@altinn/altinn-components 0.52.3 → 0.52.5

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 (496) hide show
  1. package/dist/assets/AccountMenuButton.css +1 -1
  2. package/dist/assets/AccountSelector.css +1 -1
  3. package/dist/assets/ActionFooter.css +1 -1
  4. package/dist/assets/ActionHeader.css +1 -1
  5. package/dist/assets/Avatar.css +1 -1
  6. package/dist/assets/Backdrop.css +1 -1
  7. package/dist/assets/BreadcrumbsLink.css +1 -1
  8. package/dist/assets/ButtonBase.css +1 -1
  9. package/dist/assets/ButtonGroup.css +1 -0
  10. package/dist/assets/ButtonGroupDivider.css +1 -0
  11. package/dist/assets/ButtonLabel.css +1 -1
  12. package/dist/assets/DrawerBase.css +1 -1
  13. package/dist/assets/DrawerOrDropdown.css +1 -1
  14. package/dist/assets/DropdownBase.css +1 -1
  15. package/dist/assets/Flex.css +1 -1
  16. package/dist/assets/FooterBase.css +1 -1
  17. package/dist/assets/FooterMenu.css +1 -1
  18. package/dist/assets/GlobalHeader.css +1 -1
  19. package/dist/assets/GlobalHeaderBase.css +1 -1
  20. package/dist/assets/GlobalMenuBase.css +1 -1
  21. package/dist/assets/Grid.css +1 -1
  22. package/dist/assets/Header.css +1 -1
  23. package/dist/assets/HeaderBase.css +1 -1
  24. package/dist/assets/HeaderGroup.css +1 -1
  25. package/dist/assets/HeaderGroup2.css +1 -1
  26. package/dist/assets/HeaderLogo.css +1 -1
  27. package/dist/assets/HeaderSearch.css +1 -1
  28. package/dist/assets/LayoutBody.css +1 -1
  29. package/dist/assets/LayoutContent.css +1 -1
  30. package/dist/assets/LayoutSidebar.css +1 -1
  31. package/dist/assets/ListItemBase.css +1 -1
  32. package/dist/assets/ListItemHeader.css +1 -1
  33. package/dist/assets/ListItemLink.css +1 -1
  34. package/dist/assets/MenuItem.css +1 -1
  35. package/dist/assets/MenuItemBase.css +1 -1
  36. package/dist/assets/MenuSearch.css +1 -1
  37. package/dist/assets/MetaItemBase.css +1 -1
  38. package/dist/assets/NotificationItemBase.css +1 -1
  39. package/dist/assets/NotificationItemIcon.css +1 -1
  40. package/dist/assets/PageMenu.css +1 -1
  41. package/dist/assets/PageTabs.css +1 -1
  42. package/dist/assets/SearchField.css +1 -1
  43. package/dist/assets/SearchbarBase.css +1 -1
  44. package/dist/assets/SearchbarField.css +1 -1
  45. package/dist/assets/SnackbarBase.css +1 -1
  46. package/dist/assets/TimelineBase.css +1 -1
  47. package/dist/assets/ToolbarBase.css +1 -1
  48. package/dist/assets/globalSearch.css +1 -1
  49. package/dist/button-MzZgmHyA.js +23 -0
  50. package/dist/components/AccessAreaListItem/AccessAreaListItem.js +1 -1
  51. package/dist/components/AccessPackageListItem/AccessPackageListItem.js +1 -1
  52. package/dist/components/Account/AccountList.js +23 -23
  53. package/dist/components/Account/AccountListItem.js +1 -1
  54. package/dist/components/Account/AccountListItemControls.js +26 -26
  55. package/dist/components/Account/AccountListItemDetails.js +1 -1
  56. package/dist/components/Account/AccountListVirtual.js +47 -50
  57. package/dist/components/Account/AccountMenu.js +47 -51
  58. package/dist/components/Account/AccountMenuButton.js +65 -65
  59. package/dist/components/Account/AccountNotificationSettings.js +1 -1
  60. package/dist/components/Account/AccountOrganization.js +1 -1
  61. package/dist/components/ActivityLog/ActivityLog.js +13 -13
  62. package/dist/components/ActivityLog/ActivityLogItem.js +1 -1
  63. package/dist/components/ActivityLog/ActivityLogSegment.js +6 -6
  64. package/dist/components/Alert/Alert.js +1 -1
  65. package/dist/components/Article/Article.js +1 -1
  66. package/dist/components/Article/ArticleContact.js +1 -1
  67. package/dist/components/Article/ArticleHeader.js +1 -1
  68. package/dist/components/Attachment/AttachmentLink.js +1 -1
  69. package/dist/components/Avatar/Avatar.js +1 -1
  70. package/dist/components/Avatar/AvatarGroup.js +31 -31
  71. package/dist/components/Badge/Badge.js +1 -1
  72. package/dist/components/Banner/Banner.js +6 -6
  73. package/dist/components/Button/Button.js +1 -1
  74. package/dist/components/Button/ButtonBase.js +2 -2
  75. package/dist/components/Button/ButtonGroup.js +28 -8
  76. package/dist/components/Button/ButtonGroupDivider.js +8 -0
  77. package/dist/components/Button/ButtonIcon.js +1 -1
  78. package/dist/components/Button/ButtonLabel.js +5 -5
  79. package/dist/components/Button/ComboButton.js +1 -1
  80. package/dist/components/Button/FloatingActionButton.js +1 -1
  81. package/dist/components/Button/IconButton.js +1 -1
  82. package/dist/components/Byline/Byline.js +1 -1
  83. package/dist/components/ContextMenu/ContextMenu.js +51 -54
  84. package/dist/components/Dashboard/DashboardCard.js +25 -25
  85. package/dist/components/Dashboard/DashboardHeader.js +1 -1
  86. package/dist/components/Dashboard/DashboardIcon.js +1 -1
  87. package/dist/components/Datepicker/DatepickerBase.js +1 -1
  88. package/dist/components/Datepicker/DatepickerHeader.js +1 -1
  89. package/dist/components/Datepicker/DatepickerTable.js +1 -1
  90. package/dist/components/Dialog/Dialog.js +1 -1
  91. package/dist/components/Dialog/DialogActions.js +13 -16
  92. package/dist/components/Dialog/DialogActivityLog.js +1 -1
  93. package/dist/components/Dialog/DialogAttachments.js +8 -8
  94. package/dist/components/Dialog/DialogBody.js +20 -20
  95. package/dist/components/Dialog/DialogByline.js +14 -14
  96. package/dist/components/Dialog/DialogContact.js +1 -1
  97. package/dist/components/Dialog/DialogHeader.js +1 -1
  98. package/dist/components/Dialog/DialogHistory.js +14 -14
  99. package/dist/components/Dialog/DialogHistoryItem.js +1 -1
  100. package/dist/components/Dialog/DialogHistorySegment.js +15 -15
  101. package/dist/components/Dialog/DialogLayout.js +14 -14
  102. package/dist/components/Dialog/DialogList.js +15 -15
  103. package/dist/components/Dialog/DialogListGroup.js +1 -1
  104. package/dist/components/Dialog/DialogListItem.js +27 -27
  105. package/dist/components/Dialog/DialogMetadata.js +38 -38
  106. package/dist/components/Dialog/DialogSection.js +1 -1
  107. package/dist/components/Dialog/DialogSeenBy.js +1 -1
  108. package/dist/components/Dialog/DialogSelect.js +1 -1
  109. package/dist/components/Dialog/DialogStatus.js +1 -1
  110. package/dist/components/Dialog/DialogTabs.js +1 -1
  111. package/dist/components/Dialog/SeenByLog.js +18 -18
  112. package/dist/components/Dialog/SeenByLogButton.js +1 -1
  113. package/dist/components/Dialog/SeenByLogItem.js +1 -1
  114. package/dist/components/Dropdown/Backdrop.js +1 -1
  115. package/dist/components/Dropdown/DrawerBase.js +1 -1
  116. package/dist/components/Dropdown/DrawerBody.js +1 -1
  117. package/dist/components/Dropdown/DrawerButton.js +1 -1
  118. package/dist/components/Dropdown/DrawerFooter.js +1 -1
  119. package/dist/components/Dropdown/DrawerHeader.js +1 -1
  120. package/dist/components/Dropdown/DrawerOrDropdown.js +30 -30
  121. package/dist/components/Dropdown/DropdownBase.js +1 -1
  122. package/dist/components/Dropdown/FloatingDropdown.js +53 -55
  123. package/dist/components/DsComponents/index.js +9 -9
  124. package/dist/components/Footer/FooterAddress.js +1 -1
  125. package/dist/components/Footer/FooterBase.js +1 -1
  126. package/dist/components/Footer/FooterLogo.js +1 -1
  127. package/dist/components/Footer/FooterMenu.js +1 -1
  128. package/dist/components/Forms/Checkbox.js +1 -1
  129. package/dist/components/Forms/CheckboxOptions.js +1 -1
  130. package/dist/components/Forms/Field.js +8 -8
  131. package/dist/components/Forms/FieldBase.js +1 -1
  132. package/dist/components/Forms/Fieldset.js +2 -2
  133. package/dist/components/Forms/FieldsetBase.js +1 -1
  134. package/dist/components/Forms/Input.js +1 -1
  135. package/dist/components/Forms/Label.js +1 -1
  136. package/dist/components/Forms/Legend.js +1 -1
  137. package/dist/components/Forms/Radio.js +1 -1
  138. package/dist/components/Forms/RadioOptions.js +5 -5
  139. package/dist/components/Forms/SearchField.js +34 -32
  140. package/dist/components/Forms/Select.js +15 -15
  141. package/dist/components/Forms/SelectField.js +1 -1
  142. package/dist/components/Forms/Switch.js +1 -1
  143. package/dist/components/Forms/SwitchOptions.js +4 -4
  144. package/dist/components/Forms/TextField.js +1 -1
  145. package/dist/components/Forms/Textarea.js +1 -1
  146. package/dist/components/Forms/TextareaField.js +1 -1
  147. package/dist/components/GlobalHeader/AccountSelector.js +50 -51
  148. package/dist/components/GlobalHeader/GlobalHeader.js +86 -87
  149. package/dist/components/GlobalHeader/GlobalHeaderBase.js +1 -1
  150. package/dist/components/GlobalHeader/GlobalSearch.js +17 -18
  151. package/dist/components/GlobalHeader/GlobalSearchButton.js +3 -3
  152. package/dist/components/GlobalHeader/HeaderGroup.js +1 -1
  153. package/dist/components/GlobalHeader/HeaderLogo.js +1 -1
  154. package/dist/components/GlobalMenu/BackButton.js +1 -1
  155. package/dist/components/GlobalMenu/GlobalMenu.js +40 -42
  156. package/dist/components/GlobalMenu/GlobalMenuButton.js +10 -10
  157. package/dist/components/GlobalMenu/LocaleButton.js +1 -1
  158. package/dist/components/GlobalMenu/LocaleSwitcher.js +18 -19
  159. package/dist/components/GlobalMenu/LogoutButton.js +1 -1
  160. package/dist/components/GlobalMenu_old/BackButton.js +1 -1
  161. package/dist/components/GlobalMenu_old/CurrentAccount.js +10 -10
  162. package/dist/components/GlobalMenu_old/GlobalMenu.js +50 -53
  163. package/dist/components/GlobalMenu_old/GlobalMenuButton.js +29 -29
  164. package/dist/components/GlobalMenu_old/LogoutButton.js +1 -1
  165. package/dist/components/Header/Header.js +50 -50
  166. package/dist/components/Header/HeaderBase.js +1 -1
  167. package/dist/components/Header/HeaderButton.js +30 -30
  168. package/dist/components/Header/HeaderGroup.js +1 -1
  169. package/dist/components/Header/HeaderLogo.js +1 -1
  170. package/dist/components/Header/HeaderSearch.js +1 -1
  171. package/dist/components/Header/LocaleButton.js +1 -1
  172. package/dist/components/Header/LocaleSwitcher.js +27 -29
  173. package/dist/components/Icon/Icon.js +1 -1
  174. package/dist/components/Icon/IconOrAvatar.js +1 -1
  175. package/dist/components/Icon/ProgressIcon.js +1 -1
  176. package/dist/components/InboxSearch/InboxSearch.js +1 -1
  177. package/dist/components/Layout/Layout.js +39 -39
  178. package/dist/components/LayoutAction/ActionHeader.js +1 -1
  179. package/dist/components/LayoutAction/LayoutAction.js +10 -10
  180. package/dist/components/List/List.js +1 -1
  181. package/dist/components/List/ListBase.js +1 -1
  182. package/dist/components/List/ListItem.js +1 -1
  183. package/dist/components/List/ListItemBase.js +1 -1
  184. package/dist/components/List/ListItemControls.js +1 -1
  185. package/dist/components/List/ListItemHeader.js +1 -1
  186. package/dist/components/List/ListItemIcon.js +1 -1
  187. package/dist/components/List/ListItemLabel.js +1 -1
  188. package/dist/components/List/ListItemLink.js +39 -39
  189. package/dist/components/List/ListItemSelect.js +1 -1
  190. package/dist/components/Menu/MenuBase.js +1 -1
  191. package/dist/components/Menu/MenuItem.js +1 -1
  192. package/dist/components/Menu/MenuItemBase.js +46 -46
  193. package/dist/components/Menu/MenuItemIcon.js +9 -9
  194. package/dist/components/Menu/MenuItemLabel.js +29 -29
  195. package/dist/components/Menu/MenuItems.js +61 -64
  196. package/dist/components/Menu/MenuItemsVirtual.js +111 -120
  197. package/dist/components/Menu/MenuOption.js +1 -1
  198. package/dist/components/Menu/MenuSearch.js +1 -1
  199. package/dist/components/Metadata/MetaBase.js +1 -1
  200. package/dist/components/Metadata/MetaItem.js +1 -1
  201. package/dist/components/Metadata/MetaItemBase.js +1 -1
  202. package/dist/components/Metadata/MetaItemIcon.js +1 -1
  203. package/dist/components/Metadata/MetaProgress.js +1 -1
  204. package/dist/components/Metadata/MetaTimestamp.js +1 -1
  205. package/dist/components/Metadata/Metadata.js +1 -1
  206. package/dist/components/Modal/Modal.js +1 -1
  207. package/dist/components/Modal/ModalBase.js +49 -50
  208. package/dist/components/Modal/ModalBody.js +1 -1
  209. package/dist/components/Modal/ModalFooter.js +1 -1
  210. package/dist/components/Modal/ModalHeader.js +18 -18
  211. package/dist/components/Modal/ModalIcon.js +1 -1
  212. package/dist/components/Notifications/NotificationItem.js +1 -1
  213. package/dist/components/Notifications/NotificationItemBase.js +1 -1
  214. package/dist/components/Notifications/NotificationItemControls.js +1 -1
  215. package/dist/components/Notifications/NotificationItemIcon.js +1 -1
  216. package/dist/components/Page/AccordionSection.js +9 -9
  217. package/dist/components/Page/Breadcrumbs.js +14 -14
  218. package/dist/components/Page/BreadcrumbsLink.js +1 -1
  219. package/dist/components/Page/ContactButtons.js +1 -1
  220. package/dist/components/Page/ContactSection.js +1 -1
  221. package/dist/components/Page/Flex.js +1 -1
  222. package/dist/components/Page/Grid.js +1 -1
  223. package/dist/components/Page/PageDetails.js +5 -5
  224. package/dist/components/Page/PageMenu.js +1 -1
  225. package/dist/components/Page/PageNav.js +17 -17
  226. package/dist/components/Page/PageTabs.js +1 -1
  227. package/dist/components/Page/Section.js +1 -1
  228. package/dist/components/ResourceListItem/ResourceListItem.js +1 -1
  229. package/dist/components/RootProvider/RootProvider.js +30 -30
  230. package/dist/components/Search/SearchItem.js +12 -12
  231. package/dist/components/Searchbar/Autocomplete.js +35 -38
  232. package/dist/components/Searchbar/AutocompleteBase.js +1 -1
  233. package/dist/components/Searchbar/AutocompleteItem.js +1 -1
  234. package/dist/components/Searchbar/Searchbar.js +41 -44
  235. package/dist/components/Searchbar/SearchbarBase.js +1 -1
  236. package/dist/components/Searchbar/SearchbarField.js +59 -60
  237. package/dist/components/Settings/BookmarksSettingsItem.js +57 -59
  238. package/dist/components/Settings/BookmarksSettingsList.js +25 -25
  239. package/dist/components/Settings/SettingsItem.js +48 -48
  240. package/dist/components/Settings/SettingsItemBase.js +1 -1
  241. package/dist/components/Settings/SettingsList.js +25 -25
  242. package/dist/components/Settings/SettingsModal.js +27 -28
  243. package/dist/components/Settings/SettingsSection.js +1 -1
  244. package/dist/components/Settings/UsedByLog.js +31 -31
  245. package/dist/components/Settings/UsedByLogItem.js +1 -1
  246. package/dist/components/Skeleton/Skeleton.js +1 -1
  247. package/dist/components/SkipLink/SkipLink.js +1 -1
  248. package/dist/components/Snackbar/SnackbarItem.js +13 -13
  249. package/dist/components/Snackbar/useSnackbar.js +20 -20
  250. package/dist/components/Timeline/Timeline.js +1 -1
  251. package/dist/components/Timeline/TimelineActivity.js +1 -1
  252. package/dist/components/Timeline/TimelineBase.js +1 -1
  253. package/dist/components/Timeline/TimelineFooter.js +1 -1
  254. package/dist/components/Timeline/TimelineHeader.js +1 -1
  255. package/dist/components/Timeline/TimelineIcon.js +1 -1
  256. package/dist/components/Timeline/TimelineLink.js +1 -1
  257. package/dist/components/Timeline/TimelineSection.js +1 -1
  258. package/dist/components/Timeline/TimelineSegment.js +1 -1
  259. package/dist/components/Toolbar/Toolbar.js +57 -58
  260. package/dist/components/Toolbar/ToolbarAccountMenu.js +36 -36
  261. package/dist/components/Toolbar/ToolbarAdd.js +1 -1
  262. package/dist/components/Toolbar/ToolbarButton.js +1 -1
  263. package/dist/components/Toolbar/ToolbarDaterange.js +1 -1
  264. package/dist/components/Toolbar/ToolbarFilter.js +51 -51
  265. package/dist/components/Toolbar/ToolbarFilterBase.js +1 -1
  266. package/dist/components/Toolbar/ToolbarMenu.js +1 -1
  267. package/dist/components/Toolbar/ToolbarOptions.js +51 -55
  268. package/dist/components/Toolbar/ToolbarSearch.js +1 -1
  269. package/dist/components/Transmission/Transmission.js +45 -45
  270. package/dist/components/Transmission/TransmissionList.js +1 -1
  271. package/dist/components/Transmission/TransmissionType.js +1 -1
  272. package/dist/components/Typography/Heading.js +1 -1
  273. package/dist/components/Typography/Typography.js +1 -1
  274. package/dist/components/Typography/useHighlightedText.js +13 -13
  275. package/dist/components/UserListItem/UserListItem.js +1 -1
  276. package/dist/components/index.js +449 -455
  277. package/dist/{FieldsetLegend-CiZWWPgY.js → fieldset-legend-B6lDmp0N.js} +1 -1
  278. package/dist/global.css +7 -7
  279. package/dist/globalSearch.module-DziLSGZg.js +9 -0
  280. package/dist/{Heading-By5DKz2H.js → heading-C_XYsUfi.js} +1 -1
  281. package/dist/hooks/useAccountSelector.js +96 -97
  282. package/dist/hooks/useClickOutside.js +8 -8
  283. package/dist/hooks/useEnterKey.js +6 -6
  284. package/dist/hooks/useEscapeKey.js +5 -5
  285. package/dist/hooks/useMenu.js +33 -33
  286. package/dist/index-D7FJjvrv.js +86 -0
  287. package/dist/{index-D-VWMqlv.js → index-De5bF0Gf.js} +4 -4
  288. package/dist/index-Dg71_7ad.js +2993 -0
  289. package/dist/index-Q0EA2XB0.js +111 -0
  290. package/dist/index-p1eeF8LQ.js +42 -0
  291. package/dist/index-z82sbSVU.js +105 -0
  292. package/dist/index.js +457 -463
  293. package/dist/input-wBv_FkEV.js +12 -0
  294. package/dist/{Label-9elsbqMH.js → label-xTmTyPhk.js} +1 -1
  295. package/dist/{Paragraph-Bm-eoPYv.js → paragraph-BRiIBpbY.js} +1 -1
  296. package/dist/spinner-0Qe_jRGB.js +23 -0
  297. package/dist/textfield-B_OMMEbF.js +1442 -0
  298. package/dist/tokens/{altinn-ds.css → design-tokens-build/theme.css} +425 -466
  299. package/dist/types/lib/components/Banner/Banner.d.ts +1 -1
  300. package/dist/types/lib/components/Button/ButtonGroup.d.ts +9 -5
  301. package/dist/types/lib/components/Button/ButtonGroup.stories.d.ts +12 -0
  302. package/dist/types/lib/components/Button/ButtonGroupDivider.d.ts +1 -0
  303. package/dist/types/lib/components/Forms/SearchField.stories.d.ts +1 -0
  304. package/dist/types/lib/components/LayoutAction/LayoutAction.d.ts +1 -1
  305. package/dist/types/lib/components/Snackbar/SnackbarItem.d.ts +1 -1
  306. package/dist/types/lib/components/index.d.ts +0 -1
  307. package/dist/types/lib/types/color.d.ts +1 -1
  308. package/dist/types/lib/types/fields.d.ts +1 -1
  309. package/dist/use-merge-refs-Cj4kTYVj.js +29 -0
  310. package/package.json +24 -20
  311. package/dist/Button-B0t0vz2h.js +0 -23
  312. package/dist/Input-B_w6SBmg.js +0 -12
  313. package/dist/Spinner-BDXfwXIh.js +0 -26
  314. package/dist/altinn-ds-overrides.css +0 -53
  315. package/dist/altinn-ds.css +0 -1125
  316. package/dist/components/Bookmarks/BookmarksListItem.js +0 -20
  317. package/dist/components/Bookmarks/BookmarksSection.js +0 -40
  318. package/dist/components/Bookmarks/EditableBookmark.js +0 -92
  319. package/dist/components/Bookmarks/index.js +0 -8
  320. package/dist/globalSearch.module-Ejp7X0dO.js +0 -9
  321. package/dist/index-B6sKSsN9.js +0 -2951
  322. package/dist/index-CnWc2FNH.js +0 -81
  323. package/dist/index-D3Rt9ate.js +0 -116
  324. package/dist/index-D8Pn8SCu.js +0 -78
  325. package/dist/index-L8X2o7IH.js +0 -44
  326. package/dist/tokens/$metadata.json +0 -25
  327. package/dist/tokens/$themes.json +0 -137
  328. package/dist/tokens/README.md +0 -14
  329. package/dist/tokens/alert.css +0 -25
  330. package/dist/tokens/alert.json +0 -70
  331. package/dist/tokens/altinn-ds/color/alert.css +0 -25
  332. package/dist/tokens/altinn-ds/color/article.css +0 -25
  333. package/dist/tokens/altinn-ds/color/company.css +0 -26
  334. package/dist/tokens/altinn-ds/color/danger.css +0 -25
  335. package/dist/tokens/altinn-ds/color/info.css +0 -25
  336. package/dist/tokens/altinn-ds/color/neutral.css +0 -25
  337. package/dist/tokens/altinn-ds/color/person.css +0 -25
  338. package/dist/tokens/altinn-ds/color/success.css +0 -25
  339. package/dist/tokens/altinn-ds/color/warning.css +0 -25
  340. package/dist/tokens/altinn-ds/color-scheme/dark.css +0 -311
  341. package/dist/tokens/altinn-ds/color-scheme/light.css +0 -312
  342. package/dist/tokens/altinn-ds/semantic.css +0 -70
  343. package/dist/tokens/altinn-ds/typography/primary.css +0 -123
  344. package/dist/tokens/altinn-ds/typography/secondary.css +0 -122
  345. package/dist/tokens/altinn-ds.json +0 -22
  346. package/dist/tokens/article.css +0 -25
  347. package/dist/tokens/article.json +0 -70
  348. package/dist/tokens/color/alert.css +0 -25
  349. package/dist/tokens/color/article.css +0 -25
  350. package/dist/tokens/color/company.css +0 -26
  351. package/dist/tokens/color/danger.css +0 -25
  352. package/dist/tokens/color/info.css +0 -25
  353. package/dist/tokens/color/neutral.css +0 -25
  354. package/dist/tokens/color/person.css +0 -25
  355. package/dist/tokens/color/success.css +0 -25
  356. package/dist/tokens/color/warning.css +0 -25
  357. package/dist/tokens/color-scheme/dark/altinn-ds.json +0 -334
  358. package/dist/tokens/color-scheme/dark/global.json +0 -334
  359. package/dist/tokens/color-scheme/dark.css +0 -311
  360. package/dist/tokens/color-scheme/light/altinn-ds.json +0 -334
  361. package/dist/tokens/color-scheme/light/global.json +0 -334
  362. package/dist/tokens/color-scheme/light.css +0 -312
  363. package/dist/tokens/color.json +0 -616
  364. package/dist/tokens/colors.d.ts +0 -10
  365. package/dist/tokens/company.css +0 -26
  366. package/dist/tokens/company.json +0 -70
  367. package/dist/tokens/danger.css +0 -25
  368. package/dist/tokens/dark/altinn-ds.json +0 -334
  369. package/dist/tokens/dark/global.json +0 -334
  370. package/dist/tokens/dark.css +0 -311
  371. package/dist/tokens/design-tokens/$metadata.json +0 -25
  372. package/dist/tokens/design-tokens/$themes.json +0 -137
  373. package/dist/tokens/design-tokens/primitives/globals.json +0 -143
  374. package/dist/tokens/design-tokens/primitives/modes/color-scheme/dark/altinn-ds.json +0 -334
  375. package/dist/tokens/design-tokens/primitives/modes/color-scheme/dark/global.json +0 -334
  376. package/dist/tokens/design-tokens/primitives/modes/color-scheme/light/altinn-ds.json +0 -334
  377. package/dist/tokens/design-tokens/primitives/modes/color-scheme/light/global.json +0 -334
  378. package/dist/tokens/design-tokens/primitives/modes/size/global.json +0 -96
  379. package/dist/tokens/design-tokens/primitives/modes/size/large.json +0 -16
  380. package/dist/tokens/design-tokens/primitives/modes/size/medium.json +0 -16
  381. package/dist/tokens/design-tokens/primitives/modes/size/small.json +0 -16
  382. package/dist/tokens/design-tokens/primitives/modes/typography/primary/altinn-ds.json +0 -22
  383. package/dist/tokens/design-tokens/primitives/modes/typography/secondary/altinn-ds.json +0 -22
  384. package/dist/tokens/design-tokens/primitives/modes/typography/size/large.json +0 -96
  385. package/dist/tokens/design-tokens/primitives/modes/typography/size/medium.json +0 -96
  386. package/dist/tokens/design-tokens/primitives/modes/typography/size/small.json +0 -96
  387. package/dist/tokens/design-tokens/semantic/color.json +0 -616
  388. package/dist/tokens/design-tokens/semantic/modes/main-color/company.json +0 -70
  389. package/dist/tokens/design-tokens/semantic/modes/main-color/person.json +0 -70
  390. package/dist/tokens/design-tokens/semantic/modes/support-color/alert.json +0 -70
  391. package/dist/tokens/design-tokens/semantic/modes/support-color/article.json +0 -70
  392. package/dist/tokens/design-tokens/semantic/style.json +0 -378
  393. package/dist/tokens/design-tokens/themes/altinn-ds.json +0 -386
  394. package/dist/tokens/design-tokens-build/altinn-ds/color/alert.css +0 -25
  395. package/dist/tokens/design-tokens-build/altinn-ds/color/article.css +0 -25
  396. package/dist/tokens/design-tokens-build/altinn-ds/color/company.css +0 -26
  397. package/dist/tokens/design-tokens-build/altinn-ds/color/danger.css +0 -25
  398. package/dist/tokens/design-tokens-build/altinn-ds/color/info.css +0 -25
  399. package/dist/tokens/design-tokens-build/altinn-ds/color/neutral.css +0 -25
  400. package/dist/tokens/design-tokens-build/altinn-ds/color/person.css +0 -25
  401. package/dist/tokens/design-tokens-build/altinn-ds/color/success.css +0 -25
  402. package/dist/tokens/design-tokens-build/altinn-ds/color/warning.css +0 -25
  403. package/dist/tokens/design-tokens-build/altinn-ds/color-scheme/dark.css +0 -311
  404. package/dist/tokens/design-tokens-build/altinn-ds/color-scheme/light.css +0 -312
  405. package/dist/tokens/design-tokens-build/altinn-ds/semantic.css +0 -70
  406. package/dist/tokens/design-tokens-build/altinn-ds/typography/primary.css +0 -123
  407. package/dist/tokens/design-tokens-build/altinn-ds/typography/secondary.css +0 -122
  408. package/dist/tokens/design-tokens-build/altinn-ds.css +0 -1125
  409. package/dist/tokens/design-tokens-build/colors.d.ts +0 -10
  410. package/dist/tokens/global.json +0 -334
  411. package/dist/tokens/globals.json +0 -143
  412. package/dist/tokens/info.css +0 -25
  413. package/dist/tokens/large.json +0 -96
  414. package/dist/tokens/light/altinn-ds.json +0 -334
  415. package/dist/tokens/light/global.json +0 -334
  416. package/dist/tokens/light.css +0 -312
  417. package/dist/tokens/main-color/company.json +0 -70
  418. package/dist/tokens/main-color/person.json +0 -70
  419. package/dist/tokens/medium.json +0 -96
  420. package/dist/tokens/modes/color-scheme/dark/altinn-ds.json +0 -334
  421. package/dist/tokens/modes/color-scheme/dark/global.json +0 -334
  422. package/dist/tokens/modes/color-scheme/light/altinn-ds.json +0 -334
  423. package/dist/tokens/modes/color-scheme/light/global.json +0 -334
  424. package/dist/tokens/modes/main-color/company.json +0 -70
  425. package/dist/tokens/modes/main-color/person.json +0 -70
  426. package/dist/tokens/modes/size/global.json +0 -96
  427. package/dist/tokens/modes/size/large.json +0 -16
  428. package/dist/tokens/modes/size/medium.json +0 -16
  429. package/dist/tokens/modes/size/small.json +0 -16
  430. package/dist/tokens/modes/support-color/alert.json +0 -70
  431. package/dist/tokens/modes/support-color/article.json +0 -70
  432. package/dist/tokens/modes/typography/primary/altinn-ds.json +0 -22
  433. package/dist/tokens/modes/typography/secondary/altinn-ds.json +0 -22
  434. package/dist/tokens/modes/typography/size/large.json +0 -96
  435. package/dist/tokens/modes/typography/size/medium.json +0 -96
  436. package/dist/tokens/modes/typography/size/small.json +0 -96
  437. package/dist/tokens/neutral.css +0 -25
  438. package/dist/tokens/person.css +0 -25
  439. package/dist/tokens/person.json +0 -70
  440. package/dist/tokens/primary/altinn-ds.json +0 -22
  441. package/dist/tokens/primary.css +0 -123
  442. package/dist/tokens/primitives/globals.json +0 -143
  443. package/dist/tokens/primitives/modes/color-scheme/dark/altinn-ds.json +0 -334
  444. package/dist/tokens/primitives/modes/color-scheme/dark/global.json +0 -334
  445. package/dist/tokens/primitives/modes/color-scheme/light/altinn-ds.json +0 -334
  446. package/dist/tokens/primitives/modes/color-scheme/light/global.json +0 -334
  447. package/dist/tokens/primitives/modes/size/global.json +0 -96
  448. package/dist/tokens/primitives/modes/size/large.json +0 -16
  449. package/dist/tokens/primitives/modes/size/medium.json +0 -16
  450. package/dist/tokens/primitives/modes/size/small.json +0 -16
  451. package/dist/tokens/primitives/modes/typography/primary/altinn-ds.json +0 -22
  452. package/dist/tokens/primitives/modes/typography/secondary/altinn-ds.json +0 -22
  453. package/dist/tokens/primitives/modes/typography/size/large.json +0 -96
  454. package/dist/tokens/primitives/modes/typography/size/medium.json +0 -96
  455. package/dist/tokens/primitives/modes/typography/size/small.json +0 -96
  456. package/dist/tokens/secondary/altinn-ds.json +0 -22
  457. package/dist/tokens/secondary.css +0 -122
  458. package/dist/tokens/semantic/color.json +0 -616
  459. package/dist/tokens/semantic/modes/main-color/company.json +0 -70
  460. package/dist/tokens/semantic/modes/main-color/person.json +0 -70
  461. package/dist/tokens/semantic/modes/support-color/alert.json +0 -70
  462. package/dist/tokens/semantic/modes/support-color/article.json +0 -70
  463. package/dist/tokens/semantic/style.json +0 -378
  464. package/dist/tokens/semantic.css +0 -70
  465. package/dist/tokens/size/global.json +0 -96
  466. package/dist/tokens/size/large.json +0 -96
  467. package/dist/tokens/size/medium.json +0 -96
  468. package/dist/tokens/size/small.json +0 -96
  469. package/dist/tokens/small.json +0 -96
  470. package/dist/tokens/style.json +0 -378
  471. package/dist/tokens/success.css +0 -25
  472. package/dist/tokens/support-color/alert.json +0 -70
  473. package/dist/tokens/support-color/article.json +0 -70
  474. package/dist/tokens/themes/altinn-ds.json +0 -386
  475. package/dist/tokens/typography/primary/altinn-ds.json +0 -22
  476. package/dist/tokens/typography/primary.css +0 -123
  477. package/dist/tokens/typography/secondary/altinn-ds.json +0 -22
  478. package/dist/tokens/typography/secondary.css +0 -122
  479. package/dist/tokens/typography/size/large.json +0 -96
  480. package/dist/tokens/typography/size/medium.json +0 -96
  481. package/dist/tokens/typography/size/small.json +0 -96
  482. package/dist/tokens/warning.css +0 -25
  483. package/dist/types/lib/components/Bookmarks/BookmarksListItem.d.ts +0 -7
  484. package/dist/types/lib/components/Bookmarks/BookmarksListItem.stories.d.ts +0 -23
  485. package/dist/types/lib/components/Bookmarks/BookmarksSection.d.ts +0 -12
  486. package/dist/types/lib/components/Bookmarks/BookmarksSection.stories.d.ts +0 -77
  487. package/dist/types/lib/components/Bookmarks/EditableBookmark.d.ts +0 -32
  488. package/dist/types/lib/components/Bookmarks/index.d.ts +0 -3
  489. package/dist/useMergeRefs-DOnoWyUH.js +0 -29
  490. package/dist/usePagination-cq1YWZkE.js +0 -889
  491. /package/dist/{Alert-BzifOfXl.js → alert-BzifOfXl.js} +0 -0
  492. /package/dist/{padding.css → data-padding.css} +0 -0
  493. /package/dist/{shadow.css → data-shadow.css} +0 -0
  494. /package/dist/{spacing.css → data-spacing.css} +0 -0
  495. /package/dist/{altinn-theme.css → data-theme.css} +0 -0
  496. /package/dist/{Textarea-BBstVlPT.js → textarea-BBstVlPT.js} +0 -0
