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