@luzmo/lucero 0.0.26 → 0.0.28

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 (184) hide show
  1. package/components/accordion/index.cjs +4 -4
  2. package/components/accordion/index.js +4 -4
  3. package/components/action-bar/index.cjs +1 -1
  4. package/components/action-bar/index.js +6 -6
  5. package/components/action-button/index.cjs +2 -2
  6. package/components/action-button/index.js +5 -5
  7. package/components/action-group/index.cjs +1 -1
  8. package/components/action-group/index.js +1 -1
  9. package/components/{action-group-DngGfcr_.js → action-group-DBImibFn.js} +2 -2
  10. package/components/{action-group-hy1HZxOi.cjs → action-group-DJGMcRHb.cjs} +1 -1
  11. package/components/action-menu/index.cjs +2 -2
  12. package/components/action-menu/index.js +6 -6
  13. package/components/{async-directive-B0s_zDWg.cjs → async-directive-BX1T1e1_.cjs} +1 -1
  14. package/components/{async-directive-C0KryStG.js → async-directive-BfcqVjDp.js} +1 -1
  15. package/components/avatar/index.cjs +3 -3
  16. package/components/avatar/index.js +10 -10
  17. package/components/base-CBCg3yyw.cjs +40 -0
  18. package/components/{base-DroC2Znx.js → base-WsynuqaS.js} +54 -51
  19. package/components/button/index.cjs +1 -1
  20. package/components/button/index.js +6 -6
  21. package/components/{button-base-BRZtaOk8.js → button-base-DbkDzb71.js} +4 -4
  22. package/components/{button-base-CJc7kjJK.cjs → button-base-XgPLmwP-.cjs} +1 -1
  23. package/components/button-group/index.cjs +1 -1
  24. package/components/button-group/index.js +2 -2
  25. package/components/calendar/index.cjs +1 -1
  26. package/components/calendar/index.js +1 -1
  27. package/components/checkbox/index.cjs +1 -1
  28. package/components/checkbox/index.js +4 -4
  29. package/components/{checkbox-mixin-CcPwhZst.cjs → checkbox-mixin-BDN0dBtS.cjs} +1 -1
  30. package/components/{checkbox-mixin-DbcpHFBw.js → checkbox-mixin-Do7EgtpQ.js} +2 -2
  31. package/components/{class-map-DuvNig0r.cjs → class-map-Di1D_rCm.cjs} +1 -1
  32. package/components/{class-map-CjcRhurN.js → class-map-NbVXqBU0.js} +1 -1
  33. package/components/{clear-button-Nwq4REOv.js → clear-button-DoeRUWQ3.js} +16 -16
  34. package/components/clear-button-Qi1pMA5S.cjs +18 -0
  35. package/components/close-button-BFMBEw3q.cjs +18 -0
  36. package/components/{close-button-9l1TxW7Y.cjs → close-button-BWXdHSx3.js} +34 -1
  37. package/components/color-area/index.cjs +1 -1
  38. package/components/color-area/index.js +3 -3
  39. package/components/color-field/index.cjs +1 -1
  40. package/components/color-field/index.js +2 -2
  41. package/components/color-handle/index.cjs +1 -1
  42. package/components/color-handle/index.js +2 -2
  43. package/components/color-loupe/index.cjs +1 -1
  44. package/components/color-loupe/index.js +1 -1
  45. package/components/{color-loupe-Ck2IRn4K.cjs → color-loupe-CaA_Lfkk.cjs} +1 -1
  46. package/components/{color-loupe-B0mH9Jyx.js → color-loupe-CmMsXbjT.js} +1 -1
  47. package/components/color-menu/index.cjs +4 -4
  48. package/components/color-menu/index.js +4 -4
  49. package/components/color-picker/index.cjs +1 -1
  50. package/components/color-picker/index.js +3 -3
  51. package/components/color-slider/index.cjs +1 -1
  52. package/components/color-slider/index.js +5 -5
  53. package/components/date-time-picker/index.cjs +3 -3
  54. package/components/date-time-picker/index.js +10 -10
  55. package/components/directive-helpers-Cm6gitnu.js +62 -0
  56. package/components/{directive-helpers-OG6wWKJt.js → directive-helpers-DyIRTWwA.cjs} +2 -8
  57. package/components/divider/index.cjs +1 -1
  58. package/components/divider/index.js +5 -5
  59. package/components/{divider.module-CXMNveQc.cjs → divider.module-DDvBo9zo.cjs} +1 -1
  60. package/components/{divider.module-DwOuLGU3.js → divider.module-DoQWQEIJ.js} +1 -1
  61. package/components/field-group/index.cjs +1 -1
  62. package/components/field-group/index.js +1 -1
  63. package/components/{field-group-ClxYbp6Z.js → field-group-DXfBWrkO.js} +2 -2
  64. package/components/{field-group-CIach2C_.cjs → field-group-DkGst3r5.cjs} +1 -1
  65. package/components/field-label/index.cjs +1 -1
  66. package/components/field-label/index.js +1 -1
  67. package/components/{field-label-BaOJ2i-l.js → field-label-CZ2zzChK.js} +2 -2
  68. package/components/{field-label-CkZCXvyb.cjs → field-label-mO1AkUgR.cjs} +1 -1
  69. package/components/flow-D-0MTYCm.js +527 -0
  70. package/components/flow-DM3dNAKs.cjs +30 -0
  71. package/components/{focusable-Dy9nRVST.js → focusable-BxtpnzWp.js} +1 -1
  72. package/components/{focusable-BW4I5ppi.cjs → focusable-EbipgXRh.cjs} +1 -1
  73. package/components/icon/index.cjs +1 -1
  74. package/components/icon/index.js +3 -3
  75. package/components/{if-defined-D7nbLM5n.cjs → if-defined-C9YGdo33.cjs} +1 -1
  76. package/components/{if-defined-CUCu7LSf.js → if-defined-DOaE2coe.js} +1 -1
  77. package/components/{index-C6wHQ74z.js → index-A-yOTB_d.js} +20 -20
  78. package/components/index-BLWuwZXx.cjs +113 -0
  79. package/components/index.cjs +1 -1
  80. package/components/index.js +132 -127
  81. package/components/infield-button/index.cjs +1 -1
  82. package/components/infield-button/index.js +3 -3
  83. package/components/label/index.cjs +1 -1
  84. package/components/label/index.js +1 -1
  85. package/components/{like-anchor-CkIPVvtI.js → like-anchor-Bvn_vLQ8.js} +2 -2
  86. package/components/{like-anchor-s-5FEzRQ.cjs → like-anchor-sod1C1fR.cjs} +1 -1
  87. package/components/luzmo-icons-DbwDQtuO.js +229 -0
  88. package/components/luzmo-icons-DletXGWU.cjs +29 -0
  89. package/components/{manage-help-text-DGwDhPtP.cjs → manage-help-text-DhgARkZX.cjs} +1 -1
  90. package/components/{manage-help-text-BzyCpgqN.js → manage-help-text-syYnjKGL.js} +2 -2
  91. package/components/menu/index.cjs +8 -8
  92. package/components/menu/index.js +19 -19
  93. package/components/multi-language-field/index.cjs +1 -1
  94. package/components/multi-language-field/index.js +3 -3
  95. package/components/number-field/index.cjs +3 -3
  96. package/components/number-field/index.js +10 -10
  97. package/components/{observe-slot-text-BMloiRX5.js → observe-slot-text-BPfIQQtz.js} +1 -1
  98. package/components/{observe-slot-text-BzdHQBH3.cjs → observe-slot-text-Ceb7SvYT.cjs} +1 -1
  99. package/components/options/index.cjs +104 -0
  100. package/components/options/index.d.ts +13 -0
  101. package/components/options/index.js +1172 -0
  102. package/components/options/option.d.ts +70 -0
  103. package/components/options/options-divider.d.ts +14 -0
  104. package/components/options/options.d.ts +85 -0
  105. package/components/overlay/index.cjs +4 -4
  106. package/components/overlay/index.js +8 -8
  107. package/components/{overlay-D4oZnKKd.js → overlay-BBNyvs8F.js} +4 -4
  108. package/components/{overlay-DAVu8dy8.cjs → overlay-o0tLxsk-.cjs} +1 -1
  109. package/components/{pending-state-xRhujC3J.js → pending-state-C5OtdXCm.js} +2 -2
  110. package/components/{pending-state-CkibRs0D.cjs → pending-state-gs6IxYtB.cjs} +1 -1
  111. package/components/picker/index.cjs +1 -1
  112. package/components/picker/index.js +2 -2
  113. package/components/picker/picker.d.ts +2 -2
  114. package/components/picker-CM3kN655.js +461 -0
  115. package/components/picker-C__p3kzA.cjs +123 -0
  116. package/components/picker-button/index.cjs +2 -2
  117. package/components/picker-button/index.js +6 -6
  118. package/components/popover/index.cjs +1 -1
  119. package/components/popover/index.js +1 -1
  120. package/components/{popover-Cx4MhaoE.js → popover-DjX0aAnY.js} +2 -2
  121. package/components/{popover-DBQ1YYW6.cjs → popover-KFfO0IYL.cjs} +1 -1
  122. package/components/progress-circle/index.cjs +1 -1
  123. package/components/progress-circle/index.js +1 -1
  124. package/components/{progress-circle-BGubjTvj.cjs → progress-circle-B12-2Gww.cjs} +1 -1
  125. package/components/{progress-circle-B25wyiBi.js → progress-circle-CWGsfHnp.js} +3 -3
  126. package/components/radio/index.cjs +1 -1
  127. package/components/radio/index.js +3 -3
  128. package/components/search/index.cjs +4 -4
  129. package/components/search/index.js +5 -5
  130. package/components/select/index.cjs +156 -0
  131. package/components/select/index.d.ts +7 -0
  132. package/components/select/index.js +572 -0
  133. package/components/{multi-picker/multi-picker.d.ts → select/select.d.ts} +83 -59
  134. package/components/{sized-mixin-CDhX3fJn.cjs → sized-mixin-CPxE5C96.cjs} +1 -1
  135. package/components/{sized-mixin-Y_QuYtjJ.js → sized-mixin-D4ACoVUr.js} +1 -1
  136. package/components/slider/index.cjs +1 -1
  137. package/components/slider/index.js +2 -2
  138. package/components/{state-Bq6oXknJ.cjs → state-D8JEtYqe.cjs} +1 -1
  139. package/components/{state-BF7jO1DT.js → state-Deh-vKYE.js} +1 -1
  140. package/components/strategies-Bc3hG-HA.js +195 -0
  141. package/components/strategies-DGwsR7Xf.cjs +18 -0
  142. package/components/{streaming-listener-Cm6s-WvF.cjs → streaming-listener-B00MvALi.cjs} +1 -1
  143. package/components/{streaming-listener-Dxbr_Jiv.js → streaming-listener-CP-JE6Fa.js} +2 -2
  144. package/components/{style-map-Cp3I-AN3.cjs → style-map-CeilmSgs.cjs} +1 -1
  145. package/components/{style-map-DqptyE0A.js → style-map-IgqIKvlE.js} +1 -1
  146. package/components/swatch/index.cjs +2 -2
  147. package/components/swatch/index.js +11 -11
  148. package/components/switch/index.cjs +1 -1
  149. package/components/switch/index.js +4 -4
  150. package/components/tabs/index.cjs +5 -5
  151. package/components/tabs/index.js +10 -10
  152. package/components/tags/index.cjs +1 -1
  153. package/components/tags/index.js +3 -3
  154. package/components/text-field/index.cjs +2 -2
  155. package/components/text-field/index.js +8 -8
  156. package/components/{text-field-DWC0tpq4.js → text-field-BIADXoLC.js} +11 -11
  157. package/components/{text-field-CThL0T_y.cjs → text-field-D5d_Gt0t.cjs} +5 -5
  158. package/components/toast/index.cjs +4 -4
  159. package/components/toast/index.js +5 -5
  160. package/components/tooltip/index.cjs +1 -1
  161. package/components/tooltip/index.js +3 -3
  162. package/components/unit-input/index.cjs +3 -3
  163. package/components/unit-input/index.js +4 -4
  164. package/components/utils.cjs +1 -1
  165. package/components/utils.js +4 -4
  166. package/custom-elements.json +1 -1
  167. package/index.d.ts +2 -1
  168. package/package.json +11 -6
  169. package/{components/picker → utils/button-interaction-controllers}/interaction-controller.d.ts +6 -5
  170. package/{components/picker → utils/button-interaction-controllers}/mobile-controller.d.ts +2 -2
  171. package/components/base-CTSOJw6c.cjs +0 -40
  172. package/components/clear-button-BkQsOIoW.cjs +0 -18
  173. package/components/close-button-7ut4xT4f.js +0 -51
  174. package/components/directive-helpers-BQRjDUVe.cjs +0 -22
  175. package/components/index-CbaDCtQl.cjs +0 -113
  176. package/components/multi-picker/index.cjs +0 -127
  177. package/components/multi-picker/index.d.ts +0 -7
  178. package/components/multi-picker/index.js +0 -502
  179. package/components/picker-D0wr8mRN.js +0 -460
  180. package/components/picker-PMfW3n8Z.cjs +0 -123
  181. package/components/strategies-CzfvQU_H.js +0 -192
  182. package/components/strategies-D_cIzAJE.cjs +0 -18
  183. /package/{components/picker → utils/button-interaction-controllers}/desktop-controller.d.ts +0 -0
  184. /package/{components/picker → utils/button-interaction-controllers}/strategies.d.ts +0 -0
