@jobber/components 6.123.0 → 6.123.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/dist/AtlantisThemeContext-cjs.js +1 -1
  2. package/dist/AtlantisThemeContext-es.js +9 -9
  3. package/dist/Autocomplete/Autocomplete.types.d.ts +33 -0
  4. package/dist/Autocomplete/index.cjs +5 -5
  5. package/dist/Autocomplete/index.mjs +8 -8
  6. package/dist/Autocomplete/useAutocomplete.d.ts +2 -57
  7. package/dist/Body-cjs.js +1 -1
  8. package/dist/Body-es.js +2 -2
  9. package/dist/BottomSheet-cjs.js +42 -12
  10. package/dist/BottomSheet-es.js +43 -13
  11. package/dist/Box-cjs.js +2 -2
  12. package/dist/Box-es.js +2 -2
  13. package/dist/Button/index.mjs +1 -1
  14. package/dist/Button-es.js +1 -1
  15. package/dist/Card-cjs.js +1 -1
  16. package/dist/Card-es.js +1 -1
  17. package/dist/Checkbox/index.cjs +1 -1
  18. package/dist/Checkbox/index.mjs +1 -1
  19. package/dist/Chip/index.mjs +1 -1
  20. package/dist/Chip-cjs.js +2 -2
  21. package/dist/Chip-es.js +2 -2
  22. package/dist/ChipDismissible-es.js +1 -1
  23. package/dist/Chips/InternalChipDismissible/hooks/index.mjs +1 -1
  24. package/dist/Combobox-cjs.js +1 -1
  25. package/dist/Combobox-es.js +1 -1
  26. package/dist/ComboboxAction-cjs.js +1 -1
  27. package/dist/ComboboxAction-es.js +1 -1
  28. package/dist/ComboboxContent-cjs.js +1 -1
  29. package/dist/ComboboxContent-es.js +2 -2
  30. package/dist/ComboboxContentHeader-cjs.js +1 -1
  31. package/dist/ComboboxContentHeader-es.js +1 -1
  32. package/dist/ComboboxContentList-es.js +1 -1
  33. package/dist/ComboboxContentSearch-cjs.js +1 -1
  34. package/dist/ComboboxContentSearch-es.js +1 -1
  35. package/dist/ComboboxLoadMore-cjs.js +1 -1
  36. package/dist/ComboboxLoadMore-es.js +1 -1
  37. package/dist/ComboboxOption-cjs.js +1 -1
  38. package/dist/ComboboxOption-es.js +1 -1
  39. package/dist/Container-cjs.js +1 -1
  40. package/dist/Container-es.js +1 -1
  41. package/dist/Content-cjs.js +1 -1
  42. package/dist/Content-es.js +1 -1
  43. package/dist/ContentBlock-cjs.js +1 -1
  44. package/dist/ContentBlock-es.js +1 -1
  45. package/dist/Countdown-cjs.js +7 -3
  46. package/dist/Countdown-es.js +8 -4
  47. package/dist/Cover-cjs.js +1 -1
  48. package/dist/Cover-es.js +1 -1
  49. package/dist/DataList-es.js +3 -3
  50. package/dist/DataList.const-cjs.js +0 -1
  51. package/dist/DataList.const-es.js +1 -2
  52. package/dist/DataList.module-cjs.js +1 -1
  53. package/dist/DataList.module-es.js +1 -1
  54. package/dist/DataList.utils-es.js +6 -6
  55. package/dist/DataListAction-cjs.js +1 -1
  56. package/dist/DataListAction-es.js +1 -1
  57. package/dist/DataListActionsMenu-cjs.js +1 -1
  58. package/dist/DataListActionsMenu-es.js +2 -2
  59. package/dist/DataListBulkActions-cjs.js +1 -1
  60. package/dist/DataListBulkActions-es.js +1 -1
  61. package/dist/DataListContext-cjs.js +6 -5
  62. package/dist/DataListContext-es.js +6 -5
  63. package/dist/DataListEmptyState-cjs.js +1 -1
  64. package/dist/DataListEmptyState-es.js +1 -1
  65. package/dist/DataListHeaderTile-cjs.js +2 -2
  66. package/dist/DataListHeaderTile-es.js +2 -2
  67. package/dist/DataListItemActions-cjs.js +1 -1
  68. package/dist/DataListItemActions-es.js +2 -2
  69. package/dist/DataListLayoutActions-cjs.js +1 -1
  70. package/dist/DataListLayoutActions-es.js +2 -2
  71. package/dist/DataListLoadMore-cjs.js +1 -1
  72. package/dist/DataListLoadMore-es.js +1 -1
  73. package/dist/DataListLoadingState-cjs.js +1 -1
  74. package/dist/DataListLoadingState-es.js +2 -2
  75. package/dist/DataListOverflowFade-cjs.js +1 -1
  76. package/dist/DataListOverflowFade-es.js +1 -1
  77. package/dist/DataListSearch-cjs.js +1 -1
  78. package/dist/DataListSearch-es.js +1 -1
  79. package/dist/DataListSortingOptions-cjs.js +1 -1
  80. package/dist/DataListSortingOptions-es.js +1 -1
  81. package/dist/DataListStickyHeader-cjs.js +1 -1
  82. package/dist/DataListStickyHeader-es.js +1 -1
  83. package/dist/DataListTags-cjs.js +1 -1
  84. package/dist/DataListTags-es.js +1 -1
  85. package/dist/DataListTotalCount-cjs.js +1 -1
  86. package/dist/DataListTotalCount-es.js +2 -2
  87. package/dist/DataTable/index.mjs +1 -1
  88. package/dist/DataTable-cjs.js +3 -3
  89. package/dist/DataTable-es.js +5 -5
  90. package/dist/DataTableTable-cjs.js +2 -2
  91. package/dist/DataTableTable-es.js +3 -3
  92. package/dist/DatePicker-cjs.js +266 -81
  93. package/dist/DatePicker-es.js +268 -83
  94. package/dist/DayOfMonthSelect-cjs.js +5 -5
  95. package/dist/DayOfMonthSelect-es.js +6 -6
  96. package/dist/DescriptionList-cjs.js +1 -1
  97. package/dist/DescriptionList-es.js +1 -1
  98. package/dist/Disclosure-cjs.js +1 -1
  99. package/dist/Disclosure-es.js +1 -1
  100. package/dist/Divider-cjs.js +1 -1
  101. package/dist/Divider-es.js +1 -1
  102. package/dist/DrawerGrid-cjs.js +2 -2
  103. package/dist/DrawerGrid-es.js +2 -2
  104. package/dist/DrawerRoot-cjs.js +10 -48
  105. package/dist/DrawerRoot-es.js +12 -50
  106. package/dist/FeatureSwitch-cjs.js +1 -1
  107. package/dist/FeatureSwitch-es.js +1 -1
  108. package/dist/FormField/index.mjs +1 -1
  109. package/dist/FormField-cjs.js +1 -1
  110. package/dist/FormField-es.js +2 -2
  111. package/dist/FormatEmail-cjs.js +1 -1
  112. package/dist/FormatEmail-es.js +1 -1
  113. package/dist/FormatFile-cjs.js +1 -6
  114. package/dist/FormatFile-es.js +1 -6
  115. package/dist/Frame-cjs.js +1 -1
  116. package/dist/Frame-es.js +1 -1
  117. package/dist/Glimmer/index.mjs +1 -1
  118. package/dist/Glimmer-cjs.js +1 -1
  119. package/dist/Glimmer-es.js +2 -2
  120. package/dist/Grid-cjs.js +1 -1
  121. package/dist/Grid-es.js +1 -1
  122. package/dist/GridCell-cjs.js +1 -1
  123. package/dist/GridCell-es.js +1 -1
  124. package/dist/InputAvatar-cjs.js +1 -1
  125. package/dist/InputAvatar-es.js +1 -1
  126. package/dist/InputDate/index.mjs +1 -1
  127. package/dist/InputEmail/index.mjs +1 -1
  128. package/dist/InputFile-cjs.js +8 -3
  129. package/dist/InputFile-es.js +8 -3
  130. package/dist/InputNumber/index.cjs +181 -69
  131. package/dist/InputNumber/index.mjs +184 -72
  132. package/dist/InputPassword-es.js +1 -1
  133. package/dist/InputPhoneNumber/index.cjs +1 -1
  134. package/dist/InputPhoneNumber/index.mjs +2 -2
  135. package/dist/InputText/InputText.d.ts +2 -70
  136. package/dist/InputText/index.mjs +1 -1
  137. package/dist/InputTime/index.cjs +0 -1
  138. package/dist/InputTime/index.mjs +1 -2
  139. package/dist/InputValidation-cjs.js +1 -1
  140. package/dist/InputValidation-es.js +1 -1
  141. package/dist/InternalChipDismissible-cjs.js +1 -1
  142. package/dist/InternalChipDismissible-es.js +2 -2
  143. package/dist/LightBox-cjs.js +1 -1
  144. package/dist/LightBox-es.js +1 -1
  145. package/dist/Link-cjs.js +1 -1
  146. package/dist/Link-es.js +1 -1
  147. package/dist/List-cjs.js +3 -3
  148. package/dist/List-es.js +7 -7
  149. package/dist/Markdown-cjs.js +604 -961
  150. package/dist/Markdown-es.js +610 -967
  151. package/dist/Menu/Menu.d.ts +1 -1
  152. package/dist/Menu-cjs.js +859 -629
  153. package/dist/Menu-es.js +855 -625
  154. package/dist/Modal/index.cjs +2 -2
  155. package/dist/Modal/index.mjs +2 -2
  156. package/dist/Modal/useModal.d.ts +9 -29
  157. package/dist/MultiSelect-cjs.js +2 -2
  158. package/dist/MultiSelect-es.js +2 -2
  159. package/dist/OverlaySeparator-cjs.js +1 -1
  160. package/dist/OverlaySeparator-es.js +1 -1
  161. package/dist/Popover-cjs.js +1 -1
  162. package/dist/Popover-es.js +2 -2
  163. package/dist/ProgressBar-cjs.js +1 -1
  164. package/dist/ProgressBar-es.js +1 -1
  165. package/dist/RadioGroup-cjs.js +1 -1
  166. package/dist/RadioGroup-es.js +1 -1
  167. package/dist/RecurringSelect/components/index.mjs +1 -1
  168. package/dist/RecurringSelect/index.cjs +1 -0
  169. package/dist/RecurringSelect/index.mjs +1 -0
  170. package/dist/RecurringSelect-cjs.js +1 -1
  171. package/dist/RecurringSelect-es.js +2 -2
  172. package/dist/SegmentedControl-cjs.js +1 -1
  173. package/dist/SegmentedControl-es.js +2 -2
  174. package/dist/Select/index.cjs +1 -1
  175. package/dist/Select/index.mjs +2 -2
  176. package/dist/SideDrawer-cjs.js +1 -1
  177. package/dist/SideDrawer-es.js +1 -1
  178. package/dist/Spinner-cjs.js +1 -1
  179. package/dist/Spinner-es.js +1 -1
  180. package/dist/StatusIndicator-cjs.js +1 -1
  181. package/dist/StatusIndicator-es.js +1 -1
  182. package/dist/Switch-cjs.js +1 -1
  183. package/dist/Switch-es.js +1 -1
  184. package/dist/Table/index.mjs +1 -1
  185. package/dist/Tabs/index.mjs +1 -1
  186. package/dist/Tabs-cjs.js +1 -1
  187. package/dist/Tabs-es.js +6 -6
  188. package/dist/Text-cjs2.js +365 -175
  189. package/dist/Text-es2.js +361 -175
  190. package/dist/Thumbnail-cjs.js +1 -1
  191. package/dist/Thumbnail-es.js +2 -2
  192. package/dist/Tiles-cjs.js +1 -1
  193. package/dist/Tiles-es.js +1 -1
  194. package/dist/Tooltip-cjs.js +1 -1
  195. package/dist/Tooltip-es.js +2 -2
  196. package/dist/Typography-cjs.js +3 -3
  197. package/dist/Typography-es.js +3 -3
  198. package/dist/_baseEach-cjs.js +1 -1
  199. package/dist/_baseEach-es.js +7 -7
  200. package/dist/_baseFlatten-es.js +1 -1
  201. package/dist/_getAllKeys-cjs.js +2 -8
  202. package/dist/_getAllKeys-es.js +4 -10
  203. package/dist/_getTag-es.js +1 -1
  204. package/dist/_isIterateeCall-es.js +3 -3
  205. package/dist/_setToString-es.js +2 -2
  206. package/dist/debounce-es.js +4 -4
  207. package/dist/floating-ui.react-cjs.js +35 -16
  208. package/dist/floating-ui.react-dom-es.js +2 -2
  209. package/dist/floating-ui.react-es.js +37 -18
  210. package/dist/identity-es.js +5 -5
  211. package/dist/index-cjs.js +6 -6
  212. package/dist/index-es.js +6 -6
  213. package/dist/index.esm-es.js +1 -1
  214. package/dist/index.mjs +6 -6
  215. package/dist/isSymbol-es.js +1 -1
  216. package/dist/isTypedArray-cjs.js +4 -4
  217. package/dist/isTypedArray-es.js +6 -6
  218. package/dist/keysIn-cjs.js +2 -2
  219. package/dist/keysIn-es.js +5 -5
  220. package/dist/noop-es.js +4 -4
  221. package/dist/omit-cjs.js +37 -5
  222. package/dist/omit-es.js +46 -14
  223. package/dist/primitives/BottomSheet/BottomSheet.d.ts +13 -8
  224. package/dist/showToast-cjs.js +1 -1
  225. package/dist/showToast-es.js +1 -1
  226. package/dist/styles.css +56 -124
  227. package/dist/unstyledPrimitives/index.mjs +3 -3
  228. package/dist/useScrollToActive-cjs.js +1 -1
  229. package/dist/useScrollToActive-es.js +8 -8
  230. package/package.json +32 -15
  231. package/rollup.config.mjs +4 -1
package/dist/Menu-es.js CHANGED
@@ -1,9 +1,9 @@
1
- import React__default, { createContext, useContext, useRef, useEffect, useState, useCallback, useMemo, cloneElement, forwardRef, isValidElement, useId } from 'react';
1
+ import React__default, { createContext, useRef, useEffect, useState, useCallback, useMemo, useContext, cloneElement, forwardRef, isValidElement, useId } from 'react';
2
2
  import classnames from 'classnames';
3
3
  import { motion, AnimatePresence } from 'framer-motion';
4
4
  import { useWindowDimensions, useRefocusOnActivator, useIsMounted } from '@jobber/hooks';
5
5
  import { u as useFloating, c as useDismiss, k as useListNavigation, d as useInteractions, F as FloatingPortal } from './floating-ui.react-es.js';
6
- import { I as $f4e2df6bd15f8569$export$98658e8c59125e6a, J as $d4ee10de306f2510$export$4282f70798064fe0, K as $c87311424ea30a05$export$b7d78993b74f766d, L as $c87311424ea30a05$export$9ac100e40613ea10, M as $c87311424ea30a05$export$78551043582a6a98, N as $c87311424ea30a05$export$7bef049ce92e4224, O as $7215afc6de606d6b$export$de79e2c695e052f3, k as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, r as $9446cca9a3875146$export$7d15b64cf5a3a4c4, a as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7, x as $c87311424ea30a05$export$fedb369cb70207f1, P as $431fbd86ca7dc216$export$b204af158042fbac, Q as $bbed8b41f857bcc0$export$24490316f764c430, t as $03deb23ff14920c4$export$4eaf04e54aa8eed6, $ as $8ae05eaa5c114e9c$export$7f54fc3180508a52, R as $8a9cb279dc87e130$export$c2b7abe5d61ec696, S as $8a9cb279dc87e130$export$525bc4921d56d4a, T as $d4ee10de306f2510$export$e58f029f0fbfdb29, U as $6a7db85432448f7f$export$29bf1b5f2c56cf63, V as $8a9cb279dc87e130$export$cabe61c495ee3649, W as $6a7db85432448f7f$export$60278871457622de, p as $431fbd86ca7dc216$export$f21a1ffae260145a, j as $3ef42575df84b30b$export$9d1611c77c2fe928, X as $e7801be82b4b2a53$export$4debdb1a3f0fa79e, w as $ff5963eb1fccf552$export$e08e3b67e392101e, Y as $df56164dff5785e2$export$4338b53315abf666, n as $f645667febf57a63$export$4c014de7c8940b4c, Z as $b4b717babfbb907b$export$4c063cf1350e6fed, _ as $5dc95899b306f630$export$c9058316764c140e, a0 as $d4ee10de306f2510$export$cd4e5573fbe2b576, a1 as $3ad3f6e1647bc98d$export$80f3e147d781571c, a2 as $b4b717babfbb907b$export$bebd5a1431fec25d, v as $c87311424ea30a05$export$a11b0059900ceec8, a3 as $c87311424ea30a05$export$6446a186d09e379e, a4 as $507fabe10e71c6fb$export$630ff653c5ada6a9, f as $9ab94262bd0047c7$export$420e68273165f4ec, g as $bdb11010cef70236$export$f680877a34711e37, s as $fca6afa0e843324b$export$f12b703ca79dfbb1, h as $313b98861ee5dd6c$export$d6875122194c7b44, a5 as $b5e257d569688ac6$export$535bd6ca7f90a273, a6 as $c87311424ea30a05$export$e1865c3bedcd822b, b as $e9faafb641e167db$export$90fc3a17d93f704c, o as $65484d02dcb7eb3e$export$457c3d6518dd4c6f, i as $bdb11010cef70236$export$b4cc09c592e8fdb8, C as $6179b936705e76d3$export$ae780daf29e6d456, c as $507fabe10e71c6fb$export$b9b3dfddab17db27, a7 as $46d819fcbaf35654$export$8f71654801c2f7cd, e as $a1ea59d68270f0dd$export$f8168d8dd8fd66e6, a8 as $f39a9eba43920ace$export$8dc98ba7eadeaa56, a9 as $f645667febf57a63$export$f9762fab77588ecb, m as $458b0a5536c1a7cf$export$40bfa8c7b0832715, z as $64fa3d84918910a7$export$29f1550f4b0d4415, aa as $f39a9eba43920ace$export$b5d7cc18bb8d2b59, A as $64fa3d84918910a7$export$4d86445c2cf5e3, G as $64fa3d84918910a7$export$2881499e37b75b9a, E as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, D as $64fa3d84918910a7$export$fabf2dc03a41866e, H as $514c0188e459b4c0$export$9afb8bc826b033ea, ab as $64fa3d84918910a7$export$c62b8e45d58ddad9 } from './Text-es2.js';
6
+ import { K as $f4e2df6bd15f8569$export$98658e8c59125e6a, L as $d4ee10de306f2510$export$4282f70798064fe0, k as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, $ as $8ae05eaa5c114e9c$export$7f54fc3180508a52, M as $c87311424ea30a05$export$9ac100e40613ea10, x as $c87311424ea30a05$export$fedb369cb70207f1, N as $c87311424ea30a05$export$6446a186d09e379e, O as $c87311424ea30a05$export$78551043582a6a98, r as $9446cca9a3875146$export$7d15b64cf5a3a4c4, m as $d4ee10de306f2510$export$e58f029f0fbfdb29, a as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7, P as $d4ee10de306f2510$export$b4f377a2b6254582, y as $d4ee10de306f2510$export$cd4e5573fbe2b576, Q as $431fbd86ca7dc216$export$b204af158042fbac, R as $bbed8b41f857bcc0$export$24490316f764c430, t as $03deb23ff14920c4$export$4eaf04e54aa8eed6, S as $8a9cb279dc87e130$export$c2b7abe5d61ec696, T as $8a9cb279dc87e130$export$525bc4921d56d4a, w as $ff5963eb1fccf552$export$e08e3b67e392101e, U as $431fbd86ca7dc216$export$f21a1ffae260145a, V as $6a7db85432448f7f$export$29bf1b5f2c56cf63, W as $8a9cb279dc87e130$export$cabe61c495ee3649, X as $6a7db85432448f7f$export$60278871457622de, j as $3ef42575df84b30b$export$9d1611c77c2fe928, Y as $e7801be82b4b2a53$export$4debdb1a3f0fa79e, Z as $ea8dcbcb9ea1b556$export$95185d699e05d4d7, _ as $7215afc6de606d6b$export$de79e2c695e052f3, a0 as $df56164dff5785e2$export$4338b53315abf666, o as $f645667febf57a63$export$4c014de7c8940b4c, a1 as $b4b717babfbb907b$export$4c063cf1350e6fed, a2 as $5dc95899b306f630$export$c9058316764c140e, v as $c87311424ea30a05$export$a11b0059900ceec8, a3 as $b4b717babfbb907b$export$bebd5a1431fec25d, a4 as $3ad3f6e1647bc98d$export$80f3e147d781571c, a5 as $507fabe10e71c6fb$export$630ff653c5ada6a9, f as $9ab94262bd0047c7$export$420e68273165f4ec, g as $bdb11010cef70236$export$f680877a34711e37, s as $fca6afa0e843324b$export$f12b703ca79dfbb1, h as $313b98861ee5dd6c$export$d6875122194c7b44, a6 as $b5e257d569688ac6$export$535bd6ca7f90a273, a7 as $c87311424ea30a05$export$e1865c3bedcd822b, a8 as $ea8dcbcb9ea1b556$export$9a302a45f65d0572, b as $e9faafb641e167db$export$90fc3a17d93f704c, p as $65484d02dcb7eb3e$export$457c3d6518dd4c6f, i as $bdb11010cef70236$export$b4cc09c592e8fdb8, E as $6179b936705e76d3$export$ae780daf29e6d456, c as $507fabe10e71c6fb$export$b9b3dfddab17db27, a9 as $46d819fcbaf35654$export$8f71654801c2f7cd, l as $507fabe10e71c6fb$export$8397ddfc504fdb9a, aa as $ea8dcbcb9ea1b556$export$7e924b3091a3bd18, ab as $ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f, ac as $f39a9eba43920ace$export$8dc98ba7eadeaa56, ad as $f645667febf57a63$export$f9762fab77588ecb, n as $458b0a5536c1a7cf$export$40bfa8c7b0832715, A as $64fa3d84918910a7$export$29f1550f4b0d4415, B as $64fa3d84918910a7$export$df3a06d6289f983e, ae as $f39a9eba43920ace$export$b5d7cc18bb8d2b59, C as $64fa3d84918910a7$export$4d86445c2cf5e3, F as $64fa3d84918910a7$export$fabf2dc03a41866e, I as $64fa3d84918910a7$export$2881499e37b75b9a, J as $514c0188e459b4c0$export$9afb8bc826b033ea, af as $64fa3d84918910a7$export$c62b8e45d58ddad9, G as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8 } from './Text-es2.js';
7
7
  import ReactDOM__default, { flushSync, createPortal } from 'react-dom';
8
8
  import { s as shimExports } from './index-es.js';
9
9
  import { B as Button } from './Button-es.js';
@@ -11,21 +11,27 @@ import { T as Typography } from './Typography-es.js';
11
11
  import { I as Icon } from './Icon-es.js';
12
12
  import { f as formFieldFocusAttribute } from './useFormFieldFocus-es.js';
13
13
  import { c as calculateMaxHeight } from './maxHeight-es.js';
14
- import { o as offset, f as flip, d as size, b as autoUpdate } from './floating-ui.react-dom-es.js';
14
+ import { o as offset, f as flip, d as size, a as autoUpdate } from './floating-ui.react-dom-es.js';
15
15
 
16
16
  /*
17
- * Copyright 2025 Adobe. All rights reserved.
18
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
17
+ * Copyright 2024 Adobe. All rights reserved.
18
+ * This file is licensed to you under the Apache License, Version 2.0 (the 'License');
19
19
  * you may not use this file except in compliance with the License. You may obtain a copy
20
20
  * of the License at http://www.apache.org/licenses/LICENSE-2.0
21
21
  *
22
22
  * Unless required by applicable law or agreed to in writing, software distributed under
23
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
23
+ * the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
24
24
  * OF ANY KIND, either express or implied. See the License for the specific language
25
25
  * governing permissions and limitations under the License.
26
26
  */
27
- const $8e6cc465cc68f603$export$b0d3ecf7112093a7 = /*#__PURE__*/ (createContext)(null);
28
- const $8e6cc465cc68f603$export$698f465ec27e93df = /*#__PURE__*/ (createContext)(null);
27
+ (createContext)(null);
28
+ (createContext)(null);
29
+ (createContext)(null);
30
+ (createContext)(null);
31
+ (createContext)(null);
32
+ (createContext)({});
33
+ const $4e85f108e88277b8$export$b0d3ecf7112093a7 = (createContext)(null);
34
+ const $4e85f108e88277b8$export$698f465ec27e93df = (createContext)(null);
29
35
 
30
36
  // https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/ShadowTreeWalker.ts
31
37
 
@@ -215,109 +221,6 @@ function $dfc540311bf7f109$export$4d0f8be8b12a7ef6(doc, root, whatToShow, filter
215
221
  return doc.createTreeWalker(root, whatToShow, filter);
216
222
  }
217
223
 
