@jasonshimmy/custom-elements-runtime 1.0.6 → 1.0.8
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 +1254 -1127
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +18 -18
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,8 +6,8 @@ class dt {
|
|
|
6
6
|
* Uses component identity to deduplicate multiple render requests for the same component
|
|
7
7
|
*/
|
|
8
8
|
schedule(t, r) {
|
|
9
|
-
const
|
|
10
|
-
this.pendingUpdates.set(
|
|
9
|
+
const n = r || t.toString();
|
|
10
|
+
this.pendingUpdates.set(n, t), this.isFlushScheduled || (this.isFlushScheduled = !0, typeof globalThis.process < "u" && globalThis.process.env?.NODE_ENV === "test" || typeof window < "u" && (window.__vitest__ || window.Cypress) ? this.flush() : queueMicrotask(() => this.flush()));
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Execute all pending updates
|
|
@@ -18,8 +18,8 @@ class dt {
|
|
|
18
18
|
for (const r of t)
|
|
19
19
|
try {
|
|
20
20
|
r();
|
|
21
|
-
} catch (
|
|
22
|
-
typeof console < "u" && console.error && console.error("Error in batched update:",
|
|
21
|
+
} catch (n) {
|
|
22
|
+
typeof console < "u" && console.error && console.error("Error in batched update:", n);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
@@ -30,7 +30,7 @@ class dt {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
const ht = new dt();
|
|
33
|
-
function
|
|
33
|
+
function ue(e, t) {
|
|
34
34
|
ht.schedule(e, t);
|
|
35
35
|
}
|
|
36
36
|
const Fe = /* @__PURE__ */ new WeakSet();
|
|
@@ -41,11 +41,11 @@ class pt {
|
|
|
41
41
|
/**
|
|
42
42
|
* Get or create a reactive proxy for an object
|
|
43
43
|
*/
|
|
44
|
-
static getOrCreateProxy(t, r,
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
47
|
-
return
|
|
48
|
-
const s =
|
|
44
|
+
static getOrCreateProxy(t, r, n = !1) {
|
|
45
|
+
const i = this.cache.get(t);
|
|
46
|
+
if (i)
|
|
47
|
+
return i;
|
|
48
|
+
const s = n ? this.getOrCreateArrayHandler(r) : this.getOrCreateObjectHandler(r), o = new Proxy(t, s);
|
|
49
49
|
try {
|
|
50
50
|
nt.markAsProxy(o);
|
|
51
51
|
} catch {
|
|
@@ -58,9 +58,9 @@ class pt {
|
|
|
58
58
|
static getOrCreateArrayHandler(t) {
|
|
59
59
|
if (!this.arrayHandlerCache.has(t)) {
|
|
60
60
|
const r = {
|
|
61
|
-
get: (
|
|
62
|
-
const o = Reflect.get(
|
|
63
|
-
return typeof o == "function" && typeof
|
|
61
|
+
get: (n, i, s) => {
|
|
62
|
+
const o = Reflect.get(n, i, s);
|
|
63
|
+
return typeof o == "function" && typeof i == "string" && [
|
|
64
64
|
"push",
|
|
65
65
|
"pop",
|
|
66
66
|
"shift",
|
|
@@ -70,13 +70,13 @@ class pt {
|
|
|
70
70
|
"reverse",
|
|
71
71
|
"fill",
|
|
72
72
|
"copyWithin"
|
|
73
|
-
].includes(
|
|
74
|
-
const m = o.apply(
|
|
73
|
+
].includes(i) ? function(...u) {
|
|
74
|
+
const m = o.apply(n, u);
|
|
75
75
|
return t.triggerUpdate(), m;
|
|
76
76
|
} : o;
|
|
77
77
|
},
|
|
78
|
-
set: (
|
|
79
|
-
deleteProperty: (
|
|
78
|
+
set: (n, i, s) => (n[i] = t.makeReactiveValue(s), t.triggerUpdate(), !0),
|
|
79
|
+
deleteProperty: (n, i) => (delete n[i], t.triggerUpdate(), !0)
|
|
80
80
|
};
|
|
81
81
|
this.arrayHandlerCache.set(t, r);
|
|
82
82
|
}
|
|
@@ -88,9 +88,9 @@ class pt {
|
|
|
88
88
|
static getOrCreateObjectHandler(t) {
|
|
89
89
|
if (!this.objectHandlerCache.has(t)) {
|
|
90
90
|
const r = {
|
|
91
|
-
get: (
|
|
92
|
-
set: (
|
|
93
|
-
deleteProperty: (
|
|
91
|
+
get: (n, i, s) => Reflect.get(n, i, s),
|
|
92
|
+
set: (n, i, s) => (n[i] = t.makeReactiveValue(s), t.triggerUpdate(), !0),
|
|
93
|
+
deleteProperty: (n, i) => (delete n[i], t.triggerUpdate(), !0)
|
|
94
94
|
};
|
|
95
95
|
this.objectHandlerCache.set(t, r);
|
|
96
96
|
}
|
|
@@ -127,19 +127,19 @@ class nt {
|
|
|
127
127
|
/**
|
|
128
128
|
* Create an optimized reactive proxy with minimal overhead
|
|
129
129
|
*/
|
|
130
|
-
static createReactiveProxy(t, r,
|
|
130
|
+
static createReactiveProxy(t, r, n) {
|
|
131
131
|
try {
|
|
132
132
|
if (Fe.has(t)) return t;
|
|
133
133
|
} catch {
|
|
134
134
|
}
|
|
135
|
-
const
|
|
135
|
+
const i = Array.isArray(t);
|
|
136
136
|
let s = this.contextCache.get(r);
|
|
137
137
|
s || (s = /* @__PURE__ */ new WeakMap(), this.contextCache.set(r, s));
|
|
138
|
-
let o = s.get(
|
|
138
|
+
let o = s.get(n);
|
|
139
139
|
return o || (o = {
|
|
140
140
|
triggerUpdate: r,
|
|
141
|
-
makeReactiveValue:
|
|
142
|
-
}, s.set(
|
|
141
|
+
makeReactiveValue: n
|
|
142
|
+
}, s.set(n, o)), pt.getOrCreateProxy(t, o, i);
|
|
143
143
|
}
|
|
144
144
|
/**
|
|
145
145
|
* Mark an object as a proxy (for optimization)
|
|
@@ -198,8 +198,8 @@ class gt {
|
|
|
198
198
|
*/
|
|
199
199
|
shouldEmitRenderWarning() {
|
|
200
200
|
if (!this.currentComponent) return !0;
|
|
201
|
-
const t = this.currentComponent, r = this.lastWarningTime.get(t) || 0,
|
|
202
|
-
return
|
|
201
|
+
const t = this.currentComponent, r = this.lastWarningTime.get(t) || 0, n = Date.now();
|
|
202
|
+
return n - r < 1e3 ? !1 : (this.lastWarningTime.set(t, n), !0);
|
|
203
203
|
}
|
|
204
204
|
/**
|
|
205
205
|
* Execute a function with tracking disabled
|
|
@@ -219,11 +219,11 @@ class gt {
|
|
|
219
219
|
getOrCreateState(t) {
|
|
220
220
|
if (!this.currentComponent)
|
|
221
221
|
return new He(t);
|
|
222
|
-
const r = this.currentComponent,
|
|
223
|
-
if (this.stateIndexCounter.set(r,
|
|
224
|
-
return this.stateStorage.get(
|
|
222
|
+
const r = this.currentComponent, n = this.stateIndexCounter.get(r) || 0, i = `${r}:${n}`;
|
|
223
|
+
if (this.stateIndexCounter.set(r, n + 1), this.stateStorage.has(i))
|
|
224
|
+
return this.stateStorage.get(i);
|
|
225
225
|
const s = new He(t);
|
|
226
|
-
return this.stateStorage.set(
|
|
226
|
+
return this.stateStorage.set(i, s), s;
|
|
227
227
|
}
|
|
228
228
|
/**
|
|
229
229
|
* Track a dependency for the current component
|
|
@@ -236,8 +236,8 @@ class gt {
|
|
|
236
236
|
*/
|
|
237
237
|
triggerUpdate(t) {
|
|
238
238
|
t.getDependents().forEach((r) => {
|
|
239
|
-
const
|
|
240
|
-
|
|
239
|
+
const n = this.componentRenderFunctions.get(r);
|
|
240
|
+
n && ue(n, r);
|
|
241
241
|
});
|
|
242
242
|
}
|
|
243
243
|
/**
|
|
@@ -245,9 +245,9 @@ class gt {
|
|
|
245
245
|
*/
|
|
246
246
|
cleanup(t) {
|
|
247
247
|
const r = this.componentDependencies.get(t);
|
|
248
|
-
r && (r.forEach((
|
|
249
|
-
for (const
|
|
250
|
-
|
|
248
|
+
r && (r.forEach((n) => n.removeDependent(t)), this.componentDependencies.delete(t)), this.componentRenderFunctions.delete(t);
|
|
249
|
+
for (const n of Array.from(this.stateStorage.keys()))
|
|
250
|
+
n.startsWith(t + ":") && this.stateStorage.delete(n);
|
|
251
251
|
this.stateIndexCounter.delete(t);
|
|
252
252
|
}
|
|
253
253
|
}
|
|
@@ -316,31 +316,31 @@ function hr(e) {
|
|
|
316
316
|
};
|
|
317
317
|
}
|
|
318
318
|
function pr(e, t, r = {}) {
|
|
319
|
-
let
|
|
320
|
-
r.immediate && t(
|
|
321
|
-
const
|
|
322
|
-
F.setCurrentComponent(
|
|
319
|
+
let n = e();
|
|
320
|
+
r.immediate && t(n, n);
|
|
321
|
+
const i = `watch-${Math.random().toString(36).substr(2, 9)}`, s = () => {
|
|
322
|
+
F.setCurrentComponent(i, s);
|
|
323
323
|
const o = e();
|
|
324
|
-
F.clearCurrentComponent(), o !==
|
|
324
|
+
F.clearCurrentComponent(), o !== n && (t(o, n), n = o);
|
|
325
325
|
};
|
|
326
|
-
return F.setCurrentComponent(
|
|
327
|
-
F.cleanup(
|
|
326
|
+
return F.setCurrentComponent(i, s), e(), F.clearCurrentComponent(), () => {
|
|
327
|
+
F.cleanup(i);
|
|
328
328
|
};
|
|
329
329
|
}
|
|
330
|
-
const
|
|
330
|
+
const ve = /* @__PURE__ */ new Map(), xe = /* @__PURE__ */ new Map(), $e = /* @__PURE__ */ new Map(), Ue = 500;
|
|
331
331
|
function re(e) {
|
|
332
|
-
if (xe.has(e))
|
|
333
|
-
return xe.get(e);
|
|
334
|
-
const t = e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
335
|
-
return xe.size < Ue && xe.set(e, t), t;
|
|
336
|
-
}
|
|
337
|
-
function it(e) {
|
|
338
332
|
if (ve.has(e))
|
|
339
333
|
return ve.get(e);
|
|
340
|
-
const t = e.replace(
|
|
334
|
+
const t = e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
341
335
|
return ve.size < Ue && ve.set(e, t), t;
|
|
342
336
|
}
|
|
343
|
-
function
|
|
337
|
+
function it(e) {
|
|
338
|
+
if (xe.has(e))
|
|
339
|
+
return xe.get(e);
|
|
340
|
+
const t = e.replace(/-([a-z])/g, (r, n) => n.toUpperCase());
|
|
341
|
+
return xe.size < Ue && xe.set(e, t), t;
|
|
342
|
+
}
|
|
343
|
+
function de(e) {
|
|
344
344
|
if (typeof e == "string") {
|
|
345
345
|
if ($e.has(e))
|
|
346
346
|
return $e.get(e);
|
|
@@ -360,19 +360,19 @@ function ie(e) {
|
|
|
360
360
|
}
|
|
361
361
|
function H(e, t) {
|
|
362
362
|
if (typeof t == "string") {
|
|
363
|
-
const r = t.split(".").reduce((
|
|
363
|
+
const r = t.split(".").reduce((n, i) => n?.[i], e);
|
|
364
364
|
return ee(r) ? r.value : r;
|
|
365
365
|
}
|
|
366
366
|
return t;
|
|
367
367
|
}
|
|
368
368
|
function _e(e, t, r) {
|
|
369
|
-
const
|
|
370
|
-
if (!
|
|
371
|
-
const s =
|
|
372
|
-
ee(s[
|
|
369
|
+
const n = String(t).split("."), i = n.pop();
|
|
370
|
+
if (!i) return;
|
|
371
|
+
const s = n.reduce((o, c) => (o[c] == null && (o[c] = {}), o[c]), e);
|
|
372
|
+
ee(s[i]) ? s[i].value = r : s[i] = r;
|
|
373
373
|
}
|
|
374
374
|
const st = typeof process < "u" && process.env?.NODE_ENV !== "production";
|
|
375
|
-
function
|
|
375
|
+
function ie(e, ...t) {
|
|
376
376
|
st && console.error(e, ...t);
|
|
377
377
|
}
|
|
378
378
|
function Oe(e, ...t) {
|
|
@@ -380,74 +380,74 @@ function Oe(e, ...t) {
|
|
|
380
380
|
}
|
|
381
381
|
function mt(e, t, r) {
|
|
382
382
|
if (r)
|
|
383
|
-
for (const [
|
|
383
|
+
for (const [n, i] of Object.entries(r)) {
|
|
384
384
|
let s, o = {};
|
|
385
|
-
if (Array.isArray(
|
|
385
|
+
if (Array.isArray(i) ? (s = i[0], o = i[1] || {}) : s = i, t.set(n, {
|
|
386
386
|
callback: s,
|
|
387
387
|
options: o,
|
|
388
|
-
oldValue: H(e,
|
|
388
|
+
oldValue: H(e, n)
|
|
389
389
|
}), o.immediate)
|
|
390
390
|
try {
|
|
391
|
-
const
|
|
392
|
-
s(
|
|
393
|
-
} catch (
|
|
394
|
-
|
|
391
|
+
const c = H(e, n);
|
|
392
|
+
s(c, void 0, e);
|
|
393
|
+
} catch (c) {
|
|
394
|
+
ie(`Error in immediate watcher for "${n}":`, c);
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
|
-
function yt(e, t, r,
|
|
399
|
-
const
|
|
400
|
-
if (o ===
|
|
401
|
-
if (typeof o != typeof
|
|
402
|
-
if (Array.isArray(o) && Array.isArray(
|
|
403
|
-
return o.length !==
|
|
404
|
-
const u = Object.keys(o), m = Object.keys(
|
|
405
|
-
return u.length !== m.length ? !1 : u.every((g) =>
|
|
398
|
+
function yt(e, t, r, n) {
|
|
399
|
+
const i = (o, c) => {
|
|
400
|
+
if (o === c) return !0;
|
|
401
|
+
if (typeof o != typeof c || typeof o != "object" || o === null || c === null) return !1;
|
|
402
|
+
if (Array.isArray(o) && Array.isArray(c))
|
|
403
|
+
return o.length !== c.length ? !1 : o.every((g, b) => i(g, c[b]));
|
|
404
|
+
const u = Object.keys(o), m = Object.keys(c);
|
|
405
|
+
return u.length !== m.length ? !1 : u.every((g) => i(o[g], c[g]));
|
|
406
406
|
}, s = t.get(r);
|
|
407
|
-
if (s && !n
|
|
407
|
+
if (s && !i(n, s.oldValue))
|
|
408
408
|
try {
|
|
409
|
-
s.callback(
|
|
409
|
+
s.callback(n, s.oldValue, e), s.oldValue = n;
|
|
410
410
|
} catch (o) {
|
|
411
|
-
|
|
411
|
+
ie(`Error in watcher for "${r}":`, o);
|
|
412
412
|
}
|
|
413
|
-
for (const [o,
|
|
414
|
-
if (
|
|
413
|
+
for (const [o, c] of t.entries())
|
|
414
|
+
if (c.options.deep && r.startsWith(o + "."))
|
|
415
415
|
try {
|
|
416
416
|
const u = H(e, o);
|
|
417
|
-
|
|
417
|
+
i(u, c.oldValue) || (c.callback(u, c.oldValue, e), c.oldValue = u);
|
|
418
418
|
} catch (u) {
|
|
419
|
-
|
|
419
|
+
ie(`Error in deep watcher for "${o}":`, u);
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
function Ke(e, t) {
|
|
423
423
|
return t === Boolean ? e === "true" : t === Number ? Number(e) : e;
|
|
424
424
|
}
|
|
425
425
|
function bt(e, t, r) {
|
|
426
|
-
t && Object.entries(t).forEach(([
|
|
427
|
-
const s = re(
|
|
428
|
-
if (
|
|
429
|
-
r[
|
|
430
|
-
else if (typeof e[
|
|
426
|
+
t && Object.entries(t).forEach(([n, i]) => {
|
|
427
|
+
const s = re(n), o = e.getAttribute(s);
|
|
428
|
+
if (i.type === Function && typeof e[n] == "function")
|
|
429
|
+
r[n] = e[n];
|
|
430
|
+
else if (typeof e[n] < "u")
|
|
431
431
|
try {
|
|
432
|
-
const
|
|
433
|
-
|
|
432
|
+
const c = e[n];
|
|
433
|
+
i.type === Boolean && typeof c == "boolean" || i.type === Number && typeof c == "number" || i.type === Function && typeof c == "function" ? r[n] = c : r[n] = Ke(String(c), i.type);
|
|
434
434
|
} catch {
|
|
435
|
-
r[
|
|
435
|
+
r[n] = e[n];
|
|
436
436
|
}
|
|
437
|
-
else o !== null ? r[
|
|
437
|
+
else o !== null ? r[n] = Ke(o, i.type) : "default" in i && i.default !== void 0 && (r[n] = i.default);
|
|
438
438
|
});
|
|
439
439
|
}
|
|
440
440
|
function wt(e, t, r) {
|
|
441
441
|
t.props && bt(e, t.props, r);
|
|
442
442
|
}
|
|
443
|
-
function
|
|
444
|
-
e.onConnected && !r && (e.onConnected(t),
|
|
443
|
+
function vt(e, t, r, n) {
|
|
444
|
+
e.onConnected && !r && (e.onConnected(t), n(!0));
|
|
445
445
|
}
|
|
446
|
-
function
|
|
447
|
-
e.onDisconnected && e.onDisconnected(t), r.forEach((u) => u()),
|
|
446
|
+
function xt(e, t, r, n, i, s, o, c) {
|
|
447
|
+
e.onDisconnected && e.onDisconnected(t), r.forEach((u) => u()), n(), i(), s(!1), o(null), c(!1);
|
|
448
448
|
}
|
|
449
|
-
function $t(e, t, r,
|
|
450
|
-
e.onAttributeChanged && e.onAttributeChanged(t, r,
|
|
449
|
+
function $t(e, t, r, n, i) {
|
|
450
|
+
e.onAttributeChanged && e.onAttributeChanged(t, r, n, i);
|
|
451
451
|
}
|
|
452
452
|
class kt {
|
|
453
453
|
static cache = /* @__PURE__ */ new Map();
|
|
@@ -471,24 +471,24 @@ class kt {
|
|
|
471
471
|
/XMLHttpRequest/i
|
|
472
472
|
];
|
|
473
473
|
static evaluate(t, r) {
|
|
474
|
-
const
|
|
475
|
-
if (
|
|
476
|
-
if (!
|
|
474
|
+
const n = this.cache.get(t);
|
|
475
|
+
if (n) {
|
|
476
|
+
if (!n.isSecure) {
|
|
477
477
|
Oe("Blocked cached dangerous expression:", t);
|
|
478
478
|
return;
|
|
479
479
|
}
|
|
480
|
-
return
|
|
480
|
+
return n.evaluator(r);
|
|
481
481
|
}
|
|
482
|
-
const
|
|
482
|
+
const i = this.createEvaluator(t);
|
|
483
483
|
if (this.cache.size >= this.maxCacheSize) {
|
|
484
484
|
const s = this.cache.keys().next().value;
|
|
485
485
|
s && this.cache.delete(s);
|
|
486
486
|
}
|
|
487
|
-
if (this.cache.set(t,
|
|
487
|
+
if (this.cache.set(t, i), !i.isSecure) {
|
|
488
488
|
Oe("Blocked dangerous expression:", t);
|
|
489
489
|
return;
|
|
490
490
|
}
|
|
491
|
-
return
|
|
491
|
+
return i.evaluator(r);
|
|
492
492
|
}
|
|
493
493
|
static createEvaluator(t) {
|
|
494
494
|
if (this.hasDangerousPatterns(t))
|
|
@@ -512,21 +512,21 @@ class kt {
|
|
|
512
512
|
return this.createObjectEvaluator(t);
|
|
513
513
|
if (/^ctx\.[a-zA-Z0-9_\.]+$/.test(t.trim())) {
|
|
514
514
|
const r = t.trim().slice(4);
|
|
515
|
-
return (
|
|
515
|
+
return (n) => H(n, r);
|
|
516
516
|
}
|
|
517
517
|
return t.includes("ctx") || /[+\-*/%<>=&|?:\[\]]/.test(t) ? this.createSimpleEvaluator(t) : (r) => H(r, t);
|
|
518
518
|
}
|
|
519
519
|
static createObjectEvaluator(t) {
|
|
520
|
-
const r = t.trim().slice(1, -1),
|
|
521
|
-
return (
|
|
520
|
+
const r = t.trim().slice(1, -1), n = this.parseObjectProperties(r);
|
|
521
|
+
return (i) => {
|
|
522
522
|
const s = {};
|
|
523
|
-
for (const { key: o, value:
|
|
523
|
+
for (const { key: o, value: c } of n)
|
|
524
524
|
try {
|
|
525
|
-
if (
|
|
526
|
-
const u =
|
|
527
|
-
s[o] = H(
|
|
525
|
+
if (c.startsWith("ctx.")) {
|
|
526
|
+
const u = c.slice(4);
|
|
527
|
+
s[o] = H(i, u);
|
|
528
528
|
} else
|
|
529
|
-
s[o] = this.evaluateSimpleValue(
|
|
529
|
+
s[o] = this.evaluateSimpleValue(c, i);
|
|
530
530
|
} catch {
|
|
531
531
|
s[o] = void 0;
|
|
532
532
|
}
|
|
@@ -534,51 +534,51 @@ class kt {
|
|
|
534
534
|
};
|
|
535
535
|
}
|
|
536
536
|
static parseObjectProperties(t) {
|
|
537
|
-
const r = [],
|
|
538
|
-
for (const
|
|
539
|
-
const s =
|
|
537
|
+
const r = [], n = t.split(",");
|
|
538
|
+
for (const i of n) {
|
|
539
|
+
const s = i.indexOf(":");
|
|
540
540
|
if (s === -1) continue;
|
|
541
|
-
const o =
|
|
542
|
-
r.push({ key: u, value:
|
|
541
|
+
const o = i.slice(0, s).trim(), c = i.slice(s + 1).trim(), u = o.replace(/^['"]|['"]$/g, "");
|
|
542
|
+
r.push({ key: u, value: c });
|
|
543
543
|
}
|
|
544
544
|
return r;
|
|
545
545
|
}
|
|
546
546
|
static createSimpleEvaluator(t) {
|
|
547
547
|
return (r) => {
|
|
548
548
|
try {
|
|
549
|
-
let
|
|
550
|
-
const
|
|
551
|
-
|
|
552
|
-
const s =
|
|
549
|
+
let n = t;
|
|
550
|
+
const i = [];
|
|
551
|
+
n = n.replace(/("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')/g, (b) => `<<#${i.push(b) - 1}#>>`);
|
|
552
|
+
const s = n.match(/ctx\.[\w.]+/g) || [];
|
|
553
553
|
for (const b of s) {
|
|
554
|
-
const p = b.slice(4),
|
|
555
|
-
if (
|
|
556
|
-
const
|
|
557
|
-
|
|
554
|
+
const p = b.slice(4), f = H(r, p);
|
|
555
|
+
if (f === void 0) return;
|
|
556
|
+
const h = i.push(JSON.stringify(f)) - 1;
|
|
557
|
+
n = n.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${h}#>>`);
|
|
558
558
|
}
|
|
559
|
-
const o = /\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g,
|
|
560
|
-
for (const b of
|
|
559
|
+
const o = /\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g, c = n.match(o) || [];
|
|
560
|
+
for (const b of c) {
|
|
561
561
|
if (b.startsWith("ctx.")) continue;
|
|
562
562
|
const p = H(r, b);
|
|
563
563
|
if (p === void 0) return;
|
|
564
|
-
const
|
|
565
|
-
|
|
564
|
+
const f = i.push(JSON.stringify(p)) - 1;
|
|
565
|
+
n = n.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${f}#>>`);
|
|
566
566
|
}
|
|
567
567
|
const u = /\b([a-zA-Z_][a-zA-Z0-9_]*)\b/g;
|
|
568
568
|
let m;
|
|
569
569
|
const g = /* @__PURE__ */ new Set();
|
|
570
|
-
for (; (m = u.exec(
|
|
570
|
+
for (; (m = u.exec(n)) !== null; ) {
|
|
571
571
|
const b = m[1];
|
|
572
572
|
if (["true", "false", "null", "undefined"].includes(b) || /^[0-9]+$/.test(b) || b === "ctx" || g.has(b)) continue;
|
|
573
573
|
g.add(b);
|
|
574
574
|
const p = H(r, b);
|
|
575
575
|
if (p === void 0) return;
|
|
576
|
-
const
|
|
577
|
-
b.includes(".") ?
|
|
576
|
+
const f = JSON.stringify(p), h = i.push(f) - 1;
|
|
577
|
+
b.includes(".") ? n = n.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${h}#>>`) : n = n.replace(new RegExp("\\b" + b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") + "\\b", "g"), `<<#${h}#>>`);
|
|
578
578
|
}
|
|
579
|
-
|
|
579
|
+
n = n.replace(/<<#(\d+)#>>/g, (b, p) => i[Number(p)]);
|
|
580
580
|
try {
|
|
581
|
-
return this.evaluateBasicExpression(
|
|
581
|
+
return this.evaluateBasicExpression(n);
|
|
582
582
|
} catch {
|
|
583
583
|
return;
|
|
584
584
|
}
|
|
@@ -594,141 +594,141 @@ class kt {
|
|
|
594
594
|
*/
|
|
595
595
|
static evaluateBasicExpression(t) {
|
|
596
596
|
const r = this.tokenize(t);
|
|
597
|
-
let
|
|
598
|
-
function
|
|
599
|
-
return r[
|
|
600
|
-
}
|
|
601
|
-
function s(
|
|
602
|
-
const
|
|
603
|
-
if (
|
|
604
|
-
throw new Error(`Unexpected token EOF, expected ${
|
|
605
|
-
if (
|
|
606
|
-
throw new Error(`Unexpected token ${
|
|
607
|
-
return
|
|
597
|
+
let n = 0;
|
|
598
|
+
function i() {
|
|
599
|
+
return r[n];
|
|
600
|
+
}
|
|
601
|
+
function s(a) {
|
|
602
|
+
const l = r[n++];
|
|
603
|
+
if (a && !l)
|
|
604
|
+
throw new Error(`Unexpected token EOF, expected ${a}`);
|
|
605
|
+
if (a && l && l.type !== a && l.value !== a)
|
|
606
|
+
throw new Error(`Unexpected token ${l.type}/${l.value}, expected ${a}`);
|
|
607
|
+
return l;
|
|
608
608
|
}
|
|
609
609
|
function o() {
|
|
610
|
-
return
|
|
610
|
+
return c();
|
|
611
611
|
}
|
|
612
|
-
function
|
|
613
|
-
let
|
|
614
|
-
if (
|
|
612
|
+
function c() {
|
|
613
|
+
let a = u();
|
|
614
|
+
if (i() && i().value === "?") {
|
|
615
615
|
s("?");
|
|
616
|
-
const
|
|
616
|
+
const l = o();
|
|
617
617
|
s(":");
|
|
618
618
|
const y = o();
|
|
619
|
-
return
|
|
619
|
+
return a ? l : y;
|
|
620
620
|
}
|
|
621
|
-
return
|
|
621
|
+
return a;
|
|
622
622
|
}
|
|
623
623
|
function u() {
|
|
624
|
-
let
|
|
625
|
-
for (;
|
|
624
|
+
let a = m();
|
|
625
|
+
for (; i() && i().value === "||"; ) {
|
|
626
626
|
s("OP");
|
|
627
|
-
const
|
|
628
|
-
|
|
627
|
+
const l = m();
|
|
628
|
+
a = a || l;
|
|
629
629
|
}
|
|
630
|
-
return
|
|
630
|
+
return a;
|
|
631
631
|
}
|
|
632
632
|
function m() {
|
|
633
|
-
let
|
|
634
|
-
for (;
|
|
633
|
+
let a = g();
|
|
634
|
+
for (; i() && i().value === "&&"; ) {
|
|
635
635
|
s("OP");
|
|
636
|
-
const
|
|
637
|
-
|
|
636
|
+
const l = g();
|
|
637
|
+
a = a && l;
|
|
638
638
|
}
|
|
639
|
-
return
|
|
639
|
+
return a;
|
|
640
640
|
}
|
|
641
641
|
function g() {
|
|
642
|
-
let
|
|
643
|
-
for (;
|
|
644
|
-
const
|
|
645
|
-
switch (
|
|
642
|
+
let a = b();
|
|
643
|
+
for (; i() && ["==", "!=", "===", "!=="].includes(i().value); ) {
|
|
644
|
+
const l = s("OP").value, y = b();
|
|
645
|
+
switch (l) {
|
|
646
646
|
case "==":
|
|
647
|
-
|
|
647
|
+
a = a == y;
|
|
648
648
|
break;
|
|
649
649
|
case "!=":
|
|
650
|
-
|
|
650
|
+
a = a != y;
|
|
651
651
|
break;
|
|
652
652
|
case "===":
|
|
653
|
-
|
|
653
|
+
a = a === y;
|
|
654
654
|
break;
|
|
655
655
|
case "!==":
|
|
656
|
-
|
|
656
|
+
a = a !== y;
|
|
657
657
|
break;
|
|
658
658
|
}
|
|
659
659
|
}
|
|
660
|
-
return
|
|
660
|
+
return a;
|
|
661
661
|
}
|
|
662
662
|
function b() {
|
|
663
|
-
let
|
|
664
|
-
for (;
|
|
665
|
-
const
|
|
666
|
-
switch (
|
|
663
|
+
let a = p();
|
|
664
|
+
for (; i() && [">", "<", ">=", "<="].includes(i().value); ) {
|
|
665
|
+
const l = s("OP").value, y = p();
|
|
666
|
+
switch (l) {
|
|
667
667
|
case ">":
|
|
668
|
-
|
|
668
|
+
a = a > y;
|
|
669
669
|
break;
|
|
670
670
|
case "<":
|
|
671
|
-
|
|
671
|
+
a = a < y;
|
|
672
672
|
break;
|
|
673
673
|
case ">=":
|
|
674
|
-
|
|
674
|
+
a = a >= y;
|
|
675
675
|
break;
|
|
676
676
|
case "<=":
|
|
677
|
-
|
|
677
|
+
a = a <= y;
|
|
678
678
|
break;
|
|
679
679
|
}
|
|
680
680
|
}
|
|
681
|
-
return
|
|
681
|
+
return a;
|
|
682
682
|
}
|
|
683
683
|
function p() {
|
|
684
|
-
let
|
|
685
|
-
for (;
|
|
686
|
-
const
|
|
687
|
-
|
|
684
|
+
let a = f();
|
|
685
|
+
for (; i() && (i().value === "+" || i().value === "-"); ) {
|
|
686
|
+
const l = s("OP").value, y = f();
|
|
687
|
+
a = l === "+" ? a + y : a - y;
|
|
688
688
|
}
|
|
689
|
-
return
|
|
689
|
+
return a;
|
|
690
690
|
}
|
|
691
|
-
function
|
|
692
|
-
let
|
|
693
|
-
for (;
|
|
694
|
-
const
|
|
695
|
-
switch (
|
|
691
|
+
function f() {
|
|
692
|
+
let a = h();
|
|
693
|
+
for (; i() && (i().value === "*" || i().value === "/" || i().value === "%"); ) {
|
|
694
|
+
const l = s("OP").value, y = h();
|
|
695
|
+
switch (l) {
|
|
696
696
|
case "*":
|
|
697
|
-
|
|
697
|
+
a = a * y;
|
|
698
698
|
break;
|
|
699
699
|
case "/":
|
|
700
|
-
|
|
700
|
+
a = a / y;
|
|
701
701
|
break;
|
|
702
702
|
case "%":
|
|
703
|
-
|
|
703
|
+
a = a % y;
|
|
704
704
|
break;
|
|
705
705
|
}
|
|
706
706
|
}
|
|
707
|
-
return
|
|
707
|
+
return a;
|
|
708
708
|
}
|
|
709
|
-
function
|
|
710
|
-
return
|
|
709
|
+
function h() {
|
|
710
|
+
return i() && i().value === "!" ? (s("OP"), !h()) : i() && i().value === "-" ? (s("OP"), -h()) : v();
|
|
711
711
|
}
|
|
712
|
-
function
|
|
713
|
-
const
|
|
714
|
-
if (
|
|
715
|
-
if (
|
|
716
|
-
return s("NUMBER"), Number(
|
|
717
|
-
if (
|
|
718
|
-
return s("STRING"),
|
|
719
|
-
if (
|
|
720
|
-
return s("IDENT"),
|
|
721
|
-
if (
|
|
712
|
+
function v() {
|
|
713
|
+
const a = i();
|
|
714
|
+
if (a) {
|
|
715
|
+
if (a.type === "NUMBER")
|
|
716
|
+
return s("NUMBER"), Number(a.value);
|
|
717
|
+
if (a.type === "STRING")
|
|
718
|
+
return s("STRING"), a.value.slice(1, -1);
|
|
719
|
+
if (a.type === "IDENT")
|
|
720
|
+
return s("IDENT"), a.value === "true" ? !0 : a.value === "false" ? !1 : a.value === "null" ? null : void 0;
|
|
721
|
+
if (a.value === "[") {
|
|
722
722
|
s("PUNC");
|
|
723
|
-
const
|
|
724
|
-
for (;
|
|
725
|
-
|
|
726
|
-
return s("PUNC"),
|
|
723
|
+
const l = [];
|
|
724
|
+
for (; i() && i().value !== "]"; )
|
|
725
|
+
l.push(o()), i() && i().value === "," && s("PUNC");
|
|
726
|
+
return s("PUNC"), l;
|
|
727
727
|
}
|
|
728
|
-
if (
|
|
728
|
+
if (a.value === "(") {
|
|
729
729
|
s("PUNC");
|
|
730
|
-
const
|
|
731
|
-
return s("PUNC"),
|
|
730
|
+
const l = o();
|
|
731
|
+
return s("PUNC"), l;
|
|
732
732
|
}
|
|
733
733
|
throw new Error("Unexpected token in expression");
|
|
734
734
|
}
|
|
@@ -736,10 +736,10 @@ class kt {
|
|
|
736
736
|
return o();
|
|
737
737
|
}
|
|
738
738
|
static tokenize(t) {
|
|
739
|
-
const r = [],
|
|
740
|
-
let
|
|
741
|
-
for (; (
|
|
742
|
-
const s =
|
|
739
|
+
const r = [], n = /\s*(=>|===|!==|==|!=|>=|<=|\|\||&&|[()?:,\[\]]|\+|-|\*|\/|%|>|<|!|\d+\.?\d*|"[^"]*"|'[^']*'|[a-zA-Z_][a-zA-Z0-9_]*|\S)\s*/g;
|
|
740
|
+
let i;
|
|
741
|
+
for (; (i = n.exec(t)) !== null; ) {
|
|
742
|
+
const s = i[1];
|
|
743
743
|
s && (/^\d/.test(s) ? r.push({ type: "NUMBER", value: s }) : /^"/.test(s) || /^'/.test(s) ? r.push({ type: "STRING", value: s }) : /^[a-zA-Z_]/.test(s) ? r.push({ type: "IDENT", value: s }) : /^[()?:,\[\]]$/.test(s) ? r.push({ type: "PUNC", value: s }) : r.push({ type: "OP", value: s }));
|
|
744
744
|
}
|
|
745
745
|
return r;
|
|
@@ -749,8 +749,8 @@ class kt {
|
|
|
749
749
|
if (t === "false") return !1;
|
|
750
750
|
if (!isNaN(Number(t))) return Number(t);
|
|
751
751
|
if (t.startsWith("ctx.")) {
|
|
752
|
-
const
|
|
753
|
-
return H(r,
|
|
752
|
+
const n = t.slice(4);
|
|
753
|
+
return H(r, n);
|
|
754
754
|
}
|
|
755
755
|
return t.startsWith('"') && t.endsWith('"') || t.startsWith("'") && t.endsWith("'") ? t.slice(1, -1) : t;
|
|
756
756
|
}
|
|
@@ -761,39 +761,39 @@ class kt {
|
|
|
761
761
|
return this.cache.size;
|
|
762
762
|
}
|
|
763
763
|
}
|
|
764
|
-
class
|
|
764
|
+
class se {
|
|
765
765
|
static cleanupFunctions = /* @__PURE__ */ new WeakMap();
|
|
766
766
|
/**
|
|
767
767
|
* Add an event listener with automatic cleanup tracking
|
|
768
768
|
*/
|
|
769
|
-
static addListener(t, r,
|
|
770
|
-
t.addEventListener(r,
|
|
771
|
-
const o = { event: r, handler:
|
|
769
|
+
static addListener(t, r, n, i) {
|
|
770
|
+
t.addEventListener(r, n, i);
|
|
771
|
+
const o = { event: r, handler: n, options: i, cleanup: () => t.removeEventListener(r, n, i), addedAt: Date.now() };
|
|
772
772
|
this.cleanupFunctions.has(t) || this.cleanupFunctions.set(t, []);
|
|
773
|
-
const
|
|
774
|
-
|
|
773
|
+
const c = this.cleanupFunctions.get(t);
|
|
774
|
+
c.push(o), this.cleanupFunctions.get(t).__metaList = c;
|
|
775
775
|
}
|
|
776
776
|
/**
|
|
777
777
|
* Remove a specific event listener
|
|
778
778
|
*/
|
|
779
|
-
static removeListener(t, r,
|
|
780
|
-
t.removeEventListener(r,
|
|
779
|
+
static removeListener(t, r, n, i) {
|
|
780
|
+
t.removeEventListener(r, n, i);
|
|
781
781
|
const s = this.cleanupFunctions.get(t);
|
|
782
782
|
if (s) {
|
|
783
783
|
const o = s.__metaList || null;
|
|
784
784
|
if (o) {
|
|
785
|
-
const
|
|
786
|
-
if (
|
|
785
|
+
const c = o.findIndex((u) => u.event === r && u.handler === n && JSON.stringify(u.options) === JSON.stringify(i));
|
|
786
|
+
if (c >= 0) {
|
|
787
787
|
try {
|
|
788
|
-
o[
|
|
788
|
+
o[c].cleanup();
|
|
789
789
|
} catch {
|
|
790
790
|
}
|
|
791
|
-
o.splice(
|
|
791
|
+
o.splice(c, 1);
|
|
792
792
|
}
|
|
793
793
|
o.length === 0 && this.cleanupFunctions.delete(t);
|
|
794
794
|
} else {
|
|
795
|
-
const
|
|
796
|
-
|
|
795
|
+
const c = s.findIndex(() => !0);
|
|
796
|
+
c >= 0 && (s.splice(c, 1), s.length === 0 && this.cleanupFunctions.delete(t));
|
|
797
797
|
}
|
|
798
798
|
}
|
|
799
799
|
}
|
|
@@ -802,9 +802,9 @@ class oe {
|
|
|
802
802
|
*/
|
|
803
803
|
static cleanup(t) {
|
|
804
804
|
const r = this.cleanupFunctions.get(t);
|
|
805
|
-
r && ((r.__metaList || r).forEach((
|
|
805
|
+
r && ((r.__metaList || r).forEach((i) => {
|
|
806
806
|
try {
|
|
807
|
-
typeof
|
|
807
|
+
typeof i == "function" ? i() : i && typeof i.cleanup == "function" && i.cleanup();
|
|
808
808
|
} catch (s) {
|
|
809
809
|
console.error("Error during event cleanup:", s);
|
|
810
810
|
}
|
|
@@ -824,151 +824,151 @@ class oe {
|
|
|
824
824
|
* Check if an element has any tracked event listeners
|
|
825
825
|
*/
|
|
826
826
|
static hasListeners(t) {
|
|
827
|
-
const r = this.cleanupFunctions.get(t),
|
|
828
|
-
return !!(
|
|
827
|
+
const r = this.cleanupFunctions.get(t), n = r ? r.__metaList || r : void 0;
|
|
828
|
+
return !!(n && n.length > 0);
|
|
829
829
|
}
|
|
830
830
|
/**
|
|
831
831
|
* Get the number of tracked event listeners for an element
|
|
832
832
|
*/
|
|
833
833
|
static getListenerCount(t) {
|
|
834
|
-
const r = this.cleanupFunctions.get(t),
|
|
835
|
-
return
|
|
834
|
+
const r = this.cleanupFunctions.get(t), n = r ? r.__metaList || r : void 0;
|
|
835
|
+
return n ? n.length : 0;
|
|
836
836
|
}
|
|
837
837
|
}
|
|
838
|
-
function
|
|
838
|
+
function le(e, t) {
|
|
839
839
|
if (t && e instanceof HTMLElement) {
|
|
840
|
-
|
|
840
|
+
se.cleanup(e);
|
|
841
841
|
for (const r in t)
|
|
842
842
|
t[r] === e && delete t[r];
|
|
843
843
|
for (const r of Array.from(e.childNodes))
|
|
844
|
-
|
|
844
|
+
le(r, t);
|
|
845
845
|
}
|
|
846
846
|
}
|
|
847
847
|
function pe(e, t, r) {
|
|
848
848
|
if (typeof e == "string") return;
|
|
849
|
-
const
|
|
850
|
-
|
|
849
|
+
const n = e.props?.reactiveRef ?? (e.props?.props && e.props.props.reactiveRef), i = e.props?.ref ?? (e.props?.props && e.props.props.ref);
|
|
850
|
+
n ? n.value = t : i && r && (r[i] = t);
|
|
851
851
|
}
|
|
852
|
-
function Ct(e, t, r,
|
|
852
|
+
function Ct(e, t, r, n, i, s, o, c) {
|
|
853
853
|
if (!s) return;
|
|
854
854
|
const u = t.includes("lazy"), m = t.includes("trim"), g = t.includes("number"), b = e && typeof e == "object" && "value" in e && typeof e.value < "u", p = () => {
|
|
855
855
|
if (b) {
|
|
856
|
-
const
|
|
857
|
-
return
|
|
856
|
+
const $ = e.value;
|
|
857
|
+
return c && typeof $ == "object" && $ !== null ? $[c] : $;
|
|
858
858
|
}
|
|
859
859
|
return H(s._state || s, e);
|
|
860
|
-
},
|
|
861
|
-
let
|
|
862
|
-
o instanceof HTMLInputElement ?
|
|
863
|
-
const
|
|
864
|
-
if (
|
|
865
|
-
if (Array.isArray(
|
|
866
|
-
r[
|
|
860
|
+
}, f = p();
|
|
861
|
+
let h = "text";
|
|
862
|
+
o instanceof HTMLInputElement ? h = n?.type || o.type || "text" : o instanceof HTMLSelectElement ? h = "select" : o instanceof HTMLTextAreaElement && (h = "textarea");
|
|
863
|
+
const v = o instanceof HTMLInputElement || o instanceof HTMLTextAreaElement || o instanceof HTMLSelectElement, a = v ? h === "checkbox" || h === "radio" ? "checked" : "value" : c ?? "modelValue";
|
|
864
|
+
if (h === "checkbox")
|
|
865
|
+
if (Array.isArray(f))
|
|
866
|
+
r[a] = f.includes(String(o?.getAttribute("value") ?? n?.value ?? ""));
|
|
867
867
|
else {
|
|
868
|
-
const
|
|
869
|
-
r[
|
|
868
|
+
const $ = o?.getAttribute("true-value") ?? !0;
|
|
869
|
+
r[a] = f === $;
|
|
870
870
|
}
|
|
871
|
-
else if (
|
|
872
|
-
r[
|
|
873
|
-
else if (
|
|
871
|
+
else if (h === "radio")
|
|
872
|
+
r[a] = f === (n?.value ?? "");
|
|
873
|
+
else if (h === "select")
|
|
874
874
|
if (o && o.hasAttribute("multiple") && o instanceof HTMLSelectElement) {
|
|
875
|
-
const
|
|
875
|
+
const $ = Array.isArray(f) ? f.map(String) : [];
|
|
876
876
|
setTimeout(() => {
|
|
877
|
-
Array.from(o.options).forEach((
|
|
878
|
-
|
|
877
|
+
Array.from(o.options).forEach((k) => {
|
|
878
|
+
k.selected = $.includes(k.value);
|
|
879
879
|
});
|
|
880
|
-
}, 0), r[
|
|
880
|
+
}, 0), r[a] = Array.isArray(f) ? f : [];
|
|
881
881
|
} else
|
|
882
|
-
r[
|
|
882
|
+
r[a] = f;
|
|
883
883
|
else {
|
|
884
|
-
r[
|
|
884
|
+
r[a] = f;
|
|
885
885
|
try {
|
|
886
|
-
const
|
|
887
|
-
|
|
886
|
+
const $ = re(a);
|
|
887
|
+
n && (n[$] = f);
|
|
888
888
|
} catch {
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
|
-
const
|
|
892
|
-
if (
|
|
893
|
-
const
|
|
894
|
-
if (
|
|
895
|
-
const
|
|
896
|
-
if (!
|
|
897
|
-
let
|
|
898
|
-
if (
|
|
891
|
+
const l = u || h === "checkbox" || h === "radio" || h === "select" ? "change" : "input", y = ($) => {
|
|
892
|
+
if ($.isComposing || i._isComposing) return;
|
|
893
|
+
const k = typeof globalThis.process < "u" && globalThis.process.env?.NODE_ENV === "test" || typeof window < "u" && window.__vitest__;
|
|
894
|
+
if ($.isTrusted === !1 && !k) return;
|
|
895
|
+
const d = $.target;
|
|
896
|
+
if (!d || d._modelUpdating) return;
|
|
897
|
+
let x = d.value;
|
|
898
|
+
if (h === "checkbox") {
|
|
899
899
|
const T = p();
|
|
900
900
|
if (Array.isArray(T)) {
|
|
901
|
-
const R =
|
|
902
|
-
if (
|
|
901
|
+
const R = d.getAttribute("value") ?? "", S = Array.from(T);
|
|
902
|
+
if (d.checked)
|
|
903
903
|
S.includes(R) || S.push(R);
|
|
904
904
|
else {
|
|
905
905
|
const P = S.indexOf(R);
|
|
906
906
|
P > -1 && S.splice(P, 1);
|
|
907
907
|
}
|
|
908
|
-
|
|
908
|
+
x = S;
|
|
909
909
|
} else {
|
|
910
|
-
const R =
|
|
911
|
-
|
|
910
|
+
const R = d.getAttribute("true-value") ?? !0, S = d.getAttribute("false-value") ?? !1;
|
|
911
|
+
x = d.checked ? R : S;
|
|
912
912
|
}
|
|
913
|
-
} else if (
|
|
914
|
-
|
|
915
|
-
else if (
|
|
916
|
-
|
|
917
|
-
else if (m && typeof
|
|
918
|
-
const T = Number(
|
|
919
|
-
isNaN(T) || (
|
|
913
|
+
} else if (h === "radio")
|
|
914
|
+
x = d.getAttribute("value") ?? d.value;
|
|
915
|
+
else if (h === "select" && d.multiple)
|
|
916
|
+
x = Array.from(d.selectedOptions).map((T) => T.value);
|
|
917
|
+
else if (m && typeof x == "string" && (x = x.trim()), g) {
|
|
918
|
+
const T = Number(x);
|
|
919
|
+
isNaN(T) || (x = T);
|
|
920
920
|
}
|
|
921
921
|
const A = s._state || s, C = p();
|
|
922
|
-
if (Array.isArray(
|
|
923
|
-
|
|
922
|
+
if (Array.isArray(x) && Array.isArray(C) ? JSON.stringify([...x].sort()) !== JSON.stringify([...C].sort()) : x !== C) {
|
|
923
|
+
d._modelUpdating = !0;
|
|
924
924
|
try {
|
|
925
925
|
if (b)
|
|
926
|
-
if (
|
|
926
|
+
if (c && typeof e.value == "object" && e.value !== null) {
|
|
927
927
|
const T = { ...e.value };
|
|
928
|
-
T[
|
|
928
|
+
T[c] = x, e.value = T;
|
|
929
929
|
} else
|
|
930
|
-
e.value =
|
|
930
|
+
e.value = x;
|
|
931
931
|
else
|
|
932
|
-
_e(A, e,
|
|
932
|
+
_e(A, e, x);
|
|
933
933
|
if (s._requestRender && s._requestRender(), s._triggerWatchers) {
|
|
934
934
|
const T = b ? "reactiveState" : e;
|
|
935
|
-
s._triggerWatchers(T,
|
|
935
|
+
s._triggerWatchers(T, x);
|
|
936
936
|
}
|
|
937
|
-
if (
|
|
938
|
-
const T = `update:${re(
|
|
939
|
-
detail:
|
|
937
|
+
if (d) {
|
|
938
|
+
const T = `update:${re(a)}`, R = new CustomEvent(T, {
|
|
939
|
+
detail: x,
|
|
940
940
|
bubbles: !0,
|
|
941
941
|
composed: !0
|
|
942
942
|
});
|
|
943
|
-
|
|
943
|
+
d.dispatchEvent(R);
|
|
944
944
|
}
|
|
945
945
|
} finally {
|
|
946
|
-
setTimeout(() =>
|
|
946
|
+
setTimeout(() => d._modelUpdating = !1, 0);
|
|
947
947
|
}
|
|
948
948
|
}
|
|
949
949
|
};
|
|
950
|
-
if (
|
|
951
|
-
if (
|
|
952
|
-
const
|
|
953
|
-
o &&
|
|
950
|
+
if (v) {
|
|
951
|
+
if (i[l]) {
|
|
952
|
+
const $ = i[l];
|
|
953
|
+
o && se.removeListener(o, l, $);
|
|
954
954
|
}
|
|
955
|
-
|
|
955
|
+
i[l] = y;
|
|
956
956
|
} else {
|
|
957
|
-
const
|
|
958
|
-
if (
|
|
959
|
-
const
|
|
960
|
-
o &&
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
const
|
|
964
|
-
if (Array.isArray(
|
|
965
|
-
_e(
|
|
966
|
-
const E =
|
|
957
|
+
const $ = `update:${re(a)}`;
|
|
958
|
+
if (i[$]) {
|
|
959
|
+
const k = i[$];
|
|
960
|
+
o && se.removeListener(o, $, k);
|
|
961
|
+
}
|
|
962
|
+
i[$] = (k) => {
|
|
963
|
+
const d = s._state || s, x = k.detail !== void 0 ? k.detail : k.target?.value, A = H(d, e);
|
|
964
|
+
if (Array.isArray(x) && Array.isArray(A) ? JSON.stringify([...x].sort()) !== JSON.stringify([...A].sort()) : x !== A) {
|
|
965
|
+
_e(d, e, x), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, x);
|
|
966
|
+
const E = k.target;
|
|
967
967
|
if (E) {
|
|
968
|
-
E[
|
|
968
|
+
E[a] = x;
|
|
969
969
|
try {
|
|
970
|
-
const T = re(
|
|
971
|
-
typeof
|
|
970
|
+
const T = re(a);
|
|
971
|
+
typeof x == "boolean" ? x ? E.setAttribute(T, "true") : E.setAttribute(T, "false") : E.setAttribute(T, String(x));
|
|
972
972
|
} catch {
|
|
973
973
|
}
|
|
974
974
|
queueMicrotask(() => {
|
|
@@ -978,22 +978,22 @@ function Ct(e, t, r, i, n, s, o, a) {
|
|
|
978
978
|
}
|
|
979
979
|
};
|
|
980
980
|
}
|
|
981
|
-
(
|
|
982
|
-
|
|
983
|
-
const
|
|
984
|
-
|
|
985
|
-
const
|
|
986
|
-
let C =
|
|
981
|
+
(h === "text" || h === "textarea") && (i.compositionstart = (() => i._isComposing = !0), i.compositionend = ($) => {
|
|
982
|
+
i._isComposing = !1;
|
|
983
|
+
const k = $.target;
|
|
984
|
+
k && setTimeout(() => {
|
|
985
|
+
const d = k.value, x = s._state || s, A = H(x, e);
|
|
986
|
+
let C = d;
|
|
987
987
|
if (m && (C = C.trim()), g) {
|
|
988
988
|
const T = Number(C);
|
|
989
989
|
isNaN(T) || (C = T);
|
|
990
990
|
}
|
|
991
991
|
if (Array.isArray(C) && Array.isArray(A) ? JSON.stringify([...C].sort()) !== JSON.stringify([...A].sort()) : C !== A) {
|
|
992
|
-
|
|
992
|
+
k._modelUpdating = !0;
|
|
993
993
|
try {
|
|
994
|
-
_e(
|
|
994
|
+
_e(x, e, C), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, C);
|
|
995
995
|
} finally {
|
|
996
|
-
setTimeout(() =>
|
|
996
|
+
setTimeout(() => k._modelUpdating = !1, 0);
|
|
997
997
|
}
|
|
998
998
|
}
|
|
999
999
|
}, 0);
|
|
@@ -1003,83 +1003,83 @@ function ot(e) {
|
|
|
1003
1003
|
const t = e.slice(2);
|
|
1004
1004
|
return t ? t.charAt(0).toLowerCase() + t.slice(1) : "";
|
|
1005
1005
|
}
|
|
1006
|
-
function _t(e, t, r,
|
|
1006
|
+
function _t(e, t, r, n) {
|
|
1007
1007
|
if (typeof e == "object" && e !== null)
|
|
1008
|
-
for (const [
|
|
1009
|
-
|
|
1008
|
+
for (const [i, s] of Object.entries(e))
|
|
1009
|
+
i.startsWith("data-") || i.startsWith("aria-") || i === "class" ? r[i] = s : t[i] = s;
|
|
1010
1010
|
else if (typeof e == "string") {
|
|
1011
|
-
if (!
|
|
1011
|
+
if (!n) return;
|
|
1012
1012
|
try {
|
|
1013
|
-
const
|
|
1014
|
-
if (typeof
|
|
1015
|
-
for (const [s, o] of Object.entries(
|
|
1013
|
+
const i = me(e, n);
|
|
1014
|
+
if (typeof i == "object" && i !== null) {
|
|
1015
|
+
for (const [s, o] of Object.entries(i))
|
|
1016
1016
|
s.startsWith("data-") || s.startsWith("aria-") || s === "class" ? r[s] = o : t[s] = o;
|
|
1017
1017
|
return;
|
|
1018
1018
|
} else {
|
|
1019
|
-
r[e] =
|
|
1019
|
+
r[e] = i;
|
|
1020
1020
|
return;
|
|
1021
1021
|
}
|
|
1022
1022
|
} catch {
|
|
1023
|
-
const
|
|
1024
|
-
r[e] =
|
|
1023
|
+
const i = H(n, e);
|
|
1024
|
+
r[e] = i;
|
|
1025
1025
|
}
|
|
1026
1026
|
}
|
|
1027
1027
|
}
|
|
1028
1028
|
function Et(e, t, r) {
|
|
1029
|
-
let
|
|
1029
|
+
let n;
|
|
1030
1030
|
if (typeof e == "string") {
|
|
1031
1031
|
if (!r) return;
|
|
1032
|
-
|
|
1032
|
+
n = me(e, r);
|
|
1033
1033
|
} else
|
|
1034
|
-
|
|
1035
|
-
const
|
|
1036
|
-
let s =
|
|
1037
|
-
if (
|
|
1038
|
-
if (
|
|
1039
|
-
const o =
|
|
1034
|
+
n = e;
|
|
1035
|
+
const i = t.style || "";
|
|
1036
|
+
let s = i;
|
|
1037
|
+
if (n) {
|
|
1038
|
+
if (i) {
|
|
1039
|
+
const o = i.split(";").map((u) => u.trim()).filter(Boolean), c = o.findIndex(
|
|
1040
1040
|
(u) => u.startsWith("display:")
|
|
1041
1041
|
);
|
|
1042
|
-
|
|
1042
|
+
c >= 0 && o[c] === "display: none" && (o.splice(c, 1), s = o.length > 0 ? o.join("; ") + ";" : "");
|
|
1043
1043
|
}
|
|
1044
|
-
} else if (
|
|
1045
|
-
const o =
|
|
1044
|
+
} else if (i) {
|
|
1045
|
+
const o = i.split(";").filter(Boolean), c = o.findIndex(
|
|
1046
1046
|
(u) => u.trim().startsWith("display:")
|
|
1047
1047
|
);
|
|
1048
|
-
|
|
1048
|
+
c >= 0 ? o[c] = "display: none" : o.push("display: none"), s = o.join("; ");
|
|
1049
1049
|
} else
|
|
1050
1050
|
s = "display: none";
|
|
1051
|
-
s !==
|
|
1051
|
+
s !== i && (s ? t.style = s : delete t.style);
|
|
1052
1052
|
}
|
|
1053
1053
|
function me(e, t) {
|
|
1054
1054
|
return kt.evaluate(e, t);
|
|
1055
1055
|
}
|
|
1056
1056
|
function St(e, t, r) {
|
|
1057
|
-
let
|
|
1057
|
+
let n;
|
|
1058
1058
|
if (typeof e == "string") {
|
|
1059
1059
|
if (!r) return;
|
|
1060
|
-
|
|
1060
|
+
n = me(e, r);
|
|
1061
1061
|
} else
|
|
1062
|
-
|
|
1063
|
-
let
|
|
1064
|
-
typeof
|
|
1065
|
-
const s = t.class || "", o = s ? `${s} ${
|
|
1062
|
+
n = e;
|
|
1063
|
+
let i = [];
|
|
1064
|
+
typeof n == "string" ? i = [n] : Array.isArray(n) ? i = n.filter(Boolean) : typeof n == "object" && n !== null && (i = Object.entries(n).filter(([, c]) => !!c).flatMap(([c]) => c.split(/\s+/).filter(Boolean)));
|
|
1065
|
+
const s = t.class || "", o = s ? `${s} ${i.join(" ")}`.trim() : i.join(" ");
|
|
1066
1066
|
o && (t.class = o);
|
|
1067
1067
|
}
|
|
1068
1068
|
function At(e, t, r) {
|
|
1069
|
-
let
|
|
1069
|
+
let n;
|
|
1070
1070
|
if (typeof e == "string") {
|
|
1071
1071
|
if (!r) return;
|
|
1072
|
-
|
|
1072
|
+
n = me(e, r);
|
|
1073
1073
|
} else
|
|
1074
|
-
|
|
1075
|
-
let
|
|
1076
|
-
if (typeof
|
|
1077
|
-
|
|
1078
|
-
else if (
|
|
1074
|
+
n = e;
|
|
1075
|
+
let i = "";
|
|
1076
|
+
if (typeof n == "string")
|
|
1077
|
+
i = n;
|
|
1078
|
+
else if (n && typeof n == "object") {
|
|
1079
1079
|
const o = [];
|
|
1080
|
-
for (const [
|
|
1080
|
+
for (const [c, u] of Object.entries(n))
|
|
1081
1081
|
if (u != null && u !== "") {
|
|
1082
|
-
const m =
|
|
1082
|
+
const m = c.replace(
|
|
1083
1083
|
/[A-Z]/g,
|
|
1084
1084
|
(p) => `-${p.toLowerCase()}`
|
|
1085
1085
|
), g = [
|
|
@@ -1111,37 +1111,37 @@ function At(e, t, r) {
|
|
|
1111
1111
|
let b = String(u);
|
|
1112
1112
|
typeof u == "number" && g.includes(m) && (b = `${u}px`), o.push(`${m}: ${b}`);
|
|
1113
1113
|
}
|
|
1114
|
-
|
|
1114
|
+
i = o.join("; ") + (o.length > 0 ? ";" : "");
|
|
1115
1115
|
}
|
|
1116
1116
|
const s = t.style || "";
|
|
1117
|
-
t.style = s + (s && !s.endsWith(";") ? "; " : "") +
|
|
1117
|
+
t.style = s + (s && !s.endsWith(";") ? "; " : "") + i;
|
|
1118
1118
|
}
|
|
1119
1119
|
function Tt(e, t, r) {
|
|
1120
|
-
let
|
|
1121
|
-
typeof e == "string" && r && (
|
|
1120
|
+
let n = e;
|
|
1121
|
+
typeof e == "string" && r && (n = me(e, r)), ee(n) ? t.reactiveRef = n : t.ref = n;
|
|
1122
1122
|
}
|
|
1123
|
-
function at(e, t, r,
|
|
1124
|
-
const
|
|
1125
|
-
for (const [
|
|
1123
|
+
function at(e, t, r, n) {
|
|
1124
|
+
const i = {}, s = { ...n || {} }, o = {};
|
|
1125
|
+
for (const [c, u] of Object.entries(e)) {
|
|
1126
1126
|
const { value: m, modifiers: g, arg: b } = u;
|
|
1127
|
-
if (
|
|
1128
|
-
const p =
|
|
1127
|
+
if (c === "model" || c.startsWith("model:")) {
|
|
1128
|
+
const p = c.split(":"), f = p.length > 1 ? p[1] : b;
|
|
1129
1129
|
Ct(
|
|
1130
1130
|
m,
|
|
1131
1131
|
// Pass the original value (could be string or reactive state object)
|
|
1132
1132
|
g,
|
|
1133
|
-
|
|
1133
|
+
i,
|
|
1134
1134
|
s,
|
|
1135
1135
|
o,
|
|
1136
1136
|
t,
|
|
1137
1137
|
r,
|
|
1138
|
-
|
|
1138
|
+
f
|
|
1139
1139
|
);
|
|
1140
1140
|
continue;
|
|
1141
1141
|
}
|
|
1142
|
-
switch (
|
|
1142
|
+
switch (c) {
|
|
1143
1143
|
case "bind":
|
|
1144
|
-
_t(m,
|
|
1144
|
+
_t(m, i, s, t);
|
|
1145
1145
|
break;
|
|
1146
1146
|
case "show":
|
|
1147
1147
|
Et(m, s, t);
|
|
@@ -1153,20 +1153,20 @@ function at(e, t, r, i) {
|
|
|
1153
1153
|
At(m, s, t);
|
|
1154
1154
|
break;
|
|
1155
1155
|
case "ref":
|
|
1156
|
-
Tt(m,
|
|
1156
|
+
Tt(m, i, t);
|
|
1157
1157
|
break;
|
|
1158
1158
|
}
|
|
1159
1159
|
}
|
|
1160
|
-
return { props:
|
|
1160
|
+
return { props: i, attrs: s, listeners: o };
|
|
1161
1161
|
}
|
|
1162
1162
|
function Be(e, t) {
|
|
1163
1163
|
if (Array.isArray(e)) {
|
|
1164
1164
|
const s = /* @__PURE__ */ new Set();
|
|
1165
1165
|
return e.map((o) => {
|
|
1166
1166
|
if (!o || typeof o != "object") return o;
|
|
1167
|
-
let
|
|
1168
|
-
if (!
|
|
1169
|
-
const b = o.tag || "node",
|
|
1167
|
+
let c = o.props?.key ?? o.key;
|
|
1168
|
+
if (!c) {
|
|
1169
|
+
const b = o.tag || "node", f = [
|
|
1170
1170
|
// attrs (kebab-case)
|
|
1171
1171
|
o.props?.attrs?.id,
|
|
1172
1172
|
o.props?.attrs?.name,
|
|
@@ -1176,68 +1176,68 @@ function Be(e, t) {
|
|
|
1176
1176
|
o.props?.props?.name,
|
|
1177
1177
|
o.props?.props?.dataKey,
|
|
1178
1178
|
o.props?.props?.["data-key"]
|
|
1179
|
-
].find((
|
|
1180
|
-
|
|
1179
|
+
].find((h) => h != null) ?? "";
|
|
1180
|
+
c = f ? `${t}:${b}:${f}` : `${t}:${b}`;
|
|
1181
1181
|
}
|
|
1182
|
-
let u =
|
|
1182
|
+
let u = c, m = 1;
|
|
1183
1183
|
for (; s.has(u); )
|
|
1184
|
-
u = `${
|
|
1184
|
+
u = `${c}#${m++}`;
|
|
1185
1185
|
s.add(u);
|
|
1186
1186
|
let g = o.children;
|
|
1187
1187
|
return Array.isArray(g) && (g = Be(g, u)), { ...o, key: u, children: g };
|
|
1188
1188
|
});
|
|
1189
1189
|
}
|
|
1190
1190
|
const r = e;
|
|
1191
|
-
let
|
|
1192
|
-
return Array.isArray(
|
|
1191
|
+
let n = r.props?.key ?? r.key ?? t, i = r.children;
|
|
1192
|
+
return Array.isArray(i) && (i = Be(i, n)), { ...r, key: n, children: i };
|
|
1193
1193
|
}
|
|
1194
|
-
function Ve(e, t, r,
|
|
1195
|
-
const
|
|
1196
|
-
n,
|
|
1194
|
+
function Ve(e, t, r, n) {
|
|
1195
|
+
const i = r.directives ?? {}, s = at(
|
|
1197
1196
|
i,
|
|
1197
|
+
n,
|
|
1198
1198
|
e,
|
|
1199
1199
|
r.attrs
|
|
1200
1200
|
), o = {
|
|
1201
1201
|
...t.props,
|
|
1202
1202
|
...r.props,
|
|
1203
1203
|
...s.props
|
|
1204
|
-
},
|
|
1204
|
+
}, c = {
|
|
1205
1205
|
...t.attrs,
|
|
1206
1206
|
...r.attrs,
|
|
1207
1207
|
...s.attrs
|
|
1208
1208
|
}, u = t.props ?? {}, m = o, g = r?.isCustomElement ?? t?.isCustomElement ?? !1;
|
|
1209
1209
|
let b = !1;
|
|
1210
|
-
for (const
|
|
1211
|
-
const
|
|
1212
|
-
if (
|
|
1213
|
-
if (b = !0,
|
|
1210
|
+
for (const h in { ...u, ...m }) {
|
|
1211
|
+
const v = u[h], w = m[h];
|
|
1212
|
+
if (v !== w)
|
|
1213
|
+
if (b = !0, h === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement))
|
|
1214
1214
|
e.value !== w && (e.value = w ?? "");
|
|
1215
|
-
else if (
|
|
1215
|
+
else if (h === "checked" && e instanceof HTMLInputElement)
|
|
1216
1216
|
e.checked = !!w;
|
|
1217
|
-
else if (
|
|
1218
|
-
const
|
|
1219
|
-
typeof
|
|
1217
|
+
else if (h.startsWith("on") && typeof w == "function") {
|
|
1218
|
+
const a = ot(h);
|
|
1219
|
+
typeof v == "function" && se.removeListener(e, a, v), se.addListener(e, a, w);
|
|
1220
1220
|
} else if (w == null)
|
|
1221
|
-
e.removeAttribute(
|
|
1222
|
-
else if ((r?.isCustomElement ?? t?.isCustomElement ?? !1) ||
|
|
1221
|
+
e.removeAttribute(h);
|
|
1222
|
+
else if ((r?.isCustomElement ?? t?.isCustomElement ?? !1) || h in e)
|
|
1223
1223
|
try {
|
|
1224
|
-
e[
|
|
1224
|
+
e[h] = w;
|
|
1225
1225
|
} catch {
|
|
1226
1226
|
}
|
|
1227
1227
|
else
|
|
1228
|
-
w === !1 && e.removeAttribute(
|
|
1228
|
+
w === !1 && e.removeAttribute(h);
|
|
1229
1229
|
}
|
|
1230
|
-
for (const [
|
|
1230
|
+
for (const [h, v] of Object.entries(
|
|
1231
1231
|
s.listeners || {}
|
|
1232
1232
|
))
|
|
1233
|
-
|
|
1234
|
-
const p = t.attrs ?? {},
|
|
1235
|
-
for (const
|
|
1236
|
-
const
|
|
1237
|
-
let
|
|
1238
|
-
if (ee(
|
|
1239
|
-
if (b = !0,
|
|
1240
|
-
if (e.removeAttribute(
|
|
1233
|
+
se.addListener(e, h, v);
|
|
1234
|
+
const p = t.attrs ?? {}, f = c;
|
|
1235
|
+
for (const h in { ...p, ...f }) {
|
|
1236
|
+
const v = p[h], w = f[h];
|
|
1237
|
+
let a = v, l = w;
|
|
1238
|
+
if (ee(v) && (a = v.value), ee(w) && (l = w.value), a !== l)
|
|
1239
|
+
if (b = !0, l == null || l === !1) {
|
|
1240
|
+
if (e.removeAttribute(h), h === "value") {
|
|
1241
1241
|
if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement)
|
|
1242
1242
|
try {
|
|
1243
1243
|
e.value = "";
|
|
@@ -1254,66 +1254,66 @@ function Ve(e, t, r, i) {
|
|
|
1254
1254
|
} catch {
|
|
1255
1255
|
}
|
|
1256
1256
|
}
|
|
1257
|
-
if (
|
|
1257
|
+
if (h === "checked" && e instanceof HTMLInputElement)
|
|
1258
1258
|
try {
|
|
1259
1259
|
e.checked = !1;
|
|
1260
1260
|
} catch {
|
|
1261
1261
|
}
|
|
1262
|
-
if (
|
|
1262
|
+
if (h === "disabled")
|
|
1263
1263
|
try {
|
|
1264
1264
|
e.disabled = !1;
|
|
1265
1265
|
} catch {
|
|
1266
1266
|
}
|
|
1267
1267
|
} else {
|
|
1268
|
-
if (
|
|
1268
|
+
if (h === "value") {
|
|
1269
1269
|
if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement) {
|
|
1270
1270
|
try {
|
|
1271
|
-
e.value =
|
|
1271
|
+
e.value = l ?? "";
|
|
1272
1272
|
} catch {
|
|
1273
|
-
e.setAttribute(
|
|
1273
|
+
e.setAttribute(h, String(l));
|
|
1274
1274
|
}
|
|
1275
1275
|
continue;
|
|
1276
1276
|
} else if (e instanceof HTMLSelectElement) {
|
|
1277
1277
|
try {
|
|
1278
|
-
e.value =
|
|
1278
|
+
e.value = l ?? "";
|
|
1279
1279
|
} catch {
|
|
1280
1280
|
}
|
|
1281
1281
|
continue;
|
|
1282
1282
|
} else if (e instanceof HTMLProgressElement) {
|
|
1283
1283
|
try {
|
|
1284
|
-
e.value = Number(
|
|
1284
|
+
e.value = Number(l);
|
|
1285
1285
|
} catch {
|
|
1286
1286
|
}
|
|
1287
1287
|
continue;
|
|
1288
1288
|
}
|
|
1289
1289
|
}
|
|
1290
|
-
if (
|
|
1290
|
+
if (h === "checked" && e instanceof HTMLInputElement) {
|
|
1291
1291
|
try {
|
|
1292
|
-
e.checked = !!
|
|
1292
|
+
e.checked = !!l;
|
|
1293
1293
|
} catch {
|
|
1294
1294
|
}
|
|
1295
1295
|
continue;
|
|
1296
1296
|
}
|
|
1297
|
-
if (
|
|
1298
|
-
e.setAttribute(
|
|
1297
|
+
if (h === "style") {
|
|
1298
|
+
e.setAttribute(h, String(l));
|
|
1299
1299
|
continue;
|
|
1300
1300
|
}
|
|
1301
1301
|
const y = e.namespaceURI === "http://www.w3.org/2000/svg";
|
|
1302
|
-
if (g && !y &&
|
|
1303
|
-
const
|
|
1302
|
+
if (g && !y && h.includes("-")) {
|
|
1303
|
+
const $ = it(h);
|
|
1304
1304
|
try {
|
|
1305
|
-
e[
|
|
1305
|
+
e[$] = l;
|
|
1306
1306
|
} catch {
|
|
1307
|
-
e.setAttribute(
|
|
1307
|
+
e.setAttribute(h, String(l));
|
|
1308
1308
|
}
|
|
1309
|
-
} else if (!y &&
|
|
1309
|
+
} else if (!y && h in e)
|
|
1310
1310
|
try {
|
|
1311
|
-
e[
|
|
1311
|
+
e[h] = l;
|
|
1312
1312
|
} catch {
|
|
1313
|
-
e.setAttribute(
|
|
1313
|
+
e.setAttribute(h, String(l));
|
|
1314
1314
|
}
|
|
1315
1315
|
else
|
|
1316
|
-
e.setAttribute(
|
|
1316
|
+
e.setAttribute(h, String(l));
|
|
1317
1317
|
}
|
|
1318
1318
|
}
|
|
1319
1319
|
if (g && b)
|
|
@@ -1337,226 +1337,226 @@ function X(e, t, r) {
|
|
|
1337
1337
|
return e.key != null && (p.key = e.key), p;
|
|
1338
1338
|
}
|
|
1339
1339
|
if (e.tag === "#anchor") {
|
|
1340
|
-
const p = e,
|
|
1341
|
-
p.key != null && (
|
|
1340
|
+
const p = e, f = Array.isArray(p.children) ? p.children : [], h = document.createTextNode(""), v = document.createTextNode("");
|
|
1341
|
+
p.key != null && (h.key = `${p.key}:start`, v.key = `${p.key}:end`), p._startNode = h, p._endNode = v;
|
|
1342
1342
|
const w = document.createDocumentFragment();
|
|
1343
|
-
w.appendChild(
|
|
1344
|
-
for (const
|
|
1345
|
-
const
|
|
1346
|
-
w.appendChild(
|
|
1347
|
-
}
|
|
1348
|
-
return w.appendChild(
|
|
1349
|
-
}
|
|
1350
|
-
const
|
|
1351
|
-
e.key != null && (
|
|
1352
|
-
const { props:
|
|
1353
|
-
...
|
|
1354
|
-
...
|
|
1343
|
+
w.appendChild(h);
|
|
1344
|
+
for (const a of f) {
|
|
1345
|
+
const l = X(a, t);
|
|
1346
|
+
w.appendChild(l);
|
|
1347
|
+
}
|
|
1348
|
+
return w.appendChild(v), w;
|
|
1349
|
+
}
|
|
1350
|
+
const n = document.createElement(e.tag);
|
|
1351
|
+
e.key != null && (n.key = e.key);
|
|
1352
|
+
const { props: i = {}, attrs: s = {}, directives: o = {} } = e.props ?? {}, c = at(o, t, n, s), u = {
|
|
1353
|
+
...i,
|
|
1354
|
+
...c.props
|
|
1355
1355
|
}, m = {
|
|
1356
1356
|
...s,
|
|
1357
|
-
...
|
|
1358
|
-
}, g =
|
|
1357
|
+
...c.attrs
|
|
1358
|
+
}, g = n.namespaceURI === "http://www.w3.org/2000/svg";
|
|
1359
1359
|
for (const p in m) {
|
|
1360
|
-
const
|
|
1360
|
+
const f = m[p];
|
|
1361
1361
|
if (!(typeof p != "string" || /\[object Object\]/.test(p))) {
|
|
1362
|
-
if (typeof
|
|
1363
|
-
|
|
1364
|
-
else if (
|
|
1365
|
-
if (!g && p === "value" && (
|
|
1362
|
+
if (typeof f == "boolean")
|
|
1363
|
+
f && n.setAttribute(p, "");
|
|
1364
|
+
else if (f != null)
|
|
1365
|
+
if (!g && p === "value" && (n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n instanceof HTMLSelectElement || n instanceof HTMLProgressElement))
|
|
1366
1366
|
try {
|
|
1367
|
-
|
|
1367
|
+
n instanceof HTMLProgressElement ? n.value = Number(f) : n.value = f ?? "";
|
|
1368
1368
|
} catch {
|
|
1369
|
-
|
|
1369
|
+
n.setAttribute(p, String(f));
|
|
1370
1370
|
}
|
|
1371
|
-
else if (!g && p === "checked" &&
|
|
1371
|
+
else if (!g && p === "checked" && n instanceof HTMLInputElement)
|
|
1372
1372
|
try {
|
|
1373
|
-
|
|
1373
|
+
n.checked = !!f;
|
|
1374
1374
|
} catch {
|
|
1375
|
-
|
|
1375
|
+
n.setAttribute(p, String(f));
|
|
1376
1376
|
}
|
|
1377
|
-
else if (!g && p in
|
|
1377
|
+
else if (!g && p in n)
|
|
1378
1378
|
try {
|
|
1379
|
-
|
|
1379
|
+
n[p] = f;
|
|
1380
1380
|
} catch {
|
|
1381
|
-
|
|
1381
|
+
n.setAttribute(p, String(f));
|
|
1382
1382
|
}
|
|
1383
1383
|
else if ((e.props?.isCustomElement ?? !1) && !g && p.includes("-")) {
|
|
1384
|
-
const
|
|
1384
|
+
const v = it(p);
|
|
1385
1385
|
try {
|
|
1386
|
-
|
|
1386
|
+
n[v] = f;
|
|
1387
1387
|
} catch {
|
|
1388
|
-
|
|
1388
|
+
n.setAttribute(p, String(f));
|
|
1389
1389
|
}
|
|
1390
1390
|
} else
|
|
1391
|
-
|
|
1391
|
+
n.setAttribute(p, String(f));
|
|
1392
1392
|
}
|
|
1393
1393
|
}
|
|
1394
1394
|
for (const p in u) {
|
|
1395
|
-
const
|
|
1395
|
+
const f = u[p];
|
|
1396
1396
|
if (!(typeof p != "string" || /\[object Object\]/.test(p)))
|
|
1397
|
-
if (p === "value" && (
|
|
1398
|
-
const
|
|
1399
|
-
|
|
1400
|
-
} else if (p === "checked" &&
|
|
1401
|
-
const
|
|
1402
|
-
|
|
1403
|
-
} else if (p.startsWith("on") && typeof
|
|
1404
|
-
|
|
1397
|
+
if (p === "value" && (n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n instanceof HTMLSelectElement)) {
|
|
1398
|
+
const h = typeof f == "object" && f !== null && typeof f.value < "u" ? f.value : f;
|
|
1399
|
+
n.value = h ?? "";
|
|
1400
|
+
} else if (p === "checked" && n instanceof HTMLInputElement) {
|
|
1401
|
+
const h = typeof f == "object" && f !== null && typeof f.value < "u" ? f.value : f;
|
|
1402
|
+
n.checked = !!h;
|
|
1403
|
+
} else if (p.startsWith("on") && typeof f == "function")
|
|
1404
|
+
se.addListener(n, ot(p), f);
|
|
1405
1405
|
else {
|
|
1406
|
-
if (p.startsWith("on") &&
|
|
1406
|
+
if (p.startsWith("on") && f === void 0)
|
|
1407
1407
|
continue;
|
|
1408
|
-
if (
|
|
1409
|
-
|
|
1410
|
-
else if ((e.props?.isCustomElement ?? !1) || p in
|
|
1408
|
+
if (f == null || f === !1)
|
|
1409
|
+
n.removeAttribute(p);
|
|
1410
|
+
else if ((e.props?.isCustomElement ?? !1) || p in n)
|
|
1411
1411
|
try {
|
|
1412
|
-
const
|
|
1413
|
-
|
|
1412
|
+
const v = typeof f == "object" && f !== null && typeof f.value < "u" ? f.value : f;
|
|
1413
|
+
n[p] = v;
|
|
1414
1414
|
} catch {
|
|
1415
1415
|
}
|
|
1416
1416
|
}
|
|
1417
1417
|
}
|
|
1418
|
-
for (const [p,
|
|
1419
|
-
|
|
1418
|
+
for (const [p, f] of Object.entries(
|
|
1419
|
+
c.listeners || {}
|
|
1420
1420
|
))
|
|
1421
|
-
|
|
1421
|
+
se.addListener(n, p, f);
|
|
1422
1422
|
const b = {
|
|
1423
1423
|
...e,
|
|
1424
1424
|
props: {
|
|
1425
1425
|
...e.props,
|
|
1426
|
-
...
|
|
1426
|
+
...c.props
|
|
1427
1427
|
}
|
|
1428
1428
|
};
|
|
1429
|
-
pe(b,
|
|
1429
|
+
pe(b, n, r);
|
|
1430
1430
|
try {
|
|
1431
|
-
if (typeof
|
|
1431
|
+
if (typeof n._applyProps == "function")
|
|
1432
1432
|
try {
|
|
1433
|
-
|
|
1433
|
+
n._applyProps(n._cfg);
|
|
1434
1434
|
} catch {
|
|
1435
1435
|
}
|
|
1436
|
-
typeof
|
|
1436
|
+
typeof n.requestRender == "function" ? n.requestRender() : typeof n._render == "function" && n._render(n._cfg);
|
|
1437
1437
|
} catch {
|
|
1438
1438
|
}
|
|
1439
1439
|
if (Array.isArray(e.children))
|
|
1440
1440
|
for (const p of e.children)
|
|
1441
|
-
|
|
1442
|
-
else typeof e.children == "string" && (
|
|
1441
|
+
n.appendChild(X(p, t, r));
|
|
1442
|
+
else typeof e.children == "string" && (n.textContent = e.children);
|
|
1443
1443
|
try {
|
|
1444
|
-
if (
|
|
1444
|
+
if (n instanceof HTMLSelectElement && m && m.hasOwnProperty("value"))
|
|
1445
1445
|
try {
|
|
1446
|
-
|
|
1446
|
+
n.value = m.value ?? "";
|
|
1447
1447
|
} catch {
|
|
1448
1448
|
}
|
|
1449
1449
|
} catch {
|
|
1450
1450
|
}
|
|
1451
|
-
return
|
|
1451
|
+
return n;
|
|
1452
1452
|
}
|
|
1453
|
-
function Rt(e, t, r,
|
|
1453
|
+
function Rt(e, t, r, n, i) {
|
|
1454
1454
|
if (typeof r == "string") {
|
|
1455
1455
|
e.textContent !== r && (e.textContent = r);
|
|
1456
1456
|
return;
|
|
1457
1457
|
}
|
|
1458
1458
|
if (!Array.isArray(r)) return;
|
|
1459
|
-
const s = Array.from(e.childNodes), o = Array.isArray(t) ? t : [],
|
|
1460
|
-
for (const
|
|
1461
|
-
|
|
1459
|
+
const s = Array.from(e.childNodes), o = Array.isArray(t) ? t : [], c = /* @__PURE__ */ new Map();
|
|
1460
|
+
for (const f of o)
|
|
1461
|
+
f && f.key != null && c.set(f.key, f);
|
|
1462
1462
|
const u = /* @__PURE__ */ new Map();
|
|
1463
|
-
for (const
|
|
1464
|
-
const
|
|
1465
|
-
|
|
1463
|
+
for (const f of s) {
|
|
1464
|
+
const h = f.key;
|
|
1465
|
+
h != null && u.set(h, f);
|
|
1466
1466
|
}
|
|
1467
1467
|
const m = /* @__PURE__ */ new Set();
|
|
1468
1468
|
let g = e.firstChild;
|
|
1469
|
-
function b(
|
|
1470
|
-
let
|
|
1471
|
-
for (;
|
|
1472
|
-
|
|
1473
|
-
}
|
|
1474
|
-
function p(
|
|
1475
|
-
const
|
|
1476
|
-
let
|
|
1477
|
-
for (;
|
|
1478
|
-
|
|
1479
|
-
const y = Array.isArray(
|
|
1480
|
-
if (w.some((
|
|
1481
|
-
const
|
|
1469
|
+
function b(f, h) {
|
|
1470
|
+
let v = f;
|
|
1471
|
+
for (; v && (m.add(v), v !== h); )
|
|
1472
|
+
v = v.nextSibling;
|
|
1473
|
+
}
|
|
1474
|
+
function p(f, h, v, w) {
|
|
1475
|
+
const a = [];
|
|
1476
|
+
let l = f.nextSibling;
|
|
1477
|
+
for (; l && l !== h; )
|
|
1478
|
+
a.push(l), l = l.nextSibling;
|
|
1479
|
+
const y = Array.isArray(v) ? v : [];
|
|
1480
|
+
if (w.some((k) => k && k.key != null) || y.some((k) => k && k.key != null)) {
|
|
1481
|
+
const k = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
|
|
1482
1482
|
for (const C of y)
|
|
1483
|
-
C && C.key != null &&
|
|
1484
|
-
for (const C of
|
|
1483
|
+
C && C.key != null && k.set(C.key, C);
|
|
1484
|
+
for (const C of a) {
|
|
1485
1485
|
const E = C.key;
|
|
1486
|
-
E != null &&
|
|
1486
|
+
E != null && d.set(E, C);
|
|
1487
1487
|
}
|
|
1488
|
-
const
|
|
1489
|
-
let A =
|
|
1488
|
+
const x = /* @__PURE__ */ new Set();
|
|
1489
|
+
let A = f.nextSibling;
|
|
1490
1490
|
for (const C of w) {
|
|
1491
1491
|
let E;
|
|
1492
|
-
if (C.key != null &&
|
|
1493
|
-
const T =
|
|
1492
|
+
if (C.key != null && d.has(C.key)) {
|
|
1493
|
+
const T = k.get(C.key);
|
|
1494
1494
|
E = Ee(
|
|
1495
|
-
|
|
1495
|
+
d.get(C.key),
|
|
1496
1496
|
T,
|
|
1497
1497
|
C,
|
|
1498
|
-
|
|
1499
|
-
),
|
|
1498
|
+
n
|
|
1499
|
+
), x.add(E), E !== A && e.contains(E) && e.insertBefore(E, A);
|
|
1500
1500
|
} else
|
|
1501
|
-
E = X(C,
|
|
1501
|
+
E = X(C, n), e.insertBefore(E, A), x.add(E);
|
|
1502
1502
|
A = E.nextSibling;
|
|
1503
1503
|
}
|
|
1504
|
-
for (const C of
|
|
1505
|
-
!
|
|
1504
|
+
for (const C of a)
|
|
1505
|
+
!x.has(C) && e.contains(C) && e.removeChild(C);
|
|
1506
1506
|
} else {
|
|
1507
|
-
const
|
|
1507
|
+
const k = Math.min(
|
|
1508
1508
|
y.length,
|
|
1509
1509
|
w.length
|
|
1510
1510
|
);
|
|
1511
|
-
for (let
|
|
1512
|
-
const
|
|
1513
|
-
C !==
|
|
1511
|
+
for (let d = 0; d < k; d++) {
|
|
1512
|
+
const x = y[d], A = w[d], C = Ee(a[d], x, A, n);
|
|
1513
|
+
C !== a[d] && (e.insertBefore(C, a[d]), e.removeChild(a[d]));
|
|
1514
1514
|
}
|
|
1515
|
-
for (let
|
|
1516
|
-
e.insertBefore(X(w[
|
|
1517
|
-
for (let
|
|
1518
|
-
e.removeChild(
|
|
1519
|
-
}
|
|
1520
|
-
}
|
|
1521
|
-
for (const
|
|
1522
|
-
let
|
|
1523
|
-
if (
|
|
1524
|
-
const
|
|
1525
|
-
let
|
|
1526
|
-
const
|
|
1527
|
-
if (
|
|
1528
|
-
e.insertBefore(
|
|
1529
|
-
for (const
|
|
1530
|
-
e.insertBefore(X(
|
|
1515
|
+
for (let d = k; d < w.length; d++)
|
|
1516
|
+
e.insertBefore(X(w[d], n), h);
|
|
1517
|
+
for (let d = k; d < a.length; d++)
|
|
1518
|
+
e.removeChild(a[d]);
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
for (const f of r) {
|
|
1522
|
+
let h;
|
|
1523
|
+
if (f.tag === "#anchor") {
|
|
1524
|
+
const v = f.key, w = `${v}:start`, a = `${v}:end`;
|
|
1525
|
+
let l = u.get(w), y = u.get(a);
|
|
1526
|
+
const $ = Array.isArray(f.children) ? f.children : [];
|
|
1527
|
+
if (l || (l = document.createTextNode(""), l.key = w), y || (y = document.createTextNode(""), y.key = a), f._startNode = l, f._endNode = y, !e.contains(l) || !e.contains(y)) {
|
|
1528
|
+
e.insertBefore(l, g);
|
|
1529
|
+
for (const k of $)
|
|
1530
|
+
e.insertBefore(X(k, n), g);
|
|
1531
1531
|
e.insertBefore(y, g);
|
|
1532
1532
|
} else
|
|
1533
1533
|
p(
|
|
1534
|
-
|
|
1534
|
+
l,
|
|
1535
1535
|
y,
|
|
1536
|
-
|
|
1537
|
-
|
|
1536
|
+
c.get(v)?.children,
|
|
1537
|
+
$
|
|
1538
1538
|
);
|
|
1539
|
-
b(
|
|
1539
|
+
b(l, y), g = y.nextSibling;
|
|
1540
1540
|
continue;
|
|
1541
1541
|
}
|
|
1542
|
-
if (
|
|
1543
|
-
const
|
|
1544
|
-
|
|
1545
|
-
u.get(
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
), m.add(
|
|
1542
|
+
if (f.key != null && u.has(f.key)) {
|
|
1543
|
+
const v = c.get(f.key);
|
|
1544
|
+
h = Ee(
|
|
1545
|
+
u.get(f.key),
|
|
1546
|
+
v,
|
|
1547
|
+
f,
|
|
1548
|
+
n,
|
|
1549
|
+
i
|
|
1550
|
+
), m.add(h), h !== g && e.contains(h) && (g && !e.contains(g) && (g = null), e.insertBefore(h, g));
|
|
1551
1551
|
} else
|
|
1552
|
-
|
|
1553
|
-
g =
|
|
1552
|
+
h = X(f, n, i), g && !e.contains(g) && (g = null), e.insertBefore(h, g), m.add(h);
|
|
1553
|
+
g = h.nextSibling;
|
|
1554
1554
|
}
|
|
1555
|
-
for (const
|
|
1556
|
-
!m.has(
|
|
1555
|
+
for (const f of s)
|
|
1556
|
+
!m.has(f) && e.contains(f) && (le(f, i), e.removeChild(f));
|
|
1557
1557
|
}
|
|
1558
|
-
function Ee(e, t, r,
|
|
1559
|
-
if (t && typeof t != "string" && t.props?.ref &&
|
|
1558
|
+
function Ee(e, t, r, n, i) {
|
|
1559
|
+
if (t && typeof t != "string" && t.props?.ref && i && le(e, i), t === r) return e;
|
|
1560
1560
|
if (typeof r == "string") {
|
|
1561
1561
|
if (e.nodeType === Node.TEXT_NODE)
|
|
1562
1562
|
return e.textContent !== r && (e.textContent = r), e;
|
|
@@ -1566,84 +1566,84 @@ function Ee(e, t, r, i, n) {
|
|
|
1566
1566
|
}
|
|
1567
1567
|
}
|
|
1568
1568
|
if (r && typeof r != "string" && r.tag === "#anchor") {
|
|
1569
|
-
const o = r,
|
|
1569
|
+
const o = r, c = Array.isArray(o.children) ? o.children : [], u = o._startNode ?? document.createTextNode(""), m = o._endNode ?? document.createTextNode("");
|
|
1570
1570
|
o.key != null && (u.key = `${o.key}:start`, m.key = `${o.key}:end`), o._startNode = u, o._endNode = m;
|
|
1571
1571
|
const g = document.createDocumentFragment();
|
|
1572
1572
|
g.appendChild(u);
|
|
1573
|
-
for (const b of
|
|
1574
|
-
const p = X(b,
|
|
1573
|
+
for (const b of c) {
|
|
1574
|
+
const p = X(b, n);
|
|
1575
1575
|
g.appendChild(p);
|
|
1576
1576
|
}
|
|
1577
1577
|
return g.appendChild(m), e.parentNode?.replaceChild(g, e), u;
|
|
1578
1578
|
}
|
|
1579
1579
|
if (!r) {
|
|
1580
|
-
|
|
1580
|
+
le(e, i);
|
|
1581
1581
|
const o = document.createComment("removed");
|
|
1582
1582
|
return e.parentNode?.replaceChild(o, e), o;
|
|
1583
1583
|
}
|
|
1584
1584
|
if (!t || typeof t == "string") {
|
|
1585
|
-
|
|
1586
|
-
const o = X(r,
|
|
1587
|
-
return pe(r, o,
|
|
1585
|
+
le(e, i);
|
|
1586
|
+
const o = X(r, n, i);
|
|
1587
|
+
return pe(r, o, i), e.parentNode?.replaceChild(o, e), o;
|
|
1588
1588
|
}
|
|
1589
1589
|
if (r.tag === "#anchor") {
|
|
1590
|
-
const o = Array.isArray(r.children) ? r.children : [],
|
|
1591
|
-
r.key != null && (
|
|
1590
|
+
const o = Array.isArray(r.children) ? r.children : [], c = r._startNode ?? document.createTextNode(""), u = r._endNode ?? document.createTextNode("");
|
|
1591
|
+
r.key != null && (c.key = `${r.key}:start`, u.key = `${r.key}:end`), r._startNode = c, r._endNode = u;
|
|
1592
1592
|
const m = document.createDocumentFragment();
|
|
1593
|
-
m.appendChild(
|
|
1593
|
+
m.appendChild(c);
|
|
1594
1594
|
for (const g of o)
|
|
1595
|
-
m.appendChild(X(g,
|
|
1596
|
-
return m.appendChild(u), e.parentNode?.replaceChild(m, e),
|
|
1595
|
+
m.appendChild(X(g, n));
|
|
1596
|
+
return m.appendChild(u), e.parentNode?.replaceChild(m, e), c;
|
|
1597
1597
|
}
|
|
1598
1598
|
if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && t.key === r.key) {
|
|
1599
1599
|
const o = e;
|
|
1600
|
-
return Ve(o, t.props || {}, r.props || {},
|
|
1600
|
+
return Ve(o, t.props || {}, r.props || {}, n), Rt(o, t.children, r.children, n, i), pe(r, o, i), o;
|
|
1601
1601
|
}
|
|
1602
1602
|
if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && (t.tag && String(t.tag).includes("-") || r.props && r.props.isCustomElement || t.props && t.props.isCustomElement))
|
|
1603
1603
|
try {
|
|
1604
|
-
const
|
|
1605
|
-
return Ve(
|
|
1604
|
+
const c = e;
|
|
1605
|
+
return Ve(c, t.props || {}, r.props || {}, n), pe(r, c, i), c;
|
|
1606
1606
|
} catch {
|
|
1607
1607
|
}
|
|
1608
|
-
|
|
1609
|
-
const s = X(r,
|
|
1610
|
-
return pe(r, s,
|
|
1608
|
+
le(e, i);
|
|
1609
|
+
const s = X(r, n, i);
|
|
1610
|
+
return pe(r, s, i), e.parentNode?.replaceChild(s, e), s;
|
|
1611
1611
|
}
|
|
1612
|
-
function Ot(e, t, r,
|
|
1613
|
-
let
|
|
1614
|
-
Array.isArray(t) ? t.length === 1 ? (
|
|
1612
|
+
function Ot(e, t, r, n) {
|
|
1613
|
+
let i;
|
|
1614
|
+
Array.isArray(t) ? t.length === 1 ? (i = t[0], i && typeof i == "object" && i.key == null && (i = { ...i, key: "__root__" })) : i = { tag: "div", key: "__root__", children: t } : (i = t, i && typeof i == "object" && i.key == null && (i = { ...i, key: "__root__" })), i && typeof i == "object" && i.tag === "#anchor" && (i = {
|
|
1615
1615
|
tag: "div",
|
|
1616
1616
|
key: "__anchor_root__",
|
|
1617
1617
|
props: { attrs: { "data-anchor-block-root": "", key: "__anchor_root__" } },
|
|
1618
|
-
children: [
|
|
1619
|
-
}),
|
|
1618
|
+
children: [i]
|
|
1619
|
+
}), i = Be(i, String(i.key ?? "root"));
|
|
1620
1620
|
const s = e._prevVNode ?? null, o = e._prevDom ?? e.firstChild ?? null;
|
|
1621
|
-
let
|
|
1622
|
-
s && o ? typeof s != "string" && typeof
|
|
1621
|
+
let c;
|
|
1622
|
+
s && o ? typeof s != "string" && typeof i != "string" && s.tag === i.tag && s.key === i.key ? c = Ee(o, s, i, r, n) : (c = X(i, r, n), e.replaceChild(c, o)) : (c = X(i, r, n), e.firstChild ? e.replaceChild(c, e.firstChild) : e.appendChild(c));
|
|
1623
1623
|
const u = [];
|
|
1624
1624
|
for (let m = 0; m < e.childNodes.length; m++) {
|
|
1625
1625
|
const g = e.childNodes[m];
|
|
1626
|
-
g !==
|
|
1626
|
+
g !== c && g.nodeName !== "STYLE" && (le(g, n), u.push(g));
|
|
1627
1627
|
}
|
|
1628
|
-
u.forEach((m) => e.removeChild(m)), e._prevVNode =
|
|
1628
|
+
u.forEach((m) => e.removeChild(m)), e._prevVNode = i, e._prevDom = c;
|
|
1629
1629
|
}
|
|
1630
1630
|
function Pe(e) {
|
|
1631
|
-
if (typeof e == "string") return
|
|
1631
|
+
if (typeof e == "string") return de(e);
|
|
1632
1632
|
if (e.tag === "#text")
|
|
1633
|
-
return typeof e.children == "string" ?
|
|
1633
|
+
return typeof e.children == "string" ? de(e.children) : "";
|
|
1634
1634
|
if (e.tag === "#anchor")
|
|
1635
1635
|
return (Array.isArray(e.children) ? e.children.filter(Boolean) : []).map(Pe).join("");
|
|
1636
1636
|
let t = "";
|
|
1637
|
-
e.props && e.props.attrs && (t = Object.entries(e.props.attrs).map(([
|
|
1637
|
+
e.props && e.props.attrs && (t = Object.entries(e.props.attrs).map(([i, s]) => ` ${i}="${de(String(s))}"`).join(""));
|
|
1638
1638
|
let r = "";
|
|
1639
|
-
e.props && (r = Object.entries(e.props).filter(([
|
|
1640
|
-
const
|
|
1641
|
-
return `<${e.tag}${t}${r}>${
|
|
1639
|
+
e.props && (r = Object.entries(e.props).filter(([i]) => i !== "attrs" && i !== "directives" && i !== "ref" && i !== "key").map(([i, s]) => ` ${i}="${de(String(s))}"`).join(""));
|
|
1640
|
+
const n = Array.isArray(e.children) ? e.children.filter(Boolean).map(Pe).join("") : typeof e.children == "string" ? de(e.children) : e.children ? Pe(e.children) : "";
|
|
1641
|
+
return `<${e.tag}${t}${r}>${n}</${e.tag}>`;
|
|
1642
1642
|
}
|
|
1643
1643
|
function Pt(e, ...t) {
|
|
1644
1644
|
let r = "";
|
|
1645
|
-
for (let
|
|
1646
|
-
r += e[
|
|
1645
|
+
for (let n = 0; n < e.length; n++)
|
|
1646
|
+
r += e[n], n < t.length && (r += t[n]);
|
|
1647
1647
|
return r;
|
|
1648
1648
|
}
|
|
1649
1649
|
function ct(e) {
|
|
@@ -1671,7 +1671,7 @@ const Mt = Pt`
|
|
|
1671
1671
|
}
|
|
1672
1672
|
:host {
|
|
1673
1673
|
display: contents;
|
|
1674
|
-
font: 16px/1.5 ui-sans-serif, system-ui, sans-serif;
|
|
1674
|
+
font: 16px/1.5 var(--font-sans, ui-sans-serif, system-ui, sans-serif);
|
|
1675
1675
|
-webkit-text-size-adjust: 100%;
|
|
1676
1676
|
text-size-adjust: 100%;
|
|
1677
1677
|
}
|
|
@@ -1814,13 +1814,13 @@ const Mt = Pt`
|
|
|
1814
1814
|
Object.entries(jt).map(([e, t]) => [
|
|
1815
1815
|
e,
|
|
1816
1816
|
Object.fromEntries(
|
|
1817
|
-
Object.entries(t).map(([r,
|
|
1817
|
+
Object.entries(t).map(([r, n]) => [
|
|
1818
1818
|
r,
|
|
1819
|
-
`var(--color-${e}${r === "DEFAULT" ? "" : `-${r}`}, ${
|
|
1819
|
+
`var(--color-${e}${r === "DEFAULT" ? "" : `-${r}`}, ${n})`
|
|
1820
1820
|
])
|
|
1821
1821
|
)
|
|
1822
1822
|
])
|
|
1823
|
-
),
|
|
1823
|
+
), ce = "0.25rem", Nt = {
|
|
1824
1824
|
// Tailwind container widths
|
|
1825
1825
|
// 3xs: 16rem => 16 / 0.25 = 64
|
|
1826
1826
|
"3xs": 64,
|
|
@@ -1851,18 +1851,18 @@ const Mt = Pt`
|
|
|
1851
1851
|
}, zt = () => {
|
|
1852
1852
|
const e = {};
|
|
1853
1853
|
for (const [t, r] of Object.entries(Nt))
|
|
1854
|
-
e[`max-w-${t}`] = `max-width:calc(${
|
|
1854
|
+
e[`max-w-${t}`] = `max-width:calc(${ce} * ${r});`, e[`min-w-${t}`] = `min-width:calc(${ce} * ${r});`, e[`w-${t}`] = `width:calc(${ce} * ${r});`, e[`max-h-${t}`] = `max-height:calc(${ce} * ${r});`, e[`min-h-${t}`] = `min-height:calc(${ce} * ${r});`, e[`h-${t}`] = `height:calc(${ce} * ${r});`;
|
|
1855
1855
|
return e;
|
|
1856
|
-
},
|
|
1856
|
+
}, It = () => {
|
|
1857
1857
|
const e = {}, t = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
1858
1858
|
for (const r of t)
|
|
1859
1859
|
e[`grid-cols-${r}`] = `grid-template-columns:repeat(${r},minmax(0,1fr));`, e[`grid-rows-${r}`] = `grid-template-rows:repeat(${r},minmax(0,1fr));`, e[`col-span-${r}`] = `grid-column:span ${r} / span ${r};`, e[`row-span-${r}`] = `grid-row:span ${r} / span ${r};`, e[`col-start-${r}`] = `grid-column-start:${r};`, e[`col-end-${r}`] = `grid-column-end:${r};`, e[`row-start-${r}`] = `grid-row-start:${r};`, e[`row-end-${r}`] = `grid-row-end:${r};`;
|
|
1860
1860
|
return e["grid-cols-none"] = "grid-template-columns:none;", e["grid-rows-none"] = "grid-template-rows:none;", e["col-span-full"] = "grid-column:1 / -1;", e["row-span-full"] = "grid-row:1 / -1;", e["auto-cols-auto"] = "grid-auto-columns:auto;", e["auto-cols-min"] = "grid-auto-columns:min-content;", e["auto-cols-max"] = "grid-auto-columns:max-content;", e["auto-cols-fr"] = "grid-auto-columns:1fr;", e["auto-rows-auto"] = "grid-auto-rows:auto;", e["auto-rows-min"] = "grid-auto-rows:min-content;", e["auto-rows-max"] = "grid-auto-rows:max-content;", e["auto-rows-fr"] = "grid-auto-rows:1fr;", e["grid-flow-row"] = "grid-auto-flow:row;", e["grid-flow-col"] = "grid-auto-flow:column;", e["grid-flow-row-dense"] = "grid-auto-flow:row dense;", e["grid-flow-col-dense"] = "grid-auto-flow:column dense;", e;
|
|
1861
|
-
},
|
|
1861
|
+
}, Dt = () => {
|
|
1862
1862
|
const e = {}, t = [0, 1, 2, 4, 6, 8];
|
|
1863
1863
|
for (const r of t) {
|
|
1864
|
-
const
|
|
1865
|
-
e[`border-${r}`] = `border-width:${
|
|
1864
|
+
const n = `${r}px`;
|
|
1865
|
+
e[`border-${r}`] = `border-width:${n};`, e[`border-s-${r}`] = `border-inline-start-width:${n};`, e[`border-e-${r}`] = `border-inline-end-width:${n};`, e[`border-bs-${r}`] = `border-block-start-width:${n};`, e[`border-be-${r}`] = `border-block-end-width:${n};`, e[`border-x-${r}`] = `border-inline-width:${n};`, e[`border-y-${r}`] = `border-block-width:${n};`, e[`border-t-${r}`] = `border-top-width:${n};`, e[`border-r-${r}`] = `border-right-width:${n};`, e[`border-b-${r}`] = `border-bottom-width:${n};`, e[`border-l-${r}`] = `border-left-width:${n};`;
|
|
1866
1866
|
}
|
|
1867
1867
|
return e.border = "border-width:1px;", e["border-t"] = "border-top-width:1px;", e["border-r"] = "border-right-width:1px;", e["border-b"] = "border-bottom-width:1px;", e["border-l"] = "border-left-width:1px;", e["border-x"] = "border-left-width:1px;border-right-width:1px;", e["border-y"] = "border-top-width:1px;border-bottom-width:1px;", e["border-s"] = "border-inline-start-width:1px;", e["border-e"] = "border-inline-end-width:1px;", e["border-bs"] = "border-block-start-width:1px;", e["border-be"] = "border-block-end-width:1px;", e;
|
|
1868
1868
|
}, Ht = () => {
|
|
@@ -1878,9 +1878,9 @@ const Mt = Pt`
|
|
|
1878
1878
|
"4xl": 32,
|
|
1879
1879
|
full: 9999
|
|
1880
1880
|
};
|
|
1881
|
-
for (const [r,
|
|
1882
|
-
const
|
|
1883
|
-
e[`rounded-${r}`] = `border-radius:${
|
|
1881
|
+
for (const [r, n] of Object.entries(t)) {
|
|
1882
|
+
const i = n === 9999 ? "9999px" : `${n / 16}rem`;
|
|
1883
|
+
e[`rounded-${r}`] = `border-radius:${i};`, e[`rounded-s-${r}`] = `border-start-start-radius:${i};border-end-start-radius:${i};`, e[`rounded-e-${r}`] = `border-start-end-radius:${i};border-end-end-radius:${i};`, e[`rounded-t-${r}`] = `border-top-left-radius:${i};border-top-right-radius:${i};`, e[`rounded-r-${r}`] = `border-top-right-radius:${i};border-bottom-right-radius:${i};`, e[`rounded-b-${r}`] = `border-bottom-left-radius:${i};border-bottom-right-radius:${i};`, e[`rounded-l-${r}`] = `border-top-left-radius:${i};border-bottom-left-radius:${i};`, e[`rounded-x-${r}`] = `border-top-left-radius:${i};border-bottom-left-radius:${i};border-top-right-radius:${i};border-bottom-right-radius:${i};`, e[`rounded-y-${r}`] = `border-top-left-radius:${i};border-top-right-radius:${i};border-bottom-left-radius:${i};border-bottom-right-radius:${i};`;
|
|
1884
1884
|
}
|
|
1885
1885
|
return e;
|
|
1886
1886
|
}, Le = {
|
|
@@ -1929,7 +1929,7 @@ const Mt = Pt`
|
|
|
1929
1929
|
"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;",
|
|
1930
1930
|
"not-sr-only": "position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip:auto;white-space:normal;",
|
|
1931
1931
|
/* Grid Layout & Placement */
|
|
1932
|
-
...
|
|
1932
|
+
...It(),
|
|
1933
1933
|
/* Positioning */
|
|
1934
1934
|
absolute: "position:absolute;",
|
|
1935
1935
|
relative: "position:relative;",
|
|
@@ -1966,7 +1966,7 @@ const Mt = Pt`
|
|
|
1966
1966
|
"text-7xl": "font-size:4.5rem;line-height:1",
|
|
1967
1967
|
"text-8xl": "font-size:6rem;line-height:1",
|
|
1968
1968
|
/* Borders */
|
|
1969
|
-
...
|
|
1969
|
+
...Dt(),
|
|
1970
1970
|
...Ht(),
|
|
1971
1971
|
/* Shadow and effects */
|
|
1972
1972
|
// Shadows use a CSS variable for color so color utilities can modify --ce-shadow-color
|
|
@@ -2019,9 +2019,9 @@ const Mt = Pt`
|
|
|
2019
2019
|
"grow-0": "flex-grow:0;",
|
|
2020
2020
|
"shrink-0": "flex-shrink:0;",
|
|
2021
2021
|
/* Font Family */
|
|
2022
|
-
"font-sans": "font-family:ui-sans-serif,system-ui,sans-serif;",
|
|
2023
|
-
"font-serif": "font-family:ui-serif,Georgia,serif;",
|
|
2024
|
-
"font-mono": "font-family:ui-monospace,SFMono-Regular,monospace;",
|
|
2022
|
+
"font-sans": "font-family:var(--font-sans, ui-sans-serif,system-ui,sans-serif);",
|
|
2023
|
+
"font-serif": "font-family:var(--font-serif, ui-serif,Georgia,serif);",
|
|
2024
|
+
"font-mono": "font-family:var(--font-mono, ui-monospace,SFMono-Regular,monospace);",
|
|
2025
2025
|
/* Line Clamp (for webkit) */
|
|
2026
2026
|
"line-clamp-1": "display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;",
|
|
2027
2027
|
"line-clamp-2": "display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;",
|
|
@@ -2084,15 +2084,15 @@ const Mt = Pt`
|
|
|
2084
2084
|
"gap-y": ["row-gap"]
|
|
2085
2085
|
};
|
|
2086
2086
|
function G(e, t) {
|
|
2087
|
-
let r = 0,
|
|
2088
|
-
for (let
|
|
2089
|
-
const s = e[
|
|
2087
|
+
let r = 0, n = 0;
|
|
2088
|
+
for (let i = 0; i < e.length; i++) {
|
|
2089
|
+
const s = e[i];
|
|
2090
2090
|
if (s === "[") r++;
|
|
2091
2091
|
else if (s === "]" && r > 0) r--;
|
|
2092
|
-
else if (s === "(")
|
|
2093
|
-
else if (s === ")" &&
|
|
2094
|
-
else if (r === 0 &&
|
|
2095
|
-
return e.slice(0,
|
|
2092
|
+
else if (s === "(") n++;
|
|
2093
|
+
else if (s === ")" && n > 0) n--;
|
|
2094
|
+
else if (r === 0 && n === 0 && (s === ">" || s === "+" || s === "~" || s === " "))
|
|
2095
|
+
return e.slice(0, i) + t + e.slice(i);
|
|
2096
2096
|
}
|
|
2097
2097
|
return e + t;
|
|
2098
2098
|
}
|
|
@@ -2130,24 +2130,24 @@ const Bt = {
|
|
|
2130
2130
|
dark: "(prefers-color-scheme: dark)"
|
|
2131
2131
|
}, je = ["sm", "md", "lg", "xl", "2xl"];
|
|
2132
2132
|
function We(e) {
|
|
2133
|
-
const t = e.startsWith("-"),
|
|
2134
|
-
if (
|
|
2135
|
-
const
|
|
2136
|
-
if (Number.isNaN(o) || !Ze[
|
|
2137
|
-
const
|
|
2138
|
-
return Ze[
|
|
2133
|
+
const t = e.startsWith("-"), n = (t ? e.slice(1) : e).split("-");
|
|
2134
|
+
if (n.length < 2) return null;
|
|
2135
|
+
const i = n.slice(0, -1).join("-"), s = n[n.length - 1], o = parseFloat(s);
|
|
2136
|
+
if (Number.isNaN(o) || !Ze[i]) return null;
|
|
2137
|
+
const c = t ? "-" : "";
|
|
2138
|
+
return Ze[i].map((u) => `${u}:calc(${c}${ce} * ${o});`).join("");
|
|
2139
2139
|
}
|
|
2140
2140
|
function Ge(e) {
|
|
2141
|
-
const t = e.replace("#", ""), r = parseInt(t, 16),
|
|
2142
|
-
return `${
|
|
2141
|
+
const t = e.replace("#", ""), r = parseInt(t, 16), n = r >> 16 & 255, i = r >> 8 & 255, s = r & 255;
|
|
2142
|
+
return `${n} ${i} ${s}`;
|
|
2143
2143
|
}
|
|
2144
2144
|
function Ut(e) {
|
|
2145
2145
|
const t = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
|
|
2146
2146
|
if (!t) return null;
|
|
2147
|
-
const [, r,
|
|
2147
|
+
const [, r, n, i = "DEFAULT"] = t, s = Wt[n]?.[i];
|
|
2148
2148
|
if (!s) return null;
|
|
2149
2149
|
if (r === "shadow") return `--ce-shadow-color:${s};`;
|
|
2150
|
-
const
|
|
2150
|
+
const c = {
|
|
2151
2151
|
bg: "background-color",
|
|
2152
2152
|
decoration: "text-decoration-color",
|
|
2153
2153
|
text: "color",
|
|
@@ -2158,35 +2158,35 @@ function Ut(e) {
|
|
|
2158
2158
|
fill: "fill",
|
|
2159
2159
|
stroke: "stroke"
|
|
2160
2160
|
}[r];
|
|
2161
|
-
return
|
|
2161
|
+
return c ? `${c}:${s};` : null;
|
|
2162
2162
|
}
|
|
2163
2163
|
function qt(e) {
|
|
2164
2164
|
const [t, r] = e.split("/");
|
|
2165
2165
|
if (!r) return { base: t };
|
|
2166
|
-
const
|
|
2167
|
-
return isNaN(
|
|
2166
|
+
const n = parseInt(r, 10);
|
|
2167
|
+
return isNaN(n) || n < 0 || n > 100 ? { base: t } : { base: t, opacity: n / 100 };
|
|
2168
2168
|
}
|
|
2169
2169
|
function Ne(e) {
|
|
2170
|
-
const { base: t, opacity: r } = qt(e),
|
|
2171
|
-
if (
|
|
2170
|
+
const { base: t, opacity: r } = qt(e), n = Ut(t);
|
|
2171
|
+
if (n) {
|
|
2172
2172
|
if (r !== void 0) {
|
|
2173
|
-
const s = /#([0-9a-f]{6})/i.exec(
|
|
2173
|
+
const s = /#([0-9a-f]{6})/i.exec(n);
|
|
2174
2174
|
if (s) {
|
|
2175
2175
|
const o = Ge(s[0]);
|
|
2176
|
-
return
|
|
2176
|
+
return n.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
|
|
2177
2177
|
}
|
|
2178
2178
|
}
|
|
2179
|
-
return
|
|
2179
|
+
return n;
|
|
2180
2180
|
}
|
|
2181
|
-
const
|
|
2182
|
-
if (
|
|
2183
|
-
const s = /#([0-9a-f]{6})/i.exec(
|
|
2181
|
+
const i = Se(t);
|
|
2182
|
+
if (i && r !== void 0) {
|
|
2183
|
+
const s = /#([0-9a-f]{6})/i.exec(i);
|
|
2184
2184
|
if (s) {
|
|
2185
2185
|
const o = Ge(s[0]);
|
|
2186
|
-
return
|
|
2186
|
+
return i.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
|
|
2187
2187
|
}
|
|
2188
2188
|
}
|
|
2189
|
-
return
|
|
2189
|
+
return i;
|
|
2190
2190
|
}
|
|
2191
2191
|
function ze(e) {
|
|
2192
2192
|
const t = /^opacity-(\d{1,3})$/.exec(e);
|
|
@@ -2196,19 +2196,19 @@ function ze(e) {
|
|
|
2196
2196
|
}
|
|
2197
2197
|
function Se(e) {
|
|
2198
2198
|
if (e.startsWith("[") && e.endsWith("]") && !e.includes("-[")) {
|
|
2199
|
-
const
|
|
2200
|
-
if (
|
|
2201
|
-
const s =
|
|
2202
|
-
let o =
|
|
2199
|
+
const i = e.slice(1, -1).trim().match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*:(.*)$/);
|
|
2200
|
+
if (i) {
|
|
2201
|
+
const s = i[1].trim();
|
|
2202
|
+
let o = i[2].trim();
|
|
2203
2203
|
return o = o.replace(/url\('\s*([^']*?)\s*'\)/g, 'url("$1")'), o = o.replace(/^'([^']*)'$/g, '"$1"'), `${s}:${o};`;
|
|
2204
2204
|
}
|
|
2205
2205
|
return null;
|
|
2206
2206
|
}
|
|
2207
2207
|
const t = e.indexOf("-["), r = e.endsWith("]");
|
|
2208
2208
|
if (t > 0 && r) {
|
|
2209
|
-
const
|
|
2210
|
-
let
|
|
2211
|
-
|
|
2209
|
+
const n = e.slice(0, t);
|
|
2210
|
+
let i = e.slice(t + 2, -1);
|
|
2211
|
+
i = i.replace(/_/g, " ");
|
|
2212
2212
|
const s = {
|
|
2213
2213
|
bg: "background-color",
|
|
2214
2214
|
text: "color",
|
|
@@ -2253,10 +2253,10 @@ function Se(e) {
|
|
|
2253
2253
|
leading: "line-height",
|
|
2254
2254
|
z: "z-index"
|
|
2255
2255
|
};
|
|
2256
|
-
if (
|
|
2257
|
-
return `transform:rotate(${
|
|
2258
|
-
const o = s[
|
|
2259
|
-
if (o &&
|
|
2256
|
+
if (n === "rotate")
|
|
2257
|
+
return `transform:rotate(${i});`;
|
|
2258
|
+
const o = s[n] ?? n.replace(/_/g, "-");
|
|
2259
|
+
if (o && i) return `${o}:${i};`;
|
|
2260
2260
|
}
|
|
2261
2261
|
return null;
|
|
2262
2262
|
}
|
|
@@ -2277,10 +2277,10 @@ function Kt(e) {
|
|
|
2277
2277
|
}
|
|
2278
2278
|
function Vt(e) {
|
|
2279
2279
|
const t = /class\s*=\s*(['"])(.*?)\1/g, r = [];
|
|
2280
|
-
let
|
|
2281
|
-
for (;
|
|
2282
|
-
const
|
|
2283
|
-
|
|
2280
|
+
let n;
|
|
2281
|
+
for (; n = t.exec(e); ) {
|
|
2282
|
+
const i = n[2].split(/\s+/).filter(Boolean);
|
|
2283
|
+
i.length && r.push(...i);
|
|
2284
2284
|
}
|
|
2285
2285
|
return r.filter(Boolean);
|
|
2286
2286
|
}
|
|
@@ -2288,27 +2288,27 @@ const Xe = /* @__PURE__ */ new Map(), Jt = 16;
|
|
|
2288
2288
|
function Zt(e) {
|
|
2289
2289
|
const t = Date.now(), r = Xe.get(e);
|
|
2290
2290
|
if (r && t - r.timestamp < Jt) return r.css;
|
|
2291
|
-
const
|
|
2292
|
-
function g(w,
|
|
2293
|
-
const
|
|
2294
|
-
if (
|
|
2295
|
-
const y =
|
|
2296
|
-
return m[
|
|
2291
|
+
const n = Vt(e), i = new Set(n), s = [], o = [], c = [], u = [], m = {};
|
|
2292
|
+
function g(w, a = !1) {
|
|
2293
|
+
const l = (a ? "dark|" : "") + w;
|
|
2294
|
+
if (l in m) return m[l];
|
|
2295
|
+
const y = h(w, a);
|
|
2296
|
+
return m[l] = y, y;
|
|
2297
2297
|
}
|
|
2298
2298
|
function b(w) {
|
|
2299
|
-
const
|
|
2300
|
-
return w.length === 0 ? 1 : !
|
|
2299
|
+
const a = w.some((y) => je.includes(y)), l = w.includes("dark");
|
|
2300
|
+
return w.length === 0 ? 1 : !a && !l ? 2 : a && !l ? 3 : 4;
|
|
2301
2301
|
}
|
|
2302
2302
|
function p(w) {
|
|
2303
|
-
const
|
|
2304
|
-
let
|
|
2305
|
-
for (let
|
|
2306
|
-
const
|
|
2307
|
-
|
|
2303
|
+
const a = [];
|
|
2304
|
+
let l = "", y = 0, $ = 0;
|
|
2305
|
+
for (let k = 0; k < w.length; k++) {
|
|
2306
|
+
const d = w[k];
|
|
2307
|
+
d === "[" ? y++ : d === "]" && y > 0 ? y-- : d === "(" ? $++ : d === ")" && $ > 0 && $--, d === ":" && y === 0 && $ === 0 ? (a.push(l), l = "") : l += d;
|
|
2308
2308
|
}
|
|
2309
|
-
return
|
|
2309
|
+
return l && a.push(l), a;
|
|
2310
2310
|
}
|
|
2311
|
-
function
|
|
2311
|
+
function f(w) {
|
|
2312
2312
|
switch (w) {
|
|
2313
2313
|
case "hover":
|
|
2314
2314
|
return ":hover";
|
|
@@ -2338,17 +2338,17 @@ function Zt(e) {
|
|
|
2338
2338
|
return null;
|
|
2339
2339
|
}
|
|
2340
2340
|
}
|
|
2341
|
-
function
|
|
2342
|
-
const
|
|
2341
|
+
function h(w, a = !1) {
|
|
2342
|
+
const l = p(w);
|
|
2343
2343
|
let y = !1;
|
|
2344
|
-
const
|
|
2345
|
-
if (
|
|
2346
|
-
const
|
|
2347
|
-
if (!
|
|
2348
|
-
const
|
|
2349
|
-
let A =
|
|
2350
|
-
|
|
2351
|
-
const C = `.${Kt(w)}`, E = "__SUBJECT__", T = y ?
|
|
2344
|
+
const $ = l.find((_) => (_.startsWith("!") && (y = !0, _ = _.slice(1)), Le[_] || We(_) || ze(_) || Ne(_) || Se(_)));
|
|
2345
|
+
if (!$) return null;
|
|
2346
|
+
const k = $.replace(/^!/, ""), d = Le[k] ?? We(k) ?? ze(k) ?? Ne(k) ?? Se(k);
|
|
2347
|
+
if (!d) return null;
|
|
2348
|
+
const x = l.indexOf($);
|
|
2349
|
+
let A = x >= 0 ? l.slice(0, x) : [];
|
|
2350
|
+
a && (A = A.filter((_) => _ !== "dark"));
|
|
2351
|
+
const C = `.${Kt(w)}`, E = "__SUBJECT__", T = y ? d.replace(/;$/, " !important;") : d;
|
|
2352
2352
|
let R = E;
|
|
2353
2353
|
const S = [];
|
|
2354
2354
|
for (const _ of A)
|
|
@@ -2363,9 +2363,9 @@ function Zt(e) {
|
|
|
2363
2363
|
V = U;
|
|
2364
2364
|
continue;
|
|
2365
2365
|
}
|
|
2366
|
-
const
|
|
2367
|
-
if (
|
|
2368
|
-
V ? B.push(
|
|
2366
|
+
const I = f(_);
|
|
2367
|
+
if (I) {
|
|
2368
|
+
V ? B.push(I) : P.push(I);
|
|
2369
2369
|
continue;
|
|
2370
2370
|
}
|
|
2371
2371
|
const N = Bt[_];
|
|
@@ -2373,20 +2373,20 @@ function Zt(e) {
|
|
|
2373
2373
|
}
|
|
2374
2374
|
function we(_, U) {
|
|
2375
2375
|
if (!U) return _;
|
|
2376
|
-
let
|
|
2376
|
+
let I = 0, N = 0;
|
|
2377
2377
|
if (_.length && (_[0] === ">" || _[0] === "+" || _[0] === "~" || _[0] === " ")) {
|
|
2378
2378
|
let O = 1;
|
|
2379
2379
|
for (; O < _.length && _[O] === " "; ) O++;
|
|
2380
2380
|
for (; O < _.length; O++) {
|
|
2381
|
-
const
|
|
2382
|
-
if (
|
|
2381
|
+
const D = _[O];
|
|
2382
|
+
if (D === "[" ? I++ : D === "]" && I > 0 ? I-- : D === "(" ? N++ : D === ")" && N > 0 && N--, I === 0 && N === 0 && (_[O] === ">" || _[O] === "+" || _[O] === "~" || _[O] === " "))
|
|
2383
2383
|
return _.slice(0, O) + U + _.slice(O);
|
|
2384
2384
|
}
|
|
2385
2385
|
return _ + U;
|
|
2386
2386
|
}
|
|
2387
2387
|
for (let O = 0; O < _.length; O++) {
|
|
2388
|
-
const
|
|
2389
|
-
if (
|
|
2388
|
+
const D = _[O];
|
|
2389
|
+
if (D === "[" ? I++ : D === "]" && I > 0 ? I-- : D === "(" ? N++ : D === ")" && N > 0 && N--, I === 0 && N === 0 && (D === ">" || D === "+" || D === "~" || D === " "))
|
|
2390
2390
|
return _.slice(0, O) + U + _.slice(O);
|
|
2391
2391
|
}
|
|
2392
2392
|
return _ + U;
|
|
@@ -2394,12 +2394,12 @@ function Zt(e) {
|
|
|
2394
2394
|
const K = P.join(""), L = B.join("");
|
|
2395
2395
|
if (V)
|
|
2396
2396
|
if (V.includes("&")) {
|
|
2397
|
-
const _ = V.indexOf("&"), U = V.slice(0, _),
|
|
2397
|
+
const _ = V.indexOf("&"), U = V.slice(0, _), I = V.slice(_ + 1), N = E + K, O = R;
|
|
2398
2398
|
if (P.length === 0)
|
|
2399
|
-
R = O.replace(E, U + N + L +
|
|
2399
|
+
R = O.replace(E, U + N + L + I);
|
|
2400
2400
|
else {
|
|
2401
|
-
const
|
|
2402
|
-
R = O.replace(E, U + N +
|
|
2401
|
+
const D = we(I, L);
|
|
2402
|
+
R = O.replace(E, U + N + D);
|
|
2403
2403
|
}
|
|
2404
2404
|
} else
|
|
2405
2405
|
R = R.replace(E, `${V}${E + K}`), L && (R = R.replace(E, `${E}${L}`));
|
|
@@ -2408,56 +2408,56 @@ function Zt(e) {
|
|
|
2408
2408
|
R = R.replace(new RegExp(E, "g"), C);
|
|
2409
2409
|
let M = `${R}{${T}}`;
|
|
2410
2410
|
const J = A.filter((_) => je.includes(_)), Z = J.length ? J[J.length - 1] : null, z = A.includes("dark");
|
|
2411
|
-
return
|
|
2411
|
+
return a && Z ? M = `@media (prefers-color-scheme: dark) and ${Me[Z]}{${M}}` : a ? M = `@media (prefers-color-scheme: dark){${M}}` : z && Z ? M = `@media (prefers-color-scheme: dark) and ${Me[Z]}{${M}}` : z ? M = `@media (prefers-color-scheme: dark){${M}}` : Z && (M = `@media ${Me[Z]}{${M}}`), M;
|
|
2412
2412
|
}
|
|
2413
|
-
for (const w of
|
|
2414
|
-
const
|
|
2415
|
-
(
|
|
2413
|
+
for (const w of i) {
|
|
2414
|
+
const a = p(w), l = a.find(
|
|
2415
|
+
(d) => Le[d] || We(d) || ze(d) || Ne(d) || Se(d)
|
|
2416
2416
|
);
|
|
2417
|
-
if (!
|
|
2418
|
-
const y =
|
|
2419
|
-
if (
|
|
2420
|
-
const
|
|
2421
|
-
|
|
2417
|
+
if (!l) continue;
|
|
2418
|
+
const y = a.indexOf(l), $ = y >= 0 ? a.slice(0, y) : [], k = b($);
|
|
2419
|
+
if (k === 4) {
|
|
2420
|
+
const d = g(w, !0);
|
|
2421
|
+
d && u.push(d);
|
|
2422
2422
|
} else {
|
|
2423
|
-
const
|
|
2424
|
-
|
|
2423
|
+
const d = g(w);
|
|
2424
|
+
d && (k === 1 ? s.push(d) : k === 2 ? o.push(d) : k === 3 && c.push(d));
|
|
2425
2425
|
}
|
|
2426
2426
|
}
|
|
2427
|
-
const
|
|
2428
|
-
return Xe.set(e, { css:
|
|
2427
|
+
const v = [...s, ...o, ...c, ...u].join("");
|
|
2428
|
+
return Xe.set(e, { css: v, timestamp: t }), v;
|
|
2429
2429
|
}
|
|
2430
2430
|
const ge = [];
|
|
2431
|
-
function Gt(e, t, r,
|
|
2431
|
+
function Gt(e, t, r, n, i, s, o, c) {
|
|
2432
2432
|
if (e) {
|
|
2433
2433
|
ge.push(r);
|
|
2434
2434
|
try {
|
|
2435
2435
|
const u = t.render(r);
|
|
2436
2436
|
if (u instanceof Promise) {
|
|
2437
2437
|
s(!0), u.then((m) => {
|
|
2438
|
-
s(!1), o(null), Ye(e, m, r,
|
|
2438
|
+
s(!1), o(null), Ye(e, m, r, n, i), c(e.innerHTML);
|
|
2439
2439
|
}).catch((m) => {
|
|
2440
2440
|
s(!1), o(m);
|
|
2441
2441
|
});
|
|
2442
2442
|
return;
|
|
2443
2443
|
}
|
|
2444
|
-
Ye(e, u, r,
|
|
2444
|
+
Ye(e, u, r, n, i), c(e.innerHTML);
|
|
2445
2445
|
} finally {
|
|
2446
2446
|
ge.pop();
|
|
2447
2447
|
}
|
|
2448
2448
|
}
|
|
2449
2449
|
}
|
|
2450
|
-
function Ye(e, t, r,
|
|
2450
|
+
function Ye(e, t, r, n, i) {
|
|
2451
2451
|
e && (Ot(
|
|
2452
2452
|
e,
|
|
2453
2453
|
Array.isArray(t) ? t : [t],
|
|
2454
2454
|
r,
|
|
2455
|
-
|
|
2456
|
-
),
|
|
2455
|
+
n
|
|
2456
|
+
), i(e.innerHTML));
|
|
2457
2457
|
}
|
|
2458
|
-
function Xt(e, t, r,
|
|
2458
|
+
function Xt(e, t, r, n, i, s, o) {
|
|
2459
2459
|
if (s !== null && clearTimeout(s), Date.now() - t < 16) {
|
|
2460
|
-
if (
|
|
2460
|
+
if (i(r + 1), r === 15)
|
|
2461
2461
|
console.warn(
|
|
2462
2462
|
`⚠️ Component is re-rendering rapidly. This might indicate:
|
|
2463
2463
|
Common causes:
|
|
@@ -2476,27 +2476,27 @@ Stopping runaway component render to prevent browser freeze`
|
|
|
2476
2476
|
return;
|
|
2477
2477
|
}
|
|
2478
2478
|
} else
|
|
2479
|
-
|
|
2479
|
+
i(0);
|
|
2480
2480
|
const m = setTimeout(() => {
|
|
2481
|
-
|
|
2481
|
+
n(Date.now()), e(), o(null);
|
|
2482
2482
|
}, r > 10 ? 100 : 0);
|
|
2483
2483
|
o(m);
|
|
2484
2484
|
}
|
|
2485
|
-
function Yt(e, t, r,
|
|
2485
|
+
function Yt(e, t, r, n, i) {
|
|
2486
2486
|
if (!e) return;
|
|
2487
2487
|
const s = Zt(r);
|
|
2488
2488
|
if ((!s || s.trim() === "") && !t._computedStyle) {
|
|
2489
|
-
|
|
2489
|
+
i(null), e.adoptedStyleSheets = [Je()];
|
|
2490
2490
|
return;
|
|
2491
2491
|
}
|
|
2492
2492
|
let o = "";
|
|
2493
2493
|
t._computedStyle && (o = t._computedStyle);
|
|
2494
|
-
let
|
|
2494
|
+
let c = Lt(`${o}
|
|
2495
2495
|
${s}
|
|
2496
2496
|
`);
|
|
2497
|
-
|
|
2498
|
-
let u =
|
|
2499
|
-
u || (u = new CSSStyleSheet()), (u.cssRules.length === 0 || u.toString() !==
|
|
2497
|
+
c = ct(c);
|
|
2498
|
+
let u = n;
|
|
2499
|
+
u || (u = new CSSStyleSheet()), (u.cssRules.length === 0 || u.toString() !== c) && u.replaceSync(c), e.adoptedStyleSheets = [Je(), u], i(u);
|
|
2500
2500
|
}
|
|
2501
2501
|
let W = null;
|
|
2502
2502
|
function Qt(e) {
|
|
@@ -2539,7 +2539,7 @@ function wr(e) {
|
|
|
2539
2539
|
throw new Error("useOnError must be called during component render");
|
|
2540
2540
|
ye(W), W._hookCallbacks.onError = e;
|
|
2541
2541
|
}
|
|
2542
|
-
function
|
|
2542
|
+
function vr(e) {
|
|
2543
2543
|
if (!W)
|
|
2544
2544
|
throw new Error("useStyle must be called during component render");
|
|
2545
2545
|
ye(W);
|
|
@@ -2567,9 +2567,7 @@ if (typeof window < "u") {
|
|
|
2567
2567
|
}
|
|
2568
2568
|
function tr(e, t) {
|
|
2569
2569
|
if (!t.render)
|
|
2570
|
-
throw new Error(
|
|
2571
|
-
"Component must have a render function"
|
|
2572
|
-
);
|
|
2570
|
+
throw new Error("Component must have a render function");
|
|
2573
2571
|
return typeof window > "u" ? class {
|
|
2574
2572
|
constructor() {
|
|
2575
2573
|
}
|
|
@@ -2633,58 +2631,53 @@ function tr(e, t) {
|
|
|
2633
2631
|
enumerable: !1,
|
|
2634
2632
|
configurable: !1
|
|
2635
2633
|
}), Object.defineProperty(r, "_triggerWatchers", {
|
|
2636
|
-
value: (
|
|
2634
|
+
value: (i, s) => this._triggerWatchers(i, s),
|
|
2637
2635
|
writable: !1,
|
|
2638
2636
|
enumerable: !1,
|
|
2639
2637
|
configurable: !1
|
|
2640
2638
|
}), this.context = r, Object.defineProperty(this.context, "emit", {
|
|
2641
|
-
value: (
|
|
2642
|
-
const
|
|
2639
|
+
value: (i, s, o) => {
|
|
2640
|
+
const c = new CustomEvent(i, {
|
|
2643
2641
|
detail: s,
|
|
2644
2642
|
bubbles: !0,
|
|
2645
2643
|
composed: !0,
|
|
2646
2644
|
...o || {}
|
|
2647
2645
|
});
|
|
2648
|
-
return this.dispatchEvent(
|
|
2646
|
+
return this.dispatchEvent(c), !c.defaultPrevented;
|
|
2649
2647
|
},
|
|
2650
2648
|
writable: !1,
|
|
2651
2649
|
enumerable: !1,
|
|
2652
2650
|
configurable: !1
|
|
2653
2651
|
});
|
|
2654
|
-
const
|
|
2655
|
-
Object.keys(
|
|
2656
|
-
const s = i
|
|
2657
|
-
typeof s == "function" && (this.context[
|
|
2658
|
-
}), this._applyComputed(
|
|
2659
|
-
let s = this[
|
|
2660
|
-
Object.defineProperty(this,
|
|
2652
|
+
const n = Te.get(e) || t;
|
|
2653
|
+
Object.keys(n).forEach((i) => {
|
|
2654
|
+
const s = n[i];
|
|
2655
|
+
typeof s == "function" && (this.context[i] = (...o) => s(...o, this.context));
|
|
2656
|
+
}), this._applyComputed(n), n.props && Object.keys(n.props).forEach((i) => {
|
|
2657
|
+
let s = this[i];
|
|
2658
|
+
Object.defineProperty(this, i, {
|
|
2661
2659
|
get() {
|
|
2662
2660
|
return s;
|
|
2663
2661
|
},
|
|
2664
2662
|
set(o) {
|
|
2665
|
-
const
|
|
2666
|
-
s = o, this.context[
|
|
2663
|
+
const c = s;
|
|
2664
|
+
s = o, this.context[i] = o, this._initializing || (this._applyProps(n), c !== o && this._requestRender());
|
|
2667
2665
|
},
|
|
2668
2666
|
enumerable: !0,
|
|
2669
2667
|
configurable: !0
|
|
2670
2668
|
});
|
|
2671
|
-
}), this._initializing = !1, this._initWatchers(
|
|
2669
|
+
}), this._initializing = !1, this._initWatchers(n), this._applyProps(n), this._render(n);
|
|
2672
2670
|
}
|
|
2673
2671
|
connectedCallback() {
|
|
2674
2672
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
2675
|
-
this._applyProps(t), this._requestRender(),
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
this._mounted,
|
|
2679
|
-
(r) => {
|
|
2680
|
-
this._mounted = r;
|
|
2681
|
-
}
|
|
2682
|
-
);
|
|
2673
|
+
this._applyProps(t), this._requestRender(), vt(t, this.context, this._mounted, (r) => {
|
|
2674
|
+
this._mounted = r;
|
|
2675
|
+
});
|
|
2683
2676
|
});
|
|
2684
2677
|
}
|
|
2685
2678
|
disconnectedCallback() {
|
|
2686
2679
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
2687
|
-
|
|
2680
|
+
xt(
|
|
2688
2681
|
t,
|
|
2689
2682
|
this.context,
|
|
2690
2683
|
this._listeners,
|
|
@@ -2706,15 +2699,9 @@ function tr(e, t) {
|
|
|
2706
2699
|
);
|
|
2707
2700
|
});
|
|
2708
2701
|
}
|
|
2709
|
-
attributeChangedCallback(r,
|
|
2702
|
+
attributeChangedCallback(r, n, i) {
|
|
2710
2703
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
2711
|
-
this._applyProps(t),
|
|
2712
|
-
t,
|
|
2713
|
-
r,
|
|
2714
|
-
i,
|
|
2715
|
-
n,
|
|
2716
|
-
this.context
|
|
2717
|
-
);
|
|
2704
|
+
this._applyProps(t), n !== i && this._requestRender(), $t(t, r, n, i, this.context);
|
|
2718
2705
|
});
|
|
2719
2706
|
}
|
|
2720
2707
|
static get observedAttributes() {
|
|
@@ -2730,16 +2717,16 @@ function tr(e, t) {
|
|
|
2730
2717
|
r,
|
|
2731
2718
|
this.context,
|
|
2732
2719
|
this._refs,
|
|
2733
|
-
(
|
|
2734
|
-
this._lastHtmlStringForJitCSS =
|
|
2720
|
+
(n) => {
|
|
2721
|
+
this._lastHtmlStringForJitCSS = n, typeof this.onHtmlStringUpdate == "function" && this.onHtmlStringUpdate(n);
|
|
2735
2722
|
},
|
|
2736
|
-
(
|
|
2737
|
-
this._templateLoading =
|
|
2723
|
+
(n) => {
|
|
2724
|
+
this._templateLoading = n, typeof this.onLoadingStateChange == "function" && this.onLoadingStateChange(n);
|
|
2738
2725
|
},
|
|
2739
|
-
(
|
|
2740
|
-
this._templateError =
|
|
2726
|
+
(n) => {
|
|
2727
|
+
this._templateError = n, typeof this.onErrorStateChange == "function" && this.onErrorStateChange(n);
|
|
2741
2728
|
},
|
|
2742
|
-
(
|
|
2729
|
+
(n) => this._applyStyle(r, n)
|
|
2743
2730
|
);
|
|
2744
2731
|
});
|
|
2745
2732
|
}
|
|
@@ -2748,7 +2735,7 @@ function tr(e, t) {
|
|
|
2748
2735
|
}
|
|
2749
2736
|
_requestRender() {
|
|
2750
2737
|
this._runLogicWithinErrorBoundary(this._cfg, () => {
|
|
2751
|
-
|
|
2738
|
+
ue(() => {
|
|
2752
2739
|
Xt(
|
|
2753
2740
|
() => this._render(this._cfg),
|
|
2754
2741
|
this._lastRenderTime,
|
|
@@ -2768,35 +2755,35 @@ function tr(e, t) {
|
|
|
2768
2755
|
});
|
|
2769
2756
|
}
|
|
2770
2757
|
// --- Style ---
|
|
2771
|
-
_applyStyle(r,
|
|
2758
|
+
_applyStyle(r, n) {
|
|
2772
2759
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
2773
2760
|
Yt(
|
|
2774
2761
|
this.shadowRoot,
|
|
2775
2762
|
this.context,
|
|
2776
|
-
|
|
2763
|
+
n,
|
|
2777
2764
|
this._styleSheet,
|
|
2778
|
-
(
|
|
2779
|
-
this._styleSheet =
|
|
2765
|
+
(i) => {
|
|
2766
|
+
this._styleSheet = i;
|
|
2780
2767
|
}
|
|
2781
2768
|
);
|
|
2782
2769
|
});
|
|
2783
2770
|
}
|
|
2784
2771
|
// --- Error Boundary function ---
|
|
2785
|
-
_runLogicWithinErrorBoundary(r,
|
|
2772
|
+
_runLogicWithinErrorBoundary(r, n) {
|
|
2786
2773
|
this._hasError && (this._hasError = !1);
|
|
2787
2774
|
try {
|
|
2788
|
-
|
|
2789
|
-
} catch (
|
|
2790
|
-
this._hasError = !0, r.onError && r.onError(
|
|
2775
|
+
n();
|
|
2776
|
+
} catch (i) {
|
|
2777
|
+
this._hasError = !0, r.onError && r.onError(i, this.context);
|
|
2791
2778
|
}
|
|
2792
2779
|
}
|
|
2793
2780
|
// --- State, props, computed ---
|
|
2794
2781
|
_initContext(r) {
|
|
2795
2782
|
try {
|
|
2796
|
-
let
|
|
2783
|
+
let n = function(s, o = "") {
|
|
2797
2784
|
return Array.isArray(s) ? new Proxy(s, {
|
|
2798
|
-
get(
|
|
2799
|
-
const g = Reflect.get(
|
|
2785
|
+
get(c, u, m) {
|
|
2786
|
+
const g = Reflect.get(c, u, m);
|
|
2800
2787
|
return typeof g == "function" && typeof u == "string" && [
|
|
2801
2788
|
"push",
|
|
2802
2789
|
"pop",
|
|
@@ -2806,50 +2793,53 @@ function tr(e, t) {
|
|
|
2806
2793
|
"sort",
|
|
2807
2794
|
"reverse"
|
|
2808
2795
|
].includes(u) ? function(...p) {
|
|
2809
|
-
const
|
|
2810
|
-
if (!
|
|
2811
|
-
const
|
|
2812
|
-
|
|
2796
|
+
const f = g.apply(c, p);
|
|
2797
|
+
if (!i._initializing) {
|
|
2798
|
+
const h = o || "root";
|
|
2799
|
+
i._triggerWatchers(h, c), ue(
|
|
2800
|
+
() => i._render(r),
|
|
2801
|
+
i._componentId
|
|
2802
|
+
);
|
|
2813
2803
|
}
|
|
2814
|
-
return
|
|
2804
|
+
return f;
|
|
2815
2805
|
} : g;
|
|
2816
2806
|
},
|
|
2817
|
-
set(
|
|
2818
|
-
if (
|
|
2807
|
+
set(c, u, m) {
|
|
2808
|
+
if (c[u] = m, !i._initializing) {
|
|
2819
2809
|
const g = o ? `${o}.${String(u)}` : String(u);
|
|
2820
|
-
|
|
2810
|
+
i._triggerWatchers(g, m), ue(() => i._render(r), i._componentId);
|
|
2821
2811
|
}
|
|
2822
2812
|
return !0;
|
|
2823
2813
|
},
|
|
2824
|
-
deleteProperty(
|
|
2825
|
-
if (delete
|
|
2814
|
+
deleteProperty(c, u) {
|
|
2815
|
+
if (delete c[u], !i._initializing) {
|
|
2826
2816
|
const m = o ? `${o}.${String(u)}` : String(u);
|
|
2827
|
-
|
|
2817
|
+
i._triggerWatchers(m, void 0), ue(() => i._render(r), i._componentId);
|
|
2828
2818
|
}
|
|
2829
2819
|
return !0;
|
|
2830
2820
|
}
|
|
2831
|
-
}) : s && typeof s == "object" ? s.constructor && s.constructor.name === "ReactiveState" ? s : (Object.keys(s).forEach((
|
|
2832
|
-
const u = o ? `${o}.${
|
|
2833
|
-
s[
|
|
2821
|
+
}) : s && typeof s == "object" ? s.constructor && s.constructor.name === "ReactiveState" ? s : (Object.keys(s).forEach((c) => {
|
|
2822
|
+
const u = o ? `${o}.${c}` : c;
|
|
2823
|
+
s[c] = n(s[c], u);
|
|
2834
2824
|
}), new Proxy(s, {
|
|
2835
|
-
set(
|
|
2825
|
+
set(c, u, m) {
|
|
2836
2826
|
const g = o ? `${o}.${String(u)}` : String(u);
|
|
2837
|
-
return
|
|
2838
|
-
g,
|
|
2839
|
-
a[u]
|
|
2840
|
-
), fe(() => n._render(r), n._componentId)), !0;
|
|
2827
|
+
return c[u] = n(m, g), i._initializing || (i._triggerWatchers(g, c[u]), ue(() => i._render(r), i._componentId)), !0;
|
|
2841
2828
|
},
|
|
2842
|
-
get(
|
|
2843
|
-
return Reflect.get(
|
|
2829
|
+
get(c, u, m) {
|
|
2830
|
+
return Reflect.get(c, u, m);
|
|
2844
2831
|
}
|
|
2845
2832
|
})) : s;
|
|
2846
2833
|
};
|
|
2847
|
-
const
|
|
2848
|
-
return
|
|
2834
|
+
const i = this;
|
|
2835
|
+
return n({
|
|
2849
2836
|
// For functional components, state is managed by state() function calls
|
|
2850
2837
|
// Include prop defaults in initial reactive context so prop updates trigger reactivity
|
|
2851
2838
|
...r.props ? Object.fromEntries(
|
|
2852
|
-
Object.entries(r.props).map(([s, o]) => [
|
|
2839
|
+
Object.entries(r.props).map(([s, o]) => [
|
|
2840
|
+
s,
|
|
2841
|
+
o.default
|
|
2842
|
+
])
|
|
2853
2843
|
) : {}
|
|
2854
2844
|
});
|
|
2855
2845
|
} catch {
|
|
@@ -2866,15 +2856,15 @@ function tr(e, t) {
|
|
|
2866
2856
|
);
|
|
2867
2857
|
});
|
|
2868
2858
|
}
|
|
2869
|
-
_triggerWatchers(r,
|
|
2870
|
-
yt(this.context, this._watchers, r,
|
|
2859
|
+
_triggerWatchers(r, n) {
|
|
2860
|
+
yt(this.context, this._watchers, r, n);
|
|
2871
2861
|
}
|
|
2872
2862
|
_applyProps(r) {
|
|
2873
2863
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
2874
2864
|
try {
|
|
2875
2865
|
wt(this, r, this.context);
|
|
2876
|
-
} catch (
|
|
2877
|
-
this._hasError = !0, r.onError && r.onError(
|
|
2866
|
+
} catch (n) {
|
|
2867
|
+
this._hasError = !0, r.onError && r.onError(n, this.context);
|
|
2878
2868
|
}
|
|
2879
2869
|
});
|
|
2880
2870
|
}
|
|
@@ -2883,67 +2873,201 @@ function tr(e, t) {
|
|
|
2883
2873
|
function et(e, t) {
|
|
2884
2874
|
let r = re(e);
|
|
2885
2875
|
r.includes("-") || (r = `cer-${r}`);
|
|
2886
|
-
let
|
|
2876
|
+
let n = {};
|
|
2887
2877
|
if (typeof window < "u")
|
|
2888
2878
|
try {
|
|
2889
|
-
const
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2879
|
+
const o = t.toString();
|
|
2880
|
+
let c = null;
|
|
2881
|
+
const u = o.indexOf("({");
|
|
2882
|
+
if (u !== -1) {
|
|
2883
|
+
let m = 0, g = !1, b = null, p = !1, f = -1;
|
|
2884
|
+
for (let h = u + 2; h < o.length; h++) {
|
|
2885
|
+
const v = o[h];
|
|
2886
|
+
if (p) {
|
|
2887
|
+
p = !1;
|
|
2888
|
+
continue;
|
|
2889
|
+
}
|
|
2890
|
+
if (v === "\\") {
|
|
2891
|
+
p = !0;
|
|
2892
|
+
continue;
|
|
2893
|
+
}
|
|
2894
|
+
if (!g && (v === '"' || v === "'" || v === "`")) {
|
|
2895
|
+
g = !0, b = v;
|
|
2896
|
+
continue;
|
|
2897
|
+
}
|
|
2898
|
+
if (g && v === b) {
|
|
2899
|
+
g = !1, b = null;
|
|
2900
|
+
continue;
|
|
2901
|
+
}
|
|
2902
|
+
if (!g) {
|
|
2903
|
+
if (v === "{")
|
|
2904
|
+
m++;
|
|
2905
|
+
else if (v === "}") {
|
|
2906
|
+
if (m === 0) {
|
|
2907
|
+
f = h;
|
|
2908
|
+
break;
|
|
2909
|
+
}
|
|
2910
|
+
m--;
|
|
2900
2911
|
}
|
|
2901
|
-
} else {
|
|
2902
|
-
const p = g.split(":")[0].trim();
|
|
2903
|
-
p && !p.includes("}") && (i[p] = "");
|
|
2904
2912
|
}
|
|
2905
2913
|
}
|
|
2914
|
+
if (f !== -1) {
|
|
2915
|
+
const h = o.substring(u, f + 2), v = o.substring(u + 2, f).trim();
|
|
2916
|
+
c = [h, v];
|
|
2917
|
+
}
|
|
2918
|
+
}
|
|
2919
|
+
if (c) {
|
|
2920
|
+
const m = c[1];
|
|
2921
|
+
let g = "", b = "", p = !0, f = 0, h = null, v = !1, w = 0;
|
|
2922
|
+
for (; w < m.length; ) {
|
|
2923
|
+
const a = m[w];
|
|
2924
|
+
if (v) {
|
|
2925
|
+
p ? g += a : b += a, v = !1, w++;
|
|
2926
|
+
continue;
|
|
2927
|
+
}
|
|
2928
|
+
if (a === "\\") {
|
|
2929
|
+
v = !0, p ? g += a : b += a, w++;
|
|
2930
|
+
continue;
|
|
2931
|
+
}
|
|
2932
|
+
if ((a === '"' || a === "'" || a === "`") && !h) {
|
|
2933
|
+
h = a, p ? g += a : b += a, w++;
|
|
2934
|
+
continue;
|
|
2935
|
+
}
|
|
2936
|
+
if (a === h) {
|
|
2937
|
+
h = null, p ? g += a : b += a, w++;
|
|
2938
|
+
continue;
|
|
2939
|
+
}
|
|
2940
|
+
if (h) {
|
|
2941
|
+
p ? g += a : b += a, w++;
|
|
2942
|
+
continue;
|
|
2943
|
+
}
|
|
2944
|
+
if (a === "{" || a === "[") {
|
|
2945
|
+
f++, p ? g += a : b += a, w++;
|
|
2946
|
+
continue;
|
|
2947
|
+
}
|
|
2948
|
+
if (a === "}" || a === "]") {
|
|
2949
|
+
f--, p ? g += a : b += a, w++;
|
|
2950
|
+
continue;
|
|
2951
|
+
}
|
|
2952
|
+
if (a === "=" && f === 0 && p) {
|
|
2953
|
+
p = !1, w++;
|
|
2954
|
+
continue;
|
|
2955
|
+
}
|
|
2956
|
+
if (a === "," && f === 0) {
|
|
2957
|
+
if (g.trim() && b.trim()) {
|
|
2958
|
+
const l = g.trim(), y = b.trim();
|
|
2959
|
+
try {
|
|
2960
|
+
if (y === "true") n[l] = !0;
|
|
2961
|
+
else if (y === "false") n[l] = !1;
|
|
2962
|
+
else if (y === "[]") n[l] = [];
|
|
2963
|
+
else if (y === "{}") n[l] = {};
|
|
2964
|
+
else if (/^\d+$/.test(y))
|
|
2965
|
+
n[l] = parseInt(y);
|
|
2966
|
+
else if (/^'.*'$/s.test(y))
|
|
2967
|
+
n[l] = y.slice(1, -1).replace(/\\'/g, "'").replace(/\\"/g, '"').replace(/\\\//g, "/");
|
|
2968
|
+
else if (/^".*"$/s.test(y))
|
|
2969
|
+
n[l] = y.slice(1, -1).replace(/\\"/g, '"').replace(/\\'/g, "'").replace(/\\\//g, "/");
|
|
2970
|
+
else if (/^`.*`$/s.test(y)) {
|
|
2971
|
+
const $ = y.slice(1, -1);
|
|
2972
|
+
if ($.includes("${"))
|
|
2973
|
+
try {
|
|
2974
|
+
n[l] = new Function(
|
|
2975
|
+
`return \`${$}\`;`
|
|
2976
|
+
)();
|
|
2977
|
+
} catch {
|
|
2978
|
+
n[l] = $;
|
|
2979
|
+
}
|
|
2980
|
+
else
|
|
2981
|
+
n[l] = $;
|
|
2982
|
+
} else
|
|
2983
|
+
n[l] = y;
|
|
2984
|
+
} catch {
|
|
2985
|
+
n[l] = "";
|
|
2986
|
+
}
|
|
2987
|
+
} else if (g.trim()) {
|
|
2988
|
+
const l = g.split(":")[0].trim();
|
|
2989
|
+
l && !l.includes("}") && (n[l] = "");
|
|
2990
|
+
}
|
|
2991
|
+
g = "", b = "", p = !0, w++;
|
|
2992
|
+
continue;
|
|
2993
|
+
}
|
|
2994
|
+
p ? g += a : b += a, w++;
|
|
2995
|
+
}
|
|
2996
|
+
if (g.trim() && b.trim()) {
|
|
2997
|
+
const a = g.trim(), l = b.trim();
|
|
2998
|
+
try {
|
|
2999
|
+
if (l === "true") n[a] = !0;
|
|
3000
|
+
else if (l === "false") n[a] = !1;
|
|
3001
|
+
else if (l === "[]") n[a] = [];
|
|
3002
|
+
else if (l === "{}") n[a] = {};
|
|
3003
|
+
else if (/^\d+$/.test(l)) n[a] = parseInt(l);
|
|
3004
|
+
else if (/^'.*'$/s.test(l))
|
|
3005
|
+
n[a] = l.slice(1, -1).replace(/\\'/g, "'").replace(/\\"/g, '"').replace(/\\\//g, "/");
|
|
3006
|
+
else if (/^".*"$/s.test(l))
|
|
3007
|
+
n[a] = l.slice(1, -1).replace(/\\"/g, '"').replace(/\\'/g, "'").replace(/\\\//g, "/");
|
|
3008
|
+
else if (/^`.*`$/s.test(l)) {
|
|
3009
|
+
const y = l.slice(1, -1);
|
|
3010
|
+
if (y.includes("${"))
|
|
3011
|
+
try {
|
|
3012
|
+
n[a] = new Function(
|
|
3013
|
+
`return \`${y}\`;`
|
|
3014
|
+
)();
|
|
3015
|
+
} catch {
|
|
3016
|
+
n[a] = y;
|
|
3017
|
+
}
|
|
3018
|
+
else
|
|
3019
|
+
n[a] = y;
|
|
3020
|
+
} else
|
|
3021
|
+
n[a] = l;
|
|
3022
|
+
} catch {
|
|
3023
|
+
n[a] = "";
|
|
3024
|
+
}
|
|
3025
|
+
} else if (g.trim()) {
|
|
3026
|
+
const a = g.split(":")[0].trim();
|
|
3027
|
+
a && !a.includes("}") && (n[a] = "");
|
|
3028
|
+
}
|
|
2906
3029
|
}
|
|
2907
3030
|
} catch {
|
|
2908
3031
|
}
|
|
2909
|
-
let
|
|
3032
|
+
let i = {};
|
|
2910
3033
|
const s = {
|
|
2911
3034
|
// Generate props config from defaults
|
|
2912
3035
|
props: Object.fromEntries(
|
|
2913
|
-
Object.entries(
|
|
3036
|
+
Object.entries(n).map(([o, c]) => [o, { type: typeof c == "boolean" ? Boolean : typeof c == "number" ? Number : typeof c == "string" ? String : Function, default: c }])
|
|
2914
3037
|
),
|
|
2915
3038
|
// Add lifecycle hooks from the stored functions
|
|
2916
3039
|
onConnected: (o) => {
|
|
2917
|
-
|
|
3040
|
+
i.onConnected && i.onConnected();
|
|
2918
3041
|
},
|
|
2919
3042
|
onDisconnected: (o) => {
|
|
2920
|
-
|
|
3043
|
+
i.onDisconnected && i.onDisconnected();
|
|
2921
3044
|
},
|
|
2922
|
-
onAttributeChanged: (o,
|
|
2923
|
-
|
|
3045
|
+
onAttributeChanged: (o, c, u, m) => {
|
|
3046
|
+
i.onAttributeChanged && i.onAttributeChanged(o, c, u);
|
|
2924
3047
|
},
|
|
2925
|
-
onError: (o,
|
|
2926
|
-
|
|
3048
|
+
onError: (o, c) => {
|
|
3049
|
+
i.onError && o && i.onError(o);
|
|
2927
3050
|
},
|
|
2928
3051
|
render: (o) => {
|
|
2929
|
-
const
|
|
2930
|
-
F.setCurrentComponent(
|
|
3052
|
+
const c = o._componentId || `${r}-${Math.random().toString(36).substr(2, 9)}`;
|
|
3053
|
+
F.setCurrentComponent(c, () => {
|
|
2931
3054
|
o.requestRender && o.requestRender();
|
|
2932
3055
|
});
|
|
2933
3056
|
try {
|
|
2934
3057
|
Qt(o);
|
|
2935
|
-
const u = Object.keys(
|
|
3058
|
+
const u = Object.keys(n).length > 0;
|
|
2936
3059
|
let m;
|
|
2937
3060
|
if (u) {
|
|
2938
3061
|
const g = {};
|
|
2939
|
-
Object.keys(
|
|
2940
|
-
|
|
3062
|
+
Object.keys(n).forEach((b) => {
|
|
3063
|
+
const p = o[b], f = n[b];
|
|
3064
|
+
g[b] = p != null && p !== "" ? p : f;
|
|
2941
3065
|
}), m = t(g);
|
|
2942
3066
|
} else
|
|
2943
3067
|
m = t();
|
|
2944
3068
|
if (o._hookCallbacks) {
|
|
2945
3069
|
const g = o._hookCallbacks;
|
|
2946
|
-
g.onConnected && (
|
|
3070
|
+
g.onConnected && (i.onConnected = g.onConnected), g.onDisconnected && (i.onDisconnected = g.onDisconnected), g.onAttributeChanged && (i.onAttributeChanged = g.onAttributeChanged), g.onError && (i.onError = g.onError), g.style && (o._styleCallback = g.style);
|
|
2947
3071
|
}
|
|
2948
3072
|
return m;
|
|
2949
3073
|
} finally {
|
|
@@ -2951,7 +3075,10 @@ function et(e, t) {
|
|
|
2951
3075
|
}
|
|
2952
3076
|
}
|
|
2953
3077
|
};
|
|
2954
|
-
Te.set(r, s), typeof window < "u" && (customElements.get(r) || customElements.define(
|
|
3078
|
+
Te.set(r, s), typeof window < "u" && (customElements.get(r) || customElements.define(
|
|
3079
|
+
r,
|
|
3080
|
+
tr(r, s)
|
|
3081
|
+
));
|
|
2955
3082
|
}
|
|
2956
3083
|
class rr {
|
|
2957
3084
|
map = /* @__PURE__ */ new Map();
|
|
@@ -2966,8 +3093,8 @@ class rr {
|
|
|
2966
3093
|
}
|
|
2967
3094
|
set(t, r) {
|
|
2968
3095
|
if (this.map.has(t) && this.map.delete(t), this.map.set(t, r), this.map.size > this.maxSize) {
|
|
2969
|
-
const
|
|
2970
|
-
|
|
3096
|
+
const n = this.map.keys().next().value;
|
|
3097
|
+
n !== void 0 && this.map.delete(n);
|
|
2971
3098
|
}
|
|
2972
3099
|
}
|
|
2973
3100
|
has(t) {
|
|
@@ -2977,7 +3104,7 @@ class rr {
|
|
|
2977
3104
|
this.map.clear();
|
|
2978
3105
|
}
|
|
2979
3106
|
}
|
|
2980
|
-
const
|
|
3107
|
+
const Ie = new rr(500);
|
|
2981
3108
|
function nr(e, t) {
|
|
2982
3109
|
if (e == null) {
|
|
2983
3110
|
console.warn(
|
|
@@ -2991,9 +3118,9 @@ function nr(e, t) {
|
|
|
2991
3118
|
`💡 Tip: If your event handler function returns undefined, make sure you're passing the function reference, not calling it. Use @${t}="\${fn}" not @${t}="\${fn()}"`
|
|
2992
3119
|
);
|
|
2993
3120
|
}
|
|
2994
|
-
function he(e, t = {}, r,
|
|
2995
|
-
const
|
|
2996
|
-
return { tag: e, key:
|
|
3121
|
+
function he(e, t = {}, r, n) {
|
|
3122
|
+
const i = n ?? t.key;
|
|
3123
|
+
return { tag: e, key: i, props: t, children: r };
|
|
2997
3124
|
}
|
|
2998
3125
|
function Ae(e) {
|
|
2999
3126
|
return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
|
|
@@ -3005,103 +3132,103 @@ function ir(e, t) {
|
|
|
3005
3132
|
return e.key != null ? e : { ...e, key: t };
|
|
3006
3133
|
}
|
|
3007
3134
|
function sr(e, t = [], r = {}) {
|
|
3008
|
-
const
|
|
3135
|
+
const n = {}, i = {}, s = {}, o = [], c = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
|
|
3009
3136
|
let u;
|
|
3010
|
-
for (; u =
|
|
3137
|
+
for (; u = c.exec(e); ) {
|
|
3011
3138
|
const m = u[1], g = u[2], b = (u[4] || u[6]) ?? "", p = b.match(/^{{(\d+)}}$/);
|
|
3012
|
-
let
|
|
3013
|
-
p || (
|
|
3014
|
-
const
|
|
3139
|
+
let f = p ? t[Number(p[1])] ?? null : b;
|
|
3140
|
+
p || (f === "true" ? f = !0 : f === "false" ? f = !1 : f === "null" ? f = null : isNaN(Number(f)) || (f = Number(f)));
|
|
3141
|
+
const h = ["model", "bind", "show", "class", "style", "ref"];
|
|
3015
3142
|
if (m === ":") {
|
|
3016
|
-
const [
|
|
3017
|
-
if (
|
|
3018
|
-
const y = [...
|
|
3019
|
-
s[
|
|
3020
|
-
value:
|
|
3143
|
+
const [v, w] = g.split(":"), [a, ...l] = v.split(".");
|
|
3144
|
+
if (h.includes(a)) {
|
|
3145
|
+
const y = [...l], $ = a === "model" && w ? `model:${w}` : a;
|
|
3146
|
+
s[$] = {
|
|
3147
|
+
value: f,
|
|
3021
3148
|
modifiers: y,
|
|
3022
3149
|
arg: w
|
|
3023
3150
|
};
|
|
3024
3151
|
} else {
|
|
3025
|
-
let y =
|
|
3026
|
-
y && ee(y) && (y = y.value),
|
|
3152
|
+
let y = f;
|
|
3153
|
+
y && ee(y) && (y = y.value), i[g] = y, o.push(g);
|
|
3027
3154
|
}
|
|
3028
3155
|
} else if (m === "@") {
|
|
3029
|
-
const [
|
|
3030
|
-
nr(
|
|
3031
|
-
const
|
|
3032
|
-
if (
|
|
3033
|
-
const y = (
|
|
3034
|
-
if (
|
|
3035
|
-
return
|
|
3036
|
-
},
|
|
3037
|
-
|
|
3156
|
+
const [v, ...w] = g.split("."), a = w;
|
|
3157
|
+
nr(f, v);
|
|
3158
|
+
const l = typeof f == "function" ? f : typeof r[f] == "function" ? r[f] : void 0;
|
|
3159
|
+
if (l) {
|
|
3160
|
+
const y = (k) => {
|
|
3161
|
+
if (a.includes("prevent") && k.preventDefault(), a.includes("stop") && k.stopPropagation(), !(a.includes("self") && k.target !== k.currentTarget))
|
|
3162
|
+
return a.includes("once") && k.currentTarget?.removeEventListener(v, y), l(k);
|
|
3163
|
+
}, $ = "on" + v.charAt(0).toUpperCase() + v.slice(1);
|
|
3164
|
+
n[$] = y;
|
|
3038
3165
|
}
|
|
3039
|
-
} else g === "ref" ?
|
|
3166
|
+
} else g === "ref" ? n.ref = f : i[g] = f;
|
|
3040
3167
|
}
|
|
3041
|
-
return { props:
|
|
3168
|
+
return { props: n, attrs: i, directives: s, bound: o };
|
|
3042
3169
|
}
|
|
3043
3170
|
function or(e, t, r) {
|
|
3044
|
-
const
|
|
3171
|
+
const n = ge.length > 0 ? ge[ge.length - 1] : void 0, i = r ?? n, s = !r && t.length === 0, o = s ? e.join("<!--TEMPLATE_DELIM-->") : null;
|
|
3045
3172
|
if (s && o) {
|
|
3046
|
-
const
|
|
3047
|
-
if (
|
|
3173
|
+
const d = Ie.get(o);
|
|
3174
|
+
if (d) return d;
|
|
3048
3175
|
}
|
|
3049
|
-
function
|
|
3050
|
-
return he("#text", {},
|
|
3176
|
+
function c(d, x) {
|
|
3177
|
+
return he("#text", {}, d, x);
|
|
3051
3178
|
}
|
|
3052
3179
|
let u = "";
|
|
3053
|
-
for (let
|
|
3054
|
-
u += e[
|
|
3180
|
+
for (let d = 0; d < e.length; d++)
|
|
3181
|
+
u += e[d], d < t.length && (u += `{{${d}}}`);
|
|
3055
3182
|
const m = /<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, g = [];
|
|
3056
|
-
let b, p = [],
|
|
3057
|
-
function
|
|
3058
|
-
!
|
|
3059
|
-
if (
|
|
3060
|
-
const A =
|
|
3183
|
+
let b, p = [], f = null, h = {}, v, w = 0, a = [];
|
|
3184
|
+
function l(d) {
|
|
3185
|
+
!d || typeof d != "object" || Ae(d) || (d.props || d.attrs ? (d.props && (h.props || (h.props = {}), Object.assign(h.props, d.props)), d.attrs && (h.attrs || (h.attrs = {}), Object.keys(d.attrs).forEach((x) => {
|
|
3186
|
+
if (x === "style" && h.attrs.style) {
|
|
3187
|
+
const A = h.attrs.style.replace(
|
|
3061
3188
|
/;?\s*$/,
|
|
3062
3189
|
""
|
|
3063
|
-
), C =
|
|
3064
|
-
|
|
3065
|
-
} else if (
|
|
3066
|
-
const A =
|
|
3190
|
+
), C = d.attrs.style.replace(/^;?\s*/, "");
|
|
3191
|
+
h.attrs.style = A + "; " + C;
|
|
3192
|
+
} else if (x === "class" && h.attrs.class) {
|
|
3193
|
+
const A = h.attrs.class.trim().split(/\s+/).filter(Boolean), C = d.attrs.class.trim().split(/\s+/).filter(Boolean), E = [
|
|
3067
3194
|
.../* @__PURE__ */ new Set([...A, ...C])
|
|
3068
3195
|
];
|
|
3069
|
-
|
|
3196
|
+
h.attrs.class = E.join(" ");
|
|
3070
3197
|
} else
|
|
3071
|
-
|
|
3072
|
-
}))) : (
|
|
3073
|
-
}
|
|
3074
|
-
function y(
|
|
3075
|
-
const A =
|
|
3076
|
-
if (Ae(
|
|
3077
|
-
const C =
|
|
3078
|
-
let E =
|
|
3198
|
+
h.attrs[x] = d.attrs[x];
|
|
3199
|
+
}))) : (h.props || (h.props = {}), Object.assign(h.props, d)));
|
|
3200
|
+
}
|
|
3201
|
+
function y(d, x) {
|
|
3202
|
+
const A = f ? p : a;
|
|
3203
|
+
if (Ae(d)) {
|
|
3204
|
+
const C = d.key ?? x;
|
|
3205
|
+
let E = d.children;
|
|
3079
3206
|
A.push({
|
|
3080
|
-
...
|
|
3207
|
+
...d,
|
|
3081
3208
|
key: C,
|
|
3082
3209
|
children: E
|
|
3083
3210
|
});
|
|
3084
3211
|
return;
|
|
3085
3212
|
}
|
|
3086
|
-
if (Ce(
|
|
3087
|
-
A.push(ir(
|
|
3213
|
+
if (Ce(d)) {
|
|
3214
|
+
A.push(ir(d, void 0));
|
|
3088
3215
|
return;
|
|
3089
3216
|
}
|
|
3090
|
-
if (Array.isArray(
|
|
3091
|
-
if (
|
|
3092
|
-
for (let C = 0; C <
|
|
3093
|
-
const E =
|
|
3094
|
-
Ae(E) || Ce(E) || Array.isArray(E) ? y(E, `${
|
|
3217
|
+
if (Array.isArray(d)) {
|
|
3218
|
+
if (d.length === 0) return;
|
|
3219
|
+
for (let C = 0; C < d.length; C++) {
|
|
3220
|
+
const E = d[C];
|
|
3221
|
+
Ae(E) || Ce(E) || Array.isArray(E) ? y(E, `${x}-${C}`) : E !== null && typeof E == "object" ? l(E) : A.push(c(String(E), `${x}-${C}`));
|
|
3095
3222
|
}
|
|
3096
3223
|
return;
|
|
3097
3224
|
}
|
|
3098
|
-
if (
|
|
3099
|
-
|
|
3225
|
+
if (d !== null && typeof d == "object") {
|
|
3226
|
+
l(d);
|
|
3100
3227
|
return;
|
|
3101
3228
|
}
|
|
3102
|
-
A.push(
|
|
3229
|
+
A.push(c(String(d), x));
|
|
3103
3230
|
}
|
|
3104
|
-
const
|
|
3231
|
+
const $ = /* @__PURE__ */ new Set([
|
|
3105
3232
|
"area",
|
|
3106
3233
|
"base",
|
|
3107
3234
|
"br",
|
|
@@ -3120,12 +3247,12 @@ function or(e, t, r) {
|
|
|
3120
3247
|
for (; b = m.exec(u); )
|
|
3121
3248
|
if (!(b[0].startsWith("<!--") && b[0].endsWith("-->"))) {
|
|
3122
3249
|
if (b[1]) {
|
|
3123
|
-
const
|
|
3250
|
+
const d = b[1], x = b[0][1] === "/", A = b[0][b[0].length - 2] === "/" || $.has(d), {
|
|
3124
3251
|
props: C,
|
|
3125
3252
|
attrs: E,
|
|
3126
3253
|
directives: T,
|
|
3127
3254
|
bound: R
|
|
3128
|
-
} = sr(b[2] || "", t,
|
|
3255
|
+
} = sr(b[2] || "", t, i), S = { props: {}, attrs: {} };
|
|
3129
3256
|
for (const P in C) S.props[P] = C[P];
|
|
3130
3257
|
for (const P in E) S.attrs[P] = E[P];
|
|
3131
3258
|
if (S.attrs && Object.prototype.hasOwnProperty.call(S.attrs, "key") && !(S.props && Object.prototype.hasOwnProperty.call(S.props, "key")))
|
|
@@ -3143,7 +3270,7 @@ function or(e, t, r) {
|
|
|
3143
3270
|
audio: ["muted", "autoplay", "controls", "loop"],
|
|
3144
3271
|
img: ["src", "alt", "width", "height"],
|
|
3145
3272
|
button: ["type", "name", "value", "disabled", "autofocus", "form"]
|
|
3146
|
-
}, B =
|
|
3273
|
+
}, B = d.toLowerCase(), V = P[B] ?? [];
|
|
3147
3274
|
if (S.attrs) {
|
|
3148
3275
|
for (const K of V)
|
|
3149
3276
|
if (R && R.includes(K) && K in S.attrs && !(S.props && K in S.props)) {
|
|
@@ -3151,7 +3278,7 @@ function or(e, t, r) {
|
|
|
3151
3278
|
L && ee(L) && (L = L.value), S.props[K] = L, delete S.attrs[K];
|
|
3152
3279
|
}
|
|
3153
3280
|
}
|
|
3154
|
-
if ((
|
|
3281
|
+
if ((d.includes("-") || !!i?.__customElements?.has?.(d)) && (S.isCustomElement = !0, R && S.attrs)) {
|
|
3155
3282
|
const K = /* @__PURE__ */ new Set(["id", "name", "data-key", "key"]);
|
|
3156
3283
|
for (const L of R)
|
|
3157
3284
|
if (L in S.attrs && !(S.props && L in S.props)) {
|
|
@@ -3164,13 +3291,13 @@ function or(e, t, r) {
|
|
|
3164
3291
|
}
|
|
3165
3292
|
if (T && Object.keys(T).some((P) => P === "model" || P.startsWith("model:")))
|
|
3166
3293
|
try {
|
|
3167
|
-
const P = Symbol.for("cer.registry"), B = globalThis[P], V = !!(B && typeof B.has == "function" && B.has(
|
|
3168
|
-
if (!!(
|
|
3294
|
+
const P = Symbol.for("cer.registry"), B = globalThis[P], V = !!(B && typeof B.has == "function" && B.has(d)), we = !!(i && (i.__customElements instanceof Set && i.__customElements.has(d) || Array.isArray(i.__isCustomElements) && i.__isCustomElements.includes(d)));
|
|
3295
|
+
if (!!(d.includes("-") || we || V))
|
|
3169
3296
|
for (const M of Object.keys(T)) {
|
|
3170
3297
|
if (M !== "model" && !M.startsWith("model:")) continue;
|
|
3171
|
-
const J = T[M], Z = J.arg ?? (M.includes(":") ? M.split(":", 2)[1] : void 0), z = J.value, _ = Z ?? "modelValue", U = H,
|
|
3298
|
+
const J = T[M], Z = J.arg ?? (M.includes(":") ? M.split(":", 2)[1] : void 0), z = J.value, _ = Z ?? "modelValue", U = H, I = _e, N = i ? i._state || i : void 0;
|
|
3172
3299
|
let O;
|
|
3173
|
-
typeof z == "string" &&
|
|
3300
|
+
typeof z == "string" && i ? O = U(N, z) : (O = z, O && ee(O) && (O = O.value)), S.props[_] = O;
|
|
3174
3301
|
try {
|
|
3175
3302
|
const ne = re(_);
|
|
3176
3303
|
S.attrs || (S.attrs = {}), O !== void 0 && (S.attrs[ne] = O);
|
|
@@ -3182,35 +3309,35 @@ function or(e, t, r) {
|
|
|
3182
3309
|
const Y = ne.detail !== void 0 ? ne.detail : ne.target ? ne.target.value : void 0;
|
|
3183
3310
|
if (N)
|
|
3184
3311
|
if (z && ee(z)) {
|
|
3185
|
-
const
|
|
3186
|
-
(Array.isArray(Y) && Array.isArray(
|
|
3312
|
+
const oe = z.value;
|
|
3313
|
+
(Array.isArray(Y) && Array.isArray(oe) ? JSON.stringify([...Y].sort()) !== JSON.stringify([...oe].sort()) : Y !== oe) && (z.value = Y, i?.requestRender ? i.requestRender() : i?._requestRender && i._requestRender());
|
|
3187
3314
|
} else {
|
|
3188
|
-
const
|
|
3189
|
-
(Array.isArray(Y) && Array.isArray(
|
|
3315
|
+
const oe = U(N, typeof z == "string" ? z : String(z));
|
|
3316
|
+
(Array.isArray(Y) && Array.isArray(oe) ? JSON.stringify([...Y].sort()) !== JSON.stringify([...oe].sort()) : Y !== oe) && (I(N, typeof z == "string" ? z : String(z), Y), i?.requestRender ? i.requestRender() : i?._requestRender && i._requestRender());
|
|
3190
3317
|
}
|
|
3191
3318
|
}, delete T[M];
|
|
3192
3319
|
}
|
|
3193
3320
|
} catch {
|
|
3194
3321
|
}
|
|
3195
|
-
if (Object.keys(T).length > 0 && (S.directives = { ...T }),
|
|
3322
|
+
if (Object.keys(T).length > 0 && (S.directives = { ...T }), x) {
|
|
3196
3323
|
const P = he(
|
|
3197
|
-
|
|
3198
|
-
|
|
3324
|
+
f,
|
|
3325
|
+
h,
|
|
3199
3326
|
p.length === 1 && Ce(p[0]) && p[0].tag === "#text" ? typeof p[0].children == "string" ? p[0].children : "" : p.length ? p : void 0,
|
|
3200
|
-
|
|
3327
|
+
v
|
|
3201
3328
|
), B = g.pop();
|
|
3202
|
-
B ? (
|
|
3203
|
-
} else A ?
|
|
3204
|
-
tag:
|
|
3205
|
-
props:
|
|
3329
|
+
B ? (f = B.tag, h = B.props, v = B.key, p = B.children, p.push(P)) : (a.push(P), f = null, h = {}, v = void 0, p = []);
|
|
3330
|
+
} else A ? f ? p.push(he(d, S, void 0, void 0)) : a.push(he(d, S, void 0, void 0)) : (f && g.push({
|
|
3331
|
+
tag: f,
|
|
3332
|
+
props: h,
|
|
3206
3333
|
children: p,
|
|
3207
|
-
key:
|
|
3208
|
-
}),
|
|
3334
|
+
key: v
|
|
3335
|
+
}), f = d, h = S, p = []);
|
|
3209
3336
|
} else if (typeof b[3] < "u") {
|
|
3210
|
-
const
|
|
3211
|
-
y(
|
|
3337
|
+
const d = Number(b[3]), x = t[d], A = `interp-${d}`;
|
|
3338
|
+
y(x, A);
|
|
3212
3339
|
} else if (b[4]) {
|
|
3213
|
-
const
|
|
3340
|
+
const d = b[4], x = f ? p : a, A = d.split(/({{\d+}})/);
|
|
3214
3341
|
for (const C of A) {
|
|
3215
3342
|
if (!C) continue;
|
|
3216
3343
|
const E = C.match(/^{{(\d+)}}$/);
|
|
@@ -3219,32 +3346,32 @@ function or(e, t, r) {
|
|
|
3219
3346
|
y(R, S);
|
|
3220
3347
|
} else {
|
|
3221
3348
|
const T = `text-${w++}`;
|
|
3222
|
-
|
|
3349
|
+
x.push(c(C, T));
|
|
3223
3350
|
}
|
|
3224
3351
|
}
|
|
3225
3352
|
}
|
|
3226
3353
|
}
|
|
3227
|
-
const
|
|
3228
|
-
if (
|
|
3229
|
-
const
|
|
3230
|
-
return s && o &&
|
|
3231
|
-
} else if (
|
|
3232
|
-
const
|
|
3233
|
-
return s && o &&
|
|
3354
|
+
const k = a.filter((d) => Ce(d) && d.tag === "#text" ? typeof d.children == "string" && d.children.trim() !== "" : !0);
|
|
3355
|
+
if (k.length === 1) {
|
|
3356
|
+
const d = k[0];
|
|
3357
|
+
return s && o && Ie.set(o, d), d;
|
|
3358
|
+
} else if (k.length > 1) {
|
|
3359
|
+
const d = k;
|
|
3360
|
+
return s && o && Ie.set(o, d), d;
|
|
3234
3361
|
}
|
|
3235
3362
|
return he("div", {}, "", "fallback-root");
|
|
3236
3363
|
}
|
|
3237
|
-
function
|
|
3238
|
-
const r = t[t.length - 1],
|
|
3239
|
-
return or(e, t,
|
|
3364
|
+
function ae(e, ...t) {
|
|
3365
|
+
const r = t[t.length - 1], n = typeof r == "object" && r && !Array.isArray(r) ? r : void 0;
|
|
3366
|
+
return or(e, t, n);
|
|
3240
3367
|
}
|
|
3241
3368
|
function Re(e, t) {
|
|
3242
3369
|
return j(e ? t : [], "when-block");
|
|
3243
3370
|
}
|
|
3244
|
-
function
|
|
3245
|
-
return e.map((r,
|
|
3246
|
-
const
|
|
3247
|
-
return j(t(r,
|
|
3371
|
+
function xr(e, t) {
|
|
3372
|
+
return e.map((r, n) => {
|
|
3373
|
+
const i = typeof r == "object" ? r?.key ?? r?.id ?? `idx-${n}` : String(r);
|
|
3374
|
+
return j(t(r, n), `each-${i}`);
|
|
3248
3375
|
});
|
|
3249
3376
|
}
|
|
3250
3377
|
function ar() {
|
|
@@ -3263,8 +3390,8 @@ function ar() {
|
|
|
3263
3390
|
}
|
|
3264
3391
|
function cr(...e) {
|
|
3265
3392
|
for (let t = 0; t < e.length; t++) {
|
|
3266
|
-
const [r,
|
|
3267
|
-
if (r) return [j(
|
|
3393
|
+
const [r, n] = e[t];
|
|
3394
|
+
if (r) return [j(n, `whenChain-branch-${t}`)];
|
|
3268
3395
|
}
|
|
3269
3396
|
return [j([], "whenChain-empty")];
|
|
3270
3397
|
}
|
|
@@ -3288,12 +3415,12 @@ function Cr(e, t) {
|
|
|
3288
3415
|
return Re(r, t);
|
|
3289
3416
|
}
|
|
3290
3417
|
function _r(e, t, r) {
|
|
3291
|
-
const
|
|
3292
|
-
return e.forEach((
|
|
3293
|
-
t(
|
|
3294
|
-
}),
|
|
3295
|
-
const
|
|
3296
|
-
return j(r(
|
|
3418
|
+
const n = [];
|
|
3419
|
+
return e.forEach((i, s) => {
|
|
3420
|
+
t(i, s) && n.push({ item: i, originalIndex: s });
|
|
3421
|
+
}), n.map(({ item: i, originalIndex: s }, o) => {
|
|
3422
|
+
const c = typeof i == "object" && i != null ? i?.key ?? i?.id ?? `filtered-${s}` : `filtered-${s}`;
|
|
3423
|
+
return j(r(i, s, o), `each-where-${c}`);
|
|
3297
3424
|
});
|
|
3298
3425
|
}
|
|
3299
3426
|
function Er(e, t) {
|
|
@@ -3301,20 +3428,20 @@ function Er(e, t) {
|
|
|
3301
3428
|
return r === 0 && t.empty ? j(t.empty, "switch-length-empty") : r === 1 && t.one ? j(t.one(e[0]), "switch-length-one") : t.exactly?.[r] ? j(t.exactly[r](e), `switch-length-${r}`) : r > 1 && t.many ? j(t.many(e), "switch-length-many") : j([], "switch-length-fallback");
|
|
3302
3429
|
}
|
|
3303
3430
|
function Sr(e, t, r) {
|
|
3304
|
-
const
|
|
3305
|
-
return e.forEach((
|
|
3306
|
-
const s = t(
|
|
3307
|
-
|
|
3308
|
-
}), Array.from(
|
|
3309
|
-
r(
|
|
3310
|
-
`each-group-${
|
|
3431
|
+
const n = /* @__PURE__ */ new Map();
|
|
3432
|
+
return e.forEach((i) => {
|
|
3433
|
+
const s = t(i);
|
|
3434
|
+
n.has(s) || n.set(s, []), n.get(s).push(i);
|
|
3435
|
+
}), Array.from(n.entries()).map(([i, s], o) => j(
|
|
3436
|
+
r(i, s, o),
|
|
3437
|
+
`each-group-${i}`
|
|
3311
3438
|
));
|
|
3312
3439
|
}
|
|
3313
|
-
function Ar(e, t, r,
|
|
3314
|
-
const
|
|
3315
|
-
return e.slice(
|
|
3316
|
-
const m =
|
|
3317
|
-
return j(
|
|
3440
|
+
function Ar(e, t, r, n) {
|
|
3441
|
+
const i = r * t, s = Math.min(i + t, e.length);
|
|
3442
|
+
return e.slice(i, s).map((c, u) => {
|
|
3443
|
+
const m = i + u, g = typeof c == "object" && c != null ? c?.key ?? c?.id ?? `page-${m}` : `page-${m}`;
|
|
3444
|
+
return j(n(c, m, u), `each-page-${g}`);
|
|
3318
3445
|
});
|
|
3319
3446
|
}
|
|
3320
3447
|
function Tr(e, t) {
|
|
@@ -3355,45 +3482,45 @@ const te = {
|
|
|
3355
3482
|
function Rr(e, t) {
|
|
3356
3483
|
const r = [];
|
|
3357
3484
|
e.includes("dark") ? r.push(te.dark) : e.includes("light") && r.push("(prefers-color-scheme: light)");
|
|
3358
|
-
const
|
|
3485
|
+
const n = e.filter(
|
|
3359
3486
|
(o) => lt.includes(o)
|
|
3360
|
-
),
|
|
3361
|
-
|
|
3487
|
+
), i = n[n.length - 1];
|
|
3488
|
+
i && i in te && r.push(te[i]);
|
|
3362
3489
|
const s = r.length > 0 ? r.join(" and ") : "all";
|
|
3363
3490
|
return q(s, t);
|
|
3364
3491
|
}
|
|
3365
3492
|
function Or(e) {
|
|
3366
3493
|
const t = [];
|
|
3367
3494
|
return e.base && t.push(j(e.base, "responsive-base")), lt.forEach((r) => {
|
|
3368
|
-
const
|
|
3369
|
-
|
|
3495
|
+
const n = e[r];
|
|
3496
|
+
n && t.push(lr[r](n));
|
|
3370
3497
|
}), t;
|
|
3371
3498
|
}
|
|
3372
3499
|
function Pr(e) {
|
|
3373
3500
|
const t = [];
|
|
3374
3501
|
let r = null;
|
|
3375
3502
|
return {
|
|
3376
|
-
case(
|
|
3377
|
-
const s = typeof
|
|
3378
|
-
return t.push({ condition: s, content:
|
|
3503
|
+
case(n, i) {
|
|
3504
|
+
const s = typeof n == "function" ? n : (o) => o === n;
|
|
3505
|
+
return t.push({ condition: s, content: i }), this;
|
|
3379
3506
|
},
|
|
3380
|
-
when(
|
|
3381
|
-
return t.push({ condition:
|
|
3507
|
+
when(n, i) {
|
|
3508
|
+
return t.push({ condition: n, content: i }), this;
|
|
3382
3509
|
},
|
|
3383
|
-
otherwise(
|
|
3384
|
-
return r =
|
|
3510
|
+
otherwise(n) {
|
|
3511
|
+
return r = n, this;
|
|
3385
3512
|
},
|
|
3386
3513
|
done() {
|
|
3387
|
-
for (let
|
|
3388
|
-
const { condition:
|
|
3389
|
-
if (
|
|
3390
|
-
return j(s, `switch-case-${
|
|
3514
|
+
for (let n = 0; n < t.length; n++) {
|
|
3515
|
+
const { condition: i, content: s } = t[n];
|
|
3516
|
+
if (i(e))
|
|
3517
|
+
return j(s, `switch-case-${n}`);
|
|
3391
3518
|
}
|
|
3392
3519
|
return j(r || [], "switch-otherwise");
|
|
3393
3520
|
}
|
|
3394
3521
|
};
|
|
3395
3522
|
}
|
|
3396
|
-
class
|
|
3523
|
+
class fe extends EventTarget {
|
|
3397
3524
|
handlers = {};
|
|
3398
3525
|
static instance;
|
|
3399
3526
|
eventCounters = /* @__PURE__ */ new Map();
|
|
@@ -3401,7 +3528,7 @@ class de extends EventTarget {
|
|
|
3401
3528
|
* Returns the singleton instance of GlobalEventBus
|
|
3402
3529
|
*/
|
|
3403
3530
|
static getInstance() {
|
|
3404
|
-
return
|
|
3531
|
+
return fe.instance || (fe.instance = new fe()), fe.instance;
|
|
3405
3532
|
}
|
|
3406
3533
|
/**
|
|
3407
3534
|
* Emit a global event with optional data. Includes event storm protection.
|
|
@@ -3409,10 +3536,10 @@ class de extends EventTarget {
|
|
|
3409
3536
|
* @param data - Optional event payload
|
|
3410
3537
|
*/
|
|
3411
3538
|
emit(t, r) {
|
|
3412
|
-
const
|
|
3413
|
-
if (!
|
|
3414
|
-
this.eventCounters.set(t, { count: 1, window:
|
|
3415
|
-
else if (
|
|
3539
|
+
const n = Date.now(), i = this.eventCounters.get(t);
|
|
3540
|
+
if (!i || n - i.window > 1e3)
|
|
3541
|
+
this.eventCounters.set(t, { count: 1, window: n });
|
|
3542
|
+
else if (i.count++, i.count > 50 && i.count > 100)
|
|
3416
3543
|
return;
|
|
3417
3544
|
this.dispatchEvent(new CustomEvent(t, {
|
|
3418
3545
|
detail: r,
|
|
@@ -3424,8 +3551,8 @@ class de extends EventTarget {
|
|
|
3424
3551
|
s && s.forEach((o) => {
|
|
3425
3552
|
try {
|
|
3426
3553
|
o(r);
|
|
3427
|
-
} catch (
|
|
3428
|
-
|
|
3554
|
+
} catch (c) {
|
|
3555
|
+
ie(`Error in global event handler for "${t}":`, c);
|
|
3429
3556
|
}
|
|
3430
3557
|
});
|
|
3431
3558
|
}
|
|
@@ -3443,8 +3570,8 @@ class de extends EventTarget {
|
|
|
3443
3570
|
* @param handler - Handler function to remove
|
|
3444
3571
|
*/
|
|
3445
3572
|
off(t, r) {
|
|
3446
|
-
const
|
|
3447
|
-
|
|
3573
|
+
const n = this.handlers[t];
|
|
3574
|
+
n && n.delete(r);
|
|
3448
3575
|
}
|
|
3449
3576
|
/**
|
|
3450
3577
|
* Remove all handlers for a specific event.
|
|
@@ -3459,8 +3586,8 @@ class de extends EventTarget {
|
|
|
3459
3586
|
* @param handler - CustomEvent handler
|
|
3460
3587
|
* @param options - AddEventListener options
|
|
3461
3588
|
*/
|
|
3462
|
-
listen(t, r,
|
|
3463
|
-
return this.addEventListener(t, r,
|
|
3589
|
+
listen(t, r, n) {
|
|
3590
|
+
return this.addEventListener(t, r, n), () => this.removeEventListener(t, r);
|
|
3464
3591
|
}
|
|
3465
3592
|
/**
|
|
3466
3593
|
* Register a one-time event handler. Returns a promise that resolves with the event data.
|
|
@@ -3468,9 +3595,9 @@ class de extends EventTarget {
|
|
|
3468
3595
|
* @param handler - Handler function
|
|
3469
3596
|
*/
|
|
3470
3597
|
once(t, r) {
|
|
3471
|
-
return new Promise((
|
|
3472
|
-
const
|
|
3473
|
-
|
|
3598
|
+
return new Promise((n) => {
|
|
3599
|
+
const i = this.on(t, (s) => {
|
|
3600
|
+
i(), r(s), n(s);
|
|
3474
3601
|
});
|
|
3475
3602
|
});
|
|
3476
3603
|
}
|
|
@@ -3500,9 +3627,9 @@ class de extends EventTarget {
|
|
|
3500
3627
|
*/
|
|
3501
3628
|
getEventStats() {
|
|
3502
3629
|
const t = {};
|
|
3503
|
-
for (const [r,
|
|
3630
|
+
for (const [r, n] of this.eventCounters.entries())
|
|
3504
3631
|
t[r] = {
|
|
3505
|
-
count:
|
|
3632
|
+
count: n.count,
|
|
3506
3633
|
handlersCount: this.getHandlerCount(r)
|
|
3507
3634
|
};
|
|
3508
3635
|
return t;
|
|
@@ -3514,44 +3641,44 @@ class de extends EventTarget {
|
|
|
3514
3641
|
this.eventCounters.clear();
|
|
3515
3642
|
}
|
|
3516
3643
|
}
|
|
3517
|
-
const be =
|
|
3644
|
+
const be = fe.getInstance(), Lr = (e, t) => be.emit(e, t), Mr = (e, t) => be.on(e, t), jr = (e, t) => be.off(e, t), Wr = (e, t) => be.once(e, t), Nr = (e, t, r) => be.listen(e, t, r);
|
|
3518
3645
|
function tt(e) {
|
|
3519
3646
|
let t = { ...e };
|
|
3520
3647
|
const r = [];
|
|
3521
|
-
function
|
|
3522
|
-
r.push(
|
|
3648
|
+
function n(c) {
|
|
3649
|
+
r.push(c), c(t);
|
|
3523
3650
|
}
|
|
3524
|
-
function
|
|
3651
|
+
function i() {
|
|
3525
3652
|
return t;
|
|
3526
3653
|
}
|
|
3527
|
-
function s(
|
|
3528
|
-
const u = typeof
|
|
3654
|
+
function s(c) {
|
|
3655
|
+
const u = typeof c == "function" ? c(t) : c;
|
|
3529
3656
|
t = { ...t, ...u }, o();
|
|
3530
3657
|
}
|
|
3531
3658
|
function o() {
|
|
3532
|
-
r.forEach((
|
|
3659
|
+
r.forEach((c) => c(t));
|
|
3533
3660
|
}
|
|
3534
|
-
return { subscribe:
|
|
3661
|
+
return { subscribe: n, getState: i, setState: s };
|
|
3535
3662
|
}
|
|
3536
3663
|
const rt = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, Q = (e, t) => {
|
|
3537
3664
|
for (const r of e) {
|
|
3538
|
-
const
|
|
3665
|
+
const n = [], i = r.path.replace(/:[^/]+/g, (c) => (n.push(c.slice(1)), "([^/]+)")), s = new RegExp(`^${i}$`), o = t.match(s);
|
|
3539
3666
|
if (o) {
|
|
3540
|
-
const
|
|
3541
|
-
return
|
|
3542
|
-
|
|
3543
|
-
}), { route: r, params:
|
|
3667
|
+
const c = {};
|
|
3668
|
+
return n.forEach((u, m) => {
|
|
3669
|
+
c[u] = o[m + 1];
|
|
3670
|
+
}), { route: r, params: c };
|
|
3544
3671
|
}
|
|
3545
3672
|
}
|
|
3546
3673
|
return { route: null, params: {} };
|
|
3547
|
-
},
|
|
3674
|
+
}, De = {};
|
|
3548
3675
|
async function ur(e) {
|
|
3549
3676
|
if (e.component) return e.component;
|
|
3550
3677
|
if (e.load) {
|
|
3551
|
-
if (
|
|
3678
|
+
if (De[e.path]) return De[e.path];
|
|
3552
3679
|
try {
|
|
3553
3680
|
const t = await e.load();
|
|
3554
|
-
return
|
|
3681
|
+
return De[e.path] = t.default, t.default;
|
|
3555
3682
|
} catch {
|
|
3556
3683
|
throw new Error(`Failed to load component for route: ${e.path}`);
|
|
3557
3684
|
}
|
|
@@ -3559,125 +3686,125 @@ async function ur(e) {
|
|
|
3559
3686
|
throw new Error(`No component or loader defined for route: ${e.path}`);
|
|
3560
3687
|
}
|
|
3561
3688
|
function fr(e) {
|
|
3562
|
-
const { routes: t, base: r = "", initialUrl:
|
|
3563
|
-
let
|
|
3564
|
-
const b = async (
|
|
3565
|
-
const
|
|
3566
|
-
if (
|
|
3689
|
+
const { routes: t, base: r = "", initialUrl: n } = e;
|
|
3690
|
+
let i, s, o, c, u, m, g;
|
|
3691
|
+
const b = async (v, w) => {
|
|
3692
|
+
const a = t.find((l) => Q([l], v.path).route !== null);
|
|
3693
|
+
if (a?.beforeEnter)
|
|
3567
3694
|
try {
|
|
3568
|
-
const
|
|
3569
|
-
return typeof
|
|
3570
|
-
} catch (
|
|
3571
|
-
return
|
|
3695
|
+
const l = await a.beforeEnter(v, w);
|
|
3696
|
+
return typeof l == "string" ? (await h(l, !0), !1) : l !== !1;
|
|
3697
|
+
} catch (l) {
|
|
3698
|
+
return ie("beforeEnter error", l), !1;
|
|
3572
3699
|
}
|
|
3573
3700
|
return !0;
|
|
3574
|
-
}, p = async (
|
|
3575
|
-
const
|
|
3576
|
-
if (
|
|
3701
|
+
}, p = async (v, w) => {
|
|
3702
|
+
const a = t.find((l) => Q([l], v.path).route !== null);
|
|
3703
|
+
if (a?.onEnter)
|
|
3577
3704
|
try {
|
|
3578
|
-
const
|
|
3579
|
-
return typeof
|
|
3580
|
-
} catch (
|
|
3581
|
-
return
|
|
3705
|
+
const l = await a.onEnter(v, w);
|
|
3706
|
+
return typeof l == "string" ? (await h(l, !0), !1) : l !== !1;
|
|
3707
|
+
} catch (l) {
|
|
3708
|
+
return ie("onEnter error", l), !1;
|
|
3582
3709
|
}
|
|
3583
3710
|
return !0;
|
|
3584
|
-
},
|
|
3585
|
-
const
|
|
3586
|
-
if (
|
|
3711
|
+
}, f = (v, w) => {
|
|
3712
|
+
const a = t.find((l) => Q([l], v.path).route !== null);
|
|
3713
|
+
if (a?.afterEnter)
|
|
3587
3714
|
try {
|
|
3588
|
-
|
|
3589
|
-
} catch (
|
|
3590
|
-
|
|
3715
|
+
a.afterEnter(v, w);
|
|
3716
|
+
} catch (l) {
|
|
3717
|
+
ie("afterEnter error", l);
|
|
3591
3718
|
}
|
|
3592
|
-
},
|
|
3719
|
+
}, h = async (v, w = !1) => {
|
|
3593
3720
|
try {
|
|
3594
|
-
const
|
|
3595
|
-
path:
|
|
3721
|
+
const a = {
|
|
3722
|
+
path: v.replace(r, "") || "/",
|
|
3596
3723
|
query: {}
|
|
3597
|
-
},
|
|
3598
|
-
if (!
|
|
3599
|
-
const y = o.getState(),
|
|
3600
|
-
path:
|
|
3601
|
-
params:
|
|
3602
|
-
query:
|
|
3724
|
+
}, l = Q(t, a.path);
|
|
3725
|
+
if (!l) throw new Error(`No route found for ${a.path}`);
|
|
3726
|
+
const y = o.getState(), $ = {
|
|
3727
|
+
path: a.path,
|
|
3728
|
+
params: l.params,
|
|
3729
|
+
query: a.query
|
|
3603
3730
|
};
|
|
3604
|
-
if (!await b(
|
|
3605
|
-
typeof window < "u" && typeof document < "u" && (w ? window.history.replaceState({}, "", r +
|
|
3606
|
-
} catch (
|
|
3607
|
-
|
|
3731
|
+
if (!await b($, y) || !await p($, y)) return;
|
|
3732
|
+
typeof window < "u" && typeof document < "u" && (w ? window.history.replaceState({}, "", r + v) : window.history.pushState({}, "", r + v)), o.setState($), f($, y);
|
|
3733
|
+
} catch (a) {
|
|
3734
|
+
ie("Navigation error:", a);
|
|
3608
3735
|
}
|
|
3609
3736
|
};
|
|
3610
|
-
if (typeof window < "u" && typeof document < "u" && typeof
|
|
3611
|
-
|
|
3612
|
-
const w = new URL(window.location.href),
|
|
3613
|
-
return { path:
|
|
3614
|
-
}, s =
|
|
3615
|
-
const
|
|
3737
|
+
if (typeof window < "u" && typeof document < "u" && typeof n > "u") {
|
|
3738
|
+
i = () => {
|
|
3739
|
+
const w = new URL(window.location.href), a = w.pathname.replace(r, "") || "/", l = rt(w.search);
|
|
3740
|
+
return { path: a, query: l };
|
|
3741
|
+
}, s = i();
|
|
3742
|
+
const v = Q(t, s.path);
|
|
3616
3743
|
o = tt({
|
|
3617
3744
|
path: s.path,
|
|
3618
|
-
params:
|
|
3745
|
+
params: v.params,
|
|
3619
3746
|
query: s.query
|
|
3620
|
-
}),
|
|
3621
|
-
const
|
|
3622
|
-
await
|
|
3623
|
-
}, window.addEventListener("popstate", () =>
|
|
3747
|
+
}), c = async (w = !1) => {
|
|
3748
|
+
const a = i();
|
|
3749
|
+
await h(a.path, w);
|
|
3750
|
+
}, window.addEventListener("popstate", () => c(!0)), u = (w) => h(w, !1), m = (w) => h(w, !0), g = () => window.history.back();
|
|
3624
3751
|
} else {
|
|
3625
|
-
|
|
3626
|
-
const
|
|
3627
|
-
return { path:
|
|
3628
|
-
}, s =
|
|
3629
|
-
const
|
|
3752
|
+
i = () => {
|
|
3753
|
+
const a = new URL(n || "/", "http://localhost"), l = a.pathname.replace(r, "") || "/", y = rt(a.search);
|
|
3754
|
+
return { path: l, query: y };
|
|
3755
|
+
}, s = i();
|
|
3756
|
+
const v = Q(t, s.path);
|
|
3630
3757
|
o = tt({
|
|
3631
3758
|
path: s.path,
|
|
3632
|
-
params:
|
|
3759
|
+
params: v.params,
|
|
3633
3760
|
query: s.query
|
|
3634
|
-
}),
|
|
3635
|
-
const
|
|
3636
|
-
await w(
|
|
3761
|
+
}), c = async () => {
|
|
3762
|
+
const a = i();
|
|
3763
|
+
await w(a.path);
|
|
3637
3764
|
};
|
|
3638
|
-
const w = async (
|
|
3765
|
+
const w = async (a) => {
|
|
3639
3766
|
try {
|
|
3640
|
-
const
|
|
3641
|
-
path:
|
|
3767
|
+
const l = {
|
|
3768
|
+
path: a.replace(r, "") || "/",
|
|
3642
3769
|
query: {}
|
|
3643
|
-
}, y = Q(t,
|
|
3644
|
-
if (!y) throw new Error(`No route found for ${
|
|
3645
|
-
const
|
|
3646
|
-
path:
|
|
3770
|
+
}, y = Q(t, l.path);
|
|
3771
|
+
if (!y) throw new Error(`No route found for ${l.path}`);
|
|
3772
|
+
const $ = o.getState(), k = {
|
|
3773
|
+
path: l.path,
|
|
3647
3774
|
params: y.params,
|
|
3648
|
-
query:
|
|
3649
|
-
},
|
|
3650
|
-
if (
|
|
3775
|
+
query: l.query
|
|
3776
|
+
}, d = t.find((x) => Q([x], k.path).route !== null);
|
|
3777
|
+
if (d?.beforeEnter)
|
|
3651
3778
|
try {
|
|
3652
|
-
const
|
|
3653
|
-
if (typeof
|
|
3654
|
-
await w(
|
|
3779
|
+
const x = await d.beforeEnter(k, $);
|
|
3780
|
+
if (typeof x == "string") {
|
|
3781
|
+
await w(x);
|
|
3655
3782
|
return;
|
|
3656
3783
|
}
|
|
3657
|
-
if (
|
|
3784
|
+
if (x === !1) return;
|
|
3658
3785
|
} catch {
|
|
3659
3786
|
return;
|
|
3660
3787
|
}
|
|
3661
|
-
if (
|
|
3788
|
+
if (d?.onEnter)
|
|
3662
3789
|
try {
|
|
3663
|
-
const
|
|
3664
|
-
if (typeof
|
|
3665
|
-
await w(
|
|
3790
|
+
const x = await d.onEnter(k, $);
|
|
3791
|
+
if (typeof x == "string") {
|
|
3792
|
+
await w(x);
|
|
3666
3793
|
return;
|
|
3667
3794
|
}
|
|
3668
|
-
if (
|
|
3795
|
+
if (x === !1) return;
|
|
3669
3796
|
} catch {
|
|
3670
3797
|
return;
|
|
3671
3798
|
}
|
|
3672
|
-
if (o.setState(
|
|
3799
|
+
if (o.setState(k), d?.afterEnter)
|
|
3673
3800
|
try {
|
|
3674
|
-
|
|
3801
|
+
d.afterEnter(k, $);
|
|
3675
3802
|
} catch {
|
|
3676
3803
|
}
|
|
3677
3804
|
} catch {
|
|
3678
3805
|
}
|
|
3679
3806
|
};
|
|
3680
|
-
u = async (
|
|
3807
|
+
u = async (a) => w(a), m = async (a) => w(a), g = () => {
|
|
3681
3808
|
};
|
|
3682
3809
|
}
|
|
3683
3810
|
return {
|
|
@@ -3686,7 +3813,7 @@ function fr(e) {
|
|
|
3686
3813
|
replace: m,
|
|
3687
3814
|
back: g,
|
|
3688
3815
|
subscribe: o.subscribe,
|
|
3689
|
-
matchRoute: (
|
|
3816
|
+
matchRoute: (v) => Q(t, v),
|
|
3690
3817
|
getCurrent: () => o.getState(),
|
|
3691
3818
|
resolveRouteComponent: ur
|
|
3692
3819
|
};
|
|
@@ -3694,68 +3821,68 @@ function fr(e) {
|
|
|
3694
3821
|
function zr(e, t) {
|
|
3695
3822
|
return Q(e, t);
|
|
3696
3823
|
}
|
|
3697
|
-
function
|
|
3824
|
+
function Ir(e) {
|
|
3698
3825
|
const t = fr(e);
|
|
3699
|
-
return et("router-view", (r = {},
|
|
3700
|
-
const { onConnected:
|
|
3701
|
-
if (
|
|
3826
|
+
return et("router-view", (r = {}, n = {}) => {
|
|
3827
|
+
const { onConnected: i } = n;
|
|
3828
|
+
if (i && i(() => {
|
|
3702
3829
|
t && typeof t.subscribe == "function" && t.subscribe(() => {
|
|
3703
3830
|
});
|
|
3704
|
-
}), !t) return
|
|
3705
|
-
const s = t.getCurrent(), { path: o } = s,
|
|
3706
|
-
return
|
|
3831
|
+
}), !t) return ae`<div>Router not initialized.</div>`;
|
|
3832
|
+
const s = t.getCurrent(), { path: o } = s, c = t.matchRoute(o);
|
|
3833
|
+
return c.route ? t.resolveRouteComponent(c.route).then((u) => {
|
|
3707
3834
|
if (typeof u == "string")
|
|
3708
3835
|
return { tag: u, props: {}, children: [] };
|
|
3709
3836
|
if (typeof u == "function") {
|
|
3710
3837
|
const m = u();
|
|
3711
3838
|
return (m instanceof Promise ? m : Promise.resolve(m)).then((b) => typeof b == "string" ? { tag: b, props: {}, children: [] } : b);
|
|
3712
3839
|
}
|
|
3713
|
-
return
|
|
3714
|
-
}).catch(() =>
|
|
3715
|
-
}), et("router-link", (r = {},
|
|
3840
|
+
return ae`<div>Invalid route component</div>`;
|
|
3841
|
+
}).catch(() => ae`<div>Invalid route component</div>`) : ae`<div>Not found</div>`;
|
|
3842
|
+
}), et("router-link", (r = {}, n = {}) => {
|
|
3716
3843
|
const {
|
|
3717
|
-
to:
|
|
3844
|
+
to: i = "",
|
|
3718
3845
|
tag: s = "a",
|
|
3719
3846
|
replace: o = !1,
|
|
3720
|
-
exact:
|
|
3847
|
+
exact: c = !1,
|
|
3721
3848
|
activeClass: u = "active",
|
|
3722
3849
|
exactActiveClass: m = "exact-active",
|
|
3723
3850
|
ariaCurrentValue: g = "page",
|
|
3724
3851
|
disabled: b = !1,
|
|
3725
3852
|
external: p = !1,
|
|
3726
|
-
class:
|
|
3727
|
-
} = r,
|
|
3728
|
-
for (const C of
|
|
3729
|
-
const
|
|
3853
|
+
class: f = ""
|
|
3854
|
+
} = r, h = t.getCurrent(), v = h.path === i, w = c ? v : h && typeof h.path == "string" ? h.path.startsWith(i) : !1, a = v ? `aria-current="${g}"` : "", l = (f || "").split(/\s+/).filter(Boolean), y = {};
|
|
3855
|
+
for (const C of l) y[C] = !0;
|
|
3856
|
+
const $ = {
|
|
3730
3857
|
...y,
|
|
3731
3858
|
// Also include the configurable names (may duplicate the above)
|
|
3732
3859
|
[u]: w,
|
|
3733
|
-
[m]:
|
|
3734
|
-
},
|
|
3860
|
+
[m]: v
|
|
3861
|
+
}, k = s === "button", d = b ? k ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", x = p && (s === "a" || !s) ? 'target="_blank" rel="noopener noreferrer"' : "", A = (C) => {
|
|
3735
3862
|
if (b) {
|
|
3736
3863
|
C.preventDefault();
|
|
3737
3864
|
return;
|
|
3738
3865
|
}
|
|
3739
|
-
p && (s === "a" || !s) || (C.preventDefault(), o ? t.replace(
|
|
3866
|
+
p && (s === "a" || !s) || (C.preventDefault(), o ? t.replace(i) : t.push(i));
|
|
3740
3867
|
};
|
|
3741
|
-
return
|
|
3742
|
-
${ar().when(
|
|
3868
|
+
return ae`
|
|
3869
|
+
${ar().when(k, ae`
|
|
3743
3870
|
<button
|
|
3744
3871
|
part="button"
|
|
3745
|
-
:class="${
|
|
3746
|
-
${
|
|
3747
|
-
${
|
|
3748
|
-
${
|
|
3872
|
+
:class="${$}"
|
|
3873
|
+
${a}
|
|
3874
|
+
${d}
|
|
3875
|
+
${x}
|
|
3749
3876
|
@click="${A}"
|
|
3750
3877
|
><slot></slot></button>
|
|
3751
|
-
`).otherwise(
|
|
3878
|
+
`).otherwise(ae`
|
|
3752
3879
|
<a
|
|
3753
3880
|
part="link"
|
|
3754
|
-
href="${
|
|
3755
|
-
:class="${
|
|
3756
|
-
${
|
|
3757
|
-
${
|
|
3758
|
-
${
|
|
3881
|
+
href="${i}"
|
|
3882
|
+
:class="${$}"
|
|
3883
|
+
${a}
|
|
3884
|
+
${d}
|
|
3885
|
+
${x}
|
|
3759
3886
|
@click="${A}"
|
|
3760
3887
|
><slot></slot></a>
|
|
3761
3888
|
`).done()}
|
|
@@ -3763,20 +3890,20 @@ function Dr(e) {
|
|
|
3763
3890
|
}), t;
|
|
3764
3891
|
}
|
|
3765
3892
|
export {
|
|
3766
|
-
|
|
3893
|
+
fe as GlobalEventBus,
|
|
3767
3894
|
j as anchorBlock,
|
|
3768
3895
|
et as component,
|
|
3769
3896
|
hr as computed,
|
|
3770
3897
|
tt as createStore,
|
|
3771
3898
|
Pt as css,
|
|
3772
|
-
|
|
3899
|
+
xr as each,
|
|
3773
3900
|
Sr as eachGroup,
|
|
3774
3901
|
Ar as eachPage,
|
|
3775
3902
|
_r as eachWhere,
|
|
3776
3903
|
Lr as emit,
|
|
3777
3904
|
be as eventBus,
|
|
3778
|
-
|
|
3779
|
-
|
|
3905
|
+
ae as html,
|
|
3906
|
+
Ir as initRouter,
|
|
3780
3907
|
Nr as listen,
|
|
3781
3908
|
ar as match,
|
|
3782
3909
|
Q as matchRoute,
|
|
@@ -3802,7 +3929,7 @@ export {
|
|
|
3802
3929
|
yr as useOnDisconnected,
|
|
3803
3930
|
wr as useOnError,
|
|
3804
3931
|
fr as useRouter,
|
|
3805
|
-
|
|
3932
|
+
vr as useStyle,
|
|
3806
3933
|
pr as watch,
|
|
3807
3934
|
Re as when,
|
|
3808
3935
|
kr as whenEmpty,
|