@jasonshimmy/custom-elements-runtime 0.3.0 → 0.3.1
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 +1 -0
- package/dist/custom-elements-runtime.cjs.js +10 -10
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +1247 -939
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +10 -10
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/dist/directive-enhancements.d.ts +138 -0
- package/dist/directives.d.ts +5 -0
- package/dist/index.d.ts +1 -0
- package/dist/runtime/logger.d.ts +16 -0
- package/dist/runtime/scheduler.d.ts +27 -0
- package/dist/runtime/vdom.d.ts +3 -10
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
function
|
|
2
|
-
return
|
|
1
|
+
function we(e, t) {
|
|
2
|
+
return O(e ? t : [], "when-block");
|
|
3
3
|
}
|
|
4
|
-
function
|
|
4
|
+
function Ot(e, t) {
|
|
5
5
|
return e.map((r, i) => {
|
|
6
6
|
const n = typeof r == "object" ? r?.key ?? r?.id ?? `idx-${i}` : String(r);
|
|
7
|
-
return
|
|
7
|
+
return O(t(r, i), `each-${n}`);
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function Ke() {
|
|
11
11
|
const e = [];
|
|
12
12
|
return {
|
|
13
13
|
when(t, r) {
|
|
@@ -17,18 +17,18 @@ function ze() {
|
|
|
17
17
|
return e.push([!0, t]), this;
|
|
18
18
|
},
|
|
19
19
|
done() {
|
|
20
|
-
return
|
|
20
|
+
return Je(...e);
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function Je(...e) {
|
|
25
25
|
for (let t = 0; t < e.length; t++) {
|
|
26
26
|
const [r, i] = e[t];
|
|
27
|
-
if (r) return [
|
|
27
|
+
if (r) return [O(i, `whenChain-branch-${t}`)];
|
|
28
28
|
}
|
|
29
|
-
return [
|
|
29
|
+
return [O([], "whenChain-empty")];
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function O(e, t) {
|
|
32
32
|
const r = e ? Array.isArray(e) ? e.filter(Boolean) : [e].filter(Boolean) : [];
|
|
33
33
|
return {
|
|
34
34
|
tag: "#anchor",
|
|
@@ -36,7 +36,131 @@ function pe(e, t) {
|
|
|
36
36
|
children: r
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
function Pt(e, t) {
|
|
40
|
+
return we(!e, t);
|
|
41
|
+
}
|
|
42
|
+
function Mt(e, t) {
|
|
43
|
+
const r = !e || e.length === 0;
|
|
44
|
+
return we(r, t);
|
|
45
|
+
}
|
|
46
|
+
function Bt(e, t) {
|
|
47
|
+
const r = !!(e && e.length > 0);
|
|
48
|
+
return we(r, t);
|
|
49
|
+
}
|
|
50
|
+
function Wt(e, t, r) {
|
|
51
|
+
const i = [];
|
|
52
|
+
return e.forEach((n, s) => {
|
|
53
|
+
t(n, s) && i.push({ item: n, originalIndex: s });
|
|
54
|
+
}), i.map(({ item: n, originalIndex: s }, o) => {
|
|
55
|
+
const a = typeof n == "object" && n != null ? n?.key ?? n?.id ?? `filtered-${s}` : `filtered-${s}`;
|
|
56
|
+
return O(r(n, s, o), `each-where-${a}`);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function It(e, t) {
|
|
60
|
+
const r = e?.length ?? 0;
|
|
61
|
+
return r === 0 && t.empty ? O(t.empty, "switch-length-empty") : r === 1 && t.one ? O(t.one(e[0]), "switch-length-one") : t.exactly?.[r] ? O(t.exactly[r](e), `switch-length-${r}`) : r > 1 && t.many ? O(t.many(e), "switch-length-many") : O([], "switch-length-fallback");
|
|
62
|
+
}
|
|
63
|
+
function qt(e, t, r) {
|
|
64
|
+
const i = /* @__PURE__ */ new Map();
|
|
65
|
+
return e.forEach((n) => {
|
|
66
|
+
const s = t(n);
|
|
67
|
+
i.has(s) || i.set(s, []), i.get(s).push(n);
|
|
68
|
+
}), Array.from(i.entries()).map(([n, s], o) => O(
|
|
69
|
+
r(n, s, o),
|
|
70
|
+
`each-group-${n}`
|
|
71
|
+
));
|
|
72
|
+
}
|
|
73
|
+
function zt(e, t, r, i) {
|
|
74
|
+
const n = r * t, s = Math.min(n + t, e.length);
|
|
75
|
+
return e.slice(n, s).map((a, c) => {
|
|
76
|
+
const u = n + c, m = typeof a == "object" && a != null ? a?.key ?? a?.id ?? `page-${u}` : `page-${u}`;
|
|
77
|
+
return O(i(a, u, c), `each-page-${m}`);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function Ht(e, t) {
|
|
81
|
+
return e.loading && t.loading ? O(t.loading, "promise-loading") : e.error && t.error ? O(t.error(e.error), "promise-error") : e.data !== void 0 && t.success ? O(t.success(e.data), "promise-success") : t.idle ? O(t.idle, "promise-idle") : O([], "promise-fallback");
|
|
82
|
+
}
|
|
83
|
+
function q(e, t) {
|
|
84
|
+
const r = typeof window < "u" && window.matchMedia?.(e)?.matches;
|
|
85
|
+
return we(!!r, t);
|
|
86
|
+
}
|
|
87
|
+
const G = {
|
|
88
|
+
// Responsive breakpoints (matching style.ts)
|
|
89
|
+
sm: "(min-width:640px)",
|
|
90
|
+
md: "(min-width:768px)",
|
|
91
|
+
lg: "(min-width:1024px)",
|
|
92
|
+
xl: "(min-width:1280px)",
|
|
93
|
+
"2xl": "(min-width:1536px)",
|
|
94
|
+
// Dark mode (matching style.ts)
|
|
95
|
+
dark: "(prefers-color-scheme: dark)"
|
|
96
|
+
}, ze = ["sm", "md", "lg", "xl", "2xl"], Ve = {
|
|
97
|
+
// Breakpoint-based rendering (matching style.ts exactly)
|
|
98
|
+
sm: (e) => q(G.sm, e),
|
|
99
|
+
md: (e) => q(G.md, e),
|
|
100
|
+
lg: (e) => q(G.lg, e),
|
|
101
|
+
xl: (e) => q(G.xl, e),
|
|
102
|
+
"2xl": (e) => q(G["2xl"], e),
|
|
103
|
+
// Dark mode (matching style.ts)
|
|
104
|
+
dark: (e) => q(G.dark, e),
|
|
105
|
+
light: (e) => q("(prefers-color-scheme: light)", e),
|
|
106
|
+
// Accessibility and interaction preferences
|
|
107
|
+
touch: (e) => q("(hover: none) and (pointer: coarse)", e),
|
|
108
|
+
mouse: (e) => q("(hover: hover) and (pointer: fine)", e),
|
|
109
|
+
reducedMotion: (e) => q("(prefers-reduced-motion: reduce)", e),
|
|
110
|
+
highContrast: (e) => q("(prefers-contrast: high)", e),
|
|
111
|
+
// Orientation
|
|
112
|
+
portrait: (e) => q("(orientation: portrait)", e),
|
|
113
|
+
landscape: (e) => q("(orientation: landscape)", e)
|
|
114
|
+
};
|
|
115
|
+
function Nt(e, t) {
|
|
116
|
+
const r = [];
|
|
117
|
+
e.includes("dark") ? r.push(G.dark) : e.includes("light") && r.push("(prefers-color-scheme: light)");
|
|
118
|
+
const i = e.filter(
|
|
119
|
+
(o) => ze.includes(o)
|
|
120
|
+
), n = i[i.length - 1];
|
|
121
|
+
n && n in G && r.push(G[n]);
|
|
122
|
+
const s = r.length > 0 ? r.join(" and ") : "all";
|
|
123
|
+
return q(s, t);
|
|
124
|
+
}
|
|
125
|
+
function Dt(e) {
|
|
126
|
+
const t = [];
|
|
127
|
+
return e.base && t.push(O(e.base, "responsive-base")), ze.forEach((r) => {
|
|
128
|
+
const i = e[r];
|
|
129
|
+
i && t.push(Ve[r](i));
|
|
130
|
+
}), t;
|
|
131
|
+
}
|
|
132
|
+
function Ut(e) {
|
|
133
|
+
const t = [];
|
|
134
|
+
let r = null;
|
|
135
|
+
return {
|
|
136
|
+
case(i, n) {
|
|
137
|
+
const s = typeof i == "function" ? i : (o) => o === i;
|
|
138
|
+
return t.push({ condition: s, content: n }), this;
|
|
139
|
+
},
|
|
140
|
+
when(i, n) {
|
|
141
|
+
return t.push({ condition: i, content: n }), this;
|
|
142
|
+
},
|
|
143
|
+
otherwise(i) {
|
|
144
|
+
return r = i, this;
|
|
145
|
+
},
|
|
146
|
+
done() {
|
|
147
|
+
for (let i = 0; i < t.length; i++) {
|
|
148
|
+
const { condition: n, content: s } = t[i];
|
|
149
|
+
if (n(e))
|
|
150
|
+
return O(s, `switch-case-${i}`);
|
|
151
|
+
}
|
|
152
|
+
return O(r || [], "switch-otherwise");
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
const He = typeof process < "u" && process.env?.NODE_ENV !== "production";
|
|
157
|
+
function Y(e, ...t) {
|
|
158
|
+
He && console.error(e, ...t);
|
|
159
|
+
}
|
|
160
|
+
function pe(e, ...t) {
|
|
161
|
+
He && console.warn(e, ...t);
|
|
162
|
+
}
|
|
163
|
+
class ne extends EventTarget {
|
|
40
164
|
handlers = {};
|
|
41
165
|
static instance;
|
|
42
166
|
eventCounters = /* @__PURE__ */ new Map();
|
|
@@ -44,7 +168,7 @@ class X extends EventTarget {
|
|
|
44
168
|
* Returns the singleton instance of GlobalEventBus
|
|
45
169
|
*/
|
|
46
170
|
static getInstance() {
|
|
47
|
-
return
|
|
171
|
+
return ne.instance || (ne.instance = new ne()), ne.instance;
|
|
48
172
|
}
|
|
49
173
|
/**
|
|
50
174
|
* Emit a global event with optional data. Includes event storm protection.
|
|
@@ -63,12 +187,12 @@ class X extends EventTarget {
|
|
|
63
187
|
// Global events don't need to bubble
|
|
64
188
|
cancelable: !0
|
|
65
189
|
}));
|
|
66
|
-
const
|
|
67
|
-
|
|
190
|
+
const s = this.handlers[t];
|
|
191
|
+
s && s.forEach((o) => {
|
|
68
192
|
try {
|
|
69
|
-
|
|
193
|
+
o(r);
|
|
70
194
|
} catch (a) {
|
|
71
|
-
|
|
195
|
+
Y(`Error in global event handler for "${t}":`, a);
|
|
72
196
|
}
|
|
73
197
|
});
|
|
74
198
|
}
|
|
@@ -112,8 +236,8 @@ class X extends EventTarget {
|
|
|
112
236
|
*/
|
|
113
237
|
once(t, r) {
|
|
114
238
|
return new Promise((i) => {
|
|
115
|
-
const n = this.on(t, (
|
|
116
|
-
n(), r(
|
|
239
|
+
const n = this.on(t, (s) => {
|
|
240
|
+
n(), r(s), i(s);
|
|
117
241
|
});
|
|
118
242
|
});
|
|
119
243
|
}
|
|
@@ -157,8 +281,8 @@ class X extends EventTarget {
|
|
|
157
281
|
this.eventCounters.clear();
|
|
158
282
|
}
|
|
159
283
|
}
|
|
160
|
-
const
|
|
161
|
-
function
|
|
284
|
+
const le = ne.getInstance(), Ft = (e, t) => le.emit(e, t), Kt = (e, t) => le.on(e, t), Jt = (e, t) => le.off(e, t), Vt = (e, t) => le.once(e, t), Gt = (e, t, r) => le.listen(e, t, r);
|
|
285
|
+
function Le(e) {
|
|
162
286
|
let t = { ...e };
|
|
163
287
|
const r = [];
|
|
164
288
|
function i(a) {
|
|
@@ -167,19 +291,19 @@ function $e(e) {
|
|
|
167
291
|
function n() {
|
|
168
292
|
return t;
|
|
169
293
|
}
|
|
170
|
-
function
|
|
171
|
-
const
|
|
172
|
-
t = { ...t, ...
|
|
294
|
+
function s(a) {
|
|
295
|
+
const c = typeof a == "function" ? a(t) : a;
|
|
296
|
+
t = { ...t, ...c }, o();
|
|
173
297
|
}
|
|
174
|
-
function
|
|
298
|
+
function o() {
|
|
175
299
|
r.forEach((a) => a(t));
|
|
176
300
|
}
|
|
177
|
-
return { subscribe: i, getState: n, setState:
|
|
301
|
+
return { subscribe: i, getState: n, setState: s };
|
|
178
302
|
}
|
|
179
|
-
function
|
|
303
|
+
function Q(e) {
|
|
180
304
|
return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
181
305
|
}
|
|
182
|
-
function
|
|
306
|
+
function Z(e) {
|
|
183
307
|
return typeof e == "string" ? e.replace(
|
|
184
308
|
/[&<>"']/g,
|
|
185
309
|
(t) => ({
|
|
@@ -191,248 +315,342 @@ function J(e) {
|
|
|
191
315
|
})[t]
|
|
192
316
|
) : e;
|
|
193
317
|
}
|
|
194
|
-
function
|
|
318
|
+
function K(e, t) {
|
|
195
319
|
return typeof t == "string" ? t.split(".").reduce((r, i) => r?.[i], e) : t;
|
|
196
320
|
}
|
|
197
|
-
function
|
|
321
|
+
function he(e, t, r) {
|
|
198
322
|
const i = String(t).split("."), n = i.pop();
|
|
199
323
|
if (!n) return;
|
|
200
|
-
const
|
|
201
|
-
|
|
324
|
+
const s = i.reduce((o, a) => (o[a] == null && (o[a] = {}), o[a]), e);
|
|
325
|
+
s[n] = r;
|
|
202
326
|
}
|
|
203
|
-
function
|
|
327
|
+
function Ge(e, t, r) {
|
|
204
328
|
if (r)
|
|
205
329
|
for (const [i, n] of Object.entries(r)) {
|
|
206
|
-
let
|
|
207
|
-
if (Array.isArray(n) ? (
|
|
208
|
-
callback:
|
|
209
|
-
options:
|
|
210
|
-
oldValue:
|
|
211
|
-
}),
|
|
330
|
+
let s, o = {};
|
|
331
|
+
if (Array.isArray(n) ? (s = n[0], o = n[1] || {}) : s = n, t.set(i, {
|
|
332
|
+
callback: s,
|
|
333
|
+
options: o,
|
|
334
|
+
oldValue: K(e, i)
|
|
335
|
+
}), o.immediate)
|
|
212
336
|
try {
|
|
213
|
-
const a =
|
|
214
|
-
|
|
337
|
+
const a = K(e, i);
|
|
338
|
+
s(a, void 0, e);
|
|
215
339
|
} catch (a) {
|
|
216
|
-
|
|
340
|
+
Y(`Error in immediate watcher for "${i}":`, a);
|
|
217
341
|
}
|
|
218
342
|
}
|
|
219
343
|
}
|
|
220
|
-
function
|
|
221
|
-
const n = (
|
|
222
|
-
if (
|
|
223
|
-
if (typeof
|
|
224
|
-
if (Array.isArray(
|
|
225
|
-
return
|
|
226
|
-
const
|
|
227
|
-
return
|
|
228
|
-
},
|
|
229
|
-
if (
|
|
344
|
+
function Ze(e, t, r, i) {
|
|
345
|
+
const n = (o, a) => {
|
|
346
|
+
if (o === a) return !0;
|
|
347
|
+
if (typeof o != typeof a || typeof o != "object" || o === null || a === null) return !1;
|
|
348
|
+
if (Array.isArray(o) && Array.isArray(a))
|
|
349
|
+
return o.length !== a.length ? !1 : o.every((m, T) => n(m, a[T]));
|
|
350
|
+
const c = Object.keys(o), u = Object.keys(a);
|
|
351
|
+
return c.length !== u.length ? !1 : c.every((m) => n(o[m], a[m]));
|
|
352
|
+
}, s = t.get(r);
|
|
353
|
+
if (s && !n(i, s.oldValue))
|
|
230
354
|
try {
|
|
231
|
-
|
|
232
|
-
} catch (
|
|
233
|
-
|
|
355
|
+
s.callback(i, s.oldValue, e), s.oldValue = i;
|
|
356
|
+
} catch (o) {
|
|
357
|
+
Y(`Error in watcher for "${r}":`, o);
|
|
234
358
|
}
|
|
235
|
-
for (const [
|
|
236
|
-
if (a.options.deep && r.startsWith(
|
|
359
|
+
for (const [o, a] of t.entries())
|
|
360
|
+
if (a.options.deep && r.startsWith(o + "."))
|
|
237
361
|
try {
|
|
238
|
-
const
|
|
239
|
-
n(
|
|
240
|
-
} catch (
|
|
241
|
-
|
|
362
|
+
const c = K(e, o);
|
|
363
|
+
n(c, a.oldValue) || (a.callback(c, a.oldValue, e), a.oldValue = c);
|
|
364
|
+
} catch (c) {
|
|
365
|
+
Y(`Error in deep watcher for "${o}":`, c);
|
|
242
366
|
}
|
|
243
367
|
}
|
|
244
|
-
function
|
|
368
|
+
function Ye(e, t, r) {
|
|
245
369
|
if (!t.props) return;
|
|
246
|
-
function i(n,
|
|
247
|
-
return
|
|
370
|
+
function i(n, s) {
|
|
371
|
+
return s === Boolean ? n === "true" : s === Number ? Number(n) : n;
|
|
248
372
|
}
|
|
249
|
-
Object.entries(t.props).forEach(([n,
|
|
250
|
-
if (
|
|
373
|
+
Object.entries(t.props).forEach(([n, s]) => {
|
|
374
|
+
if (s.type === Function && typeof e[n] == "function")
|
|
251
375
|
r[n] = e[n];
|
|
252
376
|
else {
|
|
253
|
-
const
|
|
377
|
+
const o = Q(n), a = e.getAttribute(o);
|
|
254
378
|
if (typeof e[n] < "u")
|
|
255
379
|
try {
|
|
256
|
-
|
|
380
|
+
const c = e[n];
|
|
381
|
+
s.type === Boolean && typeof c == "boolean" || s.type === Number && typeof c == "number" || s.type === Function && typeof c == "function" ? r[n] = c : r[n] = Z(i(String(c), s.type));
|
|
257
382
|
} catch {
|
|
258
383
|
r[n] = e[n];
|
|
259
384
|
}
|
|
260
|
-
else a !== null ? r[n] =
|
|
385
|
+
else a !== null ? r[n] = Z(i(a, s.type)) : "default" in s && s.default !== void 0 && (r[n] = Z(s.default));
|
|
261
386
|
}
|
|
262
387
|
});
|
|
263
388
|
}
|
|
264
|
-
function
|
|
389
|
+
function Qe(e, t, r, i) {
|
|
265
390
|
e.onConnected && !r && (e.onConnected(t), i(!0));
|
|
266
391
|
}
|
|
267
|
-
function
|
|
268
|
-
e.onDisconnected && e.onDisconnected(t), r.forEach((
|
|
392
|
+
function Xe(e, t, r, i, n, s, o, a) {
|
|
393
|
+
e.onDisconnected && e.onDisconnected(t), r.forEach((c) => c()), i(), n(), s(!1), o(null), a(!1);
|
|
269
394
|
}
|
|
270
|
-
function
|
|
395
|
+
function et(e, t, r, i, n) {
|
|
271
396
|
e.onAttributeChanged && e.onAttributeChanged(t, r, i, n);
|
|
272
397
|
}
|
|
273
|
-
function
|
|
398
|
+
function te(e, t) {
|
|
274
399
|
if (t && e instanceof HTMLElement) {
|
|
275
400
|
for (const r in t)
|
|
276
401
|
t[r] === e && delete t[r];
|
|
277
402
|
for (const r of Array.from(e.childNodes))
|
|
278
|
-
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
function
|
|
282
|
-
if (!
|
|
283
|
-
const
|
|
284
|
-
let
|
|
285
|
-
|
|
286
|
-
const w =
|
|
287
|
-
if (
|
|
288
|
-
if (Array.isArray(
|
|
289
|
-
r[d] =
|
|
403
|
+
te(r, t);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
function tt(e, t, r, i, n, s, o, a) {
|
|
407
|
+
if (!s) return;
|
|
408
|
+
const c = t.includes("lazy"), u = t.includes("trim"), m = t.includes("number"), T = () => K(s._state || s, e), p = T();
|
|
409
|
+
let l = "text";
|
|
410
|
+
o instanceof HTMLInputElement ? l = i?.type || o.type || "text" : o instanceof HTMLSelectElement ? l = "select" : o instanceof HTMLTextAreaElement && (l = "textarea");
|
|
411
|
+
const w = o instanceof HTMLInputElement || o instanceof HTMLTextAreaElement || o instanceof HTMLSelectElement, d = w ? l === "checkbox" || l === "radio" ? "checked" : "value" : a ?? "modelValue";
|
|
412
|
+
if (l === "checkbox")
|
|
413
|
+
if (Array.isArray(p))
|
|
414
|
+
r[d] = p.includes(String(o?.getAttribute("value") ?? i?.value ?? ""));
|
|
290
415
|
else {
|
|
291
|
-
const x =
|
|
292
|
-
r[d] =
|
|
293
|
-
}
|
|
294
|
-
else if (
|
|
295
|
-
r[d] =
|
|
296
|
-
else if (
|
|
297
|
-
if (
|
|
298
|
-
const x = Array.isArray(
|
|
416
|
+
const x = o?.getAttribute("true-value") ?? !0;
|
|
417
|
+
r[d] = p === x;
|
|
418
|
+
}
|
|
419
|
+
else if (l === "radio")
|
|
420
|
+
r[d] = p === (i?.value ?? "");
|
|
421
|
+
else if (l === "select")
|
|
422
|
+
if (o && o.hasAttribute("multiple") && o instanceof HTMLSelectElement) {
|
|
423
|
+
const x = Array.isArray(p) ? p.map(String) : [];
|
|
299
424
|
setTimeout(() => {
|
|
300
|
-
Array.from(
|
|
301
|
-
|
|
425
|
+
Array.from(o.options).forEach((f) => {
|
|
426
|
+
f.selected = x.includes(f.value);
|
|
302
427
|
});
|
|
303
|
-
}, 0), r[d] = Array.isArray(
|
|
428
|
+
}, 0), r[d] = Array.isArray(p) ? p : [];
|
|
304
429
|
} else
|
|
305
|
-
r[d] =
|
|
430
|
+
r[d] = p;
|
|
306
431
|
else {
|
|
307
|
-
r[d] =
|
|
432
|
+
r[d] = p;
|
|
308
433
|
try {
|
|
309
|
-
const x =
|
|
310
|
-
i && (i[x] =
|
|
434
|
+
const x = Q(d);
|
|
435
|
+
i && (i[x] = p);
|
|
311
436
|
} catch {
|
|
312
437
|
}
|
|
313
438
|
}
|
|
314
|
-
const g =
|
|
315
|
-
if (x.isComposing || n._isComposing
|
|
316
|
-
const
|
|
317
|
-
if (!
|
|
318
|
-
|
|
319
|
-
if (
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
439
|
+
const g = c || l === "checkbox" || l === "radio" || l === "select" ? "change" : "input", y = (x) => {
|
|
440
|
+
if (x.isComposing || n._isComposing) return;
|
|
441
|
+
const f = typeof globalThis.process < "u" && globalThis.process.env?.NODE_ENV === "test" || typeof window < "u" && window.__vitest__;
|
|
442
|
+
if (x.isTrusted === !1 && !f) return;
|
|
443
|
+
const b = x.target;
|
|
444
|
+
if (!b || b._modelUpdating) return;
|
|
445
|
+
let h = b.value;
|
|
446
|
+
if (l === "checkbox") {
|
|
447
|
+
const E = T();
|
|
448
|
+
if (Array.isArray(E)) {
|
|
449
|
+
const C = b.getAttribute("value") ?? "", A = Array.from(E);
|
|
450
|
+
if (b.checked)
|
|
451
|
+
A.includes(C) || A.push(C);
|
|
325
452
|
else {
|
|
326
|
-
const
|
|
327
|
-
|
|
453
|
+
const P = A.indexOf(C);
|
|
454
|
+
P > -1 && A.splice(P, 1);
|
|
328
455
|
}
|
|
329
|
-
|
|
456
|
+
h = A;
|
|
330
457
|
} else {
|
|
331
|
-
const
|
|
332
|
-
|
|
458
|
+
const C = b.getAttribute("true-value") ?? !0, A = b.getAttribute("false-value") ?? !1;
|
|
459
|
+
h = b.checked ? C : A;
|
|
333
460
|
}
|
|
334
|
-
} else if (
|
|
335
|
-
|
|
336
|
-
else if (
|
|
337
|
-
|
|
338
|
-
else if (
|
|
339
|
-
const
|
|
340
|
-
isNaN(
|
|
341
|
-
}
|
|
342
|
-
const
|
|
343
|
-
if (Array.isArray(
|
|
344
|
-
|
|
461
|
+
} else if (l === "radio")
|
|
462
|
+
h = b.getAttribute("value") ?? b.value;
|
|
463
|
+
else if (l === "select" && b.multiple)
|
|
464
|
+
h = Array.from(b.selectedOptions).map((E) => E.value);
|
|
465
|
+
else if (u && typeof h == "string" && (h = h.trim()), m) {
|
|
466
|
+
const E = Number(h);
|
|
467
|
+
isNaN(E) || (h = E);
|
|
468
|
+
}
|
|
469
|
+
const _ = s._state || s, $ = K(_, e);
|
|
470
|
+
if (Array.isArray(h) && Array.isArray($) ? JSON.stringify([...h].sort()) !== JSON.stringify([...$].sort()) : h !== $) {
|
|
471
|
+
b._modelUpdating = !0;
|
|
345
472
|
try {
|
|
346
|
-
|
|
473
|
+
if (he(_, e, h), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, h), b) {
|
|
474
|
+
const E = `update:${Q(d)}`, C = new CustomEvent(E, {
|
|
475
|
+
detail: h,
|
|
476
|
+
bubbles: !0,
|
|
477
|
+
composed: !0
|
|
478
|
+
});
|
|
479
|
+
b.dispatchEvent(C);
|
|
480
|
+
}
|
|
347
481
|
} finally {
|
|
348
|
-
setTimeout(() =>
|
|
482
|
+
setTimeout(() => b._modelUpdating = !1, 0);
|
|
349
483
|
}
|
|
350
484
|
}
|
|
351
485
|
};
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
486
|
+
if (w) {
|
|
487
|
+
if (n[g]) {
|
|
488
|
+
const x = n[g];
|
|
489
|
+
o && o.removeEventListener(g, x);
|
|
490
|
+
}
|
|
491
|
+
n[g] = y;
|
|
492
|
+
} else {
|
|
493
|
+
const x = `update:${Q(d)}`;
|
|
494
|
+
if (n[x]) {
|
|
495
|
+
const f = n[x];
|
|
496
|
+
o && o.removeEventListener(x, f);
|
|
497
|
+
}
|
|
498
|
+
n[x] = (f) => {
|
|
499
|
+
const b = s._state || s, h = f.detail !== void 0 ? f.detail : f.target?.value, _ = K(b, e);
|
|
500
|
+
if (Array.isArray(h) && Array.isArray(_) ? JSON.stringify([...h].sort()) !== JSON.stringify([..._].sort()) : h !== _) {
|
|
501
|
+
he(b, e, h), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, h);
|
|
502
|
+
const S = f.target;
|
|
503
|
+
if (S) {
|
|
504
|
+
S[d] = h;
|
|
505
|
+
try {
|
|
506
|
+
const E = Q(d);
|
|
507
|
+
typeof h == "boolean" ? h ? S.setAttribute(E, "true") : S.setAttribute(E, "false") : S.setAttribute(E, String(h));
|
|
508
|
+
} catch {
|
|
509
|
+
}
|
|
510
|
+
queueMicrotask(() => {
|
|
511
|
+
typeof S._applyProps == "function" && S._applyProps(S._cfg), typeof S._requestRender == "function" && S._requestRender();
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
(l === "text" || l === "textarea") && (n.compositionstart = (() => n._isComposing = !0), n.compositionend = (x) => {
|
|
356
518
|
n._isComposing = !1;
|
|
357
|
-
const
|
|
358
|
-
|
|
359
|
-
const b =
|
|
360
|
-
let
|
|
361
|
-
if (
|
|
362
|
-
const
|
|
363
|
-
isNaN(
|
|
519
|
+
const f = x.target;
|
|
520
|
+
f && setTimeout(() => {
|
|
521
|
+
const b = f.value, h = s._state || s, _ = K(h, e);
|
|
522
|
+
let $ = b;
|
|
523
|
+
if (u && ($ = $.trim()), m) {
|
|
524
|
+
const E = Number($);
|
|
525
|
+
isNaN(E) || ($ = E);
|
|
364
526
|
}
|
|
365
|
-
if (Array.isArray(
|
|
366
|
-
|
|
527
|
+
if (Array.isArray($) && Array.isArray(_) ? JSON.stringify([...$].sort()) !== JSON.stringify([..._].sort()) : $ !== _) {
|
|
528
|
+
f._modelUpdating = !0;
|
|
367
529
|
try {
|
|
368
|
-
|
|
530
|
+
he(h, e, $), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, $);
|
|
369
531
|
} finally {
|
|
370
|
-
setTimeout(() =>
|
|
532
|
+
setTimeout(() => f._modelUpdating = !1, 0);
|
|
371
533
|
}
|
|
372
534
|
}
|
|
373
535
|
}, 0);
|
|
374
536
|
});
|
|
375
537
|
}
|
|
376
|
-
function
|
|
538
|
+
function Ne(e) {
|
|
377
539
|
const t = e.slice(2);
|
|
378
540
|
return t ? t.charAt(0).toLowerCase() + t.slice(1) : "";
|
|
379
541
|
}
|
|
380
|
-
function
|
|
381
|
-
if (
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
} catch {
|
|
394
|
-
const n = W(i, e);
|
|
542
|
+
function rt(e, t, r, i) {
|
|
543
|
+
if (typeof e == "object" && e !== null)
|
|
544
|
+
for (const [n, s] of Object.entries(e))
|
|
545
|
+
n.startsWith("data-") || n.startsWith("aria-") || n === "class" ? r[n] = s : t[n] = s;
|
|
546
|
+
else if (typeof e == "string") {
|
|
547
|
+
if (!i) return;
|
|
548
|
+
try {
|
|
549
|
+
const n = xe(e, i);
|
|
550
|
+
if (typeof n == "object" && n !== null) {
|
|
551
|
+
for (const [s, o] of Object.entries(n))
|
|
552
|
+
s.startsWith("data-") || s.startsWith("aria-") || s === "class" ? r[s] = o : t[s] = o;
|
|
553
|
+
return;
|
|
554
|
+
} else {
|
|
395
555
|
r[e] = n;
|
|
556
|
+
return;
|
|
396
557
|
}
|
|
558
|
+
} catch {
|
|
559
|
+
const n = K(i, e);
|
|
560
|
+
r[e] = n;
|
|
561
|
+
}
|
|
397
562
|
}
|
|
398
563
|
}
|
|
399
|
-
function
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
564
|
+
function nt(e, t, r) {
|
|
565
|
+
let i;
|
|
566
|
+
if (typeof e == "string") {
|
|
567
|
+
if (!r) return;
|
|
568
|
+
i = xe(e, r);
|
|
569
|
+
} else
|
|
570
|
+
i = e;
|
|
571
|
+
const n = t.style || "";
|
|
572
|
+
let s = n;
|
|
573
|
+
if (i) {
|
|
574
|
+
if (n) {
|
|
575
|
+
const o = n.split(";").map((c) => c.trim()).filter(Boolean), a = o.findIndex(
|
|
576
|
+
(c) => c.startsWith("display:")
|
|
577
|
+
);
|
|
578
|
+
a >= 0 && o[a] === "display: none" && (o.splice(a, 1), s = o.length > 0 ? o.join("; ") + ";" : "");
|
|
579
|
+
}
|
|
580
|
+
} else if (n) {
|
|
581
|
+
const o = n.split(";").filter(Boolean), a = o.findIndex(
|
|
582
|
+
(c) => c.trim().startsWith("display:")
|
|
405
583
|
);
|
|
406
|
-
a >= 0 ?
|
|
584
|
+
a >= 0 ? o[a] = "display: none" : o.push("display: none"), s = o.join("; ");
|
|
407
585
|
} else
|
|
408
|
-
|
|
586
|
+
s = "display: none";
|
|
587
|
+
s !== n && (s ? t.style = s : delete t.style);
|
|
588
|
+
}
|
|
589
|
+
function xe(e, t) {
|
|
590
|
+
if ([
|
|
591
|
+
/constructor/i,
|
|
592
|
+
/prototype/i,
|
|
593
|
+
/__proto__/i,
|
|
594
|
+
/function/i,
|
|
595
|
+
/eval/i,
|
|
596
|
+
/import/i,
|
|
597
|
+
/require/i,
|
|
598
|
+
/window/i,
|
|
599
|
+
/document/i,
|
|
600
|
+
/global/i,
|
|
601
|
+
/process/i
|
|
602
|
+
].some((i) => i.test(e))) {
|
|
603
|
+
pe("Potentially dangerous expression blocked:", e);
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
if (e.trim().startsWith("{") && e.trim().endsWith("}"))
|
|
607
|
+
try {
|
|
608
|
+
const i = Object.keys(t), n = i.map((a) => t[a]), s = e.replace(/ctx\./g, "");
|
|
609
|
+
if (s.length > 1e3) {
|
|
610
|
+
pe("Expression too long, blocked for security:", e);
|
|
611
|
+
return;
|
|
612
|
+
}
|
|
613
|
+
return new Function(...i, `return ${s}`)(...n);
|
|
614
|
+
} catch (i) {
|
|
615
|
+
pe("Failed to evaluate expression:", e, i);
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
618
|
+
if (e.startsWith("ctx.")) {
|
|
619
|
+
const i = e.slice(4);
|
|
620
|
+
return K(t, i);
|
|
621
|
+
}
|
|
622
|
+
return K(t, e);
|
|
409
623
|
}
|
|
410
|
-
function
|
|
411
|
-
|
|
412
|
-
|
|
624
|
+
function it(e, t, r) {
|
|
625
|
+
let i;
|
|
626
|
+
if (typeof e == "string") {
|
|
627
|
+
if (!r) return;
|
|
628
|
+
i = xe(e, r);
|
|
629
|
+
} else
|
|
630
|
+
i = e;
|
|
413
631
|
let n = [];
|
|
414
|
-
typeof i == "string" ? n = [i] : Array.isArray(i) ? n = i.filter(Boolean) : typeof i == "object" && (n = Object.entries(i).filter(([, a]) => !!a).flatMap(([a]) => a.split(/\s+/).filter(Boolean)));
|
|
415
|
-
const
|
|
416
|
-
|
|
632
|
+
typeof i == "string" ? n = [i] : Array.isArray(i) ? n = i.filter(Boolean) : typeof i == "object" && i !== null && (n = Object.entries(i).filter(([, a]) => !!a).flatMap(([a]) => a.split(/\s+/).filter(Boolean)));
|
|
633
|
+
const s = t.class || "", o = s ? `${s} ${n.join(" ")}`.trim() : n.join(" ");
|
|
634
|
+
o && (t.class = o);
|
|
417
635
|
}
|
|
418
|
-
function
|
|
636
|
+
function st(e, t, r) {
|
|
419
637
|
let i;
|
|
420
638
|
if (typeof e == "string") {
|
|
421
639
|
if (!r) return;
|
|
422
|
-
i =
|
|
640
|
+
i = xe(e, r);
|
|
423
641
|
} else
|
|
424
642
|
i = e;
|
|
425
643
|
let n = "";
|
|
426
644
|
if (typeof i == "string")
|
|
427
645
|
n = i;
|
|
428
646
|
else if (i && typeof i == "object") {
|
|
429
|
-
const
|
|
430
|
-
for (const [a,
|
|
431
|
-
if (
|
|
432
|
-
const
|
|
647
|
+
const o = [];
|
|
648
|
+
for (const [a, c] of Object.entries(i))
|
|
649
|
+
if (c != null && c !== "") {
|
|
650
|
+
const u = a.replace(
|
|
433
651
|
/[A-Z]/g,
|
|
434
|
-
(
|
|
435
|
-
),
|
|
652
|
+
(p) => `-${p.toLowerCase()}`
|
|
653
|
+
), m = [
|
|
436
654
|
"width",
|
|
437
655
|
"height",
|
|
438
656
|
"top",
|
|
@@ -458,125 +676,126 @@ function Ze(e, t, r) {
|
|
|
458
676
|
"min-height",
|
|
459
677
|
"max-height"
|
|
460
678
|
];
|
|
461
|
-
let
|
|
462
|
-
typeof
|
|
679
|
+
let T = String(c);
|
|
680
|
+
typeof c == "number" && m.includes(u) && (T = `${c}px`), o.push(`${u}: ${T}`);
|
|
463
681
|
}
|
|
464
|
-
n =
|
|
682
|
+
n = o.join("; ") + (o.length > 0 ? ";" : "");
|
|
465
683
|
}
|
|
466
|
-
const
|
|
467
|
-
t.style =
|
|
684
|
+
const s = t.style || "";
|
|
685
|
+
t.style = s + (s && !s.endsWith(";") ? "; " : "") + n;
|
|
468
686
|
}
|
|
469
|
-
function
|
|
470
|
-
const n = {},
|
|
471
|
-
for (const [a,
|
|
472
|
-
const { value:
|
|
687
|
+
function De(e, t, r, i) {
|
|
688
|
+
const n = {}, s = { ...i || {} }, o = {};
|
|
689
|
+
for (const [a, c] of Object.entries(e)) {
|
|
690
|
+
const { value: u, modifiers: m, arg: T } = c;
|
|
473
691
|
if (a === "model" || a.startsWith("model:")) {
|
|
474
|
-
const
|
|
475
|
-
|
|
476
|
-
typeof
|
|
477
|
-
|
|
692
|
+
const p = a.split(":"), l = p.length > 1 ? p[1] : T;
|
|
693
|
+
tt(
|
|
694
|
+
typeof u == "string" ? u : String(u),
|
|
695
|
+
m,
|
|
478
696
|
n,
|
|
479
|
-
o,
|
|
480
697
|
s,
|
|
698
|
+
o,
|
|
481
699
|
t,
|
|
482
700
|
r,
|
|
483
|
-
|
|
701
|
+
l
|
|
484
702
|
);
|
|
485
703
|
continue;
|
|
486
704
|
}
|
|
487
705
|
switch (a) {
|
|
488
706
|
case "bind":
|
|
489
|
-
|
|
707
|
+
rt(u, n, s, t);
|
|
490
708
|
break;
|
|
491
709
|
case "show":
|
|
492
|
-
|
|
710
|
+
nt(u, s, t);
|
|
493
711
|
break;
|
|
494
712
|
case "class":
|
|
495
|
-
|
|
713
|
+
it(u, s, t);
|
|
496
714
|
break;
|
|
497
715
|
case "style":
|
|
498
|
-
|
|
716
|
+
st(u, s, t);
|
|
499
717
|
break;
|
|
500
718
|
}
|
|
501
719
|
}
|
|
502
|
-
return { props: n, attrs:
|
|
720
|
+
return { props: n, attrs: s, listeners: o };
|
|
503
721
|
}
|
|
504
|
-
function
|
|
722
|
+
function je(e, t) {
|
|
505
723
|
if (Array.isArray(e)) {
|
|
506
|
-
const
|
|
507
|
-
return e.map((
|
|
508
|
-
if (!
|
|
509
|
-
let a =
|
|
724
|
+
const s = /* @__PURE__ */ new Set();
|
|
725
|
+
return e.map((o) => {
|
|
726
|
+
if (!o || typeof o != "object") return o;
|
|
727
|
+
let a = o.props?.key ?? o.key;
|
|
510
728
|
if (!a) {
|
|
511
|
-
const
|
|
729
|
+
const T = o.tag || "node", l = [
|
|
512
730
|
// attrs (kebab-case)
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
731
|
+
o.props?.attrs?.id,
|
|
732
|
+
o.props?.attrs?.name,
|
|
733
|
+
o.props?.attrs?.["data-key"],
|
|
516
734
|
// promoted JS props (camelCase or original)
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
735
|
+
o.props?.props?.id,
|
|
736
|
+
o.props?.props?.name,
|
|
737
|
+
o.props?.props?.dataKey,
|
|
738
|
+
o.props?.props?.["data-key"]
|
|
521
739
|
].find((w) => w != null) ?? "";
|
|
522
|
-
a =
|
|
740
|
+
a = l ? `${t}:${T}:${l}` : `${t}:${T}`;
|
|
523
741
|
}
|
|
524
|
-
let
|
|
525
|
-
for (;
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
let
|
|
529
|
-
return Array.isArray(
|
|
742
|
+
let c = a, u = 1;
|
|
743
|
+
for (; s.has(c); )
|
|
744
|
+
c = `${a}#${u++}`;
|
|
745
|
+
s.add(c);
|
|
746
|
+
let m = o.children;
|
|
747
|
+
return Array.isArray(m) && (m = je(m, c)), { ...o, key: c, children: m };
|
|
530
748
|
});
|
|
531
749
|
}
|
|
532
750
|
const r = e;
|
|
533
751
|
let i = r.props?.key ?? r.key ?? t, n = r.children;
|
|
534
|
-
return Array.isArray(n) && (n =
|
|
752
|
+
return Array.isArray(n) && (n = je(n, i)), { ...r, key: i, children: n };
|
|
535
753
|
}
|
|
536
|
-
function
|
|
537
|
-
const n = r.directives ?? {},
|
|
754
|
+
function Re(e, t, r, i) {
|
|
755
|
+
const n = r.directives ?? {}, s = De(
|
|
538
756
|
n,
|
|
539
757
|
i,
|
|
540
758
|
e,
|
|
541
759
|
r.attrs
|
|
542
|
-
),
|
|
760
|
+
), o = {
|
|
543
761
|
...t.props,
|
|
544
762
|
...r.props,
|
|
545
|
-
...
|
|
763
|
+
...s.props
|
|
546
764
|
}, a = {
|
|
547
765
|
...t.attrs,
|
|
548
766
|
...r.attrs,
|
|
549
|
-
...
|
|
550
|
-
},
|
|
551
|
-
let
|
|
552
|
-
for (const w in { ...
|
|
553
|
-
const v =
|
|
554
|
-
if (v !== d)
|
|
555
|
-
if (
|
|
767
|
+
...s.attrs
|
|
768
|
+
}, c = t.props ?? {}, u = o, m = r?.isCustomElement ?? t?.isCustomElement ?? !1;
|
|
769
|
+
let T = !1;
|
|
770
|
+
for (const w in { ...c, ...u }) {
|
|
771
|
+
const v = c[w], d = u[w];
|
|
772
|
+
if (v !== d)
|
|
773
|
+
if (T = !0, w === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement))
|
|
556
774
|
e.value !== d && (e.value = d ?? "");
|
|
557
775
|
else if (w === "checked" && e instanceof HTMLInputElement)
|
|
558
776
|
e.checked = !!d;
|
|
559
777
|
else if (w.startsWith("on") && typeof d == "function") {
|
|
560
|
-
const g =
|
|
778
|
+
const g = Ne(w);
|
|
561
779
|
typeof v == "function" && e.removeEventListener(g, v), e.addEventListener(g, d);
|
|
562
|
-
} else if (d == null
|
|
780
|
+
} else if (d == null)
|
|
563
781
|
e.removeAttribute(w);
|
|
564
782
|
else if ((r?.isCustomElement ?? t?.isCustomElement ?? !1) || w in e)
|
|
565
783
|
try {
|
|
566
784
|
e[w] = d;
|
|
567
785
|
} catch {
|
|
568
786
|
}
|
|
569
|
-
|
|
787
|
+
else
|
|
788
|
+
d === !1 && e.removeAttribute(w);
|
|
570
789
|
}
|
|
571
790
|
for (const [w, v] of Object.entries(
|
|
572
|
-
|
|
791
|
+
s.listeners || {}
|
|
573
792
|
))
|
|
574
793
|
e.addEventListener(w, v);
|
|
575
|
-
const
|
|
576
|
-
for (const w in { ...
|
|
577
|
-
const v =
|
|
794
|
+
const p = t.attrs ?? {}, l = a;
|
|
795
|
+
for (const w in { ...p, ...l }) {
|
|
796
|
+
const v = p[w], d = l[w];
|
|
578
797
|
if (v !== d)
|
|
579
|
-
if (
|
|
798
|
+
if (T = !0, d == null || d === !1) {
|
|
580
799
|
if (e.removeAttribute(w), w === "value") {
|
|
581
800
|
if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement)
|
|
582
801
|
try {
|
|
@@ -634,6 +853,10 @@ function Se(e, t, r, i) {
|
|
|
634
853
|
}
|
|
635
854
|
continue;
|
|
636
855
|
}
|
|
856
|
+
if (w === "style") {
|
|
857
|
+
e.setAttribute(w, String(d));
|
|
858
|
+
continue;
|
|
859
|
+
}
|
|
637
860
|
if (!(e.namespaceURI === "http://www.w3.org/2000/svg") && w in e)
|
|
638
861
|
try {
|
|
639
862
|
e[w] = d;
|
|
@@ -644,7 +867,7 @@ function Se(e, t, r, i) {
|
|
|
644
867
|
e.setAttribute(w, String(d));
|
|
645
868
|
}
|
|
646
869
|
}
|
|
647
|
-
if (
|
|
870
|
+
if (m && T)
|
|
648
871
|
try {
|
|
649
872
|
if (typeof e._applyProps == "function")
|
|
650
873
|
try {
|
|
@@ -655,90 +878,90 @@ function Se(e, t, r, i) {
|
|
|
655
878
|
} catch {
|
|
656
879
|
}
|
|
657
880
|
}
|
|
658
|
-
function
|
|
881
|
+
function U(e, t, r) {
|
|
659
882
|
if (typeof e == "string")
|
|
660
883
|
return document.createTextNode(e);
|
|
661
884
|
if (e.tag === "#text") {
|
|
662
|
-
const
|
|
885
|
+
const p = document.createTextNode(
|
|
663
886
|
typeof e.children == "string" ? e.children : ""
|
|
664
887
|
);
|
|
665
|
-
return e.key != null && (
|
|
888
|
+
return e.key != null && (p.key = e.key), p;
|
|
666
889
|
}
|
|
667
890
|
if (e.tag === "#anchor") {
|
|
668
|
-
const
|
|
669
|
-
|
|
891
|
+
const p = e, l = Array.isArray(p.children) ? p.children : [], w = document.createTextNode(""), v = document.createTextNode("");
|
|
892
|
+
p.key != null && (w.key = `${p.key}:start`, v.key = `${p.key}:end`), p._startNode = w, p._endNode = v;
|
|
670
893
|
const d = document.createDocumentFragment();
|
|
671
894
|
d.appendChild(w);
|
|
672
|
-
for (const g of
|
|
673
|
-
const
|
|
674
|
-
d.appendChild(
|
|
895
|
+
for (const g of l) {
|
|
896
|
+
const y = U(g, t);
|
|
897
|
+
d.appendChild(y);
|
|
675
898
|
}
|
|
676
899
|
return d.appendChild(v), d;
|
|
677
900
|
}
|
|
678
901
|
const i = document.createElement(e.tag);
|
|
679
902
|
e.key != null && (i.key = e.key);
|
|
680
|
-
const { props: n = {}, attrs:
|
|
903
|
+
const { props: n = {}, attrs: s = {}, directives: o = {} } = e.props ?? {}, a = De(o, t, i, s), c = {
|
|
681
904
|
...n,
|
|
682
905
|
...a.props
|
|
683
|
-
},
|
|
684
|
-
...
|
|
906
|
+
}, u = {
|
|
907
|
+
...s,
|
|
685
908
|
...a.attrs
|
|
686
|
-
},
|
|
687
|
-
for (const
|
|
688
|
-
const
|
|
689
|
-
if (!(typeof
|
|
690
|
-
if (typeof
|
|
691
|
-
|
|
692
|
-
else if (
|
|
693
|
-
if (!
|
|
909
|
+
}, m = i.namespaceURI === "http://www.w3.org/2000/svg";
|
|
910
|
+
for (const p in u) {
|
|
911
|
+
const l = u[p];
|
|
912
|
+
if (!(typeof p != "string" || /\[object Object\]/.test(p))) {
|
|
913
|
+
if (typeof l == "boolean")
|
|
914
|
+
l && i.setAttribute(p, "");
|
|
915
|
+
else if (l != null)
|
|
916
|
+
if (!m && p === "value" && (i instanceof HTMLInputElement || i instanceof HTMLTextAreaElement || i instanceof HTMLSelectElement || i instanceof HTMLProgressElement))
|
|
694
917
|
try {
|
|
695
|
-
i instanceof HTMLProgressElement ? i.value = Number(
|
|
918
|
+
i instanceof HTMLProgressElement ? i.value = Number(l) : i.value = l ?? "";
|
|
696
919
|
} catch {
|
|
697
|
-
i.setAttribute(
|
|
920
|
+
i.setAttribute(p, String(l));
|
|
698
921
|
}
|
|
699
|
-
else if (!
|
|
922
|
+
else if (!m && p === "checked" && i instanceof HTMLInputElement)
|
|
700
923
|
try {
|
|
701
|
-
i.checked = !!
|
|
924
|
+
i.checked = !!l;
|
|
702
925
|
} catch {
|
|
703
|
-
i.setAttribute(
|
|
926
|
+
i.setAttribute(p, String(l));
|
|
704
927
|
}
|
|
705
|
-
else if (!
|
|
928
|
+
else if (!m && p in i)
|
|
706
929
|
try {
|
|
707
|
-
i[
|
|
930
|
+
i[p] = l;
|
|
708
931
|
} catch {
|
|
709
|
-
i.setAttribute(
|
|
932
|
+
i.setAttribute(p, String(l));
|
|
710
933
|
}
|
|
711
934
|
else
|
|
712
|
-
i.setAttribute(
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
for (const
|
|
716
|
-
const
|
|
717
|
-
if (!(typeof
|
|
718
|
-
if (
|
|
719
|
-
i.value =
|
|
720
|
-
else if (
|
|
721
|
-
i.checked = !!
|
|
722
|
-
else if (
|
|
723
|
-
i.addEventListener(
|
|
935
|
+
i.setAttribute(p, String(l));
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
for (const p in c) {
|
|
939
|
+
const l = c[p];
|
|
940
|
+
if (!(typeof p != "string" || /\[object Object\]/.test(p)))
|
|
941
|
+
if (p === "value" && (i instanceof HTMLInputElement || i instanceof HTMLTextAreaElement || i instanceof HTMLSelectElement))
|
|
942
|
+
i.value = l ?? "";
|
|
943
|
+
else if (p === "checked" && i instanceof HTMLInputElement)
|
|
944
|
+
i.checked = !!l;
|
|
945
|
+
else if (p.startsWith("on") && typeof l == "function")
|
|
946
|
+
i.addEventListener(Ne(p), l);
|
|
724
947
|
else {
|
|
725
|
-
if (
|
|
948
|
+
if (p.startsWith("on") && l === void 0)
|
|
726
949
|
continue;
|
|
727
|
-
if (
|
|
728
|
-
i.removeAttribute(
|
|
729
|
-
else if ((e.props?.isCustomElement ?? !1) ||
|
|
950
|
+
if (l == null || l === !1)
|
|
951
|
+
i.removeAttribute(p);
|
|
952
|
+
else if ((e.props?.isCustomElement ?? !1) || p in i)
|
|
730
953
|
try {
|
|
731
|
-
i[
|
|
954
|
+
i[p] = l;
|
|
732
955
|
} catch {
|
|
733
956
|
}
|
|
734
957
|
}
|
|
735
958
|
}
|
|
736
|
-
for (const [
|
|
959
|
+
for (const [p, l] of Object.entries(
|
|
737
960
|
a.listeners || {}
|
|
738
961
|
))
|
|
739
|
-
i.addEventListener(
|
|
740
|
-
const
|
|
741
|
-
typeof e != "string" &&
|
|
962
|
+
i.addEventListener(p, l);
|
|
963
|
+
const T = e.props?.ref ?? (e.props?.props && e.props.props.ref);
|
|
964
|
+
typeof e != "string" && T && r && (r[T] = i);
|
|
742
965
|
try {
|
|
743
966
|
if (typeof i._applyProps == "function")
|
|
744
967
|
try {
|
|
@@ -749,69 +972,69 @@ function D(e, t, r) {
|
|
|
749
972
|
} catch {
|
|
750
973
|
}
|
|
751
974
|
if (Array.isArray(e.children))
|
|
752
|
-
for (const
|
|
753
|
-
i.appendChild(
|
|
975
|
+
for (const p of e.children)
|
|
976
|
+
i.appendChild(U(p, t, r));
|
|
754
977
|
else typeof e.children == "string" && (i.textContent = e.children);
|
|
755
978
|
try {
|
|
756
|
-
if (i instanceof HTMLSelectElement &&
|
|
979
|
+
if (i instanceof HTMLSelectElement && u && u.hasOwnProperty("value"))
|
|
757
980
|
try {
|
|
758
|
-
i.value =
|
|
981
|
+
i.value = u.value ?? "";
|
|
759
982
|
} catch {
|
|
760
983
|
}
|
|
761
984
|
} catch {
|
|
762
985
|
}
|
|
763
986
|
return i;
|
|
764
987
|
}
|
|
765
|
-
function
|
|
988
|
+
function ot(e, t, r, i, n) {
|
|
766
989
|
if (typeof r == "string") {
|
|
767
990
|
e.textContent !== r && (e.textContent = r);
|
|
768
991
|
return;
|
|
769
992
|
}
|
|
770
993
|
if (!Array.isArray(r)) return;
|
|
771
|
-
const
|
|
772
|
-
for (const
|
|
773
|
-
|
|
774
|
-
const
|
|
775
|
-
for (const
|
|
776
|
-
const w =
|
|
777
|
-
w != null &&
|
|
778
|
-
}
|
|
779
|
-
const
|
|
780
|
-
let
|
|
781
|
-
function
|
|
782
|
-
let v =
|
|
783
|
-
for (; v && (
|
|
994
|
+
const s = Array.from(e.childNodes), o = Array.isArray(t) ? t : [], a = /* @__PURE__ */ new Map();
|
|
995
|
+
for (const l of o)
|
|
996
|
+
l && l.key != null && a.set(l.key, l);
|
|
997
|
+
const c = /* @__PURE__ */ new Map();
|
|
998
|
+
for (const l of s) {
|
|
999
|
+
const w = l.key;
|
|
1000
|
+
w != null && c.set(w, l);
|
|
1001
|
+
}
|
|
1002
|
+
const u = /* @__PURE__ */ new Set();
|
|
1003
|
+
let m = e.firstChild;
|
|
1004
|
+
function T(l, w) {
|
|
1005
|
+
let v = l;
|
|
1006
|
+
for (; v && (u.add(v), v !== w); )
|
|
784
1007
|
v = v.nextSibling;
|
|
785
1008
|
}
|
|
786
|
-
function
|
|
1009
|
+
function p(l, w, v, d) {
|
|
787
1010
|
const g = [];
|
|
788
|
-
let
|
|
789
|
-
for (;
|
|
790
|
-
g.push(
|
|
1011
|
+
let y = l.nextSibling;
|
|
1012
|
+
for (; y && y !== w; )
|
|
1013
|
+
g.push(y), y = y.nextSibling;
|
|
791
1014
|
const x = Array.isArray(v) ? v : [];
|
|
792
1015
|
if (d.some((b) => b && b.key != null) || x.some((b) => b && b.key != null)) {
|
|
793
|
-
const b = /* @__PURE__ */ new Map(),
|
|
1016
|
+
const b = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map();
|
|
794
1017
|
for (const S of x)
|
|
795
1018
|
S && S.key != null && b.set(S.key, S);
|
|
796
1019
|
for (const S of g) {
|
|
797
|
-
const
|
|
798
|
-
|
|
1020
|
+
const E = S.key;
|
|
1021
|
+
E != null && h.set(E, S);
|
|
799
1022
|
}
|
|
800
1023
|
const _ = /* @__PURE__ */ new Set();
|
|
801
|
-
let
|
|
1024
|
+
let $ = l.nextSibling;
|
|
802
1025
|
for (const S of d) {
|
|
803
|
-
let
|
|
804
|
-
if (S.key != null &&
|
|
805
|
-
const
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
1026
|
+
let E;
|
|
1027
|
+
if (S.key != null && h.has(S.key)) {
|
|
1028
|
+
const C = b.get(S.key);
|
|
1029
|
+
E = ge(
|
|
1030
|
+
h.get(S.key),
|
|
1031
|
+
C,
|
|
809
1032
|
S,
|
|
810
1033
|
i
|
|
811
|
-
), _.add(
|
|
1034
|
+
), _.add(E), E !== $ && e.contains(E) && e.insertBefore(E, $);
|
|
812
1035
|
} else
|
|
813
|
-
|
|
814
|
-
|
|
1036
|
+
E = U(S, i), e.insertBefore(E, $), _.add(E);
|
|
1037
|
+
$ = E.nextSibling;
|
|
815
1038
|
}
|
|
816
1039
|
for (const S of g)
|
|
817
1040
|
!_.has(S) && e.contains(S) && e.removeChild(S);
|
|
@@ -820,155 +1043,155 @@ function Ve(e, t, r, i, n) {
|
|
|
820
1043
|
x.length,
|
|
821
1044
|
d.length
|
|
822
1045
|
);
|
|
823
|
-
for (let
|
|
824
|
-
const _ = x[
|
|
825
|
-
S !== g[
|
|
1046
|
+
for (let h = 0; h < b; h++) {
|
|
1047
|
+
const _ = x[h], $ = d[h], S = ge(g[h], _, $, i);
|
|
1048
|
+
S !== g[h] && (e.insertBefore(S, g[h]), e.removeChild(g[h]));
|
|
826
1049
|
}
|
|
827
|
-
for (let
|
|
828
|
-
e.insertBefore(
|
|
829
|
-
for (let
|
|
830
|
-
e.removeChild(g[
|
|
1050
|
+
for (let h = b; h < d.length; h++)
|
|
1051
|
+
e.insertBefore(U(d[h], i), w);
|
|
1052
|
+
for (let h = b; h < g.length; h++)
|
|
1053
|
+
e.removeChild(g[h]);
|
|
831
1054
|
}
|
|
832
1055
|
}
|
|
833
|
-
for (const
|
|
1056
|
+
for (const l of r) {
|
|
834
1057
|
let w;
|
|
835
|
-
if (
|
|
836
|
-
const v =
|
|
837
|
-
let
|
|
838
|
-
const
|
|
839
|
-
if (
|
|
840
|
-
e.insertBefore(
|
|
841
|
-
for (const b of
|
|
842
|
-
e.insertBefore(
|
|
843
|
-
e.insertBefore(x,
|
|
1058
|
+
if (l.tag === "#anchor") {
|
|
1059
|
+
const v = l.key, d = `${v}:start`, g = `${v}:end`;
|
|
1060
|
+
let y = c.get(d), x = c.get(g);
|
|
1061
|
+
const f = Array.isArray(l.children) ? l.children : [];
|
|
1062
|
+
if (y || (y = document.createTextNode(""), y.key = d), x || (x = document.createTextNode(""), x.key = g), l._startNode = y, l._endNode = x, !e.contains(y) || !e.contains(x)) {
|
|
1063
|
+
e.insertBefore(y, m);
|
|
1064
|
+
for (const b of f)
|
|
1065
|
+
e.insertBefore(U(b, i), m);
|
|
1066
|
+
e.insertBefore(x, m);
|
|
844
1067
|
} else
|
|
845
|
-
|
|
846
|
-
|
|
1068
|
+
p(
|
|
1069
|
+
y,
|
|
847
1070
|
x,
|
|
848
1071
|
a.get(v)?.children,
|
|
849
|
-
|
|
1072
|
+
f
|
|
850
1073
|
);
|
|
851
|
-
|
|
1074
|
+
T(y, x), m = x.nextSibling;
|
|
852
1075
|
continue;
|
|
853
1076
|
}
|
|
854
|
-
if (
|
|
855
|
-
const v = a.get(
|
|
856
|
-
w =
|
|
857
|
-
|
|
1077
|
+
if (l.key != null && c.has(l.key)) {
|
|
1078
|
+
const v = a.get(l.key);
|
|
1079
|
+
w = ge(
|
|
1080
|
+
c.get(l.key),
|
|
858
1081
|
v,
|
|
859
|
-
|
|
1082
|
+
l,
|
|
860
1083
|
i,
|
|
861
1084
|
n
|
|
862
|
-
),
|
|
1085
|
+
), u.add(w), w !== m && e.contains(w) && (m && !e.contains(m) && (m = null), e.insertBefore(w, m));
|
|
863
1086
|
} else
|
|
864
|
-
w =
|
|
865
|
-
|
|
1087
|
+
w = U(l, i, n), m && !e.contains(m) && (m = null), e.insertBefore(w, m), u.add(w);
|
|
1088
|
+
m = w.nextSibling;
|
|
866
1089
|
}
|
|
867
|
-
for (const
|
|
868
|
-
!
|
|
1090
|
+
for (const l of s)
|
|
1091
|
+
!u.has(l) && e.contains(l) && (te(l, n), e.removeChild(l));
|
|
869
1092
|
}
|
|
870
|
-
function
|
|
871
|
-
if (t && typeof t != "string" && t.props?.ref && n &&
|
|
1093
|
+
function ge(e, t, r, i, n) {
|
|
1094
|
+
if (t && typeof t != "string" && t.props?.ref && n && te(e, n), t === r) return e;
|
|
872
1095
|
if (typeof r == "string") {
|
|
873
1096
|
if (e.nodeType === Node.TEXT_NODE)
|
|
874
1097
|
return e.textContent !== r && (e.textContent = r), e;
|
|
875
1098
|
{
|
|
876
|
-
const
|
|
877
|
-
return e.parentNode?.replaceChild(
|
|
1099
|
+
const o = document.createTextNode(r);
|
|
1100
|
+
return e.parentNode?.replaceChild(o, e), o;
|
|
878
1101
|
}
|
|
879
1102
|
}
|
|
880
1103
|
if (r && typeof r != "string" && r.tag === "#anchor") {
|
|
881
|
-
const
|
|
882
|
-
|
|
883
|
-
const
|
|
884
|
-
|
|
885
|
-
for (const
|
|
886
|
-
const
|
|
887
|
-
|
|
1104
|
+
const o = r, a = Array.isArray(o.children) ? o.children : [], c = o._startNode ?? document.createTextNode(""), u = o._endNode ?? document.createTextNode("");
|
|
1105
|
+
o.key != null && (c.key = `${o.key}:start`, u.key = `${o.key}:end`), o._startNode = c, o._endNode = u;
|
|
1106
|
+
const m = document.createDocumentFragment();
|
|
1107
|
+
m.appendChild(c);
|
|
1108
|
+
for (const T of a) {
|
|
1109
|
+
const p = U(T, i);
|
|
1110
|
+
m.appendChild(p);
|
|
888
1111
|
}
|
|
889
|
-
return
|
|
1112
|
+
return m.appendChild(u), e.parentNode?.replaceChild(m, e), c;
|
|
890
1113
|
}
|
|
891
1114
|
if (!r) {
|
|
892
|
-
|
|
893
|
-
const
|
|
894
|
-
return e.parentNode?.replaceChild(
|
|
1115
|
+
te(e, n);
|
|
1116
|
+
const o = document.createComment("removed");
|
|
1117
|
+
return e.parentNode?.replaceChild(o, e), o;
|
|
895
1118
|
}
|
|
896
1119
|
if (!t || typeof t == "string") {
|
|
897
|
-
|
|
898
|
-
const
|
|
899
|
-
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] =
|
|
1120
|
+
te(e, n);
|
|
1121
|
+
const o = U(r, i, n);
|
|
1122
|
+
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = o), e.parentNode?.replaceChild(o, e), o;
|
|
900
1123
|
}
|
|
901
1124
|
if (r.tag === "#anchor") {
|
|
902
|
-
const
|
|
903
|
-
r.key != null && (a.key = `${r.key}:start`,
|
|
904
|
-
const
|
|
905
|
-
|
|
906
|
-
for (const
|
|
907
|
-
|
|
908
|
-
return
|
|
1125
|
+
const o = Array.isArray(r.children) ? r.children : [], a = r._startNode ?? document.createTextNode(""), c = r._endNode ?? document.createTextNode("");
|
|
1126
|
+
r.key != null && (a.key = `${r.key}:start`, c.key = `${r.key}:end`), r._startNode = a, r._endNode = c;
|
|
1127
|
+
const u = document.createDocumentFragment();
|
|
1128
|
+
u.appendChild(a);
|
|
1129
|
+
for (const m of o)
|
|
1130
|
+
u.appendChild(U(m, i));
|
|
1131
|
+
return u.appendChild(c), e.parentNode?.replaceChild(u, e), a;
|
|
909
1132
|
}
|
|
910
1133
|
if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && t.key === r.key) {
|
|
911
|
-
const
|
|
912
|
-
return
|
|
1134
|
+
const o = e;
|
|
1135
|
+
return Re(o, t.props || {}, r.props || {}, i), ot(o, t.children, r.children, i, n), typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = o), o;
|
|
913
1136
|
}
|
|
914
1137
|
if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && (t.tag && String(t.tag).includes("-") || r.props && r.props.isCustomElement || t.props && t.props.isCustomElement))
|
|
915
1138
|
try {
|
|
916
1139
|
const a = e;
|
|
917
|
-
return
|
|
1140
|
+
return Re(a, t.props || {}, r.props || {}, i), typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = a), a;
|
|
918
1141
|
} catch {
|
|
919
1142
|
}
|
|
920
|
-
|
|
921
|
-
const
|
|
922
|
-
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] =
|
|
1143
|
+
te(e, n);
|
|
1144
|
+
const s = U(r, i, n);
|
|
1145
|
+
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = s), e.parentNode?.replaceChild(s, e), s;
|
|
923
1146
|
}
|
|
924
|
-
function
|
|
1147
|
+
function at(e, t, r, i) {
|
|
925
1148
|
let n;
|
|
926
1149
|
Array.isArray(t) ? t.length === 1 ? (n = t[0], n && typeof n == "object" && n.key == null && (n = { ...n, key: "__root__" })) : n = { tag: "div", key: "__root__", children: t } : (n = t, n && typeof n == "object" && n.key == null && (n = { ...n, key: "__root__" })), n && typeof n == "object" && n.tag === "#anchor" && (n = {
|
|
927
1150
|
tag: "div",
|
|
928
1151
|
key: "__anchor_root__",
|
|
929
1152
|
props: { attrs: { "data-anchor-block-root": "", key: "__anchor_root__" } },
|
|
930
1153
|
children: [n]
|
|
931
|
-
}), n =
|
|
932
|
-
const
|
|
1154
|
+
}), n = je(n, String(n.key ?? "root"));
|
|
1155
|
+
const s = e._prevVNode ?? null, o = e._prevDom ?? e.firstChild ?? null;
|
|
933
1156
|
let a;
|
|
934
|
-
|
|
935
|
-
const
|
|
936
|
-
for (let
|
|
937
|
-
const
|
|
938
|
-
|
|
1157
|
+
s && o ? typeof s != "string" && typeof n != "string" && s.tag === n.tag && s.key === n.key ? a = ge(o, s, n, r, i) : (a = U(n, r, i), e.replaceChild(a, o)) : (a = U(n, r, i), e.firstChild ? e.replaceChild(a, e.firstChild) : e.appendChild(a));
|
|
1158
|
+
const c = [];
|
|
1159
|
+
for (let u = 0; u < e.childNodes.length; u++) {
|
|
1160
|
+
const m = e.childNodes[u];
|
|
1161
|
+
m !== a && m.nodeName !== "STYLE" && (te(m, i), c.push(m));
|
|
939
1162
|
}
|
|
940
|
-
|
|
1163
|
+
c.forEach((u) => e.removeChild(u)), e._prevVNode = n, e._prevDom = a;
|
|
941
1164
|
}
|
|
942
|
-
function
|
|
943
|
-
if (typeof e == "string") return
|
|
1165
|
+
function ke(e) {
|
|
1166
|
+
if (typeof e == "string") return Z(e);
|
|
944
1167
|
if (e.tag === "#text")
|
|
945
|
-
return typeof e.children == "string" ?
|
|
1168
|
+
return typeof e.children == "string" ? Z(e.children) : "";
|
|
946
1169
|
if (e.tag === "#anchor")
|
|
947
|
-
return (Array.isArray(e.children) ? e.children.filter(Boolean) : []).map(
|
|
1170
|
+
return (Array.isArray(e.children) ? e.children.filter(Boolean) : []).map(ke).join("");
|
|
948
1171
|
let t = "";
|
|
949
|
-
e.props && e.props.attrs && (t = Object.entries(e.props.attrs).map(([n,
|
|
1172
|
+
e.props && e.props.attrs && (t = Object.entries(e.props.attrs).map(([n, s]) => ` ${n}="${Z(String(s))}"`).join(""));
|
|
950
1173
|
let r = "";
|
|
951
|
-
e.props && (r = Object.entries(e.props).filter(([n]) => n !== "attrs" && n !== "directives" && n !== "ref" && n !== "key").map(([n,
|
|
952
|
-
const i = Array.isArray(e.children) ? e.children.filter(Boolean).map(
|
|
1174
|
+
e.props && (r = Object.entries(e.props).filter(([n]) => n !== "attrs" && n !== "directives" && n !== "ref" && n !== "key").map(([n, s]) => ` ${n}="${Z(String(s))}"`).join(""));
|
|
1175
|
+
const i = Array.isArray(e.children) ? e.children.filter(Boolean).map(ke).join("") : typeof e.children == "string" ? Z(e.children) : e.children ? ke(e.children) : "";
|
|
953
1176
|
return `<${e.tag}${t}${r}>${i}</${e.tag}>`;
|
|
954
1177
|
}
|
|
955
|
-
function
|
|
1178
|
+
function Ue(e, ...t) {
|
|
956
1179
|
let r = "";
|
|
957
1180
|
for (let i = 0; i < e.length; i++)
|
|
958
1181
|
r += e[i], i < t.length && (r += t[i]);
|
|
959
1182
|
return r;
|
|
960
1183
|
}
|
|
961
|
-
function
|
|
1184
|
+
function Fe(e) {
|
|
962
1185
|
return e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;}/g, "}").trim();
|
|
963
1186
|
}
|
|
964
|
-
let
|
|
965
|
-
function
|
|
966
|
-
return
|
|
1187
|
+
let ue = null;
|
|
1188
|
+
function Oe() {
|
|
1189
|
+
return ue || (ue = new CSSStyleSheet(), ue.replaceSync(Fe(lt))), ue;
|
|
967
1190
|
}
|
|
968
|
-
function
|
|
1191
|
+
function ct(e) {
|
|
969
1192
|
return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi, "").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, "").replace(/expression\s*\([^)]*\)/gi, "");
|
|
970
1193
|
}
|
|
971
|
-
const
|
|
1194
|
+
const lt = Ue`
|
|
972
1195
|
:host, *, ::before, ::after {
|
|
973
1196
|
all: isolate;
|
|
974
1197
|
box-sizing: border-box;
|
|
@@ -1026,7 +1249,7 @@ const Xe = Pe`
|
|
|
1026
1249
|
sup { top: -.5em }
|
|
1027
1250
|
[disabled], [aria-disabled=true] { cursor: not-allowed }
|
|
1028
1251
|
[hidden] { display: none }
|
|
1029
|
-
`,
|
|
1252
|
+
`, ft = {
|
|
1030
1253
|
neutral: {
|
|
1031
1254
|
50: "#fafafa",
|
|
1032
1255
|
100: "#f4f4f5",
|
|
@@ -1122,8 +1345,8 @@ const Xe = Pe`
|
|
|
1122
1345
|
black: { DEFAULT: "#000000" },
|
|
1123
1346
|
transparent: { DEFAULT: "transparent" },
|
|
1124
1347
|
current: { DEFAULT: "currentColor" }
|
|
1125
|
-
},
|
|
1126
|
-
Object.entries(
|
|
1348
|
+
}, ut = Object.fromEntries(
|
|
1349
|
+
Object.entries(ft).map(([e, t]) => [
|
|
1127
1350
|
e,
|
|
1128
1351
|
Object.fromEntries(
|
|
1129
1352
|
Object.entries(t).map(([r, i]) => [
|
|
@@ -1132,7 +1355,7 @@ const Xe = Pe`
|
|
|
1132
1355
|
])
|
|
1133
1356
|
)
|
|
1134
1357
|
])
|
|
1135
|
-
),
|
|
1358
|
+
), _e = {
|
|
1136
1359
|
/* Display */
|
|
1137
1360
|
block: "display:block;",
|
|
1138
1361
|
inline: "display:inline;",
|
|
@@ -1347,7 +1570,7 @@ const Xe = Pe`
|
|
|
1347
1570
|
"z-30": "z-index:30;",
|
|
1348
1571
|
"z-40": "z-index:40;",
|
|
1349
1572
|
"z-50": "z-index:50;"
|
|
1350
|
-
},
|
|
1573
|
+
}, dt = "0.25rem", Pe = {
|
|
1351
1574
|
m: ["margin"],
|
|
1352
1575
|
mx: ["margin-inline"],
|
|
1353
1576
|
my: ["margin-block"],
|
|
@@ -1379,34 +1602,34 @@ const Xe = Pe`
|
|
|
1379
1602
|
"gap-x": ["column-gap"],
|
|
1380
1603
|
"gap-y": ["row-gap"]
|
|
1381
1604
|
};
|
|
1382
|
-
function
|
|
1605
|
+
function D(e, t) {
|
|
1383
1606
|
let r = 0, i = 0;
|
|
1384
1607
|
for (let n = 0; n < e.length; n++) {
|
|
1385
|
-
const
|
|
1386
|
-
if (
|
|
1387
|
-
else if (
|
|
1388
|
-
else if (
|
|
1389
|
-
else if (
|
|
1390
|
-
else if (r === 0 && i === 0 && (
|
|
1608
|
+
const s = e[n];
|
|
1609
|
+
if (s === "[") r++;
|
|
1610
|
+
else if (s === "]" && r > 0) r--;
|
|
1611
|
+
else if (s === "(") i++;
|
|
1612
|
+
else if (s === ")" && i > 0) i--;
|
|
1613
|
+
else if (r === 0 && i === 0 && (s === ">" || s === "+" || s === "~" || s === " "))
|
|
1391
1614
|
return e.slice(0, n) + t + e.slice(n);
|
|
1392
1615
|
}
|
|
1393
1616
|
return e + t;
|
|
1394
1617
|
}
|
|
1395
|
-
const
|
|
1618
|
+
const pt = {
|
|
1396
1619
|
before: (e, t) => `${e}::before{${t}}`,
|
|
1397
1620
|
after: (e, t) => `${e}::after{${t}}`,
|
|
1398
|
-
hover: (e, t) => `${
|
|
1399
|
-
focus: (e, t) => `${
|
|
1400
|
-
active: (e, t) => `${
|
|
1401
|
-
disabled: (e, t) => `${
|
|
1402
|
-
visited: (e, t) => `${
|
|
1403
|
-
checked: (e, t) => `${
|
|
1404
|
-
first: (e, t) => `${
|
|
1405
|
-
last: (e, t) => `${
|
|
1406
|
-
odd: (e, t) => `${
|
|
1407
|
-
even: (e, t) => `${
|
|
1408
|
-
"focus-within": (e, t) => `${
|
|
1409
|
-
"focus-visible": (e, t) => `${
|
|
1621
|
+
hover: (e, t) => `${D(e, ":hover")}{${t}}`,
|
|
1622
|
+
focus: (e, t) => `${D(e, ":focus")}{${t}}`,
|
|
1623
|
+
active: (e, t) => `${D(e, ":active")}{${t}}`,
|
|
1624
|
+
disabled: (e, t) => `${D(e, ":disabled")}{${t}}`,
|
|
1625
|
+
visited: (e, t) => `${D(e, ":visited")}{${t}}`,
|
|
1626
|
+
checked: (e, t) => `${D(e, ":checked")}{${t}}`,
|
|
1627
|
+
first: (e, t) => `${D(e, ":first-child")}{${t}}`,
|
|
1628
|
+
last: (e, t) => `${D(e, ":last-child")}{${t}}`,
|
|
1629
|
+
odd: (e, t) => `${D(e, ":nth-child(odd)")}{${t}}`,
|
|
1630
|
+
even: (e, t) => `${D(e, ":nth-child(even)")}{${t}}`,
|
|
1631
|
+
"focus-within": (e, t) => `${D(e, ":focus-within")}{${t}}`,
|
|
1632
|
+
"focus-visible": (e, t) => `${D(e, ":focus-visible")}{${t}}`,
|
|
1410
1633
|
"group-hover": (e, t) => `.group:hover ${e}{${t}}`,
|
|
1411
1634
|
"group-focus": (e, t) => `.group:focus ${e}{${t}}`,
|
|
1412
1635
|
"group-active": (e, t) => `.group:active ${e}{${t}}`,
|
|
@@ -1415,7 +1638,7 @@ const nt = {
|
|
|
1415
1638
|
"peer-focus": (e, t) => `.peer:focus ~ ${e}{${t}}`,
|
|
1416
1639
|
"peer-checked": (e, t) => `.peer:checked ~ ${e}{${t}}`,
|
|
1417
1640
|
"peer-disabled": (e, t) => `.peer:disabled ~ ${e}{${t}}`
|
|
1418
|
-
},
|
|
1641
|
+
}, Ee = {
|
|
1419
1642
|
// Responsive
|
|
1420
1643
|
sm: "(min-width:640px)",
|
|
1421
1644
|
md: "(min-width:768px)",
|
|
@@ -1424,25 +1647,25 @@ const nt = {
|
|
|
1424
1647
|
"2xl": "(min-width:1536px)",
|
|
1425
1648
|
// Dark mode (now plain string)
|
|
1426
1649
|
dark: "(prefers-color-scheme: dark)"
|
|
1427
|
-
},
|
|
1428
|
-
function
|
|
1650
|
+
}, $e = ["sm", "md", "lg", "xl", "2xl"];
|
|
1651
|
+
function Se(e) {
|
|
1429
1652
|
const t = e.startsWith("-"), i = (t ? e.slice(1) : e).split("-");
|
|
1430
1653
|
if (i.length < 2) return null;
|
|
1431
|
-
const n = i.slice(0, -1).join("-"),
|
|
1432
|
-
if (Number.isNaN(
|
|
1654
|
+
const n = i.slice(0, -1).join("-"), s = i[i.length - 1], o = parseFloat(s);
|
|
1655
|
+
if (Number.isNaN(o) || !Pe[n]) return null;
|
|
1433
1656
|
const a = t ? "-" : "";
|
|
1434
|
-
return
|
|
1657
|
+
return Pe[n].map((c) => `${c}:calc(${a}${dt} * ${o});`).join("");
|
|
1435
1658
|
}
|
|
1436
|
-
function
|
|
1437
|
-
const t = e.replace("#", ""), r = parseInt(t, 16), i = r >> 16 & 255, n = r >> 8 & 255,
|
|
1438
|
-
return `${i} ${n} ${
|
|
1659
|
+
function Me(e) {
|
|
1660
|
+
const t = e.replace("#", ""), r = parseInt(t, 16), i = r >> 16 & 255, n = r >> 8 & 255, s = r & 255;
|
|
1661
|
+
return `${i} ${n} ${s}`;
|
|
1439
1662
|
}
|
|
1440
|
-
function
|
|
1663
|
+
function ht(e) {
|
|
1441
1664
|
const t = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
|
|
1442
1665
|
if (!t) return null;
|
|
1443
|
-
const [, r, i, n = "DEFAULT"] = t,
|
|
1444
|
-
if (!
|
|
1445
|
-
if (r === "shadow") return `--ce-shadow-color:${
|
|
1666
|
+
const [, r, i, n = "DEFAULT"] = t, s = ut[i]?.[n];
|
|
1667
|
+
if (!s) return null;
|
|
1668
|
+
if (r === "shadow") return `--ce-shadow-color:${s};`;
|
|
1446
1669
|
const a = {
|
|
1447
1670
|
bg: "background-color",
|
|
1448
1671
|
decoration: "text-decoration-color",
|
|
@@ -1454,49 +1677,49 @@ function it(e) {
|
|
|
1454
1677
|
fill: "fill",
|
|
1455
1678
|
stroke: "stroke"
|
|
1456
1679
|
}[r];
|
|
1457
|
-
return a ? `${a}:${
|
|
1680
|
+
return a ? `${a}:${s};` : null;
|
|
1458
1681
|
}
|
|
1459
|
-
function
|
|
1682
|
+
function gt(e) {
|
|
1460
1683
|
const [t, r] = e.split("/");
|
|
1461
1684
|
if (!r) return { base: t };
|
|
1462
1685
|
const i = parseInt(r, 10);
|
|
1463
1686
|
return isNaN(i) || i < 0 || i > 100 ? { base: t } : { base: t, opacity: i / 100 };
|
|
1464
1687
|
}
|
|
1465
|
-
function
|
|
1466
|
-
const { base: t, opacity: r } =
|
|
1688
|
+
function Ce(e) {
|
|
1689
|
+
const { base: t, opacity: r } = gt(e), i = ht(t);
|
|
1467
1690
|
if (i) {
|
|
1468
1691
|
if (r !== void 0) {
|
|
1469
|
-
const
|
|
1470
|
-
if (
|
|
1471
|
-
const
|
|
1472
|
-
return i.replace(/#([0-9a-f]{6})/i, `rgb(${
|
|
1692
|
+
const s = /#([0-9a-f]{6})/i.exec(i);
|
|
1693
|
+
if (s) {
|
|
1694
|
+
const o = Me(s[0]);
|
|
1695
|
+
return i.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
|
|
1473
1696
|
}
|
|
1474
1697
|
}
|
|
1475
1698
|
return i;
|
|
1476
1699
|
}
|
|
1477
|
-
const n =
|
|
1700
|
+
const n = me(t);
|
|
1478
1701
|
if (n && r !== void 0) {
|
|
1479
|
-
const
|
|
1480
|
-
if (
|
|
1481
|
-
const
|
|
1482
|
-
return n.replace(/#([0-9a-f]{6})/i, `rgb(${
|
|
1702
|
+
const s = /#([0-9a-f]{6})/i.exec(n);
|
|
1703
|
+
if (s) {
|
|
1704
|
+
const o = Me(s[0]);
|
|
1705
|
+
return n.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
|
|
1483
1706
|
}
|
|
1484
1707
|
}
|
|
1485
1708
|
return n;
|
|
1486
1709
|
}
|
|
1487
|
-
function
|
|
1710
|
+
function Ae(e) {
|
|
1488
1711
|
const t = /^opacity-(\d{1,3})$/.exec(e);
|
|
1489
1712
|
if (!t) return null;
|
|
1490
1713
|
const r = parseInt(t[1], 10);
|
|
1491
1714
|
return r < 0 || r > 100 ? null : `opacity:${r / 100};`;
|
|
1492
1715
|
}
|
|
1493
|
-
function
|
|
1716
|
+
function me(e) {
|
|
1494
1717
|
if (e.startsWith("[") && e.endsWith("]") && !e.includes("-[")) {
|
|
1495
1718
|
const n = e.slice(1, -1).trim().match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*:(.*)$/);
|
|
1496
1719
|
if (n) {
|
|
1497
|
-
const
|
|
1498
|
-
let
|
|
1499
|
-
return
|
|
1720
|
+
const s = n[1].trim();
|
|
1721
|
+
let o = n[2].trim();
|
|
1722
|
+
return o = o.replace(/url\('\s*([^']*?)\s*'\)/g, 'url("$1")'), o = o.replace(/^'([^']*)'$/g, '"$1"'), `${s}:${o};`;
|
|
1500
1723
|
}
|
|
1501
1724
|
return null;
|
|
1502
1725
|
}
|
|
@@ -1505,7 +1728,7 @@ function fe(e) {
|
|
|
1505
1728
|
const i = e.slice(0, t);
|
|
1506
1729
|
let n = e.slice(t + 2, -1);
|
|
1507
1730
|
n = n.replace(/_/g, " ");
|
|
1508
|
-
const
|
|
1731
|
+
const s = {
|
|
1509
1732
|
bg: "background-color",
|
|
1510
1733
|
text: "color",
|
|
1511
1734
|
shadow: "box-shadow",
|
|
@@ -1549,12 +1772,12 @@ function fe(e) {
|
|
|
1549
1772
|
};
|
|
1550
1773
|
if (i === "rotate")
|
|
1551
1774
|
return `transform:rotate(${n});`;
|
|
1552
|
-
const
|
|
1553
|
-
if (
|
|
1775
|
+
const o = s[i] ?? i.replace(/_/g, "-");
|
|
1776
|
+
if (o && n) return `${o}:${n};`;
|
|
1554
1777
|
}
|
|
1555
1778
|
return null;
|
|
1556
1779
|
}
|
|
1557
|
-
function
|
|
1780
|
+
function mt(e) {
|
|
1558
1781
|
if (e.startsWith("[") && e.endsWith("]")) {
|
|
1559
1782
|
const r = e.slice(1, -1);
|
|
1560
1783
|
return r.includes("&") ? r : e;
|
|
@@ -1566,10 +1789,10 @@ function ot(e) {
|
|
|
1566
1789
|
}
|
|
1567
1790
|
return null;
|
|
1568
1791
|
}
|
|
1569
|
-
function
|
|
1792
|
+
function yt(e) {
|
|
1570
1793
|
return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
|
|
1571
1794
|
}
|
|
1572
|
-
function
|
|
1795
|
+
function bt(e) {
|
|
1573
1796
|
const t = /class\s*=\s*(['"])(.*?)\1/g, r = [];
|
|
1574
1797
|
let i;
|
|
1575
1798
|
for (; i = t.exec(e); ) {
|
|
@@ -1578,31 +1801,31 @@ function ct(e) {
|
|
|
1578
1801
|
}
|
|
1579
1802
|
return r.filter(Boolean);
|
|
1580
1803
|
}
|
|
1581
|
-
const
|
|
1582
|
-
function
|
|
1583
|
-
const t = Date.now(), r =
|
|
1584
|
-
if (r && t - r.timestamp <
|
|
1585
|
-
const i =
|
|
1586
|
-
function
|
|
1587
|
-
const
|
|
1588
|
-
if (
|
|
1804
|
+
const Be = /* @__PURE__ */ new Map(), wt = 16;
|
|
1805
|
+
function xt(e) {
|
|
1806
|
+
const t = Date.now(), r = Be.get(e);
|
|
1807
|
+
if (r && t - r.timestamp < wt) return r.css;
|
|
1808
|
+
const i = bt(e), n = new Set(i), s = [], o = [], a = [], c = [], u = {};
|
|
1809
|
+
function m(d, g = !1) {
|
|
1810
|
+
const y = (g ? "dark|" : "") + d;
|
|
1811
|
+
if (y in u) return u[y];
|
|
1589
1812
|
const x = w(d, g);
|
|
1590
|
-
return
|
|
1813
|
+
return u[y] = x, x;
|
|
1591
1814
|
}
|
|
1592
|
-
function
|
|
1593
|
-
const g = d.some((x) =>
|
|
1594
|
-
return d.length === 0 ? 1 : !g && !
|
|
1815
|
+
function T(d) {
|
|
1816
|
+
const g = d.some((x) => $e.includes(x)), y = d.includes("dark");
|
|
1817
|
+
return d.length === 0 ? 1 : !g && !y ? 2 : g && !y ? 3 : 4;
|
|
1595
1818
|
}
|
|
1596
|
-
function
|
|
1819
|
+
function p(d) {
|
|
1597
1820
|
const g = [];
|
|
1598
|
-
let
|
|
1821
|
+
let y = "", x = 0, f = 0;
|
|
1599
1822
|
for (let b = 0; b < d.length; b++) {
|
|
1600
|
-
const
|
|
1601
|
-
|
|
1823
|
+
const h = d[b];
|
|
1824
|
+
h === "[" ? x++ : h === "]" && x > 0 ? x-- : h === "(" ? f++ : h === ")" && f > 0 && f--, h === ":" && x === 0 && f === 0 ? (g.push(y), y = "") : y += h;
|
|
1602
1825
|
}
|
|
1603
|
-
return
|
|
1826
|
+
return y && g.push(y), g;
|
|
1604
1827
|
}
|
|
1605
|
-
function
|
|
1828
|
+
function l(d) {
|
|
1606
1829
|
switch (d) {
|
|
1607
1830
|
case "hover":
|
|
1608
1831
|
return ":hover";
|
|
@@ -1633,209 +1856,244 @@ function ft(e) {
|
|
|
1633
1856
|
}
|
|
1634
1857
|
}
|
|
1635
1858
|
function w(d, g = !1) {
|
|
1636
|
-
const
|
|
1859
|
+
const y = p(d);
|
|
1637
1860
|
let x = !1;
|
|
1638
|
-
const
|
|
1639
|
-
if (!
|
|
1640
|
-
const b =
|
|
1641
|
-
if (!
|
|
1642
|
-
const _ =
|
|
1643
|
-
let
|
|
1644
|
-
g && (
|
|
1645
|
-
const S = `.${
|
|
1646
|
-
let
|
|
1647
|
-
const
|
|
1648
|
-
for (const k of
|
|
1649
|
-
k.startsWith("group-") ? (
|
|
1650
|
-
|
|
1651
|
-
const
|
|
1861
|
+
const f = y.find((k) => (k.startsWith("!") && (x = !0, k = k.slice(1)), _e[k] || Se(k) || Ae(k) || Ce(k) || me(k)));
|
|
1862
|
+
if (!f) return null;
|
|
1863
|
+
const b = f.replace(/^!/, ""), h = _e[b] ?? Se(b) ?? Ae(b) ?? Ce(b) ?? me(b);
|
|
1864
|
+
if (!h) return null;
|
|
1865
|
+
const _ = y.indexOf(f);
|
|
1866
|
+
let $ = _ >= 0 ? y.slice(0, _) : [];
|
|
1867
|
+
g && ($ = $.filter((k) => k !== "dark"));
|
|
1868
|
+
const S = `.${yt(d)}`, E = "__SUBJECT__", C = x ? h.replace(/;$/, " !important;") : h;
|
|
1869
|
+
let A = E;
|
|
1870
|
+
const P = [];
|
|
1871
|
+
for (const k of $)
|
|
1872
|
+
k.startsWith("group-") ? (A = `.group:${k.slice(6)} ${A}`, P.push(k)) : k.startsWith("peer-") && (A = A.replace(E, `.peer:${k.slice(5)}~${E}`), P.push(k));
|
|
1873
|
+
$ = $.filter((k) => !P.includes(k));
|
|
1874
|
+
const X = [], ie = [];
|
|
1652
1875
|
let M = null;
|
|
1653
|
-
for (const k of
|
|
1654
|
-
if (k === "dark" ||
|
|
1655
|
-
const
|
|
1656
|
-
if (
|
|
1657
|
-
M =
|
|
1876
|
+
for (const k of $) {
|
|
1877
|
+
if (k === "dark" || $e.includes(k)) continue;
|
|
1878
|
+
const W = mt(k);
|
|
1879
|
+
if (W) {
|
|
1880
|
+
M = W;
|
|
1658
1881
|
continue;
|
|
1659
1882
|
}
|
|
1660
|
-
const R =
|
|
1883
|
+
const R = l(k);
|
|
1661
1884
|
if (R) {
|
|
1662
|
-
M ?
|
|
1885
|
+
M ? ie.push(R) : X.push(R);
|
|
1663
1886
|
continue;
|
|
1664
1887
|
}
|
|
1665
|
-
const
|
|
1666
|
-
typeof
|
|
1888
|
+
const B = pt[k];
|
|
1889
|
+
typeof B == "function" && (A = B(A, C).split("{")[0]);
|
|
1667
1890
|
}
|
|
1668
|
-
function
|
|
1669
|
-
if (!
|
|
1670
|
-
let R = 0,
|
|
1891
|
+
function F(k, W) {
|
|
1892
|
+
if (!W) return k;
|
|
1893
|
+
let R = 0, B = 0;
|
|
1671
1894
|
if (k.length && (k[0] === ">" || k[0] === "+" || k[0] === "~" || k[0] === " ")) {
|
|
1672
1895
|
let j = 1;
|
|
1673
1896
|
for (; j < k.length && k[j] === " "; ) j++;
|
|
1674
1897
|
for (; j < k.length; j++) {
|
|
1675
1898
|
const L = k[j];
|
|
1676
|
-
if (L === "[" ? R++ : L === "]" && R > 0 ? R-- : L === "(" ?
|
|
1677
|
-
return k.slice(0, j) +
|
|
1899
|
+
if (L === "[" ? R++ : L === "]" && R > 0 ? R-- : L === "(" ? B++ : L === ")" && B > 0 && B--, R === 0 && B === 0 && (k[j] === ">" || k[j] === "+" || k[j] === "~" || k[j] === " "))
|
|
1900
|
+
return k.slice(0, j) + W + k.slice(j);
|
|
1678
1901
|
}
|
|
1679
|
-
return k +
|
|
1902
|
+
return k + W;
|
|
1680
1903
|
}
|
|
1681
1904
|
for (let j = 0; j < k.length; j++) {
|
|
1682
1905
|
const L = k[j];
|
|
1683
|
-
if (L === "[" ? R++ : L === "]" && R > 0 ? R-- : L === "(" ?
|
|
1684
|
-
return k.slice(0, j) +
|
|
1906
|
+
if (L === "[" ? R++ : L === "]" && R > 0 ? R-- : L === "(" ? B++ : L === ")" && B > 0 && B--, R === 0 && B === 0 && (L === ">" || L === "+" || L === "~" || L === " "))
|
|
1907
|
+
return k.slice(0, j) + W + k.slice(j);
|
|
1685
1908
|
}
|
|
1686
|
-
return k +
|
|
1909
|
+
return k + W;
|
|
1687
1910
|
}
|
|
1688
|
-
const
|
|
1911
|
+
const H = X.join(""), N = ie.join("");
|
|
1689
1912
|
if (M)
|
|
1690
1913
|
if (M.includes("&")) {
|
|
1691
|
-
const k = M.indexOf("&"),
|
|
1692
|
-
if (
|
|
1693
|
-
|
|
1914
|
+
const k = M.indexOf("&"), W = M.slice(0, k), R = M.slice(k + 1), B = E + H, j = A;
|
|
1915
|
+
if (X.length === 0)
|
|
1916
|
+
A = j.replace(E, W + B + N + R);
|
|
1694
1917
|
else {
|
|
1695
|
-
const L =
|
|
1696
|
-
|
|
1918
|
+
const L = F(R, N);
|
|
1919
|
+
A = j.replace(E, W + B + L);
|
|
1697
1920
|
}
|
|
1698
1921
|
} else
|
|
1699
|
-
|
|
1922
|
+
A = A.replace(E, `${M}${E + H}`), N && (A = A.replace(E, `${E}${N}`));
|
|
1700
1923
|
else
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
let
|
|
1704
|
-
const
|
|
1705
|
-
return g &&
|
|
1924
|
+
A = E + H + N;
|
|
1925
|
+
A = A.replace(new RegExp(E, "g"), S);
|
|
1926
|
+
let I = `${A}{${C}}`;
|
|
1927
|
+
const z = $.filter((k) => $e.includes(k)), J = z.length ? z[z.length - 1] : null, se = $.includes("dark");
|
|
1928
|
+
return g && J ? I = `@media (prefers-color-scheme: dark) and ${Ee[J]}{${I}}` : g ? I = `@media (prefers-color-scheme: dark){${I}}` : se && J ? I = `@media (prefers-color-scheme: dark) and ${Ee[J]}{${I}}` : se ? I = `@media (prefers-color-scheme: dark){${I}}` : J && (I = `@media ${Ee[J]}{${I}}`), I;
|
|
1706
1929
|
}
|
|
1707
1930
|
for (const d of n) {
|
|
1708
|
-
const g =
|
|
1709
|
-
(
|
|
1931
|
+
const g = p(d), y = g.find(
|
|
1932
|
+
(h) => _e[h] || Se(h) || Ae(h) || Ce(h) || me(h)
|
|
1710
1933
|
);
|
|
1711
|
-
if (!
|
|
1712
|
-
const x = g.indexOf(
|
|
1934
|
+
if (!y) continue;
|
|
1935
|
+
const x = g.indexOf(y), f = x >= 0 ? g.slice(0, x) : [], b = T(f);
|
|
1713
1936
|
if (b === 4) {
|
|
1714
|
-
const
|
|
1715
|
-
|
|
1937
|
+
const h = m(d, !0);
|
|
1938
|
+
h && c.push(h);
|
|
1716
1939
|
} else {
|
|
1717
|
-
const
|
|
1718
|
-
|
|
1940
|
+
const h = m(d);
|
|
1941
|
+
h && (b === 1 ? s.push(h) : b === 2 ? o.push(h) : b === 3 && a.push(h));
|
|
1719
1942
|
}
|
|
1720
1943
|
}
|
|
1721
|
-
const v = [...
|
|
1722
|
-
return
|
|
1944
|
+
const v = [...s, ...o, ...a, ...c].join("");
|
|
1945
|
+
return Be.set(e, { css: v, timestamp: t }), v;
|
|
1723
1946
|
}
|
|
1724
|
-
const
|
|
1725
|
-
function
|
|
1947
|
+
const ce = [];
|
|
1948
|
+
function vt(e, t, r, i, n, s, o, a) {
|
|
1726
1949
|
if (e) {
|
|
1727
|
-
|
|
1950
|
+
ce.push(r);
|
|
1728
1951
|
try {
|
|
1729
1952
|
if (t.loadingTemplate && r.isLoading) {
|
|
1730
|
-
|
|
1953
|
+
re(e, t.loadingTemplate(r), r, i, n);
|
|
1731
1954
|
return;
|
|
1732
1955
|
}
|
|
1733
1956
|
if (t.errorTemplate && r.hasError) {
|
|
1734
|
-
r.error instanceof Error &&
|
|
1957
|
+
r.error instanceof Error && re(e, t.errorTemplate(r.error, r), r, i, n);
|
|
1735
1958
|
return;
|
|
1736
1959
|
}
|
|
1737
|
-
const
|
|
1738
|
-
if (
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
}).catch((
|
|
1742
|
-
|
|
1743
|
-
}), t.loadingTemplate &&
|
|
1960
|
+
const c = t.render(r);
|
|
1961
|
+
if (c instanceof Promise) {
|
|
1962
|
+
s(!0), c.then((u) => {
|
|
1963
|
+
s(!1), o(null), re(e, u, r, i, n), a(e.innerHTML);
|
|
1964
|
+
}).catch((u) => {
|
|
1965
|
+
s(!1), o(u), t.errorTemplate && re(e, t.errorTemplate(u, r), r, i, n);
|
|
1966
|
+
}), t.loadingTemplate && re(e, t.loadingTemplate(r), r, i, n);
|
|
1744
1967
|
return;
|
|
1745
1968
|
}
|
|
1746
|
-
|
|
1969
|
+
re(e, c, r, i, n), a(e.innerHTML);
|
|
1747
1970
|
} finally {
|
|
1748
|
-
|
|
1971
|
+
ce.pop();
|
|
1749
1972
|
}
|
|
1750
1973
|
}
|
|
1751
1974
|
}
|
|
1752
|
-
function
|
|
1753
|
-
e && (
|
|
1975
|
+
function re(e, t, r, i, n) {
|
|
1976
|
+
e && (at(
|
|
1754
1977
|
e,
|
|
1755
1978
|
Array.isArray(t) ? t : [t],
|
|
1756
1979
|
r,
|
|
1757
1980
|
i
|
|
1758
1981
|
), n(e.innerHTML));
|
|
1759
1982
|
}
|
|
1760
|
-
function
|
|
1761
|
-
if (
|
|
1983
|
+
function kt(e, t, r, i, n, s, o) {
|
|
1984
|
+
if (s !== null && clearTimeout(s), Date.now() - t < 16) {
|
|
1762
1985
|
if (n(r + 1), r > 10) {
|
|
1763
|
-
|
|
1986
|
+
o(null);
|
|
1764
1987
|
return;
|
|
1765
1988
|
}
|
|
1766
1989
|
} else
|
|
1767
1990
|
n(0);
|
|
1768
|
-
const
|
|
1769
|
-
i(Date.now()), e(),
|
|
1991
|
+
const c = setTimeout(() => {
|
|
1992
|
+
i(Date.now()), e(), o(null);
|
|
1770
1993
|
}, 0);
|
|
1771
|
-
|
|
1994
|
+
o(c);
|
|
1772
1995
|
}
|
|
1773
|
-
function
|
|
1996
|
+
function _t(e, t, r, i, n, s) {
|
|
1774
1997
|
if (!e) return;
|
|
1775
|
-
const
|
|
1776
|
-
if (!t.style && (!
|
|
1777
|
-
|
|
1998
|
+
const o = xt(i);
|
|
1999
|
+
if (!t.style && (!o || o.trim() === "")) {
|
|
2000
|
+
s(null), e.adoptedStyleSheets = [Oe()];
|
|
1778
2001
|
return;
|
|
1779
2002
|
}
|
|
1780
2003
|
let a = "";
|
|
1781
2004
|
t.style && (typeof t.style == "string" ? a = t.style : typeof t.style == "function" && (a = t.style(r)));
|
|
1782
|
-
let
|
|
1783
|
-
${
|
|
2005
|
+
let c = ct(`${a}
|
|
2006
|
+
${o}
|
|
1784
2007
|
`);
|
|
1785
|
-
|
|
1786
|
-
let
|
|
1787
|
-
|
|
2008
|
+
c = Fe(c);
|
|
2009
|
+
let u = n;
|
|
2010
|
+
u || (u = new CSSStyleSheet()), (u.cssRules.length === 0 || u.toString() !== c) && u.replaceSync(c), e.adoptedStyleSheets = [Oe(), u], s(u);
|
|
1788
2011
|
}
|
|
1789
|
-
|
|
2012
|
+
class Et {
|
|
2013
|
+
pendingUpdates = /* @__PURE__ */ new Map();
|
|
2014
|
+
isFlushScheduled = !1;
|
|
2015
|
+
/**
|
|
2016
|
+
* Schedule an update to be executed in the next microtask
|
|
2017
|
+
* Uses component identity to deduplicate multiple render requests for the same component
|
|
2018
|
+
*/
|
|
2019
|
+
schedule(t, r) {
|
|
2020
|
+
const i = r || t.toString();
|
|
2021
|
+
this.pendingUpdates.set(i, t), this.isFlushScheduled || (this.isFlushScheduled = !0, typeof globalThis.process < "u" && globalThis.process.env?.NODE_ENV === "test" || typeof window < "u" && (window.__vitest__ || window.Cypress) ? this.flush() : queueMicrotask(() => this.flush()));
|
|
2022
|
+
}
|
|
2023
|
+
/**
|
|
2024
|
+
* Execute all pending updates
|
|
2025
|
+
*/
|
|
2026
|
+
flush() {
|
|
2027
|
+
const t = Array.from(this.pendingUpdates.values());
|
|
2028
|
+
this.pendingUpdates.clear(), this.isFlushScheduled = !1;
|
|
2029
|
+
for (const r of t)
|
|
2030
|
+
try {
|
|
2031
|
+
r();
|
|
2032
|
+
} catch (i) {
|
|
2033
|
+
typeof console < "u" && console.error && console.error("Error in batched update:", i);
|
|
2034
|
+
}
|
|
2035
|
+
}
|
|
2036
|
+
/**
|
|
2037
|
+
* Get the number of pending updates
|
|
2038
|
+
*/
|
|
2039
|
+
get pendingCount() {
|
|
2040
|
+
return this.pendingUpdates.size;
|
|
2041
|
+
}
|
|
2042
|
+
}
|
|
2043
|
+
const $t = new Et();
|
|
2044
|
+
function oe(e, t) {
|
|
2045
|
+
$t.schedule(e, t);
|
|
2046
|
+
}
|
|
2047
|
+
const be = /* @__PURE__ */ new Map(), We = Symbol.for("cer.registry");
|
|
1790
2048
|
if (typeof window < "u") {
|
|
1791
2049
|
const e = globalThis;
|
|
1792
|
-
e[
|
|
2050
|
+
e[We] || (e[We] = be);
|
|
1793
2051
|
}
|
|
1794
|
-
function
|
|
1795
|
-
let i =
|
|
2052
|
+
function Ie(e, t, r) {
|
|
2053
|
+
let i = Q(e);
|
|
1796
2054
|
i.includes("-") || (i = `cer-${i}`);
|
|
1797
2055
|
let n;
|
|
1798
|
-
typeof t == "function" ? n = { ...r, render: t } : n = t, typeof n.onError != "function" && (n.onError = (
|
|
1799
|
-
|
|
2056
|
+
typeof t == "function" ? n = { ...r, render: t } : n = t, typeof n.onError != "function" && (n.onError = (s, o) => {
|
|
2057
|
+
Y(`[${i}] Error:`, s, o);
|
|
1800
2058
|
});
|
|
1801
2059
|
try {
|
|
1802
|
-
const
|
|
2060
|
+
const s = /* @__PURE__ */ new Set([
|
|
1803
2061
|
"refs",
|
|
1804
2062
|
"requestRender",
|
|
1805
2063
|
"error",
|
|
1806
2064
|
"hasError",
|
|
1807
2065
|
"isLoading",
|
|
1808
2066
|
"emit"
|
|
1809
|
-
]),
|
|
2067
|
+
]), o = [];
|
|
1810
2068
|
if (n.state && typeof n.state == "object" && Object.keys(n.state).forEach((a) => {
|
|
1811
|
-
|
|
2069
|
+
s.has(a) && o.push(a);
|
|
1812
2070
|
}), n.props && typeof n.props == "object" && Object.keys(n.props).forEach((a) => {
|
|
1813
|
-
|
|
2071
|
+
s.has(a) && o.push(a);
|
|
1814
2072
|
}), n.computed && typeof n.computed == "object" && Object.keys(n.computed).forEach((a) => {
|
|
1815
|
-
|
|
1816
|
-
}),
|
|
1817
|
-
const a = Array.from(new Set(
|
|
1818
|
-
|
|
2073
|
+
s.has(a) && o.push(a);
|
|
2074
|
+
}), o.length > 0) {
|
|
2075
|
+
const a = Array.from(new Set(o));
|
|
2076
|
+
pe(
|
|
1819
2077
|
`[${i}] Reserved runtime context keys used in component config: ${a.join(", ")}. These names are provided by the runtime (for example: refs, error, emit). Rename your state/prop/computed keys (e.g. 'error' -> 'errorMessage') to avoid collisions and TypeScript type conflicts.`
|
|
1820
2078
|
);
|
|
1821
2079
|
}
|
|
1822
2080
|
} catch {
|
|
1823
2081
|
}
|
|
1824
|
-
if (
|
|
2082
|
+
if (be.set(i, n), typeof window < "u")
|
|
1825
2083
|
if (!customElements.get(i))
|
|
1826
|
-
customElements.define(i,
|
|
2084
|
+
customElements.define(i, St(i, n));
|
|
1827
2085
|
else
|
|
1828
2086
|
try {
|
|
1829
|
-
document.querySelectorAll(i).forEach((
|
|
2087
|
+
document.querySelectorAll(i).forEach((s) => {
|
|
1830
2088
|
try {
|
|
1831
|
-
typeof
|
|
2089
|
+
typeof s._cfg < "u" && (s._cfg = n), typeof s._render == "function" && s._render(n);
|
|
1832
2090
|
} catch {
|
|
1833
2091
|
}
|
|
1834
2092
|
});
|
|
1835
2093
|
} catch {
|
|
1836
2094
|
}
|
|
1837
2095
|
}
|
|
1838
|
-
function
|
|
2096
|
+
function St(e, t) {
|
|
1839
2097
|
if (!t.render)
|
|
1840
2098
|
throw new Error(
|
|
1841
2099
|
"Component must have a render function"
|
|
@@ -1853,6 +2111,7 @@ function ht(e, t) {
|
|
|
1853
2111
|
_mounted = !1;
|
|
1854
2112
|
_hasError = !1;
|
|
1855
2113
|
_initializing = !0;
|
|
2114
|
+
_componentId;
|
|
1856
2115
|
_styleSheet = null;
|
|
1857
2116
|
_lastHtmlStringForJitCSS = "";
|
|
1858
2117
|
/**
|
|
@@ -1879,7 +2138,7 @@ function ht(e, t) {
|
|
|
1879
2138
|
_templateLoading = !1;
|
|
1880
2139
|
_templateError = null;
|
|
1881
2140
|
constructor() {
|
|
1882
|
-
super(), this.attachShadow({ mode: "open" }), this._cfg =
|
|
2141
|
+
super(), this.attachShadow({ mode: "open" }), this._cfg = be.get(e) || t, this._componentId = `${e}-${Math.random().toString(36).substr(2, 9)}`;
|
|
1883
2142
|
const r = this._initContext(t);
|
|
1884
2143
|
Object.defineProperty(r, "refs", {
|
|
1885
2144
|
value: this._refs,
|
|
@@ -1891,13 +2150,23 @@ function ht(e, t) {
|
|
|
1891
2150
|
writable: !1,
|
|
1892
2151
|
enumerable: !1,
|
|
1893
2152
|
configurable: !1
|
|
2153
|
+
}), Object.defineProperty(r, "_requestRender", {
|
|
2154
|
+
value: () => this._requestRender(),
|
|
2155
|
+
writable: !1,
|
|
2156
|
+
enumerable: !1,
|
|
2157
|
+
configurable: !1
|
|
2158
|
+
}), Object.defineProperty(r, "_triggerWatchers", {
|
|
2159
|
+
value: (n, s) => this._triggerWatchers(n, s),
|
|
2160
|
+
writable: !1,
|
|
2161
|
+
enumerable: !1,
|
|
2162
|
+
configurable: !1
|
|
1894
2163
|
}), this.context = r, Object.defineProperty(this.context, "emit", {
|
|
1895
|
-
value: (n,
|
|
2164
|
+
value: (n, s, o) => {
|
|
1896
2165
|
const a = new CustomEvent(n, {
|
|
1897
|
-
detail:
|
|
2166
|
+
detail: s,
|
|
1898
2167
|
bubbles: !0,
|
|
1899
2168
|
composed: !0,
|
|
1900
|
-
...
|
|
2169
|
+
...o || {}
|
|
1901
2170
|
});
|
|
1902
2171
|
return this.dispatchEvent(a), !a.defaultPrevented;
|
|
1903
2172
|
},
|
|
@@ -1905,15 +2174,28 @@ function ht(e, t) {
|
|
|
1905
2174
|
enumerable: !1,
|
|
1906
2175
|
configurable: !1
|
|
1907
2176
|
});
|
|
1908
|
-
const i =
|
|
2177
|
+
const i = be.get(e) || t;
|
|
1909
2178
|
Object.keys(i).forEach((n) => {
|
|
1910
|
-
const
|
|
1911
|
-
typeof
|
|
1912
|
-
}), this._applyComputed(i),
|
|
2179
|
+
const s = i[n];
|
|
2180
|
+
typeof s == "function" && (this.context[n] = (...o) => s(...o, this.context));
|
|
2181
|
+
}), this._applyComputed(i), i.props && Object.keys(i.props).forEach((n) => {
|
|
2182
|
+
let s = this[n];
|
|
2183
|
+
Object.defineProperty(this, n, {
|
|
2184
|
+
get() {
|
|
2185
|
+
return s;
|
|
2186
|
+
},
|
|
2187
|
+
set(o) {
|
|
2188
|
+
const a = s;
|
|
2189
|
+
s = o, this.context[n] = o, this._initializing || (this._applyProps(i), a !== o && this._requestRender());
|
|
2190
|
+
},
|
|
2191
|
+
enumerable: !0,
|
|
2192
|
+
configurable: !0
|
|
2193
|
+
});
|
|
2194
|
+
}), this._initializing = !1, this._initWatchers(i), this._render(i);
|
|
1913
2195
|
}
|
|
1914
2196
|
connectedCallback() {
|
|
1915
2197
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1916
|
-
this._applyProps(t),
|
|
2198
|
+
this._applyProps(t), Qe(
|
|
1917
2199
|
t,
|
|
1918
2200
|
this.context,
|
|
1919
2201
|
this._mounted,
|
|
@@ -1925,7 +2207,7 @@ function ht(e, t) {
|
|
|
1925
2207
|
}
|
|
1926
2208
|
disconnectedCallback() {
|
|
1927
2209
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1928
|
-
|
|
2210
|
+
Xe(
|
|
1929
2211
|
t,
|
|
1930
2212
|
this.context,
|
|
1931
2213
|
this._listeners,
|
|
@@ -1949,7 +2231,7 @@ function ht(e, t) {
|
|
|
1949
2231
|
}
|
|
1950
2232
|
attributeChangedCallback(r, i, n) {
|
|
1951
2233
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1952
|
-
this._applyProps(t),
|
|
2234
|
+
this._applyProps(t), et(
|
|
1953
2235
|
t,
|
|
1954
2236
|
r,
|
|
1955
2237
|
i,
|
|
@@ -1959,15 +2241,15 @@ function ht(e, t) {
|
|
|
1959
2241
|
});
|
|
1960
2242
|
}
|
|
1961
2243
|
static get observedAttributes() {
|
|
1962
|
-
return t.props ? Object.keys(t.props).map(
|
|
2244
|
+
return t.props ? Object.keys(t.props).map(Q) : [];
|
|
1963
2245
|
}
|
|
1964
2246
|
_applyComputed(r) {
|
|
1965
2247
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1966
2248
|
r.computed && Object.entries(r.computed).forEach(([i, n]) => {
|
|
1967
2249
|
Object.defineProperty(this.context, i, {
|
|
1968
2250
|
get: () => {
|
|
1969
|
-
const
|
|
1970
|
-
return
|
|
2251
|
+
const s = n(this.context);
|
|
2252
|
+
return Z(s);
|
|
1971
2253
|
},
|
|
1972
2254
|
enumerable: !0
|
|
1973
2255
|
});
|
|
@@ -1977,7 +2259,7 @@ function ht(e, t) {
|
|
|
1977
2259
|
// --- Render ---
|
|
1978
2260
|
_render(r) {
|
|
1979
2261
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1980
|
-
|
|
2262
|
+
vt(
|
|
1981
2263
|
this.shadowRoot,
|
|
1982
2264
|
r,
|
|
1983
2265
|
this.context,
|
|
@@ -2000,27 +2282,29 @@ function ht(e, t) {
|
|
|
2000
2282
|
}
|
|
2001
2283
|
_requestRender() {
|
|
2002
2284
|
this._runLogicWithinErrorBoundary(this._cfg, () => {
|
|
2003
|
-
|
|
2004
|
-
(
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2285
|
+
oe(() => {
|
|
2286
|
+
kt(
|
|
2287
|
+
() => this._render(this._cfg),
|
|
2288
|
+
this._lastRenderTime,
|
|
2289
|
+
this._renderCount,
|
|
2290
|
+
(r) => {
|
|
2291
|
+
this._lastRenderTime = r;
|
|
2292
|
+
},
|
|
2293
|
+
(r) => {
|
|
2294
|
+
this._renderCount = r;
|
|
2295
|
+
},
|
|
2296
|
+
this._renderTimeoutId,
|
|
2297
|
+
(r) => {
|
|
2298
|
+
this._renderTimeoutId = r;
|
|
2299
|
+
}
|
|
2300
|
+
);
|
|
2301
|
+
}, this._componentId);
|
|
2018
2302
|
});
|
|
2019
2303
|
}
|
|
2020
2304
|
// --- Style ---
|
|
2021
2305
|
_applyStyle(r, i) {
|
|
2022
2306
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
2023
|
-
|
|
2307
|
+
_t(
|
|
2024
2308
|
this.shadowRoot,
|
|
2025
2309
|
r,
|
|
2026
2310
|
this.context,
|
|
@@ -2047,11 +2331,11 @@ function ht(e, t) {
|
|
|
2047
2331
|
// --- State, props, computed ---
|
|
2048
2332
|
_initContext(r) {
|
|
2049
2333
|
try {
|
|
2050
|
-
let i = function(
|
|
2051
|
-
return Array.isArray(
|
|
2052
|
-
get(a,
|
|
2053
|
-
const
|
|
2054
|
-
return typeof
|
|
2334
|
+
let i = function(s, o = "") {
|
|
2335
|
+
return Array.isArray(s) ? new Proxy(s, {
|
|
2336
|
+
get(a, c, u) {
|
|
2337
|
+
const m = Reflect.get(a, c, u);
|
|
2338
|
+
return typeof m == "function" && typeof c == "string" && [
|
|
2055
2339
|
"push",
|
|
2056
2340
|
"pop",
|
|
2057
2341
|
"shift",
|
|
@@ -2059,44 +2343,44 @@ function ht(e, t) {
|
|
|
2059
2343
|
"splice",
|
|
2060
2344
|
"sort",
|
|
2061
2345
|
"reverse"
|
|
2062
|
-
].includes(
|
|
2063
|
-
const
|
|
2346
|
+
].includes(c) ? function(...p) {
|
|
2347
|
+
const l = m.apply(a, p);
|
|
2064
2348
|
if (!n._initializing) {
|
|
2065
|
-
const w =
|
|
2066
|
-
n._triggerWatchers(w, a), n._render(r);
|
|
2349
|
+
const w = o || "root";
|
|
2350
|
+
n._triggerWatchers(w, a), oe(() => n._render(r), n._componentId);
|
|
2067
2351
|
}
|
|
2068
|
-
return
|
|
2069
|
-
} :
|
|
2352
|
+
return l;
|
|
2353
|
+
} : m;
|
|
2070
2354
|
},
|
|
2071
|
-
set(a,
|
|
2072
|
-
if (a[
|
|
2073
|
-
const
|
|
2074
|
-
n._triggerWatchers(
|
|
2355
|
+
set(a, c, u) {
|
|
2356
|
+
if (a[c] = u, !n._initializing) {
|
|
2357
|
+
const m = o ? `${o}.${String(c)}` : String(c);
|
|
2358
|
+
n._triggerWatchers(m, u), oe(() => n._render(r), n._componentId);
|
|
2075
2359
|
}
|
|
2076
2360
|
return !0;
|
|
2077
2361
|
},
|
|
2078
|
-
deleteProperty(a,
|
|
2079
|
-
if (delete a[
|
|
2080
|
-
const
|
|
2081
|
-
n._triggerWatchers(
|
|
2362
|
+
deleteProperty(a, c) {
|
|
2363
|
+
if (delete a[c], !n._initializing) {
|
|
2364
|
+
const u = o ? `${o}.${String(c)}` : String(c);
|
|
2365
|
+
n._triggerWatchers(u, void 0), oe(() => n._render(r), n._componentId);
|
|
2082
2366
|
}
|
|
2083
2367
|
return !0;
|
|
2084
2368
|
}
|
|
2085
|
-
}) :
|
|
2086
|
-
const
|
|
2087
|
-
|
|
2088
|
-
}), new Proxy(
|
|
2089
|
-
set(a,
|
|
2090
|
-
const
|
|
2091
|
-
return a[
|
|
2092
|
-
|
|
2093
|
-
a[
|
|
2094
|
-
), n._render(r)), !0;
|
|
2369
|
+
}) : s && typeof s == "object" ? (Object.keys(s).forEach((a) => {
|
|
2370
|
+
const c = o ? `${o}.${a}` : a;
|
|
2371
|
+
s[a] = i(s[a], c);
|
|
2372
|
+
}), new Proxy(s, {
|
|
2373
|
+
set(a, c, u) {
|
|
2374
|
+
const m = o ? `${o}.${String(c)}` : String(c);
|
|
2375
|
+
return a[c] = i(u, m), n._initializing || (n._triggerWatchers(
|
|
2376
|
+
m,
|
|
2377
|
+
a[c]
|
|
2378
|
+
), oe(() => n._render(r), n._componentId)), !0;
|
|
2095
2379
|
},
|
|
2096
|
-
get(a,
|
|
2097
|
-
return Reflect.get(a,
|
|
2380
|
+
get(a, c, u) {
|
|
2381
|
+
return Reflect.get(a, c, u);
|
|
2098
2382
|
}
|
|
2099
|
-
})) :
|
|
2383
|
+
})) : s;
|
|
2100
2384
|
};
|
|
2101
2385
|
const n = this;
|
|
2102
2386
|
return i({ ...r.state });
|
|
@@ -2106,7 +2390,7 @@ function ht(e, t) {
|
|
|
2106
2390
|
}
|
|
2107
2391
|
_initWatchers(r) {
|
|
2108
2392
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
2109
|
-
|
|
2393
|
+
Ge(
|
|
2110
2394
|
this.context,
|
|
2111
2395
|
this._watchers,
|
|
2112
2396
|
r.watch || {}
|
|
@@ -2114,12 +2398,12 @@ function ht(e, t) {
|
|
|
2114
2398
|
});
|
|
2115
2399
|
}
|
|
2116
2400
|
_triggerWatchers(r, i) {
|
|
2117
|
-
|
|
2401
|
+
Ze(this.context, this._watchers, r, i);
|
|
2118
2402
|
}
|
|
2119
2403
|
_applyProps(r) {
|
|
2120
2404
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
2121
2405
|
try {
|
|
2122
|
-
|
|
2406
|
+
Ye(this, r, this.context);
|
|
2123
2407
|
} catch (i) {
|
|
2124
2408
|
this._hasError = !0, r.onError && r.onError(i, this.context), r.errorFallback && this.shadowRoot && (this.shadowRoot.innerHTML = r.errorFallback(i, this.context));
|
|
2125
2409
|
}
|
|
@@ -2127,103 +2411,109 @@ function ht(e, t) {
|
|
|
2127
2411
|
}
|
|
2128
2412
|
};
|
|
2129
2413
|
}
|
|
2130
|
-
function
|
|
2414
|
+
function ae(e, t = {}, r, i) {
|
|
2131
2415
|
const n = i ?? t.key;
|
|
2132
2416
|
return { tag: e, key: n, props: t, children: r };
|
|
2133
2417
|
}
|
|
2134
|
-
function
|
|
2418
|
+
function ye(e) {
|
|
2135
2419
|
return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
|
|
2136
2420
|
}
|
|
2137
|
-
function
|
|
2138
|
-
return typeof e == "object" && e !== null && "tag" in e && !
|
|
2421
|
+
function de(e) {
|
|
2422
|
+
return typeof e == "object" && e !== null && "tag" in e && !ye(e);
|
|
2139
2423
|
}
|
|
2140
|
-
function
|
|
2424
|
+
function Ct(e, t) {
|
|
2141
2425
|
return e.key != null ? e : { ...e, key: t };
|
|
2142
2426
|
}
|
|
2143
|
-
function
|
|
2144
|
-
const i = {}, n = {},
|
|
2145
|
-
let
|
|
2146
|
-
for (;
|
|
2147
|
-
const
|
|
2148
|
-
let
|
|
2149
|
-
|
|
2427
|
+
function At(e, t = [], r = {}) {
|
|
2428
|
+
const i = {}, n = {}, s = {}, o = [], a = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
|
|
2429
|
+
let c;
|
|
2430
|
+
for (; c = a.exec(e); ) {
|
|
2431
|
+
const u = c[1], m = c[2], T = (c[4] || c[6]) ?? "", p = T.match(/^{{(\d+)}}$/);
|
|
2432
|
+
let l = p ? t[Number(p[1])] ?? null : T;
|
|
2433
|
+
p || (l === "true" ? l = !0 : l === "false" ? l = !1 : l === "null" ? l = null : isNaN(Number(l)) || (l = Number(l)));
|
|
2150
2434
|
const w = ["model", "bind", "show", "class", "style"];
|
|
2151
|
-
if (
|
|
2152
|
-
const [v, d] =
|
|
2435
|
+
if (u === ":") {
|
|
2436
|
+
const [v, d] = m.split(":"), [g, ...y] = v.split(".");
|
|
2153
2437
|
if (w.includes(g)) {
|
|
2154
|
-
const x = [...
|
|
2155
|
-
|
|
2156
|
-
value:
|
|
2438
|
+
const x = [...y], f = g === "model" && d ? `model:${d}` : g;
|
|
2439
|
+
s[f] = {
|
|
2440
|
+
value: l,
|
|
2157
2441
|
modifiers: x,
|
|
2158
2442
|
arg: d
|
|
2159
2443
|
};
|
|
2160
2444
|
} else
|
|
2161
|
-
n[
|
|
2162
|
-
} else if (
|
|
2163
|
-
const v =
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
}
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
}
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2445
|
+
n[m] = l, o.push(m);
|
|
2446
|
+
} else if (u === "@") {
|
|
2447
|
+
const [v, ...d] = m.split("."), g = d, y = typeof l == "function" ? l : typeof r[l] == "function" ? r[l] : void 0;
|
|
2448
|
+
if (y) {
|
|
2449
|
+
const x = (b) => {
|
|
2450
|
+
if (g.includes("prevent") && b.preventDefault(), g.includes("stop") && b.stopPropagation(), !(g.includes("self") && b.target !== b.currentTarget))
|
|
2451
|
+
return g.includes("once") && b.currentTarget?.removeEventListener(v, x), y(b);
|
|
2452
|
+
}, f = "on" + v.charAt(0).toUpperCase() + v.slice(1);
|
|
2453
|
+
i[f] = x;
|
|
2454
|
+
}
|
|
2455
|
+
} else m === "ref" ? i.ref = l : n[m] = l;
|
|
2456
|
+
}
|
|
2457
|
+
return { props: i, attrs: n, directives: s, bound: o };
|
|
2458
|
+
}
|
|
2459
|
+
function Tt(e, t, r) {
|
|
2460
|
+
const i = ce.length > 0 ? ce[ce.length - 1] : void 0, n = r ?? i;
|
|
2461
|
+
function s(f, b) {
|
|
2462
|
+
return ae("#text", {}, f, b);
|
|
2463
|
+
}
|
|
2464
|
+
let o = "";
|
|
2465
|
+
for (let f = 0; f < e.length; f++)
|
|
2466
|
+
o += e[f], f < t.length && (o += `{{${f}}}`);
|
|
2467
|
+
const a = /<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, c = [];
|
|
2468
|
+
let u, m = [], T = null, p = {}, l, w = 0, v = [];
|
|
2469
|
+
function d(f) {
|
|
2470
|
+
!f || typeof f != "object" || ye(f) || (f.props || f.attrs ? (f.props && (p.props || (p.props = {}), Object.assign(p.props, f.props)), f.attrs && (p.attrs || (p.attrs = {}), Object.keys(f.attrs).forEach((b) => {
|
|
2471
|
+
if (b === "style" && p.attrs.style) {
|
|
2472
|
+
const h = p.attrs.style.replace(
|
|
2183
2473
|
/;?\s*$/,
|
|
2184
2474
|
""
|
|
2185
|
-
), _ =
|
|
2186
|
-
|
|
2187
|
-
} else if (b === "class" &&
|
|
2188
|
-
const
|
|
2189
|
-
.../* @__PURE__ */ new Set([...
|
|
2475
|
+
), _ = f.attrs.style.replace(/^;?\s*/, "");
|
|
2476
|
+
p.attrs.style = h + "; " + _;
|
|
2477
|
+
} else if (b === "class" && p.attrs.class) {
|
|
2478
|
+
const h = p.attrs.class.trim().split(/\s+/).filter(Boolean), _ = f.attrs.class.trim().split(/\s+/).filter(Boolean), $ = [
|
|
2479
|
+
.../* @__PURE__ */ new Set([...h, ..._])
|
|
2190
2480
|
];
|
|
2191
|
-
|
|
2481
|
+
p.attrs.class = $.join(" ");
|
|
2192
2482
|
} else
|
|
2193
|
-
|
|
2194
|
-
}))) : (
|
|
2195
|
-
}
|
|
2196
|
-
function g(
|
|
2197
|
-
const
|
|
2198
|
-
if (
|
|
2199
|
-
const _ =
|
|
2200
|
-
let
|
|
2201
|
-
|
|
2202
|
-
...
|
|
2483
|
+
p.attrs[b] = f.attrs[b];
|
|
2484
|
+
}))) : (p.props || (p.props = {}), Object.assign(p.props, f)));
|
|
2485
|
+
}
|
|
2486
|
+
function g(f, b) {
|
|
2487
|
+
const h = T ? m : v;
|
|
2488
|
+
if (ye(f)) {
|
|
2489
|
+
const _ = f.key ?? b;
|
|
2490
|
+
let $ = f.children;
|
|
2491
|
+
h.push({
|
|
2492
|
+
...f,
|
|
2203
2493
|
key: _,
|
|
2204
|
-
children:
|
|
2494
|
+
children: $
|
|
2205
2495
|
});
|
|
2206
2496
|
return;
|
|
2207
2497
|
}
|
|
2208
|
-
if (
|
|
2209
|
-
|
|
2498
|
+
if (de(f)) {
|
|
2499
|
+
h.push(Ct(f, void 0));
|
|
2210
2500
|
return;
|
|
2211
2501
|
}
|
|
2212
|
-
if (Array.isArray(
|
|
2213
|
-
if (
|
|
2214
|
-
for (let _ = 0; _ <
|
|
2215
|
-
const
|
|
2216
|
-
|
|
2502
|
+
if (Array.isArray(f)) {
|
|
2503
|
+
if (f.length === 0) return;
|
|
2504
|
+
for (let _ = 0; _ < f.length; _++) {
|
|
2505
|
+
const $ = f[_];
|
|
2506
|
+
ye($) || de($) || Array.isArray($) ? g($, `${b}-${_}`) : $ !== null && typeof $ == "object" ? d($) : h.push(s(String($), `${b}-${_}`));
|
|
2217
2507
|
}
|
|
2218
2508
|
return;
|
|
2219
2509
|
}
|
|
2220
|
-
if (
|
|
2221
|
-
d(
|
|
2510
|
+
if (f !== null && typeof f == "object") {
|
|
2511
|
+
d(f);
|
|
2222
2512
|
return;
|
|
2223
2513
|
}
|
|
2224
|
-
|
|
2514
|
+
h.push(s(String(f), b));
|
|
2225
2515
|
}
|
|
2226
|
-
const
|
|
2516
|
+
const y = /* @__PURE__ */ new Set([
|
|
2227
2517
|
"area",
|
|
2228
2518
|
"base",
|
|
2229
2519
|
"br",
|
|
@@ -2239,226 +2529,228 @@ function yt(e, t, r) {
|
|
|
2239
2529
|
"track",
|
|
2240
2530
|
"wbr"
|
|
2241
2531
|
]);
|
|
2242
|
-
for (;
|
|
2243
|
-
if (
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
const T = {
|
|
2259
|
-
input: ["value", "checked", "disabled", "readonly", "required", "placeholder", "maxlength", "minlength"],
|
|
2260
|
-
textarea: ["value", "disabled", "readonly", "required", "placeholder", "maxlength", "minlength"],
|
|
2261
|
-
select: ["value", "disabled", "required", "multiple"],
|
|
2262
|
-
option: ["selected", "disabled", "value"],
|
|
2263
|
-
video: ["muted", "autoplay", "controls", "loop", "playsinline"],
|
|
2264
|
-
audio: ["muted", "autoplay", "controls", "loop"],
|
|
2265
|
-
img: ["src", "alt", "width", "height"],
|
|
2266
|
-
button: ["type", "name", "value", "disabled", "autofocus", "form"]
|
|
2267
|
-
}, B = l.toLowerCase(), G = T[B] ?? [];
|
|
2268
|
-
if ($.attrs)
|
|
2269
|
-
for (const M of G)
|
|
2270
|
-
A && A.includes(M) && M in $.attrs && !($.props && M in $.props) && ($.props[M] = $.attrs[M], delete $.attrs[M]);
|
|
2271
|
-
if ((l.includes("-") || !!n?.__customElements?.has?.(l)) && A && $.attrs) {
|
|
2272
|
-
const M = /* @__PURE__ */ new Set(["id", "name", "data-key", "key"]);
|
|
2273
|
-
for (const U of A)
|
|
2274
|
-
if (U in $.attrs && !($.props && U in $.props)) {
|
|
2275
|
-
const q = U.includes("-") ? U.split("-").map((I, z) => z === 0 ? I : I.charAt(0).toUpperCase() + I.slice(1)).join("") : U;
|
|
2276
|
-
$.props[q] = $.attrs[U], M.has(U) || delete $.attrs[U];
|
|
2277
|
-
}
|
|
2278
|
-
$.isCustomElement = !0;
|
|
2279
|
-
}
|
|
2280
|
-
} catch {
|
|
2281
|
-
}
|
|
2282
|
-
if (S && Object.keys(S).some((T) => T === "model" || T.startsWith("model:")))
|
|
2532
|
+
for (; u = a.exec(o); )
|
|
2533
|
+
if (!(u[0].startsWith("<!--") && u[0].endsWith("-->"))) {
|
|
2534
|
+
if (u[1]) {
|
|
2535
|
+
const f = u[1], b = u[0][1] === "/", h = u[0][u[0].length - 2] === "/" || y.has(f), {
|
|
2536
|
+
props: _,
|
|
2537
|
+
attrs: $,
|
|
2538
|
+
directives: S,
|
|
2539
|
+
bound: E
|
|
2540
|
+
} = At(u[2] || "", t, n), C = { props: {}, attrs: {} };
|
|
2541
|
+
for (const A in _) C.props[A] = _[A];
|
|
2542
|
+
for (const A in $) C.attrs[A] = $[A];
|
|
2543
|
+
if (C.attrs && Object.prototype.hasOwnProperty.call(C.attrs, "key") && !(C.props && Object.prototype.hasOwnProperty.call(C.props, "key")))
|
|
2544
|
+
try {
|
|
2545
|
+
C.props.key = C.attrs.key;
|
|
2546
|
+
} catch {
|
|
2547
|
+
}
|
|
2283
2548
|
try {
|
|
2284
|
-
const
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2549
|
+
const A = {
|
|
2550
|
+
input: ["value", "checked", "disabled", "readonly", "required", "placeholder", "maxlength", "minlength"],
|
|
2551
|
+
textarea: ["value", "disabled", "readonly", "required", "placeholder", "maxlength", "minlength"],
|
|
2552
|
+
select: ["value", "disabled", "required", "multiple"],
|
|
2553
|
+
option: ["selected", "disabled", "value"],
|
|
2554
|
+
video: ["muted", "autoplay", "controls", "loop", "playsinline"],
|
|
2555
|
+
audio: ["muted", "autoplay", "controls", "loop"],
|
|
2556
|
+
img: ["src", "alt", "width", "height"],
|
|
2557
|
+
button: ["type", "name", "value", "disabled", "autofocus", "form"]
|
|
2558
|
+
}, P = f.toLowerCase(), X = A[P] ?? [];
|
|
2559
|
+
if (C.attrs)
|
|
2560
|
+
for (const M of X)
|
|
2561
|
+
E && E.includes(M) && M in C.attrs && !(C.props && M in C.props) && (C.props[M] = C.attrs[M], delete C.attrs[M]);
|
|
2562
|
+
if ((f.includes("-") || !!n?.__customElements?.has?.(f)) && E && C.attrs) {
|
|
2563
|
+
const M = /* @__PURE__ */ new Set(["id", "name", "data-key", "key"]);
|
|
2564
|
+
for (const F of E)
|
|
2565
|
+
if (F in C.attrs && !(C.props && F in C.props)) {
|
|
2566
|
+
const H = F.includes("-") ? F.split("-").map((N, I) => I === 0 ? N : N.charAt(0).toUpperCase() + N.slice(1)).join("") : F;
|
|
2567
|
+
C.props[H] = C.attrs[F], M.has(F) || delete C.attrs[F];
|
|
2295
2568
|
}
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
$.props[j] = function(L) {
|
|
2299
|
-
const se = L.detail !== void 0 ? L.detail : L.target ? L.target.value : void 0;
|
|
2300
|
-
if (!P) return;
|
|
2301
|
-
const he = te(P, typeof H == "string" ? H : String(H));
|
|
2302
|
-
(Array.isArray(se) && Array.isArray(he) ? JSON.stringify([...se].sort()) !== JSON.stringify([...he].sort()) : se !== he) && (k(P, typeof H == "string" ? H : String(H), se), n?.requestRender ? n.requestRender() : n?._requestRender && n._requestRender());
|
|
2303
|
-
}, delete S[q];
|
|
2304
|
-
}
|
|
2569
|
+
C.isCustomElement = !0;
|
|
2570
|
+
}
|
|
2305
2571
|
} catch {
|
|
2306
2572
|
}
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
}
|
|
2333
|
-
const
|
|
2334
|
-
|
|
2573
|
+
if (S && Object.keys(S).some((A) => A === "model" || A.startsWith("model:")))
|
|
2574
|
+
try {
|
|
2575
|
+
const A = Symbol.for("cer.registry"), P = globalThis[A], X = !!(P && typeof P.has == "function" && P.has(f)), ie = !!(n && (n.__customElements instanceof Set && n.__customElements.has(f) || Array.isArray(n.__isCustomElements) && n.__isCustomElements.includes(f)));
|
|
2576
|
+
if (!!(f.includes("-") || ie || X))
|
|
2577
|
+
for (const H of Object.keys(S)) {
|
|
2578
|
+
if (H !== "model" && !H.startsWith("model:")) continue;
|
|
2579
|
+
const N = S[H], I = N.arg ?? (H.includes(":") ? H.split(":", 2)[1] : void 0), z = N.value, J = I ?? "modelValue", se = K, k = he, W = n ? n._state || n : void 0;
|
|
2580
|
+
let R;
|
|
2581
|
+
typeof z == "string" && n ? R = se(W, z) : R = z, C.props[J] = R;
|
|
2582
|
+
try {
|
|
2583
|
+
const L = Q(J);
|
|
2584
|
+
C.attrs || (C.attrs = {}), R !== void 0 && (C.attrs[L] = R);
|
|
2585
|
+
} catch {
|
|
2586
|
+
}
|
|
2587
|
+
C.isCustomElement = !0;
|
|
2588
|
+
const B = `update:${Q(J)}`, j = "on" + B.charAt(0).toUpperCase() + B.slice(1);
|
|
2589
|
+
C.props[j] = function(L) {
|
|
2590
|
+
const fe = L.detail !== void 0 ? L.detail : L.target ? L.target.value : void 0;
|
|
2591
|
+
if (!W) return;
|
|
2592
|
+
const ve = se(W, typeof z == "string" ? z : String(z));
|
|
2593
|
+
(Array.isArray(fe) && Array.isArray(ve) ? JSON.stringify([...fe].sort()) !== JSON.stringify([...ve].sort()) : fe !== ve) && (k(W, typeof z == "string" ? z : String(z), fe), n?.requestRender ? n.requestRender() : n?._requestRender && n._requestRender());
|
|
2594
|
+
}, delete S[H];
|
|
2595
|
+
}
|
|
2596
|
+
} catch {
|
|
2597
|
+
}
|
|
2598
|
+
if (Object.keys(S).length > 0 && (C.directives = { ...S }), b) {
|
|
2599
|
+
const A = ae(
|
|
2600
|
+
T,
|
|
2601
|
+
p,
|
|
2602
|
+
m.length === 1 && de(m[0]) && m[0].tag === "#text" ? typeof m[0].children == "string" ? m[0].children : "" : m.length ? m : void 0,
|
|
2603
|
+
l
|
|
2604
|
+
), P = c.pop();
|
|
2605
|
+
P ? (T = P.tag, p = P.props, l = P.key, m = P.children, m.push(A)) : (v.push(A), T = null, p = {}, l = void 0, m = []);
|
|
2606
|
+
} else h ? T ? m.push(ae(f, C, void 0, void 0)) : v.push(ae(f, C, void 0, void 0)) : (T && c.push({
|
|
2607
|
+
tag: T,
|
|
2608
|
+
props: p,
|
|
2609
|
+
children: m,
|
|
2610
|
+
key: l
|
|
2611
|
+
}), T = f, p = C, m = []);
|
|
2612
|
+
} else if (typeof u[3] < "u") {
|
|
2613
|
+
const f = Number(u[3]), b = t[f], h = `interp-${f}`;
|
|
2614
|
+
g(b, h);
|
|
2615
|
+
} else if (u[4]) {
|
|
2616
|
+
const f = u[4], b = T ? m : v, h = f.split(/({{\d+}})/);
|
|
2617
|
+
for (const _ of h) {
|
|
2618
|
+
if (!_) continue;
|
|
2619
|
+
const $ = _.match(/^{{(\d+)}}$/);
|
|
2620
|
+
if ($) {
|
|
2621
|
+
const S = Number($[1]), E = t[S], C = `interp-${S}`;
|
|
2622
|
+
g(E, C);
|
|
2623
|
+
} else {
|
|
2624
|
+
const S = `text-${w++}`;
|
|
2625
|
+
b.push(s(_, S));
|
|
2626
|
+
}
|
|
2335
2627
|
}
|
|
2336
2628
|
}
|
|
2337
2629
|
}
|
|
2338
|
-
const x = v.filter((
|
|
2339
|
-
return x.length === 1 ? x[0] : x.length > 1 ? x :
|
|
2630
|
+
const x = v.filter((f) => de(f) && f.tag === "#text" ? typeof f.children == "string" && f.children.trim() !== "" : !0);
|
|
2631
|
+
return x.length === 1 ? x[0] : x.length > 1 ? x : ae("div", {}, "", "fallback-root");
|
|
2340
2632
|
}
|
|
2341
|
-
function
|
|
2633
|
+
function ee(e, ...t) {
|
|
2342
2634
|
const r = t[t.length - 1], i = typeof r == "object" && r && !Array.isArray(r) ? r : void 0;
|
|
2343
|
-
return
|
|
2635
|
+
return Tt(e, t, i);
|
|
2344
2636
|
}
|
|
2345
|
-
const
|
|
2637
|
+
const qe = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, V = (e, t) => {
|
|
2346
2638
|
for (const r of e) {
|
|
2347
|
-
const i = [], n = r.path.replace(/:[^/]+/g, (a) => (i.push(a.slice(1)), "([^/]+)")),
|
|
2348
|
-
if (
|
|
2639
|
+
const i = [], n = r.path.replace(/:[^/]+/g, (a) => (i.push(a.slice(1)), "([^/]+)")), s = new RegExp(`^${n}$`), o = t.match(s);
|
|
2640
|
+
if (o) {
|
|
2349
2641
|
const a = {};
|
|
2350
|
-
return i.forEach((
|
|
2351
|
-
a[
|
|
2642
|
+
return i.forEach((c, u) => {
|
|
2643
|
+
a[c] = o[u + 1];
|
|
2352
2644
|
}), { route: r, params: a };
|
|
2353
2645
|
}
|
|
2354
2646
|
}
|
|
2355
2647
|
return { route: null, params: {} };
|
|
2356
|
-
},
|
|
2357
|
-
async function
|
|
2648
|
+
}, Te = {};
|
|
2649
|
+
async function jt(e) {
|
|
2358
2650
|
if (e.component) return e.component;
|
|
2359
2651
|
if (e.load) {
|
|
2360
|
-
if (
|
|
2652
|
+
if (Te[e.path]) return Te[e.path];
|
|
2361
2653
|
try {
|
|
2362
2654
|
const t = await e.load();
|
|
2363
|
-
return
|
|
2655
|
+
return Te[e.path] = t.default, t.default;
|
|
2364
2656
|
} catch {
|
|
2365
2657
|
throw new Error(`Failed to load component for route: ${e.path}`);
|
|
2366
2658
|
}
|
|
2367
2659
|
}
|
|
2368
2660
|
throw new Error(`No component or loader defined for route: ${e.path}`);
|
|
2369
2661
|
}
|
|
2370
|
-
function
|
|
2662
|
+
function Lt(e) {
|
|
2371
2663
|
const { routes: t, base: r = "", initialUrl: i } = e;
|
|
2372
|
-
let n,
|
|
2373
|
-
const
|
|
2374
|
-
const g = t.find((
|
|
2664
|
+
let n, s, o, a, c, u, m;
|
|
2665
|
+
const T = async (v, d) => {
|
|
2666
|
+
const g = t.find((y) => V([y], v.path).route !== null);
|
|
2375
2667
|
if (g?.beforeEnter)
|
|
2376
2668
|
try {
|
|
2377
|
-
const
|
|
2378
|
-
return typeof
|
|
2379
|
-
} catch (
|
|
2380
|
-
return
|
|
2669
|
+
const y = await g.beforeEnter(v, d);
|
|
2670
|
+
return typeof y == "string" ? (await w(y, !0), !1) : y !== !1;
|
|
2671
|
+
} catch (y) {
|
|
2672
|
+
return Y("beforeEnter error", y), !1;
|
|
2381
2673
|
}
|
|
2382
2674
|
return !0;
|
|
2383
|
-
},
|
|
2384
|
-
const g = t.find((
|
|
2675
|
+
}, p = async (v, d) => {
|
|
2676
|
+
const g = t.find((y) => V([y], v.path).route !== null);
|
|
2385
2677
|
if (g?.onEnter)
|
|
2386
2678
|
try {
|
|
2387
|
-
const
|
|
2388
|
-
return typeof
|
|
2389
|
-
} catch (
|
|
2390
|
-
return
|
|
2679
|
+
const y = await g.onEnter(v, d);
|
|
2680
|
+
return typeof y == "string" ? (await w(y, !0), !1) : y !== !1;
|
|
2681
|
+
} catch (y) {
|
|
2682
|
+
return Y("onEnter error", y), !1;
|
|
2391
2683
|
}
|
|
2392
2684
|
return !0;
|
|
2393
|
-
},
|
|
2394
|
-
const g = t.find((
|
|
2685
|
+
}, l = (v, d) => {
|
|
2686
|
+
const g = t.find((y) => V([y], v.path).route !== null);
|
|
2395
2687
|
if (g?.afterEnter)
|
|
2396
2688
|
try {
|
|
2397
2689
|
g.afterEnter(v, d);
|
|
2398
|
-
} catch (
|
|
2399
|
-
|
|
2690
|
+
} catch (y) {
|
|
2691
|
+
Y("afterEnter error", y);
|
|
2400
2692
|
}
|
|
2401
2693
|
}, w = async (v, d = !1) => {
|
|
2402
2694
|
try {
|
|
2403
2695
|
const g = {
|
|
2404
2696
|
path: v.replace(r, "") || "/",
|
|
2405
2697
|
query: {}
|
|
2406
|
-
},
|
|
2407
|
-
if (!
|
|
2408
|
-
const x =
|
|
2698
|
+
}, y = V(t, g.path);
|
|
2699
|
+
if (!y) throw new Error(`No route found for ${g.path}`);
|
|
2700
|
+
const x = o.getState(), f = {
|
|
2409
2701
|
path: g.path,
|
|
2410
|
-
params:
|
|
2702
|
+
params: y.params,
|
|
2411
2703
|
query: g.query
|
|
2412
2704
|
};
|
|
2413
|
-
if (!await
|
|
2414
|
-
typeof window < "u" && typeof document < "u" && (d ? window.history.replaceState({}, "", r + v) : window.history.pushState({}, "", r + v)),
|
|
2705
|
+
if (!await T(f, x) || !await p(f, x)) return;
|
|
2706
|
+
typeof window < "u" && typeof document < "u" && (d ? window.history.replaceState({}, "", r + v) : window.history.pushState({}, "", r + v)), o.setState(f), l(f, x);
|
|
2415
2707
|
} catch (g) {
|
|
2416
|
-
|
|
2708
|
+
Y("Navigation error:", g);
|
|
2417
2709
|
}
|
|
2418
2710
|
};
|
|
2419
2711
|
if (typeof window < "u" && typeof document < "u") {
|
|
2420
2712
|
n = () => {
|
|
2421
|
-
const d = new URL(window.location.href), g = d.pathname.replace(r, "") || "/",
|
|
2422
|
-
return { path: g, query:
|
|
2423
|
-
},
|
|
2424
|
-
const v =
|
|
2425
|
-
|
|
2426
|
-
path:
|
|
2713
|
+
const d = new URL(window.location.href), g = d.pathname.replace(r, "") || "/", y = qe(d.search);
|
|
2714
|
+
return { path: g, query: y };
|
|
2715
|
+
}, s = n();
|
|
2716
|
+
const v = V(t, s.path);
|
|
2717
|
+
o = Le({
|
|
2718
|
+
path: s.path,
|
|
2427
2719
|
params: v.params,
|
|
2428
|
-
query:
|
|
2720
|
+
query: s.query
|
|
2429
2721
|
}), a = async (d = !1) => {
|
|
2430
2722
|
const g = n();
|
|
2431
2723
|
await w(g.path, d);
|
|
2432
|
-
}, window.addEventListener("popstate", () => a(!0)),
|
|
2724
|
+
}, window.addEventListener("popstate", () => a(!0)), c = (d) => w(d, !1), u = (d) => w(d, !0), m = () => window.history.back();
|
|
2433
2725
|
} else {
|
|
2434
2726
|
n = () => {
|
|
2435
|
-
const g = new URL(i || "/", "http://localhost"),
|
|
2436
|
-
return { path:
|
|
2437
|
-
},
|
|
2438
|
-
const v =
|
|
2439
|
-
|
|
2440
|
-
path:
|
|
2727
|
+
const g = new URL(i || "/", "http://localhost"), y = g.pathname.replace(r, "") || "/", x = qe(g.search);
|
|
2728
|
+
return { path: y, query: x };
|
|
2729
|
+
}, s = n();
|
|
2730
|
+
const v = V(t, s.path);
|
|
2731
|
+
o = Le({
|
|
2732
|
+
path: s.path,
|
|
2441
2733
|
params: v.params,
|
|
2442
|
-
query:
|
|
2734
|
+
query: s.query
|
|
2443
2735
|
}), a = async () => {
|
|
2444
2736
|
const g = n();
|
|
2445
2737
|
await d(g.path);
|
|
2446
2738
|
};
|
|
2447
2739
|
const d = async (g) => {
|
|
2448
2740
|
try {
|
|
2449
|
-
const
|
|
2741
|
+
const y = {
|
|
2450
2742
|
path: g.replace(r, "") || "/",
|
|
2451
2743
|
query: {}
|
|
2452
|
-
}, x =
|
|
2453
|
-
if (!x) throw new Error(`No route found for ${
|
|
2454
|
-
const
|
|
2455
|
-
path:
|
|
2744
|
+
}, x = V(t, y.path);
|
|
2745
|
+
if (!x) throw new Error(`No route found for ${y.path}`);
|
|
2746
|
+
const f = o.getState(), b = {
|
|
2747
|
+
path: y.path,
|
|
2456
2748
|
params: x.params,
|
|
2457
|
-
query:
|
|
2458
|
-
},
|
|
2459
|
-
if (
|
|
2749
|
+
query: y.query
|
|
2750
|
+
}, h = t.find((_) => V([_], b.path).route !== null);
|
|
2751
|
+
if (h?.beforeEnter)
|
|
2460
2752
|
try {
|
|
2461
|
-
const _ = await
|
|
2753
|
+
const _ = await h.beforeEnter(b, f);
|
|
2462
2754
|
if (typeof _ == "string") {
|
|
2463
2755
|
await d(_);
|
|
2464
2756
|
return;
|
|
@@ -2467,9 +2759,9 @@ function wt(e) {
|
|
|
2467
2759
|
} catch {
|
|
2468
2760
|
return;
|
|
2469
2761
|
}
|
|
2470
|
-
if (
|
|
2762
|
+
if (h?.onEnter)
|
|
2471
2763
|
try {
|
|
2472
|
-
const _ = await
|
|
2764
|
+
const _ = await h.onEnter(b, f);
|
|
2473
2765
|
if (typeof _ == "string") {
|
|
2474
2766
|
await d(_);
|
|
2475
2767
|
return;
|
|
@@ -2478,49 +2770,49 @@ function wt(e) {
|
|
|
2478
2770
|
} catch {
|
|
2479
2771
|
return;
|
|
2480
2772
|
}
|
|
2481
|
-
if (
|
|
2773
|
+
if (o.setState(b), h?.afterEnter)
|
|
2482
2774
|
try {
|
|
2483
|
-
|
|
2775
|
+
h.afterEnter(b, f);
|
|
2484
2776
|
} catch {
|
|
2485
2777
|
}
|
|
2486
2778
|
} catch {
|
|
2487
2779
|
}
|
|
2488
2780
|
};
|
|
2489
|
-
|
|
2781
|
+
c = async (g) => d(g), u = async (g) => d(g), m = () => {
|
|
2490
2782
|
};
|
|
2491
2783
|
}
|
|
2492
2784
|
return {
|
|
2493
|
-
store:
|
|
2494
|
-
push:
|
|
2495
|
-
replace:
|
|
2496
|
-
back:
|
|
2497
|
-
subscribe:
|
|
2498
|
-
matchRoute: (v) =>
|
|
2499
|
-
getCurrent: () =>
|
|
2500
|
-
resolveRouteComponent:
|
|
2785
|
+
store: o,
|
|
2786
|
+
push: c,
|
|
2787
|
+
replace: u,
|
|
2788
|
+
back: m,
|
|
2789
|
+
subscribe: o.subscribe,
|
|
2790
|
+
matchRoute: (v) => V(t, v),
|
|
2791
|
+
getCurrent: () => o.getState(),
|
|
2792
|
+
resolveRouteComponent: jt
|
|
2501
2793
|
};
|
|
2502
2794
|
}
|
|
2503
|
-
function
|
|
2504
|
-
return
|
|
2795
|
+
function Zt(e, t) {
|
|
2796
|
+
return V(e, t);
|
|
2505
2797
|
}
|
|
2506
|
-
function
|
|
2507
|
-
const t =
|
|
2508
|
-
return
|
|
2798
|
+
function Yt(e) {
|
|
2799
|
+
const t = Lt(e);
|
|
2800
|
+
return Ie("router-view", {
|
|
2509
2801
|
async render() {
|
|
2510
|
-
if (!t) return
|
|
2802
|
+
if (!t) return ee`<div>Router not initialized.</div>`;
|
|
2511
2803
|
const r = t.getCurrent(), { path: i } = r, n = t.matchRoute(i);
|
|
2512
|
-
if (!n.route) return
|
|
2804
|
+
if (!n.route) return ee`<div>Not found</div>`;
|
|
2513
2805
|
try {
|
|
2514
|
-
const
|
|
2515
|
-
if (typeof
|
|
2516
|
-
return { tag:
|
|
2517
|
-
if (typeof
|
|
2518
|
-
const
|
|
2806
|
+
const s = await t.resolveRouteComponent(n.route);
|
|
2807
|
+
if (typeof s == "string")
|
|
2808
|
+
return { tag: s, props: {}, children: [] };
|
|
2809
|
+
if (typeof s == "function") {
|
|
2810
|
+
const o = s(), a = o instanceof Promise ? await o : o;
|
|
2519
2811
|
return typeof a == "string" ? { tag: a, props: {}, children: [] } : a;
|
|
2520
2812
|
}
|
|
2521
|
-
return
|
|
2813
|
+
return ee`<div>Invalid route component</div>`;
|
|
2522
2814
|
} catch {
|
|
2523
|
-
return
|
|
2815
|
+
return ee`<div>Invalid route component</div>`;
|
|
2524
2816
|
}
|
|
2525
2817
|
},
|
|
2526
2818
|
onConnected(r) {
|
|
@@ -2528,7 +2820,7 @@ function Tt(e) {
|
|
|
2528
2820
|
typeof r.requestRender == "function" && r.requestRender();
|
|
2529
2821
|
});
|
|
2530
2822
|
}
|
|
2531
|
-
}),
|
|
2823
|
+
}), Ie("router-link", {
|
|
2532
2824
|
state: {},
|
|
2533
2825
|
props: {
|
|
2534
2826
|
to: { type: String, default: "" },
|
|
@@ -2541,7 +2833,7 @@ function Tt(e) {
|
|
|
2541
2833
|
disabled: { type: Boolean, default: !1 },
|
|
2542
2834
|
external: { type: Boolean, default: !1 },
|
|
2543
2835
|
class: { type: String, default: "" },
|
|
2544
|
-
style: { type: String, default:
|
|
2836
|
+
style: { type: String, default: Ue`
|
|
2545
2837
|
[aria-disabled="true"] {
|
|
2546
2838
|
pointer-events: none;
|
|
2547
2839
|
opacity: 0.5;
|
|
@@ -2550,32 +2842,32 @@ function Tt(e) {
|
|
|
2550
2842
|
},
|
|
2551
2843
|
style: (r) => r.style,
|
|
2552
2844
|
render: (r) => {
|
|
2553
|
-
const i = t.getCurrent(), n = r.to,
|
|
2845
|
+
const i = t.getCurrent(), n = r.to, s = r.exact, o = r.exactActiveClass, a = r.activeClass, c = r.ariaCurrentValue, u = r.tag, m = r.disabled, T = r.external, p = i.path === n, l = s ? p : i && typeof i.path == "string" ? i.path.startsWith(n) : !1, w = p ? `aria-current="${c}"` : "", v = (r.class || "").split(/\s+/).filter(Boolean), d = {};
|
|
2554
2846
|
for (const b of v) d[b] = !0;
|
|
2555
2847
|
const g = {
|
|
2556
2848
|
...d,
|
|
2557
2849
|
// Also include the configurable names (may duplicate the above)
|
|
2558
|
-
[a]:
|
|
2559
|
-
[
|
|
2560
|
-
},
|
|
2561
|
-
return
|
|
2562
|
-
${
|
|
2850
|
+
[a]: l,
|
|
2851
|
+
[o]: p
|
|
2852
|
+
}, y = u === "button", x = m ? y ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", f = T && (u === "a" || !u) ? 'target="_blank" rel="noopener noreferrer"' : "";
|
|
2853
|
+
return ee`
|
|
2854
|
+
${Ke().when(y, ee`
|
|
2563
2855
|
<button
|
|
2564
2856
|
part="button"
|
|
2565
2857
|
:class="${g}"
|
|
2566
2858
|
${w}
|
|
2567
2859
|
${x}
|
|
2568
|
-
${
|
|
2860
|
+
${f}
|
|
2569
2861
|
@click="navigate"
|
|
2570
2862
|
><slot></slot></button>
|
|
2571
|
-
`).otherwise(
|
|
2863
|
+
`).otherwise(ee`
|
|
2572
2864
|
<a
|
|
2573
2865
|
part="link"
|
|
2574
2866
|
href="${n}"
|
|
2575
2867
|
:class="${g}"
|
|
2576
2868
|
${w}
|
|
2577
2869
|
${x}
|
|
2578
|
-
${
|
|
2870
|
+
${f}
|
|
2579
2871
|
@click="navigate"
|
|
2580
2872
|
><slot></slot></a>
|
|
2581
2873
|
`).done()}
|
|
@@ -2591,26 +2883,42 @@ function Tt(e) {
|
|
|
2591
2883
|
}), t;
|
|
2592
2884
|
}
|
|
2593
2885
|
export {
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2886
|
+
ne as GlobalEventBus,
|
|
2887
|
+
O as anchorBlock,
|
|
2888
|
+
Ie as component,
|
|
2889
|
+
Le as createStore,
|
|
2890
|
+
Ue as css,
|
|
2891
|
+
Ot as each,
|
|
2892
|
+
qt as eachGroup,
|
|
2893
|
+
zt as eachPage,
|
|
2894
|
+
Wt as eachWhere,
|
|
2895
|
+
Ft as emit,
|
|
2896
|
+
le as eventBus,
|
|
2897
|
+
ee as html,
|
|
2898
|
+
Yt as initRouter,
|
|
2899
|
+
Gt as listen,
|
|
2900
|
+
Ke as match,
|
|
2901
|
+
V as matchRoute,
|
|
2902
|
+
Zt as matchRouteSSR,
|
|
2903
|
+
G as mediaVariants,
|
|
2904
|
+
Jt as off,
|
|
2905
|
+
Kt as on,
|
|
2906
|
+
Vt as once,
|
|
2907
|
+
qe as parseQuery,
|
|
2908
|
+
ke as renderToString,
|
|
2909
|
+
jt as resolveRouteComponent,
|
|
2910
|
+
Ve as responsive,
|
|
2911
|
+
ze as responsiveOrder,
|
|
2912
|
+
Dt as responsiveSwitch,
|
|
2913
|
+
Ut as switchOn,
|
|
2914
|
+
It as switchOnLength,
|
|
2915
|
+
Ht as switchOnPromise,
|
|
2916
|
+
Pt as unless,
|
|
2917
|
+
Lt as useRouter,
|
|
2918
|
+
we as when,
|
|
2919
|
+
Mt as whenEmpty,
|
|
2920
|
+
q as whenMedia,
|
|
2921
|
+
Bt as whenNotEmpty,
|
|
2922
|
+
Nt as whenVariants
|
|
2615
2923
|
};
|
|
2616
2924
|
//# sourceMappingURL=custom-elements-runtime.es.js.map
|