@luzmo/lucero 0.0.16 → 0.0.17

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 (119) hide show
  1. package/components/NumberFormatter-DewVDY5w.cjs +18 -0
  2. package/components/NumberFormatter-DgOUVrge.js +136 -0
  3. package/components/NumberParser-Dik4a0h-.cjs +18 -0
  4. package/components/NumberParser-ci9J5EKv.js +173 -0
  5. package/components/accordion/index.cjs +1 -1
  6. package/components/accordion/index.js +2 -2
  7. package/components/action-bar/index.cjs +1 -1
  8. package/components/action-bar/index.js +2 -2
  9. package/components/action-button/index.cjs +1 -1
  10. package/components/action-button/index.js +2 -2
  11. package/components/action-group/index.js +1 -1
  12. package/components/action-menu/index.cjs +1 -1
  13. package/components/action-menu/index.js +3 -3
  14. package/components/avatar/index.js +1 -1
  15. package/components/button/index.cjs +1 -1
  16. package/components/button/index.js +3 -3
  17. package/components/button-group/index.js +1 -1
  18. package/components/calendar/calendar.d.ts +218 -0
  19. package/components/calendar/index.cjs +18 -0
  20. package/components/calendar/index.d.ts +7 -0
  21. package/components/calendar/index.js +28 -0
  22. package/components/checkbox/index.cjs +1 -1
  23. package/components/checkbox/index.js +2 -2
  24. package/components/class-map-Buyb1CLm.cjs +22 -0
  25. package/components/class-map-CJko4aXp.js +51 -0
  26. package/components/{close-button-DOA-6eL0.cjs → close-button-BQJ2wHkM.cjs} +1 -1
  27. package/components/{close-button-DU58NTKR.js → close-button-DN2cjFRq.js} +1 -1
  28. package/components/color-area/index.js +1 -1
  29. package/components/color-field/index.cjs +1 -1
  30. package/components/color-field/index.js +2 -2
  31. package/components/color-handle/index.js +1 -1
  32. package/components/color-loupe/index.js +1 -1
  33. package/components/color-menu/index.js +1 -1
  34. package/components/color-picker/index.js +1 -1
  35. package/components/color-slider/index.js +1 -1
  36. package/components/date-time-picker/date-time-picker.d.ts +269 -0
  37. package/components/date-time-picker/helpers.d.ts +10 -0
  38. package/components/date-time-picker/index.cjs +105 -0
  39. package/components/date-time-picker/index.d.ts +7 -0
  40. package/components/date-time-picker/index.js +1126 -0
  41. package/components/date-time-picker/segments/date/day-segment.d.ts +9 -0
  42. package/components/date-time-picker/segments/date/month-segment.d.ts +9 -0
  43. package/components/date-time-picker/segments/date/year-segment.d.ts +12 -0
  44. package/components/date-time-picker/segments/date-time-segments.d.ts +35 -0
  45. package/components/date-time-picker/segments/editable-segment.d.ts +21 -0
  46. package/components/date-time-picker/segments/literal-segment.d.ts +6 -0
  47. package/components/date-time-picker/segments/modifiers/clear-modifier.d.ts +5 -0
  48. package/components/date-time-picker/segments/modifiers/decrement-modifier.d.ts +5 -0
  49. package/components/date-time-picker/segments/modifiers/increment-modifier.d.ts +5 -0
  50. package/components/date-time-picker/segments/modifiers/input-modifier.d.ts +13 -0
  51. package/components/date-time-picker/segments/modifiers/segments-modifier.d.ts +18 -0
  52. package/components/date-time-picker/segments/segments-factory.d.ts +16 -0
  53. package/components/date-time-picker/segments/segments-formatter.d.ts +17 -0
  54. package/components/date-time-picker/segments/time/day-period-segment.d.ts +18 -0
  55. package/components/date-time-picker/segments/time/hour-segment.d.ts +19 -0
  56. package/components/date-time-picker/segments/time/millisecond-segment.d.ts +7 -0
  57. package/components/date-time-picker/segments/time/minute-segment.d.ts +7 -0
  58. package/components/date-time-picker/segments/time/second-segment.d.ts +7 -0
  59. package/components/date-time-picker/types.d.ts +41 -0
  60. package/components/divider/index.js +1 -1
  61. package/components/field-group/index.js +1 -1
  62. package/components/field-label/index.js +1 -1
  63. package/components/icon/index.cjs +1 -1
  64. package/components/icon/index.js +2 -2
  65. package/components/index-BziWAe4P.cjs +113 -0
  66. package/components/index-vWdA-LXe.js +1490 -0
  67. package/components/index.cjs +1 -1
  68. package/components/index.js +135 -129
  69. package/components/infield-button/index.cjs +1 -1
  70. package/components/infield-button/index.js +2 -2
  71. package/components/label/index.js +1 -1
  72. package/components/menu/index.cjs +66 -1
  73. package/components/menu/index.js +874 -10
  74. package/components/multi-language-field/index.js +1 -1
  75. package/components/number-field/index.cjs +6 -6
  76. package/components/number-field/index.js +128 -394
  77. package/components/observe-slot-presence-CmVi0zTc.js +68 -0
  78. package/components/observe-slot-presence-bc9chhsi.cjs +18 -0
  79. package/components/overlay/index.js +1 -1
  80. package/components/picker/index.cjs +1 -1
  81. package/components/picker/index.js +3 -3
  82. package/components/{picker-C9HmjRgR.js → picker-BxEG2NdV.js} +110 -138
  83. package/components/picker-DROquiIZ.cjs +123 -0
  84. package/components/picker-button/index.cjs +37 -0
  85. package/components/picker-button/index.d.ts +7 -0
  86. package/components/picker-button/index.js +87 -0
  87. package/components/picker-button/picker-button.d.ts +21 -0
  88. package/components/popover/index.js +1 -1
  89. package/components/progress-circle/index.js +1 -1
  90. package/components/radio/index.cjs +1 -1
  91. package/components/radio/index.js +2 -2
  92. package/components/search/index.cjs +1 -1
  93. package/components/search/index.js +3 -3
  94. package/components/slider/index.js +1 -1
  95. package/components/swatch/index.cjs +1 -1
  96. package/components/swatch/index.js +2 -2
  97. package/components/switch/index.cjs +1 -1
  98. package/components/switch/index.js +2 -2
  99. package/components/tags/index.cjs +1 -1
  100. package/components/tags/index.js +2 -2
  101. package/components/text-field/index.cjs +1 -1
  102. package/components/text-field/index.js +3 -3
  103. package/components/text-field-BTnBJoP9.js +314 -0
  104. package/components/text-field-mxJCYues.cjs +85 -0
  105. package/components/text-field.module-ColtFhf_.js +21 -0
  106. package/components/text-field.module-p_VF2tC_.cjs +18 -0
  107. package/components/toast/index.cjs +1 -1
  108. package/components/toast/index.js +3 -3
  109. package/components/tooltip/index.js +1 -1
  110. package/components/unit-input/index.cjs +1 -1
  111. package/components/unit-input/index.js +2 -2
  112. package/custom-elements.json +1 -1
  113. package/index.d.ts +3 -0
  114. package/package.json +16 -1
  115. package/components/index-4SZZSkew.cjs +0 -83
  116. package/components/index-AM-58E5r.js +0 -936
  117. package/components/picker-B05XA8I1.cjs +0 -127
  118. package/components/text-field-5_ev9way.cjs +0 -85
  119. package/components/text-field-CvKSS59x.js +0 -313
