@aurodesignsystem-dev/auro-formkit 0.0.0-pr1001.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (297) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE +201 -0
  3. package/NOTICE +2 -0
  4. package/README.md +314 -0
  5. package/components/bibtemplate/dist/auro-bibtemplate.d.ts +50 -0
  6. package/components/bibtemplate/dist/buttonVersion.d.ts +2 -0
  7. package/components/bibtemplate/dist/headerVersion.d.ts +2 -0
  8. package/components/bibtemplate/dist/iconVersion.d.ts +2 -0
  9. package/components/bibtemplate/dist/index.d.ts +2 -0
  10. package/components/bibtemplate/dist/index.js +1940 -0
  11. package/components/bibtemplate/dist/registered.js +1940 -0
  12. package/components/bibtemplate/dist/styles/color-css.d.ts +2 -0
  13. package/components/bibtemplate/dist/styles/style-css.d.ts +2 -0
  14. package/components/bibtemplate/dist/styles/tokens-css.d.ts +2 -0
  15. package/components/checkbox/README.md +142 -0
  16. package/components/checkbox/demo/api.html +61 -0
  17. package/components/checkbox/demo/api.js +17 -0
  18. package/components/checkbox/demo/api.md +436 -0
  19. package/components/checkbox/demo/api.min.js +1870 -0
  20. package/components/checkbox/demo/index.html +57 -0
  21. package/components/checkbox/demo/index.js +8 -0
  22. package/components/checkbox/demo/index.md +327 -0
  23. package/components/checkbox/demo/index.min.js +1845 -0
  24. package/components/checkbox/demo/readme.html +57 -0
  25. package/components/checkbox/demo/readme.md +142 -0
  26. package/components/checkbox/dist/auro-checkbox-group.d.ts +166 -0
  27. package/components/checkbox/dist/auro-checkbox.d.ts +136 -0
  28. package/components/checkbox/dist/helptextVersion.d.ts +2 -0
  29. package/components/checkbox/dist/index.d.ts +3 -0
  30. package/components/checkbox/dist/index.js +1794 -0
  31. package/components/checkbox/dist/registered.js +1795 -0
  32. package/components/checkbox/dist/styles/auro-checkbox-css.d.ts +2 -0
  33. package/components/checkbox/dist/styles/auro-checkbox-group-css.d.ts +2 -0
  34. package/components/checkbox/dist/styles/color-css.d.ts +2 -0
  35. package/components/checkbox/dist/styles/colorGroup-css.d.ts +2 -0
  36. package/components/checkbox/dist/styles/tokens-css.d.ts +2 -0
  37. package/components/combobox/README.md +154 -0
  38. package/components/combobox/demo/api.html +63 -0
  39. package/components/combobox/demo/api.js +36 -0
  40. package/components/combobox/demo/api.md +1326 -0
  41. package/components/combobox/demo/api.min.js +18691 -0
  42. package/components/combobox/demo/index.html +63 -0
  43. package/components/combobox/demo/index.js +26 -0
  44. package/components/combobox/demo/index.md +725 -0
  45. package/components/combobox/demo/index.min.js +18545 -0
  46. package/components/combobox/demo/readme.html +57 -0
  47. package/components/combobox/demo/readme.md +154 -0
  48. package/components/combobox/dist/auro-combobox.d.ts +434 -0
  49. package/components/combobox/dist/bibtemplateVersion.d.ts +2 -0
  50. package/components/combobox/dist/dropdownVersion.d.ts +2 -0
  51. package/components/combobox/dist/index.d.ts +2 -0
  52. package/components/combobox/dist/index.js +16999 -0
  53. package/components/combobox/dist/inputVersion.d.ts +2 -0
  54. package/components/combobox/dist/registered.js +17001 -0
  55. package/components/combobox/dist/styles/emphasized/style-css.d.ts +2 -0
  56. package/components/combobox/dist/styles/snowflake/style-css.d.ts +2 -0
  57. package/components/combobox/dist/styles/style-css.d.ts +2 -0
  58. package/components/counter/README.md +146 -0
  59. package/components/counter/demo/api.html +61 -0
  60. package/components/counter/demo/api.js +20 -0
  61. package/components/counter/demo/api.md +730 -0
  62. package/components/counter/demo/api.min.js +10406 -0
  63. package/components/counter/demo/index.html +61 -0
  64. package/components/counter/demo/index.js +21 -0
  65. package/components/counter/demo/index.md +401 -0
  66. package/components/counter/demo/index.min.js +10370 -0
  67. package/components/counter/demo/readme.html +57 -0
  68. package/components/counter/demo/readme.md +146 -0
  69. package/components/counter/dist/auro-counter-button.d.ts +14 -0
  70. package/components/counter/dist/auro-counter-group.d.ts +386 -0
  71. package/components/counter/dist/auro-counter-wrapper.d.ts +22 -0
  72. package/components/counter/dist/auro-counter.d.ts +113 -0
  73. package/components/counter/dist/bibtemplateVersion.d.ts +2 -0
  74. package/components/counter/dist/dropdownVersion.d.ts +2 -0
  75. package/components/counter/dist/helptextVersion.d.ts +2 -0
  76. package/components/counter/dist/iconVersion.d.ts +2 -0
  77. package/components/counter/dist/index.d.ts +3 -0
  78. package/components/counter/dist/index.js +10313 -0
  79. package/components/counter/dist/registered.js +10314 -0
  80. package/components/counter/dist/styles/color-css.d.ts +2 -0
  81. package/components/counter/dist/styles/counter-button-color-css.d.ts +2 -0
  82. package/components/counter/dist/styles/counter-button-css.d.ts +2 -0
  83. package/components/counter/dist/styles/counter-group-css.d.ts +2 -0
  84. package/components/counter/dist/styles/counter-wrapper-color-css.d.ts +2 -0
  85. package/components/counter/dist/styles/counter-wrapper-css.d.ts +2 -0
  86. package/components/counter/dist/styles/shapeSize-css.d.ts +2 -0
  87. package/components/counter/dist/styles/style-css.d.ts +2 -0
  88. package/components/counter/dist/styles/tokens-css.d.ts +2 -0
  89. package/components/datepicker/README.md +141 -0
  90. package/components/datepicker/demo/api.html +63 -0
  91. package/components/datepicker/demo/api.js +35 -0
  92. package/components/datepicker/demo/api.md +1529 -0
  93. package/components/datepicker/demo/api.min.js +29755 -0
  94. package/components/datepicker/demo/index.html +62 -0
  95. package/components/datepicker/demo/index.js +19 -0
  96. package/components/datepicker/demo/index.md +204 -0
  97. package/components/datepicker/demo/index.min.js +29476 -0
  98. package/components/datepicker/demo/readme.html +57 -0
  99. package/components/datepicker/demo/readme.md +141 -0
  100. package/components/datepicker/dist/auro-calendar-cell.d.ts +163 -0
  101. package/components/datepicker/dist/auro-calendar-month.d.ts +20 -0
  102. package/components/datepicker/dist/auro-calendar.d.ts +133 -0
  103. package/components/datepicker/dist/auro-datepicker.d.ts +625 -0
  104. package/components/datepicker/dist/bibtemplateVersion.d.ts +2 -0
  105. package/components/datepicker/dist/buttonVersion.d.ts +2 -0
  106. package/components/datepicker/dist/dropdownVersion.d.ts +2 -0
  107. package/components/datepicker/dist/iconVersion.d.ts +2 -0
  108. package/components/datepicker/dist/index.d.ts +2 -0
  109. package/components/datepicker/dist/index.js +29406 -0
  110. package/components/datepicker/dist/inputVersion.d.ts +2 -0
  111. package/components/datepicker/dist/popoverVersion.d.ts +2 -0
  112. package/components/datepicker/dist/registered.js +29406 -0
  113. package/components/datepicker/dist/styles/classic/color-css.d.ts +2 -0
  114. package/components/datepicker/dist/styles/classic/style-css.d.ts +2 -0
  115. package/components/datepicker/dist/styles/color-calendar-css.d.ts +2 -0
  116. package/components/datepicker/dist/styles/color-cell-css.d.ts +2 -0
  117. package/components/datepicker/dist/styles/color-css.d.ts +2 -0
  118. package/components/datepicker/dist/styles/color-month-css.d.ts +2 -0
  119. package/components/datepicker/dist/styles/shapeSize-css.d.ts +2 -0
  120. package/components/datepicker/dist/styles/snowflake/color-css.d.ts +2 -0
  121. package/components/datepicker/dist/styles/snowflake/style-css.d.ts +2 -0
  122. package/components/datepicker/dist/styles/style-auro-calendar-cell-css.d.ts +2 -0
  123. package/components/datepicker/dist/styles/style-auro-calendar-css.d.ts +2 -0
  124. package/components/datepicker/dist/styles/style-auro-calendar-month-css.d.ts +2 -0
  125. package/components/datepicker/dist/styles/style-css.d.ts +2 -0
  126. package/components/datepicker/dist/styles/tokens-css.d.ts +2 -0
  127. package/components/datepicker/dist/utilities.d.ts +78 -0
  128. package/components/datepicker/dist/utilitiesCalendar.d.ts +38 -0
  129. package/components/datepicker/dist/utilitiesCalendarRender.d.ts +50 -0
  130. package/components/datepicker/dist/vendor/wc-range-datepicker/day.d.ts +5 -0
  131. package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker-calendar.d.ts +60 -0
  132. package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker-cell.d.ts +1 -0
  133. package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker.d.ts +57 -0
  134. package/components/dropdown/README.md +144 -0
  135. package/components/dropdown/demo/api.html +63 -0
  136. package/components/dropdown/demo/api.js +21 -0
  137. package/components/dropdown/demo/api.md +1266 -0
  138. package/components/dropdown/demo/api.min.js +4442 -0
  139. package/components/dropdown/demo/index.html +61 -0
  140. package/components/dropdown/demo/index.js +19 -0
  141. package/components/dropdown/demo/index.md +337 -0
  142. package/components/dropdown/demo/index.min.js +4405 -0
  143. package/components/dropdown/demo/readme.html +57 -0
  144. package/components/dropdown/demo/readme.md +144 -0
  145. package/components/dropdown/dist/auro-dropdown.d.ts +425 -0
  146. package/components/dropdown/dist/auro-dropdownBib.d.ts +68 -0
  147. package/components/dropdown/dist/dropdownVersion.d.ts +2 -0
  148. package/components/dropdown/dist/helptextVersion.d.ts +2 -0
  149. package/components/dropdown/dist/iconVersion.d.ts +2 -0
  150. package/components/dropdown/dist/index.d.ts +2 -0
  151. package/components/dropdown/dist/index.js +4350 -0
  152. package/components/dropdown/dist/registered.js +4350 -0
  153. package/components/dropdown/dist/styles/classic/bibColors-css.d.ts +2 -0
  154. package/components/dropdown/dist/styles/classic/bibStyles-css.d.ts +2 -0
  155. package/components/dropdown/dist/styles/classic/color-css.d.ts +2 -0
  156. package/components/dropdown/dist/styles/classic/style-css.d.ts +2 -0
  157. package/components/dropdown/dist/styles/color-css.d.ts +2 -0
  158. package/components/dropdown/dist/styles/emphasized/style-css.d.ts +2 -0
  159. package/components/dropdown/dist/styles/shapeSize-css.d.ts +2 -0
  160. package/components/dropdown/dist/styles/snowflake/style-css.d.ts +2 -0
  161. package/components/dropdown/dist/styles/style-css.d.ts +2 -0
  162. package/components/dropdown/dist/styles/tokens-css.d.ts +2 -0
  163. package/components/form/README.md +142 -0
  164. package/components/form/demo/api.html +56 -0
  165. package/components/form/demo/api.js +3 -0
  166. package/components/form/demo/api.md +51 -0
  167. package/components/form/demo/api.min.js +638 -0
  168. package/components/form/demo/autocomplete.html +31 -0
  169. package/components/form/demo/index.html +57 -0
  170. package/components/form/demo/index.js +4 -0
  171. package/components/form/demo/index.md +403 -0
  172. package/components/form/demo/index.min.js +639 -0
  173. package/components/form/demo/readme.html +57 -0
  174. package/components/form/demo/readme.md +142 -0
  175. package/components/form/demo/registerDemoDeps.js +23 -0
  176. package/components/form/demo/working.html +124 -0
  177. package/components/form/dist/auro-form.d.ts +223 -0
  178. package/components/form/dist/index.d.ts +2 -0
  179. package/components/form/dist/index.js +614 -0
  180. package/components/form/dist/registered.d.ts +1 -0
  181. package/components/form/dist/registered.js +614 -0
  182. package/components/form/dist/styles/style-css.d.ts +2 -0
  183. package/components/helptext/dist/auro-helptext.d.ts +59 -0
  184. package/components/helptext/dist/index.d.ts +2 -0
  185. package/components/helptext/dist/index.js +207 -0
  186. package/components/helptext/dist/registered.js +207 -0
  187. package/components/helptext/dist/styles/color-css.d.ts +2 -0
  188. package/components/helptext/dist/styles/style-css.d.ts +2 -0
  189. package/components/helptext/dist/styles/tokens-css.d.ts +2 -0
  190. package/components/input/README.md +139 -0
  191. package/components/input/demo/api.html +48 -0
  192. package/components/input/demo/api.js +29 -0
  193. package/components/input/demo/api.md +1366 -0
  194. package/components/input/demo/api.min.js +8542 -0
  195. package/components/input/demo/index.html +49 -0
  196. package/components/input/demo/index.js +20 -0
  197. package/components/input/demo/index.md +270 -0
  198. package/components/input/demo/index.min.js +8461 -0
  199. package/components/input/demo/readme.html +57 -0
  200. package/components/input/demo/readme.md +139 -0
  201. package/components/input/dist/auro-input.d.ts +167 -0
  202. package/components/input/dist/base-input.d.ts +566 -0
  203. package/components/input/dist/buttonVersion.d.ts +2 -0
  204. package/components/input/dist/helptextVersion.d.ts +2 -0
  205. package/components/input/dist/i18n.d.ts +18 -0
  206. package/components/input/dist/iconVersion.d.ts +2 -0
  207. package/components/input/dist/index.d.ts +2 -0
  208. package/components/input/dist/index.js +8367 -0
  209. package/components/input/dist/registered.js +8367 -0
  210. package/components/input/dist/styles/classic/color-css.d.ts +2 -0
  211. package/components/input/dist/styles/classic/style-css.d.ts +2 -0
  212. package/components/input/dist/styles/color-css.d.ts +2 -0
  213. package/components/input/dist/styles/default/borders-css.d.ts +2 -0
  214. package/components/input/dist/styles/default/color-css.d.ts +2 -0
  215. package/components/input/dist/styles/default/mixins-css.d.ts +2 -0
  216. package/components/input/dist/styles/default/notificationIcons-css.d.ts +2 -0
  217. package/components/input/dist/styles/default/style-css.d.ts +2 -0
  218. package/components/input/dist/styles/emphasized/color-css.d.ts +2 -0
  219. package/components/input/dist/styles/emphasized/style-css.d.ts +2 -0
  220. package/components/input/dist/styles/mixins-css.d.ts +2 -0
  221. package/components/input/dist/styles/shapeSize-css.d.ts +2 -0
  222. package/components/input/dist/styles/snowflake/style-css.d.ts +2 -0
  223. package/components/input/dist/styles/style-css.d.ts +2 -0
  224. package/components/input/dist/styles/tokens-css.d.ts +2 -0
  225. package/components/input/dist/utilities.d.ts +25 -0
  226. package/components/layoutElement/dist/auroElement.d.ts +34 -0
  227. package/components/layoutElement/dist/index.d.ts +2 -0
  228. package/components/layoutElement/dist/index.js +98 -0
  229. package/components/layoutElement/dist/registered.js +98 -0
  230. package/components/menu/README.md +145 -0
  231. package/components/menu/demo/api.html +62 -0
  232. package/components/menu/demo/api.js +27 -0
  233. package/components/menu/demo/api.md +1011 -0
  234. package/components/menu/demo/api.min.js +1762 -0
  235. package/components/menu/demo/index.html +58 -0
  236. package/components/menu/demo/index.js +28 -0
  237. package/components/menu/demo/index.md +61 -0
  238. package/components/menu/demo/index.min.js +1708 -0
  239. package/components/menu/demo/readme.html +57 -0
  240. package/components/menu/demo/readme.md +145 -0
  241. package/components/menu/dist/auro-menu-utils.d.ts +34 -0
  242. package/components/menu/dist/auro-menu.d.ts +246 -0
  243. package/components/menu/dist/auro-menuoption.d.ts +81 -0
  244. package/components/menu/dist/dropdownVersion.d.ts +2 -0
  245. package/components/menu/dist/iconVersion.d.ts +2 -0
  246. package/components/menu/dist/index.d.ts +4 -0
  247. package/components/menu/dist/index.js +1691 -0
  248. package/components/menu/dist/registered.js +1651 -0
  249. package/components/menu/dist/styles/default/color-menu-css.d.ts +2 -0
  250. package/components/menu/dist/styles/default/color-menuoption-css.d.ts +2 -0
  251. package/components/menu/dist/styles/default/style-menu-css.d.ts +2 -0
  252. package/components/menu/dist/styles/default/style-menuoption-css.d.ts +2 -0
  253. package/components/menu/dist/styles/default/tokens-css.d.ts +2 -0
  254. package/components/radio/README.md +137 -0
  255. package/components/radio/demo/api.html +59 -0
  256. package/components/radio/demo/api.js +19 -0
  257. package/components/radio/demo/api.md +602 -0
  258. package/components/radio/demo/api.min.js +1951 -0
  259. package/components/radio/demo/index.html +56 -0
  260. package/components/radio/demo/index.js +8 -0
  261. package/components/radio/demo/index.md +150 -0
  262. package/components/radio/demo/index.min.js +1908 -0
  263. package/components/radio/demo/readme.html +57 -0
  264. package/components/radio/demo/readme.md +137 -0
  265. package/components/radio/dist/auro-radio-group.d.ts +194 -0
  266. package/components/radio/dist/auro-radio.d.ts +147 -0
  267. package/components/radio/dist/helptextVersion.d.ts +2 -0
  268. package/components/radio/dist/index.d.ts +3 -0
  269. package/components/radio/dist/index.js +1857 -0
  270. package/components/radio/dist/registered.js +1858 -0
  271. package/components/radio/dist/styles/auro-radio-group-css.d.ts +2 -0
  272. package/components/radio/dist/styles/color-css.d.ts +2 -0
  273. package/components/radio/dist/styles/groupColor-css.d.ts +2 -0
  274. package/components/radio/dist/styles/style-css.d.ts +2 -0
  275. package/components/radio/dist/styles/tokens-css.d.ts +2 -0
  276. package/components/select/README.md +145 -0
  277. package/components/select/demo/api.html +77 -0
  278. package/components/select/demo/api.js +35 -0
  279. package/components/select/demo/api.md +1413 -0
  280. package/components/select/demo/api.min.js +10502 -0
  281. package/components/select/demo/index.html +73 -0
  282. package/components/select/demo/index.js +9 -0
  283. package/components/select/demo/index.md +1151 -0
  284. package/components/select/demo/index.min.js +10390 -0
  285. package/components/select/demo/readme.html +57 -0
  286. package/components/select/demo/readme.md +145 -0
  287. package/components/select/dist/auro-select.d.ts +512 -0
  288. package/components/select/dist/bibtemplateVersion.d.ts +2 -0
  289. package/components/select/dist/dropdownVersion.d.ts +2 -0
  290. package/components/select/dist/helptextVersion.d.ts +2 -0
  291. package/components/select/dist/index.d.ts +2 -0
  292. package/components/select/dist/index.js +8898 -0
  293. package/components/select/dist/registered.js +8898 -0
  294. package/components/select/dist/styles/shapeSize-css.d.ts +2 -0
  295. package/components/select/dist/styles/style-css.d.ts +2 -0
  296. package/components/select/dist/styles/tokens-css.d.ts +2 -0
  297. package/package.json +218 -0
