@jasonshimmy/custom-elements-runtime 0.1.1 → 0.1.2
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 +31 -97
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +540 -520
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +31 -97
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/style-utils.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
function Re(e) {
|
|
2
2
|
let t = new Proxy(e, {
|
|
3
|
-
set: (
|
|
3
|
+
set: (i, l, c) => (i[l] = c, s(), !0)
|
|
4
4
|
});
|
|
5
5
|
const n = [];
|
|
6
|
-
function r(
|
|
7
|
-
n.push(
|
|
6
|
+
function r(i) {
|
|
7
|
+
n.push(i), i(t);
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function o() {
|
|
10
10
|
return t;
|
|
11
11
|
}
|
|
12
12
|
function s() {
|
|
13
|
-
n.forEach((
|
|
13
|
+
n.forEach((i) => i(t));
|
|
14
14
|
}
|
|
15
|
-
return { subscribe: r, getState:
|
|
15
|
+
return { subscribe: r, getState: o };
|
|
16
16
|
}
|
|
17
17
|
class B extends EventTarget {
|
|
18
18
|
handlers = {};
|
|
@@ -31,10 +31,10 @@ class B extends EventTarget {
|
|
|
31
31
|
* @param data - Optional event payload
|
|
32
32
|
*/
|
|
33
33
|
emit(t, n) {
|
|
34
|
-
const r = Date.now(),
|
|
35
|
-
if (!
|
|
34
|
+
const r = Date.now(), o = this.eventCounters.get(t);
|
|
35
|
+
if (!o || r - o.window > 1e3)
|
|
36
36
|
this.eventCounters.set(t, { count: 1, window: r });
|
|
37
|
-
else if (
|
|
37
|
+
else if (o.count++, o.count > 50 && (console.error(`Event storm detected for "${t}": ${o.count} events in 1 second. Throttling...`), o.count > 100)) {
|
|
38
38
|
console.warn(`Blocking further "${t}" events to prevent infinite loop`);
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
@@ -45,9 +45,9 @@ class B extends EventTarget {
|
|
|
45
45
|
cancelable: !0
|
|
46
46
|
}));
|
|
47
47
|
const s = this.handlers[t];
|
|
48
|
-
s && s.forEach((
|
|
48
|
+
s && s.forEach((i) => {
|
|
49
49
|
try {
|
|
50
|
-
|
|
50
|
+
i(n);
|
|
51
51
|
} catch (l) {
|
|
52
52
|
console.error(`Error in global event handler for "${t}":`, l);
|
|
53
53
|
}
|
|
@@ -93,8 +93,8 @@ class B extends EventTarget {
|
|
|
93
93
|
*/
|
|
94
94
|
once(t, n) {
|
|
95
95
|
return new Promise((r) => {
|
|
96
|
-
const
|
|
97
|
-
|
|
96
|
+
const o = this.on(t, (s) => {
|
|
97
|
+
o(), n(s), r(s);
|
|
98
98
|
});
|
|
99
99
|
});
|
|
100
100
|
}
|
|
@@ -140,8 +140,8 @@ class B extends EventTarget {
|
|
|
140
140
|
}
|
|
141
141
|
const Be = B.getInstance();
|
|
142
142
|
function P(e, t = {}, n, r) {
|
|
143
|
-
const
|
|
144
|
-
return { tag: e, key:
|
|
143
|
+
const o = r ?? t.key;
|
|
144
|
+
return { tag: e, key: o, props: t, children: n };
|
|
145
145
|
}
|
|
146
146
|
function I(e) {
|
|
147
147
|
return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
|
|
@@ -153,63 +153,63 @@ function le(e, t) {
|
|
|
153
153
|
return e.key != null ? e : { ...e, key: t };
|
|
154
154
|
}
|
|
155
155
|
function ce(e, t = [], n = {}) {
|
|
156
|
-
const r = {},
|
|
156
|
+
const r = {}, o = {}, s = {}, i = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
|
|
157
157
|
let l;
|
|
158
|
-
for (; l =
|
|
159
|
-
const
|
|
160
|
-
let
|
|
161
|
-
if (
|
|
162
|
-
typeof
|
|
163
|
-
else if (
|
|
164
|
-
const
|
|
165
|
-
r[
|
|
166
|
-
} else if (
|
|
167
|
-
const [
|
|
168
|
-
let
|
|
169
|
-
if (
|
|
170
|
-
const b = ["trim", "number", "lazy"], g =
|
|
171
|
-
let x =
|
|
158
|
+
for (; l = i.exec(e); ) {
|
|
159
|
+
const c = l[1], d = l[2], p = (l[4] || l[6]) ?? "", u = p.match(/^{{(\d+)}}$/);
|
|
160
|
+
let f = u ? t[Number(u[1])] ?? null : p;
|
|
161
|
+
if (u || (f === "true" ? f = !0 : f === "false" ? f = !1 : f === "null" ? f = null : isNaN(Number(f)) || (f = Number(f))), c === ":")
|
|
162
|
+
typeof f == "boolean" ? o[d] = f : f != null && (r[d] = f);
|
|
163
|
+
else if (c === "@") {
|
|
164
|
+
const m = "on" + d.charAt(0).toUpperCase() + d.slice(1);
|
|
165
|
+
r[m] = typeof f == "function" ? f : typeof n[f] == "function" ? n[f] : void 0;
|
|
166
|
+
} else if (c === "#") {
|
|
167
|
+
const [m, ...h] = d.split("."), S = [...h];
|
|
168
|
+
let y = f, a = [...S];
|
|
169
|
+
if (m === "model" && typeof y == "string" && y.includes(".")) {
|
|
170
|
+
const b = ["trim", "number", "lazy"], g = y.split(".");
|
|
171
|
+
let x = y;
|
|
172
172
|
const w = [];
|
|
173
173
|
for (let k = g.length - 1; k > 0 && b.includes(g[k]); k--)
|
|
174
174
|
w.unshift(g[k]), x = g.slice(0, k).join(".");
|
|
175
|
-
|
|
175
|
+
y = x, a.push(...w);
|
|
176
176
|
}
|
|
177
|
-
s[
|
|
178
|
-
value:
|
|
177
|
+
s[m] = {
|
|
178
|
+
value: y,
|
|
179
179
|
modifiers: a
|
|
180
180
|
};
|
|
181
|
-
} else
|
|
181
|
+
} else d === "ref" ? r.ref = f : o[d] = f;
|
|
182
182
|
}
|
|
183
|
-
return { props: r, attrs:
|
|
183
|
+
return { props: r, attrs: o, directives: s };
|
|
184
184
|
}
|
|
185
185
|
function fe(e, t, n) {
|
|
186
186
|
function r(a, b) {
|
|
187
187
|
return P("#text", {}, a, b);
|
|
188
188
|
}
|
|
189
|
-
let
|
|
189
|
+
let o = "";
|
|
190
190
|
for (let a = 0; a < e.length; a++)
|
|
191
|
-
|
|
192
|
-
const s = /<\/?([a-zA-Z0-9-]+)([^>]*)\/?>|{{(\d+)}}|([^<]+)/g,
|
|
193
|
-
let l = null,
|
|
191
|
+
o += e[a], a < t.length && (o += `{{${a}}}`);
|
|
192
|
+
const s = /<\/?([a-zA-Z0-9-]+)([^>]*)\/?>|{{(\d+)}}|([^<]+)/g, i = [];
|
|
193
|
+
let l = null, c, d = [], p = null, u = {}, f, m = 0, h = [];
|
|
194
194
|
function S(a) {
|
|
195
|
-
!a || typeof a != "object" || I(a) || (a.props || a.attrs ? (a.props && (
|
|
196
|
-
if (b === "style" &&
|
|
197
|
-
const g =
|
|
195
|
+
!a || typeof a != "object" || I(a) || (a.props || a.attrs ? (a.props && (u.props || (u.props = {}), Object.assign(u.props, a.props)), a.attrs && (u.attrs || (u.attrs = {}), Object.keys(a.attrs).forEach((b) => {
|
|
196
|
+
if (b === "style" && u.attrs.style) {
|
|
197
|
+
const g = u.attrs.style.replace(
|
|
198
198
|
/;?\s*$/,
|
|
199
199
|
""
|
|
200
200
|
), x = a.attrs.style.replace(/^;?\s*/, "");
|
|
201
|
-
|
|
202
|
-
} else if (b === "class" &&
|
|
203
|
-
const g =
|
|
201
|
+
u.attrs.style = g + "; " + x;
|
|
202
|
+
} else if (b === "class" && u.attrs.class) {
|
|
203
|
+
const g = u.attrs.class.trim().split(/\s+/).filter(Boolean), x = a.attrs.class.trim().split(/\s+/).filter(Boolean), w = [
|
|
204
204
|
.../* @__PURE__ */ new Set([...g, ...x])
|
|
205
205
|
];
|
|
206
|
-
|
|
206
|
+
u.attrs.class = w.join(" ");
|
|
207
207
|
} else
|
|
208
|
-
|
|
209
|
-
}))) : (
|
|
208
|
+
u.attrs[b] = a.attrs[b];
|
|
209
|
+
}))) : (u.props || (u.props = {}), Object.assign(u.props, a)));
|
|
210
210
|
}
|
|
211
|
-
function
|
|
212
|
-
const g = p ?
|
|
211
|
+
function y(a, b) {
|
|
212
|
+
const g = p ? d : h;
|
|
213
213
|
if (I(a)) {
|
|
214
214
|
const x = a.key ?? b;
|
|
215
215
|
let w = a.children;
|
|
@@ -228,7 +228,7 @@ function fe(e, t, n) {
|
|
|
228
228
|
if (a.length === 0) return;
|
|
229
229
|
for (let x = 0; x < a.length; x++) {
|
|
230
230
|
const w = a[x];
|
|
231
|
-
I(w) || R(w) || Array.isArray(w) ?
|
|
231
|
+
I(w) || R(w) || Array.isArray(w) ? y(w, `${b}-${x}`) : w !== null && typeof w == "object" ? S(w) : g.push(r(String(w), `${b}-${x}`));
|
|
232
232
|
}
|
|
233
233
|
return;
|
|
234
234
|
}
|
|
@@ -238,13 +238,13 @@ function fe(e, t, n) {
|
|
|
238
238
|
}
|
|
239
239
|
g.push(r(String(a), b));
|
|
240
240
|
}
|
|
241
|
-
for (;
|
|
242
|
-
if (
|
|
243
|
-
const a =
|
|
241
|
+
for (; c = s.exec(o); )
|
|
242
|
+
if (c[1]) {
|
|
243
|
+
const a = c[1], b = c[0][1] === "/", g = c[0][c[0].length - 2] === "/", {
|
|
244
244
|
props: x,
|
|
245
245
|
attrs: w,
|
|
246
246
|
directives: k
|
|
247
|
-
} = ce(
|
|
247
|
+
} = ce(c[2] || "", t, n), $ = { props: {}, attrs: {} };
|
|
248
248
|
for (const v in x) $.props[v] = x[v];
|
|
249
249
|
for (const v in w) $.attrs[v] = w[v];
|
|
250
250
|
for (const [v, _] of Object.entries(k))
|
|
@@ -271,20 +271,20 @@ function fe(e, t, n) {
|
|
|
271
271
|
} else if (A && typeof A == "object")
|
|
272
272
|
for (const [j, L] of Object.entries(A))
|
|
273
273
|
L && E.push(...j.split(/\s+/).filter(Boolean));
|
|
274
|
-
const
|
|
274
|
+
const O = $.attrs.class || "", M = [
|
|
275
275
|
.../* @__PURE__ */ new Set([
|
|
276
|
-
...
|
|
276
|
+
...O.split(/\s+/).filter(Boolean),
|
|
277
277
|
...E
|
|
278
278
|
])
|
|
279
279
|
];
|
|
280
|
-
$.attrs.class =
|
|
280
|
+
$.attrs.class = M.join(" ");
|
|
281
281
|
} else if (v === "style") {
|
|
282
282
|
const A = _.value;
|
|
283
283
|
let E = "";
|
|
284
284
|
if (typeof A == "string")
|
|
285
285
|
E = A;
|
|
286
286
|
else if (A && typeof A == "object") {
|
|
287
|
-
const
|
|
287
|
+
const M = [];
|
|
288
288
|
for (const [j, L] of Object.entries(A))
|
|
289
289
|
if (L != null && L !== "") {
|
|
290
290
|
const N = j.replace(
|
|
@@ -317,12 +317,12 @@ function fe(e, t, n) {
|
|
|
317
317
|
"max-height"
|
|
318
318
|
];
|
|
319
319
|
let X = String(L);
|
|
320
|
-
typeof L == "number" && se.includes(N) && (X = `${L}px`),
|
|
320
|
+
typeof L == "number" && se.includes(N) && (X = `${L}px`), M.push(`${N}: ${X}`);
|
|
321
321
|
}
|
|
322
|
-
E =
|
|
322
|
+
E = M.join("; ") + (M.length > 0 ? ";" : "");
|
|
323
323
|
}
|
|
324
|
-
const
|
|
325
|
-
$.attrs.style =
|
|
324
|
+
const O = $.attrs.style || "";
|
|
325
|
+
$.attrs.style = O + (O && !O.endsWith(";") ? "; " : "") + E;
|
|
326
326
|
}
|
|
327
327
|
const C = {};
|
|
328
328
|
for (const [v, _] of Object.entries(k))
|
|
@@ -330,30 +330,30 @@ function fe(e, t, n) {
|
|
|
330
330
|
if (Object.keys(C).length > 0 && ($.directives = C), b) {
|
|
331
331
|
const v = P(
|
|
332
332
|
p,
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
), _ =
|
|
337
|
-
_ ? (p = _.tag,
|
|
338
|
-
} else g ? (p ?
|
|
333
|
+
u,
|
|
334
|
+
d.length === 1 && R(d[0]) && d[0].tag === "#text" ? typeof d[0].children == "string" ? d[0].children : "" : d.length ? d : void 0,
|
|
335
|
+
f
|
|
336
|
+
), _ = i.pop();
|
|
337
|
+
_ ? (p = _.tag, u = _.props, f = _.key, d = _.children, d.push(v)) : l = v;
|
|
338
|
+
} else g ? (p ? d : h).push(P(a, $, void 0, void 0)) : (p && i.push({
|
|
339
339
|
tag: p,
|
|
340
|
-
props:
|
|
341
|
-
children:
|
|
342
|
-
key:
|
|
343
|
-
}), p = a,
|
|
344
|
-
} else if (typeof
|
|
345
|
-
const a = Number(
|
|
346
|
-
|
|
347
|
-
} else if (
|
|
348
|
-
const a =
|
|
340
|
+
props: u,
|
|
341
|
+
children: d,
|
|
342
|
+
key: f
|
|
343
|
+
}), p = a, u = $, d = []);
|
|
344
|
+
} else if (typeof c[3] < "u") {
|
|
345
|
+
const a = Number(c[3]), b = t[a], g = `interp-${a}`;
|
|
346
|
+
y(b, g);
|
|
347
|
+
} else if (c[4]) {
|
|
348
|
+
const a = c[4], b = p ? d : h, g = a.split(/({{\d+}})/);
|
|
349
349
|
for (const x of g) {
|
|
350
350
|
if (!x) continue;
|
|
351
351
|
const w = x.match(/^{{(\d+)}}$/);
|
|
352
352
|
if (w) {
|
|
353
353
|
const k = Number(w[1]), $ = t[k], C = `interp-${k}`;
|
|
354
|
-
|
|
354
|
+
y($, C);
|
|
355
355
|
} else {
|
|
356
|
-
const k = `text-${
|
|
356
|
+
const k = `text-${m++}`;
|
|
357
357
|
b.push(r(x, k));
|
|
358
358
|
}
|
|
359
359
|
}
|
|
@@ -371,17 +371,17 @@ function fe(e, t, n) {
|
|
|
371
371
|
}
|
|
372
372
|
return P("div", {}, "", "fallback-root");
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function Oe(e, ...t) {
|
|
375
375
|
const n = t[t.length - 1], r = typeof n == "object" && n && !Array.isArray(n) ? n : void 0;
|
|
376
376
|
return fe(e, t, r);
|
|
377
377
|
}
|
|
378
|
-
function
|
|
378
|
+
function Me(e, t) {
|
|
379
379
|
return K(e ? t : [], "when-block");
|
|
380
380
|
}
|
|
381
381
|
function Ne(e, t) {
|
|
382
382
|
return e.map((n, r) => {
|
|
383
|
-
const
|
|
384
|
-
return K(t(n, r), `each-${
|
|
383
|
+
const o = typeof n == "object" ? n?.key ?? n?.id ?? `idx-${r}` : String(n);
|
|
384
|
+
return K(t(n, r), `each-${o}`);
|
|
385
385
|
});
|
|
386
386
|
}
|
|
387
387
|
function Pe() {
|
|
@@ -394,11 +394,11 @@ function Pe() {
|
|
|
394
394
|
return e.push([!0, t]), this;
|
|
395
395
|
},
|
|
396
396
|
done() {
|
|
397
|
-
return
|
|
397
|
+
return ue(...e);
|
|
398
398
|
}
|
|
399
399
|
};
|
|
400
400
|
}
|
|
401
|
-
function
|
|
401
|
+
function ue(...e) {
|
|
402
402
|
for (let t = 0; t < e.length; t++) {
|
|
403
403
|
const [n, r] = e[t];
|
|
404
404
|
if (n) return [K(r, `whenChain-branch-${t}`)];
|
|
@@ -417,54 +417,54 @@ function z(e, t) {
|
|
|
417
417
|
return t.split(".").reduce((n, r) => n?.[r], e);
|
|
418
418
|
}
|
|
419
419
|
function Y(e, t, n) {
|
|
420
|
-
const r = t.split("."),
|
|
421
|
-
if (!
|
|
422
|
-
const s = r.reduce((
|
|
423
|
-
s[
|
|
420
|
+
const r = t.split("."), o = r.pop();
|
|
421
|
+
if (!o) return;
|
|
422
|
+
const s = r.reduce((i, l) => (l in i || (i[l] = {}), i[l]), e);
|
|
423
|
+
s[o] = n;
|
|
424
424
|
}
|
|
425
|
-
function
|
|
425
|
+
function de(e, t, n, r, o, s, i) {
|
|
426
426
|
if (!s) return;
|
|
427
|
-
const l = t.includes("lazy"),
|
|
428
|
-
const
|
|
429
|
-
return z(
|
|
430
|
-
},
|
|
431
|
-
let
|
|
432
|
-
const
|
|
433
|
-
if (
|
|
434
|
-
if (Array.isArray(
|
|
435
|
-
const
|
|
436
|
-
|
|
427
|
+
const l = t.includes("lazy"), c = t.includes("trim"), d = t.includes("number"), p = () => {
|
|
428
|
+
const y = s._state || s;
|
|
429
|
+
return z(y, e);
|
|
430
|
+
}, u = p();
|
|
431
|
+
let f = "text";
|
|
432
|
+
const m = r?.type;
|
|
433
|
+
if (i instanceof HTMLInputElement ? f = m || i.type || "text" : i instanceof HTMLSelectElement ? f = "select" : i instanceof HTMLTextAreaElement && (f = "textarea"), f === "checkbox")
|
|
434
|
+
if (Array.isArray(u)) {
|
|
435
|
+
const y = i?.getAttribute("value") || r?.value || "", a = u.includes(y);
|
|
436
|
+
i && i.checked !== a && (n.checked = a);
|
|
437
437
|
} else {
|
|
438
|
-
const
|
|
439
|
-
|
|
438
|
+
const y = i?.getAttribute("true-value") || !0, a = u === y;
|
|
439
|
+
i && i.checked !== a && (n.checked = a);
|
|
440
440
|
}
|
|
441
|
-
else if (
|
|
442
|
-
const
|
|
443
|
-
|
|
444
|
-
} else if (
|
|
445
|
-
if (
|
|
446
|
-
const
|
|
441
|
+
else if (f === "radio") {
|
|
442
|
+
const y = r?.value || "", a = u === y;
|
|
443
|
+
i && i.checked !== a && (n.checked = a);
|
|
444
|
+
} else if (f === "select")
|
|
445
|
+
if (i && i.hasAttribute("multiple")) {
|
|
446
|
+
const y = i, a = Array.isArray(u) ? u : [];
|
|
447
447
|
setTimeout(() => {
|
|
448
|
-
Array.from(
|
|
448
|
+
Array.from(y.options).forEach((b) => {
|
|
449
449
|
const g = a.includes(b.value);
|
|
450
450
|
b.selected !== g && (b.selected = g);
|
|
451
451
|
});
|
|
452
452
|
}, 0);
|
|
453
453
|
} else
|
|
454
454
|
setTimeout(() => {
|
|
455
|
-
|
|
455
|
+
i instanceof HTMLSelectElement && i.value !== String(u) && (i.value = String(u));
|
|
456
456
|
}, 0);
|
|
457
457
|
else {
|
|
458
|
-
const
|
|
459
|
-
(!
|
|
458
|
+
const y = String(u ?? "");
|
|
459
|
+
(!i || i.value !== y) && (n.value = u);
|
|
460
460
|
}
|
|
461
|
-
const h = l ||
|
|
462
|
-
if (
|
|
463
|
-
const a =
|
|
461
|
+
const h = l || f === "checkbox" || f === "radio" || f === "select" ? "change" : "input", S = (y) => {
|
|
462
|
+
if (y.isComposing || o._isComposing || y.isTrusted === !1) return;
|
|
463
|
+
const a = y.target;
|
|
464
464
|
if (a._modelUpdating) return;
|
|
465
465
|
const b = p();
|
|
466
466
|
let g = a.value;
|
|
467
|
-
if (
|
|
467
|
+
if (f === "checkbox")
|
|
468
468
|
if (Array.isArray(b)) {
|
|
469
469
|
const $ = a.getAttribute("value") || "", C = [...b];
|
|
470
470
|
if (a.checked)
|
|
@@ -478,35 +478,35 @@ function ue(e, t, n, r, i, s, o) {
|
|
|
478
478
|
const $ = a.getAttribute("true-value") || !0, C = a.getAttribute("false-value") || !1;
|
|
479
479
|
g = a.checked ? $ : C;
|
|
480
480
|
}
|
|
481
|
-
else if (
|
|
481
|
+
else if (f === "radio")
|
|
482
482
|
g = a.getAttribute("value") || a.value;
|
|
483
|
-
else if (
|
|
483
|
+
else if (f === "select" && a.multiple) {
|
|
484
484
|
const $ = a;
|
|
485
485
|
g = Array.from($.selectedOptions).map(
|
|
486
486
|
(C) => C.value
|
|
487
487
|
);
|
|
488
|
-
} else if (
|
|
488
|
+
} else if (c && (g = g.trim()), d) {
|
|
489
489
|
const $ = Number(g);
|
|
490
490
|
isNaN($) || (g = $);
|
|
491
491
|
}
|
|
492
492
|
const x = s._state || s, w = z(x, e);
|
|
493
493
|
if (Array.isArray(g) && Array.isArray(w) ? JSON.stringify([...g].sort()) !== JSON.stringify([...w].sort()) : g !== w) {
|
|
494
|
-
const $ =
|
|
494
|
+
const $ = y.target;
|
|
495
495
|
$._modelUpdating = !0, Y(x, e, g), setTimeout(() => {
|
|
496
496
|
$._modelUpdating = !1;
|
|
497
497
|
}, 0), s._requestRender && s._requestRender();
|
|
498
498
|
}
|
|
499
499
|
};
|
|
500
|
-
if (
|
|
501
|
-
const
|
|
502
|
-
|
|
500
|
+
if (o[h] = S, f === "text" || f === "textarea") {
|
|
501
|
+
const y = () => {
|
|
502
|
+
o._isComposing = !0;
|
|
503
503
|
}, a = (b) => {
|
|
504
|
-
|
|
504
|
+
o._isComposing = !1;
|
|
505
505
|
const g = b.target;
|
|
506
506
|
setTimeout(() => {
|
|
507
507
|
if (g) {
|
|
508
508
|
let x = g.value;
|
|
509
|
-
if (
|
|
509
|
+
if (c && (x = x.trim()), d) {
|
|
510
510
|
const C = Number(x);
|
|
511
511
|
isNaN(C) || (x = C);
|
|
512
512
|
}
|
|
@@ -517,57 +517,57 @@ function ue(e, t, n, r, i, s, o) {
|
|
|
517
517
|
}
|
|
518
518
|
}, 0);
|
|
519
519
|
};
|
|
520
|
-
|
|
520
|
+
o.compositionstart = y, o.compositionend = a;
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
523
|
function pe(e, t, n, r) {
|
|
524
524
|
if (r)
|
|
525
525
|
try {
|
|
526
|
-
const
|
|
527
|
-
if (typeof
|
|
528
|
-
for (const [s,
|
|
529
|
-
t[s] =
|
|
526
|
+
const o = JSON.parse(e);
|
|
527
|
+
if (typeof o == "object")
|
|
528
|
+
for (const [s, i] of Object.entries(o))
|
|
529
|
+
t[s] = i;
|
|
530
530
|
} catch {
|
|
531
|
-
const
|
|
532
|
-
n[e] =
|
|
531
|
+
const o = z(r, e);
|
|
532
|
+
n[e] = o;
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
535
|
function he(e, t, n) {
|
|
536
536
|
if (!n) return;
|
|
537
|
-
const r = z(n, e),
|
|
538
|
-
if (
|
|
539
|
-
const
|
|
540
|
-
(
|
|
537
|
+
const r = z(n, e), o = t.style || "", s = r ? "" : "none";
|
|
538
|
+
if (o) {
|
|
539
|
+
const i = o.split(";").filter(Boolean), l = i.findIndex(
|
|
540
|
+
(c) => c.trim().startsWith("display:")
|
|
541
541
|
);
|
|
542
|
-
l >= 0 ?
|
|
542
|
+
l >= 0 ? i[l] = `display: ${s}` : i.push(`display: ${s}`), t.style = i.join("; ");
|
|
543
543
|
} else
|
|
544
544
|
t.style = `display: ${s}`;
|
|
545
545
|
}
|
|
546
546
|
function ge(e, t, n) {
|
|
547
547
|
if (!n) return;
|
|
548
548
|
const r = z(n, e);
|
|
549
|
-
let
|
|
550
|
-
typeof r == "string" ?
|
|
551
|
-
const s = t.class || "",
|
|
552
|
-
|
|
549
|
+
let o = [];
|
|
550
|
+
typeof r == "string" ? o = [r] : Array.isArray(r) ? o = r.filter(Boolean) : typeof r == "object" && (o = Object.entries(r).filter(([, l]) => !!l).map(([l]) => l));
|
|
551
|
+
const s = t.class || "", i = s ? `${s} ${o.join(" ")}`.trim() : o.join(" ");
|
|
552
|
+
i && (t.class = i);
|
|
553
553
|
}
|
|
554
|
-
function
|
|
554
|
+
function me(e, t, n) {
|
|
555
555
|
let r;
|
|
556
556
|
if (typeof e == "string") {
|
|
557
557
|
if (!n) return;
|
|
558
558
|
r = z(n, e);
|
|
559
559
|
} else
|
|
560
560
|
r = e;
|
|
561
|
-
let
|
|
561
|
+
let o = "";
|
|
562
562
|
if (typeof r == "string")
|
|
563
|
-
|
|
563
|
+
o = r;
|
|
564
564
|
else if (r && typeof r == "object") {
|
|
565
|
-
const
|
|
566
|
-
for (const [l,
|
|
567
|
-
if (
|
|
568
|
-
const
|
|
565
|
+
const i = [];
|
|
566
|
+
for (const [l, c] of Object.entries(r))
|
|
567
|
+
if (c != null && c !== "") {
|
|
568
|
+
const d = l.replace(
|
|
569
569
|
/[A-Z]/g,
|
|
570
|
-
(
|
|
570
|
+
(f) => `-${f.toLowerCase()}`
|
|
571
571
|
), p = [
|
|
572
572
|
"width",
|
|
573
573
|
"height",
|
|
@@ -594,75 +594,75 @@ function ye(e, t, n) {
|
|
|
594
594
|
"min-height",
|
|
595
595
|
"max-height"
|
|
596
596
|
];
|
|
597
|
-
let
|
|
598
|
-
typeof
|
|
597
|
+
let u = String(c);
|
|
598
|
+
typeof c == "number" && p.includes(d) && (u = `${c}px`), i.push(`${d}: ${u}`);
|
|
599
599
|
}
|
|
600
|
-
|
|
600
|
+
o = i.join("; ") + (i.length > 0 ? ";" : "");
|
|
601
601
|
}
|
|
602
602
|
const s = t.style || "";
|
|
603
|
-
t.style = s + (s && !s.endsWith(";") ? "; " : "") +
|
|
603
|
+
t.style = s + (s && !s.endsWith(";") ? "; " : "") + o;
|
|
604
604
|
}
|
|
605
605
|
function ie(e, t, n, r) {
|
|
606
|
-
const
|
|
607
|
-
for (const [l,
|
|
608
|
-
const { value:
|
|
606
|
+
const o = {}, s = { ...r || {} }, i = {};
|
|
607
|
+
for (const [l, c] of Object.entries(e)) {
|
|
608
|
+
const { value: d, modifiers: p } = c;
|
|
609
609
|
switch (l) {
|
|
610
610
|
case "model":
|
|
611
|
-
|
|
612
|
-
typeof
|
|
611
|
+
de(
|
|
612
|
+
typeof d == "string" ? d : String(d),
|
|
613
613
|
p,
|
|
614
|
-
i,
|
|
615
|
-
s,
|
|
616
614
|
o,
|
|
615
|
+
s,
|
|
616
|
+
i,
|
|
617
617
|
t,
|
|
618
618
|
n
|
|
619
619
|
);
|
|
620
620
|
break;
|
|
621
621
|
case "bind":
|
|
622
|
-
pe(
|
|
622
|
+
pe(d, o, s, t);
|
|
623
623
|
break;
|
|
624
624
|
case "show":
|
|
625
|
-
he(
|
|
625
|
+
he(d, s, t);
|
|
626
626
|
break;
|
|
627
627
|
case "class":
|
|
628
|
-
ge(
|
|
628
|
+
ge(d, s, t);
|
|
629
629
|
break;
|
|
630
630
|
case "style":
|
|
631
|
-
|
|
631
|
+
me(d, s, t);
|
|
632
632
|
break;
|
|
633
633
|
}
|
|
634
634
|
}
|
|
635
|
-
return { props:
|
|
635
|
+
return { props: o, attrs: s, listeners: i };
|
|
636
636
|
}
|
|
637
637
|
function Z(e, t) {
|
|
638
638
|
if (Array.isArray(e)) {
|
|
639
639
|
const s = /* @__PURE__ */ new Set();
|
|
640
|
-
return e.map((
|
|
641
|
-
if (!
|
|
642
|
-
let l =
|
|
640
|
+
return e.map((i) => {
|
|
641
|
+
if (!i || typeof i != "object") return i;
|
|
642
|
+
let l = i.props?.key ?? i.key;
|
|
643
643
|
if (!l) {
|
|
644
|
-
const
|
|
645
|
-
l =
|
|
644
|
+
const u = i.tag || "node", f = i.props?.attrs?.id ?? i.props?.attrs?.name ?? i.props?.attrs?.["data-key"] ?? "";
|
|
645
|
+
l = f ? `${t}:${u}:${f}` : `${t}:${u}`;
|
|
646
646
|
}
|
|
647
|
-
let
|
|
648
|
-
for (; s.has(
|
|
649
|
-
|
|
650
|
-
s.add(
|
|
651
|
-
let p =
|
|
652
|
-
return Array.isArray(p) && (p = Z(p,
|
|
647
|
+
let c = l, d = 1;
|
|
648
|
+
for (; s.has(c); )
|
|
649
|
+
c = `${l}#${d++}`;
|
|
650
|
+
s.add(c);
|
|
651
|
+
let p = i.children;
|
|
652
|
+
return Array.isArray(p) && (p = Z(p, c)), { ...i, key: c, children: p };
|
|
653
653
|
});
|
|
654
654
|
}
|
|
655
655
|
const n = e;
|
|
656
|
-
let r = n.props?.key ?? n.key ?? t,
|
|
657
|
-
return Array.isArray(
|
|
656
|
+
let r = n.props?.key ?? n.key ?? t, o = n.children;
|
|
657
|
+
return Array.isArray(o) && (o = Z(o, r)), { ...n, key: r, children: o };
|
|
658
658
|
}
|
|
659
|
-
function
|
|
660
|
-
const
|
|
661
|
-
|
|
659
|
+
function ye(e, t, n, r) {
|
|
660
|
+
const o = n.directives ?? {}, s = ie(
|
|
661
|
+
o,
|
|
662
662
|
r,
|
|
663
663
|
e,
|
|
664
664
|
n.attrs
|
|
665
|
-
),
|
|
665
|
+
), i = {
|
|
666
666
|
...t.props,
|
|
667
667
|
...n.props,
|
|
668
668
|
...s.props
|
|
@@ -670,105 +670,105 @@ function me(e, t, n, r) {
|
|
|
670
670
|
...t.attrs,
|
|
671
671
|
...n.attrs,
|
|
672
672
|
...s.attrs
|
|
673
|
-
},
|
|
674
|
-
for (const
|
|
675
|
-
const
|
|
676
|
-
|
|
673
|
+
}, c = t.props ?? {}, d = i;
|
|
674
|
+
for (const f in { ...c, ...d }) {
|
|
675
|
+
const m = c[f], h = d[f];
|
|
676
|
+
m !== h && (f === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement) ? e.value !== h && (e.value = h ?? "") : f === "checked" && e instanceof HTMLInputElement ? e.checked = !!h : f.startsWith("on") && typeof h == "function" ? (typeof m == "function" && e.removeEventListener(f.slice(2).toLowerCase(), m), e.addEventListener(f.slice(2).toLowerCase(), h)) : h == null || h === !1 ? e.removeAttribute(f) : e.setAttribute(f, String(h)));
|
|
677
677
|
}
|
|
678
|
-
for (const [
|
|
678
|
+
for (const [f, m] of Object.entries(
|
|
679
679
|
s.listeners || {}
|
|
680
680
|
))
|
|
681
|
-
e.addEventListener(
|
|
682
|
-
const p = t.attrs ?? {},
|
|
683
|
-
for (const
|
|
684
|
-
const
|
|
685
|
-
|
|
681
|
+
e.addEventListener(f, m);
|
|
682
|
+
const p = t.attrs ?? {}, u = l;
|
|
683
|
+
for (const f in { ...p, ...u }) {
|
|
684
|
+
const m = p[f], h = u[f];
|
|
685
|
+
m !== h && (h == null || h === !1 ? e.removeAttribute(f) : e.setAttribute(f, String(h)));
|
|
686
686
|
}
|
|
687
687
|
}
|
|
688
688
|
function T(e, t, n) {
|
|
689
689
|
if (typeof e == "string")
|
|
690
690
|
return document.createTextNode(e);
|
|
691
691
|
if (e.tag === "#text") {
|
|
692
|
-
const
|
|
692
|
+
const u = document.createTextNode(
|
|
693
693
|
typeof e.children == "string" ? e.children : ""
|
|
694
694
|
);
|
|
695
|
-
return e.key != null && (
|
|
695
|
+
return e.key != null && (u.key = e.key), u;
|
|
696
696
|
}
|
|
697
697
|
if (e.tag === "#anchor") {
|
|
698
|
-
const
|
|
699
|
-
|
|
698
|
+
const u = e, f = Array.isArray(u.children) ? u.children : [], m = document.createTextNode(""), h = document.createTextNode("");
|
|
699
|
+
u.key != null && (m.key = `${u.key}:start`, h.key = `${u.key}:end`), u._startNode = m, u._endNode = h;
|
|
700
700
|
const S = document.createDocumentFragment();
|
|
701
|
-
S.appendChild(
|
|
702
|
-
for (const
|
|
703
|
-
S.appendChild(T(
|
|
701
|
+
S.appendChild(m);
|
|
702
|
+
for (const y of f)
|
|
703
|
+
S.appendChild(T(y, t));
|
|
704
704
|
return S.appendChild(h), S;
|
|
705
705
|
}
|
|
706
706
|
const r = document.createElement(e.tag);
|
|
707
707
|
e.key != null && (r.key = e.key);
|
|
708
|
-
const { props:
|
|
709
|
-
...
|
|
708
|
+
const { props: o = {}, attrs: s = {}, directives: i = {} } = e.props ?? {}, l = ie(i, t, r, s), c = {
|
|
709
|
+
...o,
|
|
710
710
|
...l.props
|
|
711
|
-
},
|
|
711
|
+
}, d = {
|
|
712
712
|
...s,
|
|
713
713
|
...l.attrs
|
|
714
714
|
};
|
|
715
|
-
for (const
|
|
716
|
-
const
|
|
717
|
-
typeof
|
|
718
|
-
}
|
|
719
|
-
for (const
|
|
720
|
-
const
|
|
721
|
-
if (
|
|
722
|
-
r.value =
|
|
723
|
-
else if (
|
|
724
|
-
r.checked = !!
|
|
725
|
-
else if (
|
|
726
|
-
r.addEventListener(
|
|
715
|
+
for (const u in d) {
|
|
716
|
+
const f = d[u];
|
|
717
|
+
typeof f == "boolean" ? f && r.setAttribute(u, "") : f != null && r.setAttribute(u, String(f));
|
|
718
|
+
}
|
|
719
|
+
for (const u in c) {
|
|
720
|
+
const f = c[u];
|
|
721
|
+
if (u === "value" && (r instanceof HTMLInputElement || r instanceof HTMLTextAreaElement || r instanceof HTMLSelectElement))
|
|
722
|
+
r.value = f ?? "";
|
|
723
|
+
else if (u === "checked" && r instanceof HTMLInputElement)
|
|
724
|
+
r.checked = !!f;
|
|
725
|
+
else if (u.startsWith("on") && typeof f == "function")
|
|
726
|
+
r.addEventListener(u.slice(2).toLowerCase(), f);
|
|
727
727
|
else {
|
|
728
|
-
if (
|
|
728
|
+
if (u.startsWith("on") && f === void 0)
|
|
729
729
|
continue;
|
|
730
|
-
|
|
730
|
+
f == null || f === !1 ? r.removeAttribute(u) : r.setAttribute(u, String(f));
|
|
731
731
|
}
|
|
732
732
|
}
|
|
733
|
-
for (const [
|
|
733
|
+
for (const [u, f] of Object.entries(
|
|
734
734
|
l.listeners || {}
|
|
735
735
|
))
|
|
736
|
-
r.addEventListener(
|
|
736
|
+
r.addEventListener(u, f);
|
|
737
737
|
const p = e.props?.ref ?? (e.props?.props && e.props.props.ref);
|
|
738
738
|
if (typeof e != "string" && p && n && (n[p] = r), Array.isArray(e.children))
|
|
739
|
-
for (const
|
|
740
|
-
r.appendChild(T(
|
|
739
|
+
for (const u of e.children)
|
|
740
|
+
r.appendChild(T(u, t, n));
|
|
741
741
|
else typeof e.children == "string" && (r.textContent = e.children);
|
|
742
742
|
return r;
|
|
743
743
|
}
|
|
744
|
-
function be(e, t, n, r,
|
|
744
|
+
function be(e, t, n, r, o) {
|
|
745
745
|
if (typeof n == "string") {
|
|
746
746
|
e.textContent !== n && (e.textContent = n);
|
|
747
747
|
return;
|
|
748
748
|
}
|
|
749
749
|
if (!Array.isArray(n)) return;
|
|
750
|
-
const s = Array.from(e.childNodes),
|
|
751
|
-
for (const
|
|
752
|
-
|
|
753
|
-
const
|
|
754
|
-
for (const
|
|
755
|
-
const h =
|
|
756
|
-
h != null &&
|
|
757
|
-
}
|
|
758
|
-
const
|
|
750
|
+
const s = Array.from(e.childNodes), i = Array.isArray(t) ? t : [], l = /* @__PURE__ */ new Map();
|
|
751
|
+
for (const m of i)
|
|
752
|
+
m && m.key != null && l.set(m.key, m);
|
|
753
|
+
const c = /* @__PURE__ */ new Map();
|
|
754
|
+
for (const m of s) {
|
|
755
|
+
const h = m.key;
|
|
756
|
+
h != null && c.set(h, m);
|
|
757
|
+
}
|
|
758
|
+
const d = /* @__PURE__ */ new Set();
|
|
759
759
|
let p = e.firstChild;
|
|
760
|
-
function
|
|
761
|
-
let S =
|
|
762
|
-
for (; S && (
|
|
760
|
+
function u(m, h) {
|
|
761
|
+
let S = m;
|
|
762
|
+
for (; S && (d.add(S), S !== h); )
|
|
763
763
|
S = S.nextSibling;
|
|
764
764
|
}
|
|
765
|
-
function
|
|
765
|
+
function f(m, h, S, y) {
|
|
766
766
|
const a = [];
|
|
767
|
-
let b =
|
|
767
|
+
let b = m.nextSibling;
|
|
768
768
|
for (; b && b !== h; )
|
|
769
769
|
a.push(b), b = b.nextSibling;
|
|
770
770
|
const g = Array.isArray(S) ? S : [];
|
|
771
|
-
if (
|
|
771
|
+
if (y.some((w) => w && w.key != null) || g.some((w) => w && w.key != null)) {
|
|
772
772
|
const w = /* @__PURE__ */ new Map(), k = /* @__PURE__ */ new Map();
|
|
773
773
|
for (const v of g)
|
|
774
774
|
v && v.key != null && w.set(v.key, v);
|
|
@@ -777,8 +777,8 @@ function be(e, t, n, r, i) {
|
|
|
777
777
|
_ != null && k.set(_, v);
|
|
778
778
|
}
|
|
779
779
|
const $ = /* @__PURE__ */ new Set();
|
|
780
|
-
let C =
|
|
781
|
-
for (const v of
|
|
780
|
+
let C = m.nextSibling;
|
|
781
|
+
for (const v of y) {
|
|
782
782
|
let _;
|
|
783
783
|
if (v.key != null && k.has(v.key)) {
|
|
784
784
|
const A = w.get(v.key);
|
|
@@ -797,121 +797,121 @@ function be(e, t, n, r, i) {
|
|
|
797
797
|
} else {
|
|
798
798
|
const w = Math.min(
|
|
799
799
|
g.length,
|
|
800
|
-
|
|
800
|
+
y.length
|
|
801
801
|
);
|
|
802
802
|
for (let k = 0; k < w; k++) {
|
|
803
|
-
const $ = g[k], C =
|
|
803
|
+
const $ = g[k], C = y[k], v = D(a[k], $, C, r);
|
|
804
804
|
v !== a[k] && (e.insertBefore(v, a[k]), e.removeChild(a[k]));
|
|
805
805
|
}
|
|
806
|
-
for (let k = w; k <
|
|
807
|
-
e.insertBefore(T(
|
|
806
|
+
for (let k = w; k < y.length; k++)
|
|
807
|
+
e.insertBefore(T(y[k], r), h);
|
|
808
808
|
for (let k = w; k < a.length; k++)
|
|
809
809
|
e.removeChild(a[k]);
|
|
810
810
|
}
|
|
811
811
|
}
|
|
812
|
-
for (const
|
|
812
|
+
for (const m of n) {
|
|
813
813
|
let h;
|
|
814
|
-
if (
|
|
815
|
-
const S =
|
|
816
|
-
let b =
|
|
817
|
-
const x = Array.isArray(
|
|
818
|
-
if (b || (b = document.createTextNode(""), b.key =
|
|
814
|
+
if (m.tag === "#anchor") {
|
|
815
|
+
const S = m.key, y = `${S}:start`, a = `${S}:end`;
|
|
816
|
+
let b = c.get(y), g = c.get(a);
|
|
817
|
+
const x = Array.isArray(m.children) ? m.children : [];
|
|
818
|
+
if (b || (b = document.createTextNode(""), b.key = y), g || (g = document.createTextNode(""), g.key = a), m._startNode = b, m._endNode = g, !e.contains(b) || !e.contains(g)) {
|
|
819
819
|
e.insertBefore(b, p);
|
|
820
820
|
for (const w of x)
|
|
821
821
|
e.insertBefore(T(w, r), p);
|
|
822
822
|
e.insertBefore(g, p);
|
|
823
823
|
} else
|
|
824
|
-
|
|
824
|
+
f(
|
|
825
825
|
b,
|
|
826
826
|
g,
|
|
827
827
|
l.get(S)?.children,
|
|
828
828
|
x
|
|
829
829
|
);
|
|
830
|
-
|
|
830
|
+
u(b, g), p = g.nextSibling;
|
|
831
831
|
continue;
|
|
832
832
|
}
|
|
833
|
-
if (
|
|
834
|
-
const S = l.get(
|
|
833
|
+
if (m.key != null && c.has(m.key)) {
|
|
834
|
+
const S = l.get(m.key);
|
|
835
835
|
h = D(
|
|
836
|
-
|
|
836
|
+
c.get(m.key),
|
|
837
837
|
S,
|
|
838
|
-
|
|
838
|
+
m,
|
|
839
839
|
r,
|
|
840
|
-
|
|
841
|
-
),
|
|
840
|
+
o
|
|
841
|
+
), d.add(h), h !== p && e.contains(h) && (p && !e.contains(p) && (p = null), e.insertBefore(h, p));
|
|
842
842
|
} else
|
|
843
|
-
h = T(
|
|
843
|
+
h = T(m, r, o), p && !e.contains(p) && (p = null), e.insertBefore(h, p), d.add(h);
|
|
844
844
|
p = h.nextSibling;
|
|
845
845
|
}
|
|
846
|
-
for (const
|
|
847
|
-
if (!
|
|
848
|
-
if (
|
|
849
|
-
for (const h in
|
|
850
|
-
|
|
851
|
-
e.removeChild(
|
|
846
|
+
for (const m of s)
|
|
847
|
+
if (!d.has(m) && e.contains(m)) {
|
|
848
|
+
if (m instanceof HTMLElement && o)
|
|
849
|
+
for (const h in o)
|
|
850
|
+
o[h] === m && delete o[h];
|
|
851
|
+
e.removeChild(m);
|
|
852
852
|
}
|
|
853
853
|
}
|
|
854
|
-
function D(e, t, n, r,
|
|
855
|
-
if (t && typeof t != "string" && t.props?.ref &&
|
|
854
|
+
function D(e, t, n, r, o) {
|
|
855
|
+
if (t && typeof t != "string" && t.props?.ref && o && delete o[t.props.ref], t === n) return e;
|
|
856
856
|
if (typeof n == "string") {
|
|
857
857
|
if (e.nodeType === Node.TEXT_NODE)
|
|
858
858
|
return e.textContent !== n && (e.textContent = n), e;
|
|
859
859
|
{
|
|
860
|
-
const
|
|
861
|
-
return e.parentNode?.replaceChild(
|
|
860
|
+
const i = document.createTextNode(n);
|
|
861
|
+
return e.parentNode?.replaceChild(i, e), i;
|
|
862
862
|
}
|
|
863
863
|
}
|
|
864
864
|
if (n && typeof n != "string" && n.tag === "#anchor") {
|
|
865
|
-
const
|
|
866
|
-
|
|
865
|
+
const i = n, l = Array.isArray(i.children) ? i.children : [], c = i._startNode ?? document.createTextNode(""), d = i._endNode ?? document.createTextNode("");
|
|
866
|
+
i.key != null && (c.key = `${i.key}:start`, d.key = `${i.key}:end`), i._startNode = c, i._endNode = d;
|
|
867
867
|
const p = document.createDocumentFragment();
|
|
868
|
-
p.appendChild(
|
|
869
|
-
for (const
|
|
870
|
-
p.appendChild(T(
|
|
871
|
-
return p.appendChild(
|
|
868
|
+
p.appendChild(c);
|
|
869
|
+
for (const u of l)
|
|
870
|
+
p.appendChild(T(u, r));
|
|
871
|
+
return p.appendChild(d), e.parentNode?.replaceChild(p, e), c;
|
|
872
872
|
}
|
|
873
873
|
if (!n) {
|
|
874
|
-
const
|
|
875
|
-
return e.parentNode?.replaceChild(
|
|
874
|
+
const i = document.createComment("removed");
|
|
875
|
+
return e.parentNode?.replaceChild(i, e), i;
|
|
876
876
|
}
|
|
877
877
|
if (!t || typeof t == "string") {
|
|
878
|
-
const
|
|
879
|
-
return typeof n != "string" && n.props?.ref &&
|
|
878
|
+
const i = T(n, r, o);
|
|
879
|
+
return typeof n != "string" && n.props?.ref && o && (o[n.props.ref] = i), e.parentNode?.replaceChild(i, e), i;
|
|
880
880
|
}
|
|
881
881
|
if (n.tag === "#anchor") {
|
|
882
|
-
const
|
|
883
|
-
n.key != null && (l.key = `${n.key}:start`,
|
|
884
|
-
const
|
|
885
|
-
|
|
886
|
-
for (const p of
|
|
887
|
-
|
|
888
|
-
return
|
|
882
|
+
const i = Array.isArray(n.children) ? n.children : [], l = n._startNode ?? document.createTextNode(""), c = n._endNode ?? document.createTextNode("");
|
|
883
|
+
n.key != null && (l.key = `${n.key}:start`, c.key = `${n.key}:end`), n._startNode = l, n._endNode = c;
|
|
884
|
+
const d = document.createDocumentFragment();
|
|
885
|
+
d.appendChild(l);
|
|
886
|
+
for (const p of i)
|
|
887
|
+
d.appendChild(T(p, r));
|
|
888
|
+
return d.appendChild(c), e.parentNode?.replaceChild(d, e), l;
|
|
889
889
|
}
|
|
890
890
|
if (typeof t != "string" && typeof n != "string" && t.tag === n.tag && t.key === n.key) {
|
|
891
|
-
const
|
|
892
|
-
return
|
|
891
|
+
const i = e;
|
|
892
|
+
return ye(i, t.props || {}, n.props || {}, r), be(i, t.children, n.children, r, o), typeof n != "string" && n.props?.ref && o && (o[n.props.ref] = i), i;
|
|
893
893
|
}
|
|
894
|
-
const s = T(n, r,
|
|
895
|
-
return typeof n != "string" && n.props?.ref &&
|
|
894
|
+
const s = T(n, r, o);
|
|
895
|
+
return typeof n != "string" && n.props?.ref && o && (o[n.props.ref] = s), e.parentNode?.replaceChild(s, e), s;
|
|
896
896
|
}
|
|
897
897
|
function xe(e, t, n, r) {
|
|
898
|
-
const
|
|
899
|
-
let s = Array.isArray(t) ? { tag: "div", key: "__root__", children: t } :
|
|
898
|
+
const o = (p) => p.key == null ? { ...p, key: "__root__" } : p;
|
|
899
|
+
let s = Array.isArray(t) ? { tag: "div", key: "__root__", children: t } : o(t);
|
|
900
900
|
s = Z(s, String(s.key ?? "root"));
|
|
901
|
-
const
|
|
902
|
-
let
|
|
903
|
-
|
|
904
|
-
const
|
|
901
|
+
const i = e._prevVNode ?? null, l = e._prevDom ?? e.firstChild ?? null;
|
|
902
|
+
let c;
|
|
903
|
+
i && l ? typeof i != "string" && typeof s != "string" && i.tag === s.tag && i.key === s.key ? c = D(l, i, s, n, r) : (c = T(s, n, r), e.replaceChild(c, l)) : (c = T(s, n, r), e.firstChild ? e.replaceChild(c, e.firstChild) : e.appendChild(c));
|
|
904
|
+
const d = [];
|
|
905
905
|
for (let p = 0; p < e.childNodes.length; p++) {
|
|
906
|
-
const
|
|
907
|
-
if (
|
|
908
|
-
if (
|
|
909
|
-
for (const
|
|
910
|
-
r[
|
|
911
|
-
|
|
906
|
+
const u = e.childNodes[p];
|
|
907
|
+
if (u !== c && u.nodeName !== "STYLE") {
|
|
908
|
+
if (u instanceof HTMLElement && r)
|
|
909
|
+
for (const f in r)
|
|
910
|
+
r[f] === u && delete r[f];
|
|
911
|
+
d.push(u);
|
|
912
912
|
}
|
|
913
913
|
}
|
|
914
|
-
|
|
914
|
+
d.forEach((p) => e.removeChild(p)), e._prevVNode = s, e._prevDom = c;
|
|
915
915
|
}
|
|
916
916
|
function oe(e) {
|
|
917
917
|
return e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;}/g, "}").trim();
|
|
@@ -925,128 +925,62 @@ function ve(e) {
|
|
|
925
925
|
}
|
|
926
926
|
const we = `
|
|
927
927
|
:host, *, ::before, ::after {
|
|
928
|
+
all: isolate;
|
|
928
929
|
box-sizing: border-box;
|
|
929
|
-
border
|
|
930
|
-
border-style: solid;
|
|
931
|
-
border-color: currentColor;
|
|
932
|
-
}
|
|
933
|
-
:host {
|
|
934
|
-
font-size: 16px;
|
|
935
|
-
line-height: 1.5;
|
|
936
|
-
font-family: ui-sans-serif, system-ui, sans-serif;
|
|
937
|
-
-webkit-text-size-adjust: 100%;
|
|
938
|
-
text-size-adjust: 100%;
|
|
939
|
-
color: inherit;
|
|
940
|
-
background-color: transparent;
|
|
941
|
-
}
|
|
942
|
-
*, ::before, ::after {
|
|
943
|
-
-webkit-tap-highlight-color: transparent;
|
|
930
|
+
border: 0 solid currentColor;
|
|
944
931
|
margin: 0;
|
|
945
932
|
padding: 0;
|
|
946
933
|
font: inherit;
|
|
947
934
|
vertical-align: baseline;
|
|
948
935
|
background: transparent;
|
|
949
936
|
color: inherit;
|
|
937
|
+
-webkit-tap-highlight-color: transparent;
|
|
950
938
|
}
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
939
|
+
:host {
|
|
940
|
+
display: contents;
|
|
941
|
+
font: 16px/1.5 ui-sans-serif, system-ui, sans-serif;
|
|
942
|
+
-webkit-text-size-adjust: 100%;
|
|
943
|
+
text-size-adjust: 100%;
|
|
944
|
+
}
|
|
945
|
+
button, input, select, textarea {
|
|
954
946
|
background: transparent;
|
|
955
|
-
border: none;
|
|
956
947
|
outline: none;
|
|
957
|
-
margin: 0;
|
|
958
|
-
padding: 0;
|
|
959
|
-
}
|
|
960
|
-
textarea {
|
|
961
|
-
resize: vertical;
|
|
962
|
-
}
|
|
963
|
-
progress {
|
|
964
|
-
vertical-align: baseline;
|
|
965
|
-
}
|
|
966
|
-
button, textarea {
|
|
967
|
-
overflow: visible;
|
|
968
|
-
}
|
|
969
|
-
input[type="search"]::-webkit-search-decoration,
|
|
970
|
-
input[type="search"]::-webkit-search-cancel-button,
|
|
971
|
-
input[type="search"]::-webkit-search-results-button,
|
|
972
|
-
input[type="search"]::-webkit-search-results-decoration {
|
|
973
|
-
-webkit-appearance: none;
|
|
974
948
|
}
|
|
949
|
+
textarea { resize: vertical }
|
|
950
|
+
progress { vertical-align: baseline }
|
|
951
|
+
button, textarea { overflow: visible }
|
|
975
952
|
img, svg, video, canvas, audio, iframe, embed, object {
|
|
976
953
|
display: block;
|
|
977
954
|
max-width: 100%;
|
|
978
955
|
height: auto;
|
|
979
|
-
vertical-align: middle;
|
|
980
956
|
}
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
optgroup {
|
|
985
|
-
font-weight: bold;
|
|
986
|
-
}
|
|
987
|
-
fieldset {
|
|
988
|
-
border: none;
|
|
989
|
-
}
|
|
990
|
-
svg {
|
|
991
|
-
fill: currentColor;
|
|
992
|
-
stroke: none;
|
|
993
|
-
}
|
|
994
|
-
a {
|
|
995
|
-
color: inherit;
|
|
996
|
-
text-decoration: inherit;
|
|
997
|
-
}
|
|
998
|
-
a, button {
|
|
957
|
+
svg { fill: currentColor; stroke: none }
|
|
958
|
+
a { text-decoration: inherit; cursor: pointer }
|
|
959
|
+
button, [type=button], [type=reset], [type=submit] {
|
|
999
960
|
cursor: pointer;
|
|
1000
|
-
}
|
|
1001
|
-
input[type="file"] {
|
|
1002
|
-
border: 0;
|
|
1003
|
-
}
|
|
1004
|
-
button, [type="button"], [type="reset"], [type="submit"] {
|
|
1005
961
|
appearance: button;
|
|
1006
|
-
background
|
|
1007
|
-
background-image: none;
|
|
1008
|
-
}
|
|
1009
|
-
[type='button'], [type='reset'], [type='submit'] {
|
|
962
|
+
background: none;
|
|
1010
963
|
-webkit-user-select: none;
|
|
1011
964
|
user-select: none;
|
|
1012
965
|
}
|
|
1013
|
-
::-webkit-input-placeholder {
|
|
1014
|
-
|
|
966
|
+
::-webkit-input-placeholder, ::placeholder {
|
|
967
|
+
color: inherit; opacity: .5;
|
|
968
|
+
}
|
|
1015
969
|
*:focus {
|
|
1016
|
-
outline: 2px solid #3b82f6;
|
|
970
|
+
outline: 2px solid var(--color-blue-500, #3b82f6);
|
|
1017
971
|
outline-offset: 2px;
|
|
1018
972
|
}
|
|
1019
|
-
ol, ul {
|
|
1020
|
-
|
|
1021
|
-
}
|
|
1022
|
-
table {
|
|
1023
|
-
border-collapse: collapse;
|
|
1024
|
-
border-spacing: 0;
|
|
1025
|
-
}
|
|
1026
|
-
strong {
|
|
1027
|
-
font-weight: bolder;
|
|
1028
|
-
}
|
|
973
|
+
ol, ul { list-style: none }
|
|
974
|
+
table { border-collapse: collapse }
|
|
1029
975
|
sub, sup {
|
|
1030
|
-
font-size:
|
|
976
|
+
font-size: .75em;
|
|
1031
977
|
line-height: 0;
|
|
1032
978
|
position: relative;
|
|
1033
|
-
vertical-align: baseline;
|
|
1034
|
-
}
|
|
1035
|
-
sub {
|
|
1036
|
-
bottom: -0.25em;
|
|
1037
|
-
}
|
|
1038
|
-
sup {
|
|
1039
|
-
top: -0.5em;
|
|
1040
|
-
}
|
|
1041
|
-
[disabled] {
|
|
1042
|
-
cursor: not-allowed;
|
|
1043
|
-
}
|
|
1044
|
-
[hidden] {
|
|
1045
|
-
display: none;
|
|
1046
|
-
}
|
|
1047
|
-
[aria-disabled="true"] {
|
|
1048
|
-
cursor: not-allowed;
|
|
1049
979
|
}
|
|
980
|
+
sub { bottom: -.25em }
|
|
981
|
+
sup { top: -.5em }
|
|
982
|
+
[disabled], [aria-disabled=true] { cursor: not-allowed }
|
|
983
|
+
[hidden] { display: none }
|
|
1050
984
|
`, ke = {
|
|
1051
985
|
gray: {
|
|
1052
986
|
50: "var(--color-gray-50, #f9fafb)",
|
|
@@ -1060,6 +994,18 @@ const we = `
|
|
|
1060
994
|
800: "var(--color-gray-800, #1f2937)",
|
|
1061
995
|
900: "var(--color-gray-900, #111827)"
|
|
1062
996
|
},
|
|
997
|
+
neutral: {
|
|
998
|
+
50: "var(--color-neutral-50, #fafafa)",
|
|
999
|
+
100: "var(--color-neutral-100, #f5f5f5)",
|
|
1000
|
+
200: "var(--color-neutral-200, #e5e5e5)",
|
|
1001
|
+
300: "var(--color-neutral-300, #d4d4d4)",
|
|
1002
|
+
400: "var(--color-neutral-400, #a3a3a3)",
|
|
1003
|
+
500: "var(--color-neutral-500, #737373)",
|
|
1004
|
+
600: "var(--color-neutral-600, #525252)",
|
|
1005
|
+
700: "var(--color-neutral-700, #404040)",
|
|
1006
|
+
800: "var(--color-neutral-800, #262626)",
|
|
1007
|
+
900: "var(--color-neutral-900, #171717)"
|
|
1008
|
+
},
|
|
1063
1009
|
slate: {
|
|
1064
1010
|
50: "var(--color-slate-50, #f8fafc)",
|
|
1065
1011
|
100: "var(--color-slate-100, #f1f5f9)",
|
|
@@ -1179,6 +1125,26 @@ const we = `
|
|
|
1179
1125
|
"inline-flex": "display:inline-flex;",
|
|
1180
1126
|
grid: "display:grid;",
|
|
1181
1127
|
hidden: "display:none;",
|
|
1128
|
+
/* Sizing & Spacing */
|
|
1129
|
+
"w-full": "width:100%;",
|
|
1130
|
+
"w-screen": "width:100dvw;",
|
|
1131
|
+
"h-full": "height:100%;",
|
|
1132
|
+
"h-screen": "height:100dvw;",
|
|
1133
|
+
"max-w-full": "max-width:100%;",
|
|
1134
|
+
"max-h-full": "max-height:100%;",
|
|
1135
|
+
"min-w-0": "min-width:0;",
|
|
1136
|
+
"min-h-0": "min-height:0;",
|
|
1137
|
+
"m-auto": "margin:auto;",
|
|
1138
|
+
"mx-auto": "margin-inline:auto;",
|
|
1139
|
+
"my-auto": "margin-block:auto;",
|
|
1140
|
+
/* Overflow */
|
|
1141
|
+
"overflow-auto": "overflow:auto;",
|
|
1142
|
+
"overflow-hidden": "overflow:hidden;",
|
|
1143
|
+
"overflow-visible": "overflow:visible;",
|
|
1144
|
+
"overflow-scroll": "overflow:scroll;",
|
|
1145
|
+
/* Pointer Events */
|
|
1146
|
+
"pointer-events-none": "pointer-events:none;",
|
|
1147
|
+
"pointer-events-auto": "pointer-events:auto;",
|
|
1182
1148
|
/* Accessibility */
|
|
1183
1149
|
"sr-only": "position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;",
|
|
1184
1150
|
"not-sr-only": "position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip:auto;white-space:normal;",
|
|
@@ -1283,7 +1249,28 @@ const we = `
|
|
|
1283
1249
|
"items-stretch": "align-items:stretch;",
|
|
1284
1250
|
"justify-center": "justify-content:center;",
|
|
1285
1251
|
"justify-start": "justify-content:flex-start;",
|
|
1252
|
+
"justify-between": "justify-content:space-between;",
|
|
1253
|
+
"justify-around": "justify-content:space-around;",
|
|
1254
|
+
"justify-evenly": "justify-content:space-evenly;",
|
|
1286
1255
|
"justify-end": "justify-content:flex-end;",
|
|
1256
|
+
"flex-wrap": "flex-wrap:wrap;",
|
|
1257
|
+
"flex-nowrap": "flex-wrap:nowrap;",
|
|
1258
|
+
"flex-wrap-reverse": "flex-wrap:wrap-reverse;",
|
|
1259
|
+
"content-center": "align-content:center;",
|
|
1260
|
+
"content-start": "align-content:flex-start;",
|
|
1261
|
+
"content-end": "align-content:flex-end;",
|
|
1262
|
+
"content-between": "align-content:space-between;",
|
|
1263
|
+
"content-around": "align-content:space-around;",
|
|
1264
|
+
"content-stretch": "align-content:stretch;",
|
|
1265
|
+
"self-auto": "align-self:auto;",
|
|
1266
|
+
"self-start": "align-self:flex-start;",
|
|
1267
|
+
"self-end": "align-self:flex-end;",
|
|
1268
|
+
"self-center": "align-self:center;",
|
|
1269
|
+
"self-stretch": "align-self:stretch;",
|
|
1270
|
+
"flex-1": "flex:1 1 0%;",
|
|
1271
|
+
"flex-auto": "flex:1 1 auto;",
|
|
1272
|
+
"flex-initial": "flex:0 1 auto;",
|
|
1273
|
+
"flex-none": "flex:0 0 auto;",
|
|
1287
1274
|
"flex-col": "flex-direction:column;",
|
|
1288
1275
|
"flex-row": "flex-direction:row;",
|
|
1289
1276
|
grow: "flex-grow:1;",
|
|
@@ -1303,7 +1290,7 @@ const we = `
|
|
|
1303
1290
|
"transition-colors": "transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;",
|
|
1304
1291
|
"transition-opacity": "transition-property:opacity;",
|
|
1305
1292
|
"transition-transform": "transition-property:transform;"
|
|
1306
|
-
}, _e = "0.25rem", ee = {
|
|
1293
|
+
}, _e = "var(--spacing, 0.25rem)", ee = {
|
|
1307
1294
|
m: ["margin"],
|
|
1308
1295
|
mx: ["margin-inline"],
|
|
1309
1296
|
my: ["margin-block"],
|
|
@@ -1321,6 +1308,12 @@ const we = `
|
|
|
1321
1308
|
inset: ["inset"],
|
|
1322
1309
|
"inset-x": ["inset-inline"],
|
|
1323
1310
|
"inset-y": ["inset-block"],
|
|
1311
|
+
h: ["height"],
|
|
1312
|
+
w: ["width"],
|
|
1313
|
+
"min-h": ["min-height"],
|
|
1314
|
+
"min-w": ["min-width"],
|
|
1315
|
+
"max-h": ["max-height"],
|
|
1316
|
+
"max-w": ["max-width"],
|
|
1324
1317
|
top: ["top"],
|
|
1325
1318
|
bottom: ["bottom"],
|
|
1326
1319
|
left: ["left"],
|
|
@@ -1367,19 +1360,19 @@ const we = `
|
|
|
1367
1360
|
function U(e) {
|
|
1368
1361
|
const t = e.startsWith("-"), r = (t ? e.slice(1) : e).split("-");
|
|
1369
1362
|
if (r.length < 2) return null;
|
|
1370
|
-
const
|
|
1371
|
-
if (Number.isNaN(
|
|
1363
|
+
const o = r.slice(0, -1).join("-"), s = r[r.length - 1], i = parseFloat(s);
|
|
1364
|
+
if (Number.isNaN(i) || !ee[o]) return null;
|
|
1372
1365
|
const l = t ? "-" : "";
|
|
1373
|
-
return ee[
|
|
1366
|
+
return ee[o].map((c) => `${c}:calc(${l}${_e} * ${i});`).join("");
|
|
1374
1367
|
}
|
|
1375
1368
|
function re(e) {
|
|
1376
|
-
const t = e.replace("#", ""), n = parseInt(t, 16), r = n >> 16 & 255,
|
|
1377
|
-
return `${r} ${
|
|
1369
|
+
const t = e.replace("#", ""), n = parseInt(t, 16), r = n >> 16 & 255, o = n >> 8 & 255, s = n & 255;
|
|
1370
|
+
return `${r} ${o} ${s}`;
|
|
1378
1371
|
}
|
|
1379
1372
|
function Se(e) {
|
|
1380
1373
|
const t = /^(bg|text|border|shadow|outline|caret|accent)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
|
|
1381
1374
|
if (!t) return null;
|
|
1382
|
-
const [, n, r,
|
|
1375
|
+
const [, n, r, o = "DEFAULT"] = t, s = ke[r]?.[o];
|
|
1383
1376
|
return s ? `${{
|
|
1384
1377
|
bg: "background-color",
|
|
1385
1378
|
text: "color",
|
|
@@ -1402,29 +1395,29 @@ function q(e) {
|
|
|
1402
1395
|
if (n !== void 0) {
|
|
1403
1396
|
const s = /#([0-9a-f]{6})/i.exec(r);
|
|
1404
1397
|
if (s) {
|
|
1405
|
-
const
|
|
1406
|
-
return r.replace(/#([0-9a-f]{6})/i, `rgb(${
|
|
1398
|
+
const i = re(s[0]);
|
|
1399
|
+
return r.replace(/#([0-9a-f]{6})/i, `rgb(${i} / ${n})`);
|
|
1407
1400
|
}
|
|
1408
1401
|
}
|
|
1409
1402
|
return r;
|
|
1410
1403
|
}
|
|
1411
|
-
const
|
|
1412
|
-
if (
|
|
1413
|
-
const s = /#([0-9a-f]{6})/i.exec(
|
|
1404
|
+
const o = W(t);
|
|
1405
|
+
if (o && n !== void 0) {
|
|
1406
|
+
const s = /#([0-9a-f]{6})/i.exec(o);
|
|
1414
1407
|
if (s) {
|
|
1415
|
-
const
|
|
1416
|
-
return
|
|
1408
|
+
const i = re(s[0]);
|
|
1409
|
+
return o.replace(/#([0-9a-f]{6})/i, `rgb(${i} / ${n})`);
|
|
1417
1410
|
}
|
|
1418
1411
|
}
|
|
1419
|
-
return
|
|
1412
|
+
return o;
|
|
1420
1413
|
}
|
|
1421
1414
|
function W(e) {
|
|
1422
1415
|
const t = e.indexOf("-["), n = e.endsWith("]");
|
|
1423
1416
|
if (t > 0 && n) {
|
|
1424
1417
|
const r = e.slice(0, t);
|
|
1425
|
-
let
|
|
1426
|
-
|
|
1427
|
-
const
|
|
1418
|
+
let o = e.slice(t + 2, -1);
|
|
1419
|
+
o = o.replace(/_/g, " ");
|
|
1420
|
+
const i = {
|
|
1428
1421
|
bg: "background-color",
|
|
1429
1422
|
text: "color",
|
|
1430
1423
|
p: "padding",
|
|
@@ -1464,7 +1457,7 @@ function W(e) {
|
|
|
1464
1457
|
leading: "line-height",
|
|
1465
1458
|
z: "z-index"
|
|
1466
1459
|
}[r] ?? r.replace(/_/g, "-");
|
|
1467
|
-
if (
|
|
1460
|
+
if (i && o) return `${i}:${o};`;
|
|
1468
1461
|
}
|
|
1469
1462
|
return null;
|
|
1470
1463
|
}
|
|
@@ -1475,10 +1468,10 @@ function Ee(e) {
|
|
|
1475
1468
|
const t = /class\s*=\s*["']([^"']+)["']/g, n = [];
|
|
1476
1469
|
let r;
|
|
1477
1470
|
for (; r = t.exec(e); ) {
|
|
1478
|
-
let
|
|
1479
|
-
for (const
|
|
1480
|
-
|
|
1481
|
-
|
|
1471
|
+
let o = "", s = !1;
|
|
1472
|
+
for (const i of r[1])
|
|
1473
|
+
i === "[" && (s = !0), i === "]" && (s = !1), i === " " && !s ? (o && n.push(o), o = "") : o += i;
|
|
1474
|
+
o && n.push(o);
|
|
1482
1475
|
}
|
|
1483
1476
|
return n.filter(Boolean);
|
|
1484
1477
|
}
|
|
@@ -1486,27 +1479,27 @@ const ne = /* @__PURE__ */ new Map(), Te = 16;
|
|
|
1486
1479
|
function je(e) {
|
|
1487
1480
|
const t = Date.now(), n = ne.get(e);
|
|
1488
1481
|
if (n && t - n.timestamp < Te) return n.css;
|
|
1489
|
-
const r = Ee(e),
|
|
1482
|
+
const r = Ee(e), o = new Set(r), s = [], i = [], l = [], c = [], d = {};
|
|
1490
1483
|
function p(h, S = !1) {
|
|
1491
|
-
const
|
|
1492
|
-
if (
|
|
1493
|
-
const a =
|
|
1494
|
-
return
|
|
1484
|
+
const y = (S ? "dark|" : "") + h;
|
|
1485
|
+
if (y in d) return d[y];
|
|
1486
|
+
const a = f(h, S);
|
|
1487
|
+
return d[y] = a, a;
|
|
1495
1488
|
}
|
|
1496
|
-
function
|
|
1497
|
-
const S = h.some((a) => V.includes(a)),
|
|
1498
|
-
return h.length === 0 ? 1 : !S && !
|
|
1489
|
+
function u(h) {
|
|
1490
|
+
const S = h.some((a) => V.includes(a)), y = h.includes("dark");
|
|
1491
|
+
return h.length === 0 ? 1 : !S && !y ? 2 : S && !y ? 3 : 4;
|
|
1499
1492
|
}
|
|
1500
|
-
function
|
|
1501
|
-
const
|
|
1493
|
+
function f(h, S = !1) {
|
|
1494
|
+
const y = h.split(":"), a = y.find(
|
|
1502
1495
|
(_) => F[_] || U(_) || q(_) || W(_)
|
|
1503
1496
|
);
|
|
1504
1497
|
if (!a) return null;
|
|
1505
1498
|
const b = F[a] ?? U(a) ?? q(a) ?? W(a);
|
|
1506
1499
|
if (!b) return null;
|
|
1507
1500
|
let g = `.${Ae(h)}`, x = b;
|
|
1508
|
-
const w =
|
|
1509
|
-
let k = w >= 0 ?
|
|
1501
|
+
const w = y.indexOf(a);
|
|
1502
|
+
let k = w >= 0 ? y.slice(0, w) : [];
|
|
1510
1503
|
S && (k = k.filter((_) => _ !== "dark"));
|
|
1511
1504
|
const $ = k.filter((_) => V.includes(_)), C = $.length ? $[$.length - 1] : null;
|
|
1512
1505
|
for (const _ of k) {
|
|
@@ -1517,22 +1510,22 @@ function je(e) {
|
|
|
1517
1510
|
let v = `${g}{${x}}`;
|
|
1518
1511
|
return S && C ? v = `@media (prefers-color-scheme: dark) and ${te[C]}{${v}}` : S ? v = `@media (prefers-color-scheme: dark){${v}}` : C && (v = `@media ${te[C]}{${v}}`), v;
|
|
1519
1512
|
}
|
|
1520
|
-
for (const h of
|
|
1521
|
-
const S = h.split(":"),
|
|
1513
|
+
for (const h of o) {
|
|
1514
|
+
const S = h.split(":"), y = S.find(
|
|
1522
1515
|
(x) => F[x] || U(x) || q(x) || W(x)
|
|
1523
1516
|
);
|
|
1524
|
-
if (!
|
|
1525
|
-
const a = S.indexOf(
|
|
1517
|
+
if (!y) continue;
|
|
1518
|
+
const a = S.indexOf(y), b = a >= 0 ? S.slice(0, a) : [], g = u(b);
|
|
1526
1519
|
if (g === 4) {
|
|
1527
1520
|
const x = p(h, !0);
|
|
1528
|
-
x &&
|
|
1521
|
+
x && c.push(x);
|
|
1529
1522
|
} else {
|
|
1530
1523
|
const x = p(h);
|
|
1531
|
-
x && (g === 1 ? s.push(x) : g === 2 ?
|
|
1524
|
+
x && (g === 1 ? s.push(x) : g === 2 ? i.push(x) : g === 3 && l.push(x));
|
|
1532
1525
|
}
|
|
1533
1526
|
}
|
|
1534
|
-
const
|
|
1535
|
-
return ne.set(e, { css:
|
|
1527
|
+
const m = [...s, ...i, ...l, ...c].join("");
|
|
1528
|
+
return ne.set(e, { css: m, timestamp: t }), m;
|
|
1536
1529
|
}
|
|
1537
1530
|
const Le = /* @__PURE__ */ new Map();
|
|
1538
1531
|
function Q(e) {
|
|
@@ -1559,10 +1552,10 @@ function He(e, ...t) {
|
|
|
1559
1552
|
function Ie(e, t, n) {
|
|
1560
1553
|
let r = Q(e);
|
|
1561
1554
|
r.includes("-") || (r = `cer-${r}`);
|
|
1562
|
-
let
|
|
1563
|
-
typeof t == "function" ?
|
|
1564
|
-
console.error(`[${r}] Error:`, s,
|
|
1565
|
-
}), Le.set(r,
|
|
1555
|
+
let o;
|
|
1556
|
+
typeof t == "function" ? o = { ...n, render: t } : o = t, typeof o.onError != "function" && (o.onError = (s, i) => {
|
|
1557
|
+
console.error(`[${r}] Error:`, s, i);
|
|
1558
|
+
}), Le.set(r, o), typeof window < "u" && !customElements.get(r) && customElements.define(r, ze(o));
|
|
1566
1559
|
}
|
|
1567
1560
|
function ze(e) {
|
|
1568
1561
|
if (!e.render)
|
|
@@ -1596,12 +1589,35 @@ function ze(e) {
|
|
|
1596
1589
|
value: this._refs,
|
|
1597
1590
|
writable: !1,
|
|
1598
1591
|
enumerable: !1,
|
|
1599
|
-
// Hide from iteration to avoid proxy traps
|
|
1600
1592
|
configurable: !1
|
|
1601
|
-
}), this.context = t,
|
|
1593
|
+
}), this.context = t, this._applyProps(e), Object.defineProperty(this.context, "emit", {
|
|
1594
|
+
value: (n, r, o) => {
|
|
1595
|
+
this.dispatchEvent(
|
|
1596
|
+
new CustomEvent(n, {
|
|
1597
|
+
detail: r,
|
|
1598
|
+
bubbles: !0,
|
|
1599
|
+
composed: !0,
|
|
1600
|
+
...o || {}
|
|
1601
|
+
})
|
|
1602
|
+
);
|
|
1603
|
+
const s = `on${n.charAt(0).toUpperCase()}${n.slice(1)}`, i = typeof this[s] == "function" ? this[s] : void 0, l = typeof this.context[s] == "function" ? this.context[s] : void 0, c = typeof e[s] == "function" ? e[s] : void 0;
|
|
1604
|
+
i && i(r, this.context), l && l !== i && l(r, this.context), c && c !== i && c !== l && c(r, this.context);
|
|
1605
|
+
},
|
|
1606
|
+
writable: !1,
|
|
1607
|
+
enumerable: !1,
|
|
1608
|
+
configurable: !1
|
|
1609
|
+
}), Object.keys(e).forEach((n) => {
|
|
1602
1610
|
const r = e[n];
|
|
1603
|
-
typeof r == "function" && !n.startsWith("on")
|
|
1604
|
-
|
|
1611
|
+
if (typeof r == "function" && !n.startsWith("on"))
|
|
1612
|
+
this.context[n] = (...o) => r(...o, this.context);
|
|
1613
|
+
else if (n.startsWith("on") && n.length > 2 && n[2] === n[2].toUpperCase()) {
|
|
1614
|
+
const o = n.slice(2, 3).toLowerCase() + n.slice(3);
|
|
1615
|
+
this.addEventListener(o, (s) => {
|
|
1616
|
+
const i = typeof this[n] == "function" ? this[n] : this.context[n];
|
|
1617
|
+
typeof i == "function" && i(s.detail, this.context);
|
|
1618
|
+
});
|
|
1619
|
+
}
|
|
1620
|
+
}), this._applyComputed(e), this._initializing = !1, this._initWatchers(e), this._render(e);
|
|
1605
1621
|
}
|
|
1606
1622
|
connectedCallback() {
|
|
1607
1623
|
this._runLogicWithinErrorBoundary(e, () => {
|
|
@@ -1631,8 +1647,8 @@ function ze(e) {
|
|
|
1631
1647
|
t.computed && Object.entries(t.computed).forEach(([n, r]) => {
|
|
1632
1648
|
Object.defineProperty(this.context, n, {
|
|
1633
1649
|
get: () => {
|
|
1634
|
-
const
|
|
1635
|
-
return J(
|
|
1650
|
+
const o = r(this.context);
|
|
1651
|
+
return J(o);
|
|
1636
1652
|
},
|
|
1637
1653
|
enumerable: !0
|
|
1638
1654
|
});
|
|
@@ -1655,8 +1671,8 @@ function ze(e) {
|
|
|
1655
1671
|
if (n instanceof Promise) {
|
|
1656
1672
|
this._templateLoading = !0, n.then((r) => (this._templateLoading = !1, this._templateError = null, this._renderOutput(r), r)).catch((r) => {
|
|
1657
1673
|
if (this._templateLoading = !1, this._templateError = r, t.errorTemplate) {
|
|
1658
|
-
const
|
|
1659
|
-
return this._renderOutput(
|
|
1674
|
+
const o = t.errorTemplate(r, this.context);
|
|
1675
|
+
return this._renderOutput(o), o;
|
|
1660
1676
|
}
|
|
1661
1677
|
throw r;
|
|
1662
1678
|
}), t.loadingTemplate && this._renderOutput(t.loadingTemplate(this.context));
|
|
@@ -1669,15 +1685,15 @@ function ze(e) {
|
|
|
1669
1685
|
_renderOutput(t) {
|
|
1670
1686
|
if (!this.shadowRoot) return;
|
|
1671
1687
|
const n = new Proxy(this.context, {
|
|
1672
|
-
get: (r,
|
|
1673
|
-
set: (r,
|
|
1674
|
-
if (typeof
|
|
1675
|
-
const
|
|
1688
|
+
get: (r, o) => o === "_requestRender" ? () => this._requestRender() : o === "context" ? r : typeof o == "string" && o.includes(".") ? o.split(".").reduce((s, i) => s?.[i], r) : r[o],
|
|
1689
|
+
set: (r, o, s) => {
|
|
1690
|
+
if (typeof o == "string" && o.includes(".")) {
|
|
1691
|
+
const i = o.split("."), l = i.pop();
|
|
1676
1692
|
if (!l) return !1;
|
|
1677
|
-
const
|
|
1678
|
-
return
|
|
1693
|
+
const c = i.reduce((d, p) => (p in d || (d[p] = {}), d[p]), r);
|
|
1694
|
+
return c[l] = s, !0;
|
|
1679
1695
|
}
|
|
1680
|
-
return r[
|
|
1696
|
+
return r[o] = s, !0;
|
|
1681
1697
|
}
|
|
1682
1698
|
});
|
|
1683
1699
|
xe(
|
|
@@ -1712,10 +1728,10 @@ function ze(e) {
|
|
|
1712
1728
|
}
|
|
1713
1729
|
let r = "";
|
|
1714
1730
|
t.style && (typeof t.style == "string" ? r = t.style : typeof t.style == "function" && (r = t.style(this.context)));
|
|
1715
|
-
let
|
|
1731
|
+
let o = ve(`${r}
|
|
1716
1732
|
${n}
|
|
1717
1733
|
`);
|
|
1718
|
-
|
|
1734
|
+
o = oe(o), this._styleSheet || (this._styleSheet = new CSSStyleSheet()), (this._styleSheet.cssRules.length === 0 || this._styleSheet.toString() !== o) && this._styleSheet.replaceSync(o), this.shadowRoot.adoptedStyleSheets = [G(), this._styleSheet];
|
|
1719
1735
|
});
|
|
1720
1736
|
}
|
|
1721
1737
|
// --- Error Boundary function ---
|
|
@@ -1733,11 +1749,11 @@ ${n}
|
|
|
1733
1749
|
// --- State, props, computed ---
|
|
1734
1750
|
_initContext(t) {
|
|
1735
1751
|
try {
|
|
1736
|
-
let n = function(
|
|
1737
|
-
return Array.isArray(
|
|
1738
|
-
get(
|
|
1739
|
-
const
|
|
1740
|
-
return typeof
|
|
1752
|
+
let n = function(o, s = "") {
|
|
1753
|
+
return Array.isArray(o) ? new Proxy(o, {
|
|
1754
|
+
get(i, l, c) {
|
|
1755
|
+
const d = Reflect.get(i, l, c);
|
|
1756
|
+
return typeof d == "function" && typeof l == "string" && [
|
|
1741
1757
|
"push",
|
|
1742
1758
|
"pop",
|
|
1743
1759
|
"shift",
|
|
@@ -1745,44 +1761,44 @@ ${n}
|
|
|
1745
1761
|
"splice",
|
|
1746
1762
|
"sort",
|
|
1747
1763
|
"reverse"
|
|
1748
|
-
].includes(l) ? function(...
|
|
1749
|
-
const
|
|
1764
|
+
].includes(l) ? function(...u) {
|
|
1765
|
+
const f = d.apply(i, u);
|
|
1750
1766
|
if (!r._initializing) {
|
|
1751
|
-
const
|
|
1752
|
-
r._triggerWatchers(
|
|
1767
|
+
const m = s || "root";
|
|
1768
|
+
r._triggerWatchers(m, i), r._render(t);
|
|
1753
1769
|
}
|
|
1754
|
-
return
|
|
1755
|
-
} :
|
|
1770
|
+
return f;
|
|
1771
|
+
} : d;
|
|
1756
1772
|
},
|
|
1757
|
-
set(
|
|
1758
|
-
if (
|
|
1759
|
-
const
|
|
1760
|
-
r._triggerWatchers(
|
|
1773
|
+
set(i, l, c) {
|
|
1774
|
+
if (i[l] = c, !r._initializing) {
|
|
1775
|
+
const d = s ? `${s}.${String(l)}` : String(l);
|
|
1776
|
+
r._triggerWatchers(d, c), r._render(t);
|
|
1761
1777
|
}
|
|
1762
1778
|
return !0;
|
|
1763
1779
|
},
|
|
1764
|
-
deleteProperty(
|
|
1765
|
-
if (delete
|
|
1766
|
-
const
|
|
1767
|
-
r._triggerWatchers(
|
|
1780
|
+
deleteProperty(i, l) {
|
|
1781
|
+
if (delete i[l], !r._initializing) {
|
|
1782
|
+
const c = s ? `${s}.${String(l)}` : String(l);
|
|
1783
|
+
r._triggerWatchers(c, void 0), r._render(t);
|
|
1768
1784
|
}
|
|
1769
1785
|
return !0;
|
|
1770
1786
|
}
|
|
1771
|
-
}) :
|
|
1772
|
-
const l = s ? `${s}.${
|
|
1773
|
-
i
|
|
1774
|
-
}), new Proxy(
|
|
1775
|
-
set(
|
|
1776
|
-
const
|
|
1777
|
-
return
|
|
1778
|
-
|
|
1779
|
-
|
|
1787
|
+
}) : o && typeof o == "object" ? (Object.keys(o).forEach((i) => {
|
|
1788
|
+
const l = s ? `${s}.${i}` : i;
|
|
1789
|
+
o[i] = n(o[i], l);
|
|
1790
|
+
}), new Proxy(o, {
|
|
1791
|
+
set(i, l, c) {
|
|
1792
|
+
const d = s ? `${s}.${String(l)}` : String(l);
|
|
1793
|
+
return i[l] = n(c, d), r._initializing || (r._triggerWatchers(
|
|
1794
|
+
d,
|
|
1795
|
+
i[l]
|
|
1780
1796
|
), r._render(t)), !0;
|
|
1781
1797
|
},
|
|
1782
|
-
get(
|
|
1783
|
-
return Reflect.get(
|
|
1798
|
+
get(i, l, c) {
|
|
1799
|
+
return Reflect.get(i, l, c);
|
|
1784
1800
|
}
|
|
1785
|
-
})) :
|
|
1801
|
+
})) : o;
|
|
1786
1802
|
};
|
|
1787
1803
|
const r = this;
|
|
1788
1804
|
return n({ ...t.state });
|
|
@@ -1793,17 +1809,17 @@ ${n}
|
|
|
1793
1809
|
_initWatchers(t) {
|
|
1794
1810
|
if (t.watch)
|
|
1795
1811
|
for (const [n, r] of Object.entries(t.watch)) {
|
|
1796
|
-
let
|
|
1797
|
-
if (Array.isArray(r) ? (
|
|
1798
|
-
callback:
|
|
1812
|
+
let o, s = {};
|
|
1813
|
+
if (Array.isArray(r) ? (o = r[0], s = r[1] || {}) : o = r, this._watchers.set(n, {
|
|
1814
|
+
callback: o,
|
|
1799
1815
|
options: s,
|
|
1800
1816
|
oldValue: this._getNestedValue(n)
|
|
1801
1817
|
}), s.immediate)
|
|
1802
1818
|
try {
|
|
1803
|
-
const
|
|
1804
|
-
i
|
|
1805
|
-
} catch (
|
|
1806
|
-
console.error(`Error in immediate watcher for "${n}":`,
|
|
1819
|
+
const i = this._getNestedValue(n);
|
|
1820
|
+
o(i, void 0, this.context);
|
|
1821
|
+
} catch (i) {
|
|
1822
|
+
console.error(`Error in immediate watcher for "${n}":`, i);
|
|
1807
1823
|
}
|
|
1808
1824
|
}
|
|
1809
1825
|
}
|
|
@@ -1814,40 +1830,44 @@ ${n}
|
|
|
1814
1830
|
);
|
|
1815
1831
|
}
|
|
1816
1832
|
_triggerWatchers(t, n) {
|
|
1817
|
-
const r = (s,
|
|
1818
|
-
if (s ===
|
|
1819
|
-
if (typeof s != typeof
|
|
1820
|
-
if (Array.isArray(s) && Array.isArray(
|
|
1821
|
-
return s.length !==
|
|
1822
|
-
const l = Object.keys(s),
|
|
1823
|
-
return l.length !==
|
|
1824
|
-
},
|
|
1825
|
-
if (
|
|
1833
|
+
const r = (s, i) => {
|
|
1834
|
+
if (s === i) return !0;
|
|
1835
|
+
if (typeof s != typeof i || typeof s != "object" || s === null || i === null) return !1;
|
|
1836
|
+
if (Array.isArray(s) && Array.isArray(i))
|
|
1837
|
+
return s.length !== i.length ? !1 : s.every((d, p) => r(d, i[p]));
|
|
1838
|
+
const l = Object.keys(s), c = Object.keys(i);
|
|
1839
|
+
return l.length !== c.length ? !1 : l.every((d) => r(s[d], i[d]));
|
|
1840
|
+
}, o = this._watchers.get(t);
|
|
1841
|
+
if (o && !r(n, o.oldValue))
|
|
1826
1842
|
try {
|
|
1827
|
-
|
|
1843
|
+
o.callback(n, o.oldValue, this.context), o.oldValue = n;
|
|
1828
1844
|
} catch (s) {
|
|
1829
1845
|
console.error(`Error in watcher for "${t}":`, s);
|
|
1830
1846
|
}
|
|
1831
|
-
for (const [s,
|
|
1832
|
-
if (
|
|
1847
|
+
for (const [s, i] of this._watchers.entries())
|
|
1848
|
+
if (i.options.deep && t.startsWith(s + "."))
|
|
1833
1849
|
try {
|
|
1834
1850
|
const l = this._getNestedValue(s);
|
|
1835
|
-
r(l,
|
|
1851
|
+
r(l, i.oldValue) || (i.callback(l, i.oldValue, this.context), i.oldValue = l);
|
|
1836
1852
|
} catch (l) {
|
|
1837
1853
|
console.error(`Error in deep watcher for "${s}":`, l);
|
|
1838
1854
|
}
|
|
1839
1855
|
}
|
|
1840
1856
|
_applyProps(t) {
|
|
1841
1857
|
try {
|
|
1842
|
-
let n = function(r,
|
|
1843
|
-
return
|
|
1858
|
+
let n = function(r, o) {
|
|
1859
|
+
return o === Boolean ? r === "true" : o === Number ? Number(r) : r;
|
|
1844
1860
|
};
|
|
1845
1861
|
if (!t.props) return;
|
|
1846
|
-
Object.entries(t.props).forEach(([r,
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1862
|
+
Object.entries(t.props).forEach(([r, o]) => {
|
|
1863
|
+
if (o.type === Function && typeof this[r] == "function")
|
|
1864
|
+
this.context[r] = this[r];
|
|
1865
|
+
else {
|
|
1866
|
+
const s = this.getAttribute(Q(r));
|
|
1867
|
+
s !== null ? this.context[r] = J(
|
|
1868
|
+
n(s, o.type)
|
|
1869
|
+
) : "default" in o && o.default !== void 0 && (this.context[r] = J(o.default));
|
|
1870
|
+
}
|
|
1851
1871
|
});
|
|
1852
1872
|
} catch (n) {
|
|
1853
1873
|
this._hasError = !0, t.onError && t.onError(n, this.context), t.errorFallback && this.shadowRoot && (this.shadowRoot.innerHTML = t.errorFallback(
|
|
@@ -1865,8 +1885,8 @@ export {
|
|
|
1865
1885
|
He as css,
|
|
1866
1886
|
Ne as each,
|
|
1867
1887
|
Be as eventBus,
|
|
1868
|
-
|
|
1888
|
+
Oe as html,
|
|
1869
1889
|
Pe as match,
|
|
1870
|
-
|
|
1890
|
+
Me as when
|
|
1871
1891
|
};
|
|
1872
1892
|
//# sourceMappingURL=custom-elements-runtime.es.js.map
|