218
- /*
219
- * Copyright 2023 Adobe. All rights reserved.
220
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
221
- * you may not use this file except in compliance with the License. You may obtain a copy
222
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
223
- *
224
- * Unless required by applicable law or agreed to in writing, software distributed under
225
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
226
- * OF ANY KIND, either express or implied. See the License for the specific language
227
- * governing permissions and limitations under the License.
228
- */
229
-
230
-
231
- const $ea8dcbcb9ea1b556$var$RouterContext = /*#__PURE__*/ (createContext)({
232
- isNative: true,
233
- open: $ea8dcbcb9ea1b556$var$openSyntheticLink,
234
- useHref: (href)=>href
235
- });
236
- function $ea8dcbcb9ea1b556$export$9a302a45f65d0572() {
237
- return (useContext)($ea8dcbcb9ea1b556$var$RouterContext);
238
- }
239
- function $ea8dcbcb9ea1b556$export$efa8c9099e530235(link, modifiers) {
240
- // Use getAttribute here instead of link.target. Firefox will default link.target to "_parent" when inside an iframe.
241
- let target = link.getAttribute('target');
242
- return (!target || target === '_self') && link.origin === location.origin && !link.hasAttribute('download') && !modifiers.metaKey && // open in new tab (mac)
243
- !modifiers.ctrlKey && // open in new tab (windows)
244
- !modifiers.altKey && // download
245
- !modifiers.shiftKey;
246
- }
247
- function $ea8dcbcb9ea1b556$export$95185d699e05d4d7(target, modifiers, setOpening = true) {
248
- var _window_event_type, _window_event;
249
- let { metaKey: metaKey, ctrlKey: ctrlKey, altKey: altKey, shiftKey: shiftKey } = modifiers;
250
- // Firefox does not recognize keyboard events as a user action by default, and the popup blocker
251
- // will prevent links with target="_blank" from opening. However, it does allow the event if the
252
- // Command/Control key is held, which opens the link in a background tab. This seems like the best we can do.
253
- // See https://bugzilla.mozilla.org/show_bug.cgi?id=257870 and https://bugzilla.mozilla.org/show_bug.cgi?id=746640.
254
- if (($c87311424ea30a05$export$b7d78993b74f766d)() && ((_window_event = window.event) === null || _window_event === void 0 ? void 0 : (_window_event_type = _window_event.type) === null || _window_event_type === void 0 ? void 0 : _window_event_type.startsWith('key')) && target.target === '_blank') {
255
- if (($c87311424ea30a05$export$9ac100e40613ea10)()) metaKey = true;
256
- else ctrlKey = true;
257
- }
258
- // WebKit does not support firing click events with modifier keys, but does support keyboard events.
259
- // https://github.com/WebKit/WebKit/blob/c03d0ac6e6db178f90923a0a63080b5ca210d25f/Source/WebCore/html/HTMLAnchorElement.cpp#L184
260
- let event = ($c87311424ea30a05$export$78551043582a6a98)() && ($c87311424ea30a05$export$9ac100e40613ea10)() && !($c87311424ea30a05$export$7bef049ce92e4224)() && process.env.NODE_ENV !== 'test' ? new KeyboardEvent('keydown', {
261
- keyIdentifier: 'Enter',
262
- metaKey: metaKey,
263
- ctrlKey: ctrlKey,
264
- altKey: altKey,
265
- shiftKey: shiftKey
266
- }) : new MouseEvent('click', {
267
- metaKey: metaKey,
268
- ctrlKey: ctrlKey,
269
- altKey: altKey,
270
- shiftKey: shiftKey,
271
- bubbles: true,
272
- cancelable: true
273
- });
274
- $ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = setOpening;
275
- ($7215afc6de606d6b$export$de79e2c695e052f3)(target);
276
- target.dispatchEvent(event);
277
- $ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = false;
278
- }
279
- // https://github.com/parcel-bundler/parcel/issues/8724
280
- $ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = false;
281
- function $ea8dcbcb9ea1b556$var$getSyntheticLink(target, open) {
282
- if (target instanceof HTMLAnchorElement) open(target);
283
- else if (target.hasAttribute('data-href')) {
284
- let link = document.createElement('a');
285
- link.href = target.getAttribute('data-href');
286
- if (target.hasAttribute('data-target')) link.target = target.getAttribute('data-target');
287
- if (target.hasAttribute('data-rel')) link.rel = target.getAttribute('data-rel');
288
- if (target.hasAttribute('data-download')) link.download = target.getAttribute('data-download');
289
- if (target.hasAttribute('data-ping')) link.ping = target.getAttribute('data-ping');
290
- if (target.hasAttribute('data-referrer-policy')) link.referrerPolicy = target.getAttribute('data-referrer-policy');
291
- target.appendChild(link);
292
- open(link);
293
- target.removeChild(link);
294
- }
295
- }
296
- function $ea8dcbcb9ea1b556$var$openSyntheticLink(target, modifiers) {
297
- $ea8dcbcb9ea1b556$var$getSyntheticLink(target, (link)=>$ea8dcbcb9ea1b556$export$95185d699e05d4d7(link, modifiers));
298
- }
299
- function $ea8dcbcb9ea1b556$export$7e924b3091a3bd18(props) {
300
- let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
301
- var _props_href;
302
- const href = router.useHref((_props_href = props === null || props === void 0 ? void 0 : props.href) !== null && _props_href !== void 0 ? _props_href : '');
303
- return {
304
- href: (props === null || props === void 0 ? void 0 : props.href) ? href : undefined,
305
- target: props === null || props === void 0 ? void 0 : props.target,
306
- rel: props === null || props === void 0 ? void 0 : props.rel,
307
- download: props === null || props === void 0 ? void 0 : props.download,
308
- ping: props === null || props === void 0 ? void 0 : props.ping,
309
- referrerPolicy: props === null || props === void 0 ? void 0 : props.referrerPolicy
310
- };
311
- }
312
- function $ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f(e, router, href, routerOptions) {
313
- // If a custom router is provided, prevent default and forward if this link should client navigate.
314
- if (!router.isNative && e.currentTarget instanceof HTMLAnchorElement && e.currentTarget.href && // If props are applied to a router Link component, it may have already prevented default.
315
- !e.isDefaultPrevented() && $ea8dcbcb9ea1b556$export$efa8c9099e530235(e.currentTarget, e) && href) {
316
- e.preventDefault();
317
- router.open(e.currentTarget, e, href, routerOptions);
318
- }
319
- }
320
-
321
224
  /*
322
225
  * Copyright 2024 Adobe. All rights reserved.
323
226
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -351,19 +254,22 @@ function $9daab02d461809db$var$hasResizeObserver() {
351
254
  return typeof window.ResizeObserver !== 'undefined';
352
255
  }
353
256
  function $9daab02d461809db$export$683480f191c0e3ea(options) {
257
+ // Only call onResize from inside the effect, otherwise we'll void our assumption that
258
+ // useEffectEvents are safe to pass in.
354
259
  const { ref: ref, box: box, onResize: onResize } = options;
260
+ let onResizeEvent = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(onResize);
355
261
  (useEffect)(()=>{
356
262
  let element = ref === null || ref === void 0 ? void 0 : ref.current;
357
263
  if (!element) return;
358
264
  if (!$9daab02d461809db$var$hasResizeObserver()) {
359
- window.addEventListener('resize', onResize, false);
265
+ window.addEventListener('resize', onResizeEvent, false);
360
266
  return ()=>{
361
- window.removeEventListener('resize', onResize, false);
267
+ window.removeEventListener('resize', onResizeEvent, false);
362
268
  };
363
269
  } else {
364
270
  const resizeObserverInstance = new window.ResizeObserver((entries)=>{
365
271
  if (!entries.length) return;
366
- onResize();
272
+ onResizeEvent();
367
273
  });
368
274
  resizeObserverInstance.observe(element, {
369
275
  box: box
@@ -373,7 +279,6 @@ function $9daab02d461809db$export$683480f191c0e3ea(options) {
373
279
  };
374
280
  }
375
281
  }, [
376
- onResize,
377
282
  ref,
378
283
  box
379
284
  ]);
@@ -392,7 +297,10 @@ function $9daab02d461809db$export$683480f191c0e3ea(options) {
392
297
  */ function $cc38e7bd3fc7b213$export$2bb74740c4e19def(node, checkForOverflow) {
393
298
  if (!node) return false;
394
299
  let style = window.getComputedStyle(node);
300
+ let root = document.scrollingElement || document.documentElement;
395
301
  let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);
302
+ // Root element has `visible` overflow by default, but is scrollable nonetheless.
303
+ if (node === root && style.overflow !== 'hidden') isScrollable = true;
396
304
  if (isScrollable && checkForOverflow) isScrollable = node.scrollHeight !== node.clientHeight || node.scrollWidth !== node.clientWidth;
397
305
  return isScrollable;
398
306
  }
@@ -427,12 +335,44 @@ function $62d8ded9296f3872$export$cfa2225e87938781(node, checkForOverflow) {
427
335
  * governing permissions and limitations under the License.
428
336
  */
429
337
  function $a40c673dc9f6d9c7$export$94ed1c92c7beeb22(node, checkForOverflow) {
430
- const scrollParents = [];
431
- while(node && node !== document.documentElement){
432
- if (($cc38e7bd3fc7b213$export$2bb74740c4e19def)(node, checkForOverflow)) scrollParents.push(node);
338
+ let parentElements = [];
339
+ let root = document.scrollingElement || document.documentElement;
340
+ do {
341
+ if (($cc38e7bd3fc7b213$export$2bb74740c4e19def)(node, checkForOverflow)) parentElements.push(node);
433
342
  node = node.parentElement;
434
- }
435
- return scrollParents;
343
+ }while (node && node !== root);
344
+ return parentElements;
345
+ }
346
+
347
+ /*
348
+ * Copyright 2024 Adobe. All rights reserved.
349
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
350
+ * you may not use this file except in compliance with the License. You may obtain a copy
351
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
352
+ *
353
+ * Unless required by applicable law or agreed to in writing, software distributed under
354
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
355
+ * OF ANY KIND, either express or implied. See the License for the specific language
356
+ * governing permissions and limitations under the License.
357
+ */
358
+ function $21f1aa98acb08317$export$16792effe837dba3(e) {
359
+ if (($c87311424ea30a05$export$9ac100e40613ea10)()) return e.metaKey;
360
+ return e.ctrlKey;
361
+ }
362
+ // HTML input types that do not cause the software keyboard to appear.
363
+ const $21f1aa98acb08317$var$nonTextInputTypes = new Set([
364
+ 'checkbox',
365
+ 'radio',
366
+ 'range',
367
+ 'color',
368
+ 'file',
369
+ 'image',
370
+ 'button',
371
+ 'submit',
372
+ 'reset'
373
+ ]);
374
+ function $21f1aa98acb08317$export$c57958e35f31ed73(target) {
375
+ return target instanceof HTMLInputElement && !$21f1aa98acb08317$var$nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;
436
376
  }
437
377
 
438
378
  /*
@@ -494,59 +434,84 @@ function $ef06256079686ba0$export$f8aeda7b10753fa1(description) {
494
434
  * OF ANY KIND, either express or implied. See the License for the specific language
495
435
  * governing permissions and limitations under the License.
496
436
  */
497
- function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element) {
498
- let offsetX = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, 'left');
499
- let offsetY = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, 'top');
500
- let width = element.offsetWidth;
501
- let height = element.offsetHeight;
502
- let x = scrollView.scrollLeft;
437
+
438
+ function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element, opts = {}) {
439
+ let { block: block = 'nearest', inline: inline = 'nearest' } = opts;
440
+ if (scrollView === element) return;
503
441
  let y = scrollView.scrollTop;
504
- // Account for top/left border offsetting the scroll top/Left + scroll padding
505
- let { borderTopWidth: borderTopWidth, borderLeftWidth: borderLeftWidth, scrollPaddingTop: scrollPaddingTop, scrollPaddingRight: scrollPaddingRight, scrollPaddingBottom: scrollPaddingBottom, scrollPaddingLeft: scrollPaddingLeft } = getComputedStyle(scrollView);
506
- let borderAdjustedX = x + parseInt(borderLeftWidth, 10);
507
- let borderAdjustedY = y + parseInt(borderTopWidth, 10);
508
- // Ignore end/bottom border via clientHeight/Width instead of offsetHeight/Width
509
- let maxX = borderAdjustedX + scrollView.clientWidth;
510
- let maxY = borderAdjustedY + scrollView.clientHeight;
511
- // Get scroll padding values as pixels - defaults to 0 if no scroll padding
512
- // is used.
513
- let scrollPaddingTopNumber = parseInt(scrollPaddingTop, 10) || 0;
514
- let scrollPaddingBottomNumber = parseInt(scrollPaddingBottom, 10) || 0;
515
- let scrollPaddingRightNumber = parseInt(scrollPaddingRight, 10) || 0;
516
- let scrollPaddingLeftNumber = parseInt(scrollPaddingLeft, 10) || 0;
517
- if (offsetX <= x + scrollPaddingLeftNumber) x = offsetX - parseInt(borderLeftWidth, 10) - scrollPaddingLeftNumber;
518
- else if (offsetX + width > maxX - scrollPaddingRightNumber) x += offsetX + width - maxX + scrollPaddingRightNumber;
519
- if (offsetY <= borderAdjustedY + scrollPaddingTopNumber) y = offsetY - parseInt(borderTopWidth, 10) - scrollPaddingTopNumber;
520
- else if (offsetY + height > maxY - scrollPaddingBottomNumber) y += offsetY + height - maxY + scrollPaddingBottomNumber;
521
- scrollView.scrollLeft = x;
522
- scrollView.scrollTop = y;
523
- }
524
- /**
525
- * Computes the offset left or top from child to ancestor by accumulating
526
- * offsetLeft or offsetTop through intervening offsetParents.
527
- */ function $2f04cbc44ee30ce0$var$relativeOffset(ancestor, child, axis) {
528
- const prop = axis === 'left' ? 'offsetLeft' : 'offsetTop';
529
- let sum = 0;
530
- while(child.offsetParent){
531
- sum += child[prop];
532
- if (child.offsetParent === ancestor) break;
533
- else if (child.offsetParent.contains(ancestor)) {
534
- // If the ancestor is not `position:relative`, then we stop at
535
- // _its_ offset parent, and we subtract off _its_ offset, so that
536
- // we end up with the proper offset from child to ancestor.
537
- sum -= ancestor[prop];
538
- break;
539
- }
540
- child = child.offsetParent;
541
- }
542
- return sum;
442
+ let x = scrollView.scrollLeft;
443
+ let target = element.getBoundingClientRect();
444
+ let view = scrollView.getBoundingClientRect();
445
+ let itemStyle = window.getComputedStyle(element);
446
+ let viewStyle = window.getComputedStyle(scrollView);
447
+ let root = document.scrollingElement || document.documentElement;
448
+ let viewTop = scrollView === root ? 0 : view.top;
449
+ let viewBottom = scrollView === root ? scrollView.clientHeight : view.bottom;
450
+ let viewLeft = scrollView === root ? 0 : view.left;
451
+ let viewRight = scrollView === root ? scrollView.clientWidth : view.right;
452
+ let scrollMarginTop = parseInt(itemStyle.scrollMarginTop, 10) || 0;
453
+ let scrollMarginBottom = parseInt(itemStyle.scrollMarginBottom, 10) || 0;
454
+ let scrollMarginLeft = parseInt(itemStyle.scrollMarginLeft, 10) || 0;
455
+ let scrollMarginRight = parseInt(itemStyle.scrollMarginRight, 10) || 0;
456
+ let scrollPaddingTop = parseInt(viewStyle.scrollPaddingTop, 10) || 0;
457
+ let scrollPaddingBottom = parseInt(viewStyle.scrollPaddingBottom, 10) || 0;
458
+ let scrollPaddingLeft = parseInt(viewStyle.scrollPaddingLeft, 10) || 0;
459
+ let scrollPaddingRight = parseInt(viewStyle.scrollPaddingRight, 10) || 0;
460
+ let borderTopWidth = parseInt(viewStyle.borderTopWidth, 10) || 0;
461
+ let borderBottomWidth = parseInt(viewStyle.borderBottomWidth, 10) || 0;
462
+ let borderLeftWidth = parseInt(viewStyle.borderLeftWidth, 10) || 0;
463
+ let borderRightWidth = parseInt(viewStyle.borderRightWidth, 10) || 0;
464
+ let scrollAreaTop = target.top - scrollMarginTop;
465
+ let scrollAreaBottom = target.bottom + scrollMarginBottom;
466
+ let scrollAreaLeft = target.left - scrollMarginLeft;
467
+ let scrollAreaRight = target.right + scrollMarginRight;
468
+ let scrollBarOffsetX = scrollView === root ? 0 : borderLeftWidth + borderRightWidth;
469
+ let scrollBarOffsetY = scrollView === root ? 0 : borderTopWidth + borderBottomWidth;
470
+ let scrollBarWidth = scrollView.offsetWidth - scrollView.clientWidth - scrollBarOffsetX;
471
+ let scrollBarHeight = scrollView.offsetHeight - scrollView.clientHeight - scrollBarOffsetY;
472
+ let scrollPortTop = viewTop + borderTopWidth + scrollPaddingTop;
473
+ let scrollPortBottom = viewBottom - borderBottomWidth - scrollPaddingBottom - scrollBarHeight;
474
+ let scrollPortLeft = viewLeft + borderLeftWidth + scrollPaddingLeft;
475
+ let scrollPortRight = viewRight - borderRightWidth - scrollPaddingRight;
476
+ // IOS always positions the scrollbar on the right ¯\_(ツ)_/¯
477
+ if (viewStyle.direction === 'rtl' && !($c87311424ea30a05$export$fedb369cb70207f1)()) scrollPortLeft += scrollBarWidth;
478
+ else scrollPortRight -= scrollBarWidth;
479
+ let shouldScrollBlock = scrollAreaTop < scrollPortTop || scrollAreaBottom > scrollPortBottom;
480
+ let shouldScrollInline = scrollAreaLeft < scrollPortLeft || scrollAreaRight > scrollPortRight;
481
+ if (shouldScrollBlock && block === 'start') y += scrollAreaTop - scrollPortTop;
482
+ else if (shouldScrollBlock && block === 'center') y += (scrollAreaTop + scrollAreaBottom) / 2 - (scrollPortTop + scrollPortBottom) / 2;
483
+ else if (shouldScrollBlock && block === 'end') y += scrollAreaBottom - scrollPortBottom;
484
+ else if (shouldScrollBlock && block === 'nearest') {
485
+ let start = scrollAreaTop - scrollPortTop;
486
+ let end = scrollAreaBottom - scrollPortBottom;
487
+ y += Math.abs(start) <= Math.abs(end) ? start : end;
488
+ }
489
+ if (shouldScrollInline && inline === 'start') x += scrollAreaLeft - scrollPortLeft;
490
+ else if (shouldScrollInline && inline === 'center') x += (scrollAreaLeft + scrollAreaRight) / 2 - (scrollPortLeft + scrollPortRight) / 2;
491
+ else if (shouldScrollInline && inline === 'end') x += scrollAreaRight - scrollPortRight;
492
+ else if (shouldScrollInline && inline === 'nearest') {
493
+ let start = scrollAreaLeft - scrollPortLeft;
494
+ let end = scrollAreaRight - scrollPortRight;
495
+ x += Math.abs(start) <= Math.abs(end) ? start : end;
496
+ }
497
+ if (process.env.NODE_ENV === 'test') {
498
+ scrollView.scrollLeft = x;
499
+ scrollView.scrollTop = y;
500
+ return;
501
+ }
502
+ scrollView.scrollTo({
503
+ left: x,
504
+ top: y
505
+ });
543
506
  }
544
- function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
545
- if (targetElement && document.contains(targetElement)) {
507
+ function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts = {}) {
508
+ let { containingElement: containingElement } = opts;
509
+ if (targetElement && targetElement.isConnected) {
546
510
  let root = document.scrollingElement || document.documentElement;
547
511
  let isScrollPrevented = window.getComputedStyle(root).overflow === 'hidden';
548
- // If scrolling is not currently prevented then we arent in a overlay nor is a overlay open, just use element.scrollIntoView to bring the element into view
549
- if (!isScrollPrevented) {
512
+ // If scrolling is not currently prevented then we aren't in a overlay nor is a overlay open, just use element.scrollIntoView to bring the element into view
513
+ // Also ignore in chrome because of this bug: https://issues.chromium.org/issues/40074749
514
+ if (!isScrollPrevented && !($c87311424ea30a05$export$6446a186d09e379e)()) {
550
515
  var // use scrollIntoView({block: 'nearest'}) instead of .focus to check if the element is fully in view or not since .focus()
551
516
  // won't cause a scroll if the element is already focused and doesn't behave consistently when an element is partially out of view horizontally vs vertically
552
517
  _targetElement_scrollIntoView;
@@ -557,8 +522,8 @@ function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
557
522
  let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
558
523
  // Account for sub pixel differences from rounding
559
524
  if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
560
- var _opts_containingElement_scrollIntoView, _opts_containingElement, _targetElement_scrollIntoView1;
561
- opts === null || opts === void 0 ? void 0 : (_opts_containingElement = opts.containingElement) === null || _opts_containingElement === void 0 ? void 0 : (_opts_containingElement_scrollIntoView = _opts_containingElement.scrollIntoView) === null || _opts_containingElement_scrollIntoView === void 0 ? void 0 : _opts_containingElement_scrollIntoView.call(_opts_containingElement, {
525
+ var _containingElement_scrollIntoView, _targetElement_scrollIntoView1;
526
+ containingElement === null || containingElement === void 0 ? void 0 : (_containingElement_scrollIntoView = containingElement.scrollIntoView) === null || _containingElement_scrollIntoView === void 0 ? void 0 : _containingElement_scrollIntoView.call(containingElement, {
562
527
  block: 'center',
563
528
  inline: 'center'
564
529
  });
@@ -567,9 +532,19 @@ function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
567
532
  });
568
533
  }
569
534
  } else {
570
- let scrollParents = ($a40c673dc9f6d9c7$export$94ed1c92c7beeb22)(targetElement);
535
+ let { left: originalLeft, top: originalTop } = targetElement.getBoundingClientRect();
571
536
  // If scrolling is prevented, we don't want to scroll the body since it might move the overlay partially offscreen and the user can't scroll it back into view.
537
+ let scrollParents = ($a40c673dc9f6d9c7$export$94ed1c92c7beeb22)(targetElement, true);
572
538
  for (let scrollParent of scrollParents)$2f04cbc44ee30ce0$export$53a0910f038337bd(scrollParent, targetElement);
539
+ let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
540
+ // Account for sub pixel differences from rounding
541
+ if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
542
+ scrollParents = containingElement ? ($a40c673dc9f6d9c7$export$94ed1c92c7beeb22)(containingElement, true) : [];
543
+ for (let scrollParent of scrollParents)$2f04cbc44ee30ce0$export$53a0910f038337bd(scrollParent, containingElement, {
544
+ block: 'center',
545
+ inline: 'center'
546
+ });
547
+ }
573
548
  }
574
549
  }
575
550
  }
@@ -588,22 +563,6 @@ function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
588
563
  const $5671b20cf9b562b2$export$447a38995de2c711 = 'react-aria-clear-focus';
589
564
  const $5671b20cf9b562b2$export$831c820ad60f9d12 = 'react-aria-focus';
590
565
 