@@ -0,0 +1,1172 @@
1
+ /*! * Lucero - The design system for Luzmo.
2
+ *
3
+ * Copyright © 2025 Luzmo
4
+ * All rights reserved.
5
+ * Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
6
+ * This license allows users with a current active Luzmo account to use Lucero.
7
+ * This license terminates automatically if a user no longer has an active Luzmo account.
8
+ * Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
9
+ *
10
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
11
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
13
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
14
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
15
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
16
+ * SOFTWARE.
17
+ * */
18
+ import { s as Q } from "../mutation-controller-DH7YOCyj.js";
19
+ import { x as g, r as T, E as L, n as v, T as H, c as oo, a as W } from "../base-WsynuqaS.js";
20
+ import { e as V } from "../query-D_KR_GUc.js";
21
+ import { F as to } from "../focusable-BxtpnzWp.js";
22
+ import { L as eo } from "../like-anchor-Bvn_vLQ8.js";
23
+ import { O as io } from "../observe-slot-presence-CmVi0zTc.js";
24
+ import { O as lo } from "../observe-slot-text-BPfIQQtz.js";
25
+ import { r as ro } from "../random-id-ByCz1xaq.js";
26
+ import { O as D, C as no, h as so, F as ao } from "../luzmo-icons-DbwDQtuO.js";
27
+ import { e as q, i as co, t as K } from "../directive-oAbCiebi.js";
28
+ import { f as ho } from "../async-directive-BfcqVjDp.js";
29
+ import { p as uo, v as k, r as E, M, m as po } from "../directive-helpers-Cm6gitnu.js";
30
+ import { e as mo } from "../base-D76d76ww.js";
31
+ import { S as G } from "../sized-mixin-D4ACoVUr.js";
32
+ import { d as vo } from "../divider.module-DoQWQEIJ.js";
33
+ const Y = () => {
34
+ if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
35
+ const s = document.createElement("style");
36
+ s.setAttribute("data-luzmo-vars", ""), s.textContent = 'html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: rgb(140, 140, 140);--luzmo-border-color-full-down: rgb(110, 110, 110);--luzmo-border-color-full-focus: rgb(140, 140, 140);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: #f0f0fc;--luzmo-background-color-down: #f1f1ff;--luzmo-background-color-focus: #f0f0fc;--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: rgb(225, 225, 225);--luzmo-background-color-highlight-down: rgb(215, 215, 215);--luzmo-background-color-highlight-focus: rgb(225, 225, 225);--luzmo-border-width: 1px;--luzmo-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-disabled-color);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: #333;--luzmo-font-color-down: #111;--luzmo-font-color-focus: #333;--luzmo-primary: #4434ff;--luzmo-primary-hover: #4234e4;--luzmo-primary-down: #392cc7;--luzmo-primary-focus: #4234e4;--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: #e309e3;--luzmo-secondary-down: #c711c7;--luzmo-secondary-focus: #e309e3;--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-negative-color: #ca221c;--luzmo-negative-color-hover: #b3241f;--luzmo-negative-color-down: #9f231f;--luzmo-negative-color-focus: #b3241f;--luzmo-negative-color-rgb: 202, 34, 28;--luzmo-positive-color: rgb(20, 150, 101);--luzmo-positive-color-hover: rgb(17, 128, 86);--luzmo-positive-color-down: rgb(16, 105, 71);--luzmo-positive-color-focus: rgb(17, 128, 86);--luzmo-positive-color-rgb: 20, 150, 101;--luzmo-selected-color: rgb(110, 110, 110);--luzmo-selected-color-hover: rgb(70, 70, 70);--luzmo-selected-color-down: rgb(40, 40, 40);--luzmo-selected-color-focus: rgb(70, 70, 70);--luzmo-selected-color-hard: #1e1e1e;--luzmo-selected-color-hard-hover: rgb(0, 0, 0);--luzmo-selected-color-hard-down: rgb(0, 0, 0);--luzmo-selected-color-hard-focus: rgb(0, 0, 0);--luzmo-informative-color: #1a77e9;--luzmo-informative-color-rgb: 26, 119, 233;--luzmo-disabled-color: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}', document.head.appendChild(s);
37
+ }
38
+ };
39
+ Y();
40
+ /**
41
+ * @license
42
+ * Copyright 2017 Google LLC
43
+ * SPDX-License-Identifier: BSD-3-Clause
44
+ */
45
+ let fo;
46
+ function go(s) {
47
+ return (o, t) => mo(o, t, { get() {
48
+ return (this.renderRoot ?? fo ?? (fo = document.createDocumentFragment())).querySelectorAll(s);
49
+ } });
50
+ }
51
+ const bo = '#icon{grid-area:iconArea;align-self:start;height:var(--luzmo-option-icon-container-height, var(--option-icon-container-height));display:flex;align-items:center;justify-content:center;color:var(--highcontrast-option-color-default, var(--luzmo-option-label-icon-color-default, var(--option-label-icon-color-default)))}::slotted([slot=icon]){fill:var(--highcontrast-option-color-default, var(--luzmo-option-label-icon-color-default, var(--option-label-icon-color-default)));margin-inline-end:var(--luzmo-option-label-text-to-visual, var(--option-label-text-to-visual));block-size:var(--luzmo-option-icon-size, var(--option-icon-height));inline-size:var(--luzmo-option-icon-width, var(--option-icon-height));font-size:var(--luzmo-option-icon-size, var(--option-icon-height));text-align:center;--luzmo-icon-vertical-align: 0}:host{cursor:pointer;box-sizing:border-box;background-color:var(--highcontrast-option-background-color-default, var(--luzmo-option-background-color-default, var(--option-background-color-default)));line-height:var(--luzmo-option-label-line-height, var(--option-label-line-height));min-block-size:var(--luzmo-option-min-height, var(--option-min-height));padding-block-start:var(--luzmo-option-top-edge-to-text, var(--option-top-edge-to-text));padding-block-end:var(--luzmo-option-bottom-edge-to-text, var(--option-bottom-edge-to-text));padding-inline:var(--luzmo-option-label-inline-edge-to-content, var(--option-label-inline-edge-to-content));grid-template:". . headingIconArea sectionHeadingArea . ." "selectedArea checkArea iconArea labelArea valueArea actionsArea" 1fr ". . . descriptionArea . ." ". . . . . ."/auto auto auto 1fr auto auto;justify-content:start;margin:0;-webkit-text-decoration:none;text-decoration:none;display:grid;outline:none;align-items:center;position:relative;flex-shrink:0}:host:focus-visible{outline:none}#label{grid-area:submenuItemLabelArea}.checkmark,.checkbox{opacity:1;grid-area:checkArea;align-self:start;display:block}.checkmark{font-size:var(--luzmo-option-checkmark-size, var(--option-checkmark-size));fill:var(--highcontrast-options-checkmark-icon-color-default, var(--luzmo-options-checkmark-icon-color-default, var(--options-checkmark-icon-color-default)));color:var(--highcontrast-options-checkmark-icon-color-default, var(--luzmo-options-checkmark-icon-color-default, var(--options-checkmark-icon-color-default)));margin-block-start:calc(var(--luzmo-option-top-to-checkmark, var(--option-top-to-checkmark)) - var(--luzmo-option-top-edge-to-text, var(--option-top-edge-to-text)));margin-inline-end:var(--luzmo-option-text-to-control, var(--option-label-text-to-control))}.checkbox{font-size:var(--luzmo-option-checkbox-size, var(--option-checkbox-size));fill:var(--highcontrast-options-checkbox-icon-color-default, var(--luzmo-options-checkbox-icon-color-default, var(--options-checkbox-icon-color-default)));color:var(--highcontrast-options-checkbox-icon-color-default, var(--luzmo-options-checkbox-icon-color-default, var(--options-checkbox-icon-color-default)));margin-block-start:calc(var(--luzmo-option-top-to-checkbox, var(--option-top-to-checkbox)) - var(--luzmo-option-top-edge-to-text, var(--option-top-edge-to-text)));margin-inline-end:var(--luzmo-option-text-to-control, var(--option-label-text-to-control))}::slotted([slot=value]){grid-area:submenuItemValueArea}:host([focused]){background-color:var(--highcontrast-option-background-color-focus, var(--luzmo-option-background-color-key-focus, var(--option-background-color-key-focus)));outline:none}:host([focused])>#label,:host(:focus)>#label{color:var(--highcontrast-option-color-focus, var(--luzmo-option-label-content-color-focus, var(--option-label-content-color-focus)))}:host([focused])>[name=description]::slotted(*),:host(:focus)>[name=description]::slotted(*){color:var(--highcontrast-option-color-focus, var(--luzmo-option-description-color-focus, var(--option-description-color-focus)))}:host([focused])>::slotted([slot=value]),:host(:focus)>::slotted([slot=value]){color:var(--highcontrast-option-color-focus, var(--luzmo-option-value-color-focus, var(--option-value-color-focus)))}:host([focused])>.icon:not(.checkmark,.checkbox),:host(:focus)>.icon:not(.checkmark,.checkbox){fill:var(--highcontrast-option-color-focus, var(--luzmo-option-label-icon-color-focus, var(--option-label-icon-color-focus)));color:var(--highcontrast-option-color-focus, var(--luzmo-option-label-icon-color-focus, var(--option-label-icon-color-focus)))}:host([focused])>.checkmark,:host(:focus)>.checkmark{fill:var(--highcontrast-option-color-focus, var(--luzmo-options-checkmark-icon-color-focus, var(--options-checkmark-icon-color-focus)));color:var(--highcontrast-option-color-focus, var(--luzmo-options-checkmark-icon-color-focus, var(--options-checkmark-icon-color-focus)))}:host([focused])>.checkbox,:host(:focus)>.checkbox{fill:var(--highcontrast-option-color-focus, var(--luzmo-options-checkbox-icon-color-focus, var(--options-checkbox-icon-color-focus)));color:var(--highcontrast-option-color-focus, var(--luzmo-options-checkbox-icon-color-focus, var(--options-checkbox-icon-color-focus)))}:host:dir(rtl),:host([dir=rtl]){--option-focus-indicator-direction-scalar: -1}:host(:is(:active,[active])){background-color:var(--highcontrast-option-background-color-focus, var(--luzmo-option-background-color-down, var(--option-background-color-down)))}:host(:is(:active,[active]))>#label{color:var(--highcontrast-option-color-focus, var(--luzmo-option-label-content-color-down, var(--option-label-content-color-down)))}:host(:is(:active,[active]))>[name=description]::slotted(*){color:var(--highcontrast-option-color-focus, var(--luzmo-option-description-color-down, var(--option-description-color-down)))}:host(:is(:active,[active]))>::slotted([slot=value]){color:var(--highcontrast-option-color-focus, var(--luzmo-option-value-color-down, var(--option-value-color-down)))}:host(:is(:active,[active]))>.icon:not(.checkmark,.checkbox){fill:var(--highcontrast-option-color-focus, var(--luzmo-option-label-icon-color-down, var(--option-label-icon-color-down)));color:var(--highcontrast-option-color-focus, var(--luzmo-option-label-icon-color-down, var(--option-label-icon-color-down)))}:host(:is(:active,[active]))>.checkmark{fill:var(--highcontrast-option-color-focus, var(--luzmo-options-checkmark-icon-color-down, var(--options-checkmark-icon-color-down)));color:var(--highcontrast-option-color-focus, var(--luzmo-options-checkmark-icon-color-down, var(--options-checkmark-icon-color-down)))}:host(:is(:active,[active]))>.checkbox{fill:var(--highcontrast-option-color-focus, var(--luzmo-options-checkbox-icon-color-down, var(--options-checkbox-icon-color-down)));color:var(--highcontrast-option-color-focus, var(--luzmo-options-checkbox-icon-color-down, var(--options-checkbox-icon-color-down)))}:host([disabled]),:host([aria-disabled=true]){background-color:initial}:host([disabled]) #label,:host([disabled]) ::slotted([slot=value]),:host([aria-disabled=true]) #label,:host([aria-disabled=true]) ::slotted([slot=value]){color:var(--highcontrast-option-color-disabled, var(--luzmo-option-label-content-color-disabled, var(--option-label-content-color-disabled)))}:host([disabled]) [name=description]::slotted(*),:host([aria-disabled=true]) [name=description]::slotted(*){color:var(--highcontrast-option-color-disabled, var(--luzmo-option-description-color-disabled, var(--option-description-color-disabled)))}:host([disabled]) ::slotted([slot=icon]),:host([aria-disabled=true]) ::slotted([slot=icon]){color:var(--highcontrast-option-color-disabled, var(--luzmo-option-label-icon-color-disabled, var(--option-label-icon-color-disabled)));fill:var(--highcontrast-option-color-disabled, var(--luzmo-option-label-icon-color-disabled, var(--option-label-icon-color-disabled)))}:host([focused]){box-shadow:inset calc(var(--luzmo-option-focus-indicator-width, var(--option-focus-indicator-width)) * 1) 0 0 0 var(--highcontrast-option-focus-indicator-color, var(--luzmo-option-focus-indicator-color, var(--option-focus-indicator-color)));box-shadow:inset calc(var(--luzmo-option-focus-indicator-width, var(--option-focus-indicator-width)) * var(--option-focus-indicator-direction-scalar, 1)) 0 0 0 var(--highcontrast-option-focus-indicator-color, var(--luzmo-option-focus-indicator-color, var(--option-focus-indicator-color)))}#label{font-size:var(--luzmo-option-label-font-size, var(--option-label-font-size));color:var(--highcontrast-option-color-default, var(--luzmo-option-label-content-color-default, var(--option-label-content-color-default)));-webkit-hyphens:auto;hyphens:auto;overflow-wrap:break-word;grid-area:labelArea}:host([variant=highlight][selected]){background-color:var(--luzmo-option-highlight-selected-label-background-color, var(--option-highlight-selected-label-background-color))}:host([variant=highlight][selected]) #label{color:var(--luzmo-option-highlight-selected-label-content-color, var(--option-highlight-selected-label-content-color))}:host([variant=highlight][selected]):hover #label{color:var(--luzmo-option-highlight-selected-label-content-color-hover, var(--option-highlight-selected-label-content-color-hover))}:host([variant=highlight][selected]):active #label{color:var(--luzmo-option-highlight-selected-label-content-color-down, var(--option-highlight-selected-label-content-color-down))}:host([variant=highlight][selected]):focus #label{color:var(--luzmo-option-highlight-selected-label-content-color-focus, var(--option-highlight-selected-label-content-color-focus))}:host([variant=highlight][selected]) ::slotted([slot=icon]){color:var(--highcontrast-option-color-disabled, var(--luzmo-option-highlight-selected-label-content-color, var(--option-highlight-selected-label-content-color)));fill:var(--highcontrast-option-color-disabled, var(--luzmo-option-highlight-selected-label-content-color, var(--option-highlight-selected-label-content-color)))}::slotted([slot=value]){color:var(--highcontrast-option-color-default, var(--luzmo-option-value-color-default, var(--option-value-color-default)));font-size:var(--luzmo-option-label-font-size, var(--option-label-font-size));grid-area:valueArea;justify-self:end}[name=description]::slotted(*){color:var(--highcontrast-option-color-default, var(--luzmo-option-description-color-default, var(--option-description-color-default)));font-size:var(--luzmo-option-description-font-size, var(--option-description-font-size));-webkit-hyphens:auto;hyphens:auto;overflow-wrap:break-word;line-height:var(--luzmo-option-description-line-height, var(--option-description-line-height));grid-area:descriptionArea;margin-block-start:var(--luzmo-option-label-to-description-spacing, var(--option-label-to-description-spacing))}:host([no-wrap]) #label{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@media (hover: hover){:host(:hover){background-color:var(--highcontrast-option-background-color-focus, var(--luzmo-option-background-color-hover, var(--option-background-color-hover)))}:host(:hover)>#label{color:var(--highcontrast-option-color-focus, var(--luzmo-option-label-content-color-hover, var(--option-label-content-color-hover)))}:host([variant=highlight][selected]:hover)>#label{color:var(--luzmo-option-highlight-selected-label-content-color-hover, var(--option-highlight-selected-label-content-color-hover))}:host(:hover)>[name=description]::slotted(*){color:var(--highcontrast-option-color-focus, var(--luzmo-option-description-color-hover, var(--option-description-color-hover)))}:host(:hover)>::slotted([slot=value]){color:var(--highcontrast-option-color-focus, var(--luzmo-option-value-color-hover, var(--option-value-color-hover)))}:host(:hover)>.icon:not(.checkmark,.checkbox){fill:var(--highcontrast-option-color-focus, var(--luzmo-option-label-icon-color-hover, var(--option-label-icon-color-hover)));color:var(--highcontrast-option-color-focus, var(--luzmo-option-label-icon-color-hover, var(--option-label-icon-color-hover)))}:host([variant=highlight][selected]:hover)>.icon:not(.checkmark,.checkbox){fill:var(--luzmo-option-highlight-selected-label-icon-color-hover, var(--option-highlight-selected-label-icon-color-hover))}:host(:hover)>.checkmark{fill:var(--highcontrast-option-color-focus, var(--luzmo-options-checkmark-icon-color-hover, var(--options-checkmark-icon-color-hover)));color:var(--highcontrast-option-color-focus, var(--luzmo-options-checkmark-icon-color-hover, var(--options-checkmark-icon-color-hover)))}:host(:hover)>.checkbox{fill:var(--highcontrast-option-color-focus, var(--luzmo-options-checkbox-icon-color-hover, var(--options-checkbox-icon-color-hover)));color:var(--highcontrast-option-color-focus, var(--luzmo-options-checkbox-icon-color-hover, var(--options-checkbox-icon-color-hover)))}:host([disabled]:hover),:host([aria-disabled=true]:hover){cursor:default;background-color:initial}:host([disabled]:hover) #label,:host([disabled]:hover) ::slotted([slot=value]),:host([aria-disabled=true]:hover) #label,:host([aria-disabled=true]:hover) ::slotted([slot=value]){color:var(--highcontrast-option-color-disabled, var(--luzmo-option-label-content-color-disabled, var(--option-label-content-color-disabled)))}:host([disabled]:hover) [name=description]::slotted(*),:host([aria-disabled=true]:hover) [name=description]::slotted(*){color:var(--highcontrast-option-color-disabled, var(--luzmo-option-description-color-disabled, var(--option-description-color-disabled)))}:host([disabled]:hover) ::slotted([slot=icon]),:host([aria-disabled=true]:hover) ::slotted([slot=icon]){color:var(--highcontrast-option-color-disabled, var(--luzmo-option-label-icon-color-disabled, var(--option-label-icon-color-disabled)));fill:var(--highcontrast-option-color-disabled, var(--luzmo-option-label-icon-color-disabled, var(--option-label-icon-color-disabled)))}}:host([emphasized]){--options-checkmark-icon-color-default: var(--luzmo-primary);--options-checkmark-icon-color-hover: var(--luzmo-primary-hover);--options-checkmark-icon-color-down: var(--luzmo-primary-down);--options-checkmark-icon-color-focus: var(--luzmo-primary-focus);--options-checkbox-icon-color-default: var(--luzmo-primary);--options-checkbox-icon-color-hover: var(--luzmo-primary-hover);--options-checkbox-icon-color-down: var(--luzmo-primary-down);--options-checkbox-icon-color-focus: var(--luzmo-primary-focus)}:host{text-align:initial;font-family:var(--luzmo-option-font-family, var(--luzmo-font-family))}:host([hidden]){display:none}:host([disabled]){pointer-events:none}:host([disabled]) [name=value]::slotted(*){color:var(--luzmo-option-label-icon-color-disabled, var(--luzmo-disabled-color))}#button{position:absolute;top:0;right:0;bottom:0;left:0}.icon-container>svg{vertical-align:top}:host([dir=ltr]) [icon-only]::slotted(:last-of-type){margin-right:auto}:host([dir=rtl]) [icon-only]::slotted(:last-of-type){margin-left:auto}@media (forced-colors: active){:host{forced-color-adjust:none}}:host([no-wrap]) #label{display:block}';
52
+ var zo = Object.defineProperty, _o = Object.getOwnPropertyDescriptor, _ = (s, o, t, e) => {
53
+ for (var i = e > 1 ? void 0 : e ? _o(o, t) : o, l = s.length - 1, r; l >= 0; l--)
54
+ (r = s[l]) && (i = (e ? r(o, t, i) : r(i)) || i);
55
+ return e && i && zo(o, t, i), i;
56
+ };
57
+ const yo = (s) => g`
58
+ <span class="icon-container icon checkmark ${s.join(" ")}">
59
+ ${D(ao)}
60
+ </span>
61
+ `, ko = (s) => g`
62
+ <span class="icon-container icon checkbox ${s.join(" ")}">
63
+ ${D(so)}
64
+ </span>
65
+ `, xo = (s) => g`
66
+ <span class="icon-container icon checkbox ${s.join(" ")}">
67
+ ${D(no)}
68
+ </span>
69
+ `;
70
+ class b extends eo(
71
+ lo(io(to, '[slot="icon"]'))
72
+ ) {
73
+ constructor() {
74
+ super(), this.active = !1, this.focused = !1, this.selected = !1, this.emphasized = !1, this.variant = "checkmarks", this._value = "", this.noWrap = !1, this.renderCheckIcon = (o, t) => {
75
+ const e = t ? ["check-icon--with-adjacent-icon"] : [];
76
+ return this.variant === "checkboxes" ? o ? xo(e) : ko(e) : o && this.variant !== "highlight" ? yo(e) : g``;
77
+ }, this.proxyFocus = () => {
78
+ this.focus();
79
+ }, this.willDispatchUpdate = !1, this.addEventListener("click", this.handleClickCapture, {
80
+ capture: !0
81
+ }), new Q(this, {
82
+ config: {
83
+ characterData: !0,
84
+ childList: !0,
85
+ subtree: !0
86
+ },
87
+ callback: () => {
88
+ this.breakItemChildrenCache();
89
+ }
90
+ });
91
+ }
92
+ static get styles() {
93
+ return [T(bo)];
94
+ }
95
+ get value() {
96
+ return this._value || this.itemText;
97
+ }
98
+ set value(o) {
99
+ o !== this._value && (this._value = o || "", this._value ? this.setAttribute("value", this._value) : this.removeAttribute("value"));
100
+ }
101
+ /**
102
+ * @private
103
+ */
104
+ get itemText() {
105
+ return this.itemChildren.content.reduce(
106
+ (o, t) => o + (t.textContent || "").trim(),
107
+ ""
108
+ );
109
+ }
110
+ get focusElement() {
111
+ return this;
112
+ }
113
+ get hasIcon() {
114
+ return this.slotContentIsPresent;
115
+ }
116
+ get itemChildren() {
117
+ if (!this.iconSlot || !this.contentSlot)
118
+ return {
119
+ icon: [],
120
+ content: []
121
+ };
122
+ if (this._itemChildren)
123
+ return this._itemChildren;
124
+ const o = this.iconSlot.assignedElements().map((e) => {
125
+ const i = e.cloneNode(!0);
126
+ return i.removeAttribute("slot"), i.classList.toggle("icon"), i;
127
+ }), t = this.contentSlot.assignedNodes().map((e) => e.cloneNode(!0));
128
+ return this._itemChildren = { icon: o, content: t }, this._itemChildren;
129
+ }
130
+ click() {
131
+ this.disabled || this.shouldProxyClick() || super.click();
132
+ }
133
+ handleClickCapture(o) {
134
+ if (this.disabled)
135
+ return o.preventDefault(), o.stopImmediatePropagation(), o.stopPropagation(), !1;
136
+ }
137
+ shouldProxyClick() {
138
+ let o = !1;
139
+ return this.anchorElement && (this.anchorElement.click(), o = !0), o;
140
+ }
141
+ breakItemChildrenCache() {
142
+ this._itemChildren = void 0, this.triggerUpdate();
143
+ }
144
+ render() {
145
+ return g`
146
+ ${this.renderCheckIcon(this.selected, this.hasIcon)}
147
+ <div id="icon">
148
+ <slot name="icon"></slot>
149
+ </div>
150
+ <div id="label">
151
+ <slot id="slot"></slot>
152
+ </div>
153
+ <slot name="description"></slot>
154
+ <slot name="value"></slot>
155
+ ${this.href && this.href.length > 0 ? super.renderAnchor({
156
+ id: "button",
157
+ ariaHidden: !0,
158
+ className: "button anchor hidden"
159
+ }) : L}
160
+ `;
161
+ }
162
+ handlePointerdown() {
163
+ }
164
+ firstUpdated(o) {
165
+ super.firstUpdated(o), this.setAttribute("tabindex", "-1"), this.addEventListener("pointerdown", this.handlePointerdown), this.hasAttribute("id") || (this.id = `luzmo-option-${ro()}`);
166
+ }
167
+ updateAriaSelected() {
168
+ const o = this.getAttribute("role");
169
+ o === "option" ? this.setAttribute("aria-selected", this.selected ? "true" : "false") : o === "optioncheckbox" && this.setAttribute("aria-checked", this.selected ? "true" : "false");
170
+ }
171
+ setRole(o) {
172
+ this.setAttribute("role", o), this.updateAriaSelected();
173
+ }
174
+ updated(o) {
175
+ super.updated(o), o.has("label") && (this.label || o.get("label") !== void 0) && this.setAttribute("aria-label", this.label || ""), this.anchorElement && (this.anchorElement.addEventListener("focus", this.proxyFocus), this.anchorElement.tabIndex = -1), o.has("selected") && this.updateAriaSelected();
176
+ }
177
+ connectedCallback() {
178
+ super.connectedCallback(), this.triggerUpdate();
179
+ }
180
+ async triggerUpdate() {
181
+ this.willDispatchUpdate || (this.willDispatchUpdate = !0, await new Promise((o) => requestAnimationFrame(o)), this.dispatchUpdate());
182
+ }
183
+ dispatchUpdate() {
184
+ this.isConnected && (this.willDispatchUpdate = !1);
185
+ }
186
+ }
187
+ _([
188
+ v({ type: Boolean, reflect: !0 })
189
+ ], b.prototype, "active", 2);
190
+ _([
191
+ v({ type: Boolean, reflect: !0 })
192
+ ], b.prototype, "focused", 2);
193
+ _([
194
+ v({ type: Boolean, reflect: !0 })
195
+ ], b.prototype, "selected", 2);
196
+ _([
197
+ v({ type: Boolean, reflect: !0 })
198
+ ], b.prototype, "emphasized", 2);
199
+ _([
200
+ v({ type: String, reflect: !0 })
201
+ ], b.prototype, "variant", 2);
202
+ _([
203
+ v({ type: String })
204
+ ], b.prototype, "value", 1);
205
+ _([
206
+ V("slot:not([name])")
207
+ ], b.prototype, "contentSlot", 2);
208
+ _([
209
+ V('slot[name="icon"]')
210
+ ], b.prototype, "iconSlot", 2);
211
+ _([
212
+ v({
213
+ type: Boolean,
214
+ reflect: !0,
215
+ attribute: "no-wrap",
216
+ hasChanged() {
217
+ return !1;
218
+ }
219
+ })
220
+ ], b.prototype, "noWrap", 2);
221
+ _([
222
+ V(".anchor")
223
+ ], b.prototype, "anchorElement", 2);
224
+ function S(s, o, t, e) {
225
+ var i = arguments.length, l = i < 3 ? o : e === null ? e = Object.getOwnPropertyDescriptor(o, t) : e, r;
226
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") l = Reflect.decorate(s, o, t, e);
227
+ else for (var n = s.length - 1; n >= 0; n--) (r = s[n]) && (l = (i < 3 ? r(l) : i > 3 ? r(o, t, l) : r(o, t)) || l);
228
+ return i > 3 && l && Object.defineProperty(o, t, l), l;
229
+ }
230
+ /**
231
+ * @license
232
+ * Copyright 2017 Google LLC
233
+ * SPDX-License-Identifier: BSD-3-Clause
234
+ */
235
+ const P = (s, o, t) => {
236
+ const e = /* @__PURE__ */ new Map();
237
+ for (let i = o; i <= t; i++) e.set(s[i], i);
238
+ return e;
239
+ }, Z = q(class extends co {
240
+ constructor(s) {
241
+ if (super(s), s.type !== K.CHILD) throw Error("repeat() can only be used in text expressions");
242
+ }
243
+ dt(s, o, t) {
244
+ let e;
245
+ t === void 0 ? t = o : o !== void 0 && (e = o);
246
+ const i = [], l = [];
247
+ let r = 0;
248
+ for (const n of s) i[r] = e ? e(n, r) : r, l[r] = t(n, r), r++;
249
+ return { values: l, keys: i };
250
+ }
251
+ render(s, o, t) {
252
+ return this.dt(s, o, t).values;
253
+ }
254
+ update(s, [o, t, e]) {
255
+ const i = uo(s), { values: l, keys: r } = this.dt(o, t, e);
256
+ if (!Array.isArray(i)) return this.ut = r, l;
257
+ const n = this.ut ?? (this.ut = []), a = [];
258
+ let c, f, u = 0, d = i.length - 1, h = 0, p = l.length - 1;
259
+ for (; u <= d && h <= p; ) if (i[u] === null) u++;
260
+ else if (i[d] === null) d--;
261
+ else if (n[u] === r[h]) a[h] = k(i[u], l[h]), u++, h++;
262
+ else if (n[d] === r[p]) a[p] = k(i[d], l[p]), d--, p--;
263
+ else if (n[u] === r[p]) a[p] = k(i[u], l[p]), E(s, a[p + 1], i[u]), u++, p--;
264
+ else if (n[d] === r[h]) a[h] = k(i[d], l[h]), E(s, i[u], i[d]), d--, h++;
265
+ else if (c === void 0 && (c = P(r, h, p), f = P(n, u, d)), c.has(n[u])) if (c.has(n[d])) {
266
+ const m = f.get(r[h]), C = m !== void 0 ? i[m] : null;
267
+ if (C === null) {
268
+ const O = E(s, i[u]);
269
+ k(O, l[h]), a[h] = O;
270
+ } else a[h] = k(C, l[h]), E(s, i[u], C), i[m] = null;
271
+ h++;
272
+ } else M(i[d]), d--;
273
+ else M(i[u]), u++;
274
+ for (; h <= p; ) {
275
+ const m = E(s, a[p + 1]);
276
+ k(m, l[h]), a[h++] = m;
277
+ }
278
+ for (; u <= d; ) {
279
+ const m = i[u++];
280
+ m !== null && M(m);
281
+ }
282
+ return this.ut = r, po(s, a), H;
283
+ }
284
+ });
285
+ /**
286
+ * @license
287
+ * Copyright 2021 Google LLC
288
+ * SPDX-License-Identifier: BSD-3-Clause
289
+ */
290
+ class $ extends Event {
291
+ constructor(o) {
292
+ super($.eventName, { bubbles: !1 }), this.first = o.first, this.last = o.last;
293
+ }
294
+ }
295
+ $.eventName = "rangeChanged";
296
+ class R extends Event {
297
+ constructor(o) {
298
+ super(R.eventName, { bubbles: !1 }), this.first = o.first, this.last = o.last;
299
+ }
300
+ }
301
+ R.eventName = "visibilityChanged";
302
+ class F extends Event {
303
+ constructor() {
304
+ super(F.eventName, { bubbles: !1 });
305
+ }
306
+ }
307
+ F.eventName = "unpinned";
308
+ /**
309
+ * @license
310
+ * Copyright 2021 Google LLC
311
+ * SPDX-License-Identifier: BSD-3-Clause
312
+ */
313
+ class wo {
314
+ constructor(o) {
315
+ this._element = null;
316
+ const t = o ?? window;
317
+ this._node = t, o && (this._element = o);
318
+ }
319
+ get element() {
320
+ return this._element || document.scrollingElement || document.documentElement;
321
+ }
322
+ get scrollTop() {
323
+ return this.element.scrollTop || window.scrollY;
324
+ }
325
+ get scrollLeft() {
326
+ return this.element.scrollLeft || window.scrollX;
327
+ }
328
+ get scrollHeight() {
329
+ return this.element.scrollHeight;
330
+ }
331
+ get scrollWidth() {
332
+ return this.element.scrollWidth;
333
+ }
334
+ get viewportHeight() {
335
+ return this._element ? this._element.getBoundingClientRect().height : window.innerHeight;
336
+ }
337
+ get viewportWidth() {
338
+ return this._element ? this._element.getBoundingClientRect().width : window.innerWidth;
339
+ }
340
+ get maxScrollTop() {
341
+ return this.scrollHeight - this.viewportHeight;
342
+ }
343
+ get maxScrollLeft() {
344
+ return this.scrollWidth - this.viewportWidth;
345
+ }
346
+ }
347
+ class Co extends wo {
348
+ constructor(o, t) {
349
+ super(t), this._clients = /* @__PURE__ */ new Set(), this._retarget = null, this._end = null, this.__destination = null, this.correctingScrollError = !1, this._checkForArrival = this._checkForArrival.bind(this), this._updateManagedScrollTo = this._updateManagedScrollTo.bind(this), this.scrollTo = this.scrollTo.bind(this), this.scrollBy = this.scrollBy.bind(this);
350
+ const e = this._node;
351
+ this._originalScrollTo = e.scrollTo, this._originalScrollBy = e.scrollBy, this._originalScroll = e.scroll, this._attach(o);
352
+ }
353
+ get _destination() {
354
+ return this.__destination;
355
+ }
356
+ get scrolling() {
357
+ return this._destination !== null;
358
+ }
359
+ scrollTo(o, t) {
360
+ const e = typeof o == "number" && typeof t == "number" ? { left: o, top: t } : o;
361
+ this._scrollTo(e);
362
+ }
363
+ scrollBy(o, t) {
364
+ const e = typeof o == "number" && typeof t == "number" ? { left: o, top: t } : o;
365
+ e.top !== void 0 && (e.top += this.scrollTop), e.left !== void 0 && (e.left += this.scrollLeft), this._scrollTo(e);
366
+ }
367
+ _nativeScrollTo(o) {
368
+ this._originalScrollTo.bind(this._element || window)(o);
369
+ }
370
+ _scrollTo(o, t = null, e = null) {
371
+ this._end !== null && this._end(), o.behavior === "smooth" ? (this._setDestination(o), this._retarget = t, this._end = e) : this._resetScrollState(), this._nativeScrollTo(o);
372
+ }
373
+ _setDestination(o) {
374
+ let { top: t, left: e } = o;
375
+ return t = t === void 0 ? void 0 : Math.max(0, Math.min(t, this.maxScrollTop)), e = e === void 0 ? void 0 : Math.max(0, Math.min(e, this.maxScrollLeft)), this._destination !== null && e === this._destination.left && t === this._destination.top ? !1 : (this.__destination = { top: t, left: e, behavior: "smooth" }, !0);
376
+ }
377
+ _resetScrollState() {
378
+ this.__destination = null, this._retarget = null, this._end = null;
379
+ }
380
+ _updateManagedScrollTo(o) {
381
+ this._destination && this._setDestination(o) && this._nativeScrollTo(this._destination);
382
+ }
383
+ managedScrollTo(o, t, e) {
384
+ return this._scrollTo(o, t, e), this._updateManagedScrollTo;
385
+ }
386
+ correctScrollError(o) {
387
+ this.correctingScrollError = !0, requestAnimationFrame(() => requestAnimationFrame(() => this.correctingScrollError = !1)), this._nativeScrollTo(o), this._retarget && this._setDestination(this._retarget()), this._destination && this._nativeScrollTo(this._destination);
388
+ }
389
+ _checkForArrival() {
390
+ if (this._destination !== null) {
391
+ const { scrollTop: o, scrollLeft: t } = this;
392
+ let { top: e, left: i } = this._destination;
393
+ e = Math.min(e || 0, this.maxScrollTop), i = Math.min(i || 0, this.maxScrollLeft);
394
+ const l = Math.abs(e - o), r = Math.abs(i - t);
395
+ l < 1 && r < 1 && (this._end && this._end(), this._resetScrollState());
396
+ }
397
+ }
398
+ detach(o) {
399
+ return this._clients.delete(o), this._clients.size === 0 && (this._node.scrollTo = this._originalScrollTo, this._node.scrollBy = this._originalScrollBy, this._node.scroll = this._originalScroll, this._node.removeEventListener("scroll", this._checkForArrival)), null;
400
+ }
401
+ _attach(o) {
402
+ this._clients.add(o), this._clients.size === 1 && (this._node.scrollTo = this.scrollTo, this._node.scrollBy = this.scrollBy, this._node.scroll = this.scrollTo, this._node.addEventListener("scroll", this._checkForArrival));
403
+ }
404
+ }
405
+ /**
406
+ * @license
407
+ * Copyright 2021 Google LLC
408
+ * SPDX-License-Identifier: BSD-3-Clause
409
+ */
410
+ let j = typeof window < "u" ? window.ResizeObserver : void 0;
411
+ const B = Symbol("virtualizerRef"), I = "virtualizer-sizer";
412
+ let U;
413
+ class Eo {
414
+ constructor(o) {
415
+ if (this._benchmarkStart = null, this._layout = null, this._clippingAncestors = [], this._scrollSize = null, this._scrollError = null, this._childrenPos = null, this._childMeasurements = null, this._toBeMeasured = /* @__PURE__ */ new Map(), this._rangeChanged = !0, this._itemsChanged = !0, this._visibilityChanged = !0, this._scrollerController = null, this._isScroller = !1, this._sizer = null, this._hostElementRO = null, this._childrenRO = null, this._mutationObserver = null, this._scrollEventListeners = [], this._scrollEventListenerOptions = {
416
+ passive: !0
417
+ }, this._loadListener = this._childLoaded.bind(this), this._scrollIntoViewTarget = null, this._updateScrollIntoViewCoordinates = null, this._items = [], this._first = -1, this._last = -1, this._firstVisible = -1, this._lastVisible = -1, this._scheduled = /* @__PURE__ */ new WeakSet(), this._measureCallback = null, this._measureChildOverride = null, this._layoutCompletePromise = null, this._layoutCompleteResolver = null, this._layoutCompleteRejecter = null, this._pendingLayoutComplete = null, this._layoutInitialized = null, this._connected = !1, !o)
418
+ throw new Error("Virtualizer constructor requires a configuration object");
419
+ if (o.hostElement)
420
+ this._init(o);
421
+ else
422
+ throw new Error('Virtualizer configuration requires the "hostElement" property');
423
+ }
424
+ set items(o) {
425
+ Array.isArray(o) && o !== this._items && (this._itemsChanged = !0, this._items = o, this._schedule(this._updateLayout));
426
+ }
427
+ _init(o) {
428
+ this._isScroller = !!o.scroller, this._initHostElement(o);
429
+ const t = o.layout || {};
430
+ this._layoutInitialized = this._initLayout(t);
431
+ }
432
+ _initObservers() {
433
+ this._mutationObserver = new MutationObserver(this._finishDOMUpdate.bind(this)), this._hostElementRO = new j(() => this._hostElementSizeChanged()), this._childrenRO = new j(this._childrenSizeChanged.bind(this));
434
+ }
435
+ _initHostElement(o) {
436
+ const t = this._hostElement = o.hostElement;
437
+ this._applyVirtualizerStyles(), t[B] = this;
438
+ }
439
+ connected() {
440
+ this._initObservers();
441
+ const o = this._isScroller;
442
+ this._clippingAncestors = Io(this._hostElement, o), this._scrollerController = new Co(this, this._clippingAncestors[0]), this._schedule(this._updateLayout), this._observeAndListen(), this._connected = !0;
443
+ }
444
+ _observeAndListen() {
445
+ this._mutationObserver.observe(this._hostElement, { childList: !0 }), this._hostElementRO.observe(this._hostElement), this._scrollEventListeners.push(window), window.addEventListener("scroll", this, this._scrollEventListenerOptions), this._clippingAncestors.forEach((o) => {
446
+ o.addEventListener("scroll", this, this._scrollEventListenerOptions), this._scrollEventListeners.push(o), this._hostElementRO.observe(o);
447
+ }), this._hostElementRO.observe(this._scrollerController.element), this._children.forEach((o) => this._childrenRO.observe(o)), this._scrollEventListeners.forEach((o) => o.addEventListener("scroll", this, this._scrollEventListenerOptions));
448
+ }
449
+ disconnected() {
450
+ var o, t, e, i;
451
+ this._scrollEventListeners.forEach((l) => l.removeEventListener("scroll", this, this._scrollEventListenerOptions)), this._scrollEventListeners = [], this._clippingAncestors = [], (o = this._scrollerController) == null || o.detach(this), this._scrollerController = null, (t = this._mutationObserver) == null || t.disconnect(), this._mutationObserver = null, (e = this._hostElementRO) == null || e.disconnect(), this._hostElementRO = null, (i = this._childrenRO) == null || i.disconnect(), this._childrenRO = null, this._rejectLayoutCompletePromise("disconnected"), this._connected = !1;
452
+ }
453
+ _applyVirtualizerStyles() {
454
+ const t = this._hostElement.style;
455
+ t.display = t.display || "block", t.position = t.position || "relative", t.contain = t.contain || "size layout", this._isScroller && (t.overflow = t.overflow || "auto", t.minHeight = t.minHeight || "150px");
456
+ }
457
+ _getSizer() {
458
+ const o = this._hostElement;
459
+ if (!this._sizer) {
460
+ let t = o.querySelector(`[${I}]`);
461
+ t || (t = document.createElement("div"), t.setAttribute(I, ""), o.appendChild(t)), Object.assign(t.style, {
462
+ position: "absolute",
463
+ margin: "-2px 0 0 0",
464
+ padding: 0,
465
+ visibility: "hidden",
466
+ fontSize: "2px"
467
+ }), t.textContent = "&nbsp;", t.setAttribute(I, ""), this._sizer = t;
468
+ }
469
+ return this._sizer;
470
+ }
471
+ async updateLayoutConfig(o) {
472
+ await this._layoutInitialized;
473
+ const t = o.type || // The new config is compatible with the current layout,
474
+ // so we update the config and return true to indicate
475
+ // a successful update
476
+ U;
477
+ if (typeof t == "function" && this._layout instanceof t) {
478
+ const e = { ...o };
479
+ return delete e.type, this._layout.config = e, !0;
480
+ }
481
+ return !1;
482
+ }
483
+ async _initLayout(o) {
484
+ let t, e;
485
+ if (typeof o.type == "function") {
486
+ e = o.type;
487
+ const i = { ...o };
488
+ delete i.type, t = i;
489
+ } else
490
+ t = o;
491
+ e === void 0 && (U = e = (await import("../flow-D-0MTYCm.js")).FlowLayout), this._layout = new e((i) => this._handleLayoutMessage(i), t), this._layout.measureChildren && typeof this._layout.updateItemSizes == "function" && (typeof this._layout.measureChildren == "function" && (this._measureChildOverride = this._layout.measureChildren), this._measureCallback = this._layout.updateItemSizes.bind(this._layout)), this._layout.listenForChildLoadEvents && this._hostElement.addEventListener("load", this._loadListener, !0), this._schedule(this._updateLayout);
492
+ }
493
+ // TODO (graynorton): Rework benchmarking so that it has no API and
494
+ // instead is always on except in production builds
495
+ startBenchmarking() {
496
+ this._benchmarkStart === null && (this._benchmarkStart = window.performance.now());
497
+ }
498
+ stopBenchmarking() {
499
+ if (this._benchmarkStart !== null) {
500
+ const o = window.performance.now(), t = o - this._benchmarkStart, i = performance.getEntriesByName("uv-virtualizing", "measure").filter((l) => l.startTime >= this._benchmarkStart && l.startTime < o).reduce((l, r) => l + r.duration, 0);
501
+ return this._benchmarkStart = null, { timeElapsed: t, virtualizationTime: i };
502
+ }
503
+ return null;
504
+ }
505
+ _measureChildren() {
506
+ const o = {}, t = this._children, e = this._measureChildOverride || this._measureChild;
507
+ for (let i = 0; i < t.length; i++) {
508
+ const l = t[i], r = this._first + i;
509
+ (this._itemsChanged || this._toBeMeasured.has(l)) && (o[r] = e.call(this, l, this._items[r]));
510
+ }
511
+ this._childMeasurements = o, this._schedule(this._updateLayout), this._toBeMeasured.clear();
512
+ }
513
+ /**
514
+ * Returns the width, height, and margins of the given child.
515
+ */
516
+ _measureChild(o) {
517
+ const { width: t, height: e } = o.getBoundingClientRect();
518
+ return Object.assign({ width: t, height: e }, So(o));
519
+ }
520
+ async _schedule(o) {
521
+ this._scheduled.has(o) || (this._scheduled.add(o), await Promise.resolve(), this._scheduled.delete(o), o.call(this));
522
+ }
523
+ async _updateDOM(o) {
524
+ this._scrollSize = o.scrollSize, this._adjustRange(o.range), this._childrenPos = o.childPositions, this._scrollError = o.scrollError || null;
525
+ const { _rangeChanged: t, _itemsChanged: e } = this;
526
+ this._visibilityChanged && (this._notifyVisibility(), this._visibilityChanged = !1), (t || e) && (this._notifyRange(), this._rangeChanged = !1), this._finishDOMUpdate();
527
+ }
528
+ _finishDOMUpdate() {
529
+ this._connected && (this._children.forEach((o) => this._childrenRO.observe(o)), this._checkScrollIntoViewTarget(this._childrenPos), this._positionChildren(this._childrenPos), this._sizeHostElement(this._scrollSize), this._correctScrollError(), this._benchmarkStart && "mark" in window.performance && window.performance.mark("uv-end"));
530
+ }
531
+ _updateLayout() {
532
+ this._layout && this._connected && (this._layout.items = this._items, this._updateView(), this._childMeasurements !== null && (this._measureCallback && this._measureCallback(this._childMeasurements), this._childMeasurements = null), this._layout.reflowIfNeeded(), this._benchmarkStart && "mark" in window.performance && window.performance.mark("uv-end"));
533
+ }
534
+ _handleScrollEvent() {
535
+ var o;
536
+ if (this._benchmarkStart && "mark" in window.performance) {
537
+ try {
538
+ window.performance.measure("uv-virtualizing", "uv-start", "uv-end");
539
+ } catch (t) {
540
+ console.warn("Error measuring performance data: ", t);
541
+ }
542
+ window.performance.mark("uv-start");
543
+ }
544
+ this._scrollerController.correctingScrollError === !1 && ((o = this._layout) == null || o.unpin()), this._schedule(this._updateLayout);
545
+ }
546
+ handleEvent(o) {
547
+ switch (o.type) {
548
+ case "scroll":
549
+ (o.currentTarget === window || this._clippingAncestors.includes(o.currentTarget)) && this._handleScrollEvent();
550
+ break;
551
+ default:
552
+ console.warn("event not handled", o);
553
+ }
554
+ }
555
+ _handleLayoutMessage(o) {
556
+ o.type === "stateChanged" ? this._updateDOM(o) : o.type === "visibilityChanged" ? (this._firstVisible = o.firstVisible, this._lastVisible = o.lastVisible, this._notifyVisibility()) : o.type === "unpinned" && this._hostElement.dispatchEvent(new F());
557
+ }
558
+ get _children() {
559
+ const o = [];
560
+ let t = this._hostElement.firstElementChild;
561
+ for (; t; )
562
+ t.hasAttribute(I) || o.push(t), t = t.nextElementSibling;
563
+ return o;
564
+ }
565
+ _updateView() {
566
+ var i;
567
+ const o = this._hostElement, t = (i = this._scrollerController) == null ? void 0 : i.element, e = this._layout;
568
+ if (o && t && e) {
569
+ let l, r, n, a;
570
+ const c = o.getBoundingClientRect();
571
+ l = 0, r = 0, n = window.innerHeight, a = window.innerWidth;
572
+ const f = this._clippingAncestors.map((x) => x.getBoundingClientRect());
573
+ f.unshift(c);
574
+ for (const x of f)
575
+ l = Math.max(l, x.top), r = Math.max(r, x.left), n = Math.min(n, x.bottom), a = Math.min(a, x.right);
576
+ const u = t.getBoundingClientRect(), d = {
577
+ left: c.left - u.left,
578
+ top: c.top - u.top
579
+ }, h = {
580
+ width: t.scrollWidth,
581
+ height: t.scrollHeight
582
+ }, p = l - c.top + o.scrollTop, m = r - c.left + o.scrollLeft, C = Math.max(0, n - l), O = Math.max(0, a - r);
583
+ e.viewportSize = { width: O, height: C }, e.viewportScroll = { top: p, left: m }, e.totalScrollSize = h, e.offsetWithinScroller = d;
584
+ }
585
+ }
586
+ /**
587
+ * Styles the host element so that its size reflects the
588
+ * total size of all items.
589
+ */
590
+ _sizeHostElement(o) {
591
+ const e = o && o.width !== null ? Math.min(82e5, o.width) : 0, i = o && o.height !== null ? Math.min(82e5, o.height) : 0;
592
+ if (this._isScroller)
593
+ this._getSizer().style.transform = `translate(${e}px, ${i}px)`;
594
+ else {
595
+ const l = this._hostElement.style;
596
+ l.minWidth = e ? `${e}px` : "100%", l.minHeight = i ? `${i}px` : "100%";
597
+ }
598
+ }
599
+ /**
600
+ * Sets the top and left transform style of the children from the values in
601
+ * pos.
602
+ */
603
+ _positionChildren(o) {
604
+ o && o.forEach(({ top: t, left: e, width: i, height: l, xOffset: r, yOffset: n }, a) => {
605
+ const c = this._children[a - this._first];
606
+ c && (c.style.position = "absolute", c.style.boxSizing = "border-box", c.style.transform = `translate(${e}px, ${t}px)`, i !== void 0 && (c.style.width = i + "px"), l !== void 0 && (c.style.height = l + "px"), c.style.left = r === void 0 ? null : r + "px", c.style.top = n === void 0 ? null : n + "px");
607
+ });
608
+ }
609
+ async _adjustRange(o) {
610
+ const { _first: t, _last: e, _firstVisible: i, _lastVisible: l } = this;
611
+ this._first = o.first, this._last = o.last, this._firstVisible = o.firstVisible, this._lastVisible = o.lastVisible, this._rangeChanged = this._rangeChanged || this._first !== t || this._last !== e, this._visibilityChanged = this._visibilityChanged || this._firstVisible !== i || this._lastVisible !== l;
612
+ }
613
+ _correctScrollError() {
614
+ if (this._scrollError) {
615
+ const { scrollTop: o, scrollLeft: t } = this._scrollerController, { top: e, left: i } = this._scrollError;
616
+ this._scrollError = null, this._scrollerController.correctScrollError({
617
+ top: o - e,
618
+ left: t - i
619
+ });
620
+ }
621
+ }
622
+ element(o) {
623
+ var t;
624
+ return o === 1 / 0 && (o = this._items.length - 1), ((t = this._items) == null ? void 0 : t[o]) === void 0 ? void 0 : {
625
+ scrollIntoView: (e = {}) => this._scrollElementIntoView({ ...e, index: o })
626
+ };
627
+ }
628
+ _scrollElementIntoView(o) {
629
+ if (o.index >= this._first && o.index <= this._last)
630
+ this._children[o.index - this._first].scrollIntoView(o);
631
+ else if (o.index = Math.min(o.index, this._items.length - 1), o.behavior === "smooth") {
632
+ const t = this._layout.getScrollIntoViewCoordinates(o), { behavior: e } = o;
633
+ this._updateScrollIntoViewCoordinates = this._scrollerController.managedScrollTo(Object.assign(t, { behavior: e }), () => this._layout.getScrollIntoViewCoordinates(o), () => this._scrollIntoViewTarget = null), this._scrollIntoViewTarget = o;
634
+ } else
635
+ this._layout.pin = o;
636
+ }
637
+ /**
638
+ * If we are smoothly scrolling to an element and the target element
639
+ * is in the DOM, we update our target coordinates as needed
640
+ */
641
+ _checkScrollIntoViewTarget(o) {
642
+ const { index: t } = this._scrollIntoViewTarget || {};
643
+ t && (o != null && o.has(t)) && this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget));
644
+ }
645
+ /**
646
+ * Emits a rangechange event with the current first, last, firstVisible, and
647
+ * lastVisible.
648
+ */
649
+ _notifyRange() {
650
+ this._hostElement.dispatchEvent(new $({ first: this._first, last: this._last }));
651
+ }
652
+ _notifyVisibility() {
653
+ this._hostElement.dispatchEvent(new R({
654
+ first: this._firstVisible,
655
+ last: this._lastVisible
656
+ }));
657
+ }
658
+ get layoutComplete() {
659
+ return this._layoutCompletePromise || (this._layoutCompletePromise = new Promise((o, t) => {
660
+ this._layoutCompleteResolver = o, this._layoutCompleteRejecter = t;
661
+ })), this._layoutCompletePromise;
662
+ }
663
+ _rejectLayoutCompletePromise(o) {
664
+ this._layoutCompleteRejecter !== null && this._layoutCompleteRejecter(o), this._resetLayoutCompleteState();
665
+ }
666
+ _scheduleLayoutComplete() {
667
+ this._layoutCompletePromise && this._pendingLayoutComplete === null && (this._pendingLayoutComplete = requestAnimationFrame(() => requestAnimationFrame(() => this._resolveLayoutCompletePromise())));
668
+ }
669
+ _resolveLayoutCompletePromise() {
670
+ this._layoutCompleteResolver !== null && this._layoutCompleteResolver(), this._resetLayoutCompleteState();
671
+ }
672
+ _resetLayoutCompleteState() {
673
+ this._layoutCompletePromise = null, this._layoutCompleteResolver = null, this._layoutCompleteRejecter = null, this._pendingLayoutComplete = null;
674
+ }
675
+ /**
676
+ * Render and update the view at the next opportunity with the given
677
+ * hostElement size.
678
+ */
679
+ _hostElementSizeChanged() {
680
+ this._schedule(this._updateLayout);
681
+ }
682
+ // TODO (graynorton): Rethink how this works. Probably child loading is too specific
683
+ // to have dedicated support for; might want some more generic lifecycle hooks for
684
+ // layouts to use. Possibly handle measurement this way, too, or maybe that remains
685
+ // a first-class feature?
686
+ _childLoaded() {
687
+ }
688
+ // This is the callback for the ResizeObserver that watches the
689
+ // virtualizer's children. We land here at the end of every virtualizer
690
+ // update cycle that results in changes to physical items, and we also
691
+ // end up here if one or more children change size independently of
692
+ // the virtualizer update cycle.
693
+ _childrenSizeChanged(o) {
694
+ var t;
695
+ if ((t = this._layout) != null && t.measureChildren) {
696
+ for (const e of o)
697
+ this._toBeMeasured.set(e.target, e.contentRect);
698
+ this._measureChildren();
699
+ }
700
+ this._scheduleLayoutComplete(), this._itemsChanged = !1, this._rangeChanged = !1;
701
+ }
702
+ }
703
+ function So(s) {
704
+ const o = window.getComputedStyle(s);
705
+ return {
706
+ marginTop: A(o.marginTop),
707
+ marginRight: A(o.marginRight),
708
+ marginBottom: A(o.marginBottom),
709
+ marginLeft: A(o.marginLeft)
710
+ };
711
+ }
712
+ function A(s) {
713
+ const o = s ? parseFloat(s) : NaN;
714
+ return Number.isNaN(o) ? 0 : o;
715
+ }
716
+ function N(s) {
717
+ if (s.assignedSlot !== null)
718
+ return s.assignedSlot;
719
+ if (s.parentElement !== null)
720
+ return s.parentElement;
721
+ const o = s.parentNode;
722
+ return o && o.nodeType === Node.DOCUMENT_FRAGMENT_NODE && o.host || null;
723
+ }
724
+ function Oo(s, o = !1) {
725
+ const t = [];
726
+ let e = o ? s : N(s);
727
+ for (; e !== null; )
728
+ t.push(e), e = N(e);
729
+ return t;
730
+ }
731
+ function Io(s, o = !1) {
732
+ let t = !1;
733
+ return Oo(s, o).filter((e) => {
734
+ if (t)
735
+ return !1;
736
+ const i = getComputedStyle(e);
737
+ return t = i.position === "fixed", i.overflow !== "visible";
738
+ });
739
+ }
740
+ /**
741
+ * @license
742
+ * Copyright 2021 Google LLC
743
+ * SPDX-License-Identifier: BSD-3-Clause
744
+ */
745
+ const J = (s) => s, X = (s, o) => g`${o}: ${JSON.stringify(s, null, 2)}`;
746
+ class Ao extends ho {
747
+ constructor(o) {
748
+ if (super(o), this._virtualizer = null, this._first = 0, this._last = -1, this._renderItem = (t, e) => X(t, e + this._first), this._keyFunction = (t, e) => J(t, e + this._first), this._items = [], o.type !== K.CHILD)
749
+ throw new Error("The virtualize directive can only be used in child expressions");
750
+ }
751
+ render(o) {
752
+ o && this._setFunctions(o);
753
+ const t = [];
754
+ if (this._first >= 0 && this._last >= this._first)
755
+ for (let e = this._first; e <= this._last; e++)
756
+ t.push(this._items[e]);
757
+ return Z(t, this._keyFunction, this._renderItem);
758
+ }
759
+ update(o, [t]) {
760
+ this._setFunctions(t);
761
+ const e = this._items !== t.items;
762
+ return this._items = t.items || [], this._virtualizer ? this._updateVirtualizerConfig(o, t) : this._initialize(o, t), e ? H : this.render();
763
+ }
764
+ async _updateVirtualizerConfig(o, t) {
765
+ if (!await this._virtualizer.updateLayoutConfig(t.layout || {})) {
766
+ const i = o.parentNode;
767
+ this._makeVirtualizer(i, t);
768
+ }
769
+ this._virtualizer.items = this._items;
770
+ }
771
+ _setFunctions(o) {
772
+ const { renderItem: t, keyFunction: e } = o;
773
+ t && (this._renderItem = (i, l) => t(i, l + this._first)), e && (this._keyFunction = (i, l) => e(i, l + this._first));
774
+ }
775
+ _makeVirtualizer(o, t) {
776
+ this._virtualizer && this._virtualizer.disconnected();
777
+ const { layout: e, scroller: i, items: l } = t;
778
+ this._virtualizer = new Eo({ hostElement: o, layout: e, scroller: i }), this._virtualizer.items = l, this._virtualizer.connected();
779
+ }
780
+ _initialize(o, t) {
781
+ const e = o.parentNode;
782
+ e && e.nodeType === 1 && (e.addEventListener("rangeChanged", (i) => {
783
+ this._first = i.first, this._last = i.last, this.setValue(this.render());
784
+ }), this._makeVirtualizer(e, t));
785
+ }
786
+ disconnected() {
787
+ var o;
788
+ (o = this._virtualizer) == null || o.disconnected();
789
+ }
790
+ reconnected() {
791
+ var o;
792
+ (o = this._virtualizer) == null || o.connected();
793
+ }
794
+ }
795
+ const Lo = q(Ao);
796
+ /**
797
+ * @license
798
+ * Copyright 2021 Google LLC
799
+ * SPDX-License-Identifier: BSD-3-Clause
800
+ */
801
+ class w extends oo {
802
+ constructor() {
803
+ super(...arguments), this.items = [], this.renderItem = X, this.keyFunction = J, this.layout = {}, this.scroller = !1;
804
+ }
805
+ createRenderRoot() {
806
+ return this;
807
+ }
808
+ render() {
809
+ const { items: o, renderItem: t, keyFunction: e, layout: i, scroller: l } = this;
810
+ return g`${Lo({
811
+ items: o,
812
+ renderItem: t,
813
+ keyFunction: e,
814
+ layout: i,
815
+ scroller: l
816
+ })}`;
817
+ }
818
+ element(o) {
819
+ var t;
820
+ return (t = this[B]) == null ? void 0 : t.element(o);
821
+ }
822
+ get layoutComplete() {
823
+ var o;
824
+ return (o = this[B]) == null ? void 0 : o.layoutComplete;
825
+ }
826
+ /**
827
+ * This scrollToIndex() shim is here to provide backwards compatibility with other 0.x versions of
828
+ * lit-virtualizer. It is deprecated and will likely be removed in the 1.0.0 release.
829
+ */
830
+ scrollToIndex(o, t = "start") {
831
+ var e;
832
+ (e = this.element(o)) == null || e.scrollIntoView({ block: t });
833
+ }
834
+ }
835
+ S([
836
+ v({ attribute: !1 })
837
+ ], w.prototype, "items", void 0);
838
+ S([
839
+ v()
840
+ ], w.prototype, "renderItem", void 0);
841
+ S([
842
+ v()
843
+ ], w.prototype, "keyFunction", void 0);
844
+ S([
845
+ v({ attribute: !1 })
846
+ ], w.prototype, "layout", void 0);
847
+ S([
848
+ v({ reflect: !0, type: Boolean })
849
+ ], w.prototype, "scroller", void 0);
850
+ /**
851
+ * @license
852
+ * Copyright 2021 Google LLC
853
+ * SPDX-License-Identifier: BSD-3-Clause
854
+ */
855
+ customElements.define("lit-virtualizer", w);
856
+ const To = ":host{--options-divider-thickness: var( --divider-thickness-medium, var(--luzmo-border-width) );inline-size:auto;margin-block:var(--luzmo-options-section-divider-margin-block, max(0px, (var(--option-section-divider-height) - var(--options-divider-thickness)) / 2));margin-inline:var(--luzmo-option-label-inline-edge-to-content, var(--option-label-inline-edge-to-content));overflow:visible}:host{display:block;flex-shrink:0}";
857
+ class Vo extends G(W, {
858
+ validSizes: ["s", "m", "l"]
859
+ }) {
860
+ static get styles() {
861
+ return [T(vo), T(To)];
862
+ }
863
+ firstUpdated(o) {
864
+ super.firstUpdated(o), this.setAttribute("role", "separator");
865
+ }
866
+ }
867
+ const $o = ":host{--option-top-to-action: var(--luzmo-spacing-1);--option-top-to-checkbox: var(--luzmo-spacing-1);--option-label-line-height: var(--luzmo-line-height);--option-label-line-height-cjk: 1.5;--option-label-to-description-spacing: 1px;--option-focus-indicator-width: var(--luzmo-indicator-width);--option-focus-indicator-color: var(--luzmo-indicator-color);--option-label-to-value-area-min-spacing: var(--luzmo-spacing-3);--option-label-content-color-default: var(--luzmo-font-color);--option-label-content-color-hover: var(--luzmo-font-color-hover);--option-label-content-color-down: var(--luzmo-font-color-down);--option-label-content-color-focus: var(--luzmo-font-color-focus);--option-label-icon-color-default: var(--luzmo-font-color);--option-label-icon-color-hover: var(--luzmo-font-color-hover);--option-label-icon-color-down: var(--luzmo-font-color-down);--option-label-icon-color-focus: var(--luzmo-font-color-focus);--option-highlight-selected-label-background-color: var(--luzmo-primary);--option-highlight-selected-label-content-color: var( --luzmo-primary-inverse-color );--option-highlight-selected-label-content-color-hover: var( --luzmo-primary-inverse-color );--option-highlight-selected-label-content-color-down: var( --luzmo-primary-inverse-color );--option-highlight-selected-label-content-color-focus: var( --luzmo-primary-inverse-color );--option-label-content-color-disabled: var(--luzmo-font-color-disabled);--option-label-icon-color-disabled: var(--luzmo-font-color-disabled);--option-description-line-height: var(--luzmo-line-height);--option-description-line-height-cjk: 1.5;--option-description-color-default: var(--luzmo-font-color);--option-description-color-hover: var(--luzmo-font-color-hover);--option-description-color-down: var(--luzmo-font-color-down);--option-description-color-focus: var(--luzmo-font-color-focus);--option-description-color-disabled: var(--luzmo-disabled-color);--options-section-header-line-height: var(--luzmo-line-height);--options-section-header-line-height-cjk: 1.5;--options-section-header-font-weight: bold;--options-section-header-color: var(--luzmo-font-color-hard);--options-collapsible-icon-color: var(--luzmo-font-color-hard);--options-checkmark-icon-color-default: var(--luzmo-font-color);--options-checkmark-icon-color-hover: var(--luzmo-font-color-hover);--options-checkmark-icon-color-down: var(--luzmo-font-color-down);--options-checkmark-icon-color-focus: var(--luzmo-font-color-focus);--options-checkbox-icon-color-default: var(--luzmo-font-color);--options-checkbox-icon-color-hover: var(--luzmo-font-color-hover);--options-checkbox-icon-color-down: var(--luzmo-font-color-down);--options-checkbox-icon-color-focus: var(--luzmo-font-color-focus);--options-drillin-icon-color-default: var(--luzmo-font-color);--options-drillin-icon-color-hover: var(--luzmo-font-color-hover);--options-drillin-icon-color-down: var(--luzmo-font-color-down);--options-drillin-icon-color-focus: var(--luzmo-font-color-focus);--option-value-color-default: var(--luzmo-font-color);--option-value-color-hover: var(--luzmo-font-color-hover);--option-value-color-down: var(--luzmo-font-color-down);--option-value-color-focus: var(--luzmo-font-color-focus);--option-collapsible-no-icon-suboption-padding-x-start: 28px;--option-background-color-selected: var(--luzmo-background-color);--option-background-color-default: var(--luzmo-background-color);--option-background-color-hover: var(--luzmo-background-color-hover);--option-background-color-down: var(--luzmo-background-color-down);--option-background-color-key-focus: var(--luzmo-background-color-focus)}:host{--option-min-height: var(--luzmo-component-height);--option-icon-container-height: 18px;--pending-height: var(--option-min-height);--option-icon-height: var(--luzmo-font-size-l);--option-icon-width: var(--luzmo-font-size-l);--option-label-font-size: var(--luzmo-font-size-l);--option-label-text-to-visual: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--option-label-text-to-control: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--option-label-inline-edge-to-content: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--pending-inline-edge-to-content: var(--option-label-inline-edge-to-content);--option-top-edge-to-text: calc( var(--luzmo-spacing-2) + var(--luzmo-spacing-1) );--option-bottom-edge-to-text: var(--luzmo-spacing-3);--option-description-font-size: var(--luzmo-font-size-xs);--options-section-header-font-size: var(--luzmo-font-size);--options-section-header-min-width: var(--luzmo-component-height);--option-selectable-edge-to-text-not-selected: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--option-checkmark-size: var(--luzmo-font-size-xs);--option-checkbox-size: var(--luzmo-font-size-xs);--option-top-to-checkmark: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--option-top-to-checkbox: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) )}:host([size=s]){--option-min-height: var(--luzmo-component-height-s);--option-icon-container-height: 17px;--option-icon-height: var(--luzmo-font-size);--option-icon-width: var(--luzmo-font-size);--option-label-font-size: var(--luzmo-font-size-s);--option-label-text-to-visual: var(--luzmo-spacing-3);--option-label-text-to-control: var(--luzmo-spacing-3);--option-label-inline-edge-to-content: var(--luzmo-spacing-3);--option-top-edge-to-text: calc( var(--luzmo-spacing-1) + var(--luzmo-spacing-2) );--option-bottom-edge-to-text: var(--luzmo-spacing-2);--option-description-font-size: var(--luzmo-font-size-xs);--options-section-header-font-size: var(--luzmo-font-size-s);--options-section-header-min-width: var(--luzmo-component-height-s);--option-selectable-edge-to-text-not-selected: var(--luzmo-spacing-3);--option-checkmark-size: var(--luzmo-font-size-xs);--option-checkbox-size: var(--luzmo-font-size-xs);--option-top-to-checkmark: var(--luzmo-spacing-3);--option-top-to-checkbox: var(--luzmo-spacing-3)}:host([size=l]){--option-min-height: var(--luzmo-component-height-l);--option-icon-container-height: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--option-icon-height: var(--luzmo-font-size-l);--option-icon-width: var(--luzmo-font-size-l);--option-label-font-size: var(--luzmo-font-size-l);--option-label-text-to-visual: var(--luzmo-spacing-4);--option-label-text-to-control: var(--luzmo-spacing-4);--option-label-inline-edge-to-content: var(--luzmo-spacing-4);--option-top-edge-to-text: var(--luzmo-spacing-4);--option-bottom-edge-to-text: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--option-description-font-size: var(--luzmo-font-size-s);--options-section-header-font-size: var(--luzmo-font-size-l);--options-section-header-min-width: var(--luzmo-component-height-l);--option-selectable-edge-to-text-not-selected: var(--luzmo-spacing-4);--option-checkmark-size: var(--luzmo-font-size-s);--option-checkbox-size: var(--luzmo-font-size-s);--option-top-to-checkmark: var(--luzmo-spacing-4);--option-top-to-checkbox: var(--luzmo-spacing-4)}:host([size=xl]){--option-min-height: var(--luzmo-component-height-xl);--option-icon-container-height: 26px;--option-icon-height: var(--luzmo-font-size-xl);--option-icon-width: var(--luzmo-font-size-xl);--option-label-font-size: var(--luzmo-font-size-xl);--option-label-text-to-visual: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--option-label-text-to-control: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--option-label-inline-edge-to-content: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--option-top-edge-to-text: var(--luzmo-spacing-4);--option-bottom-edge-to-text: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--option-description-font-size: var(--luzmo-font-size);--options-section-header-font-size: var(--luzmo-font-size-xl);--options-section-header-min-width: var(--luzmo-component-height-xl);--option-selectable-edge-to-text-not-selected: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--option-checkmark-size: var(--luzmo-font-size);--option-checkbox-size: var(--luzmo-font-size);--option-top-to-checkmark: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--option-top-to-checkbox: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) )}@media (forced-colors: active){:host{--highcontrast-option-background-color-default: ButtonFace;--highcontrast-option-color-default: ButtonText;--highcontrast-option-background-color-focus: Highlight;--highcontrast-option-color-focus: HighlightText;--highcontrast-options-checkmark-icon-color-default: Highlight;--highcontrast-options-checkbox-icon-color-default: Highlight;--highcontrast-option-color-disabled: GrayText;--highcontrast-option-focus-indicator-color: Highlight;--highcontrast-option-selected-background-color: Highlight;--highcontrast-option-selected-color: HighlightText}@supports (color: SelectedItem){:host{--highcontrast-option-selected-background-color: SelectedItem;--highcontrast-option-selected-color: SelectedItemText}}}:host{inline-size:auto;inline-size:var(--luzmo-options-inline-size, auto);box-sizing:border-box;margin:0;padding:0;list-style-type:none;display:inline-block;overflow:auto}:host:lang(ja),:host:lang(ko),:host:lang(zh){--option-label-line-height: var( --luzmo-option-label-line-height-cjk, var(--option-label-line-height-cjk) );--option-description-line-height: var( --luzmo-option-description-line-height-cjk, var(--option-description-line-height-cjk) );--options-section-header-line-height: var( --luzmo-options-section-header-line-height-cjk, var(--options-section-header-line-height-cjk) )}luzmo-option{width:100%}#pending{display:flex;align-items:center;height:var(--pending-height);padding-inline:var(--pending-inline-edge-to-content)}:host{display:inline-flex;flex-direction:column;width:100%}:host(:focus){outline:none}::slotted(*){flex-shrink:0}";
868
+ var Ro = Object.defineProperty, y = (s, o, t, e) => {
869
+ for (var i = void 0, l = s.length - 1, r; l >= 0; l--)
870
+ (r = s[l]) && (i = r(o, t, i) || i);
871
+ return i && Ro(o, t, i), i;
872
+ };
873
+ const Fo = 25;
874
+ function Mo(s, o) {
875
+ return !!o && (s === o || s.contains(o));
876
+ }
877
+ class z extends G(W, {
878
+ noDefaultSize: !0
879
+ }) {
880
+ constructor() {
881
+ super(), this.label = "", this.variant = "highlight", this.selects = "single", this.emphasized = !1, this.pending = !1, this.options = [], this.value = [], this.focusedOptionIndex = 0, this._selectedOptions = [], this._firstVisibleIndex = 0, this.addEventListener("focusin", this.handleFocusin), this.addEventListener("blur", this.handleBlur);
882
+ }
883
+ static get styles() {
884
+ return [T($o)];
885
+ }
886
+ get _virtualizeActive() {
887
+ return this.options.length > Fo;
888
+ }
889
+ firstUpdated(o) {
890
+ super.firstUpdated(o), this.hasAttribute("tabindex") || (this.tabIndex = 0);
891
+ const t = [
892
+ new Promise((e) => requestAnimationFrame(() => e(!0)))
893
+ ];
894
+ [...this.children].forEach((e) => {
895
+ e.localName === "luzmo-option" && t.push(e.updateComplete);
896
+ }), this.optionElementsUpdated = Promise.all(t);
897
+ }
898
+ willUpdate(o) {
899
+ var e;
900
+ o.has("selects") && this.selects === "single" && ((e = this.value) == null ? void 0 : e.length) > 1 && (this.value = this.value.slice(0, 1));
901
+ }
902
+ updated(o) {
903
+ super.updated(o), o.has("label") && (this.label || o.get("label") !== void 0) && (this.label ? this.setAttribute("aria-label", this.label) : this.removeAttribute("aria-label"));
904
+ }
905
+ async getUpdateComplete() {
906
+ const o = await super.getUpdateComplete();
907
+ return await this.optionElementsUpdated, o;
908
+ }
909
+ focus({ preventScroll: o } = {}) {
910
+ super.focus({ preventScroll: o }), this.focusOptionByOffset(0);
911
+ }
912
+ _removeFocusedPropertyOnOptions() {
913
+ requestAnimationFrame(() => {
914
+ this.visibleOptionElements.forEach((o) => {
915
+ o.focused = !1;
916
+ });
917
+ });
918
+ }
919
+ scrollToTop() {
920
+ this.scrollTop = 0;
921
+ }
922
+ handleFocusin() {
923
+ this.startListeningToKeyboard();
924
+ }
925
+ // when the focus is lost in the options menu, we need to remove the focus from the item, stop listening to keyboard events and clean up the aria-activedescendant
926
+ handleBlur(o) {
927
+ Mo(this, o.relatedTarget) || (this.stopListeningToKeyboard(), this._removeFocusedPropertyOnOptions(), this.removeAttribute("aria-activedescendant"));
928
+ }
929
+ startListeningToKeyboard() {
930
+ this.addEventListener("keydown", this.handleKeydown);
931
+ }
932
+ stopListeningToKeyboard() {
933
+ this.removeEventListener("keydown", this.handleKeydown);
934
+ }
935
+ handleKeydown(o) {
936
+ var l;
937
+ if (o.defaultPrevented)
938
+ return;
939
+ const t = this.focusedOptionIndex, e = [...this.visibleOptionElements].find(
940
+ (r) => {
941
+ var n, a, c, f;
942
+ return ((n = r.value) == null ? void 0 : n.toString()) === ((f = (c = (a = this.options) == null ? void 0 : a[t]) == null ? void 0 : c.value) == null ? void 0 : f.toString());
943
+ }
944
+ ), { key: i } = o;
945
+ if (i === "Tab") {
946
+ this.prepareToCleanUp();
947
+ return;
948
+ }
949
+ if (i === " " || i === "Enter") {
950
+ o.preventDefault(), e && this.toggleOption(o, (l = this.options) == null ? void 0 : l[t]);
951
+ return;
952
+ }
953
+ if (i === "ArrowDown" || i === "ArrowUp") {
954
+ o.preventDefault(), this.navigateWithinOptions(o, e);
955
+ return;
956
+ }
957
+ }
958
+ navigateWithinOptions(o, t) {
959
+ const { key: e } = o, i = e === "ArrowDown" ? 1 : -1;
960
+ o.preventDefault(), o.stopPropagation();
961
+ const l = this.focusOptionByOffset(
962
+ i,
963
+ t,
964
+ !0
965
+ );
966
+ l !== t && (this._virtualizeActive || l == null || l.scrollIntoView({ block: "nearest" }));
967
+ }
968
+ focusOptionByOffset(o, t, e) {
969
+ var u;
970
+ const i = o || 1;
971
+ t && (t.focused = !1);
972
+ const l = this.focusedOptionIndex;
973
+ this.focusedOptionIndex = this.options.length > 0 ? (this.options.length + this.focusedOptionIndex + o) % this.options.length : 0;
974
+ let r = this.options[this.focusedOptionIndex], n = this.options.length;
975
+ for (; (r != null && r.disabled || r != null && r.divider) && n; )
976
+ n -= 1, this.focusedOptionIndex = (this.options.length + this.focusedOptionIndex + i) % this.options.length, r = this.options[this.focusedOptionIndex];
977
+ const a = l < this.focusedOptionIndex && o === -1, c = l > this.focusedOptionIndex && o === 1;
978
+ (a || c) && (this.focusedOptionIndex = l, this.dispatchEvent(
979
+ new Event(`luzmo-exceeded-${a ? "top" : "bottom"}`, {
980
+ bubbles: !0,
981
+ composed: !0,
982
+ cancelable: !0
983
+ })
984
+ ));
985
+ let f;
986
+ return e && this._virtualizeActive && (f = [...this.visibleOptionElements].find(
987
+ (d) => {
988
+ var h, p, m;
989
+ return ((h = d.value) == null ? void 0 : h.toString()) === ((m = (p = this.options[this.focusedOptionIndex]) == null ? void 0 : p.value) == null ? void 0 : m.toString());
990
+ }
991
+ ), f || (this.focusedOptionIndex = this._firstVisibleIndex)), this._virtualizeActive && e && ((u = this.virtualizer.element(this.focusedOptionIndex)) == null || u.scrollIntoView({
992
+ behavior: "smooth",
993
+ block: "nearest"
994
+ })), f = f ?? [...this.visibleOptionElements].find(
995
+ (d) => {
996
+ var h, p, m;
997
+ return ((h = d.value) == null ? void 0 : h.toString()) === ((m = (p = this.options[this.focusedOptionIndex]) == null ? void 0 : p.value) == null ? void 0 : m.toString());
998
+ }
999
+ ), r != null && r.disabled || this.setFocusedAndActiveDescendant(f), f;
1000
+ }
1001
+ updateSelectedItemIndex() {
1002
+ this.focusedOptionIndex = this._virtualizeActive ? this._firstVisibleIndex : 0;
1003
+ }
1004
+ setSelectedOptionsFromValue() {
1005
+ this._selectedOptions = this.options.filter(
1006
+ (o) => {
1007
+ var t;
1008
+ return typeof (o == null ? void 0 : o.value) == "string" && ((t = this.value) == null ? void 0 : t.includes(o == null ? void 0 : o.value));
1009
+ }
1010
+ );
1011
+ }
1012
+ visibilityChanged(o) {
1013
+ this._firstVisibleIndex = (o == null ? void 0 : o.first) ?? 0;
1014
+ }
1015
+ rangeChange(o) {
1016
+ o.stopPropagation(), o.preventDefault(), (o == null ? void 0 : o.first) !== -1 && (o == null ? void 0 : o.last) !== -1 && this.dispatchEvent(
1017
+ new CustomEvent("luzmo-scrolled", {
1018
+ bubbles: !0,
1019
+ composed: !0,
1020
+ cancelable: !0,
1021
+ detail: {
1022
+ first: o.first,
1023
+ last: o.last
1024
+ }
1025
+ })
1026
+ );
1027
+ }
1028
+ async toggleOption(o, t) {
1029
+ const e = o instanceof KeyboardEvent, i = this.options.findIndex(
1030
+ (r) => (r == null ? void 0 : r.value) === (t == null ? void 0 : t.value)
1031
+ );
1032
+ this.focusedOptionIndex = i, this.visibleOptionElements.forEach((r) => {
1033
+ var n, a;
1034
+ if (e) {
1035
+ const c = ((n = r.value) == null ? void 0 : n.toString()) === ((a = t == null ? void 0 : t.value) == null ? void 0 : a.toString());
1036
+ r.focused = c, c && this.setFocusedAndActiveDescendant(r);
1037
+ } else
1038
+ r.focused = !1;
1039
+ });
1040
+ const l = (this.value ?? []).includes(t == null ? void 0 : t.value);
1041
+ this.selects === "single" ? (this.value = [t == null ? void 0 : t.value], this._selectedOptions = [t]) : (this.value = l ? this.value.filter((r) => r !== (t == null ? void 0 : t.value)) : [...this.value ?? [], t == null ? void 0 : t.value], this._selectedOptions = l ? this._selectedOptions.filter(
1042
+ (r) => r.value !== t.value
1043
+ ) : [...this._selectedOptions, t]), await this.updateComplete, this.dispatchEvent(
1044
+ new CustomEvent("change", {
1045
+ bubbles: !0,
1046
+ cancelable: !0,
1047
+ composed: !0,
1048
+ detail: {
1049
+ value: this.value ?? []
1050
+ }
1051
+ })
1052
+ ), this.prepareToCleanUp();
1053
+ }
1054
+ handleOptionClick(o, t) {
1055
+ this.toggleOption(t, o);
1056
+ }
1057
+ render() {
1058
+ const o = (n) => g`<luzmo-icon
1059
+ slot="icon"
1060
+ .icon=${n}
1061
+ .size=${this.size}
1062
+ ></luzmo-icon>`, t = (n) => g`<span slot="description">${n}</span>`, e = (n) => g`<luzmo-icon
1063
+ slot="icon"
1064
+ .src=${n}
1065
+ .size=${this.size}
1066
+ ></luzmo-icon>`, i = (n) => {
1067
+ var m;
1068
+ const a = (n == null ? void 0 : n.value) ?? (n == null ? void 0 : n.label), c = (n == null ? void 0 : n.label) ?? (n == null ? void 0 : n.value), f = n == null ? void 0 : n.description, u = n == null ? void 0 : n.icon, d = n == null ? void 0 : n.imgSrc, h = n == null ? void 0 : n.divider, p = typeof n == "string" || n == null ? void 0 : n.disabled;
1069
+ return h ? g`<luzmo-options-divider></luzmo-options-divider>` : g`<luzmo-option
1070
+ .value=${a}
1071
+ .size=${this.size}
1072
+ .variant=${this.variant}
1073
+ ?emphasized=${this.emphasized}
1074
+ ?no-wrap=${this.noWrap}
1075
+ ?disabled=${p}
1076
+ .selected=${Array.isArray(this.value) ? (m = this.value) == null ? void 0 : m.includes(a) : !1}
1077
+ .role=${this.selects === "single" ? "option" : "optioncheckbox"}
1078
+ @click=${this.handleOptionClick.bind(this, n)}
1079
+ >
1080
+ ${u ? o(u) : d ? e(d) : L}
1081
+ ${c} ${f ? t(f) : L}
1082
+ </luzmo-option>`;
1083
+ }, l = this._virtualizeActive ? g`<lit-virtualizer
1084
+ .items=${this.options}
1085
+ .renderItem=${i}
1086
+ @rangeChanged=${this.rangeChange}
1087
+ @visibilityChanged=${this.visibilityChanged}
1088
+ ></lit-virtualizer>` : Z(this.options, i), r = this.pending ? g`<div id="pending">
1089
+ <luzmo-progress-circle
1090
+ indeterminate
1091
+ .size=${this.size}
1092
+ ></luzmo-progress-circle>
1093
+ </div>` : L;
1094
+ return g`${l} ${r}`;
1095
+ }
1096
+ connectedCallback() {
1097
+ super.connectedCallback(), this.setAttribute("role", "listbox"), this.updateComplete.then(() => this.updateItemFocus());
1098
+ }
1099
+ disconnectedCallback() {
1100
+ super.disconnectedCallback();
1101
+ }
1102
+ prepareToCleanUp() {
1103
+ document.addEventListener(
1104
+ "focusout",
1105
+ () => {
1106
+ requestAnimationFrame(() => {
1107
+ this.updateSelectedItemIndex();
1108
+ });
1109
+ },
1110
+ { once: !0 }
1111
+ );
1112
+ }
1113
+ updateItemFocus() {
1114
+ if (this.visibleOptionElements.length === 0)
1115
+ return;
1116
+ const o = this.focusedOptionIndex, t = [...this.visibleOptionElements].find(
1117
+ (e) => {
1118
+ var i, l, r, n;
1119
+ return ((i = e.value) == null ? void 0 : i.toString()) === ((n = (r = (l = this.options) == null ? void 0 : l[o]) == null ? void 0 : r.value) == null ? void 0 : n.toString());
1120
+ }
1121
+ );
1122
+ this.setFocusedAndActiveDescendant(t);
1123
+ }
1124
+ setFocusedAndActiveDescendant(o) {
1125
+ var e, i;
1126
+ if (!o)
1127
+ return;
1128
+ const t = this.hasVisibleFocusInTree() || !!((e = this.visibleOptionElements) != null && e.some && ((i = this.visibleOptionElements) != null && i.some(
1129
+ (l) => l.hasVisibleFocusInTree()
1130
+ )));
1131
+ o.focused = t, t && this.setAttribute("aria-activedescendant", o.id);
1132
+ }
1133
+ }
1134
+ y([
1135
+ v({ type: String, reflect: !0 })
1136
+ ], z.prototype, "label");
1137
+ y([
1138
+ v({ type: String, reflect: !0 })
1139
+ ], z.prototype, "variant");
1140
+ y([
1141
+ v({ type: String, reflect: !0 })
1142
+ ], z.prototype, "selects");
1143
+ y([
1144
+ v({ type: Boolean, reflect: !0 })
1145
+ ], z.prototype, "emphasized");
1146
+ y([
1147
+ v({ type: Boolean, reflect: !0 })
1148
+ ], z.prototype, "pending");
1149
+ y([
1150
+ v({ type: Array })
1151
+ ], z.prototype, "options");
1152
+ y([
1153
+ v({ type: Boolean, reflect: !0, attribute: "no-wrap" })
1154
+ ], z.prototype, "noWrap");
1155
+ y([
1156
+ v({ type: Array })
1157
+ ], z.prototype, "value");
1158
+ y([
1159
+ V("lit-virtualizer")
1160
+ ], z.prototype, "virtualizer");
1161
+ y([
1162
+ go("luzmo-option")
1163
+ ], z.prototype, "visibleOptionElements");
1164
+ customElements.get("luzmo-options") || customElements.define("luzmo-options", z);
1165
+ customElements.get("luzmo-options-divider") || customElements.define("luzmo-options-divider", Vo);
1166
+ customElements.get("luzmo-option") || customElements.define("luzmo-option", b);
1167
+ export {
1168
+ b as LuzmoOption,
1169
+ z as LuzmoOptions,
1170
+ Vo as LuzmoOptionsDivider,
1171
+ Fo as VIRTUALIZE_AS_OF_NUM_ITEMS
1172
+ };