@aurodesignsystem-dev/auro-formkit 0.0.0-pr1379.0 → 0.0.0-pr1379.10

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 (226) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/README.md +87 -113
  3. package/components/combobox/demo/keyboardBehavior.html +81 -0
  4. package/components/counter/demo/keyboardBehavior.html +81 -0
  5. package/components/datepicker/demo/keyboard-behavior.html +81 -0
  6. package/components/dropdown/demo/keyboardBehavior.html +81 -0
  7. package/components/select/demo/keyboardBehavior.html +81 -0
  8. package/package.json +64 -53
  9. package/components/bibtemplate/dist/auro-bibtemplate.d.ts +0 -66
  10. package/components/bibtemplate/dist/buttonVersion.d.ts +0 -2
  11. package/components/bibtemplate/dist/headerVersion.d.ts +0 -2
  12. package/components/bibtemplate/dist/iconVersion.d.ts +0 -2
  13. package/components/bibtemplate/dist/index.d.ts +0 -2
  14. package/components/bibtemplate/dist/index.js +0 -395
  15. package/components/bibtemplate/dist/registered.js +0 -395
  16. package/components/bibtemplate/dist/styles/color-css.d.ts +0 -2
  17. package/components/bibtemplate/dist/styles/style-css.d.ts +0 -2
  18. package/components/bibtemplate/dist/styles/tokens-css.d.ts +0 -2
  19. package/components/checkbox/demo/api.md +0 -489
  20. package/components/checkbox/demo/api.min.js +0 -2133
  21. package/components/checkbox/demo/index.md +0 -55
  22. package/components/checkbox/demo/index.min.js +0 -2108
  23. package/components/checkbox/demo/readme.md +0 -142
  24. package/components/checkbox/dist/auro-checkbox-group.d.ts +0 -176
  25. package/components/checkbox/dist/auro-checkbox.d.ts +0 -209
  26. package/components/checkbox/dist/index.d.ts +0 -3
  27. package/components/checkbox/dist/index.js +0 -2057
  28. package/components/checkbox/dist/registered.js +0 -2058
  29. package/components/checkbox/dist/styles/auro-checkbox-css.d.ts +0 -2
  30. package/components/checkbox/dist/styles/auro-checkbox-group-css.d.ts +0 -2
  31. package/components/checkbox/dist/styles/color-css.d.ts +0 -2
  32. package/components/checkbox/dist/styles/colorGroup-css.d.ts +0 -2
  33. package/components/checkbox/dist/styles/tokens-css.d.ts +0 -2
  34. package/components/combobox/demo/api.md +0 -2287
  35. package/components/combobox/demo/api.min.js +0 -17549
  36. package/components/combobox/demo/index.md +0 -196
  37. package/components/combobox/demo/index.min.js +0 -17454
  38. package/components/combobox/demo/readme.md +0 -158
  39. package/components/combobox/dist/auro-combobox.d.ts +0 -552
  40. package/components/combobox/dist/comboboxKeyboardStrategy.d.ts +0 -6
  41. package/components/combobox/dist/index.d.ts +0 -2
  42. package/components/combobox/dist/index.js +0 -15474
  43. package/components/combobox/dist/registered.js +0 -15476
  44. package/components/combobox/dist/styles/emphasized/style-css.d.ts +0 -2
  45. package/components/combobox/dist/styles/snowflake/style-css.d.ts +0 -2
  46. package/components/combobox/dist/styles/style-css.d.ts +0 -2
  47. package/components/counter/demo/api.md +0 -1285
  48. package/components/counter/demo/api.min.js +0 -7993
  49. package/components/counter/demo/index.md +0 -92
  50. package/components/counter/demo/index.min.js +0 -7974
  51. package/components/counter/demo/readme.md +0 -161
  52. package/components/counter/dist/auro-counter-button.d.ts +0 -14
  53. package/components/counter/dist/auro-counter-group.d.ts +0 -390
  54. package/components/counter/dist/auro-counter-wrapper.d.ts +0 -17
  55. package/components/counter/dist/auro-counter.d.ts +0 -126
  56. package/components/counter/dist/buttonVersion.d.ts +0 -2
  57. package/components/counter/dist/iconVersion.d.ts +0 -2
  58. package/components/counter/dist/index.d.ts +0 -3
  59. package/components/counter/dist/index.js +0 -7896
  60. package/components/counter/dist/registered.js +0 -7897
  61. package/components/counter/dist/styles/color-css.d.ts +0 -2
  62. package/components/counter/dist/styles/counter-button-color-css.d.ts +0 -2
  63. package/components/counter/dist/styles/counter-button-css.d.ts +0 -2
  64. package/components/counter/dist/styles/counter-group-css.d.ts +0 -2
  65. package/components/counter/dist/styles/counter-wrapper-color-css.d.ts +0 -2
  66. package/components/counter/dist/styles/counter-wrapper-css.d.ts +0 -2
  67. package/components/counter/dist/styles/shapeSize-css.d.ts +0 -2
  68. package/components/counter/dist/styles/style-css.d.ts +0 -2
  69. package/components/counter/dist/styles/tokens-css.d.ts +0 -2
  70. package/components/datepicker/demo/api.md +0 -1824
  71. package/components/datepicker/demo/api.min.js +0 -24530
  72. package/components/datepicker/demo/index.md +0 -158
  73. package/components/datepicker/demo/index.min.js +0 -24251
  74. package/components/datepicker/demo/readme.md +0 -137
  75. package/components/datepicker/dist/auro-calendar-cell.d.ts +0 -169
  76. package/components/datepicker/dist/auro-calendar-month.d.ts +0 -20
  77. package/components/datepicker/dist/auro-calendar.d.ts +0 -173
  78. package/components/datepicker/dist/auro-datepicker.d.ts +0 -722
  79. package/components/datepicker/dist/buttonVersion.d.ts +0 -2
  80. package/components/datepicker/dist/iconVersion.d.ts +0 -2
  81. package/components/datepicker/dist/index.d.ts +0 -2
  82. package/components/datepicker/dist/index.js +0 -24166
  83. package/components/datepicker/dist/popoverVersion.d.ts +0 -2
  84. package/components/datepicker/dist/registered.js +0 -24166
  85. package/components/datepicker/dist/styles/classic/color-css.d.ts +0 -2
  86. package/components/datepicker/dist/styles/classic/style-css.d.ts +0 -2
  87. package/components/datepicker/dist/styles/color-calendar-css.d.ts +0 -2
  88. package/components/datepicker/dist/styles/color-cell-css.d.ts +0 -2
  89. package/components/datepicker/dist/styles/color-css.d.ts +0 -2
  90. package/components/datepicker/dist/styles/color-month-css.d.ts +0 -2
  91. package/components/datepicker/dist/styles/shapeSize-css.d.ts +0 -2
  92. package/components/datepicker/dist/styles/snowflake/color-css.d.ts +0 -2
  93. package/components/datepicker/dist/styles/snowflake/style-css.d.ts +0 -2
  94. package/components/datepicker/dist/styles/style-auro-calendar-cell-css.d.ts +0 -2
  95. package/components/datepicker/dist/styles/style-auro-calendar-css.d.ts +0 -2
  96. package/components/datepicker/dist/styles/style-auro-calendar-month-css.d.ts +0 -2
  97. package/components/datepicker/dist/styles/style-css.d.ts +0 -2
  98. package/components/datepicker/dist/styles/tokens-css.d.ts +0 -2
  99. package/components/datepicker/dist/utilities.d.ts +0 -78
  100. package/components/datepicker/dist/utilitiesCalendar.d.ts +0 -38
  101. package/components/datepicker/dist/utilitiesCalendarRender.d.ts +0 -50
  102. package/components/datepicker/dist/vendor/wc-range-datepicker/day.d.ts +0 -5
  103. package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker-calendar.d.ts +0 -60
  104. package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker-cell.d.ts +0 -1
  105. package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker.d.ts +0 -57
  106. package/components/dropdown/demo/api.md +0 -1358
  107. package/components/dropdown/demo/api.min.js +0 -4853
  108. package/components/dropdown/demo/index.md +0 -283
  109. package/components/dropdown/demo/index.min.js +0 -4788
  110. package/components/dropdown/demo/readme.md +0 -160
  111. package/components/dropdown/dist/auro-dropdown.d.ts +0 -482
  112. package/components/dropdown/dist/auro-dropdownBib.d.ts +0 -155
  113. package/components/dropdown/dist/iconVersion.d.ts +0 -2
  114. package/components/dropdown/dist/index.d.ts +0 -2
  115. package/components/dropdown/dist/index.js +0 -4685
  116. package/components/dropdown/dist/keyboardUtils.d.ts +0 -18
  117. package/components/dropdown/dist/registered.js +0 -4685
  118. package/components/dropdown/dist/styles/classic/bibColors-css.d.ts +0 -2
  119. package/components/dropdown/dist/styles/classic/bibStyles-css.d.ts +0 -2
  120. package/components/dropdown/dist/styles/classic/color-css.d.ts +0 -2
  121. package/components/dropdown/dist/styles/classic/style-css.d.ts +0 -2
  122. package/components/dropdown/dist/styles/color-css.d.ts +0 -2
  123. package/components/dropdown/dist/styles/emphasized/style-css.d.ts +0 -2
  124. package/components/dropdown/dist/styles/shapeSize-css.d.ts +0 -2
  125. package/components/dropdown/dist/styles/snowflake/style-css.d.ts +0 -2
  126. package/components/dropdown/dist/styles/style-css.d.ts +0 -2
  127. package/components/dropdown/dist/styles/tokens-css.d.ts +0 -2
  128. package/components/form/demo/api.md +0 -319
  129. package/components/form/demo/api.min.js +0 -69996
  130. package/components/form/demo/index.md +0 -128
  131. package/components/form/demo/index.min.js +0 -69996
  132. package/components/form/demo/readme.md +0 -145
  133. package/components/form/dist/auro-form.d.ts +0 -280
  134. package/components/form/dist/index.d.ts +0 -2
  135. package/components/form/dist/index.js +0 -718
  136. package/components/form/dist/registered.d.ts +0 -1
  137. package/components/form/dist/registered.js +0 -718
  138. package/components/form/dist/styles/style-css.d.ts +0 -2
  139. package/components/helptext/dist/auro-helptext.d.ts +0 -69
  140. package/components/helptext/dist/index.d.ts +0 -2
  141. package/components/helptext/dist/index.js +0 -231
  142. package/components/helptext/dist/registered.js +0 -231
  143. package/components/helptext/dist/styles/color-css.d.ts +0 -2
  144. package/components/helptext/dist/styles/style-css.d.ts +0 -2
  145. package/components/helptext/dist/styles/tokens-css.d.ts +0 -2
  146. package/components/input/demo/api.md +0 -1397
  147. package/components/input/demo/api.min.js +0 -7435
  148. package/components/input/demo/index.md +0 -161
  149. package/components/input/demo/index.min.js +0 -7355
  150. package/components/input/demo/readme.md +0 -134
  151. package/components/input/dist/auro-input.d.ts +0 -195
  152. package/components/input/dist/base-input.d.ts +0 -628
  153. package/components/input/dist/buttonVersion.d.ts +0 -2
  154. package/components/input/dist/i18n.d.ts +0 -18
  155. package/components/input/dist/iconVersion.d.ts +0 -2
  156. package/components/input/dist/index.d.ts +0 -2
  157. package/components/input/dist/index.js +0 -7278
  158. package/components/input/dist/registered.js +0 -7278
  159. package/components/input/dist/styles/classic/color-css.d.ts +0 -2
  160. package/components/input/dist/styles/classic/style-css.d.ts +0 -2
  161. package/components/input/dist/styles/color-css.d.ts +0 -2
  162. package/components/input/dist/styles/default/borders-css.d.ts +0 -2
  163. package/components/input/dist/styles/default/color-css.d.ts +0 -2
  164. package/components/input/dist/styles/default/mixins-css.d.ts +0 -2
  165. package/components/input/dist/styles/default/notificationIcons-css.d.ts +0 -2
  166. package/components/input/dist/styles/default/style-css.d.ts +0 -2
  167. package/components/input/dist/styles/emphasized/color-css.d.ts +0 -2
  168. package/components/input/dist/styles/emphasized/style-css.d.ts +0 -2
  169. package/components/input/dist/styles/mixins-css.d.ts +0 -2
  170. package/components/input/dist/styles/shapeSize-css.d.ts +0 -2
  171. package/components/input/dist/styles/snowflake/style-css.d.ts +0 -2
  172. package/components/input/dist/styles/style-css.d.ts +0 -2
  173. package/components/input/dist/styles/tokens-css.d.ts +0 -2
  174. package/components/input/dist/utilities.d.ts +0 -25
  175. package/components/layoutElement/dist/auroElement.d.ts +0 -40
  176. package/components/layoutElement/dist/index.d.ts +0 -2
  177. package/components/layoutElement/dist/index.js +0 -107
  178. package/components/layoutElement/dist/registered.js +0 -107
  179. package/components/menu/demo/api.md +0 -1200
  180. package/components/menu/demo/api.min.js +0 -2292
  181. package/components/menu/demo/index.md +0 -72
  182. package/components/menu/demo/index.min.js +0 -2185
  183. package/components/menu/demo/readme.md +0 -145
  184. package/components/menu/dist/auro-menu-utils.d.ts +0 -34
  185. package/components/menu/dist/auro-menu.context.d.ts +0 -227
  186. package/components/menu/dist/auro-menu.d.ts +0 -324
  187. package/components/menu/dist/auro-menuoption.d.ts +0 -210
  188. package/components/menu/dist/iconVersion.d.ts +0 -2
  189. package/components/menu/dist/index.d.ts +0 -4
  190. package/components/menu/dist/index.js +0 -2148
  191. package/components/menu/dist/registered.js +0 -2096
  192. package/components/menu/dist/styles/default/color-menu-css.d.ts +0 -2
  193. package/components/menu/dist/styles/default/color-menuoption-css.d.ts +0 -2
  194. package/components/menu/dist/styles/default/style-menu-css.d.ts +0 -2
  195. package/components/menu/dist/styles/default/style-menuoption-css.d.ts +0 -2
  196. package/components/menu/dist/styles/default/tokens-css.d.ts +0 -2
  197. package/components/radio/demo/api.md +0 -675
  198. package/components/radio/demo/api.min.js +0 -2210
  199. package/components/radio/demo/index.md +0 -73
  200. package/components/radio/demo/index.min.js +0 -2167
  201. package/components/radio/demo/readme.md +0 -141
  202. package/components/radio/dist/auro-radio-group.d.ts +0 -250
  203. package/components/radio/dist/auro-radio.d.ts +0 -180
  204. package/components/radio/dist/index.d.ts +0 -3
  205. package/components/radio/dist/index.js +0 -2116
  206. package/components/radio/dist/registered.js +0 -2117
  207. package/components/radio/dist/styles/auro-radio-group-css.d.ts +0 -2
  208. package/components/radio/dist/styles/color-css.d.ts +0 -2
  209. package/components/radio/dist/styles/groupColor-css.d.ts +0 -2
  210. package/components/radio/dist/styles/style-css.d.ts +0 -2
  211. package/components/radio/dist/styles/tokens-css.d.ts +0 -2
  212. package/components/select/demo/api.md +0 -2378
  213. package/components/select/demo/api.min.js +0 -10133
  214. package/components/select/demo/index.md +0 -355
  215. package/components/select/demo/index.min.js +0 -10040
  216. package/components/select/demo/readme.md +0 -148
  217. package/components/select/dist/auro-select.d.ts +0 -545
  218. package/components/select/dist/index.d.ts +0 -2
  219. package/components/select/dist/index.js +0 -8072
  220. package/components/select/dist/registered.js +0 -8072
  221. package/components/select/dist/selectKeyboardStrategy.d.ts +0 -8
  222. package/components/select/dist/styles/emphasized/color-css.d.ts +0 -2
  223. package/components/select/dist/styles/shapeSize-css.d.ts +0 -2
  224. package/components/select/dist/styles/style-css.d.ts +0 -2
  225. package/components/select/dist/styles/tokens-css.d.ts +0 -2
  226. package/custom-elements.json +0 -18656
