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