@@ -1,2951 +0,0 @@
1
- "use client";
2
- import { jsx as Ae } from "react/jsx-runtime";
3
- import { c as En } from "./lite-1fxw3LjI.js";
4
- import * as m from "react";
5
- import { useLayoutEffect as In, useEffect as Cn, useRef as lr, createContext as Wt, useReducer as ar, useContext as $t, forwardRef as Je, useId as ur, useMemo as fr, isValidElement as dr } from "react";
6
- import { B as Sn } from "./Button-B0t0vz2h.js";
7
- import * as Tn from "react-dom";
8
- import { S as mr } from "./index-D8Pn8SCu.js";
9
- import { L as pr } from "./Label-9elsbqMH.js";
10
- import { I as gr } from "./Input-B_w6SBmg.js";
11
- const We = Math.min, ce = Math.max, ft = Math.round, Ve = Math.floor, ge = (e) => ({
12
- x: e,
13
- y: e
14
- }), hr = {
15
- left: "right",
16
- right: "left",
17
- bottom: "top",
18
- top: "bottom"
19
- }, br = {
20
- start: "end",
21
- end: "start"
22
- };
23
- function en(e, t, n) {
24
- return ce(e, We(t, n));
25
- }
26
- function Qe(e, t) {
27
- return typeof e == "function" ? e(t) : e;
28
- }
29
- function Oe(e) {
30
- return e.split("-")[0];
31
- }
32
- function et(e) {
33
- return e.split("-")[1];
34
- }
35
- function An(e) {
36
- return e === "x" ? "y" : "x";
37
- }
38
- function On(e) {
39
- return e === "y" ? "height" : "width";
40
- }
41
- function Se(e) {
42
- return ["top", "bottom"].includes(Oe(e)) ? "y" : "x";
43
- }
44
- function Mn(e) {
45
- return An(Se(e));
46
- }
47
- function vr(e, t, n) {
48
- n === void 0 && (n = !1);
49
- const r = et(e), o = Mn(e), i = On(o);
50
- let s = o === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
51
- return t.reference[i] > t.floating[i] && (s = dt(s)), [s, dt(s)];
52
- }
53
- function xr(e) {
54
- const t = dt(e);
55
- return [Lt(e), t, Lt(t)];
56
- }
57
- function Lt(e) {
58
- return e.replace(/start|end/g, (t) => br[t]);
59
- }
60
- function yr(e, t, n) {
61
- const r = ["left", "right"], o = ["right", "left"], i = ["top", "bottom"], s = ["bottom", "top"];
62
- switch (e) {
63
- case "top":
64
- case "bottom":
65
- return n ? t ? o : r : t ? r : o;
66
- case "left":
67
- case "right":
68
- return t ? i : s;
69
- default:
70
- return [];
71
- }
72
- }
73
- function wr(e, t, n, r) {
74
- const o = et(e);
75
- let i = yr(Oe(e), n === "start", r);
76
- return o && (i = i.map((s) => s + "-" + o), t && (i = i.concat(i.map(Lt)))), i;
77
- }
78
- function dt(e) {
79
- return e.replace(/left|right|bottom|top/g, (t) => hr[t]);
80
- }
81
- function Rr(e) {
82
- return {
83
- top: 0,
84
- right: 0,
85
- bottom: 0,
86
- left: 0,
87
- ...e
88
- };
89
- }
90
- function Er(e) {
91
- return typeof e != "number" ? Rr(e) : {
92
- top: e,
93
- right: e,
94
- bottom: e,
95
- left: e
96
- };
97
- }
98
- function mt(e) {
99
- const {
100
- x: t,
101
- y: n,
102
- width: r,
103
- height: o
104
- } = e;
105
- return {
106
- width: r,
107
- height: o,
108
- top: n,
109
- left: t,
110
- right: t + r,
111
- bottom: n + o,
112
- x: t,
113
- y: n
114
- };
115
- }
116
- function tn(e, t, n) {
117
- let {
118
- reference: r,
119
- floating: o
120
- } = e;
121
- const i = Se(t), s = Mn(t), l = On(s), a = Oe(t), c = i === "y", d = r.x + r.width / 2 - o.width / 2, u = r.y + r.height / 2 - o.height / 2, g = r[l] / 2 - o[l] / 2;
122
- let f;
123
- switch (a) {
124
- case "top":
125
- f = {
126
- x: d,
127
- y: r.y - o.height
128
- };
129
- break;
130
- case "bottom":
131
- f = {
132
- x: d,
133
- y: r.y + r.height
134
- };
135
- break;
136
- case "right":
137
- f = {
138
- x: r.x + r.width,
139
- y: u
140
- };
141
- break;
142
- case "left":
143
- f = {
144
- x: r.x - o.width,
145
- y: u
146
- };
147
- break;
148
- default:
149
- f = {
150
- x: r.x,
151
- y: r.y
152
- };
153
- }
154
- switch (et(t)) {
155
- case "start":
156
- f[s] -= g * (n && c ? -1 : 1);
157
- break;
158
- case "end":
159
- f[s] += g * (n && c ? -1 : 1);
160
- break;
161
- }
162
- return f;
163
- }
164
- const Ir = async (e, t, n) => {
165
- const {
166
- placement: r = "bottom",
167
- strategy: o = "absolute",
168
- middleware: i = [],
169
- platform: s
170
- } = n, l = i.filter(Boolean), a = await (s.isRTL == null ? void 0 : s.isRTL(t));
171
- let c = await s.getElementRects({
172
- reference: e,
173
- floating: t,
174
- strategy: o
175
- }), {
176
- x: d,
177
- y: u
178
- } = tn(c, r, a), g = r, f = {}, p = 0;
179
- for (let h = 0; h < l.length; h++) {
180
- const {
181
- name: y,
182
- fn: x
183
- } = l[h], {
184
- x: E,
185
- y: b,
186
- data: w,
187
- reset: D
188
- } = await x({
189
- x: d,
190
- y: u,
191
- initialPlacement: r,
192
- placement: g,
193
- strategy: o,
194
- middlewareData: f,
195
- rects: c,
196
- platform: s,
197
- elements: {
198
- reference: e,
199
- floating: t
200
- }
201
- });
202
- d = E ?? d, u = b ?? u, f = {
203
- ...f,
204
- [y]: {
205
- ...f[y],
206
- ...w
207
- }
208
- }, D && p <= 50 && (p++, typeof D == "object" && (D.placement && (g = D.placement), D.rects && (c = D.rects === !0 ? await s.getElementRects({
209
- reference: e,
210
- floating: t,
211
- strategy: o
212
- }) : D.rects), {
213
- x: d,
214
- y: u
215
- } = tn(c, g, a)), h = -1);
216
- }
217
- return {
218
- x: d,
219
- y: u,
220
- placement: g,
221
- strategy: o,
222
- middlewareData: f
223
- };
224
- };
225
- async function Kt(e, t) {
226
- var n;
227
- t === void 0 && (t = {});
228
- const {
229
- x: r,
230
- y: o,
231
- platform: i,
232
- rects: s,
233
- elements: l,
234
- strategy: a
235
- } = e, {
236
- boundary: c = "clippingAncestors",
237
- rootBoundary: d = "viewport",
238
- elementContext: u = "floating",
239
- altBoundary: g = !1,
240
- padding: f = 0
241
- } = Qe(t, e), p = Er(f), y = l[g ? u === "floating" ? "reference" : "floating" : u], x = mt(await i.getClippingRect({
242
- element: (n = await (i.isElement == null ? void 0 : i.isElement(y))) == null || n ? y : y.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(l.floating)),
243
- boundary: c,
244
- rootBoundary: d,
245
- strategy: a
246
- })), E = u === "floating" ? {
247
- x: r,
248
- y: o,
249
- width: s.floating.width,
250
- height: s.floating.height
251
- } : s.reference, b = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(l.floating)), w = await (i.isElement == null ? void 0 : i.isElement(b)) ? await (i.getScale == null ? void 0 : i.getScale(b)) || {
252
- x: 1,
253
- y: 1
254
- } : {
255
- x: 1,
256
- y: 1
257
- }, D = mt(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
258
- elements: l,
259
- rect: E,
260
- offsetParent: b,
261
- strategy: a
262
- }) : E);
263
- return {
264
- top: (x.top - D.top + p.top) / w.y,
265
- bottom: (D.bottom - x.bottom + p.bottom) / w.y,
266
- left: (x.left - D.left + p.left) / w.x,
267
- right: (D.right - x.right + p.right) / w.x
268
- };
269
- }
270
- const Cr = function(e) {
271
- return e === void 0 && (e = {}), {
272
- name: "flip",
273
- options: e,
274
- async fn(t) {
275
- var n, r;
276
- const {
277
- placement: o,
278
- middlewareData: i,
279
- rects: s,
280
- initialPlacement: l,
281
- platform: a,
282
- elements: c
283
- } = t, {
284
- mainAxis: d = !0,
285
- crossAxis: u = !0,
286
- fallbackPlacements: g,
287
- fallbackStrategy: f = "bestFit",
288
- fallbackAxisSideDirection: p = "none",
289
- flipAlignment: h = !0,
290
- ...y
291
- } = Qe(e, t);
292
- if ((n = i.arrow) != null && n.alignmentOffset)
293
- return {};
294
- const x = Oe(o), E = Se(l), b = Oe(l) === l, w = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), D = g || (b || !h ? [dt(l)] : xr(l)), F = p !== "none";
295
- !g && F && D.push(...wr(l, h, p, w));
296
- const W = [l, ...D], _ = await Kt(t, y), Z = [];
297
- let K = ((r = i.flip) == null ? void 0 : r.overflows) || [];
298
- if (d && Z.push(_[x]), u) {
299
- const v = vr(o, s, w);
300
- Z.push(_[v[0]], _[v[1]]);
301
- }
302
- if (K = [...K, {
303
- placement: o,
304
- overflows: Z
305
- }], !Z.every((v) => v <= 0)) {
306
- var $, C;
307
- const v = ((($ = i.flip) == null ? void 0 : $.index) || 0) + 1, M = W[v];
308
- if (M) {
309
- var L;
310
- const I = u === "alignment" ? E !== Se(M) : !1, R = ((L = K[0]) == null ? void 0 : L.overflows[0]) > 0;
311
- if (!I || R)
312
- return {
313
- data: {
314
- index: v,
315
- overflows: K
316
- },
317
- reset: {
318
- placement: M
319
- }
320
- };
321
- }
322
- let N = (C = K.filter((I) => I.overflows[0] <= 0).sort((I, R) => I.overflows[1] - R.overflows[1])[0]) == null ? void 0 : C.placement;
323
- if (!N)
324
- switch (f) {
325
- case "bestFit": {
326
- var A;
327
- const I = (A = K.filter((R) => {
328
- if (F) {
329
- const B = Se(R.placement);
330
- return B === E || // Create a bias to the `y` side axis due to horizontal
331
- // reading directions favoring greater width.
332
- B === "y";
333
- }
334
- return !0;
335
- }).map((R) => [R.placement, R.overflows.filter((B) => B > 0).reduce((B, J) => B + J, 0)]).sort((R, B) => R[1] - B[1])[0]) == null ? void 0 : A[0];
336
- I && (N = I);
337
- break;
338
- }
339
- case "initialPlacement":
340
- N = l;
341
- break;
342
- }
343
- if (o !== N)
344
- return {
345
- reset: {
346
- placement: N
347
- }
348
- };
349
- }
350
- return {};
351
- }
352
- };
353
- };
354
- async function Sr(e, t) {
355
- const {
356
- placement: n,
357
- platform: r,
358
- elements: o
359
- } = e, i = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), s = Oe(n), l = et(n), a = Se(n) === "y", c = ["left", "top"].includes(s) ? -1 : 1, d = i && a ? -1 : 1, u = Qe(t, e);
360
- let {
361
- mainAxis: g,
362
- crossAxis: f,
363
- alignmentAxis: p
364
- } = typeof u == "number" ? {
365
- mainAxis: u,
366
- crossAxis: 0,
367
- alignmentAxis: null
368
- } : {
369
- mainAxis: u.mainAxis || 0,
370
- crossAxis: u.crossAxis || 0,
371
- alignmentAxis: u.alignmentAxis
372
- };
373
- return l && typeof p == "number" && (f = l === "end" ? p * -1 : p), a ? {
374
- x: f * d,
375
- y: g * c
376
- } : {
377
- x: g * c,
378
- y: f * d
379
- };
380
- }
381
- const Tr = function(e) {
382
- return e === void 0 && (e = 0), {
383
- name: "offset",
384
- options: e,
385
- async fn(t) {
386
- var n, r;
387
- const {
388
- x: o,
389
- y: i,
390
- placement: s,
391
- middlewareData: l
392
- } = t, a = await Sr(t, e);
393
- return s === ((n = l.offset) == null ? void 0 : n.placement) && (r = l.arrow) != null && r.alignmentOffset ? {} : {
394
- x: o + a.x,
395
- y: i + a.y,
396
- data: {
397
- ...a,
398
- placement: s
399
- }
400
- };
401
- }
402
- };
403
- }, Ar = function(e) {
404
- return e === void 0 && (e = {}), {
405
- name: "shift",
406
- options: e,
407
- async fn(t) {
408
- const {
409
- x: n,
410
- y: r,
411
- placement: o
412
- } = t, {
413
- mainAxis: i = !0,
414
- crossAxis: s = !1,
415
- limiter: l = {
416
- fn: (y) => {
417
- let {
418
- x,
419
- y: E
420
- } = y;
421
- return {
422
- x,
423
- y: E
424
- };
425
- }
426
- },
427
- ...a
428
- } = Qe(e, t), c = {
429
- x: n,
430
- y: r
431
- }, d = await Kt(t, a), u = Se(Oe(o)), g = An(u);
432
- let f = c[g], p = c[u];
433
- if (i) {
434
- const y = g === "y" ? "top" : "left", x = g === "y" ? "bottom" : "right", E = f + d[y], b = f - d[x];
435
- f = en(E, f, b);
436
- }
437
- if (s) {
438
- const y = u === "y" ? "top" : "left", x = u === "y" ? "bottom" : "right", E = p + d[y], b = p - d[x];
439
- p = en(E, p, b);
440
- }
441
- const h = l.fn({
442
- ...t,
443
- [g]: f,
444
- [u]: p
445
- });
446
- return {
447
- ...h,
448
- data: {
449
- x: h.x - n,
450
- y: h.y - r,
451
- enabled: {
452
- [g]: i,
453
- [u]: s
454
- }
455
- }
456
- };
457
- }
458
- };
459
- }, Or = function(e) {
460
- return e === void 0 && (e = {}), {
461
- name: "size",
462
- options: e,
463
- async fn(t) {
464
- var n, r;
465
- const {
466
- placement: o,
467
- rects: i,
468
- platform: s,
469
- elements: l
470
- } = t, {
471
- apply: a = () => {
472
- },
473
- ...c
474
- } = Qe(e, t), d = await Kt(t, c), u = Oe(o), g = et(o), f = Se(o) === "y", {
475
- width: p,
476
- height: h
477
- } = i.floating;
478
- let y, x;
479
- u === "top" || u === "bottom" ? (y = u, x = g === (await (s.isRTL == null ? void 0 : s.isRTL(l.floating)) ? "start" : "end") ? "left" : "right") : (x = u, y = g === "end" ? "top" : "bottom");
480
- const E = h - d.top - d.bottom, b = p - d.left - d.right, w = We(h - d[y], E), D = We(p - d[x], b), F = !t.middlewareData.shift;
481
- let W = w, _ = D;
482
- if ((n = t.middlewareData.shift) != null && n.enabled.x && (_ = b), (r = t.middlewareData.shift) != null && r.enabled.y && (W = E), F && !g) {
483
- const K = ce(d.left, 0), $ = ce(d.right, 0), C = ce(d.top, 0), L = ce(d.bottom, 0);
484
- f ? _ = p - 2 * (K !== 0 || $ !== 0 ? K + $ : ce(d.left, d.right)) : W = h - 2 * (C !== 0 || L !== 0 ? C + L : ce(d.top, d.bottom));
485
- }
486
- await a({
487
- ...t,
488
- availableWidth: _,
489
- availableHeight: W
490
- });
491
- const Z = await s.getDimensions(l.floating);
492
- return p !== Z.width || h !== Z.height ? {
493
- reset: {
494
- rects: !0
495
- }
496
- } : {};
497
- }
498
- };
499
- };
500
- function yt() {
501
- return typeof window < "u";
502
- }
503
- function De(e) {
504
- return Dn(e) ? (e.nodeName || "").toLowerCase() : "#document";
505
- }
506
- function le(e) {
507
- var t;
508
- return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
509
- }
510
- function he(e) {
511
- var t;
512
- return (t = (Dn(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
513
- }
514
- function Dn(e) {
515
- return yt() ? e instanceof Node || e instanceof le(e).Node : !1;
516
- }
517
- function U(e) {
518
- return yt() ? e instanceof Element || e instanceof le(e).Element : !1;
519
- }
520
- function X(e) {
521
- return yt() ? e instanceof HTMLElement || e instanceof le(e).HTMLElement : !1;
522
- }
523
- function Nt(e) {
524
- return !yt() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof le(e).ShadowRoot;
525
- }
526
- function tt(e) {
527
- const {
528
- overflow: t,
529
- overflowX: n,
530
- overflowY: r,
531
- display: o
532
- } = ae(e);
533
- return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && !["inline", "contents"].includes(o);
534
- }
535
- function Mr(e) {
536
- return ["table", "td", "th"].includes(De(e));
537
- }
538
- function wt(e) {
539
- return [":popover-open", ":modal"].some((t) => {
540
- try {
541
- return e.matches(t);
542
- } catch {
543
- return !1;
544
- }
545
- });
546
- }
547
- function Ht(e) {
548
- const t = zt(), n = U(e) ? ae(e) : e;
549
- return ["transform", "translate", "scale", "rotate", "perspective"].some((r) => n[r] ? n[r] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((r) => (n.willChange || "").includes(r)) || ["paint", "layout", "strict", "content"].some((r) => (n.contain || "").includes(r));
550
- }
551
- function Dr(e) {
552
- let t = xe(e);
553
- for (; X(t) && !Me(t); ) {
554
- if (Ht(t))
555
- return t;
556
- if (wt(t))
557
- return null;
558
- t = xe(t);
559
- }
560
- return null;
561
- }
562
- function zt() {
563
- return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
564
- }
565
- function Me(e) {
566
- return ["html", "body", "#document"].includes(De(e));
567
- }
568
- function ae(e) {
569
- return le(e).getComputedStyle(e);
570
- }
571
- function Rt(e) {
572
- return U(e) ? {
573
- scrollLeft: e.scrollLeft,
574
- scrollTop: e.scrollTop
575
- } : {
576
- scrollLeft: e.scrollX,
577
- scrollTop: e.scrollY
578
- };
579
- }
580
- function xe(e) {
581
- if (De(e) === "html")
582
- return e;
583
- const t = (
584
- // Step into the shadow DOM of the parent of a slotted node.
585
- e.assignedSlot || // DOM Element detected.
586
- e.parentNode || // ShadowRoot detected.
587
- Nt(e) && e.host || // Fallback.
588
- he(e)
589
- );
590
- return Nt(t) ? t.host : t;
591
- }
592
- function Pn(e) {
593
- const t = xe(e);
594
- return Me(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : X(t) && tt(t) ? t : Pn(t);
595
- }
596
- function Te(e, t, n) {
597
- var r;
598
- t === void 0 && (t = []), n === void 0 && (n = !0);
599
- const o = Pn(e), i = o === ((r = e.ownerDocument) == null ? void 0 : r.body), s = le(o);
600
- if (i) {
601
- const l = kt(s);
602
- return t.concat(s, s.visualViewport || [], tt(o) ? o : [], l && n ? Te(l) : []);
603
- }
604
- return t.concat(o, Te(o, [], n));
605
- }
606
- function kt(e) {
607
- return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
608
- }
609
- function Fn(e) {
610
- const t = ae(e);
611
- let n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0;
612
- const o = X(e), i = o ? e.offsetWidth : n, s = o ? e.offsetHeight : r, l = ft(n) !== i || ft(r) !== s;
613
- return l && (n = i, r = s), {
614
- width: n,
615
- height: r,
616
- $: l
617
- };
618
- }
619
- function qt(e) {
620
- return U(e) ? e : e.contextElement;
621
- }
622
- function Be(e) {
623
- const t = qt(e);
624
- if (!X(t))
625
- return ge(1);
626
- const n = t.getBoundingClientRect(), {
627
- width: r,
628
- height: o,
629
- $: i
630
- } = Fn(t);
631
- let s = (i ? ft(n.width) : n.width) / r, l = (i ? ft(n.height) : n.height) / o;
632
- return (!s || !Number.isFinite(s)) && (s = 1), (!l || !Number.isFinite(l)) && (l = 1), {
633
- x: s,
634
- y: l
635
- };
636
- }
637
- const Pr = /* @__PURE__ */ ge(0);
638
- function Ln(e) {
639
- const t = le(e);
640
- return !zt() || !t.visualViewport ? Pr : {
641
- x: t.visualViewport.offsetLeft,
642
- y: t.visualViewport.offsetTop
643
- };
644
- }
645
- function Fr(e, t, n) {
646
- return t === void 0 && (t = !1), !n || t && n !== le(e) ? !1 : t;
647
- }
648
- function Ne(e, t, n, r) {
649
- t === void 0 && (t = !1), n === void 0 && (n = !1);
650
- const o = e.getBoundingClientRect(), i = qt(e);
651
- let s = ge(1);
652
- t && (r ? U(r) && (s = Be(r)) : s = Be(e));
653
- const l = Fr(i, n, r) ? Ln(i) : ge(0);
654
- let a = (o.left + l.x) / s.x, c = (o.top + l.y) / s.y, d = o.width / s.x, u = o.height / s.y;
655
- if (i) {
656
- const g = le(i), f = r && U(r) ? le(r) : r;
657
- let p = g, h = kt(p);
658
- for (; h && r && f !== p; ) {
659
- const y = Be(h), x = h.getBoundingClientRect(), E = ae(h), b = x.left + (h.clientLeft + parseFloat(E.paddingLeft)) * y.x, w = x.top + (h.clientTop + parseFloat(E.paddingTop)) * y.y;
660
- a *= y.x, c *= y.y, d *= y.x, u *= y.y, a += b, c += w, p = le(h), h = kt(p);
661
- }
662
- }
663
- return mt({
664
- width: d,
665
- height: u,
666
- x: a,
667
- y: c
668
- });
669
- }
670
- function jt(e, t) {
671
- const n = Rt(e).scrollLeft;
672
- return t ? t.left + n : Ne(he(e)).left + n;
673
- }
674
- function Nn(e, t, n) {
675
- n === void 0 && (n = !1);
676
- const r = e.getBoundingClientRect(), o = r.left + t.scrollLeft - (n ? 0 : (
677
- // RTL <body> scrollbar.
678
- jt(e, r)
679
- )), i = r.top + t.scrollTop;
680
- return {
681
- x: o,
682
- y: i
683
- };
684
- }
685
- function Lr(e) {
686
- let {
687
- elements: t,
688
- rect: n,
689
- offsetParent: r,
690
- strategy: o
691
- } = e;
692
- const i = o === "fixed", s = he(r), l = t ? wt(t.floating) : !1;
693
- if (r === s || l && i)
694
- return n;
695
- let a = {
696
- scrollLeft: 0,
697
- scrollTop: 0
698
- }, c = ge(1);
699
- const d = ge(0), u = X(r);
700
- if ((u || !u && !i) && ((De(r) !== "body" || tt(s)) && (a = Rt(r)), X(r))) {
701
- const f = Ne(r);
702
- c = Be(r), d.x = f.x + r.clientLeft, d.y = f.y + r.clientTop;
703
- }
704
- const g = s && !u && !i ? Nn(s, a, !0) : ge(0);
705
- return {
706
- width: n.width * c.x,
707
- height: n.height * c.y,
708
- x: n.x * c.x - a.scrollLeft * c.x + d.x + g.x,
709
- y: n.y * c.y - a.scrollTop * c.y + d.y + g.y
710
- };
711
- }
712
- function Nr(e) {
713
- return Array.from(e.getClientRects());
714
- }
715
- function kr(e) {
716
- const t = he(e), n = Rt(e), r = e.ownerDocument.body, o = ce(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), i = ce(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
717
- let s = -n.scrollLeft + jt(e);
718
- const l = -n.scrollTop;
719
- return ae(r).direction === "rtl" && (s += ce(t.clientWidth, r.clientWidth) - o), {
720
- width: o,
721
- height: i,
722
- x: s,
723
- y: l
724
- };
725
- }
726
- function Vr(e, t) {
727
- const n = le(e), r = he(e), o = n.visualViewport;
728
- let i = r.clientWidth, s = r.clientHeight, l = 0, a = 0;
729
- if (o) {
730
- i = o.width, s = o.height;
731
- const c = zt();
732
- (!c || c && t === "fixed") && (l = o.offsetLeft, a = o.offsetTop);
733
- }
734
- return {
735
- width: i,
736
- height: s,
737
- x: l,
738
- y: a
739
- };
740
- }
741
- function Br(e, t) {
742
- const n = Ne(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, i = X(e) ? Be(e) : ge(1), s = e.clientWidth * i.x, l = e.clientHeight * i.y, a = o * i.x, c = r * i.y;
743
- return {
744
- width: s,
745
- height: l,
746
- x: a,
747
- y: c
748
- };
749
- }
750
- function nn(e, t, n) {
751
- let r;
752
- if (t === "viewport")
753
- r = Vr(e, n);
754
- else if (t === "document")
755
- r = kr(he(e));
756
- else if (U(t))
757
- r = Br(t, n);
758
- else {
759
- const o = Ln(e);
760
- r = {
761
- x: t.x - o.x,
762
- y: t.y - o.y,
763
- width: t.width,
764
- height: t.height
765
- };
766
- }
767
- return mt(r);
768
- }
769
- function kn(e, t) {
770
- const n = xe(e);
771
- return n === t || !U(n) || Me(n) ? !1 : ae(n).position === "fixed" || kn(n, t);
772
- }
773
- function _r(e, t) {
774
- const n = t.get(e);
775
- if (n)
776
- return n;
777
- let r = Te(e, [], !1).filter((l) => U(l) && De(l) !== "body"), o = null;
778
- const i = ae(e).position === "fixed";
779
- let s = i ? xe(e) : e;
780
- for (; U(s) && !Me(s); ) {
781
- const l = ae(s), a = Ht(s);
782
- !a && l.position === "fixed" && (o = null), (i ? !a && !o : !a && l.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || tt(s) && !a && kn(e, s)) ? r = r.filter((d) => d !== s) : o = l, s = xe(s);
783
- }
784
- return t.set(e, r), r;
785
- }
786
- function Wr(e) {
787
- let {
788
- element: t,
789
- boundary: n,
790
- rootBoundary: r,
791
- strategy: o
792
- } = e;
793
- const s = [...n === "clippingAncestors" ? wt(t) ? [] : _r(t, this._c) : [].concat(n), r], l = s[0], a = s.reduce((c, d) => {
794
- const u = nn(t, d, o);
795
- return c.top = ce(u.top, c.top), c.right = We(u.right, c.right), c.bottom = We(u.bottom, c.bottom), c.left = ce(u.left, c.left), c;
796
- }, nn(t, l, o));
797
- return {
798
- width: a.right - a.left,
799
- height: a.bottom - a.top,
800
- x: a.left,
801
- y: a.top
802
- };
803
- }
804
- function $r(e) {
805
- const {
806
- width: t,
807
- height: n
808
- } = Fn(e);
809
- return {
810
- width: t,
811
- height: n
812
- };
813
- }
814
- function Kr(e, t, n) {
815
- const r = X(t), o = he(t), i = n === "fixed", s = Ne(e, !0, i, t);
816
- let l = {
817
- scrollLeft: 0,
818
- scrollTop: 0
819
- };
820
- const a = ge(0);
821
- function c() {
822
- a.x = jt(o);
823
- }
824
- if (r || !r && !i)
825
- if ((De(t) !== "body" || tt(o)) && (l = Rt(t)), r) {
826
- const f = Ne(t, !0, i, t);
827
- a.x = f.x + t.clientLeft, a.y = f.y + t.clientTop;
828
- } else o && c();
829
- i && !r && o && c();
830
- const d = o && !r && !i ? Nn(o, l) : ge(0), u = s.left + l.scrollLeft - a.x - d.x, g = s.top + l.scrollTop - a.y - d.y;
831
- return {
832
- x: u,
833
- y: g,
834
- width: s.width,
835
- height: s.height
836
- };
837
- }
838
- function Ct(e) {
839
- return ae(e).position === "static";
840
- }
841
- function rn(e, t) {
842
- if (!X(e) || ae(e).position === "fixed")
843
- return null;
844
- if (t)
845
- return t(e);
846
- let n = e.offsetParent;
847
- return he(e) === n && (n = n.ownerDocument.body), n;
848
- }
849
- function Vn(e, t) {
850
- const n = le(e);
851
- if (wt(e))
852
- return n;
853
- if (!X(e)) {
854
- let o = xe(e);
855
- for (; o && !Me(o); ) {
856
- if (U(o) && !Ct(o))
857
- return o;
858
- o = xe(o);
859
- }
860
- return n;
861
- }
862
- let r = rn(e, t);
863
- for (; r && Mr(r) && Ct(r); )
864
- r = rn(r, t);
865
- return r && Me(r) && Ct(r) && !Ht(r) ? n : r || Dr(e) || n;
866
- }
867
- const Hr = async function(e) {
868
- const t = this.getOffsetParent || Vn, n = this.getDimensions, r = await n(e.floating);
869
- return {
870
- reference: Kr(e.reference, await t(e.floating), e.strategy),
871
- floating: {
872
- x: 0,
873
- y: 0,
874
- width: r.width,
875
- height: r.height
876
- }
877
- };
878
- };
879
- function zr(e) {
880
- return ae(e).direction === "rtl";
881
- }
882
- const qr = {
883
- convertOffsetParentRelativeRectToViewportRelativeRect: Lr,
884
- getDocumentElement: he,
885
- getClippingRect: Wr,
886
- getOffsetParent: Vn,
887
- getElementRects: Hr,
888
- getClientRects: Nr,
889
- getDimensions: $r,
890
- getScale: Be,
891
- isElement: U,
892
- isRTL: zr
893
- };
894
- function Bn(e, t) {
895
- return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
896
- }
897
- function jr(e, t) {
898
- let n = null, r;
899
- const o = he(e);
900
- function i() {
901
- var l;
902
- clearTimeout(r), (l = n) == null || l.disconnect(), n = null;
903
- }
904
- function s(l, a) {
905
- l === void 0 && (l = !1), a === void 0 && (a = 1), i();
906
- const c = e.getBoundingClientRect(), {
907
- left: d,
908
- top: u,
909
- width: g,
910
- height: f
911
- } = c;
912
- if (l || t(), !g || !f)
913
- return;
914
- const p = Ve(u), h = Ve(o.clientWidth - (d + g)), y = Ve(o.clientHeight - (u + f)), x = Ve(d), b = {
915
- rootMargin: -p + "px " + -h + "px " + -y + "px " + -x + "px",
916
- threshold: ce(0, We(1, a)) || 1
917
- };
918
- let w = !0;
919
- function D(F) {
920
- const W = F[0].intersectionRatio;
921
- if (W !== a) {
922
- if (!w)
923
- return s();
924
- W ? s(!1, W) : r = setTimeout(() => {
925
- s(!1, 1e-7);
926
- }, 1e3);
927
- }
928
- W === 1 && !Bn(c, e.getBoundingClientRect()) && s(), w = !1;
929
- }
930
- try {
931
- n = new IntersectionObserver(D, {
932
- ...b,
933
- // Handle <iframe>s
934
- root: o.ownerDocument
935
- });
936
- } catch {
937
- n = new IntersectionObserver(D, b);
938
- }
939
- n.observe(e);
940
- }
941
- return s(!0), i;
942
- }
943
- function bi(e, t, n, r) {
944
- r === void 0 && (r = {});
945
- const {
946
- ancestorScroll: o = !0,
947
- ancestorResize: i = !0,
948
- elementResize: s = typeof ResizeObserver == "function",
949
- layoutShift: l = typeof IntersectionObserver == "function",
950
- animationFrame: a = !1
951
- } = r, c = qt(e), d = o || i ? [...c ? Te(c) : [], ...Te(t)] : [];
952
- d.forEach((x) => {
953
- o && x.addEventListener("scroll", n, {
954
- passive: !0
955
- }), i && x.addEventListener("resize", n);
956
- });
957
- const u = c && l ? jr(c, n) : null;
958
- let g = -1, f = null;
959
- s && (f = new ResizeObserver((x) => {
960
- let [E] = x;
961
- E && E.target === c && f && (f.unobserve(t), cancelAnimationFrame(g), g = requestAnimationFrame(() => {
962
- var b;
963
- (b = f) == null || b.observe(t);
964
- })), n();
965
- }), c && !a && f.observe(c), f.observe(t));
966
- let p, h = a ? Ne(e) : null;
967
- a && y();
968
- function y() {
969
- const x = Ne(e);
970
- h && !Bn(h, x) && n(), h = x, p = requestAnimationFrame(y);
971
- }
972
- return n(), () => {
973
- var x;
974
- d.forEach((E) => {
975
- o && E.removeEventListener("scroll", n), i && E.removeEventListener("resize", n);
976
- }), u == null || u(), (x = f) == null || x.disconnect(), f = null, a && cancelAnimationFrame(p);
977
- };
978
- }
979
- const Ur = Tr, vi = Ar, Yr = Cr, Gr = Or, Xr = (e, t, n) => {
980
- const r = /* @__PURE__ */ new Map(), o = {
981
- platform: qr,
982
- ...n
983
- }, i = {
984
- ...o.platform,
985
- _c: r
986
- };
987
- return Ir(e, t, {
988
- ...o,
989
- platform: i
990
- });
991
- };
992
- function ve(e) {
993
- let t = e.activeElement;
994
- for (; ((n = t) == null || (n = n.shadowRoot) == null ? void 0 : n.activeElement) != null; ) {
995
- var n;
996
- t = t.shadowRoot.activeElement;
997
- }
998
- return t;
999
- }
1000
- function ne(e, t) {
1001
- if (!e || !t)
1002
- return !1;
1003
- const n = t.getRootNode == null ? void 0 : t.getRootNode();
1004
- if (e.contains(t))
1005
- return !0;
1006
- if (n && Nt(n)) {
1007
- let r = t;
1008
- for (; r; ) {
1009
- if (e === r)
1010
- return !0;
1011
- r = r.parentNode || r.host;
1012
- }
1013
- }
1014
- return !1;
1015
- }
1016
- function _n() {
1017
- const e = navigator.userAgentData;
1018
- return e != null && e.platform ? e.platform : navigator.platform;
1019
- }
1020
- function Wn() {
1021
- const e = navigator.userAgentData;
1022
- return e && Array.isArray(e.brands) ? e.brands.map((t) => {
1023
- let {
1024
- brand: n,
1025
- version: r
1026
- } = t;
1027
- return n + "/" + r;
1028
- }).join(" ") : navigator.userAgent;
1029
- }
1030
- function $n(e) {
1031
- return e.mozInputSource === 0 && e.isTrusted ? !0 : Vt() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
1032
- }
1033
- function Kn(e) {
1034
- return Jr() ? !1 : !Vt() && e.width === 0 && e.height === 0 || Vt() && e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse" || // iOS VoiceOver returns 0.333• for width/height.
1035
- e.width < 1 && e.height < 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "touch";
1036
- }
1037
- function Hn() {
1038
- return /apple/i.test(navigator.vendor);
1039
- }
1040
- function Vt() {
1041
- const e = /android/i;
1042
- return e.test(_n()) || e.test(Wn());
1043
- }
1044
- function Zr() {
1045
- return _n().toLowerCase().startsWith("mac") && !navigator.maxTouchPoints;
1046
- }
1047
- function Jr() {
1048
- return Wn().includes("jsdom/");
1049
- }
1050
- function Qr(e) {
1051
- return "nativeEvent" in e;
1052
- }
1053
- function eo(e) {
1054
- return e.matches("html,body");
1055
- }
1056
- function se(e) {
1057
- return (e == null ? void 0 : e.ownerDocument) || document;
1058
- }
1059
- function St(e, t) {
1060
- if (t == null)
1061
- return !1;
1062
- if ("composedPath" in e)
1063
- return e.composedPath().includes(t);
1064
- const n = e;
1065
- return n.target != null && t.contains(n.target);
1066
- }
1067
- function Le(e) {
1068
- return "composedPath" in e ? e.composedPath()[0] : e.target;
1069
- }
1070
- const to = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";
1071
- function no(e) {
1072
- return X(e) && e.matches(to);
1073
- }
1074
- function re(e) {
1075
- e.preventDefault(), e.stopPropagation();
1076
- }
1077
- function zn(e) {
1078
- return e ? e.getAttribute("role") === "combobox" && no(e) : !1;
1079
- }
1080
- /*!
1081
- * tabbable 6.2.0
1082
- * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
1083
- */
1084
- var ro = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])", "a[href]:not([inert])", "button:not([inert])", "[tabindex]:not(slot):not([inert])", "audio[controls]:not([inert])", "video[controls]:not([inert])", '[contenteditable]:not([contenteditable="false"]):not([inert])', "details>summary:first-of-type:not([inert])", "details:not([inert])"], pt = /* @__PURE__ */ ro.join(","), qn = typeof Element > "u", $e = qn ? function() {
1085
- } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, gt = !qn && Element.prototype.getRootNode ? function(e) {
1086
- var t;
1087
- return e == null || (t = e.getRootNode) === null || t === void 0 ? void 0 : t.call(e);
1088
- } : function(e) {
1089
- return e == null ? void 0 : e.ownerDocument;
1090
- }, ht = function e(t, n) {
1091
- var r;
1092
- n === void 0 && (n = !0);
1093
- var o = t == null || (r = t.getAttribute) === null || r === void 0 ? void 0 : r.call(t, "inert"), i = o === "" || o === "true", s = i || n && t && e(t.parentNode);
1094
- return s;
1095
- }, oo = function(t) {
1096
- var n, r = t == null || (n = t.getAttribute) === null || n === void 0 ? void 0 : n.call(t, "contenteditable");
1097
- return r === "" || r === "true";
1098
- }, io = function(t, n, r) {
1099
- if (ht(t))
1100
- return [];
1101
- var o = Array.prototype.slice.apply(t.querySelectorAll(pt));
1102
- return n && $e.call(t, pt) && o.unshift(t), o = o.filter(r), o;
1103
- }, so = function e(t, n, r) {
1104
- for (var o = [], i = Array.from(t); i.length; ) {
1105
- var s = i.shift();
1106
- if (!ht(s, !1))
1107
- if (s.tagName === "SLOT") {
1108
- var l = s.assignedElements(), a = l.length ? l : s.children, c = e(a, !0, r);
1109
- r.flatten ? o.push.apply(o, c) : o.push({
1110
- scopeParent: s,
1111
- candidates: c
1112
- });
1113
- } else {
1114
- var d = $e.call(s, pt);
1115
- d && r.filter(s) && (n || !t.includes(s)) && o.push(s);
1116
- var u = s.shadowRoot || // check for an undisclosed shadow
1117
- typeof r.getShadowRoot == "function" && r.getShadowRoot(s), g = !ht(u, !1) && (!r.shadowRootFilter || r.shadowRootFilter(s));
1118
- if (u && g) {
1119
- var f = e(u === !0 ? s.children : u.children, !0, r);
1120
- r.flatten ? o.push.apply(o, f) : o.push({
1121
- scopeParent: s,
1122
- candidates: f
1123
- });
1124
- } else
1125
- i.unshift.apply(i, s.children);
1126
- }
1127
- }
1128
- return o;
1129
- }, jn = function(t) {
1130
- return !isNaN(parseInt(t.getAttribute("tabindex"), 10));
1131
- }, Un = function(t) {
1132
- if (!t)
1133
- throw new Error("No node provided");
1134
- return t.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName) || oo(t)) && !jn(t) ? 0 : t.tabIndex;
1135
- }, co = function(t, n) {
1136
- var r = Un(t);
1137
- return r < 0 && n && !jn(t) ? 0 : r;
1138
- }, lo = function(t, n) {
1139
- return t.tabIndex === n.tabIndex ? t.documentOrder - n.documentOrder : t.tabIndex - n.tabIndex;
1140
- }, Yn = function(t) {
1141
- return t.tagName === "INPUT";
1142
- }, ao = function(t) {
1143
- return Yn(t) && t.type === "hidden";
1144
- }, uo = function(t) {
1145
- var n = t.tagName === "DETAILS" && Array.prototype.slice.apply(t.children).some(function(r) {
1146
- return r.tagName === "SUMMARY";
1147
- });
1148
- return n;
1149
- }, fo = function(t, n) {
1150
- for (var r = 0; r < t.length; r++)
1151
- if (t[r].checked && t[r].form === n)
1152
- return t[r];
1153
- }, mo = function(t) {
1154
- if (!t.name)
1155
- return !0;
1156
- var n = t.form || gt(t), r = function(l) {
1157
- return n.querySelectorAll('input[type="radio"][name="' + l + '"]');
1158
- }, o;
1159
- if (typeof window < "u" && typeof window.CSS < "u" && typeof window.CSS.escape == "function")
1160
- o = r(window.CSS.escape(t.name));
1161
- else
1162
- try {
1163
- o = r(t.name);
1164
- } catch (s) {
1165
- return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", s.message), !1;
1166
- }
1167
- var i = fo(o, t.form);
1168
- return !i || i === t;
1169
- }, po = function(t) {
1170
- return Yn(t) && t.type === "radio";
1171
- }, go = function(t) {
1172
- return po(t) && !mo(t);
1173
- }, ho = function(t) {
1174
- var n, r = t && gt(t), o = (n = r) === null || n === void 0 ? void 0 : n.host, i = !1;
1175
- if (r && r !== t) {
1176
- var s, l, a;
1177
- for (i = !!((s = o) !== null && s !== void 0 && (l = s.ownerDocument) !== null && l !== void 0 && l.contains(o) || t != null && (a = t.ownerDocument) !== null && a !== void 0 && a.contains(t)); !i && o; ) {
1178
- var c, d, u;
1179
- r = gt(o), o = (c = r) === null || c === void 0 ? void 0 : c.host, i = !!((d = o) !== null && d !== void 0 && (u = d.ownerDocument) !== null && u !== void 0 && u.contains(o));
1180
- }
1181
- }
1182
- return i;
1183
- }, on = function(t) {
1184
- var n = t.getBoundingClientRect(), r = n.width, o = n.height;
1185
- return r === 0 && o === 0;
1186
- }, bo = function(t, n) {
1187
- var r = n.displayCheck, o = n.getShadowRoot;
1188
- if (getComputedStyle(t).visibility === "hidden")
1189
- return !0;
1190
- var i = $e.call(t, "details>summary:first-of-type"), s = i ? t.parentElement : t;
1191
- if ($e.call(s, "details:not([open]) *"))
1192
- return !0;
1193
- if (!r || r === "full" || r === "legacy-full") {
1194
- if (typeof o == "function") {
1195
- for (var l = t; t; ) {
1196
- var a = t.parentElement, c = gt(t);
1197
- if (a && !a.shadowRoot && o(a) === !0)
1198
- return on(t);
1199
- t.assignedSlot ? t = t.assignedSlot : !a && c !== t.ownerDocument ? t = c.host : t = a;
1200
- }
1201
- t = l;
1202
- }
1203
- if (ho(t))
1204
- return !t.getClientRects().length;
1205
- if (r !== "legacy-full")
1206
- return !0;
1207
- } else if (r === "non-zero-area")
1208
- return on(t);
1209
- return !1;
1210
- }, vo = function(t) {
1211
- if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))
1212
- for (var n = t.parentElement; n; ) {
1213
- if (n.tagName === "FIELDSET" && n.disabled) {
1214
- for (var r = 0; r < n.children.length; r++) {
1215
- var o = n.children.item(r);
1216
- if (o.tagName === "LEGEND")
1217
- return $e.call(n, "fieldset[disabled] *") ? !0 : !o.contains(t);
1218
- }
1219
- return !0;
1220
- }
1221
- n = n.parentElement;
1222
- }
1223
- return !1;
1224
- }, xo = function(t, n) {
1225
- return !(n.disabled || // we must do an inert look up to filter out any elements inside an inert ancestor
1226
- // because we're limited in the type of selectors we can use in JSDom (see related
1227
- // note related to `candidateSelectors`)
1228
- ht(n) || ao(n) || bo(n, t) || // For a details element with a summary, the summary element gets the focus
1229
- uo(n) || vo(n));
1230
- }, Bt = function(t, n) {
1231
- return !(go(n) || Un(n) < 0 || !xo(t, n));
1232
- }, yo = function(t) {
1233
- var n = parseInt(t.getAttribute("tabindex"), 10);
1234
- return !!(isNaN(n) || n >= 0);
1235
- }, wo = function e(t) {
1236
- var n = [], r = [];
1237
- return t.forEach(function(o, i) {
1238
- var s = !!o.scopeParent, l = s ? o.scopeParent : o, a = co(l, s), c = s ? e(o.candidates) : l;
1239
- a === 0 ? s ? n.push.apply(n, c) : n.push(l) : r.push({
1240
- documentOrder: i,
1241
- tabIndex: a,
1242
- item: o,
1243
- isScope: s,
1244
- content: c
1245
- });
1246
- }), r.sort(lo).reduce(function(o, i) {
1247
- return i.isScope ? o.push.apply(o, i.content) : o.push(i.content), o;
1248
- }, []).concat(n);
1249
- }, Xe = function(t, n) {
1250
- n = n || {};
1251
- var r;
1252
- return n.getShadowRoot ? r = so([t], n.includeContainer, {
1253
- filter: Bt.bind(null, n),
1254
- flatten: !1,
1255
- getShadowRoot: n.getShadowRoot,
1256
- shadowRootFilter: yo
1257
- }) : r = io(t, n.includeContainer, Bt.bind(null, n)), wo(r);
1258
- }, Ro = function(t, n) {
1259
- if (n = n || {}, !t)
1260
- throw new Error("No node provided");
1261
- return $e.call(t, pt) === !1 ? !1 : Bt(n, t);
1262
- }, at = typeof document < "u" ? In : Cn;
1263
- function bt(e, t) {
1264
- if (e === t)
1265
- return !0;
1266
- if (typeof e != typeof t)
1267
- return !1;
1268
- if (typeof e == "function" && e.toString() === t.toString())
1269
- return !0;
1270
- let n, r, o;
1271
- if (e && t && typeof e == "object") {
1272
- if (Array.isArray(e)) {
1273
- if (n = e.length, n !== t.length) return !1;
1274
- for (r = n; r-- !== 0; )
1275
- if (!bt(e[r], t[r]))
1276
- return !1;
1277
- return !0;
1278
- }
1279
- if (o = Object.keys(e), n = o.length, n !== Object.keys(t).length)
1280
- return !1;
1281
- for (r = n; r-- !== 0; )
1282
- if (!{}.hasOwnProperty.call(t, o[r]))
1283
- return !1;
1284
- for (r = n; r-- !== 0; ) {
1285
- const i = o[r];
1286
- if (!(i === "_owner" && e.$$typeof) && !bt(e[i], t[i]))
1287
- return !1;
1288
- }
1289
- return !0;
1290
- }
1291
- return e !== e && t !== t;
1292
- }
1293
- function Gn(e) {
1294
- return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
1295
- }
1296
- function sn(e, t) {
1297
- const n = Gn(e);
1298
- return Math.round(t * n) / n;
1299
- }
1300
- function Tt(e) {
1301
- const t = m.useRef(e);
1302
- return at(() => {
1303
- t.current = e;
1304
- }), t;
1305
- }
1306
- function Eo(e) {
1307
- e === void 0 && (e = {});
1308
- const {
1309
- placement: t = "bottom",
1310
- strategy: n = "absolute",
1311
- middleware: r = [],
1312
- platform: o,
1313
- elements: {
1314
- reference: i,
1315
- floating: s
1316
- } = {},
1317
- transform: l = !0,
1318
- whileElementsMounted: a,
1319
- open: c
1320
- } = e, [d, u] = m.useState({
1321
- x: 0,
1322
- y: 0,
1323
- strategy: n,
1324
- placement: t,
1325
- middlewareData: {},
1326
- isPositioned: !1
1327
- }), [g, f] = m.useState(r);
1328
- bt(g, r) || f(r);
1329
- const [p, h] = m.useState(null), [y, x] = m.useState(null), E = m.useCallback((I) => {
1330
- I !== F.current && (F.current = I, h(I));
1331
- }, []), b = m.useCallback((I) => {
1332
- I !== W.current && (W.current = I, x(I));
1333
- }, []), w = i || p, D = s || y, F = m.useRef(null), W = m.useRef(null), _ = m.useRef(d), Z = a != null, K = Tt(a), $ = Tt(o), C = Tt(c), L = m.useCallback(() => {
1334
- if (!F.current || !W.current)
1335
- return;
1336
- const I = {
1337
- placement: t,
1338
- strategy: n,
1339
- middleware: g
1340
- };
1341
- $.current && (I.platform = $.current), Xr(F.current, W.current, I).then((R) => {
1342
- const B = {
1343
- ...R,
1344
- // The floating element's position may be recomputed while it's closed
1345
- // but still mounted (such as when transitioning out). To ensure
1346
- // `isPositioned` will be `false` initially on the next open, avoid
1347
- // setting it to `true` when `open === false` (must be specified).
1348
- isPositioned: C.current !== !1
1349
- };
1350
- A.current && !bt(_.current, B) && (_.current = B, Tn.flushSync(() => {
1351
- u(B);
1352
- }));
1353
- });
1354
- }, [g, t, n, $, C]);
1355
- at(() => {
1356
- c === !1 && _.current.isPositioned && (_.current.isPositioned = !1, u((I) => ({
1357
- ...I,
1358
- isPositioned: !1
1359
- })));
1360
- }, [c]);
1361
- const A = m.useRef(!1);
1362
- at(() => (A.current = !0, () => {
1363
- A.current = !1;
1364
- }), []), at(() => {
1365
- if (w && (F.current = w), D && (W.current = D), w && D) {
1366
- if (K.current)
1367
- return K.current(w, D, L);
1368
- L();
1369
- }
1370
- }, [w, D, L, K, Z]);
1371
- const v = m.useMemo(() => ({
1372
- reference: F,
1373
- floating: W,
1374
- setReference: E,
1375
- setFloating: b
1376
- }), [E, b]), M = m.useMemo(() => ({
1377
- reference: w,
1378
- floating: D
1379
- }), [w, D]), N = m.useMemo(() => {
1380
- const I = {
1381
- position: n,
1382
- left: 0,
1383
- top: 0
1384
- };
1385
- if (!M.floating)
1386
- return I;
1387
- const R = sn(M.floating, d.x), B = sn(M.floating, d.y);
1388
- return l ? {
1389
- ...I,
1390
- transform: "translate(" + R + "px, " + B + "px)",
1391
- ...Gn(M.floating) >= 1.5 && {
1392
- willChange: "transform"
1393
- }
1394
- } : {
1395
- position: n,
1396
- left: R,
1397
- top: B
1398
- };
1399
- }, [n, l, M.floating, d.x, d.y]);
1400
- return m.useMemo(() => ({
1401
- ...d,
1402
- update: L,
1403
- refs: v,
1404
- elements: M,
1405
- floatingStyles: N
1406
- }), [d, L, v, M, N]);
1407
- }
1408
- const xi = (e, t) => ({
1409
- ...Ur(e),
1410
- options: [e, t]
1411
- }), yi = (e, t) => ({
1412
- ...Yr(e),
1413
- options: [e, t]
1414
- }), wi = (e, t) => ({
1415
- ...Gr(e),
1416
- options: [e, t]
1417
- });
1418
- function Io(e) {
1419
- return m.useMemo(() => e.every((t) => t == null) ? null : (t) => {
1420
- e.forEach((n) => {
1421
- typeof n == "function" ? n(t) : n != null && (n.current = t);
1422
- });
1423
- }, e);
1424
- }
1425
- const Xn = {
1426
- ...m
1427
- }, Co = Xn.useInsertionEffect, So = Co || ((e) => e());
1428
- function fe(e) {
1429
- const t = m.useRef(() => {
1430
- if (process.env.NODE_ENV !== "production")
1431
- throw new Error("Cannot call an event handler while rendering.");
1432
- });
1433
- return So(() => {
1434
- t.current = e;
1435
- }), m.useCallback(function() {
1436
- for (var n = arguments.length, r = new Array(n), o = 0; o < n; o++)
1437
- r[o] = arguments[o];
1438
- return t.current == null ? void 0 : t.current(...r);
1439
- }, []);
1440
- }
1441
- const Ut = "ArrowUp", nt = "ArrowDown", Ke = "ArrowLeft", qe = "ArrowRight";
1442
- function st(e, t, n) {
1443
- return Math.floor(e / t) !== n;
1444
- }
1445
- function Ye(e, t) {
1446
- return t < 0 || t >= e.current.length;
1447
- }
1448
- function At(e, t) {
1449
- return ee(e, {
1450
- disabledIndices: t
1451
- });
1452
- }
1453
- function cn(e, t) {
1454
- return ee(e, {
1455
- decrement: !0,
1456
- startingIndex: e.current.length,
1457
- disabledIndices: t
1458
- });
1459
- }
1460
- function ee(e, t) {
1461
- let {
1462
- startingIndex: n = -1,
1463
- decrement: r = !1,
1464
- disabledIndices: o,
1465
- amount: i = 1
1466
- } = t === void 0 ? {} : t;
1467
- const s = e.current;
1468
- let l = n;
1469
- do
1470
- l += r ? -i : i;
1471
- while (l >= 0 && l <= s.length - 1 && ut(s, l, o));
1472
- return l;
1473
- }
1474
- function To(e, t) {
1475
- let {
1476
- event: n,
1477
- orientation: r,
1478
- loop: o,
1479
- cols: i,
1480
- disabledIndices: s,
1481
- minIndex: l,
1482
- maxIndex: a,
1483
- prevIndex: c,
1484
- stopEvent: d = !1
1485
- } = t, u = c;
1486
- if (n.key === Ut) {
1487
- if (d && re(n), c === -1)
1488
- u = a;
1489
- else if (u = ee(e, {
1490
- startingIndex: u,
1491
- amount: i,
1492
- decrement: !0,
1493
- disabledIndices: s
1494
- }), o && (c - i < l || u < 0)) {
1495
- const g = c % i, f = a % i, p = a - (f - g);
1496
- f === g ? u = a : u = f > g ? p : p - i;
1497
- }
1498
- Ye(e, u) && (u = c);
1499
- }
1500
- if (n.key === nt && (d && re(n), c === -1 ? u = l : (u = ee(e, {
1501
- startingIndex: c,
1502
- amount: i,
1503
- disabledIndices: s
1504
- }), o && c + i > a && (u = ee(e, {
1505
- startingIndex: c % i - i,
1506
- amount: i,
1507
- disabledIndices: s
1508
- }))), Ye(e, u) && (u = c)), r === "both") {
1509
- const g = Ve(c / i);
1510
- n.key === qe && (d && re(n), c % i !== i - 1 ? (u = ee(e, {
1511
- startingIndex: c,
1512
- disabledIndices: s
1513
- }), o && st(u, i, g) && (u = ee(e, {
1514
- startingIndex: c - c % i - 1,
1515
- disabledIndices: s
1516
- }))) : o && (u = ee(e, {
1517
- startingIndex: c - c % i - 1,
1518
- disabledIndices: s
1519
- })), st(u, i, g) && (u = c)), n.key === Ke && (d && re(n), c % i !== 0 ? (u = ee(e, {
1520
- startingIndex: c,
1521
- decrement: !0,
1522
- disabledIndices: s
1523
- }), o && st(u, i, g) && (u = ee(e, {
1524
- startingIndex: c + (i - c % i),
1525
- decrement: !0,
1526
- disabledIndices: s
1527
- }))) : o && (u = ee(e, {
1528
- startingIndex: c + (i - c % i),
1529
- decrement: !0,
1530
- disabledIndices: s
1531
- })), st(u, i, g) && (u = c));
1532
- const f = Ve(a / i) === g;
1533
- Ye(e, u) && (o && f ? u = n.key === Ke ? a : ee(e, {
1534
- startingIndex: c - c % i - 1,
1535
- disabledIndices: s
1536
- }) : u = c);
1537
- }
1538
- return u;
1539
- }
1540
- function Ao(e, t, n) {
1541
- const r = [];
1542
- let o = 0;
1543
- return e.forEach((i, s) => {
1544
- let {
1545
- width: l,
1546
- height: a
1547
- } = i;
1548
- if (l > t && process.env.NODE_ENV !== "production")
1549
- throw new Error("[Floating UI]: Invalid grid - item width at index " + s + " is greater than grid columns");
1550
- let c = !1;
1551
- for (n && (o = 0); !c; ) {
1552
- const d = [];
1553
- for (let u = 0; u < l; u++)
1554
- for (let g = 0; g < a; g++)
1555
- d.push(o + u + g * t);
1556
- o % t + l <= t && d.every((u) => r[u] == null) ? (d.forEach((u) => {
1557
- r[u] = s;
1558
- }), c = !0) : o++;
1559
- }
1560
- }), [...r];
1561
- }
1562
- function Oo(e, t, n, r, o) {
1563
- if (e === -1) return -1;
1564
- const i = n.indexOf(e), s = t[e];
1565
- switch (o) {
1566
- case "tl":
1567
- return i;
1568
- case "tr":
1569
- return s ? i + s.width - 1 : i;
1570
- case "bl":
1571
- return s ? i + (s.height - 1) * r : i;
1572
- case "br":
1573
- return n.lastIndexOf(e);
1574
- }
1575
- }
1576
- function Mo(e, t) {
1577
- return t.flatMap((n, r) => e.includes(n) ? [r] : []);
1578
- }
1579
- function ut(e, t, n) {
1580
- if (n)
1581
- return n.includes(t);
1582
- const r = e[t];
1583
- return r == null || r.hasAttribute("disabled") || r.getAttribute("aria-disabled") === "true";
1584
- }
1585
- let ln = 0;
1586
- function Ie(e, t) {
1587
- t === void 0 && (t = {});
1588
- const {
1589
- preventScroll: n = !1,
1590
- cancelPrevious: r = !0,
1591
- sync: o = !1
1592
- } = t;
1593
- r && cancelAnimationFrame(ln);
1594
- const i = () => e == null ? void 0 : e.focus({
1595
- preventScroll: n
1596
- });
1597
- o ? i() : ln = requestAnimationFrame(i);
1598
- }
1599
- var G = typeof document < "u" ? In : Cn;
1600
- function vt() {
1601
- return vt = Object.assign ? Object.assign.bind() : function(e) {
1602
- for (var t = 1; t < arguments.length; t++) {
1603
- var n = arguments[t];
1604
- for (var r in n)
1605
- Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
1606
- }
1607
- return e;
1608
- }, vt.apply(this, arguments);
1609
- }
1610
- let an = !1, Do = 0;
1611
- const un = () => (
1612
- // Ensure the id is unique with multiple independent versions of Floating UI
1613
- // on <React 18
1614
- "floating-ui-" + Math.random().toString(36).slice(2, 6) + Do++
1615
- );
1616
- function Po() {
1617
- const [e, t] = m.useState(() => an ? un() : void 0);
1618
- return G(() => {
1619
- e == null && t(un());
1620
- }, []), m.useEffect(() => {
1621
- an = !0;
1622
- }, []), e;
1623
- }
1624
- const Fo = Xn.useId, Yt = Fo || Po;
1625
- let Ze;
1626
- process.env.NODE_ENV !== "production" && (Ze = /* @__PURE__ */ new Set());
1627
- function Ot() {
1628
- for (var e, t = arguments.length, n = new Array(t), r = 0; r < t; r++)
1629
- n[r] = arguments[r];
1630
- const o = "Floating UI: " + n.join(" ");
1631
- if (!((e = Ze) != null && e.has(o))) {
1632
- var i;
1633
- (i = Ze) == null || i.add(o), console.warn(o);
1634
- }
1635
- }
1636
- function Lo() {
1637
- for (var e, t = arguments.length, n = new Array(t), r = 0; r < t; r++)
1638
- n[r] = arguments[r];
1639
- const o = "Floating UI: " + n.join(" ");
1640
- if (!((e = Ze) != null && e.has(o))) {
1641
- var i;
1642
- (i = Ze) == null || i.add(o), console.error(o);
1643
- }
1644
- }
1645
- function No() {
1646
- const e = /* @__PURE__ */ new Map();
1647
- return {
1648
- emit(t, n) {
1649
- var r;
1650
- (r = e.get(t)) == null || r.forEach((o) => o(n));
1651
- },
1652
- on(t, n) {
1653
- e.set(t, [...e.get(t) || [], n]);
1654
- },
1655
- off(t, n) {
1656
- var r;
1657
- e.set(t, ((r = e.get(t)) == null ? void 0 : r.filter((o) => o !== n)) || []);
1658
- }
1659
- };
1660
- }
1661
- const ko = /* @__PURE__ */ m.createContext(null), Vo = /* @__PURE__ */ m.createContext(null), Gt = () => {
1662
- var e;
1663
- return ((e = m.useContext(ko)) == null ? void 0 : e.id) || null;
1664
- }, Et = () => m.useContext(Vo);
1665
- function He(e) {
1666
- return "data-floating-ui-" + e;
1667
- }
1668
- function Ce(e) {
1669
- const t = lr(e);
1670
- return G(() => {
1671
- t.current = e;
1672
- }), t;
1673
- }
1674
- function Bo(e, t) {
1675
- var n;
1676
- let r = [], o = (n = e.find((i) => i.id === t)) == null ? void 0 : n.parentId;
1677
- for (; o; ) {
1678
- const i = e.find((s) => s.id === o);
1679
- o = i == null ? void 0 : i.parentId, i && (r = r.concat(i));
1680
- }
1681
- return r;
1682
- }
1683
- function _e(e, t) {
1684
- let n = e.filter((o) => {
1685
- var i;
1686
- return o.parentId === t && ((i = o.context) == null ? void 0 : i.open);
1687
- }), r = n;
1688
- for (; r.length; )
1689
- r = e.filter((o) => {
1690
- var i;
1691
- return (i = r) == null ? void 0 : i.some((s) => {
1692
- var l;
1693
- return o.parentId === s.id && ((l = o.context) == null ? void 0 : l.open);
1694
- });
1695
- }), n = n.concat(r);
1696
- return n;
1697
- }
1698
- function _o(e, t) {
1699
- let n, r = -1;
1700
- function o(i, s) {
1701
- s > r && (n = i, r = s), _e(e, i).forEach((a) => {
1702
- o(a.id, s + 1);
1703
- });
1704
- }
1705
- return o(t, 0), e.find((i) => i.id === n);
1706
- }
1707
- let ke = /* @__PURE__ */ new WeakMap(), ct = /* @__PURE__ */ new WeakSet(), lt = {}, Mt = 0;
1708
- const Wo = () => typeof HTMLElement < "u" && "inert" in HTMLElement.prototype, Zn = (e) => e && (e.host || Zn(e.parentNode)), $o = (e, t) => t.map((n) => {
1709
- if (e.contains(n))
1710
- return n;
1711
- const r = Zn(n);
1712
- return e.contains(r) ? r : null;
1713
- }).filter((n) => n != null);
1714
- function Ko(e, t, n, r) {
1715
- const o = "data-floating-ui-inert", i = r ? "inert" : n ? "aria-hidden" : null, s = $o(t, e), l = /* @__PURE__ */ new Set(), a = new Set(s), c = [];
1716
- lt[o] || (lt[o] = /* @__PURE__ */ new WeakMap());
1717
- const d = lt[o];
1718
- s.forEach(u), g(t), l.clear();
1719
- function u(f) {
1720
- !f || l.has(f) || (l.add(f), f.parentNode && u(f.parentNode));
1721
- }
1722
- function g(f) {
1723
- !f || a.has(f) || [].forEach.call(f.children, (p) => {
1724
- if (De(p) !== "script")
1725
- if (l.has(p))
1726
- g(p);
1727
- else {
1728
- const h = i ? p.getAttribute(i) : null, y = h !== null && h !== "false", x = (ke.get(p) || 0) + 1, E = (d.get(p) || 0) + 1;
1729
- ke.set(p, x), d.set(p, E), c.push(p), x === 1 && y && ct.add(p), E === 1 && p.setAttribute(o, ""), !y && i && p.setAttribute(i, "true");
1730
- }
1731
- });
1732
- }
1733
- return Mt++, () => {
1734
- c.forEach((f) => {
1735
- const p = (ke.get(f) || 0) - 1, h = (d.get(f) || 0) - 1;
1736
- ke.set(f, p), d.set(f, h), p || (!ct.has(f) && i && f.removeAttribute(i), ct.delete(f)), h || f.removeAttribute(o);
1737
- }), Mt--, Mt || (ke = /* @__PURE__ */ new WeakMap(), ke = /* @__PURE__ */ new WeakMap(), ct = /* @__PURE__ */ new WeakSet(), lt = {});
1738
- };
1739
- }
1740
- function fn(e, t, n) {
1741
- t === void 0 && (t = !1), n === void 0 && (n = !1);
1742
- const r = se(e[0]).body;
1743
- return Ko(e.concat(Array.from(r.querySelectorAll("[aria-live]"))), r, t, n);
1744
- }
1745
- const ze = () => ({
1746
- getShadowRoot: !0,
1747
- displayCheck: (
1748
- // JSDOM does not support the `tabbable` library. To solve this we can
1749
- // check if `ResizeObserver` is a real function (not polyfilled), which
1750
- // determines if the current environment is JSDOM-like.
1751
- typeof ResizeObserver == "function" && ResizeObserver.toString().includes("[native code]") ? "full" : "none"
1752
- )
1753
- });
1754
- function Jn(e, t) {
1755
- const n = Xe(e, ze());
1756
- t === "prev" && n.reverse();
1757
- const r = n.indexOf(ve(se(e)));
1758
- return n.slice(r + 1)[0];
1759
- }
1760
- function Qn() {
1761
- return Jn(document.body, "next");
1762
- }
1763
- function er() {
1764
- return Jn(document.body, "prev");
1765
- }
1766
- function Ge(e, t) {
1767
- const n = t || e.currentTarget, r = e.relatedTarget;
1768
- return !r || !ne(n, r);
1769
- }
1770
- function Ho(e) {
1771
- Xe(e, ze()).forEach((n) => {
1772
- n.dataset.tabindex = n.getAttribute("tabindex") || "", n.setAttribute("tabindex", "-1");
1773
- });
1774
- }
1775
- function dn(e) {
1776
- e.querySelectorAll("[data-tabindex]").forEach((n) => {
1777
- const r = n.dataset.tabindex;
1778
- delete n.dataset.tabindex, r ? n.setAttribute("tabindex", r) : n.removeAttribute("tabindex");
1779
- });
1780
- }
1781
- function zo(e, t, n) {
1782
- const r = e.indexOf(t);
1783
- function o(s) {
1784
- const l = He("focus-guard");
1785
- let a = r + (s ? 1 : 0), c = e[a];
1786
- for (; c && (!c.isConnected || c.hasAttribute(l) || ne(n, c)); )
1787
- s ? a++ : a--, c = e[a];
1788
- return c;
1789
- }
1790
- const i = o(!0);
1791
- return i || o(!1);
1792
- }
1793
- const Xt = {
1794
- border: 0,
1795
- clip: "rect(0 0 0 0)",
1796
- height: "1px",
1797
- margin: "-1px",
1798
- overflow: "hidden",
1799
- padding: 0,
1800
- position: "fixed",
1801
- whiteSpace: "nowrap",
1802
- width: "1px",
1803
- top: 0,
1804
- left: 0
1805
- };
1806
- let qo;
1807
- function mn(e) {
1808
- e.key === "Tab" && (e.target, clearTimeout(qo));
1809
- }
1810
- const xt = /* @__PURE__ */ m.forwardRef(function(t, n) {
1811
- const [r, o] = m.useState();
1812
- G(() => (Hn() && o("button"), document.addEventListener("keydown", mn), () => {
1813
- document.removeEventListener("keydown", mn);
1814
- }), []);
1815
- const i = {
1816
- ref: n,
1817
- tabIndex: 0,
1818
- // Role is only for VoiceOver
1819
- role: r,
1820
- "aria-hidden": r ? void 0 : !0,
1821
- [He("focus-guard")]: "",
1822
- style: Xt
1823
- };
1824
- return /* @__PURE__ */ m.createElement("span", vt({}, t, i));
1825
- }), tr = /* @__PURE__ */ m.createContext(null), pn = /* @__PURE__ */ He("portal");
1826
- function jo(e) {
1827
- e === void 0 && (e = {});
1828
- const {
1829
- id: t,
1830
- root: n
1831
- } = e, r = Yt(), o = nr(), [i, s] = m.useState(null), l = m.useRef(null);
1832
- return G(() => () => {
1833
- i == null || i.remove(), queueMicrotask(() => {
1834
- l.current = null;
1835
- });
1836
- }, [i]), G(() => {
1837
- if (!r || l.current) return;
1838
- const a = t ? document.getElementById(t) : null;
1839
- if (!a) return;
1840
- const c = document.createElement("div");
1841
- c.id = r, c.setAttribute(pn, ""), a.appendChild(c), l.current = c, s(c);
1842
- }, [t, r]), G(() => {
1843
- if (!r || l.current) return;
1844
- let a = n || (o == null ? void 0 : o.portalNode);
1845
- a && !U(a) && (a = a.current), a = a || document.body;
1846
- let c = null;
1847
- t && (c = document.createElement("div"), c.id = t, a.appendChild(c));
1848
- const d = document.createElement("div");
1849
- d.id = r, d.setAttribute(pn, ""), a = c || a, a.appendChild(d), l.current = d, s(d);
1850
- }, [t, n, r, o]), i;
1851
- }
1852
- function Ri(e) {
1853
- const {
1854
- children: t,
1855
- id: n,
1856
- root: r = null,
1857
- preserveTabOrder: o = !0
1858
- } = e, i = jo({
1859
- id: n,
1860
- root: r
1861
- }), [s, l] = m.useState(null), a = m.useRef(null), c = m.useRef(null), d = m.useRef(null), u = m.useRef(null), g = s == null ? void 0 : s.modal, f = s == null ? void 0 : s.open, p = (
1862
- // The FocusManager and therefore floating element are currently open/
1863
- // rendered.
1864
- !!s && // Guards are only for non-modal focus management.
1865
- !s.modal && // Don't render if unmount is transitioning.
1866
- s.open && o && !!(r || i)
1867
- );
1868
- return m.useEffect(() => {
1869
- if (!i || !o || g)
1870
- return;
1871
- function h(y) {
1872
- i && Ge(y) && (y.type === "focusin" ? dn : Ho)(i);
1873
- }
1874
- return i.addEventListener("focusin", h, !0), i.addEventListener("focusout", h, !0), () => {
1875
- i.removeEventListener("focusin", h, !0), i.removeEventListener("focusout", h, !0);
1876
- };
1877
- }, [i, o, g]), m.useEffect(() => {
1878
- i && (f || dn(i));
1879
- }, [f, i]), /* @__PURE__ */ m.createElement(tr.Provider, {
1880
- value: m.useMemo(() => ({
1881
- preserveTabOrder: o,
1882
- beforeOutsideRef: a,
1883
- afterOutsideRef: c,
1884
- beforeInsideRef: d,
1885
- afterInsideRef: u,
1886
- portalNode: i,
1887
- setFocusManagerState: l
1888
- }), [o, i])
1889
- }, p && i && /* @__PURE__ */ m.createElement(xt, {
1890
- "data-type": "outside",
1891
- ref: a,
1892
- onFocus: (h) => {
1893
- if (Ge(h, i)) {
1894
- var y;
1895
- (y = d.current) == null || y.focus();
1896
- } else {
1897
- const x = er() || (s == null ? void 0 : s.refs.domReference.current);
1898
- x == null || x.focus();
1899
- }
1900
- }
1901
- }), p && i && /* @__PURE__ */ m.createElement("span", {
1902
- "aria-owns": i.id,
1903
- style: Xt
1904
- }), i && /* @__PURE__ */ Tn.createPortal(t, i), p && i && /* @__PURE__ */ m.createElement(xt, {
1905
- "data-type": "outside",
1906
- ref: c,
1907
- onFocus: (h) => {
1908
- if (Ge(h, i)) {
1909
- var y;
1910
- (y = u.current) == null || y.focus();
1911
- } else {
1912
- const x = Qn() || (s == null ? void 0 : s.refs.domReference.current);
1913
- x == null || x.focus(), s != null && s.closeOnFocusOut && (s == null || s.onOpenChange(!1, h.nativeEvent, "focus-out"));
1914
- }
1915
- }
1916
- }));
1917
- }
1918
- const nr = () => m.useContext(tr), _t = "data-floating-ui-focusable";
1919
- function rr(e) {
1920
- return e ? e.hasAttribute(_t) ? e : e.querySelector("[" + _t + "]") || e : null;
1921
- }
1922
- const Uo = 20;
1923
- let Fe = [];
1924
- function Dt(e) {
1925
- Fe = Fe.filter((n) => n.isConnected);
1926
- let t = e;
1927
- if (!(!t || De(t) === "body")) {
1928
- if (!Ro(t, ze())) {
1929
- const n = Xe(t, ze())[0];
1930
- n && (t = n);
1931
- }
1932
- Fe.push(t), Fe.length > Uo && (Fe = Fe.slice(-20));
1933
- }
1934
- }
1935
- function gn() {
1936
- return Fe.slice().reverse().find((e) => e.isConnected);
1937
- }
1938
- const Yo = /* @__PURE__ */ m.forwardRef(function(t, n) {
1939
- return /* @__PURE__ */ m.createElement("button", vt({}, t, {
1940
- type: "button",
1941
- ref: n,
1942
- tabIndex: -1,
1943
- style: Xt
1944
- }));
1945
- });
1946
- function Ei(e) {
1947
- const {
1948
- context: t,
1949
- children: n,
1950
- disabled: r = !1,
1951
- order: o = ["content"],
1952
- guards: i = !0,
1953
- initialFocus: s = 0,
1954
- returnFocus: l = !0,
1955
- restoreFocus: a = !1,
1956
- modal: c = !0,
1957
- visuallyHiddenDismiss: d = !1,
1958
- closeOnFocusOut: u = !0
1959
- } = e, {
1960
- open: g,
1961
- refs: f,
1962
- nodeId: p,
1963
- onOpenChange: h,
1964
- events: y,
1965
- dataRef: x,
1966
- floatingId: E,
1967
- elements: {
1968
- domReference: b,
1969
- floating: w
1970
- }
1971
- } = t, D = typeof s == "number" && s < 0, F = zn(b) && D, W = Wo() ? i : !0, _ = Ce(o), Z = Ce(s), K = Ce(l), $ = Et(), C = nr(), L = m.useRef(null), A = m.useRef(null), v = m.useRef(!1), M = m.useRef(!1), N = m.useRef(-1), I = C != null, R = rr(w), B = fe(function(V) {
1972
- return V === void 0 && (V = R), V ? Xe(V, ze()) : [];
1973
- }), J = fe((V) => {
1974
- const O = B(V);
1975
- return _.current.map((S) => b && S === "reference" ? b : R && S === "floating" ? R : O).filter(Boolean).flat();
1976
- });
1977
- m.useEffect(() => {
1978
- v.current = !1;
1979
- }, [r]), m.useEffect(() => {
1980
- if (r || !c) return;
1981
- function V(S) {
1982
- if (S.key === "Tab") {
1983
- ne(R, ve(se(R))) && B().length === 0 && !F && re(S);
1984
- const P = J(), q = Le(S);
1985
- _.current[0] === "reference" && q === b && (re(S), S.shiftKey ? Ie(P[P.length - 1]) : Ie(P[1])), _.current[1] === "floating" && q === R && S.shiftKey && (re(S), Ie(P[0]));
1986
- }
1987
- }
1988
- const O = se(R);
1989
- return O.addEventListener("keydown", V), () => {
1990
- O.removeEventListener("keydown", V);
1991
- };
1992
- }, [r, b, R, c, _, F, B, J]), m.useEffect(() => {
1993
- if (r || !w) return;
1994
- function V(O) {
1995
- const S = Le(O), q = B().indexOf(S);
1996
- q !== -1 && (N.current = q);
1997
- }
1998
- return w.addEventListener("focusin", V), () => {
1999
- w.removeEventListener("focusin", V);
2000
- };
2001
- }, [r, w, B]), m.useEffect(() => {
2002
- if (r || !u) return;
2003
- function V() {
2004
- M.current = !0, setTimeout(() => {
2005
- M.current = !1;
2006
- });
2007
- }
2008
- function O(S) {
2009
- const P = S.relatedTarget;
2010
- queueMicrotask(() => {
2011
- const q = !(ne(b, P) || ne(w, P) || ne(P, w) || ne(C == null ? void 0 : C.portalNode, P) || P != null && P.hasAttribute(He("focus-guard")) || $ && (_e($.nodesRef.current, p).find((Q) => {
2012
- var te, Y;
2013
- return ne((te = Q.context) == null ? void 0 : te.elements.floating, P) || ne((Y = Q.context) == null ? void 0 : Y.elements.domReference, P);
2014
- }) || Bo($.nodesRef.current, p).find((Q) => {
2015
- var te, Y;
2016
- return ((te = Q.context) == null ? void 0 : te.elements.floating) === P || ((Y = Q.context) == null ? void 0 : Y.elements.domReference) === P;
2017
- })));
2018
- if (a && q && ve(se(R)) === se(R).body) {
2019
- X(R) && R.focus();
2020
- const Q = N.current, te = B(), Y = te[Q] || te[te.length - 1] || R;
2021
- X(Y) && Y.focus();
2022
- }
2023
- (F || !c) && P && q && !M.current && // Fix React 18 Strict Mode returnFocus due to double rendering.
2024
- P !== gn() && (v.current = !0, h(!1, S, "focus-out"));
2025
- });
2026
- }
2027
- if (w && X(b))
2028
- return b.addEventListener("focusout", O), b.addEventListener("pointerdown", V), w.addEventListener("focusout", O), () => {
2029
- b.removeEventListener("focusout", O), b.removeEventListener("pointerdown", V), w.removeEventListener("focusout", O);
2030
- };
2031
- }, [r, b, w, R, c, p, $, C, h, u, a, B, F]), m.useEffect(() => {
2032
- var V;
2033
- if (r) return;
2034
- const O = Array.from((C == null || (V = C.portalNode) == null ? void 0 : V.querySelectorAll("[" + He("portal") + "]")) || []);
2035
- if (w) {
2036
- const S = [w, ...O, L.current, A.current, _.current.includes("reference") || F ? b : null].filter((q) => q != null), P = c || F ? fn(S, W, !W) : fn(S);
2037
- return () => {
2038
- P();
2039
- };
2040
- }
2041
- }, [r, b, w, c, _, C, F, W]), G(() => {
2042
- if (r || !X(R)) return;
2043
- const V = se(R), O = ve(V);
2044
- queueMicrotask(() => {
2045
- const S = J(R), P = Z.current, q = (typeof P == "number" ? S[P] : P.current) || R, Q = ne(R, O);
2046
- !D && !Q && g && Ie(q, {
2047
- preventScroll: q === R
2048
- });
2049
- });
2050
- }, [r, g, R, D, J, Z]), G(() => {
2051
- if (r || !R) return;
2052
- let V = !1;
2053
- const O = se(R), S = ve(O);
2054
- let q = x.current.openEvent;
2055
- const Q = f.domReference.current;
2056
- Dt(S);
2057
- function te(Y) {
2058
- let {
2059
- open: Pe,
2060
- reason: ye,
2061
- event: oe,
2062
- nested: we
2063
- } = Y;
2064
- Pe && (q = oe), ye === "escape-key" && f.domReference.current && Dt(f.domReference.current), ye === "hover" && oe.type === "mouseleave" && (v.current = !0), ye === "outside-press" && (we ? (v.current = !1, V = !0) : v.current = !($n(oe) || Kn(oe)));
2065
- }
2066
- return y.on("openchange", te), () => {
2067
- y.off("openchange", te);
2068
- const Y = ve(O), Pe = ne(w, Y) || $ && _e($.nodesRef.current, p).some((me) => {
2069
- var je;
2070
- return ne((je = me.context) == null ? void 0 : je.elements.floating, Y);
2071
- });
2072
- (Pe || q && ["click", "mousedown"].includes(q.type)) && f.domReference.current && Dt(f.domReference.current);
2073
- const oe = Q || S, we = Xe(se(oe).body, ze());
2074
- queueMicrotask(() => {
2075
- let me = gn();
2076
- !me && X(oe) && w && (me = zo(we, oe, w)), // eslint-disable-next-line react-hooks/exhaustive-deps
2077
- K.current && !v.current && X(me) && // If the focus moved somewhere else after mount, avoid returning focus
2078
- // since it likely entered a different element which should be
2079
- // respected: https://github.com/floating-ui/floating-ui/issues/2607
2080
- (!(me !== Y && Y !== O.body) || Pe) && me.focus({
2081
- preventScroll: V
2082
- });
2083
- });
2084
- };
2085
- }, [r, w, R, K, x, f, y, $, p]), G(() => {
2086
- if (!r && C)
2087
- return C.setFocusManagerState({
2088
- modal: c,
2089
- closeOnFocusOut: u,
2090
- open: g,
2091
- onOpenChange: h,
2092
- refs: f
2093
- }), () => {
2094
- C.setFocusManagerState(null);
2095
- };
2096
- }, [r, C, c, g, h, f, u]), G(() => {
2097
- if (r || !R || typeof MutationObserver != "function" || D) return;
2098
- const V = () => {
2099
- const S = R.getAttribute("tabindex"), P = B(), q = ve(se(w)), Q = P.indexOf(q);
2100
- Q !== -1 && (N.current = Q), _.current.includes("floating") || q !== f.domReference.current && P.length === 0 ? S !== "0" && R.setAttribute("tabindex", "0") : S !== "-1" && R.setAttribute("tabindex", "-1");
2101
- };
2102
- V();
2103
- const O = new MutationObserver(V);
2104
- return O.observe(R, {
2105
- childList: !0,
2106
- subtree: !0,
2107
- attributes: !0
2108
- }), () => {
2109
- O.disconnect();
2110
- };
2111
- }, [r, w, R, f, _, B, D]);
2112
- function be(V) {
2113
- return r || !d || !c ? null : /* @__PURE__ */ m.createElement(Yo, {
2114
- ref: V === "start" ? L : A,
2115
- onClick: (O) => h(!1, O.nativeEvent)
2116
- }, typeof d == "string" ? d : "Dismiss");
2117
- }
2118
- const de = !r && W && (c ? !F : !0) && (I || c);
2119
- return /* @__PURE__ */ m.createElement(m.Fragment, null, de && /* @__PURE__ */ m.createElement(xt, {
2120
- "data-type": "inside",
2121
- ref: C == null ? void 0 : C.beforeInsideRef,
2122
- onFocus: (V) => {
2123
- if (c) {
2124
- const S = J();
2125
- Ie(o[0] === "reference" ? S[0] : S[S.length - 1]);
2126
- } else if (C != null && C.preserveTabOrder && C.portalNode)
2127
- if (v.current = !1, Ge(V, C.portalNode)) {
2128
- const S = Qn() || b;
2129
- S == null || S.focus();
2130
- } else {
2131
- var O;
2132
- (O = C.beforeOutsideRef.current) == null || O.focus();
2133
- }
2134
- }
2135
- }), !F && be("start"), n, be("end"), de && /* @__PURE__ */ m.createElement(xt, {
2136
- "data-type": "inside",
2137
- ref: C == null ? void 0 : C.afterInsideRef,
2138
- onFocus: (V) => {
2139
- if (c)
2140
- Ie(J()[0]);
2141
- else if (C != null && C.preserveTabOrder && C.portalNode)
2142
- if (u && (v.current = !0), Ge(V, C.portalNode)) {
2143
- const S = er() || b;
2144
- S == null || S.focus();
2145
- } else {
2146
- var O;
2147
- (O = C.afterOutsideRef.current) == null || O.focus();
2148
- }
2149
- }
2150
- }));
2151
- }
2152
- const Go = {
2153
- pointerdown: "onPointerDown",
2154
- mousedown: "onMouseDown",
2155
- click: "onClick"
2156
- }, Xo = {
2157
- pointerdown: "onPointerDownCapture",
2158
- mousedown: "onMouseDownCapture",
2159
- click: "onClickCapture"
2160
- }, hn = (e) => {
2161
- var t, n;
2162
- return {
2163
- escapeKey: typeof e == "boolean" ? e : (t = e == null ? void 0 : e.escapeKey) != null ? t : !1,
2164
- outsidePress: typeof e == "boolean" ? e : (n = e == null ? void 0 : e.outsidePress) != null ? n : !0
2165
- };
2166
- };
2167
- function Ii(e, t) {
2168
- t === void 0 && (t = {});
2169
- const {
2170
- open: n,
2171
- onOpenChange: r,
2172
- elements: o,
2173
- dataRef: i
2174
- } = e, {
2175
- enabled: s = !0,
2176
- escapeKey: l = !0,
2177
- outsidePress: a = !0,
2178
- outsidePressEvent: c = "pointerdown",
2179
- referencePress: d = !1,
2180
- referencePressEvent: u = "pointerdown",
2181
- ancestorScroll: g = !1,
2182
- bubbles: f,
2183
- capture: p
2184
- } = t, h = Et(), y = fe(typeof a == "function" ? a : () => !1), x = typeof a == "function" ? y : a, E = m.useRef(!1), b = m.useRef(!1), {
2185
- escapeKey: w,
2186
- outsidePress: D
2187
- } = hn(f), {
2188
- escapeKey: F,
2189
- outsidePress: W
2190
- } = hn(p), _ = fe((A) => {
2191
- var v;
2192
- if (!n || !s || !l || A.key !== "Escape")
2193
- return;
2194
- const M = (v = i.current.floatingContext) == null ? void 0 : v.nodeId, N = h ? _e(h.nodesRef.current, M) : [];
2195
- if (!w && (A.stopPropagation(), N.length > 0)) {
2196
- let I = !0;
2197
- if (N.forEach((R) => {
2198
- var B;
2199
- if ((B = R.context) != null && B.open && !R.context.dataRef.current.__escapeKeyBubbles) {
2200
- I = !1;
2201
- return;
2202
- }
2203
- }), !I)
2204
- return;
2205
- }
2206
- r(!1, Qr(A) ? A.nativeEvent : A, "escape-key");
2207
- }), Z = fe((A) => {
2208
- var v;
2209
- const M = () => {
2210
- var N;
2211
- _(A), (N = Le(A)) == null || N.removeEventListener("keydown", M);
2212
- };
2213
- (v = Le(A)) == null || v.addEventListener("keydown", M);
2214
- }), K = fe((A) => {
2215
- var v;
2216
- const M = E.current;
2217
- E.current = !1;
2218
- const N = b.current;
2219
- if (b.current = !1, c === "click" && N || M || typeof x == "function" && !x(A))
2220
- return;
2221
- const I = Le(A), R = "[" + He("inert") + "]", B = se(o.floating).querySelectorAll(R);
2222
- let J = U(I) ? I : null;
2223
- for (; J && !Me(J); ) {
2224
- const O = xe(J);
2225
- if (Me(O) || !U(O))
2226
- break;
2227
- J = O;
2228
- }
2229
- if (B.length && U(I) && !eo(I) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
2230
- !ne(I, o.floating) && // If the target root element contains none of the markers, then the
2231
- // element was injected after the floating element rendered.
2232
- Array.from(B).every((O) => !ne(J, O)))
2233
- return;
2234
- if (X(I) && L) {
2235
- const O = I.clientWidth > 0 && I.scrollWidth > I.clientWidth, S = I.clientHeight > 0 && I.scrollHeight > I.clientHeight;
2236
- let P = S && A.offsetX > I.clientWidth;
2237
- if (S && ae(I).direction === "rtl" && (P = A.offsetX <= I.offsetWidth - I.clientWidth), P || O && A.offsetY > I.clientHeight)
2238
- return;
2239
- }
2240
- const be = (v = i.current.floatingContext) == null ? void 0 : v.nodeId, de = h && _e(h.nodesRef.current, be).some((O) => {
2241
- var S;
2242
- return St(A, (S = O.context) == null ? void 0 : S.elements.floating);
2243
- });
2244
- if (St(A, o.floating) || St(A, o.domReference) || de)
2245
- return;
2246
- const V = h ? _e(h.nodesRef.current, be) : [];
2247
- if (V.length > 0) {
2248
- let O = !0;
2249
- if (V.forEach((S) => {
2250
- var P;
2251
- if ((P = S.context) != null && P.open && !S.context.dataRef.current.__outsidePressBubbles) {
2252
- O = !1;
2253
- return;
2254
- }
2255
- }), !O)
2256
- return;
2257
- }
2258
- r(!1, A, "outside-press");
2259
- }), $ = fe((A) => {
2260
- var v;
2261
- const M = () => {
2262
- var N;
2263
- K(A), (N = Le(A)) == null || N.removeEventListener(c, M);
2264
- };
2265
- (v = Le(A)) == null || v.addEventListener(c, M);
2266
- });
2267
- m.useEffect(() => {
2268
- if (!n || !s)
2269
- return;
2270
- i.current.__escapeKeyBubbles = w, i.current.__outsidePressBubbles = D;
2271
- function A(N) {
2272
- r(!1, N, "ancestor-scroll");
2273
- }
2274
- const v = se(o.floating);
2275
- l && v.addEventListener("keydown", F ? Z : _, F), x && v.addEventListener(c, W ? $ : K, W);
2276
- let M = [];
2277
- return g && (U(o.domReference) && (M = Te(o.domReference)), U(o.floating) && (M = M.concat(Te(o.floating))), !U(o.reference) && o.reference && o.reference.contextElement && (M = M.concat(Te(o.reference.contextElement)))), M = M.filter((N) => {
2278
- var I;
2279
- return N !== ((I = v.defaultView) == null ? void 0 : I.visualViewport);
2280
- }), M.forEach((N) => {
2281
- N.addEventListener("scroll", A, {
2282
- passive: !0
2283
- });
2284
- }), () => {
2285
- l && v.removeEventListener("keydown", F ? Z : _, F), x && v.removeEventListener(c, W ? $ : K, W), M.forEach((N) => {
2286
- N.removeEventListener("scroll", A);
2287
- });
2288
- };
2289
- }, [i, o, l, x, c, n, r, g, s, w, D, _, F, Z, K, W, $]), m.useEffect(() => {
2290
- E.current = !1;
2291
- }, [x, c]);
2292
- const C = m.useMemo(() => ({
2293
- onKeyDown: _,
2294
- [Go[u]]: (A) => {
2295
- d && r(!1, A.nativeEvent, "reference-press");
2296
- }
2297
- }), [_, r, d, u]), L = m.useMemo(() => ({
2298
- onKeyDown: _,
2299
- onMouseDown() {
2300
- b.current = !0;
2301
- },
2302
- onMouseUp() {
2303
- b.current = !0;
2304
- },
2305
- [Xo[c]]: () => {
2306
- E.current = !0;
2307
- }
2308
- }), [_, c]);
2309
- return m.useMemo(() => s ? {
2310
- reference: C,
2311
- floating: L
2312
- } : {}, [s, C, L]);
2313
- }
2314
- function Zo(e) {
2315
- const {
2316
- open: t = !1,
2317
- onOpenChange: n,
2318
- elements: r
2319
- } = e, o = Yt(), i = m.useRef({}), [s] = m.useState(() => No()), l = Gt() != null;
2320
- if (process.env.NODE_ENV !== "production") {
2321
- const f = r.reference;
2322
- f && !U(f) && Lo("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
2323
- }
2324
- const [a, c] = m.useState(r.reference), d = fe((f, p, h) => {
2325
- i.current.openEvent = f ? p : void 0, s.emit("openchange", {
2326
- open: f,
2327
- event: p,
2328
- reason: h,
2329
- nested: l
2330
- }), n == null || n(f, p, h);
2331
- }), u = m.useMemo(() => ({
2332
- setPositionReference: c
2333
- }), []), g = m.useMemo(() => ({
2334
- reference: a || r.reference || null,
2335
- floating: r.floating || null,
2336
- domReference: r.reference
2337
- }), [a, r.reference, r.floating]);
2338
- return m.useMemo(() => ({
2339
- dataRef: i,
2340
- open: t,
2341
- onOpenChange: d,
2342
- elements: g,
2343
- events: s,
2344
- floatingId: o,
2345
- refs: u
2346
- }), [t, d, g, s, o, u]);
2347
- }
2348
- function Ci(e) {
2349
- e === void 0 && (e = {});
2350
- const {
2351
- nodeId: t
2352
- } = e, n = Zo({
2353
- ...e,
2354
- elements: {
2355
- reference: null,
2356
- floating: null,
2357
- ...e.elements
2358
- }
2359
- }), r = e.rootContext || n, o = r.elements, [i, s] = m.useState(null), [l, a] = m.useState(null), d = (o == null ? void 0 : o.reference) || i, u = m.useRef(null), g = Et();
2360
- G(() => {
2361
- d && (u.current = d);
2362
- }, [d]);
2363
- const f = Eo({
2364
- ...e,
2365
- elements: {
2366
- ...o,
2367
- ...l && {
2368
- reference: l
2369
- }
2370
- }
2371
- }), p = m.useCallback((b) => {
2372
- const w = U(b) ? {
2373
- getBoundingClientRect: () => b.getBoundingClientRect(),
2374
- contextElement: b
2375
- } : b;
2376
- a(w), f.refs.setReference(w);
2377
- }, [f.refs]), h = m.useCallback((b) => {
2378
- (U(b) || b === null) && (u.current = b, s(b)), (U(f.refs.reference.current) || f.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
2379
- // `null` to support `positionReference` + an unstable `reference`
2380
- // callback ref.
2381
- b !== null && !U(b)) && f.refs.setReference(b);
2382
- }, [f.refs]), y = m.useMemo(() => ({
2383
- ...f.refs,
2384
- setReference: h,
2385
- setPositionReference: p,
2386
- domReference: u
2387
- }), [f.refs, h, p]), x = m.useMemo(() => ({
2388
- ...f.elements,
2389
- domReference: d
2390
- }), [f.elements, d]), E = m.useMemo(() => ({
2391
- ...f,
2392
- ...r,
2393
- refs: y,
2394
- elements: x,
2395
- nodeId: t
2396
- }), [f, y, x, t, r]);
2397
- return G(() => {
2398
- r.dataRef.current.floatingContext = E;
2399
- const b = g == null ? void 0 : g.nodesRef.current.find((w) => w.id === t);
2400
- b && (b.context = E);
2401
- }), m.useMemo(() => ({
2402
- ...f,
2403
- context: E,
2404
- refs: y,
2405
- elements: x
2406
- }), [f, y, x, E]);
2407
- }
2408
- const bn = "active", vn = "selected";
2409
- function Pt(e, t, n) {
2410
- const r = /* @__PURE__ */ new Map(), o = n === "item";
2411
- let i = e;
2412
- if (o && e) {
2413
- const {
2414
- [bn]: s,
2415
- [vn]: l,
2416
- ...a
2417
- } = e;
2418
- i = a;
2419
- }
2420
- return {
2421
- ...n === "floating" && {
2422
- tabIndex: -1,
2423
- [_t]: ""
2424
- },
2425
- ...i,
2426
- ...t.map((s) => {
2427
- const l = s ? s[n] : null;
2428
- return typeof l == "function" ? e ? l(e) : null : l;
2429
- }).concat(e).reduce((s, l) => (l && Object.entries(l).forEach((a) => {
2430
- let [c, d] = a;
2431
- if (!(o && [bn, vn].includes(c)))
2432
- if (c.indexOf("on") === 0) {
2433
- if (r.has(c) || r.set(c, []), typeof d == "function") {
2434
- var u;
2435
- (u = r.get(c)) == null || u.push(d), s[c] = function() {
2436
- for (var g, f = arguments.length, p = new Array(f), h = 0; h < f; h++)
2437
- p[h] = arguments[h];
2438
- return (g = r.get(c)) == null ? void 0 : g.map((y) => y(...p)).find((y) => y !== void 0);
2439
- };
2440
- }
2441
- } else
2442
- s[c] = d;
2443
- }), s), {})
2444
- };
2445
- }
2446
- function Si(e) {
2447
- e === void 0 && (e = []);
2448
- const t = e.map((l) => l == null ? void 0 : l.reference), n = e.map((l) => l == null ? void 0 : l.floating), r = e.map((l) => l == null ? void 0 : l.item), o = m.useCallback(
2449
- (l) => Pt(l, e, "reference"),
2450
- // eslint-disable-next-line react-hooks/exhaustive-deps
2451
- t
2452
- ), i = m.useCallback(
2453
- (l) => Pt(l, e, "floating"),
2454
- // eslint-disable-next-line react-hooks/exhaustive-deps
2455
- n
2456
- ), s = m.useCallback(
2457
- (l) => Pt(l, e, "item"),
2458
- // eslint-disable-next-line react-hooks/exhaustive-deps
2459
- r
2460
- );
2461
- return m.useMemo(() => ({
2462
- getReferenceProps: o,
2463
- getFloatingProps: i,
2464
- getItemProps: s
2465
- }), [o, i, s]);
2466
- }
2467
- let xn = !1;
2468
- function It(e, t, n) {
2469
- switch (e) {
2470
- case "vertical":
2471
- return t;
2472
- case "horizontal":
2473
- return n;
2474
- default:
2475
- return t || n;
2476
- }
2477
- }
2478
- function yn(e, t) {
2479
- return It(t, e === Ut || e === nt, e === Ke || e === qe);
2480
- }
2481
- function Ft(e, t, n) {
2482
- return It(t, e === nt, n ? e === Ke : e === qe) || e === "Enter" || e === " " || e === "";
2483
- }
2484
- function Jo(e, t, n) {
2485
- return It(t, n ? e === Ke : e === qe, e === nt);
2486
- }
2487
- function wn(e, t, n) {
2488
- return It(t, n ? e === qe : e === Ke, e === Ut);
2489
- }
2490
- function Ti(e, t) {
2491
- const {
2492
- open: n,
2493
- onOpenChange: r,
2494
- elements: o
2495
- } = e, {
2496
- listRef: i,
2497
- activeIndex: s,
2498
- onNavigate: l = () => {
2499
- },
2500
- enabled: a = !0,
2501
- selectedIndex: c = null,
2502
- allowEscape: d = !1,
2503
- loop: u = !1,
2504
- nested: g = !1,
2505
- rtl: f = !1,
2506
- virtual: p = !1,
2507
- focusItemOnOpen: h = "auto",
2508
- focusItemOnHover: y = !0,
2509
- openOnArrowKeyDown: x = !0,
2510
- disabledIndices: E = void 0,
2511
- orientation: b = "vertical",
2512
- cols: w = 1,
2513
- scrollItemIntoView: D = !0,
2514
- virtualItemRef: F,
2515
- itemSizes: W,
2516
- dense: _ = !1
2517
- } = t;
2518
- process.env.NODE_ENV !== "production" && (d && (u || Ot("`useListNavigation` looping must be enabled to allow escaping."), p || Ot("`useListNavigation` must be virtual to allow escaping.")), b === "vertical" && w > 1 && Ot("In grid list navigation mode (`cols` > 1), the `orientation` should", 'be either "horizontal" or "both".'));
2519
- const Z = rr(o.floating), K = Ce(Z), $ = Gt(), C = Et(), L = fe(l), A = m.useRef(h), v = m.useRef(c ?? -1), M = m.useRef(null), N = m.useRef(!0), I = m.useRef(L), R = m.useRef(!!o.floating), B = m.useRef(n), J = m.useRef(!1), be = m.useRef(!1), de = Ce(E), V = Ce(n), O = Ce(D), S = Ce(c), [P, q] = m.useState(), [Q, te] = m.useState(), Y = fe(function(k, j, T) {
2520
- T === void 0 && (T = !1);
2521
- function H(z) {
2522
- p ? (q(z.id), C == null || C.events.emit("virtualfocus", z), F && (F.current = z)) : Ie(z, {
2523
- preventScroll: !0,
2524
- // Mac Safari does not move the virtual cursor unless the focus call
2525
- // is sync. However, for the very first focus call, we need to wait
2526
- // for the position to be ready in order to prevent unwanted
2527
- // scrolling. This means the virtual cursor will not move to the first
2528
- // item when first opening the floating element, but will on
2529
- // subsequent calls. `preventScroll` is supported in modern Safari,
2530
- // so we can use that instead.
2531
- // iOS Safari must be async or the first item will not be focused.
2532
- sync: Zr() && Hn() ? xn || J.current : !1
2533
- });
2534
- }
2535
- const ie = k.current[j.current];
2536
- ie && H(ie), requestAnimationFrame(() => {
2537
- const z = k.current[j.current] || ie;
2538
- if (!z) return;
2539
- ie || H(z);
2540
- const pe = O.current;
2541
- pe && ye && (T || !N.current) && (z.scrollIntoView == null || z.scrollIntoView(typeof pe == "boolean" ? {
2542
- block: "nearest",
2543
- inline: "nearest"
2544
- } : pe));
2545
- });
2546
- });
2547
- G(() => {
2548
- document.createElement("div").focus({
2549
- get preventScroll() {
2550
- return xn = !0, !1;
2551
- }
2552
- });
2553
- }, []), G(() => {
2554
- a && (n && o.floating ? A.current && c != null && (be.current = !0, v.current = c, L(c)) : R.current && (v.current = -1, I.current(null)));
2555
- }, [a, n, o.floating, c, L]), G(() => {
2556
- if (a && n && o.floating)
2557
- if (s == null) {
2558
- if (J.current = !1, S.current != null)
2559
- return;
2560
- if (R.current && (v.current = -1, Y(i, v)), (!B.current || !R.current) && A.current && (M.current != null || A.current === !0 && M.current == null)) {
2561
- let k = 0;
2562
- const j = () => {
2563
- i.current[0] == null ? (k < 2 && (k ? requestAnimationFrame : queueMicrotask)(j), k++) : (v.current = M.current == null || Ft(M.current, b, f) || g ? At(i, de.current) : cn(i, de.current), M.current = null, L(v.current));
2564
- };
2565
- j();
2566
- }
2567
- } else Ye(i, s) || (v.current = s, Y(i, v, be.current), be.current = !1);
2568
- }, [a, n, o.floating, s, S, g, i, b, f, L, Y, de]), G(() => {
2569
- var k;
2570
- if (!a || o.floating || !C || p || !R.current)
2571
- return;
2572
- const j = C.nodesRef.current, T = (k = j.find((z) => z.id === $)) == null || (k = k.context) == null ? void 0 : k.elements.floating, H = ve(se(o.floating)), ie = j.some((z) => z.context && ne(z.context.elements.floating, H));
2573
- T && !ie && N.current && T.focus({
2574
- preventScroll: !0
2575
- });
2576
- }, [a, o.floating, C, $, p]), G(() => {
2577
- if (!a || !C || !p || $) return;
2578
- function k(j) {
2579
- te(j.id), F && (F.current = j);
2580
- }
2581
- return C.events.on("virtualfocus", k), () => {
2582
- C.events.off("virtualfocus", k);
2583
- };
2584
- }, [a, C, p, $, F]), G(() => {
2585
- I.current = L, R.current = !!o.floating;
2586
- }), G(() => {
2587
- n || (M.current = null);
2588
- }, [n]), G(() => {
2589
- B.current = n;
2590
- }, [n]);
2591
- const Pe = s != null, ye = m.useMemo(() => {
2592
- function k(T) {
2593
- if (!n) return;
2594
- const H = i.current.indexOf(T);
2595
- H !== -1 && L(H);
2596
- }
2597
- return {
2598
- onFocus(T) {
2599
- let {
2600
- currentTarget: H
2601
- } = T;
2602
- k(H);
2603
- },
2604
- onClick: (T) => {
2605
- let {
2606
- currentTarget: H
2607
- } = T;
2608
- return H.focus({
2609
- preventScroll: !0
2610
- });
2611
- },
2612
- // Safari
2613
- ...y && {
2614
- onMouseMove(T) {
2615
- let {
2616
- currentTarget: H
2617
- } = T;
2618
- k(H);
2619
- },
2620
- onPointerLeave(T) {
2621
- let {
2622
- pointerType: H
2623
- } = T;
2624
- !N.current || H === "touch" || (v.current = -1, Y(i, v), L(null), p || Ie(K.current, {
2625
- preventScroll: !0
2626
- }));
2627
- }
2628
- }
2629
- };
2630
- }, [n, K, Y, y, i, L, p]), oe = fe((k) => {
2631
- if (N.current = !1, J.current = !0, !V.current && k.currentTarget === K.current)
2632
- return;
2633
- if (g && wn(k.key, b, f)) {
2634
- re(k), r(!1, k.nativeEvent, "list-navigation"), X(o.domReference) && !p && o.domReference.focus();
2635
- return;
2636
- }
2637
- const j = v.current, T = At(i, E), H = cn(i, E);
2638
- if (k.key === "Home" && (re(k), v.current = T, L(v.current)), k.key === "End" && (re(k), v.current = H, L(v.current)), w > 1) {
2639
- const ie = W || Array.from({
2640
- length: i.current.length
2641
- }, () => ({
2642
- width: 1,
2643
- height: 1
2644
- })), z = Ao(ie, w, _), pe = z.findIndex((ue) => ue != null && !ut(i.current, ue, E)), rt = z.reduce((ue, Re, ot) => Re != null && !ut(i.current, Re, E) ? ot : ue, -1), Ue = z[To({
2645
- current: z.map((ue) => ue != null ? i.current[ue] : null)
2646
- }, {
2647
- event: k,
2648
- orientation: b,
2649
- loop: u,
2650
- cols: w,
2651
- // treat undefined (empty grid spaces) as disabled indices so we
2652
- // don't end up in them
2653
- disabledIndices: Mo([...E || i.current.map((ue, Re) => ut(i.current, Re) ? Re : void 0), void 0], z),
2654
- minIndex: pe,
2655
- maxIndex: rt,
2656
- prevIndex: Oo(
2657
- v.current > H ? T : v.current,
2658
- ie,
2659
- z,
2660
- w,
2661
- // use a corner matching the edge closest to the direction
2662
- // we're moving in so we don't end up in the same item. Prefer
2663
- // top/left over bottom/right.
2664
- k.key === nt ? "bl" : k.key === qe ? "tr" : "tl"
2665
- ),
2666
- stopEvent: !0
2667
- })];
2668
- if (Ue != null && (v.current = Ue, L(v.current)), b === "both")
2669
- return;
2670
- }
2671
- if (yn(k.key, b)) {
2672
- if (re(k), n && !p && ve(k.currentTarget.ownerDocument) === k.currentTarget) {
2673
- v.current = Ft(k.key, b, f) ? T : H, L(v.current);
2674
- return;
2675
- }
2676
- Ft(k.key, b, f) ? u ? v.current = j >= H ? d && j !== i.current.length ? -1 : T : ee(i, {
2677
- startingIndex: j,
2678
- disabledIndices: E
2679
- }) : v.current = Math.min(H, ee(i, {
2680
- startingIndex: j,
2681
- disabledIndices: E
2682
- })) : u ? v.current = j <= T ? d && j !== -1 ? i.current.length : H : ee(i, {
2683
- startingIndex: j,
2684
- decrement: !0,
2685
- disabledIndices: E
2686
- }) : v.current = Math.max(T, ee(i, {
2687
- startingIndex: j,
2688
- decrement: !0,
2689
- disabledIndices: E
2690
- })), Ye(i, v.current) ? L(null) : L(v.current);
2691
- }
2692
- }), we = m.useMemo(() => p && n && Pe && {
2693
- "aria-activedescendant": Q || P
2694
- }, [p, n, Pe, Q, P]), me = m.useMemo(() => ({
2695
- "aria-orientation": b === "both" ? void 0 : b,
2696
- ...!zn(o.domReference) && we,
2697
- onKeyDown: oe,
2698
- onPointerMove() {
2699
- N.current = !0;
2700
- }
2701
- }), [we, oe, o.domReference, b]), je = m.useMemo(() => {
2702
- function k(T) {
2703
- h === "auto" && $n(T.nativeEvent) && (A.current = !0);
2704
- }
2705
- function j(T) {
2706
- A.current = h, h === "auto" && Kn(T.nativeEvent) && (A.current = !0);
2707
- }
2708
- return {
2709
- ...we,
2710
- onKeyDown(T) {
2711
- N.current = !1;
2712
- const H = T.key.indexOf("Arrow") === 0, ie = Jo(T.key, b, f), z = wn(T.key, b, f), pe = yn(T.key, b), rt = (g ? ie : pe) || T.key === "Enter" || T.key.trim() === "";
2713
- if (p && n) {
2714
- const ot = C == null ? void 0 : C.nodesRef.current.find((it) => it.parentId == null), Ee = C && ot ? _o(C.nodesRef.current, ot.id) : null;
2715
- if (H && Ee && F) {
2716
- const it = new KeyboardEvent("keydown", {
2717
- key: T.key,
2718
- bubbles: !0
2719
- });
2720
- if (ie || z) {
2721
- var Ue, ue;
2722
- const cr = ((Ue = Ee.context) == null ? void 0 : Ue.elements.domReference) === T.currentTarget, Jt = z && !cr ? (ue = Ee.context) == null ? void 0 : ue.elements.domReference : ie ? i.current.find((Qt) => (Qt == null ? void 0 : Qt.id) === P) : null;
2723
- Jt && (re(T), Jt.dispatchEvent(it), te(void 0));
2724
- }
2725
- if (pe && Ee.context && Ee.context.open && Ee.parentId && T.currentTarget !== Ee.context.elements.domReference) {
2726
- var Re;
2727
- re(T), (Re = Ee.context.elements.domReference) == null || Re.dispatchEvent(it);
2728
- return;
2729
- }
2730
- }
2731
- return oe(T);
2732
- }
2733
- if (!(!n && !x && H)) {
2734
- if (rt && (M.current = g && pe ? null : T.key), g) {
2735
- ie && (re(T), n ? (v.current = At(i, de.current), L(v.current)) : r(!0, T.nativeEvent, "list-navigation"));
2736
- return;
2737
- }
2738
- pe && (c != null && (v.current = c), re(T), !n && x ? r(!0, T.nativeEvent, "list-navigation") : oe(T), n && L(v.current));
2739
- }
2740
- },
2741
- onFocus() {
2742
- n && !p && L(null);
2743
- },
2744
- onPointerDown: j,
2745
- onMouseDown: k,
2746
- onClick: k
2747
- };
2748
- }, [P, we, oe, de, h, i, g, L, r, n, x, b, f, c, C, p, F]);
2749
- return m.useMemo(() => a ? {
2750
- reference: je,
2751
- floating: me,
2752
- item: ye
2753
- } : {}, [a, je, me, ye]);
2754
- }
2755
- const Qo = /* @__PURE__ */ new Map([["select", "listbox"], ["combobox", "listbox"], ["label", !1]]);
2756
- function Ai(e, t) {
2757
- var n;
2758
- t === void 0 && (t = {});
2759
- const {
2760
- open: r,
2761
- floatingId: o
2762
- } = e, {
2763
- enabled: i = !0,
2764
- role: s = "dialog"
2765
- } = t, l = (n = Qo.get(s)) != null ? n : s, a = Yt(), d = Gt() != null, u = m.useMemo(() => l === "tooltip" || s === "label" ? {
2766
- ["aria-" + (s === "label" ? "labelledby" : "describedby")]: r ? o : void 0
2767
- } : {
2768
- "aria-expanded": r ? "true" : "false",
2769
- "aria-haspopup": l === "alertdialog" ? "dialog" : l,
2770
- "aria-controls": r ? o : void 0,
2771
- ...l === "listbox" && {
2772
- role: "combobox"
2773
- },
2774
- ...l === "menu" && {
2775
- id: a
2776
- },
2777
- ...l === "menu" && d && {
2778
- role: "menuitem"
2779
- },
2780
- ...s === "select" && {
2781
- "aria-autocomplete": "none"
2782
- },
2783
- ...s === "combobox" && {
2784
- "aria-autocomplete": "list"
2785
- }
2786
- }, [l, o, d, r, a, s]), g = m.useMemo(() => {
2787
- const p = {
2788
- id: o,
2789
- ...l && {
2790
- role: l
2791
- }
2792
- };
2793
- return l === "tooltip" || s === "label" ? p : {
2794
- ...p,
2795
- ...l === "menu" && {
2796
- "aria-labelledby": a
2797
- }
2798
- };
2799
- }, [l, o, a, s]), f = m.useCallback((p) => {
2800
- let {
2801
- active: h,
2802
- selected: y
2803
- } = p;
2804
- const x = {
2805
- role: "option",
2806
- ...h && {
2807
- id: o + "-option"
2808
- }
2809
- };
2810
- switch (s) {
2811
- case "select":
2812
- return {
2813
- ...x,
2814
- "aria-selected": h && y
2815
- };
2816
- case "combobox":
2817
- return {
2818
- ...x,
2819
- ...h && {
2820
- "aria-selected": !0
2821
- }
2822
- };
2823
- }
2824
- return {};
2825
- }, [o, s]);
2826
- return m.useMemo(() => i ? {
2827
- reference: u,
2828
- floating: g,
2829
- item: f
2830
- } : {}, [i, u, g, f]);
2831
- }
2832
- const ei = Wt(void 0), or = Wt({
2833
- activeIndex: 0
2834
- }), ti = (e, t) => {
2835
- switch (t.type) {
2836
- case "SET_ACTIVE_INDEX":
2837
- return {
2838
- ...e,
2839
- activeIndex: t.payload
2840
- };
2841
- default:
2842
- return e;
2843
- }
2844
- }, ir = Wt(() => {
2845
- throw new Error("ComboboxIdDispatch must be used within a provider");
2846
- }), Oi = ({ children: e }) => {
2847
- const [t, n] = ar(ti, {
2848
- activeIndex: 0
2849
- });
2850
- return Ae(or.Provider, { value: t, children: Ae(ir.Provider, { value: n, children: e }) });
2851
- };
2852
- function Mi() {
2853
- return $t(ir);
2854
- }
2855
- function ni() {
2856
- return $t(or);
2857
- }
2858
- const Rn = (e, t) => {
2859
- const n = {}, r = {};
2860
- let o = 0;
2861
- const i = e.length;
2862
- for (; o < i; )
2863
- r[e[o]] = 1, o += 1;
2864
- for (const s in t)
2865
- Object.prototype.hasOwnProperty.call(r, s) || (n[s] = t[s]);
2866
- return n;
2867
- }, ri = Je(({ asChild: e, interactive: t, id: n, className: r, ...o }, i) => {
2868
- if (t && !n)
2869
- throw new Error("If ComboboxCustom is interactive, it must have an id");
2870
- const s = e ? mr : "div", l = ur(), { activeIndex: a } = ni(), c = $t(ei);
2871
- if (!c)
2872
- throw new Error("ComboboxCustom must be used within a Combobox");
2873
- const { customIds: d, setListRef: u, getItemProps: g, size: f } = c, p = fr(() => n && d.indexOf(n) || 0, [n, d]), h = Io([
2874
- (y) => {
2875
- u(p, y);
2876
- },
2877
- i
2878
- ]);
2879
- return Ae(pr, { "data-size": f, asChild: !0, children: Ae(s, { ref: h, tabIndex: -1, className: En("ds-combobox__custom", r), id: n || l, role: "option", "aria-selected": a === p, "data-active": a === p, ...Rn(["interactive"], o), ...Rn(["onClick", "onPointerLeave"], g()) }) });
2880
- });
2881
- function oi(e) {
2882
- return dr(e) && e.type === ri;
2883
- }
2884
- function Di(e) {
2885
- return oi(e) && e.props.interactive === !0;
2886
- }
2887
- const sr = "internal-option-", Pi = (e) => sr + e, Fi = (e) => e.slice(sr.length), ii = (e, t) => {
2888
- const n = e.value;
2889
- e.value = t;
2890
- const r = e._valueTracker;
2891
- typeof r < "u" && r.setValue(n), e.dispatchEvent(new Event("change", { bubbles: !0 }));
2892
- }, si = Je(function({ "aria-label": t = "Tøm", onClick: n, ...r }, o) {
2893
- return Ae(Sn, { ref: o, variant: "tertiary", type: "reset", "aria-label": t, onClick: (s) => {
2894
- var c;
2895
- const l = s.target;
2896
- let a = null;
2897
- if (l instanceof HTMLElement && (a = (c = l.closest(".ds-search")) == null ? void 0 : c.querySelector("input")), !a)
2898
- throw new Error("Input is missing");
2899
- if (!(a instanceof HTMLInputElement))
2900
- throw new Error("Input is not an input element");
2901
- s.preventDefault(), ii(a, ""), a.focus(), n == null || n(s);
2902
- }, icon: !0, ...r });
2903
- }), ci = Je(function({ children: t = "Søk", ...n }, r) {
2904
- return Ae(Sn, { ref: r, type: "submit", ...n, children: t });
2905
- }), li = Je(function({ ...t }, n) {
2906
- return Ae(gr, {
2907
- ref: n,
2908
- type: "search",
2909
- /* We need an empty placeholder for the clear button to be able to show/hide */
2910
- placeholder: "",
2911
- ...t
2912
- });
2913
- }), ai = Je(function({ className: t, ...n }, r) {
2914
- return Ae("div", { ref: r, className: En("ds-search", t), ...n });
2915
- }), Zt = Object.assign(ai, {
2916
- Clear: si,
2917
- Button: ci,
2918
- Input: li
2919
- });
2920
- Zt.Clear.displayName = "Search.Clear";
2921
- Zt.Button.displayName = "Search.Button";
2922
- Zt.Input.displayName = "Search.Input";
2923
- export {
2924
- ei as C,
2925
- Ri as F,
2926
- Zt as S,
2927
- bi as a,
2928
- Io as b,
2929
- Xr as c,
2930
- Rn as d,
2931
- ni as e,
2932
- Yr as f,
2933
- Ci as g,
2934
- Ai as h,
2935
- Di as i,
2936
- Ii as j,
2937
- Ti as k,
2938
- Si as l,
2939
- yi as m,
2940
- wi as n,
2941
- Ur as o,
2942
- Pi as p,
2943
- xi as q,
2944
- Fi as r,
2945
- vi as s,
2946
- Oi as t,
2947
- Mi as u,
2948
- ii as v,
2949
- Ei as w,
2950
- ri as x
2951
- };