591
- /*
592
- * Copyright 2024 Adobe. All rights reserved.
593
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
594
- * you may not use this file except in compliance with the License. You may obtain a copy
595
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
596
- *
597
- * Unless required by applicable law or agreed to in writing, software distributed under
598
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
599
- * OF ANY KIND, either express or implied. See the License for the specific language
600
- * governing permissions and limitations under the License.
601
- */
602
- function $21f1aa98acb08317$export$16792effe837dba3(e) {
603
- if (($c87311424ea30a05$export$9ac100e40613ea10)()) return e.metaKey;
604
- return e.ctrlKey;
605
- }
606
-
607
566
  /*
608
567
  * Copyright 2020 Adobe. All rights reserved.
609
568
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -724,28 +683,31 @@ const $edcf132a9284368a$var$TOTAL_SIZE = {
724
683
  height: 'totalHeight'
725
684
  };
726
685
  const $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE = {};
727
- let $edcf132a9284368a$var$visualViewport = typeof document !== 'undefined' ? window.visualViewport : null;
728
- function $edcf132a9284368a$var$getContainerDimensions(containerNode) {
686
+ let $edcf132a9284368a$var$getVisualViewport = ()=>typeof document !== 'undefined' ? window.visualViewport : null;
687
+ function $edcf132a9284368a$var$getContainerDimensions(containerNode, visualViewport) {
729
688
  let width = 0, height = 0, totalWidth = 0, totalHeight = 0, top = 0, left = 0;
730
689
  let scroll = {};
731
690
  var _visualViewport_scale;
732
- let isPinchZoomedIn = ((_visualViewport_scale = $edcf132a9284368a$var$visualViewport === null || $edcf132a9284368a$var$visualViewport === void 0 ? void 0 : $edcf132a9284368a$var$visualViewport.scale) !== null && _visualViewport_scale !== void 0 ? _visualViewport_scale : 1) > 1;
733
- if (containerNode.tagName === 'BODY') {
691
+ let isPinchZoomedIn = ((_visualViewport_scale = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.scale) !== null && _visualViewport_scale !== void 0 ? _visualViewport_scale : 1) > 1;
692
+ // In the case where the container is `html` or `body` and the container doesn't have something like `position: relative`,
693
+ // then position absolute will be positioned relative to the viewport, also known as the `initial containing block`.
694
+ // That's why we use the visual viewport instead.
695
+ if (containerNode.tagName === 'BODY' || containerNode.tagName === 'HTML') {
734
696
  let documentElement = document.documentElement;
735
697
  totalWidth = documentElement.clientWidth;
736
698
  totalHeight = documentElement.clientHeight;
737
699
  var _visualViewport_width;
738
- width = (_visualViewport_width = $edcf132a9284368a$var$visualViewport === null || $edcf132a9284368a$var$visualViewport === void 0 ? void 0 : $edcf132a9284368a$var$visualViewport.width) !== null && _visualViewport_width !== void 0 ? _visualViewport_width : totalWidth;
700
+ width = (_visualViewport_width = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.width) !== null && _visualViewport_width !== void 0 ? _visualViewport_width : totalWidth;
739
701
  var _visualViewport_height;
740
- height = (_visualViewport_height = $edcf132a9284368a$var$visualViewport === null || $edcf132a9284368a$var$visualViewport === void 0 ? void 0 : $edcf132a9284368a$var$visualViewport.height) !== null && _visualViewport_height !== void 0 ? _visualViewport_height : totalHeight;
702
+ height = (_visualViewport_height = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.height) !== null && _visualViewport_height !== void 0 ? _visualViewport_height : totalHeight;
741
703
  scroll.top = documentElement.scrollTop || containerNode.scrollTop;
742
704
  scroll.left = documentElement.scrollLeft || containerNode.scrollLeft;
743
705
  // The goal of the below is to get a top/left value that represents the top/left of the visual viewport with
744
706
  // respect to the layout viewport origin. This combined with the scrollTop/scrollLeft will allow us to calculate
745
707
  // coordinates/values with respect to the visual viewport or with respect to the layout viewport.
746
- if ($edcf132a9284368a$var$visualViewport) {
747
- top = $edcf132a9284368a$var$visualViewport.offsetTop;
748
- left = $edcf132a9284368a$var$visualViewport.offsetLeft;
708
+ if (visualViewport) {
709
+ top = visualViewport.offsetTop;
710
+ left = visualViewport.offsetLeft;
749
711
  }
750
712
  } else {
751
713
  ({ width: width, height: height, top: top, left: left } = $edcf132a9284368a$var$getOffset(containerNode, false));
@@ -762,9 +724,9 @@ function $edcf132a9284368a$var$getContainerDimensions(containerNode) {
762
724
  scroll.top = 0;
763
725
  scroll.left = 0;
764
726
  var _visualViewport_pageTop;
765
- top = (_visualViewport_pageTop = $edcf132a9284368a$var$visualViewport === null || $edcf132a9284368a$var$visualViewport === void 0 ? void 0 : $edcf132a9284368a$var$visualViewport.pageTop) !== null && _visualViewport_pageTop !== void 0 ? _visualViewport_pageTop : 0;
727
+ top = (_visualViewport_pageTop = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.pageTop) !== null && _visualViewport_pageTop !== void 0 ? _visualViewport_pageTop : 0;
766
728
  var _visualViewport_pageLeft;
767
- left = (_visualViewport_pageLeft = $edcf132a9284368a$var$visualViewport === null || $edcf132a9284368a$var$visualViewport === void 0 ? void 0 : $edcf132a9284368a$var$visualViewport.pageLeft) !== null && _visualViewport_pageLeft !== void 0 ? _visualViewport_pageLeft : 0;
729
+ left = (_visualViewport_pageLeft = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.pageLeft) !== null && _visualViewport_pageLeft !== void 0 ? _visualViewport_pageLeft : 0;
768
730
  }
769
731
  return {
770
732
  width: width,
@@ -799,10 +761,12 @@ containerDimensions, padding, containerOffsetWithBoundary) {
799
761
  let boundarySize = boundaryDimensions[$edcf132a9284368a$var$AXIS_SIZE[axis]];
800
762
  // Calculate the edges of the boundary (accomodating for the boundary padding) and the edges of the overlay.
801
763
  // Note that these values are with respect to the visual viewport (aka 0,0 is the top left of the viewport)
802
- let boundaryStartEdge = boundaryDimensions.scroll[$edcf132a9284368a$var$AXIS[axis]] + padding;
803
- let boundaryEndEdge = boundarySize + boundaryDimensions.scroll[$edcf132a9284368a$var$AXIS[axis]] - padding;
804
- let startEdgeOffset = offset - containerScroll + containerOffsetWithBoundary[axis] - boundaryDimensions[$edcf132a9284368a$var$AXIS[axis]];
805
- let endEdgeOffset = offset - containerScroll + size + containerOffsetWithBoundary[axis] - boundaryDimensions[$edcf132a9284368a$var$AXIS[axis]];
764
+ let boundaryStartEdge = containerOffsetWithBoundary[axis] + boundaryDimensions.scroll[$edcf132a9284368a$var$AXIS[axis]] + padding;
765
+ let boundaryEndEdge = containerOffsetWithBoundary[axis] + boundaryDimensions.scroll[$edcf132a9284368a$var$AXIS[axis]] + boundarySize - padding;
766
+ // transformed value of the left edge of the overlay
767
+ let startEdgeOffset = offset - containerScroll + boundaryDimensions.scroll[$edcf132a9284368a$var$AXIS[axis]] + containerOffsetWithBoundary[axis] - boundaryDimensions[$edcf132a9284368a$var$AXIS[axis]];
768
+ // transformed value of the right edge of the overlay
769
+ let endEdgeOffset = offset - containerScroll + size + boundaryDimensions.scroll[$edcf132a9284368a$var$AXIS[axis]] + containerOffsetWithBoundary[axis] - boundaryDimensions[$edcf132a9284368a$var$AXIS[axis]];
806
770
  // If any of the overlay edges falls outside of the boundary, shift the overlay the required amount to align one of the overlay's
807
771
  // edges with the closest boundary edge.
808
772
  if (startEdgeOffset < boundaryStartEdge) return boundaryStartEdge - startEdgeOffset;
@@ -836,7 +800,7 @@ function $edcf132a9284368a$var$parsePlacement(input) {
836
800
  };
837
801
  return $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input];
838
802
  }
839
- function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset) {
803
+ function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset, containerDimensions) {
840
804
  let { placement: placement, crossPlacement: crossPlacement, axis: axis, crossAxis: crossAxis, size: size, crossSize: crossSize } = placementInfo;
841
805
  let position = {};
842
806
  var _childOffset_crossAxis;
@@ -853,9 +817,9 @@ function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions,
853
817
  the overlay top should match the button top
854
818
  } */
855
819
  position[crossAxis] += crossOffset;
856
- // overlay top overlapping arrow with button bottom
820
+ // overlay top or left overlapping arrow with button bottom or right
857
821
  const minPosition = childOffset[crossAxis] - overlaySize[crossSize] + arrowSize + arrowBoundaryOffset;
858
- // overlay bottom overlapping arrow with button top
822
+ // overlay bottom or right overlapping arrow with button top or left
859
823
  const maxPosition = childOffset[crossAxis] + childOffset[crossSize] - arrowSize - arrowBoundaryOffset;
860
824
  position[crossAxis] = ($9446cca9a3875146$export$7d15b64cf5a3a4c4)(position[crossAxis], minPosition, maxPosition);
861
825
  // Floor these so the position isn't placed on a partial pixel, only whole pixels. Shouldn't matter if it was floored or ceiled, so chose one.
@@ -863,46 +827,61 @@ function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions,
863
827
  // If the container is positioned (non-static), then we use the container's actual
864
828
  // height, as `bottom` will be relative to this height. But if the container is static,
865
829
  // then it can only be the `document.body`, and `bottom` will be relative to _its_
866
- // container, which should be as large as boundaryDimensions.
867
- const containerHeight = isContainerPositioned ? containerOffsetWithBoundary[size] : boundaryDimensions[$edcf132a9284368a$var$TOTAL_SIZE[size]];
830
+ // container.
831
+ let containerHeight = isContainerPositioned ? containerDimensions[size] : containerDimensions[$edcf132a9284368a$var$TOTAL_SIZE[size]];
868
832
  position[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] = Math.floor(containerHeight - childOffset[axis] + offset);
869
833
  } else position[axis] = Math.floor(childOffset[axis] + childOffset[size] + offset);
870
834
  return position;
871
835
  }
872
- function $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlayHeight, heightGrowthDirection) {
873
- const containerHeight = isContainerPositioned ? containerOffsetWithBoundary.height : boundaryDimensions[$edcf132a9284368a$var$TOTAL_SIZE.height];
874
- var _position_bottom;
875
- // For cases where position is set via "bottom" instead of "top", we need to calculate the true overlay top with respect to the boundary. Reverse calculate this with the same method
876
- // used in computePosition.
877
- let overlayTop = position.top != null ? containerOffsetWithBoundary.top + position.top : containerOffsetWithBoundary.top + (containerHeight - ((_position_bottom = position.bottom) !== null && _position_bottom !== void 0 ? _position_bottom : 0) - overlayHeight);
878
- var _boundaryDimensions_scroll_top, _margins_top, _margins_bottom, _boundaryDimensions_scroll_top1, _margins_top1, _margins_bottom1;
836
+ function $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlayHeight, heightGrowthDirection, containerDimensions, isContainerDescendentOfBoundary, visualViewport) {
837
+ var _position_bottom, _containerDimensions_scroll_top;
838
+ // For cases where position is set via "bottom" instead of "top", we need to calculate the true overlay top
839
+ // with respect to the container.
840
+ let overlayTop = (position.top != null ? position.top : containerDimensions[$edcf132a9284368a$var$TOTAL_SIZE.height] - ((_position_bottom = position.bottom) !== null && _position_bottom !== void 0 ? _position_bottom : 0) - overlayHeight) - ((_containerDimensions_scroll_top = containerDimensions.scroll.top) !== null && _containerDimensions_scroll_top !== void 0 ? _containerDimensions_scroll_top : 0);
841
+ // calculate the dimentions of the "boundingRect" which is most restrictive top/bottom of the boundaryRect and the visual view port
842
+ let boundaryToContainerTransformOffset = isContainerDescendentOfBoundary ? containerOffsetWithBoundary.top : 0;
843
+ var _visualViewport_offsetTop, _visualViewport_offsetTop1, _visualViewport_height;
844
+ let boundingRect = {
845
+ // This should be boundary top in container coord system vs viewport top in container coord system
846
+ // For the viewport top, there are several cases
847
+ // 1. pinchzoom case where we want the viewports offset top as top here
848
+ // 2. case where container is offset from the boundary and is contained by the boundary. In this case the top we want here is NOT 0, we want to take boundary's top even though is is a negative number OR the visual viewport, whichever is more restrictive
849
+ top: Math.max(boundaryDimensions.top + boundaryToContainerTransformOffset, ((_visualViewport_offsetTop = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.offsetTop) !== null && _visualViewport_offsetTop !== void 0 ? _visualViewport_offsetTop : boundaryDimensions.top) + boundaryToContainerTransformOffset),
850
+ bottom: Math.min(boundaryDimensions.top + boundaryDimensions.height + boundaryToContainerTransformOffset, ((_visualViewport_offsetTop1 = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.offsetTop) !== null && _visualViewport_offsetTop1 !== void 0 ? _visualViewport_offsetTop1 : 0) + ((_visualViewport_height = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.height) !== null && _visualViewport_height !== void 0 ? _visualViewport_height : 0))
851
+ };
852
+ var _margins_top, _margins_bottom, _margins_top1, _margins_bottom1;
879
853
  let maxHeight = heightGrowthDirection !== 'top' ? // We want the distance between the top of the overlay to the bottom of the boundary
880
- Math.max(0, boundaryDimensions.height + boundaryDimensions.top + ((_boundaryDimensions_scroll_top = boundaryDimensions.scroll.top) !== null && _boundaryDimensions_scroll_top !== void 0 ? _boundaryDimensions_scroll_top : 0) - overlayTop // this is the top of the overlay
854
+ Math.max(0, boundingRect.bottom // this is the bottom of the boundary
855
+ - overlayTop // this is the top of the overlay
881
856
  - (((_margins_top = margins.top) !== null && _margins_top !== void 0 ? _margins_top : 0) + ((_margins_bottom = margins.bottom) !== null && _margins_bottom !== void 0 ? _margins_bottom : 0) + padding // save additional space for margin and padding
882
857
  )) : Math.max(0, overlayTop + overlayHeight // this is the bottom of the overlay
883
- - (boundaryDimensions.top + ((_boundaryDimensions_scroll_top1 = boundaryDimensions.scroll.top) !== null && _boundaryDimensions_scroll_top1 !== void 0 ? _boundaryDimensions_scroll_top1 : 0) // this is the top of the boundary
884
- ) - (((_margins_top1 = margins.top) !== null && _margins_top1 !== void 0 ? _margins_top1 : 0) + ((_margins_bottom1 = margins.bottom) !== null && _margins_bottom1 !== void 0 ? _margins_bottom1 : 0) + padding // save additional space for margin and padding
858
+ - boundingRect.top // this is the top of the boundary
859
+ - (((_margins_top1 = margins.top) !== null && _margins_top1 !== void 0 ? _margins_top1 : 0) + ((_margins_bottom1 = margins.bottom) !== null && _margins_bottom1 !== void 0 ? _margins_bottom1 : 0) + padding // save additional space for margin and padding
885
860
  ));
886
- return Math.min(boundaryDimensions.height - padding * 2, maxHeight);
861
+ return maxHeight;
887
862
  }
888
- function $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo) {
863
+ function $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo, containerDimensions, isContainerDescendentOfBoundary) {
889
864
  let { placement: placement, axis: axis, size: size } = placementInfo;
890
- var _boundaryDimensions_scroll_axis, _margins_axis;
891
- if (placement === axis) return Math.max(0, childOffset[axis] - boundaryDimensions[axis] - ((_boundaryDimensions_scroll_axis = boundaryDimensions.scroll[axis]) !== null && _boundaryDimensions_scroll_axis !== void 0 ? _boundaryDimensions_scroll_axis : 0) + containerOffsetWithBoundary[axis] - ((_margins_axis = margins[axis]) !== null && _margins_axis !== void 0 ? _margins_axis : 0) - margins[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] - padding);
892
- var _margins_axis1;
893
- return Math.max(0, boundaryDimensions[size] + boundaryDimensions[axis] + boundaryDimensions.scroll[axis] - containerOffsetWithBoundary[axis] - childOffset[axis] - childOffset[size] - ((_margins_axis1 = margins[axis]) !== null && _margins_axis1 !== void 0 ? _margins_axis1 : 0) - margins[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] - padding);
894
- }
895
- function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset, overlaySize, scrollSize, margins, padding, flip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, userSetMaxHeight, arrowSize, arrowBoundaryOffset) {
865
+ var _containerDimensions_scroll_axis, _margins_axis;
866
+ if (placement === axis) return Math.max(0, childOffset[axis] // trigger start
867
+ - ((_containerDimensions_scroll_axis = containerDimensions.scroll[axis]) !== null && _containerDimensions_scroll_axis !== void 0 ? _containerDimensions_scroll_axis : 0 // transform trigger position to be with respect to viewport 0,0
868
+ ) - (boundaryDimensions[axis] + (isContainerDescendentOfBoundary ? containerOffsetWithBoundary[axis] : 0) // boundary start
869
+ ) - ((_margins_axis = margins[axis]) !== null && _margins_axis !== void 0 ? _margins_axis : 0 // margins usually for arrows or other decorations
870
+ ) - margins[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] - padding); // padding between overlay and boundary
871
+ var _containerDimensions_scroll_axis1, _margins_axis1;
872
+ return Math.max(0, boundaryDimensions[size] + boundaryDimensions[axis] + (isContainerDescendentOfBoundary ? containerOffsetWithBoundary[axis] : 0) - childOffset[axis] - childOffset[size] + ((_containerDimensions_scroll_axis1 = containerDimensions.scroll[axis]) !== null && _containerDimensions_scroll_axis1 !== void 0 ? _containerDimensions_scroll_axis1 : 0) - ((_margins_axis1 = margins[axis]) !== null && _margins_axis1 !== void 0 ? _margins_axis1 : 0) - margins[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] - padding);
873
+ }
874
+ function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset, overlaySize, scrollSize, margins, padding, flip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, userSetMaxHeight, arrowSize, arrowBoundaryOffset, isContainerDescendentOfBoundary, visualViewport) {
896
875
  let placementInfo = $edcf132a9284368a$var$parsePlacement(placementInput);
897
876
  let { size: size, crossAxis: crossAxis, crossSize: crossSize, placement: placement, crossPlacement: crossPlacement } = placementInfo;
898
- let position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
877
+ let position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset, containerDimensions);
899
878
  let normalizedOffset = offset;
900
- let space = $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, placementInfo);
879
+ let space = $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, placementInfo, containerDimensions, isContainerDescendentOfBoundary);
901
880
  // Check if the scroll size of the overlay is greater than the available space to determine if we need to flip
902
- if (flip && scrollSize[size] > space) {
881
+ if (flip && overlaySize[size] > space) {
903
882
  let flippedPlacementInfo = $edcf132a9284368a$var$parsePlacement(`${$edcf132a9284368a$var$FLIPPED_DIRECTION[placement]} ${crossPlacement}`);
904
- let flippedPosition = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, flippedPlacementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
905
- let flippedSpace = $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, flippedPlacementInfo);
883
+ let flippedPosition = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, flippedPlacementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset, containerDimensions);
884
+ let flippedSpace = $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, flippedPlacementInfo, containerDimensions, isContainerDescendentOfBoundary);
906
885
  // If the available space for the flipped position is greater than the original available space, flip.
907
886
  if (flippedSpace > space) {
908
887
  placementInfo = flippedPlacementInfo;
@@ -921,10 +900,10 @@ function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset,
921
900
  }
922
901
  let delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary);
923
902
  position[crossAxis] += delta;
924
- let maxHeight = $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlaySize.height, heightGrowthDirection);
903
+ let maxHeight = $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlaySize.height, heightGrowthDirection, containerDimensions, isContainerDescendentOfBoundary, visualViewport);
925
904
  if (userSetMaxHeight && userSetMaxHeight < maxHeight) maxHeight = userSetMaxHeight;
926
905
  overlaySize.height = Math.min(overlaySize.height, maxHeight);
927
- position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
906
+ position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset, containerDimensions);
928
907
  delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary);
929
908
  position[crossAxis] += delta;
930
909
  let arrowPosition = {};
@@ -970,6 +949,7 @@ function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset,
970
949
  }
