@luzmo/lucero 0.0.3 → 0.0.4

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 (179) hide show
  1. package/lib/accordion/index.cjs +43 -0
  2. package/lib/accordion/index.js +182 -0
  3. package/lib/action-bar/index.cjs +39 -0
  4. package/lib/action-bar/index.js +108 -0
  5. package/lib/action-button/index.cjs +24 -0
  6. package/lib/action-button/index.js +162 -0
  7. package/lib/action-group/index.cjs +18 -0
  8. package/lib/action-group/index.js +29 -0
  9. package/lib/action-group-BoIH8s8R.js +259 -0
  10. package/lib/action-group-D4MxBrq8.cjs +20 -0
  11. package/lib/action-menu/index.cjs +56 -0
  12. package/lib/action-menu/index.js +127 -0
  13. package/lib/async-directive-CV2MII86.cjs +22 -0
  14. package/lib/async-directive-FGzMycjH.js +82 -0
  15. package/lib/avatar/index.cjs +24 -0
  16. package/lib/avatar/index.js +82 -0
  17. package/lib/base-BCmA9Wxv.cjs +30 -0
  18. package/lib/base-BjTwmyRF.cjs +22 -0
  19. package/lib/base-D76d76ww.js +26 -0
  20. package/lib/base-nYalvNMy.js +390 -0
  21. package/lib/button/index.cjs +20 -0
  22. package/lib/button/index.js +128 -0
  23. package/lib/button-base-B0iB_JTv.cjs +25 -0
  24. package/lib/button-base-DgtT6sU5.js +143 -0
  25. package/lib/button-group/index.cjs +18 -0
  26. package/lib/button-group/index.js +60 -0
  27. package/lib/checkbox/index.cjs +25 -0
  28. package/lib/checkbox/index.js +97 -0
  29. package/lib/checkbox-mixin-DegQlk5C.js +71 -0
  30. package/lib/checkbox-mixin-H0Hm-VLk.cjs +27 -0
  31. package/lib/clear-button-Ap5H3UyH.js +54 -0
  32. package/lib/clear-button-D0djuaLb.cjs +18 -0
  33. package/lib/close-button-BrfeZvjk.cjs +18 -0
  34. package/lib/close-button-CGISEF33.js +52 -0
  35. package/lib/color-Bg3tYsAQ.js +178 -0
  36. package/lib/color-DphK4hwx.cjs +18 -0
  37. package/lib/color-area/index.cjs +80 -0
  38. package/lib/color-area/index.js +373 -0
  39. package/lib/color-field/index.cjs +23 -0
  40. package/lib/color-field/index.js +81 -0
  41. package/lib/color-handle/index.cjs +24 -0
  42. package/lib/color-handle/index.js +74 -0
  43. package/lib/color-loupe/index.cjs +18 -0
  44. package/lib/color-loupe/index.js +29 -0
  45. package/lib/color-loupe-BICpNqFs.cjs +56 -0
  46. package/lib/color-loupe-DBEApMDT.js +82 -0
  47. package/lib/color-menu/index.cjs +86 -0
  48. package/lib/color-menu/index.js +204 -0
  49. package/lib/color-picker/index.cjs +48 -0
  50. package/lib/color-picker/index.js +142 -0
  51. package/lib/color-slider/index.cjs +57 -0
  52. package/lib/color-slider/index.js +318 -0
  53. package/lib/condition-attribute-with-id-DrQYZzFS.cjs +18 -0
  54. package/lib/condition-attribute-with-id-Dv4lSRbe.js +31 -0
  55. package/lib/dependency-manger-C5HCkMMB.cjs +18 -0
  56. package/lib/dependency-manger-CEXvGQUV.js +54 -0
  57. package/lib/directive-C7oCP5Bh.cjs +22 -0
  58. package/lib/directive-helpers-BLDZnGQv.js +28 -0
  59. package/lib/directive-helpers-C2vOfhFx.cjs +22 -0
  60. package/lib/directive-oAbCiebi.js +44 -0
  61. package/lib/divider/index.cjs +18 -0
  62. package/lib/divider/index.js +62 -0
  63. package/lib/divider.module-CXMNveQc.cjs +18 -0
  64. package/lib/divider.module-DwOuLGU3.js +21 -0
  65. package/lib/element-resolution-BvRLGqIU.cjs +18 -0
  66. package/lib/element-resolution-FCUT-wql.js +91 -0
  67. package/lib/field-group/index.cjs +18 -0
  68. package/lib/field-group/index.js +29 -0
  69. package/lib/field-group-CBWafIUV.js +67 -0
  70. package/lib/field-group-TUFvhJkk.cjs +23 -0
  71. package/lib/field-label/index.cjs +18 -0
  72. package/lib/field-label/index.js +29 -0
  73. package/lib/field-label-BK_tk8vP.js +107 -0
  74. package/lib/field-label-BrJaeORz.cjs +25 -0
  75. package/lib/focus-group-DHeTq18L.js +218 -0
  76. package/lib/focus-group-DnxZUBhQ.cjs +18 -0
  77. package/lib/focus-visible-B0P9aY_G.cjs +18 -0
  78. package/lib/focus-visible-DBlJGoEW.js +74 -0
  79. package/lib/focusable-DbUg-3Vp.js +153 -0
  80. package/lib/focusable-Dv_6CFaY.cjs +18 -0
  81. package/lib/focusable-selectors-B4YgbghQ.js +31 -0
  82. package/lib/focusable-selectors-BgFlyFcY.cjs +18 -0
  83. package/lib/icon/index.cjs +18 -0
  84. package/lib/icon/index.js +89 -0
  85. package/lib/if-defined-CYpcjGCb.js +27 -0
  86. package/lib/if-defined-Cv6xanXh.cjs +22 -0
  87. package/lib/index-C1chwzNp.js +727 -0
  88. package/lib/index-DCKCHDTt.cjs +18 -0
  89. package/lib/index-ovT-qVzf.js +928 -0
  90. package/lib/index-yNcLzjhM.cjs +77 -0
  91. package/lib/index.cjs +18 -0
  92. package/lib/index.js +133 -0
  93. package/lib/infield-button/index.cjs +22 -0
  94. package/lib/infield-button/index.js +65 -0
  95. package/lib/label/index.cjs +18 -0
  96. package/lib/label/index.js +52 -0
  97. package/lib/legend-position/index.cjs +27 -0
  98. package/lib/legend-position/index.js +85 -0
  99. package/lib/like-anchor-K8W0QYwC.cjs +32 -0
  100. package/lib/like-anchor-cDeGGeHh.js +70 -0
  101. package/lib/lit-html-B3ugcwD9.js +248 -0
  102. package/lib/lit-html-p4Oxv2-5.cjs +24 -0
  103. package/lib/manage-help-text-2mSEy-AD.js +92 -0
  104. package/lib/manage-help-text-iOk-zmy8.cjs +30 -0
  105. package/lib/menu/index.cjs +18 -0
  106. package/lib/menu/index.js +32 -0
  107. package/lib/multi-language-field/index.cjs +39 -0
  108. package/lib/multi-language-field/index.js +149 -0
  109. package/lib/mutation-controller-DH7YOCyj.js +52 -0
  110. package/lib/mutation-controller-DkOMCW-c.cjs +22 -0
  111. package/lib/number-field/index.cjs +57 -0
  112. package/lib/number-field/index.js +736 -0
  113. package/lib/observe-slot-text-BmsCNJig.cjs +18 -0
  114. package/lib/observe-slot-text-BoFRF-VI.js +87 -0
  115. package/lib/overlay/index.cjs +73 -0
  116. package/lib/overlay/index.js +325 -0
  117. package/lib/overlay-C7QKFqRc.js +2702 -0
  118. package/lib/overlay-DScraBAi.cjs +47 -0
  119. package/lib/pending-state-D5KTK4_1.js +61 -0
  120. package/lib/pending-state-Dbc2HIM2.cjs +26 -0
  121. package/lib/picker/index.cjs +18 -0
  122. package/lib/picker/index.js +32 -0
  123. package/lib/picker--2OCYWnV.js +657 -0
  124. package/lib/picker-B9W7Haf4.cjs +127 -0
  125. package/lib/platform-CQzYNWKq.cjs +18 -0
  126. package/lib/platform-DQYMG7JI.js +54 -0
  127. package/lib/popover/index.cjs +18 -0
  128. package/lib/popover/index.js +29 -0
  129. package/lib/popover-CVbjhSnx.cjs +30 -0
  130. package/lib/popover-ZRVxogyp.js +68 -0
  131. package/lib/progress-circle/index.cjs +18 -0
  132. package/lib/progress-circle/index.js +29 -0
  133. package/lib/progress-circle-CiJoS8J7.cjs +33 -0
  134. package/lib/progress-circle-DpXiqW6a.js +98 -0
  135. package/lib/query-BL-TJj7K.cjs +22 -0
  136. package/lib/query-D_KR_GUc.js +51 -0
  137. package/lib/query-assigned-elements-DjfhL1cl.js +36 -0
  138. package/lib/query-assigned-elements-DsKsfk7G.cjs +22 -0
  139. package/lib/query-assigned-nodes-BcKWmGzy.cjs +22 -0
  140. package/lib/query-assigned-nodes-C76XVPWY.js +36 -0
  141. package/lib/radio/index.cjs +22 -0
  142. package/lib/radio/index.js +192 -0
  143. package/lib/random-id-ByCz1xaq.js +26 -0
  144. package/lib/random-id-CqvckpWe.cjs +18 -0
  145. package/lib/roving-tabindex-By_fCy_e.cjs +18 -0
  146. package/lib/roving-tabindex-DOg4z6ZU.js +66 -0
  147. package/lib/search/index.cjs +45 -0
  148. package/lib/search/index.js +132 -0
  149. package/lib/sized-mixin-BSYHt8nT.cjs +18 -0
  150. package/lib/sized-mixin-Dl0KoEcV.js +63 -0
  151. package/lib/slider/index.cjs +18 -0
  152. package/lib/slider/index.js +1159 -0
  153. package/lib/slottable-request-event-BfUUt1Mh.cjs +18 -0
  154. package/lib/slottable-request-event-DggLA4Rx.js +31 -0
  155. package/lib/state-BAO-13Bs.js +29 -0
  156. package/lib/state-DReJ3hB6.cjs +22 -0
  157. package/lib/streaming-listener-Bw4jE33f.cjs +18 -0
  158. package/lib/streaming-listener-DLo0wkMc.js +125 -0
  159. package/lib/style-map-BjBGQ_u3.cjs +22 -0
  160. package/lib/style-map-BqvQDFJt.js +53 -0
  161. package/lib/swatch/index.cjs +49 -0
  162. package/lib/swatch/index.js +343 -0
  163. package/lib/switch/index.cjs +22 -0
  164. package/lib/switch/index.js +74 -0
  165. package/lib/tags/index.cjs +32 -0
  166. package/lib/tags/index.js +174 -0
  167. package/lib/text-field/index.cjs +21 -0
  168. package/lib/text-field/index.js +62 -0
  169. package/lib/text-field-C6Aa7XOb.cjs +85 -0
  170. package/lib/text-field-DPk332j9.js +315 -0
  171. package/lib/toast/index.cjs +51 -0
  172. package/lib/toast/index.js +154 -0
  173. package/lib/tooltip/index.cjs +45 -0
  174. package/lib/tooltip/index.js +221 -0
  175. package/lib/unit-input/index.cjs +43 -0
  176. package/lib/unit-input/index.js +184 -0
  177. package/lib/when-CDK1Tt5Y.js +28 -0
  178. package/lib/when-CDZyJPvd.cjs +22 -0
  179. package/package.json +2 -2
