@jasonshimmy/custom-elements-runtime 0.2.4 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-elements-runtime.cjs.js +13 -13
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +929 -925
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +13 -13
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
function
|
|
1
|
+
function xt(e, t) {
|
|
2
2
|
return fe(e ? t : [], "when-block");
|
|
3
3
|
}
|
|
4
|
-
function
|
|
5
|
-
return e.map((r,
|
|
6
|
-
const n = typeof r == "object" ? r?.key ?? r?.id ?? `idx-${
|
|
7
|
-
return fe(t(r,
|
|
4
|
+
function kt(e, t) {
|
|
5
|
+
return e.map((r, i) => {
|
|
6
|
+
const n = typeof r == "object" ? r?.key ?? r?.id ?? `idx-${i}` : String(r);
|
|
7
|
+
return fe(t(r, i), `each-${n}`);
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function Pe() {
|
|
11
11
|
const e = [];
|
|
12
12
|
return {
|
|
13
13
|
when(t, r) {
|
|
@@ -17,14 +17,14 @@ function Oe() {
|
|
|
17
17
|
return e.push([!0, t]), this;
|
|
18
18
|
},
|
|
19
19
|
done() {
|
|
20
|
-
return
|
|
20
|
+
return Ne(...e);
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function Ne(...e) {
|
|
25
25
|
for (let t = 0; t < e.length; t++) {
|
|
26
|
-
const [r,
|
|
27
|
-
if (r) return [fe(
|
|
26
|
+
const [r, i] = e[t];
|
|
27
|
+
if (r) return [fe(i, `whenChain-branch-${t}`)];
|
|
28
28
|
}
|
|
29
29
|
return [fe([], "whenChain-empty")];
|
|
30
30
|
}
|
|
@@ -52,9 +52,9 @@ class G extends EventTarget {
|
|
|
52
52
|
* @param data - Optional event payload
|
|
53
53
|
*/
|
|
54
54
|
emit(t, r) {
|
|
55
|
-
const
|
|
56
|
-
if (!n ||
|
|
57
|
-
this.eventCounters.set(t, { count: 1, window:
|
|
55
|
+
const i = Date.now(), n = this.eventCounters.get(t);
|
|
56
|
+
if (!n || i - n.window > 1e3)
|
|
57
|
+
this.eventCounters.set(t, { count: 1, window: i });
|
|
58
58
|
else if (n.count++, n.count > 50 && n.count > 100)
|
|
59
59
|
return;
|
|
60
60
|
this.dispatchEvent(new CustomEvent(t, {
|
|
@@ -63,10 +63,10 @@ class G extends EventTarget {
|
|
|
63
63
|
// Global events don't need to bubble
|
|
64
64
|
cancelable: !0
|
|
65
65
|
}));
|
|
66
|
-
const
|
|
67
|
-
|
|
66
|
+
const s = this.handlers[t];
|
|
67
|
+
s && s.forEach((o) => {
|
|
68
68
|
try {
|
|
69
|
-
|
|
69
|
+
o(r);
|
|
70
70
|
} catch (a) {
|
|
71
71
|
console.error(`Error in global event handler for "${t}":`, a);
|
|
72
72
|
}
|
|
@@ -86,8 +86,8 @@ class G extends EventTarget {
|
|
|
86
86
|
* @param handler - Handler function to remove
|
|
87
87
|
*/
|
|
88
88
|
off(t, r) {
|
|
89
|
-
const
|
|
90
|
-
|
|
89
|
+
const i = this.handlers[t];
|
|
90
|
+
i && i.delete(r);
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
93
93
|
* Remove all handlers for a specific event.
|
|
@@ -102,8 +102,8 @@ class G extends EventTarget {
|
|
|
102
102
|
* @param handler - CustomEvent handler
|
|
103
103
|
* @param options - AddEventListener options
|
|
104
104
|
*/
|
|
105
|
-
listen(t, r,
|
|
106
|
-
return this.addEventListener(t, r,
|
|
105
|
+
listen(t, r, i) {
|
|
106
|
+
return this.addEventListener(t, r, i), () => this.removeEventListener(t, r);
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
109
|
* Register a one-time event handler. Returns a promise that resolves with the event data.
|
|
@@ -111,9 +111,9 @@ class G extends EventTarget {
|
|
|
111
111
|
* @param handler - Handler function
|
|
112
112
|
*/
|
|
113
113
|
once(t, r) {
|
|
114
|
-
return new Promise((
|
|
115
|
-
const n = this.on(t, (
|
|
116
|
-
n(), r(
|
|
114
|
+
return new Promise((i) => {
|
|
115
|
+
const n = this.on(t, (s) => {
|
|
116
|
+
n(), r(s), i(s);
|
|
117
117
|
});
|
|
118
118
|
});
|
|
119
119
|
}
|
|
@@ -143,9 +143,9 @@ class G extends EventTarget {
|
|
|
143
143
|
*/
|
|
144
144
|
getEventStats() {
|
|
145
145
|
const t = {};
|
|
146
|
-
for (const [r,
|
|
146
|
+
for (const [r, i] of this.eventCounters.entries())
|
|
147
147
|
t[r] = {
|
|
148
|
-
count:
|
|
148
|
+
count: i.count,
|
|
149
149
|
handlersCount: this.getHandlerCount(r)
|
|
150
150
|
};
|
|
151
151
|
return t;
|
|
@@ -157,24 +157,24 @@ class G extends EventTarget {
|
|
|
157
157
|
this.eventCounters.clear();
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
const re = G.getInstance(),
|
|
160
|
+
const re = G.getInstance(), vt = (e, t) => re.emit(e, t), $t = (e, t) => re.on(e, t), _t = (e, t) => re.off(e, t), St = (e, t) => re.once(e, t), Et = (e, t, r) => re.listen(e, t, r);
|
|
161
161
|
function $e(e) {
|
|
162
162
|
let t = { ...e };
|
|
163
163
|
const r = [];
|
|
164
|
-
function
|
|
164
|
+
function i(a) {
|
|
165
165
|
r.push(a), a(t);
|
|
166
166
|
}
|
|
167
167
|
function n() {
|
|
168
168
|
return t;
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function s(a) {
|
|
171
171
|
const f = typeof a == "function" ? a(t) : a;
|
|
172
|
-
t = { ...t, ...f },
|
|
172
|
+
t = { ...t, ...f }, o();
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function o() {
|
|
175
175
|
r.forEach((a) => a(t));
|
|
176
176
|
}
|
|
177
|
-
return { subscribe:
|
|
177
|
+
return { subscribe: i, getState: n, setState: s };
|
|
178
178
|
}
|
|
179
179
|
function J(e) {
|
|
180
180
|
return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
@@ -191,78 +191,78 @@ function H(e) {
|
|
|
191
191
|
})[t]
|
|
192
192
|
) : e;
|
|
193
193
|
}
|
|
194
|
-
function
|
|
195
|
-
return typeof t == "string" ? t.split(".").reduce((r,
|
|
194
|
+
function z(e, t) {
|
|
195
|
+
return typeof t == "string" ? t.split(".").reduce((r, i) => r?.[i], e) : t;
|
|
196
196
|
}
|
|
197
|
-
function
|
|
198
|
-
const
|
|
197
|
+
function oe(e, t, r) {
|
|
198
|
+
const i = String(t).split("."), n = i.pop();
|
|
199
199
|
if (!n) return;
|
|
200
|
-
const
|
|
201
|
-
|
|
200
|
+
const s = i.reduce((o, a) => (o[a] == null && (o[a] = {}), o[a]), e);
|
|
201
|
+
s[n] = r;
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function ze(e, t, r) {
|
|
204
204
|
if (r)
|
|
205
|
-
for (const [
|
|
206
|
-
let
|
|
207
|
-
if (Array.isArray(n) ? (
|
|
208
|
-
callback:
|
|
209
|
-
options:
|
|
210
|
-
oldValue:
|
|
211
|
-
}),
|
|
205
|
+
for (const [i, n] of Object.entries(r)) {
|
|
206
|
+
let s, o = {};
|
|
207
|
+
if (Array.isArray(n) ? (s = n[0], o = n[1] || {}) : s = n, t.set(i, {
|
|
208
|
+
callback: s,
|
|
209
|
+
options: o,
|
|
210
|
+
oldValue: z(e, i)
|
|
211
|
+
}), o.immediate)
|
|
212
212
|
try {
|
|
213
|
-
const a =
|
|
214
|
-
|
|
213
|
+
const a = z(e, i);
|
|
214
|
+
s(a, void 0, e);
|
|
215
215
|
} catch (a) {
|
|
216
|
-
console.error(`Error in immediate watcher for "${
|
|
216
|
+
console.error(`Error in immediate watcher for "${i}":`, a);
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
function Me(e, t, r,
|
|
221
|
-
const n = (
|
|
222
|
-
if (
|
|
223
|
-
if (typeof
|
|
224
|
-
if (Array.isArray(
|
|
225
|
-
return
|
|
226
|
-
const f = Object.keys(
|
|
227
|
-
return f.length !== u.length ? !1 : f.every((d) => n(
|
|
228
|
-
},
|
|
229
|
-
if (
|
|
220
|
+
function Me(e, t, r, i) {
|
|
221
|
+
const n = (o, a) => {
|
|
222
|
+
if (o === a) return !0;
|
|
223
|
+
if (typeof o != typeof a || typeof o != "object" || o === null || a === null) return !1;
|
|
224
|
+
if (Array.isArray(o) && Array.isArray(a))
|
|
225
|
+
return o.length !== a.length ? !1 : o.every((d, y) => n(d, a[y]));
|
|
226
|
+
const f = Object.keys(o), u = Object.keys(a);
|
|
227
|
+
return f.length !== u.length ? !1 : f.every((d) => n(o[d], a[d]));
|
|
228
|
+
}, s = t.get(r);
|
|
229
|
+
if (s && !n(i, s.oldValue))
|
|
230
230
|
try {
|
|
231
|
-
|
|
232
|
-
} catch (
|
|
233
|
-
console.error(`Error in watcher for "${r}":`,
|
|
231
|
+
s.callback(i, s.oldValue, e), s.oldValue = i;
|
|
232
|
+
} catch (o) {
|
|
233
|
+
console.error(`Error in watcher for "${r}":`, o);
|
|
234
234
|
}
|
|
235
|
-
for (const [
|
|
236
|
-
if (a.options.deep && r.startsWith(
|
|
235
|
+
for (const [o, a] of t.entries())
|
|
236
|
+
if (a.options.deep && r.startsWith(o + "."))
|
|
237
237
|
try {
|
|
238
|
-
const f =
|
|
238
|
+
const f = z(e, o);
|
|
239
239
|
n(f, a.oldValue) || (a.callback(f, a.oldValue, e), a.oldValue = f);
|
|
240
240
|
} catch (f) {
|
|
241
|
-
console.error(`Error in deep watcher for "${
|
|
241
|
+
console.error(`Error in deep watcher for "${o}":`, f);
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
function We(e, t, r) {
|
|
245
245
|
if (!t.props) return;
|
|
246
|
-
function
|
|
247
|
-
return
|
|
246
|
+
function i(n, s) {
|
|
247
|
+
return s === Boolean ? n === "true" : s === Number ? Number(n) : n;
|
|
248
248
|
}
|
|
249
|
-
Object.entries(t.props).forEach(([n,
|
|
250
|
-
if (
|
|
249
|
+
Object.entries(t.props).forEach(([n, s]) => {
|
|
250
|
+
if (s.type === Function && typeof e[n] == "function")
|
|
251
251
|
r[n] = e[n];
|
|
252
252
|
else {
|
|
253
|
-
const
|
|
254
|
-
|
|
253
|
+
const o = e.getAttribute(J(n));
|
|
254
|
+
o !== null ? r[n] = H(i(o, s.type)) : "default" in s && s.default !== void 0 && (r[n] = H(s.default));
|
|
255
255
|
}
|
|
256
256
|
});
|
|
257
257
|
}
|
|
258
|
-
function qe(e, t, r,
|
|
259
|
-
e.onConnected && !r && (e.onConnected(t),
|
|
258
|
+
function qe(e, t, r, i) {
|
|
259
|
+
e.onConnected && !r && (e.onConnected(t), i(!0));
|
|
260
260
|
}
|
|
261
|
-
function De(e, t, r,
|
|
262
|
-
e.onDisconnected && e.onDisconnected(t), r.forEach((f) => f()),
|
|
261
|
+
function De(e, t, r, i, n, s, o, a) {
|
|
262
|
+
e.onDisconnected && e.onDisconnected(t), r.forEach((f) => f()), i(), n(), s(!1), o(null), a(!1);
|
|
263
263
|
}
|
|
264
|
-
function Ie(e, t, r,
|
|
265
|
-
e.onAttributeChanged && e.onAttributeChanged(t, r,
|
|
264
|
+
function Ie(e, t, r, i, n) {
|
|
265
|
+
e.onAttributeChanged && e.onAttributeChanged(t, r, i, n);
|
|
266
266
|
}
|
|
267
267
|
function V(e, t) {
|
|
268
268
|
if (t && e instanceof HTMLElement) {
|
|
@@ -272,96 +272,96 @@ function V(e, t) {
|
|
|
272
272
|
V(r, t);
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
|
-
function He(e, t, r,
|
|
276
|
-
if (!
|
|
277
|
-
const f = t.includes("lazy"), u = t.includes("trim"), d = t.includes("number"),
|
|
275
|
+
function He(e, t, r, i, n, s, o, a) {
|
|
276
|
+
if (!s) return;
|
|
277
|
+
const f = t.includes("lazy"), u = t.includes("trim"), d = t.includes("number"), y = () => z(s._state || s, e), c = y();
|
|
278
278
|
let h = "text";
|
|
279
|
-
|
|
280
|
-
const
|
|
279
|
+
o instanceof HTMLInputElement ? h = i?.type || o.type || "text" : o instanceof HTMLSelectElement ? h = "select" : o instanceof HTMLTextAreaElement && (h = "textarea");
|
|
280
|
+
const k = o instanceof HTMLInputElement || o instanceof HTMLTextAreaElement || o instanceof HTMLSelectElement, w = k ? h === "checkbox" || h === "radio" ? "checked" : "value" : a ?? "modelValue";
|
|
281
281
|
if (h === "checkbox")
|
|
282
|
-
if (Array.isArray(
|
|
283
|
-
r[
|
|
282
|
+
if (Array.isArray(c))
|
|
283
|
+
r[w] = c.includes(String(o?.getAttribute("value") ?? i?.value ?? ""));
|
|
284
284
|
else {
|
|
285
|
-
const x =
|
|
286
|
-
r[
|
|
285
|
+
const x = o?.getAttribute("true-value") ?? !0;
|
|
286
|
+
r[w] = c === x;
|
|
287
287
|
}
|
|
288
288
|
else if (h === "radio")
|
|
289
|
-
r[
|
|
289
|
+
r[w] = c === (i?.value ?? "");
|
|
290
290
|
else if (h === "select")
|
|
291
|
-
if (
|
|
292
|
-
const x = Array.isArray(
|
|
291
|
+
if (o && o.hasAttribute("multiple") && o instanceof HTMLSelectElement) {
|
|
292
|
+
const x = Array.isArray(c) ? c.map(String) : [];
|
|
293
293
|
setTimeout(() => {
|
|
294
|
-
Array.from(
|
|
295
|
-
|
|
294
|
+
Array.from(o.options).forEach((l) => {
|
|
295
|
+
l.selected = x.includes(l.value);
|
|
296
296
|
});
|
|
297
|
-
}, 0), r[
|
|
297
|
+
}, 0), r[w] = Array.isArray(c) ? c : [];
|
|
298
298
|
} else
|
|
299
|
-
r[
|
|
299
|
+
r[w] = c;
|
|
300
300
|
else {
|
|
301
|
-
r[
|
|
301
|
+
r[w] = c;
|
|
302
302
|
try {
|
|
303
|
-
const x = J(
|
|
304
|
-
|
|
303
|
+
const x = J(w);
|
|
304
|
+
i && (i[x] = c);
|
|
305
305
|
} catch {
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
-
const b = f || h === "checkbox" || h === "radio" || h === "select" ? "change" : "input",
|
|
308
|
+
const b = f || h === "checkbox" || h === "radio" || h === "select" ? "change" : "input", m = (x) => {
|
|
309
309
|
if (x.isComposing || n._isComposing || x.isTrusted === !1) return;
|
|
310
|
-
const
|
|
311
|
-
if (!
|
|
312
|
-
let g =
|
|
310
|
+
const l = x.target;
|
|
311
|
+
if (!l || l._modelUpdating) return;
|
|
312
|
+
let g = l.value;
|
|
313
313
|
if (h === "checkbox") {
|
|
314
|
-
const
|
|
315
|
-
if (Array.isArray(
|
|
316
|
-
const S =
|
|
317
|
-
if (
|
|
314
|
+
const E = y();
|
|
315
|
+
if (Array.isArray(E)) {
|
|
316
|
+
const S = l.getAttribute("value") ?? "", A = Array.from(E);
|
|
317
|
+
if (l.checked)
|
|
318
318
|
A.includes(S) || A.push(S);
|
|
319
319
|
else {
|
|
320
|
-
const
|
|
321
|
-
|
|
320
|
+
const j = A.indexOf(S);
|
|
321
|
+
j > -1 && A.splice(j, 1);
|
|
322
322
|
}
|
|
323
323
|
g = A;
|
|
324
324
|
} else {
|
|
325
|
-
const S =
|
|
326
|
-
g =
|
|
325
|
+
const S = l.getAttribute("true-value") ?? !0, A = l.getAttribute("false-value") ?? !1;
|
|
326
|
+
g = l.checked ? S : A;
|
|
327
327
|
}
|
|
328
328
|
} else if (h === "radio")
|
|
329
|
-
g =
|
|
330
|
-
else if (h === "select" &&
|
|
331
|
-
g = Array.from(
|
|
329
|
+
g = l.getAttribute("value") ?? l.value;
|
|
330
|
+
else if (h === "select" && l.multiple)
|
|
331
|
+
g = Array.from(l.selectedOptions).map((E) => E.value);
|
|
332
332
|
else if (u && typeof g == "string" && (g = g.trim()), d) {
|
|
333
|
-
const
|
|
334
|
-
isNaN(
|
|
333
|
+
const E = Number(g);
|
|
334
|
+
isNaN(E) || (g = E);
|
|
335
335
|
}
|
|
336
|
-
const p =
|
|
336
|
+
const p = s._state || s, _ = z(p, e);
|
|
337
337
|
if (Array.isArray(g) && Array.isArray(_) ? JSON.stringify([...g].sort()) !== JSON.stringify([..._].sort()) : g !== _) {
|
|
338
|
-
|
|
338
|
+
l._modelUpdating = !0;
|
|
339
339
|
try {
|
|
340
|
-
|
|
340
|
+
oe(p, e, g), s._requestRender && s._requestRender();
|
|
341
341
|
} finally {
|
|
342
|
-
setTimeout(() =>
|
|
342
|
+
setTimeout(() => l._modelUpdating = !1, 0);
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
};
|
|
346
|
-
|
|
347
|
-
const
|
|
348
|
-
(Array.isArray(g) && Array.isArray(p) ? JSON.stringify([...g].sort()) !== JSON.stringify([...p].sort()) : g !== p) && (
|
|
346
|
+
k ? n[b] = m : n[`update:${J(w)}`] = (x) => {
|
|
347
|
+
const l = s._state || s, g = x.detail !== void 0 ? x.detail : x.target?.value, p = z(l, e);
|
|
348
|
+
(Array.isArray(g) && Array.isArray(p) ? JSON.stringify([...g].sort()) !== JSON.stringify([...p].sort()) : g !== p) && (oe(l, e, g), s._requestRender && s._requestRender());
|
|
349
349
|
}, (h === "text" || h === "textarea") && (n.compositionstart = (() => n._isComposing = !0), n.compositionend = (x) => {
|
|
350
350
|
n._isComposing = !1;
|
|
351
|
-
const
|
|
352
|
-
|
|
353
|
-
const g =
|
|
354
|
-
let
|
|
355
|
-
if (u && (
|
|
356
|
-
const S = Number(
|
|
357
|
-
isNaN(S) || (
|
|
351
|
+
const l = x.target;
|
|
352
|
+
l && setTimeout(() => {
|
|
353
|
+
const g = l.value, p = s._state || s, _ = z(p, e);
|
|
354
|
+
let C = g;
|
|
355
|
+
if (u && (C = C.trim()), d) {
|
|
356
|
+
const S = Number(C);
|
|
357
|
+
isNaN(S) || (C = S);
|
|
358
358
|
}
|
|
359
|
-
if (Array.isArray(
|
|
360
|
-
|
|
359
|
+
if (Array.isArray(C) && Array.isArray(_) ? JSON.stringify([...C].sort()) !== JSON.stringify([..._].sort()) : C !== _) {
|
|
360
|
+
l._modelUpdating = !0;
|
|
361
361
|
try {
|
|
362
|
-
|
|
362
|
+
oe(p, e, C), s._requestRender && s._requestRender();
|
|
363
363
|
} finally {
|
|
364
|
-
setTimeout(() =>
|
|
364
|
+
setTimeout(() => l._modelUpdating = !1, 0);
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
}, 0);
|
|
@@ -371,61 +371,61 @@ function Le(e) {
|
|
|
371
371
|
const t = e.slice(2);
|
|
372
372
|
return t ? t.charAt(0).toLowerCase() + t.slice(1) : "";
|
|
373
373
|
}
|
|
374
|
-
function Fe(e, t, r,
|
|
375
|
-
if (
|
|
374
|
+
function Fe(e, t, r, i) {
|
|
375
|
+
if (i) {
|
|
376
376
|
if (typeof e == "object" && e !== null)
|
|
377
|
-
for (const [n,
|
|
378
|
-
t[n] =
|
|
377
|
+
for (const [n, s] of Object.entries(e))
|
|
378
|
+
t[n] = s;
|
|
379
379
|
else if (typeof e == "string")
|
|
380
380
|
try {
|
|
381
381
|
const n = JSON.parse(e);
|
|
382
382
|
if (typeof n == "object" && n !== null) {
|
|
383
|
-
for (const [
|
|
384
|
-
t[
|
|
383
|
+
for (const [s, o] of Object.entries(n))
|
|
384
|
+
t[s] = o;
|
|
385
385
|
return;
|
|
386
386
|
}
|
|
387
387
|
} catch {
|
|
388
|
-
const n =
|
|
388
|
+
const n = z(i, e);
|
|
389
389
|
r[e] = n;
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
393
|
function Ke(e, t, r) {
|
|
394
394
|
if (!r) return;
|
|
395
|
-
const
|
|
395
|
+
const i = z(r, e), n = t.style || "", s = i ? "" : "none";
|
|
396
396
|
if (n) {
|
|
397
|
-
const
|
|
397
|
+
const o = n.split(";").filter(Boolean), a = o.findIndex(
|
|
398
398
|
(f) => f.trim().startsWith("display:")
|
|
399
399
|
);
|
|
400
|
-
a >= 0 ?
|
|
400
|
+
a >= 0 ? o[a] = `display: ${s}` : o.push(`display: ${s}`), t.style = o.join("; ");
|
|
401
401
|
} else
|
|
402
|
-
t.style = `display: ${
|
|
402
|
+
t.style = `display: ${s}`;
|
|
403
403
|
}
|
|
404
404
|
function Ue(e, t, r) {
|
|
405
405
|
if (!r) return;
|
|
406
|
-
const
|
|
406
|
+
const i = z(r, e);
|
|
407
407
|
let n = [];
|
|
408
|
-
typeof
|
|
409
|
-
const
|
|
410
|
-
|
|
408
|
+
typeof i == "string" ? n = [i] : Array.isArray(i) ? n = i.filter(Boolean) : typeof i == "object" && (n = Object.entries(i).filter(([, a]) => !!a).flatMap(([a]) => a.split(/\s+/).filter(Boolean)));
|
|
409
|
+
const s = t.class || "", o = s ? `${s} ${n.join(" ")}`.trim() : n.join(" ");
|
|
410
|
+
o && (t.class = o);
|
|
411
411
|
}
|
|
412
412
|
function Ve(e, t, r) {
|
|
413
|
-
let
|
|
413
|
+
let i;
|
|
414
414
|
if (typeof e == "string") {
|
|
415
415
|
if (!r) return;
|
|
416
|
-
|
|
416
|
+
i = z(r, e);
|
|
417
417
|
} else
|
|
418
|
-
|
|
418
|
+
i = e;
|
|
419
419
|
let n = "";
|
|
420
|
-
if (typeof
|
|
421
|
-
n =
|
|
422
|
-
else if (
|
|
423
|
-
const
|
|
424
|
-
for (const [a, f] of Object.entries(
|
|
420
|
+
if (typeof i == "string")
|
|
421
|
+
n = i;
|
|
422
|
+
else if (i && typeof i == "object") {
|
|
423
|
+
const o = [];
|
|
424
|
+
for (const [a, f] of Object.entries(i))
|
|
425
425
|
if (f != null && f !== "") {
|
|
426
426
|
const u = a.replace(
|
|
427
427
|
/[A-Z]/g,
|
|
428
|
-
(
|
|
428
|
+
(c) => `-${c.toLowerCase()}`
|
|
429
429
|
), d = [
|
|
430
430
|
"width",
|
|
431
431
|
"height",
|
|
@@ -452,26 +452,26 @@ function Ve(e, t, r) {
|
|
|
452
452
|
"min-height",
|
|
453
453
|
"max-height"
|
|
454
454
|
];
|
|
455
|
-
let
|
|
456
|
-
typeof f == "number" && d.includes(u) && (
|
|
455
|
+
let y = String(f);
|
|
456
|
+
typeof f == "number" && d.includes(u) && (y = `${f}px`), o.push(`${u}: ${y}`);
|
|
457
457
|
}
|
|
458
|
-
n =
|
|
458
|
+
n = o.join("; ") + (o.length > 0 ? ";" : "");
|
|
459
459
|
}
|
|
460
|
-
const
|
|
461
|
-
t.style =
|
|
460
|
+
const s = t.style || "";
|
|
461
|
+
t.style = s + (s && !s.endsWith(";") ? "; " : "") + n;
|
|
462
462
|
}
|
|
463
|
-
function Re(e, t, r,
|
|
464
|
-
const n = {},
|
|
463
|
+
function Re(e, t, r, i) {
|
|
464
|
+
const n = {}, s = { ...i || {} }, o = {};
|
|
465
465
|
for (const [a, f] of Object.entries(e)) {
|
|
466
|
-
const { value: u, modifiers: d, arg:
|
|
466
|
+
const { value: u, modifiers: d, arg: y } = f;
|
|
467
467
|
if (a === "model" || a.startsWith("model:")) {
|
|
468
|
-
const
|
|
468
|
+
const c = a.split(":"), h = c.length > 1 ? c[1] : y;
|
|
469
469
|
He(
|
|
470
470
|
typeof u == "string" ? u : String(u),
|
|
471
471
|
d,
|
|
472
472
|
n,
|
|
473
|
-
i,
|
|
474
473
|
s,
|
|
474
|
+
o,
|
|
475
475
|
t,
|
|
476
476
|
r,
|
|
477
477
|
h
|
|
@@ -480,330 +480,330 @@ function Re(e, t, r, o) {
|
|
|
480
480
|
}
|
|
481
481
|
switch (a) {
|
|
482
482
|
case "bind":
|
|
483
|
-
Fe(u, n,
|
|
483
|
+
Fe(u, n, s, t);
|
|
484
484
|
break;
|
|
485
485
|
case "show":
|
|
486
|
-
Ke(u,
|
|
486
|
+
Ke(u, s, t);
|
|
487
487
|
break;
|
|
488
488
|
case "class":
|
|
489
|
-
Ue(u,
|
|
489
|
+
Ue(u, s, t);
|
|
490
490
|
break;
|
|
491
491
|
case "style":
|
|
492
|
-
Ve(u,
|
|
492
|
+
Ve(u, s, t);
|
|
493
493
|
break;
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
|
-
return { props: n, attrs:
|
|
496
|
+
return { props: n, attrs: s, listeners: o };
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function ve(e, t) {
|
|
499
499
|
if (Array.isArray(e)) {
|
|
500
|
-
const
|
|
501
|
-
return e.map((
|
|
502
|
-
if (!
|
|
503
|
-
let a =
|
|
500
|
+
const s = /* @__PURE__ */ new Set();
|
|
501
|
+
return e.map((o) => {
|
|
502
|
+
if (!o || typeof o != "object") return o;
|
|
503
|
+
let a = o.props?.key ?? o.key;
|
|
504
504
|
if (!a) {
|
|
505
|
-
const
|
|
506
|
-
a =
|
|
505
|
+
const y = o.tag || "node", c = o.props?.attrs?.id ?? o.props?.attrs?.name ?? o.props?.attrs?.["data-key"] ?? "";
|
|
506
|
+
a = c ? `${t}:${y}:${c}` : `${t}:${y}`;
|
|
507
507
|
}
|
|
508
508
|
let f = a, u = 1;
|
|
509
|
-
for (;
|
|
509
|
+
for (; s.has(f); )
|
|
510
510
|
f = `${a}#${u++}`;
|
|
511
|
-
|
|
512
|
-
let d =
|
|
513
|
-
return Array.isArray(d) && (d =
|
|
511
|
+
s.add(f);
|
|
512
|
+
let d = o.children;
|
|
513
|
+
return Array.isArray(d) && (d = ve(d, f)), { ...o, key: f, children: d };
|
|
514
514
|
});
|
|
515
515
|
}
|
|
516
516
|
const r = e;
|
|
517
|
-
let
|
|
518
|
-
return Array.isArray(n) && (n =
|
|
517
|
+
let i = r.props?.key ?? r.key ?? t, n = r.children;
|
|
518
|
+
return Array.isArray(n) && (n = ve(n, i)), { ...r, key: i, children: n };
|
|
519
519
|
}
|
|
520
|
-
function Je(e, t, r,
|
|
521
|
-
const n = r.directives ?? {},
|
|
520
|
+
function Je(e, t, r, i) {
|
|
521
|
+
const n = r.directives ?? {}, s = Re(
|
|
522
522
|
n,
|
|
523
|
-
|
|
523
|
+
i,
|
|
524
524
|
e,
|
|
525
525
|
r.attrs
|
|
526
|
-
),
|
|
526
|
+
), o = {
|
|
527
527
|
...t.props,
|
|
528
528
|
...r.props,
|
|
529
|
-
...
|
|
529
|
+
...s.props
|
|
530
530
|
}, a = {
|
|
531
531
|
...t.attrs,
|
|
532
532
|
...r.attrs,
|
|
533
|
-
...
|
|
534
|
-
}, f = t.props ?? {}, u =
|
|
535
|
-
for (const
|
|
536
|
-
const h = f[
|
|
537
|
-
if (h !==
|
|
538
|
-
if (
|
|
539
|
-
e.value !==
|
|
540
|
-
else if (
|
|
541
|
-
e.checked = !!
|
|
542
|
-
else if (
|
|
543
|
-
const $ = Le(
|
|
544
|
-
typeof h == "function" && e.removeEventListener($, h), e.addEventListener($,
|
|
545
|
-
} else if (
|
|
546
|
-
e.removeAttribute(
|
|
547
|
-
else if ((r?.isCustomElement ?? t?.isCustomElement ?? !1) ||
|
|
533
|
+
...s.attrs
|
|
534
|
+
}, f = t.props ?? {}, u = o;
|
|
535
|
+
for (const c in { ...f, ...u }) {
|
|
536
|
+
const h = f[c], k = u[c];
|
|
537
|
+
if (h !== k) {
|
|
538
|
+
if (c === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement))
|
|
539
|
+
e.value !== k && (e.value = k ?? "");
|
|
540
|
+
else if (c === "checked" && e instanceof HTMLInputElement)
|
|
541
|
+
e.checked = !!k;
|
|
542
|
+
else if (c.startsWith("on") && typeof k == "function") {
|
|
543
|
+
const $ = Le(c);
|
|
544
|
+
typeof h == "function" && e.removeEventListener($, h), e.addEventListener($, k);
|
|
545
|
+
} else if (k == null || k === !1)
|
|
546
|
+
e.removeAttribute(c);
|
|
547
|
+
else if ((r?.isCustomElement ?? t?.isCustomElement ?? !1) || c in e)
|
|
548
548
|
try {
|
|
549
|
-
e[
|
|
549
|
+
e[c] = k;
|
|
550
550
|
} catch {
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
|
-
for (const [
|
|
555
|
-
|
|
554
|
+
for (const [c, h] of Object.entries(
|
|
555
|
+
s.listeners || {}
|
|
556
556
|
))
|
|
557
|
-
e.addEventListener(
|
|
558
|
-
const d = t.attrs ?? {},
|
|
559
|
-
for (const
|
|
560
|
-
const h = d[
|
|
561
|
-
h !==
|
|
557
|
+
e.addEventListener(c, h);
|
|
558
|
+
const d = t.attrs ?? {}, y = a;
|
|
559
|
+
for (const c in { ...d, ...y }) {
|
|
560
|
+
const h = d[c], k = y[c];
|
|
561
|
+
h !== k && (k == null || k === !1 ? e.removeAttribute(c) : e.setAttribute(c, String(k)));
|
|
562
562
|
}
|
|
563
563
|
}
|
|
564
564
|
function M(e, t, r) {
|
|
565
565
|
if (typeof e == "string")
|
|
566
566
|
return document.createTextNode(e);
|
|
567
567
|
if (e.tag === "#text") {
|
|
568
|
-
const
|
|
568
|
+
const y = document.createTextNode(
|
|
569
569
|
typeof e.children == "string" ? e.children : ""
|
|
570
570
|
);
|
|
571
|
-
return e.key != null && (
|
|
571
|
+
return e.key != null && (y.key = e.key), y;
|
|
572
572
|
}
|
|
573
573
|
if (e.tag === "#anchor") {
|
|
574
|
-
const
|
|
575
|
-
|
|
574
|
+
const y = e, c = Array.isArray(y.children) ? y.children : [], h = document.createTextNode(""), k = document.createTextNode("");
|
|
575
|
+
y.key != null && (h.key = `${y.key}:start`, k.key = `${y.key}:end`), y._startNode = h, y._endNode = k;
|
|
576
576
|
const $ = document.createDocumentFragment();
|
|
577
577
|
$.appendChild(h);
|
|
578
|
-
for (const
|
|
579
|
-
const b = M(
|
|
578
|
+
for (const w of c) {
|
|
579
|
+
const b = M(w, t);
|
|
580
580
|
$.appendChild(b);
|
|
581
581
|
}
|
|
582
|
-
return $.appendChild(
|
|
582
|
+
return $.appendChild(k), $;
|
|
583
583
|
}
|
|
584
|
-
const
|
|
585
|
-
e.key != null && (
|
|
586
|
-
const { props: n = {}, attrs:
|
|
584
|
+
const i = document.createElement(e.tag);
|
|
585
|
+
e.key != null && (i.key = e.key);
|
|
586
|
+
const { props: n = {}, attrs: s = {}, directives: o = {} } = e.props ?? {}, a = Re(o, t, i, s), f = {
|
|
587
587
|
...n,
|
|
588
588
|
...a.props
|
|
589
589
|
}, u = {
|
|
590
|
-
...
|
|
590
|
+
...s,
|
|
591
591
|
...a.attrs
|
|
592
592
|
};
|
|
593
|
-
for (const
|
|
594
|
-
const
|
|
595
|
-
typeof
|
|
596
|
-
}
|
|
597
|
-
for (const
|
|
598
|
-
const
|
|
599
|
-
if (!(typeof
|
|
600
|
-
if (
|
|
601
|
-
|
|
602
|
-
else if (
|
|
603
|
-
|
|
604
|
-
else if (
|
|
605
|
-
|
|
593
|
+
for (const y in u) {
|
|
594
|
+
const c = u[y];
|
|
595
|
+
typeof y != "string" || /\[object Object\]/.test(y) || (typeof c == "boolean" ? c && i.setAttribute(y, "") : c != null && i.setAttribute(y, c));
|
|
596
|
+
}
|
|
597
|
+
for (const y in f) {
|
|
598
|
+
const c = f[y];
|
|
599
|
+
if (!(typeof y != "string" || /\[object Object\]/.test(y)))
|
|
600
|
+
if (y === "value" && (i instanceof HTMLInputElement || i instanceof HTMLTextAreaElement || i instanceof HTMLSelectElement))
|
|
601
|
+
i.value = c ?? "";
|
|
602
|
+
else if (y === "checked" && i instanceof HTMLInputElement)
|
|
603
|
+
i.checked = !!c;
|
|
604
|
+
else if (y.startsWith("on") && typeof c == "function")
|
|
605
|
+
i.addEventListener(Le(y), c);
|
|
606
606
|
else {
|
|
607
|
-
if (
|
|
607
|
+
if (y.startsWith("on") && c === void 0)
|
|
608
608
|
continue;
|
|
609
|
-
if (
|
|
610
|
-
|
|
611
|
-
else if ((e.props?.isCustomElement ?? !1) ||
|
|
609
|
+
if (c == null || c === !1)
|
|
610
|
+
i.removeAttribute(y);
|
|
611
|
+
else if ((e.props?.isCustomElement ?? !1) || y in i)
|
|
612
612
|
try {
|
|
613
|
-
|
|
613
|
+
i[y] = c;
|
|
614
614
|
} catch {
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
|
-
for (const [
|
|
618
|
+
for (const [y, c] of Object.entries(
|
|
619
619
|
a.listeners || {}
|
|
620
620
|
))
|
|
621
|
-
|
|
621
|
+
i.addEventListener(y, c);
|
|
622
622
|
const d = e.props?.ref ?? (e.props?.props && e.props.props.ref);
|
|
623
|
-
typeof e != "string" && d && r && (r[d] =
|
|
623
|
+
typeof e != "string" && d && r && (r[d] = i);
|
|
624
624
|
try {
|
|
625
|
-
if (typeof
|
|
625
|
+
if (typeof i._applyProps == "function")
|
|
626
626
|
try {
|
|
627
|
-
|
|
627
|
+
i._applyProps(i._cfg);
|
|
628
628
|
} catch {
|
|
629
629
|
}
|
|
630
|
-
typeof
|
|
630
|
+
typeof i.requestRender == "function" ? i.requestRender() : typeof i._render == "function" && i._render(i._cfg);
|
|
631
631
|
} catch {
|
|
632
632
|
}
|
|
633
633
|
if (Array.isArray(e.children))
|
|
634
|
-
for (const
|
|
635
|
-
|
|
636
|
-
else typeof e.children == "string" && (
|
|
637
|
-
return
|
|
634
|
+
for (const y of e.children)
|
|
635
|
+
i.appendChild(M(y, t, r));
|
|
636
|
+
else typeof e.children == "string" && (i.textContent = e.children);
|
|
637
|
+
return i;
|
|
638
638
|
}
|
|
639
|
-
function Ze(e, t, r,
|
|
639
|
+
function Ze(e, t, r, i, n) {
|
|
640
640
|
if (typeof r == "string") {
|
|
641
641
|
e.textContent !== r && (e.textContent = r);
|
|
642
642
|
return;
|
|
643
643
|
}
|
|
644
644
|
if (!Array.isArray(r)) return;
|
|
645
|
-
const
|
|
646
|
-
for (const h of
|
|
645
|
+
const s = Array.from(e.childNodes), o = Array.isArray(t) ? t : [], a = /* @__PURE__ */ new Map();
|
|
646
|
+
for (const h of o)
|
|
647
647
|
h && h.key != null && a.set(h.key, h);
|
|
648
648
|
const f = /* @__PURE__ */ new Map();
|
|
649
|
-
for (const h of
|
|
650
|
-
const
|
|
651
|
-
|
|
649
|
+
for (const h of s) {
|
|
650
|
+
const k = h.key;
|
|
651
|
+
k != null && f.set(k, h);
|
|
652
652
|
}
|
|
653
653
|
const u = /* @__PURE__ */ new Set();
|
|
654
654
|
let d = e.firstChild;
|
|
655
|
-
function
|
|
655
|
+
function y(h, k) {
|
|
656
656
|
let $ = h;
|
|
657
|
-
for (; $ && (u.add($), $ !==
|
|
657
|
+
for (; $ && (u.add($), $ !== k); )
|
|
658
658
|
$ = $.nextSibling;
|
|
659
659
|
}
|
|
660
|
-
function
|
|
660
|
+
function c(h, k, $, w) {
|
|
661
661
|
const b = [];
|
|
662
|
-
let
|
|
663
|
-
for (;
|
|
664
|
-
b.push(
|
|
662
|
+
let m = h.nextSibling;
|
|
663
|
+
for (; m && m !== k; )
|
|
664
|
+
b.push(m), m = m.nextSibling;
|
|
665
665
|
const x = Array.isArray($) ? $ : [];
|
|
666
|
-
if (
|
|
666
|
+
if (w.some((g) => g && g.key != null) || x.some((g) => g && g.key != null)) {
|
|
667
667
|
const g = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
|
|
668
|
-
for (const
|
|
669
|
-
|
|
670
|
-
for (const
|
|
671
|
-
const S =
|
|
672
|
-
S != null && p.set(S,
|
|
668
|
+
for (const E of x)
|
|
669
|
+
E && E.key != null && g.set(E.key, E);
|
|
670
|
+
for (const E of b) {
|
|
671
|
+
const S = E.key;
|
|
672
|
+
S != null && p.set(S, E);
|
|
673
673
|
}
|
|
674
674
|
const _ = /* @__PURE__ */ new Set();
|
|
675
|
-
let
|
|
676
|
-
for (const
|
|
675
|
+
let C = h.nextSibling;
|
|
676
|
+
for (const E of w) {
|
|
677
677
|
let S;
|
|
678
|
-
if (
|
|
679
|
-
const A = g.get(
|
|
678
|
+
if (E.key != null && p.has(E.key)) {
|
|
679
|
+
const A = g.get(E.key);
|
|
680
680
|
S = ae(
|
|
681
|
-
p.get(
|
|
681
|
+
p.get(E.key),
|
|
682
682
|
A,
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
), _.add(S), S !==
|
|
683
|
+
E,
|
|
684
|
+
i
|
|
685
|
+
), _.add(S), S !== C && e.contains(S) && e.insertBefore(S, C);
|
|
686
686
|
} else
|
|
687
|
-
S = M(
|
|
688
|
-
|
|
687
|
+
S = M(E, i), e.insertBefore(S, C), _.add(S);
|
|
688
|
+
C = S.nextSibling;
|
|
689
689
|
}
|
|
690
|
-
for (const
|
|
691
|
-
!_.has(
|
|
690
|
+
for (const E of b)
|
|
691
|
+
!_.has(E) && e.contains(E) && e.removeChild(E);
|
|
692
692
|
} else {
|
|
693
693
|
const g = Math.min(
|
|
694
694
|
x.length,
|
|
695
|
-
|
|
695
|
+
w.length
|
|
696
696
|
);
|
|
697
697
|
for (let p = 0; p < g; p++) {
|
|
698
|
-
const _ = x[p],
|
|
699
|
-
|
|
698
|
+
const _ = x[p], C = w[p], E = ae(b[p], _, C, i);
|
|
699
|
+
E !== b[p] && (e.insertBefore(E, b[p]), e.removeChild(b[p]));
|
|
700
700
|
}
|
|
701
|
-
for (let p = g; p <
|
|
702
|
-
e.insertBefore(M(
|
|
701
|
+
for (let p = g; p < w.length; p++)
|
|
702
|
+
e.insertBefore(M(w[p], i), k);
|
|
703
703
|
for (let p = g; p < b.length; p++)
|
|
704
704
|
e.removeChild(b[p]);
|
|
705
705
|
}
|
|
706
706
|
}
|
|
707
707
|
for (const h of r) {
|
|
708
|
-
let
|
|
708
|
+
let k;
|
|
709
709
|
if (h.tag === "#anchor") {
|
|
710
|
-
const $ = h.key,
|
|
711
|
-
let
|
|
712
|
-
const
|
|
713
|
-
if (
|
|
714
|
-
e.insertBefore(
|
|
715
|
-
for (const g of
|
|
716
|
-
e.insertBefore(M(g,
|
|
710
|
+
const $ = h.key, w = `${$}:start`, b = `${$}:end`;
|
|
711
|
+
let m = f.get(w), x = f.get(b);
|
|
712
|
+
const l = Array.isArray(h.children) ? h.children : [];
|
|
713
|
+
if (m || (m = document.createTextNode(""), m.key = w), x || (x = document.createTextNode(""), x.key = b), h._startNode = m, h._endNode = x, !e.contains(m) || !e.contains(x)) {
|
|
714
|
+
e.insertBefore(m, d);
|
|
715
|
+
for (const g of l)
|
|
716
|
+
e.insertBefore(M(g, i), d);
|
|
717
717
|
e.insertBefore(x, d);
|
|
718
718
|
} else
|
|
719
|
-
|
|
720
|
-
|
|
719
|
+
c(
|
|
720
|
+
m,
|
|
721
721
|
x,
|
|
722
722
|
a.get($)?.children,
|
|
723
|
-
|
|
723
|
+
l
|
|
724
724
|
);
|
|
725
|
-
m
|
|
725
|
+
y(m, x), d = x.nextSibling;
|
|
726
726
|
continue;
|
|
727
727
|
}
|
|
728
728
|
if (h.key != null && f.has(h.key)) {
|
|
729
729
|
const $ = a.get(h.key);
|
|
730
|
-
|
|
730
|
+
k = ae(
|
|
731
731
|
f.get(h.key),
|
|
732
732
|
$,
|
|
733
733
|
h,
|
|
734
|
-
|
|
734
|
+
i,
|
|
735
735
|
n
|
|
736
|
-
), u.add(
|
|
736
|
+
), u.add(k), k !== d && e.contains(k) && (d && !e.contains(d) && (d = null), e.insertBefore(k, d));
|
|
737
737
|
} else
|
|
738
|
-
|
|
739
|
-
d =
|
|
738
|
+
k = M(h, i, n), d && !e.contains(d) && (d = null), e.insertBefore(k, d), u.add(k);
|
|
739
|
+
d = k.nextSibling;
|
|
740
740
|
}
|
|
741
|
-
for (const h of
|
|
741
|
+
for (const h of s)
|
|
742
742
|
!u.has(h) && e.contains(h) && (V(h, n), e.removeChild(h));
|
|
743
743
|
}
|
|
744
|
-
function ae(e, t, r,
|
|
744
|
+
function ae(e, t, r, i, n) {
|
|
745
745
|
if (t && typeof t != "string" && t.props?.ref && n && V(e, n), t === r) return e;
|
|
746
746
|
if (typeof r == "string") {
|
|
747
747
|
if (e.nodeType === Node.TEXT_NODE)
|
|
748
748
|
return e.textContent !== r && (e.textContent = r), e;
|
|
749
749
|
{
|
|
750
|
-
const
|
|
751
|
-
return e.parentNode?.replaceChild(
|
|
750
|
+
const o = document.createTextNode(r);
|
|
751
|
+
return e.parentNode?.replaceChild(o, e), o;
|
|
752
752
|
}
|
|
753
753
|
}
|
|
754
754
|
if (r && typeof r != "string" && r.tag === "#anchor") {
|
|
755
|
-
const
|
|
756
|
-
|
|
755
|
+
const o = r, a = Array.isArray(o.children) ? o.children : [], f = o._startNode ?? document.createTextNode(""), u = o._endNode ?? document.createTextNode("");
|
|
756
|
+
o.key != null && (f.key = `${o.key}:start`, u.key = `${o.key}:end`), o._startNode = f, o._endNode = u;
|
|
757
757
|
const d = document.createDocumentFragment();
|
|
758
758
|
d.appendChild(f);
|
|
759
|
-
for (const
|
|
760
|
-
const
|
|
761
|
-
d.appendChild(
|
|
759
|
+
for (const y of a) {
|
|
760
|
+
const c = M(y, i);
|
|
761
|
+
d.appendChild(c);
|
|
762
762
|
}
|
|
763
763
|
return d.appendChild(u), e.parentNode?.replaceChild(d, e), f;
|
|
764
764
|
}
|
|
765
765
|
if (!r) {
|
|
766
766
|
V(e, n);
|
|
767
|
-
const
|
|
768
|
-
return e.parentNode?.replaceChild(
|
|
767
|
+
const o = document.createComment("removed");
|
|
768
|
+
return e.parentNode?.replaceChild(o, e), o;
|
|
769
769
|
}
|
|
770
770
|
if (!t || typeof t == "string") {
|
|
771
771
|
V(e, n);
|
|
772
|
-
const
|
|
773
|
-
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] =
|
|
772
|
+
const o = M(r, i, n);
|
|
773
|
+
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = o), e.parentNode?.replaceChild(o, e), o;
|
|
774
774
|
}
|
|
775
775
|
if (r.tag === "#anchor") {
|
|
776
|
-
const
|
|
776
|
+
const o = Array.isArray(r.children) ? r.children : [], a = r._startNode ?? document.createTextNode(""), f = r._endNode ?? document.createTextNode("");
|
|
777
777
|
r.key != null && (a.key = `${r.key}:start`, f.key = `${r.key}:end`), r._startNode = a, r._endNode = f;
|
|
778
778
|
const u = document.createDocumentFragment();
|
|
779
779
|
u.appendChild(a);
|
|
780
|
-
for (const d of
|
|
781
|
-
u.appendChild(M(d,
|
|
780
|
+
for (const d of o)
|
|
781
|
+
u.appendChild(M(d, i));
|
|
782
782
|
return u.appendChild(f), e.parentNode?.replaceChild(u, e), a;
|
|
783
783
|
}
|
|
784
784
|
if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && t.key === r.key) {
|
|
785
|
-
const
|
|
786
|
-
return Je(
|
|
785
|
+
const o = e;
|
|
786
|
+
return Je(o, t.props || {}, r.props || {}, i), Ze(o, t.children, r.children, i, n), typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = o), o;
|
|
787
787
|
}
|
|
788
788
|
V(e, n);
|
|
789
|
-
const
|
|
790
|
-
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] =
|
|
789
|
+
const s = M(r, i, n);
|
|
790
|
+
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = s), e.parentNode?.replaceChild(s, e), s;
|
|
791
791
|
}
|
|
792
|
-
function Ye(e, t, r,
|
|
792
|
+
function Ye(e, t, r, i) {
|
|
793
793
|
let n;
|
|
794
794
|
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 = {
|
|
795
795
|
tag: "div",
|
|
796
796
|
key: "__anchor_root__",
|
|
797
797
|
props: { attrs: { "data-anchor-block-root": "", key: "__anchor_root__" } },
|
|
798
798
|
children: [n]
|
|
799
|
-
}), n =
|
|
800
|
-
const
|
|
799
|
+
}), n = ve(n, String(n.key ?? "root"));
|
|
800
|
+
const s = e._prevVNode ?? null, o = e._prevDom ?? e.firstChild ?? null;
|
|
801
801
|
let a;
|
|
802
|
-
|
|
802
|
+
s && o ? typeof s != "string" && typeof n != "string" && s.tag === n.tag && s.key === n.key ? a = ae(o, s, n, r, i) : (a = M(n, r, i), e.replaceChild(a, o)) : (a = M(n, r, i), e.firstChild ? e.replaceChild(a, e.firstChild) : e.appendChild(a));
|
|
803
803
|
const f = [];
|
|
804
804
|
for (let u = 0; u < e.childNodes.length; u++) {
|
|
805
805
|
const d = e.childNodes[u];
|
|
806
|
-
d !== a && d.nodeName !== "STYLE" && (V(d,
|
|
806
|
+
d !== a && d.nodeName !== "STYLE" && (V(d, i), f.push(d));
|
|
807
807
|
}
|
|
808
808
|
f.forEach((u) => e.removeChild(u)), e._prevVNode = n, e._prevDom = a;
|
|
809
809
|
}
|
|
@@ -814,29 +814,29 @@ function he(e) {
|
|
|
814
814
|
if (e.tag === "#anchor")
|
|
815
815
|
return (Array.isArray(e.children) ? e.children.filter(Boolean) : []).map(he).join("");
|
|
816
816
|
let t = "";
|
|
817
|
-
e.props && e.props.attrs && (t = Object.entries(e.props.attrs).map(([n,
|
|
817
|
+
e.props && e.props.attrs && (t = Object.entries(e.props.attrs).map(([n, s]) => ` ${n}="${H(String(s))}"`).join(""));
|
|
818
818
|
let r = "";
|
|
819
|
-
e.props && (r = Object.entries(e.props).filter(([n]) => n !== "attrs" && n !== "directives" && n !== "ref" && n !== "key").map(([n,
|
|
820
|
-
const
|
|
821
|
-
return `<${e.tag}${t}${r}>${
|
|
819
|
+
e.props && (r = Object.entries(e.props).filter(([n]) => n !== "attrs" && n !== "directives" && n !== "ref" && n !== "key").map(([n, s]) => ` ${n}="${H(String(s))}"`).join(""));
|
|
820
|
+
const i = Array.isArray(e.children) ? e.children.filter(Boolean).map(he).join("") : typeof e.children == "string" ? H(e.children) : e.children ? he(e.children) : "";
|
|
821
|
+
return `<${e.tag}${t}${r}>${i}</${e.tag}>`;
|
|
822
822
|
}
|
|
823
|
-
function
|
|
823
|
+
function Oe(e, ...t) {
|
|
824
824
|
let r = "";
|
|
825
|
-
for (let
|
|
826
|
-
r += e[
|
|
825
|
+
for (let i = 0; i < e.length; i++)
|
|
826
|
+
r += e[i], i < t.length && (r += t[i]);
|
|
827
827
|
return r;
|
|
828
828
|
}
|
|
829
829
|
function Be(e) {
|
|
830
830
|
return e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;}/g, "}").trim();
|
|
831
831
|
}
|
|
832
|
-
let
|
|
832
|
+
let ie = null;
|
|
833
833
|
function _e() {
|
|
834
|
-
return
|
|
834
|
+
return ie || (ie = new CSSStyleSheet(), ie.replaceSync(Be(Qe))), ie;
|
|
835
835
|
}
|
|
836
836
|
function Ge(e) {
|
|
837
837
|
return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi, "").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, "").replace(/expression\s*\([^)]*\)/gi, "");
|
|
838
838
|
}
|
|
839
|
-
const Qe =
|
|
839
|
+
const Qe = Oe`
|
|
840
840
|
:host, *, ::before, ::after {
|
|
841
841
|
all: isolate;
|
|
842
842
|
box-sizing: border-box;
|
|
@@ -879,8 +879,8 @@ const Qe = ze`
|
|
|
879
879
|
::-webkit-input-placeholder, ::placeholder {
|
|
880
880
|
color: inherit; opacity: .5;
|
|
881
881
|
}
|
|
882
|
-
*:focus {
|
|
883
|
-
outline: 2px solid var(--color-
|
|
882
|
+
*:focus-visible {
|
|
883
|
+
outline: 2px solid var(--color-primary-500, #3b82f6);
|
|
884
884
|
outline-offset: 2px;
|
|
885
885
|
}
|
|
886
886
|
ol, ul { list-style: none }
|
|
@@ -895,143 +895,112 @@ const Qe = ze`
|
|
|
895
895
|
[disabled], [aria-disabled=true] { cursor: not-allowed }
|
|
896
896
|
[hidden] { display: none }
|
|
897
897
|
`, Xe = {
|
|
898
|
-
gray: {
|
|
899
|
-
50: "var(--color-gray-50, #f9fafb)",
|
|
900
|
-
100: "var(--color-gray-100, #f3f4f6)",
|
|
901
|
-
200: "var(--color-gray-200, #e5e7eb)",
|
|
902
|
-
300: "var(--color-gray-300, #d1d5db)",
|
|
903
|
-
400: "var(--color-gray-400, #9ca3af)",
|
|
904
|
-
500: "var(--color-gray-500, #6b7280)",
|
|
905
|
-
600: "var(--color-gray-600, #4b5563)",
|
|
906
|
-
700: "var(--color-gray-700, #374151)",
|
|
907
|
-
800: "var(--color-gray-800, #1f2937)",
|
|
908
|
-
900: "var(--color-gray-900, #111827)"
|
|
909
|
-
},
|
|
910
898
|
neutral: {
|
|
911
|
-
50: "
|
|
912
|
-
100: "
|
|
913
|
-
200: "
|
|
914
|
-
300: "
|
|
915
|
-
400: "
|
|
916
|
-
500: "
|
|
917
|
-
600: "
|
|
918
|
-
700: "
|
|
919
|
-
800: "
|
|
920
|
-
900: "
|
|
921
|
-
|
|
922
|
-
slate: {
|
|
923
|
-
50: "var(--color-slate-50, #f8fafc)",
|
|
924
|
-
100: "var(--color-slate-100, #f1f5f9)",
|
|
925
|
-
200: "var(--color-slate-200, #e2e8f0)",
|
|
926
|
-
300: "var(--color-slate-300, #cbd5e1)",
|
|
927
|
-
400: "var(--color-slate-400, #94a3b8)",
|
|
928
|
-
500: "var(--color-slate-500, #64748b)",
|
|
929
|
-
600: "var(--color-slate-600, #475569)",
|
|
930
|
-
700: "var(--color-slate-700, #334155)",
|
|
931
|
-
800: "var(--color-slate-800, #1e293b)",
|
|
932
|
-
900: "var(--color-slate-900, #0f172a)"
|
|
899
|
+
50: "#fafafa",
|
|
900
|
+
100: "#f4f4f5",
|
|
901
|
+
200: "#e4e4e7",
|
|
902
|
+
300: "#d4d4d8",
|
|
903
|
+
400: "#9f9fa9",
|
|
904
|
+
500: "#71717b",
|
|
905
|
+
600: "#52525c",
|
|
906
|
+
700: "#3f3f46",
|
|
907
|
+
800: "#27272a",
|
|
908
|
+
900: "#18181b",
|
|
909
|
+
950: "#09090b"
|
|
933
910
|
},
|
|
934
|
-
|
|
935
|
-
50: "
|
|
936
|
-
100: "
|
|
937
|
-
200: "
|
|
938
|
-
300: "
|
|
939
|
-
400: "
|
|
940
|
-
500: "
|
|
941
|
-
600: "
|
|
942
|
-
700: "
|
|
943
|
-
800: "
|
|
944
|
-
900: "
|
|
911
|
+
primary: {
|
|
912
|
+
50: "#eff6ff",
|
|
913
|
+
100: "#dbeafe",
|
|
914
|
+
200: "#bfdbfe",
|
|
915
|
+
300: "#93c5fd",
|
|
916
|
+
400: "#60a5fa",
|
|
917
|
+
500: "#3b82f6",
|
|
918
|
+
600: "#2563eb",
|
|
919
|
+
700: "#1d4ed8",
|
|
920
|
+
800: "#1e40af",
|
|
921
|
+
900: "#1e3a8a",
|
|
922
|
+
950: "#172554"
|
|
945
923
|
},
|
|
946
|
-
|
|
947
|
-
50: "
|
|
948
|
-
100: "
|
|
949
|
-
200: "
|
|
950
|
-
300: "
|
|
951
|
-
400: "
|
|
952
|
-
500: "
|
|
953
|
-
600: "
|
|
954
|
-
700: "
|
|
955
|
-
800: "
|
|
956
|
-
900: "
|
|
924
|
+
secondary: {
|
|
925
|
+
50: "#eef2ff",
|
|
926
|
+
100: "#e0e7ff",
|
|
927
|
+
200: "#c7d2fe",
|
|
928
|
+
300: "#a5b4fc",
|
|
929
|
+
400: "#818cf8",
|
|
930
|
+
500: "#6366f1",
|
|
931
|
+
600: "#4f46e5",
|
|
932
|
+
700: "#4338ca",
|
|
933
|
+
800: "#3730a3",
|
|
934
|
+
900: "#312e81",
|
|
935
|
+
950: "#1e1b4b"
|
|
957
936
|
},
|
|
958
|
-
|
|
959
|
-
50: "
|
|
960
|
-
100: "
|
|
961
|
-
200: "
|
|
962
|
-
300: "
|
|
963
|
-
400: "
|
|
964
|
-
500: "
|
|
965
|
-
600: "
|
|
966
|
-
700: "
|
|
967
|
-
800: "
|
|
968
|
-
900: "
|
|
937
|
+
success: {
|
|
938
|
+
50: "#f0fdf4",
|
|
939
|
+
100: "#dcfce7",
|
|
940
|
+
200: "#bbf7d0",
|
|
941
|
+
300: "#86efac",
|
|
942
|
+
400: "#4ade80",
|
|
943
|
+
500: "#22c55e",
|
|
944
|
+
600: "#16a34a",
|
|
945
|
+
700: "#15803d",
|
|
946
|
+
800: "#166534",
|
|
947
|
+
900: "#14532d",
|
|
948
|
+
950: "#052e16"
|
|
969
949
|
},
|
|
970
|
-
|
|
971
|
-
50: "
|
|
972
|
-
100: "
|
|
973
|
-
200: "
|
|
974
|
-
300: "
|
|
975
|
-
400: "
|
|
976
|
-
500: "
|
|
977
|
-
600: "
|
|
978
|
-
700: "
|
|
979
|
-
800: "
|
|
980
|
-
900: "
|
|
950
|
+
info: {
|
|
951
|
+
50: "#f0f9ff",
|
|
952
|
+
100: "#e0f2fe",
|
|
953
|
+
200: "#bae6fd",
|
|
954
|
+
300: "#7dd3fc",
|
|
955
|
+
400: "#38bdf8",
|
|
956
|
+
500: "#0ea5e9",
|
|
957
|
+
600: "#0284c7",
|
|
958
|
+
700: "#0369a1",
|
|
959
|
+
800: "#075985",
|
|
960
|
+
900: "#0c4a6e",
|
|
961
|
+
950: "#082f49"
|
|
981
962
|
},
|
|
982
|
-
|
|
983
|
-
50: "
|
|
984
|
-
100: "
|
|
985
|
-
200: "
|
|
986
|
-
300: "
|
|
987
|
-
400: "
|
|
988
|
-
500: "
|
|
989
|
-
600: "
|
|
990
|
-
700: "
|
|
991
|
-
800: "
|
|
992
|
-
900: "
|
|
963
|
+
warning: {
|
|
964
|
+
50: "#fffbeb",
|
|
965
|
+
100: "#fef3c7",
|
|
966
|
+
200: "#fde68a",
|
|
967
|
+
300: "#fcd34d",
|
|
968
|
+
400: "#fbbf24",
|
|
969
|
+
500: "#f59e0b",
|
|
970
|
+
600: "#d97706",
|
|
971
|
+
700: "#b45309",
|
|
972
|
+
800: "#92400e",
|
|
973
|
+
900: "#78350f",
|
|
974
|
+
950: "#451a03"
|
|
993
975
|
},
|
|
994
|
-
|
|
995
|
-
50: "
|
|
996
|
-
100: "
|
|
997
|
-
200: "
|
|
998
|
-
300: "
|
|
999
|
-
400: "
|
|
1000
|
-
500: "
|
|
1001
|
-
600: "
|
|
1002
|
-
700: "
|
|
1003
|
-
800: "
|
|
1004
|
-
900: "
|
|
976
|
+
error: {
|
|
977
|
+
50: "#fef2f2",
|
|
978
|
+
100: "#fee2e2",
|
|
979
|
+
200: "#fecaca",
|
|
980
|
+
300: "#fca5a5",
|
|
981
|
+
400: "#f87171",
|
|
982
|
+
500: "#ef4444",
|
|
983
|
+
600: "#dc2626",
|
|
984
|
+
700: "#b91c1c",
|
|
985
|
+
800: "#991b1b",
|
|
986
|
+
900: "#7f1d1d",
|
|
987
|
+
950: "#450a0a"
|
|
1005
988
|
},
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
200: "var(--color-rose-200, #fecdd3)",
|
|
1022
|
-
300: "var(--color-rose-300, #fda4af)",
|
|
1023
|
-
400: "var(--color-rose-400, #fb7185)",
|
|
1024
|
-
500: "var(--color-rose-500, #f43f5e)",
|
|
1025
|
-
600: "var(--color-rose-600, #e11d48)",
|
|
1026
|
-
700: "var(--color-rose-700, #be123c)",
|
|
1027
|
-
800: "var(--color-rose-800, #9f1239)",
|
|
1028
|
-
900: "var(--color-rose-900, #881337)"
|
|
1029
|
-
},
|
|
1030
|
-
white: { DEFAULT: "var(--color-white, #ffffff)" },
|
|
1031
|
-
black: { DEFAULT: "var(--color-black, #000000)" },
|
|
1032
|
-
transparent: { DEFAULT: "var(--color-transparent, transparent)" },
|
|
1033
|
-
current: { DEFAULT: "var(--color-current, currentColor)" }
|
|
1034
|
-
}, ge = {
|
|
989
|
+
white: { DEFAULT: "#ffffff" },
|
|
990
|
+
black: { DEFAULT: "#000000" },
|
|
991
|
+
transparent: { DEFAULT: "transparent" },
|
|
992
|
+
current: { DEFAULT: "currentColor" }
|
|
993
|
+
}, et = Object.fromEntries(
|
|
994
|
+
Object.entries(Xe).map(([e, t]) => [
|
|
995
|
+
e,
|
|
996
|
+
Object.fromEntries(
|
|
997
|
+
Object.entries(t).map(([r, i]) => [
|
|
998
|
+
r,
|
|
999
|
+
`var(--color-${e}${r === "DEFAULT" ? "" : `-${r}`}, ${i})`
|
|
1000
|
+
])
|
|
1001
|
+
)
|
|
1002
|
+
])
|
|
1003
|
+
), ge = {
|
|
1035
1004
|
/* Display */
|
|
1036
1005
|
block: "display:block;",
|
|
1037
1006
|
inline: "display:inline;",
|
|
@@ -1070,12 +1039,23 @@ const Qe = ze`
|
|
|
1070
1039
|
"grid-cols-4": "grid-template-columns:repeat(4,minmax(0,1fr));",
|
|
1071
1040
|
"grid-cols-5": "grid-template-columns:repeat(5,minmax(0,1fr));",
|
|
1072
1041
|
"grid-cols-6": "grid-template-columns:repeat(6,minmax(0,1fr));",
|
|
1042
|
+
"grid-cols-7": "grid-template-columns:repeat(7,minmax(0,1fr));",
|
|
1043
|
+
"grid-cols-8": "grid-template-columns:repeat(8,minmax(0,1fr));",
|
|
1044
|
+
"grid-cols-9": "grid-template-columns:repeat(9,minmax(0,1fr));",
|
|
1045
|
+
"grid-cols-10": "grid-template-columns:repeat(10,minmax(0,1fr));",
|
|
1046
|
+
"grid-cols-11": "grid-template-columns:repeat(11,minmax(0,1fr));",
|
|
1073
1047
|
"grid-cols-12": "grid-template-columns:repeat(12,minmax(0,1fr));",
|
|
1074
1048
|
"grid-rows-1": "grid-template-rows:repeat(1,minmax(0,1fr));",
|
|
1075
1049
|
"grid-rows-2": "grid-template-rows:repeat(2,minmax(0,1fr));",
|
|
1076
1050
|
"grid-rows-3": "grid-template-rows:repeat(3,minmax(0,1fr));",
|
|
1077
1051
|
"grid-rows-4": "grid-template-rows:repeat(4,minmax(0,1fr));",
|
|
1052
|
+
"grid-rows-5": "grid-template-rows:repeat(5,minmax(0,1fr));",
|
|
1078
1053
|
"grid-rows-6": "grid-template-rows:repeat(6,minmax(0,1fr));",
|
|
1054
|
+
"grid-rows-7": "grid-template-rows:repeat(7,minmax(0,1fr));",
|
|
1055
|
+
"grid-rows-8": "grid-template-rows:repeat(8,minmax(0,1fr));",
|
|
1056
|
+
"grid-rows-9": "grid-template-rows:repeat(9,minmax(0,1fr));",
|
|
1057
|
+
"grid-rows-10": "grid-template-rows:repeat(10,minmax(0,1fr));",
|
|
1058
|
+
"grid-rows-11": "grid-template-rows:repeat(11,minmax(0,1fr));",
|
|
1079
1059
|
"grid-rows-12": "grid-template-rows:repeat(12,minmax(0,1fr));",
|
|
1080
1060
|
/* Grid Placement */
|
|
1081
1061
|
"col-span-1": "grid-column:span 1 / span 1;",
|
|
@@ -1084,12 +1064,22 @@ const Qe = ze`
|
|
|
1084
1064
|
"col-span-4": "grid-column:span 4 / span 4;",
|
|
1085
1065
|
"col-span-5": "grid-column:span 5 / span 5;",
|
|
1086
1066
|
"col-span-6": "grid-column:span 6 / span 6;",
|
|
1067
|
+
"col-span-7": "grid-column:span 7 / span 7;",
|
|
1068
|
+
"col-span-8": "grid-column:span 8 / span 8;",
|
|
1069
|
+
"col-span-9": "grid-column:span 9 / span 9;",
|
|
1070
|
+
"col-span-10": "grid-column:span 10 / span 10;",
|
|
1071
|
+
"col-span-11": "grid-column:span 11 / span 11;",
|
|
1087
1072
|
"col-span-12": "grid-column:span 12 / span 12;",
|
|
1088
1073
|
"row-span-1": "grid-row:span 1 / span 1;",
|
|
1089
1074
|
"row-span-2": "grid-row:span 2 / span 2;",
|
|
1090
1075
|
"row-span-3": "grid-row:span 3 / span 3;",
|
|
1091
1076
|
"row-span-4": "grid-row:span 4 / span 4;",
|
|
1092
1077
|
"row-span-6": "grid-row:span 6 / span 6;",
|
|
1078
|
+
"row-span-7": "grid-row:span 7 / span 7;",
|
|
1079
|
+
"row-span-8": "grid-row:span 8 / span 8;",
|
|
1080
|
+
"row-span-9": "grid-row:span 9 / span 9;",
|
|
1081
|
+
"row-span-10": "grid-row:span 10 / span 10;",
|
|
1082
|
+
"row-span-11": "grid-row:span 11 / span 11;",
|
|
1093
1083
|
"row-span-12": "grid-row:span 12 / span 12;",
|
|
1094
1084
|
/* Positioning */
|
|
1095
1085
|
absolute: "position:absolute;",
|
|
@@ -1128,21 +1118,25 @@ const Qe = ze`
|
|
|
1128
1118
|
"text-8xl": "font-size:6rem;line-height:1",
|
|
1129
1119
|
/* Borders */
|
|
1130
1120
|
border: "border-width:1px;",
|
|
1121
|
+
"border-2": "border-width:2px;",
|
|
1122
|
+
"border-4": "border-width:4px;",
|
|
1123
|
+
"border-6": "border-width:6px;",
|
|
1124
|
+
"border-8": "border-width:8px;",
|
|
1131
1125
|
"rounded-none": "border-radius:0;",
|
|
1132
1126
|
"rounded-xs": "border-radius:0.125rem;",
|
|
1133
|
-
rounded: "border-radius:0.25rem;",
|
|
1134
1127
|
"rounded-sm": "border-radius:0.25rem;",
|
|
1135
1128
|
"rounded-md": "border-radius:0.375rem;",
|
|
1136
1129
|
"rounded-lg": "border-radius:0.5rem;",
|
|
1137
1130
|
"rounded-full": "border-radius:9999px;",
|
|
1138
1131
|
/* Shadow and effects */
|
|
1139
|
-
|
|
1140
|
-
"shadow-
|
|
1141
|
-
"shadow-
|
|
1142
|
-
"shadow-
|
|
1143
|
-
"shadow-
|
|
1144
|
-
"shadow-
|
|
1145
|
-
"shadow-
|
|
1132
|
+
// Shadows use a CSS variable for color so color utilities can modify --ce-shadow-color
|
|
1133
|
+
"shadow-none": "--ce-shadow-color: rgb(0 0 0 / 0);box-shadow:0 0 var(--ce-shadow-color, #0000);",
|
|
1134
|
+
"shadow-xs": "--ce-shadow-color: rgb(0 0 0 / 0.05);box-shadow:0 1px 2px 0 var(--ce-shadow-color, rgb(0 0 0 / 0.05));",
|
|
1135
|
+
"shadow-sm": "--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 1px 3px 0 var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 1px 2px -1px var(--ce-shadow-color, rgb(0 0 0 / 0.1));",
|
|
1136
|
+
"shadow-md": "--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 4px 6px -1px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 2px 4px -2px var(--ce-shadow-color, rgb(0 0 0 / 0.1));",
|
|
1137
|
+
"shadow-lg": "--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 10px 15px -3px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 4px 6px -4px var(--ce-shadow-color, rgb(0 0 0 / 0.1));",
|
|
1138
|
+
"shadow-xl": "--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 20px 25px -5px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 8px 10px -6px var(--ce-shadow-color, rgb(0 0 0 / 0.1));",
|
|
1139
|
+
"shadow-2xl": "--ce-shadow-color: rgb(0 0 0 / 0.25);box-shadow:0 25px 50px -12px var(--ce-shadow-color, rgb(0 0 0 / 0.25));",
|
|
1146
1140
|
/* Text Overflow & Whitespace */
|
|
1147
1141
|
truncate: "overflow:hidden;text-overflow:ellipsis;white-space:nowrap;",
|
|
1148
1142
|
/* Visibility */
|
|
@@ -1201,6 +1195,15 @@ const Qe = ze`
|
|
|
1201
1195
|
"transition-opacity": "transition-property:opacity;",
|
|
1202
1196
|
"transition-transform": "transition-property:transform;",
|
|
1203
1197
|
"transition-none": "transition-property:none;",
|
|
1198
|
+
/* Cursor */
|
|
1199
|
+
"cursor-auto": "cursor:auto;",
|
|
1200
|
+
"cursor-default": "cursor:default;",
|
|
1201
|
+
"cursor-pointer": "cursor:pointer;",
|
|
1202
|
+
"cursor-wait": "cursor:wait;",
|
|
1203
|
+
"cursor-text": "cursor:text;",
|
|
1204
|
+
"cursor-move": "cursor:move;",
|
|
1205
|
+
"cursor-help": "cursor:help;",
|
|
1206
|
+
"cursor-not-allowed": "cursor:not-allowed;",
|
|
1204
1207
|
/* Z-index */
|
|
1205
1208
|
"z-0": "z-index:0;",
|
|
1206
1209
|
"z-10": "z-index:10;",
|
|
@@ -1208,7 +1211,7 @@ const Qe = ze`
|
|
|
1208
1211
|
"z-30": "z-index:30;",
|
|
1209
1212
|
"z-40": "z-index:40;",
|
|
1210
1213
|
"z-50": "z-index:50;"
|
|
1211
|
-
},
|
|
1214
|
+
}, tt = "0.25rem", Se = {
|
|
1212
1215
|
m: ["margin"],
|
|
1213
1216
|
mx: ["margin-inline"],
|
|
1214
1217
|
my: ["margin-block"],
|
|
@@ -1240,34 +1243,34 @@ const Qe = ze`
|
|
|
1240
1243
|
"gap-x": ["column-gap"],
|
|
1241
1244
|
"gap-y": ["row-gap"]
|
|
1242
1245
|
};
|
|
1243
|
-
function
|
|
1244
|
-
let r = 0,
|
|
1246
|
+
function N(e, t) {
|
|
1247
|
+
let r = 0, i = 0;
|
|
1245
1248
|
for (let n = 0; n < e.length; n++) {
|
|
1246
|
-
const
|
|
1247
|
-
if (
|
|
1248
|
-
else if (
|
|
1249
|
-
else if (
|
|
1250
|
-
else if (
|
|
1251
|
-
else if (r === 0 &&
|
|
1249
|
+
const s = e[n];
|
|
1250
|
+
if (s === "[") r++;
|
|
1251
|
+
else if (s === "]" && r > 0) r--;
|
|
1252
|
+
else if (s === "(") i++;
|
|
1253
|
+
else if (s === ")" && i > 0) i--;
|
|
1254
|
+
else if (r === 0 && i === 0 && (s === ">" || s === "+" || s === "~" || s === " "))
|
|
1252
1255
|
return e.slice(0, n) + t + e.slice(n);
|
|
1253
1256
|
}
|
|
1254
1257
|
return e + t;
|
|
1255
1258
|
}
|
|
1256
|
-
const
|
|
1259
|
+
const rt = {
|
|
1257
1260
|
before: (e, t) => `${e}::before{${t}}`,
|
|
1258
1261
|
after: (e, t) => `${e}::after{${t}}`,
|
|
1259
|
-
hover: (e, t) => `${
|
|
1260
|
-
focus: (e, t) => `${
|
|
1261
|
-
active: (e, t) => `${
|
|
1262
|
-
disabled: (e, t) => `${
|
|
1263
|
-
visited: (e, t) => `${
|
|
1264
|
-
checked: (e, t) => `${
|
|
1265
|
-
first: (e, t) => `${
|
|
1266
|
-
last: (e, t) => `${
|
|
1267
|
-
odd: (e, t) => `${
|
|
1268
|
-
even: (e, t) => `${
|
|
1269
|
-
"focus-within": (e, t) => `${
|
|
1270
|
-
"focus-visible": (e, t) => `${
|
|
1262
|
+
hover: (e, t) => `${N(e, ":hover")}{${t}}`,
|
|
1263
|
+
focus: (e, t) => `${N(e, ":focus")}{${t}}`,
|
|
1264
|
+
active: (e, t) => `${N(e, ":active")}{${t}}`,
|
|
1265
|
+
disabled: (e, t) => `${N(e, ":disabled")}{${t}}`,
|
|
1266
|
+
visited: (e, t) => `${N(e, ":visited")}{${t}}`,
|
|
1267
|
+
checked: (e, t) => `${N(e, ":checked")}{${t}}`,
|
|
1268
|
+
first: (e, t) => `${N(e, ":first-child")}{${t}}`,
|
|
1269
|
+
last: (e, t) => `${N(e, ":last-child")}{${t}}`,
|
|
1270
|
+
odd: (e, t) => `${N(e, ":nth-child(odd)")}{${t}}`,
|
|
1271
|
+
even: (e, t) => `${N(e, ":nth-child(even)")}{${t}}`,
|
|
1272
|
+
"focus-within": (e, t) => `${N(e, ":focus-within")}{${t}}`,
|
|
1273
|
+
"focus-visible": (e, t) => `${N(e, ":focus-visible")}{${t}}`,
|
|
1271
1274
|
"group-hover": (e, t) => `.group:hover ${e}{${t}}`,
|
|
1272
1275
|
"group-focus": (e, t) => `.group:focus ${e}{${t}}`,
|
|
1273
1276
|
"group-active": (e, t) => `.group:active ${e}{${t}}`,
|
|
@@ -1276,7 +1279,7 @@ const tt = {
|
|
|
1276
1279
|
"peer-focus": (e, t) => `.peer:focus ~ ${e}{${t}}`,
|
|
1277
1280
|
"peer-checked": (e, t) => `.peer:checked ~ ${e}{${t}}`,
|
|
1278
1281
|
"peer-disabled": (e, t) => `.peer:disabled ~ ${e}{${t}}`
|
|
1279
|
-
},
|
|
1282
|
+
}, me = {
|
|
1280
1283
|
// Responsive
|
|
1281
1284
|
sm: "(min-width:640px)",
|
|
1282
1285
|
md: "(min-width:768px)",
|
|
@@ -1285,61 +1288,62 @@ const tt = {
|
|
|
1285
1288
|
"2xl": "(min-width:1536px)",
|
|
1286
1289
|
// Dark mode (now plain string)
|
|
1287
1290
|
dark: "(prefers-color-scheme: dark)"
|
|
1288
|
-
},
|
|
1291
|
+
}, ye = ["sm", "md", "lg", "xl", "2xl"];
|
|
1289
1292
|
function be(e) {
|
|
1290
|
-
const t = e.startsWith("-"),
|
|
1291
|
-
if (
|
|
1292
|
-
const n =
|
|
1293
|
-
if (Number.isNaN(
|
|
1293
|
+
const t = e.startsWith("-"), i = (t ? e.slice(1) : e).split("-");
|
|
1294
|
+
if (i.length < 2) return null;
|
|
1295
|
+
const n = i.slice(0, -1).join("-"), s = i[i.length - 1], o = parseFloat(s);
|
|
1296
|
+
if (Number.isNaN(o) || !Se[n]) return null;
|
|
1294
1297
|
const a = t ? "-" : "";
|
|
1295
|
-
return Se[n].map((f) => `${f}:calc(${a}${
|
|
1298
|
+
return Se[n].map((f) => `${f}:calc(${a}${tt} * ${o});`).join("");
|
|
1296
1299
|
}
|
|
1297
|
-
function
|
|
1298
|
-
const t = e.replace("#", ""), r = parseInt(t, 16),
|
|
1299
|
-
return `${
|
|
1300
|
+
function Ee(e) {
|
|
1301
|
+
const t = e.replace("#", ""), r = parseInt(t, 16), i = r >> 16 & 255, n = r >> 8 & 255, s = r & 255;
|
|
1302
|
+
return `${i} ${n} ${s}`;
|
|
1300
1303
|
}
|
|
1301
|
-
function
|
|
1304
|
+
function nt(e) {
|
|
1302
1305
|
const t = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
|
|
1303
1306
|
if (!t) return null;
|
|
1304
|
-
const [, r,
|
|
1305
|
-
|
|
1307
|
+
const [, r, i, n = "DEFAULT"] = t, s = et[i]?.[n];
|
|
1308
|
+
if (!s) return null;
|
|
1309
|
+
if (r === "shadow") return `--ce-shadow-color:${s};`;
|
|
1310
|
+
const a = {
|
|
1306
1311
|
bg: "background-color",
|
|
1307
1312
|
decoration: "text-decoration-color",
|
|
1308
1313
|
text: "color",
|
|
1309
1314
|
border: "border-color",
|
|
1310
|
-
shadow: "box-shadow",
|
|
1311
1315
|
outline: "outline-color",
|
|
1312
1316
|
caret: "caret-color",
|
|
1313
1317
|
accent: "accent-color",
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
}
|
|
1318
|
+
fill: "fill",
|
|
1319
|
+
stroke: "stroke"
|
|
1320
|
+
}[r];
|
|
1321
|
+
return a ? `${a}:${s};` : null;
|
|
1318
1322
|
}
|
|
1319
|
-
function
|
|
1323
|
+
function it(e) {
|
|
1320
1324
|
const [t, r] = e.split("/");
|
|
1321
1325
|
if (!r) return { base: t };
|
|
1322
|
-
const
|
|
1323
|
-
return isNaN(
|
|
1326
|
+
const i = parseInt(r, 10);
|
|
1327
|
+
return isNaN(i) || i < 0 || i > 100 ? { base: t } : { base: t, opacity: i / 100 };
|
|
1324
1328
|
}
|
|
1325
|
-
function
|
|
1326
|
-
const { base: t, opacity: r } =
|
|
1327
|
-
if (
|
|
1329
|
+
function we(e) {
|
|
1330
|
+
const { base: t, opacity: r } = it(e), i = nt(t);
|
|
1331
|
+
if (i) {
|
|
1328
1332
|
if (r !== void 0) {
|
|
1329
|
-
const
|
|
1330
|
-
if (
|
|
1331
|
-
const
|
|
1332
|
-
return
|
|
1333
|
+
const s = /#([0-9a-f]{6})/i.exec(i);
|
|
1334
|
+
if (s) {
|
|
1335
|
+
const o = Ee(s[0]);
|
|
1336
|
+
return i.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
|
|
1333
1337
|
}
|
|
1334
1338
|
}
|
|
1335
|
-
return
|
|
1339
|
+
return i;
|
|
1336
1340
|
}
|
|
1337
|
-
const n =
|
|
1341
|
+
const n = ce(t);
|
|
1338
1342
|
if (n && r !== void 0) {
|
|
1339
|
-
const
|
|
1340
|
-
if (
|
|
1341
|
-
const
|
|
1342
|
-
return n.replace(/#([0-9a-f]{6})/i, `rgb(${
|
|
1343
|
+
const s = /#([0-9a-f]{6})/i.exec(n);
|
|
1344
|
+
if (s) {
|
|
1345
|
+
const o = Ee(s[0]);
|
|
1346
|
+
return n.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
|
|
1343
1347
|
}
|
|
1344
1348
|
}
|
|
1345
1349
|
return n;
|
|
@@ -1350,22 +1354,22 @@ function xe(e) {
|
|
|
1350
1354
|
const r = parseInt(t[1], 10);
|
|
1351
1355
|
return r < 0 || r > 100 ? null : `opacity:${r / 100};`;
|
|
1352
1356
|
}
|
|
1353
|
-
function
|
|
1357
|
+
function ce(e) {
|
|
1354
1358
|
if (e.startsWith("[") && e.endsWith("]") && !e.includes("-[")) {
|
|
1355
1359
|
const n = e.slice(1, -1).trim().match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*:(.*)$/);
|
|
1356
1360
|
if (n) {
|
|
1357
|
-
const
|
|
1358
|
-
let
|
|
1359
|
-
return
|
|
1361
|
+
const s = n[1].trim();
|
|
1362
|
+
let o = n[2].trim();
|
|
1363
|
+
return o = o.replace(/url\('\s*([^']*?)\s*'\)/g, 'url("$1")'), o = o.replace(/^'([^']*)'$/g, '"$1"'), `${s}:${o};`;
|
|
1360
1364
|
}
|
|
1361
1365
|
return null;
|
|
1362
1366
|
}
|
|
1363
1367
|
const t = e.indexOf("-["), r = e.endsWith("]");
|
|
1364
1368
|
if (t > 0 && r) {
|
|
1365
|
-
const
|
|
1369
|
+
const i = e.slice(0, t);
|
|
1366
1370
|
let n = e.slice(t + 2, -1);
|
|
1367
1371
|
n = n.replace(/_/g, " ");
|
|
1368
|
-
const
|
|
1372
|
+
const s = {
|
|
1369
1373
|
bg: "background-color",
|
|
1370
1374
|
text: "color",
|
|
1371
1375
|
shadow: "box-shadow",
|
|
@@ -1407,14 +1411,14 @@ function le(e) {
|
|
|
1407
1411
|
leading: "line-height",
|
|
1408
1412
|
z: "z-index"
|
|
1409
1413
|
};
|
|
1410
|
-
if (
|
|
1414
|
+
if (i === "rotate")
|
|
1411
1415
|
return `transform:rotate(${n});`;
|
|
1412
|
-
const
|
|
1413
|
-
if (
|
|
1416
|
+
const o = s[i] ?? i.replace(/_/g, "-");
|
|
1417
|
+
if (o && n) return `${o}:${n};`;
|
|
1414
1418
|
}
|
|
1415
1419
|
return null;
|
|
1416
1420
|
}
|
|
1417
|
-
function
|
|
1421
|
+
function st(e) {
|
|
1418
1422
|
if (e.startsWith("[") && e.endsWith("]")) {
|
|
1419
1423
|
const r = e.slice(1, -1);
|
|
1420
1424
|
return r.includes("&") ? r : e;
|
|
@@ -1426,44 +1430,44 @@ function ot(e) {
|
|
|
1426
1430
|
}
|
|
1427
1431
|
return null;
|
|
1428
1432
|
}
|
|
1429
|
-
function
|
|
1433
|
+
function ot(e) {
|
|
1430
1434
|
return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
|
|
1431
1435
|
}
|
|
1432
|
-
function
|
|
1436
|
+
function at(e) {
|
|
1433
1437
|
const t = /class\s*=\s*(['"])(.*?)\1/g, r = [];
|
|
1434
|
-
let
|
|
1435
|
-
for (;
|
|
1436
|
-
const n =
|
|
1438
|
+
let i;
|
|
1439
|
+
for (; i = t.exec(e); ) {
|
|
1440
|
+
const n = i[2].split(/\s+/).filter(Boolean);
|
|
1437
1441
|
n.length && r.push(...n);
|
|
1438
1442
|
}
|
|
1439
1443
|
return r.filter(Boolean);
|
|
1440
1444
|
}
|
|
1441
|
-
const
|
|
1445
|
+
const Ce = /* @__PURE__ */ new Map(), ct = 16;
|
|
1442
1446
|
function lt(e) {
|
|
1443
|
-
const t = Date.now(), r =
|
|
1444
|
-
if (r && t - r.timestamp <
|
|
1445
|
-
const
|
|
1446
|
-
function d(
|
|
1447
|
-
const
|
|
1448
|
-
if (
|
|
1449
|
-
const x = w
|
|
1450
|
-
return u[
|
|
1451
|
-
}
|
|
1452
|
-
function
|
|
1453
|
-
const b =
|
|
1454
|
-
return
|
|
1455
|
-
}
|
|
1456
|
-
function
|
|
1447
|
+
const t = Date.now(), r = Ce.get(e);
|
|
1448
|
+
if (r && t - r.timestamp < ct) return r.css;
|
|
1449
|
+
const i = at(e), n = new Set(i), s = [], o = [], a = [], f = [], u = {};
|
|
1450
|
+
function d(w, b = !1) {
|
|
1451
|
+
const m = (b ? "dark|" : "") + w;
|
|
1452
|
+
if (m in u) return u[m];
|
|
1453
|
+
const x = k(w, b);
|
|
1454
|
+
return u[m] = x, x;
|
|
1455
|
+
}
|
|
1456
|
+
function y(w) {
|
|
1457
|
+
const b = w.some((x) => ye.includes(x)), m = w.includes("dark");
|
|
1458
|
+
return w.length === 0 ? 1 : !b && !m ? 2 : b && !m ? 3 : 4;
|
|
1459
|
+
}
|
|
1460
|
+
function c(w) {
|
|
1457
1461
|
const b = [];
|
|
1458
|
-
let
|
|
1459
|
-
for (let g = 0; g <
|
|
1460
|
-
const p =
|
|
1461
|
-
p === "[" ? x++ : p === "]" && x > 0 ? x-- : p === "(" ?
|
|
1462
|
+
let m = "", x = 0, l = 0;
|
|
1463
|
+
for (let g = 0; g < w.length; g++) {
|
|
1464
|
+
const p = w[g];
|
|
1465
|
+
p === "[" ? x++ : p === "]" && x > 0 ? x-- : p === "(" ? l++ : p === ")" && l > 0 && l--, p === ":" && x === 0 && l === 0 ? (b.push(m), m = "") : m += p;
|
|
1462
1466
|
}
|
|
1463
|
-
return
|
|
1467
|
+
return m && b.push(m), b;
|
|
1464
1468
|
}
|
|
1465
|
-
function h(
|
|
1466
|
-
switch (
|
|
1469
|
+
function h(w) {
|
|
1470
|
+
switch (w) {
|
|
1467
1471
|
case "hover":
|
|
1468
1472
|
return ":hover";
|
|
1469
1473
|
case "focus":
|
|
@@ -1492,210 +1496,210 @@ function lt(e) {
|
|
|
1492
1496
|
return null;
|
|
1493
1497
|
}
|
|
1494
1498
|
}
|
|
1495
|
-
function w
|
|
1496
|
-
const
|
|
1499
|
+
function k(w, b = !1) {
|
|
1500
|
+
const m = c(w);
|
|
1497
1501
|
let x = !1;
|
|
1498
|
-
const
|
|
1499
|
-
if (!
|
|
1500
|
-
const g =
|
|
1502
|
+
const l = m.find((v) => (v.startsWith("!") && (x = !0, v = v.slice(1)), ge[v] || be(v) || xe(v) || we(v) || ce(v)));
|
|
1503
|
+
if (!l) return null;
|
|
1504
|
+
const g = l.replace(/^!/, ""), p = ge[g] ?? be(g) ?? xe(g) ?? we(g) ?? ce(g);
|
|
1501
1505
|
if (!p) return null;
|
|
1502
|
-
const _ =
|
|
1503
|
-
let
|
|
1504
|
-
b && (
|
|
1505
|
-
const
|
|
1506
|
-
let
|
|
1506
|
+
const _ = m.indexOf(l);
|
|
1507
|
+
let C = _ >= 0 ? m.slice(0, _) : [];
|
|
1508
|
+
b && (C = C.filter((v) => v !== "dark"));
|
|
1509
|
+
const E = `.${ot(w)}`, S = "__SUBJECT__", A = x ? p.replace(/;$/, " !important;") : p;
|
|
1510
|
+
let j = S;
|
|
1507
1511
|
const Q = [];
|
|
1508
|
-
for (const
|
|
1509
|
-
|
|
1510
|
-
|
|
1512
|
+
for (const v of C)
|
|
1513
|
+
v.startsWith("group-") ? (j = `.group:${v.slice(6)} ${j}`, Q.push(v)) : v.startsWith("peer-") && (j = j.replace(S, `.peer:${v.slice(5)}~${S}`), Q.push(v));
|
|
1514
|
+
C = C.filter((v) => !Q.includes(v));
|
|
1511
1515
|
const X = [], de = [];
|
|
1512
1516
|
let q = null;
|
|
1513
|
-
for (const
|
|
1514
|
-
if (
|
|
1515
|
-
const B =
|
|
1517
|
+
for (const v of C) {
|
|
1518
|
+
if (v === "dark" || ye.includes(v)) continue;
|
|
1519
|
+
const B = st(v);
|
|
1516
1520
|
if (B) {
|
|
1517
1521
|
q = B;
|
|
1518
1522
|
continue;
|
|
1519
1523
|
}
|
|
1520
|
-
const
|
|
1521
|
-
if (
|
|
1522
|
-
q ? de.push(
|
|
1524
|
+
const O = h(v);
|
|
1525
|
+
if (O) {
|
|
1526
|
+
q ? de.push(O) : X.push(O);
|
|
1523
1527
|
continue;
|
|
1524
1528
|
}
|
|
1525
|
-
const
|
|
1526
|
-
typeof
|
|
1529
|
+
const P = rt[v];
|
|
1530
|
+
typeof P == "function" && (j = P(j, A).split("{")[0]);
|
|
1527
1531
|
}
|
|
1528
|
-
function I(
|
|
1529
|
-
if (!B) return
|
|
1530
|
-
let
|
|
1531
|
-
if (
|
|
1532
|
-
let
|
|
1533
|
-
for (;
|
|
1534
|
-
for (;
|
|
1535
|
-
const R =
|
|
1536
|
-
if (R === "[" ?
|
|
1537
|
-
return
|
|
1532
|
+
function I(v, B) {
|
|
1533
|
+
if (!B) return v;
|
|
1534
|
+
let O = 0, P = 0;
|
|
1535
|
+
if (v.length && (v[0] === ">" || v[0] === "+" || v[0] === "~" || v[0] === " ")) {
|
|
1536
|
+
let T = 1;
|
|
1537
|
+
for (; T < v.length && v[T] === " "; ) T++;
|
|
1538
|
+
for (; T < v.length; T++) {
|
|
1539
|
+
const R = v[T];
|
|
1540
|
+
if (R === "[" ? O++ : R === "]" && O > 0 ? O-- : R === "(" ? P++ : R === ")" && P > 0 && P--, O === 0 && P === 0 && (v[T] === ">" || v[T] === "+" || v[T] === "~" || v[T] === " "))
|
|
1541
|
+
return v.slice(0, T) + B + v.slice(T);
|
|
1538
1542
|
}
|
|
1539
|
-
return
|
|
1543
|
+
return v + B;
|
|
1540
1544
|
}
|
|
1541
|
-
for (let
|
|
1542
|
-
const R =
|
|
1543
|
-
if (R === "[" ?
|
|
1544
|
-
return
|
|
1545
|
+
for (let T = 0; T < v.length; T++) {
|
|
1546
|
+
const R = v[T];
|
|
1547
|
+
if (R === "[" ? O++ : R === "]" && O > 0 ? O-- : R === "(" ? P++ : R === ")" && P > 0 && P--, O === 0 && P === 0 && (R === ">" || R === "+" || R === "~" || R === " "))
|
|
1548
|
+
return v.slice(0, T) + B + v.slice(T);
|
|
1545
1549
|
}
|
|
1546
|
-
return
|
|
1550
|
+
return v + B;
|
|
1547
1551
|
}
|
|
1548
1552
|
const Z = X.join(""), F = de.join("");
|
|
1549
1553
|
if (q)
|
|
1550
1554
|
if (q.includes("&")) {
|
|
1551
|
-
const
|
|
1555
|
+
const v = q.indexOf("&"), B = q.slice(0, v), O = q.slice(v + 1), P = S + Z, T = j;
|
|
1552
1556
|
if (X.length === 0)
|
|
1553
|
-
|
|
1557
|
+
j = T.replace(S, B + P + F + O);
|
|
1554
1558
|
else {
|
|
1555
|
-
const R = I(
|
|
1556
|
-
|
|
1559
|
+
const R = I(O, F);
|
|
1560
|
+
j = T.replace(S, B + P + R);
|
|
1557
1561
|
}
|
|
1558
1562
|
} else
|
|
1559
|
-
|
|
1563
|
+
j = j.replace(S, `${q}${S + Z}`), F && (j = j.replace(S, `${S}${F}`));
|
|
1560
1564
|
else
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
let L = `${
|
|
1564
|
-
const K =
|
|
1565
|
-
return b && D ? L = `@media (prefers-color-scheme: dark) and ${
|
|
1566
|
-
}
|
|
1567
|
-
for (const
|
|
1568
|
-
const b =
|
|
1569
|
-
(p) => ge[p] || be(p) || xe(p) ||
|
|
1565
|
+
j = S + Z + F;
|
|
1566
|
+
j = j.replace(new RegExp(S, "g"), E);
|
|
1567
|
+
let L = `${j}{${A}}`;
|
|
1568
|
+
const K = C.filter((v) => ye.includes(v)), D = K.length ? K[K.length - 1] : null, ne = C.includes("dark");
|
|
1569
|
+
return b && D ? L = `@media (prefers-color-scheme: dark) and ${me[D]}{${L}}` : b ? L = `@media (prefers-color-scheme: dark){${L}}` : ne && D ? L = `@media (prefers-color-scheme: dark) and ${me[D]}{${L}}` : ne ? L = `@media (prefers-color-scheme: dark){${L}}` : D && (L = `@media ${me[D]}{${L}}`), L;
|
|
1570
|
+
}
|
|
1571
|
+
for (const w of n) {
|
|
1572
|
+
const b = c(w), m = b.find(
|
|
1573
|
+
(p) => ge[p] || be(p) || xe(p) || we(p) || ce(p)
|
|
1570
1574
|
);
|
|
1571
|
-
if (!
|
|
1572
|
-
const x = b.indexOf(
|
|
1575
|
+
if (!m) continue;
|
|
1576
|
+
const x = b.indexOf(m), l = x >= 0 ? b.slice(0, x) : [], g = y(l);
|
|
1573
1577
|
if (g === 4) {
|
|
1574
|
-
const p = d(
|
|
1578
|
+
const p = d(w, !0);
|
|
1575
1579
|
p && f.push(p);
|
|
1576
1580
|
} else {
|
|
1577
|
-
const p = d(
|
|
1578
|
-
p && (g === 1 ?
|
|
1581
|
+
const p = d(w);
|
|
1582
|
+
p && (g === 1 ? s.push(p) : g === 2 ? o.push(p) : g === 3 && a.push(p));
|
|
1579
1583
|
}
|
|
1580
1584
|
}
|
|
1581
|
-
const $ = [...
|
|
1582
|
-
return
|
|
1585
|
+
const $ = [...s, ...o, ...a, ...f].join("");
|
|
1586
|
+
return Ce.set(e, { css: $, timestamp: t }), $;
|
|
1583
1587
|
}
|
|
1584
1588
|
const te = [];
|
|
1585
|
-
function
|
|
1589
|
+
function ft(e, t, r, i, n, s, o, a) {
|
|
1586
1590
|
if (e) {
|
|
1587
1591
|
te.push(r);
|
|
1588
1592
|
try {
|
|
1589
1593
|
if (t.loadingTemplate && r.isLoading) {
|
|
1590
|
-
Y(e, t.loadingTemplate(r), r,
|
|
1594
|
+
Y(e, t.loadingTemplate(r), r, i, n);
|
|
1591
1595
|
return;
|
|
1592
1596
|
}
|
|
1593
1597
|
if (t.errorTemplate && r.hasError) {
|
|
1594
|
-
r.error instanceof Error && Y(e, t.errorTemplate(r.error, r), r,
|
|
1598
|
+
r.error instanceof Error && Y(e, t.errorTemplate(r.error, r), r, i, n);
|
|
1595
1599
|
return;
|
|
1596
1600
|
}
|
|
1597
1601
|
const f = t.render(r);
|
|
1598
1602
|
if (f instanceof Promise) {
|
|
1599
|
-
|
|
1600
|
-
|
|
1603
|
+
s(!0), f.then((u) => {
|
|
1604
|
+
s(!1), o(null), Y(e, u, r, i, n), a(e.innerHTML);
|
|
1601
1605
|
}).catch((u) => {
|
|
1602
|
-
|
|
1603
|
-
}), t.loadingTemplate && Y(e, t.loadingTemplate(r), r,
|
|
1606
|
+
s(!1), o(u), t.errorTemplate && Y(e, t.errorTemplate(u, r), r, i, n);
|
|
1607
|
+
}), t.loadingTemplate && Y(e, t.loadingTemplate(r), r, i, n);
|
|
1604
1608
|
return;
|
|
1605
1609
|
}
|
|
1606
|
-
Y(e, f, r,
|
|
1610
|
+
Y(e, f, r, i, n), a(e.innerHTML);
|
|
1607
1611
|
} finally {
|
|
1608
1612
|
te.pop();
|
|
1609
1613
|
}
|
|
1610
1614
|
}
|
|
1611
1615
|
}
|
|
1612
|
-
function Y(e, t, r,
|
|
1616
|
+
function Y(e, t, r, i, n) {
|
|
1613
1617
|
e && (Ye(
|
|
1614
1618
|
e,
|
|
1615
1619
|
Array.isArray(t) ? t : [t],
|
|
1616
1620
|
r,
|
|
1617
|
-
|
|
1621
|
+
i
|
|
1618
1622
|
), n(e.innerHTML));
|
|
1619
1623
|
}
|
|
1620
|
-
function
|
|
1621
|
-
if (
|
|
1624
|
+
function ut(e, t, r, i, n, s, o) {
|
|
1625
|
+
if (s !== null && clearTimeout(s), Date.now() - t < 16) {
|
|
1622
1626
|
if (n(r + 1), r > 10) {
|
|
1623
|
-
|
|
1627
|
+
o(null);
|
|
1624
1628
|
return;
|
|
1625
1629
|
}
|
|
1626
1630
|
} else
|
|
1627
1631
|
n(0);
|
|
1628
1632
|
const f = setTimeout(() => {
|
|
1629
|
-
|
|
1633
|
+
i(Date.now()), e(), o(null);
|
|
1630
1634
|
}, 0);
|
|
1631
|
-
|
|
1635
|
+
o(f);
|
|
1632
1636
|
}
|
|
1633
|
-
function
|
|
1637
|
+
function dt(e, t, r, i, n, s) {
|
|
1634
1638
|
if (!e) return;
|
|
1635
|
-
const
|
|
1636
|
-
if (!t.style && (!
|
|
1637
|
-
|
|
1639
|
+
const o = lt(i);
|
|
1640
|
+
if (!t.style && (!o || o.trim() === "")) {
|
|
1641
|
+
s(null), e.adoptedStyleSheets = [_e()];
|
|
1638
1642
|
return;
|
|
1639
1643
|
}
|
|
1640
1644
|
let a = "";
|
|
1641
1645
|
t.style && (typeof t.style == "string" ? a = t.style : typeof t.style == "function" && (a = t.style(r)));
|
|
1642
1646
|
let f = Ge(`${a}
|
|
1643
|
-
${
|
|
1647
|
+
${o}
|
|
1644
1648
|
`);
|
|
1645
1649
|
f = Be(f);
|
|
1646
1650
|
let u = n;
|
|
1647
|
-
u || (u = new CSSStyleSheet()), (u.cssRules.length === 0 || u.toString() !== f) && u.replaceSync(f), e.adoptedStyleSheets = [_e(), u],
|
|
1651
|
+
u || (u = new CSSStyleSheet()), (u.cssRules.length === 0 || u.toString() !== f) && u.replaceSync(f), e.adoptedStyleSheets = [_e(), u], s(u);
|
|
1648
1652
|
}
|
|
1649
1653
|
const ue = /* @__PURE__ */ new Map(), Ae = Symbol.for("cer.registry");
|
|
1650
1654
|
if (typeof window < "u") {
|
|
1651
1655
|
const e = globalThis;
|
|
1652
1656
|
e[Ae] || (e[Ae] = ue);
|
|
1653
1657
|
}
|
|
1654
|
-
function
|
|
1655
|
-
let
|
|
1656
|
-
|
|
1658
|
+
function je(e, t, r) {
|
|
1659
|
+
let i = J(e);
|
|
1660
|
+
i.includes("-") || (i = `cer-${i}`);
|
|
1657
1661
|
let n;
|
|
1658
|
-
typeof t == "function" ? n = { ...r, render: t } : n = t, typeof n.onError != "function" && (n.onError = (
|
|
1659
|
-
console.error(`[${
|
|
1662
|
+
typeof t == "function" ? n = { ...r, render: t } : n = t, typeof n.onError != "function" && (n.onError = (s, o) => {
|
|
1663
|
+
console.error(`[${i}] Error:`, s, o);
|
|
1660
1664
|
});
|
|
1661
1665
|
try {
|
|
1662
|
-
const
|
|
1666
|
+
const s = /* @__PURE__ */ new Set([
|
|
1663
1667
|
"refs",
|
|
1664
1668
|
"requestRender",
|
|
1665
1669
|
"error",
|
|
1666
1670
|
"hasError",
|
|
1667
1671
|
"isLoading",
|
|
1668
1672
|
"emit"
|
|
1669
|
-
]),
|
|
1673
|
+
]), o = [];
|
|
1670
1674
|
if (n.state && typeof n.state == "object" && Object.keys(n.state).forEach((a) => {
|
|
1671
|
-
|
|
1675
|
+
s.has(a) && o.push(a);
|
|
1672
1676
|
}), n.props && typeof n.props == "object" && Object.keys(n.props).forEach((a) => {
|
|
1673
|
-
|
|
1677
|
+
s.has(a) && o.push(a);
|
|
1674
1678
|
}), n.computed && typeof n.computed == "object" && Object.keys(n.computed).forEach((a) => {
|
|
1675
|
-
|
|
1676
|
-
}),
|
|
1677
|
-
const a = Array.from(new Set(
|
|
1679
|
+
s.has(a) && o.push(a);
|
|
1680
|
+
}), o.length > 0) {
|
|
1681
|
+
const a = Array.from(new Set(o));
|
|
1678
1682
|
console.warn(
|
|
1679
|
-
`[${
|
|
1683
|
+
`[${i}] 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.`
|
|
1680
1684
|
);
|
|
1681
1685
|
}
|
|
1682
1686
|
} catch {
|
|
1683
1687
|
}
|
|
1684
|
-
if (ue.set(
|
|
1685
|
-
if (!customElements.get(
|
|
1686
|
-
customElements.define(
|
|
1688
|
+
if (ue.set(i, n), typeof window < "u")
|
|
1689
|
+
if (!customElements.get(i))
|
|
1690
|
+
customElements.define(i, pt(i, n));
|
|
1687
1691
|
else
|
|
1688
1692
|
try {
|
|
1689
|
-
document.querySelectorAll(
|
|
1693
|
+
document.querySelectorAll(i).forEach((s) => {
|
|
1690
1694
|
try {
|
|
1691
|
-
typeof
|
|
1695
|
+
typeof s._cfg < "u" && (s._cfg = n), typeof s._render == "function" && s._render(n);
|
|
1692
1696
|
} catch {
|
|
1693
1697
|
}
|
|
1694
1698
|
});
|
|
1695
1699
|
} catch {
|
|
1696
1700
|
}
|
|
1697
1701
|
}
|
|
1698
|
-
function
|
|
1702
|
+
function pt(e, t) {
|
|
1699
1703
|
if (!t.render)
|
|
1700
1704
|
throw new Error(
|
|
1701
1705
|
"Component must have a render function"
|
|
@@ -1752,12 +1756,12 @@ function dt(e, t) {
|
|
|
1752
1756
|
enumerable: !1,
|
|
1753
1757
|
configurable: !1
|
|
1754
1758
|
}), this.context = r, Object.defineProperty(this.context, "emit", {
|
|
1755
|
-
value: (n,
|
|
1759
|
+
value: (n, s, o) => {
|
|
1756
1760
|
const a = new CustomEvent(n, {
|
|
1757
|
-
detail:
|
|
1761
|
+
detail: s,
|
|
1758
1762
|
bubbles: !0,
|
|
1759
1763
|
composed: !0,
|
|
1760
|
-
...
|
|
1764
|
+
...o || {}
|
|
1761
1765
|
});
|
|
1762
1766
|
return this.dispatchEvent(a), !a.defaultPrevented;
|
|
1763
1767
|
},
|
|
@@ -1765,11 +1769,11 @@ function dt(e, t) {
|
|
|
1765
1769
|
enumerable: !1,
|
|
1766
1770
|
configurable: !1
|
|
1767
1771
|
});
|
|
1768
|
-
const
|
|
1769
|
-
Object.keys(
|
|
1770
|
-
const
|
|
1771
|
-
typeof
|
|
1772
|
-
}), this._applyComputed(
|
|
1772
|
+
const i = ue.get(e) || t;
|
|
1773
|
+
Object.keys(i).forEach((n) => {
|
|
1774
|
+
const s = i[n];
|
|
1775
|
+
typeof s == "function" && (this.context[n] = (...o) => s(...o, this.context));
|
|
1776
|
+
}), this._applyComputed(i), this._initializing = !1, this._initWatchers(i), this._render(i);
|
|
1773
1777
|
}
|
|
1774
1778
|
connectedCallback() {
|
|
1775
1779
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
@@ -1807,12 +1811,12 @@ function dt(e, t) {
|
|
|
1807
1811
|
);
|
|
1808
1812
|
});
|
|
1809
1813
|
}
|
|
1810
|
-
attributeChangedCallback(r,
|
|
1814
|
+
attributeChangedCallback(r, i, n) {
|
|
1811
1815
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1812
1816
|
this._applyProps(t), Ie(
|
|
1813
1817
|
t,
|
|
1814
1818
|
r,
|
|
1815
|
-
|
|
1819
|
+
i,
|
|
1816
1820
|
n,
|
|
1817
1821
|
this.context
|
|
1818
1822
|
);
|
|
@@ -1823,11 +1827,11 @@ function dt(e, t) {
|
|
|
1823
1827
|
}
|
|
1824
1828
|
_applyComputed(r) {
|
|
1825
1829
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1826
|
-
r.computed && Object.entries(r.computed).forEach(([
|
|
1827
|
-
Object.defineProperty(this.context,
|
|
1830
|
+
r.computed && Object.entries(r.computed).forEach(([i, n]) => {
|
|
1831
|
+
Object.defineProperty(this.context, i, {
|
|
1828
1832
|
get: () => {
|
|
1829
|
-
const
|
|
1830
|
-
return H(
|
|
1833
|
+
const s = n(this.context);
|
|
1834
|
+
return H(s);
|
|
1831
1835
|
},
|
|
1832
1836
|
enumerable: !0
|
|
1833
1837
|
});
|
|
@@ -1837,21 +1841,21 @@ function dt(e, t) {
|
|
|
1837
1841
|
// --- Render ---
|
|
1838
1842
|
_render(r) {
|
|
1839
1843
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1840
|
-
|
|
1844
|
+
ft(
|
|
1841
1845
|
this.shadowRoot,
|
|
1842
1846
|
r,
|
|
1843
1847
|
this.context,
|
|
1844
1848
|
this._refs,
|
|
1845
|
-
(
|
|
1846
|
-
this._lastHtmlStringForJitCSS =
|
|
1849
|
+
(i) => {
|
|
1850
|
+
this._lastHtmlStringForJitCSS = i, typeof this.onHtmlStringUpdate == "function" && this.onHtmlStringUpdate(i);
|
|
1847
1851
|
},
|
|
1848
|
-
(
|
|
1849
|
-
this._templateLoading =
|
|
1852
|
+
(i) => {
|
|
1853
|
+
this._templateLoading = i, typeof this.onLoadingStateChange == "function" && this.onLoadingStateChange(i);
|
|
1850
1854
|
},
|
|
1851
|
-
(
|
|
1852
|
-
this._templateError =
|
|
1855
|
+
(i) => {
|
|
1856
|
+
this._templateError = i, typeof this.onErrorStateChange == "function" && this.onErrorStateChange(i);
|
|
1853
1857
|
},
|
|
1854
|
-
(
|
|
1858
|
+
(i) => this._applyStyle(r, i)
|
|
1855
1859
|
);
|
|
1856
1860
|
});
|
|
1857
1861
|
}
|
|
@@ -1860,7 +1864,7 @@ function dt(e, t) {
|
|
|
1860
1864
|
}
|
|
1861
1865
|
_requestRender() {
|
|
1862
1866
|
this._runLogicWithinErrorBoundary(this._cfg, () => {
|
|
1863
|
-
|
|
1867
|
+
ut(
|
|
1864
1868
|
() => this._render(this._cfg),
|
|
1865
1869
|
this._lastRenderTime,
|
|
1866
1870
|
this._renderCount,
|
|
@@ -1878,13 +1882,13 @@ function dt(e, t) {
|
|
|
1878
1882
|
});
|
|
1879
1883
|
}
|
|
1880
1884
|
// --- Style ---
|
|
1881
|
-
_applyStyle(r,
|
|
1885
|
+
_applyStyle(r, i) {
|
|
1882
1886
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1883
|
-
|
|
1887
|
+
dt(
|
|
1884
1888
|
this.shadowRoot,
|
|
1885
1889
|
r,
|
|
1886
1890
|
this.context,
|
|
1887
|
-
|
|
1891
|
+
i,
|
|
1888
1892
|
this._styleSheet,
|
|
1889
1893
|
(n) => {
|
|
1890
1894
|
this._styleSheet = n;
|
|
@@ -1893,10 +1897,10 @@ function dt(e, t) {
|
|
|
1893
1897
|
});
|
|
1894
1898
|
}
|
|
1895
1899
|
// --- Error Boundary function ---
|
|
1896
|
-
_runLogicWithinErrorBoundary(r,
|
|
1900
|
+
_runLogicWithinErrorBoundary(r, i) {
|
|
1897
1901
|
this._hasError && (this._hasError = !1);
|
|
1898
1902
|
try {
|
|
1899
|
-
|
|
1903
|
+
i();
|
|
1900
1904
|
} catch (n) {
|
|
1901
1905
|
this._hasError = !0, r.onError && r.onError(n, this.context), r.errorFallback && this.shadowRoot && (this.shadowRoot.innerHTML = r.errorFallback(
|
|
1902
1906
|
n,
|
|
@@ -1907,8 +1911,8 @@ function dt(e, t) {
|
|
|
1907
1911
|
// --- State, props, computed ---
|
|
1908
1912
|
_initContext(r) {
|
|
1909
1913
|
try {
|
|
1910
|
-
let
|
|
1911
|
-
return Array.isArray(
|
|
1914
|
+
let i = function(s, o = "") {
|
|
1915
|
+
return Array.isArray(s) ? new Proxy(s, {
|
|
1912
1916
|
get(a, f, u) {
|
|
1913
1917
|
const d = Reflect.get(a, f, u);
|
|
1914
1918
|
return typeof d == "function" && typeof f == "string" && [
|
|
@@ -1919,36 +1923,36 @@ function dt(e, t) {
|
|
|
1919
1923
|
"splice",
|
|
1920
1924
|
"sort",
|
|
1921
1925
|
"reverse"
|
|
1922
|
-
].includes(f) ? function(...
|
|
1923
|
-
const h = d.apply(a,
|
|
1926
|
+
].includes(f) ? function(...c) {
|
|
1927
|
+
const h = d.apply(a, c);
|
|
1924
1928
|
if (!n._initializing) {
|
|
1925
|
-
const
|
|
1926
|
-
n._triggerWatchers(
|
|
1929
|
+
const k = o || "root";
|
|
1930
|
+
n._triggerWatchers(k, a), n._render(r);
|
|
1927
1931
|
}
|
|
1928
1932
|
return h;
|
|
1929
1933
|
} : d;
|
|
1930
1934
|
},
|
|
1931
1935
|
set(a, f, u) {
|
|
1932
1936
|
if (a[f] = u, !n._initializing) {
|
|
1933
|
-
const d =
|
|
1937
|
+
const d = o ? `${o}.${String(f)}` : String(f);
|
|
1934
1938
|
n._triggerWatchers(d, u), n._render(r);
|
|
1935
1939
|
}
|
|
1936
1940
|
return !0;
|
|
1937
1941
|
},
|
|
1938
1942
|
deleteProperty(a, f) {
|
|
1939
1943
|
if (delete a[f], !n._initializing) {
|
|
1940
|
-
const u =
|
|
1944
|
+
const u = o ? `${o}.${String(f)}` : String(f);
|
|
1941
1945
|
n._triggerWatchers(u, void 0), n._render(r);
|
|
1942
1946
|
}
|
|
1943
1947
|
return !0;
|
|
1944
1948
|
}
|
|
1945
|
-
}) :
|
|
1946
|
-
const f =
|
|
1947
|
-
|
|
1948
|
-
}), new Proxy(
|
|
1949
|
+
}) : s && typeof s == "object" ? (Object.keys(s).forEach((a) => {
|
|
1950
|
+
const f = o ? `${o}.${a}` : a;
|
|
1951
|
+
s[a] = i(s[a], f);
|
|
1952
|
+
}), new Proxy(s, {
|
|
1949
1953
|
set(a, f, u) {
|
|
1950
|
-
const d =
|
|
1951
|
-
return a[f] =
|
|
1954
|
+
const d = o ? `${o}.${String(f)}` : String(f);
|
|
1955
|
+
return a[f] = i(u, d), n._initializing || (n._triggerWatchers(
|
|
1952
1956
|
d,
|
|
1953
1957
|
a[f]
|
|
1954
1958
|
), n._render(r)), !0;
|
|
@@ -1956,134 +1960,134 @@ function dt(e, t) {
|
|
|
1956
1960
|
get(a, f, u) {
|
|
1957
1961
|
return Reflect.get(a, f, u);
|
|
1958
1962
|
}
|
|
1959
|
-
})) :
|
|
1963
|
+
})) : s;
|
|
1960
1964
|
};
|
|
1961
1965
|
const n = this;
|
|
1962
|
-
return
|
|
1966
|
+
return i({ ...r.state });
|
|
1963
1967
|
} catch {
|
|
1964
1968
|
return {};
|
|
1965
1969
|
}
|
|
1966
1970
|
}
|
|
1967
1971
|
_initWatchers(r) {
|
|
1968
1972
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1969
|
-
|
|
1973
|
+
ze(
|
|
1970
1974
|
this.context,
|
|
1971
1975
|
this._watchers,
|
|
1972
1976
|
r.watch || {}
|
|
1973
1977
|
);
|
|
1974
1978
|
});
|
|
1975
1979
|
}
|
|
1976
|
-
_triggerWatchers(r,
|
|
1977
|
-
Me(this.context, this._watchers, r,
|
|
1980
|
+
_triggerWatchers(r, i) {
|
|
1981
|
+
Me(this.context, this._watchers, r, i);
|
|
1978
1982
|
}
|
|
1979
1983
|
_applyProps(r) {
|
|
1980
1984
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1981
1985
|
try {
|
|
1982
1986
|
We(this, r, this.context);
|
|
1983
|
-
} catch (
|
|
1984
|
-
this._hasError = !0, r.onError && r.onError(
|
|
1987
|
+
} catch (i) {
|
|
1988
|
+
this._hasError = !0, r.onError && r.onError(i, this.context), r.errorFallback && this.shadowRoot && (this.shadowRoot.innerHTML = r.errorFallback(i, this.context));
|
|
1985
1989
|
}
|
|
1986
1990
|
});
|
|
1987
1991
|
}
|
|
1988
1992
|
};
|
|
1989
1993
|
}
|
|
1990
|
-
function ee(e, t = {}, r,
|
|
1991
|
-
const n =
|
|
1994
|
+
function ee(e, t = {}, r, i) {
|
|
1995
|
+
const n = i ?? t.key;
|
|
1992
1996
|
return { tag: e, key: n, props: t, children: r };
|
|
1993
1997
|
}
|
|
1994
|
-
function
|
|
1998
|
+
function le(e) {
|
|
1995
1999
|
return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
|
|
1996
2000
|
}
|
|
1997
|
-
function
|
|
1998
|
-
return typeof e == "object" && e !== null && "tag" in e && !
|
|
2001
|
+
function se(e) {
|
|
2002
|
+
return typeof e == "object" && e !== null && "tag" in e && !le(e);
|
|
1999
2003
|
}
|
|
2000
|
-
function
|
|
2004
|
+
function ht(e, t) {
|
|
2001
2005
|
return e.key != null ? e : { ...e, key: t };
|
|
2002
2006
|
}
|
|
2003
|
-
function
|
|
2004
|
-
const
|
|
2007
|
+
function gt(e, t = [], r = {}) {
|
|
2008
|
+
const i = {}, n = {}, s = {}, o = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
|
|
2005
2009
|
let a;
|
|
2006
|
-
for (; a =
|
|
2007
|
-
const f = a[1], u = a[2], d = (a[4] || a[6]) ?? "",
|
|
2008
|
-
let
|
|
2009
|
-
|
|
2010
|
+
for (; a = o.exec(e); ) {
|
|
2011
|
+
const f = a[1], u = a[2], d = (a[4] || a[6]) ?? "", y = d.match(/^{{(\d+)}}$/);
|
|
2012
|
+
let c = y ? t[Number(y[1])] ?? null : d;
|
|
2013
|
+
y || (c === "true" ? c = !0 : c === "false" ? c = !1 : c === "null" ? c = null : isNaN(Number(c)) || (c = Number(c)));
|
|
2010
2014
|
const h = ["model", "bind", "show", "class", "style"];
|
|
2011
2015
|
if (f === ":") {
|
|
2012
|
-
const [
|
|
2013
|
-
if (h.includes(
|
|
2014
|
-
const
|
|
2015
|
-
|
|
2016
|
-
value:
|
|
2017
|
-
modifiers:
|
|
2016
|
+
const [k, $] = u.split(":"), [w, ...b] = k.split(".");
|
|
2017
|
+
if (h.includes(w)) {
|
|
2018
|
+
const m = [...b], x = w === "model" && $ ? `model:${$}` : w;
|
|
2019
|
+
s[x] = {
|
|
2020
|
+
value: c,
|
|
2021
|
+
modifiers: m,
|
|
2018
2022
|
arg: $
|
|
2019
2023
|
};
|
|
2020
2024
|
} else
|
|
2021
|
-
n[u] =
|
|
2025
|
+
n[u] = c;
|
|
2022
2026
|
} else if (f === "@") {
|
|
2023
|
-
const
|
|
2024
|
-
|
|
2025
|
-
} else u === "ref" ?
|
|
2027
|
+
const k = "on" + u.charAt(0).toUpperCase() + u.slice(1);
|
|
2028
|
+
i[k] = typeof c == "function" ? c : typeof r[c] == "function" ? r[c] : void 0;
|
|
2029
|
+
} else u === "ref" ? i.ref = c : n[u] = c;
|
|
2026
2030
|
}
|
|
2027
|
-
return { props:
|
|
2031
|
+
return { props: i, attrs: n, directives: s };
|
|
2028
2032
|
}
|
|
2029
|
-
function
|
|
2030
|
-
const
|
|
2031
|
-
function
|
|
2032
|
-
return ee("#text", {},
|
|
2033
|
+
function mt(e, t, r) {
|
|
2034
|
+
const i = te.length > 0 ? te[te.length - 1] : void 0, n = r ?? i;
|
|
2035
|
+
function s(l, g) {
|
|
2036
|
+
return ee("#text", {}, l, g);
|
|
2033
2037
|
}
|
|
2034
|
-
let
|
|
2035
|
-
for (let
|
|
2036
|
-
|
|
2038
|
+
let o = "";
|
|
2039
|
+
for (let l = 0; l < e.length; l++)
|
|
2040
|
+
o += e[l], l < t.length && (o += `{{${l}}}`);
|
|
2037
2041
|
const a = /<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, f = [];
|
|
2038
|
-
let u, d = [],
|
|
2039
|
-
function
|
|
2040
|
-
!
|
|
2041
|
-
if (g === "style" &&
|
|
2042
|
-
const p =
|
|
2042
|
+
let u, d = [], y = null, c = {}, h, k = 0, $ = [];
|
|
2043
|
+
function w(l) {
|
|
2044
|
+
!l || typeof l != "object" || le(l) || (l.props || l.attrs ? (l.props && (c.props || (c.props = {}), Object.assign(c.props, l.props)), l.attrs && (c.attrs || (c.attrs = {}), Object.keys(l.attrs).forEach((g) => {
|
|
2045
|
+
if (g === "style" && c.attrs.style) {
|
|
2046
|
+
const p = c.attrs.style.replace(
|
|
2043
2047
|
/;?\s*$/,
|
|
2044
2048
|
""
|
|
2045
|
-
), _ =
|
|
2046
|
-
|
|
2047
|
-
} else if (g === "class" &&
|
|
2048
|
-
const p =
|
|
2049
|
+
), _ = l.attrs.style.replace(/^;?\s*/, "");
|
|
2050
|
+
c.attrs.style = p + "; " + _;
|
|
2051
|
+
} else if (g === "class" && c.attrs.class) {
|
|
2052
|
+
const p = c.attrs.class.trim().split(/\s+/).filter(Boolean), _ = l.attrs.class.trim().split(/\s+/).filter(Boolean), C = [
|
|
2049
2053
|
.../* @__PURE__ */ new Set([...p, ..._])
|
|
2050
2054
|
];
|
|
2051
|
-
|
|
2055
|
+
c.attrs.class = C.join(" ");
|
|
2052
2056
|
} else
|
|
2053
|
-
|
|
2054
|
-
}))) : (
|
|
2055
|
-
}
|
|
2056
|
-
function b(
|
|
2057
|
-
const p =
|
|
2058
|
-
if (
|
|
2059
|
-
const _ =
|
|
2060
|
-
let
|
|
2057
|
+
c.attrs[g] = l.attrs[g];
|
|
2058
|
+
}))) : (c.props || (c.props = {}), Object.assign(c.props, l)));
|
|
2059
|
+
}
|
|
2060
|
+
function b(l, g) {
|
|
2061
|
+
const p = y ? d : $;
|
|
2062
|
+
if (le(l)) {
|
|
2063
|
+
const _ = l.key ?? g;
|
|
2064
|
+
let C = l.children;
|
|
2061
2065
|
p.push({
|
|
2062
|
-
...
|
|
2066
|
+
...l,
|
|
2063
2067
|
key: _,
|
|
2064
|
-
children:
|
|
2068
|
+
children: C
|
|
2065
2069
|
});
|
|
2066
2070
|
return;
|
|
2067
2071
|
}
|
|
2068
|
-
if (
|
|
2069
|
-
p.push(
|
|
2072
|
+
if (se(l)) {
|
|
2073
|
+
p.push(ht(l, void 0));
|
|
2070
2074
|
return;
|
|
2071
2075
|
}
|
|
2072
|
-
if (Array.isArray(
|
|
2073
|
-
if (
|
|
2074
|
-
for (let _ = 0; _ <
|
|
2075
|
-
const
|
|
2076
|
-
|
|
2076
|
+
if (Array.isArray(l)) {
|
|
2077
|
+
if (l.length === 0) return;
|
|
2078
|
+
for (let _ = 0; _ < l.length; _++) {
|
|
2079
|
+
const C = l[_];
|
|
2080
|
+
le(C) || se(C) || Array.isArray(C) ? b(C, `${g}-${_}`) : C !== null && typeof C == "object" ? w(C) : p.push(s(String(C), `${g}-${_}`));
|
|
2077
2081
|
}
|
|
2078
2082
|
return;
|
|
2079
2083
|
}
|
|
2080
|
-
if (
|
|
2081
|
-
|
|
2084
|
+
if (l !== null && typeof l == "object") {
|
|
2085
|
+
w(l);
|
|
2082
2086
|
return;
|
|
2083
2087
|
}
|
|
2084
|
-
p.push(
|
|
2088
|
+
p.push(s(String(l), g));
|
|
2085
2089
|
}
|
|
2086
|
-
const
|
|
2090
|
+
const m = /* @__PURE__ */ new Set([
|
|
2087
2091
|
"area",
|
|
2088
2092
|
"base",
|
|
2089
2093
|
"br",
|
|
@@ -2099,197 +2103,197 @@ function gt(e, t, r) {
|
|
|
2099
2103
|
"track",
|
|
2100
2104
|
"wbr"
|
|
2101
2105
|
]);
|
|
2102
|
-
for (; u = a.exec(
|
|
2106
|
+
for (; u = a.exec(o); )
|
|
2103
2107
|
if (u[1]) {
|
|
2104
|
-
const
|
|
2108
|
+
const l = u[1], g = u[0][1] === "/", p = u[0][u[0].length - 2] === "/" || m.has(l), {
|
|
2105
2109
|
props: _,
|
|
2106
|
-
attrs:
|
|
2107
|
-
directives:
|
|
2108
|
-
} =
|
|
2110
|
+
attrs: C,
|
|
2111
|
+
directives: E
|
|
2112
|
+
} = gt(u[2] || "", t, n), S = { props: {}, attrs: {} };
|
|
2109
2113
|
for (const A in _) S.props[A] = _[A];
|
|
2110
|
-
for (const A in
|
|
2111
|
-
if (
|
|
2114
|
+
for (const A in C) S.attrs[A] = C[A];
|
|
2115
|
+
if (E && Object.keys(E).some((A) => A === "model" || A.startsWith("model:")))
|
|
2112
2116
|
try {
|
|
2113
|
-
const A = Symbol.for("cer.registry"),
|
|
2114
|
-
if (!!(
|
|
2115
|
-
for (const I of Object.keys(
|
|
2117
|
+
const A = Symbol.for("cer.registry"), j = globalThis[A], Q = !!(j && typeof j.has == "function" && j.has(l)), X = !!(n && (n.__customElements instanceof Set && n.__customElements.has(l) || Array.isArray(n.__isCustomElements) && n.__isCustomElements.includes(l)));
|
|
2118
|
+
if (!!(l.includes("-") || X || Q))
|
|
2119
|
+
for (const I of Object.keys(E)) {
|
|
2116
2120
|
if (I !== "model" && !I.startsWith("model:")) continue;
|
|
2117
|
-
const Z =
|
|
2121
|
+
const Z = E[I], F = Z.arg ?? (I.includes(":") ? I.split(":", 2)[1] : void 0), L = Z.value, K = F ?? "modelValue", D = z, ne = oe, v = n ? n._state || n : void 0;
|
|
2118
2122
|
let B;
|
|
2119
|
-
typeof L == "string" && n ? B = D(
|
|
2123
|
+
typeof L == "string" && n ? B = D(v, L) : B = L, S.props[K] = B;
|
|
2120
2124
|
try {
|
|
2121
|
-
const
|
|
2122
|
-
S.attrs || (S.attrs = {}), B !== void 0 && (S.attrs[
|
|
2125
|
+
const T = J(K);
|
|
2126
|
+
S.attrs || (S.attrs = {}), B !== void 0 && (S.attrs[T] = B);
|
|
2123
2127
|
} catch {
|
|
2124
2128
|
}
|
|
2125
2129
|
S.isCustomElement = !0;
|
|
2126
|
-
const
|
|
2127
|
-
S.props[
|
|
2128
|
-
const R =
|
|
2129
|
-
if (!
|
|
2130
|
-
const pe = D(
|
|
2131
|
-
(Array.isArray(R) && Array.isArray(pe) ? JSON.stringify([...R].sort()) !== JSON.stringify([...pe].sort()) : R !== pe) && (ne(
|
|
2132
|
-
}, delete
|
|
2130
|
+
const O = `update:${J(K)}`, P = "on" + O.charAt(0).toUpperCase() + O.slice(1);
|
|
2131
|
+
S.props[P] = function(T) {
|
|
2132
|
+
const R = T.detail !== void 0 ? T.detail : T.target ? T.target.value : void 0;
|
|
2133
|
+
if (!v) return;
|
|
2134
|
+
const pe = D(v, typeof L == "string" ? L : String(L));
|
|
2135
|
+
(Array.isArray(R) && Array.isArray(pe) ? JSON.stringify([...R].sort()) !== JSON.stringify([...pe].sort()) : R !== pe) && (ne(v, typeof L == "string" ? L : String(L), R), n?.requestRender ? n.requestRender() : n?._requestRender && n._requestRender());
|
|
2136
|
+
}, delete E[I];
|
|
2133
2137
|
}
|
|
2134
2138
|
} catch {
|
|
2135
2139
|
}
|
|
2136
|
-
if (Object.keys(
|
|
2140
|
+
if (Object.keys(E).length > 0 && (S.directives = { ...E }), g) {
|
|
2137
2141
|
const A = ee(
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
d.length === 1 &&
|
|
2142
|
+
y,
|
|
2143
|
+
c,
|
|
2144
|
+
d.length === 1 && se(d[0]) && d[0].tag === "#text" ? typeof d[0].children == "string" ? d[0].children : "" : d.length ? d : void 0,
|
|
2141
2145
|
h
|
|
2142
|
-
),
|
|
2143
|
-
|
|
2144
|
-
} else p ?
|
|
2145
|
-
tag:
|
|
2146
|
-
props:
|
|
2146
|
+
), j = f.pop();
|
|
2147
|
+
j ? (y = j.tag, c = j.props, h = j.key, d = j.children, d.push(A)) : ($.push(A), y = null, c = {}, h = void 0, d = []);
|
|
2148
|
+
} else p ? y ? d.push(ee(l, S, void 0, void 0)) : $.push(ee(l, S, void 0, void 0)) : (y && f.push({
|
|
2149
|
+
tag: y,
|
|
2150
|
+
props: c,
|
|
2147
2151
|
children: d,
|
|
2148
2152
|
key: h
|
|
2149
|
-
}),
|
|
2153
|
+
}), y = l, c = S, d = []);
|
|
2150
2154
|
} else if (typeof u[3] < "u") {
|
|
2151
|
-
const
|
|
2155
|
+
const l = Number(u[3]), g = t[l], p = `interp-${l}`;
|
|
2152
2156
|
b(g, p);
|
|
2153
2157
|
} else if (u[4]) {
|
|
2154
|
-
const
|
|
2158
|
+
const l = u[4], g = y ? d : $, p = l.split(/({{\d+}})/);
|
|
2155
2159
|
for (const _ of p) {
|
|
2156
2160
|
if (!_) continue;
|
|
2157
|
-
const
|
|
2158
|
-
if (
|
|
2159
|
-
const
|
|
2161
|
+
const C = _.match(/^{{(\d+)}}$/);
|
|
2162
|
+
if (C) {
|
|
2163
|
+
const E = Number(C[1]), S = t[E], A = `interp-${E}`;
|
|
2160
2164
|
b(S, A);
|
|
2161
2165
|
} else {
|
|
2162
|
-
const
|
|
2163
|
-
g.push(
|
|
2166
|
+
const E = `text-${k++}`;
|
|
2167
|
+
g.push(s(_, E));
|
|
2164
2168
|
}
|
|
2165
2169
|
}
|
|
2166
2170
|
}
|
|
2167
|
-
const x = $.filter((
|
|
2171
|
+
const x = $.filter((l) => se(l) && l.tag === "#text" ? typeof l.children == "string" && l.children.trim() !== "" : !0);
|
|
2168
2172
|
return x.length === 1 ? x[0] : x.length > 1 ? x : ee("div", {}, "", "fallback-root");
|
|
2169
2173
|
}
|
|
2170
2174
|
function U(e, ...t) {
|
|
2171
|
-
const r = t[t.length - 1],
|
|
2172
|
-
return
|
|
2175
|
+
const r = t[t.length - 1], i = typeof r == "object" && r && !Array.isArray(r) ? r : void 0;
|
|
2176
|
+
return mt(e, t, i);
|
|
2173
2177
|
}
|
|
2174
|
-
const
|
|
2178
|
+
const Te = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, W = (e, t) => {
|
|
2175
2179
|
for (const r of e) {
|
|
2176
|
-
const
|
|
2177
|
-
if (
|
|
2180
|
+
const i = [], n = r.path.replace(/:[^/]+/g, (a) => (i.push(a.slice(1)), "([^/]+)")), s = new RegExp(`^${n}$`), o = t.match(s);
|
|
2181
|
+
if (o) {
|
|
2178
2182
|
const a = {};
|
|
2179
|
-
return
|
|
2180
|
-
a[f] =
|
|
2183
|
+
return i.forEach((f, u) => {
|
|
2184
|
+
a[f] = o[u + 1];
|
|
2181
2185
|
}), { route: r, params: a };
|
|
2182
2186
|
}
|
|
2183
2187
|
}
|
|
2184
2188
|
return { route: null, params: {} };
|
|
2185
|
-
},
|
|
2189
|
+
}, ke = {};
|
|
2186
2190
|
async function yt(e) {
|
|
2187
2191
|
if (e.component) return e.component;
|
|
2188
2192
|
if (e.load) {
|
|
2189
|
-
if (
|
|
2193
|
+
if (ke[e.path]) return ke[e.path];
|
|
2190
2194
|
try {
|
|
2191
2195
|
const t = await e.load();
|
|
2192
|
-
return
|
|
2196
|
+
return ke[e.path] = t.default, t.default;
|
|
2193
2197
|
} catch {
|
|
2194
2198
|
throw new Error(`Failed to load component for route: ${e.path}`);
|
|
2195
2199
|
}
|
|
2196
2200
|
}
|
|
2197
2201
|
throw new Error(`No component or loader defined for route: ${e.path}`);
|
|
2198
2202
|
}
|
|
2199
|
-
function
|
|
2200
|
-
const { routes: t, base: r = "", initialUrl:
|
|
2201
|
-
let n,
|
|
2202
|
-
const
|
|
2203
|
-
const b = t.find((
|
|
2203
|
+
function bt(e) {
|
|
2204
|
+
const { routes: t, base: r = "", initialUrl: i } = e;
|
|
2205
|
+
let n, s, o, a, f, u, d;
|
|
2206
|
+
const y = async ($, w) => {
|
|
2207
|
+
const b = t.find((m) => W([m], $.path).route !== null);
|
|
2204
2208
|
if (b?.beforeEnter)
|
|
2205
2209
|
try {
|
|
2206
|
-
const
|
|
2207
|
-
return typeof
|
|
2208
|
-
} catch (
|
|
2209
|
-
return console.error("beforeEnter error",
|
|
2210
|
+
const m = await b.beforeEnter($, w);
|
|
2211
|
+
return typeof m == "string" ? (await k(m, !0), !1) : m !== !1;
|
|
2212
|
+
} catch (m) {
|
|
2213
|
+
return console.error("beforeEnter error", m), !1;
|
|
2210
2214
|
}
|
|
2211
2215
|
return !0;
|
|
2212
|
-
},
|
|
2213
|
-
const b = t.find((
|
|
2216
|
+
}, c = async ($, w) => {
|
|
2217
|
+
const b = t.find((m) => W([m], $.path).route !== null);
|
|
2214
2218
|
if (b?.onEnter)
|
|
2215
2219
|
try {
|
|
2216
|
-
const
|
|
2217
|
-
return typeof
|
|
2218
|
-
} catch (
|
|
2219
|
-
return console.error("onEnter error",
|
|
2220
|
+
const m = await b.onEnter($, w);
|
|
2221
|
+
return typeof m == "string" ? (await k(m, !0), !1) : m !== !1;
|
|
2222
|
+
} catch (m) {
|
|
2223
|
+
return console.error("onEnter error", m), !1;
|
|
2220
2224
|
}
|
|
2221
2225
|
return !0;
|
|
2222
|
-
}, h = ($,
|
|
2223
|
-
const b = t.find((
|
|
2226
|
+
}, h = ($, w) => {
|
|
2227
|
+
const b = t.find((m) => W([m], $.path).route !== null);
|
|
2224
2228
|
if (b?.afterEnter)
|
|
2225
2229
|
try {
|
|
2226
|
-
b.afterEnter($,
|
|
2227
|
-
} catch (
|
|
2228
|
-
console.error("afterEnter error",
|
|
2230
|
+
b.afterEnter($, w);
|
|
2231
|
+
} catch (m) {
|
|
2232
|
+
console.error("afterEnter error", m);
|
|
2229
2233
|
}
|
|
2230
|
-
},
|
|
2234
|
+
}, k = async ($, w = !1) => {
|
|
2231
2235
|
try {
|
|
2232
2236
|
const b = {
|
|
2233
2237
|
path: $.replace(r, "") || "/",
|
|
2234
2238
|
query: {}
|
|
2235
|
-
},
|
|
2236
|
-
if (!
|
|
2237
|
-
const x =
|
|
2239
|
+
}, m = W(t, b.path);
|
|
2240
|
+
if (!m) throw new Error(`No route found for ${b.path}`);
|
|
2241
|
+
const x = o.getState(), l = {
|
|
2238
2242
|
path: b.path,
|
|
2239
|
-
params:
|
|
2243
|
+
params: m.params,
|
|
2240
2244
|
query: b.query
|
|
2241
2245
|
};
|
|
2242
|
-
if (!await
|
|
2243
|
-
typeof window < "u" && typeof document < "u" && (
|
|
2246
|
+
if (!await y(l, x) || !await c(l, x)) return;
|
|
2247
|
+
typeof window < "u" && typeof document < "u" && (w ? window.history.replaceState({}, "", r + $) : window.history.pushState({}, "", r + $)), o.setState(l), h(l, x);
|
|
2244
2248
|
} catch (b) {
|
|
2245
2249
|
console.error("Navigation error:", b);
|
|
2246
2250
|
}
|
|
2247
2251
|
};
|
|
2248
2252
|
if (typeof window < "u" && typeof document < "u") {
|
|
2249
2253
|
n = () => {
|
|
2250
|
-
const
|
|
2251
|
-
return { path: b, query:
|
|
2252
|
-
},
|
|
2253
|
-
const $ = W(t,
|
|
2254
|
-
|
|
2255
|
-
path:
|
|
2254
|
+
const w = new URL(window.location.href), b = w.pathname.replace(r, "") || "/", m = Te(w.search);
|
|
2255
|
+
return { path: b, query: m };
|
|
2256
|
+
}, s = n();
|
|
2257
|
+
const $ = W(t, s.path);
|
|
2258
|
+
o = $e({
|
|
2259
|
+
path: s.path,
|
|
2256
2260
|
params: $.params,
|
|
2257
|
-
query:
|
|
2258
|
-
}), a = async (
|
|
2261
|
+
query: s.query
|
|
2262
|
+
}), a = async (w = !1) => {
|
|
2259
2263
|
const b = n();
|
|
2260
|
-
await
|
|
2261
|
-
}, window.addEventListener("popstate", () => a(!0)), f = (
|
|
2264
|
+
await k(b.path, w);
|
|
2265
|
+
}, window.addEventListener("popstate", () => a(!0)), f = (w) => k(w, !1), u = (w) => k(w, !0), d = () => window.history.back();
|
|
2262
2266
|
} else {
|
|
2263
2267
|
n = () => {
|
|
2264
|
-
const b = new URL(
|
|
2265
|
-
return { path:
|
|
2266
|
-
},
|
|
2267
|
-
const $ = W(t,
|
|
2268
|
-
|
|
2269
|
-
path:
|
|
2268
|
+
const b = new URL(i || "/", "http://localhost"), m = b.pathname.replace(r, "") || "/", x = Te(b.search);
|
|
2269
|
+
return { path: m, query: x };
|
|
2270
|
+
}, s = n();
|
|
2271
|
+
const $ = W(t, s.path);
|
|
2272
|
+
o = $e({
|
|
2273
|
+
path: s.path,
|
|
2270
2274
|
params: $.params,
|
|
2271
|
-
query:
|
|
2275
|
+
query: s.query
|
|
2272
2276
|
}), a = async () => {
|
|
2273
2277
|
const b = n();
|
|
2274
|
-
await
|
|
2278
|
+
await w(b.path);
|
|
2275
2279
|
};
|
|
2276
|
-
const
|
|
2280
|
+
const w = async (b) => {
|
|
2277
2281
|
try {
|
|
2278
|
-
const
|
|
2282
|
+
const m = {
|
|
2279
2283
|
path: b.replace(r, "") || "/",
|
|
2280
2284
|
query: {}
|
|
2281
|
-
}, x = W(t,
|
|
2282
|
-
if (!x) throw new Error(`No route found for ${
|
|
2283
|
-
const
|
|
2284
|
-
path:
|
|
2285
|
+
}, x = W(t, m.path);
|
|
2286
|
+
if (!x) throw new Error(`No route found for ${m.path}`);
|
|
2287
|
+
const l = o.getState(), g = {
|
|
2288
|
+
path: m.path,
|
|
2285
2289
|
params: x.params,
|
|
2286
|
-
query:
|
|
2290
|
+
query: m.query
|
|
2287
2291
|
}, p = t.find((_) => W([_], g.path).route !== null);
|
|
2288
2292
|
if (p?.beforeEnter)
|
|
2289
2293
|
try {
|
|
2290
|
-
const _ = await p.beforeEnter(g,
|
|
2294
|
+
const _ = await p.beforeEnter(g, l);
|
|
2291
2295
|
if (typeof _ == "string") {
|
|
2292
|
-
await
|
|
2296
|
+
await w(_);
|
|
2293
2297
|
return;
|
|
2294
2298
|
}
|
|
2295
2299
|
if (_ === !1) return;
|
|
@@ -2298,53 +2302,53 @@ function mt(e) {
|
|
|
2298
2302
|
}
|
|
2299
2303
|
if (p?.onEnter)
|
|
2300
2304
|
try {
|
|
2301
|
-
const _ = await p.onEnter(g,
|
|
2305
|
+
const _ = await p.onEnter(g, l);
|
|
2302
2306
|
if (typeof _ == "string") {
|
|
2303
|
-
await
|
|
2307
|
+
await w(_);
|
|
2304
2308
|
return;
|
|
2305
2309
|
}
|
|
2306
2310
|
if (_ === !1) return;
|
|
2307
2311
|
} catch {
|
|
2308
2312
|
return;
|
|
2309
2313
|
}
|
|
2310
|
-
if (
|
|
2314
|
+
if (o.setState(g), p?.afterEnter)
|
|
2311
2315
|
try {
|
|
2312
|
-
p.afterEnter(g,
|
|
2316
|
+
p.afterEnter(g, l);
|
|
2313
2317
|
} catch {
|
|
2314
2318
|
}
|
|
2315
2319
|
} catch {
|
|
2316
2320
|
}
|
|
2317
2321
|
};
|
|
2318
|
-
f = async (b) =>
|
|
2322
|
+
f = async (b) => w(b), u = async (b) => w(b), d = () => {
|
|
2319
2323
|
};
|
|
2320
2324
|
}
|
|
2321
2325
|
return {
|
|
2322
|
-
store:
|
|
2326
|
+
store: o,
|
|
2323
2327
|
push: f,
|
|
2324
2328
|
replace: u,
|
|
2325
2329
|
back: d,
|
|
2326
|
-
subscribe:
|
|
2330
|
+
subscribe: o.subscribe,
|
|
2327
2331
|
matchRoute: ($) => W(t, $),
|
|
2328
|
-
getCurrent: () =>
|
|
2332
|
+
getCurrent: () => o.getState(),
|
|
2329
2333
|
resolveRouteComponent: yt
|
|
2330
2334
|
};
|
|
2331
2335
|
}
|
|
2332
2336
|
function Ct(e, t) {
|
|
2333
2337
|
return W(e, t);
|
|
2334
2338
|
}
|
|
2335
|
-
function
|
|
2336
|
-
const t =
|
|
2337
|
-
return
|
|
2339
|
+
function At(e) {
|
|
2340
|
+
const t = bt(e);
|
|
2341
|
+
return je("router-view", {
|
|
2338
2342
|
async render() {
|
|
2339
2343
|
if (!t) return U`<div>Router not initialized.</div>`;
|
|
2340
|
-
const r = t.getCurrent(), { path:
|
|
2344
|
+
const r = t.getCurrent(), { path: i } = r, n = t.matchRoute(i);
|
|
2341
2345
|
if (!n.route) return U`<div>Not found</div>`;
|
|
2342
2346
|
try {
|
|
2343
|
-
const
|
|
2344
|
-
if (typeof
|
|
2345
|
-
return { tag:
|
|
2346
|
-
if (typeof
|
|
2347
|
-
const
|
|
2347
|
+
const s = await t.resolveRouteComponent(n.route);
|
|
2348
|
+
if (typeof s == "string")
|
|
2349
|
+
return { tag: s, props: {}, children: [] };
|
|
2350
|
+
if (typeof s == "function") {
|
|
2351
|
+
const o = s(), a = o instanceof Promise ? await o : o;
|
|
2348
2352
|
return typeof a == "string" ? { tag: a, props: {}, children: [] } : a;
|
|
2349
2353
|
}
|
|
2350
2354
|
return U`<div>Invalid route component</div>`;
|
|
@@ -2357,7 +2361,7 @@ function Et(e) {
|
|
|
2357
2361
|
typeof r.requestRender == "function" && r.requestRender();
|
|
2358
2362
|
});
|
|
2359
2363
|
}
|
|
2360
|
-
}),
|
|
2364
|
+
}), je("router-link", {
|
|
2361
2365
|
state: {},
|
|
2362
2366
|
props: {
|
|
2363
2367
|
to: { type: String, default: "" },
|
|
@@ -2370,7 +2374,7 @@ function Et(e) {
|
|
|
2370
2374
|
disabled: { type: Boolean, default: !1 },
|
|
2371
2375
|
external: { type: Boolean, default: !1 },
|
|
2372
2376
|
class: { type: String, default: "" },
|
|
2373
|
-
style: { type: String, default:
|
|
2377
|
+
style: { type: String, default: Oe`
|
|
2374
2378
|
[aria-disabled="true"] {
|
|
2375
2379
|
pointer-events: none;
|
|
2376
2380
|
opacity: 0.5;
|
|
@@ -2379,22 +2383,22 @@ function Et(e) {
|
|
|
2379
2383
|
},
|
|
2380
2384
|
style: (r) => r.style,
|
|
2381
2385
|
render: (r) => {
|
|
2382
|
-
const
|
|
2383
|
-
for (const g of $)
|
|
2386
|
+
const i = t.getCurrent(), n = r.to, s = r.exact, o = r.exactActiveClass, a = r.activeClass, f = r.ariaCurrentValue, u = r.tag, d = r.disabled, y = r.external, c = i.path === n, h = s ? c : i && typeof i.path == "string" ? i.path.startsWith(n) : !1, k = c ? `aria-current="${f}"` : "", $ = (r.class || "").split(/\s+/).filter(Boolean), w = {};
|
|
2387
|
+
for (const g of $) w[g] = !0;
|
|
2384
2388
|
const b = {
|
|
2385
|
-
...
|
|
2389
|
+
...w,
|
|
2386
2390
|
// Also include the configurable names (may duplicate the above)
|
|
2387
2391
|
[a]: h,
|
|
2388
|
-
[
|
|
2389
|
-
},
|
|
2392
|
+
[o]: c
|
|
2393
|
+
}, m = u === "button", x = d ? m ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", l = y && (u === "a" || !u) ? 'target="_blank" rel="noopener noreferrer"' : "";
|
|
2390
2394
|
return U`
|
|
2391
|
-
${
|
|
2395
|
+
${Pe().when(m, U`
|
|
2392
2396
|
<button
|
|
2393
2397
|
part="button"
|
|
2394
2398
|
:class="${b}"
|
|
2395
|
-
${
|
|
2399
|
+
${k}
|
|
2396
2400
|
${x}
|
|
2397
|
-
${
|
|
2401
|
+
${l}
|
|
2398
2402
|
@click="navigate"
|
|
2399
2403
|
><slot></slot></button>
|
|
2400
2404
|
`).otherwise(U`
|
|
@@ -2402,44 +2406,44 @@ function Et(e) {
|
|
|
2402
2406
|
part="link"
|
|
2403
2407
|
href="${n}"
|
|
2404
2408
|
:class="${b}"
|
|
2405
|
-
${
|
|
2409
|
+
${k}
|
|
2406
2410
|
${x}
|
|
2407
|
-
${
|
|
2411
|
+
${l}
|
|
2408
2412
|
@click="navigate"
|
|
2409
2413
|
><slot></slot></a>
|
|
2410
2414
|
`).done()}
|
|
2411
2415
|
`;
|
|
2412
2416
|
},
|
|
2413
|
-
navigate: (r,
|
|
2414
|
-
if (
|
|
2417
|
+
navigate: (r, i) => {
|
|
2418
|
+
if (i.disabled) {
|
|
2415
2419
|
r.preventDefault();
|
|
2416
2420
|
return;
|
|
2417
2421
|
}
|
|
2418
|
-
|
|
2422
|
+
i.external && (i.tag === "a" || !i.tag) || (r.preventDefault(), i.replace ? t.replace(i.to) : t.push(i.to));
|
|
2419
2423
|
}
|
|
2420
2424
|
}), t;
|
|
2421
2425
|
}
|
|
2422
2426
|
export {
|
|
2423
2427
|
G as GlobalEventBus,
|
|
2424
|
-
|
|
2428
|
+
je as component,
|
|
2425
2429
|
$e as createStore,
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2430
|
+
Oe as css,
|
|
2431
|
+
kt as each,
|
|
2432
|
+
vt as emit,
|
|
2429
2433
|
re as eventBus,
|
|
2430
2434
|
U as html,
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2435
|
+
At as initRouter,
|
|
2436
|
+
Et as listen,
|
|
2437
|
+
Pe as match,
|
|
2434
2438
|
W as matchRoute,
|
|
2435
2439
|
Ct as matchRouteSSR,
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
+
_t as off,
|
|
2441
|
+
$t as on,
|
|
2442
|
+
St as once,
|
|
2443
|
+
Te as parseQuery,
|
|
2440
2444
|
he as renderToString,
|
|
2441
2445
|
yt as resolveRouteComponent,
|
|
2442
|
-
|
|
2443
|
-
|
|
2446
|
+
bt as useRouter,
|
|
2447
|
+
xt as when
|
|
2444
2448
|
};
|
|
2445
2449
|
//# sourceMappingURL=custom-elements-runtime.es.js.map
|