971
950
  function $edcf132a9284368a$export$b3ceb0cbf1056d98(opts) {
972
951
  let { placement: placement, targetNode: targetNode, overlayNode: overlayNode, scrollNode: scrollNode, padding: padding, shouldFlip: shouldFlip, boundaryElement: boundaryElement, offset: offset, crossOffset: crossOffset, maxHeight: maxHeight, arrowSize: arrowSize = 0, arrowBoundaryOffset: arrowBoundaryOffset = 0 } = opts;
952
+ let visualViewport = $edcf132a9284368a$var$getVisualViewport();
973
953
  let container = overlayNode instanceof HTMLElement ? $edcf132a9284368a$var$getContainingBlock(overlayNode) : document.documentElement;
974
954
  let isViewportContainer = container === document.documentElement;
975
955
  const containerPositionStyle = window.getComputedStyle(container).position;
@@ -987,21 +967,46 @@ function $edcf132a9284368a$export$b3ceb0cbf1056d98(opts) {
987
967
  var _margins_top, _margins_bottom;
988
968
  overlaySize.height += ((_margins_top = margins.top) !== null && _margins_top !== void 0 ? _margins_top : 0) + ((_margins_bottom = margins.bottom) !== null && _margins_bottom !== void 0 ? _margins_bottom : 0);
989
969
  let scrollSize = $edcf132a9284368a$var$getScroll(scrollNode);
990
- let boundaryDimensions = $edcf132a9284368a$var$getContainerDimensions(boundaryElement);
991
- let containerDimensions = $edcf132a9284368a$var$getContainerDimensions(container);
992
- // If the container is the HTML element wrapping the body element, the retrieved scrollTop/scrollLeft will be equal to the
993
- // body element's scroll. Set the container's scroll values to 0 since the overlay's edge position value in getDelta don't then need to be further offset
994
- // by the container scroll since they are essentially the same containing element and thus in the same coordinate system
995
- let containerOffsetWithBoundary = boundaryElement.tagName === 'BODY' ? $edcf132a9284368a$var$getOffset(container, false) : $edcf132a9284368a$var$getPosition(container, boundaryElement, false);
996
- if (container.tagName === 'HTML' && boundaryElement.tagName === 'BODY') {
997
- containerDimensions.scroll.top = 0;
998
- containerDimensions.scroll.left = 0;
999
- }
1000
- return $edcf132a9284368a$export$6839422d1f33cee9(placement, childOffset, overlaySize, scrollSize, margins, padding, shouldFlip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, maxHeight, arrowSize, arrowBoundaryOffset);
970
+ // Note that due to logic inside getContainerDimensions, for cases where the boundary element is the body, we will return
971
+ // a height/width that matches the visual viewport size rather than the body's height/width (aka for zoom it will be zoom adjusted size)
972
+ // and a top/left that is adjusted as well (will return the top/left of the zoomed in viewport, or 0,0 for a non-zoomed body)
973
+ // Otherwise this returns the height/width of a arbitrary boundary element, and its top/left with respect to the viewport (NOTE THIS MEANS IT DOESNT INCLUDE SCROLL)
974
+ let boundaryDimensions = $edcf132a9284368a$var$getContainerDimensions(boundaryElement, visualViewport);
975
+ let containerDimensions = $edcf132a9284368a$var$getContainerDimensions(container, visualViewport);
976
+ // There are several difference cases of how to calculate the containerOffsetWithBoundary:
977
+ // - boundaryElement is body or HTML and the container is an arbitrary element in the boundary (aka submenu with parent menu as container in v3)
978
+ // - boundaryElement and container are both body or HTML element (aka standard popover case)
979
+ // - boundaryElement is customized by the user. Container can also be arbitrary (either body/HTML or some other element)
980
+ // containerOffsetWithBoundary should always return a value that is the boundary's coordinate offset with respect to the container coord system (container is 0, 0)
981
+ let containerOffsetWithBoundary;
982
+ if ((boundaryElement.tagName === 'BODY' || boundaryElement.tagName === 'HTML') && !isViewportContainer) {
983
+ // Use getRect instead of getOffset because boundaryDimensions for BODY/HTML is in viewport coordinate space,
984
+ // not document coordinate space
985
+ let containerRect = $edcf132a9284368a$export$4b834cebd9e5cebe(container, false);
986
+ // the offset should be negative because if container is at viewport position x,y, then viewport top (aka 0)
987
+ // is at position -x,y in container-relative coordinates
988
+ containerOffsetWithBoundary = {
989
+ top: -(containerRect.top - boundaryDimensions.top),
990
+ left: -(containerRect.left - boundaryDimensions.left),
991
+ width: 0,
992
+ height: 0
993
+ };
994
+ } else if ((boundaryElement.tagName === 'BODY' || boundaryElement.tagName === 'HTML') && isViewportContainer) // both are the same viewport container, no offset needed
995
+ containerOffsetWithBoundary = {
996
+ top: 0,
997
+ left: 0,
998
+ width: 0,
999
+ height: 0
1000
+ };
1001
+ else // This returns the boundary's coordinate with respect to the container. This case captures cases such as when you provide a custom boundary
1002
+ // like in ScrollingBoundaryContainerExample in Popover.stories.
1003
+ containerOffsetWithBoundary = $edcf132a9284368a$var$getPosition(boundaryElement, container, false);
1004
+ let isContainerDescendentOfBoundary = ($d4ee10de306f2510$export$4282f70798064fe0)(boundaryElement, container);
1005
+ return $edcf132a9284368a$export$6839422d1f33cee9(placement, childOffset, overlaySize, scrollSize, margins, padding, shouldFlip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, maxHeight, arrowSize, arrowBoundaryOffset, isContainerDescendentOfBoundary, visualViewport);
1001
1006
  }
1002
1007
  function $edcf132a9284368a$export$4b834cebd9e5cebe(node, ignoreScale) {
1003
1008
  let { top: top, left: left, width: width, height: height } = node.getBoundingClientRect();
1004
- // Use offsetWidth and offsetHeight if this is an HTML element, so that
1009
+ // Use offsetWidth and offsetHeight if this is an HTML element, so that
1005
1010
  // the size is not affected by scale transforms.
1006
1011
  if (ignoreScale && node instanceof node.ownerDocument.defaultView.HTMLElement) {
1007
1012
  width = node.offsetWidth;
@@ -1080,6 +1085,7 @@ function $edcf132a9284368a$var$isContainingBlock(node) {
1080
1085
  * OF ANY KIND, either express or implied. See the License for the specific language
1081
1086
  * governing permissions and limitations under the License.
1082
1087
  */
1088
+
1083
1089
  const $dd149f63282afbbf$export$f6211563215e3b37 = new WeakMap();
1084
1090
  function $dd149f63282afbbf$export$18fc8428861184da(opts) {
1085
1091
  let { triggerRef: triggerRef, isOpen: isOpen, onClose: onClose } = opts;
@@ -1087,13 +1093,13 @@ function $dd149f63282afbbf$export$18fc8428861184da(opts) {
1087
1093
  if (!isOpen || onClose === null) return;
1088
1094
  let onScroll = (e)=>{
1089
1095
  // Ignore if scrolling an scrollable region outside the trigger's tree.
1090
- let target = e.target;
1096
+ let target = ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e);
1091
1097
  // window is not a Node and doesn't have contain, but window contains everything
1092
- if (!triggerRef.current || target instanceof Node && !target.contains(triggerRef.current)) return;
1098
+ if (!triggerRef.current || target instanceof Node && !($d4ee10de306f2510$export$4282f70798064fe0)(target, triggerRef.current)) return;
1093
1099
  // Ignore scroll events on any input or textarea as the cursor position can cause it to scroll
1094
1100
  // such as in a combobox. Clicking the dropdown button places focus on the input, and if the
1095
1101
  // text inside the input extends beyond the 'end', then it will scroll so the cursor is visible at the end.
1096
- if (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) return;
1102
+ if (target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement) return;
1097
1103
  let onCloseHandler = onClose || $dd149f63282afbbf$export$f6211563215e3b37.get(triggerRef.current);
1098
1104
  if (onCloseHandler) onCloseHandler();
1099
1105
  };
@@ -1195,9 +1201,9 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
1195
1201
  // so it can be restored after repositioning. This way if the overlay height
1196
1202
  // changes, the focused element appears to stay in the same position.
1197
1203
  let anchor = null;
1198
- if (scrollRef.current && scrollRef.current.contains(document.activeElement)) {
1199
- var _document_activeElement;
1200
- let anchorRect = (_document_activeElement = document.activeElement) === null || _document_activeElement === void 0 ? void 0 : _document_activeElement.getBoundingClientRect();
1204
+ if (scrollRef.current && ($d4ee10de306f2510$export$b4f377a2b6254582)(scrollRef.current)) {
1205
+ var _getActiveElement;
1206
+ let anchorRect = (_getActiveElement = ($d4ee10de306f2510$export$cd4e5573fbe2b576)()) === null || _getActiveElement === void 0 ? void 0 : _getActiveElement.getBoundingClientRect();
1201
1207
  let scrollRect = scrollRef.current.getBoundingClientRect();
1202
1208
  var _anchorRect_top;
1203
1209
  // Anchor from the top if the offset is in the top half of the scrollable element,
@@ -1246,8 +1252,9 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
1246
1252
  Object.keys(position.position).forEach((key)=>overlay.style[key] = position.position[key] + 'px');
1247
1253
  overlay.style.maxHeight = position.maxHeight != null ? position.maxHeight + 'px' : '';
1248
1254
  // Restore scroll position relative to anchor element.
1249
- if (anchor && document.activeElement && scrollRef.current) {
1250
- let anchorRect = document.activeElement.getBoundingClientRect();
1255
+ let activeElement = ($d4ee10de306f2510$export$cd4e5573fbe2b576)();
1256
+ if (anchor && activeElement && scrollRef.current) {
1257
+ let anchorRect = activeElement.getBoundingClientRect();
1251
1258
  let scrollRect = scrollRef.current.getBoundingClientRect();
1252
1259
  let newOffset = anchorRect[anchor.type] - scrollRect[anchor.type];
1253
1260
  scrollRef.current.scrollTop += newOffset - anchor.offset;
@@ -1496,7 +1503,9 @@ function $f6c31cce2adf654f$var$usePressResponderContext(props) {
1496
1503
  // Consume context from <PressResponder> and merge with props.
1497
1504
  let context = (useContext)(($ae1eeba8b9eafd08$export$5165eccb35aaadb5));
1498
1505
  if (context) {
1499
- let { register: register, ...contextProps } = context;
1506
+ // Prevent mergeProps from merging ref.
1507
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1508
+ let { register: register, ref: ref, ...contextProps } = context;
1500
1509
  props = ($3ef42575df84b30b$export$9d1611c77c2fe928)(contextProps, props);
1501
1510
  register();
1502
1511
  }
@@ -1544,6 +1553,7 @@ class $f6c31cce2adf654f$var$PressEvent {
1544
1553
  this.altKey = originalEvent.altKey;
1545
1554
  this.x = x;
1546
1555
  this.y = y;
1556
+ this.key = originalEvent.key;
1547
1557
  }
1548
1558
  }
1549
1559
  const $f6c31cce2adf654f$var$LINK_CLICKED = Symbol('linkClicked');
@@ -1563,8 +1573,8 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
1563
1573
  pointerType: null,
1564
1574
  disposables: []
1565
1575
  });
1566
- let { addGlobalListener: addGlobalListener, removeAllGlobalListeners: removeAllGlobalListeners } = ($03deb23ff14920c4$export$4eaf04e54aa8eed6)();
1567
- let triggerPressStart = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)((originalEvent, pointerType)=>{
1576
+ let { addGlobalListener: addGlobalListener, removeAllGlobalListeners: removeAllGlobalListeners, removeGlobalListener: removeGlobalListener } = ($03deb23ff14920c4$export$4eaf04e54aa8eed6)();
1577
+ let triggerPressStart = (useCallback)((originalEvent, pointerType)=>{
1568
1578
  let state = ref.current;
1569
1579
  if (isDisabled || state.didFirePressStart) return false;
1570
1580
  let shouldStopPropagation = true;
@@ -1579,8 +1589,12 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
1579
1589
  state.didFirePressStart = true;
1580
1590
  setPressed(true);
1581
1591
  return shouldStopPropagation;
1582
- });
1583
- let triggerPressEnd = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)((originalEvent, pointerType, wasPressed = true)=>{
1592
+ }, [
1593
+ isDisabled,
1594
+ onPressStart,
1595
+ onPressChange
1596
+ ]);
1597
+ let triggerPressEnd = (useCallback)((originalEvent, pointerType, wasPressed = true)=>{
1584
1598
  let state = ref.current;
1585
1599
  if (!state.didFirePressStart) return false;
1586
1600
  state.didFirePressStart = false;
@@ -1600,8 +1614,14 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
1600
1614
  }
1601
1615
  state.isTriggeringEvent = false;
1602
1616
  return shouldStopPropagation;
1603
- });
1604
- let triggerPressUp = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)((originalEvent, pointerType)=>{
1617
+ }, [
1618
+ isDisabled,
1619
+ onPressEnd,
1620
+ onPressChange,
1621
+ onPress
1622
+ ]);
1623
+ let triggerPressEndEvent = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(triggerPressEnd);
1624
+ let triggerPressUp = (useCallback)((originalEvent, pointerType)=>{
1605
1625
  let state = ref.current;
1606
1626
  if (isDisabled) return false;
1607
1627
  if (onPressUp) {
@@ -1612,12 +1632,17 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
1612
1632
  return event.shouldStopPropagation;
1613
1633
  }
1614
1634
  return true;
1615
- });
1616
- let cancel = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)((e)=>{
1635
+ }, [
1636
+ isDisabled,
1637
+ onPressUp
1638
+ ]);
1639
+ let triggerPressUpEvent = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(triggerPressUp);
1640
+ let cancel = (useCallback)((e)=>{
1617
1641
  let state = ref.current;
1618
1642
  if (state.isPressed && state.target) {
1619
1643
  if (state.didFirePressStart && state.pointerType != null) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
1620
1644
  state.isPressed = false;
1645
+ setIsPointerPressed(null);
1621
1646
  state.isOverTarget = false;
1622
1647
  state.activePointerId = null;
1623
1648
  state.pointerType = null;
@@ -1626,14 +1651,27 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
1626
1651
  for (let dispose of state.disposables)dispose();
1627
1652
  state.disposables = [];
1628
1653
  }
1629
- });
1630
- let cancelOnPointerExit = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)((e)=>{
1654
+ }, [
1655
+ allowTextSelectionOnPress,
1656
+ removeAllGlobalListeners,
1657
+ triggerPressEnd
1658
+ ]);
1659
+ let cancelEvent = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(cancel);
1660
+ let cancelOnPointerExit = (useCallback)((e)=>{
1631
1661
  if (shouldCancelOnPointerExit) cancel(e);
1632
- });
1633
- let triggerClick = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)((e)=>{
1662
+ }, [
1663
+ shouldCancelOnPointerExit,
1664
+ cancel
1665
+ ]);
1666
+ let triggerClick = (useCallback)((e)=>{
1667
+ if (isDisabled) return;
1634
1668
  onClick === null || onClick === void 0 ? void 0 : onClick(e);
1635
- });
1636
- let triggerSyntheticClick = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)((e, target)=>{
1669
+ }, [
1670
+ isDisabled,
1671
+ onClick
1672
+ ]);
1673
+ let triggerSyntheticClick = (useCallback)((e, target)=>{
1674
+ if (isDisabled) return;
1637
1675
  // Some third-party libraries pass in onClick instead of onPress.
1638
1676
  // Create a fake mouse event and trigger onClick as well.
1639
1677
  // This matches the browser's native activation behavior for certain elements (e.g. button).
@@ -1644,14 +1682,154 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
1644
1682
  ($8a9cb279dc87e130$export$c2b7abe5d61ec696)(event, target);
1645
1683
  onClick(($8a9cb279dc87e130$export$525bc4921d56d4a)(event));
1646
1684
  }
1647
- });
1685
+ }, [
1686
+ isDisabled,
1687
+ onClick
1688
+ ]);
1689
+ let triggerSyntheticClickEvent = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(triggerSyntheticClick);
1690
+ let [isElemKeyPressed, setIsElemKeyPressed] = (useState)(false);
1691
+ ($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
1692
+ let state = ref.current;
1693
+ if (isElemKeyPressed) {
1694
+ let onKeyUp = (e)=>{
1695
+ var _state_metaKeyEvents;
1696
+ if (state.isPressed && state.target && $f6c31cce2adf654f$var$isValidKeyboardEvent(e, state.target)) {
1697
+ var _state_metaKeyEvents1;
1698
+ if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(($d4ee10de306f2510$export$e58f029f0fbfdb29)(e), e.key)) e.preventDefault();
1699
+ let target = ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e);
1700
+ let wasPressed = ($d4ee10de306f2510$export$4282f70798064fe0)(state.target, target);
1701
+ triggerPressEndEvent($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard', wasPressed);
1702
+ if (wasPressed) triggerSyntheticClickEvent(e, state.target);
1703
+ removeAllGlobalListeners();
1704
+ // If a link was triggered with a key other than Enter, open the URL ourselves.
1705
+ // This means the link has a role override, and the default browser behavior
1706
+ // only applies when using the Enter key.
1707
+ if (e.key !== 'Enter' && $f6c31cce2adf654f$var$isHTMLAnchorLink(state.target) && ($d4ee10de306f2510$export$4282f70798064fe0)(state.target, target) && !e[$f6c31cce2adf654f$var$LINK_CLICKED]) {
1708
+ // Store a hidden property on the event so we only trigger link click once,
1709
+ // even if there are multiple usePress instances attached to the element.
1710
+ e[$f6c31cce2adf654f$var$LINK_CLICKED] = true;
1711
+ ($ea8dcbcb9ea1b556$export$95185d699e05d4d7)(state.target, e, false);
1712
+ }
1713
+ state.isPressed = false;
1714
+ setIsElemKeyPressed(false);
1715
+ (_state_metaKeyEvents1 = state.metaKeyEvents) === null || _state_metaKeyEvents1 === void 0 ? void 0 : _state_metaKeyEvents1.delete(e.key);
1716
+ } else if (e.key === 'Meta' && ((_state_metaKeyEvents = state.metaKeyEvents) === null || _state_metaKeyEvents === void 0 ? void 0 : _state_metaKeyEvents.size)) {
1717
+ var _state_target;
1718
+ // If we recorded keydown events that occurred while the Meta key was pressed,
1719
+ // and those haven't received keyup events already, fire keyup events ourselves.
1720
+ // See comment above for more info about the macOS bug causing this.
1721
+ let events = state.metaKeyEvents;
1722
+ state.metaKeyEvents = undefined;
1723
+ for (let event of events.values())(_state_target = state.target) === null || _state_target === void 0 ? void 0 : _state_target.dispatchEvent(new KeyboardEvent('keyup', event));
1724
+ }
1725
+ };
1726
+ // Focus may move before the key up event, so register the event on the document
1727
+ // instead of the same element where the key down event occurred. Make it capturing so that it will trigger
1728
+ // before stopPropagation from useKeyboard on a child element may happen and thus we can still call triggerPress for the parent element.
1729
+ let originalTarget = state.target;
1730
+ let pressUp = (e)=>{
1731
+ if (originalTarget && $f6c31cce2adf654f$var$isValidKeyboardEvent(e, originalTarget) && !e.repeat && ($d4ee10de306f2510$export$4282f70798064fe0)(originalTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e)) && state.target) triggerPressUpEvent($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard');
1732
+ };
1733
+ let listener = ($ff5963eb1fccf552$export$e08e3b67e392101e)(pressUp, onKeyUp);
1734
+ addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'keyup', listener, true);
1735
+ return ()=>{
1736
+ removeGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'keyup', listener, true);
1737
+ };
1738
+ }
1739
+ }, [
1740
+ isElemKeyPressed,
1741
+ addGlobalListener,
1742
+ removeAllGlobalListeners,
1743
+ removeGlobalListener
1744
+ ]);
1745
+ let [isPointerPressed, setIsPointerPressed] = (useState)(null);
1746
+ ($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
1747
+ let state = ref.current;
1748
+ if (isPointerPressed === 'pointer') {
1749
+ let onPointerUp = (e)=>{
1750
+ if (e.pointerId === state.activePointerId && state.isPressed && e.button === 0 && state.target) {
1751
+ if (($d4ee10de306f2510$export$4282f70798064fe0)(state.target, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e)) && state.pointerType != null) {
1752
+ // Wait for onClick to fire onPress. This avoids browser issues when the DOM
1753
+ // is mutated between onPointerUp and onClick, and is more compatible with third party libraries.
1754
+ // https://github.com/adobe/react-spectrum/issues/1513
1755
+ // https://issues.chromium.org/issues/40732224
1756
+ // However, iOS and Android do not focus or fire onClick after a long press.
1757
+ // We work around this by triggering a click ourselves after a timeout.
1758
+ // This timeout is canceled during the click event in case the real one fires first.
1759
+ // The timeout must be at least 32ms, because Safari on iOS delays the click event on
1760
+ // non-form elements without certain ARIA roles (for hover emulation).
1761
+ // https://github.com/WebKit/WebKit/blob/dccfae42bb29bd4bdef052e469f604a9387241c0/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm#L875-L892
1762
+ let clicked = false;
1763
+ let timeout = setTimeout(()=>{
1764
+ if (state.isPressed && state.target instanceof HTMLElement) {
1765
+ if (clicked) cancelEvent(e);
1766
+ else {
1767
+ ($7215afc6de606d6b$export$de79e2c695e052f3)(state.target);
1768
+ state.target.click();
1769
+ }
1770
+ }
1771
+ }, 80);
1772
+ // Use a capturing listener to track if a click occurred.
1773
+ // If stopPropagation is called it may never reach our handler.
1774
+ if (e.currentTarget) addGlobalListener(e.currentTarget, 'click', ()=>clicked = true, true);
1775
+ state.disposables.push(()=>clearTimeout(timeout));
1776
+ } else cancelEvent(e);
1777
+ // Ignore subsequent onPointerLeave event before onClick on touch devices.
1778
+ state.isOverTarget = false;
1779
+ }
1780
+ };
1781
+ let onPointerCancel = (e)=>{
1782
+ cancelEvent(e);
1783
+ };
1784
+ addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'pointerup', onPointerUp, false);
1785
+ addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'pointercancel', onPointerCancel, false);
1786
+ return ()=>{
1787
+ removeGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'pointerup', onPointerUp, false);
1788
+ removeGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'pointercancel', onPointerCancel, false);
1789
+ };
1790
+ } else if (isPointerPressed === 'mouse' && process.env.NODE_ENV === 'test') {
1791
+ let onMouseUp = (e)=>{
1792
+ // Only handle left clicks
1793
+ if (e.button !== 0) return;
1794
+ if (state.ignoreEmulatedMouseEvents) {
1795
+ state.ignoreEmulatedMouseEvents = false;
1796
+ return;
1797
+ }
1798
+ if (state.target && ($d4ee10de306f2510$export$4282f70798064fe0)(state.target, e.target) && state.pointerType != null) ;
1799
+ else cancelEvent(e);
1800
+ state.isOverTarget = false;
1801
+ };
1802
+ addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'mouseup', onMouseUp, false);
1803
+ return ()=>{
1804
+ removeGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(state.target), 'mouseup', onMouseUp, false);
1805
+ };
1806
+ } else if (isPointerPressed === 'touch' && process.env.NODE_ENV === 'test') {
1807
+ let onScroll = (e)=>{
1808
+ if (state.isPressed && ($d4ee10de306f2510$export$4282f70798064fe0)(($d4ee10de306f2510$export$e58f029f0fbfdb29)(e), state.target)) cancelEvent({
1809
+ currentTarget: state.target,
1810
+ shiftKey: false,
1811
+ ctrlKey: false,
1812
+ metaKey: false,
1813
+ altKey: false
1814
+ });
1815
+ };
1816
+ addGlobalListener(($431fbd86ca7dc216$export$f21a1ffae260145a)(state.target), 'scroll', onScroll, true);
1817
+ return ()=>{
1818
+ removeGlobalListener(($431fbd86ca7dc216$export$f21a1ffae260145a)(state.target), 'scroll', onScroll, true);
1819
+ };
1820
+ }
1821
+ }, [
1822
+ isPointerPressed,
1823
+ addGlobalListener,
1824
+ removeGlobalListener
1825
+ ]);
1648
1826
  let pressProps = (useMemo)(()=>{
1649
1827
  let state = ref.current;
1650
1828
  let pressProps = {
1651
1829
  onKeyDown (e) {
1652
- if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e.nativeEvent, e.currentTarget) && ($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) {
1830
+ if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e.nativeEvent, e.currentTarget) && ($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) {
1653
1831
  var _state_metaKeyEvents;
1654
- if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent), e.key)) e.preventDefault();
1832
+ if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(($d4ee10de306f2510$export$e58f029f0fbfdb29)(e), e.key)) e.preventDefault();
1655
1833
  // If the event is repeating, it may have started on a different element
1656
1834
  // after which focus moved to the current element. Ignore these events and
1657
1835
  // only handle the first key down event.
@@ -1659,16 +1837,9 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
1659
1837
  if (!state.isPressed && !e.repeat) {
1660
1838
  state.target = e.currentTarget;
1661
1839
  state.isPressed = true;
1840
+ setIsElemKeyPressed(true);
1662
1841
  state.pointerType = 'keyboard';
1663
1842
  shouldStopPropagation = triggerPressStart(e, 'keyboard');
1664
- // Focus may move before the key up event, so register the event on the document
1665
- // instead of the same element where the key down event occurred. Make it capturing so that it will trigger
1666
- // before stopPropagation from useKeyboard on a child element may happen and thus we can still call triggerPress for the parent element.
1667
- let originalTarget = e.currentTarget;
1668
- let pressUp = (e)=>{
1669
- if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e, originalTarget) && !e.repeat && ($d4ee10de306f2510$export$4282f70798064fe0)(originalTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e)) && state.target) triggerPressUp($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard');
1670
- };
1671
- addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(e.currentTarget), 'keyup', ($ff5963eb1fccf552$export$e08e3b67e392101e)(pressUp, onKeyUp), true);
1672
1843
  }
1673
1844
  if (shouldStopPropagation) e.stopPropagation();
1674
1845
  // Keep track of the keydown events that occur while the Meta (e.g. Command) key is held.
@@ -1682,7 +1853,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
1682
1853
  } else if (e.key === 'Meta') state.metaKeyEvents = new Map();
1683
1854
  },
1684
1855
  onClick (e) {
1685
- if (e && !($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
1856
+ if (e && !($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
1686
1857
  if (e && e.button === 0 && !state.isTriggeringEvent && !($ea8dcbcb9ea1b556$export$95185d699e05d4d7).isOpening) {
1687
1858
  let shouldStopPropagation = true;
1688
1859
  if (isDisabled) e.preventDefault();
@@ -1708,41 +1879,10 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
1708
1879
  }
1709
1880
  }
1710
1881
  };
1711
- let onKeyUp = (e)=>{
1712
- var _state_metaKeyEvents;
1713
- if (state.isPressed && state.target && $f6c31cce2adf654f$var$isValidKeyboardEvent(e, state.target)) {
1714
- var _state_metaKeyEvents1;
1715
- if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(($d4ee10de306f2510$export$e58f029f0fbfdb29)(e), e.key)) e.preventDefault();
1716
- let target = ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e);
1717
- let wasPressed = ($d4ee10de306f2510$export$4282f70798064fe0)(state.target, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e));
1718
- triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard', wasPressed);
1719
- if (wasPressed) triggerSyntheticClick(e, state.target);
1720
- removeAllGlobalListeners();
1721
- // If a link was triggered with a key other than Enter, open the URL ourselves.
1722
- // This means the link has a role override, and the default browser behavior
1723
- // only applies when using the Enter key.
1724
- if (e.key !== 'Enter' && $f6c31cce2adf654f$var$isHTMLAnchorLink(state.target) && ($d4ee10de306f2510$export$4282f70798064fe0)(state.target, target) && !e[$f6c31cce2adf654f$var$LINK_CLICKED]) {
1725
- // Store a hidden property on the event so we only trigger link click once,
1726
- // even if there are multiple usePress instances attached to the element.
1727
- e[$f6c31cce2adf654f$var$LINK_CLICKED] = true;
1728
- ($ea8dcbcb9ea1b556$export$95185d699e05d4d7)(state.target, e, false);
1729
- }
1730
- state.isPressed = false;
1731
- (_state_metaKeyEvents1 = state.metaKeyEvents) === null || _state_metaKeyEvents1 === void 0 ? void 0 : _state_metaKeyEvents1.delete(e.key);
1732
- } else if (e.key === 'Meta' && ((_state_metaKeyEvents = state.metaKeyEvents) === null || _state_metaKeyEvents === void 0 ? void 0 : _state_metaKeyEvents.size)) {
1733
- var _state_target;
1734
- // If we recorded keydown events that occurred while the Meta key was pressed,
1735
- // and those haven't received keyup events already, fire keyup events ourselves.
1736
- // See comment above for more info about the macOS bug causing this.
1737
- let events = state.metaKeyEvents;
1738
- state.metaKeyEvents = undefined;
1739
- for (let event of events.values())(_state_target = state.target) === null || _state_target === void 0 ? void 0 : _state_target.dispatchEvent(new KeyboardEvent('keyup', event));
1740
- }
1741
- };
1742
1882
  if (typeof PointerEvent !== 'undefined') {
1743
1883
  pressProps.onPointerDown = (e)=>{
1744
1884
  // Only handle left clicks, and ignore events that bubbled through portals.
1745
- if (e.button !== 0 || !($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
1885
+ if (e.button !== 0 || !($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
1746
1886
  // iOS safari fires pointer events from VoiceOver with incorrect coordinates/target.
1747
1887
  // Ignore and let the onClick handler take care of it instead.
1748
1888
  // https://bugs.webkit.org/show_bug.cgi?id=222627
@@ -1755,6 +1895,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
1755
1895
  let shouldStopPropagation = true;
1756
1896
  if (!state.isPressed) {
1757
1897
  state.isPressed = true;
1898
+ setIsPointerPressed('pointer');
1758
1899
  state.isOverTarget = true;
1759
1900
  state.activePointerId = e.pointerId;
1760
1901
  state.target = e.currentTarget;
@@ -1762,15 +1903,17 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
1762
1903
  shouldStopPropagation = triggerPressStart(e, state.pointerType);
1763
1904
  // Release pointer capture so that touch interactions can leave the original target.
1764
1905
  // This enables onPointerLeave and onPointerEnter to fire.
1765
- let target = ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent);
1766
- if ('releasePointerCapture' in target) target.releasePointerCapture(e.pointerId);
1767
- addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(e.currentTarget), 'pointerup', onPointerUp, false);
1768
- addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(e.currentTarget), 'pointercancel', onPointerCancel, false);
1906
+ let target = ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e);
1907
+ if ('releasePointerCapture' in target) {
1908
+ if ('hasPointerCapture' in target) {
1909
+ if (target.hasPointerCapture(e.pointerId)) target.releasePointerCapture(e.pointerId);
1910
+ } else target.releasePointerCapture(e.pointerId);
1911
+ }
1769
1912
  }
1770
1913
  if (shouldStopPropagation) e.stopPropagation();
1771
1914
  };
1772
1915
  pressProps.onMouseDown = (e)=>{
1773
- if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
1916
+ if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
1774
1917
  if (e.button === 0) {
1775
1918
  if (preventFocusOnPress) {
1776
1919
  let dispose = ($8a9cb279dc87e130$export$cabe61c495ee3649)(e.target);
@@ -1781,7 +1924,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
1781
1924
  };
1782
1925
  pressProps.onPointerUp = (e)=>{
1783
1926
  // iOS fires pointerup with zero width and height, so check the pointerType recorded during pointerdown.
1784
- if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent)) || state.pointerType === 'virtual') return;
1927
+ if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e)) || state.pointerType === 'virtual') return;
1785
1928
  // Only handle left clicks. If isPressed is true, delay until onClick.
1786
1929
  if (e.button === 0 && !state.isPressed) triggerPressUp(e, state.pointerType || e.pointerType);
1787
1930
  };
@@ -1798,43 +1941,8 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
1798
1941
  cancelOnPointerExit(e);
1799
1942
  }
1800
1943
  };