@@ -0,0 +1,4350 @@
1
+ import { unsafeStatic, literal, html as html$1 } from 'lit/static-html.js';
2
+ import { classMap } from 'lit/directives/class-map.js';
3
+ import { LitElement, css, html } from 'lit';
4
+ import { ifDefined } from 'lit/directives/if-defined.js';
5
+
6
+ // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
7
+ // See LICENSE in the project root for license information.
8
+
9
+ // ---------------------------------------------------------------------
10
+
11
+ /* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
12
+
13
+ let AuroLibraryRuntimeUtils$2 = class AuroLibraryRuntimeUtils {
14
+
15
+ /* eslint-disable jsdoc/require-param */
16
+
17
+ /**
18
+ * This will register a new custom element with the browser.
19
+ * @param {String} name - The name of the custom element.
20
+ * @param {Object} componentClass - The class to register as a custom element.
21
+ * @returns {void}
22
+ */
23
+ registerComponent(name, componentClass) {
24
+ if (!customElements.get(name)) {
25
+ customElements.define(name, class extends componentClass {});
26
+ }
27
+ }
28
+
29
+ /**
30
+ * Finds and returns the closest HTML Element based on a selector.
31
+ * @returns {void}
32
+ */
33
+ closestElement(
34
+ selector, // selector like in .closest()
35
+ base = this, // extra functionality to skip a parent
36
+ __Closest = (el, found = el && el.closest(selector)) =>
37
+ !el || el === document || el === window
38
+ ? null // standard .closest() returns null for non-found selectors also
39
+ : found
40
+ ? found // found a selector INside this element
41
+ : __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
42
+ ) {
43
+ return __Closest(base);
44
+ }
45
+ /* eslint-enable jsdoc/require-param */
46
+
47
+ /**
48
+ * 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.
49
+ * @param {Object} elem - The element to check.
50
+ * @param {String} tagName - The name of the Auro component to check for or add as an attribute.
51
+ * @returns {void}
52
+ */
53
+ handleComponentTagRename(elem, tagName) {
54
+ const tag = tagName.toLowerCase();
55
+ const elemTag = elem.tagName.toLowerCase();
56
+
57
+ if (elemTag !== tag) {
58
+ elem.setAttribute(tag, true);
59
+ }
60
+ }
61
+
62
+ /**
63
+ * Validates if an element is a specific Auro component.
64
+ * @param {Object} elem - The element to validate.
65
+ * @param {String} tagName - The name of the Auro component to check against.
66
+ * @returns {Boolean} - Returns true if the element is the specified Auro component.
67
+ */
68
+ elementMatch(elem, tagName) {
69
+ const tag = tagName.toLowerCase();
70
+ const elemTag = elem.tagName.toLowerCase();
71
+
72
+ return elemTag === tag || elem.hasAttribute(tag);
73
+ }
74
+ };
75
+
76
+ /**
77
+ * Custom positioning reference element.
78
+ * @see https://floating-ui.com/docs/virtual-elements
79
+ */
80
+
81
+ const sides = ['top', 'right', 'bottom', 'left'];
82
+ const alignments = ['start', 'end'];
83
+ const placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []);
84
+ const min = Math.min;
85
+ const max = Math.max;
86
+ const round = Math.round;
87
+ const floor = Math.floor;
88
+ const createCoords = v => ({
89
+ x: v,
90
+ y: v
91
+ });
92
+ const oppositeSideMap = {
93
+ left: 'right',
94
+ right: 'left',
95
+ bottom: 'top',
96
+ top: 'bottom'
97
+ };
98
+ const oppositeAlignmentMap = {
99
+ start: 'end',
100
+ end: 'start'
101
+ };
102
+ function evaluate(value, param) {
103
+ return typeof value === 'function' ? value(param) : value;
104
+ }
105
+ function getSide(placement) {
106
+ return placement.split('-')[0];
107
+ }
108
+ function getAlignment(placement) {
109
+ return placement.split('-')[1];
110
+ }
111
+ function getOppositeAxis(axis) {
112
+ return axis === 'x' ? 'y' : 'x';
113
+ }
114
+ function getAxisLength(axis) {
115
+ return axis === 'y' ? 'height' : 'width';
116
+ }
117
+ function getSideAxis(placement) {
118
+ return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
119
+ }
120
+ function getAlignmentAxis(placement) {
121
+ return getOppositeAxis(getSideAxis(placement));
122
+ }
123
+ function getAlignmentSides(placement, rects, rtl) {
124
+ if (rtl === void 0) {
125
+ rtl = false;
126
+ }
127
+ const alignment = getAlignment(placement);
128
+ const alignmentAxis = getAlignmentAxis(placement);
129
+ const length = getAxisLength(alignmentAxis);
130
+ let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
131
+ if (rects.reference[length] > rects.floating[length]) {
132
+ mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
133
+ }
134
+ return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
135
+ }
136
+ function getExpandedPlacements(placement) {
137
+ const oppositePlacement = getOppositePlacement(placement);
138
+ return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
139
+ }
140
+ function getOppositeAlignmentPlacement(placement) {
141
+ return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
142
+ }
143
+ function getSideList(side, isStart, rtl) {
144
+ const lr = ['left', 'right'];
145
+ const rl = ['right', 'left'];
146
+ const tb = ['top', 'bottom'];
147
+ const bt = ['bottom', 'top'];
148
+ switch (side) {
149
+ case 'top':
150
+ case 'bottom':
151
+ if (rtl) return isStart ? rl : lr;
152
+ return isStart ? lr : rl;
153
+ case 'left':
154
+ case 'right':
155
+ return isStart ? tb : bt;
156
+ default:
157
+ return [];
158
+ }
159
+ }
160
+ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
161
+ const alignment = getAlignment(placement);
162
+ let list = getSideList(getSide(placement), direction === 'start', rtl);
163
+ if (alignment) {
164
+ list = list.map(side => side + "-" + alignment);
165
+ if (flipAlignment) {
166
+ list = list.concat(list.map(getOppositeAlignmentPlacement));
167
+ }
168
+ }
169
+ return list;
170
+ }
171
+ function getOppositePlacement(placement) {
172
+ return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
173
+ }
174
+ function expandPaddingObject(padding) {
175
+ return {
176
+ top: 0,
177
+ right: 0,
178
+ bottom: 0,
179
+ left: 0,
180
+ ...padding
181
+ };
182
+ }
183
+ function getPaddingObject(padding) {
184
+ return typeof padding !== 'number' ? expandPaddingObject(padding) : {
185
+ top: padding,
186
+ right: padding,
187
+ bottom: padding,
188
+ left: padding
189
+ };
190
+ }
191
+ function rectToClientRect(rect) {
192
+ const {
193
+ x,
194
+ y,
195
+ width,
196
+ height
197
+ } = rect;
198
+ return {
199
+ width,
200
+ height,
201
+ top: y,
202
+ left: x,
203
+ right: x + width,
204
+ bottom: y + height,
205
+ x,
206
+ y
207
+ };
208
+ }
209
+
210
+ function computeCoordsFromPlacement(_ref, placement, rtl) {
211
+ let {
212
+ reference,
213
+ floating
214
+ } = _ref;
215
+ const sideAxis = getSideAxis(placement);
216
+ const alignmentAxis = getAlignmentAxis(placement);
217
+ const alignLength = getAxisLength(alignmentAxis);
218
+ const side = getSide(placement);
219
+ const isVertical = sideAxis === 'y';
220
+ const commonX = reference.x + reference.width / 2 - floating.width / 2;
221
+ const commonY = reference.y + reference.height / 2 - floating.height / 2;
222
+ const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
223
+ let coords;
224
+ switch (side) {
225
+ case 'top':
226
+ coords = {
227
+ x: commonX,
228
+ y: reference.y - floating.height
229
+ };
230
+ break;
231
+ case 'bottom':
232
+ coords = {
233
+ x: commonX,
234
+ y: reference.y + reference.height
235
+ };
236
+ break;
237
+ case 'right':
238
+ coords = {
239
+ x: reference.x + reference.width,
240
+ y: commonY
241
+ };
242
+ break;
243
+ case 'left':
244
+ coords = {
245
+ x: reference.x - floating.width,
246
+ y: commonY
247
+ };
248
+ break;
249
+ default:
250
+ coords = {
251
+ x: reference.x,
252
+ y: reference.y
253
+ };
254
+ }
255
+ switch (getAlignment(placement)) {
256
+ case 'start':
257
+ coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
258
+ break;
259
+ case 'end':
260
+ coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
261
+ break;
262
+ }
263
+ return coords;
264
+ }
265
+
266
+ /**
267
+ * Computes the `x` and `y` coordinates that will place the floating element
268
+ * next to a given reference element.
269
+ *
270
+ * This export does not have any `platform` interface logic. You will need to
271
+ * write one for the platform you are using Floating UI with.
272
+ */
273
+ const computePosition$1 = async (reference, floating, config) => {
274
+ const {
275
+ placement = 'bottom',
276
+ strategy = 'absolute',
277
+ middleware = [],
278
+ platform
279
+ } = config;
280
+ const validMiddleware = middleware.filter(Boolean);
281
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
282
+ let rects = await platform.getElementRects({
283
+ reference,
284
+ floating,
285
+ strategy
286
+ });
287
+ let {
288
+ x,
289
+ y
290
+ } = computeCoordsFromPlacement(rects, placement, rtl);
291
+ let statefulPlacement = placement;
292
+ let middlewareData = {};
293
+ let resetCount = 0;
294
+ for (let i = 0; i < validMiddleware.length; i++) {
295
+ const {
296
+ name,
297
+ fn
298
+ } = validMiddleware[i];
299
+ const {
300
+ x: nextX,
301
+ y: nextY,
302
+ data,
303
+ reset
304
+ } = await fn({
305
+ x,
306
+ y,
307
+ initialPlacement: placement,
308
+ placement: statefulPlacement,
309
+ strategy,
310
+ middlewareData,
311
+ rects,
312
+ platform,
313
+ elements: {
314
+ reference,
315
+ floating
316
+ }
317
+ });
318
+ x = nextX != null ? nextX : x;
319
+ y = nextY != null ? nextY : y;
320
+ middlewareData = {
321
+ ...middlewareData,
322
+ [name]: {
323
+ ...middlewareData[name],
324
+ ...data
325
+ }
326
+ };
327
+ if (reset && resetCount <= 50) {
328
+ resetCount++;
329
+ if (typeof reset === 'object') {
330
+ if (reset.placement) {
331
+ statefulPlacement = reset.placement;
332
+ }
333
+ if (reset.rects) {
334
+ rects = reset.rects === true ? await platform.getElementRects({
335
+ reference,
336
+ floating,
337
+ strategy
338
+ }) : reset.rects;
339
+ }
340
+ ({
341
+ x,
342
+ y
343
+ } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
344
+ }
345
+ i = -1;
346
+ }
347
+ }
348
+ return {
349
+ x,
350
+ y,
351
+ placement: statefulPlacement,
352
+ strategy,
353
+ middlewareData
354
+ };
355
+ };
356
+
357
+ /**
358
+ * Resolves with an object of overflow side offsets that determine how much the
359
+ * element is overflowing a given clipping boundary on each side.
360
+ * - positive = overflowing the boundary by that number of pixels
361
+ * - negative = how many pixels left before it will overflow
362
+ * - 0 = lies flush with the boundary
363
+ * @see https://floating-ui.com/docs/detectOverflow
364
+ */
365
+ async function detectOverflow(state, options) {
366
+ var _await$platform$isEle;
367
+ if (options === void 0) {
368
+ options = {};
369
+ }
370
+ const {
371
+ x,
372
+ y,
373
+ platform,
374
+ rects,
375
+ elements,
376
+ strategy
377
+ } = state;
378
+ const {
379
+ boundary = 'clippingAncestors',
380
+ rootBoundary = 'viewport',
381
+ elementContext = 'floating',
382
+ altBoundary = false,
383
+ padding = 0
384
+ } = evaluate(options, state);
385
+ const paddingObject = getPaddingObject(padding);
386
+ const altContext = elementContext === 'floating' ? 'reference' : 'floating';
387
+ const element = elements[altBoundary ? altContext : elementContext];
388
+ const clippingClientRect = rectToClientRect(await platform.getClippingRect({
389
+ element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
390
+ boundary,
391
+ rootBoundary,
392
+ strategy
393
+ }));
394
+ const rect = elementContext === 'floating' ? {
395
+ x,
396
+ y,
397
+ width: rects.floating.width,
398
+ height: rects.floating.height
399
+ } : rects.reference;
400
+ const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
401
+ const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
402
+ x: 1,
403
+ y: 1
404
+ } : {
405
+ x: 1,
406
+ y: 1
407
+ };
408
+ const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
409
+ elements,
410
+ rect,
411
+ offsetParent,
412
+ strategy
413
+ }) : rect);
414
+ return {
415
+ top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
416
+ bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
417
+ left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
418
+ right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
419
+ };
420
+ }
421
+
422
+ function getPlacementList(alignment, autoAlignment, allowedPlacements) {
423
+ const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);
424
+ return allowedPlacementsSortedByAlignment.filter(placement => {
425
+ if (alignment) {
426
+ return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);
427
+ }
428
+ return true;
429
+ });
430
+ }
431
+ /**
432
+ * Optimizes the visibility of the floating element by choosing the placement
433
+ * that has the most space available automatically, without needing to specify a
434
+ * preferred placement. Alternative to `flip`.
435
+ * @see https://floating-ui.com/docs/autoPlacement
436
+ */
437
+ const autoPlacement$1 = function (options) {
438
+ if (options === void 0) {
439
+ options = {};
440
+ }
441
+ return {
442
+ name: 'autoPlacement',
443
+ options,
444
+ async fn(state) {
445
+ var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;
446
+ const {
447
+ rects,
448
+ middlewareData,
449
+ placement,
450
+ platform,
451
+ elements
452
+ } = state;
453
+ const {
454
+ crossAxis = false,
455
+ alignment,
456
+ allowedPlacements = placements,
457
+ autoAlignment = true,
458
+ ...detectOverflowOptions
459
+ } = evaluate(options, state);
460
+ const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
461
+ const overflow = await detectOverflow(state, detectOverflowOptions);
462
+ const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
463
+ const currentPlacement = placements$1[currentIndex];
464
+ if (currentPlacement == null) {
465
+ return {};
466
+ }
467
+ const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
468
+
469
+ // Make `computeCoords` start from the right place.
470
+ if (placement !== currentPlacement) {
471
+ return {
472
+ reset: {
473
+ placement: placements$1[0]
474
+ }
475
+ };
476
+ }
477
+ const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];
478
+ const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {
479
+ placement: currentPlacement,
480
+ overflows: currentOverflows
481
+ }];
482
+ const nextPlacement = placements$1[currentIndex + 1];
483
+
484
+ // There are more placements to check.
485
+ if (nextPlacement) {
486
+ return {
487
+ data: {
488
+ index: currentIndex + 1,
489
+ overflows: allOverflows
490
+ },
491
+ reset: {
492
+ placement: nextPlacement
493
+ }
494
+ };
495
+ }
496
+ const placementsSortedByMostSpace = allOverflows.map(d => {
497
+ const alignment = getAlignment(d.placement);
498
+ return [d.placement, alignment && crossAxis ?
499
+ // Check along the mainAxis and main crossAxis side.
500
+ d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :
501
+ // Check only the mainAxis.
502
+ d.overflows[0], d.overflows];
503
+ }).sort((a, b) => a[1] - b[1]);
504
+ const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,
505
+ // Aligned placements should not check their opposite crossAxis
506
+ // side.
507
+ getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));
508
+ const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];
509
+ if (resetPlacement !== placement) {
510
+ return {
511
+ data: {
512
+ index: currentIndex + 1,
513
+ overflows: allOverflows
514
+ },
515
+ reset: {
516
+ placement: resetPlacement
517
+ }
518
+ };
519
+ }
520
+ return {};
521
+ }
522
+ };
523
+ };
524
+
525
+ /**
526
+ * Optimizes the visibility of the floating element by flipping the `placement`
527
+ * in order to keep it in view when the preferred placement(s) will overflow the
528
+ * clipping boundary. Alternative to `autoPlacement`.
529
+ * @see https://floating-ui.com/docs/flip
530
+ */
531
+ const flip$1 = function (options) {
532
+ if (options === void 0) {
533
+ options = {};
534
+ }
535
+ return {
536
+ name: 'flip',
537
+ options,
538
+ async fn(state) {
539
+ var _middlewareData$arrow, _middlewareData$flip;
540
+ const {
541
+ placement,
542
+ middlewareData,
543
+ rects,
544
+ initialPlacement,
545
+ platform,
546
+ elements
547
+ } = state;
548
+ const {
549
+ mainAxis: checkMainAxis = true,
550
+ crossAxis: checkCrossAxis = true,
551
+ fallbackPlacements: specifiedFallbackPlacements,
552
+ fallbackStrategy = 'bestFit',
553
+ fallbackAxisSideDirection = 'none',
554
+ flipAlignment = true,
555
+ ...detectOverflowOptions
556
+ } = evaluate(options, state);
557
+
558
+ // If a reset by the arrow was caused due to an alignment offset being
559
+ // added, we should skip any logic now since `flip()` has already done its
560
+ // work.
561
+ // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
562
+ if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
563
+ return {};
564
+ }
565
+ const side = getSide(placement);
566
+ const initialSideAxis = getSideAxis(initialPlacement);
567
+ const isBasePlacement = getSide(initialPlacement) === initialPlacement;
568
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
569
+ const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
570
+ const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';
571
+ if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
572
+ fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
573
+ }
574
+ const placements = [initialPlacement, ...fallbackPlacements];
575
+ const overflow = await detectOverflow(state, detectOverflowOptions);
576
+ const overflows = [];
577
+ let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
578
+ if (checkMainAxis) {
579
+ overflows.push(overflow[side]);
580
+ }
581
+ if (checkCrossAxis) {
582
+ const sides = getAlignmentSides(placement, rects, rtl);
583
+ overflows.push(overflow[sides[0]], overflow[sides[1]]);
584
+ }
585
+ overflowsData = [...overflowsData, {
586
+ placement,
587
+ overflows
588
+ }];
589
+
590
+ // One or more sides is overflowing.
591
+ if (!overflows.every(side => side <= 0)) {
592
+ var _middlewareData$flip2, _overflowsData$filter;
593
+ const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
594
+ const nextPlacement = placements[nextIndex];
595
+ if (nextPlacement) {
596
+ const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;
597
+ if (!ignoreCrossAxisOverflow ||
598
+ // We leave the current main axis only if every placement on that axis
599
+ // overflows the main axis.
600
+ overflowsData.every(d => d.overflows[0] > 0 && getSideAxis(d.placement) === initialSideAxis)) {
601
+ // Try next placement and re-run the lifecycle.
602
+ return {
603
+ data: {
604
+ index: nextIndex,
605
+ overflows: overflowsData
606
+ },
607
+ reset: {
608
+ placement: nextPlacement
609
+ }
610
+ };
611
+ }
612
+ }
613
+
614
+ // First, find the candidates that fit on the mainAxis side of overflow,
615
+ // then find the placement that fits the best on the main crossAxis side.
616
+ let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
617
+
618
+ // Otherwise fallback.
619
+ if (!resetPlacement) {
620
+ switch (fallbackStrategy) {
621
+ case 'bestFit':
622
+ {
623
+ var _overflowsData$filter2;
624
+ const placement = (_overflowsData$filter2 = overflowsData.filter(d => {
625
+ if (hasFallbackAxisSideDirection) {
626
+ const currentSideAxis = getSideAxis(d.placement);
627
+ return currentSideAxis === initialSideAxis ||
628
+ // Create a bias to the `y` side axis due to horizontal
629
+ // reading directions favoring greater width.
630
+ currentSideAxis === 'y';
631
+ }
632
+ return true;
633
+ }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
634
+ if (placement) {
635
+ resetPlacement = placement;
636
+ }
637
+ break;
638
+ }
639
+ case 'initialPlacement':
640
+ resetPlacement = initialPlacement;
641
+ break;
642
+ }
643
+ }
644
+ if (placement !== resetPlacement) {
645
+ return {
646
+ reset: {
647
+ placement: resetPlacement
648
+ }
649
+ };
650
+ }
651
+ }
652
+ return {};
653
+ }
654
+ };
655
+ };
656
+
657
+ // For type backwards-compatibility, the `OffsetOptions` type was also
658
+ // Derivable.
659
+
660
+ async function convertValueToCoords(state, options) {
661
+ const {
662
+ placement,
663
+ platform,
664
+ elements
665
+ } = state;
666
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
667
+ const side = getSide(placement);
668
+ const alignment = getAlignment(placement);
669
+ const isVertical = getSideAxis(placement) === 'y';
670
+ const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
671
+ const crossAxisMulti = rtl && isVertical ? -1 : 1;
672
+ const rawValue = evaluate(options, state);
673
+
674
+ // eslint-disable-next-line prefer-const
675
+ let {
676
+ mainAxis,
677
+ crossAxis,
678
+ alignmentAxis
679
+ } = typeof rawValue === 'number' ? {
680
+ mainAxis: rawValue,
681
+ crossAxis: 0,
682
+ alignmentAxis: null
683
+ } : {
684
+ mainAxis: rawValue.mainAxis || 0,
685
+ crossAxis: rawValue.crossAxis || 0,
686
+ alignmentAxis: rawValue.alignmentAxis
687
+ };
688
+ if (alignment && typeof alignmentAxis === 'number') {
689
+ crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
690
+ }
691
+ return isVertical ? {
692
+ x: crossAxis * crossAxisMulti,
693
+ y: mainAxis * mainAxisMulti
694
+ } : {
695
+ x: mainAxis * mainAxisMulti,
696
+ y: crossAxis * crossAxisMulti
697
+ };
698
+ }
699
+
700
+ /**
701
+ * Modifies the placement by translating the floating element along the
702
+ * specified axes.
703
+ * A number (shorthand for `mainAxis` or distance), or an axes configuration
704
+ * object may be passed.
705
+ * @see https://floating-ui.com/docs/offset
706
+ */
707
+ const offset$1 = function (options) {
708
+ if (options === void 0) {
709
+ options = 0;
710
+ }
711
+ return {
712
+ name: 'offset',
713
+ options,
714
+ async fn(state) {
715
+ var _middlewareData$offse, _middlewareData$arrow;
716
+ const {
717
+ x,
718
+ y,
719
+ placement,
720
+ middlewareData
721
+ } = state;
722
+ const diffCoords = await convertValueToCoords(state, options);
723
+
724
+ // If the placement is the same and the arrow caused an alignment offset
725
+ // then we don't need to change the positioning coordinates.
726
+ if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
727
+ return {};
728
+ }
729
+ return {
730
+ x: x + diffCoords.x,
731
+ y: y + diffCoords.y,
732
+ data: {
733
+ ...diffCoords,
734
+ placement
735
+ }
736
+ };
737
+ }
738
+ };
739
+ };
740
+
741
+ function hasWindow() {
742
+ return typeof window !== 'undefined';
743
+ }
744
+ function getNodeName(node) {
745
+ if (isNode(node)) {
746
+ return (node.nodeName || '').toLowerCase();
747
+ }
748
+ // Mocked nodes in testing environments may not be instances of Node. By
749
+ // returning `#document` an infinite loop won't occur.
750
+ // https://github.com/floating-ui/floating-ui/issues/2317
751
+ return '#document';
752
+ }
753
+ function getWindow(node) {
754
+ var _node$ownerDocument;
755
+ return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
756
+ }
757
+ function getDocumentElement(node) {
758
+ var _ref;
759
+ return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
760
+ }
761
+ function isNode(value) {
762
+ if (!hasWindow()) {
763
+ return false;
764
+ }
765
+ return value instanceof Node || value instanceof getWindow(value).Node;
766
+ }
767
+ function isElement(value) {
768
+ if (!hasWindow()) {
769
+ return false;
770
+ }
771
+ return value instanceof Element || value instanceof getWindow(value).Element;
772
+ }
773
+ function isHTMLElement(value) {
774
+ if (!hasWindow()) {
775
+ return false;
776
+ }
777
+ return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
778
+ }
779
+ function isShadowRoot(value) {
780
+ if (!hasWindow() || typeof ShadowRoot === 'undefined') {
781
+ return false;
782
+ }
783
+ return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
784
+ }
785
+ function isOverflowElement(element) {
786
+ const {
787
+ overflow,
788
+ overflowX,
789
+ overflowY,
790
+ display
791
+ } = getComputedStyle$1(element);
792
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
793
+ }
794
+ function isTableElement(element) {
795
+ return ['table', 'td', 'th'].includes(getNodeName(element));
796
+ }
797
+ function isTopLayer(element) {
798
+ return [':popover-open', ':modal'].some(selector => {
799
+ try {
800
+ return element.matches(selector);
801
+ } catch (e) {
802
+ return false;
803
+ }
804
+ });
805
+ }
806
+ function isContainingBlock(elementOrCss) {
807
+ const webkit = isWebKit();
808
+ const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
809
+
810
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
811
+ // https://drafts.csswg.org/css-transforms-2/#individual-transforms
812
+ return ['transform', 'translate', 'scale', 'rotate', 'perspective'].some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
813
+ }
814
+ function getContainingBlock(element) {
815
+ let currentNode = getParentNode(element);
816
+ while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
817
+ if (isContainingBlock(currentNode)) {
818
+ return currentNode;
819
+ } else if (isTopLayer(currentNode)) {
820
+ return null;
821
+ }
822
+ currentNode = getParentNode(currentNode);
823
+ }
824
+ return null;
825
+ }
826
+ function isWebKit() {
827
+ if (typeof CSS === 'undefined' || !CSS.supports) return false;
828
+ return CSS.supports('-webkit-backdrop-filter', 'none');
829
+ }
830
+ function isLastTraversableNode(node) {
831
+ return ['html', 'body', '#document'].includes(getNodeName(node));
832
+ }
833
+ function getComputedStyle$1(element) {
834
+ return getWindow(element).getComputedStyle(element);
835
+ }
836
+ function getNodeScroll(element) {
837
+ if (isElement(element)) {
838
+ return {
839
+ scrollLeft: element.scrollLeft,
840
+ scrollTop: element.scrollTop
841
+ };
842
+ }
843
+ return {
844
+ scrollLeft: element.scrollX,
845
+ scrollTop: element.scrollY
846
+ };
847
+ }
848
+ function getParentNode(node) {
849
+ if (getNodeName(node) === 'html') {
850
+ return node;
851
+ }
852
+ const result =
853
+ // Step into the shadow DOM of the parent of a slotted node.
854
+ node.assignedSlot ||
855
+ // DOM Element detected.
856
+ node.parentNode ||
857
+ // ShadowRoot detected.
858
+ isShadowRoot(node) && node.host ||
859
+ // Fallback.
860
+ getDocumentElement(node);
861
+ return isShadowRoot(result) ? result.host : result;
862
+ }
863
+ function getNearestOverflowAncestor(node) {
864
+ const parentNode = getParentNode(node);
865
+ if (isLastTraversableNode(parentNode)) {
866
+ return node.ownerDocument ? node.ownerDocument.body : node.body;
867
+ }
868
+ if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
869
+ return parentNode;
870
+ }
871
+ return getNearestOverflowAncestor(parentNode);
872
+ }
873
+ function getOverflowAncestors(node, list, traverseIframes) {
874
+ var _node$ownerDocument2;
875
+ if (list === void 0) {
876
+ list = [];
877
+ }
878
+ if (traverseIframes === void 0) {
879
+ traverseIframes = true;
880
+ }
881
+ const scrollableAncestor = getNearestOverflowAncestor(node);
882
+ const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
883
+ const win = getWindow(scrollableAncestor);
884
+ if (isBody) {
885
+ const frameElement = getFrameElement(win);
886
+ return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
887
+ }
888
+ return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
889
+ }
890
+ function getFrameElement(win) {
891
+ return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
892
+ }
893
+
894
+ function getCssDimensions(element) {
895
+ const css = getComputedStyle$1(element);
896
+ // In testing environments, the `width` and `height` properties are empty
897
+ // strings for SVG elements, returning NaN. Fallback to `0` in this case.
898
+ let width = parseFloat(css.width) || 0;
899
+ let height = parseFloat(css.height) || 0;
900
+ const hasOffset = isHTMLElement(element);
901
+ const offsetWidth = hasOffset ? element.offsetWidth : width;
902
+ const offsetHeight = hasOffset ? element.offsetHeight : height;
903
+ const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
904
+ if (shouldFallback) {
905
+ width = offsetWidth;
906
+ height = offsetHeight;
907
+ }
908
+ return {
909
+ width,
910
+ height,
911
+ $: shouldFallback
912
+ };
913
+ }
914
+
915
+ function unwrapElement(element) {
916
+ return !isElement(element) ? element.contextElement : element;
917
+ }
918
+
919
+ function getScale(element) {
920
+ const domElement = unwrapElement(element);
921
+ if (!isHTMLElement(domElement)) {
922
+ return createCoords(1);
923
+ }
924
+ const rect = domElement.getBoundingClientRect();
925
+ const {
926
+ width,
927
+ height,
928
+ $
929
+ } = getCssDimensions(domElement);
930
+ let x = ($ ? round(rect.width) : rect.width) / width;
931
+ let y = ($ ? round(rect.height) : rect.height) / height;
932
+
933
+ // 0, NaN, or Infinity should always fallback to 1.
934
+
935
+ if (!x || !Number.isFinite(x)) {
936
+ x = 1;
937
+ }
938
+ if (!y || !Number.isFinite(y)) {
939
+ y = 1;
940
+ }
941
+ return {
942
+ x,
943
+ y
944
+ };
945
+ }
946
+
947
+ const noOffsets = /*#__PURE__*/createCoords(0);
948
+ function getVisualOffsets(element) {
949
+ const win = getWindow(element);
950
+ if (!isWebKit() || !win.visualViewport) {
951
+ return noOffsets;
952
+ }
953
+ return {
954
+ x: win.visualViewport.offsetLeft,
955
+ y: win.visualViewport.offsetTop
956
+ };
957
+ }
958
+ function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
959
+ if (isFixed === void 0) {
960
+ isFixed = false;
961
+ }
962
+ if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
963
+ return false;
964
+ }
965
+ return isFixed;
966
+ }
967
+
968
+ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
969
+ if (includeScale === void 0) {
970
+ includeScale = false;
971
+ }
972
+ if (isFixedStrategy === void 0) {
973
+ isFixedStrategy = false;
974
+ }
975
+ const clientRect = element.getBoundingClientRect();
976
+ const domElement = unwrapElement(element);
977
+ let scale = createCoords(1);
978
+ if (includeScale) {
979
+ if (offsetParent) {
980
+ if (isElement(offsetParent)) {
981
+ scale = getScale(offsetParent);
982
+ }
983
+ } else {
984
+ scale = getScale(element);
985
+ }
986
+ }
987
+ const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
988
+ let x = (clientRect.left + visualOffsets.x) / scale.x;
989
+ let y = (clientRect.top + visualOffsets.y) / scale.y;
990
+ let width = clientRect.width / scale.x;
991
+ let height = clientRect.height / scale.y;
992
+ if (domElement) {
993
+ const win = getWindow(domElement);
994
+ const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
995
+ let currentWin = win;
996
+ let currentIFrame = getFrameElement(currentWin);
997
+ while (currentIFrame && offsetParent && offsetWin !== currentWin) {
998
+ const iframeScale = getScale(currentIFrame);
999
+ const iframeRect = currentIFrame.getBoundingClientRect();
1000
+ const css = getComputedStyle$1(currentIFrame);
1001
+ const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
1002
+ const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
1003
+ x *= iframeScale.x;
1004
+ y *= iframeScale.y;
1005
+ width *= iframeScale.x;
1006
+ height *= iframeScale.y;
1007
+ x += left;
1008
+ y += top;
1009
+ currentWin = getWindow(currentIFrame);
1010
+ currentIFrame = getFrameElement(currentWin);
1011
+ }
1012
+ }
1013
+ return rectToClientRect({
1014
+ width,
1015
+ height,
1016
+ x,
1017
+ y
1018
+ });
1019
+ }
1020
+
1021
+ // If <html> has a CSS width greater than the viewport, then this will be
1022
+ // incorrect for RTL.
1023
+ function getWindowScrollBarX(element, rect) {
1024
+ const leftScroll = getNodeScroll(element).scrollLeft;
1025
+ if (!rect) {
1026
+ return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
1027
+ }
1028
+ return rect.left + leftScroll;
1029
+ }
1030
+
1031
+ function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
1032
+ if (ignoreScrollbarX === void 0) {
1033
+ ignoreScrollbarX = false;
1034
+ }
1035
+ const htmlRect = documentElement.getBoundingClientRect();
1036
+ const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 :
1037
+ // RTL <body> scrollbar.
1038
+ getWindowScrollBarX(documentElement, htmlRect));
1039
+ const y = htmlRect.top + scroll.scrollTop;
1040
+ return {
1041
+ x,
1042
+ y
1043
+ };
1044
+ }
1045
+
1046
+ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
1047
+ let {
1048
+ elements,
1049
+ rect,
1050
+ offsetParent,
1051
+ strategy
1052
+ } = _ref;
1053
+ const isFixed = strategy === 'fixed';
1054
+ const documentElement = getDocumentElement(offsetParent);
1055
+ const topLayer = elements ? isTopLayer(elements.floating) : false;
1056
+ if (offsetParent === documentElement || topLayer && isFixed) {
1057
+ return rect;
1058
+ }
1059
+ let scroll = {
1060
+ scrollLeft: 0,
1061
+ scrollTop: 0
1062
+ };
1063
+ let scale = createCoords(1);
1064
+ const offsets = createCoords(0);
1065
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
1066
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1067
+ if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
1068
+ scroll = getNodeScroll(offsetParent);
1069
+ }
1070
+ if (isHTMLElement(offsetParent)) {
1071
+ const offsetRect = getBoundingClientRect(offsetParent);
1072
+ scale = getScale(offsetParent);
1073
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
1074
+ offsets.y = offsetRect.y + offsetParent.clientTop;
1075
+ }
1076
+ }
1077
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);
1078
+ return {
1079
+ width: rect.width * scale.x,
1080
+ height: rect.height * scale.y,
1081
+ x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
1082
+ y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
1083
+ };
1084
+ }
1085
+
1086
+ function getClientRects(element) {
1087
+ return Array.from(element.getClientRects());
1088
+ }
1089
+
1090
+ // Gets the entire size of the scrollable document area, even extending outside
1091
+ // of the `<html>` and `<body>` rect bounds if horizontally scrollable.
1092
+ function getDocumentRect(element) {
1093
+ const html = getDocumentElement(element);
1094
+ const scroll = getNodeScroll(element);
1095
+ const body = element.ownerDocument.body;
1096
+ const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
1097
+ const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
1098
+ let x = -scroll.scrollLeft + getWindowScrollBarX(element);
1099
+ const y = -scroll.scrollTop;
1100
+ if (getComputedStyle$1(body).direction === 'rtl') {
1101
+ x += max(html.clientWidth, body.clientWidth) - width;
1102
+ }
1103
+ return {
1104
+ width,
1105
+ height,
1106
+ x,
1107
+ y
1108
+ };
1109
+ }
1110
+
1111
+ function getViewportRect(element, strategy) {
1112
+ const win = getWindow(element);
1113
+ const html = getDocumentElement(element);
1114
+ const visualViewport = win.visualViewport;
1115
+ let width = html.clientWidth;
1116
+ let height = html.clientHeight;
1117
+ let x = 0;
1118
+ let y = 0;
1119
+ if (visualViewport) {
1120
+ width = visualViewport.width;
1121
+ height = visualViewport.height;
1122
+ const visualViewportBased = isWebKit();
1123
+ if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
1124
+ x = visualViewport.offsetLeft;
1125
+ y = visualViewport.offsetTop;
1126
+ }
1127
+ }
1128
+ return {
1129
+ width,
1130
+ height,
1131
+ x,
1132
+ y
1133
+ };
1134
+ }
1135
+
1136
+ // Returns the inner client rect, subtracting scrollbars if present.
1137
+ function getInnerBoundingClientRect(element, strategy) {
1138
+ const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
1139
+ const top = clientRect.top + element.clientTop;
1140
+ const left = clientRect.left + element.clientLeft;
1141
+ const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
1142
+ const width = element.clientWidth * scale.x;
1143
+ const height = element.clientHeight * scale.y;
1144
+ const x = left * scale.x;
1145
+ const y = top * scale.y;
1146
+ return {
1147
+ width,
1148
+ height,
1149
+ x,
1150
+ y
1151
+ };
1152
+ }
1153
+ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
1154
+ let rect;
1155
+ if (clippingAncestor === 'viewport') {
1156
+ rect = getViewportRect(element, strategy);
1157
+ } else if (clippingAncestor === 'document') {
1158
+ rect = getDocumentRect(getDocumentElement(element));
1159
+ } else if (isElement(clippingAncestor)) {
1160
+ rect = getInnerBoundingClientRect(clippingAncestor, strategy);
1161
+ } else {
1162
+ const visualOffsets = getVisualOffsets(element);
1163
+ rect = {
1164
+ x: clippingAncestor.x - visualOffsets.x,
1165
+ y: clippingAncestor.y - visualOffsets.y,
1166
+ width: clippingAncestor.width,
1167
+ height: clippingAncestor.height
1168
+ };
1169
+ }
1170
+ return rectToClientRect(rect);
1171
+ }
1172
+ function hasFixedPositionAncestor(element, stopNode) {
1173
+ const parentNode = getParentNode(element);
1174
+ if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
1175
+ return false;
1176
+ }
1177
+ return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
1178
+ }
1179
+
1180
+ // A "clipping ancestor" is an `overflow` element with the characteristic of
1181
+ // clipping (or hiding) child elements. This returns all clipping ancestors
1182
+ // of the given element up the tree.
1183
+ function getClippingElementAncestors(element, cache) {
1184
+ const cachedResult = cache.get(element);
1185
+ if (cachedResult) {
1186
+ return cachedResult;
1187
+ }
1188
+ let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
1189
+ let currentContainingBlockComputedStyle = null;
1190
+ const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
1191
+ let currentNode = elementIsFixed ? getParentNode(element) : element;
1192
+
1193
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
1194
+ while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
1195
+ const computedStyle = getComputedStyle$1(currentNode);
1196
+ const currentNodeIsContaining = isContainingBlock(currentNode);
1197
+ if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
1198
+ currentContainingBlockComputedStyle = null;
1199
+ }
1200
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
1201
+ if (shouldDropCurrentNode) {
1202
+ // Drop non-containing blocks.
1203
+ result = result.filter(ancestor => ancestor !== currentNode);
1204
+ } else {
1205
+ // Record last containing block for next iteration.
1206
+ currentContainingBlockComputedStyle = computedStyle;
1207
+ }
1208
+ currentNode = getParentNode(currentNode);
1209
+ }
1210
+ cache.set(element, result);
1211
+ return result;
1212
+ }
1213
+
1214
+ // Gets the maximum area that the element is visible in due to any number of
1215
+ // clipping ancestors.
1216
+ function getClippingRect(_ref) {
1217
+ let {
1218
+ element,
1219
+ boundary,
1220
+ rootBoundary,
1221
+ strategy
1222
+ } = _ref;
1223
+ const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
1224
+ const clippingAncestors = [...elementClippingAncestors, rootBoundary];
1225
+ const firstClippingAncestor = clippingAncestors[0];
1226
+ const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
1227
+ const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
1228
+ accRect.top = max(rect.top, accRect.top);
1229
+ accRect.right = min(rect.right, accRect.right);
1230
+ accRect.bottom = min(rect.bottom, accRect.bottom);
1231
+ accRect.left = max(rect.left, accRect.left);
1232
+ return accRect;
1233
+ }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
1234
+ return {
1235
+ width: clippingRect.right - clippingRect.left,
1236
+ height: clippingRect.bottom - clippingRect.top,
1237
+ x: clippingRect.left,
1238
+ y: clippingRect.top
1239
+ };
1240
+ }
1241
+
1242
+ function getDimensions(element) {
1243
+ const {
1244
+ width,
1245
+ height
1246
+ } = getCssDimensions(element);
1247
+ return {
1248
+ width,
1249
+ height
1250
+ };
1251
+ }
1252
+
1253
+ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
1254
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
1255
+ const documentElement = getDocumentElement(offsetParent);
1256
+ const isFixed = strategy === 'fixed';
1257
+ const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
1258
+ let scroll = {
1259
+ scrollLeft: 0,
1260
+ scrollTop: 0
1261
+ };
1262
+ const offsets = createCoords(0);
1263
+
1264
+ // If the <body> scrollbar appears on the left (e.g. RTL systems). Use
1265
+ // Firefox with layout.scrollbar.side = 3 in about:config to test this.
1266
+ function setLeftRTLScrollbarOffset() {
1267
+ offsets.x = getWindowScrollBarX(documentElement);
1268
+ }
1269
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1270
+ if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
1271
+ scroll = getNodeScroll(offsetParent);
1272
+ }
1273
+ if (isOffsetParentAnElement) {
1274
+ const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
1275
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
1276
+ offsets.y = offsetRect.y + offsetParent.clientTop;
1277
+ } else if (documentElement) {
1278
+ setLeftRTLScrollbarOffset();
1279
+ }
1280
+ }
1281
+ if (isFixed && !isOffsetParentAnElement && documentElement) {
1282
+ setLeftRTLScrollbarOffset();
1283
+ }
1284
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
1285
+ const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
1286
+ const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
1287
+ return {
1288
+ x,
1289
+ y,
1290
+ width: rect.width,
1291
+ height: rect.height
1292
+ };
1293
+ }
1294
+
1295
+ function isStaticPositioned(element) {
1296
+ return getComputedStyle$1(element).position === 'static';
1297
+ }
1298
+
1299
+ function getTrueOffsetParent(element, polyfill) {
1300
+ if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
1301
+ return null;
1302
+ }
1303
+ if (polyfill) {
1304
+ return polyfill(element);
1305
+ }
1306
+ let rawOffsetParent = element.offsetParent;
1307
+
1308
+ // Firefox returns the <html> element as the offsetParent if it's non-static,
1309
+ // while Chrome and Safari return the <body> element. The <body> element must
1310
+ // be used to perform the correct calculations even if the <html> element is
1311
+ // non-static.
1312
+ if (getDocumentElement(element) === rawOffsetParent) {
1313
+ rawOffsetParent = rawOffsetParent.ownerDocument.body;
1314
+ }
1315
+ return rawOffsetParent;
1316
+ }
1317
+
1318
+ // Gets the closest ancestor positioned element. Handles some edge cases,
1319
+ // such as table ancestors and cross browser bugs.
1320
+ function getOffsetParent(element, polyfill) {
1321
+ const win = getWindow(element);
1322
+ if (isTopLayer(element)) {
1323
+ return win;
1324
+ }
1325
+ if (!isHTMLElement(element)) {
1326
+ let svgOffsetParent = getParentNode(element);
1327
+ while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
1328
+ if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
1329
+ return svgOffsetParent;
1330
+ }
1331
+ svgOffsetParent = getParentNode(svgOffsetParent);
1332
+ }
1333
+ return win;
1334
+ }
1335
+ let offsetParent = getTrueOffsetParent(element, polyfill);
1336
+ while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
1337
+ offsetParent = getTrueOffsetParent(offsetParent, polyfill);
1338
+ }
1339
+ if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
1340
+ return win;
1341
+ }
1342
+ return offsetParent || getContainingBlock(element) || win;
1343
+ }
1344
+
1345
+ const getElementRects = async function (data) {
1346
+ const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
1347
+ const getDimensionsFn = this.getDimensions;
1348
+ const floatingDimensions = await getDimensionsFn(data.floating);
1349
+ return {
1350
+ reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
1351
+ floating: {
1352
+ x: 0,
1353
+ y: 0,
1354
+ width: floatingDimensions.width,
1355
+ height: floatingDimensions.height
1356
+ }
1357
+ };
1358
+ };
1359
+
1360
+ function isRTL(element) {
1361
+ return getComputedStyle$1(element).direction === 'rtl';
1362
+ }
1363
+
1364
+ const platform = {
1365
+ convertOffsetParentRelativeRectToViewportRelativeRect,
1366
+ getDocumentElement,
1367
+ getClippingRect,
1368
+ getOffsetParent,
1369
+ getElementRects,
1370
+ getClientRects,
1371
+ getDimensions,
1372
+ getScale,
1373
+ isElement,
1374
+ isRTL
1375
+ };
1376
+
1377
+ function rectsAreEqual(a, b) {
1378
+ return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
1379
+ }
1380
+
1381
+ // https://samthor.au/2021/observing-dom/
1382
+ function observeMove(element, onMove) {
1383
+ let io = null;
1384
+ let timeoutId;
1385
+ const root = getDocumentElement(element);
1386
+ function cleanup() {
1387
+ var _io;
1388
+ clearTimeout(timeoutId);
1389
+ (_io = io) == null || _io.disconnect();
1390
+ io = null;
1391
+ }
1392
+ function refresh(skip, threshold) {
1393
+ if (skip === void 0) {
1394
+ skip = false;
1395
+ }
1396
+ if (threshold === void 0) {
1397
+ threshold = 1;
1398
+ }
1399
+ cleanup();
1400
+ const elementRectForRootMargin = element.getBoundingClientRect();
1401
+ const {
1402
+ left,
1403
+ top,
1404
+ width,
1405
+ height
1406
+ } = elementRectForRootMargin;
1407
+ if (!skip) {
1408
+ onMove();
1409
+ }
1410
+ if (!width || !height) {
1411
+ return;
1412
+ }
1413
+ const insetTop = floor(top);
1414
+ const insetRight = floor(root.clientWidth - (left + width));
1415
+ const insetBottom = floor(root.clientHeight - (top + height));
1416
+ const insetLeft = floor(left);
1417
+ const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
1418
+ const options = {
1419
+ rootMargin,
1420
+ threshold: max(0, min(1, threshold)) || 1
1421
+ };
1422
+ let isFirstUpdate = true;
1423
+ function handleObserve(entries) {
1424
+ const ratio = entries[0].intersectionRatio;
1425
+ if (ratio !== threshold) {
1426
+ if (!isFirstUpdate) {
1427
+ return refresh();
1428
+ }
1429
+ if (!ratio) {
1430
+ // If the reference is clipped, the ratio is 0. Throttle the refresh
1431
+ // to prevent an infinite loop of updates.
1432
+ timeoutId = setTimeout(() => {
1433
+ refresh(false, 1e-7);
1434
+ }, 1000);
1435
+ } else {
1436
+ refresh(false, ratio);
1437
+ }
1438
+ }
1439
+ if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
1440
+ // It's possible that even though the ratio is reported as 1, the
1441
+ // element is not actually fully within the IntersectionObserver's root
1442
+ // area anymore. This can happen under performance constraints. This may
1443
+ // be a bug in the browser's IntersectionObserver implementation. To
1444
+ // work around this, we compare the element's bounding rect now with
1445
+ // what it was at the time we created the IntersectionObserver. If they
1446
+ // are not equal then the element moved, so we refresh.
1447
+ refresh();
1448
+ }
1449
+ isFirstUpdate = false;
1450
+ }
1451
+
1452
+ // Older browsers don't support a `document` as the root and will throw an
1453
+ // error.
1454
+ try {
1455
+ io = new IntersectionObserver(handleObserve, {
1456
+ ...options,
1457
+ // Handle <iframe>s
1458
+ root: root.ownerDocument
1459
+ });
1460
+ } catch (_e) {
1461
+ io = new IntersectionObserver(handleObserve, options);
1462
+ }
1463
+ io.observe(element);
1464
+ }
1465
+ refresh(true);
1466
+ return cleanup;
1467
+ }
1468
+
1469
+ /**
1470
+ * Automatically updates the position of the floating element when necessary.
1471
+ * Should only be called when the floating element is mounted on the DOM or
1472
+ * visible on the screen.
1473
+ * @returns cleanup function that should be invoked when the floating element is
1474
+ * removed from the DOM or hidden from the screen.
1475
+ * @see https://floating-ui.com/docs/autoUpdate
1476
+ */
1477
+ function autoUpdate(reference, floating, update, options) {
1478
+ if (options === void 0) {
1479
+ options = {};
1480
+ }
1481
+ const {
1482
+ ancestorScroll = true,
1483
+ ancestorResize = true,
1484
+ elementResize = typeof ResizeObserver === 'function',
1485
+ layoutShift = typeof IntersectionObserver === 'function',
1486
+ animationFrame = false
1487
+ } = options;
1488
+ const referenceEl = unwrapElement(reference);
1489
+ const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];
1490
+ ancestors.forEach(ancestor => {
1491
+ ancestorScroll && ancestor.addEventListener('scroll', update, {
1492
+ passive: true
1493
+ });
1494
+ ancestorResize && ancestor.addEventListener('resize', update);
1495
+ });
1496
+ const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
1497
+ let reobserveFrame = -1;
1498
+ let resizeObserver = null;
1499
+ if (elementResize) {
1500
+ resizeObserver = new ResizeObserver(_ref => {
1501
+ let [firstEntry] = _ref;
1502
+ if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
1503
+ // Prevent update loops when using the `size` middleware.
1504
+ // https://github.com/floating-ui/floating-ui/issues/1740
1505
+ resizeObserver.unobserve(floating);
1506
+ cancelAnimationFrame(reobserveFrame);
1507
+ reobserveFrame = requestAnimationFrame(() => {
1508
+ var _resizeObserver;
1509
+ (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
1510
+ });
1511
+ }
1512
+ update();
1513
+ });
1514
+ if (referenceEl && !animationFrame) {
1515
+ resizeObserver.observe(referenceEl);
1516
+ }
1517
+ resizeObserver.observe(floating);
1518
+ }
1519
+ let frameId;
1520
+ let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
1521
+ if (animationFrame) {
1522
+ frameLoop();
1523
+ }
1524
+ function frameLoop() {
1525
+ const nextRefRect = getBoundingClientRect(reference);
1526
+ if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
1527
+ update();
1528
+ }
1529
+ prevRefRect = nextRefRect;
1530
+ frameId = requestAnimationFrame(frameLoop);
1531
+ }
1532
+ update();
1533
+ return () => {
1534
+ var _resizeObserver2;
1535
+ ancestors.forEach(ancestor => {
1536
+ ancestorScroll && ancestor.removeEventListener('scroll', update);
1537
+ ancestorResize && ancestor.removeEventListener('resize', update);
1538
+ });
1539
+ cleanupIo == null || cleanupIo();
1540
+ (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
1541
+ resizeObserver = null;
1542
+ if (animationFrame) {
1543
+ cancelAnimationFrame(frameId);
1544
+ }
1545
+ };
1546
+ }
1547
+
1548
+ /**
1549
+ * Modifies the placement by translating the floating element along the
1550
+ * specified axes.
1551
+ * A number (shorthand for `mainAxis` or distance), or an axes configuration
1552
+ * object may be passed.
1553
+ * @see https://floating-ui.com/docs/offset
1554
+ */
1555
+ const offset = offset$1;
1556
+
1557
+ /**
1558
+ * Optimizes the visibility of the floating element by choosing the placement
1559
+ * that has the most space available automatically, without needing to specify a
1560
+ * preferred placement. Alternative to `flip`.
1561
+ * @see https://floating-ui.com/docs/autoPlacement
1562
+ */
1563
+ const autoPlacement = autoPlacement$1;
1564
+
1565
+ /**
1566
+ * Optimizes the visibility of the floating element by flipping the `placement`
1567
+ * in order to keep it in view when the preferred placement(s) will overflow the
1568
+ * clipping boundary. Alternative to `autoPlacement`.
1569
+ * @see https://floating-ui.com/docs/flip
1570
+ */
1571
+ const flip = flip$1;
1572
+
1573
+ /**
1574
+ * Computes the `x` and `y` coordinates that will place the floating element
1575
+ * next to a given reference element.
1576
+ */
1577
+ const computePosition = (reference, floating, options) => {
1578
+ // This caches the expensive `getClippingElementAncestors` function so that
1579
+ // multiple lifecycle resets re-use the same result. It only lives for a
1580
+ // single call. If other functions become expensive, we can add them as well.
1581
+ const cache = new Map();
1582
+ const mergedOptions = {
1583
+ platform,
1584
+ ...options
1585
+ };
1586
+ const platformWithCache = {
1587
+ ...mergedOptions.platform,
1588
+ _c: cache
1589
+ };
1590
+ return computePosition$1(reference, floating, {
1591
+ ...mergedOptions,
1592
+ platform: platformWithCache
1593
+ });
1594
+ };
1595
+
1596
+ /* eslint-disable line-comment-position, no-inline-comments */
1597
+
1598
+
1599
+
1600
+ const MAX_CONFIGURATION_COUNT = 10;
1601
+
1602
+ class AuroFloatingUI {
1603
+
1604
+ /**
1605
+ * @private
1606
+ */
1607
+ static isMousePressed = false;
1608
+
1609
+ /**
1610
+ * @private
1611
+ */
1612
+ static isMousePressHandlerInitialized = false;
1613
+
1614
+ /**
1615
+ * @private
1616
+ */
1617
+ static setupMousePressChecker() {
1618
+ if (!AuroFloatingUI.isMousePressHandlerInitialized && window && window.addEventListener) {
1619
+ AuroFloatingUI.isMousePressHandlerInitialized = true;
1620
+
1621
+ // Track timeout for isMousePressed reset to avoid race conditions
1622
+ if (!AuroFloatingUI._mousePressedTimeout) {
1623
+ AuroFloatingUI._mousePressedTimeout = null;
1624
+ }
1625
+ const mouseEventGlobalHandler = (event) => {
1626
+ const isPressed = event.type === 'mousedown';
1627
+ if (isPressed) {
1628
+ // Clear any pending timeout to prevent race condition
1629
+ if (AuroFloatingUI._mousePressedTimeout !== null) {
1630
+ clearTimeout(AuroFloatingUI._mousePressedTimeout);
1631
+ AuroFloatingUI._mousePressedTimeout = null;
1632
+ }
1633
+ if (!AuroFloatingUI.isMousePressed) {
1634
+ AuroFloatingUI.isMousePressed = true;
1635
+ }
1636
+ } else if (AuroFloatingUI.isMousePressed && !isPressed) {
1637
+ // Schedule reset and track timeout ID
1638
+ AuroFloatingUI._mousePressedTimeout = setTimeout(() => {
1639
+ AuroFloatingUI.isMousePressed = false;
1640
+ AuroFloatingUI._mousePressedTimeout = null;
1641
+ }, 0);
1642
+ }
1643
+ };
1644
+
1645
+ window.addEventListener('mousedown', mouseEventGlobalHandler);
1646
+ window.addEventListener('mouseup', mouseEventGlobalHandler);
1647
+ }
1648
+ }
1649
+
1650
+ constructor(element, behavior) {
1651
+ this.element = element;
1652
+ this.behavior = behavior;
1653
+
1654
+ // Store event listener references for cleanup
1655
+ this.focusHandler = null;
1656
+ this.clickHandler = null;
1657
+ this.keyDownHandler = null;
1658
+
1659
+ /**
1660
+ * @private
1661
+ */
1662
+ this.configureTrial = 0;
1663
+
1664
+ /**
1665
+ * @private
1666
+ */
1667
+ this.eventPrefix = undefined;
1668
+
1669
+ /**
1670
+ * @private
1671
+ */
1672
+ this.id = undefined;
1673
+
1674
+ /**
1675
+ * @private
1676
+ */
1677
+ this.showing = false;
1678
+
1679
+ /**
1680
+ * @private
1681
+ */
1682
+ this.strategy = undefined;
1683
+ }
1684
+
1685
+ /**
1686
+ * Mirrors the size of the bibSizer element to the bib content.
1687
+ * Copies the width, height, max-width, and max-height styles from the bibSizer element to the bib content container.
1688
+ * This ensures that the bib content has the same dimensions as the sizer element.
1689
+ */
1690
+ mirrorSize() {
1691
+ // mirror the boxsize from bibSizer
1692
+ if (this.element.bibSizer && this.element.matchWidth) {
1693
+ const sizerStyle = window.getComputedStyle(this.element.bibSizer);
1694
+ const bibContent = this.element.bib.shadowRoot.querySelector(".container");
1695
+ if (sizerStyle.width !== '0px') {
1696
+ bibContent.style.width = sizerStyle.width;
1697
+ }
1698
+ if (sizerStyle.height !== '0px') {
1699
+ bibContent.style.height = sizerStyle.height;
1700
+ }
1701
+ bibContent.style.maxWidth = sizerStyle.maxWidth;
1702
+ bibContent.style.maxHeight = sizerStyle.maxHeight;
1703
+ }
1704
+ }
1705
+
1706
+ /**
1707
+ * @private
1708
+ * Determines the positioning strategy based on the current viewport size and mobile breakpoint.
1709
+ *
1710
+ * This method checks if the current viewport width is less than or equal to the specified mobile fullscreen breakpoint
1711
+ * defined in the bib element. If it is, the strategy is set to 'fullscreen'; otherwise, it defaults to 'floating'.
1712
+ *
1713
+ * @returns {String} The positioning strategy, one of 'fullscreen', 'floating', 'cover'.
1714
+ */
1715
+ getPositioningStrategy() {
1716
+ const breakpoint = this.element.bib.mobileFullscreenBreakpoint || this.element.floaterConfig?.fullscreenBreakpoint;
1717
+ switch (this.behavior) {
1718
+ case "tooltip":
1719
+ return "floating";
1720
+ case "dialog":
1721
+ case "drawer":
1722
+ if (breakpoint) {
1723
+ const smallerThanBreakpoint = window.matchMedia(`(max-width: ${breakpoint})`).matches;
1724
+
1725
+ this.element.expanded = smallerThanBreakpoint;
1726
+ }
1727
+ if (this.element.nested) {
1728
+ return "cover";
1729
+ }
1730
+ return 'fullscreen';
1731
+ case "dropdown":
1732
+ case undefined:
1733
+ case null:
1734
+ if (breakpoint) {
1735
+ const smallerThanBreakpoint = window.matchMedia(`(max-width: ${breakpoint})`).matches;
1736
+ if (smallerThanBreakpoint) {
1737
+ return 'fullscreen';
1738
+ }
1739
+ }
1740
+ return "floating";
1741
+ default:
1742
+ return this.behavior;
1743
+ }
1744
+ }
1745
+
1746
+ /**
1747
+ * @private
1748
+ * Positions the bib element based on the current configuration and positioning strategy.
1749
+ *
1750
+ * This method determines the appropriate positioning strategy (fullscreen or not) and configures the bib accordingly.
1751
+ * It also sets up middleware for the floater configuration, computes the position of the bib relative to the trigger element,
1752
+ * and applies the calculated position to the bib's style.
1753
+ */
1754
+ position() {
1755
+ const strategy = this.getPositioningStrategy();
1756
+ this.configureBibStrategy(strategy);
1757
+
1758
+ if (strategy === 'floating') {
1759
+ this.mirrorSize();
1760
+ // Define the middlware for the floater configuration
1761
+ const middleware = [
1762
+ offset(this.element.floaterConfig?.offset || 0),
1763
+ ...this.element.floaterConfig?.flip ? [flip()] : [], // Add flip middleware if flip is enabled.
1764
+ ...this.element.floaterConfig?.autoPlacement ? [autoPlacement()] : [], // Add autoPlacement middleware if autoPlacement is enabled.
1765
+ ];
1766
+
1767
+ // Compute the position of the bib
1768
+ computePosition(this.element.trigger, this.element.bib, {
1769
+ strategy: this.element.floaterConfig?.strategy || 'fixed',
1770
+ placement: this.element.floaterConfig?.placement,
1771
+ middleware: middleware || []
1772
+ }).then(({ x, y }) => { // eslint-disable-line id-length
1773
+ Object.assign(this.element.bib.style, {
1774
+ left: `${x}px`,
1775
+ top: `${y}px`,
1776
+ });
1777
+ });
1778
+ } else if (strategy === 'cover') {
1779
+ // Compute the position of the bib
1780
+ computePosition(this.element.parentNode, this.element.bib, {
1781
+ placement: 'bottom-start'
1782
+ }).then(({ x, y }) => { // eslint-disable-line id-length
1783
+ Object.assign(this.element.bib.style, {
1784
+ left: `${x}px`,
1785
+ top: `${y - this.element.parentNode.offsetHeight}px`,
1786
+ width: `${this.element.parentNode.offsetWidth}px`,
1787
+ height: `${this.element.parentNode.offsetHeight}px`
1788
+ });
1789
+ });
1790
+ }
1791
+ }
1792
+
1793
+ /**
1794
+ * @private
1795
+ * Controls whether to lock the scrolling for the document's body.
1796
+ * @param {Boolean} lock - If true, locks the body's scrolling functionlity; otherwise, unlock.
1797
+ */
1798
+ lockScroll(lock = true) {
1799
+ if (lock) {
1800
+ document.body.style.overflow = 'hidden'; // hide body's scrollbar
1801
+
1802
+ // Move `bib` by the amount the viewport is shifted to stay aligned in fullscreen.
1803
+ this.element.bib.style.transform = `translateY(${visualViewport.offsetTop}px)`;
1804
+ } else {
1805
+ document.body.style.overflow = '';
1806
+ }
1807
+ }
1808
+
1809
+ /**
1810
+ * @private
1811
+ * Configures the bib element's display strategy.
1812
+ *
1813
+ * Sets the bib to fullscreen or floating mode based on the provided strategy.
1814
+ * Dispatches a 'strategy-change' event if the strategy changes.
1815
+ *
1816
+ * @param {string} strategy - The positioning strategy ('fullscreen' or 'floating').
1817
+ */
1818
+ configureBibStrategy(value) {
1819
+ if (value === 'fullscreen') {
1820
+ this.element.isBibFullscreen = true;
1821
+ // reset the prev position
1822
+ this.element.bib.setAttribute('isfullscreen', "");
1823
+ this.element.bib.style.position = 'fixed';
1824
+ this.element.bib.style.top = "0px";
1825
+ this.element.bib.style.left = "0px";
1826
+ this.element.bib.style.width = '';
1827
+ this.element.bib.style.height = '';
1828
+ this.element.style.contain = '';
1829
+
1830
+ // reset the size that was mirroring `size` css-part
1831
+ const bibContent = this.element.bib.shadowRoot.querySelector(".container");
1832
+ if (bibContent) {
1833
+ bibContent.style.width = '';
1834
+ bibContent.style.height = '';
1835
+ bibContent.style.maxWidth = '';
1836
+ bibContent.style.maxHeight = `${window.visualViewport.height}px`;
1837
+ this.configureTrial = 0;
1838
+ } else if (this.configureTrial < MAX_CONFIGURATION_COUNT) {
1839
+ this.configureTrial += 1;
1840
+
1841
+ setTimeout(() => {
1842
+ this.configureBibStrategy(value);
1843
+ }, 0);
1844
+ }
1845
+
1846
+ if (this.element.isPopoverVisible) {
1847
+ this.lockScroll(true);
1848
+ }
1849
+ } else {
1850
+ this.element.bib.style.position = '';
1851
+ this.element.bib.removeAttribute('isfullscreen');
1852
+ this.element.isBibFullscreen = false;
1853
+ this.element.style.contain = 'layout';
1854
+ }
1855
+
1856
+ const isChanged = this.strategy && this.strategy !== value;
1857
+ this.strategy = value;
1858
+ if (isChanged) {
1859
+ const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-strategy-change` : 'strategy-change', {
1860
+ detail: {
1861
+ value,
1862
+ },
1863
+ composed: true
1864
+ });
1865
+
1866
+ this.element.dispatchEvent(event);
1867
+ }
1868
+ }
1869
+
1870
+ updateState() {
1871
+ const isVisible = this.element.isPopoverVisible;
1872
+ if (!isVisible) {
1873
+ this.cleanupHideHandlers();
1874
+ try {
1875
+ this.element.cleanup?.();
1876
+ } catch (error) {
1877
+ // Do nothing
1878
+ }
1879
+ }
1880
+ }
1881
+
1882
+ /**
1883
+ * @private
1884
+ * getting called on 'blur' in trigger or `focusin` in document
1885
+ *
1886
+ * Hides the bib if focus moves outside of the trigger or bib, unless a 'noHideOnThisFocusLoss' flag is set.
1887
+ * This method checks if the currently active element is still within the trigger or bib.
1888
+ * If not, and if the bib isn't in fullscreen mode with focus lost, it hides the bib.
1889
+ */
1890
+ handleFocusLoss() {
1891
+ // if mouse is being pressed, skip and let click event to handle the action
1892
+ if (AuroFloatingUI.isMousePressed) {
1893
+ return;
1894
+ }
1895
+
1896
+ if (this.element.noHideOnThisFocusLoss ||
1897
+ this.element.hasAttribute('noHideOnThisFocusLoss')) {
1898
+ return;
1899
+ }
1900
+
1901
+ const { activeElement } = document;
1902
+ // if focus is still inside of trigger or bib, do not close
1903
+ if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
1904
+ return;
1905
+ }
1906
+
1907
+ // if fullscreen bib is in fullscreen mode, do not close
1908
+ if (this.element.bib.hasAttribute('isfullscreen')) {
1909
+ return;
1910
+ }
1911
+
1912
+ this.hideBib("keydown");
1913
+ }
1914
+
1915
+ setupHideHandlers() {
1916
+ // Define handlers & store references
1917
+ this.focusHandler = () => this.handleFocusLoss();
1918
+
1919
+ this.clickHandler = (evt) => {
1920
+ if ((!evt.composedPath().includes(this.element.trigger) &&
1921
+ !evt.composedPath().includes(this.element.bib)) ||
1922
+ (this.element.bib.backdrop && evt.composedPath().includes(this.element.bib.backdrop))) {
1923
+ const existedVisibleFloatingUI = document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
1924
+
1925
+ if (existedVisibleFloatingUI && existedVisibleFloatingUI.element.isPopoverVisible) {
1926
+ // if something else is open, close that
1927
+ existedVisibleFloatingUI.hideBib();
1928
+ document.expandedAuroFormkitDropdown = null;
1929
+ document.expandedAuroFloater = this;
1930
+ } else {
1931
+ this.hideBib("click");
1932
+ }
1933
+ }
1934
+ };
1935
+
1936
+ // ESC key handler
1937
+ this.keyDownHandler = (evt) => {
1938
+ if (evt.key === 'Escape' && this.element.isPopoverVisible) {
1939
+ const existedVisibleFloatingUI = document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
1940
+ if (existedVisibleFloatingUI && existedVisibleFloatingUI !== this && existedVisibleFloatingUI.element.isPopoverVisible) {
1941
+ // if something else is open, let it handle itself
1942
+ return;
1943
+ }
1944
+ this.hideBib("keydown");
1945
+ }
1946
+ };
1947
+
1948
+ if (this.behavior !== 'drawer' && this.behavior !== 'dialog') {
1949
+ // Add event listeners using the stored references
1950
+ document.addEventListener('focusin', this.focusHandler);
1951
+ }
1952
+
1953
+ document.addEventListener('keydown', this.keyDownHandler);
1954
+
1955
+ // send this task to the end of queue to prevent conflicting
1956
+ // it conflicts if showBib gets call from a button that's not this.element.trigger
1957
+ setTimeout(() => {
1958
+ window.addEventListener('click', this.clickHandler);
1959
+ }, 0);
1960
+ }
1961
+
1962
+ cleanupHideHandlers() {
1963
+ // Remove event listeners if they exist
1964
+
1965
+ if (this.focusHandler) {
1966
+ document.removeEventListener('focusin', this.focusHandler);
1967
+ this.focusHandler = null;
1968
+ }
1969
+
1970
+ if (this.clickHandler) {
1971
+ window.removeEventListener('click', this.clickHandler);
1972
+ this.clickHandler = null;
1973
+ }
1974
+
1975
+ if (this.keyDownHandler) {
1976
+ document.removeEventListener('keydown', this.keyDownHandler);
1977
+ this.keyDownHandler = null;
1978
+ }
1979
+ }
1980
+
1981
+ handleUpdate(changedProperties) {
1982
+ if (changedProperties.has('isPopoverVisible')) {
1983
+ this.updateState();
1984
+ }
1985
+ }
1986
+
1987
+ updateCurrentExpandedDropdown() {
1988
+ // Close any other dropdown that is already open
1989
+ const existedVisibleFloatingUI = document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
1990
+ if (existedVisibleFloatingUI && existedVisibleFloatingUI !== this &&
1991
+ existedVisibleFloatingUI.element.isPopoverVisible &&
1992
+ document.expandedAuroFloater.eventPrefix === this.eventPrefix) {
1993
+ document.expandedAuroFloater.hideBib();
1994
+ }
1995
+
1996
+ document.expandedAuroFloater = this;
1997
+ }
1998
+
1999
+ showBib() {
2000
+ if (!this.element.disabled && !this.showing) {
2001
+ this.updateCurrentExpandedDropdown();
2002
+ this.element.triggerChevron?.setAttribute('data-expanded', true);
2003
+
2004
+ // prevent double showing: isPopovervisible gets first and showBib gets called later
2005
+ if (!this.showing) {
2006
+ if (!this.element.modal) {
2007
+ this.setupHideHandlers();
2008
+ }
2009
+ this.showing = true;
2010
+ this.element.isPopoverVisible = true;
2011
+ this.position();
2012
+ this.dispatchEventDropdownToggle();
2013
+ }
2014
+
2015
+ // Setup auto update to handle resize and scroll
2016
+ this.element.cleanup = autoUpdate(this.element.trigger || this.element.parentNode, this.element.bib, () => {
2017
+ this.position();
2018
+ });
2019
+ }
2020
+ }
2021
+
2022
+ /**
2023
+ * Hides the floating UI element.
2024
+ * @param {String} eventType - The event type that triggered the hiding action.
2025
+ */
2026
+ hideBib(eventType = "unknown") {
2027
+ if (!this.element.disabled && !this.element.noToggle) {
2028
+ this.lockScroll(false);
2029
+ this.element.triggerChevron?.removeAttribute('data-expanded');
2030
+
2031
+ if (this.element.isPopoverVisible) {
2032
+ this.element.isPopoverVisible = false;
2033
+ }
2034
+ if (this.showing) {
2035
+ this.cleanupHideHandlers();
2036
+ this.showing = false;
2037
+ this.dispatchEventDropdownToggle(eventType);
2038
+ }
2039
+ }
2040
+ document.expandedAuroFloater = null;
2041
+ }
2042
+
2043
+ /**
2044
+ * @private
2045
+ * @returns {void} Dispatches event with an object showing the state of the dropdown.
2046
+ * @param {String} eventType - The event type that triggered the toggle action.
2047
+ */
2048
+ dispatchEventDropdownToggle(eventType) {
2049
+ const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
2050
+ detail: {
2051
+ expanded: this.showing,
2052
+ eventType: eventType || "unknown",
2053
+ },
2054
+ composed: true
2055
+ });
2056
+
2057
+ this.element.dispatchEvent(event);
2058
+ }
2059
+
2060
+ handleClick() {
2061
+ if (this.element.isPopoverVisible) {
2062
+ this.hideBib("click");
2063
+ } else {
2064
+ this.showBib();
2065
+ }
2066
+
2067
+ const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-triggerClick` : "triggerClick", {
2068
+ composed: true,
2069
+ detail: {
2070
+ expanded: this.element.isPopoverVisible
2071
+ }
2072
+ });
2073
+
2074
+ this.element.dispatchEvent(event);
2075
+ }
2076
+
2077
+ handleEvent(event) {
2078
+ if (!this.element.disableEventShow) {
2079
+ switch (event.type) {
2080
+ case 'keydown':
2081
+ // Support both Enter and Space keys for accessibility
2082
+ // Space is included as it's expected behavior for interactive elements
2083
+
2084
+ const origin = event.composedPath()[0];
2085
+ if (event.key === 'Enter' || event.key === ' ' && (!origin || origin.tagName !== "INPUT")) {
2086
+
2087
+ event.preventDefault();
2088
+ this.handleClick();
2089
+ }
2090
+ break;
2091
+ case 'mouseenter':
2092
+ if (this.element.hoverToggle) {
2093
+ this.showBib();
2094
+ }
2095
+ break;
2096
+ case 'mouseleave':
2097
+ if (this.element.hoverToggle) {
2098
+ this.hideBib("mouseleave");
2099
+ }
2100
+ break;
2101
+ case 'focus':
2102
+ if (this.element.focusShow) {
2103
+
2104
+ /*
2105
+ This needs to better handle clicking that gives focus -
2106
+ currently it shows and then immediately hides the bib
2107
+ */
2108
+ this.showBib();
2109
+ }
2110
+ break;
2111
+ case 'blur':
2112
+ // send this task 100ms later queue to
2113
+ // wait a frame in case focus moves within the floating element/bib
2114
+ setTimeout(() => this.handleFocusLoss(), 0);
2115
+ break;
2116
+ case 'click':
2117
+ if (document.activeElement === document.body) {
2118
+ event.currentTarget.focus();
2119
+ }
2120
+ this.handleClick();
2121
+ break;
2122
+ // Do nothing
2123
+ }
2124
+ }
2125
+ }
2126
+
2127
+ /**
2128
+ * Manages the tabIndex of the trigger element based on its focusability.
2129
+ *
2130
+ * If the trigger element or any of its children are inherently focusable, the tabIndex of the component is set to -1.
2131
+ * This prevents the component itself from being focusable when the trigger element already handles focus.
2132
+ */
2133
+ handleTriggerTabIndex() {
2134
+ const focusableElementSelectors = [
2135
+ 'a',
2136
+ 'button',
2137
+ 'input:not([type="hidden"])',
2138
+ 'select',
2139
+ 'textarea',
2140
+ '[tabindex]:not([tabindex="-1"])',
2141
+ 'auro-button',
2142
+ 'auro-input',
2143
+ 'auro-hyperlink'
2144
+ ];
2145
+
2146
+ const triggerNode = this.element.querySelectorAll('[slot="trigger"]')[0];
2147
+ if (!triggerNode) {
2148
+ return;
2149
+ }
2150
+ const triggerNodeTagName = triggerNode.tagName.toLowerCase();
2151
+
2152
+ focusableElementSelectors.forEach((selector) => {
2153
+ // Check if the trigger node element is focusable
2154
+ if (triggerNodeTagName === selector) {
2155
+ this.element.tabIndex = -1;
2156
+ return;
2157
+ }
2158
+
2159
+ // Check if any child is focusable
2160
+ if (triggerNode.querySelector(selector)) {
2161
+ this.element.tabIndex = -1;
2162
+ }
2163
+ });
2164
+ }
2165
+
2166
+ /**
2167
+ *
2168
+ * @param {*} eventPrefix
2169
+ */
2170
+ regenerateBibId() {
2171
+ this.id = this.element.getAttribute('id');
2172
+ if (!this.id) {
2173
+ this.id = window.crypto.randomUUID();
2174
+ this.element.setAttribute('id', this.id);
2175
+ }
2176
+
2177
+ this.element.bib.setAttribute("id", `${this.id}-floater-bib`);
2178
+ }
2179
+
2180
+ configure(elem, eventPrefix) {
2181
+ AuroFloatingUI.setupMousePressChecker();
2182
+
2183
+ this.eventPrefix = eventPrefix;
2184
+ if (this.element !== elem) {
2185
+ this.element = elem;
2186
+ }
2187
+
2188
+ if (this.behavior !== this.element.behavior) {
2189
+ this.behavior = this.element.behavior;
2190
+ }
2191
+
2192
+ if (this.element.trigger) {
2193
+ this.disconnect();
2194
+ }
2195
+ this.element.trigger = this.element.triggerElement || this.element.shadowRoot.querySelector('#trigger') || this.element.trigger;
2196
+ this.element.bib = this.element.shadowRoot.querySelector('#bib') || this.element.bib;
2197
+ this.element.bibSizer = this.element.shadowRoot.querySelector('#bibSizer');
2198
+ this.element.triggerChevron = this.element.shadowRoot.querySelector('#showStateIcon');
2199
+
2200
+
2201
+ if (this.element.floaterConfig) {
2202
+ this.element.hoverToggle = this.element.floaterConfig.hoverToggle;
2203
+ }
2204
+
2205
+ this.regenerateBibId();
2206
+ this.handleTriggerTabIndex();
2207
+
2208
+ this.handleEvent = this.handleEvent.bind(this);
2209
+ if (this.element.trigger) {
2210
+ this.element.trigger.addEventListener('keydown', this.handleEvent);
2211
+ this.element.trigger.addEventListener('click', this.handleEvent);
2212
+ this.element.trigger.addEventListener('mouseenter', this.handleEvent);
2213
+ this.element.trigger.addEventListener('mouseleave', this.handleEvent);
2214
+ this.element.trigger.addEventListener('focus', this.handleEvent);
2215
+ this.element.trigger.addEventListener('blur', this.handleEvent);
2216
+ }
2217
+ }
2218
+
2219
+ disconnect() {
2220
+ this.cleanupHideHandlers();
2221
+ if (this.element) {
2222
+ this.element.cleanup?.();
2223
+
2224
+ if (this.element.bib) {
2225
+ this.element.shadowRoot.append(this.element.bib);
2226
+ }
2227
+
2228
+ // Remove event & keyboard listeners
2229
+ if (this.element?.trigger) {
2230
+ this.element.trigger.removeEventListener('keydown', this.handleEvent);
2231
+ this.element.trigger.removeEventListener('click', this.handleEvent);
2232
+ this.element.trigger.removeEventListener('mouseenter', this.handleEvent);
2233
+ this.element.trigger.removeEventListener('mouseleave', this.handleEvent);
2234
+ this.element.trigger.removeEventListener('focus', this.handleEvent);
2235
+ this.element.trigger.removeEventListener('blur', this.handleEvent);
2236
+ }
2237
+ }
2238
+ }
2239
+ }
2240
+
2241
+ // Selectors for focusable elements
2242
+ const FOCUSABLE_SELECTORS = [
2243
+ 'a[href]',
2244
+ 'button:not([disabled])',
2245
+ 'textarea:not([disabled])',
2246
+ 'input:not([disabled])',
2247
+ 'select:not([disabled])',
2248
+ '[role="tab"]:not([disabled])',
2249
+ '[role="link"]:not([disabled])',
2250
+ '[role="button"]:not([disabled])',
2251
+ '[tabindex]:not([tabindex="-1"])',
2252
+ '[contenteditable]:not([contenteditable="false"])'
2253
+ ];
2254
+
2255
+ // List of custom components that are known to be focusable
2256
+ const FOCUSABLE_COMPONENTS = [
2257
+ 'auro-checkbox',
2258
+ 'auro-radio',
2259
+ 'auro-dropdown',
2260
+ 'auro-button',
2261
+ 'auro-combobox',
2262
+ 'auro-input',
2263
+ 'auro-counter',
2264
+ 'auro-menu',
2265
+ 'auro-select',
2266
+ 'auro-datepicker',
2267
+ 'auro-hyperlink',
2268
+ 'auro-accordion',
2269
+ ];
2270
+
2271
+ /**
2272
+ * Determines if a given element is a custom focusable component.
2273
+ * Returns true if the element matches a known focusable component and is not disabled.
2274
+ *
2275
+ * @param {HTMLElement} element The element to check for focusability.
2276
+ * @returns {boolean} True if the element is a focusable custom component, false otherwise.
2277
+ */
2278
+ function isFocusableComponent(element) {
2279
+ const componentName = element.tagName.toLowerCase();
2280
+
2281
+ // Guard Clause: Element is a focusable component
2282
+ if (!FOCUSABLE_COMPONENTS.some((name) => element.hasAttribute(name) || componentName === name)) return false;
2283
+
2284
+ // Guard Clause: Element is not disabled
2285
+ if (element.hasAttribute('disabled')) return false;
2286
+
2287
+ // Guard Clause: The element is a hyperlink and has no href attribute
2288
+ if (componentName.match("hyperlink") && !element.hasAttribute('href')) return false;
2289
+
2290
+ // If all guard clauses pass, the element is a focusable component
2291
+ return true;
2292
+ }
2293
+
2294
+ /**
2295
+ * Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
2296
+ * Returns a unique, ordered array of elements that can receive focus.
2297
+ *
2298
+ * @param {HTMLElement} container The container to search within
2299
+ * @returns {Array<HTMLElement>} An array of focusable elements within the container.
2300
+ */
2301
+ function getFocusableElements(container) {
2302
+ // Get elements in DOM order by walking the tree
2303
+ const orderedFocusableElements = [];
2304
+
2305
+ // Define a recursive function to collect focusable elements in DOM order
2306
+ const collectFocusableElements = (root) => {
2307
+ // Check if current element is focusable
2308
+ if (root.nodeType === Node.ELEMENT_NODE) {
2309
+ // Check if this is a custom component that is focusable
2310
+ const isComponentFocusable = isFocusableComponent(root);
2311
+
2312
+ if (isComponentFocusable) {
2313
+ // Add the component itself as a focusable element and don't traverse its shadow DOM
2314
+ orderedFocusableElements.push(root);
2315
+ return; // Skip traversing inside this component
2316
+ }
2317
+
2318
+ // Check if the element itself matches any selector
2319
+ for (const selector of FOCUSABLE_SELECTORS) {
2320
+ if (root.matches?.(selector)) {
2321
+ orderedFocusableElements.push(root);
2322
+ break; // Once we know it's focusable, no need to check other selectors
2323
+ }
2324
+ }
2325
+
2326
+ // Process shadow DOM only for non-Auro components
2327
+ if (root.shadowRoot) {
2328
+ // Process shadow DOM children in order
2329
+ if (root.shadowRoot.children) {
2330
+ Array.from(root.shadowRoot.children).forEach(child => {
2331
+ collectFocusableElements(child);
2332
+ });
2333
+ }
2334
+ }
2335
+
2336
+ // Process slots and their assigned nodes in order
2337
+ if (root.tagName === 'SLOT') {
2338
+ const assignedNodes = root.assignedNodes({ flatten: true });
2339
+ for (const node of assignedNodes) {
2340
+ collectFocusableElements(node);
2341
+ }
2342
+ } else {
2343
+ // Process light DOM children in order
2344
+ if (root.children) {
2345
+ Array.from(root.children).forEach(child => {
2346
+ collectFocusableElements(child);
2347
+ });
2348
+ }
2349
+ }
2350
+ }
2351
+ };
2352
+
2353
+ // Start the traversal from the container
2354
+ collectFocusableElements(container);
2355
+
2356
+ // Remove duplicates that might have been collected through different paths
2357
+ // while preserving order
2358
+ const uniqueElements = [];
2359
+ const seen = new Set();
2360
+
2361
+ for (const element of orderedFocusableElements) {
2362
+ if (!seen.has(element)) {
2363
+ seen.add(element);
2364
+ uniqueElements.push(element);
2365
+ }
2366
+ }
2367
+
2368
+ return uniqueElements;
2369
+ }
2370
+
2371
+ /**
2372
+ * FocusTrap manages keyboard focus within a specified container element, ensuring that focus does not leave the container when tabbing.
2373
+ * It is commonly used for modal dialogs or overlays to improve accessibility by trapping focus within interactive UI components.
2374
+ */
2375
+ class FocusTrap {
2376
+ /**
2377
+ * Creates a new FocusTrap instance for the given container element.
2378
+ * Initializes event listeners and prepares the container for focus management.
2379
+ *
2380
+ * @param {HTMLElement} container The DOM element to trap focus within.
2381
+ * @throws {Error} If the provided container is not a valid HTMLElement.
2382
+ */
2383
+ constructor(container) {
2384
+ if (!container || !(container instanceof HTMLElement)) {
2385
+ throw new Error("FocusTrap requires a valid HTMLElement.");
2386
+ }
2387
+
2388
+ this.container = container;
2389
+ this.tabDirection = 'forward'; // or 'backward'
2390
+
2391
+ this._init();
2392
+ }
2393
+
2394
+ /**
2395
+ * Initializes the focus trap by setting up event listeners and attributes on the container.
2396
+ * Prepares the container for focus management, including support for shadow DOM and inert attributes.
2397
+ *
2398
+ * @private
2399
+ */
2400
+ _init() {
2401
+
2402
+ // Add inert attribute to prevent focusing programmatically as well (if supported)
2403
+ if ('inert' in HTMLElement.prototype) {
2404
+ this.container.inert = false; // Ensure the container isn't inert
2405
+ this.container.setAttribute('data-focus-trap-container', true); // Mark for identification
2406
+ }
2407
+
2408
+ // Track tab direction
2409
+ this.container.addEventListener('keydown', this._onKeydown);
2410
+ }
2411
+
2412
+ /**
2413
+ * Handles keydown events to manage tab navigation within the container.
2414
+ * Ensures that focus wraps around when reaching the first or last focusable element.
2415
+ *
2416
+ * @param {KeyboardEvent} e The keyboard event triggered by user interaction.
2417
+ * @private
2418
+ */
2419
+ _onKeydown = (e) => {
2420
+
2421
+ if (e.key === 'Tab') {
2422
+
2423
+ // Set the tab direction based on the key pressed
2424
+ this.tabDirection = e.shiftKey ? 'backward' : 'forward';
2425
+
2426
+ // Get the active element(s) in the document and shadow root
2427
+ // This will include the active element in the shadow DOM if it exists
2428
+ // Active element may be inside the shadow DOM depending on delegatesFocus, so we need to check both
2429
+ let activeElement = document.activeElement;
2430
+ const actives = [activeElement];
2431
+ while (activeElement?.shadowRoot?.activeElement) {
2432
+ actives.push(activeElement.shadowRoot.activeElement);
2433
+ activeElement = activeElement.shadowRoot.activeElement;
2434
+ }
2435
+
2436
+ // Update the focusable elements
2437
+ const focusables = this._getFocusableElements();
2438
+
2439
+ // If we're at either end of the focusable elements, wrap around to the other end
2440
+ const focusIndex =
2441
+ (actives.includes(focusables[0]) || actives.includes(this.container)) && this.tabDirection === 'backward'
2442
+ ? focusables.length - 1
2443
+ : actives.includes(focusables[focusables.length - 1]) && this.tabDirection === 'forward'
2444
+ ? 0
2445
+ : null;
2446
+
2447
+ if (focusIndex !== null) {
2448
+ focusables[focusIndex].focus();
2449
+ e.preventDefault(); // Prevent default tab behavior
2450
+ e.stopPropagation(); // Stop the event from bubbling up
2451
+ }
2452
+ }
2453
+ };
2454
+
2455
+ /**
2456
+ * Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
2457
+ * Returns a unique, ordered array of elements that can receive focus.
2458
+ *
2459
+ * @returns {Array<HTMLElement>} An array of focusable elements within the container.
2460
+ * @private
2461
+ */
2462
+ _getFocusableElements() {
2463
+ // Use the imported utility function to get focusable elements
2464
+ const elements = getFocusableElements(this.container);
2465
+
2466
+ // Filter out any elements with the 'focus-bookend' class
2467
+ return elements;
2468
+ }
2469
+
2470
+ /**
2471
+ * Moves focus to the first focusable element within the container.
2472
+ * Useful for setting initial focus when activating the focus trap.
2473
+ */
2474
+ focusFirstElement() {
2475
+ const focusables = this._getFocusableElements();
2476
+ if (focusables.length) focusables[0].focus();
2477
+ }
2478
+
2479
+ /**
2480
+ * Moves focus to the last focusable element within the container.
2481
+ * Useful for setting focus when deactivating or cycling focus in reverse.
2482
+ */
2483
+ focusLastElement() {
2484
+ const focusables = this._getFocusableElements();
2485
+ if (focusables.length) focusables[focusables.length - 1].focus();
2486
+ }
2487
+
2488
+ /**
2489
+ * Removes event listeners and attributes added by the focus trap.
2490
+ * Call this method to clean up when the focus trap is no longer needed.
2491
+ */
2492
+ disconnect() {
2493
+
2494
+ if (this.container.hasAttribute('data-focus-trap-container')) {
2495
+ this.container.removeAttribute('data-focus-trap-container');
2496
+ }
2497
+
2498
+ this.container.removeEventListener('keydown', this._onKeydown);
2499
+ }
2500
+ }
2501
+
2502
+ // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
2503
+ // See LICENSE in the project root for license information.
2504
+
2505
+
2506
+ class AuroDependencyVersioning {
2507
+
2508
+ /**
2509
+ * Generates a unique string to be used for child auro element naming.
2510
+ * @private
2511
+ * @param {string} baseName - Defines the first part of the unique element name.
2512
+ * @param {string} version - Version of the component that will be appended to the baseName.
2513
+ * @returns {string} - Unique string to be used for naming.
2514
+ */
2515
+ generateElementName(baseName, version) {
2516
+ let result = baseName;
2517
+
2518
+ result += '-';
2519
+ result += version.replace(/[.]/g, '_');
2520
+
2521
+ return result;
2522
+ }
2523
+
2524
+ /**
2525
+ * Generates a unique string to be used for child auro element naming.
2526
+ * @param {string} baseName - Defines the first part of the unique element name.
2527
+ * @param {string} version - Version of the component that will be appended to the baseName.
2528
+ * @returns {string} - Unique string to be used for naming.
2529
+ */
2530
+ generateTag(baseName, version, tagClass) {
2531
+ const elementName = this.generateElementName(baseName, version);
2532
+ const tag = literal`${unsafeStatic(elementName)}`;
2533
+
2534
+ if (!customElements.get(elementName)) {
2535
+ customElements.define(elementName, class extends tagClass {});
2536
+ }
2537
+
2538
+ return tag;
2539
+ }
2540
+ }
2541
+
2542
+ // Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
2543
+ // See LICENSE in the project root for license information.
2544
+
2545
+
2546
+ /**
2547
+ * @attr {Boolean} hidden - If present, the component will be hidden both visually and from screen readers
2548
+ * @attr {Boolean} hiddenVisually - If present, the component will be hidden visually, but still read by screen readers
2549
+ * @attr {Boolean} hiddenAudible - If present, the component will be hidden from screen readers, but seen visually
2550
+ */
2551
+
2552
+ let AuroElement$1 = class AuroElement extends LitElement {
2553
+
2554
+ // function to define props used within the scope of this component
2555
+ static get properties() {
2556
+ return {
2557
+ hidden: { type: Boolean,
2558
+ reflect: true },
2559
+ hiddenVisually: { type: Boolean,
2560
+ reflect: true },
2561
+ hiddenAudible: { type: Boolean,
2562
+ reflect: true },
2563
+ };
2564
+ }
2565
+
2566
+ /**
2567
+ * @private Function that determines state of aria-hidden
2568
+ */
2569
+ hideAudible(value) {
2570
+ if (value) {
2571
+ return 'true'
2572
+ }
2573
+
2574
+ return 'false'
2575
+ }
2576
+ };
2577
+
2578
+ var error = {"svg":"<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>"};
2579
+
2580
+ /* eslint-disable no-underscore-dangle, jsdoc/no-undefined-types, jsdoc/require-param-description */
2581
+
2582
+ const _fetchMap = new Map();
2583
+
2584
+ /**
2585
+ * A callback to parse Response body.
2586
+ *
2587
+ * @callback ResponseParser
2588
+ * @param {Fetch.Response} response
2589
+ * @returns {Promise}
2590
+ */
2591
+
2592
+ /**
2593
+ * A minimal in-memory map to de-duplicate Fetch API media requests.
2594
+ *
2595
+ * @param {String} uri
2596
+ * @param {Object} [options={}]
2597
+ * @param {ResponseParser} [options.responseParser=(response) => response.text()]
2598
+ * @returns {Promise}
2599
+ */
2600
+ const cacheFetch = (uri, options = {}) => {
2601
+ const responseParser = options.responseParser || ((response) => response.text());
2602
+ if (!_fetchMap.has(uri)) {
2603
+ _fetchMap.set(uri, fetch(uri).then(responseParser));
2604
+ }
2605
+ return _fetchMap.get(uri);
2606
+ };
2607
+
2608
+ var styleCss$3 = css`: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, 0.75rem))}:host{color:currentColor;vertical-align:middle;line-height:1;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}.svgWrapper{height:var(--ds-auro-icon-size);width:var(--ds-auro-icon-size)}.labelWrapper{margin-left:var(--ds-size-50, 0.25rem);line-height:1.8}`;
2609
+
2610
+ // Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
2611
+ // See LICENSE in the project root for license information.
2612
+
2613
+
2614
+ // See https://git.io/JJ6SJ for "How to document your components using JSDoc"
2615
+ /**
2616
+ * @slot - Hidden from visibility, used for a11y if icon description is needed
2617
+ */
2618
+
2619
+ // build the component class
2620
+ class BaseIcon extends AuroElement$1 {
2621
+ constructor() {
2622
+ super();
2623
+ this.onDark = false;
2624
+ }
2625
+
2626
+ // function to define props used within the scope of this component
2627
+ static get properties() {
2628
+ return {
2629
+ ...super.properties,
2630
+
2631
+ /**
2632
+ * Set value for on-dark version of auro-icon.
2633
+ */
2634
+ onDark: {
2635
+ type: Boolean,
2636
+ reflect: true
2637
+ },
2638
+
2639
+ /**
2640
+ * @private
2641
+ */
2642
+ svg: {
2643
+ attribute: false,
2644
+ reflect: true
2645
+ }
2646
+ };
2647
+ }
2648
+
2649
+ static get styles() {
2650
+ return css`
2651
+ ${styleCss$3}
2652
+ `;
2653
+ }
2654
+
2655
+ /**
2656
+ * Async function to fetch requested icon from npm CDN.
2657
+ * @private
2658
+ * @param {string} category - Icon category.
2659
+ * @param {string} name - Icon name.
2660
+ * @returns {SVGElement} DOM - Ready HTML to be appended.
2661
+ */
2662
+ async fetchIcon(category, name) {
2663
+ let iconHTML = '';
2664
+
2665
+ if (category === 'logos') {
2666
+ iconHTML = await cacheFetch(`${this.uri}/${category}/${name}.svg`);
2667
+ } else {
2668
+ iconHTML = await cacheFetch(`${this.uri}/icons/${category}/${name}.svg`);
2669
+ }
2670
+
2671
+ const dom = new DOMParser().parseFromString(iconHTML, 'text/html');
2672
+
2673
+ return dom.body.querySelector('svg');
2674
+ }
2675
+
2676
+ // lifecycle function
2677
+ async firstUpdated() {
2678
+ if (!this.customSvg) {
2679
+ const svg = await this.fetchIcon(this.category, this.name);
2680
+
2681
+ if (svg) {
2682
+ this.svg = svg;
2683
+ } else if (!svg) {
2684
+ const penDOM = new DOMParser().parseFromString(error.svg, 'text/html');
2685
+
2686
+ this.svg = penDOM.body.firstChild;
2687
+ }
2688
+ }
2689
+ }
2690
+ }
2691
+
2692
+ var tokensCss$2 = css`: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)}`;
2693
+
2694
+ var colorCss$3 = css`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]){--ds-auro-icon-color:var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]){--ds-auro-icon-color:var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]){--ds-auro-icon-color:var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]){--ds-auro-icon-color:var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]){--ds-auro-icon-color:var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]){--ds-auro-icon-color:var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]){--ds-auro-icon-color:var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]){--ds-auro-icon-color:var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][variant=statusError]){--ds-auro-icon-color:var(--ds-advanced-color-state-error-inverse, #f9a4a8)}`;
2695
+
2696
+ // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
2697
+ // See LICENSE in the project root for license information.
2698
+
2699
+ // ---------------------------------------------------------------------
2700
+
2701
+ /* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
2702
+
2703
+ let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
2704
+
2705
+ /* eslint-disable jsdoc/require-param */
2706
+
2707
+ /**
2708
+ * This will register a new custom element with the browser.
2709
+ * @param {String} name - The name of the custom element.
2710
+ * @param {Object} componentClass - The class to register as a custom element.
2711
+ * @returns {void}
2712
+ */
2713
+ registerComponent(name, componentClass) {
2714
+ if (!customElements.get(name)) {
2715
+ customElements.define(name, class extends componentClass {});
2716
+ }
2717
+ }
2718
+
2719
+ /**
2720
+ * Finds and returns the closest HTML Element based on a selector.
2721
+ * @returns {void}
2722
+ */
2723
+ closestElement(
2724
+ selector, // selector like in .closest()
2725
+ base = this, // extra functionality to skip a parent
2726
+ __Closest = (el, found = el && el.closest(selector)) =>
2727
+ !el || el === document || el === window
2728
+ ? null // standard .closest() returns null for non-found selectors also
2729
+ : found
2730
+ ? found // found a selector INside this element
2731
+ : __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
2732
+ ) {
2733
+ return __Closest(base);
2734
+ }
2735
+ /* eslint-enable jsdoc/require-param */
2736
+
2737
+ /**
2738
+ * 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.
2739
+ * @param {Object} elem - The element to check.
2740
+ * @param {String} tagName - The name of the Auro component to check for or add as an attribute.
2741
+ * @returns {void}
2742
+ */
2743
+ handleComponentTagRename(elem, tagName) {
2744
+ const tag = tagName.toLowerCase();
2745
+ const elemTag = elem.tagName.toLowerCase();
2746
+
2747
+ if (elemTag !== tag) {
2748
+ elem.setAttribute(tag, true);
2749
+ }
2750
+ }
2751
+
2752
+ /**
2753
+ * Validates if an element is a specific Auro component.
2754
+ * @param {Object} elem - The element to validate.
2755
+ * @param {String} tagName - The name of the Auro component to check against.
2756
+ * @returns {Boolean} - Returns true if the element is the specified Auro component.
2757
+ */
2758
+ elementMatch(elem, tagName) {
2759
+ const tag = tagName.toLowerCase();
2760
+ const elemTag = elem.tagName.toLowerCase();
2761
+
2762
+ return elemTag === tag || elem.hasAttribute(tag);
2763
+ }
2764
+ };
2765
+
2766
+ // Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
2767
+ // See LICENSE in the project root for license information.
2768
+
2769
+
2770
+ class AuroIcon extends BaseIcon {
2771
+ constructor() {
2772
+ super();
2773
+
2774
+ this.variant = undefined;
2775
+ this.privateDefaults();
2776
+ }
2777
+
2778
+ /**
2779
+ * Internal Defaults.
2780
+ * @private
2781
+ * @returns {void}
2782
+ */
2783
+ privateDefaults() {
2784
+ this.uri = 'https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist';
2785
+ this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
2786
+ }
2787
+
2788
+ // function to define props used within the scope of this component
2789
+ static get properties() {
2790
+ return {
2791
+ ...super.properties,
2792
+
2793
+ /**
2794
+ * Set aria-hidden value. Default is `true`. Option is `false`.
2795
+ */
2796
+ ariaHidden: {
2797
+ type: String,
2798
+ reflect: true
2799
+ },
2800
+
2801
+ /**
2802
+ * The category of the icon you are looking for. See https://auro.alaskaair.com/icons/usage.
2803
+ */
2804
+ category: {
2805
+ type: String,
2806
+ reflect: true
2807
+ },
2808
+
2809
+ /**
2810
+ * Allows custom color to be set.
2811
+ */
2812
+ customColor: {
2813
+ type: Boolean,
2814
+ reflect: true
2815
+ },
2816
+
2817
+ /**
2818
+ * When true, auro-icon will render a custom SVG inside the default slot.
2819
+ */
2820
+ customSvg: {
2821
+ type: Boolean
2822
+ },
2823
+
2824
+ /**
2825
+ * Exposes content in slot as icon label.
2826
+ */
2827
+ label: {
2828
+ type: Boolean,
2829
+ reflect: true
2830
+ },
2831
+
2832
+ /**
2833
+ * The name of the icon you are looking for without the file extension. See https://auro.alaskaair.com/icons/usage.
2834
+ */
2835
+ name: {
2836
+ type: String,
2837
+ reflect: true
2838
+ },
2839
+
2840
+ /**
2841
+ * The style of the icon. The accepted variants are `accent1`, `disabled`, `muted`, `statusDefault`, `statusInfo`, `statusSuccess`, `statusWarning`, `statusError`, `statusInfoSubtle`, `statusSuccessSubtle`, `statusWarningSubtle`, `statusErrorSubtle`, `fareBasicEconomy`, `fareBusiness`, `fareEconomy`, `fareFirst`, `farePremiumEconomy`, `tierOneWorldEmerald`, `tierOneWorldSapphire`, `tierOneWorldRuby`.
2842
+ */
2843
+ variant: {
2844
+ type: String,
2845
+ reflect: true
2846
+ }
2847
+ };
2848
+ }
2849
+
2850
+ static get styles() {
2851
+ return [
2852
+ super.styles,
2853
+ css`${tokensCss$2}`,
2854
+ css`${styleCss$3}`,
2855
+ css`${colorCss$3}`
2856
+ ];
2857
+ }
2858
+
2859
+ /**
2860
+ * This will register this element with the browser.
2861
+ * @param {string} [name="auro-icon"] - The name of element that you want to register to.
2862
+ *
2863
+ * @example
2864
+ * AuroIcon.register("custom-icon") // this will register this element to <custom-icon/>
2865
+ *
2866
+ */
2867
+ static register(name = "auro-icon") {
2868
+ AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroIcon);
2869
+ }
2870
+
2871
+ connectedCallback() {
2872
+ super.connectedCallback();
2873
+
2874
+ // Add the tag name as an attribute if it is different than the component name
2875
+ this.runtimeUtils.handleComponentTagRename(this, 'auro-icon');
2876
+ }
2877
+
2878
+ /**
2879
+ * @private
2880
+ * @returns {void} Exposes CSS parts for styling from parent components.
2881
+ */
2882
+ exposeCssParts() {
2883
+ this.setAttribute('exportparts', 'svg:iconSvg');
2884
+ }
2885
+
2886
+ async firstUpdated() {
2887
+ await super.firstUpdated();
2888
+
2889
+ /**
2890
+ * icons provide a description for screen readers. Icon only instances Auro-button
2891
+ * depend on this description to provide context for the user using a screen reader.
2892
+ * Removes the SVG description for screen reader if ariaHidden is set to true.
2893
+ */
2894
+ if (this.hasAttribute('ariaHidden') && this.svg) {
2895
+ const svgDesc = this.svg.querySelector('desc');
2896
+
2897
+ if (svgDesc) {
2898
+ svgDesc.remove();
2899
+ this.svg.removeAttribute('aria-labelledby');
2900
+ }
2901
+ }
2902
+ }
2903
+
2904
+ // function that renders the HTML and CSS into the scope of the component
2905
+ render() {
2906
+ const labelClasses = {
2907
+ 'labelWrapper': true,
2908
+ 'util_displayHiddenVisually': !this.label
2909
+ };
2910
+
2911
+ const svgClasses = {
2912
+ 'svgWrapper': true,
2913
+ };
2914
+
2915
+ return html`
2916
+ <div class="componentWrapper">
2917
+ <div
2918
+ class="${classMap(svgClasses)}"
2919
+ title="${ifDefined(this.title || undefined)}">
2920
+ <span aria-hidden="${ifDefined(this.ariaHidden || true)}" part="svg">
2921
+ ${this.customSvg ? html`
2922
+ <slot name="svg"></slot>
2923
+ ` : html`
2924
+ ${this.svg}
2925
+ `
2926
+ }
2927
+ </span>
2928
+ </div>
2929
+
2930
+ <div class="${classMap(labelClasses)}">
2931
+ <slot></slot>
2932
+ </div>
2933
+ </div>
2934
+ `;
2935
+ }
2936
+ }
2937
+
2938
+ var iconVersion = '6.1.2';
2939
+
2940
+ var styleCss$2 = css`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none;isolation:isolate}:host(:not([matchWidth])) .container{min-width:fit-content}:host([isfullscreen]){position:fixed;top:0;left:0}:host([isfullscreen]) .container{width:100dvw;max-width:none;height:100dvh;max-height:none;border-radius:unset;margin-top:0;box-shadow:unset;overscroll-behavior:contain}:host([data-show]){display:flex}:host([common]:not([isfullscreen])) .container,:host([rounded]:not([isfullscreen])) .container{border-radius:var(--ds-border-radius, 0.375rem)}:host([common][isfullscreen]) .container,:host([rounded][isfullscreen]) .container{border-radius:unset;box-shadow:unset}:host(:not([isfullscreen])) .container.shape-box{border-radius:unset}:host(:not([isfullscreen])) .container[class*=shape-pill],:host(:not([isfullscreen])) .container[class*=shape-snowflake]{border-radius:30px}.container{display:inline-block;overflow:auto;box-sizing:border-box;border-radius:var(--ds-border-radius, 0.375rem);margin:var(--ds-size-50, 0.25rem) 0}`;
2941
+
2942
+ var colorCss$2 = css`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
2943
+
2944
+ var tokensCss$1 = css`:host(:not([ondark])){--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-muted, #676767);--ds-auro-dropdown-trigger-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdown-trigger-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-bold, #585e67);--ds-auro-dropdown-trigger-outline-color: transparent;--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-dropdownbib-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdownbib-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdownbib-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]){--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db);--ds-auro-dropdown-trigger-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-inverse, #ffffff);--ds-auro-dropdown-trigger-outline-color: transparent;--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-dropdownbib-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdownbib-container-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdownbib-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}`;
2945
+
2946
+ // Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
2947
+ // See LICENSE in the project root for license information.
2948
+
2949
+
2950
+ const DESIGN_TOKEN_BREAKPOINT_PREFIX = '--ds-grid-breakpoint-';
2951
+ const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
2952
+ 'xl',
2953
+ 'lg',
2954
+ 'md',
2955
+ 'sm',
2956
+ 'xs',
2957
+ ];
2958
+
2959
+ /**
2960
+ * @prop { String } fullscreenBreakpoint - Defines the screen size breakpoint (`lg`, `md`, `sm`, or `xs`) at which the dropdown switches to fullscreen mode on mobile. When expanded, the dropdown will automatically display in fullscreen mode if the screen size is equal to or smaller than the selected breakpoint.
2961
+ * @csspart bibContainer - Apply css to the bib container.
2962
+ */
2963
+
2964
+ class AuroDropdownBib extends LitElement {
2965
+ // not extending AuroElement because Bib needs only `shape` prop
2966
+ constructor() {
2967
+ super();
2968
+
2969
+ /**
2970
+ * @private
2971
+ */
2972
+ this._mobileBreakpointValue = undefined;
2973
+
2974
+ AuroLibraryRuntimeUtils$2.prototype.handleComponentTagRename(this, 'auro-dropdownbib');
2975
+
2976
+ this.shape = "rounded";
2977
+ this.matchWidth = false;
2978
+ }
2979
+
2980
+ static get styles() {
2981
+ return [
2982
+ styleCss$2,
2983
+ colorCss$2,
2984
+ tokensCss$1
2985
+ ];
2986
+ }
2987
+
2988
+ static get properties() {
2989
+ return {
2990
+
2991
+ /**
2992
+ * If declared, will take the fullscreen when the bib is displayed.
2993
+ */
2994
+ isFullscreen: {
2995
+ type: Boolean,
2996
+ reflect: true
2997
+ },
2998
+
2999
+ /**
3000
+ * If declared, will apply all styles for the common theme.
3001
+ */
3002
+ common: {
3003
+ type: Boolean,
3004
+ reflect: true
3005
+ },
3006
+
3007
+ /**
3008
+ * If declared, will apply extra padding to bib content.
3009
+ */
3010
+ inset: {
3011
+ type: Boolean,
3012
+ reflect: true
3013
+ },
3014
+
3015
+ /**
3016
+ * If declared, the bib width will match the trigger width.
3017
+ * @private
3018
+ */
3019
+ matchWidth: {
3020
+ type: Boolean,
3021
+ reflect: true
3022
+ },
3023
+
3024
+ /**
3025
+ * If declared, will apply border-radius to the bib.
3026
+ */
3027
+ rounded: {
3028
+ type: Boolean,
3029
+ reflect: true
3030
+ },
3031
+
3032
+ /**
3033
+ * A reference to the associated bib template element.
3034
+ */
3035
+ bibTemplate: {
3036
+ type: Object
3037
+ },
3038
+
3039
+ shape: {
3040
+ type: String,
3041
+ reflect: true
3042
+ }
3043
+ };
3044
+ }
3045
+
3046
+ set mobileFullscreenBreakpoint(value) {
3047
+ // verify the defined breakpoint is valid and exit out if not
3048
+ // 'disabled' is a design token breakpoint so it acts as our "undefined" value
3049
+ const validatedValue = DESIGN_TOKEN_BREAKPOINT_OPTIONS.includes(value) ? value : undefined;
3050
+ if (!validatedValue) {
3051
+ this._mobileBreakpointValue = undefined;
3052
+ } else {
3053
+ // get the pixel value for the defined breakpoint
3054
+ const docStyle = getComputedStyle(document.documentElement);
3055
+ this._mobileBreakpointValue = docStyle.getPropertyValue(DESIGN_TOKEN_BREAKPOINT_PREFIX + value);
3056
+ }
3057
+ }
3058
+
3059
+ get mobileFullscreenBreakpoint() {
3060
+ return this._mobileBreakpointValue;
3061
+ }
3062
+
3063
+ updated(changedProperties) {
3064
+ if (changedProperties.has('isFullscreen')) {
3065
+ this.childNodes.forEach((child) => {
3066
+ // skip any text that is not in an HTMLElement on setting `isFullscreen` attr.
3067
+ if (child.nodeName !== '#text') {
3068
+ if (this.isFullscreen) {
3069
+ child.setAttribute('isFullscreen', 'true');
3070
+ } else {
3071
+ child.removeAttribute('isFullscreen');
3072
+ }
3073
+ }
3074
+ });
3075
+
3076
+ if (this.bibTemplate) {
3077
+ // If the bib template is found, set the fullscreen attribute
3078
+ if (this.isFullscreen) {
3079
+ this.bibTemplate.setAttribute('isFullscreen', 'true');
3080
+ } else {
3081
+ this.bibTemplate.removeAttribute('isFullscreen');
3082
+ }
3083
+ }
3084
+ }
3085
+ }
3086
+
3087
+ connectedCallback() {
3088
+ super.connectedCallback();
3089
+
3090
+ // Listen for the auro-bibtemplate-connected event to set the fullscreen attribute
3091
+ this.addEventListener('auro-bibtemplate-connected', (event) => {
3092
+ const bibTemplate = event.detail.element;
3093
+ this.bibTemplate = bibTemplate;
3094
+
3095
+ if (bibTemplate) {
3096
+ // If the bib template is found, set the fullscreen attribute
3097
+ if (this.isFullscreen) {
3098
+ bibTemplate.setAttribute('isFullscreen', 'true');
3099
+ } else {
3100
+ bibTemplate.removeAttribute('isFullscreen');
3101
+ }
3102
+ }
3103
+ });
3104
+ }
3105
+
3106
+ firstUpdated(changedProperties) {
3107
+ super.firstUpdated(changedProperties);
3108
+
3109
+ // Dispatch a custom event when the component is connected
3110
+ this.dispatchEvent(new CustomEvent('auro-dropdownbib-connected', {
3111
+ bubbles: true,
3112
+ composed: true,
3113
+ detail: {
3114
+ element: this
3115
+ }
3116
+ }));
3117
+ }
3118
+
3119
+ // function that renders the HTML and CSS into the scope of the component
3120
+ render() {
3121
+ const classes = {
3122
+ container: true
3123
+ };
3124
+
3125
+ // Since this class does not inherit from AuroElement, we apply the shape-related class within the `render` function,
3126
+ // mimicking the class naming convention used in AuroElement.resetShapeClasses.
3127
+ classes[`shape-${this.shape}`] = true;
3128
+
3129
+ return html$1`
3130
+ <div class="${classMap(classes)}" part="bibContainer">
3131
+ <slot></slot>
3132
+ </div>
3133
+ `;
3134
+ }
3135
+ }
3136
+
3137
+ var dropdownVersion = '3.0.0';
3138
+
3139
+ var shapeSizeCss = css`.wrapper{overflow:hidden}.shape-classic-xl,.shape-classic-lg,.shape-classic-md,.shape-classic-sm,.shape-classic-xs{min-height:56px;max-height:56px;border-style:solid;border-width:1px;border-radius:var(--ds-border-radius, 0.375rem)}.shape-classic-xl.simple,.shape-classic-lg.simple,.shape-classic-md.simple,.shape-classic-sm.simple,.shape-classic-xs.simple{border-width:0px;min-height:58px;max-height:58px;background-color:unset;box-shadow:none}.shape-classic-xl.thin,.shape-classic-lg.thin,.shape-classic-md.thin,.shape-classic-sm.thin,.shape-classic-xs.thin{border-width:1px;min-height:56px;max-height:56px;background-color:unset}.shape-classic-xl.parentBorder,.shape-classic-lg.parentBorder,.shape-classic-md.parentBorder,.shape-classic-sm.parentBorder,.shape-classic-xs.parentBorder{border:0;box-shadow:unset;min-height:54px;max-height:54px}.shape-snowflake-xl,.shape-snowflake-lg,.shape-snowflake-md,.shape-snowflake-sm,.shape-snowflake-xs{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:30px}.shape-snowflake-xl.simple,.shape-snowflake-lg.simple,.shape-snowflake-md.simple,.shape-snowflake-sm.simple,.shape-snowflake-xs.simple{border-width:0px;min-height:60px;max-height:60px;background-color:unset;box-shadow:none}.shape-snowflake-xl.thin,.shape-snowflake-lg.thin,.shape-snowflake-md.thin,.shape-snowflake-sm.thin,.shape-snowflake-xs.thin{border-width:1px;min-height:58px;max-height:58px;background-color:unset}.shape-snowflake-xl.parentBorder,.shape-snowflake-lg.parentBorder,.shape-snowflake-md.parentBorder,.shape-snowflake-sm.parentBorder,.shape-snowflake-xs.parentBorder{border:0;box-shadow:unset;min-height:56px;max-height:56px}.shape-box-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-box-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-box-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-box-lg{min-height:52px;max-height:52px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-lg.simple{border-width:0px;min-height:56px;max-height:56px;background-color:unset;box-shadow:none}.shape-box-lg.thin{border-width:1px;min-height:54px;max-height:54px;background-color:unset}.shape-box-lg.parentBorder{border:0;box-shadow:unset;min-height:52px;max-height:52px}.shape-box-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-box-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-box-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-box-sm{min-height:32px;max-height:32px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-sm.simple{border-width:0px;min-height:36px;max-height:36px;background-color:unset;box-shadow:none}.shape-box-sm.thin{border-width:1px;min-height:34px;max-height:34px;background-color:unset}.shape-box-sm.parentBorder{border:0;box-shadow:unset;min-height:32px;max-height:32px}.shape-box-xs{min-height:20px;max-height:20px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-xs.simple{border-width:0px;min-height:24px;max-height:24px;background-color:unset;box-shadow:none}.shape-box-xs.thin{border-width:1px;min-height:22px;max-height:22px;background-color:unset}.shape-box-xs.parentBorder{border:0;box-shadow:unset;min-height:20px;max-height:20px}.shape-rounded-lg{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:6px}.shape-rounded-lg.simple{border-width:0px;min-height:56px;max-height:56px;background-color:unset;box-shadow:none}.shape-rounded-lg.thin{border-width:1px;min-height:54px;max-height:54px;background-color:unset}.shape-rounded-lg.parentBorder{border:0;box-shadow:unset;min-height:52px;max-height:52px}.shape-pill-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px}.shape-pill-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-left-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px 0 0 36px}.shape-pill-left-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-left-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-left-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-right-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:0 36px 36px 0}.shape-pill-right-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-right-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-right-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px}.shape-pill-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-pill-left-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px 0 0 36px}.shape-pill-left-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-left-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-left-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-pill-right-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:0 36px 36px 0}.shape-pill-right-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-right-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-right-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}`;
3140
+
3141
+ var colorCss$1 = css`:host(:not([layout*=classic])){--ds-auro-dropdown-trigger-border-color: transparent}:host(:not([ondark])) .wrapper{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-background-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host(:not([ondark])) .wrapper:focus-within,:host(:not([ondark])) .wrapper:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused, #01426a);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused, #01426a)}:host(:not([onDark])[disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-subtle, #dddddd)}:host(:not([ondark])[error]){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]) .label,:host([onDark]) .helpText{color:var(--ds-auro-dropdown-label-text-color)}:host([onDark]) .wrapper{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-background-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host([onDark]) .wrapper:focus-within,:host([onDark]) .wrapper:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused-inverse, #ffffff)}:host([onDark][disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse-disabled, rgba(255, 255, 255, 0.1))}:host([ondark][error]){--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8)}`;
3142
+
3143
+ var styleCss$1 = css`:host{position:relative;display:block}:host([open]){z-index:var(--depth-tooltip, 400)}.wrapper{display:flex;flex:1;flex-direction:row;align-items:center;justify-content:center;outline:none}.triggerContentWrapper{display:flex;overflow:hidden;width:100%;flex:1;align-items:center;justify-content:center;text-overflow:ellipsis;white-space:nowrap}:host([matchwidth]) #bibSizer{width:100%}`;
3144
+
3145
+ var classicColorCss = css``;
3146
+
3147
+ var classicLayoutCss = css`:host([layout*=classic]){position:relative;max-width:100%}:host([layout*=classic]) #bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}:host([layout*=classic]) label{transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}:host([layout*=classic]) .wrapper{display:flex;flex-direction:row;box-shadow:inset 0 0 0 1px var(--ds-auro-dropdown-trigger-outline-color)}@media(hover: hover){:host([layout*=classic]) .wrapper:hover{cursor:pointer}}:host([layout*=classic]) .triggerContentWrapper{overflow:hidden;flex:1;justify-content:start;text-overflow:ellipsis;white-space:nowrap}:host([layout*=classic]) #showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;padding-right:var(--ds-size-150, 0.75rem)}:host([layout*=classic]) #showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem)}:host([layout*=classic]) #showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}`;
3148
+
3149
+ var styleEmphasizedCss = css`.layout-emphasized .chevron,.layout-emphasized-left .chevron,.layout-emphasized-right .chevron{margin-right:var(--ds-size-300, 1.5rem)}:host([layout*=emphasized][shape*=pill]:not([layout*=right])) .leftIndent{width:calc(100% - var(--ds-size-300, 1.5rem));margin-left:var(--ds-size-300, 1.5rem)}:host([layout*=emphasized][shape*=pill]:not([layout*=left])) .rightIndent{width:calc(100% - var(--ds-size-300, 1.5rem));margin-right:var(--ds-size-300, 1.5rem)}:host([layout*=emphasized][shape*=pill]:not([layout*=left]):not([layout*=right])) .rightIndent{width:calc(100% - var(--ds-size-600, 3rem));margin-right:var(--ds-size-300, 1.5rem)}`;
3150
+
3151
+ var styleSnowflakeCss = css`:host([layout*=snowflake]) .leftIndent{width:calc(100% - var(--ds-size-600, 3rem));margin-left:var(--ds-size-300, 1.5rem)}:host([layout*=snowflake]) .rightIndent{width:calc(100% - var(--ds-size-600, 3rem));margin-right:var(--ds-size-300, 1.5rem)}:host([layout*=snowflake]) .trigger,:host([layout*=snowflake]) .helpText{text-align:center}.layout-snowflake .chevron,.layout-snowflake-left .chevron,.layout-snowflake-right .chevron{margin-right:var(--ds-size-300, 1.5rem)}`;
3152
+
3153
+ var colorCss = css`:host([error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]){--ds-auro-helptext-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][error]){--ds-auro-helptext-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
3154
+
3155
+ var styleCss = css`.body-default{font-size:var(--wcss-body-default-font-size, 1rem);line-height:var(--wcss-body-default-line-height, 1.5rem)}.body-default,.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)}.body-lg{font-size:var(--wcss-body-lg-font-size, 1.125rem);line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-sm{font-size:var(--wcss-body-sm-font-size, 0.875rem);line-height:var(--wcss-body-sm-line-height, 1.25rem)}.body-sm,.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)}.body-xs{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-size:var(--wcss-body-2xs-font-size, 0.625rem);font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);line-height:var(--wcss-body-2xs-line-height, 0.875rem)}.display-2xl{font-family:var(--wcss-display-2xl-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem));font-weight:var(--wcss-display-2xl-weight, 300);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);line-height:var(--wcss-display-2xl-line-height, 1.3)}.display-xl{font-family:var(--wcss-display-xl-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem));font-weight:var(--wcss-display-xl-weight, 300);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);line-height:var(--wcss-display-xl-line-height, 1.3)}.display-lg{font-family:var(--wcss-display-lg-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem));font-weight:var(--wcss-display-lg-weight, 300);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);line-height:var(--wcss-display-lg-line-height, 1.3)}.display-md{font-family:var(--wcss-display-md-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem));font-weight:var(--wcss-display-md-weight, 300);letter-spacing:var(--wcss-display-md-letter-spacing, 0);line-height:var(--wcss-display-md-line-height, 1.3)}.display-sm{font-family:var(--wcss-display-sm-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem));font-weight:var(--wcss-display-sm-weight, 300);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);line-height:var(--wcss-display-sm-line-height, 1.3)}.display-xs{font-family:var(--wcss-display-xs-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem));font-weight:var(--wcss-display-xs-weight, 300);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);line-height:var(--wcss-display-xs-line-height, 1.3)}.heading-xl{font-family:var(--wcss-heading-xl-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem));font-weight:var(--wcss-heading-xl-weight, 300);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);line-height:var(--wcss-heading-xl-line-height, 1.3)}.heading-lg{font-family:var(--wcss-heading-lg-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem));font-weight:var(--wcss-heading-lg-weight, 300);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);line-height:var(--wcss-heading-lg-line-height, 1.3)}.heading-md{font-family:var(--wcss-heading-md-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem));font-weight:var(--wcss-heading-md-weight, 300);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);line-height:var(--wcss-heading-md-line-height, 1.3)}.heading-sm{font-family:var(--wcss-heading-sm-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem));font-weight:var(--wcss-heading-sm-weight, 300);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);line-height:var(--wcss-heading-sm-line-height, 1.3)}.heading-xs{font-family:var(--wcss-heading-xs-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem));font-weight:var(--wcss-heading-xs-weight, 450);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);line-height:var(--wcss-heading-xs-line-height, 1.3)}.heading-2xs{font-family:var(--wcss-heading-2xs-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem));font-weight:var(--wcss-heading-2xs-weight, 450);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);line-height:var(--wcss-heading-2xs-line-height, 1.3)}.accent-2xl{font-family:var(--wcss-accent-2xl-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));font-weight:var(--wcss-accent-2xl-weight, 450);letter-spacing:var(--wcss-accent-2xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-2xl-line-height, 1)}.accent-2xl,.accent-xl{text-transform:uppercase}.accent-xl{font-family:var(--wcss-accent-xl-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));font-weight:var(--wcss-accent-xl-weight, 450);letter-spacing:var(--wcss-accent-xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-xl-line-height, 1.3)}.accent-lg{font-family:var(--wcss-accent-lg-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));font-weight:var(--wcss-accent-lg-weight, 450);letter-spacing:var(--wcss-accent-lg-letter-spacing, 0.05em);line-height:var(--wcss-accent-lg-line-height, 1.3)}.accent-lg,.accent-md{text-transform:uppercase}.accent-md{font-family:var(--wcss-accent-md-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));font-weight:var(--wcss-accent-md-weight, 500);letter-spacing:var(--wcss-accent-md-letter-spacing, 0.05em);line-height:var(--wcss-accent-md-line-height, 1.3)}.accent-sm{font-family:var(--wcss-accent-sm-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));font-weight:var(--wcss-accent-sm-weight, 500);letter-spacing:var(--wcss-accent-sm-letter-spacing, 0.05em);line-height:var(--wcss-accent-sm-line-height, 1.3)}.accent-sm,.accent-xs{text-transform:uppercase}.accent-xs{font-family:var(--wcss-accent-xs-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));font-weight:var(--wcss-accent-xs-weight, 500);letter-spacing:var(--wcss-accent-xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-xs-line-height, 1.3)}.accent-2xs{font-family:var(--wcss-accent-2xs-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xs-font-size, clamp(0.875rem, 1.1666666667vw, 0.875rem));font-weight:var(--wcss-accent-2xs-weight, 450);letter-spacing:var(--wcss-accent-2xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-2xs-line-height, 1.3);text-transform:uppercase}:host{position:relative;display:block}.helptext-wrapper{display:none}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
3156
+
3157
+ var tokensCss = css`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
3158
+
3159
+ // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
3160
+ // See LICENSE in the project root for license information.
3161
+
3162
+ // ---------------------------------------------------------------------
3163
+
3164
+ /* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
3165
+
3166
+ class AuroLibraryRuntimeUtils {
3167
+
3168
+ /* eslint-disable jsdoc/require-param */
3169
+
3170
+ /**
3171
+ * This will register a new custom element with the browser.
3172
+ * @param {String} name - The name of the custom element.
3173
+ * @param {Object} componentClass - The class to register as a custom element.
3174
+ * @returns {void}
3175
+ */
3176
+ registerComponent(name, componentClass) {
3177
+ if (!customElements.get(name)) {
3178
+ customElements.define(name, class extends componentClass {});
3179
+ }
3180
+ }
3181
+
3182
+ /**
3183
+ * Finds and returns the closest HTML Element based on a selector.
3184
+ * @returns {void}
3185
+ */
3186
+ closestElement(
3187
+ selector, // selector like in .closest()
3188
+ base = this, // extra functionality to skip a parent
3189
+ __Closest = (el, found = el && el.closest(selector)) =>
3190
+ !el || el === document || el === window
3191
+ ? null // standard .closest() returns null for non-found selectors also
3192
+ : found
3193
+ ? found // found a selector INside this element
3194
+ : __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
3195
+ ) {
3196
+ return __Closest(base);
3197
+ }
3198
+ /* eslint-enable jsdoc/require-param */
3199
+
3200
+ /**
3201
+ * 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.
3202
+ * @param {Object} elem - The element to check.
3203
+ * @param {String} tagName - The name of the Auro component to check for or add as an attribute.
3204
+ * @returns {void}
3205
+ */
3206
+ handleComponentTagRename(elem, tagName) {
3207
+ const tag = tagName.toLowerCase();
3208
+ const elemTag = elem.tagName.toLowerCase();
3209
+
3210
+ if (elemTag !== tag) {
3211
+ elem.setAttribute(tag, true);
3212
+ }
3213
+ }
3214
+
3215
+ /**
3216
+ * Validates if an element is a specific Auro component.
3217
+ * @param {Object} elem - The element to validate.
3218
+ * @param {String} tagName - The name of the Auro component to check against.
3219
+ * @returns {Boolean} - Returns true if the element is the specified Auro component.
3220
+ */
3221
+ elementMatch(elem, tagName) {
3222
+ const tag = tagName.toLowerCase();
3223
+ const elemTag = elem.tagName.toLowerCase();
3224
+
3225
+ return elemTag === tag || elem.hasAttribute(tag);
3226
+ }
3227
+ }
3228
+
3229
+ // Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
3230
+ // See LICENSE in the project root for license information.
3231
+
3232
+
3233
+ /**
3234
+ * Displays help text or error messages within form elements - Internal Use Only.
3235
+ */
3236
+ class AuroHelpText extends LitElement {
3237
+
3238
+ constructor() {
3239
+ super();
3240
+
3241
+ this.error = false;
3242
+ this.onDark = false;
3243
+ this.hasTextContent = false;
3244
+
3245
+ AuroLibraryRuntimeUtils.prototype.handleComponentTagRename(this, 'auro-helptext');
3246
+ }
3247
+
3248
+ static get styles() {
3249
+ return [
3250
+ colorCss,
3251
+ styleCss,
3252
+ tokensCss
3253
+ ];
3254
+ }
3255
+
3256
+ // function to define props used within the scope of this component
3257
+ static get properties() {
3258
+ return {
3259
+
3260
+ /**
3261
+ * @private
3262
+ */
3263
+ slotNodes: {
3264
+ type: Boolean,
3265
+ },
3266
+
3267
+ /**
3268
+ * @private
3269
+ */
3270
+ hasTextContent: {
3271
+ type: Boolean,
3272
+ },
3273
+
3274
+ /**
3275
+ * If declared, make font color red.
3276
+ */
3277
+ error: {
3278
+ type: Boolean,
3279
+ reflect: true,
3280
+ },
3281
+
3282
+ /**
3283
+ * If declared, will apply onDark styles.
3284
+ */
3285
+ onDark: {
3286
+ type: Boolean,
3287
+ reflect: true
3288
+ }
3289
+ };
3290
+ }
3291
+
3292
+ /**
3293
+ * This will register this element with the browser.
3294
+ * @param {string} [name="auro-helptext"] - The name of element that you want to register to.
3295
+ *
3296
+ * @example
3297
+ * AuroCheckbox.register("custom-helptext") // this will register this element to <custom-helptext/>
3298
+ *
3299
+ */
3300
+ static register(name = "auro-helptext") {
3301
+ AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroHelpText);
3302
+ }
3303
+
3304
+ updated() {
3305
+ this.handleSlotChange();
3306
+ }
3307
+
3308
+ handleSlotChange(event) {
3309
+ if (event) {
3310
+ this.slotNodes = event.target.assignedNodes();
3311
+ }
3312
+
3313
+ this.hasTextContent = this.checkSlotsForContent(this.slotNodes);
3314
+ }
3315
+
3316
+ /**
3317
+ * Checks if any of the provided nodes or their nested slot nodes contain non-empty text content.
3318
+ *
3319
+ * @param {NodeList|Array} nodes - The list of nodes to check for content.
3320
+ * @returns {boolean} - Returns true if any node or nested slot node contains non-empty text content, otherwise false.
3321
+ * @private
3322
+ */
3323
+ checkSlotsForContent(nodes) {
3324
+ if (!nodes) {
3325
+ return false;
3326
+ }
3327
+
3328
+ return nodes.some((node) => {
3329
+ if (node.textContent.trim()) {
3330
+ return true;
3331
+ }
3332
+
3333
+ if (!node.querySelector) {
3334
+ return false;
3335
+ }
3336
+
3337
+ const nestedSlot = node.tagName === 'SLOT' ? node : node.querySelector('slot');
3338
+ if (!nestedSlot) {
3339
+ return false;
3340
+ }
3341
+
3342
+ const nestedSlotNodes = nestedSlot.assignedNodes();
3343
+ return this.checkSlotsForContent(nestedSlotNodes);
3344
+ });
3345
+ }
3346
+
3347
+ // function that renders the HTML and CSS into the scope of the component
3348
+ render() {
3349
+ return html`
3350
+ <div class="helptext-wrapper body-xs" ?visible="${this.hasTextContent}">
3351
+ <slot @slotchange=${this.handleSlotChange}></slot>
3352
+ </div>
3353
+ `;
3354
+ }
3355
+ }
3356
+
3357
+ var helpTextVersion = '1.0.0';
3358
+
3359
+ class AuroElement extends LitElement {
3360
+ static get properties() {
3361
+ return {
3362
+
3363
+ /**
3364
+ * Defines the language of an element.
3365
+ * @default {'default'}
3366
+ */
3367
+ layout: {
3368
+ type: String,
3369
+ attribute: "layout",
3370
+ reflect: true
3371
+ },
3372
+
3373
+ shape: {
3374
+ type: String,
3375
+ attribute: "shape",
3376
+ reflect: true
3377
+ },
3378
+
3379
+ size: {
3380
+ type: String,
3381
+ attribute: "size",
3382
+ reflect: true
3383
+ },
3384
+
3385
+ onDark: {
3386
+ type: Boolean,
3387
+ attribute: "ondark",
3388
+ reflect: true
3389
+ }
3390
+ };
3391
+ }
3392
+
3393
+ resetShapeClasses() {
3394
+ const wrapper = this.shadowRoot.querySelector('.wrapper');
3395
+
3396
+ if (wrapper) {
3397
+ wrapper.classList.forEach((className) => {
3398
+ if (className.startsWith('shape-')) {
3399
+ wrapper.classList.remove(className);
3400
+ }
3401
+ });
3402
+
3403
+ if (this.shape && this.size) {
3404
+ wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
3405
+ } else {
3406
+ wrapper.classList.add('shape-none');
3407
+ }
3408
+ }
3409
+
3410
+ }
3411
+
3412
+ resetLayoutClasses() {
3413
+ if (this.layout) {
3414
+ const wrapper = this.shadowRoot.querySelector('.wrapper');
3415
+
3416
+ if (wrapper) {
3417
+ wrapper.classList.forEach((className) => {
3418
+ if (className.startsWith('layout-')) {
3419
+ wrapper.classList.remove(className);
3420
+ }
3421
+ });
3422
+
3423
+ wrapper.classList.add(`layout-${this.layout.toLowerCase()}`);
3424
+ }
3425
+ }
3426
+ }
3427
+
3428
+ updateComponentArchitecture() {
3429
+ this.resetLayoutClasses();
3430
+ this.resetShapeClasses();
3431
+ }
3432
+
3433
+ updated(changedProperties) {
3434
+ if (changedProperties.has('layout') || changedProperties.has('shape') || changedProperties.has('size')) {
3435
+ this.updateComponentArchitecture();
3436
+ }
3437
+ }
3438
+
3439
+ // Try to render the defined `this.layout` layout. If that fails, fall back to the default layout.
3440
+ // This will catch if an invalid layout value is passed in and render the default layout if so.
3441
+ render() {
3442
+ try {
3443
+ return this.renderLayout();
3444
+ } catch (error) {
3445
+ // failed to get the defined layout
3446
+ console.error('Failed to get the defined layout - using the default layout', error); // eslint-disable-line no-console
3447
+
3448
+ // fallback to the default layout
3449
+ return this.getLayout('default');
3450
+ }
3451
+ }
3452
+ }
3453
+
3454
+ // Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
3455
+ // See LICENSE in the project root for license information.
3456
+
3457
+
3458
+
3459
+ /*
3460
+ * @slot - Default slot for the popover content.
3461
+ * @slot helpText - Defines the content of the helpText.
3462
+ * @slot trigger - Defines the content of the trigger.
3463
+ * @csspart trigger - The trigger content container.
3464
+ * @csspart chevron - The collapsed/expanded state icon container.
3465
+ * @csspart size - The size of the dropdown bib. (height, width, maxHeight, maxWidth only)
3466
+ * @csspart helpText - The helpText content container.
3467
+ * @event auroDropdown-triggerClick - Notifies that the trigger has been clicked.
3468
+ * @event auroDropdown-toggled - Notifies that the visibility of the dropdown bib has changed.
3469
+ * @event auroDropdown-idAdded - Notifies consumers that the unique ID for the dropdown bib has been generated.
3470
+ */
3471
+ class AuroDropdown extends AuroElement {
3472
+ constructor() {
3473
+ super();
3474
+
3475
+ this.isPopoverVisible = false;
3476
+ this.isBibFullscreen = false;
3477
+ this.matchWidth = false;
3478
+ this.noHideOnThisFocusLoss = false;
3479
+
3480
+ this.errorMessage = undefined; // TODO - check with Doug if there is still more to do here
3481
+
3482
+ // Layout Config
3483
+ this.layout = undefined;
3484
+ this.shape = undefined;
3485
+ this.size = undefined;
3486
+
3487
+ this.parentBorder = false;
3488
+
3489
+ /** @private */
3490
+ this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
3491
+
3492
+ this.privateDefaults();
3493
+ }
3494
+
3495
+ /**
3496
+ * @private
3497
+ * @returns {object} Class definition for the wrapper element.
3498
+ */
3499
+ get commonWrapperClasses() {
3500
+ return {
3501
+ 'trigger': true,
3502
+ 'wrapper': true,
3503
+ 'hasFocus': this.hasFocus,
3504
+ 'simple': this.simple,
3505
+ 'parentBorder': this.parentBorder
3506
+ };
3507
+ }
3508
+
3509
+ /**
3510
+ * @private
3511
+ * @returns {void} Internal defaults.
3512
+ */
3513
+ privateDefaults() {
3514
+ this.chevron = false;
3515
+ this.disabled = false;
3516
+ this.disableFocusTrap = false;
3517
+ this.error = false;
3518
+ this.tabIndex = 0;
3519
+ this.noToggle = false;
3520
+ this.a11yRole = 'button';
3521
+ this.onDark = false;
3522
+ this.showTriggerBorders = true;
3523
+ this.triggerContentFocusable = false;
3524
+ this.simple = false;
3525
+
3526
+ // floaterConfig
3527
+ this.placement = 'bottom-start';
3528
+ this.offset = 0;
3529
+ this.noFlip = false;
3530
+ this.autoPlacement = false;
3531
+
3532
+ /**
3533
+ * @private
3534
+ * @property {boolean} delegatesFocus - Whether the shadow root delegates focus.
3535
+ */
3536
+ this.constructor.shadowRootOptions = {
3537
+ ...LitElement.shadowRootOptions,
3538
+ delegatesFocus: true,
3539
+ };
3540
+
3541
+ /**
3542
+ * @private
3543
+ */
3544
+ this.hasTriggerContent = false;
3545
+
3546
+ /**
3547
+ * @private
3548
+ */
3549
+ this.triggerContentSlot = undefined;
3550
+
3551
+ /**
3552
+ * @private
3553
+ */
3554
+ this.runtimeUtils = new AuroLibraryRuntimeUtils$2();
3555
+
3556
+ /**
3557
+ * @private
3558
+ */
3559
+ this.floater = new AuroFloatingUI();
3560
+
3561
+ /**
3562
+ * Generate unique names for dependency components.
3563
+ */
3564
+ const versioning = new AuroDependencyVersioning();
3565
+
3566
+ /**
3567
+ * @private
3568
+ */
3569
+ this.iconTag = versioning.generateTag('auro-formkit-dropdown-icon', iconVersion, AuroIcon);
3570
+
3571
+ /**
3572
+ * @private
3573
+ */
3574
+ this.dropdownBibTag = versioning.generateTag('auro-formkit-dropdown-dropdownbib', dropdownVersion, AuroDropdownBib);
3575
+
3576
+ /**
3577
+ * @private
3578
+ */
3579
+ this.helpTextTag = versioning.generateTag('auro-formkit-dropdown-helptext', helpTextVersion, AuroHelpText);
3580
+
3581
+ /**
3582
+ * @private
3583
+ */
3584
+ this.bindFocusEventToTrigger = this.bindFocusEventToTrigger.bind(this);
3585
+ }
3586
+
3587
+ /**
3588
+ * @ignore
3589
+ */
3590
+ get floaterConfig() {
3591
+ return {
3592
+ placement: this.placement,
3593
+ flip: !this.noFlip,
3594
+ autoPlacement: this.autoPlacement,
3595
+ offset: this.offset,
3596
+ };
3597
+ }
3598
+
3599
+ /**
3600
+ * Public method to hide the dropdown.
3601
+ * @returns {void}
3602
+ */
3603
+ hide() {
3604
+ this.floater.hideBib();
3605
+ }
3606
+
3607
+ /**
3608
+ * Public method to show the dropdown.
3609
+ * @returns {void}
3610
+ */
3611
+ show() {
3612
+ this.floater.showBib();
3613
+ }
3614
+
3615
+ /**
3616
+ * When bib is open, focus on the first element inside of bib.
3617
+ * If not, trigger element will get focus.
3618
+ */
3619
+ focus() {
3620
+ if (this.isPopoverVisible && this.focusTrap) {
3621
+ this.focusTrap.focusFirstElement();
3622
+ } else {
3623
+ this.trigger.focus();
3624
+ }
3625
+ }
3626
+
3627
+ // function to define props used within the scope of this component
3628
+ static get properties() {
3629
+ return {
3630
+
3631
+ /**
3632
+ * If declared, bib's position will be automatically calculated where to appear.
3633
+ * @default false
3634
+ */
3635
+ autoPlacement: {
3636
+ type: Boolean,
3637
+ reflect: true
3638
+ },
3639
+
3640
+ /**
3641
+ * If declared, the dropdown will only show by calling the API .show() public method.
3642
+ * @default false
3643
+ */
3644
+ disableEventShow: {
3645
+ type: Boolean,
3646
+ reflect: true
3647
+ },
3648
+
3649
+ /**
3650
+ * If declared, applies a border around the trigger slot.
3651
+ */
3652
+ simple: {
3653
+ type: Boolean,
3654
+ reflect: true
3655
+ },
3656
+
3657
+ /**
3658
+ * If declared, the dropdown displays a chevron on the right.
3659
+ * @attr {Boolean} chevron
3660
+ */
3661
+ chevron: {
3662
+ type: Boolean,
3663
+ reflect: true
3664
+ },
3665
+
3666
+ /**
3667
+ * If declared, the dropdown is not interactive.
3668
+ */
3669
+ disabled: {
3670
+ type: Boolean,
3671
+ reflect: true
3672
+ },
3673
+
3674
+ /**
3675
+ * If declared, the focus trap inside of bib will be turned off.
3676
+ */
3677
+ disableFocusTrap: {
3678
+ type: Boolean,
3679
+ reflect: true
3680
+ },
3681
+
3682
+ /**
3683
+ * @private
3684
+ */
3685
+ dropdownWidth: {
3686
+ type: Number
3687
+ },
3688
+
3689
+ /**
3690
+ * The unique ID for the dropdown bib element.
3691
+ * @private
3692
+ */
3693
+ dropdownId: {
3694
+ type: String,
3695
+ reflect: false,
3696
+ attribute: false
3697
+ },
3698
+
3699
+ /**
3700
+ * If declared in combination with not using the `simple` property or `helpText` slot content, will apply red color to both.
3701
+ */
3702
+ error: {
3703
+ type: Boolean,
3704
+ reflect: true
3705
+ },
3706
+
3707
+ /**
3708
+ * Contains the help text message for the current validity error.
3709
+ */
3710
+ errorMessage: {
3711
+ type: String
3712
+ },
3713
+
3714
+ /**
3715
+ * If declared, the bib will display when focus is applied to the trigger.
3716
+ */
3717
+ focusShow: {
3718
+ type: Boolean,
3719
+ reflect: true
3720
+ },
3721
+
3722
+ /**
3723
+ * If true, the dropdown bib is displayed.
3724
+ */
3725
+ isPopoverVisible: {
3726
+ type: Boolean,
3727
+ reflect: true,
3728
+ attribute: 'open'
3729
+ },
3730
+
3731
+ /**
3732
+ * If true, the dropdown bib is taking the fullscreen when it's open.
3733
+ */
3734
+ isBibFullscreen: {
3735
+ type: Boolean,
3736
+ reflect: true
3737
+ },
3738
+
3739
+ /**
3740
+ * If declared, the trigger will toggle the dropdown on mouseover/mouseout.
3741
+ */
3742
+ hoverToggle: {
3743
+ type: Boolean,
3744
+ reflect: true
3745
+ },
3746
+
3747
+ /**
3748
+ * @private
3749
+ */
3750
+ hasTriggerContent: {
3751
+ type: Boolean
3752
+ },
3753
+
3754
+ /**
3755
+ * Defines the screen size breakpoint (`xs`, `sm`, `md`, `lg`, `xl`, `disabled`)
3756
+ * at which the dropdown switches to fullscreen mode on mobile. `disabled` indicates a dropdown should _never_ enter fullscreen.
3757
+ *
3758
+ * When expanded, the dropdown will automatically display in fullscreen mode
3759
+ * if the screen size is equal to or smaller than the selected breakpoint.
3760
+ * @default sm
3761
+ */
3762
+ fullscreenBreakpoint: {
3763
+ type: String,
3764
+ reflect: true
3765
+ },
3766
+
3767
+ /**
3768
+ * Defines if the trigger should size based on the parent element providing the border UI.
3769
+ * @private
3770
+ */
3771
+ parentBorder: {
3772
+ type: Boolean,
3773
+ reflect: true
3774
+ },
3775
+
3776
+ /**
3777
+ * If declared, the popover and trigger will be set to the same width.
3778
+ */
3779
+ matchWidth: {
3780
+ type: Boolean,
3781
+ reflect: true
3782
+ },
3783
+
3784
+ /**
3785
+ * If declared, the bib will NOT flip to an alternate position
3786
+ * when there isn't enough space in the specified `placement`.
3787
+ * @default false
3788
+ */
3789
+ noFlip: {
3790
+ type: Boolean,
3791
+ reflect: true
3792
+ },
3793
+
3794
+ /**
3795
+ * If declared, the dropdown will not hide when moving focus outside the element.
3796
+ */
3797
+ noHideOnThisFocusLoss: {
3798
+ type: Boolean,
3799
+ reflect: true
3800
+ },
3801
+
3802
+ /**
3803
+ * If declared, the trigger will only show the dropdown bib.
3804
+ */
3805
+ noToggle: {
3806
+ type: Boolean,
3807
+ reflect: true
3808
+ },
3809
+
3810
+ /**
3811
+ * Gap between the trigger element and bib.
3812
+ * @default 0
3813
+ */
3814
+ offset: {
3815
+ type: Number,
3816
+ reflect: true
3817
+ },
3818
+
3819
+ /**
3820
+ * If declared, onDark styles will be applied.
3821
+ */
3822
+ onDark: {
3823
+ type: Boolean,
3824
+ reflect: true
3825
+ },
3826
+
3827
+ /**
3828
+ * If declared, and a function is set, that function will execute when the slot content is updated.
3829
+ */
3830
+ onSlotChange: {
3831
+ type: Function,
3832
+ reflect: false
3833
+ },
3834
+
3835
+ /**
3836
+ * Position where the bib should appear relative to the trigger.
3837
+ * @default bottom-start
3838
+ */
3839
+ placement: {
3840
+ type: String,
3841
+ reflect: true
3842
+ },
3843
+
3844
+ /**
3845
+ * @private
3846
+ */
3847
+ tabIndex: {
3848
+ type: Number
3849
+ },
3850
+
3851
+ /**
3852
+ * The value for the role attribute of the trigger element.
3853
+ */
3854
+ a11yRole: {
3855
+ type: String || undefined,
3856
+ attribute: false,
3857
+ reflect: false
3858
+ }
3859
+ };
3860
+ }
3861
+
3862
+ static get styles() {
3863
+ return [
3864
+ styleCss$1,
3865
+ tokensCss$1,
3866
+ colorCss$1,
3867
+
3868
+ // default layout
3869
+ classicColorCss,
3870
+ classicLayoutCss,
3871
+
3872
+ // emphasized layout
3873
+ styleEmphasizedCss,
3874
+
3875
+ // snowflake layout
3876
+ styleSnowflakeCss,
3877
+
3878
+ shapeSizeCss
3879
+ ];
3880
+ }
3881
+
3882
+ /**
3883
+ * This will register this element with the browser.
3884
+ * @param {string} [name="auro-dropdown"] - The name of element that you want to register to.
3885
+ *
3886
+ * @example
3887
+ * AuroDropdown.register("custom-dropdown") // this will register this element to <custom-dropdown/>
3888
+ *
3889
+ */
3890
+ static register(name = "auro-dropdown") {
3891
+ AuroLibraryRuntimeUtils$2.prototype.registerComponent(name, AuroDropdown);
3892
+ }
3893
+
3894
+ /**
3895
+ * Accessor for reusing the focusable entity query string.
3896
+ * @private
3897
+ * @returns {string}
3898
+ */
3899
+ get focusableEntityQuery () {
3900
+ return 'auro-input, [auro-input], auro-button, [auro-button], button, input';
3901
+ }
3902
+
3903
+ connectedCallback() {
3904
+ super.connectedCallback();
3905
+ }
3906
+
3907
+ disconnectedCallback() {
3908
+ super.disconnectedCallback();
3909
+ this.floater.disconnect();
3910
+ this.clearTriggerFocusEventBinding();
3911
+ }
3912
+
3913
+ updated(changedProperties) {
3914
+ super.updated(changedProperties);
3915
+ this.floater.handleUpdate(changedProperties);
3916
+
3917
+ // Note: `disabled` is not a breakpoint (it is not a screen size),
3918
+ // so it looks like we never consume this - however, dropdownBib handles this in the setter as "undefined"
3919
+ if (changedProperties.has('fullscreenBreakpoint')) {
3920
+ this.bibContent.mobileFullscreenBreakpoint = this.fullscreenBreakpoint;
3921
+ }
3922
+
3923
+ // when trigger's content is changed without any attribute or node change,
3924
+ // `requestUpdate` needs to be called to update hasTriggerContent
3925
+ if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
3926
+ this.handleTriggerContentSlotChange();
3927
+ }
3928
+ }
3929
+
3930
+ /**
3931
+ * Handles the custom event `auroDropdown-toggled` to update the visibility of the dropdown bib.
3932
+ * @private
3933
+ * @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
3934
+ */
3935
+ handleDropdownToggle(event) {
3936
+ this.updateFocusTrap();
3937
+ this.isPopoverVisible = event.detail.expanded;
3938
+ const eventType = event.detail.eventType || "unknown";
3939
+ if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
3940
+ this.trigger.focus();
3941
+ }
3942
+ }
3943
+
3944
+ firstUpdated() {
3945
+
3946
+ // Configure the floater to, this will generate the ID for the bib
3947
+ this.floater.configure(this, 'auroDropdown');
3948
+ this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
3949
+
3950
+ /**
3951
+ * @description Let subscribers know that the dropdown ID ha been generated and added.
3952
+ * @event auroDropdown-idAdded
3953
+ * @type {Object<key: 'id', value: string>} - The ID of the dropdown bib element.
3954
+ */
3955
+ this.dispatchEvent(new CustomEvent('auroDropdown-idAdded', {detail: {id: this.floater.element.id}}));
3956
+
3957
+ // Set the bib ID locally if the user hasn't provided a focusable trigger
3958
+ if (!this.triggerContentFocusable) {
3959
+ this.dropdownId = this.floater.element.id;
3960
+ }
3961
+
3962
+ this.bibContent = this.floater.element.bib;
3963
+
3964
+ // Add the tag name as an attribute if it is different than the component name
3965
+ this.runtimeUtils.handleComponentTagRename(this, 'auro-dropdown');
3966
+
3967
+ this.trigger.addEventListener('click', () => {
3968
+ this.dispatchEvent(new CustomEvent('auroDropdown-triggerClick', {
3969
+ bubbles: true,
3970
+ composed: true
3971
+ }));
3972
+ });
3973
+ }
3974
+
3975
+ /**
3976
+ * Exposes CSS parts for styling from parent components.
3977
+ * @returns {void}
3978
+ */
3979
+ exposeCssParts() {
3980
+ this.setAttribute('exportparts', 'trigger:dropdownTrigger, chevron:dropdownChevron, helpText:dropdownHelpText, size:dropdownSize');
3981
+ }
3982
+
3983
+ /**
3984
+ * Determines if content is within a custom slot.
3985
+ * @private
3986
+ * @param {HTMLElement} element - The element to check.
3987
+ * @returns {Boolean}
3988
+ */
3989
+ isCustomSlotContent(element) {
3990
+ let currentElement = element;
3991
+
3992
+ let inCustomSlot = false;
3993
+
3994
+ while (currentElement) {
3995
+ currentElement = currentElement.parentElement;
3996
+
3997
+ if (currentElement && currentElement.hasAttribute('slot')) {
3998
+ inCustomSlot = true;
3999
+ break;
4000
+ }
4001
+ }
4002
+
4003
+ return inCustomSlot;
4004
+ }
4005
+
4006
+ /**
4007
+ * Function to support @focusin event.
4008
+ * @private
4009
+ * @return {void}
4010
+ */
4011
+ handleFocusin() {
4012
+ this.hasFocus = true;
4013
+ }
4014
+
4015
+ /**
4016
+ * @private
4017
+ */
4018
+ updateFocusTrap() {
4019
+ // If the dropdown is open, create a focus trap and focus the first element
4020
+ if (this.isPopoverVisible && !this.disableFocusTrap) {
4021
+ this.focusTrap = new FocusTrap(this.bibContent);
4022
+ this.focusTrap.focusFirstElement();
4023
+ return;
4024
+ }
4025
+
4026
+ // Guard Clause: Ensure there is a focus trap currently active before continuing
4027
+ if (!this.focusTrap) {
4028
+ return;
4029
+ }
4030
+
4031
+ // If the dropdown is not open, disconnect the focus trap if it exists
4032
+ this.focusTrap.disconnect();
4033
+ this.focusTrap = undefined;
4034
+ }
4035
+
4036
+ /**
4037
+ * Function to support @focusout event.
4038
+ * @private
4039
+ * @return {void}
4040
+ */
4041
+ handleFocusout() {
4042
+ this.hasFocus = false;
4043
+ }
4044
+
4045
+ /**
4046
+ * Creates and dispatches a duplicate focus event on the trigger element.
4047
+ * @private
4048
+ * @param {Event} event - The original focus event.
4049
+ */
4050
+ bindFocusEventToTrigger(event) {
4051
+ const dupEvent = new FocusEvent(event.type, {
4052
+ bubbles: false,
4053
+ cancelable: false,
4054
+ composed: true,
4055
+ });
4056
+ this.trigger.dispatchEvent(dupEvent);
4057
+ }
4058
+
4059
+ /**
4060
+ * Sets up event listeners to deliver focus and blur events from nested Auro components within the trigger slot to trigger.
4061
+ * This ensures that focus/blur events originating from within these components are propagated to the trigger element itself.
4062
+ * @private
4063
+ */
4064
+ setupTriggerFocusEventBinding() {
4065
+ if (!this.triggerContentSlot || this.triggerContentSlot.length === 0) {
4066
+ return;
4067
+ }
4068
+
4069
+ this.triggerContentSlot.forEach((node) => {
4070
+ if (node.querySelectorAll) {
4071
+ const auroElements = node.querySelectorAll(this.focusableEntityQuery);
4072
+ auroElements.forEach((auroEl) => {
4073
+ auroEl.addEventListener('focus', this.bindFocusEventToTrigger);
4074
+ auroEl.addEventListener('blur', this.bindFocusEventToTrigger);
4075
+ });
4076
+ }
4077
+ });
4078
+ }
4079
+
4080
+ /**
4081
+ * Clears focus and blur event listeners from nested Auro components within the trigger slot.
4082
+ * @private
4083
+ * @returns {void}
4084
+ */
4085
+ clearTriggerFocusEventBinding() {
4086
+ if (!this.triggerContentSlot || this.triggerContentSlot.length === 0) {
4087
+ return;
4088
+ }
4089
+
4090
+ this.triggerContentSlot.forEach((node) => {
4091
+ if (node.querySelectorAll) {
4092
+ const auroElements = node.querySelectorAll(this.focusableEntityQuery);
4093
+ auroElements.forEach((auroEl) => {
4094
+ auroEl.removeEventListener('focus', this.bindFocusEventToTrigger);
4095
+ auroEl.removeEventListener('blur', this.bindFocusEventToTrigger);
4096
+ });
4097
+ }
4098
+ });
4099
+ }
4100
+
4101
+ /*
4102
+ * Sets aria attributes for the trigger element if a custom one is passed in.
4103
+ * @private
4104
+ * @method setTriggerAriaAttributes
4105
+ * @param { HTMLElement } triggerElement - The custom trigger element.
4106
+ */
4107
+ clearTriggerA11yAttributes(triggerElement) {
4108
+
4109
+ if (!triggerElement || !triggerElement.removeAttribute) {
4110
+ return;
4111
+ }
4112
+
4113
+ // Reset appropriate attributes for a11y
4114
+ triggerElement.removeAttribute('aria-labelledby');
4115
+ if (triggerElement.getAttribute('id') === `${this.id}-trigger-element`) {
4116
+ triggerElement.removeAttribute('id');
4117
+ }
4118
+ triggerElement.removeAttribute('role');
4119
+ triggerElement.removeAttribute('aria-expanded');
4120
+
4121
+ triggerElement.removeAttribute('aria-controls');
4122
+ triggerElement.removeAttribute('aria-autocomplete');
4123
+ }
4124
+
4125
+ /**
4126
+ * Handles changes to the trigger content slot and updates related properties.
4127
+ *
4128
+ * It first updates the floater settings
4129
+ * Then, it retrieves the assigned nodes from the event target and checks if any of
4130
+ * the nodes contain non-empty text content, updating the `hasTriggerContent` property accordingly.
4131
+ *
4132
+ * @private
4133
+ * @method handleTriggerContentSlotChange
4134
+ * @param {Event} event - Native slotchange event.
4135
+ * @returns {void}
4136
+ */
4137
+ handleTriggerContentSlotChange(event) {
4138
+ this.floater.handleTriggerTabIndex();
4139
+
4140
+ // Get the trigger
4141
+ const trigger = this.shadowRoot.querySelector('#trigger');
4142
+
4143
+ // Get the trigger slot
4144
+ const triggerSlot = this.shadowRoot.querySelector('.triggerContentWrapper slot');
4145
+
4146
+ // If there's a trigger slot
4147
+ if (triggerSlot) {
4148
+
4149
+ // Get the content nodes to see if there are any children
4150
+ const triggerContentNodes = triggerSlot.assignedNodes();
4151
+
4152
+ // If there are children
4153
+ if (triggerContentNodes) {
4154
+
4155
+ // See if any of them are focusable elements
4156
+ this.triggerContentFocusable = triggerContentNodes.some((node) => getFocusableElements(node).length > 0);
4157
+
4158
+ // If any of them are focusable elements
4159
+ if (this.triggerContentFocusable) {
4160
+
4161
+ // Assume the consumer will be providing their own a11y in whatever they passed in
4162
+ this.clearTriggerA11yAttributes(trigger);
4163
+
4164
+ // Remove the tabindex from the trigger so it doesn't interrupt focus flow
4165
+ trigger.removeAttribute('tabindex');
4166
+ } else {
4167
+
4168
+ // Add the tabindex to the trigger so that it's in the focus flow
4169
+ trigger.setAttribute('tabindex', '0');
4170
+ }
4171
+ }
4172
+ }
4173
+
4174
+ if (event) {
4175
+ this.triggerNode = event.target;
4176
+ this.triggerContentSlot = event.target.assignedNodes();
4177
+ }
4178
+
4179
+ if (this.triggerContentSlot) {
4180
+ this.setupTriggerFocusEventBinding();
4181
+
4182
+ this.hasTriggerContent = this.triggerContentSlot.some((slot) => {
4183
+ if (slot.textContent.trim()) {
4184
+ return true;
4185
+ }
4186
+ const slotInSlot = slot.querySelector('slot');
4187
+ if (!slotInSlot) {
4188
+ return false;
4189
+ }
4190
+ const slotsInSlotNodes = slotInSlot.assignedNodes();
4191
+ return slotsInSlotNodes.some((ss) => Boolean(ss.textContent.trim()));
4192
+ });
4193
+ } else {
4194
+ this.hasTriggerContent = false;
4195
+ }
4196
+ }
4197
+
4198
+ /**
4199
+ * Handles the default slot change event and updates the content.
4200
+ *
4201
+ * This method retrieves all nodes assigned to the default slot of the event target and appends them
4202
+ * to the `bibContent` element. If a callback function `onSlotChange` is defined, it is invoked to
4203
+ * notify about the slot change.
4204
+ *
4205
+ * @private
4206
+ * @method handleDefaultSlot
4207
+ * @fires Function#onSlotChange - Optional callback invoked when the slot content changes.
4208
+ */
4209
+ handleDefaultSlot() {
4210
+
4211
+ if (this.onSlotChange) {
4212
+ this.onSlotChange();
4213
+ }
4214
+ }
4215
+
4216
+ /**
4217
+ * Returns HTML for the common portion of the layouts.
4218
+ * @private
4219
+ * @param {Object} helpTextClasses - Classes to apply to the help text container.
4220
+ * @returns {html} - Returns HTML.
4221
+ */
4222
+ renderBasicHtml(helpTextClasses) {
4223
+ return html$1`
4224
+ <div>
4225
+ <div
4226
+ id="trigger"
4227
+ class="${classMap(this.commonWrapperClasses)}" part="wrapper"
4228
+ tabindex="${ifDefined(this.triggerContentFocusable ? undefined : this.tabIndex)}"
4229
+ role="${ifDefined(this.triggerContentFocusable ? undefined : this.a11yRole)}"
4230
+ aria-expanded="${ifDefined(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
4231
+ aria-controls="${ifDefined(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.dropdownId)}"
4232
+ aria-labelledby="${ifDefined(this.triggerContentFocusable ? undefined : 'triggerLabel')}"
4233
+ @focusin="${this.handleFocusin}"
4234
+ @blur="${this.handleFocusOut}">
4235
+ <div class="triggerContentWrapper" id="triggerLabel">
4236
+ <slot
4237
+ name="trigger"
4238
+ @slotchange="${this.handleTriggerContentSlotChange}"></slot>
4239
+ </div>
4240
+ ${this.chevron ? html$1`
4241
+ <div
4242
+ id="showStateIcon"
4243
+ class="chevron"
4244
+ part="chevron">
4245
+ <${this.iconTag}
4246
+ category="interface"
4247
+ name="chevron-down"
4248
+ ?onDark="${this.onDark}"
4249
+ variant="${this.disabled ? 'disabled' : 'muted'}">
4250
+ >
4251
+ </${this.iconTag}>
4252
+ </div>
4253
+ ` : undefined }
4254
+ </div>
4255
+ <div class="${classMap(helpTextClasses)}">
4256
+ <slot name="helpText"></slot>
4257
+ </div>
4258
+ <div id="bibSizer" part="size"></div>
4259
+ <${this.dropdownBibTag}
4260
+ id="bib"
4261
+ shape="${this.shape}"
4262
+ ?data-show="${this.isPopoverVisible}"
4263
+ ?isfullscreen="${this.isBibFullscreen}">
4264
+ <div class="slotContent">
4265
+ <slot @slotchange="${this.handleDefaultSlot}"></slot>
4266
+ </div>
4267
+ </${this.dropdownBibTag}>
4268
+ </div>
4269
+ `;
4270
+ }
4271
+
4272
+ /**
4273
+ * Returns HTML for the classic layout. Does not support type="*".
4274
+ * @private
4275
+ * @returns {html} - Returns HTML for the classic layout.
4276
+ */
4277
+ renderLayoutClassic() {
4278
+ // TODO: check with Doug why this was never used?
4279
+ const helpTextClasses = {
4280
+ 'helpText': true
4281
+ };
4282
+
4283
+ return html$1`
4284
+ ${this.renderBasicHtml(helpTextClasses)}
4285
+ `;
4286
+ }
4287
+
4288
+ /**
4289
+ * Returns HTML for the snowflake layout. Does not support type="*".
4290
+ * @private
4291
+ * @returns {html} - Returns HTML for the snowflake layout.
4292
+ */
4293
+ renderLayoutSnowflake() {
4294
+ const helpTextClasses = {
4295
+ 'helpText': true,
4296
+ 'leftIndent': true,
4297
+ 'rightIndent': true
4298
+ };
4299
+
4300
+ return html$1`
4301
+ ${this.renderBasicHtml(helpTextClasses)}
4302
+ `;
4303
+ }
4304
+
4305
+ /**
4306
+ * Returns HTML for the emphasized layout. Does not support type="*".
4307
+ * @private
4308
+ * @returns {html} - Returns HTML for the emphasized layout.
4309
+ */
4310
+ renderLayoutEmphasized() {
4311
+ const helpTextClasses = {
4312
+ 'helpText': true,
4313
+ 'leftIndent': this.shape.toLowerCase().includes('pill') && !this.shape.toLowerCase().includes('right'),
4314
+ 'rightIndent': this.shape.toLowerCase().includes('pill') && !this.shape.toLowerCase().includes('left')
4315
+ };
4316
+
4317
+ return html$1`
4318
+ ${this.renderBasicHtml(helpTextClasses)}
4319
+ `;
4320
+ }
4321
+
4322
+ /**
4323
+ * Logic to determine the layout of the component.
4324
+ * @private
4325
+ * @param {string} [ForcedLayout] - Used to force a specific layout, pass in the layout name to use.
4326
+ * @returns {HTMLCollection} - Returns the HTML for the layout.
4327
+ */
4328
+ renderLayout(ForcedLayout) {
4329
+ const layout = ForcedLayout || this.layout;
4330
+
4331
+ switch (layout) {
4332
+ case 'emphasized':
4333
+ return this.renderLayoutEmphasized();
4334
+ case 'emphasized-left':
4335
+ return this.renderLayoutEmphasized();
4336
+ case 'emphasized-right':
4337
+ return this.renderLayoutEmphasized();
4338
+ case 'snowflake':
4339
+ return this.renderLayoutSnowflake();
4340
+ case 'snowflake-left':
4341
+ return this.renderLayoutSnowflake();
4342
+ case 'snowflake-right':
4343
+ return this.renderLayoutSnowflake();
4344
+ default:
4345
+ return this.renderLayoutClassic();
4346
+ }
4347
+ }
4348
+ }
4349
+
4350
+ export { AuroDropdown };