@jasonshimmy/custom-elements-runtime 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-elements-runtime.cjs.js +11 -11
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +1259 -1245
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +12 -12
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/dist/runtime/helpers.d.ts +0 -3
- package/dist/runtime/reactive.d.ts +5 -0
- package/dist/runtime/style.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
class
|
|
1
|
+
class dt {
|
|
2
2
|
pendingUpdates = /* @__PURE__ */ new Map();
|
|
3
3
|
isFlushScheduled = !1;
|
|
4
4
|
/**
|
|
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, n) {
|
|
9
|
+
const r = n || t.toString();
|
|
10
|
+
this.pendingUpdates.set(r, 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 ut {
|
|
|
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 n of t)
|
|
19
19
|
try {
|
|
20
|
-
|
|
21
|
-
} catch (
|
|
22
|
-
typeof console < "u" && console.error && console.error("Error in batched update:",
|
|
20
|
+
n();
|
|
21
|
+
} catch (r) {
|
|
22
|
+
typeof console < "u" && console.error && console.error("Error in batched update:", r);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
@@ -29,25 +29,25 @@ class ut {
|
|
|
29
29
|
return this.pendingUpdates.size;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
const
|
|
33
|
-
function
|
|
34
|
-
|
|
32
|
+
const pt = new dt();
|
|
33
|
+
function fe(e, t) {
|
|
34
|
+
pt.schedule(e, t);
|
|
35
35
|
}
|
|
36
|
-
const
|
|
37
|
-
class
|
|
36
|
+
const Fe = /* @__PURE__ */ new WeakSet();
|
|
37
|
+
class ht {
|
|
38
38
|
static cache = /* @__PURE__ */ new WeakMap();
|
|
39
39
|
static arrayHandlerCache = /* @__PURE__ */ new WeakMap();
|
|
40
40
|
static objectHandlerCache = /* @__PURE__ */ new WeakMap();
|
|
41
41
|
/**
|
|
42
42
|
* Get or create a reactive proxy for an object
|
|
43
43
|
*/
|
|
44
|
-
static getOrCreateProxy(t,
|
|
44
|
+
static getOrCreateProxy(t, n, r = !1) {
|
|
45
45
|
const i = this.cache.get(t);
|
|
46
46
|
if (i)
|
|
47
47
|
return i;
|
|
48
|
-
const s =
|
|
48
|
+
const s = r ? this.getOrCreateArrayHandler(n) : this.getOrCreateObjectHandler(n), o = new Proxy(t, s);
|
|
49
49
|
try {
|
|
50
|
-
|
|
50
|
+
rt.markAsProxy(o);
|
|
51
51
|
} catch {
|
|
52
52
|
}
|
|
53
53
|
return this.cache.set(t, o), o;
|
|
@@ -57,9 +57,9 @@ class dt {
|
|
|
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 n = {
|
|
61
|
+
get: (r, i, s) => {
|
|
62
|
+
const o = Reflect.get(r, i, s);
|
|
63
63
|
return typeof o == "function" && typeof i == "string" && [
|
|
64
64
|
"push",
|
|
65
65
|
"pop",
|
|
@@ -71,14 +71,14 @@ class dt {
|
|
|
71
71
|
"fill",
|
|
72
72
|
"copyWithin"
|
|
73
73
|
].includes(i) ? function(...u) {
|
|
74
|
-
const
|
|
75
|
-
return t.triggerUpdate(),
|
|
74
|
+
const y = o.apply(r, u);
|
|
75
|
+
return t.triggerUpdate(), y;
|
|
76
76
|
} : o;
|
|
77
77
|
},
|
|
78
|
-
set: (
|
|
79
|
-
deleteProperty: (
|
|
78
|
+
set: (r, i, s) => (r[i] = t.makeReactiveValue(s), t.triggerUpdate(), !0),
|
|
79
|
+
deleteProperty: (r, i) => (delete r[i], t.triggerUpdate(), !0)
|
|
80
80
|
};
|
|
81
|
-
this.arrayHandlerCache.set(t,
|
|
81
|
+
this.arrayHandlerCache.set(t, n);
|
|
82
82
|
}
|
|
83
83
|
return this.arrayHandlerCache.get(t);
|
|
84
84
|
}
|
|
@@ -87,12 +87,12 @@ class dt {
|
|
|
87
87
|
*/
|
|
88
88
|
static getOrCreateObjectHandler(t) {
|
|
89
89
|
if (!this.objectHandlerCache.has(t)) {
|
|
90
|
-
const
|
|
91
|
-
get: (
|
|
92
|
-
set: (
|
|
93
|
-
deleteProperty: (
|
|
90
|
+
const n = {
|
|
91
|
+
get: (r, i, s) => Reflect.get(r, i, s),
|
|
92
|
+
set: (r, i, s) => (r[i] = t.makeReactiveValue(s), t.triggerUpdate(), !0),
|
|
93
|
+
deleteProperty: (r, i) => (delete r[i], t.triggerUpdate(), !0)
|
|
94
94
|
};
|
|
95
|
-
this.objectHandlerCache.set(t,
|
|
95
|
+
this.objectHandlerCache.set(t, n);
|
|
96
96
|
}
|
|
97
97
|
return this.objectHandlerCache.get(t);
|
|
98
98
|
}
|
|
@@ -118,7 +118,7 @@ class dt {
|
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
class
|
|
121
|
+
class rt {
|
|
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 tt {
|
|
|
127
127
|
/**
|
|
128
128
|
* Create an optimized reactive proxy with minimal overhead
|
|
129
129
|
*/
|
|
130
|
-
static createReactiveProxy(t,
|
|
130
|
+
static createReactiveProxy(t, n, r) {
|
|
131
131
|
try {
|
|
132
|
-
if (
|
|
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(n);
|
|
137
|
+
s || (s = /* @__PURE__ */ new WeakMap(), this.contextCache.set(n, s));
|
|
138
|
+
let o = s.get(r);
|
|
139
139
|
return o || (o = {
|
|
140
|
-
triggerUpdate:
|
|
141
|
-
makeReactiveValue:
|
|
142
|
-
}, s.set(
|
|
140
|
+
triggerUpdate: n,
|
|
141
|
+
makeReactiveValue: r
|
|
142
|
+
}, s.set(r, o)), ht.getOrCreateProxy(t, o, i);
|
|
143
143
|
}
|
|
144
144
|
/**
|
|
145
145
|
* Mark an object as a proxy (for optimization)
|
|
@@ -147,12 +147,12 @@ class tt {
|
|
|
147
147
|
static markAsProxy(t) {
|
|
148
148
|
if (t)
|
|
149
149
|
try {
|
|
150
|
-
|
|
150
|
+
Fe.add(t);
|
|
151
151
|
} catch {
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
class
|
|
155
|
+
class gt {
|
|
156
156
|
currentComponent = null;
|
|
157
157
|
componentDependencies = /* @__PURE__ */ new Map();
|
|
158
158
|
componentRenderFunctions = /* @__PURE__ */ new Map();
|
|
@@ -165,8 +165,8 @@ class pt {
|
|
|
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, n) {
|
|
169
|
+
this.currentComponent = t, this.componentRenderFunctions.set(t, n), 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 pt {
|
|
|
198
198
|
*/
|
|
199
199
|
shouldEmitRenderWarning() {
|
|
200
200
|
if (!this.currentComponent) return !0;
|
|
201
|
-
const t = this.currentComponent,
|
|
202
|
-
return
|
|
201
|
+
const t = this.currentComponent, n = this.lastWarningTime.get(t) || 0, r = Date.now();
|
|
202
|
+
return r - n < 1e3 ? !1 : (this.lastWarningTime.set(t, r), !0);
|
|
203
203
|
}
|
|
204
204
|
/**
|
|
205
205
|
* Execute a function with tracking disabled
|
|
206
206
|
*/
|
|
207
207
|
withoutTracking(t) {
|
|
208
|
-
const
|
|
208
|
+
const n = this.trackingDisabled;
|
|
209
209
|
this.trackingDisabled = !0;
|
|
210
210
|
try {
|
|
211
211
|
return t();
|
|
212
212
|
} finally {
|
|
213
|
-
this.trackingDisabled =
|
|
213
|
+
this.trackingDisabled = n;
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
/**
|
|
@@ -218,11 +218,11 @@ class pt {
|
|
|
218
218
|
*/
|
|
219
219
|
getOrCreateState(t) {
|
|
220
220
|
if (!this.currentComponent)
|
|
221
|
-
return new
|
|
222
|
-
const
|
|
223
|
-
if (this.stateIndexCounter.set(
|
|
221
|
+
return new He(t);
|
|
222
|
+
const n = this.currentComponent, r = this.stateIndexCounter.get(n) || 0, i = `${n}:${r}`;
|
|
223
|
+
if (this.stateIndexCounter.set(n, r + 1), this.stateStorage.has(i))
|
|
224
224
|
return this.stateStorage.get(i);
|
|
225
|
-
const s = new
|
|
225
|
+
const s = new He(t);
|
|
226
226
|
return this.stateStorage.set(i, s), s;
|
|
227
227
|
}
|
|
228
228
|
/**
|
|
@@ -235,28 +235,33 @@ class pt {
|
|
|
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((n) => {
|
|
239
|
+
const r = this.componentRenderFunctions.get(n);
|
|
240
|
+
r && fe(r, n);
|
|
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 n = this.componentDependencies.get(t);
|
|
248
|
+
n && (n.forEach((r) => r.removeDependent(t)), this.componentDependencies.delete(t)), this.componentRenderFunctions.delete(t);
|
|
249
|
+
for (const r of Array.from(this.stateStorage.keys()))
|
|
250
|
+
r.startsWith(t + ":") && this.stateStorage.delete(r);
|
|
251
251
|
this.stateIndexCounter.delete(t);
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
|
-
const F = new
|
|
255
|
-
class
|
|
254
|
+
const F = new gt();
|
|
255
|
+
class He {
|
|
256
256
|
_value;
|
|
257
257
|
dependents = /* @__PURE__ */ new Set();
|
|
258
258
|
constructor(t) {
|
|
259
259
|
this._value = this.makeReactive(t);
|
|
260
|
+
try {
|
|
261
|
+
const n = Symbol.for("@cer/ReactiveState");
|
|
262
|
+
Object.defineProperty(this, n, { value: !0, enumerable: !1, configurable: !1 });
|
|
263
|
+
} catch {
|
|
264
|
+
}
|
|
260
265
|
}
|
|
261
266
|
get value() {
|
|
262
267
|
return F.trackDependency(this), this._value;
|
|
@@ -279,159 +284,172 @@ class De {
|
|
|
279
284
|
return this.dependents;
|
|
280
285
|
}
|
|
281
286
|
makeReactive(t) {
|
|
282
|
-
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 : rt.createReactiveProxy(
|
|
283
288
|
t,
|
|
284
289
|
() => F.triggerUpdate(this),
|
|
285
|
-
(
|
|
290
|
+
(n) => this.makeReactive(n)
|
|
286
291
|
);
|
|
287
292
|
}
|
|
288
293
|
}
|
|
289
|
-
function
|
|
294
|
+
function fn(e) {
|
|
290
295
|
return F.getOrCreateState(e === void 0 ? null : e);
|
|
291
296
|
}
|
|
292
|
-
function
|
|
293
|
-
|
|
297
|
+
function ee(e) {
|
|
298
|
+
if (!e || typeof e != "object") return !1;
|
|
299
|
+
try {
|
|
300
|
+
const t = Symbol.for("@cer/ReactiveState");
|
|
301
|
+
if (e[t]) return !0;
|
|
302
|
+
} catch {
|
|
303
|
+
}
|
|
304
|
+
try {
|
|
305
|
+
return !!(e.constructor && e.constructor.name === "ReactiveState");
|
|
306
|
+
} catch {
|
|
307
|
+
return !1;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
function dn(e) {
|
|
311
|
+
const t = new He(e());
|
|
294
312
|
return {
|
|
295
313
|
get value() {
|
|
296
314
|
return F.trackDependency(t), e();
|
|
297
315
|
}
|
|
298
316
|
};
|
|
299
317
|
}
|
|
300
|
-
function
|
|
301
|
-
let
|
|
302
|
-
|
|
318
|
+
function pn(e, t, n = {}) {
|
|
319
|
+
let r = e();
|
|
320
|
+
n.immediate && t(r, r);
|
|
303
321
|
const i = `watch-${Math.random().toString(36).substr(2, 9)}`, s = () => {
|
|
304
322
|
F.setCurrentComponent(i, s);
|
|
305
323
|
const o = e();
|
|
306
|
-
F.clearCurrentComponent(), o !==
|
|
324
|
+
F.clearCurrentComponent(), o !== r && (t(o, r), r = o);
|
|
307
325
|
};
|
|
308
326
|
return F.setCurrentComponent(i, s), e(), F.clearCurrentComponent(), () => {
|
|
309
327
|
F.cleanup(i);
|
|
310
328
|
};
|
|
311
329
|
}
|
|
312
|
-
const
|
|
313
|
-
function
|
|
314
|
-
if (
|
|
315
|
-
return
|
|
330
|
+
const xe = /* @__PURE__ */ new Map(), ve = /* @__PURE__ */ new Map(), ke = /* @__PURE__ */ new Map(), Ue = 500;
|
|
331
|
+
function ne(e) {
|
|
332
|
+
if (xe.has(e))
|
|
333
|
+
return xe.get(e);
|
|
316
334
|
const t = e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
317
|
-
return
|
|
335
|
+
return xe.size < Ue && xe.set(e, t), t;
|
|
318
336
|
}
|
|
319
|
-
function
|
|
320
|
-
if (
|
|
321
|
-
return
|
|
322
|
-
const t = e.replace(/-([a-z])/g, (
|
|
323
|
-
return
|
|
337
|
+
function it(e) {
|
|
338
|
+
if (ve.has(e))
|
|
339
|
+
return ve.get(e);
|
|
340
|
+
const t = e.replace(/-([a-z])/g, (n, r) => r.toUpperCase());
|
|
341
|
+
return ve.size < Ue && ve.set(e, t), t;
|
|
324
342
|
}
|
|
325
|
-
function
|
|
343
|
+
function ie(e) {
|
|
326
344
|
if (typeof e == "string") {
|
|
327
|
-
if (
|
|
328
|
-
return
|
|
345
|
+
if (ke.has(e))
|
|
346
|
+
return ke.get(e);
|
|
329
347
|
const t = e.replace(
|
|
330
348
|
/[&<>"']/g,
|
|
331
|
-
(
|
|
349
|
+
(n) => ({
|
|
332
350
|
"&": "&",
|
|
333
351
|
"<": "<",
|
|
334
352
|
">": ">",
|
|
335
353
|
'"': """,
|
|
336
354
|
"'": "'"
|
|
337
|
-
})[
|
|
355
|
+
})[n]
|
|
338
356
|
);
|
|
339
|
-
return t !== e &&
|
|
357
|
+
return t !== e && ke.size < Ue && ke.set(e, t), t;
|
|
340
358
|
}
|
|
341
359
|
return e;
|
|
342
360
|
}
|
|
343
361
|
function H(e, t) {
|
|
344
362
|
if (typeof t == "string") {
|
|
345
|
-
const
|
|
346
|
-
return
|
|
363
|
+
const n = t.split(".").reduce((r, i) => r?.[i], e);
|
|
364
|
+
return ee(n) ? n.value : n;
|
|
347
365
|
}
|
|
348
366
|
return t;
|
|
349
367
|
}
|
|
350
|
-
function
|
|
351
|
-
const
|
|
368
|
+
function Ee(e, t, n) {
|
|
369
|
+
const r = String(t).split("."), i = r.pop();
|
|
352
370
|
if (!i) return;
|
|
353
|
-
const s =
|
|
354
|
-
s[i]
|
|
371
|
+
const s = r.reduce((o, a) => (o[a] == null && (o[a] = {}), o[a]), e);
|
|
372
|
+
ee(s[i]) ? s[i].value = n : s[i] = n;
|
|
355
373
|
}
|
|
356
|
-
const
|
|
357
|
-
function
|
|
358
|
-
|
|
374
|
+
const st = typeof process < "u" && process.env?.NODE_ENV !== "production";
|
|
375
|
+
function se(e, ...t) {
|
|
376
|
+
st && console.error(e, ...t);
|
|
359
377
|
}
|
|
360
|
-
function
|
|
361
|
-
|
|
378
|
+
function Oe(e, ...t) {
|
|
379
|
+
st && console.warn(e, ...t);
|
|
362
380
|
}
|
|
363
|
-
function
|
|
364
|
-
if (
|
|
365
|
-
for (const [
|
|
381
|
+
function yt(e, t, n) {
|
|
382
|
+
if (n)
|
|
383
|
+
for (const [r, i] of Object.entries(n)) {
|
|
366
384
|
let s, o = {};
|
|
367
|
-
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(r, {
|
|
368
386
|
callback: s,
|
|
369
387
|
options: o,
|
|
370
|
-
oldValue: H(e,
|
|
388
|
+
oldValue: H(e, r)
|
|
371
389
|
}), o.immediate)
|
|
372
390
|
try {
|
|
373
|
-
const a = H(e,
|
|
391
|
+
const a = H(e, r);
|
|
374
392
|
s(a, void 0, e);
|
|
375
393
|
} catch (a) {
|
|
376
|
-
|
|
394
|
+
se(`Error in immediate watcher for "${r}":`, a);
|
|
377
395
|
}
|
|
378
396
|
}
|
|
379
397
|
}
|
|
380
|
-
function
|
|
398
|
+
function mt(e, t, n, r) {
|
|
381
399
|
const i = (o, a) => {
|
|
382
400
|
if (o === a) return !0;
|
|
383
401
|
if (typeof o != typeof a || typeof o != "object" || o === null || a === null) return !1;
|
|
384
402
|
if (Array.isArray(o) && Array.isArray(a))
|
|
385
|
-
return o.length !== a.length ? !1 : o.every((g,
|
|
386
|
-
const u = Object.keys(o),
|
|
387
|
-
return u.length !==
|
|
388
|
-
}, s = t.get(
|
|
389
|
-
if (s && !i(
|
|
403
|
+
return o.length !== a.length ? !1 : o.every((g, b) => i(g, a[b]));
|
|
404
|
+
const u = Object.keys(o), y = Object.keys(a);
|
|
405
|
+
return u.length !== y.length ? !1 : u.every((g) => i(o[g], a[g]));
|
|
406
|
+
}, s = t.get(n);
|
|
407
|
+
if (s && !i(r, s.oldValue))
|
|
390
408
|
try {
|
|
391
|
-
s.callback(
|
|
409
|
+
s.callback(r, s.oldValue, e), s.oldValue = r;
|
|
392
410
|
} catch (o) {
|
|
393
|
-
|
|
411
|
+
se(`Error in watcher for "${n}":`, o);
|
|
394
412
|
}
|
|
395
413
|
for (const [o, a] of t.entries())
|
|
396
|
-
if (a.options.deep &&
|
|
414
|
+
if (a.options.deep && n.startsWith(o + "."))
|
|
397
415
|
try {
|
|
398
416
|
const u = H(e, o);
|
|
399
417
|
i(u, a.oldValue) || (a.callback(u, a.oldValue, e), a.oldValue = u);
|
|
400
418
|
} catch (u) {
|
|
401
|
-
|
|
419
|
+
se(`Error in deep watcher for "${o}":`, u);
|
|
402
420
|
}
|
|
403
421
|
}
|
|
404
|
-
function
|
|
422
|
+
function Ke(e, t) {
|
|
405
423
|
return t === Boolean ? e === "true" : t === Number ? Number(e) : e;
|
|
406
424
|
}
|
|
407
|
-
function
|
|
408
|
-
t && Object.entries(t).forEach(([
|
|
409
|
-
const s =
|
|
410
|
-
if (i.type === Function && typeof e[
|
|
411
|
-
r
|
|
412
|
-
else if (typeof e[
|
|
425
|
+
function bt(e, t, n) {
|
|
426
|
+
t && Object.entries(t).forEach(([r, i]) => {
|
|
427
|
+
const s = ne(r), o = e.getAttribute(s);
|
|
428
|
+
if (i.type === Function && typeof e[r] == "function")
|
|
429
|
+
n[r] = e[r];
|
|
430
|
+
else if (typeof e[r] < "u")
|
|
413
431
|
try {
|
|
414
|
-
const a = e[
|
|
415
|
-
i.type === Boolean && typeof a == "boolean" || i.type === Number && typeof a == "number" || i.type === Function && typeof a == "function" ? r
|
|
432
|
+
const a = e[r];
|
|
433
|
+
i.type === Boolean && typeof a == "boolean" || i.type === Number && typeof a == "number" || i.type === Function && typeof a == "function" ? n[r] = a : n[r] = ie(Ke(String(a), i.type));
|
|
416
434
|
} catch {
|
|
417
|
-
r
|
|
435
|
+
n[r] = e[r];
|
|
418
436
|
}
|
|
419
|
-
else o !== null ? r
|
|
437
|
+
else o !== null ? n[r] = ie(Ke(o, i.type)) : "default" in i && i.default !== void 0 && (n[r] = ie(i.default));
|
|
420
438
|
});
|
|
421
439
|
}
|
|
422
|
-
function
|
|
423
|
-
t.props &&
|
|
440
|
+
function wt(e, t, n) {
|
|
441
|
+
t.props && bt(e, t.props, n);
|
|
424
442
|
}
|
|
425
|
-
function
|
|
426
|
-
e.onConnected && !
|
|
443
|
+
function xt(e, t, n, r) {
|
|
444
|
+
e.onConnected && !n && (e.onConnected(t), r(!0));
|
|
427
445
|
}
|
|
428
|
-
function
|
|
429
|
-
e.onDisconnected && e.onDisconnected(t),
|
|
446
|
+
function vt(e, t, n, r, i, s, o, a) {
|
|
447
|
+
e.onDisconnected && e.onDisconnected(t), n.forEach((u) => u()), r(), i(), s(!1), o(null), a(!1);
|
|
430
448
|
}
|
|
431
|
-
function
|
|
432
|
-
e.onAttributeChanged && e.onAttributeChanged(t,
|
|
449
|
+
function kt(e, t, n, r, i) {
|
|
450
|
+
e.onAttributeChanged && e.onAttributeChanged(t, n, r, i);
|
|
433
451
|
}
|
|
434
|
-
class
|
|
452
|
+
class Ct {
|
|
435
453
|
static cache = /* @__PURE__ */ new Map();
|
|
436
454
|
static maxCacheSize = 1e3;
|
|
437
455
|
// Dangerous patterns to block
|
|
@@ -452,14 +470,14 @@ class xt {
|
|
|
452
470
|
/fetch/i,
|
|
453
471
|
/XMLHttpRequest/i
|
|
454
472
|
];
|
|
455
|
-
static evaluate(t,
|
|
456
|
-
const
|
|
457
|
-
if (
|
|
458
|
-
if (!
|
|
459
|
-
|
|
473
|
+
static evaluate(t, n) {
|
|
474
|
+
const r = this.cache.get(t);
|
|
475
|
+
if (r) {
|
|
476
|
+
if (!r.isSecure) {
|
|
477
|
+
Oe("Blocked cached dangerous expression:", t);
|
|
460
478
|
return;
|
|
461
479
|
}
|
|
462
|
-
return
|
|
480
|
+
return r.evaluator(n);
|
|
463
481
|
}
|
|
464
482
|
const i = this.createEvaluator(t);
|
|
465
483
|
if (this.cache.size >= this.maxCacheSize) {
|
|
@@ -467,10 +485,10 @@ class xt {
|
|
|
467
485
|
s && this.cache.delete(s);
|
|
468
486
|
}
|
|
469
487
|
if (this.cache.set(t, i), !i.isSecure) {
|
|
470
|
-
|
|
488
|
+
Oe("Blocked dangerous expression:", t);
|
|
471
489
|
return;
|
|
472
490
|
}
|
|
473
|
-
return i.evaluator(
|
|
491
|
+
return i.evaluator(n);
|
|
474
492
|
}
|
|
475
493
|
static createEvaluator(t) {
|
|
476
494
|
if (this.hasDangerousPatterns(t))
|
|
@@ -481,28 +499,28 @@ class xt {
|
|
|
481
499
|
}, isSecure: !1 };
|
|
482
500
|
try {
|
|
483
501
|
return { evaluator: this.createSafeEvaluator(t), isSecure: !0 };
|
|
484
|
-
} catch (
|
|
485
|
-
return
|
|
502
|
+
} catch (n) {
|
|
503
|
+
return Oe("Failed to create evaluator for expression:", t, n), { evaluator: () => {
|
|
486
504
|
}, isSecure: !1 };
|
|
487
505
|
}
|
|
488
506
|
}
|
|
489
507
|
static hasDangerousPatterns(t) {
|
|
490
|
-
return this.dangerousPatterns.some((
|
|
508
|
+
return this.dangerousPatterns.some((n) => n.test(t));
|
|
491
509
|
}
|
|
492
510
|
static createSafeEvaluator(t) {
|
|
493
511
|
if (t.trim().startsWith("{") && t.trim().endsWith("}"))
|
|
494
512
|
return this.createObjectEvaluator(t);
|
|
495
513
|
if (/^ctx\.[a-zA-Z0-9_\.]+$/.test(t.trim())) {
|
|
496
|
-
const
|
|
497
|
-
return (
|
|
514
|
+
const n = t.trim().slice(4);
|
|
515
|
+
return (r) => H(r, n);
|
|
498
516
|
}
|
|
499
|
-
return t.includes("ctx") || /[+\-*/%<>=&|?:\[\]]/.test(t) ? this.createSimpleEvaluator(t) : (
|
|
517
|
+
return t.includes("ctx") || /[+\-*/%<>=&|?:\[\]]/.test(t) ? this.createSimpleEvaluator(t) : (n) => H(n, t);
|
|
500
518
|
}
|
|
501
519
|
static createObjectEvaluator(t) {
|
|
502
|
-
const
|
|
520
|
+
const n = t.trim().slice(1, -1), r = this.parseObjectProperties(n);
|
|
503
521
|
return (i) => {
|
|
504
522
|
const s = {};
|
|
505
|
-
for (const { key: o, value: a } of
|
|
523
|
+
for (const { key: o, value: a } of r)
|
|
506
524
|
try {
|
|
507
525
|
if (a.startsWith("ctx.")) {
|
|
508
526
|
const u = a.slice(4);
|
|
@@ -516,51 +534,51 @@ class xt {
|
|
|
516
534
|
};
|
|
517
535
|
}
|
|
518
536
|
static parseObjectProperties(t) {
|
|
519
|
-
const
|
|
520
|
-
for (const i of
|
|
537
|
+
const n = [], r = t.split(",");
|
|
538
|
+
for (const i of r) {
|
|
521
539
|
const s = i.indexOf(":");
|
|
522
540
|
if (s === -1) continue;
|
|
523
541
|
const o = i.slice(0, s).trim(), a = i.slice(s + 1).trim(), u = o.replace(/^['"]|['"]$/g, "");
|
|
524
|
-
|
|
542
|
+
n.push({ key: u, value: a });
|
|
525
543
|
}
|
|
526
|
-
return
|
|
544
|
+
return n;
|
|
527
545
|
}
|
|
528
546
|
static createSimpleEvaluator(t) {
|
|
529
|
-
return (
|
|
547
|
+
return (n) => {
|
|
530
548
|
try {
|
|
531
|
-
let
|
|
549
|
+
let r = t;
|
|
532
550
|
const i = [];
|
|
533
|
-
|
|
534
|
-
const s =
|
|
535
|
-
for (const
|
|
536
|
-
const h =
|
|
551
|
+
r = r.replace(/("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')/g, (b) => `<<#${i.push(b) - 1}#>>`);
|
|
552
|
+
const s = r.match(/ctx\.[\w.]+/g) || [];
|
|
553
|
+
for (const b of s) {
|
|
554
|
+
const h = b.slice(4), l = H(n, h);
|
|
537
555
|
if (l === void 0) return;
|
|
538
556
|
const d = i.push(JSON.stringify(l)) - 1;
|
|
539
|
-
|
|
557
|
+
r = r.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${d}#>>`);
|
|
540
558
|
}
|
|
541
|
-
const o = /\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g, a =
|
|
542
|
-
for (const
|
|
543
|
-
if (
|
|
544
|
-
const h = H(
|
|
559
|
+
const o = /\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g, a = r.match(o) || [];
|
|
560
|
+
for (const b of a) {
|
|
561
|
+
if (b.startsWith("ctx.")) continue;
|
|
562
|
+
const h = H(n, b);
|
|
545
563
|
if (h === void 0) return;
|
|
546
564
|
const l = i.push(JSON.stringify(h)) - 1;
|
|
547
|
-
|
|
565
|
+
r = r.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${l}#>>`);
|
|
548
566
|
}
|
|
549
567
|
const u = /\b([a-zA-Z_][a-zA-Z0-9_]*)\b/g;
|
|
550
|
-
let
|
|
568
|
+
let y;
|
|
551
569
|
const g = /* @__PURE__ */ new Set();
|
|
552
|
-
for (; (
|
|
553
|
-
const
|
|
554
|
-
if (["true", "false", "null", "undefined"].includes(
|
|
555
|
-
g.add(
|
|
556
|
-
const h = H(
|
|
570
|
+
for (; (y = u.exec(r)) !== null; ) {
|
|
571
|
+
const b = y[1];
|
|
572
|
+
if (["true", "false", "null", "undefined"].includes(b) || /^[0-9]+$/.test(b) || b === "ctx" || g.has(b)) continue;
|
|
573
|
+
g.add(b);
|
|
574
|
+
const h = H(n, b);
|
|
557
575
|
if (h === void 0) return;
|
|
558
576
|
const l = JSON.stringify(h), d = i.push(l) - 1;
|
|
559
|
-
|
|
577
|
+
b.includes(".") ? r = r.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${d}#>>`) : r = r.replace(new RegExp("\\b" + b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") + "\\b", "g"), `<<#${d}#>>`);
|
|
560
578
|
}
|
|
561
|
-
|
|
579
|
+
r = r.replace(/<<#(\d+)#>>/g, (b, h) => i[Number(h)]);
|
|
562
580
|
try {
|
|
563
|
-
return this.evaluateBasicExpression(
|
|
581
|
+
return this.evaluateBasicExpression(r);
|
|
564
582
|
} catch {
|
|
565
583
|
return;
|
|
566
584
|
}
|
|
@@ -575,13 +593,13 @@ class xt {
|
|
|
575
593
|
* arithmetic (+ - * / %), comparisons, logical && and ||, parentheses, and ternary `a ? b : c`.
|
|
576
594
|
*/
|
|
577
595
|
static evaluateBasicExpression(t) {
|
|
578
|
-
const
|
|
579
|
-
let
|
|
596
|
+
const n = this.tokenize(t);
|
|
597
|
+
let r = 0;
|
|
580
598
|
function i() {
|
|
581
|
-
return r
|
|
599
|
+
return n[r];
|
|
582
600
|
}
|
|
583
601
|
function s(c) {
|
|
584
|
-
const p = r
|
|
602
|
+
const p = n[r++];
|
|
585
603
|
if (c && !p)
|
|
586
604
|
throw new Error(`Unexpected token EOF, expected ${c}`);
|
|
587
605
|
if (c && p && p.type !== c && p.value !== c)
|
|
@@ -597,21 +615,21 @@ class xt {
|
|
|
597
615
|
s("?");
|
|
598
616
|
const p = o();
|
|
599
617
|
s(":");
|
|
600
|
-
const
|
|
601
|
-
return c ? p :
|
|
618
|
+
const m = o();
|
|
619
|
+
return c ? p : m;
|
|
602
620
|
}
|
|
603
621
|
return c;
|
|
604
622
|
}
|
|
605
623
|
function u() {
|
|
606
|
-
let c =
|
|
624
|
+
let c = y();
|
|
607
625
|
for (; i() && i().value === "||"; ) {
|
|
608
626
|
s("OP");
|
|
609
|
-
const p =
|
|
627
|
+
const p = y();
|
|
610
628
|
c = c || p;
|
|
611
629
|
}
|
|
612
630
|
return c;
|
|
613
631
|
}
|
|
614
|
-
function
|
|
632
|
+
function y() {
|
|
615
633
|
let c = g();
|
|
616
634
|
for (; i() && i().value === "&&"; ) {
|
|
617
635
|
s("OP");
|
|
@@ -621,42 +639,42 @@ class xt {
|
|
|
621
639
|
return c;
|
|
622
640
|
}
|
|
623
641
|
function g() {
|
|
624
|
-
let c =
|
|
642
|
+
let c = b();
|
|
625
643
|
for (; i() && ["==", "!=", "===", "!=="].includes(i().value); ) {
|
|
626
|
-
const p = s("OP").value,
|
|
644
|
+
const p = s("OP").value, m = b();
|
|
627
645
|
switch (p) {
|
|
628
646
|
case "==":
|
|
629
|
-
c = c ==
|
|
647
|
+
c = c == m;
|
|
630
648
|
break;
|
|
631
649
|
case "!=":
|
|
632
|
-
c = c !=
|
|
650
|
+
c = c != m;
|
|
633
651
|
break;
|
|
634
652
|
case "===":
|
|
635
|
-
c = c ===
|
|
653
|
+
c = c === m;
|
|
636
654
|
break;
|
|
637
655
|
case "!==":
|
|
638
|
-
c = c !==
|
|
656
|
+
c = c !== m;
|
|
639
657
|
break;
|
|
640
658
|
}
|
|
641
659
|
}
|
|
642
660
|
return c;
|
|
643
661
|
}
|
|
644
|
-
function
|
|
662
|
+
function b() {
|
|
645
663
|
let c = h();
|
|
646
664
|
for (; i() && [">", "<", ">=", "<="].includes(i().value); ) {
|
|
647
|
-
const p = s("OP").value,
|
|
665
|
+
const p = s("OP").value, m = h();
|
|
648
666
|
switch (p) {
|
|
649
667
|
case ">":
|
|
650
|
-
c = c >
|
|
668
|
+
c = c > m;
|
|
651
669
|
break;
|
|
652
670
|
case "<":
|
|
653
|
-
c = c <
|
|
671
|
+
c = c < m;
|
|
654
672
|
break;
|
|
655
673
|
case ">=":
|
|
656
|
-
c = c >=
|
|
674
|
+
c = c >= m;
|
|
657
675
|
break;
|
|
658
676
|
case "<=":
|
|
659
|
-
c = c <=
|
|
677
|
+
c = c <= m;
|
|
660
678
|
break;
|
|
661
679
|
}
|
|
662
680
|
}
|
|
@@ -665,33 +683,33 @@ class xt {
|
|
|
665
683
|
function h() {
|
|
666
684
|
let c = l();
|
|
667
685
|
for (; i() && (i().value === "+" || i().value === "-"); ) {
|
|
668
|
-
const p = s("OP").value,
|
|
669
|
-
c = p === "+" ? c +
|
|
686
|
+
const p = s("OP").value, m = l();
|
|
687
|
+
c = p === "+" ? c + m : c - m;
|
|
670
688
|
}
|
|
671
689
|
return c;
|
|
672
690
|
}
|
|
673
691
|
function l() {
|
|
674
692
|
let c = d();
|
|
675
693
|
for (; i() && (i().value === "*" || i().value === "/" || i().value === "%"); ) {
|
|
676
|
-
const p = s("OP").value,
|
|
694
|
+
const p = s("OP").value, m = d();
|
|
677
695
|
switch (p) {
|
|
678
696
|
case "*":
|
|
679
|
-
c = c *
|
|
697
|
+
c = c * m;
|
|
680
698
|
break;
|
|
681
699
|
case "/":
|
|
682
|
-
c = c /
|
|
700
|
+
c = c / m;
|
|
683
701
|
break;
|
|
684
702
|
case "%":
|
|
685
|
-
c = c %
|
|
703
|
+
c = c % m;
|
|
686
704
|
break;
|
|
687
705
|
}
|
|
688
706
|
}
|
|
689
707
|
return c;
|
|
690
708
|
}
|
|
691
709
|
function d() {
|
|
692
|
-
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();
|
|
693
711
|
}
|
|
694
|
-
function
|
|
712
|
+
function x() {
|
|
695
713
|
const c = i();
|
|
696
714
|
if (c) {
|
|
697
715
|
if (c.type === "NUMBER")
|
|
@@ -718,21 +736,21 @@ class xt {
|
|
|
718
736
|
return o();
|
|
719
737
|
}
|
|
720
738
|
static tokenize(t) {
|
|
721
|
-
const
|
|
739
|
+
const n = [], r = /\s*(=>|===|!==|==|!=|>=|<=|\|\||&&|[()?:,\[\]]|\+|-|\*|\/|%|>|<|!|\d+\.?\d*|"[^"]*"|'[^']*'|[a-zA-Z_][a-zA-Z0-9_]*|\S)\s*/g;
|
|
722
740
|
let i;
|
|
723
|
-
for (; (i =
|
|
741
|
+
for (; (i = r.exec(t)) !== null; ) {
|
|
724
742
|
const s = i[1];
|
|
725
|
-
s && (/^\d/.test(s) ?
|
|
743
|
+
s && (/^\d/.test(s) ? n.push({ type: "NUMBER", value: s }) : /^"/.test(s) || /^'/.test(s) ? n.push({ type: "STRING", value: s }) : /^[a-zA-Z_]/.test(s) ? n.push({ type: "IDENT", value: s }) : /^[()?:,\[\]]$/.test(s) ? n.push({ type: "PUNC", value: s }) : n.push({ type: "OP", value: s }));
|
|
726
744
|
}
|
|
727
|
-
return
|
|
745
|
+
return n;
|
|
728
746
|
}
|
|
729
|
-
static evaluateSimpleValue(t,
|
|
747
|
+
static evaluateSimpleValue(t, n) {
|
|
730
748
|
if (t === "true") return !0;
|
|
731
749
|
if (t === "false") return !1;
|
|
732
750
|
if (!isNaN(Number(t))) return Number(t);
|
|
733
751
|
if (t.startsWith("ctx.")) {
|
|
734
|
-
const
|
|
735
|
-
return H(
|
|
752
|
+
const r = t.slice(4);
|
|
753
|
+
return H(n, r);
|
|
736
754
|
}
|
|
737
755
|
return t.startsWith('"') && t.endsWith('"') || t.startsWith("'") && t.endsWith("'") ? t.slice(1, -1) : t;
|
|
738
756
|
}
|
|
@@ -743,14 +761,14 @@ class xt {
|
|
|
743
761
|
return this.cache.size;
|
|
744
762
|
}
|
|
745
763
|
}
|
|
746
|
-
class
|
|
764
|
+
class oe {
|
|
747
765
|
static cleanupFunctions = /* @__PURE__ */ new WeakMap();
|
|
748
766
|
/**
|
|
749
767
|
* Add an event listener with automatic cleanup tracking
|
|
750
768
|
*/
|
|
751
|
-
static addListener(t,
|
|
752
|
-
t.addEventListener(
|
|
753
|
-
const o = { event:
|
|
769
|
+
static addListener(t, n, r, i) {
|
|
770
|
+
t.addEventListener(n, r, i);
|
|
771
|
+
const o = { event: n, handler: r, options: i, cleanup: () => t.removeEventListener(n, r, i), addedAt: Date.now() };
|
|
754
772
|
this.cleanupFunctions.has(t) || this.cleanupFunctions.set(t, []);
|
|
755
773
|
const a = this.cleanupFunctions.get(t);
|
|
756
774
|
a.push(o), this.cleanupFunctions.get(t).__metaList = a;
|
|
@@ -758,13 +776,13 @@ class se {
|
|
|
758
776
|
/**
|
|
759
777
|
* Remove a specific event listener
|
|
760
778
|
*/
|
|
761
|
-
static removeListener(t,
|
|
762
|
-
t.removeEventListener(
|
|
779
|
+
static removeListener(t, n, r, i) {
|
|
780
|
+
t.removeEventListener(n, r, i);
|
|
763
781
|
const s = this.cleanupFunctions.get(t);
|
|
764
782
|
if (s) {
|
|
765
783
|
const o = s.__metaList || null;
|
|
766
784
|
if (o) {
|
|
767
|
-
const a = o.findIndex((u) => u.event ===
|
|
785
|
+
const a = o.findIndex((u) => u.event === n && u.handler === r && JSON.stringify(u.options) === JSON.stringify(i));
|
|
768
786
|
if (a >= 0) {
|
|
769
787
|
try {
|
|
770
788
|
o[a].cleanup();
|
|
@@ -783,8 +801,8 @@ class se {
|
|
|
783
801
|
* Clean up all event listeners for an element
|
|
784
802
|
*/
|
|
785
803
|
static cleanup(t) {
|
|
786
|
-
const
|
|
787
|
-
|
|
804
|
+
const n = this.cleanupFunctions.get(t);
|
|
805
|
+
n && ((n.__metaList || n).forEach((i) => {
|
|
788
806
|
try {
|
|
789
807
|
typeof i == "function" ? i() : i && typeof i.cleanup == "function" && i.cleanup();
|
|
790
808
|
} catch (s) {
|
|
@@ -806,52 +824,52 @@ class se {
|
|
|
806
824
|
* Check if an element has any tracked event listeners
|
|
807
825
|
*/
|
|
808
826
|
static hasListeners(t) {
|
|
809
|
-
const
|
|
810
|
-
return !!(
|
|
827
|
+
const n = this.cleanupFunctions.get(t), r = n ? n.__metaList || n : void 0;
|
|
828
|
+
return !!(r && r.length > 0);
|
|
811
829
|
}
|
|
812
830
|
/**
|
|
813
831
|
* Get the number of tracked event listeners for an element
|
|
814
832
|
*/
|
|
815
833
|
static getListenerCount(t) {
|
|
816
|
-
const
|
|
817
|
-
return
|
|
834
|
+
const n = this.cleanupFunctions.get(t), r = n ? n.__metaList || n : void 0;
|
|
835
|
+
return r ? r.length : 0;
|
|
818
836
|
}
|
|
819
837
|
}
|
|
820
|
-
function
|
|
838
|
+
function ue(e, t) {
|
|
821
839
|
if (t && e instanceof HTMLElement) {
|
|
822
|
-
|
|
823
|
-
for (const
|
|
824
|
-
t[
|
|
825
|
-
for (const
|
|
826
|
-
|
|
840
|
+
oe.cleanup(e);
|
|
841
|
+
for (const n in t)
|
|
842
|
+
t[n] === e && delete t[n];
|
|
843
|
+
for (const n of Array.from(e.childNodes))
|
|
844
|
+
ue(n, t);
|
|
827
845
|
}
|
|
828
846
|
}
|
|
829
|
-
function
|
|
847
|
+
function he(e, t, n) {
|
|
830
848
|
if (typeof e == "string") return;
|
|
831
|
-
const
|
|
832
|
-
|
|
849
|
+
const r = e.props?.reactiveRef ?? (e.props?.props && e.props.props.reactiveRef), i = e.props?.ref ?? (e.props?.props && e.props.props.ref);
|
|
850
|
+
r ? r.value = t : i && n && (n[i] = t);
|
|
833
851
|
}
|
|
834
|
-
function
|
|
852
|
+
function _t(e, t, n, r, i, s, o, a) {
|
|
835
853
|
if (!s) return;
|
|
836
|
-
const u = t.includes("lazy"),
|
|
837
|
-
if (
|
|
854
|
+
const u = t.includes("lazy"), y = t.includes("trim"), g = t.includes("number"), b = e && typeof e == "object" && "value" in e && typeof e.value < "u", h = () => {
|
|
855
|
+
if (b) {
|
|
838
856
|
const C = e.value;
|
|
839
857
|
return a && typeof C == "object" && C !== null ? C[a] : C;
|
|
840
858
|
}
|
|
841
859
|
return H(s._state || s, e);
|
|
842
860
|
}, l = h();
|
|
843
861
|
let d = "text";
|
|
844
|
-
o instanceof HTMLInputElement ? d =
|
|
845
|
-
const
|
|
862
|
+
o instanceof HTMLInputElement ? d = r?.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";
|
|
846
864
|
if (d === "checkbox")
|
|
847
865
|
if (Array.isArray(l))
|
|
848
|
-
|
|
866
|
+
n[c] = l.includes(String(o?.getAttribute("value") ?? r?.value ?? ""));
|
|
849
867
|
else {
|
|
850
868
|
const C = o?.getAttribute("true-value") ?? !0;
|
|
851
|
-
|
|
869
|
+
n[c] = l === C;
|
|
852
870
|
}
|
|
853
871
|
else if (d === "radio")
|
|
854
|
-
|
|
872
|
+
n[c] = l === (r?.value ?? "");
|
|
855
873
|
else if (d === "select")
|
|
856
874
|
if (o && o.hasAttribute("multiple") && o instanceof HTMLSelectElement) {
|
|
857
875
|
const C = Array.isArray(l) ? l.map(String) : [];
|
|
@@ -859,102 +877,102 @@ function kt(e, t, r, n, i, s, o, a) {
|
|
|
859
877
|
Array.from(o.options).forEach((k) => {
|
|
860
878
|
k.selected = C.includes(k.value);
|
|
861
879
|
});
|
|
862
|
-
}, 0),
|
|
880
|
+
}, 0), n[c] = Array.isArray(l) ? l : [];
|
|
863
881
|
} else
|
|
864
|
-
|
|
882
|
+
n[c] = l;
|
|
865
883
|
else {
|
|
866
|
-
|
|
884
|
+
n[c] = l;
|
|
867
885
|
try {
|
|
868
|
-
const C =
|
|
869
|
-
|
|
886
|
+
const C = ne(c);
|
|
887
|
+
r && (r[C] = l);
|
|
870
888
|
} catch {
|
|
871
889
|
}
|
|
872
890
|
}
|
|
873
|
-
const p = u || d === "checkbox" || d === "radio" || d === "select" ? "change" : "input",
|
|
891
|
+
const p = u || d === "checkbox" || d === "radio" || d === "select" ? "change" : "input", m = (C) => {
|
|
874
892
|
if (C.isComposing || i._isComposing) return;
|
|
875
893
|
const k = typeof globalThis.process < "u" && globalThis.process.env?.NODE_ENV === "test" || typeof window < "u" && window.__vitest__;
|
|
876
894
|
if (C.isTrusted === !1 && !k) return;
|
|
877
895
|
const f = C.target;
|
|
878
896
|
if (!f || f._modelUpdating) return;
|
|
879
|
-
let
|
|
897
|
+
let v = f.value;
|
|
880
898
|
if (d === "checkbox") {
|
|
881
|
-
const
|
|
882
|
-
if (Array.isArray(
|
|
883
|
-
const
|
|
899
|
+
const T = h();
|
|
900
|
+
if (Array.isArray(T)) {
|
|
901
|
+
const R = f.getAttribute("value") ?? "", S = Array.from(T);
|
|
884
902
|
if (f.checked)
|
|
885
|
-
|
|
903
|
+
S.includes(R) || S.push(R);
|
|
886
904
|
else {
|
|
887
|
-
const P =
|
|
888
|
-
P > -1 &&
|
|
905
|
+
const P = S.indexOf(R);
|
|
906
|
+
P > -1 && S.splice(P, 1);
|
|
889
907
|
}
|
|
890
|
-
|
|
908
|
+
v = S;
|
|
891
909
|
} else {
|
|
892
|
-
const
|
|
893
|
-
|
|
910
|
+
const R = f.getAttribute("true-value") ?? !0, S = f.getAttribute("false-value") ?? !1;
|
|
911
|
+
v = f.checked ? R : S;
|
|
894
912
|
}
|
|
895
913
|
} else if (d === "radio")
|
|
896
|
-
|
|
914
|
+
v = f.getAttribute("value") ?? f.value;
|
|
897
915
|
else if (d === "select" && f.multiple)
|
|
898
|
-
|
|
899
|
-
else if (
|
|
900
|
-
const
|
|
901
|
-
isNaN(
|
|
916
|
+
v = Array.from(f.selectedOptions).map((T) => T.value);
|
|
917
|
+
else if (y && typeof v == "string" && (v = v.trim()), g) {
|
|
918
|
+
const T = Number(v);
|
|
919
|
+
isNaN(T) || (v = T);
|
|
902
920
|
}
|
|
903
921
|
const A = s._state || s, _ = h();
|
|
904
|
-
if (Array.isArray(
|
|
922
|
+
if (Array.isArray(v) && Array.isArray(_) ? JSON.stringify([...v].sort()) !== JSON.stringify([..._].sort()) : v !== _) {
|
|
905
923
|
f._modelUpdating = !0;
|
|
906
924
|
try {
|
|
907
|
-
if (
|
|
925
|
+
if (b)
|
|
908
926
|
if (a && typeof e.value == "object" && e.value !== null) {
|
|
909
|
-
const
|
|
910
|
-
|
|
927
|
+
const T = { ...e.value };
|
|
928
|
+
T[a] = v, e.value = T;
|
|
911
929
|
} else
|
|
912
|
-
e.value =
|
|
930
|
+
e.value = v;
|
|
913
931
|
else
|
|
914
|
-
|
|
932
|
+
Ee(A, e, v);
|
|
915
933
|
if (s._requestRender && s._requestRender(), s._triggerWatchers) {
|
|
916
|
-
const
|
|
917
|
-
s._triggerWatchers(
|
|
934
|
+
const T = b ? "reactiveState" : e;
|
|
935
|
+
s._triggerWatchers(T, v);
|
|
918
936
|
}
|
|
919
937
|
if (f) {
|
|
920
|
-
const
|
|
921
|
-
detail:
|
|
938
|
+
const T = `update:${ne(c)}`, R = new CustomEvent(T, {
|
|
939
|
+
detail: v,
|
|
922
940
|
bubbles: !0,
|
|
923
941
|
composed: !0
|
|
924
942
|
});
|
|
925
|
-
f.dispatchEvent(
|
|
943
|
+
f.dispatchEvent(R);
|
|
926
944
|
}
|
|
927
945
|
} finally {
|
|
928
946
|
setTimeout(() => f._modelUpdating = !1, 0);
|
|
929
947
|
}
|
|
930
948
|
}
|
|
931
949
|
};
|
|
932
|
-
if (
|
|
950
|
+
if (x) {
|
|
933
951
|
if (i[p]) {
|
|
934
952
|
const C = i[p];
|
|
935
|
-
o &&
|
|
953
|
+
o && oe.removeListener(o, p, C);
|
|
936
954
|
}
|
|
937
|
-
i[p] =
|
|
955
|
+
i[p] = m;
|
|
938
956
|
} else {
|
|
939
|
-
const C = `update:${
|
|
957
|
+
const C = `update:${ne(c)}`;
|
|
940
958
|
if (i[C]) {
|
|
941
959
|
const k = i[C];
|
|
942
|
-
o &&
|
|
960
|
+
o && oe.removeListener(o, C, k);
|
|
943
961
|
}
|
|
944
962
|
i[C] = (k) => {
|
|
945
|
-
const f = s._state || s,
|
|
946
|
-
if (Array.isArray(
|
|
947
|
-
|
|
948
|
-
const
|
|
949
|
-
if (
|
|
950
|
-
|
|
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
|
+
const $ = k.target;
|
|
967
|
+
if ($) {
|
|
968
|
+
$[c] = v;
|
|
951
969
|
try {
|
|
952
|
-
const
|
|
953
|
-
typeof
|
|
970
|
+
const T = ne(c);
|
|
971
|
+
typeof v == "boolean" ? v ? $.setAttribute(T, "true") : $.setAttribute(T, "false") : $.setAttribute(T, String(v));
|
|
954
972
|
} catch {
|
|
955
973
|
}
|
|
956
974
|
queueMicrotask(() => {
|
|
957
|
-
typeof
|
|
975
|
+
typeof $._applyProps == "function" && $._applyProps($._cfg), typeof $._requestRender == "function" && $._requestRender();
|
|
958
976
|
});
|
|
959
977
|
}
|
|
960
978
|
}
|
|
@@ -964,16 +982,16 @@ function kt(e, t, r, n, i, s, o, a) {
|
|
|
964
982
|
i._isComposing = !1;
|
|
965
983
|
const k = C.target;
|
|
966
984
|
k && setTimeout(() => {
|
|
967
|
-
const f = k.value,
|
|
985
|
+
const f = k.value, v = s._state || s, A = H(v, e);
|
|
968
986
|
let _ = f;
|
|
969
|
-
if (
|
|
970
|
-
const
|
|
971
|
-
isNaN(
|
|
987
|
+
if (y && (_ = _.trim()), g) {
|
|
988
|
+
const T = Number(_);
|
|
989
|
+
isNaN(T) || (_ = T);
|
|
972
990
|
}
|
|
973
991
|
if (Array.isArray(_) && Array.isArray(A) ? JSON.stringify([..._].sort()) !== JSON.stringify([...A].sort()) : _ !== A) {
|
|
974
992
|
k._modelUpdating = !0;
|
|
975
993
|
try {
|
|
976
|
-
|
|
994
|
+
Ee(v, e, _), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, _);
|
|
977
995
|
} finally {
|
|
978
996
|
setTimeout(() => k._modelUpdating = !1, 0);
|
|
979
997
|
}
|
|
@@ -981,42 +999,42 @@ function kt(e, t, r, n, i, s, o, a) {
|
|
|
981
999
|
}, 0);
|
|
982
1000
|
});
|
|
983
1001
|
}
|
|
984
|
-
function
|
|
1002
|
+
function ot(e) {
|
|
985
1003
|
const t = e.slice(2);
|
|
986
1004
|
return t ? t.charAt(0).toLowerCase() + t.slice(1) : "";
|
|
987
1005
|
}
|
|
988
|
-
function
|
|
1006
|
+
function Et(e, t, n, r) {
|
|
989
1007
|
if (typeof e == "object" && e !== null)
|
|
990
1008
|
for (const [i, s] of Object.entries(e))
|
|
991
|
-
i.startsWith("data-") || i.startsWith("aria-") || i === "class" ?
|
|
1009
|
+
i.startsWith("data-") || i.startsWith("aria-") || i === "class" ? n[i] = s : t[i] = s;
|
|
992
1010
|
else if (typeof e == "string") {
|
|
993
|
-
if (!
|
|
1011
|
+
if (!r) return;
|
|
994
1012
|
try {
|
|
995
|
-
const i =
|
|
1013
|
+
const i = ye(e, r);
|
|
996
1014
|
if (typeof i == "object" && i !== null) {
|
|
997
1015
|
for (const [s, o] of Object.entries(i))
|
|
998
|
-
s.startsWith("data-") || s.startsWith("aria-") || s === "class" ?
|
|
1016
|
+
s.startsWith("data-") || s.startsWith("aria-") || s === "class" ? n[s] = o : t[s] = o;
|
|
999
1017
|
return;
|
|
1000
1018
|
} else {
|
|
1001
|
-
|
|
1019
|
+
n[e] = i;
|
|
1002
1020
|
return;
|
|
1003
1021
|
}
|
|
1004
1022
|
} catch {
|
|
1005
|
-
const i = H(
|
|
1006
|
-
|
|
1023
|
+
const i = H(r, e);
|
|
1024
|
+
n[e] = i;
|
|
1007
1025
|
}
|
|
1008
1026
|
}
|
|
1009
1027
|
}
|
|
1010
|
-
function
|
|
1011
|
-
let
|
|
1028
|
+
function $t(e, t, n) {
|
|
1029
|
+
let r;
|
|
1012
1030
|
if (typeof e == "string") {
|
|
1013
|
-
if (!
|
|
1014
|
-
|
|
1031
|
+
if (!n) return;
|
|
1032
|
+
r = ye(e, n);
|
|
1015
1033
|
} else
|
|
1016
|
-
|
|
1034
|
+
r = e;
|
|
1017
1035
|
const i = t.style || "";
|
|
1018
1036
|
let s = i;
|
|
1019
|
-
if (
|
|
1037
|
+
if (r) {
|
|
1020
1038
|
if (i) {
|
|
1021
1039
|
const o = i.split(";").map((u) => u.trim()).filter(Boolean), a = o.findIndex(
|
|
1022
1040
|
(u) => u.startsWith("display:")
|
|
@@ -1032,36 +1050,36 @@ function _t(e, t, r) {
|
|
|
1032
1050
|
s = "display: none";
|
|
1033
1051
|
s !== i && (s ? t.style = s : delete t.style);
|
|
1034
1052
|
}
|
|
1035
|
-
function
|
|
1036
|
-
return
|
|
1053
|
+
function ye(e, t) {
|
|
1054
|
+
return Ct.evaluate(e, t);
|
|
1037
1055
|
}
|
|
1038
|
-
function
|
|
1039
|
-
let
|
|
1056
|
+
function St(e, t, n) {
|
|
1057
|
+
let r;
|
|
1040
1058
|
if (typeof e == "string") {
|
|
1041
|
-
if (!
|
|
1042
|
-
|
|
1059
|
+
if (!n) return;
|
|
1060
|
+
r = ye(e, n);
|
|
1043
1061
|
} else
|
|
1044
|
-
|
|
1062
|
+
r = e;
|
|
1045
1063
|
let i = [];
|
|
1046
|
-
typeof
|
|
1064
|
+
typeof r == "string" ? i = [r] : Array.isArray(r) ? i = r.filter(Boolean) : typeof r == "object" && r !== null && (i = Object.entries(r).filter(([, a]) => !!a).flatMap(([a]) => a.split(/\s+/).filter(Boolean)));
|
|
1047
1065
|
const s = t.class || "", o = s ? `${s} ${i.join(" ")}`.trim() : i.join(" ");
|
|
1048
1066
|
o && (t.class = o);
|
|
1049
1067
|
}
|
|
1050
|
-
function
|
|
1051
|
-
let
|
|
1068
|
+
function At(e, t, n) {
|
|
1069
|
+
let r;
|
|
1052
1070
|
if (typeof e == "string") {
|
|
1053
|
-
if (!
|
|
1054
|
-
|
|
1071
|
+
if (!n) return;
|
|
1072
|
+
r = ye(e, n);
|
|
1055
1073
|
} else
|
|
1056
|
-
|
|
1074
|
+
r = e;
|
|
1057
1075
|
let i = "";
|
|
1058
|
-
if (typeof
|
|
1059
|
-
i =
|
|
1060
|
-
else if (
|
|
1076
|
+
if (typeof r == "string")
|
|
1077
|
+
i = r;
|
|
1078
|
+
else if (r && typeof r == "object") {
|
|
1061
1079
|
const o = [];
|
|
1062
|
-
for (const [a, u] of Object.entries(
|
|
1080
|
+
for (const [a, u] of Object.entries(r))
|
|
1063
1081
|
if (u != null && u !== "") {
|
|
1064
|
-
const
|
|
1082
|
+
const y = a.replace(
|
|
1065
1083
|
/[A-Z]/g,
|
|
1066
1084
|
(h) => `-${h.toLowerCase()}`
|
|
1067
1085
|
), g = [
|
|
@@ -1090,65 +1108,65 @@ function St(e, t, r) {
|
|
|
1090
1108
|
"min-height",
|
|
1091
1109
|
"max-height"
|
|
1092
1110
|
];
|
|
1093
|
-
let
|
|
1094
|
-
typeof u == "number" && g.includes(
|
|
1111
|
+
let b = String(u);
|
|
1112
|
+
typeof u == "number" && g.includes(y) && (b = `${u}px`), o.push(`${y}: ${b}`);
|
|
1095
1113
|
}
|
|
1096
1114
|
i = o.join("; ") + (o.length > 0 ? ";" : "");
|
|
1097
1115
|
}
|
|
1098
1116
|
const s = t.style || "";
|
|
1099
1117
|
t.style = s + (s && !s.endsWith(";") ? "; " : "") + i;
|
|
1100
1118
|
}
|
|
1101
|
-
function
|
|
1102
|
-
let
|
|
1103
|
-
typeof e == "string" &&
|
|
1119
|
+
function Tt(e, t, n) {
|
|
1120
|
+
let r = e;
|
|
1121
|
+
typeof e == "string" && n && (r = ye(e, n)), ee(r) ? t.reactiveRef = r : t.ref = r;
|
|
1104
1122
|
}
|
|
1105
|
-
function
|
|
1106
|
-
const i = {}, s = { ...
|
|
1123
|
+
function at(e, t, n, r) {
|
|
1124
|
+
const i = {}, s = { ...r || {} }, o = {};
|
|
1107
1125
|
for (const [a, u] of Object.entries(e)) {
|
|
1108
|
-
const { value:
|
|
1126
|
+
const { value: y, modifiers: g, arg: b } = u;
|
|
1109
1127
|
if (a === "model" || a.startsWith("model:")) {
|
|
1110
|
-
const h = a.split(":"), l = h.length > 1 ? h[1] :
|
|
1111
|
-
|
|
1112
|
-
|
|
1128
|
+
const h = a.split(":"), l = h.length > 1 ? h[1] : b;
|
|
1129
|
+
_t(
|
|
1130
|
+
y,
|
|
1113
1131
|
// Pass the original value (could be string or reactive state object)
|
|
1114
1132
|
g,
|
|
1115
1133
|
i,
|
|
1116
1134
|
s,
|
|
1117
1135
|
o,
|
|
1118
1136
|
t,
|
|
1119
|
-
|
|
1137
|
+
n,
|
|
1120
1138
|
l
|
|
1121
1139
|
);
|
|
1122
1140
|
continue;
|
|
1123
1141
|
}
|
|
1124
1142
|
switch (a) {
|
|
1125
1143
|
case "bind":
|
|
1126
|
-
|
|
1144
|
+
Et(y, i, s, t);
|
|
1127
1145
|
break;
|
|
1128
1146
|
case "show":
|
|
1129
|
-
|
|
1147
|
+
$t(y, s, t);
|
|
1130
1148
|
break;
|
|
1131
1149
|
case "class":
|
|
1132
|
-
|
|
1150
|
+
St(y, s, t);
|
|
1133
1151
|
break;
|
|
1134
1152
|
case "style":
|
|
1135
|
-
|
|
1153
|
+
At(y, s, t);
|
|
1136
1154
|
break;
|
|
1137
1155
|
case "ref":
|
|
1138
|
-
|
|
1156
|
+
Tt(y, i, t);
|
|
1139
1157
|
break;
|
|
1140
1158
|
}
|
|
1141
1159
|
}
|
|
1142
1160
|
return { props: i, attrs: s, listeners: o };
|
|
1143
1161
|
}
|
|
1144
|
-
function
|
|
1162
|
+
function Be(e, t) {
|
|
1145
1163
|
if (Array.isArray(e)) {
|
|
1146
1164
|
const s = /* @__PURE__ */ new Set();
|
|
1147
1165
|
return e.map((o) => {
|
|
1148
1166
|
if (!o || typeof o != "object") return o;
|
|
1149
1167
|
let a = o.props?.key ?? o.key;
|
|
1150
1168
|
if (!a) {
|
|
1151
|
-
const
|
|
1169
|
+
const b = o.tag || "node", l = [
|
|
1152
1170
|
// attrs (kebab-case)
|
|
1153
1171
|
o.props?.attrs?.id,
|
|
1154
1172
|
o.props?.attrs?.name,
|
|
@@ -1159,66 +1177,66 @@ function Ie(e, t) {
|
|
|
1159
1177
|
o.props?.props?.dataKey,
|
|
1160
1178
|
o.props?.props?.["data-key"]
|
|
1161
1179
|
].find((d) => d != null) ?? "";
|
|
1162
|
-
a = l ? `${t}:${
|
|
1180
|
+
a = l ? `${t}:${b}:${l}` : `${t}:${b}`;
|
|
1163
1181
|
}
|
|
1164
|
-
let u = a,
|
|
1182
|
+
let u = a, y = 1;
|
|
1165
1183
|
for (; s.has(u); )
|
|
1166
|
-
u = `${a}#${
|
|
1184
|
+
u = `${a}#${y++}`;
|
|
1167
1185
|
s.add(u);
|
|
1168
1186
|
let g = o.children;
|
|
1169
|
-
return Array.isArray(g) && (g =
|
|
1187
|
+
return Array.isArray(g) && (g = Be(g, u)), { ...o, key: u, children: g };
|
|
1170
1188
|
});
|
|
1171
1189
|
}
|
|
1172
|
-
const
|
|
1173
|
-
let
|
|
1174
|
-
return Array.isArray(i) && (i =
|
|
1190
|
+
const n = e;
|
|
1191
|
+
let r = n.props?.key ?? n.key ?? t, i = n.children;
|
|
1192
|
+
return Array.isArray(i) && (i = Be(i, r)), { ...n, key: r, children: i };
|
|
1175
1193
|
}
|
|
1176
|
-
function
|
|
1177
|
-
const i =
|
|
1194
|
+
function Ve(e, t, n, r) {
|
|
1195
|
+
const i = n.directives ?? {}, s = at(
|
|
1178
1196
|
i,
|
|
1179
|
-
|
|
1197
|
+
r,
|
|
1180
1198
|
e,
|
|
1181
|
-
|
|
1199
|
+
n.attrs
|
|
1182
1200
|
), o = {
|
|
1183
1201
|
...t.props,
|
|
1184
|
-
...
|
|
1202
|
+
...n.props,
|
|
1185
1203
|
...s.props
|
|
1186
1204
|
}, a = {
|
|
1187
1205
|
...t.attrs,
|
|
1188
|
-
...
|
|
1206
|
+
...n.attrs,
|
|
1189
1207
|
...s.attrs
|
|
1190
|
-
}, u = t.props ?? {},
|
|
1191
|
-
let
|
|
1192
|
-
for (const d in { ...u, ...
|
|
1193
|
-
const
|
|
1194
|
-
if (
|
|
1195
|
-
if (
|
|
1196
|
-
e.value !==
|
|
1208
|
+
}, u = t.props ?? {}, y = o, g = n?.isCustomElement ?? t?.isCustomElement ?? !1;
|
|
1209
|
+
let b = !1;
|
|
1210
|
+
for (const d in { ...u, ...y }) {
|
|
1211
|
+
const x = u[d], w = y[d];
|
|
1212
|
+
if (x !== w)
|
|
1213
|
+
if (b = !0, d === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement))
|
|
1214
|
+
e.value !== w && (e.value = w ?? "");
|
|
1197
1215
|
else if (d === "checked" && e instanceof HTMLInputElement)
|
|
1198
|
-
e.checked = !!
|
|
1199
|
-
else if (d.startsWith("on") && typeof
|
|
1200
|
-
const c =
|
|
1201
|
-
typeof
|
|
1202
|
-
} else if (
|
|
1216
|
+
e.checked = !!w;
|
|
1217
|
+
else if (d.startsWith("on") && typeof w == "function") {
|
|
1218
|
+
const c = ot(d);
|
|
1219
|
+
typeof x == "function" && oe.removeListener(e, c, x), oe.addListener(e, c, w);
|
|
1220
|
+
} else if (w == null)
|
|
1203
1221
|
e.removeAttribute(d);
|
|
1204
|
-
else if ((
|
|
1222
|
+
else if ((n?.isCustomElement ?? t?.isCustomElement ?? !1) || d in e)
|
|
1205
1223
|
try {
|
|
1206
|
-
e[d] =
|
|
1224
|
+
e[d] = w;
|
|
1207
1225
|
} catch {
|
|
1208
1226
|
}
|
|
1209
1227
|
else
|
|
1210
|
-
|
|
1228
|
+
w === !1 && e.removeAttribute(d);
|
|
1211
1229
|
}
|
|
1212
|
-
for (const [d,
|
|
1230
|
+
for (const [d, x] of Object.entries(
|
|
1213
1231
|
s.listeners || {}
|
|
1214
1232
|
))
|
|
1215
|
-
|
|
1233
|
+
oe.addListener(e, d, x);
|
|
1216
1234
|
const h = t.attrs ?? {}, l = a;
|
|
1217
1235
|
for (const d in { ...h, ...l }) {
|
|
1218
|
-
const
|
|
1219
|
-
let c =
|
|
1220
|
-
if (
|
|
1221
|
-
if (
|
|
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
|
+
if (b = !0, p == null || p === !1) {
|
|
1222
1240
|
if (e.removeAttribute(d), d === "value") {
|
|
1223
1241
|
if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement)
|
|
1224
1242
|
try {
|
|
@@ -1280,15 +1298,15 @@ function Fe(e, t, r, n) {
|
|
|
1280
1298
|
e.setAttribute(d, String(p));
|
|
1281
1299
|
continue;
|
|
1282
1300
|
}
|
|
1283
|
-
const
|
|
1284
|
-
if (g && !
|
|
1285
|
-
const C =
|
|
1301
|
+
const m = e.namespaceURI === "http://www.w3.org/2000/svg";
|
|
1302
|
+
if (g && !m && d.includes("-")) {
|
|
1303
|
+
const C = it(d);
|
|
1286
1304
|
try {
|
|
1287
1305
|
e[C] = p;
|
|
1288
1306
|
} catch {
|
|
1289
1307
|
e.setAttribute(d, String(p));
|
|
1290
1308
|
}
|
|
1291
|
-
} else if (!
|
|
1309
|
+
} else if (!m && d in e)
|
|
1292
1310
|
try {
|
|
1293
1311
|
e[d] = p;
|
|
1294
1312
|
} catch {
|
|
@@ -1298,7 +1316,7 @@ function Fe(e, t, r, n) {
|
|
|
1298
1316
|
e.setAttribute(d, String(p));
|
|
1299
1317
|
}
|
|
1300
1318
|
}
|
|
1301
|
-
if (g &&
|
|
1319
|
+
if (g && b)
|
|
1302
1320
|
try {
|
|
1303
1321
|
if (typeof e._applyProps == "function")
|
|
1304
1322
|
try {
|
|
@@ -1309,7 +1327,7 @@ function Fe(e, t, r, n) {
|
|
|
1309
1327
|
} catch {
|
|
1310
1328
|
}
|
|
1311
1329
|
}
|
|
1312
|
-
function X(e, t,
|
|
1330
|
+
function X(e, t, n) {
|
|
1313
1331
|
if (typeof e == "string")
|
|
1314
1332
|
return document.createTextNode(e);
|
|
1315
1333
|
if (e.tag === "#text") {
|
|
@@ -1319,80 +1337,80 @@ function X(e, t, r) {
|
|
|
1319
1337
|
return e.key != null && (h.key = e.key), h;
|
|
1320
1338
|
}
|
|
1321
1339
|
if (e.tag === "#anchor") {
|
|
1322
|
-
const h = e, l = Array.isArray(h.children) ? h.children : [], d = document.createTextNode(""),
|
|
1323
|
-
h.key != null && (d.key = `${h.key}:start`,
|
|
1324
|
-
const
|
|
1325
|
-
|
|
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
|
+
const w = document.createDocumentFragment();
|
|
1343
|
+
w.appendChild(d);
|
|
1326
1344
|
for (const c of l) {
|
|
1327
1345
|
const p = X(c, t);
|
|
1328
|
-
|
|
1346
|
+
w.appendChild(p);
|
|
1329
1347
|
}
|
|
1330
|
-
return
|
|
1348
|
+
return w.appendChild(x), w;
|
|
1331
1349
|
}
|
|
1332
|
-
const
|
|
1333
|
-
e.key != null && (
|
|
1334
|
-
const { props: i = {}, attrs: s = {}, directives: o = {} } = e.props ?? {}, a =
|
|
1350
|
+
const r = document.createElement(e.tag);
|
|
1351
|
+
e.key != null && (r.key = e.key);
|
|
1352
|
+
const { props: i = {}, attrs: s = {}, directives: o = {} } = e.props ?? {}, a = at(o, t, r, s), u = {
|
|
1335
1353
|
...i,
|
|
1336
1354
|
...a.props
|
|
1337
|
-
},
|
|
1355
|
+
}, y = {
|
|
1338
1356
|
...s,
|
|
1339
1357
|
...a.attrs
|
|
1340
|
-
}, g =
|
|
1341
|
-
for (const h in
|
|
1342
|
-
const l =
|
|
1358
|
+
}, g = r.namespaceURI === "http://www.w3.org/2000/svg";
|
|
1359
|
+
for (const h in y) {
|
|
1360
|
+
const l = y[h];
|
|
1343
1361
|
if (!(typeof h != "string" || /\[object Object\]/.test(h))) {
|
|
1344
1362
|
if (typeof l == "boolean")
|
|
1345
|
-
l &&
|
|
1363
|
+
l && r.setAttribute(h, "");
|
|
1346
1364
|
else if (l != null)
|
|
1347
|
-
if (!g && h === "value" && (
|
|
1365
|
+
if (!g && h === "value" && (r instanceof HTMLInputElement || r instanceof HTMLTextAreaElement || r instanceof HTMLSelectElement || r instanceof HTMLProgressElement))
|
|
1348
1366
|
try {
|
|
1349
|
-
|
|
1367
|
+
r instanceof HTMLProgressElement ? r.value = Number(l) : r.value = l ?? "";
|
|
1350
1368
|
} catch {
|
|
1351
|
-
|
|
1369
|
+
r.setAttribute(h, String(l));
|
|
1352
1370
|
}
|
|
1353
|
-
else if (!g && h === "checked" &&
|
|
1371
|
+
else if (!g && h === "checked" && r instanceof HTMLInputElement)
|
|
1354
1372
|
try {
|
|
1355
|
-
|
|
1373
|
+
r.checked = !!l;
|
|
1356
1374
|
} catch {
|
|
1357
|
-
|
|
1375
|
+
r.setAttribute(h, String(l));
|
|
1358
1376
|
}
|
|
1359
|
-
else if (!g && h in
|
|
1377
|
+
else if (!g && h in r)
|
|
1360
1378
|
try {
|
|
1361
|
-
|
|
1379
|
+
r[h] = l;
|
|
1362
1380
|
} catch {
|
|
1363
|
-
|
|
1381
|
+
r.setAttribute(h, String(l));
|
|
1364
1382
|
}
|
|
1365
1383
|
else if ((e.props?.isCustomElement ?? !1) && !g && h.includes("-")) {
|
|
1366
|
-
const
|
|
1384
|
+
const x = it(h);
|
|
1367
1385
|
try {
|
|
1368
|
-
|
|
1386
|
+
r[x] = l;
|
|
1369
1387
|
} catch {
|
|
1370
|
-
|
|
1388
|
+
r.setAttribute(h, String(l));
|
|
1371
1389
|
}
|
|
1372
1390
|
} else
|
|
1373
|
-
|
|
1391
|
+
r.setAttribute(h, String(l));
|
|
1374
1392
|
}
|
|
1375
1393
|
}
|
|
1376
1394
|
for (const h in u) {
|
|
1377
1395
|
const l = u[h];
|
|
1378
1396
|
if (!(typeof h != "string" || /\[object Object\]/.test(h)))
|
|
1379
|
-
if (h === "value" && (
|
|
1397
|
+
if (h === "value" && (r instanceof HTMLInputElement || r instanceof HTMLTextAreaElement || r instanceof HTMLSelectElement)) {
|
|
1380
1398
|
const d = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
|
|
1381
|
-
|
|
1382
|
-
} else if (h === "checked" &&
|
|
1399
|
+
r.value = d ?? "";
|
|
1400
|
+
} else if (h === "checked" && r instanceof HTMLInputElement) {
|
|
1383
1401
|
const d = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
|
|
1384
|
-
|
|
1402
|
+
r.checked = !!d;
|
|
1385
1403
|
} else if (h.startsWith("on") && typeof l == "function")
|
|
1386
|
-
|
|
1404
|
+
oe.addListener(r, ot(h), l);
|
|
1387
1405
|
else {
|
|
1388
1406
|
if (h.startsWith("on") && l === void 0)
|
|
1389
1407
|
continue;
|
|
1390
1408
|
if (l == null || l === !1)
|
|
1391
|
-
|
|
1392
|
-
else if ((e.props?.isCustomElement ?? !1) || h in
|
|
1409
|
+
r.removeAttribute(h);
|
|
1410
|
+
else if ((e.props?.isCustomElement ?? !1) || h in r)
|
|
1393
1411
|
try {
|
|
1394
|
-
const
|
|
1395
|
-
|
|
1412
|
+
const x = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
|
|
1413
|
+
r[h] = x;
|
|
1396
1414
|
} catch {
|
|
1397
1415
|
}
|
|
1398
1416
|
}
|
|
@@ -1400,44 +1418,44 @@ function X(e, t, r) {
|
|
|
1400
1418
|
for (const [h, l] of Object.entries(
|
|
1401
1419
|
a.listeners || {}
|
|
1402
1420
|
))
|
|
1403
|
-
|
|
1404
|
-
const
|
|
1421
|
+
oe.addListener(r, h, l);
|
|
1422
|
+
const b = {
|
|
1405
1423
|
...e,
|
|
1406
1424
|
props: {
|
|
1407
1425
|
...e.props,
|
|
1408
1426
|
...a.props
|
|
1409
1427
|
}
|
|
1410
1428
|
};
|
|
1411
|
-
|
|
1429
|
+
he(b, r, n);
|
|
1412
1430
|
try {
|
|
1413
|
-
if (typeof
|
|
1431
|
+
if (typeof r._applyProps == "function")
|
|
1414
1432
|
try {
|
|
1415
|
-
|
|
1433
|
+
r._applyProps(r._cfg);
|
|
1416
1434
|
} catch {
|
|
1417
1435
|
}
|
|
1418
|
-
typeof
|
|
1436
|
+
typeof r.requestRender == "function" ? r.requestRender() : typeof r._render == "function" && r._render(r._cfg);
|
|
1419
1437
|
} catch {
|
|
1420
1438
|
}
|
|
1421
1439
|
if (Array.isArray(e.children))
|
|
1422
1440
|
for (const h of e.children)
|
|
1423
|
-
|
|
1424
|
-
else typeof e.children == "string" && (
|
|
1441
|
+
r.appendChild(X(h, t, n));
|
|
1442
|
+
else typeof e.children == "string" && (r.textContent = e.children);
|
|
1425
1443
|
try {
|
|
1426
|
-
if (
|
|
1444
|
+
if (r instanceof HTMLSelectElement && y && y.hasOwnProperty("value"))
|
|
1427
1445
|
try {
|
|
1428
|
-
|
|
1446
|
+
r.value = y.value ?? "";
|
|
1429
1447
|
} catch {
|
|
1430
1448
|
}
|
|
1431
1449
|
} catch {
|
|
1432
1450
|
}
|
|
1433
|
-
return
|
|
1451
|
+
return r;
|
|
1434
1452
|
}
|
|
1435
|
-
function
|
|
1436
|
-
if (typeof
|
|
1437
|
-
e.textContent !==
|
|
1453
|
+
function Rt(e, t, n, r, i) {
|
|
1454
|
+
if (typeof n == "string") {
|
|
1455
|
+
e.textContent !== n && (e.textContent = n);
|
|
1438
1456
|
return;
|
|
1439
1457
|
}
|
|
1440
|
-
if (!Array.isArray(
|
|
1458
|
+
if (!Array.isArray(n)) return;
|
|
1441
1459
|
const s = Array.from(e.childNodes), o = Array.isArray(t) ? t : [], a = /* @__PURE__ */ new Map();
|
|
1442
1460
|
for (const l of o)
|
|
1443
1461
|
l && l.key != null && a.set(l.key, l);
|
|
@@ -1446,199 +1464,199 @@ function At(e, t, r, n, i) {
|
|
|
1446
1464
|
const d = l.key;
|
|
1447
1465
|
d != null && u.set(d, l);
|
|
1448
1466
|
}
|
|
1449
|
-
const
|
|
1467
|
+
const y = /* @__PURE__ */ new Set();
|
|
1450
1468
|
let g = e.firstChild;
|
|
1451
|
-
function
|
|
1452
|
-
let
|
|
1453
|
-
for (;
|
|
1454
|
-
|
|
1469
|
+
function b(l, d) {
|
|
1470
|
+
let x = l;
|
|
1471
|
+
for (; x && (y.add(x), x !== d); )
|
|
1472
|
+
x = x.nextSibling;
|
|
1455
1473
|
}
|
|
1456
|
-
function h(l, d,
|
|
1474
|
+
function h(l, d, x, w) {
|
|
1457
1475
|
const c = [];
|
|
1458
1476
|
let p = l.nextSibling;
|
|
1459
1477
|
for (; p && p !== d; )
|
|
1460
1478
|
c.push(p), p = p.nextSibling;
|
|
1461
|
-
const
|
|
1462
|
-
if (
|
|
1479
|
+
const m = Array.isArray(x) ? x : [];
|
|
1480
|
+
if (w.some((k) => k && k.key != null) || m.some((k) => k && k.key != null)) {
|
|
1463
1481
|
const k = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
|
|
1464
|
-
for (const _ of
|
|
1482
|
+
for (const _ of m)
|
|
1465
1483
|
_ && _.key != null && k.set(_.key, _);
|
|
1466
1484
|
for (const _ of c) {
|
|
1467
|
-
const
|
|
1468
|
-
|
|
1485
|
+
const $ = _.key;
|
|
1486
|
+
$ != null && f.set($, _);
|
|
1469
1487
|
}
|
|
1470
|
-
const
|
|
1488
|
+
const v = /* @__PURE__ */ new Set();
|
|
1471
1489
|
let A = l.nextSibling;
|
|
1472
|
-
for (const _ of
|
|
1473
|
-
let
|
|
1490
|
+
for (const _ of w) {
|
|
1491
|
+
let $;
|
|
1474
1492
|
if (_.key != null && f.has(_.key)) {
|
|
1475
|
-
const
|
|
1476
|
-
|
|
1493
|
+
const T = k.get(_.key);
|
|
1494
|
+
$ = $e(
|
|
1477
1495
|
f.get(_.key),
|
|
1478
|
-
|
|
1496
|
+
T,
|
|
1479
1497
|
_,
|
|
1480
|
-
|
|
1481
|
-
),
|
|
1498
|
+
r
|
|
1499
|
+
), v.add($), $ !== A && e.contains($) && e.insertBefore($, A);
|
|
1482
1500
|
} else
|
|
1483
|
-
|
|
1484
|
-
A =
|
|
1501
|
+
$ = X(_, r), e.insertBefore($, A), v.add($);
|
|
1502
|
+
A = $.nextSibling;
|
|
1485
1503
|
}
|
|
1486
1504
|
for (const _ of c)
|
|
1487
|
-
!
|
|
1505
|
+
!v.has(_) && e.contains(_) && e.removeChild(_);
|
|
1488
1506
|
} else {
|
|
1489
1507
|
const k = Math.min(
|
|
1490
|
-
|
|
1491
|
-
|
|
1508
|
+
m.length,
|
|
1509
|
+
w.length
|
|
1492
1510
|
);
|
|
1493
1511
|
for (let f = 0; f < k; f++) {
|
|
1494
|
-
const
|
|
1512
|
+
const v = m[f], A = w[f], _ = $e(c[f], v, A, r);
|
|
1495
1513
|
_ !== c[f] && (e.insertBefore(_, c[f]), e.removeChild(c[f]));
|
|
1496
1514
|
}
|
|
1497
|
-
for (let f = k; f <
|
|
1498
|
-
e.insertBefore(X(
|
|
1515
|
+
for (let f = k; f < w.length; f++)
|
|
1516
|
+
e.insertBefore(X(w[f], r), d);
|
|
1499
1517
|
for (let f = k; f < c.length; f++)
|
|
1500
1518
|
e.removeChild(c[f]);
|
|
1501
1519
|
}
|
|
1502
1520
|
}
|
|
1503
|
-
for (const l of
|
|
1521
|
+
for (const l of n) {
|
|
1504
1522
|
let d;
|
|
1505
1523
|
if (l.tag === "#anchor") {
|
|
1506
|
-
const
|
|
1507
|
-
let p = u.get(
|
|
1524
|
+
const x = l.key, w = `${x}:start`, c = `${x}:end`;
|
|
1525
|
+
let p = u.get(w), m = u.get(c);
|
|
1508
1526
|
const C = Array.isArray(l.children) ? l.children : [];
|
|
1509
|
-
if (p || (p = document.createTextNode(""), p.key =
|
|
1527
|
+
if (p || (p = document.createTextNode(""), p.key = w), m || (m = document.createTextNode(""), m.key = c), l._startNode = p, l._endNode = m, !e.contains(p) || !e.contains(m)) {
|
|
1510
1528
|
e.insertBefore(p, g);
|
|
1511
1529
|
for (const k of C)
|
|
1512
|
-
e.insertBefore(X(k,
|
|
1513
|
-
e.insertBefore(
|
|
1530
|
+
e.insertBefore(X(k, r), g);
|
|
1531
|
+
e.insertBefore(m, g);
|
|
1514
1532
|
} else
|
|
1515
1533
|
h(
|
|
1516
1534
|
p,
|
|
1517
|
-
|
|
1518
|
-
a.get(
|
|
1535
|
+
m,
|
|
1536
|
+
a.get(x)?.children,
|
|
1519
1537
|
C
|
|
1520
1538
|
);
|
|
1521
|
-
|
|
1539
|
+
b(p, m), g = m.nextSibling;
|
|
1522
1540
|
continue;
|
|
1523
1541
|
}
|
|
1524
1542
|
if (l.key != null && u.has(l.key)) {
|
|
1525
|
-
const
|
|
1526
|
-
d =
|
|
1543
|
+
const x = a.get(l.key);
|
|
1544
|
+
d = $e(
|
|
1527
1545
|
u.get(l.key),
|
|
1528
|
-
|
|
1546
|
+
x,
|
|
1529
1547
|
l,
|
|
1530
|
-
|
|
1548
|
+
r,
|
|
1531
1549
|
i
|
|
1532
|
-
),
|
|
1550
|
+
), y.add(d), d !== g && e.contains(d) && (g && !e.contains(g) && (g = null), e.insertBefore(d, g));
|
|
1533
1551
|
} else
|
|
1534
|
-
d = X(l,
|
|
1552
|
+
d = X(l, r, i), g && !e.contains(g) && (g = null), e.insertBefore(d, g), y.add(d);
|
|
1535
1553
|
g = d.nextSibling;
|
|
1536
1554
|
}
|
|
1537
1555
|
for (const l of s)
|
|
1538
|
-
!
|
|
1556
|
+
!y.has(l) && e.contains(l) && (ue(l, i), e.removeChild(l));
|
|
1539
1557
|
}
|
|
1540
|
-
function
|
|
1541
|
-
if (t && typeof t != "string" && t.props?.ref && i &&
|
|
1542
|
-
if (typeof
|
|
1558
|
+
function $e(e, t, n, r, i) {
|
|
1559
|
+
if (t && typeof t != "string" && t.props?.ref && i && ue(e, i), t === n) return e;
|
|
1560
|
+
if (typeof n == "string") {
|
|
1543
1561
|
if (e.nodeType === Node.TEXT_NODE)
|
|
1544
|
-
return e.textContent !==
|
|
1562
|
+
return e.textContent !== n && (e.textContent = n), e;
|
|
1545
1563
|
{
|
|
1546
|
-
const o = document.createTextNode(
|
|
1564
|
+
const o = document.createTextNode(n);
|
|
1547
1565
|
return e.parentNode?.replaceChild(o, e), o;
|
|
1548
1566
|
}
|
|
1549
1567
|
}
|
|
1550
|
-
if (
|
|
1551
|
-
const o =
|
|
1552
|
-
o.key != null && (u.key = `${o.key}:start`,
|
|
1568
|
+
if (n && typeof n != "string" && n.tag === "#anchor") {
|
|
1569
|
+
const o = n, a = Array.isArray(o.children) ? o.children : [], u = o._startNode ?? document.createTextNode(""), y = o._endNode ?? document.createTextNode("");
|
|
1570
|
+
o.key != null && (u.key = `${o.key}:start`, y.key = `${o.key}:end`), o._startNode = u, o._endNode = y;
|
|
1553
1571
|
const g = document.createDocumentFragment();
|
|
1554
1572
|
g.appendChild(u);
|
|
1555
|
-
for (const
|
|
1556
|
-
const h = X(
|
|
1573
|
+
for (const b of a) {
|
|
1574
|
+
const h = X(b, r);
|
|
1557
1575
|
g.appendChild(h);
|
|
1558
1576
|
}
|
|
1559
|
-
return g.appendChild(
|
|
1577
|
+
return g.appendChild(y), e.parentNode?.replaceChild(g, e), u;
|
|
1560
1578
|
}
|
|
1561
|
-
if (!
|
|
1562
|
-
|
|
1579
|
+
if (!n) {
|
|
1580
|
+
ue(e, i);
|
|
1563
1581
|
const o = document.createComment("removed");
|
|
1564
1582
|
return e.parentNode?.replaceChild(o, e), o;
|
|
1565
1583
|
}
|
|
1566
1584
|
if (!t || typeof t == "string") {
|
|
1567
|
-
|
|
1568
|
-
const o = X(
|
|
1569
|
-
return
|
|
1570
|
-
}
|
|
1571
|
-
if (
|
|
1572
|
-
const o = Array.isArray(
|
|
1573
|
-
|
|
1574
|
-
const
|
|
1575
|
-
|
|
1585
|
+
ue(e, i);
|
|
1586
|
+
const o = X(n, r, i);
|
|
1587
|
+
return he(n, o, i), e.parentNode?.replaceChild(o, e), o;
|
|
1588
|
+
}
|
|
1589
|
+
if (n.tag === "#anchor") {
|
|
1590
|
+
const o = Array.isArray(n.children) ? n.children : [], a = n._startNode ?? document.createTextNode(""), u = n._endNode ?? document.createTextNode("");
|
|
1591
|
+
n.key != null && (a.key = `${n.key}:start`, u.key = `${n.key}:end`), n._startNode = a, n._endNode = u;
|
|
1592
|
+
const y = document.createDocumentFragment();
|
|
1593
|
+
y.appendChild(a);
|
|
1576
1594
|
for (const g of o)
|
|
1577
|
-
|
|
1578
|
-
return
|
|
1595
|
+
y.appendChild(X(g, r));
|
|
1596
|
+
return y.appendChild(u), e.parentNode?.replaceChild(y, e), a;
|
|
1579
1597
|
}
|
|
1580
|
-
if (typeof t != "string" && typeof
|
|
1598
|
+
if (typeof t != "string" && typeof n != "string" && t.tag === n.tag && t.key === n.key) {
|
|
1581
1599
|
const o = e;
|
|
1582
|
-
return
|
|
1600
|
+
return Ve(o, t.props || {}, n.props || {}, r), Rt(o, t.children, n.children, r, i), he(n, o, i), o;
|
|
1583
1601
|
}
|
|
1584
|
-
if (typeof t != "string" && typeof
|
|
1602
|
+
if (typeof t != "string" && typeof n != "string" && t.tag === n.tag && (t.tag && String(t.tag).includes("-") || n.props && n.props.isCustomElement || t.props && t.props.isCustomElement))
|
|
1585
1603
|
try {
|
|
1586
1604
|
const a = e;
|
|
1587
|
-
return
|
|
1605
|
+
return Ve(a, t.props || {}, n.props || {}, r), he(n, a, i), a;
|
|
1588
1606
|
} catch {
|
|
1589
1607
|
}
|
|
1590
|
-
|
|
1591
|
-
const s = X(
|
|
1592
|
-
return
|
|
1608
|
+
ue(e, i);
|
|
1609
|
+
const s = X(n, r, i);
|
|
1610
|
+
return he(n, s, i), e.parentNode?.replaceChild(s, e), s;
|
|
1593
1611
|
}
|
|
1594
|
-
function
|
|
1612
|
+
function Ot(e, t, n, r) {
|
|
1595
1613
|
let i;
|
|
1596
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 = {
|
|
1597
1615
|
tag: "div",
|
|
1598
1616
|
key: "__anchor_root__",
|
|
1599
1617
|
props: { attrs: { "data-anchor-block-root": "", key: "__anchor_root__" } },
|
|
1600
1618
|
children: [i]
|
|
1601
|
-
}), i =
|
|
1619
|
+
}), i = Be(i, String(i.key ?? "root"));
|
|
1602
1620
|
const s = e._prevVNode ?? null, o = e._prevDom ?? e.firstChild ?? null;
|
|
1603
1621
|
let a;
|
|
1604
|
-
s && o ? typeof s != "string" && typeof i != "string" && s.tag === i.tag && s.key === i.key ? a =
|
|
1622
|
+
s && o ? typeof s != "string" && typeof i != "string" && s.tag === i.tag && s.key === i.key ? a = $e(o, s, i, n, r) : (a = X(i, n, r), e.replaceChild(a, o)) : (a = X(i, n, r), e.firstChild ? e.replaceChild(a, e.firstChild) : e.appendChild(a));
|
|
1605
1623
|
const u = [];
|
|
1606
|
-
for (let
|
|
1607
|
-
const g = e.childNodes[
|
|
1608
|
-
g !== a && g.nodeName !== "STYLE" && (
|
|
1624
|
+
for (let y = 0; y < e.childNodes.length; y++) {
|
|
1625
|
+
const g = e.childNodes[y];
|
|
1626
|
+
g !== a && g.nodeName !== "STYLE" && (ue(g, r), u.push(g));
|
|
1609
1627
|
}
|
|
1610
|
-
u.forEach((
|
|
1628
|
+
u.forEach((y) => e.removeChild(y)), e._prevVNode = i, e._prevDom = a;
|
|
1611
1629
|
}
|
|
1612
|
-
function
|
|
1613
|
-
if (typeof e == "string") return
|
|
1630
|
+
function Pe(e) {
|
|
1631
|
+
if (typeof e == "string") return ie(e);
|
|
1614
1632
|
if (e.tag === "#text")
|
|
1615
|
-
return typeof e.children == "string" ?
|
|
1633
|
+
return typeof e.children == "string" ? ie(e.children) : "";
|
|
1616
1634
|
if (e.tag === "#anchor")
|
|
1617
|
-
return (Array.isArray(e.children) ? e.children.filter(Boolean) : []).map(
|
|
1635
|
+
return (Array.isArray(e.children) ? e.children.filter(Boolean) : []).map(Pe).join("");
|
|
1618
1636
|
let t = "";
|
|
1619
|
-
e.props && e.props.attrs && (t = Object.entries(e.props.attrs).map(([i, s]) => ` ${i}="${
|
|
1620
|
-
let
|
|
1621
|
-
e.props && (
|
|
1622
|
-
const
|
|
1623
|
-
return `<${e.tag}${t}${
|
|
1624
|
-
}
|
|
1625
|
-
function
|
|
1626
|
-
let
|
|
1627
|
-
for (let
|
|
1628
|
-
|
|
1629
|
-
return
|
|
1637
|
+
e.props && e.props.attrs && (t = Object.entries(e.props.attrs).map(([i, s]) => ` ${i}="${ie(String(s))}"`).join(""));
|
|
1638
|
+
let n = "";
|
|
1639
|
+
e.props && (n = Object.entries(e.props).filter(([i]) => i !== "attrs" && i !== "directives" && i !== "ref" && i !== "key").map(([i, s]) => ` ${i}="${ie(String(s))}"`).join(""));
|
|
1640
|
+
const r = 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}${n}>${r}</${e.tag}>`;
|
|
1642
|
+
}
|
|
1643
|
+
function Pt(e, ...t) {
|
|
1644
|
+
let n = "";
|
|
1645
|
+
for (let r = 0; r < e.length; r++)
|
|
1646
|
+
n += e[r], r < t.length && (n += t[r]);
|
|
1647
|
+
return n;
|
|
1630
1648
|
}
|
|
1631
|
-
function
|
|
1649
|
+
function ct(e) {
|
|
1632
1650
|
return e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;}/g, "}").trim();
|
|
1633
1651
|
}
|
|
1634
|
-
let
|
|
1635
|
-
function
|
|
1636
|
-
return
|
|
1652
|
+
let Ce = null;
|
|
1653
|
+
function Je() {
|
|
1654
|
+
return Ce || (Ce = new CSSStyleSheet(), Ce.replaceSync(ct(Mt))), Ce;
|
|
1637
1655
|
}
|
|
1638
|
-
function
|
|
1656
|
+
function Lt(e) {
|
|
1639
1657
|
return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi, "").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, "").replace(/expression\s*\([^)]*\)/gi, "");
|
|
1640
1658
|
}
|
|
1641
|
-
const
|
|
1659
|
+
const Mt = Pt`
|
|
1642
1660
|
:host, *, ::before, ::after {
|
|
1643
1661
|
all: isolate;
|
|
1644
1662
|
box-sizing: border-box;
|
|
@@ -1696,7 +1714,7 @@ const Pt = Tt`
|
|
|
1696
1714
|
sup { top: -.5em }
|
|
1697
1715
|
[disabled], [aria-disabled=true] { cursor: not-allowed }
|
|
1698
1716
|
[hidden] { display: none }
|
|
1699
|
-
`,
|
|
1717
|
+
`, jt = {
|
|
1700
1718
|
neutral: {
|
|
1701
1719
|
50: "#fafafa",
|
|
1702
1720
|
100: "#f4f4f5",
|
|
@@ -1792,17 +1810,55 @@ const Pt = Tt`
|
|
|
1792
1810
|
black: { DEFAULT: "#000000" },
|
|
1793
1811
|
transparent: { DEFAULT: "transparent" },
|
|
1794
1812
|
current: { DEFAULT: "currentColor" }
|
|
1795
|
-
},
|
|
1796
|
-
Object.entries(
|
|
1813
|
+
}, Nt = Object.fromEntries(
|
|
1814
|
+
Object.entries(jt).map(([e, t]) => [
|
|
1797
1815
|
e,
|
|
1798
1816
|
Object.fromEntries(
|
|
1799
|
-
Object.entries(t).map(([
|
|
1800
|
-
|
|
1801
|
-
`var(--color-${e}${
|
|
1817
|
+
Object.entries(t).map(([n, r]) => [
|
|
1818
|
+
n,
|
|
1819
|
+
`var(--color-${e}${n === "DEFAULT" ? "" : `-${n}`}, ${r})`
|
|
1802
1820
|
])
|
|
1803
1821
|
)
|
|
1804
1822
|
])
|
|
1805
|
-
),
|
|
1823
|
+
), le = "0.25rem", Wt = {
|
|
1824
|
+
// Tailwind container widths
|
|
1825
|
+
// 3xs: 16rem => 16 / 0.25 = 64
|
|
1826
|
+
"3xs": 64,
|
|
1827
|
+
// 2xs: 18rem => 72
|
|
1828
|
+
"2xs": 72,
|
|
1829
|
+
// xs: 20rem => 80
|
|
1830
|
+
xs: 80,
|
|
1831
|
+
// sm: 24rem => 96
|
|
1832
|
+
sm: 96,
|
|
1833
|
+
// md: 28rem => 112
|
|
1834
|
+
md: 112,
|
|
1835
|
+
// lg: 32rem => 128
|
|
1836
|
+
lg: 128,
|
|
1837
|
+
// xl: 36rem => 144
|
|
1838
|
+
xl: 144,
|
|
1839
|
+
// 2xl: 42rem => 168
|
|
1840
|
+
"2xl": 168,
|
|
1841
|
+
// 3xl: 48rem => 192
|
|
1842
|
+
"3xl": 192,
|
|
1843
|
+
// 4xl: 56rem => 224
|
|
1844
|
+
"4xl": 224,
|
|
1845
|
+
// 5xl: 64rem => 256
|
|
1846
|
+
"5xl": 256,
|
|
1847
|
+
// 6xl: 72rem => 288
|
|
1848
|
+
"6xl": 288,
|
|
1849
|
+
// 7xl: 80rem => 320
|
|
1850
|
+
"7xl": 320
|
|
1851
|
+
}, zt = () => {
|
|
1852
|
+
const e = {};
|
|
1853
|
+
for (const [t, n] of Object.entries(Wt))
|
|
1854
|
+
e[`max-w-${t}`] = `max-width:calc(${le} * ${n});`, e[`min-w-${t}`] = `min-width:calc(${le} * ${n});`, e[`w-${t}`] = `width:calc(${le} * ${n});`, e[`max-h-${t}`] = `max-height:calc(${le} * ${n});`, e[`min-h-${t}`] = `min-height:calc(${le} * ${n});`, e[`h-${t}`] = `height:calc(${le} * ${n});`;
|
|
1855
|
+
return e;
|
|
1856
|
+
}, Dt = () => {
|
|
1857
|
+
const e = {};
|
|
1858
|
+
for (const t of [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])
|
|
1859
|
+
e[`grid-cols-${t}`] = `grid-template-columns:repeat(${t},minmax(0,1fr));`, e[`grid-rows-${t}`] = `grid-template-rows:repeat(${t},minmax(0,1fr));`, e[`col-span-${t}`] = `grid-column:span ${t} / span ${t};`, e[`row-span-${t}`] = `grid-row:span ${t} / span ${t};`;
|
|
1860
|
+
return e;
|
|
1861
|
+
}, Le = {
|
|
1806
1862
|
/* Display */
|
|
1807
1863
|
block: "display:block;",
|
|
1808
1864
|
inline: "display:inline;",
|
|
@@ -1818,8 +1874,11 @@ const Pt = Tt`
|
|
|
1818
1874
|
"h-screen": "height:100dvw;",
|
|
1819
1875
|
"max-w-full": "max-width:100%;",
|
|
1820
1876
|
"max-h-full": "max-height:100%;",
|
|
1877
|
+
"max-w-screen": "max-width:100dvw;",
|
|
1878
|
+
"max-h-screen": "max-height:100dvh;",
|
|
1821
1879
|
"min-w-0": "min-width:0;",
|
|
1822
1880
|
"min-h-0": "min-height:0;",
|
|
1881
|
+
...zt(),
|
|
1823
1882
|
"m-auto": "margin:auto;",
|
|
1824
1883
|
"mx-auto": "margin-inline:auto;",
|
|
1825
1884
|
"my-auto": "margin-block:auto;",
|
|
@@ -1834,55 +1893,8 @@ const Pt = Tt`
|
|
|
1834
1893
|
/* Accessibility */
|
|
1835
1894
|
"sr-only": "position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;",
|
|
1836
1895
|
"not-sr-only": "position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip:auto;white-space:normal;",
|
|
1837
|
-
/* Grid Layout */
|
|
1838
|
-
|
|
1839
|
-
"grid-cols-2": "grid-template-columns:repeat(2,minmax(0,1fr));",
|
|
1840
|
-
"grid-cols-3": "grid-template-columns:repeat(3,minmax(0,1fr));",
|
|
1841
|
-
"grid-cols-4": "grid-template-columns:repeat(4,minmax(0,1fr));",
|
|
1842
|
-
"grid-cols-5": "grid-template-columns:repeat(5,minmax(0,1fr));",
|
|
1843
|
-
"grid-cols-6": "grid-template-columns:repeat(6,minmax(0,1fr));",
|
|
1844
|
-
"grid-cols-7": "grid-template-columns:repeat(7,minmax(0,1fr));",
|
|
1845
|
-
"grid-cols-8": "grid-template-columns:repeat(8,minmax(0,1fr));",
|
|
1846
|
-
"grid-cols-9": "grid-template-columns:repeat(9,minmax(0,1fr));",
|
|
1847
|
-
"grid-cols-10": "grid-template-columns:repeat(10,minmax(0,1fr));",
|
|
1848
|
-
"grid-cols-11": "grid-template-columns:repeat(11,minmax(0,1fr));",
|
|
1849
|
-
"grid-cols-12": "grid-template-columns:repeat(12,minmax(0,1fr));",
|
|
1850
|
-
"grid-rows-1": "grid-template-rows:repeat(1,minmax(0,1fr));",
|
|
1851
|
-
"grid-rows-2": "grid-template-rows:repeat(2,minmax(0,1fr));",
|
|
1852
|
-
"grid-rows-3": "grid-template-rows:repeat(3,minmax(0,1fr));",
|
|
1853
|
-
"grid-rows-4": "grid-template-rows:repeat(4,minmax(0,1fr));",
|
|
1854
|
-
"grid-rows-5": "grid-template-rows:repeat(5,minmax(0,1fr));",
|
|
1855
|
-
"grid-rows-6": "grid-template-rows:repeat(6,minmax(0,1fr));",
|
|
1856
|
-
"grid-rows-7": "grid-template-rows:repeat(7,minmax(0,1fr));",
|
|
1857
|
-
"grid-rows-8": "grid-template-rows:repeat(8,minmax(0,1fr));",
|
|
1858
|
-
"grid-rows-9": "grid-template-rows:repeat(9,minmax(0,1fr));",
|
|
1859
|
-
"grid-rows-10": "grid-template-rows:repeat(10,minmax(0,1fr));",
|
|
1860
|
-
"grid-rows-11": "grid-template-rows:repeat(11,minmax(0,1fr));",
|
|
1861
|
-
"grid-rows-12": "grid-template-rows:repeat(12,minmax(0,1fr));",
|
|
1862
|
-
/* Grid Placement */
|
|
1863
|
-
"col-span-1": "grid-column:span 1 / span 1;",
|
|
1864
|
-
"col-span-2": "grid-column:span 2 / span 2;",
|
|
1865
|
-
"col-span-3": "grid-column:span 3 / span 3;",
|
|
1866
|
-
"col-span-4": "grid-column:span 4 / span 4;",
|
|
1867
|
-
"col-span-5": "grid-column:span 5 / span 5;",
|
|
1868
|
-
"col-span-6": "grid-column:span 6 / span 6;",
|
|
1869
|
-
"col-span-7": "grid-column:span 7 / span 7;",
|
|
1870
|
-
"col-span-8": "grid-column:span 8 / span 8;",
|
|
1871
|
-
"col-span-9": "grid-column:span 9 / span 9;",
|
|
1872
|
-
"col-span-10": "grid-column:span 10 / span 10;",
|
|
1873
|
-
"col-span-11": "grid-column:span 11 / span 11;",
|
|
1874
|
-
"col-span-12": "grid-column:span 12 / span 12;",
|
|
1875
|
-
"row-span-1": "grid-row:span 1 / span 1;",
|
|
1876
|
-
"row-span-2": "grid-row:span 2 / span 2;",
|
|
1877
|
-
"row-span-3": "grid-row:span 3 / span 3;",
|
|
1878
|
-
"row-span-4": "grid-row:span 4 / span 4;",
|
|
1879
|
-
"row-span-6": "grid-row:span 6 / span 6;",
|
|
1880
|
-
"row-span-7": "grid-row:span 7 / span 7;",
|
|
1881
|
-
"row-span-8": "grid-row:span 8 / span 8;",
|
|
1882
|
-
"row-span-9": "grid-row:span 9 / span 9;",
|
|
1883
|
-
"row-span-10": "grid-row:span 10 / span 10;",
|
|
1884
|
-
"row-span-11": "grid-row:span 11 / span 11;",
|
|
1885
|
-
"row-span-12": "grid-row:span 12 / span 12;",
|
|
1896
|
+
/* Grid Layout & Placement */
|
|
1897
|
+
...Dt(),
|
|
1886
1898
|
/* Positioning */
|
|
1887
1899
|
absolute: "position:absolute;",
|
|
1888
1900
|
relative: "position:relative;",
|
|
@@ -2017,7 +2029,7 @@ const Pt = Tt`
|
|
|
2017
2029
|
"z-30": "z-index:30;",
|
|
2018
2030
|
"z-40": "z-index:40;",
|
|
2019
2031
|
"z-50": "z-index:50;"
|
|
2020
|
-
},
|
|
2032
|
+
}, Ze = {
|
|
2021
2033
|
m: ["margin"],
|
|
2022
2034
|
mx: ["margin-inline"],
|
|
2023
2035
|
my: ["margin-block"],
|
|
@@ -2050,19 +2062,19 @@ const Pt = Tt`
|
|
|
2050
2062
|
"gap-y": ["row-gap"]
|
|
2051
2063
|
};
|
|
2052
2064
|
function G(e, t) {
|
|
2053
|
-
let
|
|
2065
|
+
let n = 0, r = 0;
|
|
2054
2066
|
for (let i = 0; i < e.length; i++) {
|
|
2055
2067
|
const s = e[i];
|
|
2056
|
-
if (s === "[")
|
|
2057
|
-
else if (s === "]" &&
|
|
2058
|
-
else if (s === "(")
|
|
2059
|
-
else if (s === ")" &&
|
|
2060
|
-
else if (
|
|
2068
|
+
if (s === "[") n++;
|
|
2069
|
+
else if (s === "]" && n > 0) n--;
|
|
2070
|
+
else if (s === "(") r++;
|
|
2071
|
+
else if (s === ")" && r > 0) r--;
|
|
2072
|
+
else if (n === 0 && r === 0 && (s === ">" || s === "+" || s === "~" || s === " "))
|
|
2061
2073
|
return e.slice(0, i) + t + e.slice(i);
|
|
2062
2074
|
}
|
|
2063
2075
|
return e + t;
|
|
2064
2076
|
}
|
|
2065
|
-
const
|
|
2077
|
+
const It = {
|
|
2066
2078
|
before: (e, t) => `${e}::before{${t}}`,
|
|
2067
2079
|
after: (e, t) => `${e}::after{${t}}`,
|
|
2068
2080
|
hover: (e, t) => `${G(e, ":hover")}{${t}}`,
|
|
@@ -2085,7 +2097,7 @@ const Nt = {
|
|
|
2085
2097
|
"peer-focus": (e, t) => `.peer:focus ~ ${e}{${t}}`,
|
|
2086
2098
|
"peer-checked": (e, t) => `.peer:checked ~ ${e}{${t}}`,
|
|
2087
2099
|
"peer-disabled": (e, t) => `.peer:disabled ~ ${e}{${t}}`
|
|
2088
|
-
},
|
|
2100
|
+
}, Me = {
|
|
2089
2101
|
// Responsive
|
|
2090
2102
|
sm: "(min-width:640px)",
|
|
2091
2103
|
md: "(min-width:768px)",
|
|
@@ -2094,25 +2106,25 @@ const Nt = {
|
|
|
2094
2106
|
"2xl": "(min-width:1536px)",
|
|
2095
2107
|
// Dark mode (now plain string)
|
|
2096
2108
|
dark: "(prefers-color-scheme: dark)"
|
|
2097
|
-
},
|
|
2098
|
-
function
|
|
2099
|
-
const t = e.startsWith("-"),
|
|
2100
|
-
if (
|
|
2101
|
-
const i =
|
|
2102
|
-
if (Number.isNaN(o) || !
|
|
2109
|
+
}, je = ["sm", "md", "lg", "xl", "2xl"];
|
|
2110
|
+
function Ne(e) {
|
|
2111
|
+
const t = e.startsWith("-"), r = (t ? e.slice(1) : e).split("-");
|
|
2112
|
+
if (r.length < 2) return null;
|
|
2113
|
+
const i = r.slice(0, -1).join("-"), s = r[r.length - 1], o = parseFloat(s);
|
|
2114
|
+
if (Number.isNaN(o) || !Ze[i]) return null;
|
|
2103
2115
|
const a = t ? "-" : "";
|
|
2104
|
-
return
|
|
2116
|
+
return Ze[i].map((u) => `${u}:calc(${a}${le} * ${o});`).join("");
|
|
2105
2117
|
}
|
|
2106
|
-
function
|
|
2107
|
-
const t = e.replace("#", ""),
|
|
2108
|
-
return `${
|
|
2118
|
+
function Ge(e) {
|
|
2119
|
+
const t = e.replace("#", ""), n = parseInt(t, 16), r = n >> 16 & 255, i = n >> 8 & 255, s = n & 255;
|
|
2120
|
+
return `${r} ${i} ${s}`;
|
|
2109
2121
|
}
|
|
2110
|
-
function
|
|
2122
|
+
function Ht(e) {
|
|
2111
2123
|
const t = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
|
|
2112
2124
|
if (!t) return null;
|
|
2113
|
-
const [,
|
|
2125
|
+
const [, n, r, i = "DEFAULT"] = t, s = Nt[r]?.[i];
|
|
2114
2126
|
if (!s) return null;
|
|
2115
|
-
if (
|
|
2127
|
+
if (n === "shadow") return `--ce-shadow-color:${s};`;
|
|
2116
2128
|
const a = {
|
|
2117
2129
|
bg: "background-color",
|
|
2118
2130
|
decoration: "text-decoration-color",
|
|
@@ -2123,44 +2135,44 @@ function Wt(e) {
|
|
|
2123
2135
|
accent: "accent-color",
|
|
2124
2136
|
fill: "fill",
|
|
2125
2137
|
stroke: "stroke"
|
|
2126
|
-
}[
|
|
2138
|
+
}[n];
|
|
2127
2139
|
return a ? `${a}:${s};` : null;
|
|
2128
2140
|
}
|
|
2129
|
-
function
|
|
2130
|
-
const [t,
|
|
2131
|
-
if (!
|
|
2132
|
-
const
|
|
2133
|
-
return isNaN(
|
|
2134
|
-
}
|
|
2135
|
-
function
|
|
2136
|
-
const { base: t, opacity:
|
|
2137
|
-
if (
|
|
2138
|
-
if (
|
|
2139
|
-
const s = /#([0-9a-f]{6})/i.exec(
|
|
2141
|
+
function Bt(e) {
|
|
2142
|
+
const [t, n] = e.split("/");
|
|
2143
|
+
if (!n) return { base: t };
|
|
2144
|
+
const r = parseInt(n, 10);
|
|
2145
|
+
return isNaN(r) || r < 0 || r > 100 ? { base: t } : { base: t, opacity: r / 100 };
|
|
2146
|
+
}
|
|
2147
|
+
function We(e) {
|
|
2148
|
+
const { base: t, opacity: n } = Bt(e), r = Ht(t);
|
|
2149
|
+
if (r) {
|
|
2150
|
+
if (n !== void 0) {
|
|
2151
|
+
const s = /#([0-9a-f]{6})/i.exec(r);
|
|
2140
2152
|
if (s) {
|
|
2141
|
-
const o =
|
|
2142
|
-
return
|
|
2153
|
+
const o = Ge(s[0]);
|
|
2154
|
+
return r.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${n})`);
|
|
2143
2155
|
}
|
|
2144
2156
|
}
|
|
2145
|
-
return
|
|
2157
|
+
return r;
|
|
2146
2158
|
}
|
|
2147
|
-
const i =
|
|
2148
|
-
if (i &&
|
|
2159
|
+
const i = Se(t);
|
|
2160
|
+
if (i && n !== void 0) {
|
|
2149
2161
|
const s = /#([0-9a-f]{6})/i.exec(i);
|
|
2150
2162
|
if (s) {
|
|
2151
|
-
const o =
|
|
2152
|
-
return i.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${
|
|
2163
|
+
const o = Ge(s[0]);
|
|
2164
|
+
return i.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${n})`);
|
|
2153
2165
|
}
|
|
2154
2166
|
}
|
|
2155
2167
|
return i;
|
|
2156
2168
|
}
|
|
2157
|
-
function
|
|
2169
|
+
function ze(e) {
|
|
2158
2170
|
const t = /^opacity-(\d{1,3})$/.exec(e);
|
|
2159
2171
|
if (!t) return null;
|
|
2160
|
-
const
|
|
2161
|
-
return
|
|
2172
|
+
const n = parseInt(t[1], 10);
|
|
2173
|
+
return n < 0 || n > 100 ? null : `opacity:${n / 100};`;
|
|
2162
2174
|
}
|
|
2163
|
-
function
|
|
2175
|
+
function Se(e) {
|
|
2164
2176
|
if (e.startsWith("[") && e.endsWith("]") && !e.includes("-[")) {
|
|
2165
2177
|
const i = e.slice(1, -1).trim().match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*:(.*)$/);
|
|
2166
2178
|
if (i) {
|
|
@@ -2170,9 +2182,9 @@ function Ee(e) {
|
|
|
2170
2182
|
}
|
|
2171
2183
|
return null;
|
|
2172
2184
|
}
|
|
2173
|
-
const t = e.indexOf("-["),
|
|
2174
|
-
if (t > 0 &&
|
|
2175
|
-
const
|
|
2185
|
+
const t = e.indexOf("-["), n = e.endsWith("]");
|
|
2186
|
+
if (t > 0 && n) {
|
|
2187
|
+
const r = e.slice(0, t);
|
|
2176
2188
|
let i = e.slice(t + 2, -1);
|
|
2177
2189
|
i = i.replace(/_/g, " ");
|
|
2178
2190
|
const s = {
|
|
@@ -2197,6 +2209,8 @@ function Ee(e) {
|
|
|
2197
2209
|
"border-r": "border-right",
|
|
2198
2210
|
"border-x": "border-inline",
|
|
2199
2211
|
"border-y": "border-block",
|
|
2212
|
+
"grid-cols": "grid-template-columns",
|
|
2213
|
+
"grid-rows": "grid-template-rows",
|
|
2200
2214
|
transition: "transition-property",
|
|
2201
2215
|
ease: "transition-timing-function",
|
|
2202
2216
|
delay: "transition-delay",
|
|
@@ -2217,63 +2231,63 @@ function Ee(e) {
|
|
|
2217
2231
|
leading: "line-height",
|
|
2218
2232
|
z: "z-index"
|
|
2219
2233
|
};
|
|
2220
|
-
if (
|
|
2234
|
+
if (r === "rotate")
|
|
2221
2235
|
return `transform:rotate(${i});`;
|
|
2222
|
-
const o = s[
|
|
2236
|
+
const o = s[r] ?? r.replace(/_/g, "-");
|
|
2223
2237
|
if (o && i) return `${o}:${i};`;
|
|
2224
2238
|
}
|
|
2225
2239
|
return null;
|
|
2226
2240
|
}
|
|
2227
|
-
function
|
|
2241
|
+
function Ut(e) {
|
|
2228
2242
|
if (e.startsWith("[") && e.endsWith("]")) {
|
|
2229
|
-
const
|
|
2230
|
-
return
|
|
2243
|
+
const n = e.slice(1, -1);
|
|
2244
|
+
return n.includes("&") ? n : e;
|
|
2231
2245
|
}
|
|
2232
2246
|
const t = e.indexOf("-[");
|
|
2233
2247
|
if (t > 0 && e.endsWith("]")) {
|
|
2234
|
-
const
|
|
2235
|
-
return
|
|
2248
|
+
const n = e.slice(t + 2, -1).replace(/_/g, "-");
|
|
2249
|
+
return n.includes("&") ? n : e.replace(/_/g, "-");
|
|
2236
2250
|
}
|
|
2237
2251
|
return null;
|
|
2238
2252
|
}
|
|
2239
|
-
function
|
|
2253
|
+
function qt(e) {
|
|
2240
2254
|
return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
|
|
2241
2255
|
}
|
|
2242
|
-
function
|
|
2243
|
-
const t = /class\s*=\s*(['"])(.*?)\1/g,
|
|
2244
|
-
let
|
|
2245
|
-
for (;
|
|
2246
|
-
const i =
|
|
2247
|
-
i.length &&
|
|
2256
|
+
function Ft(e) {
|
|
2257
|
+
const t = /class\s*=\s*(['"])(.*?)\1/g, n = [];
|
|
2258
|
+
let r;
|
|
2259
|
+
for (; r = t.exec(e); ) {
|
|
2260
|
+
const i = r[2].split(/\s+/).filter(Boolean);
|
|
2261
|
+
i.length && n.push(...i);
|
|
2248
2262
|
}
|
|
2249
|
-
return
|
|
2263
|
+
return n.filter(Boolean);
|
|
2250
2264
|
}
|
|
2251
|
-
const
|
|
2252
|
-
function
|
|
2253
|
-
const t = Date.now(),
|
|
2254
|
-
if (
|
|
2255
|
-
const
|
|
2256
|
-
function g(
|
|
2257
|
-
const p = (c ? "dark|" : "") +
|
|
2258
|
-
if (p in
|
|
2259
|
-
const
|
|
2260
|
-
return
|
|
2261
|
-
}
|
|
2262
|
-
function w
|
|
2263
|
-
const c =
|
|
2264
|
-
return
|
|
2265
|
-
}
|
|
2266
|
-
function h(
|
|
2265
|
+
const Xe = /* @__PURE__ */ new Map(), Kt = 16;
|
|
2266
|
+
function Vt(e) {
|
|
2267
|
+
const t = Date.now(), n = Xe.get(e);
|
|
2268
|
+
if (n && t - n.timestamp < Kt) return n.css;
|
|
2269
|
+
const r = Ft(e), i = new Set(r), s = [], o = [], a = [], u = [], y = {};
|
|
2270
|
+
function g(w, c = !1) {
|
|
2271
|
+
const p = (c ? "dark|" : "") + w;
|
|
2272
|
+
if (p in y) return y[p];
|
|
2273
|
+
const m = d(w, c);
|
|
2274
|
+
return y[p] = m, m;
|
|
2275
|
+
}
|
|
2276
|
+
function b(w) {
|
|
2277
|
+
const c = w.some((m) => je.includes(m)), p = w.includes("dark");
|
|
2278
|
+
return w.length === 0 ? 1 : !c && !p ? 2 : c && !p ? 3 : 4;
|
|
2279
|
+
}
|
|
2280
|
+
function h(w) {
|
|
2267
2281
|
const c = [];
|
|
2268
|
-
let p = "",
|
|
2269
|
-
for (let k = 0; k <
|
|
2270
|
-
const f =
|
|
2271
|
-
f === "[" ?
|
|
2282
|
+
let p = "", m = 0, C = 0;
|
|
2283
|
+
for (let k = 0; k < w.length; k++) {
|
|
2284
|
+
const f = w[k];
|
|
2285
|
+
f === "[" ? m++ : f === "]" && m > 0 ? m-- : f === "(" ? C++ : f === ")" && C > 0 && C--, f === ":" && m === 0 && C === 0 ? (c.push(p), p = "") : p += f;
|
|
2272
2286
|
}
|
|
2273
2287
|
return p && c.push(p), c;
|
|
2274
2288
|
}
|
|
2275
|
-
function l(
|
|
2276
|
-
switch (
|
|
2289
|
+
function l(w) {
|
|
2290
|
+
switch (w) {
|
|
2277
2291
|
case "hover":
|
|
2278
2292
|
return ":hover";
|
|
2279
2293
|
case "focus":
|
|
@@ -2302,126 +2316,126 @@ function Ut(e) {
|
|
|
2302
2316
|
return null;
|
|
2303
2317
|
}
|
|
2304
2318
|
}
|
|
2305
|
-
function d(
|
|
2306
|
-
const p = h(
|
|
2307
|
-
let
|
|
2308
|
-
const C = p.find((E) => (E.startsWith("!") && (
|
|
2319
|
+
function d(w, c = !1) {
|
|
2320
|
+
const p = h(w);
|
|
2321
|
+
let m = !1;
|
|
2322
|
+
const C = p.find((E) => (E.startsWith("!") && (m = !0, E = E.slice(1)), Le[E] || Ne(E) || ze(E) || We(E) || Se(E)));
|
|
2309
2323
|
if (!C) return null;
|
|
2310
|
-
const k = C.replace(/^!/, ""), f =
|
|
2324
|
+
const k = C.replace(/^!/, ""), f = Le[k] ?? Ne(k) ?? ze(k) ?? We(k) ?? Se(k);
|
|
2311
2325
|
if (!f) return null;
|
|
2312
|
-
const
|
|
2313
|
-
let A =
|
|
2326
|
+
const v = p.indexOf(C);
|
|
2327
|
+
let A = v >= 0 ? p.slice(0, v) : [];
|
|
2314
2328
|
c && (A = A.filter((E) => E !== "dark"));
|
|
2315
|
-
const _ = `.${
|
|
2316
|
-
let
|
|
2317
|
-
const
|
|
2329
|
+
const _ = `.${qt(w)}`, $ = "__SUBJECT__", T = m ? f.replace(/;$/, " !important;") : f;
|
|
2330
|
+
let R = $;
|
|
2331
|
+
const S = [];
|
|
2318
2332
|
for (const E of A)
|
|
2319
|
-
E.startsWith("group-") ? (
|
|
2320
|
-
A = A.filter((E) =>
|
|
2333
|
+
E.startsWith("group-") ? (R = `.group:${E.slice(6)} ${R}`, S.push(E)) : E.startsWith("peer-") && (R = R.replace($, `.peer:${E.slice(5)}~${$}`), S.push(E));
|
|
2334
|
+
A = A.filter((E) => !S.includes(E));
|
|
2321
2335
|
const P = [], B = [];
|
|
2322
|
-
let
|
|
2336
|
+
let V = null;
|
|
2323
2337
|
for (const E of A) {
|
|
2324
|
-
if (E === "dark" ||
|
|
2325
|
-
const U =
|
|
2338
|
+
if (E === "dark" || je.includes(E)) continue;
|
|
2339
|
+
const U = Ut(E);
|
|
2326
2340
|
if (U) {
|
|
2327
|
-
|
|
2341
|
+
V = U;
|
|
2328
2342
|
continue;
|
|
2329
2343
|
}
|
|
2330
2344
|
const D = l(E);
|
|
2331
2345
|
if (D) {
|
|
2332
|
-
|
|
2346
|
+
V ? B.push(D) : P.push(D);
|
|
2333
2347
|
continue;
|
|
2334
2348
|
}
|
|
2335
|
-
const
|
|
2336
|
-
typeof
|
|
2349
|
+
const W = It[E];
|
|
2350
|
+
typeof W == "function" && (R = W(R, T).split("{")[0]);
|
|
2337
2351
|
}
|
|
2338
|
-
function
|
|
2352
|
+
function we(E, U) {
|
|
2339
2353
|
if (!U) return E;
|
|
2340
|
-
let D = 0,
|
|
2354
|
+
let D = 0, W = 0;
|
|
2341
2355
|
if (E.length && (E[0] === ">" || E[0] === "+" || E[0] === "~" || E[0] === " ")) {
|
|
2342
2356
|
let O = 1;
|
|
2343
2357
|
for (; O < E.length && E[O] === " "; ) O++;
|
|
2344
2358
|
for (; O < E.length; O++) {
|
|
2345
2359
|
const I = E[O];
|
|
2346
|
-
if (I === "[" ? D++ : I === "]" && D > 0 ? D-- : I === "(" ?
|
|
2360
|
+
if (I === "[" ? D++ : I === "]" && D > 0 ? D-- : I === "(" ? W++ : I === ")" && W > 0 && W--, D === 0 && W === 0 && (E[O] === ">" || E[O] === "+" || E[O] === "~" || E[O] === " "))
|
|
2347
2361
|
return E.slice(0, O) + U + E.slice(O);
|
|
2348
2362
|
}
|
|
2349
2363
|
return E + U;
|
|
2350
2364
|
}
|
|
2351
2365
|
for (let O = 0; O < E.length; O++) {
|
|
2352
2366
|
const I = E[O];
|
|
2353
|
-
if (I === "[" ? D++ : I === "]" && D > 0 ? D-- : I === "(" ?
|
|
2367
|
+
if (I === "[" ? D++ : I === "]" && D > 0 ? D-- : I === "(" ? W++ : I === ")" && W > 0 && W--, D === 0 && W === 0 && (I === ">" || I === "+" || I === "~" || I === " "))
|
|
2354
2368
|
return E.slice(0, O) + U + E.slice(O);
|
|
2355
2369
|
}
|
|
2356
2370
|
return E + U;
|
|
2357
2371
|
}
|
|
2358
2372
|
const K = P.join(""), L = B.join("");
|
|
2359
|
-
if (
|
|
2360
|
-
if (
|
|
2361
|
-
const E =
|
|
2373
|
+
if (V)
|
|
2374
|
+
if (V.includes("&")) {
|
|
2375
|
+
const E = V.indexOf("&"), U = V.slice(0, E), D = V.slice(E + 1), W = $ + K, O = R;
|
|
2362
2376
|
if (P.length === 0)
|
|
2363
|
-
|
|
2377
|
+
R = O.replace($, U + W + L + D);
|
|
2364
2378
|
else {
|
|
2365
|
-
const I =
|
|
2366
|
-
|
|
2379
|
+
const I = we(D, L);
|
|
2380
|
+
R = O.replace($, U + W + I);
|
|
2367
2381
|
}
|
|
2368
2382
|
} else
|
|
2369
|
-
|
|
2383
|
+
R = R.replace($, `${V}${$ + K}`), L && (R = R.replace($, `${$}${L}`));
|
|
2370
2384
|
else
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
let
|
|
2374
|
-
const
|
|
2375
|
-
return c && Z ?
|
|
2376
|
-
}
|
|
2377
|
-
for (const
|
|
2378
|
-
const c = h(
|
|
2379
|
-
(f) =>
|
|
2385
|
+
R = $ + K + L;
|
|
2386
|
+
R = R.replace(new RegExp($, "g"), _);
|
|
2387
|
+
let M = `${R}{${T}}`;
|
|
2388
|
+
const J = A.filter((E) => je.includes(E)), Z = J.length ? J[J.length - 1] : null, z = A.includes("dark");
|
|
2389
|
+
return c && Z ? M = `@media (prefers-color-scheme: dark) and ${Me[Z]}{${M}}` : c ? M = `@media (prefers-color-scheme: dark){${M}}` : z && Z ? M = `@media (prefers-color-scheme: dark) and ${Me[Z]}{${M}}` : z ? M = `@media (prefers-color-scheme: dark){${M}}` : Z && (M = `@media ${Me[Z]}{${M}}`), M;
|
|
2390
|
+
}
|
|
2391
|
+
for (const w of i) {
|
|
2392
|
+
const c = h(w), p = c.find(
|
|
2393
|
+
(f) => Le[f] || Ne(f) || ze(f) || We(f) || Se(f)
|
|
2380
2394
|
);
|
|
2381
2395
|
if (!p) continue;
|
|
2382
|
-
const
|
|
2396
|
+
const m = c.indexOf(p), C = m >= 0 ? c.slice(0, m) : [], k = b(C);
|
|
2383
2397
|
if (k === 4) {
|
|
2384
|
-
const f = g(
|
|
2398
|
+
const f = g(w, !0);
|
|
2385
2399
|
f && u.push(f);
|
|
2386
2400
|
} else {
|
|
2387
|
-
const f = g(
|
|
2401
|
+
const f = g(w);
|
|
2388
2402
|
f && (k === 1 ? s.push(f) : k === 2 ? o.push(f) : k === 3 && a.push(f));
|
|
2389
2403
|
}
|
|
2390
2404
|
}
|
|
2391
|
-
const
|
|
2392
|
-
return
|
|
2405
|
+
const x = [...s, ...o, ...a, ...u].join("");
|
|
2406
|
+
return Xe.set(e, { css: x, timestamp: t }), x;
|
|
2393
2407
|
}
|
|
2394
|
-
const
|
|
2395
|
-
function
|
|
2408
|
+
const ge = [];
|
|
2409
|
+
function Jt(e, t, n, r, i, s, o, a) {
|
|
2396
2410
|
if (e) {
|
|
2397
|
-
|
|
2411
|
+
ge.push(n);
|
|
2398
2412
|
try {
|
|
2399
|
-
const u = t.render(
|
|
2413
|
+
const u = t.render(n);
|
|
2400
2414
|
if (u instanceof Promise) {
|
|
2401
|
-
s(!0), u.then((
|
|
2402
|
-
s(!1), o(null),
|
|
2403
|
-
}).catch((
|
|
2404
|
-
s(!1), o(
|
|
2415
|
+
s(!0), u.then((y) => {
|
|
2416
|
+
s(!1), o(null), Ye(e, y, n, r, i), a(e.innerHTML);
|
|
2417
|
+
}).catch((y) => {
|
|
2418
|
+
s(!1), o(y);
|
|
2405
2419
|
});
|
|
2406
2420
|
return;
|
|
2407
2421
|
}
|
|
2408
|
-
|
|
2422
|
+
Ye(e, u, n, r, i), a(e.innerHTML);
|
|
2409
2423
|
} finally {
|
|
2410
|
-
|
|
2424
|
+
ge.pop();
|
|
2411
2425
|
}
|
|
2412
2426
|
}
|
|
2413
2427
|
}
|
|
2414
|
-
function
|
|
2415
|
-
e && (
|
|
2428
|
+
function Ye(e, t, n, r, i) {
|
|
2429
|
+
e && (Ot(
|
|
2416
2430
|
e,
|
|
2417
2431
|
Array.isArray(t) ? t : [t],
|
|
2418
|
-
|
|
2419
|
-
|
|
2432
|
+
n,
|
|
2433
|
+
r
|
|
2420
2434
|
), i(e.innerHTML));
|
|
2421
2435
|
}
|
|
2422
|
-
function
|
|
2436
|
+
function Zt(e, t, n, r, i, s, o) {
|
|
2423
2437
|
if (s !== null && clearTimeout(s), Date.now() - t < 16) {
|
|
2424
|
-
if (i(
|
|
2438
|
+
if (i(n + 1), n === 15)
|
|
2425
2439
|
console.warn(
|
|
2426
2440
|
`⚠️ Component is re-rendering rapidly. This might indicate:
|
|
2427
2441
|
Common causes:
|
|
@@ -2430,7 +2444,7 @@ function Ft(e, t, r, n, i, s, o) {
|
|
|
2430
2444
|
• Missing dependencies in computed/watch
|
|
2431
2445
|
Component rendering will be throttled to prevent browser freeze.`
|
|
2432
2446
|
);
|
|
2433
|
-
else if (
|
|
2447
|
+
else if (n > 20) {
|
|
2434
2448
|
console.error(
|
|
2435
2449
|
`🛑 Infinite loop detected in component render:
|
|
2436
2450
|
• This might be caused by state updates during render
|
|
@@ -2441,41 +2455,41 @@ Stopping runaway component render to prevent browser freeze`
|
|
|
2441
2455
|
}
|
|
2442
2456
|
} else
|
|
2443
2457
|
i(0);
|
|
2444
|
-
const
|
|
2445
|
-
|
|
2446
|
-
},
|
|
2447
|
-
o(
|
|
2458
|
+
const y = setTimeout(() => {
|
|
2459
|
+
r(Date.now()), e(), o(null);
|
|
2460
|
+
}, n > 10 ? 100 : 0);
|
|
2461
|
+
o(y);
|
|
2448
2462
|
}
|
|
2449
|
-
function
|
|
2463
|
+
function Gt(e, t, n, r, i) {
|
|
2450
2464
|
if (!e) return;
|
|
2451
|
-
const s =
|
|
2465
|
+
const s = Vt(n);
|
|
2452
2466
|
if ((!s || s.trim() === "") && !t._computedStyle) {
|
|
2453
|
-
i(null), e.adoptedStyleSheets = [
|
|
2467
|
+
i(null), e.adoptedStyleSheets = [Je()];
|
|
2454
2468
|
return;
|
|
2455
2469
|
}
|
|
2456
2470
|
let o = "";
|
|
2457
2471
|
t._computedStyle && (o = t._computedStyle);
|
|
2458
|
-
let a =
|
|
2472
|
+
let a = Lt(`${o}
|
|
2459
2473
|
${s}
|
|
2460
2474
|
`);
|
|
2461
|
-
a =
|
|
2462
|
-
let u =
|
|
2463
|
-
u || (u = new CSSStyleSheet()), (u.cssRules.length === 0 || u.toString() !== a) && u.replaceSync(a), e.adoptedStyleSheets = [
|
|
2475
|
+
a = ct(a);
|
|
2476
|
+
let u = r;
|
|
2477
|
+
u || (u = new CSSStyleSheet()), (u.cssRules.length === 0 || u.toString() !== a) && u.replaceSync(a), e.adoptedStyleSheets = [Je(), u], i(u);
|
|
2464
2478
|
}
|
|
2465
2479
|
let N = null;
|
|
2466
|
-
function
|
|
2480
|
+
function Xt(e) {
|
|
2467
2481
|
N = e;
|
|
2468
2482
|
}
|
|
2469
|
-
function
|
|
2483
|
+
function Yt() {
|
|
2470
2484
|
N = null;
|
|
2471
2485
|
}
|
|
2472
|
-
function
|
|
2486
|
+
function hn() {
|
|
2473
2487
|
if (!N)
|
|
2474
2488
|
throw new Error("useEmit must be called during component render");
|
|
2475
2489
|
const e = N.emit;
|
|
2476
|
-
return (t,
|
|
2490
|
+
return (t, n) => e(t, n);
|
|
2477
2491
|
}
|
|
2478
|
-
function
|
|
2492
|
+
function me(e) {
|
|
2479
2493
|
e._hookCallbacks || Object.defineProperty(e, "_hookCallbacks", {
|
|
2480
2494
|
value: {},
|
|
2481
2495
|
writable: !0,
|
|
@@ -2483,30 +2497,30 @@ function ge(e) {
|
|
|
2483
2497
|
configurable: !1
|
|
2484
2498
|
});
|
|
2485
2499
|
}
|
|
2486
|
-
function
|
|
2500
|
+
function gn(e) {
|
|
2487
2501
|
if (!N)
|
|
2488
2502
|
throw new Error("useOnConnected must be called during component render");
|
|
2489
|
-
|
|
2503
|
+
me(N), N._hookCallbacks.onConnected = e;
|
|
2490
2504
|
}
|
|
2491
|
-
function
|
|
2505
|
+
function yn(e) {
|
|
2492
2506
|
if (!N)
|
|
2493
2507
|
throw new Error("useOnDisconnected must be called during component render");
|
|
2494
|
-
|
|
2508
|
+
me(N), N._hookCallbacks.onDisconnected = e;
|
|
2495
2509
|
}
|
|
2496
|
-
function
|
|
2510
|
+
function mn(e) {
|
|
2497
2511
|
if (!N)
|
|
2498
2512
|
throw new Error("useOnAttributeChanged must be called during component render");
|
|
2499
|
-
|
|
2513
|
+
me(N), N._hookCallbacks.onAttributeChanged = e;
|
|
2500
2514
|
}
|
|
2501
|
-
function
|
|
2515
|
+
function bn(e) {
|
|
2502
2516
|
if (!N)
|
|
2503
2517
|
throw new Error("useOnError must be called during component render");
|
|
2504
|
-
|
|
2518
|
+
me(N), N._hookCallbacks.onError = e;
|
|
2505
2519
|
}
|
|
2506
|
-
function
|
|
2520
|
+
function wn(e) {
|
|
2507
2521
|
if (!N)
|
|
2508
2522
|
throw new Error("useStyle must be called during component render");
|
|
2509
|
-
|
|
2523
|
+
me(N);
|
|
2510
2524
|
try {
|
|
2511
2525
|
const t = e();
|
|
2512
2526
|
Object.defineProperty(N, "_computedStyle", {
|
|
@@ -2524,12 +2538,12 @@ function hr(e) {
|
|
|
2524
2538
|
});
|
|
2525
2539
|
}
|
|
2526
2540
|
}
|
|
2527
|
-
const
|
|
2541
|
+
const Te = /* @__PURE__ */ new Map(), Qe = Symbol.for("cer.registry");
|
|
2528
2542
|
if (typeof window < "u") {
|
|
2529
2543
|
const e = globalThis;
|
|
2530
|
-
e[
|
|
2544
|
+
e[Qe] || (e[Qe] = Te);
|
|
2531
2545
|
}
|
|
2532
|
-
function
|
|
2546
|
+
function Qt(e, t) {
|
|
2533
2547
|
if (!t.render)
|
|
2534
2548
|
throw new Error(
|
|
2535
2549
|
"Component must have a render function"
|
|
@@ -2574,34 +2588,34 @@ function Zt(e, t) {
|
|
|
2574
2588
|
_templateLoading = !1;
|
|
2575
2589
|
_templateError = null;
|
|
2576
2590
|
constructor() {
|
|
2577
|
-
super(), this.attachShadow({ mode: "open" }), this._cfg =
|
|
2578
|
-
const
|
|
2579
|
-
Object.defineProperty(
|
|
2591
|
+
super(), this.attachShadow({ mode: "open" }), this._cfg = Te.get(e) || t, this._componentId = `${e}-${Math.random().toString(36).substr(2, 9)}`;
|
|
2592
|
+
const n = this._initContext(t);
|
|
2593
|
+
Object.defineProperty(n, "refs", {
|
|
2580
2594
|
value: this._refs,
|
|
2581
2595
|
writable: !1,
|
|
2582
2596
|
enumerable: !1,
|
|
2583
2597
|
configurable: !1
|
|
2584
|
-
}), Object.defineProperty(
|
|
2598
|
+
}), Object.defineProperty(n, "requestRender", {
|
|
2585
2599
|
value: () => this.requestRender(),
|
|
2586
2600
|
writable: !1,
|
|
2587
2601
|
enumerable: !1,
|
|
2588
2602
|
configurable: !1
|
|
2589
|
-
}), Object.defineProperty(
|
|
2603
|
+
}), Object.defineProperty(n, "_requestRender", {
|
|
2590
2604
|
value: () => this._requestRender(),
|
|
2591
2605
|
writable: !1,
|
|
2592
2606
|
enumerable: !1,
|
|
2593
2607
|
configurable: !1
|
|
2594
|
-
}), Object.defineProperty(
|
|
2608
|
+
}), Object.defineProperty(n, "_componentId", {
|
|
2595
2609
|
value: this._componentId,
|
|
2596
2610
|
writable: !1,
|
|
2597
2611
|
enumerable: !1,
|
|
2598
2612
|
configurable: !1
|
|
2599
|
-
}), Object.defineProperty(
|
|
2613
|
+
}), Object.defineProperty(n, "_triggerWatchers", {
|
|
2600
2614
|
value: (i, s) => this._triggerWatchers(i, s),
|
|
2601
2615
|
writable: !1,
|
|
2602
2616
|
enumerable: !1,
|
|
2603
2617
|
configurable: !1
|
|
2604
|
-
}), this.context =
|
|
2618
|
+
}), this.context = n, Object.defineProperty(this.context, "emit", {
|
|
2605
2619
|
value: (i, s, o) => {
|
|
2606
2620
|
const a = new CustomEvent(i, {
|
|
2607
2621
|
detail: s,
|
|
@@ -2615,11 +2629,11 @@ function Zt(e, t) {
|
|
|
2615
2629
|
enumerable: !1,
|
|
2616
2630
|
configurable: !1
|
|
2617
2631
|
});
|
|
2618
|
-
const
|
|
2619
|
-
Object.keys(
|
|
2620
|
-
const s =
|
|
2632
|
+
const r = Te.get(e) || t;
|
|
2633
|
+
Object.keys(r).forEach((i) => {
|
|
2634
|
+
const s = r[i];
|
|
2621
2635
|
typeof s == "function" && (this.context[i] = (...o) => s(...o, this.context));
|
|
2622
|
-
}), this._applyComputed(
|
|
2636
|
+
}), this._applyComputed(r), r.props && Object.keys(r.props).forEach((i) => {
|
|
2623
2637
|
let s = this[i];
|
|
2624
2638
|
Object.defineProperty(this, i, {
|
|
2625
2639
|
get() {
|
|
@@ -2627,28 +2641,28 @@ function Zt(e, t) {
|
|
|
2627
2641
|
},
|
|
2628
2642
|
set(o) {
|
|
2629
2643
|
const a = s;
|
|
2630
|
-
s = o, this.context[i] = o, this._initializing || (this._applyProps(
|
|
2644
|
+
s = o, this.context[i] = o, this._initializing || (this._applyProps(r), a !== o && this._requestRender());
|
|
2631
2645
|
},
|
|
2632
2646
|
enumerable: !0,
|
|
2633
2647
|
configurable: !0
|
|
2634
2648
|
});
|
|
2635
|
-
}), this._initializing = !1, this._initWatchers(
|
|
2649
|
+
}), this._initializing = !1, this._initWatchers(r), this._applyProps(r), this._render(r);
|
|
2636
2650
|
}
|
|
2637
2651
|
connectedCallback() {
|
|
2638
2652
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
2639
|
-
this._applyProps(t), this._requestRender(),
|
|
2653
|
+
this._applyProps(t), this._requestRender(), xt(
|
|
2640
2654
|
t,
|
|
2641
2655
|
this.context,
|
|
2642
2656
|
this._mounted,
|
|
2643
|
-
(
|
|
2644
|
-
this._mounted =
|
|
2657
|
+
(n) => {
|
|
2658
|
+
this._mounted = n;
|
|
2645
2659
|
}
|
|
2646
2660
|
);
|
|
2647
2661
|
});
|
|
2648
2662
|
}
|
|
2649
2663
|
disconnectedCallback() {
|
|
2650
2664
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
2651
|
-
|
|
2665
|
+
vt(
|
|
2652
2666
|
t,
|
|
2653
2667
|
this.context,
|
|
2654
2668
|
this._listeners,
|
|
@@ -2658,52 +2672,52 @@ function Zt(e, t) {
|
|
|
2658
2672
|
() => {
|
|
2659
2673
|
this._watchers.clear();
|
|
2660
2674
|
},
|
|
2661
|
-
(
|
|
2662
|
-
this._templateLoading =
|
|
2675
|
+
(n) => {
|
|
2676
|
+
this._templateLoading = n;
|
|
2663
2677
|
},
|
|
2664
|
-
(
|
|
2665
|
-
this._templateError =
|
|
2678
|
+
(n) => {
|
|
2679
|
+
this._templateError = n;
|
|
2666
2680
|
},
|
|
2667
|
-
(
|
|
2668
|
-
this._mounted =
|
|
2681
|
+
(n) => {
|
|
2682
|
+
this._mounted = n;
|
|
2669
2683
|
}
|
|
2670
2684
|
);
|
|
2671
2685
|
});
|
|
2672
2686
|
}
|
|
2673
|
-
attributeChangedCallback(
|
|
2687
|
+
attributeChangedCallback(n, r, i) {
|
|
2674
2688
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
2675
|
-
this._applyProps(t),
|
|
2689
|
+
this._applyProps(t), r !== i && this._requestRender(), kt(
|
|
2676
2690
|
t,
|
|
2677
|
-
r,
|
|
2678
2691
|
n,
|
|
2692
|
+
r,
|
|
2679
2693
|
i,
|
|
2680
2694
|
this.context
|
|
2681
2695
|
);
|
|
2682
2696
|
});
|
|
2683
2697
|
}
|
|
2684
2698
|
static get observedAttributes() {
|
|
2685
|
-
return t.props ? Object.keys(t.props).map(
|
|
2699
|
+
return t.props ? Object.keys(t.props).map(ne) : [];
|
|
2686
2700
|
}
|
|
2687
|
-
_applyComputed(
|
|
2701
|
+
_applyComputed(n) {
|
|
2688
2702
|
}
|
|
2689
2703
|
// --- Render ---
|
|
2690
|
-
_render(
|
|
2691
|
-
this._runLogicWithinErrorBoundary(
|
|
2692
|
-
|
|
2704
|
+
_render(n) {
|
|
2705
|
+
this._runLogicWithinErrorBoundary(n, () => {
|
|
2706
|
+
Jt(
|
|
2693
2707
|
this.shadowRoot,
|
|
2694
|
-
|
|
2708
|
+
n,
|
|
2695
2709
|
this.context,
|
|
2696
2710
|
this._refs,
|
|
2697
|
-
(
|
|
2698
|
-
this._lastHtmlStringForJitCSS =
|
|
2711
|
+
(r) => {
|
|
2712
|
+
this._lastHtmlStringForJitCSS = r, typeof this.onHtmlStringUpdate == "function" && this.onHtmlStringUpdate(r);
|
|
2699
2713
|
},
|
|
2700
|
-
(
|
|
2701
|
-
this._templateLoading =
|
|
2714
|
+
(r) => {
|
|
2715
|
+
this._templateLoading = r, typeof this.onLoadingStateChange == "function" && this.onLoadingStateChange(r);
|
|
2702
2716
|
},
|
|
2703
|
-
(
|
|
2704
|
-
this._templateError =
|
|
2717
|
+
(r) => {
|
|
2718
|
+
this._templateError = r, typeof this.onErrorStateChange == "function" && this.onErrorStateChange(r);
|
|
2705
2719
|
},
|
|
2706
|
-
(
|
|
2720
|
+
(r) => this._applyStyle(n, r)
|
|
2707
2721
|
);
|
|
2708
2722
|
});
|
|
2709
2723
|
}
|
|
@@ -2712,32 +2726,32 @@ function Zt(e, t) {
|
|
|
2712
2726
|
}
|
|
2713
2727
|
_requestRender() {
|
|
2714
2728
|
this._runLogicWithinErrorBoundary(this._cfg, () => {
|
|
2715
|
-
|
|
2716
|
-
|
|
2729
|
+
fe(() => {
|
|
2730
|
+
Zt(
|
|
2717
2731
|
() => this._render(this._cfg),
|
|
2718
2732
|
this._lastRenderTime,
|
|
2719
2733
|
this._renderCount,
|
|
2720
|
-
(
|
|
2721
|
-
this._lastRenderTime =
|
|
2734
|
+
(n) => {
|
|
2735
|
+
this._lastRenderTime = n;
|
|
2722
2736
|
},
|
|
2723
|
-
(
|
|
2724
|
-
this._renderCount =
|
|
2737
|
+
(n) => {
|
|
2738
|
+
this._renderCount = n;
|
|
2725
2739
|
},
|
|
2726
2740
|
this._renderTimeoutId,
|
|
2727
|
-
(
|
|
2728
|
-
this._renderTimeoutId =
|
|
2741
|
+
(n) => {
|
|
2742
|
+
this._renderTimeoutId = n;
|
|
2729
2743
|
}
|
|
2730
2744
|
);
|
|
2731
2745
|
}, this._componentId);
|
|
2732
2746
|
});
|
|
2733
2747
|
}
|
|
2734
2748
|
// --- Style ---
|
|
2735
|
-
_applyStyle(
|
|
2736
|
-
this._runLogicWithinErrorBoundary(
|
|
2737
|
-
|
|
2749
|
+
_applyStyle(n, r) {
|
|
2750
|
+
this._runLogicWithinErrorBoundary(n, () => {
|
|
2751
|
+
Gt(
|
|
2738
2752
|
this.shadowRoot,
|
|
2739
2753
|
this.context,
|
|
2740
|
-
|
|
2754
|
+
r,
|
|
2741
2755
|
this._styleSheet,
|
|
2742
2756
|
(i) => {
|
|
2743
2757
|
this._styleSheet = i;
|
|
@@ -2746,21 +2760,21 @@ function Zt(e, t) {
|
|
|
2746
2760
|
});
|
|
2747
2761
|
}
|
|
2748
2762
|
// --- Error Boundary function ---
|
|
2749
|
-
_runLogicWithinErrorBoundary(
|
|
2763
|
+
_runLogicWithinErrorBoundary(n, r) {
|
|
2750
2764
|
this._hasError && (this._hasError = !1);
|
|
2751
2765
|
try {
|
|
2752
|
-
|
|
2766
|
+
r();
|
|
2753
2767
|
} catch (i) {
|
|
2754
|
-
this._hasError = !0,
|
|
2768
|
+
this._hasError = !0, n.onError && n.onError(i, this.context);
|
|
2755
2769
|
}
|
|
2756
2770
|
}
|
|
2757
2771
|
// --- State, props, computed ---
|
|
2758
|
-
_initContext(
|
|
2772
|
+
_initContext(n) {
|
|
2759
2773
|
try {
|
|
2760
|
-
let
|
|
2774
|
+
let r = function(s, o = "") {
|
|
2761
2775
|
return Array.isArray(s) ? new Proxy(s, {
|
|
2762
|
-
get(a, u,
|
|
2763
|
-
const g = Reflect.get(a, u,
|
|
2776
|
+
get(a, u, y) {
|
|
2777
|
+
const g = Reflect.get(a, u, y);
|
|
2764
2778
|
return typeof g == "function" && typeof u == "string" && [
|
|
2765
2779
|
"push",
|
|
2766
2780
|
"pop",
|
|
@@ -2773,56 +2787,56 @@ function Zt(e, t) {
|
|
|
2773
2787
|
const l = g.apply(a, h);
|
|
2774
2788
|
if (!i._initializing) {
|
|
2775
2789
|
const d = o || "root";
|
|
2776
|
-
i._triggerWatchers(d, a),
|
|
2790
|
+
i._triggerWatchers(d, a), fe(() => i._render(n), i._componentId);
|
|
2777
2791
|
}
|
|
2778
2792
|
return l;
|
|
2779
2793
|
} : g;
|
|
2780
2794
|
},
|
|
2781
|
-
set(a, u,
|
|
2782
|
-
if (a[u] =
|
|
2795
|
+
set(a, u, y) {
|
|
2796
|
+
if (a[u] = y, !i._initializing) {
|
|
2783
2797
|
const g = o ? `${o}.${String(u)}` : String(u);
|
|
2784
|
-
i._triggerWatchers(g,
|
|
2798
|
+
i._triggerWatchers(g, y), fe(() => i._render(n), i._componentId);
|
|
2785
2799
|
}
|
|
2786
2800
|
return !0;
|
|
2787
2801
|
},
|
|
2788
2802
|
deleteProperty(a, u) {
|
|
2789
2803
|
if (delete a[u], !i._initializing) {
|
|
2790
|
-
const
|
|
2791
|
-
i._triggerWatchers(
|
|
2804
|
+
const y = o ? `${o}.${String(u)}` : String(u);
|
|
2805
|
+
i._triggerWatchers(y, void 0), fe(() => i._render(n), i._componentId);
|
|
2792
2806
|
}
|
|
2793
2807
|
return !0;
|
|
2794
2808
|
}
|
|
2795
2809
|
}) : s && typeof s == "object" ? s.constructor && s.constructor.name === "ReactiveState" ? s : (Object.keys(s).forEach((a) => {
|
|
2796
2810
|
const u = o ? `${o}.${a}` : a;
|
|
2797
|
-
s[a] =
|
|
2811
|
+
s[a] = r(s[a], u);
|
|
2798
2812
|
}), new Proxy(s, {
|
|
2799
|
-
set(a, u,
|
|
2813
|
+
set(a, u, y) {
|
|
2800
2814
|
const g = o ? `${o}.${String(u)}` : String(u);
|
|
2801
|
-
return a[u] =
|
|
2815
|
+
return a[u] = r(y, g), i._initializing || (i._triggerWatchers(
|
|
2802
2816
|
g,
|
|
2803
2817
|
a[u]
|
|
2804
|
-
),
|
|
2818
|
+
), fe(() => i._render(n), i._componentId)), !0;
|
|
2805
2819
|
},
|
|
2806
|
-
get(a, u,
|
|
2807
|
-
return Reflect.get(a, u,
|
|
2820
|
+
get(a, u, y) {
|
|
2821
|
+
return Reflect.get(a, u, y);
|
|
2808
2822
|
}
|
|
2809
2823
|
})) : s;
|
|
2810
2824
|
};
|
|
2811
2825
|
const i = this;
|
|
2812
|
-
return
|
|
2826
|
+
return r({
|
|
2813
2827
|
// For functional components, state is managed by state() function calls
|
|
2814
2828
|
// Include prop defaults in initial reactive context so prop updates trigger reactivity
|
|
2815
|
-
...
|
|
2816
|
-
Object.entries(
|
|
2829
|
+
...n.props ? Object.fromEntries(
|
|
2830
|
+
Object.entries(n.props).map(([s, o]) => [s, o.default])
|
|
2817
2831
|
) : {}
|
|
2818
2832
|
});
|
|
2819
2833
|
} catch {
|
|
2820
2834
|
return {};
|
|
2821
2835
|
}
|
|
2822
2836
|
}
|
|
2823
|
-
_initWatchers(
|
|
2824
|
-
this._runLogicWithinErrorBoundary(
|
|
2825
|
-
|
|
2837
|
+
_initWatchers(n) {
|
|
2838
|
+
this._runLogicWithinErrorBoundary(n, () => {
|
|
2839
|
+
yt(
|
|
2826
2840
|
this.context,
|
|
2827
2841
|
this._watchers,
|
|
2828
2842
|
{}
|
|
@@ -2830,41 +2844,41 @@ function Zt(e, t) {
|
|
|
2830
2844
|
);
|
|
2831
2845
|
});
|
|
2832
2846
|
}
|
|
2833
|
-
_triggerWatchers(
|
|
2834
|
-
|
|
2847
|
+
_triggerWatchers(n, r) {
|
|
2848
|
+
mt(this.context, this._watchers, n, r);
|
|
2835
2849
|
}
|
|
2836
|
-
_applyProps(
|
|
2837
|
-
this._runLogicWithinErrorBoundary(
|
|
2850
|
+
_applyProps(n) {
|
|
2851
|
+
this._runLogicWithinErrorBoundary(n, () => {
|
|
2838
2852
|
try {
|
|
2839
|
-
|
|
2840
|
-
} catch (
|
|
2841
|
-
this._hasError = !0,
|
|
2853
|
+
wt(this, n, this.context);
|
|
2854
|
+
} catch (r) {
|
|
2855
|
+
this._hasError = !0, n.onError && n.onError(r, this.context);
|
|
2842
2856
|
}
|
|
2843
2857
|
});
|
|
2844
2858
|
}
|
|
2845
2859
|
};
|
|
2846
2860
|
}
|
|
2847
|
-
function
|
|
2848
|
-
let
|
|
2849
|
-
|
|
2850
|
-
let
|
|
2861
|
+
function et(e, t) {
|
|
2862
|
+
let n = ne(e);
|
|
2863
|
+
n.includes("-") || (n = `cer-${n}`);
|
|
2864
|
+
let r = {};
|
|
2851
2865
|
if (typeof window < "u")
|
|
2852
2866
|
try {
|
|
2853
2867
|
const a = t.toString().match(/\(\s*{\s*([^}]+)\s*}/);
|
|
2854
2868
|
if (a) {
|
|
2855
|
-
const
|
|
2856
|
-
for (const g of
|
|
2857
|
-
const
|
|
2858
|
-
if (
|
|
2859
|
-
const h = g.substring(0,
|
|
2869
|
+
const y = a[1].split(",").map((g) => g.trim());
|
|
2870
|
+
for (const g of y) {
|
|
2871
|
+
const b = g.indexOf("=");
|
|
2872
|
+
if (b !== -1) {
|
|
2873
|
+
const h = g.substring(0, b).trim(), l = g.substring(b + 1).trim();
|
|
2860
2874
|
try {
|
|
2861
|
-
l === "true" ?
|
|
2875
|
+
l === "true" ? r[h] = !0 : l === "false" ? r[h] = !1 : l === "[]" ? r[h] = [] : l === "{}" ? r[h] = {} : /^\d+$/.test(l) ? r[h] = parseInt(l) : /^'.*'$/.test(l) || /^".*"$/.test(l) ? r[h] = l.slice(1, -1) : r[h] = l;
|
|
2862
2876
|
} catch {
|
|
2863
|
-
|
|
2877
|
+
r[h] = "";
|
|
2864
2878
|
}
|
|
2865
2879
|
} else {
|
|
2866
2880
|
const h = g.split(":")[0].trim();
|
|
2867
|
-
h && !h.includes("}") && (
|
|
2881
|
+
h && !h.includes("}") && (r[h] = "");
|
|
2868
2882
|
}
|
|
2869
2883
|
}
|
|
2870
2884
|
}
|
|
@@ -2874,7 +2888,7 @@ function Ye(e, t) {
|
|
|
2874
2888
|
const s = {
|
|
2875
2889
|
// Generate props config from defaults
|
|
2876
2890
|
props: Object.fromEntries(
|
|
2877
|
-
Object.entries(
|
|
2891
|
+
Object.entries(r).map(([o, a]) => [o, { type: typeof a == "boolean" ? Boolean : typeof a == "number" ? Number : typeof a == "string" ? String : Function, default: a }])
|
|
2878
2892
|
),
|
|
2879
2893
|
// Add lifecycle hooks from the stored functions
|
|
2880
2894
|
onConnected: (o) => {
|
|
@@ -2883,55 +2897,55 @@ function Ye(e, t) {
|
|
|
2883
2897
|
onDisconnected: (o) => {
|
|
2884
2898
|
i.onDisconnected && i.onDisconnected();
|
|
2885
2899
|
},
|
|
2886
|
-
onAttributeChanged: (o, a, u,
|
|
2900
|
+
onAttributeChanged: (o, a, u, y) => {
|
|
2887
2901
|
i.onAttributeChanged && i.onAttributeChanged(o, a, u);
|
|
2888
2902
|
},
|
|
2889
2903
|
onError: (o, a) => {
|
|
2890
2904
|
i.onError && o && i.onError(o);
|
|
2891
2905
|
},
|
|
2892
2906
|
render: (o) => {
|
|
2893
|
-
const a = o._componentId || `${
|
|
2907
|
+
const a = o._componentId || `${n}-${Math.random().toString(36).substr(2, 9)}`;
|
|
2894
2908
|
F.setCurrentComponent(a, () => {
|
|
2895
2909
|
o.requestRender && o.requestRender();
|
|
2896
2910
|
});
|
|
2897
2911
|
try {
|
|
2898
|
-
|
|
2899
|
-
const u = Object.keys(
|
|
2900
|
-
let
|
|
2912
|
+
Xt(o);
|
|
2913
|
+
const u = Object.keys(r).length > 0;
|
|
2914
|
+
let y;
|
|
2901
2915
|
if (u) {
|
|
2902
2916
|
const g = {};
|
|
2903
|
-
Object.keys(
|
|
2904
|
-
g[
|
|
2905
|
-
}),
|
|
2917
|
+
Object.keys(r).forEach((b) => {
|
|
2918
|
+
g[b] = o[b] ?? r[b];
|
|
2919
|
+
}), y = t(g);
|
|
2906
2920
|
} else
|
|
2907
|
-
|
|
2921
|
+
y = t();
|
|
2908
2922
|
if (o._hookCallbacks) {
|
|
2909
2923
|
const g = o._hookCallbacks;
|
|
2910
2924
|
g.onConnected && (i.onConnected = g.onConnected), g.onDisconnected && (i.onDisconnected = g.onDisconnected), g.onAttributeChanged && (i.onAttributeChanged = g.onAttributeChanged), g.onError && (i.onError = g.onError), g.style && (o._styleCallback = g.style);
|
|
2911
2925
|
}
|
|
2912
|
-
return
|
|
2926
|
+
return y;
|
|
2913
2927
|
} finally {
|
|
2914
|
-
|
|
2928
|
+
Yt(), F.clearCurrentComponent();
|
|
2915
2929
|
}
|
|
2916
2930
|
}
|
|
2917
2931
|
};
|
|
2918
|
-
|
|
2932
|
+
Te.set(n, s), typeof window < "u" && (customElements.get(n) || customElements.define(n, Qt(n, s)));
|
|
2919
2933
|
}
|
|
2920
|
-
class
|
|
2934
|
+
class en {
|
|
2921
2935
|
map = /* @__PURE__ */ new Map();
|
|
2922
2936
|
maxSize;
|
|
2923
2937
|
constructor(t) {
|
|
2924
2938
|
this.maxSize = t;
|
|
2925
2939
|
}
|
|
2926
2940
|
get(t) {
|
|
2927
|
-
const
|
|
2928
|
-
if (
|
|
2929
|
-
return this.map.delete(t), this.map.set(t,
|
|
2941
|
+
const n = this.map.get(t);
|
|
2942
|
+
if (n !== void 0)
|
|
2943
|
+
return this.map.delete(t), this.map.set(t, n), n;
|
|
2930
2944
|
}
|
|
2931
|
-
set(t,
|
|
2932
|
-
if (this.map.has(t) && this.map.delete(t), this.map.set(t,
|
|
2933
|
-
const
|
|
2934
|
-
|
|
2945
|
+
set(t, n) {
|
|
2946
|
+
if (this.map.has(t) && this.map.delete(t), this.map.set(t, n), this.map.size > this.maxSize) {
|
|
2947
|
+
const r = this.map.keys().next().value;
|
|
2948
|
+
r !== void 0 && this.map.delete(r);
|
|
2935
2949
|
}
|
|
2936
2950
|
}
|
|
2937
2951
|
has(t) {
|
|
@@ -2941,8 +2955,8 @@ class Gt {
|
|
|
2941
2955
|
this.map.clear();
|
|
2942
2956
|
}
|
|
2943
2957
|
}
|
|
2944
|
-
const
|
|
2945
|
-
function
|
|
2958
|
+
const De = new en(500);
|
|
2959
|
+
function tn(e, t) {
|
|
2946
2960
|
if (e == null) {
|
|
2947
2961
|
console.warn(
|
|
2948
2962
|
`⚠️ Event handler for '@${t}' is ${e}. This will prevent the event from working. Use a function reference instead: @${t}="\${functionName}"`
|
|
@@ -2955,107 +2969,107 @@ function Xt(e, t) {
|
|
|
2955
2969
|
`💡 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()}"`
|
|
2956
2970
|
);
|
|
2957
2971
|
}
|
|
2958
|
-
function
|
|
2959
|
-
const i =
|
|
2960
|
-
return { tag: e, key: i, props: t, children:
|
|
2972
|
+
function pe(e, t = {}, n, r) {
|
|
2973
|
+
const i = r ?? t.key;
|
|
2974
|
+
return { tag: e, key: i, props: t, children: n };
|
|
2961
2975
|
}
|
|
2962
|
-
function
|
|
2976
|
+
function Ae(e) {
|
|
2963
2977
|
return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
|
|
2964
2978
|
}
|
|
2965
|
-
function
|
|
2966
|
-
return typeof e == "object" && e !== null && "tag" in e && !
|
|
2979
|
+
function _e(e) {
|
|
2980
|
+
return typeof e == "object" && e !== null && "tag" in e && !Ae(e);
|
|
2967
2981
|
}
|
|
2968
|
-
function
|
|
2982
|
+
function nn(e, t) {
|
|
2969
2983
|
return e.key != null ? e : { ...e, key: t };
|
|
2970
2984
|
}
|
|
2971
|
-
function
|
|
2972
|
-
const
|
|
2985
|
+
function rn(e, t = [], n = {}) {
|
|
2986
|
+
const r = {}, i = {}, s = {}, o = [], a = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
|
|
2973
2987
|
let u;
|
|
2974
2988
|
for (; u = a.exec(e); ) {
|
|
2975
|
-
const
|
|
2976
|
-
let l = h ? t[Number(h[1])] ?? null :
|
|
2989
|
+
const y = u[1], g = u[2], b = (u[4] || u[6]) ?? "", h = b.match(/^{{(\d+)}}$/);
|
|
2990
|
+
let l = h ? t[Number(h[1])] ?? null : b;
|
|
2977
2991
|
h || (l === "true" ? l = !0 : l === "false" ? l = !1 : l === "null" ? l = null : isNaN(Number(l)) || (l = Number(l)));
|
|
2978
2992
|
const d = ["model", "bind", "show", "class", "style", "ref"];
|
|
2979
|
-
if (
|
|
2980
|
-
const [
|
|
2993
|
+
if (y === ":") {
|
|
2994
|
+
const [x, w] = g.split(":"), [c, ...p] = x.split(".");
|
|
2981
2995
|
if (d.includes(c)) {
|
|
2982
|
-
const
|
|
2996
|
+
const m = [...p], C = c === "model" && w ? `model:${w}` : c;
|
|
2983
2997
|
s[C] = {
|
|
2984
2998
|
value: l,
|
|
2985
|
-
modifiers:
|
|
2986
|
-
arg:
|
|
2999
|
+
modifiers: m,
|
|
3000
|
+
arg: w
|
|
2987
3001
|
};
|
|
2988
3002
|
} else {
|
|
2989
|
-
let
|
|
2990
|
-
|
|
3003
|
+
let m = l;
|
|
3004
|
+
m && ee(m) && (m = m.value), i[g] = m, o.push(g);
|
|
2991
3005
|
}
|
|
2992
|
-
} else if (
|
|
2993
|
-
const [
|
|
2994
|
-
|
|
2995
|
-
const p = typeof l == "function" ? l : typeof
|
|
3006
|
+
} else if (y === "@") {
|
|
3007
|
+
const [x, ...w] = g.split("."), c = w;
|
|
3008
|
+
tn(l, x);
|
|
3009
|
+
const p = typeof l == "function" ? l : typeof n[l] == "function" ? n[l] : void 0;
|
|
2996
3010
|
if (p) {
|
|
2997
|
-
const
|
|
3011
|
+
const m = (k) => {
|
|
2998
3012
|
if (c.includes("prevent") && k.preventDefault(), c.includes("stop") && k.stopPropagation(), !(c.includes("self") && k.target !== k.currentTarget))
|
|
2999
|
-
return c.includes("once") && k.currentTarget?.removeEventListener(
|
|
3000
|
-
}, C = "on" +
|
|
3001
|
-
|
|
3013
|
+
return c.includes("once") && k.currentTarget?.removeEventListener(x, m), p(k);
|
|
3014
|
+
}, C = "on" + x.charAt(0).toUpperCase() + x.slice(1);
|
|
3015
|
+
r[C] = m;
|
|
3002
3016
|
}
|
|
3003
|
-
} else g === "ref" ?
|
|
3017
|
+
} else g === "ref" ? r.ref = l : i[g] = l;
|
|
3004
3018
|
}
|
|
3005
|
-
return { props:
|
|
3019
|
+
return { props: r, attrs: i, directives: s, bound: o };
|
|
3006
3020
|
}
|
|
3007
|
-
function
|
|
3008
|
-
const
|
|
3021
|
+
function sn(e, t, n) {
|
|
3022
|
+
const r = ge.length > 0 ? ge[ge.length - 1] : void 0, i = n ?? r, s = !n && t.length === 0, o = s ? e.join("<!--TEMPLATE_DELIM-->") : null;
|
|
3009
3023
|
if (s && o) {
|
|
3010
|
-
const f =
|
|
3024
|
+
const f = De.get(o);
|
|
3011
3025
|
if (f) return f;
|
|
3012
3026
|
}
|
|
3013
|
-
function a(f,
|
|
3014
|
-
return
|
|
3027
|
+
function a(f, v) {
|
|
3028
|
+
return pe("#text", {}, f, v);
|
|
3015
3029
|
}
|
|
3016
3030
|
let u = "";
|
|
3017
3031
|
for (let f = 0; f < e.length; f++)
|
|
3018
3032
|
u += e[f], f < t.length && (u += `{{${f}}}`);
|
|
3019
|
-
const
|
|
3020
|
-
let
|
|
3033
|
+
const y = /<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, g = [];
|
|
3034
|
+
let b, h = [], l = null, d = {}, x, w = 0, c = [];
|
|
3021
3035
|
function p(f) {
|
|
3022
|
-
!f || typeof f != "object" ||
|
|
3023
|
-
if (
|
|
3036
|
+
!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) => {
|
|
3037
|
+
if (v === "style" && d.attrs.style) {
|
|
3024
3038
|
const A = d.attrs.style.replace(
|
|
3025
3039
|
/;?\s*$/,
|
|
3026
3040
|
""
|
|
3027
3041
|
), _ = f.attrs.style.replace(/^;?\s*/, "");
|
|
3028
3042
|
d.attrs.style = A + "; " + _;
|
|
3029
|
-
} else if (
|
|
3030
|
-
const A = d.attrs.class.trim().split(/\s+/).filter(Boolean), _ = f.attrs.class.trim().split(/\s+/).filter(Boolean),
|
|
3043
|
+
} else if (v === "class" && d.attrs.class) {
|
|
3044
|
+
const A = d.attrs.class.trim().split(/\s+/).filter(Boolean), _ = f.attrs.class.trim().split(/\s+/).filter(Boolean), $ = [
|
|
3031
3045
|
.../* @__PURE__ */ new Set([...A, ..._])
|
|
3032
3046
|
];
|
|
3033
|
-
d.attrs.class =
|
|
3047
|
+
d.attrs.class = $.join(" ");
|
|
3034
3048
|
} else
|
|
3035
|
-
d.attrs[
|
|
3049
|
+
d.attrs[v] = f.attrs[v];
|
|
3036
3050
|
}))) : (d.props || (d.props = {}), Object.assign(d.props, f)));
|
|
3037
3051
|
}
|
|
3038
|
-
function
|
|
3052
|
+
function m(f, v) {
|
|
3039
3053
|
const A = l ? h : c;
|
|
3040
|
-
if (
|
|
3041
|
-
const _ = f.key ??
|
|
3042
|
-
let
|
|
3054
|
+
if (Ae(f)) {
|
|
3055
|
+
const _ = f.key ?? v;
|
|
3056
|
+
let $ = f.children;
|
|
3043
3057
|
A.push({
|
|
3044
3058
|
...f,
|
|
3045
3059
|
key: _,
|
|
3046
|
-
children:
|
|
3060
|
+
children: $
|
|
3047
3061
|
});
|
|
3048
3062
|
return;
|
|
3049
3063
|
}
|
|
3050
|
-
if (
|
|
3051
|
-
A.push(
|
|
3064
|
+
if (_e(f)) {
|
|
3065
|
+
A.push(nn(f, void 0));
|
|
3052
3066
|
return;
|
|
3053
3067
|
}
|
|
3054
3068
|
if (Array.isArray(f)) {
|
|
3055
3069
|
if (f.length === 0) return;
|
|
3056
3070
|
for (let _ = 0; _ < f.length; _++) {
|
|
3057
|
-
const
|
|
3058
|
-
|
|
3071
|
+
const $ = f[_];
|
|
3072
|
+
Ae($) || _e($) || Array.isArray($) ? m($, `${v}-${_}`) : $ !== null && typeof $ == "object" ? p($) : A.push(a(String($), `${v}-${_}`));
|
|
3059
3073
|
}
|
|
3060
3074
|
return;
|
|
3061
3075
|
}
|
|
@@ -3063,7 +3077,7 @@ function er(e, t, r) {
|
|
|
3063
3077
|
p(f);
|
|
3064
3078
|
return;
|
|
3065
3079
|
}
|
|
3066
|
-
A.push(a(String(f),
|
|
3080
|
+
A.push(a(String(f), v));
|
|
3067
3081
|
}
|
|
3068
3082
|
const C = /* @__PURE__ */ new Set([
|
|
3069
3083
|
"area",
|
|
@@ -3081,20 +3095,20 @@ function er(e, t, r) {
|
|
|
3081
3095
|
"track",
|
|
3082
3096
|
"wbr"
|
|
3083
3097
|
]);
|
|
3084
|
-
for (;
|
|
3085
|
-
if (!(
|
|
3086
|
-
if (
|
|
3087
|
-
const f =
|
|
3098
|
+
for (; b = y.exec(u); )
|
|
3099
|
+
if (!(b[0].startsWith("<!--") && b[0].endsWith("-->"))) {
|
|
3100
|
+
if (b[1]) {
|
|
3101
|
+
const f = b[1], v = b[0][1] === "/", A = b[0][b[0].length - 2] === "/" || C.has(f), {
|
|
3088
3102
|
props: _,
|
|
3089
|
-
attrs:
|
|
3090
|
-
directives:
|
|
3091
|
-
bound:
|
|
3092
|
-
} =
|
|
3093
|
-
for (const P in _)
|
|
3094
|
-
for (const P in
|
|
3095
|
-
if (
|
|
3103
|
+
attrs: $,
|
|
3104
|
+
directives: T,
|
|
3105
|
+
bound: R
|
|
3106
|
+
} = rn(b[2] || "", t, i), S = { props: {}, attrs: {} };
|
|
3107
|
+
for (const P in _) S.props[P] = _[P];
|
|
3108
|
+
for (const P in $) S.attrs[P] = $[P];
|
|
3109
|
+
if (S.attrs && Object.prototype.hasOwnProperty.call(S.attrs, "key") && !(S.props && Object.prototype.hasOwnProperty.call(S.props, "key")))
|
|
3096
3110
|
try {
|
|
3097
|
-
|
|
3111
|
+
S.props.key = S.attrs.key;
|
|
3098
3112
|
} catch {
|
|
3099
3113
|
}
|
|
3100
3114
|
try {
|
|
@@ -3107,188 +3121,188 @@ function er(e, t, r) {
|
|
|
3107
3121
|
audio: ["muted", "autoplay", "controls", "loop"],
|
|
3108
3122
|
img: ["src", "alt", "width", "height"],
|
|
3109
3123
|
button: ["type", "name", "value", "disabled", "autofocus", "form"]
|
|
3110
|
-
}, B = f.toLowerCase(),
|
|
3111
|
-
if (
|
|
3112
|
-
for (const K of
|
|
3113
|
-
if (
|
|
3114
|
-
let L =
|
|
3115
|
-
L &&
|
|
3124
|
+
}, B = f.toLowerCase(), V = P[B] ?? [];
|
|
3125
|
+
if (S.attrs) {
|
|
3126
|
+
for (const K of V)
|
|
3127
|
+
if (R && R.includes(K) && K in S.attrs && !(S.props && K in S.props)) {
|
|
3128
|
+
let L = S.attrs[K];
|
|
3129
|
+
L && ee(L) && (L = L.value), S.props[K] = L, delete S.attrs[K];
|
|
3116
3130
|
}
|
|
3117
3131
|
}
|
|
3118
|
-
if ((f.includes("-") || !!i?.__customElements?.has?.(f)) && (
|
|
3132
|
+
if ((f.includes("-") || !!i?.__customElements?.has?.(f)) && (S.isCustomElement = !0, R && S.attrs)) {
|
|
3119
3133
|
const K = /* @__PURE__ */ new Set(["id", "name", "data-key", "key"]);
|
|
3120
|
-
for (const L of
|
|
3121
|
-
if (L in
|
|
3122
|
-
const
|
|
3123
|
-
let
|
|
3124
|
-
|
|
3134
|
+
for (const L of R)
|
|
3135
|
+
if (L in S.attrs && !(S.props && L in S.props)) {
|
|
3136
|
+
const M = L.includes("-") ? L.split("-").map((Z, z) => z === 0 ? Z : Z.charAt(0).toUpperCase() + Z.slice(1)).join("") : L;
|
|
3137
|
+
let J = S.attrs[L];
|
|
3138
|
+
J && ee(J) && (J = J.value), S.props[M] = J, K.has(L) || delete S.attrs[L];
|
|
3125
3139
|
}
|
|
3126
3140
|
}
|
|
3127
3141
|
} catch {
|
|
3128
3142
|
}
|
|
3129
|
-
if (
|
|
3143
|
+
if (T && Object.keys(T).some((P) => P === "model" || P.startsWith("model:")))
|
|
3130
3144
|
try {
|
|
3131
|
-
const P = Symbol.for("cer.registry"), B = globalThis[P],
|
|
3132
|
-
if (!!(f.includes("-") ||
|
|
3133
|
-
for (const
|
|
3134
|
-
if (
|
|
3135
|
-
const
|
|
3145
|
+
const P = Symbol.for("cer.registry"), B = globalThis[P], V = !!(B && typeof B.has == "function" && B.has(f)), we = !!(i && (i.__customElements instanceof Set && i.__customElements.has(f) || Array.isArray(i.__isCustomElements) && i.__isCustomElements.includes(f)));
|
|
3146
|
+
if (!!(f.includes("-") || we || V))
|
|
3147
|
+
for (const M of Object.keys(T)) {
|
|
3148
|
+
if (M !== "model" && !M.startsWith("model:")) continue;
|
|
3149
|
+
const J = T[M], Z = J.arg ?? (M.includes(":") ? M.split(":", 2)[1] : void 0), z = J.value, E = Z ?? "modelValue", U = H, D = Ee, W = i ? i._state || i : void 0;
|
|
3136
3150
|
let O;
|
|
3137
|
-
typeof
|
|
3151
|
+
typeof z == "string" && i ? O = U(W, z) : (O = z, O && ee(O) && (O = O.value)), S.props[E] = O;
|
|
3138
3152
|
try {
|
|
3139
|
-
const re =
|
|
3140
|
-
|
|
3153
|
+
const re = ne(E);
|
|
3154
|
+
S.attrs || (S.attrs = {}), O !== void 0 && (S.attrs[re] = O);
|
|
3141
3155
|
} catch {
|
|
3142
3156
|
}
|
|
3143
|
-
|
|
3144
|
-
const
|
|
3145
|
-
|
|
3157
|
+
S.isCustomElement = !0;
|
|
3158
|
+
const qe = `update:${ne(E)}`.replace(/-([a-z])/g, (re, Y) => Y.toUpperCase()), ut = "on" + qe.charAt(0).toUpperCase() + qe.slice(1);
|
|
3159
|
+
S.props[ut] = function(re) {
|
|
3146
3160
|
const Y = re.detail !== void 0 ? re.detail : re.target ? re.target.value : void 0;
|
|
3147
|
-
if (
|
|
3148
|
-
if (
|
|
3149
|
-
const
|
|
3150
|
-
(Array.isArray(Y) && Array.isArray(
|
|
3161
|
+
if (W)
|
|
3162
|
+
if (z && ee(z)) {
|
|
3163
|
+
const ae = z.value;
|
|
3164
|
+
(Array.isArray(Y) && Array.isArray(ae) ? JSON.stringify([...Y].sort()) !== JSON.stringify([...ae].sort()) : Y !== ae) && (z.value = Y, i?.requestRender ? i.requestRender() : i?._requestRender && i._requestRender());
|
|
3151
3165
|
} else {
|
|
3152
|
-
const
|
|
3153
|
-
(Array.isArray(Y) && Array.isArray(
|
|
3166
|
+
const ae = U(W, typeof z == "string" ? z : String(z));
|
|
3167
|
+
(Array.isArray(Y) && Array.isArray(ae) ? JSON.stringify([...Y].sort()) !== JSON.stringify([...ae].sort()) : Y !== ae) && (D(W, typeof z == "string" ? z : String(z), Y), i?.requestRender ? i.requestRender() : i?._requestRender && i._requestRender());
|
|
3154
3168
|
}
|
|
3155
|
-
}, delete
|
|
3169
|
+
}, delete T[M];
|
|
3156
3170
|
}
|
|
3157
3171
|
} catch {
|
|
3158
3172
|
}
|
|
3159
|
-
if (Object.keys(
|
|
3160
|
-
const P =
|
|
3173
|
+
if (Object.keys(T).length > 0 && (S.directives = { ...T }), v) {
|
|
3174
|
+
const P = pe(
|
|
3161
3175
|
l,
|
|
3162
3176
|
d,
|
|
3163
|
-
h.length === 1 &&
|
|
3164
|
-
|
|
3177
|
+
h.length === 1 && _e(h[0]) && h[0].tag === "#text" ? typeof h[0].children == "string" ? h[0].children : "" : h.length ? h : void 0,
|
|
3178
|
+
x
|
|
3165
3179
|
), B = g.pop();
|
|
3166
|
-
B ? (l = B.tag, d = B.props,
|
|
3167
|
-
} else A ? l ? h.push(
|
|
3180
|
+
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 = []);
|
|
3181
|
+
} else A ? l ? h.push(pe(f, S, void 0, void 0)) : c.push(pe(f, S, void 0, void 0)) : (l && g.push({
|
|
3168
3182
|
tag: l,
|
|
3169
3183
|
props: d,
|
|
3170
3184
|
children: h,
|
|
3171
|
-
key:
|
|
3172
|
-
}), l = f, d =
|
|
3173
|
-
} else if (typeof
|
|
3174
|
-
const f = Number(
|
|
3175
|
-
|
|
3176
|
-
} else if (
|
|
3177
|
-
const f =
|
|
3185
|
+
key: x
|
|
3186
|
+
}), l = f, d = S, h = []);
|
|
3187
|
+
} else if (typeof b[3] < "u") {
|
|
3188
|
+
const f = Number(b[3]), v = t[f], A = `interp-${f}`;
|
|
3189
|
+
m(v, A);
|
|
3190
|
+
} else if (b[4]) {
|
|
3191
|
+
const f = b[4], v = l ? h : c, A = f.split(/({{\d+}})/);
|
|
3178
3192
|
for (const _ of A) {
|
|
3179
3193
|
if (!_) continue;
|
|
3180
|
-
const
|
|
3181
|
-
if (
|
|
3182
|
-
const
|
|
3183
|
-
|
|
3194
|
+
const $ = _.match(/^{{(\d+)}}$/);
|
|
3195
|
+
if ($) {
|
|
3196
|
+
const T = Number($[1]), R = t[T], S = `interp-${T}`;
|
|
3197
|
+
m(R, S);
|
|
3184
3198
|
} else {
|
|
3185
|
-
const
|
|
3186
|
-
|
|
3199
|
+
const T = `text-${w++}`;
|
|
3200
|
+
v.push(a(_, T));
|
|
3187
3201
|
}
|
|
3188
3202
|
}
|
|
3189
3203
|
}
|
|
3190
3204
|
}
|
|
3191
|
-
const k = c.filter((f) =>
|
|
3205
|
+
const k = c.filter((f) => _e(f) && f.tag === "#text" ? typeof f.children == "string" && f.children.trim() !== "" : !0);
|
|
3192
3206
|
if (k.length === 1) {
|
|
3193
3207
|
const f = k[0];
|
|
3194
|
-
return s && o &&
|
|
3208
|
+
return s && o && De.set(o, f), f;
|
|
3195
3209
|
} else if (k.length > 1) {
|
|
3196
3210
|
const f = k;
|
|
3197
|
-
return s && o &&
|
|
3211
|
+
return s && o && De.set(o, f), f;
|
|
3198
3212
|
}
|
|
3199
|
-
return
|
|
3213
|
+
return pe("div", {}, "", "fallback-root");
|
|
3200
3214
|
}
|
|
3201
|
-
function
|
|
3202
|
-
const
|
|
3203
|
-
return
|
|
3215
|
+
function ce(e, ...t) {
|
|
3216
|
+
const n = t[t.length - 1], r = typeof n == "object" && n && !Array.isArray(n) ? n : void 0;
|
|
3217
|
+
return sn(e, t, r);
|
|
3204
3218
|
}
|
|
3205
|
-
function
|
|
3206
|
-
return
|
|
3219
|
+
function Re(e, t) {
|
|
3220
|
+
return j(e ? t : [], "when-block");
|
|
3207
3221
|
}
|
|
3208
|
-
function
|
|
3209
|
-
return e.map((
|
|
3210
|
-
const i = typeof
|
|
3211
|
-
return
|
|
3222
|
+
function xn(e, t) {
|
|
3223
|
+
return e.map((n, r) => {
|
|
3224
|
+
const i = typeof n == "object" ? n?.key ?? n?.id ?? `idx-${r}` : String(n);
|
|
3225
|
+
return j(t(n, r), `each-${i}`);
|
|
3212
3226
|
});
|
|
3213
3227
|
}
|
|
3214
|
-
function
|
|
3228
|
+
function on() {
|
|
3215
3229
|
const e = [];
|
|
3216
3230
|
return {
|
|
3217
|
-
when(t,
|
|
3218
|
-
return e.push([t,
|
|
3231
|
+
when(t, n) {
|
|
3232
|
+
return e.push([t, n]), this;
|
|
3219
3233
|
},
|
|
3220
3234
|
otherwise(t) {
|
|
3221
3235
|
return e.push([!0, t]), this;
|
|
3222
3236
|
},
|
|
3223
3237
|
done() {
|
|
3224
|
-
return
|
|
3238
|
+
return an(...e);
|
|
3225
3239
|
}
|
|
3226
3240
|
};
|
|
3227
3241
|
}
|
|
3228
|
-
function
|
|
3242
|
+
function an(...e) {
|
|
3229
3243
|
for (let t = 0; t < e.length; t++) {
|
|
3230
|
-
const [
|
|
3231
|
-
if (
|
|
3244
|
+
const [n, r] = e[t];
|
|
3245
|
+
if (n) return [j(r, `whenChain-branch-${t}`)];
|
|
3232
3246
|
}
|
|
3233
|
-
return [
|
|
3247
|
+
return [j([], "whenChain-empty")];
|
|
3234
3248
|
}
|
|
3235
|
-
function
|
|
3236
|
-
const
|
|
3249
|
+
function j(e, t) {
|
|
3250
|
+
const n = e ? Array.isArray(e) ? e.filter(Boolean) : [e].filter(Boolean) : [];
|
|
3237
3251
|
return {
|
|
3238
3252
|
tag: "#anchor",
|
|
3239
3253
|
key: t,
|
|
3240
|
-
children:
|
|
3254
|
+
children: n
|
|
3241
3255
|
};
|
|
3242
3256
|
}
|
|
3243
|
-
function
|
|
3244
|
-
return
|
|
3257
|
+
function vn(e, t) {
|
|
3258
|
+
return Re(!e, t);
|
|
3245
3259
|
}
|
|
3246
|
-
function
|
|
3247
|
-
const
|
|
3248
|
-
return
|
|
3260
|
+
function kn(e, t) {
|
|
3261
|
+
const n = !e || e.length === 0;
|
|
3262
|
+
return Re(n, t);
|
|
3249
3263
|
}
|
|
3250
|
-
function
|
|
3251
|
-
const
|
|
3252
|
-
return
|
|
3264
|
+
function Cn(e, t) {
|
|
3265
|
+
const n = !!(e && e.length > 0);
|
|
3266
|
+
return Re(n, t);
|
|
3253
3267
|
}
|
|
3254
|
-
function
|
|
3255
|
-
const
|
|
3268
|
+
function _n(e, t, n) {
|
|
3269
|
+
const r = [];
|
|
3256
3270
|
return e.forEach((i, s) => {
|
|
3257
|
-
t(i, s) &&
|
|
3258
|
-
}),
|
|
3271
|
+
t(i, s) && r.push({ item: i, originalIndex: s });
|
|
3272
|
+
}), r.map(({ item: i, originalIndex: s }, o) => {
|
|
3259
3273
|
const a = typeof i == "object" && i != null ? i?.key ?? i?.id ?? `filtered-${s}` : `filtered-${s}`;
|
|
3260
|
-
return
|
|
3274
|
+
return j(n(i, s, o), `each-where-${a}`);
|
|
3261
3275
|
});
|
|
3262
3276
|
}
|
|
3263
|
-
function
|
|
3264
|
-
const
|
|
3265
|
-
return
|
|
3277
|
+
function En(e, t) {
|
|
3278
|
+
const n = e?.length ?? 0;
|
|
3279
|
+
return n === 0 && t.empty ? j(t.empty, "switch-length-empty") : n === 1 && t.one ? j(t.one(e[0]), "switch-length-one") : t.exactly?.[n] ? j(t.exactly[n](e), `switch-length-${n}`) : n > 1 && t.many ? j(t.many(e), "switch-length-many") : j([], "switch-length-fallback");
|
|
3266
3280
|
}
|
|
3267
|
-
function
|
|
3268
|
-
const
|
|
3281
|
+
function $n(e, t, n) {
|
|
3282
|
+
const r = /* @__PURE__ */ new Map();
|
|
3269
3283
|
return e.forEach((i) => {
|
|
3270
3284
|
const s = t(i);
|
|
3271
|
-
|
|
3272
|
-
}), Array.from(
|
|
3273
|
-
|
|
3285
|
+
r.has(s) || r.set(s, []), r.get(s).push(i);
|
|
3286
|
+
}), Array.from(r.entries()).map(([i, s], o) => j(
|
|
3287
|
+
n(i, s, o),
|
|
3274
3288
|
`each-group-${i}`
|
|
3275
3289
|
));
|
|
3276
3290
|
}
|
|
3277
|
-
function
|
|
3278
|
-
const i =
|
|
3291
|
+
function Sn(e, t, n, r) {
|
|
3292
|
+
const i = n * t, s = Math.min(i + t, e.length);
|
|
3279
3293
|
return e.slice(i, s).map((a, u) => {
|
|
3280
|
-
const
|
|
3281
|
-
return
|
|
3294
|
+
const y = i + u, g = typeof a == "object" && a != null ? a?.key ?? a?.id ?? `page-${y}` : `page-${y}`;
|
|
3295
|
+
return j(r(a, y, u), `each-page-${g}`);
|
|
3282
3296
|
});
|
|
3283
3297
|
}
|
|
3284
|
-
function
|
|
3285
|
-
return e.loading && t.loading ?
|
|
3298
|
+
function An(e, t) {
|
|
3299
|
+
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");
|
|
3286
3300
|
}
|
|
3287
3301
|
function q(e, t) {
|
|
3288
|
-
const
|
|
3289
|
-
return
|
|
3302
|
+
const n = typeof window < "u" && window.matchMedia?.(e)?.matches;
|
|
3303
|
+
return Re(!!n, t);
|
|
3290
3304
|
}
|
|
3291
|
-
const
|
|
3305
|
+
const te = {
|
|
3292
3306
|
// Responsive breakpoints (matching style.ts)
|
|
3293
3307
|
sm: "(min-width:640px)",
|
|
3294
3308
|
md: "(min-width:768px)",
|
|
@@ -3297,15 +3311,15 @@ const ee = {
|
|
|
3297
3311
|
"2xl": "(min-width:1536px)",
|
|
3298
3312
|
// Dark mode (matching style.ts)
|
|
3299
3313
|
dark: "(prefers-color-scheme: dark)"
|
|
3300
|
-
},
|
|
3314
|
+
}, lt = ["sm", "md", "lg", "xl", "2xl"], cn = {
|
|
3301
3315
|
// Breakpoint-based rendering (matching style.ts exactly)
|
|
3302
|
-
sm: (e) => q(
|
|
3303
|
-
md: (e) => q(
|
|
3304
|
-
lg: (e) => q(
|
|
3305
|
-
xl: (e) => q(
|
|
3306
|
-
"2xl": (e) => q(
|
|
3316
|
+
sm: (e) => q(te.sm, e),
|
|
3317
|
+
md: (e) => q(te.md, e),
|
|
3318
|
+
lg: (e) => q(te.lg, e),
|
|
3319
|
+
xl: (e) => q(te.xl, e),
|
|
3320
|
+
"2xl": (e) => q(te["2xl"], e),
|
|
3307
3321
|
// Dark mode (matching style.ts)
|
|
3308
|
-
dark: (e) => q(
|
|
3322
|
+
dark: (e) => q(te.dark, e),
|
|
3309
3323
|
light: (e) => q("(prefers-color-scheme: light)", e),
|
|
3310
3324
|
// Accessibility and interaction preferences
|
|
3311
3325
|
touch: (e) => q("(hover: none) and (pointer: coarse)", e),
|
|
@@ -3316,48 +3330,48 @@ const ee = {
|
|
|
3316
3330
|
portrait: (e) => q("(orientation: portrait)", e),
|
|
3317
3331
|
landscape: (e) => q("(orientation: landscape)", e)
|
|
3318
3332
|
};
|
|
3319
|
-
function
|
|
3320
|
-
const
|
|
3321
|
-
e.includes("dark") ?
|
|
3322
|
-
const
|
|
3323
|
-
(o) =>
|
|
3324
|
-
), i =
|
|
3325
|
-
i && i in
|
|
3326
|
-
const s =
|
|
3333
|
+
function Tn(e, t) {
|
|
3334
|
+
const n = [];
|
|
3335
|
+
e.includes("dark") ? n.push(te.dark) : e.includes("light") && n.push("(prefers-color-scheme: light)");
|
|
3336
|
+
const r = e.filter(
|
|
3337
|
+
(o) => lt.includes(o)
|
|
3338
|
+
), i = r[r.length - 1];
|
|
3339
|
+
i && i in te && n.push(te[i]);
|
|
3340
|
+
const s = n.length > 0 ? n.join(" and ") : "all";
|
|
3327
3341
|
return q(s, t);
|
|
3328
3342
|
}
|
|
3329
|
-
function
|
|
3343
|
+
function Rn(e) {
|
|
3330
3344
|
const t = [];
|
|
3331
|
-
return e.base && t.push(
|
|
3332
|
-
const
|
|
3333
|
-
|
|
3345
|
+
return e.base && t.push(j(e.base, "responsive-base")), lt.forEach((n) => {
|
|
3346
|
+
const r = e[n];
|
|
3347
|
+
r && t.push(cn[n](r));
|
|
3334
3348
|
}), t;
|
|
3335
3349
|
}
|
|
3336
|
-
function
|
|
3350
|
+
function On(e) {
|
|
3337
3351
|
const t = [];
|
|
3338
|
-
let
|
|
3352
|
+
let n = null;
|
|
3339
3353
|
return {
|
|
3340
|
-
case(
|
|
3341
|
-
const s = typeof
|
|
3354
|
+
case(r, i) {
|
|
3355
|
+
const s = typeof r == "function" ? r : (o) => o === r;
|
|
3342
3356
|
return t.push({ condition: s, content: i }), this;
|
|
3343
3357
|
},
|
|
3344
|
-
when(
|
|
3345
|
-
return t.push({ condition:
|
|
3358
|
+
when(r, i) {
|
|
3359
|
+
return t.push({ condition: r, content: i }), this;
|
|
3346
3360
|
},
|
|
3347
|
-
otherwise(
|
|
3348
|
-
return
|
|
3361
|
+
otherwise(r) {
|
|
3362
|
+
return n = r, this;
|
|
3349
3363
|
},
|
|
3350
3364
|
done() {
|
|
3351
|
-
for (let
|
|
3352
|
-
const { condition: i, content: s } = t[
|
|
3365
|
+
for (let r = 0; r < t.length; r++) {
|
|
3366
|
+
const { condition: i, content: s } = t[r];
|
|
3353
3367
|
if (i(e))
|
|
3354
|
-
return
|
|
3368
|
+
return j(s, `switch-case-${r}`);
|
|
3355
3369
|
}
|
|
3356
|
-
return
|
|
3370
|
+
return j(n || [], "switch-otherwise");
|
|
3357
3371
|
}
|
|
3358
3372
|
};
|
|
3359
3373
|
}
|
|
3360
|
-
class
|
|
3374
|
+
class de extends EventTarget {
|
|
3361
3375
|
handlers = {};
|
|
3362
3376
|
static instance;
|
|
3363
3377
|
eventCounters = /* @__PURE__ */ new Map();
|
|
@@ -3365,21 +3379,21 @@ class ue extends EventTarget {
|
|
|
3365
3379
|
* Returns the singleton instance of GlobalEventBus
|
|
3366
3380
|
*/
|
|
3367
3381
|
static getInstance() {
|
|
3368
|
-
return
|
|
3382
|
+
return de.instance || (de.instance = new de()), de.instance;
|
|
3369
3383
|
}
|
|
3370
3384
|
/**
|
|
3371
3385
|
* Emit a global event with optional data. Includes event storm protection.
|
|
3372
3386
|
* @param eventName - Name of the event
|
|
3373
3387
|
* @param data - Optional event payload
|
|
3374
3388
|
*/
|
|
3375
|
-
emit(t,
|
|
3376
|
-
const
|
|
3377
|
-
if (!i ||
|
|
3378
|
-
this.eventCounters.set(t, { count: 1, window:
|
|
3389
|
+
emit(t, n) {
|
|
3390
|
+
const r = Date.now(), i = this.eventCounters.get(t);
|
|
3391
|
+
if (!i || r - i.window > 1e3)
|
|
3392
|
+
this.eventCounters.set(t, { count: 1, window: r });
|
|
3379
3393
|
else if (i.count++, i.count > 50 && i.count > 100)
|
|
3380
3394
|
return;
|
|
3381
3395
|
this.dispatchEvent(new CustomEvent(t, {
|
|
3382
|
-
detail:
|
|
3396
|
+
detail: n,
|
|
3383
3397
|
bubbles: !1,
|
|
3384
3398
|
// Global events don't need to bubble
|
|
3385
3399
|
cancelable: !0
|
|
@@ -3387,9 +3401,9 @@ class ue extends EventTarget {
|
|
|
3387
3401
|
const s = this.handlers[t];
|
|
3388
3402
|
s && s.forEach((o) => {
|
|
3389
3403
|
try {
|
|
3390
|
-
o(
|
|
3404
|
+
o(n);
|
|
3391
3405
|
} catch (a) {
|
|
3392
|
-
|
|
3406
|
+
se(`Error in global event handler for "${t}":`, a);
|
|
3393
3407
|
}
|
|
3394
3408
|
});
|
|
3395
3409
|
}
|
|
@@ -3398,17 +3412,17 @@ class ue extends EventTarget {
|
|
|
3398
3412
|
* @param eventName - Name of the event
|
|
3399
3413
|
* @param handler - Handler function
|
|
3400
3414
|
*/
|
|
3401
|
-
on(t,
|
|
3402
|
-
return this.handlers[t] || (this.handlers[t] = /* @__PURE__ */ new Set()), this.handlers[t].add(
|
|
3415
|
+
on(t, n) {
|
|
3416
|
+
return this.handlers[t] || (this.handlers[t] = /* @__PURE__ */ new Set()), this.handlers[t].add(n), () => this.off(t, n);
|
|
3403
3417
|
}
|
|
3404
3418
|
/**
|
|
3405
3419
|
* Remove a specific handler for a global event.
|
|
3406
3420
|
* @param eventName - Name of the event
|
|
3407
3421
|
* @param handler - Handler function to remove
|
|
3408
3422
|
*/
|
|
3409
|
-
off(t,
|
|
3410
|
-
const
|
|
3411
|
-
|
|
3423
|
+
off(t, n) {
|
|
3424
|
+
const r = this.handlers[t];
|
|
3425
|
+
r && r.delete(n);
|
|
3412
3426
|
}
|
|
3413
3427
|
/**
|
|
3414
3428
|
* Remove all handlers for a specific event.
|
|
@@ -3423,18 +3437,18 @@ class ue extends EventTarget {
|
|
|
3423
3437
|
* @param handler - CustomEvent handler
|
|
3424
3438
|
* @param options - AddEventListener options
|
|
3425
3439
|
*/
|
|
3426
|
-
listen(t,
|
|
3427
|
-
return this.addEventListener(t,
|
|
3440
|
+
listen(t, n, r) {
|
|
3441
|
+
return this.addEventListener(t, n, r), () => this.removeEventListener(t, n);
|
|
3428
3442
|
}
|
|
3429
3443
|
/**
|
|
3430
3444
|
* Register a one-time event handler. Returns a promise that resolves with the event data.
|
|
3431
3445
|
* @param eventName - Name of the event
|
|
3432
3446
|
* @param handler - Handler function
|
|
3433
3447
|
*/
|
|
3434
|
-
once(t,
|
|
3435
|
-
return new Promise((
|
|
3448
|
+
once(t, n) {
|
|
3449
|
+
return new Promise((r) => {
|
|
3436
3450
|
const i = this.on(t, (s) => {
|
|
3437
|
-
i(),
|
|
3451
|
+
i(), n(s), r(s);
|
|
3438
3452
|
});
|
|
3439
3453
|
});
|
|
3440
3454
|
}
|
|
@@ -3464,10 +3478,10 @@ class ue extends EventTarget {
|
|
|
3464
3478
|
*/
|
|
3465
3479
|
getEventStats() {
|
|
3466
3480
|
const t = {};
|
|
3467
|
-
for (const [
|
|
3468
|
-
t[
|
|
3469
|
-
count:
|
|
3470
|
-
handlersCount: this.getHandlerCount(
|
|
3481
|
+
for (const [n, r] of this.eventCounters.entries())
|
|
3482
|
+
t[n] = {
|
|
3483
|
+
count: r.count,
|
|
3484
|
+
handlersCount: this.getHandlerCount(n)
|
|
3471
3485
|
};
|
|
3472
3486
|
return t;
|
|
3473
3487
|
}
|
|
@@ -3478,12 +3492,12 @@ class ue extends EventTarget {
|
|
|
3478
3492
|
this.eventCounters.clear();
|
|
3479
3493
|
}
|
|
3480
3494
|
}
|
|
3481
|
-
const
|
|
3482
|
-
function
|
|
3495
|
+
const be = de.getInstance(), Pn = (e, t) => be.emit(e, t), Ln = (e, t) => be.on(e, t), Mn = (e, t) => be.off(e, t), jn = (e, t) => be.once(e, t), Nn = (e, t, n) => be.listen(e, t, n);
|
|
3496
|
+
function tt(e) {
|
|
3483
3497
|
let t = { ...e };
|
|
3484
|
-
const
|
|
3485
|
-
function
|
|
3486
|
-
|
|
3498
|
+
const n = [];
|
|
3499
|
+
function r(a) {
|
|
3500
|
+
n.push(a), a(t);
|
|
3487
3501
|
}
|
|
3488
3502
|
function i() {
|
|
3489
3503
|
return t;
|
|
@@ -3493,143 +3507,143 @@ function Qe(e) {
|
|
|
3493
3507
|
t = { ...t, ...u }, o();
|
|
3494
3508
|
}
|
|
3495
3509
|
function o() {
|
|
3496
|
-
|
|
3510
|
+
n.forEach((a) => a(t));
|
|
3497
3511
|
}
|
|
3498
|
-
return { subscribe:
|
|
3512
|
+
return { subscribe: r, getState: i, setState: s };
|
|
3499
3513
|
}
|
|
3500
|
-
const
|
|
3501
|
-
for (const
|
|
3502
|
-
const
|
|
3514
|
+
const nt = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, Q = (e, t) => {
|
|
3515
|
+
for (const n of e) {
|
|
3516
|
+
const r = [], i = n.path.replace(/:[^/]+/g, (a) => (r.push(a.slice(1)), "([^/]+)")), s = new RegExp(`^${i}$`), o = t.match(s);
|
|
3503
3517
|
if (o) {
|
|
3504
3518
|
const a = {};
|
|
3505
|
-
return
|
|
3506
|
-
a[u] = o[
|
|
3507
|
-
}), { route:
|
|
3519
|
+
return r.forEach((u, y) => {
|
|
3520
|
+
a[u] = o[y + 1];
|
|
3521
|
+
}), { route: n, params: a };
|
|
3508
3522
|
}
|
|
3509
3523
|
}
|
|
3510
3524
|
return { route: null, params: {} };
|
|
3511
|
-
},
|
|
3512
|
-
async function
|
|
3525
|
+
}, Ie = {};
|
|
3526
|
+
async function ln(e) {
|
|
3513
3527
|
if (e.component) return e.component;
|
|
3514
3528
|
if (e.load) {
|
|
3515
|
-
if (
|
|
3529
|
+
if (Ie[e.path]) return Ie[e.path];
|
|
3516
3530
|
try {
|
|
3517
3531
|
const t = await e.load();
|
|
3518
|
-
return
|
|
3532
|
+
return Ie[e.path] = t.default, t.default;
|
|
3519
3533
|
} catch {
|
|
3520
3534
|
throw new Error(`Failed to load component for route: ${e.path}`);
|
|
3521
3535
|
}
|
|
3522
3536
|
}
|
|
3523
3537
|
throw new Error(`No component or loader defined for route: ${e.path}`);
|
|
3524
3538
|
}
|
|
3525
|
-
function
|
|
3526
|
-
const { routes: t, base:
|
|
3527
|
-
let i, s, o, a, u,
|
|
3528
|
-
const
|
|
3529
|
-
const c = t.find((p) => Q([p],
|
|
3539
|
+
function un(e) {
|
|
3540
|
+
const { routes: t, base: n = "", initialUrl: r } = e;
|
|
3541
|
+
let i, s, o, a, u, y, g;
|
|
3542
|
+
const b = async (x, w) => {
|
|
3543
|
+
const c = t.find((p) => Q([p], x.path).route !== null);
|
|
3530
3544
|
if (c?.beforeEnter)
|
|
3531
3545
|
try {
|
|
3532
|
-
const p = await c.beforeEnter(
|
|
3546
|
+
const p = await c.beforeEnter(x, w);
|
|
3533
3547
|
return typeof p == "string" ? (await d(p, !0), !1) : p !== !1;
|
|
3534
3548
|
} catch (p) {
|
|
3535
|
-
return
|
|
3549
|
+
return se("beforeEnter error", p), !1;
|
|
3536
3550
|
}
|
|
3537
3551
|
return !0;
|
|
3538
|
-
}, h = async (
|
|
3539
|
-
const c = t.find((p) => Q([p],
|
|
3552
|
+
}, h = async (x, w) => {
|
|
3553
|
+
const c = t.find((p) => Q([p], x.path).route !== null);
|
|
3540
3554
|
if (c?.onEnter)
|
|
3541
3555
|
try {
|
|
3542
|
-
const p = await c.onEnter(
|
|
3556
|
+
const p = await c.onEnter(x, w);
|
|
3543
3557
|
return typeof p == "string" ? (await d(p, !0), !1) : p !== !1;
|
|
3544
3558
|
} catch (p) {
|
|
3545
|
-
return
|
|
3559
|
+
return se("onEnter error", p), !1;
|
|
3546
3560
|
}
|
|
3547
3561
|
return !0;
|
|
3548
|
-
}, l = (
|
|
3549
|
-
const c = t.find((p) => Q([p],
|
|
3562
|
+
}, l = (x, w) => {
|
|
3563
|
+
const c = t.find((p) => Q([p], x.path).route !== null);
|
|
3550
3564
|
if (c?.afterEnter)
|
|
3551
3565
|
try {
|
|
3552
|
-
c.afterEnter(
|
|
3566
|
+
c.afterEnter(x, w);
|
|
3553
3567
|
} catch (p) {
|
|
3554
|
-
|
|
3568
|
+
se("afterEnter error", p);
|
|
3555
3569
|
}
|
|
3556
|
-
}, d = async (
|
|
3570
|
+
}, d = async (x, w = !1) => {
|
|
3557
3571
|
try {
|
|
3558
3572
|
const c = {
|
|
3559
|
-
path:
|
|
3573
|
+
path: x.replace(n, "") || "/",
|
|
3560
3574
|
query: {}
|
|
3561
3575
|
}, p = Q(t, c.path);
|
|
3562
3576
|
if (!p) throw new Error(`No route found for ${c.path}`);
|
|
3563
|
-
const
|
|
3577
|
+
const m = o.getState(), C = {
|
|
3564
3578
|
path: c.path,
|
|
3565
3579
|
params: p.params,
|
|
3566
3580
|
query: c.query
|
|
3567
3581
|
};
|
|
3568
|
-
if (!await
|
|
3569
|
-
typeof window < "u" && typeof document < "u" && (
|
|
3582
|
+
if (!await b(C, m) || !await h(C, m)) return;
|
|
3583
|
+
typeof window < "u" && typeof document < "u" && (w ? window.history.replaceState({}, "", n + x) : window.history.pushState({}, "", n + x)), o.setState(C), l(C, m);
|
|
3570
3584
|
} catch (c) {
|
|
3571
|
-
|
|
3585
|
+
se("Navigation error:", c);
|
|
3572
3586
|
}
|
|
3573
3587
|
};
|
|
3574
|
-
if (typeof window < "u" && typeof document < "u" && typeof
|
|
3588
|
+
if (typeof window < "u" && typeof document < "u" && typeof r > "u") {
|
|
3575
3589
|
i = () => {
|
|
3576
|
-
const
|
|
3590
|
+
const w = new URL(window.location.href), c = w.pathname.replace(n, "") || "/", p = nt(w.search);
|
|
3577
3591
|
return { path: c, query: p };
|
|
3578
3592
|
}, s = i();
|
|
3579
|
-
const
|
|
3580
|
-
o =
|
|
3593
|
+
const x = Q(t, s.path);
|
|
3594
|
+
o = tt({
|
|
3581
3595
|
path: s.path,
|
|
3582
|
-
params:
|
|
3596
|
+
params: x.params,
|
|
3583
3597
|
query: s.query
|
|
3584
|
-
}), a = async (
|
|
3598
|
+
}), a = async (w = !1) => {
|
|
3585
3599
|
const c = i();
|
|
3586
|
-
await d(c.path,
|
|
3587
|
-
}, window.addEventListener("popstate", () => a(!0)), u = (
|
|
3600
|
+
await d(c.path, w);
|
|
3601
|
+
}, window.addEventListener("popstate", () => a(!0)), u = (w) => d(w, !1), y = (w) => d(w, !0), g = () => window.history.back();
|
|
3588
3602
|
} else {
|
|
3589
3603
|
i = () => {
|
|
3590
|
-
const c = new URL(
|
|
3591
|
-
return { path: p, query:
|
|
3604
|
+
const c = new URL(r || "/", "http://localhost"), p = c.pathname.replace(n, "") || "/", m = nt(c.search);
|
|
3605
|
+
return { path: p, query: m };
|
|
3592
3606
|
}, s = i();
|
|
3593
|
-
const
|
|
3594
|
-
o =
|
|
3607
|
+
const x = Q(t, s.path);
|
|
3608
|
+
o = tt({
|
|
3595
3609
|
path: s.path,
|
|
3596
|
-
params:
|
|
3610
|
+
params: x.params,
|
|
3597
3611
|
query: s.query
|
|
3598
3612
|
}), a = async () => {
|
|
3599
3613
|
const c = i();
|
|
3600
|
-
await
|
|
3614
|
+
await w(c.path);
|
|
3601
3615
|
};
|
|
3602
|
-
const
|
|
3616
|
+
const w = async (c) => {
|
|
3603
3617
|
try {
|
|
3604
3618
|
const p = {
|
|
3605
|
-
path: c.replace(
|
|
3619
|
+
path: c.replace(n, "") || "/",
|
|
3606
3620
|
query: {}
|
|
3607
|
-
},
|
|
3608
|
-
if (!
|
|
3621
|
+
}, m = Q(t, p.path);
|
|
3622
|
+
if (!m) throw new Error(`No route found for ${p.path}`);
|
|
3609
3623
|
const C = o.getState(), k = {
|
|
3610
3624
|
path: p.path,
|
|
3611
|
-
params:
|
|
3625
|
+
params: m.params,
|
|
3612
3626
|
query: p.query
|
|
3613
|
-
}, f = t.find((
|
|
3627
|
+
}, f = t.find((v) => Q([v], k.path).route !== null);
|
|
3614
3628
|
if (f?.beforeEnter)
|
|
3615
3629
|
try {
|
|
3616
|
-
const
|
|
3617
|
-
if (typeof
|
|
3618
|
-
await
|
|
3630
|
+
const v = await f.beforeEnter(k, C);
|
|
3631
|
+
if (typeof v == "string") {
|
|
3632
|
+
await w(v);
|
|
3619
3633
|
return;
|
|
3620
3634
|
}
|
|
3621
|
-
if (
|
|
3635
|
+
if (v === !1) return;
|
|
3622
3636
|
} catch {
|
|
3623
3637
|
return;
|
|
3624
3638
|
}
|
|
3625
3639
|
if (f?.onEnter)
|
|
3626
3640
|
try {
|
|
3627
|
-
const
|
|
3628
|
-
if (typeof
|
|
3629
|
-
await
|
|
3641
|
+
const v = await f.onEnter(k, C);
|
|
3642
|
+
if (typeof v == "string") {
|
|
3643
|
+
await w(v);
|
|
3630
3644
|
return;
|
|
3631
3645
|
}
|
|
3632
|
-
if (
|
|
3646
|
+
if (v === !1) return;
|
|
3633
3647
|
} catch {
|
|
3634
3648
|
return;
|
|
3635
3649
|
}
|
|
@@ -3641,85 +3655,85 @@ function sr(e) {
|
|
|
3641
3655
|
} catch {
|
|
3642
3656
|
}
|
|
3643
3657
|
};
|
|
3644
|
-
u = async (c) =>
|
|
3658
|
+
u = async (c) => w(c), y = async (c) => w(c), g = () => {
|
|
3645
3659
|
};
|
|
3646
3660
|
}
|
|
3647
3661
|
return {
|
|
3648
3662
|
store: o,
|
|
3649
3663
|
push: u,
|
|
3650
|
-
replace:
|
|
3664
|
+
replace: y,
|
|
3651
3665
|
back: g,
|
|
3652
3666
|
subscribe: o.subscribe,
|
|
3653
|
-
matchRoute: (
|
|
3667
|
+
matchRoute: (x) => Q(t, x),
|
|
3654
3668
|
getCurrent: () => o.getState(),
|
|
3655
|
-
resolveRouteComponent:
|
|
3669
|
+
resolveRouteComponent: ln
|
|
3656
3670
|
};
|
|
3657
3671
|
}
|
|
3658
|
-
function
|
|
3672
|
+
function Wn(e, t) {
|
|
3659
3673
|
return Q(e, t);
|
|
3660
3674
|
}
|
|
3661
|
-
function
|
|
3662
|
-
const t =
|
|
3663
|
-
return
|
|
3664
|
-
const { onConnected: i } =
|
|
3675
|
+
function zn(e) {
|
|
3676
|
+
const t = un(e);
|
|
3677
|
+
return et("router-view", (n = {}, r = {}) => {
|
|
3678
|
+
const { onConnected: i } = r;
|
|
3665
3679
|
if (i && i(() => {
|
|
3666
3680
|
t && typeof t.subscribe == "function" && t.subscribe(() => {
|
|
3667
3681
|
});
|
|
3668
|
-
}), !t) return
|
|
3682
|
+
}), !t) return ce`<div>Router not initialized.</div>`;
|
|
3669
3683
|
const s = t.getCurrent(), { path: o } = s, a = t.matchRoute(o);
|
|
3670
3684
|
return a.route ? t.resolveRouteComponent(a.route).then((u) => {
|
|
3671
3685
|
if (typeof u == "string")
|
|
3672
3686
|
return { tag: u, props: {}, children: [] };
|
|
3673
3687
|
if (typeof u == "function") {
|
|
3674
|
-
const
|
|
3675
|
-
return (
|
|
3688
|
+
const y = u();
|
|
3689
|
+
return (y instanceof Promise ? y : Promise.resolve(y)).then((b) => typeof b == "string" ? { tag: b, props: {}, children: [] } : b);
|
|
3676
3690
|
}
|
|
3677
|
-
return
|
|
3678
|
-
}).catch(() =>
|
|
3679
|
-
}),
|
|
3691
|
+
return ce`<div>Invalid route component</div>`;
|
|
3692
|
+
}).catch(() => ce`<div>Invalid route component</div>`) : ce`<div>Not found</div>`;
|
|
3693
|
+
}), et("router-link", (n = {}, r = {}) => {
|
|
3680
3694
|
const {
|
|
3681
3695
|
to: i = "",
|
|
3682
3696
|
tag: s = "a",
|
|
3683
3697
|
replace: o = !1,
|
|
3684
3698
|
exact: a = !1,
|
|
3685
3699
|
activeClass: u = "active",
|
|
3686
|
-
exactActiveClass:
|
|
3700
|
+
exactActiveClass: y = "exact-active",
|
|
3687
3701
|
ariaCurrentValue: g = "page",
|
|
3688
|
-
disabled:
|
|
3702
|
+
disabled: b = !1,
|
|
3689
3703
|
external: h = !1,
|
|
3690
3704
|
class: l = ""
|
|
3691
|
-
} =
|
|
3692
|
-
for (const _ of p)
|
|
3705
|
+
} = n, 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), m = {};
|
|
3706
|
+
for (const _ of p) m[_] = !0;
|
|
3693
3707
|
const C = {
|
|
3694
|
-
...
|
|
3708
|
+
...m,
|
|
3695
3709
|
// Also include the configurable names (may duplicate the above)
|
|
3696
|
-
[u]:
|
|
3697
|
-
[
|
|
3698
|
-
}, k = s === "button", f =
|
|
3699
|
-
if (
|
|
3710
|
+
[u]: w,
|
|
3711
|
+
[y]: x
|
|
3712
|
+
}, 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 = (_) => {
|
|
3713
|
+
if (b) {
|
|
3700
3714
|
_.preventDefault();
|
|
3701
3715
|
return;
|
|
3702
3716
|
}
|
|
3703
3717
|
h && (s === "a" || !s) || (_.preventDefault(), o ? t.replace(i) : t.push(i));
|
|
3704
3718
|
};
|
|
3705
|
-
return
|
|
3706
|
-
${
|
|
3719
|
+
return ce`
|
|
3720
|
+
${on().when(k, ce`
|
|
3707
3721
|
<button
|
|
3708
3722
|
part="button"
|
|
3709
3723
|
:class="${C}"
|
|
3710
3724
|
${c}
|
|
3711
3725
|
${f}
|
|
3712
|
-
${
|
|
3726
|
+
${v}
|
|
3713
3727
|
@click="${A}"
|
|
3714
3728
|
><slot></slot></button>
|
|
3715
|
-
`).otherwise(
|
|
3729
|
+
`).otherwise(ce`
|
|
3716
3730
|
<a
|
|
3717
3731
|
part="link"
|
|
3718
3732
|
href="${i}"
|
|
3719
3733
|
:class="${C}"
|
|
3720
3734
|
${c}
|
|
3721
3735
|
${f}
|
|
3722
|
-
${
|
|
3736
|
+
${v}
|
|
3723
3737
|
@click="${A}"
|
|
3724
3738
|
><slot></slot></a>
|
|
3725
3739
|
`).done()}
|
|
@@ -3727,51 +3741,51 @@ function Lr(e) {
|
|
|
3727
3741
|
}), t;
|
|
3728
3742
|
}
|
|
3729
3743
|
export {
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3744
|
+
de as GlobalEventBus,
|
|
3745
|
+
j as anchorBlock,
|
|
3746
|
+
et as component,
|
|
3747
|
+
dn as computed,
|
|
3748
|
+
tt as createStore,
|
|
3749
|
+
Pt as css,
|
|
3750
|
+
xn as each,
|
|
3751
|
+
$n as eachGroup,
|
|
3752
|
+
Sn as eachPage,
|
|
3753
|
+
_n as eachWhere,
|
|
3754
|
+
Pn as emit,
|
|
3755
|
+
be as eventBus,
|
|
3756
|
+
ce as html,
|
|
3757
|
+
zn as initRouter,
|
|
3758
|
+
Nn as listen,
|
|
3759
|
+
on as match,
|
|
3746
3760
|
Q as matchRoute,
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3761
|
+
Wn as matchRouteSSR,
|
|
3762
|
+
te as mediaVariants,
|
|
3763
|
+
Mn as off,
|
|
3764
|
+
Ln as on,
|
|
3765
|
+
jn as once,
|
|
3766
|
+
nt as parseQuery,
|
|
3767
|
+
fn as ref,
|
|
3768
|
+
Pe as renderToString,
|
|
3769
|
+
ln as resolveRouteComponent,
|
|
3770
|
+
cn as responsive,
|
|
3771
|
+
lt as responsiveOrder,
|
|
3772
|
+
Rn as responsiveSwitch,
|
|
3773
|
+
On as switchOn,
|
|
3774
|
+
En as switchOnLength,
|
|
3775
|
+
An as switchOnPromise,
|
|
3776
|
+
vn as unless,
|
|
3777
|
+
hn as useEmit,
|
|
3778
|
+
mn as useOnAttributeChanged,
|
|
3779
|
+
gn as useOnConnected,
|
|
3780
|
+
yn as useOnDisconnected,
|
|
3781
|
+
bn as useOnError,
|
|
3782
|
+
un as useRouter,
|
|
3783
|
+
wn as useStyle,
|
|
3784
|
+
pn as watch,
|
|
3785
|
+
Re as when,
|
|
3786
|
+
kn as whenEmpty,
|
|
3773
3787
|
q as whenMedia,
|
|
3774
|
-
|
|
3775
|
-
|
|
3788
|
+
Cn as whenNotEmpty,
|
|
3789
|
+
Tn as whenVariants
|
|
3776
3790
|
};
|
|
3777
3791
|
//# sourceMappingURL=custom-elements-runtime.es.js.map
|