1801
- let onPointerUp = (e)=>{
1802
- if (e.pointerId === state.activePointerId && state.isPressed && e.button === 0 && state.target) {
1803
- if (($d4ee10de306f2510$export$4282f70798064fe0)(state.target, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e)) && state.pointerType != null) {
1804
- // Wait for onClick to fire onPress. This avoids browser issues when the DOM
1805
- // is mutated between onPointerUp and onClick, and is more compatible with third party libraries.
1806
- // https://github.com/adobe/react-spectrum/issues/1513
1807
- // https://issues.chromium.org/issues/40732224
1808
- // However, iOS and Android do not focus or fire onClick after a long press.
1809
- // We work around this by triggering a click ourselves after a timeout.
1810
- // This timeout is canceled during the click event in case the real one fires first.
1811
- // The timeout must be at least 32ms, because Safari on iOS delays the click event on
1812
- // non-form elements without certain ARIA roles (for hover emulation).
1813
- // https://github.com/WebKit/WebKit/blob/dccfae42bb29bd4bdef052e469f604a9387241c0/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm#L875-L892
1814
- let clicked = false;
1815
- let timeout = setTimeout(()=>{
1816
- if (state.isPressed && state.target instanceof HTMLElement) {
1817
- if (clicked) cancel(e);
1818
- else {
1819
- ($7215afc6de606d6b$export$de79e2c695e052f3)(state.target);
1820
- state.target.click();
1821
- }
1822
- }
1823
- }, 80);
1824
- // Use a capturing listener to track if a click occurred.
1825
- // If stopPropagation is called it may never reach our handler.
1826
- addGlobalListener(e.currentTarget, 'click', ()=>clicked = true, true);
1827
- state.disposables.push(()=>clearTimeout(timeout));
1828
- } else cancel(e);
1829
- // Ignore subsequent onPointerLeave event before onClick on touch devices.
1830
- state.isOverTarget = false;
1831
- }
1832
- };
1833
- let onPointerCancel = (e)=>{
1834
- cancel(e);
1835
- };
1836
1944
  pressProps.onDragStart = (e)=>{
1837
- if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
1945
+ if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
1838
1946
  // Safari does not call onPointerCancel when a drag starts, whereas Chrome and Firefox do.
1839
1947
  cancel(e);
1840
1948
  };
@@ -1843,12 +1951,13 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
1843
1951
  // All browsers now support pointer events, but JSDOM still does not.
