bromcom-ui-next 0.1.4 → 0.1.6

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 (395) hide show
  1. package/dist/bromcom-ui/bromcom-ui.css +1 -1
  2. package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
  3. package/dist/bromcom-ui/bromcom-ui.esm.js.map +1 -1
  4. package/dist/bromcom-ui/p-0d0d6483.entry.js +2 -0
  5. package/dist/bromcom-ui/{p-3b607038.entry.js.map → p-0d0d6483.entry.js.map} +1 -1
  6. package/dist/bromcom-ui/p-13784cd7.entry.js +2 -0
  7. package/dist/bromcom-ui/p-13784cd7.entry.js.map +1 -0
  8. package/dist/bromcom-ui/p-13a245f6.js +2 -0
  9. package/dist/bromcom-ui/p-13a245f6.js.map +1 -0
  10. package/dist/bromcom-ui/p-25038cc8.entry.js +2 -0
  11. package/dist/bromcom-ui/p-25038cc8.entry.js.map +1 -0
  12. package/dist/bromcom-ui/p-308f865b.entry.js +2 -0
  13. package/dist/bromcom-ui/p-308f865b.entry.js.map +1 -0
  14. package/dist/bromcom-ui/p-385fa0f3.entry.js +2 -0
  15. package/dist/bromcom-ui/p-385fa0f3.entry.js.map +1 -0
  16. package/dist/bromcom-ui/p-389f1976.entry.js +2 -0
  17. package/dist/bromcom-ui/p-389f1976.entry.js.map +1 -0
  18. package/dist/bromcom-ui/p-3b230145.entry.js +2 -0
  19. package/dist/bromcom-ui/p-3b230145.entry.js.map +1 -0
  20. package/dist/bromcom-ui/p-49b0e982.entry.js +2 -0
  21. package/dist/bromcom-ui/p-49b0e982.entry.js.map +1 -0
  22. package/dist/bromcom-ui/p-55c4263c.entry.js +2 -0
  23. package/dist/bromcom-ui/p-55c4263c.entry.js.map +1 -0
  24. package/dist/bromcom-ui/{p-ebed10d5.entry.js → p-58ee24a8.entry.js} +2 -2
  25. package/dist/bromcom-ui/{p-ebed10d5.entry.js.map → p-58ee24a8.entry.js.map} +1 -1
  26. package/dist/bromcom-ui/p-729a870f.js.map +1 -1
  27. package/dist/bromcom-ui/p-9551c35e.entry.js +2 -0
  28. package/dist/bromcom-ui/p-9551c35e.entry.js.map +1 -0
  29. package/dist/bromcom-ui/p-9594cebb.js +2 -0
  30. package/dist/bromcom-ui/p-9594cebb.js.map +1 -0
  31. package/dist/bromcom-ui/p-98c76392.entry.js +2 -0
  32. package/dist/bromcom-ui/p-98c76392.entry.js.map +1 -0
  33. package/dist/bromcom-ui/p-a29e61a4.entry.js +2 -0
  34. package/dist/bromcom-ui/{p-cd437280.entry.js.map → p-a29e61a4.entry.js.map} +1 -1
  35. package/dist/bromcom-ui/p-ba2410ef.js +2 -0
  36. package/dist/bromcom-ui/p-ba2410ef.js.map +1 -0
  37. package/dist/bromcom-ui/p-bd0f7e78.entry.js +2 -0
  38. package/dist/bromcom-ui/p-bd0f7e78.entry.js.map +1 -0
  39. package/dist/bromcom-ui/p-bf69fc8a.entry.js +2 -0
  40. package/dist/bromcom-ui/p-bf69fc8a.entry.js.map +1 -0
  41. package/dist/bromcom-ui/{p-5d0838e9.entry.js → p-c1161950.entry.js} +2 -2
  42. package/dist/bromcom-ui/{p-5d0838e9.entry.js.map → p-c1161950.entry.js.map} +1 -1
  43. package/dist/bromcom-ui/p-c2b3945e.entry.js +2 -0
  44. package/dist/bromcom-ui/p-c2b3945e.entry.js.map +1 -0
  45. package/dist/bromcom-ui/p-c427ffee.entry.js +2 -0
  46. package/dist/bromcom-ui/{p-dcea8d62.entry.js.map → p-c427ffee.entry.js.map} +1 -1
  47. package/dist/bromcom-ui/p-c444235a.entry.js +2 -0
  48. package/dist/bromcom-ui/p-c444235a.entry.js.map +1 -0
  49. package/dist/bromcom-ui/p-c995a48c.entry.js +2 -0
  50. package/dist/bromcom-ui/p-c995a48c.entry.js.map +1 -0
  51. package/dist/bromcom-ui/p-c9b736d9.js +3 -0
  52. package/dist/{cjs/index-4795c073.js.map → bromcom-ui/p-c9b736d9.js.map} +1 -1
  53. package/dist/bromcom-ui/p-cd271b49.entry.js +2 -0
  54. package/dist/bromcom-ui/p-cd271b49.entry.js.map +1 -0
  55. package/dist/bromcom-ui/p-cee68279.entry.js +2 -0
  56. package/dist/bromcom-ui/{p-1d86c1cf.entry.js.map → p-cee68279.entry.js.map} +1 -1
  57. package/dist/bromcom-ui/{p-a590f793.entry.js → p-d57587e5.entry.js} +2 -2
  58. package/dist/bromcom-ui/{p-a590f793.entry.js.map → p-d57587e5.entry.js.map} +1 -1
  59. package/dist/bromcom-ui/p-e89ab4a7.entry.js +2 -0
  60. package/dist/bromcom-ui/p-e89ab4a7.entry.js.map +1 -0
  61. package/dist/bromcom-ui/{p-1b11150b.entry.js → p-f2d8aa70.entry.js} +2 -2
  62. package/dist/bromcom-ui/{p-1b11150b.entry.js.map → p-f2d8aa70.entry.js.map} +1 -1
  63. package/dist/bromcom-ui/p-f4e8a47d.entry.js +2 -0
  64. package/dist/bromcom-ui/p-f4e8a47d.entry.js.map +1 -0
  65. package/dist/cjs/app-globals-29edfda4.js.map +1 -1
  66. package/dist/cjs/bcm-accordion-group.cjs.entry.js +2 -2
  67. package/dist/cjs/bcm-accordion-group.cjs.entry.js.map +1 -1
  68. package/dist/cjs/bcm-accordion.cjs.entry.js +2 -2
  69. package/dist/cjs/bcm-accordion.cjs.entry.js.map +1 -1
  70. package/dist/cjs/bcm-alert.cjs.entry.js +2 -2
  71. package/dist/cjs/bcm-alert.cjs.entry.js.map +1 -1
  72. package/dist/cjs/bcm-avatar_4.cjs.entry.js +13 -7
  73. package/dist/cjs/bcm-avatar_4.cjs.entry.js.map +1 -1
  74. package/dist/cjs/bcm-button-group.cjs.entry.js +97 -0
  75. package/dist/cjs/bcm-button-group.cjs.entry.js.map +1 -0
  76. package/dist/cjs/bcm-checkbox.cjs.entry.js +226 -0
  77. package/dist/cjs/bcm-checkbox.cjs.entry.js.map +1 -0
  78. package/dist/cjs/bcm-chip.cjs.entry.js +3 -3
  79. package/dist/cjs/bcm-chip.cjs.entry.js.map +1 -1
  80. package/dist/cjs/bcm-divider.cjs.entry.js +3 -3
  81. package/dist/cjs/bcm-divider.cjs.entry.js.map +1 -1
  82. package/dist/cjs/bcm-dropdown-item.cjs.entry.js +63 -0
  83. package/dist/cjs/bcm-dropdown-item.cjs.entry.js.map +1 -0
  84. package/dist/cjs/bcm-dropdown.cjs.entry.js +56 -0
  85. package/dist/cjs/bcm-dropdown.cjs.entry.js.map +1 -0
  86. package/dist/cjs/bcm-input.cjs.entry.js +7 -6
  87. package/dist/cjs/bcm-input.cjs.entry.js.map +1 -1
  88. package/dist/cjs/bcm-linked.cjs.entry.js +91 -0
  89. package/dist/cjs/bcm-linked.cjs.entry.js.map +1 -0
  90. package/dist/cjs/bcm-pop-confirm.cjs.entry.js +252 -0
  91. package/dist/cjs/bcm-pop-confirm.cjs.entry.js.map +1 -0
  92. package/dist/cjs/bcm-popover.cjs.entry.js +191 -0
  93. package/dist/cjs/bcm-popover.cjs.entry.js.map +1 -0
  94. package/dist/cjs/bcm-radio-group.cjs.entry.js +171 -0
  95. package/dist/cjs/bcm-radio-group.cjs.entry.js.map +1 -0
  96. package/dist/cjs/bcm-radio.cjs.entry.js +173 -0
  97. package/dist/cjs/bcm-radio.cjs.entry.js.map +1 -0
  98. package/dist/cjs/bcm-segmented-picker-option.cjs.entry.js +109 -0
  99. package/dist/cjs/bcm-segmented-picker-option.cjs.entry.js.map +1 -0
  100. package/dist/cjs/bcm-segmented-picker.cjs.entry.js +146 -0
  101. package/dist/cjs/bcm-segmented-picker.cjs.entry.js.map +1 -0
  102. package/dist/cjs/bcm-switch.cjs.entry.js +188 -0
  103. package/dist/cjs/bcm-switch.cjs.entry.js.map +1 -0
  104. package/dist/cjs/bcm-tabs-content.cjs.entry.js +22 -0
  105. package/dist/cjs/bcm-tabs-content.cjs.entry.js.map +1 -0
  106. package/dist/cjs/bcm-tabs-list.cjs.entry.js +43 -0
  107. package/dist/cjs/bcm-tabs-list.cjs.entry.js.map +1 -0
  108. package/dist/cjs/bcm-tabs-trigger.cjs.entry.js +92 -0
  109. package/dist/cjs/bcm-tabs-trigger.cjs.entry.js.map +1 -0
  110. package/dist/cjs/bcm-tabs.cjs.entry.js +211 -0
  111. package/dist/cjs/bcm-tabs.cjs.entry.js.map +1 -0
  112. package/dist/cjs/bcm-text.cjs.entry.js +3 -3
  113. package/dist/cjs/bcm-text.cjs.entry.js.map +1 -1
  114. package/dist/cjs/bcm-textarea.cjs.entry.js +8 -7
  115. package/dist/cjs/bcm-textarea.cjs.entry.js.map +1 -1
  116. package/dist/cjs/bcm-tooltip.cjs.entry.js +187 -0
  117. package/dist/cjs/bcm-tooltip.cjs.entry.js.map +1 -0
  118. package/dist/cjs/bromcom-ui.cjs.js +2 -2
  119. package/dist/cjs/floating-ui.dom.esm-3ec8404c.js +2085 -0
  120. package/dist/cjs/floating-ui.dom.esm-3ec8404c.js.map +1 -0
  121. package/dist/{components/p-31354aaa.js → cjs/generate-id-f6982042.js} +4 -47
  122. package/dist/cjs/generate-id-f6982042.js.map +1 -0
  123. package/dist/cjs/{index-4795c073.js → index-9a2c5938.js} +36 -7
  124. package/dist/{bromcom-ui/p-15fe392b.js.map → cjs/index-9a2c5938.js.map} +1 -1
  125. package/dist/cjs/loader.cjs.js +2 -2
  126. package/dist/cjs/validation-messages-18389279.js +52 -0
  127. package/dist/cjs/validation-messages-18389279.js.map +1 -0
  128. package/dist/collection/collection-manifest.json +18 -1
  129. package/dist/collection/components/accordion/accordion.css +1 -1
  130. package/dist/collection/components/accordion-group/accordion-group.css +1 -1
  131. package/dist/collection/components/alert/alert.css +1 -1
  132. package/dist/collection/components/avatar/avatar.css +1 -1
  133. package/dist/collection/components/badge/badge.css +1 -1
  134. package/dist/collection/components/basic-badge/basic-badge.css +1 -1
  135. package/dist/collection/components/button/button.component.js +33 -2
  136. package/dist/collection/components/button/button.component.js.map +1 -1
  137. package/dist/collection/components/button/button.css +1 -1
  138. package/dist/collection/components/button/types.js.map +1 -1
  139. package/dist/collection/components/button-group/button-group.component.js +252 -0
  140. package/dist/collection/components/button-group/button-group.component.js.map +1 -0
  141. package/dist/collection/components/button-group/button-group.css +1 -0
  142. package/dist/collection/components/button-group/types.js +2 -0
  143. package/dist/collection/components/button-group/types.js.map +1 -0
  144. package/dist/collection/components/checkbox/checkbox.component.js +440 -0
  145. package/dist/collection/components/checkbox/checkbox.component.js.map +1 -0
  146. package/dist/collection/components/checkbox/checkbox.css +1 -0
  147. package/dist/collection/components/chip/chip.component.js +1 -1
  148. package/dist/collection/components/chip/chip.css +1 -1
  149. package/dist/collection/components/divider/divider.component.js +1 -1
  150. package/dist/collection/components/divider/divider.css +1 -1
  151. package/dist/collection/components/dropdown/dropdown.component.js +110 -0
  152. package/dist/collection/components/dropdown/dropdown.component.js.map +1 -0
  153. package/dist/collection/components/dropdown/dropdown.css +1 -0
  154. package/dist/collection/components/dropdown-item/dropdown-item.component.js +198 -0
  155. package/dist/collection/components/dropdown-item/dropdown-item.component.js.map +1 -0
  156. package/dist/collection/components/dropdown-item/dropdown-item.css +1 -0
  157. package/dist/collection/components/input/input.component.js +2 -2
  158. package/dist/collection/components/input/input.css +1 -1
  159. package/dist/collection/components/linked/linked.component.js +140 -0
  160. package/dist/collection/components/linked/linked.component.js.map +1 -0
  161. package/dist/collection/components/linked/linked.css +1 -0
  162. package/dist/collection/components/pop-confirm/pop-confirm.component.js +629 -0
  163. package/dist/collection/components/pop-confirm/pop-confirm.component.js.map +1 -0
  164. package/dist/collection/components/pop-confirm/pop-confirm.css +1 -0
  165. package/dist/collection/components/popover/popover.component.js +477 -0
  166. package/dist/collection/components/popover/popover.component.js.map +1 -0
  167. package/dist/collection/components/popover/popover.css +1 -0
  168. package/dist/collection/components/radio/radio.component.js +502 -0
  169. package/dist/collection/components/radio/radio.component.js.map +1 -0
  170. package/dist/collection/components/radio/radio.css +1 -0
  171. package/dist/collection/components/radio-group/radio-group.component.js +523 -0
  172. package/dist/collection/components/radio-group/radio-group.component.js.map +1 -0
  173. package/dist/collection/components/radio-group/radio-group.css +1 -0
  174. package/dist/collection/components/segmented-picker/segmented-picker-option.component.js +253 -0
  175. package/dist/collection/components/segmented-picker/segmented-picker-option.component.js.map +1 -0
  176. package/dist/collection/components/segmented-picker/segmented-picker-option.css +1 -0
  177. package/dist/collection/components/segmented-picker/segmented-picker.component.js +269 -0
  178. package/dist/collection/components/segmented-picker/segmented-picker.component.js.map +1 -0
  179. package/dist/collection/components/segmented-picker/segmented-picker.css +1 -0
  180. package/dist/collection/components/segmented-picker/types.js +2 -0
  181. package/dist/collection/components/segmented-picker/types.js.map +1 -0
  182. package/dist/collection/components/switch/switch.component.js +452 -0
  183. package/dist/collection/components/switch/switch.component.js.map +1 -0
  184. package/dist/collection/components/switch/switch.css +1 -0
  185. package/dist/collection/components/tabs/bcm-tabs.css +1 -0
  186. package/dist/collection/components/tabs/tabs-content.component.js +46 -0
  187. package/dist/collection/components/tabs/tabs-content.component.js.map +1 -0
  188. package/dist/collection/components/tabs/tabs-content.css +1 -0
  189. package/dist/collection/components/tabs/tabs-list.component.js +46 -0
  190. package/dist/collection/components/tabs/tabs-list.component.js.map +1 -0
  191. package/dist/collection/components/tabs/tabs-list.css +1 -0
  192. package/dist/collection/components/tabs/tabs-trigger.component.js +195 -0
  193. package/dist/collection/components/tabs/tabs-trigger.component.js.map +1 -0
  194. package/dist/collection/components/tabs/tabs-trigger.css +1 -0
  195. package/dist/collection/components/tabs/tabs.component.js +422 -0
  196. package/dist/collection/components/tabs/tabs.component.js.map +1 -0
  197. package/dist/collection/components/text/text.component.js +1 -1
  198. package/dist/collection/components/text/text.css +1 -1
  199. package/dist/collection/components/textarea/textarea.component.js +3 -3
  200. package/dist/collection/components/textarea/textarea.css +1 -1
  201. package/dist/collection/components/tooltip/tooltip.component.js +385 -0
  202. package/dist/collection/components/tooltip/tooltip.component.js.map +1 -0
  203. package/dist/collection/components/tooltip/tooltip.css +1 -0
  204. package/dist/collection/styles/theme-variables.js +29 -0
  205. package/dist/collection/styles/theme-variables.js.map +1 -1
  206. package/dist/components/bcm-accordion-group.js +2 -2
  207. package/dist/components/bcm-accordion-group.js.map +1 -1
  208. package/dist/components/bcm-accordion.js +2 -2
  209. package/dist/components/bcm-accordion.js.map +1 -1
  210. package/dist/components/bcm-alert.js +2 -2
  211. package/dist/components/bcm-alert.js.map +1 -1
  212. package/dist/components/bcm-avatar.js +3 -3
  213. package/dist/components/bcm-avatar.js.map +1 -1
  214. package/dist/components/bcm-badge.js +1 -1
  215. package/dist/components/bcm-basic-badge.js +2 -2
  216. package/dist/components/bcm-basic-badge.js.map +1 -1
  217. package/dist/components/bcm-button-group.d.ts +11 -0
  218. package/dist/components/bcm-button-group.js +120 -0
  219. package/dist/components/bcm-button-group.js.map +1 -0
  220. package/dist/components/bcm-button.js +1 -327
  221. package/dist/components/bcm-button.js.map +1 -1
  222. package/dist/components/bcm-checkbox.d.ts +11 -0
  223. package/dist/components/bcm-checkbox.js +256 -0
  224. package/dist/components/bcm-checkbox.js.map +1 -0
  225. package/dist/components/bcm-chip.js +3 -3
  226. package/dist/components/bcm-chip.js.map +1 -1
  227. package/dist/components/bcm-divider.js +3 -3
  228. package/dist/components/bcm-divider.js.map +1 -1
  229. package/dist/components/bcm-dropdown-item.d.ts +11 -0
  230. package/dist/components/bcm-dropdown-item.js +85 -0
  231. package/dist/components/bcm-dropdown-item.js.map +1 -0
  232. package/dist/components/bcm-dropdown.d.ts +11 -0
  233. package/dist/components/bcm-dropdown.js +87 -0
  234. package/dist/components/bcm-dropdown.js.map +1 -0
  235. package/dist/components/bcm-input.js +6 -5
  236. package/dist/components/bcm-input.js.map +1 -1
  237. package/dist/components/bcm-linked.d.ts +11 -0
  238. package/dist/components/bcm-linked.js +8 -0
  239. package/dist/components/bcm-linked.js.map +1 -0
  240. package/dist/components/bcm-pop-confirm.d.ts +11 -0
  241. package/dist/components/bcm-pop-confirm.js +288 -0
  242. package/dist/components/bcm-pop-confirm.js.map +1 -0
  243. package/dist/components/bcm-popover.d.ts +11 -0
  244. package/dist/components/bcm-popover.js +216 -0
  245. package/dist/components/bcm-popover.js.map +1 -0
  246. package/dist/components/bcm-radio-group.d.ts +11 -0
  247. package/dist/components/bcm-radio-group.js +200 -0
  248. package/dist/components/bcm-radio-group.js.map +1 -0
  249. package/dist/components/bcm-radio.d.ts +11 -0
  250. package/dist/components/bcm-radio.js +198 -0
  251. package/dist/components/bcm-radio.js.map +1 -0
  252. package/dist/components/bcm-segmented-picker-option.d.ts +11 -0
  253. package/dist/components/bcm-segmented-picker-option.js +131 -0
  254. package/dist/components/bcm-segmented-picker-option.js.map +1 -0
  255. package/dist/components/bcm-segmented-picker.d.ts +11 -0
  256. package/dist/components/bcm-segmented-picker.js +170 -0
  257. package/dist/components/bcm-segmented-picker.js.map +1 -0
  258. package/dist/components/bcm-switch.d.ts +11 -0
  259. package/dist/components/bcm-switch.js +215 -0
  260. package/dist/components/bcm-switch.js.map +1 -0
  261. package/dist/components/bcm-tabs-content.d.ts +11 -0
  262. package/dist/components/bcm-tabs-content.js +39 -0
  263. package/dist/components/bcm-tabs-content.js.map +1 -0
  264. package/dist/components/bcm-tabs-list.d.ts +11 -0
  265. package/dist/components/bcm-tabs-list.js +58 -0
  266. package/dist/components/bcm-tabs-list.js.map +1 -0
  267. package/dist/components/bcm-tabs-trigger.d.ts +11 -0
  268. package/dist/components/bcm-tabs-trigger.js +112 -0
  269. package/dist/components/bcm-tabs-trigger.js.map +1 -0
  270. package/dist/components/bcm-tabs.d.ts +11 -0
  271. package/dist/components/bcm-tabs.js +239 -0
  272. package/dist/components/bcm-tabs.js.map +1 -0
  273. package/dist/components/bcm-text.js +3 -3
  274. package/dist/components/bcm-text.js.map +1 -1
  275. package/dist/components/bcm-textarea.js +7 -6
  276. package/dist/components/bcm-textarea.js.map +1 -1
  277. package/dist/components/bcm-tooltip.d.ts +11 -0
  278. package/dist/components/bcm-tooltip.js +211 -0
  279. package/dist/components/bcm-tooltip.js.map +1 -0
  280. package/dist/components/index.js +1 -1
  281. package/dist/components/p-13a245f6.js +48 -0
  282. package/dist/components/p-13a245f6.js.map +1 -0
  283. package/dist/components/{p-39637e05.js → p-49f20ff7.js} +3 -3
  284. package/dist/components/{p-39637e05.js.map → p-49f20ff7.js.map} +1 -1
  285. package/dist/components/{p-13582168.js → p-5377117d.js} +32 -6
  286. package/dist/components/p-5377117d.js.map +1 -0
  287. package/dist/components/p-5f7a0d0d.js +107 -0
  288. package/dist/components/p-5f7a0d0d.js.map +1 -0
  289. package/dist/components/p-9594cebb.js +2078 -0
  290. package/dist/components/p-9594cebb.js.map +1 -0
  291. package/dist/{esm/validation-messages-a29d53be.js → components/p-ba2410ef.js} +2 -47
  292. package/dist/components/p-ba2410ef.js.map +1 -0
  293. package/dist/components/p-c3a60937.js +338 -0
  294. package/dist/components/p-c3a60937.js.map +1 -0
  295. package/dist/esm/app-globals-bfa07b76.js.map +1 -1
  296. package/dist/esm/bcm-accordion-group.entry.js +2 -2
  297. package/dist/esm/bcm-accordion-group.entry.js.map +1 -1
  298. package/dist/esm/bcm-accordion.entry.js +2 -2
  299. package/dist/esm/bcm-accordion.entry.js.map +1 -1
  300. package/dist/esm/bcm-alert.entry.js +2 -2
  301. package/dist/esm/bcm-alert.entry.js.map +1 -1
  302. package/dist/esm/bcm-avatar_4.entry.js +13 -7
  303. package/dist/esm/bcm-avatar_4.entry.js.map +1 -1
  304. package/dist/esm/bcm-button-group.entry.js +93 -0
  305. package/dist/esm/bcm-button-group.entry.js.map +1 -0
  306. package/dist/esm/bcm-checkbox.entry.js +222 -0
  307. package/dist/esm/bcm-checkbox.entry.js.map +1 -0
  308. package/dist/esm/bcm-chip.entry.js +3 -3
  309. package/dist/esm/bcm-chip.entry.js.map +1 -1
  310. package/dist/esm/bcm-divider.entry.js +3 -3
  311. package/dist/esm/bcm-divider.entry.js.map +1 -1
  312. package/dist/esm/bcm-dropdown-item.entry.js +59 -0
  313. package/dist/esm/bcm-dropdown-item.entry.js.map +1 -0
  314. package/dist/esm/bcm-dropdown.entry.js +52 -0
  315. package/dist/esm/bcm-dropdown.entry.js.map +1 -0
  316. package/dist/esm/bcm-input.entry.js +6 -5
  317. package/dist/esm/bcm-input.entry.js.map +1 -1
  318. package/dist/esm/bcm-linked.entry.js +87 -0
  319. package/dist/esm/bcm-linked.entry.js.map +1 -0
  320. package/dist/esm/bcm-pop-confirm.entry.js +248 -0
  321. package/dist/esm/bcm-pop-confirm.entry.js.map +1 -0
  322. package/dist/esm/bcm-popover.entry.js +187 -0
  323. package/dist/esm/bcm-popover.entry.js.map +1 -0
  324. package/dist/esm/bcm-radio-group.entry.js +167 -0
  325. package/dist/esm/bcm-radio-group.entry.js.map +1 -0
  326. package/dist/esm/bcm-radio.entry.js +169 -0
  327. package/dist/esm/bcm-radio.entry.js.map +1 -0
  328. package/dist/esm/bcm-segmented-picker-option.entry.js +105 -0
  329. package/dist/esm/bcm-segmented-picker-option.entry.js.map +1 -0
  330. package/dist/esm/bcm-segmented-picker.entry.js +142 -0
  331. package/dist/esm/bcm-segmented-picker.entry.js.map +1 -0
  332. package/dist/esm/bcm-switch.entry.js +184 -0
  333. package/dist/esm/bcm-switch.entry.js.map +1 -0
  334. package/dist/esm/bcm-tabs-content.entry.js +18 -0
  335. package/dist/esm/bcm-tabs-content.entry.js.map +1 -0
  336. package/dist/esm/bcm-tabs-list.entry.js +39 -0
  337. package/dist/esm/bcm-tabs-list.entry.js.map +1 -0
  338. package/dist/esm/bcm-tabs-trigger.entry.js +88 -0
  339. package/dist/esm/bcm-tabs-trigger.entry.js.map +1 -0
  340. package/dist/esm/bcm-tabs.entry.js +207 -0
  341. package/dist/esm/bcm-tabs.entry.js.map +1 -0
  342. package/dist/esm/bcm-text.entry.js +3 -3
  343. package/dist/esm/bcm-text.entry.js.map +1 -1
  344. package/dist/esm/bcm-textarea.entry.js +7 -6
  345. package/dist/esm/bcm-textarea.entry.js.map +1 -1
  346. package/dist/esm/bcm-tooltip.entry.js +183 -0
  347. package/dist/esm/bcm-tooltip.entry.js.map +1 -0
  348. package/dist/esm/bromcom-ui.js +3 -3
  349. package/dist/esm/floating-ui.dom.esm-480e0f15.js +2078 -0
  350. package/dist/esm/floating-ui.dom.esm-480e0f15.js.map +1 -0
  351. package/dist/{cjs/validation-messages-c36e5c31.js → esm/generate-id-3b2fcb93.js} +2 -52
  352. package/dist/esm/generate-id-3b2fcb93.js.map +1 -0
  353. package/dist/esm/{index-27cc1bac.js → index-8571fbf7.js} +36 -8
  354. package/dist/esm/index-8571fbf7.js.map +1 -0
  355. package/dist/esm/loader.js +3 -3
  356. package/dist/esm/validation-messages-af4512f0.js +48 -0
  357. package/dist/esm/validation-messages-af4512f0.js.map +1 -0
  358. package/dist/types/components/button/button.component.d.ts +3 -1
  359. package/dist/types/components/button/types.d.ts +4 -4
  360. package/dist/types/components/button-group/button-group.component.d.ts +25 -0
  361. package/dist/types/components/button-group/types.d.ts +2 -0
  362. package/dist/types/components/checkbox/checkbox.component.d.ts +99 -0
  363. package/dist/types/components/dropdown/dropdown.component.d.ts +14 -0
  364. package/dist/types/components/dropdown-item/dropdown-item.component.d.ts +14 -0
  365. package/dist/types/components/linked/linked.component.d.ts +16 -0
  366. package/dist/types/components/pop-confirm/pop-confirm.component.d.ts +195 -0
  367. package/dist/types/components/popover/popover.component.d.ts +118 -0
  368. package/dist/types/components/radio/radio.component.d.ts +105 -0
  369. package/dist/types/components/radio-group/radio-group.component.d.ts +124 -0
  370. package/dist/types/components/segmented-picker/segmented-picker-option.component.d.ts +30 -0
  371. package/dist/types/components/segmented-picker/segmented-picker.component.d.ts +35 -0
  372. package/dist/types/components/segmented-picker/types.d.ts +1 -0
  373. package/dist/types/components/switch/switch.component.d.ts +62 -0
  374. package/dist/types/components/tabs/tabs-content.component.d.ts +13 -0
  375. package/dist/types/components/tabs/tabs-list.component.d.ts +12 -0
  376. package/dist/types/components/tabs/tabs-trigger.component.d.ts +41 -0
  377. package/dist/types/components/tabs/tabs.component.d.ts +88 -0
  378. package/dist/types/components/tooltip/tooltip.component.d.ts +86 -0
  379. package/dist/types/components.d.ts +2495 -649
  380. package/dist/types/styles/theme-variables.d.ts +29 -0
  381. package/package.json +2 -1
  382. package/dist/bromcom-ui/p-04f6d730.entry.js +0 -2
  383. package/dist/bromcom-ui/p-04f6d730.entry.js.map +0 -1
  384. package/dist/bromcom-ui/p-15fe392b.js +0 -3
  385. package/dist/bromcom-ui/p-1d86c1cf.entry.js +0 -2
  386. package/dist/bromcom-ui/p-31354aaa.js +0 -2
  387. package/dist/bromcom-ui/p-31354aaa.js.map +0 -1
  388. package/dist/bromcom-ui/p-3b607038.entry.js +0 -2
  389. package/dist/bromcom-ui/p-cd437280.entry.js +0 -2
  390. package/dist/bromcom-ui/p-dcea8d62.entry.js +0 -2
  391. package/dist/cjs/validation-messages-c36e5c31.js.map +0 -1
  392. package/dist/components/p-13582168.js.map +0 -1
  393. package/dist/components/p-31354aaa.js.map +0 -1
  394. package/dist/esm/index-27cc1bac.js.map +0 -1
  395. package/dist/esm/validation-messages-a29d53be.js.map +0 -1