@@ -15,18 +15,882 @@
15
15
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
16
16
  * SOFTWARE.
17
17
  * */
18
- import { L as u, a as m, b as c, c as z, M as n } from "../index-AM-58E5r.js";
19
- const l = () => {
18
+ import { a as x, r as f, x as d, n as a, E as k } from "../base-CawdqE7p.js";
19
+ import { e as g } from "../query-D_KR_GUc.js";
20
+ import { S as I } from "../sized-mixin-BxMraZLS.js";
21
+ import { s as M } from "../divider.module-DwOuLGU3.js";
22
+ import { r as A } from "../state-CYxk12SV.js";
23
+ import { n as C } from "../query-assigned-nodes-C76XVPWY.js";
24
+ import { r as w } from "../random-id-ByCz1xaq.js";
25
+ import { s as D } from "../mutation-controller-DH7YOCyj.js";
26
+ import { F as R } from "../focusable-cj2QhwDT.js";
27
+ import { L as O } from "../like-anchor-QBlvwFfT.js";
28
+ import { O as P } from "../observe-slot-presence-CmVi0zTc.js";
29
+ import { O as L } from "../observe-slot-text-ggb4kKgY.js";
30
+ import { D as U } from "../dependency-manger-CEXvGQUV.js";
31
+ import { luzmoIcon as y, luzmoAngleRight as T, luzmoCheck as _ } from "@luzmo/icons";
32
+ import { S as $ } from "../slottable-request-event-DggLA4Rx.js";
33
+ const E = () => {
20
34
  if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
21
- const o = document.createElement("style");
22
- o.setAttribute("data-luzmo-vars", ""), o.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-color-disabled);--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-color-negative: #ca221c;--luzmo-color-negative-hover: #b3241f;--luzmo-color-negative-down: #9f231f;--luzmo-color-negative-focus: #b3241f;--luzmo-color-negative-rgb: 202, 34, 28;--luzmo-color-positive: rgb(20, 150, 101);--luzmo-color-positive-hover: rgb(17, 128, 86);--luzmo-color-positive-down: rgb(16, 105, 71);--luzmo-color-positive-focus: rgb(17, 128, 86);--luzmo-color-positive-rgb: 20, 150, 101;--luzmo-color-selected: rgb(110, 110, 110);--luzmo-color-selected-hover: rgb(70, 70, 70);--luzmo-color-selected-down: rgb(40, 40, 40);--luzmo-color-selected-focus: rgb(70, 70, 70);--luzmo-color-selected-hard: #1e1e1e;--luzmo-color-selected-hard-hover: rgb(0, 0, 0);--luzmo-color-selected-hard-down: rgb(0, 0, 0);--luzmo-color-selected-hard-focus: rgb(0, 0, 0);--luzmo-color-informative: #1a77e9;--luzmo-color-informative-rgb: 26, 119, 233;--luzmo-color-disabled: #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(o);
35
+ const r = document.createElement("style");
36
+ r.setAttribute("data-luzmo-vars", ""), r.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(r);
23
37
  }
24
38
  };
