@jasonshimmy/custom-elements-runtime 3.2.0 → 3.3.0
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/{css-utils-Cg4o1MqY.js → css-utils-CC43BbEy.js} +20 -21
- package/dist/css-utils-CC43BbEy.js.map +1 -0
- package/dist/{css-utils-RqkyBWft.cjs → css-utils-mgjmH8qX.cjs} +5 -4
- package/dist/css-utils-mgjmH8qX.cjs.map +1 -0
- package/dist/custom-elements-runtime.cjs.js +4 -3
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.colors.cjs.js +3 -2
- package/dist/custom-elements-runtime.colors.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.colors.es.js +3 -2
- package/dist/custom-elements-runtime.colors.es.js.map +1 -1
- package/dist/custom-elements-runtime.directive-enhancements.cjs.js +3 -2
- package/dist/custom-elements-runtime.directive-enhancements.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.directive-enhancements.es.js +86 -100
- package/dist/custom-elements-runtime.directive-enhancements.es.js.map +1 -1
- package/dist/custom-elements-runtime.directives.cjs.js +3 -2
- package/dist/custom-elements-runtime.directives.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.directives.es.js +40 -43
- package/dist/custom-elements-runtime.directives.es.js.map +1 -1
- package/dist/custom-elements-runtime.dom-jit-css.cjs.js +7 -6
- package/dist/custom-elements-runtime.dom-jit-css.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.dom-jit-css.es.js +58 -76
- package/dist/custom-elements-runtime.dom-jit-css.es.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +162 -186
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.event-bus.cjs.js +3 -2
- package/dist/custom-elements-runtime.event-bus.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.event-bus.es.js +48 -103
- package/dist/custom-elements-runtime.event-bus.es.js.map +1 -1
- package/dist/custom-elements-runtime.jit-css.cjs.js +3 -2
- package/dist/custom-elements-runtime.jit-css.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.jit-css.es.js +29 -30
- package/dist/custom-elements-runtime.jit-css.es.js.map +1 -1
- package/dist/custom-elements-runtime.router.cjs.js +20 -19
- package/dist/custom-elements-runtime.router.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.router.es.js +579 -582
- package/dist/custom-elements-runtime.router.es.js.map +1 -1
- package/dist/custom-elements-runtime.ssr-middleware.cjs.js +5 -4
- package/dist/custom-elements-runtime.ssr-middleware.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.ssr-middleware.es.js +44 -37
- package/dist/custom-elements-runtime.ssr-middleware.es.js.map +1 -1
- package/dist/custom-elements-runtime.ssr.cjs.js +1 -4
- package/dist/custom-elements-runtime.ssr.es.js +11 -176
- package/dist/custom-elements-runtime.store.cjs.js +3 -2
- package/dist/custom-elements-runtime.store.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.store.es.js +17 -11
- package/dist/custom-elements-runtime.store.es.js.map +1 -1
- package/dist/custom-elements-runtime.transitions.cjs.js +3 -2
- package/dist/custom-elements-runtime.transitions.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.transitions.es.js +55 -120
- package/dist/custom-elements-runtime.transitions.es.js.map +1 -1
- package/dist/custom-elements-runtime.vite-plugin.cjs.js +3 -2
- package/dist/custom-elements-runtime.vite-plugin.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.vite-plugin.es.js +54 -75
- package/dist/custom-elements-runtime.vite-plugin.es.js.map +1 -1
- package/dist/hooks-_3xP4G2N.js +1189 -0
- package/dist/hooks-_3xP4G2N.js.map +1 -0
- package/dist/hooks-fYQgZk2g.cjs +7 -0
- package/dist/hooks-fYQgZk2g.cjs.map +1 -0
- package/dist/logger-BYIN7ysT.cjs +3 -0
- package/dist/logger-BYIN7ysT.cjs.map +1 -0
- package/dist/logger-L25axmB-.js +41 -0
- package/dist/logger-L25axmB-.js.map +1 -0
- package/dist/namespace-helpers-Bf7rm9JV.cjs +3 -0
- package/dist/namespace-helpers-Bf7rm9JV.cjs.map +1 -0
- package/dist/namespace-helpers-BucDdgz_.js +61 -0
- package/dist/namespace-helpers-BucDdgz_.js.map +1 -0
- package/dist/reset.css +1 -1
- package/dist/ssr-B3lxl1vr.js +165 -0
- package/dist/ssr-B3lxl1vr.js.map +1 -0
- package/dist/ssr-DtD9e5iA.cjs +5 -0
- package/dist/ssr-DtD9e5iA.cjs.map +1 -0
- package/dist/style-Bjn8zDiZ.cjs +56 -0
- package/dist/style-Bjn8zDiZ.cjs.map +1 -0
- package/dist/{style-BmyOIMcU.js → style-DuDoj_xK.js} +724 -876
- package/dist/style-DuDoj_xK.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/template-compiler-BB4JJdqk.cjs +23 -0
- package/dist/template-compiler-BB4JJdqk.cjs.map +1 -0
- package/dist/template-compiler-Cs5axmn4.js +3236 -0
- package/dist/template-compiler-Cs5axmn4.js.map +1 -0
- package/dist/variables.css +1 -1
- package/package.json +7 -7
- package/dist/css-utils-Cg4o1MqY.js.map +0 -1
- package/dist/css-utils-RqkyBWft.cjs.map +0 -1
- package/dist/custom-elements-runtime.ssr.cjs.js.map +0 -1
- package/dist/custom-elements-runtime.ssr.es.js.map +0 -1
- package/dist/hooks-BH-CpUun.js +0 -1474
- package/dist/hooks-BH-CpUun.js.map +0 -1
- package/dist/hooks-NOFG9QRQ.cjs +0 -6
- package/dist/hooks-NOFG9QRQ.cjs.map +0 -1
- package/dist/logger-BvkEbVM4.js +0 -48
- package/dist/logger-BvkEbVM4.js.map +0 -1
- package/dist/logger-CSALKaYm.cjs +0 -2
- package/dist/logger-CSALKaYm.cjs.map +0 -1
- package/dist/namespace-helpers-D4wC2-qA.js +0 -61
- package/dist/namespace-helpers-D4wC2-qA.js.map +0 -1
- package/dist/namespace-helpers-ckeEOxpR.cjs +0 -2
- package/dist/namespace-helpers-ckeEOxpR.cjs.map +0 -1
- package/dist/style-BmyOIMcU.js.map +0 -1
- package/dist/style-D40DsIqJ.cjs +0 -55
- package/dist/style-D40DsIqJ.cjs.map +0 -1
- package/dist/template-compiler-CDvhsHia.cjs +0 -22
- package/dist/template-compiler-CDvhsHia.cjs.map +0 -1
- package/dist/template-compiler-DiE69FLO.js +0 -3724
- package/dist/template-compiler-DiE69FLO.js.map +0 -1
|
@@ -1,664 +1,652 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { r as y, t as k } from "./logger-L25axmB-.js";
|
|
2
|
+
import { J as nt, R as L, V as et, _ as St, h as st, i as it, m as ct, y as Rt } from "./hooks-_3xP4G2N.js";
|
|
3
|
+
import { n as lt, t as U } from "./template-compiler-Cs5axmn4.js";
|
|
4
|
+
import { match as Et } from "./custom-elements-runtime.directives.es.js";
|
|
5
|
+
import { createStore as ut } from "./custom-elements-runtime.store.es.js";
|
|
6
|
+
var ft = {
|
|
7
7
|
enabled: !0,
|
|
8
8
|
offset: 0,
|
|
9
9
|
timeoutMs: 2e3
|
|
10
|
-
},
|
|
10
|
+
}, ot = (t) => t ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(t)) : {}, $t = (t) => {
|
|
11
11
|
if (!t || Object.keys(t).length === 0) return "";
|
|
12
12
|
try {
|
|
13
13
|
return "?" + new URLSearchParams(t).toString();
|
|
14
14
|
} catch {
|
|
15
15
|
return "";
|
|
16
16
|
}
|
|
17
|
-
},
|
|
17
|
+
}, ht = (t) => t ? /^\s*javascript\s*:/i.test(t) : !1, K = (t) => /^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(t) || t.startsWith("//"), Ct = (t) => {
|
|
18
18
|
try {
|
|
19
19
|
return decodeURIComponent(t);
|
|
20
20
|
} catch {
|
|
21
21
|
return t;
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
|
-
function
|
|
24
|
+
function C(t) {
|
|
25
25
|
if (!t) return "/";
|
|
26
26
|
let r = t.replace(/\/+/g, "/");
|
|
27
27
|
return r.startsWith("/") || (r = "/" + r), r.length > 1 && r.endsWith("/") && (r = r.slice(0, -1)), r;
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
var xt = (t) => {
|
|
30
30
|
if (!t) return "";
|
|
31
|
-
const r =
|
|
31
|
+
const r = C(t);
|
|
32
32
|
return r === "/" ? "" : r;
|
|
33
|
-
},
|
|
34
|
-
function
|
|
33
|
+
}, pt = /* @__PURE__ */ new WeakMap();
|
|
34
|
+
function At(t) {
|
|
35
35
|
return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
36
36
|
}
|
|
37
37
|
function kt(t) {
|
|
38
|
-
const r = t.path || "/",
|
|
39
|
-
for (let
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
42
|
-
if (
|
|
43
|
-
return
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const S = `splat${c.length}`;
|
|
47
|
-
c.push(S), a.push("__SPLAT__");
|
|
38
|
+
const r = C(t.path || "/"), h = r === "/" ? [] : r.split("/").filter(Boolean), a = [], i = [];
|
|
39
|
+
for (let m = 0; m < h.length; m++) {
|
|
40
|
+
const g = h[m];
|
|
41
|
+
if (g === "*") {
|
|
42
|
+
if (m !== h.length - 1)
|
|
43
|
+
return y(`Route '${t.path}' contains a '*' splat in a non-terminal position; splats must be the last segment. This route will be ignored.`), { invalid: !0 };
|
|
44
|
+
const c = `splat${a.length}`;
|
|
45
|
+
a.push(c), i.push("__SPLAT__");
|
|
48
46
|
continue;
|
|
49
47
|
}
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
52
|
-
const
|
|
53
|
-
if (
|
|
54
|
-
return
|
|
55
|
-
|
|
56
|
-
), { invalid: !0 };
|
|
57
|
-
c.push(S), a.push(C ? "__SPLAT__" : "([^/]+)");
|
|
48
|
+
const v = g.match(/^:([A-Za-z0-9_-]+)(\*)?$/);
|
|
49
|
+
if (v) {
|
|
50
|
+
const c = v[1], R = !!v[2];
|
|
51
|
+
if (R && m !== h.length - 1)
|
|
52
|
+
return y(`Route '${t.path}' contains a splat param ':${c}*' in a non-terminal position; splats must be the last segment. This route will be ignored.`), { invalid: !0 };
|
|
53
|
+
a.push(c), i.push(R ? "__SPLAT__" : "([^/]+)");
|
|
58
54
|
continue;
|
|
59
55
|
}
|
|
60
|
-
|
|
56
|
+
i.push(At(g));
|
|
61
57
|
}
|
|
62
|
-
let
|
|
63
|
-
if (
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
} else
|
|
69
|
-
g = `^/${a.join("/")}(?:/)?$`;
|
|
58
|
+
let o;
|
|
59
|
+
if (i.length === 0) o = "^/$";
|
|
60
|
+
else if (i[i.length - 1] === "__SPLAT__") {
|
|
61
|
+
const m = i.slice(0, -1).join("/");
|
|
62
|
+
m ? o = `^/${m}(?:/(.*))?(?:/)?$` : o = "^(?:/(.*))?(?:/)?$";
|
|
63
|
+
} else o = `^/${i.join("/")}(?:/)?$`;
|
|
70
64
|
try {
|
|
71
|
-
return {
|
|
72
|
-
|
|
73
|
-
|
|
65
|
+
return {
|
|
66
|
+
regex: new RegExp(o),
|
|
67
|
+
paramNames: a
|
|
68
|
+
};
|
|
69
|
+
} catch (m) {
|
|
70
|
+
return y(`Failed to compile route regex for '${t.path}': ${String(m)}`), { invalid: !0 };
|
|
74
71
|
}
|
|
75
72
|
}
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
for (const
|
|
79
|
-
let
|
|
80
|
-
if (
|
|
81
|
-
const { regex:
|
|
82
|
-
if (
|
|
83
|
-
const
|
|
84
|
-
for (let
|
|
85
|
-
const
|
|
86
|
-
|
|
73
|
+
var Q = (t, r) => {
|
|
74
|
+
const h = C(r);
|
|
75
|
+
for (const a of t) {
|
|
76
|
+
let i = pt.get(a);
|
|
77
|
+
if (i || (i = kt(a), pt.set(a, i)), i.invalid) continue;
|
|
78
|
+
const { regex: o, paramNames: m } = i, g = o.exec(h);
|
|
79
|
+
if (g) {
|
|
80
|
+
const v = {};
|
|
81
|
+
for (let c = 0; c < m.length; c++) {
|
|
82
|
+
const R = g[c + 1] || "";
|
|
83
|
+
v[m[c]] = R ? Ct(R) : "";
|
|
87
84
|
}
|
|
88
|
-
return {
|
|
85
|
+
return {
|
|
86
|
+
route: a,
|
|
87
|
+
params: v
|
|
88
|
+
};
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
return {
|
|
91
|
+
return {
|
|
92
|
+
route: null,
|
|
93
|
+
params: {}
|
|
94
|
+
};
|
|
92
95
|
};
|
|
93
96
|
function rt(t, r) {
|
|
94
|
-
for (const
|
|
95
|
-
if (J([p], r).route !== null) return p;
|
|
97
|
+
for (const h of t) if (Q([h], r).route !== null) return h;
|
|
96
98
|
return null;
|
|
97
99
|
}
|
|
98
|
-
function
|
|
99
|
-
const
|
|
100
|
-
return
|
|
100
|
+
function Ft(t, r) {
|
|
101
|
+
const h = r.split("?")[0].split("#")[0];
|
|
102
|
+
return Q(t, h);
|
|
101
103
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
X = {}, H = {};
|
|
104
|
+
var dt = 50, J = {}, B = {};
|
|
105
|
+
function Pt() {
|
|
106
|
+
J = {}, B = {};
|
|
106
107
|
}
|
|
107
|
-
function
|
|
108
|
-
const t = Object.entries(
|
|
109
|
-
if (t.length <=
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
).slice(
|
|
113
|
-
0,
|
|
114
|
-
t.length - yt
|
|
115
|
-
);
|
|
116
|
-
for (const [o] of p)
|
|
117
|
-
delete X[o];
|
|
108
|
+
function _t() {
|
|
109
|
+
const t = Object.entries(J);
|
|
110
|
+
if (t.length <= dt) return;
|
|
111
|
+
const r = t.sort(([, h], [, a]) => h.lastAccessed - a.lastAccessed).slice(0, t.length - dt);
|
|
112
|
+
for (const [h] of r) delete J[h];
|
|
118
113
|
}
|
|
119
|
-
async function
|
|
114
|
+
async function gt(t) {
|
|
120
115
|
if (t.component) return t.component;
|
|
121
116
|
if (t.load) {
|
|
122
|
-
const r =
|
|
117
|
+
const r = J[t.path];
|
|
123
118
|
if (r)
|
|
124
119
|
return r.lastAccessed = Date.now(), r.component;
|
|
125
|
-
if (
|
|
126
|
-
|
|
127
|
-
const p = typeof window > "u";
|
|
120
|
+
if (B[t.path] !== void 0) return B[t.path];
|
|
121
|
+
const h = typeof window > "u";
|
|
128
122
|
try {
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
const
|
|
132
|
-
return
|
|
133
|
-
component:
|
|
123
|
+
const a = t.load().then((i) => {
|
|
124
|
+
_t();
|
|
125
|
+
const o = i.default;
|
|
126
|
+
return J[t.path] = {
|
|
127
|
+
component: o,
|
|
134
128
|
lastAccessed: Date.now()
|
|
135
|
-
}, delete
|
|
136
|
-
}).catch((
|
|
137
|
-
delete
|
|
138
|
-
const
|
|
139
|
-
throw
|
|
140
|
-
`SSR component load failed for route: ${t.path}. ${a}`
|
|
141
|
-
), new Error(
|
|
142
|
-
`Failed to load component for route: ${t.path}. ${a}`
|
|
143
|
-
);
|
|
129
|
+
}, delete B[t.path], o;
|
|
130
|
+
}).catch((i) => {
|
|
131
|
+
delete B[t.path];
|
|
132
|
+
const o = i instanceof Error ? i.message : String(i);
|
|
133
|
+
throw h && k(`SSR component load failed for route: ${t.path}. ${o}`), new Error(`Failed to load component for route: ${t.path}. ${o}`);
|
|
144
134
|
});
|
|
145
|
-
return
|
|
146
|
-
} catch (
|
|
147
|
-
const
|
|
148
|
-
throw new Error(
|
|
149
|
-
`Failed to load component for route: ${t.path}. ${c}`,
|
|
150
|
-
{ cause: o }
|
|
151
|
-
);
|
|
135
|
+
return B[t.path] = a, await a;
|
|
136
|
+
} catch (a) {
|
|
137
|
+
const i = a instanceof Error ? a.message : String(a);
|
|
138
|
+
throw new Error(`Failed to load component for route: ${t.path}. ${i}`, { cause: a });
|
|
152
139
|
}
|
|
153
140
|
}
|
|
154
141
|
throw new Error(`No component or loader defined for route: ${t.path}`);
|
|
155
142
|
}
|
|
156
|
-
|
|
157
|
-
function
|
|
158
|
-
|
|
143
|
+
var d = null;
|
|
144
|
+
function qt(t) {
|
|
145
|
+
d = t;
|
|
159
146
|
}
|
|
160
|
-
function
|
|
161
|
-
return
|
|
147
|
+
function yt() {
|
|
148
|
+
return d;
|
|
162
149
|
}
|
|
163
|
-
|
|
164
|
-
let L = null;
|
|
150
|
+
var V = /* @__PURE__ */ new Set(), D = null;
|
|
165
151
|
function bt() {
|
|
166
|
-
if (
|
|
152
|
+
if (D) {
|
|
167
153
|
try {
|
|
168
|
-
|
|
154
|
+
D();
|
|
169
155
|
} catch {
|
|
170
156
|
}
|
|
171
|
-
|
|
157
|
+
D = null;
|
|
172
158
|
}
|
|
173
|
-
if (
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
try {
|
|
180
|
-
p(r);
|
|
181
|
-
} catch {
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
try {
|
|
185
|
-
_.base = y.base;
|
|
159
|
+
if (d) try {
|
|
160
|
+
let t = !1;
|
|
161
|
+
D = d.subscribe((r) => {
|
|
162
|
+
t = !0;
|
|
163
|
+
for (const h of V) try {
|
|
164
|
+
h(r);
|
|
186
165
|
} catch {
|
|
187
166
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
try {
|
|
199
|
-
p(r);
|
|
200
|
-
} catch {
|
|
201
|
-
}
|
|
167
|
+
});
|
|
168
|
+
try {
|
|
169
|
+
x.base = d.base;
|
|
170
|
+
} catch {
|
|
171
|
+
}
|
|
172
|
+
if (t) {
|
|
173
|
+
const r = d.getCurrent();
|
|
174
|
+
for (const h of V) try {
|
|
175
|
+
h(r);
|
|
176
|
+
} catch {
|
|
202
177
|
}
|
|
203
|
-
|
|
204
|
-
|
|
178
|
+
} else {
|
|
179
|
+
const r = d.getCurrent();
|
|
180
|
+
for (const h of V) try {
|
|
181
|
+
h(r);
|
|
205
182
|
} catch {
|
|
206
183
|
}
|
|
184
|
+
}
|
|
185
|
+
try {
|
|
186
|
+
typeof window < "u" && nt();
|
|
207
187
|
} catch {
|
|
208
|
-
L = null;
|
|
209
188
|
}
|
|
189
|
+
} catch {
|
|
190
|
+
D = null;
|
|
191
|
+
}
|
|
210
192
|
}
|
|
211
|
-
function
|
|
193
|
+
function Tt() {
|
|
212
194
|
bt();
|
|
213
195
|
}
|
|
214
|
-
|
|
196
|
+
var x = {
|
|
215
197
|
store: {
|
|
216
198
|
subscribe(t) {
|
|
217
|
-
if (
|
|
199
|
+
if (d) return d.store.subscribe(t);
|
|
218
200
|
try {
|
|
219
|
-
t({
|
|
201
|
+
t({
|
|
202
|
+
path: "/",
|
|
203
|
+
params: {},
|
|
204
|
+
query: {}
|
|
205
|
+
});
|
|
220
206
|
} catch {
|
|
221
207
|
}
|
|
222
208
|
return () => {
|
|
223
209
|
};
|
|
224
210
|
},
|
|
225
211
|
getState() {
|
|
226
|
-
return
|
|
212
|
+
return d ? d.getCurrent() : {
|
|
213
|
+
path: "/",
|
|
214
|
+
params: {},
|
|
215
|
+
query: {}
|
|
216
|
+
};
|
|
227
217
|
},
|
|
228
218
|
setState(t) {
|
|
229
|
-
if (
|
|
219
|
+
if (d)
|
|
230
220
|
try {
|
|
231
|
-
|
|
232
|
-
t
|
|
233
|
-
);
|
|
221
|
+
d.store.setState(t);
|
|
234
222
|
} catch {
|
|
235
223
|
}
|
|
236
224
|
}
|
|
237
225
|
},
|
|
238
226
|
subscribe(t) {
|
|
239
227
|
if (typeof t != "function")
|
|
240
|
-
return
|
|
228
|
+
return y("activeRouterProxy.subscribe: listener must be a function"), () => {
|
|
241
229
|
};
|
|
242
|
-
if (V.add(t),
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
230
|
+
if (V.add(t), d) if (!D) bt();
|
|
231
|
+
else try {
|
|
232
|
+
const r = d.getCurrent();
|
|
233
|
+
r && t(r);
|
|
234
|
+
} catch (r) {
|
|
235
|
+
y("activeRouterProxy subscription failed", r);
|
|
236
|
+
}
|
|
237
|
+
else try {
|
|
238
|
+
t({
|
|
239
|
+
path: "/",
|
|
240
|
+
params: {},
|
|
241
|
+
query: {}
|
|
242
|
+
});
|
|
243
|
+
} catch (r) {
|
|
244
|
+
y("activeRouterProxy fallback state delivery failed", r);
|
|
245
|
+
}
|
|
258
246
|
return () => {
|
|
259
247
|
try {
|
|
260
|
-
if (V.delete(t), V.size === 0 &&
|
|
248
|
+
if (V.delete(t), V.size === 0 && D) {
|
|
261
249
|
try {
|
|
262
|
-
|
|
250
|
+
D();
|
|
263
251
|
} catch (r) {
|
|
264
|
-
|
|
252
|
+
y("activeRouterProxy inner unsubscribe failed", r);
|
|
265
253
|
}
|
|
266
|
-
|
|
254
|
+
D = null;
|
|
267
255
|
}
|
|
268
256
|
} catch (r) {
|
|
269
|
-
|
|
257
|
+
y("activeRouterProxy unsubscribe failed", r);
|
|
270
258
|
}
|
|
271
259
|
};
|
|
272
260
|
},
|
|
273
261
|
getCurrent() {
|
|
274
|
-
return
|
|
262
|
+
return d ? d.getCurrent() : {
|
|
263
|
+
path: "/",
|
|
264
|
+
params: {},
|
|
265
|
+
query: {}
|
|
266
|
+
};
|
|
275
267
|
},
|
|
276
268
|
async push(t) {
|
|
277
|
-
return
|
|
269
|
+
return d ? d.push(t) : Promise.resolve();
|
|
278
270
|
},
|
|
279
271
|
async replace(t) {
|
|
280
|
-
return
|
|
272
|
+
return d ? d.replace(t) : Promise.resolve();
|
|
281
273
|
},
|
|
282
274
|
back() {
|
|
283
|
-
if (
|
|
284
|
-
return
|
|
275
|
+
if (d)
|
|
276
|
+
return d.back();
|
|
285
277
|
},
|
|
286
278
|
matchRoute(t) {
|
|
287
|
-
return
|
|
279
|
+
return d ? d.matchRoute(t) : {
|
|
280
|
+
route: null,
|
|
281
|
+
params: {}
|
|
282
|
+
};
|
|
288
283
|
},
|
|
289
284
|
resolveRouteComponent(t) {
|
|
290
|
-
return
|
|
285
|
+
return d ? d.resolveRouteComponent(t) : Promise.reject(/* @__PURE__ */ new Error("No active router"));
|
|
291
286
|
},
|
|
292
287
|
base: "",
|
|
293
288
|
scrollToFragment(t) {
|
|
294
|
-
return
|
|
289
|
+
return d ? d.scrollToFragment(t) : Promise.resolve(!1);
|
|
295
290
|
},
|
|
296
291
|
destroy() {
|
|
297
|
-
|
|
292
|
+
d && d.destroy();
|
|
298
293
|
}
|
|
299
294
|
};
|
|
300
|
-
function
|
|
301
|
-
const { routes: r, base:
|
|
302
|
-
|
|
295
|
+
function It(t) {
|
|
296
|
+
const { routes: r, base: h = "", initialUrl: a, scrollToFragment: i = !0 } = t, o = xt(h), m = typeof i == "boolean" ? {
|
|
297
|
+
...ft,
|
|
298
|
+
enabled: i
|
|
299
|
+
} : {
|
|
300
|
+
...ft,
|
|
301
|
+
...i
|
|
303
302
|
};
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
const
|
|
303
|
+
let g, v, c, R, M, z, H, X = () => {
|
|
304
|
+
};
|
|
305
|
+
const T = /* @__PURE__ */ new Set(), W = 10;
|
|
306
|
+
let P = 0;
|
|
307
|
+
const G = async (s, l) => {
|
|
307
308
|
const e = rt(r, s.path);
|
|
308
309
|
if (!e || !e.beforeEnter) return !0;
|
|
309
310
|
try {
|
|
310
|
-
const n = await e.beforeEnter(s,
|
|
311
|
+
const n = await e.beforeEnter(s, l);
|
|
311
312
|
if (typeof n == "string") {
|
|
312
313
|
const f = `${s.path}->${n}`;
|
|
313
|
-
return T.has(f) ||
|
|
314
|
+
return T.has(f) || P >= W ? (k(`Redirect loop detected: ${f}`), !1) : n;
|
|
314
315
|
}
|
|
315
316
|
return n !== !1;
|
|
316
317
|
} catch (n) {
|
|
317
318
|
k("beforeEnter error", n);
|
|
318
319
|
try {
|
|
319
|
-
|
|
320
|
+
c.setState(l);
|
|
320
321
|
} catch {
|
|
321
322
|
}
|
|
322
323
|
throw n;
|
|
323
324
|
}
|
|
324
|
-
}, at = async (s,
|
|
325
|
+
}, at = async (s, l) => {
|
|
325
326
|
const e = rt(r, s.path);
|
|
326
327
|
if (!e || !e.onEnter) return !0;
|
|
327
328
|
try {
|
|
328
|
-
const n = await e.onEnter(s,
|
|
329
|
+
const n = await e.onEnter(s, l);
|
|
329
330
|
if (typeof n == "string") {
|
|
330
331
|
const f = `${s.path}->${n}`;
|
|
331
|
-
return T.has(f) ||
|
|
332
|
+
return T.has(f) || P >= W ? (k(`Redirect loop detected: ${f}`), !1) : n;
|
|
332
333
|
}
|
|
333
334
|
return n !== !1;
|
|
334
335
|
} catch (n) {
|
|
335
336
|
k("onEnter error", n);
|
|
336
337
|
try {
|
|
337
|
-
|
|
338
|
+
c.setState(l);
|
|
338
339
|
} catch {
|
|
339
340
|
}
|
|
340
341
|
throw n;
|
|
341
342
|
}
|
|
342
|
-
}, Y = (s,
|
|
343
|
+
}, Y = (s, l) => {
|
|
343
344
|
const e = rt(r, s.path);
|
|
344
345
|
if (!(!e || !e.afterEnter))
|
|
345
346
|
try {
|
|
346
|
-
const n = e.afterEnter(s,
|
|
347
|
+
const n = e.afterEnter(s, l);
|
|
347
348
|
n instanceof Promise && n.catch((f) => {
|
|
348
349
|
k("afterEnter async error", f);
|
|
349
350
|
});
|
|
350
351
|
} catch (n) {
|
|
351
352
|
k("afterEnter error", n);
|
|
352
353
|
}
|
|
353
|
-
}, A = /* @__PURE__ */ new Map(),
|
|
354
|
-
if (A.has(s))
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
for (let f = 0; f < e && f < n.length; f++)
|
|
360
|
-
A.delete(n[f]);
|
|
354
|
+
}, A = /* @__PURE__ */ new Map(), j = 100, N = (s) => {
|
|
355
|
+
if (A.has(s)) return A.get(s);
|
|
356
|
+
const l = Q(r, s);
|
|
357
|
+
if (A.size >= j) {
|
|
358
|
+
const e = Math.floor(j * 0.25), n = Array.from(A.keys());
|
|
359
|
+
for (let f = 0; f < e && f < n.length; f++) A.delete(n[f]);
|
|
361
360
|
}
|
|
362
|
-
return A.set(s,
|
|
361
|
+
return A.set(s, l), l;
|
|
363
362
|
}, tt = () => {
|
|
364
363
|
};
|
|
365
|
-
async function
|
|
364
|
+
async function p(s, l = 0) {
|
|
366
365
|
try {
|
|
367
366
|
const e = document.getElementById(s);
|
|
368
|
-
if (!e)
|
|
369
|
-
|
|
370
|
-
|
|
367
|
+
if (!e) return !1;
|
|
368
|
+
if (l > 0) try {
|
|
369
|
+
const n = e.getBoundingClientRect(), f = Math.max(0, window.scrollY + n.top - l);
|
|
370
|
+
typeof window.scrollTo == "function" && window.scrollTo({
|
|
371
|
+
top: f,
|
|
372
|
+
behavior: "auto"
|
|
373
|
+
});
|
|
374
|
+
} catch {
|
|
371
375
|
try {
|
|
372
|
-
|
|
373
|
-
typeof window.scrollTo == "function" && window.scrollTo({ top: f, behavior: "auto" });
|
|
376
|
+
e.scrollIntoView();
|
|
374
377
|
} catch {
|
|
375
|
-
|
|
376
|
-
e.scrollIntoView();
|
|
377
|
-
} catch {
|
|
378
|
-
return !1;
|
|
379
|
-
}
|
|
378
|
+
return !1;
|
|
380
379
|
}
|
|
381
|
-
|
|
380
|
+
}
|
|
381
|
+
else if (typeof e.scrollIntoView == "function") try {
|
|
382
|
+
e.scrollIntoView({
|
|
383
|
+
behavior: "auto",
|
|
384
|
+
block: "start",
|
|
385
|
+
inline: "nearest"
|
|
386
|
+
});
|
|
387
|
+
} catch {
|
|
382
388
|
try {
|
|
383
|
-
e.scrollIntoView(
|
|
384
|
-
behavior: "auto",
|
|
385
|
-
block: "start",
|
|
386
|
-
inline: "nearest"
|
|
387
|
-
});
|
|
389
|
+
e.scrollIntoView();
|
|
388
390
|
} catch {
|
|
389
|
-
|
|
390
|
-
e.scrollIntoView();
|
|
391
|
-
} catch {
|
|
392
|
-
return !1;
|
|
393
|
-
}
|
|
391
|
+
return !1;
|
|
394
392
|
}
|
|
393
|
+
}
|
|
395
394
|
return !0;
|
|
396
395
|
} catch {
|
|
397
396
|
return !1;
|
|
398
397
|
}
|
|
399
398
|
}
|
|
400
|
-
function
|
|
399
|
+
function w(s, l = 0, e = 2e3) {
|
|
401
400
|
return new Promise((n) => {
|
|
402
|
-
let f = !1,
|
|
403
|
-
const
|
|
404
|
-
f || (f = !0,
|
|
405
|
-
},
|
|
401
|
+
let f = !1, E = null, S = null;
|
|
402
|
+
const q = Date.now(), b = (O) => {
|
|
403
|
+
f || (f = !0, E && clearTimeout(E), S !== null && cancelAnimationFrame(S), n(O));
|
|
404
|
+
}, F = async () => {
|
|
406
405
|
if (!f)
|
|
407
406
|
try {
|
|
408
|
-
if (await
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
} catch (wt) {
|
|
419
|
-
m("Scroll retry attempt failed:", wt), w = requestAnimationFrame(z);
|
|
407
|
+
if (await p(s, l)) return b(!0);
|
|
408
|
+
const O = async () => {
|
|
409
|
+
if (!f) {
|
|
410
|
+
if (Date.now() - q >= e) return b(!1);
|
|
411
|
+
try {
|
|
412
|
+
if (await p(s, l)) return b(!0);
|
|
413
|
+
S = requestAnimationFrame(O);
|
|
414
|
+
} catch (wt) {
|
|
415
|
+
y("Scroll retry attempt failed:", wt), S = requestAnimationFrame(O);
|
|
416
|
+
}
|
|
420
417
|
}
|
|
421
418
|
};
|
|
422
|
-
|
|
423
|
-
} catch (
|
|
424
|
-
|
|
419
|
+
S = requestAnimationFrame(O);
|
|
420
|
+
} catch (O) {
|
|
421
|
+
y("Initial scroll attempt failed:", O), b(!1);
|
|
425
422
|
}
|
|
426
423
|
};
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
}, e),
|
|
430
|
-
|
|
424
|
+
E = setTimeout(() => {
|
|
425
|
+
b(!1);
|
|
426
|
+
}, e), F().catch((O) => {
|
|
427
|
+
y("Scroll attempt failed:", O), b(!1);
|
|
431
428
|
});
|
|
432
429
|
});
|
|
433
430
|
}
|
|
434
|
-
let
|
|
435
|
-
const
|
|
436
|
-
if (
|
|
437
|
-
|
|
431
|
+
let _ = !1;
|
|
432
|
+
const I = async (s, l = !1) => {
|
|
433
|
+
if (_) {
|
|
434
|
+
y(`Navigation to ${s} blocked - navigation already in progress`);
|
|
438
435
|
return;
|
|
439
436
|
}
|
|
440
|
-
|
|
437
|
+
_ = !0, P = 0, T.clear();
|
|
441
438
|
try {
|
|
442
|
-
await
|
|
439
|
+
await $(s, l);
|
|
443
440
|
} finally {
|
|
444
|
-
|
|
441
|
+
_ = !1, P = 0, T.clear();
|
|
445
442
|
}
|
|
446
|
-
},
|
|
447
|
-
const
|
|
443
|
+
}, u = (s) => {
|
|
444
|
+
const l = s.indexOf("#"), e = l >= 0 ? s.slice(l + 1) : "", n = l >= 0 ? s.slice(0, l) : s, f = n.indexOf("?"), E = f >= 0 ? n.slice(0, f) : n, S = f >= 0 ? ot(n.slice(f)) : {};
|
|
448
445
|
return {
|
|
449
|
-
path:
|
|
450
|
-
query:
|
|
446
|
+
path: C((E.startsWith(o) ? E.slice(o.length) : E) || "/"),
|
|
447
|
+
query: S,
|
|
451
448
|
fragment: e
|
|
452
449
|
};
|
|
453
|
-
},
|
|
450
|
+
}, $ = async (s, l = !1) => {
|
|
454
451
|
try {
|
|
455
|
-
const e =
|
|
452
|
+
const e = u(s), n = N(e.path);
|
|
456
453
|
if (!n.route) throw new Error(`No route found for ${e.path}`);
|
|
457
|
-
const f =
|
|
454
|
+
const f = c.getState(), E = {
|
|
458
455
|
path: e.path,
|
|
459
456
|
params: n.params,
|
|
460
457
|
query: e.query,
|
|
461
458
|
fragment: e.fragment
|
|
462
|
-
},
|
|
463
|
-
if (
|
|
464
|
-
if (typeof
|
|
465
|
-
|
|
466
|
-
const
|
|
467
|
-
T.add(
|
|
459
|
+
}, S = await G(E, f);
|
|
460
|
+
if (S === !1) return;
|
|
461
|
+
if (typeof S == "string") {
|
|
462
|
+
P++;
|
|
463
|
+
const b = `${E.path}->${S}`;
|
|
464
|
+
T.add(b), await $(S, !0);
|
|
468
465
|
return;
|
|
469
466
|
}
|
|
470
|
-
const
|
|
471
|
-
if (
|
|
472
|
-
if (typeof
|
|
473
|
-
|
|
474
|
-
const
|
|
475
|
-
T.add(
|
|
467
|
+
const q = await at(E, f);
|
|
468
|
+
if (q === !1) return;
|
|
469
|
+
if (typeof q == "string") {
|
|
470
|
+
P++;
|
|
471
|
+
const b = `${E.path}->${q}`;
|
|
472
|
+
T.add(b), await $(q, !0);
|
|
476
473
|
return;
|
|
477
474
|
}
|
|
478
475
|
if (typeof window < "u" && typeof document < "u") {
|
|
479
|
-
const
|
|
480
|
-
|
|
476
|
+
const b = $t(e.query), F = o + e.path + (b || "") + (e.fragment ? "#" + e.fragment : "");
|
|
477
|
+
l ? window.history.replaceState({}, "", F) : window.history.pushState({}, "", F);
|
|
478
|
+
}
|
|
479
|
+
if (c.setState(E), Y(E, f), typeof window < "u" && typeof document < "u") try {
|
|
480
|
+
const b = E.fragment;
|
|
481
|
+
m.enabled && b && w(String(b), m.offset, m.timeoutMs).catch(() => {
|
|
482
|
+
});
|
|
483
|
+
} catch {
|
|
481
484
|
}
|
|
482
|
-
if (d.setState(b), Y(b, f), typeof window < "u" && typeof document < "u")
|
|
483
|
-
try {
|
|
484
|
-
const R = b.fragment;
|
|
485
|
-
g.enabled && R && E(
|
|
486
|
-
String(R),
|
|
487
|
-
g.offset,
|
|
488
|
-
g.timeoutMs
|
|
489
|
-
).catch(() => {
|
|
490
|
-
});
|
|
491
|
-
} catch {
|
|
492
|
-
}
|
|
493
485
|
} catch (e) {
|
|
494
|
-
if (k("Navigation error:", e), e instanceof Error && (e.stack?.includes("runBeforeEnter") || e.stack?.includes("runOnEnter")))
|
|
495
|
-
throw e;
|
|
486
|
+
if (k("Navigation error:", e), e instanceof Error && (e.stack?.includes("runBeforeEnter") || e.stack?.includes("runOnEnter"))) throw e;
|
|
496
487
|
try {
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
d.setState({
|
|
505
|
-
path: b.path,
|
|
506
|
-
params: w.params,
|
|
488
|
+
if (!Q(r, c.getState().path).route) {
|
|
489
|
+
let n = r.find((f) => f.path === "/");
|
|
490
|
+
if (n || (n = r.find((f) => !f.path.includes(":") && !f.path.includes("*"))), !n && r.length > 0 && (n = r[0]), n) {
|
|
491
|
+
const f = Q(r, n.path);
|
|
492
|
+
c.setState({
|
|
493
|
+
path: n.path,
|
|
494
|
+
params: f.params,
|
|
507
495
|
query: {}
|
|
508
496
|
});
|
|
509
|
-
} else
|
|
510
|
-
k("No fallback route available for error recovery");
|
|
497
|
+
} else k("No fallback route available for error recovery");
|
|
511
498
|
}
|
|
512
499
|
} catch (n) {
|
|
513
|
-
|
|
514
|
-
"State recovery failed during navigation error:",
|
|
515
|
-
n
|
|
516
|
-
);
|
|
500
|
+
y("State recovery failed during navigation error:", n);
|
|
517
501
|
}
|
|
518
502
|
}
|
|
519
503
|
};
|
|
520
504
|
if (((s) => {
|
|
521
505
|
if (!s || s.length === 0)
|
|
522
506
|
return k("Router configuration error: No routes provided"), !1;
|
|
523
|
-
const
|
|
507
|
+
const l = /* @__PURE__ */ new Set();
|
|
524
508
|
for (const e of s) {
|
|
525
509
|
if (!e.path)
|
|
526
510
|
return k("Router configuration error: Route missing path", e), !1;
|
|
527
|
-
|
|
511
|
+
l.has(e.path) && y(`Duplicate route path detected: ${e.path}`), l.add(e.path), !e.component && !e.load && y(`Route '${e.path}' has no component or load function`);
|
|
528
512
|
}
|
|
529
513
|
return !0;
|
|
530
|
-
})(r), typeof window > "u" || typeof
|
|
531
|
-
for (const s of r)
|
|
532
|
-
|
|
533
|
-
m(`Pre-compiled ${r.length} routes for SSR`);
|
|
514
|
+
})(r), typeof window > "u" || typeof a < "u") {
|
|
515
|
+
for (const s of r) N(s.path);
|
|
516
|
+
y(`Pre-compiled ${r.length} routes for SSR`);
|
|
534
517
|
}
|
|
535
|
-
if (typeof window < "u" && typeof document < "u" && typeof
|
|
536
|
-
|
|
518
|
+
if (typeof window < "u" && typeof document < "u" && typeof a > "u") {
|
|
519
|
+
g = () => {
|
|
537
520
|
try {
|
|
538
|
-
const e = new URL(window.location.href), n = e.pathname
|
|
539
|
-
return {
|
|
521
|
+
const e = new URL(window.location.href), n = e.pathname;
|
|
522
|
+
return {
|
|
523
|
+
path: C((n.startsWith(o) ? n.slice(o.length) : n) || "/"),
|
|
524
|
+
query: ot(e.search),
|
|
525
|
+
fragment: e.hash && e.hash.length ? e.hash.slice(1) : ""
|
|
526
|
+
};
|
|
540
527
|
} catch (e) {
|
|
541
|
-
return
|
|
528
|
+
return y("Invalid URL detected, falling back to safe defaults", e), {
|
|
529
|
+
path: "/",
|
|
530
|
+
query: {},
|
|
531
|
+
fragment: ""
|
|
532
|
+
};
|
|
542
533
|
}
|
|
543
|
-
},
|
|
544
|
-
const s =
|
|
545
|
-
|
|
546
|
-
path:
|
|
534
|
+
}, v = g();
|
|
535
|
+
const s = N(v.path);
|
|
536
|
+
c = ut({
|
|
537
|
+
path: v.path,
|
|
547
538
|
params: s.params,
|
|
548
|
-
query:
|
|
549
|
-
fragment:
|
|
550
|
-
}),
|
|
551
|
-
|
|
552
|
-
await P(n.path, e);
|
|
539
|
+
query: v.query,
|
|
540
|
+
fragment: v.fragment
|
|
541
|
+
}), R = async (e = !1) => {
|
|
542
|
+
await I(g().path, e);
|
|
553
543
|
};
|
|
554
|
-
const
|
|
555
|
-
window.addEventListener("popstate",
|
|
556
|
-
|
|
544
|
+
const l = () => R(!0);
|
|
545
|
+
window.addEventListener("popstate", l), X = () => window.removeEventListener("popstate", l), M = (e) => I(e, !1), z = (e) => I(e, !0), H = () => window.history.back(), queueMicrotask(() => {
|
|
546
|
+
I(v.path, !0).catch((e) => {
|
|
557
547
|
k("Initial navigation error:", e);
|
|
558
548
|
});
|
|
559
549
|
});
|
|
560
550
|
} else {
|
|
561
|
-
|
|
551
|
+
g = () => {
|
|
562
552
|
try {
|
|
563
|
-
const e = new URL(
|
|
564
|
-
return {
|
|
553
|
+
const e = new URL(a || "/", "http://localhost"), n = e.pathname;
|
|
554
|
+
return {
|
|
555
|
+
path: C((n.startsWith(o) ? n.slice(o.length) : n) || "/"),
|
|
556
|
+
query: ot(e.search),
|
|
557
|
+
fragment: e.hash && e.hash.length ? e.hash.slice(1) : ""
|
|
558
|
+
};
|
|
565
559
|
} catch (e) {
|
|
566
|
-
return
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
560
|
+
return y("Invalid SSR URL detected, falling back to safe defaults", e), {
|
|
561
|
+
path: "/",
|
|
562
|
+
query: {},
|
|
563
|
+
fragment: ""
|
|
564
|
+
};
|
|
570
565
|
}
|
|
571
|
-
},
|
|
572
|
-
const s =
|
|
573
|
-
|
|
574
|
-
path:
|
|
566
|
+
}, v = g();
|
|
567
|
+
const s = N(v.path);
|
|
568
|
+
c = ut({
|
|
569
|
+
path: v.path,
|
|
575
570
|
params: s.params,
|
|
576
|
-
query:
|
|
577
|
-
fragment:
|
|
578
|
-
}),
|
|
579
|
-
|
|
580
|
-
await i(e.path);
|
|
571
|
+
query: v.query,
|
|
572
|
+
fragment: v.fragment
|
|
573
|
+
}), R = async () => {
|
|
574
|
+
await l(g().path);
|
|
581
575
|
};
|
|
582
|
-
const
|
|
583
|
-
if (
|
|
576
|
+
const l = async (e) => {
|
|
577
|
+
if (P++, P > W) {
|
|
584
578
|
k(`SSR redirect depth exceeded for path: ${e}`);
|
|
585
579
|
return;
|
|
586
580
|
}
|
|
587
581
|
try {
|
|
588
|
-
const n =
|
|
582
|
+
const n = u(e), f = N(n.path);
|
|
589
583
|
if (!f.route) throw new Error(`No route found for ${n.path}`);
|
|
590
|
-
const
|
|
584
|
+
const E = c.getState(), S = {
|
|
591
585
|
path: n.path,
|
|
592
586
|
params: f.params,
|
|
593
587
|
query: n.query,
|
|
594
588
|
fragment: n.fragment
|
|
595
|
-
},
|
|
596
|
-
if (
|
|
597
|
-
const
|
|
598
|
-
if (typeof
|
|
599
|
-
const
|
|
600
|
-
T.add(
|
|
589
|
+
}, q = rt(r, S.path);
|
|
590
|
+
if (q?.beforeEnter) {
|
|
591
|
+
const b = await q.beforeEnter(S, E);
|
|
592
|
+
if (typeof b == "string") {
|
|
593
|
+
const F = `${S.path}->${b}`;
|
|
594
|
+
T.add(F), await l(b);
|
|
601
595
|
return;
|
|
602
596
|
}
|
|
603
|
-
if (
|
|
597
|
+
if (b === !1) return;
|
|
604
598
|
}
|
|
605
|
-
if (
|
|
606
|
-
const
|
|
607
|
-
if (typeof
|
|
608
|
-
const
|
|
609
|
-
T.add(
|
|
599
|
+
if (q?.onEnter) {
|
|
600
|
+
const b = await q.onEnter(S, E);
|
|
601
|
+
if (typeof b == "string") {
|
|
602
|
+
const F = `${S.path}->${b}`;
|
|
603
|
+
T.add(F), await l(b);
|
|
610
604
|
return;
|
|
611
605
|
}
|
|
612
|
-
if (
|
|
606
|
+
if (b === !1) return;
|
|
613
607
|
}
|
|
614
|
-
|
|
608
|
+
c.setState(S), q?.afterEnter && q.afterEnter(S, E);
|
|
615
609
|
} catch (n) {
|
|
616
610
|
throw k("SSR navigation error:", n), n;
|
|
617
611
|
}
|
|
618
612
|
};
|
|
619
|
-
|
|
613
|
+
M = async (e) => (P = 0, T.clear(), l(e)), z = async (e) => (P = 0, T.clear(), l(e)), H = () => {
|
|
620
614
|
};
|
|
621
615
|
}
|
|
622
616
|
return {
|
|
623
617
|
_cleanupScrollState: tt,
|
|
624
|
-
destroy:
|
|
625
|
-
store:
|
|
626
|
-
push:
|
|
627
|
-
replace:
|
|
628
|
-
back:
|
|
629
|
-
subscribe:
|
|
630
|
-
matchRoute: (s) =>
|
|
631
|
-
getCurrent: () =>
|
|
632
|
-
resolveRouteComponent:
|
|
633
|
-
base:
|
|
634
|
-
// Public API: allow components or tests to explicitly request scrolling to
|
|
635
|
-
// a fragment when they know their DOM is ready. Returns true if scrolled.
|
|
618
|
+
destroy: X,
|
|
619
|
+
store: c,
|
|
620
|
+
push: M,
|
|
621
|
+
replace: z,
|
|
622
|
+
back: H,
|
|
623
|
+
subscribe: c.subscribe,
|
|
624
|
+
matchRoute: (s) => N(s),
|
|
625
|
+
getCurrent: () => c.getState(),
|
|
626
|
+
resolveRouteComponent: gt,
|
|
627
|
+
base: o,
|
|
636
628
|
scrollToFragment: (s) => {
|
|
637
|
-
const
|
|
638
|
-
return !
|
|
639
|
-
i,
|
|
640
|
-
g.offset,
|
|
641
|
-
g.timeoutMs
|
|
642
|
-
);
|
|
629
|
+
const l = s || c.getState().fragment;
|
|
630
|
+
return !l || typeof window > "u" || typeof document > "u" ? Promise.resolve(!1) : w(l, m.offset, m.timeoutMs);
|
|
643
631
|
}
|
|
644
632
|
};
|
|
645
633
|
}
|
|
646
|
-
function
|
|
647
|
-
|
|
648
|
-
const r =
|
|
649
|
-
if (
|
|
634
|
+
function zt(t) {
|
|
635
|
+
Pt();
|
|
636
|
+
const r = It(t), h = yt();
|
|
637
|
+
if (h) {
|
|
650
638
|
try {
|
|
651
|
-
|
|
639
|
+
h.destroy();
|
|
652
640
|
} catch {
|
|
653
641
|
}
|
|
654
642
|
try {
|
|
655
|
-
|
|
643
|
+
h._cleanupScrollState?.();
|
|
656
644
|
} catch {
|
|
657
645
|
}
|
|
658
646
|
}
|
|
659
|
-
|
|
647
|
+
qt(r);
|
|
660
648
|
try {
|
|
661
|
-
|
|
649
|
+
Tt();
|
|
662
650
|
try {
|
|
663
651
|
typeof window < "u" && nt();
|
|
664
652
|
} catch {
|
|
@@ -674,55 +662,68 @@ function Wt(t) {
|
|
|
674
662
|
}
|
|
675
663
|
} catch {
|
|
676
664
|
}
|
|
677
|
-
return
|
|
678
|
-
const
|
|
679
|
-
if (!
|
|
680
|
-
const
|
|
681
|
-
let
|
|
682
|
-
|
|
665
|
+
return lt("router-view", async () => {
|
|
666
|
+
const a = it()?._router, i = a ?? x;
|
|
667
|
+
if (!yt() && !a) return U`<div>Router not initialized.</div>`;
|
|
668
|
+
const o = et(i.getCurrent()), m = typeof window > "u";
|
|
669
|
+
let g;
|
|
670
|
+
m || (ct(() => {
|
|
683
671
|
try {
|
|
684
|
-
typeof
|
|
672
|
+
typeof i.subscribe == "function" && (g = i.subscribe((c) => {
|
|
685
673
|
try {
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
674
|
+
c && typeof c == "object" && typeof c.path == "string" ? o.value = c : (y("router-view received invalid state", c), o.value = {
|
|
675
|
+
path: "/",
|
|
676
|
+
params: {},
|
|
677
|
+
query: {}
|
|
678
|
+
});
|
|
679
|
+
} catch (R) {
|
|
680
|
+
y("router-view subscription update failed", R);
|
|
689
681
|
try {
|
|
690
|
-
|
|
682
|
+
o.value = {
|
|
683
|
+
path: "/",
|
|
684
|
+
params: {},
|
|
685
|
+
query: {}
|
|
686
|
+
};
|
|
691
687
|
} catch {
|
|
692
688
|
}
|
|
693
689
|
}
|
|
694
690
|
}));
|
|
695
|
-
} catch (
|
|
696
|
-
|
|
691
|
+
} catch (c) {
|
|
692
|
+
y("router-view subscribe failed", c);
|
|
697
693
|
}
|
|
698
|
-
}),
|
|
699
|
-
if (typeof
|
|
694
|
+
}), st(() => {
|
|
695
|
+
if (typeof g == "function") {
|
|
700
696
|
try {
|
|
701
|
-
|
|
702
|
-
} catch (
|
|
703
|
-
|
|
697
|
+
g();
|
|
698
|
+
} catch (c) {
|
|
699
|
+
y("router-view unsubscribe failed", c);
|
|
704
700
|
}
|
|
705
|
-
|
|
701
|
+
g = void 0;
|
|
706
702
|
}
|
|
707
703
|
}));
|
|
708
|
-
const
|
|
709
|
-
if (!
|
|
704
|
+
const v = i.matchRoute(o.value.path);
|
|
705
|
+
if (!v || !v.route) return U`<div>Not found</div>`;
|
|
710
706
|
try {
|
|
711
|
-
const
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
707
|
+
const c = await i.resolveRouteComponent(v.route);
|
|
708
|
+
if (typeof c == "string") return {
|
|
709
|
+
tag: c,
|
|
710
|
+
props: { attrs: { ...o.value.params } },
|
|
711
|
+
children: []
|
|
712
|
+
};
|
|
713
|
+
if (typeof c == "function") {
|
|
714
|
+
const R = c();
|
|
715
|
+
return (R instanceof Promise ? R : Promise.resolve(R)).then((M) => typeof M == "string" ? {
|
|
716
|
+
tag: M,
|
|
717
|
+
props: {},
|
|
718
|
+
children: []
|
|
719
|
+
} : M);
|
|
719
720
|
}
|
|
720
|
-
return
|
|
721
|
+
return U`<div>Invalid route component</div>`;
|
|
721
722
|
} catch {
|
|
722
|
-
return
|
|
723
|
+
return U`<div>Invalid route component</div>`;
|
|
723
724
|
}
|
|
724
|
-
}),
|
|
725
|
-
const
|
|
725
|
+
}), lt("router-link", () => {
|
|
726
|
+
const a = St({
|
|
726
727
|
to: "",
|
|
727
728
|
tag: "a",
|
|
728
729
|
replace: !1,
|
|
@@ -732,65 +733,73 @@ function Wt(t) {
|
|
|
732
733
|
ariaCurrentValue: "page",
|
|
733
734
|
disabled: !1,
|
|
734
735
|
external: !1,
|
|
735
|
-
// allow host `class` and `style` attributes to be read via useProps
|
|
736
736
|
class: "",
|
|
737
737
|
style: ""
|
|
738
|
-
}),
|
|
739
|
-
isExactActive:
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
_.base
|
|
743
|
-
),
|
|
744
|
-
isActive: vt(
|
|
745
|
-
g,
|
|
746
|
-
v,
|
|
747
|
-
_.base
|
|
748
|
-
),
|
|
749
|
-
isExternal: Q(v) || !!o.external
|
|
738
|
+
}), i = typeof window > "u", o = et(x.getCurrent()), m = o.value?.path || "/", g = String(a.to || ""), v = i ? {
|
|
739
|
+
isExactActive: mt(m, g, x.base),
|
|
740
|
+
isActive: vt(m, g, x.base),
|
|
741
|
+
isExternal: K(g) || !!a.external
|
|
750
742
|
} : null;
|
|
751
|
-
let
|
|
752
|
-
|
|
753
|
-
const
|
|
754
|
-
if (!
|
|
755
|
-
|
|
756
|
-
|
|
743
|
+
let c;
|
|
744
|
+
Rt(() => "a,button{display:inline-block;}");
|
|
745
|
+
const R = et(a.class || ""), M = et(a.style || "");
|
|
746
|
+
if (!i) {
|
|
747
|
+
const p = it(), w = p?._host ?? null;
|
|
748
|
+
let _ = null, I = null;
|
|
749
|
+
ct(() => {
|
|
750
|
+
w instanceof HTMLElement && (I = () => {
|
|
751
|
+
const u = String(a.to || "");
|
|
752
|
+
if (u && !K(u)) try {
|
|
753
|
+
const { route: $ } = x.matchRoute(u);
|
|
754
|
+
$?.load && gt($).catch(() => {
|
|
755
|
+
});
|
|
756
|
+
} catch {
|
|
757
|
+
}
|
|
758
|
+
}, w.addEventListener("mouseenter", I, { once: !0 }));
|
|
757
759
|
try {
|
|
758
|
-
if (typeof
|
|
759
|
-
|
|
760
|
+
if (typeof x.subscribe == "function") {
|
|
761
|
+
c = x.subscribe((u) => {
|
|
760
762
|
try {
|
|
761
|
-
u && typeof u == "object" && typeof u.path == "string" ?
|
|
762
|
-
|
|
763
|
-
|
|
763
|
+
u && typeof u == "object" && typeof u.path == "string" ? o.value = u : (y("router-link received invalid state", u), o.value = {
|
|
764
|
+
path: "/",
|
|
765
|
+
params: {},
|
|
766
|
+
query: {}
|
|
767
|
+
});
|
|
768
|
+
} catch ($) {
|
|
769
|
+
y("router-link subscription update failed", $);
|
|
764
770
|
try {
|
|
765
|
-
|
|
771
|
+
o.value = {
|
|
772
|
+
path: "/",
|
|
773
|
+
params: {},
|
|
774
|
+
query: {}
|
|
775
|
+
};
|
|
766
776
|
} catch {
|
|
767
777
|
}
|
|
768
778
|
}
|
|
769
779
|
});
|
|
770
780
|
try {
|
|
771
|
-
const u =
|
|
772
|
-
u && typeof u.path == "string" && (
|
|
781
|
+
const u = x.getCurrent();
|
|
782
|
+
u && typeof u.path == "string" && (o.value = u);
|
|
773
783
|
} catch (u) {
|
|
774
|
-
|
|
784
|
+
y("router-link initial state sync failed", u);
|
|
775
785
|
}
|
|
776
|
-
|
|
786
|
+
_ = setInterval(() => {
|
|
777
787
|
try {
|
|
778
|
-
const u =
|
|
779
|
-
u && typeof u.path == "string" && JSON.stringify(
|
|
788
|
+
const u = x.getCurrent();
|
|
789
|
+
u && typeof u.path == "string" && JSON.stringify(o.value) !== JSON.stringify(u) && (o.value = u);
|
|
780
790
|
} catch {
|
|
781
791
|
}
|
|
782
792
|
}, 100);
|
|
783
793
|
}
|
|
784
794
|
} catch (u) {
|
|
785
|
-
|
|
795
|
+
y("router-link subscribe failed", u);
|
|
786
796
|
}
|
|
787
797
|
try {
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
P && (S.value = P), N && (C.value = N), P !== null && u.removeAttribute("class"), N !== null && u.removeAttribute("style");
|
|
798
|
+
if (w instanceof HTMLElement) {
|
|
799
|
+
const u = w.getAttribute("class"), $ = w.getAttribute("style");
|
|
800
|
+
u && (R.value = u), $ && (M.value = $), u !== null && w.removeAttribute("class"), $ !== null && w.removeAttribute("style");
|
|
792
801
|
try {
|
|
793
|
-
|
|
802
|
+
p?._requestRender?.();
|
|
794
803
|
try {
|
|
795
804
|
nt();
|
|
796
805
|
} catch {
|
|
@@ -799,100 +808,89 @@ function Wt(t) {
|
|
|
799
808
|
}
|
|
800
809
|
}
|
|
801
810
|
} catch (u) {
|
|
802
|
-
|
|
811
|
+
y("router-link host migration failed", u);
|
|
812
|
+
}
|
|
813
|
+
}), st(() => {
|
|
814
|
+
if (I && w instanceof HTMLElement) try {
|
|
815
|
+
w.removeEventListener("mouseenter", I);
|
|
816
|
+
} catch {
|
|
817
|
+
} finally {
|
|
818
|
+
I = null;
|
|
819
|
+
}
|
|
820
|
+
if (typeof c == "function") try {
|
|
821
|
+
c();
|
|
822
|
+
} catch (u) {
|
|
823
|
+
y("router-link unsubscribe failed", u);
|
|
824
|
+
} finally {
|
|
825
|
+
c = void 0;
|
|
826
|
+
}
|
|
827
|
+
if (_) try {
|
|
828
|
+
clearInterval(_);
|
|
829
|
+
} catch (u) {
|
|
830
|
+
y("router-link sync interval cleanup failed", u);
|
|
831
|
+
} finally {
|
|
832
|
+
_ = null;
|
|
803
833
|
}
|
|
804
|
-
}), lt(() => {
|
|
805
|
-
if (typeof d == "function")
|
|
806
|
-
try {
|
|
807
|
-
d();
|
|
808
|
-
} catch (E) {
|
|
809
|
-
m("router-link unsubscribe failed", E);
|
|
810
|
-
} finally {
|
|
811
|
-
d = void 0;
|
|
812
|
-
}
|
|
813
|
-
if (h)
|
|
814
|
-
try {
|
|
815
|
-
clearInterval(h);
|
|
816
|
-
} catch (E) {
|
|
817
|
-
m("router-link sync interval cleanup failed", E);
|
|
818
|
-
} finally {
|
|
819
|
-
h = null;
|
|
820
|
-
}
|
|
821
834
|
});
|
|
822
835
|
}
|
|
823
|
-
const
|
|
824
|
-
if (
|
|
825
|
-
return l.isExactActive;
|
|
836
|
+
const z = L(() => {
|
|
837
|
+
if (i && v) return v.isExactActive;
|
|
826
838
|
try {
|
|
827
|
-
const
|
|
828
|
-
return !
|
|
829
|
-
} catch (
|
|
830
|
-
return
|
|
839
|
+
const p = x.base ?? "", w = a.to || "";
|
|
840
|
+
return !o.value || typeof o.value.path != "string" ? !1 : mt(o.value.path, w, p);
|
|
841
|
+
} catch (p) {
|
|
842
|
+
return y("isExactActive computation error", p), !1;
|
|
831
843
|
}
|
|
832
|
-
}),
|
|
833
|
-
if (
|
|
834
|
-
return l.isActive;
|
|
844
|
+
}), H = L(() => {
|
|
845
|
+
if (i && v) return v.isActive;
|
|
835
846
|
try {
|
|
836
|
-
const
|
|
837
|
-
return !
|
|
838
|
-
} catch (
|
|
839
|
-
return
|
|
847
|
+
const p = x.base ?? "", w = a.to || "";
|
|
848
|
+
return !o.value || typeof o.value.path != "string" ? !1 : a.exact ? z.value : vt(o.value.path, w, p);
|
|
849
|
+
} catch (p) {
|
|
850
|
+
return y("isActive computation error", p), !1;
|
|
840
851
|
}
|
|
841
|
-
}),
|
|
842
|
-
const
|
|
843
|
-
if (
|
|
844
|
-
if (
|
|
845
|
-
const [
|
|
846
|
-
let Z =
|
|
847
|
-
if (
|
|
848
|
-
const
|
|
849
|
-
|
|
852
|
+
}), X = L(() => {
|
|
853
|
+
const p = String(a.to || "");
|
|
854
|
+
if (ht(p)) return null;
|
|
855
|
+
if (K(p)) return p;
|
|
856
|
+
const [w, _] = p.split("#"), [I, u] = (w || "").split("?"), $ = x.base ?? "";
|
|
857
|
+
let Z = I || "/";
|
|
858
|
+
if ($ && $ !== "/") {
|
|
859
|
+
const s = C($), l = C(Z);
|
|
860
|
+
l.startsWith(s) ? Z = l.slice(s.length) || "/" : Z = l;
|
|
850
861
|
}
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
}), B = M(() => ({
|
|
862
|
+
return $ + C(Z || "/") + (u ? "?" + u : "") + (_ ? "#" + _ : "");
|
|
863
|
+
}), T = L(() => {
|
|
864
|
+
const p = (R && R.value || a.class || "").split(/\s+/).filter(Boolean), w = {};
|
|
865
|
+
for (const _ of p) w[_] = !0;
|
|
866
|
+
return w;
|
|
867
|
+
}), W = L(() => ({
|
|
858
868
|
...T.value,
|
|
859
|
-
[
|
|
860
|
-
[
|
|
861
|
-
})),
|
|
862
|
-
(
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
const h = String(o.to || "");
|
|
867
|
-
return (Q(h) || !!o.external) && G.value === "a";
|
|
868
|
-
}), O = M(
|
|
869
|
-
() => C && C.value || o.style || ""
|
|
870
|
-
), tt = (h) => {
|
|
871
|
-
if (h.defaultPrevented || h.button !== 0 || h.metaKey || h.altKey || h.ctrlKey || h.shiftKey)
|
|
872
|
-
return;
|
|
873
|
-
if (A.value) {
|
|
874
|
-
h.preventDefault();
|
|
875
|
-
return;
|
|
876
|
-
}
|
|
877
|
-
const E = String(o.to || "");
|
|
878
|
-
if (pt(E)) {
|
|
879
|
-
try {
|
|
880
|
-
h.preventDefault();
|
|
881
|
-
} catch {
|
|
869
|
+
[a.activeClass || "active"]: H.value,
|
|
870
|
+
[a.exactActiveClass || "exact-active"]: z.value
|
|
871
|
+
})), P = L(() => Object.keys(W.value).filter((p) => W.value[p]).join(" ")), G = L(() => a.tag || "a"), at = L(() => G.value === "button"), Y = L(() => z.value ? a.ariaCurrentValue : null), A = L(() => !!a.disabled), j = L(() => (K(String(a.to || "")) || !!a.external) && G.value === "a"), N = L(() => M && M.value || a.style || ""), tt = (p) => {
|
|
872
|
+
if (!(p.defaultPrevented || p.button !== 0 || p.metaKey || p.altKey || p.ctrlKey || p.shiftKey)) {
|
|
873
|
+
if (A.value) {
|
|
874
|
+
p.preventDefault();
|
|
875
|
+
return;
|
|
882
876
|
}
|
|
883
|
-
|
|
884
|
-
|
|
877
|
+
if (ht(String(a.to || ""))) {
|
|
878
|
+
try {
|
|
879
|
+
p.preventDefault();
|
|
880
|
+
} catch {
|
|
881
|
+
}
|
|
882
|
+
y("Blocked unsafe javascript: URI in router-link.to");
|
|
883
|
+
return;
|
|
884
|
+
}
|
|
885
|
+
j.value || (p.preventDefault(), a.replace ? x.replace(a.to) : x.push(a.to));
|
|
885
886
|
}
|
|
886
|
-
K.value || (h.preventDefault(), o.replace ? _.replace(o.to) : _.push(o.to));
|
|
887
887
|
};
|
|
888
|
-
return
|
|
889
|
-
${
|
|
890
|
-
at.value,
|
|
891
|
-
j`
|
|
888
|
+
return U`
|
|
889
|
+
${Et().when(at.value, U`
|
|
892
890
|
<button
|
|
893
891
|
part="button"
|
|
894
|
-
class="${
|
|
895
|
-
style="${
|
|
892
|
+
class="${P.value}"
|
|
893
|
+
style="${N.value || null}"
|
|
896
894
|
aria-current="${Y.value}"
|
|
897
895
|
disabled="${A.value ? "" : null}"
|
|
898
896
|
aria-disabled="${A.value ? "true" : null}"
|
|
@@ -901,18 +899,17 @@ function Wt(t) {
|
|
|
901
899
|
>
|
|
902
900
|
<slot></slot>
|
|
903
901
|
</button>
|
|
904
|
-
`
|
|
905
|
-
).otherwise(j`
|
|
902
|
+
`).otherwise(U`
|
|
906
903
|
<a
|
|
907
904
|
part="link"
|
|
908
|
-
href="${A.value ? null :
|
|
909
|
-
class="${
|
|
910
|
-
style="${
|
|
905
|
+
href="${A.value ? null : X.value}"
|
|
906
|
+
class="${P.value}"
|
|
907
|
+
style="${N.value || null}"
|
|
911
908
|
aria-current="${Y.value}"
|
|
912
909
|
aria-disabled="${A.value ? "true" : null}"
|
|
913
910
|
tabindex="${A.value ? "-1" : null}"
|
|
914
|
-
target="${
|
|
915
|
-
rel="${
|
|
911
|
+
target="${j.value ? "_blank" : null}"
|
|
912
|
+
rel="${j.value ? "noopener noreferrer" : null}"
|
|
916
913
|
@click="${tt}"
|
|
917
914
|
><slot></slot
|
|
918
915
|
></a>
|
|
@@ -920,42 +917,42 @@ function Wt(t) {
|
|
|
920
917
|
`;
|
|
921
918
|
}), r;
|
|
922
919
|
}
|
|
923
|
-
function
|
|
924
|
-
if (
|
|
925
|
-
let
|
|
926
|
-
if (
|
|
927
|
-
const
|
|
928
|
-
|
|
920
|
+
function mt(t, r, h) {
|
|
921
|
+
if (K(r)) return !1;
|
|
922
|
+
let a = (r.split("#")[0] || "/").split("?")[0];
|
|
923
|
+
if (h && h !== "/") {
|
|
924
|
+
const i = C(h), o = C(a);
|
|
925
|
+
o.startsWith(i) ? a = o.slice(i.length) || "/" : a = o;
|
|
929
926
|
}
|
|
930
|
-
|
|
931
|
-
return a === g;
|
|
927
|
+
return C(t) === C(a);
|
|
932
928
|
}
|
|
933
|
-
function vt(t, r,
|
|
934
|
-
if (
|
|
935
|
-
let
|
|
936
|
-
if (
|
|
937
|
-
const
|
|
938
|
-
|
|
929
|
+
function vt(t, r, h) {
|
|
930
|
+
if (K(r)) return !1;
|
|
931
|
+
let a = (r.split("#")[0] || "/").split("?")[0];
|
|
932
|
+
if (h && h !== "/") {
|
|
933
|
+
const m = C(h), g = C(a);
|
|
934
|
+
g.startsWith(m) ? a = g.slice(m.length) || "/" : a = g;
|
|
939
935
|
}
|
|
940
|
-
const
|
|
941
|
-
return
|
|
936
|
+
const i = C(t), o = C(a);
|
|
937
|
+
return o === "/" ? i === "/" : i === o ? !0 : i.startsWith(o.endsWith("/") ? o : o + "/");
|
|
942
938
|
}
|
|
943
939
|
export {
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
940
|
+
ft as DEFAULT_SCROLL_CONFIG,
|
|
941
|
+
x as activeRouterProxy,
|
|
942
|
+
xt as canonicalizeBase,
|
|
943
|
+
Pt as clearComponentCache,
|
|
948
944
|
rt as findMatchedRoute,
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
945
|
+
zt as initRouter,
|
|
946
|
+
K as isAbsoluteUrl,
|
|
947
|
+
ht as isDangerousScheme,
|
|
948
|
+
Q as matchRoute,
|
|
949
|
+
Ft as matchRouteSSR,
|
|
950
|
+
C as normalizePathForRoute,
|
|
951
|
+
ot as parseQuery,
|
|
952
|
+
gt as resolveRouteComponent,
|
|
953
|
+
Ct as safeDecode,
|
|
954
|
+
$t as serializeQuery,
|
|
955
|
+
It as useRouter
|
|
960
956
|
};
|
|
961
|
-
|
|
957
|
+
|
|
958
|
+
//# sourceMappingURL=custom-elements-runtime.router.es.js.map
|