@jasonshimmy/custom-elements-runtime 0.2.6 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-elements-runtime.cjs.js +12 -12
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +991 -824
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +12 -12
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/dist/runtime/template-compiler.d.ts +5 -3
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
function
|
|
2
|
-
return
|
|
1
|
+
function vt(e, t) {
|
|
2
|
+
return pe(e ? t : [], "when-block");
|
|
3
3
|
}
|
|
4
4
|
function kt(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 pe(t(r, i), `each-${n}`);
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function ze() {
|
|
11
11
|
const e = [];
|
|
12
12
|
return {
|
|
13
13
|
when(t, r) {
|
|
@@ -17,18 +17,18 @@ function Pe() {
|
|
|
17
17
|
return e.push([!0, t]), this;
|
|
18
18
|
},
|
|
19
19
|
done() {
|
|
20
|
-
return
|
|
20
|
+
return He(...e);
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function He(...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 [pe(i, `whenChain-branch-${t}`)];
|
|
28
28
|
}
|
|
29
|
-
return [
|
|
29
|
+
return [pe([], "whenChain-empty")];
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function pe(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,7 @@ function fe(e, t) {
|
|
|
36
36
|
children: r
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
class
|
|
39
|
+
class X extends EventTarget {
|
|
40
40
|
handlers = {};
|
|
41
41
|
static instance;
|
|
42
42
|
eventCounters = /* @__PURE__ */ new Map();
|
|
@@ -44,7 +44,7 @@ class G extends EventTarget {
|
|
|
44
44
|
* Returns the singleton instance of GlobalEventBus
|
|
45
45
|
*/
|
|
46
46
|
static getInstance() {
|
|
47
|
-
return
|
|
47
|
+
return X.instance || (X.instance = new X()), X.instance;
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
50
|
* Emit a global event with optional data. Includes event storm protection.
|
|
@@ -63,10 +63,10 @@ class G extends EventTarget {
|
|
|
63
63
|
// Global events don't need to bubble
|
|
64
64
|
cancelable: !0
|
|
65
65
|
}));
|
|
66
|
-
const
|
|
67
|
-
|
|
66
|
+
const o = this.handlers[t];
|
|
67
|
+
o && o.forEach((s) => {
|
|
68
68
|
try {
|
|
69
|
-
|
|
69
|
+
s(r);
|
|
70
70
|
} catch (a) {
|
|
71
71
|
console.error(`Error in global event handler for "${t}":`, a);
|
|
72
72
|
}
|
|
@@ -112,8 +112,8 @@ class G extends EventTarget {
|
|
|
112
112
|
*/
|
|
113
113
|
once(t, r) {
|
|
114
114
|
return new Promise((i) => {
|
|
115
|
-
const n = this.on(t, (
|
|
116
|
-
n(), r(
|
|
115
|
+
const n = this.on(t, (o) => {
|
|
116
|
+
n(), r(o), i(o);
|
|
117
117
|
});
|
|
118
118
|
});
|
|
119
119
|
}
|
|
@@ -157,7 +157,7 @@ class G extends EventTarget {
|
|
|
157
157
|
this.eventCounters.clear();
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
const
|
|
160
|
+
const ie = X.getInstance(), _t = (e, t) => ie.emit(e, t), $t = (e, t) => ie.on(e, t), St = (e, t) => ie.off(e, t), Et = (e, t) => ie.once(e, t), Ct = (e, t, r) => ie.listen(e, t, r);
|
|
161
161
|
function $e(e) {
|
|
162
162
|
let t = { ...e };
|
|
163
163
|
const r = [];
|
|
@@ -167,19 +167,19 @@ function $e(e) {
|
|
|
167
167
|
function n() {
|
|
168
168
|
return t;
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function o(a) {
|
|
171
171
|
const f = typeof a == "function" ? a(t) : a;
|
|
172
|
-
t = { ...t, ...f },
|
|
172
|
+
t = { ...t, ...f }, s();
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function s() {
|
|
175
175
|
r.forEach((a) => a(t));
|
|
176
176
|
}
|
|
177
|
-
return { subscribe: i, getState: n, setState:
|
|
177
|
+
return { subscribe: i, getState: n, setState: o };
|
|
178
178
|
}
|
|
179
|
-
function
|
|
179
|
+
function Y(e) {
|
|
180
180
|
return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function J(e) {
|
|
183
183
|
return typeof e == "string" ? e.replace(
|
|
184
184
|
/[&<>"']/g,
|
|
185
185
|
(t) => ({
|
|
@@ -191,77 +191,83 @@ function H(e) {
|
|
|
191
191
|
})[t]
|
|
192
192
|
) : e;
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function W(e, t) {
|
|
195
195
|
return typeof t == "string" ? t.split(".").reduce((r, i) => r?.[i], e) : t;
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function ce(e, t, r) {
|
|
198
198
|
const i = String(t).split("."), n = i.pop();
|
|
199
199
|
if (!n) return;
|
|
200
|
-
const
|
|
201
|
-
|
|
200
|
+
const o = i.reduce((s, a) => (s[a] == null && (s[a] = {}), s[a]), e);
|
|
201
|
+
o[n] = r;
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function qe(e, t, r) {
|
|
204
204
|
if (r)
|
|
205
205
|
for (const [i, n] of Object.entries(r)) {
|
|
206
|
-
let
|
|
207
|
-
if (Array.isArray(n) ? (
|
|
208
|
-
callback:
|
|
209
|
-
options:
|
|
210
|
-
oldValue:
|
|
211
|
-
}),
|
|
206
|
+
let o, s = {};
|
|
207
|
+
if (Array.isArray(n) ? (o = n[0], s = n[1] || {}) : o = n, t.set(i, {
|
|
208
|
+
callback: o,
|
|
209
|
+
options: s,
|
|
210
|
+
oldValue: W(e, i)
|
|
211
|
+
}), s.immediate)
|
|
212
212
|
try {
|
|
213
|
-
const a =
|
|
214
|
-
|
|
213
|
+
const a = W(e, i);
|
|
214
|
+
o(a, void 0, e);
|
|
215
215
|
} catch (a) {
|
|
216
216
|
console.error(`Error in immediate watcher for "${i}":`, a);
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
const n = (
|
|
222
|
-
if (
|
|
223
|
-
if (typeof
|
|
224
|
-
if (Array.isArray(
|
|
225
|
-
return
|
|
226
|
-
const f = Object.keys(
|
|
227
|
-
return f.length !==
|
|
228
|
-
},
|
|
229
|
-
if (
|
|
220
|
+
function Ie(e, t, r, i) {
|
|
221
|
+
const n = (s, a) => {
|
|
222
|
+
if (s === a) return !0;
|
|
223
|
+
if (typeof s != typeof a || typeof s != "object" || s === null || a === null) return !1;
|
|
224
|
+
if (Array.isArray(s) && Array.isArray(a))
|
|
225
|
+
return s.length !== a.length ? !1 : s.every((h, C) => n(h, a[C]));
|
|
226
|
+
const f = Object.keys(s), p = Object.keys(a);
|
|
227
|
+
return f.length !== p.length ? !1 : f.every((h) => n(s[h], a[h]));
|
|
228
|
+
}, o = t.get(r);
|
|
229
|
+
if (o && !n(i, o.oldValue))
|
|
230
230
|
try {
|
|
231
|
-
|
|
232
|
-
} catch (
|
|
233
|
-
console.error(`Error in watcher for "${r}":`,
|
|
231
|
+
o.callback(i, o.oldValue, e), o.oldValue = i;
|
|
232
|
+
} catch (s) {
|
|
233
|
+
console.error(`Error in watcher for "${r}":`, s);
|
|
234
234
|
}
|
|
235
|
-
for (const [
|
|
236
|
-
if (a.options.deep && r.startsWith(
|
|
235
|
+
for (const [s, a] of t.entries())
|
|
236
|
+
if (a.options.deep && r.startsWith(s + "."))
|
|
237
237
|
try {
|
|
238
|
-
const f =
|
|
238
|
+
const f = W(e, s);
|
|
239
239
|
n(f, a.oldValue) || (a.callback(f, a.oldValue, e), a.oldValue = f);
|
|
240
240
|
} catch (f) {
|
|
241
|
-
console.error(`Error in deep watcher for "${
|
|
241
|
+
console.error(`Error in deep watcher for "${s}":`, f);
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function Ne(e, t, r) {
|
|
245
245
|
if (!t.props) return;
|
|
246
|
-
function i(n,
|
|
247
|
-
return
|
|
246
|
+
function i(n, o) {
|
|
247
|
+
return o === Boolean ? n === "true" : o === Number ? Number(n) : n;
|
|
248
248
|
}
|
|
249
|
-
Object.entries(t.props).forEach(([n,
|
|
250
|
-
if (
|
|
249
|
+
Object.entries(t.props).forEach(([n, o]) => {
|
|
250
|
+
if (o.type === Function && typeof e[n] == "function")
|
|
251
251
|
r[n] = e[n];
|
|
252
252
|
else {
|
|
253
|
-
const
|
|
254
|
-
|
|
253
|
+
const s = Y(n), a = e.getAttribute(s);
|
|
254
|
+
if (typeof e[n] < "u")
|
|
255
|
+
try {
|
|
256
|
+
r[n] = J(i(e[n], o.type));
|
|
257
|
+
} catch {
|
|
258
|
+
r[n] = e[n];
|
|
259
|
+
}
|
|
260
|
+
else a !== null ? r[n] = J(i(a, o.type)) : "default" in o && o.default !== void 0 && (r[n] = J(o.default));
|
|
255
261
|
}
|
|
256
262
|
});
|
|
257
263
|
}
|
|
258
|
-
function
|
|
264
|
+
function We(e, t, r, i) {
|
|
259
265
|
e.onConnected && !r && (e.onConnected(t), i(!0));
|
|
260
266
|
}
|
|
261
|
-
function De(e, t, r, i, n,
|
|
262
|
-
e.onDisconnected && e.onDisconnected(t), r.forEach((f) => f()), i(), n(),
|
|
267
|
+
function De(e, t, r, i, n, o, s, a) {
|
|
268
|
+
e.onDisconnected && e.onDisconnected(t), r.forEach((f) => f()), i(), n(), o(!1), s(null), a(!1);
|
|
263
269
|
}
|
|
264
|
-
function
|
|
270
|
+
function Ue(e, t, r, i, n) {
|
|
265
271
|
e.onAttributeChanged && e.onAttributeChanged(t, r, i, n);
|
|
266
272
|
}
|
|
267
273
|
function V(e, t) {
|
|
@@ -272,94 +278,94 @@ function V(e, t) {
|
|
|
272
278
|
V(r, t);
|
|
273
279
|
}
|
|
274
280
|
}
|
|
275
|
-
function
|
|
276
|
-
if (!
|
|
277
|
-
const f = t.includes("lazy"),
|
|
278
|
-
let
|
|
279
|
-
|
|
280
|
-
const
|
|
281
|
-
if (
|
|
282
|
-
if (Array.isArray(
|
|
283
|
-
r[
|
|
281
|
+
function Fe(e, t, r, i, n, o, s, a) {
|
|
282
|
+
if (!o) return;
|
|
283
|
+
const f = t.includes("lazy"), p = t.includes("trim"), h = t.includes("number"), C = () => W(o._state || o, e), u = C();
|
|
284
|
+
let c = "text";
|
|
285
|
+
s instanceof HTMLInputElement ? c = i?.type || s.type || "text" : s instanceof HTMLSelectElement ? c = "select" : s instanceof HTMLTextAreaElement && (c = "textarea");
|
|
286
|
+
const w = s instanceof HTMLInputElement || s instanceof HTMLTextAreaElement || s instanceof HTMLSelectElement, d = w ? c === "checkbox" || c === "radio" ? "checked" : "value" : a ?? "modelValue";
|
|
287
|
+
if (c === "checkbox")
|
|
288
|
+
if (Array.isArray(u))
|
|
289
|
+
r[d] = u.includes(String(s?.getAttribute("value") ?? i?.value ?? ""));
|
|
284
290
|
else {
|
|
285
|
-
const x =
|
|
286
|
-
r[
|
|
291
|
+
const x = s?.getAttribute("true-value") ?? !0;
|
|
292
|
+
r[d] = u === x;
|
|
287
293
|
}
|
|
288
|
-
else if (
|
|
289
|
-
r[
|
|
290
|
-
else if (
|
|
291
|
-
if (
|
|
292
|
-
const x = Array.isArray(
|
|
294
|
+
else if (c === "radio")
|
|
295
|
+
r[d] = u === (i?.value ?? "");
|
|
296
|
+
else if (c === "select")
|
|
297
|
+
if (s && s.hasAttribute("multiple") && s instanceof HTMLSelectElement) {
|
|
298
|
+
const x = Array.isArray(u) ? u.map(String) : [];
|
|
293
299
|
setTimeout(() => {
|
|
294
|
-
Array.from(
|
|
300
|
+
Array.from(s.options).forEach((l) => {
|
|
295
301
|
l.selected = x.includes(l.value);
|
|
296
302
|
});
|
|
297
|
-
}, 0), r[
|
|
303
|
+
}, 0), r[d] = Array.isArray(u) ? u : [];
|
|
298
304
|
} else
|
|
299
|
-
r[
|
|
305
|
+
r[d] = u;
|
|
300
306
|
else {
|
|
301
|
-
r[
|
|
307
|
+
r[d] = u;
|
|
302
308
|
try {
|
|
303
|
-
const x =
|
|
304
|
-
i && (i[x] =
|
|
309
|
+
const x = Y(d);
|
|
310
|
+
i && (i[x] = u);
|
|
305
311
|
} catch {
|
|
306
312
|
}
|
|
307
313
|
}
|
|
308
|
-
const
|
|
314
|
+
const g = f || c === "checkbox" || c === "radio" || c === "select" ? "change" : "input", m = (x) => {
|
|
309
315
|
if (x.isComposing || n._isComposing || x.isTrusted === !1) return;
|
|
310
316
|
const l = x.target;
|
|
311
317
|
if (!l || l._modelUpdating) return;
|
|
312
|
-
let
|
|
313
|
-
if (
|
|
314
|
-
const
|
|
315
|
-
if (Array.isArray(
|
|
316
|
-
const
|
|
318
|
+
let b = l.value;
|
|
319
|
+
if (c === "checkbox") {
|
|
320
|
+
const S = C();
|
|
321
|
+
if (Array.isArray(S)) {
|
|
322
|
+
const A = l.getAttribute("value") ?? "", $ = Array.from(S);
|
|
317
323
|
if (l.checked)
|
|
318
|
-
|
|
324
|
+
$.includes(A) || $.push(A);
|
|
319
325
|
else {
|
|
320
|
-
const
|
|
321
|
-
|
|
326
|
+
const T = $.indexOf(A);
|
|
327
|
+
T > -1 && $.splice(T, 1);
|
|
322
328
|
}
|
|
323
|
-
|
|
329
|
+
b = $;
|
|
324
330
|
} else {
|
|
325
|
-
const
|
|
326
|
-
|
|
331
|
+
const A = l.getAttribute("true-value") ?? !0, $ = l.getAttribute("false-value") ?? !1;
|
|
332
|
+
b = l.checked ? A : $;
|
|
327
333
|
}
|
|
328
|
-
} else if (
|
|
329
|
-
|
|
330
|
-
else if (
|
|
331
|
-
|
|
332
|
-
else if (
|
|
333
|
-
const
|
|
334
|
-
isNaN(
|
|
334
|
+
} else if (c === "radio")
|
|
335
|
+
b = l.getAttribute("value") ?? l.value;
|
|
336
|
+
else if (c === "select" && l.multiple)
|
|
337
|
+
b = Array.from(l.selectedOptions).map((S) => S.value);
|
|
338
|
+
else if (p && typeof b == "string" && (b = b.trim()), h) {
|
|
339
|
+
const S = Number(b);
|
|
340
|
+
isNaN(S) || (b = S);
|
|
335
341
|
}
|
|
336
|
-
const
|
|
337
|
-
if (Array.isArray(
|
|
342
|
+
const y = o._state || o, _ = W(y, e);
|
|
343
|
+
if (Array.isArray(b) && Array.isArray(_) ? JSON.stringify([...b].sort()) !== JSON.stringify([..._].sort()) : b !== _) {
|
|
338
344
|
l._modelUpdating = !0;
|
|
339
345
|
try {
|
|
340
|
-
|
|
346
|
+
ce(y, e, b), o._requestRender && o._requestRender();
|
|
341
347
|
} finally {
|
|
342
348
|
setTimeout(() => l._modelUpdating = !1, 0);
|
|
343
349
|
}
|
|
344
350
|
}
|
|
345
351
|
};
|
|
346
|
-
|
|
347
|
-
const l =
|
|
348
|
-
(Array.isArray(
|
|
349
|
-
}, (
|
|
352
|
+
w ? n[g] = m : n[`update:${Y(d)}`] = (x) => {
|
|
353
|
+
const l = o._state || o, b = x.detail !== void 0 ? x.detail : x.target?.value, y = W(l, e);
|
|
354
|
+
(Array.isArray(b) && Array.isArray(y) ? JSON.stringify([...b].sort()) !== JSON.stringify([...y].sort()) : b !== y) && (ce(l, e, b), o._requestRender && o._requestRender());
|
|
355
|
+
}, (c === "text" || c === "textarea") && (n.compositionstart = (() => n._isComposing = !0), n.compositionend = (x) => {
|
|
350
356
|
n._isComposing = !1;
|
|
351
357
|
const l = x.target;
|
|
352
358
|
l && setTimeout(() => {
|
|
353
|
-
const
|
|
354
|
-
let
|
|
355
|
-
if (
|
|
356
|
-
const
|
|
357
|
-
isNaN(
|
|
359
|
+
const b = l.value, y = o._state || o, _ = W(y, e);
|
|
360
|
+
let E = b;
|
|
361
|
+
if (p && (E = E.trim()), h) {
|
|
362
|
+
const A = Number(E);
|
|
363
|
+
isNaN(A) || (E = A);
|
|
358
364
|
}
|
|
359
|
-
if (Array.isArray(
|
|
365
|
+
if (Array.isArray(E) && Array.isArray(_) ? JSON.stringify([...E].sort()) !== JSON.stringify([..._].sort()) : E !== _) {
|
|
360
366
|
l._modelUpdating = !0;
|
|
361
367
|
try {
|
|
362
|
-
|
|
368
|
+
ce(y, e, E), o._requestRender && o._requestRender();
|
|
363
369
|
} finally {
|
|
364
370
|
setTimeout(() => l._modelUpdating = !1, 0);
|
|
365
371
|
}
|
|
@@ -367,66 +373,66 @@ function He(e, t, r, i, n, s, o, a) {
|
|
|
367
373
|
}, 0);
|
|
368
374
|
});
|
|
369
375
|
}
|
|
370
|
-
function
|
|
376
|
+
function Me(e) {
|
|
371
377
|
const t = e.slice(2);
|
|
372
378
|
return t ? t.charAt(0).toLowerCase() + t.slice(1) : "";
|
|
373
379
|
}
|
|
374
|
-
function
|
|
380
|
+
function Ke(e, t, r, i) {
|
|
375
381
|
if (i) {
|
|
376
382
|
if (typeof e == "object" && e !== null)
|
|
377
|
-
for (const [n,
|
|
378
|
-
t[n] =
|
|
383
|
+
for (const [n, o] of Object.entries(e))
|
|
384
|
+
t[n] = o;
|
|
379
385
|
else if (typeof e == "string")
|
|
380
386
|
try {
|
|
381
387
|
const n = JSON.parse(e);
|
|
382
388
|
if (typeof n == "object" && n !== null) {
|
|
383
|
-
for (const [
|
|
384
|
-
t[
|
|
389
|
+
for (const [o, s] of Object.entries(n))
|
|
390
|
+
t[o] = s;
|
|
385
391
|
return;
|
|
386
392
|
}
|
|
387
393
|
} catch {
|
|
388
|
-
const n =
|
|
394
|
+
const n = W(i, e);
|
|
389
395
|
r[e] = n;
|
|
390
396
|
}
|
|
391
397
|
}
|
|
392
398
|
}
|
|
393
|
-
function
|
|
399
|
+
function Je(e, t, r) {
|
|
394
400
|
if (!r) return;
|
|
395
|
-
const i =
|
|
401
|
+
const i = W(r, e), n = t.style || "", o = i ? "" : "none";
|
|
396
402
|
if (n) {
|
|
397
|
-
const
|
|
403
|
+
const s = n.split(";").filter(Boolean), a = s.findIndex(
|
|
398
404
|
(f) => f.trim().startsWith("display:")
|
|
399
405
|
);
|
|
400
|
-
a >= 0 ?
|
|
406
|
+
a >= 0 ? s[a] = `display: ${o}` : s.push(`display: ${o}`), t.style = s.join("; ");
|
|
401
407
|
} else
|
|
402
|
-
t.style = `display: ${
|
|
408
|
+
t.style = `display: ${o}`;
|
|
403
409
|
}
|
|
404
|
-
function
|
|
410
|
+
function Ge(e, t, r) {
|
|
405
411
|
if (!r) return;
|
|
406
|
-
const i =
|
|
412
|
+
const i = W(r, e);
|
|
407
413
|
let n = [];
|
|
408
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)));
|
|
409
|
-
const
|
|
410
|
-
|
|
415
|
+
const o = t.class || "", s = o ? `${o} ${n.join(" ")}`.trim() : n.join(" ");
|
|
416
|
+
s && (t.class = s);
|
|
411
417
|
}
|
|
412
|
-
function
|
|
418
|
+
function Ze(e, t, r) {
|
|
413
419
|
let i;
|
|
414
420
|
if (typeof e == "string") {
|
|
415
421
|
if (!r) return;
|
|
416
|
-
i =
|
|
422
|
+
i = W(r, e);
|
|
417
423
|
} else
|
|
418
424
|
i = e;
|
|
419
425
|
let n = "";
|
|
420
426
|
if (typeof i == "string")
|
|
421
427
|
n = i;
|
|
422
428
|
else if (i && typeof i == "object") {
|
|
423
|
-
const
|
|
429
|
+
const s = [];
|
|
424
430
|
for (const [a, f] of Object.entries(i))
|
|
425
431
|
if (f != null && f !== "") {
|
|
426
|
-
const
|
|
432
|
+
const p = a.replace(
|
|
427
433
|
/[A-Z]/g,
|
|
428
|
-
(
|
|
429
|
-
),
|
|
434
|
+
(u) => `-${u.toLowerCase()}`
|
|
435
|
+
), h = [
|
|
430
436
|
"width",
|
|
431
437
|
"height",
|
|
432
438
|
"top",
|
|
@@ -452,175 +458,287 @@ function Ve(e, t, r) {
|
|
|
452
458
|
"min-height",
|
|
453
459
|
"max-height"
|
|
454
460
|
];
|
|
455
|
-
let
|
|
456
|
-
typeof f == "number" &&
|
|
461
|
+
let C = String(f);
|
|
462
|
+
typeof f == "number" && h.includes(p) && (C = `${f}px`), s.push(`${p}: ${C}`);
|
|
457
463
|
}
|
|
458
|
-
n =
|
|
464
|
+
n = s.join("; ") + (s.length > 0 ? ";" : "");
|
|
459
465
|
}
|
|
460
|
-
const
|
|
461
|
-
t.style =
|
|
466
|
+
const o = t.style || "";
|
|
467
|
+
t.style = o + (o && !o.endsWith(";") ? "; " : "") + n;
|
|
462
468
|
}
|
|
463
|
-
function
|
|
464
|
-
const n = {},
|
|
469
|
+
function Oe(e, t, r, i) {
|
|
470
|
+
const n = {}, o = { ...i || {} }, s = {};
|
|
465
471
|
for (const [a, f] of Object.entries(e)) {
|
|
466
|
-
const { value:
|
|
472
|
+
const { value: p, modifiers: h, arg: C } = f;
|
|
467
473
|
if (a === "model" || a.startsWith("model:")) {
|
|
468
|
-
const
|
|
469
|
-
|
|
470
|
-
typeof
|
|
471
|
-
|
|
474
|
+
const u = a.split(":"), c = u.length > 1 ? u[1] : C;
|
|
475
|
+
Fe(
|
|
476
|
+
typeof p == "string" ? p : String(p),
|
|
477
|
+
h,
|
|
472
478
|
n,
|
|
473
|
-
s,
|
|
474
479
|
o,
|
|
480
|
+
s,
|
|
475
481
|
t,
|
|
476
482
|
r,
|
|
477
|
-
|
|
483
|
+
c
|
|
478
484
|
);
|
|
479
485
|
continue;
|
|
480
486
|
}
|
|
481
487
|
switch (a) {
|
|
482
488
|
case "bind":
|
|
483
|
-
|
|
489
|
+
Ke(p, n, o, t);
|
|
484
490
|
break;
|
|
485
491
|
case "show":
|
|
486
|
-
|
|
492
|
+
Je(p, o, t);
|
|
487
493
|
break;
|
|
488
494
|
case "class":
|
|
489
|
-
|
|
495
|
+
Ge(p, o, t);
|
|
490
496
|
break;
|
|
491
497
|
case "style":
|
|
492
|
-
|
|
498
|
+
Ze(p, o, t);
|
|
493
499
|
break;
|
|
494
500
|
}
|
|
495
501
|
}
|
|
496
|
-
return { props: n, attrs:
|
|
502
|
+
return { props: n, attrs: o, listeners: s };
|
|
497
503
|
}
|
|
498
|
-
function
|
|
504
|
+
function _e(e, t) {
|
|
499
505
|
if (Array.isArray(e)) {
|
|
500
|
-
const
|
|
501
|
-
return e.map((
|
|
502
|
-
if (!
|
|
503
|
-
let a =
|
|
506
|
+
const o = /* @__PURE__ */ new Set();
|
|
507
|
+
return e.map((s) => {
|
|
508
|
+
if (!s || typeof s != "object") return s;
|
|
509
|
+
let a = s.props?.key ?? s.key;
|
|
504
510
|
if (!a) {
|
|
505
|
-
const
|
|
506
|
-
|
|
511
|
+
const C = s.tag || "node", c = [
|
|
512
|
+
// attrs (kebab-case)
|
|
513
|
+
s.props?.attrs?.id,
|
|
514
|
+
s.props?.attrs?.name,
|
|
515
|
+
s.props?.attrs?.["data-key"],
|
|
516
|
+
// promoted JS props (camelCase or original)
|
|
517
|
+
s.props?.props?.id,
|
|
518
|
+
s.props?.props?.name,
|
|
519
|
+
s.props?.props?.dataKey,
|
|
520
|
+
s.props?.props?.["data-key"]
|
|
521
|
+
].find((w) => w != null) ?? "";
|
|
522
|
+
a = c ? `${t}:${C}:${c}` : `${t}:${C}`;
|
|
507
523
|
}
|
|
508
|
-
let f = a,
|
|
509
|
-
for (;
|
|
510
|
-
f = `${a}#${
|
|
511
|
-
|
|
512
|
-
let
|
|
513
|
-
return Array.isArray(
|
|
524
|
+
let f = a, p = 1;
|
|
525
|
+
for (; o.has(f); )
|
|
526
|
+
f = `${a}#${p++}`;
|
|
527
|
+
o.add(f);
|
|
528
|
+
let h = s.children;
|
|
529
|
+
return Array.isArray(h) && (h = _e(h, f)), { ...s, key: f, children: h };
|
|
514
530
|
});
|
|
515
531
|
}
|
|
516
532
|
const r = e;
|
|
517
533
|
let i = r.props?.key ?? r.key ?? t, n = r.children;
|
|
518
|
-
return Array.isArray(n) && (n =
|
|
534
|
+
return Array.isArray(n) && (n = _e(n, i)), { ...r, key: i, children: n };
|
|
519
535
|
}
|
|
520
|
-
function
|
|
521
|
-
const n = r.directives ?? {},
|
|
536
|
+
function Se(e, t, r, i) {
|
|
537
|
+
const n = r.directives ?? {}, o = Oe(
|
|
522
538
|
n,
|
|
523
539
|
i,
|
|
524
540
|
e,
|
|
525
541
|
r.attrs
|
|
526
|
-
),
|
|
542
|
+
), s = {
|
|
527
543
|
...t.props,
|
|
528
544
|
...r.props,
|
|
529
|
-
...
|
|
545
|
+
...o.props
|
|
530
546
|
}, a = {
|
|
531
547
|
...t.attrs,
|
|
532
548
|
...r.attrs,
|
|
533
|
-
...
|
|
534
|
-
}, f = t.props ?? {},
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
549
|
+
...o.attrs
|
|
550
|
+
}, f = t.props ?? {}, p = s, h = r?.isCustomElement ?? t?.isCustomElement ?? !1;
|
|
551
|
+
let C = !1;
|
|
552
|
+
for (const w in { ...f, ...p }) {
|
|
553
|
+
const v = f[w], d = p[w];
|
|
554
|
+
if (v !== d) {
|
|
555
|
+
if (C = !0, w === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement))
|
|
556
|
+
e.value !== d && (e.value = d ?? "");
|
|
557
|
+
else if (w === "checked" && e instanceof HTMLInputElement)
|
|
558
|
+
e.checked = !!d;
|
|
559
|
+
else if (w.startsWith("on") && typeof d == "function") {
|
|
560
|
+
const g = Me(w);
|
|
561
|
+
typeof v == "function" && e.removeEventListener(g, v), e.addEventListener(g, d);
|
|
562
|
+
} else if (d == null || d === !1)
|
|
563
|
+
e.removeAttribute(w);
|
|
564
|
+
else if ((r?.isCustomElement ?? t?.isCustomElement ?? !1) || w in e)
|
|
548
565
|
try {
|
|
549
|
-
e[
|
|
566
|
+
e[w] = d;
|
|
550
567
|
} catch {
|
|
551
568
|
}
|
|
552
569
|
}
|
|
553
570
|
}
|
|
554
|
-
for (const [
|
|
555
|
-
|
|
571
|
+
for (const [w, v] of Object.entries(
|
|
572
|
+
o.listeners || {}
|
|
556
573
|
))
|
|
557
|
-
e.addEventListener(
|
|
558
|
-
const
|
|
559
|
-
for (const
|
|
560
|
-
const
|
|
561
|
-
|
|
574
|
+
e.addEventListener(w, v);
|
|
575
|
+
const u = t.attrs ?? {}, c = a;
|
|
576
|
+
for (const w in { ...u, ...c }) {
|
|
577
|
+
const v = u[w], d = c[w];
|
|
578
|
+
if (v !== d)
|
|
579
|
+
if (C = !0, d == null || d === !1) {
|
|
580
|
+
if (e.removeAttribute(w), w === "value") {
|
|
581
|
+
if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement)
|
|
582
|
+
try {
|
|
583
|
+
e.value = "";
|
|
584
|
+
} catch {
|
|
585
|
+
}
|
|
586
|
+
else if (e instanceof HTMLSelectElement)
|
|
587
|
+
try {
|
|
588
|
+
e.value = "";
|
|
589
|
+
} catch {
|
|
590
|
+
}
|
|
591
|
+
else if (e instanceof HTMLProgressElement)
|
|
592
|
+
try {
|
|
593
|
+
e.value = 0;
|
|
594
|
+
} catch {
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
if (w === "checked" && e instanceof HTMLInputElement)
|
|
598
|
+
try {
|
|
599
|
+
e.checked = !1;
|
|
600
|
+
} catch {
|
|
601
|
+
}
|
|
602
|
+
if (w === "disabled")
|
|
603
|
+
try {
|
|
604
|
+
e.disabled = !1;
|
|
605
|
+
} catch {
|
|
606
|
+
}
|
|
607
|
+
} else {
|
|
608
|
+
if (w === "value") {
|
|
609
|
+
if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement) {
|
|
610
|
+
try {
|
|
611
|
+
e.value = d ?? "";
|
|
612
|
+
} catch {
|
|
613
|
+
e.setAttribute(w, String(d));
|
|
614
|
+
}
|
|
615
|
+
continue;
|
|
616
|
+
} else if (e instanceof HTMLSelectElement) {
|
|
617
|
+
try {
|
|
618
|
+
e.value = d ?? "";
|
|
619
|
+
} catch {
|
|
620
|
+
}
|
|
621
|
+
continue;
|
|
622
|
+
} else if (e instanceof HTMLProgressElement) {
|
|
623
|
+
try {
|
|
624
|
+
e.value = Number(d);
|
|
625
|
+
} catch {
|
|
626
|
+
}
|
|
627
|
+
continue;
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
if (w === "checked" && e instanceof HTMLInputElement) {
|
|
631
|
+
try {
|
|
632
|
+
e.checked = !!d;
|
|
633
|
+
} catch {
|
|
634
|
+
}
|
|
635
|
+
continue;
|
|
636
|
+
}
|
|
637
|
+
if (!(e.namespaceURI === "http://www.w3.org/2000/svg") && w in e)
|
|
638
|
+
try {
|
|
639
|
+
e[w] = d;
|
|
640
|
+
} catch {
|
|
641
|
+
e.setAttribute(w, String(d));
|
|
642
|
+
}
|
|
643
|
+
else
|
|
644
|
+
e.setAttribute(w, String(d));
|
|
645
|
+
}
|
|
562
646
|
}
|
|
647
|
+
if (h && C)
|
|
648
|
+
try {
|
|
649
|
+
if (typeof e._applyProps == "function")
|
|
650
|
+
try {
|
|
651
|
+
e._applyProps(e._cfg);
|
|
652
|
+
} catch {
|
|
653
|
+
}
|
|
654
|
+
typeof e.requestRender == "function" ? e.requestRender() : typeof e._render == "function" && e._render(e._cfg);
|
|
655
|
+
} catch {
|
|
656
|
+
}
|
|
563
657
|
}
|
|
564
|
-
function
|
|
658
|
+
function D(e, t, r) {
|
|
565
659
|
if (typeof e == "string")
|
|
566
660
|
return document.createTextNode(e);
|
|
567
661
|
if (e.tag === "#text") {
|
|
568
|
-
const
|
|
662
|
+
const u = document.createTextNode(
|
|
569
663
|
typeof e.children == "string" ? e.children : ""
|
|
570
664
|
);
|
|
571
|
-
return e.key != null && (
|
|
665
|
+
return e.key != null && (u.key = e.key), u;
|
|
572
666
|
}
|
|
573
667
|
if (e.tag === "#anchor") {
|
|
574
|
-
const
|
|
575
|
-
|
|
576
|
-
const
|
|
577
|
-
|
|
578
|
-
for (const
|
|
579
|
-
const
|
|
580
|
-
|
|
668
|
+
const u = e, c = Array.isArray(u.children) ? u.children : [], w = document.createTextNode(""), v = document.createTextNode("");
|
|
669
|
+
u.key != null && (w.key = `${u.key}:start`, v.key = `${u.key}:end`), u._startNode = w, u._endNode = v;
|
|
670
|
+
const d = document.createDocumentFragment();
|
|
671
|
+
d.appendChild(w);
|
|
672
|
+
for (const g of c) {
|
|
673
|
+
const m = D(g, t);
|
|
674
|
+
d.appendChild(m);
|
|
581
675
|
}
|
|
582
|
-
return
|
|
676
|
+
return d.appendChild(v), d;
|
|
583
677
|
}
|
|
584
678
|
const i = document.createElement(e.tag);
|
|
585
679
|
e.key != null && (i.key = e.key);
|
|
586
|
-
const { props: n = {}, attrs:
|
|
680
|
+
const { props: n = {}, attrs: o = {}, directives: s = {} } = e.props ?? {}, a = Oe(s, t, i, o), f = {
|
|
587
681
|
...n,
|
|
588
682
|
...a.props
|
|
589
|
-
},
|
|
590
|
-
...
|
|
683
|
+
}, p = {
|
|
684
|
+
...o,
|
|
591
685
|
...a.attrs
|
|
592
|
-
};
|
|
593
|
-
for (const
|
|
594
|
-
const c = u
|
|
595
|
-
typeof
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
686
|
+
}, h = i.namespaceURI === "http://www.w3.org/2000/svg";
|
|
687
|
+
for (const u in p) {
|
|
688
|
+
const c = p[u];
|
|
689
|
+
if (!(typeof u != "string" || /\[object Object\]/.test(u))) {
|
|
690
|
+
if (typeof c == "boolean")
|
|
691
|
+
c && i.setAttribute(u, "");
|
|
692
|
+
else if (c != null)
|
|
693
|
+
if (!h && u === "value" && (i instanceof HTMLInputElement || i instanceof HTMLTextAreaElement || i instanceof HTMLSelectElement || i instanceof HTMLProgressElement))
|
|
694
|
+
try {
|
|
695
|
+
i instanceof HTMLProgressElement ? i.value = Number(c) : i.value = c ?? "";
|
|
696
|
+
} catch {
|
|
697
|
+
i.setAttribute(u, String(c));
|
|
698
|
+
}
|
|
699
|
+
else if (!h && u === "checked" && i instanceof HTMLInputElement)
|
|
700
|
+
try {
|
|
701
|
+
i.checked = !!c;
|
|
702
|
+
} catch {
|
|
703
|
+
i.setAttribute(u, String(c));
|
|
704
|
+
}
|
|
705
|
+
else if (!h && u in i)
|
|
706
|
+
try {
|
|
707
|
+
i[u] = c;
|
|
708
|
+
} catch {
|
|
709
|
+
i.setAttribute(u, String(c));
|
|
710
|
+
}
|
|
711
|
+
else
|
|
712
|
+
i.setAttribute(u, String(c));
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
for (const u in f) {
|
|
716
|
+
const c = f[u];
|
|
717
|
+
if (!(typeof u != "string" || /\[object Object\]/.test(u)))
|
|
718
|
+
if (u === "value" && (i instanceof HTMLInputElement || i instanceof HTMLTextAreaElement || i instanceof HTMLSelectElement))
|
|
601
719
|
i.value = c ?? "";
|
|
602
|
-
else if (
|
|
720
|
+
else if (u === "checked" && i instanceof HTMLInputElement)
|
|
603
721
|
i.checked = !!c;
|
|
604
|
-
else if (
|
|
605
|
-
i.addEventListener(
|
|
722
|
+
else if (u.startsWith("on") && typeof c == "function")
|
|
723
|
+
i.addEventListener(Me(u), c);
|
|
606
724
|
else {
|
|
607
|
-
if (
|
|
725
|
+
if (u.startsWith("on") && c === void 0)
|
|
608
726
|
continue;
|
|
609
727
|
if (c == null || c === !1)
|
|
610
|
-
i.removeAttribute(
|
|
611
|
-
else if ((e.props?.isCustomElement ?? !1) ||
|
|
728
|
+
i.removeAttribute(u);
|
|
729
|
+
else if ((e.props?.isCustomElement ?? !1) || u in i)
|
|
612
730
|
try {
|
|
613
|
-
i[
|
|
731
|
+
i[u] = c;
|
|
614
732
|
} catch {
|
|
615
733
|
}
|
|
616
734
|
}
|
|
617
735
|
}
|
|
618
|
-
for (const [
|
|
736
|
+
for (const [u, c] of Object.entries(
|
|
619
737
|
a.listeners || {}
|
|
620
738
|
))
|
|
621
|
-
i.addEventListener(
|
|
622
|
-
const
|
|
623
|
-
typeof e != "string" &&
|
|
739
|
+
i.addEventListener(u, c);
|
|
740
|
+
const C = e.props?.ref ?? (e.props?.props && e.props.props.ref);
|
|
741
|
+
typeof e != "string" && C && r && (r[C] = i);
|
|
624
742
|
try {
|
|
625
743
|
if (typeof i._applyProps == "function")
|
|
626
744
|
try {
|
|
@@ -631,163 +749,177 @@ function M(e, t, r) {
|
|
|
631
749
|
} catch {
|
|
632
750
|
}
|
|
633
751
|
if (Array.isArray(e.children))
|
|
634
|
-
for (const
|
|
635
|
-
i.appendChild(
|
|
752
|
+
for (const u of e.children)
|
|
753
|
+
i.appendChild(D(u, t, r));
|
|
636
754
|
else typeof e.children == "string" && (i.textContent = e.children);
|
|
755
|
+
try {
|
|
756
|
+
if (i instanceof HTMLSelectElement && p && p.hasOwnProperty("value"))
|
|
757
|
+
try {
|
|
758
|
+
i.value = p.value ?? "";
|
|
759
|
+
} catch {
|
|
760
|
+
}
|
|
761
|
+
} catch {
|
|
762
|
+
}
|
|
637
763
|
return i;
|
|
638
764
|
}
|
|
639
|
-
function
|
|
765
|
+
function Ve(e, t, r, i, n) {
|
|
640
766
|
if (typeof r == "string") {
|
|
641
767
|
e.textContent !== r && (e.textContent = r);
|
|
642
768
|
return;
|
|
643
769
|
}
|
|
644
770
|
if (!Array.isArray(r)) return;
|
|
645
|
-
const
|
|
646
|
-
for (const
|
|
647
|
-
|
|
771
|
+
const o = Array.from(e.childNodes), s = Array.isArray(t) ? t : [], a = /* @__PURE__ */ new Map();
|
|
772
|
+
for (const c of s)
|
|
773
|
+
c && c.key != null && a.set(c.key, c);
|
|
648
774
|
const f = /* @__PURE__ */ new Map();
|
|
649
|
-
for (const
|
|
650
|
-
const
|
|
651
|
-
|
|
652
|
-
}
|
|
653
|
-
const
|
|
654
|
-
let
|
|
655
|
-
function
|
|
656
|
-
let
|
|
657
|
-
for (;
|
|
658
|
-
|
|
659
|
-
}
|
|
660
|
-
function c
|
|
661
|
-
const
|
|
662
|
-
let m =
|
|
663
|
-
for (; m && m !==
|
|
664
|
-
|
|
665
|
-
const x = Array.isArray(
|
|
666
|
-
if (
|
|
667
|
-
const
|
|
668
|
-
for (const
|
|
669
|
-
|
|
670
|
-
for (const
|
|
671
|
-
const
|
|
672
|
-
|
|
775
|
+
for (const c of o) {
|
|
776
|
+
const w = c.key;
|
|
777
|
+
w != null && f.set(w, c);
|
|
778
|
+
}
|
|
779
|
+
const p = /* @__PURE__ */ new Set();
|
|
780
|
+
let h = e.firstChild;
|
|
781
|
+
function C(c, w) {
|
|
782
|
+
let v = c;
|
|
783
|
+
for (; v && (p.add(v), v !== w); )
|
|
784
|
+
v = v.nextSibling;
|
|
785
|
+
}
|
|
786
|
+
function u(c, w, v, d) {
|
|
787
|
+
const g = [];
|
|
788
|
+
let m = c.nextSibling;
|
|
789
|
+
for (; m && m !== w; )
|
|
790
|
+
g.push(m), m = m.nextSibling;
|
|
791
|
+
const x = Array.isArray(v) ? v : [];
|
|
792
|
+
if (d.some((b) => b && b.key != null) || x.some((b) => b && b.key != null)) {
|
|
793
|
+
const b = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map();
|
|
794
|
+
for (const S of x)
|
|
795
|
+
S && S.key != null && b.set(S.key, S);
|
|
796
|
+
for (const S of g) {
|
|
797
|
+
const A = S.key;
|
|
798
|
+
A != null && y.set(A, S);
|
|
673
799
|
}
|
|
674
800
|
const _ = /* @__PURE__ */ new Set();
|
|
675
|
-
let
|
|
676
|
-
for (const
|
|
677
|
-
let
|
|
678
|
-
if (
|
|
679
|
-
const
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
801
|
+
let E = c.nextSibling;
|
|
802
|
+
for (const S of d) {
|
|
803
|
+
let A;
|
|
804
|
+
if (S.key != null && y.has(S.key)) {
|
|
805
|
+
const $ = b.get(S.key);
|
|
806
|
+
A = le(
|
|
807
|
+
y.get(S.key),
|
|
808
|
+
$,
|
|
809
|
+
S,
|
|
684
810
|
i
|
|
685
|
-
), _.add(
|
|
811
|
+
), _.add(A), A !== E && e.contains(A) && e.insertBefore(A, E);
|
|
686
812
|
} else
|
|
687
|
-
|
|
688
|
-
|
|
813
|
+
A = D(S, i), e.insertBefore(A, E), _.add(A);
|
|
814
|
+
E = A.nextSibling;
|
|
689
815
|
}
|
|
690
|
-
for (const
|
|
691
|
-
!_.has(
|
|
816
|
+
for (const S of g)
|
|
817
|
+
!_.has(S) && e.contains(S) && e.removeChild(S);
|
|
692
818
|
} else {
|
|
693
|
-
const
|
|
819
|
+
const b = Math.min(
|
|
694
820
|
x.length,
|
|
695
|
-
|
|
821
|
+
d.length
|
|
696
822
|
);
|
|
697
|
-
for (let
|
|
698
|
-
const _ = x[
|
|
699
|
-
|
|
823
|
+
for (let y = 0; y < b; y++) {
|
|
824
|
+
const _ = x[y], E = d[y], S = le(g[y], _, E, i);
|
|
825
|
+
S !== g[y] && (e.insertBefore(S, g[y]), e.removeChild(g[y]));
|
|
700
826
|
}
|
|
701
|
-
for (let
|
|
702
|
-
e.insertBefore(
|
|
703
|
-
for (let
|
|
704
|
-
e.removeChild(
|
|
827
|
+
for (let y = b; y < d.length; y++)
|
|
828
|
+
e.insertBefore(D(d[y], i), w);
|
|
829
|
+
for (let y = b; y < g.length; y++)
|
|
830
|
+
e.removeChild(g[y]);
|
|
705
831
|
}
|
|
706
832
|
}
|
|
707
|
-
for (const
|
|
708
|
-
let
|
|
709
|
-
if (
|
|
710
|
-
const
|
|
711
|
-
let m = f.get(
|
|
712
|
-
const l = Array.isArray(
|
|
713
|
-
if (m || (m = document.createTextNode(""), m.key =
|
|
714
|
-
e.insertBefore(m,
|
|
715
|
-
for (const
|
|
716
|
-
e.insertBefore(
|
|
717
|
-
e.insertBefore(x,
|
|
833
|
+
for (const c of r) {
|
|
834
|
+
let w;
|
|
835
|
+
if (c.tag === "#anchor") {
|
|
836
|
+
const v = c.key, d = `${v}:start`, g = `${v}:end`;
|
|
837
|
+
let m = f.get(d), x = f.get(g);
|
|
838
|
+
const l = Array.isArray(c.children) ? c.children : [];
|
|
839
|
+
if (m || (m = document.createTextNode(""), m.key = d), x || (x = document.createTextNode(""), x.key = g), c._startNode = m, c._endNode = x, !e.contains(m) || !e.contains(x)) {
|
|
840
|
+
e.insertBefore(m, h);
|
|
841
|
+
for (const b of l)
|
|
842
|
+
e.insertBefore(D(b, i), h);
|
|
843
|
+
e.insertBefore(x, h);
|
|
718
844
|
} else
|
|
719
|
-
|
|
845
|
+
u(
|
|
720
846
|
m,
|
|
721
847
|
x,
|
|
722
|
-
a.get(
|
|
848
|
+
a.get(v)?.children,
|
|
723
849
|
l
|
|
724
850
|
);
|
|
725
|
-
|
|
851
|
+
C(m, x), h = x.nextSibling;
|
|
726
852
|
continue;
|
|
727
853
|
}
|
|
728
|
-
if (
|
|
729
|
-
const
|
|
730
|
-
|
|
731
|
-
f.get(
|
|
732
|
-
|
|
733
|
-
|
|
854
|
+
if (c.key != null && f.has(c.key)) {
|
|
855
|
+
const v = a.get(c.key);
|
|
856
|
+
w = le(
|
|
857
|
+
f.get(c.key),
|
|
858
|
+
v,
|
|
859
|
+
c,
|
|
734
860
|
i,
|
|
735
861
|
n
|
|
736
|
-
),
|
|
862
|
+
), p.add(w), w !== h && e.contains(w) && (h && !e.contains(h) && (h = null), e.insertBefore(w, h));
|
|
737
863
|
} else
|
|
738
|
-
|
|
739
|
-
|
|
864
|
+
w = D(c, i, n), h && !e.contains(h) && (h = null), e.insertBefore(w, h), p.add(w);
|
|
865
|
+
h = w.nextSibling;
|
|
740
866
|
}
|
|
741
|
-
for (const
|
|
742
|
-
!
|
|
867
|
+
for (const c of o)
|
|
868
|
+
!p.has(c) && e.contains(c) && (V(c, n), e.removeChild(c));
|
|
743
869
|
}
|
|
744
|
-
function
|
|
870
|
+
function le(e, t, r, i, n) {
|
|
745
871
|
if (t && typeof t != "string" && t.props?.ref && n && V(e, n), t === r) return e;
|
|
746
872
|
if (typeof r == "string") {
|
|
747
873
|
if (e.nodeType === Node.TEXT_NODE)
|
|
748
874
|
return e.textContent !== r && (e.textContent = r), e;
|
|
749
875
|
{
|
|
750
|
-
const
|
|
751
|
-
return e.parentNode?.replaceChild(
|
|
876
|
+
const s = document.createTextNode(r);
|
|
877
|
+
return e.parentNode?.replaceChild(s, e), s;
|
|
752
878
|
}
|
|
753
879
|
}
|
|
754
880
|
if (r && typeof r != "string" && r.tag === "#anchor") {
|
|
755
|
-
const
|
|
756
|
-
|
|
757
|
-
const
|
|
758
|
-
|
|
759
|
-
for (const
|
|
760
|
-
const
|
|
761
|
-
|
|
881
|
+
const s = r, a = Array.isArray(s.children) ? s.children : [], f = s._startNode ?? document.createTextNode(""), p = s._endNode ?? document.createTextNode("");
|
|
882
|
+
s.key != null && (f.key = `${s.key}:start`, p.key = `${s.key}:end`), s._startNode = f, s._endNode = p;
|
|
883
|
+
const h = document.createDocumentFragment();
|
|
884
|
+
h.appendChild(f);
|
|
885
|
+
for (const C of a) {
|
|
886
|
+
const u = D(C, i);
|
|
887
|
+
h.appendChild(u);
|
|
762
888
|
}
|
|
763
|
-
return
|
|
889
|
+
return h.appendChild(p), e.parentNode?.replaceChild(h, e), f;
|
|
764
890
|
}
|
|
765
891
|
if (!r) {
|
|
766
892
|
V(e, n);
|
|
767
|
-
const
|
|
768
|
-
return e.parentNode?.replaceChild(
|
|
893
|
+
const s = document.createComment("removed");
|
|
894
|
+
return e.parentNode?.replaceChild(s, e), s;
|
|
769
895
|
}
|
|
770
896
|
if (!t || typeof t == "string") {
|
|
771
897
|
V(e, n);
|
|
772
|
-
const
|
|
773
|
-
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] =
|
|
898
|
+
const s = D(r, i, n);
|
|
899
|
+
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = s), e.parentNode?.replaceChild(s, e), s;
|
|
774
900
|
}
|
|
775
901
|
if (r.tag === "#anchor") {
|
|
776
|
-
const
|
|
902
|
+
const s = Array.isArray(r.children) ? r.children : [], a = r._startNode ?? document.createTextNode(""), f = r._endNode ?? document.createTextNode("");
|
|
777
903
|
r.key != null && (a.key = `${r.key}:start`, f.key = `${r.key}:end`), r._startNode = a, r._endNode = f;
|
|
778
|
-
const
|
|
779
|
-
|
|
780
|
-
for (const
|
|
781
|
-
|
|
782
|
-
return
|
|
904
|
+
const p = document.createDocumentFragment();
|
|
905
|
+
p.appendChild(a);
|
|
906
|
+
for (const h of s)
|
|
907
|
+
p.appendChild(D(h, i));
|
|
908
|
+
return p.appendChild(f), e.parentNode?.replaceChild(p, e), a;
|
|
783
909
|
}
|
|
784
910
|
if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && t.key === r.key) {
|
|
785
|
-
const
|
|
786
|
-
return
|
|
911
|
+
const s = e;
|
|
912
|
+
return Se(s, t.props || {}, r.props || {}, i), Ve(s, t.children, r.children, i, n), typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = s), s;
|
|
787
913
|
}
|
|
914
|
+
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
|
+
try {
|
|
916
|
+
const a = e;
|
|
917
|
+
return Se(a, t.props || {}, r.props || {}, i), typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = a), a;
|
|
918
|
+
} catch {
|
|
919
|
+
}
|
|
788
920
|
V(e, n);
|
|
789
|
-
const
|
|
790
|
-
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] =
|
|
921
|
+
const o = D(r, i, n);
|
|
922
|
+
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = o), e.parentNode?.replaceChild(o, e), o;
|
|
791
923
|
}
|
|
792
924
|
function Ye(e, t, r, i) {
|
|
793
925
|
let n;
|
|
@@ -796,31 +928,31 @@ function Ye(e, t, r, i) {
|
|
|
796
928
|
key: "__anchor_root__",
|
|
797
929
|
props: { attrs: { "data-anchor-block-root": "", key: "__anchor_root__" } },
|
|
798
930
|
children: [n]
|
|
799
|
-
}), n =
|
|
800
|
-
const
|
|
931
|
+
}), n = _e(n, String(n.key ?? "root"));
|
|
932
|
+
const o = e._prevVNode ?? null, s = e._prevDom ?? e.firstChild ?? null;
|
|
801
933
|
let a;
|
|
802
|
-
|
|
934
|
+
o && s ? typeof o != "string" && typeof n != "string" && o.tag === n.tag && o.key === n.key ? a = le(s, o, n, r, i) : (a = D(n, r, i), e.replaceChild(a, s)) : (a = D(n, r, i), e.firstChild ? e.replaceChild(a, e.firstChild) : e.appendChild(a));
|
|
803
935
|
const f = [];
|
|
804
|
-
for (let
|
|
805
|
-
const
|
|
806
|
-
|
|
936
|
+
for (let p = 0; p < e.childNodes.length; p++) {
|
|
937
|
+
const h = e.childNodes[p];
|
|
938
|
+
h !== a && h.nodeName !== "STYLE" && (V(h, i), f.push(h));
|
|
807
939
|
}
|
|
808
|
-
f.forEach((
|
|
940
|
+
f.forEach((p) => e.removeChild(p)), e._prevVNode = n, e._prevDom = a;
|
|
809
941
|
}
|
|
810
|
-
function
|
|
811
|
-
if (typeof e == "string") return
|
|
942
|
+
function ge(e) {
|
|
943
|
+
if (typeof e == "string") return J(e);
|
|
812
944
|
if (e.tag === "#text")
|
|
813
|
-
return typeof e.children == "string" ?
|
|
945
|
+
return typeof e.children == "string" ? J(e.children) : "";
|
|
814
946
|
if (e.tag === "#anchor")
|
|
815
|
-
return (Array.isArray(e.children) ? e.children.filter(Boolean) : []).map(
|
|
947
|
+
return (Array.isArray(e.children) ? e.children.filter(Boolean) : []).map(ge).join("");
|
|
816
948
|
let t = "";
|
|
817
|
-
e.props && e.props.attrs && (t = Object.entries(e.props.attrs).map(([n,
|
|
949
|
+
e.props && e.props.attrs && (t = Object.entries(e.props.attrs).map(([n, o]) => ` ${n}="${J(String(o))}"`).join(""));
|
|
818
950
|
let r = "";
|
|
819
|
-
e.props && (r = Object.entries(e.props).filter(([n]) => n !== "attrs" && n !== "directives" && n !== "ref" && n !== "key").map(([n,
|
|
820
|
-
const i = Array.isArray(e.children) ? e.children.filter(Boolean).map(
|
|
951
|
+
e.props && (r = Object.entries(e.props).filter(([n]) => n !== "attrs" && n !== "directives" && n !== "ref" && n !== "key").map(([n, o]) => ` ${n}="${J(String(o))}"`).join(""));
|
|
952
|
+
const i = Array.isArray(e.children) ? e.children.filter(Boolean).map(ge).join("") : typeof e.children == "string" ? J(e.children) : e.children ? ge(e.children) : "";
|
|
821
953
|
return `<${e.tag}${t}${r}>${i}</${e.tag}>`;
|
|
822
954
|
}
|
|
823
|
-
function
|
|
955
|
+
function Pe(e, ...t) {
|
|
824
956
|
let r = "";
|
|
825
957
|
for (let i = 0; i < e.length; i++)
|
|
826
958
|
r += e[i], i < t.length && (r += t[i]);
|
|
@@ -829,14 +961,14 @@ function Oe(e, ...t) {
|
|
|
829
961
|
function Be(e) {
|
|
830
962
|
return e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;}/g, "}").trim();
|
|
831
963
|
}
|
|
832
|
-
let
|
|
833
|
-
function
|
|
834
|
-
return
|
|
964
|
+
let oe = null;
|
|
965
|
+
function Ee() {
|
|
966
|
+
return oe || (oe = new CSSStyleSheet(), oe.replaceSync(Be(Xe))), oe;
|
|
835
967
|
}
|
|
836
|
-
function
|
|
968
|
+
function Qe(e) {
|
|
837
969
|
return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi, "").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, "").replace(/expression\s*\([^)]*\)/gi, "");
|
|
838
970
|
}
|
|
839
|
-
const
|
|
971
|
+
const Xe = Pe`
|
|
840
972
|
:host, *, ::before, ::after {
|
|
841
973
|
all: isolate;
|
|
842
974
|
box-sizing: border-box;
|
|
@@ -894,7 +1026,7 @@ const Qe = Oe`
|
|
|
894
1026
|
sup { top: -.5em }
|
|
895
1027
|
[disabled], [aria-disabled=true] { cursor: not-allowed }
|
|
896
1028
|
[hidden] { display: none }
|
|
897
|
-
`,
|
|
1029
|
+
`, et = {
|
|
898
1030
|
neutral: {
|
|
899
1031
|
50: "#fafafa",
|
|
900
1032
|
100: "#f4f4f5",
|
|
@@ -990,8 +1122,8 @@ const Qe = Oe`
|
|
|
990
1122
|
black: { DEFAULT: "#000000" },
|
|
991
1123
|
transparent: { DEFAULT: "transparent" },
|
|
992
1124
|
current: { DEFAULT: "currentColor" }
|
|
993
|
-
},
|
|
994
|
-
Object.entries(
|
|
1125
|
+
}, tt = Object.fromEntries(
|
|
1126
|
+
Object.entries(et).map(([e, t]) => [
|
|
995
1127
|
e,
|
|
996
1128
|
Object.fromEntries(
|
|
997
1129
|
Object.entries(t).map(([r, i]) => [
|
|
@@ -1000,7 +1132,7 @@ const Qe = Oe`
|
|
|
1000
1132
|
])
|
|
1001
1133
|
)
|
|
1002
1134
|
])
|
|
1003
|
-
),
|
|
1135
|
+
), me = {
|
|
1004
1136
|
/* Display */
|
|
1005
1137
|
block: "display:block;",
|
|
1006
1138
|
inline: "display:inline;",
|
|
@@ -1127,6 +1259,10 @@ const Qe = Oe`
|
|
|
1127
1259
|
"rounded-sm": "border-radius:0.25rem;",
|
|
1128
1260
|
"rounded-md": "border-radius:0.375rem;",
|
|
1129
1261
|
"rounded-lg": "border-radius:0.5rem;",
|
|
1262
|
+
"rounded-xl": "border-radius:0.75rem;",
|
|
1263
|
+
"rounded-2xl": "border-radius:1rem;",
|
|
1264
|
+
"rounded-3xl": "border-radius:1.5rem;",
|
|
1265
|
+
"rounded-4xl": "border-radius:2rem;",
|
|
1130
1266
|
"rounded-full": "border-radius:9999px;",
|
|
1131
1267
|
/* Shadow and effects */
|
|
1132
1268
|
// Shadows use a CSS variable for color so color utilities can modify --ce-shadow-color
|
|
@@ -1211,7 +1347,7 @@ const Qe = Oe`
|
|
|
1211
1347
|
"z-30": "z-index:30;",
|
|
1212
1348
|
"z-40": "z-index:40;",
|
|
1213
1349
|
"z-50": "z-index:50;"
|
|
1214
|
-
},
|
|
1350
|
+
}, rt = "0.25rem", Ce = {
|
|
1215
1351
|
m: ["margin"],
|
|
1216
1352
|
mx: ["margin-inline"],
|
|
1217
1353
|
my: ["margin-block"],
|
|
@@ -1246,17 +1382,17 @@ const Qe = Oe`
|
|
|
1246
1382
|
function N(e, t) {
|
|
1247
1383
|
let r = 0, i = 0;
|
|
1248
1384
|
for (let n = 0; n < e.length; n++) {
|
|
1249
|
-
const
|
|
1250
|
-
if (
|
|
1251
|
-
else if (
|
|
1252
|
-
else if (
|
|
1253
|
-
else if (
|
|
1254
|
-
else if (r === 0 && i === 0 && (
|
|
1385
|
+
const o = e[n];
|
|
1386
|
+
if (o === "[") r++;
|
|
1387
|
+
else if (o === "]" && r > 0) r--;
|
|
1388
|
+
else if (o === "(") i++;
|
|
1389
|
+
else if (o === ")" && i > 0) i--;
|
|
1390
|
+
else if (r === 0 && i === 0 && (o === ">" || o === "+" || o === "~" || o === " "))
|
|
1255
1391
|
return e.slice(0, n) + t + e.slice(n);
|
|
1256
1392
|
}
|
|
1257
1393
|
return e + t;
|
|
1258
1394
|
}
|
|
1259
|
-
const
|
|
1395
|
+
const nt = {
|
|
1260
1396
|
before: (e, t) => `${e}::before{${t}}`,
|
|
1261
1397
|
after: (e, t) => `${e}::after{${t}}`,
|
|
1262
1398
|
hover: (e, t) => `${N(e, ":hover")}{${t}}`,
|
|
@@ -1279,7 +1415,7 @@ const rt = {
|
|
|
1279
1415
|
"peer-focus": (e, t) => `.peer:focus ~ ${e}{${t}}`,
|
|
1280
1416
|
"peer-checked": (e, t) => `.peer:checked ~ ${e}{${t}}`,
|
|
1281
1417
|
"peer-disabled": (e, t) => `.peer:disabled ~ ${e}{${t}}`
|
|
1282
|
-
},
|
|
1418
|
+
}, ye = {
|
|
1283
1419
|
// Responsive
|
|
1284
1420
|
sm: "(min-width:640px)",
|
|
1285
1421
|
md: "(min-width:768px)",
|
|
@@ -1288,25 +1424,25 @@ const rt = {
|
|
|
1288
1424
|
"2xl": "(min-width:1536px)",
|
|
1289
1425
|
// Dark mode (now plain string)
|
|
1290
1426
|
dark: "(prefers-color-scheme: dark)"
|
|
1291
|
-
},
|
|
1292
|
-
function
|
|
1427
|
+
}, be = ["sm", "md", "lg", "xl", "2xl"];
|
|
1428
|
+
function we(e) {
|
|
1293
1429
|
const t = e.startsWith("-"), i = (t ? e.slice(1) : e).split("-");
|
|
1294
1430
|
if (i.length < 2) return null;
|
|
1295
|
-
const n = i.slice(0, -1).join("-"),
|
|
1296
|
-
if (Number.isNaN(
|
|
1431
|
+
const n = i.slice(0, -1).join("-"), o = i[i.length - 1], s = parseFloat(o);
|
|
1432
|
+
if (Number.isNaN(s) || !Ce[n]) return null;
|
|
1297
1433
|
const a = t ? "-" : "";
|
|
1298
|
-
return
|
|
1434
|
+
return Ce[n].map((f) => `${f}:calc(${a}${rt} * ${s});`).join("");
|
|
1299
1435
|
}
|
|
1300
|
-
function
|
|
1301
|
-
const t = e.replace("#", ""), r = parseInt(t, 16), i = r >> 16 & 255, n = r >> 8 & 255,
|
|
1302
|
-
return `${i} ${n} ${
|
|
1436
|
+
function Ae(e) {
|
|
1437
|
+
const t = e.replace("#", ""), r = parseInt(t, 16), i = r >> 16 & 255, n = r >> 8 & 255, o = r & 255;
|
|
1438
|
+
return `${i} ${n} ${o}`;
|
|
1303
1439
|
}
|
|
1304
|
-
function
|
|
1440
|
+
function it(e) {
|
|
1305
1441
|
const t = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
|
|
1306
1442
|
if (!t) return null;
|
|
1307
|
-
const [, r, i, n = "DEFAULT"] = t,
|
|
1308
|
-
if (!
|
|
1309
|
-
if (r === "shadow") return `--ce-shadow-color:${
|
|
1443
|
+
const [, r, i, n = "DEFAULT"] = t, o = tt[i]?.[n];
|
|
1444
|
+
if (!o) return null;
|
|
1445
|
+
if (r === "shadow") return `--ce-shadow-color:${o};`;
|
|
1310
1446
|
const a = {
|
|
1311
1447
|
bg: "background-color",
|
|
1312
1448
|
decoration: "text-decoration-color",
|
|
@@ -1318,49 +1454,49 @@ function nt(e) {
|
|
|
1318
1454
|
fill: "fill",
|
|
1319
1455
|
stroke: "stroke"
|
|
1320
1456
|
}[r];
|
|
1321
|
-
return a ? `${a}:${
|
|
1457
|
+
return a ? `${a}:${o};` : null;
|
|
1322
1458
|
}
|
|
1323
|
-
function
|
|
1459
|
+
function st(e) {
|
|
1324
1460
|
const [t, r] = e.split("/");
|
|
1325
1461
|
if (!r) return { base: t };
|
|
1326
1462
|
const i = parseInt(r, 10);
|
|
1327
1463
|
return isNaN(i) || i < 0 || i > 100 ? { base: t } : { base: t, opacity: i / 100 };
|
|
1328
1464
|
}
|
|
1329
|
-
function
|
|
1330
|
-
const { base: t, opacity: r } =
|
|
1465
|
+
function xe(e) {
|
|
1466
|
+
const { base: t, opacity: r } = st(e), i = it(t);
|
|
1331
1467
|
if (i) {
|
|
1332
1468
|
if (r !== void 0) {
|
|
1333
|
-
const
|
|
1334
|
-
if (
|
|
1335
|
-
const
|
|
1336
|
-
return i.replace(/#([0-9a-f]{6})/i, `rgb(${
|
|
1469
|
+
const o = /#([0-9a-f]{6})/i.exec(i);
|
|
1470
|
+
if (o) {
|
|
1471
|
+
const s = Ae(o[0]);
|
|
1472
|
+
return i.replace(/#([0-9a-f]{6})/i, `rgb(${s} / ${r})`);
|
|
1337
1473
|
}
|
|
1338
1474
|
}
|
|
1339
1475
|
return i;
|
|
1340
1476
|
}
|
|
1341
|
-
const n =
|
|
1477
|
+
const n = fe(t);
|
|
1342
1478
|
if (n && r !== void 0) {
|
|
1343
|
-
const
|
|
1344
|
-
if (
|
|
1345
|
-
const
|
|
1346
|
-
return n.replace(/#([0-9a-f]{6})/i, `rgb(${
|
|
1479
|
+
const o = /#([0-9a-f]{6})/i.exec(n);
|
|
1480
|
+
if (o) {
|
|
1481
|
+
const s = Ae(o[0]);
|
|
1482
|
+
return n.replace(/#([0-9a-f]{6})/i, `rgb(${s} / ${r})`);
|
|
1347
1483
|
}
|
|
1348
1484
|
}
|
|
1349
1485
|
return n;
|
|
1350
1486
|
}
|
|
1351
|
-
function
|
|
1487
|
+
function ve(e) {
|
|
1352
1488
|
const t = /^opacity-(\d{1,3})$/.exec(e);
|
|
1353
1489
|
if (!t) return null;
|
|
1354
1490
|
const r = parseInt(t[1], 10);
|
|
1355
1491
|
return r < 0 || r > 100 ? null : `opacity:${r / 100};`;
|
|
1356
1492
|
}
|
|
1357
|
-
function
|
|
1493
|
+
function fe(e) {
|
|
1358
1494
|
if (e.startsWith("[") && e.endsWith("]") && !e.includes("-[")) {
|
|
1359
1495
|
const n = e.slice(1, -1).trim().match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*:(.*)$/);
|
|
1360
1496
|
if (n) {
|
|
1361
|
-
const
|
|
1362
|
-
let
|
|
1363
|
-
return
|
|
1497
|
+
const o = n[1].trim();
|
|
1498
|
+
let s = n[2].trim();
|
|
1499
|
+
return s = s.replace(/url\('\s*([^']*?)\s*'\)/g, 'url("$1")'), s = s.replace(/^'([^']*)'$/g, '"$1"'), `${o}:${s};`;
|
|
1364
1500
|
}
|
|
1365
1501
|
return null;
|
|
1366
1502
|
}
|
|
@@ -1369,7 +1505,7 @@ function ce(e) {
|
|
|
1369
1505
|
const i = e.slice(0, t);
|
|
1370
1506
|
let n = e.slice(t + 2, -1);
|
|
1371
1507
|
n = n.replace(/_/g, " ");
|
|
1372
|
-
const
|
|
1508
|
+
const o = {
|
|
1373
1509
|
bg: "background-color",
|
|
1374
1510
|
text: "color",
|
|
1375
1511
|
shadow: "box-shadow",
|
|
@@ -1413,12 +1549,12 @@ function ce(e) {
|
|
|
1413
1549
|
};
|
|
1414
1550
|
if (i === "rotate")
|
|
1415
1551
|
return `transform:rotate(${n});`;
|
|
1416
|
-
const
|
|
1417
|
-
if (
|
|
1552
|
+
const s = o[i] ?? i.replace(/_/g, "-");
|
|
1553
|
+
if (s && n) return `${s}:${n};`;
|
|
1418
1554
|
}
|
|
1419
1555
|
return null;
|
|
1420
1556
|
}
|
|
1421
|
-
function
|
|
1557
|
+
function ot(e) {
|
|
1422
1558
|
if (e.startsWith("[") && e.endsWith("]")) {
|
|
1423
1559
|
const r = e.slice(1, -1);
|
|
1424
1560
|
return r.includes("&") ? r : e;
|
|
@@ -1430,10 +1566,10 @@ function st(e) {
|
|
|
1430
1566
|
}
|
|
1431
1567
|
return null;
|
|
1432
1568
|
}
|
|
1433
|
-
function
|
|
1569
|
+
function at(e) {
|
|
1434
1570
|
return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
|
|
1435
1571
|
}
|
|
1436
|
-
function
|
|
1572
|
+
function ct(e) {
|
|
1437
1573
|
const t = /class\s*=\s*(['"])(.*?)\1/g, r = [];
|
|
1438
1574
|
let i;
|
|
1439
1575
|
for (; i = t.exec(e); ) {
|
|
@@ -1442,32 +1578,32 @@ function at(e) {
|
|
|
1442
1578
|
}
|
|
1443
1579
|
return r.filter(Boolean);
|
|
1444
1580
|
}
|
|
1445
|
-
const
|
|
1446
|
-
function
|
|
1447
|
-
const t = Date.now(), r =
|
|
1448
|
-
if (r && t - r.timestamp <
|
|
1449
|
-
const i =
|
|
1450
|
-
function d
|
|
1451
|
-
const m = (
|
|
1452
|
-
if (m in
|
|
1453
|
-
const x =
|
|
1454
|
-
return
|
|
1455
|
-
}
|
|
1456
|
-
function
|
|
1457
|
-
const
|
|
1458
|
-
return
|
|
1459
|
-
}
|
|
1460
|
-
function
|
|
1461
|
-
const
|
|
1581
|
+
const Te = /* @__PURE__ */ new Map(), lt = 16;
|
|
1582
|
+
function ft(e) {
|
|
1583
|
+
const t = Date.now(), r = Te.get(e);
|
|
1584
|
+
if (r && t - r.timestamp < lt) return r.css;
|
|
1585
|
+
const i = ct(e), n = new Set(i), o = [], s = [], a = [], f = [], p = {};
|
|
1586
|
+
function h(d, g = !1) {
|
|
1587
|
+
const m = (g ? "dark|" : "") + d;
|
|
1588
|
+
if (m in p) return p[m];
|
|
1589
|
+
const x = w(d, g);
|
|
1590
|
+
return p[m] = x, x;
|
|
1591
|
+
}
|
|
1592
|
+
function C(d) {
|
|
1593
|
+
const g = d.some((x) => be.includes(x)), m = d.includes("dark");
|
|
1594
|
+
return d.length === 0 ? 1 : !g && !m ? 2 : g && !m ? 3 : 4;
|
|
1595
|
+
}
|
|
1596
|
+
function u(d) {
|
|
1597
|
+
const g = [];
|
|
1462
1598
|
let m = "", x = 0, l = 0;
|
|
1463
|
-
for (let
|
|
1464
|
-
const
|
|
1465
|
-
|
|
1599
|
+
for (let b = 0; b < d.length; b++) {
|
|
1600
|
+
const y = d[b];
|
|
1601
|
+
y === "[" ? x++ : y === "]" && x > 0 ? x-- : y === "(" ? l++ : y === ")" && l > 0 && l--, y === ":" && x === 0 && l === 0 ? (g.push(m), m = "") : m += y;
|
|
1466
1602
|
}
|
|
1467
|
-
return m &&
|
|
1603
|
+
return m && g.push(m), g;
|
|
1468
1604
|
}
|
|
1469
|
-
function
|
|
1470
|
-
switch (
|
|
1605
|
+
function c(d) {
|
|
1606
|
+
switch (d) {
|
|
1471
1607
|
case "hover":
|
|
1472
1608
|
return ":hover";
|
|
1473
1609
|
case "focus":
|
|
@@ -1496,124 +1632,124 @@ function lt(e) {
|
|
|
1496
1632
|
return null;
|
|
1497
1633
|
}
|
|
1498
1634
|
}
|
|
1499
|
-
function
|
|
1500
|
-
const m =
|
|
1635
|
+
function w(d, g = !1) {
|
|
1636
|
+
const m = u(d);
|
|
1501
1637
|
let x = !1;
|
|
1502
|
-
const l = m.find((
|
|
1638
|
+
const l = m.find((k) => (k.startsWith("!") && (x = !0, k = k.slice(1)), me[k] || we(k) || ve(k) || xe(k) || fe(k)));
|
|
1503
1639
|
if (!l) return null;
|
|
1504
|
-
const
|
|
1505
|
-
if (!
|
|
1640
|
+
const b = l.replace(/^!/, ""), y = me[b] ?? we(b) ?? ve(b) ?? xe(b) ?? fe(b);
|
|
1641
|
+
if (!y) return null;
|
|
1506
1642
|
const _ = m.indexOf(l);
|
|
1507
|
-
let
|
|
1508
|
-
|
|
1509
|
-
const
|
|
1510
|
-
let
|
|
1511
|
-
const
|
|
1512
|
-
for (const
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
const
|
|
1516
|
-
let
|
|
1517
|
-
for (const
|
|
1518
|
-
if (
|
|
1519
|
-
const
|
|
1520
|
-
if (
|
|
1521
|
-
|
|
1643
|
+
let E = _ >= 0 ? m.slice(0, _) : [];
|
|
1644
|
+
g && (E = E.filter((k) => k !== "dark"));
|
|
1645
|
+
const S = `.${at(d)}`, A = "__SUBJECT__", $ = x ? y.replace(/;$/, " !important;") : y;
|
|
1646
|
+
let T = A;
|
|
1647
|
+
const B = [];
|
|
1648
|
+
for (const k of E)
|
|
1649
|
+
k.startsWith("group-") ? (T = `.group:${k.slice(6)} ${T}`, B.push(k)) : k.startsWith("peer-") && (T = T.replace(A, `.peer:${k.slice(5)}~${A}`), B.push(k));
|
|
1650
|
+
E = E.filter((k) => !B.includes(k));
|
|
1651
|
+
const G = [], ee = [];
|
|
1652
|
+
let M = null;
|
|
1653
|
+
for (const k of E) {
|
|
1654
|
+
if (k === "dark" || be.includes(k)) continue;
|
|
1655
|
+
const P = ot(k);
|
|
1656
|
+
if (P) {
|
|
1657
|
+
M = P;
|
|
1522
1658
|
continue;
|
|
1523
1659
|
}
|
|
1524
|
-
const
|
|
1525
|
-
if (
|
|
1526
|
-
|
|
1660
|
+
const R = c(k);
|
|
1661
|
+
if (R) {
|
|
1662
|
+
M ? ee.push(R) : G.push(R);
|
|
1527
1663
|
continue;
|
|
1528
1664
|
}
|
|
1529
|
-
const
|
|
1530
|
-
typeof
|
|
1665
|
+
const O = nt[k];
|
|
1666
|
+
typeof O == "function" && (T = O(T, $).split("{")[0]);
|
|
1531
1667
|
}
|
|
1532
|
-
function
|
|
1533
|
-
if (!
|
|
1534
|
-
let
|
|
1535
|
-
if (
|
|
1536
|
-
let
|
|
1537
|
-
for (;
|
|
1538
|
-
for (;
|
|
1539
|
-
const
|
|
1540
|
-
if (
|
|
1541
|
-
return
|
|
1668
|
+
function U(k, P) {
|
|
1669
|
+
if (!P) return k;
|
|
1670
|
+
let R = 0, O = 0;
|
|
1671
|
+
if (k.length && (k[0] === ">" || k[0] === "+" || k[0] === "~" || k[0] === " ")) {
|
|
1672
|
+
let j = 1;
|
|
1673
|
+
for (; j < k.length && k[j] === " "; ) j++;
|
|
1674
|
+
for (; j < k.length; j++) {
|
|
1675
|
+
const L = k[j];
|
|
1676
|
+
if (L === "[" ? R++ : L === "]" && R > 0 ? R-- : L === "(" ? O++ : L === ")" && O > 0 && O--, R === 0 && O === 0 && (k[j] === ">" || k[j] === "+" || k[j] === "~" || k[j] === " "))
|
|
1677
|
+
return k.slice(0, j) + P + k.slice(j);
|
|
1542
1678
|
}
|
|
1543
|
-
return
|
|
1679
|
+
return k + P;
|
|
1544
1680
|
}
|
|
1545
|
-
for (let
|
|
1546
|
-
const
|
|
1547
|
-
if (
|
|
1548
|
-
return
|
|
1681
|
+
for (let j = 0; j < k.length; j++) {
|
|
1682
|
+
const L = k[j];
|
|
1683
|
+
if (L === "[" ? R++ : L === "]" && R > 0 ? R-- : L === "(" ? O++ : L === ")" && O > 0 && O--, R === 0 && O === 0 && (L === ">" || L === "+" || L === "~" || L === " "))
|
|
1684
|
+
return k.slice(0, j) + P + k.slice(j);
|
|
1549
1685
|
}
|
|
1550
|
-
return
|
|
1686
|
+
return k + P;
|
|
1551
1687
|
}
|
|
1552
|
-
const
|
|
1553
|
-
if (
|
|
1554
|
-
if (
|
|
1555
|
-
const
|
|
1556
|
-
if (
|
|
1557
|
-
|
|
1688
|
+
const q = G.join(""), I = ee.join("");
|
|
1689
|
+
if (M)
|
|
1690
|
+
if (M.includes("&")) {
|
|
1691
|
+
const k = M.indexOf("&"), P = M.slice(0, k), R = M.slice(k + 1), O = A + q, j = T;
|
|
1692
|
+
if (G.length === 0)
|
|
1693
|
+
T = j.replace(A, P + O + I + R);
|
|
1558
1694
|
else {
|
|
1559
|
-
const
|
|
1560
|
-
|
|
1695
|
+
const L = U(R, I);
|
|
1696
|
+
T = j.replace(A, P + O + L);
|
|
1561
1697
|
}
|
|
1562
1698
|
} else
|
|
1563
|
-
|
|
1699
|
+
T = T.replace(A, `${M}${A + q}`), I && (T = T.replace(A, `${A}${I}`));
|
|
1564
1700
|
else
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
let
|
|
1568
|
-
const
|
|
1569
|
-
return
|
|
1570
|
-
}
|
|
1571
|
-
for (const
|
|
1572
|
-
const
|
|
1573
|
-
(
|
|
1701
|
+
T = A + q + I;
|
|
1702
|
+
T = T.replace(new RegExp(A, "g"), S);
|
|
1703
|
+
let z = `${T}{${$}}`;
|
|
1704
|
+
const H = E.filter((k) => be.includes(k)), F = H.length ? H[H.length - 1] : null, te = E.includes("dark");
|
|
1705
|
+
return g && F ? z = `@media (prefers-color-scheme: dark) and ${ye[F]}{${z}}` : g ? z = `@media (prefers-color-scheme: dark){${z}}` : te && F ? z = `@media (prefers-color-scheme: dark) and ${ye[F]}{${z}}` : te ? z = `@media (prefers-color-scheme: dark){${z}}` : F && (z = `@media ${ye[F]}{${z}}`), z;
|
|
1706
|
+
}
|
|
1707
|
+
for (const d of n) {
|
|
1708
|
+
const g = u(d), m = g.find(
|
|
1709
|
+
(y) => me[y] || we(y) || ve(y) || xe(y) || fe(y)
|
|
1574
1710
|
);
|
|
1575
1711
|
if (!m) continue;
|
|
1576
|
-
const x =
|
|
1577
|
-
if (
|
|
1578
|
-
const
|
|
1579
|
-
|
|
1712
|
+
const x = g.indexOf(m), l = x >= 0 ? g.slice(0, x) : [], b = C(l);
|
|
1713
|
+
if (b === 4) {
|
|
1714
|
+
const y = h(d, !0);
|
|
1715
|
+
y && f.push(y);
|
|
1580
1716
|
} else {
|
|
1581
|
-
const
|
|
1582
|
-
|
|
1717
|
+
const y = h(d);
|
|
1718
|
+
y && (b === 1 ? o.push(y) : b === 2 ? s.push(y) : b === 3 && a.push(y));
|
|
1583
1719
|
}
|
|
1584
1720
|
}
|
|
1585
|
-
const
|
|
1586
|
-
return
|
|
1721
|
+
const v = [...o, ...s, ...a, ...f].join("");
|
|
1722
|
+
return Te.set(e, { css: v, timestamp: t }), v;
|
|
1587
1723
|
}
|
|
1588
|
-
const
|
|
1589
|
-
function
|
|
1724
|
+
const ne = [];
|
|
1725
|
+
function ut(e, t, r, i, n, o, s, a) {
|
|
1590
1726
|
if (e) {
|
|
1591
|
-
|
|
1727
|
+
ne.push(r);
|
|
1592
1728
|
try {
|
|
1593
1729
|
if (t.loadingTemplate && r.isLoading) {
|
|
1594
|
-
|
|
1730
|
+
Q(e, t.loadingTemplate(r), r, i, n);
|
|
1595
1731
|
return;
|
|
1596
1732
|
}
|
|
1597
1733
|
if (t.errorTemplate && r.hasError) {
|
|
1598
|
-
r.error instanceof Error &&
|
|
1734
|
+
r.error instanceof Error && Q(e, t.errorTemplate(r.error, r), r, i, n);
|
|
1599
1735
|
return;
|
|
1600
1736
|
}
|
|
1601
1737
|
const f = t.render(r);
|
|
1602
1738
|
if (f instanceof Promise) {
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
}).catch((
|
|
1606
|
-
|
|
1607
|
-
}), t.loadingTemplate &&
|
|
1739
|
+
o(!0), f.then((p) => {
|
|
1740
|
+
o(!1), s(null), Q(e, p, r, i, n), a(e.innerHTML);
|
|
1741
|
+
}).catch((p) => {
|
|
1742
|
+
o(!1), s(p), t.errorTemplate && Q(e, t.errorTemplate(p, r), r, i, n);
|
|
1743
|
+
}), t.loadingTemplate && Q(e, t.loadingTemplate(r), r, i, n);
|
|
1608
1744
|
return;
|
|
1609
1745
|
}
|
|
1610
|
-
|
|
1746
|
+
Q(e, f, r, i, n), a(e.innerHTML);
|
|
1611
1747
|
} finally {
|
|
1612
|
-
|
|
1748
|
+
ne.pop();
|
|
1613
1749
|
}
|
|
1614
1750
|
}
|
|
1615
1751
|
}
|
|
1616
|
-
function
|
|
1752
|
+
function Q(e, t, r, i, n) {
|
|
1617
1753
|
e && (Ye(
|
|
1618
1754
|
e,
|
|
1619
1755
|
Array.isArray(t) ? t : [t],
|
|
@@ -1621,85 +1757,85 @@ function Y(e, t, r, i, n) {
|
|
|
1621
1757
|
i
|
|
1622
1758
|
), n(e.innerHTML));
|
|
1623
1759
|
}
|
|
1624
|
-
function
|
|
1625
|
-
if (
|
|
1760
|
+
function pt(e, t, r, i, n, o, s) {
|
|
1761
|
+
if (o !== null && clearTimeout(o), Date.now() - t < 16) {
|
|
1626
1762
|
if (n(r + 1), r > 10) {
|
|
1627
|
-
|
|
1763
|
+
s(null);
|
|
1628
1764
|
return;
|
|
1629
1765
|
}
|
|
1630
1766
|
} else
|
|
1631
1767
|
n(0);
|
|
1632
1768
|
const f = setTimeout(() => {
|
|
1633
|
-
i(Date.now()), e(),
|
|
1769
|
+
i(Date.now()), e(), s(null);
|
|
1634
1770
|
}, 0);
|
|
1635
|
-
|
|
1771
|
+
s(f);
|
|
1636
1772
|
}
|
|
1637
|
-
function dt(e, t, r, i, n,
|
|
1773
|
+
function dt(e, t, r, i, n, o) {
|
|
1638
1774
|
if (!e) return;
|
|
1639
|
-
const
|
|
1640
|
-
if (!t.style && (!
|
|
1641
|
-
|
|
1775
|
+
const s = ft(i);
|
|
1776
|
+
if (!t.style && (!s || s.trim() === "")) {
|
|
1777
|
+
o(null), e.adoptedStyleSheets = [Ee()];
|
|
1642
1778
|
return;
|
|
1643
1779
|
}
|
|
1644
1780
|
let a = "";
|
|
1645
1781
|
t.style && (typeof t.style == "string" ? a = t.style : typeof t.style == "function" && (a = t.style(r)));
|
|
1646
|
-
let f =
|
|
1647
|
-
${
|
|
1782
|
+
let f = Qe(`${a}
|
|
1783
|
+
${s}
|
|
1648
1784
|
`);
|
|
1649
1785
|
f = Be(f);
|
|
1650
|
-
let
|
|
1651
|
-
|
|
1786
|
+
let p = n;
|
|
1787
|
+
p || (p = new CSSStyleSheet()), (p.cssRules.length === 0 || p.toString() !== f) && p.replaceSync(f), e.adoptedStyleSheets = [Ee(), p], o(p);
|
|
1652
1788
|
}
|
|
1653
|
-
const
|
|
1789
|
+
const de = /* @__PURE__ */ new Map(), je = Symbol.for("cer.registry");
|
|
1654
1790
|
if (typeof window < "u") {
|
|
1655
1791
|
const e = globalThis;
|
|
1656
|
-
e[
|
|
1792
|
+
e[je] || (e[je] = de);
|
|
1657
1793
|
}
|
|
1658
|
-
function
|
|
1659
|
-
let i =
|
|
1794
|
+
function Le(e, t, r) {
|
|
1795
|
+
let i = Y(e);
|
|
1660
1796
|
i.includes("-") || (i = `cer-${i}`);
|
|
1661
1797
|
let n;
|
|
1662
|
-
typeof t == "function" ? n = { ...r, render: t } : n = t, typeof n.onError != "function" && (n.onError = (
|
|
1663
|
-
console.error(`[${i}] Error:`,
|
|
1798
|
+
typeof t == "function" ? n = { ...r, render: t } : n = t, typeof n.onError != "function" && (n.onError = (o, s) => {
|
|
1799
|
+
console.error(`[${i}] Error:`, o, s);
|
|
1664
1800
|
});
|
|
1665
1801
|
try {
|
|
1666
|
-
const
|
|
1802
|
+
const o = /* @__PURE__ */ new Set([
|
|
1667
1803
|
"refs",
|
|
1668
1804
|
"requestRender",
|
|
1669
1805
|
"error",
|
|
1670
1806
|
"hasError",
|
|
1671
1807
|
"isLoading",
|
|
1672
1808
|
"emit"
|
|
1673
|
-
]),
|
|
1809
|
+
]), s = [];
|
|
1674
1810
|
if (n.state && typeof n.state == "object" && Object.keys(n.state).forEach((a) => {
|
|
1675
|
-
|
|
1811
|
+
o.has(a) && s.push(a);
|
|
1676
1812
|
}), n.props && typeof n.props == "object" && Object.keys(n.props).forEach((a) => {
|
|
1677
|
-
|
|
1813
|
+
o.has(a) && s.push(a);
|
|
1678
1814
|
}), n.computed && typeof n.computed == "object" && Object.keys(n.computed).forEach((a) => {
|
|
1679
|
-
|
|
1680
|
-
}),
|
|
1681
|
-
const a = Array.from(new Set(
|
|
1815
|
+
o.has(a) && s.push(a);
|
|
1816
|
+
}), s.length > 0) {
|
|
1817
|
+
const a = Array.from(new Set(s));
|
|
1682
1818
|
console.warn(
|
|
1683
1819
|
`[${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.`
|
|
1684
1820
|
);
|
|
1685
1821
|
}
|
|
1686
1822
|
} catch {
|
|
1687
1823
|
}
|
|
1688
|
-
if (
|
|
1824
|
+
if (de.set(i, n), typeof window < "u")
|
|
1689
1825
|
if (!customElements.get(i))
|
|
1690
|
-
customElements.define(i,
|
|
1826
|
+
customElements.define(i, ht(i, n));
|
|
1691
1827
|
else
|
|
1692
1828
|
try {
|
|
1693
|
-
document.querySelectorAll(i).forEach((
|
|
1829
|
+
document.querySelectorAll(i).forEach((o) => {
|
|
1694
1830
|
try {
|
|
1695
|
-
typeof
|
|
1831
|
+
typeof o._cfg < "u" && (o._cfg = n), typeof o._render == "function" && o._render(n);
|
|
1696
1832
|
} catch {
|
|
1697
1833
|
}
|
|
1698
1834
|
});
|
|
1699
1835
|
} catch {
|
|
1700
1836
|
}
|
|
1701
1837
|
}
|
|
1702
|
-
function
|
|
1838
|
+
function ht(e, t) {
|
|
1703
1839
|
if (!t.render)
|
|
1704
1840
|
throw new Error(
|
|
1705
1841
|
"Component must have a render function"
|
|
@@ -1743,7 +1879,7 @@ function pt(e, t) {
|
|
|
1743
1879
|
_templateLoading = !1;
|
|
1744
1880
|
_templateError = null;
|
|
1745
1881
|
constructor() {
|
|
1746
|
-
super(), this.attachShadow({ mode: "open" }), this._cfg =
|
|
1882
|
+
super(), this.attachShadow({ mode: "open" }), this._cfg = de.get(e) || t;
|
|
1747
1883
|
const r = this._initContext(t);
|
|
1748
1884
|
Object.defineProperty(r, "refs", {
|
|
1749
1885
|
value: this._refs,
|
|
@@ -1756,12 +1892,12 @@ function pt(e, t) {
|
|
|
1756
1892
|
enumerable: !1,
|
|
1757
1893
|
configurable: !1
|
|
1758
1894
|
}), this.context = r, Object.defineProperty(this.context, "emit", {
|
|
1759
|
-
value: (n,
|
|
1895
|
+
value: (n, o, s) => {
|
|
1760
1896
|
const a = new CustomEvent(n, {
|
|
1761
|
-
detail:
|
|
1897
|
+
detail: o,
|
|
1762
1898
|
bubbles: !0,
|
|
1763
1899
|
composed: !0,
|
|
1764
|
-
...
|
|
1900
|
+
...s || {}
|
|
1765
1901
|
});
|
|
1766
1902
|
return this.dispatchEvent(a), !a.defaultPrevented;
|
|
1767
1903
|
},
|
|
@@ -1769,15 +1905,15 @@ function pt(e, t) {
|
|
|
1769
1905
|
enumerable: !1,
|
|
1770
1906
|
configurable: !1
|
|
1771
1907
|
});
|
|
1772
|
-
const i =
|
|
1908
|
+
const i = de.get(e) || t;
|
|
1773
1909
|
Object.keys(i).forEach((n) => {
|
|
1774
|
-
const
|
|
1775
|
-
typeof
|
|
1910
|
+
const o = i[n];
|
|
1911
|
+
typeof o == "function" && (this.context[n] = (...s) => o(...s, this.context));
|
|
1776
1912
|
}), this._applyComputed(i), this._initializing = !1, this._initWatchers(i), this._render(i);
|
|
1777
1913
|
}
|
|
1778
1914
|
connectedCallback() {
|
|
1779
1915
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1780
|
-
this._applyProps(t),
|
|
1916
|
+
this._applyProps(t), We(
|
|
1781
1917
|
t,
|
|
1782
1918
|
this.context,
|
|
1783
1919
|
this._mounted,
|
|
@@ -1813,7 +1949,7 @@ function pt(e, t) {
|
|
|
1813
1949
|
}
|
|
1814
1950
|
attributeChangedCallback(r, i, n) {
|
|
1815
1951
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1816
|
-
this._applyProps(t),
|
|
1952
|
+
this._applyProps(t), Ue(
|
|
1817
1953
|
t,
|
|
1818
1954
|
r,
|
|
1819
1955
|
i,
|
|
@@ -1823,15 +1959,15 @@ function pt(e, t) {
|
|
|
1823
1959
|
});
|
|
1824
1960
|
}
|
|
1825
1961
|
static get observedAttributes() {
|
|
1826
|
-
return t.props ? Object.keys(t.props).map(
|
|
1962
|
+
return t.props ? Object.keys(t.props).map(Y) : [];
|
|
1827
1963
|
}
|
|
1828
1964
|
_applyComputed(r) {
|
|
1829
1965
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1830
1966
|
r.computed && Object.entries(r.computed).forEach(([i, n]) => {
|
|
1831
1967
|
Object.defineProperty(this.context, i, {
|
|
1832
1968
|
get: () => {
|
|
1833
|
-
const
|
|
1834
|
-
return
|
|
1969
|
+
const o = n(this.context);
|
|
1970
|
+
return J(o);
|
|
1835
1971
|
},
|
|
1836
1972
|
enumerable: !0
|
|
1837
1973
|
});
|
|
@@ -1841,7 +1977,7 @@ function pt(e, t) {
|
|
|
1841
1977
|
// --- Render ---
|
|
1842
1978
|
_render(r) {
|
|
1843
1979
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1844
|
-
|
|
1980
|
+
ut(
|
|
1845
1981
|
this.shadowRoot,
|
|
1846
1982
|
r,
|
|
1847
1983
|
this.context,
|
|
@@ -1864,7 +2000,7 @@ function pt(e, t) {
|
|
|
1864
2000
|
}
|
|
1865
2001
|
_requestRender() {
|
|
1866
2002
|
this._runLogicWithinErrorBoundary(this._cfg, () => {
|
|
1867
|
-
|
|
2003
|
+
pt(
|
|
1868
2004
|
() => this._render(this._cfg),
|
|
1869
2005
|
this._lastRenderTime,
|
|
1870
2006
|
this._renderCount,
|
|
@@ -1911,11 +2047,11 @@ function pt(e, t) {
|
|
|
1911
2047
|
// --- State, props, computed ---
|
|
1912
2048
|
_initContext(r) {
|
|
1913
2049
|
try {
|
|
1914
|
-
let i = function(
|
|
1915
|
-
return Array.isArray(
|
|
1916
|
-
get(a, f,
|
|
1917
|
-
const
|
|
1918
|
-
return typeof
|
|
2050
|
+
let i = function(o, s = "") {
|
|
2051
|
+
return Array.isArray(o) ? new Proxy(o, {
|
|
2052
|
+
get(a, f, p) {
|
|
2053
|
+
const h = Reflect.get(a, f, p);
|
|
2054
|
+
return typeof h == "function" && typeof f == "string" && [
|
|
1919
2055
|
"push",
|
|
1920
2056
|
"pop",
|
|
1921
2057
|
"shift",
|
|
@@ -1923,44 +2059,44 @@ function pt(e, t) {
|
|
|
1923
2059
|
"splice",
|
|
1924
2060
|
"sort",
|
|
1925
2061
|
"reverse"
|
|
1926
|
-
].includes(f) ? function(...
|
|
1927
|
-
const
|
|
2062
|
+
].includes(f) ? function(...u) {
|
|
2063
|
+
const c = h.apply(a, u);
|
|
1928
2064
|
if (!n._initializing) {
|
|
1929
|
-
const
|
|
1930
|
-
n._triggerWatchers(
|
|
2065
|
+
const w = s || "root";
|
|
2066
|
+
n._triggerWatchers(w, a), n._render(r);
|
|
1931
2067
|
}
|
|
1932
|
-
return
|
|
1933
|
-
} :
|
|
2068
|
+
return c;
|
|
2069
|
+
} : h;
|
|
1934
2070
|
},
|
|
1935
|
-
set(a, f,
|
|
1936
|
-
if (a[f] =
|
|
1937
|
-
const
|
|
1938
|
-
n._triggerWatchers(
|
|
2071
|
+
set(a, f, p) {
|
|
2072
|
+
if (a[f] = p, !n._initializing) {
|
|
2073
|
+
const h = s ? `${s}.${String(f)}` : String(f);
|
|
2074
|
+
n._triggerWatchers(h, p), n._render(r);
|
|
1939
2075
|
}
|
|
1940
2076
|
return !0;
|
|
1941
2077
|
},
|
|
1942
2078
|
deleteProperty(a, f) {
|
|
1943
2079
|
if (delete a[f], !n._initializing) {
|
|
1944
|
-
const
|
|
1945
|
-
n._triggerWatchers(
|
|
2080
|
+
const p = s ? `${s}.${String(f)}` : String(f);
|
|
2081
|
+
n._triggerWatchers(p, void 0), n._render(r);
|
|
1946
2082
|
}
|
|
1947
2083
|
return !0;
|
|
1948
2084
|
}
|
|
1949
|
-
}) :
|
|
1950
|
-
const f =
|
|
1951
|
-
|
|
1952
|
-
}), new Proxy(
|
|
1953
|
-
set(a, f,
|
|
1954
|
-
const
|
|
1955
|
-
return a[f] = i(
|
|
1956
|
-
|
|
2085
|
+
}) : o && typeof o == "object" ? (Object.keys(o).forEach((a) => {
|
|
2086
|
+
const f = s ? `${s}.${a}` : a;
|
|
2087
|
+
o[a] = i(o[a], f);
|
|
2088
|
+
}), new Proxy(o, {
|
|
2089
|
+
set(a, f, p) {
|
|
2090
|
+
const h = s ? `${s}.${String(f)}` : String(f);
|
|
2091
|
+
return a[f] = i(p, h), n._initializing || (n._triggerWatchers(
|
|
2092
|
+
h,
|
|
1957
2093
|
a[f]
|
|
1958
2094
|
), n._render(r)), !0;
|
|
1959
2095
|
},
|
|
1960
|
-
get(a, f,
|
|
1961
|
-
return Reflect.get(a, f,
|
|
2096
|
+
get(a, f, p) {
|
|
2097
|
+
return Reflect.get(a, f, p);
|
|
1962
2098
|
}
|
|
1963
|
-
})) :
|
|
2099
|
+
})) : o;
|
|
1964
2100
|
};
|
|
1965
2101
|
const n = this;
|
|
1966
2102
|
return i({ ...r.state });
|
|
@@ -1970,7 +2106,7 @@ function pt(e, t) {
|
|
|
1970
2106
|
}
|
|
1971
2107
|
_initWatchers(r) {
|
|
1972
2108
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1973
|
-
|
|
2109
|
+
qe(
|
|
1974
2110
|
this.context,
|
|
1975
2111
|
this._watchers,
|
|
1976
2112
|
r.watch || {}
|
|
@@ -1978,12 +2114,12 @@ function pt(e, t) {
|
|
|
1978
2114
|
});
|
|
1979
2115
|
}
|
|
1980
2116
|
_triggerWatchers(r, i) {
|
|
1981
|
-
|
|
2117
|
+
Ie(this.context, this._watchers, r, i);
|
|
1982
2118
|
}
|
|
1983
2119
|
_applyProps(r) {
|
|
1984
2120
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1985
2121
|
try {
|
|
1986
|
-
|
|
2122
|
+
Ne(this, r, this.context);
|
|
1987
2123
|
} catch (i) {
|
|
1988
2124
|
this._hasError = !0, r.onError && r.onError(i, this.context), r.errorFallback && this.shadowRoot && (this.shadowRoot.innerHTML = r.errorFallback(i, this.context));
|
|
1989
2125
|
}
|
|
@@ -1991,101 +2127,101 @@ function pt(e, t) {
|
|
|
1991
2127
|
}
|
|
1992
2128
|
};
|
|
1993
2129
|
}
|
|
1994
|
-
function
|
|
2130
|
+
function re(e, t = {}, r, i) {
|
|
1995
2131
|
const n = i ?? t.key;
|
|
1996
2132
|
return { tag: e, key: n, props: t, children: r };
|
|
1997
2133
|
}
|
|
1998
|
-
function
|
|
2134
|
+
function ue(e) {
|
|
1999
2135
|
return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
|
|
2000
2136
|
}
|
|
2001
|
-
function
|
|
2002
|
-
return typeof e == "object" && e !== null && "tag" in e && !
|
|
2137
|
+
function ae(e) {
|
|
2138
|
+
return typeof e == "object" && e !== null && "tag" in e && !ue(e);
|
|
2003
2139
|
}
|
|
2004
|
-
function
|
|
2140
|
+
function gt(e, t) {
|
|
2005
2141
|
return e.key != null ? e : { ...e, key: t };
|
|
2006
2142
|
}
|
|
2007
|
-
function
|
|
2008
|
-
const i = {}, n = {},
|
|
2009
|
-
let
|
|
2010
|
-
for (;
|
|
2011
|
-
const
|
|
2012
|
-
let c =
|
|
2013
|
-
|
|
2014
|
-
const
|
|
2015
|
-
if (
|
|
2016
|
-
const [
|
|
2017
|
-
if (
|
|
2018
|
-
const
|
|
2019
|
-
|
|
2143
|
+
function mt(e, t = [], r = {}) {
|
|
2144
|
+
const i = {}, n = {}, o = {}, s = [], a = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
|
|
2145
|
+
let f;
|
|
2146
|
+
for (; f = a.exec(e); ) {
|
|
2147
|
+
const p = f[1], h = f[2], C = (f[4] || f[6]) ?? "", u = C.match(/^{{(\d+)}}$/);
|
|
2148
|
+
let c = u ? t[Number(u[1])] ?? null : C;
|
|
2149
|
+
u || (c === "true" ? c = !0 : c === "false" ? c = !1 : c === "null" ? c = null : isNaN(Number(c)) || (c = Number(c)));
|
|
2150
|
+
const w = ["model", "bind", "show", "class", "style"];
|
|
2151
|
+
if (p === ":") {
|
|
2152
|
+
const [v, d] = h.split(":"), [g, ...m] = v.split(".");
|
|
2153
|
+
if (w.includes(g)) {
|
|
2154
|
+
const x = [...m], l = g === "model" && d ? `model:${d}` : g;
|
|
2155
|
+
o[l] = {
|
|
2020
2156
|
value: c,
|
|
2021
|
-
modifiers:
|
|
2022
|
-
arg:
|
|
2157
|
+
modifiers: x,
|
|
2158
|
+
arg: d
|
|
2023
2159
|
};
|
|
2024
2160
|
} else
|
|
2025
|
-
n[
|
|
2026
|
-
} else if (
|
|
2027
|
-
const
|
|
2028
|
-
i[
|
|
2029
|
-
} else
|
|
2161
|
+
n[h] = c, s.push(h);
|
|
2162
|
+
} else if (p === "@") {
|
|
2163
|
+
const v = "on" + h.charAt(0).toUpperCase() + h.slice(1);
|
|
2164
|
+
i[v] = typeof c == "function" ? c : typeof r[c] == "function" ? r[c] : void 0;
|
|
2165
|
+
} else h === "ref" ? i.ref = c : n[h] = c;
|
|
2030
2166
|
}
|
|
2031
|
-
return { props: i, attrs: n, directives: s };
|
|
2167
|
+
return { props: i, attrs: n, directives: o, bound: s };
|
|
2032
2168
|
}
|
|
2033
|
-
function
|
|
2034
|
-
const i =
|
|
2035
|
-
function
|
|
2036
|
-
return
|
|
2169
|
+
function yt(e, t, r) {
|
|
2170
|
+
const i = ne.length > 0 ? ne[ne.length - 1] : void 0, n = r ?? i;
|
|
2171
|
+
function o(l, b) {
|
|
2172
|
+
return re("#text", {}, l, b);
|
|
2037
2173
|
}
|
|
2038
|
-
let
|
|
2174
|
+
let s = "";
|
|
2039
2175
|
for (let l = 0; l < e.length; l++)
|
|
2040
|
-
|
|
2176
|
+
s += e[l], l < t.length && (s += `{{${l}}}`);
|
|
2041
2177
|
const a = /<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, f = [];
|
|
2042
|
-
let
|
|
2043
|
-
function
|
|
2044
|
-
!l || typeof l != "object" ||
|
|
2045
|
-
if (
|
|
2046
|
-
const
|
|
2178
|
+
let p, h = [], C = null, u = {}, c, w = 0, v = [];
|
|
2179
|
+
function d(l) {
|
|
2180
|
+
!l || typeof l != "object" || ue(l) || (l.props || l.attrs ? (l.props && (u.props || (u.props = {}), Object.assign(u.props, l.props)), l.attrs && (u.attrs || (u.attrs = {}), Object.keys(l.attrs).forEach((b) => {
|
|
2181
|
+
if (b === "style" && u.attrs.style) {
|
|
2182
|
+
const y = u.attrs.style.replace(
|
|
2047
2183
|
/;?\s*$/,
|
|
2048
2184
|
""
|
|
2049
2185
|
), _ = l.attrs.style.replace(/^;?\s*/, "");
|
|
2050
|
-
|
|
2051
|
-
} else if (
|
|
2052
|
-
const
|
|
2053
|
-
.../* @__PURE__ */ new Set([...
|
|
2186
|
+
u.attrs.style = y + "; " + _;
|
|
2187
|
+
} else if (b === "class" && u.attrs.class) {
|
|
2188
|
+
const y = u.attrs.class.trim().split(/\s+/).filter(Boolean), _ = l.attrs.class.trim().split(/\s+/).filter(Boolean), E = [
|
|
2189
|
+
.../* @__PURE__ */ new Set([...y, ..._])
|
|
2054
2190
|
];
|
|
2055
|
-
|
|
2191
|
+
u.attrs.class = E.join(" ");
|
|
2056
2192
|
} else
|
|
2057
|
-
|
|
2058
|
-
}))) : (
|
|
2059
|
-
}
|
|
2060
|
-
function
|
|
2061
|
-
const
|
|
2062
|
-
if (
|
|
2063
|
-
const _ = l.key ??
|
|
2064
|
-
let
|
|
2065
|
-
|
|
2193
|
+
u.attrs[b] = l.attrs[b];
|
|
2194
|
+
}))) : (u.props || (u.props = {}), Object.assign(u.props, l)));
|
|
2195
|
+
}
|
|
2196
|
+
function g(l, b) {
|
|
2197
|
+
const y = C ? h : v;
|
|
2198
|
+
if (ue(l)) {
|
|
2199
|
+
const _ = l.key ?? b;
|
|
2200
|
+
let E = l.children;
|
|
2201
|
+
y.push({
|
|
2066
2202
|
...l,
|
|
2067
2203
|
key: _,
|
|
2068
|
-
children:
|
|
2204
|
+
children: E
|
|
2069
2205
|
});
|
|
2070
2206
|
return;
|
|
2071
2207
|
}
|
|
2072
|
-
if (
|
|
2073
|
-
|
|
2208
|
+
if (ae(l)) {
|
|
2209
|
+
y.push(gt(l, void 0));
|
|
2074
2210
|
return;
|
|
2075
2211
|
}
|
|
2076
2212
|
if (Array.isArray(l)) {
|
|
2077
2213
|
if (l.length === 0) return;
|
|
2078
2214
|
for (let _ = 0; _ < l.length; _++) {
|
|
2079
|
-
const
|
|
2080
|
-
|
|
2215
|
+
const E = l[_];
|
|
2216
|
+
ue(E) || ae(E) || Array.isArray(E) ? g(E, `${b}-${_}`) : E !== null && typeof E == "object" ? d(E) : y.push(o(String(E), `${b}-${_}`));
|
|
2081
2217
|
}
|
|
2082
2218
|
return;
|
|
2083
2219
|
}
|
|
2084
2220
|
if (l !== null && typeof l == "object") {
|
|
2085
|
-
|
|
2221
|
+
d(l);
|
|
2086
2222
|
return;
|
|
2087
2223
|
}
|
|
2088
|
-
|
|
2224
|
+
y.push(o(String(l), b));
|
|
2089
2225
|
}
|
|
2090
2226
|
const m = /* @__PURE__ */ new Set([
|
|
2091
2227
|
"area",
|
|
@@ -2103,91 +2239,122 @@ function mt(e, t, r) {
|
|
|
2103
2239
|
"track",
|
|
2104
2240
|
"wbr"
|
|
2105
2241
|
]);
|
|
2106
|
-
for (;
|
|
2107
|
-
if (
|
|
2108
|
-
const l =
|
|
2242
|
+
for (; p = a.exec(s); )
|
|
2243
|
+
if (p[1]) {
|
|
2244
|
+
const l = p[1], b = p[0][1] === "/", y = p[0][p[0].length - 2] === "/" || m.has(l), {
|
|
2109
2245
|
props: _,
|
|
2110
|
-
attrs:
|
|
2111
|
-
directives:
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
for (const
|
|
2115
|
-
|
|
2246
|
+
attrs: E,
|
|
2247
|
+
directives: S,
|
|
2248
|
+
bound: A
|
|
2249
|
+
} = mt(p[2] || "", t, n), $ = { props: {}, attrs: {} };
|
|
2250
|
+
for (const T in _) $.props[T] = _[T];
|
|
2251
|
+
for (const T in E) $.attrs[T] = E[T];
|
|
2252
|
+
if ($.attrs && Object.prototype.hasOwnProperty.call($.attrs, "key") && !($.props && Object.prototype.hasOwnProperty.call($.props, "key")))
|
|
2116
2253
|
try {
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2254
|
+
$.props.key = $.attrs.key;
|
|
2255
|
+
} catch {
|
|
2256
|
+
}
|
|
2257
|
+
try {
|
|
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:")))
|
|
2283
|
+
try {
|
|
2284
|
+
const T = Symbol.for("cer.registry"), B = globalThis[T], G = !!(B && typeof B.has == "function" && B.has(l)), ee = !!(n && (n.__customElements instanceof Set && n.__customElements.has(l) || Array.isArray(n.__isCustomElements) && n.__isCustomElements.includes(l)));
|
|
2285
|
+
if (!!(l.includes("-") || ee || G))
|
|
2286
|
+
for (const q of Object.keys(S)) {
|
|
2287
|
+
if (q !== "model" && !q.startsWith("model:")) continue;
|
|
2288
|
+
const I = S[q], z = I.arg ?? (q.includes(":") ? q.split(":", 2)[1] : void 0), H = I.value, F = z ?? "modelValue", te = W, k = ce, P = n ? n._state || n : void 0;
|
|
2289
|
+
let R;
|
|
2290
|
+
typeof H == "string" && n ? R = te(P, H) : R = H, $.props[F] = R;
|
|
2124
2291
|
try {
|
|
2125
|
-
const
|
|
2126
|
-
|
|
2292
|
+
const L = Y(F);
|
|
2293
|
+
$.attrs || ($.attrs = {}), R !== void 0 && ($.attrs[L] = R);
|
|
2127
2294
|
} catch {
|
|
2128
2295
|
}
|
|
2129
|
-
|
|
2130
|
-
const O = `update:${
|
|
2131
|
-
|
|
2132
|
-
const
|
|
2133
|
-
if (!
|
|
2134
|
-
const
|
|
2135
|
-
(Array.isArray(
|
|
2136
|
-
}, delete
|
|
2296
|
+
$.isCustomElement = !0;
|
|
2297
|
+
const O = `update:${Y(F)}`, j = "on" + O.charAt(0).toUpperCase() + O.slice(1);
|
|
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];
|
|
2137
2304
|
}
|
|
2138
2305
|
} catch {
|
|
2139
2306
|
}
|
|
2140
|
-
if (Object.keys(
|
|
2141
|
-
const
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
),
|
|
2147
|
-
|
|
2148
|
-
} else
|
|
2149
|
-
tag:
|
|
2150
|
-
props:
|
|
2151
|
-
children:
|
|
2152
|
-
key:
|
|
2153
|
-
}),
|
|
2154
|
-
} else if (typeof
|
|
2155
|
-
const l = Number(
|
|
2156
|
-
b
|
|
2157
|
-
} else if (
|
|
2158
|
-
const l =
|
|
2159
|
-
for (const _ of
|
|
2307
|
+
if (Object.keys(S).length > 0 && ($.directives = { ...S }), b) {
|
|
2308
|
+
const T = re(
|
|
2309
|
+
C,
|
|
2310
|
+
u,
|
|
2311
|
+
h.length === 1 && ae(h[0]) && h[0].tag === "#text" ? typeof h[0].children == "string" ? h[0].children : "" : h.length ? h : void 0,
|
|
2312
|
+
c
|
|
2313
|
+
), B = f.pop();
|
|
2314
|
+
B ? (C = B.tag, u = B.props, c = B.key, h = B.children, h.push(T)) : (v.push(T), C = null, u = {}, c = void 0, h = []);
|
|
2315
|
+
} else y ? C ? h.push(re(l, $, void 0, void 0)) : v.push(re(l, $, void 0, void 0)) : (C && f.push({
|
|
2316
|
+
tag: C,
|
|
2317
|
+
props: u,
|
|
2318
|
+
children: h,
|
|
2319
|
+
key: c
|
|
2320
|
+
}), C = l, u = $, h = []);
|
|
2321
|
+
} else if (typeof p[3] < "u") {
|
|
2322
|
+
const l = Number(p[3]), b = t[l], y = `interp-${l}`;
|
|
2323
|
+
g(b, y);
|
|
2324
|
+
} else if (p[4]) {
|
|
2325
|
+
const l = p[4], b = C ? h : v, y = l.split(/({{\d+}})/);
|
|
2326
|
+
for (const _ of y) {
|
|
2160
2327
|
if (!_) continue;
|
|
2161
|
-
const
|
|
2162
|
-
if (
|
|
2163
|
-
const
|
|
2164
|
-
|
|
2328
|
+
const E = _.match(/^{{(\d+)}}$/);
|
|
2329
|
+
if (E) {
|
|
2330
|
+
const S = Number(E[1]), A = t[S], $ = `interp-${S}`;
|
|
2331
|
+
g(A, $);
|
|
2165
2332
|
} else {
|
|
2166
|
-
const
|
|
2167
|
-
|
|
2333
|
+
const S = `text-${w++}`;
|
|
2334
|
+
b.push(o(_, S));
|
|
2168
2335
|
}
|
|
2169
2336
|
}
|
|
2170
2337
|
}
|
|
2171
|
-
const x =
|
|
2172
|
-
return x.length === 1 ? x[0] : x.length > 1 ? x :
|
|
2338
|
+
const x = v.filter((l) => ae(l) && l.tag === "#text" ? typeof l.children == "string" && l.children.trim() !== "" : !0);
|
|
2339
|
+
return x.length === 1 ? x[0] : x.length > 1 ? x : re("div", {}, "", "fallback-root");
|
|
2173
2340
|
}
|
|
2174
|
-
function
|
|
2341
|
+
function Z(e, ...t) {
|
|
2175
2342
|
const r = t[t.length - 1], i = typeof r == "object" && r && !Array.isArray(r) ? r : void 0;
|
|
2176
|
-
return
|
|
2343
|
+
return yt(e, t, i);
|
|
2177
2344
|
}
|
|
2178
|
-
const
|
|
2345
|
+
const Re = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, K = (e, t) => {
|
|
2179
2346
|
for (const r of e) {
|
|
2180
|
-
const i = [], n = r.path.replace(/:[^/]+/g, (a) => (i.push(a.slice(1)), "([^/]+)")),
|
|
2181
|
-
if (
|
|
2347
|
+
const i = [], n = r.path.replace(/:[^/]+/g, (a) => (i.push(a.slice(1)), "([^/]+)")), o = new RegExp(`^${n}$`), s = t.match(o);
|
|
2348
|
+
if (s) {
|
|
2182
2349
|
const a = {};
|
|
2183
|
-
return i.forEach((f,
|
|
2184
|
-
a[f] =
|
|
2350
|
+
return i.forEach((f, p) => {
|
|
2351
|
+
a[f] = s[p + 1];
|
|
2185
2352
|
}), { route: r, params: a };
|
|
2186
2353
|
}
|
|
2187
2354
|
}
|
|
2188
2355
|
return { route: null, params: {} };
|
|
2189
2356
|
}, ke = {};
|
|
2190
|
-
async function
|
|
2357
|
+
async function bt(e) {
|
|
2191
2358
|
if (e.component) return e.component;
|
|
2192
2359
|
if (e.load) {
|
|
2193
2360
|
if (ke[e.path]) return ke[e.path];
|
|
@@ -2200,160 +2367,160 @@ async function yt(e) {
|
|
|
2200
2367
|
}
|
|
2201
2368
|
throw new Error(`No component or loader defined for route: ${e.path}`);
|
|
2202
2369
|
}
|
|
2203
|
-
function
|
|
2370
|
+
function wt(e) {
|
|
2204
2371
|
const { routes: t, base: r = "", initialUrl: i } = e;
|
|
2205
|
-
let n,
|
|
2206
|
-
const
|
|
2207
|
-
const
|
|
2208
|
-
if (
|
|
2372
|
+
let n, o, s, a, f, p, h;
|
|
2373
|
+
const C = async (v, d) => {
|
|
2374
|
+
const g = t.find((m) => K([m], v.path).route !== null);
|
|
2375
|
+
if (g?.beforeEnter)
|
|
2209
2376
|
try {
|
|
2210
|
-
const m = await
|
|
2211
|
-
return typeof m == "string" ? (await
|
|
2377
|
+
const m = await g.beforeEnter(v, d);
|
|
2378
|
+
return typeof m == "string" ? (await w(m, !0), !1) : m !== !1;
|
|
2212
2379
|
} catch (m) {
|
|
2213
2380
|
return console.error("beforeEnter error", m), !1;
|
|
2214
2381
|
}
|
|
2215
2382
|
return !0;
|
|
2216
|
-
},
|
|
2217
|
-
const
|
|
2218
|
-
if (
|
|
2383
|
+
}, u = async (v, d) => {
|
|
2384
|
+
const g = t.find((m) => K([m], v.path).route !== null);
|
|
2385
|
+
if (g?.onEnter)
|
|
2219
2386
|
try {
|
|
2220
|
-
const m = await
|
|
2221
|
-
return typeof m == "string" ? (await
|
|
2387
|
+
const m = await g.onEnter(v, d);
|
|
2388
|
+
return typeof m == "string" ? (await w(m, !0), !1) : m !== !1;
|
|
2222
2389
|
} catch (m) {
|
|
2223
2390
|
return console.error("onEnter error", m), !1;
|
|
2224
2391
|
}
|
|
2225
2392
|
return !0;
|
|
2226
|
-
},
|
|
2227
|
-
const
|
|
2228
|
-
if (
|
|
2393
|
+
}, c = (v, d) => {
|
|
2394
|
+
const g = t.find((m) => K([m], v.path).route !== null);
|
|
2395
|
+
if (g?.afterEnter)
|
|
2229
2396
|
try {
|
|
2230
|
-
|
|
2397
|
+
g.afterEnter(v, d);
|
|
2231
2398
|
} catch (m) {
|
|
2232
2399
|
console.error("afterEnter error", m);
|
|
2233
2400
|
}
|
|
2234
|
-
},
|
|
2401
|
+
}, w = async (v, d = !1) => {
|
|
2235
2402
|
try {
|
|
2236
|
-
const
|
|
2237
|
-
path:
|
|
2403
|
+
const g = {
|
|
2404
|
+
path: v.replace(r, "") || "/",
|
|
2238
2405
|
query: {}
|
|
2239
|
-
}, m =
|
|
2240
|
-
if (!m) throw new Error(`No route found for ${
|
|
2241
|
-
const x =
|
|
2242
|
-
path:
|
|
2406
|
+
}, m = K(t, g.path);
|
|
2407
|
+
if (!m) throw new Error(`No route found for ${g.path}`);
|
|
2408
|
+
const x = s.getState(), l = {
|
|
2409
|
+
path: g.path,
|
|
2243
2410
|
params: m.params,
|
|
2244
|
-
query:
|
|
2411
|
+
query: g.query
|
|
2245
2412
|
};
|
|
2246
|
-
if (!await
|
|
2247
|
-
typeof window < "u" && typeof document < "u" && (
|
|
2248
|
-
} catch (
|
|
2249
|
-
console.error("Navigation error:",
|
|
2413
|
+
if (!await C(l, x) || !await u(l, x)) return;
|
|
2414
|
+
typeof window < "u" && typeof document < "u" && (d ? window.history.replaceState({}, "", r + v) : window.history.pushState({}, "", r + v)), s.setState(l), c(l, x);
|
|
2415
|
+
} catch (g) {
|
|
2416
|
+
console.error("Navigation error:", g);
|
|
2250
2417
|
}
|
|
2251
2418
|
};
|
|
2252
2419
|
if (typeof window < "u" && typeof document < "u") {
|
|
2253
2420
|
n = () => {
|
|
2254
|
-
const
|
|
2255
|
-
return { path:
|
|
2256
|
-
},
|
|
2257
|
-
const
|
|
2258
|
-
|
|
2259
|
-
path:
|
|
2260
|
-
params:
|
|
2261
|
-
query:
|
|
2262
|
-
}), a = async (
|
|
2263
|
-
const
|
|
2264
|
-
await
|
|
2265
|
-
}, window.addEventListener("popstate", () => a(!0)), f = (
|
|
2421
|
+
const d = new URL(window.location.href), g = d.pathname.replace(r, "") || "/", m = Re(d.search);
|
|
2422
|
+
return { path: g, query: m };
|
|
2423
|
+
}, o = n();
|
|
2424
|
+
const v = K(t, o.path);
|
|
2425
|
+
s = $e({
|
|
2426
|
+
path: o.path,
|
|
2427
|
+
params: v.params,
|
|
2428
|
+
query: o.query
|
|
2429
|
+
}), a = async (d = !1) => {
|
|
2430
|
+
const g = n();
|
|
2431
|
+
await w(g.path, d);
|
|
2432
|
+
}, window.addEventListener("popstate", () => a(!0)), f = (d) => w(d, !1), p = (d) => w(d, !0), h = () => window.history.back();
|
|
2266
2433
|
} else {
|
|
2267
2434
|
n = () => {
|
|
2268
|
-
const
|
|
2435
|
+
const g = new URL(i || "/", "http://localhost"), m = g.pathname.replace(r, "") || "/", x = Re(g.search);
|
|
2269
2436
|
return { path: m, query: x };
|
|
2270
|
-
},
|
|
2271
|
-
const
|
|
2272
|
-
|
|
2273
|
-
path:
|
|
2274
|
-
params:
|
|
2275
|
-
query:
|
|
2437
|
+
}, o = n();
|
|
2438
|
+
const v = K(t, o.path);
|
|
2439
|
+
s = $e({
|
|
2440
|
+
path: o.path,
|
|
2441
|
+
params: v.params,
|
|
2442
|
+
query: o.query
|
|
2276
2443
|
}), a = async () => {
|
|
2277
|
-
const
|
|
2278
|
-
await
|
|
2444
|
+
const g = n();
|
|
2445
|
+
await d(g.path);
|
|
2279
2446
|
};
|
|
2280
|
-
const
|
|
2447
|
+
const d = async (g) => {
|
|
2281
2448
|
try {
|
|
2282
2449
|
const m = {
|
|
2283
|
-
path:
|
|
2450
|
+
path: g.replace(r, "") || "/",
|
|
2284
2451
|
query: {}
|
|
2285
|
-
}, x =
|
|
2452
|
+
}, x = K(t, m.path);
|
|
2286
2453
|
if (!x) throw new Error(`No route found for ${m.path}`);
|
|
2287
|
-
const l =
|
|
2454
|
+
const l = s.getState(), b = {
|
|
2288
2455
|
path: m.path,
|
|
2289
2456
|
params: x.params,
|
|
2290
2457
|
query: m.query
|
|
2291
|
-
},
|
|
2292
|
-
if (
|
|
2458
|
+
}, y = t.find((_) => K([_], b.path).route !== null);
|
|
2459
|
+
if (y?.beforeEnter)
|
|
2293
2460
|
try {
|
|
2294
|
-
const _ = await
|
|
2461
|
+
const _ = await y.beforeEnter(b, l);
|
|
2295
2462
|
if (typeof _ == "string") {
|
|
2296
|
-
await
|
|
2463
|
+
await d(_);
|
|
2297
2464
|
return;
|
|
2298
2465
|
}
|
|
2299
2466
|
if (_ === !1) return;
|
|
2300
2467
|
} catch {
|
|
2301
2468
|
return;
|
|
2302
2469
|
}
|
|
2303
|
-
if (
|
|
2470
|
+
if (y?.onEnter)
|
|
2304
2471
|
try {
|
|
2305
|
-
const _ = await
|
|
2472
|
+
const _ = await y.onEnter(b, l);
|
|
2306
2473
|
if (typeof _ == "string") {
|
|
2307
|
-
await
|
|
2474
|
+
await d(_);
|
|
2308
2475
|
return;
|
|
2309
2476
|
}
|
|
2310
2477
|
if (_ === !1) return;
|
|
2311
2478
|
} catch {
|
|
2312
2479
|
return;
|
|
2313
2480
|
}
|
|
2314
|
-
if (
|
|
2481
|
+
if (s.setState(b), y?.afterEnter)
|
|
2315
2482
|
try {
|
|
2316
|
-
|
|
2483
|
+
y.afterEnter(b, l);
|
|
2317
2484
|
} catch {
|
|
2318
2485
|
}
|
|
2319
2486
|
} catch {
|
|
2320
2487
|
}
|
|
2321
2488
|
};
|
|
2322
|
-
f = async (
|
|
2489
|
+
f = async (g) => d(g), p = async (g) => d(g), h = () => {
|
|
2323
2490
|
};
|
|
2324
2491
|
}
|
|
2325
2492
|
return {
|
|
2326
|
-
store:
|
|
2493
|
+
store: s,
|
|
2327
2494
|
push: f,
|
|
2328
|
-
replace:
|
|
2329
|
-
back:
|
|
2330
|
-
subscribe:
|
|
2331
|
-
matchRoute: (
|
|
2332
|
-
getCurrent: () =>
|
|
2333
|
-
resolveRouteComponent:
|
|
2495
|
+
replace: p,
|
|
2496
|
+
back: h,
|
|
2497
|
+
subscribe: s.subscribe,
|
|
2498
|
+
matchRoute: (v) => K(t, v),
|
|
2499
|
+
getCurrent: () => s.getState(),
|
|
2500
|
+
resolveRouteComponent: bt
|
|
2334
2501
|
};
|
|
2335
2502
|
}
|
|
2336
|
-
function
|
|
2337
|
-
return
|
|
2503
|
+
function At(e, t) {
|
|
2504
|
+
return K(e, t);
|
|
2338
2505
|
}
|
|
2339
|
-
function
|
|
2340
|
-
const t =
|
|
2341
|
-
return
|
|
2506
|
+
function Tt(e) {
|
|
2507
|
+
const t = wt(e);
|
|
2508
|
+
return Le("router-view", {
|
|
2342
2509
|
async render() {
|
|
2343
|
-
if (!t) return
|
|
2510
|
+
if (!t) return Z`<div>Router not initialized.</div>`;
|
|
2344
2511
|
const r = t.getCurrent(), { path: i } = r, n = t.matchRoute(i);
|
|
2345
|
-
if (!n.route) return
|
|
2512
|
+
if (!n.route) return Z`<div>Not found</div>`;
|
|
2346
2513
|
try {
|
|
2347
|
-
const
|
|
2348
|
-
if (typeof
|
|
2349
|
-
return { tag:
|
|
2350
|
-
if (typeof
|
|
2351
|
-
const
|
|
2514
|
+
const o = await t.resolveRouteComponent(n.route);
|
|
2515
|
+
if (typeof o == "string")
|
|
2516
|
+
return { tag: o, props: {}, children: [] };
|
|
2517
|
+
if (typeof o == "function") {
|
|
2518
|
+
const s = o(), a = s instanceof Promise ? await s : s;
|
|
2352
2519
|
return typeof a == "string" ? { tag: a, props: {}, children: [] } : a;
|
|
2353
2520
|
}
|
|
2354
|
-
return
|
|
2521
|
+
return Z`<div>Invalid route component</div>`;
|
|
2355
2522
|
} catch {
|
|
2356
|
-
return
|
|
2523
|
+
return Z`<div>Invalid route component</div>`;
|
|
2357
2524
|
}
|
|
2358
2525
|
},
|
|
2359
2526
|
onConnected(r) {
|
|
@@ -2361,7 +2528,7 @@ function At(e) {
|
|
|
2361
2528
|
typeof r.requestRender == "function" && r.requestRender();
|
|
2362
2529
|
});
|
|
2363
2530
|
}
|
|
2364
|
-
}),
|
|
2531
|
+
}), Le("router-link", {
|
|
2365
2532
|
state: {},
|
|
2366
2533
|
props: {
|
|
2367
2534
|
to: { type: String, default: "" },
|
|
@@ -2374,7 +2541,7 @@ function At(e) {
|
|
|
2374
2541
|
disabled: { type: Boolean, default: !1 },
|
|
2375
2542
|
external: { type: Boolean, default: !1 },
|
|
2376
2543
|
class: { type: String, default: "" },
|
|
2377
|
-
style: { type: String, default:
|
|
2544
|
+
style: { type: String, default: Pe`
|
|
2378
2545
|
[aria-disabled="true"] {
|
|
2379
2546
|
pointer-events: none;
|
|
2380
2547
|
opacity: 0.5;
|
|
@@ -2383,30 +2550,30 @@ function At(e) {
|
|
|
2383
2550
|
},
|
|
2384
2551
|
style: (r) => r.style,
|
|
2385
2552
|
render: (r) => {
|
|
2386
|
-
const i = t.getCurrent(), n = r.to,
|
|
2387
|
-
for (const
|
|
2388
|
-
const
|
|
2389
|
-
...
|
|
2553
|
+
const i = t.getCurrent(), n = r.to, o = r.exact, s = r.exactActiveClass, a = r.activeClass, f = r.ariaCurrentValue, p = r.tag, h = r.disabled, C = r.external, u = i.path === n, c = o ? u : i && typeof i.path == "string" ? i.path.startsWith(n) : !1, w = u ? `aria-current="${f}"` : "", v = (r.class || "").split(/\s+/).filter(Boolean), d = {};
|
|
2554
|
+
for (const b of v) d[b] = !0;
|
|
2555
|
+
const g = {
|
|
2556
|
+
...d,
|
|
2390
2557
|
// Also include the configurable names (may duplicate the above)
|
|
2391
|
-
[a]:
|
|
2392
|
-
[
|
|
2393
|
-
}, m =
|
|
2394
|
-
return
|
|
2395
|
-
${
|
|
2558
|
+
[a]: c,
|
|
2559
|
+
[s]: u
|
|
2560
|
+
}, m = p === "button", x = h ? m ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", l = C && (p === "a" || !p) ? 'target="_blank" rel="noopener noreferrer"' : "";
|
|
2561
|
+
return Z`
|
|
2562
|
+
${ze().when(m, Z`
|
|
2396
2563
|
<button
|
|
2397
2564
|
part="button"
|
|
2398
|
-
:class="${
|
|
2399
|
-
${
|
|
2565
|
+
:class="${g}"
|
|
2566
|
+
${w}
|
|
2400
2567
|
${x}
|
|
2401
2568
|
${l}
|
|
2402
2569
|
@click="navigate"
|
|
2403
2570
|
><slot></slot></button>
|
|
2404
|
-
`).otherwise(
|
|
2571
|
+
`).otherwise(Z`
|
|
2405
2572
|
<a
|
|
2406
2573
|
part="link"
|
|
2407
2574
|
href="${n}"
|
|
2408
|
-
:class="${
|
|
2409
|
-
${
|
|
2575
|
+
:class="${g}"
|
|
2576
|
+
${w}
|
|
2410
2577
|
${x}
|
|
2411
2578
|
${l}
|
|
2412
2579
|
@click="navigate"
|
|
@@ -2424,26 +2591,26 @@ function At(e) {
|
|
|
2424
2591
|
}), t;
|
|
2425
2592
|
}
|
|
2426
2593
|
export {
|
|
2427
|
-
|
|
2428
|
-
|
|
2594
|
+
X as GlobalEventBus,
|
|
2595
|
+
Le as component,
|
|
2429
2596
|
$e as createStore,
|
|
2430
|
-
|
|
2597
|
+
Pe as css,
|
|
2431
2598
|
kt as each,
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2599
|
+
_t as emit,
|
|
2600
|
+
ie as eventBus,
|
|
2601
|
+
Z as html,
|
|
2602
|
+
Tt as initRouter,
|
|
2603
|
+
Ct as listen,
|
|
2604
|
+
ze as match,
|
|
2605
|
+
K as matchRoute,
|
|
2606
|
+
At as matchRouteSSR,
|
|
2607
|
+
St as off,
|
|
2441
2608
|
$t as on,
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2609
|
+
Et as once,
|
|
2610
|
+
Re as parseQuery,
|
|
2611
|
+
ge as renderToString,
|
|
2612
|
+
bt as resolveRouteComponent,
|
|
2613
|
+
wt as useRouter,
|
|
2614
|
+
vt as when
|
|
2448
2615
|
};
|
|
2449
2616
|
//# sourceMappingURL=custom-elements-runtime.es.js.map
|