@@ -0,0 +1,2078 @@
1
+ /**
2
+ * Custom positioning reference element.
3
+ * @see https://floating-ui.com/docs/virtual-elements
4
+ */
5
+
6
+ const sides = ['top', 'right', 'bottom', 'left'];
7
+ const alignments = ['start', 'end'];
8
+ const placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []);
9
+ const min = Math.min;
10
+ const max = Math.max;
11
+ const round = Math.round;
12
+ const floor = Math.floor;
13
+ const createCoords = v => ({
14
+ x: v,
15
+ y: v
16
+ });
17
+ const oppositeSideMap = {
18
+ left: 'right',
19
+ right: 'left',
20
+ bottom: 'top',
21
+ top: 'bottom'
22
+ };
23
+ const oppositeAlignmentMap = {
24
+ start: 'end',
25
+ end: 'start'
26
+ };
27
+ function clamp(start, value, end) {
28
+ return max(start, min(value, end));
29
+ }
30
+ function evaluate(value, param) {
31
+ return typeof value === 'function' ? value(param) : value;
32
+ }
33
+ function getSide(placement) {
34
+ return placement.split('-')[0];
35
+ }
36
+ function getAlignment(placement) {
37
+ return placement.split('-')[1];
38
+ }
39
+ function getOppositeAxis(axis) {
40
+ return axis === 'x' ? 'y' : 'x';
41
+ }
42
+ function getAxisLength(axis) {
43
+ return axis === 'y' ? 'height' : 'width';
44
+ }
45
+ function getSideAxis(placement) {
46
+ return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
47
+ }
48
+ function getAlignmentAxis(placement) {
49
+ return getOppositeAxis(getSideAxis(placement));
50
+ }
51
+ function getAlignmentSides(placement, rects, rtl) {
52
+ if (rtl === void 0) {
53
+ rtl = false;
54
+ }
55
+ const alignment = getAlignment(placement);
56
+ const alignmentAxis = getAlignmentAxis(placement);
57
+ const length = getAxisLength(alignmentAxis);
58
+ let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
59
+ if (rects.reference[length] > rects.floating[length]) {
60
+ mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
61
+ }
62
+ return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
63
+ }
64
+ function getExpandedPlacements(placement) {
65
+ const oppositePlacement = getOppositePlacement(placement);
66
+ return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
67
+ }
68
+ function getOppositeAlignmentPlacement(placement) {
69
+ return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
70
+ }
71
+ function getSideList(side, isStart, rtl) {
72
+ const lr = ['left', 'right'];
73
+ const rl = ['right', 'left'];
74
+ const tb = ['top', 'bottom'];
75
+ const bt = ['bottom', 'top'];
76
+ switch (side) {
77
+ case 'top':
78
+ case 'bottom':
79
+ if (rtl) return isStart ? rl : lr;
80
+ return isStart ? lr : rl;
81
+ case 'left':
82
+ case 'right':
83
+ return isStart ? tb : bt;
84
+ default:
85
+ return [];
86
+ }
87
+ }
88
+ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
89
+ const alignment = getAlignment(placement);
90
+ let list = getSideList(getSide(placement), direction === 'start', rtl);
91
+ if (alignment) {
92
+ list = list.map(side => side + "-" + alignment);
93
+ if (flipAlignment) {
94
+ list = list.concat(list.map(getOppositeAlignmentPlacement));
95
+ }
96
+ }
97
+ return list;
98
+ }
99
+ function getOppositePlacement(placement) {
100
+ return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
101
+ }
102
+ function expandPaddingObject(padding) {
103
+ return {
104
+ top: 0,
105
+ right: 0,
106
+ bottom: 0,
107
+ left: 0,
108
+ ...padding
109
+ };
110
+ }
111
+ function getPaddingObject(padding) {
112
+ return typeof padding !== 'number' ? expandPaddingObject(padding) : {
113
+ top: padding,
114
+ right: padding,
115
+ bottom: padding,
116
+ left: padding
117
+ };
118
+ }
119
+ function rectToClientRect(rect) {
120
+ const {
121
+ x,
122
+ y,
123
+ width,
124
+ height
125
+ } = rect;
126
+ return {
127
+ width,
128
+ height,
129
+ top: y,
130
+ left: x,
131
+ right: x + width,
132
+ bottom: y + height,
133
+ x,
134
+ y
135
+ };
136
+ }
137
+
138
+ function computeCoordsFromPlacement(_ref, placement, rtl) {
139
+ let {
140
+ reference,
141
+ floating
142
+ } = _ref;
143
+ const sideAxis = getSideAxis(placement);
144
+ const alignmentAxis = getAlignmentAxis(placement);
145
+ const alignLength = getAxisLength(alignmentAxis);
146
+ const side = getSide(placement);
147
+ const isVertical = sideAxis === 'y';
148
+ const commonX = reference.x + reference.width / 2 - floating.width / 2;
149
+ const commonY = reference.y + reference.height / 2 - floating.height / 2;
150
+ const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
151
+ let coords;
152
+ switch (side) {
153
+ case 'top':
154
+ coords = {
155
+ x: commonX,
156
+ y: reference.y - floating.height
157
+ };
158
+ break;
159
+ case 'bottom':
160
+ coords = {
161
+ x: commonX,
162
+ y: reference.y + reference.height
163
+ };
164
+ break;
165
+ case 'right':
166
+ coords = {
167
+ x: reference.x + reference.width,
168
+ y: commonY
169
+ };
170
+ break;
171
+ case 'left':
172
+ coords = {
173
+ x: reference.x - floating.width,
174
+ y: commonY
175
+ };
176
+ break;
177
+ default:
178
+ coords = {
179
+ x: reference.x,
180
+ y: reference.y
181
+ };
182
+ }
183
+ switch (getAlignment(placement)) {
184
+ case 'start':
185
+ coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
186
+ break;
187
+ case 'end':
188
+ coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
189
+ break;
190
+ }
191
+ return coords;
192
+ }
193
+
194
+ /**
195
+ * Computes the `x` and `y` coordinates that will place the floating element
196
+ * next to a given reference element.
197
+ *
198
+ * This export does not have any `platform` interface logic. You will need to
199
+ * write one for the platform you are using Floating UI with.
200
+ */
201
+ const computePosition$1 = async (reference, floating, config) => {
202
+ const {
203
+ placement = 'bottom',
204
+ strategy = 'absolute',
205
+ middleware = [],
206
+ platform
207
+ } = config;
208
+ const validMiddleware = middleware.filter(Boolean);
209
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
210
+ let rects = await platform.getElementRects({
211
+ reference,
212
+ floating,
213
+ strategy
214
+ });
215
+ let {
216
+ x,
217
+ y
218
+ } = computeCoordsFromPlacement(rects, placement, rtl);
219
+ let statefulPlacement = placement;
220
+ let middlewareData = {};
221
+ let resetCount = 0;
222
+ for (let i = 0; i < validMiddleware.length; i++) {
223
+ const {
224
+ name,
225
+ fn
226
+ } = validMiddleware[i];
227
+ const {
228
+ x: nextX,
229
+ y: nextY,
230
+ data,
231
+ reset
232
+ } = await fn({
233
+ x,
234
+ y,
235
+ initialPlacement: placement,
236
+ placement: statefulPlacement,
237
+ strategy,
238
+ middlewareData,
239
+ rects,
240
+ platform,
241
+ elements: {
242
+ reference,
243
+ floating
244
+ }
245
+ });
246
+ x = nextX != null ? nextX : x;
247
+ y = nextY != null ? nextY : y;
248
+ middlewareData = {
249
+ ...middlewareData,
250
+ [name]: {
251
+ ...middlewareData[name],
252
+ ...data
253
+ }
254
+ };
255
+ if (reset && resetCount <= 50) {
256
+ resetCount++;
257
+ if (typeof reset === 'object') {
258
+ if (reset.placement) {
259
+ statefulPlacement = reset.placement;
260
+ }
261
+ if (reset.rects) {
262
+ rects = reset.rects === true ? await platform.getElementRects({
263
+ reference,
264
+ floating,
265
+ strategy
266
+ }) : reset.rects;
267
+ }
268
+ ({
269
+ x,
270
+ y
271
+ } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
272
+ }
273
+ i = -1;
274
+ }
275
+ }
276
+ return {
277
+ x,
278
+ y,
279
+ placement: statefulPlacement,
280
+ strategy,
281
+ middlewareData
282
+ };
283
+ };
284
+
285
+ /**
286
+ * Resolves with an object of overflow side offsets that determine how much the
287
+ * element is overflowing a given clipping boundary on each side.
288
+ * - positive = overflowing the boundary by that number of pixels
289
+ * - negative = how many pixels left before it will overflow
290
+ * - 0 = lies flush with the boundary
291
+ * @see https://floating-ui.com/docs/detectOverflow
292
+ */
293
+ async function detectOverflow(state, options) {
294
+ var _await$platform$isEle;
295
+ if (options === void 0) {
296
+ options = {};
297
+ }
298
+ const {
299
+ x,
300
+ y,
301
+ platform,
302
+ rects,
303
+ elements,
304
+ strategy
305
+ } = state;
306
+ const {
307
+ boundary = 'clippingAncestors',
308
+ rootBoundary = 'viewport',
309
+ elementContext = 'floating',
310
+ altBoundary = false,
311
+ padding = 0
312
+ } = evaluate(options, state);
313
+ const paddingObject = getPaddingObject(padding);
314
+ const altContext = elementContext === 'floating' ? 'reference' : 'floating';
315
+ const element = elements[altBoundary ? altContext : elementContext];
316
+ const clippingClientRect = rectToClientRect(await platform.getClippingRect({
317
+ 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))),
318
+ boundary,
319
+ rootBoundary,
320
+ strategy
321
+ }));
322
+ const rect = elementContext === 'floating' ? {
323
+ x,
324
+ y,
325
+ width: rects.floating.width,
326
+ height: rects.floating.height
327
+ } : rects.reference;
328
+ const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
329
+ const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
330
+ x: 1,
331
+ y: 1
332
+ } : {
333
+ x: 1,
334
+ y: 1
335
+ };
336
+ const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
337
+ elements,
338
+ rect,
339
+ offsetParent,
340
+ strategy
341
+ }) : rect);
342
+ return {
343
+ top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
344
+ bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
345
+ left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
346
+ right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
347
+ };
348
+ }
349
+
350
+ /**
351
+ * Provides data to position an inner element of the floating element so that it
352
+ * appears centered to the reference element.
353
+ * @see https://floating-ui.com/docs/arrow
354
+ */
355
+ const arrow$1 = options => ({
356
+ name: 'arrow',
357
+ options,
358
+ async fn(state) {
359
+ const {
360
+ x,
361
+ y,
362
+ placement,
363
+ rects,
364
+ platform,
365
+ elements,
366
+ middlewareData
367
+ } = state;
368
+ // Since `element` is required, we don't Partial<> the type.
369
+ const {
370
+ element,
371
+ padding = 0
372
+ } = evaluate(options, state) || {};
373
+ if (element == null) {
374
+ return {};
375
+ }
376
+ const paddingObject = getPaddingObject(padding);
377
+ const coords = {
378
+ x,
379
+ y
380
+ };
381
+ const axis = getAlignmentAxis(placement);
382
+ const length = getAxisLength(axis);
383
+ const arrowDimensions = await platform.getDimensions(element);
384
+ const isYAxis = axis === 'y';
385
+ const minProp = isYAxis ? 'top' : 'left';
386
+ const maxProp = isYAxis ? 'bottom' : 'right';
387
+ const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
388
+ const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
389
+ const startDiff = coords[axis] - rects.reference[axis];
390
+ const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
391
+ let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
392
+
393
+ // DOM platform can return `window` as the `offsetParent`.
394
+ if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
395
+ clientSize = elements.floating[clientProp] || rects.floating[length];
396
+ }
397
+ const centerToReference = endDiff / 2 - startDiff / 2;
398
+
399
+ // If the padding is large enough that it causes the arrow to no longer be
400
+ // centered, modify the padding so that it is centered.
401
+ const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
402
+ const minPadding = min(paddingObject[minProp], largestPossiblePadding);
403
+ const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
404
+
405
+ // Make sure the arrow doesn't overflow the floating element if the center
406
+ // point is outside the floating element's bounds.
407
+ const min$1 = minPadding;
408
+ const max = clientSize - arrowDimensions[length] - maxPadding;
409
+ const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
410
+ const offset = clamp(min$1, center, max);
411
+
412
+ // If the reference is small enough that the arrow's padding causes it to
413
+ // to point to nothing for an aligned placement, adjust the offset of the
414
+ // floating element itself. To ensure `shift()` continues to take action,
415
+ // a single reset is performed when this is true.
416
+ const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
417
+ const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
418
+ return {
419
+ [axis]: coords[axis] + alignmentOffset,
420
+ data: {
421
+ [axis]: offset,
422
+ centerOffset: center - offset - alignmentOffset,
423
+ ...(shouldAddOffset && {
424
+ alignmentOffset
425
+ })
426
+ },
427
+ reset: shouldAddOffset
428
+ };
429
+ }
430
+ });
431
+
432
+ function getPlacementList(alignment, autoAlignment, allowedPlacements) {
433
+ const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);
434
+ return allowedPlacementsSortedByAlignment.filter(placement => {
435
+ if (alignment) {
436
+ return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);
437
+ }
438
+ return true;
439
+ });
440
+ }
441
+ /**
442
+ * Optimizes the visibility of the floating element by choosing the placement
443
+ * that has the most space available automatically, without needing to specify a
444
+ * preferred placement. Alternative to `flip`.
445
+ * @see https://floating-ui.com/docs/autoPlacement
446
+ */
447
+ const autoPlacement = function (options) {
448
+ if (options === void 0) {
449
+ options = {};
450
+ }
451
+ return {
452
+ name: 'autoPlacement',
453
+ options,
454
+ async fn(state) {
455
+ var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;
456
+ const {
457
+ rects,
458
+ middlewareData,
459
+ placement,
460
+ platform,
461
+ elements
462
+ } = state;
463
+ const {
464
+ crossAxis = false,
465
+ alignment,
466
+ allowedPlacements = placements,
467
+ autoAlignment = true,
468
+ ...detectOverflowOptions
469
+ } = evaluate(options, state);
470
+ const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
471
+ const overflow = await detectOverflow(state, detectOverflowOptions);
472
+ const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
473
+ const currentPlacement = placements$1[currentIndex];
474
+ if (currentPlacement == null) {
475
+ return {};
476
+ }
477
+ const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
478
+
479
+ // Make `computeCoords` start from the right place.
480
+ if (placement !== currentPlacement) {
481
+ return {
482
+ reset: {
483
+ placement: placements$1[0]
484
+ }
485
+ };
486
+ }
487
+ const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];
488
+ const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {
489
+ placement: currentPlacement,
490
+ overflows: currentOverflows
491
+ }];
492
+ const nextPlacement = placements$1[currentIndex + 1];
493
+
494
+ // There are more placements to check.
495
+ if (nextPlacement) {
496
+ return {
497
+ data: {
498
+ index: currentIndex + 1,
499
+ overflows: allOverflows
500
+ },
501
+ reset: {
502
+ placement: nextPlacement
503
+ }
504
+ };
505
+ }
506
+ const placementsSortedByMostSpace = allOverflows.map(d => {
507
+ const alignment = getAlignment(d.placement);
508
+ return [d.placement, alignment && crossAxis ?
509
+ // Check along the mainAxis and main crossAxis side.
510
+ d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :
511
+ // Check only the mainAxis.
512
+ d.overflows[0], d.overflows];
513
+ }).sort((a, b) => a[1] - b[1]);
514
+ const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,
515
+ // Aligned placements should not check their opposite crossAxis
516
+ // side.
517
+ getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));
518
+ const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];
519
+ if (resetPlacement !== placement) {
520
+ return {
521
+ data: {
522
+ index: currentIndex + 1,
523
+ overflows: allOverflows
524
+ },
525
+ reset: {
526
+ placement: resetPlacement
527
+ }
528
+ };
529
+ }
530
+ return {};
531
+ }
532
+ };
533
+ };
534
+
535
+ /**
536
+ * Optimizes the visibility of the floating element by flipping the `placement`
537
+ * in order to keep it in view when the preferred placement(s) will overflow the
538
+ * clipping boundary. Alternative to `autoPlacement`.
539
+ * @see https://floating-ui.com/docs/flip
540
+ */
541
+ const flip$1 = function (options) {
542
+ if (options === void 0) {
543
+ options = {};
544
+ }
545
+ return {
546
+ name: 'flip',
547
+ options,
548
+ async fn(state) {
549
+ var _middlewareData$arrow, _middlewareData$flip;
550
+ const {
551
+ placement,
552
+ middlewareData,
553
+ rects,
554
+ initialPlacement,
555
+ platform,
556
+ elements
557
+ } = state;
558
+ const {
559
+ mainAxis: checkMainAxis = true,
560
+ crossAxis: checkCrossAxis = true,
561
+ fallbackPlacements: specifiedFallbackPlacements,
562
+ fallbackStrategy = 'bestFit',
563
+ fallbackAxisSideDirection = 'none',
564
+ flipAlignment = true,
565
+ ...detectOverflowOptions
566
+ } = evaluate(options, state);
567
+
568
+ // If a reset by the arrow was caused due to an alignment offset being
569
+ // added, we should skip any logic now since `flip()` has already done its
570
+ // work.
571
+ // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
572
+ if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
573
+ return {};
574
+ }
575
+ const side = getSide(placement);
576
+ const initialSideAxis = getSideAxis(initialPlacement);
577
+ const isBasePlacement = getSide(initialPlacement) === initialPlacement;
578
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
579
+ const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
580
+ const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';
581
+ if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
582
+ fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
583
+ }
584
+ const placements = [initialPlacement, ...fallbackPlacements];
585
+ const overflow = await detectOverflow(state, detectOverflowOptions);
586
+ const overflows = [];
587
+ let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
588
+ if (checkMainAxis) {
589
+ overflows.push(overflow[side]);
590
+ }
591
+ if (checkCrossAxis) {
592
+ const sides = getAlignmentSides(placement, rects, rtl);
593
+ overflows.push(overflow[sides[0]], overflow[sides[1]]);
594
+ }
595
+ overflowsData = [...overflowsData, {
596
+ placement,
597
+ overflows
598
+ }];
599
+
600
+ // One or more sides is overflowing.
601
+ if (!overflows.every(side => side <= 0)) {
602
+ var _middlewareData$flip2, _overflowsData$filter;
603
+ const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
604
+ const nextPlacement = placements[nextIndex];
605
+ if (nextPlacement) {
606
+ var _overflowsData$;
607
+ const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;
608
+ const hasInitialMainAxisOverflow = ((_overflowsData$ = overflowsData[0]) == null ? void 0 : _overflowsData$.overflows[0]) > 0;
609
+ if (!ignoreCrossAxisOverflow || hasInitialMainAxisOverflow) {
610
+ // Try next placement and re-run the lifecycle.
611
+ return {
612
+ data: {
613
+ index: nextIndex,
614
+ overflows: overflowsData
615
+ },
616
+ reset: {
617
+ placement: nextPlacement
618
+ }
619
+ };
620
+ }
621
+ }
622
+
623
+ // First, find the candidates that fit on the mainAxis side of overflow,
624
+ // then find the placement that fits the best on the main crossAxis side.
625
+ 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;
626
+
627
+ // Otherwise fallback.
628
+ if (!resetPlacement) {
629
+ switch (fallbackStrategy) {
630
+ case 'bestFit':
631
+ {
632
+ var _overflowsData$filter2;
633
+ const placement = (_overflowsData$filter2 = overflowsData.filter(d => {
634
+ if (hasFallbackAxisSideDirection) {
635
+ const currentSideAxis = getSideAxis(d.placement);
636
+ return currentSideAxis === initialSideAxis ||
637
+ // Create a bias to the `y` side axis due to horizontal
638
+ // reading directions favoring greater width.
639
+ currentSideAxis === 'y';
640
+ }
641
+ return true;
642
+ }).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];
643
+ if (placement) {
644
+ resetPlacement = placement;
645
+ }
646
+ break;
647
+ }
648
+ case 'initialPlacement':
649
+ resetPlacement = initialPlacement;
650
+ break;
651
+ }
652
+ }
653
+ if (placement !== resetPlacement) {
654
+ return {
655
+ reset: {
656
+ placement: resetPlacement
657
+ }
658
+ };
659
+ }
660
+ }
661
+ return {};
662
+ }
663
+ };
664
+ };
665
+
666
+ function getSideOffsets(overflow, rect) {
667
+ return {
668
+ top: overflow.top - rect.height,
669
+ right: overflow.right - rect.width,
670
+ bottom: overflow.bottom - rect.height,
671
+ left: overflow.left - rect.width
672
+ };
673
+ }
674
+ function isAnySideFullyClipped(overflow) {
675
+ return sides.some(side => overflow[side] >= 0);
676
+ }
677
+ /**
678
+ * Provides data to hide the floating element in applicable situations, such as
679
+ * when it is not in the same clipping context as the reference element.
680
+ * @see https://floating-ui.com/docs/hide
681
+ */
682
+ const hide = function (options) {
683
+ if (options === void 0) {
684
+ options = {};
685
+ }
686
+ return {
687
+ name: 'hide',
688
+ options,
689
+ async fn(state) {
690
+ const {
691
+ rects
692
+ } = state;
693
+ const {
694
+ strategy = 'referenceHidden',
695
+ ...detectOverflowOptions
696
+ } = evaluate(options, state);
697
+ switch (strategy) {
698
+ case 'referenceHidden':
699
+ {
700
+ const overflow = await detectOverflow(state, {
701
+ ...detectOverflowOptions,
702
+ elementContext: 'reference'
703
+ });
704
+ const offsets = getSideOffsets(overflow, rects.reference);
705
+ return {
706
+ data: {
707
+ referenceHiddenOffsets: offsets,
708
+ referenceHidden: isAnySideFullyClipped(offsets)
709
+ }
710
+ };
711
+ }
712
+ case 'escaped':
713
+ {
714
+ const overflow = await detectOverflow(state, {
715
+ ...detectOverflowOptions,
716
+ altBoundary: true
717
+ });
718
+ const offsets = getSideOffsets(overflow, rects.floating);
719
+ return {
720
+ data: {
721
+ escapedOffsets: offsets,
722
+ escaped: isAnySideFullyClipped(offsets)
723
+ }
724
+ };
725
+ }
726
+ default:
727
+ {
728
+ return {};
729
+ }
730
+ }
731
+ }
732
+ };
733
+ };
734
+
735
+ function getBoundingRect(rects) {
736
+ const minX = min(...rects.map(rect => rect.left));
737
+ const minY = min(...rects.map(rect => rect.top));
738
+ const maxX = max(...rects.map(rect => rect.right));
739
+ const maxY = max(...rects.map(rect => rect.bottom));
740
+ return {
741
+ x: minX,
742
+ y: minY,
743
+ width: maxX - minX,
744
+ height: maxY - minY
745
+ };
746
+ }
747
+ function getRectsByLine(rects) {
748
+ const sortedRects = rects.slice().sort((a, b) => a.y - b.y);
749
+ const groups = [];
750
+ let prevRect = null;
751
+ for (let i = 0; i < sortedRects.length; i++) {
752
+ const rect = sortedRects[i];
753
+ if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {
754
+ groups.push([rect]);
755
+ } else {
756
+ groups[groups.length - 1].push(rect);
757
+ }
758
+ prevRect = rect;
759
+ }
760
+ return groups.map(rect => rectToClientRect(getBoundingRect(rect)));
761
+ }
762
+ /**
763
+ * Provides improved positioning for inline reference elements that can span
764
+ * over multiple lines, such as hyperlinks or range selections.
765
+ * @see https://floating-ui.com/docs/inline
766
+ */
767
+ const inline = function (options) {
768
+ if (options === void 0) {
769
+ options = {};
770
+ }
771
+ return {
772
+ name: 'inline',
773
+ options,
774
+ async fn(state) {
775
+ const {
776
+ placement,
777
+ elements,
778
+ rects,
779
+ platform,
780
+ strategy
781
+ } = state;
782
+ // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a
783
+ // ClientRect's bounds, despite the event listener being triggered. A
784
+ // padding of 2 seems to handle this issue.
785
+ const {
786
+ padding = 2,
787
+ x,
788
+ y
789
+ } = evaluate(options, state);
790
+ const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);
791
+ const clientRects = getRectsByLine(nativeClientRects);
792
+ const fallback = rectToClientRect(getBoundingRect(nativeClientRects));
793
+ const paddingObject = getPaddingObject(padding);
794
+ function getBoundingClientRect() {
795
+ // There are two rects and they are disjoined.
796
+ if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {
797
+ // Find the first rect in which the point is fully inside.
798
+ return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;
799
+ }
800
+
801
+ // There are 2 or more connected rects.
802
+ if (clientRects.length >= 2) {
803
+ if (getSideAxis(placement) === 'y') {
804
+ const firstRect = clientRects[0];
805
+ const lastRect = clientRects[clientRects.length - 1];
806
+ const isTop = getSide(placement) === 'top';
807
+ const top = firstRect.top;
808
+ const bottom = lastRect.bottom;
809
+ const left = isTop ? firstRect.left : lastRect.left;
810
+ const right = isTop ? firstRect.right : lastRect.right;
811
+ const width = right - left;
812
+ const height = bottom - top;
813
+ return {
814
+ top,
815
+ bottom,
816
+ left,
817
+ right,
818
+ width,
819
+ height,
820
+ x: left,
821
+ y: top
822
+ };
823
+ }
824
+ const isLeftSide = getSide(placement) === 'left';
825
+ const maxRight = max(...clientRects.map(rect => rect.right));
826
+ const minLeft = min(...clientRects.map(rect => rect.left));
827
+ const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
828
+ const top = measureRects[0].top;
829
+ const bottom = measureRects[measureRects.length - 1].bottom;
830
+ const left = minLeft;
831
+ const right = maxRight;
832
+ const width = right - left;
833
+ const height = bottom - top;
834
+ return {
835
+ top,
836
+ bottom,
837
+ left,
838
+ right,
839
+ width,
840
+ height,
841
+ x: left,
842
+ y: top
843
+ };
844
+ }
845
+ return fallback;
846
+ }
847
+ const resetRects = await platform.getElementRects({
848
+ reference: {
849
+ getBoundingClientRect
850
+ },
851
+ floating: elements.floating,
852
+ strategy
853
+ });
854
+ if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {
855
+ return {
856
+ reset: {
857
+ rects: resetRects
858
+ }
859
+ };
860
+ }
861
+ return {};
862
+ }
863
+ };
864
+ };
865
+
866
+ // For type backwards-compatibility, the `OffsetOptions` type was also
867
+ // Derivable.
868
+
869
+ async function convertValueToCoords(state, options) {
870
+ const {
871
+ placement,
872
+ platform,
873
+ elements
874
+ } = state;
875
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
876
+ const side = getSide(placement);
877
+ const alignment = getAlignment(placement);
878
+ const isVertical = getSideAxis(placement) === 'y';
879
+ const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
880
+ const crossAxisMulti = rtl && isVertical ? -1 : 1;
881
+ const rawValue = evaluate(options, state);
882
+
883
+ // eslint-disable-next-line prefer-const
884
+ let {
885
+ mainAxis,
886
+ crossAxis,
887
+ alignmentAxis
888
+ } = typeof rawValue === 'number' ? {
889
+ mainAxis: rawValue,
890
+ crossAxis: 0,
891
+ alignmentAxis: null
892
+ } : {
893
+ mainAxis: rawValue.mainAxis || 0,
894
+ crossAxis: rawValue.crossAxis || 0,
895
+ alignmentAxis: rawValue.alignmentAxis
896
+ };
897
+ if (alignment && typeof alignmentAxis === 'number') {
898
+ crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
899
+ }
900
+ return isVertical ? {
901
+ x: crossAxis * crossAxisMulti,
902
+ y: mainAxis * mainAxisMulti
903
+ } : {
904
+ x: mainAxis * mainAxisMulti,
905
+ y: crossAxis * crossAxisMulti
906
+ };
907
+ }
908
+
909
+ /**
910
+ * Modifies the placement by translating the floating element along the
911
+ * specified axes.
912
+ * A number (shorthand for `mainAxis` or distance), or an axes configuration
913
+ * object may be passed.
914
+ * @see https://floating-ui.com/docs/offset
915
+ */
916
+ const offset$1 = function (options) {
917
+ if (options === void 0) {
918
+ options = 0;
919
+ }
920
+ return {
921
+ name: 'offset',
922
+ options,
923
+ async fn(state) {
924
+ var _middlewareData$offse, _middlewareData$arrow;
925
+ const {
926
+ x,
927
+ y,
928
+ placement,
929
+ middlewareData
930
+ } = state;
931
+ const diffCoords = await convertValueToCoords(state, options);
932
+
933
+ // If the placement is the same and the arrow caused an alignment offset
934
+ // then we don't need to change the positioning coordinates.
935
+ if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
936
+ return {};
937
+ }
938
+ return {
939
+ x: x + diffCoords.x,
940
+ y: y + diffCoords.y,
941
+ data: {
942
+ ...diffCoords,
943
+ placement
944
+ }
945
+ };
946
+ }
947
+ };
948
+ };
949
+
950
+ /**
951
+ * Optimizes the visibility of the floating element by shifting it in order to
952
+ * keep it in view when it will overflow the clipping boundary.
953
+ * @see https://floating-ui.com/docs/shift
954
+ */
955
+ const shift$1 = function (options) {
956
+ if (options === void 0) {
957
+ options = {};
958
+ }
959
+ return {
960
+ name: 'shift',
961
+ options,
962
+ async fn(state) {
963
+ const {
964
+ x,
965
+ y,
966
+ placement
967
+ } = state;
968
+ const {
969
+ mainAxis: checkMainAxis = true,
970
+ crossAxis: checkCrossAxis = false,
971
+ limiter = {
972
+ fn: _ref => {
973
+ let {
974
+ x,
975
+ y
976
+ } = _ref;
977
+ return {
978
+ x,
979
+ y
980
+ };
981
+ }
982
+ },
983
+ ...detectOverflowOptions
984
+ } = evaluate(options, state);
985
+ const coords = {
986
+ x,
987
+ y
988
+ };
989
+ const overflow = await detectOverflow(state, detectOverflowOptions);
990
+ const crossAxis = getSideAxis(getSide(placement));
991
+ const mainAxis = getOppositeAxis(crossAxis);
992
+ let mainAxisCoord = coords[mainAxis];
993
+ let crossAxisCoord = coords[crossAxis];
994
+ if (checkMainAxis) {
995
+ const minSide = mainAxis === 'y' ? 'top' : 'left';
996
+ const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
997
+ const min = mainAxisCoord + overflow[minSide];
998
+ const max = mainAxisCoord - overflow[maxSide];
999
+ mainAxisCoord = clamp(min, mainAxisCoord, max);
1000
+ }
1001
+ if (checkCrossAxis) {
1002
+ const minSide = crossAxis === 'y' ? 'top' : 'left';
1003
+ const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
1004
+ const min = crossAxisCoord + overflow[minSide];
1005
+ const max = crossAxisCoord - overflow[maxSide];
1006
+ crossAxisCoord = clamp(min, crossAxisCoord, max);
1007
+ }
1008
+ const limitedCoords = limiter.fn({
1009
+ ...state,
1010
+ [mainAxis]: mainAxisCoord,
1011
+ [crossAxis]: crossAxisCoord
1012
+ });
1013
+ return {
1014
+ ...limitedCoords,
1015
+ data: {
1016
+ x: limitedCoords.x - x,
1017
+ y: limitedCoords.y - y,
1018
+ enabled: {
1019
+ [mainAxis]: checkMainAxis,
1020
+ [crossAxis]: checkCrossAxis
1021
+ }
1022
+ }
1023
+ };
1024
+ }
1025
+ };
1026
+ };
1027
+ /**
1028
+ * Built-in `limiter` that will stop `shift()` at a certain point.
1029
+ */
1030
+ const limitShift = function (options) {
1031
+ if (options === void 0) {
1032
+ options = {};
1033
+ }
1034
+ return {
1035
+ options,
1036
+ fn(state) {
1037
+ const {
1038
+ x,
1039
+ y,
1040
+ placement,
1041
+ rects,
1042
+ middlewareData
1043
+ } = state;
1044
+ const {
1045
+ offset = 0,
1046
+ mainAxis: checkMainAxis = true,
1047
+ crossAxis: checkCrossAxis = true
1048
+ } = evaluate(options, state);
1049
+ const coords = {
1050
+ x,
1051
+ y
1052
+ };
1053
+ const crossAxis = getSideAxis(placement);
1054
+ const mainAxis = getOppositeAxis(crossAxis);
1055
+ let mainAxisCoord = coords[mainAxis];
1056
+ let crossAxisCoord = coords[crossAxis];
1057
+ const rawOffset = evaluate(offset, state);
1058
+ const computedOffset = typeof rawOffset === 'number' ? {
1059
+ mainAxis: rawOffset,
1060
+ crossAxis: 0
1061
+ } : {
1062
+ mainAxis: 0,
1063
+ crossAxis: 0,
1064
+ ...rawOffset
1065
+ };
1066
+ if (checkMainAxis) {
1067
+ const len = mainAxis === 'y' ? 'height' : 'width';
1068
+ const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
1069
+ const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
1070
+ if (mainAxisCoord < limitMin) {
1071
+ mainAxisCoord = limitMin;
1072
+ } else if (mainAxisCoord > limitMax) {
1073
+ mainAxisCoord = limitMax;
1074
+ }
1075
+ }
1076
+ if (checkCrossAxis) {
1077
+ var _middlewareData$offse, _middlewareData$offse2;
1078
+ const len = mainAxis === 'y' ? 'width' : 'height';
1079
+ const isOriginSide = ['top', 'left'].includes(getSide(placement));
1080
+ const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
1081
+ const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
1082
+ if (crossAxisCoord < limitMin) {
1083
+ crossAxisCoord = limitMin;
1084
+ } else if (crossAxisCoord > limitMax) {
1085
+ crossAxisCoord = limitMax;
1086
+ }
1087
+ }
1088
+ return {
1089
+ [mainAxis]: mainAxisCoord,
1090
+ [crossAxis]: crossAxisCoord
1091
+ };
1092
+ }
1093
+ };
1094
+ };
1095
+
1096
+ /**
1097
+ * Provides data that allows you to change the size of the floating element —
1098
+ * for instance, prevent it from overflowing the clipping boundary or match the
1099
+ * width of the reference element.
1100
+ * @see https://floating-ui.com/docs/size
1101
+ */
1102
+ const size = function (options) {
1103
+ if (options === void 0) {
1104
+ options = {};
1105
+ }
1106
+ return {
1107
+ name: 'size',
1108
+ options,
1109
+ async fn(state) {
1110
+ var _state$middlewareData, _state$middlewareData2;
1111
+ const {
1112
+ placement,
1113
+ rects,
1114
+ platform,
1115
+ elements
1116
+ } = state;
1117
+ const {
1118
+ apply = () => {},
1119
+ ...detectOverflowOptions
1120
+ } = evaluate(options, state);
1121
+ const overflow = await detectOverflow(state, detectOverflowOptions);
1122
+ const side = getSide(placement);
1123
+ const alignment = getAlignment(placement);
1124
+ const isYAxis = getSideAxis(placement) === 'y';
1125
+ const {
1126
+ width,
1127
+ height
1128
+ } = rects.floating;
1129
+ let heightSide;
1130
+ let widthSide;
1131
+ if (side === 'top' || side === 'bottom') {
1132
+ heightSide = side;
1133
+ widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';
1134
+ } else {
1135
+ widthSide = side;
1136
+ heightSide = alignment === 'end' ? 'top' : 'bottom';
1137
+ }
1138
+ const maximumClippingHeight = height - overflow.top - overflow.bottom;
1139
+ const maximumClippingWidth = width - overflow.left - overflow.right;
1140
+ const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
1141
+ const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
1142
+ const noShift = !state.middlewareData.shift;
1143
+ let availableHeight = overflowAvailableHeight;
1144
+ let availableWidth = overflowAvailableWidth;
1145
+ if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {
1146
+ availableWidth = maximumClippingWidth;
1147
+ }
1148
+ if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {
1149
+ availableHeight = maximumClippingHeight;
1150
+ }
1151
+ if (noShift && !alignment) {
1152
+ const xMin = max(overflow.left, 0);
1153
+ const xMax = max(overflow.right, 0);
1154
+ const yMin = max(overflow.top, 0);
1155
+ const yMax = max(overflow.bottom, 0);
1156
+ if (isYAxis) {
1157
+ availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
1158
+ } else {
1159
+ availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
1160
+ }
1161
+ }
1162
+ await apply({
1163
+ ...state,
1164
+ availableWidth,
1165
+ availableHeight
1166
+ });
1167
+ const nextDimensions = await platform.getDimensions(elements.floating);
1168
+ if (width !== nextDimensions.width || height !== nextDimensions.height) {
1169
+ return {
1170
+ reset: {
1171
+ rects: true
1172
+ }
1173
+ };
1174
+ }
1175
+ return {};
1176
+ }
1177
+ };
1178
+ };
1179
+
1180
+ function hasWindow() {
1181
+ return typeof window !== 'undefined';
1182
+ }
1183
+ function getNodeName(node) {
1184
+ if (isNode(node)) {
1185
+ return (node.nodeName || '').toLowerCase();
1186
+ }
1187
+ // Mocked nodes in testing environments may not be instances of Node. By
1188
+ // returning `#document` an infinite loop won't occur.
1189
+ // https://github.com/floating-ui/floating-ui/issues/2317
1190
+ return '#document';
1191
+ }
1192
+ function getWindow(node) {
1193
+ var _node$ownerDocument;
1194
+ return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
1195
+ }
1196
+ function getDocumentElement(node) {
1197
+ var _ref;
1198
+ return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
1199
+ }
1200
+ function isNode(value) {
1201
+ if (!hasWindow()) {
1202
+ return false;
1203
+ }
1204
+ return value instanceof Node || value instanceof getWindow(value).Node;
1205
+ }
1206
+ function isElement(value) {
1207
+ if (!hasWindow()) {
1208
+ return false;
1209
+ }
1210
+ return value instanceof Element || value instanceof getWindow(value).Element;
1211
+ }
1212
+ function isHTMLElement(value) {
1213
+ if (!hasWindow()) {
1214
+ return false;
1215
+ }
1216
+ return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
1217
+ }
1218
+ function isShadowRoot(value) {
1219
+ if (!hasWindow() || typeof ShadowRoot === 'undefined') {
1220
+ return false;
1221
+ }
1222
+ return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
1223
+ }
1224
+ function isOverflowElement(element) {
1225
+ const {
1226
+ overflow,
1227
+ overflowX,
1228
+ overflowY,
1229
+ display
1230
+ } = getComputedStyle(element);
1231
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
1232
+ }
1233
+ function isTableElement(element) {
1234
+ return ['table', 'td', 'th'].includes(getNodeName(element));
1235
+ }
1236
+ function isTopLayer(element) {
1237
+ return [':popover-open', ':modal'].some(selector => {
1238
+ try {
1239
+ return element.matches(selector);
1240
+ } catch (e) {
1241
+ return false;
1242
+ }
1243
+ });
1244
+ }
1245
+ function isContainingBlock(elementOrCss) {
1246
+ const webkit = isWebKit();
1247
+ const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
1248
+
1249
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
1250
+ // https://drafts.csswg.org/css-transforms-2/#individual-transforms
1251
+ return ['transform', 'translate', 'scale', 'rotate', 'perspective'].some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
1252
+ }
1253
+ function getContainingBlock(element) {
1254
+ let currentNode = getParentNode(element);
1255
+ while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
1256
+ if (isContainingBlock(currentNode)) {
1257
+ return currentNode;
1258
+ } else if (isTopLayer(currentNode)) {
1259
+ return null;
1260
+ }
1261
+ currentNode = getParentNode(currentNode);
1262
+ }
1263
+ return null;
1264
+ }
1265
+ function isWebKit() {
1266
+ if (typeof CSS === 'undefined' || !CSS.supports) return false;
1267
+ return CSS.supports('-webkit-backdrop-filter', 'none');
1268
+ }
1269
+ function isLastTraversableNode(node) {
1270
+ return ['html', 'body', '#document'].includes(getNodeName(node));
1271
+ }
1272
+ function getComputedStyle(element) {
1273
+ return getWindow(element).getComputedStyle(element);
1274
+ }
1275
+ function getNodeScroll(element) {
1276
+ if (isElement(element)) {
1277
+ return {
1278
+ scrollLeft: element.scrollLeft,
1279
+ scrollTop: element.scrollTop
1280
+ };
1281
+ }
1282
+ return {
1283
+ scrollLeft: element.scrollX,
1284
+ scrollTop: element.scrollY
1285
+ };
1286
+ }
1287
+ function getParentNode(node) {
1288
+ if (getNodeName(node) === 'html') {
1289
+ return node;
1290
+ }
1291
+ const result =
1292
+ // Step into the shadow DOM of the parent of a slotted node.
1293
+ node.assignedSlot ||
1294
+ // DOM Element detected.
1295
+ node.parentNode ||
1296
+ // ShadowRoot detected.
1297
+ isShadowRoot(node) && node.host ||
1298
+ // Fallback.
1299
+ getDocumentElement(node);
1300
+ return isShadowRoot(result) ? result.host : result;
1301
+ }
1302
+ function getNearestOverflowAncestor(node) {
1303
+ const parentNode = getParentNode(node);
1304
+ if (isLastTraversableNode(parentNode)) {
1305
+ return node.ownerDocument ? node.ownerDocument.body : node.body;
1306
+ }
1307
+ if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
1308
+ return parentNode;
1309
+ }
1310
+ return getNearestOverflowAncestor(parentNode);
1311
+ }
1312
+ function getOverflowAncestors(node, list, traverseIframes) {
1313
+ var _node$ownerDocument2;
1314
+ if (list === void 0) {
1315
+ list = [];
1316
+ }
1317
+ if (traverseIframes === void 0) {
1318
+ traverseIframes = true;
1319
+ }
1320
+ const scrollableAncestor = getNearestOverflowAncestor(node);
1321
+ const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
1322
+ const win = getWindow(scrollableAncestor);
1323
+ if (isBody) {
1324
+ const frameElement = getFrameElement(win);
1325
+ return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
1326
+ }
1327
+ return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
1328
+ }
1329
+ function getFrameElement(win) {
1330
+ return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
1331
+ }
1332
+
1333
+ function getCssDimensions(element) {
1334
+ const css = getComputedStyle(element);
1335
+ // In testing environments, the `width` and `height` properties are empty
1336
+ // strings for SVG elements, returning NaN. Fallback to `0` in this case.
1337
+ let width = parseFloat(css.width) || 0;
1338
+ let height = parseFloat(css.height) || 0;
1339
+ const hasOffset = isHTMLElement(element);
1340
+ const offsetWidth = hasOffset ? element.offsetWidth : width;
1341
+ const offsetHeight = hasOffset ? element.offsetHeight : height;
1342
+ const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
1343
+ if (shouldFallback) {
1344
+ width = offsetWidth;
1345
+ height = offsetHeight;
1346
+ }
1347
+ return {
1348
+ width,
1349
+ height,
1350
+ $: shouldFallback
1351
+ };
1352
+ }
1353
+
1354
+ function unwrapElement(element) {
1355
+ return !isElement(element) ? element.contextElement : element;
1356
+ }
1357
+
1358
+ function getScale(element) {
1359
+ const domElement = unwrapElement(element);
1360
+ if (!isHTMLElement(domElement)) {
1361
+ return createCoords(1);
1362
+ }
1363
+ const rect = domElement.getBoundingClientRect();
1364
+ const {
1365
+ width,
1366
+ height,
1367
+ $
1368
+ } = getCssDimensions(domElement);
1369
+ let x = ($ ? round(rect.width) : rect.width) / width;
1370
+ let y = ($ ? round(rect.height) : rect.height) / height;
1371
+
1372
+ // 0, NaN, or Infinity should always fallback to 1.
1373
+
1374
+ if (!x || !Number.isFinite(x)) {
1375
+ x = 1;
1376
+ }
1377
+ if (!y || !Number.isFinite(y)) {
1378
+ y = 1;
1379
+ }
1380
+ return {
1381
+ x,
1382
+ y
1383
+ };
1384
+ }
1385
+
1386
+ const noOffsets = /*#__PURE__*/createCoords(0);
1387
+ function getVisualOffsets(element) {
1388
+ const win = getWindow(element);
1389
+ if (!isWebKit() || !win.visualViewport) {
1390
+ return noOffsets;
1391
+ }
1392
+ return {
1393
+ x: win.visualViewport.offsetLeft,
1394
+ y: win.visualViewport.offsetTop
1395
+ };
1396
+ }
1397
+ function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
1398
+ if (isFixed === void 0) {
1399
+ isFixed = false;
1400
+ }
1401
+ if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
1402
+ return false;
1403
+ }
1404
+ return isFixed;
1405
+ }
1406
+
1407
+ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
1408
+ if (includeScale === void 0) {
1409
+ includeScale = false;
1410
+ }
1411
+ if (isFixedStrategy === void 0) {
1412
+ isFixedStrategy = false;
1413
+ }
1414
+ const clientRect = element.getBoundingClientRect();
1415
+ const domElement = unwrapElement(element);
1416
+ let scale = createCoords(1);
1417
+ if (includeScale) {
1418
+ if (offsetParent) {
1419
+ if (isElement(offsetParent)) {
1420
+ scale = getScale(offsetParent);
1421
+ }
1422
+ } else {
1423
+ scale = getScale(element);
1424
+ }
1425
+ }
1426
+ const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
1427
+ let x = (clientRect.left + visualOffsets.x) / scale.x;
1428
+ let y = (clientRect.top + visualOffsets.y) / scale.y;
1429
+ let width = clientRect.width / scale.x;
1430
+ let height = clientRect.height / scale.y;
1431
+ if (domElement) {
1432
+ const win = getWindow(domElement);
1433
+ const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
1434
+ let currentWin = win;
1435
+ let currentIFrame = getFrameElement(currentWin);
1436
+ while (currentIFrame && offsetParent && offsetWin !== currentWin) {
1437
+ const iframeScale = getScale(currentIFrame);
1438
+ const iframeRect = currentIFrame.getBoundingClientRect();
1439
+ const css = getComputedStyle(currentIFrame);
1440
+ const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
1441
+ const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
1442
+ x *= iframeScale.x;
1443
+ y *= iframeScale.y;
1444
+ width *= iframeScale.x;
1445
+ height *= iframeScale.y;
1446
+ x += left;
1447
+ y += top;
1448
+ currentWin = getWindow(currentIFrame);
1449
+ currentIFrame = getFrameElement(currentWin);
1450
+ }
1451
+ }
1452
+ return rectToClientRect({
1453
+ width,
1454
+ height,
1455
+ x,
1456
+ y
1457
+ });
1458
+ }
1459
+
1460
+ // If <html> has a CSS width greater than the viewport, then this will be
1461
+ // incorrect for RTL.
1462
+ function getWindowScrollBarX(element, rect) {
1463
+ const leftScroll = getNodeScroll(element).scrollLeft;
1464
+ if (!rect) {
1465
+ return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
1466
+ }
1467
+ return rect.left + leftScroll;
1468
+ }
1469
+
1470
+ function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
1471
+ if (ignoreScrollbarX === void 0) {
1472
+ ignoreScrollbarX = false;
1473
+ }
1474
+ const htmlRect = documentElement.getBoundingClientRect();
1475
+ const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 :
1476
+ // RTL <body> scrollbar.
1477
+ getWindowScrollBarX(documentElement, htmlRect));
1478
+ const y = htmlRect.top + scroll.scrollTop;
1479
+ return {
1480
+ x,
1481
+ y
1482
+ };
1483
+ }
1484
+
1485
+ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
1486
+ let {
1487
+ elements,
1488
+ rect,
1489
+ offsetParent,
1490
+ strategy
1491
+ } = _ref;
1492
+ const isFixed = strategy === 'fixed';
1493
+ const documentElement = getDocumentElement(offsetParent);
1494
+ const topLayer = elements ? isTopLayer(elements.floating) : false;
1495
+ if (offsetParent === documentElement || topLayer && isFixed) {
1496
+ return rect;
1497
+ }
1498
+ let scroll = {
1499
+ scrollLeft: 0,
1500
+ scrollTop: 0
1501
+ };
1502
+ let scale = createCoords(1);
1503
+ const offsets = createCoords(0);
1504
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
1505
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1506
+ if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
1507
+ scroll = getNodeScroll(offsetParent);
1508
+ }
1509
+ if (isHTMLElement(offsetParent)) {
1510
+ const offsetRect = getBoundingClientRect(offsetParent);
1511
+ scale = getScale(offsetParent);
1512
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
1513
+ offsets.y = offsetRect.y + offsetParent.clientTop;
1514
+ }
1515
+ }
1516
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);
1517
+ return {
1518
+ width: rect.width * scale.x,
1519
+ height: rect.height * scale.y,
1520
+ x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
1521
+ y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
1522
+ };
1523
+ }
1524
+
1525
+ function getClientRects(element) {
1526
+ return Array.from(element.getClientRects());
1527
+ }
1528
+
1529
+ // Gets the entire size of the scrollable document area, even extending outside
1530
+ // of the `<html>` and `<body>` rect bounds if horizontally scrollable.
1531
+ function getDocumentRect(element) {
1532
+ const html = getDocumentElement(element);
1533
+ const scroll = getNodeScroll(element);
1534
+ const body = element.ownerDocument.body;
1535
+ const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
1536
+ const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
1537
+ let x = -scroll.scrollLeft + getWindowScrollBarX(element);
1538
+ const y = -scroll.scrollTop;
1539
+ if (getComputedStyle(body).direction === 'rtl') {
1540
+ x += max(html.clientWidth, body.clientWidth) - width;
1541
+ }
1542
+ return {
1543
+ width,
1544
+ height,
1545
+ x,
1546
+ y
1547
+ };
1548
+ }
1549
+
1550
+ function getViewportRect(element, strategy) {
1551
+ const win = getWindow(element);
1552
+ const html = getDocumentElement(element);
1553
+ const visualViewport = win.visualViewport;
1554
+ let width = html.clientWidth;
1555
+ let height = html.clientHeight;
1556
+ let x = 0;
1557
+ let y = 0;
1558
+ if (visualViewport) {
1559
+ width = visualViewport.width;
1560
+ height = visualViewport.height;
1561
+ const visualViewportBased = isWebKit();
1562
+ if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
1563
+ x = visualViewport.offsetLeft;
1564
+ y = visualViewport.offsetTop;
1565
+ }
1566
+ }
1567
+ return {
1568
+ width,
1569
+ height,
1570
+ x,
1571
+ y
1572
+ };
1573
+ }
1574
+
1575
+ // Returns the inner client rect, subtracting scrollbars if present.
1576
+ function getInnerBoundingClientRect(element, strategy) {
1577
+ const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
1578
+ const top = clientRect.top + element.clientTop;
1579
+ const left = clientRect.left + element.clientLeft;
1580
+ const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
1581
+ const width = element.clientWidth * scale.x;
1582
+ const height = element.clientHeight * scale.y;
1583
+ const x = left * scale.x;
1584
+ const y = top * scale.y;
1585
+ return {
1586
+ width,
1587
+ height,
1588
+ x,
1589
+ y
1590
+ };
1591
+ }
1592
+ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
1593
+ let rect;
1594
+ if (clippingAncestor === 'viewport') {
1595
+ rect = getViewportRect(element, strategy);
1596
+ } else if (clippingAncestor === 'document') {
1597
+ rect = getDocumentRect(getDocumentElement(element));
1598
+ } else if (isElement(clippingAncestor)) {
1599
+ rect = getInnerBoundingClientRect(clippingAncestor, strategy);
1600
+ } else {
1601
+ const visualOffsets = getVisualOffsets(element);
1602
+ rect = {
1603
+ x: clippingAncestor.x - visualOffsets.x,
1604
+ y: clippingAncestor.y - visualOffsets.y,
1605
+ width: clippingAncestor.width,
1606
+ height: clippingAncestor.height
1607
+ };
1608
+ }
1609
+ return rectToClientRect(rect);
1610
+ }
1611
+ function hasFixedPositionAncestor(element, stopNode) {
1612
+ const parentNode = getParentNode(element);
1613
+ if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
1614
+ return false;
1615
+ }
1616
+ return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
1617
+ }
1618
+
1619
+ // A "clipping ancestor" is an `overflow` element with the characteristic of
1620
+ // clipping (or hiding) child elements. This returns all clipping ancestors
1621
+ // of the given element up the tree.
1622
+ function getClippingElementAncestors(element, cache) {
1623
+ const cachedResult = cache.get(element);
1624
+ if (cachedResult) {
1625
+ return cachedResult;
1626
+ }
1627
+ let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
1628
+ let currentContainingBlockComputedStyle = null;
1629
+ const elementIsFixed = getComputedStyle(element).position === 'fixed';
1630
+ let currentNode = elementIsFixed ? getParentNode(element) : element;
1631
+
1632
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
1633
+ while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
1634
+ const computedStyle = getComputedStyle(currentNode);
1635
+ const currentNodeIsContaining = isContainingBlock(currentNode);
1636
+ if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
1637
+ currentContainingBlockComputedStyle = null;
1638
+ }
1639
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
1640
+ if (shouldDropCurrentNode) {
1641
+ // Drop non-containing blocks.
1642
+ result = result.filter(ancestor => ancestor !== currentNode);
1643
+ } else {
1644
+ // Record last containing block for next iteration.
1645
+ currentContainingBlockComputedStyle = computedStyle;
1646
+ }
1647
+ currentNode = getParentNode(currentNode);
1648
+ }
1649
+ cache.set(element, result);
1650
+ return result;
1651
+ }
1652
+
1653
+ // Gets the maximum area that the element is visible in due to any number of
1654
+ // clipping ancestors.
1655
+ function getClippingRect(_ref) {
1656
+ let {
1657
+ element,
1658
+ boundary,
1659
+ rootBoundary,
1660
+ strategy
1661
+ } = _ref;
1662
+ const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
1663
+ const clippingAncestors = [...elementClippingAncestors, rootBoundary];
1664
+ const firstClippingAncestor = clippingAncestors[0];
1665
+ const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
1666
+ const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
1667
+ accRect.top = max(rect.top, accRect.top);
1668
+ accRect.right = min(rect.right, accRect.right);
1669
+ accRect.bottom = min(rect.bottom, accRect.bottom);
1670
+ accRect.left = max(rect.left, accRect.left);
1671
+ return accRect;
1672
+ }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
1673
+ return {
1674
+ width: clippingRect.right - clippingRect.left,
1675
+ height: clippingRect.bottom - clippingRect.top,
1676
+ x: clippingRect.left,
1677
+ y: clippingRect.top
1678
+ };
1679
+ }
1680
+
1681
+ function getDimensions(element) {
1682
+ const {
1683
+ width,
1684
+ height
1685
+ } = getCssDimensions(element);
1686
+ return {
1687
+ width,
1688
+ height
1689
+ };
1690
+ }
1691
+
1692
+ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
1693
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
1694
+ const documentElement = getDocumentElement(offsetParent);
1695
+ const isFixed = strategy === 'fixed';
1696
+ const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
1697
+ let scroll = {
1698
+ scrollLeft: 0,
1699
+ scrollTop: 0
1700
+ };
1701
+ const offsets = createCoords(0);
1702
+
1703
+ // If the <body> scrollbar appears on the left (e.g. RTL systems). Use
1704
+ // Firefox with layout.scrollbar.side = 3 in about:config to test this.
1705
+ function setLeftRTLScrollbarOffset() {
1706
+ offsets.x = getWindowScrollBarX(documentElement);
1707
+ }
1708
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1709
+ if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
1710
+ scroll = getNodeScroll(offsetParent);
1711
+ }
1712
+ if (isOffsetParentAnElement) {
1713
+ const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
1714
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
1715
+ offsets.y = offsetRect.y + offsetParent.clientTop;
1716
+ } else if (documentElement) {
1717
+ setLeftRTLScrollbarOffset();
1718
+ }
1719
+ }
1720
+ if (isFixed && !isOffsetParentAnElement && documentElement) {
1721
+ setLeftRTLScrollbarOffset();
1722
+ }
1723
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
1724
+ const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
1725
+ const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
1726
+ return {
1727
+ x,
1728
+ y,
1729
+ width: rect.width,
1730
+ height: rect.height
1731
+ };
1732
+ }
1733
+
1734
+ function isStaticPositioned(element) {
1735
+ return getComputedStyle(element).position === 'static';
1736
+ }
1737
+
1738
+ function getTrueOffsetParent(element, polyfill) {
1739
+ if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
1740
+ return null;
1741
+ }
1742
+ if (polyfill) {
1743
+ return polyfill(element);
1744
+ }
1745
+ let rawOffsetParent = element.offsetParent;
1746
+
1747
+ // Firefox returns the <html> element as the offsetParent if it's non-static,
1748
+ // while Chrome and Safari return the <body> element. The <body> element must
1749
+ // be used to perform the correct calculations even if the <html> element is
1750
+ // non-static.
1751
+ if (getDocumentElement(element) === rawOffsetParent) {
1752
+ rawOffsetParent = rawOffsetParent.ownerDocument.body;
1753
+ }
1754
+ return rawOffsetParent;
1755
+ }
1756
+
1757
+ // Gets the closest ancestor positioned element. Handles some edge cases,
1758
+ // such as table ancestors and cross browser bugs.
1759
+ function getOffsetParent(element, polyfill) {
1760
+ const win = getWindow(element);
1761
+ if (isTopLayer(element)) {
1762
+ return win;
1763
+ }
1764
+ if (!isHTMLElement(element)) {
1765
+ let svgOffsetParent = getParentNode(element);
1766
+ while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
1767
+ if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
1768
+ return svgOffsetParent;
1769
+ }
1770
+ svgOffsetParent = getParentNode(svgOffsetParent);
1771
+ }
1772
+ return win;
1773
+ }
1774
+ let offsetParent = getTrueOffsetParent(element, polyfill);
1775
+ while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
1776
+ offsetParent = getTrueOffsetParent(offsetParent, polyfill);
1777
+ }
1778
+ if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
1779
+ return win;
1780
+ }
1781
+ return offsetParent || getContainingBlock(element) || win;
1782
+ }
1783
+
1784
+ const getElementRects = async function (data) {
1785
+ const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
1786
+ const getDimensionsFn = this.getDimensions;
1787
+ const floatingDimensions = await getDimensionsFn(data.floating);
1788
+ return {
1789
+ reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
1790
+ floating: {
1791
+ x: 0,
1792
+ y: 0,
1793
+ width: floatingDimensions.width,
1794
+ height: floatingDimensions.height
1795
+ }
1796
+ };
1797
+ };
1798
+
1799
+ function isRTL(element) {
1800
+ return getComputedStyle(element).direction === 'rtl';
1801
+ }
1802
+
1803
+ const platform = {
1804
+ convertOffsetParentRelativeRectToViewportRelativeRect,
1805
+ getDocumentElement,
1806
+ getClippingRect,
1807
+ getOffsetParent,
1808
+ getElementRects,
1809
+ getClientRects,
1810
+ getDimensions,
1811
+ getScale,
1812
+ isElement,
1813
+ isRTL
1814
+ };
1815
+
1816
+ function rectsAreEqual(a, b) {
1817
+ return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
1818
+ }
1819
+
1820
+ // https://samthor.au/2021/observing-dom/
1821
+ function observeMove(element, onMove) {
1822
+ let io = null;
1823
+ let timeoutId;
1824
+ const root = getDocumentElement(element);
1825
+ function cleanup() {
1826
+ var _io;
1827
+ clearTimeout(timeoutId);
1828
+ (_io = io) == null || _io.disconnect();
1829
+ io = null;
1830
+ }
1831
+ function refresh(skip, threshold) {
1832
+ if (skip === void 0) {
1833
+ skip = false;
1834
+ }
1835
+ if (threshold === void 0) {
1836
+ threshold = 1;
1837
+ }
1838
+ cleanup();
1839
+ const elementRectForRootMargin = element.getBoundingClientRect();
1840
+ const {
1841
+ left,
1842
+ top,
1843
+ width,
1844
+ height
1845
+ } = elementRectForRootMargin;
1846
+ if (!skip) {
1847
+ onMove();
1848
+ }
1849
+ if (!width || !height) {
1850
+ return;
1851
+ }
1852
+ const insetTop = floor(top);
1853
+ const insetRight = floor(root.clientWidth - (left + width));
1854
+ const insetBottom = floor(root.clientHeight - (top + height));
1855
+ const insetLeft = floor(left);
1856
+ const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
1857
+ const options = {
1858
+ rootMargin,
1859
+ threshold: max(0, min(1, threshold)) || 1
1860
+ };
1861
+ let isFirstUpdate = true;
1862
+ function handleObserve(entries) {
1863
+ const ratio = entries[0].intersectionRatio;
1864
+ if (ratio !== threshold) {
1865
+ if (!isFirstUpdate) {
1866
+ return refresh();
1867
+ }
1868
+ if (!ratio) {
1869
+ // If the reference is clipped, the ratio is 0. Throttle the refresh
1870
+ // to prevent an infinite loop of updates.
1871
+ timeoutId = setTimeout(() => {
1872
+ refresh(false, 1e-7);
1873
+ }, 1000);
1874
+ } else {
1875
+ refresh(false, ratio);
1876
+ }
1877
+ }
1878
+ if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
1879
+ // It's possible that even though the ratio is reported as 1, the
1880
+ // element is not actually fully within the IntersectionObserver's root
1881
+ // area anymore. This can happen under performance constraints. This may
1882
+ // be a bug in the browser's IntersectionObserver implementation. To
1883
+ // work around this, we compare the element's bounding rect now with
1884
+ // what it was at the time we created the IntersectionObserver. If they
1885
+ // are not equal then the element moved, so we refresh.
1886
+ refresh();
1887
+ }
1888
+ isFirstUpdate = false;
1889
+ }
1890
+
1891
+ // Older browsers don't support a `document` as the root and will throw an
1892
+ // error.
1893
+ try {
1894
+ io = new IntersectionObserver(handleObserve, {
1895
+ ...options,
1896
+ // Handle <iframe>s
1897
+ root: root.ownerDocument
1898
+ });
1899
+ } catch (_e) {
1900
+ io = new IntersectionObserver(handleObserve, options);
1901
+ }
1902
+ io.observe(element);
1903
+ }
1904
+ refresh(true);
1905
+ return cleanup;
1906
+ }
1907
+
1908
+ /**
1909
+ * Automatically updates the position of the floating element when necessary.
1910
+ * Should only be called when the floating element is mounted on the DOM or
1911
+ * visible on the screen.
1912
+ * @returns cleanup function that should be invoked when the floating element is
1913
+ * removed from the DOM or hidden from the screen.
1914
+ * @see https://floating-ui.com/docs/autoUpdate
1915
+ */
1916
+ function autoUpdate(reference, floating, update, options) {
1917
+ if (options === void 0) {
1918
+ options = {};
1919
+ }
1920
+ const {
1921
+ ancestorScroll = true,
1922
+ ancestorResize = true,
1923
+ elementResize = typeof ResizeObserver === 'function',
1924
+ layoutShift = typeof IntersectionObserver === 'function',
1925
+ animationFrame = false
1926
+ } = options;
1927
+ const referenceEl = unwrapElement(reference);
1928
+ const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];
1929
+ ancestors.forEach(ancestor => {
1930
+ ancestorScroll && ancestor.addEventListener('scroll', update, {
1931
+ passive: true
1932
+ });
1933
+ ancestorResize && ancestor.addEventListener('resize', update);
1934
+ });
1935
+ const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
1936
+ let reobserveFrame = -1;
1937
+ let resizeObserver = null;
1938
+ if (elementResize) {
1939
+ resizeObserver = new ResizeObserver(_ref => {
1940
+ let [firstEntry] = _ref;
1941
+ if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
1942
+ // Prevent update loops when using the `size` middleware.
1943
+ // https://github.com/floating-ui/floating-ui/issues/1740
1944
+ resizeObserver.unobserve(floating);
1945
+ cancelAnimationFrame(reobserveFrame);
1946
+ reobserveFrame = requestAnimationFrame(() => {
1947
+ var _resizeObserver;
1948
+ (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
1949
+ });
1950
+ }
1951
+ update();
1952
+ });
1953
+ if (referenceEl && !animationFrame) {
1954
+ resizeObserver.observe(referenceEl);
1955
+ }
1956
+ resizeObserver.observe(floating);
1957
+ }
1958
+ let frameId;
1959
+ let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
1960
+ if (animationFrame) {
1961
+ frameLoop();
1962
+ }
1963
+ function frameLoop() {
1964
+ const nextRefRect = getBoundingClientRect(reference);
1965
+ if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
1966
+ update();
1967
+ }
1968
+ prevRefRect = nextRefRect;
1969
+ frameId = requestAnimationFrame(frameLoop);
1970
+ }
1971
+ update();
1972
+ return () => {
1973
+ var _resizeObserver2;
1974
+ ancestors.forEach(ancestor => {
1975
+ ancestorScroll && ancestor.removeEventListener('scroll', update);
1976
+ ancestorResize && ancestor.removeEventListener('resize', update);
1977
+ });
1978
+ cleanupIo == null || cleanupIo();
1979
+ (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
1980
+ resizeObserver = null;
1981
+ if (animationFrame) {
1982
+ cancelAnimationFrame(frameId);
1983
+ }
1984
+ };
1985
+ }
1986
+
1987
+ /**
1988
+ * Modifies the placement by translating the floating element along the
1989
+ * specified axes.
1990
+ * A number (shorthand for `mainAxis` or distance), or an axes configuration
1991
+ * object may be passed.
1992
+ * @see https://floating-ui.com/docs/offset
1993
+ */
1994
+ const offset = offset$1;
1995
+
1996
+ /**
1997
+ * Optimizes the visibility of the floating element by choosing the placement
1998
+ * that has the most space available automatically, without needing to specify a
1999
+ * preferred placement. Alternative to `flip`.
2000
+ * @see https://floating-ui.com/docs/autoPlacement
2001
+ */
2002
+ autoPlacement;
2003
+
2004
+ /**
2005
+ * Optimizes the visibility of the floating element by shifting it in order to
2006
+ * keep it in view when it will overflow the clipping boundary.
2007
+ * @see https://floating-ui.com/docs/shift
2008
+ */
2009
+ const shift = shift$1;
2010
+
2011
+ /**
2012
+ * Optimizes the visibility of the floating element by flipping the `placement`
2013
+ * in order to keep it in view when the preferred placement(s) will overflow the
2014
+ * clipping boundary. Alternative to `autoPlacement`.
2015
+ * @see https://floating-ui.com/docs/flip
2016
+ */
2017
+ const flip = flip$1;
2018
+
2019
+ /**
2020
+ * Provides data that allows you to change the size of the floating element —
2021
+ * for instance, prevent it from overflowing the clipping boundary or match the
2022
+ * width of the reference element.
2023
+ * @see https://floating-ui.com/docs/size
2024
+ */
2025
+ size;
2026
+
2027
+ /**
2028
+ * Provides data to hide the floating element in applicable situations, such as
2029
+ * when it is not in the same clipping context as the reference element.
2030
+ * @see https://floating-ui.com/docs/hide
2031
+ */
2032
+ hide;
2033
+
2034
+ /**
2035
+ * Provides data to position an inner element of the floating element so that it
2036
+ * appears centered to the reference element.
2037
+ * @see https://floating-ui.com/docs/arrow
2038
+ */
2039
+ const arrow = arrow$1;
2040
+
2041
+ /**
2042
+ * Provides improved positioning for inline reference elements that can span
2043
+ * over multiple lines, such as hyperlinks or range selections.
2044
+ * @see https://floating-ui.com/docs/inline
2045
+ */
2046
+ inline;
2047
+
2048
+ /**
2049
+ * Built-in `limiter` that will stop `shift()` at a certain point.
2050
+ */
2051
+ limitShift;
2052
+
2053
+ /**
2054
+ * Computes the `x` and `y` coordinates that will place the floating element
2055
+ * next to a given reference element.
2056
+ */
2057
+ const computePosition = (reference, floating, options) => {
2058
+ // This caches the expensive `getClippingElementAncestors` function so that
2059
+ // multiple lifecycle resets re-use the same result. It only lives for a
2060
+ // single call. If other functions become expensive, we can add them as well.
2061
+ const cache = new Map();
2062
+ const mergedOptions = {
2063
+ platform,
2064
+ ...options
2065
+ };
2066
+ const platformWithCache = {
2067
+ ...mergedOptions.platform,
2068
+ _c: cache
2069
+ };
2070
+ return computePosition$1(reference, floating, {
2071
+ ...mergedOptions,
2072
+ platform: platformWithCache
2073
+ });
2074
+ };
2075
+
2076
+ export { arrow as a, autoUpdate as b, computePosition as c, flip as f, offset as o, shift as s };
2077
+
2078
+ //# sourceMappingURL=p-9594cebb.js.map