1844
1952
  pressProps.onMouseDown = (e)=>{
1845
1953
  // Only handle left clicks
1846
- if (e.button !== 0 || !($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
1954
+ if (e.button !== 0 || !($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
1847
1955
  if (state.ignoreEmulatedMouseEvents) {
1848
1956
  e.stopPropagation();
1849
1957
  return;
1850
1958
  }
1851
1959
  state.isPressed = true;
1960
+ setIsPointerPressed('mouse');
1852
1961
  state.isOverTarget = true;
1853
1962
  state.target = e.currentTarget;
1854
1963
  state.pointerType = ($6a7db85432448f7f$export$60278871457622de)(e.nativeEvent) ? 'virtual' : 'mouse';
@@ -1859,10 +1968,9 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
1859
1968
  let dispose = ($8a9cb279dc87e130$export$cabe61c495ee3649)(e.target);
1860
1969
  if (dispose) state.disposables.push(dispose);
1861
1970
  }
1862
- addGlobalListener(($431fbd86ca7dc216$export$b204af158042fbac)(e.currentTarget), 'mouseup', onMouseUp, false);
1863
1971
  };
1864
1972
  pressProps.onMouseEnter = (e)=>{
1865
- if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
1973
+ if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
1866
1974
  let shouldStopPropagation = true;
1867
1975
  if (state.isPressed && !state.ignoreEmulatedMouseEvents && state.pointerType != null) {
1868
1976
  state.isOverTarget = true;
@@ -1871,7 +1979,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
1871
1979
  if (shouldStopPropagation) e.stopPropagation();
1872
1980
  };
1873
1981
  pressProps.onMouseLeave = (e)=>{
1874
- if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
1982
+ if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
1875
1983
  let shouldStopPropagation = true;
1876
1984
  if (state.isPressed && !state.ignoreEmulatedMouseEvents && state.pointerType != null) {
1877
1985
  state.isOverTarget = false;
@@ -1881,37 +1989,26 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
1881
1989
  if (shouldStopPropagation) e.stopPropagation();
1882
1990
  };
1883
1991
  pressProps.onMouseUp = (e)=>{
1884
- if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
1992
+ if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
1885
1993
  if (!state.ignoreEmulatedMouseEvents && e.button === 0 && !state.isPressed) triggerPressUp(e, state.pointerType || 'mouse');
1886
1994
  };
1887
- let onMouseUp = (e)=>{
1888
- // Only handle left clicks
1889
- if (e.button !== 0) return;
1890
- if (state.ignoreEmulatedMouseEvents) {
1891
- state.ignoreEmulatedMouseEvents = false;
1892
- return;
1893
- }
1894
- if (state.target && state.target.contains(e.target) && state.pointerType != null) ;
1895
- else cancel(e);
1896
- state.isOverTarget = false;
1897
- };
1898
1995
  pressProps.onTouchStart = (e)=>{
1899
- if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
1996
+ if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
1900
1997
  let touch = $f6c31cce2adf654f$var$getTouchFromEvent(e.nativeEvent);
1901
1998
  if (!touch) return;
1902
1999
  state.activePointerId = touch.identifier;
1903
2000
  state.ignoreEmulatedMouseEvents = true;
1904
2001
  state.isOverTarget = true;
1905
2002
  state.isPressed = true;
2003
+ setIsPointerPressed('touch');
1906
2004
  state.target = e.currentTarget;
1907
2005
  state.pointerType = 'touch';
1908
2006
  if (!allowTextSelectionOnPress) ($14c0b72509d70225$export$16a4697467175487)(state.target);
1909
2007
  let shouldStopPropagation = triggerPressStart($f6c31cce2adf654f$var$createTouchEvent(state.target, e), state.pointerType);
1910
2008
  if (shouldStopPropagation) e.stopPropagation();
1911
- addGlobalListener(($431fbd86ca7dc216$export$f21a1ffae260145a)(e.currentTarget), 'scroll', onScroll, true);
1912
2009
  };
1913
2010
  pressProps.onTouchMove = (e)=>{
1914
- if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
2011
+ if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
1915
2012
  if (!state.isPressed) {
1916
2013
  e.stopPropagation();
1917
2014
  return;
@@ -1931,7 +2028,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
1931
2028
  if (shouldStopPropagation) e.stopPropagation();
1932
2029
  };
1933
2030
  pressProps.onTouchEnd = (e)=>{
1934
- if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
2031
+ if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
1935
2032
  if (!state.isPressed) {
1936
2033
  e.stopPropagation();
1937
2034
  return;
@@ -1945,6 +2042,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
1945
2042
  } else if (state.isOverTarget && state.pointerType != null) shouldStopPropagation = triggerPressEnd($f6c31cce2adf654f$var$createTouchEvent(state.target, e), state.pointerType, false);
1946
2043
  if (shouldStopPropagation) e.stopPropagation();
1947
2044
  state.isPressed = false;
2045
+ setIsPointerPressed(null);
1948
2046
  state.activePointerId = null;
1949
2047
  state.isOverTarget = false;
1950
2048
  state.ignoreEmulatedMouseEvents = true;
@@ -1952,27 +2050,17 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
1952
2050
  removeAllGlobalListeners();
1953
2051
  };
1954
2052
  pressProps.onTouchCancel = (e)=>{
1955
- if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
2053
+ if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
1956
2054
  e.stopPropagation();
1957
2055
  if (state.isPressed) cancel($f6c31cce2adf654f$var$createTouchEvent(state.target, e));
1958
2056
  };
1959
- let onScroll = (e)=>{
1960
- if (state.isPressed && ($d4ee10de306f2510$export$4282f70798064fe0)(($d4ee10de306f2510$export$e58f029f0fbfdb29)(e), state.target)) cancel({
1961
- currentTarget: state.target,
1962
- shiftKey: false,
1963
- ctrlKey: false,
1964
- metaKey: false,
1965
- altKey: false
1966
- });
1967
- };
1968
2057
  pressProps.onDragStart = (e)=>{
1969
- if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e.nativeEvent))) return;
2058
+ if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
1970
2059
  cancel(e);
1971
2060
  };
1972
2061
  }
1973
2062
  return pressProps;
1974
2063
  }, [
1975
- addGlobalListener,
1976
2064
  isDisabled,
1977
2065
  preventFocusOnPress,
1978
2066
  removeAllGlobalListeners,
@@ -2077,7 +2165,8 @@ function $f6c31cce2adf654f$var$createEvent(target, e) {
2077
2165
  metaKey: e.metaKey,
2078
2166
  altKey: e.altKey,
2079
2167
  clientX: clientX,
2080
- clientY: clientY
2168
+ clientY: clientY,
2169
+ key: e.key
2081
2170
  };
2082
2171
  }
2083
2172
  function $f6c31cce2adf654f$var$getPointClientRect(point) {
@@ -2200,16 +2289,15 @@ const $3b117e43dc0ca95d$export$27c701ed9e449e99 = /*#__PURE__*/ (React__default)
2200
2289
  const $f1ab8c75478c6f73$export$3351871ee4b288b8 = /*#__PURE__*/ (React__default).forwardRef(({ children: children, ...props }, ref)=>{
2201
2290
  let isRegistered = (useRef)(false);
2202
2291
  let prevContext = (useContext)(($ae1eeba8b9eafd08$export$5165eccb35aaadb5));
2203
- ref = ($df56164dff5785e2$export$4338b53315abf666)(ref || (prevContext === null || prevContext === void 0 ? void 0 : prevContext.ref));
2204
2292
  let context = ($3ef42575df84b30b$export$9d1611c77c2fe928)(prevContext || {}, {
2205
2293
  ...props,
2206
- ref: ref,
2207
2294
  register () {
2208
2295
  isRegistered.current = true;
2209
2296
  if (prevContext) prevContext.register();
2210
2297
  }
2211
2298
  });
2212
- ($e7801be82b4b2a53$export$4debdb1a3f0fa79e)(prevContext, ref);
2299
+ context.ref = ($df56164dff5785e2$export$4338b53315abf666)(ref || (prevContext === null || prevContext === void 0 ? void 0 : prevContext.ref));
2300
+ ($e7801be82b4b2a53$export$4debdb1a3f0fa79e)(prevContext, context.ref);
2213
2301
  (useEffect)(()=>{
2214
2302
  if (!isRegistered.current) {
2215
2303
  if (process.env.NODE_ENV !== 'production') console.warn("A PressResponder was rendered without a pressable child. Either call the usePress hook, or wrap your DOM node with <Pressable> component.");
@@ -2304,19 +2392,18 @@ function $e0b6e0b68ec7f50f$export$872b660ac5a1ff98(props) {
2304
2392
  }
2305
2393
  }, [
2306
2394
  ref,
2307
- isDisabled,
2308
- onPointerDown,
2309
- triggerInteractOutside
2395
+ isDisabled
2310
2396
  ]);
2311
2397
  }
2312
2398
  function $e0b6e0b68ec7f50f$var$isValidEvent(event, ref) {
2313
2399
  if (event.button > 0) return false;
2314
- if (event.target) {
2400
+ let target = ($d4ee10de306f2510$export$e58f029f0fbfdb29)(event);
2401
+ if (target) {
2315
2402
  // if the event target is no longer in the document, ignore
2316
- const ownerDocument = event.target.ownerDocument;
2317
- if (!ownerDocument || !ownerDocument.documentElement.contains(event.target)) return false;
2403
+ const ownerDocument = target.ownerDocument;
2404
+ if (!ownerDocument || !($d4ee10de306f2510$export$4282f70798064fe0)(ownerDocument.documentElement, target)) return false;
2318
2405
  // If the target is within a top layer element (e.g. toasts), ignore.
2319
- if (event.target.closest('[data-react-aria-top-layer]')) return false;
2406
+ if (target.closest('[data-react-aria-top-layer]')) return false;
2320
2407
  }
2321
2408
  if (!ref.current) return false;
2322
2409
  // When the event source is inside a Shadow DOM, event.target is just the shadow root.
@@ -2603,22 +2690,23 @@ function $9bf71ea28793e738$var$shouldContainFocus(scopeRef) {
2603
2690
  }
2604
2691
  return true;
2605
2692
  }
2693
+ function $9bf71ea28793e738$var$getRadiosInGroup(element) {
2694
+ if (!element.form) // Radio buttons outside a form - query the document
2695
+ return Array.from(($431fbd86ca7dc216$export$b204af158042fbac)(element).querySelectorAll(`input[type="radio"][name="${CSS.escape(element.name)}"]`)).filter((radio)=>!radio.form);
2696
+ // namedItem returns RadioNodeList (iterable) for 2+ elements, but a single Element for exactly 1.
2697
+ // https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormControlsCollection/namedItem
2698
+ const radioList = element.form.elements.namedItem(element.name);
2699
+ let ownerWindow = ($431fbd86ca7dc216$export$f21a1ffae260145a)(element);
2700
+ if (radioList instanceof ownerWindow.RadioNodeList) return Array.from(radioList).filter((el)=>el instanceof ownerWindow.HTMLInputElement);
2701
+ if (radioList instanceof ownerWindow.HTMLInputElement) return [
2702
+ radioList
2703
+ ];
2704
+ return [];
2705
+ }
2606
2706
  function $9bf71ea28793e738$var$isTabbableRadio(element) {
2607
2707
  if (element.checked) return true;
2608
- let radios = [];
2609
- if (!element.form) radios = [
2610
- ...($431fbd86ca7dc216$export$b204af158042fbac)(element).querySelectorAll(`input[type="radio"][name="${CSS.escape(element.name)}"]`)
2611
- ].filter((radio)=>!radio.form);
2612
- else {
2613
- var _element_form_elements, _element_form;
2614
- let radioList = (_element_form = element.form) === null || _element_form === void 0 ? void 0 : (_element_form_elements = _element_form.elements) === null || _element_form_elements === void 0 ? void 0 : _element_form_elements.namedItem(element.name);
2615
- radios = [
2616
- ...radioList !== null && radioList !== void 0 ? radioList : []
2617
- ];
2618
- }
2619
- if (!radios) return false;
2620
- let anyChecked = radios.some((radio)=>radio.checked);
2621
- return !anyChecked;
2708
+ const radios = $9bf71ea28793e738$var$getRadiosInGroup(element);
2709
+ return radios.length > 0 && !radios.some((radio)=>radio.checked);
2622
2710
  }
2623
2711
  function $9bf71ea28793e738$var$useFocusContainment(scopeRef, contain) {
2624
2712
  let focusedNode = (useRef)(undefined);
@@ -2718,7 +2806,7 @@ function $9bf71ea28793e738$var$isElementInAnyScope(element) {
2718
2806
  function $9bf71ea28793e738$var$isElementInScope(element, scope) {
2719
2807
  if (!element) return false;
2720
2808
  if (!scope) return false;
2721
- return scope.some((node)=>node.contains(element));
2809
+ return scope.some((node)=>($d4ee10de306f2510$export$4282f70798064fe0)(node, element));
2722
2810
  }
2723
2811
  function $9bf71ea28793e738$var$isElementInChildScope(element, scope = null) {
2724
2812
  // If the element is within a top layer element (e.g. toasts), always allow moving focus there.
@@ -2965,9 +3053,8 @@ function $9bf71ea28793e738$export$2d6ec8fc375ceafa(root, opts, scope) {
2965
3053
  // Create a TreeWalker, ensuring the root is an Element or Document
2966
3054
  let walker = ($dfc540311bf7f109$export$4d0f8be8b12a7ef6)(doc, root || doc, NodeFilter.SHOW_ELEMENT, {
2967
3055
  acceptNode (node) {
2968
- var _opts_from;
2969
3056
  // Skip nodes inside the starting node.
2970
- if (opts === null || opts === void 0 ? void 0 : (_opts_from = opts.from) === null || _opts_from === void 0 ? void 0 : _opts_from.contains(node)) return NodeFilter.FILTER_REJECT;
3057
+ if (($d4ee10de306f2510$export$4282f70798064fe0)(opts === null || opts === void 0 ? void 0 : opts.from, node)) return NodeFilter.FILTER_REJECT;
2971
3058
  if ((opts === null || opts === void 0 ? void 0 : opts.tabbable) && node.tagName === 'INPUT' && node.getAttribute('type') === 'radio') {
2972
3059
  // If the radio is in a form, we can get all the other radios by name
2973
3060
  if (!$9bf71ea28793e738$var$isTabbableRadio(node)) return NodeFilter.FILTER_REJECT;
@@ -3100,9 +3187,11 @@ function $55f9b1ae81f22853$export$759df0d867455a91(document) {
3100
3187
  */
3101
3188
 
3102
3189
 
3190
+
3103
3191
  const $a11501f3d1d39e6c$var$visibleOverlays = [];
3104
3192
  function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
3105
3193
  let { onClose: onClose, shouldCloseOnBlur: shouldCloseOnBlur, isOpen: isOpen, isDismissable: isDismissable = false, isKeyboardDismissDisabled: isKeyboardDismissDisabled = false, shouldCloseOnInteractOutside: shouldCloseOnInteractOutside } = props;
3194
+ let lastVisibleOverlay = (useRef)(undefined);
3106
3195
  // Add the overlay ref to the stack of visible overlays on mount, and remove on unmount.
3107
3196
  (useEffect)(()=>{
3108
3197
  if (isOpen && !$a11501f3d1d39e6c$var$visibleOverlays.includes(ref)) {
@@ -3121,21 +3210,24 @@ function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
3121
3210
  if ($a11501f3d1d39e6c$var$visibleOverlays[$a11501f3d1d39e6c$var$visibleOverlays.length - 1] === ref && onClose) onClose();
3122
3211
  };
3123
3212
  let onInteractOutsideStart = (e)=>{
3124
- if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.target)) {
3125
- if ($a11501f3d1d39e6c$var$visibleOverlays[$a11501f3d1d39e6c$var$visibleOverlays.length - 1] === ref) {
3213
+ const topMostOverlay = $a11501f3d1d39e6c$var$visibleOverlays[$a11501f3d1d39e6c$var$visibleOverlays.length - 1];
3214
+ lastVisibleOverlay.current = topMostOverlay;
3215
+ if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) {
3216
+ if (topMostOverlay === ref) {
3126
3217
  e.stopPropagation();
3127
3218
  e.preventDefault();
3128
3219
  }
3129
3220
  }
3130
3221
  };
3131
3222
  let onInteractOutside = (e)=>{
3132
- if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.target)) {
3223
+ if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) {
3133
3224
  if ($a11501f3d1d39e6c$var$visibleOverlays[$a11501f3d1d39e6c$var$visibleOverlays.length - 1] === ref) {
3134
3225
  e.stopPropagation();
3135
3226
  e.preventDefault();
3136
3227
  }
3137
- onHide();
3228
+ if (lastVisibleOverlay.current === ref) onHide();
3138
3229
  }
3230
+ lastVisibleOverlay.current = undefined;
3139
3231
  };
3140
3232
  // Handle the escape key
3141
3233
  let onKeyDown = (e)=>{
@@ -3169,7 +3261,7 @@ function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
3169
3261
  });
3170
3262
  let onPointerDownUnderlay = (e)=>{
3171
3263
  // fixes a firefox issue that starts text selection https://bugzilla.mozilla.org/show_bug.cgi?id=1675846
3172
- if (e.target === e.currentTarget) e.preventDefault();
3264
+ if (($d4ee10de306f2510$export$e58f029f0fbfdb29)(e) === e.currentTarget) e.preventDefault();
3173
3265
  };
3174
3266
  return {
3175
3267
  overlayProps: {
@@ -3236,18 +3328,6 @@ function $628037886ba31236$export$f9d5c8beee7d008d(props, state, ref) {
3236
3328
  * governing permissions and limitations under the License.
3237
3329
  */
3238
3330
  const $49c51c25361d4cd2$var$visualViewport = typeof document !== 'undefined' && window.visualViewport;
3239
- // HTML input types that do not cause the software keyboard to appear.
3240
- const $49c51c25361d4cd2$var$nonTextInputTypes = new Set([
3241
- 'checkbox',
3242
- 'radio',
3243
- 'range',
3244
- 'color',
3245
- 'file',
3246
- 'image',
3247
- 'button',
3248
- 'submit',
3249
- 'reset'
3250
- ]);
3251
3331
  // The number of active usePreventScroll calls. Used to determine whether to revert back to the original page style/scroll position
3252
3332
  let $49c51c25361d4cd2$var$preventScrollCount = 0;
3253
3333
  let $49c51c25361d4cd2$var$restore;
@@ -3292,29 +3372,46 @@ function $49c51c25361d4cd2$var$preventScrollStandard() {
3292
3372
  // on the window.
3293
3373
  // 2. Set `overscroll-behavior: contain` on nested scrollable regions so they do not scroll the page when at
3294
3374
  // the top or bottom. Work around a bug where this does not work when the element does not actually overflow
3295
- // by preventing default in a `touchmove` event.
3375
+ // by preventing default in a `touchmove` event. This is best effort: we can't prevent default when pinch
3376
+ // zooming or when an element contains text selection, which may allow scrolling in some cases.
3296
3377
  // 3. Prevent default on `touchend` events on input elements and handle focusing the element ourselves.
3297
- // 4. When focusing an input, apply a transform to trick Safari into thinking the input is at the top
3298
- // of the page, which prevents it from scrolling the page. After the input is focused, scroll the element
3299
- // into view ourselves, without scrolling the whole page.
3300
- // 5. Offset the body by the scroll position using a negative margin and scroll to the top. This should appear the
3301
- // same visually, but makes the actual scroll position always zero. This is required to make all of the
3302
- // above work or Safari will still try to scroll the page when focusing an input.
3303
- // 6. As a last resort, handle window scroll events, and scroll back to the top. This can happen when attempting
3304
- // to navigate to an input with the next/previous buttons that's outside a modal.
3378
+ // 4. When focus moves to an input, create an off screen input and focus that temporarily. This prevents
3379
+ // Safari from scrolling the page. After a small delay, focus the real input and scroll it into view
3380
+ // ourselves, without scrolling the whole page.
3305
3381
  function $49c51c25361d4cd2$var$preventScrollMobileSafari() {
3382
+ // Set overflow hidden so scrollIntoViewport() (useSelectableCollection) sees isScrollPrevented and
3383
+ // scrolls only scroll parents instead of calling native scrollIntoView() which moves the window.
3384
+ let restoreOverflow = $49c51c25361d4cd2$var$setStyle(document.documentElement, 'overflow', 'hidden');
3306
3385
  let scrollable;
3307
- let restoreScrollableStyles;
3386
+ let allowTouchMove = false;
3308
3387
  let onTouchStart = (e)=>{
3309
3388
  // Store the nearest scrollable parent element from the element that the user touched.
3310
- scrollable = ($62d8ded9296f3872$export$cfa2225e87938781)(e.target, true);
3311
- if (scrollable === document.documentElement && scrollable === document.body) return;
3312
- // Prevent scrolling up when at the top and scrolling down when at the bottom
3313
- // of a nested scrollable area, otherwise mobile Safari will start scrolling
3314
- // the window instead.
3315
- if (scrollable instanceof HTMLElement && window.getComputedStyle(scrollable).overscrollBehavior === 'auto') restoreScrollableStyles = $49c51c25361d4cd2$var$setStyle(scrollable, 'overscrollBehavior', 'contain');
3389
+ let target = ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e);
3390
+ scrollable = ($cc38e7bd3fc7b213$export$2bb74740c4e19def)(target) ? target : ($62d8ded9296f3872$export$cfa2225e87938781)(target, true);
3391
+ allowTouchMove = false;
3392
+ // If the target is selected, don't preventDefault in touchmove to allow user to adjust selection.
3393
+ let selection = target.ownerDocument.defaultView.getSelection();
3394
+ if (selection && !selection.isCollapsed && selection.containsNode(target, true)) allowTouchMove = true;
3395
+ // If this is a range input, allow touch move to allow user to adjust the slider value
3396
+ if (e.composedPath().some((el)=>el instanceof HTMLInputElement && el.type === 'range')) allowTouchMove = true;
3397
+ // If this is a focused input element with a selected range, allow user to drag the selection handles.
3398
+ if ('selectionStart' in target && 'selectionEnd' in target && target.selectionStart < target.selectionEnd && target.ownerDocument.activeElement === target) allowTouchMove = true;
3316
3399
  };
3400
+ // Prevent scrolling up when at the top and scrolling down when at the bottom
3401
+ // of a nested scrollable area, otherwise mobile Safari will start scrolling
3402
+ // the window instead.
3403
+ // This must be applied before the touchstart event as of iOS 26, so inject it as a <style> element.
3404
+ let style = document.createElement('style');
3405
+ style.textContent = `
3406
+ @layer {
3407
+ * {
3408
+ overscroll-behavior: contain;
3409
+ }
3410
+ }`.trim();
3411
+ document.head.prepend(style);
3317
3412
  let onTouchMove = (e)=>{
3413
+ // Allow pinch-zooming.
3414
+ if (e.touches.length === 2 || allowTouchMove) return;
3318
3415
  // Prevent scrolling the window.
3319
3416
  if (!scrollable || scrollable === document.documentElement || scrollable === document.body) {
3320
3417
  e.preventDefault();
@@ -3328,53 +3425,40 @@ function $49c51c25361d4cd2$var$preventScrollMobileSafari() {
3328
3425
  // because it must be set before the touchstart event.
3329
3426
  if (scrollable.scrollHeight === scrollable.clientHeight && scrollable.scrollWidth === scrollable.clientWidth) e.preventDefault();
3330
3427
  };
3331
- let onTouchEnd = ()=>{
3332
- if (restoreScrollableStyles) restoreScrollableStyles();
3333
- };
3334
- let onFocus = (e)=>{
3335
- let target = e.target;
3336
- if ($49c51c25361d4cd2$var$willOpenKeyboard(target)) {
3337
- setupStyles();
3338
- // Apply a transform to trick Safari into thinking the input is at the top of the page
3339
- // so it doesn't try to scroll it into view.
3340
- target.style.transform = 'translateY(-2000px)';
3341
- requestAnimationFrame(()=>{
3342
- target.style.transform = '';
3343
- // This will have prevented the browser from scrolling the focused element into view,
3344
- // so we need to do this ourselves in a way that doesn't cause the whole page to scroll.
3345
- if ($49c51c25361d4cd2$var$visualViewport) {
3346
- if ($49c51c25361d4cd2$var$visualViewport.height < window.innerHeight) // If the keyboard is already visible, do this after one additional frame
3347
- // to wait for the transform to be removed.
3348
- requestAnimationFrame(()=>{
3349
- $49c51c25361d4cd2$var$scrollIntoView(target);
3350
- });
3351
- else // Otherwise, wait for the visual viewport to resize before scrolling so we can
3352
- // measure the correct position to scroll to.
3353
- $49c51c25361d4cd2$var$visualViewport.addEventListener('resize', ()=>$49c51c25361d4cd2$var$scrollIntoView(target), {
3354
- once: true
3355
- });
3356
- }
3428
+ let onBlur = (e)=>{
3429
+ let target = ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e);
3430
+ let relatedTarget = e.relatedTarget;
3431
+ if (relatedTarget && ($21f1aa98acb08317$export$c57958e35f31ed73)(relatedTarget)) {
3432
+ // Focus without scrolling the whole page, and then scroll into view manually.
3433
+ relatedTarget.focus({
3434
+ preventScroll: true
3435
+ });
3436
+ $49c51c25361d4cd2$var$scrollIntoViewWhenReady(relatedTarget, ($21f1aa98acb08317$export$c57958e35f31ed73)(target));
3437
+ } else if (!relatedTarget) {
3438
+ var _target_parentElement;
3439
+ // When tapping the Done button on the keyboard, focus moves to the body.
3440
+ // FocusScope will then restore focus back to the input. Later when tapping
3441
+ // the same input again, it is already focused, so no blur event will fire,
3442
+ // resulting in the flow above never running and Safari's native scrolling occurring.
3443
+ // Instead, move focus to the parent focusable element (e.g. the dialog).
3444
+ let focusable = (_target_parentElement = target.parentElement) === null || _target_parentElement === void 0 ? void 0 : _target_parentElement.closest('[tabindex]');
3445
+ focusable === null || focusable === void 0 ? void 0 : focusable.focus({
3446
+ preventScroll: true
3357
3447
  });
3358
3448
  }
3359
3449
  };
3360
- let restoreStyles = null;
3361
- let setupStyles = ()=>{
3362
- if (restoreStyles) return;
3363
- let onWindowScroll = ()=>{
3364
- // Last resort. If the window scrolled, scroll it back to the top.
3365
- // It should always be at the top because the body will have a negative margin (see below).
3366
- window.scrollTo(0, 0);
3367
- };
3368
- // Record the original scroll position so we can restore it.
3369
- // Then apply a negative margin to the body to offset it by the scroll position. This will
3370
- // enable us to scroll the window to the top, which is required for the rest of this to work.
3371
- let scrollX = window.pageXOffset;
3372
- let scrollY = window.pageYOffset;
3373
- restoreStyles = ($ff5963eb1fccf552$export$e08e3b67e392101e)($49c51c25361d4cd2$var$addEvent(window, 'scroll', onWindowScroll), $49c51c25361d4cd2$var$setStyle(document.documentElement, 'paddingRight', `${window.innerWidth - document.documentElement.clientWidth}px`), $49c51c25361d4cd2$var$setStyle(document.documentElement, 'overflow', 'hidden'), $49c51c25361d4cd2$var$setStyle(document.body, 'marginTop', `-${scrollY}px`), ()=>{
3374
- window.scrollTo(scrollX, scrollY);
3450
+ // Override programmatic focus to scroll into view without scrolling the whole page.
3451
+ let focus = HTMLElement.prototype.focus;
3452
+ HTMLElement.prototype.focus = function(opts) {
3453
+ // Track whether the keyboard was already visible before.
3454
+ let activeElement = ($d4ee10de306f2510$export$cd4e5573fbe2b576)();
3455
+ let wasKeyboardVisible = activeElement != null && ($21f1aa98acb08317$export$c57958e35f31ed73)(activeElement);
3456
+ // Focus the element without scrolling the page.
3457
+ focus.call(this, {
3458
+ ...opts,
3459
+ preventScroll: true
3375
3460
  });
3376
- // Scroll to the top. The negative margin on the body will make this appear the same.
3377
- window.scrollTo(0, 0);
3461
+ if (!opts || !opts.preventScroll) $49c51c25361d4cd2$var$scrollIntoViewWhenReady(this, wasKeyboardVisible);
3378
3462
  };
3379
3463
  let removeEvents = ($ff5963eb1fccf552$export$e08e3b67e392101e)($49c51c25361d4cd2$var$addEvent(document, 'touchstart', onTouchStart, {
3380
3464
  passive: false,
@@ -3382,15 +3466,12 @@ function $49c51c25361d4cd2$var$preventScrollMobileSafari() {
3382
3466
  }), $49c51c25361d4cd2$var$addEvent(document, 'touchmove', onTouchMove, {
3383
3467
  passive: false,
3384
3468
  capture: true
3385
- }), $49c51c25361d4cd2$var$addEvent(document, 'touchend', onTouchEnd, {
3386
- passive: false,
3387
- capture: true
3388
- }), $49c51c25361d4cd2$var$addEvent(document, 'focus', onFocus, true));
3469
+ }), $49c51c25361d4cd2$var$addEvent(document, 'blur', onBlur, true));
3389
3470
  return ()=>{
3390
- // Restore styles and scroll the page back to where it was.
3391
- restoreScrollableStyles === null || restoreScrollableStyles === void 0 ? void 0 : restoreScrollableStyles();
3392
- restoreStyles === null || restoreStyles === void 0 ? void 0 : restoreStyles();
3471
+ restoreOverflow();
3393
3472
  removeEvents();
3473
+ style.remove();
3474
+ HTMLElement.prototype.focus = focus;
3394
3475
  };
3395
3476
  }
3396
3477
  // Sets a CSS property on an element, and returns a function to revert it to the previous value.
@@ -3411,6 +3492,15 @@ function $49c51c25361d4cd2$var$addEvent(target, event, handler, options) {
3411
3492
  target.removeEventListener(event, handler, options);
3412
3493
  };
3413
3494
  }
3495
+ function $49c51c25361d4cd2$var$scrollIntoViewWhenReady(target, wasKeyboardVisible) {
3496
+ if (wasKeyboardVisible || !$49c51c25361d4cd2$var$visualViewport) // If the keyboard was already visible, scroll the target into view immediately.
3497
+ $49c51c25361d4cd2$var$scrollIntoView(target);
3498
+ else // Otherwise, wait for the visual viewport to resize before scrolling so we can
3499
+ // measure the correct position to scroll to.
3500
+ $49c51c25361d4cd2$var$visualViewport.addEventListener('resize', ()=>$49c51c25361d4cd2$var$scrollIntoView(target), {
3501
+ once: true
3502
+ });
3503
+ }
3414
3504
  function $49c51c25361d4cd2$var$scrollIntoView(target) {
3415
3505
  let root = document.scrollingElement || document.documentElement;
3416
3506
  let nextTarget = target;
@@ -3418,16 +3508,23 @@ function $49c51c25361d4cd2$var$scrollIntoView(target) {
3418
3508
  // Find the parent scrollable element and adjust the scroll position if the target is not already in view.
3419
3509
  let scrollable = ($62d8ded9296f3872$export$cfa2225e87938781)(nextTarget);
3420
3510
  if (scrollable !== document.documentElement && scrollable !== document.body && scrollable !== nextTarget) {
3421
- let scrollableTop = scrollable.getBoundingClientRect().top;
3422
- let targetTop = nextTarget.getBoundingClientRect().top;
3423
- if (targetTop > scrollableTop + nextTarget.clientHeight) scrollable.scrollTop += targetTop - scrollableTop;
3511
+ let scrollableRect = scrollable.getBoundingClientRect();
3512
+ let targetRect = nextTarget.getBoundingClientRect();
3513
+ if (targetRect.top < scrollableRect.top || targetRect.bottom > scrollableRect.top + nextTarget.clientHeight) {
3514
+ let bottom = scrollableRect.bottom;
3515
+ if ($49c51c25361d4cd2$var$visualViewport) bottom = Math.min(bottom, $49c51c25361d4cd2$var$visualViewport.offsetTop + $49c51c25361d4cd2$var$visualViewport.height);
3516
+ // Center within the viewport.
3517
+ let adjustment = targetRect.top - scrollableRect.top - ((bottom - scrollableRect.top) / 2 - targetRect.height / 2);
3518
+ scrollable.scrollTo({
3519
+ // Clamp to the valid range to prevent over-scrolling.
3520
+ top: Math.max(0, Math.min(scrollable.scrollHeight - scrollable.clientHeight, scrollable.scrollTop + adjustment)),
3521
+ behavior: 'smooth'
3522
+ });
3523
+ }
3424
3524
  }
3425
3525
  nextTarget = scrollable.parentElement;
3426
3526
  }
3427
3527
  }
3428
- function $49c51c25361d4cd2$var$willOpenKeyboard(target) {
3429
- return target instanceof HTMLInputElement && !$49c51c25361d4cd2$var$nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;
3430
- }
3431
3528
 
3432
3529
  /*
3433
3530
  * Copyright 2024 Adobe. All rights reserved.
@@ -3793,6 +3890,7 @@ function $86ea4cb521eb2e37$export$2317d149ed6f78c4(props) {
3793
3890
  * OF ANY KIND, either express or implied. See the License for the specific language
3794
3891
  * governing permissions and limitations under the License.
3795
3892
  */
3893
+
3796
3894
  const $5e3802645cc19319$var$supportsInert = typeof HTMLElement !== 'undefined' && 'inert' in HTMLElement.prototype;
3797
3895
  // Keeps a ref count of all hidden elements. Added to when hiding an element, and
3798
3896
  // subtracted from when showing it again. When it reaches zero, aria-hidden is removed.
@@ -3821,6 +3919,17 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, options) {
3821
3919
  element.inert = false;
3822
3920
  }
3823
3921
  };
3922
+ let shadowRootsToWatch = new Set();
3923
+ if (($f4e2df6bd15f8569$export$98658e8c59125e6a)()) // find all shadow roots that are ancestors of the targets
3924
+ // traverse upwards until the root is reached
3925
+ for (let target of targets){
3926
+ let node = target;
3927
+ while(node && node !== root){
3928
+ let root = node.getRootNode();
3929
+ if ('shadowRoot' in root) shadowRootsToWatch.add(root.shadowRoot);
3930
+ node = root.parentNode;
3931
+ }
3932
+ }
3824
3933
  let walk = (root)=>{
3825
3934
  // Keep live announcer and top layer elements (e.g. toasts) visible.
3826
3935
  for (let element of root.querySelectorAll('[data-live-announcer], [data-react-aria-top-layer]'))visibleNodes.add(element);
@@ -3832,11 +3941,11 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, options) {
3832
3941
  if (hiddenNodes.has(node) || visibleNodes.has(node) || node.parentElement && hiddenNodes.has(node.parentElement) && node.parentElement.getAttribute('role') !== 'row') return NodeFilter.FILTER_REJECT;
3833
3942
  // Skip this node but continue to children if one of the targets is inside the node.
3834
3943
  for (let target of visibleNodes){
3835
- if (node.contains(target)) return NodeFilter.FILTER_SKIP;
3944
+ if (($d4ee10de306f2510$export$4282f70798064fe0)(node, target)) return NodeFilter.FILTER_SKIP;
3836
3945
  }
3837
3946
  return NodeFilter.FILTER_ACCEPT;
3838
3947
  };
3839
- let walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {
3948
+ let walker = ($dfc540311bf7f109$export$4d0f8be8b12a7ef6)(($431fbd86ca7dc216$export$b204af158042fbac)(root), root, NodeFilter.SHOW_ELEMENT, {
3840
3949
  acceptNode: acceptNode
3841
3950
  });
3842
3951
  // TreeWalker does not include the root.
@@ -3869,19 +3978,56 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, options) {
3869
3978
  if (change.type !== 'childList') continue;
3870
3979
  // If the parent element of the added nodes is not within one of the targets,
3871
3980
  // and not already inside a hidden node, hide all of the new children.
3872
- if (![
3981
+ if (change.target.isConnected && ![
3873
3982
  ...visibleNodes,
3874
3983
  ...hiddenNodes
3875
- ].some((node)=>node.contains(change.target))) for (let node of change.addedNodes){
3984
+ ].some((node)=>($d4ee10de306f2510$export$4282f70798064fe0)(node, change.target))) for (let node of change.addedNodes){
3876
3985
  if ((node instanceof HTMLElement || node instanceof SVGElement) && (node.dataset.liveAnnouncer === 'true' || node.dataset.reactAriaTopLayer === 'true')) visibleNodes.add(node);
3877
3986
  else if (node instanceof Element) walk(node);
3878
3987
  }
3988
+ if (($f4e2df6bd15f8569$export$98658e8c59125e6a)()) {
3989
+ // if any of the observed shadow roots were removed, stop observing them
3990
+ for (let shadowRoot of shadowRootsToWatch)if (!shadowRoot.isConnected) {
3991
+ observer.disconnect();
3992
+ break;
3993
+ }
3994
+ }
3879
3995
  }
3880
3996
  });
3881
3997
  observer.observe(root, {
3882
3998
  childList: true,
3883
3999
  subtree: true
3884
4000
  });
4001
+ let shadowObservers = new Set();
4002
+ if (($f4e2df6bd15f8569$export$98658e8c59125e6a)()) for (let shadowRoot of shadowRootsToWatch){
4003
+ // Disconnect single target instead of all https://github.com/whatwg/dom/issues/126
4004
+ let shadowObserver = new MutationObserver((changes)=>{
4005
+ for (let change of changes){
4006
+ if (change.type !== 'childList') continue;
4007
+ // If the parent element of the added nodes is not within one of the targets,
4008
+ // and not already inside a hidden node, hide all of the new children.
4009
+ if (change.target.isConnected && ![
4010
+ ...visibleNodes,
4011
+ ...hiddenNodes
4012
+ ].some((node)=>($d4ee10de306f2510$export$4282f70798064fe0)(node, change.target))) for (let node of change.addedNodes){
4013
+ if ((node instanceof HTMLElement || node instanceof SVGElement) && (node.dataset.liveAnnouncer === 'true' || node.dataset.reactAriaTopLayer === 'true')) visibleNodes.add(node);
4014
+ else if (node instanceof Element) walk(node);
4015
+ }
4016
+ if (($f4e2df6bd15f8569$export$98658e8c59125e6a)()) {
4017
+ // if any of the observed shadow roots were removed, stop observing them
4018
+ for (let shadowRoot of shadowRootsToWatch)if (!shadowRoot.isConnected) {
4019
+ observer.disconnect();
4020
+ break;
4021
+ }
4022
+ }
4023
+ }
4024
+ });
4025
+ shadowObserver.observe(shadowRoot, {
4026
+ childList: true,
4027
+ subtree: true
4028
+ });
4029
+ shadowObservers.add(shadowObserver);
4030
+ }
3885
4031
  let observerWrapper = {
3886
4032
  visibleNodes: visibleNodes,
3887
4033
  hiddenNodes: hiddenNodes,
@@ -3898,6 +4044,7 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, options) {
3898
4044
  $5e3802645cc19319$var$observerStack.push(observerWrapper);
3899
4045
  return ()=>{
3900
4046
  observer.disconnect();
4047
+ if (($f4e2df6bd15f8569$export$98658e8c59125e6a)()) for (let shadowObserver of shadowObservers)shadowObserver.disconnect();
3901
4048
  for (let node of hiddenNodes){
3902
4049
  let count = $5e3802645cc19319$var$refCountMap.get(node);
3903
4050
  if (count == null) continue;
@@ -4072,6 +4219,7 @@ function $feb5ffebff200149$export$6aeb1680a0ae8741(collection) {
4072
4219
  * OF ANY KIND, either express or implied. See the License for the specific language
4073
4220
  * governing permissions and limitations under the License.
4074
4221
  */
4222
+
4075
4223
  /**
4076
4224
  * Controls how long to wait before clearing the typeahead buffer.
4077
4225
  */ const $fb3050f43d946246$var$TYPEAHEAD_DEBOUNCE_WAIT_MS = 1000; // 1 second
@@ -4083,7 +4231,7 @@ function $fb3050f43d946246$export$e32c88dfddc6e1d8(options) {
4083
4231
  }).current;
4084
4232
  let onKeyDown = (e)=>{
4085
4233
  let character = $fb3050f43d946246$var$getStringForKey(e.key);
4086
- if (!character || e.ctrlKey || e.metaKey || !e.currentTarget.contains(e.target) || state.search.length === 0 && character === ' ') return;
4234
+ if (!character || e.ctrlKey || e.metaKey || !($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e)) || state.search.length === 0 && character === ' ') return;
4087
4235
  // Do not propagate the Spacebar event if it's meant to be part of the search.
4088
4236
  // When we time out, the search term becomes empty, hence the check on length.
4089
4237
  // Trimming is to account for the case of pressing the Spacebar more than once,
@@ -4145,17 +4293,16 @@ function $fb3050f43d946246$var$getStringForKey(key) {
4145
4293
 
4146
4294
 
4147
4295
  function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
4148
- let { selectionManager: manager, keyboardDelegate: delegate, ref: ref, autoFocus: autoFocus = false, shouldFocusWrap: shouldFocusWrap = false, disallowEmptySelection: disallowEmptySelection = false, disallowSelectAll: disallowSelectAll = false, escapeKeyBehavior: escapeKeyBehavior = 'clearSelection', selectOnFocus: selectOnFocus = manager.selectionBehavior === 'replace', disallowTypeAhead: disallowTypeAhead = false, shouldUseVirtualFocus: shouldUseVirtualFocus, allowsTabNavigation: allowsTabNavigation = false, isVirtualized: isVirtualized, scrollRef: // If no scrollRef is provided, assume the collection ref is the scrollable region
4296
+ let { selectionManager: manager, keyboardDelegate: delegate, ref: ref, autoFocus: autoFocus = false, shouldFocusWrap: shouldFocusWrap = false, disallowEmptySelection: disallowEmptySelection = false, disallowSelectAll: disallowSelectAll = false, escapeKeyBehavior: escapeKeyBehavior = 'clearSelection', selectOnFocus: selectOnFocus = manager.selectionBehavior === 'replace', disallowTypeAhead: disallowTypeAhead = false, shouldUseVirtualFocus: shouldUseVirtualFocus, allowsTabNavigation: allowsTabNavigation = false, scrollRef: // If no scrollRef is provided, assume the collection ref is the scrollable region
4149
4297
  scrollRef = ref, linkBehavior: linkBehavior = 'action' } = options;
4150
4298
  let { direction: direction } = ($18f2051aff69b9bf$export$43bb16f9c6d9e3f7)();
4151
4299
  let router = ($ea8dcbcb9ea1b556$export$9a302a45f65d0572)();
4152
4300
  let onKeyDown = (e)=>{
4153
- var _ref_current;
4154
4301
  // Prevent option + tab from doing anything since it doesn't move focus to the cells, only buttons/checkboxes
4155
4302
  if (e.altKey && e.key === 'Tab') e.preventDefault();
4156
4303
  // Keyboard events bubble through portals. Don't handle keyboard events
4157
4304
  // for elements outside the collection (e.g. menus).
4158
- if (!((_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.contains(e.target))) return;
4305
+ if (!ref.current || !($d4ee10de306f2510$export$4282f70798064fe0)(ref.current, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
4159
4306
  const navigateToKey = (key, childFocus)=>{
4160
4307
  if (key != null) {
4161
4308
  if (manager.isLink(key) && linkBehavior === 'selection' && selectOnFocus && !($feb5ffebff200149$export$d3e3bd3e26688c04)(e)) {
@@ -4293,7 +4440,11 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
4293
4440
  last = walker.lastChild();
4294
4441
  if (last) next = last;
4295
4442
  }while (last);
4296
- if (next && !next.contains(document.activeElement)) ($7215afc6de606d6b$export$de79e2c695e052f3)(next);
4443
+ // If the active element is NOT tabbable but is contained by an element that IS tabbable (aka the cell), the browser will actually move focus to
4444
+ // the containing element. We need to special case this so that tab will move focus out of the grid instead of looping between
4445
+ // focusing the containing cell and back to the non-tabbable child element
4446
+ let activeElement = ($d4ee10de306f2510$export$cd4e5573fbe2b576)();
4447
+ if (next && (!($d4ee10de306f2510$export$b4f377a2b6254582)(next) || activeElement && !($b4b717babfbb907b$export$bebd5a1431fec25d)(activeElement))) ($7215afc6de606d6b$export$de79e2c695e052f3)(next);
4297
4448
  }
4298
4449
  break;
4299
4450
  }
@@ -4305,7 +4456,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
4305
4456
  top: 0,
4306
4457
  left: 0
4307
4458
  });
4308
- ($e9faafb641e167db$export$90fc3a17d93f704c)(scrollRef, 'scroll', isVirtualized ? undefined : ()=>{
4459
+ ($e9faafb641e167db$export$90fc3a17d93f704c)(scrollRef, 'scroll', ()=>{
4309
4460
  var _scrollRef_current, _scrollRef_current1;
4310
4461
  var _scrollRef_current_scrollTop, _scrollRef_current_scrollLeft;
4311
4462
  scrollPos.current = {
@@ -4316,11 +4467,11 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
4316
4467
  let onFocus = (e)=>{
4317
4468
  if (manager.isFocused) {
4318
4469
  // If a focus event bubbled through a portal, reset focus state.
4319
- if (!e.currentTarget.contains(e.target)) manager.setFocused(false);
4470
+ if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) manager.setFocused(false);
4320
4471
  return;
4321
4472
  }
4322
4473
  // Focus events can bubble through portals. Ignore these events.
4323
- if (!e.currentTarget.contains(e.target)) return;
4474
+ if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e))) return;
4324
4475
  manager.setFocused(true);
4325
4476
  if (manager.focusedKey == null) {
4326
4477
  var _delegate_getLastKey, _delegate_getFirstKey;
@@ -4337,7 +4488,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
4337
4488
  var _manager_lastSelectedKey, _manager_firstSelectedKey;
4338
4489
  if (relatedTarget && e.currentTarget.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING) navigateToKey((_manager_lastSelectedKey = manager.lastSelectedKey) !== null && _manager_lastSelectedKey !== void 0 ? _manager_lastSelectedKey : (_delegate_getLastKey = delegate.getLastKey) === null || _delegate_getLastKey === void 0 ? void 0 : _delegate_getLastKey.call(delegate));
4339
4490
  else navigateToKey((_manager_firstSelectedKey = manager.firstSelectedKey) !== null && _manager_firstSelectedKey !== void 0 ? _manager_firstSelectedKey : (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate));
4340
- } else if (!isVirtualized && scrollRef.current) {
4491
+ } else if (scrollRef.current) {
4341
4492
  // Restore the scroll position to what it was before.
4342
4493
  scrollRef.current.scrollTop = scrollPos.current.top;
4343
4494
  scrollRef.current.scrollLeft = scrollPos.current.left;
@@ -4347,7 +4498,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
4347
4498
  let element = ($feb5ffebff200149$export$c3d8340acf92597f)(ref, manager.focusedKey);
4348
4499
  if (element instanceof HTMLElement) {
4349
4500
  // This prevents a flash of focus on the first/last element in the collection, or the collection itself.
4350
- if (!element.contains(document.activeElement) && !shouldUseVirtualFocus) ($7215afc6de606d6b$export$de79e2c695e052f3)(element);
4501
+ if (!($d4ee10de306f2510$export$b4f377a2b6254582)(element) && !shouldUseVirtualFocus) ($7215afc6de606d6b$export$de79e2c695e052f3)(element);
4351
4502
  let modality = ($507fabe10e71c6fb$export$630ff653c5ada6a9)();
4352
4503
  if (modality === 'keyboard') ($2f04cbc44ee30ce0$export$c826860796309d1b)(element, {
4353
4504
  containingElement: ref.current
@@ -4357,7 +4508,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
4357
4508
  };
4358
4509
  let onBlur = (e)=>{
4359
4510
  // Don't set blurred and then focused again if moving focus within the collection.
4360
- if (!e.currentTarget.contains(e.relatedTarget)) manager.setFocused(false);
4511
+ if (!($d4ee10de306f2510$export$4282f70798064fe0)(e.currentTarget, e.relatedTarget)) manager.setFocused(false);
4361
4512
  };
4362
4513
  // Ref to track whether the first item in the collection should be automatically focused. Specifically used for autocomplete when user types
4363
4514
  // to focus the first key AFTER the collection updates.
@@ -4373,44 +4524,40 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
4373
4524
  // If the user is typing forwards, autofocus the first option in the list.
4374
4525
  if ((detail === null || detail === void 0 ? void 0 : detail.focusStrategy) === 'first') shouldVirtualFocusFirst.current = true;
4375
4526
  });
4376
- let updateActiveDescendant = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(()=>{
4377
- var _delegate_getFirstKey;
4378
- var _delegate_getFirstKey1;
4379
- let keyToFocus = (_delegate_getFirstKey1 = (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate)) !== null && _delegate_getFirstKey1 !== void 0 ? _delegate_getFirstKey1 : null;
4380
- // If no focusable items exist in the list, make sure to clear any activedescendant that may still exist and move focus back to
4381
- // the original active element (e.g. the autocomplete input)
4382
- if (keyToFocus == null) {
4383
- let previousActiveElement = ($d4ee10de306f2510$export$cd4e5573fbe2b576)();
4384
- ($55f9b1ae81f22853$export$76e4e37e5339496d)(ref.current);
4385
- ($55f9b1ae81f22853$export$2b35b76d2e30e129)(previousActiveElement, null);
4386
- // If there wasn't a focusable key but the collection had items, then that means we aren't in an intermediate load state and all keys are disabled.
4387
- // Reset shouldVirtualFocusFirst so that we don't erronously autofocus an item when the collection is filtered again.
4388
- if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
4389
- } else {
4390
- manager.setFocusedKey(keyToFocus);
4391
- // Only set shouldVirtualFocusFirst to false if we've successfully set the first key as the focused key
4392
- // If there wasn't a key to focus, we might be in a temporary loading state so we'll want to still focus the first key
4393
- // after the collection updates after load
4394
- shouldVirtualFocusFirst.current = false;
4395
- }
4396
- });
4527
+ // update active descendant
4397
4528
  ($ca9b37712f007381$export$72ef708ab07251f1)(()=>{
4398
- if (shouldVirtualFocusFirst.current) updateActiveDescendant();
4529
+ if (shouldVirtualFocusFirst.current) {
4530
+ var _delegate_getFirstKey;
4531
+ var _delegate_getFirstKey1;
4532
+ let keyToFocus = (_delegate_getFirstKey1 = (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate)) !== null && _delegate_getFirstKey1 !== void 0 ? _delegate_getFirstKey1 : null;
4533
+ // If no focusable items exist in the list, make sure to clear any activedescendant that may still exist and move focus back to
4534
+ // the original active element (e.g. the autocomplete input)
4535
+ if (keyToFocus == null) {
4536
+ let previousActiveElement = ($d4ee10de306f2510$export$cd4e5573fbe2b576)();
4537
+ ($55f9b1ae81f22853$export$76e4e37e5339496d)(ref.current);
4538
+ ($55f9b1ae81f22853$export$2b35b76d2e30e129)(previousActiveElement, null);
4539
+ // If there wasn't a focusable key but the collection had items, then that means we aren't in an intermediate load state and all keys are disabled.
4540
+ // Reset shouldVirtualFocusFirst so that we don't erronously autofocus an item when the collection is filtered again.
4541
+ if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
4542
+ } else {
4543
+ manager.setFocusedKey(keyToFocus);
4544
+ // Only set shouldVirtualFocusFirst to false if we've successfully set the first key as the focused key
4545
+ // If there wasn't a key to focus, we might be in a temporary loading state so we'll want to still focus the first key
4546
+ // after the collection updates after load
4547
+ shouldVirtualFocusFirst.current = false;
4548
+ }
4549
+ }
4399
4550
  }, [
4400
- manager.collection,
4401
- updateActiveDescendant
4551
+ manager.collection
4402
4552
  ]);
4403
- let resetFocusFirstFlag = ($8ae05eaa5c114e9c$export$7f54fc3180508a52)(()=>{
4553
+ // reset focus first flag
4554
+ ($ca9b37712f007381$export$72ef708ab07251f1)(()=>{
4404
4555
  // If user causes the focused key to change in any other way, clear shouldVirtualFocusFirst so we don't
4405
4556
  // accidentally move focus from under them. Skip this if the collection was empty because we might be in a load
4406
4557
  // state and will still want to focus the first item after load
4407
4558
  if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
4408
- });
4409
- ($ca9b37712f007381$export$72ef708ab07251f1)(()=>{
4410
- resetFocusFirstFlag();
4411
4559
  }, [
4412
- manager.focusedKey,
4413
- resetFocusFirstFlag
4560
+ manager.focusedKey
4414
4561
  ]);
4415
4562
  ($e9faafb641e167db$export$90fc3a17d93f704c)(ref, ($5671b20cf9b562b2$export$447a38995de2c711), !shouldUseVirtualFocus ? undefined : (e)=>{
4416
4563
  var _e_detail;
@@ -4492,7 +4639,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
4492
4639
  onBlur: onBlur,
4493
4640
  onMouseDown (e) {
4494
4641
  // Ignore events that bubbled through portals.
4495
- if (scrollRef.current === e.target) // Prevent focus going to the collection when clicking on the scrollbar.
4642
+ if (scrollRef.current === ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e)) // Prevent focus going to the collection when clicking on the scrollbar.
4496
4643
  e.preventDefault();
4497
4644
  }
4498
4645
  };
@@ -4564,7 +4711,7 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
4564
4711
  if (isFocused && manager.isFocused) {
4565
4712
  if (!shouldUseVirtualFocus) {
4566
4713
  if (focus) focus();
4567
- else if (document.activeElement !== ref.current && ref.current) ($3ad3f6e1647bc98d$export$80f3e147d781571c)(ref.current);
4714
+ else if (($d4ee10de306f2510$export$cd4e5573fbe2b576)() !== ref.current && ref.current) ($3ad3f6e1647bc98d$export$80f3e147d781571c)(ref.current);
4568
4715
  } else ($55f9b1ae81f22853$export$76e4e37e5339496d)(ref.current);
4569
4716
  }
4570
4717
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -4584,20 +4731,28 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
4584
4731
  if (!shouldUseVirtualFocus && !isDisabled) itemProps = {
4585
4732
  tabIndex: key === manager.focusedKey ? 0 : -1,
4586
4733
  onFocus (e) {
4587
- if (e.target === ref.current) manager.setFocusedKey(key);
4734
+ if (($d4ee10de306f2510$export$e58f029f0fbfdb29)(e) === ref.current) manager.setFocusedKey(key);
4588
4735
  }
4589
4736
  };
4590
4737
  else if (isDisabled) itemProps.onMouseDown = (e)=>{
4591
4738
  // Prevent focus going to the body when clicking on a disabled item.
4592
4739
  e.preventDefault();
4593
4740
  };
4741
+ (useEffect)(()=>{
4742
+ if (isDisabled && manager.focusedKey === key) manager.setFocusedKey(null);
4743
+ }, [
4744
+ manager,
4745
+ isDisabled,
4746
+ key
4747
+ ]);
4594
4748
  // With checkbox selection, onAction (i.e. navigation) becomes primary, and occurs on a single click of the row.
4595
4749
  // Clicking the checkbox enters selection mode, after which clicking anywhere on any row toggles selection for that row.
4596
4750
  // With highlight selection, onAction is secondary, and occurs on double click. Single click selects the row.
4597
4751
  // With touch, onAction occurs on single tap, and long press enters selection mode.
4598
4752
  let isLinkOverride = manager.isLink(key) && linkBehavior === 'override';
4753
+ let isActionOverride = onAction && options['UNSTABLE_itemBehavior'] === 'action';
4599
4754
  let hasLinkAction = manager.isLink(key) && linkBehavior !== 'selection' && linkBehavior !== 'none';
4600
- let allowsSelection = !isDisabled && manager.canSelectItem(key) && !isLinkOverride;
4755
+ let allowsSelection = !isDisabled && manager.canSelectItem(key) && !isLinkOverride && !isActionOverride;
4601
4756
  let allowsActions = (onAction || hasLinkAction) && !isDisabled;
4602
4757
  let hasPrimaryAction = allowsActions && (manager.selectionBehavior === 'replace' ? !allowsSelection : !allowsSelection || manager.isEmpty);
4603
4758
  let hasSecondaryAction = allowsActions && allowsSelection && manager.selectionBehavior === 'replace';
@@ -4608,7 +4763,13 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
4608
4763
  let hadPrimaryActionOnPressStart = (useRef)(false);
4609
4764
  let collectionItemProps = manager.getItemProps(key);
4610
4765
  let performAction = (e)=>{
4611
- if (onAction) onAction();
4766
+ if (onAction) {
4767
+ var _ref_current;
4768
+ onAction();
4769
+ (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.dispatchEvent(new CustomEvent('react-aria-item-action', {
4770
+ bubbles: true
4771
+ }));
4772
+ }
4612
4773
  if (hasLinkAction && ref.current) router.open(ref.current, e, collectionItemProps.href, collectionItemProps.routerOptions);
4613
4774
  };
4614
4775
  // By default, selection occurs on pointer down. This can be strange if selecting an
@@ -4625,13 +4786,13 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
4625
4786
  itemPressProps.onPressStart = (e)=>{
4626
4787
  modality.current = e.pointerType;
4627
4788
  longPressEnabledOnPressStart.current = longPressEnabled;
4628
- if (e.pointerType === 'keyboard' && (!hasAction || $880e95eb8b93ba9a$var$isSelectionKey())) onSelect(e);
4789
+ if (e.pointerType === 'keyboard' && (!hasAction || $880e95eb8b93ba9a$var$isSelectionKey(e.key))) onSelect(e);
4629
4790
  };
4630
4791
  // If allowsDifferentPressOrigin and interacting with mouse, make selection happen on pressUp (e.g. open menu on press down, selection on menu item happens on press up.)
4631
4792
  // Otherwise, have selection happen onPress (prevents listview row selection when clicking on interactable elements in the row)
4632
4793
  if (!allowsDifferentPressOrigin) itemPressProps.onPress = (e)=>{
4633
4794
  if (hasPrimaryAction || hasSecondaryAction && e.pointerType !== 'mouse') {
4634
- if (e.pointerType === 'keyboard' && !$880e95eb8b93ba9a$var$isActionKey()) return;
4795
+ if (e.pointerType === 'keyboard' && !$880e95eb8b93ba9a$var$isActionKey(e.key)) return;
4635
4796
  performAction(e);
4636
4797
  } else if (e.pointerType !== 'keyboard' && allowsSelection) onSelect(e);
4637
4798
  };
@@ -4651,13 +4812,13 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
4651
4812
  // Select on mouse down unless there is a primary action which will occur on mouse up.
4652
4813
  // For keyboard, select on key down. If there is an action, the Space key selects on key down,
4653
4814
  // and the Enter key performs onAction on key up.
4654
- if (allowsSelection && (e.pointerType === 'mouse' && !hasPrimaryAction || e.pointerType === 'keyboard' && (!allowsActions || $880e95eb8b93ba9a$var$isSelectionKey()))) onSelect(e);
4815
+ if (allowsSelection && (e.pointerType === 'mouse' && !hasPrimaryAction || e.pointerType === 'keyboard' && (!allowsActions || $880e95eb8b93ba9a$var$isSelectionKey(e.key)))) onSelect(e);
4655
4816
  };
4656
4817
  itemPressProps.onPress = (e)=>{
4657
4818
  // Selection occurs on touch up. Primary actions always occur on pointer up.
4658
4819
  // Both primary and secondary actions occur on Enter key up. The only exception
4659
4820
  // is secondary actions, which occur on double click with a mouse.
4660
- if (e.pointerType === 'touch' || e.pointerType === 'pen' || e.pointerType === 'virtual' || e.pointerType === 'keyboard' && hasAction && $880e95eb8b93ba9a$var$isActionKey() || e.pointerType === 'mouse' && hadPrimaryActionOnPressStart.current) {
4821
+ if (e.pointerType === 'touch' || e.pointerType === 'pen' || e.pointerType === 'virtual' || e.pointerType === 'keyboard' && hasAction && $880e95eb8b93ba9a$var$isActionKey(e.key) || e.pointerType === 'mouse' && hadPrimaryActionOnPressStart.current) {
4661
4822
  if (hasAction) performAction(e);
4662
4823
  else if (allowsSelection) onSelect(e);
4663
4824
  }
@@ -4742,13 +4903,11 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
4742
4903
  hasAction: hasAction
4743
4904
  };
4744
4905
  }
4745
- function $880e95eb8b93ba9a$var$isActionKey() {
4746
- let event = window.event;
4747
- return (event === null || event === void 0 ? void 0 : event.key) === 'Enter';
4906
+ function $880e95eb8b93ba9a$var$isActionKey(key) {
4907
+ return key === 'Enter';
4748
4908
  }
4749
- function $880e95eb8b93ba9a$var$isSelectionKey() {
4750
- let event = window.event;
4751
- return (event === null || event === void 0 ? void 0 : event.key) === ' ' || (event === null || event === void 0 ? void 0 : event.code) === 'Space';
4909
+ function $880e95eb8b93ba9a$var$isSelectionKey(key) {
4910
+ return key === ' ';
4752
4911
  }
4753
4912
 
4754
4913
  /*
@@ -4771,8 +4930,8 @@ class $657e4dc4a6e88df0$export$8f5ed9ff9f511381 {
4771
4930
  let containerRect = container.getBoundingClientRect();
4772
4931
  let itemRect = item.getBoundingClientRect();
4773
4932
  return {
4774
- x: itemRect.left - containerRect.left + container.scrollLeft,
4775
- y: itemRect.top - containerRect.top + container.scrollTop,
4933
+ x: itemRect.left - containerRect.left - container.clientLeft + container.scrollLeft,
4934
+ y: itemRect.top - containerRect.top - container.clientTop + container.scrollTop,
4776
4935
  width: itemRect.width,
4777
4936
  height: itemRect.height
4778
4937
  };
@@ -4787,12 +4946,12 @@ class $657e4dc4a6e88df0$export$8f5ed9ff9f511381 {
4787
4946
  }
4788
4947
  getVisibleRect() {
4789
4948
  let container = this.ref.current;
4790
- var _container_scrollLeft, _container_scrollTop, _container_offsetWidth, _container_offsetHeight;
4949
+ var _container_scrollLeft, _container_scrollTop, _container_clientWidth, _container_clientHeight;
4791
4950
  return {
4792
4951
  x: (_container_scrollLeft = container === null || container === void 0 ? void 0 : container.scrollLeft) !== null && _container_scrollLeft !== void 0 ? _container_scrollLeft : 0,
4793
4952
  y: (_container_scrollTop = container === null || container === void 0 ? void 0 : container.scrollTop) !== null && _container_scrollTop !== void 0 ? _container_scrollTop : 0,
4794
- width: (_container_offsetWidth = container === null || container === void 0 ? void 0 : container.offsetWidth) !== null && _container_offsetWidth !== void 0 ? _container_offsetWidth : 0,
4795
- height: (_container_offsetHeight = container === null || container === void 0 ? void 0 : container.offsetHeight) !== null && _container_offsetHeight !== void 0 ? _container_offsetHeight : 0
4953
+ width: (_container_clientWidth = container === null || container === void 0 ? void 0 : container.clientWidth) !== null && _container_clientWidth !== void 0 ? _container_clientWidth : 0,
4954
+ height: (_container_clientHeight = container === null || container === void 0 ? void 0 : container.clientHeight) !== null && _container_clientHeight !== void 0 ? _container_clientHeight : 0
4796
4955
  };
4797
4956
  }
4798
4957
  constructor(ref){
@@ -5439,7 +5598,7 @@ $a89a74a39eba465a$exports = {
5439
5598
 
5440
5599
  var $edc7c66594a0ae8a$exports = {};
5441
5600
  $edc7c66594a0ae8a$exports = {
5442
- "longPressMessage": `Premere a lungo o premere Alt + Freccia gi\xf9 per aprire il menu`
5601
+ "longPressMessage": `Premi a lungo o premi Alt + Freccia gi\xf9 per aprire il menu`
5443
5602
  };
5444
5603
 
5445
5604
  var $f1ab51510712db52$exports = {};
@@ -5789,7 +5948,7 @@ function $d5336fe17ce95402$export$38eaa17faae8f579(props, state, ref) {
5789
5948
 
5790
5949
 
5791
5950
  function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
5792
- let { id: id, key: key, closeOnSelect: closeOnSelect, isVirtualized: isVirtualized, 'aria-haspopup': hasPopup, onPressStart: onPressStart, onPressUp: pressUpProp, onPress: onPress, onPressChange: pressChangeProp, onPressEnd: onPressEnd, onClick: onClickProp, onHoverStart: hoverStartProp, onHoverChange: onHoverChange, onHoverEnd: onHoverEnd, onKeyDown: onKeyDown, onKeyUp: onKeyUp, onFocus: onFocus, onFocusChange: onFocusChange, onBlur: onBlur, selectionManager: selectionManager = state.selectionManager } = props;
5951
+ let { id: id, key: key, closeOnSelect: closeOnSelect, shouldCloseOnSelect: shouldCloseOnSelect, isVirtualized: isVirtualized, 'aria-haspopup': hasPopup, onPressStart: onPressStart, onPressUp: pressUpProp, onPress: onPress, onPressChange: pressChangeProp, onPressEnd: onPressEnd, onClick: onClickProp, onHoverStart: hoverStartProp, onHoverChange: onHoverChange, onHoverEnd: onHoverEnd, onKeyDown: onKeyDown, onKeyUp: onKeyUp, onFocus: onFocus, onFocusChange: onFocusChange, onBlur: onBlur, selectionManager: selectionManager = state.selectionManager } = props;
5793
5952
  let isTrigger = !!hasPopup;
5794
5953
  let isTriggerExpanded = isTrigger && props['aria-expanded'] === 'true';
5795
5954
  var _props_isDisabled;
@@ -5826,6 +5985,7 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
5826
5985
  'aria-label': props['aria-label'],
5827
5986
  'aria-labelledby': labelId,
5828
5987
  'aria-describedby': [
5988
+ props['aria-describedby'],
5829
5989
  descriptionId,
5830
5990
  keyboardId
5831
5991
  ].filter(Boolean).join(' ') || undefined,
@@ -5835,7 +5995,8 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
5835
5995
  };
5836
5996
  if (selectionManager.selectionMode !== 'none' && !isTrigger) ariaProps['aria-checked'] = isSelected;
5837
5997
  if (isVirtualized) {
5838
- ariaProps['aria-posinset'] = item === null || item === void 0 ? void 0 : item.index;
5998
+ let index = Number(item === null || item === void 0 ? void 0 : item.index);
5999
+ ariaProps['aria-posinset'] = Number.isNaN(index) ? undefined : index + 1;
5839
6000
  ariaProps['aria-setsize'] = ($453cc9f0df89c0a5$export$77d5aafae4e095b2)(state.collection);
5840
6001
  }
5841
6002
  let isPressedRef = (useRef)(false);
@@ -5861,7 +6022,8 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
5861
6022
  performAction();
5862
6023
  ($ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f)(e, router, item.props.href, item === null || item === void 0 ? void 0 : item.props.routerOptions);
5863
6024
  let shouldClose = ((_interaction_current = interaction.current) === null || _interaction_current === void 0 ? void 0 : _interaction_current.pointerType) === 'keyboard' ? ((_interaction_current1 = interaction.current) === null || _interaction_current1 === void 0 ? void 0 : _interaction_current1.key) === 'Enter' || selectionManager.selectionMode === 'none' || selectionManager.isLink(key) : selectionManager.selectionMode !== 'multiple' || selectionManager.isLink(key);
5864
- shouldClose = closeOnSelect !== null && closeOnSelect !== void 0 ? closeOnSelect : shouldClose;
6025
+ var _ref;
6026
+ shouldClose = (_ref = shouldCloseOnSelect !== null && shouldCloseOnSelect !== void 0 ? shouldCloseOnSelect : closeOnSelect) !== null && _ref !== void 0 ? _ref : shouldClose;
5865
6027
  if (onClose && !isTrigger && shouldClose) onClose();
5866
6028
  interaction.current = null;
5867
6029
  };
@@ -5914,7 +6076,10 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
5914
6076
  pointerType: 'keyboard',
5915
6077
  key: ' '
5916
6078
  };
5917
- e.target.click();
6079
+ ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e).click();
6080
+ // click above sets modality to "virtual", need to set interaction modality back to 'keyboard' so focusSafely calls properly move focus
6081
+ // to the newly opened submenu's first item.
6082
+ ($507fabe10e71c6fb$export$8397ddfc504fdb9a)('keyboard');
5918
6083
  break;
5919
6084
  case 'Enter':
5920
6085
  interaction.current = {
@@ -5922,7 +6087,10 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
5922
6087
  key: 'Enter'
5923
6088
  };
5924
6089
  // Trigger click unless this is a link. Links trigger click natively.
5925
- if (e.target.tagName !== 'A') e.target.click();
6090
+ if (($d4ee10de306f2510$export$e58f029f0fbfdb29)(e).tagName !== 'A') ($d4ee10de306f2510$export$e58f029f0fbfdb29)(e).click();
6091
+ // click above sets modality to "virtual", need to set interaction modality back to 'keyboard' so focusSafely calls properly move focus
6092
+ // to the newly opened submenu's first item.
6093
+ ($507fabe10e71c6fb$export$8397ddfc504fdb9a)('keyboard');
5926
6094
  break;
5927
6095
  default:
5928
6096
  if (!isTrigger) e.continuePropagation();
@@ -5932,11 +6100,11 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
5932
6100
  },
5933
6101
  onKeyUp: onKeyUp
5934
6102
  });
5935
- let { focusProps: focusProps } = ($a1ea59d68270f0dd$export$f8168d8dd8fd66e6)({
6103
+ let { focusableProps: focusableProps } = ($f645667febf57a63$export$4c014de7c8940b4c)({
5936
6104
  onBlur: onBlur,
5937
6105
  onFocus: onFocus,
5938
6106
  onFocusChange: onFocusChange
5939
- });
6107
+ }, ref);
5940
6108
  let domProps = ($65484d02dcb7eb3e$export$457c3d6518dd4c6f)(item === null || item === void 0 ? void 0 : item.props);
5941
6109
  delete domProps.id;
5942
6110
  let linkProps = ($ea8dcbcb9ea1b556$export$7e924b3091a3bd18)(item === null || item === void 0 ? void 0 : item.props);
@@ -5947,7 +6115,7 @@ function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
5947
6115
  onFocus: itemProps.onFocus,
5948
6116
  'data-collection': itemProps['data-collection'],
5949
6117
  'data-key': itemProps['data-key']
5950
- } : itemProps, pressProps, hoverProps, keyboardProps, focusProps, // Prevent DOM focus from moving on mouse down when using virtual focus or this is a submenu/subdialog trigger.
6118
+ } : itemProps, pressProps, hoverProps, keyboardProps, focusableProps, // Prevent DOM focus from moving on mouse down when using virtual focus or this is a submenu/subdialog trigger.
5951
6119
  data.shouldUseVirtualFocus || isTrigger ? {
5952
6120
  onMouseDown: (e)=>e.preventDefault()
5953
6121
  } : undefined, isDisabled ? undefined : {
@@ -6369,7 +6537,7 @@ function $23b9f4fcf0fe224b$var$filterChildren(collection, newCollection, firstCh
6369
6537
  if (this.isConnected) this.ownerDocument.queueUpdate();
6370
6538
  }
6371
6539
  removeChild(child) {
6372
- if (child.parentNode !== this || !this.ownerDocument.isMounted) return;
6540
+ if (child.parentNode !== this) return;
6373
6541
  if (this._minInvalidChildIndex === child) this._minInvalidChildIndex = null;
6374
6542
  if (child.nextSibling) {
6375
6543
  this.invalidateChildIndices(child.nextSibling);
@@ -6426,8 +6594,8 @@ class $681cc3c98f569e39$export$dc064fe9e59310fd extends $681cc3c98f569e39$export
6426
6594
  this.ownerDocument.markDirty(this);
6427
6595
  }
6428
6596
  get level() {
6429
- var _this_node;
6430
- if (this.parentNode instanceof $681cc3c98f569e39$export$dc064fe9e59310fd) return this.parentNode.level + (((_this_node = this.node) === null || _this_node === void 0 ? void 0 : _this_node.type) === 'item' ? 1 : 0);
6597
+ var _this_parentNode_node;
6598
+ if (this.parentNode instanceof $681cc3c98f569e39$export$dc064fe9e59310fd) return this.parentNode.level + (((_this_parentNode_node = this.parentNode.node) === null || _this_parentNode_node === void 0 ? void 0 : _this_parentNode_node.type) === 'item' ? 1 : 0);
6431
6599
  return 0;
6432
6600
  }
6433
6601
  /**
@@ -6483,6 +6651,7 @@ class $681cc3c98f569e39$export$dc064fe9e59310fd extends $681cc3c98f569e39$export
6483
6651
  node.rendered = rendered;
6484
6652
  node.render = render;
6485
6653
  node.value = value1;
6654
+ if (obj['aria-label']) node['aria-label'] = obj['aria-label'];
6486
6655
  node.textValue = textValue || (typeof props.children === 'string' ? props.children : '') || obj['aria-label'] || '';
6487
6656
  if (id != null && id !== node.key) throw new Error('Cannot change the id of an item');
6488
6657
  if (props.colSpan != null) node.colSpan = props.colSpan;
@@ -6528,7 +6697,7 @@ class $681cc3c98f569e39$export$dc064fe9e59310fd extends $681cc3c98f569e39$export
6528
6697
  }
6529
6698
  class $681cc3c98f569e39$export$b34a105447964f9f extends $681cc3c98f569e39$export$410b0c854570d131 {
6530
6699
  get isConnected() {
6531
- return this.isMounted;
6700
+ return true;
6532
6701
  }
6533
6702
  createElement(type) {
6534
6703
  return new $681cc3c98f569e39$export$dc064fe9e59310fd(type, this);
@@ -6547,17 +6716,16 @@ class $681cc3c98f569e39$export$b34a105447964f9f extends $681cc3c98f569e39$export
6547
6716
  collection.addNode(element.node);
6548
6717
  }
6549
6718
  removeNode(node) {
6550
- if (node.node == null) return;
6551
6719
  for (let child of node)this.removeNode(child);
6552
- let collection = this.getMutableCollection();
6553
- collection.removeNode(node.node.key);
6720
+ if (node.node) {
6721
+ let collection = this.getMutableCollection();
6722
+ collection.removeNode(node.node.key);
6723
+ }
6554
6724
  }
6555
6725
  /** Finalizes the collection update, updating all nodes and freezing the collection. */ getCollection() {
6556
- // If in a subscription update, return a clone of the existing collection.
6557
- // This ensures React will queue a render. React will call getCollection again
6558
- // during render, at which point all the updates will be complete and we can return
6559
- // the new collection.
6560
- if (this.inSubscription) return this.collection.clone();
6726
+ // If in a subscription update, return return the existing collection.
6727
+ // React will call getCollection again during render, at which point all the updates will be complete.
6728
+ if (this.inSubscription) return this.collection;
6561
6729
  // Reset queuedRender to false when getCollection is called during render.
6562
6730
  this.queuedRender = false;
6563
6731
  this.updateCollection();
@@ -6573,9 +6741,9 @@ class $681cc3c98f569e39$export$b34a105447964f9f extends $681cc3c98f569e39$export
6573
6741
  element.updateNode();
6574
6742
  this.addNode(element);
6575
6743
  }
6744
+ if (element.node) this.dirtyNodes.delete(element);
6576
6745
  element.isMutated = false;
6577
- }
6578
- this.dirtyNodes.clear();
6746
+ } else this.dirtyNodes.delete(element);
6579
6747
  // Finally, update the collection.
6580
6748
  if (this.nextCollection) {
6581
6749
  var _this_firstVisibleChild_node, _this_firstVisibleChild, _this_lastVisibleChild_node, _this_lastVisibleChild;
@@ -6596,6 +6764,10 @@ class $681cc3c98f569e39$export$b34a105447964f9f extends $681cc3c98f569e39$export
6596
6764
  // we reset queuedRender back to false.
6597
6765
  this.queuedRender = true;
6598
6766
  this.inSubscription = true;
6767
+ // Clone the collection to ensure that React queues a render. It will call getCollection again
6768
+ // during render, at which point all the updates will be complete and we can return
6769
+ // the new collection.
6770
+ if (!this.isSSR) this.collection = this.collection.clone();
6599
6771
  for (let fn of this.subscriptions)fn();
6600
6772
  this.inSubscription = false;
6601
6773
  }
@@ -6614,7 +6786,7 @@ class $681cc3c98f569e39$export$b34a105447964f9f extends $681cc3c98f569e39$export
6614
6786
  constructor(collection){
6615
6787
  // @ts-ignore
6616
6788
  super(null), this.nodeType = 11 // DOCUMENT_FRAGMENT_NODE
6617
- , this.ownerDocument = this, this.dirtyNodes = new Set(), this.isSSR = false, this.nodeId = 0, this.nodesByProps = new WeakMap(), this.isMounted = true, this.nextCollection = null, this.subscriptions = new Set(), this.queuedRender = false, this.inSubscription = false;
6789
+ , this.ownerDocument = this, this.dirtyNodes = new Set(), this.isSSR = false, this.nodeId = 0, this.nodesByProps = new WeakMap(), this.nextCollection = null, this.subscriptions = new Set(), this.queuedRender = false, this.inSubscription = false;
6618
6790
  this.collection = collection;
6619
6791
  this.nextCollection = collection;
6620
6792
  }
@@ -6647,7 +6819,7 @@ function $e948873055cbafe4$export$727c8fc270210f13(props) {
6647
6819
  // @ts-ignore
6648
6820
  let key = (_ref = (_rendered_props_id = rendered.props.id) !== null && _rendered_props_id !== void 0 ? _rendered_props_id : item.key) !== null && _ref !== void 0 ? _ref : item.id;
6649
6821
  if (key == null) throw new Error('Could not determine key for item');
6650
- if (idScope) key = idScope + ':' + key;
6822
+ if (idScope != null) key = idScope + ':' + key;
6651
6823
  // Note: only works if wrapped Item passes through id...
6652
6824
  rendered = (cloneElement)(rendered, addIdAndValue ? {
6653
6825
  key: key,
@@ -6690,7 +6862,6 @@ function $e948873055cbafe4$export$727c8fc270210f13(props) {
6690
6862
 
6691
6863
 
6692
6864
 
6693
-
6694
6865
  const $e1995378a142960e$var$ShallowRenderContext = /*#__PURE__*/ (createContext)(false);
6695
6866
  const $e1995378a142960e$var$CollectionDocumentContext = /*#__PURE__*/ (createContext)(null);
6696
6867
  function $e1995378a142960e$export$bf788dd355e3a401(props) {
@@ -6760,16 +6931,6 @@ function $e1995378a142960e$var$useCollectionDocument(createCollection) {
6760
6931
  document
6761
6932
  ]);
6762
6933
  let collection = $e1995378a142960e$var$useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
6763
- ($f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
6764
- document.isMounted = true;
6765
- return ()=>{
6766
- // Mark unmounted so we can skip all of the collection updates caused by
6767
- // React calling removeChild on every item in the collection.
6768
- document.isMounted = false;
6769
- };
6770
- }, [
6771
- document
6772
- ]);
6773
6934
  return {
6774
6935
  collection: collection,
6775
6936
  document: document
@@ -6862,7 +7023,8 @@ const $e1995378a142960e$var$CollectionContext = /*#__PURE__*/ (createContext)(nu
6862
7023
  function $e1995378a142960e$export$fb8073518f34e6ec(props) {
6863
7024
  let ctx = (useContext)($e1995378a142960e$var$CollectionContext);
6864
7025
  let dependencies = ((ctx === null || ctx === void 0 ? void 0 : ctx.dependencies) || []).concat(props.dependencies);
6865
- let idScope = props.idScope || (ctx === null || ctx === void 0 ? void 0 : ctx.idScope);
7026
+ var _props_idScope;
7027
+ let idScope = (_props_idScope = props.idScope) !== null && _props_idScope !== void 0 ? _props_idScope : ctx === null || ctx === void 0 ? void 0 : ctx.idScope;
6866
7028
  let children = $e1995378a142960e$var$useCollectionChildren({
6867
7029
  ...props,
6868
7030
  idScope: idScope,
@@ -6926,6 +7088,9 @@ function $7135fc7d473fd974$var$useCollectionRender(collection, parent, renderDro
6926
7088
  renderDropIndicator
6927
7089
  ],
6928
7090
  children (node) {
7091
+ // Return a empty fragment since we don't want to render the content twice
7092
+ // If we don't skip the content node here, we end up rendering them twice in a Tree since we also render the content node in TreeItem
7093
+ if (node.type === 'content') return /*#__PURE__*/ (React__default).createElement((React__default).Fragment, null);
6929
7094
  let rendered = node.render(node);
6930
7095
  if (!renderDropIndicator || node.type !== 'item') return rendered;
6931
7096
  return /*#__PURE__*/ (React__default).createElement((React__default).Fragment, null, renderDropIndicator({
@@ -6952,7 +7117,7 @@ function $7135fc7d473fd974$export$2dbbd341daed716d(collection, node, renderDropI
6952
7117
  let afterIndicators = [];
6953
7118
  if (nextItemInSameLevel == null) {
6954
7119
  let current = node;
6955
- while(current && (!nextItemInFlattenedCollection || current.parentKey !== nextItemInFlattenedCollection.parentKey && nextItemInFlattenedCollection.level < current.level)){
7120
+ while((current === null || current === void 0 ? void 0 : current.type) === 'item' && (!nextItemInFlattenedCollection || current.parentKey !== nextItemInFlattenedCollection.parentKey && nextItemInFlattenedCollection.level < current.level)){
6956
7121
  let indicator = renderDropIndicator({
6957
7122
  type: 'item',
6958
7123
  key: current.key,
@@ -7674,13 +7839,53 @@ function $875d6693e12af071$var$toggleKey(set, key) {
7674
7839
  const $72a5793c14baf454$export$e0e4026c12a8bdbb = /*#__PURE__*/ (createContext)({});
7675
7840
  const $72a5793c14baf454$export$8b251419efc915eb = /*#__PURE__*/ ($e1995378a142960e$export$18af5c7a9e9b3664)(($23b9f4fcf0fe224b$export$5ae2504e948afce5), function Header(props, ref) {
7676
7841
  [props, ref] = ($64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $72a5793c14baf454$export$e0e4026c12a8bdbb);
7677
- return /*#__PURE__*/ (React__default).createElement("header", {
7842
+ return /*#__PURE__*/ (React__default).createElement(($64fa3d84918910a7$export$df3a06d6289f983e).header, {
7678
7843
  className: "react-aria-Header",
7679
7844
  ...props,
7680
7845
  ref: ref
7681
7846
  }, props.children);
7682
7847
  });
7683
7848
 
7849
+ /*
7850
+ * Copyright 2025 Adobe. All rights reserved.
7851
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
7852
+ * you may not use this file except in compliance with the License. You may obtain a copy
7853
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
7854
+ *
7855
+ * Unless required by applicable law or agreed to in writing, software distributed under
7856
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
7857
+ * OF ANY KIND, either express or implied. See the License for the specific language
7858
+ * governing permissions and limitations under the License.
7859
+ */
7860
+
7861
+
7862
+
7863
+
7864
+ const $c8a5a149f625efcf$var$SharedElementContext = /*#__PURE__*/ (createContext)(null);
7865
+ function $c8a5a149f625efcf$export$758399f318e6385a(props) {
7866
+ let ref = (useRef)({});
7867
+ return /*#__PURE__*/ (React__default).createElement($c8a5a149f625efcf$var$SharedElementContext.Provider, {
7868
+ value: ref
7869
+ }, props.children);
7870
+ }
7871
+
7872
+ /*
7873
+ * Copyright 2025 Adobe. All rights reserved.
7874
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
7875
+ * you may not use this file except in compliance with the License. You may obtain a copy
7876
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
7877
+ *
7878
+ * Unless required by applicable law or agreed to in writing, software distributed under
7879
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
7880
+ * OF ANY KIND, either express or implied. See the License for the specific language
7881
+ * governing permissions and limitations under the License.
7882
+ */
7883
+
7884
+
7885
+ const $1d5b8b8664671ef2$export$c9549807523555e0 = /*#__PURE__*/ (createContext)({
7886
+ isSelected: false
7887
+ });
7888
+
7684
7889
  /*
7685
7890
  * Copyright 2022 Adobe. All rights reserved.
7686
7891
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -7714,6 +7919,7 @@ const $431f98aba6844401$export$1ff3c3f08ae963c0 = /*#__PURE__*/ ($e1995378a14296
7714
7919
  let { elementType: elementType, orientation: orientation, style: style, className: className, slot: slot, ...otherProps } = props;
7715
7920
  let Element = elementType || 'hr';
7716
7921
  if (Element === 'hr' && orientation === 'vertical') Element = 'div';
7922
+ let ElementType = ($64fa3d84918910a7$export$df3a06d6289f983e)[Element];
7717
7923
  let { separatorProps: separatorProps } = ($f4b273590fab9f93$export$52210f68a14655d0)({
7718
7924
  ...otherProps,
7719
7925
  elementType: elementType,
@@ -7722,7 +7928,8 @@ const $431f98aba6844401$export$1ff3c3f08ae963c0 = /*#__PURE__*/ ($e1995378a14296
7722
7928
  let DOMProps = ($65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props, {
7723
7929
  global: true
7724
7930
  });
7725
- return /*#__PURE__*/ (React__default).createElement(Element, {
7931
+ return /*#__PURE__*/ (React__default).createElement(ElementType, {
7932
+ render: props.render,
7726
7933
  ...($3ef42575df84b30b$export$9d1611c77c2fe928)(DOMProps, separatorProps),
7727
7934
  style: style,
7728
7935
  className: className !== null && className !== void 0 ? className : 'react-aria-Separator',
@@ -7841,7 +8048,7 @@ function $07b14b47974efb58$var$PopoverInner({ state: state, isExiting: isExiting
7841
8048
  // Focus the popover itself on mount, unless a child element is already focused.
7842
8049
  // Skip this for submenus since hovering a submenutrigger should keep focus on the trigger
7843
8050
  (useEffect)(()=>{
7844
- if (isDialog && props.trigger !== 'SubmenuTrigger' && ref.current && !ref.current.contains(document.activeElement)) ($3ad3f6e1647bc98d$export$80f3e147d781571c)(ref.current);
8051
+ if (isDialog && (props.trigger !== 'SubmenuTrigger' || ($507fabe10e71c6fb$export$630ff653c5ada6a9)() !== 'pointer') && ref.current && !($d4ee10de306f2510$export$b4f377a2b6254582)(ref.current)) ($3ad3f6e1647bc98d$export$80f3e147d781571c)(ref.current);
7845
8052
  }, [
7846
8053
  isDialog,
7847
8054
  ref,
@@ -7862,7 +8069,7 @@ function $07b14b47974efb58$var$PopoverInner({ state: state, isExiting: isExiting
7862
8069
  '--trigger-anchor-point': triggerAnchorPoint ? `${triggerAnchorPoint.x}px ${triggerAnchorPoint.y}px` : undefined,
7863
8070
  ...renderProps.style
7864
8071
  };
7865
- let overlay = /*#__PURE__*/ (React__default).createElement("div", {
8072
+ let overlay = /*#__PURE__*/ (React__default).createElement(($64fa3d84918910a7$export$df3a06d6289f983e).div, {
7866
8073
  ...($3ef42575df84b30b$export$9d1611c77c2fe928)(($65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props, {
7867
8074
  global: true
7868
8075
  }), popoverProps),
@@ -7961,6 +8168,8 @@ const $63df2425e2108aa8$export$744d98a3b8a94e1c = /*#__PURE__*/ (createContext)(
7961
8168
 
7962
8169
 
7963
8170
 
8171
+
8172
+
7964
8173
  const $3674c52c6b3c5bce$export$c7e742effb1c51e2 = /*#__PURE__*/ (createContext)(null);
7965
8174
  const $3674c52c6b3c5bce$export$24aad8519b95b41b = /*#__PURE__*/ (createContext)(null);
7966
8175
  const $3674c52c6b3c5bce$export$795aec4671cbae19 = /*#__PURE__*/ (createContext)(null);
@@ -8046,7 +8255,7 @@ const $3674c52c6b3c5bce$export$d9b273488cd8ce6f = /*#__PURE__*/ (forwardRef)(fun
8046
8255
  }));
8047
8256
  });
8048
8257
  function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection, menuRef: ref }) {
8049
- [props, ref] = ($64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, ($8e6cc465cc68f603$export$b0d3ecf7112093a7));
8258
+ [props, ref] = ($64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, ($4e85f108e88277b8$export$b0d3ecf7112093a7));
8050
8259
  let { filter: filter, ...autocompleteMenuProps } = props;
8051
8260
  let filteredCollection = (useMemo)(()=>filter ? collection.filter(filter) : collection, [
8052
8261
  collection,
@@ -8065,9 +8274,9 @@ function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection,
8065
8274
  onClose: props.onClose || (triggerState === null || triggerState === void 0 ? void 0 : triggerState.close)
8066
8275
  }, state, ref);
8067
8276
  let renderProps = ($64fa3d84918910a7$export$4d86445c2cf5e3)({
8277
+ ...props,
8278
+ children: undefined,
8068
8279
  defaultClassName: 'react-aria-Menu',
8069
- className: props.className,
8070
- style: props.style,
8071
8280
  values: {
8072
8281
  isEmpty: state.collection.size === 0
8073
8282
  }
@@ -8082,7 +8291,7 @@ function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection,
8082
8291
  let DOMProps = ($65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props, {
8083
8292
  global: true
8084
8293
  });
8085
- return /*#__PURE__*/ (React__default).createElement(($9bf71ea28793e738$export$20e40289641fbbb6), null, /*#__PURE__*/ (React__default).createElement("div", {
8294
+ return /*#__PURE__*/ (React__default).createElement(($9bf71ea28793e738$export$20e40289641fbbb6), null, /*#__PURE__*/ (React__default).createElement(($64fa3d84918910a7$export$df3a06d6289f983e).div, {
8086
8295
  ...($3ef42575df84b30b$export$9d1611c77c2fe928)(DOMProps, renderProps, menuProps),
8087
8296
  ref: ref,
8088
8297
  slot: props.slot || undefined,
@@ -8116,14 +8325,16 @@ function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection,
8116
8325
  ],
8117
8326
  [
8118
8327
  $3674c52c6b3c5bce$var$MenuItemContext,
8119
- null
8328
+ {
8329
+ shouldCloseOnSelect: props.shouldCloseOnSelect
8330
+ }
8120
8331
  ],
8121
8332
  [
8122
- ($8e6cc465cc68f603$export$b0d3ecf7112093a7),
8333
+ ($4e85f108e88277b8$export$b0d3ecf7112093a7),
8123
8334
  null
8124
8335
  ],
8125
8336
  [
8126
- ($8e6cc465cc68f603$export$698f465ec27e93df),
8337
+ ($4e85f108e88277b8$export$698f465ec27e93df),
8127
8338
  null
8128
8339
  ],
8129
8340
  [
@@ -8135,11 +8346,11 @@ function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection,
8135
8346
  triggerState !== null && triggerState !== void 0 ? triggerState : ($a28c903ee9ad8dc5$export$79fefeb1c2091ac3)({})
8136
8347
  ]
8137
8348
  ]
8138
- }, /*#__PURE__*/ (React__default).createElement(CollectionRoot, {
8349
+ }, /*#__PURE__*/ (React__default).createElement(($c8a5a149f625efcf$export$758399f318e6385a), null, /*#__PURE__*/ (React__default).createElement(CollectionRoot, {
8139
8350
  collection: state.collection,
8140
8351
  persistedKeys: ($7135fc7d473fd974$export$90e00781bc59d8f9)(state.selectionManager.focusedKey),
8141
8352
  scrollRef: ref
8142
- })), emptyState));
8353
+ }))), emptyState));
8143
8354
  }
8144
8355
  // A subclass of SelectionManager that forwards focus-related properties to the parent,
8145
8356
  // but has its own local selection state.
@@ -8165,7 +8376,7 @@ class $3674c52c6b3c5bce$var$GroupSelectionManager extends ($d496c0a20b6e58ec$exp
8165
8376
  }
8166
8377
  }
8167
8378
  function $3674c52c6b3c5bce$var$MenuSectionInner(props, ref, section, className = 'react-aria-MenuSection') {
8168
- var _section_props, _section_props1;
8379
+ var _section_props, _section_props1, _useSlottedContext;
8169
8380
  let state = (useContext)($3674c52c6b3c5bce$export$24aad8519b95b41b);
8170
8381
  let { CollectionBranch: CollectionBranch } = (useContext)(($7135fc7d473fd974$export$4feb769f8ddf26c5));
8171
8382
  let [headingRef, heading] = ($64fa3d84918910a7$export$9d4c57ee4c6ffdd8)();
@@ -8175,19 +8386,24 @@ function $3674c52c6b3c5bce$var$MenuSectionInner(props, ref, section, className =
8175
8386
  'aria-label': (_section_props_arialabel = section.props['aria-label']) !== null && _section_props_arialabel !== void 0 ? _section_props_arialabel : undefined
8176
8387
  });
8177
8388
  let renderProps = ($64fa3d84918910a7$export$4d86445c2cf5e3)({
8389
+ ...props,
8390
+ id: undefined,
8391
+ children: undefined,
8178
8392
  defaultClassName: className,
8179
8393
  className: (_section_props = section.props) === null || _section_props === void 0 ? void 0 : _section_props.className,
8180
8394
  style: (_section_props1 = section.props) === null || _section_props1 === void 0 ? void 0 : _section_props1.style,
8181
- values: {}
8395
+ values: undefined
8182
8396
  });
8183
8397
  let parent = (useContext)($3674c52c6b3c5bce$var$SelectionManagerContext);
8184
8398
  let selectionState = ($7af3f5b51489e0b5$export$253fe78d46329472)(props);
8185
8399
  let manager = props.selectionMode != null ? new $3674c52c6b3c5bce$var$GroupSelectionManager(parent, selectionState) : parent;
8400
+ let closeOnSelect = (_useSlottedContext = ($64fa3d84918910a7$export$fabf2dc03a41866e)($3674c52c6b3c5bce$var$MenuItemContext)) === null || _useSlottedContext === void 0 ? void 0 : _useSlottedContext.shouldCloseOnSelect;
8186
8401
  let DOMProps = ($65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props, {
8187
8402
  global: true
8188
8403
  });
8189
8404
  delete DOMProps.id;
8190
- return /*#__PURE__*/ (React__default).createElement("section", {
8405
+ var _props_shouldCloseOnSelect;
8406
+ return /*#__PURE__*/ (React__default).createElement(($64fa3d84918910a7$export$df3a06d6289f983e).section, {
8191
8407
  ...($3ef42575df84b30b$export$9d1611c77c2fe928)(DOMProps, renderProps, groupProps),
8192
8408
  ref: ref
8193
8409
  }, /*#__PURE__*/ (React__default).createElement(($64fa3d84918910a7$export$2881499e37b75b9a), {
@@ -8202,6 +8418,12 @@ function $3674c52c6b3c5bce$var$MenuSectionInner(props, ref, section, className =
8202
8418
  [
8203
8419
  $3674c52c6b3c5bce$var$SelectionManagerContext,
8204
8420
  manager
8421
+ ],
8422
+ [
8423
+ $3674c52c6b3c5bce$var$MenuItemContext,
8424
+ {
8425
+ shouldCloseOnSelect: (_props_shouldCloseOnSelect = props.shouldCloseOnSelect) !== null && _props_shouldCloseOnSelect !== void 0 ? _props_shouldCloseOnSelect : closeOnSelect
8426
+ }
8205
8427
  ]
8206
8428
  ]
8207
8429
  }, /*#__PURE__*/ (React__default).createElement(CollectionBranch, {
@@ -8218,11 +8440,13 @@ const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /*#__PURE__*/ ($e1995378a14296
8218
8440
  let state = (useContext)($3674c52c6b3c5bce$export$24aad8519b95b41b);
8219
8441
  let ref = ($df56164dff5785e2$export$4338b53315abf666)(forwardedRef);
8220
8442
  let selectionManager = (useContext)($3674c52c6b3c5bce$var$SelectionManagerContext);
8443
+ let { isVirtualized: isVirtualized } = (useContext)(($7135fc7d473fd974$export$4feb769f8ddf26c5));
8221
8444
  let { menuItemProps: menuItemProps, labelProps: labelProps, descriptionProps: descriptionProps, keyboardShortcutProps: keyboardShortcutProps, ...states } = ($a2e5df62f93c7633$export$9d32628fc2aea7da)({
8222
8445
  ...props,
8223
8446
  id: id,
8224
8447
  key: item.key,
8225
- selectionManager: selectionManager
8448
+ selectionManager: selectionManager,
8449
+ isVirtualized: isVirtualized
8226
8450
  }, state, ref);
8227
8451
  let { hoverProps: hoverProps, isHovered: isHovered } = ($6179b936705e76d3$export$ae780daf29e6d456)({
8228
8452
  isDisabled: states.isDisabled
@@ -8242,7 +8466,7 @@ const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /*#__PURE__*/ ($e1995378a14296
8242
8466
  isOpen: props['aria-expanded'] === 'true'
8243
8467
  }
8244
8468
  });
8245
- let ElementType = props.href ? 'a' : 'div';
8469
+ let ElementType = props.href ? ($64fa3d84918910a7$export$df3a06d6289f983e).a : ($64fa3d84918910a7$export$df3a06d6289f983e).div;
8246
8470
  let DOMProps = ($65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props, {
8247
8471
  global: true
8248
8472
  });
@@ -8275,6 +8499,12 @@ const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /*#__PURE__*/ ($e1995378a14296
8275
8499
  [
8276
8500
  ($63df2425e2108aa8$export$744d98a3b8a94e1c),
8277
8501
  keyboardShortcutProps
8502
+ ],
8503
+ [
8504
+ ($1d5b8b8664671ef2$export$c9549807523555e0),
8505
+ {
8506
+ isSelected: states.isSelected
8507
+ }
8278
8508
  ]
8279
8509
  ]
8280
8510
  }, renderProps.children));
@@ -8282,7 +8512,7 @@ const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /*#__PURE__*/ ($e1995378a14296
8282
8512
 
8283
8513
  const $de32f1b87079253c$export$d2f961adcb0afbe = /*#__PURE__*/ (createContext)(null);
8284
8514
 
8285
- var styles = {"wrapper":"fpi0W91w2ag-","floatingContainer":"ba-Kj6mvQUw-","menu":"-DayvgvIcVo-","legacySection":"VsRRunpS6Yo-","separator":"jnggqK3YTIU-","triggerWrapper":"oRQQVVq-yxA-","ariaMenu":"QInUBKqkrl0-","ariaItem":"bWR8m7-LKg4-","ariaSection":"PH5vvtLgvXI-","ariaSectionHeader":"iJjIifpa9bk-","sectionHeader":"Bq7pLWj3jm4-","legacyAction":"P4Sdaq0-lZs-","action":"M1BgN-oCmKw-","destructive":"U9ihZZavz9w-","overlay":"_7we5hh6kYs8-","fullWidth":"_5OJ7B6mFcwk-","screenReaderOnly":"Bzvkz60bwWE-","spinning":"_0-VzuzHdi8o-"};
8515
+ var styles = {"wrapper":"fpi0W91w2ag-","floatingContainer":"ba-Kj6mvQUw-","menu":"-DayvgvIcVo-","legacySection":"VsRRunpS6Yo-","separator":"jnggqK3YTIU-","triggerWrapper":"oRQQVVq-yxA-","ariaMenu":"QInUBKqkrl0-","ariaItem":"bWR8m7-LKg4-","ariaSection":"PH5vvtLgvXI-","ariaSectionHeader":"iJjIifpa9bk-","sectionHeader":"Bq7pLWj3jm4-","legacyAction":"P4Sdaq0-lZs-","action":"M1BgN-oCmKw-","destructive":"U9ihZZavz9w-","overlay":"_7we5hh6kYs8-","fullWidth":"_5OJ7B6mFcwk-","screenReaderOnly":"Bzvkz60bwWE-"};
8286
8516
 
8287
8517
  const SMALL_SCREEN_BREAKPOINT = 490;
8288
8518
  const MENU_OFFSET = 6;