25
- l();
39
+ E();
40
+ const B = ":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-disabled-color);--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-icon: calc( ( var(--menu-item-min-height) - var(--menu-item-top-edge-to-text) - var( --menu-item-bottom-edge-to-text ) - var(--menu-item-icon-height) ) / 2 );--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-icon: calc( ( var(--menu-item-min-height) - var(--menu-item-top-edge-to-text) - var( --menu-item-bottom-edge-to-text ) - var(--menu-item-icon-height) ) / 2 );--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-icon: calc( ( var(--menu-item-min-height) - var(--menu-item-top-edge-to-text) - var( --menu-item-bottom-edge-to-text ) - var(--menu-item-icon-height) ) / 2 );--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(--luzmo-font-size-xl);--menu-item-icon-width: var(--luzmo-font-size-xl);--menu-item-label-font-size: var(--luzmo-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(--luzmo-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(--luzmo-font-size);--menu-item-angle-size: var(--luzmo-font-size-xl);--menu-item-top-to-icon: calc( ( var(--menu-item-min-height) - var(--menu-item-top-edge-to-text) - var( --menu-item-bottom-edge-to-text ) - var(--menu-item-icon-height) ) / 2 );--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-checkmark-display: var(--menu-checkmark-display-hidden);--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 )}:host([variant=highlight]) ::slotted(luzmo-menu-item[selected]){padding-inline-start:var(--luzmo-menu-item-label-inline-edge-to-content, var(--menu-item-label-inline-edge-to-content));background-color:var(--luzmo-menu-item-highlight-label-background-color, var(--menu-item-highlight-label-background-color, var(--luzmo-border-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}";
41
+ var F = Object.defineProperty, j = Object.getOwnPropertyDescriptor, u = (r, e, t, o) => {
42
+ for (var i = o > 1 ? void 0 : o ? j(e, t) : e, n = r.length - 1, l; n >= 0; n--)
43
+ (l = r[n]) && (i = (o ? l(e, t, i) : l(i)) || i);
44
+ return o && i && F(e, t, i), i;
45
+ };
46
+ function H(r, e) {
47
+ return !!e && (r === e || r.contains(e));
48
+ }
49
+ class c extends I(x, {
50
+ noDefaultSize: !0
51
+ }) {
52
+ constructor() {
53
+ 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) => {
54
+ e.stopPropagation(), e.composedPath()[0].dispatchEvent(
55
+ new Event("luzmo-menu-submenu-closed", {
56
+ bubbles: !0,
57
+ composed: !0
58
+ })
59
+ );
60
+ }, this.handleSubmenuOpened = (e) => {
61
+ e.stopPropagation(), e.composedPath()[0].dispatchEvent(
62
+ new Event("luzmo-menu-submenu-opened", {
63
+ bubbles: !0,
64
+ composed: !0
65
+ })
66
+ );
67
+ const o = this.childItems[this.focusedItemIndex];
68
+ o && (o.focused = !1);
69
+ const i = e.composedPath().find((l) => this.childItemSet.has(l));
70
+ if (!i)
71
+ return;
72
+ const n = this.childItems.indexOf(
73
+ i
74
+ );
75
+ this.focusedItemIndex = n, this.focusInItemIndex = n;
76
+ }, this.resolveCacheUpdated = () => {
77
+ }, this.addEventListener(
78
+ "luzmo-menu-item-added-or-updated",
79
+ this.onSelectableItemAddedOrUpdated
80
+ ), this.addEventListener(
81
+ "luzmo-menu-item-added-or-updated",
82
+ this.onFocusableItemAddedOrUpdated,
83
+ {
84
+ capture: !0
85
+ }
86
+ ), 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);
87
+ }
88
+ static get styles() {
89
+ return [f(B)];
90
+ }
91
+ get isSubmenu() {
92
+ return this.slot === "submenu";
93
+ }
94
+ get selected() {
95
+ return this._selected;
96
+ }
97
+ set selected(e) {
98
+ if (e === this.selected)
99
+ return;
100
+ const t = this.selected;
101
+ this._selected = e, this.selectedItems = [], this.selectedItemsMap.clear(), this.childItems.forEach((o) => {
102
+ this === o.menuData.selectionRoot && (o.selected = this.selected.includes(o.value), o.selected && (this.selectedItems.push(o), this.selectedItemsMap.set(o, !0)));
103
+ }), this.requestUpdate("selected", t);
104
+ }
105
+ get childItems() {
106
+ return this.cachedChildItems || (this.cachedChildItems = this.updateCachedMenuItems()), this.cachedChildItems;
107
+ }
108
+ /**
109
+ * Hide this getter from web-component-analyzer until
110
+ * https://github.com/runem/web-component-analyzer/issues/131
111
+ * has been addressed.
112
+ *
113
+ * @private
114
+ */
115
+ get childRole() {
116
+ if (this.resolvedRole === "listbox")
117
+ return "option";
118
+ switch (this.resolvedSelects) {
119
+ case "single":
120
+ return "menuitemradio";
121
+ case "multiple":
122
+ return "menuitemcheckbox";
123
+ default:
124
+ return "menuitem";
125
+ }
126
+ }
127
+ get ownRole() {
128
+ return "menu";
129
+ }
130
+ focus({ preventScroll: e } = {}) {
131
+ if (this.childItems.every((o) => o.disabled))
132
+ return;
133
+ if (this.childItems.some((o) => o.menuData.focusRoot !== this)) {
134
+ super.focus({ preventScroll: e });
135
+ return;
136
+ }
137
+ this.focusMenuItemByOffset(0), super.focus({ preventScroll: e });
138
+ const t = this.selectedItems[0];
139
+ t && !e && t.scrollIntoView({ block: "nearest" });
140
+ }
141
+ handleFocusin(e) {
142
+ var i;
143
+ if (this.childItems.some((n) => n.menuData.focusRoot !== this))
144
+ return;
145
+ const t = this.getRootNode().activeElement, o = ((i = this.childItems[this.focusedItemIndex]) == null ? void 0 : i.menuData.selectionRoot) || this;
146
+ if ((t !== o || e.target !== this) && (o.focus({ preventScroll: !0 }), t && this.focusedItemIndex === 0)) {
147
+ const n = this.childItems.indexOf(t);
148
+ this.focusMenuItemByOffset(Math.max(n, 0));
149
+ }
150
+ this.startListeningToKeyboard();
151
+ }
152
+ startListeningToKeyboard() {
153
+ this.addEventListener("keydown", this.handleKeydown);
154
+ }
155
+ handleBlur(e) {
156
+ H(this, e.relatedTarget) || (this.stopListeningToKeyboard(), this.childItems.forEach((t) => t.focused = !1), this.removeAttribute("aria-activedescendant"));
157
+ }
158
+ stopListeningToKeyboard() {
159
+ this.removeEventListener("keydown", this.handleKeydown);
160
+ }
161
+ selectOrToggleItem(e) {
162
+ const t = this.resolvedSelects, o = new Map(this.selectedItemsMap), i = [...this.selected], n = [...this.selectedItems], l = this.value, h = this.childItems[this.focusedItemIndex];
163
+ if (h && (h.focused = !1, h.active = !1), this.focusedItemIndex = this.childItems.indexOf(e), this.forwardFocusVisibleToItem(e), t === "multiple") {
164
+ this.selectedItemsMap.has(e) ? this.selectedItemsMap.delete(e) : this.selectedItemsMap.set(e, !0);
165
+ const v = [], z = [];
166
+ this.childItemSet.forEach((p) => {
167
+ p.menuData.selectionRoot === this && this.selectedItemsMap.has(p) && (v.push(p.value), z.push(p));
168
+ }), this._selected = v, this.selectedItems = z, this.value = this.selected.join(this.valueSeparator);
169
+ } else
170
+ this.selectedItemsMap.clear(), this.selectedItemsMap.set(e, !0), this.value = e.value, this._selected = [e.value], this.selectedItems = [e];
171
+ if (!this.dispatchEvent(
172
+ new Event("change", {
173
+ cancelable: !0,
174
+ bubbles: !0,
175
+ composed: !0
176
+ })
177
+ )) {
178
+ this._selected = i, this.selectedItems = n, this.selectedItemsMap = o, this.value = l;
179
+ return;
180
+ }
181
+ if (t === "single") {
182
+ for (const v of o.keys())
183
+ v !== e && (v.selected = !1);
184
+ e.selected = !0;
185
+ } else t === "multiple" && (e.selected = !e.selected);
186
+ }
187
+ handleKeydown(e) {
188
+ if (e.defaultPrevented)
189
+ return;
190
+ const t = this.childItems[this.focusedItemIndex];
191
+ t && (t.focused = !0);
192
+ const { key: o } = e;
193
+ if (e.shiftKey && e.target !== this && this.hasAttribute("tabindex")) {
194
+ this.removeAttribute("tabindex");
195
+ const i = (n) => {
196
+ !n.shiftKey && !this.hasAttribute("tabindex") && (this.tabIndex = 0, document.removeEventListener("keyup", i), this.removeEventListener("focusout", i));
197
+ };
198
+ document.addEventListener("keyup", i), this.addEventListener("focusout", i);
199
+ }
200
+ if (o === "Tab") {
201
+ this.prepareToCleanUp();
202
+ return;
203
+ }
204
+ if (o === " " && (t != null && t.hasSubmenu)) {
205
+ t.openOverlay();
206
+ return;
207
+ }
208
+ if (o === " " || o === "Enter") {
209
+ const i = this.childItems[this.focusedItemIndex];
210
+ i && i.menuData.selectionRoot === e.target && (e.preventDefault(), i.click());
211
+ return;
212
+ }
213
+ if (o === "ArrowDown" || o === "ArrowUp") {
214
+ const i = this.childItems[this.focusedItemIndex];
215
+ i && i.menuData.selectionRoot === e.target && this.navigateWithinMenu(e);
216
+ return;
217
+ }
218
+ this.navigateBetweenRelatedMenus(e);
219
+ }
220
+ focusMenuItemByOffset(e) {
221
+ const t = e || 1, o = this.childItems[this.focusedItemIndex];
222
+ o && (o.focused = !1, o.active = o.open), this.focusedItemIndex = (this.childItems.length + this.focusedItemIndex + e) % this.childItems.length;
223
+ let i = this.childItems[this.focusedItemIndex], n = this.childItems.length;
224
+ for (; i != null && i.disabled && n; )
225
+ n -= 1, this.focusedItemIndex = (this.childItems.length + this.focusedItemIndex + t) % this.childItems.length, i = this.childItems[this.focusedItemIndex];
226
+ return i != null && i.disabled || this.forwardFocusVisibleToItem(i), i;
227
+ }
228
+ updateSelectedItemIndex() {
229
+ let e = 0;
230
+ const t = /* @__PURE__ */ new Map(), o = [], i = [];
231
+ let n = this.childItems.length;
232
+ for (; n; ) {
233
+ n -= 1;
234
+ const l = this.childItems[n];
235
+ 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));
236
+ }
237
+ i.map((l, h) => {
238
+ h > 0 && (l.focused = !1);
239
+ }), this.selectedItemsMap = t, this._selected = o, this.selectedItems = i, this.value = this.selected.join(this.valueSeparator), this.focusedItemIndex = e, this.focusInItemIndex = e;
240
+ }
241
+ closeDescendentOverlays() {
242
+ this.descendentOverlays.forEach((e) => {
243
+ e.open = !1;
244
+ }), this.descendentOverlays = /* @__PURE__ */ new Map();
245
+ }
246
+ render() {
247
+ return this.renderMenuItemSlot();
248
+ }
249
+ connectedCallback() {
250
+ super.connectedCallback(), !this.hasAttribute("role") && !this.ignore && this.setAttribute("role", this.ownRole), this.updateComplete.then(() => this.updateItemFocus());
251
+ }
252
+ disconnectedCallback() {
253
+ this.cachedChildItems = void 0, this.selectedItems = [], this.selectedItemsMap.clear(), this.childItemSet.clear(), this.descendentOverlays = /* @__PURE__ */ new Map(), super.disconnectedCallback();
254
+ }
255
+ handleDescendentOverlayOpened(e) {
256
+ const t = e.composedPath()[0];
257
+ t.overlayElement && this.descendentOverlays.set(t.overlayElement, t.overlayElement);
258
+ }
259
+ handleDescendentOverlayClosed(e) {
260
+ const t = e.composedPath()[0];
261
+ t.overlayElement && this.descendentOverlays.delete(t.overlayElement);
262
+ }
263
+ navigateWithinMenu(e) {
264
+ const { key: t } = e, o = this.childItems[this.focusedItemIndex], i = t === "ArrowDown" ? 1 : -1, n = this.focusMenuItemByOffset(i);
265
+ n !== o && (e.preventDefault(), e.stopPropagation(), n.scrollIntoView({ block: "nearest" }));
266
+ }
267
+ navigateBetweenRelatedMenus(e) {
268
+ const { key: t } = e;
269
+ e.stopPropagation();
270
+ const o = this.isLTR && t === "ArrowRight" || !this.isLTR && t === "ArrowLeft", i = this.isLTR && t === "ArrowLeft" || !this.isLTR && t === "ArrowRight";
271
+ if (o) {
272
+ const n = this.childItems[this.focusedItemIndex];
273
+ n != null && n.hasSubmenu && n.openOverlay();
274
+ } else i && this.isSubmenu && (this.dispatchEvent(new Event("close", { bubbles: !0 })), this.updateSelectedItemIndex());
275
+ }
276
+ renderMenuItemSlot() {
277
+ return d`
278
+ <slot
279
+ @luzmo-menu-submenu-opened=${this.handleDescendentOverlayOpened}
280
+ @luzmo-menu-submenu-closed=${this.handleDescendentOverlayClosed}
281
+ @slotchange=${this.handleSlotchange}
282
+ ></slot>
283
+ `;
284
+ }
285
+ firstUpdated(e) {
286
+ if (super.firstUpdated(e), !this.hasAttribute("tabindex") && !this.ignore) {
287
+ const o = this.getAttribute("role");
288
+ this.tabIndex = o === "group" ? -1 : 0;
289
+ }
290
+ const t = [
291
+ new Promise((o) => requestAnimationFrame(() => o(!0)))
292
+ ];
293
+ [...this.children].forEach((o) => {
294
+ o.localName === "luzmo-menu-item" && t.push(o.updateComplete);
295
+ }), this.childItemsUpdated = Promise.all(t);
296
+ }
297
+ updated(e) {
298
+ 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"));
299
+ }
300
+ selectsChanged() {
301
+ const e = [
302
+ new Promise((t) => requestAnimationFrame(() => t(!0)))
303
+ ];
304
+ this.childItemSet.forEach((t) => {
305
+ e.push(t.triggerUpdate());
306
+ }), this.childItemsUpdated = Promise.all(e);
307
+ }
308
+ async getUpdateComplete() {
309
+ const e = await super.getUpdateComplete();
310
+ return await this.childItemsUpdated, await this.cacheUpdated, e;
311
+ }
312
+ updateCachedMenuItems() {
313
+ if (this.cachedChildItems = [], !this.menuSlot)
314
+ return [];
315
+ const e = this.menuSlot.assignedElements({
316
+ flatten: !0
317
+ });
318
+ for (const [t, o] of e.entries()) {
319
+ if (this.childItemSet.has(o)) {
320
+ this.cachedChildItems.push(o);
321
+ continue;
322
+ }
323
+ const n = o.localName === "slot" ? o.assignedElements({
324
+ flatten: !0
325
+ }) : [...o.querySelectorAll(":scope > *")];
326
+ e.splice(
327
+ t,
328
+ 1,
329
+ o,
330
+ ...n
331
+ );
332
+ }
333
+ return this.cachedChildItems;
334
+ }
335
+ /**
336
+ * When a descendant `<luzmo-menu-item>` element is added or updated it will dispatch
337
+ * this event to announce its presence in the DOM. During the CAPTURE phase the first
338
+ * Menu based element that the event encounters will manage the focus state of the
339
+ * dispatching `<luzmo-menu-item>` element.
340
+ * @param event
341
+ */
342
+ onFocusableItemAddedOrUpdated(e) {
343
+ e.menuCascade.set(this, {
344
+ hadFocusRoot: !!e.item.menuData.focusRoot,
345
+ ancestorWithSelects: e.currentAncestorWithSelects
346
+ }), this.selects && (e.currentAncestorWithSelects = this), e.item.menuData.focusRoot = e.item.menuData.focusRoot || this;
347
+ }
348
+ /**
349
+ * When a descendant `<luzmo-menu-item>` element is added or updated it will dispatch
350
+ * this event to announce its presence in the DOM. During the BUBBLE phase the first
351
+ * Menu based element that the event encounters that does not inherit selection will
352
+ * manage the selection state of the dispatching `<luzmo-menu-item>` element.
353
+ * @param event
354
+ */
355
+ onSelectableItemAddedOrUpdated(e) {
356
+ var i, n;
357
+ const t = e.menuCascade.get(this);
358
+ if (!t)
359
+ return;
360
+ if (e.item.menuData.parentMenu = e.item.menuData.parentMenu || this, t.hadFocusRoot && !this.ignore && (this.tabIndex = -1), this.addChildItem(e.item), this.selects === "inherit") {
361
+ this.resolvedSelects = "inherit";
362
+ const l = (i = e.currentAncestorWithSelects) == null ? void 0 : i.ignore;
363
+ this.resolvedRole = l ? "none" : ((n = e.currentAncestorWithSelects) == null ? void 0 : n.getAttribute("role")) || this.getAttribute("role") || void 0;
364
+ } 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");
365
+ const o = this.resolvedSelects === "single" || this.resolvedSelects === "multiple";
366
+ e.item.menuData.cleanupSteps.push(
367
+ (l) => this.removeChildItem(l)
368
+ ), (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)));
369
+ }
370
+ addChildItem(e) {
371
+ this.childItemSet.add(e), this.handleItemsChanged();
372
+ }
373
+ async removeChildItem(e) {
374
+ this.childItemSet.delete(e), this.cachedChildItems = void 0, e.focused && (this.handleItemsChanged(), await this.updateComplete, this.focus());
375
+ }
376
+ handleClick(e) {
377
+ if (this.pointerUpTarget === e.target) {
378
+ this.pointerUpTarget = null;
379
+ return;
380
+ }
381
+ this.handlePointerBasedSelection(e);
382
+ }
383
+ handlePointerup(e) {
384
+ this.pointerUpTarget = e.target, this.handlePointerBasedSelection(e);
385
+ }
386
+ handlePointerBasedSelection(e) {
387
+ var i, n;
388
+ if (e instanceof MouseEvent && e.button !== 0)
389
+ return;
390
+ const o = e.composedPath().find((l) => l instanceof Element ? l.getAttribute("role") === this.childRole : !1);
391
+ if (e.defaultPrevented) {
392
+ const l = this.childItems.indexOf(o);
393
+ ((i = o == null ? void 0 : o.menuData) == null ? void 0 : i.focusRoot) === this && l !== -1 && (this.focusedItemIndex = l);
394
+ return;
395
+ }
396
+ if (o != null && o.href && o.href.length > 0) {
397
+ this.dispatchEvent(
398
+ new Event("change", {
399
+ bubbles: !0,
400
+ composed: !0
401
+ })
402
+ );
403
+ return;
404
+ } else if (((n = o == null ? void 0 : o.menuData) == null ? void 0 : n.selectionRoot) === this && this.childItems.length > 0) {
405
+ if (e.preventDefault(), o.hasSubmenu || o.open)
406
+ return;
407
+ this.selectOrToggleItem(o);
408
+ } else
409
+ return;
410
+ this.prepareToCleanUp();
411
+ }
412
+ prepareToCleanUp() {
413
+ document.addEventListener(
414
+ "focusout",
415
+ () => {
416
+ requestAnimationFrame(() => {
417
+ const e = this.childItems[this.focusedItemIndex];
418
+ e && (e.focused = !1, this.updateSelectedItemIndex());
419
+ });
420
+ },
421
+ { once: !0 }
422
+ );
423
+ }
424
+ handleItemsChanged() {
425
+ this.cachedChildItems = void 0, this._willUpdateItems || (this._willUpdateItems = !0, this.cacheUpdated = this.updateCache());
426
+ }
427
+ async updateCache() {
428
+ await (this.hasUpdated ? new Promise((e) => requestAnimationFrame(() => e(!0))) : Promise.all([
429
+ new Promise((e) => requestAnimationFrame(() => e(!0))),
430
+ this.updateComplete
431
+ ])), this.cachedChildItems === void 0 && (this.updateSelectedItemIndex(), this.updateItemFocus()), this._willUpdateItems = !1;
432
+ }
433
+ updateItemFocus() {
434
+ if (this.childItems.length === 0)
435
+ return;
436
+ const e = this.childItems[this.focusInItemIndex];
437
+ this.getRootNode().activeElement === e.menuData.focusRoot && this.forwardFocusVisibleToItem(e);
438
+ }
439
+ forwardFocusVisibleToItem(e) {
440
+ if (!e || e.menuData.focusRoot !== this)
441
+ return;
442
+ this.closeDescendentOverlays();
443
+ const t = this.hasVisibleFocusInTree() || !!this.childItems.some((o) => o.hasVisibleFocusInTree());
444
+ e.focused = t, this.setAttribute("aria-activedescendant", e.id), e.menuData.selectionRoot && e.menuData.selectionRoot !== this && e.menuData.selectionRoot.focus();
445
+ }
446
+ handleSlotchange({
447
+ target: e
448
+ }) {
449
+ const t = e.assignedElements({
450
+ flatten: !0
451
+ });
452
+ this.childItems.length !== t.length && t.forEach((o) => {
453
+ o.triggerUpdate !== void 0 ? o.triggerUpdate() : o.childItems !== void 0 && o.childItems.forEach((i) => {
454
+ i.triggerUpdate();
455
+ });
456
+ });
457
+ }
458
+ }
459
+ u([
460
+ a({ type: String, reflect: !0 })
461
+ ], c.prototype, "label", 2);
462
+ u([
463
+ a({ type: Boolean, reflect: !0 })
464
+ ], c.prototype, "ignore", 2);
465
+ u([
466
+ a({ type: String, reflect: !0 })
467
+ ], c.prototype, "variant", 2);
468
+ u([
469
+ a({ type: String, reflect: !0 })
470
+ ], c.prototype, "selects", 2);
471
+ u([
472
+ a({ type: String })
473
+ ], c.prototype, "value", 2);
474
+ u([
475
+ a({ type: String, attribute: "value-separator" })
476
+ ], c.prototype, "valueSeparator", 2);
477
+ u([
478
+ a({ attribute: !1 })
479
+ ], c.prototype, "selected", 1);
480
+ u([
481
+ a({ attribute: !1 })
482
+ ], c.prototype, "selectedItems", 2);
483
+ u([
484
+ g("slot:not([name])")
485
+ ], c.prototype, "menuSlot", 2);
486
+ const q = ":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}";
487
+ class N extends I(x, {
488
+ validSizes: ["s", "m", "l"]
489
+ }) {
490
+ static get styles() {
491
+ return [f(M), f(q)];
492
+ }
493
+ firstUpdated(e) {
494
+ super.firstUpdated(e), this.setAttribute("role", "separator");
495
+ }
496
+ }
497
+ const V = ".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}";
498
+ var W = Object.defineProperty, S = (r, e, t, o) => {
499
+ for (var i = void 0, n = r.length - 1, l; n >= 0; n--)
500
+ (l = r[n]) && (i = l(e, t, i) || i);
501
+ return i && W(e, t, i), i;
502
+ };
503
+ class b extends c {
504
+ constructor() {
505
+ super(...arguments), this.headerId = "";
506
+ }
507
+ static get styles() {
508
+ return [...super.styles, f(V)];
509
+ }
510
+ render() {
511
+ return d`
512
+ <span class="header" ?hidden=${!this.headerElement}>
513
+ <slot name="header" @slotchange=${this.updateLabel}></slot>
514
+ </span>
515
+ <luzmo-menu
516
+ size=${this.size}
517
+ .variant=${this.variant}
518
+ .selects=${this.selects}
519
+ ignore
520
+ >${this.renderMenuItemSlot()}</luzmo-menu
521
+ >
522
+ `;
523
+ }
524
+ get ownRole() {
525
+ switch (this.selects) {
526
+ case "multiple":
527
+ case "single":
528
+ case "inherit":
529
+ return "group";
530
+ default:
531
+ return "menu";
532
+ }
533
+ }
534
+ updateLabel() {
535
+ const e = this.headerElements.length > 0 ? this.headerElements[0] : void 0;
536
+ if (e !== this.headerElement)
537
+ if (this.headerElement && this.headerElement.id === this.headerId && this.headerElement.removeAttribute("id"), e) {
538
+ this.headerId = this.headerId || `luzmo-menu-group-label-${w()}`;
539
+ const t = e.id || this.headerId;
540
+ e.id || (e.id = t), this.setAttribute("aria-labelledby", t);
541
+ } else
542
+ this.removeAttribute("aria-labelledby");
543
+ this.headerElement = e;
544
+ }
545
+ }
546
+ S([
547
+ C({
548
+ slot: "header",
549
+ flatten: !0
550
+ })
551
+ ], b.prototype, "headerElements");
552
+ S([
553
+ A()
554
+ ], b.prototype, "headerElement");
555
+ const K = '.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));margin-block-start:var(--luzmo-menu-item-top-to-icon, var(--menu-item-top-to-icon));block-size:var(--luzmo-menu-item-icon-size, var(--menu-item-icon-height));inline-size:var(--luzmo-menu-item-icon-width, var(--menu-item-icon-height));font-size:var(--luzmo-menu-item-icon-size, var(--menu-item-icon-height));text-align:center;--luzmo-icon-vertical-align: 0}: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}';
556
+ var G = Object.defineProperty, J = Object.getOwnPropertyDescriptor, m = (r, e, t, o) => {
557
+ for (var i = o > 1 ? void 0 : o ? J(e, t) : e, n = r.length - 1, l; n >= 0; n--)
558
+ (l = r[n]) && (i = (o ? l(e, t, i) : l(i)) || i);
559
+ return o && i && G(e, t, i), i;
560
+ };
561
+ const Q = 100, X = (r) => d`
562
+ <span class="icon-container icon checkmark ${r.join(" ")}">
563
+ ${y(_)}
564
+ </span>
565
+ `, Y = (r) => d`
566
+ <span class="icon-container icon angle ${r.join(" ")}">
567
+ ${y(T, { className: "indicator" })}
568
+ </span>
569
+ `;
570
+ class Z extends Event {
571
+ constructor(e) {
572
+ super("luzmo-menu-item-added-or-updated", {
573
+ bubbles: !0,
574
+ composed: !0
575
+ }), this.menuCascade = /* @__PURE__ */ new WeakMap(), this.clear(e);
576
+ }
577
+ get item() {
578
+ return this._item;
579
+ }
580
+ clear(e) {
581
+ this._item = e, this.currentAncestorWithSelects = void 0, e.menuData = {
582
+ cleanupSteps: [],
583
+ focusRoot: void 0,
584
+ selectionRoot: void 0,
585
+ parentMenu: void 0
586
+ }, this.menuCascade = /* @__PURE__ */ new WeakMap();
587
+ }
588
+ }
589
+ class s extends O(
590
+ L(P(R, '[slot="icon"]'))
591
+ ) {
592
+ constructor() {
593
+ 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 = []) => Y(e), this.renderCheckIcon = (e = []) => X(e), this.open = !1, this.handleSlottableRequest = (e) => {
594
+ var t;
595
+ (t = this.submenuElement) == null || t.dispatchEvent(
596
+ new $(e.name, e.data)
597
+ );
598
+ }, this.proxyFocus = () => {
599
+ this.focus();
600
+ }, this.handleBeforetoggle = (e) => {
601
+ e.newState === "closed" && (this.open = !0, this.overlayElement.manuallyKeepOpen(), this.overlayElement.removeEventListener(
602
+ "beforetoggle",
603
+ this.handleBeforetoggle
604
+ ));
605
+ }, this.recentlyLeftChild = !1, this.willDispatchUpdate = !1, this.menuData = {
606
+ focusRoot: void 0,
607
+ parentMenu: void 0,
608
+ selectionRoot: void 0,
609
+ cleanupSteps: []
610
+ }, this.addEventListener("click", this.handleClickCapture, {
611
+ capture: !0
612
+ }), new D(this, {
613
+ config: {
614
+ characterData: !0,
615
+ childList: !0,
616
+ subtree: !0
617
+ },
618
+ callback: (e) => {
619
+ e.every(
620
+ (o) => o.target.slot === "submenu"
621
+ ) || this.breakItemChildrenCache();
622
+ }
623
+ });
624
+ }
625
+ static get styles() {
626
+ return [f(K)];
627
+ }
628
+ get value() {
629
+ return this._value || this.itemText;
630
+ }
631
+ set value(e) {
632
+ e !== this._value && (this._value = e || "", this._value ? this.setAttribute("value", this._value) : this.removeAttribute("value"));
633
+ }
634
+ /**
635
+ * @private
636
+ */
637
+ get itemText() {
638
+ return this.itemChildren.content.reduce(
639
+ (e, t) => e + (t.textContent || "").trim(),
640
+ ""
641
+ );
642
+ }
643
+ get focusElement() {
644
+ return this;
645
+ }
646
+ get hasIcon() {
647
+ return this.slotContentIsPresent;
648
+ }
649
+ get itemChildren() {
650
+ if (!this.iconSlot || !this.contentSlot)
651
+ return {
652
+ icon: [],
653
+ content: []
654
+ };
655
+ if (this._itemChildren)
656
+ return this._itemChildren;
657
+ const e = this.iconSlot.assignedElements().map((o) => {
658
+ const i = o.cloneNode(!0);
659
+ return i.removeAttribute("slot"), i.classList.toggle("icon"), i;
660
+ }), t = this.contentSlot.assignedNodes().map((o) => o.cloneNode(!0));
661
+ return this._itemChildren = { icon: e, content: t }, this._itemChildren;
662
+ }
663
+ click() {
664
+ this.disabled || this.shouldProxyClick() || super.click();
665
+ }
666
+ handleClickCapture(e) {
667
+ if (this.disabled)
668
+ return e.preventDefault(), e.stopImmediatePropagation(), e.stopPropagation(), !1;
669
+ }
670
+ shouldProxyClick() {
671
+ let e = !1;
672
+ return this.anchorElement && (this.anchorElement.click(), e = !0), e;
673
+ }
674
+ breakItemChildrenCache() {
675
+ this._itemChildren = void 0, this.triggerUpdate();
676
+ }
677
+ renderSubmenu() {
678
+ const e = d`
679
+ <slot
680
+ name="submenu"
681
+ @slotchange=${this.manageSubmenu}
682
+ @luzmo-menu-item-added-or-updated=${{
683
+ handleEvent: (t) => {
684
+ t.clear(t.item);
685
+ },
686
+ capture: !0
687
+ }}
688
+ @focusin=${(t) => t.stopPropagation()}
689
+ ></slot>
690
+ `;
691
+ return this.hasSubmenu ? (this.dependencyManager.add("luzmo-overlay"), this.dependencyManager.add("luzmo-popover"), import("../overlay-CJ9by37f.js").then((t) => t.f), import("../popover-Bx4ZDHk4.js"), d`
692
+ <luzmo-overlay
693
+ .triggerElement=${this}
694
+ ?disabled=${!this.hasSubmenu}
695
+ ?open=${this.hasSubmenu && this.open && this.dependencyManager.loaded}
696
+ .placement=${this.isLTR ? "right-start" : "left-start"}
697
+ .offset=${[-10, -5]}
698
+ .type=${"auto"}
699
+ @close=${(t) => t.stopPropagation()}
700
+ @slottable-request=${this.handleSlottableRequest}
701
+ >
702
+ <luzmo-popover
703
+ @change=${(t) => {
704
+ this.handleSubmenuChange(t), this.open = !1;
705
+ }}
706
+ @pointerenter=${this.handleSubmenuPointerenter}
707
+ @pointerleave=${this.handleSubmenuPointerleave}
708
+ @luzmo-menu-item-added-or-updated=${(t) => t.stopPropagation()}
709
+ >
710
+ ${e}
711
+ </luzmo-popover>
712
+ </luzmo-overlay>
713
+ ${this.renderAngleIcon()}
714
+ `) : e;
715
+ }
716
+ render() {
717
+ return d`
718
+ ${this.selected ? d`
719
+ ${this.renderCheckIcon(
720
+ this.hasIcon ? ["checkmark--withAdjacentIcon"] : []
721
+ )}
722
+ ` : k}
723
+ <slot name="icon"></slot>
724
+ <div id="label">
725
+ <slot id="slot"></slot>
726
+ </div>
727
+ <slot name="description"></slot>
728
+ <slot name="value"></slot>
729
+ ${this.href && this.href.length > 0 ? super.renderAnchor({
730
+ id: "button",
731
+ ariaHidden: !0,
732
+ className: "button anchor hidden"
733
+ }) : k}
734
+ ${this.renderSubmenu()}
735
+ `;
736
+ }
737
+ manageSubmenu(e) {
738
+ this.submenuElement = e.target.assignedElements({
739
+ flatten: !0
740
+ })[0], this.hasSubmenu = !!this.submenuElement, this.hasSubmenu && this.setAttribute("aria-haspopup", "true");
741
+ }
742
+ handlePointerdown(e) {
743
+ e.target === this && this.hasSubmenu && this.open && (this.addEventListener("focus", this.handleSubmenuFocus, {
744
+ once: !0
745
+ }), this.overlayElement.addEventListener(
746
+ "beforetoggle",
747
+ this.handleBeforetoggle
748
+ ));
749
+ }
750
+ firstUpdated(e) {
751
+ 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-${w()}`);
752
+ }
753
+ closeOverlaysForRoot() {
754
+ var e;
755
+ this.open || (e = this.menuData.parentMenu) == null || e.closeDescendentOverlays();
756
+ }
757
+ handleSubmenuClick(e) {
758
+ e.composedPath().includes(this.overlayElement) || this.openOverlay();
759
+ }
760
+ handleSubmenuFocus() {
761
+ requestAnimationFrame(() => {
762
+ this.overlayElement.open = this.open;
763
+ });
764
+ }
765
+ handlePointerenter() {
766
+ if (this.leaveTimeout) {
767
+ clearTimeout(this.leaveTimeout), delete this.leaveTimeout;
768
+ return;
769
+ }
770
+ this.openOverlay();
771
+ }
772
+ handlePointerleave() {
773
+ this.open && !this.recentlyLeftChild && (this.leaveTimeout = setTimeout(() => {
774
+ delete this.leaveTimeout, this.open = !1;
775
+ }, Q));
776
+ }
777
+ /**
778
+ * When there is a `change` event in the submenu for this item
779
+ * then we "click" this item to cascade the selection up the
780
+ * menu tree allowing all submenus between the initial selection
781
+ * and the root of the tree to have their selection changes and
782
+ * be closed.
783
+ */
784
+ handleSubmenuChange(e) {
785
+ var t;
786
+ e.stopPropagation(), (t = this.menuData.selectionRoot) == null || t.selectOrToggleItem(this);
787
+ }
788
+ handleSubmenuPointerenter() {
789
+ this.recentlyLeftChild = !0;
790
+ }
791
+ handleSubmenuPointerleave() {
792
+ requestAnimationFrame(() => {
793
+ this.recentlyLeftChild = !1;
794
+ });
795
+ }
796
+ handleSubmenuOpen(e) {
797
+ this.focused = !1;
798
+ const t = e.composedPath().find(
799
+ (o) => o !== this.overlayElement && o.localName === "luzmo-overlay"
800
+ );
801
+ this.overlayElement.parentOverlayToForceClose = t;
802
+ }
803
+ cleanup() {
804
+ this.open = !1, this.active = !1;
805
+ }
806
+ openOverlay() {
807
+ !this.hasSubmenu || this.open || this.disabled || (this.open = !0, this.active = !0, this.setAttribute("aria-expanded", "true"), this.addEventListener("luzmo-closed", this.cleanup, {
808
+ once: !0
809
+ }));
810
+ }
811
+ updateAriaSelected() {
812
+ const e = this.getAttribute("role");
813
+ e === "option" ? this.setAttribute("aria-selected", this.selected ? "true" : "false") : (e === "menuitemcheckbox" || e === "menuitemradio") && this.setAttribute("aria-checked", this.selected ? "true" : "false");
814
+ }
815
+ setRole(e) {
816
+ this.setAttribute("role", e), this.updateAriaSelected();
817
+ }
818
+ updated(e) {
819
+ var t, o;
820
+ 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))
821
+ if (this.hasSubmenu) {
822
+ this.abortControllerSubmenu = new AbortController();
823
+ const i = { signal: this.abortControllerSubmenu.signal };
824
+ 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);
825
+ } else
826
+ (o = this.abortControllerSubmenu) == null || o.abort();
827
+ }
828
+ connectedCallback() {
829
+ super.connectedCallback(), this.triggerUpdate();
830
+ }
831
+ disconnectedCallback() {
832
+ this.menuData.cleanupSteps.forEach((e) => e(this)), this.menuData = {
833
+ focusRoot: void 0,
834
+ parentMenu: void 0,
835
+ selectionRoot: void 0,
836
+ cleanupSteps: []
837
+ }, super.disconnectedCallback();
838
+ }
839
+ async triggerUpdate() {
840
+ this.willDispatchUpdate || (this.willDispatchUpdate = !0, await new Promise((e) => requestAnimationFrame(e)), this.dispatchUpdate());
841
+ }
842
+ dispatchUpdate() {
843
+ this.isConnected && (this.dispatchEvent(new Z(this)), this.willDispatchUpdate = !1);
844
+ }
845
+ }
846
+ m([
847
+ a({ type: Boolean, reflect: !0 })
848
+ ], s.prototype, "active", 2);
849
+ m([
850
+ a({ type: Boolean, reflect: !0 })
851
+ ], s.prototype, "focused", 2);
852
+ m([
853
+ a({ type: Boolean, reflect: !0 })
854
+ ], s.prototype, "selected", 2);
855
+ m([
856
+ a({ type: String })
857
+ ], s.prototype, "value", 1);
858
+ m([
859
+ a({ type: Boolean, reflect: !0, attribute: "has-submenu" })
860
+ ], s.prototype, "hasSubmenu", 2);
861
+ m([
862
+ g("slot:not([name])")
863
+ ], s.prototype, "contentSlot", 2);
864
+ m([
865
+ g('slot[name="icon"]')
866
+ ], s.prototype, "iconSlot", 2);
867
+ m([
868
+ a({
869
+ type: Boolean,
870
+ reflect: !0,
871
+ attribute: "no-wrap",
872
+ hasChanged() {
873
+ return !1;
874
+ }
875
+ })
876
+ ], s.prototype, "noWrap", 2);
877
+ m([
878
+ g(".anchor")
879
+ ], s.prototype, "anchorElement", 2);
880
+ m([
881
+ g("luzmo-overlay")
882
+ ], s.prototype, "overlayElement", 2);
883
+ m([
884
+ a({ type: Boolean, reflect: !0 })
885
+ ], s.prototype, "open", 2);
886
+ customElements.get("luzmo-menu") || customElements.define("luzmo-menu", c);
887
+ customElements.get("luzmo-menu-divider") || customElements.define("luzmo-menu-divider", N);
888
+ customElements.get("luzmo-menu-group") || customElements.define("luzmo-menu-group", b);
889
+ customElements.get("luzmo-menu-item") || customElements.define("luzmo-menu-item", s);
26
890
  export {
27
- u as LuzmoMenu,
28
- m as LuzmoMenuDivider,
29
- c as LuzmoMenuGroup,
30
- z as LuzmoMenuItem,
31
- n as MenuItemAddedOrUpdatedEvent
891
+ c as LuzmoMenu,
892
+ N as LuzmoMenuDivider,
893
+ b as LuzmoMenuGroup,
894
+ s as LuzmoMenuItem,
895
+ Z as MenuItemAddedOrUpdatedEvent
32
896
  };