@jasonshimmy/custom-elements-runtime 0.1.25 → 0.2.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 +15 -15
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +707 -650
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +15 -15
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
function yt(e, t) {
|
|
2
|
-
return te(e ? t : [], "when-block");
|
|
3
|
-
}
|
|
4
1
|
function mt(e, t) {
|
|
2
|
+
return oe(e ? t : [], "when-block");
|
|
3
|
+
}
|
|
4
|
+
function bt(e, t) {
|
|
5
5
|
return e.map((r, n) => {
|
|
6
6
|
const o = typeof r == "object" ? r?.key ?? r?.id ?? `idx-${n}` : String(r);
|
|
7
|
-
return
|
|
7
|
+
return oe(t(r, n), `each-${o}`);
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
10
|
function Be() {
|
|
@@ -24,11 +24,11 @@ function Be() {
|
|
|
24
24
|
function Re(...e) {
|
|
25
25
|
for (let t = 0; t < e.length; t++) {
|
|
26
26
|
const [r, n] = e[t];
|
|
27
|
-
if (r) return [
|
|
27
|
+
if (r) return [oe(n, `whenChain-branch-${t}`)];
|
|
28
28
|
}
|
|
29
|
-
return [
|
|
29
|
+
return [oe([], "whenChain-empty")];
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function oe(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 te(e, t) {
|
|
|
36
36
|
children: r
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
class
|
|
39
|
+
class V extends EventTarget {
|
|
40
40
|
handlers = {};
|
|
41
41
|
static instance;
|
|
42
42
|
eventCounters = /* @__PURE__ */ new Map();
|
|
@@ -44,7 +44,7 @@ class K extends EventTarget {
|
|
|
44
44
|
* Returns the singleton instance of GlobalEventBus
|
|
45
45
|
*/
|
|
46
46
|
static getInstance() {
|
|
47
|
-
return
|
|
47
|
+
return V.instance || (V.instance = new V()), V.instance;
|
|
48
48
|
}
|
|
49
49
|
// Enhanced emit method with better typing and event storm protection
|
|
50
50
|
/**
|
|
@@ -160,7 +160,7 @@ class K extends EventTarget {
|
|
|
160
160
|
this.eventCounters.clear();
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
const
|
|
163
|
+
const X = V.getInstance(), vt = (e, t) => X.emit(e, t), wt = (e, t) => X.on(e, t), xt = (e, t) => X.off(e, t), kt = (e, t) => X.once(e, t), $t = (e, t, r) => X.listen(e, t, r);
|
|
164
164
|
function xe(e) {
|
|
165
165
|
let t = { ...e };
|
|
166
166
|
const r = [];
|
|
@@ -179,10 +179,10 @@ function xe(e) {
|
|
|
179
179
|
}
|
|
180
180
|
return { subscribe: n, getState: o, setState: s };
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function ve(e) {
|
|
183
183
|
return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function ge(e) {
|
|
186
186
|
return typeof e == "string" ? e.replace(
|
|
187
187
|
/[&<>"']/g,
|
|
188
188
|
(t) => ({
|
|
@@ -194,34 +194,34 @@ function pe(e) {
|
|
|
194
194
|
})[t]
|
|
195
195
|
) : e;
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function Oe(e, t, r) {
|
|
198
198
|
if (r)
|
|
199
199
|
for (const [n, o] of Object.entries(r)) {
|
|
200
200
|
let s, i = {};
|
|
201
201
|
if (Array.isArray(o) ? (s = o[0], i = o[1] || {}) : s = o, t.set(n, {
|
|
202
202
|
callback: s,
|
|
203
203
|
options: i,
|
|
204
|
-
oldValue:
|
|
204
|
+
oldValue: ye(e, n)
|
|
205
205
|
}), i.immediate)
|
|
206
206
|
try {
|
|
207
|
-
const a =
|
|
207
|
+
const a = ye(e, n);
|
|
208
208
|
s(a, void 0, e);
|
|
209
209
|
} catch (a) {
|
|
210
210
|
console.error(`Error in immediate watcher for "${n}":`, a);
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function ye(e, t) {
|
|
215
215
|
return t.split(".").reduce((r, n) => r?.[n], e);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function Me(e, t, r, n) {
|
|
218
218
|
const o = (i, a) => {
|
|
219
219
|
if (i === a) return !0;
|
|
220
220
|
if (typeof i != typeof a || typeof i != "object" || i === null || a === null) return !1;
|
|
221
221
|
if (Array.isArray(i) && Array.isArray(a))
|
|
222
|
-
return i.length !== a.length ? !1 : i.every((
|
|
223
|
-
const c = Object.keys(i),
|
|
224
|
-
return c.length !==
|
|
222
|
+
return i.length !== a.length ? !1 : i.every((l, y) => o(l, a[y]));
|
|
223
|
+
const c = Object.keys(i), u = Object.keys(a);
|
|
224
|
+
return c.length !== u.length ? !1 : c.every((l) => o(i[l], a[l]));
|
|
225
225
|
}, s = t.get(r);
|
|
226
226
|
if (s && !o(n, s.oldValue))
|
|
227
227
|
try {
|
|
@@ -232,13 +232,13 @@ function Oe(e, t, r, n) {
|
|
|
232
232
|
for (const [i, a] of t.entries())
|
|
233
233
|
if (a.options.deep && r.startsWith(i + "."))
|
|
234
234
|
try {
|
|
235
|
-
const c =
|
|
235
|
+
const c = ye(e, i);
|
|
236
236
|
o(c, a.oldValue) || (a.callback(c, a.oldValue, e), a.oldValue = c);
|
|
237
237
|
} catch (c) {
|
|
238
238
|
console.error(`Error in deep watcher for "${i}":`, c);
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function Ne(e, t, r) {
|
|
242
242
|
if (!t.props) return;
|
|
243
243
|
function n(o, s) {
|
|
244
244
|
return s === Boolean ? o === "true" : s === Number ? Number(o) : o;
|
|
@@ -247,63 +247,63 @@ function Me(e, t, r) {
|
|
|
247
247
|
if (s.type === Function && typeof e[o] == "function")
|
|
248
248
|
r[o] = e[o];
|
|
249
249
|
else {
|
|
250
|
-
const i = e.getAttribute(
|
|
251
|
-
i !== null ? r[o] =
|
|
250
|
+
const i = e.getAttribute(ve(o));
|
|
251
|
+
i !== null ? r[o] = ge(n(i, s.type)) : "default" in s && s.default !== void 0 && (r[o] = ge(s.default));
|
|
252
252
|
}
|
|
253
253
|
});
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function We(e, t, r, n) {
|
|
256
256
|
e.onConnected && !r && (e.onConnected(t), n(!0));
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function De(e, t, r, n, o, s, i, a) {
|
|
259
259
|
e.onDisconnected && e.onDisconnected(t), r.forEach((c) => c()), n(), o(), s(!1), i(null), a(!1);
|
|
260
260
|
}
|
|
261
|
-
function
|
|
261
|
+
function qe(e, t, r, n, o) {
|
|
262
262
|
e.onAttributeChanged && e.onAttributeChanged(t, r, n, o);
|
|
263
263
|
}
|
|
264
|
-
function
|
|
264
|
+
function H(e, t) {
|
|
265
265
|
if (t && e instanceof HTMLElement) {
|
|
266
266
|
for (const r in t)
|
|
267
267
|
t[r] === e && delete t[r];
|
|
268
268
|
for (const r of Array.from(e.childNodes))
|
|
269
|
-
|
|
269
|
+
H(r, t);
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function K(e, t) {
|
|
273
273
|
return typeof t == "string" ? t.split(".").reduce((r, n) => r?.[n], e) : t;
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function ke(e, t, r) {
|
|
276
276
|
const n = t.split("."), o = n.pop();
|
|
277
277
|
if (!o) return;
|
|
278
278
|
const s = n.reduce((i, a) => (a in i || (i[a] = {}), i[a]), e);
|
|
279
279
|
s[o] = r;
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function Ie(e, t, r, n, o, s, i) {
|
|
282
282
|
if (!s) return;
|
|
283
|
-
const a = t.includes("lazy"), c = t.includes("trim"),
|
|
284
|
-
const
|
|
285
|
-
return
|
|
286
|
-
}, y =
|
|
287
|
-
let
|
|
288
|
-
const
|
|
289
|
-
if (i instanceof HTMLInputElement ?
|
|
283
|
+
const a = t.includes("lazy"), c = t.includes("trim"), u = t.includes("number"), l = () => {
|
|
284
|
+
const p = s._state || s;
|
|
285
|
+
return K(p, e);
|
|
286
|
+
}, y = l();
|
|
287
|
+
let d = "text";
|
|
288
|
+
const b = n?.type;
|
|
289
|
+
if (i instanceof HTMLInputElement ? d = b || i.type || "text" : i instanceof HTMLSelectElement ? d = "select" : i instanceof HTMLTextAreaElement && (d = "textarea"), d === "checkbox")
|
|
290
290
|
if (Array.isArray(y)) {
|
|
291
|
-
const
|
|
292
|
-
i && i.checked !==
|
|
291
|
+
const p = i?.getAttribute("value") || n?.value || "", f = y.includes(p);
|
|
292
|
+
i && i.checked !== f && (r.checked = f);
|
|
293
293
|
} else {
|
|
294
|
-
const
|
|
295
|
-
i && i.checked !==
|
|
294
|
+
const p = i?.getAttribute("true-value") || !0, f = y === p;
|
|
295
|
+
i && i.checked !== f && (r.checked = f);
|
|
296
296
|
}
|
|
297
|
-
else if (
|
|
298
|
-
const
|
|
299
|
-
i && i.checked !==
|
|
300
|
-
} else if (
|
|
297
|
+
else if (d === "radio") {
|
|
298
|
+
const p = n?.value || "", f = y === p;
|
|
299
|
+
i && i.checked !== f && (r.checked = f);
|
|
300
|
+
} else if (d === "select")
|
|
301
301
|
if (i && i.hasAttribute("multiple")) {
|
|
302
|
-
const
|
|
302
|
+
const p = i, f = Array.isArray(y) ? y : [];
|
|
303
303
|
setTimeout(() => {
|
|
304
|
-
Array.from(
|
|
305
|
-
const
|
|
306
|
-
g.selected !==
|
|
304
|
+
Array.from(p.options).forEach((g) => {
|
|
305
|
+
const m = f.includes(g.value);
|
|
306
|
+
g.selected !== m && (g.selected = m);
|
|
307
307
|
});
|
|
308
308
|
}, 0);
|
|
309
309
|
} else
|
|
@@ -311,75 +311,84 @@ function qe(e, t, r, n, o, s, i) {
|
|
|
311
311
|
i instanceof HTMLSelectElement && i.value !== String(y) && (i.value = String(y));
|
|
312
312
|
}, 0);
|
|
313
313
|
else {
|
|
314
|
-
const
|
|
315
|
-
(!i || i.value !==
|
|
316
|
-
}
|
|
317
|
-
const
|
|
318
|
-
if (
|
|
319
|
-
const
|
|
320
|
-
if (
|
|
321
|
-
const g =
|
|
322
|
-
let
|
|
323
|
-
if (
|
|
314
|
+
const p = String(y ?? "");
|
|
315
|
+
(!i || i.value !== p) && (r.value = y);
|
|
316
|
+
}
|
|
317
|
+
const k = a || d === "checkbox" || d === "radio" || d === "select" ? "change" : "input", x = (p) => {
|
|
318
|
+
if (p.isComposing || o._isComposing || p.isTrusted === !1) return;
|
|
319
|
+
const f = p.target;
|
|
320
|
+
if (f._modelUpdating) return;
|
|
321
|
+
const g = l();
|
|
322
|
+
let m = f.value;
|
|
323
|
+
if (d === "checkbox")
|
|
324
324
|
if (Array.isArray(g)) {
|
|
325
|
-
const $ =
|
|
326
|
-
if (
|
|
325
|
+
const $ = f.getAttribute("value") || "", _ = [...g];
|
|
326
|
+
if (f.checked)
|
|
327
327
|
_.includes($) || _.push($);
|
|
328
328
|
else {
|
|
329
329
|
const C = _.indexOf($);
|
|
330
330
|
C > -1 && _.splice(C, 1);
|
|
331
331
|
}
|
|
332
|
-
|
|
332
|
+
m = _;
|
|
333
333
|
} else {
|
|
334
|
-
const $ =
|
|
335
|
-
|
|
334
|
+
const $ = f.getAttribute("true-value") || !0, _ = f.getAttribute("false-value") || !1;
|
|
335
|
+
m = f.checked ? $ : _;
|
|
336
336
|
}
|
|
337
|
-
else if (
|
|
338
|
-
|
|
339
|
-
else if (
|
|
340
|
-
const $ =
|
|
341
|
-
|
|
337
|
+
else if (d === "radio")
|
|
338
|
+
m = f.getAttribute("value") || f.value;
|
|
339
|
+
else if (d === "select" && f.multiple) {
|
|
340
|
+
const $ = f;
|
|
341
|
+
m = Array.from($.selectedOptions).map(
|
|
342
342
|
(_) => _.value
|
|
343
343
|
);
|
|
344
|
-
} else if (c && (
|
|
345
|
-
const $ = Number(
|
|
346
|
-
isNaN($) || (
|
|
344
|
+
} else if (c && (m = m.trim()), u) {
|
|
345
|
+
const $ = Number(m);
|
|
346
|
+
isNaN($) || (m = $);
|
|
347
347
|
}
|
|
348
|
-
const
|
|
349
|
-
if (Array.isArray(
|
|
350
|
-
const $ =
|
|
351
|
-
$._modelUpdating = !0,
|
|
348
|
+
const h = s._state || s, w = K(h, e);
|
|
349
|
+
if (Array.isArray(m) && Array.isArray(w) ? JSON.stringify([...m].sort()) !== JSON.stringify([...w].sort()) : m !== w) {
|
|
350
|
+
const $ = p.target;
|
|
351
|
+
$._modelUpdating = !0, ke(h, e, m), setTimeout(() => {
|
|
352
352
|
$._modelUpdating = !1;
|
|
353
353
|
}, 0), s._requestRender && s._requestRender();
|
|
354
354
|
}
|
|
355
355
|
};
|
|
356
|
-
if (o[
|
|
357
|
-
const
|
|
356
|
+
if (o[k] = x, d === "text" || d === "textarea") {
|
|
357
|
+
const p = () => {
|
|
358
358
|
o._isComposing = !0;
|
|
359
|
-
},
|
|
359
|
+
}, f = (g) => {
|
|
360
360
|
o._isComposing = !1;
|
|
361
|
-
const
|
|
361
|
+
const m = g.target;
|
|
362
362
|
setTimeout(() => {
|
|
363
|
-
if (
|
|
364
|
-
let
|
|
365
|
-
if (c && (
|
|
366
|
-
const _ = Number(
|
|
367
|
-
isNaN(_) || (
|
|
363
|
+
if (m) {
|
|
364
|
+
let h = m.value;
|
|
365
|
+
if (c && (h = h.trim()), u) {
|
|
366
|
+
const _ = Number(h);
|
|
367
|
+
isNaN(_) || (h = _);
|
|
368
368
|
}
|
|
369
|
-
const
|
|
370
|
-
(Array.isArray(
|
|
371
|
-
|
|
372
|
-
}, 0)),
|
|
369
|
+
const w = s._state || s, v = K(w, e);
|
|
370
|
+
(Array.isArray(h) && Array.isArray(v) ? JSON.stringify([...h].sort()) !== JSON.stringify([...v].sort()) : h !== v) && (m && (m._modelUpdating = !0, setTimeout(() => {
|
|
371
|
+
m._modelUpdating = !1;
|
|
372
|
+
}, 0)), ke(w, e, h), s._requestRender && s._requestRender());
|
|
373
373
|
}
|
|
374
374
|
}, 0);
|
|
375
375
|
};
|
|
376
|
-
o.compositionstart =
|
|
376
|
+
o.compositionstart = p, o.compositionend = f;
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function Te(e) {
|
|
380
380
|
return e.slice(2).charAt(0).toLowerCase() + e.slice(3);
|
|
381
381
|
}
|
|
382
|
-
function
|
|
382
|
+
function ee(e) {
|
|
383
|
+
if (!e) return [void 0, void 0];
|
|
384
|
+
if (typeof e == "function") return [e, void 0];
|
|
385
|
+
if (typeof e == "object") {
|
|
386
|
+
if (typeof e.handler == "function") return [e.handler, e.options];
|
|
387
|
+
if (typeof e.fn == "function") return [e.fn, e.options];
|
|
388
|
+
}
|
|
389
|
+
return [void 0, void 0];
|
|
390
|
+
}
|
|
391
|
+
function He(e, t, r, n) {
|
|
383
392
|
if (n) {
|
|
384
393
|
if (typeof e == "object" && e !== null)
|
|
385
394
|
for (const [o, s] of Object.entries(e))
|
|
@@ -393,14 +402,14 @@ function Ie(e, t, r, n) {
|
|
|
393
402
|
return;
|
|
394
403
|
}
|
|
395
404
|
} catch {
|
|
396
|
-
const o =
|
|
405
|
+
const o = K(n, e);
|
|
397
406
|
r[e] = o;
|
|
398
407
|
}
|
|
399
408
|
}
|
|
400
409
|
}
|
|
401
|
-
function
|
|
410
|
+
function Ke(e, t, r) {
|
|
402
411
|
if (!r) return;
|
|
403
|
-
const n =
|
|
412
|
+
const n = K(r, e), o = t.style || "", s = n ? "" : "none";
|
|
404
413
|
if (o) {
|
|
405
414
|
const i = o.split(";").filter(Boolean), a = i.findIndex(
|
|
406
415
|
(c) => c.trim().startsWith("display:")
|
|
@@ -409,19 +418,19 @@ function He(e, t, r) {
|
|
|
409
418
|
} else
|
|
410
419
|
t.style = `display: ${s}`;
|
|
411
420
|
}
|
|
412
|
-
function
|
|
421
|
+
function Ue(e, t, r) {
|
|
413
422
|
if (!r) return;
|
|
414
|
-
const n =
|
|
423
|
+
const n = K(r, e);
|
|
415
424
|
let o = [];
|
|
416
425
|
typeof n == "string" ? o = [n] : Array.isArray(n) ? o = n.filter(Boolean) : typeof n == "object" && (o = Object.entries(n).filter(([, a]) => !!a).flatMap(([a]) => a.split(/\s+/).filter(Boolean)));
|
|
417
426
|
const s = t.class || "", i = s ? `${s} ${o.join(" ")}`.trim() : o.join(" ");
|
|
418
427
|
i && (t.class = i);
|
|
419
428
|
}
|
|
420
|
-
function
|
|
429
|
+
function Fe(e, t, r) {
|
|
421
430
|
let n;
|
|
422
431
|
if (typeof e == "string") {
|
|
423
432
|
if (!r) return;
|
|
424
|
-
n =
|
|
433
|
+
n = K(r, e);
|
|
425
434
|
} else
|
|
426
435
|
n = e;
|
|
427
436
|
let o = "";
|
|
@@ -431,10 +440,10 @@ function Ke(e, t, r) {
|
|
|
431
440
|
const i = [];
|
|
432
441
|
for (const [a, c] of Object.entries(n))
|
|
433
442
|
if (c != null && c !== "") {
|
|
434
|
-
const
|
|
443
|
+
const u = a.replace(
|
|
435
444
|
/[A-Z]/g,
|
|
436
|
-
(
|
|
437
|
-
),
|
|
445
|
+
(d) => `-${d.toLowerCase()}`
|
|
446
|
+
), l = [
|
|
438
447
|
"width",
|
|
439
448
|
"height",
|
|
440
449
|
"top",
|
|
@@ -461,22 +470,22 @@ function Ke(e, t, r) {
|
|
|
461
470
|
"max-height"
|
|
462
471
|
];
|
|
463
472
|
let y = String(c);
|
|
464
|
-
typeof c == "number" &&
|
|
473
|
+
typeof c == "number" && l.includes(u) && (y = `${c}px`), i.push(`${u}: ${y}`);
|
|
465
474
|
}
|
|
466
475
|
o = i.join("; ") + (i.length > 0 ? ";" : "");
|
|
467
476
|
}
|
|
468
477
|
const s = t.style || "";
|
|
469
478
|
t.style = s + (s && !s.endsWith(";") ? "; " : "") + o;
|
|
470
479
|
}
|
|
471
|
-
function
|
|
480
|
+
function je(e, t, r, n) {
|
|
472
481
|
const o = {}, s = { ...n || {} }, i = {};
|
|
473
482
|
for (const [a, c] of Object.entries(e)) {
|
|
474
|
-
const { value:
|
|
483
|
+
const { value: u, modifiers: l } = c;
|
|
475
484
|
switch (a) {
|
|
476
485
|
case "model":
|
|
477
|
-
|
|
478
|
-
typeof
|
|
479
|
-
|
|
486
|
+
Ie(
|
|
487
|
+
typeof u == "string" ? u : String(u),
|
|
488
|
+
l,
|
|
480
489
|
o,
|
|
481
490
|
s,
|
|
482
491
|
i,
|
|
@@ -485,45 +494,45 @@ function Te(e, t, r, n) {
|
|
|
485
494
|
);
|
|
486
495
|
break;
|
|
487
496
|
case "bind":
|
|
488
|
-
|
|
497
|
+
He(u, o, s, t);
|
|
489
498
|
break;
|
|
490
499
|
case "show":
|
|
491
|
-
|
|
500
|
+
Ke(u, s, t);
|
|
492
501
|
break;
|
|
493
502
|
case "class":
|
|
494
|
-
|
|
503
|
+
Ue(u, s, t);
|
|
495
504
|
break;
|
|
496
505
|
case "style":
|
|
497
|
-
|
|
506
|
+
Fe(u, s, t);
|
|
498
507
|
break;
|
|
499
508
|
}
|
|
500
509
|
}
|
|
501
510
|
return { props: o, attrs: s, listeners: i };
|
|
502
511
|
}
|
|
503
|
-
function
|
|
512
|
+
function me(e, t) {
|
|
504
513
|
if (Array.isArray(e)) {
|
|
505
514
|
const s = /* @__PURE__ */ new Set();
|
|
506
515
|
return e.map((i) => {
|
|
507
516
|
if (!i || typeof i != "object") return i;
|
|
508
517
|
let a = i.props?.key ?? i.key;
|
|
509
518
|
if (!a) {
|
|
510
|
-
const y = i.tag || "node",
|
|
511
|
-
a =
|
|
519
|
+
const y = i.tag || "node", d = i.props?.attrs?.id ?? i.props?.attrs?.name ?? i.props?.attrs?.["data-key"] ?? "";
|
|
520
|
+
a = d ? `${t}:${y}:${d}` : `${t}:${y}`;
|
|
512
521
|
}
|
|
513
|
-
let c = a,
|
|
522
|
+
let c = a, u = 1;
|
|
514
523
|
for (; s.has(c); )
|
|
515
|
-
c = `${a}#${
|
|
524
|
+
c = `${a}#${u++}`;
|
|
516
525
|
s.add(c);
|
|
517
|
-
let
|
|
518
|
-
return Array.isArray(
|
|
526
|
+
let l = i.children;
|
|
527
|
+
return Array.isArray(l) && (l = me(l, c)), { ...i, key: c, children: l };
|
|
519
528
|
});
|
|
520
529
|
}
|
|
521
530
|
const r = e;
|
|
522
531
|
let n = r.props?.key ?? r.key ?? t, o = r.children;
|
|
523
|
-
return Array.isArray(o) && (o =
|
|
532
|
+
return Array.isArray(o) && (o = me(o, n)), { ...r, key: n, children: o };
|
|
524
533
|
}
|
|
525
|
-
function
|
|
526
|
-
const o = r.directives ?? {}, s =
|
|
534
|
+
function Ve(e, t, r, n) {
|
|
535
|
+
const o = r.directives ?? {}, s = je(
|
|
527
536
|
o,
|
|
528
537
|
n,
|
|
529
538
|
e,
|
|
@@ -536,30 +545,32 @@ function Ue(e, t, r, n) {
|
|
|
536
545
|
...t.attrs,
|
|
537
546
|
...r.attrs,
|
|
538
547
|
...s.attrs
|
|
539
|
-
}, c = t.props ?? {},
|
|
540
|
-
for (const
|
|
541
|
-
const
|
|
542
|
-
if (
|
|
543
|
-
if (
|
|
544
|
-
e.value !==
|
|
545
|
-
else if (
|
|
546
|
-
e.checked = !!
|
|
547
|
-
else if (
|
|
548
|
-
const k =
|
|
549
|
-
|
|
550
|
-
} else
|
|
551
|
-
}
|
|
552
|
-
for (const [
|
|
548
|
+
}, c = t.props ?? {}, u = i;
|
|
549
|
+
for (const d in { ...c, ...u }) {
|
|
550
|
+
const b = c[d], k = u[d];
|
|
551
|
+
if (b !== k)
|
|
552
|
+
if (d === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement))
|
|
553
|
+
e.value !== k && (e.value = k ?? "");
|
|
554
|
+
else if (d === "checked" && e instanceof HTMLInputElement)
|
|
555
|
+
e.checked = !!k;
|
|
556
|
+
else if (d.startsWith("on")) {
|
|
557
|
+
const x = Te(d), [p, f] = ee(k), [g, m] = ee(b);
|
|
558
|
+
g && e.removeEventListener(x, g, m), p && e.addEventListener(x, p, f);
|
|
559
|
+
} else k == null || k === !1 ? e.removeAttribute(d) : e.setAttribute(d, String(k));
|
|
560
|
+
}
|
|
561
|
+
for (const [d, b] of Object.entries(
|
|
553
562
|
s.listeners || {}
|
|
554
|
-
))
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
563
|
+
)) {
|
|
564
|
+
const [k, x] = ee(b);
|
|
565
|
+
k && e.addEventListener(d, k, x);
|
|
566
|
+
}
|
|
567
|
+
const l = t.attrs ?? {}, y = a;
|
|
568
|
+
for (const d in { ...l, ...y }) {
|
|
569
|
+
const b = l[d], k = y[d];
|
|
570
|
+
b !== k && (k == null || k === !1 ? e.removeAttribute(d) : e.setAttribute(d, String(k)));
|
|
560
571
|
}
|
|
561
572
|
}
|
|
562
|
-
function
|
|
573
|
+
function O(e, t, r) {
|
|
563
574
|
if (typeof e == "string")
|
|
564
575
|
return document.createTextNode(e);
|
|
565
576
|
if (e.tag === "#text") {
|
|
@@ -569,169 +580,170 @@ function P(e, t, r) {
|
|
|
569
580
|
return e.key != null && (y.key = e.key), y;
|
|
570
581
|
}
|
|
571
582
|
if (e.tag === "#anchor") {
|
|
572
|
-
const y = e,
|
|
573
|
-
y.key != null && (
|
|
574
|
-
const
|
|
575
|
-
|
|
576
|
-
for (const
|
|
577
|
-
const
|
|
578
|
-
|
|
583
|
+
const y = e, d = Array.isArray(y.children) ? y.children : [], b = document.createTextNode(""), k = document.createTextNode("");
|
|
584
|
+
y.key != null && (b.key = `${y.key}:start`, k.key = `${y.key}:end`), y._startNode = b, y._endNode = k;
|
|
585
|
+
const x = document.createDocumentFragment();
|
|
586
|
+
x.appendChild(b);
|
|
587
|
+
for (const p of d) {
|
|
588
|
+
const f = O(p, t);
|
|
589
|
+
x.appendChild(f);
|
|
579
590
|
}
|
|
580
|
-
return
|
|
591
|
+
return x.appendChild(k), x;
|
|
581
592
|
}
|
|
582
593
|
const n = document.createElement(e.tag);
|
|
583
594
|
e.key != null && (n.key = e.key);
|
|
584
|
-
const { props: o = {}, attrs: s = {}, directives: i = {} } = e.props ?? {}, a =
|
|
595
|
+
const { props: o = {}, attrs: s = {}, directives: i = {} } = e.props ?? {}, a = je(i, t, n, s), c = {
|
|
585
596
|
...o,
|
|
586
597
|
...a.props
|
|
587
|
-
},
|
|
598
|
+
}, u = {
|
|
588
599
|
...s,
|
|
589
600
|
...a.attrs
|
|
590
601
|
};
|
|
591
|
-
for (const y in
|
|
592
|
-
const
|
|
602
|
+
for (const y in u) {
|
|
603
|
+
const d = u[y];
|
|
593
604
|
if (typeof y != "string" || /\[object Object\]/.test(y)) {
|
|
594
|
-
typeof window < "u" && window.console && console.warn("Skipping invalid attribute key:", y,
|
|
605
|
+
typeof window < "u" && window.console && console.warn("Skipping invalid attribute key:", y, d);
|
|
595
606
|
continue;
|
|
596
607
|
}
|
|
597
|
-
typeof
|
|
608
|
+
typeof d == "boolean" ? d && n.setAttribute(y, "") : d != null && n.setAttribute(y, d);
|
|
598
609
|
}
|
|
599
610
|
for (const y in c) {
|
|
600
|
-
const
|
|
611
|
+
const d = c[y];
|
|
601
612
|
if (typeof y != "string" || /\[object Object\]/.test(y)) {
|
|
602
|
-
typeof window < "u" && window.console && console.warn("Skipping invalid prop key:", y,
|
|
613
|
+
typeof window < "u" && window.console && console.warn("Skipping invalid prop key:", y, d);
|
|
603
614
|
continue;
|
|
604
615
|
}
|
|
605
616
|
if (y === "value" && (n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n instanceof HTMLSelectElement))
|
|
606
|
-
n.value =
|
|
617
|
+
n.value = d ?? "";
|
|
607
618
|
else if (y === "checked" && n instanceof HTMLInputElement)
|
|
608
|
-
n.checked = !!
|
|
609
|
-
else if (y.startsWith("on")
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
619
|
+
n.checked = !!d;
|
|
620
|
+
else if (y.startsWith("on")) {
|
|
621
|
+
const [b, k] = ee(d);
|
|
622
|
+
b && n.addEventListener(Te(y), b, k);
|
|
623
|
+
} else {
|
|
624
|
+
if (y.startsWith("on") && d === void 0)
|
|
613
625
|
continue;
|
|
614
|
-
|
|
626
|
+
d == null || d === !1 ? n.removeAttribute(y) : n.setAttribute(y, String(d));
|
|
615
627
|
}
|
|
616
628
|
}
|
|
617
|
-
for (const [y,
|
|
629
|
+
for (const [y, d] of Object.entries(
|
|
618
630
|
a.listeners || {}
|
|
619
631
|
))
|
|
620
|
-
n.addEventListener(y,
|
|
621
|
-
const
|
|
622
|
-
if (typeof e != "string" &&
|
|
632
|
+
n.addEventListener(y, d);
|
|
633
|
+
const l = e.props?.ref ?? (e.props?.props && e.props.props.ref);
|
|
634
|
+
if (typeof e != "string" && l && r && (r[l] = n), Array.isArray(e.children))
|
|
623
635
|
for (const y of e.children)
|
|
624
|
-
n.appendChild(
|
|
636
|
+
n.appendChild(O(y, t, r));
|
|
625
637
|
else typeof e.children == "string" && (n.textContent = e.children);
|
|
626
638
|
return n;
|
|
627
639
|
}
|
|
628
|
-
function
|
|
640
|
+
function Je(e, t, r, n, o) {
|
|
629
641
|
if (typeof r == "string") {
|
|
630
642
|
e.textContent !== r && (e.textContent = r);
|
|
631
643
|
return;
|
|
632
644
|
}
|
|
633
645
|
if (!Array.isArray(r)) return;
|
|
634
646
|
const s = Array.from(e.childNodes), i = Array.isArray(t) ? t : [], a = /* @__PURE__ */ new Map();
|
|
635
|
-
for (const
|
|
636
|
-
|
|
647
|
+
for (const b of i)
|
|
648
|
+
b && b.key != null && a.set(b.key, b);
|
|
637
649
|
const c = /* @__PURE__ */ new Map();
|
|
638
|
-
for (const
|
|
639
|
-
const
|
|
640
|
-
|
|
641
|
-
}
|
|
642
|
-
const
|
|
643
|
-
let
|
|
644
|
-
function y(
|
|
645
|
-
let
|
|
646
|
-
for (;
|
|
647
|
-
|
|
648
|
-
}
|
|
649
|
-
function
|
|
650
|
-
const
|
|
651
|
-
let g =
|
|
652
|
-
for (; g && g !==
|
|
653
|
-
|
|
654
|
-
const
|
|
655
|
-
if (
|
|
656
|
-
const
|
|
657
|
-
for (const C of
|
|
658
|
-
C && C.key != null &&
|
|
659
|
-
for (const C of
|
|
650
|
+
for (const b of s) {
|
|
651
|
+
const k = b.key;
|
|
652
|
+
k != null && c.set(k, b);
|
|
653
|
+
}
|
|
654
|
+
const u = /* @__PURE__ */ new Set();
|
|
655
|
+
let l = e.firstChild;
|
|
656
|
+
function y(b, k) {
|
|
657
|
+
let x = b;
|
|
658
|
+
for (; x && (u.add(x), x !== k); )
|
|
659
|
+
x = x.nextSibling;
|
|
660
|
+
}
|
|
661
|
+
function d(b, k, x, p) {
|
|
662
|
+
const f = [];
|
|
663
|
+
let g = b.nextSibling;
|
|
664
|
+
for (; g && g !== k; )
|
|
665
|
+
f.push(g), g = g.nextSibling;
|
|
666
|
+
const m = Array.isArray(x) ? x : [];
|
|
667
|
+
if (p.some((w) => w && w.key != null) || m.some((w) => w && w.key != null)) {
|
|
668
|
+
const w = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map();
|
|
669
|
+
for (const C of m)
|
|
670
|
+
C && C.key != null && w.set(C.key, C);
|
|
671
|
+
for (const C of f) {
|
|
660
672
|
const E = C.key;
|
|
661
|
-
E != null &&
|
|
673
|
+
E != null && v.set(E, C);
|
|
662
674
|
}
|
|
663
675
|
const $ = /* @__PURE__ */ new Set();
|
|
664
|
-
let _ =
|
|
665
|
-
for (const C of
|
|
676
|
+
let _ = b.nextSibling;
|
|
677
|
+
for (const C of p) {
|
|
666
678
|
let E;
|
|
667
|
-
if (C.key != null &&
|
|
668
|
-
const j =
|
|
669
|
-
E =
|
|
670
|
-
|
|
679
|
+
if (C.key != null && v.has(C.key)) {
|
|
680
|
+
const j = w.get(C.key);
|
|
681
|
+
E = te(
|
|
682
|
+
v.get(C.key),
|
|
671
683
|
j,
|
|
672
684
|
C,
|
|
673
685
|
n
|
|
674
686
|
), $.add(E), E !== _ && e.contains(E) && e.insertBefore(E, _);
|
|
675
687
|
} else
|
|
676
|
-
E =
|
|
688
|
+
E = O(C, n), e.insertBefore(E, _), $.add(E);
|
|
677
689
|
_ = E.nextSibling;
|
|
678
690
|
}
|
|
679
|
-
for (const C of
|
|
691
|
+
for (const C of f)
|
|
680
692
|
!$.has(C) && e.contains(C) && e.removeChild(C);
|
|
681
693
|
} else {
|
|
682
|
-
const
|
|
683
|
-
|
|
684
|
-
|
|
694
|
+
const w = Math.min(
|
|
695
|
+
m.length,
|
|
696
|
+
p.length
|
|
685
697
|
);
|
|
686
|
-
for (let
|
|
687
|
-
const $ =
|
|
688
|
-
C !==
|
|
698
|
+
for (let v = 0; v < w; v++) {
|
|
699
|
+
const $ = m[v], _ = p[v], C = te(f[v], $, _, n);
|
|
700
|
+
C !== f[v] && (e.insertBefore(C, f[v]), e.removeChild(f[v]));
|
|
689
701
|
}
|
|
690
|
-
for (let
|
|
691
|
-
e.insertBefore(
|
|
692
|
-
for (let
|
|
693
|
-
e.removeChild(
|
|
702
|
+
for (let v = w; v < p.length; v++)
|
|
703
|
+
e.insertBefore(O(p[v], n), k);
|
|
704
|
+
for (let v = w; v < f.length; v++)
|
|
705
|
+
e.removeChild(f[v]);
|
|
694
706
|
}
|
|
695
707
|
}
|
|
696
|
-
for (const
|
|
697
|
-
let
|
|
698
|
-
if (
|
|
699
|
-
const
|
|
700
|
-
let g = c.get(
|
|
701
|
-
const
|
|
702
|
-
if (g || (g = document.createTextNode(""), g.key =
|
|
703
|
-
e.insertBefore(g,
|
|
704
|
-
for (const
|
|
705
|
-
e.insertBefore(
|
|
706
|
-
e.insertBefore(
|
|
708
|
+
for (const b of r) {
|
|
709
|
+
let k;
|
|
710
|
+
if (b.tag === "#anchor") {
|
|
711
|
+
const x = b.key, p = `${x}:start`, f = `${x}:end`;
|
|
712
|
+
let g = c.get(p), m = c.get(f);
|
|
713
|
+
const h = Array.isArray(b.children) ? b.children : [];
|
|
714
|
+
if (g || (g = document.createTextNode(""), g.key = p), m || (m = document.createTextNode(""), m.key = f), b._startNode = g, b._endNode = m, !e.contains(g) || !e.contains(m)) {
|
|
715
|
+
e.insertBefore(g, l);
|
|
716
|
+
for (const w of h)
|
|
717
|
+
e.insertBefore(O(w, n), l);
|
|
718
|
+
e.insertBefore(m, l);
|
|
707
719
|
} else
|
|
708
|
-
|
|
720
|
+
d(
|
|
709
721
|
g,
|
|
710
|
-
|
|
711
|
-
a.get(
|
|
712
|
-
|
|
722
|
+
m,
|
|
723
|
+
a.get(x)?.children,
|
|
724
|
+
h
|
|
713
725
|
);
|
|
714
|
-
y(g,
|
|
726
|
+
y(g, m), l = m.nextSibling;
|
|
715
727
|
continue;
|
|
716
728
|
}
|
|
717
|
-
if (
|
|
718
|
-
const
|
|
719
|
-
|
|
720
|
-
c.get(
|
|
721
|
-
|
|
722
|
-
|
|
729
|
+
if (b.key != null && c.has(b.key)) {
|
|
730
|
+
const x = a.get(b.key);
|
|
731
|
+
k = te(
|
|
732
|
+
c.get(b.key),
|
|
733
|
+
x,
|
|
734
|
+
b,
|
|
723
735
|
n,
|
|
724
736
|
o
|
|
725
|
-
),
|
|
737
|
+
), u.add(k), k !== l && e.contains(k) && (l && !e.contains(l) && (l = null), e.insertBefore(k, l));
|
|
726
738
|
} else
|
|
727
|
-
|
|
728
|
-
|
|
739
|
+
k = O(b, n, o), l && !e.contains(l) && (l = null), e.insertBefore(k, l), u.add(k);
|
|
740
|
+
l = k.nextSibling;
|
|
729
741
|
}
|
|
730
|
-
for (const
|
|
731
|
-
!
|
|
742
|
+
for (const b of s)
|
|
743
|
+
!u.has(b) && e.contains(b) && (H(b, o), e.removeChild(b));
|
|
732
744
|
}
|
|
733
|
-
function
|
|
734
|
-
if (t && typeof t != "string" && t.props?.ref && o &&
|
|
745
|
+
function te(e, t, r, n, o) {
|
|
746
|
+
if (t && typeof t != "string" && t.props?.ref && o && H(e, o), t === r) return e;
|
|
735
747
|
if (typeof r == "string") {
|
|
736
748
|
if (e.nodeType === Node.TEXT_NODE)
|
|
737
749
|
return e.textContent !== r && (e.textContent = r), e;
|
|
@@ -741,78 +753,78 @@ function Y(e, t, r, n, o) {
|
|
|
741
753
|
}
|
|
742
754
|
}
|
|
743
755
|
if (r && typeof r != "string" && r.tag === "#anchor") {
|
|
744
|
-
const i = r, a = Array.isArray(i.children) ? i.children : [], c = i._startNode ?? document.createTextNode(""),
|
|
745
|
-
i.key != null && (c.key = `${i.key}:start`,
|
|
746
|
-
const
|
|
747
|
-
|
|
756
|
+
const i = r, a = Array.isArray(i.children) ? i.children : [], c = i._startNode ?? document.createTextNode(""), u = i._endNode ?? document.createTextNode("");
|
|
757
|
+
i.key != null && (c.key = `${i.key}:start`, u.key = `${i.key}:end`), i._startNode = c, i._endNode = u;
|
|
758
|
+
const l = document.createDocumentFragment();
|
|
759
|
+
l.appendChild(c);
|
|
748
760
|
for (const y of a) {
|
|
749
|
-
const
|
|
750
|
-
|
|
761
|
+
const d = O(y, n);
|
|
762
|
+
l.appendChild(d);
|
|
751
763
|
}
|
|
752
|
-
return
|
|
764
|
+
return l.appendChild(u), e.parentNode?.replaceChild(l, e), c;
|
|
753
765
|
}
|
|
754
766
|
if (!r) {
|
|
755
|
-
|
|
767
|
+
H(e, o);
|
|
756
768
|
const i = document.createComment("removed");
|
|
757
769
|
return e.parentNode?.replaceChild(i, e), i;
|
|
758
770
|
}
|
|
759
771
|
if (!t || typeof t == "string") {
|
|
760
|
-
|
|
761
|
-
const i =
|
|
772
|
+
H(e, o);
|
|
773
|
+
const i = O(r, n, o);
|
|
762
774
|
return typeof r != "string" && r.props?.ref && o && (o[r.props.ref] = i), e.parentNode?.replaceChild(i, e), i;
|
|
763
775
|
}
|
|
764
776
|
if (r.tag === "#anchor") {
|
|
765
777
|
const i = Array.isArray(r.children) ? r.children : [], a = r._startNode ?? document.createTextNode(""), c = r._endNode ?? document.createTextNode("");
|
|
766
778
|
r.key != null && (a.key = `${r.key}:start`, c.key = `${r.key}:end`), r._startNode = a, r._endNode = c;
|
|
767
|
-
const
|
|
768
|
-
|
|
769
|
-
for (const
|
|
770
|
-
|
|
771
|
-
return
|
|
779
|
+
const u = document.createDocumentFragment();
|
|
780
|
+
u.appendChild(a);
|
|
781
|
+
for (const l of i)
|
|
782
|
+
u.appendChild(O(l, n));
|
|
783
|
+
return u.appendChild(c), e.parentNode?.replaceChild(u, e), a;
|
|
772
784
|
}
|
|
773
785
|
if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && t.key === r.key) {
|
|
774
786
|
const i = e;
|
|
775
|
-
return
|
|
787
|
+
return Ve(i, t.props || {}, r.props || {}, n), Je(i, t.children, r.children, n, o), typeof r != "string" && r.props?.ref && o && (o[r.props.ref] = i), i;
|
|
776
788
|
}
|
|
777
|
-
|
|
778
|
-
const s =
|
|
789
|
+
H(e, o);
|
|
790
|
+
const s = O(r, n, o);
|
|
779
791
|
return typeof r != "string" && r.props?.ref && o && (o[r.props.ref] = s), e.parentNode?.replaceChild(s, e), s;
|
|
780
792
|
}
|
|
781
|
-
function
|
|
793
|
+
function Ze(e, t, r, n) {
|
|
782
794
|
let o;
|
|
783
795
|
Array.isArray(t) ? t.length === 1 ? (o = t[0], o && typeof o == "object" && o.key == null && (o = { ...o, key: "__root__" })) : o = { tag: "div", key: "__root__", children: t } : (o = t, o && typeof o == "object" && o.key == null && (o = { ...o, key: "__root__" })), o && typeof o == "object" && o.tag === "#anchor" && (o = {
|
|
784
796
|
tag: "div",
|
|
785
797
|
key: "__anchor_root__",
|
|
786
798
|
props: { attrs: { "data-anchor-block-root": "", key: "__anchor_root__" } },
|
|
787
799
|
children: [o]
|
|
788
|
-
}), o =
|
|
800
|
+
}), o = me(o, String(o.key ?? "root"));
|
|
789
801
|
const s = e._prevVNode ?? null, i = e._prevDom ?? e.firstChild ?? null;
|
|
790
802
|
let a;
|
|
791
|
-
s && i ? typeof s != "string" && typeof o != "string" && s.tag === o.tag && s.key === o.key ? a =
|
|
803
|
+
s && i ? typeof s != "string" && typeof o != "string" && s.tag === o.tag && s.key === o.key ? a = te(i, s, o, r, n) : (a = O(o, r, n), e.replaceChild(a, i)) : (a = O(o, r, n), e.firstChild ? e.replaceChild(a, e.firstChild) : e.appendChild(a));
|
|
792
804
|
const c = [];
|
|
793
|
-
for (let
|
|
794
|
-
const
|
|
795
|
-
|
|
805
|
+
for (let u = 0; u < e.childNodes.length; u++) {
|
|
806
|
+
const l = e.childNodes[u];
|
|
807
|
+
l !== a && l.nodeName !== "STYLE" && (H(l, n), c.push(l));
|
|
796
808
|
}
|
|
797
|
-
c.forEach((
|
|
809
|
+
c.forEach((u) => e.removeChild(u)), e._prevVNode = o, e._prevDom = a;
|
|
798
810
|
}
|
|
799
|
-
function
|
|
811
|
+
function Le(e, ...t) {
|
|
800
812
|
let r = "";
|
|
801
813
|
for (let n = 0; n < e.length; n++)
|
|
802
814
|
r += e[n], n < t.length && (r += t[n]);
|
|
803
815
|
return r;
|
|
804
816
|
}
|
|
805
|
-
function
|
|
817
|
+
function ze(e) {
|
|
806
818
|
return e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;}/g, "}").trim();
|
|
807
819
|
}
|
|
808
|
-
let
|
|
809
|
-
function
|
|
810
|
-
return
|
|
820
|
+
let Y = null;
|
|
821
|
+
function $e() {
|
|
822
|
+
return Y || (Y = new CSSStyleSheet(), Y.replaceSync(ze(Xe))), Y;
|
|
811
823
|
}
|
|
812
|
-
function
|
|
824
|
+
function Qe(e) {
|
|
813
825
|
return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi, "").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, "").replace(/expression\s*\([^)]*\)/gi, "");
|
|
814
826
|
}
|
|
815
|
-
const
|
|
827
|
+
const Xe = Le`
|
|
816
828
|
:host, *, ::before, ::after {
|
|
817
829
|
all: isolate;
|
|
818
830
|
box-sizing: border-box;
|
|
@@ -870,7 +882,7 @@ const Qe = je`
|
|
|
870
882
|
sup { top: -.5em }
|
|
871
883
|
[disabled], [aria-disabled=true] { cursor: not-allowed }
|
|
872
884
|
[hidden] { display: none }
|
|
873
|
-
`,
|
|
885
|
+
`, Ye = {
|
|
874
886
|
gray: {
|
|
875
887
|
50: "var(--color-gray-50, #f9fafb)",
|
|
876
888
|
100: "var(--color-gray-100, #f3f4f6)",
|
|
@@ -1005,7 +1017,7 @@ const Qe = je`
|
|
|
1005
1017
|
},
|
|
1006
1018
|
white: { DEFAULT: "var(--color-white, #ffffff)" },
|
|
1007
1019
|
black: { DEFAULT: "var(--color-black, #000000)" }
|
|
1008
|
-
},
|
|
1020
|
+
}, le = {
|
|
1009
1021
|
/* Display */
|
|
1010
1022
|
block: "display:block;",
|
|
1011
1023
|
inline: "display:inline;",
|
|
@@ -1186,7 +1198,7 @@ const Qe = je`
|
|
|
1186
1198
|
"z-30": "z-index:30;",
|
|
1187
1199
|
"z-40": "z-index:40;",
|
|
1188
1200
|
"z-50": "z-index:50;"
|
|
1189
|
-
},
|
|
1201
|
+
}, Ge = "0.25rem", Se = {
|
|
1190
1202
|
m: ["margin"],
|
|
1191
1203
|
mx: ["margin-inline"],
|
|
1192
1204
|
my: ["margin-block"],
|
|
@@ -1231,7 +1243,7 @@ function R(e, t) {
|
|
|
1231
1243
|
}
|
|
1232
1244
|
return e + t;
|
|
1233
1245
|
}
|
|
1234
|
-
const
|
|
1246
|
+
const et = {
|
|
1235
1247
|
before: (e, t) => `${e}::before{${t}}`,
|
|
1236
1248
|
after: (e, t) => `${e}::after{${t}}`,
|
|
1237
1249
|
hover: (e, t) => `${R(e, ":hover")}{${t}}`,
|
|
@@ -1254,7 +1266,7 @@ const Ge = {
|
|
|
1254
1266
|
"peer-focus": (e, t) => `.peer:focus ~ ${e}{${t}}`,
|
|
1255
1267
|
"peer-checked": (e, t) => `.peer:checked ~ ${e}{${t}}`,
|
|
1256
1268
|
"peer-disabled": (e, t) => `.peer:disabled ~ ${e}{${t}}`
|
|
1257
|
-
},
|
|
1269
|
+
}, ce = {
|
|
1258
1270
|
// Responsive
|
|
1259
1271
|
sm: "(min-width:640px)",
|
|
1260
1272
|
md: "(min-width:768px)",
|
|
@@ -1263,23 +1275,23 @@ const Ge = {
|
|
|
1263
1275
|
"2xl": "(min-width:1536px)",
|
|
1264
1276
|
// Dark mode (now plain string)
|
|
1265
1277
|
dark: "(prefers-color-scheme: dark)"
|
|
1266
|
-
},
|
|
1267
|
-
function
|
|
1278
|
+
}, fe = ["sm", "md", "lg", "xl", "2xl"];
|
|
1279
|
+
function ue(e) {
|
|
1268
1280
|
const t = e.startsWith("-"), n = (t ? e.slice(1) : e).split("-");
|
|
1269
1281
|
if (n.length < 2) return null;
|
|
1270
1282
|
const o = n.slice(0, -1).join("-"), s = n[n.length - 1], i = parseFloat(s);
|
|
1271
|
-
if (Number.isNaN(i) ||
|
|
1283
|
+
if (Number.isNaN(i) || !Se[o]) return null;
|
|
1272
1284
|
const a = t ? "-" : "";
|
|
1273
|
-
return
|
|
1285
|
+
return Se[o].map((c) => `${c}:calc(${a}${Ge} * ${i});`).join("");
|
|
1274
1286
|
}
|
|
1275
|
-
function
|
|
1287
|
+
function _e(e) {
|
|
1276
1288
|
const t = e.replace("#", ""), r = parseInt(t, 16), n = r >> 16 & 255, o = r >> 8 & 255, s = r & 255;
|
|
1277
1289
|
return `${n} ${o} ${s}`;
|
|
1278
1290
|
}
|
|
1279
|
-
function
|
|
1291
|
+
function tt(e) {
|
|
1280
1292
|
const t = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
|
|
1281
1293
|
if (!t) return null;
|
|
1282
|
-
const [, r, n, o = "DEFAULT"] = t, s =
|
|
1294
|
+
const [, r, n, o = "DEFAULT"] = t, s = Ye[n]?.[o];
|
|
1283
1295
|
return s ? `${{
|
|
1284
1296
|
bg: "background-color",
|
|
1285
1297
|
decoration: "text-decoration-color",
|
|
@@ -1294,41 +1306,41 @@ function et(e) {
|
|
|
1294
1306
|
stroke: "stroke-color"
|
|
1295
1307
|
}[r]}:${s};` : null;
|
|
1296
1308
|
}
|
|
1297
|
-
function
|
|
1309
|
+
function rt(e) {
|
|
1298
1310
|
const [t, r] = e.split("/");
|
|
1299
1311
|
if (!r) return { base: t };
|
|
1300
1312
|
const n = parseInt(r, 10);
|
|
1301
1313
|
return isNaN(n) || n < 0 || n > 100 ? { base: t } : { base: t, opacity: n / 100 };
|
|
1302
1314
|
}
|
|
1303
|
-
function
|
|
1304
|
-
const { base: t, opacity: r } =
|
|
1315
|
+
function de(e) {
|
|
1316
|
+
const { base: t, opacity: r } = rt(e), n = tt(t);
|
|
1305
1317
|
if (n) {
|
|
1306
1318
|
if (r !== void 0) {
|
|
1307
1319
|
const s = /#([0-9a-f]{6})/i.exec(n);
|
|
1308
1320
|
if (s) {
|
|
1309
|
-
const i =
|
|
1321
|
+
const i = _e(s[0]);
|
|
1310
1322
|
return n.replace(/#([0-9a-f]{6})/i, `rgb(${i} / ${r})`);
|
|
1311
1323
|
}
|
|
1312
1324
|
}
|
|
1313
1325
|
return n;
|
|
1314
1326
|
}
|
|
1315
|
-
const o =
|
|
1327
|
+
const o = re(t);
|
|
1316
1328
|
if (o && r !== void 0) {
|
|
1317
1329
|
const s = /#([0-9a-f]{6})/i.exec(o);
|
|
1318
1330
|
if (s) {
|
|
1319
|
-
const i =
|
|
1331
|
+
const i = _e(s[0]);
|
|
1320
1332
|
return o.replace(/#([0-9a-f]{6})/i, `rgb(${i} / ${r})`);
|
|
1321
1333
|
}
|
|
1322
1334
|
}
|
|
1323
1335
|
return o;
|
|
1324
1336
|
}
|
|
1325
|
-
function
|
|
1337
|
+
function pe(e) {
|
|
1326
1338
|
const t = /^opacity-(\d{1,3})$/.exec(e);
|
|
1327
1339
|
if (!t) return null;
|
|
1328
1340
|
const r = parseInt(t[1], 10);
|
|
1329
1341
|
return r < 0 || r > 100 ? null : `opacity:${r / 100};`;
|
|
1330
1342
|
}
|
|
1331
|
-
function
|
|
1343
|
+
function re(e) {
|
|
1332
1344
|
if (e.startsWith("[") && e.endsWith("]") && !e.includes("-[")) {
|
|
1333
1345
|
const o = e.slice(1, -1).trim().match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*:(.*)$/);
|
|
1334
1346
|
if (o) {
|
|
@@ -1390,7 +1402,7 @@ function G(e) {
|
|
|
1390
1402
|
}
|
|
1391
1403
|
return null;
|
|
1392
1404
|
}
|
|
1393
|
-
function
|
|
1405
|
+
function nt(e) {
|
|
1394
1406
|
if (e.startsWith("[") && e.endsWith("]")) {
|
|
1395
1407
|
const r = e.slice(1, -1);
|
|
1396
1408
|
return r.includes("&") ? r : e;
|
|
@@ -1402,10 +1414,10 @@ function rt(e) {
|
|
|
1402
1414
|
}
|
|
1403
1415
|
return null;
|
|
1404
1416
|
}
|
|
1405
|
-
function
|
|
1417
|
+
function ot(e) {
|
|
1406
1418
|
return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
|
|
1407
1419
|
}
|
|
1408
|
-
function
|
|
1420
|
+
function it(e) {
|
|
1409
1421
|
const t = /class\s*=\s*(['"])(.*?)\1/g, r = [];
|
|
1410
1422
|
let n;
|
|
1411
1423
|
for (; n = t.exec(e); ) {
|
|
@@ -1414,32 +1426,32 @@ function ot(e) {
|
|
|
1414
1426
|
}
|
|
1415
1427
|
return r.filter(Boolean);
|
|
1416
1428
|
}
|
|
1417
|
-
const
|
|
1418
|
-
function
|
|
1419
|
-
const t = Date.now(), r =
|
|
1420
|
-
if (r && t - r.timestamp <
|
|
1421
|
-
const n =
|
|
1422
|
-
function p
|
|
1423
|
-
const g = (
|
|
1424
|
-
if (g in
|
|
1425
|
-
const
|
|
1426
|
-
return
|
|
1427
|
-
}
|
|
1428
|
-
function y(
|
|
1429
|
-
const
|
|
1430
|
-
return
|
|
1431
|
-
}
|
|
1432
|
-
function
|
|
1433
|
-
const
|
|
1434
|
-
let g = "",
|
|
1435
|
-
for (let
|
|
1436
|
-
const
|
|
1437
|
-
|
|
1429
|
+
const Ce = /* @__PURE__ */ new Map(), st = 16;
|
|
1430
|
+
function at(e) {
|
|
1431
|
+
const t = Date.now(), r = Ce.get(e);
|
|
1432
|
+
if (r && t - r.timestamp < st) return r.css;
|
|
1433
|
+
const n = it(e), o = new Set(n), s = [], i = [], a = [], c = [], u = {};
|
|
1434
|
+
function l(p, f = !1) {
|
|
1435
|
+
const g = (f ? "dark|" : "") + p;
|
|
1436
|
+
if (g in u) return u[g];
|
|
1437
|
+
const m = k(p, f);
|
|
1438
|
+
return u[g] = m, m;
|
|
1439
|
+
}
|
|
1440
|
+
function y(p) {
|
|
1441
|
+
const f = p.some((m) => fe.includes(m)), g = p.includes("dark");
|
|
1442
|
+
return p.length === 0 ? 1 : !f && !g ? 2 : f && !g ? 3 : 4;
|
|
1443
|
+
}
|
|
1444
|
+
function d(p) {
|
|
1445
|
+
const f = [];
|
|
1446
|
+
let g = "", m = 0, h = 0;
|
|
1447
|
+
for (let w = 0; w < p.length; w++) {
|
|
1448
|
+
const v = p[w];
|
|
1449
|
+
v === "[" ? m++ : v === "]" && m > 0 ? m-- : v === "(" ? h++ : v === ")" && h > 0 && h--, v === ":" && m === 0 && h === 0 ? (f.push(g), g = "") : g += v;
|
|
1438
1450
|
}
|
|
1439
|
-
return g &&
|
|
1451
|
+
return g && f.push(g), f;
|
|
1440
1452
|
}
|
|
1441
|
-
function
|
|
1442
|
-
switch (
|
|
1453
|
+
function b(p) {
|
|
1454
|
+
switch (p) {
|
|
1443
1455
|
case "hover":
|
|
1444
1456
|
return ":hover";
|
|
1445
1457
|
case "focus":
|
|
@@ -1468,99 +1480,99 @@ function st(e) {
|
|
|
1468
1480
|
return null;
|
|
1469
1481
|
}
|
|
1470
1482
|
}
|
|
1471
|
-
function
|
|
1472
|
-
const g =
|
|
1473
|
-
(
|
|
1474
|
-
let
|
|
1475
|
-
if (!
|
|
1476
|
-
const
|
|
1477
|
-
if (!
|
|
1478
|
-
const $ = g.indexOf(
|
|
1483
|
+
function k(p, f = !1) {
|
|
1484
|
+
const g = d(p);
|
|
1485
|
+
(p.includes("mask-image") || p.includes("sm: hover") || p.includes("sm:hover") || p.includes("mask.svg")) && console.error("DEBUG generateRule:", p, g);
|
|
1486
|
+
let m = !1, h = g.find((S) => (S.startsWith("!") && (m = !0, S = S.slice(1)), le[S] || ue(S) || pe(S) || de(S) || re(S)));
|
|
1487
|
+
if (!h) return null;
|
|
1488
|
+
const w = h.replace(/^!/, ""), v = le[w] ?? ue(w) ?? pe(w) ?? de(w) ?? re(w);
|
|
1489
|
+
if (!v) return null;
|
|
1490
|
+
const $ = g.indexOf(h);
|
|
1479
1491
|
let _ = $ >= 0 ? g.slice(0, $) : [];
|
|
1480
|
-
|
|
1481
|
-
const C = `.${
|
|
1482
|
-
let
|
|
1483
|
-
const
|
|
1492
|
+
f && (_ = _.filter((S) => S !== "dark"));
|
|
1493
|
+
const C = `.${ot(p)}`, E = "__SUBJECT__", j = m ? v.replace(/;$/, " !important;") : v;
|
|
1494
|
+
let T = E;
|
|
1495
|
+
const A = [];
|
|
1484
1496
|
for (const S of _)
|
|
1485
|
-
S.startsWith("group-") ? (
|
|
1486
|
-
_ = _.filter((S) => !
|
|
1487
|
-
const
|
|
1497
|
+
S.startsWith("group-") ? (T = `.group:${S.slice(6)} ${T}`, A.push(S)) : S.startsWith("peer-") && (T = T.replace(E, `.peer:${S.slice(5)}~${E}`), A.push(S));
|
|
1498
|
+
_ = _.filter((S) => !A.includes(S));
|
|
1499
|
+
const q = [], ie = [];
|
|
1488
1500
|
let W = null;
|
|
1489
1501
|
for (const S of _) {
|
|
1490
|
-
if (S === "dark" ||
|
|
1491
|
-
const
|
|
1492
|
-
if (
|
|
1493
|
-
W =
|
|
1502
|
+
if (S === "dark" || fe.includes(S)) continue;
|
|
1503
|
+
const N = nt(S);
|
|
1504
|
+
if (N) {
|
|
1505
|
+
W = N;
|
|
1494
1506
|
continue;
|
|
1495
1507
|
}
|
|
1496
|
-
const
|
|
1497
|
-
if (
|
|
1498
|
-
W ?
|
|
1508
|
+
const z = b(S);
|
|
1509
|
+
if (z) {
|
|
1510
|
+
W ? ie.push(z) : q.push(z);
|
|
1499
1511
|
continue;
|
|
1500
1512
|
}
|
|
1501
|
-
const B =
|
|
1502
|
-
typeof B == "function" && (
|
|
1513
|
+
const B = et[S];
|
|
1514
|
+
typeof B == "function" && (T = B(T, j).split("{")[0]);
|
|
1503
1515
|
}
|
|
1504
|
-
function
|
|
1505
|
-
if (!
|
|
1506
|
-
let
|
|
1516
|
+
function Pe(S, N) {
|
|
1517
|
+
if (!N) return S;
|
|
1518
|
+
let z = 0, B = 0;
|
|
1507
1519
|
if (S.length && (S[0] === ">" || S[0] === "+" || S[0] === "~" || S[0] === " ")) {
|
|
1508
|
-
let
|
|
1509
|
-
for (;
|
|
1510
|
-
for (;
|
|
1511
|
-
const
|
|
1512
|
-
if (
|
|
1513
|
-
return S.slice(0,
|
|
1520
|
+
let L = 1;
|
|
1521
|
+
for (; L < S.length && S[L] === " "; ) L++;
|
|
1522
|
+
for (; L < S.length; L++) {
|
|
1523
|
+
const P = S[L];
|
|
1524
|
+
if (P === "[" ? z++ : P === "]" && z > 0 ? z-- : P === "(" ? B++ : P === ")" && B > 0 && B--, z === 0 && B === 0 && (S[L] === ">" || S[L] === "+" || S[L] === "~" || S[L] === " "))
|
|
1525
|
+
return S.slice(0, L) + N + S.slice(L);
|
|
1514
1526
|
}
|
|
1515
|
-
return S +
|
|
1527
|
+
return S + N;
|
|
1516
1528
|
}
|
|
1517
|
-
for (let
|
|
1518
|
-
const
|
|
1519
|
-
if (
|
|
1520
|
-
return S.slice(0,
|
|
1529
|
+
for (let L = 0; L < S.length; L++) {
|
|
1530
|
+
const P = S[L];
|
|
1531
|
+
if (P === "[" ? z++ : P === "]" && z > 0 ? z-- : P === "(" ? B++ : P === ")" && B > 0 && B--, z === 0 && B === 0 && (P === ">" || P === "+" || P === "~" || P === " "))
|
|
1532
|
+
return S.slice(0, L) + N + S.slice(L);
|
|
1521
1533
|
}
|
|
1522
|
-
return S +
|
|
1534
|
+
return S + N;
|
|
1523
1535
|
}
|
|
1524
|
-
const
|
|
1536
|
+
const se = q.join(""), J = ie.join("");
|
|
1525
1537
|
if (W)
|
|
1526
1538
|
if (W.includes("&")) {
|
|
1527
|
-
const S = W.indexOf("&"),
|
|
1528
|
-
if (
|
|
1529
|
-
|
|
1539
|
+
const S = W.indexOf("&"), N = W.slice(0, S), z = W.slice(S + 1), B = E + se, L = T;
|
|
1540
|
+
if (q.length === 0)
|
|
1541
|
+
T = L.replace(E, N + B + J + z);
|
|
1530
1542
|
else {
|
|
1531
|
-
const
|
|
1532
|
-
|
|
1543
|
+
const P = Pe(z, J);
|
|
1544
|
+
T = L.replace(E, N + B + P);
|
|
1533
1545
|
}
|
|
1534
1546
|
} else
|
|
1535
|
-
|
|
1547
|
+
T = T.replace(E, `${W}${E + se}`), J && (T = T.replace(E, `${E}${J}`));
|
|
1536
1548
|
else
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
let
|
|
1540
|
-
const
|
|
1541
|
-
return
|
|
1542
|
-
}
|
|
1543
|
-
for (const
|
|
1544
|
-
const
|
|
1545
|
-
(
|
|
1549
|
+
T = E + se + J;
|
|
1550
|
+
T = T.replace(new RegExp(E, "g"), C);
|
|
1551
|
+
let M = `${T}{${j}}`;
|
|
1552
|
+
const ae = _.filter((S) => fe.includes(S)), U = ae.length ? ae[ae.length - 1] : null, we = _.includes("dark");
|
|
1553
|
+
return f && U ? M = `@media (prefers-color-scheme: dark) and ${ce[U]}{${M}}` : f ? M = `@media (prefers-color-scheme: dark){${M}}` : we && U ? M = `@media (prefers-color-scheme: dark) and ${ce[U]}{${M}}` : we ? M = `@media (prefers-color-scheme: dark){${M}}` : U && (M = `@media ${ce[U]}{${M}}`), M;
|
|
1554
|
+
}
|
|
1555
|
+
for (const p of o) {
|
|
1556
|
+
const f = d(p), g = f.find(
|
|
1557
|
+
(v) => le[v] || ue(v) || pe(v) || de(v) || re(v)
|
|
1546
1558
|
);
|
|
1547
1559
|
if (!g) continue;
|
|
1548
|
-
const
|
|
1549
|
-
if (
|
|
1550
|
-
const
|
|
1551
|
-
|
|
1560
|
+
const m = f.indexOf(g), h = m >= 0 ? f.slice(0, m) : [], w = y(h);
|
|
1561
|
+
if (w === 4) {
|
|
1562
|
+
const v = l(p, !0);
|
|
1563
|
+
v && c.push(v);
|
|
1552
1564
|
} else {
|
|
1553
|
-
const
|
|
1554
|
-
|
|
1565
|
+
const v = l(p);
|
|
1566
|
+
v && (w === 1 ? s.push(v) : w === 2 ? i.push(v) : w === 3 && a.push(v));
|
|
1555
1567
|
}
|
|
1556
1568
|
}
|
|
1557
|
-
const
|
|
1558
|
-
return
|
|
1569
|
+
const x = [...s, ...i, ...a, ...c].join("");
|
|
1570
|
+
return Ce.set(e, { css: x, timestamp: t }), x;
|
|
1559
1571
|
}
|
|
1560
|
-
const
|
|
1561
|
-
function
|
|
1572
|
+
const Q = [];
|
|
1573
|
+
function lt(e, t, r, n, o, s, i, a) {
|
|
1562
1574
|
if (e) {
|
|
1563
|
-
|
|
1575
|
+
Q.push(r);
|
|
1564
1576
|
try {
|
|
1565
1577
|
if (t.loadingTemplate && r.isLoading) {
|
|
1566
1578
|
F(e, t.loadingTemplate(r), r, n, o);
|
|
@@ -1572,28 +1584,28 @@ function at(e, t, r, n, o, s, i, a) {
|
|
|
1572
1584
|
}
|
|
1573
1585
|
const c = t.render(r);
|
|
1574
1586
|
if (c instanceof Promise) {
|
|
1575
|
-
s(!0), c.then((
|
|
1576
|
-
s(!1), i(null), F(e,
|
|
1577
|
-
}).catch((
|
|
1578
|
-
s(!1), i(
|
|
1587
|
+
s(!0), c.then((u) => {
|
|
1588
|
+
s(!1), i(null), F(e, u, r, n, o), a(e.innerHTML);
|
|
1589
|
+
}).catch((u) => {
|
|
1590
|
+
s(!1), i(u), t.errorTemplate && F(e, t.errorTemplate(u, r), r, n, o);
|
|
1579
1591
|
}), t.loadingTemplate && F(e, t.loadingTemplate(r), r, n, o);
|
|
1580
1592
|
return;
|
|
1581
1593
|
}
|
|
1582
1594
|
F(e, c, r, n, o), a(e.innerHTML);
|
|
1583
1595
|
} finally {
|
|
1584
|
-
|
|
1596
|
+
Q.pop();
|
|
1585
1597
|
}
|
|
1586
1598
|
}
|
|
1587
1599
|
}
|
|
1588
1600
|
function F(e, t, r, n, o) {
|
|
1589
|
-
e && (
|
|
1601
|
+
e && (Ze(
|
|
1590
1602
|
e,
|
|
1591
1603
|
Array.isArray(t) ? t : [t],
|
|
1592
1604
|
r,
|
|
1593
1605
|
n
|
|
1594
1606
|
), o(e.innerHTML));
|
|
1595
1607
|
}
|
|
1596
|
-
function
|
|
1608
|
+
function ct(e, t, r, n, o, s, i) {
|
|
1597
1609
|
if (s !== null && clearTimeout(s), Date.now() - t < 16) {
|
|
1598
1610
|
if (o(r + 1), r > 10) {
|
|
1599
1611
|
console.warn("Potential infinite render loop detected. Skipping render."), i(null);
|
|
@@ -1606,32 +1618,32 @@ function lt(e, t, r, n, o, s, i) {
|
|
|
1606
1618
|
}, 0);
|
|
1607
1619
|
i(c);
|
|
1608
1620
|
}
|
|
1609
|
-
function
|
|
1621
|
+
function ft(e, t, r, n, o, s) {
|
|
1610
1622
|
if (!e) return;
|
|
1611
|
-
const i =
|
|
1623
|
+
const i = at(n);
|
|
1612
1624
|
if (!t.style && (!i || i.trim() === "")) {
|
|
1613
|
-
s(null), e.adoptedStyleSheets = [
|
|
1625
|
+
s(null), e.adoptedStyleSheets = [$e()];
|
|
1614
1626
|
return;
|
|
1615
1627
|
}
|
|
1616
1628
|
let a = "";
|
|
1617
1629
|
t.style && (typeof t.style == "string" ? a = t.style : typeof t.style == "function" && (a = t.style(r)));
|
|
1618
|
-
let c =
|
|
1630
|
+
let c = Qe(`${a}
|
|
1619
1631
|
${i}
|
|
1620
1632
|
`);
|
|
1621
|
-
c =
|
|
1622
|
-
let
|
|
1623
|
-
|
|
1633
|
+
c = ze(c);
|
|
1634
|
+
let u = o;
|
|
1635
|
+
u || (u = new CSSStyleSheet()), (u.cssRules.length === 0 || u.toString() !== c) && u.replaceSync(c), e.adoptedStyleSheets = [$e(), u], s(u);
|
|
1624
1636
|
}
|
|
1625
|
-
const
|
|
1626
|
-
function
|
|
1627
|
-
let n =
|
|
1637
|
+
const be = /* @__PURE__ */ new Map();
|
|
1638
|
+
function Ee(e, t, r) {
|
|
1639
|
+
let n = ve(e);
|
|
1628
1640
|
n.includes("-") || (n = `cer-${n}`);
|
|
1629
1641
|
let o;
|
|
1630
1642
|
if (typeof t == "function" ? o = { ...r, render: t } : o = t, typeof o.onError != "function" && (o.onError = (s, i) => {
|
|
1631
1643
|
console.error(`[${n}] Error:`, s, i);
|
|
1632
|
-
}),
|
|
1644
|
+
}), be.set(n, o), typeof window < "u")
|
|
1633
1645
|
if (!customElements.get(n))
|
|
1634
|
-
customElements.define(n,
|
|
1646
|
+
customElements.define(n, ut(n, o));
|
|
1635
1647
|
else
|
|
1636
1648
|
try {
|
|
1637
1649
|
document.querySelectorAll(n).forEach((s) => {
|
|
@@ -1643,7 +1655,7 @@ function Ce(e, t, r) {
|
|
|
1643
1655
|
} catch {
|
|
1644
1656
|
}
|
|
1645
1657
|
}
|
|
1646
|
-
function
|
|
1658
|
+
function ut(e, t) {
|
|
1647
1659
|
if (!t.render)
|
|
1648
1660
|
throw new Error(
|
|
1649
1661
|
"Component must have a render function"
|
|
@@ -1687,7 +1699,7 @@ function ft(e, t) {
|
|
|
1687
1699
|
_templateLoading = !1;
|
|
1688
1700
|
_templateError = null;
|
|
1689
1701
|
constructor() {
|
|
1690
|
-
super(), this.attachShadow({ mode: "open" }), this._cfg =
|
|
1702
|
+
super(), this.attachShadow({ mode: "open" }), this._cfg = be.get(e) || t;
|
|
1691
1703
|
const r = this._initContext(t);
|
|
1692
1704
|
Object.defineProperty(r, "refs", {
|
|
1693
1705
|
value: this._refs,
|
|
@@ -1713,7 +1725,7 @@ function ft(e, t) {
|
|
|
1713
1725
|
enumerable: !1,
|
|
1714
1726
|
configurable: !1
|
|
1715
1727
|
});
|
|
1716
|
-
const n =
|
|
1728
|
+
const n = be.get(e) || t;
|
|
1717
1729
|
Object.keys(n).forEach((o) => {
|
|
1718
1730
|
const s = n[o];
|
|
1719
1731
|
typeof s == "function" && (this.context[o] = (...i) => s(...i, this.context));
|
|
@@ -1721,7 +1733,7 @@ function ft(e, t) {
|
|
|
1721
1733
|
}
|
|
1722
1734
|
connectedCallback() {
|
|
1723
1735
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1724
|
-
|
|
1736
|
+
We(
|
|
1725
1737
|
t,
|
|
1726
1738
|
this.context,
|
|
1727
1739
|
this._mounted,
|
|
@@ -1733,7 +1745,7 @@ function ft(e, t) {
|
|
|
1733
1745
|
}
|
|
1734
1746
|
disconnectedCallback() {
|
|
1735
1747
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1736
|
-
|
|
1748
|
+
De(
|
|
1737
1749
|
t,
|
|
1738
1750
|
this.context,
|
|
1739
1751
|
this._listeners,
|
|
@@ -1757,7 +1769,7 @@ function ft(e, t) {
|
|
|
1757
1769
|
}
|
|
1758
1770
|
attributeChangedCallback(r, n, o) {
|
|
1759
1771
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1760
|
-
this._applyProps(t),
|
|
1772
|
+
this._applyProps(t), qe(
|
|
1761
1773
|
t,
|
|
1762
1774
|
r,
|
|
1763
1775
|
n,
|
|
@@ -1767,7 +1779,7 @@ function ft(e, t) {
|
|
|
1767
1779
|
});
|
|
1768
1780
|
}
|
|
1769
1781
|
static get observedAttributes() {
|
|
1770
|
-
return t.props ? Object.keys(t.props).map(
|
|
1782
|
+
return t.props ? Object.keys(t.props).map(ve) : [];
|
|
1771
1783
|
}
|
|
1772
1784
|
_applyComputed(r) {
|
|
1773
1785
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
@@ -1775,7 +1787,7 @@ function ft(e, t) {
|
|
|
1775
1787
|
Object.defineProperty(this.context, n, {
|
|
1776
1788
|
get: () => {
|
|
1777
1789
|
const s = o(this.context);
|
|
1778
|
-
return
|
|
1790
|
+
return ge(s);
|
|
1779
1791
|
},
|
|
1780
1792
|
enumerable: !0
|
|
1781
1793
|
});
|
|
@@ -1785,7 +1797,7 @@ function ft(e, t) {
|
|
|
1785
1797
|
// --- Render ---
|
|
1786
1798
|
_render(r) {
|
|
1787
1799
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1788
|
-
|
|
1800
|
+
lt(
|
|
1789
1801
|
this.shadowRoot,
|
|
1790
1802
|
r,
|
|
1791
1803
|
this.context,
|
|
@@ -1808,7 +1820,7 @@ function ft(e, t) {
|
|
|
1808
1820
|
}
|
|
1809
1821
|
_requestRender() {
|
|
1810
1822
|
this._runLogicWithinErrorBoundary(this._cfg, () => {
|
|
1811
|
-
|
|
1823
|
+
ct(
|
|
1812
1824
|
() => this._render(this._cfg),
|
|
1813
1825
|
this._lastRenderTime,
|
|
1814
1826
|
this._renderCount,
|
|
@@ -1828,7 +1840,7 @@ function ft(e, t) {
|
|
|
1828
1840
|
// --- Style ---
|
|
1829
1841
|
_applyStyle(r, n) {
|
|
1830
1842
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1831
|
-
|
|
1843
|
+
ft(
|
|
1832
1844
|
this.shadowRoot,
|
|
1833
1845
|
r,
|
|
1834
1846
|
this.context,
|
|
@@ -1857,9 +1869,9 @@ function ft(e, t) {
|
|
|
1857
1869
|
try {
|
|
1858
1870
|
let n = function(s, i = "") {
|
|
1859
1871
|
return Array.isArray(s) ? new Proxy(s, {
|
|
1860
|
-
get(a, c,
|
|
1861
|
-
const
|
|
1862
|
-
return typeof
|
|
1872
|
+
get(a, c, u) {
|
|
1873
|
+
const l = Reflect.get(a, c, u);
|
|
1874
|
+
return typeof l == "function" && typeof c == "string" && [
|
|
1863
1875
|
"push",
|
|
1864
1876
|
"pop",
|
|
1865
1877
|
"shift",
|
|
@@ -1867,26 +1879,26 @@ function ft(e, t) {
|
|
|
1867
1879
|
"splice",
|
|
1868
1880
|
"sort",
|
|
1869
1881
|
"reverse"
|
|
1870
|
-
].includes(c) ? function(...
|
|
1871
|
-
const
|
|
1882
|
+
].includes(c) ? function(...d) {
|
|
1883
|
+
const b = l.apply(a, d);
|
|
1872
1884
|
if (!o._initializing) {
|
|
1873
|
-
const
|
|
1874
|
-
o._triggerWatchers(
|
|
1885
|
+
const k = i || "root";
|
|
1886
|
+
o._triggerWatchers(k, a), o._render(r);
|
|
1875
1887
|
}
|
|
1876
|
-
return
|
|
1877
|
-
} :
|
|
1888
|
+
return b;
|
|
1889
|
+
} : l;
|
|
1878
1890
|
},
|
|
1879
|
-
set(a, c,
|
|
1880
|
-
if (a[c] =
|
|
1881
|
-
const
|
|
1882
|
-
o._triggerWatchers(
|
|
1891
|
+
set(a, c, u) {
|
|
1892
|
+
if (a[c] = u, !o._initializing) {
|
|
1893
|
+
const l = i ? `${i}.${String(c)}` : String(c);
|
|
1894
|
+
o._triggerWatchers(l, u), o._render(r);
|
|
1883
1895
|
}
|
|
1884
1896
|
return !0;
|
|
1885
1897
|
},
|
|
1886
1898
|
deleteProperty(a, c) {
|
|
1887
1899
|
if (delete a[c], !o._initializing) {
|
|
1888
|
-
const
|
|
1889
|
-
o._triggerWatchers(
|
|
1900
|
+
const u = i ? `${i}.${String(c)}` : String(c);
|
|
1901
|
+
o._triggerWatchers(u, void 0), o._render(r);
|
|
1890
1902
|
}
|
|
1891
1903
|
return !0;
|
|
1892
1904
|
}
|
|
@@ -1894,15 +1906,15 @@ function ft(e, t) {
|
|
|
1894
1906
|
const c = i ? `${i}.${a}` : a;
|
|
1895
1907
|
s[a] = n(s[a], c);
|
|
1896
1908
|
}), new Proxy(s, {
|
|
1897
|
-
set(a, c,
|
|
1898
|
-
const
|
|
1899
|
-
return a[c] = n(
|
|
1900
|
-
|
|
1909
|
+
set(a, c, u) {
|
|
1910
|
+
const l = i ? `${i}.${String(c)}` : String(c);
|
|
1911
|
+
return a[c] = n(u, l), o._initializing || (o._triggerWatchers(
|
|
1912
|
+
l,
|
|
1901
1913
|
a[c]
|
|
1902
1914
|
), o._render(r)), !0;
|
|
1903
1915
|
},
|
|
1904
|
-
get(a, c,
|
|
1905
|
-
return Reflect.get(a, c,
|
|
1916
|
+
get(a, c, u) {
|
|
1917
|
+
return Reflect.get(a, c, u);
|
|
1906
1918
|
}
|
|
1907
1919
|
})) : s;
|
|
1908
1920
|
};
|
|
@@ -1914,7 +1926,7 @@ function ft(e, t) {
|
|
|
1914
1926
|
}
|
|
1915
1927
|
_initWatchers(r) {
|
|
1916
1928
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1917
|
-
|
|
1929
|
+
Oe(
|
|
1918
1930
|
this.context,
|
|
1919
1931
|
this._watchers,
|
|
1920
1932
|
r.watch || {}
|
|
@@ -1922,12 +1934,12 @@ function ft(e, t) {
|
|
|
1922
1934
|
});
|
|
1923
1935
|
}
|
|
1924
1936
|
_triggerWatchers(r, n) {
|
|
1925
|
-
|
|
1937
|
+
Me(this.context, this._watchers, r, n);
|
|
1926
1938
|
}
|
|
1927
1939
|
_applyProps(r) {
|
|
1928
1940
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1929
1941
|
try {
|
|
1930
|
-
|
|
1942
|
+
Ne(this, r, this.context);
|
|
1931
1943
|
} catch (n) {
|
|
1932
1944
|
this._hasError = !0, r.onError && r.onError(n, this.context), r.errorFallback && this.shadowRoot && (this.shadowRoot.innerHTML = r.errorFallback(n, this.context));
|
|
1933
1945
|
}
|
|
@@ -1935,100 +1947,145 @@ function ft(e, t) {
|
|
|
1935
1947
|
}
|
|
1936
1948
|
};
|
|
1937
1949
|
}
|
|
1938
|
-
function
|
|
1950
|
+
function Z(e, t = {}, r, n) {
|
|
1939
1951
|
const o = n ?? t.key;
|
|
1940
1952
|
return { tag: e, key: o, props: t, children: r };
|
|
1941
1953
|
}
|
|
1942
|
-
function
|
|
1954
|
+
function ne(e) {
|
|
1943
1955
|
return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
|
|
1944
1956
|
}
|
|
1945
|
-
function
|
|
1946
|
-
return typeof e == "object" && e !== null && "tag" in e && !
|
|
1957
|
+
function G(e) {
|
|
1958
|
+
return typeof e == "object" && e !== null && "tag" in e && !ne(e);
|
|
1947
1959
|
}
|
|
1948
|
-
function
|
|
1960
|
+
function dt(e, t) {
|
|
1949
1961
|
return e.key != null ? e : { ...e, key: t };
|
|
1950
1962
|
}
|
|
1951
|
-
function
|
|
1952
|
-
const n = {}, o = {}, s = {}
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
+
function pt(e, t = [], r = {}) {
|
|
1964
|
+
const n = {}, o = {}, s = {};
|
|
1965
|
+
function i(u, l, y) {
|
|
1966
|
+
const d = typeof u == "function" ? u : typeof y[u] == "function" ? y[u] : void 0;
|
|
1967
|
+
if (typeof d != "function") return;
|
|
1968
|
+
const b = l.includes("prevent"), k = l.includes("stop"), x = l.includes("stopImmediate") || l.includes("stopImmediatePropagation"), p = l.includes("self"), f = l.includes("left"), g = l.includes("middle"), m = l.includes("right"), h = l.includes("ctrl") || l.includes("control"), w = l.includes("alt") || l.includes("option"), v = l.includes("shift"), $ = l.includes("meta") || l.includes("cmd") || l.includes("command"), _ = {
|
|
1969
|
+
enter: "Enter",
|
|
1970
|
+
tab: "Tab",
|
|
1971
|
+
space: " ",
|
|
1972
|
+
spacebar: " ",
|
|
1973
|
+
esc: "Escape",
|
|
1974
|
+
escape: "Escape",
|
|
1975
|
+
del: "Delete",
|
|
1976
|
+
delete: "Delete",
|
|
1977
|
+
backspace: "Backspace",
|
|
1978
|
+
up: "ArrowUp",
|
|
1979
|
+
down: "ArrowDown",
|
|
1980
|
+
left: "ArrowLeft",
|
|
1981
|
+
right: "ArrowRight",
|
|
1982
|
+
home: "Home",
|
|
1983
|
+
end: "End",
|
|
1984
|
+
pageup: "PageUp",
|
|
1985
|
+
pagedown: "PageDown",
|
|
1986
|
+
insert: "Insert",
|
|
1987
|
+
pause: "Pause"
|
|
1988
|
+
};
|
|
1989
|
+
let C = l.filter((A) => _[A]);
|
|
1990
|
+
(f || g || m) && (C = C.filter((A) => A !== "left" && A !== "middle" && A !== "right"));
|
|
1991
|
+
const E = function(A) {
|
|
1992
|
+
if (!((f || g || m) && A instanceof MouseEvent && (f && A.button !== 0 || g && A.button !== 1 || m && A.button !== 2)) && !(h && !A.ctrlKey) && !(w && !A.altKey) && !(v && !A.shiftKey) && !($ && !A.metaKey)) {
|
|
1993
|
+
if (C.length > 0) {
|
|
1994
|
+
const q = A.key;
|
|
1995
|
+
if (!q || !C.some((W) => _[W] === q)) return;
|
|
1996
|
+
}
|
|
1997
|
+
if (!(p && A.target !== A.currentTarget)) {
|
|
1998
|
+
b && A.preventDefault(), k && A.stopPropagation(), x && A.stopImmediatePropagation();
|
|
1999
|
+
try {
|
|
2000
|
+
return typeof u == "function" ? u.call(void 0, A) : d.call(y, A);
|
|
2001
|
+
} catch (q) {
|
|
2002
|
+
throw q;
|
|
2003
|
+
}
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
}, j = {};
|
|
2007
|
+
return l.includes("once") && (j.once = !0), l.includes("capture") && (j.capture = !0), l.includes("passive") && (j.passive = !0), Object.keys(j).length > 0 ? { handler: E, options: j } : E;
|
|
2008
|
+
}
|
|
2009
|
+
const a = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
|
|
2010
|
+
let c;
|
|
2011
|
+
for (; c = a.exec(e); ) {
|
|
2012
|
+
const u = c[1], l = c[2], y = (c[4] || c[6]) ?? "", d = y.match(/^{{(\d+)}}$/);
|
|
2013
|
+
let b = d ? t[Number(d[1])] ?? null : y;
|
|
2014
|
+
d || (b === "true" ? b = !0 : b === "false" ? b = !1 : b === "null" ? b = null : isNaN(Number(b)) || (b = Number(b)));
|
|
2015
|
+
const k = ["model", "bind", "show", "class", "style"];
|
|
2016
|
+
if (u === ":") {
|
|
2017
|
+
const [x, ...p] = l.split(".");
|
|
2018
|
+
if (k.includes(x)) {
|
|
2019
|
+
const f = [...p];
|
|
1963
2020
|
s[x] = {
|
|
1964
|
-
value:
|
|
1965
|
-
modifiers:
|
|
2021
|
+
value: b,
|
|
2022
|
+
modifiers: f
|
|
1966
2023
|
};
|
|
1967
2024
|
} else
|
|
1968
|
-
o[
|
|
1969
|
-
} else if (
|
|
1970
|
-
const x = "on" +
|
|
1971
|
-
|
|
1972
|
-
} else
|
|
2025
|
+
o[l] = b;
|
|
2026
|
+
} else if (u === "@") {
|
|
2027
|
+
const x = l.split("."), p = x[0], f = x.slice(1), g = "on" + p.charAt(0).toUpperCase() + p.slice(1), m = i(b, f, r);
|
|
2028
|
+
m !== void 0 && (n[g] = m);
|
|
2029
|
+
} else l === "ref" ? n.ref = b : o[l] = b;
|
|
1973
2030
|
}
|
|
1974
2031
|
return { props: n, attrs: o, directives: s };
|
|
1975
2032
|
}
|
|
1976
|
-
function
|
|
1977
|
-
const n =
|
|
1978
|
-
function s(
|
|
1979
|
-
return
|
|
2033
|
+
function ht(e, t, r) {
|
|
2034
|
+
const n = Q.length > 0 ? Q[Q.length - 1] : void 0, o = r ?? n;
|
|
2035
|
+
function s(h, w) {
|
|
2036
|
+
return Z("#text", {}, h, w);
|
|
1980
2037
|
}
|
|
1981
2038
|
let i = "";
|
|
1982
|
-
for (let
|
|
1983
|
-
i += e[
|
|
2039
|
+
for (let h = 0; h < e.length; h++)
|
|
2040
|
+
i += e[h], h < t.length && (i += `{{${h}}}`);
|
|
1984
2041
|
const a = /<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, c = [];
|
|
1985
|
-
let
|
|
1986
|
-
function h
|
|
1987
|
-
!
|
|
1988
|
-
if (
|
|
1989
|
-
const
|
|
2042
|
+
let u, l = [], y = null, d = {}, b, k = 0, x = [];
|
|
2043
|
+
function p(h) {
|
|
2044
|
+
!h || typeof h != "object" || ne(h) || (h.props || h.attrs ? (h.props && (d.props || (d.props = {}), Object.assign(d.props, h.props)), h.attrs && (d.attrs || (d.attrs = {}), Object.keys(h.attrs).forEach((w) => {
|
|
2045
|
+
if (w === "style" && d.attrs.style) {
|
|
2046
|
+
const v = d.attrs.style.replace(
|
|
1990
2047
|
/;?\s*$/,
|
|
1991
2048
|
""
|
|
1992
|
-
), $ =
|
|
1993
|
-
|
|
1994
|
-
} else if (
|
|
1995
|
-
const
|
|
1996
|
-
.../* @__PURE__ */ new Set([...
|
|
2049
|
+
), $ = h.attrs.style.replace(/^;?\s*/, "");
|
|
2050
|
+
d.attrs.style = v + "; " + $;
|
|
2051
|
+
} else if (w === "class" && d.attrs.class) {
|
|
2052
|
+
const v = d.attrs.class.trim().split(/\s+/).filter(Boolean), $ = h.attrs.class.trim().split(/\s+/).filter(Boolean), _ = [
|
|
2053
|
+
.../* @__PURE__ */ new Set([...v, ...$])
|
|
1997
2054
|
];
|
|
1998
|
-
|
|
2055
|
+
d.attrs.class = _.join(" ");
|
|
1999
2056
|
} else
|
|
2000
|
-
|
|
2001
|
-
}))) : (
|
|
2002
|
-
}
|
|
2003
|
-
function
|
|
2004
|
-
const
|
|
2005
|
-
if (
|
|
2006
|
-
const $ =
|
|
2007
|
-
let _ =
|
|
2008
|
-
|
|
2009
|
-
...
|
|
2057
|
+
d.attrs[w] = h.attrs[w];
|
|
2058
|
+
}))) : (d.props || (d.props = {}), Object.assign(d.props, h)));
|
|
2059
|
+
}
|
|
2060
|
+
function f(h, w) {
|
|
2061
|
+
const v = y ? l : x;
|
|
2062
|
+
if (ne(h)) {
|
|
2063
|
+
const $ = h.key ?? w;
|
|
2064
|
+
let _ = h.children;
|
|
2065
|
+
v.push({
|
|
2066
|
+
...h,
|
|
2010
2067
|
key: $,
|
|
2011
2068
|
children: _
|
|
2012
2069
|
});
|
|
2013
2070
|
return;
|
|
2014
2071
|
}
|
|
2015
|
-
if (
|
|
2016
|
-
|
|
2072
|
+
if (G(h)) {
|
|
2073
|
+
v.push(dt(h, void 0));
|
|
2017
2074
|
return;
|
|
2018
2075
|
}
|
|
2019
|
-
if (Array.isArray(
|
|
2020
|
-
if (
|
|
2021
|
-
for (let $ = 0; $ <
|
|
2022
|
-
const _ =
|
|
2023
|
-
|
|
2076
|
+
if (Array.isArray(h)) {
|
|
2077
|
+
if (h.length === 0) return;
|
|
2078
|
+
for (let $ = 0; $ < h.length; $++) {
|
|
2079
|
+
const _ = h[$];
|
|
2080
|
+
ne(_) || G(_) || Array.isArray(_) ? f(_, `${w}-${$}`) : _ !== null && typeof _ == "object" ? p(_) : v.push(s(String(_), `${w}-${$}`));
|
|
2024
2081
|
}
|
|
2025
2082
|
return;
|
|
2026
2083
|
}
|
|
2027
|
-
if (
|
|
2028
|
-
h
|
|
2084
|
+
if (h !== null && typeof h == "object") {
|
|
2085
|
+
p(h);
|
|
2029
2086
|
return;
|
|
2030
2087
|
}
|
|
2031
|
-
|
|
2088
|
+
v.push(s(String(h), w));
|
|
2032
2089
|
}
|
|
2033
2090
|
const g = /* @__PURE__ */ new Set([
|
|
2034
2091
|
"area",
|
|
@@ -2046,221 +2103,221 @@ function pt(e, t, r) {
|
|
|
2046
2103
|
"track",
|
|
2047
2104
|
"wbr"
|
|
2048
2105
|
]);
|
|
2049
|
-
for (;
|
|
2050
|
-
if (
|
|
2051
|
-
const
|
|
2106
|
+
for (; u = a.exec(i); )
|
|
2107
|
+
if (u[1]) {
|
|
2108
|
+
const h = u[1], w = u[0][1] === "/", v = u[0][u[0].length - 2] === "/" || g.has(h), {
|
|
2052
2109
|
props: $,
|
|
2053
2110
|
attrs: _,
|
|
2054
2111
|
directives: C
|
|
2055
|
-
} =
|
|
2112
|
+
} = pt(u[2] || "", t, o), E = { props: {}, attrs: {} };
|
|
2056
2113
|
for (const j in $) E.props[j] = $[j];
|
|
2057
2114
|
for (const j in _) E.attrs[j] = _[j];
|
|
2058
|
-
if (Object.keys(C).length > 0 && (E.directives = { ...C }),
|
|
2059
|
-
const j =
|
|
2115
|
+
if (Object.keys(C).length > 0 && (E.directives = { ...C }), w) {
|
|
2116
|
+
const j = Z(
|
|
2060
2117
|
y,
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
),
|
|
2065
|
-
|
|
2066
|
-
} else
|
|
2118
|
+
d,
|
|
2119
|
+
l.length === 1 && G(l[0]) && l[0].tag === "#text" ? typeof l[0].children == "string" ? l[0].children : "" : l.length ? l : void 0,
|
|
2120
|
+
b
|
|
2121
|
+
), T = c.pop();
|
|
2122
|
+
T ? (y = T.tag, d = T.props, b = T.key, l = T.children, l.push(j)) : (x.push(j), y = null, d = {}, b = void 0, l = []);
|
|
2123
|
+
} else v ? y ? l.push(Z(h, E, void 0, void 0)) : x.push(Z(h, E, void 0, void 0)) : (y && c.push({
|
|
2067
2124
|
tag: y,
|
|
2068
|
-
props:
|
|
2069
|
-
children:
|
|
2070
|
-
key:
|
|
2071
|
-
}), y =
|
|
2072
|
-
} else if (typeof
|
|
2073
|
-
const
|
|
2074
|
-
|
|
2075
|
-
} else if (
|
|
2076
|
-
const
|
|
2077
|
-
for (const $ of
|
|
2125
|
+
props: d,
|
|
2126
|
+
children: l,
|
|
2127
|
+
key: b
|
|
2128
|
+
}), y = h, d = E, l = []);
|
|
2129
|
+
} else if (typeof u[3] < "u") {
|
|
2130
|
+
const h = Number(u[3]), w = t[h], v = `interp-${h}`;
|
|
2131
|
+
f(w, v);
|
|
2132
|
+
} else if (u[4]) {
|
|
2133
|
+
const h = u[4], w = y ? l : x, v = h.split(/({{\d+}})/);
|
|
2134
|
+
for (const $ of v) {
|
|
2078
2135
|
if (!$) continue;
|
|
2079
2136
|
const _ = $.match(/^{{(\d+)}}$/);
|
|
2080
2137
|
if (_) {
|
|
2081
2138
|
const C = Number(_[1]), E = t[C], j = `interp-${C}`;
|
|
2082
|
-
|
|
2139
|
+
f(E, j);
|
|
2083
2140
|
} else {
|
|
2084
|
-
const C = `text-${
|
|
2085
|
-
|
|
2141
|
+
const C = `text-${k++}`;
|
|
2142
|
+
w.push(s($, C));
|
|
2086
2143
|
}
|
|
2087
2144
|
}
|
|
2088
2145
|
}
|
|
2089
|
-
const
|
|
2090
|
-
return
|
|
2146
|
+
const m = x.filter((h) => G(h) && h.tag === "#text" ? typeof h.children == "string" && h.children.trim() !== "" : !0);
|
|
2147
|
+
return m.length === 1 ? m[0] : m.length > 1 ? m : Z("div", {}, "", "fallback-root");
|
|
2091
2148
|
}
|
|
2092
|
-
function
|
|
2149
|
+
function I(e, ...t) {
|
|
2093
2150
|
const r = t[t.length - 1], n = typeof r == "object" && r && !Array.isArray(r) ? r : void 0;
|
|
2094
|
-
return
|
|
2151
|
+
return ht(e, t, n);
|
|
2095
2152
|
}
|
|
2096
|
-
const
|
|
2153
|
+
const Ae = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, D = (e, t) => {
|
|
2097
2154
|
for (const r of e) {
|
|
2098
2155
|
const n = [], o = r.path.replace(/:[^/]+/g, (a) => (n.push(a.slice(1)), "([^/]+)")), s = new RegExp(`^${o}$`), i = t.match(s);
|
|
2099
2156
|
if (i) {
|
|
2100
2157
|
const a = {};
|
|
2101
|
-
return n.forEach((c,
|
|
2102
|
-
a[c] = i[
|
|
2158
|
+
return n.forEach((c, u) => {
|
|
2159
|
+
a[c] = i[u + 1];
|
|
2103
2160
|
}), { route: r, params: a };
|
|
2104
2161
|
}
|
|
2105
2162
|
}
|
|
2106
2163
|
return { route: null, params: {} };
|
|
2107
|
-
},
|
|
2108
|
-
async function
|
|
2164
|
+
}, he = {};
|
|
2165
|
+
async function gt(e) {
|
|
2109
2166
|
if (e.component) return e.component;
|
|
2110
2167
|
if (e.load) {
|
|
2111
|
-
if (
|
|
2168
|
+
if (he[e.path]) return he[e.path];
|
|
2112
2169
|
try {
|
|
2113
2170
|
const t = await e.load();
|
|
2114
|
-
return
|
|
2171
|
+
return he[e.path] = t.default, t.default;
|
|
2115
2172
|
} catch {
|
|
2116
2173
|
throw new Error(`Failed to load component for route: ${e.path}`);
|
|
2117
2174
|
}
|
|
2118
2175
|
}
|
|
2119
2176
|
throw new Error(`No component or loader defined for route: ${e.path}`);
|
|
2120
2177
|
}
|
|
2121
|
-
function
|
|
2178
|
+
function yt(e) {
|
|
2122
2179
|
const { routes: t, base: r = "", initialUrl: n } = e;
|
|
2123
|
-
let o, s, i, a, c,
|
|
2124
|
-
const y = async (
|
|
2125
|
-
const
|
|
2126
|
-
if (
|
|
2180
|
+
let o, s, i, a, c, u, l;
|
|
2181
|
+
const y = async (x, p) => {
|
|
2182
|
+
const f = t.find((g) => D([g], x.path).route !== null);
|
|
2183
|
+
if (f?.beforeEnter)
|
|
2127
2184
|
try {
|
|
2128
|
-
const g = await
|
|
2129
|
-
return typeof g == "string" ? (await
|
|
2185
|
+
const g = await f.beforeEnter(x, p);
|
|
2186
|
+
return typeof g == "string" ? (await k(g, !0), !1) : g !== !1;
|
|
2130
2187
|
} catch (g) {
|
|
2131
2188
|
return console.error("beforeEnter error", g), !1;
|
|
2132
2189
|
}
|
|
2133
2190
|
return !0;
|
|
2134
|
-
},
|
|
2135
|
-
const
|
|
2136
|
-
if (
|
|
2191
|
+
}, d = async (x, p) => {
|
|
2192
|
+
const f = t.find((g) => D([g], x.path).route !== null);
|
|
2193
|
+
if (f?.onEnter)
|
|
2137
2194
|
try {
|
|
2138
|
-
const g = await
|
|
2139
|
-
return typeof g == "string" ? (await
|
|
2195
|
+
const g = await f.onEnter(x, p);
|
|
2196
|
+
return typeof g == "string" ? (await k(g, !0), !1) : g !== !1;
|
|
2140
2197
|
} catch (g) {
|
|
2141
2198
|
return console.error("onEnter error", g), !1;
|
|
2142
2199
|
}
|
|
2143
2200
|
return !0;
|
|
2144
|
-
},
|
|
2145
|
-
const
|
|
2146
|
-
if (
|
|
2201
|
+
}, b = (x, p) => {
|
|
2202
|
+
const f = t.find((g) => D([g], x.path).route !== null);
|
|
2203
|
+
if (f?.afterEnter)
|
|
2147
2204
|
try {
|
|
2148
|
-
|
|
2205
|
+
f.afterEnter(x, p);
|
|
2149
2206
|
} catch (g) {
|
|
2150
2207
|
console.error("afterEnter error", g);
|
|
2151
2208
|
}
|
|
2152
|
-
},
|
|
2209
|
+
}, k = async (x, p = !1) => {
|
|
2153
2210
|
try {
|
|
2154
|
-
const
|
|
2155
|
-
path:
|
|
2211
|
+
const f = {
|
|
2212
|
+
path: x.replace(r, "") || "/",
|
|
2156
2213
|
query: {}
|
|
2157
|
-
}, g =
|
|
2158
|
-
if (!g) throw new Error(`No route found for ${
|
|
2159
|
-
const
|
|
2160
|
-
path:
|
|
2214
|
+
}, g = D(t, f.path);
|
|
2215
|
+
if (!g) throw new Error(`No route found for ${f.path}`);
|
|
2216
|
+
const m = i.getState(), h = {
|
|
2217
|
+
path: f.path,
|
|
2161
2218
|
params: g.params,
|
|
2162
|
-
query:
|
|
2219
|
+
query: f.query
|
|
2163
2220
|
};
|
|
2164
|
-
if (!await y(
|
|
2165
|
-
typeof window < "u" && typeof document < "u" && (
|
|
2166
|
-
} catch (
|
|
2167
|
-
console.error("Navigation error:",
|
|
2221
|
+
if (!await y(h, m) || !await d(h, m)) return;
|
|
2222
|
+
typeof window < "u" && typeof document < "u" && (p ? window.history.replaceState({}, "", r + x) : window.history.pushState({}, "", r + x)), i.setState(h), b(h, m);
|
|
2223
|
+
} catch (f) {
|
|
2224
|
+
console.error("Navigation error:", f);
|
|
2168
2225
|
}
|
|
2169
2226
|
};
|
|
2170
2227
|
if (typeof window < "u" && typeof document < "u") {
|
|
2171
2228
|
o = () => {
|
|
2172
|
-
const
|
|
2173
|
-
return { path:
|
|
2229
|
+
const p = new URL(window.location.href), f = p.pathname.replace(r, "") || "/", g = Ae(p.search);
|
|
2230
|
+
return { path: f, query: g };
|
|
2174
2231
|
}, s = o();
|
|
2175
|
-
const
|
|
2232
|
+
const x = D(t, s.path);
|
|
2176
2233
|
i = xe({
|
|
2177
2234
|
path: s.path,
|
|
2178
|
-
params:
|
|
2235
|
+
params: x.params,
|
|
2179
2236
|
query: s.query
|
|
2180
|
-
}), a = async (
|
|
2181
|
-
const
|
|
2182
|
-
await
|
|
2183
|
-
}, window.addEventListener("popstate", () => a(!0)), c = (
|
|
2237
|
+
}), a = async (p = !1) => {
|
|
2238
|
+
const f = o();
|
|
2239
|
+
await k(f.path, p);
|
|
2240
|
+
}, window.addEventListener("popstate", () => a(!0)), c = (p) => k(p, !1), u = (p) => k(p, !0), l = () => window.history.back();
|
|
2184
2241
|
} else {
|
|
2185
2242
|
o = () => {
|
|
2186
|
-
const
|
|
2187
|
-
return { path: g, query:
|
|
2243
|
+
const f = new URL(n || "/", "http://localhost"), g = f.pathname.replace(r, "") || "/", m = Ae(f.search);
|
|
2244
|
+
return { path: g, query: m };
|
|
2188
2245
|
}, s = o();
|
|
2189
|
-
const
|
|
2246
|
+
const x = D(t, s.path);
|
|
2190
2247
|
i = xe({
|
|
2191
2248
|
path: s.path,
|
|
2192
|
-
params:
|
|
2249
|
+
params: x.params,
|
|
2193
2250
|
query: s.query
|
|
2194
2251
|
}), a = async () => {
|
|
2195
|
-
const
|
|
2196
|
-
await
|
|
2252
|
+
const f = o();
|
|
2253
|
+
await p(f.path);
|
|
2197
2254
|
};
|
|
2198
|
-
const
|
|
2255
|
+
const p = async (f) => {
|
|
2199
2256
|
try {
|
|
2200
2257
|
const g = {
|
|
2201
|
-
path:
|
|
2258
|
+
path: f.replace(r, "") || "/",
|
|
2202
2259
|
query: {}
|
|
2203
|
-
},
|
|
2204
|
-
if (!
|
|
2205
|
-
const
|
|
2260
|
+
}, m = D(t, g.path);
|
|
2261
|
+
if (!m) throw new Error(`No route found for ${g.path}`);
|
|
2262
|
+
const h = i.getState(), w = {
|
|
2206
2263
|
path: g.path,
|
|
2207
|
-
params:
|
|
2264
|
+
params: m.params,
|
|
2208
2265
|
query: g.query
|
|
2209
|
-
},
|
|
2210
|
-
if (
|
|
2266
|
+
}, v = t.find(($) => D([$], w.path).route !== null);
|
|
2267
|
+
if (v?.beforeEnter)
|
|
2211
2268
|
try {
|
|
2212
|
-
const $ = await
|
|
2269
|
+
const $ = await v.beforeEnter(w, h);
|
|
2213
2270
|
if (typeof $ == "string") {
|
|
2214
|
-
await
|
|
2271
|
+
await p($);
|
|
2215
2272
|
return;
|
|
2216
2273
|
}
|
|
2217
2274
|
if ($ === !1) return;
|
|
2218
2275
|
} catch {
|
|
2219
2276
|
return;
|
|
2220
2277
|
}
|
|
2221
|
-
if (
|
|
2278
|
+
if (v?.onEnter)
|
|
2222
2279
|
try {
|
|
2223
|
-
const $ = await
|
|
2280
|
+
const $ = await v.onEnter(w, h);
|
|
2224
2281
|
if (typeof $ == "string") {
|
|
2225
|
-
await
|
|
2282
|
+
await p($);
|
|
2226
2283
|
return;
|
|
2227
2284
|
}
|
|
2228
2285
|
if ($ === !1) return;
|
|
2229
2286
|
} catch {
|
|
2230
2287
|
return;
|
|
2231
2288
|
}
|
|
2232
|
-
if (i.setState(
|
|
2289
|
+
if (i.setState(w), v?.afterEnter)
|
|
2233
2290
|
try {
|
|
2234
|
-
|
|
2291
|
+
v.afterEnter(w, h);
|
|
2235
2292
|
} catch {
|
|
2236
2293
|
}
|
|
2237
2294
|
} catch {
|
|
2238
2295
|
}
|
|
2239
2296
|
};
|
|
2240
|
-
c = async (
|
|
2297
|
+
c = async (f) => p(f), u = async (f) => p(f), l = () => {
|
|
2241
2298
|
};
|
|
2242
2299
|
}
|
|
2243
2300
|
return {
|
|
2244
2301
|
store: i,
|
|
2245
2302
|
push: c,
|
|
2246
|
-
replace:
|
|
2247
|
-
back:
|
|
2303
|
+
replace: u,
|
|
2304
|
+
back: l,
|
|
2248
2305
|
subscribe: i.subscribe,
|
|
2249
|
-
matchRoute: (
|
|
2306
|
+
matchRoute: (x) => D(t, x),
|
|
2250
2307
|
getCurrent: () => i.getState(),
|
|
2251
|
-
resolveRouteComponent:
|
|
2308
|
+
resolveRouteComponent: gt
|
|
2252
2309
|
};
|
|
2253
2310
|
}
|
|
2254
|
-
function
|
|
2255
|
-
return
|
|
2311
|
+
function St(e, t) {
|
|
2312
|
+
return D(e, t);
|
|
2256
2313
|
}
|
|
2257
|
-
function
|
|
2258
|
-
const t =
|
|
2259
|
-
return
|
|
2314
|
+
function _t(e) {
|
|
2315
|
+
const t = yt(e);
|
|
2316
|
+
return Ee("router-view", {
|
|
2260
2317
|
async render() {
|
|
2261
|
-
if (!t) return
|
|
2318
|
+
if (!t) return I`<div>Router not initialized.</div>`;
|
|
2262
2319
|
const r = t.getCurrent(), { path: n } = r, o = t.matchRoute(n);
|
|
2263
|
-
if (!o.route) return
|
|
2320
|
+
if (!o.route) return I`<div>Not found</div>`;
|
|
2264
2321
|
try {
|
|
2265
2322
|
const s = await t.resolveRouteComponent(o.route);
|
|
2266
2323
|
if (typeof s == "string")
|
|
@@ -2269,9 +2326,9 @@ function St(e) {
|
|
|
2269
2326
|
const i = s(), a = i instanceof Promise ? await i : i;
|
|
2270
2327
|
return typeof a == "string" ? { tag: a, props: {}, children: [] } : a;
|
|
2271
2328
|
}
|
|
2272
|
-
return
|
|
2329
|
+
return I`<div>Invalid route component</div>`;
|
|
2273
2330
|
} catch {
|
|
2274
|
-
return
|
|
2331
|
+
return I`<div>Invalid route component</div>`;
|
|
2275
2332
|
}
|
|
2276
2333
|
},
|
|
2277
2334
|
onConnected(r) {
|
|
@@ -2279,7 +2336,7 @@ function St(e) {
|
|
|
2279
2336
|
typeof r.requestRender == "function" && r.requestRender();
|
|
2280
2337
|
});
|
|
2281
2338
|
}
|
|
2282
|
-
}),
|
|
2339
|
+
}), Ee("router-link", {
|
|
2283
2340
|
state: {},
|
|
2284
2341
|
props: {
|
|
2285
2342
|
to: { type: String, default: "" },
|
|
@@ -2292,7 +2349,7 @@ function St(e) {
|
|
|
2292
2349
|
disabled: { type: Boolean, default: !1 },
|
|
2293
2350
|
external: { type: Boolean, default: !1 },
|
|
2294
2351
|
class: { type: String, default: "" },
|
|
2295
|
-
style: { type: String, default:
|
|
2352
|
+
style: { type: String, default: Le`
|
|
2296
2353
|
[aria-disabled="true"] {
|
|
2297
2354
|
pointer-events: none;
|
|
2298
2355
|
opacity: 0.5;
|
|
@@ -2301,32 +2358,32 @@ function St(e) {
|
|
|
2301
2358
|
},
|
|
2302
2359
|
style: (r) => r.style,
|
|
2303
2360
|
render: (r) => {
|
|
2304
|
-
const n = t.getCurrent(), o = r.to, s = r.exact, i = r.exactActiveClass, a = r.activeClass, c = r.ariaCurrentValue,
|
|
2305
|
-
for (const
|
|
2306
|
-
const
|
|
2307
|
-
...
|
|
2361
|
+
const n = t.getCurrent(), o = r.to, s = r.exact, i = r.exactActiveClass, a = r.activeClass, c = r.ariaCurrentValue, u = r.tag, l = r.disabled, y = r.external, d = n.path === o, b = s ? d : n && typeof n.path == "string" ? n.path.startsWith(o) : !1, k = d ? `aria-current="${c}"` : "", x = (r.class || "").split(/\s+/).filter(Boolean), p = {};
|
|
2362
|
+
for (const w of x) p[w] = !0;
|
|
2363
|
+
const f = {
|
|
2364
|
+
...p,
|
|
2308
2365
|
// Also include the configurable names (may duplicate the above)
|
|
2309
|
-
[a]:
|
|
2310
|
-
[i]:
|
|
2311
|
-
}, g =
|
|
2312
|
-
return
|
|
2313
|
-
${Be().when(g,
|
|
2366
|
+
[a]: b,
|
|
2367
|
+
[i]: d
|
|
2368
|
+
}, g = u === "button", m = l ? g ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", h = y && (u === "a" || !u) ? 'target="_blank" rel="noopener noreferrer"' : "";
|
|
2369
|
+
return I`
|
|
2370
|
+
${Be().when(g, I`
|
|
2314
2371
|
<button
|
|
2315
2372
|
part="button"
|
|
2316
|
-
:class="${
|
|
2317
|
-
${
|
|
2318
|
-
${
|
|
2319
|
-
${
|
|
2373
|
+
:class="${f}"
|
|
2374
|
+
${k}
|
|
2375
|
+
${m}
|
|
2376
|
+
${h}
|
|
2320
2377
|
@click="navigate"
|
|
2321
2378
|
><slot></slot></button>
|
|
2322
|
-
`).otherwise(
|
|
2379
|
+
`).otherwise(I`
|
|
2323
2380
|
<a
|
|
2324
2381
|
part="link"
|
|
2325
2382
|
href="${o}"
|
|
2326
|
-
:class="${
|
|
2327
|
-
${
|
|
2328
|
-
${
|
|
2329
|
-
${
|
|
2383
|
+
:class="${f}"
|
|
2384
|
+
${k}
|
|
2385
|
+
${m}
|
|
2386
|
+
${h}
|
|
2330
2387
|
@click="navigate"
|
|
2331
2388
|
><slot></slot></a>
|
|
2332
2389
|
`).done()}
|
|
@@ -2342,25 +2399,25 @@ function St(e) {
|
|
|
2342
2399
|
}), t;
|
|
2343
2400
|
}
|
|
2344
2401
|
export {
|
|
2345
|
-
|
|
2346
|
-
|
|
2402
|
+
V as GlobalEventBus,
|
|
2403
|
+
Ee as component,
|
|
2347
2404
|
xe as createStore,
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2405
|
+
Le as css,
|
|
2406
|
+
bt as each,
|
|
2407
|
+
vt as emit,
|
|
2408
|
+
X as eventBus,
|
|
2409
|
+
I as html,
|
|
2410
|
+
_t as initRouter,
|
|
2411
|
+
$t as listen,
|
|
2355
2412
|
Be as match,
|
|
2356
|
-
|
|
2357
|
-
|
|
2413
|
+
D as matchRoute,
|
|
2414
|
+
St as matchRouteSSR,
|
|
2358
2415
|
xt as off,
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2416
|
+
wt as on,
|
|
2417
|
+
kt as once,
|
|
2418
|
+
Ae as parseQuery,
|
|
2419
|
+
gt as resolveRouteComponent,
|
|
2420
|
+
yt as useRouter,
|
|
2421
|
+
mt as when
|
|
2365
2422
|
};
|
|
2366
2423
|
//# sourceMappingURL=custom-elements-runtime.es.js.map
|