@kitbag/router 0.20.5 → 0.20.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kitbag-router.js +228 -228
- package/dist/kitbag-router.umd.cjs +2 -2
- package/package.json +1 -1
package/dist/kitbag-router.js
CHANGED
|
@@ -82,7 +82,7 @@ function Xr(t, e) {
|
|
|
82
82
|
function tn(t) {
|
|
83
83
|
return Jt(t) && t.defaultValue !== void 0;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function Jo(t, e) {
|
|
86
86
|
return Xr(t, e);
|
|
87
87
|
}
|
|
88
88
|
function en(t) {
|
|
@@ -624,19 +624,19 @@ function Ke(t) {
|
|
|
624
624
|
return pn(t, new RegExp(Ft, "g")).map((e) => e.startsWith(At) ? Ye(e) : ie(e)).join("");
|
|
625
625
|
}
|
|
626
626
|
function Ye(t) {
|
|
627
|
-
return t.replace(new RegExp(Ft, "g"),
|
|
627
|
+
return t.replace(new RegExp(Ft, "g"), gn);
|
|
628
628
|
}
|
|
629
629
|
function yn(t, e) {
|
|
630
630
|
const r = Xe(e);
|
|
631
|
-
return t.replace(r,
|
|
631
|
+
return t.replace(r, Rn);
|
|
632
632
|
}
|
|
633
633
|
function ce(t, e) {
|
|
634
|
-
return
|
|
634
|
+
return wn(e).test(t.value);
|
|
635
635
|
}
|
|
636
636
|
function ue(t) {
|
|
637
637
|
return new RegExp(mn, "g").test(t);
|
|
638
638
|
}
|
|
639
|
-
const Ft = `\\${At}\\??([\\w-_]+)\\${Dt}`, mn = `\\${At}\\?([\\w-_]+)\\${Dt}
|
|
639
|
+
const Ft = `\\${At}\\??([\\w-_]+)\\${Dt}`, mn = `\\${At}\\?([\\w-_]+)\\${Dt}`, gn = ".*", Rn = "(.*)";
|
|
640
640
|
function fe(t) {
|
|
641
641
|
const [e] = tr(t, new RegExp(Ft, "g"));
|
|
642
642
|
return e;
|
|
@@ -644,13 +644,13 @@ function fe(t) {
|
|
|
644
644
|
function Xe(t) {
|
|
645
645
|
return new RegExp(`\\${At}\\??${t}\\${Dt}`, "g");
|
|
646
646
|
}
|
|
647
|
-
function
|
|
647
|
+
function wn(t) {
|
|
648
648
|
return new RegExp(`\\${At}\\?${t}\\${Dt}`, "g");
|
|
649
649
|
}
|
|
650
650
|
function tr(t, e) {
|
|
651
651
|
return Array.from(t.matchAll(e)).flatMap(([, ...n]) => n.map((o) => W(o) ? o : ""));
|
|
652
652
|
}
|
|
653
|
-
function
|
|
653
|
+
function vn(t = "", e = {}) {
|
|
654
654
|
return W(t) ? Array.from(t.matchAll(new RegExp(Ft, "g"))).reduce((n, [o, a]) => {
|
|
655
655
|
const s = fe(o);
|
|
656
656
|
if (!s)
|
|
@@ -659,16 +659,16 @@ function Rn(t = "", e = {}) {
|
|
|
659
659
|
return bt([s], n), n[a] = p, n;
|
|
660
660
|
}, {}) : {};
|
|
661
661
|
}
|
|
662
|
-
function
|
|
662
|
+
function En(t) {
|
|
663
663
|
return mt(t) && typeof t.value == "string";
|
|
664
664
|
}
|
|
665
665
|
function et(t) {
|
|
666
|
-
return t === void 0 ? K() :
|
|
666
|
+
return t === void 0 ? K() : En(t) ? t : K(t, {});
|
|
667
667
|
}
|
|
668
668
|
function K(t, e) {
|
|
669
669
|
return {
|
|
670
670
|
value: t ?? "",
|
|
671
|
-
params:
|
|
671
|
+
params: vn(t, e)
|
|
672
672
|
};
|
|
673
673
|
}
|
|
674
674
|
function er(t, e) {
|
|
@@ -676,23 +676,23 @@ function er(t, e) {
|
|
|
676
676
|
const r = `${t.value}${e.value}`;
|
|
677
677
|
return K(r, { ...t.params, ...e.params });
|
|
678
678
|
}
|
|
679
|
-
function
|
|
679
|
+
function bn(t, e) {
|
|
680
680
|
return er(t, e);
|
|
681
681
|
}
|
|
682
|
-
function
|
|
683
|
-
return
|
|
682
|
+
function Sn(t, e) {
|
|
683
|
+
return Pn(t, e), { ...t, ...e };
|
|
684
684
|
}
|
|
685
|
-
function
|
|
685
|
+
function Pn(t, e) {
|
|
686
686
|
const r = Object.keys(t).find((n) => n in e && typeof e[n] != typeof t[n]);
|
|
687
687
|
if (r)
|
|
688
688
|
throw new Qr(r);
|
|
689
689
|
}
|
|
690
|
-
function
|
|
690
|
+
function An(t, e) {
|
|
691
691
|
bt(t.params, e.params);
|
|
692
692
|
const r = [t.value, e.value].filter(W).join("&");
|
|
693
693
|
return K(r, { ...t.params, ...e.params });
|
|
694
694
|
}
|
|
695
|
-
function
|
|
695
|
+
function xn(t, e) {
|
|
696
696
|
return bt(t, e), { ...t, ...e };
|
|
697
697
|
}
|
|
698
698
|
function rr(t) {
|
|
@@ -714,10 +714,10 @@ function ar(t, e) {
|
|
|
714
714
|
return {
|
|
715
715
|
...e,
|
|
716
716
|
path: er(t.path, e.path),
|
|
717
|
-
query:
|
|
718
|
-
meta:
|
|
719
|
-
state:
|
|
720
|
-
hash:
|
|
717
|
+
query: An(t.query, e.query),
|
|
718
|
+
meta: Sn(t.meta, e.meta),
|
|
719
|
+
state: xn(t.state, e.state),
|
|
720
|
+
hash: bn(t.hash, e.hash),
|
|
721
721
|
matches: [...t.matches, e.matched],
|
|
722
722
|
host: t.host,
|
|
723
723
|
depth: t.depth + 1
|
|
@@ -759,9 +759,9 @@ function de() {
|
|
|
759
759
|
let t = 0;
|
|
760
760
|
return () => (++t).toString();
|
|
761
761
|
}
|
|
762
|
-
const
|
|
763
|
-
function
|
|
764
|
-
return t ===
|
|
762
|
+
const kn = de()();
|
|
763
|
+
function Nn(t) {
|
|
764
|
+
return t === kn;
|
|
765
765
|
}
|
|
766
766
|
const he = de();
|
|
767
767
|
function sr(t) {
|
|
@@ -791,12 +791,12 @@ const Vt = { template: "<div>This is component</div>" }, ye = gt({
|
|
|
791
791
|
parent: ye,
|
|
792
792
|
name: "parentA.childA",
|
|
793
793
|
path: "/childA/[?paramB]"
|
|
794
|
-
}),
|
|
794
|
+
}), Ln = gt({
|
|
795
795
|
parent: ye,
|
|
796
796
|
name: "parentA.childB",
|
|
797
797
|
path: "/childB/[paramD]",
|
|
798
798
|
component: Vt
|
|
799
|
-
}),
|
|
799
|
+
}), Un = gt({
|
|
800
800
|
parent: ir,
|
|
801
801
|
name: "parentA.childA.grandChildA",
|
|
802
802
|
path: "/[paramC]",
|
|
@@ -811,7 +811,7 @@ gt({
|
|
|
811
811
|
path: "/",
|
|
812
812
|
component: Vt
|
|
813
813
|
});
|
|
814
|
-
const
|
|
814
|
+
const Bn = "lazy", Cn = {
|
|
815
815
|
components: !0,
|
|
816
816
|
props: !1
|
|
817
817
|
};
|
|
@@ -823,8 +823,8 @@ function cr({ routerPrefetch: t, routePrefetch: e, linkPrefetch: r }, n) {
|
|
|
823
823
|
o,
|
|
824
824
|
a,
|
|
825
825
|
s,
|
|
826
|
-
|
|
827
|
-
|
|
826
|
+
Cn[n],
|
|
827
|
+
Bn
|
|
828
828
|
].reduce((h, u) => Lt(h) ? h : h === !0 && Lt(u) ? u : h === !0 && !Lt(u) ? h : h === void 0 ? u : h, void 0);
|
|
829
829
|
return Lt(p) ? p : !1;
|
|
830
830
|
}
|
|
@@ -890,7 +890,7 @@ function lr() {
|
|
|
890
890
|
};
|
|
891
891
|
}
|
|
892
892
|
const pr = Symbol();
|
|
893
|
-
function
|
|
893
|
+
function Vn() {
|
|
894
894
|
const { setVueApp: t, runWithContext: e } = lr(), r = qt(/* @__PURE__ */ new Map()), { push: n, replace: o, reject: a } = fr(), s = (v, i, f) => i.matches.filter((c) => cr({ ...f, routePrefetch: c.prefetch }, "props") === v).flatMap((c) => S(c)).reduce((c, { id: l, name: E, props: A }) => {
|
|
895
895
|
if (!A)
|
|
896
896
|
return c;
|
|
@@ -999,14 +999,14 @@ function dr() {
|
|
|
999
999
|
throw new Et();
|
|
1000
1000
|
return t;
|
|
1001
1001
|
}
|
|
1002
|
-
const
|
|
1002
|
+
const Zn = jr(() => new Promise((t) => {
|
|
1003
1003
|
t({ default: { template: "foo" } });
|
|
1004
1004
|
}));
|
|
1005
1005
|
function Ae(t) {
|
|
1006
|
-
return t.name ===
|
|
1006
|
+
return t.name === Zn.name && "__asyncLoader" in t;
|
|
1007
1007
|
}
|
|
1008
1008
|
const hr = Symbol("visibilityObserver");
|
|
1009
|
-
function
|
|
1009
|
+
function On(t) {
|
|
1010
1010
|
const e = it(hr);
|
|
1011
1011
|
if (!e)
|
|
1012
1012
|
throw new Et();
|
|
@@ -1018,15 +1018,15 @@ function Vn(t) {
|
|
|
1018
1018
|
isElementVisible: O(() => t.value ? e.isElementVisible(t.value) : !1)
|
|
1019
1019
|
};
|
|
1020
1020
|
}
|
|
1021
|
-
function
|
|
1021
|
+
function xe(t, e, r) {
|
|
1022
1022
|
ot(t, (n, o) => {
|
|
1023
1023
|
n && n.addEventListener(e, r), o && o.removeEventListener(e, r);
|
|
1024
1024
|
}, { immediate: !0 }), Ht(() => {
|
|
1025
1025
|
t.value && t.value.removeEventListener(e, r);
|
|
1026
1026
|
});
|
|
1027
1027
|
}
|
|
1028
|
-
function
|
|
1029
|
-
const e = /* @__PURE__ */ new Map(), r = Pt(), { getPrefetchProps: n, setPrefetchProps: o } = dr(), { isElementVisible: a } =
|
|
1028
|
+
function jn(t) {
|
|
1029
|
+
const e = /* @__PURE__ */ new Map(), r = Pt(), { getPrefetchProps: n, setPrefetchProps: o } = dr(), { isElementVisible: a } = On(r), s = () => {
|
|
1030
1030
|
const u = Array.from(e.values()).reduce((m, R) => (Object.assign(m, R), m), {});
|
|
1031
1031
|
o(u);
|
|
1032
1032
|
};
|
|
@@ -1035,20 +1035,20 @@ function Zn(t) {
|
|
|
1035
1035
|
}, { immediate: !0 }), ot(a, (u) => {
|
|
1036
1036
|
const { route: m, ...R } = V(t);
|
|
1037
1037
|
!m || !u || h("lazy", m, R);
|
|
1038
|
-
}, { immediate: !0 }),
|
|
1038
|
+
}, { immediate: !0 }), xe(r, "focusin", p), xe(r, "mouseover", p);
|
|
1039
1039
|
function p() {
|
|
1040
1040
|
const { route: u, ...m } = V(t);
|
|
1041
1041
|
u && h("intent", u, m);
|
|
1042
1042
|
}
|
|
1043
1043
|
function h(u, m, R) {
|
|
1044
|
-
|
|
1044
|
+
$n(u, m, R), e.has(u) || e.set(u, n(u, m, R));
|
|
1045
1045
|
}
|
|
1046
1046
|
return {
|
|
1047
1047
|
element: r,
|
|
1048
1048
|
commit: s
|
|
1049
1049
|
};
|
|
1050
1050
|
}
|
|
1051
|
-
function
|
|
1051
|
+
function $n(t, e, r) {
|
|
1052
1052
|
e.matches.forEach((n) => {
|
|
1053
1053
|
cr({
|
|
1054
1054
|
...r,
|
|
@@ -1059,10 +1059,10 @@ function On(t, e, r) {
|
|
|
1059
1059
|
});
|
|
1060
1060
|
}
|
|
1061
1061
|
const yr = Symbol("isRouterRouteSymbol");
|
|
1062
|
-
function
|
|
1062
|
+
function _n(t) {
|
|
1063
1063
|
return typeof t == "object" && t !== null && yr in t;
|
|
1064
1064
|
}
|
|
1065
|
-
function
|
|
1065
|
+
function qn(t, e) {
|
|
1066
1066
|
function r(i, f, c) {
|
|
1067
1067
|
if (typeof i == "object") {
|
|
1068
1068
|
const E = {
|
|
@@ -1144,7 +1144,7 @@ function $n(t, e) {
|
|
|
1144
1144
|
});
|
|
1145
1145
|
}
|
|
1146
1146
|
function re(t, e, { exact: r } = {}) {
|
|
1147
|
-
return
|
|
1147
|
+
return _n(t) ? e === void 0 ? !0 : r ? t.matched.name === e : t.matches.map((n) => n.name).includes(e) : !1;
|
|
1148
1148
|
}
|
|
1149
1149
|
function me(...t) {
|
|
1150
1150
|
const e = new URLSearchParams();
|
|
@@ -1155,7 +1155,7 @@ function me(...t) {
|
|
|
1155
1155
|
}
|
|
1156
1156
|
return e;
|
|
1157
1157
|
}
|
|
1158
|
-
function
|
|
1158
|
+
function Hn(t, e = {}, r = {}) {
|
|
1159
1159
|
const n = It(), o = O(() => {
|
|
1160
1160
|
const i = V(t);
|
|
1161
1161
|
return typeof i != "string" ? i : M(i) ? n.find(i, V(r)) : n.resolve(i, V(e), V(r));
|
|
@@ -1178,7 +1178,7 @@ function _n(t, e = {}, r = {}) {
|
|
|
1178
1178
|
}), m = O(() => !!a.value && n.isExternal(a.value)), R = O(() => {
|
|
1179
1179
|
const i = V(t);
|
|
1180
1180
|
return typeof i != "string" || M(i) ? V(e) : V(r);
|
|
1181
|
-
}), { element: L, commit: S } =
|
|
1181
|
+
}), { element: L, commit: S } = jn(() => ({
|
|
1182
1182
|
route: o.value,
|
|
1183
1183
|
routerPrefetch: n.prefetch,
|
|
1184
1184
|
linkPrefetch: R.value.prefetch
|
|
@@ -1205,10 +1205,10 @@ function _n(t, e = {}, r = {}) {
|
|
|
1205
1205
|
replace: (i) => U({ ...i, replace: !0 })
|
|
1206
1206
|
};
|
|
1207
1207
|
}
|
|
1208
|
-
const
|
|
1208
|
+
const In = ["href"], Dn = {
|
|
1209
1209
|
name: "RouterLink"
|
|
1210
|
-
},
|
|
1211
|
-
...
|
|
1210
|
+
}, Jn = /* @__PURE__ */ vt({
|
|
1211
|
+
...Dn,
|
|
1212
1212
|
props: {
|
|
1213
1213
|
to: {},
|
|
1214
1214
|
prefetch: { type: [Boolean, String, Object], default: void 0 },
|
|
@@ -1221,7 +1221,7 @@ const qn = ["href"], Hn = {
|
|
|
1221
1221
|
const e = t, r = It(), n = O(() => U(e.to)), o = O(() => v(e.to)), a = O(() => {
|
|
1222
1222
|
const { to: f, ...c } = e;
|
|
1223
1223
|
return c;
|
|
1224
|
-
}), { element: s, isMatch: p, isExactMatch: h, isActive: u, isExactActive: m, isExternal: R, push: L } =
|
|
1224
|
+
}), { element: s, isMatch: p, isExactMatch: h, isActive: u, isExactActive: m, isExternal: R, push: L } = Hn(() => typeof e.to == "function" ? e.to(r.resolve) : e.to, a), S = O(() => ({
|
|
1225
1225
|
"router-link--match": p.value,
|
|
1226
1226
|
"router-link--exact-match": h.value,
|
|
1227
1227
|
"router-link--active": u.value,
|
|
@@ -1252,10 +1252,10 @@ const qn = ["href"], Hn = {
|
|
|
1252
1252
|
onClick: i
|
|
1253
1253
|
}, [
|
|
1254
1254
|
_e(f.$slots, "default", qe(Hr({ route: n.value, isMatch: tt(p), isExactMatch: tt(h), isActive: tt(u), isExactActive: tt(m), isExternal: tt(R) })))
|
|
1255
|
-
], 10,
|
|
1255
|
+
], 10, In));
|
|
1256
1256
|
}
|
|
1257
1257
|
}), mr = Symbol();
|
|
1258
|
-
function
|
|
1258
|
+
function Fn() {
|
|
1259
1259
|
const t = it(mr);
|
|
1260
1260
|
if (!t)
|
|
1261
1261
|
throw new Et();
|
|
@@ -1275,7 +1275,7 @@ const gr = Symbol();
|
|
|
1275
1275
|
function Re() {
|
|
1276
1276
|
return it(gr, 0);
|
|
1277
1277
|
}
|
|
1278
|
-
function
|
|
1278
|
+
function Tn(t, e, r) {
|
|
1279
1279
|
return vt({
|
|
1280
1280
|
name: "PropsWrapper",
|
|
1281
1281
|
expose: [],
|
|
@@ -1283,19 +1283,19 @@ function Jn(t, e, r) {
|
|
|
1283
1283
|
const n = Ir(), o = dr(), a = ge();
|
|
1284
1284
|
return () => {
|
|
1285
1285
|
const s = o.getProps(t.id, e, a);
|
|
1286
|
-
return s instanceof Error ? "" : oe(s) ? n != null && n.suspense ? dt(
|
|
1286
|
+
return s instanceof Error ? "" : oe(s) ? n != null && n.suspense ? dt(Wn, { component: r, props: s }) : dt(Mn, { component: r, props: s }) : dt(r, s);
|
|
1287
1287
|
};
|
|
1288
1288
|
}
|
|
1289
1289
|
});
|
|
1290
1290
|
}
|
|
1291
|
-
const
|
|
1291
|
+
const Mn = vt((t) => {
|
|
1292
1292
|
const e = Pt();
|
|
1293
1293
|
return ot(() => t.props, async (r) => {
|
|
1294
1294
|
e.value = await r;
|
|
1295
1295
|
}, { immediate: !0, deep: !0 }), () => e.value instanceof Error ? "" : e.value ? dt(t.component, e.value) : "";
|
|
1296
1296
|
}, {
|
|
1297
1297
|
props: ["component", "props"]
|
|
1298
|
-
}),
|
|
1298
|
+
}), Wn = vt(async (t) => {
|
|
1299
1299
|
const e = Pt();
|
|
1300
1300
|
return e.value = await t.props, ot(() => e.value, async (r) => {
|
|
1301
1301
|
e.value = await r;
|
|
@@ -1303,45 +1303,45 @@ const Fn = vt((t) => {
|
|
|
1303
1303
|
}, {
|
|
1304
1304
|
props: ["component", "props"]
|
|
1305
1305
|
}), Rr = Symbol();
|
|
1306
|
-
function
|
|
1306
|
+
function Gn() {
|
|
1307
1307
|
const t = /* @__PURE__ */ new Map();
|
|
1308
1308
|
return {
|
|
1309
1309
|
getRouteComponents: (r) => {
|
|
1310
1310
|
const n = t.get(r.id);
|
|
1311
1311
|
if (n)
|
|
1312
1312
|
return n;
|
|
1313
|
-
const o =
|
|
1313
|
+
const o = Qn(r);
|
|
1314
1314
|
return t.set(r.id, o), o;
|
|
1315
1315
|
}
|
|
1316
1316
|
};
|
|
1317
1317
|
}
|
|
1318
|
-
function
|
|
1319
|
-
return or(t) ?
|
|
1318
|
+
function Qn(t) {
|
|
1319
|
+
return or(t) ? ke(t, t.components) : nr(t) ? ke(t, { default: t.component }) : { default: wr };
|
|
1320
1320
|
}
|
|
1321
|
-
function
|
|
1321
|
+
function ke(t, e) {
|
|
1322
1322
|
return Object.fromEntries(
|
|
1323
|
-
Object.entries(e).map(([r, n]) => [r,
|
|
1323
|
+
Object.entries(e).map(([r, n]) => [r, Tn(t, r, n)])
|
|
1324
1324
|
);
|
|
1325
1325
|
}
|
|
1326
|
-
function
|
|
1326
|
+
function zn() {
|
|
1327
1327
|
const t = it(Rr);
|
|
1328
1328
|
if (!t)
|
|
1329
1329
|
throw new Et();
|
|
1330
1330
|
return t;
|
|
1331
1331
|
}
|
|
1332
|
-
const
|
|
1332
|
+
const Kn = {
|
|
1333
1333
|
name: "RouterView"
|
|
1334
1334
|
}, wr = /* @__PURE__ */ vt({
|
|
1335
|
-
...
|
|
1335
|
+
...Kn,
|
|
1336
1336
|
props: {
|
|
1337
1337
|
name: { default: "default" }
|
|
1338
1338
|
},
|
|
1339
1339
|
setup(t) {
|
|
1340
|
-
const e = ge(), r = It(), n =
|
|
1340
|
+
const e = ge(), r = It(), n = Fn(), o = Re();
|
|
1341
1341
|
Dr(async () => {
|
|
1342
1342
|
await r.start();
|
|
1343
1343
|
});
|
|
1344
|
-
const { getRouteComponents: a } =
|
|
1344
|
+
const { getRouteComponents: a } = zn();
|
|
1345
1345
|
Jr(gr, o + 1);
|
|
1346
1346
|
const s = O(() => {
|
|
1347
1347
|
if (!r.started.value)
|
|
@@ -1356,7 +1356,7 @@ const Qn = {
|
|
|
1356
1356
|
]) : Fr("", !0);
|
|
1357
1357
|
}
|
|
1358
1358
|
});
|
|
1359
|
-
function
|
|
1359
|
+
function Fo(t, e = String) {
|
|
1360
1360
|
const r = ge(), n = O({
|
|
1361
1361
|
get() {
|
|
1362
1362
|
const a = r.query.get(V(t));
|
|
@@ -1394,11 +1394,11 @@ class st {
|
|
|
1394
1394
|
T(this, "onAfterRouteLeave", /* @__PURE__ */ new Set());
|
|
1395
1395
|
}
|
|
1396
1396
|
}
|
|
1397
|
-
const
|
|
1397
|
+
const xt = (t, e, r) => {
|
|
1398
1398
|
var a, s;
|
|
1399
1399
|
const n = t.matches, o = (e == null ? void 0 : e.matches) ?? [];
|
|
1400
1400
|
return ((a = n.at(r)) == null ? void 0 : a.id) !== ((s = o.at(r)) == null ? void 0 : s.id);
|
|
1401
|
-
},
|
|
1401
|
+
}, kt = (t, e, r) => {
|
|
1402
1402
|
var a, s;
|
|
1403
1403
|
const n = t.matches, o = (e == null ? void 0 : e.matches) ?? [];
|
|
1404
1404
|
return ((a = n.at(r)) == null ? void 0 : a.id) !== ((s = o.at(r)) == null ? void 0 : s.id);
|
|
@@ -1410,57 +1410,57 @@ function Ne(t) {
|
|
|
1410
1410
|
switch (t) {
|
|
1411
1411
|
case "onBeforeRouteEnter":
|
|
1412
1412
|
case "onAfterRouteEnter":
|
|
1413
|
-
return
|
|
1413
|
+
return xt;
|
|
1414
1414
|
case "onBeforeRouteUpdate":
|
|
1415
1415
|
case "onAfterRouteUpdate":
|
|
1416
1416
|
return Nt;
|
|
1417
1417
|
case "onBeforeRouteLeave":
|
|
1418
1418
|
case "onAfterRouteLeave":
|
|
1419
|
-
return
|
|
1419
|
+
return kt;
|
|
1420
1420
|
default:
|
|
1421
1421
|
throw new Error(`Switch is not exhaustive for lifecycle: ${t}`);
|
|
1422
1422
|
}
|
|
1423
1423
|
}
|
|
1424
|
-
function
|
|
1424
|
+
function Yn(t, e) {
|
|
1425
1425
|
const r = new st();
|
|
1426
1426
|
return t.matches.forEach((n, o) => {
|
|
1427
|
-
n.onBeforeRouteEnter &&
|
|
1427
|
+
n.onBeforeRouteEnter && xt(t, e, o) && ht(n.onBeforeRouteEnter).forEach((a) => r.onBeforeRouteEnter.add(a)), n.onBeforeRouteUpdate && Nt(t, e, o) && ht(n.onBeforeRouteUpdate).forEach((a) => r.onBeforeRouteUpdate.add(a));
|
|
1428
1428
|
}), e == null || e.matches.forEach((n, o) => {
|
|
1429
|
-
n.onBeforeRouteLeave &&
|
|
1429
|
+
n.onBeforeRouteLeave && kt(t, e, o) && ht(n.onBeforeRouteLeave).forEach((a) => r.onBeforeRouteLeave.add(a));
|
|
1430
1430
|
}), r;
|
|
1431
1431
|
}
|
|
1432
|
-
function
|
|
1432
|
+
function Xn(t, e) {
|
|
1433
1433
|
const r = new st();
|
|
1434
1434
|
return t.matches.forEach((n, o) => {
|
|
1435
|
-
n.onAfterRouteEnter &&
|
|
1435
|
+
n.onAfterRouteEnter && xt(t, e, o) && ht(n.onAfterRouteEnter).forEach((a) => r.onAfterRouteEnter.add(a)), n.onAfterRouteUpdate && Nt(t, e, o) && ht(n.onAfterRouteUpdate).forEach((a) => r.onAfterRouteUpdate.add(a));
|
|
1436
1436
|
}), e == null || e.matches.forEach((n, o) => {
|
|
1437
|
-
n.onAfterRouteLeave &&
|
|
1437
|
+
n.onAfterRouteLeave && kt(t, e, o) && ht(n.onAfterRouteLeave).forEach((a) => r.onAfterRouteLeave.add(a));
|
|
1438
1438
|
}), r;
|
|
1439
1439
|
}
|
|
1440
|
-
function
|
|
1440
|
+
function to(t, e, r) {
|
|
1441
1441
|
const n = new st();
|
|
1442
1442
|
return t.matches.forEach((o, a) => {
|
|
1443
|
-
|
|
1443
|
+
xt(t, e, a) && r.onBeforeRouteEnter.forEach((s) => n.onBeforeRouteEnter.add(s)), Nt(t, e, a) && r.onBeforeRouteUpdate.forEach((s) => n.onBeforeRouteUpdate.add(s));
|
|
1444
1444
|
}), e == null || e.matches.forEach((o, a) => {
|
|
1445
|
-
|
|
1445
|
+
kt(t, e, a) && r.onBeforeRouteLeave.forEach((s) => n.onBeforeRouteLeave.add(s));
|
|
1446
1446
|
}), n;
|
|
1447
1447
|
}
|
|
1448
|
-
function
|
|
1448
|
+
function eo(t, e, r) {
|
|
1449
1449
|
const n = new st();
|
|
1450
1450
|
return t.matches.forEach((o, a) => {
|
|
1451
|
-
|
|
1451
|
+
xt(t, e, a) && r.onAfterRouteEnter.forEach((s) => n.onAfterRouteEnter.add(s)), Nt(t, e, a) && r.onAfterRouteUpdate.forEach((s) => n.onAfterRouteUpdate.add(s));
|
|
1452
1452
|
}), e == null || e.matches.forEach((o, a) => {
|
|
1453
|
-
|
|
1453
|
+
kt(t, e, a) && r.onAfterRouteLeave.forEach((s) => n.onAfterRouteLeave.add(s));
|
|
1454
1454
|
}), n;
|
|
1455
1455
|
}
|
|
1456
1456
|
const vr = Symbol();
|
|
1457
|
-
function
|
|
1457
|
+
function ro() {
|
|
1458
1458
|
const { setVueApp: t, runWithContext: e } = lr(), r = {
|
|
1459
1459
|
global: new st(),
|
|
1460
1460
|
component: new st()
|
|
1461
1461
|
}, { reject: n, push: o, replace: a, abort: s } = fr(), p = (c) => (r.global.onBeforeRouteEnter.add(c), () => r.global.onBeforeRouteEnter.delete(c)), h = (c) => (r.global.onBeforeRouteUpdate.add(c), () => r.global.onBeforeRouteUpdate.delete(c)), u = (c) => (r.global.onBeforeRouteLeave.add(c), () => r.global.onBeforeRouteLeave.delete(c)), m = (c) => (r.global.onAfterRouteEnter.add(c), () => r.global.onAfterRouteEnter.delete(c)), R = (c) => (r.global.onAfterRouteUpdate.add(c), () => r.global.onAfterRouteUpdate.delete(c)), L = (c) => (r.global.onAfterRouteLeave.add(c), () => r.global.onAfterRouteLeave.delete(c));
|
|
1462
1462
|
async function S({ to: c, from: l }) {
|
|
1463
|
-
const { global: E, component: A } = r, P =
|
|
1463
|
+
const { global: E, component: A } = r, P = Yn(c, l), g = to(c, l, E), d = [
|
|
1464
1464
|
...g.onBeforeRouteEnter,
|
|
1465
1465
|
...P.onBeforeRouteEnter,
|
|
1466
1466
|
...g.onBeforeRouteUpdate,
|
|
@@ -1471,7 +1471,7 @@ function to() {
|
|
|
1471
1471
|
...A.onBeforeRouteLeave
|
|
1472
1472
|
];
|
|
1473
1473
|
try {
|
|
1474
|
-
const y = d.map((
|
|
1474
|
+
const y = d.map((x) => e(() => x(c, {
|
|
1475
1475
|
from: l,
|
|
1476
1476
|
reject: n,
|
|
1477
1477
|
push: o,
|
|
@@ -1489,7 +1489,7 @@ function to() {
|
|
|
1489
1489
|
};
|
|
1490
1490
|
}
|
|
1491
1491
|
async function U({ to: c, from: l }) {
|
|
1492
|
-
const { global: E, component: A } = r, P =
|
|
1492
|
+
const { global: E, component: A } = r, P = Xn(c, l), g = eo(c, l, E), d = [
|
|
1493
1493
|
...A.onAfterRouteLeave,
|
|
1494
1494
|
...P.onAfterRouteLeave,
|
|
1495
1495
|
...g.onAfterRouteLeave,
|
|
@@ -1501,7 +1501,7 @@ function to() {
|
|
|
1501
1501
|
...g.onAfterRouteEnter
|
|
1502
1502
|
];
|
|
1503
1503
|
try {
|
|
1504
|
-
const y = d.map((
|
|
1504
|
+
const y = d.map((x) => e(() => x(c, {
|
|
1505
1505
|
from: l,
|
|
1506
1506
|
reject: n,
|
|
1507
1507
|
push: o,
|
|
@@ -1564,7 +1564,7 @@ function Sr(t) {
|
|
|
1564
1564
|
return Ht(o), o;
|
|
1565
1565
|
};
|
|
1566
1566
|
}
|
|
1567
|
-
const
|
|
1567
|
+
const To = br("onBeforeRouteLeave"), Mo = br("onBeforeRouteUpdate"), Wo = Sr("onAfterRouteLeave"), Go = Sr("onAfterRouteUpdate");
|
|
1568
1568
|
function X() {
|
|
1569
1569
|
return X = Object.assign ? Object.assign.bind() : function(t) {
|
|
1570
1570
|
for (var e = 1; e < arguments.length; e++) {
|
|
@@ -1592,18 +1592,18 @@ function rt(t, e) {
|
|
|
1592
1592
|
}
|
|
1593
1593
|
}
|
|
1594
1594
|
}
|
|
1595
|
-
var Ot = "beforeunload",
|
|
1595
|
+
var Ot = "beforeunload", no = "hashchange", Pr = "popstate";
|
|
1596
1596
|
function Le(t) {
|
|
1597
1597
|
t === void 0 && (t = {});
|
|
1598
1598
|
var e = t, r = e.window, n = r === void 0 ? document.defaultView : r, o = n.history;
|
|
1599
1599
|
function a() {
|
|
1600
|
-
var g = n.location, d = g.pathname, y = g.search,
|
|
1601
|
-
return [
|
|
1600
|
+
var g = n.location, d = g.pathname, y = g.search, x = g.hash, k = o.state || {};
|
|
1601
|
+
return [k.idx, Rt({
|
|
1602
1602
|
pathname: d,
|
|
1603
1603
|
search: y,
|
|
1604
|
-
hash:
|
|
1605
|
-
state:
|
|
1606
|
-
key:
|
|
1604
|
+
hash: x,
|
|
1605
|
+
state: k.usr || null,
|
|
1606
|
+
key: k.key || "default"
|
|
1607
1607
|
})];
|
|
1608
1608
|
}
|
|
1609
1609
|
var s = null;
|
|
@@ -1611,17 +1611,17 @@ function Le(t) {
|
|
|
1611
1611
|
if (s)
|
|
1612
1612
|
S.call(s), s = null;
|
|
1613
1613
|
else {
|
|
1614
|
-
var g = $.Pop, d = a(), y = d[0],
|
|
1614
|
+
var g = $.Pop, d = a(), y = d[0], x = d[1];
|
|
1615
1615
|
if (S.length)
|
|
1616
1616
|
if (y != null) {
|
|
1617
|
-
var
|
|
1618
|
-
|
|
1617
|
+
var k = m - y;
|
|
1618
|
+
k && (s = {
|
|
1619
1619
|
action: g,
|
|
1620
|
-
location:
|
|
1620
|
+
location: x,
|
|
1621
1621
|
retry: function() {
|
|
1622
|
-
A(
|
|
1622
|
+
A(k * -1);
|
|
1623
1623
|
}
|
|
1624
|
-
}, A(
|
|
1624
|
+
}, A(k));
|
|
1625
1625
|
} else
|
|
1626
1626
|
process.env.NODE_ENV !== "production" && rt(
|
|
1627
1627
|
!1,
|
|
@@ -1675,12 +1675,12 @@ function Le(t) {
|
|
|
1675
1675
|
});
|
|
1676
1676
|
}
|
|
1677
1677
|
function l(g, d) {
|
|
1678
|
-
var y = $.Push,
|
|
1679
|
-
function
|
|
1678
|
+
var y = $.Push, x = v(g, d);
|
|
1679
|
+
function k() {
|
|
1680
1680
|
l(g, d);
|
|
1681
1681
|
}
|
|
1682
|
-
if (f(y,
|
|
1683
|
-
var C = i(
|
|
1682
|
+
if (f(y, x, k)) {
|
|
1683
|
+
var C = i(x, m + 1), j = C[0], _ = C[1];
|
|
1684
1684
|
try {
|
|
1685
1685
|
o.pushState(j, "", _);
|
|
1686
1686
|
} catch {
|
|
@@ -1690,12 +1690,12 @@ function Le(t) {
|
|
|
1690
1690
|
}
|
|
1691
1691
|
}
|
|
1692
1692
|
function E(g, d) {
|
|
1693
|
-
var y = $.Replace,
|
|
1694
|
-
function
|
|
1693
|
+
var y = $.Replace, x = v(g, d);
|
|
1694
|
+
function k() {
|
|
1695
1695
|
E(g, d);
|
|
1696
1696
|
}
|
|
1697
|
-
if (f(y,
|
|
1698
|
-
var C = i(
|
|
1697
|
+
if (f(y, x, k)) {
|
|
1698
|
+
var C = i(x, m), j = C[0], _ = C[1];
|
|
1699
1699
|
o.replaceState(j, "", _), c(y);
|
|
1700
1700
|
}
|
|
1701
1701
|
}
|
|
@@ -1731,13 +1731,13 @@ function Le(t) {
|
|
|
1731
1731
|
};
|
|
1732
1732
|
return P;
|
|
1733
1733
|
}
|
|
1734
|
-
function
|
|
1734
|
+
function oo(t) {
|
|
1735
1735
|
t === void 0 && (t = {});
|
|
1736
1736
|
var e = t, r = e.window, n = r === void 0 ? document.defaultView : r, o = n.history;
|
|
1737
1737
|
function a() {
|
|
1738
|
-
var d = St(n.location.hash.substr(1)), y = d.pathname,
|
|
1738
|
+
var d = St(n.location.hash.substr(1)), y = d.pathname, x = y === void 0 ? "/" : y, k = d.search, C = k === void 0 ? "" : k, j = d.hash, _ = j === void 0 ? "" : j, q = o.state || {};
|
|
1739
1739
|
return [q.idx, Rt({
|
|
1740
|
-
pathname:
|
|
1740
|
+
pathname: x,
|
|
1741
1741
|
search: C,
|
|
1742
1742
|
hash: _,
|
|
1743
1743
|
state: q.usr || null,
|
|
@@ -1749,13 +1749,13 @@ function ro(t) {
|
|
|
1749
1749
|
if (s)
|
|
1750
1750
|
S.call(s), s = null;
|
|
1751
1751
|
else {
|
|
1752
|
-
var d = $.Pop, y = a(),
|
|
1752
|
+
var d = $.Pop, y = a(), x = y[0], k = y[1];
|
|
1753
1753
|
if (S.length)
|
|
1754
|
-
if (
|
|
1755
|
-
var C = m -
|
|
1754
|
+
if (x != null) {
|
|
1755
|
+
var C = m - x;
|
|
1756
1756
|
C && (s = {
|
|
1757
1757
|
action: d,
|
|
1758
|
-
location:
|
|
1758
|
+
location: k,
|
|
1759
1759
|
retry: function() {
|
|
1760
1760
|
P(C * -1);
|
|
1761
1761
|
}
|
|
@@ -1772,7 +1772,7 @@ function ro(t) {
|
|
|
1772
1772
|
l(d);
|
|
1773
1773
|
}
|
|
1774
1774
|
}
|
|
1775
|
-
n.addEventListener(Pr, p), n.addEventListener(
|
|
1775
|
+
n.addEventListener(Pr, p), n.addEventListener(no, function() {
|
|
1776
1776
|
var d = a(), y = d[1];
|
|
1777
1777
|
nt(y) !== nt(R) && p();
|
|
1778
1778
|
});
|
|
@@ -1783,8 +1783,8 @@ function ro(t) {
|
|
|
1783
1783
|
function U() {
|
|
1784
1784
|
var d = document.querySelector("base"), y = "";
|
|
1785
1785
|
if (d && d.getAttribute("href")) {
|
|
1786
|
-
var
|
|
1787
|
-
y =
|
|
1786
|
+
var x = n.location.href, k = x.indexOf("#");
|
|
1787
|
+
y = k === -1 ? x : x.slice(0, k);
|
|
1788
1788
|
}
|
|
1789
1789
|
return y;
|
|
1790
1790
|
}
|
|
@@ -1808,11 +1808,11 @@ function ro(t) {
|
|
|
1808
1808
|
idx: y
|
|
1809
1809
|
}, v(d)];
|
|
1810
1810
|
}
|
|
1811
|
-
function c(d, y,
|
|
1811
|
+
function c(d, y, x) {
|
|
1812
1812
|
return !S.length || (S.call({
|
|
1813
1813
|
action: d,
|
|
1814
1814
|
location: y,
|
|
1815
|
-
retry:
|
|
1815
|
+
retry: x
|
|
1816
1816
|
}), !1);
|
|
1817
1817
|
}
|
|
1818
1818
|
function l(d) {
|
|
@@ -1824,28 +1824,28 @@ function ro(t) {
|
|
|
1824
1824
|
});
|
|
1825
1825
|
}
|
|
1826
1826
|
function E(d, y) {
|
|
1827
|
-
var
|
|
1827
|
+
var x = $.Push, k = i(d, y);
|
|
1828
1828
|
function C() {
|
|
1829
1829
|
E(d, y);
|
|
1830
1830
|
}
|
|
1831
|
-
if (process.env.NODE_ENV !== "production" && rt(
|
|
1832
|
-
var j = f(
|
|
1831
|
+
if (process.env.NODE_ENV !== "production" && rt(k.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.push(" + JSON.stringify(d) + ")"), c(x, k, C)) {
|
|
1832
|
+
var j = f(k, m + 1), _ = j[0], q = j[1];
|
|
1833
1833
|
try {
|
|
1834
1834
|
o.pushState(_, "", q);
|
|
1835
1835
|
} catch {
|
|
1836
1836
|
n.location.assign(q);
|
|
1837
1837
|
}
|
|
1838
|
-
l(
|
|
1838
|
+
l(x);
|
|
1839
1839
|
}
|
|
1840
1840
|
}
|
|
1841
1841
|
function A(d, y) {
|
|
1842
|
-
var
|
|
1842
|
+
var x = $.Replace, k = i(d, y);
|
|
1843
1843
|
function C() {
|
|
1844
1844
|
A(d, y);
|
|
1845
1845
|
}
|
|
1846
|
-
if (process.env.NODE_ENV !== "production" && rt(
|
|
1847
|
-
var j = f(
|
|
1848
|
-
o.replaceState(_, "", q), l(
|
|
1846
|
+
if (process.env.NODE_ENV !== "production" && rt(k.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(d) + ")"), c(x, k, C)) {
|
|
1847
|
+
var j = f(k, m), _ = j[0], q = j[1];
|
|
1848
|
+
o.replaceState(_, "", q), l(x);
|
|
1849
1849
|
}
|
|
1850
1850
|
}
|
|
1851
1851
|
function P(d) {
|
|
@@ -1872,9 +1872,9 @@ function ro(t) {
|
|
|
1872
1872
|
return L.push(y);
|
|
1873
1873
|
},
|
|
1874
1874
|
block: function(y) {
|
|
1875
|
-
var
|
|
1875
|
+
var x = S.push(y);
|
|
1876
1876
|
return S.length === 1 && n.addEventListener(Ot, jt), function() {
|
|
1877
|
-
|
|
1877
|
+
x(), S.length || n.removeEventListener(Ot, jt);
|
|
1878
1878
|
};
|
|
1879
1879
|
}
|
|
1880
1880
|
};
|
|
@@ -2012,13 +2012,13 @@ function St(t) {
|
|
|
2012
2012
|
return e;
|
|
2013
2013
|
}
|
|
2014
2014
|
const Ar = Symbol();
|
|
2015
|
-
function
|
|
2015
|
+
function ao(t, e) {
|
|
2016
2016
|
const r = qt({ ...t }), n = (s) => {
|
|
2017
2017
|
Object.assign(r, {
|
|
2018
2018
|
[Ar]: !1,
|
|
2019
2019
|
...s
|
|
2020
2020
|
});
|
|
2021
|
-
}, o = r, a =
|
|
2021
|
+
}, o = r, a = qn(o, e);
|
|
2022
2022
|
return {
|
|
2023
2023
|
currentRoute: o,
|
|
2024
2024
|
routerRoute: a,
|
|
@@ -2026,9 +2026,9 @@ function no(t, e) {
|
|
|
2026
2026
|
};
|
|
2027
2027
|
}
|
|
2028
2028
|
function I(t) {
|
|
2029
|
-
return !t.startsWith("http") ?
|
|
2029
|
+
return !t.startsWith("http") ? io(t) : so(t);
|
|
2030
2030
|
}
|
|
2031
|
-
function
|
|
2031
|
+
function so(t) {
|
|
2032
2032
|
const { protocol: e, host: r, pathname: n, search: o, searchParams: a, hash: s } = new URL(t, t);
|
|
2033
2033
|
return {
|
|
2034
2034
|
protocol: e,
|
|
@@ -2039,7 +2039,7 @@ function oo(t) {
|
|
|
2039
2039
|
hash: s
|
|
2040
2040
|
};
|
|
2041
2041
|
}
|
|
2042
|
-
function
|
|
2042
|
+
function io(t) {
|
|
2043
2043
|
const { pathname: e, search: r, searchParams: n, hash: o } = new URL(t, "https://localhost");
|
|
2044
2044
|
return {
|
|
2045
2045
|
pathname: e,
|
|
@@ -2048,14 +2048,14 @@ function ao(t) {
|
|
|
2048
2048
|
hash: o
|
|
2049
2049
|
};
|
|
2050
2050
|
}
|
|
2051
|
-
function
|
|
2051
|
+
function co(t) {
|
|
2052
2052
|
return (e) => {
|
|
2053
2053
|
const { host: r } = I(e);
|
|
2054
2054
|
return !(r === void 0 || r === t);
|
|
2055
2055
|
};
|
|
2056
2056
|
}
|
|
2057
|
-
function
|
|
2058
|
-
const r =
|
|
2057
|
+
function uo({ mode: t, listener: e }) {
|
|
2058
|
+
const r = fo(t), n = (h, u) => {
|
|
2059
2059
|
if (u != null && u.replace) {
|
|
2060
2060
|
r.replace(h, u.state);
|
|
2061
2061
|
return;
|
|
@@ -2078,7 +2078,7 @@ function io({ mode: t, listener: e }) {
|
|
|
2078
2078
|
}
|
|
2079
2079
|
};
|
|
2080
2080
|
}
|
|
2081
|
-
function
|
|
2081
|
+
function fo(t = "auto") {
|
|
2082
2082
|
switch (t) {
|
|
2083
2083
|
case "auto":
|
|
2084
2084
|
return le() ? Le() : Ue();
|
|
@@ -2087,20 +2087,20 @@ function co(t = "auto") {
|
|
|
2087
2087
|
case "memory":
|
|
2088
2088
|
return Ue();
|
|
2089
2089
|
case "hash":
|
|
2090
|
-
return
|
|
2090
|
+
return oo();
|
|
2091
2091
|
default:
|
|
2092
2092
|
const e = t;
|
|
2093
2093
|
throw new Error(`Switch is not exhaustive for mode: ${e}`);
|
|
2094
2094
|
}
|
|
2095
2095
|
}
|
|
2096
|
-
function
|
|
2096
|
+
function lo(t) {
|
|
2097
2097
|
return vt(() => () => dt("h1", t), {
|
|
2098
2098
|
name: t,
|
|
2099
2099
|
props: []
|
|
2100
2100
|
});
|
|
2101
2101
|
}
|
|
2102
|
-
function
|
|
2103
|
-
const e = (a) => Ut(t[a] ??
|
|
2102
|
+
function po(t) {
|
|
2103
|
+
const e = (a) => Ut(t[a] ?? lo(a)), r = (a) => {
|
|
2104
2104
|
const s = Ut(e(a)), p = {
|
|
2105
2105
|
id: he(),
|
|
2106
2106
|
component: s,
|
|
@@ -2133,39 +2133,39 @@ function fo(t) {
|
|
|
2133
2133
|
getRejectionRoute: r
|
|
2134
2134
|
};
|
|
2135
2135
|
}
|
|
2136
|
-
class
|
|
2136
|
+
class ho extends Error {
|
|
2137
2137
|
constructor() {
|
|
2138
2138
|
super("initialUrl must be set if window.location is unavailable");
|
|
2139
2139
|
}
|
|
2140
2140
|
}
|
|
2141
|
-
function
|
|
2141
|
+
function yo(t) {
|
|
2142
2142
|
if (t)
|
|
2143
2143
|
return t;
|
|
2144
2144
|
if (le())
|
|
2145
2145
|
return window.location.toString();
|
|
2146
|
-
throw new
|
|
2146
|
+
throw new ho();
|
|
2147
2147
|
}
|
|
2148
|
-
function
|
|
2148
|
+
function xr(t) {
|
|
2149
2149
|
return !!t && typeof t == "object";
|
|
2150
2150
|
}
|
|
2151
2151
|
const _t = !0;
|
|
2152
|
-
function
|
|
2153
|
-
if (
|
|
2152
|
+
function mo(t, e, r) {
|
|
2153
|
+
if (xr(t) && e in t) {
|
|
2154
2154
|
const n = t[e];
|
|
2155
2155
|
return typeof n == "string" ? at(n, r, _t) : n;
|
|
2156
2156
|
}
|
|
2157
2157
|
return at(void 0, r, _t);
|
|
2158
2158
|
}
|
|
2159
|
-
function
|
|
2159
|
+
function kr(t, e) {
|
|
2160
2160
|
const r = {};
|
|
2161
2161
|
for (const [n, o] of Object.entries(t)) {
|
|
2162
|
-
const a =
|
|
2162
|
+
const a = mo(e, n, o);
|
|
2163
2163
|
r[n] = a;
|
|
2164
2164
|
}
|
|
2165
2165
|
return r;
|
|
2166
2166
|
}
|
|
2167
|
-
function
|
|
2168
|
-
if (
|
|
2167
|
+
function go(t, e, r) {
|
|
2168
|
+
if (xr(t) && e in t) {
|
|
2169
2169
|
const n = t[e];
|
|
2170
2170
|
return z(n, r, _t);
|
|
2171
2171
|
}
|
|
@@ -2174,12 +2174,12 @@ function yo(t, e, r) {
|
|
|
2174
2174
|
const Ce = (t, e) => {
|
|
2175
2175
|
const r = {};
|
|
2176
2176
|
for (const [n, o] of Object.entries(t)) {
|
|
2177
|
-
const a =
|
|
2177
|
+
const a = go(e, n, o);
|
|
2178
2178
|
r[n] = a;
|
|
2179
2179
|
}
|
|
2180
2180
|
return r;
|
|
2181
2181
|
};
|
|
2182
|
-
function
|
|
2182
|
+
function Ro() {
|
|
2183
2183
|
const t = qt(/* @__PURE__ */ new Map()), e = le() ? s() : null, r = (p) => {
|
|
2184
2184
|
t.set(p, !1), e == null || e.observe(p);
|
|
2185
2185
|
}, n = (p) => {
|
|
@@ -2201,7 +2201,7 @@ function mo() {
|
|
|
2201
2201
|
isElementVisible: a
|
|
2202
2202
|
};
|
|
2203
2203
|
}
|
|
2204
|
-
class
|
|
2204
|
+
class wo extends Error {
|
|
2205
2205
|
constructor(e) {
|
|
2206
2206
|
super(`Route not found: "${e}"`);
|
|
2207
2207
|
}
|
|
@@ -2220,18 +2220,18 @@ function Ur({ protocol: t, host: e, pathname: r, search: n, searchParams: o, has
|
|
|
2220
2220
|
const p = s.toString().replace(/^https:\/\/localhost\/*/, "/");
|
|
2221
2221
|
return He(p);
|
|
2222
2222
|
}
|
|
2223
|
-
function
|
|
2224
|
-
const { params: r = {}, query: n } = e, o =
|
|
2223
|
+
function vo(t, e = {}) {
|
|
2224
|
+
const { params: r = {}, query: n } = e, o = bo(t.query, r), a = me(o, n), s = Ve(t.path, r), p = t.hash.value ? Ve(t.hash, r) : e.hash, h = Eo(t.host, r), { protocol: u, host: m } = I(h);
|
|
2225
2225
|
return Ur({ protocol: u, host: m, pathname: s, searchParams: a, hash: p });
|
|
2226
2226
|
}
|
|
2227
|
-
function
|
|
2227
|
+
function Eo(t, e) {
|
|
2228
2228
|
const r = t.value && !t.value.startsWith("http") ? `https://${t.value}` : t.value;
|
|
2229
2229
|
return Object.keys(t.params).reduce((n, o) => Lr(n, t, o, e[o]), r);
|
|
2230
2230
|
}
|
|
2231
2231
|
function Ve(t, e) {
|
|
2232
2232
|
return Object.keys(t.params).reduce((r, n) => Lr(r, t, n, e[n]), t.value);
|
|
2233
2233
|
}
|
|
2234
|
-
function
|
|
2234
|
+
function bo(t, e) {
|
|
2235
2235
|
const r = new URLSearchParams(t.value);
|
|
2236
2236
|
if (!t.value)
|
|
2237
2237
|
return r;
|
|
@@ -2244,7 +2244,7 @@ function vo(t, e) {
|
|
|
2244
2244
|
}
|
|
2245
2245
|
return r;
|
|
2246
2246
|
}
|
|
2247
|
-
const
|
|
2247
|
+
const So = (t, e) => {
|
|
2248
2248
|
try {
|
|
2249
2249
|
we(t, e);
|
|
2250
2250
|
} catch {
|
|
@@ -2256,7 +2256,7 @@ const Eo = (t, e) => {
|
|
|
2256
2256
|
return {
|
|
2257
2257
|
...zt(t.host, `${r}//${n}`),
|
|
2258
2258
|
...zt(t.path, o),
|
|
2259
|
-
...
|
|
2259
|
+
...Po(t.query, a),
|
|
2260
2260
|
...zt(t.hash, s)
|
|
2261
2261
|
};
|
|
2262
2262
|
};
|
|
@@ -2268,7 +2268,7 @@ function zt(t, e) {
|
|
|
2268
2268
|
}
|
|
2269
2269
|
return r;
|
|
2270
2270
|
}
|
|
2271
|
-
function
|
|
2271
|
+
function Po(t, e) {
|
|
2272
2272
|
const r = {}, n = new URLSearchParams(t.value), o = new URLSearchParams(e);
|
|
2273
2273
|
for (const [a, s] of Array.from(n.entries())) {
|
|
2274
2274
|
const p = fe(s);
|
|
@@ -2279,8 +2279,8 @@ function bo(t, e) {
|
|
|
2279
2279
|
}
|
|
2280
2280
|
return r;
|
|
2281
2281
|
}
|
|
2282
|
-
function
|
|
2283
|
-
const n =
|
|
2282
|
+
function Ao(t, e = {}, r = {}) {
|
|
2283
|
+
const n = vo(t, {
|
|
2284
2284
|
params: e,
|
|
2285
2285
|
query: r.query,
|
|
2286
2286
|
hash: r.hash
|
|
@@ -2292,22 +2292,22 @@ function So(t, e = {}, r = {}) {
|
|
|
2292
2292
|
name: t.name,
|
|
2293
2293
|
query: pe(o),
|
|
2294
2294
|
params: we(t, n),
|
|
2295
|
-
state:
|
|
2295
|
+
state: kr(t.state, r.state),
|
|
2296
2296
|
hash: a,
|
|
2297
2297
|
href: n
|
|
2298
2298
|
};
|
|
2299
2299
|
}
|
|
2300
|
-
const
|
|
2300
|
+
const xo = (t) => "name" in t.matched && !!t.matched.name, ko = (t, e) => {
|
|
2301
2301
|
const { pathname: r } = I(e);
|
|
2302
2302
|
return dn(t).test(r);
|
|
2303
|
-
},
|
|
2303
|
+
}, No = (t, e) => {
|
|
2304
2304
|
const { search: r } = I(e);
|
|
2305
2305
|
return hn(t).every((o) => o.test(r));
|
|
2306
2306
|
}, ne = (t, e) => {
|
|
2307
2307
|
const { hash: r } = I(e), { value: n } = t.hash;
|
|
2308
2308
|
return W(n) ? `#${n.replace(/^#*/, "")}`.toLowerCase() === r.toLowerCase() : !0;
|
|
2309
2309
|
};
|
|
2310
|
-
function
|
|
2310
|
+
function Lo(t) {
|
|
2311
2311
|
const { searchParams: e, pathname: r } = I(t), n = -1, o = 1;
|
|
2312
2312
|
return (a, s) => {
|
|
2313
2313
|
const p = Oe(a, e), h = Ze(a, r), u = Oe(s, e), m = Ze(s, r);
|
|
@@ -2322,19 +2322,19 @@ function Oe(t, e) {
|
|
|
2322
2322
|
const r = new URLSearchParams(e), n = new URLSearchParams(t.query.value), o = Array.from(n.keys()), a = o.filter((s) => !r.has(s));
|
|
2323
2323
|
return o.length - a.length;
|
|
2324
2324
|
}
|
|
2325
|
-
const
|
|
2326
|
-
|
|
2327
|
-
Ao,
|
|
2325
|
+
const Uo = [
|
|
2326
|
+
xo,
|
|
2328
2327
|
ko,
|
|
2328
|
+
No,
|
|
2329
2329
|
ne,
|
|
2330
|
-
|
|
2330
|
+
So
|
|
2331
2331
|
];
|
|
2332
|
-
function
|
|
2333
|
-
const r =
|
|
2334
|
-
return t.filter((n) =>
|
|
2332
|
+
function Bo(t, e) {
|
|
2333
|
+
const r = Lo(e);
|
|
2334
|
+
return t.filter((n) => Uo.every((o) => o(n, e))).sort(r);
|
|
2335
2335
|
}
|
|
2336
|
-
function
|
|
2337
|
-
const n =
|
|
2336
|
+
function Co(t, e, r) {
|
|
2337
|
+
const n = Bo(t, e);
|
|
2338
2338
|
if (!n.length)
|
|
2339
2339
|
return;
|
|
2340
2340
|
const [o] = n, { searchParams: a, hash: s } = I(e);
|
|
@@ -2345,7 +2345,7 @@ function Uo(t, e, r) {
|
|
|
2345
2345
|
name: o.name,
|
|
2346
2346
|
query: pe(a),
|
|
2347
2347
|
params: we(o, e),
|
|
2348
|
-
state:
|
|
2348
|
+
state: kr(o.state, r),
|
|
2349
2349
|
hash: s,
|
|
2350
2350
|
href: He(e)
|
|
2351
2351
|
};
|
|
@@ -2360,7 +2360,7 @@ function je(t, e) {
|
|
|
2360
2360
|
hash: W(n.hash) ? n.hash : r.hash
|
|
2361
2361
|
});
|
|
2362
2362
|
}
|
|
2363
|
-
function
|
|
2363
|
+
function Vo(t, e) {
|
|
2364
2364
|
return W(e) ? t.map((r) => {
|
|
2365
2365
|
const n = `${e}${r.path.value}`;
|
|
2366
2366
|
return {
|
|
@@ -2369,7 +2369,7 @@ function Bo(t, e) {
|
|
|
2369
2369
|
};
|
|
2370
2370
|
}) : t;
|
|
2371
2371
|
}
|
|
2372
|
-
class
|
|
2372
|
+
class Zo extends Error {
|
|
2373
2373
|
/**
|
|
2374
2374
|
* Constructs a new DuplicateNamesError instance with a message indicating the problematic name.
|
|
2375
2375
|
* @param name - The name of the name that was duplicated.
|
|
@@ -2378,20 +2378,20 @@ class Co extends Error {
|
|
|
2378
2378
|
super(`Invalid Name "${e}": Router does not support multiple routes with the same name. All name names must be unique.`);
|
|
2379
2379
|
}
|
|
2380
2380
|
}
|
|
2381
|
-
function
|
|
2381
|
+
function Oo(t) {
|
|
2382
2382
|
const e = t.map(({ name: r }) => r);
|
|
2383
2383
|
for (const r of e)
|
|
2384
2384
|
if (De(e, r) > 1)
|
|
2385
|
-
throw new
|
|
2385
|
+
throw new Zo(r);
|
|
2386
2386
|
}
|
|
2387
|
-
function
|
|
2387
|
+
function jo(t, e = [], r) {
|
|
2388
2388
|
const n = [
|
|
2389
2389
|
...t,
|
|
2390
2390
|
...e.map((o) => o.routes)
|
|
2391
2391
|
].flat();
|
|
2392
|
-
return
|
|
2392
|
+
return Oo(n), Vo(n, r);
|
|
2393
2393
|
}
|
|
2394
|
-
function
|
|
2394
|
+
function $o(t = {}, e = []) {
|
|
2395
2395
|
const r = new st();
|
|
2396
2396
|
return ft("onBeforeRouteEnter", t, e).forEach((n) => r.onBeforeRouteEnter.add(n)), ft("onBeforeRouteUpdate", t, e).forEach((n) => r.onBeforeRouteUpdate.add(n)), ft("onBeforeRouteLeave", t, e).forEach((n) => r.onBeforeRouteLeave.add(n)), ft("onAfterRouteEnter", t, e).forEach((n) => r.onAfterRouteEnter.add(n)), ft("onAfterRouteUpdate", t, e).forEach((n) => r.onAfterRouteUpdate.add(n)), ft("onAfterRouteLeave", t, e).forEach((n) => r.onAfterRouteLeave.add(n)), r;
|
|
2397
2397
|
}
|
|
@@ -2401,10 +2401,10 @@ function ft(t, e, r) {
|
|
|
2401
2401
|
...r.map((o) => o[t])
|
|
2402
2402
|
].flat().filter((o) => o !== void 0);
|
|
2403
2403
|
}
|
|
2404
|
-
function
|
|
2405
|
-
const n =
|
|
2406
|
-
o.addGlobalRouteHooks(
|
|
2407
|
-
const a = de(), s =
|
|
2404
|
+
function Qo(t, e, r = []) {
|
|
2405
|
+
const n = jo(t, r, e == null ? void 0 : e.base), o = ro();
|
|
2406
|
+
o.addGlobalRouteHooks($o(e, r));
|
|
2407
|
+
const a = de(), s = Vn(), p = Gn(), h = Ro(), u = uo({
|
|
2408
2408
|
mode: e == null ? void 0 : e.historyMode,
|
|
2409
2409
|
listener: ({ location: b }) => {
|
|
2410
2410
|
const B = nt(b);
|
|
@@ -2412,11 +2412,11 @@ function Wo(t, e, r = []) {
|
|
|
2412
2412
|
}
|
|
2413
2413
|
});
|
|
2414
2414
|
function m(b, B = {}) {
|
|
2415
|
-
return
|
|
2415
|
+
return Co(n, b, B.state);
|
|
2416
2416
|
}
|
|
2417
2417
|
async function R(b, B = {}) {
|
|
2418
2418
|
const G = a();
|
|
2419
|
-
if (u.stopListening(),
|
|
2419
|
+
if (u.stopListening(), x(b)) {
|
|
2420
2420
|
u.update(b, B);
|
|
2421
2421
|
return;
|
|
2422
2422
|
}
|
|
@@ -2476,8 +2476,8 @@ function Wo(t, e, r = []) {
|
|
|
2476
2476
|
const L = (b, B = {}, G = {}) => {
|
|
2477
2477
|
const D = n.find((H) => H.name === b);
|
|
2478
2478
|
if (!D)
|
|
2479
|
-
throw new
|
|
2480
|
-
return
|
|
2479
|
+
throw new wo(String(b));
|
|
2480
|
+
return Ao(D, B, G);
|
|
2481
2481
|
}, S = (b, B, G) => {
|
|
2482
2482
|
if (M(b)) {
|
|
2483
2483
|
const F = { ...B }, J = je(b, {
|
|
@@ -2508,25 +2508,25 @@ function Wo(t, e, r = []) {
|
|
|
2508
2508
|
return S(b, D);
|
|
2509
2509
|
}, v = (b) => {
|
|
2510
2510
|
i(b);
|
|
2511
|
-
}, { setRejection: i, rejection: f, getRejectionRoute: c } =
|
|
2511
|
+
}, { setRejection: i, rejection: f, getRejectionRoute: c } = po({
|
|
2512
2512
|
...r.reduce((b, B) => ({ ...b, ...B.rejections }), {}),
|
|
2513
2513
|
...e == null ? void 0 : e.rejections
|
|
2514
|
-
}), l = c("NotFound"), { currentRoute: E, routerRoute: A, updateRoute: P } =
|
|
2515
|
-
let
|
|
2514
|
+
}), l = c("NotFound"), { currentRoute: E, routerRoute: A, updateRoute: P } = ao(l, S), g = yo(e == null ? void 0 : e.initialUrl), d = u.location.state, { host: y } = I(g), x = co(y);
|
|
2515
|
+
let k = !1;
|
|
2516
2516
|
const C = Pt(!1), { promise: j, resolve: _ } = Promise.withResolvers();
|
|
2517
2517
|
async function q() {
|
|
2518
|
-
if (
|
|
2518
|
+
if (k)
|
|
2519
2519
|
return j;
|
|
2520
|
-
|
|
2520
|
+
k = !0, nn(n) && await on(), await R(g, { replace: !0, state: d }), u.startListening(), _(), C.value = !0;
|
|
2521
2521
|
}
|
|
2522
2522
|
function ve() {
|
|
2523
2523
|
u.stopListening();
|
|
2524
2524
|
}
|
|
2525
2525
|
function Br(b) {
|
|
2526
|
-
return
|
|
2526
|
+
return Nn(b) ? null : { ...E };
|
|
2527
2527
|
}
|
|
2528
2528
|
function Cr(b) {
|
|
2529
|
-
o.setVueApp(b), s.setVueApp(b), b.component("RouterView", wr), b.component("RouterLink",
|
|
2529
|
+
o.setVueApp(b), s.setVueApp(b), b.component("RouterView", wr), b.component("RouterLink", Jn), b.provide(mr, f), b.provide(vr, o), b.provide(pr, s), b.provide(Rr, p), b.provide(hr, h), b.provide(Ie, Ee), q();
|
|
2530
2530
|
}
|
|
2531
2531
|
const Ee = {
|
|
2532
2532
|
route: A,
|
|
@@ -2540,7 +2540,7 @@ function Wo(t, e, r = []) {
|
|
|
2540
2540
|
back: u.back,
|
|
2541
2541
|
go: u.go,
|
|
2542
2542
|
install: Cr,
|
|
2543
|
-
isExternal:
|
|
2543
|
+
isExternal: x,
|
|
2544
2544
|
onBeforeRouteEnter: o.onBeforeRouteEnter,
|
|
2545
2545
|
onBeforeRouteUpdate: o.onBeforeRouteUpdate,
|
|
2546
2546
|
onBeforeRouteLeave: o.onBeforeRouteLeave,
|
|
@@ -2554,14 +2554,14 @@ function Wo(t, e, r = []) {
|
|
|
2554
2554
|
};
|
|
2555
2555
|
return Ee;
|
|
2556
2556
|
}
|
|
2557
|
-
function
|
|
2557
|
+
function zo(t) {
|
|
2558
2558
|
return {
|
|
2559
2559
|
routes: t.routes ?? [],
|
|
2560
2560
|
rejections: t.rejections ?? {},
|
|
2561
2561
|
...t
|
|
2562
2562
|
};
|
|
2563
2563
|
}
|
|
2564
|
-
function
|
|
2564
|
+
function _o(t) {
|
|
2565
2565
|
return {
|
|
2566
2566
|
get: (e, { invalid: r }) => {
|
|
2567
2567
|
for (const n of t) {
|
|
@@ -2581,11 +2581,11 @@ function jo(t) {
|
|
|
2581
2581
|
}
|
|
2582
2582
|
};
|
|
2583
2583
|
}
|
|
2584
|
-
const
|
|
2584
|
+
const qo = {
|
|
2585
2585
|
separator: ","
|
|
2586
2586
|
};
|
|
2587
|
-
function
|
|
2588
|
-
const { separator: r } = {
|
|
2587
|
+
function Ko(t, e = {}) {
|
|
2588
|
+
const { separator: r } = { ...qo, ...e }, n = _o(t);
|
|
2589
2589
|
return {
|
|
2590
2590
|
get: (o, a) => o.split(r).map((s) => n.get(s, a)),
|
|
2591
2591
|
set: (o, a) => {
|
|
@@ -2595,11 +2595,11 @@ function Qo(t, e = {}) {
|
|
|
2595
2595
|
}
|
|
2596
2596
|
};
|
|
2597
2597
|
}
|
|
2598
|
-
const
|
|
2598
|
+
const Ho = {
|
|
2599
2599
|
separator: ","
|
|
2600
2600
|
};
|
|
2601
|
-
function
|
|
2602
|
-
const { separator: r } = { ...
|
|
2601
|
+
function Yo(t, e = {}) {
|
|
2602
|
+
const { separator: r } = { ...Ho, ...e };
|
|
2603
2603
|
return {
|
|
2604
2604
|
get: (n) => {
|
|
2605
2605
|
const o = n.split(r);
|
|
@@ -2614,8 +2614,8 @@ function zo(t, e = {}) {
|
|
|
2614
2614
|
}
|
|
2615
2615
|
};
|
|
2616
2616
|
}
|
|
2617
|
-
const
|
|
2618
|
-
function
|
|
2617
|
+
const Xo = K, ta = K, ea = K;
|
|
2618
|
+
function ra(t) {
|
|
2619
2619
|
const e = he(), r = sr(t.name), n = et(t.path), o = et(t.query), a = et(t.hash), s = t.meta ?? {}, p = et(t.host), h = Ut({ id: e, meta: {}, state: {}, ...t }), u = {
|
|
2620
2620
|
id: e,
|
|
2621
2621
|
matched: h,
|
|
@@ -2634,32 +2634,32 @@ function ta(t) {
|
|
|
2634
2634
|
export {
|
|
2635
2635
|
Gr as DuplicateParamsError,
|
|
2636
2636
|
Qr as MetaPropertyConflict,
|
|
2637
|
-
|
|
2637
|
+
Jn as RouterLink,
|
|
2638
2638
|
Et as RouterNotInstalledError,
|
|
2639
2639
|
wr as RouterView,
|
|
2640
2640
|
zr as UseRouteInvalidError,
|
|
2641
|
-
|
|
2641
|
+
Ko as arrayOf,
|
|
2642
2642
|
He as asUrl,
|
|
2643
|
-
|
|
2643
|
+
ra as createExternalRoute,
|
|
2644
2644
|
Xr as createParam,
|
|
2645
2645
|
gt as createRoute,
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2646
|
+
Qo as createRouter,
|
|
2647
|
+
zo as createRouterPlugin,
|
|
2648
|
+
ta as host,
|
|
2649
2649
|
re as isRoute,
|
|
2650
2650
|
M as isUrl,
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2651
|
+
Wo as onAfterRouteLeave,
|
|
2652
|
+
Go as onAfterRouteUpdate,
|
|
2653
|
+
To as onBeforeRouteLeave,
|
|
2654
|
+
Mo as onBeforeRouteUpdate,
|
|
2655
|
+
Xo as path,
|
|
2656
|
+
ea as query,
|
|
2657
|
+
Yo as tupleOf,
|
|
2658
|
+
_o as unionOf,
|
|
2659
|
+
Hn as useLink,
|
|
2660
|
+
Fo as useQueryValue,
|
|
2661
2661
|
ge as useRoute,
|
|
2662
2662
|
It as useRouter,
|
|
2663
|
-
|
|
2663
|
+
Jo as withDefault,
|
|
2664
2664
|
K as withParams
|
|
2665
2665
|
};
|