@3r1s_s/erisui 1.0.14 → 1.0.16

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/erisui.mjs CHANGED
@@ -1,7 +1,4 @@
1
- var S = Object.defineProperty;
2
- var z = (o, t, e) => t in o ? S(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
3
- var v = (o, t, e) => z(o, typeof t != "symbol" ? t + "" : t, e);
4
- class M extends HTMLElement {
1
+ class E extends HTMLElement {
5
2
  static get observedAttributes() {
6
3
  return ["size", "border-radius", "name", "color"];
7
4
  }
@@ -55,32 +52,32 @@ class M extends HTMLElement {
55
52
  }
56
53
  connectedCallback() {
57
54
  this.avatar = this.shadowRoot.querySelector(".avatar"), this.initials = this.shadowRoot.querySelector("#initials");
58
- const t = this.shadowRoot.querySelector("slot"), e = t && t.assignedNodes().length > 0;
59
- if (e) {
60
- const i = t.assignedNodes()[0];
61
- i && i.tagName === "IMG" && (this.initials.style.display = "none", this.avatar.style.backgroundColor = "transparent");
55
+ const t = this.shadowRoot.querySelector("slot"), i = t && t.assignedNodes().length > 0;
56
+ if (i) {
57
+ const e = t.assignedNodes()[0];
58
+ e && e.tagName === "IMG" && (this.initials.style.display = "none", this.avatar.style.backgroundColor = "transparent");
62
59
  } else
63
60
  this.hasAttribute("color") && (this.avatar.style.backgroundColor = this.getAttribute("color"));
64
61
  if (this.hasAttribute("color") && (this.avatar.style.backgroundColor = this.getAttribute("color")), this.hasAttribute("size")) {
65
- const i = this.getAttribute("size");
66
- this.avatar.style.width = i + "px", this.avatar.style.height = i + "px", this.initials.style.fontSize = i / 2 + "px";
62
+ const e = this.getAttribute("size");
63
+ this.avatar.style.width = e + "px", this.avatar.style.height = e + "px", this.initials.style.fontSize = e / 2 + "px";
67
64
  }
68
- if (this.hasAttribute("border-radius") && (this.avatar.style.borderRadius = this.getAttribute("border-radius") + "px"), this.hasAttribute("name") && (this.avatar.title = this.getAttribute("name")), !e && this.hasAttribute("name")) {
69
- const n = this.getAttribute("name").trim().split(/\s+/);
70
- let s = "";
71
- n.length === 1 ? s = n[0][0] || "" : s = (n[0][0] || "") + (n[n.length - 1][0] || ""), this.initials.textContent = s.toUpperCase();
65
+ if (this.hasAttribute("border-radius") && (this.avatar.style.borderRadius = this.getAttribute("border-radius") + "px"), this.hasAttribute("name") && (this.avatar.title = this.getAttribute("name")), !i && this.hasAttribute("name")) {
66
+ const a = this.getAttribute("name").trim().split(/\s+/);
67
+ let n = "";
68
+ a.length === 1 ? n = a[0][0] || "" : n = (a[0][0] || "") + (a[a.length - 1][0] || ""), this.initials.textContent = n.toUpperCase();
72
69
  }
73
70
  }
74
71
  }
75
- customElements.define("eui-avatar", M);
72
+ customElements.define("eui-avatar", E);
76
73
  const u = /* @__PURE__ */ (() => {
77
- let o = {};
74
+ let s = {};
78
75
  return {
79
- register(t, e) {
80
- o[t] = e;
76
+ register(t, i) {
77
+ s[t] = i;
81
78
  },
82
79
  get(t) {
83
- return o[t] || "";
80
+ return s[t] || "";
84
81
  }
85
82
  };
86
83
  })();
@@ -93,7 +90,7 @@ u.register("copy", '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="1
93
90
  u.register("arrow", '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path d="M9.3 5.3a1 1 0 0 0 0 1.4l5.29 5.3-5.3 5.3a1 1 0 1 0 1.42 1.4l6-6a1 1 0 0 0 0-1.4l-6-6a1 1 0 0 0-1.42 0Z"></path></svg>');
94
91
  u.register("back", '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" style="transform: rotate(180deg)"><path d="M9.3 5.3a1 1 0 0 0 0 1.4l5.29 5.3-5.3 5.3a1 1 0 1 0 1.42 1.4l6-6a1 1 0 0 0 0-1.4l-6-6a1 1 0 0 0-1.42 0Z"></path></svg>');
95
92
  u.register("check", '<svg width="12" height="10" viewBox="0 0 12 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.86368 9.12226C3.82463 9.16131 3.76131 9.16131 3.72226 9.12226L0.146522 5.54652C-0.0487403 5.35126 -0.0487401 5.03468 0.146522 4.83942L0.839416 4.14652C1.03468 3.95126 1.35126 3.95126 1.54652 4.14652L3.72226 6.32226C3.76131 6.36131 3.82463 6.36131 3.86368 6.32226L10.0394 0.146522C10.2347 -0.0487398 10.5513 -0.0487399 10.7465 0.146522L11.4394 0.839416C11.6347 1.03468 11.6347 1.35126 11.4394 1.54652L3.86368 9.12226Z" fill="currentColor"/></svg>');
96
- class T extends HTMLElement {
93
+ class A extends HTMLElement {
97
94
  static get observedAttributes() {
98
95
  return ["name", "width", "height"];
99
96
  }
@@ -107,23 +104,23 @@ class T extends HTMLElement {
107
104
  this.render();
108
105
  }
109
106
  render() {
110
- const t = this.getAttribute("name"), e = u.get(t);
111
- if (!e) {
107
+ const t = this.getAttribute("name"), i = u.get(t);
108
+ if (!i) {
112
109
  this.shadowRoot.innerHTML = '<span style="color:red;">?</span>';
113
110
  return;
114
111
  }
115
- const i = document.createElement("template");
116
- i.innerHTML = e.trim();
117
- const n = i.content.cloneNode(!0), s = n.firstElementChild;
118
- if (s && s.style) {
119
- const r = this.getAttribute("width"), c = this.getAttribute("height");
120
- r && s.setAttribute("width", r), c && s.setAttribute("height", c), s.style.display = "block";
112
+ const e = document.createElement("template");
113
+ e.innerHTML = i.trim();
114
+ const a = e.content.cloneNode(!0), n = a.firstElementChild;
115
+ if (n && n.style) {
116
+ const r = this.getAttribute("width"), l = this.getAttribute("height");
117
+ r && n.setAttribute("width", r), l && n.setAttribute("height", l), n.style.display = "block";
121
118
  }
122
- this.shadowRoot.innerHTML = "", this.shadowRoot.appendChild(n);
119
+ this.shadowRoot.innerHTML = "", this.shadowRoot.appendChild(a);
123
120
  }
124
121
  }
125
- customElements.define("eui-icon", T);
126
- class $ extends HTMLElement {
122
+ customElements.define("eui-icon", A);
123
+ class L extends HTMLElement {
127
124
  static get observedAttributes() {
128
125
  return ["label", "value", "id", "type", "filled"];
129
126
  }
@@ -231,21 +228,23 @@ class $ extends HTMLElement {
231
228
  `;
232
229
  }
233
230
  connectedCallback() {
234
- this.form = this.shadowRoot.querySelector(".form"), this.inputEl = this.shadowRoot.querySelector(".form-input"), this.labelEl = this.shadowRoot.querySelector("label"), this.hasAttribute("value") && (this.inputEl.value = this.getAttribute("value")), this.hasAttribute("id") && (this.inputEl.id = this.getAttribute("id")), this.hasAttribute("label") && (this.labelEl.textContent = this.getAttribute("label")), this.hasAttribute("type") && (this.inputEl.type = this.getAttribute("type")), this.hasAttribute("filled") && this.form.classList.add("filled"), this.inputEl.addEventListener("input", () => {
235
- this.setAttribute("value", this.inputEl.value);
231
+ this.form = this.shadowRoot.querySelector(".form"), this.inputEl = this.shadowRoot.querySelector(".form-input"), this.labelEl = this.shadowRoot.querySelector("label"), this.hasAttribute("value") && (this.inputEl.value = this.getAttribute("value")), this.hasAttribute("id") && (this.inputEl.id = this.getAttribute("id")), this.hasAttribute("label") && (this.labelEl.textContent = this.getAttribute("label")), this.hasAttribute("type") && (this.inputEl.type = this.getAttribute("type")), this.hasAttribute("filled") && this.form.classList.add("filled"), this.inputEl.addEventListener("input", (t) => {
232
+ this.setAttribute("value", this.inputEl.value), this.dispatchEvent(new Event("input", { bubbles: !0, composed: !0 }));
233
+ }), this.inputEl.addEventListener("change", (t) => {
234
+ this.dispatchEvent(new Event("change", { bubbles: !0, composed: !0 }));
236
235
  });
237
236
  }
238
- attributeChangedCallback(t, e, i) {
237
+ attributeChangedCallback(t, i, e) {
239
238
  if (!(!this.inputEl || !this.labelEl))
240
239
  switch (t) {
241
240
  case "value":
242
- this.inputEl.value !== i && (this.inputEl.value = i);
241
+ this.inputEl.value !== e && (this.inputEl.value = e);
243
242
  break;
244
243
  case "id":
245
- this.inputEl.id = i;
244
+ this.inputEl.id = e;
246
245
  break;
247
246
  case "label":
248
- this.labelEl.textContent = i;
247
+ this.labelEl.textContent = e;
249
248
  break;
250
249
  }
251
250
  }
@@ -256,8 +255,8 @@ class $ extends HTMLElement {
256
255
  this.setAttribute("value", t);
257
256
  }
258
257
  }
259
- customElements.define("eui-input", $);
260
- class R extends HTMLElement {
258
+ customElements.define("eui-input", L);
259
+ class S extends HTMLElement {
261
260
  constructor() {
262
261
  super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = `
263
262
  <style>
@@ -307,8 +306,8 @@ class R extends HTMLElement {
307
306
  `;
308
307
  }
309
308
  }
310
- customElements.define("eui-loader", R);
311
- class H extends HTMLElement {
309
+ customElements.define("eui-loader", S);
310
+ class z extends HTMLElement {
312
311
  static get observedAttributes() {
313
312
  return ["value", "intermediate", "id"];
314
313
  }
@@ -370,8 +369,8 @@ class H extends HTMLElement {
370
369
  this.hasAttribute("id") && (this.progress.id = this.getAttribute("id")), this.hasAttribute("intermediate") && t.classList.add("intermediate"), this.hasAttribute("value") && (t.style.width = this.getAttribute("value") + "%");
371
370
  }
372
371
  }
373
- customElements.define("eui-progressbar", H);
374
- const x = {
372
+ customElements.define("eui-progressbar", z);
373
+ const v = {
375
374
  is: {
376
375
  iPhone: /iPhone/.test(navigator.userAgent),
377
376
  iPad: /iPad/.test(navigator.userAgent),
@@ -391,80 +390,80 @@ const x = {
391
390
  haptics: "vibrate" in navigator || "Vibrate" in window || typeof window.navigator.vibrate == "function"
392
391
  },
393
392
  userAgent: navigator.userAgent
394
- }, J = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
393
+ }, Z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
395
394
  __proto__: null,
396
- device: x
395
+ device: v
397
396
  }, Symbol.toStringTag, { value: "Module" }));
398
- function _() {
397
+ function T() {
399
398
  try {
400
- const o = document.createElement("label");
401
- o.ariaHidden = "true", o.style.display = "none";
399
+ const s = document.createElement("label");
400
+ s.ariaHidden = "true", s.style.display = "none";
402
401
  const t = document.createElement("input");
403
- t.type = "checkbox", t.setAttribute("switch", ""), o.appendChild(t), document.head.appendChild(o), o.click(), document.head.removeChild(o);
402
+ t.type = "checkbox", t.setAttribute("switch", ""), s.appendChild(t), document.head.appendChild(s), s.click(), document.head.removeChild(s);
404
403
  } catch {
405
404
  }
406
405
  }
407
- function w(o) {
408
- x.supports.haptics ? navigator.vibrate(o || 50) : x.is.iPhone && _();
406
+ function x(s) {
407
+ v.supports.haptics ? navigator.vibrate(s || 50) : v.is.iPhone && T();
409
408
  }
410
- const K = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
409
+ const X = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
411
410
  __proto__: null,
412
- haptic: w
413
- }, Symbol.toStringTag, { value: "Module" })), y = (() => {
414
- let o = {}, t;
411
+ haptic: x
412
+ }, Symbol.toStringTag, { value: "Module" })), w = (() => {
413
+ let s = {}, t;
415
414
  try {
416
- o = JSON.parse(localStorage.getItem(t) || "{}");
417
- } catch (e) {
418
- console.error(e);
415
+ s = JSON.parse(localStorage.getItem(t) || "{}");
416
+ } catch (i) {
417
+ console.error(i);
419
418
  }
420
419
  return {
421
- get(e) {
422
- return o[e];
420
+ get(i) {
421
+ return s[i];
423
422
  },
424
- set(e, i) {
425
- o[e] = i, localStorage.setItem(t, JSON.stringify(o));
423
+ set(i, e) {
424
+ s[i] = e, localStorage.setItem(t, JSON.stringify(s));
426
425
  },
427
- delete(e) {
428
- delete o[e], localStorage.setItem(t, JSON.stringify(o));
426
+ delete(i) {
427
+ delete s[i], localStorage.setItem(t, JSON.stringify(s));
429
428
  },
430
429
  all() {
431
- return o;
430
+ return s;
432
431
  },
433
432
  clear() {
434
- o = {}, localStorage.setItem(t, JSON.stringify(o));
433
+ s = {}, localStorage.setItem(t, JSON.stringify(s));
435
434
  },
436
- name(e) {
437
- t = e;
435
+ name(i) {
436
+ t = i;
438
437
  try {
439
- o = JSON.parse(localStorage.getItem(t) || "{}");
440
- } catch (i) {
441
- console.error(i);
438
+ s = JSON.parse(localStorage.getItem(t) || "{}");
439
+ } catch (e) {
440
+ console.error(e);
442
441
  }
443
442
  },
444
443
  settings: {
445
- get(e) {
446
- return o && o.settings && o.settings[e];
444
+ get(i) {
445
+ return s && s.settings && s.settings[i];
447
446
  },
448
- set(e, i) {
449
- o.settings || (o.settings = {}), o.settings[e] = i, localStorage.setItem(t, JSON.stringify(o));
447
+ set(i, e) {
448
+ s.settings || (s.settings = {}), s.settings[i] = e, localStorage.setItem(t, JSON.stringify(s));
450
449
  },
451
- delete(e) {
452
- o.settings && (delete o.settings[e], localStorage.setItem(t, JSON.stringify(o)));
450
+ delete(i) {
451
+ s.settings && (delete s.settings[i], localStorage.setItem(t, JSON.stringify(s)));
453
452
  },
454
453
  all() {
455
- return o.settings || {};
454
+ return s.settings || {};
456
455
  },
457
456
  clear() {
458
- o.settings && (o.settings = {}, localStorage.setItem(t, JSON.stringify(o)));
457
+ s.settings && (s.settings = {}, localStorage.setItem(t, JSON.stringify(s)));
459
458
  }
460
459
  }
461
460
  };
462
- })(), k = y.settings, Y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
461
+ })(), M = w.settings, W = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
463
462
  __proto__: null,
464
- settings: k,
465
- storage: y
463
+ settings: M,
464
+ storage: w
466
465
  }, Symbol.toStringTag, { value: "Module" }));
467
- class F extends HTMLElement {
466
+ class $ extends HTMLElement {
468
467
  static get observedAttributes() {
469
468
  return ["selected"];
470
469
  }
@@ -544,13 +543,13 @@ class F extends HTMLElement {
544
543
  this.inputEl = this.shadowRoot.querySelector("input"), this.switchEl = this.shadowRoot.querySelector(".switch"), this.updateFromAttribute(), this.switchEl.addEventListener("click", () => this.toggle());
545
544
  }
546
545
  toggle() {
547
- this.selected = !this.selected, w();
546
+ this.selected = !this.selected, x(), this.dispatchEvent(new Event("change", { bubbles: !0, composed: !0 }));
548
547
  }
549
548
  updateFromAttribute() {
550
549
  const t = this.hasAttribute("selected");
551
550
  this.inputEl.checked = t, this.switchEl.classList.toggle("selected", t);
552
551
  }
553
- attributeChangedCallback(t, e, i) {
552
+ attributeChangedCallback(t, i, e) {
554
553
  t === "selected" && this.inputEl && this.updateFromAttribute();
555
554
  }
556
555
  get selected() {
@@ -560,8 +559,8 @@ class F extends HTMLElement {
560
559
  t ? this.setAttribute("selected", "") : this.removeAttribute("selected");
561
560
  }
562
561
  }
563
- customElements.define("eui-switch", F);
564
- class I extends HTMLElement {
562
+ customElements.define("eui-switch", $);
563
+ class R extends HTMLElement {
565
564
  constructor() {
566
565
  super(), this.attachShadow({ mode: "open" });
567
566
  }
@@ -612,97 +611,97 @@ class I extends HTMLElement {
612
611
  </style>
613
612
  <slot></slot>
614
613
  `, this.addEventListener("pointerdown", (t) => {
615
- const e = document.createElement("span"), i = t.currentTarget, n = Math.max(i.offsetWidth, i.offsetHeight);
616
- e.classList.add("ripple"), e.style.left = t.clientX - i.getBoundingClientRect().left - n / 2 + "px", e.style.top = t.clientY - i.getBoundingClientRect().top - n / 2 + "px", e.style.width = n + "px", e.style.height = n + "px", this.shadowRoot.appendChild(e), setTimeout(() => {
617
- e.remove();
614
+ const i = document.createElement("span"), e = t.currentTarget, a = Math.max(e.offsetWidth, e.offsetHeight);
615
+ i.classList.add("ripple"), i.style.left = t.clientX - e.getBoundingClientRect().left - a / 2 + "px", i.style.top = t.clientY - e.getBoundingClientRect().top - a / 2 + "px", i.style.width = a + "px", i.style.height = a + "px", this.shadowRoot.appendChild(i), setTimeout(() => {
616
+ i.remove();
618
617
  }, 600);
619
618
  });
620
619
  }
621
620
  }
622
- customElements.define("eui-chip", I);
623
- const m = "", C = (() => {
624
- const o = [];
625
- function t(a, l) {
626
- const h = [], g = a.replace(/:([^/]+)/g, (b, f) => (h.push(f), "([^/]+)")).replace(/\//g, "\\/"), p = new RegExp(`^${m}${g}$`);
627
- o.push({ regex: p, paramNames: h, renderFn: l });
628
- }
629
- function e(a) {
630
- for (const { regex: l, paramNames: h, renderFn: g } of o) {
631
- const p = a.match(l);
621
+ customElements.define("eui-chip", R);
622
+ const b = "", y = (() => {
623
+ const s = [];
624
+ function t(o, d) {
625
+ const h = [], g = o.replace(/:([^/]+)/g, (m, f) => (h.push(f), "([^/]+)")).replace(/\//g, "\\/"), p = new RegExp(`^${b}${g}$`);
626
+ s.push({ regex: p, paramNames: h, renderFn: d });
627
+ }
628
+ function i(o) {
629
+ for (const { regex: d, paramNames: h, renderFn: g } of s) {
630
+ const p = o.match(d);
632
631
  if (p) {
633
- const b = {};
634
- return h.forEach((f, L) => {
635
- b[f] = decodeURIComponent(p[L + 1]);
636
- }), { renderFn: g, params: b };
632
+ const m = {};
633
+ return h.forEach((f, C) => {
634
+ m[f] = decodeURIComponent(p[C + 1]);
635
+ }), { renderFn: g, params: m };
637
636
  }
638
637
  }
639
638
  return null;
640
639
  }
641
- function i(a, l = !0) {
642
- a.startsWith(m) || (a = m + (a.startsWith("/") ? "" : "/") + a);
643
- const h = a.split(/[?#]/)[0];
644
- if (h === window.location.pathname && a.includes("#")) {
645
- l && history.pushState({}, "", a);
646
- const p = "#" + a.split("#")[1];
647
- n(p);
640
+ function e(o, d = !0) {
641
+ o.startsWith(b) || (o = b + (o.startsWith("/") ? "" : "/") + o);
642
+ const h = o.split(/[?#]/)[0];
643
+ if (h === window.location.pathname && o.includes("#")) {
644
+ d && history.pushState({}, "", o);
645
+ const p = "#" + o.split("#")[1];
646
+ a(p);
648
647
  return;
649
648
  }
650
- const g = e(h);
649
+ const g = i(h);
651
650
  if (g)
652
- if (l && history.pushState({}, "", a), g.renderFn(g.params), window.dispatchEvent(new CustomEvent("route-changed", { detail: { path: a } })), a.includes("#")) {
653
- const p = "#" + a.split("#")[1];
654
- setTimeout(() => n(p), 100);
651
+ if (d && history.pushState({}, "", o), g.renderFn(g.params), window.dispatchEvent(new CustomEvent("route-changed", { detail: { path: o } })), o.includes("#")) {
652
+ const p = "#" + o.split("#")[1];
653
+ setTimeout(() => a(p), 100);
655
654
  } else {
656
655
  const p = document.getElementById("main");
657
656
  p && p.scrollTo(0, 0);
658
657
  }
659
- else s ? (l && history.pushState({}, "", a), s()) : console.warn(`No route found for ${h}`);
658
+ else n ? (d && history.pushState({}, "", o), n()) : console.warn(`No route found for ${h}`);
660
659
  }
661
- function n(a) {
662
- if (a)
660
+ function a(o) {
661
+ if (o)
663
662
  try {
664
- const l = document.querySelector(a);
665
- l && l.scrollIntoView({ behavior: "smooth" });
663
+ const d = document.querySelector(o);
664
+ d && d.scrollIntoView({ behavior: "smooth" });
666
665
  } catch {
667
- console.warn("Invalid hash:", a);
666
+ console.warn("Invalid hash:", o);
668
667
  }
669
668
  }
670
- let s = null;
671
- function r(a) {
672
- s = a;
669
+ let n = null;
670
+ function r(o) {
671
+ n = o;
673
672
  }
674
- function c() {
673
+ function l() {
675
674
  history.back();
676
675
  }
677
- function d() {
678
- return window.location.pathname.replace(m, "") || "/";
676
+ function c() {
677
+ return window.location.pathname.replace(b, "") || "/";
679
678
  }
680
679
  return window.addEventListener("popstate", () => {
681
- const a = window.location.pathname + window.location.search + window.location.hash;
682
- i(a, !1);
683
- }), window.addEventListener("click", (a) => {
684
- if (a.button !== 0 || a.metaKey || a.altKey || a.ctrlKey || a.shiftKey) return;
685
- const l = a.target.closest("a");
686
- if (!l || l.hasAttribute("download") || l.getAttribute("target") === "_blank") return;
687
- const h = l.getAttribute("href");
680
+ const o = window.location.pathname + window.location.search + window.location.hash;
681
+ e(o, !1);
682
+ }), window.addEventListener("click", (o) => {
683
+ if (o.button !== 0 || o.metaKey || o.altKey || o.ctrlKey || o.shiftKey) return;
684
+ const d = o.target.closest("a");
685
+ if (!d || d.hasAttribute("download") || d.getAttribute("target") === "_blank") return;
686
+ const h = d.getAttribute("href");
688
687
  if (!(!h || h.startsWith("http") && !h.startsWith(window.location.origin))) {
689
- if (a.preventDefault(), h.startsWith("#")) {
690
- history.pushState({}, "", h), n(h);
688
+ if (o.preventDefault(), h.startsWith("#")) {
689
+ history.pushState({}, "", h), a(h);
691
690
  return;
692
691
  }
693
- i(h);
692
+ e(h);
694
693
  }
695
- }), { add: t, navigate: i, back: c, location: d, setNotFound: r };
694
+ }), { add: t, navigate: e, back: l, location: c, setNotFound: r };
696
695
  })();
697
- async function G(o) {
696
+ async function J(s) {
698
697
  try {
699
698
  const t = document.getElementById("main");
700
- t.classList.add("fade-out"), await new Promise((i) => setTimeout(i, 200));
701
- const e = await fetch(`/src/pages/${o}.html`).then((i) => i.text());
702
- t.innerHTML = e, t.classList.remove("fade-out"), t.classList.add("fade-in"), window.location.hash ? setTimeout(() => {
699
+ t.classList.add("fade-out"), await new Promise((e) => setTimeout(e, 200));
700
+ const i = await fetch(`/src/pages/${s}.html`).then((e) => e.text());
701
+ t.innerHTML = i, t.classList.remove("fade-out"), t.classList.add("fade-in"), window.location.hash ? setTimeout(() => {
703
702
  try {
704
- const i = document.querySelector(window.location.hash);
705
- i && i.scrollIntoView({ behavior: "smooth" });
703
+ const e = document.querySelector(window.location.hash);
704
+ e && e.scrollIntoView({ behavior: "smooth" });
706
705
  } catch {
707
706
  }
708
707
  }, 100) : t && t.scrollTo(0, 0), setTimeout(() => {
@@ -712,60 +711,59 @@ async function G(o) {
712
711
  console.error("Page load failed:", t);
713
712
  }
714
713
  }
715
- class j extends HTMLElement {
716
- constructor() {
717
- super();
718
- v(this, "handleClick", () => {
719
- const e = this.getAttribute("path");
720
- e && C.navigate(e);
721
- });
722
- this.attachShadow({ mode: "open" });
723
- }
714
+ class H extends HTMLElement {
724
715
  static get observedAttributes() {
725
716
  return ["path", "icon", "label", "badge", "active", "avatar-src", "avatar-name"];
726
717
  }
718
+ constructor() {
719
+ super(), this.attachShadow({ mode: "open" });
720
+ }
727
721
  connectedCallback() {
728
722
  this.hasRendered || (this.render(), this.setupEventListeners(), this.hasRendered = !0), this.updateContent(), this.addEventListener("click", this.handleClick);
729
723
  }
730
724
  disconnectedCallback() {
731
725
  this.removeEventListener("click", this.handleClick);
732
726
  }
733
- attributeChangedCallback(e, i, n) {
734
- if (i !== n && this.hasRendered) {
735
- if (e === "active")
727
+ attributeChangedCallback(t, i, e) {
728
+ if (i !== e && this.hasRendered) {
729
+ if (t === "active")
736
730
  return;
737
731
  this.updateContent();
738
732
  }
739
733
  }
734
+ handleClick = () => {
735
+ const t = this.getAttribute("path");
736
+ t && y.navigate(t);
737
+ };
740
738
  setupEventListeners() {
741
- this.addEventListener("pointerdown", (e) => {
742
- const i = document.createElement("span"), n = e.currentTarget, s = n.getBoundingClientRect(), r = Math.max(n.offsetWidth, n.offsetHeight), c = r / 2;
743
- i.classList.add("ripple"), i.style.width = `${r}px`, i.style.height = `${r}px`, i.style.left = `${e.clientX - s.left - c}px`, i.style.top = `${e.clientY - s.top - c}px`, this.shadowRoot.appendChild(i), i.addEventListener("animationend", () => {
739
+ this.addEventListener("pointerdown", (t) => {
740
+ const i = document.createElement("span"), e = t.currentTarget, a = e.getBoundingClientRect(), n = Math.max(e.offsetWidth, e.offsetHeight), r = n / 2;
741
+ i.classList.add("ripple"), i.style.width = `${n}px`, i.style.height = `${n}px`, i.style.left = `${t.clientX - a.left - r}px`, i.style.top = `${t.clientY - a.top - r}px`, this.shadowRoot.appendChild(i), i.addEventListener("animationend", () => {
744
742
  i.remove();
745
743
  });
746
744
  });
747
745
  }
748
746
  updateContent() {
749
- const e = this.getAttribute("icon"), i = this.getAttribute("avatar-src"), n = this.getAttribute("avatar-name"), s = this.getAttribute("label") || "", r = this.getAttribute("badge"), c = this.shadowRoot.querySelector(".badge");
750
- if (r)
751
- if (c)
752
- c.textContent = r;
747
+ const t = this.getAttribute("icon"), i = this.getAttribute("avatar-src"), e = this.getAttribute("avatar-name"), a = this.getAttribute("label") || "", n = this.getAttribute("badge"), r = this.shadowRoot.querySelector(".badge");
748
+ if (n)
749
+ if (r)
750
+ r.textContent = n;
753
751
  else {
754
- const l = document.createElement("span");
755
- l.className = "badge", l.textContent = r, this.shadowRoot.appendChild(l);
752
+ const o = document.createElement("span");
753
+ o.className = "badge", o.textContent = n, this.shadowRoot.appendChild(o);
756
754
  }
757
- else c && c.remove();
758
- const d = this.shadowRoot.querySelector("slot[name='icon']");
759
- if (d)
760
- if (i || n) {
761
- let l = '<eui-avatar size="24"';
762
- n && (l += ` name="${n}"`), l += ">", i && (l += `<img src="${i}" alt="${n || "Avatar"}" />`), l += "</eui-avatar>", d.innerHTML = l;
755
+ else r && r.remove();
756
+ const l = this.shadowRoot.querySelector("slot[name='icon']");
757
+ if (l)
758
+ if (i || e) {
759
+ let o = '<eui-avatar size="24"';
760
+ e && (o += ` name="${e}"`), o += ">", i && (o += `<img src="${i}" alt="${e || "Avatar"}" />`), o += "</eui-avatar>", l.innerHTML = o;
763
761
  } else {
764
- const l = d.querySelector("eui-icon");
765
- e && l ? l.getAttribute("name") !== e && l.setAttribute("name", e) : e ? d.innerHTML = `<eui-icon width="24" height="24" name="${e}"></eui-icon>` : d.innerHTML = "";
762
+ const o = l.querySelector("eui-icon");
763
+ t && o ? o.getAttribute("name") !== t && o.setAttribute("name", t) : t ? l.innerHTML = `<eui-icon width="24" height="24" name="${t}"></eui-icon>` : l.innerHTML = "";
766
764
  }
767
- const a = this.shadowRoot.querySelector(".label");
768
- a && (a.textContent = s);
765
+ const c = this.shadowRoot.querySelector(".label");
766
+ c && (c.textContent = a);
769
767
  }
770
768
  render() {
771
769
  this.shadowRoot.innerHTML = `
@@ -876,8 +874,8 @@ class j extends HTMLElement {
876
874
  `;
877
875
  }
878
876
  }
879
- customElements.define("eui-nav-item", j);
880
- class q extends HTMLElement {
877
+ customElements.define("eui-nav-item", H);
878
+ class _ extends HTMLElement {
881
879
  constructor() {
882
880
  super(), this.attachShadow({ mode: "open" });
883
881
  }
@@ -986,11 +984,10 @@ class q extends HTMLElement {
986
984
  <a href="#content" id="skip_navigation_link">Skip To Content</a>
987
985
  <div class="nav-items">
988
986
  ${this.navItems.map((t) => {
989
- var n, s;
990
987
  if (t.type === "divider")
991
988
  return '<div style="height: 1px; background: var(--app-300); margin: 0.5rem 0;"></div>';
992
- const e = ((n = t.avatar) == null ? void 0 : n.src) || "", i = ((s = t.avatar) == null ? void 0 : s.name) || "";
993
- return `<eui-nav-item path="${t.path}" icon="${t.icon}" avatar-src="${e}" avatar-name="${i}" label="${t.label}"></eui-nav-item>`;
989
+ const i = t.avatar?.src || "", e = t.avatar?.name || "";
990
+ return `<eui-nav-item path="${t.path}" icon="${t.icon}" avatar-src="${i}" avatar-name="${e}" label="${t.label}"></eui-nav-item>`;
994
991
  }).join("")}
995
992
  </div>
996
993
  </div>
@@ -1003,13 +1000,13 @@ class q extends HTMLElement {
1003
1000
  return this._navItems || [];
1004
1001
  }
1005
1002
  updateActiveState(t) {
1006
- t || (t = C.location()), t.startsWith("/") || (t = "/" + t), this.shadowRoot.querySelectorAll("eui-nav-item").forEach((i) => {
1007
- i.getAttribute("path") === t ? i.setAttribute("active", "") : i.removeAttribute("active");
1003
+ t || (t = y.location()), t.startsWith("/") || (t = "/" + t), this.shadowRoot.querySelectorAll("eui-nav-item").forEach((e) => {
1004
+ e.getAttribute("path") === t ? e.setAttribute("active", "") : e.removeAttribute("active");
1008
1005
  });
1009
1006
  }
1010
1007
  }
1011
- customElements.define("eui-app-nav", q);
1012
- class B extends HTMLElement {
1008
+ customElements.define("eui-app-nav", _);
1009
+ class F extends HTMLElement {
1013
1010
  static get observedAttributes() {
1014
1011
  return ["type", "title", "subtitle", "img"];
1015
1012
  }
@@ -1105,13 +1102,13 @@ class B extends HTMLElement {
1105
1102
  connectedCallback() {
1106
1103
  this.hd = this.shadowRoot.querySelector(".header"), this.hasAttribute("type") && this.hd.classList.add(this.getAttribute("type"));
1107
1104
  }
1108
- attributeChangedCallback(t, e, i) {
1109
- const n = this.shadowRoot.querySelector("h1"), s = this.shadowRoot.querySelector("p"), r = this.shadowRoot.querySelector(".img");
1110
- t === "title" && (n.textContent = i), t === "subtitle" && (s.textContent = i), t === "img" && (r.style.backgroundImage = i ? `url(${i})` : "");
1105
+ attributeChangedCallback(t, i, e) {
1106
+ const a = this.shadowRoot.querySelector("h1"), n = this.shadowRoot.querySelector("p"), r = this.shadowRoot.querySelector(".img");
1107
+ t === "title" && (a.textContent = e), t === "subtitle" && (n.textContent = e), t === "img" && (r.style.backgroundImage = e ? `url(${e})` : "");
1111
1108
  }
1112
1109
  }
1113
- customElements.define("eui-header", B);
1114
- class N extends HTMLElement {
1110
+ customElements.define("eui-header", F);
1111
+ class I extends HTMLElement {
1115
1112
  static get observedAttributes() {
1116
1113
  return ["selected"];
1117
1114
  }
@@ -1119,7 +1116,8 @@ class N extends HTMLElement {
1119
1116
  super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = `
1120
1117
  <style>
1121
1118
  :host {
1122
- display: block;
1119
+ display: inline-block;
1120
+ vertical-align: bottom;
1123
1121
  position: relative;
1124
1122
  cursor: pointer;
1125
1123
  width: 24px;
@@ -1205,15 +1203,13 @@ class N extends HTMLElement {
1205
1203
  this.inputEl = this.shadowRoot.querySelector("input"), this.checkEl = this.shadowRoot.querySelector(".checkbox"), this.updateFromAttribute(), this.checkEl.addEventListener("click", () => this.toggle());
1206
1204
  }
1207
1205
  toggle() {
1208
- this.selected = !this.selected, w();
1209
- const t = this.selected, e = this.dataset.setting;
1210
- e && k.set(e, t);
1206
+ this.selected = !this.selected, x(), this.dispatchEvent(new Event("change", { bubbles: !0, composed: !0 }));
1211
1207
  }
1212
1208
  updateFromAttribute() {
1213
1209
  const t = this.hasAttribute("selected");
1214
1210
  this.inputEl.checked = t, this.checkEl.classList.toggle("selected", t);
1215
1211
  }
1216
- attributeChangedCallback(t, e, i) {
1212
+ attributeChangedCallback(t, i, e) {
1217
1213
  t === "selected" && this.inputEl && this.updateFromAttribute();
1218
1214
  }
1219
1215
  get selected() {
@@ -1223,8 +1219,9 @@ class N extends HTMLElement {
1223
1219
  t ? this.setAttribute("selected", "") : this.removeAttribute("selected");
1224
1220
  }
1225
1221
  }
1226
- customElements.define("eui-checkbox", N);
1227
- class E extends HTMLElement {
1222
+ customElements.define("eui-checkbox", I);
1223
+ class q extends HTMLElement {
1224
+ static observedAttributes = ["type", "width", "height", "border-radius", "icon", "link", "href"];
1228
1225
  constructor() {
1229
1226
  super(), this.attachShadow({ mode: "open" });
1230
1227
  }
@@ -1232,7 +1229,7 @@ class E extends HTMLElement {
1232
1229
  this.render();
1233
1230
  }
1234
1231
  render() {
1235
- const t = this.getAttribute("href"), e = t ? "a" : "button";
1232
+ const t = this.getAttribute("href"), i = t ? "a" : "button";
1236
1233
  this.shadowRoot.innerHTML = `
1237
1234
  <style>
1238
1235
  button, a {
@@ -1336,22 +1333,21 @@ class E extends HTMLElement {
1336
1333
  }
1337
1334
 
1338
1335
  </style>
1339
- <${e}>
1336
+ <${i}>
1340
1337
  <slot></slot>
1341
- </${e}>
1338
+ </${i}>
1342
1339
  `;
1343
- const i = this.shadowRoot.querySelector(e);
1344
- t && i.setAttribute("href", t), this.hasAttribute("type") && i.classList.add(this.getAttribute("type")), this.hasAttribute("icon") && i.classList.add("icon"), this.hasAttribute("width") && (i.style.width = this.getAttribute("width") + "px"), this.hasAttribute("height") && (i.style.height = this.getAttribute("height") + "px"), this.hasAttribute("border-radius") && (i.style.borderRadius = this.getAttribute("border-radius") + "px"), i.addEventListener("pointerdown", (n) => {
1345
- const s = document.createElement("span"), r = n.currentTarget, c = r.getBoundingClientRect(), d = Math.max(r.offsetWidth, r.offsetHeight), a = d / 2;
1346
- s.classList.add("ripple"), s.style.width = `${d}px`, s.style.height = `${d}px`, s.style.left = `${n.clientX - c.left - a}px`, s.style.top = `${n.clientY - c.top - a}px`, i.appendChild(s), s.addEventListener("animationend", () => {
1347
- s.remove();
1340
+ const e = this.shadowRoot.querySelector(i);
1341
+ t && e.setAttribute("href", t), this.hasAttribute("type") && e.classList.add(this.getAttribute("type")), this.hasAttribute("icon") && e.classList.add("icon"), this.hasAttribute("width") && (e.style.width = this.getAttribute("width") + "px"), this.hasAttribute("height") && (e.style.height = this.getAttribute("height") + "px"), this.hasAttribute("border-radius") && (e.style.borderRadius = this.getAttribute("border-radius") + "px"), e.addEventListener("pointerdown", (a) => {
1342
+ const n = document.createElement("span"), r = a.currentTarget, l = r.getBoundingClientRect(), c = Math.max(r.offsetWidth, r.offsetHeight), o = c / 2;
1343
+ n.classList.add("ripple"), n.style.width = `${c}px`, n.style.height = `${c}px`, n.style.left = `${a.clientX - l.left - o}px`, n.style.top = `${a.clientY - l.top - o}px`, e.appendChild(n), n.addEventListener("animationend", () => {
1344
+ n.remove();
1348
1345
  });
1349
1346
  });
1350
1347
  }
1351
1348
  }
1352
- v(E, "observedAttributes", ["type", "width", "height", "border-radius", "icon", "link", "href"]);
1353
- customElements.define("eui-button", E);
1354
- class O extends HTMLElement {
1349
+ customElements.define("eui-button", q);
1350
+ class j extends HTMLElement {
1355
1351
  static get observedAttributes() {
1356
1352
  return ["type", "anchor"];
1357
1353
  }
@@ -1423,28 +1419,28 @@ class O extends HTMLElement {
1423
1419
  `;
1424
1420
  }
1425
1421
  }
1426
- customElements.define("eui-heading", O);
1427
- function P(o) {
1428
- const i = Date.now() - o, n = Math.floor(i / 1e3), s = Math.floor(n / 60), r = Math.floor(s / 60), c = Math.floor(r / 24), d = Math.floor(c / 30), a = Math.floor(d / 12);
1429
- return a > 0 ? `${a}y` : d > 0 ? `${d}mo` : c > 0 ? `${c}d` : r > 0 ? `${r}h` : s > 0 ? `${s}m` : `${n}s`;
1422
+ customElements.define("eui-heading", j);
1423
+ function B(s) {
1424
+ const e = Date.now() - s, a = Math.floor(e / 1e3), n = Math.floor(a / 60), r = Math.floor(n / 60), l = Math.floor(r / 24), c = Math.floor(l / 30), o = Math.floor(c / 12);
1425
+ return o > 0 ? `${o}y` : c > 0 ? `${c}mo` : l > 0 ? `${l}d` : r > 0 ? `${r}h` : n > 0 ? `${n}m` : `${a}s`;
1430
1426
  }
1431
- function V(o) {
1432
- const i = Date.now() - o, n = Math.floor(i / 1e3), s = Math.floor(n / 60), r = Math.floor(s / 60), c = Math.floor(r / 24), d = Math.floor(c / 30), a = Math.floor(d / 12);
1433
- return a > 0 ? `${a} year${a > 1 ? "s" : ""} ago` : d > 0 ? `${d} month${d > 1 ? "s" : ""} ago` : c > 0 ? `${c} day${c > 1 ? "s" : ""} ago` : r > 0 ? `${r} hour${r > 1 ? "s" : ""} ago` : s > 0 ? `${s} minute${s > 1 ? "s" : ""} ago` : `${n} second${n > 1 ? "s" : ""} ago`;
1427
+ function N(s) {
1428
+ const e = Date.now() - s, a = Math.floor(e / 1e3), n = Math.floor(a / 60), r = Math.floor(n / 60), l = Math.floor(r / 24), c = Math.floor(l / 30), o = Math.floor(c / 12);
1429
+ return o > 0 ? `${o} year${o > 1 ? "s" : ""} ago` : c > 0 ? `${c} month${c > 1 ? "s" : ""} ago` : l > 0 ? `${l} day${l > 1 ? "s" : ""} ago` : r > 0 ? `${r} hour${r > 1 ? "s" : ""} ago` : n > 0 ? `${n} minute${n > 1 ? "s" : ""} ago` : `${a} second${a > 1 ? "s" : ""} ago`;
1434
1430
  }
1435
- function D(o) {
1436
- return o.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;").replace(/`/g, "&#96;").replace(/'/g, "&#39;");
1431
+ function O(s) {
1432
+ return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;").replace(/`/g, "&#96;").replace(/'/g, "&#39;");
1437
1433
  }
1438
- function A(o) {
1434
+ function k(s) {
1439
1435
  const t = document.createElement("input");
1440
- t.value = o, document.body.appendChild(t), t.select(), document.execCommand("copy"), document.body.removeChild(t);
1436
+ t.value = s, document.body.appendChild(t), t.select(), document.execCommand("copy"), document.body.removeChild(t);
1441
1437
  }
1442
- const Q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1438
+ const K = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1443
1439
  __proto__: null,
1444
- copystr: A,
1445
- joinedAgo: V,
1446
- sanitize: D,
1447
- timeAgo: P
1440
+ copystr: k,
1441
+ joinedAgo: N,
1442
+ sanitize: O,
1443
+ timeAgo: B
1448
1444
  }, Symbol.toStringTag, { value: "Module" }));
1449
1445
  class U extends HTMLElement {
1450
1446
  static get observedAttributes() {
@@ -1456,11 +1452,11 @@ class U extends HTMLElement {
1456
1452
  connectedCallback() {
1457
1453
  this._isRendered || (this.render(), this._isRendered = !0);
1458
1454
  }
1459
- attributeChangedCallback(t, e, i) {
1460
- this._isRendered && e !== i && this.render();
1455
+ attributeChangedCallback(t, i, e) {
1456
+ this._isRendered && i !== e && this.render();
1461
1457
  }
1462
1458
  render() {
1463
- const t = this.hasAttribute("copy"), e = this.getAttribute("language") || "text";
1459
+ const t = this.hasAttribute("copy"), i = this.getAttribute("language") || "text";
1464
1460
  this.shadowRoot.innerHTML = `
1465
1461
  <style>
1466
1462
  :host {
@@ -1514,39 +1510,39 @@ class U extends HTMLElement {
1514
1510
 
1515
1511
  <pre class="${t ? "g" : ""}"><code></code></pre>
1516
1512
  `, this.copyBtn = this.shadowRoot.querySelector(".copy"), this.codeEl = this.shadowRoot.querySelector("code");
1517
- const i = this._getFormattedText();
1518
- this.codeEl.innerHTML = this._highlight(i, e), t ? this.copyBtn.addEventListener("click", this._boundCopy) : this.copyBtn.style.display = "none";
1513
+ const e = this._getFormattedText();
1514
+ this.codeEl.innerHTML = this._highlight(e, i), t ? this.copyBtn.addEventListener("click", this._boundCopy) : this.copyBtn.style.display = "none";
1519
1515
  }
1520
1516
  _getFormattedText() {
1521
- let e = (this.querySelector("code") || this).innerHTML || "";
1522
- e = this._unescapeHtml(e), e = e.replace(/^\s*\n/, "").replace(/\n\s*$/, "");
1523
- const i = e.split(`
1524
- `), n = i.filter((r) => r.trim()).map((r) => r.match(/^\s*/)[0].length), s = n.length ? Math.min(...n) : 0;
1525
- return i.map((r) => r.slice(s)).join(`
1517
+ let i = (this.querySelector("code") || this).innerHTML || "";
1518
+ i = this._unescapeHtml(i), i = i.replace(/^\s*\n/, "").replace(/\n\s*$/, "");
1519
+ const e = i.split(`
1520
+ `), a = e.filter((r) => r.trim()).map((r) => r.match(/^\s*/)[0].length), n = a.length ? Math.min(...a) : 0;
1521
+ return e.map((r) => r.slice(n)).join(`
1526
1522
  `);
1527
1523
  }
1528
1524
  _unescapeHtml(t) {
1529
- const e = document.createElement("textarea");
1530
- return e.innerHTML = t, e.value;
1525
+ const i = document.createElement("textarea");
1526
+ return i.innerHTML = t, i.value;
1531
1527
  }
1532
- _highlight(t, e) {
1528
+ _highlight(t, i) {
1533
1529
  t = t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
1534
- const i = {};
1535
- let n = 0;
1536
- function s(r, c) {
1537
- const d = `__TOKEN_${c}_${n++}__`;
1538
- return i[d] = `<span class="token ${c}">${r}</span>`, d;
1530
+ const e = {};
1531
+ let a = 0;
1532
+ function n(r, l) {
1533
+ const c = `__TOKEN_${l}_${a++}__`;
1534
+ return e[c] = `<span class="token ${l}">${r}</span>`, c;
1539
1535
  }
1540
- return ["javascript", "js", "json", "bash", "sh", "css"].includes(e) ? (t = t.replace(/("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/g, (r) => s(r, "string")), e === "bash" || e === "sh" ? t = t.replace(/(#.*$)/gm, (r) => s(r, "comment")) : e === "css" ? t = t.replace(/(\/\*[\s\S]*?\*\/)/g, (r) => s(r, "comment")) : t = t.replace(/(\/\/.*$|\/\*[\s\S]*?\*\/)/gm, (r) => s(r, "comment"))) : ["html", "xml"].includes(e) && (t = t.replace(/(&lt;!--[\s\S]*?--&gt;)/g, (r) => s(r, "comment")), t = t.replace(/(&lt;\/?[a-z0-9:-]+)/gi, (r) => s(r, "tag"))), e === "javascript" || e === "js" || e === "json" ? (t = t.replace(/\b(const|let|var|if|else|for|while|return|function|class|import|export|from|default|switch|case|break|continue|new|this|async|await)\b/g, '<span class="token keyword">$1</span>'), t = t.replace(/\b(true|false|null|undefined)\b/g, '<span class="token boolean">$1</span>'), t = t.replace(/\b([a-zA-Z0-9_]+)\s*(?=\()/g, '<span class="token function">$1</span>')) : e === "bash" || e === "sh" ? (t = t.replace(/\b(npm|npx|node|git|cd|ls|mkdir|rm|mv|cp|echo|cat|sudo|docker|brew|grep|curl|wget|chmod|chown|touch)\b/g, '<span class="token keyword">$1</span>'), t = t.replace(/\b(install|run|build|start|test|dev|init|clone|pull|push|commit|add|checkout|branch|merge)\b/g, '<span class="token function">$1</span>'), t = t.replace(/(\s-+[a-zA-Z0-9-]+)/g, '<span class="token attr-name">$1</span>'), t = t.replace(/(\$[A-Z0-9_]+)/g, '<span class="token number">$1</span>')) : e === "html" || e === "xml" ? (t = t.replace(/\s([a-z0-9:-]+)=/gi, (r, c) => " " + s(c, "attr-name") + "="), t = t.replace(/(".*?")/g, (r) => s(r, "attr-value")), t = t.replace(/&gt;/g, '<span class="token tag">&gt;</span>')) : e === "css" && (t = t.replace(/([a-z-]+)(?=:)/g, '<span class="token keyword">$1</span>')), Object.keys(i).reverse().forEach((r) => {
1541
- t = t.replace(r, i[r]);
1536
+ return ["javascript", "js", "json", "bash", "sh", "css"].includes(i) ? (t = t.replace(/("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/g, (r) => n(r, "string")), i === "bash" || i === "sh" ? t = t.replace(/(#.*$)/gm, (r) => n(r, "comment")) : i === "css" ? t = t.replace(/(\/\*[\s\S]*?\*\/)/g, (r) => n(r, "comment")) : t = t.replace(/(\/\/.*$|\/\*[\s\S]*?\*\/)/gm, (r) => n(r, "comment"))) : ["html", "xml"].includes(i) && (t = t.replace(/(&lt;!--[\s\S]*?--&gt;)/g, (r) => n(r, "comment")), t = t.replace(/(&lt;\/?[a-z0-9:-]+)/gi, (r) => n(r, "tag"))), i === "javascript" || i === "js" || i === "json" ? (t = t.replace(/\b(const|let|var|if|else|for|while|return|function|class|import|export|from|default|switch|case|break|continue|new|this|async|await)\b/g, '<span class="token keyword">$1</span>'), t = t.replace(/\b(true|false|null|undefined)\b/g, '<span class="token boolean">$1</span>'), t = t.replace(/\b([a-zA-Z0-9_]+)\s*(?=\()/g, '<span class="token function">$1</span>')) : i === "bash" || i === "sh" ? (t = t.replace(/\b(npm|npx|node|git|cd|ls|mkdir|rm|mv|cp|echo|cat|sudo|docker|brew|grep|curl|wget|chmod|chown|touch)\b/g, '<span class="token keyword">$1</span>'), t = t.replace(/\b(install|run|build|start|test|dev|init|clone|pull|push|commit|add|checkout|branch|merge)\b/g, '<span class="token function">$1</span>'), t = t.replace(/(\s-+[a-zA-Z0-9-]+)/g, '<span class="token attr-name">$1</span>'), t = t.replace(/(\$[A-Z0-9_]+)/g, '<span class="token number">$1</span>')) : i === "html" || i === "xml" ? (t = t.replace(/\s([a-z0-9:-]+)=/gi, (r, l) => " " + n(l, "attr-name") + "="), t = t.replace(/(".*?")/g, (r) => n(r, "attr-value")), t = t.replace(/&gt;/g, '<span class="token tag">&gt;</span>')) : i === "css" && (t = t.replace(/([a-z-]+)(?=:)/g, '<span class="token keyword">$1</span>')), Object.keys(e).reverse().forEach((r) => {
1537
+ t = t.replace(r, e[r]);
1542
1538
  }), t;
1543
1539
  }
1544
1540
  _onCopy() {
1545
- A(this._getFormattedText());
1541
+ k(this._getFormattedText());
1546
1542
  const t = this.copyBtn.querySelector("eui-icon");
1547
1543
  if (t) {
1548
- const e = t.getAttribute("name");
1549
- t.setAttribute("name", "check"), setTimeout(() => t.setAttribute("name", e), 2e3);
1544
+ const i = t.getAttribute("name");
1545
+ t.setAttribute("name", "check"), setTimeout(() => t.setAttribute("name", i), 2e3);
1550
1546
  }
1551
1547
  }
1552
1548
  disconnectedCallback() {
@@ -1554,7 +1550,7 @@ class U extends HTMLElement {
1554
1550
  }
1555
1551
  }
1556
1552
  customElements.define("eui-code", U);
1557
- class Z extends HTMLElement {
1553
+ class P extends HTMLElement {
1558
1554
  constructor() {
1559
1555
  super(), this.attachShadow({ mode: "open" });
1560
1556
  }
@@ -1564,7 +1560,7 @@ class Z extends HTMLElement {
1564
1560
  static get observedAttributes() {
1565
1561
  return ["name"];
1566
1562
  }
1567
- attributeChangedCallback(t, e, i) {
1563
+ attributeChangedCallback(t, i, e) {
1568
1564
  t === "name" && (this.render(), this.setupEventListeners());
1569
1565
  }
1570
1566
  setupEventListeners() {
@@ -1670,8 +1666,8 @@ class Z extends HTMLElement {
1670
1666
  `;
1671
1667
  }
1672
1668
  }
1673
- customElements.define("eui-app-titlebar", Z);
1674
- class X extends HTMLElement {
1669
+ customElements.define("eui-app-titlebar", P);
1670
+ class V extends HTMLElement {
1675
1671
  constructor() {
1676
1672
  super(), this.attachShadow({ mode: "open" }), this._handleMouseDown = this._addRipple.bind(this);
1677
1673
  }
@@ -1681,16 +1677,16 @@ class X extends HTMLElement {
1681
1677
  static get observedAttributes() {
1682
1678
  return ["elevated", "interactive", "ripple"];
1683
1679
  }
1684
- attributeChangedCallback(t, e, i) {
1685
- e !== i && t === "ripple" && this.setupEventListeners();
1680
+ attributeChangedCallback(t, i, e) {
1681
+ i !== e && t === "ripple" && this.setupEventListeners();
1686
1682
  }
1687
1683
  setupEventListeners() {
1688
1684
  this.removeEventListener("mousedown", this._handleMouseDown), this.hasAttribute("ripple") && this.addEventListener("mousedown", this._handleMouseDown);
1689
1685
  }
1690
1686
  _addRipple(t) {
1691
- const e = this.getBoundingClientRect(), i = document.createElement("span"), n = Math.max(e.width, e.height), s = n / 2;
1692
- i.style.width = i.style.height = `${n}px`, i.style.left = `${t.clientX - e.left - s}px`, i.style.top = `${t.clientY - e.top - s}px`, i.classList.add("ripple"), this.shadowRoot.querySelector(".surface").appendChild(i), i.addEventListener("animationend", () => {
1693
- i.remove();
1687
+ const i = this.getBoundingClientRect(), e = document.createElement("span"), a = Math.max(i.width, i.height), n = a / 2;
1688
+ e.style.width = e.style.height = `${a}px`, e.style.left = `${t.clientX - i.left - n}px`, e.style.top = `${t.clientY - i.top - n}px`, e.classList.add("ripple"), this.shadowRoot.querySelector(".surface").appendChild(e), e.addEventListener("animationend", () => {
1689
+ e.remove();
1694
1690
  });
1695
1691
  }
1696
1692
  render() {
@@ -1758,14 +1754,143 @@ class X extends HTMLElement {
1758
1754
  `;
1759
1755
  }
1760
1756
  }
1761
- customElements.define("eui-surface", X);
1757
+ customElements.define("eui-surface", V);
1758
+ class D extends HTMLElement {
1759
+ static get observedAttributes() {
1760
+ return ["value", "min", "max", "step", "label"];
1761
+ }
1762
+ constructor() {
1763
+ super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = `
1764
+ <style>
1765
+ :host {
1766
+ display: flex;
1767
+ flex-direction: column;
1768
+ gap: 8px;
1769
+ width: 100%;
1770
+ max-width: 300px;
1771
+ margin: 0.75rem 0;
1772
+ user-select: none;
1773
+ }
1774
+
1775
+ .header {
1776
+ display: flex;
1777
+ justify-content: space-between;
1778
+ align-items: center;
1779
+ color: var(--app-400, #999);
1780
+ font-size: 0.85rem;
1781
+ font-weight: 500;
1782
+ padding: 0 4px;
1783
+ }
1784
+
1785
+ .slider-container {
1786
+ position: relative;
1787
+ height: 32px;
1788
+ display: flex;
1789
+ align-items: center;
1790
+ }
1791
+
1792
+ input[type="range"] {
1793
+ -webkit-appearance: none;
1794
+ appearance: none;
1795
+ opacity: 0;
1796
+ width: 100%;
1797
+ height: 4px;
1798
+ background: var(--app-300, #333);
1799
+ border-radius: 3px;
1800
+ outline: none;
1801
+ margin: 0;
1802
+ cursor: pointer;
1803
+ position: relative;
1804
+ z-index: 1;
1805
+ }
1806
+
1807
+ .track {
1808
+ position: absolute;
1809
+ height: 4px;
1810
+ width: 100%;
1811
+ background: var(--app-200, #333);
1812
+ border-radius: 3px;
1813
+ overflow: hidden;
1814
+ pointer-events: none;
1815
+ z-index: 0;
1816
+ }
1817
+
1818
+ .track-fill {
1819
+ position: absolute;
1820
+ height: 4px;
1821
+ background: var(--app-accent, #6366f1);
1822
+ pointer-events: none;
1823
+ z-index: 0;
1824
+ left: 0;
1825
+ }
1826
+
1827
+ .slider-thumb {
1828
+ position: absolute;
1829
+ width: 20px;
1830
+ height: 20px;
1831
+ background: var(--app-accent, #6366f1);
1832
+ box-shadow: inset 0 0 0 1px var(--app-500, #131318), inset 0 0 0 4px var(--app-200, #131318);
1833
+ border-radius: 50%;
1834
+ pointer-events: none;
1835
+ z-index: 0;
1836
+ left: 0;
1837
+ }
1838
+
1839
+ .slider-thumb.active {
1840
+ background: var(--app-accent-50, #7376ff);
1841
+ }
1842
+
1843
+ .value-badge {
1844
+ color: var(--app-text);
1845
+ font-weight: 600;
1846
+ }
1847
+ </style>
1848
+ <div class="header">
1849
+ <span class="label"></span>
1850
+ <span class="value-badge"></span>
1851
+ </div>
1852
+ <div class="slider-container">
1853
+ <div class="track">
1854
+ <div class="track-fill"></div>
1855
+ </div>
1856
+ <div class="slider-thumb"></div>
1857
+ <input type="range">
1858
+ </div>
1859
+ `;
1860
+ }
1861
+ connectedCallback() {
1862
+ this.inputEl = this.shadowRoot.querySelector("input"), this.labelEl = this.shadowRoot.querySelector(".label"), this.valueEl = this.shadowRoot.querySelector(".value-badge"), this.trackFillEl = this.shadowRoot.querySelector(".track-fill"), this.sliderThumbEl = this.shadowRoot.querySelector(".slider-thumb"), this.inputEl.min = this.getAttribute("min") || 0, this.inputEl.max = this.getAttribute("max") || 100, this.inputEl.step = this.getAttribute("step") || 1, this.inputEl.value = this.getAttribute("value") || 50, this.hasAttribute("label") && (this.labelEl.textContent = this.getAttribute("label")), this.updateUI(), this.inputEl.addEventListener("input", () => {
1863
+ this.updateValue(this.inputEl.value), this.dispatchEvent(new Event("input", { bubbles: !0, composed: !0 }));
1864
+ }), this.inputEl.addEventListener("change", () => {
1865
+ this.dispatchEvent(new Event("change", { bubbles: !0, composed: !0 }));
1866
+ }), this.inputEl.addEventListener("mousedown", () => this.sliderThumbEl.classList.add("active")), this.inputEl.addEventListener("touchstart", () => this.sliderThumbEl.classList.add("active"), { passive: !0 }), window.addEventListener("mouseup", () => this.sliderThumbEl.classList.remove("active")), window.addEventListener("touchend", () => this.sliderThumbEl.classList.remove("active"));
1867
+ }
1868
+ updateValue(t) {
1869
+ this.setAttribute("value", t), this.updateUI();
1870
+ }
1871
+ updateUI() {
1872
+ if (!this.inputEl) return;
1873
+ const t = parseFloat(this.inputEl.min), i = parseFloat(this.inputEl.max), e = parseFloat(this.inputEl.value), a = (e - t) / (i - t) * 100;
1874
+ this.trackFillEl.style.width = `${a}%`, this.sliderThumbEl.style.left = `calc(${a}% - ${a / 100 * 20}px)`, this.valueEl.textContent = e;
1875
+ }
1876
+ attributeChangedCallback(t, i, e) {
1877
+ this.inputEl && (t === "value" && e !== this.inputEl.value ? (this.inputEl.value = e, this.updateUI()) : ["min", "max", "step"].includes(t) ? (this.inputEl[t] = e, this.updateUI()) : t === "label" && (this.labelEl.textContent = e));
1878
+ }
1879
+ get value() {
1880
+ return parseFloat(this.inputEl.value);
1881
+ }
1882
+ set value(t) {
1883
+ this.setAttribute("value", t);
1884
+ }
1885
+ }
1886
+ customElements.define("eui-slider", D);
1762
1887
  typeof window < "u" && console.log("ErisUI loaded successfully");
1763
1888
  export {
1764
- J as device,
1765
- K as haptics,
1889
+ Z as device,
1890
+ X as haptics,
1766
1891
  u as icons,
1767
- G as loadPage,
1768
- C as router,
1769
- Y as storage,
1770
- Q as utils
1892
+ J as loadPage,
1893
+ y as router,
1894
+ W as storage,
1895
+ K as utils
1771
1896
  };