@voidable/ui 0.6.1 → 0.8.0

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.
Files changed (250) hide show
  1. package/README.md +168 -9
  2. package/dist/angular/index.d.ts +20 -0
  3. package/dist/angular/index.js +78 -0
  4. package/dist/autoloader-core.d.ts +45 -0
  5. package/dist/autoloader-table.generated.d.ts +5 -0
  6. package/dist/autoloader.d.ts +13 -0
  7. package/dist/autoloader.js +229 -0
  8. package/dist/base.d.ts +173 -2
  9. package/dist/base.js +2 -9
  10. package/dist/chunks/base-CMruMbxC.js +824 -0
  11. package/dist/chunks/disclosure-Bj_49GcC.js +23 -0
  12. package/dist/chunks/dismiss-Drsy_dE5.js +37 -0
  13. package/dist/chunks/form-control-C0vH6gii.js +300 -0
  14. package/dist/chunks/keyboard-MQpfTX5I.js +46 -0
  15. package/dist/chunks/keyboard-activation-CV0m4hkn.js +29 -0
  16. package/dist/chunks/modal-D_YVy2vg.js +71 -0
  17. package/dist/chunks/overlay-BywGMcDW.js +467 -0
  18. package/dist/chunks/parts-D30c8OoG.js +229 -0
  19. package/dist/chunks/{shape-FJvZa8FW.js → shape-C_LW7EjG.js} +12 -4
  20. package/dist/components/accordion.d.ts +38 -10
  21. package/dist/components/accordion.js +51 -53
  22. package/dist/components/action-input.d.ts +64 -6
  23. package/dist/components/action-input.js +84 -41
  24. package/dist/components/alert.d.ts +24 -10
  25. package/dist/components/alert.js +26 -27
  26. package/dist/components/avatar.d.ts +8 -2
  27. package/dist/components/avatar.js +3 -3
  28. package/dist/components/badge.d.ts +8 -3
  29. package/dist/components/badge.js +2 -2
  30. package/dist/components/banner.d.ts +21 -10
  31. package/dist/components/banner.js +27 -27
  32. package/dist/components/bar-chart.d.ts +30 -6
  33. package/dist/components/bar-chart.js +29 -39
  34. package/dist/components/breadcrumbs.d.ts +19 -6
  35. package/dist/components/breadcrumbs.js +16 -22
  36. package/dist/components/button.d.ts +64 -10
  37. package/dist/components/button.js +70 -26
  38. package/dist/components/calendar.d.ts +65 -10
  39. package/dist/components/calendar.js +157 -106
  40. package/dist/components/card.d.ts +14 -9
  41. package/dist/components/card.js +8 -22
  42. package/dist/components/carousel.d.ts +65 -14
  43. package/dist/components/carousel.js +84 -93
  44. package/dist/components/charts/scale.d.ts +0 -1
  45. package/dist/components/charts/shape.d.ts +0 -1
  46. package/dist/components/checkbox-group.d.ts +38 -5
  47. package/dist/components/checkbox-group.js +61 -20
  48. package/dist/components/checkbox.d.ts +53 -7
  49. package/dist/components/checkbox.js +66 -29
  50. package/dist/components/collapsible.d.ts +29 -9
  51. package/dist/components/collapsible.js +42 -44
  52. package/dist/components/color-picker.d.ts +20 -4
  53. package/dist/components/color-picker.js +35 -29
  54. package/dist/components/combobox.d.ts +84 -10
  55. package/dist/components/combobox.js +142 -45
  56. package/dist/components/compose-input.d.ts +8 -1
  57. package/dist/components/compose-input.js +9 -3
  58. package/dist/components/dialog.d.ts +24 -20
  59. package/dist/components/dialog.js +8 -57
  60. package/dist/components/divider.d.ts +8 -1
  61. package/dist/components/divider.js +3 -3
  62. package/dist/components/donut-chart.d.ts +28 -5
  63. package/dist/components/donut-chart.js +55 -54
  64. package/dist/components/drawer.d.ts +19 -18
  65. package/dist/components/drawer.js +9 -53
  66. package/dist/components/dropdown-menu.d.ts +62 -7
  67. package/dist/components/dropdown-menu.js +124 -33
  68. package/dist/components/editable.d.ts +37 -3
  69. package/dist/components/editable.js +45 -24
  70. package/dist/components/error-fallback.d.ts +36 -5
  71. package/dist/components/error-fallback.js +73 -23
  72. package/dist/components/field.d.ts +38 -4
  73. package/dist/components/field.js +63 -21
  74. package/dist/components/file-upload.d.ts +23 -2
  75. package/dist/components/file-upload.js +47 -24
  76. package/dist/components/gauge.d.ts +48 -9
  77. package/dist/components/gauge.js +57 -55
  78. package/dist/components/hamburger.d.ts +19 -4
  79. package/dist/components/hamburger.js +28 -19
  80. package/dist/components/hover-card.d.ts +40 -14
  81. package/dist/components/hover-card.js +76 -59
  82. package/dist/components/indicator.d.ts +18 -7
  83. package/dist/components/indicator.js +16 -18
  84. package/dist/components/input.d.ts +70 -5
  85. package/dist/components/input.js +83 -20
  86. package/dist/components/line-chart.d.ts +27 -5
  87. package/dist/components/line-chart.js +19 -21
  88. package/dist/components/list.d.ts +10 -1
  89. package/dist/components/list.js +3 -3
  90. package/dist/components/menu.d.ts +67 -21
  91. package/dist/components/menu.js +116 -115
  92. package/dist/components/multiselect.d.ts +108 -13
  93. package/dist/components/multiselect.js +207 -70
  94. package/dist/components/nav-bar.d.ts +12 -7
  95. package/dist/components/nav-bar.js +11 -21
  96. package/dist/components/nav-menu.d.ts +52 -12
  97. package/dist/components/nav-menu.js +68 -70
  98. package/dist/components/number-input.d.ts +76 -8
  99. package/dist/components/number-input.js +117 -51
  100. package/dist/components/pagination.d.ts +19 -1
  101. package/dist/components/pagination.js +68 -7
  102. package/dist/components/panel.d.ts +16 -8
  103. package/dist/components/panel.js +20 -20
  104. package/dist/components/pin-input.d.ts +41 -4
  105. package/dist/components/pin-input.js +45 -27
  106. package/dist/components/popover.d.ts +29 -11
  107. package/dist/components/popover.js +47 -35
  108. package/dist/components/progress.d.ts +7 -3
  109. package/dist/components/progress.js +3 -3
  110. package/dist/components/radio-group.d.ts +30 -5
  111. package/dist/components/radio-group.js +56 -19
  112. package/dist/components/radio.d.ts +47 -7
  113. package/dist/components/radio.js +68 -29
  114. package/dist/components/scroll-area.d.ts +8 -5
  115. package/dist/components/scroll-area.js +19 -20
  116. package/dist/components/segmented-control.d.ts +52 -8
  117. package/dist/components/segmented-control.js +66 -36
  118. package/dist/components/select.d.ts +59 -12
  119. package/dist/components/select.js +96 -46
  120. package/dist/components/sidebar.d.ts +22 -3
  121. package/dist/components/sidebar.js +20 -10
  122. package/dist/components/skeleton.d.ts +5 -2
  123. package/dist/components/skeleton.js +4 -4
  124. package/dist/components/slider.d.ts +27 -5
  125. package/dist/components/slider.js +29 -17
  126. package/dist/components/spinner.d.ts +6 -2
  127. package/dist/components/spinner.js +3 -3
  128. package/dist/components/stat.d.ts +21 -4
  129. package/dist/components/stat.js +7 -3
  130. package/dist/components/status-dot.d.ts +4 -1
  131. package/dist/components/status-dot.js +3 -3
  132. package/dist/components/stepper.d.ts +5 -1
  133. package/dist/components/stepper.js +2 -2
  134. package/dist/components/switch.d.ts +24 -5
  135. package/dist/components/switch.js +37 -19
  136. package/dist/components/table.d.ts +51 -2
  137. package/dist/components/table.js +157 -8
  138. package/dist/components/tabs.d.ts +49 -17
  139. package/dist/components/tabs.js +85 -54
  140. package/dist/components/tag.d.ts +17 -7
  141. package/dist/components/tag.js +19 -21
  142. package/dist/components/tags-input.d.ts +33 -4
  143. package/dist/components/tags-input.js +40 -30
  144. package/dist/components/textarea.d.ts +61 -5
  145. package/dist/components/textarea.js +58 -21
  146. package/dist/components/toast.d.ts +89 -15
  147. package/dist/components/toast.js +105 -30
  148. package/dist/components/toggle-group.d.ts +30 -3
  149. package/dist/components/toggle-group.js +43 -16
  150. package/dist/components/toggle.d.ts +25 -4
  151. package/dist/components/toggle.js +28 -18
  152. package/dist/components/tooltip.d.ts +31 -12
  153. package/dist/components/tooltip.js +62 -28
  154. package/dist/components.json +1518 -0
  155. package/dist/custom-elements.json +31817 -0
  156. package/dist/dev/index.d.ts +40 -0
  157. package/dist/dev/rules.d.ts +46 -0
  158. package/dist/dev/table.generated.d.ts +8 -0
  159. package/dist/dev/types.d.ts +113 -0
  160. package/dist/dev.js +3364 -0
  161. package/dist/disclosure.d.ts +30 -0
  162. package/dist/dismiss.d.ts +20 -0
  163. package/dist/form-control.d.ts +92 -0
  164. package/dist/index.d.ts +5 -4
  165. package/dist/index.js +24 -24
  166. package/dist/keyboard-activation.d.ts +31 -0
  167. package/dist/keyboard.d.ts +32 -0
  168. package/dist/modal.d.ts +44 -0
  169. package/dist/overlay.d.ts +249 -0
  170. package/dist/parts.d.ts +171 -0
  171. package/dist/projection.d.ts +370 -0
  172. package/dist/types/elements.d.ts +648 -0
  173. package/dist/types/react.d.ts +163 -0
  174. package/dist/types/solid.d.ts +164 -0
  175. package/dist/types/solid2.d.ts +161 -0
  176. package/dist/types/svelte.d.ts +154 -0
  177. package/dist/types/vue.d.ts +156 -0
  178. package/dist/vscode.html-custom-data.json +6004 -0
  179. package/dist/web-types.json +8365 -0
  180. package/package.json +113 -21
  181. package/dist/base.d.ts.map +0 -1
  182. package/dist/components/accordion.d.ts.map +0 -1
  183. package/dist/components/action-input.d.ts.map +0 -1
  184. package/dist/components/alert.d.ts.map +0 -1
  185. package/dist/components/avatar.d.ts.map +0 -1
  186. package/dist/components/badge.d.ts.map +0 -1
  187. package/dist/components/banner.d.ts.map +0 -1
  188. package/dist/components/bar-chart.d.ts.map +0 -1
  189. package/dist/components/breadcrumbs.d.ts.map +0 -1
  190. package/dist/components/button.d.ts.map +0 -1
  191. package/dist/components/calendar.d.ts.map +0 -1
  192. package/dist/components/card.d.ts.map +0 -1
  193. package/dist/components/carousel.d.ts.map +0 -1
  194. package/dist/components/charts/scale.d.ts.map +0 -1
  195. package/dist/components/charts/shape.d.ts.map +0 -1
  196. package/dist/components/checkbox-group.d.ts.map +0 -1
  197. package/dist/components/checkbox.d.ts.map +0 -1
  198. package/dist/components/collapsible.d.ts.map +0 -1
  199. package/dist/components/color-picker.d.ts.map +0 -1
  200. package/dist/components/combobox.d.ts.map +0 -1
  201. package/dist/components/compose-input.d.ts.map +0 -1
  202. package/dist/components/dialog.d.ts.map +0 -1
  203. package/dist/components/divider.d.ts.map +0 -1
  204. package/dist/components/donut-chart.d.ts.map +0 -1
  205. package/dist/components/drawer.d.ts.map +0 -1
  206. package/dist/components/dropdown-menu.d.ts.map +0 -1
  207. package/dist/components/editable.d.ts.map +0 -1
  208. package/dist/components/error-fallback.d.ts.map +0 -1
  209. package/dist/components/field.d.ts.map +0 -1
  210. package/dist/components/file-upload.d.ts.map +0 -1
  211. package/dist/components/gauge.d.ts.map +0 -1
  212. package/dist/components/hamburger.d.ts.map +0 -1
  213. package/dist/components/hover-card.d.ts.map +0 -1
  214. package/dist/components/indicator.d.ts.map +0 -1
  215. package/dist/components/input.d.ts.map +0 -1
  216. package/dist/components/line-chart.d.ts.map +0 -1
  217. package/dist/components/list.d.ts.map +0 -1
  218. package/dist/components/menu.d.ts.map +0 -1
  219. package/dist/components/multiselect.d.ts.map +0 -1
  220. package/dist/components/nav-bar.d.ts.map +0 -1
  221. package/dist/components/nav-menu.d.ts.map +0 -1
  222. package/dist/components/number-input.d.ts.map +0 -1
  223. package/dist/components/pagination.d.ts.map +0 -1
  224. package/dist/components/panel.d.ts.map +0 -1
  225. package/dist/components/pin-input.d.ts.map +0 -1
  226. package/dist/components/popover.d.ts.map +0 -1
  227. package/dist/components/progress.d.ts.map +0 -1
  228. package/dist/components/radio-group.d.ts.map +0 -1
  229. package/dist/components/radio.d.ts.map +0 -1
  230. package/dist/components/scroll-area.d.ts.map +0 -1
  231. package/dist/components/segmented-control.d.ts.map +0 -1
  232. package/dist/components/select.d.ts.map +0 -1
  233. package/dist/components/sidebar.d.ts.map +0 -1
  234. package/dist/components/skeleton.d.ts.map +0 -1
  235. package/dist/components/slider.d.ts.map +0 -1
  236. package/dist/components/spinner.d.ts.map +0 -1
  237. package/dist/components/stat.d.ts.map +0 -1
  238. package/dist/components/status-dot.d.ts.map +0 -1
  239. package/dist/components/stepper.d.ts.map +0 -1
  240. package/dist/components/switch.d.ts.map +0 -1
  241. package/dist/components/table.d.ts.map +0 -1
  242. package/dist/components/tabs.d.ts.map +0 -1
  243. package/dist/components/tag.d.ts.map +0 -1
  244. package/dist/components/tags-input.d.ts.map +0 -1
  245. package/dist/components/textarea.d.ts.map +0 -1
  246. package/dist/components/toast.d.ts.map +0 -1
  247. package/dist/components/toggle-group.d.ts.map +0 -1
  248. package/dist/components/toggle.d.ts.map +0 -1
  249. package/dist/components/tooltip.d.ts.map +0 -1
  250. package/dist/index.d.ts.map +0 -1
