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