@@ -1,2292 +0,0 @@
1
- function auroMenuResetExample() {
2
- const resetExampleBtnElem = document.querySelector('#resetExampleBtn');
3
- const resetExampleElem = document.querySelector('#resetExample');
4
-
5
- if (resetExampleElem && resetExampleBtnElem) {
6
- resetExampleBtnElem.addEventListener('click', () => {
7
- resetExampleElem.reset();
8
- });
9
- }
10
- }
11
-
12
- function updateMatch() {
13
- let matchWordMenu = document.querySelector('#matchWordMenu');
14
-
15
- matchWordMenu.matchWord = matchWordInput.value;
16
- }
17
-
18
- function auroMenuMatchWordExample() {
19
- let matchWordInput = document.querySelector('#matchWordInput');
20
-
21
- matchWordInput.addEventListener('keyup', updateMatch);
22
- }
23
-
24
- function initKeysExample() {
25
- const menu = document.getElementById('keys-menu');
26
- const stopsButton = document.getElementById('stopsButton');
27
- const stopsTopButton = document.getElementById('stopsTopButton');
28
- const output = document.getElementById('output');
29
-
30
- const createConsoleEntry = (message) => {
31
- const node = document.createElement('span');
32
- node.innerHTML = message;
33
- output.appendChild(node);
34
- output.appendChild(document.createElement('br'));
35
- };
36
-
37
- const resetConsole = () => {
38
- output.innerHTML = '';
39
- };
40
-
41
- const updateMenuValue = (value) => {
42
- resetConsole();
43
- createConsoleEntry(`Setting menu.value: <em>"${value}"</em>`);
44
- menu.value = '';
45
- menu.value = value;
46
- createConsoleEntry(`menu.value before next lifecycle: <em>"${menu.value}"</em>`);
47
- setTimeout(() => {
48
- createConsoleEntry(`menu.value after lifecycle: <em>"${menu.value}"</em>`);
49
- });
50
- };
51
-
52
- stopsButton.addEventListener('click', () => {
53
- updateMenuValue('stops');
54
- });
55
-
56
- stopsTopButton.addEventListener('click', () => {
57
- updateMenuValue('stops-top');
58
- });
59
- }
60
-
61
- function auroMenuLoadingExample() {
62
- document.querySelector("#loadingExampleToggleButton").addEventListener("click", () => {
63
- document.querySelectorAll("#loadingExampleTable auro-menu").forEach(menu => menu.toggleAttribute("loading"));
64
- });
65
- }
66
-
67
- const initSelectAllMatchingOptionsExample = () => {
68
-
69
- const selectAllBtn = document.getElementById('selectAllBtn');
70
- const selectAllMenu = document.getElementById('selectAllMenu');
71
- const selectFirstBtn = document.getElementById('selectFirstBtn');
72
- const selectFirstMenu = document.getElementById('selectFirstMenu');
73
- const resetAllBtn = document.getElementById('resetAllBtn');
74
- const resetFirstBtn = document.getElementById('resetFirstBtn');
75
-
76
- selectAllBtn.addEventListener('click', () => {
77
- selectAllMenu.value = 'stops';
78
- });
79
-
80
- resetAllBtn.addEventListener('click', () => {
81
- selectAllMenu.reset();
82
- });
83
-
84
- selectFirstBtn.addEventListener('click', () => {
85
- selectFirstMenu.value = 'stops';
86
- });
87
-
88
- resetFirstBtn.addEventListener('click', () => {
89
- selectFirstMenu.reset();
90
- });
91
- };
92
-
93
- /**
94
- * @license
95
- * Copyright 2019 Google LLC
96
- * SPDX-License-Identifier: BSD-3-Clause
97
- */
98
- const t$2=globalThis,e$5=t$2.ShadowRoot&&(void 0===t$2.ShadyCSS||t$2.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$6=Symbol(),o$5=new WeakMap;let n$4 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s$6)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$5&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$5.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$5.set(s,t));}return t}toString(){return this.cssText}};const r$2=t=>new n$4("string"==typeof t?t:t+"",void 0,s$6),i$6=(t,...e)=>{const o=1===t.length?t[0]:e.reduce((e,s,o)=>e+(t=>{if(true===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[o+1],t[0]);return new n$4(o,t,s$6)},S$1=(s,o)=>{if(e$5)s.adoptedStyleSheets=o.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const e of o){const o=document.createElement("style"),n=t$2.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$2=e$5?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$2(e)})(t):t;
99
-
100
- /**
101
- * @license
102
- * Copyright 2017 Google LLC
103
- * SPDX-License-Identifier: BSD-3-Clause
104
- */const{is:i$5,defineProperty:e$4,getOwnPropertyDescriptor:h$1,getOwnPropertyNames:r$1,getOwnPropertySymbols:o$4,getPrototypeOf:n$3}=Object,a$2=globalThis,c$1=a$2.trustedTypes,l$2=c$1?c$1.emptyScript:"",p$2=a$2.reactiveElementPolyfillSupport,d$1=(t,s)=>t,u$3={toAttribute(t,s){switch(s){case Boolean:t=t?l$2:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch(t){i=null;}}return i}},f$2=(t,s)=>!i$5(t,s),b$1={attribute:true,type:String,converter:u$3,reflect:false,useDefault:false,hasChanged:f$2};Symbol.metadata??=Symbol("metadata"),a$2.litPropertyMetadata??=new WeakMap;let y$2 = class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b$1){if(s.state&&(s.attribute=false),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=true),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e$4(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h$1(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??b$1}static _$Ei(){if(this.hasOwnProperty(d$1("elementProperties")))return;const t=n$3(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d$1("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d$1("properties"))){const t=this.properties,s=[...r$1(t),...o$4(t)];for(const i of s)this.createProperty(i,t[i]);}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i);}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$2(s));}else void 0!==s&&i.push(c$2(s));return i}static _$Eu(t,s){const i=s.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this));}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S$1(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this._$EO?.forEach(t=>t.hostConnected?.());}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.());}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&true===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u$3).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null;}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u$3;this._$Em=e;const r=h.fromAttribute(s,t.type);this[e]=r??this._$Ej?.get(e)??r,this._$Em=null;}}requestUpdate(t,s,i,e=false,h){if(void 0!==t){const r=this.constructor;if(false===e&&(h=this[t]),i??=r.getPropertyOptions(t),!((i.hasChanged??f$2)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(r._$Eu(t,i))))return;this.C(t,s,i);} false===this.isUpdatePending&&(this._$ES=this._$EP());}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),true!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),true===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t));}async _$EP(){this.isUpdatePending=true;try{await this._$ES;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0;}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];true!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e);}}let t=false;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(s)):this._$EM();}catch(s){throw t=false,this._$EM(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$EM(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM();}updated(t){}firstUpdated(t){}};y$2.elementStyles=[],y$2.shadowRootOptions={mode:"open"},y$2[d$1("elementProperties")]=new Map,y$2[d$1("finalized")]=new Map,p$2?.({ReactiveElement:y$2}),(a$2.reactiveElementVersions??=[]).push("2.1.2");
105
-
106
- /**
107
- * @license
108
- * Copyright 2017 Google LLC
109
- * SPDX-License-Identifier: BSD-3-Clause
110
- */
111
- const t$1=globalThis,i$4=t=>t,s$5=t$1.trustedTypes,e$3=s$5?s$5.createPolicy("lit-html",{createHTML:t=>t}):void 0,h="$lit$",o$3=`lit$${Math.random().toFixed(9).slice(2)}$`,n$2="?"+o$3,r=`<${n$2}>`,l$1=document,c=()=>l$1.createComment(""),a$1=t=>null===t||"object"!=typeof t&&"function"!=typeof t,u$2=Array.isArray,d=t=>u$2(t)||"function"==typeof t?.[Symbol.iterator],f$1="[ \t\n\f\r]",v=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_$1=/-->/g,m$1=/>/g,p$1=RegExp(`>|${f$1}(?:([^\\s"'>=/]+)(${f$1}*=${f$1}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),g$1=/'/g,$=/"/g,y$1=/^(?:script|style|textarea|title)$/i,x$1=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),b=x$1(1),E=Symbol.for("lit-noChange"),A=Symbol.for("lit-nothing"),C=new WeakMap,P=l$1.createTreeWalker(l$1,129);function V(t,i){if(!u$2(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==e$3?e$3.createHTML(i):i}const N=(t,i)=>{const s=t.length-1,e=[];let n,l=2===i?"<svg>":3===i?"<math>":"",c=v;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,f=0;for(;f<s.length&&(c.lastIndex=f,u=c.exec(s),null!==u);)f=c.lastIndex,c===v?"!--"===u[1]?c=_$1:void 0!==u[1]?c=m$1:void 0!==u[2]?(y$1.test(u[2])&&(n=RegExp("</"+u[2],"g")),c=p$1):void 0!==u[3]&&(c=p$1):c===p$1?">"===u[0]?(c=n??v,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?p$1:'"'===u[3]?$:g$1):c===$||c===g$1?c=p$1:c===_$1||c===m$1?c=v:(c=p$1,n=void 0);const x=c===p$1&&t[i+1].startsWith("/>")?" ":"";l+=c===v?s+r:d>=0?(e.push(a),s.slice(0,d)+h+s.slice(d)+o$3+x):s+o$3+(-2===d?i:x);}return [V(t,l+(t[s]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),e]};class S{constructor({strings:t,_$litType$:i},e){let r;this.parts=[];let l=0,a=0;const u=t.length-1,d=this.parts,[f,v]=N(t,i);if(this.el=S.createElement(f,e),P.currentNode=this.el.content,2===i||3===i){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=P.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(h)){const i=v[a++],s=r.getAttribute(t).split(o$3),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:l,name:e[2],strings:s,ctor:"."===e[1]?I:"?"===e[1]?L:"@"===e[1]?z$1:H}),r.removeAttribute(t);}else t.startsWith(o$3)&&(d.push({type:6,index:l}),r.removeAttribute(t));if(y$1.test(r.tagName)){const t=r.textContent.split(o$3),i=t.length-1;if(i>0){r.textContent=s$5?s$5.emptyScript:"";for(let s=0;s<i;s++)r.append(t[s],c()),P.nextNode(),d.push({type:2,index:++l});r.append(t[i],c());}}}else if(8===r.nodeType)if(r.data===n$2)d.push({type:2,index:l});else {let t=-1;for(;-1!==(t=r.data.indexOf(o$3,t+1));)d.push({type:7,index:l}),t+=o$3.length-1;}l++;}}static createElement(t,i){const s=l$1.createElement("template");return s.innerHTML=t,s}}function M(t,i,s=t,e){if(i===E)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=a$1(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(false),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=M(t,h._$AS(t,i.values),h,e)),i}class R{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??l$1).importNode(i,true);P.currentNode=e;let h=P.nextNode(),o=0,n=0,r=s[0];for(;void 0!==r;){if(o===r.index){let i;2===r.type?i=new k(h,h.nextSibling,this,t):1===r.type?i=new r.ctor(h,r.name,r.strings,this,t):6===r.type&&(i=new Z(h,this,t)),this._$AV.push(i),r=s[++n];}o!==r?.index&&(h=P.nextNode(),o++);}return P.currentNode=l$1,e}p(t){let i=0;for(const s of this._$AV) void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}}class k{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=A,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??true;}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=M(this,t,i),a$1(t)?t===A||null==t||""===t?(this._$AH!==A&&this._$AR(),this._$AH=A):t!==this._$AH&&t!==E&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):d(t)?this.k(t):this._(t);}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t));}_(t){this._$AH!==A&&a$1(this._$AH)?this._$AA.nextSibling.data=t:this.T(l$1.createTextNode(t)),this._$AH=t;}$(t){const{values:i,_$litType$:s}=t,e="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=S.createElement(V(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new R(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t;}}_$AC(t){let i=C.get(t.strings);return void 0===i&&C.set(t.strings,i=new S(t)),i}k(t){u$2(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new k(this.O(c()),this.O(c()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,s){for(this._$AP?.(false,true,s);t!==this._$AB;){const s=i$4(t).nextSibling;i$4(t).remove(),t=s;}}setConnected(t){ void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t));}}class H{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=A,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=A;}_$AI(t,i=this,s,e){const h=this.strings;let o=false;if(void 0===h)t=M(this,t,i,0),o=!a$1(t)||t!==this._$AH&&t!==E,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=M(this,e[s+n],i,n),r===E&&(r=this._$AH[n]),o||=!a$1(r)||r!==this._$AH[n],r===A?t=A:t!==A&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===A?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}}class I extends H{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===A?void 0:t;}}class L extends H{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==A);}}let z$1 = class z extends H{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=M(this,t,i,0)??A)===E)return;const s=this._$AH,e=t===A&&s!==A||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==A&&(s===A||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t);}};class Z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){M(this,t);}}const B=t$1.litHtmlPolyfillSupport;B?.(S,k),(t$1.litHtmlVersions??=[]).push("3.3.2");const D=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new k(i.insertBefore(c(),t),t,void 0,s??{});}return h._$AI(t),h};
112
-
113
- /**
114
- * @license
115
- * Copyright 2017 Google LLC
116
- * SPDX-License-Identifier: BSD-3-Clause
117
- */const s$4=globalThis;let i$3 = class i extends y$2{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=D(r,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(true);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(false);}render(){return E}};i$3._$litElement$=true,i$3["finalized"]=true,s$4.litElementHydrateSupport?.({LitElement:i$3});const o$2=s$4.litElementPolyfillSupport;o$2?.({LitElement:i$3});(s$4.litElementVersions??=[]).push("4.2.2");
118
-
119
- var styleCss$1 = i$6`:focus:not(:focus-visible){outline:3px solid transparent}.body-default{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);font-size:var(--wcss-body-default-font-size, 1rem);line-height:var(--wcss-body-default-line-height, 1.5rem)}.body-lg{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);font-size:var(--wcss-body-lg-font-size, 1.125rem);line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-sm{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);font-size:var(--wcss-body-sm-font-size, 0.875rem);line-height:var(--wcss-body-sm-line-height, 1.25rem)}.body-xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);font-size:var(--wcss-body-xs-font-size, 0.75rem);line-height:var(--wcss-body-xs-line-height, 1rem)}.body-2xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);font-size:var(--wcss-body-2xs-font-size, 0.625rem);line-height:var(--wcss-body-2xs-line-height, 0.875rem)}.display-2xl{font-family:var(--wcss-display-2xl-family, "AS Circular"),var(--wcss-display-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);font-weight:var(--wcss-display-2xl-weight, 300);line-height:var(--wcss-display-2xl-line-height, 1.3);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem))}.display-xl{font-family:var(--wcss-display-xl-family, "AS Circular"),var(--wcss-display-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);font-weight:var(--wcss-display-xl-weight, 300);line-height:var(--wcss-display-xl-line-height, 1.3);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem))}.display-lg{font-family:var(--wcss-display-lg-family, "AS Circular"),var(--wcss-display-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);font-weight:var(--wcss-display-lg-weight, 300);line-height:var(--wcss-display-lg-line-height, 1.3);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem))}.display-md{font-family:var(--wcss-display-md-family, "AS Circular"),var(--wcss-display-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-display-md-letter-spacing, 0);font-weight:var(--wcss-display-md-weight, 300);line-height:var(--wcss-display-md-line-height, 1.3);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem))}.display-sm{font-family:var(--wcss-display-sm-family, "AS Circular"),var(--wcss-display-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);font-weight:var(--wcss-display-sm-weight, 300);line-height:var(--wcss-display-sm-line-height, 1.3);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem))}.display-xs{font-family:var(--wcss-display-xs-family, "AS Circular"),var(--wcss-display-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);font-weight:var(--wcss-display-xs-weight, 300);line-height:var(--wcss-display-xs-line-height, 1.3);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem))}.heading-xl{font-family:var(--wcss-heading-xl-family, "AS Circular"),var(--wcss-heading-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);font-weight:var(--wcss-heading-xl-weight, 300);line-height:var(--wcss-heading-xl-line-height, 1.3);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem))}.heading-lg{font-family:var(--wcss-heading-lg-family, "AS Circular"),var(--wcss-heading-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);font-weight:var(--wcss-heading-lg-weight, 300);line-height:var(--wcss-heading-lg-line-height, 1.3);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem))}.heading-md{font-family:var(--wcss-heading-md-family, "AS Circular"),var(--wcss-heading-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);font-weight:var(--wcss-heading-md-weight, 300);line-height:var(--wcss-heading-md-line-height, 1.3);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem))}.heading-sm{font-family:var(--wcss-heading-sm-family, "AS Circular"),var(--wcss-heading-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);font-weight:var(--wcss-heading-sm-weight, 300);line-height:var(--wcss-heading-sm-line-height, 1.3);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem))}.heading-xs{font-family:var(--wcss-heading-xs-family, "AS Circular"),var(--wcss-heading-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);font-weight:var(--wcss-heading-xs-weight, 450);line-height:var(--wcss-heading-xs-line-height, 1.3);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem))}.heading-2xs{font-family:var(--wcss-heading-2xs-family, "AS Circular"),var(--wcss-heading-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);font-weight:var(--wcss-heading-2xs-weight, 450);line-height:var(--wcss-heading-2xs-line-height, 1.3);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem))}.accent-2xl{font-family:var(--wcss-accent-2xl-family, "Good OT"),var(--wcss-accent-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-accent-2xl-letter-spacing, 0.05em);font-weight:var(--wcss-accent-2xl-weight, 450);line-height:var(--wcss-accent-2xl-line-height, 1);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));text-transform:uppercase}.accent-xl{font-family:var(--wcss-accent-xl-family, "Good OT"),var(--wcss-accent-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-accent-xl-letter-spacing, 0.05em);font-weight:var(--wcss-accent-xl-weight, 450);line-height:var(--wcss-accent-xl-line-height, 1.3);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));text-transform:uppercase}.accent-lg{font-family:var(--wcss-accent-lg-family, "Good OT"),var(--wcss-accent-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-accent-lg-letter-spacing, 0.05em);font-weight:var(--wcss-accent-lg-weight, 450);line-height:var(--wcss-accent-lg-line-height, 1.3);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));text-transform:uppercase}.accent-md{font-family:var(--wcss-accent-md-family, "Good OT"),var(--wcss-accent-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-accent-md-letter-spacing, 0.05em);font-weight:var(--wcss-accent-md-weight, 500);line-height:var(--wcss-accent-md-line-height, 1.3);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));text-transform:uppercase}.accent-sm{font-family:var(--wcss-accent-sm-family, "Good OT"),var(--wcss-accent-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-accent-sm-letter-spacing, 0.05em);font-weight:var(--wcss-accent-sm-weight, 500);line-height:var(--wcss-accent-sm-line-height, 1.3);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));text-transform:uppercase}.accent-xs{font-family:var(--wcss-accent-xs-family, "Good OT"),var(--wcss-accent-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-accent-xs-letter-spacing, 0.1em);font-weight:var(--wcss-accent-xs-weight, 500);line-height:var(--wcss-accent-xs-line-height, 1.3);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));text-transform:uppercase}.accent-2xs{font-family:var(--wcss-accent-2xs-family, "Good OT"),var(--wcss-accent-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-accent-2xs-letter-spacing, 0.1em);font-weight:var(--wcss-accent-2xs-weight, 450);line-height:var(--wcss-accent-2xs-line-height, 1.3);font-size:var(--wcss-accent-2xs-font-size, clamp(0.875rem, 1.1666666667vw, 0.875rem));text-transform:uppercase}:host{display:block;vertical-align:middle;line-height:0}:host .menuWrapper{box-sizing:border-box;display:flex;flex-direction:column;width:100%;margin:0;padding:0}:host ::slotted(hr){box-sizing:content-box !important;height:0 !important;overflow:visible !important;margin:var(--ds-size-100, 0.5rem) 0 !important;border-width:0 !important;border-top-width:1px !important;border-top-style:solid !important}:host [loadingplaceholder].empty{opacity:0;position:absolute}:host [loadingplaceholder] slot[name=loadingIcon]{vertical-align:middle;display:inline-block;margin-bottom:var(--ds-size-25, 0.125rem)}:host [loadingplaceholder] slot[name=loadingIcon]::slotted(*){margin-right:var(--ds-size-150, 0.75rem)}:host([root]) .menuWrapper.lg{padding:var(--ds-size-150, 0.75rem);gap:var(--ds-size-50, 0.25rem)}:host([root]) .menuWrapper.xl{padding:var(--ds-size-200, 1rem);gap:var(--ds-size-100, 0.5rem)}`;
120
-
121
- var colorCss$1 = i$6`:host ::slotted(hr){border-top-color:var(--ds-auro-menu-divider-color)}[loadingplaceholder] slot[name=loadingIcon]{color:var(--ds-auro-menu-loader-color)}[loadingplaceholder] slot[name=loadingText]{color:var(--ds-auro-menu-loader-text-color)}`;
122
-
123
- var tokensCss = i$6`:host{--ds-auro-menu-divider-color: var(--ds-basic-color-border-divider, rgba(0, 0, 0, 0.15));--ds-auro-menu-loader-color: var(--ds-basic-color-brand-primary, #01426a);--ds-auro-menu-loader-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-menuoption-container-color: transparent;--ds-auro-menuoption-container-border-color: var(--ds-auro-menuoption-container-color);--ds-auro-menuoption-icon-color: transparent;--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}`;
124
-
125
- class AuroElement extends i$3 {
126
- static get properties() {
127
- return {
128
-
129
- /**
130
- * Defines the language of an element.
131
- * @default {'default'}
132
- */
133
- layout: {
134
- type: String,
135
- attribute: "layout",
136
- reflect: true
137
- },
138
-
139
- shape: {
140
- type: String,
141
- attribute: "shape",
142
- reflect: true
143
- },
144
-
145
- size: {
146
- type: String,
147
- attribute: "size",
148
- reflect: true
149
- },
150
-
151
- onDark: {
152
- type: Boolean,
153
- attribute: "ondark",
154
- reflect: true
155
- }
156
- };
157
- }
158
-
159
- /**
160
- * Returns true if the element has focus.
161
- * @private
162
- * @returns {boolean} - Returns true if the element has focus.
163
- */
164
- get componentHasFocus() {
165
- return this.matches(':focus') || this.matches(':focus-within');
166
- }
167
-
168
- resetShapeClasses() {
169
- const wrapper = this.shadowRoot.querySelector('.wrapper');
170
-
171
- if (wrapper) {
172
- wrapper.classList.forEach((className) => {
173
- if (className.startsWith('shape-')) {
174
- wrapper.classList.remove(className);
175
- }
176
- });
177
-
178
- if (this.shape && this.size) {
179
- wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
180
- } else {
181
- wrapper.classList.add('shape-none');
182
- }
183
- }
184
-
185
- }
186
-
187
- resetLayoutClasses() {
188
- if (this.layout) {
189
- const wrapper = this.shadowRoot.querySelector('.wrapper');
190
-
191
- if (wrapper) {
192
- wrapper.classList.forEach((className) => {
193
- if (className.startsWith('layout-')) {
194
- wrapper.classList.remove(className);
195
- }
196
- });
197
-
198
- wrapper.classList.add(`layout-${this.layout.toLowerCase()}`);
199
- }
200
- }
201
- }
202
-
203
- updateComponentArchitecture() {
204
- this.resetLayoutClasses();
205
- this.resetShapeClasses();
206
- }
207
-
208
- updated(changedProperties) {
209
- if (changedProperties.has('layout') || changedProperties.has('shape') || changedProperties.has('size')) {
210
- this.updateComponentArchitecture();
211
- }
212
- }
213
-
214
- // Try to render the defined `this.layout` layout. If that fails, fall back to the default layout.
215
- // This will catch if an invalid layout value is passed in and render the default layout if so.
216
- render() {
217
- try {
218
- return this.renderLayout();
219
- } catch (error) {
220
- // failed to get the defined layout
221
- console.error('Failed to get the defined layout - using the default layout', error); // eslint-disable-line no-console
222
-
223
- // fallback to the default layout
224
- return this.getLayout('default');
225
- }
226
- }
227
- }
228
-
229
- /**
230
- * @license
231
- * Copyright 2021 Google LLC
232
- * SPDX-License-Identifier: BSD-3-Clause
233
- */
234
- let s$3 = class s extends Event{constructor(s,t,e,o){super("context-request",{bubbles:true,composed:true}),this.context=s,this.contextTarget=t,this.callback=e,this.subscribe=o??false;}};
235
-
236
- /**
237
- * @license
238
- * Copyright 2021 Google LLC
239
- * SPDX-License-Identifier: BSD-3-Clause
240
- */
241
- function n$1(n){return n}
242
-
243
- /**
244
- * @license
245
- * Copyright 2021 Google LLC
246
- * SPDX-License-Identifier: BSD-3-Clause
247
- */let s$2 = class s{constructor(t,s,i,h){if(this.subscribe=false,this.provided=false,this.value=void 0,this.t=(t,s)=>{this.unsubscribe&&(this.unsubscribe!==s&&(this.provided=false,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=t,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=true,this.callback&&this.callback(t,s)),this.unsubscribe=s;},this.host=t,void 0!==s.context){const t=s;this.context=t.context,this.callback=t.callback,this.subscribe=t.subscribe??false;}else this.context=s,this.callback=i,this.subscribe=h??false;this.host.addController(this);}hostConnected(){this.dispatchRequest();}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0);}dispatchRequest(){this.host.dispatchEvent(new s$3(this.context,this.host,this.t,this.subscribe));}};
248
-
249
- /**
250
- * @license
251
- * Copyright 2021 Google LLC
252
- * SPDX-License-Identifier: BSD-3-Clause
253
- */
254
- let s$1 = class s{get value(){return this.o}set value(s){this.setValue(s);}setValue(s,t=false){const i=t||!Object.is(s,this.o);this.o=s,i&&this.updateObservers();}constructor(s){this.subscriptions=new Map,this.updateObservers=()=>{for(const[s,{disposer:t}]of this.subscriptions)s(this.o,t);},void 0!==s&&(this.value=s);}addCallback(s,t,i){if(!i)return void s(this.value);this.subscriptions.has(s)||this.subscriptions.set(s,{disposer:()=>{this.subscriptions.delete(s);},consumerHost:t});const{disposer:h}=this.subscriptions.get(s);s(this.value,h);}clearCallbacks(){this.subscriptions.clear();}};
255
-
256
- /**
257
- * @license
258
- * Copyright 2021 Google LLC
259
- * SPDX-License-Identifier: BSD-3-Clause
260
- */let e$2 = class e extends Event{constructor(t,s){super("context-provider",{bubbles:true,composed:true}),this.context=t,this.contextTarget=s;}};let i$2 = class i extends s$1{constructor(s,e,i){super(void 0!==e.context?e.initialValue:i),this.onContextRequest=t=>{if(t.context!==this.context)return;const s=t.contextTarget??t.composedPath()[0];s!==this.host&&(t.stopPropagation(),this.addCallback(t.callback,s,t.subscribe));},this.onProviderRequest=s=>{if(s.context!==this.context)return;if((s.contextTarget??s.composedPath()[0])===this.host)return;const e=new Set;for(const[s,{consumerHost:i}]of this.subscriptions)e.has(s)||(e.add(s),i.dispatchEvent(new s$3(this.context,i,s,true)));s.stopPropagation();},this.host=s,void 0!==e.context?this.context=e.context:this.context=e,this.attachListeners(),this.host.addController?.(this);}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest);}hostConnected(){this.host.dispatchEvent(new e$2(this.context,this.host));}};
261
-
262
- /**
263
- * @license
264
- * Copyright 2020 Google LLC
265
- * SPDX-License-Identifier: BSD-3-Clause
266
- */
267
- const a=Symbol.for(""),o$1=t=>{if(t?.r===a)return t?._$litStatic$},s=t=>({_$litStatic$:t,r:a}),i$1=(t,...r)=>({_$litStatic$:r.reduce((r,e,a)=>r+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(e)+t[a+1],t[0]),r:a}),l=new Map,n=t=>(r,...e)=>{const a=e.length;let s,i;const n=[],u=[];let c,$=0,f=false;for(;$<a;){for(c=r[$];$<a&&void 0!==(i=e[$],s=o$1(i));)c+=s+r[++$],f=true;$!==a&&u.push(i),n.push(c),$++;}if($===a&&n.push(r[a]),f){const t=n.join("$$lit$$");void 0===(r=l.get(t))&&(n.raw=n,l.set(t,r=n)),e=u;}return t(r,...e)},u$1=n(b);
268
-
269
- var styleCss = i$6`.body-default{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);font-size:var(--wcss-body-default-font-size, 1rem);line-height:var(--wcss-body-default-line-height, 1.5rem)}.body-lg{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);font-size:var(--wcss-body-lg-font-size, 1.125rem);line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-sm{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);font-size:var(--wcss-body-sm-font-size, 0.875rem);line-height:var(--wcss-body-sm-line-height, 1.25rem)}.body-xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);font-size:var(--wcss-body-xs-font-size, 0.75rem);line-height:var(--wcss-body-xs-line-height, 1rem)}.body-2xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);font-size:var(--wcss-body-2xs-font-size, 0.625rem);line-height:var(--wcss-body-2xs-line-height, 0.875rem)}.display-2xl{font-family:var(--wcss-display-2xl-family, "AS Circular"),var(--wcss-display-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);font-weight:var(--wcss-display-2xl-weight, 300);line-height:var(--wcss-display-2xl-line-height, 1.3);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem))}.display-xl{font-family:var(--wcss-display-xl-family, "AS Circular"),var(--wcss-display-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);font-weight:var(--wcss-display-xl-weight, 300);line-height:var(--wcss-display-xl-line-height, 1.3);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem))}.display-lg{font-family:var(--wcss-display-lg-family, "AS Circular"),var(--wcss-display-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);font-weight:var(--wcss-display-lg-weight, 300);line-height:var(--wcss-display-lg-line-height, 1.3);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem))}.display-md{font-family:var(--wcss-display-md-family, "AS Circular"),var(--wcss-display-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-display-md-letter-spacing, 0);font-weight:var(--wcss-display-md-weight, 300);line-height:var(--wcss-display-md-line-height, 1.3);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem))}.display-sm{font-family:var(--wcss-display-sm-family, "AS Circular"),var(--wcss-display-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);font-weight:var(--wcss-display-sm-weight, 300);line-height:var(--wcss-display-sm-line-height, 1.3);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem))}.display-xs{font-family:var(--wcss-display-xs-family, "AS Circular"),var(--wcss-display-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);font-weight:var(--wcss-display-xs-weight, 300);line-height:var(--wcss-display-xs-line-height, 1.3);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem))}.heading-xl{font-family:var(--wcss-heading-xl-family, "AS Circular"),var(--wcss-heading-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);font-weight:var(--wcss-heading-xl-weight, 300);line-height:var(--wcss-heading-xl-line-height, 1.3);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem))}.heading-lg{font-family:var(--wcss-heading-lg-family, "AS Circular"),var(--wcss-heading-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);font-weight:var(--wcss-heading-lg-weight, 300);line-height:var(--wcss-heading-lg-line-height, 1.3);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem))}.heading-md{font-family:var(--wcss-heading-md-family, "AS Circular"),var(--wcss-heading-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);font-weight:var(--wcss-heading-md-weight, 300);line-height:var(--wcss-heading-md-line-height, 1.3);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem))}.heading-sm{font-family:var(--wcss-heading-sm-family, "AS Circular"),var(--wcss-heading-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);font-weight:var(--wcss-heading-sm-weight, 300);line-height:var(--wcss-heading-sm-line-height, 1.3);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem))}.heading-xs{font-family:var(--wcss-heading-xs-family, "AS Circular"),var(--wcss-heading-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);font-weight:var(--wcss-heading-xs-weight, 450);line-height:var(--wcss-heading-xs-line-height, 1.3);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem))}.heading-2xs{font-family:var(--wcss-heading-2xs-family, "AS Circular"),var(--wcss-heading-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);font-weight:var(--wcss-heading-2xs-weight, 450);line-height:var(--wcss-heading-2xs-line-height, 1.3);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem))}.accent-2xl{font-family:var(--wcss-accent-2xl-family, "Good OT"),var(--wcss-accent-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-accent-2xl-letter-spacing, 0.05em);font-weight:var(--wcss-accent-2xl-weight, 450);line-height:var(--wcss-accent-2xl-line-height, 1);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));text-transform:uppercase}.accent-xl{font-family:var(--wcss-accent-xl-family, "Good OT"),var(--wcss-accent-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-accent-xl-letter-spacing, 0.05em);font-weight:var(--wcss-accent-xl-weight, 450);line-height:var(--wcss-accent-xl-line-height, 1.3);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));text-transform:uppercase}.accent-lg{font-family:var(--wcss-accent-lg-family, "Good OT"),var(--wcss-accent-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-accent-lg-letter-spacing, 0.05em);font-weight:var(--wcss-accent-lg-weight, 450);line-height:var(--wcss-accent-lg-line-height, 1.3);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));text-transform:uppercase}.accent-md{font-family:var(--wcss-accent-md-family, "Good OT"),var(--wcss-accent-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-accent-md-letter-spacing, 0.05em);font-weight:var(--wcss-accent-md-weight, 500);line-height:var(--wcss-accent-md-line-height, 1.3);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));text-transform:uppercase}.accent-sm{font-family:var(--wcss-accent-sm-family, "Good OT"),var(--wcss-accent-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-accent-sm-letter-spacing, 0.05em);font-weight:var(--wcss-accent-sm-weight, 500);line-height:var(--wcss-accent-sm-line-height, 1.3);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));text-transform:uppercase}.accent-xs{font-family:var(--wcss-accent-xs-family, "Good OT"),var(--wcss-accent-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-accent-xs-letter-spacing, 0.1em);font-weight:var(--wcss-accent-xs-weight, 500);line-height:var(--wcss-accent-xs-line-height, 1.3);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));text-transform:uppercase}.accent-2xs{font-family:var(--wcss-accent-2xs-family, "Good OT"),var(--wcss-accent-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);letter-spacing:var(--wcss-accent-2xs-letter-spacing, 0.1em);font-weight:var(--wcss-accent-2xs-weight, 450);line-height:var(--wcss-accent-2xs-line-height, 1.3);font-size:var(--wcss-accent-2xs-font-size, clamp(0.875rem, 1.1666666667vw, 0.875rem));text-transform:uppercase}:host{cursor:pointer;user-select:none;text-overflow:ellipsis;max-width:100dvw}:host .wrapper{display:flex;align-items:center;padding-right:var(--ds-size-200, 1rem);padding-left:calc(var(--ds-size-150, 0.75rem) + var(--ds-size-300, 1.5rem) + var(--ds-size-100, 0.5rem));padding-top:var(--ds-size-50, 0.25rem);padding-bottom:var(--ds-size-50, 0.25rem);border-radius:var(--ds-size-100, 0.5rem);-webkit-tap-highlight-color:transparent}:host .wrapper[class*=shape-box]{border-radius:unset}:host .wrapper[class*=shape-snowflake]{border-radius:unset;line-height:24px}:host .wrapper[class*=shape-pill]{border-radius:30px}:host .wrapper[class*=-lg]{padding-top:var(--ds-size-75, 0.375rem);padding-bottom:var(--ds-size-75, 0.375rem);padding-right:var(--ds-size-150, 0.75rem);line-height:26px}:host .wrapper[class*=-xl]{padding-top:var(--ds-size-100, 0.5rem);padding-bottom:var(--ds-size-100, 0.5rem);padding-right:var(--ds-size-200, 1rem);line-height:26px}:host slot{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host [auro-icon]{--ds-auro-icon-size: var(--ds-size-300, 1.5rem);margin-right:var(--ds-size-150, 0.75rem);margin-left:var(--ds-size-100, 0.5rem)}:host ::slotted(.nestingSpacer){display:inline-block;width:var(--ds-size-300, 1.5rem)}[slot=displayValue]{display:none}:host([loadingplaceholder]) .wrapper{padding-left:calc(var(--ds-size-150, 0.75rem) + var(--ds-size-300, 1.5rem) + var(--ds-size-100, 0.5rem))}:host([selected]) .wrapper{padding-left:0}:host([nocheckmark]) .wrapper{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-lg]{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-xl]{padding-left:var(--ds-size-200, 1rem)}:host([hidden]){display:none}:host([static]){pointer-events:none}:host([disabled]:hover){cursor:auto}:host([disabled]){user-select:none;pointer-events:none}`;
270
-
271
- var colorCss = i$6`:host .wrapper{background-color:var(--ds-auro-menuoption-container-color, transparent);box-shadow:inset 0 0 0 1px var(--ds-auro-menuoption-container-border-color, transparent);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color)}:host([disabled]){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-menuoption-icon-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(.active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-accent1-muted, #ebfafd)}@media(hover: hover){:host(:hover){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-accent1-muted, #ebfafd)}}:host(:focus){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-menuoption-container-border-color: var(--ds-basic-color-border-brand, #00274a)}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-accent1-subtle, #b4eff9);--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-menuoption-icon-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([selected].active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-accent1-muted, #ebfafd)}@media(hover: hover){:host([selected]:hover){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-accent1-muted, #ebfafd)}}:host([selected]:focus){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-accent1-subtle, #b4eff9);--ds-auro-menuoption-container-border-color: var(--ds-basic-color-border-brand, #00274a)}:host(:focus.active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-accent1-muted, #ebfafd);--ds-auro-menuoption-container-border-color: var(--ds-basic-color-border-brand, #00274a)}@media(hover: hover){:host(:focus:hover){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-accent1-muted, #ebfafd);--ds-auro-menuoption-container-border-color: var(--ds-basic-color-border-brand, #00274a)}}:host([selected]:focus.active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-accent1-muted, #ebfafd);--ds-auro-menuoption-container-border-color: var(--ds-basic-color-border-brand, #00274a)}@media(hover: hover){:host([selected]:focus:hover){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-accent1-muted, #ebfafd);--ds-auro-menuoption-container-border-color: var(--ds-basic-color-border-brand, #00274a)}}`;
272
-
273
- // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
274
- // See LICENSE in the project root for license information.
275
-
276
- // ---------------------------------------------------------------------
277
-
278
- /* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
279
-
280
- class AuroLibraryRuntimeUtils {
281
-
282
- /* eslint-disable jsdoc/require-param */
283
-
284
- /**
285
- * This will register a new custom element with the browser.
286
- * @param {String} name - The name of the custom element.
287
- * @param {Object} componentClass - The class to register as a custom element.
288
- * @returns {void}
289
- */
290
- registerComponent(name, componentClass) {
291
- if (!customElements.get(name)) {
292
- customElements.define(name, class extends componentClass {});
293
- }
294
- }
295
-
296
- /**
297
- * Finds and returns the closest HTML Element based on a selector.
298
- * @returns {void}
299
- */
300
- closestElement(
301
- selector, // selector like in .closest()
302
- base = this, // extra functionality to skip a parent
303
- __Closest = (el, found = el && el.closest(selector)) =>
304
- !el || el === document || el === window
305
- ? null // standard .closest() returns null for non-found selectors also
306
- : found
307
- ? found // found a selector INside this element
308
- : __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
309
- ) {
310
- return __Closest(base);
311
- }
312
- /* eslint-enable jsdoc/require-param */
313
-
314
- /**
315
- * If the element passed is registered with a different tag name than what is passed in, the tag name is added as an attribute to the element.
316
- * @param {Object} elem - The element to check.
317
- * @param {String} tagName - The name of the Auro component to check for or add as an attribute.
318
- * @returns {void}
319
- */
320
- handleComponentTagRename(elem, tagName) {
321
- const tag = tagName.toLowerCase();
322
- const elemTag = elem.tagName.toLowerCase();
323
-
324
- if (elemTag !== tag) {
325
- elem.setAttribute(tag, true);
326
- }
327
- }
328
-
329
- /**
330
- * Validates if an element is a specific Auro component.
331
- * @param {Object} elem - The element to validate.
332
- * @param {String} tagName - The name of the Auro component to check against.
333
- * @returns {Boolean} - Returns true if the element is the specified Auro component.
334
- */
335
- elementMatch(elem, tagName) {
336
- const tag = tagName.toLowerCase();
337
- const elemTag = elem.tagName.toLowerCase();
338
-
339
- return elemTag === tag || elem.hasAttribute(tag);
340
- }
341
-
342
- /**
343
- * Gets the text content of a named slot.
344
- * @returns {String}
345
- * @private
346
- */
347
- getSlotText(elem, name) {
348
- const slot = elem.shadowRoot?.querySelector(`slot[name="${name}"]`);
349
- const nodes = slot?.assignedNodes({ flatten: true }) || [];
350
- const text = nodes.map(n => n.textContent?.trim()).join(' ').trim();
351
-
352
- return text || null;
353
- }
354
- }
355
-
356
- // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
357
- // See LICENSE in the project root for license information.
358
-
359
-
360
- class AuroDependencyVersioning {
361
-
362
- /**
363
- * Generates a unique string to be used for child auro element naming.
364
- * @private
365
- * @param {string} baseName - Defines the first part of the unique element name.
366
- * @param {string} version - Version of the component that will be appended to the baseName.
367
- * @returns {string} - Unique string to be used for naming.
368
- */
369
- generateElementName(baseName, version) {
370
- let result = baseName;
371
-
372
- result += '-';
373
- result += version.replace(/[.]/g, '_');
374
-
375
- return result;
376
- }
377
-
378
- /**
379
- * Generates a unique string to be used for child auro element naming.
380
- * @param {string} baseName - Defines the first part of the unique element name.
381
- * @param {string} version - Version of the component that will be appended to the baseName.
382
- * @returns {string} - Unique string to be used for naming.
383
- */
384
- generateTag(baseName, version, tagClass) {
385
- const elementName = this.generateElementName(baseName, version);
386
- const tag = i$1`${s(elementName)}`;
387
-
388
- if (!customElements.get(elementName)) {
389
- customElements.define(elementName, class extends tagClass {});
390
- }
391
-
392
- return tag;
393
- }
394
- }
395
-
396
- /**
397
- * @license
398
- * Copyright 2017 Google LLC
399
- * SPDX-License-Identifier: BSD-3-Clause
400
- */
401
- const t={ATTRIBUTE:1},e$1=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i;}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
402
-
403
- /**
404
- * @license
405
- * Copyright 2018 Google LLC
406
- * SPDX-License-Identifier: BSD-3-Clause
407
- */const e=e$1(class extends i{constructor(t$1){if(super(t$1),t$1.type!==t.ATTRIBUTE||"class"!==t$1.name||t$1.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return " "+Object.keys(t).filter(s=>t[s]).join(" ")+" "}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)));}return E}});
408
-
409
- /**
410
- * @license
411
- * Copyright 2018 Google LLC
412
- * SPDX-License-Identifier: BSD-3-Clause
413
- */const o=o=>o??A;
414
-
415
- class p{registerComponent(t,a){customElements.get(t)||customElements.define(t,class extends a{});}closestElement(t,a=this,e=(a,s=a&&a.closest(t))=>a&&a!==document&&a!==window?s||e(a.getRootNode().host):null){return e(a)}handleComponentTagRename(t,a){const e=a.toLowerCase();t.tagName.toLowerCase()!==e&&t.setAttribute(e,true);}elementMatch(t,a){const e=a.toLowerCase();return t.tagName.toLowerCase()===e||t.hasAttribute(e)}getSlotText(t,a){const e=t.shadowRoot?.querySelector(`slot[name="${a}"]`);return (e?.assignedNodes({flatten:true})||[]).map(t=>t.textContent?.trim()).join(" ").trim()||null}}var u='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-labelledby="error__desc" class="ico_squareLarge" data-deprecated="true" role="img" style="min-width:var(--auro-size-lg, var(--ds-size-300, 1.5rem));height:var(--auro-size-lg, var(--ds-size-300, 1.5rem));fill:currentColor" viewBox="0 0 24 24" part="svg"><title/><desc id="error__desc">Error alert indicator.</desc><path d="m13.047 5.599 6.786 11.586A1.207 1.207 0 0 1 18.786 19H5.214a1.207 1.207 0 0 1-1.047-1.815l6.786-11.586a1.214 1.214 0 0 1 2.094 0m-1.165.87a.23.23 0 0 0-.085.085L5.419 17.442a.232.232 0 0 0 .203.35h12.756a.234.234 0 0 0 .203-.35L12.203 6.554a.236.236 0 0 0-.321-.084M12 15.5a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m-.024-6.22c.325 0 .589.261.589.583v4.434a.586.586 0 0 1-.589.583.586.586 0 0 1-.588-.583V9.863c0-.322.264-.583.588-.583"/></svg>';class m extends i$3{static get properties(){return {hidden:{type:Boolean,reflect:true},hiddenVisually:{type:Boolean,reflect:true},hiddenAudible:{type:Boolean,reflect:true}}}hideAudible(t){return t?"true":"false"}}const g=new Map,f=(t,a={})=>{const e=a.responseParser||(t=>t.text());return g.has(t)||g.set(t,fetch(t).then(e)),g.get(t)};var w=i$6`:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock,:host{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host([hidden]:not(:focus):not(:active)){display:none}.util_displayHiddenVisually,:host([hiddenVisually]:not(:focus):not(:active)){position:absolute;overflow:hidden;clip:rect(1px,1px,1px,1px);width:1px;height:1px;padding:0;border:0}.ico_squareLarge{fill:currentColor;height:var(--auro-size-lg, var(--ds-size-300, 1.5rem))}.ico_squareSmall{fill:currentColor;height:.6rem}.ico_squareMed{fill:currentColor;height:var(--auro-size-md, var(--ds-size-200, 1rem))}.ico_squareSml{fill:currentColor;height:var(--auro-size-sm, var(--ds-size-150, .75rem))}:host{color:currentColor;vertical-align:middle;display:inline-block}svg{min-width:var(--ds-auro-icon-size, 1.5rem)!important;width:var(--ds-auro-icon-size, 1.5rem)!important;height:var(--ds-auro-icon-size, 1.5rem)!important}.componentWrapper{display:flex;line-height:var(--ds-auro-icon-size)}.svgWrapper{height:var(--ds-auro-icon-size);width:var(--ds-auro-icon-size)}.svgWrapper [part=svg]{display:flex}.labelWrapper{margin-left:var(--ds-size-50, .25rem)}.labelWrapper ::slotted(*){line-height:inherit!important}
416
- `;class z extends m{constructor(){super(),this._initializeDefaults();}_initializeDefaults(){this.onDark=false,this.appearance="default";}static get properties(){return {...m.properties,onDark:{type:Boolean,reflect:true},appearance:{type:String,reflect:true},svg:{attribute:false,reflect:true}}}static get styles(){return w}async fetchIcon(t,a){let e="";e="logos"===t?await f(`${this.uri}/${t}/${a}.svg`):await f(`${this.uri}/icons/${t}/${a}.svg`);return (new DOMParser).parseFromString(e,"text/html").body.querySelector("svg")}async firstUpdated(){try{if(!this.customSvg){const t=await this.fetchIcon(this.category,this.name);if(t)this.svg=t;else if(!t){const t=(new DOMParser).parseFromString(u,"text/html");this.svg=t.body.firstChild;}}}catch(t){this.svg=void 0;}}}i$6`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock,:host{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host([hidden]:not(:focus):not(:active)){display:none}.util_displayHiddenVisually,:host([hiddenVisually]:not(:focus):not(:active)){position:absolute;overflow:hidden;clip:rect(1px,1px,1px,1px);width:1px;height:1px;padding:0;border:0}:host{display:inline-block;--ds-auro-icon-size: 100%;width:100%;height:100%}:host .logo{color:var(--ds-auro-alaska-color)}:host([onDark]),:host([appearance=inverse]){--ds-auro-alaska-color: #FFF}
417
- `;var y=i$6`:host{--ds-auro-icon-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-alaska-color: #02426D;--ds-auro-icon-size: var(--ds-size-300, 1.5rem)}
418
- `;var x=i$6`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]),:host(:not([appearance=inverse])[variant=accent1]){--ds-auro-icon-color: var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]),:host(:not([appearance=inverse])[variant=disabled]){--ds-auro-icon-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]),:host(:not([appearance=inverse])[variant=muted]){--ds-auro-icon-color: var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]),:host(:not([appearance=inverse])[variant=statusDefault]){--ds-auro-icon-color: var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]),:host(:not([appearance=inverse])[variant=statusInfo]){--ds-auro-icon-color: var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]),:host(:not([appearance=inverse])[variant=statusSuccess]){--ds-auro-icon-color: var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]),:host(:not([appearance=inverse])[variant=statusWarning]){--ds-auro-icon-color: var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]),:host(:not([appearance=inverse])[variant=statusError]){--ds-auro-icon-color: var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]),:host(:not([appearance=inverse])[variant=statusInfoSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]),:host(:not([appearance=inverse])[variant=statusSuccessSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]),:host(:not([appearance=inverse])[variant=statusWarningSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]),:host(:not([appearance=inverse])[variant=statusErrorSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]),:host(:not([appearance=inverse])[variant=fareBasicEconomy]){--ds-auro-icon-color: var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]),:host(:not([appearance=inverse])[variant=fareBusiness]){--ds-auro-icon-color: var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]),:host(:not([appearance=inverse])[variant=fareEconomy]){--ds-auro-icon-color: var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]),:host(:not([appearance=inverse])[variant=fareFirst]){--ds-auro-icon-color: var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]),:host(:not([appearance=inverse])[variant=farePremiumEconomy]){--ds-auro-icon-color: var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]),:host(:not([appearance=inverse])[variant=tierOneWorldEmerald]){--ds-auro-icon-color: var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]),:host(:not([appearance=inverse])[variant=tierOneWorldSapphire]){--ds-auro-icon-color: var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]),:host(:not([appearance=inverse])[variant=tierOneWorldRuby]){--ds-auro-icon-color: var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]),:host([appearance=inverse]){--ds-auro-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]),:host([appearance=inverse][variant=disabled]){--ds-auro-icon-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]),:host([appearance=inverse][variant=muted]){--ds-auro-icon-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][variant=statusError]),:host([appearance=inverse][variant=statusError]){--ds-auro-icon-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8)}
419
- `;class _ extends z{constructor(){super(),this._initializeDefaults();}_initializeDefaults(){this.variant=void 0,this.uri="https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist",this.runtimeUtils=new p;}static get properties(){return {...z.properties,ariaHidden:{type:String,reflect:true},category:{type:String,reflect:true},customColor:{type:Boolean,reflect:true},customSvg:{type:Boolean},label:{type:Boolean,reflect:true},name:{type:String,reflect:true},variant:{type:String,reflect:true}}}static get styles(){return [z.styles,y,w,x]}static register(t="auro-icon"){p.prototype.registerComponent(t,_);}connectedCallback(){super.connectedCallback(),this.runtimeUtils.handleComponentTagRename(this,"auro-icon");}exposeCssParts(){this.setAttribute("exportparts","svg:iconSvg");}async firstUpdated(){if(await super.firstUpdated(),this.hasAttribute("ariaHidden")&&this.svg){const t=this.svg.querySelector("desc");t&&(t.remove(),this.svg.removeAttribute("aria-labelledby"));}}render(){const t={labelWrapper:true,util_displayHiddenVisually:!this.label};return b`
420
- <div class="componentWrapper">
421
- <div
422
- class="${e({svgWrapper:true})}"
423
- title="${o(this.title||void 0)}">
424
- <span aria-hidden="${o(this.ariaHidden||true)}" part="svg">
425
- ${this.customSvg?b`
426
- <slot name="svg"></slot>
427
- `:b`
428
- ${this.svg}
429
- `}
430
- </span>
431
- </div>
432
-
433
- <div class="${e(t)}" part="label">
434
- <slot></slot>
435
- </div>
436
- </div>
437
- `}}
438
-
439
- var iconVersion = '9.1.2';
440
-
441
- var checkmarkIcon = {"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-labelledby=\"checkmark-sm__desc\" class=\"ico_squareLarge\" role=\"img\" style=\"min-width:var(--auro-size-lg, var(--ds-size-300, 1.5rem));height:var(--auro-size-lg, var(--ds-size-300, 1.5rem));fill:currentColor\" viewBox=\"0 0 24 24\" part=\"svg\"><title/><desc id=\"checkmark-sm__desc\">a small check mark.</desc><path d=\"M8.461 11.84a.625.625 0 1 0-.922.844l2.504 2.738c.247.27.674.27.922 0l5.496-6a.625.625 0 1 0-.922-.844l-5.035 5.496z\"/></svg>"};
442
-
443
- // Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
444
- // See LICENSE in the project root for license information.
445
-
446
-
447
- /**
448
- * Helper method to dispatch custom events.
449
- * @param {HTMLElement} element - Element to dispatch event from.
450
- * @param {string} eventName - Name of the event to dispatch.
451
- * @param {Object} [detail] - Optional detail object to include with the event.
452
- */
453
- function dispatchMenuEvent(element, eventName, detail = null) {
454
- const eventConfig = {
455
- bubbles: true,
456
- cancelable: false,
457
- composed: true
458
- };
459
-
460
- if (detail !== null) {
461
- eventConfig.detail = detail;
462
- }
463
-
464
- element.dispatchEvent(new CustomEvent(eventName, eventConfig));
465
- }
466
-
467
- // Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
468
- // See LICENSE in the project root for license information.
469
-
470
-
471
- let menuOptionIdCounter = 0;
472
-
473
- /**
474
- * The `auro-menuoption` element provides users a way to define a menu option.
475
- * @customElement auro-menuoption
476
- *
477
- * @slot default - The default slot for the menu option text.
478
- *
479
- * @event auroMenuOption-mouseover - Notifies that this option has been hovered over.
480
- */
481
- class AuroMenuOption extends AuroElement {
482
-
483
- /**
484
- * This will register this element with the browser.
485
- * @param {string} [name="auro-menuoption"] - The name of the element that you want to register.
486
- *
487
- * @example
488
- * AuroMenuOption.register("custom-menuoption") // this will register this element to <custom-menuoption/>
489
- *
490
- */
491
- static register(name = "auro-menuoption") {
492
- AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroMenuOption);
493
- }
494
-
495
- /**
496
- * Returns whether the menu option is currently active and selectable.
497
- * An option is considered active if it is not hidden, not disabled, and not static.
498
- * @returns {boolean} True if the option is active, false otherwise.
499
- */
500
- get isActive() {
501
- return !this.hasAttribute('hidden') &&
502
- !this.disabled &&
503
- !this.hasAttribute('static');
504
- }
505
-
506
- constructor() {
507
- super();
508
-
509
- this.bindEvents();
510
-
511
- /**
512
- * @private
513
- */
514
- this.shape = undefined;
515
-
516
- /**
517
- * @private
518
- */
519
- this.size = undefined;
520
-
521
- /**
522
- * Generate unique names for dependency components.
523
- */
524
- const versioning = new AuroDependencyVersioning();
525
- this.iconTag = versioning.generateTag('auro-formkit-menuoption-icon', iconVersion, _);
526
-
527
- this.selected = false;
528
- this.noCheckmark = false;
529
- this.disabled = false;
530
-
531
- /**
532
- * @private
533
- */
534
- this.runtimeUtils = new AuroLibraryRuntimeUtils();
535
-
536
- // Initialize context-related properties
537
- this.menuService = null;
538
- this.unsubscribe = null;
539
-
540
- /**
541
- * @private
542
- */
543
- this.handleMenuChange = this.handleMenuChange.bind(this);
544
- }
545
-
546
- static get properties() {
547
- return {
548
- ...super.properties,
549
-
550
- /**
551
- * When true, disables the menu option.
552
- */
553
- disabled: {
554
- type: Boolean,
555
- reflect: true
556
- },
557
-
558
- /**
559
- * @private
560
- */
561
- event: {
562
- type: String,
563
- reflect: true
564
- },
565
-
566
- /**
567
- * @private
568
- */
569
- layout: {
570
- type: String
571
- },
572
-
573
- /**
574
- * Allows users to set a unique key for the menu option for specified option selection. If no key is provided, the value property will be used.
575
- */
576
- key: {
577
- type: String,
578
- reflect: true
579
- },
580
-
581
- /**
582
- * @private
583
- */
584
- menuService: {
585
- type: Object,
586
- state: true
587
- },
588
-
589
- /**
590
- * @private
591
- */
592
- matchWord: {
593
- type: String,
594
- state: true
595
- },
596
-
597
- /**
598
- * @private
599
- */
600
- noCheckmark: {
601
- type: Boolean,
602
- reflect: true
603
- },
604
-
605
- /**
606
- * Specifies that an option is selected.
607
- */
608
- selected: {
609
- type: Boolean,
610
- reflect: true
611
- },
612
-
613
- /**
614
- * Specifies the tab index of the menu option.
615
- */
616
- tabIndex: {
617
- type: Number,
618
- reflect: true
619
- },
620
-
621
- /**
622
- * Specifies the value to be sent to a server.
623
- */
624
- value: {
625
- type: String,
626
- reflect: true
627
- },
628
- };
629
- }
630
-
631
- static get styles() {
632
- return [
633
- styleCss,
634
- colorCss,
635
- tokensCss
636
- ];
637
- }
638
-
639
- connectedCallback() {
640
- super.connectedCallback();
641
-
642
- // Add the tag name as an attribute if it is different than the component name
643
- // Add this step soon as this node gets attached to the DOM to avoid racing condition with menu's value setting logic.
644
- this.runtimeUtils.handleComponentTagRename(this, 'auro-menuoption');
645
-
646
- // Set up context consumption in connectedCallback
647
- this._contextConsumer = new s$2(this, {
648
- context: MenuContext,
649
- callback: this.attachTo.bind(this),
650
- subscribe: true
651
- });
652
-
653
- // Establish the key property as early as possible
654
- const valueAttr = this.getAttribute('value');
655
- const keyAttr = this.getAttribute('key');
656
- this.key = keyAttr !== null ? keyAttr : valueAttr;
657
- }
658
-
659
- firstUpdated() {
660
- // Add the tag name as an attribute if it is different than the component name
661
- this.runtimeUtils.handleComponentTagRename(this, 'auro-menuoption');
662
-
663
- // Generate unique ID if not already set (required for aria-activedescendant)
664
- if (!this.id) {
665
- menuOptionIdCounter += 1;
666
- this.id = `menuoption-${menuOptionIdCounter}`;
667
- }
668
-
669
- this.setAttribute('role', 'option');
670
- this.setAttribute('aria-selected', 'false');
671
-
672
- this.addEventListener('mouseover', () => {
673
- this.dispatchEvent(new CustomEvent('auroMenuOption-mouseover', {
674
- bubbles: true,
675
- cancelable: false,
676
- composed: true,
677
- detail: this
678
- }));
679
- });
680
- }
681
-
682
- updated(changedProperties) {
683
- super.updated(changedProperties);
684
-
685
- // Update aria-selected attribute if selected changed
686
- if (changedProperties.has('selected')) {
687
-
688
- // Update aria-selected attribute
689
- this.setAttribute('aria-selected', this.selected.toString());
690
-
691
- // Update menu service selection state if this isn't an internal update
692
- if (this.internalUpdateInProgress !== true) {
693
- this.menuService[this.selected ? 'selectOption' : 'deselectOption'](this);
694
- }
695
- }
696
-
697
- if (changedProperties.has('active')) {
698
- this.updateActiveClasses();
699
- }
700
-
701
- // Update text highlight if matchWord changed
702
- if (changedProperties.has('matchWord')) {
703
- this.updateTextHighlight();
704
- }
705
-
706
- // Set the key to be the passed value if no key is provided
707
- if (changedProperties.has('value') && this.key === undefined) {
708
- this.key = this.value;
709
- }
710
- }
711
-
712
- disconnectedCallback() {
713
- if (this.menuService) {
714
- this.menuService.unsubscribe(this.handleMenuChange);
715
- this.menuService.removeMenuOption(this);
716
- }
717
- }
718
-
719
- /**
720
- * Sets up event listeners for user interaction with the menu option.
721
- * This function enables click and mouse enter events to trigger selection and highlighting logic.
722
- */
723
- bindEvents() {
724
- this.addEventListener('click', this.handleClick.bind(this));
725
- this.addEventListener('mouseenter', this.handleMouseEnter.bind(this));
726
- }
727
-
728
- /**
729
- * Attaches this menu option to a menu service and subscribes to its events.
730
- * This method enables the option to participate in menu selection and highlighting logic.
731
- * @param {Object} service - The menu service instance to attach to.
732
- */
733
- attachTo(service) {
734
- if (!service) {
735
- return;
736
- }
737
- this.menuService = service;
738
- this.menuService.addMenuOption(this);
739
- this.menuService.subscribe(this.handleMenuChange);
740
- }
741
-
742
- /**
743
- * Handles changes from the menu service and updates the option's state.
744
- * This function synchronizes the option's properties and selection/highlight state with menu events.
745
- * @param {Object} event - The event object from the menu service.
746
- */
747
- handleMenuChange(event) {
748
-
749
- // Ignore events without a type or property
750
- if (!event || (!event.type && !event.property)) {
751
- return;
752
- }
753
-
754
- // Update reactive properties based on event type
755
- if (event.property && Object.keys(AuroMenuOption.properties).includes(event.property)) {
756
- this[event.property] = event.value;
757
- }
758
-
759
- // Handle highlight changes
760
- if (event.type === 'highlightChange') {
761
- const isActive = event.option === this;
762
- this.active = isActive;
763
- this.updateActiveClasses();
764
- }
765
-
766
- if (event.type === 'stateChange') {
767
- const isSelected = event.selectedOptions.includes(this);
768
- this.setInternalSelected(isSelected);
769
- }
770
- }
771
-
772
- /**
773
- * Updates the internal selected state of the menu option bypassing 'updated' and triggers custom events if selected.
774
- * This function ensures the option's selection state is synchronized with menu logic and notifies listeners.
775
- * @param {boolean} isSelected - Whether the option should be marked as selected.
776
- */
777
- setInternalSelected(isSelected) {
778
- this.internalUpdateInProgress = true;
779
- this.selected = isSelected;
780
-
781
- // Fire custom event if selected
782
- if (isSelected) {
783
- this.handleCustomEvent();
784
- }
785
-
786
- setTimeout(() => {
787
- this.internalUpdateInProgress = false;
788
- }, 0);
789
- }
790
-
791
- /**
792
- * Sets the selected state of the menu option.
793
- * This function updates whether the option is currently selected.
794
- * @param {boolean} isSelected - Whether the option should be marked as selected.
795
- * @deprecated Simply modify the `selected` property directly instead.
796
- */
797
- setSelected(isSelected) {
798
- this.selected = isSelected;
799
- }
800
-
801
- /**
802
- * Updates the active state and visual highlighting of the menu option.
803
- * This function toggles the option's active status and applies or removes the active CSS class.
804
- * @param {boolean} isActive - Whether the option should be marked as active.
805
- * @deprecated Simply modify the `active` property directly instead.
806
- */
807
- updateActive(isActive) {
808
-
809
- // Set active state
810
- this.active = isActive;
811
- this.updateActiveClasses();
812
- }
813
-
814
- /**
815
- * Updates the CSS class for the menu option based on its active state.
816
- * This function adds or removes the 'active' class to visually indicate the option's active status.
817
- * @private
818
- */
819
- updateActiveClasses() {
820
- // Update class based on active state
821
- if (this.active) this.classList.add('active');
822
- else this.classList.remove('active');
823
- }
824
-
825
-
826
- /**
827
- * Updates the visual highlighting of text within the menu option based on the current match word.
828
- * This function highlights matching text segments and manages nested spacers for display formatting.
829
- * @private
830
- */
831
- updateTextHighlight() {
832
-
833
- // Regex for matchWord if needed
834
- let regexWord = null;
835
-
836
- if (this.matchWord && this.matchWord.length) {
837
- const escapedWord = this.matchWord.replace(/[.*+?^${}()|[\]\\]/gu, '\\$&');
838
- regexWord = new RegExp(escapedWord, 'giu');
839
- }
840
-
841
- // Update text highlighting if matchWord changed
842
- if (regexWord &&
843
- this.isActive && !this.hasAttribute('persistent')) {
844
- const nested = this.querySelectorAll('.nestingSpacer');
845
-
846
- const displayValueEl = this.querySelector('[slot="displayValue"]');
847
- if (displayValueEl) {
848
- this.removeChild(displayValueEl);
849
- }
850
-
851
- // Create nested spacers
852
- const nestingSpacerBundle = [...nested].map(() => this.nestingSpacer).join('');
853
-
854
- // Update with spacers and matchWord
855
- this.innerHTML = nestingSpacerBundle +
856
- this.textContent.replace(
857
- regexWord,
858
- (match) => `<strong>${match}</strong>`
859
- );
860
- if (displayValueEl) {
861
- this.append(displayValueEl);
862
- }
863
- }
864
- }
865
-
866
- /**
867
- * Handles click events on the menu option, toggling its selected state.
868
- * This function dispatches a click event and updates selection if the option is not disabled.
869
- * @private
870
- */
871
- handleClick() {
872
- if (!this.disabled) {
873
- this.dispatchClickEvent();
874
- this.selected = !this.selected;
875
- }
876
- }
877
-
878
- /**
879
- * Handles mouse enter events to highlight the menu option.
880
- * This function updates the menu service to set this option as the currently highlighted item if not disabled.
881
- * @private
882
- */
883
- handleMouseEnter() {
884
- if (!this.disabled) {
885
- this.menuService.setHighlightedOption(this);
886
- }
887
- }
888
-
889
- /**
890
- * Dispatches custom events defined for this menu option.
891
- * This function notifies listeners when a custom event is triggered by the option.
892
- * @private
893
- */
894
- handleCustomEvent() {
895
- if (this.event) {
896
- dispatchMenuEvent(this, this.event, { option: this });
897
- dispatchMenuEvent(this, 'auroMenu-customEventFired', { option: this });
898
- }
899
- }
900
-
901
- /**
902
- * Dispatches a click event for this menu option.
903
- * This function notifies listeners that the option has been clicked.
904
- * @private
905
- */
906
- dispatchClickEvent() {
907
- this.dispatchEvent(new CustomEvent('auroMenuOption-click', {
908
- bubbles: true,
909
- cancelable: false,
910
- composed: true,
911
- detail: this
912
- }));
913
- }
914
-
915
- /**
916
- * Generates an HTML element containing an SVG icon based on the provided `svgContent`.
917
- *
918
- * @private
919
- * @param {string} svgContent - The SVG content to be embedded.
920
- * @returns {Element} The HTML element containing the SVG icon.
921
- */
922
- generateIconHtml(svgContent) {
923
- const dom = new DOMParser().parseFromString(svgContent, 'text/html');
924
- const svg = dom.body.firstChild;
925
-
926
- svg.setAttribute('slot', 'svg');
927
-
928
- return u$1`<${this.iconTag} customColor customSvg>${svg}</${this.iconTag}>`;
929
- }
930
-
931
- /**
932
- * Logic to determine the layout of the component.
933
- * @protected
934
- * @returns {void}
935
- */
936
- renderLayout() {
937
-
938
- const fontClassMap = {
939
- xs: 'body-sm',
940
- sm: 'body-default',
941
- md: 'body-default',
942
- lg: 'body-lg',
943
- xl: 'body-lg'
944
- };
945
-
946
- const classes = e({
947
- 'wrapper': true,
948
- [this.size ? fontClassMap[this.size] : 'body-sm']: true,
949
- });
950
-
951
- return u$1`
952
- <div class="${classes}">
953
- ${this.selected && !this.noCheckmark
954
- ? this.generateIconHtml(checkmarkIcon.svg)
955
- : undefined}
956
- <slot></slot>
957
- </div>
958
- `;
959
- }
960
- }
961
-
962
- /* eslint-disable */
963
-
964
- class MenuService {
965
-
966
- /**
967
- * PROPERTIES AND GETTERS
968
- */
969
-
970
- /**
971
- * Gets the list of registered menu options.
972
- * @returns {AuroMenuOption[]}
973
- */
974
- get menuOptions() {
975
- return this._menuOptions;
976
- }
977
-
978
- /**
979
- * Gets the currently highlighted option.
980
- * @returns {AuroMenuOption|null}
981
- */
982
- get highlightedOption() {
983
- return this._menuOptions[this.highlightedIndex] || null;
984
- }
985
-
986
- /**
987
- * Gets the current value(s) of the selected option(s).
988
- * @returns {string|string[]|undefined}
989
- */
990
- get currentValue() {
991
- const values = (this.selectedOptions || []).map(option => option.value);
992
- return this.multiSelect ? values : values[0];
993
- }
994
-
995
- /**
996
- * Gets the label(s) of the currently selected option(s).
997
- * @returns {string}
998
- */
999
- get currentLabel() {
1000
- const labels = (this.selectedOptions || []).map(option => option.textContent);
1001
- return this.multiSelect ? labels.join(", ") : labels[0] || '';
1002
- }
1003
-
1004
- /**
1005
- * Gets the string representation of the current value(s).
1006
- * For multi-select, this is a JSON stringified array.
1007
- * @returns {string|undefined}
1008
- */
1009
- get stringValue() {
1010
- const { currentValue } = this;
1011
-
1012
- if (Array.isArray(currentValue)) {
1013
- if (currentValue.length > 0) {
1014
- return JSON.stringify(currentValue);
1015
- }
1016
- return undefined;
1017
- }
1018
-
1019
- if (typeof currentValue === 'string') {
1020
- if (currentValue.length > 0) {
1021
- return currentValue;
1022
- }
1023
- return undefined;
1024
- }
1025
-
1026
- // Future: handle other types here (e.g., number, object, etc.)
1027
- return undefined;
1028
- }
1029
-
1030
- /**
1031
- * Gets the key(s) of the currently selected option(s).
1032
- * @returns {string|string[]|undefined}
1033
- */
1034
- get currentKeys() {
1035
- const keys = (this.selectedOptions || []).map(option => option.key);
1036
- return this.multiSelect ? keys : keys[0];
1037
- }
1038
-
1039
- /**
1040
- * CONSTRUCTOR
1041
- */
1042
-
1043
- /**
1044
- * Creates a new MenuService instance.
1045
- * @param {Object} options - The options object.
1046
- * @param {AuroMenu} options.host - The host element that this service will control. Required.
1047
- * @throws {Error} If the host is not provided.
1048
- */
1049
- constructor({ host } = {}) {
1050
-
1051
- // Ensure a host was passed
1052
- if (!host) {
1053
- throw new Error("MenuService requires a host element.");
1054
- }
1055
-
1056
- // Attach the service to the host
1057
- this.host = host;
1058
- this.host.addController(this);
1059
-
1060
- // Set default properties
1061
- this.size = undefined;
1062
- this.shape = undefined;
1063
- this.noCheckmark = undefined;
1064
- this.disabled = undefined;
1065
- this.matchWord = undefined;
1066
- this.multiSelect = undefined;
1067
- this.allowDeselect = undefined;
1068
- this.selectAllMatchingOptions = undefined;
1069
-
1070
- this.highlightedIndex = -1;
1071
-
1072
- this._menuOptions = [];
1073
- this._subscribers = [];
1074
- this.internalUpdateInProgress = false;
1075
- this.selectedOptions = [];
1076
- }
1077
-
1078
- /**
1079
- * PROPERTY SYNCING
1080
- */
1081
-
1082
- /**
1083
- * Handles host updates.
1084
- * This is a lit reactive lifecycle method.
1085
- * This comes from the Lit controller interface provided by adding this service as a controller to the host.
1086
- * See constructor for `this.host.addController(this)`
1087
- * You can read more about Lit reactive controllers here: https://lit.dev/docs/composition/controllers/
1088
- */
1089
- hostUpdated() {
1090
-
1091
- // Reset selection if multiSelect mode changes
1092
- if (this.host.multiSelect !== this.multiSelect) {
1093
- this.selectedOptions = [];
1094
- }
1095
-
1096
- // Update properties on host update
1097
- this.setProperties({
1098
- size: this.host.size,
1099
- shape: this.host.shape,
1100
- noCheckmark: this.host.noCheckmark,
1101
- disabled: this.host.disabled,
1102
- matchWord: this.host.matchWord,
1103
- multiSelect: this.host.multiSelect,
1104
- allowDeselect: this.host.allowDeselect,
1105
- selectAllMatchingOptions: this.host.selectAllMatchingOptions
1106
- });
1107
- }
1108
-
1109
- /**
1110
- * Handles host disconnection and memory cleanup.
1111
- */
1112
- hostDisconnected() {
1113
- this._subscribers = [];
1114
- this._menuOptions = [];
1115
- }
1116
-
1117
- /**
1118
- * Sets a property value if it exists on the instance and the value has changed.
1119
- * @param {string} property
1120
- * @param {any} value
1121
- */
1122
- setProperty(property, value) {
1123
-
1124
- // Only update if we are tracking the property in this service
1125
- if (this.hasOwnProperty(property)) {
1126
-
1127
- // Check if the value has changed
1128
- const valueChanged = this[property] !== value;
1129
-
1130
- // Update and notify if changed
1131
- if (valueChanged) {
1132
- this[property] = value;
1133
- this.notify({ property, value });
1134
- }
1135
- }
1136
- }
1137
-
1138
- /**
1139
- * Sets multiple properties on the instance.
1140
- * @param {Object} properties - Key-value pairs of properties to set.
1141
- */
1142
- setProperties(properties) {
1143
- for (const [key, value] of Object.entries(properties)) {
1144
- this.setProperty(key, value);
1145
- }
1146
- }
1147
-
1148
- /**
1149
- * MENU OPTION HIGHLIGHTING
1150
- */
1151
-
1152
- /**
1153
- * Highlights the next active option in the menu.
1154
- */
1155
- highlightNext() {
1156
- this.moveHighlightedOption("next");
1157
- }
1158
-
1159
- /**
1160
- * Highlights the previous active option in the menu.
1161
- */
1162
- highlightPrevious() {
1163
- this.moveHighlightedOption("previous");
1164
- }
1165
-
1166
- /**
1167
- * Moves the highlighted option in the specified direction.
1168
- * @param {string} direction - The direction to move the highlight ("next" or "previous").
1169
- */
1170
- moveHighlightedOption(direction) {
1171
-
1172
- // Get the active options
1173
- const activeOptions = this._menuOptions.filter(option => option.isActive);
1174
-
1175
- // Get the currently active option
1176
- const currentActiveOption = activeOptions[activeOptions.indexOf(this.highlightedOption)];
1177
-
1178
- // Determine the new index based on the currently active option and direction
1179
- let newIndex = currentActiveOption
1180
- ? direction === "previous"
1181
- ? activeOptions.indexOf(currentActiveOption) - 1
1182
- : activeOptions.indexOf(currentActiveOption) + 1
1183
- : direction === "previous"
1184
- ? activeOptions.length - 1
1185
- : 0;
1186
-
1187
- // Wrap around the index if needed
1188
- newIndex = newIndex < 0 ? activeOptions.length - 1 : newIndex >= activeOptions.length ? 0 : newIndex;
1189
-
1190
- // Get the new active option and set it as highlighted
1191
- const newActiveOption = activeOptions[newIndex];
1192
- this.setHighlightedOption(newActiveOption);
1193
- }
1194
-
1195
- /**
1196
- * Sets the highlighted index to the specified option.
1197
- * @param {AuroMenuOption} option - The option to highlight.
1198
- */
1199
- setHighlightedOption(option) {
1200
-
1201
- if (!option) return;
1202
-
1203
- // Get the index of the option to highlight
1204
- const index = this._menuOptions.indexOf(option);
1205
-
1206
- // Update highlighted index
1207
- this.highlightedIndex = index;
1208
-
1209
- // Notify subscribers of highlight change
1210
- this.notify({ type: 'highlightChange', option, index: this.highlightedIndex });
1211
-
1212
- // Dispatch the change event
1213
- this.dispatchChangeEvent('auroMenu-activatedOption', option);
1214
- }
1215
-
1216
- /**
1217
- * Sets the highlighted option to the option at the specified index if it exists.
1218
- * @param {number} index
1219
- */
1220
- setHighlightedIndex(index) {
1221
- const option = this._menuOptions[index] || null;
1222
- this.setHighlightedOption(option);
1223
- }
1224
-
1225
- /**
1226
- * Selects the currently highlighted option.
1227
- */
1228
- selectHighlightedOption() {
1229
- if (this.highlightedOption) {
1230
- this.toggleOption(this.highlightedOption);
1231
- }
1232
- }
1233
-
1234
- /**
1235
- * SELECTION AND DESELECTION METHODS
1236
- */
1237
-
1238
- /**
1239
- * Selects one or more options in a batch operation
1240
- * @param {AuroMenuOption|AuroMenuOption[]} options - Single option or array of options to select
1241
- */
1242
- selectOptions(options) {
1243
- let optionsToSelect = Array.isArray(options) ? options : [options];
1244
-
1245
- // Filter out options that are inactive
1246
- optionsToSelect = optionsToSelect.filter(option => option.isActive);
1247
-
1248
- if (!optionsToSelect.length) return;
1249
-
1250
- if (this.multiSelect) {
1251
- this.selectedOptions = [...(this.selectedOptions || []), ...optionsToSelect];
1252
- } else {
1253
- // In single select mode, only take the last option
1254
- this.selectedOptions = [optionsToSelect[optionsToSelect.length - 1]];
1255
- }
1256
-
1257
- this.stageUpdate();
1258
- }
1259
-
1260
- /**
1261
- * Deselects one or more options in a batch operation
1262
- * @param {AuroMenuOption|AuroMenuOption[]} options - Single option or array of options to deselect
1263
- */
1264
- deselectOptions(options) {
1265
- const optionsToDeselect = Array.isArray(options) ? options : [options];
1266
-
1267
- if (!optionsToDeselect.length) return;
1268
-
1269
- // Check if deselection should be prevented
1270
- const shouldPreventDeselect = !this.allowDeselect && !this.multiSelect;
1271
- const isOnlySelectedOption = this.selectedOptions.length === 1 && optionsToDeselect.includes(this.selectedOptions[0]);
1272
-
1273
- // Prevent deselecting the only selected option if not allowed
1274
- if (shouldPreventDeselect && isOnlySelectedOption) return;
1275
-
1276
- const optionsSet = new Set(optionsToDeselect);
1277
- this.selectedOptions = (this.selectedOptions || [])
1278
- .filter(opt => !optionsSet.has(opt));
1279
-
1280
- this.stageUpdate();
1281
- }
1282
-
1283
- /**
1284
- * Selects a single option.
1285
- * @param {AuroMenuOption} option
1286
- */
1287
- selectOption(option) {
1288
- this.selectOptions(option);
1289
- }
1290
-
1291
- /**
1292
- * Deselects a single option.
1293
- * @param {AuroMenuOption} option
1294
- */
1295
- deselectOption(option) {
1296
- this.deselectOptions(option);
1297
- }
1298
-
1299
- /**
1300
- * Toggles the selection state of a single option.
1301
- * @param {AuroMenuOption} option
1302
- */
1303
- toggleOption(option) {
1304
- if (option.selected) {
1305
- this.deselectOption(option);
1306
- } else {
1307
- this.selectOption(option);
1308
- }
1309
- }
1310
-
1311
- /**
1312
- * Selects options based on their value(s) when compared to a passed value or values.
1313
- * Value or values are normalized to an array of strings that can be matched to option keys.
1314
- * @param {string|number|Array<string|number>} value - The value(s) to select.
1315
- */
1316
- selectByValue(value) {
1317
- // Early exit for invalid/empty values or internal updates
1318
- if (this.internalUpdateInProgress ||
1319
- this.host.internalUpdateInProgress ||
1320
- value === undefined ||
1321
- value === null ||
1322
- (Array.isArray(value) && value.length === 0) ||
1323
- (typeof value === 'string' && value.trim() === '')) {
1324
- return;
1325
- }
1326
-
1327
- this.reset();
1328
-
1329
- // Normalize values to array of strings
1330
- const normalizedValues = this._getNormalizedValues(value);
1331
-
1332
- // Validate for single-select mode
1333
- let validatedValues = normalizedValues;
1334
- if (normalizedValues.length > 1 && !this.multiSelect) {
1335
- console.warn("MenuService - Multiple values provided for single-select menu. Only the first value will be selected.");
1336
- validatedValues = [normalizedValues[0]];
1337
- }
1338
-
1339
- // Find matching options by comparing available options to validated values
1340
- const trackedKeys = new Set();
1341
- const optionsToSelect = this._menuOptions.filter(option => {
1342
- const passesFilter = validatedValues.includes(option.key);
1343
- const alreadyTracked = trackedKeys.has(option.key);
1344
-
1345
- trackedKeys.add(option.key);
1346
-
1347
- // Include the option in the options to be selected if it passes the filter check and
1348
- // either hasn't been tracked yet or selectAllMatchingOptions is true
1349
- return passesFilter && (!alreadyTracked || (alreadyTracked && this.selectAllMatchingOptions));
1350
- });
1351
-
1352
- // Handle selection result
1353
- if (optionsToSelect.length && !this.optionsArraysMatch(optionsToSelect, this.selectedOptions)) {
1354
- this.selectOptions(optionsToSelect);
1355
- } else {
1356
- this.stageUpdate();
1357
- }
1358
-
1359
- // Dispatch failure event if no matches found
1360
- if (!optionsToSelect.length && validatedValues.length) {
1361
- this.dispatchChangeEvent('auroMenu-selectValueFailure', {
1362
- message: 'No matching options found for the provided value(s).',
1363
- values: validatedValues
1364
- });
1365
- }
1366
- }
1367
-
1368
- /**
1369
- * Resets the selected options to an empty array.
1370
- */
1371
- reset() {
1372
- const previousOptions = [...this.selectedOptions];
1373
- this.selectedOptions = [];
1374
-
1375
- // Single update after clearing all
1376
- if (previousOptions.length) {
1377
- this.stageUpdate();
1378
- }
1379
- }
1380
-
1381
- /**
1382
- * SUBSCRIPTION, NOTIFICATION AND EVENT DISPATCH METHODS
1383
- */
1384
-
1385
- /**
1386
- * Subscribes a callback to menu service events.
1387
- * @param {Function} callback - The callback to invoke on events.
1388
- */
1389
- subscribe(callback) {
1390
- this._subscribers.push(callback);
1391
- }
1392
-
1393
- /**
1394
- * Remove a previously subscribed callback from menu service events.
1395
- * @param {Function} callback
1396
- */
1397
- unsubscribe(callback) {
1398
- this._subscribers = this._subscribers.filter(cb => cb !== callback);
1399
- }
1400
-
1401
- /**
1402
- * Stages an update to notify subscribers of state and value changes.
1403
- */
1404
- stageUpdate() {
1405
- this.notifyStateChange();
1406
- this.notifyValueChange();
1407
- }
1408
-
1409
- /**
1410
- * Notifies subscribers of a menu service event.
1411
- * All notifications are sent to all subscribers.
1412
- * @param {string} event - The event to send to subscribers.
1413
- */
1414
- notify(event) {
1415
- this._subscribers.forEach(callback => callback(event));
1416
- }
1417
-
1418
- /**
1419
- * Notifies subscribers of a state change (selected options has changed).
1420
- */
1421
- notifyStateChange() {
1422
- this.notify({ type: 'stateChange', selectedOptions: this.selectedOptions });
1423
- }
1424
-
1425
- /**
1426
- * Notifies subscribers of a value change (current value has changed).
1427
- */
1428
- notifyValueChange() {
1429
-
1430
- // Prepare details for the event
1431
- const details = {
1432
- value: this.currentValue,
1433
- stringValue: this.stringValue,
1434
- keys: this.currentKeys,
1435
- options: this.selectedOptions,
1436
- label: this.currentLabel
1437
- };
1438
-
1439
- // If only one option is selected, include its index
1440
- if (this.selectedOptions.length === 1) details.index = this._menuOptions.indexOf(this.selectedOptions[0]);
1441
-
1442
- this.notify({
1443
- type: 'valueChange',
1444
- ...details
1445
- });
1446
-
1447
- this.dispatchChangeEvent('auroMenu-selectedOption', details);
1448
- }
1449
-
1450
- /**
1451
- * Dispatches a custom event from the host element.
1452
- * @param {string} eventName
1453
- * @param {any} detail
1454
- */
1455
- dispatchChangeEvent(eventName, detail) {
1456
- this.host.dispatchEvent(new CustomEvent(eventName, {
1457
- bubbles: true,
1458
- cancelable: false,
1459
- composed: true,
1460
- detail
1461
- }));
1462
- }
1463
-
1464
- /**
1465
- * MENU OPTION MANAGEMENT METHODS
1466
- */
1467
-
1468
- /**
1469
- * Adds a menu option to the service's list.
1470
- * @param {AuroMenuOption} option - the option to track
1471
- */
1472
- addMenuOption(option) {
1473
- this._menuOptions.push(option);
1474
- this.notify({ type: 'optionsChange', options: this._menuOptions });
1475
- }
1476
-
1477
- /**
1478
- * Removes a menu option from the service's list.
1479
- * @param {AuroMenuOption} option - the option to remove
1480
- */
1481
- removeMenuOption(option) {
1482
- this._menuOptions = this._menuOptions.filter(opt => opt !== option);
1483
- this.notify({ type: 'optionsChange', options: this._menuOptions });
1484
- }
1485
-
1486
- /**
1487
- * UTILITIES
1488
- */
1489
-
1490
- /**
1491
- * Normalizes a value or array of values into an array of strings for option selection.
1492
- * This function ensures that input values are consistently formatted for matching menu options.
1493
- *
1494
- * @param {string|number|Array<string|number>} value - The value(s) to normalize.
1495
- * @returns {Array<string>} An array of string values suitable for option matching.
1496
- * @throws {Error} If any value is not a string or number.
1497
- */
1498
- _getNormalizedValues(value) {
1499
- let values = value;
1500
-
1501
- // Handle JSON string and single value string input
1502
- if (!Array.isArray(values) && typeof values === 'string') {
1503
-
1504
- // Attempt to parse as JSON array
1505
- try {
1506
-
1507
- // Normalize single quotes to double quotes for JSON parsing
1508
- // This will not handle complex cases but will cover basic usage
1509
- const parseValue = values.replace(/'([^']*?)'/g, '"$1"');
1510
-
1511
- // Attempt parse
1512
- const parsed = JSON.parse(parseValue);
1513
-
1514
- // Ensure parsed value is an array
1515
- if (!Array.isArray(parsed)) throw new Error('Not an array');
1516
-
1517
- // Set values to parsed array
1518
- values = parsed;
1519
- } catch (err) {
1520
-
1521
- // If parsing fails, treat as single value
1522
- values = [value];
1523
- }
1524
- }
1525
-
1526
- // Handle a single number being passed
1527
- if (typeof values === 'number') {
1528
- values = [String(values)];
1529
- }
1530
-
1531
- // Coerce each value to string and validate types
1532
- values.forEach((val, index) => {
1533
-
1534
- // Throw an error for invalid value types
1535
- if (typeof val !== 'string' && typeof val !== 'number') {
1536
- throw new Error('Value contains invalid value type. Supported types are string and number.');
1537
- }
1538
-
1539
- // Convert numbers to strings for consistency
1540
- if (typeof val === 'number') {
1541
- values[index] = String(val);
1542
- }
1543
- });
1544
-
1545
- // Return the resulting array of string values
1546
- return values;
1547
- }
1548
-
1549
- /**
1550
- * Returns whether two arrays of options contain the same elements.
1551
- * @param {AuroMenuOption[]} arr1 - First array of options.
1552
- * @param {AuroMenuOption[]} arr2 - Second array of options.
1553
- * @returns {boolean} True if arrays match, false otherwise.
1554
- */
1555
- optionsArraysMatch(arr1, arr2) {
1556
- if (arr1.length !== arr2.length) return false;
1557
-
1558
- const set1 = new Set(arr1);
1559
- const set2 = new Set(arr2);
1560
-
1561
- for (let item of set1) {
1562
- if (!set2.has(item)) {
1563
- return false;
1564
- }
1565
- }
1566
-
1567
- return true;
1568
- }
1569
- }
1570
-
1571
- const MenuContext = n$1('menu-context');
1572
-
1573
- /* eslint-disable no-underscore-dangle */
1574
- // Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
1575
- // See LICENSE in the project root for license information.
1576
-
1577
-
1578
-
1579
- /**
1580
- * The `auro-menu` element provides users a way to select from a list of options.
1581
- * @customElement auro-menu
1582
- *
1583
- * @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
1584
- * @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
1585
- * @event {CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>} auroMenu-loadingChange - Notifies when the loading attribute is changed.
1586
- * @event {CustomEvent<any>} auroMenu-selectValueFailure - Notifies that an attempt to select a menuoption by matching a value has failed.
1587
- * @event {CustomEvent<any>} auroMenu-selectValueReset - Notifies that the component value has been reset.
1588
- * @event {CustomEvent<any>} auroMenu-selectedOption - Notifies that a new menuoption selection has been made.
1589
- * @slot loadingText - Text to show while loading attribute is set
1590
- * @slot loadingIcon - Icon to show while loading attribute is set
1591
- * @slot - Slot for insertion of menu options.
1592
- */
1593
-
1594
- /* eslint-disable max-lines */
1595
-
1596
- class AuroMenu extends AuroElement {
1597
-
1598
- constructor() {
1599
- super();
1600
-
1601
- // State properties (reactive)
1602
-
1603
- /**
1604
- * @private
1605
- */
1606
- this.shape = "box";
1607
-
1608
- /**
1609
- * @private
1610
- */
1611
- this.size = "sm";
1612
-
1613
- // Value of the selected options
1614
- this.value = undefined;
1615
- // Currently selected option
1616
- this.optionSelected = undefined;
1617
- // String used for highlighting/filtering
1618
- this.matchWord = undefined;
1619
- // Hide the checkmark icon on selected options
1620
- this.noCheckmark = false;
1621
- // Currently active option
1622
- this.optionActive = undefined;
1623
- // Loading state
1624
- this.loading = false;
1625
- // Multi-select mode
1626
- this.multiSelect = false;
1627
- // Allow deselecting of menu options
1628
- this.allowDeselect = false;
1629
- // Select all matching options when setting value in multi-select mode
1630
- this.selectAllMatchingOptions = false;
1631
-
1632
- // Event Bindings
1633
-
1634
- /**
1635
- * @private
1636
- */
1637
- this.handleKeyDown = this.handleKeyDown.bind(this);
1638
-
1639
-
1640
- /**
1641
- * @private
1642
- */
1643
- this.handleSlotChange = this.handleSlotChange.bind(this);
1644
-
1645
- // Instance properties (non-reactive)
1646
-
1647
- /**
1648
- * @private
1649
- */
1650
- Object.assign(this, {
1651
- // Root-level menu (true) or a nested submenu (false)
1652
- rootMenu: true,
1653
- // Currently focused/active menu item index
1654
- _index: -1,
1655
- // Nested menu spacer
1656
- nestingSpacer: '<span class="nestingSpacer"></span>',
1657
- // Loading indicator for slot elements
1658
- loadingSlots: null,
1659
- });
1660
- }
1661
-
1662
- static get properties() {
1663
- return {
1664
- ...super.properties,
1665
-
1666
- /**
1667
- * Allows deselecting an already selected option when clicked again in single-select mode.
1668
- */
1669
- allowDeselect: {
1670
- type: Boolean,
1671
- reflect: true,
1672
- },
1673
-
1674
- /**
1675
- * When true, the entire menu and all options are disabled.
1676
- */
1677
- disabled: {
1678
- type: Boolean,
1679
- reflect: true
1680
- },
1681
-
1682
- /**
1683
- * Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
1684
- */
1685
- hasLoadingPlaceholder: {
1686
- type: Boolean
1687
- },
1688
-
1689
- /**
1690
- * @private
1691
- */
1692
- layout: {
1693
- type: String
1694
- },
1695
-
1696
- /**
1697
- * Indent level for submenus.
1698
- * @private
1699
- */
1700
- level: {
1701
- type: Number,
1702
- reflect: false,
1703
- attribute: false
1704
- },
1705
-
1706
- /**
1707
- * When true, displays a loading state using the loadingIcon and loadingText slots if provided.
1708
- */
1709
- loading: {
1710
- type: Boolean,
1711
- reflect: true
1712
- },
1713
-
1714
- /**
1715
- * Specifies a string used to highlight matched string parts in options.
1716
- */
1717
- matchWord: {
1718
- type: String,
1719
- attribute: 'matchword'
1720
- },
1721
-
1722
- /**
1723
- * When true, the selected option can be multiple options.
1724
- */
1725
- multiSelect: {
1726
- type: Boolean,
1727
- reflect: true,
1728
- attribute: 'multiselect'
1729
- },
1730
-
1731
- /**
1732
- * When true, selected option will not show the checkmark.
1733
- */
1734
- noCheckmark: {
1735
- type: Boolean,
1736
- reflect: true,
1737
- attribute: 'nocheckmark'
1738
- },
1739
-
1740
- /**
1741
- * Specifies the current active menuOption.
1742
- */
1743
- optionActive: {
1744
- type: Object,
1745
- attribute: 'optionactive'
1746
- },
1747
-
1748
- /**
1749
- * An array of currently selected menu options, type `HTMLElement` by default. In multi-select mode, `optionSelected` is an array of HTML elements.
1750
- */
1751
- optionSelected: {
1752
- // Allow HTMLElement, HTMLElement[] arrays and undefined
1753
- type: Object
1754
- },
1755
-
1756
- /**
1757
- * Available menu options
1758
- * @readonly
1759
- */
1760
- options: {
1761
- type: Array,
1762
- reflect: false,
1763
- attribute: false
1764
- },
1765
-
1766
- /**
1767
- * Sets the size of the menu.
1768
- * @type {'sm' | 'md'}
1769
- * @default 'sm'
1770
- */
1771
- size: {
1772
- type: String,
1773
- reflect: true
1774
- },
1775
-
1776
- /**
1777
- * When true, selects all options that match the provided value/key when setting value and multiselect is enabled.
1778
- */
1779
- selectAllMatchingOptions: {
1780
- type: Boolean,
1781
- reflect: true,
1782
- },
1783
-
1784
- /**
1785
- * Sets the shape of the menu.
1786
- * @type {'box' | 'round'}
1787
- * @default 'box'
1788
- */
1789
- shape: {
1790
- type: String,
1791
- reflect: true
1792
- },
1793
-
1794
- /**
1795
- * The value of the selected option. In multi-select mode, this is a JSON stringified array of selected option values.
1796
- */
1797
- value: {
1798
- type: String,
1799
- reflect: true,
1800
- attribute: 'value'
1801
- }
1802
- };
1803
- }
1804
-
1805
- static get styles() {
1806
- return [
1807
- styleCss$1,
1808
- colorCss$1,
1809
- tokensCss
1810
- ];
1811
- }
1812
-
1813
- /**
1814
- * @readonly
1815
- * @returns {string} - Returns the label of the currently selected option(s).
1816
- */
1817
- get currentLabel() {
1818
- return this.menuService.currentLabel;
1819
- };
1820
-
1821
- /**
1822
- * @readonly
1823
- * @returns {Array<HTMLElement>} - Returns the array of available menu options.
1824
- * @deprecated use `options` property instead.
1825
- */
1826
- get items() {
1827
- return this.options;
1828
- }
1829
-
1830
- /**
1831
- * @returns {number} - Returns the index of the currently active option.
1832
- */
1833
- get index() {
1834
- return this._index;
1835
- }
1836
-
1837
- /**
1838
- * @param {number} value - Sets the index of the currently active option.
1839
- */
1840
- set index(value) {
1841
- this.menuService.setHighlightedIndex(value);
1842
- }
1843
-
1844
- /**
1845
- * This will register this element with the browser.
1846
- * @param {string} [name="auro-menu"] - The name of the element that you want to register.
1847
- *
1848
- * @example
1849
- * AuroMenu.register("custom-menu") // this will register this element to <custom-menu/>
1850
- *
1851
- */
1852
- static register(name = "auro-menu") {
1853
- AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroMenu);
1854
- }
1855
-
1856
- /**
1857
- * Formatted value based on `multiSelect` state.
1858
- * Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
1859
- * @private
1860
- * @returns {String|Array<String>}
1861
- */
1862
- get formattedValue() {
1863
- return this.menuService.currentValue;
1864
- }
1865
-
1866
- /**
1867
- * Gets the current property values for the menu service.
1868
- * @private
1869
- * @returns {Object}
1870
- */
1871
- get propertyValues() {
1872
- return {
1873
- size: this.size,
1874
- shape: this.shape,
1875
- noCheckmark: this.nocheckmark,
1876
- disabled: this.disabled
1877
- };
1878
- }
1879
-
1880
- /**
1881
- * Provides the menu context to child components.
1882
- * Initializes the MenuService and subscribes to menu changes.
1883
- * @protected
1884
- */
1885
- provideContext() {
1886
- this.menuService = new MenuService({host: this});
1887
- this.menuService.setProperties(this.propertyValues);
1888
- this.menuService.subscribe(this.handleMenuChange.bind(this));
1889
- this._contextProvider = new i$2(this, {
1890
- context: MenuContext,
1891
- initialValue: this.menuService
1892
- });
1893
- }
1894
-
1895
- /**
1896
- * Updates the currently active option in the menu.
1897
- * @param {HTMLElement} option - The option to set as active.
1898
- */
1899
- updateActiveOption(option) {
1900
- this.menuService.setHighlightedOption(option);
1901
- }
1902
-
1903
- /**
1904
- * Sets the internal value and manages update state.
1905
- * @param {String|Array<String>} value - The value to set.
1906
- * @protected
1907
- */
1908
- setInternalValue(value) {
1909
- if (this.value !== value) {
1910
- this.internalUpdateInProgress = true;
1911
- this.value = value;
1912
-
1913
- setTimeout(() => {
1914
- this.internalUpdateInProgress = false;
1915
- });
1916
- }
1917
- }
1918
-
1919
- /**
1920
- * Handles changes from the menu service and updates component state.
1921
- * @param {Object} event - The event object from the menu service.
1922
- * @protected
1923
- */
1924
- handleMenuChange(event) {
1925
- if (event.type === 'valueChange') {
1926
-
1927
- // New option is array value or first option with fallback to undefined for empty array in all cases
1928
- const newOption = this.multiSelect && event.options.length ? event.options : event.options[0] || undefined;
1929
- const newValue = event.stringValue;
1930
-
1931
- // Check if the option or value has actually changed
1932
- if (newValue === undefined || (this.optionSelected !== newOption || this.stringValue !== newValue)) {
1933
- this.optionSelected = newOption;
1934
- this.setInternalValue(newValue);
1935
- }
1936
-
1937
- // Notify components of selection change
1938
- this.notifySelectionChange(event);
1939
- }
1940
-
1941
- if (event.type === 'highlightChange') {
1942
- this.optionActive = event.option;
1943
- this._index = event.index;
1944
- }
1945
-
1946
- if (event.type === 'optionsChange') {
1947
- this.options = event.options;
1948
- this.dispatchEvent(new CustomEvent('auroMenu-optionsChange', {
1949
- detail: {
1950
- options: event.options
1951
- }
1952
- }));
1953
- }
1954
- }
1955
-
1956
- /**
1957
- * Gets the currently selected options.
1958
- * @returns {Array<HTMLElement>}
1959
- */
1960
- get selectedOptions() {
1961
- return this.menuService ? this.menuService.selectedOptions : [];
1962
- }
1963
-
1964
- /**
1965
- * Gets the first selected option, or null if none.
1966
- * @returns {HTMLElement|null}
1967
- */
1968
- get selectedOption() {
1969
- return this.menuService ? this.menuService.selectedOptions[0] : null;
1970
- }
1971
-
1972
- // Lifecycle Methods
1973
-
1974
- connectedCallback() {
1975
- super.connectedCallback();
1976
-
1977
- this.provideContext();
1978
-
1979
- this.addEventListener('keydown', this.handleKeyDown);
1980
- this.addEventListener('auroMenuOption-click', this.handleMouseSelect);
1981
- this.addEventListener('auroMenuOption-mouseover', this.handleOptionHover);
1982
- this.addEventListener('slotchange', this.handleSlotChange);
1983
- this.setTagAttribute("auro-menu");
1984
- }
1985
-
1986
- disconnectedCallback() {
1987
- this.removeEventListener('keydown', this.handleKeyDown);
1988
- this.removeEventListener('auroMenuOption-click', this.handleMouseSelect);
1989
- this.removeEventListener('auroMenuOption-mouseover', this.handleOptionHover);
1990
- this.removeEventListener('slotchange', this.handleSlotChange);
1991
-
1992
- super.disconnectedCallback();
1993
- }
1994
-
1995
- firstUpdated() {
1996
- AuroLibraryRuntimeUtils.prototype.handleComponentTagRename(this, 'auro-menu');
1997
-
1998
- this.loadingSlots = this.querySelectorAll("[slot='loadingText'], [slot='loadingIcon']");
1999
- this.initializeMenu();
2000
- }
2001
-
2002
-
2003
- updated(changedProperties) {
2004
- super.updated(changedProperties);
2005
-
2006
- // Update menu service properties on host update
2007
- if (changedProperties.has('value')) {
2008
- this.menuService.selectByValue(this.value);
2009
- }
2010
-
2011
- // Handle loading state changes
2012
- if (changedProperties.has('loading')) {
2013
- this.setLoadingState(this.loading);
2014
- }
2015
-
2016
- if (changedProperties.has('multiSelect') && this.rootMenu) {
2017
- if (this.multiSelect) {
2018
- this.setAttribute('aria-multiselectable', 'true');
2019
- } else {
2020
- this.removeAttribute('aria-multiselectable');
2021
- }
2022
- }
2023
- }
2024
-
2025
- /**
2026
- * Sets an attribute that matches the default tag name if the tag name is not the default.
2027
- * @param {string} tagName - The tag name to set as an attribute.
2028
- * @private
2029
- */
2030
- setTagAttribute(tagName) {
2031
- if (this.tagName.toLowerCase() !== tagName) {
2032
- this.setAttribute(tagName, true);
2033
- }
2034
- }
2035
-
2036
- /**
2037
- * Sets the loading state and dispatches a loading change event.
2038
- * @param {boolean} isLoading - Whether the menu is loading.
2039
- * @protected
2040
- */
2041
- setLoadingState(isLoading) {
2042
- this.setAttribute("aria-busy", isLoading);
2043
- dispatchMenuEvent(this, "auroMenu-loadingChange", {
2044
- loading: isLoading,
2045
- hasLoadingPlaceholder: this.hasLoadingPlaceholder
2046
- });
2047
- }
2048
-
2049
- // Init Methods
2050
-
2051
- /**
2052
- * Initializes the menu's state and structure.
2053
- * @private
2054
- */
2055
- initializeMenu() {
2056
- if (this.rootMenu) {
2057
- this.setAttribute('role', 'listbox');
2058
- this.setAttribute('root', '');
2059
-
2060
- if (this.multiSelect) {
2061
- this.setAttribute('aria-multiselectable', 'true');
2062
- }
2063
-
2064
- this.handleNestedMenus(this);
2065
- }
2066
- }
2067
-
2068
- /**
2069
- * Selects the currently highlighted option.
2070
- * @protected
2071
- */
2072
- makeSelection() {
2073
- this.menuService.selectHighlightedOption();
2074
- }
2075
-
2076
- /**
2077
- * Resets all options to their default state.
2078
- * @private
2079
- */
2080
- clearSelection() {
2081
- this.optionSelected = undefined;
2082
- this.value = undefined;
2083
- this._index = -1;
2084
- }
2085
-
2086
- /**
2087
- * Resets the menu to its initial state.
2088
- * This is the only way to return value to undefined.
2089
- * @public
2090
- */
2091
- reset() {
2092
- this.menuService.reset();
2093
-
2094
- // Dispatch reset event
2095
- dispatchMenuEvent(this, 'auroMenu-selectValueReset');
2096
- }
2097
-
2098
- /**
2099
- * Handles nested menu structure.
2100
- * @private
2101
- * @param {HTMLElement} menu - Root menu element.
2102
- */
2103
- handleNestedMenus(menu) {
2104
- menu.level = menu.parentElement.level >= 0 ? menu.parentElement.level + 1 : 0;
2105
-
2106
- if (menu.level > 0) {
2107
- menu.setAttribute('role', 'group');
2108
- menu.removeAttribute("root");
2109
- if (!menu.hasAttribute('aria-label')) {
2110
- menu.setAttribute('aria-label', 'submenu');
2111
- }
2112
- }
2113
-
2114
- const options = menu.querySelectorAll(':scope > auro-menuoption, :scope > [auro-menuoption]');
2115
- options.forEach((option) => {
2116
- const regex = new RegExp(this.nestingSpacer, "gu");
2117
- option.innerHTML = this.nestingSpacer.repeat(menu.level) + option.innerHTML.replace(regex, '');
2118
- });
2119
- }
2120
-
2121
- // Event Handlers
2122
-
2123
- /**
2124
- * Handles keyboard navigation.
2125
- * @private
2126
- * @param {KeyboardEvent} event - Event object from the browser.
2127
- */
2128
- handleKeyDown(event) {
2129
- event.preventDefault();
2130
- switch (event.key) {
2131
- case "ArrowDown":
2132
- this.menuService.highlightNext();
2133
- break;
2134
- case "ArrowUp":
2135
- this.menuService.highlightPrevious();
2136
- break;
2137
- case "Tab":
2138
- case "Enter":
2139
- this.menuService.selectHighlightedOption();
2140
- break;
2141
- }
2142
- }
2143
-
2144
- /**
2145
- * Navigates the menu options in the specified direction.
2146
- * @param {'up'|'down'} direction - The direction to navigate.
2147
- * @protected
2148
- */
2149
- navigateOptions(direction) {
2150
- if (direction === 'up') {
2151
- this.menuService.highlightPrevious();
2152
- } else if (direction === 'down') {
2153
- this.menuService.highlightNext();
2154
- }
2155
- }
2156
-
2157
- /**
2158
- * Handles slot change events.
2159
- * @private
2160
- */
2161
- handleSlotChange() {
2162
- if (this.parentElement && this.parentElement.closest('auro-menu, [auro-menu]')) {
2163
- this.rootMenu = false;
2164
- }
2165
-
2166
- if (this.rootMenu) {
2167
- this.initializeMenu();
2168
- }
2169
- }
2170
-
2171
- /**
2172
- * Handles custom events defined on options.
2173
- * @private
2174
- * @param {HTMLElement} option - Option with custom event.
2175
- */
2176
- handleCustomEvent(option) {
2177
- const eventName = option.getAttribute('event');
2178
- dispatchMenuEvent(this, eventName);
2179
- dispatchMenuEvent(this, 'auroMenu-customEventFired');
2180
- }
2181
-
2182
- /**
2183
- * Notifies selection change to parent components.
2184
- * @param {any} source - The source that triggers this event.
2185
- * @private
2186
- */
2187
- notifySelectionChange({value, stringValue, keys, options} = {}) {
2188
- dispatchMenuEvent(this, 'auroMenu-selectedOption', {
2189
- value,
2190
- stringValue,
2191
- keys,
2192
- options
2193
- });
2194
- }
2195
-
2196
- /**
2197
- * Checks if an option is currently selected.
2198
- * @private
2199
- * @param {HTMLElement} option - The option to check.
2200
- * @returns {boolean}
2201
- */
2202
- isOptionSelected(option) {
2203
- if (!this.optionSelected) {
2204
- return false;
2205
- }
2206
-
2207
- if (this.multiSelect) {
2208
- // In multi-select mode, check if the option is in the selected array
2209
- return Array.isArray(this.optionSelected) && this.optionSelected.some((selectedOption) => selectedOption === option);
2210
- }
2211
-
2212
- return this.optionSelected === option;
2213
- }
2214
-
2215
- /**
2216
- * Getter for loading placeholder state.
2217
- * @returns {boolean} - True if loading slots are present and non-empty.
2218
- */
2219
- get hasLoadingPlaceholder() {
2220
- return this.loadingSlots && this.loadingSlots.length > 0;
2221
- }
2222
-
2223
- /**
2224
- * Getter for wrapper classes based on size.
2225
- * @returns {Object} - Class map for the wrapper element.
2226
- * @private
2227
- */
2228
- get wrapperClasses() {
2229
- return e({
2230
- 'menuWrapper': true,
2231
- [this.size]: true,
2232
- });
2233
- }
2234
-
2235
- /**
2236
- * Logic to determine the layout of the component.
2237
- * @protected
2238
- * @returns {void}
2239
- */
2240
- renderLayout() {
2241
- if (this.loading) {
2242
- return b`
2243
- <div class="${this.wrapperClasses}">
2244
- <auro-menuoption
2245
- disabled
2246
- loadingplaceholder
2247
- class="${this.hasLoadingPlaceholder ? "" : "empty"}"
2248
- >
2249
- <div>
2250
- <slot name="loadingIcon" class="body-lg"></slot>
2251
- <slot name="loadingText"></slot>
2252
- </div>
2253
- </auro-menuoption>
2254
- </div>
2255
- `;
2256
- }
2257
-
2258
- return b`
2259
- <div class="${this.wrapperClasses}">
2260
- <slot @slotchange=${this.handleSlotChange}></slot>
2261
- </div>
2262
- `;
2263
- }
2264
- }
2265
-
2266
- AuroMenu.register();
2267
- AuroMenuOption.register();
2268
-
2269
- /* eslint-disable jsdoc/require-jsdoc, no-magic-numbers, no-param-reassign */
2270
-
2271
-
2272
- function initExamples(initCount) {
2273
- initCount = initCount || 0;
2274
-
2275
- try {
2276
- // javascript example function calls to be added here upon creation to test examples
2277
- initKeysExample();
2278
- auroMenuLoadingExample();
2279
- auroMenuMatchWordExample();
2280
- initSelectAllMatchingOptionsExample();
2281
- auroMenuResetExample();
2282
- } catch (err) {
2283
- if (initCount <= 20) {
2284
- // setTimeout handles issue where content is sometimes loaded after the functions get called
2285
- setTimeout(() => {
2286
- initExamples(initCount + 1);
2287
- }, 100);
2288
- }
2289
- }
2290
- }
2291
-
2292
- export { initExamples };