@jasonshimmy/custom-elements-runtime 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-elements-runtime.cjs.js +12 -12
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +958 -988
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +10 -10
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/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 i = r || t.toString();
|
|
10
|
+
this.pendingUpdates.set(i, t), this.isFlushScheduled || (this.isFlushScheduled = !0, typeof globalThis.process < "u" && globalThis.process.env?.NODE_ENV === "test" || typeof window < "u" && (window.__vitest__ || window.Cypress) ? this.flush() : queueMicrotask(() => this.flush()));
|
|
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 (i) {
|
|
22
|
+
typeof console < "u" && console.error && console.error("Error in batched update:", i);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
@@ -29,23 +29,23 @@ class dt {
|
|
|
29
29
|
return this.pendingUpdates.size;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
const
|
|
32
|
+
const ht = new dt();
|
|
33
33
|
function fe(e, t) {
|
|
34
|
-
|
|
34
|
+
ht.schedule(e, t);
|
|
35
35
|
}
|
|
36
36
|
const Fe = /* @__PURE__ */ new WeakSet();
|
|
37
|
-
class
|
|
37
|
+
class pt {
|
|
38
38
|
static cache = /* @__PURE__ */ new WeakMap();
|
|
39
39
|
static arrayHandlerCache = /* @__PURE__ */ new WeakMap();
|
|
40
40
|
static objectHandlerCache = /* @__PURE__ */ new WeakMap();
|
|
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, i = !1) {
|
|
45
|
+
const n = this.cache.get(t);
|
|
46
|
+
if (n)
|
|
47
|
+
return n;
|
|
48
|
+
const s = i ? 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 ht {
|
|
|
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: (i, n, s) => {
|
|
62
|
+
const o = Reflect.get(i, n, s);
|
|
63
|
+
return typeof o == "function" && typeof n == "string" && [
|
|
64
64
|
"push",
|
|
65
65
|
"pop",
|
|
66
66
|
"shift",
|
|
@@ -70,13 +70,13 @@ class ht {
|
|
|
70
70
|
"reverse",
|
|
71
71
|
"fill",
|
|
72
72
|
"copyWithin"
|
|
73
|
-
].includes(
|
|
74
|
-
const m = o.apply(
|
|
73
|
+
].includes(n) ? function(...u) {
|
|
74
|
+
const m = o.apply(i, u);
|
|
75
75
|
return t.triggerUpdate(), m;
|
|
76
76
|
} : o;
|
|
77
77
|
},
|
|
78
|
-
set: (
|
|
79
|
-
deleteProperty: (
|
|
78
|
+
set: (i, n, s) => (i[n] = t.makeReactiveValue(s), t.triggerUpdate(), !0),
|
|
79
|
+
deleteProperty: (i, n) => (delete i[n], t.triggerUpdate(), !0)
|
|
80
80
|
};
|
|
81
81
|
this.arrayHandlerCache.set(t, r);
|
|
82
82
|
}
|
|
@@ -88,9 +88,9 @@ class ht {
|
|
|
88
88
|
static getOrCreateObjectHandler(t) {
|
|
89
89
|
if (!this.objectHandlerCache.has(t)) {
|
|
90
90
|
const r = {
|
|
91
|
-
get: (
|
|
92
|
-
set: (
|
|
93
|
-
deleteProperty: (
|
|
91
|
+
get: (i, n, s) => Reflect.get(i, n, s),
|
|
92
|
+
set: (i, n, s) => (i[n] = t.makeReactiveValue(s), t.triggerUpdate(), !0),
|
|
93
|
+
deleteProperty: (i, n) => (delete i[n], 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, i) {
|
|
131
131
|
try {
|
|
132
132
|
if (Fe.has(t)) return t;
|
|
133
133
|
} catch {
|
|
134
134
|
}
|
|
135
|
-
const
|
|
135
|
+
const n = 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(i);
|
|
139
139
|
return o || (o = {
|
|
140
140
|
triggerUpdate: r,
|
|
141
|
-
makeReactiveValue:
|
|
142
|
-
}, s.set(
|
|
141
|
+
makeReactiveValue: i
|
|
142
|
+
}, s.set(i, o)), pt.getOrCreateProxy(t, o, n);
|
|
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, i = Date.now();
|
|
202
|
+
return i - r < 1e3 ? !1 : (this.lastWarningTime.set(t, i), !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, i = this.stateIndexCounter.get(r) || 0, n = `${r}:${i}`;
|
|
223
|
+
if (this.stateIndexCounter.set(r, i + 1), this.stateStorage.has(n))
|
|
224
|
+
return this.stateStorage.get(n);
|
|
225
225
|
const s = new He(t);
|
|
226
|
-
return this.stateStorage.set(
|
|
226
|
+
return this.stateStorage.set(n, 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 i = this.componentRenderFunctions.get(r);
|
|
240
|
+
i && fe(i, 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((i) => i.removeDependent(t)), this.componentDependencies.delete(t)), this.componentRenderFunctions.delete(t);
|
|
249
|
+
for (const i of Array.from(this.stateStorage.keys()))
|
|
250
|
+
i.startsWith(t + ":") && this.stateStorage.delete(i);
|
|
251
251
|
this.stateIndexCounter.delete(t);
|
|
252
252
|
}
|
|
253
253
|
}
|
|
@@ -291,7 +291,7 @@ class He {
|
|
|
291
291
|
);
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
|
-
function
|
|
294
|
+
function dr(e) {
|
|
295
295
|
return F.getOrCreateState(e === void 0 ? null : e);
|
|
296
296
|
}
|
|
297
297
|
function ee(e) {
|
|
@@ -307,7 +307,7 @@ function ee(e) {
|
|
|
307
307
|
return !1;
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function hr(e) {
|
|
311
311
|
const t = new He(e());
|
|
312
312
|
return {
|
|
313
313
|
get value() {
|
|
@@ -315,19 +315,19 @@ function fr(e) {
|
|
|
315
315
|
}
|
|
316
316
|
};
|
|
317
317
|
}
|
|
318
|
-
function
|
|
319
|
-
let
|
|
320
|
-
r.immediate && t(
|
|
321
|
-
const
|
|
322
|
-
F.setCurrentComponent(
|
|
318
|
+
function pr(e, t, r = {}) {
|
|
319
|
+
let i = e();
|
|
320
|
+
r.immediate && t(i, i);
|
|
321
|
+
const n = `watch-${Math.random().toString(36).substr(2, 9)}`, s = () => {
|
|
322
|
+
F.setCurrentComponent(n, s);
|
|
323
323
|
const o = e();
|
|
324
|
-
F.clearCurrentComponent(), o !==
|
|
324
|
+
F.clearCurrentComponent(), o !== i && (t(o, i), i = o);
|
|
325
325
|
};
|
|
326
|
-
return F.setCurrentComponent(
|
|
327
|
-
F.cleanup(
|
|
326
|
+
return F.setCurrentComponent(n, s), e(), F.clearCurrentComponent(), () => {
|
|
327
|
+
F.cleanup(n);
|
|
328
328
|
};
|
|
329
329
|
}
|
|
330
|
-
const xe = /* @__PURE__ */ new Map(), ve = /* @__PURE__ */ new Map(),
|
|
330
|
+
const xe = /* @__PURE__ */ new Map(), ve = /* @__PURE__ */ new Map(), $e = /* @__PURE__ */ new Map(), Ue = 500;
|
|
331
331
|
function re(e) {
|
|
332
332
|
if (xe.has(e))
|
|
333
333
|
return xe.get(e);
|
|
@@ -337,13 +337,13 @@ function re(e) {
|
|
|
337
337
|
function it(e) {
|
|
338
338
|
if (ve.has(e))
|
|
339
339
|
return ve.get(e);
|
|
340
|
-
const t = e.replace(/-([a-z])/g, (r,
|
|
340
|
+
const t = e.replace(/-([a-z])/g, (r, i) => i.toUpperCase());
|
|
341
341
|
return ve.size < Ue && ve.set(e, t), t;
|
|
342
342
|
}
|
|
343
343
|
function ie(e) {
|
|
344
344
|
if (typeof e == "string") {
|
|
345
|
-
if (
|
|
346
|
-
return
|
|
345
|
+
if ($e.has(e))
|
|
346
|
+
return $e.get(e);
|
|
347
347
|
const t = e.replace(
|
|
348
348
|
/[&<>"']/g,
|
|
349
349
|
(r) => ({
|
|
@@ -354,22 +354,22 @@ function ie(e) {
|
|
|
354
354
|
"'": "'"
|
|
355
355
|
})[r]
|
|
356
356
|
);
|
|
357
|
-
return t !== e &&
|
|
357
|
+
return t !== e && $e.size < Ue && $e.set(e, t), t;
|
|
358
358
|
}
|
|
359
359
|
return 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((i, n) => i?.[n], e);
|
|
364
364
|
return ee(r) ? r.value : r;
|
|
365
365
|
}
|
|
366
366
|
return t;
|
|
367
367
|
}
|
|
368
|
-
function
|
|
369
|
-
const
|
|
370
|
-
if (!
|
|
371
|
-
const s =
|
|
372
|
-
ee(s[
|
|
368
|
+
function _e(e, t, r) {
|
|
369
|
+
const i = String(t).split("."), n = i.pop();
|
|
370
|
+
if (!n) return;
|
|
371
|
+
const s = i.reduce((o, a) => (o[a] == null && (o[a] = {}), o[a]), e);
|
|
372
|
+
ee(s[n]) ? s[n].value = r : s[n] = r;
|
|
373
373
|
}
|
|
374
374
|
const st = typeof process < "u" && process.env?.NODE_ENV !== "production";
|
|
375
375
|
function se(e, ...t) {
|
|
@@ -380,33 +380,33 @@ function Oe(e, ...t) {
|
|
|
380
380
|
}
|
|
381
381
|
function mt(e, t, r) {
|
|
382
382
|
if (r)
|
|
383
|
-
for (const [
|
|
383
|
+
for (const [i, n] of Object.entries(r)) {
|
|
384
384
|
let s, o = {};
|
|
385
|
-
if (Array.isArray(
|
|
385
|
+
if (Array.isArray(n) ? (s = n[0], o = n[1] || {}) : s = n, t.set(i, {
|
|
386
386
|
callback: s,
|
|
387
387
|
options: o,
|
|
388
|
-
oldValue: H(e,
|
|
388
|
+
oldValue: H(e, i)
|
|
389
389
|
}), o.immediate)
|
|
390
390
|
try {
|
|
391
|
-
const a = H(e,
|
|
391
|
+
const a = H(e, i);
|
|
392
392
|
s(a, void 0, e);
|
|
393
393
|
} catch (a) {
|
|
394
|
-
se(`Error in immediate watcher for "${
|
|
394
|
+
se(`Error in immediate watcher for "${i}":`, a);
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
|
-
function yt(e, t, r,
|
|
399
|
-
const
|
|
398
|
+
function yt(e, t, r, i) {
|
|
399
|
+
const n = (o, a) => {
|
|
400
400
|
if (o === a) return !0;
|
|
401
401
|
if (typeof o != typeof a || typeof o != "object" || o === null || a === null) return !1;
|
|
402
402
|
if (Array.isArray(o) && Array.isArray(a))
|
|
403
|
-
return o.length !== a.length ? !1 : o.every((g, b) =>
|
|
403
|
+
return o.length !== a.length ? !1 : o.every((g, b) => n(g, a[b]));
|
|
404
404
|
const u = Object.keys(o), m = Object.keys(a);
|
|
405
|
-
return u.length !== m.length ? !1 : u.every((g) =>
|
|
405
|
+
return u.length !== m.length ? !1 : u.every((g) => n(o[g], a[g]));
|
|
406
406
|
}, s = t.get(r);
|
|
407
|
-
if (s && !i
|
|
407
|
+
if (s && !n(i, s.oldValue))
|
|
408
408
|
try {
|
|
409
|
-
s.callback(
|
|
409
|
+
s.callback(i, s.oldValue, e), s.oldValue = i;
|
|
410
410
|
} catch (o) {
|
|
411
411
|
se(`Error in watcher for "${r}":`, o);
|
|
412
412
|
}
|
|
@@ -414,7 +414,7 @@ function yt(e, t, r, n) {
|
|
|
414
414
|
if (a.options.deep && r.startsWith(o + "."))
|
|
415
415
|
try {
|
|
416
416
|
const u = H(e, o);
|
|
417
|
-
|
|
417
|
+
n(u, a.oldValue) || (a.callback(u, a.oldValue, e), a.oldValue = u);
|
|
418
418
|
} catch (u) {
|
|
419
419
|
se(`Error in deep watcher for "${o}":`, u);
|
|
420
420
|
}
|
|
@@ -423,33 +423,33 @@ 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(([i, n]) => {
|
|
427
|
+
const s = re(i), o = e.getAttribute(s);
|
|
428
|
+
if (n.type === Function && typeof e[i] == "function")
|
|
429
|
+
r[i] = e[i];
|
|
430
|
+
else if (typeof e[i] < "u")
|
|
431
431
|
try {
|
|
432
|
-
const a = e[
|
|
433
|
-
|
|
432
|
+
const a = e[i];
|
|
433
|
+
n.type === Boolean && typeof a == "boolean" || n.type === Number && typeof a == "number" || n.type === Function && typeof a == "function" ? r[i] = a : r[i] = ie(Ke(String(a), n.type));
|
|
434
434
|
} catch {
|
|
435
|
-
r[
|
|
435
|
+
r[i] = e[i];
|
|
436
436
|
}
|
|
437
|
-
else o !== null ? r[
|
|
437
|
+
else o !== null ? r[i] = ie(Ke(o, n.type)) : "default" in n && n.default !== void 0 && (r[i] = ie(n.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 xt(e, t, r,
|
|
444
|
-
e.onConnected && !r && (e.onConnected(t),
|
|
443
|
+
function xt(e, t, r, i) {
|
|
444
|
+
e.onConnected && !r && (e.onConnected(t), i(!0));
|
|
445
445
|
}
|
|
446
|
-
function vt(e, t, r,
|
|
447
|
-
e.onDisconnected && e.onDisconnected(t), r.forEach((u) => u()),
|
|
446
|
+
function vt(e, t, r, i, n, s, o, a) {
|
|
447
|
+
e.onDisconnected && e.onDisconnected(t), r.forEach((u) => u()), i(), n(), s(!1), o(null), a(!1);
|
|
448
448
|
}
|
|
449
|
-
function
|
|
450
|
-
e.onAttributeChanged && e.onAttributeChanged(t, r,
|
|
449
|
+
function $t(e, t, r, i, n) {
|
|
450
|
+
e.onAttributeChanged && e.onAttributeChanged(t, r, i, n);
|
|
451
451
|
}
|
|
452
|
-
class
|
|
452
|
+
class kt {
|
|
453
453
|
static cache = /* @__PURE__ */ new Map();
|
|
454
454
|
static maxCacheSize = 1e3;
|
|
455
455
|
// Dangerous patterns to block
|
|
@@ -471,24 +471,24 @@ class Ct {
|
|
|
471
471
|
/XMLHttpRequest/i
|
|
472
472
|
];
|
|
473
473
|
static evaluate(t, r) {
|
|
474
|
-
const
|
|
475
|
-
if (
|
|
476
|
-
if (!
|
|
474
|
+
const i = this.cache.get(t);
|
|
475
|
+
if (i) {
|
|
476
|
+
if (!i.isSecure) {
|
|
477
477
|
Oe("Blocked cached dangerous expression:", t);
|
|
478
478
|
return;
|
|
479
479
|
}
|
|
480
|
-
return
|
|
480
|
+
return i.evaluator(r);
|
|
481
481
|
}
|
|
482
|
-
const
|
|
482
|
+
const n = 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, n), !n.isSecure) {
|
|
488
488
|
Oe("Blocked dangerous expression:", t);
|
|
489
489
|
return;
|
|
490
490
|
}
|
|
491
|
-
return
|
|
491
|
+
return n.evaluator(r);
|
|
492
492
|
}
|
|
493
493
|
static createEvaluator(t) {
|
|
494
494
|
if (this.hasDangerousPatterns(t))
|
|
@@ -512,21 +512,21 @@ class Ct {
|
|
|
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 (i) => H(i, 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), i = this.parseObjectProperties(r);
|
|
521
|
+
return (n) => {
|
|
522
522
|
const s = {};
|
|
523
|
-
for (const { key: o, value: a } of
|
|
523
|
+
for (const { key: o, value: a } of i)
|
|
524
524
|
try {
|
|
525
525
|
if (a.startsWith("ctx.")) {
|
|
526
526
|
const u = a.slice(4);
|
|
527
|
-
s[o] = H(
|
|
527
|
+
s[o] = H(n, u);
|
|
528
528
|
} else
|
|
529
|
-
s[o] = this.evaluateSimpleValue(a,
|
|
529
|
+
s[o] = this.evaluateSimpleValue(a, n);
|
|
530
530
|
} catch {
|
|
531
531
|
s[o] = void 0;
|
|
532
532
|
}
|
|
@@ -534,11 +534,11 @@ class Ct {
|
|
|
534
534
|
};
|
|
535
535
|
}
|
|
536
536
|
static parseObjectProperties(t) {
|
|
537
|
-
const r = [],
|
|
538
|
-
for (const
|
|
539
|
-
const s =
|
|
537
|
+
const r = [], i = t.split(",");
|
|
538
|
+
for (const n of i) {
|
|
539
|
+
const s = n.indexOf(":");
|
|
540
540
|
if (s === -1) continue;
|
|
541
|
-
const o =
|
|
541
|
+
const o = n.slice(0, s).trim(), a = n.slice(s + 1).trim(), u = o.replace(/^['"]|['"]$/g, "");
|
|
542
542
|
r.push({ key: u, value: a });
|
|
543
543
|
}
|
|
544
544
|
return r;
|
|
@@ -546,39 +546,39 @@ class Ct {
|
|
|
546
546
|
static createSimpleEvaluator(t) {
|
|
547
547
|
return (r) => {
|
|
548
548
|
try {
|
|
549
|
-
let
|
|
550
|
-
const
|
|
551
|
-
|
|
552
|
-
const s =
|
|
549
|
+
let i = t;
|
|
550
|
+
const n = [];
|
|
551
|
+
i = i.replace(/("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')/g, (b) => `<<#${n.push(b) - 1}#>>`);
|
|
552
|
+
const s = i.match(/ctx\.[\w.]+/g) || [];
|
|
553
553
|
for (const b of s) {
|
|
554
|
-
const
|
|
554
|
+
const p = b.slice(4), l = H(r, p);
|
|
555
555
|
if (l === void 0) return;
|
|
556
|
-
const d =
|
|
557
|
-
|
|
556
|
+
const d = n.push(JSON.stringify(l)) - 1;
|
|
557
|
+
i = i.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${d}#>>`);
|
|
558
558
|
}
|
|
559
|
-
const o = /\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g, a =
|
|
559
|
+
const o = /\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g, a = i.match(o) || [];
|
|
560
560
|
for (const b of a) {
|
|
561
561
|
if (b.startsWith("ctx.")) continue;
|
|
562
|
-
const
|
|
563
|
-
if (
|
|
564
|
-
const l =
|
|
565
|
-
|
|
562
|
+
const p = H(r, b);
|
|
563
|
+
if (p === void 0) return;
|
|
564
|
+
const l = n.push(JSON.stringify(p)) - 1;
|
|
565
|
+
i = i.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${l}#>>`);
|
|
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(i)) !== 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
|
-
const
|
|
575
|
-
if (
|
|
576
|
-
const l = JSON.stringify(
|
|
577
|
-
b.includes(".") ?
|
|
574
|
+
const p = H(r, b);
|
|
575
|
+
if (p === void 0) return;
|
|
576
|
+
const l = JSON.stringify(p), d = n.push(l) - 1;
|
|
577
|
+
b.includes(".") ? i = i.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${d}#>>`) : i = i.replace(new RegExp("\\b" + b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") + "\\b", "g"), `<<#${d}#>>`);
|
|
578
578
|
}
|
|
579
|
-
|
|
579
|
+
i = i.replace(/<<#(\d+)#>>/g, (b, p) => n[Number(p)]);
|
|
580
580
|
try {
|
|
581
|
-
return this.evaluateBasicExpression(
|
|
581
|
+
return this.evaluateBasicExpression(i);
|
|
582
582
|
} catch {
|
|
583
583
|
return;
|
|
584
584
|
}
|
|
@@ -594,55 +594,55 @@ class Ct {
|
|
|
594
594
|
*/
|
|
595
595
|
static evaluateBasicExpression(t) {
|
|
596
596
|
const r = this.tokenize(t);
|
|
597
|
-
let
|
|
598
|
-
function
|
|
599
|
-
return r[
|
|
597
|
+
let i = 0;
|
|
598
|
+
function n() {
|
|
599
|
+
return r[i];
|
|
600
600
|
}
|
|
601
601
|
function s(c) {
|
|
602
|
-
const
|
|
603
|
-
if (c && !
|
|
602
|
+
const h = r[i++];
|
|
603
|
+
if (c && !h)
|
|
604
604
|
throw new Error(`Unexpected token EOF, expected ${c}`);
|
|
605
|
-
if (c &&
|
|
606
|
-
throw new Error(`Unexpected token ${
|
|
607
|
-
return
|
|
605
|
+
if (c && h && h.type !== c && h.value !== c)
|
|
606
|
+
throw new Error(`Unexpected token ${h.type}/${h.value}, expected ${c}`);
|
|
607
|
+
return h;
|
|
608
608
|
}
|
|
609
609
|
function o() {
|
|
610
610
|
return a();
|
|
611
611
|
}
|
|
612
612
|
function a() {
|
|
613
613
|
let c = u();
|
|
614
|
-
if (
|
|
614
|
+
if (n() && n().value === "?") {
|
|
615
615
|
s("?");
|
|
616
|
-
const
|
|
616
|
+
const h = o();
|
|
617
617
|
s(":");
|
|
618
618
|
const y = o();
|
|
619
|
-
return c ?
|
|
619
|
+
return c ? h : y;
|
|
620
620
|
}
|
|
621
621
|
return c;
|
|
622
622
|
}
|
|
623
623
|
function u() {
|
|
624
624
|
let c = m();
|
|
625
|
-
for (;
|
|
625
|
+
for (; n() && n().value === "||"; ) {
|
|
626
626
|
s("OP");
|
|
627
|
-
const
|
|
628
|
-
c = c ||
|
|
627
|
+
const h = m();
|
|
628
|
+
c = c || h;
|
|
629
629
|
}
|
|
630
630
|
return c;
|
|
631
631
|
}
|
|
632
632
|
function m() {
|
|
633
633
|
let c = g();
|
|
634
|
-
for (;
|
|
634
|
+
for (; n() && n().value === "&&"; ) {
|
|
635
635
|
s("OP");
|
|
636
|
-
const
|
|
637
|
-
c = c &&
|
|
636
|
+
const h = g();
|
|
637
|
+
c = c && h;
|
|
638
638
|
}
|
|
639
639
|
return c;
|
|
640
640
|
}
|
|
641
641
|
function g() {
|
|
642
642
|
let c = b();
|
|
643
|
-
for (;
|
|
644
|
-
const
|
|
645
|
-
switch (
|
|
643
|
+
for (; n() && ["==", "!=", "===", "!=="].includes(n().value); ) {
|
|
644
|
+
const h = s("OP").value, y = b();
|
|
645
|
+
switch (h) {
|
|
646
646
|
case "==":
|
|
647
647
|
c = c == y;
|
|
648
648
|
break;
|
|
@@ -660,10 +660,10 @@ class Ct {
|
|
|
660
660
|
return c;
|
|
661
661
|
}
|
|
662
662
|
function b() {
|
|
663
|
-
let c =
|
|
664
|
-
for (;
|
|
665
|
-
const
|
|
666
|
-
switch (
|
|
663
|
+
let c = p();
|
|
664
|
+
for (; n() && [">", "<", ">=", "<="].includes(n().value); ) {
|
|
665
|
+
const h = s("OP").value, y = p();
|
|
666
|
+
switch (h) {
|
|
667
667
|
case ">":
|
|
668
668
|
c = c > y;
|
|
669
669
|
break;
|
|
@@ -680,19 +680,19 @@ class Ct {
|
|
|
680
680
|
}
|
|
681
681
|
return c;
|
|
682
682
|
}
|
|
683
|
-
function
|
|
683
|
+
function p() {
|
|
684
684
|
let c = l();
|
|
685
|
-
for (;
|
|
686
|
-
const
|
|
687
|
-
c =
|
|
685
|
+
for (; n() && (n().value === "+" || n().value === "-"); ) {
|
|
686
|
+
const h = s("OP").value, y = l();
|
|
687
|
+
c = h === "+" ? c + y : c - y;
|
|
688
688
|
}
|
|
689
689
|
return c;
|
|
690
690
|
}
|
|
691
691
|
function l() {
|
|
692
692
|
let c = d();
|
|
693
|
-
for (;
|
|
694
|
-
const
|
|
695
|
-
switch (
|
|
693
|
+
for (; n() && (n().value === "*" || n().value === "/" || n().value === "%"); ) {
|
|
694
|
+
const h = s("OP").value, y = d();
|
|
695
|
+
switch (h) {
|
|
696
696
|
case "*":
|
|
697
697
|
c = c * y;
|
|
698
698
|
break;
|
|
@@ -707,10 +707,10 @@ class Ct {
|
|
|
707
707
|
return c;
|
|
708
708
|
}
|
|
709
709
|
function d() {
|
|
710
|
-
return
|
|
710
|
+
return n() && n().value === "!" ? (s("OP"), !d()) : n() && n().value === "-" ? (s("OP"), -d()) : x();
|
|
711
711
|
}
|
|
712
712
|
function x() {
|
|
713
|
-
const c =
|
|
713
|
+
const c = n();
|
|
714
714
|
if (c) {
|
|
715
715
|
if (c.type === "NUMBER")
|
|
716
716
|
return s("NUMBER"), Number(c.value);
|
|
@@ -720,15 +720,15 @@ class Ct {
|
|
|
720
720
|
return s("IDENT"), c.value === "true" ? !0 : c.value === "false" ? !1 : c.value === "null" ? null : void 0;
|
|
721
721
|
if (c.value === "[") {
|
|
722
722
|
s("PUNC");
|
|
723
|
-
const
|
|
724
|
-
for (;
|
|
725
|
-
|
|
726
|
-
return s("PUNC"),
|
|
723
|
+
const h = [];
|
|
724
|
+
for (; n() && n().value !== "]"; )
|
|
725
|
+
h.push(o()), n() && n().value === "," && s("PUNC");
|
|
726
|
+
return s("PUNC"), h;
|
|
727
727
|
}
|
|
728
728
|
if (c.value === "(") {
|
|
729
729
|
s("PUNC");
|
|
730
|
-
const
|
|
731
|
-
return s("PUNC"),
|
|
730
|
+
const h = o();
|
|
731
|
+
return s("PUNC"), h;
|
|
732
732
|
}
|
|
733
733
|
throw new Error("Unexpected token in expression");
|
|
734
734
|
}
|
|
@@ -736,10 +736,10 @@ class Ct {
|
|
|
736
736
|
return o();
|
|
737
737
|
}
|
|
738
738
|
static tokenize(t) {
|
|
739
|
-
const r = [],
|
|
740
|
-
let
|
|
741
|
-
for (; (
|
|
742
|
-
const s =
|
|
739
|
+
const r = [], i = /\s*(=>|===|!==|==|!=|>=|<=|\|\||&&|[()?:,\[\]]|\+|-|\*|\/|%|>|<|!|\d+\.?\d*|"[^"]*"|'[^']*'|[a-zA-Z_][a-zA-Z0-9_]*|\S)\s*/g;
|
|
740
|
+
let n;
|
|
741
|
+
for (; (n = i.exec(t)) !== null; ) {
|
|
742
|
+
const s = n[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 Ct {
|
|
|
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 i = t.slice(4);
|
|
753
|
+
return H(r, i);
|
|
754
754
|
}
|
|
755
755
|
return t.startsWith('"') && t.endsWith('"') || t.startsWith("'") && t.endsWith("'") ? t.slice(1, -1) : t;
|
|
756
756
|
}
|
|
@@ -766,9 +766,9 @@ class oe {
|
|
|
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, i, n) {
|
|
770
|
+
t.addEventListener(r, i, n);
|
|
771
|
+
const o = { event: r, handler: i, options: n, cleanup: () => t.removeEventListener(r, i, n), addedAt: Date.now() };
|
|
772
772
|
this.cleanupFunctions.has(t) || this.cleanupFunctions.set(t, []);
|
|
773
773
|
const a = this.cleanupFunctions.get(t);
|
|
774
774
|
a.push(o), this.cleanupFunctions.get(t).__metaList = a;
|
|
@@ -776,13 +776,13 @@ class oe {
|
|
|
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, i, n) {
|
|
780
|
+
t.removeEventListener(r, i, n);
|
|
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 a = o.findIndex((u) => u.event === r && u.handler ===
|
|
785
|
+
const a = o.findIndex((u) => u.event === r && u.handler === i && JSON.stringify(u.options) === JSON.stringify(n));
|
|
786
786
|
if (a >= 0) {
|
|
787
787
|
try {
|
|
788
788
|
o[a].cleanup();
|
|
@@ -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((n) => {
|
|
806
806
|
try {
|
|
807
|
-
typeof
|
|
807
|
+
typeof n == "function" ? n() : n && typeof n.cleanup == "function" && n.cleanup();
|
|
808
808
|
} catch (s) {
|
|
809
809
|
console.error("Error during event cleanup:", s);
|
|
810
810
|
}
|
|
@@ -824,15 +824,15 @@ 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), i = r ? r.__metaList || r : void 0;
|
|
828
|
+
return !!(i && i.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), i = r ? r.__metaList || r : void 0;
|
|
835
|
+
return i ? i.length : 0;
|
|
836
836
|
}
|
|
837
837
|
}
|
|
838
838
|
function ue(e, t) {
|
|
@@ -844,38 +844,38 @@ function ue(e, t) {
|
|
|
844
844
|
ue(r, t);
|
|
845
845
|
}
|
|
846
846
|
}
|
|
847
|
-
function
|
|
847
|
+
function pe(e, t, r) {
|
|
848
848
|
if (typeof e == "string") return;
|
|
849
|
-
const
|
|
850
|
-
|
|
849
|
+
const i = e.props?.reactiveRef ?? (e.props?.props && e.props.props.reactiveRef), n = e.props?.ref ?? (e.props?.props && e.props.props.ref);
|
|
850
|
+
i ? i.value = t : n && r && (r[n] = t);
|
|
851
851
|
}
|
|
852
|
-
function
|
|
852
|
+
function Ct(e, t, r, i, n, s, o, a) {
|
|
853
853
|
if (!s) return;
|
|
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",
|
|
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 a && typeof
|
|
856
|
+
const k = e.value;
|
|
857
|
+
return a && typeof k == "object" && k !== null ? k[a] : k;
|
|
858
858
|
}
|
|
859
859
|
return H(s._state || s, e);
|
|
860
|
-
}, l =
|
|
860
|
+
}, l = p();
|
|
861
861
|
let d = "text";
|
|
862
|
-
o instanceof HTMLInputElement ? d =
|
|
862
|
+
o instanceof HTMLInputElement ? d = i?.type || o.type || "text" : o instanceof HTMLSelectElement ? d = "select" : o instanceof HTMLTextAreaElement && (d = "textarea");
|
|
863
863
|
const x = o instanceof HTMLInputElement || o instanceof HTMLTextAreaElement || o instanceof HTMLSelectElement, c = x ? d === "checkbox" || d === "radio" ? "checked" : "value" : a ?? "modelValue";
|
|
864
864
|
if (d === "checkbox")
|
|
865
865
|
if (Array.isArray(l))
|
|
866
|
-
r[c] = l.includes(String(o?.getAttribute("value") ??
|
|
866
|
+
r[c] = l.includes(String(o?.getAttribute("value") ?? i?.value ?? ""));
|
|
867
867
|
else {
|
|
868
|
-
const
|
|
869
|
-
r[c] = l ===
|
|
868
|
+
const k = o?.getAttribute("true-value") ?? !0;
|
|
869
|
+
r[c] = l === k;
|
|
870
870
|
}
|
|
871
871
|
else if (d === "radio")
|
|
872
|
-
r[c] = l === (
|
|
872
|
+
r[c] = l === (i?.value ?? "");
|
|
873
873
|
else if (d === "select")
|
|
874
874
|
if (o && o.hasAttribute("multiple") && o instanceof HTMLSelectElement) {
|
|
875
|
-
const
|
|
875
|
+
const k = Array.isArray(l) ? l.map(String) : [];
|
|
876
876
|
setTimeout(() => {
|
|
877
|
-
Array.from(o.options).forEach((
|
|
878
|
-
|
|
877
|
+
Array.from(o.options).forEach(($) => {
|
|
878
|
+
$.selected = k.includes($.value);
|
|
879
879
|
});
|
|
880
880
|
}, 0), r[c] = Array.isArray(l) ? l : [];
|
|
881
881
|
} else
|
|
@@ -883,20 +883,20 @@ function _t(e, t, r, n, i, s, o, a) {
|
|
|
883
883
|
else {
|
|
884
884
|
r[c] = l;
|
|
885
885
|
try {
|
|
886
|
-
const
|
|
887
|
-
|
|
886
|
+
const k = re(c);
|
|
887
|
+
i && (i[k] = l);
|
|
888
888
|
} catch {
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
|
-
const
|
|
892
|
-
if (
|
|
893
|
-
const
|
|
894
|
-
if (
|
|
895
|
-
const f =
|
|
891
|
+
const h = u || d === "checkbox" || d === "radio" || d === "select" ? "change" : "input", y = (k) => {
|
|
892
|
+
if (k.isComposing || n._isComposing) return;
|
|
893
|
+
const $ = typeof globalThis.process < "u" && globalThis.process.env?.NODE_ENV === "test" || typeof window < "u" && window.__vitest__;
|
|
894
|
+
if (k.isTrusted === !1 && !$) return;
|
|
895
|
+
const f = k.target;
|
|
896
896
|
if (!f || f._modelUpdating) return;
|
|
897
897
|
let v = f.value;
|
|
898
898
|
if (d === "checkbox") {
|
|
899
|
-
const T =
|
|
899
|
+
const T = p();
|
|
900
900
|
if (Array.isArray(T)) {
|
|
901
901
|
const R = f.getAttribute("value") ?? "", S = Array.from(T);
|
|
902
902
|
if (f.checked)
|
|
@@ -918,8 +918,8 @@ function _t(e, t, r, n, i, s, o, a) {
|
|
|
918
918
|
const T = Number(v);
|
|
919
919
|
isNaN(T) || (v = T);
|
|
920
920
|
}
|
|
921
|
-
const A = s._state || s,
|
|
922
|
-
if (Array.isArray(v) && Array.isArray(
|
|
921
|
+
const A = s._state || s, C = p();
|
|
922
|
+
if (Array.isArray(v) && Array.isArray(C) ? JSON.stringify([...v].sort()) !== JSON.stringify([...C].sort()) : v !== C) {
|
|
923
923
|
f._modelUpdating = !0;
|
|
924
924
|
try {
|
|
925
925
|
if (b)
|
|
@@ -929,7 +929,7 @@ function _t(e, t, r, n, i, s, o, a) {
|
|
|
929
929
|
} else
|
|
930
930
|
e.value = v;
|
|
931
931
|
else
|
|
932
|
-
|
|
932
|
+
_e(A, e, v);
|
|
933
933
|
if (s._requestRender && s._requestRender(), s._triggerWatchers) {
|
|
934
934
|
const T = b ? "reactiveState" : e;
|
|
935
935
|
s._triggerWatchers(T, v);
|
|
@@ -948,52 +948,52 @@ function _t(e, t, r, n, i, s, o, a) {
|
|
|
948
948
|
}
|
|
949
949
|
};
|
|
950
950
|
if (x) {
|
|
951
|
-
if (
|
|
952
|
-
const
|
|
953
|
-
o && oe.removeListener(o,
|
|
951
|
+
if (n[h]) {
|
|
952
|
+
const k = n[h];
|
|
953
|
+
o && oe.removeListener(o, h, k);
|
|
954
954
|
}
|
|
955
|
-
|
|
955
|
+
n[h] = y;
|
|
956
956
|
} else {
|
|
957
|
-
const
|
|
958
|
-
if (
|
|
959
|
-
const
|
|
960
|
-
o && oe.removeListener(o,
|
|
957
|
+
const k = `update:${re(c)}`;
|
|
958
|
+
if (n[k]) {
|
|
959
|
+
const $ = n[k];
|
|
960
|
+
o && oe.removeListener(o, k, $);
|
|
961
961
|
}
|
|
962
|
-
|
|
963
|
-
const f = s._state || s, v =
|
|
962
|
+
n[k] = ($) => {
|
|
963
|
+
const f = s._state || s, v = $.detail !== void 0 ? $.detail : $.target?.value, A = H(f, e);
|
|
964
964
|
if (Array.isArray(v) && Array.isArray(A) ? JSON.stringify([...v].sort()) !== JSON.stringify([...A].sort()) : v !== A) {
|
|
965
|
-
|
|
966
|
-
const
|
|
967
|
-
if (
|
|
968
|
-
|
|
965
|
+
_e(f, e, v), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, v);
|
|
966
|
+
const E = $.target;
|
|
967
|
+
if (E) {
|
|
968
|
+
E[c] = v;
|
|
969
969
|
try {
|
|
970
970
|
const T = re(c);
|
|
971
|
-
typeof v == "boolean" ? v ?
|
|
971
|
+
typeof v == "boolean" ? v ? E.setAttribute(T, "true") : E.setAttribute(T, "false") : E.setAttribute(T, String(v));
|
|
972
972
|
} catch {
|
|
973
973
|
}
|
|
974
974
|
queueMicrotask(() => {
|
|
975
|
-
typeof
|
|
975
|
+
typeof E._applyProps == "function" && E._applyProps(E._cfg), typeof E._requestRender == "function" && E._requestRender();
|
|
976
976
|
});
|
|
977
977
|
}
|
|
978
978
|
}
|
|
979
979
|
};
|
|
980
980
|
}
|
|
981
|
-
(d === "text" || d === "textarea") && (
|
|
982
|
-
|
|
983
|
-
const
|
|
984
|
-
|
|
985
|
-
const f =
|
|
986
|
-
let
|
|
987
|
-
if (m && (
|
|
988
|
-
const T = Number(
|
|
989
|
-
isNaN(T) || (
|
|
981
|
+
(d === "text" || d === "textarea") && (n.compositionstart = (() => n._isComposing = !0), n.compositionend = (k) => {
|
|
982
|
+
n._isComposing = !1;
|
|
983
|
+
const $ = k.target;
|
|
984
|
+
$ && setTimeout(() => {
|
|
985
|
+
const f = $.value, v = s._state || s, A = H(v, e);
|
|
986
|
+
let C = f;
|
|
987
|
+
if (m && (C = C.trim()), g) {
|
|
988
|
+
const T = Number(C);
|
|
989
|
+
isNaN(T) || (C = T);
|
|
990
990
|
}
|
|
991
|
-
if (Array.isArray(
|
|
992
|
-
|
|
991
|
+
if (Array.isArray(C) && Array.isArray(A) ? JSON.stringify([...C].sort()) !== JSON.stringify([...A].sort()) : C !== A) {
|
|
992
|
+
$._modelUpdating = !0;
|
|
993
993
|
try {
|
|
994
|
-
|
|
994
|
+
_e(v, e, C), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, C);
|
|
995
995
|
} finally {
|
|
996
|
-
setTimeout(() =>
|
|
996
|
+
setTimeout(() => $._modelUpdating = !1, 0);
|
|
997
997
|
}
|
|
998
998
|
}
|
|
999
999
|
}, 0);
|
|
@@ -1003,85 +1003,85 @@ 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
|
|
1006
|
+
function _t(e, t, r, i) {
|
|
1007
1007
|
if (typeof e == "object" && e !== null)
|
|
1008
|
-
for (const [
|
|
1009
|
-
|
|
1008
|
+
for (const [n, s] of Object.entries(e))
|
|
1009
|
+
n.startsWith("data-") || n.startsWith("aria-") || n === "class" ? r[n] = s : t[n] = s;
|
|
1010
1010
|
else if (typeof e == "string") {
|
|
1011
|
-
if (!
|
|
1011
|
+
if (!i) return;
|
|
1012
1012
|
try {
|
|
1013
|
-
const
|
|
1014
|
-
if (typeof
|
|
1015
|
-
for (const [s, o] of Object.entries(
|
|
1013
|
+
const n = me(e, i);
|
|
1014
|
+
if (typeof n == "object" && n !== null) {
|
|
1015
|
+
for (const [s, o] of Object.entries(n))
|
|
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] = n;
|
|
1020
1020
|
return;
|
|
1021
1021
|
}
|
|
1022
1022
|
} catch {
|
|
1023
|
-
const
|
|
1024
|
-
r[e] =
|
|
1023
|
+
const n = H(i, e);
|
|
1024
|
+
r[e] = n;
|
|
1025
1025
|
}
|
|
1026
1026
|
}
|
|
1027
1027
|
}
|
|
1028
|
-
function
|
|
1029
|
-
let
|
|
1028
|
+
function Et(e, t, r) {
|
|
1029
|
+
let i;
|
|
1030
1030
|
if (typeof e == "string") {
|
|
1031
1031
|
if (!r) return;
|
|
1032
|
-
|
|
1032
|
+
i = me(e, r);
|
|
1033
1033
|
} else
|
|
1034
|
-
|
|
1035
|
-
const
|
|
1036
|
-
let s =
|
|
1037
|
-
if (
|
|
1038
|
-
if (
|
|
1039
|
-
const o =
|
|
1034
|
+
i = e;
|
|
1035
|
+
const n = t.style || "";
|
|
1036
|
+
let s = n;
|
|
1037
|
+
if (i) {
|
|
1038
|
+
if (n) {
|
|
1039
|
+
const o = n.split(";").map((u) => u.trim()).filter(Boolean), a = o.findIndex(
|
|
1040
1040
|
(u) => u.startsWith("display:")
|
|
1041
1041
|
);
|
|
1042
1042
|
a >= 0 && o[a] === "display: none" && (o.splice(a, 1), s = o.length > 0 ? o.join("; ") + ";" : "");
|
|
1043
1043
|
}
|
|
1044
|
-
} else if (
|
|
1045
|
-
const o =
|
|
1044
|
+
} else if (n) {
|
|
1045
|
+
const o = n.split(";").filter(Boolean), a = o.findIndex(
|
|
1046
1046
|
(u) => u.trim().startsWith("display:")
|
|
1047
1047
|
);
|
|
1048
1048
|
a >= 0 ? o[a] = "display: none" : o.push("display: none"), s = o.join("; ");
|
|
1049
1049
|
} else
|
|
1050
1050
|
s = "display: none";
|
|
1051
|
-
s !==
|
|
1051
|
+
s !== n && (s ? t.style = s : delete t.style);
|
|
1052
1052
|
}
|
|
1053
1053
|
function me(e, t) {
|
|
1054
|
-
return
|
|
1054
|
+
return kt.evaluate(e, t);
|
|
1055
1055
|
}
|
|
1056
1056
|
function St(e, t, r) {
|
|
1057
|
-
let
|
|
1057
|
+
let i;
|
|
1058
1058
|
if (typeof e == "string") {
|
|
1059
1059
|
if (!r) return;
|
|
1060
|
-
|
|
1060
|
+
i = me(e, r);
|
|
1061
1061
|
} else
|
|
1062
|
-
|
|
1063
|
-
let
|
|
1064
|
-
typeof
|
|
1065
|
-
const s = t.class || "", o = s ? `${s} ${
|
|
1062
|
+
i = e;
|
|
1063
|
+
let n = [];
|
|
1064
|
+
typeof i == "string" ? n = [i] : Array.isArray(i) ? n = i.filter(Boolean) : typeof i == "object" && i !== null && (n = Object.entries(i).filter(([, a]) => !!a).flatMap(([a]) => a.split(/\s+/).filter(Boolean)));
|
|
1065
|
+
const s = t.class || "", o = s ? `${s} ${n.join(" ")}`.trim() : n.join(" ");
|
|
1066
1066
|
o && (t.class = o);
|
|
1067
1067
|
}
|
|
1068
1068
|
function At(e, t, r) {
|
|
1069
|
-
let
|
|
1069
|
+
let i;
|
|
1070
1070
|
if (typeof e == "string") {
|
|
1071
1071
|
if (!r) return;
|
|
1072
|
-
|
|
1072
|
+
i = me(e, r);
|
|
1073
1073
|
} else
|
|
1074
|
-
|
|
1075
|
-
let
|
|
1076
|
-
if (typeof
|
|
1077
|
-
|
|
1078
|
-
else if (
|
|
1074
|
+
i = e;
|
|
1075
|
+
let n = "";
|
|
1076
|
+
if (typeof i == "string")
|
|
1077
|
+
n = i;
|
|
1078
|
+
else if (i && typeof i == "object") {
|
|
1079
1079
|
const o = [];
|
|
1080
|
-
for (const [a, u] of Object.entries(
|
|
1080
|
+
for (const [a, u] of Object.entries(i))
|
|
1081
1081
|
if (u != null && u !== "") {
|
|
1082
1082
|
const m = a.replace(
|
|
1083
1083
|
/[A-Z]/g,
|
|
1084
|
-
(
|
|
1084
|
+
(p) => `-${p.toLowerCase()}`
|
|
1085
1085
|
), g = [
|
|
1086
1086
|
"width",
|
|
1087
1087
|
"height",
|
|
@@ -1111,26 +1111,26 @@ 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
|
+
n = 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(";") ? "; " : "") + n;
|
|
1118
1118
|
}
|
|
1119
1119
|
function Tt(e, t, r) {
|
|
1120
|
-
let
|
|
1121
|
-
typeof e == "string" && r && (
|
|
1120
|
+
let i = e;
|
|
1121
|
+
typeof e == "string" && r && (i = me(e, r)), ee(i) ? t.reactiveRef = i : t.ref = i;
|
|
1122
1122
|
}
|
|
1123
|
-
function at(e, t, r,
|
|
1124
|
-
const
|
|
1123
|
+
function at(e, t, r, i) {
|
|
1124
|
+
const n = {}, s = { ...i || {} }, o = {};
|
|
1125
1125
|
for (const [a, u] of Object.entries(e)) {
|
|
1126
1126
|
const { value: m, modifiers: g, arg: b } = u;
|
|
1127
1127
|
if (a === "model" || a.startsWith("model:")) {
|
|
1128
|
-
const
|
|
1129
|
-
|
|
1128
|
+
const p = a.split(":"), l = p.length > 1 ? p[1] : b;
|
|
1129
|
+
Ct(
|
|
1130
1130
|
m,
|
|
1131
1131
|
// Pass the original value (could be string or reactive state object)
|
|
1132
1132
|
g,
|
|
1133
|
-
|
|
1133
|
+
n,
|
|
1134
1134
|
s,
|
|
1135
1135
|
o,
|
|
1136
1136
|
t,
|
|
@@ -1141,10 +1141,10 @@ function at(e, t, r, n) {
|
|
|
1141
1141
|
}
|
|
1142
1142
|
switch (a) {
|
|
1143
1143
|
case "bind":
|
|
1144
|
-
|
|
1144
|
+
_t(m, n, s, t);
|
|
1145
1145
|
break;
|
|
1146
1146
|
case "show":
|
|
1147
|
-
|
|
1147
|
+
Et(m, s, t);
|
|
1148
1148
|
break;
|
|
1149
1149
|
case "class":
|
|
1150
1150
|
St(m, s, t);
|
|
@@ -1153,11 +1153,11 @@ function at(e, t, r, n) {
|
|
|
1153
1153
|
At(m, s, t);
|
|
1154
1154
|
break;
|
|
1155
1155
|
case "ref":
|
|
1156
|
-
Tt(m,
|
|
1156
|
+
Tt(m, n, t);
|
|
1157
1157
|
break;
|
|
1158
1158
|
}
|
|
1159
1159
|
}
|
|
1160
|
-
return { props:
|
|
1160
|
+
return { props: n, attrs: s, listeners: o };
|
|
1161
1161
|
}
|
|
1162
1162
|
function Be(e, t) {
|
|
1163
1163
|
if (Array.isArray(e)) {
|
|
@@ -1188,13 +1188,13 @@ function Be(e, t) {
|
|
|
1188
1188
|
});
|
|
1189
1189
|
}
|
|
1190
1190
|
const r = e;
|
|
1191
|
-
let
|
|
1192
|
-
return Array.isArray(
|
|
1191
|
+
let i = r.props?.key ?? r.key ?? t, n = r.children;
|
|
1192
|
+
return Array.isArray(n) && (n = Be(n, i)), { ...r, key: i, children: n };
|
|
1193
1193
|
}
|
|
1194
|
-
function Ve(e, t, r,
|
|
1195
|
-
const
|
|
1196
|
-
i,
|
|
1194
|
+
function Ve(e, t, r, i) {
|
|
1195
|
+
const n = r.directives ?? {}, s = at(
|
|
1197
1196
|
n,
|
|
1197
|
+
i,
|
|
1198
1198
|
e,
|
|
1199
1199
|
r.attrs
|
|
1200
1200
|
), o = {
|
|
@@ -1231,12 +1231,12 @@ function Ve(e, t, r, n) {
|
|
|
1231
1231
|
s.listeners || {}
|
|
1232
1232
|
))
|
|
1233
1233
|
oe.addListener(e, d, x);
|
|
1234
|
-
const
|
|
1235
|
-
for (const d in { ...
|
|
1236
|
-
const x =
|
|
1237
|
-
let c = x,
|
|
1238
|
-
if (ee(x) && (c = x.value), ee(w) && (
|
|
1239
|
-
if (b = !0,
|
|
1234
|
+
const p = t.attrs ?? {}, l = a;
|
|
1235
|
+
for (const d in { ...p, ...l }) {
|
|
1236
|
+
const x = p[d], w = l[d];
|
|
1237
|
+
let c = x, h = w;
|
|
1238
|
+
if (ee(x) && (c = x.value), ee(w) && (h = w.value), c !== h)
|
|
1239
|
+
if (b = !0, h == null || h === !1) {
|
|
1240
1240
|
if (e.removeAttribute(d), d === "value") {
|
|
1241
1241
|
if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement)
|
|
1242
1242
|
try {
|
|
@@ -1268,20 +1268,20 @@ function Ve(e, t, r, n) {
|
|
|
1268
1268
|
if (d === "value") {
|
|
1269
1269
|
if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement) {
|
|
1270
1270
|
try {
|
|
1271
|
-
e.value =
|
|
1271
|
+
e.value = h ?? "";
|
|
1272
1272
|
} catch {
|
|
1273
|
-
e.setAttribute(d, String(
|
|
1273
|
+
e.setAttribute(d, String(h));
|
|
1274
1274
|
}
|
|
1275
1275
|
continue;
|
|
1276
1276
|
} else if (e instanceof HTMLSelectElement) {
|
|
1277
1277
|
try {
|
|
1278
|
-
e.value =
|
|
1278
|
+
e.value = h ?? "";
|
|
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(h);
|
|
1285
1285
|
} catch {
|
|
1286
1286
|
}
|
|
1287
1287
|
continue;
|
|
@@ -1289,31 +1289,31 @@ function Ve(e, t, r, n) {
|
|
|
1289
1289
|
}
|
|
1290
1290
|
if (d === "checked" && e instanceof HTMLInputElement) {
|
|
1291
1291
|
try {
|
|
1292
|
-
e.checked = !!
|
|
1292
|
+
e.checked = !!h;
|
|
1293
1293
|
} catch {
|
|
1294
1294
|
}
|
|
1295
1295
|
continue;
|
|
1296
1296
|
}
|
|
1297
1297
|
if (d === "style") {
|
|
1298
|
-
e.setAttribute(d, String(
|
|
1298
|
+
e.setAttribute(d, String(h));
|
|
1299
1299
|
continue;
|
|
1300
1300
|
}
|
|
1301
1301
|
const y = e.namespaceURI === "http://www.w3.org/2000/svg";
|
|
1302
1302
|
if (g && !y && d.includes("-")) {
|
|
1303
|
-
const
|
|
1303
|
+
const k = it(d);
|
|
1304
1304
|
try {
|
|
1305
|
-
e[
|
|
1305
|
+
e[k] = h;
|
|
1306
1306
|
} catch {
|
|
1307
|
-
e.setAttribute(d, String(
|
|
1307
|
+
e.setAttribute(d, String(h));
|
|
1308
1308
|
}
|
|
1309
1309
|
} else if (!y && d in e)
|
|
1310
1310
|
try {
|
|
1311
|
-
e[d] =
|
|
1311
|
+
e[d] = h;
|
|
1312
1312
|
} catch {
|
|
1313
|
-
e.setAttribute(d, String(
|
|
1313
|
+
e.setAttribute(d, String(h));
|
|
1314
1314
|
}
|
|
1315
1315
|
else
|
|
1316
|
-
e.setAttribute(d, String(
|
|
1316
|
+
e.setAttribute(d, String(h));
|
|
1317
1317
|
}
|
|
1318
1318
|
}
|
|
1319
1319
|
if (g && b)
|
|
@@ -1331,94 +1331,94 @@ function X(e, t, r) {
|
|
|
1331
1331
|
if (typeof e == "string")
|
|
1332
1332
|
return document.createTextNode(e);
|
|
1333
1333
|
if (e.tag === "#text") {
|
|
1334
|
-
const
|
|
1334
|
+
const p = document.createTextNode(
|
|
1335
1335
|
typeof e.children == "string" ? e.children : ""
|
|
1336
1336
|
);
|
|
1337
|
-
return e.key != null && (
|
|
1337
|
+
return e.key != null && (p.key = e.key), p;
|
|
1338
1338
|
}
|
|
1339
1339
|
if (e.tag === "#anchor") {
|
|
1340
|
-
const
|
|
1341
|
-
|
|
1340
|
+
const p = e, l = Array.isArray(p.children) ? p.children : [], d = document.createTextNode(""), x = document.createTextNode("");
|
|
1341
|
+
p.key != null && (d.key = `${p.key}:start`, x.key = `${p.key}:end`), p._startNode = d, p._endNode = x;
|
|
1342
1342
|
const w = document.createDocumentFragment();
|
|
1343
1343
|
w.appendChild(d);
|
|
1344
1344
|
for (const c of l) {
|
|
1345
|
-
const
|
|
1346
|
-
w.appendChild(
|
|
1345
|
+
const h = X(c, t);
|
|
1346
|
+
w.appendChild(h);
|
|
1347
1347
|
}
|
|
1348
1348
|
return w.appendChild(x), w;
|
|
1349
1349
|
}
|
|
1350
|
-
const
|
|
1351
|
-
e.key != null && (
|
|
1352
|
-
const { props:
|
|
1353
|
-
...
|
|
1350
|
+
const i = document.createElement(e.tag);
|
|
1351
|
+
e.key != null && (i.key = e.key);
|
|
1352
|
+
const { props: n = {}, attrs: s = {}, directives: o = {} } = e.props ?? {}, a = at(o, t, i, s), u = {
|
|
1353
|
+
...n,
|
|
1354
1354
|
...a.props
|
|
1355
1355
|
}, m = {
|
|
1356
1356
|
...s,
|
|
1357
1357
|
...a.attrs
|
|
1358
|
-
}, g =
|
|
1359
|
-
for (const
|
|
1360
|
-
const l = m[
|
|
1361
|
-
if (!(typeof
|
|
1358
|
+
}, g = i.namespaceURI === "http://www.w3.org/2000/svg";
|
|
1359
|
+
for (const p in m) {
|
|
1360
|
+
const l = m[p];
|
|
1361
|
+
if (!(typeof p != "string" || /\[object Object\]/.test(p))) {
|
|
1362
1362
|
if (typeof l == "boolean")
|
|
1363
|
-
l &&
|
|
1363
|
+
l && i.setAttribute(p, "");
|
|
1364
1364
|
else if (l != null)
|
|
1365
|
-
if (!g &&
|
|
1365
|
+
if (!g && p === "value" && (i instanceof HTMLInputElement || i instanceof HTMLTextAreaElement || i instanceof HTMLSelectElement || i instanceof HTMLProgressElement))
|
|
1366
1366
|
try {
|
|
1367
|
-
|
|
1367
|
+
i instanceof HTMLProgressElement ? i.value = Number(l) : i.value = l ?? "";
|
|
1368
1368
|
} catch {
|
|
1369
|
-
|
|
1369
|
+
i.setAttribute(p, String(l));
|
|
1370
1370
|
}
|
|
1371
|
-
else if (!g &&
|
|
1371
|
+
else if (!g && p === "checked" && i instanceof HTMLInputElement)
|
|
1372
1372
|
try {
|
|
1373
|
-
|
|
1373
|
+
i.checked = !!l;
|
|
1374
1374
|
} catch {
|
|
1375
|
-
|
|
1375
|
+
i.setAttribute(p, String(l));
|
|
1376
1376
|
}
|
|
1377
|
-
else if (!g &&
|
|
1377
|
+
else if (!g && p in i)
|
|
1378
1378
|
try {
|
|
1379
|
-
|
|
1379
|
+
i[p] = l;
|
|
1380
1380
|
} catch {
|
|
1381
|
-
|
|
1381
|
+
i.setAttribute(p, String(l));
|
|
1382
1382
|
}
|
|
1383
|
-
else if ((e.props?.isCustomElement ?? !1) && !g &&
|
|
1384
|
-
const x = it(
|
|
1383
|
+
else if ((e.props?.isCustomElement ?? !1) && !g && p.includes("-")) {
|
|
1384
|
+
const x = it(p);
|
|
1385
1385
|
try {
|
|
1386
|
-
|
|
1386
|
+
i[x] = l;
|
|
1387
1387
|
} catch {
|
|
1388
|
-
|
|
1388
|
+
i.setAttribute(p, String(l));
|
|
1389
1389
|
}
|
|
1390
1390
|
} else
|
|
1391
|
-
|
|
1391
|
+
i.setAttribute(p, String(l));
|
|
1392
1392
|
}
|
|
1393
1393
|
}
|
|
1394
|
-
for (const
|
|
1395
|
-
const l = u[
|
|
1396
|
-
if (!(typeof
|
|
1397
|
-
if (
|
|
1394
|
+
for (const p in u) {
|
|
1395
|
+
const l = u[p];
|
|
1396
|
+
if (!(typeof p != "string" || /\[object Object\]/.test(p)))
|
|
1397
|
+
if (p === "value" && (i instanceof HTMLInputElement || i instanceof HTMLTextAreaElement || i instanceof HTMLSelectElement)) {
|
|
1398
1398
|
const d = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
|
|
1399
|
-
|
|
1400
|
-
} else if (
|
|
1399
|
+
i.value = d ?? "";
|
|
1400
|
+
} else if (p === "checked" && i instanceof HTMLInputElement) {
|
|
1401
1401
|
const d = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
|
|
1402
|
-
|
|
1403
|
-
} else if (
|
|
1404
|
-
oe.addListener(
|
|
1402
|
+
i.checked = !!d;
|
|
1403
|
+
} else if (p.startsWith("on") && typeof l == "function")
|
|
1404
|
+
oe.addListener(i, ot(p), l);
|
|
1405
1405
|
else {
|
|
1406
|
-
if (
|
|
1406
|
+
if (p.startsWith("on") && l === void 0)
|
|
1407
1407
|
continue;
|
|
1408
1408
|
if (l == null || l === !1)
|
|
1409
|
-
|
|
1410
|
-
else if ((e.props?.isCustomElement ?? !1) ||
|
|
1409
|
+
i.removeAttribute(p);
|
|
1410
|
+
else if ((e.props?.isCustomElement ?? !1) || p in i)
|
|
1411
1411
|
try {
|
|
1412
1412
|
const x = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
|
|
1413
|
-
|
|
1413
|
+
i[p] = x;
|
|
1414
1414
|
} catch {
|
|
1415
1415
|
}
|
|
1416
1416
|
}
|
|
1417
1417
|
}
|
|
1418
|
-
for (const [
|
|
1418
|
+
for (const [p, l] of Object.entries(
|
|
1419
1419
|
a.listeners || {}
|
|
1420
1420
|
))
|
|
1421
|
-
oe.addListener(
|
|
1421
|
+
oe.addListener(i, p, l);
|
|
1422
1422
|
const b = {
|
|
1423
1423
|
...e,
|
|
1424
1424
|
props: {
|
|
@@ -1426,31 +1426,31 @@ function X(e, t, r) {
|
|
|
1426
1426
|
...a.props
|
|
1427
1427
|
}
|
|
1428
1428
|
};
|
|
1429
|
-
|
|
1429
|
+
pe(b, i, r);
|
|
1430
1430
|
try {
|
|
1431
|
-
if (typeof
|
|
1431
|
+
if (typeof i._applyProps == "function")
|
|
1432
1432
|
try {
|
|
1433
|
-
|
|
1433
|
+
i._applyProps(i._cfg);
|
|
1434
1434
|
} catch {
|
|
1435
1435
|
}
|
|
1436
|
-
typeof
|
|
1436
|
+
typeof i.requestRender == "function" ? i.requestRender() : typeof i._render == "function" && i._render(i._cfg);
|
|
1437
1437
|
} catch {
|
|
1438
1438
|
}
|
|
1439
1439
|
if (Array.isArray(e.children))
|
|
1440
|
-
for (const
|
|
1441
|
-
|
|
1442
|
-
else typeof e.children == "string" && (
|
|
1440
|
+
for (const p of e.children)
|
|
1441
|
+
i.appendChild(X(p, t, r));
|
|
1442
|
+
else typeof e.children == "string" && (i.textContent = e.children);
|
|
1443
1443
|
try {
|
|
1444
|
-
if (
|
|
1444
|
+
if (i instanceof HTMLSelectElement && m && m.hasOwnProperty("value"))
|
|
1445
1445
|
try {
|
|
1446
|
-
|
|
1446
|
+
i.value = m.value ?? "";
|
|
1447
1447
|
} catch {
|
|
1448
1448
|
}
|
|
1449
1449
|
} catch {
|
|
1450
1450
|
}
|
|
1451
|
-
return
|
|
1451
|
+
return i;
|
|
1452
1452
|
}
|
|
1453
|
-
function Rt(e, t, r,
|
|
1453
|
+
function Rt(e, t, r, i, n) {
|
|
1454
1454
|
if (typeof r == "string") {
|
|
1455
1455
|
e.textContent !== r && (e.textContent = r);
|
|
1456
1456
|
return;
|
|
@@ -1471,50 +1471,50 @@ function Rt(e, t, r, n, i) {
|
|
|
1471
1471
|
for (; x && (m.add(x), x !== d); )
|
|
1472
1472
|
x = x.nextSibling;
|
|
1473
1473
|
}
|
|
1474
|
-
function
|
|
1474
|
+
function p(l, d, x, w) {
|
|
1475
1475
|
const c = [];
|
|
1476
|
-
let
|
|
1477
|
-
for (;
|
|
1478
|
-
c.push(
|
|
1476
|
+
let h = l.nextSibling;
|
|
1477
|
+
for (; h && h !== d; )
|
|
1478
|
+
c.push(h), h = h.nextSibling;
|
|
1479
1479
|
const y = Array.isArray(x) ? x : [];
|
|
1480
|
-
if (w.some((
|
|
1481
|
-
const
|
|
1482
|
-
for (const
|
|
1483
|
-
|
|
1484
|
-
for (const
|
|
1485
|
-
const
|
|
1486
|
-
|
|
1480
|
+
if (w.some(($) => $ && $.key != null) || y.some(($) => $ && $.key != null)) {
|
|
1481
|
+
const $ = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
|
|
1482
|
+
for (const C of y)
|
|
1483
|
+
C && C.key != null && $.set(C.key, C);
|
|
1484
|
+
for (const C of c) {
|
|
1485
|
+
const E = C.key;
|
|
1486
|
+
E != null && f.set(E, C);
|
|
1487
1487
|
}
|
|
1488
1488
|
const v = /* @__PURE__ */ new Set();
|
|
1489
1489
|
let A = l.nextSibling;
|
|
1490
|
-
for (const
|
|
1491
|
-
let
|
|
1492
|
-
if (
|
|
1493
|
-
const T =
|
|
1494
|
-
|
|
1495
|
-
f.get(
|
|
1490
|
+
for (const C of w) {
|
|
1491
|
+
let E;
|
|
1492
|
+
if (C.key != null && f.has(C.key)) {
|
|
1493
|
+
const T = $.get(C.key);
|
|
1494
|
+
E = Ee(
|
|
1495
|
+
f.get(C.key),
|
|
1496
1496
|
T,
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
), v.add(
|
|
1497
|
+
C,
|
|
1498
|
+
i
|
|
1499
|
+
), v.add(E), E !== A && e.contains(E) && e.insertBefore(E, A);
|
|
1500
1500
|
} else
|
|
1501
|
-
|
|
1502
|
-
A =
|
|
1501
|
+
E = X(C, i), e.insertBefore(E, A), v.add(E);
|
|
1502
|
+
A = E.nextSibling;
|
|
1503
1503
|
}
|
|
1504
|
-
for (const
|
|
1505
|
-
!v.has(
|
|
1504
|
+
for (const C of c)
|
|
1505
|
+
!v.has(C) && e.contains(C) && e.removeChild(C);
|
|
1506
1506
|
} else {
|
|
1507
|
-
const
|
|
1507
|
+
const $ = Math.min(
|
|
1508
1508
|
y.length,
|
|
1509
1509
|
w.length
|
|
1510
1510
|
);
|
|
1511
|
-
for (let f = 0; f <
|
|
1512
|
-
const v = y[f], A = w[f],
|
|
1513
|
-
|
|
1511
|
+
for (let f = 0; f < $; f++) {
|
|
1512
|
+
const v = y[f], A = w[f], C = Ee(c[f], v, A, i);
|
|
1513
|
+
C !== c[f] && (e.insertBefore(C, c[f]), e.removeChild(c[f]));
|
|
1514
1514
|
}
|
|
1515
|
-
for (let f =
|
|
1516
|
-
e.insertBefore(X(w[f],
|
|
1517
|
-
for (let f =
|
|
1515
|
+
for (let f = $; f < w.length; f++)
|
|
1516
|
+
e.insertBefore(X(w[f], i), d);
|
|
1517
|
+
for (let f = $; f < c.length; f++)
|
|
1518
1518
|
e.removeChild(c[f]);
|
|
1519
1519
|
}
|
|
1520
1520
|
}
|
|
@@ -1522,41 +1522,41 @@ function Rt(e, t, r, n, i) {
|
|
|
1522
1522
|
let d;
|
|
1523
1523
|
if (l.tag === "#anchor") {
|
|
1524
1524
|
const x = l.key, w = `${x}:start`, c = `${x}:end`;
|
|
1525
|
-
let
|
|
1526
|
-
const
|
|
1527
|
-
if (
|
|
1528
|
-
e.insertBefore(
|
|
1529
|
-
for (const
|
|
1530
|
-
e.insertBefore(X(
|
|
1525
|
+
let h = u.get(w), y = u.get(c);
|
|
1526
|
+
const k = Array.isArray(l.children) ? l.children : [];
|
|
1527
|
+
if (h || (h = document.createTextNode(""), h.key = w), y || (y = document.createTextNode(""), y.key = c), l._startNode = h, l._endNode = y, !e.contains(h) || !e.contains(y)) {
|
|
1528
|
+
e.insertBefore(h, g);
|
|
1529
|
+
for (const $ of k)
|
|
1530
|
+
e.insertBefore(X($, i), g);
|
|
1531
1531
|
e.insertBefore(y, g);
|
|
1532
1532
|
} else
|
|
1533
|
-
|
|
1534
|
-
|
|
1533
|
+
p(
|
|
1534
|
+
h,
|
|
1535
1535
|
y,
|
|
1536
1536
|
a.get(x)?.children,
|
|
1537
|
-
|
|
1537
|
+
k
|
|
1538
1538
|
);
|
|
1539
|
-
b(
|
|
1539
|
+
b(h, y), g = y.nextSibling;
|
|
1540
1540
|
continue;
|
|
1541
1541
|
}
|
|
1542
1542
|
if (l.key != null && u.has(l.key)) {
|
|
1543
1543
|
const x = a.get(l.key);
|
|
1544
|
-
d =
|
|
1544
|
+
d = Ee(
|
|
1545
1545
|
u.get(l.key),
|
|
1546
1546
|
x,
|
|
1547
1547
|
l,
|
|
1548
|
-
|
|
1549
|
-
|
|
1548
|
+
i,
|
|
1549
|
+
n
|
|
1550
1550
|
), m.add(d), d !== g && e.contains(d) && (g && !e.contains(g) && (g = null), e.insertBefore(d, g));
|
|
1551
1551
|
} else
|
|
1552
|
-
d = X(l,
|
|
1552
|
+
d = X(l, i, n), g && !e.contains(g) && (g = null), e.insertBefore(d, g), m.add(d);
|
|
1553
1553
|
g = d.nextSibling;
|
|
1554
1554
|
}
|
|
1555
1555
|
for (const l of s)
|
|
1556
|
-
!m.has(l) && e.contains(l) && (ue(l,
|
|
1556
|
+
!m.has(l) && e.contains(l) && (ue(l, n), e.removeChild(l));
|
|
1557
1557
|
}
|
|
1558
|
-
function
|
|
1559
|
-
if (t && typeof t != "string" && t.props?.ref &&
|
|
1558
|
+
function Ee(e, t, r, i, n) {
|
|
1559
|
+
if (t && typeof t != "string" && t.props?.ref && n && ue(e, n), 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;
|
|
@@ -1571,20 +1571,20 @@ function $e(e, t, r, n, i) {
|
|
|
1571
1571
|
const g = document.createDocumentFragment();
|
|
1572
1572
|
g.appendChild(u);
|
|
1573
1573
|
for (const b of a) {
|
|
1574
|
-
const
|
|
1575
|
-
g.appendChild(
|
|
1574
|
+
const p = X(b, i);
|
|
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
|
-
ue(e,
|
|
1580
|
+
ue(e, n);
|
|
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
|
-
ue(e,
|
|
1586
|
-
const o = X(r,
|
|
1587
|
-
return
|
|
1585
|
+
ue(e, n);
|
|
1586
|
+
const o = X(r, i, n);
|
|
1587
|
+
return pe(r, o, n), e.parentNode?.replaceChild(o, e), o;
|
|
1588
1588
|
}
|
|
1589
1589
|
if (r.tag === "#anchor") {
|
|
1590
1590
|
const o = Array.isArray(r.children) ? r.children : [], a = r._startNode ?? document.createTextNode(""), u = r._endNode ?? document.createTextNode("");
|
|
@@ -1592,40 +1592,40 @@ function $e(e, t, r, n, i) {
|
|
|
1592
1592
|
const m = document.createDocumentFragment();
|
|
1593
1593
|
m.appendChild(a);
|
|
1594
1594
|
for (const g of o)
|
|
1595
|
-
m.appendChild(X(g,
|
|
1595
|
+
m.appendChild(X(g, i));
|
|
1596
1596
|
return m.appendChild(u), e.parentNode?.replaceChild(m, e), a;
|
|
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 || {}, i), Rt(o, t.children, r.children, i, n), pe(r, o, n), 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
1604
|
const a = e;
|
|
1605
|
-
return Ve(a, t.props || {}, r.props || {},
|
|
1605
|
+
return Ve(a, t.props || {}, r.props || {}, i), pe(r, a, n), a;
|
|
1606
1606
|
} catch {
|
|
1607
1607
|
}
|
|
1608
|
-
ue(e,
|
|
1609
|
-
const s = X(r,
|
|
1610
|
-
return
|
|
1608
|
+
ue(e, n);
|
|
1609
|
+
const s = X(r, i, n);
|
|
1610
|
+
return pe(r, s, n), 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, i) {
|
|
1613
|
+
let n;
|
|
1614
|
+
Array.isArray(t) ? t.length === 1 ? (n = t[0], n && typeof n == "object" && n.key == null && (n = { ...n, key: "__root__" })) : n = { tag: "div", key: "__root__", children: t } : (n = t, n && typeof n == "object" && n.key == null && (n = { ...n, key: "__root__" })), n && typeof n == "object" && n.tag === "#anchor" && (n = {
|
|
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: [n]
|
|
1619
|
+
}), n = Be(n, String(n.key ?? "root"));
|
|
1620
1620
|
const s = e._prevVNode ?? null, o = e._prevDom ?? e.firstChild ?? null;
|
|
1621
1621
|
let a;
|
|
1622
|
-
s && o ? typeof s != "string" && typeof
|
|
1622
|
+
s && o ? typeof s != "string" && typeof n != "string" && s.tag === n.tag && s.key === n.key ? a = Ee(o, s, n, r, i) : (a = X(n, r, i), e.replaceChild(a, o)) : (a = X(n, r, i), e.firstChild ? e.replaceChild(a, e.firstChild) : e.appendChild(a));
|
|
1623
1623
|
const u = [];
|
|
1624
1624
|
for (let m = 0; m < e.childNodes.length; m++) {
|
|
1625
1625
|
const g = e.childNodes[m];
|
|
1626
|
-
g !== a && g.nodeName !== "STYLE" && (ue(g,
|
|
1626
|
+
g !== a && g.nodeName !== "STYLE" && (ue(g, i), u.push(g));
|
|
1627
1627
|
}
|
|
1628
|
-
u.forEach((m) => e.removeChild(m)), e._prevVNode =
|
|
1628
|
+
u.forEach((m) => e.removeChild(m)), e._prevVNode = n, e._prevDom = a;
|
|
1629
1629
|
}
|
|
1630
1630
|
function Pe(e) {
|
|
1631
1631
|
if (typeof e == "string") return ie(e);
|
|
@@ -1634,24 +1634,24 @@ function Pe(e) {
|
|
|
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(([n, s]) => ` ${n}="${ie(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(([n]) => n !== "attrs" && n !== "directives" && n !== "ref" && n !== "key").map(([n, s]) => ` ${n}="${ie(String(s))}"`).join(""));
|
|
1640
|
+
const i = Array.isArray(e.children) ? e.children.filter(Boolean).map(Pe).join("") : typeof e.children == "string" ? ie(e.children) : e.children ? Pe(e.children) : "";
|
|
1641
|
+
return `<${e.tag}${t}${r}>${i}</${e.tag}>`;
|
|
1642
1642
|
}
|
|
1643
1643
|
function Pt(e, ...t) {
|
|
1644
1644
|
let r = "";
|
|
1645
|
-
for (let
|
|
1646
|
-
r += e[
|
|
1645
|
+
for (let i = 0; i < e.length; i++)
|
|
1646
|
+
r += e[i], i < t.length && (r += t[i]);
|
|
1647
1647
|
return r;
|
|
1648
1648
|
}
|
|
1649
1649
|
function ct(e) {
|
|
1650
1650
|
return e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;}/g, "}").trim();
|
|
1651
1651
|
}
|
|
1652
|
-
let
|
|
1652
|
+
let ke = null;
|
|
1653
1653
|
function Je() {
|
|
1654
|
-
return
|
|
1654
|
+
return ke || (ke = new CSSStyleSheet(), ke.replaceSync(ct(Mt))), ke;
|
|
1655
1655
|
}
|
|
1656
1656
|
function Lt(e) {
|
|
1657
1657
|
return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi, "").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, "").replace(/expression\s*\([^)]*\)/gi, "");
|
|
@@ -1810,17 +1810,17 @@ const Mt = Pt`
|
|
|
1810
1810
|
black: { DEFAULT: "#000000" },
|
|
1811
1811
|
transparent: { DEFAULT: "transparent" },
|
|
1812
1812
|
current: { DEFAULT: "currentColor" }
|
|
1813
|
-
},
|
|
1813
|
+
}, Wt = Object.fromEntries(
|
|
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, i]) => [
|
|
1818
1818
|
r,
|
|
1819
|
-
`var(--color-${e}${r === "DEFAULT" ? "" : `-${r}`}, ${
|
|
1819
|
+
`var(--color-${e}${r === "DEFAULT" ? "" : `-${r}`}, ${i})`
|
|
1820
1820
|
])
|
|
1821
1821
|
)
|
|
1822
1822
|
])
|
|
1823
|
-
), le = "0.25rem",
|
|
1823
|
+
), le = "0.25rem", Nt = {
|
|
1824
1824
|
// Tailwind container widths
|
|
1825
1825
|
// 3xs: 16rem => 16 / 0.25 = 64
|
|
1826
1826
|
"3xs": 64,
|
|
@@ -1850,13 +1850,38 @@ const Mt = Pt`
|
|
|
1850
1850
|
"7xl": 320
|
|
1851
1851
|
}, zt = () => {
|
|
1852
1852
|
const e = {};
|
|
1853
|
-
for (const [t, r] of Object.entries(
|
|
1853
|
+
for (const [t, r] of Object.entries(Nt))
|
|
1854
1854
|
e[`max-w-${t}`] = `max-width:calc(${le} * ${r});`, e[`min-w-${t}`] = `min-width:calc(${le} * ${r});`, e[`w-${t}`] = `width:calc(${le} * ${r});`, e[`max-h-${t}`] = `max-height:calc(${le} * ${r});`, e[`min-h-${t}`] = `min-height:calc(${le} * ${r});`, e[`h-${t}`] = `height:calc(${le} * ${r});`;
|
|
1855
1855
|
return e;
|
|
1856
1856
|
}, Dt = () => {
|
|
1857
|
-
const e = {};
|
|
1858
|
-
for (const
|
|
1859
|
-
e[`grid-cols-${
|
|
1857
|
+
const e = {}, t = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
1858
|
+
for (const r of t)
|
|
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
|
+
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
|
+
}, It = () => {
|
|
1862
|
+
const e = {}, t = [0, 1, 2, 4, 6, 8];
|
|
1863
|
+
for (const r of t) {
|
|
1864
|
+
const i = `${r}px`;
|
|
1865
|
+
e[`border-${r}`] = `border-width:${i};`, e[`border-s-${r}`] = `border-inline-start-width:${i};`, e[`border-e-${r}`] = `border-inline-end-width:${i};`, e[`border-bs-${r}`] = `border-block-start-width:${i};`, e[`border-be-${r}`] = `border-block-end-width:${i};`, e[`border-x-${r}`] = `border-inline-width:${i};`, e[`border-y-${r}`] = `border-block-width:${i};`, e[`border-t-${r}`] = `border-top-width:${i};`, e[`border-r-${r}`] = `border-right-width:${i};`, e[`border-b-${r}`] = `border-bottom-width:${i};`, e[`border-l-${r}`] = `border-left-width:${i};`;
|
|
1866
|
+
}
|
|
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
|
+
}, Ht = () => {
|
|
1869
|
+
const e = {}, t = {
|
|
1870
|
+
none: 0,
|
|
1871
|
+
xs: 2,
|
|
1872
|
+
sm: 4,
|
|
1873
|
+
md: 6,
|
|
1874
|
+
lg: 8,
|
|
1875
|
+
xl: 12,
|
|
1876
|
+
"2xl": 16,
|
|
1877
|
+
"3xl": 24,
|
|
1878
|
+
"4xl": 32,
|
|
1879
|
+
full: 9999
|
|
1880
|
+
};
|
|
1881
|
+
for (const [r, i] of Object.entries(t)) {
|
|
1882
|
+
const n = i === 9999 ? "9999px" : `${i / 16}rem`;
|
|
1883
|
+
e[`rounded-${r}`] = `border-radius:${n};`, e[`rounded-s-${r}`] = `border-start-start-radius:${n};border-end-start-radius:${n};`, e[`rounded-e-${r}`] = `border-start-end-radius:${n};border-end-end-radius:${n};`, e[`rounded-t-${r}`] = `border-top-left-radius:${n};border-top-right-radius:${n};`, e[`rounded-r-${r}`] = `border-top-right-radius:${n};border-bottom-right-radius:${n};`, e[`rounded-b-${r}`] = `border-bottom-left-radius:${n};border-bottom-right-radius:${n};`, e[`rounded-l-${r}`] = `border-top-left-radius:${n};border-bottom-left-radius:${n};`, e[`rounded-x-${r}`] = `border-top-left-radius:${n};border-bottom-left-radius:${n};border-top-right-radius:${n};border-bottom-right-radius:${n};`, e[`rounded-y-${r}`] = `border-top-left-radius:${n};border-top-right-radius:${n};border-bottom-left-radius:${n};border-bottom-right-radius:${n};`;
|
|
1884
|
+
}
|
|
1860
1885
|
return e;
|
|
1861
1886
|
}, Le = {
|
|
1862
1887
|
/* Display */
|
|
@@ -1941,63 +1966,8 @@ const Mt = Pt`
|
|
|
1941
1966
|
"text-7xl": "font-size:4.5rem;line-height:1",
|
|
1942
1967
|
"text-8xl": "font-size:6rem;line-height:1",
|
|
1943
1968
|
/* Borders */
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
"border-r": "border-right-width:1px;",
|
|
1947
|
-
"border-b": "border-bottom-width:1px;",
|
|
1948
|
-
"border-l": "border-left-width:1px;",
|
|
1949
|
-
"border-x": "border-inline-width:1px;",
|
|
1950
|
-
"border-y": "border-block-width:1px;",
|
|
1951
|
-
"border-2": "border-width:2px;",
|
|
1952
|
-
"border-4": "border-width:4px;",
|
|
1953
|
-
"border-6": "border-width:6px;",
|
|
1954
|
-
"border-8": "border-width:8px;",
|
|
1955
|
-
"rounded-none": "border-radius:0;",
|
|
1956
|
-
"rounded-xs": "border-radius:0.125rem;",
|
|
1957
|
-
"rounded-t-xs": "border-top-left-radius:0.125rem;border-top-right-radius:0.125rem;",
|
|
1958
|
-
"rounded-r-xs": "border-top-right-radius:0.125rem;border-bottom-right-radius:0.125rem;",
|
|
1959
|
-
"rounded-b-xs": "border-bottom-left-radius:0.125rem;border-bottom-right-radius:0.125rem;",
|
|
1960
|
-
"rounded-l-xs": "border-top-left-radius:0.125rem;border-bottom-left-radius:0.125rem;",
|
|
1961
|
-
"rounded-sm": "border-radius:0.25rem;",
|
|
1962
|
-
"rounded-t-sm": "border-top-left-radius:0.25rem;border-top-right-radius:0.25rem;",
|
|
1963
|
-
"rounded-r-sm": "border-top-right-radius:0.25rem;border-bottom-right-radius:0.25rem;",
|
|
1964
|
-
"rounded-b-sm": "border-bottom-left-radius:0.25rem;border-bottom-right-radius:0.25rem;",
|
|
1965
|
-
"rounded-l-sm": "border-top-left-radius:0.25rem;border-bottom-left-radius:0.25rem;",
|
|
1966
|
-
"rounded-md": "border-radius:0.375rem;",
|
|
1967
|
-
"rounded-t-md": "border-top-left-radius:0.375rem;border-top-right-radius:0.375rem;",
|
|
1968
|
-
"rounded-r-md": "border-top-right-radius:0.375rem;border-bottom-right-radius:0.375rem;",
|
|
1969
|
-
"rounded-b-md": "border-bottom-left-radius:0.375rem;border-bottom-right-radius:0.375rem;",
|
|
1970
|
-
"rounded-l-md": "border-top-left-radius:0.375rem;border-bottom-left-radius:0.375rem;",
|
|
1971
|
-
"rounded-lg": "border-radius:0.5rem;",
|
|
1972
|
-
"rounded-t-lg": "border-top-left-radius:0.5rem;border-top-right-radius:0.5rem;",
|
|
1973
|
-
"rounded-r-lg": "border-top-right-radius:0.5rem;border-bottom-right-radius:0.5rem;",
|
|
1974
|
-
"rounded-b-lg": "border-bottom-left-radius:0.5rem;border-bottom-right-radius:0.5rem;",
|
|
1975
|
-
"rounded-l-lg": "border-top-left-radius:0.5rem;border-bottom-left-radius:0.5rem;",
|
|
1976
|
-
"rounded-xl": "border-radius:0.75rem;",
|
|
1977
|
-
"rounded-t-xl": "border-top-left-radius:0.75rem;border-top-right-radius:0.75rem;",
|
|
1978
|
-
"rounded-r-xl": "border-top-right-radius:0.75rem;border-bottom-right-radius:0.75rem;",
|
|
1979
|
-
"rounded-b-xl": "border-bottom-left-radius:0.75rem;border-bottom-right-radius:0.75rem;",
|
|
1980
|
-
"rounded-l-xl": "border-top-left-radius:0.75rem;border-bottom-left-radius:0.75rem;",
|
|
1981
|
-
"rounded-2xl": "border-radius:1rem;",
|
|
1982
|
-
"rounded-t-2xl": "border-top-left-radius:1rem;border-top-right-radius:1rem;",
|
|
1983
|
-
"rounded-r-2xl": "border-top-right-radius:1rem;border-bottom-right-radius:1rem;",
|
|
1984
|
-
"rounded-b-2xl": "border-bottom-left-radius:1rem;border-bottom-right-radius:1rem;",
|
|
1985
|
-
"rounded-l-2xl": "border-top-left-radius:1rem;border-bottom-left-radius:1rem;",
|
|
1986
|
-
"rounded-3xl": "border-radius:1.5rem;",
|
|
1987
|
-
"rounded-t-3xl": "border-top-left-radius:1.5rem;border-top-right-radius:1.5rem;",
|
|
1988
|
-
"rounded-r-3xl": "border-top-right-radius:1.5rem;border-bottom-right-radius:1.5rem;",
|
|
1989
|
-
"rounded-b-3xl": "border-bottom-left-radius:1.5rem;border-bottom-right-radius:1.5rem;",
|
|
1990
|
-
"rounded-l-3xl": "border-top-left-radius:1.5rem;border-bottom-left-radius:1.5rem;",
|
|
1991
|
-
"rounded-4xl": "border-radius:2rem;",
|
|
1992
|
-
"rounded-t-4xl": "border-top-left-radius:2rem;border-top-right-radius:2rem;",
|
|
1993
|
-
"rounded-r-4xl": "border-top-right-radius:2rem;border-bottom-right-radius:2rem;",
|
|
1994
|
-
"rounded-b-4xl": "border-bottom-left-radius:2rem;border-bottom-right-radius:2rem;",
|
|
1995
|
-
"rounded-l-4xl": "border-top-left-radius:2rem;border-bottom-left-radius:2rem;",
|
|
1996
|
-
"rounded-full": "border-radius:9999px;",
|
|
1997
|
-
"rounded-t-full": "border-top-left-radius:9999px;border-top-right-radius:9999px;",
|
|
1998
|
-
"rounded-r-full": "border-top-right-radius:9999px;border-bottom-right-radius:9999px;",
|
|
1999
|
-
"rounded-b-full": "border-bottom-left-radius:9999px;border-bottom-right-radius:9999px;",
|
|
2000
|
-
"rounded-l-full": "border-top-left-radius:9999px;border-bottom-left-radius:9999px;",
|
|
1969
|
+
...It(),
|
|
1970
|
+
...Ht(),
|
|
2001
1971
|
/* Shadow and effects */
|
|
2002
1972
|
// Shadows use a CSS variable for color so color utilities can modify --ce-shadow-color
|
|
2003
1973
|
"shadow-none": "--ce-shadow-color: rgb(0 0 0 / 0);box-shadow:0 0 var(--ce-shadow-color, #0000);",
|
|
@@ -2114,19 +2084,19 @@ const Mt = Pt`
|
|
|
2114
2084
|
"gap-y": ["row-gap"]
|
|
2115
2085
|
};
|
|
2116
2086
|
function G(e, t) {
|
|
2117
|
-
let r = 0,
|
|
2118
|
-
for (let
|
|
2119
|
-
const s = e[
|
|
2087
|
+
let r = 0, i = 0;
|
|
2088
|
+
for (let n = 0; n < e.length; n++) {
|
|
2089
|
+
const s = e[n];
|
|
2120
2090
|
if (s === "[") r++;
|
|
2121
2091
|
else if (s === "]" && r > 0) r--;
|
|
2122
|
-
else if (s === "(")
|
|
2123
|
-
else if (s === ")" &&
|
|
2124
|
-
else if (r === 0 &&
|
|
2125
|
-
return e.slice(0,
|
|
2092
|
+
else if (s === "(") i++;
|
|
2093
|
+
else if (s === ")" && i > 0) i--;
|
|
2094
|
+
else if (r === 0 && i === 0 && (s === ">" || s === "+" || s === "~" || s === " "))
|
|
2095
|
+
return e.slice(0, n) + t + e.slice(n);
|
|
2126
2096
|
}
|
|
2127
2097
|
return e + t;
|
|
2128
2098
|
}
|
|
2129
|
-
const
|
|
2099
|
+
const Bt = {
|
|
2130
2100
|
before: (e, t) => `${e}::before{${t}}`,
|
|
2131
2101
|
after: (e, t) => `${e}::after{${t}}`,
|
|
2132
2102
|
hover: (e, t) => `${G(e, ":hover")}{${t}}`,
|
|
@@ -2159,22 +2129,22 @@ const It = {
|
|
|
2159
2129
|
// Dark mode (now plain string)
|
|
2160
2130
|
dark: "(prefers-color-scheme: dark)"
|
|
2161
2131
|
}, je = ["sm", "md", "lg", "xl", "2xl"];
|
|
2162
|
-
function
|
|
2163
|
-
const t = e.startsWith("-"),
|
|
2164
|
-
if (
|
|
2165
|
-
const
|
|
2166
|
-
if (Number.isNaN(o) || !Ze[
|
|
2132
|
+
function We(e) {
|
|
2133
|
+
const t = e.startsWith("-"), i = (t ? e.slice(1) : e).split("-");
|
|
2134
|
+
if (i.length < 2) return null;
|
|
2135
|
+
const n = i.slice(0, -1).join("-"), s = i[i.length - 1], o = parseFloat(s);
|
|
2136
|
+
if (Number.isNaN(o) || !Ze[n]) return null;
|
|
2167
2137
|
const a = t ? "-" : "";
|
|
2168
|
-
return Ze[
|
|
2138
|
+
return Ze[n].map((u) => `${u}:calc(${a}${le} * ${o});`).join("");
|
|
2169
2139
|
}
|
|
2170
2140
|
function Ge(e) {
|
|
2171
|
-
const t = e.replace("#", ""), r = parseInt(t, 16),
|
|
2172
|
-
return `${
|
|
2141
|
+
const t = e.replace("#", ""), r = parseInt(t, 16), i = r >> 16 & 255, n = r >> 8 & 255, s = r & 255;
|
|
2142
|
+
return `${i} ${n} ${s}`;
|
|
2173
2143
|
}
|
|
2174
|
-
function
|
|
2144
|
+
function Ut(e) {
|
|
2175
2145
|
const t = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
|
|
2176
2146
|
if (!t) return null;
|
|
2177
|
-
const [, r,
|
|
2147
|
+
const [, r, i, n = "DEFAULT"] = t, s = Wt[i]?.[n];
|
|
2178
2148
|
if (!s) return null;
|
|
2179
2149
|
if (r === "shadow") return `--ce-shadow-color:${s};`;
|
|
2180
2150
|
const a = {
|
|
@@ -2190,33 +2160,33 @@ function Ht(e) {
|
|
|
2190
2160
|
}[r];
|
|
2191
2161
|
return a ? `${a}:${s};` : null;
|
|
2192
2162
|
}
|
|
2193
|
-
function
|
|
2163
|
+
function qt(e) {
|
|
2194
2164
|
const [t, r] = e.split("/");
|
|
2195
2165
|
if (!r) return { base: t };
|
|
2196
|
-
const
|
|
2197
|
-
return isNaN(
|
|
2166
|
+
const i = parseInt(r, 10);
|
|
2167
|
+
return isNaN(i) || i < 0 || i > 100 ? { base: t } : { base: t, opacity: i / 100 };
|
|
2198
2168
|
}
|
|
2199
|
-
function
|
|
2200
|
-
const { base: t, opacity: r } =
|
|
2201
|
-
if (
|
|
2169
|
+
function Ne(e) {
|
|
2170
|
+
const { base: t, opacity: r } = qt(e), i = Ut(t);
|
|
2171
|
+
if (i) {
|
|
2202
2172
|
if (r !== void 0) {
|
|
2203
|
-
const s = /#([0-9a-f]{6})/i.exec(
|
|
2173
|
+
const s = /#([0-9a-f]{6})/i.exec(i);
|
|
2204
2174
|
if (s) {
|
|
2205
2175
|
const o = Ge(s[0]);
|
|
2206
|
-
return
|
|
2176
|
+
return i.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
|
|
2207
2177
|
}
|
|
2208
2178
|
}
|
|
2209
|
-
return
|
|
2179
|
+
return i;
|
|
2210
2180
|
}
|
|
2211
|
-
const
|
|
2212
|
-
if (
|
|
2213
|
-
const s = /#([0-9a-f]{6})/i.exec(
|
|
2181
|
+
const n = Se(t);
|
|
2182
|
+
if (n && r !== void 0) {
|
|
2183
|
+
const s = /#([0-9a-f]{6})/i.exec(n);
|
|
2214
2184
|
if (s) {
|
|
2215
2185
|
const o = Ge(s[0]);
|
|
2216
|
-
return
|
|
2186
|
+
return n.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
|
|
2217
2187
|
}
|
|
2218
2188
|
}
|
|
2219
|
-
return
|
|
2189
|
+
return n;
|
|
2220
2190
|
}
|
|
2221
2191
|
function ze(e) {
|
|
2222
2192
|
const t = /^opacity-(\d{1,3})$/.exec(e);
|
|
@@ -2226,19 +2196,19 @@ function ze(e) {
|
|
|
2226
2196
|
}
|
|
2227
2197
|
function Se(e) {
|
|
2228
2198
|
if (e.startsWith("[") && e.endsWith("]") && !e.includes("-[")) {
|
|
2229
|
-
const
|
|
2230
|
-
if (
|
|
2231
|
-
const s =
|
|
2232
|
-
let o =
|
|
2199
|
+
const n = e.slice(1, -1).trim().match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*:(.*)$/);
|
|
2200
|
+
if (n) {
|
|
2201
|
+
const s = n[1].trim();
|
|
2202
|
+
let o = n[2].trim();
|
|
2233
2203
|
return o = o.replace(/url\('\s*([^']*?)\s*'\)/g, 'url("$1")'), o = o.replace(/^'([^']*)'$/g, '"$1"'), `${s}:${o};`;
|
|
2234
2204
|
}
|
|
2235
2205
|
return null;
|
|
2236
2206
|
}
|
|
2237
2207
|
const t = e.indexOf("-["), r = e.endsWith("]");
|
|
2238
2208
|
if (t > 0 && r) {
|
|
2239
|
-
const
|
|
2240
|
-
let
|
|
2241
|
-
|
|
2209
|
+
const i = e.slice(0, t);
|
|
2210
|
+
let n = e.slice(t + 2, -1);
|
|
2211
|
+
n = n.replace(/_/g, " ");
|
|
2242
2212
|
const s = {
|
|
2243
2213
|
bg: "background-color",
|
|
2244
2214
|
text: "color",
|
|
@@ -2283,14 +2253,14 @@ function Se(e) {
|
|
|
2283
2253
|
leading: "line-height",
|
|
2284
2254
|
z: "z-index"
|
|
2285
2255
|
};
|
|
2286
|
-
if (
|
|
2287
|
-
return `transform:rotate(${
|
|
2288
|
-
const o = s[
|
|
2289
|
-
if (o &&
|
|
2256
|
+
if (i === "rotate")
|
|
2257
|
+
return `transform:rotate(${n});`;
|
|
2258
|
+
const o = s[i] ?? i.replace(/_/g, "-");
|
|
2259
|
+
if (o && n) return `${o}:${n};`;
|
|
2290
2260
|
}
|
|
2291
2261
|
return null;
|
|
2292
2262
|
}
|
|
2293
|
-
function
|
|
2263
|
+
function Ft(e) {
|
|
2294
2264
|
if (e.startsWith("[") && e.endsWith("]")) {
|
|
2295
2265
|
const r = e.slice(1, -1);
|
|
2296
2266
|
return r.includes("&") ? r : e;
|
|
@@ -2302,41 +2272,41 @@ function Ut(e) {
|
|
|
2302
2272
|
}
|
|
2303
2273
|
return null;
|
|
2304
2274
|
}
|
|
2305
|
-
function
|
|
2275
|
+
function Kt(e) {
|
|
2306
2276
|
return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
|
|
2307
2277
|
}
|
|
2308
|
-
function
|
|
2278
|
+
function Vt(e) {
|
|
2309
2279
|
const t = /class\s*=\s*(['"])(.*?)\1/g, r = [];
|
|
2310
|
-
let
|
|
2311
|
-
for (;
|
|
2312
|
-
const
|
|
2313
|
-
|
|
2280
|
+
let i;
|
|
2281
|
+
for (; i = t.exec(e); ) {
|
|
2282
|
+
const n = i[2].split(/\s+/).filter(Boolean);
|
|
2283
|
+
n.length && r.push(...n);
|
|
2314
2284
|
}
|
|
2315
2285
|
return r.filter(Boolean);
|
|
2316
2286
|
}
|
|
2317
|
-
const Xe = /* @__PURE__ */ new Map(),
|
|
2318
|
-
function
|
|
2287
|
+
const Xe = /* @__PURE__ */ new Map(), Jt = 16;
|
|
2288
|
+
function Zt(e) {
|
|
2319
2289
|
const t = Date.now(), r = Xe.get(e);
|
|
2320
|
-
if (r && t - r.timestamp <
|
|
2321
|
-
const
|
|
2290
|
+
if (r && t - r.timestamp < Jt) return r.css;
|
|
2291
|
+
const i = Vt(e), n = new Set(i), s = [], o = [], a = [], u = [], m = {};
|
|
2322
2292
|
function g(w, c = !1) {
|
|
2323
|
-
const
|
|
2324
|
-
if (
|
|
2293
|
+
const h = (c ? "dark|" : "") + w;
|
|
2294
|
+
if (h in m) return m[h];
|
|
2325
2295
|
const y = d(w, c);
|
|
2326
|
-
return m[
|
|
2296
|
+
return m[h] = y, y;
|
|
2327
2297
|
}
|
|
2328
2298
|
function b(w) {
|
|
2329
|
-
const c = w.some((y) => je.includes(y)),
|
|
2330
|
-
return w.length === 0 ? 1 : !c && !
|
|
2299
|
+
const c = w.some((y) => je.includes(y)), h = w.includes("dark");
|
|
2300
|
+
return w.length === 0 ? 1 : !c && !h ? 2 : c && !h ? 3 : 4;
|
|
2331
2301
|
}
|
|
2332
|
-
function
|
|
2302
|
+
function p(w) {
|
|
2333
2303
|
const c = [];
|
|
2334
|
-
let
|
|
2335
|
-
for (let
|
|
2336
|
-
const f = w[
|
|
2337
|
-
f === "[" ? y++ : f === "]" && y > 0 ? y-- : f === "(" ?
|
|
2304
|
+
let h = "", y = 0, k = 0;
|
|
2305
|
+
for (let $ = 0; $ < w.length; $++) {
|
|
2306
|
+
const f = w[$];
|
|
2307
|
+
f === "[" ? y++ : f === "]" && y > 0 ? y-- : f === "(" ? k++ : f === ")" && k > 0 && k--, f === ":" && y === 0 && k === 0 ? (c.push(h), h = "") : h += f;
|
|
2338
2308
|
}
|
|
2339
|
-
return
|
|
2309
|
+
return h && c.push(h), c;
|
|
2340
2310
|
}
|
|
2341
2311
|
function l(w) {
|
|
2342
2312
|
switch (w) {
|
|
@@ -2369,125 +2339,125 @@ function Vt(e) {
|
|
|
2369
2339
|
}
|
|
2370
2340
|
}
|
|
2371
2341
|
function d(w, c = !1) {
|
|
2372
|
-
const
|
|
2342
|
+
const h = p(w);
|
|
2373
2343
|
let y = !1;
|
|
2374
|
-
const
|
|
2375
|
-
if (!
|
|
2376
|
-
const
|
|
2344
|
+
const k = h.find((_) => (_.startsWith("!") && (y = !0, _ = _.slice(1)), Le[_] || We(_) || ze(_) || Ne(_) || Se(_)));
|
|
2345
|
+
if (!k) return null;
|
|
2346
|
+
const $ = k.replace(/^!/, ""), f = Le[$] ?? We($) ?? ze($) ?? Ne($) ?? Se($);
|
|
2377
2347
|
if (!f) return null;
|
|
2378
|
-
const v =
|
|
2379
|
-
let A = v >= 0 ?
|
|
2380
|
-
c && (A = A.filter((
|
|
2381
|
-
const
|
|
2382
|
-
let R =
|
|
2348
|
+
const v = h.indexOf(k);
|
|
2349
|
+
let A = v >= 0 ? h.slice(0, v) : [];
|
|
2350
|
+
c && (A = A.filter((_) => _ !== "dark"));
|
|
2351
|
+
const C = `.${Kt(w)}`, E = "__SUBJECT__", T = y ? f.replace(/;$/, " !important;") : f;
|
|
2352
|
+
let R = E;
|
|
2383
2353
|
const S = [];
|
|
2384
|
-
for (const
|
|
2385
|
-
|
|
2386
|
-
A = A.filter((
|
|
2354
|
+
for (const _ of A)
|
|
2355
|
+
_.startsWith("group-") ? (R = `.group:${_.slice(6)} ${R}`, S.push(_)) : _.startsWith("peer-") && (R = R.replace(E, `.peer:${_.slice(5)}~${E}`), S.push(_));
|
|
2356
|
+
A = A.filter((_) => !S.includes(_));
|
|
2387
2357
|
const P = [], B = [];
|
|
2388
2358
|
let V = null;
|
|
2389
|
-
for (const
|
|
2390
|
-
if (
|
|
2391
|
-
const U =
|
|
2359
|
+
for (const _ of A) {
|
|
2360
|
+
if (_ === "dark" || je.includes(_)) continue;
|
|
2361
|
+
const U = Ft(_);
|
|
2392
2362
|
if (U) {
|
|
2393
2363
|
V = U;
|
|
2394
2364
|
continue;
|
|
2395
2365
|
}
|
|
2396
|
-
const D = l(
|
|
2366
|
+
const D = l(_);
|
|
2397
2367
|
if (D) {
|
|
2398
2368
|
V ? B.push(D) : P.push(D);
|
|
2399
2369
|
continue;
|
|
2400
2370
|
}
|
|
2401
|
-
const
|
|
2402
|
-
typeof
|
|
2371
|
+
const N = Bt[_];
|
|
2372
|
+
typeof N == "function" && (R = N(R, T).split("{")[0]);
|
|
2403
2373
|
}
|
|
2404
|
-
function we(
|
|
2405
|
-
if (!U) return
|
|
2406
|
-
let D = 0,
|
|
2407
|
-
if (
|
|
2374
|
+
function we(_, U) {
|
|
2375
|
+
if (!U) return _;
|
|
2376
|
+
let D = 0, N = 0;
|
|
2377
|
+
if (_.length && (_[0] === ">" || _[0] === "+" || _[0] === "~" || _[0] === " ")) {
|
|
2408
2378
|
let O = 1;
|
|
2409
|
-
for (; O <
|
|
2410
|
-
for (; O <
|
|
2411
|
-
const I =
|
|
2412
|
-
if (I === "[" ? D++ : I === "]" && D > 0 ? D-- : I === "(" ?
|
|
2413
|
-
return
|
|
2379
|
+
for (; O < _.length && _[O] === " "; ) O++;
|
|
2380
|
+
for (; O < _.length; O++) {
|
|
2381
|
+
const I = _[O];
|
|
2382
|
+
if (I === "[" ? D++ : I === "]" && D > 0 ? D-- : I === "(" ? N++ : I === ")" && N > 0 && N--, D === 0 && N === 0 && (_[O] === ">" || _[O] === "+" || _[O] === "~" || _[O] === " "))
|
|
2383
|
+
return _.slice(0, O) + U + _.slice(O);
|
|
2414
2384
|
}
|
|
2415
|
-
return
|
|
2385
|
+
return _ + U;
|
|
2416
2386
|
}
|
|
2417
|
-
for (let O = 0; O <
|
|
2418
|
-
const I =
|
|
2419
|
-
if (I === "[" ? D++ : I === "]" && D > 0 ? D-- : I === "(" ?
|
|
2420
|
-
return
|
|
2387
|
+
for (let O = 0; O < _.length; O++) {
|
|
2388
|
+
const I = _[O];
|
|
2389
|
+
if (I === "[" ? D++ : I === "]" && D > 0 ? D-- : I === "(" ? N++ : I === ")" && N > 0 && N--, D === 0 && N === 0 && (I === ">" || I === "+" || I === "~" || I === " "))
|
|
2390
|
+
return _.slice(0, O) + U + _.slice(O);
|
|
2421
2391
|
}
|
|
2422
|
-
return
|
|
2392
|
+
return _ + U;
|
|
2423
2393
|
}
|
|
2424
2394
|
const K = P.join(""), L = B.join("");
|
|
2425
2395
|
if (V)
|
|
2426
2396
|
if (V.includes("&")) {
|
|
2427
|
-
const
|
|
2397
|
+
const _ = V.indexOf("&"), U = V.slice(0, _), D = V.slice(_ + 1), N = E + K, O = R;
|
|
2428
2398
|
if (P.length === 0)
|
|
2429
|
-
R = O.replace(
|
|
2399
|
+
R = O.replace(E, U + N + L + D);
|
|
2430
2400
|
else {
|
|
2431
2401
|
const I = we(D, L);
|
|
2432
|
-
R = O.replace(
|
|
2402
|
+
R = O.replace(E, U + N + I);
|
|
2433
2403
|
}
|
|
2434
2404
|
} else
|
|
2435
|
-
R = R.replace(
|
|
2405
|
+
R = R.replace(E, `${V}${E + K}`), L && (R = R.replace(E, `${E}${L}`));
|
|
2436
2406
|
else
|
|
2437
|
-
R =
|
|
2438
|
-
R = R.replace(new RegExp(
|
|
2407
|
+
R = E + K + L;
|
|
2408
|
+
R = R.replace(new RegExp(E, "g"), C);
|
|
2439
2409
|
let M = `${R}{${T}}`;
|
|
2440
|
-
const J = A.filter((
|
|
2410
|
+
const J = A.filter((_) => je.includes(_)), Z = J.length ? J[J.length - 1] : null, z = A.includes("dark");
|
|
2441
2411
|
return c && Z ? M = `@media (prefers-color-scheme: dark) and ${Me[Z]}{${M}}` : c ? 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;
|
|
2442
2412
|
}
|
|
2443
|
-
for (const w of
|
|
2444
|
-
const c =
|
|
2445
|
-
(f) => Le[f] ||
|
|
2413
|
+
for (const w of n) {
|
|
2414
|
+
const c = p(w), h = c.find(
|
|
2415
|
+
(f) => Le[f] || We(f) || ze(f) || Ne(f) || Se(f)
|
|
2446
2416
|
);
|
|
2447
|
-
if (!
|
|
2448
|
-
const y = c.indexOf(
|
|
2449
|
-
if (
|
|
2417
|
+
if (!h) continue;
|
|
2418
|
+
const y = c.indexOf(h), k = y >= 0 ? c.slice(0, y) : [], $ = b(k);
|
|
2419
|
+
if ($ === 4) {
|
|
2450
2420
|
const f = g(w, !0);
|
|
2451
2421
|
f && u.push(f);
|
|
2452
2422
|
} else {
|
|
2453
2423
|
const f = g(w);
|
|
2454
|
-
f && (
|
|
2424
|
+
f && ($ === 1 ? s.push(f) : $ === 2 ? o.push(f) : $ === 3 && a.push(f));
|
|
2455
2425
|
}
|
|
2456
2426
|
}
|
|
2457
2427
|
const x = [...s, ...o, ...a, ...u].join("");
|
|
2458
2428
|
return Xe.set(e, { css: x, timestamp: t }), x;
|
|
2459
2429
|
}
|
|
2460
2430
|
const ge = [];
|
|
2461
|
-
function
|
|
2431
|
+
function Gt(e, t, r, i, n, s, o, a) {
|
|
2462
2432
|
if (e) {
|
|
2463
2433
|
ge.push(r);
|
|
2464
2434
|
try {
|
|
2465
2435
|
const u = t.render(r);
|
|
2466
2436
|
if (u instanceof Promise) {
|
|
2467
2437
|
s(!0), u.then((m) => {
|
|
2468
|
-
s(!1), o(null), Ye(e, m, r,
|
|
2438
|
+
s(!1), o(null), Ye(e, m, r, i, n), a(e.innerHTML);
|
|
2469
2439
|
}).catch((m) => {
|
|
2470
2440
|
s(!1), o(m);
|
|
2471
2441
|
});
|
|
2472
2442
|
return;
|
|
2473
2443
|
}
|
|
2474
|
-
Ye(e, u, r,
|
|
2444
|
+
Ye(e, u, r, i, n), a(e.innerHTML);
|
|
2475
2445
|
} finally {
|
|
2476
2446
|
ge.pop();
|
|
2477
2447
|
}
|
|
2478
2448
|
}
|
|
2479
2449
|
}
|
|
2480
|
-
function Ye(e, t, r,
|
|
2450
|
+
function Ye(e, t, r, i, n) {
|
|
2481
2451
|
e && (Ot(
|
|
2482
2452
|
e,
|
|
2483
2453
|
Array.isArray(t) ? t : [t],
|
|
2484
2454
|
r,
|
|
2485
|
-
|
|
2486
|
-
),
|
|
2455
|
+
i
|
|
2456
|
+
), n(e.innerHTML));
|
|
2487
2457
|
}
|
|
2488
|
-
function
|
|
2458
|
+
function Xt(e, t, r, i, n, s, o) {
|
|
2489
2459
|
if (s !== null && clearTimeout(s), Date.now() - t < 16) {
|
|
2490
|
-
if (
|
|
2460
|
+
if (n(r + 1), r === 15)
|
|
2491
2461
|
console.warn(
|
|
2492
2462
|
`⚠️ Component is re-rendering rapidly. This might indicate:
|
|
2493
2463
|
Common causes:
|
|
@@ -2506,17 +2476,17 @@ Stopping runaway component render to prevent browser freeze`
|
|
|
2506
2476
|
return;
|
|
2507
2477
|
}
|
|
2508
2478
|
} else
|
|
2509
|
-
|
|
2479
|
+
n(0);
|
|
2510
2480
|
const m = setTimeout(() => {
|
|
2511
|
-
|
|
2481
|
+
i(Date.now()), e(), o(null);
|
|
2512
2482
|
}, r > 10 ? 100 : 0);
|
|
2513
2483
|
o(m);
|
|
2514
2484
|
}
|
|
2515
|
-
function
|
|
2485
|
+
function Yt(e, t, r, i, n) {
|
|
2516
2486
|
if (!e) return;
|
|
2517
|
-
const s =
|
|
2487
|
+
const s = Zt(r);
|
|
2518
2488
|
if ((!s || s.trim() === "") && !t._computedStyle) {
|
|
2519
|
-
|
|
2489
|
+
n(null), e.adoptedStyleSheets = [Je()];
|
|
2520
2490
|
return;
|
|
2521
2491
|
}
|
|
2522
2492
|
let o = "";
|
|
@@ -2525,20 +2495,20 @@ function Gt(e, t, r, n, i) {
|
|
|
2525
2495
|
${s}
|
|
2526
2496
|
`);
|
|
2527
2497
|
a = ct(a);
|
|
2528
|
-
let u =
|
|
2529
|
-
u || (u = new CSSStyleSheet()), (u.cssRules.length === 0 || u.toString() !== a) && u.replaceSync(a), e.adoptedStyleSheets = [Je(), u],
|
|
2498
|
+
let u = i;
|
|
2499
|
+
u || (u = new CSSStyleSheet()), (u.cssRules.length === 0 || u.toString() !== a) && u.replaceSync(a), e.adoptedStyleSheets = [Je(), u], n(u);
|
|
2530
2500
|
}
|
|
2531
|
-
let
|
|
2532
|
-
function
|
|
2533
|
-
|
|
2501
|
+
let W = null;
|
|
2502
|
+
function Qt(e) {
|
|
2503
|
+
W = e;
|
|
2534
2504
|
}
|
|
2535
|
-
function
|
|
2536
|
-
|
|
2505
|
+
function er() {
|
|
2506
|
+
W = null;
|
|
2537
2507
|
}
|
|
2538
|
-
function
|
|
2539
|
-
if (!
|
|
2508
|
+
function gr() {
|
|
2509
|
+
if (!W)
|
|
2540
2510
|
throw new Error("useEmit must be called during component render");
|
|
2541
|
-
const e =
|
|
2511
|
+
const e = W.emit;
|
|
2542
2512
|
return (t, r) => e(t, r);
|
|
2543
2513
|
}
|
|
2544
2514
|
function ye(e) {
|
|
@@ -2549,40 +2519,40 @@ function ye(e) {
|
|
|
2549
2519
|
configurable: !1
|
|
2550
2520
|
});
|
|
2551
2521
|
}
|
|
2552
|
-
function
|
|
2553
|
-
if (!
|
|
2522
|
+
function mr(e) {
|
|
2523
|
+
if (!W)
|
|
2554
2524
|
throw new Error("useOnConnected must be called during component render");
|
|
2555
|
-
ye(
|
|
2525
|
+
ye(W), W._hookCallbacks.onConnected = e;
|
|
2556
2526
|
}
|
|
2557
|
-
function
|
|
2558
|
-
if (!
|
|
2527
|
+
function yr(e) {
|
|
2528
|
+
if (!W)
|
|
2559
2529
|
throw new Error("useOnDisconnected must be called during component render");
|
|
2560
|
-
ye(
|
|
2530
|
+
ye(W), W._hookCallbacks.onDisconnected = e;
|
|
2561
2531
|
}
|
|
2562
|
-
function
|
|
2563
|
-
if (!
|
|
2532
|
+
function br(e) {
|
|
2533
|
+
if (!W)
|
|
2564
2534
|
throw new Error("useOnAttributeChanged must be called during component render");
|
|
2565
|
-
ye(
|
|
2535
|
+
ye(W), W._hookCallbacks.onAttributeChanged = e;
|
|
2566
2536
|
}
|
|
2567
|
-
function
|
|
2568
|
-
if (!
|
|
2537
|
+
function wr(e) {
|
|
2538
|
+
if (!W)
|
|
2569
2539
|
throw new Error("useOnError must be called during component render");
|
|
2570
|
-
ye(
|
|
2540
|
+
ye(W), W._hookCallbacks.onError = e;
|
|
2571
2541
|
}
|
|
2572
|
-
function
|
|
2573
|
-
if (!
|
|
2542
|
+
function xr(e) {
|
|
2543
|
+
if (!W)
|
|
2574
2544
|
throw new Error("useStyle must be called during component render");
|
|
2575
|
-
ye(
|
|
2545
|
+
ye(W);
|
|
2576
2546
|
try {
|
|
2577
2547
|
const t = e();
|
|
2578
|
-
Object.defineProperty(
|
|
2548
|
+
Object.defineProperty(W, "_computedStyle", {
|
|
2579
2549
|
value: t,
|
|
2580
2550
|
writable: !0,
|
|
2581
2551
|
enumerable: !1,
|
|
2582
2552
|
configurable: !0
|
|
2583
2553
|
});
|
|
2584
2554
|
} catch (t) {
|
|
2585
|
-
console.warn("Error in useStyle callback:", t), Object.defineProperty(
|
|
2555
|
+
console.warn("Error in useStyle callback:", t), Object.defineProperty(W, "_computedStyle", {
|
|
2586
2556
|
value: "",
|
|
2587
2557
|
writable: !0,
|
|
2588
2558
|
enumerable: !1,
|
|
@@ -2595,7 +2565,7 @@ if (typeof window < "u") {
|
|
|
2595
2565
|
const e = globalThis;
|
|
2596
2566
|
e[Qe] || (e[Qe] = Te);
|
|
2597
2567
|
}
|
|
2598
|
-
function
|
|
2568
|
+
function tr(e, t) {
|
|
2599
2569
|
if (!t.render)
|
|
2600
2570
|
throw new Error(
|
|
2601
2571
|
"Component must have a render function"
|
|
@@ -2663,13 +2633,13 @@ function Qt(e, t) {
|
|
|
2663
2633
|
enumerable: !1,
|
|
2664
2634
|
configurable: !1
|
|
2665
2635
|
}), Object.defineProperty(r, "_triggerWatchers", {
|
|
2666
|
-
value: (
|
|
2636
|
+
value: (n, s) => this._triggerWatchers(n, s),
|
|
2667
2637
|
writable: !1,
|
|
2668
2638
|
enumerable: !1,
|
|
2669
2639
|
configurable: !1
|
|
2670
2640
|
}), this.context = r, Object.defineProperty(this.context, "emit", {
|
|
2671
|
-
value: (
|
|
2672
|
-
const a = new CustomEvent(
|
|
2641
|
+
value: (n, s, o) => {
|
|
2642
|
+
const a = new CustomEvent(n, {
|
|
2673
2643
|
detail: s,
|
|
2674
2644
|
bubbles: !0,
|
|
2675
2645
|
composed: !0,
|
|
@@ -2681,24 +2651,24 @@ function Qt(e, t) {
|
|
|
2681
2651
|
enumerable: !1,
|
|
2682
2652
|
configurable: !1
|
|
2683
2653
|
});
|
|
2684
|
-
const
|
|
2685
|
-
Object.keys(
|
|
2686
|
-
const s = n
|
|
2687
|
-
typeof s == "function" && (this.context[
|
|
2688
|
-
}), this._applyComputed(
|
|
2689
|
-
let s = this[
|
|
2690
|
-
Object.defineProperty(this,
|
|
2654
|
+
const i = Te.get(e) || t;
|
|
2655
|
+
Object.keys(i).forEach((n) => {
|
|
2656
|
+
const s = i[n];
|
|
2657
|
+
typeof s == "function" && (this.context[n] = (...o) => s(...o, this.context));
|
|
2658
|
+
}), this._applyComputed(i), i.props && Object.keys(i.props).forEach((n) => {
|
|
2659
|
+
let s = this[n];
|
|
2660
|
+
Object.defineProperty(this, n, {
|
|
2691
2661
|
get() {
|
|
2692
2662
|
return s;
|
|
2693
2663
|
},
|
|
2694
2664
|
set(o) {
|
|
2695
2665
|
const a = s;
|
|
2696
|
-
s = o, this.context[
|
|
2666
|
+
s = o, this.context[n] = o, this._initializing || (this._applyProps(i), a !== o && this._requestRender());
|
|
2697
2667
|
},
|
|
2698
2668
|
enumerable: !0,
|
|
2699
2669
|
configurable: !0
|
|
2700
2670
|
});
|
|
2701
|
-
}), this._initializing = !1, this._initWatchers(
|
|
2671
|
+
}), this._initializing = !1, this._initWatchers(i), this._applyProps(i), this._render(i);
|
|
2702
2672
|
}
|
|
2703
2673
|
connectedCallback() {
|
|
2704
2674
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
@@ -2736,13 +2706,13 @@ function Qt(e, t) {
|
|
|
2736
2706
|
);
|
|
2737
2707
|
});
|
|
2738
2708
|
}
|
|
2739
|
-
attributeChangedCallback(r,
|
|
2709
|
+
attributeChangedCallback(r, i, n) {
|
|
2740
2710
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
2741
|
-
this._applyProps(t),
|
|
2711
|
+
this._applyProps(t), i !== n && this._requestRender(), $t(
|
|
2742
2712
|
t,
|
|
2743
2713
|
r,
|
|
2744
|
-
n,
|
|
2745
2714
|
i,
|
|
2715
|
+
n,
|
|
2746
2716
|
this.context
|
|
2747
2717
|
);
|
|
2748
2718
|
});
|
|
@@ -2755,21 +2725,21 @@ function Qt(e, t) {
|
|
|
2755
2725
|
// --- Render ---
|
|
2756
2726
|
_render(r) {
|
|
2757
2727
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
2758
|
-
|
|
2728
|
+
Gt(
|
|
2759
2729
|
this.shadowRoot,
|
|
2760
2730
|
r,
|
|
2761
2731
|
this.context,
|
|
2762
2732
|
this._refs,
|
|
2763
|
-
(
|
|
2764
|
-
this._lastHtmlStringForJitCSS =
|
|
2733
|
+
(i) => {
|
|
2734
|
+
this._lastHtmlStringForJitCSS = i, typeof this.onHtmlStringUpdate == "function" && this.onHtmlStringUpdate(i);
|
|
2765
2735
|
},
|
|
2766
|
-
(
|
|
2767
|
-
this._templateLoading =
|
|
2736
|
+
(i) => {
|
|
2737
|
+
this._templateLoading = i, typeof this.onLoadingStateChange == "function" && this.onLoadingStateChange(i);
|
|
2768
2738
|
},
|
|
2769
|
-
(
|
|
2770
|
-
this._templateError =
|
|
2739
|
+
(i) => {
|
|
2740
|
+
this._templateError = i, typeof this.onErrorStateChange == "function" && this.onErrorStateChange(i);
|
|
2771
2741
|
},
|
|
2772
|
-
(
|
|
2742
|
+
(i) => this._applyStyle(r, i)
|
|
2773
2743
|
);
|
|
2774
2744
|
});
|
|
2775
2745
|
}
|
|
@@ -2779,7 +2749,7 @@ function Qt(e, t) {
|
|
|
2779
2749
|
_requestRender() {
|
|
2780
2750
|
this._runLogicWithinErrorBoundary(this._cfg, () => {
|
|
2781
2751
|
fe(() => {
|
|
2782
|
-
|
|
2752
|
+
Xt(
|
|
2783
2753
|
() => this._render(this._cfg),
|
|
2784
2754
|
this._lastRenderTime,
|
|
2785
2755
|
this._renderCount,
|
|
@@ -2798,32 +2768,32 @@ function Qt(e, t) {
|
|
|
2798
2768
|
});
|
|
2799
2769
|
}
|
|
2800
2770
|
// --- Style ---
|
|
2801
|
-
_applyStyle(r,
|
|
2771
|
+
_applyStyle(r, i) {
|
|
2802
2772
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
2803
|
-
|
|
2773
|
+
Yt(
|
|
2804
2774
|
this.shadowRoot,
|
|
2805
2775
|
this.context,
|
|
2806
|
-
|
|
2776
|
+
i,
|
|
2807
2777
|
this._styleSheet,
|
|
2808
|
-
(
|
|
2809
|
-
this._styleSheet =
|
|
2778
|
+
(n) => {
|
|
2779
|
+
this._styleSheet = n;
|
|
2810
2780
|
}
|
|
2811
2781
|
);
|
|
2812
2782
|
});
|
|
2813
2783
|
}
|
|
2814
2784
|
// --- Error Boundary function ---
|
|
2815
|
-
_runLogicWithinErrorBoundary(r,
|
|
2785
|
+
_runLogicWithinErrorBoundary(r, i) {
|
|
2816
2786
|
this._hasError && (this._hasError = !1);
|
|
2817
2787
|
try {
|
|
2818
|
-
|
|
2819
|
-
} catch (
|
|
2820
|
-
this._hasError = !0, r.onError && r.onError(
|
|
2788
|
+
i();
|
|
2789
|
+
} catch (n) {
|
|
2790
|
+
this._hasError = !0, r.onError && r.onError(n, this.context);
|
|
2821
2791
|
}
|
|
2822
2792
|
}
|
|
2823
2793
|
// --- State, props, computed ---
|
|
2824
2794
|
_initContext(r) {
|
|
2825
2795
|
try {
|
|
2826
|
-
let
|
|
2796
|
+
let i = function(s, o = "") {
|
|
2827
2797
|
return Array.isArray(s) ? new Proxy(s, {
|
|
2828
2798
|
get(a, u, m) {
|
|
2829
2799
|
const g = Reflect.get(a, u, m);
|
|
@@ -2835,47 +2805,47 @@ function Qt(e, t) {
|
|
|
2835
2805
|
"splice",
|
|
2836
2806
|
"sort",
|
|
2837
2807
|
"reverse"
|
|
2838
|
-
].includes(u) ? function(...
|
|
2839
|
-
const l = g.apply(a,
|
|
2840
|
-
if (!
|
|
2808
|
+
].includes(u) ? function(...p) {
|
|
2809
|
+
const l = g.apply(a, p);
|
|
2810
|
+
if (!n._initializing) {
|
|
2841
2811
|
const d = o || "root";
|
|
2842
|
-
|
|
2812
|
+
n._triggerWatchers(d, a), fe(() => n._render(r), n._componentId);
|
|
2843
2813
|
}
|
|
2844
2814
|
return l;
|
|
2845
2815
|
} : g;
|
|
2846
2816
|
},
|
|
2847
2817
|
set(a, u, m) {
|
|
2848
|
-
if (a[u] = m, !
|
|
2818
|
+
if (a[u] = m, !n._initializing) {
|
|
2849
2819
|
const g = o ? `${o}.${String(u)}` : String(u);
|
|
2850
|
-
|
|
2820
|
+
n._triggerWatchers(g, m), fe(() => n._render(r), n._componentId);
|
|
2851
2821
|
}
|
|
2852
2822
|
return !0;
|
|
2853
2823
|
},
|
|
2854
2824
|
deleteProperty(a, u) {
|
|
2855
|
-
if (delete a[u], !
|
|
2825
|
+
if (delete a[u], !n._initializing) {
|
|
2856
2826
|
const m = o ? `${o}.${String(u)}` : String(u);
|
|
2857
|
-
|
|
2827
|
+
n._triggerWatchers(m, void 0), fe(() => n._render(r), n._componentId);
|
|
2858
2828
|
}
|
|
2859
2829
|
return !0;
|
|
2860
2830
|
}
|
|
2861
2831
|
}) : s && typeof s == "object" ? s.constructor && s.constructor.name === "ReactiveState" ? s : (Object.keys(s).forEach((a) => {
|
|
2862
2832
|
const u = o ? `${o}.${a}` : a;
|
|
2863
|
-
s[a] =
|
|
2833
|
+
s[a] = i(s[a], u);
|
|
2864
2834
|
}), new Proxy(s, {
|
|
2865
2835
|
set(a, u, m) {
|
|
2866
2836
|
const g = o ? `${o}.${String(u)}` : String(u);
|
|
2867
|
-
return a[u] =
|
|
2837
|
+
return a[u] = i(m, g), n._initializing || (n._triggerWatchers(
|
|
2868
2838
|
g,
|
|
2869
2839
|
a[u]
|
|
2870
|
-
), fe(() =>
|
|
2840
|
+
), fe(() => n._render(r), n._componentId)), !0;
|
|
2871
2841
|
},
|
|
2872
2842
|
get(a, u, m) {
|
|
2873
2843
|
return Reflect.get(a, u, m);
|
|
2874
2844
|
}
|
|
2875
2845
|
})) : s;
|
|
2876
2846
|
};
|
|
2877
|
-
const
|
|
2878
|
-
return
|
|
2847
|
+
const n = this;
|
|
2848
|
+
return i({
|
|
2879
2849
|
// For functional components, state is managed by state() function calls
|
|
2880
2850
|
// Include prop defaults in initial reactive context so prop updates trigger reactivity
|
|
2881
2851
|
...r.props ? Object.fromEntries(
|
|
@@ -2896,15 +2866,15 @@ function Qt(e, t) {
|
|
|
2896
2866
|
);
|
|
2897
2867
|
});
|
|
2898
2868
|
}
|
|
2899
|
-
_triggerWatchers(r,
|
|
2900
|
-
yt(this.context, this._watchers, r,
|
|
2869
|
+
_triggerWatchers(r, i) {
|
|
2870
|
+
yt(this.context, this._watchers, r, i);
|
|
2901
2871
|
}
|
|
2902
2872
|
_applyProps(r) {
|
|
2903
2873
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
2904
2874
|
try {
|
|
2905
2875
|
wt(this, r, this.context);
|
|
2906
|
-
} catch (
|
|
2907
|
-
this._hasError = !0, r.onError && r.onError(
|
|
2876
|
+
} catch (i) {
|
|
2877
|
+
this._hasError = !0, r.onError && r.onError(i, this.context);
|
|
2908
2878
|
}
|
|
2909
2879
|
});
|
|
2910
2880
|
}
|
|
@@ -2913,7 +2883,7 @@ function Qt(e, t) {
|
|
|
2913
2883
|
function et(e, t) {
|
|
2914
2884
|
let r = re(e);
|
|
2915
2885
|
r.includes("-") || (r = `cer-${r}`);
|
|
2916
|
-
let
|
|
2886
|
+
let i = {};
|
|
2917
2887
|
if (typeof window < "u")
|
|
2918
2888
|
try {
|
|
2919
2889
|
const a = t.toString().match(/\(\s*{\s*([^}]+)\s*}/);
|
|
@@ -2922,38 +2892,38 @@ function et(e, t) {
|
|
|
2922
2892
|
for (const g of m) {
|
|
2923
2893
|
const b = g.indexOf("=");
|
|
2924
2894
|
if (b !== -1) {
|
|
2925
|
-
const
|
|
2895
|
+
const p = g.substring(0, b).trim(), l = g.substring(b + 1).trim();
|
|
2926
2896
|
try {
|
|
2927
|
-
l === "true" ?
|
|
2897
|
+
l === "true" ? i[p] = !0 : l === "false" ? i[p] = !1 : l === "[]" ? i[p] = [] : l === "{}" ? i[p] = {} : /^\d+$/.test(l) ? i[p] = parseInt(l) : /^'.*'$/.test(l) || /^".*"$/.test(l) ? i[p] = l.slice(1, -1) : i[p] = l;
|
|
2928
2898
|
} catch {
|
|
2929
|
-
|
|
2899
|
+
i[p] = "";
|
|
2930
2900
|
}
|
|
2931
2901
|
} else {
|
|
2932
|
-
const
|
|
2933
|
-
|
|
2902
|
+
const p = g.split(":")[0].trim();
|
|
2903
|
+
p && !p.includes("}") && (i[p] = "");
|
|
2934
2904
|
}
|
|
2935
2905
|
}
|
|
2936
2906
|
}
|
|
2937
2907
|
} catch {
|
|
2938
2908
|
}
|
|
2939
|
-
let
|
|
2909
|
+
let n = {};
|
|
2940
2910
|
const s = {
|
|
2941
2911
|
// Generate props config from defaults
|
|
2942
2912
|
props: Object.fromEntries(
|
|
2943
|
-
Object.entries(
|
|
2913
|
+
Object.entries(i).map(([o, a]) => [o, { type: typeof a == "boolean" ? Boolean : typeof a == "number" ? Number : typeof a == "string" ? String : Function, default: a }])
|
|
2944
2914
|
),
|
|
2945
2915
|
// Add lifecycle hooks from the stored functions
|
|
2946
2916
|
onConnected: (o) => {
|
|
2947
|
-
|
|
2917
|
+
n.onConnected && n.onConnected();
|
|
2948
2918
|
},
|
|
2949
2919
|
onDisconnected: (o) => {
|
|
2950
|
-
|
|
2920
|
+
n.onDisconnected && n.onDisconnected();
|
|
2951
2921
|
},
|
|
2952
2922
|
onAttributeChanged: (o, a, u, m) => {
|
|
2953
|
-
|
|
2923
|
+
n.onAttributeChanged && n.onAttributeChanged(o, a, u);
|
|
2954
2924
|
},
|
|
2955
2925
|
onError: (o, a) => {
|
|
2956
|
-
|
|
2926
|
+
n.onError && o && n.onError(o);
|
|
2957
2927
|
},
|
|
2958
2928
|
render: (o) => {
|
|
2959
2929
|
const a = o._componentId || `${r}-${Math.random().toString(36).substr(2, 9)}`;
|
|
@@ -2961,29 +2931,29 @@ function et(e, t) {
|
|
|
2961
2931
|
o.requestRender && o.requestRender();
|
|
2962
2932
|
});
|
|
2963
2933
|
try {
|
|
2964
|
-
|
|
2965
|
-
const u = Object.keys(
|
|
2934
|
+
Qt(o);
|
|
2935
|
+
const u = Object.keys(i).length > 0;
|
|
2966
2936
|
let m;
|
|
2967
2937
|
if (u) {
|
|
2968
2938
|
const g = {};
|
|
2969
|
-
Object.keys(
|
|
2970
|
-
g[b] = o[b] ??
|
|
2939
|
+
Object.keys(i).forEach((b) => {
|
|
2940
|
+
g[b] = o[b] ?? i[b];
|
|
2971
2941
|
}), m = t(g);
|
|
2972
2942
|
} else
|
|
2973
2943
|
m = t();
|
|
2974
2944
|
if (o._hookCallbacks) {
|
|
2975
2945
|
const g = o._hookCallbacks;
|
|
2976
|
-
g.onConnected && (
|
|
2946
|
+
g.onConnected && (n.onConnected = g.onConnected), g.onDisconnected && (n.onDisconnected = g.onDisconnected), g.onAttributeChanged && (n.onAttributeChanged = g.onAttributeChanged), g.onError && (n.onError = g.onError), g.style && (o._styleCallback = g.style);
|
|
2977
2947
|
}
|
|
2978
2948
|
return m;
|
|
2979
2949
|
} finally {
|
|
2980
|
-
|
|
2950
|
+
er(), F.clearCurrentComponent();
|
|
2981
2951
|
}
|
|
2982
2952
|
}
|
|
2983
2953
|
};
|
|
2984
|
-
Te.set(r, s), typeof window < "u" && (customElements.get(r) || customElements.define(r,
|
|
2954
|
+
Te.set(r, s), typeof window < "u" && (customElements.get(r) || customElements.define(r, tr(r, s)));
|
|
2985
2955
|
}
|
|
2986
|
-
class
|
|
2956
|
+
class rr {
|
|
2987
2957
|
map = /* @__PURE__ */ new Map();
|
|
2988
2958
|
maxSize;
|
|
2989
2959
|
constructor(t) {
|
|
@@ -2996,8 +2966,8 @@ class er {
|
|
|
2996
2966
|
}
|
|
2997
2967
|
set(t, r) {
|
|
2998
2968
|
if (this.map.has(t) && this.map.delete(t), this.map.set(t, r), this.map.size > this.maxSize) {
|
|
2999
|
-
const
|
|
3000
|
-
|
|
2969
|
+
const i = this.map.keys().next().value;
|
|
2970
|
+
i !== void 0 && this.map.delete(i);
|
|
3001
2971
|
}
|
|
3002
2972
|
}
|
|
3003
2973
|
has(t) {
|
|
@@ -3007,8 +2977,8 @@ class er {
|
|
|
3007
2977
|
this.map.clear();
|
|
3008
2978
|
}
|
|
3009
2979
|
}
|
|
3010
|
-
const De = new
|
|
3011
|
-
function
|
|
2980
|
+
const De = new rr(500);
|
|
2981
|
+
function nr(e, t) {
|
|
3012
2982
|
if (e == null) {
|
|
3013
2983
|
console.warn(
|
|
3014
2984
|
`⚠️ Event handler for '@${t}' is ${e}. This will prevent the event from working. Use a function reference instead: @${t}="\${functionName}"`
|
|
@@ -3021,117 +2991,117 @@ function tr(e, t) {
|
|
|
3021
2991
|
`💡 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()}"`
|
|
3022
2992
|
);
|
|
3023
2993
|
}
|
|
3024
|
-
function
|
|
3025
|
-
const
|
|
3026
|
-
return { tag: e, key:
|
|
2994
|
+
function he(e, t = {}, r, i) {
|
|
2995
|
+
const n = i ?? t.key;
|
|
2996
|
+
return { tag: e, key: n, props: t, children: r };
|
|
3027
2997
|
}
|
|
3028
2998
|
function Ae(e) {
|
|
3029
2999
|
return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
|
|
3030
3000
|
}
|
|
3031
|
-
function
|
|
3001
|
+
function Ce(e) {
|
|
3032
3002
|
return typeof e == "object" && e !== null && "tag" in e && !Ae(e);
|
|
3033
3003
|
}
|
|
3034
|
-
function
|
|
3004
|
+
function ir(e, t) {
|
|
3035
3005
|
return e.key != null ? e : { ...e, key: t };
|
|
3036
3006
|
}
|
|
3037
|
-
function
|
|
3038
|
-
const
|
|
3007
|
+
function sr(e, t = [], r = {}) {
|
|
3008
|
+
const i = {}, n = {}, s = {}, o = [], a = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
|
|
3039
3009
|
let u;
|
|
3040
3010
|
for (; u = a.exec(e); ) {
|
|
3041
|
-
const m = u[1], g = u[2], b = (u[4] || u[6]) ?? "",
|
|
3042
|
-
let l =
|
|
3043
|
-
|
|
3011
|
+
const m = u[1], g = u[2], b = (u[4] || u[6]) ?? "", p = b.match(/^{{(\d+)}}$/);
|
|
3012
|
+
let l = p ? t[Number(p[1])] ?? null : b;
|
|
3013
|
+
p || (l === "true" ? l = !0 : l === "false" ? l = !1 : l === "null" ? l = null : isNaN(Number(l)) || (l = Number(l)));
|
|
3044
3014
|
const d = ["model", "bind", "show", "class", "style", "ref"];
|
|
3045
3015
|
if (m === ":") {
|
|
3046
|
-
const [x, w] = g.split(":"), [c, ...
|
|
3016
|
+
const [x, w] = g.split(":"), [c, ...h] = x.split(".");
|
|
3047
3017
|
if (d.includes(c)) {
|
|
3048
|
-
const y = [...
|
|
3049
|
-
s[
|
|
3018
|
+
const y = [...h], k = c === "model" && w ? `model:${w}` : c;
|
|
3019
|
+
s[k] = {
|
|
3050
3020
|
value: l,
|
|
3051
3021
|
modifiers: y,
|
|
3052
3022
|
arg: w
|
|
3053
3023
|
};
|
|
3054
3024
|
} else {
|
|
3055
3025
|
let y = l;
|
|
3056
|
-
y && ee(y) && (y = y.value),
|
|
3026
|
+
y && ee(y) && (y = y.value), n[g] = y, o.push(g);
|
|
3057
3027
|
}
|
|
3058
3028
|
} else if (m === "@") {
|
|
3059
3029
|
const [x, ...w] = g.split("."), c = w;
|
|
3060
|
-
|
|
3061
|
-
const
|
|
3062
|
-
if (
|
|
3063
|
-
const y = (
|
|
3064
|
-
if (c.includes("prevent") &&
|
|
3065
|
-
return c.includes("once") &&
|
|
3066
|
-
},
|
|
3067
|
-
|
|
3030
|
+
nr(l, x);
|
|
3031
|
+
const h = typeof l == "function" ? l : typeof r[l] == "function" ? r[l] : void 0;
|
|
3032
|
+
if (h) {
|
|
3033
|
+
const y = ($) => {
|
|
3034
|
+
if (c.includes("prevent") && $.preventDefault(), c.includes("stop") && $.stopPropagation(), !(c.includes("self") && $.target !== $.currentTarget))
|
|
3035
|
+
return c.includes("once") && $.currentTarget?.removeEventListener(x, y), h($);
|
|
3036
|
+
}, k = "on" + x.charAt(0).toUpperCase() + x.slice(1);
|
|
3037
|
+
i[k] = y;
|
|
3068
3038
|
}
|
|
3069
|
-
} else g === "ref" ?
|
|
3039
|
+
} else g === "ref" ? i.ref = l : n[g] = l;
|
|
3070
3040
|
}
|
|
3071
|
-
return { props:
|
|
3041
|
+
return { props: i, attrs: n, directives: s, bound: o };
|
|
3072
3042
|
}
|
|
3073
|
-
function
|
|
3074
|
-
const
|
|
3043
|
+
function or(e, t, r) {
|
|
3044
|
+
const i = ge.length > 0 ? ge[ge.length - 1] : void 0, n = r ?? i, s = !r && t.length === 0, o = s ? e.join("<!--TEMPLATE_DELIM-->") : null;
|
|
3075
3045
|
if (s && o) {
|
|
3076
3046
|
const f = De.get(o);
|
|
3077
3047
|
if (f) return f;
|
|
3078
3048
|
}
|
|
3079
3049
|
function a(f, v) {
|
|
3080
|
-
return
|
|
3050
|
+
return he("#text", {}, f, v);
|
|
3081
3051
|
}
|
|
3082
3052
|
let u = "";
|
|
3083
3053
|
for (let f = 0; f < e.length; f++)
|
|
3084
3054
|
u += e[f], f < t.length && (u += `{{${f}}}`);
|
|
3085
3055
|
const m = /<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, g = [];
|
|
3086
|
-
let b,
|
|
3087
|
-
function
|
|
3056
|
+
let b, p = [], l = null, d = {}, x, w = 0, c = [];
|
|
3057
|
+
function h(f) {
|
|
3088
3058
|
!f || typeof f != "object" || Ae(f) || (f.props || f.attrs ? (f.props && (d.props || (d.props = {}), Object.assign(d.props, f.props)), f.attrs && (d.attrs || (d.attrs = {}), Object.keys(f.attrs).forEach((v) => {
|
|
3089
3059
|
if (v === "style" && d.attrs.style) {
|
|
3090
3060
|
const A = d.attrs.style.replace(
|
|
3091
3061
|
/;?\s*$/,
|
|
3092
3062
|
""
|
|
3093
|
-
),
|
|
3094
|
-
d.attrs.style = A + "; " +
|
|
3063
|
+
), C = f.attrs.style.replace(/^;?\s*/, "");
|
|
3064
|
+
d.attrs.style = A + "; " + C;
|
|
3095
3065
|
} else if (v === "class" && d.attrs.class) {
|
|
3096
|
-
const A = d.attrs.class.trim().split(/\s+/).filter(Boolean),
|
|
3097
|
-
.../* @__PURE__ */ new Set([...A, ...
|
|
3066
|
+
const A = d.attrs.class.trim().split(/\s+/).filter(Boolean), C = f.attrs.class.trim().split(/\s+/).filter(Boolean), E = [
|
|
3067
|
+
.../* @__PURE__ */ new Set([...A, ...C])
|
|
3098
3068
|
];
|
|
3099
|
-
d.attrs.class =
|
|
3069
|
+
d.attrs.class = E.join(" ");
|
|
3100
3070
|
} else
|
|
3101
3071
|
d.attrs[v] = f.attrs[v];
|
|
3102
3072
|
}))) : (d.props || (d.props = {}), Object.assign(d.props, f)));
|
|
3103
3073
|
}
|
|
3104
3074
|
function y(f, v) {
|
|
3105
|
-
const A = l ?
|
|
3075
|
+
const A = l ? p : c;
|
|
3106
3076
|
if (Ae(f)) {
|
|
3107
|
-
const
|
|
3108
|
-
let
|
|
3077
|
+
const C = f.key ?? v;
|
|
3078
|
+
let E = f.children;
|
|
3109
3079
|
A.push({
|
|
3110
3080
|
...f,
|
|
3111
|
-
key:
|
|
3112
|
-
children:
|
|
3081
|
+
key: C,
|
|
3082
|
+
children: E
|
|
3113
3083
|
});
|
|
3114
3084
|
return;
|
|
3115
3085
|
}
|
|
3116
|
-
if (
|
|
3117
|
-
A.push(
|
|
3086
|
+
if (Ce(f)) {
|
|
3087
|
+
A.push(ir(f, void 0));
|
|
3118
3088
|
return;
|
|
3119
3089
|
}
|
|
3120
3090
|
if (Array.isArray(f)) {
|
|
3121
3091
|
if (f.length === 0) return;
|
|
3122
|
-
for (let
|
|
3123
|
-
const
|
|
3124
|
-
Ae(
|
|
3092
|
+
for (let C = 0; C < f.length; C++) {
|
|
3093
|
+
const E = f[C];
|
|
3094
|
+
Ae(E) || Ce(E) || Array.isArray(E) ? y(E, `${v}-${C}`) : E !== null && typeof E == "object" ? h(E) : A.push(a(String(E), `${v}-${C}`));
|
|
3125
3095
|
}
|
|
3126
3096
|
return;
|
|
3127
3097
|
}
|
|
3128
3098
|
if (f !== null && typeof f == "object") {
|
|
3129
|
-
|
|
3099
|
+
h(f);
|
|
3130
3100
|
return;
|
|
3131
3101
|
}
|
|
3132
3102
|
A.push(a(String(f), v));
|
|
3133
3103
|
}
|
|
3134
|
-
const
|
|
3104
|
+
const k = /* @__PURE__ */ new Set([
|
|
3135
3105
|
"area",
|
|
3136
3106
|
"base",
|
|
3137
3107
|
"br",
|
|
@@ -3150,14 +3120,14 @@ function ir(e, t, r) {
|
|
|
3150
3120
|
for (; b = m.exec(u); )
|
|
3151
3121
|
if (!(b[0].startsWith("<!--") && b[0].endsWith("-->"))) {
|
|
3152
3122
|
if (b[1]) {
|
|
3153
|
-
const f = b[1], v = b[0][1] === "/", A = b[0][b[0].length - 2] === "/" ||
|
|
3154
|
-
props:
|
|
3155
|
-
attrs:
|
|
3123
|
+
const f = b[1], v = b[0][1] === "/", A = b[0][b[0].length - 2] === "/" || k.has(f), {
|
|
3124
|
+
props: C,
|
|
3125
|
+
attrs: E,
|
|
3156
3126
|
directives: T,
|
|
3157
3127
|
bound: R
|
|
3158
|
-
} =
|
|
3159
|
-
for (const P in
|
|
3160
|
-
for (const P in
|
|
3128
|
+
} = sr(b[2] || "", t, n), S = { props: {}, attrs: {} };
|
|
3129
|
+
for (const P in C) S.props[P] = C[P];
|
|
3130
|
+
for (const P in E) S.attrs[P] = E[P];
|
|
3161
3131
|
if (S.attrs && Object.prototype.hasOwnProperty.call(S.attrs, "key") && !(S.props && Object.prototype.hasOwnProperty.call(S.props, "key")))
|
|
3162
3132
|
try {
|
|
3163
3133
|
S.props.key = S.attrs.key;
|
|
@@ -3181,7 +3151,7 @@ function ir(e, t, r) {
|
|
|
3181
3151
|
L && ee(L) && (L = L.value), S.props[K] = L, delete S.attrs[K];
|
|
3182
3152
|
}
|
|
3183
3153
|
}
|
|
3184
|
-
if ((f.includes("-") || !!
|
|
3154
|
+
if ((f.includes("-") || !!n?.__customElements?.has?.(f)) && (S.isCustomElement = !0, R && S.attrs)) {
|
|
3185
3155
|
const K = /* @__PURE__ */ new Set(["id", "name", "data-key", "key"]);
|
|
3186
3156
|
for (const L of R)
|
|
3187
3157
|
if (L in S.attrs && !(S.props && L in S.props)) {
|
|
@@ -3194,90 +3164,90 @@ function ir(e, t, r) {
|
|
|
3194
3164
|
}
|
|
3195
3165
|
if (T && Object.keys(T).some((P) => P === "model" || P.startsWith("model:")))
|
|
3196
3166
|
try {
|
|
3197
|
-
const P = Symbol.for("cer.registry"), B = globalThis[P], V = !!(B && typeof B.has == "function" && B.has(f)), we = !!(
|
|
3167
|
+
const P = Symbol.for("cer.registry"), B = globalThis[P], V = !!(B && typeof B.has == "function" && B.has(f)), we = !!(n && (n.__customElements instanceof Set && n.__customElements.has(f) || Array.isArray(n.__isCustomElements) && n.__isCustomElements.includes(f)));
|
|
3198
3168
|
if (!!(f.includes("-") || we || V))
|
|
3199
3169
|
for (const M of Object.keys(T)) {
|
|
3200
3170
|
if (M !== "model" && !M.startsWith("model:")) continue;
|
|
3201
|
-
const J = T[M], Z = J.arg ?? (M.includes(":") ? M.split(":", 2)[1] : void 0), z = J.value,
|
|
3171
|
+
const J = T[M], Z = J.arg ?? (M.includes(":") ? M.split(":", 2)[1] : void 0), z = J.value, _ = Z ?? "modelValue", U = H, D = _e, N = n ? n._state || n : void 0;
|
|
3202
3172
|
let O;
|
|
3203
|
-
typeof z == "string" &&
|
|
3173
|
+
typeof z == "string" && n ? O = U(N, z) : (O = z, O && ee(O) && (O = O.value)), S.props[_] = O;
|
|
3204
3174
|
try {
|
|
3205
|
-
const ne = re(
|
|
3175
|
+
const ne = re(_);
|
|
3206
3176
|
S.attrs || (S.attrs = {}), O !== void 0 && (S.attrs[ne] = O);
|
|
3207
3177
|
} catch {
|
|
3208
3178
|
}
|
|
3209
3179
|
S.isCustomElement = !0;
|
|
3210
|
-
const qe = `update:${re(
|
|
3180
|
+
const qe = `update:${re(_)}`.replace(/-([a-z])/g, (ne, Y) => Y.toUpperCase()), ut = "on" + qe.charAt(0).toUpperCase() + qe.slice(1);
|
|
3211
3181
|
S.props[ut] = function(ne) {
|
|
3212
3182
|
const Y = ne.detail !== void 0 ? ne.detail : ne.target ? ne.target.value : void 0;
|
|
3213
|
-
if (
|
|
3183
|
+
if (N)
|
|
3214
3184
|
if (z && ee(z)) {
|
|
3215
3185
|
const ae = z.value;
|
|
3216
|
-
(Array.isArray(Y) && Array.isArray(ae) ? JSON.stringify([...Y].sort()) !== JSON.stringify([...ae].sort()) : Y !== ae) && (z.value = Y,
|
|
3186
|
+
(Array.isArray(Y) && Array.isArray(ae) ? JSON.stringify([...Y].sort()) !== JSON.stringify([...ae].sort()) : Y !== ae) && (z.value = Y, n?.requestRender ? n.requestRender() : n?._requestRender && n._requestRender());
|
|
3217
3187
|
} else {
|
|
3218
|
-
const ae = U(
|
|
3219
|
-
(Array.isArray(Y) && Array.isArray(ae) ? JSON.stringify([...Y].sort()) !== JSON.stringify([...ae].sort()) : Y !== ae) && (D(
|
|
3188
|
+
const ae = U(N, typeof z == "string" ? z : String(z));
|
|
3189
|
+
(Array.isArray(Y) && Array.isArray(ae) ? JSON.stringify([...Y].sort()) !== JSON.stringify([...ae].sort()) : Y !== ae) && (D(N, typeof z == "string" ? z : String(z), Y), n?.requestRender ? n.requestRender() : n?._requestRender && n._requestRender());
|
|
3220
3190
|
}
|
|
3221
3191
|
}, delete T[M];
|
|
3222
3192
|
}
|
|
3223
3193
|
} catch {
|
|
3224
3194
|
}
|
|
3225
3195
|
if (Object.keys(T).length > 0 && (S.directives = { ...T }), v) {
|
|
3226
|
-
const P =
|
|
3196
|
+
const P = he(
|
|
3227
3197
|
l,
|
|
3228
3198
|
d,
|
|
3229
|
-
|
|
3199
|
+
p.length === 1 && Ce(p[0]) && p[0].tag === "#text" ? typeof p[0].children == "string" ? p[0].children : "" : p.length ? p : void 0,
|
|
3230
3200
|
x
|
|
3231
3201
|
), B = g.pop();
|
|
3232
|
-
B ? (l = B.tag, d = B.props, x = B.key,
|
|
3233
|
-
} else A ? l ?
|
|
3202
|
+
B ? (l = B.tag, d = B.props, x = B.key, p = B.children, p.push(P)) : (c.push(P), l = null, d = {}, x = void 0, p = []);
|
|
3203
|
+
} else A ? l ? p.push(he(f, S, void 0, void 0)) : c.push(he(f, S, void 0, void 0)) : (l && g.push({
|
|
3234
3204
|
tag: l,
|
|
3235
3205
|
props: d,
|
|
3236
|
-
children:
|
|
3206
|
+
children: p,
|
|
3237
3207
|
key: x
|
|
3238
|
-
}), l = f, d = S,
|
|
3208
|
+
}), l = f, d = S, p = []);
|
|
3239
3209
|
} else if (typeof b[3] < "u") {
|
|
3240
3210
|
const f = Number(b[3]), v = t[f], A = `interp-${f}`;
|
|
3241
3211
|
y(v, A);
|
|
3242
3212
|
} else if (b[4]) {
|
|
3243
|
-
const f = b[4], v = l ?
|
|
3244
|
-
for (const
|
|
3245
|
-
if (!
|
|
3246
|
-
const
|
|
3247
|
-
if (
|
|
3248
|
-
const T = Number(
|
|
3213
|
+
const f = b[4], v = l ? p : c, A = f.split(/({{\d+}})/);
|
|
3214
|
+
for (const C of A) {
|
|
3215
|
+
if (!C) continue;
|
|
3216
|
+
const E = C.match(/^{{(\d+)}}$/);
|
|
3217
|
+
if (E) {
|
|
3218
|
+
const T = Number(E[1]), R = t[T], S = `interp-${T}`;
|
|
3249
3219
|
y(R, S);
|
|
3250
3220
|
} else {
|
|
3251
3221
|
const T = `text-${w++}`;
|
|
3252
|
-
v.push(a(
|
|
3222
|
+
v.push(a(C, T));
|
|
3253
3223
|
}
|
|
3254
3224
|
}
|
|
3255
3225
|
}
|
|
3256
3226
|
}
|
|
3257
|
-
const
|
|
3258
|
-
if (
|
|
3259
|
-
const f =
|
|
3227
|
+
const $ = c.filter((f) => Ce(f) && f.tag === "#text" ? typeof f.children == "string" && f.children.trim() !== "" : !0);
|
|
3228
|
+
if ($.length === 1) {
|
|
3229
|
+
const f = $[0];
|
|
3260
3230
|
return s && o && De.set(o, f), f;
|
|
3261
|
-
} else if (
|
|
3262
|
-
const f =
|
|
3231
|
+
} else if ($.length > 1) {
|
|
3232
|
+
const f = $;
|
|
3263
3233
|
return s && o && De.set(o, f), f;
|
|
3264
3234
|
}
|
|
3265
|
-
return
|
|
3235
|
+
return he("div", {}, "", "fallback-root");
|
|
3266
3236
|
}
|
|
3267
3237
|
function ce(e, ...t) {
|
|
3268
|
-
const r = t[t.length - 1],
|
|
3269
|
-
return
|
|
3238
|
+
const r = t[t.length - 1], i = typeof r == "object" && r && !Array.isArray(r) ? r : void 0;
|
|
3239
|
+
return or(e, t, i);
|
|
3270
3240
|
}
|
|
3271
3241
|
function Re(e, t) {
|
|
3272
3242
|
return j(e ? t : [], "when-block");
|
|
3273
3243
|
}
|
|
3274
|
-
function
|
|
3275
|
-
return e.map((r,
|
|
3276
|
-
const
|
|
3277
|
-
return j(t(r,
|
|
3244
|
+
function vr(e, t) {
|
|
3245
|
+
return e.map((r, i) => {
|
|
3246
|
+
const n = typeof r == "object" ? r?.key ?? r?.id ?? `idx-${i}` : String(r);
|
|
3247
|
+
return j(t(r, i), `each-${n}`);
|
|
3278
3248
|
});
|
|
3279
3249
|
}
|
|
3280
|
-
function
|
|
3250
|
+
function ar() {
|
|
3281
3251
|
const e = [];
|
|
3282
3252
|
return {
|
|
3283
3253
|
when(t, r) {
|
|
@@ -3287,14 +3257,14 @@ function sr() {
|
|
|
3287
3257
|
return e.push([!0, t]), this;
|
|
3288
3258
|
},
|
|
3289
3259
|
done() {
|
|
3290
|
-
return
|
|
3260
|
+
return cr(...e);
|
|
3291
3261
|
}
|
|
3292
3262
|
};
|
|
3293
3263
|
}
|
|
3294
|
-
function
|
|
3264
|
+
function cr(...e) {
|
|
3295
3265
|
for (let t = 0; t < e.length; t++) {
|
|
3296
|
-
const [r,
|
|
3297
|
-
if (r) return [j(
|
|
3266
|
+
const [r, i] = e[t];
|
|
3267
|
+
if (r) return [j(i, `whenChain-branch-${t}`)];
|
|
3298
3268
|
}
|
|
3299
3269
|
return [j([], "whenChain-empty")];
|
|
3300
3270
|
}
|
|
@@ -3306,48 +3276,48 @@ function j(e, t) {
|
|
|
3306
3276
|
children: r
|
|
3307
3277
|
};
|
|
3308
3278
|
}
|
|
3309
|
-
function
|
|
3279
|
+
function $r(e, t) {
|
|
3310
3280
|
return Re(!e, t);
|
|
3311
3281
|
}
|
|
3312
|
-
function
|
|
3282
|
+
function kr(e, t) {
|
|
3313
3283
|
const r = !e || e.length === 0;
|
|
3314
3284
|
return Re(r, t);
|
|
3315
3285
|
}
|
|
3316
|
-
function
|
|
3286
|
+
function Cr(e, t) {
|
|
3317
3287
|
const r = !!(e && e.length > 0);
|
|
3318
3288
|
return Re(r, t);
|
|
3319
3289
|
}
|
|
3320
|
-
function
|
|
3321
|
-
const
|
|
3322
|
-
return e.forEach((
|
|
3323
|
-
t(
|
|
3324
|
-
}),
|
|
3325
|
-
const a = typeof
|
|
3326
|
-
return j(r(
|
|
3290
|
+
function _r(e, t, r) {
|
|
3291
|
+
const i = [];
|
|
3292
|
+
return e.forEach((n, s) => {
|
|
3293
|
+
t(n, s) && i.push({ item: n, originalIndex: s });
|
|
3294
|
+
}), i.map(({ item: n, originalIndex: s }, o) => {
|
|
3295
|
+
const a = typeof n == "object" && n != null ? n?.key ?? n?.id ?? `filtered-${s}` : `filtered-${s}`;
|
|
3296
|
+
return j(r(n, s, o), `each-where-${a}`);
|
|
3327
3297
|
});
|
|
3328
3298
|
}
|
|
3329
|
-
function
|
|
3299
|
+
function Er(e, t) {
|
|
3330
3300
|
const r = e?.length ?? 0;
|
|
3331
3301
|
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");
|
|
3332
3302
|
}
|
|
3333
|
-
function
|
|
3334
|
-
const
|
|
3335
|
-
return e.forEach((
|
|
3336
|
-
const s = t(
|
|
3337
|
-
|
|
3338
|
-
}), Array.from(
|
|
3339
|
-
r(
|
|
3340
|
-
`each-group-${
|
|
3303
|
+
function Sr(e, t, r) {
|
|
3304
|
+
const i = /* @__PURE__ */ new Map();
|
|
3305
|
+
return e.forEach((n) => {
|
|
3306
|
+
const s = t(n);
|
|
3307
|
+
i.has(s) || i.set(s, []), i.get(s).push(n);
|
|
3308
|
+
}), Array.from(i.entries()).map(([n, s], o) => j(
|
|
3309
|
+
r(n, s, o),
|
|
3310
|
+
`each-group-${n}`
|
|
3341
3311
|
));
|
|
3342
3312
|
}
|
|
3343
|
-
function
|
|
3344
|
-
const
|
|
3345
|
-
return e.slice(
|
|
3346
|
-
const m =
|
|
3347
|
-
return j(
|
|
3313
|
+
function Ar(e, t, r, i) {
|
|
3314
|
+
const n = r * t, s = Math.min(n + t, e.length);
|
|
3315
|
+
return e.slice(n, s).map((a, u) => {
|
|
3316
|
+
const m = n + u, g = typeof a == "object" && a != null ? a?.key ?? a?.id ?? `page-${m}` : `page-${m}`;
|
|
3317
|
+
return j(i(a, m, u), `each-page-${g}`);
|
|
3348
3318
|
});
|
|
3349
3319
|
}
|
|
3350
|
-
function
|
|
3320
|
+
function Tr(e, t) {
|
|
3351
3321
|
return e.loading && t.loading ? j(t.loading, "promise-loading") : e.error && t.error ? j(t.error(e.error), "promise-error") : e.data !== void 0 && t.success ? j(t.success(e.data), "promise-success") : t.idle ? j(t.idle, "promise-idle") : j([], "promise-fallback");
|
|
3352
3322
|
}
|
|
3353
3323
|
function q(e, t) {
|
|
@@ -3363,7 +3333,7 @@ const te = {
|
|
|
3363
3333
|
"2xl": "(min-width:1536px)",
|
|
3364
3334
|
// Dark mode (matching style.ts)
|
|
3365
3335
|
dark: "(prefers-color-scheme: dark)"
|
|
3366
|
-
}, lt = ["sm", "md", "lg", "xl", "2xl"],
|
|
3336
|
+
}, lt = ["sm", "md", "lg", "xl", "2xl"], lr = {
|
|
3367
3337
|
// Breakpoint-based rendering (matching style.ts exactly)
|
|
3368
3338
|
sm: (e) => q(te.sm, e),
|
|
3369
3339
|
md: (e) => q(te.md, e),
|
|
@@ -3382,42 +3352,42 @@ const te = {
|
|
|
3382
3352
|
portrait: (e) => q("(orientation: portrait)", e),
|
|
3383
3353
|
landscape: (e) => q("(orientation: landscape)", e)
|
|
3384
3354
|
};
|
|
3385
|
-
function
|
|
3355
|
+
function Rr(e, t) {
|
|
3386
3356
|
const r = [];
|
|
3387
3357
|
e.includes("dark") ? r.push(te.dark) : e.includes("light") && r.push("(prefers-color-scheme: light)");
|
|
3388
|
-
const
|
|
3358
|
+
const i = e.filter(
|
|
3389
3359
|
(o) => lt.includes(o)
|
|
3390
|
-
),
|
|
3391
|
-
|
|
3360
|
+
), n = i[i.length - 1];
|
|
3361
|
+
n && n in te && r.push(te[n]);
|
|
3392
3362
|
const s = r.length > 0 ? r.join(" and ") : "all";
|
|
3393
3363
|
return q(s, t);
|
|
3394
3364
|
}
|
|
3395
|
-
function
|
|
3365
|
+
function Or(e) {
|
|
3396
3366
|
const t = [];
|
|
3397
3367
|
return e.base && t.push(j(e.base, "responsive-base")), lt.forEach((r) => {
|
|
3398
|
-
const
|
|
3399
|
-
|
|
3368
|
+
const i = e[r];
|
|
3369
|
+
i && t.push(lr[r](i));
|
|
3400
3370
|
}), t;
|
|
3401
3371
|
}
|
|
3402
|
-
function
|
|
3372
|
+
function Pr(e) {
|
|
3403
3373
|
const t = [];
|
|
3404
3374
|
let r = null;
|
|
3405
3375
|
return {
|
|
3406
|
-
case(
|
|
3407
|
-
const s = typeof
|
|
3408
|
-
return t.push({ condition: s, content:
|
|
3376
|
+
case(i, n) {
|
|
3377
|
+
const s = typeof i == "function" ? i : (o) => o === i;
|
|
3378
|
+
return t.push({ condition: s, content: n }), this;
|
|
3409
3379
|
},
|
|
3410
|
-
when(
|
|
3411
|
-
return t.push({ condition:
|
|
3380
|
+
when(i, n) {
|
|
3381
|
+
return t.push({ condition: i, content: n }), this;
|
|
3412
3382
|
},
|
|
3413
|
-
otherwise(
|
|
3414
|
-
return r =
|
|
3383
|
+
otherwise(i) {
|
|
3384
|
+
return r = i, this;
|
|
3415
3385
|
},
|
|
3416
3386
|
done() {
|
|
3417
|
-
for (let
|
|
3418
|
-
const { condition:
|
|
3419
|
-
if (
|
|
3420
|
-
return j(s, `switch-case-${
|
|
3387
|
+
for (let i = 0; i < t.length; i++) {
|
|
3388
|
+
const { condition: n, content: s } = t[i];
|
|
3389
|
+
if (n(e))
|
|
3390
|
+
return j(s, `switch-case-${i}`);
|
|
3421
3391
|
}
|
|
3422
3392
|
return j(r || [], "switch-otherwise");
|
|
3423
3393
|
}
|
|
@@ -3439,10 +3409,10 @@ class de extends EventTarget {
|
|
|
3439
3409
|
* @param data - Optional event payload
|
|
3440
3410
|
*/
|
|
3441
3411
|
emit(t, r) {
|
|
3442
|
-
const
|
|
3443
|
-
if (!
|
|
3444
|
-
this.eventCounters.set(t, { count: 1, window:
|
|
3445
|
-
else if (
|
|
3412
|
+
const i = Date.now(), n = this.eventCounters.get(t);
|
|
3413
|
+
if (!n || i - n.window > 1e3)
|
|
3414
|
+
this.eventCounters.set(t, { count: 1, window: i });
|
|
3415
|
+
else if (n.count++, n.count > 50 && n.count > 100)
|
|
3446
3416
|
return;
|
|
3447
3417
|
this.dispatchEvent(new CustomEvent(t, {
|
|
3448
3418
|
detail: r,
|
|
@@ -3473,8 +3443,8 @@ class de extends EventTarget {
|
|
|
3473
3443
|
* @param handler - Handler function to remove
|
|
3474
3444
|
*/
|
|
3475
3445
|
off(t, r) {
|
|
3476
|
-
const
|
|
3477
|
-
|
|
3446
|
+
const i = this.handlers[t];
|
|
3447
|
+
i && i.delete(r);
|
|
3478
3448
|
}
|
|
3479
3449
|
/**
|
|
3480
3450
|
* Remove all handlers for a specific event.
|
|
@@ -3489,8 +3459,8 @@ class de extends EventTarget {
|
|
|
3489
3459
|
* @param handler - CustomEvent handler
|
|
3490
3460
|
* @param options - AddEventListener options
|
|
3491
3461
|
*/
|
|
3492
|
-
listen(t, r,
|
|
3493
|
-
return this.addEventListener(t, r,
|
|
3462
|
+
listen(t, r, i) {
|
|
3463
|
+
return this.addEventListener(t, r, i), () => this.removeEventListener(t, r);
|
|
3494
3464
|
}
|
|
3495
3465
|
/**
|
|
3496
3466
|
* Register a one-time event handler. Returns a promise that resolves with the event data.
|
|
@@ -3498,9 +3468,9 @@ class de extends EventTarget {
|
|
|
3498
3468
|
* @param handler - Handler function
|
|
3499
3469
|
*/
|
|
3500
3470
|
once(t, r) {
|
|
3501
|
-
return new Promise((
|
|
3502
|
-
const
|
|
3503
|
-
|
|
3471
|
+
return new Promise((i) => {
|
|
3472
|
+
const n = this.on(t, (s) => {
|
|
3473
|
+
n(), r(s), i(s);
|
|
3504
3474
|
});
|
|
3505
3475
|
});
|
|
3506
3476
|
}
|
|
@@ -3530,9 +3500,9 @@ class de extends EventTarget {
|
|
|
3530
3500
|
*/
|
|
3531
3501
|
getEventStats() {
|
|
3532
3502
|
const t = {};
|
|
3533
|
-
for (const [r,
|
|
3503
|
+
for (const [r, i] of this.eventCounters.entries())
|
|
3534
3504
|
t[r] = {
|
|
3535
|
-
count:
|
|
3505
|
+
count: i.count,
|
|
3536
3506
|
handlersCount: this.getHandlerCount(r)
|
|
3537
3507
|
};
|
|
3538
3508
|
return t;
|
|
@@ -3544,14 +3514,14 @@ class de extends EventTarget {
|
|
|
3544
3514
|
this.eventCounters.clear();
|
|
3545
3515
|
}
|
|
3546
3516
|
}
|
|
3547
|
-
const be = de.getInstance(),
|
|
3517
|
+
const be = de.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);
|
|
3548
3518
|
function tt(e) {
|
|
3549
3519
|
let t = { ...e };
|
|
3550
3520
|
const r = [];
|
|
3551
|
-
function
|
|
3521
|
+
function i(a) {
|
|
3552
3522
|
r.push(a), a(t);
|
|
3553
3523
|
}
|
|
3554
|
-
function
|
|
3524
|
+
function n() {
|
|
3555
3525
|
return t;
|
|
3556
3526
|
}
|
|
3557
3527
|
function s(a) {
|
|
@@ -3561,21 +3531,21 @@ function tt(e) {
|
|
|
3561
3531
|
function o() {
|
|
3562
3532
|
r.forEach((a) => a(t));
|
|
3563
3533
|
}
|
|
3564
|
-
return { subscribe:
|
|
3534
|
+
return { subscribe: i, getState: n, setState: s };
|
|
3565
3535
|
}
|
|
3566
3536
|
const rt = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, Q = (e, t) => {
|
|
3567
3537
|
for (const r of e) {
|
|
3568
|
-
const
|
|
3538
|
+
const i = [], n = r.path.replace(/:[^/]+/g, (a) => (i.push(a.slice(1)), "([^/]+)")), s = new RegExp(`^${n}$`), o = t.match(s);
|
|
3569
3539
|
if (o) {
|
|
3570
3540
|
const a = {};
|
|
3571
|
-
return
|
|
3541
|
+
return i.forEach((u, m) => {
|
|
3572
3542
|
a[u] = o[m + 1];
|
|
3573
3543
|
}), { route: r, params: a };
|
|
3574
3544
|
}
|
|
3575
3545
|
}
|
|
3576
3546
|
return { route: null, params: {} };
|
|
3577
3547
|
}, Ie = {};
|
|
3578
|
-
async function
|
|
3548
|
+
async function ur(e) {
|
|
3579
3549
|
if (e.component) return e.component;
|
|
3580
3550
|
if (e.load) {
|
|
3581
3551
|
if (Ie[e.path]) return Ie[e.path];
|
|
@@ -3588,98 +3558,98 @@ async function cr(e) {
|
|
|
3588
3558
|
}
|
|
3589
3559
|
throw new Error(`No component or loader defined for route: ${e.path}`);
|
|
3590
3560
|
}
|
|
3591
|
-
function
|
|
3592
|
-
const { routes: t, base: r = "", initialUrl:
|
|
3593
|
-
let
|
|
3561
|
+
function fr(e) {
|
|
3562
|
+
const { routes: t, base: r = "", initialUrl: i } = e;
|
|
3563
|
+
let n, s, o, a, u, m, g;
|
|
3594
3564
|
const b = async (x, w) => {
|
|
3595
|
-
const c = t.find((
|
|
3565
|
+
const c = t.find((h) => Q([h], x.path).route !== null);
|
|
3596
3566
|
if (c?.beforeEnter)
|
|
3597
3567
|
try {
|
|
3598
|
-
const
|
|
3599
|
-
return typeof
|
|
3600
|
-
} catch (
|
|
3601
|
-
return se("beforeEnter error",
|
|
3568
|
+
const h = await c.beforeEnter(x, w);
|
|
3569
|
+
return typeof h == "string" ? (await d(h, !0), !1) : h !== !1;
|
|
3570
|
+
} catch (h) {
|
|
3571
|
+
return se("beforeEnter error", h), !1;
|
|
3602
3572
|
}
|
|
3603
3573
|
return !0;
|
|
3604
|
-
},
|
|
3605
|
-
const c = t.find((
|
|
3574
|
+
}, p = async (x, w) => {
|
|
3575
|
+
const c = t.find((h) => Q([h], x.path).route !== null);
|
|
3606
3576
|
if (c?.onEnter)
|
|
3607
3577
|
try {
|
|
3608
|
-
const
|
|
3609
|
-
return typeof
|
|
3610
|
-
} catch (
|
|
3611
|
-
return se("onEnter error",
|
|
3578
|
+
const h = await c.onEnter(x, w);
|
|
3579
|
+
return typeof h == "string" ? (await d(h, !0), !1) : h !== !1;
|
|
3580
|
+
} catch (h) {
|
|
3581
|
+
return se("onEnter error", h), !1;
|
|
3612
3582
|
}
|
|
3613
3583
|
return !0;
|
|
3614
3584
|
}, l = (x, w) => {
|
|
3615
|
-
const c = t.find((
|
|
3585
|
+
const c = t.find((h) => Q([h], x.path).route !== null);
|
|
3616
3586
|
if (c?.afterEnter)
|
|
3617
3587
|
try {
|
|
3618
3588
|
c.afterEnter(x, w);
|
|
3619
|
-
} catch (
|
|
3620
|
-
se("afterEnter error",
|
|
3589
|
+
} catch (h) {
|
|
3590
|
+
se("afterEnter error", h);
|
|
3621
3591
|
}
|
|
3622
3592
|
}, d = async (x, w = !1) => {
|
|
3623
3593
|
try {
|
|
3624
3594
|
const c = {
|
|
3625
3595
|
path: x.replace(r, "") || "/",
|
|
3626
3596
|
query: {}
|
|
3627
|
-
},
|
|
3628
|
-
if (!
|
|
3629
|
-
const y = o.getState(),
|
|
3597
|
+
}, h = Q(t, c.path);
|
|
3598
|
+
if (!h) throw new Error(`No route found for ${c.path}`);
|
|
3599
|
+
const y = o.getState(), k = {
|
|
3630
3600
|
path: c.path,
|
|
3631
|
-
params:
|
|
3601
|
+
params: h.params,
|
|
3632
3602
|
query: c.query
|
|
3633
3603
|
};
|
|
3634
|
-
if (!await b(
|
|
3635
|
-
typeof window < "u" && typeof document < "u" && (w ? window.history.replaceState({}, "", r + x) : window.history.pushState({}, "", r + x)), o.setState(
|
|
3604
|
+
if (!await b(k, y) || !await p(k, y)) return;
|
|
3605
|
+
typeof window < "u" && typeof document < "u" && (w ? window.history.replaceState({}, "", r + x) : window.history.pushState({}, "", r + x)), o.setState(k), l(k, y);
|
|
3636
3606
|
} catch (c) {
|
|
3637
3607
|
se("Navigation error:", c);
|
|
3638
3608
|
}
|
|
3639
3609
|
};
|
|
3640
|
-
if (typeof window < "u" && typeof document < "u" && typeof
|
|
3641
|
-
|
|
3642
|
-
const w = new URL(window.location.href), c = w.pathname.replace(r, "") || "/",
|
|
3643
|
-
return { path: c, query:
|
|
3644
|
-
}, s =
|
|
3610
|
+
if (typeof window < "u" && typeof document < "u" && typeof i > "u") {
|
|
3611
|
+
n = () => {
|
|
3612
|
+
const w = new URL(window.location.href), c = w.pathname.replace(r, "") || "/", h = rt(w.search);
|
|
3613
|
+
return { path: c, query: h };
|
|
3614
|
+
}, s = n();
|
|
3645
3615
|
const x = Q(t, s.path);
|
|
3646
3616
|
o = tt({
|
|
3647
3617
|
path: s.path,
|
|
3648
3618
|
params: x.params,
|
|
3649
3619
|
query: s.query
|
|
3650
3620
|
}), a = async (w = !1) => {
|
|
3651
|
-
const c =
|
|
3621
|
+
const c = n();
|
|
3652
3622
|
await d(c.path, w);
|
|
3653
3623
|
}, window.addEventListener("popstate", () => a(!0)), u = (w) => d(w, !1), m = (w) => d(w, !0), g = () => window.history.back();
|
|
3654
3624
|
} else {
|
|
3655
|
-
|
|
3656
|
-
const c = new URL(
|
|
3657
|
-
return { path:
|
|
3658
|
-
}, s =
|
|
3625
|
+
n = () => {
|
|
3626
|
+
const c = new URL(i || "/", "http://localhost"), h = c.pathname.replace(r, "") || "/", y = rt(c.search);
|
|
3627
|
+
return { path: h, query: y };
|
|
3628
|
+
}, s = n();
|
|
3659
3629
|
const x = Q(t, s.path);
|
|
3660
3630
|
o = tt({
|
|
3661
3631
|
path: s.path,
|
|
3662
3632
|
params: x.params,
|
|
3663
3633
|
query: s.query
|
|
3664
3634
|
}), a = async () => {
|
|
3665
|
-
const c =
|
|
3635
|
+
const c = n();
|
|
3666
3636
|
await w(c.path);
|
|
3667
3637
|
};
|
|
3668
3638
|
const w = async (c) => {
|
|
3669
3639
|
try {
|
|
3670
|
-
const
|
|
3640
|
+
const h = {
|
|
3671
3641
|
path: c.replace(r, "") || "/",
|
|
3672
3642
|
query: {}
|
|
3673
|
-
}, y = Q(t,
|
|
3674
|
-
if (!y) throw new Error(`No route found for ${
|
|
3675
|
-
const
|
|
3676
|
-
path:
|
|
3643
|
+
}, y = Q(t, h.path);
|
|
3644
|
+
if (!y) throw new Error(`No route found for ${h.path}`);
|
|
3645
|
+
const k = o.getState(), $ = {
|
|
3646
|
+
path: h.path,
|
|
3677
3647
|
params: y.params,
|
|
3678
|
-
query:
|
|
3679
|
-
}, f = t.find((v) => Q([v],
|
|
3648
|
+
query: h.query
|
|
3649
|
+
}, f = t.find((v) => Q([v], $.path).route !== null);
|
|
3680
3650
|
if (f?.beforeEnter)
|
|
3681
3651
|
try {
|
|
3682
|
-
const v = await f.beforeEnter(k
|
|
3652
|
+
const v = await f.beforeEnter($, k);
|
|
3683
3653
|
if (typeof v == "string") {
|
|
3684
3654
|
await w(v);
|
|
3685
3655
|
return;
|
|
@@ -3690,7 +3660,7 @@ function lr(e) {
|
|
|
3690
3660
|
}
|
|
3691
3661
|
if (f?.onEnter)
|
|
3692
3662
|
try {
|
|
3693
|
-
const v = await f.onEnter(k
|
|
3663
|
+
const v = await f.onEnter($, k);
|
|
3694
3664
|
if (typeof v == "string") {
|
|
3695
3665
|
await w(v);
|
|
3696
3666
|
return;
|
|
@@ -3699,9 +3669,9 @@ function lr(e) {
|
|
|
3699
3669
|
} catch {
|
|
3700
3670
|
return;
|
|
3701
3671
|
}
|
|
3702
|
-
if (o.setState(
|
|
3672
|
+
if (o.setState($), f?.afterEnter)
|
|
3703
3673
|
try {
|
|
3704
|
-
f.afterEnter(k
|
|
3674
|
+
f.afterEnter($, k);
|
|
3705
3675
|
} catch {
|
|
3706
3676
|
}
|
|
3707
3677
|
} catch {
|
|
@@ -3718,17 +3688,17 @@ function lr(e) {
|
|
|
3718
3688
|
subscribe: o.subscribe,
|
|
3719
3689
|
matchRoute: (x) => Q(t, x),
|
|
3720
3690
|
getCurrent: () => o.getState(),
|
|
3721
|
-
resolveRouteComponent:
|
|
3691
|
+
resolveRouteComponent: ur
|
|
3722
3692
|
};
|
|
3723
3693
|
}
|
|
3724
|
-
function
|
|
3694
|
+
function zr(e, t) {
|
|
3725
3695
|
return Q(e, t);
|
|
3726
3696
|
}
|
|
3727
|
-
function
|
|
3728
|
-
const t =
|
|
3729
|
-
return et("router-view", (r = {},
|
|
3730
|
-
const { onConnected:
|
|
3731
|
-
if (
|
|
3697
|
+
function Dr(e) {
|
|
3698
|
+
const t = fr(e);
|
|
3699
|
+
return et("router-view", (r = {}, i = {}) => {
|
|
3700
|
+
const { onConnected: n } = i;
|
|
3701
|
+
if (n && n(() => {
|
|
3732
3702
|
t && typeof t.subscribe == "function" && t.subscribe(() => {
|
|
3733
3703
|
});
|
|
3734
3704
|
}), !t) return ce`<div>Router not initialized.</div>`;
|
|
@@ -3742,9 +3712,9 @@ function Wr(e) {
|
|
|
3742
3712
|
}
|
|
3743
3713
|
return ce`<div>Invalid route component</div>`;
|
|
3744
3714
|
}).catch(() => ce`<div>Invalid route component</div>`) : ce`<div>Not found</div>`;
|
|
3745
|
-
}), et("router-link", (r = {},
|
|
3715
|
+
}), et("router-link", (r = {}, i = {}) => {
|
|
3746
3716
|
const {
|
|
3747
|
-
to:
|
|
3717
|
+
to: n = "",
|
|
3748
3718
|
tag: s = "a",
|
|
3749
3719
|
replace: o = !1,
|
|
3750
3720
|
exact: a = !1,
|
|
@@ -3752,27 +3722,27 @@ function Wr(e) {
|
|
|
3752
3722
|
exactActiveClass: m = "exact-active",
|
|
3753
3723
|
ariaCurrentValue: g = "page",
|
|
3754
3724
|
disabled: b = !1,
|
|
3755
|
-
external:
|
|
3725
|
+
external: p = !1,
|
|
3756
3726
|
class: l = ""
|
|
3757
|
-
} = r, d = t.getCurrent(), x = d.path ===
|
|
3758
|
-
for (const
|
|
3759
|
-
const
|
|
3727
|
+
} = r, d = t.getCurrent(), x = d.path === n, w = a ? x : d && typeof d.path == "string" ? d.path.startsWith(n) : !1, c = x ? `aria-current="${g}"` : "", h = (l || "").split(/\s+/).filter(Boolean), y = {};
|
|
3728
|
+
for (const C of h) y[C] = !0;
|
|
3729
|
+
const k = {
|
|
3760
3730
|
...y,
|
|
3761
3731
|
// Also include the configurable names (may duplicate the above)
|
|
3762
3732
|
[u]: w,
|
|
3763
3733
|
[m]: x
|
|
3764
|
-
},
|
|
3734
|
+
}, $ = s === "button", f = b ? $ ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", v = p && (s === "a" || !s) ? 'target="_blank" rel="noopener noreferrer"' : "", A = (C) => {
|
|
3765
3735
|
if (b) {
|
|
3766
|
-
|
|
3736
|
+
C.preventDefault();
|
|
3767
3737
|
return;
|
|
3768
3738
|
}
|
|
3769
|
-
|
|
3739
|
+
p && (s === "a" || !s) || (C.preventDefault(), o ? t.replace(n) : t.push(n));
|
|
3770
3740
|
};
|
|
3771
3741
|
return ce`
|
|
3772
|
-
${
|
|
3742
|
+
${ar().when($, ce`
|
|
3773
3743
|
<button
|
|
3774
3744
|
part="button"
|
|
3775
|
-
:class="${
|
|
3745
|
+
:class="${k}"
|
|
3776
3746
|
${c}
|
|
3777
3747
|
${f}
|
|
3778
3748
|
${v}
|
|
@@ -3781,8 +3751,8 @@ function Wr(e) {
|
|
|
3781
3751
|
`).otherwise(ce`
|
|
3782
3752
|
<a
|
|
3783
3753
|
part="link"
|
|
3784
|
-
href="${
|
|
3785
|
-
:class="${
|
|
3754
|
+
href="${n}"
|
|
3755
|
+
:class="${k}"
|
|
3786
3756
|
${c}
|
|
3787
3757
|
${f}
|
|
3788
3758
|
${v}
|
|
@@ -3796,48 +3766,48 @@ export {
|
|
|
3796
3766
|
de as GlobalEventBus,
|
|
3797
3767
|
j as anchorBlock,
|
|
3798
3768
|
et as component,
|
|
3799
|
-
|
|
3769
|
+
hr as computed,
|
|
3800
3770
|
tt as createStore,
|
|
3801
3771
|
Pt as css,
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3772
|
+
vr as each,
|
|
3773
|
+
Sr as eachGroup,
|
|
3774
|
+
Ar as eachPage,
|
|
3775
|
+
_r as eachWhere,
|
|
3776
|
+
Lr as emit,
|
|
3807
3777
|
be as eventBus,
|
|
3808
3778
|
ce as html,
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3779
|
+
Dr as initRouter,
|
|
3780
|
+
Nr as listen,
|
|
3781
|
+
ar as match,
|
|
3812
3782
|
Q as matchRoute,
|
|
3813
|
-
|
|
3783
|
+
zr as matchRouteSSR,
|
|
3814
3784
|
te as mediaVariants,
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3785
|
+
jr as off,
|
|
3786
|
+
Mr as on,
|
|
3787
|
+
Wr as once,
|
|
3818
3788
|
rt as parseQuery,
|
|
3819
|
-
|
|
3789
|
+
dr as ref,
|
|
3820
3790
|
Pe as renderToString,
|
|
3821
|
-
|
|
3822
|
-
|
|
3791
|
+
ur as resolveRouteComponent,
|
|
3792
|
+
lr as responsive,
|
|
3823
3793
|
lt as responsiveOrder,
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3794
|
+
Or as responsiveSwitch,
|
|
3795
|
+
Pr as switchOn,
|
|
3796
|
+
Er as switchOnLength,
|
|
3797
|
+
Tr as switchOnPromise,
|
|
3798
|
+
$r as unless,
|
|
3799
|
+
gr as useEmit,
|
|
3800
|
+
br as useOnAttributeChanged,
|
|
3801
|
+
mr as useOnConnected,
|
|
3802
|
+
yr as useOnDisconnected,
|
|
3803
|
+
wr as useOnError,
|
|
3804
|
+
fr as useRouter,
|
|
3805
|
+
xr as useStyle,
|
|
3806
|
+
pr as watch,
|
|
3837
3807
|
Re as when,
|
|
3838
|
-
|
|
3808
|
+
kr as whenEmpty,
|
|
3839
3809
|
q as whenMedia,
|
|
3840
|
-
|
|
3841
|
-
|
|
3810
|
+
Cr as whenNotEmpty,
|
|
3811
|
+
Rr as whenVariants
|
|
3842
3812
|
};
|
|
3843
3813
|
//# sourceMappingURL=custom-elements-runtime.es.js.map
|