@@ -0,0 +1,928 @@
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 { L as x, n as r } from "./base-nYalvNMy.js";
19
+ import { S as y } from "./sized-mixin-Dl0KoEcV.js";
20
+ import { unsafeCSS as g, html as h, nothing as w } from "lit";
21
+ import { e as b } from "./query-D_KR_GUc.js";
22
+ import { s as A } from "./divider.module-DwOuLGU3.js";
23
+ import { r as S } from "./random-id-ByCz1xaq.js";
24
+ import { r as P } from "./state-BAO-13Bs.js";
25
+ import { n as O } from "./query-assigned-nodes-C76XVPWY.js";
26
+ import { s as E } from "./mutation-controller-DH7YOCyj.js";
27
+ import { F as D } from "./focusable-DbUg-3Vp.js";
28
+ import { L as R } from "./like-anchor-cDeGGeHh.js";
29
+ import { O as L } from "./observe-slot-text-BoFRF-VI.js";
30
+ import { D as U } from "./dependency-manger-CEXvGQUV.js";
31
+ import { luzmoIcon as M, luzmoAngleRight as T, luzmoCheck as _ } from "@luzmo/icons";
32
+ import { S as $ } from "./slottable-request-event-DggLA4Rx.js";
33
+ const p = Symbol("slotContentIsPresent");
34
+ function B(a, e) {
35
+ var t, o;
36
+ const i = Array.isArray(e) ? e : [e];
37
+ class n extends (o = a, t = p, o) {
38
+ constructor(...c) {
39
+ super(c), this[t] = /* @__PURE__ */ new Map(), this.managePresenceObservedSlot = () => {
40
+ let z = !1;
41
+ i.forEach((m) => {
42
+ const k = !!this.querySelector(`:scope > ${m}`), f = this[p].get(m) || !1;
43
+ z = z || f !== k, this[p].set(
44
+ m,
45
+ !!this.querySelector(`:scope > ${m}`)
46
+ );
47
+ }), z && this.updateComplete.then(() => {
48
+ this.requestUpdate();
49
+ });
50
+ }, new E(this, {
51
+ config: {
52
+ childList: !0,
53
+ subtree: !0
54
+ },
55
+ callback: () => {
56
+ this.managePresenceObservedSlot();
57
+ }
58
+ }), this.managePresenceObservedSlot();
59
+ }
60
+ /**
61
+ * @private
62
+ */
63
+ get slotContentIsPresent() {
64
+ if (i.length === 1)
65
+ return this[p].get(i[0]) || !1;
66
+ throw new Error(
67
+ "Multiple selectors provided to `ObserveSlotPresence` use `getSlotContentPresence(selector: string)` instead."
68
+ );
69
+ }
70
+ getSlotContentPresence(c) {
71
+ if (this[p].has(c))
72
+ return this[p].get(c) || !1;
73
+ throw new Error(
74
+ `The provided selector \`${c}\` is not being observed.`
75
+ );
76
+ }
77
+ }
78
+ return n;
79
+ }
80
+ const F = ":host{--menu-item-top-to-action: var(--luzmo-spacing-1);--menu-item-top-to-checkbox: var(--luzmo-spacing-1);--menu-item-label-line-height: var(--luzmo-line-height);--menu-item-label-line-height-cjk: 1.5;--menu-item-label-to-description-spacing: 1px;--menu-item-focus-indicator-width: var(--luzmo-indicator-width);--menu-item-focus-indicator-color: var(--luzmo-indicator-color);--menu-item-label-to-value-area-min-spacing: var(--luzmo-spacing-3);--menu-item-label-content-color-default: var(--luzmo-font-color);--menu-item-label-content-color-hover: var(--luzmo-font-color-hover);--menu-item-label-content-color-down: var(--luzmo-font-color-down);--menu-item-label-content-color-focus: var(--luzmo-font-color-focus);--menu-item-highlight-label-background-color: var(--luzmo-primary);--menu-item-highlight-label-content-color: var(--luzmo-font-color);--menu-item-highlight-label-content-color-hover: var( --luzmo-font-color-hover );--menu-item-highlight-label-content-color-down: var(--luzmo-font-color-down);--menu-item-highlight-label-content-color-focus: var( --luzmo-font-color-focus );--menu-item-label-icon-color-default: var(--luzmo-font-color);--menu-item-label-icon-color-hover: var(--luzmo-font-color-hover);--menu-item-label-icon-color-down: var(--luzmo-font-color-down);--menu-item-label-icon-color-focus: var(--luzmo-font-color-focus);--menu-item-label-content-color-disabled: var(--luzmo-font-color-disabled);--menu-item-label-icon-color-disabled: var(--luzmo-font-color-disabled);--menu-item-description-line-height: var(--luzmo-line-height);--menu-item-description-line-height-cjk: 1.5;--menu-item-description-color-default: var(--luzmo-font-color);--menu-item-description-color-hover: var(--luzmo-font-color-hover);--menu-item-description-color-down: var(--luzmo-font-color-down);--menu-item-description-color-focus: var(--luzmo-font-color-focus);--menu-item-description-color-disabled: var(--luzmo-color-disabled);--menu-section-header-line-height: var(--luzmo-line-height);--menu-section-header-line-height-cjk: 1.5;--menu-section-header-font-weight: bold;--menu-section-header-color: var(--luzmo-font-color-hard);--menu-collapsible-icon-color: var(--luzmo-font-color-hard);--menu-checkmark-icon-color-default: var(--luzmo-primary);--menu-checkmark-icon-color-hover: var(--luzmo-primary-hover);--menu-checkmark-icon-color-down: var(--luzmo-primary-down);--menu-checkmark-icon-color-focus: var(--luzmo-primary-focus);--menu-drillin-icon-color-default: var(--luzmo-font-color);--menu-drillin-icon-color-hover: var(--luzmo-font-color-hover);--menu-drillin-icon-color-down: var(--luzmo-font-color-down);--menu-drillin-icon-color-focus: var(--luzmo-font-color-focus);--menu-item-value-color-default: var(--luzmo-font-color);--menu-item-value-color-hover: var(--luzmo-font-color-hover);--menu-item-value-color-down: var(--luzmo-font-color-down);--menu-item-value-color-focus: var(--luzmo-font-color-focus);--menu-checkmark-display-hidden: none;--menu-checkmark-display-shown: block;--menu-checkmark-display: block;--menu-item-collapsible-no-icon-submenu-item-padding-x-start: 28px;--menu-item-background-color-selected: var(--luzmo-background-color);--menu-item-background-color-default: var(--luzmo-background-color);--menu-item-background-color-hover: var(--luzmo-background-color-hover);--menu-item-background-color-down: var(--luzmo-background-color-down);--menu-item-background-color-key-focus: var(--luzmo-background-color-focus)}:host{--menu-item-min-height: var(--luzmo-component-height);--menu-item-icon-height: var(--luzmo-font-size);--menu-item-icon-width: var(--luzmo-font-size);--menu-item-label-font-size: var(--luzmo-font-size);--menu-item-label-text-to-visual: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--menu-item-label-inline-edge-to-content: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--menu-item-top-edge-to-text: var(--luzmo-spacing-1);--menu-item-bottom-edge-to-text: var(--luzmo-spacing-1);--menu-item-text-to-control: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--menu-item-description-font-size: var(--luzmo-font-size-xs);--menu-section-header-font-size: var(--luzmo-font-size);--menu-section-header-min-width: var(--luzmo-component-height);--menu-item-selectable-edge-to-text-not-selected: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--menu-item-checkmark-size: var(--luzmo-font-size-xs);--menu-item-angle-size: var(--luzmo-font-size);--menu-item-top-to-checkmark: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--menu-back-icon-margin: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) )}:host([size=s]){--menu-item-min-height: var(--luzmo-component-height-s);--menu-item-icon-height: var(--luzmo-font-size-s);--menu-item-icon-width: var(--luzmo-font-size-s);--menu-item-label-font-size: var(--luzmo-font-size-s);--menu-item-label-text-to-visual: var(--luzmo-spacing-3);--menu-item-label-inline-edge-to-content: var(--luzmo-spacing-3);--menu-item-top-edge-to-text: var(--luzmo-spacing-1);--menu-item-bottom-edge-to-text: var(--luzmo-spacing-1);--menu-item-text-to-control: var(--luzmo-spacing-2);--menu-item-description-font-size: var(--luzmo-font-size-xs);--menu-section-header-font-size: var(--luzmo-font-size-s);--menu-section-header-min-width: var(--luzmo-component-height-s);--menu-item-selectable-edge-to-text-not-selected: var(--luzmo-spacing-3);--menu-item-checkmark-size: var(--luzmo-font-size-xs);--menu-item-angle-size: var(--luzmo-font-size-s);--menu-item-top-to-checkmark: var(--luzmo-spacing-3);--menu-back-icon-margin: var(--luzmo-spacing-3)}:host([size=l]){--menu-item-min-height: var(--luzmo-component-height-l);--menu-item-icon-height: var(--luzmo-font-size-l);--menu-item-icon-width: var(--luzmo-font-size-l);--menu-item-label-font-size: var(--luzmo-font-size-l);--menu-item-label-text-to-visual: var(--luzmo-spacing-4);--menu-item-label-inline-edge-to-content: var(--luzmo-spacing-4);--menu-item-top-edge-to-text: var(--luzmo-spacing-2);--menu-item-bottom-edge-to-text: var(--luzmo-spacing-2);--menu-item-text-to-control: var(--luzmo-spacing-3);--menu-item-description-font-size: var(--luzmo-font-size-s);--menu-section-header-font-size: var(--luzmo-font-size-l);--menu-section-header-min-width: var(--luzmo-component-height-l);--menu-item-selectable-edge-to-text-not-selected: var(--luzmo-spacing-4);--menu-item-checkmark-size: var(--luzmo-font-size-s);--menu-item-angle-size: var(--luzmo-font-size-l);--menu-item-top-to-checkmark: var(--luzmo-spacing-4);--menu-back-icon-margin: var(--luzmo-spacing-4)}:host([size=xl]){--menu-item-min-height: var(--luzmo-component-height-xl);--menu-item-icon-height: var(--font-size-xl);--menu-item-icon-width: var(--font-size-xl);--menu-item-label-font-size: var(--font-size-xl);--menu-item-label-text-to-visual: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--menu-item-label-inline-edge-to-content: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--menu-item-top-edge-to-text: var(--luzmo-spacing-2);--menu-item-bottom-edge-to-text: var(--luzmo-spacing-2);--menu-item-text-to-control: var(--luzmo-spacing-4);--menu-item-description-font-size: var(--luzmo-font-size);--menu-section-header-font-size: var(--font-size-xl);--menu-section-header-min-width: var(--luzmo-component-height-xl);--menu-item-selectable-edge-to-text-not-selected: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--menu-item-checkmark-size: var(--font-size);--menu-item-angle-size: var(--luzmo-font-size-xl);--menu-item-top-to-checkmark: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--menu-back-icon-margin: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) )}:host([variant=highlight]){--menu-item-highlight-label-content-color: var(--luzmo-primary-inverse-color);--menu-item-highlight-label-content-color-hover: var( --luzmo-primary-inverse-color );--menu-item-highlight-label-content-color-down: var( --luzmo-primary-inverse-color );--menu-item-highlight-label-content-color-focus: var( --luzmo-primary-inverse-color )}@media (forced-colors: active){:host{--highcontrast-menu-item-background-color-default: ButtonFace;--highcontrast-menu-item-color-default: ButtonText;--highcontrast-menu-item-background-color-focus: Highlight;--highcontrast-menu-item-color-focus: HighlightText;--highcontrast-menu-checkmark-icon-color-default: Highlight;--highcontrast-menu-item-color-disabled: GrayText;--highcontrast-menu-item-focus-indicator-color: Highlight;--highcontrast-menu-item-selected-background-color: Highlight;--highcontrast-menu-item-selected-color: HighlightText}@supports (color: SelectedItem){:host{--highcontrast-menu-item-selected-background-color: SelectedItem;--highcontrast-menu-item-selected-color: SelectedItemText}}}:host{inline-size:auto;inline-size:var(--luzmo-menu-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){--menu-item-label-line-height: var( --luzmo-menu-item-label-line-height-cjk, var(--menu-item-label-line-height-cjk) );--menu-item-description-line-height: var( --luzmo-menu-item-description-line-height-cjk, var(--menu-item-description-line-height-cjk) );--menu-section-header-line-height: var( --luzmo-menu-section-header-line-height-cjk, var(--menu-section-header-line-height-cjk) )}:host([selects]) ::slotted(luzmo-menu-item){--menu-checkmark-display: var(--menu-checkmark-display-hidden);padding-inline-start:var(--luzmo-menu-item-selectable-edge-to-text-not-selected, var(--menu-item-selectable-edge-to-text-not-selected))}:host([selects]) ::slotted(luzmo-menu-item[selected]){--menu-checkmark-display: var(--menu-checkmark-display-shown);padding-inline-start:var(--luzmo-menu-item-label-inline-edge-to-content, var(--menu-item-label-inline-edge-to-content))}.luzmo-Menu-backIcon{margin-block:var(--luzmo-menu-back-icon-margin-block, var(--menu-back-icon-margin));margin-inline:var(--luzmo-menu-back-icon-margin-inline, var(--menu-back-icon-margin));fill:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-back-icon-color-default, var(--menu-section-header-color)));color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-back-icon-color-default, var(--menu-section-header-color)))}.luzmo-Menu-back:focus-visible{box-shadow:inset calc(var(--luzmo-menu-item-focus-indicator-width, var(--menu-item-focus-indicator-width)) * 1) 0 0 0 var(--highcontrast-menu-item-focus-indicator-color, var(--luzmo-menu-item-focus-indicator-color, var(--menu-item-focus-indicator-color)));box-shadow:inset calc(var(--luzmo-menu-item-focus-indicator-width, var(--menu-item-focus-indicator-width)) * var(--menu-item-focus-indicator-direction-scalar, 1)) 0 0 0 var(--highcontrast-menu-item-focus-indicator-color, var(--luzmo-menu-item-focus-indicator-color, var(--menu-item-focus-indicator-color)))}.luzmo-Menu-sectionHeading{color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-section-header-color, var(--menu-section-header-color)));font-size:var(--luzmo-menu-section-header-font-size, var(--menu-section-header-font-size));font-weight:var(--luzmo-menu-section-header-font-weight, var(--menu-section-header-font-weight));line-height:var(--luzmo-menu-section-header-line-height, var(--menu-section-header-line-height));min-inline-size:var(--luzmo-menu-section-header-min-width, var(--menu-section-header-min-width));padding-block-start:var(--luzmo-menu-section-header-top-edge-to-text, var(--luzmo-menu-item-top-edge-to-text, var(--menu-item-top-edge-to-text)));padding-block-end:var(--luzmo-menu-section-header-bottom-edge-to-text, var(--luzmo-menu-item-bottom-edge-to-text, var(--menu-item-bottom-edge-to-text)));padding-inline:var(--luzmo-menu-item-label-inline-edge-to-content, var(--menu-item-label-inline-edge-to-content));grid-area:sectionHeadingArea/1/sectionHeadingArea/-1;display:block}.luzmo-Menu-back{padding-inline:0 var(--luzmo-menu-back-padding-inline-end, var(--menu-item-label-inline-edge-to-content));padding-inline:var(--luzmo-menu-back-padding-inline-start, 0) var(--luzmo-menu-back-padding-inline-end, var(--menu-item-label-inline-edge-to-content));padding-block:0;padding-block:var(--luzmo-menu-back-padding-block-start, 0) var(--luzmo-menu-back-padding-block-end, 0);flex-flow:wrap;align-items:center;display:flex}.luzmo-Menu-back .luzmo-Menu-sectionHeading{padding:0}.luzmo-Menu-backButton{cursor:pointer;background:none;border:0;margin:0;padding:0;display:inline-flex}.luzmo-Menu-backButton:focus-visible{outline:var(--luzmo-indicator-width) solid var(--luzmo-indicator-color);outline-offset:calc((var(--luzmo-indicator-width) + 1px) * -1)}.luzmo-Menu-backHeading{color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-back-heading-color, var(--menu-section-header-color)));font-size:var(--luzmo-menu-section-header-font-size, var(--menu-section-header-font-size));font-weight:var(--luzmo-menu-section-header-font-weight, var(--menu-section-header-font-weight));line-height:var(--luzmo-menu-section-header-line-height, var(--menu-section-header-line-height));display:block}:host{display:inline-flex;flex-direction:column;width:100%}:host(:focus){outline:none}::slotted(*){flex-shrink:0}";
81
+ var j = Object.defineProperty, H = Object.getOwnPropertyDescriptor, v = (a, e, t, o) => {
82
+ for (var i = o > 1 ? void 0 : o ? H(e, t) : e, n = a.length - 1, l; n >= 0; n--)
83
+ (l = a[n]) && (i = (o ? l(e, t, i) : l(i)) || i);
84
+ return o && i && j(e, t, i), i;
85
+ };
86
+ function q(a, e) {
87
+ return !!e && (a === e || a.contains(e));
88
+ }
89
+ class d extends y(x, {
90
+ noDefaultSize: !0
91
+ }) {
92
+ constructor() {
93
+ super(), this.label = "", this.ignore = !1, this.value = "", this.valueSeparator = ",", this.selectedItems = [], this.focusedItemIndex = 0, this.focusInItemIndex = 0, this._selected = [], this.cacheUpdated = Promise.resolve(), this.childItemSet = /* @__PURE__ */ new Set(), this.selectedItemsMap = /* @__PURE__ */ new Map(), this._hasUpdatedSelectedItemIndex = !1, this._willUpdateItems = !1, this.pointerUpTarget = null, this.descendentOverlays = /* @__PURE__ */ new Map(), this.handleSubmenuClosed = (e) => {
94
+ e.stopPropagation(), e.composedPath()[0].dispatchEvent(
95
+ new Event("luzmo-menu-submenu-closed", {
96
+ bubbles: !0,
97
+ composed: !0
98
+ })
99
+ );
100
+ }, this.handleSubmenuOpened = (e) => {
101
+ e.stopPropagation(), e.composedPath()[0].dispatchEvent(
102
+ new Event("luzmo-menu-submenu-opened", {
103
+ bubbles: !0,
104
+ composed: !0
105
+ })
106
+ );
107
+ const o = this.childItems[this.focusedItemIndex];
108
+ o && (o.focused = !1);
109
+ const i = e.composedPath().find((l) => this.childItemSet.has(l));
110
+ if (!i)
111
+ return;
112
+ const n = this.childItems.indexOf(
113
+ i
114
+ );
115
+ this.focusedItemIndex = n, this.focusInItemIndex = n;
116
+ }, this.resolveCacheUpdated = () => {
117
+ }, this.addEventListener(
118
+ "luzmo-menu-item-added-or-updated",
119
+ this.onSelectableItemAddedOrUpdated
120
+ ), this.addEventListener(
121
+ "luzmo-menu-item-added-or-updated",
122
+ this.onFocusableItemAddedOrUpdated,
123
+ {
124
+ capture: !0
125
+ }
126
+ ), this.addEventListener("click", this.handleClick), this.addEventListener("pointerup", this.handlePointerup), this.addEventListener("focusin", this.handleFocusin), this.addEventListener("blur", this.handleBlur), this.addEventListener("luzmo-opened", this.handleSubmenuOpened), this.addEventListener("luzmo-closed", this.handleSubmenuClosed);
127
+ }
128
+ static get styles() {
129
+ return [g(F)];
130
+ }
131
+ get isSubmenu() {
132
+ return this.slot === "submenu";
133
+ }
134
+ get selected() {
135
+ return this._selected;
136
+ }
137
+ set selected(e) {
138
+ if (e === this.selected)
139
+ return;
140
+ const t = this.selected;
141
+ this._selected = e, this.selectedItems = [], this.selectedItemsMap.clear(), this.childItems.forEach((o) => {
142
+ this === o.menuData.selectionRoot && (o.selected = this.selected.includes(o.value), o.selected && (this.selectedItems.push(o), this.selectedItemsMap.set(o, !0)));
143
+ }), this.requestUpdate("selected", t);
144
+ }
145
+ get childItems() {
146
+ return this.cachedChildItems || (this.cachedChildItems = this.updateCachedMenuItems()), this.cachedChildItems;
147
+ }
148
+ /**
149
+ * Hide this getter from web-component-analyzer until
150
+ * https://github.com/runem/web-component-analyzer/issues/131
151
+ * has been addressed.
152
+ *
153
+ * @private
154
+ */
155
+ get childRole() {
156
+ if (this.resolvedRole === "listbox")
157
+ return "option";
158
+ switch (this.resolvedSelects) {
159
+ case "single":
160
+ return "menuitemradio";
161
+ case "multiple":
162
+ return "menuitemcheckbox";
163
+ default:
164
+ return "menuitem";
165
+ }
166
+ }
167
+ get ownRole() {
168
+ return "menu";
169
+ }
170
+ focus({ preventScroll: e } = {}) {
171
+ if (this.childItems.every((o) => o.disabled))
172
+ return;
173
+ if (this.childItems.some((o) => o.menuData.focusRoot !== this)) {
174
+ super.focus({ preventScroll: e });
175
+ return;
176
+ }
177
+ this.focusMenuItemByOffset(0), super.focus({ preventScroll: e });
178
+ const t = this.selectedItems[0];
179
+ t && !e && t.scrollIntoView({ block: "nearest" });
180
+ }
181
+ handleFocusin(e) {
182
+ var i;
183
+ if (this.childItems.some((n) => n.menuData.focusRoot !== this))
184
+ return;
185
+ const t = this.getRootNode().activeElement, o = ((i = this.childItems[this.focusedItemIndex]) == null ? void 0 : i.menuData.selectionRoot) || this;
186
+ if ((t !== o || e.target !== this) && (o.focus({ preventScroll: !0 }), t && this.focusedItemIndex === 0)) {
187
+ const n = this.childItems.indexOf(t);
188
+ this.focusMenuItemByOffset(Math.max(n, 0));
189
+ }
190
+ this.startListeningToKeyboard();
191
+ }
192
+ startListeningToKeyboard() {
193
+ this.addEventListener("keydown", this.handleKeydown);
194
+ }
195
+ handleBlur(e) {
196
+ q(this, e.relatedTarget) || (this.stopListeningToKeyboard(), this.childItems.forEach((t) => t.focused = !1), this.removeAttribute("aria-activedescendant"));
197
+ }
198
+ stopListeningToKeyboard() {
199
+ this.removeEventListener("keydown", this.handleKeydown);
200
+ }
201
+ selectOrToggleItem(e) {
202
+ const t = this.resolvedSelects, o = new Map(this.selectedItemsMap), i = [...this.selected], n = [...this.selectedItems], l = this.value, c = this.childItems[this.focusedItemIndex];
203
+ if (c && (c.focused = !1, c.active = !1), this.focusedItemIndex = this.childItems.indexOf(e), this.forwardFocusVisibleToItem(e), t === "multiple") {
204
+ this.selectedItemsMap.has(e) ? this.selectedItemsMap.delete(e) : this.selectedItemsMap.set(e, !0);
205
+ const m = [], k = [];
206
+ this.childItemSet.forEach((f) => {
207
+ f.menuData.selectionRoot === this && this.selectedItemsMap.has(f) && (m.push(f.value), k.push(f));
208
+ }), this._selected = m, this.selectedItems = k, this.value = this.selected.join(this.valueSeparator);
209
+ } else
210
+ this.selectedItemsMap.clear(), this.selectedItemsMap.set(e, !0), this.value = e.value, this._selected = [e.value], this.selectedItems = [e];
211
+ if (!this.dispatchEvent(
212
+ new Event("change", {
213
+ cancelable: !0,
214
+ bubbles: !0,
215
+ composed: !0
216
+ })
217
+ )) {
218
+ this._selected = i, this.selectedItems = n, this.selectedItemsMap = o, this.value = l;
219
+ return;
220
+ }
221
+ if (t === "single") {
222
+ for (const m of o.keys())
223
+ m !== e && (m.selected = !1);
224
+ e.selected = !0;
225
+ } else t === "multiple" && (e.selected = !e.selected);
226
+ }
227
+ handleKeydown(e) {
228
+ if (e.defaultPrevented)
229
+ return;
230
+ const t = this.childItems[this.focusedItemIndex];
231
+ t && (t.focused = !0);
232
+ const { key: o } = e;
233
+ if (e.shiftKey && e.target !== this && this.hasAttribute("tabindex")) {
234
+ this.removeAttribute("tabindex");
235
+ const i = (n) => {
236
+ !n.shiftKey && !this.hasAttribute("tabindex") && (this.tabIndex = 0, document.removeEventListener("keyup", i), this.removeEventListener("focusout", i));
237
+ };
238
+ document.addEventListener("keyup", i), this.addEventListener("focusout", i);
239
+ }
240
+ if (o === "Tab") {
241
+ this.prepareToCleanUp();
242
+ return;
243
+ }
244
+ if (o === " " && (t != null && t.hasSubmenu)) {
245
+ t.openOverlay();
246
+ return;
247
+ }
248
+ if (o === " " || o === "Enter") {
249
+ const i = this.childItems[this.focusedItemIndex];
250
+ i && i.menuData.selectionRoot === e.target && (e.preventDefault(), i.click());
251
+ return;
252
+ }
253
+ if (o === "ArrowDown" || o === "ArrowUp") {
254
+ const i = this.childItems[this.focusedItemIndex];
255
+ i && i.menuData.selectionRoot === e.target && this.navigateWithinMenu(e);
256
+ return;
257
+ }
258
+ this.navigateBetweenRelatedMenus(e);
259
+ }
260
+ focusMenuItemByOffset(e) {
261
+ const t = e || 1, o = this.childItems[this.focusedItemIndex];
262
+ o && (o.focused = !1, o.active = o.open), this.focusedItemIndex = (this.childItems.length + this.focusedItemIndex + e) % this.childItems.length;
263
+ let i = this.childItems[this.focusedItemIndex], n = this.childItems.length;
264
+ for (; i != null && i.disabled && n; )
265
+ n -= 1, this.focusedItemIndex = (this.childItems.length + this.focusedItemIndex + t) % this.childItems.length, i = this.childItems[this.focusedItemIndex];
266
+ return i != null && i.disabled || this.forwardFocusVisibleToItem(i), i;
267
+ }
268
+ updateSelectedItemIndex() {
269
+ let e = 0;
270
+ const t = /* @__PURE__ */ new Map(), o = [], i = [];
271
+ let n = this.childItems.length;
272
+ for (; n; ) {
273
+ n -= 1;
274
+ const l = this.childItems[n];
275
+ l.menuData.selectionRoot === this && ((l.selected || !this._hasUpdatedSelectedItemIndex && this.selected.includes(l.value)) && (e = n, t.set(l, !0), o.unshift(l.value), i.unshift(l)), n !== e && (l.focused = !1));
276
+ }
277
+ i.map((l, c) => {
278
+ c > 0 && (l.focused = !1);
279
+ }), this.selectedItemsMap = t, this._selected = o, this.selectedItems = i, this.value = this.selected.join(this.valueSeparator), this.focusedItemIndex = e, this.focusInItemIndex = e;
280
+ }
281
+ closeDescendentOverlays() {
282
+ this.descendentOverlays.forEach((e) => {
283
+ e.open = !1;
284
+ }), this.descendentOverlays = /* @__PURE__ */ new Map();
285
+ }
286
+ render() {
287
+ return this.renderMenuItemSlot();
288
+ }
289
+ connectedCallback() {
290
+ super.connectedCallback(), !this.hasAttribute("role") && !this.ignore && this.setAttribute("role", this.ownRole), this.updateComplete.then(() => this.updateItemFocus());
291
+ }
292
+ disconnectedCallback() {
293
+ this.cachedChildItems = void 0, this.selectedItems = [], this.selectedItemsMap.clear(), this.childItemSet.clear(), this.descendentOverlays = /* @__PURE__ */ new Map(), super.disconnectedCallback();
294
+ }
295
+ handleDescendentOverlayOpened(e) {
296
+ const t = e.composedPath()[0];
297
+ t.overlayElement && this.descendentOverlays.set(t.overlayElement, t.overlayElement);
298
+ }
299
+ handleDescendentOverlayClosed(e) {
300
+ const t = e.composedPath()[0];
301
+ t.overlayElement && this.descendentOverlays.delete(t.overlayElement);
302
+ }
303
+ navigateWithinMenu(e) {
304
+ const { key: t } = e, o = this.childItems[this.focusedItemIndex], i = t === "ArrowDown" ? 1 : -1, n = this.focusMenuItemByOffset(i);
305
+ n !== o && (e.preventDefault(), e.stopPropagation(), n.scrollIntoView({ block: "nearest" }));
306
+ }
307
+ navigateBetweenRelatedMenus(e) {
308
+ const { key: t } = e;
309
+ e.stopPropagation();
310
+ const o = this.isLTR && t === "ArrowRight" || !this.isLTR && t === "ArrowLeft", i = this.isLTR && t === "ArrowLeft" || !this.isLTR && t === "ArrowRight";
311
+ if (o) {
312
+ const n = this.childItems[this.focusedItemIndex];
313
+ n != null && n.hasSubmenu && n.openOverlay();
314
+ } else i && this.isSubmenu && (this.dispatchEvent(new Event("close", { bubbles: !0 })), this.updateSelectedItemIndex());
315
+ }
316
+ renderMenuItemSlot() {
317
+ return h`
318
+ <slot
319
+ @luzmo-menu-submenu-opened=${this.handleDescendentOverlayOpened}
320
+ @luzmo-menu-submenu-closed=${this.handleDescendentOverlayClosed}
321
+ @slotchange=${this.handleSlotchange}
322
+ ></slot>
323
+ `;
324
+ }
325
+ firstUpdated(e) {
326
+ if (super.firstUpdated(e), !this.hasAttribute("tabindex") && !this.ignore) {
327
+ const o = this.getAttribute("role");
328
+ this.tabIndex = o === "group" ? -1 : 0;
329
+ }
330
+ const t = [
331
+ new Promise((o) => requestAnimationFrame(() => o(!0)))
332
+ ];
333
+ [...this.children].forEach((o) => {
334
+ o.localName === "luzmo-menu-item" && t.push(o.updateComplete);
335
+ }), this.childItemsUpdated = Promise.all(t);
336
+ }
337
+ updated(e) {
338
+ super.updated(e), e.has("selects") && this.hasUpdated && this.selectsChanged(), e.has("label") && (this.label || e.get("label") !== void 0) && (this.label ? this.setAttribute("aria-label", this.label) : this.removeAttribute("aria-label"));
339
+ }
340
+ selectsChanged() {
341
+ const e = [
342
+ new Promise((t) => requestAnimationFrame(() => t(!0)))
343
+ ];
344
+ this.childItemSet.forEach((t) => {
345
+ e.push(t.triggerUpdate());
346
+ }), this.childItemsUpdated = Promise.all(e);
347
+ }
348
+ async getUpdateComplete() {
349
+ const e = await super.getUpdateComplete();
350
+ return await this.childItemsUpdated, await this.cacheUpdated, e;
351
+ }
352
+ updateCachedMenuItems() {
353
+ if (this.cachedChildItems = [], !this.menuSlot)
354
+ return [];
355
+ const e = this.menuSlot.assignedElements({
356
+ flatten: !0
357
+ });
358
+ for (const [t, o] of e.entries()) {
359
+ if (this.childItemSet.has(o)) {
360
+ this.cachedChildItems.push(o);
361
+ continue;
362
+ }
363
+ const n = o.localName === "slot" ? o.assignedElements({
364
+ flatten: !0
365
+ }) : [...o.querySelectorAll(":scope > *")];
366
+ e.splice(
367
+ t,
368
+ 1,
369
+ o,
370
+ ...n
371
+ );
372
+ }
373
+ return this.cachedChildItems;
374
+ }
375
+ /**
376
+ * When a descendant `<luzmo-menu-item>` element is added or updated it will dispatch
377
+ * this event to announce its presence in the DOM. During the CAPTURE phase the first
378
+ * Menu based element that the event encounters will manage the focus state of the
379
+ * dispatching `<luzmo-menu-item>` element.
380
+ * @param event
381
+ */
382
+ onFocusableItemAddedOrUpdated(e) {
383
+ e.menuCascade.set(this, {
384
+ hadFocusRoot: !!e.item.menuData.focusRoot,
385
+ ancestorWithSelects: e.currentAncestorWithSelects
386
+ }), this.selects && (e.currentAncestorWithSelects = this), e.item.menuData.focusRoot = e.item.menuData.focusRoot || this;
387
+ }
388
+ /**
389
+ * When a descendant `<luzmo-menu-item>` element is added or updated it will dispatch
390
+ * this event to announce its presence in the DOM. During the BUBBLE phase the first
391
+ * Menu based element that the event encounters that does not inherit selection will
392
+ * manage the selection state of the dispatching `<luzmo-menu-item>` element.
393
+ * @param event
394
+ */
395
+ onSelectableItemAddedOrUpdated(e) {
396
+ var i, n;
397
+ const t = e.menuCascade.get(this);
398
+ if (!t)
399
+ return;
400
+ if (e.item.menuData.parentMenu = e.item.menuData.parentMenu || this, t.hadFocusRoot && !this.ignore && (this.tabIndex = -1), this.addChildItem(e.item), this.selects === "inherit") {
401
+ this.resolvedSelects = "inherit";
402
+ const l = (i = e.currentAncestorWithSelects) == null ? void 0 : i.ignore;
403
+ this.resolvedRole = l ? "none" : ((n = e.currentAncestorWithSelects) == null ? void 0 : n.getAttribute("role")) || this.getAttribute("role") || void 0;
404
+ } else this.selects ? (this.resolvedRole = this.ignore ? "none" : this.getAttribute("role") || void 0, this.resolvedSelects = this.selects) : (this.resolvedRole = this.ignore ? "none" : this.getAttribute("role") || void 0, this.resolvedSelects = this.resolvedRole === "none" ? "ignore" : "none");
405
+ const o = this.resolvedSelects === "single" || this.resolvedSelects === "multiple";
406
+ e.item.menuData.cleanupSteps.push(
407
+ (l) => this.removeChildItem(l)
408
+ ), (o || !this.selects && this.resolvedSelects !== "ignore") && !e.item.menuData.selectionRoot && (e.item.setRole(this.childRole), e.item.menuData.selectionRoot = e.item.menuData.selectionRoot || this, e.item.selected && (this.selectedItemsMap.set(e.item, !0), this.selectedItems = [...this.selectedItems, e.item], this._selected = [...this.selected, e.item.value], this.value = this.selected.join(this.valueSeparator)));
409
+ }
410
+ addChildItem(e) {
411
+ this.childItemSet.add(e), this.handleItemsChanged();
412
+ }
413
+ async removeChildItem(e) {
414
+ this.childItemSet.delete(e), this.cachedChildItems = void 0, e.focused && (this.handleItemsChanged(), await this.updateComplete, this.focus());
415
+ }
416
+ handleClick(e) {
417
+ if (this.pointerUpTarget === e.target) {
418
+ this.pointerUpTarget = null;
419
+ return;
420
+ }
421
+ this.handlePointerBasedSelection(e);
422
+ }
423
+ handlePointerup(e) {
424
+ this.pointerUpTarget = e.target, this.handlePointerBasedSelection(e);
425
+ }
426
+ handlePointerBasedSelection(e) {
427
+ var i, n;
428
+ if (e instanceof MouseEvent && e.button !== 0)
429
+ return;
430
+ const o = e.composedPath().find((l) => l instanceof Element ? l.getAttribute("role") === this.childRole : !1);
431
+ if (e.defaultPrevented) {
432
+ const l = this.childItems.indexOf(o);
433
+ ((i = o == null ? void 0 : o.menuData) == null ? void 0 : i.focusRoot) === this && l !== -1 && (this.focusedItemIndex = l);
434
+ return;
435
+ }
436
+ if (o != null && o.href && o.href.length > 0) {
437
+ this.dispatchEvent(
438
+ new Event("change", {
439
+ bubbles: !0,
440
+ composed: !0
441
+ })
442
+ );
443
+ return;
444
+ } else if (((n = o == null ? void 0 : o.menuData) == null ? void 0 : n.selectionRoot) === this && this.childItems.length > 0) {
445
+ if (e.preventDefault(), o.hasSubmenu || o.open)
446
+ return;
447
+ this.selectOrToggleItem(o);
448
+ } else
449
+ return;
450
+ this.prepareToCleanUp();
451
+ }
452
+ prepareToCleanUp() {
453
+ document.addEventListener(
454
+ "focusout",
455
+ () => {
456
+ requestAnimationFrame(() => {
457
+ const e = this.childItems[this.focusedItemIndex];
458
+ e && (e.focused = !1, this.updateSelectedItemIndex());
459
+ });
460
+ },
461
+ { once: !0 }
462
+ );
463
+ }
464
+ handleItemsChanged() {
465
+ this.cachedChildItems = void 0, this._willUpdateItems || (this._willUpdateItems = !0, this.cacheUpdated = this.updateCache());
466
+ }
467
+ async updateCache() {
468
+ await (this.hasUpdated ? new Promise((e) => requestAnimationFrame(() => e(!0))) : Promise.all([
469
+ new Promise((e) => requestAnimationFrame(() => e(!0))),
470
+ this.updateComplete
471
+ ])), this.cachedChildItems === void 0 && (this.updateSelectedItemIndex(), this.updateItemFocus()), this._willUpdateItems = !1;
472
+ }
473
+ updateItemFocus() {
474
+ if (this.childItems.length === 0)
475
+ return;
476
+ const e = this.childItems[this.focusInItemIndex];
477
+ this.getRootNode().activeElement === e.menuData.focusRoot && this.forwardFocusVisibleToItem(e);
478
+ }
479
+ forwardFocusVisibleToItem(e) {
480
+ if (!e || e.menuData.focusRoot !== this)
481
+ return;
482
+ this.closeDescendentOverlays();
483
+ const t = this.hasVisibleFocusInTree() || !!this.childItems.some((o) => o.hasVisibleFocusInTree());
484
+ e.focused = t, this.setAttribute("aria-activedescendant", e.id), e.menuData.selectionRoot && e.menuData.selectionRoot !== this && e.menuData.selectionRoot.focus();
485
+ }
486
+ handleSlotchange({
487
+ target: e
488
+ }) {
489
+ const t = e.assignedElements({
490
+ flatten: !0
491
+ });
492
+ this.childItems.length !== t.length && t.forEach((o) => {
493
+ o.triggerUpdate !== void 0 ? o.triggerUpdate() : o.childItems !== void 0 && o.childItems.forEach((i) => {
494
+ i.triggerUpdate();
495
+ });
496
+ });
497
+ }
498
+ }
499
+ v([
500
+ r({ type: String, reflect: !0 })
501
+ ], d.prototype, "label", 2);
502
+ v([
503
+ r({ type: Boolean, reflect: !0 })
504
+ ], d.prototype, "ignore", 2);
505
+ v([
506
+ r({ type: String, reflect: !0 })
507
+ ], d.prototype, "selects", 2);
508
+ v([
509
+ r({ type: String })
510
+ ], d.prototype, "value", 2);
511
+ v([
512
+ r({ type: String, attribute: "value-separator" })
513
+ ], d.prototype, "valueSeparator", 2);
514
+ v([
515
+ r({ attribute: !1 })
516
+ ], d.prototype, "selected", 1);
517
+ v([
518
+ r({ attribute: !1 })
519
+ ], d.prototype, "selectedItems", 2);
520
+ v([
521
+ b("slot:not([name])")
522
+ ], d.prototype, "menuSlot", 2);
523
+ const V = ":host{--menu-divider-thickness: var( --divider-thickness-medium, var(--luzmo-border-width) );inline-size:auto;margin-block:var(--luzmo-menu-section-divider-margin-block, max(0px, (var(--menu-item-section-divider-height) - var(--menu-divider-thickness)) / 2));margin-inline:var(--luzmo-menu-item-label-inline-edge-to-content, var(--menu-item-label-inline-edge-to-content));overflow:visible}.luzmo-Menu-back:focus-visible{box-shadow:inset calc(var(--luzmo-menu-item-focus-indicator-width, var(--menu-item-focus-indicator-width)) * 1) 0 0 0 var(--highcontrast-menu-item-focus-indicator-color, var(--luzmo-menu-item-focus-indicator-color, var(--menu-item-focus-indicator-color)));box-shadow:inset calc(var(--luzmo-menu-item-focus-indicator-width, var(--menu-item-focus-indicator-width)) * var(--menu-item-focus-indicator-direction-scalar, 1)) 0 0 0 var(--highcontrast-menu-item-focus-indicator-color, var(--luzmo-menu-item-focus-indicator-color, var(--menu-item-focus-indicator-color)))}.luzmo-Menu-back{padding-inline:0 var(--luzmo-menu-back-padding-inline-end, var(--menu-item-label-inline-edge-to-content));padding-inline:var(--luzmo-menu-back-padding-inline-start, 0) var(--luzmo-menu-back-padding-inline-end, var(--menu-item-label-inline-edge-to-content));padding-block:0;padding-block:var(--luzmo-menu-back-padding-block-start, 0) var(--luzmo-menu-back-padding-block-end, 0);flex-flow:wrap;align-items:center;display:flex}.luzmo-Menu-backButton{cursor:pointer;background:none;border:0;margin:0;padding:0;display:inline-flex}.luzmo-Menu-backButton:focus-visible{outline:var(--focus-indicator-thickness) solid var(--focus-indicator-color);outline-offset:calc((var(--focus-indicator-thickness) + 1px) * -1)}.luzmo-Menu-backHeading{color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-back-heading-color, var(--menu-section-header-color)));font-size:var(--luzmo-menu-section-header-font-size, var(--menu-section-header-font-size));font-weight:var(--luzmo-menu-section-header-font-weight, var(--menu-section-header-font-weight));line-height:var(--luzmo-menu-section-header-line-height, var(--menu-section-header-line-height));display:block}:host{display:block;flex-shrink:0}";
524
+ class W extends y(x, {
525
+ validSizes: ["s", "m", "l"]
526
+ }) {
527
+ static get styles() {
528
+ return [g(A), g(V)];
529
+ }
530
+ firstUpdated(e) {
531
+ super.firstUpdated(e), this.setAttribute("role", "separator");
532
+ }
533
+ }
534
+ const N = ".luzmo-Menu-back:focus-visible{box-shadow:inset calc(var(--luzmo-menu-item-focus-indicator-width, var(--menu-item-focus-indicator-width)) * 1) 0 0 0 var(--highcontrast-menu-item-focus-indicator-color, var(--luzmo-menu-item-focus-indicator-color, var(--menu-item-focus-indicator-color)));box-shadow:inset calc(var(--luzmo-menu-item-focus-indicator-width, var(--menu-item-focus-indicator-width)) * var(--menu-item-focus-indicator-direction-scalar, 1)) 0 0 0 var(--highcontrast-menu-item-focus-indicator-color, var(--luzmo-menu-item-focus-indicator-color, var(--menu-item-focus-indicator-color)))}.header{color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-section-header-color, var(--menu-section-header-color)));font-size:var(--luzmo-menu-section-header-font-size, var(--menu-section-header-font-size));font-weight:var(--luzmo-menu-section-header-font-weight, var(--menu-section-header-font-weight));line-height:var(--luzmo-menu-section-header-line-height, var(--menu-section-header-line-height));min-inline-size:var(--luzmo-menu-section-header-min-width, var(--menu-section-header-min-width));padding-block-start:var(--luzmo-menu-section-header-top-edge-to-text, var(--luzmo-menu-item-top-edge-to-text, var(--menu-item-top-edge-to-text)));padding-block-end:var(--luzmo-menu-section-header-bottom-edge-to-text, var(--luzmo-menu-item-bottom-edge-to-text, var(--menu-item-bottom-edge-to-text)));padding-inline:var(--luzmo-menu-item-label-inline-edge-to-content, var(--menu-item-label-inline-edge-to-content));grid-area:sectionHeadingArea/1/sectionHeadingArea/-1;display:block}.luzmo-Menu-back{padding-inline:0 var(--luzmo-menu-back-padding-inline-end, var(--menu-item-label-inline-edge-to-content));padding-inline:var(--luzmo-menu-back-padding-inline-start, 0) var(--luzmo-menu-back-padding-inline-end, var(--menu-item-label-inline-edge-to-content));padding-block:0;padding-block:var(--luzmo-menu-back-padding-block-start, 0) var(--luzmo-menu-back-padding-block-end, 0);flex-flow:wrap;align-items:center;display:flex}.luzmo-Menu-back .header{padding:0}.luzmo-Menu-backButton{cursor:pointer;background:none;border:0;margin:0;padding:0;display:inline-flex}.luzmo-Menu-backButton:focus-visible{outline:var(--focus-indicator-thickness) solid var(--focus-indicator-color);outline-offset:calc((var(--focus-indicator-thickness) + 1px) * -1)}.luzmo-Menu-backHeading{color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-back-heading-color, var(--menu-section-header-color)));font-size:var(--luzmo-menu-section-header-font-size, var(--menu-section-header-font-size));font-weight:var(--luzmo-menu-section-header-font-weight, var(--menu-section-header-font-weight));line-height:var(--luzmo-menu-section-header-line-height, var(--menu-section-header-line-height));display:block}:host{margin:0;display:inline-flex;overflow:visible;flex-direction:column}[hidden]{display:none!important}";
535
+ var K = Object.defineProperty, C = (a, e, t, o) => {
536
+ for (var i = void 0, n = a.length - 1, l; n >= 0; n--)
537
+ (l = a[n]) && (i = l(e, t, i) || i);
538
+ return i && K(e, t, i), i;
539
+ };
540
+ class I extends d {
541
+ constructor() {
542
+ super(...arguments), this.headerId = "";
543
+ }
544
+ static get styles() {
545
+ return [...super.styles, g(N)];
546
+ }
547
+ render() {
548
+ return h`
549
+ <span class="header" ?hidden=${!this.headerElement}>
550
+ <slot name="header" @slotchange=${this.updateLabel}></slot>
551
+ </span>
552
+ <luzmo-menu ignore>${this.renderMenuItemSlot()}</luzmo-menu>
553
+ `;
554
+ }
555
+ get ownRole() {
556
+ switch (this.selects) {
557
+ case "multiple":
558
+ case "single":
559
+ case "inherit":
560
+ return "group";
561
+ default:
562
+ return "menu";
563
+ }
564
+ }
565
+ updateLabel() {
566
+ const e = this.headerElements.length > 0 ? this.headerElements[0] : void 0;
567
+ if (e !== this.headerElement)
568
+ if (this.headerElement && this.headerElement.id === this.headerId && this.headerElement.removeAttribute("id"), e) {
569
+ this.headerId = this.headerId || `luzmo-menu-group-label-${S()}`;
570
+ const t = e.id || this.headerId;
571
+ e.id || (e.id = t), this.setAttribute("aria-labelledby", t);
572
+ } else
573
+ this.removeAttribute("aria-labelledby");
574
+ this.headerElement = e;
575
+ }
576
+ }
577
+ C([
578
+ O({
579
+ slot: "header",
580
+ flatten: !0
581
+ })
582
+ ], I.prototype, "headerElements");
583
+ C([
584
+ P()
585
+ ], I.prototype, "headerElement");
586
+ const G = '.checkmark{display:var(--luzmo-menu-checkmark-display, var(--menu-checkmark-display));font-size:var(--luzmo-menu-item-checkmark-size, var(--menu-item-checkmark-size));fill:var(--highcontrast-menu-checkmark-icon-color-default, var(--luzmo-menu-checkmark-icon-color-default, var(--menu-checkmark-icon-color-default)));color:var(--highcontrast-menu-checkmark-icon-color-default, var(--luzmo-menu-checkmark-icon-color-default, var(--menu-checkmark-icon-color-default)));opacity:1;grid-area:checkmarkArea;align-self:start;margin-block-start:calc(var(--luzmo-menu-item-top-to-checkmark, var(--menu-item-top-to-checkmark)) - var(--luzmo-menu-item-top-edge-to-text, var(--menu-item-top-edge-to-text)));margin-inline-end:var(--luzmo-menu-item-text-to-control, var(--menu-item-text-to-control))}.angle{font-size:var(--menu-item-angle-size);grid-area:angleArea;align-self:center;margin-inline-end:var(--luzmo-menu-item-text-to-control, var(--menu-item-text-to-control))}.luzmo-Menu-back:focus-visible{box-shadow:inset calc(var(--luzmo-menu-item-focus-indicator-width, var(--menu-item-focus-indicator-width)) * 1) 0 0 0 var(--highcontrast-menu-item-focus-indicator-color, var(--luzmo-menu-item-focus-indicator-color, var(--menu-item-focus-indicator-color)));box-shadow:inset calc(var(--luzmo-menu-item-focus-indicator-width, var(--menu-item-focus-indicator-width)) * var(--menu-item-focus-indicator-direction-scalar, 1)) 0 0 0 var(--highcontrast-menu-item-focus-indicator-color, var(--luzmo-menu-item-focus-indicator-color, var(--menu-item-focus-indicator-color)))}.luzmo-Menu-backButton:focus-visible{outline:var(--focus-indicator-thickness) solid var(--focus-indicator-color);outline-offset:calc((var(--focus-indicator-thickness) + 1px) * -1)}::slotted([slot=icon]){fill:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-item-label-icon-color-default, var(--menu-item-label-icon-color-default)));color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-item-label-icon-color-default, var(--menu-item-label-icon-color-default)));grid-area:iconArea;align-self:start}::slotted([slot=icon]){margin-inline-end:var(--luzmo-menu-item-label-text-to-visual, var(--menu-item-label-text-to-visual))}:host{cursor:pointer;box-sizing:border-box;background-color:var(--highcontrast-menu-item-background-color-default, var(--luzmo-menu-item-background-color-default, var(--menu-item-background-color-default)));line-height:var(--luzmo-menu-item-label-line-height, var(--menu-item-label-line-height));min-block-size:var(--luzmo-menu-item-min-height, var(--menu-item-min-height));padding-block-start:var(--luzmo-menu-item-top-edge-to-text, var(--menu-item-top-edge-to-text));padding-block-end:var(--luzmo-menu-item-bottom-edge-to-text, var(--menu-item-bottom-edge-to-text));padding-inline:var(--luzmo-menu-item-label-inline-edge-to-content, var(--menu-item-label-inline-edge-to-content));grid-template:". angleAreaCollapsible . headingIconArea sectionHeadingArea . . ." "selectedArea angleAreaCollapsible checkmarkArea iconArea labelArea valueArea actionsArea angleAreaDrillIn" 1fr ". . . . descriptionArea . . ." ". . . . submenuArea . . ." ". . . . . . . ."/auto auto auto auto 1fr auto auto auto;justify-content:start;margin:0;-webkit-text-decoration:none;text-decoration:none;display:grid;align-items:center;position:relative}.luzmo-Menu-itemCheckbox{--luzmo-checkbox-top-to-text: 0;--luzmo-checkbox-text-to-control: 0;min-block-size:0}.luzmo-Menu-itemCheckbox .luzmo-Checkbox-box{margin-block-start:var(--luzmo-menu-item-top-to-checkbox, var(--menu-item-top-to-checkbox));margin-block-end:0;margin-inline-end:var(--luzmo-menu-item-text-to-control, var(--menu-item-text-to-control))}.luzmo-Menu-itemSwitch{min-block-size:0}.luzmo-Menu-itemSwitch .luzmo-Switch-switch{margin-block-start:var(--luzmo-menu-item-top-to-action, var(--menu-item-top-to-action));margin-block-end:0}#label{grid-area:submenuItemLabelArea}::slotted([slot=value]){grid-area:submenuItemValueArea}:host([focused]),:host(:focus){background-color:var(--highcontrast-menu-item-background-color-focus, var(--luzmo-menu-item-background-color-key-focus, var(--menu-item-background-color-key-focus)));outline:none}:host([focused])>#label,:host(:focus)>#label{color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-content-color-focus, var(--menu-item-label-content-color-focus)))}:host([focused])>[name=description]::slotted(*),:host(:focus)>[name=description]::slotted(*){color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-description-color-focus, var(--menu-item-description-color-focus)))}:host([focused])>::slotted([slot=value]),:host(:focus)>::slotted([slot=value]){color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-value-color-focus, var(--menu-item-value-color-focus)))}:host([focused])>.icon:not(.angle,.checkmark),:host(:focus)>.icon:not(.angle,.checkmark){fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-icon-color-focus, var(--menu-item-label-icon-color-focus)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-icon-color-focus, var(--menu-item-label-icon-color-focus)))}:host([focused])>.angle,:host(:focus)>.angle{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-collapsible-icon-color, var(--menu-collapsible-icon-color)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-collapsible-icon-color, var(--menu-collapsible-icon-color)))}:host([focused])>.checkmark,:host(:focus)>.checkmark{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-checkmark-icon-color-focus, var(--menu-checkmark-icon-color-focus)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-checkmark-icon-color-focus, var(--menu-checkmark-icon-color-focus)))}:host:dir(rtl),:host([dir=rtl]){--menu-item-focus-indicator-direction-scalar: -1}:host(:is(:active,[active])){background-color:var(--highcontrast-menu-item-background-color-focus, var(--luzmo-menu-item-background-color-down, var(--menu-item-background-color-down)))}:host(:is(:active,[active]))>#label{color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-content-color-down, var(--menu-item-label-content-color-down)))}:host(:is(:active,[active]))>[name=description]::slotted(*){color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-description-color-down, var(--menu-item-description-color-down)))}:host(:is(:active,[active]))>::slotted([slot=value]){color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-value-color-down, var(--menu-item-value-color-down)))}:host(:is(:active,[active]))>.icon:not(.angle,.checkmark){fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-icon-color-down, var(--menu-item-label-icon-color-down)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-icon-color-down, var(--menu-item-label-icon-color-down)))}:host(:is(:active,[active]))>.angle{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-collapsible-icon-color, var(--menu-collapsible-icon-color)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-collapsible-icon-color, var(--menu-collapsible-icon-color)))}:host(:is(:active,[active]))>.checkmark{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-checkmark-icon-color-down, var(--menu-checkmark-icon-color-down)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-checkmark-icon-color-down, var(--menu-checkmark-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-menu-item-color-disabled, var(--luzmo-menu-item-label-content-color-disabled, var(--menu-item-label-content-color-disabled)))}:host([disabled]) [name=description]::slotted(*),:host([aria-disabled=true]) [name=description]::slotted(*){color:var(--highcontrast-menu-item-color-disabled, var(--luzmo-menu-item-description-color-disabled, var(--menu-item-description-color-disabled)))}:host([disabled]) ::slotted([slot=icon]),:host([aria-disabled=true]) ::slotted([slot=icon]){color:var(--highcontrast-menu-item-color-disabled, var(--luzmo-menu-item-label-icon-color-disabled, var(--menu-item-label-icon-color-disabled)));fill:var(--highcontrast-menu-item-color-disabled, var(--luzmo-menu-item-label-icon-color-disabled, var(--menu-item-label-icon-color-disabled)))}:host([focused]) .luzmo-Menu-back,:host([focused]){box-shadow:inset calc(var(--luzmo-menu-item-focus-indicator-width, var(--menu-item-focus-indicator-width)) * 1) 0 0 0 var(--highcontrast-menu-item-focus-indicator-color, var(--luzmo-menu-item-focus-indicator-color, var(--menu-item-focus-indicator-color)));box-shadow:inset calc(var(--luzmo-menu-item-focus-indicator-width, var(--menu-item-focus-indicator-width)) * var(--menu-item-focus-indicator-direction-scalar, 1)) 0 0 0 var(--highcontrast-menu-item-focus-indicator-color, var(--luzmo-menu-item-focus-indicator-color, var(--menu-item-focus-indicator-color)))}:host .is-selectableMultiple{align-items:start}.is-selectableMultiple .luzmo-Menu-itemCheckbox{grid-area:checkmarkArea}.luzmo-Menu-itemSelection{grid-area:selectedArea}#label{--luzmo-switch-control-label-spacing: 0;--luzmo-switch-spacing-top-to-label: 0;font-size:var(--luzmo-menu-item-label-font-size, var(--menu-item-label-font-size));color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-item-label-content-color-default, var(--menu-item-label-content-color-default)));-webkit-hyphens:auto;hyphens:auto;overflow-wrap:break-word;grid-area:labelArea}:host([selected]) #label{color:var(--menu-item-highlight-label-content-color)}::slotted([slot=value]){color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-item-value-color-default, var(--menu-item-value-color-default)));font-size:var(--luzmo-menu-item-label-font-size, var(--menu-item-label-font-size));grid-area:valueArea;justify-self:end}.luzmo-Menu-itemActions,::slotted([slot=value]){align-self:start;margin-inline-start:var(--luzmo-menu-item-label-to-value-area-min-spacing, var(--menu-item-label-to-value-area-min-spacing))}.luzmo-Menu-itemActions{grid-area:actionsArea}[name=description]::slotted(*){color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-item-description-color-default, var(--menu-item-description-color-default)));font-size:var(--luzmo-menu-item-description-font-size, var(--menu-item-description-font-size));-webkit-hyphens:auto;hyphens:auto;overflow-wrap:break-word;line-height:var(--luzmo-menu-item-description-line-height, var(--menu-item-description-line-height));grid-area:descriptionArea;margin-block-start:var(--luzmo-menu-item-label-to-description-spacing, var(--menu-item-label-to-description-spacing))}:host([no-wrap]) #label{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.luzmo-Menu-item--collapsible.is-open{padding-block-end:0}.luzmo-Menu-item--collapsible.is-open .angle{transform:rotate(90deg)}:host([focused]) .luzmo-Menu-item--collapsible.is-open,:host(:is(:active,[active])) .luzmo-Menu-item--collapsible.is-open,.luzmo-Menu-item--collapsible.is-open:focus{background-color:var(--highcontrast-menu-item-background-color-default, var(--luzmo-menu-item-background-color-default, var(--menu-item-background-color-default)))}.luzmo-Menu-item--collapsible ::slotted([slot=icon]){grid-area:headingIconArea}.luzmo-Menu-item--collapsible>::slotted([slot=icon]){padding-block-start:var(--luzmo-menu-section-header-top-edge-to-text, var(--luzmo-menu-item-top-edge-to-text, var(--menu-item-top-edge-to-text)));padding-block-end:var(--luzmo-menu-section-header-bottom-edge-to-text, var(--luzmo-menu-item-bottom-edge-to-text, var(--menu-item-bottom-edge-to-text)))}.luzmo-Menu-item--collapsible .angle{grid-area:angleAreaCollapsible}:host([has-submenu]) .angle{fill:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-drillin-icon-color-default, var(--menu-drillin-icon-color-default)));color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-drillin-icon-color-default, var(--menu-drillin-icon-color-default)));grid-area:angleAreaDrillIn;margin-inline-start:var(--luzmo-menu-item-label-to-value-area-min-spacing, var(--menu-item-label-to-value-area-min-spacing));margin-inline-end:0}:host([has-submenu]) .is-open{--menu-item-background-color-default: var( --highcontrast-menu-item-selected-background-color, var( --luzmo-menu-item-background-color-hover, var(--menu-item-background-color-hover) ) )}:host([has-submenu]) .is-open .icon:not(.angle,.checkmark){fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-icon-color-hover, var(--menu-item-label-icon-color-hover)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-icon-color-hover, var(--menu-item-label-icon-color-hover)))}:host([has-submenu]) .is-open .angle{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-drillin-icon-color-hover, var(--menu-drillin-icon-color-hover)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-drillin-icon-color-hover, var(--menu-drillin-icon-color-hover)))}:host([has-submenu]) .is-open .checkmark{fill:var(--highcontrast-menu-checkmark-icon-color-default, var(--luzmo-menu-checkmark-icon-color-hover, var(--menu-checkmark-icon-color-hover)));color:var(--highcontrast-menu-checkmark-icon-color-default, var(--luzmo-menu-checkmark-icon-color-hover, var(--menu-checkmark-icon-color-hover)))}@media (hover: hover){:host(:hover){background-color:var(--highcontrast-menu-item-background-color-focus, var(--luzmo-menu-item-background-color-hover, var(--menu-item-background-color-hover)))}:host(:hover)>#label{color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-content-color-hover, var(--menu-item-label-content-color-hover)))}:host([selected]:hover)>#label{color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-highlight-label-content-color, var(--menu-item-highlight-label-content-color)))}:host(:hover)>[name=description]::slotted(*){color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-description-color-hover, var(--menu-item-description-color-hover)))}:host(:hover)>::slotted([slot=value]){color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-value-color-hover, var(--menu-item-value-color-hover)))}:host(:hover)>.icon:not(.angle,.checkmark){fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-icon-color-hover, var(--menu-item-label-icon-color-hover)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-icon-color-hover, var(--menu-item-label-icon-color-hover)))}:host(:hover)>.angle{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-collapsible-icon-color, var(--menu-collapsible-icon-color)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-collapsible-icon-color, var(--menu-collapsible-icon-color)))}:host(:hover)>.checkmark{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-checkmark-icon-color-hover, var(--menu-checkmark-icon-color-hover)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-checkmark-icon-color-hover, var(--menu-checkmark-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-menu-item-color-disabled, var(--luzmo-menu-item-label-content-color-disabled, var(--menu-item-label-content-color-disabled)))}:host([disabled]:hover) [name=description]::slotted(*),:host([aria-disabled=true]:hover) [name=description]::slotted(*){color:var(--highcontrast-menu-item-color-disabled, var(--luzmo-menu-item-description-color-disabled, var(--menu-item-description-color-disabled)))}:host([disabled]:hover) ::slotted([slot=icon]),:host([aria-disabled=true]:hover) ::slotted([slot=icon]){color:var(--highcontrast-menu-item-color-disabled, var(--luzmo-menu-item-label-icon-color-disabled, var(--menu-item-label-icon-color-disabled)));fill:var(--highcontrast-menu-item-color-disabled, var(--luzmo-menu-item-label-icon-color-disabled, var(--menu-item-label-icon-color-disabled)))}.luzmo-Menu-item--collapsible.is-open:hover{background-color:var(--highcontrast-menu-item-background-color-default, var(--luzmo-menu-item-background-color-default, var(--menu-item-background-color-default)))}:host([has-submenu]:hover) .angle{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-drillin-icon-color-hover, var(--menu-drillin-icon-color-hover)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-drillin-icon-color-hover, var(--menu-drillin-icon-color-hover)))}}:host([has-submenu][focused]) .angle,:host([has-submenu]:focus) .angle{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-drillin-icon-color-focus, var(--menu-drillin-icon-color-focus)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-drillin-icon-color-focus, var(--menu-drillin-icon-color-focus)))}:host([has-submenu]:is(:active,[active])) .angle{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-drillin-icon-color-down, var(--menu-drillin-icon-color-down)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-drillin-icon-color-down, var(--menu-drillin-icon-color-down)))}.luzmo-Menu-back{padding-inline:0 var(--luzmo-menu-back-padding-inline-end, var(--menu-item-label-inline-edge-to-content));padding-inline:var(--luzmo-menu-back-padding-inline-start, 0) var(--luzmo-menu-back-padding-inline-end, var(--menu-item-label-inline-edge-to-content));padding-block:0;padding-block:var(--luzmo-menu-back-padding-block-start, 0) var(--luzmo-menu-back-padding-block-end, 0);flex-flow:wrap;align-items:center;display:flex}.luzmo-Menu-backButton{cursor:pointer;background:none;border:0;margin:0;padding:0;display:inline-flex}:host([focused]) .luzmo-Menu-backButton{outline:var(--focus-indicator-thickness) solid var(--focus-indicator-color);outline-offset:calc((var(--focus-indicator-thickness) + 1px) * -1)}.luzmo-Menu-backHeading{color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-back-heading-color, var(--menu-section-header-color)));font-size:var(--luzmo-menu-section-header-font-size, var(--menu-section-header-font-size));font-weight:var(--luzmo-menu-section-header-font-weight, var(--menu-section-header-font-weight));line-height:var(--luzmo-menu-section-header-line-height, var(--menu-section-header-line-height));display:block}:host{text-align:initial;font-family:var(--luzmo-menu-item-font-family, var(--luzmo-font-family))}:host([hidden]){display:none}:host([disabled]){pointer-events:none}:host([disabled]) [name=value]::slotted(*){color:var(--luzmo-menu-item-label-icon-color-disabled, var(--luzmo-disabled-color))}:host([has-submenu][disabled]) .angle{color:var(--luzmo-menu-item-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}}::slotted([slot=submenu]){width:max-content;max-width:100%}:host([no-wrap]) #label{display:block}';
587
+ var J = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, u = (a, e, t, o) => {
588
+ for (var i = o > 1 ? void 0 : o ? Q(e, t) : e, n = a.length - 1, l; n >= 0; n--)
589
+ (l = a[n]) && (i = (o ? l(e, t, i) : l(i)) || i);
590
+ return o && i && J(e, t, i), i;
591
+ };
592
+ const X = 100, Y = (a) => h`
593
+ <span class="icon-container icon checkmark ${a.join(" ")}">
594
+ ${M(_)}
595
+ </span>
596
+ `, Z = (a) => h`
597
+ <span class="icon-container icon angle ${a.join(" ")}">
598
+ ${M(T, { className: "indicator" })}
599
+ </span>
600
+ `;
601
+ class ee extends Event {
602
+ constructor(e) {
603
+ super("luzmo-menu-item-added-or-updated", {
604
+ bubbles: !0,
605
+ composed: !0
606
+ }), this.menuCascade = /* @__PURE__ */ new WeakMap(), this.clear(e);
607
+ }
608
+ get item() {
609
+ return this._item;
610
+ }
611
+ clear(e) {
612
+ this._item = e, this.currentAncestorWithSelects = void 0, e.menuData = {
613
+ cleanupSteps: [],
614
+ focusRoot: void 0,
615
+ selectionRoot: void 0,
616
+ parentMenu: void 0
617
+ }, this.menuCascade = /* @__PURE__ */ new WeakMap();
618
+ }
619
+ }
620
+ class s extends R(
621
+ L(B(D, '[slot="icon"]'))
622
+ ) {
623
+ constructor() {
624
+ super(), this.active = !1, this.dependencyManager = new U(this), this.focused = !1, this.selected = !1, this._value = "", this.hasSubmenu = !1, this.noWrap = !1, this.renderAngleIcon = (e = []) => Z(e), this.renderCheckIcon = (e = []) => Y(e), this.open = !1, this.handleSlottableRequest = (e) => {
625
+ var t;
626
+ (t = this.submenuElement) == null || t.dispatchEvent(
627
+ new $(e.name, e.data)
628
+ );
629
+ }, this.proxyFocus = () => {
630
+ this.focus();
631
+ }, this.handleBeforetoggle = (e) => {
632
+ e.newState === "closed" && (this.open = !0, this.overlayElement.manuallyKeepOpen(), this.overlayElement.removeEventListener(
633
+ "beforetoggle",
634
+ this.handleBeforetoggle
635
+ ));
636
+ }, this.recentlyLeftChild = !1, this.willDispatchUpdate = !1, this.menuData = {
637
+ focusRoot: void 0,
638
+ parentMenu: void 0,
639
+ selectionRoot: void 0,
640
+ cleanupSteps: []
641
+ }, this.addEventListener("click", this.handleClickCapture, {
642
+ capture: !0
643
+ }), new E(this, {
644
+ config: {
645
+ characterData: !0,
646
+ childList: !0,
647
+ subtree: !0
648
+ },
649
+ callback: (e) => {
650
+ e.every(
651
+ (o) => o.target.slot === "submenu"
652
+ ) || this.breakItemChildrenCache();
653
+ }
654
+ });
655
+ }
656
+ static get styles() {
657
+ return [g(G)];
658
+ }
659
+ get value() {
660
+ return this._value || this.itemText;
661
+ }
662
+ set value(e) {
663
+ e !== this._value && (this._value = e || "", this._value ? this.setAttribute("value", this._value) : this.removeAttribute("value"));
664
+ }
665
+ /**
666
+ * @private
667
+ */
668
+ get itemText() {
669
+ return this.itemChildren.content.reduce(
670
+ (e, t) => e + (t.textContent || "").trim(),
671
+ ""
672
+ );
673
+ }
674
+ get focusElement() {
675
+ return this;
676
+ }
677
+ get hasIcon() {
678
+ return this.slotContentIsPresent;
679
+ }
680
+ get itemChildren() {
681
+ if (!this.iconSlot || !this.contentSlot)
682
+ return {
683
+ icon: [],
684
+ content: []
685
+ };
686
+ if (this._itemChildren)
687
+ return this._itemChildren;
688
+ const e = this.iconSlot.assignedElements().map((o) => {
689
+ const i = o.cloneNode(!0);
690
+ return i.removeAttribute("slot"), i.classList.toggle("icon"), i;
691
+ }), t = this.contentSlot.assignedNodes().map((o) => o.cloneNode(!0));
692
+ return this._itemChildren = { icon: e, content: t }, this._itemChildren;
693
+ }
694
+ click() {
695
+ this.disabled || this.shouldProxyClick() || super.click();
696
+ }
697
+ handleClickCapture(e) {
698
+ if (this.disabled)
699
+ return e.preventDefault(), e.stopImmediatePropagation(), e.stopPropagation(), !1;
700
+ }
701
+ shouldProxyClick() {
702
+ let e = !1;
703
+ return this.anchorElement && (this.anchorElement.click(), e = !0), e;
704
+ }
705
+ breakItemChildrenCache() {
706
+ this._itemChildren = void 0, this.triggerUpdate();
707
+ }
708
+ renderSubmenu() {
709
+ const e = h`
710
+ <slot
711
+ name="submenu"
712
+ @slotchange=${this.manageSubmenu}
713
+ @luzmo-menu-item-added-or-updated=${{
714
+ handleEvent: (t) => {
715
+ t.clear(t.item);
716
+ },
717
+ capture: !0
718
+ }}
719
+ @focusin=${(t) => t.stopPropagation()}
720
+ ></slot>
721
+ `;
722
+ return this.hasSubmenu ? (this.dependencyManager.add("luzmo-overlay"), this.dependencyManager.add("luzmo-popover"), import("./overlay-C7QKFqRc.js").then((t) => t.o), import("./popover-ZRVxogyp.js"), h`
723
+ <luzmo-overlay
724
+ .triggerElement=${this}
725
+ ?disabled=${!this.hasSubmenu}
726
+ ?open=${this.hasSubmenu && this.open && this.dependencyManager.loaded}
727
+ .placement=${this.isLTR ? "right-start" : "left-start"}
728
+ .offset=${[-10, -5]}
729
+ .type=${"auto"}
730
+ @close=${(t) => t.stopPropagation()}
731
+ @slottable-request=${this.handleSlottableRequest}
732
+ >
733
+ <luzmo-popover
734
+ @change=${(t) => {
735
+ this.handleSubmenuChange(t), this.open = !1;
736
+ }}
737
+ @pointerenter=${this.handleSubmenuPointerenter}
738
+ @pointerleave=${this.handleSubmenuPointerleave}
739
+ @luzmo-menu-item-added-or-updated=${(t) => t.stopPropagation()}
740
+ >
741
+ ${e}
742
+ </luzmo-popover>
743
+ </luzmo-overlay>
744
+ ${this.renderAngleIcon()}
745
+ `) : e;
746
+ }
747
+ render() {
748
+ return h`
749
+ ${this.selected ? h`
750
+ ${this.renderCheckIcon(
751
+ this.hasIcon ? ["checkmark--withAdjacentIcon"] : []
752
+ )}
753
+ ` : w}
754
+ <slot name="icon"></slot>
755
+ <div id="label">
756
+ <slot id="slot"></slot>
757
+ </div>
758
+ <slot name="description"></slot>
759
+ <slot name="value"></slot>
760
+ ${this.href && this.href.length > 0 ? super.renderAnchor({
761
+ id: "button",
762
+ ariaHidden: !0,
763
+ className: "button anchor hidden"
764
+ }) : w}
765
+ ${this.renderSubmenu()}
766
+ `;
767
+ }
768
+ manageSubmenu(e) {
769
+ this.submenuElement = e.target.assignedElements({
770
+ flatten: !0
771
+ })[0], this.hasSubmenu = !!this.submenuElement, this.hasSubmenu && this.setAttribute("aria-haspopup", "true");
772
+ }
773
+ handlePointerdown(e) {
774
+ e.target === this && this.hasSubmenu && this.open && (this.addEventListener("focus", this.handleSubmenuFocus, {
775
+ once: !0
776
+ }), this.overlayElement.addEventListener(
777
+ "beforetoggle",
778
+ this.handleBeforetoggle
779
+ ));
780
+ }
781
+ firstUpdated(e) {
782
+ super.firstUpdated(e), this.setAttribute("tabindex", "-1"), this.addEventListener("pointerdown", this.handlePointerdown), this.addEventListener("pointerenter", this.closeOverlaysForRoot), this.hasAttribute("id") || (this.id = `luzmo-menu-item-${S()}`);
783
+ }
784
+ closeOverlaysForRoot() {
785
+ var e;
786
+ this.open || (e = this.menuData.parentMenu) == null || e.closeDescendentOverlays();
787
+ }
788
+ handleSubmenuClick(e) {
789
+ e.composedPath().includes(this.overlayElement) || this.openOverlay();
790
+ }
791
+ handleSubmenuFocus() {
792
+ requestAnimationFrame(() => {
793
+ this.overlayElement.open = this.open;
794
+ });
795
+ }
796
+ handlePointerenter() {
797
+ if (this.leaveTimeout) {
798
+ clearTimeout(this.leaveTimeout), delete this.leaveTimeout;
799
+ return;
800
+ }
801
+ this.openOverlay();
802
+ }
803
+ handlePointerleave() {
804
+ this.open && !this.recentlyLeftChild && (this.leaveTimeout = setTimeout(() => {
805
+ delete this.leaveTimeout, this.open = !1;
806
+ }, X));
807
+ }
808
+ /**
809
+ * When there is a `change` event in the submenu for this item
810
+ * then we "click" this item to cascade the selection up the
811
+ * menu tree allowing all submenus between the initial selection
812
+ * and the root of the tree to have their selection changes and
813
+ * be closed.
814
+ */
815
+ handleSubmenuChange(e) {
816
+ var t;
817
+ e.stopPropagation(), (t = this.menuData.selectionRoot) == null || t.selectOrToggleItem(this);
818
+ }
819
+ handleSubmenuPointerenter() {
820
+ this.recentlyLeftChild = !0;
821
+ }
822
+ handleSubmenuPointerleave() {
823
+ requestAnimationFrame(() => {
824
+ this.recentlyLeftChild = !1;
825
+ });
826
+ }
827
+ handleSubmenuOpen(e) {
828
+ this.focused = !1;
829
+ const t = e.composedPath().find(
830
+ (o) => o !== this.overlayElement && o.localName === "luzmo-overlay"
831
+ );
832
+ this.overlayElement.parentOverlayToForceClose = t;
833
+ }
834
+ cleanup() {
835
+ this.open = !1, this.active = !1;
836
+ }
837
+ openOverlay() {
838
+ !this.hasSubmenu || this.open || this.disabled || (this.open = !0, this.active = !0, this.setAttribute("aria-expanded", "true"), this.addEventListener("luzmo-closed", this.cleanup, {
839
+ once: !0
840
+ }));
841
+ }
842
+ updateAriaSelected() {
843
+ const e = this.getAttribute("role");
844
+ e === "option" ? this.setAttribute("aria-selected", this.selected ? "true" : "false") : (e === "menuitemcheckbox" || e === "menuitemradio") && this.setAttribute("aria-checked", this.selected ? "true" : "false");
845
+ }
846
+ setRole(e) {
847
+ this.setAttribute("role", e), this.updateAriaSelected();
848
+ }
849
+ updated(e) {
850
+ var t, o;
851
+ if (super.updated(e), e.has("label") && (this.label || e.get("label") !== void 0) && this.setAttribute("aria-label", this.label || ""), e.has("active") && (this.active || e.get("active") !== void 0) && this.active && ((t = this.menuData.selectionRoot) == null || t.closeDescendentOverlays()), this.anchorElement && (this.anchorElement.addEventListener("focus", this.proxyFocus), this.anchorElement.tabIndex = -1), e.has("selected") && this.updateAriaSelected(), e.has("hasSubmenu") && (this.hasSubmenu || e.get("hasSubmenu") !== void 0))
852
+ if (this.hasSubmenu) {
853
+ this.abortControllerSubmenu = new AbortController();
854
+ const i = { signal: this.abortControllerSubmenu.signal };
855
+ this.addEventListener("click", this.handleSubmenuClick, i), this.addEventListener("pointerenter", this.handlePointerenter, i), this.addEventListener("pointerleave", this.handlePointerleave, i), this.addEventListener("luzmo-opened", this.handleSubmenuOpen, i);
856
+ } else
857
+ (o = this.abortControllerSubmenu) == null || o.abort();
858
+ }
859
+ connectedCallback() {
860
+ super.connectedCallback(), this.triggerUpdate();
861
+ }
862
+ disconnectedCallback() {
863
+ this.menuData.cleanupSteps.forEach((e) => e(this)), this.menuData = {
864
+ focusRoot: void 0,
865
+ parentMenu: void 0,
866
+ selectionRoot: void 0,
867
+ cleanupSteps: []
868
+ }, super.disconnectedCallback();
869
+ }
870
+ async triggerUpdate() {
871
+ this.willDispatchUpdate || (this.willDispatchUpdate = !0, await new Promise((e) => requestAnimationFrame(e)), this.dispatchUpdate());
872
+ }
873
+ dispatchUpdate() {
874
+ this.isConnected && (this.dispatchEvent(new ee(this)), this.willDispatchUpdate = !1);
875
+ }
876
+ }
877
+ u([
878
+ r({ type: Boolean, reflect: !0 })
879
+ ], s.prototype, "active", 2);
880
+ u([
881
+ r({ type: Boolean, reflect: !0 })
882
+ ], s.prototype, "focused", 2);
883
+ u([
884
+ r({ type: Boolean, reflect: !0 })
885
+ ], s.prototype, "selected", 2);
886
+ u([
887
+ r({ type: String })
888
+ ], s.prototype, "value", 1);
889
+ u([
890
+ r({ type: Boolean, reflect: !0, attribute: "has-submenu" })
891
+ ], s.prototype, "hasSubmenu", 2);
892
+ u([
893
+ b("slot:not([name])")
894
+ ], s.prototype, "contentSlot", 2);
895
+ u([
896
+ b('slot[name="icon"]')
897
+ ], s.prototype, "iconSlot", 2);
898
+ u([
899
+ r({
900
+ type: Boolean,
901
+ reflect: !0,
902
+ attribute: "no-wrap",
903
+ hasChanged() {
904
+ return !1;
905
+ }
906
+ })
907
+ ], s.prototype, "noWrap", 2);
908
+ u([
909
+ b(".anchor")
910
+ ], s.prototype, "anchorElement", 2);
911
+ u([
912
+ b("luzmo-overlay")
913
+ ], s.prototype, "overlayElement", 2);
914
+ u([
915
+ r({ type: Boolean, reflect: !0 })
916
+ ], s.prototype, "open", 2);
917
+ customElements.get("luzmo-menu") || customElements.define("luzmo-menu", d);
918
+ customElements.get("luzmo-menu-divider") || customElements.define("luzmo-menu-divider", W);
919
+ customElements.get("luzmo-menu-group") || customElements.define("luzmo-menu-group", I);
920
+ customElements.get("luzmo-menu-item") || customElements.define("luzmo-menu-item", s);
921
+ export {
922
+ d as L,
923
+ ee as M,
924
+ B as O,
925
+ W as a,
926
+ I as b,
927
+ s as c
928
+ };