@kitbag/router 0.14.0 → 0.14.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,14 +1,14 @@
1
- var ln = Object.defineProperty;
2
- var hn = (e, t, n) => t in e ? ln(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var M = (e, t, n) => hn(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { inject as ae, toRefs as pn, computed as N, reactive as Ue, defineComponent as se, h as Z, ref as Oe, markRaw as ve, watch as Re, defineAsyncComponent as dn, toValue as T, openBlock as yt, createElementBlock as mn, normalizeClass as yn, renderSlot as gt, normalizeProps as vt, guardReactiveProps as gn, unref as ue, getCurrentInstance as vn, resolveComponent as Rn, provide as wn, mergeProps as Pn, createBlock as En, resolveDynamicComponent as bn, createCommentVNode as Sn, onUnmounted as Rt } from "vue";
1
+ var lr = Object.defineProperty;
2
+ var hr = (e, t, r) => t in e ? lr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var T = (e, t, r) => hr(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import { inject as ae, toRefs as pr, computed as N, reactive as xe, defineComponent as se, h as Z, ref as qe, markRaw as ye, watch as ge, defineAsyncComponent as dr, toValue as $, openBlock as vt, createElementBlock as mr, normalizeClass as yr, renderSlot as Rt, normalizeProps as wt, guardReactiveProps as gr, unref as ue, getCurrentInstance as vr, resolveComponent as Rr, provide as wr, mergeProps as Pr, createBlock as Er, resolveDynamicComponent as br, createCommentVNode as Sr, onUnmounted as Pt } from "vue";
5
5
  function I(e) {
6
6
  return typeof e != "string" ? !1 : /^(https?:\/\/|\/).*/g.test(e);
7
7
  }
8
- function wt(e) {
8
+ function Et(e) {
9
9
  return I(e) ? e : `/${e}`;
10
10
  }
11
- class kn extends Error {
11
+ class kr extends Error {
12
12
  /**
13
13
  * Constructs a new DuplicateParamsError instance with a message indicating the problematic parameter.
14
14
  * @param paramName - The name of the parameter that was duplicated.
@@ -17,7 +17,7 @@ class kn extends Error {
17
17
  super(`Invalid Param "${t}": Router does not support multiple params by the same name. All param names must be unique.`);
18
18
  }
19
19
  }
20
- class An extends Error {
20
+ class Ar extends Error {
21
21
  constructor(t) {
22
22
  super(`Child property on meta for ${t} conflicts with the parent meta.`);
23
23
  }
@@ -27,20 +27,20 @@ class pe extends Error {
27
27
  super("Router not installed");
28
28
  }
29
29
  }
30
- class xn extends Error {
30
+ class xr extends Error {
31
31
  /**
32
32
  * Constructs a new UseRouteInvalidError instance with a message that specifies both the given and expected route names.
33
33
  * This detailed error message aids in quickly identifying and resolving mismatches in route usage.
34
34
  * @param routeName - The route name that was incorrectly used.
35
35
  * @param actualRouteName - The expected route name that should have been used.
36
36
  */
37
- constructor(t, n) {
38
- super(`useRoute called with incorrect route. Given ${t}, expected ${n}`);
37
+ constructor(t, r) {
38
+ super(`useRoute called with incorrect route. Given ${t}, expected ${r}`);
39
39
  }
40
40
  }
41
- const Pt = Symbol();
42
- function qe() {
43
- const e = ae(Pt);
41
+ const bt = Symbol();
42
+ function _e() {
43
+ const e = ae(bt);
44
44
  if (!e)
45
45
  throw new pe();
46
46
  return e;
@@ -48,81 +48,81 @@ function qe() {
48
48
  function de(e) {
49
49
  return typeof e == "object" && e !== null && !Array.isArray(e);
50
50
  }
51
- function Ln(e) {
51
+ function Ur(e) {
52
52
  return e.every((t) => Array.isArray(t));
53
53
  }
54
- function me(e) {
54
+ function F(e) {
55
55
  return typeof e == "string" && e.length > 0;
56
56
  }
57
- function we(e) {
57
+ function ve(e) {
58
58
  return {
59
- value: me(e) ? e.replace(/^#*/, "") : void 0
59
+ value: F(e) ? e.replace(/^#*/, "") : void 0
60
60
  };
61
61
  }
62
- function Un(e, t) {
63
- return we(`${e.value ?? ""}${t.value ?? ""}`);
62
+ function Lr(e, t) {
63
+ return ve(`${e.value ?? ""}${t.value ?? ""}`);
64
64
  }
65
- function Cn(e, t) {
66
- return Bn(e, t), { ...e, ...t };
65
+ function Cr(e, t) {
66
+ return Br(e, t), { ...e, ...t };
67
67
  }
68
- function Bn(e, t) {
69
- const n = Object.keys(e).find((r) => r in t && typeof t[r] != typeof e[r]);
70
- if (n)
71
- throw new An(n);
68
+ function Br(e, t) {
69
+ const r = Object.keys(e).find((n) => n in t && typeof t[n] != typeof e[n]);
70
+ if (r)
71
+ throw new Ar(r);
72
72
  }
73
73
  function ee(e) {
74
74
  return Array.isArray(e) ? e : [e];
75
75
  }
76
- function Et(e, t) {
77
- return e.filter((n) => t === n).length;
76
+ function St(e, t) {
77
+ return e.filter((r) => t === r).length;
78
78
  }
79
79
  function ce(...e) {
80
- const t = e.flatMap((n) => Array.isArray(n) ? n : Object.keys(n).map(Nn));
81
- for (const n of t)
82
- if (Et(t, n) > 1)
83
- throw new kn(n);
80
+ const t = e.flatMap((r) => Array.isArray(r) ? r : Object.keys(r).map(Nr));
81
+ for (const r of t)
82
+ if (St(t, r) > 1)
83
+ throw new kr(r);
84
84
  }
85
- function Nn(e) {
85
+ function Nr(e) {
86
86
  return e.startsWith("?") ? e.slice(1) : e;
87
87
  }
88
- function Vn(e, t) {
88
+ function Vr(e, t) {
89
89
  return ce(e.params, t.params), {
90
90
  value: `${e.value}${t.value}`,
91
91
  params: { ...e.params, ...t.params }
92
92
  };
93
93
  }
94
- function Hn(e, t) {
94
+ function Hr(e, t) {
95
95
  return ce(e.params, t.params), {
96
- value: [e.value, t.value].filter(me).join("&"),
96
+ value: [e.value, t.value].filter(F).join("&"),
97
97
  params: { ...e.params, ...t.params }
98
98
  };
99
99
  }
100
- function jn(e, t) {
100
+ function jr(e, t) {
101
101
  return ce(e, t), { ...e, ...t };
102
102
  }
103
- function $n(e) {
103
+ function $r(e) {
104
104
  return "host" in e && !!e.host;
105
105
  }
106
- function bt(e) {
106
+ function kt(e) {
107
107
  return "parent" in e && !!e.parent;
108
108
  }
109
- function _e(e) {
109
+ function Me(e) {
110
110
  return "component" in e && !!e.component;
111
111
  }
112
112
  function We(e) {
113
113
  return "components" in e && !!e.components;
114
114
  }
115
- function On(e) {
115
+ function qr(e) {
116
116
  return "state" in e && !!e.state;
117
117
  }
118
- function St(e, t) {
118
+ function At(e, t) {
119
119
  return {
120
120
  ...t,
121
- path: Vn(e.path, t.path),
122
- query: Hn(e.query, t.query),
123
- meta: Cn(e.meta, t.meta),
124
- state: jn(e.state, t.state),
125
- hash: Un(e.hash, t.hash),
121
+ path: Vr(e.path, t.path),
122
+ query: Hr(e.query, t.query),
123
+ meta: Cr(e.meta, t.meta),
124
+ state: jr(e.state, t.state),
125
+ hash: Lr(e.hash, t.hash),
126
126
  matches: [...e.matches, t.matched],
127
127
  host: e.host,
128
128
  depth: e.depth + 1
@@ -133,37 +133,37 @@ function De() {
133
133
  }
134
134
  class ie extends Error {
135
135
  }
136
- const F = "[", K = "]";
137
- function qn(e) {
136
+ const J = "[", K = "]";
137
+ function _r(e) {
138
138
  return e !== String && e !== Boolean && e !== Number && e !== Date;
139
139
  }
140
- function _n(e) {
141
- return typeof e == "function" && qn(e);
140
+ function Mr(e) {
141
+ return typeof e == "function" && _r(e);
142
142
  }
143
- function Ce(e) {
143
+ function Ue(e) {
144
144
  return typeof e == "object" && "get" in e && typeof e.get == "function" && "set" in e && typeof e.set == "function";
145
145
  }
146
- function Wn(e) {
147
- return Ce(e) && e.defaultValue !== void 0;
146
+ function Wr(e) {
147
+ return Ue(e) && e.defaultValue !== void 0;
148
148
  }
149
- function so(e, t) {
150
- return Tn(e, t);
149
+ function fo(e, t) {
150
+ return Tr(e, t);
151
151
  }
152
- function Dn(e, t) {
152
+ function Dr(e, t) {
153
153
  return e[t] ?? String;
154
154
  }
155
- const _ = {
155
+ const q = {
156
156
  invalid: (e) => {
157
157
  throw new ie(e);
158
158
  }
159
- }, Mn = {
159
+ }, Or = {
160
160
  get: (e) => e,
161
161
  set: (e, { invalid: t }) => {
162
162
  if (typeof e != "string")
163
163
  throw t();
164
164
  return e;
165
165
  }
166
- }, kt = {
166
+ }, xt = {
167
167
  get: (e, { invalid: t }) => {
168
168
  if (e === "true")
169
169
  return !0;
@@ -176,31 +176,31 @@ const _ = {
176
176
  throw t();
177
177
  return e.toString();
178
178
  }
179
- }, At = {
179
+ }, Ut = {
180
180
  get: (e, { invalid: t }) => {
181
- const n = Number(e);
182
- if (isNaN(n))
181
+ const r = Number(e);
182
+ if (isNaN(r))
183
183
  throw t();
184
- return n;
184
+ return r;
185
185
  },
186
186
  set: (e, { invalid: t }) => {
187
187
  if (typeof e != "number")
188
188
  throw t();
189
189
  return e.toString();
190
190
  }
191
- }, xt = {
191
+ }, Lt = {
192
192
  get: (e, { invalid: t }) => {
193
- const n = new Date(e);
194
- if (isNaN(n.getTime()))
193
+ const r = new Date(e);
194
+ if (isNaN(r.getTime()))
195
195
  throw t();
196
- return n;
196
+ return r;
197
197
  },
198
198
  set: (e, { invalid: t }) => {
199
199
  if (typeof e != "object" || !(e instanceof Date))
200
200
  throw t();
201
201
  return e.toISOString();
202
202
  }
203
- }, Lt = {
203
+ }, Ct = {
204
204
  get: (e, { invalid: t }) => {
205
205
  try {
206
206
  return JSON.parse(e);
@@ -216,28 +216,28 @@ const _ = {
216
216
  }
217
217
  }
218
218
  };
219
- function fe(e, t, n = !1) {
220
- if (e === void 0 || !me(e)) {
221
- if (Wn(t))
219
+ function fe(e, t, r = !1) {
220
+ if (e === void 0 || !F(e)) {
221
+ if (Wr(t))
222
222
  return t.defaultValue;
223
- if (n)
223
+ if (r)
224
224
  return;
225
225
  throw new ie();
226
226
  }
227
227
  if (t === String)
228
- return Mn.get(e, _);
228
+ return Or.get(e, q);
229
229
  if (t === Boolean)
230
- return kt.get(e, _);
230
+ return xt.get(e, q);
231
231
  if (t === Number)
232
- return At.get(e, _);
232
+ return Ut.get(e, q);
233
233
  if (t === Date)
234
- return xt.get(e, _);
234
+ return Lt.get(e, q);
235
235
  if (t === JSON)
236
- return Lt.get(e, _);
237
- if (_n(t))
238
- return t(e, _);
239
- if (Ce(t))
240
- return t.get(e, _);
236
+ return Ct.get(e, q);
237
+ if (Mr(t))
238
+ return t(e, q);
239
+ if (Ue(t))
240
+ return t.get(e, q);
241
241
  if (t instanceof RegExp) {
242
242
  if (t.test(e))
243
243
  return e;
@@ -245,50 +245,50 @@ function fe(e, t, n = !1) {
245
245
  }
246
246
  return e;
247
247
  }
248
- function le(e, t, n = !1) {
248
+ function le(e, t, r = !1) {
249
249
  if (e === void 0) {
250
- if (n)
250
+ if (r)
251
251
  return "";
252
252
  throw new ie();
253
253
  }
254
254
  if (t === Boolean)
255
- return kt.set(e, _);
255
+ return xt.set(e, q);
256
256
  if (t === Number)
257
- return At.set(e, _);
257
+ return Ut.set(e, q);
258
258
  if (t === Date)
259
- return xt.set(e, _);
259
+ return Lt.set(e, q);
260
260
  if (t === JSON)
261
- return Lt.set(e, _);
262
- if (Ce(t))
263
- return t.set(e, _);
261
+ return Ct.set(e, q);
262
+ if (Ue(t))
263
+ return t.set(e, q);
264
264
  try {
265
265
  return e.toString();
266
266
  } catch {
267
267
  throw new ie();
268
268
  }
269
269
  }
270
- function Tn(e, t) {
271
- return Ce(e) ? { ...e, defaultValue: t ?? e.defaultValue } : {
272
- get: (n) => fe(n, e),
273
- set: (n) => le(n, e),
270
+ function Tr(e, t) {
271
+ return Ue(e) ? { ...e, defaultValue: t ?? e.defaultValue } : {
272
+ get: (r) => fe(r, e),
273
+ set: (r) => le(r, e),
274
274
  defaultValue: t
275
275
  };
276
276
  }
277
277
  function G() {
278
278
  return G = Object.assign ? Object.assign.bind() : function(e) {
279
279
  for (var t = 1; t < arguments.length; t++) {
280
- var n = arguments[t];
281
- for (var r in n)
282
- Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
280
+ var r = arguments[t];
281
+ for (var n in r)
282
+ Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
283
283
  }
284
284
  return e;
285
285
  }, G.apply(this, arguments);
286
286
  }
287
- var j;
287
+ var V;
288
288
  (function(e) {
289
289
  e.Pop = "POP", e.Push = "PUSH", e.Replace = "REPLACE";
290
- })(j || (j = {}));
291
- var ne = process.env.NODE_ENV !== "production" ? function(e) {
290
+ })(V || (V = {}));
291
+ var re = process.env.NODE_ENV !== "production" ? function(e) {
292
292
  return Object.freeze(e);
293
293
  } : function(e) {
294
294
  return e;
@@ -302,36 +302,36 @@ function Y(e, t) {
302
302
  }
303
303
  }
304
304
  }
305
- var Pe = "beforeunload", In = "hashchange", Ut = "popstate";
306
- function rt(e) {
305
+ var Re = "beforeunload", Ir = "hashchange", Bt = "popstate";
306
+ function st(e) {
307
307
  e === void 0 && (e = {});
308
- var t = e, n = t.window, r = n === void 0 ? document.defaultView : n, o = r.history;
308
+ var t = e, r = t.window, n = r === void 0 ? document.defaultView : r, o = n.history;
309
309
  function a() {
310
- var g = r.location, l = g.pathname, y = g.search, S = g.hash, k = o.state || {};
311
- return [k.idx, ne({
310
+ var g = n.location, l = g.pathname, y = g.search, S = g.hash, A = o.state || {};
311
+ return [A.idx, re({
312
312
  pathname: l,
313
313
  search: y,
314
314
  hash: S,
315
- state: k.usr || null,
316
- key: k.key || "default"
315
+ state: A.usr || null,
316
+ key: A.key || "default"
317
317
  })];
318
318
  }
319
- var c = null;
320
- function s() {
321
- if (c)
322
- h.call(c), c = null;
319
+ var s = null;
320
+ function c() {
321
+ if (s)
322
+ p.call(s), s = null;
323
323
  else {
324
- var g = j.Pop, l = a(), y = l[0], S = l[1];
325
- if (h.length)
324
+ var g = V.Pop, l = a(), y = l[0], S = l[1];
325
+ if (p.length)
326
326
  if (y != null) {
327
- var k = f - y;
328
- k && (c = {
327
+ var A = f - y;
328
+ A && (s = {
329
329
  action: g,
330
330
  location: S,
331
331
  retry: function() {
332
- L(k * -1);
332
+ x(A * -1);
333
333
  }
334
- }, L(k));
334
+ }, x(A));
335
335
  } else
336
336
  process.env.NODE_ENV !== "production" && Y(
337
337
  !1,
@@ -341,135 +341,135 @@ function rt(e) {
341
341
  "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."
342
342
  );
343
343
  else
344
- A(g);
344
+ k(g);
345
345
  }
346
346
  }
347
- r.addEventListener(Ut, s);
348
- var u = j.Pop, i = a(), f = i[0], p = i[1], P = re(), h = re();
347
+ n.addEventListener(Bt, c);
348
+ var i = V.Pop, u = a(), f = u[0], d = u[1], P = ne(), p = ne();
349
349
  f == null && (f = 0, o.replaceState(G({}, o.state, {
350
350
  idx: f
351
351
  }), ""));
352
- function m(g) {
352
+ function h(g) {
353
353
  return typeof g == "string" ? g : X(g);
354
354
  }
355
355
  function v(g, l) {
356
- return l === void 0 && (l = null), ne(G({
357
- pathname: p.pathname,
356
+ return l === void 0 && (l = null), re(G({
357
+ pathname: d.pathname,
358
358
  hash: "",
359
359
  search: ""
360
360
  }, typeof g == "string" ? he(g) : g, {
361
361
  state: l,
362
- key: be()
362
+ key: Pe()
363
363
  }));
364
364
  }
365
- function w(g, l) {
365
+ function R(g, l) {
366
366
  return [{
367
367
  usr: g.state,
368
368
  key: g.key,
369
369
  idx: l
370
- }, m(g)];
370
+ }, h(g)];
371
371
  }
372
- function R(g, l, y) {
373
- return !h.length || (h.call({
372
+ function E(g, l, y) {
373
+ return !p.length || (p.call({
374
374
  action: g,
375
375
  location: l,
376
376
  retry: y
377
377
  }), !1);
378
378
  }
379
- function A(g) {
380
- u = g;
379
+ function k(g) {
380
+ i = g;
381
381
  var l = a();
382
- f = l[0], p = l[1], P.call({
383
- action: u,
384
- location: p
382
+ f = l[0], d = l[1], P.call({
383
+ action: i,
384
+ location: d
385
385
  });
386
386
  }
387
- function d(g, l) {
388
- var y = j.Push, S = v(g, l);
389
- function k() {
390
- d(g, l);
387
+ function m(g, l) {
388
+ var y = V.Push, S = v(g, l);
389
+ function A() {
390
+ m(g, l);
391
391
  }
392
- if (R(y, S, k)) {
393
- var U = w(S, f + 1), C = U[0], O = U[1];
392
+ if (E(y, S, A)) {
393
+ var C = R(S, f + 1), B = C[0], H = C[1];
394
394
  try {
395
- o.pushState(C, "", O);
395
+ o.pushState(B, "", H);
396
396
  } catch {
397
- r.location.assign(O);
397
+ n.location.assign(H);
398
398
  }
399
- A(y);
399
+ k(y);
400
400
  }
401
401
  }
402
- function b(g, l) {
403
- var y = j.Replace, S = v(g, l);
404
- function k() {
405
- b(g, l);
402
+ function w(g, l) {
403
+ var y = V.Replace, S = v(g, l);
404
+ function A() {
405
+ w(g, l);
406
406
  }
407
- if (R(y, S, k)) {
408
- var U = w(S, f), C = U[0], O = U[1];
409
- o.replaceState(C, "", O), A(y);
407
+ if (E(y, S, A)) {
408
+ var C = R(S, f), B = C[0], H = C[1];
409
+ o.replaceState(B, "", H), k(y);
410
410
  }
411
411
  }
412
- function L(g) {
412
+ function x(g) {
413
413
  o.go(g);
414
414
  }
415
- var x = {
415
+ var U = {
416
416
  get action() {
417
- return u;
417
+ return i;
418
418
  },
419
419
  get location() {
420
- return p;
420
+ return d;
421
421
  },
422
- createHref: m,
423
- push: d,
424
- replace: b,
425
- go: L,
422
+ createHref: h,
423
+ push: m,
424
+ replace: w,
425
+ go: x,
426
426
  back: function() {
427
- L(-1);
427
+ x(-1);
428
428
  },
429
429
  forward: function() {
430
- L(1);
430
+ x(1);
431
431
  },
432
432
  listen: function(l) {
433
433
  return P.push(l);
434
434
  },
435
435
  block: function(l) {
436
- var y = h.push(l);
437
- return h.length === 1 && r.addEventListener(Pe, Ee), function() {
438
- y(), h.length || r.removeEventListener(Pe, Ee);
436
+ var y = p.push(l);
437
+ return p.length === 1 && n.addEventListener(Re, we), function() {
438
+ y(), p.length || n.removeEventListener(Re, we);
439
439
  };
440
440
  }
441
441
  };
442
- return x;
442
+ return U;
443
443
  }
444
- function Fn(e) {
444
+ function Fr(e) {
445
445
  e === void 0 && (e = {});
446
- var t = e, n = t.window, r = n === void 0 ? document.defaultView : n, o = r.history;
446
+ var t = e, r = t.window, n = r === void 0 ? document.defaultView : r, o = n.history;
447
447
  function a() {
448
- var l = he(r.location.hash.substr(1)), y = l.pathname, S = y === void 0 ? "/" : y, k = l.search, U = k === void 0 ? "" : k, C = l.hash, O = C === void 0 ? "" : C, W = o.state || {};
449
- return [W.idx, ne({
448
+ var l = he(n.location.hash.substr(1)), y = l.pathname, S = y === void 0 ? "/" : y, A = l.search, C = A === void 0 ? "" : A, B = l.hash, H = B === void 0 ? "" : B, M = o.state || {};
449
+ return [M.idx, re({
450
450
  pathname: S,
451
- search: U,
452
- hash: O,
453
- state: W.usr || null,
454
- key: W.key || "default"
451
+ search: C,
452
+ hash: H,
453
+ state: M.usr || null,
454
+ key: M.key || "default"
455
455
  })];
456
456
  }
457
- var c = null;
458
- function s() {
459
- if (c)
460
- h.call(c), c = null;
457
+ var s = null;
458
+ function c() {
459
+ if (s)
460
+ p.call(s), s = null;
461
461
  else {
462
- var l = j.Pop, y = a(), S = y[0], k = y[1];
463
- if (h.length)
462
+ var l = V.Pop, y = a(), S = y[0], A = y[1];
463
+ if (p.length)
464
464
  if (S != null) {
465
- var U = f - S;
466
- U && (c = {
465
+ var C = f - S;
466
+ C && (s = {
467
467
  action: l,
468
- location: k,
468
+ location: A,
469
469
  retry: function() {
470
- x(U * -1);
470
+ U(C * -1);
471
471
  }
472
- }, x(U));
472
+ }, U(C));
473
473
  } else
474
474
  process.env.NODE_ENV !== "production" && Y(
475
475
  !1,
@@ -479,540 +479,540 @@ function Fn(e) {
479
479
  "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."
480
480
  );
481
481
  else
482
- d(l);
482
+ m(l);
483
483
  }
484
484
  }
485
- r.addEventListener(Ut, s), r.addEventListener(In, function() {
485
+ n.addEventListener(Bt, c), n.addEventListener(Ir, function() {
486
486
  var l = a(), y = l[1];
487
- X(y) !== X(p) && s();
487
+ X(y) !== X(d) && c();
488
488
  });
489
- var u = j.Pop, i = a(), f = i[0], p = i[1], P = re(), h = re();
489
+ var i = V.Pop, u = a(), f = u[0], d = u[1], P = ne(), p = ne();
490
490
  f == null && (f = 0, o.replaceState(G({}, o.state, {
491
491
  idx: f
492
492
  }), ""));
493
- function m() {
493
+ function h() {
494
494
  var l = document.querySelector("base"), y = "";
495
495
  if (l && l.getAttribute("href")) {
496
- var S = r.location.href, k = S.indexOf("#");
497
- y = k === -1 ? S : S.slice(0, k);
496
+ var S = n.location.href, A = S.indexOf("#");
497
+ y = A === -1 ? S : S.slice(0, A);
498
498
  }
499
499
  return y;
500
500
  }
501
501
  function v(l) {
502
- return m() + "#" + (typeof l == "string" ? l : X(l));
502
+ return h() + "#" + (typeof l == "string" ? l : X(l));
503
503
  }
504
- function w(l, y) {
505
- return y === void 0 && (y = null), ne(G({
506
- pathname: p.pathname,
504
+ function R(l, y) {
505
+ return y === void 0 && (y = null), re(G({
506
+ pathname: d.pathname,
507
507
  hash: "",
508
508
  search: ""
509
509
  }, typeof l == "string" ? he(l) : l, {
510
510
  state: y,
511
- key: be()
511
+ key: Pe()
512
512
  }));
513
513
  }
514
- function R(l, y) {
514
+ function E(l, y) {
515
515
  return [{
516
516
  usr: l.state,
517
517
  key: l.key,
518
518
  idx: y
519
519
  }, v(l)];
520
520
  }
521
- function A(l, y, S) {
522
- return !h.length || (h.call({
521
+ function k(l, y, S) {
522
+ return !p.length || (p.call({
523
523
  action: l,
524
524
  location: y,
525
525
  retry: S
526
526
  }), !1);
527
527
  }
528
- function d(l) {
529
- u = l;
528
+ function m(l) {
529
+ i = l;
530
530
  var y = a();
531
- f = y[0], p = y[1], P.call({
532
- action: u,
533
- location: p
531
+ f = y[0], d = y[1], P.call({
532
+ action: i,
533
+ location: d
534
534
  });
535
535
  }
536
- function b(l, y) {
537
- var S = j.Push, k = w(l, y);
538
- function U() {
539
- b(l, y);
536
+ function w(l, y) {
537
+ var S = V.Push, A = R(l, y);
538
+ function C() {
539
+ w(l, y);
540
540
  }
541
- if (process.env.NODE_ENV !== "production" && Y(k.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.push(" + JSON.stringify(l) + ")"), A(S, k, U)) {
542
- var C = R(k, f + 1), O = C[0], W = C[1];
541
+ if (process.env.NODE_ENV !== "production" && Y(A.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.push(" + JSON.stringify(l) + ")"), k(S, A, C)) {
542
+ var B = E(A, f + 1), H = B[0], M = B[1];
543
543
  try {
544
- o.pushState(O, "", W);
544
+ o.pushState(H, "", M);
545
545
  } catch {
546
- r.location.assign(W);
546
+ n.location.assign(M);
547
547
  }
548
- d(S);
548
+ m(S);
549
549
  }
550
550
  }
551
- function L(l, y) {
552
- var S = j.Replace, k = w(l, y);
553
- function U() {
554
- L(l, y);
551
+ function x(l, y) {
552
+ var S = V.Replace, A = R(l, y);
553
+ function C() {
554
+ x(l, y);
555
555
  }
556
- if (process.env.NODE_ENV !== "production" && Y(k.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(l) + ")"), A(S, k, U)) {
557
- var C = R(k, f), O = C[0], W = C[1];
558
- o.replaceState(O, "", W), d(S);
556
+ if (process.env.NODE_ENV !== "production" && Y(A.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(l) + ")"), k(S, A, C)) {
557
+ var B = E(A, f), H = B[0], M = B[1];
558
+ o.replaceState(H, "", M), m(S);
559
559
  }
560
560
  }
561
- function x(l) {
561
+ function U(l) {
562
562
  o.go(l);
563
563
  }
564
564
  var g = {
565
565
  get action() {
566
- return u;
566
+ return i;
567
567
  },
568
568
  get location() {
569
- return p;
569
+ return d;
570
570
  },
571
571
  createHref: v,
572
- push: b,
573
- replace: L,
574
- go: x,
572
+ push: w,
573
+ replace: x,
574
+ go: U,
575
575
  back: function() {
576
- x(-1);
576
+ U(-1);
577
577
  },
578
578
  forward: function() {
579
- x(1);
579
+ U(1);
580
580
  },
581
581
  listen: function(y) {
582
582
  return P.push(y);
583
583
  },
584
584
  block: function(y) {
585
- var S = h.push(y);
586
- return h.length === 1 && r.addEventListener(Pe, Ee), function() {
587
- S(), h.length || r.removeEventListener(Pe, Ee);
585
+ var S = p.push(y);
586
+ return p.length === 1 && n.addEventListener(Re, we), function() {
587
+ S(), p.length || n.removeEventListener(Re, we);
588
588
  };
589
589
  }
590
590
  };
591
591
  return g;
592
592
  }
593
- function ot(e) {
593
+ function ct(e) {
594
594
  e === void 0 && (e = {});
595
- var t = e, n = t.initialEntries, r = n === void 0 ? ["/"] : n, o = t.initialIndex, a = r.map(function(d) {
596
- var b = ne(G({
595
+ var t = e, r = t.initialEntries, n = r === void 0 ? ["/"] : r, o = t.initialIndex, a = n.map(function(m) {
596
+ var w = re(G({
597
597
  pathname: "/",
598
598
  search: "",
599
599
  hash: "",
600
600
  state: null,
601
- key: be()
602
- }, typeof d == "string" ? he(d) : d));
603
- return process.env.NODE_ENV !== "production" && Y(b.pathname.charAt(0) === "/", "Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: " + JSON.stringify(d) + ")"), b;
604
- }), c = at(o ?? a.length - 1, 0, a.length - 1), s = j.Pop, u = a[c], i = re(), f = re();
605
- function p(d) {
606
- return typeof d == "string" ? d : X(d);
607
- }
608
- function P(d, b) {
609
- return b === void 0 && (b = null), ne(G({
610
- pathname: u.pathname,
601
+ key: Pe()
602
+ }, typeof m == "string" ? he(m) : m));
603
+ return process.env.NODE_ENV !== "production" && Y(w.pathname.charAt(0) === "/", "Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: " + JSON.stringify(m) + ")"), w;
604
+ }), s = ut(o ?? a.length - 1, 0, a.length - 1), c = V.Pop, i = a[s], u = ne(), f = ne();
605
+ function d(m) {
606
+ return typeof m == "string" ? m : X(m);
607
+ }
608
+ function P(m, w) {
609
+ return w === void 0 && (w = null), re(G({
610
+ pathname: i.pathname,
611
611
  search: "",
612
612
  hash: ""
613
- }, typeof d == "string" ? he(d) : d, {
614
- state: b,
615
- key: be()
613
+ }, typeof m == "string" ? he(m) : m, {
614
+ state: w,
615
+ key: Pe()
616
616
  }));
617
617
  }
618
- function h(d, b, L) {
618
+ function p(m, w, x) {
619
619
  return !f.length || (f.call({
620
- action: d,
621
- location: b,
622
- retry: L
620
+ action: m,
621
+ location: w,
622
+ retry: x
623
623
  }), !1);
624
624
  }
625
- function m(d, b) {
626
- s = d, u = b, i.call({
627
- action: s,
628
- location: u
625
+ function h(m, w) {
626
+ c = m, i = w, u.call({
627
+ action: c,
628
+ location: i
629
629
  });
630
630
  }
631
- function v(d, b) {
632
- var L = j.Push, x = P(d, b);
631
+ function v(m, w) {
632
+ var x = V.Push, U = P(m, w);
633
633
  function g() {
634
- v(d, b);
634
+ v(m, w);
635
635
  }
636
- process.env.NODE_ENV !== "production" && Y(u.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.push(" + JSON.stringify(d) + ")"), h(L, x, g) && (c += 1, a.splice(c, a.length, x), m(L, x));
636
+ process.env.NODE_ENV !== "production" && Y(i.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.push(" + JSON.stringify(m) + ")"), p(x, U, g) && (s += 1, a.splice(s, a.length, U), h(x, U));
637
637
  }
638
- function w(d, b) {
639
- var L = j.Replace, x = P(d, b);
638
+ function R(m, w) {
639
+ var x = V.Replace, U = P(m, w);
640
640
  function g() {
641
- w(d, b);
641
+ R(m, w);
642
642
  }
643
- process.env.NODE_ENV !== "production" && Y(u.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.replace(" + JSON.stringify(d) + ")"), h(L, x, g) && (a[c] = x, m(L, x));
643
+ process.env.NODE_ENV !== "production" && Y(i.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.replace(" + JSON.stringify(m) + ")"), p(x, U, g) && (a[s] = U, h(x, U));
644
644
  }
645
- function R(d) {
646
- var b = at(c + d, 0, a.length - 1), L = j.Pop, x = a[b];
645
+ function E(m) {
646
+ var w = ut(s + m, 0, a.length - 1), x = V.Pop, U = a[w];
647
647
  function g() {
648
- R(d);
648
+ E(m);
649
649
  }
650
- h(L, x, g) && (c = b, m(L, x));
650
+ p(x, U, g) && (s = w, h(x, U));
651
651
  }
652
- var A = {
652
+ var k = {
653
653
  get index() {
654
- return c;
654
+ return s;
655
655
  },
656
656
  get action() {
657
- return s;
657
+ return c;
658
658
  },
659
659
  get location() {
660
- return u;
660
+ return i;
661
661
  },
662
- createHref: p,
662
+ createHref: d,
663
663
  push: v,
664
- replace: w,
665
- go: R,
664
+ replace: R,
665
+ go: E,
666
666
  back: function() {
667
- R(-1);
667
+ E(-1);
668
668
  },
669
669
  forward: function() {
670
- R(1);
670
+ E(1);
671
671
  },
672
- listen: function(b) {
673
- return i.push(b);
672
+ listen: function(w) {
673
+ return u.push(w);
674
674
  },
675
- block: function(b) {
676
- return f.push(b);
675
+ block: function(w) {
676
+ return f.push(w);
677
677
  }
678
678
  };
679
- return A;
679
+ return k;
680
680
  }
681
- function at(e, t, n) {
682
- return Math.min(Math.max(e, t), n);
681
+ function ut(e, t, r) {
682
+ return Math.min(Math.max(e, t), r);
683
683
  }
684
- function Ee(e) {
684
+ function we(e) {
685
685
  e.preventDefault(), e.returnValue = "";
686
686
  }
687
- function re() {
687
+ function ne() {
688
688
  var e = [];
689
689
  return {
690
690
  get length() {
691
691
  return e.length;
692
692
  },
693
- push: function(n) {
694
- return e.push(n), function() {
695
- e = e.filter(function(r) {
696
- return r !== n;
693
+ push: function(r) {
694
+ return e.push(r), function() {
695
+ e = e.filter(function(n) {
696
+ return n !== r;
697
697
  });
698
698
  };
699
699
  },
700
- call: function(n) {
701
- e.forEach(function(r) {
702
- return r && r(n);
700
+ call: function(r) {
701
+ e.forEach(function(n) {
702
+ return n && n(r);
703
703
  });
704
704
  }
705
705
  };
706
706
  }
707
- function be() {
707
+ function Pe() {
708
708
  return Math.random().toString(36).substr(2, 8);
709
709
  }
710
710
  function X(e) {
711
- var t = e.pathname, n = t === void 0 ? "/" : t, r = e.search, o = r === void 0 ? "" : r, a = e.hash, c = a === void 0 ? "" : a;
712
- return o && o !== "?" && (n += o.charAt(0) === "?" ? o : "?" + o), c && c !== "#" && (n += c.charAt(0) === "#" ? c : "#" + c), n;
711
+ var t = e.pathname, r = t === void 0 ? "/" : t, n = e.search, o = n === void 0 ? "" : n, a = e.hash, s = a === void 0 ? "" : a;
712
+ return o && o !== "?" && (r += o.charAt(0) === "?" ? o : "?" + o), s && s !== "#" && (r += s.charAt(0) === "#" ? s : "#" + s), r;
713
713
  }
714
714
  function he(e) {
715
715
  var t = {};
716
716
  if (e) {
717
- var n = e.indexOf("#");
718
- n >= 0 && (t.hash = e.substr(n), e = e.substr(0, n));
719
- var r = e.indexOf("?");
720
- r >= 0 && (t.search = e.substr(r), e = e.substr(0, r)), e && (t.pathname = e);
717
+ var r = e.indexOf("#");
718
+ r >= 0 && (t.hash = e.substr(r), e = e.substr(0, r));
719
+ var n = e.indexOf("?");
720
+ n >= 0 && (t.search = e.substr(n), e = e.substr(0, n)), e && (t.pathname = e);
721
721
  }
722
722
  return t;
723
723
  }
724
- const Ct = Symbol();
725
- function Jn() {
726
- const e = ae(Ct);
724
+ const Nt = Symbol();
725
+ function Jr() {
726
+ const e = ae(Nt);
727
727
  if (!e)
728
728
  throw new pe();
729
729
  return e;
730
730
  }
731
- const Bt = Symbol("isRouterRouteSymbol");
732
- function Qn(e) {
733
- return typeof e == "object" && e !== null && Bt in e;
731
+ const Vt = Symbol("isRouterRouteSymbol");
732
+ function Qr(e) {
733
+ return typeof e == "object" && e !== null && Vt in e;
734
734
  }
735
- function Gn(e, t) {
736
- function n(w, R, A) {
737
- if (typeof w == "object") {
738
- const b = {
735
+ function zr(e, t) {
736
+ function r(R, E, k) {
737
+ if (typeof R == "object") {
738
+ const w = {
739
739
  ...e.params,
740
- ...w
740
+ ...R
741
741
  };
742
- return t(e.name, b, R);
742
+ return t(e.name, w, E);
743
743
  }
744
- const d = {
744
+ const m = {
745
745
  ...e.params,
746
- [w]: R
746
+ [R]: E
747
747
  };
748
- return t(e.name, d, A);
749
- }
750
- const r = (...w) => {
751
- const R = new URLSearchParams(e.query.toString());
752
- R.set(...w), n({}, { query: R });
753
- }, o = (...w) => {
754
- const R = new URLSearchParams(e.query.toString());
755
- R.append(...w), n({}, { query: R });
756
- }, a = (...w) => {
757
- const R = new URLSearchParams(e.query.toString());
758
- R.delete(...w), n({}, { query: R });
759
- }, { id: c, matched: s, matches: u, name: i, hash: f, href: p } = pn(e), P = N({
748
+ return t(e.name, m, k);
749
+ }
750
+ const n = (...R) => {
751
+ const E = new URLSearchParams(e.query);
752
+ E.set(...R), r({}, { query: E });
753
+ }, o = (...R) => {
754
+ const E = new URLSearchParams(e.query);
755
+ E.append(...R), r({}, { query: E });
756
+ }, a = (...R) => {
757
+ const E = new URLSearchParams(e.query);
758
+ E.delete(...R), r({}, { query: E });
759
+ }, { id: s, matched: c, matches: i, name: u, hash: f, href: d } = pr(e), P = N({
760
760
  get() {
761
761
  return new Proxy(e.params, {
762
- set(w, R, A) {
763
- return n(R, A), !0;
762
+ set(R, E, k) {
763
+ return r(E, k), !0;
764
764
  }
765
765
  });
766
766
  },
767
- set(w) {
768
- n(w);
767
+ set(R) {
768
+ r(R);
769
769
  }
770
- }), h = N({
770
+ }), p = N({
771
771
  get() {
772
772
  return new Proxy(e.query, {
773
- get(w, R, A) {
774
- switch (R) {
773
+ get(R, E, k) {
774
+ switch (E) {
775
775
  case "append":
776
776
  return o;
777
777
  case "set":
778
- return r;
778
+ return n;
779
779
  case "delete":
780
780
  return a;
781
781
  default:
782
- return Reflect.get(w, R, A);
782
+ return Reflect.get(R, E, k);
783
783
  }
784
784
  }
785
785
  });
786
786
  },
787
- set(w) {
788
- n({}, { query: w });
787
+ set(R) {
788
+ r({}, { query: R });
789
789
  }
790
- }), m = N({
790
+ }), h = N({
791
791
  get() {
792
792
  return new Proxy(e.state, {
793
- set(w, R, A) {
794
- return n({}, { state: { ...e.state, [R]: A } }), !0;
793
+ set(R, E, k) {
794
+ return r({}, { state: { ...e.state, [E]: k } }), !0;
795
795
  }
796
796
  });
797
797
  },
798
- set(w) {
799
- n({}, { state: w });
798
+ set(R) {
799
+ r({}, { state: R });
800
800
  }
801
801
  });
802
- return Ue({
803
- id: c,
804
- matched: s,
805
- matches: u,
806
- state: m,
807
- query: h,
802
+ return xe({
803
+ id: s,
804
+ matched: c,
805
+ matches: i,
806
+ state: h,
807
+ query: p,
808
808
  hash: f,
809
809
  params: P,
810
- name: i,
811
- href: p,
812
- update: n,
813
- [Bt]: !0
810
+ name: u,
811
+ href: d,
812
+ update: r,
813
+ [Vt]: !0
814
814
  });
815
815
  }
816
- const Nt = Symbol();
817
- function Kn(e, t) {
818
- const n = Ue({ ...e }), r = (c) => {
819
- Object.assign(n, {
820
- [Nt]: !1,
821
- ...c
816
+ const Ht = Symbol();
817
+ function Gr(e, t) {
818
+ const r = xe({ ...e }), n = (s) => {
819
+ Object.assign(r, {
820
+ [Ht]: !1,
821
+ ...s
822
822
  });
823
- }, o = n, a = Gn(o, t);
823
+ }, o = r, a = zr(o, t);
824
824
  return {
825
825
  currentRoute: o,
826
826
  routerRoute: a,
827
- updateRoute: r
827
+ updateRoute: n
828
828
  };
829
829
  }
830
- function D(e) {
831
- return !e.startsWith("http") ? Yn(e) : zn(e);
830
+ function _(e) {
831
+ return !e.startsWith("http") ? Yr(e) : Kr(e);
832
832
  }
833
- function zn(e) {
834
- const { protocol: t, host: n, pathname: r, search: o, searchParams: a, hash: c } = new URL(e, e);
833
+ function Kr(e) {
834
+ const { protocol: t, host: r, pathname: n, search: o, searchParams: a, hash: s } = new URL(e, e);
835
835
  return {
836
836
  protocol: t,
837
- host: n,
838
- pathname: r,
837
+ host: r,
838
+ pathname: n,
839
839
  search: o,
840
840
  searchParams: a,
841
- hash: c
841
+ hash: s
842
842
  };
843
843
  }
844
- function Yn(e) {
845
- const { pathname: t, search: n, searchParams: r, hash: o } = new URL(e, "https://localhost");
844
+ function Yr(e) {
845
+ const { pathname: t, search: r, searchParams: n, hash: o } = new URL(e, "https://localhost");
846
846
  return {
847
847
  pathname: t,
848
- search: n,
849
- searchParams: r,
848
+ search: r,
849
+ searchParams: n,
850
850
  hash: o
851
851
  };
852
852
  }
853
- function Xn(e) {
853
+ function Xr(e) {
854
854
  return (t) => {
855
- const { host: n } = D(t);
856
- return !(n === void 0 || n === e);
855
+ const { host: r } = _(t);
856
+ return !(r === void 0 || r === e);
857
857
  };
858
858
  }
859
- function Zn({ mode: e, listener: t }) {
860
- const n = er(e), r = (u, i) => {
861
- if (i != null && i.replace) {
862
- n.replace(u, i.state);
859
+ function Zr({ mode: e, listener: t }) {
860
+ const r = en(e), n = (i, u) => {
861
+ if (u != null && u.replace) {
862
+ r.replace(i, u.state);
863
863
  return;
864
864
  }
865
- n.push(u, i == null ? void 0 : i.state);
865
+ r.push(i, u == null ? void 0 : u.state);
866
866
  }, o = () => {
867
- const u = X(n.location);
868
- n.replace(u);
867
+ const i = X(r.location);
868
+ r.replace(i);
869
869
  };
870
870
  let a;
871
871
  return {
872
- ...n,
873
- update: r,
872
+ ...r,
873
+ update: n,
874
874
  refresh: o,
875
875
  startListening: () => {
876
- a == null || a(), a = n.listen(t);
876
+ a == null || a(), a = r.listen(t);
877
877
  },
878
878
  stopListening: () => {
879
879
  a == null || a();
880
880
  }
881
881
  };
882
882
  }
883
- function er(e = "auto") {
883
+ function en(e = "auto") {
884
884
  switch (e) {
885
885
  case "auto":
886
- return De() ? rt() : ot();
886
+ return De() ? st() : ct();
887
887
  case "browser":
888
- return rt();
888
+ return st();
889
889
  case "memory":
890
- return ot();
890
+ return ct();
891
891
  case "hash":
892
- return Fn();
892
+ return Fr();
893
893
  default:
894
894
  const t = e;
895
895
  throw new Error(`Switch is not exhaustive for mode: ${t}`);
896
896
  }
897
897
  }
898
- class Se {
898
+ class Ee {
899
899
  constructor() {
900
- M(this, "onBeforeRouteEnter", /* @__PURE__ */ new Set());
901
- M(this, "onBeforeRouteUpdate", /* @__PURE__ */ new Set());
902
- M(this, "onBeforeRouteLeave", /* @__PURE__ */ new Set());
903
- M(this, "onAfterRouteEnter", /* @__PURE__ */ new Set());
904
- M(this, "onAfterRouteUpdate", /* @__PURE__ */ new Set());
905
- M(this, "onAfterRouteLeave", /* @__PURE__ */ new Set());
900
+ T(this, "onBeforeRouteEnter", /* @__PURE__ */ new Set());
901
+ T(this, "onBeforeRouteUpdate", /* @__PURE__ */ new Set());
902
+ T(this, "onBeforeRouteLeave", /* @__PURE__ */ new Set());
903
+ T(this, "onAfterRouteEnter", /* @__PURE__ */ new Set());
904
+ T(this, "onAfterRouteUpdate", /* @__PURE__ */ new Set());
905
+ T(this, "onAfterRouteLeave", /* @__PURE__ */ new Set());
906
906
  }
907
907
  }
908
- class Vt extends Error {
908
+ class jt extends Error {
909
909
  constructor() {
910
910
  super("Uncaught CallbackContextAbortError");
911
- M(this, "response");
911
+ T(this, "response");
912
912
  this.response = { status: "ABORT" };
913
913
  }
914
914
  }
915
915
  class te extends Error {
916
- constructor(n) {
916
+ constructor(r) {
917
917
  super("Uncaught CallbackContextPushError");
918
- M(this, "response");
919
- this.response = { status: "PUSH", to: n };
918
+ T(this, "response");
919
+ this.response = { status: "PUSH", to: r };
920
920
  }
921
921
  }
922
- class ke extends Error {
923
- constructor(n) {
922
+ class be extends Error {
923
+ constructor(r) {
924
924
  super("Uncaught CallbackContextRejectionError");
925
- M(this, "response");
926
- this.response = { status: "REJECT", type: n };
927
- }
928
- }
929
- function tr(e, t) {
930
- const n = new Se();
931
- return e.matches.forEach((r, o) => {
932
- r.onBeforeRouteEnter && Me(e, t, o) && ee(r.onBeforeRouteEnter).forEach((a) => n.onBeforeRouteEnter.add(a)), r.onBeforeRouteUpdate && Ie(e, t, o) && ee(r.onBeforeRouteUpdate).forEach((a) => n.onBeforeRouteUpdate.add(a));
933
- }), t.matches.forEach((r, o) => {
934
- r.onBeforeRouteLeave && Te(e, t, o) && ee(r.onBeforeRouteLeave).forEach((a) => n.onBeforeRouteLeave.add(a));
935
- }), n;
936
- }
937
- function nr(e, t) {
938
- const n = new Se();
939
- return e.matches.forEach((r, o) => {
940
- r.onAfterRouteEnter && Me(e, t, o) && ee(r.onAfterRouteEnter).forEach((a) => n.onAfterRouteEnter.add(a)), r.onAfterRouteUpdate && Ie(e, t, o) && ee(r.onAfterRouteUpdate).forEach((a) => n.onAfterRouteUpdate.add(a));
941
- }), t.matches.forEach((r, o) => {
942
- r.onAfterRouteLeave && Te(e, t, o) && ee(r.onAfterRouteLeave).forEach((a) => n.onAfterRouteLeave.add(a));
943
- }), n;
944
- }
945
- function Ht() {
925
+ T(this, "response");
926
+ this.response = { status: "REJECT", type: r };
927
+ }
928
+ }
929
+ function tn(e, t) {
930
+ const r = new Ee();
931
+ return e.matches.forEach((n, o) => {
932
+ n.onBeforeRouteEnter && Oe(e, t, o) && ee(n.onBeforeRouteEnter).forEach((a) => r.onBeforeRouteEnter.add(a)), n.onBeforeRouteUpdate && Ie(e, t, o) && ee(n.onBeforeRouteUpdate).forEach((a) => r.onBeforeRouteUpdate.add(a));
933
+ }), t.matches.forEach((n, o) => {
934
+ n.onBeforeRouteLeave && Te(e, t, o) && ee(n.onBeforeRouteLeave).forEach((a) => r.onBeforeRouteLeave.add(a));
935
+ }), r;
936
+ }
937
+ function rn(e, t) {
938
+ const r = new Ee();
939
+ return e.matches.forEach((n, o) => {
940
+ n.onAfterRouteEnter && Oe(e, t, o) && ee(n.onAfterRouteEnter).forEach((a) => r.onAfterRouteEnter.add(a)), n.onAfterRouteUpdate && Ie(e, t, o) && ee(n.onAfterRouteUpdate).forEach((a) => r.onAfterRouteUpdate.add(a));
941
+ }), t.matches.forEach((n, o) => {
942
+ n.onAfterRouteLeave && Te(e, t, o) && ee(n.onAfterRouteLeave).forEach((a) => r.onAfterRouteLeave.add(a));
943
+ }), r;
944
+ }
945
+ function $t() {
946
946
  return { reject: (o) => {
947
- throw new ke(o);
947
+ throw new be(o);
948
948
  }, push: (...o) => {
949
949
  throw new te(o);
950
- }, replace: (o, a, c) => {
950
+ }, replace: (o, a, s) => {
951
951
  if (I(o)) {
952
- const i = a ?? {};
953
- throw new te([o, { ...i, replace: !0 }]);
952
+ const u = a ?? {};
953
+ throw new te([o, { ...u, replace: !0 }]);
954
954
  }
955
- const s = a, u = c ?? {};
956
- throw new te([o, s, { ...u, replace: !0 }]);
955
+ const c = a, i = s ?? {};
956
+ throw new te([o, c, { ...i, replace: !0 }]);
957
957
  }, abort: () => {
958
- throw new Vt();
958
+ throw new jt();
959
959
  } };
960
960
  }
961
- function rr() {
962
- const { reject: e, push: t, replace: n, abort: r } = Ht();
963
- async function o({ to: c, from: s, hooks: u }) {
964
- const { global: i, component: f } = u, p = tr(c, s), P = [
965
- ...i.onBeforeRouteEnter,
966
- ...p.onBeforeRouteEnter,
967
- ...i.onBeforeRouteUpdate,
968
- ...p.onBeforeRouteUpdate,
961
+ function nn() {
962
+ const { reject: e, push: t, replace: r, abort: n } = $t();
963
+ async function o({ to: s, from: c, hooks: i }) {
964
+ const { global: u, component: f } = i, d = tn(s, c), P = [
965
+ ...u.onBeforeRouteEnter,
966
+ ...d.onBeforeRouteEnter,
967
+ ...u.onBeforeRouteUpdate,
968
+ ...d.onBeforeRouteUpdate,
969
969
  ...f.onBeforeRouteUpdate,
970
- ...i.onBeforeRouteLeave,
971
- ...p.onBeforeRouteLeave,
970
+ ...u.onBeforeRouteLeave,
971
+ ...d.onBeforeRouteLeave,
972
972
  ...f.onBeforeRouteLeave
973
973
  ];
974
974
  try {
975
- const h = P.map((m) => m(c, {
976
- from: s,
975
+ const p = P.map((h) => h(s, {
976
+ from: c,
977
977
  reject: e,
978
978
  push: t,
979
- replace: n,
980
- abort: r
979
+ replace: r,
980
+ abort: n
981
981
  }));
982
- await Promise.all(h);
983
- } catch (h) {
984
- if (h instanceof te || h instanceof ke || h instanceof Vt)
985
- return h.response;
986
- throw h;
982
+ await Promise.all(p);
983
+ } catch (p) {
984
+ if (p instanceof te || p instanceof be || p instanceof jt)
985
+ return p.response;
986
+ throw p;
987
987
  }
988
988
  return {
989
989
  status: "SUCCESS"
990
990
  };
991
991
  }
992
- async function a({ to: c, from: s, hooks: u }) {
993
- const { global: i, component: f } = u, p = nr(c, s), P = [
992
+ async function a({ to: s, from: c, hooks: i }) {
993
+ const { global: u, component: f } = i, d = rn(s, c), P = [
994
994
  ...f.onAfterRouteLeave,
995
- ...p.onAfterRouteLeave,
996
- ...i.onAfterRouteLeave,
995
+ ...d.onAfterRouteLeave,
996
+ ...u.onAfterRouteLeave,
997
997
  ...f.onAfterRouteUpdate,
998
- ...p.onAfterRouteUpdate,
999
- ...i.onAfterRouteUpdate,
998
+ ...d.onAfterRouteUpdate,
999
+ ...u.onAfterRouteUpdate,
1000
1000
  ...f.onAfterRouteEnter,
1001
- ...p.onAfterRouteEnter,
1002
- ...i.onAfterRouteEnter
1001
+ ...d.onAfterRouteEnter,
1002
+ ...u.onAfterRouteEnter
1003
1003
  ];
1004
1004
  try {
1005
- const h = P.map((m) => m(c, {
1006
- from: s,
1005
+ const p = P.map((h) => h(s, {
1006
+ from: c,
1007
1007
  reject: e,
1008
1008
  push: t,
1009
- replace: n
1009
+ replace: r
1010
1010
  }));
1011
- await Promise.all(h);
1012
- } catch (h) {
1013
- if (h instanceof te || h instanceof ke)
1014
- return h.response;
1015
- throw h;
1011
+ await Promise.all(p);
1012
+ } catch (p) {
1013
+ if (p instanceof te || p instanceof be)
1014
+ return p.response;
1015
+ throw p;
1016
1016
  }
1017
1017
  return {
1018
1018
  status: "SUCCESS"
@@ -1023,23 +1023,23 @@ function rr() {
1023
1023
  runAfterRouteHooks: a
1024
1024
  };
1025
1025
  }
1026
- const Me = (e, t, n) => {
1026
+ const Oe = (e, t, r) => {
1027
1027
  var a;
1028
- const r = e.matches, o = (t == null ? void 0 : t.matches) ?? [];
1029
- return r.length < n || r[n].id !== ((a = o[n]) == null ? void 0 : a.id);
1030
- }, Te = (e, t, n) => {
1028
+ const n = e.matches, o = (t == null ? void 0 : t.matches) ?? [];
1029
+ return n.length < r || n[r].id !== ((a = o[r]) == null ? void 0 : a.id);
1030
+ }, Te = (e, t, r) => {
1031
1031
  var a;
1032
- const r = e.matches, o = (t == null ? void 0 : t.matches) ?? [];
1033
- return r.length < n || r[n].id !== ((a = o[n]) == null ? void 0 : a.id);
1034
- }, Ie = (e, t, n) => {
1035
- var r;
1036
- return e.matches[n].id === ((r = t == null ? void 0 : t.matches[n]) == null ? void 0 : r.id);
1032
+ const n = e.matches, o = (t == null ? void 0 : t.matches) ?? [];
1033
+ return n.length < r || n[r].id !== ((a = o[r]) == null ? void 0 : a.id);
1034
+ }, Ie = (e, t, r) => {
1035
+ var n;
1036
+ return e.matches[r].id === ((n = t == null ? void 0 : t.matches[r]) == null ? void 0 : n.id);
1037
1037
  };
1038
- function st(e) {
1038
+ function it(e) {
1039
1039
  switch (e) {
1040
1040
  case "onBeforeRouteEnter":
1041
1041
  case "onAfterRouteEnter":
1042
- return Me;
1042
+ return Oe;
1043
1043
  case "onBeforeRouteUpdate":
1044
1044
  case "onAfterRouteUpdate":
1045
1045
  return Ie;
@@ -1050,41 +1050,41 @@ function st(e) {
1050
1050
  throw new Error(`Switch is not exhaustive for lifecycle: ${e}`);
1051
1051
  }
1052
1052
  }
1053
- function or() {
1053
+ function on() {
1054
1054
  const e = {
1055
- global: new Se(),
1056
- component: new Se()
1055
+ global: new Ee(),
1056
+ component: new Ee()
1057
1057
  };
1058
- function t({ lifecycle: r, timing: o, depth: a, hook: c }) {
1059
- const s = st(r), u = e[o][r], i = (f, p) => {
1060
- if (s(f, p.from, a))
1061
- return c(f, p);
1058
+ function t({ lifecycle: n, timing: o, depth: a, hook: s }) {
1059
+ const c = it(n), i = e[o][n], u = (f, d) => {
1060
+ if (c(f, d.from, a))
1061
+ return s(f, d);
1062
1062
  };
1063
- return u.add(i), () => u.delete(i);
1063
+ return i.add(u), () => i.delete(u);
1064
1064
  }
1065
- function n({ lifecycle: r, timing: o, depth: a, hook: c }) {
1066
- const s = st(r), u = e[o][r], i = (f, p) => {
1067
- if (s(f, p.from, a))
1068
- return c(f, p);
1065
+ function r({ lifecycle: n, timing: o, depth: a, hook: s }) {
1066
+ const c = it(n), i = e[o][n], u = (f, d) => {
1067
+ if (c(f, d.from, a))
1068
+ return s(f, d);
1069
1069
  };
1070
- return u.add(i), () => u.delete(i);
1070
+ return i.add(u), () => i.delete(u);
1071
1071
  }
1072
- return { ...e, addBeforeRouteHook: t, addAfterRouteHook: n };
1072
+ return { ...e, addBeforeRouteHook: t, addAfterRouteHook: r };
1073
1073
  }
1074
- const jt = Symbol();
1075
- function ar() {
1076
- const e = or();
1074
+ const qt = Symbol();
1075
+ function an() {
1076
+ const e = on();
1077
1077
  return {
1078
- onBeforeRouteEnter: (s) => e.addBeforeRouteHook({ lifecycle: "onBeforeRouteEnter", hook: s, timing: "global", depth: 0 }),
1079
- onBeforeRouteUpdate: (s) => e.addBeforeRouteHook({ lifecycle: "onBeforeRouteUpdate", hook: s, timing: "global", depth: 0 }),
1080
- onBeforeRouteLeave: (s) => e.addBeforeRouteHook({ lifecycle: "onBeforeRouteLeave", hook: s, timing: "global", depth: 0 }),
1081
- onAfterRouteEnter: (s) => e.addAfterRouteHook({ lifecycle: "onAfterRouteEnter", hook: s, timing: "global", depth: 0 }),
1082
- onAfterRouteUpdate: (s) => e.addAfterRouteHook({ lifecycle: "onAfterRouteUpdate", hook: s, timing: "global", depth: 0 }),
1083
- onAfterRouteLeave: (s) => e.addAfterRouteHook({ lifecycle: "onAfterRouteLeave", hook: s, timing: "global", depth: 0 }),
1078
+ onBeforeRouteEnter: (c) => e.addBeforeRouteHook({ lifecycle: "onBeforeRouteEnter", hook: c, timing: "global", depth: 0 }),
1079
+ onBeforeRouteUpdate: (c) => e.addBeforeRouteHook({ lifecycle: "onBeforeRouteUpdate", hook: c, timing: "global", depth: 0 }),
1080
+ onBeforeRouteLeave: (c) => e.addBeforeRouteHook({ lifecycle: "onBeforeRouteLeave", hook: c, timing: "global", depth: 0 }),
1081
+ onAfterRouteEnter: (c) => e.addAfterRouteHook({ lifecycle: "onAfterRouteEnter", hook: c, timing: "global", depth: 0 }),
1082
+ onAfterRouteUpdate: (c) => e.addAfterRouteHook({ lifecycle: "onAfterRouteUpdate", hook: c, timing: "global", depth: 0 }),
1083
+ onAfterRouteLeave: (c) => e.addAfterRouteHook({ lifecycle: "onAfterRouteLeave", hook: c, timing: "global", depth: 0 }),
1084
1084
  hooks: e
1085
1085
  };
1086
1086
  }
1087
- function sr(e) {
1087
+ function sn(e) {
1088
1088
  return se(() => () => Z("h1", e), {
1089
1089
  name: e,
1090
1090
  props: []
@@ -1093,306 +1093,203 @@ function sr(e) {
1093
1093
  function Fe(e) {
1094
1094
  const t = new URLSearchParams(e);
1095
1095
  return {
1096
- get: (...n) => t.get(...n),
1097
- getAll: (...n) => t.getAll(...n),
1098
- set: (...n) => {
1099
- t.set(...n);
1096
+ get: (...r) => t.get(...r),
1097
+ getAll: (...r) => t.getAll(...r),
1098
+ set: (...r) => {
1099
+ t.set(...r);
1100
1100
  },
1101
- append: (...n) => {
1102
- t.append(...n);
1101
+ append: (...r) => {
1102
+ t.append(...r);
1103
1103
  },
1104
- delete: (...n) => {
1105
- t.delete(...n);
1104
+ delete: (...r) => {
1105
+ t.delete(...r);
1106
1106
  },
1107
- toString: (...n) => t.toString(...n),
1108
- forEach: (...n) => {
1109
- t.forEach(...n);
1107
+ toString: (...r) => t.toString(...r),
1108
+ forEach: (...r) => {
1109
+ t.forEach(...r);
1110
1110
  },
1111
- entries: (...n) => t.entries(...n),
1112
- keys: (...n) => t.keys(...n),
1113
- values: (...n) => t.values(...n),
1114
- has: (...n) => t.has(...n)
1111
+ entries: (...r) => t.entries(...r),
1112
+ keys: (...r) => t.keys(...r),
1113
+ values: (...r) => t.values(...r),
1114
+ has: (...r) => t.has(...r),
1115
+ size: t.size,
1116
+ sort: () => {
1117
+ t.sort();
1118
+ },
1119
+ [Symbol.iterator]: () => t[Symbol.iterator]()
1115
1120
  };
1116
1121
  }
1117
- function $t() {
1122
+ function _t() {
1118
1123
  let e = 0;
1119
1124
  return () => (++e).toString();
1120
1125
  }
1121
- const Je = $t();
1122
- function cr({
1126
+ const Je = _t();
1127
+ function cn({
1123
1128
  rejections: e
1124
1129
  }) {
1125
1130
  const t = (a) => {
1126
- const c = {
1131
+ const s = {
1127
1132
  ...e
1128
1133
  };
1129
- return ve(c[a] ?? sr(a));
1130
- }, n = (a) => {
1131
- const c = ve(t(a)), s = {
1134
+ return ye(s[a] ?? sn(a));
1135
+ }, r = (a) => {
1136
+ const s = ye(t(a)), c = {
1132
1137
  id: Je(),
1133
- component: c,
1138
+ component: s,
1134
1139
  meta: {},
1135
1140
  state: {}
1136
1141
  };
1137
1142
  return {
1138
- id: s.id,
1139
- matched: s,
1140
- matches: [s],
1143
+ id: c.id,
1144
+ matched: c,
1145
+ matches: [c],
1141
1146
  name: a,
1142
1147
  query: Fe(""),
1143
1148
  params: {},
1144
1149
  state: {},
1145
1150
  href: "/",
1146
- [Nt]: !0
1151
+ hash: "",
1152
+ [Ht]: !0
1147
1153
  };
1148
- }, r = (a) => {
1154
+ }, n = (a) => {
1149
1155
  if (!a) {
1150
1156
  o.value = null;
1151
1157
  return;
1152
1158
  }
1153
- const c = t(a);
1154
- o.value = { type: a, component: c };
1155
- }, o = Oe(null);
1159
+ const s = t(a);
1160
+ o.value = { type: a, component: s };
1161
+ }, o = qe(null);
1156
1162
  return {
1157
- setRejection: r,
1163
+ setRejection: n,
1158
1164
  rejection: o,
1159
- getRejectionRoute: n
1165
+ getRejectionRoute: r
1160
1166
  };
1161
1167
  }
1162
- class ur extends Error {
1168
+ class un extends Error {
1163
1169
  constructor() {
1164
1170
  super("initialUrl must be set if window.location is unavailable");
1165
1171
  }
1166
1172
  }
1167
- function ir(e) {
1173
+ function fn(e) {
1168
1174
  if (e)
1169
1175
  return e;
1170
1176
  if (De())
1171
1177
  return window.location.toString();
1172
- throw new ur();
1178
+ throw new un();
1173
1179
  }
1174
1180
  function Qe(e) {
1175
1181
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1176
1182
  }
1177
- function fr(e, t) {
1178
- const n = Array.from(e.matchAll(t));
1179
- if (n.length === 0)
1183
+ function ln(e, t) {
1184
+ const r = Array.from(e.matchAll(t));
1185
+ if (r.length === 0)
1180
1186
  return [e];
1181
- let r = 0;
1182
- const o = n.reduce((c, s) => {
1183
- const u = Qe(e.slice(r, s.index));
1184
- u.length && c.push(u);
1185
- const [i] = s;
1186
- return c.push(i), r = s.index + i.length, c;
1187
- }, []), a = e.slice(r);
1187
+ let n = 0;
1188
+ const o = r.reduce((s, c) => {
1189
+ const i = Qe(e.slice(n, c.index));
1190
+ i.length && s.push(i);
1191
+ const [u] = c;
1192
+ return s.push(u), n = c.index + u.length, s;
1193
+ }, []), a = e.slice(n);
1188
1194
  return a && o.push(a), o;
1189
1195
  }
1190
- function lr(e) {
1191
- const t = Ot(e.path.value);
1196
+ function hn(e) {
1197
+ const t = Mt(e.path.value);
1192
1198
  return new RegExp(`^${t}$`, "i");
1193
1199
  }
1194
- function hr(e) {
1200
+ function pn(e) {
1195
1201
  const t = new URLSearchParams(e.query.value);
1196
- return Array.from(t.entries()).filter(([, n]) => !He(n)).map(([n, r]) => {
1197
- const o = Ot(r);
1198
- return new RegExp(`${Qe(n)}=${o}(&|$)`, "i");
1202
+ return Array.from(t.entries()).filter(([, r]) => !He(r)).map(([r, n]) => {
1203
+ const o = Mt(n);
1204
+ return new RegExp(`${Qe(r)}=${o}(&|$)`, "i");
1199
1205
  });
1200
1206
  }
1201
- function Ot(e) {
1202
- return fr(e, new RegExp(pr, "g")).map((t) => t.startsWith(F) ? qt(t) : Qe(t)).join("");
1207
+ function Mt(e) {
1208
+ return ln(e, new RegExp(dn, "g")).map((t) => t.startsWith(J) ? Wt(t) : Qe(t)).join("");
1203
1209
  }
1204
- function qt(e) {
1210
+ function Wt(e) {
1205
1211
  return [
1206
- dr,
1207
- mr
1208
- ].reduce((t, n) => n(t), e);
1212
+ mn,
1213
+ yn
1214
+ ].reduce((t, r) => r(t), e);
1209
1215
  }
1210
- const pr = `\\${F}\\??([\\w-_]+)\\${K}`, Ge = `\\${F}\\?([\\w-_]+)\\${K}`, _t = `\\${F}([\\w-_]+)\\${K}`;
1211
- function dr(e) {
1212
- return e.replace(new RegExp(Ge, "g"), ".*");
1216
+ const dn = `\\${J}\\??([\\w-_]+)\\${K}`, ze = `\\${J}\\?([\\w-_]+)\\${K}`, Dt = `\\${J}([\\w-_]+)\\${K}`;
1217
+ function mn(e) {
1218
+ return e.replace(new RegExp(ze, "g"), ".*");
1213
1219
  }
1214
1220
  function He(e) {
1215
- return new RegExp(Ge, "g").test(e);
1216
- }
1217
- function mr(e) {
1218
- return e.replace(new RegExp(_t, "g"), ".+");
1219
- }
1220
- function Be(e) {
1221
- const [t] = Ae(e, new RegExp(Ge, "g")), [n] = Ae(e, new RegExp(_t, "g"));
1222
- return t ?? n;
1223
- }
1224
- function Ae(e, t) {
1225
- return Array.from(e.matchAll(t)).flatMap(([, ...r]) => r.map((o) => me(o) ? o : ""));
1226
- }
1227
- function Wt(e, t, n) {
1228
- const r = Mt(t, n), [o] = Ae(e, r);
1229
- return o;
1230
- }
1231
- function Dt(e, t) {
1232
- if (!t)
1233
- return e;
1234
- const { name: n, param: r, value: o } = t, a = Mt(e, n);
1235
- return Ae(e, a).reduce((s, u) => u === void 0 ? s : s.replace(u, () => le(o, r, n.startsWith("?"))), e);
1236
- }
1237
- function Mt(e, t) {
1238
- const n = [
1239
- yr,
1240
- gr,
1241
- qt
1242
- ].reduce((r, o) => o(r, t), e);
1243
- return new RegExp(n, "g");
1244
- }
1245
- function yr(e, t) {
1246
- if (!t.startsWith("?"))
1247
- return e;
1248
- const n = new RegExp(`\\${F}\\${t}\\${K}`, "g");
1249
- return e.replace(n, "(.*)");
1250
- }
1251
- function gr(e, t) {
1252
- if (t.startsWith("?"))
1253
- return e;
1254
- const n = new RegExp(`\\${F}${t}\\${K}`, "g");
1255
- return e.replace(n, "(.+)");
1256
- }
1257
- const vr = (e, t) => {
1258
- try {
1259
- Ke(e, t);
1260
- } catch {
1261
- return !1;
1262
- }
1263
- return !0;
1264
- }, Ke = (e, t) => {
1265
- const { pathname: n, search: r } = D(t);
1266
- return {
1267
- ...Rr(e.path, n),
1268
- ...wr(e.query, r)
1269
- };
1270
- };
1271
- function Rr(e, t) {
1272
- const n = {}, r = decodeURIComponent(t);
1273
- for (const [o, a] of Object.entries(e.params)) {
1274
- const c = o.startsWith("?"), s = c ? o.slice(1) : o, u = Wt(r, e.value, o), i = fe(u, a, c);
1275
- n[s] = i;
1276
- }
1277
- return n;
1278
- }
1279
- function wr(e, t) {
1280
- const n = {}, r = new URLSearchParams(t);
1281
- for (const [o, a] of Object.entries(e.params)) {
1282
- const c = o.startsWith("?"), s = c ? o.slice(1) : o, u = r.get(s) ?? void 0, i = fe(u, a, c);
1283
- n[s] = i;
1284
- }
1285
- return n;
1286
- }
1287
- const Pr = (e) => "name" in e.matched && !!e.matched.name, Er = (e, t) => {
1288
- const { pathname: n } = D(t);
1289
- return lr(e).test(n);
1290
- }, br = (e, t) => {
1291
- const { search: n } = D(t);
1292
- return hr(e).every((o) => o.test(n));
1293
- }, je = (e, t) => {
1294
- const { hash: n } = D(t), { value: r } = e.hash;
1295
- return r === void 0 || `#${r.toLowerCase()}` === n.toLowerCase();
1296
- };
1297
- function Sr(e) {
1298
- const { searchParams: t, pathname: n } = D(e), r = -1, o = 1;
1299
- return (a, c) => {
1300
- const s = ut(a, t), u = ct(a, n), i = ut(c, t), f = ct(c, n);
1301
- return a.depth > c.depth ? r : a.depth < c.depth ? o : s + u > i + f ? r : s + u < i + f ? o : je(a, e) ? r : je(c, e) ? o : 0;
1302
- };
1303
- }
1304
- function ct(e, t) {
1305
- const n = Object.keys(e.path.params).filter((o) => o.startsWith("?")).map((o) => o), r = n.filter((o) => Wt(t, e.path.value, o) === void 0);
1306
- return n.length - r.length;
1221
+ return new RegExp(ze, "g").test(e);
1307
1222
  }
1308
- function ut(e, t) {
1309
- const n = new URLSearchParams(e.query.value), r = Array.from(n.keys()), o = r.filter((a) => !t.has(a));
1310
- return r.length - o.length;
1223
+ function yn(e) {
1224
+ return e.replace(new RegExp(Dt, "g"), ".+");
1311
1225
  }
1312
- function Tt(e) {
1313
- return !!e && typeof e == "object";
1226
+ function Le(e) {
1227
+ const [t] = Se(e, new RegExp(ze, "g")), [r] = Se(e, new RegExp(Dt, "g"));
1228
+ return t ?? r;
1314
1229
  }
1315
- const xe = !0;
1316
- function kr(e, t, n) {
1317
- if (Tt(e) && t in e) {
1318
- const r = e[t];
1319
- if (typeof r == "string")
1320
- return fe(r, n, xe);
1321
- }
1322
- return fe(void 0, n, xe);
1323
- }
1324
- function It(e, t) {
1325
- const n = {};
1326
- for (const [r, o] of Object.entries(e)) {
1327
- const a = kr(t, r, o);
1328
- n[r] = a;
1329
- }
1330
- return n;
1331
- }
1332
- function Ar(e, t, n) {
1333
- if (Tt(e) && t in e) {
1334
- const r = e[t];
1335
- return le(r, n, xe);
1336
- }
1337
- return le(void 0, n, xe);
1338
- }
1339
- const it = (e, t) => {
1340
- const n = {};
1341
- for (const [r, o] of Object.entries(e)) {
1342
- const a = Ar(t, r, o);
1343
- n[r] = a;
1344
- }
1345
- return n;
1346
- }, xr = [
1347
- Pr,
1348
- Er,
1349
- br,
1350
- je,
1351
- vr
1352
- ];
1353
- function ft(e, t, n) {
1354
- const r = Sr(t), o = e.filter((u) => xr.every((i) => i(u, t))).sort(r);
1355
- if (o.length === 0)
1356
- return;
1357
- const [a] = o, { search: c, hash: s } = D(t);
1358
- return {
1359
- id: a.id,
1360
- matched: a.matched,
1361
- matches: a.matches,
1362
- name: a.name,
1363
- query: Fe(c),
1364
- params: Ke(a, t),
1365
- state: It(a.state, n),
1366
- hash: s,
1367
- href: wt(t)
1368
- };
1230
+ function Se(e, t) {
1231
+ return Array.from(e.matchAll(t)).flatMap(([, ...n]) => n.map((o) => F(o) ? o : ""));
1369
1232
  }
1370
- function ze(e, t) {
1371
- const n = new RegExp(`\\${F}(\\??[\\w-_]+)\\${K}`, "g");
1372
- return Array.from(e.matchAll(n)).reduce((o, [a, c]) => {
1373
- const s = Be(a);
1374
- if (!s)
1233
+ function Ge(e, t) {
1234
+ const r = new RegExp(`\\${J}(\\??[\\w-_]+)\\${K}`, "g");
1235
+ return Array.from(e.matchAll(r)).reduce((o, [a, s]) => {
1236
+ const c = Le(a);
1237
+ if (!c)
1375
1238
  return o;
1376
- const u = Dn(t, s);
1377
- return ce([s], o), o[c] = u, o;
1239
+ const i = Dr(t, c);
1240
+ return ce([c], o), o[s] = i, o;
1378
1241
  }, {});
1379
1242
  }
1380
- function $e(e, t) {
1243
+ function je(e, t) {
1381
1244
  return {
1382
1245
  value: e,
1383
- params: ze(e, t)
1246
+ params: Ge(e, t)
1384
1247
  };
1385
1248
  }
1386
- function Lr(e, t) {
1387
- return me(t) ? e.map((n) => {
1388
- const r = `${t}${n.path.value}`;
1249
+ function gn(e, t) {
1250
+ return F(t) ? e.map((r) => {
1251
+ const n = `${t}${r.path.value}`;
1389
1252
  return {
1390
- ...n,
1391
- path: $e(r, n.path.params)
1253
+ ...r,
1254
+ path: je(n, r.path.params)
1392
1255
  };
1393
1256
  }) : e;
1394
1257
  }
1395
- class Ur extends Error {
1258
+ function Ot(e) {
1259
+ return !!e && typeof e == "object";
1260
+ }
1261
+ const ke = !0;
1262
+ function vn(e, t, r) {
1263
+ if (Ot(e) && t in e) {
1264
+ const n = e[t];
1265
+ return typeof n == "string" ? fe(n, r, ke) : n;
1266
+ }
1267
+ return fe(void 0, r, ke);
1268
+ }
1269
+ function Tt(e, t) {
1270
+ const r = {};
1271
+ for (const [n, o] of Object.entries(e)) {
1272
+ const a = vn(t, n, o);
1273
+ r[n] = a;
1274
+ }
1275
+ return r;
1276
+ }
1277
+ function Rn(e, t, r) {
1278
+ if (Ot(e) && t in e) {
1279
+ const n = e[t];
1280
+ return le(n, r, ke);
1281
+ }
1282
+ return le(void 0, r, ke);
1283
+ }
1284
+ const ft = (e, t) => {
1285
+ const r = {};
1286
+ for (const [n, o] of Object.entries(e)) {
1287
+ const a = Rn(t, n, o);
1288
+ r[n] = a;
1289
+ }
1290
+ return r;
1291
+ };
1292
+ class wn extends Error {
1396
1293
  /**
1397
1294
  * Constructs a new DuplicateNamesError instance with a message indicating the problematic name.
1398
1295
  * @param name - The name of the name that was duplicated.
@@ -1401,514 +1298,653 @@ class Ur extends Error {
1401
1298
  super(`Invalid Name "${t}": Router does not support multiple routes with the same name. All name names must be unique.`);
1402
1299
  }
1403
1300
  }
1404
- function Cr(e) {
1405
- const t = e.map(({ name: n }) => n);
1406
- for (const n of t)
1407
- if (Et(t, n) > 1)
1408
- throw new Ur(n);
1301
+ function Pn(e) {
1302
+ const t = e.map(({ name: r }) => r);
1303
+ for (const r of t)
1304
+ if (St(t, r) > 1)
1305
+ throw new wn(r);
1409
1306
  }
1410
- function Br() {
1411
- const e = Ue(/* @__PURE__ */ new Map()), t = De() ? c() : null, n = (s) => {
1412
- e.set(s, !1), t == null || t.observe(s);
1413
- }, r = (s) => {
1414
- e.delete(s), t == null || t.unobserve(s);
1307
+ function En() {
1308
+ const e = xe(/* @__PURE__ */ new Map()), t = De() ? s() : null, r = (c) => {
1309
+ e.set(c, !1), t == null || t.observe(c);
1310
+ }, n = (c) => {
1311
+ e.delete(c), t == null || t.unobserve(c);
1415
1312
  }, o = () => {
1416
1313
  t == null || t.disconnect();
1417
- }, a = (s) => e.get(s) ?? !1;
1418
- function c() {
1419
- return new IntersectionObserver((s) => {
1420
- s.forEach((u) => {
1421
- e.set(u.target, u.isIntersecting);
1314
+ }, a = (c) => e.get(c) ?? !1;
1315
+ function s() {
1316
+ return new IntersectionObserver((c) => {
1317
+ c.forEach((i) => {
1318
+ e.set(i.target, i.isIntersecting);
1422
1319
  });
1423
1320
  });
1424
1321
  }
1425
1322
  return {
1426
- observe: n,
1427
- unobserve: r,
1323
+ observe: r,
1324
+ unobserve: n,
1428
1325
  disconnect: o,
1429
1326
  isElementVisible: a
1430
1327
  };
1431
1328
  }
1432
- const Ft = Symbol("visibilityObserver");
1433
- function Nr(e) {
1434
- const t = ae(Ft);
1329
+ const It = Symbol("visibilityObserver");
1330
+ function bn(e) {
1331
+ const t = ae(It);
1435
1332
  if (!t)
1436
1333
  throw new pe();
1437
- return Re(e, (r, o) => {
1438
- r && t.observe(r), o && t.unobserve(o);
1334
+ return ge(e, (n, o) => {
1335
+ n && t.observe(n), o && t.unobserve(o);
1439
1336
  }, { immediate: !0 }), {
1440
1337
  isElementVisible: N(() => e.value ? t.isElementVisible(e.value) : !1)
1441
1338
  };
1442
1339
  }
1443
- class lt extends Error {
1340
+ class Sn extends Error {
1444
1341
  constructor(t) {
1445
1342
  super(`Route not found: "${t}"`);
1446
1343
  }
1447
1344
  }
1448
- function Jt({ protocol: e, host: t, pathname: n, search: r, searchParams: o, hash: a }) {
1449
- const c = new URL("https://localhost");
1450
- e && (c.protocol = e), t && (c.host = t), n && (c.pathname = n), o ? c.search = o.toString() : r && (c.search = r), a && (c.hash = a);
1451
- const s = c.toString().replace(/^https:\/\/localhost\/*/, "/");
1452
- return wt(s);
1345
+ function Ft(e, t, r) {
1346
+ const n = Qt(t, r), [o] = Se(e, n);
1347
+ return o;
1348
+ }
1349
+ function Jt(e, t) {
1350
+ if (!t)
1351
+ return e;
1352
+ const { name: r, param: n, value: o } = t, a = Qt(e, r);
1353
+ return Se(e, a).reduce((c, i) => i === void 0 ? c : c.replace(i, () => le(o, n, r.startsWith("?"))), e);
1453
1354
  }
1454
1355
  function Qt(e, t) {
1455
- const n = new URLSearchParams(e), r = new URLSearchParams(t);
1456
- for (const [o, a] of r.entries())
1457
- n.append(o, a);
1458
- return n;
1356
+ const r = [
1357
+ kn,
1358
+ An,
1359
+ Wt
1360
+ ].reduce((n, o) => o(n, t), e);
1361
+ return new RegExp(r, "g");
1362
+ }
1363
+ function kn(e, t) {
1364
+ if (!t.startsWith("?"))
1365
+ return e;
1366
+ const r = new RegExp(`\\${J}\\${t}\\${K}`, "g");
1367
+ return e.replace(r, "(.*)");
1459
1368
  }
1460
- function Ne(e, t) {
1461
- const { searchParams: n, ...r } = D(e);
1462
- return Jt({ ...r, searchParams: Qt(n, t) });
1369
+ function An(e, t) {
1370
+ if (t.startsWith("?"))
1371
+ return e;
1372
+ const r = new RegExp(`\\${J}${t}\\${K}`, "g");
1373
+ return e.replace(r, "(.+)");
1374
+ }
1375
+ function zt({ protocol: e, host: t, pathname: r, search: n, searchParams: o, hash: a }) {
1376
+ const s = new URL("https://localhost");
1377
+ e && (s.protocol = e), t && (s.host = t), r && (s.pathname = r), o ? s.search = new URLSearchParams(o).toString() : n && (s.search = n), a && (s.hash = a);
1378
+ const c = s.toString().replace(/^https:\/\/localhost\/*/, "/");
1379
+ return Et(c);
1380
+ }
1381
+ function Ke(...e) {
1382
+ const t = new URLSearchParams();
1383
+ for (const r of e) {
1384
+ const n = new URLSearchParams(r);
1385
+ for (const [o, a] of n.entries())
1386
+ t.append(o, a);
1387
+ }
1388
+ return t;
1463
1389
  }
1464
- function Vr(e, t = {}) {
1465
- const { params: n = {}, query: r } = t, o = $r(e.query, n), a = Qt(o, r), c = jr(e.path, n), s = we(e.hash.value ?? t.hash).value, u = Hr(e.host, n), { protocol: i, host: f } = D(u);
1466
- return Jt({ protocol: i, host: f, pathname: c, searchParams: a, hash: s });
1390
+ function xn(e, t = {}) {
1391
+ const { params: r = {}, query: n } = t, o = Cn(e.query, r), a = Ke(o, n), s = Ln(e.path, r), c = ve(e.hash.value ?? t.hash).value, i = Un(e.host, r), { protocol: u, host: f } = _(i);
1392
+ return zt({ protocol: u, host: f, pathname: s, searchParams: a, hash: c });
1467
1393
  }
1468
- function Hr(e, t) {
1469
- const n = e.value && !e.value.startsWith("http") ? `https://${e.value}` : e.value;
1470
- return Object.entries(e.params).reduce((r, [o, a]) => {
1471
- const c = Be(`${F}${o}${K}`);
1472
- return c ? Dt(r, { name: o, param: a, value: t[c] }) : r;
1473
- }, n);
1474
- }
1475
- function jr(e, t) {
1476
- return Object.entries(e.params).reduce((n, [r, o]) => {
1477
- const a = Be(`${F}${r}${K}`);
1478
- return a ? Dt(n, { name: r, param: o, value: t[a] }) : n;
1394
+ function Un(e, t) {
1395
+ const r = e.value && !e.value.startsWith("http") ? `https://${e.value}` : e.value;
1396
+ return Object.entries(e.params).reduce((n, [o, a]) => {
1397
+ const s = Le(`${J}${o}${K}`);
1398
+ return s ? Jt(n, { name: o, param: a, value: t[s] }) : n;
1399
+ }, r);
1400
+ }
1401
+ function Ln(e, t) {
1402
+ return Object.entries(e.params).reduce((r, [n, o]) => {
1403
+ const a = Le(`${J}${n}${K}`);
1404
+ return a ? Jt(r, { name: n, param: o, value: t[a] }) : r;
1479
1405
  }, e.value);
1480
1406
  }
1481
- function $r(e, t) {
1482
- const n = new URLSearchParams(e.value);
1407
+ function Cn(e, t) {
1408
+ const r = new URLSearchParams(e.value);
1483
1409
  if (!e.value)
1484
- return n;
1485
- for (const [r, o] of Array.from(n.entries())) {
1486
- const a = Be(o);
1410
+ return r;
1411
+ for (const [n, o] of Array.from(r.entries())) {
1412
+ const a = Le(o);
1487
1413
  if (!a)
1488
1414
  continue;
1489
- const s = le(t[a], e.params[a], He(o)), u = t[a] === void 0 && s === "";
1490
- He(o) && u ? n.delete(r, o) : n.set(r, s);
1415
+ const c = le(t[a], e.params[a], He(o)), i = t[a] === void 0 && c === "";
1416
+ He(o) && i ? r.delete(n, o) : r.set(n, c);
1417
+ }
1418
+ return r;
1419
+ }
1420
+ const Bn = (e, t) => {
1421
+ try {
1422
+ Ye(e, t);
1423
+ } catch {
1424
+ return !1;
1425
+ }
1426
+ return !0;
1427
+ }, Ye = (e, t) => {
1428
+ const { pathname: r, search: n } = _(t);
1429
+ return {
1430
+ ...Nn(e.path, r),
1431
+ ...Vn(e.query, n)
1432
+ };
1433
+ };
1434
+ function Nn(e, t) {
1435
+ const r = {}, n = decodeURIComponent(t);
1436
+ for (const [o, a] of Object.entries(e.params)) {
1437
+ const s = o.startsWith("?"), c = s ? o.slice(1) : o, i = Ft(n, e.value, o), u = fe(i, a, s);
1438
+ r[c] = u;
1439
+ }
1440
+ return r;
1441
+ }
1442
+ function Vn(e, t) {
1443
+ const r = {}, n = new URLSearchParams(t);
1444
+ for (const [o, a] of Object.entries(e.params)) {
1445
+ const s = o.startsWith("?"), c = s ? o.slice(1) : o, i = n.get(c) ?? void 0, u = fe(i, a, s);
1446
+ r[c] = u;
1491
1447
  }
1492
- return n;
1448
+ return r;
1493
1449
  }
1494
- function Or(e, t = {}, n = {}) {
1495
- const r = Vr(e, {
1450
+ function Hn(e, t = {}, r = {}) {
1451
+ const n = xn(e, {
1496
1452
  params: t,
1497
- query: n.query,
1498
- hash: n.hash
1499
- }), { search: o, hash: a } = D(r);
1453
+ query: r.query,
1454
+ hash: r.hash
1455
+ }), { search: o, hash: a } = _(n);
1500
1456
  return {
1501
1457
  id: e.id,
1502
1458
  matched: e.matched,
1503
1459
  matches: e.matches,
1504
1460
  name: e.name,
1505
1461
  query: Fe(o),
1506
- params: Ke(e, r),
1507
- state: It(e.state, n.state),
1462
+ params: Ye(e, n),
1463
+ state: Tt(e.state, r.state),
1508
1464
  hash: a,
1509
- href: r
1465
+ href: n
1466
+ };
1467
+ }
1468
+ const jn = (e) => "name" in e.matched && !!e.matched.name, $n = (e, t) => {
1469
+ const { pathname: r } = _(t);
1470
+ return hn(e).test(r);
1471
+ }, qn = (e, t) => {
1472
+ const { search: r } = _(t);
1473
+ return pn(e).every((o) => o.test(r));
1474
+ }, $e = (e, t) => {
1475
+ const { hash: r } = _(t), { value: n } = e.hash;
1476
+ return n === void 0 || `#${n.toLowerCase()}` === r.toLowerCase();
1477
+ };
1478
+ function _n(e) {
1479
+ const { searchParams: t, pathname: r } = _(e), n = -1, o = 1;
1480
+ return (a, s) => {
1481
+ const c = ht(a, t), i = lt(a, r), u = ht(s, t), f = lt(s, r);
1482
+ return a.depth > s.depth ? n : a.depth < s.depth ? o : c + i > u + f ? n : c + i < u + f ? o : $e(a, e) ? n : $e(s, e) ? o : 0;
1510
1483
  };
1511
1484
  }
1512
- function co(e, t) {
1513
- const n = Ln(e) ? e.flat() : e, r = Lr(n, t == null ? void 0 : t.base);
1514
- Cr(r);
1515
- const o = $t(), a = Fr(), c = Br(), s = Zn({
1485
+ function lt(e, t) {
1486
+ const r = Object.keys(e.path.params).filter((o) => o.startsWith("?")).map((o) => o), n = r.filter((o) => Ft(t, e.path.value, o) === void 0);
1487
+ return r.length - n.length;
1488
+ }
1489
+ function ht(e, t) {
1490
+ const r = new URLSearchParams(t), n = new URLSearchParams(e.query.value), o = Array.from(n.keys()), a = o.filter((s) => !r.has(s));
1491
+ return o.length - a.length;
1492
+ }
1493
+ const Mn = [
1494
+ jn,
1495
+ $n,
1496
+ qn,
1497
+ $e,
1498
+ Bn
1499
+ ];
1500
+ function Wn(e, t) {
1501
+ const r = _n(t);
1502
+ return e.filter((n) => Mn.every((o) => o(n, t))).sort(r);
1503
+ }
1504
+ function Dn(e, t, r) {
1505
+ const n = Wn(e, t);
1506
+ if (!n.length)
1507
+ return;
1508
+ const [o] = n, { searchParams: a, hash: s } = _(t);
1509
+ return {
1510
+ id: o.id,
1511
+ matched: o.matched,
1512
+ matches: o.matches,
1513
+ name: o.name,
1514
+ query: Fe(a),
1515
+ params: Ye(o, t),
1516
+ state: Tt(o.state, r),
1517
+ hash: s,
1518
+ href: Et(t)
1519
+ };
1520
+ }
1521
+ function pt(e, t) {
1522
+ const r = typeof e == "string" ? _(e) : e, n = typeof t == "string" ? _(t) : t, o = r.searchParams ?? new URLSearchParams(r.search), a = n.searchParams ?? new URLSearchParams(n.search);
1523
+ return zt({
1524
+ protocol: F(n.protocol) ? n.protocol : r.protocol,
1525
+ host: F(n.host) ? n.host : r.host,
1526
+ pathname: F(n.pathname) ? n.pathname : r.pathname,
1527
+ searchParams: Ke(a, o),
1528
+ hash: F(n.hash) ? n.hash : r.hash
1529
+ });
1530
+ }
1531
+ function lo(e, t) {
1532
+ const r = Ur(e) ? e.flat() : e, n = gn(r, t == null ? void 0 : t.base);
1533
+ Pn(n);
1534
+ const o = _t(), a = Gn(), s = En(), c = Zr({
1516
1535
  mode: t == null ? void 0 : t.historyMode,
1517
- listener: ({ location: E }) => {
1518
- const B = X(E);
1519
- R(B, { state: E.state, replace: !0 });
1536
+ listener: ({ location: b }) => {
1537
+ const L = X(b);
1538
+ k(L, { state: b.state, replace: !0 });
1520
1539
  }
1521
- }), { runBeforeRouteHooks: u, runAfterRouteHooks: i } = rr(), {
1540
+ }), { runBeforeRouteHooks: i, runAfterRouteHooks: u } = nn(), {
1522
1541
  hooks: f,
1523
- onBeforeRouteEnter: p,
1542
+ onBeforeRouteEnter: d,
1524
1543
  onAfterRouteUpdate: P,
1525
- onBeforeRouteLeave: h,
1526
- onAfterRouteEnter: m,
1544
+ onBeforeRouteLeave: p,
1545
+ onAfterRouteEnter: h,
1527
1546
  onBeforeRouteUpdate: v,
1528
- onAfterRouteLeave: w
1529
- } = ar();
1530
- async function R(E, B = {}) {
1531
- const J = o();
1532
- if (s.stopListening(), ye(E)) {
1533
- s.update(E, B);
1547
+ onAfterRouteLeave: R
1548
+ } = an();
1549
+ function E(b, L = {}) {
1550
+ return Dn(n, b, L.state);
1551
+ }
1552
+ async function k(b, L = {}) {
1553
+ const Q = o();
1554
+ if (c.stopListening(), rt(b)) {
1555
+ c.update(b, L);
1534
1556
  return;
1535
1557
  }
1536
- const V = ft(r, E, B.state) ?? l("NotFound"), Q = { ...S }, H = await u({ to: V, from: Q, hooks: f });
1537
- switch (H.status) {
1558
+ const W = E(b, L) ?? y("NotFound"), j = { ...A }, z = await i({ to: W, from: j, hooks: f });
1559
+ switch (z.status) {
1538
1560
  // On abort do nothing
1539
1561
  case "ABORT":
1540
1562
  return;
1541
1563
  // On push update the history, and push new route, and return
1542
1564
  case "PUSH":
1543
- s.update(E, B), await d(...H.to);
1565
+ c.update(b, L), await w(...z.to);
1544
1566
  return;
1545
1567
  // On reject update the history, the route, and set the rejection type
1546
1568
  case "REJECT":
1547
- s.update(E, B), x(H.type);
1569
+ c.update(b, L), g(z.type);
1548
1570
  break;
1549
1571
  // On success update history, set the route, and clear the rejection
1550
1572
  case "SUCCESS":
1551
- s.update(E, B), x(null);
1573
+ c.update(b, L), g(null);
1552
1574
  break;
1553
1575
  default:
1554
- throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(H)}`);
1576
+ throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(z)}`);
1555
1577
  }
1556
- const z = J;
1557
- a.setProps(V).then((q) => {
1558
- if (z === J)
1559
- switch (q.status) {
1578
+ const Ce = Q;
1579
+ a.setProps(W).then((D) => {
1580
+ if (Ce === Q)
1581
+ switch (D.status) {
1560
1582
  case "SUCCESS":
1561
1583
  break;
1562
1584
  case "PUSH":
1563
- d(...q.to);
1585
+ w(...D.to);
1564
1586
  break;
1565
1587
  case "REJECT":
1566
- x(q.type);
1588
+ g(D.type);
1567
1589
  break;
1568
1590
  default:
1569
- const fn = q;
1570
- throw new Error(`Switch is not exhaustive for prop store response status: ${JSON.stringify(fn)}`);
1591
+ const Be = D;
1592
+ throw new Error(`Switch is not exhaustive for prop store response status: ${JSON.stringify(Be)}`);
1571
1593
  }
1572
- }), U(V);
1573
- const $ = await i({ to: V, from: Q, hooks: f });
1574
- switch ($.status) {
1594
+ }), B(W);
1595
+ const O = await u({ to: W, from: j, hooks: f });
1596
+ switch (O.status) {
1575
1597
  case "PUSH":
1576
- await d(...$.to);
1598
+ await w(...O.to);
1577
1599
  break;
1578
1600
  case "REJECT":
1579
- x($.type);
1601
+ g(O.type);
1580
1602
  break;
1581
1603
  case "SUCCESS":
1582
1604
  break;
1583
1605
  default:
1584
- const q = $;
1585
- throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(q)}`);
1606
+ const D = O;
1607
+ throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(D)}`);
1586
1608
  }
1587
- s.startListening();
1588
- }
1589
- const A = (E, B, J) => {
1590
- if (!I(E)) {
1591
- const H = B ?? {}, z = J ?? {}, $ = r.find((q) => q.name === E);
1592
- return $ ? Or($, H, z) : void 0;
1609
+ c.startListening();
1610
+ }
1611
+ const m = (b, L = {}, Q = {}) => {
1612
+ const W = n.find((j) => j.name === b);
1613
+ if (!W)
1614
+ throw new Sn(String(b));
1615
+ return Hn(W, L, Q);
1616
+ }, w = (b, L, Q) => {
1617
+ if (I(b)) {
1618
+ const O = { ...L }, D = pt(b, {
1619
+ searchParams: O.query,
1620
+ hash: O.hash
1621
+ });
1622
+ return k(D, O);
1593
1623
  }
1594
- if (ye(E))
1595
- return;
1596
- const V = { ...B }, Q = Ne(E, V.query);
1597
- return ft(r, Q);
1598
- }, d = (E, B, J) => {
1599
- if (I(E)) {
1600
- const $ = { ...B }, q = Ne(E, $.query);
1601
- return R(q, $);
1624
+ if (typeof b == "string") {
1625
+ const { replace: O, ...D } = { ...Q }, Be = { ...L }, Ne = m(b, Be, D), fr = ft({ ...Ne.matched.state }, { ...Ne.state, ...D.state });
1626
+ return k(Ne.href, { replace: O, state: fr });
1602
1627
  }
1603
- const V = { ...J }, Q = { ...B }, H = A(E, Q, V);
1604
- if (!H)
1605
- throw new lt(String(E));
1606
- const z = it({ ...H.state }, V.state);
1607
- return R(H.href, { ...V, state: z });
1608
- }, b = (E, B, J) => {
1609
- if (I(E)) {
1610
- const $ = { ...B, replace: !0 }, q = Ne(E, $.query);
1611
- return R(q, $);
1628
+ const { replace: W, ...j } = { ...L }, z = ft({ ...b.matched.state }, { ...b.state, ...j.state }), Ce = pt(b.href, {
1629
+ searchParams: j.query,
1630
+ hash: j.hash
1631
+ });
1632
+ return k(Ce, { replace: W, state: z });
1633
+ }, x = (b, L, Q) => {
1634
+ if (I(b)) {
1635
+ const j = { ...L, replace: !0 };
1636
+ return w(b, j);
1637
+ }
1638
+ if (typeof b == "string") {
1639
+ const j = { ...Q, replace: !0 }, z = { ...L };
1640
+ return w(b, z, j);
1612
1641
  }
1613
- const V = { ...J, replace: !0 }, Q = { ...B }, H = A(E, Q, V);
1614
- if (!H)
1615
- throw new lt(String(E));
1616
- const z = it({ ...H.state }, V.state);
1617
- return R(H.href, { ...V, state: z });
1618
- }, L = (E) => {
1619
- x(E);
1620
- }, { setRejection: x, rejection: g, getRejectionRoute: l } = cr(t ?? {}), y = l("NotFound"), { currentRoute: S, routerRoute: k, updateRoute: U } = Kn(y, d);
1621
- s.startListening();
1622
- const C = ir(t == null ? void 0 : t.initialUrl), O = s.location.state, { host: W } = D(C), ye = Xn(W);
1623
- let et = !1;
1624
- async function tt() {
1625
- et || (await R(C, { replace: !0, state: O }), et = !0);
1626
- }
1627
- function un(E) {
1628
- E.component("RouterView", no), E.component("RouterLink", Yr), E.provide(Ct, g), E.provide(jt, f), E.provide(nn, a), E.provide(Ft, c), E.provide(Pt, nt), tt();
1629
- }
1630
- const nt = {
1631
- route: k,
1632
- resolve: A,
1633
- push: d,
1634
- replace: b,
1635
- reject: L,
1636
- refresh: s.refresh,
1637
- forward: s.forward,
1638
- back: s.back,
1639
- go: s.go,
1640
- install: un,
1641
- isExternal: ye,
1642
- onBeforeRouteEnter: p,
1642
+ const W = { ...L, replace: !0 };
1643
+ return w(b, W);
1644
+ }, U = (b) => {
1645
+ g(b);
1646
+ }, { setRejection: g, rejection: l, getRejectionRoute: y } = cn(t ?? {}), S = y("NotFound"), { currentRoute: A, routerRoute: C, updateRoute: B } = Gr(S, w);
1647
+ c.startListening();
1648
+ const H = fn(t == null ? void 0 : t.initialUrl), M = c.location.state, { host: tt } = _(H), rt = Xr(tt);
1649
+ let nt = !1;
1650
+ async function ot() {
1651
+ nt || (await k(H, { replace: !0, state: M }), nt = !0);
1652
+ }
1653
+ function ir(b) {
1654
+ b.component("RouterView", so), b.component("RouterLink", to), b.provide(Nt, l), b.provide(qt, f), b.provide(nr, a), b.provide(It, s), b.provide(bt, at), ot();
1655
+ }
1656
+ const at = {
1657
+ route: C,
1658
+ resolve: m,
1659
+ find: E,
1660
+ push: w,
1661
+ replace: x,
1662
+ reject: U,
1663
+ refresh: c.refresh,
1664
+ forward: c.forward,
1665
+ back: c.back,
1666
+ go: c.go,
1667
+ install: ir,
1668
+ isExternal: rt,
1669
+ onBeforeRouteEnter: d,
1643
1670
  onAfterRouteUpdate: P,
1644
- onBeforeRouteLeave: h,
1645
- onAfterRouteEnter: m,
1671
+ onBeforeRouteLeave: p,
1672
+ onAfterRouteEnter: h,
1646
1673
  onBeforeRouteUpdate: v,
1647
- onAfterRouteLeave: w,
1674
+ onAfterRouteLeave: R,
1648
1675
  prefetch: t == null ? void 0 : t.prefetch,
1649
- start: tt
1676
+ start: ot
1650
1677
  };
1651
- return nt;
1678
+ return at;
1652
1679
  }
1653
- function ht(e, t) {
1680
+ function dt(e, t) {
1654
1681
  return {
1655
1682
  value: e,
1656
- params: ze(e, t)
1683
+ params: Ge(e, t)
1657
1684
  };
1658
1685
  }
1659
1686
  function Gt(e, t) {
1660
1687
  return {
1661
1688
  value: e,
1662
- params: ze(e, t)
1689
+ params: Ge(e, t)
1663
1690
  };
1664
1691
  }
1665
- function qr(e) {
1692
+ function On(e) {
1666
1693
  return de(e) && typeof e.hash == "string";
1667
1694
  }
1668
1695
  function Kt(e) {
1669
- return e === void 0 ? we() : qr(e) ? e : we(e);
1696
+ return e === void 0 ? ve() : On(e) ? e : ve(e);
1670
1697
  }
1671
- function zt(e) {
1698
+ function Yt(e) {
1672
1699
  return e === void 0 ? "" : e;
1673
1700
  }
1674
- function _r(e) {
1701
+ function Tn(e) {
1675
1702
  return de(e) && typeof e.value == "string";
1676
1703
  }
1677
- function Yt(e) {
1678
- return e === void 0 ? $e("", {}) : _r(e) ? e : $e(e, {});
1704
+ function Xt(e) {
1705
+ return e === void 0 ? je("", {}) : Tn(e) ? e : je(e, {});
1679
1706
  }
1680
- function Wr(e) {
1707
+ function In(e) {
1681
1708
  return de(e) && typeof e.value == "string";
1682
1709
  }
1683
- function Xt(e) {
1684
- return e === void 0 ? ht("", {}) : Wr(e) ? e : ht(e, {});
1710
+ function Zt(e) {
1711
+ return e === void 0 ? dt("", {}) : In(e) ? e : dt(e, {});
1685
1712
  }
1686
1713
  function oe(e) {
1687
- const t = Je(), n = zt(e.name), r = Yt(e.path), o = Xt(e.query), a = Kt(e.hash), c = e.meta ?? {}, s = On(e) ? e.state : {}, u = ve({ id: t, meta: {}, state: {}, ...e }), i = {
1714
+ const t = Je(), r = Yt(e.name), n = Xt(e.path), o = Zt(e.query), a = Kt(e.hash), s = e.meta ?? {}, c = qr(e) ? e.state : {}, i = ye({ id: t, meta: {}, state: {}, ...e }), u = {
1688
1715
  id: t,
1689
- matched: u,
1690
- matches: [u],
1691
- name: n,
1692
- path: r,
1716
+ matched: i,
1717
+ matches: [i],
1718
+ name: r,
1719
+ path: n,
1693
1720
  query: o,
1694
1721
  hash: a,
1695
- meta: c,
1696
- state: s,
1722
+ meta: s,
1723
+ state: c,
1697
1724
  depth: 1,
1698
1725
  host: Gt("", {}),
1699
1726
  prefetch: e.prefetch
1700
- }, f = bt(e) ? St(e.parent, i) : i;
1727
+ }, f = kt(e) ? At(e.parent, u) : u;
1701
1728
  return ce(f.path.params, f.query.params), f;
1702
1729
  }
1703
- const Le = { template: "<div>This is component</div>" }, Ye = oe({
1730
+ const Ae = { template: "<div>This is component</div>" }, Xe = oe({
1704
1731
  name: "parentA",
1705
1732
  path: "/parentA/[paramA]"
1706
- }), Zt = oe({
1707
- parent: Ye,
1733
+ }), er = oe({
1734
+ parent: Xe,
1708
1735
  name: "parentA.childA",
1709
1736
  path: "/[?paramB]"
1710
- }), Dr = oe({
1711
- parent: Ye,
1737
+ }), Fn = oe({
1738
+ parent: Xe,
1712
1739
  name: "parentA.childB",
1713
1740
  path: "/[paramD]",
1714
- component: Le
1715
- }), Mr = oe({
1716
- parent: Zt,
1741
+ component: Ae
1742
+ }), Jn = oe({
1743
+ parent: er,
1717
1744
  name: "parentA.childA.grandChildA",
1718
1745
  path: "/[paramC]",
1719
- component: Le
1746
+ component: Ae
1720
1747
  });
1721
1748
  oe({
1722
1749
  name: "parentB",
1723
1750
  path: "/parentB",
1724
- component: Le
1751
+ component: Ae
1725
1752
  }), oe({
1726
1753
  name: "parentC",
1727
1754
  path: "/",
1728
- component: Le
1755
+ component: Ae
1729
1756
  });
1730
- const Tr = "lazy", Ir = {
1757
+ const Qn = "lazy", zn = {
1731
1758
  components: !0,
1732
1759
  props: !1
1733
1760
  };
1734
- function ge(e) {
1761
+ function me(e) {
1735
1762
  return ["eager", "lazy"].includes(e);
1736
1763
  }
1737
- function en({ routerPrefetch: e, routePrefetch: t, linkPrefetch: n }, r) {
1738
- const o = Ve(n, r), a = Ve(t, r), c = Ve(e, r), s = [
1764
+ function tr({ routerPrefetch: e, routePrefetch: t, linkPrefetch: r }, n) {
1765
+ const o = Ve(r, n), a = Ve(t, n), s = Ve(e, n), c = [
1739
1766
  o,
1740
1767
  a,
1741
- c,
1742
- Ir[r],
1743
- Tr
1744
- ].reduce((u, i) => ge(u) ? u : u === !0 && ge(i) ? i : u === !0 && !ge(i) ? u : u === void 0 ? i : u, void 0);
1745
- return ge(s) ? s : !1;
1768
+ s,
1769
+ zn[n],
1770
+ Qn
1771
+ ].reduce((i, u) => me(i) ? i : i === !0 && me(u) ? u : i === !0 && !me(u) ? i : i === void 0 ? u : i, void 0);
1772
+ return me(c) ? c : !1;
1746
1773
  }
1747
1774
  function Ve(e, t) {
1748
1775
  return de(e) ? e[t] : e;
1749
1776
  }
1750
- function tn(e) {
1777
+ function rr(e) {
1751
1778
  return typeof e == "object" && e !== null && "then" in e;
1752
1779
  }
1753
- function pt(e) {
1780
+ function mt(e) {
1754
1781
  try {
1755
1782
  const t = e();
1756
- return tn(t) ? t.catch((n) => n) : t;
1783
+ return rr(t) ? t.catch((r) => r) : t;
1757
1784
  } catch (t) {
1758
1785
  return t;
1759
1786
  }
1760
1787
  }
1761
- const nn = Symbol();
1762
- function Fr() {
1763
- const e = Ue(/* @__PURE__ */ new Map()), { push: t, replace: n, reject: r } = Ht(), o = (p, P, h) => P.matches.filter((m) => en({ ...h, routePrefetch: m.prefetch }, "props") === p).flatMap((m) => i(m)).reduce((m, { id: v, name: w, props: R }) => {
1764
- if (!R)
1765
- return m;
1766
- const A = u(v, w, P), d = pt(() => R(P, {
1788
+ const nr = Symbol();
1789
+ function Gn() {
1790
+ const e = xe(/* @__PURE__ */ new Map()), { push: t, replace: r, reject: n } = $t(), o = (d, P, p) => P.matches.filter((h) => tr({ ...p, routePrefetch: h.prefetch }, "props") === d).flatMap((h) => u(h)).reduce((h, { id: v, name: R, props: E }) => {
1791
+ if (!E)
1792
+ return h;
1793
+ const k = i(v, R, P), m = mt(() => E(P, {
1767
1794
  push: t,
1768
- replace: n,
1769
- reject: r
1795
+ replace: r,
1796
+ reject: n
1770
1797
  }));
1771
- return m[A] = d, m;
1772
- }, {}), a = (p) => {
1773
- Object.entries(p).forEach(([P, h]) => {
1774
- e.set(P, h);
1798
+ return h[k] = m, h;
1799
+ }, {}), a = (d) => {
1800
+ Object.entries(d).forEach(([P, p]) => {
1801
+ e.set(P, p);
1775
1802
  });
1776
- }, c = async (p) => {
1777
- const P = p.matches.flatMap(i), h = [], m = [];
1778
- for (const { id: v, name: w, props: R } of P) {
1779
- if (!R)
1803
+ }, s = async (d) => {
1804
+ const P = d.matches.flatMap(u), p = [], h = [];
1805
+ for (const { id: v, name: R, props: E } of P) {
1806
+ if (!E)
1780
1807
  continue;
1781
- const A = u(v, w, p);
1782
- if (h.push(A), !e.has(A)) {
1783
- const d = pt(() => R(p, {
1808
+ const k = i(v, R, d);
1809
+ if (p.push(k), !e.has(k)) {
1810
+ const m = mt(() => E(d, {
1784
1811
  push: t,
1785
- replace: n,
1786
- reject: r
1812
+ replace: r,
1813
+ reject: n
1787
1814
  }));
1788
- e.set(A, d);
1815
+ e.set(k, m);
1789
1816
  }
1790
- m.push((async () => {
1791
- const d = await e.get(A);
1792
- if (d instanceof Error)
1793
- throw d;
1817
+ h.push((async () => {
1818
+ const m = await e.get(k);
1819
+ if (m instanceof Error)
1820
+ throw m;
1794
1821
  })());
1795
1822
  }
1796
- f(h);
1823
+ f(p);
1797
1824
  try {
1798
- return await Promise.all(m), { status: "SUCCESS" };
1825
+ return await Promise.all(h), { status: "SUCCESS" };
1799
1826
  } catch (v) {
1800
- if (v instanceof te || v instanceof ke)
1827
+ if (v instanceof te || v instanceof be)
1801
1828
  return v.response;
1802
1829
  throw v;
1803
1830
  }
1804
- }, s = (p, P, h) => {
1805
- const m = u(p, P, h);
1806
- return e.get(m);
1831
+ }, c = (d, P, p) => {
1832
+ const h = i(d, P, p);
1833
+ return e.get(h);
1807
1834
  };
1808
- function u(p, P, h) {
1809
- return [p, P, h.id, JSON.stringify(h.params)].join("-");
1835
+ function i(d, P, p) {
1836
+ return [d, P, p.id, JSON.stringify(p.params)].join("-");
1810
1837
  }
1811
- function i(p) {
1812
- return We(p) ? Object.entries(p.props ?? {}).map(([P, h]) => ({ id: p.id, name: P, props: h })) : _e(p) ? [
1838
+ function u(d) {
1839
+ return We(d) ? Object.entries(d.props ?? {}).map(([P, p]) => ({ id: d.id, name: P, props: p })) : Me(d) ? [
1813
1840
  {
1814
- id: p.id,
1841
+ id: d.id,
1815
1842
  name: "default",
1816
- props: p.props
1843
+ props: d.props
1817
1844
  }
1818
1845
  ] : [];
1819
1846
  }
1820
- function f(p) {
1847
+ function f(d) {
1821
1848
  for (const P in e.keys())
1822
- p.includes(P) || e.delete(P);
1849
+ d.includes(P) || e.delete(P);
1823
1850
  }
1824
1851
  return {
1825
1852
  getPrefetchProps: o,
1826
1853
  setPrefetchProps: a,
1827
- getProps: s,
1828
- setProps: c
1854
+ getProps: c,
1855
+ setProps: s
1829
1856
  };
1830
1857
  }
1831
- function rn() {
1832
- const e = ae(nn);
1858
+ function or() {
1859
+ const e = ae(nr);
1833
1860
  if (!e)
1834
1861
  throw new pe();
1835
1862
  return e;
1836
1863
  }
1837
- const Jr = dn(() => new Promise((e) => {
1864
+ const Kn = dr(() => new Promise((e) => {
1838
1865
  e({ default: { template: "foo" } });
1839
1866
  }));
1840
- function dt(e) {
1841
- return e.name === Jr.name && "__asyncLoader" in e;
1867
+ function yt(e) {
1868
+ return e.name === Kn.name && "__asyncLoader" in e;
1842
1869
  }
1843
- function Qr(e) {
1844
- const t = /* @__PURE__ */ new Map(), n = Oe(), { getPrefetchProps: r, setPrefetchProps: o } = rn(), { isElementVisible: a } = Nr(n), c = () => {
1845
- const u = Array.from(t.values()).reduce((i, f) => (Object.assign(i, f), i), {});
1846
- o(u);
1870
+ function Yn(e) {
1871
+ const t = /* @__PURE__ */ new Map(), r = qe(), { getPrefetchProps: n, setPrefetchProps: o } = or(), { isElementVisible: a } = bn(r), s = () => {
1872
+ const i = Array.from(t.values()).reduce((u, f) => (Object.assign(u, f), u), {});
1873
+ o(i);
1847
1874
  };
1848
- Re(() => T(e), ({ route: u, ...i }) => {
1849
- t.clear(), u && s("eager", u, i);
1850
- }, { immediate: !0 }), Re(a, (u) => {
1851
- const { route: i, ...f } = T(e);
1852
- !i || !u || s("lazy", i, f);
1875
+ ge(() => $(e), ({ route: i, ...u }) => {
1876
+ t.clear(), i && c("eager", i, u);
1877
+ }, { immediate: !0 }), ge(a, (i) => {
1878
+ const { route: u, ...f } = $(e);
1879
+ !u || !i || c("lazy", u, f);
1853
1880
  }, { immediate: !0 });
1854
- function s(u, i, f) {
1855
- Gr(u, i, f), t.has(u) || t.set(u, r(u, i, f));
1881
+ function c(i, u, f) {
1882
+ Xn(i, u, f), t.has(i) || t.set(i, n(i, u, f));
1856
1883
  }
1857
1884
  return {
1858
- element: n,
1859
- commit: c
1885
+ element: r,
1886
+ commit: s
1860
1887
  };
1861
1888
  }
1862
- function Gr(e, t, n) {
1863
- t.matches.forEach((r) => {
1864
- en({
1865
- ...n,
1866
- routePrefetch: r.prefetch
1867
- }, "components") === e && (_e(r) && dt(r.component) && r.component.__asyncLoader(), We(r) && Object.values(r.components).forEach((a) => {
1868
- dt(a) && a.__asyncLoader();
1889
+ function Xn(e, t, r) {
1890
+ t.matches.forEach((n) => {
1891
+ tr({
1892
+ ...r,
1893
+ routePrefetch: n.prefetch
1894
+ }, "components") === e && (Me(n) && yt(n.component) && n.component.__asyncLoader(), We(n) && Object.values(n.components).forEach((a) => {
1895
+ yt(a) && a.__asyncLoader();
1869
1896
  }));
1870
1897
  });
1871
1898
  }
1872
- function on(e, t, { exact: n } = {}) {
1873
- return Qn(e) ? t === void 0 ? !0 : n ? e.matched.name === t : e.matches.map((r) => r.name).includes(t) : !1;
1899
+ function ar(e, t, { exact: r } = {}) {
1900
+ return Qr(e) ? t === void 0 ? !0 : r ? e.matched.name === t : e.matches.map((n) => n.name).includes(t) : !1;
1874
1901
  }
1875
- function Kr(e, t = {}, n = {}) {
1876
- const r = qe(), o = N(() => {
1877
- const m = T(e);
1878
- return typeof m != "string" ? m : r.resolve(m, T(t), T(n));
1902
+ function Zn(e, t = {}, r = {}) {
1903
+ const n = _e(), o = N(() => {
1904
+ const h = $(e);
1905
+ return typeof h != "string" ? h : I(h) ? n.find(h, $(r)) : n.resolve(h, $(t), $(r));
1879
1906
  }), a = N(() => {
1880
1907
  if (o.value)
1881
1908
  return o.value.href;
1882
- const m = T(e);
1883
- if (I(m))
1884
- return m;
1909
+ const h = $(e);
1910
+ if (I(h))
1911
+ return h;
1885
1912
  console.error(new Error("Failed to resolve route in RouterLink."));
1886
- }), c = N(() => on(r.route) && r.route.matches.some((m) => {
1913
+ }), s = N(() => ar(n.route) && n.route.matches.some((h) => {
1887
1914
  var v;
1888
- return m.id === ((v = o.value) == null ? void 0 : v.id);
1889
- })), s = N(() => {
1890
- var m;
1891
- return r.route.id === ((m = o.value) == null ? void 0 : m.id);
1892
- }), u = N(() => !!a.value && r.isExternal(a.value)), i = N(() => {
1893
- const m = T(e);
1894
- return typeof m != "string" || I(m) ? T(t) : T(n);
1895
- }), { element: f, commit: p } = Qr(() => ({
1915
+ return h.id === ((v = o.value) == null ? void 0 : v.id);
1916
+ })), c = N(() => {
1917
+ var h;
1918
+ return n.route.id === ((h = o.value) == null ? void 0 : h.id);
1919
+ }), i = N(() => !!a.value && n.isExternal(a.value)), u = N(() => {
1920
+ const h = $(e);
1921
+ return typeof h != "string" || I(h) ? $(t) : $(r);
1922
+ }), { element: f, commit: d } = Yn(() => ({
1896
1923
  route: o.value,
1897
- routerPrefetch: r.prefetch,
1898
- linkPrefetch: i.value.prefetch
1899
- })), P = (m) => (p(), r.push(a.value, { ...i.value, ...m }));
1924
+ routerPrefetch: n.prefetch,
1925
+ linkPrefetch: u.value.prefetch
1926
+ })), P = (h) => {
1927
+ d();
1928
+ const v = {
1929
+ replace: (h == null ? void 0 : h.replace) ?? u.value.replace,
1930
+ query: Ke(u.value.query, h == null ? void 0 : h.query),
1931
+ hash: (h == null ? void 0 : h.hash) ?? u.value.hash,
1932
+ state: { ...u.value.state, ...h == null ? void 0 : h.state }
1933
+ }, R = $(e);
1934
+ return I(R) || typeof R == "object" ? n.push(R, v) : n.push(R, $(t), v);
1935
+ };
1900
1936
  return {
1901
1937
  element: f,
1902
1938
  route: o,
1903
1939
  href: a,
1904
- isMatch: c,
1905
- isExactMatch: s,
1906
- isExternal: u,
1940
+ isMatch: s,
1941
+ isExactMatch: c,
1942
+ isExternal: i,
1907
1943
  push: P,
1908
- replace: (m) => P(m)
1944
+ replace: (h) => P({ ...h, replace: !0 })
1909
1945
  };
1910
1946
  }
1911
- const zr = ["href"], Yr = /* @__PURE__ */ se({
1947
+ const eo = ["href"], to = /* @__PURE__ */ se({
1912
1948
  __name: "routerLink",
1913
1949
  props: {
1914
1950
  to: {},
@@ -1919,177 +1955,177 @@ const zr = ["href"], Yr = /* @__PURE__ */ se({
1919
1955
  state: {}
1920
1956
  },
1921
1957
  setup(e) {
1922
- const t = e, n = qe(), r = N(() => P(t.to)), o = N(() => h(t.to)), a = N(() => {
1923
- const { to: v, ...w } = t;
1924
- return w;
1925
- }), { element: c, isMatch: s, isExactMatch: u, isExternal: i, push: f } = Kr(() => typeof t.to == "function" ? t.to(n.resolve) : t.to, a), p = N(() => ({
1926
- "router-link--match": s.value,
1927
- "router-link--exact-match": u.value
1958
+ const t = e, r = _e(), n = N(() => P(t.to)), o = N(() => p(t.to)), a = N(() => {
1959
+ const { to: v, ...R } = t;
1960
+ return R;
1961
+ }), { element: s, isMatch: c, isExactMatch: i, isExternal: u, push: f } = Zn(() => typeof t.to == "function" ? t.to(r.resolve) : t.to, a), d = N(() => ({
1962
+ "router-link--match": c.value,
1963
+ "router-link--exact-match": i.value
1928
1964
  }));
1929
1965
  function P(v) {
1930
1966
  if (typeof v == "function") {
1931
- const w = v(n.resolve);
1932
- return P(w);
1967
+ const R = v(r.resolve);
1968
+ return P(R);
1933
1969
  }
1934
- return I(v) ? n.resolve(v) : v;
1970
+ return I(v) ? r.find(v) : v;
1935
1971
  }
1936
- function h(v) {
1972
+ function p(v) {
1937
1973
  if (typeof v == "function") {
1938
- const w = v(n.resolve);
1939
- return h(w);
1974
+ const R = v(r.resolve);
1975
+ return p(R);
1940
1976
  }
1941
1977
  return I(v) ? v : v == null ? void 0 : v.href;
1942
1978
  }
1943
- function m(v) {
1979
+ function h(v) {
1944
1980
  v.preventDefault(), f();
1945
1981
  }
1946
- return (v, w) => (yt(), mn("a", {
1982
+ return (v, R) => (vt(), mr("a", {
1947
1983
  ref_key: "element",
1948
- ref: c,
1984
+ ref: s,
1949
1985
  href: o.value,
1950
- class: yn(["router-link", p.value]),
1951
- onClick: m
1986
+ class: yr(["router-link", d.value]),
1987
+ onClick: h
1952
1988
  }, [
1953
- gt(v.$slots, "default", vt(gn({ route: r.value, isMatch: ue(s), isExactMatch: ue(u), isExternal: ue(i) })))
1954
- ], 10, zr));
1989
+ Rt(v.$slots, "default", wt(gr({ route: n.value, isMatch: ue(c), isExactMatch: ue(i), isExternal: ue(u) })))
1990
+ ], 10, eo));
1955
1991
  }
1956
1992
  });
1957
- function Xr(e, t) {
1958
- const n = qe();
1959
- function r() {
1993
+ function ro(e, t) {
1994
+ const r = _e();
1995
+ function n() {
1960
1996
  if (!e)
1961
1997
  return;
1962
- if (!on(n.route, e, t))
1963
- throw new xn(e, n.route.name);
1998
+ if (!ar(r.route, e, t))
1999
+ throw new xr(e, r.route.name);
1964
2000
  }
1965
- return Re(n.route, r, { immediate: !0, deep: !0 }), n.route;
2001
+ return ge(r.route, n, { immediate: !0, deep: !0 }), r.route;
1966
2002
  }
1967
- const an = Symbol();
1968
- function Xe() {
1969
- return ae(an, 0);
2003
+ const sr = Symbol();
2004
+ function Ze() {
2005
+ return ae(sr, 0);
1970
2006
  }
1971
- function Zr(e, t) {
2007
+ function no(e, t) {
1972
2008
  return se({
1973
2009
  name: "PropsWrapper",
1974
2010
  expose: [],
1975
2011
  setup() {
1976
- const n = t(), r = vn();
1977
- return () => n instanceof Error ? "" : tn(n) ? r != null && r.suspense ? Z(to(e, n)) : Z(eo(e, n)) : Z(e, n);
2012
+ const r = t(), n = vr();
2013
+ return () => r instanceof Error ? "" : rr(r) ? n != null && n.suspense ? Z(ao(e, r)) : Z(oo(e, r)) : Z(e, r);
1978
2014
  }
1979
2015
  });
1980
2016
  }
1981
- function eo(e, t) {
2017
+ function oo(e, t) {
1982
2018
  return se({
1983
2019
  name: "AsyncPropsWrapper",
1984
2020
  expose: [],
1985
2021
  setup() {
1986
- const n = Oe();
1987
- return (async () => n.value = await t)(), () => n.value instanceof Error ? "" : n.value ? Z(e, n.value) : "";
2022
+ const r = qe();
2023
+ return (async () => r.value = await t)(), () => r.value instanceof Error ? "" : r.value ? Z(e, r.value) : "";
1988
2024
  }
1989
2025
  });
1990
2026
  }
1991
- function to(e, t) {
2027
+ function ao(e, t) {
1992
2028
  return se({
1993
2029
  name: "SuspenseAsyncPropsWrapper",
1994
2030
  expose: [],
1995
2031
  async setup() {
1996
- const n = await t;
1997
- return () => Z(e, n);
2032
+ const r = await t;
2033
+ return () => Z(e, r);
1998
2034
  }
1999
2035
  });
2000
2036
  }
2001
- const no = /* @__PURE__ */ se({
2037
+ const so = /* @__PURE__ */ se({
2002
2038
  __name: "routerView",
2003
2039
  props: {
2004
2040
  name: { default: "default" }
2005
2041
  },
2006
2042
  setup(e) {
2007
- const t = Xr(), n = Jn(), r = Xe(), { getProps: o } = rn(), a = Rn("RouterView", !0);
2008
- wn(an, r + 1);
2009
- const c = N(() => {
2010
- if (n.value)
2011
- return n.value.component;
2012
- const i = t.matches.at(r);
2013
- if (!i)
2043
+ const t = ro(), r = Jr(), n = Ze(), { getProps: o } = or(), a = Rr("RouterView", !0);
2044
+ wr(sr, n + 1);
2045
+ const s = N(() => {
2046
+ if (r.value)
2047
+ return r.value.component;
2048
+ const u = t.matches.at(n);
2049
+ if (!u)
2014
2050
  return null;
2015
- const f = s(i), p = o(i.id, e.name, t);
2016
- return f ? p ? Zr(f, () => p) : f : null;
2051
+ const f = c(u), d = o(u.id, e.name, t);
2052
+ return f ? d ? no(f, () => d) : f : null;
2017
2053
  });
2018
- function s(i) {
2019
- return u(i)[e.name];
2054
+ function c(u) {
2055
+ return i(u)[e.name];
2020
2056
  }
2021
- function u(i) {
2022
- return We(i) ? i.components : _e(i) ? { default: i.component } : typeof a == "string" ? {} : { default: a };
2057
+ function i(u) {
2058
+ return We(u) ? u.components : Me(u) ? { default: u.component } : typeof a == "string" ? {} : { default: a };
2023
2059
  }
2024
- return (i, f) => c.value ? gt(i.$slots, "default", vt(Pn({ key: 0 }, { route: ue(t), component: c.value, rejection: ue(n) })), () => [
2025
- (yt(), En(bn(c.value)))
2026
- ]) : Sn("", !0);
2060
+ return (u, f) => s.value ? Rt(u.$slots, "default", wt(Pr({ key: 0 }, { route: ue(t), component: s.value, rejection: ue(r) })), () => [
2061
+ (vt(), Er(br(s.value)))
2062
+ ]) : Sr("", !0);
2027
2063
  }
2028
2064
  });
2029
- function sn() {
2030
- const e = ae(jt);
2065
+ function cr() {
2066
+ const e = ae(qt);
2031
2067
  if (!e)
2032
2068
  throw new pe();
2033
2069
  return e;
2034
2070
  }
2035
- function cn(e) {
2071
+ function ur(e) {
2036
2072
  return (t) => {
2037
- const n = Xe(), o = sn().addBeforeRouteHook({ lifecycle: e, hook: t, depth: n, timing: "component" });
2038
- return Rt(o), o;
2073
+ const r = Ze(), o = cr().addBeforeRouteHook({ lifecycle: e, hook: t, depth: r, timing: "component" });
2074
+ return Pt(o), o;
2039
2075
  };
2040
2076
  }
2041
- function Ze(e) {
2077
+ function et(e) {
2042
2078
  return (t) => {
2043
- const n = Xe(), o = sn().addAfterRouteHook({ lifecycle: e, hook: t, depth: n, timing: "component" });
2044
- return Rt(o), o;
2079
+ const r = Ze(), o = cr().addAfterRouteHook({ lifecycle: e, hook: t, depth: r, timing: "component" });
2080
+ return Pt(o), o;
2045
2081
  };
2046
2082
  }
2047
- const uo = cn("onBeforeRouteUpdate"), io = cn("onBeforeRouteLeave"), fo = Ze("onAfterRouteEnter"), lo = Ze("onAfterRouteUpdate"), ho = Ze("onAfterRouteLeave");
2048
- function ro(e) {
2083
+ const ho = ur("onBeforeRouteUpdate"), po = ur("onBeforeRouteLeave"), mo = et("onAfterRouteEnter"), yo = et("onAfterRouteUpdate"), go = et("onAfterRouteLeave");
2084
+ function co(e) {
2049
2085
  return de(e) && typeof e.value == "string";
2050
2086
  }
2051
- function mt(e) {
2052
- return ro(e) ? e : Gt(e, {});
2087
+ function gt(e) {
2088
+ return co(e) ? e : Gt(e, {});
2053
2089
  }
2054
- function po(e) {
2055
- const t = Je(), n = zt(e.name), r = Yt(e.path), o = Xt(e.query), a = Kt(e.hash), c = e.meta ?? {}, s = $n(e) ? mt(e.host) : mt(""), u = ve({ id: t, meta: {}, state: {}, ...e }), i = {
2090
+ function vo(e) {
2091
+ const t = Je(), r = Yt(e.name), n = Xt(e.path), o = Zt(e.query), a = Kt(e.hash), s = e.meta ?? {}, c = $r(e) ? gt(e.host) : gt(""), i = ye({ id: t, meta: {}, state: {}, ...e }), u = {
2056
2092
  id: t,
2057
- matched: u,
2058
- matches: [u],
2059
- name: n,
2060
- host: s,
2061
- path: r,
2093
+ matched: i,
2094
+ matches: [i],
2095
+ name: r,
2096
+ host: c,
2097
+ path: n,
2062
2098
  query: o,
2063
2099
  hash: a,
2064
- meta: c,
2100
+ meta: s,
2065
2101
  depth: 1,
2066
2102
  state: {}
2067
- }, f = bt(e) ? St(e.parent, i) : i;
2103
+ }, f = kt(e) ? At(e.parent, u) : u;
2068
2104
  return ce(f.path.params, f.query.params, f.host.params), f;
2069
2105
  }
2070
2106
  export {
2071
- kn as DuplicateParamsError,
2072
- An as MetaPropertyConflict,
2073
- Yr as RouterLink,
2107
+ kr as DuplicateParamsError,
2108
+ Ar as MetaPropertyConflict,
2109
+ to as RouterLink,
2074
2110
  pe as RouterNotInstalledError,
2075
- no as RouterView,
2076
- xn as UseRouteInvalidError,
2077
- wt as asUrl,
2078
- po as createExternalRoute,
2079
- Tn as createParam,
2111
+ so as RouterView,
2112
+ xr as UseRouteInvalidError,
2113
+ Et as asUrl,
2114
+ vo as createExternalRoute,
2115
+ Tr as createParam,
2080
2116
  oe as createRoute,
2081
- co as createRouter,
2082
- on as isRoute,
2117
+ lo as createRouter,
2118
+ ar as isRoute,
2083
2119
  I as isUrl,
2084
- fo as onAfterRouteEnter,
2085
- lo as onAfterRouteLeave,
2086
- ho as onAfterRouteUpdate,
2087
- uo as onBeforeRouteLeave,
2088
- io as onBeforeRouteUpdate,
2089
- $e as path,
2090
- ht as query,
2091
- Kr as useLink,
2092
- Xr as useRoute,
2093
- qe as useRouter,
2094
- so as withDefault
2120
+ mo as onAfterRouteEnter,
2121
+ yo as onAfterRouteLeave,
2122
+ go as onAfterRouteUpdate,
2123
+ ho as onBeforeRouteLeave,
2124
+ po as onBeforeRouteUpdate,
2125
+ je as path,
2126
+ dt as query,
2127
+ Zn as useLink,
2128
+ ro as useRoute,
2129
+ _e as useRouter,
2130
+ fo as withDefault
2095
2131
  };