@@ -0,0 +1,824 @@
1
+ import { LitElement as e, ReactiveElement as t } from "lit";
2
+ //#region src/projection.ts
3
+ var n = "__voidProjection", r = "void-projection", i = "/void-projection", a = "data-void-projection", o = "data-void-chrome", s = "data-void-wrap", c = "void-item", l = Symbol.for("@voidable/ui:projection-park");
4
+ function u(e) {
5
+ let t = e, n = t[l];
6
+ return (!n || n.parentNode !== e.documentElement) && (n = e.createElement("void-projection-park"), n.hidden = !0, e.documentElement.appendChild(n), t[l] = n), n;
7
+ }
8
+ function d(e) {
9
+ if (e.firstChild) return;
10
+ let t = e.ownerDocument;
11
+ t[l] === e && delete t[l], e.remove();
12
+ }
13
+ var f = (e) => e.nodeType === Node.ELEMENT_NODE, p = (e) => e.nodeType === Node.COMMENT_NODE, m = (e) => p(e) && (e.data === r || e.data === i) || f(e) && e.hasAttribute(o), h = (e) => p(e) || e.nodeType === Node.TEXT_NODE && !(e.textContent ?? "").trim(), g = (e) => p(e) && e.data === c, _ = Symbol.for("@voidable/ui:projection-focus");
14
+ function v(e) {
15
+ let t = e.ownerDocument, n = t.activeElement;
16
+ if (t[_] && !t[_].restored || !n || n === t.body || !e.contains(n)) return;
17
+ let r = n, i = null;
18
+ try {
19
+ typeof r.selectionStart == "number" && typeof r.selectionEnd == "number" && (i = [
20
+ r.selectionStart,
21
+ r.selectionEnd,
22
+ r.selectionDirection ?? "none"
23
+ ]);
24
+ } catch {
25
+ i = null;
26
+ }
27
+ let a = typeof r.value == "string" ? r.value : null, o = /* @__PURE__ */ new Set();
28
+ for (let e = n.parentElement; e; e = e.parentElement) o.add(e);
29
+ let s = {
30
+ el: n,
31
+ value: a,
32
+ range: i,
33
+ scroll: [n.scrollTop, n.scrollLeft],
34
+ within: o
35
+ };
36
+ t[_] = s, setTimeout(() => {
37
+ t[_] === s && delete t[_];
38
+ }, 100);
39
+ }
40
+ function y(e) {
41
+ let t = e.ownerDocument[_];
42
+ return !!t && !t.restored && (t.within.has(e) || e.contains(t.el));
43
+ }
44
+ function b(e) {
45
+ x(e);
46
+ }
47
+ function x(e) {
48
+ let t = e[_];
49
+ if (!t || !t.el.isConnected) return;
50
+ let { el: n } = t, r = e.activeElement;
51
+ if (r && r !== e.body && r !== n && !t.within.has(r)) {
52
+ delete e[_];
53
+ return;
54
+ }
55
+ if (e.activeElement === n && t.restored || (e.activeElement !== n && (t.restored = !1, n.focus({ preventScroll: !0 })), e.activeElement !== n)) return;
56
+ t.restored = !0;
57
+ let i = n;
58
+ if (t.value !== null && i.value !== t.value && (i.value = t.value), t.range) try {
59
+ i.setSelectionRange?.(t.range[0], t.range[1], t.range[2]);
60
+ } catch {}
61
+ n.scrollTop !== t.scroll[0] && (n.scrollTop = t.scroll[0]), n.scrollLeft !== t.scroll[1] && (n.scrollLeft = t.scroll[1]);
62
+ }
63
+ function S(e, t, n) {
64
+ if (t.parentNode === e && t.nextSibling === n && t !== n) return;
65
+ let r = e;
66
+ if (typeof r.moveBefore == "function" && t.isConnected && e.isConnected && !C(e, t)) try {
67
+ r.moveBefore(t, n);
68
+ return;
69
+ } catch {}
70
+ let i = w(t);
71
+ Node.prototype.insertBefore.call(e, t, n), i?.();
72
+ }
73
+ function C(e, t) {
74
+ let n = (e) => f(e) ? e.localName : "";
75
+ return [
76
+ "select",
77
+ "optgroup",
78
+ "datalist"
79
+ ].includes(n(e)) || ["option", "optgroup"].includes(n(t));
80
+ }
81
+ function w(e) {
82
+ let t = e.ownerDocument, n = t?.activeElement;
83
+ if (!t || !n || n === t.body || !e.contains(n)) return null;
84
+ let r = n, i = null;
85
+ try {
86
+ typeof r.selectionStart == "number" && typeof r.selectionEnd == "number" && (i = [
87
+ r.selectionStart,
88
+ r.selectionEnd,
89
+ r.selectionDirection ?? "none"
90
+ ]);
91
+ } catch {
92
+ i = null;
93
+ }
94
+ return () => {
95
+ if (!(!n.isConnected || t.activeElement === n) && (n.focus({ preventScroll: !0 }), i)) try {
96
+ r.setSelectionRange?.(i[0], i[1], i[2]);
97
+ } catch {}
98
+ };
99
+ }
100
+ function T(e) {
101
+ for (let t = e.firstChild; t; t = t.nextSibling) if (m(t)) return !0;
102
+ return !1;
103
+ }
104
+ function E(e) {
105
+ let t = e;
106
+ if (!T(e)) return !!t[D];
107
+ t[D] = !0;
108
+ let n = Array.from(e.childNodes), o = n.findIndex((e) => p(e) && e.data === r), c = n.findIndex((e, t) => t > o && p(e) && e.data === i), l = n.filter((e, t) => m(e) || o >= 0 && c > o && t > o && t < c);
109
+ for (let t of l) {
110
+ if (!f(t)) continue;
111
+ let n = (e) => e.hasAttribute(a), r = [t, ...Array.from(t.querySelectorAll(`[${a}]`))].filter(n);
112
+ for (let i of r) {
113
+ let r = !0;
114
+ for (let t = i.parentElement; t && t !== e; t = t.parentElement) t !== i && (n(t) || t.localName.includes("-")) && (r = !1);
115
+ if (r) for (let n of Array.from(i.childNodes)) {
116
+ let r = f(n) && n.hasAttribute(s);
117
+ for (let i of r ? Array.from(n.childNodes) : [n]) g(i) || Node.prototype.insertBefore.call(e, i, t);
118
+ }
119
+ }
120
+ }
121
+ for (let t of l) t.parentNode === e && Node.prototype.removeChild.call(e, t);
122
+ return !0;
123
+ }
124
+ var D = Symbol.for("@voidable/ui:serialized-copy"), O = class {
125
+ constructor(e, t = {}) {
126
+ this._start = null, this._end = null, this._observer = null, this._observedContainers = /* @__PURE__ */ new Set(), this._placed = /* @__PURE__ */ new WeakMap(), this._chromeTop = [], this._chromeAll = /* @__PURE__ */ new WeakSet(), this._containers = /* @__PURE__ */ new WeakSet(), this._wrapperOf = /* @__PURE__ */ new WeakMap(), this._wrappers = /* @__PURE__ */ new WeakSet(), this._litText = /* @__PURE__ */ new WeakMap(), this._signature = [], this._rendered = !1, this._recovered = !1, this._initialPass = !1, this._sawElement = !1, this._parked = null, this._warned = !1, this._scrolled = null, this._onScroll = (e) => {
127
+ let t = e.target;
128
+ t instanceof Element && t !== this._host && (this._scrolled ??= /* @__PURE__ */ new Set()).add(t);
129
+ }, this._owned = /* @__PURE__ */ new WeakSet(), this._anchorAfter = /* @__PURE__ */ new Map(), this._host = e, this._regions = t.regions ?? [], this._placement = t.placement ?? (this._regions.length ? "start" : "end"), this._onChange = t.onChange;
130
+ let r = this._host[n];
131
+ r && r !== this && e.removeController(r), this._host[n] = this, e.addController(this);
132
+ }
133
+ hostConnected() {
134
+ let e = this._host;
135
+ this._parked ? this._restore() : this._start ? this._needsInit() && (this._init(!0), e.requestUpdate()) : this._init(!1), this._observer ??= new MutationObserver(() => this._onMutation()), this._observer.observe(e, { childList: !0 }), this._observedContainers.clear(), this._observeMarker(), e.addEventListener("scroll", this._onScroll, {
136
+ capture: !0,
137
+ passive: !0
138
+ }), this._rendered && this._reconcile(!0);
139
+ }
140
+ _observeMarker() {
141
+ let e = this._start;
142
+ !this._observer || !e || !this._host.isConnected || this._observedContainers.has(e) || (this._observedContainers.add(e), this._observer.observe(e, { characterData: !0 }));
143
+ }
144
+ _redirectMarkerText() {
145
+ for (let [e, t] of [[this._start, r], [this._end, i]]) {
146
+ if (!e || e.data === t) continue;
147
+ let n = e.data;
148
+ e.data = t;
149
+ let r = this._regions.flatMap((e) => this._regionNodes(e)).find((e) => e.nodeType === Node.TEXT_NODE);
150
+ r ? r.data !== n && (r.data = n) : n && S(this._host, this._host.ownerDocument.createTextNode(n), this._placement === "end" ? this._start : null);
151
+ }
152
+ }
153
+ hostDisconnected() {
154
+ this._host.removeEventListener("scroll", this._onScroll, { capture: !0 }), this._observer?.disconnect(), this._observedContainers.clear();
155
+ }
156
+ hostUpdate() {
157
+ if (this._parked) {
158
+ this._restore();
159
+ return;
160
+ }
161
+ if (this._needsInit()) {
162
+ this._init(!0);
163
+ return;
164
+ }
165
+ if (this._rendered || !this._start || !this._end) return;
166
+ let e = [];
167
+ for (let t = this._start.nextSibling; t && t !== this._end; t = t.nextSibling) e.push(t);
168
+ if (this._placement === "end") {
169
+ for (let t of e) S(this._host, t, this._start);
170
+ this._end.nextSibling && (Node.prototype.insertBefore.call(this._host, this._start, null), Node.prototype.insertBefore.call(this._host, this._end, null));
171
+ return;
172
+ }
173
+ let t = this._end.nextSibling;
174
+ for (let n of e) S(this._host, n, t);
175
+ }
176
+ hostUpdated() {
177
+ let e = !this._rendered;
178
+ this._rendered = !0, this._markChrome(), this._initialPass = e, this._reconcile(!e || this._recovered), this._initialPass = !1, this._recovered = !1;
179
+ }
180
+ get parked() {
181
+ return this._parked !== null;
182
+ }
183
+ nodes(e) {
184
+ let t = this._regions.find((t) => t.name === e);
185
+ return t ? this._regionNodes(t) : [];
186
+ }
187
+ regionOf(e) {
188
+ return this._placed.get(e)?.name;
189
+ }
190
+ isProjected(e) {
191
+ let t = this._placed.get(e);
192
+ if (!t || typeof t.target != "function") return !1;
193
+ let n = e.parentNode;
194
+ if (!n || n === this._host) return !1;
195
+ let r = t.target();
196
+ return n === r || this._wrappers.has(n) && n.parentNode === r;
197
+ }
198
+ append(e) {
199
+ if (!f(e) || this._parked || !this._rendered || !this._intact()) return !1;
200
+ let t = this._placed.get(e) ?? this._route(e, "after");
201
+ return !t || typeof t.target != "function" || !t.target() ? !1 : this._place(e, t, null);
202
+ }
203
+ insertBefore(e, t) {
204
+ if (e.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
205
+ for (let n of Array.from(e.childNodes)) this.insertBefore(n, t);
206
+ return e;
207
+ }
208
+ if (this.isWrapEnd(t)) {
209
+ let n = t.parentNode, r = n.parentNode, i = Array.from(n.childNodes).find((e) => this._wrapperOf.get(e) === n), a = i ? this._placed.get(i) : this._regions.find((e) => e.wrap && typeof e.target == "function" && e.target() === r);
210
+ if (r && a?.wrap && (!a.accepts || a.accepts(e, {
211
+ initial: !1,
212
+ zone: "insert"
213
+ }))) {
214
+ let o = this._wrapperFor(e, a), s = this._anchorAfter.get(t), c = s && s !== o && s.parentNode === r ? s.nextSibling : i ? n.nextSibling : n;
215
+ o !== n && S(r, o, c), this._anchorAfter.set(t, o), S(o, e, this._wrapEnd(o)), this._placed.set(e, a), f(e) && (this._sawElement = !0), this._observeContainer(o);
216
+ } else S(this._host, e, null);
217
+ return e;
218
+ }
219
+ let n = this._route(e, "insert");
220
+ return n?.wrap && n === this._placed.get(t) ? this._place(e, n, t) : n && n === this._placed.get(t) && t.parentNode ? (S(t.parentNode, e, t), this._placed.set(e, n), f(e) && (this._sawElement = !0)) : (!n || !this._place(e, n, null)) && S(this._host, e, null), e;
221
+ }
222
+ replaceContent(e) {
223
+ if (!this._intact()) return !1;
224
+ let t = this._host, n = [];
225
+ for (let e of this._regions) typeof e.target == "function" && n.push(...this._regionNodes(e));
226
+ let r = "before";
227
+ for (let e = t.firstChild; e; e = e.nextSibling) e === this._start ? r = "lit" : e === this._end ? r = "after" : r !== "lit" && n.push(e);
228
+ for (let t of n) e.includes(t) || t.parentNode?.removeChild(t);
229
+ this._sawElement = !1;
230
+ let i = this._placement === "end" ? this._start : null;
231
+ for (let n of e) S(t, n, i);
232
+ return this._rendered && this._reconcile(!0), !0;
233
+ }
234
+ unproject() {
235
+ let e = this._host, t = this._start, n = this._end;
236
+ if (this._parked || !this._rendered || !t || !n || !this._intact()) return !1;
237
+ let r = this._regions.filter((e) => typeof e.target == "function").map((e) => [e, e.target()]).filter((e) => !!e[1]).sort((e, t) => e[1].compareDocumentPosition(t[1]) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1), i = e.ownerDocument, a = i.documentElement, o = !!a && e.isConnected && typeof a.moveBefore == "function";
238
+ v(e);
239
+ let s = [];
240
+ for (let [e, t] of r) e.scrolls && !this._scrolled?.has(t) && (t.scrollTop || t.scrollLeft) && (this._scrolled ??= /* @__PURE__ */ new Set()).add(t);
241
+ if (this._scrolled) for (let t of this._scrolled) {
242
+ if (!e.contains(t)) {
243
+ this._scrolled.delete(t);
244
+ continue;
245
+ }
246
+ t.scrollTop || t.scrollLeft ? s.push([
247
+ t,
248
+ t.scrollTop,
249
+ t.scrollLeft
250
+ ]) : this._scrolled.delete(t);
251
+ }
252
+ for (let [n] of r) for (let r of this._regionNodes(n)) S(e, r, t);
253
+ let c = [];
254
+ for (let e = t; e && (c.push(e), e !== n); e = e.nextSibling);
255
+ let l = {
256
+ nodes: c,
257
+ park: null,
258
+ fragment: null,
259
+ anchor: n.nextSibling,
260
+ scroll: s
261
+ };
262
+ if (o) {
263
+ let e = u(i);
264
+ for (let t of c) S(e, t, null);
265
+ l.park = e;
266
+ } else {
267
+ let e = i.createDocumentFragment();
268
+ for (let t of c) e.appendChild(t);
269
+ l.fragment = e;
270
+ }
271
+ return this._parked = l, this._observedContainers.clear(), this._observer && e.isConnected && (this._observer.disconnect(), this._observer.observe(e, { childList: !0 }), this._observer.takeRecords()), e.requestUpdate(), !0;
272
+ }
273
+ reproject() {
274
+ return this._parked && (this._restore(), this._host.requestUpdate()), this._host.updateComplete;
275
+ }
276
+ _restore() {
277
+ let e = this._host, t = this._parked;
278
+ if (!t) return;
279
+ if (this._parked = null, Array.from(e.childNodes).some(m)) {
280
+ for (let e of t.nodes) e.parentNode?.removeChild(e);
281
+ t.park && d(t.park), this._init(!0), e.requestUpdate();
282
+ return;
283
+ }
284
+ let n = this._regions.length ? e.firstChild : t.anchor && t.anchor.parentNode === e ? t.anchor : this._placement === "end" ? null : e.firstChild;
285
+ if (t.fragment) Node.prototype.insertBefore.call(e, t.fragment, n);
286
+ else for (let r of t.nodes) S(e, r, n);
287
+ t.park && d(t.park), this._signature = [], this._reconcile(!0), x(e.ownerDocument);
288
+ for (let [e, n, r] of t.scroll) e.scrollTop !== n && (e.scrollTop = n), e.scrollLeft !== r && (e.scrollLeft = r);
289
+ }
290
+ _needsInit() {
291
+ return !this._parked && !!this._start && !this._intact();
292
+ }
293
+ _intact() {
294
+ let e = this._host, t = this._start, n = this._end;
295
+ if (!t || !n || t.parentNode !== e || n.parentNode !== e) return !1;
296
+ let r = !1;
297
+ for (let e = t.nextSibling; e; e = e.nextSibling) if (e === n) {
298
+ r = !0;
299
+ break;
300
+ }
301
+ return r ? this._chromeTop.every((t) => t.parentNode === e && t.hasAttribute(o)) : !1;
302
+ }
303
+ _init(e) {
304
+ let t = this._host;
305
+ this._start = null, this._end = null, this._purgeStale();
306
+ let n = t.ownerDocument, a = n.createComment(r), o = n.createComment(i);
307
+ Node.prototype.insertBefore.call(t, o, this._placement === "end" ? null : t.firstChild), Node.prototype.insertBefore.call(t, a, o), this._start = a, this._end = o, t.renderOptions.renderBefore = o, this._placed = /* @__PURE__ */ new WeakMap(), this._litText = /* @__PURE__ */ new WeakMap(), this._chromeTop = [], this._chromeAll = /* @__PURE__ */ new WeakSet(), this._containers = /* @__PURE__ */ new WeakSet(), this._wrapperOf = /* @__PURE__ */ new WeakMap(), this._wrappers = /* @__PURE__ */ new WeakSet(), this._observedContainers.clear(), this._signature = [], this._rendered = !1, this._recovered = e, this._sawElement = !1, this._parked = null;
308
+ }
309
+ _purgeStale() {
310
+ let e = this._host, t = [], n = !1;
311
+ for (let r = e.firstChild; r; r = r.nextSibling) r === this._start ? n = !0 : r === this._end ? n = !1 : n || t.push(r);
312
+ let a = t.findIndex((e) => p(e) && e.data === r), c = t.findIndex((e, t) => t > a && p(e) && e.data === i), l = t.filter((e, t) => p(e) && (e.data === r || e.data === i) || a >= 0 && c > a && t > a && t < c ? !0 : f(e) ? e.hasAttribute(o) : this._litText.get(e) === e.data);
313
+ for (let t of l) for (let n of this._staleContainers(t)) for (let r of Array.from(n.childNodes)) {
314
+ let n = f(r) && (r.hasAttribute(s) || this._wrappers.has(r));
315
+ for (let i of n ? Array.from(r.childNodes) : [r]) g(i) || S(e, i, t);
316
+ }
317
+ for (let t of l) t.parentNode === e && Node.prototype.removeChild.call(e, t);
318
+ this._replaceRecycledChrome();
319
+ }
320
+ _replaceRecycledChrome() {
321
+ let e = this._host, t = Array.from(e.querySelectorAll("*")).filter((e) => this._chromeAll.has(e) || this._containers.has(e) || this._wrappers.has(e));
322
+ for (let e of t) {
323
+ let t = e.parentNode;
324
+ if (!t) continue;
325
+ let n = e.cloneNode(!1);
326
+ n.removeAttribute(o), n.removeAttribute(a), n.removeAttribute(s), Node.prototype.insertBefore.call(t, n, e);
327
+ for (let t of Array.from(e.childNodes)) S(n, t, null);
328
+ Node.prototype.removeChild.call(t, e);
329
+ }
330
+ }
331
+ _staleContainers(e) {
332
+ if (!f(e)) return [];
333
+ let t = (e) => e.hasAttribute(a) || this._containers.has(e);
334
+ return [e, ...Array.from(e.querySelectorAll("*"))].filter(t).filter((n) => {
335
+ for (let r = n.parentElement; r && r !== e.parentNode; r = r.parentElement) if (r !== n && (t(r) || r.localName.includes("-"))) return !1;
336
+ return !0;
337
+ });
338
+ }
339
+ _markChrome() {
340
+ for (let e of this._regions) {
341
+ if (typeof e.target != "function") continue;
342
+ let t = e.target();
343
+ if (t && (t.hasAttribute(a) || t.setAttribute(a, e.name), !this._containers.has(t))) {
344
+ for (let e = t.firstChild; e; e = e.nextSibling) this._placed.has(e) || this._owned.add(e);
345
+ this._containers.add(t);
346
+ }
347
+ }
348
+ let e = [];
349
+ for (let t = this._start?.nextSibling; t && t !== this._end; t = t.nextSibling) f(t) ? (t.hasAttribute(o) || t.setAttribute(o, ""), e.push(t), this._trackChrome(t)) : this._litText.set(t, t.data);
350
+ this._chromeTop = e;
351
+ }
352
+ _trackChrome(e) {
353
+ if (this._chromeAll.add(e), !(this._containers.has(e) || e !== this._host && e.localName.includes("-"))) for (let t = e.firstElementChild; t; t = t.nextElementSibling) this._trackChrome(t);
354
+ }
355
+ _onMutation() {
356
+ if (this._redirectMarkerText(), this._parked) {
357
+ this._restore();
358
+ return;
359
+ }
360
+ if (this._needsInit()) {
361
+ this._init(!0), this._observer?.takeRecords(), this._host.requestUpdate();
362
+ return;
363
+ }
364
+ this._reconcile(!0);
365
+ }
366
+ _route(e, t) {
367
+ let n = {
368
+ initial: !this._sawElement,
369
+ zone: t
370
+ };
371
+ return this._regions.find((t) => !t.accepts || t.accepts(e, n));
372
+ }
373
+ _place(e, t, n) {
374
+ let r = this._host, i = n && n !== e && this._placed.get(n) === t ? n : null;
375
+ if (t.target === "before") S(r, e, i && i.parentNode === r && !this._isAfterEnd(i) ? i : this._start);
376
+ else if (t.target === "after") e.parentNode === r && this._isAfterEnd(e) || (i && i.parentNode === r && this._isAfterEnd(i) ? S(r, e, i) : S(r, e, null));
377
+ else {
378
+ let n = t.target();
379
+ if (!n) return !1;
380
+ if (n.hasAttribute(a) || n.setAttribute(a, t.name), this._containers.add(n), t.wrap) {
381
+ let r = this._wrapperFor(e, t), a = i ? this._wrapperOf.get(i) : void 0;
382
+ S(n, r, a && a.parentNode === n && i.parentNode === a ? a : null), S(r, e, this._wrapEnd(r)), this._observeContainer(r);
383
+ } else S(n, e, i && i.parentNode === n ? i : null);
384
+ this._observeContainer(n);
385
+ }
386
+ return this._placed.set(e, t), f(e) && (this._sawElement = !0), !0;
387
+ }
388
+ own(e) {
389
+ this._owned.add(e);
390
+ }
391
+ _adoptForeign(e) {
392
+ let t = e.target();
393
+ if (!(!t || !this._containers.has(t))) for (let n = t.firstChild; n; n = n.nextSibling) this._placed.has(n) || this._owned.has(n) || e.accepts && !e.accepts(n, {
394
+ initial: !1,
395
+ zone: "insert"
396
+ }) || (this._placed.set(n, e), f(n) && (this._sawElement = !0));
397
+ }
398
+ _wrapperFor(e, t) {
399
+ let n = this._wrapperOf.get(e);
400
+ return n && (e.parentNode === n || Array.from(n.childNodes).some((t) => t !== e && !g(t))) && (n = void 0), n || (n = t.wrap(e), n.setAttribute(s, ""), this._wrapperOf.set(e, n), this._wrappers.add(n)), n;
401
+ }
402
+ _wrapEnd(e) {
403
+ let t = e.lastChild;
404
+ if (t && g(t)) return t;
405
+ let n = Array.from(e.childNodes).find(g) ?? e.ownerDocument.createComment(c);
406
+ return Node.prototype.insertBefore.call(e, n, null), n;
407
+ }
408
+ _normalizeWrappers(e) {
409
+ let t = e.target();
410
+ if (t) for (let n of Array.from(t.childNodes)) {
411
+ if (!f(n) || !this._wrappers.has(n)) continue;
412
+ let r = n, i = !1;
413
+ for (let n of Array.from(r.childNodes)) if (!g(n)) {
414
+ if (this._placed.get(n) === e && this._wrapperOf.get(n) === r) {
415
+ i = !0;
416
+ continue;
417
+ }
418
+ if (!e.accepts || e.accepts(n, {
419
+ initial: !1,
420
+ zone: "insert"
421
+ })) {
422
+ let a = this._wrapperFor(n, e);
423
+ S(t, a, i ? r.nextSibling : r), S(a, n, this._wrapEnd(a)), this._placed.set(n, e), f(n) && (this._sawElement = !0), this._observeContainer(a);
424
+ }
425
+ }
426
+ if (!Array.from(r.childNodes).filter((t) => this._placed.get(t) === e && this._wrapperOf.get(t) === r).length) {
427
+ for (let e of Array.from(r.childNodes)) g(e) || S(t, e, r);
428
+ Node.prototype.removeChild.call(t, r);
429
+ }
430
+ }
431
+ }
432
+ isWrapEnd(e) {
433
+ return g(e) && !!e.parentNode && this._wrappers.has(e.parentNode);
434
+ }
435
+ _isAfterEnd(e) {
436
+ for (let t = this._end?.nextSibling; t; t = t.nextSibling) if (t === e) return !0;
437
+ return !1;
438
+ }
439
+ _observeContainer(e) {
440
+ !this._onChange || !this._host.isConnected || this._observedContainers.has(e) || (this._observedContainers.add(e), this._observer?.observe(e, { childList: !0 }));
441
+ }
442
+ _regionNodes(e) {
443
+ let t = this._host, n = [];
444
+ if (e.target === "before") for (let r = t.firstChild; r && r !== this._start; r = r.nextSibling) this._placed.get(r) === e && n.push(r);
445
+ else if (e.target === "after") for (let t = this._end?.nextSibling; t; t = t.nextSibling) this._placed.get(t) === e && n.push(t);
446
+ else {
447
+ let t = e.target();
448
+ if (t) for (let r of Array.from(t.childNodes)) if (e.wrap && this._wrappers.has(r)) for (let t of Array.from(r.childNodes)) this._placed.get(t) === e && n.push(t);
449
+ else this._placed.get(r) === e && n.push(r);
450
+ }
451
+ return n;
452
+ }
453
+ _reconcile(e) {
454
+ let t = this._host, n = this._start, r = this._end;
455
+ if (!this._rendered || !n || !r || !this._intact()) return;
456
+ this._redirectMarkerText();
457
+ let i = [], o = "before", s = !1, c = this._regions.length > 0;
458
+ for (let e = t.firstChild; e; e = e.nextSibling) e === n ? o = "lit" : e === r ? o = "after" : c ? o !== "lit" && this._placed.get(e)?.target !== o && (i.push([e, o]), s ||= m(e)) : s ||= o !== "lit" && m(e);
459
+ if (s) {
460
+ this._purgeStale(), this._reconcile(e);
461
+ return;
462
+ }
463
+ if (!c && this._placement === "end" && r.nextSibling) {
464
+ let e = [];
465
+ for (let t = r.nextSibling; t; t = t.nextSibling) e.push(t);
466
+ for (let r of e) S(t, r, n);
467
+ }
468
+ if (i.length) {
469
+ let e = new Map(this._regions.map((e) => [e, this._regionNodes(e)[0] ?? null])), n = this._regions.find((e) => e.target === "before"), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = new Set(i.map((e) => e[0]));
470
+ for (let e = t.lastChild; e; e = e.previousSibling) {
471
+ s.has(e) && r.set(e, new Map(o));
472
+ let t = this._placed.get(e);
473
+ t && o.set(t, e);
474
+ }
475
+ let c = null, l = t.ownerDocument.activeElement, u = () => {
476
+ let e = c;
477
+ if (c = null, !e) return;
478
+ let n = e.region.target();
479
+ if (!n || e.nodes.length < 2) {
480
+ for (let t of e.nodes) this._place(t, e.region, null);
481
+ return;
482
+ }
483
+ let r = t.ownerDocument.createDocumentFragment();
484
+ for (let t of e.nodes) r.appendChild(t);
485
+ Node.prototype.insertBefore.call(n, r, null), n.hasAttribute(a) || n.setAttribute(a, e.region.name), this._containers.add(n);
486
+ for (let t of e.nodes) this._placed.set(t, e.region), f(t) && (this._sawElement = !0);
487
+ this._observeContainer(n);
488
+ };
489
+ for (let [a, o] of i) {
490
+ if (o === "before" && n && !this._initialPass && h(a)) {
491
+ u(), this._placed.set(a, n);
492
+ continue;
493
+ }
494
+ let i = this._placed.get(a) ?? this._route(a, o);
495
+ if (!i) continue;
496
+ let s = o === "before" ? e.get(i) ?? null : r.get(a)?.get(i) ?? null;
497
+ if (typeof i.target == "function" && !i.wrap && !i.accepts && (s === null || s.parentNode === t) && !(l && a.contains(l))) {
498
+ c && c.region !== i && u(), (c ??= {
499
+ region: i,
500
+ nodes: []
501
+ }).nodes.push(a), f(a) && (this._sawElement = !0);
502
+ continue;
503
+ }
504
+ u(), this._place(a, i, s);
505
+ }
506
+ u();
507
+ }
508
+ this._anchorAfter.clear();
509
+ for (let e of this._regions) if (e.wrap && typeof e.target == "function" ? this._normalizeWrappers(e) : typeof e.target == "function" && this._adoptForeign(e), typeof e.target == "function") {
510
+ let t = e.target();
511
+ t && (t.hasAttribute(a) || t.setAttribute(a, e.name), this._containers.add(t), this._observeContainer(t));
512
+ }
513
+ if (this._observeMarker(), this._observer?.takeRecords(), this._warnIfRequiredMissing(), !this._onChange) return;
514
+ let l = this._regions.flatMap((e) => this._regionNodes(e)), u = l.length !== this._signature.length || l.some((e, t) => e !== this._signature[t]);
515
+ this._signature = l, u && e && this._onChange();
516
+ }
517
+ _warnIfRequiredMissing() {
518
+ if (this._warned || this._host.constructor.enabledWarnings === void 0) return;
519
+ let e = (e) => this._regionNodes(e).some(f);
520
+ for (let t of this._regions) {
521
+ if (!t.required || e(t) || !this._regions.some((n) => n !== t && e(n))) continue;
522
+ let n = t.required();
523
+ if (n) {
524
+ this._warned = !0, console.warn(`<${this._host.localName}>: ${n}`, this._host);
525
+ return;
526
+ }
527
+ }
528
+ }
529
+ }, k = Symbol("voidReflectedDefaults"), A = Symbol("voidDefaultsProbe"), j = Symbol("voidReflectAgain");
530
+ function M(e) {
531
+ let t = e.constructor;
532
+ if (Object.prototype.hasOwnProperty.call(t, k)) return t[k];
533
+ let n = /* @__PURE__ */ new Map();
534
+ t[k] = n;
535
+ let r = null;
536
+ try {
537
+ customElements.get(e.localName) === t && (r = Object.assign(new t(), { [A]: !0 }));
538
+ } catch {
539
+ r = null;
540
+ }
541
+ if (!r) return n;
542
+ for (let [e, i] of t.elementProperties) {
543
+ if (!i.reflect || i.attribute === !1) continue;
544
+ let t = typeof i.attribute == "string" ? i.attribute : String(e).toLowerCase(), a = typeof i.converter == "function" || !!i.converter?.fromAttribute;
545
+ n.set(t, {
546
+ prop: e,
547
+ value: r[e],
548
+ custom: a,
549
+ options: i
550
+ });
551
+ }
552
+ return n;
553
+ }
554
+ var N = Symbol("voidMorphMeta");
555
+ function P(e) {
556
+ let t = e.constructor;
557
+ if (Object.prototype.hasOwnProperty.call(t, N)) return t[N];
558
+ let n = /* @__PURE__ */ new Map();
559
+ for (let [e, r] of t.elementProperties) {
560
+ if (r.attribute === !1) continue;
561
+ let t = typeof r.attribute == "string" ? r.attribute : String(e).toLowerCase();
562
+ n.set(t, !!r.reflect);
563
+ }
564
+ let r = {
565
+ attrs: n,
566
+ drafts: Object.entries(t.clientState ?? {}),
567
+ hook: e.morphedCallback !== B.prototype.morphedCallback,
568
+ edits: t.editState ?? []
569
+ };
570
+ return t[N] = r, r;
571
+ }
572
+ var F = 10, I = 1e3, L = Symbol.for("voidable.dev"), R = Symbol.for("@voidable/ui:morph-participants"), z = /* @__PURE__ */ new WeakMap(), B = class r extends e {
573
+ #e = null;
574
+ #t = null;
575
+ #n = !1;
576
+ #r = !1;
577
+ #i = null;
578
+ #a = void 0;
579
+ #o = void 0;
580
+ #s = !1;
581
+ #c = null;
582
+ static get observedAttributes() {
583
+ let e = super.observedAttributes;
584
+ return this.labelTarget ? [
585
+ ...e,
586
+ "aria-label",
587
+ "aria-labelledby"
588
+ ] : e;
589
+ }
590
+ #l = null;
591
+ #u(e, t) {
592
+ this.#l || (this.#l = {
593
+ "aria-label": null,
594
+ "aria-labelledby": null,
595
+ written: /* @__PURE__ */ new Map()
596
+ }, this.addController({ hostUpdated: () => this.#d() })), this.#l[e] = t || null, this.removeAttribute(e), this.#d();
597
+ }
598
+ #d() {
599
+ let e = this.#l, t = this.constructor.labelTarget;
600
+ if (!e || !t) return;
601
+ let n = Array.from(this.querySelectorAll(t));
602
+ for (let [t, r] of e.written) if (!n.includes(t)) {
603
+ e.written.delete(t);
604
+ for (let [e, n] of Object.entries(r)) n !== null && t.getAttribute(e) === n && t.removeAttribute(e);
605
+ }
606
+ for (let t of n) {
607
+ let n = e.written.get(t);
608
+ n || e.written.set(t, n = {
609
+ "aria-label": null,
610
+ "aria-labelledby": null
611
+ });
612
+ for (let r of ["aria-label", "aria-labelledby"]) {
613
+ let i = e[r], a = t.getAttribute(r);
614
+ r === "aria-labelledby" && a !== null && a !== n[r] || (i === null ? (n[r] !== null && a === n[r] && a !== null && t.removeAttribute(r), n[r] = null) : (a !== i && t.setAttribute(r, i), n[r] = i));
615
+ }
616
+ }
617
+ }
618
+ createRenderRoot() {
619
+ return this;
620
+ }
621
+ connectedCallback() {
622
+ this.#a === void 0 && (this.#a = this.#f(this), this.#o = this.outerHTML, !this.__voidProjection && this.render !== e.prototype.render && new O(this)), super.connectedCallback();
623
+ }
624
+ connectedMoveCallback() {}
625
+ #f(e) {
626
+ if (!e.hasAttributes()) return null;
627
+ let { attrs: t } = P(this), n = e.attributes, r = null;
628
+ for (let e = 0; e < n.length; e++) {
629
+ let i = n[e];
630
+ t.has(i.name) && (r ??= /* @__PURE__ */ new Map()).set(i.name, i.value);
631
+ }
632
+ return r;
633
+ }
634
+ shouldUpdate(e) {
635
+ return !this[A] && super.shouldUpdate(e);
636
+ }
637
+ update(n) {
638
+ this.#r = !0;
639
+ try {
640
+ this.render === e.prototype.render ? t.prototype.update.call(this, n) : super.update(n);
641
+ } finally {
642
+ this.#r = !1;
643
+ }
644
+ }
645
+ setHostAttribute(e, t) {
646
+ let n = t === !0 ? "" : t === !1 || t == null ? null : String(t), r = this.#e ??= /* @__PURE__ */ new Map();
647
+ this.#i && r.get(e) !== n && this.#i.delete(e), r.set(e, n), n === null ? this.hasAttribute(e) && super.removeAttribute(e) : this.getAttribute(e) !== n && super.setAttribute(e, n);
648
+ }
649
+ setHostStyle(e, t) {
650
+ t == null || t === "" ? (this.#t?.delete(e), this.style.removeProperty(e)) : ((this.#t ??= /* @__PURE__ */ new Map()).set(e, t), this.style.getPropertyValue(e) !== t && this.style.setProperty(e, t));
651
+ }
652
+ removeAttribute(e) {
653
+ super.removeAttribute(e), this.#p(e);
654
+ }
655
+ removeAttributeNS(e, t) {
656
+ super.removeAttributeNS(e, t), e || this.#p(t);
657
+ }
658
+ toggleAttribute(e, t) {
659
+ let n = super.toggleAttribute(e, t);
660
+ return n || this.#p(e), n;
661
+ }
662
+ setAttribute(e, t) {
663
+ super.setAttribute(e, t), e === "style" && this.#t?.size && this.#m();
664
+ }
665
+ #p(e) {
666
+ (e === "style" ? this.#t?.size : this.#e?.get(e) != null) && this.#m();
667
+ }
668
+ #m() {
669
+ this.#n || (this.#n = !0, queueMicrotask(() => {
670
+ this.#n = !1, this.#h();
671
+ }));
672
+ }
673
+ #h() {
674
+ if (this.#e) for (let [e, t] of this.#e) t !== null && !this.hasAttribute(e) && this.#g(e) && super.setAttribute(e, t);
675
+ if (this.#t) {
676
+ let e;
677
+ for (let [t, n] of this.#t) if (this.style.getPropertyValue(t) !== n) {
678
+ if (!(e ??= this.#g("style"))) break;
679
+ this.style.setProperty(t, n);
680
+ }
681
+ }
682
+ }
683
+ #g(e) {
684
+ let t = Date.now(), n = this.#i ??= /* @__PURE__ */ new Map(), r = n.get(e);
685
+ return r && r[0] === Infinity ? !1 : ((!r || t - r[1] > I) && n.set(e, r = [0, t]), ++r[0] <= F ? !0 : (r[0] = Infinity, globalThis[L]?.report?.({
686
+ kind: "attribute-fight",
687
+ tag: this.localName,
688
+ subject: e,
689
+ message: `<${this.localName}> ${e}: something keeps removing this attribute, which the component manages; after ${F} restorations within ${I} ms it is no longer put back. Find the script that removes it (a MutationObserver, a sanitiser) and leave the attribute alone.`,
690
+ element: this
691
+ }), !1));
692
+ }
693
+ attributeChangedCallback(e, t, n) {
694
+ if ((e === "aria-label" || e === "aria-labelledby") && this.constructor.labelTarget) {
695
+ n !== null && this.#u(e, n);
696
+ return;
697
+ }
698
+ if (super.attributeChangedCallback(e, t, n), n !== null || t === null || this.#r) return;
699
+ let r = M(this).get(e);
700
+ if (!r) return;
701
+ let i = this;
702
+ if (!r.custom && r.value !== void 0 && i[r.prop] !== r.value) {
703
+ i[r.prop] = r.value;
704
+ return;
705
+ }
706
+ let { options: a } = r, o = i[r.prop], s = typeof a.converter == "object" ? a.converter : void 0;
707
+ (s?.toAttribute ? s.toAttribute(o, a.type) : a.type === Boolean ? o ? "" : null : o ?? null) != null && this.requestUpdate(r.prop, j);
708
+ }
709
+ insertBefore(e, t) {
710
+ let r = this[n];
711
+ return r && t && t.parentNode !== this && (r.isProjected(t) || r.isWrapEnd(t)) ? r.insertBefore(e, t) : r && !t && r.append(e) ? e : super.insertBefore(e, t);
712
+ }
713
+ removeChild(e) {
714
+ let t = this[n];
715
+ return t && e.parentNode !== this && t.isProjected(e) ? e.parentNode.removeChild(e) : super.removeChild(e);
716
+ }
717
+ replaceChild(e, t) {
718
+ let r = this[n];
719
+ return r && t.parentNode !== this && r.isProjected(t) ? (r.insertBefore(e, t), t.parentNode.removeChild(t)) : super.replaceChild(e, t);
720
+ }
721
+ get textContent() {
722
+ return super.textContent ?? "";
723
+ }
724
+ set textContent(e) {
725
+ let t = this[n], r = e == null ? "" : String(e), i = r ? [this.ownerDocument.createTextNode(r)] : [];
726
+ (!t || !t.replaceContent(i)) && (super.textContent = e);
727
+ }
728
+ replaceChildren(...e) {
729
+ let t = this[n];
730
+ if (t) {
731
+ let n = [];
732
+ for (let t of e) typeof t == "string" ? n.push(this.ownerDocument.createTextNode(t)) : t.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? n.push(...Array.from(t.childNodes)) : n.push(t);
733
+ for (let e of n) if (e.nodeType === Node.DOCUMENT_NODE || e.nodeType === Node.DOCUMENT_TYPE_NODE || e.contains(this)) throw new DOMException(`Failed to execute 'replaceChildren' on '${this.localName}': the new child cannot be inserted here.`, "HierarchyRequestError");
734
+ if (t.replaceContent(n)) return;
735
+ }
736
+ super.replaceChildren(...e);
737
+ }
738
+ voidBeforeMorph(e) {
739
+ if (e && e !== this) {
740
+ e instanceof r && e[n]?.unproject();
741
+ let t = E(e) || (this[R] ?? []).some((t) => t.isCopy?.(e)), i = this.#l;
742
+ if (i) {
743
+ for (let t of ["aria-label", "aria-labelledby"]) i[t] !== null && !e.hasAttribute(t) && (i[t] = null);
744
+ this.#d();
745
+ }
746
+ if (z.get(e) !== this) {
747
+ z.set(e, this);
748
+ for (let t of this[R] ?? []) t.voidBeforeMorph(e);
749
+ this.#_(e, t);
750
+ }
751
+ this.#y(e);
752
+ }
753
+ this.isConnected || E(this);
754
+ let t = this[n];
755
+ return t ? t.parked || t.unproject() : !1;
756
+ }
757
+ voidUnchanged(e) {
758
+ let t = e.outerHTML;
759
+ return t === this.#o && !this.__voidProjection?.parked ? !0 : (this.#o = t, !1);
760
+ }
761
+ voidAfterMorph() {
762
+ return this.__voidProjection?.reproject() ?? this.updateComplete;
763
+ }
764
+ #_(e, t = !1) {
765
+ let n = P(this), i = this.#a ?? null, a = e instanceof r && e.#a !== void 0 ? e.#a : t ? i : this.#f(e), o = null;
766
+ if (i) for (let [e, t] of i) a?.get(e) !== t && (o ??= /* @__PURE__ */ new Set()).add(e);
767
+ if (a) for (let [e, t] of a) i?.get(e) !== t && (o ??= /* @__PURE__ */ new Set()).add(e);
768
+ if (o && (this.#a = a), o && n.edits.length && this.#v()) {
769
+ for (let t of n.edits) {
770
+ if (!o.delete(t)) continue;
771
+ let n = this.getAttribute(t);
772
+ n === null ? e.removeAttribute(t) : e.getAttribute(t) !== n && e.setAttribute(t, n);
773
+ }
774
+ o.size || (o = null);
775
+ }
776
+ let s = this.attributes;
777
+ for (let t = 0; t < s.length; t++) {
778
+ let r = s[t];
779
+ n.attrs.get(r.name) !== !0 || o?.has(r.name) || e.getAttribute(r.name) !== r.value && e.setAttribute(r.name, r.value);
780
+ }
781
+ if (e instanceof r) {
782
+ let t = e.attributes;
783
+ for (let r = t.length - 1; r >= 0; r--) {
784
+ let i = t[r].name;
785
+ n.attrs.get(i) === !0 && !a?.has(i) && !this.hasAttribute(i) && e.removeAttribute(i);
786
+ }
787
+ }
788
+ if (a) for (let t of a.keys()) n.attrs.get(t) === !0 && !o?.has(t) && !this.hasAttribute(t) && e.removeAttribute(t);
789
+ if (o && n.drafts.length) {
790
+ let e = this;
791
+ for (let [t, r] of n.drafts) r !== null && o.has(r) && e[t] != null && (e[t] = null, this.requestUpdate());
792
+ }
793
+ if (o) for (let e of o) (this.#c ??= /* @__PURE__ */ new Set()).add(e);
794
+ (n.hook || this.#c) && !this.#s && (this.#s = !0, queueMicrotask(() => {
795
+ this.updateComplete.then(() => {
796
+ this.#s = !1;
797
+ let e = this.#c;
798
+ this.#c = null, this.isConnected && (e && this.serverChangedCallback(e), n.hook && this.morphedCallback());
799
+ });
800
+ }));
801
+ }
802
+ #v() {
803
+ let e = this.ownerDocument.activeElement;
804
+ return !!e && e !== this && this.contains(e) || y(this);
805
+ }
806
+ serverChangedCallback(e) {}
807
+ morphedCallback() {}
808
+ #y(e) {
809
+ if (this.#e) {
810
+ let t = e instanceof r ? e.#e : null;
811
+ for (let [n, r] of this.#e) {
812
+ if (r === null) continue;
813
+ let i = e.getAttribute(n);
814
+ (i === null || t?.has(n) && t.get(n) === i) && i !== r && e.setAttribute(n, r);
815
+ }
816
+ }
817
+ if (this.#t?.size && "style" in e) {
818
+ let t = e.style;
819
+ for (let [e, n] of this.#t) t.getPropertyValue(e) || t.setProperty(e, n);
820
+ }
821
+ }
822
+ };
823
+ //#endregion
824
+ export { b as i, O as n, y as r, B as t };