@jasonshimmy/custom-elements-runtime 0.1.13 → 0.1.15

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.
@@ -1,13 +1,13 @@
1
- function Ze(e, t) {
1
+ function Xe(e, t) {
2
2
  return F(e ? t : [], "when-block");
3
3
  }
4
- function Xe(e, t) {
4
+ function Ye(e, t) {
5
5
  return e.map((r, n) => {
6
6
  const o = typeof r == "object" ? r?.key ?? r?.id ?? `idx-${n}` : String(r);
7
7
  return F(t(r, n), `each-${o}`);
8
8
  });
9
9
  }
10
- function de() {
10
+ function pe() {
11
11
  const e = [];
12
12
  return {
13
13
  when(t, r) {
@@ -17,11 +17,11 @@ function de() {
17
17
  return e.push([!0, t]), this;
18
18
  },
19
19
  done() {
20
- return pe(...e);
20
+ return he(...e);
21
21
  }
22
22
  };
23
23
  }
24
- function pe(...e) {
24
+ function he(...e) {
25
25
  for (let t = 0; t < e.length; t++) {
26
26
  const [r, n] = e[t];
27
27
  if (r) return [F(n, `whenChain-branch-${t}`)];
@@ -160,8 +160,8 @@ class N extends EventTarget {
160
160
  this.eventCounters.clear();
161
161
  }
162
162
  }
163
- const P = N.getInstance(), Ye = (e, t) => P.emit(e, t), Ge = (e, t) => P.on(e, t), et = (e, t) => P.off(e, t), tt = (e, t) => P.once(e, t), rt = (e, t, r) => P.listen(e, t, r);
164
- function ee(e) {
163
+ const P = N.getInstance(), Ge = (e, t) => P.emit(e, t), et = (e, t) => P.on(e, t), tt = (e, t) => P.off(e, t), rt = (e, t) => P.once(e, t), nt = (e, t, r) => P.listen(e, t, r);
164
+ function te(e) {
165
165
  let t = { ...e };
166
166
  const r = [];
167
167
  function n(a) {
@@ -179,10 +179,10 @@ function ee(e) {
179
179
  }
180
180
  return { subscribe: n, getState: o, setState: s };
181
181
  }
182
- function G(e) {
182
+ function ee(e) {
183
183
  return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
184
184
  }
185
- function Z(e) {
185
+ function X(e) {
186
186
  return typeof e == "string" ? e.replace(
187
187
  /[&<>"']/g,
188
188
  (t) => ({
@@ -194,27 +194,27 @@ function Z(e) {
194
194
  })[t]
195
195
  ) : e;
196
196
  }
197
- function he(e, t, r) {
197
+ function ge(e, t, r) {
198
198
  if (r)
199
199
  for (const [n, o] of Object.entries(r)) {
200
200
  let s, i = {};
201
201
  if (Array.isArray(o) ? (s = o[0], i = o[1] || {}) : s = o, t.set(n, {
202
202
  callback: s,
203
203
  options: i,
204
- oldValue: X(e, n)
204
+ oldValue: Y(e, n)
205
205
  }), i.immediate)
206
206
  try {
207
- const a = X(e, n);
207
+ const a = Y(e, n);
208
208
  s(a, void 0, e);
209
209
  } catch (a) {
210
210
  console.error(`Error in immediate watcher for "${n}":`, a);
211
211
  }
212
212
  }
213
213
  }
214
- function X(e, t) {
214
+ function Y(e, t) {
215
215
  return t.split(".").reduce((r, n) => r?.[n], e);
216
216
  }
217
- function ge(e, t, r, n) {
217
+ function ye(e, t, r, n) {
218
218
  const o = (i, a) => {
219
219
  if (i === a) return !0;
220
220
  if (typeof i != typeof a || typeof i != "object" || i === null || a === null) return !1;
@@ -232,13 +232,13 @@ function ge(e, t, r, n) {
232
232
  for (const [i, a] of t.entries())
233
233
  if (a.options.deep && r.startsWith(i + "."))
234
234
  try {
235
- const c = X(e, i);
235
+ const c = Y(e, i);
236
236
  o(c, a.oldValue) || (a.callback(c, a.oldValue, e), a.oldValue = c);
237
237
  } catch (c) {
238
238
  console.error(`Error in deep watcher for "${i}":`, c);
239
239
  }
240
240
  }
241
- function ye(e, t, r) {
241
+ function me(e, t, r) {
242
242
  if (!t.props) return;
243
243
  function n(o, s) {
244
244
  return s === Boolean ? o === "true" : s === Number ? Number(o) : o;
@@ -247,18 +247,18 @@ function ye(e, t, r) {
247
247
  if (s.type === Function && typeof e[o] == "function")
248
248
  r[o] = e[o];
249
249
  else {
250
- const i = e.getAttribute(G(o));
251
- i !== null ? r[o] = Z(n(i, s.type)) : "default" in s && s.default !== void 0 && (r[o] = Z(s.default));
250
+ const i = e.getAttribute(ee(o));
251
+ i !== null ? r[o] = X(n(i, s.type)) : "default" in s && s.default !== void 0 && (r[o] = X(s.default));
252
252
  }
253
253
  });
254
254
  }
255
- function me(e, t, r, n) {
255
+ function be(e, t, r, n) {
256
256
  e.onConnected && !r && (e.onConnected(t), n(!0));
257
257
  }
258
- function be(e, t, r, n, o, s, i, a) {
258
+ function ve(e, t, r, n, o, s, i, a) {
259
259
  e.onDisconnected && e.onDisconnected(t), r.forEach((c) => c()), n(), o(), s(!1), i(null), a(!1);
260
260
  }
261
- function ve(e, t, r, n, o) {
261
+ function xe(e, t, r, n, o) {
262
262
  e.onAttributeChanged && e.onAttributeChanged(t, r, n, o);
263
263
  }
264
264
  function j(e, t) {
@@ -269,20 +269,20 @@ function j(e, t) {
269
269
  j(r, t);
270
270
  }
271
271
  }
272
- function R(e, t) {
272
+ function z(e, t) {
273
273
  return typeof t == "string" ? t.split(".").reduce((r, n) => r?.[n], e) : t;
274
274
  }
275
- function te(e, t, r) {
275
+ function re(e, t, r) {
276
276
  const n = t.split("."), o = n.pop();
277
277
  if (!o) return;
278
278
  const s = n.reduce((i, a) => (a in i || (i[a] = {}), i[a]), e);
279
279
  s[o] = r;
280
280
  }
281
- function xe(e, t, r, n, o, s, i) {
281
+ function we(e, t, r, n, o, s, i) {
282
282
  if (!s) return;
283
283
  const a = t.includes("lazy"), c = t.includes("trim"), f = t.includes("number"), h = () => {
284
284
  const g = s._state || s;
285
- return R(g, e);
285
+ return z(g, e);
286
286
  }, p = h();
287
287
  let l = "text";
288
288
  const x = n?.type;
@@ -345,10 +345,10 @@ function xe(e, t, r, n, o, s, i) {
345
345
  const w = Number(v);
346
346
  isNaN(w) || (v = w);
347
347
  }
348
- const d = s._state || s, $ = R(d, e);
348
+ const d = s._state || s, $ = z(d, e);
349
349
  if (Array.isArray(v) && Array.isArray($) ? JSON.stringify([...v].sort()) !== JSON.stringify([...$].sort()) : v !== $) {
350
350
  const w = g.target;
351
- w._modelUpdating = !0, te(d, e, v), setTimeout(() => {
351
+ w._modelUpdating = !0, re(d, e, v), setTimeout(() => {
352
352
  w._modelUpdating = !1;
353
353
  }, 0), s._requestRender && s._requestRender();
354
354
  }
@@ -366,17 +366,17 @@ function xe(e, t, r, n, o, s, i) {
366
366
  const _ = Number(d);
367
367
  isNaN(_) || (d = _);
368
368
  }
369
- const $ = s._state || s, k = R($, e);
369
+ const $ = s._state || s, k = z($, e);
370
370
  (Array.isArray(d) && Array.isArray(k) ? JSON.stringify([...d].sort()) !== JSON.stringify([...k].sort()) : d !== k) && (v && (v._modelUpdating = !0, setTimeout(() => {
371
371
  v._modelUpdating = !1;
372
- }, 0)), te($, e, d), s._requestRender && s._requestRender());
372
+ }, 0)), re($, e, d), s._requestRender && s._requestRender());
373
373
  }
374
374
  }, 0);
375
375
  };
376
376
  o.compositionstart = g, o.compositionend = u;
377
377
  }
378
378
  }
379
- function we(e, t, r, n) {
379
+ function ke(e, t, r, n) {
380
380
  if (n) {
381
381
  if (typeof e == "object" && e !== null)
382
382
  for (const [o, s] of Object.entries(e))
@@ -390,14 +390,14 @@ function we(e, t, r, n) {
390
390
  return;
391
391
  }
392
392
  } catch {
393
- const o = R(n, e);
393
+ const o = z(n, e);
394
394
  r[e] = o;
395
395
  }
396
396
  }
397
397
  }
398
- function ke(e, t, r) {
398
+ function $e(e, t, r) {
399
399
  if (!r) return;
400
- const n = R(r, e), o = t.style || "", s = n ? "" : "none";
400
+ const n = z(r, e), o = t.style || "", s = n ? "" : "none";
401
401
  if (o) {
402
402
  const i = o.split(";").filter(Boolean), a = i.findIndex(
403
403
  (c) => c.trim().startsWith("display:")
@@ -406,19 +406,19 @@ function ke(e, t, r) {
406
406
  } else
407
407
  t.style = `display: ${s}`;
408
408
  }
409
- function $e(e, t, r) {
409
+ function _e(e, t, r) {
410
410
  if (!r) return;
411
- const n = R(r, e);
411
+ const n = z(r, e);
412
412
  let o = [];
413
413
  typeof n == "string" ? o = [n] : Array.isArray(n) ? o = n.filter(Boolean) : typeof n == "object" && (o = Object.entries(n).filter(([, a]) => !!a).flatMap(([a]) => a.split(/\s+/).filter(Boolean)));
414
414
  const s = t.class || "", i = s ? `${s} ${o.join(" ")}`.trim() : o.join(" ");
415
415
  i && (t.class = i);
416
416
  }
417
- function _e(e, t, r) {
417
+ function Se(e, t, r) {
418
418
  let n;
419
419
  if (typeof e == "string") {
420
420
  if (!r) return;
421
- n = R(r, e);
421
+ n = z(r, e);
422
422
  } else
423
423
  n = e;
424
424
  let o = "";
@@ -465,13 +465,13 @@ function _e(e, t, r) {
465
465
  const s = t.style || "";
466
466
  t.style = s + (s && !s.endsWith(";") ? "; " : "") + o;
467
467
  }
468
- function ce(e, t, r, n) {
468
+ function fe(e, t, r, n) {
469
469
  const o = {}, s = { ...n || {} }, i = {};
470
470
  for (const [a, c] of Object.entries(e)) {
471
471
  const { value: f, modifiers: h } = c;
472
472
  switch (a) {
473
473
  case "model":
474
- xe(
474
+ we(
475
475
  typeof f == "string" ? f : String(f),
476
476
  h,
477
477
  o,
@@ -482,22 +482,22 @@ function ce(e, t, r, n) {
482
482
  );
483
483
  break;
484
484
  case "bind":
485
- we(f, o, s, t);
485
+ ke(f, o, s, t);
486
486
  break;
487
487
  case "show":
488
- ke(f, s, t);
488
+ $e(f, s, t);
489
489
  break;
490
490
  case "class":
491
- $e(f, s, t);
491
+ _e(f, s, t);
492
492
  break;
493
493
  case "style":
494
- _e(f, s, t);
494
+ Se(f, s, t);
495
495
  break;
496
496
  }
497
497
  }
498
498
  return { props: o, attrs: s, listeners: i };
499
499
  }
500
- function Y(e, t) {
500
+ function G(e, t) {
501
501
  if (Array.isArray(e)) {
502
502
  const s = /* @__PURE__ */ new Set();
503
503
  return e.map((i) => {
@@ -512,15 +512,15 @@ function Y(e, t) {
512
512
  c = `${a}#${f++}`;
513
513
  s.add(c);
514
514
  let h = i.children;
515
- return Array.isArray(h) && (h = Y(h, c)), { ...i, key: c, children: h };
515
+ return Array.isArray(h) && (h = G(h, c)), { ...i, key: c, children: h };
516
516
  });
517
517
  }
518
518
  const r = e;
519
519
  let n = r.props?.key ?? r.key ?? t, o = r.children;
520
- return Array.isArray(o) && (o = Y(o, n)), { ...r, key: n, children: o };
520
+ return Array.isArray(o) && (o = G(o, n)), { ...r, key: n, children: o };
521
521
  }
522
- function Se(e, t, r, n) {
523
- const o = r.directives ?? {}, s = ce(
522
+ function Ce(e, t, r, n) {
523
+ const o = r.directives ?? {}, s = fe(
524
524
  o,
525
525
  n,
526
526
  e,
@@ -570,7 +570,7 @@ function A(e, t, r) {
570
570
  }
571
571
  const n = document.createElement(e.tag);
572
572
  e.key != null && (n.key = e.key);
573
- const { props: o = {}, attrs: s = {}, directives: i = {} } = e.props ?? {}, a = ce(i, t, n, s), c = {
573
+ const { props: o = {}, attrs: s = {}, directives: i = {} } = e.props ?? {}, a = fe(i, t, n, s), c = {
574
574
  ...o,
575
575
  ...a.props
576
576
  }, f = {
@@ -614,7 +614,7 @@ function A(e, t, r) {
614
614
  else typeof e.children == "string" && (n.textContent = e.children);
615
615
  return n;
616
616
  }
617
- function Ce(e, t, r, n, o) {
617
+ function Ee(e, t, r, n, o) {
618
618
  if (typeof r == "string") {
619
619
  e.textContent !== r && (e.textContent = r);
620
620
  return;
@@ -761,20 +761,20 @@ function H(e, t, r, n, o) {
761
761
  }
762
762
  if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && t.key === r.key) {
763
763
  const i = e;
764
- return Se(i, t.props || {}, r.props || {}, n), Ce(i, t.children, r.children, n, o), typeof r != "string" && r.props?.ref && o && (o[r.props.ref] = i), i;
764
+ return Ce(i, t.props || {}, r.props || {}, n), Ee(i, t.children, r.children, n, o), typeof r != "string" && r.props?.ref && o && (o[r.props.ref] = i), i;
765
765
  }
766
766
  j(e, o);
767
767
  const s = A(r, n, o);
768
768
  return typeof r != "string" && r.props?.ref && o && (o[r.props.ref] = s), e.parentNode?.replaceChild(s, e), s;
769
769
  }
770
- function Ee(e, t, r, n) {
770
+ function Ae(e, t, r, n) {
771
771
  let o;
772
772
  Array.isArray(t) ? t.length === 1 ? (o = t[0], o && typeof o == "object" && o.key == null && (o = { ...o, key: "__root__" })) : o = { tag: "div", key: "__root__", children: t } : (o = t, o && typeof o == "object" && o.key == null && (o = { ...o, key: "__root__" })), o && typeof o == "object" && o.tag === "#anchor" && (o = {
773
773
  tag: "div",
774
774
  key: "__anchor_root__",
775
775
  props: { attrs: { "data-anchor-block-root": "", key: "__anchor_root__" } },
776
776
  children: [o]
777
- }), o = Y(o, String(o.key ?? "root"));
777
+ }), o = G(o, String(o.key ?? "root"));
778
778
  const s = e._prevVNode ?? null, i = e._prevDom ?? e.firstChild ?? null;
779
779
  let a;
780
780
  s && i ? typeof s != "string" && typeof o != "string" && s.tag === o.tag && s.key === o.key ? a = H(i, s, o, r, n) : (a = A(o, r, n), e.replaceChild(a, i)) : (a = A(o, r, n), e.firstChild ? e.replaceChild(a, e.firstChild) : e.appendChild(a));
@@ -785,23 +785,23 @@ function Ee(e, t, r, n) {
785
785
  }
786
786
  c.forEach((f) => e.removeChild(f)), e._prevVNode = o, e._prevDom = a;
787
787
  }
788
- function fe(e, ...t) {
788
+ function ue(e, ...t) {
789
789
  let r = "";
790
790
  for (let n = 0; n < e.length; n++)
791
791
  r += e[n], n < t.length && (r += t[n]);
792
792
  return r;
793
793
  }
794
- function ue(e) {
794
+ function de(e) {
795
795
  return e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;}/g, "}").trim();
796
796
  }
797
797
  let W = null;
798
- function re() {
799
- return W || (W = new CSSStyleSheet(), W.replaceSync(ue(Te))), W;
798
+ function ne() {
799
+ return W || (W = new CSSStyleSheet(), W.replaceSync(de(Le))), W;
800
800
  }
801
- function Ae(e) {
801
+ function Te(e) {
802
802
  return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi, "").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, "").replace(/expression\s*\([^)]*\)/gi, "");
803
803
  }
804
- const Te = fe`
804
+ const Le = ue`
805
805
  :host, *, ::before, ::after {
806
806
  all: isolate;
807
807
  box-sizing: border-box;
@@ -859,7 +859,7 @@ const Te = fe`
859
859
  sup { top: -.5em }
860
860
  [disabled], [aria-disabled=true] { cursor: not-allowed }
861
861
  [hidden] { display: none }
862
- `, Le = {
862
+ `, je = {
863
863
  gray: {
864
864
  50: "var(--color-gray-50, #f9fafb)",
865
865
  100: "var(--color-gray-100, #f3f4f6)",
@@ -1167,8 +1167,15 @@ const Te = fe`
1167
1167
  /* Transition Delay/Property */
1168
1168
  "transition-colors": "transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;",
1169
1169
  "transition-opacity": "transition-property:opacity;",
1170
- "transition-transform": "transition-property:transform;"
1171
- }, je = "0.25rem", ne = {
1170
+ "transition-transform": "transition-property:transform;",
1171
+ /* Z-index */
1172
+ "z-0": "z-index:0;",
1173
+ "z-10": "z-index:10;",
1174
+ "z-20": "z-index:20;",
1175
+ "z-30": "z-index:30;",
1176
+ "z-40": "z-index:40;",
1177
+ "z-50": "z-index:50;"
1178
+ }, ze = "0.25rem", oe = {
1172
1179
  m: ["margin"],
1173
1180
  mx: ["margin-inline"],
1174
1181
  my: ["margin-block"],
@@ -1225,7 +1232,7 @@ const Te = fe`
1225
1232
  "peer-focus": (e, t) => `.peer:focus ~ ${e}{${t}}`,
1226
1233
  "peer-checked": (e, t) => `.peer:checked ~ ${e}{${t}}`,
1227
1234
  "peer-disabled": (e, t) => `.peer:disabled ~ ${e}{${t}}`
1228
- }, oe = {
1235
+ }, ie = {
1229
1236
  // Responsive
1230
1237
  sm: "(min-width:640px)",
1231
1238
  md: "(min-width:768px)",
@@ -1239,18 +1246,18 @@ function V(e) {
1239
1246
  const t = e.startsWith("-"), n = (t ? e.slice(1) : e).split("-");
1240
1247
  if (n.length < 2) return null;
1241
1248
  const o = n.slice(0, -1).join("-"), s = n[n.length - 1], i = parseFloat(s);
1242
- if (Number.isNaN(i) || !ne[o]) return null;
1249
+ if (Number.isNaN(i) || !oe[o]) return null;
1243
1250
  const a = t ? "-" : "";
1244
- return ne[o].map((c) => `${c}:calc(${a}${je} * ${i});`).join("");
1251
+ return oe[o].map((c) => `${c}:calc(${a}${ze} * ${i});`).join("");
1245
1252
  }
1246
- function ie(e) {
1253
+ function se(e) {
1247
1254
  const t = e.replace("#", ""), r = parseInt(t, 16), n = r >> 16 & 255, o = r >> 8 & 255, s = r & 255;
1248
1255
  return `${n} ${o} ${s}`;
1249
1256
  }
1250
- function ze(e) {
1257
+ function Be(e) {
1251
1258
  const t = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
1252
1259
  if (!t) return null;
1253
- const [, r, n, o = "DEFAULT"] = t, s = Le[n]?.[o];
1260
+ const [, r, n, o = "DEFAULT"] = t, s = je[n]?.[o];
1254
1261
  return s ? `${{
1255
1262
  bg: "background-color",
1256
1263
  decoration: "text-decoration-color",
@@ -1265,19 +1272,19 @@ function ze(e) {
1265
1272
  stroke: "stroke-color"
1266
1273
  }[r]}:${s};` : null;
1267
1274
  }
1268
- function Be(e) {
1275
+ function Ne(e) {
1269
1276
  const [t, r] = e.split("/");
1270
1277
  if (!r) return { base: t };
1271
1278
  const n = parseInt(r, 10);
1272
1279
  return isNaN(n) || n < 0 || n > 100 ? { base: t } : { base: t, opacity: n / 100 };
1273
1280
  }
1274
1281
  function J(e) {
1275
- const { base: t, opacity: r } = Be(e), n = ze(t);
1282
+ const { base: t, opacity: r } = Ne(e), n = Be(t);
1276
1283
  if (n) {
1277
1284
  if (r !== void 0) {
1278
1285
  const s = /#([0-9a-f]{6})/i.exec(n);
1279
1286
  if (s) {
1280
- const i = ie(s[0]);
1287
+ const i = se(s[0]);
1281
1288
  return n.replace(/#([0-9a-f]{6})/i, `rgb(${i} / ${r})`);
1282
1289
  }
1283
1290
  }
@@ -1287,12 +1294,18 @@ function J(e) {
1287
1294
  if (o && r !== void 0) {
1288
1295
  const s = /#([0-9a-f]{6})/i.exec(o);
1289
1296
  if (s) {
1290
- const i = ie(s[0]);
1297
+ const i = se(s[0]);
1291
1298
  return o.replace(/#([0-9a-f]{6})/i, `rgb(${i} / ${r})`);
1292
1299
  }
1293
1300
  }
1294
1301
  return o;
1295
1302
  }
1303
+ function Q(e) {
1304
+ const t = /^opacity-(\d{1,3})$/.exec(e);
1305
+ if (!t) return null;
1306
+ const r = parseInt(t[1], 10);
1307
+ return r < 0 || r > 100 ? null : `opacity:${r / 100};`;
1308
+ }
1296
1309
  function q(e) {
1297
1310
  const t = e.indexOf("-["), r = e.endsWith("]");
1298
1311
  if (t > 0 && r) {
@@ -1343,13 +1356,13 @@ function q(e) {
1343
1356
  }
1344
1357
  return null;
1345
1358
  }
1346
- function Ne(e) {
1359
+ function Me(e) {
1347
1360
  return e.startsWith("[") && e.endsWith("]") ? e : e.indexOf("-[") > 0 && e.endsWith("]") ? e.replace(/_/g, "-") : null;
1348
1361
  }
1349
- function Me(e) {
1362
+ function Oe(e) {
1350
1363
  return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
1351
1364
  }
1352
- function Oe(e) {
1365
+ function Pe(e) {
1353
1366
  const t = /class\s*=\s*["']([^"']+)["']/g, r = [];
1354
1367
  let n;
1355
1368
  for (; n = t.exec(e); ) {
@@ -1358,11 +1371,11 @@ function Oe(e) {
1358
1371
  }
1359
1372
  return r.filter(Boolean);
1360
1373
  }
1361
- const se = /* @__PURE__ */ new Map(), Pe = 16;
1362
- function We(e) {
1363
- const t = Date.now(), r = se.get(e);
1364
- if (r && t - r.timestamp < Pe) return r.css;
1365
- const n = Oe(e), o = new Set(n), s = [], i = [], a = [], c = [], f = {};
1374
+ const ae = /* @__PURE__ */ new Map(), We = 16;
1375
+ function De(e) {
1376
+ const t = Date.now(), r = ae.get(e);
1377
+ if (r && t - r.timestamp < We) return r.css;
1378
+ const n = Pe(e), o = new Set(n), s = [], i = [], a = [], c = [], f = {};
1366
1379
  function h(y, b = !1) {
1367
1380
  const g = (b ? "dark|" : "") + y;
1368
1381
  if (g in f) return f[g];
@@ -1375,18 +1388,18 @@ function We(e) {
1375
1388
  }
1376
1389
  function l(y, b = !1) {
1377
1390
  const g = y.split(":"), u = g.find(
1378
- (C) => K[C] || V(C) || J(C) || q(C)
1391
+ (C) => K[C] || V(C) || Q(C) || J(C) || q(C)
1379
1392
  );
1380
1393
  if (!u) return null;
1381
- const m = K[u] ?? V(u) ?? J(u) ?? q(u);
1394
+ const m = K[u] ?? V(u) ?? Q(u) ?? J(u) ?? q(u);
1382
1395
  if (!m) return null;
1383
- let v = `.${Me(y)}`, d = m;
1396
+ let v = `.${Oe(y)}`, d = m;
1384
1397
  const $ = g.indexOf(u);
1385
1398
  let k = $ >= 0 ? g.slice(0, $) : [];
1386
1399
  b && (k = k.filter((C) => C !== "dark"));
1387
1400
  const w = k.filter((C) => U.includes(C)), _ = w.length ? w[w.length - 1] : null;
1388
1401
  for (const C of k) {
1389
- const E = Ne(C);
1402
+ const E = Me(C);
1390
1403
  if (E) {
1391
1404
  v = `${E}${v}`;
1392
1405
  continue;
@@ -1396,11 +1409,11 @@ function We(e) {
1396
1409
  typeof L == "function" && (v = L(v, d).replace(/\{.*$/, ""));
1397
1410
  }
1398
1411
  let S = `${v}{${d}}`;
1399
- return b && _ ? S = `@media (prefers-color-scheme: dark) and ${oe[_]}{${S}}` : b ? S = `@media (prefers-color-scheme: dark){${S}}` : _ && (S = `@media ${oe[_]}{${S}}`), S;
1412
+ return b && _ ? S = `@media (prefers-color-scheme: dark) and ${ie[_]}{${S}}` : b ? S = `@media (prefers-color-scheme: dark){${S}}` : _ && (S = `@media ${ie[_]}{${S}}`), S;
1400
1413
  }
1401
1414
  for (const y of o) {
1402
1415
  const b = y.split(":"), g = b.find(
1403
- (d) => K[d] || V(d) || J(d) || q(d)
1416
+ (d) => K[d] || V(d) || Q(d) || J(d) || q(d)
1404
1417
  );
1405
1418
  if (!g) continue;
1406
1419
  const u = b.indexOf(g), m = u >= 0 ? b.slice(0, u) : [], v = p(m);
@@ -1413,45 +1426,45 @@ function We(e) {
1413
1426
  }
1414
1427
  }
1415
1428
  const x = [...s, ...i, ...a, ...c].join("");
1416
- return se.set(e, { css: x, timestamp: t }), x;
1429
+ return ae.set(e, { css: x, timestamp: t }), x;
1417
1430
  }
1418
1431
  const O = [];
1419
- function De(e, t, r, n, o, s, i, a) {
1432
+ function He(e, t, r, n, o, s, i, a) {
1420
1433
  if (e) {
1421
1434
  O.push(r);
1422
1435
  try {
1423
1436
  if (t.loadingTemplate && r.isLoading) {
1424
- z(e, t.loadingTemplate(r), r, n, o);
1437
+ R(e, t.loadingTemplate(r), r, n, o);
1425
1438
  return;
1426
1439
  }
1427
1440
  if (t.errorTemplate && r.hasError) {
1428
- r.error instanceof Error && z(e, t.errorTemplate(r.error, r), r, n, o);
1441
+ r.error instanceof Error && R(e, t.errorTemplate(r.error, r), r, n, o);
1429
1442
  return;
1430
1443
  }
1431
1444
  const c = t.render(r);
1432
1445
  if (c instanceof Promise) {
1433
1446
  s(!0), c.then((f) => {
1434
- s(!1), i(null), z(e, f, r, n, o), a(e.innerHTML);
1447
+ s(!1), i(null), R(e, f, r, n, o), a(e.innerHTML);
1435
1448
  }).catch((f) => {
1436
- s(!1), i(f), t.errorTemplate && z(e, t.errorTemplate(f, r), r, n, o);
1437
- }), t.loadingTemplate && z(e, t.loadingTemplate(r), r, n, o);
1449
+ s(!1), i(f), t.errorTemplate && R(e, t.errorTemplate(f, r), r, n, o);
1450
+ }), t.loadingTemplate && R(e, t.loadingTemplate(r), r, n, o);
1438
1451
  return;
1439
1452
  }
1440
- z(e, c, r, n, o), a(e.innerHTML);
1453
+ R(e, c, r, n, o), a(e.innerHTML);
1441
1454
  } finally {
1442
1455
  O.pop();
1443
1456
  }
1444
1457
  }
1445
1458
  }
1446
- function z(e, t, r, n, o) {
1447
- e && (Ee(
1459
+ function R(e, t, r, n, o) {
1460
+ e && (Ae(
1448
1461
  e,
1449
1462
  Array.isArray(t) ? t : [t],
1450
1463
  r,
1451
1464
  n
1452
1465
  ), o(e.innerHTML));
1453
1466
  }
1454
- function He(e, t, r, n, o, s, i) {
1467
+ function qe(e, t, r, n, o, s, i) {
1455
1468
  if (s !== null && clearTimeout(s), Date.now() - t < 16) {
1456
1469
  if (o(r + 1), r > 10) {
1457
1470
  console.warn("Potential infinite render loop detected. Skipping render."), i(null);
@@ -1464,32 +1477,32 @@ function He(e, t, r, n, o, s, i) {
1464
1477
  }, 0);
1465
1478
  i(c);
1466
1479
  }
1467
- function qe(e, t, r, n, o, s) {
1480
+ function Ie(e, t, r, n, o, s) {
1468
1481
  if (!e) return;
1469
- const i = We(n);
1482
+ const i = De(n);
1470
1483
  if (!t.style && (!i || i.trim() === "")) {
1471
- s(null), e.adoptedStyleSheets = [re()];
1484
+ s(null), e.adoptedStyleSheets = [ne()];
1472
1485
  return;
1473
1486
  }
1474
1487
  let a = "";
1475
1488
  t.style && (typeof t.style == "string" ? a = t.style : typeof t.style == "function" && (a = t.style(r)));
1476
- let c = Ae(`${a}
1489
+ let c = Te(`${a}
1477
1490
  ${i}
1478
1491
  `);
1479
- c = ue(c);
1492
+ c = de(c);
1480
1493
  let f = o;
1481
- f || (f = new CSSStyleSheet()), (f.cssRules.length === 0 || f.toString() !== c) && f.replaceSync(c), e.adoptedStyleSheets = [re(), f], s(f);
1494
+ f || (f = new CSSStyleSheet()), (f.cssRules.length === 0 || f.toString() !== c) && f.replaceSync(c), e.adoptedStyleSheets = [ne(), f], s(f);
1482
1495
  }
1483
- const Ie = /* @__PURE__ */ new Map();
1484
- function ae(e, t, r) {
1485
- let n = G(e);
1496
+ const Fe = /* @__PURE__ */ new Map();
1497
+ function le(e, t, r) {
1498
+ let n = ee(e);
1486
1499
  n.includes("-") || (n = `cer-${n}`);
1487
1500
  let o;
1488
1501
  typeof t == "function" ? o = { ...r, render: t } : o = t, typeof o.onError != "function" && (o.onError = (s, i) => {
1489
1502
  console.error(`[${n}] Error:`, s, i);
1490
- }), Ie.set(n, o), typeof window < "u" && !customElements.get(n) && customElements.define(n, Fe(o));
1503
+ }), Fe.set(n, o), typeof window < "u" && !customElements.get(n) && customElements.define(n, Ke(o));
1491
1504
  }
1492
- function Fe(e) {
1505
+ function Ke(e) {
1493
1506
  if (!e.render)
1494
1507
  throw new Error(
1495
1508
  "Component must have a render function"
@@ -1576,7 +1589,7 @@ function Fe(e) {
1576
1589
  }
1577
1590
  connectedCallback() {
1578
1591
  this._runLogicWithinErrorBoundary(e, () => {
1579
- me(
1592
+ be(
1580
1593
  e,
1581
1594
  this.context,
1582
1595
  this._mounted,
@@ -1588,7 +1601,7 @@ function Fe(e) {
1588
1601
  }
1589
1602
  disconnectedCallback() {
1590
1603
  this._runLogicWithinErrorBoundary(e, () => {
1591
- be(
1604
+ ve(
1592
1605
  e,
1593
1606
  this.context,
1594
1607
  this._listeners,
@@ -1612,7 +1625,7 @@ function Fe(e) {
1612
1625
  }
1613
1626
  attributeChangedCallback(t, r, n) {
1614
1627
  this._runLogicWithinErrorBoundary(e, () => {
1615
- this._applyProps(e), ve(
1628
+ this._applyProps(e), xe(
1616
1629
  e,
1617
1630
  t,
1618
1631
  r,
@@ -1622,7 +1635,7 @@ function Fe(e) {
1622
1635
  });
1623
1636
  }
1624
1637
  static get observedAttributes() {
1625
- return e.props ? Object.keys(e.props).map(G) : [];
1638
+ return e.props ? Object.keys(e.props).map(ee) : [];
1626
1639
  }
1627
1640
  _applyComputed(t) {
1628
1641
  this._runLogicWithinErrorBoundary(e, () => {
@@ -1630,7 +1643,7 @@ function Fe(e) {
1630
1643
  Object.defineProperty(this.context, r, {
1631
1644
  get: () => {
1632
1645
  const o = n(this.context);
1633
- return Z(o);
1646
+ return X(o);
1634
1647
  },
1635
1648
  enumerable: !0
1636
1649
  });
@@ -1640,7 +1653,7 @@ function Fe(e) {
1640
1653
  // --- Render ---
1641
1654
  _render(t) {
1642
1655
  this._runLogicWithinErrorBoundary(t, () => {
1643
- De(
1656
+ He(
1644
1657
  this.shadowRoot,
1645
1658
  t,
1646
1659
  this.context,
@@ -1663,7 +1676,7 @@ function Fe(e) {
1663
1676
  }
1664
1677
  _requestRender() {
1665
1678
  this._runLogicWithinErrorBoundary(this._cfg, () => {
1666
- He(
1679
+ qe(
1667
1680
  () => this._render(this._cfg),
1668
1681
  this._lastRenderTime,
1669
1682
  this._renderCount,
@@ -1683,7 +1696,7 @@ function Fe(e) {
1683
1696
  // --- Style ---
1684
1697
  _applyStyle(t, r) {
1685
1698
  this._runLogicWithinErrorBoundary(t, () => {
1686
- qe(
1699
+ Ie(
1687
1700
  this.shadowRoot,
1688
1701
  t,
1689
1702
  this.context,
@@ -1769,7 +1782,7 @@ function Fe(e) {
1769
1782
  }
1770
1783
  _initWatchers(t) {
1771
1784
  this._runLogicWithinErrorBoundary(t, () => {
1772
- he(
1785
+ ge(
1773
1786
  this.context,
1774
1787
  this._watchers,
1775
1788
  t.watch || {}
@@ -1777,12 +1790,12 @@ function Fe(e) {
1777
1790
  });
1778
1791
  }
1779
1792
  _triggerWatchers(t, r) {
1780
- ge(this.context, this._watchers, t, r);
1793
+ ye(this.context, this._watchers, t, r);
1781
1794
  }
1782
1795
  _applyProps(t) {
1783
1796
  this._runLogicWithinErrorBoundary(t, () => {
1784
1797
  try {
1785
- ye(this, t, this.context);
1798
+ me(this, t, this.context);
1786
1799
  } catch (r) {
1787
1800
  this._hasError = !0, t.onError && t.onError(r, this.context), t.errorFallback && this.shadowRoot && (this.shadowRoot.innerHTML = t.errorFallback(r, this.context));
1788
1801
  }
@@ -1800,10 +1813,10 @@ function I(e) {
1800
1813
  function D(e) {
1801
1814
  return typeof e == "object" && e !== null && "tag" in e && !I(e);
1802
1815
  }
1803
- function Ke(e, t) {
1816
+ function Ue(e, t) {
1804
1817
  return e.key != null ? e : { ...e, key: t };
1805
1818
  }
1806
- function Ue(e, t = [], r = {}) {
1819
+ function Ve(e, t = [], r = {}) {
1807
1820
  const n = {}, o = {}, s = {}, i = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
1808
1821
  let a;
1809
1822
  for (; a = i.exec(e); ) {
@@ -1828,7 +1841,7 @@ function Ue(e, t = [], r = {}) {
1828
1841
  }
1829
1842
  return { props: n, attrs: o, directives: s };
1830
1843
  }
1831
- function Ve(e, t, r) {
1844
+ function Je(e, t, r) {
1832
1845
  const n = O.length > 0 ? O[O.length - 1] : void 0, o = r ?? n;
1833
1846
  function s(d, $) {
1834
1847
  return M("#text", {}, d, $);
@@ -1868,7 +1881,7 @@ function Ve(e, t, r) {
1868
1881
  return;
1869
1882
  }
1870
1883
  if (D(d)) {
1871
- k.push(Ke(d, void 0));
1884
+ k.push(Ue(d, void 0));
1872
1885
  return;
1873
1886
  }
1874
1887
  if (Array.isArray(d)) {
@@ -1907,7 +1920,7 @@ function Ve(e, t, r) {
1907
1920
  props: w,
1908
1921
  attrs: _,
1909
1922
  directives: S
1910
- } = Ue(f[2] || "", t, o), C = { props: {}, attrs: {} };
1923
+ } = Ve(f[2] || "", t, o), C = { props: {}, attrs: {} };
1911
1924
  for (const E in w) C.props[E] = w[E];
1912
1925
  for (const E in _) C.attrs[E] = _[E];
1913
1926
  if (Object.keys(S).length > 0 && (C.directives = { ...S }), $) {
@@ -1946,9 +1959,9 @@ function Ve(e, t, r) {
1946
1959
  }
1947
1960
  function B(e, ...t) {
1948
1961
  const r = t[t.length - 1], n = typeof r == "object" && r && !Array.isArray(r) ? r : void 0;
1949
- return Ve(e, t, n);
1962
+ return Je(e, t, n);
1950
1963
  }
1951
- const le = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, T = (e, t) => {
1964
+ const ce = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, T = (e, t) => {
1952
1965
  for (const r of e) {
1953
1966
  const n = [], o = r.path.replace(/:[^/]+/g, (a) => (n.push(a.slice(1)), "([^/]+)")), s = new RegExp(`^${o}$`), i = t.match(s);
1954
1967
  if (i) {
@@ -1959,21 +1972,21 @@ const le = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new
1959
1972
  }
1960
1973
  }
1961
1974
  return { route: null, params: {} };
1962
- }, Q = {};
1963
- async function Je(e) {
1975
+ }, Z = {};
1976
+ async function Qe(e) {
1964
1977
  if (e.component) return e.component;
1965
1978
  if (e.load) {
1966
- if (Q[e.path]) return Q[e.path];
1979
+ if (Z[e.path]) return Z[e.path];
1967
1980
  try {
1968
1981
  const t = await e.load();
1969
- return Q[e.path] = t.default, t.default;
1982
+ return Z[e.path] = t.default, t.default;
1970
1983
  } catch {
1971
1984
  throw new Error(`Failed to load component for route: ${e.path}`);
1972
1985
  }
1973
1986
  }
1974
1987
  throw new Error(`No component or loader defined for route: ${e.path}`);
1975
1988
  }
1976
- function Qe(e) {
1989
+ function Ze(e) {
1977
1990
  const { routes: t, base: r = "", initialUrl: n } = e;
1978
1991
  let o, s, i, a, c, f, h;
1979
1992
  const p = async (b, g) => {
@@ -2024,11 +2037,11 @@ function Qe(e) {
2024
2037
  };
2025
2038
  if (typeof window < "u" && typeof document < "u") {
2026
2039
  o = () => {
2027
- const g = new URL(window.location.href), u = g.pathname.replace(r, "") || "/", m = le(g.search);
2040
+ const g = new URL(window.location.href), u = g.pathname.replace(r, "") || "/", m = ce(g.search);
2028
2041
  return { path: u, query: m };
2029
2042
  }, s = o();
2030
2043
  const b = T(t, s.path);
2031
- i = ee({
2044
+ i = te({
2032
2045
  path: s.path,
2033
2046
  params: b.params,
2034
2047
  query: s.query
@@ -2038,11 +2051,11 @@ function Qe(e) {
2038
2051
  }, window.addEventListener("popstate", () => a(!0)), c = (g) => y(g, !1), f = (g) => y(g, !0), h = () => window.history.back();
2039
2052
  } else {
2040
2053
  o = () => {
2041
- const u = new URL(n || "/", "http://localhost"), m = u.pathname.replace(r, "") || "/", v = le(u.search);
2054
+ const u = new URL(n || "/", "http://localhost"), m = u.pathname.replace(r, "") || "/", v = ce(u.search);
2042
2055
  return { path: m, query: v };
2043
2056
  }, s = o();
2044
2057
  const b = T(t, s.path);
2045
- i = ee({
2058
+ i = te({
2046
2059
  path: s.path,
2047
2060
  params: b.params,
2048
2061
  query: s.query
@@ -2103,15 +2116,15 @@ function Qe(e) {
2103
2116
  subscribe: i.subscribe,
2104
2117
  matchRoute: (b) => T(t, b),
2105
2118
  getCurrent: () => i.getState(),
2106
- resolveRouteComponent: Je
2119
+ resolveRouteComponent: Qe
2107
2120
  };
2108
2121
  }
2109
- function nt(e, t) {
2122
+ function ot(e, t) {
2110
2123
  return T(e, t);
2111
2124
  }
2112
- function ot(e) {
2113
- const t = Qe(e);
2114
- return ae("router-view", {
2125
+ function it(e) {
2126
+ const t = Ze(e);
2127
+ return le("router-view", {
2115
2128
  async render() {
2116
2129
  if (!t) return B`<div>Router not initialized.</div>`;
2117
2130
  const r = t.getCurrent(), { path: n } = r, o = t.matchRoute(n);
@@ -2128,7 +2141,7 @@ function ot(e) {
2128
2141
  typeof r.requestRender == "function" && r.requestRender();
2129
2142
  });
2130
2143
  }
2131
- }), ae("router-link", {
2144
+ }), le("router-link", {
2132
2145
  state: {},
2133
2146
  props: {
2134
2147
  to: { type: String, default: "" },
@@ -2141,7 +2154,7 @@ function ot(e) {
2141
2154
  disabled: { type: Boolean, default: !1 },
2142
2155
  external: { type: Boolean, default: !1 },
2143
2156
  class: { type: String, default: "" },
2144
- style: { type: String, default: fe`
2157
+ style: { type: String, default: ue`
2145
2158
  [aria-disabled="true"] {
2146
2159
  pointer-events: none;
2147
2160
  opacity: 0.5;
@@ -2152,7 +2165,7 @@ function ot(e) {
2152
2165
  render: (r) => {
2153
2166
  const n = t.getCurrent(), o = r.to, s = r.exact, i = r.exactActiveClass, a = r.activeClass, c = r.ariaCurrentValue, f = r.tag, h = r.disabled, p = r.external, l = n.path === o, x = s ? l : n && typeof n.path == "string" ? n.path.startsWith(o) : !1, y = l ? i : x ? a : "", b = l ? `aria-current="${c}"` : "", g = f === "button", u = h ? g ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", m = p && (f === "a" || !f) ? 'target="_blank" rel="noopener noreferrer"' : "";
2154
2167
  return B`
2155
- ${de().when(g, B`
2168
+ ${pe().when(g, B`
2156
2169
  <button
2157
2170
  part="button"
2158
2171
  :class="${r.class} ${y}"
@@ -2185,24 +2198,24 @@ function ot(e) {
2185
2198
  }
2186
2199
  export {
2187
2200
  N as GlobalEventBus,
2188
- ae as component,
2189
- ee as createStore,
2190
- fe as css,
2191
- Xe as each,
2192
- Ye as emit,
2201
+ le as component,
2202
+ te as createStore,
2203
+ ue as css,
2204
+ Ye as each,
2205
+ Ge as emit,
2193
2206
  P as eventBus,
2194
2207
  B as html,
2195
- ot as initRouter,
2196
- rt as listen,
2197
- de as match,
2208
+ it as initRouter,
2209
+ nt as listen,
2210
+ pe as match,
2198
2211
  T as matchRoute,
2199
- nt as matchRouteSSR,
2200
- et as off,
2201
- Ge as on,
2202
- tt as once,
2203
- le as parseQuery,
2204
- Je as resolveRouteComponent,
2205
- Qe as useRouter,
2206
- Ze as when
2212
+ ot as matchRouteSSR,
2213
+ tt as off,
2214
+ et as on,
2215
+ rt as once,
2216
+ ce as parseQuery,
2217
+ Qe as resolveRouteComponent,
2218
+ Ze as useRouter,
2219
+ Xe as when
2207
2220
  };
2208
2221
  //# sourceMappingURL=custom-elements-runtime.es.js.map