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