@jasonshimmy/custom-elements-runtime 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -327,18 +327,18 @@ function pn(e, t, n = {}) {
327
327
  F.cleanup(i);
328
328
  };
329
329
  }
330
- const ve = /* @__PURE__ */ new Map(), xe = /* @__PURE__ */ new Map(), ke = /* @__PURE__ */ new Map(), Ue = 500;
330
+ const xe = /* @__PURE__ */ new Map(), ve = /* @__PURE__ */ new Map(), ke = /* @__PURE__ */ new Map(), Ue = 500;
331
331
  function ne(e) {
332
- if (ve.has(e))
333
- return ve.get(e);
332
+ if (xe.has(e))
333
+ return xe.get(e);
334
334
  const t = e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
335
- return ve.size < Ue && ve.set(e, t), t;
335
+ return xe.size < Ue && xe.set(e, t), t;
336
336
  }
337
337
  function it(e) {
338
- if (xe.has(e))
339
- return xe.get(e);
338
+ if (ve.has(e))
339
+ return ve.get(e);
340
340
  const t = e.replace(/-([a-z])/g, (n, r) => r.toUpperCase());
341
- return xe.size < Ue && xe.set(e, t), t;
341
+ return ve.size < Ue && ve.set(e, t), t;
342
342
  }
343
343
  function ie(e) {
344
344
  if (typeof e == "string") {
@@ -440,10 +440,10 @@ function bt(e, t, n) {
440
440
  function wt(e, t, n) {
441
441
  t.props && bt(e, t.props, n);
442
442
  }
443
- function vt(e, t, n, r) {
443
+ function xt(e, t, n, r) {
444
444
  e.onConnected && !n && (e.onConnected(t), r(!0));
445
445
  }
446
- function xt(e, t, n, r, i, s, o, a) {
446
+ function vt(e, t, n, r, i, s, o, a) {
447
447
  e.onDisconnected && e.onDisconnected(t), n.forEach((u) => u()), r(), i(), s(!1), o(null), a(!1);
448
448
  }
449
449
  function kt(e, t, n, r, i) {
@@ -707,9 +707,9 @@ class Ct {
707
707
  return c;
708
708
  }
709
709
  function d() {
710
- return i() && i().value === "!" ? (s("OP"), !d()) : i() && i().value === "-" ? (s("OP"), -d()) : v();
710
+ return i() && i().value === "!" ? (s("OP"), !d()) : i() && i().value === "-" ? (s("OP"), -d()) : x();
711
711
  }
712
- function v() {
712
+ function x() {
713
713
  const c = i();
714
714
  if (c) {
715
715
  if (c.type === "NUMBER")
@@ -860,7 +860,7 @@ function _t(e, t, n, r, i, s, o, a) {
860
860
  }, l = h();
861
861
  let d = "text";
862
862
  o instanceof HTMLInputElement ? d = r?.type || o.type || "text" : o instanceof HTMLSelectElement ? d = "select" : o instanceof HTMLTextAreaElement && (d = "textarea");
863
- const v = o instanceof HTMLInputElement || o instanceof HTMLTextAreaElement || o instanceof HTMLSelectElement, c = v ? d === "checkbox" || d === "radio" ? "checked" : "value" : a ?? "modelValue";
863
+ const x = o instanceof HTMLInputElement || o instanceof HTMLTextAreaElement || o instanceof HTMLSelectElement, c = x ? d === "checkbox" || d === "radio" ? "checked" : "value" : a ?? "modelValue";
864
864
  if (d === "checkbox")
865
865
  if (Array.isArray(l))
866
866
  n[c] = l.includes(String(o?.getAttribute("value") ?? r?.value ?? ""));
@@ -894,7 +894,7 @@ function _t(e, t, n, r, i, s, o, a) {
894
894
  if (C.isTrusted === !1 && !k) return;
895
895
  const f = C.target;
896
896
  if (!f || f._modelUpdating) return;
897
- let x = f.value;
897
+ let v = f.value;
898
898
  if (d === "checkbox") {
899
899
  const T = h();
900
900
  if (Array.isArray(T)) {
@@ -905,38 +905,38 @@ function _t(e, t, n, r, i, s, o, a) {
905
905
  const P = S.indexOf(R);
906
906
  P > -1 && S.splice(P, 1);
907
907
  }
908
- x = S;
908
+ v = S;
909
909
  } else {
910
910
  const R = f.getAttribute("true-value") ?? !0, S = f.getAttribute("false-value") ?? !1;
911
- x = f.checked ? R : S;
911
+ v = f.checked ? R : S;
912
912
  }
913
913
  } else if (d === "radio")
914
- x = f.getAttribute("value") ?? f.value;
914
+ v = f.getAttribute("value") ?? f.value;
915
915
  else if (d === "select" && f.multiple)
916
- x = Array.from(f.selectedOptions).map((T) => T.value);
917
- else if (y && typeof x == "string" && (x = x.trim()), g) {
918
- const T = Number(x);
919
- isNaN(T) || (x = T);
916
+ v = Array.from(f.selectedOptions).map((T) => T.value);
917
+ else if (y && typeof v == "string" && (v = v.trim()), g) {
918
+ const T = Number(v);
919
+ isNaN(T) || (v = T);
920
920
  }
921
921
  const A = s._state || s, _ = h();
922
- if (Array.isArray(x) && Array.isArray(_) ? JSON.stringify([...x].sort()) !== JSON.stringify([..._].sort()) : x !== _) {
922
+ if (Array.isArray(v) && Array.isArray(_) ? JSON.stringify([...v].sort()) !== JSON.stringify([..._].sort()) : v !== _) {
923
923
  f._modelUpdating = !0;
924
924
  try {
925
925
  if (b)
926
926
  if (a && typeof e.value == "object" && e.value !== null) {
927
927
  const T = { ...e.value };
928
- T[a] = x, e.value = T;
928
+ T[a] = v, e.value = T;
929
929
  } else
930
- e.value = x;
930
+ e.value = v;
931
931
  else
932
- Ee(A, e, x);
932
+ Ee(A, e, v);
933
933
  if (s._requestRender && s._requestRender(), s._triggerWatchers) {
934
934
  const T = b ? "reactiveState" : e;
935
- s._triggerWatchers(T, x);
935
+ s._triggerWatchers(T, v);
936
936
  }
937
937
  if (f) {
938
938
  const T = `update:${ne(c)}`, R = new CustomEvent(T, {
939
- detail: x,
939
+ detail: v,
940
940
  bubbles: !0,
941
941
  composed: !0
942
942
  });
@@ -947,7 +947,7 @@ function _t(e, t, n, r, i, s, o, a) {
947
947
  }
948
948
  }
949
949
  };
950
- if (v) {
950
+ if (x) {
951
951
  if (i[p]) {
952
952
  const C = i[p];
953
953
  o && oe.removeListener(o, p, C);
@@ -960,15 +960,15 @@ function _t(e, t, n, r, i, s, o, a) {
960
960
  o && oe.removeListener(o, C, k);
961
961
  }
962
962
  i[C] = (k) => {
963
- const f = s._state || s, x = k.detail !== void 0 ? k.detail : k.target?.value, A = H(f, e);
964
- if (Array.isArray(x) && Array.isArray(A) ? JSON.stringify([...x].sort()) !== JSON.stringify([...A].sort()) : x !== A) {
965
- Ee(f, e, x), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, x);
963
+ const f = s._state || s, v = k.detail !== void 0 ? k.detail : k.target?.value, A = H(f, e);
964
+ if (Array.isArray(v) && Array.isArray(A) ? JSON.stringify([...v].sort()) !== JSON.stringify([...A].sort()) : v !== A) {
965
+ Ee(f, e, v), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, v);
966
966
  const $ = k.target;
967
967
  if ($) {
968
- $[c] = x;
968
+ $[c] = v;
969
969
  try {
970
970
  const T = ne(c);
971
- typeof x == "boolean" ? x ? $.setAttribute(T, "true") : $.setAttribute(T, "false") : $.setAttribute(T, String(x));
971
+ typeof v == "boolean" ? v ? $.setAttribute(T, "true") : $.setAttribute(T, "false") : $.setAttribute(T, String(v));
972
972
  } catch {
973
973
  }
974
974
  queueMicrotask(() => {
@@ -982,7 +982,7 @@ function _t(e, t, n, r, i, s, o, a) {
982
982
  i._isComposing = !1;
983
983
  const k = C.target;
984
984
  k && setTimeout(() => {
985
- const f = k.value, x = s._state || s, A = H(x, e);
985
+ const f = k.value, v = s._state || s, A = H(v, e);
986
986
  let _ = f;
987
987
  if (y && (_ = _.trim()), g) {
988
988
  const T = Number(_);
@@ -991,7 +991,7 @@ function _t(e, t, n, r, i, s, o, a) {
991
991
  if (Array.isArray(_) && Array.isArray(A) ? JSON.stringify([..._].sort()) !== JSON.stringify([...A].sort()) : _ !== A) {
992
992
  k._modelUpdating = !0;
993
993
  try {
994
- Ee(x, e, _), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, _);
994
+ Ee(v, e, _), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, _);
995
995
  } finally {
996
996
  setTimeout(() => k._modelUpdating = !1, 0);
997
997
  }
@@ -1208,15 +1208,15 @@ function Ve(e, t, n, r) {
1208
1208
  }, u = t.props ?? {}, y = o, g = n?.isCustomElement ?? t?.isCustomElement ?? !1;
1209
1209
  let b = !1;
1210
1210
  for (const d in { ...u, ...y }) {
1211
- const v = u[d], w = y[d];
1212
- if (v !== w)
1211
+ const x = u[d], w = y[d];
1212
+ if (x !== w)
1213
1213
  if (b = !0, d === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement))
1214
1214
  e.value !== w && (e.value = w ?? "");
1215
1215
  else if (d === "checked" && e instanceof HTMLInputElement)
1216
1216
  e.checked = !!w;
1217
1217
  else if (d.startsWith("on") && typeof w == "function") {
1218
1218
  const c = ot(d);
1219
- typeof v == "function" && oe.removeListener(e, c, v), oe.addListener(e, c, w);
1219
+ typeof x == "function" && oe.removeListener(e, c, x), oe.addListener(e, c, w);
1220
1220
  } else if (w == null)
1221
1221
  e.removeAttribute(d);
1222
1222
  else if ((n?.isCustomElement ?? t?.isCustomElement ?? !1) || d in e)
@@ -1227,15 +1227,15 @@ function Ve(e, t, n, r) {
1227
1227
  else
1228
1228
  w === !1 && e.removeAttribute(d);
1229
1229
  }
1230
- for (const [d, v] of Object.entries(
1230
+ for (const [d, x] of Object.entries(
1231
1231
  s.listeners || {}
1232
1232
  ))
1233
- oe.addListener(e, d, v);
1233
+ oe.addListener(e, d, x);
1234
1234
  const h = t.attrs ?? {}, l = a;
1235
1235
  for (const d in { ...h, ...l }) {
1236
- const v = h[d], w = l[d];
1237
- let c = v, p = w;
1238
- if (ee(v) && (c = v.value), ee(w) && (p = w.value), c !== p)
1236
+ const x = h[d], w = l[d];
1237
+ let c = x, p = w;
1238
+ if (ee(x) && (c = x.value), ee(w) && (p = w.value), c !== p)
1239
1239
  if (b = !0, p == null || p === !1) {
1240
1240
  if (e.removeAttribute(d), d === "value") {
1241
1241
  if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement)
@@ -1337,15 +1337,15 @@ function X(e, t, n) {
1337
1337
  return e.key != null && (h.key = e.key), h;
1338
1338
  }
1339
1339
  if (e.tag === "#anchor") {
1340
- const h = e, l = Array.isArray(h.children) ? h.children : [], d = document.createTextNode(""), v = document.createTextNode("");
1341
- h.key != null && (d.key = `${h.key}:start`, v.key = `${h.key}:end`), h._startNode = d, h._endNode = v;
1340
+ const h = e, l = Array.isArray(h.children) ? h.children : [], d = document.createTextNode(""), x = document.createTextNode("");
1341
+ h.key != null && (d.key = `${h.key}:start`, x.key = `${h.key}:end`), h._startNode = d, h._endNode = x;
1342
1342
  const w = document.createDocumentFragment();
1343
1343
  w.appendChild(d);
1344
1344
  for (const c of l) {
1345
1345
  const p = X(c, t);
1346
1346
  w.appendChild(p);
1347
1347
  }
1348
- return w.appendChild(v), w;
1348
+ return w.appendChild(x), w;
1349
1349
  }
1350
1350
  const r = document.createElement(e.tag);
1351
1351
  e.key != null && (r.key = e.key);
@@ -1381,9 +1381,9 @@ function X(e, t, n) {
1381
1381
  r.setAttribute(h, String(l));
1382
1382
  }
1383
1383
  else if ((e.props?.isCustomElement ?? !1) && !g && h.includes("-")) {
1384
- const v = it(h);
1384
+ const x = it(h);
1385
1385
  try {
1386
- r[v] = l;
1386
+ r[x] = l;
1387
1387
  } catch {
1388
1388
  r.setAttribute(h, String(l));
1389
1389
  }
@@ -1409,8 +1409,8 @@ function X(e, t, n) {
1409
1409
  r.removeAttribute(h);
1410
1410
  else if ((e.props?.isCustomElement ?? !1) || h in r)
1411
1411
  try {
1412
- const v = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
1413
- r[h] = v;
1412
+ const x = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
1413
+ r[h] = x;
1414
1414
  } catch {
1415
1415
  }
1416
1416
  }
@@ -1467,16 +1467,16 @@ function Rt(e, t, n, r, i) {
1467
1467
  const y = /* @__PURE__ */ new Set();
1468
1468
  let g = e.firstChild;
1469
1469
  function b(l, d) {
1470
- let v = l;
1471
- for (; v && (y.add(v), v !== d); )
1472
- v = v.nextSibling;
1470
+ let x = l;
1471
+ for (; x && (y.add(x), x !== d); )
1472
+ x = x.nextSibling;
1473
1473
  }
1474
- function h(l, d, v, w) {
1474
+ function h(l, d, x, w) {
1475
1475
  const c = [];
1476
1476
  let p = l.nextSibling;
1477
1477
  for (; p && p !== d; )
1478
1478
  c.push(p), p = p.nextSibling;
1479
- const m = Array.isArray(v) ? v : [];
1479
+ const m = Array.isArray(x) ? x : [];
1480
1480
  if (w.some((k) => k && k.key != null) || m.some((k) => k && k.key != null)) {
1481
1481
  const k = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
1482
1482
  for (const _ of m)
@@ -1485,7 +1485,7 @@ function Rt(e, t, n, r, i) {
1485
1485
  const $ = _.key;
1486
1486
  $ != null && f.set($, _);
1487
1487
  }
1488
- const x = /* @__PURE__ */ new Set();
1488
+ const v = /* @__PURE__ */ new Set();
1489
1489
  let A = l.nextSibling;
1490
1490
  for (const _ of w) {
1491
1491
  let $;
@@ -1496,20 +1496,20 @@ function Rt(e, t, n, r, i) {
1496
1496
  T,
1497
1497
  _,
1498
1498
  r
1499
- ), x.add($), $ !== A && e.contains($) && e.insertBefore($, A);
1499
+ ), v.add($), $ !== A && e.contains($) && e.insertBefore($, A);
1500
1500
  } else
1501
- $ = X(_, r), e.insertBefore($, A), x.add($);
1501
+ $ = X(_, r), e.insertBefore($, A), v.add($);
1502
1502
  A = $.nextSibling;
1503
1503
  }
1504
1504
  for (const _ of c)
1505
- !x.has(_) && e.contains(_) && e.removeChild(_);
1505
+ !v.has(_) && e.contains(_) && e.removeChild(_);
1506
1506
  } else {
1507
1507
  const k = Math.min(
1508
1508
  m.length,
1509
1509
  w.length
1510
1510
  );
1511
1511
  for (let f = 0; f < k; f++) {
1512
- const x = m[f], A = w[f], _ = $e(c[f], x, A, r);
1512
+ const v = m[f], A = w[f], _ = $e(c[f], v, A, r);
1513
1513
  _ !== c[f] && (e.insertBefore(_, c[f]), e.removeChild(c[f]));
1514
1514
  }
1515
1515
  for (let f = k; f < w.length; f++)
@@ -1521,7 +1521,7 @@ function Rt(e, t, n, r, i) {
1521
1521
  for (const l of n) {
1522
1522
  let d;
1523
1523
  if (l.tag === "#anchor") {
1524
- const v = l.key, w = `${v}:start`, c = `${v}:end`;
1524
+ const x = l.key, w = `${x}:start`, c = `${x}:end`;
1525
1525
  let p = u.get(w), m = u.get(c);
1526
1526
  const C = Array.isArray(l.children) ? l.children : [];
1527
1527
  if (p || (p = document.createTextNode(""), p.key = w), m || (m = document.createTextNode(""), m.key = c), l._startNode = p, l._endNode = m, !e.contains(p) || !e.contains(m)) {
@@ -1533,17 +1533,17 @@ function Rt(e, t, n, r, i) {
1533
1533
  h(
1534
1534
  p,
1535
1535
  m,
1536
- a.get(v)?.children,
1536
+ a.get(x)?.children,
1537
1537
  C
1538
1538
  );
1539
1539
  b(p, m), g = m.nextSibling;
1540
1540
  continue;
1541
1541
  }
1542
1542
  if (l.key != null && u.has(l.key)) {
1543
- const v = a.get(l.key);
1543
+ const x = a.get(l.key);
1544
1544
  d = $e(
1545
1545
  u.get(l.key),
1546
- v,
1546
+ x,
1547
1547
  l,
1548
1548
  r,
1549
1549
  i
@@ -1874,6 +1874,8 @@ const Mt = Pt`
1874
1874
  "h-screen": "height:100dvw;",
1875
1875
  "max-w-full": "max-width:100%;",
1876
1876
  "max-h-full": "max-height:100%;",
1877
+ "max-w-screen": "max-width:100dvw;",
1878
+ "max-h-screen": "max-height:100dvh;",
1877
1879
  "min-w-0": "min-width:0;",
1878
1880
  "min-h-0": "min-height:0;",
1879
1881
  ...zt(),
@@ -2321,8 +2323,8 @@ function Vt(e) {
2321
2323
  if (!C) return null;
2322
2324
  const k = C.replace(/^!/, ""), f = Le[k] ?? Ne(k) ?? ze(k) ?? We(k) ?? Se(k);
2323
2325
  if (!f) return null;
2324
- const x = p.indexOf(C);
2325
- let A = x >= 0 ? p.slice(0, x) : [];
2326
+ const v = p.indexOf(C);
2327
+ let A = v >= 0 ? p.slice(0, v) : [];
2326
2328
  c && (A = A.filter((E) => E !== "dark"));
2327
2329
  const _ = `.${qt(w)}`, $ = "__SUBJECT__", T = m ? f.replace(/;$/, " !important;") : f;
2328
2330
  let R = $;
@@ -2400,8 +2402,8 @@ function Vt(e) {
2400
2402
  f && (k === 1 ? s.push(f) : k === 2 ? o.push(f) : k === 3 && a.push(f));
2401
2403
  }
2402
2404
  }
2403
- const v = [...s, ...o, ...a, ...u].join("");
2404
- return Xe.set(e, { css: v, timestamp: t }), v;
2405
+ const x = [...s, ...o, ...a, ...u].join("");
2406
+ return Xe.set(e, { css: x, timestamp: t }), x;
2405
2407
  }
2406
2408
  const ge = [];
2407
2409
  function Jt(e, t, n, r, i, s, o, a) {
@@ -2648,7 +2650,7 @@ function Qt(e, t) {
2648
2650
  }
2649
2651
  connectedCallback() {
2650
2652
  this._runLogicWithinErrorBoundary(t, () => {
2651
- this._applyProps(t), this._requestRender(), vt(
2653
+ this._applyProps(t), this._requestRender(), xt(
2652
2654
  t,
2653
2655
  this.context,
2654
2656
  this._mounted,
@@ -2660,7 +2662,7 @@ function Qt(e, t) {
2660
2662
  }
2661
2663
  disconnectedCallback() {
2662
2664
  this._runLogicWithinErrorBoundary(t, () => {
2663
- xt(
2665
+ vt(
2664
2666
  t,
2665
2667
  this.context,
2666
2668
  this._listeners,
@@ -2989,7 +2991,7 @@ function rn(e, t = [], n = {}) {
2989
2991
  h || (l === "true" ? l = !0 : l === "false" ? l = !1 : l === "null" ? l = null : isNaN(Number(l)) || (l = Number(l)));
2990
2992
  const d = ["model", "bind", "show", "class", "style", "ref"];
2991
2993
  if (y === ":") {
2992
- const [v, w] = g.split(":"), [c, ...p] = v.split(".");
2994
+ const [x, w] = g.split(":"), [c, ...p] = x.split(".");
2993
2995
  if (d.includes(c)) {
2994
2996
  const m = [...p], C = c === "model" && w ? `model:${w}` : c;
2995
2997
  s[C] = {
@@ -3002,14 +3004,14 @@ function rn(e, t = [], n = {}) {
3002
3004
  m && ee(m) && (m = m.value), i[g] = m, o.push(g);
3003
3005
  }
3004
3006
  } else if (y === "@") {
3005
- const [v, ...w] = g.split("."), c = w;
3006
- tn(l, v);
3007
+ const [x, ...w] = g.split("."), c = w;
3008
+ tn(l, x);
3007
3009
  const p = typeof l == "function" ? l : typeof n[l] == "function" ? n[l] : void 0;
3008
3010
  if (p) {
3009
3011
  const m = (k) => {
3010
3012
  if (c.includes("prevent") && k.preventDefault(), c.includes("stop") && k.stopPropagation(), !(c.includes("self") && k.target !== k.currentTarget))
3011
- return c.includes("once") && k.currentTarget?.removeEventListener(v, m), p(k);
3012
- }, C = "on" + v.charAt(0).toUpperCase() + v.slice(1);
3013
+ return c.includes("once") && k.currentTarget?.removeEventListener(x, m), p(k);
3014
+ }, C = "on" + x.charAt(0).toUpperCase() + x.slice(1);
3013
3015
  r[C] = m;
3014
3016
  }
3015
3017
  } else g === "ref" ? r.ref = l : i[g] = l;
@@ -3022,35 +3024,35 @@ function sn(e, t, n) {
3022
3024
  const f = De.get(o);
3023
3025
  if (f) return f;
3024
3026
  }
3025
- function a(f, x) {
3026
- return pe("#text", {}, f, x);
3027
+ function a(f, v) {
3028
+ return pe("#text", {}, f, v);
3027
3029
  }
3028
3030
  let u = "";
3029
3031
  for (let f = 0; f < e.length; f++)
3030
3032
  u += e[f], f < t.length && (u += `{{${f}}}`);
3031
3033
  const y = /<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, g = [];
3032
- let b, h = [], l = null, d = {}, v, w = 0, c = [];
3034
+ let b, h = [], l = null, d = {}, x, w = 0, c = [];
3033
3035
  function p(f) {
3034
- !f || typeof f != "object" || Ae(f) || (f.props || f.attrs ? (f.props && (d.props || (d.props = {}), Object.assign(d.props, f.props)), f.attrs && (d.attrs || (d.attrs = {}), Object.keys(f.attrs).forEach((x) => {
3035
- if (x === "style" && d.attrs.style) {
3036
+ !f || typeof f != "object" || Ae(f) || (f.props || f.attrs ? (f.props && (d.props || (d.props = {}), Object.assign(d.props, f.props)), f.attrs && (d.attrs || (d.attrs = {}), Object.keys(f.attrs).forEach((v) => {
3037
+ if (v === "style" && d.attrs.style) {
3036
3038
  const A = d.attrs.style.replace(
3037
3039
  /;?\s*$/,
3038
3040
  ""
3039
3041
  ), _ = f.attrs.style.replace(/^;?\s*/, "");
3040
3042
  d.attrs.style = A + "; " + _;
3041
- } else if (x === "class" && d.attrs.class) {
3043
+ } else if (v === "class" && d.attrs.class) {
3042
3044
  const A = d.attrs.class.trim().split(/\s+/).filter(Boolean), _ = f.attrs.class.trim().split(/\s+/).filter(Boolean), $ = [
3043
3045
  .../* @__PURE__ */ new Set([...A, ..._])
3044
3046
  ];
3045
3047
  d.attrs.class = $.join(" ");
3046
3048
  } else
3047
- d.attrs[x] = f.attrs[x];
3049
+ d.attrs[v] = f.attrs[v];
3048
3050
  }))) : (d.props || (d.props = {}), Object.assign(d.props, f)));
3049
3051
  }
3050
- function m(f, x) {
3052
+ function m(f, v) {
3051
3053
  const A = l ? h : c;
3052
3054
  if (Ae(f)) {
3053
- const _ = f.key ?? x;
3055
+ const _ = f.key ?? v;
3054
3056
  let $ = f.children;
3055
3057
  A.push({
3056
3058
  ...f,
@@ -3067,7 +3069,7 @@ function sn(e, t, n) {
3067
3069
  if (f.length === 0) return;
3068
3070
  for (let _ = 0; _ < f.length; _++) {
3069
3071
  const $ = f[_];
3070
- Ae($) || _e($) || Array.isArray($) ? m($, `${x}-${_}`) : $ !== null && typeof $ == "object" ? p($) : A.push(a(String($), `${x}-${_}`));
3072
+ Ae($) || _e($) || Array.isArray($) ? m($, `${v}-${_}`) : $ !== null && typeof $ == "object" ? p($) : A.push(a(String($), `${v}-${_}`));
3071
3073
  }
3072
3074
  return;
3073
3075
  }
@@ -3075,7 +3077,7 @@ function sn(e, t, n) {
3075
3077
  p(f);
3076
3078
  return;
3077
3079
  }
3078
- A.push(a(String(f), x));
3080
+ A.push(a(String(f), v));
3079
3081
  }
3080
3082
  const C = /* @__PURE__ */ new Set([
3081
3083
  "area",
@@ -3096,7 +3098,7 @@ function sn(e, t, n) {
3096
3098
  for (; b = y.exec(u); )
3097
3099
  if (!(b[0].startsWith("<!--") && b[0].endsWith("-->"))) {
3098
3100
  if (b[1]) {
3099
- const f = b[1], x = b[0][1] === "/", A = b[0][b[0].length - 2] === "/" || C.has(f), {
3101
+ const f = b[1], v = b[0][1] === "/", A = b[0][b[0].length - 2] === "/" || C.has(f), {
3100
3102
  props: _,
3101
3103
  attrs: $,
3102
3104
  directives: T,
@@ -3168,25 +3170,25 @@ function sn(e, t, n) {
3168
3170
  }
3169
3171
  } catch {
3170
3172
  }
3171
- if (Object.keys(T).length > 0 && (S.directives = { ...T }), x) {
3173
+ if (Object.keys(T).length > 0 && (S.directives = { ...T }), v) {
3172
3174
  const P = pe(
3173
3175
  l,
3174
3176
  d,
3175
3177
  h.length === 1 && _e(h[0]) && h[0].tag === "#text" ? typeof h[0].children == "string" ? h[0].children : "" : h.length ? h : void 0,
3176
- v
3178
+ x
3177
3179
  ), B = g.pop();
3178
- B ? (l = B.tag, d = B.props, v = B.key, h = B.children, h.push(P)) : (c.push(P), l = null, d = {}, v = void 0, h = []);
3180
+ B ? (l = B.tag, d = B.props, x = B.key, h = B.children, h.push(P)) : (c.push(P), l = null, d = {}, x = void 0, h = []);
3179
3181
  } else A ? l ? h.push(pe(f, S, void 0, void 0)) : c.push(pe(f, S, void 0, void 0)) : (l && g.push({
3180
3182
  tag: l,
3181
3183
  props: d,
3182
3184
  children: h,
3183
- key: v
3185
+ key: x
3184
3186
  }), l = f, d = S, h = []);
3185
3187
  } else if (typeof b[3] < "u") {
3186
- const f = Number(b[3]), x = t[f], A = `interp-${f}`;
3187
- m(x, A);
3188
+ const f = Number(b[3]), v = t[f], A = `interp-${f}`;
3189
+ m(v, A);
3188
3190
  } else if (b[4]) {
3189
- const f = b[4], x = l ? h : c, A = f.split(/({{\d+}})/);
3191
+ const f = b[4], v = l ? h : c, A = f.split(/({{\d+}})/);
3190
3192
  for (const _ of A) {
3191
3193
  if (!_) continue;
3192
3194
  const $ = _.match(/^{{(\d+)}}$/);
@@ -3195,7 +3197,7 @@ function sn(e, t, n) {
3195
3197
  m(R, S);
3196
3198
  } else {
3197
3199
  const T = `text-${w++}`;
3198
- x.push(a(_, T));
3200
+ v.push(a(_, T));
3199
3201
  }
3200
3202
  }
3201
3203
  }
@@ -3217,7 +3219,7 @@ function ce(e, ...t) {
3217
3219
  function Re(e, t) {
3218
3220
  return j(e ? t : [], "when-block");
3219
3221
  }
3220
- function vn(e, t) {
3222
+ function xn(e, t) {
3221
3223
  return e.map((n, r) => {
3222
3224
  const i = typeof n == "object" ? n?.key ?? n?.id ?? `idx-${r}` : String(n);
3223
3225
  return j(t(n, r), `each-${i}`);
@@ -3252,7 +3254,7 @@ function j(e, t) {
3252
3254
  children: n
3253
3255
  };
3254
3256
  }
3255
- function xn(e, t) {
3257
+ function vn(e, t) {
3256
3258
  return Re(!e, t);
3257
3259
  }
3258
3260
  function kn(e, t) {
@@ -3537,38 +3539,38 @@ async function ln(e) {
3537
3539
  function un(e) {
3538
3540
  const { routes: t, base: n = "", initialUrl: r } = e;
3539
3541
  let i, s, o, a, u, y, g;
3540
- const b = async (v, w) => {
3541
- const c = t.find((p) => Q([p], v.path).route !== null);
3542
+ const b = async (x, w) => {
3543
+ const c = t.find((p) => Q([p], x.path).route !== null);
3542
3544
  if (c?.beforeEnter)
3543
3545
  try {
3544
- const p = await c.beforeEnter(v, w);
3546
+ const p = await c.beforeEnter(x, w);
3545
3547
  return typeof p == "string" ? (await d(p, !0), !1) : p !== !1;
3546
3548
  } catch (p) {
3547
3549
  return se("beforeEnter error", p), !1;
3548
3550
  }
3549
3551
  return !0;
3550
- }, h = async (v, w) => {
3551
- const c = t.find((p) => Q([p], v.path).route !== null);
3552
+ }, h = async (x, w) => {
3553
+ const c = t.find((p) => Q([p], x.path).route !== null);
3552
3554
  if (c?.onEnter)
3553
3555
  try {
3554
- const p = await c.onEnter(v, w);
3556
+ const p = await c.onEnter(x, w);
3555
3557
  return typeof p == "string" ? (await d(p, !0), !1) : p !== !1;
3556
3558
  } catch (p) {
3557
3559
  return se("onEnter error", p), !1;
3558
3560
  }
3559
3561
  return !0;
3560
- }, l = (v, w) => {
3561
- const c = t.find((p) => Q([p], v.path).route !== null);
3562
+ }, l = (x, w) => {
3563
+ const c = t.find((p) => Q([p], x.path).route !== null);
3562
3564
  if (c?.afterEnter)
3563
3565
  try {
3564
- c.afterEnter(v, w);
3566
+ c.afterEnter(x, w);
3565
3567
  } catch (p) {
3566
3568
  se("afterEnter error", p);
3567
3569
  }
3568
- }, d = async (v, w = !1) => {
3570
+ }, d = async (x, w = !1) => {
3569
3571
  try {
3570
3572
  const c = {
3571
- path: v.replace(n, "") || "/",
3573
+ path: x.replace(n, "") || "/",
3572
3574
  query: {}
3573
3575
  }, p = Q(t, c.path);
3574
3576
  if (!p) throw new Error(`No route found for ${c.path}`);
@@ -3578,7 +3580,7 @@ function un(e) {
3578
3580
  query: c.query
3579
3581
  };
3580
3582
  if (!await b(C, m) || !await h(C, m)) return;
3581
- typeof window < "u" && typeof document < "u" && (w ? window.history.replaceState({}, "", n + v) : window.history.pushState({}, "", n + v)), o.setState(C), l(C, m);
3583
+ typeof window < "u" && typeof document < "u" && (w ? window.history.replaceState({}, "", n + x) : window.history.pushState({}, "", n + x)), o.setState(C), l(C, m);
3582
3584
  } catch (c) {
3583
3585
  se("Navigation error:", c);
3584
3586
  }
@@ -3588,10 +3590,10 @@ function un(e) {
3588
3590
  const w = new URL(window.location.href), c = w.pathname.replace(n, "") || "/", p = nt(w.search);
3589
3591
  return { path: c, query: p };
3590
3592
  }, s = i();
3591
- const v = Q(t, s.path);
3593
+ const x = Q(t, s.path);
3592
3594
  o = tt({
3593
3595
  path: s.path,
3594
- params: v.params,
3596
+ params: x.params,
3595
3597
  query: s.query
3596
3598
  }), a = async (w = !1) => {
3597
3599
  const c = i();
@@ -3602,10 +3604,10 @@ function un(e) {
3602
3604
  const c = new URL(r || "/", "http://localhost"), p = c.pathname.replace(n, "") || "/", m = nt(c.search);
3603
3605
  return { path: p, query: m };
3604
3606
  }, s = i();
3605
- const v = Q(t, s.path);
3607
+ const x = Q(t, s.path);
3606
3608
  o = tt({
3607
3609
  path: s.path,
3608
- params: v.params,
3610
+ params: x.params,
3609
3611
  query: s.query
3610
3612
  }), a = async () => {
3611
3613
  const c = i();
@@ -3622,26 +3624,26 @@ function un(e) {
3622
3624
  path: p.path,
3623
3625
  params: m.params,
3624
3626
  query: p.query
3625
- }, f = t.find((x) => Q([x], k.path).route !== null);
3627
+ }, f = t.find((v) => Q([v], k.path).route !== null);
3626
3628
  if (f?.beforeEnter)
3627
3629
  try {
3628
- const x = await f.beforeEnter(k, C);
3629
- if (typeof x == "string") {
3630
- await w(x);
3630
+ const v = await f.beforeEnter(k, C);
3631
+ if (typeof v == "string") {
3632
+ await w(v);
3631
3633
  return;
3632
3634
  }
3633
- if (x === !1) return;
3635
+ if (v === !1) return;
3634
3636
  } catch {
3635
3637
  return;
3636
3638
  }
3637
3639
  if (f?.onEnter)
3638
3640
  try {
3639
- const x = await f.onEnter(k, C);
3640
- if (typeof x == "string") {
3641
- await w(x);
3641
+ const v = await f.onEnter(k, C);
3642
+ if (typeof v == "string") {
3643
+ await w(v);
3642
3644
  return;
3643
3645
  }
3644
- if (x === !1) return;
3646
+ if (v === !1) return;
3645
3647
  } catch {
3646
3648
  return;
3647
3649
  }
@@ -3662,7 +3664,7 @@ function un(e) {
3662
3664
  replace: y,
3663
3665
  back: g,
3664
3666
  subscribe: o.subscribe,
3665
- matchRoute: (v) => Q(t, v),
3667
+ matchRoute: (x) => Q(t, x),
3666
3668
  getCurrent: () => o.getState(),
3667
3669
  resolveRouteComponent: ln
3668
3670
  };
@@ -3700,14 +3702,14 @@ function zn(e) {
3700
3702
  disabled: b = !1,
3701
3703
  external: h = !1,
3702
3704
  class: l = ""
3703
- } = n, d = t.getCurrent(), v = d.path === i, w = a ? v : d && typeof d.path == "string" ? d.path.startsWith(i) : !1, c = v ? `aria-current="${g}"` : "", p = (l || "").split(/\s+/).filter(Boolean), m = {};
3705
+ } = n, d = t.getCurrent(), x = d.path === i, w = a ? x : d && typeof d.path == "string" ? d.path.startsWith(i) : !1, c = x ? `aria-current="${g}"` : "", p = (l || "").split(/\s+/).filter(Boolean), m = {};
3704
3706
  for (const _ of p) m[_] = !0;
3705
3707
  const C = {
3706
3708
  ...m,
3707
3709
  // Also include the configurable names (may duplicate the above)
3708
3710
  [u]: w,
3709
- [y]: v
3710
- }, k = s === "button", f = b ? k ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", x = h && (s === "a" || !s) ? 'target="_blank" rel="noopener noreferrer"' : "", A = (_) => {
3711
+ [y]: x
3712
+ }, k = s === "button", f = b ? k ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", v = h && (s === "a" || !s) ? 'target="_blank" rel="noopener noreferrer"' : "", A = (_) => {
3711
3713
  if (b) {
3712
3714
  _.preventDefault();
3713
3715
  return;
@@ -3721,7 +3723,7 @@ function zn(e) {
3721
3723
  :class="${C}"
3722
3724
  ${c}
3723
3725
  ${f}
3724
- ${x}
3726
+ ${v}
3725
3727
  @click="${A}"
3726
3728
  ><slot></slot></button>
3727
3729
  `).otherwise(ce`
@@ -3731,7 +3733,7 @@ function zn(e) {
3731
3733
  :class="${C}"
3732
3734
  ${c}
3733
3735
  ${f}
3734
- ${x}
3736
+ ${v}
3735
3737
  @click="${A}"
3736
3738
  ><slot></slot></a>
3737
3739
  `).done()}
@@ -3745,7 +3747,7 @@ export {
3745
3747
  dn as computed,
3746
3748
  tt as createStore,
3747
3749
  Pt as css,
3748
- vn as each,
3750
+ xn as each,
3749
3751
  $n as eachGroup,
3750
3752
  Sn as eachPage,
3751
3753
  _n as eachWhere,
@@ -3771,7 +3773,7 @@ export {
3771
3773
  On as switchOn,
3772
3774
  En as switchOnLength,
3773
3775
  An as switchOnPromise,
3774
- xn as unless,
3776
+ vn as unless,
3775
3777
  hn as useEmit,
3776
3778
  mn as useOnAttributeChanged,
3777
3779
  gn as useOnConnected,