@jasonshimmy/custom-elements-runtime 1.0.3 → 1.0.4
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 +9 -9
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +791 -749
- 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
|
@@ -5,9 +5,9 @@ class dt {
|
|
|
5
5
|
* Schedule an update to be executed in the next microtask
|
|
6
6
|
* Uses component identity to deduplicate multiple render requests for the same component
|
|
7
7
|
*/
|
|
8
|
-
schedule(t,
|
|
9
|
-
const
|
|
10
|
-
this.pendingUpdates.set(
|
|
8
|
+
schedule(t, r) {
|
|
9
|
+
const n = r || t.toString();
|
|
10
|
+
this.pendingUpdates.set(n, t), this.isFlushScheduled || (this.isFlushScheduled = !0, typeof globalThis.process < "u" && globalThis.process.env?.NODE_ENV === "test" || typeof window < "u" && (window.__vitest__ || window.Cypress) ? this.flush() : queueMicrotask(() => this.flush()));
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Execute all pending updates
|
|
@@ -15,11 +15,11 @@ class dt {
|
|
|
15
15
|
flush() {
|
|
16
16
|
const t = Array.from(this.pendingUpdates.values());
|
|
17
17
|
this.pendingUpdates.clear(), this.isFlushScheduled = !1;
|
|
18
|
-
for (const
|
|
18
|
+
for (const r of t)
|
|
19
19
|
try {
|
|
20
|
-
|
|
21
|
-
} catch (
|
|
22
|
-
typeof console < "u" && console.error && console.error("Error in batched update:",
|
|
20
|
+
r();
|
|
21
|
+
} catch (n) {
|
|
22
|
+
typeof console < "u" && console.error && console.error("Error in batched update:", n);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
@@ -41,13 +41,13 @@ class ht {
|
|
|
41
41
|
/**
|
|
42
42
|
* Get or create a reactive proxy for an object
|
|
43
43
|
*/
|
|
44
|
-
static getOrCreateProxy(t,
|
|
44
|
+
static getOrCreateProxy(t, r, n = !1) {
|
|
45
45
|
const i = this.cache.get(t);
|
|
46
46
|
if (i)
|
|
47
47
|
return i;
|
|
48
|
-
const s =
|
|
48
|
+
const s = n ? this.getOrCreateArrayHandler(r) : this.getOrCreateObjectHandler(r), o = new Proxy(t, s);
|
|
49
49
|
try {
|
|
50
|
-
|
|
50
|
+
nt.markAsProxy(o);
|
|
51
51
|
} catch {
|
|
52
52
|
}
|
|
53
53
|
return this.cache.set(t, o), o;
|
|
@@ -57,9 +57,9 @@ class ht {
|
|
|
57
57
|
*/
|
|
58
58
|
static getOrCreateArrayHandler(t) {
|
|
59
59
|
if (!this.arrayHandlerCache.has(t)) {
|
|
60
|
-
const
|
|
61
|
-
get: (
|
|
62
|
-
const o = Reflect.get(
|
|
60
|
+
const r = {
|
|
61
|
+
get: (n, i, s) => {
|
|
62
|
+
const o = Reflect.get(n, i, s);
|
|
63
63
|
return typeof o == "function" && typeof i == "string" && [
|
|
64
64
|
"push",
|
|
65
65
|
"pop",
|
|
@@ -71,14 +71,14 @@ class ht {
|
|
|
71
71
|
"fill",
|
|
72
72
|
"copyWithin"
|
|
73
73
|
].includes(i) ? function(...u) {
|
|
74
|
-
const m = o.apply(
|
|
74
|
+
const m = o.apply(n, u);
|
|
75
75
|
return t.triggerUpdate(), m;
|
|
76
76
|
} : o;
|
|
77
77
|
},
|
|
78
|
-
set: (
|
|
79
|
-
deleteProperty: (
|
|
78
|
+
set: (n, i, s) => (n[i] = t.makeReactiveValue(s), t.triggerUpdate(), !0),
|
|
79
|
+
deleteProperty: (n, i) => (delete n[i], t.triggerUpdate(), !0)
|
|
80
80
|
};
|
|
81
|
-
this.arrayHandlerCache.set(t,
|
|
81
|
+
this.arrayHandlerCache.set(t, r);
|
|
82
82
|
}
|
|
83
83
|
return this.arrayHandlerCache.get(t);
|
|
84
84
|
}
|
|
@@ -87,12 +87,12 @@ class ht {
|
|
|
87
87
|
*/
|
|
88
88
|
static getOrCreateObjectHandler(t) {
|
|
89
89
|
if (!this.objectHandlerCache.has(t)) {
|
|
90
|
-
const
|
|
91
|
-
get: (
|
|
92
|
-
set: (
|
|
93
|
-
deleteProperty: (
|
|
90
|
+
const r = {
|
|
91
|
+
get: (n, i, s) => Reflect.get(n, i, s),
|
|
92
|
+
set: (n, i, s) => (n[i] = t.makeReactiveValue(s), t.triggerUpdate(), !0),
|
|
93
|
+
deleteProperty: (n, i) => (delete n[i], t.triggerUpdate(), !0)
|
|
94
94
|
};
|
|
95
|
-
this.objectHandlerCache.set(t,
|
|
95
|
+
this.objectHandlerCache.set(t, r);
|
|
96
96
|
}
|
|
97
97
|
return this.objectHandlerCache.get(t);
|
|
98
98
|
}
|
|
@@ -118,7 +118,7 @@ class ht {
|
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
class
|
|
121
|
+
class nt {
|
|
122
122
|
// Cache a stable reactiveContext object keyed by onUpdate -> makeReactive
|
|
123
123
|
// This allows handler caches in ReactiveProxyCache to reuse handlers
|
|
124
124
|
// for identical reactive contexts instead of creating a new context object
|
|
@@ -127,19 +127,19 @@ class rt {
|
|
|
127
127
|
/**
|
|
128
128
|
* Create an optimized reactive proxy with minimal overhead
|
|
129
129
|
*/
|
|
130
|
-
static createReactiveProxy(t,
|
|
130
|
+
static createReactiveProxy(t, r, n) {
|
|
131
131
|
try {
|
|
132
132
|
if (Fe.has(t)) return t;
|
|
133
133
|
} catch {
|
|
134
134
|
}
|
|
135
135
|
const i = Array.isArray(t);
|
|
136
|
-
let s = this.contextCache.get(
|
|
137
|
-
s || (s = /* @__PURE__ */ new WeakMap(), this.contextCache.set(
|
|
138
|
-
let o = s.get(
|
|
136
|
+
let s = this.contextCache.get(r);
|
|
137
|
+
s || (s = /* @__PURE__ */ new WeakMap(), this.contextCache.set(r, s));
|
|
138
|
+
let o = s.get(n);
|
|
139
139
|
return o || (o = {
|
|
140
|
-
triggerUpdate:
|
|
141
|
-
makeReactiveValue:
|
|
142
|
-
}, s.set(
|
|
140
|
+
triggerUpdate: r,
|
|
141
|
+
makeReactiveValue: n
|
|
142
|
+
}, s.set(n, o)), ht.getOrCreateProxy(t, o, i);
|
|
143
143
|
}
|
|
144
144
|
/**
|
|
145
145
|
* Mark an object as a proxy (for optimization)
|
|
@@ -165,8 +165,8 @@ class gt {
|
|
|
165
165
|
/**
|
|
166
166
|
* Set the current component being rendered for dependency tracking
|
|
167
167
|
*/
|
|
168
|
-
setCurrentComponent(t,
|
|
169
|
-
this.currentComponent = t, this.componentRenderFunctions.set(t,
|
|
168
|
+
setCurrentComponent(t, r) {
|
|
169
|
+
this.currentComponent = t, this.componentRenderFunctions.set(t, r), this.componentDependencies.has(t) || this.componentDependencies.set(t, /* @__PURE__ */ new Set()), this.stateIndexCounter.set(t, 0);
|
|
170
170
|
}
|
|
171
171
|
/**
|
|
172
172
|
* Clear the current component after rendering
|
|
@@ -198,19 +198,19 @@ class gt {
|
|
|
198
198
|
*/
|
|
199
199
|
shouldEmitRenderWarning() {
|
|
200
200
|
if (!this.currentComponent) return !0;
|
|
201
|
-
const t = this.currentComponent,
|
|
202
|
-
return
|
|
201
|
+
const t = this.currentComponent, r = this.lastWarningTime.get(t) || 0, n = Date.now();
|
|
202
|
+
return n - r < 1e3 ? !1 : (this.lastWarningTime.set(t, n), !0);
|
|
203
203
|
}
|
|
204
204
|
/**
|
|
205
205
|
* Execute a function with tracking disabled
|
|
206
206
|
*/
|
|
207
207
|
withoutTracking(t) {
|
|
208
|
-
const
|
|
208
|
+
const r = this.trackingDisabled;
|
|
209
209
|
this.trackingDisabled = !0;
|
|
210
210
|
try {
|
|
211
211
|
return t();
|
|
212
212
|
} finally {
|
|
213
|
-
this.trackingDisabled =
|
|
213
|
+
this.trackingDisabled = r;
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
/**
|
|
@@ -219,8 +219,8 @@ class gt {
|
|
|
219
219
|
getOrCreateState(t) {
|
|
220
220
|
if (!this.currentComponent)
|
|
221
221
|
return new He(t);
|
|
222
|
-
const
|
|
223
|
-
if (this.stateIndexCounter.set(
|
|
222
|
+
const r = this.currentComponent, n = this.stateIndexCounter.get(r) || 0, i = `${r}:${n}`;
|
|
223
|
+
if (this.stateIndexCounter.set(r, n + 1), this.stateStorage.has(i))
|
|
224
224
|
return this.stateStorage.get(i);
|
|
225
225
|
const s = new He(t);
|
|
226
226
|
return this.stateStorage.set(i, s), s;
|
|
@@ -235,19 +235,19 @@ class gt {
|
|
|
235
235
|
* Trigger updates for all components that depend on a state
|
|
236
236
|
*/
|
|
237
237
|
triggerUpdate(t) {
|
|
238
|
-
t.getDependents().forEach((
|
|
239
|
-
const
|
|
240
|
-
|
|
238
|
+
t.getDependents().forEach((r) => {
|
|
239
|
+
const n = this.componentRenderFunctions.get(r);
|
|
240
|
+
n && fe(n, r);
|
|
241
241
|
});
|
|
242
242
|
}
|
|
243
243
|
/**
|
|
244
244
|
* Clean up component dependencies when component is destroyed
|
|
245
245
|
*/
|
|
246
246
|
cleanup(t) {
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
for (const
|
|
250
|
-
|
|
247
|
+
const r = this.componentDependencies.get(t);
|
|
248
|
+
r && (r.forEach((n) => n.removeDependent(t)), this.componentDependencies.delete(t)), this.componentRenderFunctions.delete(t);
|
|
249
|
+
for (const n of Array.from(this.stateStorage.keys()))
|
|
250
|
+
n.startsWith(t + ":") && this.stateStorage.delete(n);
|
|
251
251
|
this.stateIndexCounter.delete(t);
|
|
252
252
|
}
|
|
253
253
|
}
|
|
@@ -258,8 +258,8 @@ class He {
|
|
|
258
258
|
constructor(t) {
|
|
259
259
|
this._value = this.makeReactive(t);
|
|
260
260
|
try {
|
|
261
|
-
const
|
|
262
|
-
Object.defineProperty(this,
|
|
261
|
+
const r = Symbol.for("@cer/ReactiveState");
|
|
262
|
+
Object.defineProperty(this, r, { value: !0, enumerable: !1, configurable: !1 });
|
|
263
263
|
} catch {
|
|
264
264
|
}
|
|
265
265
|
}
|
|
@@ -284,14 +284,14 @@ class He {
|
|
|
284
284
|
return this.dependents;
|
|
285
285
|
}
|
|
286
286
|
makeReactive(t) {
|
|
287
|
-
return t === null || typeof t != "object" || t instanceof Node || t instanceof Element || t instanceof HTMLElement ? t :
|
|
287
|
+
return t === null || typeof t != "object" || t instanceof Node || t instanceof Element || t instanceof HTMLElement ? t : nt.createReactiveProxy(
|
|
288
288
|
t,
|
|
289
289
|
() => F.triggerUpdate(this),
|
|
290
|
-
(
|
|
290
|
+
(r) => this.makeReactive(r)
|
|
291
291
|
);
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
|
-
function
|
|
294
|
+
function ur(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 fr(e) {
|
|
311
311
|
const t = new He(e());
|
|
312
312
|
return {
|
|
313
313
|
get value() {
|
|
@@ -315,44 +315,44 @@ function dn(e) {
|
|
|
315
315
|
}
|
|
316
316
|
};
|
|
317
317
|
}
|
|
318
|
-
function
|
|
319
|
-
let
|
|
320
|
-
|
|
318
|
+
function dr(e, t, r = {}) {
|
|
319
|
+
let n = e();
|
|
320
|
+
r.immediate && t(n, n);
|
|
321
321
|
const i = `watch-${Math.random().toString(36).substr(2, 9)}`, s = () => {
|
|
322
322
|
F.setCurrentComponent(i, s);
|
|
323
323
|
const o = e();
|
|
324
|
-
F.clearCurrentComponent(), o !==
|
|
324
|
+
F.clearCurrentComponent(), o !== n && (t(o, n), n = o);
|
|
325
325
|
};
|
|
326
326
|
return F.setCurrentComponent(i, s), e(), F.clearCurrentComponent(), () => {
|
|
327
327
|
F.cleanup(i);
|
|
328
328
|
};
|
|
329
329
|
}
|
|
330
|
-
const
|
|
331
|
-
function
|
|
332
|
-
if (ve.has(e))
|
|
333
|
-
return ve.get(e);
|
|
334
|
-
const t = e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
335
|
-
return ve.size < Ue && ve.set(e, t), t;
|
|
336
|
-
}
|
|
337
|
-
function it(e) {
|
|
330
|
+
const xe = /* @__PURE__ */ new Map(), ve = /* @__PURE__ */ new Map(), ke = /* @__PURE__ */ new Map(), Ue = 500;
|
|
331
|
+
function re(e) {
|
|
338
332
|
if (xe.has(e))
|
|
339
333
|
return xe.get(e);
|
|
340
|
-
const t = e.replace(
|
|
334
|
+
const t = e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
341
335
|
return xe.size < Ue && xe.set(e, t), t;
|
|
342
336
|
}
|
|
337
|
+
function it(e) {
|
|
338
|
+
if (ve.has(e))
|
|
339
|
+
return ve.get(e);
|
|
340
|
+
const t = e.replace(/-([a-z])/g, (r, n) => n.toUpperCase());
|
|
341
|
+
return ve.size < Ue && ve.set(e, t), t;
|
|
342
|
+
}
|
|
343
343
|
function ie(e) {
|
|
344
344
|
if (typeof e == "string") {
|
|
345
345
|
if (ke.has(e))
|
|
346
346
|
return ke.get(e);
|
|
347
347
|
const t = e.replace(
|
|
348
348
|
/[&<>"']/g,
|
|
349
|
-
(
|
|
349
|
+
(r) => ({
|
|
350
350
|
"&": "&",
|
|
351
351
|
"<": "<",
|
|
352
352
|
">": ">",
|
|
353
353
|
'"': """,
|
|
354
354
|
"'": "'"
|
|
355
|
-
})[
|
|
355
|
+
})[r]
|
|
356
356
|
);
|
|
357
357
|
return t !== e && ke.size < Ue && ke.set(e, t), t;
|
|
358
358
|
}
|
|
@@ -360,16 +360,16 @@ function ie(e) {
|
|
|
360
360
|
}
|
|
361
361
|
function H(e, t) {
|
|
362
362
|
if (typeof t == "string") {
|
|
363
|
-
const
|
|
364
|
-
return ee(
|
|
363
|
+
const r = t.split(".").reduce((n, i) => n?.[i], e);
|
|
364
|
+
return ee(r) ? r.value : r;
|
|
365
365
|
}
|
|
366
366
|
return t;
|
|
367
367
|
}
|
|
368
|
-
function Ee(e, t,
|
|
369
|
-
const
|
|
368
|
+
function Ee(e, t, r) {
|
|
369
|
+
const n = String(t).split("."), i = n.pop();
|
|
370
370
|
if (!i) return;
|
|
371
|
-
const s =
|
|
372
|
-
ee(s[i]) ? s[i].value =
|
|
371
|
+
const s = n.reduce((o, a) => (o[a] == null && (o[a] = {}), o[a]), e);
|
|
372
|
+
ee(s[i]) ? s[i].value = r : s[i] = r;
|
|
373
373
|
}
|
|
374
374
|
const st = typeof process < "u" && process.env?.NODE_ENV !== "production";
|
|
375
375
|
function se(e, ...t) {
|
|
@@ -378,24 +378,24 @@ function se(e, ...t) {
|
|
|
378
378
|
function Oe(e, ...t) {
|
|
379
379
|
st && console.warn(e, ...t);
|
|
380
380
|
}
|
|
381
|
-
function mt(e, t,
|
|
382
|
-
if (
|
|
383
|
-
for (const [
|
|
381
|
+
function mt(e, t, r) {
|
|
382
|
+
if (r)
|
|
383
|
+
for (const [n, i] of Object.entries(r)) {
|
|
384
384
|
let s, o = {};
|
|
385
|
-
if (Array.isArray(i) ? (s = i[0], o = i[1] || {}) : s = i, t.set(
|
|
385
|
+
if (Array.isArray(i) ? (s = i[0], o = i[1] || {}) : s = i, t.set(n, {
|
|
386
386
|
callback: s,
|
|
387
387
|
options: o,
|
|
388
|
-
oldValue: H(e,
|
|
388
|
+
oldValue: H(e, n)
|
|
389
389
|
}), o.immediate)
|
|
390
390
|
try {
|
|
391
|
-
const a = H(e,
|
|
391
|
+
const a = H(e, n);
|
|
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 "${n}":`, a);
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
|
-
function yt(e, t,
|
|
398
|
+
function yt(e, t, r, n) {
|
|
399
399
|
const i = (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;
|
|
@@ -403,15 +403,15 @@ function yt(e, t, n, r) {
|
|
|
403
403
|
return o.length !== a.length ? !1 : o.every((g, b) => i(g, a[b]));
|
|
404
404
|
const u = Object.keys(o), m = Object.keys(a);
|
|
405
405
|
return u.length !== m.length ? !1 : u.every((g) => i(o[g], a[g]));
|
|
406
|
-
}, s = t.get(
|
|
407
|
-
if (s && !i(
|
|
406
|
+
}, s = t.get(r);
|
|
407
|
+
if (s && !i(n, s.oldValue))
|
|
408
408
|
try {
|
|
409
|
-
s.callback(
|
|
409
|
+
s.callback(n, s.oldValue, e), s.oldValue = n;
|
|
410
410
|
} catch (o) {
|
|
411
|
-
se(`Error in watcher for "${
|
|
411
|
+
se(`Error in watcher for "${r}":`, o);
|
|
412
412
|
}
|
|
413
413
|
for (const [o, a] of t.entries())
|
|
414
|
-
if (a.options.deep &&
|
|
414
|
+
if (a.options.deep && r.startsWith(o + "."))
|
|
415
415
|
try {
|
|
416
416
|
const u = H(e, o);
|
|
417
417
|
i(u, a.oldValue) || (a.callback(u, a.oldValue, e), a.oldValue = u);
|
|
@@ -422,32 +422,32 @@ function yt(e, t, n, r) {
|
|
|
422
422
|
function Ke(e, t) {
|
|
423
423
|
return t === Boolean ? e === "true" : t === Number ? Number(e) : e;
|
|
424
424
|
}
|
|
425
|
-
function bt(e, t,
|
|
426
|
-
t && Object.entries(t).forEach(([
|
|
427
|
-
const s =
|
|
428
|
-
if (i.type === Function && typeof e[
|
|
429
|
-
n
|
|
430
|
-
else if (typeof e[
|
|
425
|
+
function bt(e, t, r) {
|
|
426
|
+
t && Object.entries(t).forEach(([n, i]) => {
|
|
427
|
+
const s = re(n), o = e.getAttribute(s);
|
|
428
|
+
if (i.type === Function && typeof e[n] == "function")
|
|
429
|
+
r[n] = e[n];
|
|
430
|
+
else if (typeof e[n] < "u")
|
|
431
431
|
try {
|
|
432
|
-
const a = e[
|
|
433
|
-
i.type === Boolean && typeof a == "boolean" || i.type === Number && typeof a == "number" || i.type === Function && typeof a == "function" ? n
|
|
432
|
+
const a = e[n];
|
|
433
|
+
i.type === Boolean && typeof a == "boolean" || i.type === Number && typeof a == "number" || i.type === Function && typeof a == "function" ? r[n] = a : r[n] = ie(Ke(String(a), i.type));
|
|
434
434
|
} catch {
|
|
435
|
-
n
|
|
435
|
+
r[n] = e[n];
|
|
436
436
|
}
|
|
437
|
-
else o !== null ? n
|
|
437
|
+
else o !== null ? r[n] = ie(Ke(o, i.type)) : "default" in i && i.default !== void 0 && (r[n] = ie(i.default));
|
|
438
438
|
});
|
|
439
439
|
}
|
|
440
|
-
function wt(e, t,
|
|
441
|
-
t.props && bt(e, t.props,
|
|
440
|
+
function wt(e, t, r) {
|
|
441
|
+
t.props && bt(e, t.props, r);
|
|
442
442
|
}
|
|
443
|
-
function
|
|
444
|
-
e.onConnected && !
|
|
443
|
+
function xt(e, t, r, n) {
|
|
444
|
+
e.onConnected && !r && (e.onConnected(t), n(!0));
|
|
445
445
|
}
|
|
446
|
-
function
|
|
447
|
-
e.onDisconnected && e.onDisconnected(t),
|
|
446
|
+
function vt(e, t, r, n, i, s, o, a) {
|
|
447
|
+
e.onDisconnected && e.onDisconnected(t), r.forEach((u) => u()), n(), i(), s(!1), o(null), a(!1);
|
|
448
448
|
}
|
|
449
|
-
function kt(e, t,
|
|
450
|
-
e.onAttributeChanged && e.onAttributeChanged(t,
|
|
449
|
+
function kt(e, t, r, n, i) {
|
|
450
|
+
e.onAttributeChanged && e.onAttributeChanged(t, r, n, i);
|
|
451
451
|
}
|
|
452
452
|
class Ct {
|
|
453
453
|
static cache = /* @__PURE__ */ new Map();
|
|
@@ -470,14 +470,14 @@ class Ct {
|
|
|
470
470
|
/fetch/i,
|
|
471
471
|
/XMLHttpRequest/i
|
|
472
472
|
];
|
|
473
|
-
static evaluate(t,
|
|
474
|
-
const
|
|
475
|
-
if (
|
|
476
|
-
if (!
|
|
473
|
+
static evaluate(t, r) {
|
|
474
|
+
const n = this.cache.get(t);
|
|
475
|
+
if (n) {
|
|
476
|
+
if (!n.isSecure) {
|
|
477
477
|
Oe("Blocked cached dangerous expression:", t);
|
|
478
478
|
return;
|
|
479
479
|
}
|
|
480
|
-
return
|
|
480
|
+
return n.evaluator(r);
|
|
481
481
|
}
|
|
482
482
|
const i = this.createEvaluator(t);
|
|
483
483
|
if (this.cache.size >= this.maxCacheSize) {
|
|
@@ -488,7 +488,7 @@ class Ct {
|
|
|
488
488
|
Oe("Blocked dangerous expression:", t);
|
|
489
489
|
return;
|
|
490
490
|
}
|
|
491
|
-
return i.evaluator(
|
|
491
|
+
return i.evaluator(r);
|
|
492
492
|
}
|
|
493
493
|
static createEvaluator(t) {
|
|
494
494
|
if (this.hasDangerousPatterns(t))
|
|
@@ -499,28 +499,28 @@ class Ct {
|
|
|
499
499
|
}, isSecure: !1 };
|
|
500
500
|
try {
|
|
501
501
|
return { evaluator: this.createSafeEvaluator(t), isSecure: !0 };
|
|
502
|
-
} catch (
|
|
503
|
-
return Oe("Failed to create evaluator for expression:", t,
|
|
502
|
+
} catch (r) {
|
|
503
|
+
return Oe("Failed to create evaluator for expression:", t, r), { evaluator: () => {
|
|
504
504
|
}, isSecure: !1 };
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
507
|
static hasDangerousPatterns(t) {
|
|
508
|
-
return this.dangerousPatterns.some((
|
|
508
|
+
return this.dangerousPatterns.some((r) => r.test(t));
|
|
509
509
|
}
|
|
510
510
|
static createSafeEvaluator(t) {
|
|
511
511
|
if (t.trim().startsWith("{") && t.trim().endsWith("}"))
|
|
512
512
|
return this.createObjectEvaluator(t);
|
|
513
513
|
if (/^ctx\.[a-zA-Z0-9_\.]+$/.test(t.trim())) {
|
|
514
|
-
const
|
|
515
|
-
return (
|
|
514
|
+
const r = t.trim().slice(4);
|
|
515
|
+
return (n) => H(n, r);
|
|
516
516
|
}
|
|
517
|
-
return t.includes("ctx") || /[+\-*/%<>=&|?:\[\]]/.test(t) ? this.createSimpleEvaluator(t) : (
|
|
517
|
+
return t.includes("ctx") || /[+\-*/%<>=&|?:\[\]]/.test(t) ? this.createSimpleEvaluator(t) : (r) => H(r, t);
|
|
518
518
|
}
|
|
519
519
|
static createObjectEvaluator(t) {
|
|
520
|
-
const
|
|
520
|
+
const r = t.trim().slice(1, -1), n = this.parseObjectProperties(r);
|
|
521
521
|
return (i) => {
|
|
522
522
|
const s = {};
|
|
523
|
-
for (const { key: o, value: a } of
|
|
523
|
+
for (const { key: o, value: a } of n)
|
|
524
524
|
try {
|
|
525
525
|
if (a.startsWith("ctx.")) {
|
|
526
526
|
const u = a.slice(4);
|
|
@@ -534,51 +534,51 @@ class Ct {
|
|
|
534
534
|
};
|
|
535
535
|
}
|
|
536
536
|
static parseObjectProperties(t) {
|
|
537
|
-
const
|
|
538
|
-
for (const i of
|
|
537
|
+
const r = [], n = t.split(",");
|
|
538
|
+
for (const i of n) {
|
|
539
539
|
const s = i.indexOf(":");
|
|
540
540
|
if (s === -1) continue;
|
|
541
541
|
const o = i.slice(0, s).trim(), a = i.slice(s + 1).trim(), u = o.replace(/^['"]|['"]$/g, "");
|
|
542
|
-
|
|
542
|
+
r.push({ key: u, value: a });
|
|
543
543
|
}
|
|
544
|
-
return
|
|
544
|
+
return r;
|
|
545
545
|
}
|
|
546
546
|
static createSimpleEvaluator(t) {
|
|
547
|
-
return (
|
|
547
|
+
return (r) => {
|
|
548
548
|
try {
|
|
549
|
-
let
|
|
549
|
+
let n = t;
|
|
550
550
|
const i = [];
|
|
551
|
-
|
|
552
|
-
const s =
|
|
551
|
+
n = n.replace(/("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')/g, (b) => `<<#${i.push(b) - 1}#>>`);
|
|
552
|
+
const s = n.match(/ctx\.[\w.]+/g) || [];
|
|
553
553
|
for (const b of s) {
|
|
554
|
-
const h = b.slice(4), l = H(
|
|
554
|
+
const h = b.slice(4), l = H(r, h);
|
|
555
555
|
if (l === void 0) return;
|
|
556
556
|
const d = i.push(JSON.stringify(l)) - 1;
|
|
557
|
-
|
|
557
|
+
n = n.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 = n.match(o) || [];
|
|
560
560
|
for (const b of a) {
|
|
561
561
|
if (b.startsWith("ctx.")) continue;
|
|
562
|
-
const h = H(
|
|
562
|
+
const h = H(r, b);
|
|
563
563
|
if (h === void 0) return;
|
|
564
564
|
const l = i.push(JSON.stringify(h)) - 1;
|
|
565
|
-
|
|
565
|
+
n = n.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(n)) !== null; ) {
|
|
571
571
|
const b = m[1];
|
|
572
572
|
if (["true", "false", "null", "undefined"].includes(b) || /^[0-9]+$/.test(b) || b === "ctx" || g.has(b)) continue;
|
|
573
573
|
g.add(b);
|
|
574
|
-
const h = H(
|
|
574
|
+
const h = H(r, b);
|
|
575
575
|
if (h === void 0) return;
|
|
576
576
|
const l = JSON.stringify(h), d = i.push(l) - 1;
|
|
577
|
-
b.includes(".") ?
|
|
577
|
+
b.includes(".") ? n = n.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${d}#>>`) : n = n.replace(new RegExp("\\b" + b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") + "\\b", "g"), `<<#${d}#>>`);
|
|
578
578
|
}
|
|
579
|
-
|
|
579
|
+
n = n.replace(/<<#(\d+)#>>/g, (b, h) => i[Number(h)]);
|
|
580
580
|
try {
|
|
581
|
-
return this.evaluateBasicExpression(
|
|
581
|
+
return this.evaluateBasicExpression(n);
|
|
582
582
|
} catch {
|
|
583
583
|
return;
|
|
584
584
|
}
|
|
@@ -593,13 +593,13 @@ class Ct {
|
|
|
593
593
|
* arithmetic (+ - * / %), comparisons, logical && and ||, parentheses, and ternary `a ? b : c`.
|
|
594
594
|
*/
|
|
595
595
|
static evaluateBasicExpression(t) {
|
|
596
|
-
const
|
|
597
|
-
let
|
|
596
|
+
const r = this.tokenize(t);
|
|
597
|
+
let n = 0;
|
|
598
598
|
function i() {
|
|
599
|
-
return n
|
|
599
|
+
return r[n];
|
|
600
600
|
}
|
|
601
601
|
function s(c) {
|
|
602
|
-
const p = n
|
|
602
|
+
const p = r[n++];
|
|
603
603
|
if (c && !p)
|
|
604
604
|
throw new Error(`Unexpected token EOF, expected ${c}`);
|
|
605
605
|
if (c && p && p.type !== c && p.value !== c)
|
|
@@ -707,9 +707,9 @@ class Ct {
|
|
|
707
707
|
return c;
|
|
708
708
|
}
|
|
709
709
|
function d() {
|
|
710
|
-
return i() && i().value === "!" ? (s("OP"), !d()) : i() && i().value === "-" ? (s("OP"), -d()) :
|
|
710
|
+
return i() && i().value === "!" ? (s("OP"), !d()) : i() && i().value === "-" ? (s("OP"), -d()) : x();
|
|
711
711
|
}
|
|
712
|
-
function
|
|
712
|
+
function x() {
|
|
713
713
|
const c = i();
|
|
714
714
|
if (c) {
|
|
715
715
|
if (c.type === "NUMBER")
|
|
@@ -736,21 +736,21 @@ class Ct {
|
|
|
736
736
|
return o();
|
|
737
737
|
}
|
|
738
738
|
static tokenize(t) {
|
|
739
|
-
const
|
|
739
|
+
const r = [], n = /\s*(=>|===|!==|==|!=|>=|<=|\|\||&&|[()?:,\[\]]|\+|-|\*|\/|%|>|<|!|\d+\.?\d*|"[^"]*"|'[^']*'|[a-zA-Z_][a-zA-Z0-9_]*|\S)\s*/g;
|
|
740
740
|
let i;
|
|
741
|
-
for (; (i =
|
|
741
|
+
for (; (i = n.exec(t)) !== null; ) {
|
|
742
742
|
const s = i[1];
|
|
743
|
-
s && (/^\d/.test(s) ?
|
|
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
|
-
return
|
|
745
|
+
return r;
|
|
746
746
|
}
|
|
747
|
-
static evaluateSimpleValue(t,
|
|
747
|
+
static evaluateSimpleValue(t, r) {
|
|
748
748
|
if (t === "true") return !0;
|
|
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(
|
|
752
|
+
const n = t.slice(4);
|
|
753
|
+
return H(r, n);
|
|
754
754
|
}
|
|
755
755
|
return t.startsWith('"') && t.endsWith('"') || t.startsWith("'") && t.endsWith("'") ? t.slice(1, -1) : t;
|
|
756
756
|
}
|
|
@@ -766,9 +766,9 @@ class oe {
|
|
|
766
766
|
/**
|
|
767
767
|
* Add an event listener with automatic cleanup tracking
|
|
768
768
|
*/
|
|
769
|
-
static addListener(t,
|
|
770
|
-
t.addEventListener(
|
|
771
|
-
const o = { event:
|
|
769
|
+
static addListener(t, r, n, i) {
|
|
770
|
+
t.addEventListener(r, n, i);
|
|
771
|
+
const o = { event: r, handler: n, options: i, cleanup: () => t.removeEventListener(r, n, i), addedAt: Date.now() };
|
|
772
772
|
this.cleanupFunctions.has(t) || this.cleanupFunctions.set(t, []);
|
|
773
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,
|
|
780
|
-
t.removeEventListener(
|
|
779
|
+
static removeListener(t, r, n, i) {
|
|
780
|
+
t.removeEventListener(r, n, i);
|
|
781
781
|
const s = this.cleanupFunctions.get(t);
|
|
782
782
|
if (s) {
|
|
783
783
|
const o = s.__metaList || null;
|
|
784
784
|
if (o) {
|
|
785
|
-
const a = o.findIndex((u) => u.event ===
|
|
785
|
+
const a = o.findIndex((u) => u.event === r && u.handler === n && JSON.stringify(u.options) === JSON.stringify(i));
|
|
786
786
|
if (a >= 0) {
|
|
787
787
|
try {
|
|
788
788
|
o[a].cleanup();
|
|
@@ -801,8 +801,8 @@ class oe {
|
|
|
801
801
|
* Clean up all event listeners for an element
|
|
802
802
|
*/
|
|
803
803
|
static cleanup(t) {
|
|
804
|
-
const
|
|
805
|
-
|
|
804
|
+
const r = this.cleanupFunctions.get(t);
|
|
805
|
+
r && ((r.__metaList || r).forEach((i) => {
|
|
806
806
|
try {
|
|
807
807
|
typeof i == "function" ? i() : i && typeof i.cleanup == "function" && i.cleanup();
|
|
808
808
|
} catch (s) {
|
|
@@ -824,32 +824,32 @@ class oe {
|
|
|
824
824
|
* Check if an element has any tracked event listeners
|
|
825
825
|
*/
|
|
826
826
|
static hasListeners(t) {
|
|
827
|
-
const
|
|
828
|
-
return !!(
|
|
827
|
+
const r = this.cleanupFunctions.get(t), n = r ? r.__metaList || r : void 0;
|
|
828
|
+
return !!(n && n.length > 0);
|
|
829
829
|
}
|
|
830
830
|
/**
|
|
831
831
|
* Get the number of tracked event listeners for an element
|
|
832
832
|
*/
|
|
833
833
|
static getListenerCount(t) {
|
|
834
|
-
const
|
|
835
|
-
return
|
|
834
|
+
const r = this.cleanupFunctions.get(t), n = r ? r.__metaList || r : void 0;
|
|
835
|
+
return n ? n.length : 0;
|
|
836
836
|
}
|
|
837
837
|
}
|
|
838
838
|
function ue(e, t) {
|
|
839
839
|
if (t && e instanceof HTMLElement) {
|
|
840
840
|
oe.cleanup(e);
|
|
841
|
-
for (const
|
|
842
|
-
t[
|
|
843
|
-
for (const
|
|
844
|
-
ue(
|
|
841
|
+
for (const r in t)
|
|
842
|
+
t[r] === e && delete t[r];
|
|
843
|
+
for (const r of Array.from(e.childNodes))
|
|
844
|
+
ue(r, t);
|
|
845
845
|
}
|
|
846
846
|
}
|
|
847
|
-
function he(e, t,
|
|
847
|
+
function he(e, t, r) {
|
|
848
848
|
if (typeof e == "string") return;
|
|
849
|
-
const
|
|
850
|
-
|
|
849
|
+
const n = e.props?.reactiveRef ?? (e.props?.props && e.props.props.reactiveRef), i = e.props?.ref ?? (e.props?.props && e.props.props.ref);
|
|
850
|
+
n ? n.value = t : i && r && (r[i] = t);
|
|
851
851
|
}
|
|
852
|
-
function _t(e, t,
|
|
852
|
+
function _t(e, t, r, n, i, s, o, a) {
|
|
853
853
|
if (!s) return;
|
|
854
854
|
const u = t.includes("lazy"), m = t.includes("trim"), g = t.includes("number"), b = e && typeof e == "object" && "value" in e && typeof e.value < "u", h = () => {
|
|
855
855
|
if (b) {
|
|
@@ -859,17 +859,17 @@ function _t(e, t, n, r, i, s, o, a) {
|
|
|
859
859
|
return H(s._state || s, e);
|
|
860
860
|
}, l = h();
|
|
861
861
|
let d = "text";
|
|
862
|
-
o instanceof HTMLInputElement ? d =
|
|
863
|
-
const
|
|
862
|
+
o instanceof HTMLInputElement ? d = n?.type || o.type || "text" : o instanceof HTMLSelectElement ? d = "select" : o instanceof HTMLTextAreaElement && (d = "textarea");
|
|
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
|
-
|
|
866
|
+
r[c] = l.includes(String(o?.getAttribute("value") ?? n?.value ?? ""));
|
|
867
867
|
else {
|
|
868
868
|
const C = o?.getAttribute("true-value") ?? !0;
|
|
869
|
-
|
|
869
|
+
r[c] = l === C;
|
|
870
870
|
}
|
|
871
871
|
else if (d === "radio")
|
|
872
|
-
|
|
872
|
+
r[c] = l === (n?.value ?? "");
|
|
873
873
|
else if (d === "select")
|
|
874
874
|
if (o && o.hasAttribute("multiple") && o instanceof HTMLSelectElement) {
|
|
875
875
|
const C = Array.isArray(l) ? l.map(String) : [];
|
|
@@ -877,14 +877,14 @@ function _t(e, t, n, r, i, s, o, a) {
|
|
|
877
877
|
Array.from(o.options).forEach((k) => {
|
|
878
878
|
k.selected = C.includes(k.value);
|
|
879
879
|
});
|
|
880
|
-
}, 0),
|
|
880
|
+
}, 0), r[c] = Array.isArray(l) ? l : [];
|
|
881
881
|
} else
|
|
882
|
-
|
|
882
|
+
r[c] = l;
|
|
883
883
|
else {
|
|
884
|
-
|
|
884
|
+
r[c] = l;
|
|
885
885
|
try {
|
|
886
|
-
const C =
|
|
887
|
-
|
|
886
|
+
const C = re(c);
|
|
887
|
+
n && (n[C] = l);
|
|
888
888
|
} catch {
|
|
889
889
|
}
|
|
890
890
|
}
|
|
@@ -894,7 +894,7 @@ function _t(e, t, n, r, i, s, o, a) {
|
|
|
894
894
|
if (C.isTrusted === !1 && !k) return;
|
|
895
895
|
const f = C.target;
|
|
896
896
|
if (!f || f._modelUpdating) return;
|
|
897
|
-
let
|
|
897
|
+
let v = f.value;
|
|
898
898
|
if (d === "checkbox") {
|
|
899
899
|
const T = h();
|
|
900
900
|
if (Array.isArray(T)) {
|
|
@@ -905,38 +905,38 @@ function _t(e, t, n, r, i, s, o, a) {
|
|
|
905
905
|
const P = S.indexOf(R);
|
|
906
906
|
P > -1 && S.splice(P, 1);
|
|
907
907
|
}
|
|
908
|
-
|
|
908
|
+
v = S;
|
|
909
909
|
} else {
|
|
910
910
|
const R = f.getAttribute("true-value") ?? !0, S = f.getAttribute("false-value") ?? !1;
|
|
911
|
-
|
|
911
|
+
v = f.checked ? R : S;
|
|
912
912
|
}
|
|
913
913
|
} else if (d === "radio")
|
|
914
|
-
|
|
914
|
+
v = f.getAttribute("value") ?? f.value;
|
|
915
915
|
else if (d === "select" && f.multiple)
|
|
916
|
-
|
|
917
|
-
else if (m && typeof
|
|
918
|
-
const T = Number(
|
|
919
|
-
isNaN(T) || (
|
|
916
|
+
v = Array.from(f.selectedOptions).map((T) => T.value);
|
|
917
|
+
else if (m && typeof v == "string" && (v = v.trim()), g) {
|
|
918
|
+
const T = Number(v);
|
|
919
|
+
isNaN(T) || (v = T);
|
|
920
920
|
}
|
|
921
921
|
const A = s._state || s, _ = h();
|
|
922
|
-
if (Array.isArray(
|
|
922
|
+
if (Array.isArray(v) && Array.isArray(_) ? JSON.stringify([...v].sort()) !== JSON.stringify([..._].sort()) : v !== _) {
|
|
923
923
|
f._modelUpdating = !0;
|
|
924
924
|
try {
|
|
925
925
|
if (b)
|
|
926
926
|
if (a && typeof e.value == "object" && e.value !== null) {
|
|
927
927
|
const T = { ...e.value };
|
|
928
|
-
T[a] =
|
|
928
|
+
T[a] = v, e.value = T;
|
|
929
929
|
} else
|
|
930
|
-
e.value =
|
|
930
|
+
e.value = v;
|
|
931
931
|
else
|
|
932
|
-
Ee(A, e,
|
|
932
|
+
Ee(A, e, v);
|
|
933
933
|
if (s._requestRender && s._requestRender(), s._triggerWatchers) {
|
|
934
934
|
const T = b ? "reactiveState" : e;
|
|
935
|
-
s._triggerWatchers(T,
|
|
935
|
+
s._triggerWatchers(T, v);
|
|
936
936
|
}
|
|
937
937
|
if (f) {
|
|
938
|
-
const T = `update:${
|
|
939
|
-
detail:
|
|
938
|
+
const T = `update:${re(c)}`, R = new CustomEvent(T, {
|
|
939
|
+
detail: v,
|
|
940
940
|
bubbles: !0,
|
|
941
941
|
composed: !0
|
|
942
942
|
});
|
|
@@ -947,28 +947,28 @@ function _t(e, t, n, r, i, s, o, a) {
|
|
|
947
947
|
}
|
|
948
948
|
}
|
|
949
949
|
};
|
|
950
|
-
if (
|
|
950
|
+
if (x) {
|
|
951
951
|
if (i[p]) {
|
|
952
952
|
const C = i[p];
|
|
953
953
|
o && oe.removeListener(o, p, C);
|
|
954
954
|
}
|
|
955
955
|
i[p] = y;
|
|
956
956
|
} else {
|
|
957
|
-
const C = `update:${
|
|
957
|
+
const C = `update:${re(c)}`;
|
|
958
958
|
if (i[C]) {
|
|
959
959
|
const k = i[C];
|
|
960
960
|
o && oe.removeListener(o, C, k);
|
|
961
961
|
}
|
|
962
962
|
i[C] = (k) => {
|
|
963
|
-
const f = s._state || s,
|
|
964
|
-
if (Array.isArray(
|
|
965
|
-
Ee(f, e,
|
|
963
|
+
const f = s._state || s, v = k.detail !== void 0 ? k.detail : k.target?.value, A = H(f, e);
|
|
964
|
+
if (Array.isArray(v) && Array.isArray(A) ? JSON.stringify([...v].sort()) !== JSON.stringify([...A].sort()) : v !== A) {
|
|
965
|
+
Ee(f, e, v), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, v);
|
|
966
966
|
const $ = k.target;
|
|
967
967
|
if ($) {
|
|
968
|
-
$[c] =
|
|
968
|
+
$[c] = v;
|
|
969
969
|
try {
|
|
970
|
-
const T =
|
|
971
|
-
typeof
|
|
970
|
+
const T = re(c);
|
|
971
|
+
typeof v == "boolean" ? v ? $.setAttribute(T, "true") : $.setAttribute(T, "false") : $.setAttribute(T, String(v));
|
|
972
972
|
} catch {
|
|
973
973
|
}
|
|
974
974
|
queueMicrotask(() => {
|
|
@@ -982,7 +982,7 @@ function _t(e, t, n, r, i, s, o, a) {
|
|
|
982
982
|
i._isComposing = !1;
|
|
983
983
|
const k = C.target;
|
|
984
984
|
k && setTimeout(() => {
|
|
985
|
-
const f = k.value,
|
|
985
|
+
const f = k.value, v = s._state || s, A = H(v, e);
|
|
986
986
|
let _ = f;
|
|
987
987
|
if (m && (_ = _.trim()), g) {
|
|
988
988
|
const T = Number(_);
|
|
@@ -991,7 +991,7 @@ function _t(e, t, n, r, i, s, o, a) {
|
|
|
991
991
|
if (Array.isArray(_) && Array.isArray(A) ? JSON.stringify([..._].sort()) !== JSON.stringify([...A].sort()) : _ !== A) {
|
|
992
992
|
k._modelUpdating = !0;
|
|
993
993
|
try {
|
|
994
|
-
Ee(
|
|
994
|
+
Ee(v, e, _), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, _);
|
|
995
995
|
} finally {
|
|
996
996
|
setTimeout(() => k._modelUpdating = !1, 0);
|
|
997
997
|
}
|
|
@@ -1003,38 +1003,38 @@ 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 Et(e, t,
|
|
1006
|
+
function Et(e, t, r, n) {
|
|
1007
1007
|
if (typeof e == "object" && e !== null)
|
|
1008
1008
|
for (const [i, s] of Object.entries(e))
|
|
1009
|
-
i.startsWith("data-") || i.startsWith("aria-") || i === "class" ?
|
|
1009
|
+
i.startsWith("data-") || i.startsWith("aria-") || i === "class" ? r[i] = s : t[i] = s;
|
|
1010
1010
|
else if (typeof e == "string") {
|
|
1011
|
-
if (!
|
|
1011
|
+
if (!n) return;
|
|
1012
1012
|
try {
|
|
1013
|
-
const i = me(e,
|
|
1013
|
+
const i = me(e, n);
|
|
1014
1014
|
if (typeof i == "object" && i !== null) {
|
|
1015
1015
|
for (const [s, o] of Object.entries(i))
|
|
1016
|
-
s.startsWith("data-") || s.startsWith("aria-") || s === "class" ?
|
|
1016
|
+
s.startsWith("data-") || s.startsWith("aria-") || s === "class" ? r[s] = o : t[s] = o;
|
|
1017
1017
|
return;
|
|
1018
1018
|
} else {
|
|
1019
|
-
|
|
1019
|
+
r[e] = i;
|
|
1020
1020
|
return;
|
|
1021
1021
|
}
|
|
1022
1022
|
} catch {
|
|
1023
|
-
const i = H(
|
|
1024
|
-
|
|
1023
|
+
const i = H(n, e);
|
|
1024
|
+
r[e] = i;
|
|
1025
1025
|
}
|
|
1026
1026
|
}
|
|
1027
1027
|
}
|
|
1028
|
-
function $t(e, t,
|
|
1029
|
-
let
|
|
1028
|
+
function $t(e, t, r) {
|
|
1029
|
+
let n;
|
|
1030
1030
|
if (typeof e == "string") {
|
|
1031
|
-
if (!
|
|
1032
|
-
|
|
1031
|
+
if (!r) return;
|
|
1032
|
+
n = me(e, r);
|
|
1033
1033
|
} else
|
|
1034
|
-
|
|
1034
|
+
n = e;
|
|
1035
1035
|
const i = t.style || "";
|
|
1036
1036
|
let s = i;
|
|
1037
|
-
if (
|
|
1037
|
+
if (n) {
|
|
1038
1038
|
if (i) {
|
|
1039
1039
|
const o = i.split(";").map((u) => u.trim()).filter(Boolean), a = o.findIndex(
|
|
1040
1040
|
(u) => u.startsWith("display:")
|
|
@@ -1053,31 +1053,31 @@ function $t(e, t, n) {
|
|
|
1053
1053
|
function me(e, t) {
|
|
1054
1054
|
return Ct.evaluate(e, t);
|
|
1055
1055
|
}
|
|
1056
|
-
function St(e, t,
|
|
1057
|
-
let
|
|
1056
|
+
function St(e, t, r) {
|
|
1057
|
+
let n;
|
|
1058
1058
|
if (typeof e == "string") {
|
|
1059
|
-
if (!
|
|
1060
|
-
|
|
1059
|
+
if (!r) return;
|
|
1060
|
+
n = me(e, r);
|
|
1061
1061
|
} else
|
|
1062
|
-
|
|
1062
|
+
n = e;
|
|
1063
1063
|
let i = [];
|
|
1064
|
-
typeof
|
|
1064
|
+
typeof n == "string" ? i = [n] : Array.isArray(n) ? i = n.filter(Boolean) : typeof n == "object" && n !== null && (i = Object.entries(n).filter(([, a]) => !!a).flatMap(([a]) => a.split(/\s+/).filter(Boolean)));
|
|
1065
1065
|
const s = t.class || "", o = s ? `${s} ${i.join(" ")}`.trim() : i.join(" ");
|
|
1066
1066
|
o && (t.class = o);
|
|
1067
1067
|
}
|
|
1068
|
-
function At(e, t,
|
|
1069
|
-
let
|
|
1068
|
+
function At(e, t, r) {
|
|
1069
|
+
let n;
|
|
1070
1070
|
if (typeof e == "string") {
|
|
1071
|
-
if (!
|
|
1072
|
-
|
|
1071
|
+
if (!r) return;
|
|
1072
|
+
n = me(e, r);
|
|
1073
1073
|
} else
|
|
1074
|
-
|
|
1074
|
+
n = e;
|
|
1075
1075
|
let i = "";
|
|
1076
|
-
if (typeof
|
|
1077
|
-
i =
|
|
1078
|
-
else if (
|
|
1076
|
+
if (typeof n == "string")
|
|
1077
|
+
i = n;
|
|
1078
|
+
else if (n && typeof n == "object") {
|
|
1079
1079
|
const o = [];
|
|
1080
|
-
for (const [a, u] of Object.entries(
|
|
1080
|
+
for (const [a, u] of Object.entries(n))
|
|
1081
1081
|
if (u != null && u !== "") {
|
|
1082
1082
|
const m = a.replace(
|
|
1083
1083
|
/[A-Z]/g,
|
|
@@ -1116,12 +1116,12 @@ function At(e, t, n) {
|
|
|
1116
1116
|
const s = t.style || "";
|
|
1117
1117
|
t.style = s + (s && !s.endsWith(";") ? "; " : "") + i;
|
|
1118
1118
|
}
|
|
1119
|
-
function Tt(e, t,
|
|
1120
|
-
let
|
|
1121
|
-
typeof e == "string" &&
|
|
1119
|
+
function Tt(e, t, r) {
|
|
1120
|
+
let n = e;
|
|
1121
|
+
typeof e == "string" && r && (n = me(e, r)), ee(n) ? t.reactiveRef = n : t.ref = n;
|
|
1122
1122
|
}
|
|
1123
|
-
function at(e, t,
|
|
1124
|
-
const i = {}, s = { ...
|
|
1123
|
+
function at(e, t, r, n) {
|
|
1124
|
+
const i = {}, s = { ...n || {} }, 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:")) {
|
|
@@ -1134,7 +1134,7 @@ function at(e, t, n, r) {
|
|
|
1134
1134
|
s,
|
|
1135
1135
|
o,
|
|
1136
1136
|
t,
|
|
1137
|
-
|
|
1137
|
+
r,
|
|
1138
1138
|
l
|
|
1139
1139
|
);
|
|
1140
1140
|
continue;
|
|
@@ -1187,39 +1187,39 @@ function Be(e, t) {
|
|
|
1187
1187
|
return Array.isArray(g) && (g = Be(g, u)), { ...o, key: u, children: g };
|
|
1188
1188
|
});
|
|
1189
1189
|
}
|
|
1190
|
-
const
|
|
1191
|
-
let
|
|
1192
|
-
return Array.isArray(i) && (i = Be(i,
|
|
1190
|
+
const r = e;
|
|
1191
|
+
let n = r.props?.key ?? r.key ?? t, i = r.children;
|
|
1192
|
+
return Array.isArray(i) && (i = Be(i, n)), { ...r, key: n, children: i };
|
|
1193
1193
|
}
|
|
1194
|
-
function Ve(e, t,
|
|
1195
|
-
const i =
|
|
1194
|
+
function Ve(e, t, r, n) {
|
|
1195
|
+
const i = r.directives ?? {}, s = at(
|
|
1196
1196
|
i,
|
|
1197
|
-
|
|
1197
|
+
n,
|
|
1198
1198
|
e,
|
|
1199
|
-
|
|
1199
|
+
r.attrs
|
|
1200
1200
|
), o = {
|
|
1201
1201
|
...t.props,
|
|
1202
|
-
...
|
|
1202
|
+
...r.props,
|
|
1203
1203
|
...s.props
|
|
1204
1204
|
}, a = {
|
|
1205
1205
|
...t.attrs,
|
|
1206
|
-
...
|
|
1206
|
+
...r.attrs,
|
|
1207
1207
|
...s.attrs
|
|
1208
|
-
}, u = t.props ?? {}, m = o, g =
|
|
1208
|
+
}, u = t.props ?? {}, m = o, g = r?.isCustomElement ?? t?.isCustomElement ?? !1;
|
|
1209
1209
|
let b = !1;
|
|
1210
1210
|
for (const d in { ...u, ...m }) {
|
|
1211
|
-
const
|
|
1212
|
-
if (
|
|
1211
|
+
const x = u[d], w = m[d];
|
|
1212
|
+
if (x !== w)
|
|
1213
1213
|
if (b = !0, d === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement))
|
|
1214
1214
|
e.value !== w && (e.value = w ?? "");
|
|
1215
1215
|
else if (d === "checked" && e instanceof HTMLInputElement)
|
|
1216
1216
|
e.checked = !!w;
|
|
1217
1217
|
else if (d.startsWith("on") && typeof w == "function") {
|
|
1218
1218
|
const c = ot(d);
|
|
1219
|
-
typeof
|
|
1219
|
+
typeof x == "function" && oe.removeListener(e, c, x), oe.addListener(e, c, w);
|
|
1220
1220
|
} else if (w == null)
|
|
1221
1221
|
e.removeAttribute(d);
|
|
1222
|
-
else if ((
|
|
1222
|
+
else if ((r?.isCustomElement ?? t?.isCustomElement ?? !1) || d in e)
|
|
1223
1223
|
try {
|
|
1224
1224
|
e[d] = w;
|
|
1225
1225
|
} catch {
|
|
@@ -1227,15 +1227,15 @@ function Ve(e, t, n, r) {
|
|
|
1227
1227
|
else
|
|
1228
1228
|
w === !1 && e.removeAttribute(d);
|
|
1229
1229
|
}
|
|
1230
|
-
for (const [d,
|
|
1230
|
+
for (const [d, x] of Object.entries(
|
|
1231
1231
|
s.listeners || {}
|
|
1232
1232
|
))
|
|
1233
|
-
oe.addListener(e, d,
|
|
1233
|
+
oe.addListener(e, d, x);
|
|
1234
1234
|
const h = t.attrs ?? {}, l = a;
|
|
1235
1235
|
for (const d in { ...h, ...l }) {
|
|
1236
|
-
const
|
|
1237
|
-
let c =
|
|
1238
|
-
if (ee(
|
|
1236
|
+
const x = h[d], w = l[d];
|
|
1237
|
+
let c = x, p = w;
|
|
1238
|
+
if (ee(x) && (c = x.value), ee(w) && (p = w.value), c !== p)
|
|
1239
1239
|
if (b = !0, p == null || p === !1) {
|
|
1240
1240
|
if (e.removeAttribute(d), d === "value") {
|
|
1241
1241
|
if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement)
|
|
@@ -1327,7 +1327,7 @@ function Ve(e, t, n, r) {
|
|
|
1327
1327
|
} catch {
|
|
1328
1328
|
}
|
|
1329
1329
|
}
|
|
1330
|
-
function X(e, t,
|
|
1330
|
+
function X(e, t, r) {
|
|
1331
1331
|
if (typeof e == "string")
|
|
1332
1332
|
return document.createTextNode(e);
|
|
1333
1333
|
if (e.tag === "#text") {
|
|
@@ -1337,80 +1337,80 @@ function X(e, t, n) {
|
|
|
1337
1337
|
return e.key != null && (h.key = e.key), h;
|
|
1338
1338
|
}
|
|
1339
1339
|
if (e.tag === "#anchor") {
|
|
1340
|
-
const h = e, l = Array.isArray(h.children) ? h.children : [], d = document.createTextNode(""),
|
|
1341
|
-
h.key != null && (d.key = `${h.key}:start`,
|
|
1340
|
+
const h = e, l = Array.isArray(h.children) ? h.children : [], d = document.createTextNode(""), x = document.createTextNode("");
|
|
1341
|
+
h.key != null && (d.key = `${h.key}:start`, x.key = `${h.key}:end`), h._startNode = d, h._endNode = x;
|
|
1342
1342
|
const w = document.createDocumentFragment();
|
|
1343
1343
|
w.appendChild(d);
|
|
1344
1344
|
for (const c of l) {
|
|
1345
1345
|
const p = X(c, t);
|
|
1346
1346
|
w.appendChild(p);
|
|
1347
1347
|
}
|
|
1348
|
-
return w.appendChild(
|
|
1348
|
+
return w.appendChild(x), w;
|
|
1349
1349
|
}
|
|
1350
|
-
const
|
|
1351
|
-
e.key != null && (
|
|
1352
|
-
const { props: i = {}, attrs: s = {}, directives: o = {} } = e.props ?? {}, a = at(o, t,
|
|
1350
|
+
const n = document.createElement(e.tag);
|
|
1351
|
+
e.key != null && (n.key = e.key);
|
|
1352
|
+
const { props: i = {}, attrs: s = {}, directives: o = {} } = e.props ?? {}, a = at(o, t, n, s), u = {
|
|
1353
1353
|
...i,
|
|
1354
1354
|
...a.props
|
|
1355
1355
|
}, m = {
|
|
1356
1356
|
...s,
|
|
1357
1357
|
...a.attrs
|
|
1358
|
-
}, g =
|
|
1358
|
+
}, g = n.namespaceURI === "http://www.w3.org/2000/svg";
|
|
1359
1359
|
for (const h in m) {
|
|
1360
1360
|
const l = m[h];
|
|
1361
1361
|
if (!(typeof h != "string" || /\[object Object\]/.test(h))) {
|
|
1362
1362
|
if (typeof l == "boolean")
|
|
1363
|
-
l &&
|
|
1363
|
+
l && n.setAttribute(h, "");
|
|
1364
1364
|
else if (l != null)
|
|
1365
|
-
if (!g && h === "value" && (
|
|
1365
|
+
if (!g && h === "value" && (n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n instanceof HTMLSelectElement || n instanceof HTMLProgressElement))
|
|
1366
1366
|
try {
|
|
1367
|
-
|
|
1367
|
+
n instanceof HTMLProgressElement ? n.value = Number(l) : n.value = l ?? "";
|
|
1368
1368
|
} catch {
|
|
1369
|
-
|
|
1369
|
+
n.setAttribute(h, String(l));
|
|
1370
1370
|
}
|
|
1371
|
-
else if (!g && h === "checked" &&
|
|
1371
|
+
else if (!g && h === "checked" && n instanceof HTMLInputElement)
|
|
1372
1372
|
try {
|
|
1373
|
-
|
|
1373
|
+
n.checked = !!l;
|
|
1374
1374
|
} catch {
|
|
1375
|
-
|
|
1375
|
+
n.setAttribute(h, String(l));
|
|
1376
1376
|
}
|
|
1377
|
-
else if (!g && h in
|
|
1377
|
+
else if (!g && h in n)
|
|
1378
1378
|
try {
|
|
1379
|
-
|
|
1379
|
+
n[h] = l;
|
|
1380
1380
|
} catch {
|
|
1381
|
-
|
|
1381
|
+
n.setAttribute(h, String(l));
|
|
1382
1382
|
}
|
|
1383
1383
|
else if ((e.props?.isCustomElement ?? !1) && !g && h.includes("-")) {
|
|
1384
|
-
const
|
|
1384
|
+
const x = it(h);
|
|
1385
1385
|
try {
|
|
1386
|
-
|
|
1386
|
+
n[x] = l;
|
|
1387
1387
|
} catch {
|
|
1388
|
-
|
|
1388
|
+
n.setAttribute(h, String(l));
|
|
1389
1389
|
}
|
|
1390
1390
|
} else
|
|
1391
|
-
|
|
1391
|
+
n.setAttribute(h, String(l));
|
|
1392
1392
|
}
|
|
1393
1393
|
}
|
|
1394
1394
|
for (const h in u) {
|
|
1395
1395
|
const l = u[h];
|
|
1396
1396
|
if (!(typeof h != "string" || /\[object Object\]/.test(h)))
|
|
1397
|
-
if (h === "value" && (
|
|
1397
|
+
if (h === "value" && (n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n instanceof HTMLSelectElement)) {
|
|
1398
1398
|
const d = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
|
|
1399
|
-
|
|
1400
|
-
} else if (h === "checked" &&
|
|
1399
|
+
n.value = d ?? "";
|
|
1400
|
+
} else if (h === "checked" && n instanceof HTMLInputElement) {
|
|
1401
1401
|
const d = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
|
|
1402
|
-
|
|
1402
|
+
n.checked = !!d;
|
|
1403
1403
|
} else if (h.startsWith("on") && typeof l == "function")
|
|
1404
|
-
oe.addListener(
|
|
1404
|
+
oe.addListener(n, ot(h), l);
|
|
1405
1405
|
else {
|
|
1406
1406
|
if (h.startsWith("on") && l === void 0)
|
|
1407
1407
|
continue;
|
|
1408
1408
|
if (l == null || l === !1)
|
|
1409
|
-
|
|
1410
|
-
else if ((e.props?.isCustomElement ?? !1) || h in
|
|
1409
|
+
n.removeAttribute(h);
|
|
1410
|
+
else if ((e.props?.isCustomElement ?? !1) || h in n)
|
|
1411
1411
|
try {
|
|
1412
|
-
const
|
|
1413
|
-
|
|
1412
|
+
const x = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
|
|
1413
|
+
n[h] = x;
|
|
1414
1414
|
} catch {
|
|
1415
1415
|
}
|
|
1416
1416
|
}
|
|
@@ -1418,7 +1418,7 @@ function X(e, t, n) {
|
|
|
1418
1418
|
for (const [h, l] of Object.entries(
|
|
1419
1419
|
a.listeners || {}
|
|
1420
1420
|
))
|
|
1421
|
-
oe.addListener(
|
|
1421
|
+
oe.addListener(n, h, l);
|
|
1422
1422
|
const b = {
|
|
1423
1423
|
...e,
|
|
1424
1424
|
props: {
|
|
@@ -1426,36 +1426,36 @@ function X(e, t, n) {
|
|
|
1426
1426
|
...a.props
|
|
1427
1427
|
}
|
|
1428
1428
|
};
|
|
1429
|
-
he(b,
|
|
1429
|
+
he(b, n, r);
|
|
1430
1430
|
try {
|
|
1431
|
-
if (typeof
|
|
1431
|
+
if (typeof n._applyProps == "function")
|
|
1432
1432
|
try {
|
|
1433
|
-
|
|
1433
|
+
n._applyProps(n._cfg);
|
|
1434
1434
|
} catch {
|
|
1435
1435
|
}
|
|
1436
|
-
typeof
|
|
1436
|
+
typeof n.requestRender == "function" ? n.requestRender() : typeof n._render == "function" && n._render(n._cfg);
|
|
1437
1437
|
} catch {
|
|
1438
1438
|
}
|
|
1439
1439
|
if (Array.isArray(e.children))
|
|
1440
1440
|
for (const h of e.children)
|
|
1441
|
-
|
|
1442
|
-
else typeof e.children == "string" && (
|
|
1441
|
+
n.appendChild(X(h, t, r));
|
|
1442
|
+
else typeof e.children == "string" && (n.textContent = e.children);
|
|
1443
1443
|
try {
|
|
1444
|
-
if (
|
|
1444
|
+
if (n instanceof HTMLSelectElement && m && m.hasOwnProperty("value"))
|
|
1445
1445
|
try {
|
|
1446
|
-
|
|
1446
|
+
n.value = m.value ?? "";
|
|
1447
1447
|
} catch {
|
|
1448
1448
|
}
|
|
1449
1449
|
} catch {
|
|
1450
1450
|
}
|
|
1451
|
-
return
|
|
1451
|
+
return n;
|
|
1452
1452
|
}
|
|
1453
|
-
function Rt(e, t,
|
|
1454
|
-
if (typeof
|
|
1455
|
-
e.textContent !==
|
|
1453
|
+
function Rt(e, t, r, n, i) {
|
|
1454
|
+
if (typeof r == "string") {
|
|
1455
|
+
e.textContent !== r && (e.textContent = r);
|
|
1456
1456
|
return;
|
|
1457
1457
|
}
|
|
1458
|
-
if (!Array.isArray(
|
|
1458
|
+
if (!Array.isArray(r)) return;
|
|
1459
1459
|
const s = Array.from(e.childNodes), o = Array.isArray(t) ? t : [], a = /* @__PURE__ */ new Map();
|
|
1460
1460
|
for (const l of o)
|
|
1461
1461
|
l && l.key != null && a.set(l.key, l);
|
|
@@ -1467,16 +1467,16 @@ function Rt(e, t, n, r, i) {
|
|
|
1467
1467
|
const m = /* @__PURE__ */ new Set();
|
|
1468
1468
|
let g = e.firstChild;
|
|
1469
1469
|
function b(l, d) {
|
|
1470
|
-
let
|
|
1471
|
-
for (;
|
|
1472
|
-
|
|
1470
|
+
let x = l;
|
|
1471
|
+
for (; x && (m.add(x), x !== d); )
|
|
1472
|
+
x = x.nextSibling;
|
|
1473
1473
|
}
|
|
1474
|
-
function h(l, d,
|
|
1474
|
+
function h(l, d, x, w) {
|
|
1475
1475
|
const c = [];
|
|
1476
1476
|
let p = l.nextSibling;
|
|
1477
1477
|
for (; p && p !== d; )
|
|
1478
1478
|
c.push(p), p = p.nextSibling;
|
|
1479
|
-
const y = Array.isArray(
|
|
1479
|
+
const y = Array.isArray(x) ? x : [];
|
|
1480
1480
|
if (w.some((k) => k && k.key != null) || y.some((k) => k && k.key != null)) {
|
|
1481
1481
|
const k = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
|
|
1482
1482
|
for (const _ of y)
|
|
@@ -1485,7 +1485,7 @@ function Rt(e, t, n, r, i) {
|
|
|
1485
1485
|
const $ = _.key;
|
|
1486
1486
|
$ != null && f.set($, _);
|
|
1487
1487
|
}
|
|
1488
|
-
const
|
|
1488
|
+
const v = /* @__PURE__ */ new Set();
|
|
1489
1489
|
let A = l.nextSibling;
|
|
1490
1490
|
for (const _ of w) {
|
|
1491
1491
|
let $;
|
|
@@ -1495,121 +1495,121 @@ function Rt(e, t, n, r, i) {
|
|
|
1495
1495
|
f.get(_.key),
|
|
1496
1496
|
T,
|
|
1497
1497
|
_,
|
|
1498
|
-
|
|
1499
|
-
),
|
|
1498
|
+
n
|
|
1499
|
+
), v.add($), $ !== A && e.contains($) && e.insertBefore($, A);
|
|
1500
1500
|
} else
|
|
1501
|
-
$ = X(_,
|
|
1501
|
+
$ = X(_, n), e.insertBefore($, A), v.add($);
|
|
1502
1502
|
A = $.nextSibling;
|
|
1503
1503
|
}
|
|
1504
1504
|
for (const _ of c)
|
|
1505
|
-
!
|
|
1505
|
+
!v.has(_) && e.contains(_) && e.removeChild(_);
|
|
1506
1506
|
} else {
|
|
1507
1507
|
const k = Math.min(
|
|
1508
1508
|
y.length,
|
|
1509
1509
|
w.length
|
|
1510
1510
|
);
|
|
1511
1511
|
for (let f = 0; f < k; f++) {
|
|
1512
|
-
const
|
|
1512
|
+
const v = y[f], A = w[f], _ = $e(c[f], v, A, n);
|
|
1513
1513
|
_ !== c[f] && (e.insertBefore(_, c[f]), e.removeChild(c[f]));
|
|
1514
1514
|
}
|
|
1515
1515
|
for (let f = k; f < w.length; f++)
|
|
1516
|
-
e.insertBefore(X(w[f],
|
|
1516
|
+
e.insertBefore(X(w[f], n), d);
|
|
1517
1517
|
for (let f = k; f < c.length; f++)
|
|
1518
1518
|
e.removeChild(c[f]);
|
|
1519
1519
|
}
|
|
1520
1520
|
}
|
|
1521
|
-
for (const l of
|
|
1521
|
+
for (const l of r) {
|
|
1522
1522
|
let d;
|
|
1523
1523
|
if (l.tag === "#anchor") {
|
|
1524
|
-
const
|
|
1524
|
+
const x = l.key, w = `${x}:start`, c = `${x}:end`;
|
|
1525
1525
|
let p = u.get(w), y = u.get(c);
|
|
1526
1526
|
const C = Array.isArray(l.children) ? l.children : [];
|
|
1527
1527
|
if (p || (p = document.createTextNode(""), p.key = w), y || (y = document.createTextNode(""), y.key = c), l._startNode = p, l._endNode = y, !e.contains(p) || !e.contains(y)) {
|
|
1528
1528
|
e.insertBefore(p, g);
|
|
1529
1529
|
for (const k of C)
|
|
1530
|
-
e.insertBefore(X(k,
|
|
1530
|
+
e.insertBefore(X(k, n), g);
|
|
1531
1531
|
e.insertBefore(y, g);
|
|
1532
1532
|
} else
|
|
1533
1533
|
h(
|
|
1534
1534
|
p,
|
|
1535
1535
|
y,
|
|
1536
|
-
a.get(
|
|
1536
|
+
a.get(x)?.children,
|
|
1537
1537
|
C
|
|
1538
1538
|
);
|
|
1539
1539
|
b(p, y), g = y.nextSibling;
|
|
1540
1540
|
continue;
|
|
1541
1541
|
}
|
|
1542
1542
|
if (l.key != null && u.has(l.key)) {
|
|
1543
|
-
const
|
|
1543
|
+
const x = a.get(l.key);
|
|
1544
1544
|
d = $e(
|
|
1545
1545
|
u.get(l.key),
|
|
1546
|
-
|
|
1546
|
+
x,
|
|
1547
1547
|
l,
|
|
1548
|
-
|
|
1548
|
+
n,
|
|
1549
1549
|
i
|
|
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, n, i), 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
1556
|
!m.has(l) && e.contains(l) && (ue(l, i), e.removeChild(l));
|
|
1557
1557
|
}
|
|
1558
|
-
function $e(e, t,
|
|
1559
|
-
if (t && typeof t != "string" && t.props?.ref && i && ue(e, i), t ===
|
|
1560
|
-
if (typeof
|
|
1558
|
+
function $e(e, t, r, n, i) {
|
|
1559
|
+
if (t && typeof t != "string" && t.props?.ref && i && ue(e, i), t === r) return e;
|
|
1560
|
+
if (typeof r == "string") {
|
|
1561
1561
|
if (e.nodeType === Node.TEXT_NODE)
|
|
1562
|
-
return e.textContent !==
|
|
1562
|
+
return e.textContent !== r && (e.textContent = r), e;
|
|
1563
1563
|
{
|
|
1564
|
-
const o = document.createTextNode(
|
|
1564
|
+
const o = document.createTextNode(r);
|
|
1565
1565
|
return e.parentNode?.replaceChild(o, e), o;
|
|
1566
1566
|
}
|
|
1567
1567
|
}
|
|
1568
|
-
if (
|
|
1569
|
-
const o =
|
|
1568
|
+
if (r && typeof r != "string" && r.tag === "#anchor") {
|
|
1569
|
+
const o = r, a = Array.isArray(o.children) ? o.children : [], u = o._startNode ?? document.createTextNode(""), m = o._endNode ?? document.createTextNode("");
|
|
1570
1570
|
o.key != null && (u.key = `${o.key}:start`, m.key = `${o.key}:end`), o._startNode = u, o._endNode = m;
|
|
1571
1571
|
const g = document.createDocumentFragment();
|
|
1572
1572
|
g.appendChild(u);
|
|
1573
1573
|
for (const b of a) {
|
|
1574
|
-
const h = X(b,
|
|
1574
|
+
const h = X(b, n);
|
|
1575
1575
|
g.appendChild(h);
|
|
1576
1576
|
}
|
|
1577
1577
|
return g.appendChild(m), e.parentNode?.replaceChild(g, e), u;
|
|
1578
1578
|
}
|
|
1579
|
-
if (!
|
|
1579
|
+
if (!r) {
|
|
1580
1580
|
ue(e, i);
|
|
1581
1581
|
const o = document.createComment("removed");
|
|
1582
1582
|
return e.parentNode?.replaceChild(o, e), o;
|
|
1583
1583
|
}
|
|
1584
1584
|
if (!t || typeof t == "string") {
|
|
1585
1585
|
ue(e, i);
|
|
1586
|
-
const o = X(
|
|
1587
|
-
return he(
|
|
1586
|
+
const o = X(r, n, i);
|
|
1587
|
+
return he(r, o, i), e.parentNode?.replaceChild(o, e), o;
|
|
1588
1588
|
}
|
|
1589
|
-
if (
|
|
1590
|
-
const o = Array.isArray(
|
|
1591
|
-
|
|
1589
|
+
if (r.tag === "#anchor") {
|
|
1590
|
+
const o = Array.isArray(r.children) ? r.children : [], a = r._startNode ?? document.createTextNode(""), u = r._endNode ?? document.createTextNode("");
|
|
1591
|
+
r.key != null && (a.key = `${r.key}:start`, u.key = `${r.key}:end`), r._startNode = a, r._endNode = u;
|
|
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, n));
|
|
1596
1596
|
return m.appendChild(u), e.parentNode?.replaceChild(m, e), a;
|
|
1597
1597
|
}
|
|
1598
|
-
if (typeof t != "string" && typeof
|
|
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 || {},
|
|
1600
|
+
return Ve(o, t.props || {}, r.props || {}, n), Rt(o, t.children, r.children, n, i), he(r, o, i), o;
|
|
1601
1601
|
}
|
|
1602
|
-
if (typeof t != "string" && typeof
|
|
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 || {},
|
|
1605
|
+
return Ve(a, t.props || {}, r.props || {}, n), he(r, a, i), a;
|
|
1606
1606
|
} catch {
|
|
1607
1607
|
}
|
|
1608
1608
|
ue(e, i);
|
|
1609
|
-
const s = X(
|
|
1610
|
-
return he(
|
|
1609
|
+
const s = X(r, n, i);
|
|
1610
|
+
return he(r, s, i), e.parentNode?.replaceChild(s, e), s;
|
|
1611
1611
|
}
|
|
1612
|
-
function Ot(e, t,
|
|
1612
|
+
function Ot(e, t, r, n) {
|
|
1613
1613
|
let i;
|
|
1614
1614
|
Array.isArray(t) ? t.length === 1 ? (i = t[0], i && typeof i == "object" && i.key == null && (i = { ...i, key: "__root__" })) : i = { tag: "div", key: "__root__", children: t } : (i = t, i && typeof i == "object" && i.key == null && (i = { ...i, key: "__root__" })), i && typeof i == "object" && i.tag === "#anchor" && (i = {
|
|
1615
1615
|
tag: "div",
|
|
@@ -1619,11 +1619,11 @@ function Ot(e, t, n, r) {
|
|
|
1619
1619
|
}), i = Be(i, String(i.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 i != "string" && s.tag === i.tag && s.key === i.key ? a = $e(o, s, i,
|
|
1622
|
+
s && o ? typeof s != "string" && typeof i != "string" && s.tag === i.tag && s.key === i.key ? a = $e(o, s, i, r, n) : (a = X(i, r, n), e.replaceChild(a, o)) : (a = X(i, r, n), 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, n), u.push(g));
|
|
1627
1627
|
}
|
|
1628
1628
|
u.forEach((m) => e.removeChild(m)), e._prevVNode = i, e._prevDom = a;
|
|
1629
1629
|
}
|
|
@@ -1635,16 +1635,16 @@ function Pe(e) {
|
|
|
1635
1635
|
return (Array.isArray(e.children) ? e.children.filter(Boolean) : []).map(Pe).join("");
|
|
1636
1636
|
let t = "";
|
|
1637
1637
|
e.props && e.props.attrs && (t = Object.entries(e.props.attrs).map(([i, s]) => ` ${i}="${ie(String(s))}"`).join(""));
|
|
1638
|
-
let
|
|
1639
|
-
e.props && (
|
|
1640
|
-
const
|
|
1641
|
-
return `<${e.tag}${t}${
|
|
1638
|
+
let r = "";
|
|
1639
|
+
e.props && (r = Object.entries(e.props).filter(([i]) => i !== "attrs" && i !== "directives" && i !== "ref" && i !== "key").map(([i, s]) => ` ${i}="${ie(String(s))}"`).join(""));
|
|
1640
|
+
const n = 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}>${n}</${e.tag}>`;
|
|
1642
1642
|
}
|
|
1643
1643
|
function Pt(e, ...t) {
|
|
1644
|
-
let
|
|
1645
|
-
for (let
|
|
1646
|
-
|
|
1647
|
-
return
|
|
1644
|
+
let r = "";
|
|
1645
|
+
for (let n = 0; n < e.length; n++)
|
|
1646
|
+
r += e[n], n < t.length && (r += t[n]);
|
|
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();
|
|
@@ -1814,9 +1814,9 @@ const Mt = Pt`
|
|
|
1814
1814
|
Object.entries(jt).map(([e, t]) => [
|
|
1815
1815
|
e,
|
|
1816
1816
|
Object.fromEntries(
|
|
1817
|
-
Object.entries(t).map(([
|
|
1818
|
-
|
|
1819
|
-
`var(--color-${e}${
|
|
1817
|
+
Object.entries(t).map(([r, n]) => [
|
|
1818
|
+
r,
|
|
1819
|
+
`var(--color-${e}${r === "DEFAULT" ? "" : `-${r}`}, ${n})`
|
|
1820
1820
|
])
|
|
1821
1821
|
)
|
|
1822
1822
|
])
|
|
@@ -1850,8 +1850,8 @@ const Mt = Pt`
|
|
|
1850
1850
|
"7xl": 320
|
|
1851
1851
|
}, zt = () => {
|
|
1852
1852
|
const e = {};
|
|
1853
|
-
for (const [t,
|
|
1854
|
-
e[`max-w-${t}`] = `max-width:calc(${le} * ${
|
|
1853
|
+
for (const [t, r] of Object.entries(Wt))
|
|
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
1857
|
const e = {};
|
|
@@ -1934,20 +1934,62 @@ const Mt = Pt`
|
|
|
1934
1934
|
"text-8xl": "font-size:6rem;line-height:1",
|
|
1935
1935
|
/* Borders */
|
|
1936
1936
|
border: "border-width:1px;",
|
|
1937
|
+
"border-t": "border-top-width:1px;",
|
|
1938
|
+
"border-r": "border-right-width:1px;",
|
|
1939
|
+
"border-b": "border-bottom-width:1px;",
|
|
1940
|
+
"border-l": "border-left-width:1px;",
|
|
1941
|
+
"border-x": "border-inline-width:1px;",
|
|
1942
|
+
"border-y": "border-block-width:1px;",
|
|
1937
1943
|
"border-2": "border-width:2px;",
|
|
1938
1944
|
"border-4": "border-width:4px;",
|
|
1939
1945
|
"border-6": "border-width:6px;",
|
|
1940
1946
|
"border-8": "border-width:8px;",
|
|
1941
1947
|
"rounded-none": "border-radius:0;",
|
|
1942
1948
|
"rounded-xs": "border-radius:0.125rem;",
|
|
1949
|
+
"rounded-t-xs": "border-top-left-radius:0.125rem;border-top-right-radius:0.125rem;",
|
|
1950
|
+
"rounded-r-xs": "border-top-right-radius:0.125rem;border-bottom-right-radius:0.125rem;",
|
|
1951
|
+
"rounded-b-xs": "border-bottom-left-radius:0.125rem;border-bottom-right-radius:0.125rem;",
|
|
1952
|
+
"rounded-l-xs": "border-top-left-radius:0.125rem;border-bottom-left-radius:0.125rem;",
|
|
1943
1953
|
"rounded-sm": "border-radius:0.25rem;",
|
|
1954
|
+
"rounded-t-sm": "border-top-left-radius:0.25rem;border-top-right-radius:0.25rem;",
|
|
1955
|
+
"rounded-r-sm": "border-top-right-radius:0.25rem;border-bottom-right-radius:0.25rem;",
|
|
1956
|
+
"rounded-b-sm": "border-bottom-left-radius:0.25rem;border-bottom-right-radius:0.25rem;",
|
|
1957
|
+
"rounded-l-sm": "border-top-left-radius:0.25rem;border-bottom-left-radius:0.25rem;",
|
|
1944
1958
|
"rounded-md": "border-radius:0.375rem;",
|
|
1959
|
+
"rounded-t-md": "border-top-left-radius:0.375rem;border-top-right-radius:0.375rem;",
|
|
1960
|
+
"rounded-r-md": "border-top-right-radius:0.375rem;border-bottom-right-radius:0.375rem;",
|
|
1961
|
+
"rounded-b-md": "border-bottom-left-radius:0.375rem;border-bottom-right-radius:0.375rem;",
|
|
1962
|
+
"rounded-l-md": "border-top-left-radius:0.375rem;border-bottom-left-radius:0.375rem;",
|
|
1945
1963
|
"rounded-lg": "border-radius:0.5rem;",
|
|
1964
|
+
"rounded-t-lg": "border-top-left-radius:0.5rem;border-top-right-radius:0.5rem;",
|
|
1965
|
+
"rounded-r-lg": "border-top-right-radius:0.5rem;border-bottom-right-radius:0.5rem;",
|
|
1966
|
+
"rounded-b-lg": "border-bottom-left-radius:0.5rem;border-bottom-right-radius:0.5rem;",
|
|
1967
|
+
"rounded-l-lg": "border-top-left-radius:0.5rem;border-bottom-left-radius:0.5rem;",
|
|
1946
1968
|
"rounded-xl": "border-radius:0.75rem;",
|
|
1969
|
+
"rounded-t-xl": "border-top-left-radius:0.75rem;border-top-right-radius:0.75rem;",
|
|
1970
|
+
"rounded-r-xl": "border-top-right-radius:0.75rem;border-bottom-right-radius:0.75rem;",
|
|
1971
|
+
"rounded-b-xl": "border-bottom-left-radius:0.75rem;border-bottom-right-radius:0.75rem;",
|
|
1972
|
+
"rounded-l-xl": "border-top-left-radius:0.75rem;border-bottom-left-radius:0.75rem;",
|
|
1947
1973
|
"rounded-2xl": "border-radius:1rem;",
|
|
1974
|
+
"rounded-t-2xl": "border-top-left-radius:1rem;border-top-right-radius:1rem;",
|
|
1975
|
+
"rounded-r-2xl": "border-top-right-radius:1rem;border-bottom-right-radius:1rem;",
|
|
1976
|
+
"rounded-b-2xl": "border-bottom-left-radius:1rem;border-bottom-right-radius:1rem;",
|
|
1977
|
+
"rounded-l-2xl": "border-top-left-radius:1rem;border-bottom-left-radius:1rem;",
|
|
1948
1978
|
"rounded-3xl": "border-radius:1.5rem;",
|
|
1979
|
+
"rounded-t-3xl": "border-top-left-radius:1.5rem;border-top-right-radius:1.5rem;",
|
|
1980
|
+
"rounded-r-3xl": "border-top-right-radius:1.5rem;border-bottom-right-radius:1.5rem;",
|
|
1981
|
+
"rounded-b-3xl": "border-bottom-left-radius:1.5rem;border-bottom-right-radius:1.5rem;",
|
|
1982
|
+
"rounded-l-3xl": "border-top-left-radius:1.5rem;border-bottom-left-radius:1.5rem;",
|
|
1949
1983
|
"rounded-4xl": "border-radius:2rem;",
|
|
1984
|
+
"rounded-t-4xl": "border-top-left-radius:2rem;border-top-right-radius:2rem;",
|
|
1985
|
+
"rounded-r-4xl": "border-top-right-radius:2rem;border-bottom-right-radius:2rem;",
|
|
1986
|
+
"rounded-b-4xl": "border-bottom-left-radius:2rem;border-bottom-right-radius:2rem;",
|
|
1987
|
+
"rounded-l-4xl": "border-top-left-radius:2rem;border-bottom-left-radius:2rem;",
|
|
1950
1988
|
"rounded-full": "border-radius:9999px;",
|
|
1989
|
+
"rounded-t-full": "border-top-left-radius:9999px;border-top-right-radius:9999px;",
|
|
1990
|
+
"rounded-r-full": "border-top-right-radius:9999px;border-bottom-right-radius:9999px;",
|
|
1991
|
+
"rounded-b-full": "border-bottom-left-radius:9999px;border-bottom-right-radius:9999px;",
|
|
1992
|
+
"rounded-l-full": "border-top-left-radius:9999px;border-bottom-left-radius:9999px;",
|
|
1951
1993
|
/* Shadow and effects */
|
|
1952
1994
|
// Shadows use a CSS variable for color so color utilities can modify --ce-shadow-color
|
|
1953
1995
|
"shadow-none": "--ce-shadow-color: rgb(0 0 0 / 0);box-shadow:0 0 var(--ce-shadow-color, #0000);",
|
|
@@ -2064,14 +2106,14 @@ const Mt = Pt`
|
|
|
2064
2106
|
"gap-y": ["row-gap"]
|
|
2065
2107
|
};
|
|
2066
2108
|
function G(e, t) {
|
|
2067
|
-
let
|
|
2109
|
+
let r = 0, n = 0;
|
|
2068
2110
|
for (let i = 0; i < e.length; i++) {
|
|
2069
2111
|
const s = e[i];
|
|
2070
|
-
if (s === "[")
|
|
2071
|
-
else if (s === "]" &&
|
|
2072
|
-
else if (s === "(")
|
|
2073
|
-
else if (s === ")" &&
|
|
2074
|
-
else if (
|
|
2112
|
+
if (s === "[") r++;
|
|
2113
|
+
else if (s === "]" && r > 0) r--;
|
|
2114
|
+
else if (s === "(") n++;
|
|
2115
|
+
else if (s === ")" && n > 0) n--;
|
|
2116
|
+
else if (r === 0 && n === 0 && (s === ">" || s === "+" || s === "~" || s === " "))
|
|
2075
2117
|
return e.slice(0, i) + t + e.slice(i);
|
|
2076
2118
|
}
|
|
2077
2119
|
return e + t;
|
|
@@ -2110,23 +2152,23 @@ const It = {
|
|
|
2110
2152
|
dark: "(prefers-color-scheme: dark)"
|
|
2111
2153
|
}, je = ["sm", "md", "lg", "xl", "2xl"];
|
|
2112
2154
|
function Ne(e) {
|
|
2113
|
-
const t = e.startsWith("-"),
|
|
2114
|
-
if (
|
|
2115
|
-
const i =
|
|
2155
|
+
const t = e.startsWith("-"), n = (t ? e.slice(1) : e).split("-");
|
|
2156
|
+
if (n.length < 2) return null;
|
|
2157
|
+
const i = n.slice(0, -1).join("-"), s = n[n.length - 1], o = parseFloat(s);
|
|
2116
2158
|
if (Number.isNaN(o) || !Ze[i]) return null;
|
|
2117
2159
|
const a = t ? "-" : "";
|
|
2118
2160
|
return Ze[i].map((u) => `${u}:calc(${a}${le} * ${o});`).join("");
|
|
2119
2161
|
}
|
|
2120
2162
|
function Ge(e) {
|
|
2121
|
-
const t = e.replace("#", ""),
|
|
2122
|
-
return `${
|
|
2163
|
+
const t = e.replace("#", ""), r = parseInt(t, 16), n = r >> 16 & 255, i = r >> 8 & 255, s = r & 255;
|
|
2164
|
+
return `${n} ${i} ${s}`;
|
|
2123
2165
|
}
|
|
2124
2166
|
function Ht(e) {
|
|
2125
2167
|
const t = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
|
|
2126
2168
|
if (!t) return null;
|
|
2127
|
-
const [,
|
|
2169
|
+
const [, r, n, i = "DEFAULT"] = t, s = Nt[n]?.[i];
|
|
2128
2170
|
if (!s) return null;
|
|
2129
|
-
if (
|
|
2171
|
+
if (r === "shadow") return `--ce-shadow-color:${s};`;
|
|
2130
2172
|
const a = {
|
|
2131
2173
|
bg: "background-color",
|
|
2132
2174
|
decoration: "text-decoration-color",
|
|
@@ -2137,33 +2179,33 @@ function Ht(e) {
|
|
|
2137
2179
|
accent: "accent-color",
|
|
2138
2180
|
fill: "fill",
|
|
2139
2181
|
stroke: "stroke"
|
|
2140
|
-
}[
|
|
2182
|
+
}[r];
|
|
2141
2183
|
return a ? `${a}:${s};` : null;
|
|
2142
2184
|
}
|
|
2143
2185
|
function Bt(e) {
|
|
2144
|
-
const [t,
|
|
2145
|
-
if (!
|
|
2146
|
-
const
|
|
2147
|
-
return isNaN(
|
|
2186
|
+
const [t, r] = e.split("/");
|
|
2187
|
+
if (!r) return { base: t };
|
|
2188
|
+
const n = parseInt(r, 10);
|
|
2189
|
+
return isNaN(n) || n < 0 || n > 100 ? { base: t } : { base: t, opacity: n / 100 };
|
|
2148
2190
|
}
|
|
2149
2191
|
function We(e) {
|
|
2150
|
-
const { base: t, opacity:
|
|
2151
|
-
if (
|
|
2152
|
-
if (
|
|
2153
|
-
const s = /#([0-9a-f]{6})/i.exec(
|
|
2192
|
+
const { base: t, opacity: r } = Bt(e), n = Ht(t);
|
|
2193
|
+
if (n) {
|
|
2194
|
+
if (r !== void 0) {
|
|
2195
|
+
const s = /#([0-9a-f]{6})/i.exec(n);
|
|
2154
2196
|
if (s) {
|
|
2155
2197
|
const o = Ge(s[0]);
|
|
2156
|
-
return
|
|
2198
|
+
return n.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
|
|
2157
2199
|
}
|
|
2158
2200
|
}
|
|
2159
|
-
return
|
|
2201
|
+
return n;
|
|
2160
2202
|
}
|
|
2161
2203
|
const i = Se(t);
|
|
2162
|
-
if (i &&
|
|
2204
|
+
if (i && r !== void 0) {
|
|
2163
2205
|
const s = /#([0-9a-f]{6})/i.exec(i);
|
|
2164
2206
|
if (s) {
|
|
2165
2207
|
const o = Ge(s[0]);
|
|
2166
|
-
return i.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${
|
|
2208
|
+
return i.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
|
|
2167
2209
|
}
|
|
2168
2210
|
}
|
|
2169
2211
|
return i;
|
|
@@ -2171,8 +2213,8 @@ function We(e) {
|
|
|
2171
2213
|
function ze(e) {
|
|
2172
2214
|
const t = /^opacity-(\d{1,3})$/.exec(e);
|
|
2173
2215
|
if (!t) return null;
|
|
2174
|
-
const
|
|
2175
|
-
return
|
|
2216
|
+
const r = parseInt(t[1], 10);
|
|
2217
|
+
return r < 0 || r > 100 ? null : `opacity:${r / 100};`;
|
|
2176
2218
|
}
|
|
2177
2219
|
function Se(e) {
|
|
2178
2220
|
if (e.startsWith("[") && e.endsWith("]") && !e.includes("-[")) {
|
|
@@ -2184,9 +2226,9 @@ function Se(e) {
|
|
|
2184
2226
|
}
|
|
2185
2227
|
return null;
|
|
2186
2228
|
}
|
|
2187
|
-
const t = e.indexOf("-["),
|
|
2188
|
-
if (t > 0 &&
|
|
2189
|
-
const
|
|
2229
|
+
const t = e.indexOf("-["), r = e.endsWith("]");
|
|
2230
|
+
if (t > 0 && r) {
|
|
2231
|
+
const n = e.slice(0, t);
|
|
2190
2232
|
let i = e.slice(t + 2, -1);
|
|
2191
2233
|
i = i.replace(/_/g, " ");
|
|
2192
2234
|
const s = {
|
|
@@ -2205,12 +2247,12 @@ function Se(e) {
|
|
|
2205
2247
|
"max-w": "max-width",
|
|
2206
2248
|
"min-h": "min-height",
|
|
2207
2249
|
"max-h": "max-height",
|
|
2208
|
-
"border-t": "border-top",
|
|
2209
|
-
"border-b": "border-bottom",
|
|
2210
|
-
"border-l": "border-left",
|
|
2211
|
-
"border-r": "border-right",
|
|
2212
|
-
"border-x": "border-inline",
|
|
2213
|
-
"border-y": "border-block",
|
|
2250
|
+
"border-t": "border-top-width",
|
|
2251
|
+
"border-b": "border-bottom-width",
|
|
2252
|
+
"border-l": "border-left-width",
|
|
2253
|
+
"border-r": "border-right-width",
|
|
2254
|
+
"border-x": "border-inline-width",
|
|
2255
|
+
"border-y": "border-block-width",
|
|
2214
2256
|
"grid-cols": "grid-template-columns",
|
|
2215
2257
|
"grid-rows": "grid-template-rows",
|
|
2216
2258
|
transition: "transition-property",
|
|
@@ -2233,22 +2275,22 @@ function Se(e) {
|
|
|
2233
2275
|
leading: "line-height",
|
|
2234
2276
|
z: "z-index"
|
|
2235
2277
|
};
|
|
2236
|
-
if (
|
|
2278
|
+
if (n === "rotate")
|
|
2237
2279
|
return `transform:rotate(${i});`;
|
|
2238
|
-
const o = s[
|
|
2280
|
+
const o = s[n] ?? n.replace(/_/g, "-");
|
|
2239
2281
|
if (o && i) return `${o}:${i};`;
|
|
2240
2282
|
}
|
|
2241
2283
|
return null;
|
|
2242
2284
|
}
|
|
2243
2285
|
function Ut(e) {
|
|
2244
2286
|
if (e.startsWith("[") && e.endsWith("]")) {
|
|
2245
|
-
const
|
|
2246
|
-
return
|
|
2287
|
+
const r = e.slice(1, -1);
|
|
2288
|
+
return r.includes("&") ? r : e;
|
|
2247
2289
|
}
|
|
2248
2290
|
const t = e.indexOf("-[");
|
|
2249
2291
|
if (t > 0 && e.endsWith("]")) {
|
|
2250
|
-
const
|
|
2251
|
-
return
|
|
2292
|
+
const r = e.slice(t + 2, -1).replace(/_/g, "-");
|
|
2293
|
+
return r.includes("&") ? r : e.replace(/_/g, "-");
|
|
2252
2294
|
}
|
|
2253
2295
|
return null;
|
|
2254
2296
|
}
|
|
@@ -2256,19 +2298,19 @@ function qt(e) {
|
|
|
2256
2298
|
return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
|
|
2257
2299
|
}
|
|
2258
2300
|
function Ft(e) {
|
|
2259
|
-
const t = /class\s*=\s*(['"])(.*?)\1/g,
|
|
2260
|
-
let
|
|
2261
|
-
for (;
|
|
2262
|
-
const i =
|
|
2263
|
-
i.length &&
|
|
2301
|
+
const t = /class\s*=\s*(['"])(.*?)\1/g, r = [];
|
|
2302
|
+
let n;
|
|
2303
|
+
for (; n = t.exec(e); ) {
|
|
2304
|
+
const i = n[2].split(/\s+/).filter(Boolean);
|
|
2305
|
+
i.length && r.push(...i);
|
|
2264
2306
|
}
|
|
2265
|
-
return
|
|
2307
|
+
return r.filter(Boolean);
|
|
2266
2308
|
}
|
|
2267
2309
|
const Xe = /* @__PURE__ */ new Map(), Kt = 16;
|
|
2268
2310
|
function Vt(e) {
|
|
2269
|
-
const t = Date.now(),
|
|
2270
|
-
if (
|
|
2271
|
-
const
|
|
2311
|
+
const t = Date.now(), r = Xe.get(e);
|
|
2312
|
+
if (r && t - r.timestamp < Kt) return r.css;
|
|
2313
|
+
const n = Ft(e), i = new Set(n), s = [], o = [], a = [], u = [], m = {};
|
|
2272
2314
|
function g(w, c = !1) {
|
|
2273
2315
|
const p = (c ? "dark|" : "") + w;
|
|
2274
2316
|
if (p in m) return m[p];
|
|
@@ -2325,8 +2367,8 @@ function Vt(e) {
|
|
|
2325
2367
|
if (!C) return null;
|
|
2326
2368
|
const k = C.replace(/^!/, ""), f = Le[k] ?? Ne(k) ?? ze(k) ?? We(k) ?? Se(k);
|
|
2327
2369
|
if (!f) return null;
|
|
2328
|
-
const
|
|
2329
|
-
let A =
|
|
2370
|
+
const v = p.indexOf(C);
|
|
2371
|
+
let A = v >= 0 ? p.slice(0, v) : [];
|
|
2330
2372
|
c && (A = A.filter((E) => E !== "dark"));
|
|
2331
2373
|
const _ = `.${qt(w)}`, $ = "__SUBJECT__", T = y ? f.replace(/;$/, " !important;") : f;
|
|
2332
2374
|
let R = $;
|
|
@@ -2404,40 +2446,40 @@ function Vt(e) {
|
|
|
2404
2446
|
f && (k === 1 ? s.push(f) : k === 2 ? o.push(f) : k === 3 && a.push(f));
|
|
2405
2447
|
}
|
|
2406
2448
|
}
|
|
2407
|
-
const
|
|
2408
|
-
return Xe.set(e, { css:
|
|
2449
|
+
const x = [...s, ...o, ...a, ...u].join("");
|
|
2450
|
+
return Xe.set(e, { css: x, timestamp: t }), x;
|
|
2409
2451
|
}
|
|
2410
2452
|
const ge = [];
|
|
2411
|
-
function Jt(e, t,
|
|
2453
|
+
function Jt(e, t, r, n, i, s, o, a) {
|
|
2412
2454
|
if (e) {
|
|
2413
|
-
ge.push(
|
|
2455
|
+
ge.push(r);
|
|
2414
2456
|
try {
|
|
2415
|
-
const u = t.render(
|
|
2457
|
+
const u = t.render(r);
|
|
2416
2458
|
if (u instanceof Promise) {
|
|
2417
2459
|
s(!0), u.then((m) => {
|
|
2418
|
-
s(!1), o(null), Ye(e, m,
|
|
2460
|
+
s(!1), o(null), Ye(e, m, r, n, i), a(e.innerHTML);
|
|
2419
2461
|
}).catch((m) => {
|
|
2420
2462
|
s(!1), o(m);
|
|
2421
2463
|
});
|
|
2422
2464
|
return;
|
|
2423
2465
|
}
|
|
2424
|
-
Ye(e, u,
|
|
2466
|
+
Ye(e, u, r, n, i), a(e.innerHTML);
|
|
2425
2467
|
} finally {
|
|
2426
2468
|
ge.pop();
|
|
2427
2469
|
}
|
|
2428
2470
|
}
|
|
2429
2471
|
}
|
|
2430
|
-
function Ye(e, t,
|
|
2472
|
+
function Ye(e, t, r, n, i) {
|
|
2431
2473
|
e && (Ot(
|
|
2432
2474
|
e,
|
|
2433
2475
|
Array.isArray(t) ? t : [t],
|
|
2434
|
-
|
|
2435
|
-
|
|
2476
|
+
r,
|
|
2477
|
+
n
|
|
2436
2478
|
), i(e.innerHTML));
|
|
2437
2479
|
}
|
|
2438
|
-
function Zt(e, t,
|
|
2480
|
+
function Zt(e, t, r, n, i, s, o) {
|
|
2439
2481
|
if (s !== null && clearTimeout(s), Date.now() - t < 16) {
|
|
2440
|
-
if (i(
|
|
2482
|
+
if (i(r + 1), r === 15)
|
|
2441
2483
|
console.warn(
|
|
2442
2484
|
`⚠️ Component is re-rendering rapidly. This might indicate:
|
|
2443
2485
|
Common causes:
|
|
@@ -2446,7 +2488,7 @@ function Zt(e, t, n, r, i, s, o) {
|
|
|
2446
2488
|
• Missing dependencies in computed/watch
|
|
2447
2489
|
Component rendering will be throttled to prevent browser freeze.`
|
|
2448
2490
|
);
|
|
2449
|
-
else if (
|
|
2491
|
+
else if (r > 20) {
|
|
2450
2492
|
console.error(
|
|
2451
2493
|
`🛑 Infinite loop detected in component render:
|
|
2452
2494
|
• This might be caused by state updates during render
|
|
@@ -2458,13 +2500,13 @@ Stopping runaway component render to prevent browser freeze`
|
|
|
2458
2500
|
} else
|
|
2459
2501
|
i(0);
|
|
2460
2502
|
const m = setTimeout(() => {
|
|
2461
|
-
|
|
2462
|
-
},
|
|
2503
|
+
n(Date.now()), e(), o(null);
|
|
2504
|
+
}, r > 10 ? 100 : 0);
|
|
2463
2505
|
o(m);
|
|
2464
2506
|
}
|
|
2465
|
-
function Gt(e, t,
|
|
2507
|
+
function Gt(e, t, r, n, i) {
|
|
2466
2508
|
if (!e) return;
|
|
2467
|
-
const s = Vt(
|
|
2509
|
+
const s = Vt(r);
|
|
2468
2510
|
if ((!s || s.trim() === "") && !t._computedStyle) {
|
|
2469
2511
|
i(null), e.adoptedStyleSheets = [Je()];
|
|
2470
2512
|
return;
|
|
@@ -2475,7 +2517,7 @@ function Gt(e, t, n, r, i) {
|
|
|
2475
2517
|
${s}
|
|
2476
2518
|
`);
|
|
2477
2519
|
a = ct(a);
|
|
2478
|
-
let u =
|
|
2520
|
+
let u = n;
|
|
2479
2521
|
u || (u = new CSSStyleSheet()), (u.cssRules.length === 0 || u.toString() !== a) && u.replaceSync(a), e.adoptedStyleSheets = [Je(), u], i(u);
|
|
2480
2522
|
}
|
|
2481
2523
|
let N = null;
|
|
@@ -2485,11 +2527,11 @@ function Xt(e) {
|
|
|
2485
2527
|
function Yt() {
|
|
2486
2528
|
N = null;
|
|
2487
2529
|
}
|
|
2488
|
-
function
|
|
2530
|
+
function pr() {
|
|
2489
2531
|
if (!N)
|
|
2490
2532
|
throw new Error("useEmit must be called during component render");
|
|
2491
2533
|
const e = N.emit;
|
|
2492
|
-
return (t,
|
|
2534
|
+
return (t, r) => e(t, r);
|
|
2493
2535
|
}
|
|
2494
2536
|
function ye(e) {
|
|
2495
2537
|
e._hookCallbacks || Object.defineProperty(e, "_hookCallbacks", {
|
|
@@ -2499,27 +2541,27 @@ function ye(e) {
|
|
|
2499
2541
|
configurable: !1
|
|
2500
2542
|
});
|
|
2501
2543
|
}
|
|
2502
|
-
function
|
|
2544
|
+
function hr(e) {
|
|
2503
2545
|
if (!N)
|
|
2504
2546
|
throw new Error("useOnConnected must be called during component render");
|
|
2505
2547
|
ye(N), N._hookCallbacks.onConnected = e;
|
|
2506
2548
|
}
|
|
2507
|
-
function
|
|
2549
|
+
function gr(e) {
|
|
2508
2550
|
if (!N)
|
|
2509
2551
|
throw new Error("useOnDisconnected must be called during component render");
|
|
2510
2552
|
ye(N), N._hookCallbacks.onDisconnected = e;
|
|
2511
2553
|
}
|
|
2512
|
-
function
|
|
2554
|
+
function mr(e) {
|
|
2513
2555
|
if (!N)
|
|
2514
2556
|
throw new Error("useOnAttributeChanged must be called during component render");
|
|
2515
2557
|
ye(N), N._hookCallbacks.onAttributeChanged = e;
|
|
2516
2558
|
}
|
|
2517
|
-
function
|
|
2559
|
+
function yr(e) {
|
|
2518
2560
|
if (!N)
|
|
2519
2561
|
throw new Error("useOnError must be called during component render");
|
|
2520
2562
|
ye(N), N._hookCallbacks.onError = e;
|
|
2521
2563
|
}
|
|
2522
|
-
function
|
|
2564
|
+
function br(e) {
|
|
2523
2565
|
if (!N)
|
|
2524
2566
|
throw new Error("useStyle must be called during component render");
|
|
2525
2567
|
ye(N);
|
|
@@ -2591,33 +2633,33 @@ function Qt(e, t) {
|
|
|
2591
2633
|
_templateError = null;
|
|
2592
2634
|
constructor() {
|
|
2593
2635
|
super(), this.attachShadow({ mode: "open" }), this._cfg = Te.get(e) || t, this._componentId = `${e}-${Math.random().toString(36).substr(2, 9)}`;
|
|
2594
|
-
const
|
|
2595
|
-
Object.defineProperty(
|
|
2636
|
+
const r = this._initContext(t);
|
|
2637
|
+
Object.defineProperty(r, "refs", {
|
|
2596
2638
|
value: this._refs,
|
|
2597
2639
|
writable: !1,
|
|
2598
2640
|
enumerable: !1,
|
|
2599
2641
|
configurable: !1
|
|
2600
|
-
}), Object.defineProperty(
|
|
2642
|
+
}), Object.defineProperty(r, "requestRender", {
|
|
2601
2643
|
value: () => this.requestRender(),
|
|
2602
2644
|
writable: !1,
|
|
2603
2645
|
enumerable: !1,
|
|
2604
2646
|
configurable: !1
|
|
2605
|
-
}), Object.defineProperty(
|
|
2647
|
+
}), Object.defineProperty(r, "_requestRender", {
|
|
2606
2648
|
value: () => this._requestRender(),
|
|
2607
2649
|
writable: !1,
|
|
2608
2650
|
enumerable: !1,
|
|
2609
2651
|
configurable: !1
|
|
2610
|
-
}), Object.defineProperty(
|
|
2652
|
+
}), Object.defineProperty(r, "_componentId", {
|
|
2611
2653
|
value: this._componentId,
|
|
2612
2654
|
writable: !1,
|
|
2613
2655
|
enumerable: !1,
|
|
2614
2656
|
configurable: !1
|
|
2615
|
-
}), Object.defineProperty(
|
|
2657
|
+
}), Object.defineProperty(r, "_triggerWatchers", {
|
|
2616
2658
|
value: (i, s) => this._triggerWatchers(i, s),
|
|
2617
2659
|
writable: !1,
|
|
2618
2660
|
enumerable: !1,
|
|
2619
2661
|
configurable: !1
|
|
2620
|
-
}), this.context =
|
|
2662
|
+
}), this.context = r, Object.defineProperty(this.context, "emit", {
|
|
2621
2663
|
value: (i, s, o) => {
|
|
2622
2664
|
const a = new CustomEvent(i, {
|
|
2623
2665
|
detail: s,
|
|
@@ -2631,11 +2673,11 @@ function Qt(e, t) {
|
|
|
2631
2673
|
enumerable: !1,
|
|
2632
2674
|
configurable: !1
|
|
2633
2675
|
});
|
|
2634
|
-
const
|
|
2635
|
-
Object.keys(
|
|
2636
|
-
const s =
|
|
2676
|
+
const n = Te.get(e) || t;
|
|
2677
|
+
Object.keys(n).forEach((i) => {
|
|
2678
|
+
const s = n[i];
|
|
2637
2679
|
typeof s == "function" && (this.context[i] = (...o) => s(...o, this.context));
|
|
2638
|
-
}), this._applyComputed(
|
|
2680
|
+
}), this._applyComputed(n), n.props && Object.keys(n.props).forEach((i) => {
|
|
2639
2681
|
let s = this[i];
|
|
2640
2682
|
Object.defineProperty(this, i, {
|
|
2641
2683
|
get() {
|
|
@@ -2643,28 +2685,28 @@ function Qt(e, t) {
|
|
|
2643
2685
|
},
|
|
2644
2686
|
set(o) {
|
|
2645
2687
|
const a = s;
|
|
2646
|
-
s = o, this.context[i] = o, this._initializing || (this._applyProps(
|
|
2688
|
+
s = o, this.context[i] = o, this._initializing || (this._applyProps(n), a !== o && this._requestRender());
|
|
2647
2689
|
},
|
|
2648
2690
|
enumerable: !0,
|
|
2649
2691
|
configurable: !0
|
|
2650
2692
|
});
|
|
2651
|
-
}), this._initializing = !1, this._initWatchers(
|
|
2693
|
+
}), this._initializing = !1, this._initWatchers(n), this._applyProps(n), this._render(n);
|
|
2652
2694
|
}
|
|
2653
2695
|
connectedCallback() {
|
|
2654
2696
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
2655
|
-
this._applyProps(t), this._requestRender(),
|
|
2697
|
+
this._applyProps(t), this._requestRender(), xt(
|
|
2656
2698
|
t,
|
|
2657
2699
|
this.context,
|
|
2658
2700
|
this._mounted,
|
|
2659
|
-
(
|
|
2660
|
-
this._mounted =
|
|
2701
|
+
(r) => {
|
|
2702
|
+
this._mounted = r;
|
|
2661
2703
|
}
|
|
2662
2704
|
);
|
|
2663
2705
|
});
|
|
2664
2706
|
}
|
|
2665
2707
|
disconnectedCallback() {
|
|
2666
2708
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
2667
|
-
|
|
2709
|
+
vt(
|
|
2668
2710
|
t,
|
|
2669
2711
|
this.context,
|
|
2670
2712
|
this._listeners,
|
|
@@ -2674,52 +2716,52 @@ function Qt(e, t) {
|
|
|
2674
2716
|
() => {
|
|
2675
2717
|
this._watchers.clear();
|
|
2676
2718
|
},
|
|
2677
|
-
(
|
|
2678
|
-
this._templateLoading =
|
|
2719
|
+
(r) => {
|
|
2720
|
+
this._templateLoading = r;
|
|
2679
2721
|
},
|
|
2680
|
-
(
|
|
2681
|
-
this._templateError =
|
|
2722
|
+
(r) => {
|
|
2723
|
+
this._templateError = r;
|
|
2682
2724
|
},
|
|
2683
|
-
(
|
|
2684
|
-
this._mounted =
|
|
2725
|
+
(r) => {
|
|
2726
|
+
this._mounted = r;
|
|
2685
2727
|
}
|
|
2686
2728
|
);
|
|
2687
2729
|
});
|
|
2688
2730
|
}
|
|
2689
|
-
attributeChangedCallback(
|
|
2731
|
+
attributeChangedCallback(r, n, i) {
|
|
2690
2732
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
2691
|
-
this._applyProps(t),
|
|
2733
|
+
this._applyProps(t), n !== i && this._requestRender(), kt(
|
|
2692
2734
|
t,
|
|
2693
|
-
n,
|
|
2694
2735
|
r,
|
|
2736
|
+
n,
|
|
2695
2737
|
i,
|
|
2696
2738
|
this.context
|
|
2697
2739
|
);
|
|
2698
2740
|
});
|
|
2699
2741
|
}
|
|
2700
2742
|
static get observedAttributes() {
|
|
2701
|
-
return t.props ? Object.keys(t.props).map(
|
|
2743
|
+
return t.props ? Object.keys(t.props).map(re) : [];
|
|
2702
2744
|
}
|
|
2703
|
-
_applyComputed(
|
|
2745
|
+
_applyComputed(r) {
|
|
2704
2746
|
}
|
|
2705
2747
|
// --- Render ---
|
|
2706
|
-
_render(
|
|
2707
|
-
this._runLogicWithinErrorBoundary(
|
|
2748
|
+
_render(r) {
|
|
2749
|
+
this._runLogicWithinErrorBoundary(r, () => {
|
|
2708
2750
|
Jt(
|
|
2709
2751
|
this.shadowRoot,
|
|
2710
|
-
|
|
2752
|
+
r,
|
|
2711
2753
|
this.context,
|
|
2712
2754
|
this._refs,
|
|
2713
|
-
(
|
|
2714
|
-
this._lastHtmlStringForJitCSS =
|
|
2755
|
+
(n) => {
|
|
2756
|
+
this._lastHtmlStringForJitCSS = n, typeof this.onHtmlStringUpdate == "function" && this.onHtmlStringUpdate(n);
|
|
2715
2757
|
},
|
|
2716
|
-
(
|
|
2717
|
-
this._templateLoading =
|
|
2758
|
+
(n) => {
|
|
2759
|
+
this._templateLoading = n, typeof this.onLoadingStateChange == "function" && this.onLoadingStateChange(n);
|
|
2718
2760
|
},
|
|
2719
|
-
(
|
|
2720
|
-
this._templateError =
|
|
2761
|
+
(n) => {
|
|
2762
|
+
this._templateError = n, typeof this.onErrorStateChange == "function" && this.onErrorStateChange(n);
|
|
2721
2763
|
},
|
|
2722
|
-
(
|
|
2764
|
+
(n) => this._applyStyle(r, n)
|
|
2723
2765
|
);
|
|
2724
2766
|
});
|
|
2725
2767
|
}
|
|
@@ -2733,27 +2775,27 @@ function Qt(e, t) {
|
|
|
2733
2775
|
() => this._render(this._cfg),
|
|
2734
2776
|
this._lastRenderTime,
|
|
2735
2777
|
this._renderCount,
|
|
2736
|
-
(
|
|
2737
|
-
this._lastRenderTime =
|
|
2778
|
+
(r) => {
|
|
2779
|
+
this._lastRenderTime = r;
|
|
2738
2780
|
},
|
|
2739
|
-
(
|
|
2740
|
-
this._renderCount =
|
|
2781
|
+
(r) => {
|
|
2782
|
+
this._renderCount = r;
|
|
2741
2783
|
},
|
|
2742
2784
|
this._renderTimeoutId,
|
|
2743
|
-
(
|
|
2744
|
-
this._renderTimeoutId =
|
|
2785
|
+
(r) => {
|
|
2786
|
+
this._renderTimeoutId = r;
|
|
2745
2787
|
}
|
|
2746
2788
|
);
|
|
2747
2789
|
}, this._componentId);
|
|
2748
2790
|
});
|
|
2749
2791
|
}
|
|
2750
2792
|
// --- Style ---
|
|
2751
|
-
_applyStyle(
|
|
2752
|
-
this._runLogicWithinErrorBoundary(
|
|
2793
|
+
_applyStyle(r, n) {
|
|
2794
|
+
this._runLogicWithinErrorBoundary(r, () => {
|
|
2753
2795
|
Gt(
|
|
2754
2796
|
this.shadowRoot,
|
|
2755
2797
|
this.context,
|
|
2756
|
-
|
|
2798
|
+
n,
|
|
2757
2799
|
this._styleSheet,
|
|
2758
2800
|
(i) => {
|
|
2759
2801
|
this._styleSheet = i;
|
|
@@ -2762,18 +2804,18 @@ function Qt(e, t) {
|
|
|
2762
2804
|
});
|
|
2763
2805
|
}
|
|
2764
2806
|
// --- Error Boundary function ---
|
|
2765
|
-
_runLogicWithinErrorBoundary(
|
|
2807
|
+
_runLogicWithinErrorBoundary(r, n) {
|
|
2766
2808
|
this._hasError && (this._hasError = !1);
|
|
2767
2809
|
try {
|
|
2768
|
-
|
|
2810
|
+
n();
|
|
2769
2811
|
} catch (i) {
|
|
2770
|
-
this._hasError = !0,
|
|
2812
|
+
this._hasError = !0, r.onError && r.onError(i, this.context);
|
|
2771
2813
|
}
|
|
2772
2814
|
}
|
|
2773
2815
|
// --- State, props, computed ---
|
|
2774
|
-
_initContext(
|
|
2816
|
+
_initContext(r) {
|
|
2775
2817
|
try {
|
|
2776
|
-
let
|
|
2818
|
+
let n = function(s, o = "") {
|
|
2777
2819
|
return Array.isArray(s) ? new Proxy(s, {
|
|
2778
2820
|
get(a, u, m) {
|
|
2779
2821
|
const g = Reflect.get(a, u, m);
|
|
@@ -2789,7 +2831,7 @@ function Qt(e, t) {
|
|
|
2789
2831
|
const l = g.apply(a, h);
|
|
2790
2832
|
if (!i._initializing) {
|
|
2791
2833
|
const d = o || "root";
|
|
2792
|
-
i._triggerWatchers(d, a), fe(() => i._render(
|
|
2834
|
+
i._triggerWatchers(d, a), fe(() => i._render(r), i._componentId);
|
|
2793
2835
|
}
|
|
2794
2836
|
return l;
|
|
2795
2837
|
} : g;
|
|
@@ -2797,27 +2839,27 @@ function Qt(e, t) {
|
|
|
2797
2839
|
set(a, u, m) {
|
|
2798
2840
|
if (a[u] = m, !i._initializing) {
|
|
2799
2841
|
const g = o ? `${o}.${String(u)}` : String(u);
|
|
2800
|
-
i._triggerWatchers(g, m), fe(() => i._render(
|
|
2842
|
+
i._triggerWatchers(g, m), fe(() => i._render(r), i._componentId);
|
|
2801
2843
|
}
|
|
2802
2844
|
return !0;
|
|
2803
2845
|
},
|
|
2804
2846
|
deleteProperty(a, u) {
|
|
2805
2847
|
if (delete a[u], !i._initializing) {
|
|
2806
2848
|
const m = o ? `${o}.${String(u)}` : String(u);
|
|
2807
|
-
i._triggerWatchers(m, void 0), fe(() => i._render(
|
|
2849
|
+
i._triggerWatchers(m, void 0), fe(() => i._render(r), i._componentId);
|
|
2808
2850
|
}
|
|
2809
2851
|
return !0;
|
|
2810
2852
|
}
|
|
2811
2853
|
}) : s && typeof s == "object" ? s.constructor && s.constructor.name === "ReactiveState" ? s : (Object.keys(s).forEach((a) => {
|
|
2812
2854
|
const u = o ? `${o}.${a}` : a;
|
|
2813
|
-
s[a] =
|
|
2855
|
+
s[a] = n(s[a], u);
|
|
2814
2856
|
}), new Proxy(s, {
|
|
2815
2857
|
set(a, u, m) {
|
|
2816
2858
|
const g = o ? `${o}.${String(u)}` : String(u);
|
|
2817
|
-
return a[u] =
|
|
2859
|
+
return a[u] = n(m, g), i._initializing || (i._triggerWatchers(
|
|
2818
2860
|
g,
|
|
2819
2861
|
a[u]
|
|
2820
|
-
), fe(() => i._render(
|
|
2862
|
+
), fe(() => i._render(r), i._componentId)), !0;
|
|
2821
2863
|
},
|
|
2822
2864
|
get(a, u, m) {
|
|
2823
2865
|
return Reflect.get(a, u, m);
|
|
@@ -2825,19 +2867,19 @@ function Qt(e, t) {
|
|
|
2825
2867
|
})) : s;
|
|
2826
2868
|
};
|
|
2827
2869
|
const i = this;
|
|
2828
|
-
return
|
|
2870
|
+
return n({
|
|
2829
2871
|
// For functional components, state is managed by state() function calls
|
|
2830
2872
|
// Include prop defaults in initial reactive context so prop updates trigger reactivity
|
|
2831
|
-
...
|
|
2832
|
-
Object.entries(
|
|
2873
|
+
...r.props ? Object.fromEntries(
|
|
2874
|
+
Object.entries(r.props).map(([s, o]) => [s, o.default])
|
|
2833
2875
|
) : {}
|
|
2834
2876
|
});
|
|
2835
2877
|
} catch {
|
|
2836
2878
|
return {};
|
|
2837
2879
|
}
|
|
2838
2880
|
}
|
|
2839
|
-
_initWatchers(
|
|
2840
|
-
this._runLogicWithinErrorBoundary(
|
|
2881
|
+
_initWatchers(r) {
|
|
2882
|
+
this._runLogicWithinErrorBoundary(r, () => {
|
|
2841
2883
|
mt(
|
|
2842
2884
|
this.context,
|
|
2843
2885
|
this._watchers,
|
|
@@ -2846,24 +2888,24 @@ function Qt(e, t) {
|
|
|
2846
2888
|
);
|
|
2847
2889
|
});
|
|
2848
2890
|
}
|
|
2849
|
-
_triggerWatchers(
|
|
2850
|
-
yt(this.context, this._watchers,
|
|
2891
|
+
_triggerWatchers(r, n) {
|
|
2892
|
+
yt(this.context, this._watchers, r, n);
|
|
2851
2893
|
}
|
|
2852
|
-
_applyProps(
|
|
2853
|
-
this._runLogicWithinErrorBoundary(
|
|
2894
|
+
_applyProps(r) {
|
|
2895
|
+
this._runLogicWithinErrorBoundary(r, () => {
|
|
2854
2896
|
try {
|
|
2855
|
-
wt(this,
|
|
2856
|
-
} catch (
|
|
2857
|
-
this._hasError = !0,
|
|
2897
|
+
wt(this, r, this.context);
|
|
2898
|
+
} catch (n) {
|
|
2899
|
+
this._hasError = !0, r.onError && r.onError(n, this.context);
|
|
2858
2900
|
}
|
|
2859
2901
|
});
|
|
2860
2902
|
}
|
|
2861
2903
|
};
|
|
2862
2904
|
}
|
|
2863
2905
|
function et(e, t) {
|
|
2864
|
-
let
|
|
2865
|
-
|
|
2866
|
-
let
|
|
2906
|
+
let r = re(e);
|
|
2907
|
+
r.includes("-") || (r = `cer-${r}`);
|
|
2908
|
+
let n = {};
|
|
2867
2909
|
if (typeof window < "u")
|
|
2868
2910
|
try {
|
|
2869
2911
|
const a = t.toString().match(/\(\s*{\s*([^}]+)\s*}/);
|
|
@@ -2874,13 +2916,13 @@ function et(e, t) {
|
|
|
2874
2916
|
if (b !== -1) {
|
|
2875
2917
|
const h = g.substring(0, b).trim(), l = g.substring(b + 1).trim();
|
|
2876
2918
|
try {
|
|
2877
|
-
l === "true" ?
|
|
2919
|
+
l === "true" ? n[h] = !0 : l === "false" ? n[h] = !1 : l === "[]" ? n[h] = [] : l === "{}" ? n[h] = {} : /^\d+$/.test(l) ? n[h] = parseInt(l) : /^'.*'$/.test(l) || /^".*"$/.test(l) ? n[h] = l.slice(1, -1) : n[h] = l;
|
|
2878
2920
|
} catch {
|
|
2879
|
-
|
|
2921
|
+
n[h] = "";
|
|
2880
2922
|
}
|
|
2881
2923
|
} else {
|
|
2882
2924
|
const h = g.split(":")[0].trim();
|
|
2883
|
-
h && !h.includes("}") && (
|
|
2925
|
+
h && !h.includes("}") && (n[h] = "");
|
|
2884
2926
|
}
|
|
2885
2927
|
}
|
|
2886
2928
|
}
|
|
@@ -2890,7 +2932,7 @@ function et(e, t) {
|
|
|
2890
2932
|
const s = {
|
|
2891
2933
|
// Generate props config from defaults
|
|
2892
2934
|
props: Object.fromEntries(
|
|
2893
|
-
Object.entries(
|
|
2935
|
+
Object.entries(n).map(([o, a]) => [o, { type: typeof a == "boolean" ? Boolean : typeof a == "number" ? Number : typeof a == "string" ? String : Function, default: a }])
|
|
2894
2936
|
),
|
|
2895
2937
|
// Add lifecycle hooks from the stored functions
|
|
2896
2938
|
onConnected: (o) => {
|
|
@@ -2906,18 +2948,18 @@ function et(e, t) {
|
|
|
2906
2948
|
i.onError && o && i.onError(o);
|
|
2907
2949
|
},
|
|
2908
2950
|
render: (o) => {
|
|
2909
|
-
const a = o._componentId || `${
|
|
2951
|
+
const a = o._componentId || `${r}-${Math.random().toString(36).substr(2, 9)}`;
|
|
2910
2952
|
F.setCurrentComponent(a, () => {
|
|
2911
2953
|
o.requestRender && o.requestRender();
|
|
2912
2954
|
});
|
|
2913
2955
|
try {
|
|
2914
2956
|
Xt(o);
|
|
2915
|
-
const u = Object.keys(
|
|
2957
|
+
const u = Object.keys(n).length > 0;
|
|
2916
2958
|
let m;
|
|
2917
2959
|
if (u) {
|
|
2918
2960
|
const g = {};
|
|
2919
|
-
Object.keys(
|
|
2920
|
-
g[b] = o[b] ??
|
|
2961
|
+
Object.keys(n).forEach((b) => {
|
|
2962
|
+
g[b] = o[b] ?? n[b];
|
|
2921
2963
|
}), m = t(g);
|
|
2922
2964
|
} else
|
|
2923
2965
|
m = t();
|
|
@@ -2931,23 +2973,23 @@ function et(e, t) {
|
|
|
2931
2973
|
}
|
|
2932
2974
|
}
|
|
2933
2975
|
};
|
|
2934
|
-
Te.set(
|
|
2976
|
+
Te.set(r, s), typeof window < "u" && (customElements.get(r) || customElements.define(r, Qt(r, s)));
|
|
2935
2977
|
}
|
|
2936
|
-
class
|
|
2978
|
+
class er {
|
|
2937
2979
|
map = /* @__PURE__ */ new Map();
|
|
2938
2980
|
maxSize;
|
|
2939
2981
|
constructor(t) {
|
|
2940
2982
|
this.maxSize = t;
|
|
2941
2983
|
}
|
|
2942
2984
|
get(t) {
|
|
2943
|
-
const
|
|
2944
|
-
if (
|
|
2945
|
-
return this.map.delete(t), this.map.set(t,
|
|
2985
|
+
const r = this.map.get(t);
|
|
2986
|
+
if (r !== void 0)
|
|
2987
|
+
return this.map.delete(t), this.map.set(t, r), r;
|
|
2946
2988
|
}
|
|
2947
|
-
set(t,
|
|
2948
|
-
if (this.map.has(t) && this.map.delete(t), this.map.set(t,
|
|
2949
|
-
const
|
|
2950
|
-
|
|
2989
|
+
set(t, r) {
|
|
2990
|
+
if (this.map.has(t) && this.map.delete(t), this.map.set(t, r), this.map.size > this.maxSize) {
|
|
2991
|
+
const n = this.map.keys().next().value;
|
|
2992
|
+
n !== void 0 && this.map.delete(n);
|
|
2951
2993
|
}
|
|
2952
2994
|
}
|
|
2953
2995
|
has(t) {
|
|
@@ -2957,8 +2999,8 @@ class en {
|
|
|
2957
2999
|
this.map.clear();
|
|
2958
3000
|
}
|
|
2959
3001
|
}
|
|
2960
|
-
const De = new
|
|
2961
|
-
function
|
|
3002
|
+
const De = new er(500);
|
|
3003
|
+
function tr(e, t) {
|
|
2962
3004
|
if (e == null) {
|
|
2963
3005
|
console.warn(
|
|
2964
3006
|
`⚠️ Event handler for '@${t}' is ${e}. This will prevent the event from working. Use a function reference instead: @${t}="\${functionName}"`
|
|
@@ -2971,9 +3013,9 @@ function tn(e, t) {
|
|
|
2971
3013
|
`💡 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()}"`
|
|
2972
3014
|
);
|
|
2973
3015
|
}
|
|
2974
|
-
function pe(e, t = {},
|
|
2975
|
-
const i =
|
|
2976
|
-
return { tag: e, key: i, props: t, children:
|
|
3016
|
+
function pe(e, t = {}, r, n) {
|
|
3017
|
+
const i = n ?? t.key;
|
|
3018
|
+
return { tag: e, key: i, props: t, children: r };
|
|
2977
3019
|
}
|
|
2978
3020
|
function Ae(e) {
|
|
2979
3021
|
return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
|
|
@@ -2981,11 +3023,11 @@ function Ae(e) {
|
|
|
2981
3023
|
function _e(e) {
|
|
2982
3024
|
return typeof e == "object" && e !== null && "tag" in e && !Ae(e);
|
|
2983
3025
|
}
|
|
2984
|
-
function
|
|
3026
|
+
function rr(e, t) {
|
|
2985
3027
|
return e.key != null ? e : { ...e, key: t };
|
|
2986
3028
|
}
|
|
2987
|
-
function
|
|
2988
|
-
const
|
|
3029
|
+
function nr(e, t = [], r = {}) {
|
|
3030
|
+
const n = {}, i = {}, s = {}, o = [], a = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
|
|
2989
3031
|
let u;
|
|
2990
3032
|
for (; u = a.exec(e); ) {
|
|
2991
3033
|
const m = u[1], g = u[2], b = (u[4] || u[6]) ?? "", h = b.match(/^{{(\d+)}}$/);
|
|
@@ -2993,7 +3035,7 @@ function rn(e, t = [], n = {}) {
|
|
|
2993
3035
|
h || (l === "true" ? l = !0 : l === "false" ? l = !1 : l === "null" ? l = null : isNaN(Number(l)) || (l = Number(l)));
|
|
2994
3036
|
const d = ["model", "bind", "show", "class", "style", "ref"];
|
|
2995
3037
|
if (m === ":") {
|
|
2996
|
-
const [
|
|
3038
|
+
const [x, w] = g.split(":"), [c, ...p] = x.split(".");
|
|
2997
3039
|
if (d.includes(c)) {
|
|
2998
3040
|
const y = [...p], C = c === "model" && w ? `model:${w}` : c;
|
|
2999
3041
|
s[C] = {
|
|
@@ -3006,55 +3048,55 @@ function rn(e, t = [], n = {}) {
|
|
|
3006
3048
|
y && ee(y) && (y = y.value), i[g] = y, o.push(g);
|
|
3007
3049
|
}
|
|
3008
3050
|
} else if (m === "@") {
|
|
3009
|
-
const [
|
|
3010
|
-
|
|
3011
|
-
const p = typeof l == "function" ? l : typeof
|
|
3051
|
+
const [x, ...w] = g.split("."), c = w;
|
|
3052
|
+
tr(l, x);
|
|
3053
|
+
const p = typeof l == "function" ? l : typeof r[l] == "function" ? r[l] : void 0;
|
|
3012
3054
|
if (p) {
|
|
3013
3055
|
const y = (k) => {
|
|
3014
3056
|
if (c.includes("prevent") && k.preventDefault(), c.includes("stop") && k.stopPropagation(), !(c.includes("self") && k.target !== k.currentTarget))
|
|
3015
|
-
return c.includes("once") && k.currentTarget?.removeEventListener(
|
|
3016
|
-
}, C = "on" +
|
|
3017
|
-
|
|
3057
|
+
return c.includes("once") && k.currentTarget?.removeEventListener(x, y), p(k);
|
|
3058
|
+
}, C = "on" + x.charAt(0).toUpperCase() + x.slice(1);
|
|
3059
|
+
n[C] = y;
|
|
3018
3060
|
}
|
|
3019
|
-
} else g === "ref" ?
|
|
3061
|
+
} else g === "ref" ? n.ref = l : i[g] = l;
|
|
3020
3062
|
}
|
|
3021
|
-
return { props:
|
|
3063
|
+
return { props: n, attrs: i, directives: s, bound: o };
|
|
3022
3064
|
}
|
|
3023
|
-
function
|
|
3024
|
-
const
|
|
3065
|
+
function ir(e, t, r) {
|
|
3066
|
+
const n = ge.length > 0 ? ge[ge.length - 1] : void 0, i = r ?? n, s = !r && t.length === 0, o = s ? e.join("<!--TEMPLATE_DELIM-->") : null;
|
|
3025
3067
|
if (s && o) {
|
|
3026
3068
|
const f = De.get(o);
|
|
3027
3069
|
if (f) return f;
|
|
3028
3070
|
}
|
|
3029
|
-
function a(f,
|
|
3030
|
-
return pe("#text", {}, f,
|
|
3071
|
+
function a(f, v) {
|
|
3072
|
+
return pe("#text", {}, f, v);
|
|
3031
3073
|
}
|
|
3032
3074
|
let u = "";
|
|
3033
3075
|
for (let f = 0; f < e.length; f++)
|
|
3034
3076
|
u += e[f], f < t.length && (u += `{{${f}}}`);
|
|
3035
3077
|
const m = /<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, g = [];
|
|
3036
|
-
let b, h = [], l = null, d = {},
|
|
3078
|
+
let b, h = [], l = null, d = {}, x, w = 0, c = [];
|
|
3037
3079
|
function p(f) {
|
|
3038
|
-
!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((
|
|
3039
|
-
if (
|
|
3080
|
+
!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) => {
|
|
3081
|
+
if (v === "style" && d.attrs.style) {
|
|
3040
3082
|
const A = d.attrs.style.replace(
|
|
3041
3083
|
/;?\s*$/,
|
|
3042
3084
|
""
|
|
3043
3085
|
), _ = f.attrs.style.replace(/^;?\s*/, "");
|
|
3044
3086
|
d.attrs.style = A + "; " + _;
|
|
3045
|
-
} else if (
|
|
3087
|
+
} else if (v === "class" && d.attrs.class) {
|
|
3046
3088
|
const A = d.attrs.class.trim().split(/\s+/).filter(Boolean), _ = f.attrs.class.trim().split(/\s+/).filter(Boolean), $ = [
|
|
3047
3089
|
.../* @__PURE__ */ new Set([...A, ..._])
|
|
3048
3090
|
];
|
|
3049
3091
|
d.attrs.class = $.join(" ");
|
|
3050
3092
|
} else
|
|
3051
|
-
d.attrs[
|
|
3093
|
+
d.attrs[v] = f.attrs[v];
|
|
3052
3094
|
}))) : (d.props || (d.props = {}), Object.assign(d.props, f)));
|
|
3053
3095
|
}
|
|
3054
|
-
function y(f,
|
|
3096
|
+
function y(f, v) {
|
|
3055
3097
|
const A = l ? h : c;
|
|
3056
3098
|
if (Ae(f)) {
|
|
3057
|
-
const _ = f.key ??
|
|
3099
|
+
const _ = f.key ?? v;
|
|
3058
3100
|
let $ = f.children;
|
|
3059
3101
|
A.push({
|
|
3060
3102
|
...f,
|
|
@@ -3064,14 +3106,14 @@ function sn(e, t, n) {
|
|
|
3064
3106
|
return;
|
|
3065
3107
|
}
|
|
3066
3108
|
if (_e(f)) {
|
|
3067
|
-
A.push(
|
|
3109
|
+
A.push(rr(f, void 0));
|
|
3068
3110
|
return;
|
|
3069
3111
|
}
|
|
3070
3112
|
if (Array.isArray(f)) {
|
|
3071
3113
|
if (f.length === 0) return;
|
|
3072
3114
|
for (let _ = 0; _ < f.length; _++) {
|
|
3073
3115
|
const $ = f[_];
|
|
3074
|
-
Ae($) || _e($) || Array.isArray($) ? y($, `${
|
|
3116
|
+
Ae($) || _e($) || Array.isArray($) ? y($, `${v}-${_}`) : $ !== null && typeof $ == "object" ? p($) : A.push(a(String($), `${v}-${_}`));
|
|
3075
3117
|
}
|
|
3076
3118
|
return;
|
|
3077
3119
|
}
|
|
@@ -3079,7 +3121,7 @@ function sn(e, t, n) {
|
|
|
3079
3121
|
p(f);
|
|
3080
3122
|
return;
|
|
3081
3123
|
}
|
|
3082
|
-
A.push(a(String(f),
|
|
3124
|
+
A.push(a(String(f), v));
|
|
3083
3125
|
}
|
|
3084
3126
|
const C = /* @__PURE__ */ new Set([
|
|
3085
3127
|
"area",
|
|
@@ -3100,12 +3142,12 @@ function sn(e, t, n) {
|
|
|
3100
3142
|
for (; b = m.exec(u); )
|
|
3101
3143
|
if (!(b[0].startsWith("<!--") && b[0].endsWith("-->"))) {
|
|
3102
3144
|
if (b[1]) {
|
|
3103
|
-
const f = b[1],
|
|
3145
|
+
const f = b[1], v = b[0][1] === "/", A = b[0][b[0].length - 2] === "/" || C.has(f), {
|
|
3104
3146
|
props: _,
|
|
3105
3147
|
attrs: $,
|
|
3106
3148
|
directives: T,
|
|
3107
3149
|
bound: R
|
|
3108
|
-
} =
|
|
3150
|
+
} = nr(b[2] || "", t, i), S = { props: {}, attrs: {} };
|
|
3109
3151
|
for (const P in _) S.props[P] = _[P];
|
|
3110
3152
|
for (const P in $) S.attrs[P] = $[P];
|
|
3111
3153
|
if (S.attrs && Object.prototype.hasOwnProperty.call(S.attrs, "key") && !(S.props && Object.prototype.hasOwnProperty.call(S.props, "key")))
|
|
@@ -3152,14 +3194,14 @@ function sn(e, t, n) {
|
|
|
3152
3194
|
let O;
|
|
3153
3195
|
typeof z == "string" && i ? O = U(W, z) : (O = z, O && ee(O) && (O = O.value)), S.props[E] = O;
|
|
3154
3196
|
try {
|
|
3155
|
-
const
|
|
3156
|
-
S.attrs || (S.attrs = {}), O !== void 0 && (S.attrs[
|
|
3197
|
+
const ne = re(E);
|
|
3198
|
+
S.attrs || (S.attrs = {}), O !== void 0 && (S.attrs[ne] = O);
|
|
3157
3199
|
} catch {
|
|
3158
3200
|
}
|
|
3159
3201
|
S.isCustomElement = !0;
|
|
3160
|
-
const qe = `update:${
|
|
3161
|
-
S.props[ut] = function(
|
|
3162
|
-
const Y =
|
|
3202
|
+
const qe = `update:${re(E)}`.replace(/-([a-z])/g, (ne, Y) => Y.toUpperCase()), ut = "on" + qe.charAt(0).toUpperCase() + qe.slice(1);
|
|
3203
|
+
S.props[ut] = function(ne) {
|
|
3204
|
+
const Y = ne.detail !== void 0 ? ne.detail : ne.target ? ne.target.value : void 0;
|
|
3163
3205
|
if (W)
|
|
3164
3206
|
if (z && ee(z)) {
|
|
3165
3207
|
const ae = z.value;
|
|
@@ -3172,25 +3214,25 @@ function sn(e, t, n) {
|
|
|
3172
3214
|
}
|
|
3173
3215
|
} catch {
|
|
3174
3216
|
}
|
|
3175
|
-
if (Object.keys(T).length > 0 && (S.directives = { ...T }),
|
|
3217
|
+
if (Object.keys(T).length > 0 && (S.directives = { ...T }), v) {
|
|
3176
3218
|
const P = pe(
|
|
3177
3219
|
l,
|
|
3178
3220
|
d,
|
|
3179
3221
|
h.length === 1 && _e(h[0]) && h[0].tag === "#text" ? typeof h[0].children == "string" ? h[0].children : "" : h.length ? h : void 0,
|
|
3180
|
-
|
|
3222
|
+
x
|
|
3181
3223
|
), B = g.pop();
|
|
3182
|
-
B ? (l = B.tag, d = B.props,
|
|
3224
|
+
B ? (l = B.tag, d = B.props, x = B.key, h = B.children, h.push(P)) : (c.push(P), l = null, d = {}, x = void 0, h = []);
|
|
3183
3225
|
} else A ? l ? h.push(pe(f, S, void 0, void 0)) : c.push(pe(f, S, void 0, void 0)) : (l && g.push({
|
|
3184
3226
|
tag: l,
|
|
3185
3227
|
props: d,
|
|
3186
3228
|
children: h,
|
|
3187
|
-
key:
|
|
3229
|
+
key: x
|
|
3188
3230
|
}), l = f, d = S, h = []);
|
|
3189
3231
|
} else if (typeof b[3] < "u") {
|
|
3190
|
-
const f = Number(b[3]),
|
|
3191
|
-
y(
|
|
3232
|
+
const f = Number(b[3]), v = t[f], A = `interp-${f}`;
|
|
3233
|
+
y(v, A);
|
|
3192
3234
|
} else if (b[4]) {
|
|
3193
|
-
const f = b[4],
|
|
3235
|
+
const f = b[4], v = l ? h : c, A = f.split(/({{\d+}})/);
|
|
3194
3236
|
for (const _ of A) {
|
|
3195
3237
|
if (!_) continue;
|
|
3196
3238
|
const $ = _.match(/^{{(\d+)}}$/);
|
|
@@ -3199,7 +3241,7 @@ function sn(e, t, n) {
|
|
|
3199
3241
|
y(R, S);
|
|
3200
3242
|
} else {
|
|
3201
3243
|
const T = `text-${w++}`;
|
|
3202
|
-
|
|
3244
|
+
v.push(a(_, T));
|
|
3203
3245
|
}
|
|
3204
3246
|
}
|
|
3205
3247
|
}
|
|
@@ -3215,94 +3257,94 @@ function sn(e, t, n) {
|
|
|
3215
3257
|
return pe("div", {}, "", "fallback-root");
|
|
3216
3258
|
}
|
|
3217
3259
|
function ce(e, ...t) {
|
|
3218
|
-
const
|
|
3219
|
-
return
|
|
3260
|
+
const r = t[t.length - 1], n = typeof r == "object" && r && !Array.isArray(r) ? r : void 0;
|
|
3261
|
+
return ir(e, t, n);
|
|
3220
3262
|
}
|
|
3221
3263
|
function Re(e, t) {
|
|
3222
3264
|
return j(e ? t : [], "when-block");
|
|
3223
3265
|
}
|
|
3224
|
-
function
|
|
3225
|
-
return e.map((
|
|
3226
|
-
const i = typeof
|
|
3227
|
-
return j(t(
|
|
3266
|
+
function wr(e, t) {
|
|
3267
|
+
return e.map((r, n) => {
|
|
3268
|
+
const i = typeof r == "object" ? r?.key ?? r?.id ?? `idx-${n}` : String(r);
|
|
3269
|
+
return j(t(r, n), `each-${i}`);
|
|
3228
3270
|
});
|
|
3229
3271
|
}
|
|
3230
|
-
function
|
|
3272
|
+
function sr() {
|
|
3231
3273
|
const e = [];
|
|
3232
3274
|
return {
|
|
3233
|
-
when(t,
|
|
3234
|
-
return e.push([t,
|
|
3275
|
+
when(t, r) {
|
|
3276
|
+
return e.push([t, r]), this;
|
|
3235
3277
|
},
|
|
3236
3278
|
otherwise(t) {
|
|
3237
3279
|
return e.push([!0, t]), this;
|
|
3238
3280
|
},
|
|
3239
3281
|
done() {
|
|
3240
|
-
return
|
|
3282
|
+
return or(...e);
|
|
3241
3283
|
}
|
|
3242
3284
|
};
|
|
3243
3285
|
}
|
|
3244
|
-
function
|
|
3286
|
+
function or(...e) {
|
|
3245
3287
|
for (let t = 0; t < e.length; t++) {
|
|
3246
|
-
const [
|
|
3247
|
-
if (
|
|
3288
|
+
const [r, n] = e[t];
|
|
3289
|
+
if (r) return [j(n, `whenChain-branch-${t}`)];
|
|
3248
3290
|
}
|
|
3249
3291
|
return [j([], "whenChain-empty")];
|
|
3250
3292
|
}
|
|
3251
3293
|
function j(e, t) {
|
|
3252
|
-
const
|
|
3294
|
+
const r = e ? Array.isArray(e) ? e.filter(Boolean) : [e].filter(Boolean) : [];
|
|
3253
3295
|
return {
|
|
3254
3296
|
tag: "#anchor",
|
|
3255
3297
|
key: t,
|
|
3256
|
-
children:
|
|
3298
|
+
children: r
|
|
3257
3299
|
};
|
|
3258
3300
|
}
|
|
3259
|
-
function
|
|
3301
|
+
function xr(e, t) {
|
|
3260
3302
|
return Re(!e, t);
|
|
3261
3303
|
}
|
|
3262
|
-
function
|
|
3263
|
-
const
|
|
3264
|
-
return Re(
|
|
3304
|
+
function vr(e, t) {
|
|
3305
|
+
const r = !e || e.length === 0;
|
|
3306
|
+
return Re(r, t);
|
|
3265
3307
|
}
|
|
3266
|
-
function
|
|
3267
|
-
const
|
|
3268
|
-
return Re(
|
|
3308
|
+
function kr(e, t) {
|
|
3309
|
+
const r = !!(e && e.length > 0);
|
|
3310
|
+
return Re(r, t);
|
|
3269
3311
|
}
|
|
3270
|
-
function
|
|
3271
|
-
const
|
|
3312
|
+
function Cr(e, t, r) {
|
|
3313
|
+
const n = [];
|
|
3272
3314
|
return e.forEach((i, s) => {
|
|
3273
|
-
t(i, s) &&
|
|
3274
|
-
}),
|
|
3315
|
+
t(i, s) && n.push({ item: i, originalIndex: s });
|
|
3316
|
+
}), n.map(({ item: i, originalIndex: s }, o) => {
|
|
3275
3317
|
const a = typeof i == "object" && i != null ? i?.key ?? i?.id ?? `filtered-${s}` : `filtered-${s}`;
|
|
3276
|
-
return j(
|
|
3318
|
+
return j(r(i, s, o), `each-where-${a}`);
|
|
3277
3319
|
});
|
|
3278
3320
|
}
|
|
3279
|
-
function
|
|
3280
|
-
const
|
|
3281
|
-
return
|
|
3321
|
+
function _r(e, t) {
|
|
3322
|
+
const r = e?.length ?? 0;
|
|
3323
|
+
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");
|
|
3282
3324
|
}
|
|
3283
|
-
function
|
|
3284
|
-
const
|
|
3325
|
+
function Er(e, t, r) {
|
|
3326
|
+
const n = /* @__PURE__ */ new Map();
|
|
3285
3327
|
return e.forEach((i) => {
|
|
3286
3328
|
const s = t(i);
|
|
3287
|
-
|
|
3288
|
-
}), Array.from(
|
|
3289
|
-
|
|
3329
|
+
n.has(s) || n.set(s, []), n.get(s).push(i);
|
|
3330
|
+
}), Array.from(n.entries()).map(([i, s], o) => j(
|
|
3331
|
+
r(i, s, o),
|
|
3290
3332
|
`each-group-${i}`
|
|
3291
3333
|
));
|
|
3292
3334
|
}
|
|
3293
|
-
function
|
|
3294
|
-
const i =
|
|
3335
|
+
function $r(e, t, r, n) {
|
|
3336
|
+
const i = r * t, s = Math.min(i + t, e.length);
|
|
3295
3337
|
return e.slice(i, s).map((a, u) => {
|
|
3296
3338
|
const m = i + u, g = typeof a == "object" && a != null ? a?.key ?? a?.id ?? `page-${m}` : `page-${m}`;
|
|
3297
|
-
return j(
|
|
3339
|
+
return j(n(a, m, u), `each-page-${g}`);
|
|
3298
3340
|
});
|
|
3299
3341
|
}
|
|
3300
|
-
function
|
|
3342
|
+
function Sr(e, t) {
|
|
3301
3343
|
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");
|
|
3302
3344
|
}
|
|
3303
3345
|
function q(e, t) {
|
|
3304
|
-
const
|
|
3305
|
-
return Re(!!
|
|
3346
|
+
const r = typeof window < "u" && window.matchMedia?.(e)?.matches;
|
|
3347
|
+
return Re(!!r, t);
|
|
3306
3348
|
}
|
|
3307
3349
|
const te = {
|
|
3308
3350
|
// Responsive breakpoints (matching style.ts)
|
|
@@ -3313,7 +3355,7 @@ const te = {
|
|
|
3313
3355
|
"2xl": "(min-width:1536px)",
|
|
3314
3356
|
// Dark mode (matching style.ts)
|
|
3315
3357
|
dark: "(prefers-color-scheme: dark)"
|
|
3316
|
-
}, lt = ["sm", "md", "lg", "xl", "2xl"],
|
|
3358
|
+
}, lt = ["sm", "md", "lg", "xl", "2xl"], ar = {
|
|
3317
3359
|
// Breakpoint-based rendering (matching style.ts exactly)
|
|
3318
3360
|
sm: (e) => q(te.sm, e),
|
|
3319
3361
|
md: (e) => q(te.md, e),
|
|
@@ -3332,44 +3374,44 @@ const te = {
|
|
|
3332
3374
|
portrait: (e) => q("(orientation: portrait)", e),
|
|
3333
3375
|
landscape: (e) => q("(orientation: landscape)", e)
|
|
3334
3376
|
};
|
|
3335
|
-
function
|
|
3336
|
-
const
|
|
3337
|
-
e.includes("dark") ?
|
|
3338
|
-
const
|
|
3377
|
+
function Ar(e, t) {
|
|
3378
|
+
const r = [];
|
|
3379
|
+
e.includes("dark") ? r.push(te.dark) : e.includes("light") && r.push("(prefers-color-scheme: light)");
|
|
3380
|
+
const n = e.filter(
|
|
3339
3381
|
(o) => lt.includes(o)
|
|
3340
|
-
), i =
|
|
3341
|
-
i && i in te &&
|
|
3342
|
-
const s =
|
|
3382
|
+
), i = n[n.length - 1];
|
|
3383
|
+
i && i in te && r.push(te[i]);
|
|
3384
|
+
const s = r.length > 0 ? r.join(" and ") : "all";
|
|
3343
3385
|
return q(s, t);
|
|
3344
3386
|
}
|
|
3345
|
-
function
|
|
3387
|
+
function Tr(e) {
|
|
3346
3388
|
const t = [];
|
|
3347
|
-
return e.base && t.push(j(e.base, "responsive-base")), lt.forEach((
|
|
3348
|
-
const
|
|
3349
|
-
|
|
3389
|
+
return e.base && t.push(j(e.base, "responsive-base")), lt.forEach((r) => {
|
|
3390
|
+
const n = e[r];
|
|
3391
|
+
n && t.push(ar[r](n));
|
|
3350
3392
|
}), t;
|
|
3351
3393
|
}
|
|
3352
|
-
function
|
|
3394
|
+
function Rr(e) {
|
|
3353
3395
|
const t = [];
|
|
3354
|
-
let
|
|
3396
|
+
let r = null;
|
|
3355
3397
|
return {
|
|
3356
|
-
case(
|
|
3357
|
-
const s = typeof
|
|
3398
|
+
case(n, i) {
|
|
3399
|
+
const s = typeof n == "function" ? n : (o) => o === n;
|
|
3358
3400
|
return t.push({ condition: s, content: i }), this;
|
|
3359
3401
|
},
|
|
3360
|
-
when(
|
|
3361
|
-
return t.push({ condition:
|
|
3402
|
+
when(n, i) {
|
|
3403
|
+
return t.push({ condition: n, content: i }), this;
|
|
3362
3404
|
},
|
|
3363
|
-
otherwise(
|
|
3364
|
-
return
|
|
3405
|
+
otherwise(n) {
|
|
3406
|
+
return r = n, this;
|
|
3365
3407
|
},
|
|
3366
3408
|
done() {
|
|
3367
|
-
for (let
|
|
3368
|
-
const { condition: i, content: s } = t[
|
|
3409
|
+
for (let n = 0; n < t.length; n++) {
|
|
3410
|
+
const { condition: i, content: s } = t[n];
|
|
3369
3411
|
if (i(e))
|
|
3370
|
-
return j(s, `switch-case-${
|
|
3412
|
+
return j(s, `switch-case-${n}`);
|
|
3371
3413
|
}
|
|
3372
|
-
return j(
|
|
3414
|
+
return j(r || [], "switch-otherwise");
|
|
3373
3415
|
}
|
|
3374
3416
|
};
|
|
3375
3417
|
}
|
|
@@ -3388,14 +3430,14 @@ class de extends EventTarget {
|
|
|
3388
3430
|
* @param eventName - Name of the event
|
|
3389
3431
|
* @param data - Optional event payload
|
|
3390
3432
|
*/
|
|
3391
|
-
emit(t,
|
|
3392
|
-
const
|
|
3393
|
-
if (!i ||
|
|
3394
|
-
this.eventCounters.set(t, { count: 1, window:
|
|
3433
|
+
emit(t, r) {
|
|
3434
|
+
const n = Date.now(), i = this.eventCounters.get(t);
|
|
3435
|
+
if (!i || n - i.window > 1e3)
|
|
3436
|
+
this.eventCounters.set(t, { count: 1, window: n });
|
|
3395
3437
|
else if (i.count++, i.count > 50 && i.count > 100)
|
|
3396
3438
|
return;
|
|
3397
3439
|
this.dispatchEvent(new CustomEvent(t, {
|
|
3398
|
-
detail:
|
|
3440
|
+
detail: r,
|
|
3399
3441
|
bubbles: !1,
|
|
3400
3442
|
// Global events don't need to bubble
|
|
3401
3443
|
cancelable: !0
|
|
@@ -3403,7 +3445,7 @@ class de extends EventTarget {
|
|
|
3403
3445
|
const s = this.handlers[t];
|
|
3404
3446
|
s && s.forEach((o) => {
|
|
3405
3447
|
try {
|
|
3406
|
-
o(
|
|
3448
|
+
o(r);
|
|
3407
3449
|
} catch (a) {
|
|
3408
3450
|
se(`Error in global event handler for "${t}":`, a);
|
|
3409
3451
|
}
|
|
@@ -3414,17 +3456,17 @@ class de extends EventTarget {
|
|
|
3414
3456
|
* @param eventName - Name of the event
|
|
3415
3457
|
* @param handler - Handler function
|
|
3416
3458
|
*/
|
|
3417
|
-
on(t,
|
|
3418
|
-
return this.handlers[t] || (this.handlers[t] = /* @__PURE__ */ new Set()), this.handlers[t].add(
|
|
3459
|
+
on(t, r) {
|
|
3460
|
+
return this.handlers[t] || (this.handlers[t] = /* @__PURE__ */ new Set()), this.handlers[t].add(r), () => this.off(t, r);
|
|
3419
3461
|
}
|
|
3420
3462
|
/**
|
|
3421
3463
|
* Remove a specific handler for a global event.
|
|
3422
3464
|
* @param eventName - Name of the event
|
|
3423
3465
|
* @param handler - Handler function to remove
|
|
3424
3466
|
*/
|
|
3425
|
-
off(t,
|
|
3426
|
-
const
|
|
3427
|
-
|
|
3467
|
+
off(t, r) {
|
|
3468
|
+
const n = this.handlers[t];
|
|
3469
|
+
n && n.delete(r);
|
|
3428
3470
|
}
|
|
3429
3471
|
/**
|
|
3430
3472
|
* Remove all handlers for a specific event.
|
|
@@ -3439,18 +3481,18 @@ class de extends EventTarget {
|
|
|
3439
3481
|
* @param handler - CustomEvent handler
|
|
3440
3482
|
* @param options - AddEventListener options
|
|
3441
3483
|
*/
|
|
3442
|
-
listen(t,
|
|
3443
|
-
return this.addEventListener(t,
|
|
3484
|
+
listen(t, r, n) {
|
|
3485
|
+
return this.addEventListener(t, r, n), () => this.removeEventListener(t, r);
|
|
3444
3486
|
}
|
|
3445
3487
|
/**
|
|
3446
3488
|
* Register a one-time event handler. Returns a promise that resolves with the event data.
|
|
3447
3489
|
* @param eventName - Name of the event
|
|
3448
3490
|
* @param handler - Handler function
|
|
3449
3491
|
*/
|
|
3450
|
-
once(t,
|
|
3451
|
-
return new Promise((
|
|
3492
|
+
once(t, r) {
|
|
3493
|
+
return new Promise((n) => {
|
|
3452
3494
|
const i = this.on(t, (s) => {
|
|
3453
|
-
i(),
|
|
3495
|
+
i(), r(s), n(s);
|
|
3454
3496
|
});
|
|
3455
3497
|
});
|
|
3456
3498
|
}
|
|
@@ -3480,10 +3522,10 @@ class de extends EventTarget {
|
|
|
3480
3522
|
*/
|
|
3481
3523
|
getEventStats() {
|
|
3482
3524
|
const t = {};
|
|
3483
|
-
for (const [
|
|
3484
|
-
t[
|
|
3485
|
-
count:
|
|
3486
|
-
handlersCount: this.getHandlerCount(
|
|
3525
|
+
for (const [r, n] of this.eventCounters.entries())
|
|
3526
|
+
t[r] = {
|
|
3527
|
+
count: n.count,
|
|
3528
|
+
handlersCount: this.getHandlerCount(r)
|
|
3487
3529
|
};
|
|
3488
3530
|
return t;
|
|
3489
3531
|
}
|
|
@@ -3494,12 +3536,12 @@ class de extends EventTarget {
|
|
|
3494
3536
|
this.eventCounters.clear();
|
|
3495
3537
|
}
|
|
3496
3538
|
}
|
|
3497
|
-
const be = de.getInstance(),
|
|
3539
|
+
const be = de.getInstance(), Or = (e, t) => be.emit(e, t), Pr = (e, t) => be.on(e, t), Lr = (e, t) => be.off(e, t), Mr = (e, t) => be.once(e, t), jr = (e, t, r) => be.listen(e, t, r);
|
|
3498
3540
|
function tt(e) {
|
|
3499
3541
|
let t = { ...e };
|
|
3500
|
-
const
|
|
3501
|
-
function
|
|
3502
|
-
|
|
3542
|
+
const r = [];
|
|
3543
|
+
function n(a) {
|
|
3544
|
+
r.push(a), a(t);
|
|
3503
3545
|
}
|
|
3504
3546
|
function i() {
|
|
3505
3547
|
return t;
|
|
@@ -3509,23 +3551,23 @@ function tt(e) {
|
|
|
3509
3551
|
t = { ...t, ...u }, o();
|
|
3510
3552
|
}
|
|
3511
3553
|
function o() {
|
|
3512
|
-
|
|
3554
|
+
r.forEach((a) => a(t));
|
|
3513
3555
|
}
|
|
3514
|
-
return { subscribe:
|
|
3556
|
+
return { subscribe: n, getState: i, setState: s };
|
|
3515
3557
|
}
|
|
3516
|
-
const
|
|
3517
|
-
for (const
|
|
3518
|
-
const
|
|
3558
|
+
const rt = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, Q = (e, t) => {
|
|
3559
|
+
for (const r of e) {
|
|
3560
|
+
const n = [], i = r.path.replace(/:[^/]+/g, (a) => (n.push(a.slice(1)), "([^/]+)")), s = new RegExp(`^${i}$`), o = t.match(s);
|
|
3519
3561
|
if (o) {
|
|
3520
3562
|
const a = {};
|
|
3521
|
-
return
|
|
3563
|
+
return n.forEach((u, m) => {
|
|
3522
3564
|
a[u] = o[m + 1];
|
|
3523
|
-
}), { route:
|
|
3565
|
+
}), { route: r, params: a };
|
|
3524
3566
|
}
|
|
3525
3567
|
}
|
|
3526
3568
|
return { route: null, params: {} };
|
|
3527
3569
|
}, Ie = {};
|
|
3528
|
-
async function
|
|
3570
|
+
async function cr(e) {
|
|
3529
3571
|
if (e.component) return e.component;
|
|
3530
3572
|
if (e.load) {
|
|
3531
3573
|
if (Ie[e.path]) return Ie[e.path];
|
|
@@ -3538,41 +3580,41 @@ async function ln(e) {
|
|
|
3538
3580
|
}
|
|
3539
3581
|
throw new Error(`No component or loader defined for route: ${e.path}`);
|
|
3540
3582
|
}
|
|
3541
|
-
function
|
|
3542
|
-
const { routes: t, base:
|
|
3583
|
+
function lr(e) {
|
|
3584
|
+
const { routes: t, base: r = "", initialUrl: n } = e;
|
|
3543
3585
|
let i, s, o, a, u, m, g;
|
|
3544
|
-
const b = async (
|
|
3545
|
-
const c = t.find((p) => Q([p],
|
|
3586
|
+
const b = async (x, w) => {
|
|
3587
|
+
const c = t.find((p) => Q([p], x.path).route !== null);
|
|
3546
3588
|
if (c?.beforeEnter)
|
|
3547
3589
|
try {
|
|
3548
|
-
const p = await c.beforeEnter(
|
|
3590
|
+
const p = await c.beforeEnter(x, w);
|
|
3549
3591
|
return typeof p == "string" ? (await d(p, !0), !1) : p !== !1;
|
|
3550
3592
|
} catch (p) {
|
|
3551
3593
|
return se("beforeEnter error", p), !1;
|
|
3552
3594
|
}
|
|
3553
3595
|
return !0;
|
|
3554
|
-
}, h = async (
|
|
3555
|
-
const c = t.find((p) => Q([p],
|
|
3596
|
+
}, h = async (x, w) => {
|
|
3597
|
+
const c = t.find((p) => Q([p], x.path).route !== null);
|
|
3556
3598
|
if (c?.onEnter)
|
|
3557
3599
|
try {
|
|
3558
|
-
const p = await c.onEnter(
|
|
3600
|
+
const p = await c.onEnter(x, w);
|
|
3559
3601
|
return typeof p == "string" ? (await d(p, !0), !1) : p !== !1;
|
|
3560
3602
|
} catch (p) {
|
|
3561
3603
|
return se("onEnter error", p), !1;
|
|
3562
3604
|
}
|
|
3563
3605
|
return !0;
|
|
3564
|
-
}, l = (
|
|
3565
|
-
const c = t.find((p) => Q([p],
|
|
3606
|
+
}, l = (x, w) => {
|
|
3607
|
+
const c = t.find((p) => Q([p], x.path).route !== null);
|
|
3566
3608
|
if (c?.afterEnter)
|
|
3567
3609
|
try {
|
|
3568
|
-
c.afterEnter(
|
|
3610
|
+
c.afterEnter(x, w);
|
|
3569
3611
|
} catch (p) {
|
|
3570
3612
|
se("afterEnter error", p);
|
|
3571
3613
|
}
|
|
3572
|
-
}, d = async (
|
|
3614
|
+
}, d = async (x, w = !1) => {
|
|
3573
3615
|
try {
|
|
3574
3616
|
const c = {
|
|
3575
|
-
path:
|
|
3617
|
+
path: x.replace(r, "") || "/",
|
|
3576
3618
|
query: {}
|
|
3577
3619
|
}, p = Q(t, c.path);
|
|
3578
3620
|
if (!p) throw new Error(`No route found for ${c.path}`);
|
|
@@ -3582,20 +3624,20 @@ function un(e) {
|
|
|
3582
3624
|
query: c.query
|
|
3583
3625
|
};
|
|
3584
3626
|
if (!await b(C, y) || !await h(C, y)) return;
|
|
3585
|
-
typeof window < "u" && typeof document < "u" && (w ? window.history.replaceState({}, "",
|
|
3627
|
+
typeof window < "u" && typeof document < "u" && (w ? window.history.replaceState({}, "", r + x) : window.history.pushState({}, "", r + x)), o.setState(C), l(C, y);
|
|
3586
3628
|
} catch (c) {
|
|
3587
3629
|
se("Navigation error:", c);
|
|
3588
3630
|
}
|
|
3589
3631
|
};
|
|
3590
|
-
if (typeof window < "u" && typeof document < "u" && typeof
|
|
3632
|
+
if (typeof window < "u" && typeof document < "u" && typeof n > "u") {
|
|
3591
3633
|
i = () => {
|
|
3592
|
-
const w = new URL(window.location.href), c = w.pathname.replace(
|
|
3634
|
+
const w = new URL(window.location.href), c = w.pathname.replace(r, "") || "/", p = rt(w.search);
|
|
3593
3635
|
return { path: c, query: p };
|
|
3594
3636
|
}, s = i();
|
|
3595
|
-
const
|
|
3637
|
+
const x = Q(t, s.path);
|
|
3596
3638
|
o = tt({
|
|
3597
3639
|
path: s.path,
|
|
3598
|
-
params:
|
|
3640
|
+
params: x.params,
|
|
3599
3641
|
query: s.query
|
|
3600
3642
|
}), a = async (w = !1) => {
|
|
3601
3643
|
const c = i();
|
|
@@ -3603,13 +3645,13 @@ function un(e) {
|
|
|
3603
3645
|
}, window.addEventListener("popstate", () => a(!0)), u = (w) => d(w, !1), m = (w) => d(w, !0), g = () => window.history.back();
|
|
3604
3646
|
} else {
|
|
3605
3647
|
i = () => {
|
|
3606
|
-
const c = new URL(
|
|
3648
|
+
const c = new URL(n || "/", "http://localhost"), p = c.pathname.replace(r, "") || "/", y = rt(c.search);
|
|
3607
3649
|
return { path: p, query: y };
|
|
3608
3650
|
}, s = i();
|
|
3609
|
-
const
|
|
3651
|
+
const x = Q(t, s.path);
|
|
3610
3652
|
o = tt({
|
|
3611
3653
|
path: s.path,
|
|
3612
|
-
params:
|
|
3654
|
+
params: x.params,
|
|
3613
3655
|
query: s.query
|
|
3614
3656
|
}), a = async () => {
|
|
3615
3657
|
const c = i();
|
|
@@ -3618,7 +3660,7 @@ function un(e) {
|
|
|
3618
3660
|
const w = async (c) => {
|
|
3619
3661
|
try {
|
|
3620
3662
|
const p = {
|
|
3621
|
-
path: c.replace(
|
|
3663
|
+
path: c.replace(r, "") || "/",
|
|
3622
3664
|
query: {}
|
|
3623
3665
|
}, y = Q(t, p.path);
|
|
3624
3666
|
if (!y) throw new Error(`No route found for ${p.path}`);
|
|
@@ -3626,26 +3668,26 @@ function un(e) {
|
|
|
3626
3668
|
path: p.path,
|
|
3627
3669
|
params: y.params,
|
|
3628
3670
|
query: p.query
|
|
3629
|
-
}, f = t.find((
|
|
3671
|
+
}, f = t.find((v) => Q([v], k.path).route !== null);
|
|
3630
3672
|
if (f?.beforeEnter)
|
|
3631
3673
|
try {
|
|
3632
|
-
const
|
|
3633
|
-
if (typeof
|
|
3634
|
-
await w(
|
|
3674
|
+
const v = await f.beforeEnter(k, C);
|
|
3675
|
+
if (typeof v == "string") {
|
|
3676
|
+
await w(v);
|
|
3635
3677
|
return;
|
|
3636
3678
|
}
|
|
3637
|
-
if (
|
|
3679
|
+
if (v === !1) return;
|
|
3638
3680
|
} catch {
|
|
3639
3681
|
return;
|
|
3640
3682
|
}
|
|
3641
3683
|
if (f?.onEnter)
|
|
3642
3684
|
try {
|
|
3643
|
-
const
|
|
3644
|
-
if (typeof
|
|
3645
|
-
await w(
|
|
3685
|
+
const v = await f.onEnter(k, C);
|
|
3686
|
+
if (typeof v == "string") {
|
|
3687
|
+
await w(v);
|
|
3646
3688
|
return;
|
|
3647
3689
|
}
|
|
3648
|
-
if (
|
|
3690
|
+
if (v === !1) return;
|
|
3649
3691
|
} catch {
|
|
3650
3692
|
return;
|
|
3651
3693
|
}
|
|
@@ -3666,18 +3708,18 @@ function un(e) {
|
|
|
3666
3708
|
replace: m,
|
|
3667
3709
|
back: g,
|
|
3668
3710
|
subscribe: o.subscribe,
|
|
3669
|
-
matchRoute: (
|
|
3711
|
+
matchRoute: (x) => Q(t, x),
|
|
3670
3712
|
getCurrent: () => o.getState(),
|
|
3671
|
-
resolveRouteComponent:
|
|
3713
|
+
resolveRouteComponent: cr
|
|
3672
3714
|
};
|
|
3673
3715
|
}
|
|
3674
|
-
function
|
|
3716
|
+
function Nr(e, t) {
|
|
3675
3717
|
return Q(e, t);
|
|
3676
3718
|
}
|
|
3677
|
-
function
|
|
3678
|
-
const t =
|
|
3679
|
-
return et("router-view", (
|
|
3680
|
-
const { onConnected: i } =
|
|
3719
|
+
function Wr(e) {
|
|
3720
|
+
const t = lr(e);
|
|
3721
|
+
return et("router-view", (r = {}, n = {}) => {
|
|
3722
|
+
const { onConnected: i } = n;
|
|
3681
3723
|
if (i && i(() => {
|
|
3682
3724
|
t && typeof t.subscribe == "function" && t.subscribe(() => {
|
|
3683
3725
|
});
|
|
@@ -3692,7 +3734,7 @@ function zn(e) {
|
|
|
3692
3734
|
}
|
|
3693
3735
|
return ce`<div>Invalid route component</div>`;
|
|
3694
3736
|
}).catch(() => ce`<div>Invalid route component</div>`) : ce`<div>Not found</div>`;
|
|
3695
|
-
}), et("router-link", (
|
|
3737
|
+
}), et("router-link", (r = {}, n = {}) => {
|
|
3696
3738
|
const {
|
|
3697
3739
|
to: i = "",
|
|
3698
3740
|
tag: s = "a",
|
|
@@ -3704,14 +3746,14 @@ function zn(e) {
|
|
|
3704
3746
|
disabled: b = !1,
|
|
3705
3747
|
external: h = !1,
|
|
3706
3748
|
class: l = ""
|
|
3707
|
-
} =
|
|
3749
|
+
} = r, d = t.getCurrent(), x = d.path === i, w = a ? x : d && typeof d.path == "string" ? d.path.startsWith(i) : !1, c = x ? `aria-current="${g}"` : "", p = (l || "").split(/\s+/).filter(Boolean), y = {};
|
|
3708
3750
|
for (const _ of p) y[_] = !0;
|
|
3709
3751
|
const C = {
|
|
3710
3752
|
...y,
|
|
3711
3753
|
// Also include the configurable names (may duplicate the above)
|
|
3712
3754
|
[u]: w,
|
|
3713
|
-
[m]:
|
|
3714
|
-
}, k = s === "button", f = b ? k ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "",
|
|
3755
|
+
[m]: x
|
|
3756
|
+
}, k = s === "button", f = b ? k ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", v = h && (s === "a" || !s) ? 'target="_blank" rel="noopener noreferrer"' : "", A = (_) => {
|
|
3715
3757
|
if (b) {
|
|
3716
3758
|
_.preventDefault();
|
|
3717
3759
|
return;
|
|
@@ -3719,13 +3761,13 @@ function zn(e) {
|
|
|
3719
3761
|
h && (s === "a" || !s) || (_.preventDefault(), o ? t.replace(i) : t.push(i));
|
|
3720
3762
|
};
|
|
3721
3763
|
return ce`
|
|
3722
|
-
${
|
|
3764
|
+
${sr().when(k, ce`
|
|
3723
3765
|
<button
|
|
3724
3766
|
part="button"
|
|
3725
3767
|
:class="${C}"
|
|
3726
3768
|
${c}
|
|
3727
3769
|
${f}
|
|
3728
|
-
${
|
|
3770
|
+
${v}
|
|
3729
3771
|
@click="${A}"
|
|
3730
3772
|
><slot></slot></button>
|
|
3731
3773
|
`).otherwise(ce`
|
|
@@ -3735,7 +3777,7 @@ function zn(e) {
|
|
|
3735
3777
|
:class="${C}"
|
|
3736
3778
|
${c}
|
|
3737
3779
|
${f}
|
|
3738
|
-
${
|
|
3780
|
+
${v}
|
|
3739
3781
|
@click="${A}"
|
|
3740
3782
|
><slot></slot></a>
|
|
3741
3783
|
`).done()}
|
|
@@ -3746,48 +3788,48 @@ export {
|
|
|
3746
3788
|
de as GlobalEventBus,
|
|
3747
3789
|
j as anchorBlock,
|
|
3748
3790
|
et as component,
|
|
3749
|
-
|
|
3791
|
+
fr as computed,
|
|
3750
3792
|
tt as createStore,
|
|
3751
3793
|
Pt as css,
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3794
|
+
wr as each,
|
|
3795
|
+
Er as eachGroup,
|
|
3796
|
+
$r as eachPage,
|
|
3797
|
+
Cr as eachWhere,
|
|
3798
|
+
Or as emit,
|
|
3757
3799
|
be as eventBus,
|
|
3758
3800
|
ce as html,
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3801
|
+
Wr as initRouter,
|
|
3802
|
+
jr as listen,
|
|
3803
|
+
sr as match,
|
|
3762
3804
|
Q as matchRoute,
|
|
3763
|
-
|
|
3805
|
+
Nr as matchRouteSSR,
|
|
3764
3806
|
te as mediaVariants,
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3807
|
+
Lr as off,
|
|
3808
|
+
Pr as on,
|
|
3809
|
+
Mr as once,
|
|
3810
|
+
rt as parseQuery,
|
|
3811
|
+
ur as ref,
|
|
3770
3812
|
Pe as renderToString,
|
|
3771
|
-
|
|
3772
|
-
|
|
3813
|
+
cr as resolveRouteComponent,
|
|
3814
|
+
ar as responsive,
|
|
3773
3815
|
lt as responsiveOrder,
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3816
|
+
Tr as responsiveSwitch,
|
|
3817
|
+
Rr as switchOn,
|
|
3818
|
+
_r as switchOnLength,
|
|
3819
|
+
Sr as switchOnPromise,
|
|
3820
|
+
xr as unless,
|
|
3821
|
+
pr as useEmit,
|
|
3822
|
+
mr as useOnAttributeChanged,
|
|
3823
|
+
hr as useOnConnected,
|
|
3824
|
+
gr as useOnDisconnected,
|
|
3825
|
+
yr as useOnError,
|
|
3826
|
+
lr as useRouter,
|
|
3827
|
+
br as useStyle,
|
|
3828
|
+
dr as watch,
|
|
3787
3829
|
Re as when,
|
|
3788
|
-
|
|
3830
|
+
vr as whenEmpty,
|
|
3789
3831
|
q as whenMedia,
|
|
3790
|
-
|
|
3791
|
-
|
|
3832
|
+
kr as whenNotEmpty,
|
|
3833
|
+
Ar as whenVariants
|
|
3792
3834
|
};
|
|
3793
3835
|
//# sourceMappingURL=custom-elements-runtime.es.js.map
|