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