@servicetitan/anvil2 1.3.3 → 1.3.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.
- package/Alert-673d75aa.cjs +2 -0
- package/Alert-673d75aa.cjs.map +1 -0
- package/{Alert-012e475c.js → Alert-85a791c2.js} +29 -27
- package/Alert-85a791c2.js.map +1 -0
- package/Alert.cjs +1 -1
- package/Alert.js +1 -1
- package/Announcement.cjs +1 -1
- package/Announcement.cjs.map +1 -1
- package/Announcement.js +99 -15
- package/Announcement.js.map +1 -1
- package/AnvilProvider.cjs +1 -1
- package/AnvilProvider.js +1 -1
- package/Avatar.cjs +1 -1
- package/Avatar.cjs.map +1 -1
- package/Avatar.js +127 -12
- package/Avatar.js.map +1 -1
- package/Badge.cjs +1 -1
- package/Badge.cjs.map +1 -1
- package/Badge.js +47 -7
- package/Badge.js.map +1 -1
- package/Button.cjs +1 -1
- package/Button.cjs.map +1 -1
- package/Button.js +14 -40
- package/Button.js.map +1 -1
- package/ButtonCompound.cjs +1 -1
- package/ButtonCompound.cjs.map +1 -1
- package/ButtonCompound.js +13 -39
- package/ButtonCompound.js.map +1 -1
- package/ButtonLink.cjs +1 -1
- package/ButtonLink.cjs.map +1 -1
- package/ButtonLink.js +14 -40
- package/ButtonLink.js.map +1 -1
- package/ButtonToggle.cjs +1 -1
- package/ButtonToggle.cjs.map +1 -1
- package/ButtonToggle.js +14 -40
- package/ButtonToggle.js.map +1 -1
- package/Calendar.cjs +1 -1
- package/Calendar.cjs.map +1 -1
- package/Calendar.js +5812 -24
- package/Calendar.js.map +1 -1
- package/Card.cjs +1 -1
- package/Card.cjs.map +1 -1
- package/Card.js +52 -6
- package/Card.js.map +1 -1
- package/Checkbox-634c4d3d.js +164 -0
- package/Checkbox-634c4d3d.js.map +1 -0
- package/Checkbox-d1db5a71.cjs +2 -0
- package/Checkbox-d1db5a71.cjs.map +1 -0
- package/Checkbox.cjs +1 -1
- package/Checkbox.cjs.map +1 -1
- package/Checkbox.css +1 -0
- package/Checkbox.js +23 -49
- package/Checkbox.js.map +1 -1
- package/{Chip-6dde28bc.js → Chip-73b032eb.js} +36 -34
- package/Chip-73b032eb.js.map +1 -0
- package/Chip-88873569.cjs +2 -0
- package/Chip-88873569.cjs.map +1 -0
- package/Chip.cjs +1 -1
- package/Chip.js +1 -1
- package/Combobox.cjs +41 -1
- package/Combobox.cjs.map +1 -1
- package/Combobox.js +4177 -76
- package/Combobox.js.map +1 -1
- package/Details.cjs +1 -1
- package/Details.cjs.map +1 -1
- package/Details.js +153 -50
- package/Details.js.map +1 -1
- package/Dialog-1984afe2.js +214 -0
- package/Dialog-1984afe2.js.map +1 -0
- package/Dialog-de6969a2.cjs +2 -0
- package/Dialog-de6969a2.cjs.map +1 -0
- package/Dialog.cjs +1 -1
- package/Dialog.cjs.map +1 -1
- package/Dialog.css +1 -0
- package/Dialog.js +38 -64
- package/Dialog.js.map +1 -1
- package/Divider.cjs +1 -1
- package/Divider.cjs.map +1 -1
- package/Divider.js +76 -7
- package/Divider.js.map +1 -1
- package/Drawer.cjs +1 -1
- package/Drawer.cjs.map +1 -1
- package/Drawer.js +242 -70
- package/Drawer.js.map +1 -1
- package/{Flex-d338e855.js → Flex-d06c75c0.js} +18 -17
- package/Flex-d06c75c0.js.map +1 -0
- package/Flex-da1ad9db.cjs +2 -0
- package/Flex-da1ad9db.cjs.map +1 -0
- package/Flex.cjs +1 -1
- package/Flex.js +1 -1
- package/Grid.cjs +1 -1
- package/Grid.cjs.map +1 -1
- package/Grid.js +90 -6
- package/Grid.js.map +1 -1
- package/{Helper-74a1f07f-61317df2.cjs → Helper-74a1f07f-8fcd0721.cjs} +2 -2
- package/{Helper-74a1f07f-61317df2.cjs.map → Helper-74a1f07f-8fcd0721.cjs.map} +1 -1
- package/{Helper-74a1f07f-092263c4.js → Helper-74a1f07f-d017affe.js} +3 -3
- package/{Helper-74a1f07f-092263c4.js.map → Helper-74a1f07f-d017affe.js.map} +1 -1
- package/Icon-847b3515.cjs +2 -0
- package/Icon-847b3515.cjs.map +1 -0
- package/{Icon-b94f924c.js → Icon-be690f0b.js} +13 -12
- package/Icon-be690f0b.js.map +1 -0
- package/Icon.cjs +1 -1
- package/Icon.js +1 -1
- package/Label-854a39e4.js +47 -0
- package/Label-854a39e4.js.map +1 -0
- package/Label-e2593298.cjs +2 -0
- package/Label-e2593298.cjs.map +1 -0
- package/Label.css +1 -0
- package/Layout.cjs +1 -1
- package/Layout.cjs.map +1 -1
- package/Layout.js +21 -21
- package/Layout.js.map +1 -1
- package/Link.cjs +1 -1
- package/Link.cjs.map +1 -1
- package/Link.js +17 -43
- package/Link.js.map +1 -1
- package/ListView.cjs +1 -1
- package/ListView.cjs.map +1 -1
- package/ListView.css +1 -1
- package/ListView.js +412 -24
- package/ListView.js.map +1 -1
- package/ListView.module-854f2491-1f87d388.cjs +2 -0
- package/ListView.module-854f2491-1f87d388.cjs.map +1 -0
- package/ListView.module-854f2491-c5eba193.js +11 -0
- package/ListView.module-854f2491-c5eba193.js.map +1 -0
- package/Listbox.cjs +1 -1
- package/Listbox.cjs.map +1 -1
- package/Listbox.js +403 -25
- package/Listbox.js.map +1 -1
- package/Listbox.module-2120a0a7-794d64a0.cjs +2 -0
- package/Listbox.module-2120a0a7-794d64a0.cjs.map +1 -0
- package/Listbox.module-2120a0a7-aa22f0ed.js +13 -0
- package/Listbox.module-2120a0a7-aa22f0ed.js.map +1 -0
- package/LocalizationProvider.cjs +1 -1
- package/LocalizationProvider.cjs.map +1 -1
- package/LocalizationProvider.js +11 -10
- package/LocalizationProvider.js.map +1 -1
- package/Menu.cjs +1 -1
- package/Menu.cjs.map +1 -1
- package/Menu.js +320 -51
- package/Menu.js.map +1 -1
- package/Overflow-057bbf4e.cjs +2 -0
- package/Overflow-057bbf4e.cjs.map +1 -0
- package/Overflow-a026904d.js +249 -0
- package/Overflow-a026904d.js.map +1 -0
- package/Overflow.cjs +1 -1
- package/Overflow.cjs.map +1 -1
- package/Overflow.css +1 -0
- package/Overflow.js +23 -49
- package/Overflow.js.map +1 -1
- package/Page.cjs +1 -1
- package/Page.cjs.map +1 -1
- package/Page.js +12 -11
- package/Page.js.map +1 -1
- package/Popover-aaeea980.js +272 -0
- package/Popover-aaeea980.js.map +1 -0
- package/Popover-e336dabc.cjs +2 -0
- package/Popover-e336dabc.cjs.map +1 -0
- package/Popover.cjs +1 -1
- package/Popover.cjs.map +1 -1
- package/Popover.css +1 -0
- package/Popover.js +34 -60
- package/Popover.js.map +1 -1
- package/ProgressBar.cjs +1 -1
- package/ProgressBar.cjs.map +1 -1
- package/ProgressBar.js +121 -7
- package/ProgressBar.js.map +1 -1
- package/Radio.cjs +1 -1
- package/Radio.cjs.map +1 -1
- package/Radio.js +142 -50
- package/Radio.js.map +1 -1
- package/SegmentedControl.cjs +1 -1
- package/SegmentedControl.cjs.map +1 -1
- package/SegmentedControl.js +133 -58
- package/SegmentedControl.js.map +1 -1
- package/SideNav.cjs +1 -29
- package/SideNav.cjs.map +1 -1
- package/SideNav.js +258 -1139
- package/SideNav.js.map +1 -1
- package/SrOnly-0c7fd87a.js +13 -0
- package/{SrOnly-864bd4cb.js.map → SrOnly-0c7fd87a.js.map} +1 -1
- package/SrOnly-91a467dc.cjs +2 -0
- package/{SrOnly-88e8fca6.cjs.map → SrOnly-91a467dc.cjs.map} +1 -1
- package/SrOnly.cjs +1 -1
- package/SrOnly.js +1 -1
- package/Stepper.cjs +1 -1
- package/Stepper.cjs.map +1 -1
- package/Stepper.js +430 -47
- package/Stepper.js.map +1 -1
- package/Switch.cjs +1 -1
- package/Switch.cjs.map +1 -1
- package/Switch.js +67 -44
- package/Switch.js.map +1 -1
- package/Tab.cjs +9 -1
- package/Tab.cjs.map +1 -1
- package/Tab.js +436 -24
- package/Tab.js.map +1 -1
- package/{Text-465104f6.js → Text-08c90c22.js} +30 -29
- package/Text-08c90c22.js.map +1 -0
- package/Text-8ed03ac7.cjs +2 -0
- package/Text-8ed03ac7.cjs.map +1 -0
- package/Text.cjs +1 -1
- package/Text.js +1 -1
- package/TextField.cjs +1 -1
- package/TextField.cjs.map +1 -1
- package/TextField.js +156 -47
- package/TextField.js.map +1 -1
- package/Textarea.cjs +1 -1
- package/Textarea.cjs.map +1 -1
- package/Textarea.js +260 -45
- package/Textarea.js.map +1 -1
- package/ThemeProvider.cjs +1 -1
- package/ThemeProvider.js +1 -1
- package/Toast.cjs +8 -1
- package/Toast.cjs.map +1 -1
- package/Toast.js +568 -9
- package/Toast.js.map +1 -1
- package/Tooltip-2ecbf35e.cjs +2 -0
- package/Tooltip-2ecbf35e.cjs.map +1 -0
- package/Tooltip-dcc5d45c.js +157 -0
- package/Tooltip-dcc5d45c.js.map +1 -0
- package/Tooltip.cjs +1 -1
- package/Tooltip.cjs.map +1 -1
- package/Tooltip.css +1 -0
- package/Tooltip.js +18 -44
- package/Tooltip.js.map +1 -1
- package/anvil2.cjs +1 -1
- package/anvil2.d.ts +18 -6
- package/anvil2.js +161 -183
- package/anvil2.js.map +1 -1
- package/check_circle-48e002d3-0d49b2da.cjs +2 -0
- package/check_circle-48e002d3-0d49b2da.cjs.map +1 -0
- package/check_circle-48e002d3-5838521c.js +7 -0
- package/check_circle-48e002d3-5838521c.js.map +1 -0
- package/chevron_right-5b0931b5-96f8a9c6.cjs +2 -0
- package/chevron_right-5b0931b5-96f8a9c6.cjs.map +1 -0
- package/chevron_right-5b0931b5-ac35ad56.js +6 -0
- package/chevron_right-5b0931b5-ac35ad56.js.map +1 -0
- package/childrenToString-0cd30a27.cjs +2 -0
- package/childrenToString-0cd30a27.cjs.map +1 -0
- package/childrenToString-416df522.js +19 -0
- package/childrenToString-416df522.js.map +1 -0
- package/extends-31d75778.js +27 -0
- package/extends-31d75778.js.map +1 -0
- package/extends-60b54772.cjs +2 -0
- package/extends-60b54772.cjs.map +1 -0
- package/getKeyboardFocusableElements-58a00025.js +14 -0
- package/getKeyboardFocusableElements-58a00025.js.map +1 -0
- package/getKeyboardFocusableElements-aba1bd01.cjs +2 -0
- package/getKeyboardFocusableElements-aba1bd01.cjs.map +1 -0
- package/index-04060912.js +3677 -0
- package/index-04060912.js.map +1 -0
- package/index-06c0bdf0.js +480 -0
- package/index-06c0bdf0.js.map +1 -0
- package/index-11b6ca91-14b4e485.js +63 -0
- package/index-11b6ca91-14b4e485.js.map +1 -0
- package/index-11b6ca91-d30fd1d3.cjs +2 -0
- package/index-11b6ca91-d30fd1d3.cjs.map +1 -0
- package/{index-acdc415f.cjs → index-1f4f169d.cjs} +2 -2
- package/{index-acdc415f.cjs.map → index-1f4f169d.cjs.map} +1 -1
- package/index-40821bc4.cjs +2 -0
- package/index-40821bc4.cjs.map +1 -0
- package/{index-ab05dabf.js → index-47e4931c.js} +3 -3
- package/{index-ab05dabf.js.map → index-47e4931c.js.map} +1 -1
- package/index-49242812.js +59 -0
- package/index-49242812.js.map +1 -0
- package/index-69174413.cjs +5 -0
- package/index-69174413.cjs.map +1 -0
- package/index-902bf2b0.js +56 -0
- package/index-902bf2b0.js.map +1 -0
- package/index-a53df036.cjs +2 -0
- package/index-a53df036.cjs.map +1 -0
- package/{index-e0f6271a.js → index-c6e22bb9.js} +6 -6
- package/{index-e0f6271a.js.map → index-c6e22bb9.js.map} +1 -1
- package/index-dcf78e3f.cjs +2 -0
- package/index-dcf78e3f.cjs.map +1 -0
- package/{index-3a4e28a9-3d7ba14f.js → index-eb2e706f-03380994.js} +19 -18
- package/index-eb2e706f-03380994.js.map +1 -0
- package/index-eb2e706f-ff6c4157.cjs +2 -0
- package/index-eb2e706f-ff6c4157.cjs.map +1 -0
- package/{index-67d20edb.cjs → index-ef2e9d11.cjs} +2 -2
- package/{index-67d20edb.cjs.map → index-ef2e9d11.cjs.map} +1 -1
- package/index.css +1 -1
- package/index11.css +1 -0
- package/index12.css +1 -0
- package/index13.css +1 -0
- package/index14.css +1 -0
- package/index15.css +1 -0
- package/index16.css +1 -0
- package/index18.css +1 -0
- package/index19.css +1 -0
- package/index2.css +1 -1
- package/index21.css +1 -0
- package/index22.css +1 -0
- package/index24.css +1 -0
- package/index3.css +1 -1
- package/index6.css +1 -0
- package/index7.css +1 -0
- package/index9.css +1 -0
- package/info-af4c0112-9f16129f.cjs +2 -0
- package/info-af4c0112-9f16129f.cjs.map +1 -0
- package/info-af4c0112-f73c8f68.js +6 -0
- package/info-af4c0112-f73c8f68.js.map +1 -0
- package/package.json +2 -2
- package/tinycolor-3b50a250.cjs +2 -0
- package/tinycolor-3b50a250.cjs.map +1 -0
- package/tinycolor-d415b1fd.js +712 -0
- package/tinycolor-d415b1fd.js.map +1 -0
- package/token.cjs +1 -1
- package/token.js +1 -1
- package/useAccessibleColor.cjs +1 -1
- package/useAccessibleColor.cjs.map +1 -1
- package/useAccessibleColor.d.ts +1 -1
- package/useAccessibleColor.js +36 -32
- package/useAccessibleColor.js.map +1 -1
- package/useLayoutPropsUtil-cd33328b.cjs +2 -0
- package/useLayoutPropsUtil-cd33328b.cjs.map +1 -0
- package/useLayoutPropsUtil-f34e9597.js +160 -0
- package/useLayoutPropsUtil-f34e9597.js.map +1 -0
- package/useLinkStyles.cjs +1 -1
- package/useLinkStyles.d.ts +2 -2
- package/useLinkStyles.js +3 -31
- package/useLinkStyles.js.map +1 -1
- package/useMergeRefs.cjs +1 -1
- package/useMergeRefs.d.ts +1 -1
- package/useMergeRefs.js +3 -32
- package/useMergeRefs.js.map +1 -1
- package/usePrefersColorScheme.cjs +1 -1
- package/usePrefersColorScheme.cjs.map +1 -1
- package/usePrefersColorScheme.d.ts +1 -1
- package/usePrefersColorScheme.js +19 -32
- package/usePrefersColorScheme.js.map +1 -1
- package/useSwipe.cjs +1 -1
- package/useSwipe.cjs.map +1 -1
- package/useSwipe.d.ts +1 -1
- package/useSwipe.js +15 -32
- package/useSwipe.js.map +1 -1
- package/Alert-012e475c.js.map +0 -1
- package/Alert-066f00f2.cjs +0 -2
- package/Alert-066f00f2.cjs.map +0 -1
- package/Announcement-cd9602ed.cjs +0 -2
- package/Announcement-cd9602ed.cjs.map +0 -1
- package/Announcement-f9b09ba3.js +0 -88
- package/Announcement-f9b09ba3.js.map +0 -1
- package/Announcement.css +0 -1
- package/Badge-b8764640.cjs +0 -2
- package/Badge-b8764640.cjs.map +0 -1
- package/Badge-df96f15a.js +0 -45
- package/Badge-df96f15a.js.map +0 -1
- package/Badge.css +0 -1
- package/Calendar-31bcb381.js +0 -5797
- package/Calendar-31bcb381.js.map +0 -1
- package/Calendar-d0baf4b1.cjs +0 -2
- package/Calendar-d0baf4b1.cjs.map +0 -1
- package/Card-20628287.cjs +0 -2
- package/Card-20628287.cjs.map +0 -1
- package/Card-bb358803.js +0 -51
- package/Card-bb358803.js.map +0 -1
- package/Chip-5b63e48c.cjs +0 -2
- package/Chip-5b63e48c.cjs.map +0 -1
- package/Chip-6dde28bc.js.map +0 -1
- package/Divider-6646eeb8.cjs +0 -2
- package/Divider-6646eeb8.cjs.map +0 -1
- package/Divider-b3bff73a.js +0 -74
- package/Divider-b3bff73a.js.map +0 -1
- package/Flex-971b5295.cjs +0 -2
- package/Flex-971b5295.cjs.map +0 -1
- package/Flex-d338e855.js.map +0 -1
- package/Grid-37ded954.cjs +0 -2
- package/Grid-37ded954.cjs.map +0 -1
- package/Grid-5bad450f.js +0 -89
- package/Grid-5bad450f.js.map +0 -1
- package/Icon-57c31c9b.cjs +0 -2
- package/Icon-57c31c9b.cjs.map +0 -1
- package/Icon-b94f924c.js.map +0 -1
- package/ListView-3b1adecb.js +0 -557
- package/ListView-3b1adecb.js.map +0 -1
- package/ListView-88e49b19.cjs +0 -2
- package/ListView-88e49b19.cjs.map +0 -1
- package/Listbox-60fbdaa1.js +0 -394
- package/Listbox-60fbdaa1.js.map +0 -1
- package/Listbox-cd5c4185.cjs +0 -2
- package/Listbox-cd5c4185.cjs.map +0 -1
- package/ProgressBar-c1b5c7c3.js +0 -516
- package/ProgressBar-c1b5c7c3.js.map +0 -1
- package/ProgressBar-fa511478.cjs +0 -2
- package/ProgressBar-fa511478.cjs.map +0 -1
- package/ProgressBar.css +0 -1
- package/SideNav-33a404ec.js +0 -935
- package/SideNav-33a404ec.js.map +0 -1
- package/SideNav-47435e45.cjs +0 -21
- package/SideNav-47435e45.cjs.map +0 -1
- package/SrOnly-864bd4cb.js +0 -13
- package/SrOnly-88e8fca6.cjs +0 -2
- package/Stepper-7e3a130c.js +0 -633
- package/Stepper-7e3a130c.js.map +0 -1
- package/Stepper-8675700c.cjs +0 -2
- package/Stepper-8675700c.cjs.map +0 -1
- package/Stepper.css +0 -1
- package/Tab-1fce1d41.js +0 -422
- package/Tab-1fce1d41.js.map +0 -1
- package/Tab-f843e740.cjs +0 -10
- package/Tab-f843e740.cjs.map +0 -1
- package/Text-465104f6.js.map +0 -1
- package/Text-631c229a.cjs +0 -2
- package/Text-631c229a.cjs.map +0 -1
- package/Toast-32a4ab22.cjs +0 -9
- package/Toast-32a4ab22.cjs.map +0 -1
- package/Toast-6cd7d2e1.js +0 -566
- package/Toast-6cd7d2e1.js.map +0 -1
- package/check_circle-48e002d3-0554de7d.js +0 -8
- package/check_circle-48e002d3-0554de7d.js.map +0 -1
- package/check_circle-48e002d3-57364fcd.cjs +0 -2
- package/check_circle-48e002d3-57364fcd.cjs.map +0 -1
- package/floating-ui.react-51a3fa68.js +0 -23242
- package/floating-ui.react-51a3fa68.js.map +0 -1
- package/floating-ui.react-5347095a.cjs +0 -178
- package/floating-ui.react-5347095a.cjs.map +0 -1
- package/index-3a4e28a9-3d7ba14f.js.map +0 -1
- package/index-3a4e28a9-b649e635.cjs +0 -2
- package/index-3a4e28a9-b649e635.cjs.map +0 -1
- package/index-3f218083.js +0 -58
- package/index-3f218083.js.map +0 -1
- package/index-63e13299.cjs +0 -2
- package/index-63e13299.cjs.map +0 -1
- package/index-9948e3af.cjs +0 -23
- package/index-9948e3af.cjs.map +0 -1
- package/index-d46fa8de-c02f7a12.cjs +0 -2
- package/index-d46fa8de-c02f7a12.cjs.map +0 -1
- package/index-d46fa8de-f8bf17b6.js +0 -540
- package/index-d46fa8de-f8bf17b6.js.map +0 -1
- package/index-f7658447-1cfbda8f.js +0 -120
- package/index-f7658447-1cfbda8f.js.map +0 -1
- package/index-f7658447-f447ade8.cjs +0 -2
- package/index-f7658447-f447ade8.cjs.map +0 -1
- package/index-f7658447.css +0 -1
- package/index-ff5fea63.js +0 -5015
- package/index-ff5fea63.js.map +0 -1
- package/useLayoutPropsUtil-e307abc7-3826ee09.cjs +0 -2
- package/useLayoutPropsUtil-e307abc7-3826ee09.cjs.map +0 -1
- package/useLayoutPropsUtil-e307abc7-cbe2fb6d.js +0 -869
- package/useLayoutPropsUtil-e307abc7-cbe2fb6d.js.map +0 -1
- package/usePrefersColorScheme-129544ad-59e2e284.cjs +0 -2
- package/usePrefersColorScheme-129544ad-59e2e284.cjs.map +0 -1
- package/usePrefersColorScheme-129544ad-cab6fc3f.js +0 -55
- package/usePrefersColorScheme-129544ad-cab6fc3f.js.map +0 -1
- package/useSwipe-82769b09-835234e6.js +0 -17
- package/useSwipe-82769b09-835234e6.js.map +0 -1
- package/useSwipe-82769b09-dba26ed2.cjs +0 -2
- package/useSwipe-82769b09-dba26ed2.cjs.map +0 -1
- /package/{index-3a4e28a9.css → index-eb2e706f.css} +0 -0
- /package/{Grid.css → index10.css} +0 -0
- /package/{SideNav.css → index17.css} +0 -0
- /package/{Tab.css → index20.css} +0 -0
- /package/{Toast.css → index23.css} +0 -0
- /package/{Calendar.css → index4.css} +0 -0
- /package/{Card.css → index5.css} +0 -0
- /package/{Divider.css → index8.css} +0 -0
|
@@ -0,0 +1,3677 @@
|
|
|
1
|
+
import * as d from "react";
|
|
2
|
+
import { useLayoutEffect as Tn, useEffect as On, useRef as sr } from "react";
|
|
3
|
+
import * as Sn from "react-dom";
|
|
4
|
+
function Le(e) {
|
|
5
|
+
return Mn(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
6
|
+
}
|
|
7
|
+
function ae(e) {
|
|
8
|
+
var t;
|
|
9
|
+
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
10
|
+
}
|
|
11
|
+
function Ce(e) {
|
|
12
|
+
var t;
|
|
13
|
+
return (t = (Mn(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
|
|
14
|
+
}
|
|
15
|
+
function Mn(e) {
|
|
16
|
+
return e instanceof Node || e instanceof ae(e).Node;
|
|
17
|
+
}
|
|
18
|
+
function Y(e) {
|
|
19
|
+
return e instanceof Element || e instanceof ae(e).Element;
|
|
20
|
+
}
|
|
21
|
+
function te(e) {
|
|
22
|
+
return e instanceof HTMLElement || e instanceof ae(e).HTMLElement;
|
|
23
|
+
}
|
|
24
|
+
function kt(e) {
|
|
25
|
+
return typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof ae(e).ShadowRoot;
|
|
26
|
+
}
|
|
27
|
+
function tt(e) {
|
|
28
|
+
const {
|
|
29
|
+
overflow: t,
|
|
30
|
+
overflowX: n,
|
|
31
|
+
overflowY: r,
|
|
32
|
+
display: o
|
|
33
|
+
} = me(e);
|
|
34
|
+
return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && !["inline", "contents"].includes(o);
|
|
35
|
+
}
|
|
36
|
+
function cr(e) {
|
|
37
|
+
return ["table", "td", "th"].includes(Le(e));
|
|
38
|
+
}
|
|
39
|
+
function Rt(e) {
|
|
40
|
+
return [":popover-open", ":modal"].some((t) => {
|
|
41
|
+
try {
|
|
42
|
+
return e.matches(t);
|
|
43
|
+
} catch {
|
|
44
|
+
return !1;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function _t(e) {
|
|
49
|
+
const t = Wt(), n = Y(e) ? me(e) : e;
|
|
50
|
+
return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((r) => (n.willChange || "").includes(r)) || ["paint", "layout", "strict", "content"].some((r) => (n.contain || "").includes(r));
|
|
51
|
+
}
|
|
52
|
+
function lr(e) {
|
|
53
|
+
let t = Re(e);
|
|
54
|
+
for (; te(t) && !Me(t); ) {
|
|
55
|
+
if (_t(t))
|
|
56
|
+
return t;
|
|
57
|
+
if (Rt(t))
|
|
58
|
+
return null;
|
|
59
|
+
t = Re(t);
|
|
60
|
+
}
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
function Wt() {
|
|
64
|
+
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
65
|
+
}
|
|
66
|
+
function Me(e) {
|
|
67
|
+
return ["html", "body", "#document"].includes(Le(e));
|
|
68
|
+
}
|
|
69
|
+
function me(e) {
|
|
70
|
+
return ae(e).getComputedStyle(e);
|
|
71
|
+
}
|
|
72
|
+
function Et(e) {
|
|
73
|
+
return Y(e) ? {
|
|
74
|
+
scrollLeft: e.scrollLeft,
|
|
75
|
+
scrollTop: e.scrollTop
|
|
76
|
+
} : {
|
|
77
|
+
scrollLeft: e.scrollX,
|
|
78
|
+
scrollTop: e.scrollY
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function Re(e) {
|
|
82
|
+
if (Le(e) === "html")
|
|
83
|
+
return e;
|
|
84
|
+
const t = (
|
|
85
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
86
|
+
e.assignedSlot || // DOM Element detected.
|
|
87
|
+
e.parentNode || // ShadowRoot detected.
|
|
88
|
+
kt(e) && e.host || // Fallback.
|
|
89
|
+
Ce(e)
|
|
90
|
+
);
|
|
91
|
+
return kt(t) ? t.host : t;
|
|
92
|
+
}
|
|
93
|
+
function An(e) {
|
|
94
|
+
const t = Re(e);
|
|
95
|
+
return Me(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : te(t) && tt(t) ? t : An(t);
|
|
96
|
+
}
|
|
97
|
+
function Se(e, t, n) {
|
|
98
|
+
var r;
|
|
99
|
+
t === void 0 && (t = []), n === void 0 && (n = !0);
|
|
100
|
+
const o = An(e), i = o === ((r = e.ownerDocument) == null ? void 0 : r.body), s = ae(o);
|
|
101
|
+
return i ? t.concat(s, s.visualViewport || [], tt(o) ? o : [], s.frameElement && n ? Se(s.frameElement) : []) : t.concat(o, Se(o, [], n));
|
|
102
|
+
}
|
|
103
|
+
function he(e) {
|
|
104
|
+
let t = e.activeElement;
|
|
105
|
+
for (; ((n = t) == null || (n = n.shadowRoot) == null ? void 0 : n.activeElement) != null; ) {
|
|
106
|
+
var n;
|
|
107
|
+
t = t.shadowRoot.activeElement;
|
|
108
|
+
}
|
|
109
|
+
return t;
|
|
110
|
+
}
|
|
111
|
+
function ee(e, t) {
|
|
112
|
+
if (!e || !t)
|
|
113
|
+
return !1;
|
|
114
|
+
const n = t.getRootNode == null ? void 0 : t.getRootNode();
|
|
115
|
+
if (e.contains(t))
|
|
116
|
+
return !0;
|
|
117
|
+
if (n && kt(n)) {
|
|
118
|
+
let r = t;
|
|
119
|
+
for (; r; ) {
|
|
120
|
+
if (e === r)
|
|
121
|
+
return !0;
|
|
122
|
+
r = r.parentNode || r.host;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return !1;
|
|
126
|
+
}
|
|
127
|
+
function Pn() {
|
|
128
|
+
const e = navigator.userAgentData;
|
|
129
|
+
return e != null && e.platform ? e.platform : navigator.platform;
|
|
130
|
+
}
|
|
131
|
+
function kn() {
|
|
132
|
+
const e = navigator.userAgentData;
|
|
133
|
+
return e && Array.isArray(e.brands) ? e.brands.map((t) => {
|
|
134
|
+
let {
|
|
135
|
+
brand: n,
|
|
136
|
+
version: r
|
|
137
|
+
} = t;
|
|
138
|
+
return n + "/" + r;
|
|
139
|
+
}).join(" ") : navigator.userAgent;
|
|
140
|
+
}
|
|
141
|
+
function Dn(e) {
|
|
142
|
+
return e.mozInputSource === 0 && e.isTrusted ? !0 : Dt() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
|
|
143
|
+
}
|
|
144
|
+
function Bt(e) {
|
|
145
|
+
return ur() ? !1 : !Dt() && e.width === 0 && e.height === 0 || Dt() && e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse" || // iOS VoiceOver returns 0.333• for width/height.
|
|
146
|
+
e.width < 1 && e.height < 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "touch";
|
|
147
|
+
}
|
|
148
|
+
function Kt() {
|
|
149
|
+
return /apple/i.test(navigator.vendor);
|
|
150
|
+
}
|
|
151
|
+
function Dt() {
|
|
152
|
+
const e = /android/i;
|
|
153
|
+
return e.test(Pn()) || e.test(kn());
|
|
154
|
+
}
|
|
155
|
+
function Ln() {
|
|
156
|
+
return Pn().toLowerCase().startsWith("mac") && !navigator.maxTouchPoints;
|
|
157
|
+
}
|
|
158
|
+
function ur() {
|
|
159
|
+
return kn().includes("jsdom/");
|
|
160
|
+
}
|
|
161
|
+
function Ze(e, t) {
|
|
162
|
+
const n = ["mouse", "pen"];
|
|
163
|
+
return t || n.push("", void 0), n.includes(e);
|
|
164
|
+
}
|
|
165
|
+
function ar(e) {
|
|
166
|
+
return "nativeEvent" in e;
|
|
167
|
+
}
|
|
168
|
+
function fr(e) {
|
|
169
|
+
return e.matches("html,body");
|
|
170
|
+
}
|
|
171
|
+
function ne(e) {
|
|
172
|
+
return (e == null ? void 0 : e.ownerDocument) || document;
|
|
173
|
+
}
|
|
174
|
+
function It(e, t) {
|
|
175
|
+
if (t == null)
|
|
176
|
+
return !1;
|
|
177
|
+
if ("composedPath" in e)
|
|
178
|
+
return e.composedPath().includes(t);
|
|
179
|
+
const n = e;
|
|
180
|
+
return n.target != null && t.contains(n.target);
|
|
181
|
+
}
|
|
182
|
+
function we(e) {
|
|
183
|
+
return "composedPath" in e ? e.composedPath()[0] : e.target;
|
|
184
|
+
}
|
|
185
|
+
const dr = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";
|
|
186
|
+
function $t(e) {
|
|
187
|
+
return te(e) && e.matches(dr);
|
|
188
|
+
}
|
|
189
|
+
function oe(e) {
|
|
190
|
+
e.preventDefault(), e.stopPropagation();
|
|
191
|
+
}
|
|
192
|
+
function Fn(e) {
|
|
193
|
+
return e ? e.getAttribute("role") === "combobox" && $t(e) : !1;
|
|
194
|
+
}
|
|
195
|
+
const ye = Math.min, fe = Math.max, gt = Math.round, Be = Math.floor, Ae = (e) => ({
|
|
196
|
+
x: e,
|
|
197
|
+
y: e
|
|
198
|
+
}), mr = {
|
|
199
|
+
left: "right",
|
|
200
|
+
right: "left",
|
|
201
|
+
bottom: "top",
|
|
202
|
+
top: "bottom"
|
|
203
|
+
}, gr = {
|
|
204
|
+
start: "end",
|
|
205
|
+
end: "start"
|
|
206
|
+
};
|
|
207
|
+
function Lt(e, t, n) {
|
|
208
|
+
return fe(e, ye(t, n));
|
|
209
|
+
}
|
|
210
|
+
function Pe(e, t) {
|
|
211
|
+
return typeof e == "function" ? e(t) : e;
|
|
212
|
+
}
|
|
213
|
+
function Ee(e) {
|
|
214
|
+
return e.split("-")[0];
|
|
215
|
+
}
|
|
216
|
+
function qe(e) {
|
|
217
|
+
return e.split("-")[1];
|
|
218
|
+
}
|
|
219
|
+
function Ht(e) {
|
|
220
|
+
return e === "x" ? "y" : "x";
|
|
221
|
+
}
|
|
222
|
+
function zt(e) {
|
|
223
|
+
return e === "y" ? "height" : "width";
|
|
224
|
+
}
|
|
225
|
+
function ke(e) {
|
|
226
|
+
return ["top", "bottom"].includes(Ee(e)) ? "y" : "x";
|
|
227
|
+
}
|
|
228
|
+
function qt(e) {
|
|
229
|
+
return Ht(ke(e));
|
|
230
|
+
}
|
|
231
|
+
function pr(e, t, n) {
|
|
232
|
+
n === void 0 && (n = !1);
|
|
233
|
+
const r = qe(e), o = qt(e), i = zt(o);
|
|
234
|
+
let s = o === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
|
|
235
|
+
return t.reference[i] > t.floating[i] && (s = pt(s)), [s, pt(s)];
|
|
236
|
+
}
|
|
237
|
+
function hr(e) {
|
|
238
|
+
const t = pt(e);
|
|
239
|
+
return [Ft(e), t, Ft(t)];
|
|
240
|
+
}
|
|
241
|
+
function Ft(e) {
|
|
242
|
+
return e.replace(/start|end/g, (t) => gr[t]);
|
|
243
|
+
}
|
|
244
|
+
function vr(e, t, n) {
|
|
245
|
+
const r = ["left", "right"], o = ["right", "left"], i = ["top", "bottom"], s = ["bottom", "top"];
|
|
246
|
+
switch (e) {
|
|
247
|
+
case "top":
|
|
248
|
+
case "bottom":
|
|
249
|
+
return n ? t ? o : r : t ? r : o;
|
|
250
|
+
case "left":
|
|
251
|
+
case "right":
|
|
252
|
+
return t ? i : s;
|
|
253
|
+
default:
|
|
254
|
+
return [];
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
function br(e, t, n, r) {
|
|
258
|
+
const o = qe(e);
|
|
259
|
+
let i = vr(Ee(e), n === "start", r);
|
|
260
|
+
return o && (i = i.map((s) => s + "-" + o), t && (i = i.concat(i.map(Ft)))), i;
|
|
261
|
+
}
|
|
262
|
+
function pt(e) {
|
|
263
|
+
return e.replace(/left|right|bottom|top/g, (t) => mr[t]);
|
|
264
|
+
}
|
|
265
|
+
function yr(e) {
|
|
266
|
+
return {
|
|
267
|
+
top: 0,
|
|
268
|
+
right: 0,
|
|
269
|
+
bottom: 0,
|
|
270
|
+
left: 0,
|
|
271
|
+
...e
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
function Nn(e) {
|
|
275
|
+
return typeof e != "number" ? yr(e) : {
|
|
276
|
+
top: e,
|
|
277
|
+
right: e,
|
|
278
|
+
bottom: e,
|
|
279
|
+
left: e
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
function ht(e) {
|
|
283
|
+
const {
|
|
284
|
+
x: t,
|
|
285
|
+
y: n,
|
|
286
|
+
width: r,
|
|
287
|
+
height: o
|
|
288
|
+
} = e;
|
|
289
|
+
return {
|
|
290
|
+
width: r,
|
|
291
|
+
height: o,
|
|
292
|
+
top: n,
|
|
293
|
+
left: t,
|
|
294
|
+
right: t + r,
|
|
295
|
+
bottom: n + o,
|
|
296
|
+
x: t,
|
|
297
|
+
y: n
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
/*!
|
|
301
|
+
* tabbable 6.2.0
|
|
302
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
303
|
+
*/
|
|
304
|
+
var xr = ["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])"], vt = /* @__PURE__ */ xr.join(","), Vn = typeof Element > "u", $e = Vn ? function() {
|
|
305
|
+
} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, bt = !Vn && Element.prototype.getRootNode ? function(e) {
|
|
306
|
+
var t;
|
|
307
|
+
return e == null || (t = e.getRootNode) === null || t === void 0 ? void 0 : t.call(e);
|
|
308
|
+
} : function(e) {
|
|
309
|
+
return e == null ? void 0 : e.ownerDocument;
|
|
310
|
+
}, yt = function e(t, n) {
|
|
311
|
+
var r;
|
|
312
|
+
n === void 0 && (n = !0);
|
|
313
|
+
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);
|
|
314
|
+
return s;
|
|
315
|
+
}, wr = function(t) {
|
|
316
|
+
var n, r = t == null || (n = t.getAttribute) === null || n === void 0 ? void 0 : n.call(t, "contenteditable");
|
|
317
|
+
return r === "" || r === "true";
|
|
318
|
+
}, Rr = function(t, n, r) {
|
|
319
|
+
if (yt(t))
|
|
320
|
+
return [];
|
|
321
|
+
var o = Array.prototype.slice.apply(t.querySelectorAll(vt));
|
|
322
|
+
return n && $e.call(t, vt) && o.unshift(t), o = o.filter(r), o;
|
|
323
|
+
}, Er = function e(t, n, r) {
|
|
324
|
+
for (var o = [], i = Array.from(t); i.length; ) {
|
|
325
|
+
var s = i.shift();
|
|
326
|
+
if (!yt(s, !1))
|
|
327
|
+
if (s.tagName === "SLOT") {
|
|
328
|
+
var c = s.assignedElements(), u = c.length ? c : s.children, l = e(u, !0, r);
|
|
329
|
+
r.flatten ? o.push.apply(o, l) : o.push({
|
|
330
|
+
scopeParent: s,
|
|
331
|
+
candidates: l
|
|
332
|
+
});
|
|
333
|
+
} else {
|
|
334
|
+
var g = $e.call(s, vt);
|
|
335
|
+
g && r.filter(s) && (n || !t.includes(s)) && o.push(s);
|
|
336
|
+
var f = s.shadowRoot || // check for an undisclosed shadow
|
|
337
|
+
typeof r.getShadowRoot == "function" && r.getShadowRoot(s), h = !yt(f, !1) && (!r.shadowRootFilter || r.shadowRootFilter(s));
|
|
338
|
+
if (f && h) {
|
|
339
|
+
var a = e(f === !0 ? s.children : f.children, !0, r);
|
|
340
|
+
r.flatten ? o.push.apply(o, a) : o.push({
|
|
341
|
+
scopeParent: s,
|
|
342
|
+
candidates: a
|
|
343
|
+
});
|
|
344
|
+
} else
|
|
345
|
+
i.unshift.apply(i, s.children);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
return o;
|
|
349
|
+
}, _n = function(t) {
|
|
350
|
+
return !isNaN(parseInt(t.getAttribute("tabindex"), 10));
|
|
351
|
+
}, Wn = function(t) {
|
|
352
|
+
if (!t)
|
|
353
|
+
throw new Error("No node provided");
|
|
354
|
+
return t.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName) || wr(t)) && !_n(t) ? 0 : t.tabIndex;
|
|
355
|
+
}, Cr = function(t, n) {
|
|
356
|
+
var r = Wn(t);
|
|
357
|
+
return r < 0 && n && !_n(t) ? 0 : r;
|
|
358
|
+
}, Ir = function(t, n) {
|
|
359
|
+
return t.tabIndex === n.tabIndex ? t.documentOrder - n.documentOrder : t.tabIndex - n.tabIndex;
|
|
360
|
+
}, Bn = function(t) {
|
|
361
|
+
return t.tagName === "INPUT";
|
|
362
|
+
}, Tr = function(t) {
|
|
363
|
+
return Bn(t) && t.type === "hidden";
|
|
364
|
+
}, Or = function(t) {
|
|
365
|
+
var n = t.tagName === "DETAILS" && Array.prototype.slice.apply(t.children).some(function(r) {
|
|
366
|
+
return r.tagName === "SUMMARY";
|
|
367
|
+
});
|
|
368
|
+
return n;
|
|
369
|
+
}, Sr = function(t, n) {
|
|
370
|
+
for (var r = 0; r < t.length; r++)
|
|
371
|
+
if (t[r].checked && t[r].form === n)
|
|
372
|
+
return t[r];
|
|
373
|
+
}, Mr = function(t) {
|
|
374
|
+
if (!t.name)
|
|
375
|
+
return !0;
|
|
376
|
+
var n = t.form || bt(t), r = function(c) {
|
|
377
|
+
return n.querySelectorAll('input[type="radio"][name="' + c + '"]');
|
|
378
|
+
}, o;
|
|
379
|
+
if (typeof window < "u" && typeof window.CSS < "u" && typeof window.CSS.escape == "function")
|
|
380
|
+
o = r(window.CSS.escape(t.name));
|
|
381
|
+
else
|
|
382
|
+
try {
|
|
383
|
+
o = r(t.name);
|
|
384
|
+
} catch (s) {
|
|
385
|
+
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;
|
|
386
|
+
}
|
|
387
|
+
var i = Sr(o, t.form);
|
|
388
|
+
return !i || i === t;
|
|
389
|
+
}, Ar = function(t) {
|
|
390
|
+
return Bn(t) && t.type === "radio";
|
|
391
|
+
}, Pr = function(t) {
|
|
392
|
+
return Ar(t) && !Mr(t);
|
|
393
|
+
}, kr = function(t) {
|
|
394
|
+
var n, r = t && bt(t), o = (n = r) === null || n === void 0 ? void 0 : n.host, i = !1;
|
|
395
|
+
if (r && r !== t) {
|
|
396
|
+
var s, c, u;
|
|
397
|
+
for (i = !!((s = o) !== null && s !== void 0 && (c = s.ownerDocument) !== null && c !== void 0 && c.contains(o) || t != null && (u = t.ownerDocument) !== null && u !== void 0 && u.contains(t)); !i && o; ) {
|
|
398
|
+
var l, g, f;
|
|
399
|
+
r = bt(o), o = (l = r) === null || l === void 0 ? void 0 : l.host, i = !!((g = o) !== null && g !== void 0 && (f = g.ownerDocument) !== null && f !== void 0 && f.contains(o));
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
return i;
|
|
403
|
+
}, Qt = function(t) {
|
|
404
|
+
var n = t.getBoundingClientRect(), r = n.width, o = n.height;
|
|
405
|
+
return r === 0 && o === 0;
|
|
406
|
+
}, Dr = function(t, n) {
|
|
407
|
+
var r = n.displayCheck, o = n.getShadowRoot;
|
|
408
|
+
if (getComputedStyle(t).visibility === "hidden")
|
|
409
|
+
return !0;
|
|
410
|
+
var i = $e.call(t, "details>summary:first-of-type"), s = i ? t.parentElement : t;
|
|
411
|
+
if ($e.call(s, "details:not([open]) *"))
|
|
412
|
+
return !0;
|
|
413
|
+
if (!r || r === "full" || r === "legacy-full") {
|
|
414
|
+
if (typeof o == "function") {
|
|
415
|
+
for (var c = t; t; ) {
|
|
416
|
+
var u = t.parentElement, l = bt(t);
|
|
417
|
+
if (u && !u.shadowRoot && o(u) === !0)
|
|
418
|
+
return Qt(t);
|
|
419
|
+
t.assignedSlot ? t = t.assignedSlot : !u && l !== t.ownerDocument ? t = l.host : t = u;
|
|
420
|
+
}
|
|
421
|
+
t = c;
|
|
422
|
+
}
|
|
423
|
+
if (kr(t))
|
|
424
|
+
return !t.getClientRects().length;
|
|
425
|
+
if (r !== "legacy-full")
|
|
426
|
+
return !0;
|
|
427
|
+
} else if (r === "non-zero-area")
|
|
428
|
+
return Qt(t);
|
|
429
|
+
return !1;
|
|
430
|
+
}, Lr = function(t) {
|
|
431
|
+
if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))
|
|
432
|
+
for (var n = t.parentElement; n; ) {
|
|
433
|
+
if (n.tagName === "FIELDSET" && n.disabled) {
|
|
434
|
+
for (var r = 0; r < n.children.length; r++) {
|
|
435
|
+
var o = n.children.item(r);
|
|
436
|
+
if (o.tagName === "LEGEND")
|
|
437
|
+
return $e.call(n, "fieldset[disabled] *") ? !0 : !o.contains(t);
|
|
438
|
+
}
|
|
439
|
+
return !0;
|
|
440
|
+
}
|
|
441
|
+
n = n.parentElement;
|
|
442
|
+
}
|
|
443
|
+
return !1;
|
|
444
|
+
}, Fr = function(t, n) {
|
|
445
|
+
return !(n.disabled || // we must do an inert look up to filter out any elements inside an inert ancestor
|
|
446
|
+
// because we're limited in the type of selectors we can use in JSDom (see related
|
|
447
|
+
// note related to `candidateSelectors`)
|
|
448
|
+
yt(n) || Tr(n) || Dr(n, t) || // For a details element with a summary, the summary element gets the focus
|
|
449
|
+
Or(n) || Lr(n));
|
|
450
|
+
}, Nt = function(t, n) {
|
|
451
|
+
return !(Pr(n) || Wn(n) < 0 || !Fr(t, n));
|
|
452
|
+
}, Nr = function(t) {
|
|
453
|
+
var n = parseInt(t.getAttribute("tabindex"), 10);
|
|
454
|
+
return !!(isNaN(n) || n >= 0);
|
|
455
|
+
}, Vr = function e(t) {
|
|
456
|
+
var n = [], r = [];
|
|
457
|
+
return t.forEach(function(o, i) {
|
|
458
|
+
var s = !!o.scopeParent, c = s ? o.scopeParent : o, u = Cr(c, s), l = s ? e(o.candidates) : c;
|
|
459
|
+
u === 0 ? s ? n.push.apply(n, l) : n.push(c) : r.push({
|
|
460
|
+
documentOrder: i,
|
|
461
|
+
tabIndex: u,
|
|
462
|
+
item: o,
|
|
463
|
+
isScope: s,
|
|
464
|
+
content: l
|
|
465
|
+
});
|
|
466
|
+
}), r.sort(Ir).reduce(function(o, i) {
|
|
467
|
+
return i.isScope ? o.push.apply(o, i.content) : o.push(i.content), o;
|
|
468
|
+
}, []).concat(n);
|
|
469
|
+
}, Je = function(t, n) {
|
|
470
|
+
n = n || {};
|
|
471
|
+
var r;
|
|
472
|
+
return n.getShadowRoot ? r = Er([t], n.includeContainer, {
|
|
473
|
+
filter: Nt.bind(null, n),
|
|
474
|
+
flatten: !1,
|
|
475
|
+
getShadowRoot: n.getShadowRoot,
|
|
476
|
+
shadowRootFilter: Nr
|
|
477
|
+
}) : r = Rr(t, n.includeContainer, Nt.bind(null, n)), Vr(r);
|
|
478
|
+
}, _r = function(t, n) {
|
|
479
|
+
if (n = n || {}, !t)
|
|
480
|
+
throw new Error("No node provided");
|
|
481
|
+
return $e.call(t, vt) === !1 ? !1 : Nt(n, t);
|
|
482
|
+
};
|
|
483
|
+
function en(e, t, n) {
|
|
484
|
+
let {
|
|
485
|
+
reference: r,
|
|
486
|
+
floating: o
|
|
487
|
+
} = e;
|
|
488
|
+
const i = ke(t), s = qt(t), c = zt(s), u = Ee(t), l = i === "y", g = r.x + r.width / 2 - o.width / 2, f = r.y + r.height / 2 - o.height / 2, h = r[c] / 2 - o[c] / 2;
|
|
489
|
+
let a;
|
|
490
|
+
switch (u) {
|
|
491
|
+
case "top":
|
|
492
|
+
a = {
|
|
493
|
+
x: g,
|
|
494
|
+
y: r.y - o.height
|
|
495
|
+
};
|
|
496
|
+
break;
|
|
497
|
+
case "bottom":
|
|
498
|
+
a = {
|
|
499
|
+
x: g,
|
|
500
|
+
y: r.y + r.height
|
|
501
|
+
};
|
|
502
|
+
break;
|
|
503
|
+
case "right":
|
|
504
|
+
a = {
|
|
505
|
+
x: r.x + r.width,
|
|
506
|
+
y: f
|
|
507
|
+
};
|
|
508
|
+
break;
|
|
509
|
+
case "left":
|
|
510
|
+
a = {
|
|
511
|
+
x: r.x - o.width,
|
|
512
|
+
y: f
|
|
513
|
+
};
|
|
514
|
+
break;
|
|
515
|
+
default:
|
|
516
|
+
a = {
|
|
517
|
+
x: r.x,
|
|
518
|
+
y: r.y
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
switch (qe(t)) {
|
|
522
|
+
case "start":
|
|
523
|
+
a[s] -= h * (n && l ? -1 : 1);
|
|
524
|
+
break;
|
|
525
|
+
case "end":
|
|
526
|
+
a[s] += h * (n && l ? -1 : 1);
|
|
527
|
+
break;
|
|
528
|
+
}
|
|
529
|
+
return a;
|
|
530
|
+
}
|
|
531
|
+
const Wr = async (e, t, n) => {
|
|
532
|
+
const {
|
|
533
|
+
placement: r = "bottom",
|
|
534
|
+
strategy: o = "absolute",
|
|
535
|
+
middleware: i = [],
|
|
536
|
+
platform: s
|
|
537
|
+
} = n, c = i.filter(Boolean), u = await (s.isRTL == null ? void 0 : s.isRTL(t));
|
|
538
|
+
let l = await s.getElementRects({
|
|
539
|
+
reference: e,
|
|
540
|
+
floating: t,
|
|
541
|
+
strategy: o
|
|
542
|
+
}), {
|
|
543
|
+
x: g,
|
|
544
|
+
y: f
|
|
545
|
+
} = en(l, r, u), h = r, a = {}, m = 0;
|
|
546
|
+
for (let p = 0; p < c.length; p++) {
|
|
547
|
+
const {
|
|
548
|
+
name: R,
|
|
549
|
+
fn: E
|
|
550
|
+
} = c[p], {
|
|
551
|
+
x: C,
|
|
552
|
+
y: b,
|
|
553
|
+
data: y,
|
|
554
|
+
reset: A
|
|
555
|
+
} = await E({
|
|
556
|
+
x: g,
|
|
557
|
+
y: f,
|
|
558
|
+
initialPlacement: r,
|
|
559
|
+
placement: h,
|
|
560
|
+
strategy: o,
|
|
561
|
+
middlewareData: a,
|
|
562
|
+
rects: l,
|
|
563
|
+
platform: s,
|
|
564
|
+
elements: {
|
|
565
|
+
reference: e,
|
|
566
|
+
floating: t
|
|
567
|
+
}
|
|
568
|
+
});
|
|
569
|
+
g = C ?? g, f = b ?? f, a = {
|
|
570
|
+
...a,
|
|
571
|
+
[R]: {
|
|
572
|
+
...a[R],
|
|
573
|
+
...y
|
|
574
|
+
}
|
|
575
|
+
}, A && m <= 50 && (m++, typeof A == "object" && (A.placement && (h = A.placement), A.rects && (l = A.rects === !0 ? await s.getElementRects({
|
|
576
|
+
reference: e,
|
|
577
|
+
floating: t,
|
|
578
|
+
strategy: o
|
|
579
|
+
}) : A.rects), {
|
|
580
|
+
x: g,
|
|
581
|
+
y: f
|
|
582
|
+
} = en(l, h, u)), p = -1);
|
|
583
|
+
}
|
|
584
|
+
return {
|
|
585
|
+
x: g,
|
|
586
|
+
y: f,
|
|
587
|
+
placement: h,
|
|
588
|
+
strategy: o,
|
|
589
|
+
middlewareData: a
|
|
590
|
+
};
|
|
591
|
+
};
|
|
592
|
+
async function Ut(e, t) {
|
|
593
|
+
var n;
|
|
594
|
+
t === void 0 && (t = {});
|
|
595
|
+
const {
|
|
596
|
+
x: r,
|
|
597
|
+
y: o,
|
|
598
|
+
platform: i,
|
|
599
|
+
rects: s,
|
|
600
|
+
elements: c,
|
|
601
|
+
strategy: u
|
|
602
|
+
} = e, {
|
|
603
|
+
boundary: l = "clippingAncestors",
|
|
604
|
+
rootBoundary: g = "viewport",
|
|
605
|
+
elementContext: f = "floating",
|
|
606
|
+
altBoundary: h = !1,
|
|
607
|
+
padding: a = 0
|
|
608
|
+
} = Pe(t, e), m = Nn(a), R = c[h ? f === "floating" ? "reference" : "floating" : f], E = ht(await i.getClippingRect({
|
|
609
|
+
element: (n = await (i.isElement == null ? void 0 : i.isElement(R))) == null || n ? R : R.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(c.floating)),
|
|
610
|
+
boundary: l,
|
|
611
|
+
rootBoundary: g,
|
|
612
|
+
strategy: u
|
|
613
|
+
})), C = f === "floating" ? {
|
|
614
|
+
x: r,
|
|
615
|
+
y: o,
|
|
616
|
+
width: s.floating.width,
|
|
617
|
+
height: s.floating.height
|
|
618
|
+
} : s.reference, b = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(c.floating)), y = await (i.isElement == null ? void 0 : i.isElement(b)) ? await (i.getScale == null ? void 0 : i.getScale(b)) || {
|
|
619
|
+
x: 1,
|
|
620
|
+
y: 1
|
|
621
|
+
} : {
|
|
622
|
+
x: 1,
|
|
623
|
+
y: 1
|
|
624
|
+
}, A = ht(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
625
|
+
elements: c,
|
|
626
|
+
rect: C,
|
|
627
|
+
offsetParent: b,
|
|
628
|
+
strategy: u
|
|
629
|
+
}) : C);
|
|
630
|
+
return {
|
|
631
|
+
top: (E.top - A.top + m.top) / y.y,
|
|
632
|
+
bottom: (A.bottom - E.bottom + m.bottom) / y.y,
|
|
633
|
+
left: (E.left - A.left + m.left) / y.x,
|
|
634
|
+
right: (A.right - E.right + m.right) / y.x
|
|
635
|
+
};
|
|
636
|
+
}
|
|
637
|
+
const Br = (e) => ({
|
|
638
|
+
name: "arrow",
|
|
639
|
+
options: e,
|
|
640
|
+
async fn(t) {
|
|
641
|
+
const {
|
|
642
|
+
x: n,
|
|
643
|
+
y: r,
|
|
644
|
+
placement: o,
|
|
645
|
+
rects: i,
|
|
646
|
+
platform: s,
|
|
647
|
+
elements: c,
|
|
648
|
+
middlewareData: u
|
|
649
|
+
} = t, {
|
|
650
|
+
element: l,
|
|
651
|
+
padding: g = 0
|
|
652
|
+
} = Pe(e, t) || {};
|
|
653
|
+
if (l == null)
|
|
654
|
+
return {};
|
|
655
|
+
const f = Nn(g), h = {
|
|
656
|
+
x: n,
|
|
657
|
+
y: r
|
|
658
|
+
}, a = qt(o), m = zt(a), p = await s.getDimensions(l), R = a === "y", E = R ? "top" : "left", C = R ? "bottom" : "right", b = R ? "clientHeight" : "clientWidth", y = i.reference[m] + i.reference[a] - h[a] - i.floating[m], A = h[a] - i.reference[a], P = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(l));
|
|
659
|
+
let V = P ? P[b] : 0;
|
|
660
|
+
(!V || !await (s.isElement == null ? void 0 : s.isElement(P))) && (V = c.floating[b] || i.floating[m]);
|
|
661
|
+
const B = y / 2 - A / 2, H = V / 2 - p[m] / 2 - 1, O = ye(f[E], H), D = ye(f[C], H), M = O, S = V - p[m] - D, v = V / 2 - p[m] / 2 + B, w = Lt(M, v, S), I = !u.arrow && qe(o) != null && v !== w && i.reference[m] / 2 - (v < M ? O : D) - p[m] / 2 < 0, x = I ? v < M ? v - M : v - S : 0;
|
|
662
|
+
return {
|
|
663
|
+
[a]: h[a] + x,
|
|
664
|
+
data: {
|
|
665
|
+
[a]: w,
|
|
666
|
+
centerOffset: v - w - x,
|
|
667
|
+
...I && {
|
|
668
|
+
alignmentOffset: x
|
|
669
|
+
}
|
|
670
|
+
},
|
|
671
|
+
reset: I
|
|
672
|
+
};
|
|
673
|
+
}
|
|
674
|
+
}), Kr = function(e) {
|
|
675
|
+
return e === void 0 && (e = {}), {
|
|
676
|
+
name: "flip",
|
|
677
|
+
options: e,
|
|
678
|
+
async fn(t) {
|
|
679
|
+
var n, r;
|
|
680
|
+
const {
|
|
681
|
+
placement: o,
|
|
682
|
+
middlewareData: i,
|
|
683
|
+
rects: s,
|
|
684
|
+
initialPlacement: c,
|
|
685
|
+
platform: u,
|
|
686
|
+
elements: l
|
|
687
|
+
} = t, {
|
|
688
|
+
mainAxis: g = !0,
|
|
689
|
+
crossAxis: f = !0,
|
|
690
|
+
fallbackPlacements: h,
|
|
691
|
+
fallbackStrategy: a = "bestFit",
|
|
692
|
+
fallbackAxisSideDirection: m = "none",
|
|
693
|
+
flipAlignment: p = !0,
|
|
694
|
+
...R
|
|
695
|
+
} = Pe(e, t);
|
|
696
|
+
if ((n = i.arrow) != null && n.alignmentOffset)
|
|
697
|
+
return {};
|
|
698
|
+
const E = Ee(o), C = ke(c), b = Ee(c) === c, y = await (u.isRTL == null ? void 0 : u.isRTL(l.floating)), A = h || (b || !p ? [pt(c)] : hr(c)), P = m !== "none";
|
|
699
|
+
!h && P && A.push(...br(c, p, m, y));
|
|
700
|
+
const V = [c, ...A], B = await Ut(t, R), H = [];
|
|
701
|
+
let O = ((r = i.flip) == null ? void 0 : r.overflows) || [];
|
|
702
|
+
if (g && H.push(B[E]), f) {
|
|
703
|
+
const v = pr(o, s, y);
|
|
704
|
+
H.push(B[v[0]], B[v[1]]);
|
|
705
|
+
}
|
|
706
|
+
if (O = [...O, {
|
|
707
|
+
placement: o,
|
|
708
|
+
overflows: H
|
|
709
|
+
}], !H.every((v) => v <= 0)) {
|
|
710
|
+
var D, M;
|
|
711
|
+
const v = (((D = i.flip) == null ? void 0 : D.index) || 0) + 1, w = V[v];
|
|
712
|
+
if (w)
|
|
713
|
+
return {
|
|
714
|
+
data: {
|
|
715
|
+
index: v,
|
|
716
|
+
overflows: O
|
|
717
|
+
},
|
|
718
|
+
reset: {
|
|
719
|
+
placement: w
|
|
720
|
+
}
|
|
721
|
+
};
|
|
722
|
+
let I = (M = O.filter((x) => x.overflows[0] <= 0).sort((x, k) => x.overflows[1] - k.overflows[1])[0]) == null ? void 0 : M.placement;
|
|
723
|
+
if (!I)
|
|
724
|
+
switch (a) {
|
|
725
|
+
case "bestFit": {
|
|
726
|
+
var S;
|
|
727
|
+
const x = (S = O.filter((k) => {
|
|
728
|
+
if (P) {
|
|
729
|
+
const _ = ke(k.placement);
|
|
730
|
+
return _ === C || // Create a bias to the `y` side axis due to horizontal
|
|
731
|
+
// reading directions favoring greater width.
|
|
732
|
+
_ === "y";
|
|
733
|
+
}
|
|
734
|
+
return !0;
|
|
735
|
+
}).map((k) => [k.placement, k.overflows.filter((_) => _ > 0).reduce((_, T) => _ + T, 0)]).sort((k, _) => k[1] - _[1])[0]) == null ? void 0 : S[0];
|
|
736
|
+
x && (I = x);
|
|
737
|
+
break;
|
|
738
|
+
}
|
|
739
|
+
case "initialPlacement":
|
|
740
|
+
I = c;
|
|
741
|
+
break;
|
|
742
|
+
}
|
|
743
|
+
if (o !== I)
|
|
744
|
+
return {
|
|
745
|
+
reset: {
|
|
746
|
+
placement: I
|
|
747
|
+
}
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
return {};
|
|
751
|
+
}
|
|
752
|
+
};
|
|
753
|
+
};
|
|
754
|
+
async function $r(e, t) {
|
|
755
|
+
const {
|
|
756
|
+
placement: n,
|
|
757
|
+
platform: r,
|
|
758
|
+
elements: o
|
|
759
|
+
} = e, i = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), s = Ee(n), c = qe(n), u = ke(n) === "y", l = ["left", "top"].includes(s) ? -1 : 1, g = i && u ? -1 : 1, f = Pe(t, e);
|
|
760
|
+
let {
|
|
761
|
+
mainAxis: h,
|
|
762
|
+
crossAxis: a,
|
|
763
|
+
alignmentAxis: m
|
|
764
|
+
} = typeof f == "number" ? {
|
|
765
|
+
mainAxis: f,
|
|
766
|
+
crossAxis: 0,
|
|
767
|
+
alignmentAxis: null
|
|
768
|
+
} : {
|
|
769
|
+
mainAxis: 0,
|
|
770
|
+
crossAxis: 0,
|
|
771
|
+
alignmentAxis: null,
|
|
772
|
+
...f
|
|
773
|
+
};
|
|
774
|
+
return c && typeof m == "number" && (a = c === "end" ? m * -1 : m), u ? {
|
|
775
|
+
x: a * g,
|
|
776
|
+
y: h * l
|
|
777
|
+
} : {
|
|
778
|
+
x: h * l,
|
|
779
|
+
y: a * g
|
|
780
|
+
};
|
|
781
|
+
}
|
|
782
|
+
const Hr = function(e) {
|
|
783
|
+
return e === void 0 && (e = 0), {
|
|
784
|
+
name: "offset",
|
|
785
|
+
options: e,
|
|
786
|
+
async fn(t) {
|
|
787
|
+
var n, r;
|
|
788
|
+
const {
|
|
789
|
+
x: o,
|
|
790
|
+
y: i,
|
|
791
|
+
placement: s,
|
|
792
|
+
middlewareData: c
|
|
793
|
+
} = t, u = await $r(t, e);
|
|
794
|
+
return s === ((n = c.offset) == null ? void 0 : n.placement) && (r = c.arrow) != null && r.alignmentOffset ? {} : {
|
|
795
|
+
x: o + u.x,
|
|
796
|
+
y: i + u.y,
|
|
797
|
+
data: {
|
|
798
|
+
...u,
|
|
799
|
+
placement: s
|
|
800
|
+
}
|
|
801
|
+
};
|
|
802
|
+
}
|
|
803
|
+
};
|
|
804
|
+
}, zr = function(e) {
|
|
805
|
+
return e === void 0 && (e = {}), {
|
|
806
|
+
name: "shift",
|
|
807
|
+
options: e,
|
|
808
|
+
async fn(t) {
|
|
809
|
+
const {
|
|
810
|
+
x: n,
|
|
811
|
+
y: r,
|
|
812
|
+
placement: o
|
|
813
|
+
} = t, {
|
|
814
|
+
mainAxis: i = !0,
|
|
815
|
+
crossAxis: s = !1,
|
|
816
|
+
limiter: c = {
|
|
817
|
+
fn: (R) => {
|
|
818
|
+
let {
|
|
819
|
+
x: E,
|
|
820
|
+
y: C
|
|
821
|
+
} = R;
|
|
822
|
+
return {
|
|
823
|
+
x: E,
|
|
824
|
+
y: C
|
|
825
|
+
};
|
|
826
|
+
}
|
|
827
|
+
},
|
|
828
|
+
...u
|
|
829
|
+
} = Pe(e, t), l = {
|
|
830
|
+
x: n,
|
|
831
|
+
y: r
|
|
832
|
+
}, g = await Ut(t, u), f = ke(Ee(o)), h = Ht(f);
|
|
833
|
+
let a = l[h], m = l[f];
|
|
834
|
+
if (i) {
|
|
835
|
+
const R = h === "y" ? "top" : "left", E = h === "y" ? "bottom" : "right", C = a + g[R], b = a - g[E];
|
|
836
|
+
a = Lt(C, a, b);
|
|
837
|
+
}
|
|
838
|
+
if (s) {
|
|
839
|
+
const R = f === "y" ? "top" : "left", E = f === "y" ? "bottom" : "right", C = m + g[R], b = m - g[E];
|
|
840
|
+
m = Lt(C, m, b);
|
|
841
|
+
}
|
|
842
|
+
const p = c.fn({
|
|
843
|
+
...t,
|
|
844
|
+
[h]: a,
|
|
845
|
+
[f]: m
|
|
846
|
+
});
|
|
847
|
+
return {
|
|
848
|
+
...p,
|
|
849
|
+
data: {
|
|
850
|
+
x: p.x - n,
|
|
851
|
+
y: p.y - r
|
|
852
|
+
}
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
};
|
|
856
|
+
}, qr = function(e) {
|
|
857
|
+
return e === void 0 && (e = {}), {
|
|
858
|
+
options: e,
|
|
859
|
+
fn(t) {
|
|
860
|
+
const {
|
|
861
|
+
x: n,
|
|
862
|
+
y: r,
|
|
863
|
+
placement: o,
|
|
864
|
+
rects: i,
|
|
865
|
+
middlewareData: s
|
|
866
|
+
} = t, {
|
|
867
|
+
offset: c = 0,
|
|
868
|
+
mainAxis: u = !0,
|
|
869
|
+
crossAxis: l = !0
|
|
870
|
+
} = Pe(e, t), g = {
|
|
871
|
+
x: n,
|
|
872
|
+
y: r
|
|
873
|
+
}, f = ke(o), h = Ht(f);
|
|
874
|
+
let a = g[h], m = g[f];
|
|
875
|
+
const p = Pe(c, t), R = typeof p == "number" ? {
|
|
876
|
+
mainAxis: p,
|
|
877
|
+
crossAxis: 0
|
|
878
|
+
} : {
|
|
879
|
+
mainAxis: 0,
|
|
880
|
+
crossAxis: 0,
|
|
881
|
+
...p
|
|
882
|
+
};
|
|
883
|
+
if (u) {
|
|
884
|
+
const b = h === "y" ? "height" : "width", y = i.reference[h] - i.floating[b] + R.mainAxis, A = i.reference[h] + i.reference[b] - R.mainAxis;
|
|
885
|
+
a < y ? a = y : a > A && (a = A);
|
|
886
|
+
}
|
|
887
|
+
if (l) {
|
|
888
|
+
var E, C;
|
|
889
|
+
const b = h === "y" ? "width" : "height", y = ["top", "left"].includes(Ee(o)), A = i.reference[f] - i.floating[b] + (y && ((E = s.offset) == null ? void 0 : E[f]) || 0) + (y ? 0 : R.crossAxis), P = i.reference[f] + i.reference[b] + (y ? 0 : ((C = s.offset) == null ? void 0 : C[f]) || 0) - (y ? R.crossAxis : 0);
|
|
890
|
+
m < A ? m = A : m > P && (m = P);
|
|
891
|
+
}
|
|
892
|
+
return {
|
|
893
|
+
[h]: a,
|
|
894
|
+
[f]: m
|
|
895
|
+
};
|
|
896
|
+
}
|
|
897
|
+
};
|
|
898
|
+
}, Ur = function(e) {
|
|
899
|
+
return e === void 0 && (e = {}), {
|
|
900
|
+
name: "size",
|
|
901
|
+
options: e,
|
|
902
|
+
async fn(t) {
|
|
903
|
+
const {
|
|
904
|
+
placement: n,
|
|
905
|
+
rects: r,
|
|
906
|
+
platform: o,
|
|
907
|
+
elements: i
|
|
908
|
+
} = t, {
|
|
909
|
+
apply: s = () => {
|
|
910
|
+
},
|
|
911
|
+
...c
|
|
912
|
+
} = Pe(e, t), u = await Ut(t, c), l = Ee(n), g = qe(n), f = ke(n) === "y", {
|
|
913
|
+
width: h,
|
|
914
|
+
height: a
|
|
915
|
+
} = r.floating;
|
|
916
|
+
let m, p;
|
|
917
|
+
l === "top" || l === "bottom" ? (m = l, p = g === (await (o.isRTL == null ? void 0 : o.isRTL(i.floating)) ? "start" : "end") ? "left" : "right") : (p = l, m = g === "end" ? "top" : "bottom");
|
|
918
|
+
const R = a - u.top - u.bottom, E = h - u.left - u.right, C = ye(a - u[m], R), b = ye(h - u[p], E), y = !t.middlewareData.shift;
|
|
919
|
+
let A = C, P = b;
|
|
920
|
+
if (f ? P = g || y ? ye(b, E) : E : A = g || y ? ye(C, R) : R, y && !g) {
|
|
921
|
+
const B = fe(u.left, 0), H = fe(u.right, 0), O = fe(u.top, 0), D = fe(u.bottom, 0);
|
|
922
|
+
f ? P = h - 2 * (B !== 0 || H !== 0 ? B + H : fe(u.left, u.right)) : A = a - 2 * (O !== 0 || D !== 0 ? O + D : fe(u.top, u.bottom));
|
|
923
|
+
}
|
|
924
|
+
await s({
|
|
925
|
+
...t,
|
|
926
|
+
availableWidth: P,
|
|
927
|
+
availableHeight: A
|
|
928
|
+
});
|
|
929
|
+
const V = await o.getDimensions(i.floating);
|
|
930
|
+
return h !== V.width || a !== V.height ? {
|
|
931
|
+
reset: {
|
|
932
|
+
rects: !0
|
|
933
|
+
}
|
|
934
|
+
} : {};
|
|
935
|
+
}
|
|
936
|
+
};
|
|
937
|
+
};
|
|
938
|
+
function Kn(e) {
|
|
939
|
+
const t = me(e);
|
|
940
|
+
let n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0;
|
|
941
|
+
const o = te(e), i = o ? e.offsetWidth : n, s = o ? e.offsetHeight : r, c = gt(n) !== i || gt(r) !== s;
|
|
942
|
+
return c && (n = i, r = s), {
|
|
943
|
+
width: n,
|
|
944
|
+
height: r,
|
|
945
|
+
$: c
|
|
946
|
+
};
|
|
947
|
+
}
|
|
948
|
+
function jt(e) {
|
|
949
|
+
return Y(e) ? e : e.contextElement;
|
|
950
|
+
}
|
|
951
|
+
function Ke(e) {
|
|
952
|
+
const t = jt(e);
|
|
953
|
+
if (!te(t))
|
|
954
|
+
return Ae(1);
|
|
955
|
+
const n = t.getBoundingClientRect(), {
|
|
956
|
+
width: r,
|
|
957
|
+
height: o,
|
|
958
|
+
$: i
|
|
959
|
+
} = Kn(t);
|
|
960
|
+
let s = (i ? gt(n.width) : n.width) / r, c = (i ? gt(n.height) : n.height) / o;
|
|
961
|
+
return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
|
|
962
|
+
x: s,
|
|
963
|
+
y: c
|
|
964
|
+
};
|
|
965
|
+
}
|
|
966
|
+
const jr = /* @__PURE__ */ Ae(0);
|
|
967
|
+
function $n(e) {
|
|
968
|
+
const t = ae(e);
|
|
969
|
+
return !Wt() || !t.visualViewport ? jr : {
|
|
970
|
+
x: t.visualViewport.offsetLeft,
|
|
971
|
+
y: t.visualViewport.offsetTop
|
|
972
|
+
};
|
|
973
|
+
}
|
|
974
|
+
function Yr(e, t, n) {
|
|
975
|
+
return t === void 0 && (t = !1), !n || t && n !== ae(e) ? !1 : t;
|
|
976
|
+
}
|
|
977
|
+
function Ve(e, t, n, r) {
|
|
978
|
+
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
979
|
+
const o = e.getBoundingClientRect(), i = jt(e);
|
|
980
|
+
let s = Ae(1);
|
|
981
|
+
t && (r ? Y(r) && (s = Ke(r)) : s = Ke(e));
|
|
982
|
+
const c = Yr(i, n, r) ? $n(i) : Ae(0);
|
|
983
|
+
let u = (o.left + c.x) / s.x, l = (o.top + c.y) / s.y, g = o.width / s.x, f = o.height / s.y;
|
|
984
|
+
if (i) {
|
|
985
|
+
const h = ae(i), a = r && Y(r) ? ae(r) : r;
|
|
986
|
+
let m = h, p = m.frameElement;
|
|
987
|
+
for (; p && r && a !== m; ) {
|
|
988
|
+
const R = Ke(p), E = p.getBoundingClientRect(), C = me(p), b = E.left + (p.clientLeft + parseFloat(C.paddingLeft)) * R.x, y = E.top + (p.clientTop + parseFloat(C.paddingTop)) * R.y;
|
|
989
|
+
u *= R.x, l *= R.y, g *= R.x, f *= R.y, u += b, l += y, m = ae(p), p = m.frameElement;
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
return ht({
|
|
993
|
+
width: g,
|
|
994
|
+
height: f,
|
|
995
|
+
x: u,
|
|
996
|
+
y: l
|
|
997
|
+
});
|
|
998
|
+
}
|
|
999
|
+
function Gr(e) {
|
|
1000
|
+
let {
|
|
1001
|
+
elements: t,
|
|
1002
|
+
rect: n,
|
|
1003
|
+
offsetParent: r,
|
|
1004
|
+
strategy: o
|
|
1005
|
+
} = e;
|
|
1006
|
+
const i = o === "fixed", s = Ce(r), c = t ? Rt(t.floating) : !1;
|
|
1007
|
+
if (r === s || c && i)
|
|
1008
|
+
return n;
|
|
1009
|
+
let u = {
|
|
1010
|
+
scrollLeft: 0,
|
|
1011
|
+
scrollTop: 0
|
|
1012
|
+
}, l = Ae(1);
|
|
1013
|
+
const g = Ae(0), f = te(r);
|
|
1014
|
+
if ((f || !f && !i) && ((Le(r) !== "body" || tt(s)) && (u = Et(r)), te(r))) {
|
|
1015
|
+
const h = Ve(r);
|
|
1016
|
+
l = Ke(r), g.x = h.x + r.clientLeft, g.y = h.y + r.clientTop;
|
|
1017
|
+
}
|
|
1018
|
+
return {
|
|
1019
|
+
width: n.width * l.x,
|
|
1020
|
+
height: n.height * l.y,
|
|
1021
|
+
x: n.x * l.x - u.scrollLeft * l.x + g.x,
|
|
1022
|
+
y: n.y * l.y - u.scrollTop * l.y + g.y
|
|
1023
|
+
};
|
|
1024
|
+
}
|
|
1025
|
+
function Xr(e) {
|
|
1026
|
+
return Array.from(e.getClientRects());
|
|
1027
|
+
}
|
|
1028
|
+
function Hn(e) {
|
|
1029
|
+
return Ve(Ce(e)).left + Et(e).scrollLeft;
|
|
1030
|
+
}
|
|
1031
|
+
function Zr(e) {
|
|
1032
|
+
const t = Ce(e), n = Et(e), r = e.ownerDocument.body, o = fe(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), i = fe(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
|
|
1033
|
+
let s = -n.scrollLeft + Hn(e);
|
|
1034
|
+
const c = -n.scrollTop;
|
|
1035
|
+
return me(r).direction === "rtl" && (s += fe(t.clientWidth, r.clientWidth) - o), {
|
|
1036
|
+
width: o,
|
|
1037
|
+
height: i,
|
|
1038
|
+
x: s,
|
|
1039
|
+
y: c
|
|
1040
|
+
};
|
|
1041
|
+
}
|
|
1042
|
+
function Jr(e, t) {
|
|
1043
|
+
const n = ae(e), r = Ce(e), o = n.visualViewport;
|
|
1044
|
+
let i = r.clientWidth, s = r.clientHeight, c = 0, u = 0;
|
|
1045
|
+
if (o) {
|
|
1046
|
+
i = o.width, s = o.height;
|
|
1047
|
+
const l = Wt();
|
|
1048
|
+
(!l || l && t === "fixed") && (c = o.offsetLeft, u = o.offsetTop);
|
|
1049
|
+
}
|
|
1050
|
+
return {
|
|
1051
|
+
width: i,
|
|
1052
|
+
height: s,
|
|
1053
|
+
x: c,
|
|
1054
|
+
y: u
|
|
1055
|
+
};
|
|
1056
|
+
}
|
|
1057
|
+
function Qr(e, t) {
|
|
1058
|
+
const n = Ve(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, i = te(e) ? Ke(e) : Ae(1), s = e.clientWidth * i.x, c = e.clientHeight * i.y, u = o * i.x, l = r * i.y;
|
|
1059
|
+
return {
|
|
1060
|
+
width: s,
|
|
1061
|
+
height: c,
|
|
1062
|
+
x: u,
|
|
1063
|
+
y: l
|
|
1064
|
+
};
|
|
1065
|
+
}
|
|
1066
|
+
function tn(e, t, n) {
|
|
1067
|
+
let r;
|
|
1068
|
+
if (t === "viewport")
|
|
1069
|
+
r = Jr(e, n);
|
|
1070
|
+
else if (t === "document")
|
|
1071
|
+
r = Zr(Ce(e));
|
|
1072
|
+
else if (Y(t))
|
|
1073
|
+
r = Qr(t, n);
|
|
1074
|
+
else {
|
|
1075
|
+
const o = $n(e);
|
|
1076
|
+
r = {
|
|
1077
|
+
...t,
|
|
1078
|
+
x: t.x - o.x,
|
|
1079
|
+
y: t.y - o.y
|
|
1080
|
+
};
|
|
1081
|
+
}
|
|
1082
|
+
return ht(r);
|
|
1083
|
+
}
|
|
1084
|
+
function zn(e, t) {
|
|
1085
|
+
const n = Re(e);
|
|
1086
|
+
return n === t || !Y(n) || Me(n) ? !1 : me(n).position === "fixed" || zn(n, t);
|
|
1087
|
+
}
|
|
1088
|
+
function eo(e, t) {
|
|
1089
|
+
const n = t.get(e);
|
|
1090
|
+
if (n)
|
|
1091
|
+
return n;
|
|
1092
|
+
let r = Se(e, [], !1).filter((c) => Y(c) && Le(c) !== "body"), o = null;
|
|
1093
|
+
const i = me(e).position === "fixed";
|
|
1094
|
+
let s = i ? Re(e) : e;
|
|
1095
|
+
for (; Y(s) && !Me(s); ) {
|
|
1096
|
+
const c = me(s), u = _t(s);
|
|
1097
|
+
!u && c.position === "fixed" && (o = null), (i ? !u && !o : !u && c.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || tt(s) && !u && zn(e, s)) ? r = r.filter((g) => g !== s) : o = c, s = Re(s);
|
|
1098
|
+
}
|
|
1099
|
+
return t.set(e, r), r;
|
|
1100
|
+
}
|
|
1101
|
+
function to(e) {
|
|
1102
|
+
let {
|
|
1103
|
+
element: t,
|
|
1104
|
+
boundary: n,
|
|
1105
|
+
rootBoundary: r,
|
|
1106
|
+
strategy: o
|
|
1107
|
+
} = e;
|
|
1108
|
+
const s = [...n === "clippingAncestors" ? Rt(t) ? [] : eo(t, this._c) : [].concat(n), r], c = s[0], u = s.reduce((l, g) => {
|
|
1109
|
+
const f = tn(t, g, o);
|
|
1110
|
+
return l.top = fe(f.top, l.top), l.right = ye(f.right, l.right), l.bottom = ye(f.bottom, l.bottom), l.left = fe(f.left, l.left), l;
|
|
1111
|
+
}, tn(t, c, o));
|
|
1112
|
+
return {
|
|
1113
|
+
width: u.right - u.left,
|
|
1114
|
+
height: u.bottom - u.top,
|
|
1115
|
+
x: u.left,
|
|
1116
|
+
y: u.top
|
|
1117
|
+
};
|
|
1118
|
+
}
|
|
1119
|
+
function no(e) {
|
|
1120
|
+
const {
|
|
1121
|
+
width: t,
|
|
1122
|
+
height: n
|
|
1123
|
+
} = Kn(e);
|
|
1124
|
+
return {
|
|
1125
|
+
width: t,
|
|
1126
|
+
height: n
|
|
1127
|
+
};
|
|
1128
|
+
}
|
|
1129
|
+
function ro(e, t, n) {
|
|
1130
|
+
const r = te(t), o = Ce(t), i = n === "fixed", s = Ve(e, !0, i, t);
|
|
1131
|
+
let c = {
|
|
1132
|
+
scrollLeft: 0,
|
|
1133
|
+
scrollTop: 0
|
|
1134
|
+
};
|
|
1135
|
+
const u = Ae(0);
|
|
1136
|
+
if (r || !r && !i)
|
|
1137
|
+
if ((Le(t) !== "body" || tt(o)) && (c = Et(t)), r) {
|
|
1138
|
+
const f = Ve(t, !0, i, t);
|
|
1139
|
+
u.x = f.x + t.clientLeft, u.y = f.y + t.clientTop;
|
|
1140
|
+
} else
|
|
1141
|
+
o && (u.x = Hn(o));
|
|
1142
|
+
const l = s.left + c.scrollLeft - u.x, g = s.top + c.scrollTop - u.y;
|
|
1143
|
+
return {
|
|
1144
|
+
x: l,
|
|
1145
|
+
y: g,
|
|
1146
|
+
width: s.width,
|
|
1147
|
+
height: s.height
|
|
1148
|
+
};
|
|
1149
|
+
}
|
|
1150
|
+
function Tt(e) {
|
|
1151
|
+
return me(e).position === "static";
|
|
1152
|
+
}
|
|
1153
|
+
function nn(e, t) {
|
|
1154
|
+
return !te(e) || me(e).position === "fixed" ? null : t ? t(e) : e.offsetParent;
|
|
1155
|
+
}
|
|
1156
|
+
function qn(e, t) {
|
|
1157
|
+
const n = ae(e);
|
|
1158
|
+
if (Rt(e))
|
|
1159
|
+
return n;
|
|
1160
|
+
if (!te(e)) {
|
|
1161
|
+
let o = Re(e);
|
|
1162
|
+
for (; o && !Me(o); ) {
|
|
1163
|
+
if (Y(o) && !Tt(o))
|
|
1164
|
+
return o;
|
|
1165
|
+
o = Re(o);
|
|
1166
|
+
}
|
|
1167
|
+
return n;
|
|
1168
|
+
}
|
|
1169
|
+
let r = nn(e, t);
|
|
1170
|
+
for (; r && cr(r) && Tt(r); )
|
|
1171
|
+
r = nn(r, t);
|
|
1172
|
+
return r && Me(r) && Tt(r) && !_t(r) ? n : r || lr(e) || n;
|
|
1173
|
+
}
|
|
1174
|
+
const oo = async function(e) {
|
|
1175
|
+
const t = this.getOffsetParent || qn, n = this.getDimensions, r = await n(e.floating);
|
|
1176
|
+
return {
|
|
1177
|
+
reference: ro(e.reference, await t(e.floating), e.strategy),
|
|
1178
|
+
floating: {
|
|
1179
|
+
x: 0,
|
|
1180
|
+
y: 0,
|
|
1181
|
+
width: r.width,
|
|
1182
|
+
height: r.height
|
|
1183
|
+
}
|
|
1184
|
+
};
|
|
1185
|
+
};
|
|
1186
|
+
function io(e) {
|
|
1187
|
+
return me(e).direction === "rtl";
|
|
1188
|
+
}
|
|
1189
|
+
const so = {
|
|
1190
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Gr,
|
|
1191
|
+
getDocumentElement: Ce,
|
|
1192
|
+
getClippingRect: to,
|
|
1193
|
+
getOffsetParent: qn,
|
|
1194
|
+
getElementRects: oo,
|
|
1195
|
+
getClientRects: Xr,
|
|
1196
|
+
getDimensions: no,
|
|
1197
|
+
getScale: Ke,
|
|
1198
|
+
isElement: Y,
|
|
1199
|
+
isRTL: io
|
|
1200
|
+
};
|
|
1201
|
+
function co(e, t) {
|
|
1202
|
+
let n = null, r;
|
|
1203
|
+
const o = Ce(e);
|
|
1204
|
+
function i() {
|
|
1205
|
+
var c;
|
|
1206
|
+
clearTimeout(r), (c = n) == null || c.disconnect(), n = null;
|
|
1207
|
+
}
|
|
1208
|
+
function s(c, u) {
|
|
1209
|
+
c === void 0 && (c = !1), u === void 0 && (u = 1), i();
|
|
1210
|
+
const {
|
|
1211
|
+
left: l,
|
|
1212
|
+
top: g,
|
|
1213
|
+
width: f,
|
|
1214
|
+
height: h
|
|
1215
|
+
} = e.getBoundingClientRect();
|
|
1216
|
+
if (c || t(), !f || !h)
|
|
1217
|
+
return;
|
|
1218
|
+
const a = Be(g), m = Be(o.clientWidth - (l + f)), p = Be(o.clientHeight - (g + h)), R = Be(l), C = {
|
|
1219
|
+
rootMargin: -a + "px " + -m + "px " + -p + "px " + -R + "px",
|
|
1220
|
+
threshold: fe(0, ye(1, u)) || 1
|
|
1221
|
+
};
|
|
1222
|
+
let b = !0;
|
|
1223
|
+
function y(A) {
|
|
1224
|
+
const P = A[0].intersectionRatio;
|
|
1225
|
+
if (P !== u) {
|
|
1226
|
+
if (!b)
|
|
1227
|
+
return s();
|
|
1228
|
+
P ? s(!1, P) : r = setTimeout(() => {
|
|
1229
|
+
s(!1, 1e-7);
|
|
1230
|
+
}, 1e3);
|
|
1231
|
+
}
|
|
1232
|
+
b = !1;
|
|
1233
|
+
}
|
|
1234
|
+
try {
|
|
1235
|
+
n = new IntersectionObserver(y, {
|
|
1236
|
+
...C,
|
|
1237
|
+
// Handle <iframe>s
|
|
1238
|
+
root: o.ownerDocument
|
|
1239
|
+
});
|
|
1240
|
+
} catch {
|
|
1241
|
+
n = new IntersectionObserver(y, C);
|
|
1242
|
+
}
|
|
1243
|
+
n.observe(e);
|
|
1244
|
+
}
|
|
1245
|
+
return s(!0), i;
|
|
1246
|
+
}
|
|
1247
|
+
function Yo(e, t, n, r) {
|
|
1248
|
+
r === void 0 && (r = {});
|
|
1249
|
+
const {
|
|
1250
|
+
ancestorScroll: o = !0,
|
|
1251
|
+
ancestorResize: i = !0,
|
|
1252
|
+
elementResize: s = typeof ResizeObserver == "function",
|
|
1253
|
+
layoutShift: c = typeof IntersectionObserver == "function",
|
|
1254
|
+
animationFrame: u = !1
|
|
1255
|
+
} = r, l = jt(e), g = o || i ? [...l ? Se(l) : [], ...Se(t)] : [];
|
|
1256
|
+
g.forEach((E) => {
|
|
1257
|
+
o && E.addEventListener("scroll", n, {
|
|
1258
|
+
passive: !0
|
|
1259
|
+
}), i && E.addEventListener("resize", n);
|
|
1260
|
+
});
|
|
1261
|
+
const f = l && c ? co(l, n) : null;
|
|
1262
|
+
let h = -1, a = null;
|
|
1263
|
+
s && (a = new ResizeObserver((E) => {
|
|
1264
|
+
let [C] = E;
|
|
1265
|
+
C && C.target === l && a && (a.unobserve(t), cancelAnimationFrame(h), h = requestAnimationFrame(() => {
|
|
1266
|
+
var b;
|
|
1267
|
+
(b = a) == null || b.observe(t);
|
|
1268
|
+
})), n();
|
|
1269
|
+
}), l && !u && a.observe(l), a.observe(t));
|
|
1270
|
+
let m, p = u ? Ve(e) : null;
|
|
1271
|
+
u && R();
|
|
1272
|
+
function R() {
|
|
1273
|
+
const E = Ve(e);
|
|
1274
|
+
p && (E.x !== p.x || E.y !== p.y || E.width !== p.width || E.height !== p.height) && n(), p = E, m = requestAnimationFrame(R);
|
|
1275
|
+
}
|
|
1276
|
+
return n(), () => {
|
|
1277
|
+
var E;
|
|
1278
|
+
g.forEach((C) => {
|
|
1279
|
+
o && C.removeEventListener("scroll", n), i && C.removeEventListener("resize", n);
|
|
1280
|
+
}), f == null || f(), (E = a) == null || E.disconnect(), a = null, u && cancelAnimationFrame(m);
|
|
1281
|
+
};
|
|
1282
|
+
}
|
|
1283
|
+
const lo = Hr, uo = zr, ao = Kr, fo = Ur, rn = Br, mo = qr, go = (e, t, n) => {
|
|
1284
|
+
const r = /* @__PURE__ */ new Map(), o = {
|
|
1285
|
+
platform: so,
|
|
1286
|
+
...n
|
|
1287
|
+
}, i = {
|
|
1288
|
+
...o.platform,
|
|
1289
|
+
_c: r
|
|
1290
|
+
};
|
|
1291
|
+
return Wr(e, t, {
|
|
1292
|
+
...o,
|
|
1293
|
+
platform: i
|
|
1294
|
+
});
|
|
1295
|
+
};
|
|
1296
|
+
var at = typeof document < "u" ? Tn : On;
|
|
1297
|
+
function xt(e, t) {
|
|
1298
|
+
if (e === t)
|
|
1299
|
+
return !0;
|
|
1300
|
+
if (typeof e != typeof t)
|
|
1301
|
+
return !1;
|
|
1302
|
+
if (typeof e == "function" && e.toString() === t.toString())
|
|
1303
|
+
return !0;
|
|
1304
|
+
let n, r, o;
|
|
1305
|
+
if (e && t && typeof e == "object") {
|
|
1306
|
+
if (Array.isArray(e)) {
|
|
1307
|
+
if (n = e.length, n !== t.length)
|
|
1308
|
+
return !1;
|
|
1309
|
+
for (r = n; r-- !== 0; )
|
|
1310
|
+
if (!xt(e[r], t[r]))
|
|
1311
|
+
return !1;
|
|
1312
|
+
return !0;
|
|
1313
|
+
}
|
|
1314
|
+
if (o = Object.keys(e), n = o.length, n !== Object.keys(t).length)
|
|
1315
|
+
return !1;
|
|
1316
|
+
for (r = n; r-- !== 0; )
|
|
1317
|
+
if (!{}.hasOwnProperty.call(t, o[r]))
|
|
1318
|
+
return !1;
|
|
1319
|
+
for (r = n; r-- !== 0; ) {
|
|
1320
|
+
const i = o[r];
|
|
1321
|
+
if (!(i === "_owner" && e.$$typeof) && !xt(e[i], t[i]))
|
|
1322
|
+
return !1;
|
|
1323
|
+
}
|
|
1324
|
+
return !0;
|
|
1325
|
+
}
|
|
1326
|
+
return e !== e && t !== t;
|
|
1327
|
+
}
|
|
1328
|
+
function Un(e) {
|
|
1329
|
+
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
1330
|
+
}
|
|
1331
|
+
function on(e, t) {
|
|
1332
|
+
const n = Un(e);
|
|
1333
|
+
return Math.round(t * n) / n;
|
|
1334
|
+
}
|
|
1335
|
+
function sn(e) {
|
|
1336
|
+
const t = d.useRef(e);
|
|
1337
|
+
return at(() => {
|
|
1338
|
+
t.current = e;
|
|
1339
|
+
}), t;
|
|
1340
|
+
}
|
|
1341
|
+
function po(e) {
|
|
1342
|
+
e === void 0 && (e = {});
|
|
1343
|
+
const {
|
|
1344
|
+
placement: t = "bottom",
|
|
1345
|
+
strategy: n = "absolute",
|
|
1346
|
+
middleware: r = [],
|
|
1347
|
+
platform: o,
|
|
1348
|
+
elements: {
|
|
1349
|
+
reference: i,
|
|
1350
|
+
floating: s
|
|
1351
|
+
} = {},
|
|
1352
|
+
transform: c = !0,
|
|
1353
|
+
whileElementsMounted: u,
|
|
1354
|
+
open: l
|
|
1355
|
+
} = e, [g, f] = d.useState({
|
|
1356
|
+
x: 0,
|
|
1357
|
+
y: 0,
|
|
1358
|
+
strategy: n,
|
|
1359
|
+
placement: t,
|
|
1360
|
+
middlewareData: {},
|
|
1361
|
+
isPositioned: !1
|
|
1362
|
+
}), [h, a] = d.useState(r);
|
|
1363
|
+
xt(h, r) || a(r);
|
|
1364
|
+
const [m, p] = d.useState(null), [R, E] = d.useState(null), C = d.useCallback((x) => {
|
|
1365
|
+
x !== P.current && (P.current = x, p(x));
|
|
1366
|
+
}, []), b = d.useCallback((x) => {
|
|
1367
|
+
x !== V.current && (V.current = x, E(x));
|
|
1368
|
+
}, []), y = i || m, A = s || R, P = d.useRef(null), V = d.useRef(null), B = d.useRef(g), H = u != null, O = sn(u), D = sn(o), M = d.useCallback(() => {
|
|
1369
|
+
if (!P.current || !V.current)
|
|
1370
|
+
return;
|
|
1371
|
+
const x = {
|
|
1372
|
+
placement: t,
|
|
1373
|
+
strategy: n,
|
|
1374
|
+
middleware: h
|
|
1375
|
+
};
|
|
1376
|
+
D.current && (x.platform = D.current), go(P.current, V.current, x).then((k) => {
|
|
1377
|
+
const _ = {
|
|
1378
|
+
...k,
|
|
1379
|
+
isPositioned: !0
|
|
1380
|
+
};
|
|
1381
|
+
S.current && !xt(B.current, _) && (B.current = _, Sn.flushSync(() => {
|
|
1382
|
+
f(_);
|
|
1383
|
+
}));
|
|
1384
|
+
});
|
|
1385
|
+
}, [h, t, n, D]);
|
|
1386
|
+
at(() => {
|
|
1387
|
+
l === !1 && B.current.isPositioned && (B.current.isPositioned = !1, f((x) => ({
|
|
1388
|
+
...x,
|
|
1389
|
+
isPositioned: !1
|
|
1390
|
+
})));
|
|
1391
|
+
}, [l]);
|
|
1392
|
+
const S = d.useRef(!1);
|
|
1393
|
+
at(() => (S.current = !0, () => {
|
|
1394
|
+
S.current = !1;
|
|
1395
|
+
}), []), at(() => {
|
|
1396
|
+
if (y && (P.current = y), A && (V.current = A), y && A) {
|
|
1397
|
+
if (O.current)
|
|
1398
|
+
return O.current(y, A, M);
|
|
1399
|
+
M();
|
|
1400
|
+
}
|
|
1401
|
+
}, [y, A, M, O, H]);
|
|
1402
|
+
const v = d.useMemo(() => ({
|
|
1403
|
+
reference: P,
|
|
1404
|
+
floating: V,
|
|
1405
|
+
setReference: C,
|
|
1406
|
+
setFloating: b
|
|
1407
|
+
}), [C, b]), w = d.useMemo(() => ({
|
|
1408
|
+
reference: y,
|
|
1409
|
+
floating: A
|
|
1410
|
+
}), [y, A]), I = d.useMemo(() => {
|
|
1411
|
+
const x = {
|
|
1412
|
+
position: n,
|
|
1413
|
+
left: 0,
|
|
1414
|
+
top: 0
|
|
1415
|
+
};
|
|
1416
|
+
if (!w.floating)
|
|
1417
|
+
return x;
|
|
1418
|
+
const k = on(w.floating, g.x), _ = on(w.floating, g.y);
|
|
1419
|
+
return c ? {
|
|
1420
|
+
...x,
|
|
1421
|
+
transform: "translate(" + k + "px, " + _ + "px)",
|
|
1422
|
+
...Un(w.floating) >= 1.5 && {
|
|
1423
|
+
willChange: "transform"
|
|
1424
|
+
}
|
|
1425
|
+
} : {
|
|
1426
|
+
position: n,
|
|
1427
|
+
left: k,
|
|
1428
|
+
top: _
|
|
1429
|
+
};
|
|
1430
|
+
}, [n, c, w.floating, g.x, g.y]);
|
|
1431
|
+
return d.useMemo(() => ({
|
|
1432
|
+
...g,
|
|
1433
|
+
update: M,
|
|
1434
|
+
refs: v,
|
|
1435
|
+
elements: w,
|
|
1436
|
+
floatingStyles: I
|
|
1437
|
+
}), [g, M, v, w, I]);
|
|
1438
|
+
}
|
|
1439
|
+
const ho = (e) => {
|
|
1440
|
+
function t(n) {
|
|
1441
|
+
return {}.hasOwnProperty.call(n, "current");
|
|
1442
|
+
}
|
|
1443
|
+
return {
|
|
1444
|
+
name: "arrow",
|
|
1445
|
+
options: e,
|
|
1446
|
+
fn(n) {
|
|
1447
|
+
const {
|
|
1448
|
+
element: r,
|
|
1449
|
+
padding: o
|
|
1450
|
+
} = typeof e == "function" ? e(n) : e;
|
|
1451
|
+
return r && t(r) ? r.current != null ? rn({
|
|
1452
|
+
element: r.current,
|
|
1453
|
+
padding: o
|
|
1454
|
+
}).fn(n) : {} : r ? rn({
|
|
1455
|
+
element: r,
|
|
1456
|
+
padding: o
|
|
1457
|
+
}).fn(n) : {};
|
|
1458
|
+
}
|
|
1459
|
+
};
|
|
1460
|
+
}, Go = (e, t) => ({
|
|
1461
|
+
...lo(e),
|
|
1462
|
+
options: [e, t]
|
|
1463
|
+
}), Xo = (e, t) => ({
|
|
1464
|
+
...uo(e),
|
|
1465
|
+
options: [e, t]
|
|
1466
|
+
}), Zo = (e, t) => ({
|
|
1467
|
+
...mo(e),
|
|
1468
|
+
options: [e, t]
|
|
1469
|
+
}), Jo = (e, t) => ({
|
|
1470
|
+
...ao(e),
|
|
1471
|
+
options: [e, t]
|
|
1472
|
+
}), Qo = (e, t) => ({
|
|
1473
|
+
...fo(e),
|
|
1474
|
+
options: [e, t]
|
|
1475
|
+
}), ei = (e, t) => ({
|
|
1476
|
+
...ho(e),
|
|
1477
|
+
options: [e, t]
|
|
1478
|
+
});
|
|
1479
|
+
function ti(e) {
|
|
1480
|
+
return d.useMemo(() => e.every((t) => t == null) ? null : (t) => {
|
|
1481
|
+
e.forEach((n) => {
|
|
1482
|
+
typeof n == "function" ? n(t) : n != null && (n.current = t);
|
|
1483
|
+
});
|
|
1484
|
+
}, e);
|
|
1485
|
+
}
|
|
1486
|
+
const jn = {
|
|
1487
|
+
...d
|
|
1488
|
+
}, vo = jn.useInsertionEffect, bo = vo || ((e) => e());
|
|
1489
|
+
function ie(e) {
|
|
1490
|
+
const t = d.useRef(() => {
|
|
1491
|
+
if (process.env.NODE_ENV !== "production")
|
|
1492
|
+
throw new Error("Cannot call an event handler while rendering.");
|
|
1493
|
+
});
|
|
1494
|
+
return bo(() => {
|
|
1495
|
+
t.current = e;
|
|
1496
|
+
}), d.useCallback(function() {
|
|
1497
|
+
for (var n = arguments.length, r = new Array(n), o = 0; o < n; o++)
|
|
1498
|
+
r[o] = arguments[o];
|
|
1499
|
+
return t.current == null ? void 0 : t.current(...r);
|
|
1500
|
+
}, []);
|
|
1501
|
+
}
|
|
1502
|
+
const Yt = "ArrowUp", nt = "ArrowDown", He = "ArrowLeft", Ue = "ArrowRight";
|
|
1503
|
+
function ct(e, t, n) {
|
|
1504
|
+
return Math.floor(e / t) !== n;
|
|
1505
|
+
}
|
|
1506
|
+
function Ge(e, t) {
|
|
1507
|
+
return t < 0 || t >= e.current.length;
|
|
1508
|
+
}
|
|
1509
|
+
function Ot(e, t) {
|
|
1510
|
+
return se(e, {
|
|
1511
|
+
disabledIndices: t
|
|
1512
|
+
});
|
|
1513
|
+
}
|
|
1514
|
+
function cn(e, t) {
|
|
1515
|
+
return se(e, {
|
|
1516
|
+
decrement: !0,
|
|
1517
|
+
startingIndex: e.current.length,
|
|
1518
|
+
disabledIndices: t
|
|
1519
|
+
});
|
|
1520
|
+
}
|
|
1521
|
+
function se(e, t) {
|
|
1522
|
+
let {
|
|
1523
|
+
startingIndex: n = -1,
|
|
1524
|
+
decrement: r = !1,
|
|
1525
|
+
disabledIndices: o,
|
|
1526
|
+
amount: i = 1
|
|
1527
|
+
} = t === void 0 ? {} : t;
|
|
1528
|
+
const s = e.current;
|
|
1529
|
+
let c = n;
|
|
1530
|
+
do
|
|
1531
|
+
c += r ? -i : i;
|
|
1532
|
+
while (c >= 0 && c <= s.length - 1 && ft(s, c, o));
|
|
1533
|
+
return c;
|
|
1534
|
+
}
|
|
1535
|
+
function yo(e, t) {
|
|
1536
|
+
let {
|
|
1537
|
+
event: n,
|
|
1538
|
+
orientation: r,
|
|
1539
|
+
loop: o,
|
|
1540
|
+
cols: i,
|
|
1541
|
+
disabledIndices: s,
|
|
1542
|
+
minIndex: c,
|
|
1543
|
+
maxIndex: u,
|
|
1544
|
+
prevIndex: l,
|
|
1545
|
+
stopEvent: g = !1
|
|
1546
|
+
} = t, f = l;
|
|
1547
|
+
if (n.key === Yt) {
|
|
1548
|
+
if (g && oe(n), l === -1)
|
|
1549
|
+
f = u;
|
|
1550
|
+
else if (f = se(e, {
|
|
1551
|
+
startingIndex: f,
|
|
1552
|
+
amount: i,
|
|
1553
|
+
decrement: !0,
|
|
1554
|
+
disabledIndices: s
|
|
1555
|
+
}), o && (l - i < c || f < 0)) {
|
|
1556
|
+
const h = l % i, a = u % i, m = u - (a - h);
|
|
1557
|
+
a === h ? f = u : f = a > h ? m : m - i;
|
|
1558
|
+
}
|
|
1559
|
+
Ge(e, f) && (f = l);
|
|
1560
|
+
}
|
|
1561
|
+
if (n.key === nt && (g && oe(n), l === -1 ? f = c : (f = se(e, {
|
|
1562
|
+
startingIndex: l,
|
|
1563
|
+
amount: i,
|
|
1564
|
+
disabledIndices: s
|
|
1565
|
+
}), o && l + i > u && (f = se(e, {
|
|
1566
|
+
startingIndex: l % i - i,
|
|
1567
|
+
amount: i,
|
|
1568
|
+
disabledIndices: s
|
|
1569
|
+
}))), Ge(e, f) && (f = l)), r === "both") {
|
|
1570
|
+
const h = Be(l / i);
|
|
1571
|
+
n.key === Ue && (g && oe(n), l % i !== i - 1 ? (f = se(e, {
|
|
1572
|
+
startingIndex: l,
|
|
1573
|
+
disabledIndices: s
|
|
1574
|
+
}), o && ct(f, i, h) && (f = se(e, {
|
|
1575
|
+
startingIndex: l - l % i - 1,
|
|
1576
|
+
disabledIndices: s
|
|
1577
|
+
}))) : o && (f = se(e, {
|
|
1578
|
+
startingIndex: l - l % i - 1,
|
|
1579
|
+
disabledIndices: s
|
|
1580
|
+
})), ct(f, i, h) && (f = l)), n.key === He && (g && oe(n), l % i !== 0 ? (f = se(e, {
|
|
1581
|
+
startingIndex: l,
|
|
1582
|
+
decrement: !0,
|
|
1583
|
+
disabledIndices: s
|
|
1584
|
+
}), o && ct(f, i, h) && (f = se(e, {
|
|
1585
|
+
startingIndex: l + (i - l % i),
|
|
1586
|
+
decrement: !0,
|
|
1587
|
+
disabledIndices: s
|
|
1588
|
+
}))) : o && (f = se(e, {
|
|
1589
|
+
startingIndex: l + (i - l % i),
|
|
1590
|
+
decrement: !0,
|
|
1591
|
+
disabledIndices: s
|
|
1592
|
+
})), ct(f, i, h) && (f = l));
|
|
1593
|
+
const a = Be(u / i) === h;
|
|
1594
|
+
Ge(e, f) && (o && a ? f = n.key === He ? u : se(e, {
|
|
1595
|
+
startingIndex: l - l % i - 1,
|
|
1596
|
+
disabledIndices: s
|
|
1597
|
+
}) : f = l);
|
|
1598
|
+
}
|
|
1599
|
+
return f;
|
|
1600
|
+
}
|
|
1601
|
+
function xo(e, t, n) {
|
|
1602
|
+
const r = [];
|
|
1603
|
+
let o = 0;
|
|
1604
|
+
return e.forEach((i, s) => {
|
|
1605
|
+
let {
|
|
1606
|
+
width: c,
|
|
1607
|
+
height: u
|
|
1608
|
+
} = i;
|
|
1609
|
+
if (c > t && process.env.NODE_ENV !== "production")
|
|
1610
|
+
throw new Error("[Floating UI]: Invalid grid - item width at index " + s + " is greater than grid columns");
|
|
1611
|
+
let l = !1;
|
|
1612
|
+
for (n && (o = 0); !l; ) {
|
|
1613
|
+
const g = [];
|
|
1614
|
+
for (let f = 0; f < c; f++)
|
|
1615
|
+
for (let h = 0; h < u; h++)
|
|
1616
|
+
g.push(o + f + h * t);
|
|
1617
|
+
o % t + c <= t && g.every((f) => r[f] == null) ? (g.forEach((f) => {
|
|
1618
|
+
r[f] = s;
|
|
1619
|
+
}), l = !0) : o++;
|
|
1620
|
+
}
|
|
1621
|
+
}), [...r];
|
|
1622
|
+
}
|
|
1623
|
+
function wo(e, t, n, r, o) {
|
|
1624
|
+
if (e === -1)
|
|
1625
|
+
return -1;
|
|
1626
|
+
const i = n.indexOf(e), s = t[e];
|
|
1627
|
+
switch (o) {
|
|
1628
|
+
case "tl":
|
|
1629
|
+
return i;
|
|
1630
|
+
case "tr":
|
|
1631
|
+
return s ? i + s.width - 1 : i;
|
|
1632
|
+
case "bl":
|
|
1633
|
+
return s ? i + (s.height - 1) * r : i;
|
|
1634
|
+
case "br":
|
|
1635
|
+
return n.lastIndexOf(e);
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
function Ro(e, t) {
|
|
1639
|
+
return t.flatMap((n, r) => e.includes(n) ? [r] : []);
|
|
1640
|
+
}
|
|
1641
|
+
function ft(e, t, n) {
|
|
1642
|
+
if (n)
|
|
1643
|
+
return n.includes(t);
|
|
1644
|
+
const r = e[t];
|
|
1645
|
+
return r == null || r.hasAttribute("disabled") || r.getAttribute("aria-disabled") === "true";
|
|
1646
|
+
}
|
|
1647
|
+
let ln = 0;
|
|
1648
|
+
function Oe(e, t) {
|
|
1649
|
+
t === void 0 && (t = {});
|
|
1650
|
+
const {
|
|
1651
|
+
preventScroll: n = !1,
|
|
1652
|
+
cancelPrevious: r = !0,
|
|
1653
|
+
sync: o = !1
|
|
1654
|
+
} = t;
|
|
1655
|
+
r && cancelAnimationFrame(ln);
|
|
1656
|
+
const i = () => e == null ? void 0 : e.focus({
|
|
1657
|
+
preventScroll: n
|
|
1658
|
+
});
|
|
1659
|
+
o ? i() : ln = requestAnimationFrame(i);
|
|
1660
|
+
}
|
|
1661
|
+
var U = typeof document < "u" ? Tn : On;
|
|
1662
|
+
function Eo(e, t) {
|
|
1663
|
+
const n = e.compareDocumentPosition(t);
|
|
1664
|
+
return n & Node.DOCUMENT_POSITION_FOLLOWING || n & Node.DOCUMENT_POSITION_CONTAINED_BY ? -1 : n & Node.DOCUMENT_POSITION_PRECEDING || n & Node.DOCUMENT_POSITION_CONTAINS ? 1 : 0;
|
|
1665
|
+
}
|
|
1666
|
+
function Co(e, t) {
|
|
1667
|
+
if (e.size !== t.size)
|
|
1668
|
+
return !1;
|
|
1669
|
+
for (const [n, r] of e.entries())
|
|
1670
|
+
if (r !== t.get(n))
|
|
1671
|
+
return !1;
|
|
1672
|
+
return !0;
|
|
1673
|
+
}
|
|
1674
|
+
const Yn = /* @__PURE__ */ d.createContext({
|
|
1675
|
+
register: () => {
|
|
1676
|
+
},
|
|
1677
|
+
unregister: () => {
|
|
1678
|
+
},
|
|
1679
|
+
map: /* @__PURE__ */ new Map(),
|
|
1680
|
+
elementsRef: {
|
|
1681
|
+
current: []
|
|
1682
|
+
}
|
|
1683
|
+
});
|
|
1684
|
+
function ni(e) {
|
|
1685
|
+
const {
|
|
1686
|
+
children: t,
|
|
1687
|
+
elementsRef: n,
|
|
1688
|
+
labelsRef: r
|
|
1689
|
+
} = e, [o, i] = d.useState(() => /* @__PURE__ */ new Map()), s = d.useCallback((u) => {
|
|
1690
|
+
i((l) => new Map(l).set(u, null));
|
|
1691
|
+
}, []), c = d.useCallback((u) => {
|
|
1692
|
+
i((l) => {
|
|
1693
|
+
const g = new Map(l);
|
|
1694
|
+
return g.delete(u), g;
|
|
1695
|
+
});
|
|
1696
|
+
}, []);
|
|
1697
|
+
return U(() => {
|
|
1698
|
+
const u = new Map(o);
|
|
1699
|
+
Array.from(u.keys()).sort(Eo).forEach((g, f) => {
|
|
1700
|
+
u.set(g, f);
|
|
1701
|
+
}), Co(o, u) || i(u);
|
|
1702
|
+
}, [o]), /* @__PURE__ */ d.createElement(Yn.Provider, {
|
|
1703
|
+
value: d.useMemo(() => ({
|
|
1704
|
+
register: s,
|
|
1705
|
+
unregister: c,
|
|
1706
|
+
map: o,
|
|
1707
|
+
elementsRef: n,
|
|
1708
|
+
labelsRef: r
|
|
1709
|
+
}), [s, c, o, n, r])
|
|
1710
|
+
}, t);
|
|
1711
|
+
}
|
|
1712
|
+
function ri(e) {
|
|
1713
|
+
e === void 0 && (e = {});
|
|
1714
|
+
const {
|
|
1715
|
+
label: t
|
|
1716
|
+
} = e, {
|
|
1717
|
+
register: n,
|
|
1718
|
+
unregister: r,
|
|
1719
|
+
map: o,
|
|
1720
|
+
elementsRef: i,
|
|
1721
|
+
labelsRef: s
|
|
1722
|
+
} = d.useContext(Yn), [c, u] = d.useState(null), l = d.useRef(null), g = d.useCallback((f) => {
|
|
1723
|
+
if (l.current = f, c !== null && (i.current[c] = f, s)) {
|
|
1724
|
+
var h;
|
|
1725
|
+
const a = t !== void 0;
|
|
1726
|
+
s.current[c] = a ? t : (h = f == null ? void 0 : f.textContent) != null ? h : null;
|
|
1727
|
+
}
|
|
1728
|
+
}, [c, i, s, t]);
|
|
1729
|
+
return U(() => {
|
|
1730
|
+
const f = l.current;
|
|
1731
|
+
if (f)
|
|
1732
|
+
return n(f), () => {
|
|
1733
|
+
r(f);
|
|
1734
|
+
};
|
|
1735
|
+
}, [n, r]), U(() => {
|
|
1736
|
+
const f = l.current ? o.get(l.current) : null;
|
|
1737
|
+
f != null && u(f);
|
|
1738
|
+
}, [o]), d.useMemo(() => ({
|
|
1739
|
+
ref: g,
|
|
1740
|
+
index: c ?? -1
|
|
1741
|
+
}), [c, g]);
|
|
1742
|
+
}
|
|
1743
|
+
function Qe() {
|
|
1744
|
+
return Qe = Object.assign ? Object.assign.bind() : function(e) {
|
|
1745
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
1746
|
+
var n = arguments[t];
|
|
1747
|
+
for (var r in n)
|
|
1748
|
+
Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
1749
|
+
}
|
|
1750
|
+
return e;
|
|
1751
|
+
}, Qe.apply(this, arguments);
|
|
1752
|
+
}
|
|
1753
|
+
let un = !1, Io = 0;
|
|
1754
|
+
const an = () => (
|
|
1755
|
+
// Ensure the id is unique with multiple independent versions of Floating UI
|
|
1756
|
+
// on <React 18
|
|
1757
|
+
"floating-ui-" + Math.random().toString(36).slice(2, 6) + Io++
|
|
1758
|
+
);
|
|
1759
|
+
function To() {
|
|
1760
|
+
const [e, t] = d.useState(() => un ? an() : void 0);
|
|
1761
|
+
return U(() => {
|
|
1762
|
+
e == null && t(an());
|
|
1763
|
+
}, []), d.useEffect(() => {
|
|
1764
|
+
un = !0;
|
|
1765
|
+
}, []), e;
|
|
1766
|
+
}
|
|
1767
|
+
const Oo = jn.useId, rt = Oo || To;
|
|
1768
|
+
let et;
|
|
1769
|
+
process.env.NODE_ENV !== "production" && (et = /* @__PURE__ */ new Set());
|
|
1770
|
+
function dt() {
|
|
1771
|
+
for (var e, t = arguments.length, n = new Array(t), r = 0; r < t; r++)
|
|
1772
|
+
n[r] = arguments[r];
|
|
1773
|
+
const o = "Floating UI: " + n.join(" ");
|
|
1774
|
+
if (!((e = et) != null && e.has(o))) {
|
|
1775
|
+
var i;
|
|
1776
|
+
(i = et) == null || i.add(o), console.warn(o);
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
function So() {
|
|
1780
|
+
for (var e, t = arguments.length, n = new Array(t), r = 0; r < t; r++)
|
|
1781
|
+
n[r] = arguments[r];
|
|
1782
|
+
const o = "Floating UI: " + n.join(" ");
|
|
1783
|
+
if (!((e = et) != null && e.has(o))) {
|
|
1784
|
+
var i;
|
|
1785
|
+
(i = et) == null || i.add(o), console.error(o);
|
|
1786
|
+
}
|
|
1787
|
+
}
|
|
1788
|
+
const oi = /* @__PURE__ */ d.forwardRef(function(t, n) {
|
|
1789
|
+
const {
|
|
1790
|
+
context: {
|
|
1791
|
+
placement: r,
|
|
1792
|
+
elements: {
|
|
1793
|
+
floating: o
|
|
1794
|
+
},
|
|
1795
|
+
middlewareData: {
|
|
1796
|
+
arrow: i
|
|
1797
|
+
}
|
|
1798
|
+
},
|
|
1799
|
+
width: s = 14,
|
|
1800
|
+
height: c = 7,
|
|
1801
|
+
tipRadius: u = 0,
|
|
1802
|
+
strokeWidth: l = 0,
|
|
1803
|
+
staticOffset: g,
|
|
1804
|
+
stroke: f,
|
|
1805
|
+
d: h,
|
|
1806
|
+
style: {
|
|
1807
|
+
transform: a,
|
|
1808
|
+
...m
|
|
1809
|
+
} = {},
|
|
1810
|
+
...p
|
|
1811
|
+
} = t;
|
|
1812
|
+
process.env.NODE_ENV !== "production" && (n || dt("The `ref` prop is required for `FloatingArrow`."));
|
|
1813
|
+
const R = rt(), [E, C] = d.useState(!1);
|
|
1814
|
+
if (U(() => {
|
|
1815
|
+
if (!o)
|
|
1816
|
+
return;
|
|
1817
|
+
me(o).direction === "rtl" && C(!0);
|
|
1818
|
+
}, [o]), !o)
|
|
1819
|
+
return null;
|
|
1820
|
+
const b = l * 2, y = b / 2, A = s / 2 * (u / -8 + 1), P = c / 2 * u / 4, [V, B] = r.split("-"), H = !!h, O = V === "top" || V === "bottom", D = g && B === "end" ? "bottom" : "top";
|
|
1821
|
+
let M = g && B === "end" ? "right" : "left";
|
|
1822
|
+
g && E && (M = B === "end" ? "left" : "right");
|
|
1823
|
+
const S = (i == null ? void 0 : i.x) != null ? g || i.x : "", v = (i == null ? void 0 : i.y) != null ? g || i.y : "", w = h || "M0,0" + (" H" + s) + (" L" + (s - A) + "," + (c - P)) + (" Q" + s / 2 + "," + c + " " + A + "," + (c - P)) + " Z", I = {
|
|
1824
|
+
top: H ? "rotate(180deg)" : "",
|
|
1825
|
+
left: H ? "rotate(90deg)" : "rotate(-90deg)",
|
|
1826
|
+
bottom: H ? "" : "rotate(180deg)",
|
|
1827
|
+
right: H ? "rotate(-90deg)" : "rotate(90deg)"
|
|
1828
|
+
}[V];
|
|
1829
|
+
return /* @__PURE__ */ d.createElement("svg", Qe({}, p, {
|
|
1830
|
+
"aria-hidden": !0,
|
|
1831
|
+
ref: n,
|
|
1832
|
+
width: H ? s : s + b,
|
|
1833
|
+
height: s,
|
|
1834
|
+
viewBox: "0 0 " + s + " " + (c > s ? c : s),
|
|
1835
|
+
style: {
|
|
1836
|
+
position: "absolute",
|
|
1837
|
+
pointerEvents: "none",
|
|
1838
|
+
[M]: S,
|
|
1839
|
+
[D]: v,
|
|
1840
|
+
[V]: O || H ? "100%" : "calc(100% - " + b / 2 + "px)",
|
|
1841
|
+
transform: "" + I + (a ?? ""),
|
|
1842
|
+
...m
|
|
1843
|
+
}
|
|
1844
|
+
}), b > 0 && /* @__PURE__ */ d.createElement("path", {
|
|
1845
|
+
clipPath: "url(#" + R + ")",
|
|
1846
|
+
fill: "none",
|
|
1847
|
+
stroke: f,
|
|
1848
|
+
strokeWidth: b + (h ? 0 : 1),
|
|
1849
|
+
d: w
|
|
1850
|
+
}), /* @__PURE__ */ d.createElement("path", {
|
|
1851
|
+
stroke: b && !h ? p.fill : "none",
|
|
1852
|
+
d: w
|
|
1853
|
+
}), /* @__PURE__ */ d.createElement("clipPath", {
|
|
1854
|
+
id: R
|
|
1855
|
+
}, /* @__PURE__ */ d.createElement("rect", {
|
|
1856
|
+
x: -y,
|
|
1857
|
+
y: y * (H ? -1 : 1),
|
|
1858
|
+
width: s + b,
|
|
1859
|
+
height: s
|
|
1860
|
+
})));
|
|
1861
|
+
});
|
|
1862
|
+
function Gn() {
|
|
1863
|
+
const e = /* @__PURE__ */ new Map();
|
|
1864
|
+
return {
|
|
1865
|
+
emit(t, n) {
|
|
1866
|
+
var r;
|
|
1867
|
+
(r = e.get(t)) == null || r.forEach((o) => o(n));
|
|
1868
|
+
},
|
|
1869
|
+
on(t, n) {
|
|
1870
|
+
e.set(t, [...e.get(t) || [], n]);
|
|
1871
|
+
},
|
|
1872
|
+
off(t, n) {
|
|
1873
|
+
var r;
|
|
1874
|
+
e.set(t, ((r = e.get(t)) == null ? void 0 : r.filter((o) => o !== n)) || []);
|
|
1875
|
+
}
|
|
1876
|
+
};
|
|
1877
|
+
}
|
|
1878
|
+
const Xn = /* @__PURE__ */ d.createContext(null), Zn = /* @__PURE__ */ d.createContext(null), je = () => {
|
|
1879
|
+
var e;
|
|
1880
|
+
return ((e = d.useContext(Xn)) == null ? void 0 : e.id) || null;
|
|
1881
|
+
}, Ye = () => d.useContext(Zn);
|
|
1882
|
+
function ii(e) {
|
|
1883
|
+
const t = rt(), n = Ye(), r = je(), o = e || r;
|
|
1884
|
+
return U(() => {
|
|
1885
|
+
const i = {
|
|
1886
|
+
id: t,
|
|
1887
|
+
parentId: o
|
|
1888
|
+
};
|
|
1889
|
+
return n == null || n.addNode(i), () => {
|
|
1890
|
+
n == null || n.removeNode(i);
|
|
1891
|
+
};
|
|
1892
|
+
}, [n, t, o]), t;
|
|
1893
|
+
}
|
|
1894
|
+
function si(e) {
|
|
1895
|
+
const {
|
|
1896
|
+
children: t,
|
|
1897
|
+
id: n
|
|
1898
|
+
} = e, r = je();
|
|
1899
|
+
return /* @__PURE__ */ d.createElement(Xn.Provider, {
|
|
1900
|
+
value: d.useMemo(() => ({
|
|
1901
|
+
id: n,
|
|
1902
|
+
parentId: r
|
|
1903
|
+
}), [n, r])
|
|
1904
|
+
}, t);
|
|
1905
|
+
}
|
|
1906
|
+
function ci(e) {
|
|
1907
|
+
const {
|
|
1908
|
+
children: t
|
|
1909
|
+
} = e, n = d.useRef([]), r = d.useCallback((s) => {
|
|
1910
|
+
n.current = [...n.current, s];
|
|
1911
|
+
}, []), o = d.useCallback((s) => {
|
|
1912
|
+
n.current = n.current.filter((c) => c !== s);
|
|
1913
|
+
}, []), i = d.useState(() => Gn())[0];
|
|
1914
|
+
return /* @__PURE__ */ d.createElement(Zn.Provider, {
|
|
1915
|
+
value: d.useMemo(() => ({
|
|
1916
|
+
nodesRef: n,
|
|
1917
|
+
addNode: r,
|
|
1918
|
+
removeNode: o,
|
|
1919
|
+
events: i
|
|
1920
|
+
}), [r, o, i])
|
|
1921
|
+
}, t);
|
|
1922
|
+
}
|
|
1923
|
+
function De(e) {
|
|
1924
|
+
return "data-floating-ui-" + e;
|
|
1925
|
+
}
|
|
1926
|
+
function de(e) {
|
|
1927
|
+
const t = sr(e);
|
|
1928
|
+
return U(() => {
|
|
1929
|
+
t.current = e;
|
|
1930
|
+
}), t;
|
|
1931
|
+
}
|
|
1932
|
+
const fn = /* @__PURE__ */ De("safe-polygon");
|
|
1933
|
+
function mt(e, t, n) {
|
|
1934
|
+
return n && !Ze(n) ? 0 : typeof e == "number" ? e : e == null ? void 0 : e[t];
|
|
1935
|
+
}
|
|
1936
|
+
function li(e, t) {
|
|
1937
|
+
t === void 0 && (t = {});
|
|
1938
|
+
const {
|
|
1939
|
+
open: n,
|
|
1940
|
+
onOpenChange: r,
|
|
1941
|
+
dataRef: o,
|
|
1942
|
+
events: i,
|
|
1943
|
+
elements: s
|
|
1944
|
+
} = e, {
|
|
1945
|
+
enabled: c = !0,
|
|
1946
|
+
delay: u = 0,
|
|
1947
|
+
handleClose: l = null,
|
|
1948
|
+
mouseOnly: g = !1,
|
|
1949
|
+
restMs: f = 0,
|
|
1950
|
+
move: h = !0
|
|
1951
|
+
} = t, a = Ye(), m = je(), p = de(l), R = de(u), E = de(n), C = d.useRef(), b = d.useRef(-1), y = d.useRef(), A = d.useRef(-1), P = d.useRef(!0), V = d.useRef(!1), B = d.useRef(() => {
|
|
1952
|
+
}), H = d.useCallback(() => {
|
|
1953
|
+
var w;
|
|
1954
|
+
const I = (w = o.current.openEvent) == null ? void 0 : w.type;
|
|
1955
|
+
return (I == null ? void 0 : I.includes("mouse")) && I !== "mousedown";
|
|
1956
|
+
}, [o]);
|
|
1957
|
+
d.useEffect(() => {
|
|
1958
|
+
if (!c)
|
|
1959
|
+
return;
|
|
1960
|
+
function w(I) {
|
|
1961
|
+
let {
|
|
1962
|
+
open: x
|
|
1963
|
+
} = I;
|
|
1964
|
+
x || (clearTimeout(b.current), clearTimeout(A.current), P.current = !0);
|
|
1965
|
+
}
|
|
1966
|
+
return i.on("openchange", w), () => {
|
|
1967
|
+
i.off("openchange", w);
|
|
1968
|
+
};
|
|
1969
|
+
}, [c, i]), d.useEffect(() => {
|
|
1970
|
+
if (!c || !p.current || !n)
|
|
1971
|
+
return;
|
|
1972
|
+
function w(x) {
|
|
1973
|
+
H() && r(!1, x, "hover");
|
|
1974
|
+
}
|
|
1975
|
+
const I = ne(s.floating).documentElement;
|
|
1976
|
+
return I.addEventListener("mouseleave", w), () => {
|
|
1977
|
+
I.removeEventListener("mouseleave", w);
|
|
1978
|
+
};
|
|
1979
|
+
}, [s.floating, n, r, c, p, H]);
|
|
1980
|
+
const O = d.useCallback(function(w, I, x) {
|
|
1981
|
+
I === void 0 && (I = !0), x === void 0 && (x = "hover");
|
|
1982
|
+
const k = mt(R.current, "close", C.current);
|
|
1983
|
+
k && !y.current ? (clearTimeout(b.current), b.current = window.setTimeout(() => r(!1, w, x), k)) : I && (clearTimeout(b.current), r(!1, w, x));
|
|
1984
|
+
}, [R, r]), D = ie(() => {
|
|
1985
|
+
B.current(), y.current = void 0;
|
|
1986
|
+
}), M = ie(() => {
|
|
1987
|
+
if (V.current) {
|
|
1988
|
+
const w = ne(s.floating).body;
|
|
1989
|
+
w.style.pointerEvents = "", w.removeAttribute(fn), V.current = !1;
|
|
1990
|
+
}
|
|
1991
|
+
});
|
|
1992
|
+
d.useEffect(() => {
|
|
1993
|
+
if (!c)
|
|
1994
|
+
return;
|
|
1995
|
+
function w() {
|
|
1996
|
+
return o.current.openEvent ? ["click", "mousedown"].includes(o.current.openEvent.type) : !1;
|
|
1997
|
+
}
|
|
1998
|
+
function I(T) {
|
|
1999
|
+
if (clearTimeout(b.current), P.current = !1, g && !Ze(C.current) || f > 0 && !mt(R.current, "open"))
|
|
2000
|
+
return;
|
|
2001
|
+
const q = mt(R.current, "open", C.current);
|
|
2002
|
+
q ? b.current = window.setTimeout(() => {
|
|
2003
|
+
E.current || r(!0, T, "hover");
|
|
2004
|
+
}, q) : r(!0, T, "hover");
|
|
2005
|
+
}
|
|
2006
|
+
function x(T) {
|
|
2007
|
+
if (w())
|
|
2008
|
+
return;
|
|
2009
|
+
B.current();
|
|
2010
|
+
const q = ne(s.floating);
|
|
2011
|
+
if (clearTimeout(A.current), p.current && o.current.floatingContext) {
|
|
2012
|
+
n || clearTimeout(b.current), y.current = p.current({
|
|
2013
|
+
...o.current.floatingContext,
|
|
2014
|
+
tree: a,
|
|
2015
|
+
x: T.clientX,
|
|
2016
|
+
y: T.clientY,
|
|
2017
|
+
onClose() {
|
|
2018
|
+
M(), D(), O(T, !0, "safe-polygon");
|
|
2019
|
+
}
|
|
2020
|
+
});
|
|
2021
|
+
const ce = y.current;
|
|
2022
|
+
q.addEventListener("mousemove", ce), B.current = () => {
|
|
2023
|
+
q.removeEventListener("mousemove", ce);
|
|
2024
|
+
};
|
|
2025
|
+
return;
|
|
2026
|
+
}
|
|
2027
|
+
(C.current === "touch" ? !ee(s.floating, T.relatedTarget) : !0) && O(T);
|
|
2028
|
+
}
|
|
2029
|
+
function k(T) {
|
|
2030
|
+
w() || o.current.floatingContext && (p.current == null || p.current({
|
|
2031
|
+
...o.current.floatingContext,
|
|
2032
|
+
tree: a,
|
|
2033
|
+
x: T.clientX,
|
|
2034
|
+
y: T.clientY,
|
|
2035
|
+
onClose() {
|
|
2036
|
+
M(), D(), O(T);
|
|
2037
|
+
}
|
|
2038
|
+
})(T));
|
|
2039
|
+
}
|
|
2040
|
+
if (Y(s.domReference)) {
|
|
2041
|
+
var _;
|
|
2042
|
+
const T = s.domReference;
|
|
2043
|
+
return n && T.addEventListener("mouseleave", k), (_ = s.floating) == null || _.addEventListener("mouseleave", k), h && T.addEventListener("mousemove", I, {
|
|
2044
|
+
once: !0
|
|
2045
|
+
}), T.addEventListener("mouseenter", I), T.addEventListener("mouseleave", x), () => {
|
|
2046
|
+
var q;
|
|
2047
|
+
n && T.removeEventListener("mouseleave", k), (q = s.floating) == null || q.removeEventListener("mouseleave", k), h && T.removeEventListener("mousemove", I), T.removeEventListener("mouseenter", I), T.removeEventListener("mouseleave", x);
|
|
2048
|
+
};
|
|
2049
|
+
}
|
|
2050
|
+
}, [s, c, e, g, f, h, O, D, M, r, n, E, a, R, p, o]), U(() => {
|
|
2051
|
+
var w;
|
|
2052
|
+
if (c && n && (w = p.current) != null && w.__options.blockPointerEvents && H()) {
|
|
2053
|
+
const x = ne(s.floating).body;
|
|
2054
|
+
x.setAttribute(fn, ""), x.style.pointerEvents = "none", V.current = !0;
|
|
2055
|
+
const k = s.floating;
|
|
2056
|
+
if (Y(s.domReference) && k) {
|
|
2057
|
+
var I;
|
|
2058
|
+
const _ = s.domReference, T = a == null || (I = a.nodesRef.current.find((q) => q.id === m)) == null || (I = I.context) == null ? void 0 : I.elements.floating;
|
|
2059
|
+
return T && (T.style.pointerEvents = ""), _.style.pointerEvents = "auto", k.style.pointerEvents = "auto", () => {
|
|
2060
|
+
_.style.pointerEvents = "", k.style.pointerEvents = "";
|
|
2061
|
+
};
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
}, [c, n, m, s, a, p, H]), U(() => {
|
|
2065
|
+
n || (C.current = void 0, D(), M());
|
|
2066
|
+
}, [n, D, M]), d.useEffect(() => () => {
|
|
2067
|
+
D(), clearTimeout(b.current), clearTimeout(A.current), M();
|
|
2068
|
+
}, [c, s.domReference, D, M]);
|
|
2069
|
+
const S = d.useMemo(() => {
|
|
2070
|
+
function w(I) {
|
|
2071
|
+
C.current = I.pointerType;
|
|
2072
|
+
}
|
|
2073
|
+
return {
|
|
2074
|
+
onPointerDown: w,
|
|
2075
|
+
onPointerEnter: w,
|
|
2076
|
+
onMouseMove(I) {
|
|
2077
|
+
const {
|
|
2078
|
+
nativeEvent: x
|
|
2079
|
+
} = I;
|
|
2080
|
+
function k() {
|
|
2081
|
+
!P.current && !E.current && r(!0, x, "hover");
|
|
2082
|
+
}
|
|
2083
|
+
g && !Ze(C.current) || n || f === 0 || (clearTimeout(A.current), C.current === "touch" ? k() : A.current = window.setTimeout(k, f));
|
|
2084
|
+
}
|
|
2085
|
+
};
|
|
2086
|
+
}, [g, r, n, E, f]), v = d.useMemo(() => ({
|
|
2087
|
+
onMouseEnter() {
|
|
2088
|
+
clearTimeout(b.current);
|
|
2089
|
+
},
|
|
2090
|
+
onMouseLeave(w) {
|
|
2091
|
+
O(w.nativeEvent, !1);
|
|
2092
|
+
}
|
|
2093
|
+
}), [O]);
|
|
2094
|
+
return d.useMemo(() => c ? {
|
|
2095
|
+
reference: S,
|
|
2096
|
+
floating: v
|
|
2097
|
+
} : {}, [c, S, v]);
|
|
2098
|
+
}
|
|
2099
|
+
const Vt = () => {
|
|
2100
|
+
}, Jn = /* @__PURE__ */ d.createContext({
|
|
2101
|
+
delay: 0,
|
|
2102
|
+
initialDelay: 0,
|
|
2103
|
+
timeoutMs: 0,
|
|
2104
|
+
currentId: null,
|
|
2105
|
+
setCurrentId: Vt,
|
|
2106
|
+
setState: Vt,
|
|
2107
|
+
isInstantPhase: !1
|
|
2108
|
+
}), Mo = () => d.useContext(Jn);
|
|
2109
|
+
function ui(e) {
|
|
2110
|
+
const {
|
|
2111
|
+
children: t,
|
|
2112
|
+
delay: n,
|
|
2113
|
+
timeoutMs: r = 0
|
|
2114
|
+
} = e, [o, i] = d.useReducer((u, l) => ({
|
|
2115
|
+
...u,
|
|
2116
|
+
...l
|
|
2117
|
+
}), {
|
|
2118
|
+
delay: n,
|
|
2119
|
+
timeoutMs: r,
|
|
2120
|
+
initialDelay: n,
|
|
2121
|
+
currentId: null,
|
|
2122
|
+
isInstantPhase: !1
|
|
2123
|
+
}), s = d.useRef(null), c = d.useCallback((u) => {
|
|
2124
|
+
i({
|
|
2125
|
+
currentId: u
|
|
2126
|
+
});
|
|
2127
|
+
}, []);
|
|
2128
|
+
return U(() => {
|
|
2129
|
+
o.currentId ? s.current === null ? s.current = o.currentId : o.isInstantPhase || i({
|
|
2130
|
+
isInstantPhase: !0
|
|
2131
|
+
}) : (o.isInstantPhase && i({
|
|
2132
|
+
isInstantPhase: !1
|
|
2133
|
+
}), s.current = null);
|
|
2134
|
+
}, [o.currentId, o.isInstantPhase]), /* @__PURE__ */ d.createElement(Jn.Provider, {
|
|
2135
|
+
value: d.useMemo(() => ({
|
|
2136
|
+
...o,
|
|
2137
|
+
setState: i,
|
|
2138
|
+
setCurrentId: c
|
|
2139
|
+
}), [o, c])
|
|
2140
|
+
}, t);
|
|
2141
|
+
}
|
|
2142
|
+
function ai(e, t) {
|
|
2143
|
+
t === void 0 && (t = {});
|
|
2144
|
+
const {
|
|
2145
|
+
open: n,
|
|
2146
|
+
onOpenChange: r,
|
|
2147
|
+
floatingId: o
|
|
2148
|
+
} = e, {
|
|
2149
|
+
id: i
|
|
2150
|
+
} = t, s = i ?? o, c = Mo(), {
|
|
2151
|
+
currentId: u,
|
|
2152
|
+
setCurrentId: l,
|
|
2153
|
+
initialDelay: g,
|
|
2154
|
+
setState: f,
|
|
2155
|
+
timeoutMs: h
|
|
2156
|
+
} = c;
|
|
2157
|
+
return U(() => {
|
|
2158
|
+
u && (f({
|
|
2159
|
+
delay: {
|
|
2160
|
+
open: 1,
|
|
2161
|
+
close: mt(g, "close")
|
|
2162
|
+
}
|
|
2163
|
+
}), u !== s && r(!1));
|
|
2164
|
+
}, [s, r, f, u, g]), U(() => {
|
|
2165
|
+
function a() {
|
|
2166
|
+
r(!1), f({
|
|
2167
|
+
delay: g,
|
|
2168
|
+
currentId: null
|
|
2169
|
+
});
|
|
2170
|
+
}
|
|
2171
|
+
if (u && !n && u === s) {
|
|
2172
|
+
if (h) {
|
|
2173
|
+
const m = window.setTimeout(a, h);
|
|
2174
|
+
return () => {
|
|
2175
|
+
clearTimeout(m);
|
|
2176
|
+
};
|
|
2177
|
+
}
|
|
2178
|
+
a();
|
|
2179
|
+
}
|
|
2180
|
+
}, [n, f, u, s, r, g, h]), U(() => {
|
|
2181
|
+
l === Vt || !n || l(s);
|
|
2182
|
+
}, [n, l, s]), c;
|
|
2183
|
+
}
|
|
2184
|
+
function Ao(e, t) {
|
|
2185
|
+
var n;
|
|
2186
|
+
let r = [], o = (n = e.find((i) => i.id === t)) == null ? void 0 : n.parentId;
|
|
2187
|
+
for (; o; ) {
|
|
2188
|
+
const i = e.find((s) => s.id === o);
|
|
2189
|
+
o = i == null ? void 0 : i.parentId, i && (r = r.concat(i));
|
|
2190
|
+
}
|
|
2191
|
+
return r;
|
|
2192
|
+
}
|
|
2193
|
+
function Ne(e, t) {
|
|
2194
|
+
let n = e.filter((o) => {
|
|
2195
|
+
var i;
|
|
2196
|
+
return o.parentId === t && ((i = o.context) == null ? void 0 : i.open);
|
|
2197
|
+
}), r = n;
|
|
2198
|
+
for (; r.length; )
|
|
2199
|
+
r = e.filter((o) => {
|
|
2200
|
+
var i;
|
|
2201
|
+
return (i = r) == null ? void 0 : i.some((s) => {
|
|
2202
|
+
var c;
|
|
2203
|
+
return o.parentId === s.id && ((c = o.context) == null ? void 0 : c.open);
|
|
2204
|
+
});
|
|
2205
|
+
}), n = n.concat(r);
|
|
2206
|
+
return n;
|
|
2207
|
+
}
|
|
2208
|
+
function Po(e, t) {
|
|
2209
|
+
let n, r = -1;
|
|
2210
|
+
function o(i, s) {
|
|
2211
|
+
s > r && (n = i, r = s), Ne(e, i).forEach((u) => {
|
|
2212
|
+
o(u.id, s + 1);
|
|
2213
|
+
});
|
|
2214
|
+
}
|
|
2215
|
+
return o(t, 0), e.find((i) => i.id === n);
|
|
2216
|
+
}
|
|
2217
|
+
let We = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakSet(), ut = {}, St = 0;
|
|
2218
|
+
const ko = () => typeof HTMLElement < "u" && "inert" in HTMLElement.prototype, Qn = (e) => e && (e.host || Qn(e.parentNode)), Do = (e, t) => t.map((n) => {
|
|
2219
|
+
if (e.contains(n))
|
|
2220
|
+
return n;
|
|
2221
|
+
const r = Qn(n);
|
|
2222
|
+
return e.contains(r) ? r : null;
|
|
2223
|
+
}).filter((n) => n != null);
|
|
2224
|
+
function Lo(e, t, n, r) {
|
|
2225
|
+
const o = "data-floating-ui-inert", i = r ? "inert" : n ? "aria-hidden" : null, s = Do(t, e), c = /* @__PURE__ */ new Set(), u = new Set(s), l = [];
|
|
2226
|
+
ut[o] || (ut[o] = /* @__PURE__ */ new WeakMap());
|
|
2227
|
+
const g = ut[o];
|
|
2228
|
+
s.forEach(f), h(t), c.clear();
|
|
2229
|
+
function f(a) {
|
|
2230
|
+
!a || c.has(a) || (c.add(a), a.parentNode && f(a.parentNode));
|
|
2231
|
+
}
|
|
2232
|
+
function h(a) {
|
|
2233
|
+
!a || u.has(a) || [].forEach.call(a.children, (m) => {
|
|
2234
|
+
if (Le(m) !== "script")
|
|
2235
|
+
if (c.has(m))
|
|
2236
|
+
h(m);
|
|
2237
|
+
else {
|
|
2238
|
+
const p = i ? m.getAttribute(i) : null, R = p !== null && p !== "false", E = (We.get(m) || 0) + 1, C = (g.get(m) || 0) + 1;
|
|
2239
|
+
We.set(m, E), g.set(m, C), l.push(m), E === 1 && R && lt.add(m), C === 1 && m.setAttribute(o, ""), !R && i && m.setAttribute(i, "true");
|
|
2240
|
+
}
|
|
2241
|
+
});
|
|
2242
|
+
}
|
|
2243
|
+
return St++, () => {
|
|
2244
|
+
l.forEach((a) => {
|
|
2245
|
+
const m = (We.get(a) || 0) - 1, p = (g.get(a) || 0) - 1;
|
|
2246
|
+
We.set(a, m), g.set(a, p), m || (!lt.has(a) && i && a.removeAttribute(i), lt.delete(a)), p || a.removeAttribute(o);
|
|
2247
|
+
}), St--, St || (We = /* @__PURE__ */ new WeakMap(), We = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakSet(), ut = {});
|
|
2248
|
+
};
|
|
2249
|
+
}
|
|
2250
|
+
function dn(e, t, n) {
|
|
2251
|
+
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
2252
|
+
const r = ne(e[0]).body;
|
|
2253
|
+
return Lo(e.concat(Array.from(r.querySelectorAll("[aria-live]"))), r, t, n);
|
|
2254
|
+
}
|
|
2255
|
+
const ze = () => ({
|
|
2256
|
+
getShadowRoot: !0,
|
|
2257
|
+
displayCheck: (
|
|
2258
|
+
// JSDOM does not support the `tabbable` library. To solve this we can
|
|
2259
|
+
// check if `ResizeObserver` is a real function (not polyfilled), which
|
|
2260
|
+
// determines if the current environment is JSDOM-like.
|
|
2261
|
+
typeof ResizeObserver == "function" && ResizeObserver.toString().includes("[native code]") ? "full" : "none"
|
|
2262
|
+
)
|
|
2263
|
+
});
|
|
2264
|
+
function er(e, t) {
|
|
2265
|
+
const n = Je(e, ze());
|
|
2266
|
+
t === "prev" && n.reverse();
|
|
2267
|
+
const r = n.indexOf(he(ne(e)));
|
|
2268
|
+
return n.slice(r + 1)[0];
|
|
2269
|
+
}
|
|
2270
|
+
function tr() {
|
|
2271
|
+
return er(document.body, "next");
|
|
2272
|
+
}
|
|
2273
|
+
function nr() {
|
|
2274
|
+
return er(document.body, "prev");
|
|
2275
|
+
}
|
|
2276
|
+
function Xe(e, t) {
|
|
2277
|
+
const n = t || e.currentTarget, r = e.relatedTarget;
|
|
2278
|
+
return !r || !ee(n, r);
|
|
2279
|
+
}
|
|
2280
|
+
function Fo(e) {
|
|
2281
|
+
Je(e, ze()).forEach((n) => {
|
|
2282
|
+
n.dataset.tabindex = n.getAttribute("tabindex") || "", n.setAttribute("tabindex", "-1");
|
|
2283
|
+
});
|
|
2284
|
+
}
|
|
2285
|
+
function No(e) {
|
|
2286
|
+
e.querySelectorAll("[data-tabindex]").forEach((n) => {
|
|
2287
|
+
const r = n.dataset.tabindex;
|
|
2288
|
+
delete n.dataset.tabindex, r ? n.setAttribute("tabindex", r) : n.removeAttribute("tabindex");
|
|
2289
|
+
});
|
|
2290
|
+
}
|
|
2291
|
+
function Vo(e, t, n) {
|
|
2292
|
+
const r = e.indexOf(t);
|
|
2293
|
+
function o(s) {
|
|
2294
|
+
const c = De("focus-guard");
|
|
2295
|
+
let u = r + (s ? 1 : 0), l = e[u];
|
|
2296
|
+
for (; l && (!l.isConnected || l.hasAttribute(c) || ee(n, l)); )
|
|
2297
|
+
s ? u++ : u--, l = e[u];
|
|
2298
|
+
return l;
|
|
2299
|
+
}
|
|
2300
|
+
const i = o(!0);
|
|
2301
|
+
return i || o(!1);
|
|
2302
|
+
}
|
|
2303
|
+
const Gt = {
|
|
2304
|
+
border: 0,
|
|
2305
|
+
clip: "rect(0 0 0 0)",
|
|
2306
|
+
height: "1px",
|
|
2307
|
+
margin: "-1px",
|
|
2308
|
+
overflow: "hidden",
|
|
2309
|
+
padding: 0,
|
|
2310
|
+
position: "fixed",
|
|
2311
|
+
whiteSpace: "nowrap",
|
|
2312
|
+
width: "1px",
|
|
2313
|
+
top: 0,
|
|
2314
|
+
left: 0
|
|
2315
|
+
};
|
|
2316
|
+
let _o;
|
|
2317
|
+
function mn(e) {
|
|
2318
|
+
e.key === "Tab" && (e.target, clearTimeout(_o));
|
|
2319
|
+
}
|
|
2320
|
+
const wt = /* @__PURE__ */ d.forwardRef(function(t, n) {
|
|
2321
|
+
const [r, o] = d.useState();
|
|
2322
|
+
U(() => (Kt() && o("button"), document.addEventListener("keydown", mn), () => {
|
|
2323
|
+
document.removeEventListener("keydown", mn);
|
|
2324
|
+
}), []);
|
|
2325
|
+
const i = {
|
|
2326
|
+
ref: n,
|
|
2327
|
+
tabIndex: 0,
|
|
2328
|
+
// Role is only for VoiceOver
|
|
2329
|
+
role: r,
|
|
2330
|
+
"aria-hidden": r ? void 0 : !0,
|
|
2331
|
+
[De("focus-guard")]: "",
|
|
2332
|
+
style: Gt
|
|
2333
|
+
};
|
|
2334
|
+
return /* @__PURE__ */ d.createElement("span", Qe({}, t, i));
|
|
2335
|
+
}), rr = /* @__PURE__ */ d.createContext(null), gn = /* @__PURE__ */ De("portal");
|
|
2336
|
+
function Wo(e) {
|
|
2337
|
+
e === void 0 && (e = {});
|
|
2338
|
+
const {
|
|
2339
|
+
id: t,
|
|
2340
|
+
root: n
|
|
2341
|
+
} = e, r = rt(), o = or(), [i, s] = d.useState(null), c = d.useRef(null);
|
|
2342
|
+
return U(() => () => {
|
|
2343
|
+
i == null || i.remove(), queueMicrotask(() => {
|
|
2344
|
+
c.current = null;
|
|
2345
|
+
});
|
|
2346
|
+
}, [i]), U(() => {
|
|
2347
|
+
if (!r || c.current)
|
|
2348
|
+
return;
|
|
2349
|
+
const u = t ? document.getElementById(t) : null;
|
|
2350
|
+
if (!u)
|
|
2351
|
+
return;
|
|
2352
|
+
const l = document.createElement("div");
|
|
2353
|
+
l.id = r, l.setAttribute(gn, ""), u.appendChild(l), c.current = l, s(l);
|
|
2354
|
+
}, [t, r]), U(() => {
|
|
2355
|
+
if (!r || c.current)
|
|
2356
|
+
return;
|
|
2357
|
+
let u = n || (o == null ? void 0 : o.portalNode);
|
|
2358
|
+
u && !Y(u) && (u = u.current), u = u || document.body;
|
|
2359
|
+
let l = null;
|
|
2360
|
+
t && (l = document.createElement("div"), l.id = t, u.appendChild(l));
|
|
2361
|
+
const g = document.createElement("div");
|
|
2362
|
+
g.id = r, g.setAttribute(gn, ""), u = l || u, u.appendChild(g), c.current = g, s(g);
|
|
2363
|
+
}, [t, n, r, o]), i;
|
|
2364
|
+
}
|
|
2365
|
+
function fi(e) {
|
|
2366
|
+
const {
|
|
2367
|
+
children: t,
|
|
2368
|
+
id: n,
|
|
2369
|
+
root: r = null,
|
|
2370
|
+
preserveTabOrder: o = !0
|
|
2371
|
+
} = e, i = Wo({
|
|
2372
|
+
id: n,
|
|
2373
|
+
root: r
|
|
2374
|
+
}), [s, c] = d.useState(null), u = d.useRef(null), l = d.useRef(null), g = d.useRef(null), f = d.useRef(null), h = (
|
|
2375
|
+
// The FocusManager and therefore floating element are currently open/
|
|
2376
|
+
// rendered.
|
|
2377
|
+
!!s && // Guards are only for non-modal focus management.
|
|
2378
|
+
!s.modal && // Don't render if unmount is transitioning.
|
|
2379
|
+
s.open && o && !!(r || i)
|
|
2380
|
+
);
|
|
2381
|
+
return d.useEffect(() => {
|
|
2382
|
+
if (!i || !o || s != null && s.modal)
|
|
2383
|
+
return;
|
|
2384
|
+
function a(m) {
|
|
2385
|
+
i && Xe(m) && (m.type === "focusin" ? No : Fo)(i);
|
|
2386
|
+
}
|
|
2387
|
+
return i.addEventListener("focusin", a, !0), i.addEventListener("focusout", a, !0), () => {
|
|
2388
|
+
i.removeEventListener("focusin", a, !0), i.removeEventListener("focusout", a, !0);
|
|
2389
|
+
};
|
|
2390
|
+
}, [i, o, s == null ? void 0 : s.modal]), /* @__PURE__ */ d.createElement(rr.Provider, {
|
|
2391
|
+
value: d.useMemo(() => ({
|
|
2392
|
+
preserveTabOrder: o,
|
|
2393
|
+
beforeOutsideRef: u,
|
|
2394
|
+
afterOutsideRef: l,
|
|
2395
|
+
beforeInsideRef: g,
|
|
2396
|
+
afterInsideRef: f,
|
|
2397
|
+
portalNode: i,
|
|
2398
|
+
setFocusManagerState: c
|
|
2399
|
+
}), [o, i])
|
|
2400
|
+
}, h && i && /* @__PURE__ */ d.createElement(wt, {
|
|
2401
|
+
"data-type": "outside",
|
|
2402
|
+
ref: u,
|
|
2403
|
+
onFocus: (a) => {
|
|
2404
|
+
if (Xe(a, i)) {
|
|
2405
|
+
var m;
|
|
2406
|
+
(m = g.current) == null || m.focus();
|
|
2407
|
+
} else {
|
|
2408
|
+
const p = nr() || (s == null ? void 0 : s.refs.domReference.current);
|
|
2409
|
+
p == null || p.focus();
|
|
2410
|
+
}
|
|
2411
|
+
}
|
|
2412
|
+
}), h && i && /* @__PURE__ */ d.createElement("span", {
|
|
2413
|
+
"aria-owns": i.id,
|
|
2414
|
+
style: Gt
|
|
2415
|
+
}), i && /* @__PURE__ */ Sn.createPortal(t, i), h && i && /* @__PURE__ */ d.createElement(wt, {
|
|
2416
|
+
"data-type": "outside",
|
|
2417
|
+
ref: l,
|
|
2418
|
+
onFocus: (a) => {
|
|
2419
|
+
if (Xe(a, i)) {
|
|
2420
|
+
var m;
|
|
2421
|
+
(m = f.current) == null || m.focus();
|
|
2422
|
+
} else {
|
|
2423
|
+
const p = tr() || (s == null ? void 0 : s.refs.domReference.current);
|
|
2424
|
+
p == null || p.focus(), s != null && s.closeOnFocusOut && (s == null || s.onOpenChange(!1, a.nativeEvent));
|
|
2425
|
+
}
|
|
2426
|
+
}
|
|
2427
|
+
}));
|
|
2428
|
+
}
|
|
2429
|
+
const or = () => d.useContext(rr), pn = 20;
|
|
2430
|
+
let Fe = [];
|
|
2431
|
+
function Mt(e) {
|
|
2432
|
+
Fe = Fe.filter((n) => n.isConnected);
|
|
2433
|
+
let t = e;
|
|
2434
|
+
if (!(!t || Le(t) === "body")) {
|
|
2435
|
+
if (!_r(t, ze())) {
|
|
2436
|
+
const n = Je(t, ze())[0];
|
|
2437
|
+
n && (t = n);
|
|
2438
|
+
}
|
|
2439
|
+
Fe.push(t), Fe.length > pn && (Fe = Fe.slice(-pn));
|
|
2440
|
+
}
|
|
2441
|
+
}
|
|
2442
|
+
function hn() {
|
|
2443
|
+
return Fe.slice().reverse().find((e) => e.isConnected);
|
|
2444
|
+
}
|
|
2445
|
+
const Bo = /* @__PURE__ */ d.forwardRef(function(t, n) {
|
|
2446
|
+
return /* @__PURE__ */ d.createElement("button", Qe({}, t, {
|
|
2447
|
+
type: "button",
|
|
2448
|
+
ref: n,
|
|
2449
|
+
tabIndex: -1,
|
|
2450
|
+
style: Gt
|
|
2451
|
+
}));
|
|
2452
|
+
});
|
|
2453
|
+
function di(e) {
|
|
2454
|
+
const {
|
|
2455
|
+
context: t,
|
|
2456
|
+
children: n,
|
|
2457
|
+
disabled: r = !1,
|
|
2458
|
+
order: o = ["content"],
|
|
2459
|
+
guards: i = !0,
|
|
2460
|
+
initialFocus: s = 0,
|
|
2461
|
+
returnFocus: c = !0,
|
|
2462
|
+
restoreFocus: u = !1,
|
|
2463
|
+
modal: l = !0,
|
|
2464
|
+
visuallyHiddenDismiss: g = !1,
|
|
2465
|
+
closeOnFocusOut: f = !0
|
|
2466
|
+
} = e, {
|
|
2467
|
+
open: h,
|
|
2468
|
+
refs: a,
|
|
2469
|
+
nodeId: m,
|
|
2470
|
+
onOpenChange: p,
|
|
2471
|
+
events: R,
|
|
2472
|
+
dataRef: E,
|
|
2473
|
+
floatingId: C,
|
|
2474
|
+
elements: {
|
|
2475
|
+
domReference: b,
|
|
2476
|
+
floating: y
|
|
2477
|
+
}
|
|
2478
|
+
} = t, A = typeof s == "number" && s < 0, P = Fn(b) && A, V = ko() ? i : !0, B = de(o), H = de(s), O = de(c), D = Ye(), M = or(), S = d.useRef(null), v = d.useRef(null), w = d.useRef(!1), I = d.useRef(!1), x = d.useRef(-1), k = M != null, _ = y == null ? void 0 : y.firstElementChild, T = (_ == null ? void 0 : _.id) === C ? _ : y, q = ie(function(L) {
|
|
2479
|
+
return L === void 0 && (L = T), L ? Je(L, ze()) : [];
|
|
2480
|
+
}), re = ie((L) => {
|
|
2481
|
+
const K = q(L);
|
|
2482
|
+
return B.current.map((N) => b && N === "reference" ? b : T && N === "floating" ? T : K).filter(Boolean).flat();
|
|
2483
|
+
});
|
|
2484
|
+
d.useEffect(() => {
|
|
2485
|
+
if (r || !l)
|
|
2486
|
+
return;
|
|
2487
|
+
function L(N) {
|
|
2488
|
+
if (N.key === "Tab") {
|
|
2489
|
+
ee(T, he(ne(T))) && q().length === 0 && !P && oe(N);
|
|
2490
|
+
const F = re(), z = we(N);
|
|
2491
|
+
B.current[0] === "reference" && z === b && (oe(N), N.shiftKey ? Oe(F[F.length - 1]) : Oe(F[1])), B.current[1] === "floating" && z === T && N.shiftKey && (oe(N), Oe(F[0]));
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
const K = ne(T);
|
|
2495
|
+
return K.addEventListener("keydown", L), () => {
|
|
2496
|
+
K.removeEventListener("keydown", L);
|
|
2497
|
+
};
|
|
2498
|
+
}, [r, b, T, l, B, P, q, re]), d.useEffect(() => {
|
|
2499
|
+
if (r || !y)
|
|
2500
|
+
return;
|
|
2501
|
+
function L(K) {
|
|
2502
|
+
const N = we(K), z = q().indexOf(N);
|
|
2503
|
+
z !== -1 && (x.current = z);
|
|
2504
|
+
}
|
|
2505
|
+
return y.addEventListener("focusin", L), () => {
|
|
2506
|
+
y.removeEventListener("focusin", L);
|
|
2507
|
+
};
|
|
2508
|
+
}, [r, y, q]), d.useEffect(() => {
|
|
2509
|
+
if (r || !f)
|
|
2510
|
+
return;
|
|
2511
|
+
function L() {
|
|
2512
|
+
I.current = !0, setTimeout(() => {
|
|
2513
|
+
I.current = !1;
|
|
2514
|
+
});
|
|
2515
|
+
}
|
|
2516
|
+
function K(N) {
|
|
2517
|
+
const F = N.relatedTarget;
|
|
2518
|
+
queueMicrotask(() => {
|
|
2519
|
+
const z = !(ee(b, F) || ee(y, F) || ee(F, y) || ee(M == null ? void 0 : M.portalNode, F) || F != null && F.hasAttribute(De("focus-guard")) || D && (Ne(D.nodesRef.current, m).find((j) => {
|
|
2520
|
+
var Q, G;
|
|
2521
|
+
return ee((Q = j.context) == null ? void 0 : Q.elements.floating, F) || ee((G = j.context) == null ? void 0 : G.elements.domReference, F);
|
|
2522
|
+
}) || Ao(D.nodesRef.current, m).find((j) => {
|
|
2523
|
+
var Q, G;
|
|
2524
|
+
return ((Q = j.context) == null ? void 0 : Q.elements.floating) === F || ((G = j.context) == null ? void 0 : G.elements.domReference) === F;
|
|
2525
|
+
})));
|
|
2526
|
+
if (u && z && he(ne(T)) === ne(T).body) {
|
|
2527
|
+
te(T) && (T == null || T.focus());
|
|
2528
|
+
const j = x.current, Q = q(), G = Q[j] || Q[Q.length - 1] || T;
|
|
2529
|
+
te(G) && G.focus();
|
|
2530
|
+
}
|
|
2531
|
+
(P || !l) && F && z && !I.current && // Fix React 18 Strict Mode returnFocus due to double rendering.
|
|
2532
|
+
F !== hn() && (w.current = !0, p(!1, N));
|
|
2533
|
+
});
|
|
2534
|
+
}
|
|
2535
|
+
if (y && te(b))
|
|
2536
|
+
return b.addEventListener("focusout", K), b.addEventListener("pointerdown", L), y.addEventListener("focusout", K), () => {
|
|
2537
|
+
b.removeEventListener("focusout", K), b.removeEventListener("pointerdown", L), y.removeEventListener("focusout", K);
|
|
2538
|
+
};
|
|
2539
|
+
}, [r, b, y, T, l, m, D, M, p, f, u, q, P]), d.useEffect(() => {
|
|
2540
|
+
var L;
|
|
2541
|
+
if (r)
|
|
2542
|
+
return;
|
|
2543
|
+
const K = Array.from((M == null || (L = M.portalNode) == null ? void 0 : L.querySelectorAll("[" + De("portal") + "]")) || []);
|
|
2544
|
+
if (y) {
|
|
2545
|
+
const N = [y, ...K, S.current, v.current, B.current.includes("reference") || P ? b : null].filter((z) => z != null), F = l || P ? dn(N, V, !V) : dn(N);
|
|
2546
|
+
return () => {
|
|
2547
|
+
F();
|
|
2548
|
+
};
|
|
2549
|
+
}
|
|
2550
|
+
}, [r, b, y, l, B, M, P, V]), U(() => {
|
|
2551
|
+
if (r || !te(T))
|
|
2552
|
+
return;
|
|
2553
|
+
const L = ne(T), K = he(L);
|
|
2554
|
+
queueMicrotask(() => {
|
|
2555
|
+
const N = re(T), F = H.current, z = (typeof F == "number" ? N[F] : F.current) || T, j = ee(T, K);
|
|
2556
|
+
!A && !j && h && Oe(z, {
|
|
2557
|
+
preventScroll: z === T
|
|
2558
|
+
});
|
|
2559
|
+
});
|
|
2560
|
+
}, [r, h, T, A, re, H]), U(() => {
|
|
2561
|
+
if (r || !T)
|
|
2562
|
+
return;
|
|
2563
|
+
let L = !1;
|
|
2564
|
+
const K = ne(T), N = he(K);
|
|
2565
|
+
let z = E.current.openEvent;
|
|
2566
|
+
const j = a.domReference.current;
|
|
2567
|
+
Mt(N);
|
|
2568
|
+
function Q(G) {
|
|
2569
|
+
let {
|
|
2570
|
+
open: ve,
|
|
2571
|
+
reason: xe,
|
|
2572
|
+
event: ge,
|
|
2573
|
+
nested: _e
|
|
2574
|
+
} = G;
|
|
2575
|
+
ve && (z = ge), xe === "escape-key" && a.domReference.current && Mt(a.domReference.current), xe === "hover" && ge.type === "mouseleave" && (w.current = !0), xe === "outside-press" && (_e ? (w.current = !1, L = !0) : w.current = !(Dn(ge) || Bt(ge)));
|
|
2576
|
+
}
|
|
2577
|
+
return R.on("openchange", Q), () => {
|
|
2578
|
+
R.off("openchange", Q);
|
|
2579
|
+
const G = he(K), ve = ee(y, G) || D && Ne(D.nodesRef.current, m).some(($) => {
|
|
2580
|
+
var X;
|
|
2581
|
+
return ee((X = $.context) == null ? void 0 : X.elements.floating, G);
|
|
2582
|
+
});
|
|
2583
|
+
(ve || z && ["click", "mousedown"].includes(z.type)) && a.domReference.current && Mt(a.domReference.current);
|
|
2584
|
+
const ge = j || N, _e = Je(ne(ge).body, ze());
|
|
2585
|
+
queueMicrotask(() => {
|
|
2586
|
+
let $ = hn();
|
|
2587
|
+
!$ && te(ge) && y && ($ = Vo(_e, ge, y)), // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2588
|
+
O.current && !w.current && te($) && // If the focus moved somewhere else after mount, avoid returning focus
|
|
2589
|
+
// since it likely entered a different element which should be
|
|
2590
|
+
// respected: https://github.com/floating-ui/floating-ui/issues/2607
|
|
2591
|
+
(!($ !== G && G !== K.body) || ve) && $.focus({
|
|
2592
|
+
preventScroll: L
|
|
2593
|
+
});
|
|
2594
|
+
});
|
|
2595
|
+
};
|
|
2596
|
+
}, [r, y, T, O, E, a, R, D, m]), U(() => {
|
|
2597
|
+
if (!r && M)
|
|
2598
|
+
return M.setFocusManagerState({
|
|
2599
|
+
modal: l,
|
|
2600
|
+
closeOnFocusOut: f,
|
|
2601
|
+
open: h,
|
|
2602
|
+
onOpenChange: p,
|
|
2603
|
+
refs: a
|
|
2604
|
+
}), () => {
|
|
2605
|
+
M.setFocusManagerState(null);
|
|
2606
|
+
};
|
|
2607
|
+
}, [r, M, l, h, p, a, f]), U(() => {
|
|
2608
|
+
if (r || !T || typeof MutationObserver != "function" || A)
|
|
2609
|
+
return;
|
|
2610
|
+
const L = () => {
|
|
2611
|
+
const N = T.getAttribute("tabindex"), F = q(), z = he(ne(y)), j = F.indexOf(z);
|
|
2612
|
+
j !== -1 && (x.current = j), B.current.includes("floating") || z !== a.domReference.current && F.length === 0 ? N !== "0" && T.setAttribute("tabindex", "0") : N !== "-1" && T.setAttribute("tabindex", "-1");
|
|
2613
|
+
};
|
|
2614
|
+
L();
|
|
2615
|
+
const K = new MutationObserver(L);
|
|
2616
|
+
return K.observe(T, {
|
|
2617
|
+
childList: !0,
|
|
2618
|
+
subtree: !0,
|
|
2619
|
+
attributes: !0
|
|
2620
|
+
}), () => {
|
|
2621
|
+
K.disconnect();
|
|
2622
|
+
};
|
|
2623
|
+
}, [r, y, T, a, B, q, A]);
|
|
2624
|
+
function ce(L) {
|
|
2625
|
+
return r || !g || !l ? null : /* @__PURE__ */ d.createElement(Bo, {
|
|
2626
|
+
ref: L === "start" ? S : v,
|
|
2627
|
+
onClick: (K) => p(!1, K.nativeEvent)
|
|
2628
|
+
}, typeof g == "string" ? g : "Dismiss");
|
|
2629
|
+
}
|
|
2630
|
+
const le = !r && V && (l ? !P : !0) && (k || l);
|
|
2631
|
+
return /* @__PURE__ */ d.createElement(d.Fragment, null, le && /* @__PURE__ */ d.createElement(wt, {
|
|
2632
|
+
"data-type": "inside",
|
|
2633
|
+
ref: M == null ? void 0 : M.beforeInsideRef,
|
|
2634
|
+
onFocus: (L) => {
|
|
2635
|
+
if (l) {
|
|
2636
|
+
const N = re();
|
|
2637
|
+
Oe(o[0] === "reference" ? N[0] : N[N.length - 1]);
|
|
2638
|
+
} else if (M != null && M.preserveTabOrder && M.portalNode)
|
|
2639
|
+
if (w.current = !1, Xe(L, M.portalNode)) {
|
|
2640
|
+
const N = tr() || b;
|
|
2641
|
+
N == null || N.focus();
|
|
2642
|
+
} else {
|
|
2643
|
+
var K;
|
|
2644
|
+
(K = M.beforeOutsideRef.current) == null || K.focus();
|
|
2645
|
+
}
|
|
2646
|
+
}
|
|
2647
|
+
}), !P && ce("start"), n, ce("end"), le && /* @__PURE__ */ d.createElement(wt, {
|
|
2648
|
+
"data-type": "inside",
|
|
2649
|
+
ref: M == null ? void 0 : M.afterInsideRef,
|
|
2650
|
+
onFocus: (L) => {
|
|
2651
|
+
if (l)
|
|
2652
|
+
Oe(re()[0]);
|
|
2653
|
+
else if (M != null && M.preserveTabOrder && M.portalNode)
|
|
2654
|
+
if (f && (w.current = !0), Xe(L, M.portalNode)) {
|
|
2655
|
+
const N = nr() || b;
|
|
2656
|
+
N == null || N.focus();
|
|
2657
|
+
} else {
|
|
2658
|
+
var K;
|
|
2659
|
+
(K = M.afterOutsideRef.current) == null || K.focus();
|
|
2660
|
+
}
|
|
2661
|
+
}
|
|
2662
|
+
}));
|
|
2663
|
+
}
|
|
2664
|
+
function vn(e) {
|
|
2665
|
+
return te(e.target) && e.target.tagName === "BUTTON";
|
|
2666
|
+
}
|
|
2667
|
+
function bn(e) {
|
|
2668
|
+
return $t(e);
|
|
2669
|
+
}
|
|
2670
|
+
function mi(e, t) {
|
|
2671
|
+
t === void 0 && (t = {});
|
|
2672
|
+
const {
|
|
2673
|
+
open: n,
|
|
2674
|
+
onOpenChange: r,
|
|
2675
|
+
dataRef: o,
|
|
2676
|
+
elements: {
|
|
2677
|
+
domReference: i
|
|
2678
|
+
}
|
|
2679
|
+
} = e, {
|
|
2680
|
+
enabled: s = !0,
|
|
2681
|
+
event: c = "click",
|
|
2682
|
+
toggle: u = !0,
|
|
2683
|
+
ignoreMouse: l = !1,
|
|
2684
|
+
keyboardHandlers: g = !0
|
|
2685
|
+
} = t, f = d.useRef(), h = d.useRef(!1), a = d.useMemo(() => ({
|
|
2686
|
+
onPointerDown(m) {
|
|
2687
|
+
f.current = m.pointerType;
|
|
2688
|
+
},
|
|
2689
|
+
onMouseDown(m) {
|
|
2690
|
+
const p = f.current;
|
|
2691
|
+
m.button === 0 && c !== "click" && (Ze(p, !0) && l || (n && u && (!o.current.openEvent || o.current.openEvent.type === "mousedown") ? r(!1, m.nativeEvent, "click") : (m.preventDefault(), r(!0, m.nativeEvent, "click"))));
|
|
2692
|
+
},
|
|
2693
|
+
onClick(m) {
|
|
2694
|
+
const p = f.current;
|
|
2695
|
+
if (c === "mousedown" && f.current) {
|
|
2696
|
+
f.current = void 0;
|
|
2697
|
+
return;
|
|
2698
|
+
}
|
|
2699
|
+
Ze(p, !0) && l || (n && u && (!o.current.openEvent || o.current.openEvent.type === "click") ? r(!1, m.nativeEvent, "click") : r(!0, m.nativeEvent, "click"));
|
|
2700
|
+
},
|
|
2701
|
+
onKeyDown(m) {
|
|
2702
|
+
f.current = void 0, !(m.defaultPrevented || !g || vn(m)) && (m.key === " " && !bn(i) && (m.preventDefault(), h.current = !0), m.key === "Enter" && r(!(n && u), m.nativeEvent, "click"));
|
|
2703
|
+
},
|
|
2704
|
+
onKeyUp(m) {
|
|
2705
|
+
m.defaultPrevented || !g || vn(m) || bn(i) || m.key === " " && h.current && (h.current = !1, r(!(n && u), m.nativeEvent, "click"));
|
|
2706
|
+
}
|
|
2707
|
+
}), [o, i, c, l, g, r, n, u]);
|
|
2708
|
+
return d.useMemo(() => s ? {
|
|
2709
|
+
reference: a
|
|
2710
|
+
} : {}, [s, a]);
|
|
2711
|
+
}
|
|
2712
|
+
const Ko = {
|
|
2713
|
+
pointerdown: "onPointerDown",
|
|
2714
|
+
mousedown: "onMouseDown",
|
|
2715
|
+
click: "onClick"
|
|
2716
|
+
}, $o = {
|
|
2717
|
+
pointerdown: "onPointerDownCapture",
|
|
2718
|
+
mousedown: "onMouseDownCapture",
|
|
2719
|
+
click: "onClickCapture"
|
|
2720
|
+
}, yn = (e) => {
|
|
2721
|
+
var t, n;
|
|
2722
|
+
return {
|
|
2723
|
+
escapeKey: typeof e == "boolean" ? e : (t = e == null ? void 0 : e.escapeKey) != null ? t : !1,
|
|
2724
|
+
outsidePress: typeof e == "boolean" ? e : (n = e == null ? void 0 : e.outsidePress) != null ? n : !0
|
|
2725
|
+
};
|
|
2726
|
+
};
|
|
2727
|
+
function gi(e, t) {
|
|
2728
|
+
t === void 0 && (t = {});
|
|
2729
|
+
const {
|
|
2730
|
+
open: n,
|
|
2731
|
+
onOpenChange: r,
|
|
2732
|
+
elements: o,
|
|
2733
|
+
dataRef: i
|
|
2734
|
+
} = e, {
|
|
2735
|
+
enabled: s = !0,
|
|
2736
|
+
escapeKey: c = !0,
|
|
2737
|
+
outsidePress: u = !0,
|
|
2738
|
+
outsidePressEvent: l = "pointerdown",
|
|
2739
|
+
referencePress: g = !1,
|
|
2740
|
+
referencePressEvent: f = "pointerdown",
|
|
2741
|
+
ancestorScroll: h = !1,
|
|
2742
|
+
bubbles: a,
|
|
2743
|
+
capture: m
|
|
2744
|
+
} = t, p = Ye(), R = ie(typeof u == "function" ? u : () => !1), E = typeof u == "function" ? R : u, C = d.useRef(!1), b = d.useRef(!1), {
|
|
2745
|
+
escapeKey: y,
|
|
2746
|
+
outsidePress: A
|
|
2747
|
+
} = yn(a), {
|
|
2748
|
+
escapeKey: P,
|
|
2749
|
+
outsidePress: V
|
|
2750
|
+
} = yn(m), B = ie((v) => {
|
|
2751
|
+
var w;
|
|
2752
|
+
if (!n || !s || !c || v.key !== "Escape")
|
|
2753
|
+
return;
|
|
2754
|
+
const I = (w = i.current.floatingContext) == null ? void 0 : w.nodeId, x = p ? Ne(p.nodesRef.current, I) : [];
|
|
2755
|
+
if (!y && (v.stopPropagation(), x.length > 0)) {
|
|
2756
|
+
let k = !0;
|
|
2757
|
+
if (x.forEach((_) => {
|
|
2758
|
+
var T;
|
|
2759
|
+
if ((T = _.context) != null && T.open && !_.context.dataRef.current.__escapeKeyBubbles) {
|
|
2760
|
+
k = !1;
|
|
2761
|
+
return;
|
|
2762
|
+
}
|
|
2763
|
+
}), !k)
|
|
2764
|
+
return;
|
|
2765
|
+
}
|
|
2766
|
+
r(!1, ar(v) ? v.nativeEvent : v, "escape-key");
|
|
2767
|
+
}), H = ie((v) => {
|
|
2768
|
+
var w;
|
|
2769
|
+
const I = () => {
|
|
2770
|
+
var x;
|
|
2771
|
+
B(v), (x = we(v)) == null || x.removeEventListener("keydown", I);
|
|
2772
|
+
};
|
|
2773
|
+
(w = we(v)) == null || w.addEventListener("keydown", I);
|
|
2774
|
+
}), O = ie((v) => {
|
|
2775
|
+
var w;
|
|
2776
|
+
const I = C.current;
|
|
2777
|
+
C.current = !1;
|
|
2778
|
+
const x = b.current;
|
|
2779
|
+
if (b.current = !1, l === "click" && x || I || typeof E == "function" && !E(v))
|
|
2780
|
+
return;
|
|
2781
|
+
const k = we(v), _ = "[" + De("inert") + "]", T = ne(o.floating).querySelectorAll(_);
|
|
2782
|
+
let q = Y(k) ? k : null;
|
|
2783
|
+
for (; q && !Me(q); ) {
|
|
2784
|
+
const L = Re(q);
|
|
2785
|
+
if (Me(L) || !Y(L))
|
|
2786
|
+
break;
|
|
2787
|
+
q = L;
|
|
2788
|
+
}
|
|
2789
|
+
if (T.length && Y(k) && !fr(k) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
|
|
2790
|
+
!ee(k, o.floating) && // If the target root element contains none of the markers, then the
|
|
2791
|
+
// element was injected after the floating element rendered.
|
|
2792
|
+
Array.from(T).every((L) => !ee(q, L)))
|
|
2793
|
+
return;
|
|
2794
|
+
if (te(k) && S) {
|
|
2795
|
+
const L = k.clientWidth > 0 && k.scrollWidth > k.clientWidth, K = k.clientHeight > 0 && k.scrollHeight > k.clientHeight;
|
|
2796
|
+
let N = K && v.offsetX > k.clientWidth;
|
|
2797
|
+
if (K && me(k).direction === "rtl" && (N = v.offsetX <= k.offsetWidth - k.clientWidth), N || L && v.offsetY > k.clientHeight)
|
|
2798
|
+
return;
|
|
2799
|
+
}
|
|
2800
|
+
const re = (w = i.current.floatingContext) == null ? void 0 : w.nodeId, ce = p && Ne(p.nodesRef.current, re).some((L) => {
|
|
2801
|
+
var K;
|
|
2802
|
+
return It(v, (K = L.context) == null ? void 0 : K.elements.floating);
|
|
2803
|
+
});
|
|
2804
|
+
if (It(v, o.floating) || It(v, o.domReference) || ce)
|
|
2805
|
+
return;
|
|
2806
|
+
const le = p ? Ne(p.nodesRef.current, re) : [];
|
|
2807
|
+
if (le.length > 0) {
|
|
2808
|
+
let L = !0;
|
|
2809
|
+
if (le.forEach((K) => {
|
|
2810
|
+
var N;
|
|
2811
|
+
if ((N = K.context) != null && N.open && !K.context.dataRef.current.__outsidePressBubbles) {
|
|
2812
|
+
L = !1;
|
|
2813
|
+
return;
|
|
2814
|
+
}
|
|
2815
|
+
}), !L)
|
|
2816
|
+
return;
|
|
2817
|
+
}
|
|
2818
|
+
r(!1, v, "outside-press");
|
|
2819
|
+
}), D = ie((v) => {
|
|
2820
|
+
var w;
|
|
2821
|
+
const I = () => {
|
|
2822
|
+
var x;
|
|
2823
|
+
O(v), (x = we(v)) == null || x.removeEventListener(l, I);
|
|
2824
|
+
};
|
|
2825
|
+
(w = we(v)) == null || w.addEventListener(l, I);
|
|
2826
|
+
});
|
|
2827
|
+
d.useEffect(() => {
|
|
2828
|
+
if (!n || !s)
|
|
2829
|
+
return;
|
|
2830
|
+
i.current.__escapeKeyBubbles = y, i.current.__outsidePressBubbles = A;
|
|
2831
|
+
function v(x) {
|
|
2832
|
+
r(!1, x, "ancestor-scroll");
|
|
2833
|
+
}
|
|
2834
|
+
const w = ne(o.floating);
|
|
2835
|
+
c && w.addEventListener("keydown", P ? H : B, P), E && w.addEventListener(l, V ? D : O, V);
|
|
2836
|
+
let I = [];
|
|
2837
|
+
return h && (Y(o.domReference) && (I = Se(o.domReference)), Y(o.floating) && (I = I.concat(Se(o.floating))), !Y(o.reference) && o.reference && o.reference.contextElement && (I = I.concat(Se(o.reference.contextElement)))), I = I.filter((x) => {
|
|
2838
|
+
var k;
|
|
2839
|
+
return x !== ((k = w.defaultView) == null ? void 0 : k.visualViewport);
|
|
2840
|
+
}), I.forEach((x) => {
|
|
2841
|
+
x.addEventListener("scroll", v, {
|
|
2842
|
+
passive: !0
|
|
2843
|
+
});
|
|
2844
|
+
}), () => {
|
|
2845
|
+
c && w.removeEventListener("keydown", P ? H : B, P), E && w.removeEventListener(l, V ? D : O, V), I.forEach((x) => {
|
|
2846
|
+
x.removeEventListener("scroll", v);
|
|
2847
|
+
});
|
|
2848
|
+
};
|
|
2849
|
+
}, [i, o, c, E, l, n, r, h, s, y, A, B, P, H, O, V, D]), d.useEffect(() => {
|
|
2850
|
+
C.current = !1;
|
|
2851
|
+
}, [E, l]);
|
|
2852
|
+
const M = d.useMemo(() => ({
|
|
2853
|
+
onKeyDown: B,
|
|
2854
|
+
[Ko[f]]: (v) => {
|
|
2855
|
+
g && r(!1, v.nativeEvent, "reference-press");
|
|
2856
|
+
}
|
|
2857
|
+
}), [B, r, g, f]), S = d.useMemo(() => ({
|
|
2858
|
+
onKeyDown: B,
|
|
2859
|
+
onMouseDown() {
|
|
2860
|
+
b.current = !0;
|
|
2861
|
+
},
|
|
2862
|
+
onMouseUp() {
|
|
2863
|
+
b.current = !0;
|
|
2864
|
+
},
|
|
2865
|
+
[$o[l]]: () => {
|
|
2866
|
+
C.current = !0;
|
|
2867
|
+
}
|
|
2868
|
+
}), [B, l]);
|
|
2869
|
+
return d.useMemo(() => s ? {
|
|
2870
|
+
reference: M,
|
|
2871
|
+
floating: S
|
|
2872
|
+
} : {}, [s, M, S]);
|
|
2873
|
+
}
|
|
2874
|
+
function Ho(e) {
|
|
2875
|
+
const {
|
|
2876
|
+
open: t = !1,
|
|
2877
|
+
onOpenChange: n,
|
|
2878
|
+
elements: r
|
|
2879
|
+
} = e, o = rt(), i = d.useRef({}), [s] = d.useState(() => Gn()), c = je() != null;
|
|
2880
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2881
|
+
const a = r.reference;
|
|
2882
|
+
a && !Y(a) && So("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
|
|
2883
|
+
}
|
|
2884
|
+
const [u, l] = d.useState(r.reference), g = ie((a, m, p) => {
|
|
2885
|
+
i.current.openEvent = a ? m : void 0, s.emit("openchange", {
|
|
2886
|
+
open: a,
|
|
2887
|
+
event: m,
|
|
2888
|
+
reason: p,
|
|
2889
|
+
nested: c
|
|
2890
|
+
}), n == null || n(a, m, p);
|
|
2891
|
+
}), f = d.useMemo(() => ({
|
|
2892
|
+
setPositionReference: l
|
|
2893
|
+
}), []), h = d.useMemo(() => ({
|
|
2894
|
+
reference: u || r.reference || null,
|
|
2895
|
+
floating: r.floating || null,
|
|
2896
|
+
domReference: r.reference
|
|
2897
|
+
}), [u, r.reference, r.floating]);
|
|
2898
|
+
return d.useMemo(() => ({
|
|
2899
|
+
dataRef: i,
|
|
2900
|
+
open: t,
|
|
2901
|
+
onOpenChange: g,
|
|
2902
|
+
elements: h,
|
|
2903
|
+
events: s,
|
|
2904
|
+
floatingId: o,
|
|
2905
|
+
refs: f
|
|
2906
|
+
}), [t, g, h, s, o, f]);
|
|
2907
|
+
}
|
|
2908
|
+
function pi(e) {
|
|
2909
|
+
e === void 0 && (e = {});
|
|
2910
|
+
const {
|
|
2911
|
+
nodeId: t
|
|
2912
|
+
} = e, n = Ho({
|
|
2913
|
+
...e,
|
|
2914
|
+
elements: {
|
|
2915
|
+
reference: null,
|
|
2916
|
+
floating: null,
|
|
2917
|
+
...e.elements
|
|
2918
|
+
}
|
|
2919
|
+
}), r = e.rootContext || n, o = r.elements, [i, s] = d.useState(null), [c, u] = d.useState(null), g = (o == null ? void 0 : o.reference) || i, f = d.useRef(null), h = Ye();
|
|
2920
|
+
U(() => {
|
|
2921
|
+
g && (f.current = g);
|
|
2922
|
+
}, [g]);
|
|
2923
|
+
const a = po({
|
|
2924
|
+
...e,
|
|
2925
|
+
elements: {
|
|
2926
|
+
...o,
|
|
2927
|
+
...c && {
|
|
2928
|
+
reference: c
|
|
2929
|
+
}
|
|
2930
|
+
}
|
|
2931
|
+
}), m = d.useCallback((b) => {
|
|
2932
|
+
const y = Y(b) ? {
|
|
2933
|
+
getBoundingClientRect: () => b.getBoundingClientRect(),
|
|
2934
|
+
contextElement: b
|
|
2935
|
+
} : b;
|
|
2936
|
+
u(y), a.refs.setReference(y);
|
|
2937
|
+
}, [a.refs]), p = d.useCallback((b) => {
|
|
2938
|
+
(Y(b) || b === null) && (f.current = b, s(b)), (Y(a.refs.reference.current) || a.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
|
|
2939
|
+
// `null` to support `positionReference` + an unstable `reference`
|
|
2940
|
+
// callback ref.
|
|
2941
|
+
b !== null && !Y(b)) && a.refs.setReference(b);
|
|
2942
|
+
}, [a.refs]), R = d.useMemo(() => ({
|
|
2943
|
+
...a.refs,
|
|
2944
|
+
setReference: p,
|
|
2945
|
+
setPositionReference: m,
|
|
2946
|
+
domReference: f
|
|
2947
|
+
}), [a.refs, p, m]), E = d.useMemo(() => ({
|
|
2948
|
+
...a.elements,
|
|
2949
|
+
domReference: g
|
|
2950
|
+
}), [a.elements, g]), C = d.useMemo(() => ({
|
|
2951
|
+
...a,
|
|
2952
|
+
...r,
|
|
2953
|
+
refs: R,
|
|
2954
|
+
elements: E,
|
|
2955
|
+
nodeId: t
|
|
2956
|
+
}), [a, R, E, t, r]);
|
|
2957
|
+
return U(() => {
|
|
2958
|
+
r.dataRef.current.floatingContext = C;
|
|
2959
|
+
const b = h == null ? void 0 : h.nodesRef.current.find((y) => y.id === t);
|
|
2960
|
+
b && (b.context = C);
|
|
2961
|
+
}), d.useMemo(() => ({
|
|
2962
|
+
...a,
|
|
2963
|
+
context: C,
|
|
2964
|
+
refs: R,
|
|
2965
|
+
elements: E
|
|
2966
|
+
}), [a, R, E, C]);
|
|
2967
|
+
}
|
|
2968
|
+
function hi(e, t) {
|
|
2969
|
+
t === void 0 && (t = {});
|
|
2970
|
+
const {
|
|
2971
|
+
open: n,
|
|
2972
|
+
onOpenChange: r,
|
|
2973
|
+
events: o,
|
|
2974
|
+
dataRef: i,
|
|
2975
|
+
elements: s
|
|
2976
|
+
} = e, {
|
|
2977
|
+
enabled: c = !0,
|
|
2978
|
+
visibleOnly: u = !0
|
|
2979
|
+
} = t, l = d.useRef(!1), g = d.useRef(), f = d.useRef(!0);
|
|
2980
|
+
d.useEffect(() => {
|
|
2981
|
+
if (!c)
|
|
2982
|
+
return;
|
|
2983
|
+
const a = ae(s.domReference);
|
|
2984
|
+
function m() {
|
|
2985
|
+
!n && te(s.domReference) && s.domReference === he(ne(s.domReference)) && (l.current = !0);
|
|
2986
|
+
}
|
|
2987
|
+
function p() {
|
|
2988
|
+
f.current = !0;
|
|
2989
|
+
}
|
|
2990
|
+
return a.addEventListener("blur", m), a.addEventListener("keydown", p, !0), () => {
|
|
2991
|
+
a.removeEventListener("blur", m), a.removeEventListener("keydown", p, !0);
|
|
2992
|
+
};
|
|
2993
|
+
}, [s.domReference, n, c]), d.useEffect(() => {
|
|
2994
|
+
if (!c)
|
|
2995
|
+
return;
|
|
2996
|
+
function a(m) {
|
|
2997
|
+
let {
|
|
2998
|
+
reason: p
|
|
2999
|
+
} = m;
|
|
3000
|
+
(p === "reference-press" || p === "escape-key") && (l.current = !0);
|
|
3001
|
+
}
|
|
3002
|
+
return o.on("openchange", a), () => {
|
|
3003
|
+
o.off("openchange", a);
|
|
3004
|
+
};
|
|
3005
|
+
}, [o, c]), d.useEffect(() => () => {
|
|
3006
|
+
clearTimeout(g.current);
|
|
3007
|
+
}, []);
|
|
3008
|
+
const h = d.useMemo(() => ({
|
|
3009
|
+
onPointerDown(a) {
|
|
3010
|
+
Bt(a.nativeEvent) || (f.current = !1);
|
|
3011
|
+
},
|
|
3012
|
+
onMouseLeave() {
|
|
3013
|
+
l.current = !1;
|
|
3014
|
+
},
|
|
3015
|
+
onFocus(a) {
|
|
3016
|
+
if (l.current)
|
|
3017
|
+
return;
|
|
3018
|
+
const m = we(a.nativeEvent);
|
|
3019
|
+
if (u && Y(m))
|
|
3020
|
+
try {
|
|
3021
|
+
if (Kt() && Ln())
|
|
3022
|
+
throw Error();
|
|
3023
|
+
if (!m.matches(":focus-visible"))
|
|
3024
|
+
return;
|
|
3025
|
+
} catch {
|
|
3026
|
+
if (!f.current && !$t(m))
|
|
3027
|
+
return;
|
|
3028
|
+
}
|
|
3029
|
+
r(!0, a.nativeEvent, "focus");
|
|
3030
|
+
},
|
|
3031
|
+
onBlur(a) {
|
|
3032
|
+
l.current = !1;
|
|
3033
|
+
const m = a.relatedTarget, p = a.nativeEvent, R = Y(m) && m.hasAttribute(De("focus-guard")) && m.getAttribute("data-type") === "outside";
|
|
3034
|
+
g.current = window.setTimeout(() => {
|
|
3035
|
+
var E;
|
|
3036
|
+
const C = he(s.domReference ? s.domReference.ownerDocument : document);
|
|
3037
|
+
!m && C === s.domReference || ee((E = i.current.floatingContext) == null ? void 0 : E.refs.floating.current, C) || ee(s.domReference, C) || R || r(!1, p, "focus");
|
|
3038
|
+
});
|
|
3039
|
+
}
|
|
3040
|
+
}), [i, s.domReference, r, u]);
|
|
3041
|
+
return d.useMemo(() => c ? {
|
|
3042
|
+
reference: h
|
|
3043
|
+
} : {}, [c, h]);
|
|
3044
|
+
}
|
|
3045
|
+
const xn = "active", wn = "selected";
|
|
3046
|
+
function At(e, t, n) {
|
|
3047
|
+
const r = /* @__PURE__ */ new Map(), o = n === "item";
|
|
3048
|
+
let i = e;
|
|
3049
|
+
if (o && e) {
|
|
3050
|
+
const {
|
|
3051
|
+
[xn]: s,
|
|
3052
|
+
[wn]: c,
|
|
3053
|
+
...u
|
|
3054
|
+
} = e;
|
|
3055
|
+
i = u;
|
|
3056
|
+
}
|
|
3057
|
+
return {
|
|
3058
|
+
...n === "floating" && {
|
|
3059
|
+
tabIndex: -1
|
|
3060
|
+
},
|
|
3061
|
+
...i,
|
|
3062
|
+
...t.map((s) => {
|
|
3063
|
+
const c = s ? s[n] : null;
|
|
3064
|
+
return typeof c == "function" ? e ? c(e) : null : c;
|
|
3065
|
+
}).concat(e).reduce((s, c) => (c && Object.entries(c).forEach((u) => {
|
|
3066
|
+
let [l, g] = u;
|
|
3067
|
+
if (!(o && [xn, wn].includes(l)))
|
|
3068
|
+
if (l.indexOf("on") === 0) {
|
|
3069
|
+
if (r.has(l) || r.set(l, []), typeof g == "function") {
|
|
3070
|
+
var f;
|
|
3071
|
+
(f = r.get(l)) == null || f.push(g), s[l] = function() {
|
|
3072
|
+
for (var h, a = arguments.length, m = new Array(a), p = 0; p < a; p++)
|
|
3073
|
+
m[p] = arguments[p];
|
|
3074
|
+
return (h = r.get(l)) == null ? void 0 : h.map((R) => R(...m)).find((R) => R !== void 0);
|
|
3075
|
+
};
|
|
3076
|
+
}
|
|
3077
|
+
} else
|
|
3078
|
+
s[l] = g;
|
|
3079
|
+
}), s), {})
|
|
3080
|
+
};
|
|
3081
|
+
}
|
|
3082
|
+
function vi(e) {
|
|
3083
|
+
e === void 0 && (e = []);
|
|
3084
|
+
const t = e.map((c) => c == null ? void 0 : c.reference), n = e.map((c) => c == null ? void 0 : c.floating), r = e.map((c) => c == null ? void 0 : c.item), o = d.useCallback(
|
|
3085
|
+
(c) => At(c, e, "reference"),
|
|
3086
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3087
|
+
t
|
|
3088
|
+
), i = d.useCallback(
|
|
3089
|
+
(c) => At(c, e, "floating"),
|
|
3090
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3091
|
+
n
|
|
3092
|
+
), s = d.useCallback(
|
|
3093
|
+
(c) => At(c, e, "item"),
|
|
3094
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3095
|
+
r
|
|
3096
|
+
);
|
|
3097
|
+
return d.useMemo(() => ({
|
|
3098
|
+
getReferenceProps: o,
|
|
3099
|
+
getFloatingProps: i,
|
|
3100
|
+
getItemProps: s
|
|
3101
|
+
}), [o, i, s]);
|
|
3102
|
+
}
|
|
3103
|
+
let Rn = !1;
|
|
3104
|
+
function Ct(e, t, n) {
|
|
3105
|
+
switch (e) {
|
|
3106
|
+
case "vertical":
|
|
3107
|
+
return t;
|
|
3108
|
+
case "horizontal":
|
|
3109
|
+
return n;
|
|
3110
|
+
default:
|
|
3111
|
+
return t || n;
|
|
3112
|
+
}
|
|
3113
|
+
}
|
|
3114
|
+
function En(e, t) {
|
|
3115
|
+
return Ct(t, e === Yt || e === nt, e === He || e === Ue);
|
|
3116
|
+
}
|
|
3117
|
+
function Pt(e, t, n) {
|
|
3118
|
+
return Ct(t, e === nt, n ? e === He : e === Ue) || e === "Enter" || e === " " || e === "";
|
|
3119
|
+
}
|
|
3120
|
+
function zo(e, t, n) {
|
|
3121
|
+
return Ct(t, n ? e === He : e === Ue, e === nt);
|
|
3122
|
+
}
|
|
3123
|
+
function Cn(e, t, n) {
|
|
3124
|
+
return Ct(t, n ? e === Ue : e === He, e === Yt);
|
|
3125
|
+
}
|
|
3126
|
+
function bi(e, t) {
|
|
3127
|
+
const {
|
|
3128
|
+
open: n,
|
|
3129
|
+
onOpenChange: r,
|
|
3130
|
+
elements: o
|
|
3131
|
+
} = e, {
|
|
3132
|
+
listRef: i,
|
|
3133
|
+
activeIndex: s,
|
|
3134
|
+
onNavigate: c = () => {
|
|
3135
|
+
},
|
|
3136
|
+
enabled: u = !0,
|
|
3137
|
+
selectedIndex: l = null,
|
|
3138
|
+
allowEscape: g = !1,
|
|
3139
|
+
loop: f = !1,
|
|
3140
|
+
nested: h = !1,
|
|
3141
|
+
rtl: a = !1,
|
|
3142
|
+
virtual: m = !1,
|
|
3143
|
+
focusItemOnOpen: p = "auto",
|
|
3144
|
+
focusItemOnHover: R = !0,
|
|
3145
|
+
openOnArrowKeyDown: E = !0,
|
|
3146
|
+
disabledIndices: C = void 0,
|
|
3147
|
+
orientation: b = "vertical",
|
|
3148
|
+
cols: y = 1,
|
|
3149
|
+
scrollItemIntoView: A = !0,
|
|
3150
|
+
virtualItemRef: P,
|
|
3151
|
+
itemSizes: V,
|
|
3152
|
+
dense: B = !1
|
|
3153
|
+
} = t;
|
|
3154
|
+
process.env.NODE_ENV !== "production" && (g && (f || dt("`useListNavigation` looping must be enabled to allow escaping."), m || dt("`useListNavigation` must be virtual to allow escaping.")), b === "vertical" && y > 1 && dt("In grid list navigation mode (`cols` > 1), the `orientation` should", 'be either "horizontal" or "both".'));
|
|
3155
|
+
const H = je(), O = Ye(), D = ie(c), M = d.useRef(p), S = d.useRef(l ?? -1), v = d.useRef(null), w = d.useRef(!0), I = d.useRef(D), x = d.useRef(!!o.floating), k = d.useRef(n), _ = d.useRef(!1), T = d.useRef(!1), q = de(C), re = de(n), ce = de(A), le = de(o.floating), L = de(l), [K, N] = d.useState(), [F, z] = d.useState(), j = ie(function($, X, W) {
|
|
3156
|
+
W === void 0 && (W = !1);
|
|
3157
|
+
function Z(J) {
|
|
3158
|
+
m ? (N(J.id), O == null || O.events.emit("virtualfocus", J), P && (P.current = J)) : Oe(J, {
|
|
3159
|
+
preventScroll: !0,
|
|
3160
|
+
// Mac Safari does not move the virtual cursor unless the focus call
|
|
3161
|
+
// is sync. However, for the very first focus call, we need to wait
|
|
3162
|
+
// for the position to be ready in order to prevent unwanted
|
|
3163
|
+
// scrolling. This means the virtual cursor will not move to the first
|
|
3164
|
+
// item when first opening the floating element, but will on
|
|
3165
|
+
// subsequent calls. `preventScroll` is supported in modern Safari,
|
|
3166
|
+
// so we can use that instead.
|
|
3167
|
+
// iOS Safari must be async or the first item will not be focused.
|
|
3168
|
+
sync: Ln() && Kt() ? Rn || _.current : !1
|
|
3169
|
+
});
|
|
3170
|
+
}
|
|
3171
|
+
const ue = $.current[X.current];
|
|
3172
|
+
ue && Z(ue), requestAnimationFrame(() => {
|
|
3173
|
+
const J = $.current[X.current] || ue;
|
|
3174
|
+
if (!J)
|
|
3175
|
+
return;
|
|
3176
|
+
ue || Z(J);
|
|
3177
|
+
const be = ce.current;
|
|
3178
|
+
be && G && (W || !w.current) && (J.scrollIntoView == null || J.scrollIntoView(typeof be == "boolean" ? {
|
|
3179
|
+
block: "nearest",
|
|
3180
|
+
inline: "nearest"
|
|
3181
|
+
} : be));
|
|
3182
|
+
});
|
|
3183
|
+
});
|
|
3184
|
+
U(() => {
|
|
3185
|
+
document.createElement("div").focus({
|
|
3186
|
+
get preventScroll() {
|
|
3187
|
+
return Rn = !0, !1;
|
|
3188
|
+
}
|
|
3189
|
+
});
|
|
3190
|
+
}, []), U(() => {
|
|
3191
|
+
u && (n && o.floating ? M.current && l != null && (T.current = !0, S.current = l, D(l)) : x.current && (S.current = -1, I.current(null)));
|
|
3192
|
+
}, [u, n, o.floating, l, D]), U(() => {
|
|
3193
|
+
if (u && n && o.floating)
|
|
3194
|
+
if (s == null) {
|
|
3195
|
+
if (_.current = !1, L.current != null)
|
|
3196
|
+
return;
|
|
3197
|
+
if (x.current && (S.current = -1, j(i, S)), (!k.current || !x.current) && M.current && (v.current != null || M.current === !0 && v.current == null)) {
|
|
3198
|
+
let $ = 0;
|
|
3199
|
+
const X = () => {
|
|
3200
|
+
i.current[0] == null ? ($ < 2 && ($ ? requestAnimationFrame : queueMicrotask)(X), $++) : (S.current = v.current == null || Pt(v.current, b, a) || h ? Ot(i, q.current) : cn(i, q.current), v.current = null, D(S.current));
|
|
3201
|
+
};
|
|
3202
|
+
X();
|
|
3203
|
+
}
|
|
3204
|
+
} else
|
|
3205
|
+
Ge(i, s) || (S.current = s, j(i, S, T.current), T.current = !1);
|
|
3206
|
+
}, [u, n, o.floating, s, L, h, i, b, a, D, j, q]), U(() => {
|
|
3207
|
+
var $;
|
|
3208
|
+
if (!u || o.floating || !O || m || !x.current)
|
|
3209
|
+
return;
|
|
3210
|
+
const X = O.nodesRef.current, W = ($ = X.find((J) => J.id === H)) == null || ($ = $.context) == null ? void 0 : $.elements.floating, Z = he(ne(o.floating)), ue = X.some((J) => J.context && ee(J.context.elements.floating, Z));
|
|
3211
|
+
W && !ue && w.current && W.focus({
|
|
3212
|
+
preventScroll: !0
|
|
3213
|
+
});
|
|
3214
|
+
}, [u, o.floating, O, H, m]), U(() => {
|
|
3215
|
+
if (!u || !O || !m || H)
|
|
3216
|
+
return;
|
|
3217
|
+
function $(X) {
|
|
3218
|
+
z(X.id), P && (P.current = X);
|
|
3219
|
+
}
|
|
3220
|
+
return O.events.on("virtualfocus", $), () => {
|
|
3221
|
+
O.events.off("virtualfocus", $);
|
|
3222
|
+
};
|
|
3223
|
+
}, [u, O, m, H, P]), U(() => {
|
|
3224
|
+
I.current = D, x.current = !!o.floating;
|
|
3225
|
+
}), U(() => {
|
|
3226
|
+
n || (v.current = null);
|
|
3227
|
+
}, [n]), U(() => {
|
|
3228
|
+
k.current = n;
|
|
3229
|
+
}, [n]);
|
|
3230
|
+
const Q = s != null, G = d.useMemo(() => {
|
|
3231
|
+
function $(W) {
|
|
3232
|
+
if (!n)
|
|
3233
|
+
return;
|
|
3234
|
+
const Z = i.current.indexOf(W);
|
|
3235
|
+
Z !== -1 && D(Z);
|
|
3236
|
+
}
|
|
3237
|
+
return {
|
|
3238
|
+
onFocus(W) {
|
|
3239
|
+
let {
|
|
3240
|
+
currentTarget: Z
|
|
3241
|
+
} = W;
|
|
3242
|
+
$(Z);
|
|
3243
|
+
},
|
|
3244
|
+
onClick: (W) => {
|
|
3245
|
+
let {
|
|
3246
|
+
currentTarget: Z
|
|
3247
|
+
} = W;
|
|
3248
|
+
return Z.focus({
|
|
3249
|
+
preventScroll: !0
|
|
3250
|
+
});
|
|
3251
|
+
},
|
|
3252
|
+
// Safari
|
|
3253
|
+
...R && {
|
|
3254
|
+
onMouseMove(W) {
|
|
3255
|
+
let {
|
|
3256
|
+
currentTarget: Z
|
|
3257
|
+
} = W;
|
|
3258
|
+
$(Z);
|
|
3259
|
+
},
|
|
3260
|
+
onPointerLeave(W) {
|
|
3261
|
+
let {
|
|
3262
|
+
pointerType: Z
|
|
3263
|
+
} = W;
|
|
3264
|
+
!w.current || Z === "touch" || (S.current = -1, j(i, S), D(null), m || Oe(le.current, {
|
|
3265
|
+
preventScroll: !0
|
|
3266
|
+
}));
|
|
3267
|
+
}
|
|
3268
|
+
}
|
|
3269
|
+
};
|
|
3270
|
+
}, [n, le, j, R, i, D, m]), ve = ie(($) => {
|
|
3271
|
+
if (w.current = !1, _.current = !0, !re.current && $.currentTarget === le.current)
|
|
3272
|
+
return;
|
|
3273
|
+
if (h && Cn($.key, b, a)) {
|
|
3274
|
+
oe($), r(!1, $.nativeEvent, "list-navigation"), te(o.domReference) && !m && o.domReference.focus();
|
|
3275
|
+
return;
|
|
3276
|
+
}
|
|
3277
|
+
const X = S.current, W = Ot(i, C), Z = cn(i, C);
|
|
3278
|
+
if ($.key === "Home" && (oe($), S.current = W, D(S.current)), $.key === "End" && (oe($), S.current = Z, D(S.current)), y > 1) {
|
|
3279
|
+
const ue = V || Array.from({
|
|
3280
|
+
length: i.current.length
|
|
3281
|
+
}, () => ({
|
|
3282
|
+
width: 1,
|
|
3283
|
+
height: 1
|
|
3284
|
+
})), J = xo(ue, y, B), be = J.findIndex((pe) => pe != null && !ft(i.current, pe, C)), ot = J.reduce((pe, Ie, it) => Ie != null && !ft(i.current, Ie, C) ? it : pe, -1);
|
|
3285
|
+
if (S.current = J[yo({
|
|
3286
|
+
current: J.map((pe) => pe != null ? i.current[pe] : null)
|
|
3287
|
+
}, {
|
|
3288
|
+
event: $,
|
|
3289
|
+
orientation: b,
|
|
3290
|
+
loop: f,
|
|
3291
|
+
cols: y,
|
|
3292
|
+
// treat undefined (empty grid spaces) as disabled indices so we
|
|
3293
|
+
// don't end up in them
|
|
3294
|
+
disabledIndices: Ro([...C || i.current.map((pe, Ie) => ft(i.current, Ie) ? Ie : void 0), void 0], J),
|
|
3295
|
+
minIndex: be,
|
|
3296
|
+
maxIndex: ot,
|
|
3297
|
+
prevIndex: wo(
|
|
3298
|
+
S.current > Z ? W : S.current,
|
|
3299
|
+
ue,
|
|
3300
|
+
J,
|
|
3301
|
+
y,
|
|
3302
|
+
// use a corner matching the edge closest to the direction
|
|
3303
|
+
// we're moving in so we don't end up in the same item. Prefer
|
|
3304
|
+
// top/left over bottom/right.
|
|
3305
|
+
$.key === nt ? "bl" : $.key === Ue ? "tr" : "tl"
|
|
3306
|
+
),
|
|
3307
|
+
stopEvent: !0
|
|
3308
|
+
})], D(S.current), b === "both")
|
|
3309
|
+
return;
|
|
3310
|
+
}
|
|
3311
|
+
if (En($.key, b)) {
|
|
3312
|
+
if (oe($), n && !m && he($.currentTarget.ownerDocument) === $.currentTarget) {
|
|
3313
|
+
S.current = Pt($.key, b, a) ? W : Z, D(S.current);
|
|
3314
|
+
return;
|
|
3315
|
+
}
|
|
3316
|
+
Pt($.key, b, a) ? f ? S.current = X >= Z ? g && X !== i.current.length ? -1 : W : se(i, {
|
|
3317
|
+
startingIndex: X,
|
|
3318
|
+
disabledIndices: C
|
|
3319
|
+
}) : S.current = Math.min(Z, se(i, {
|
|
3320
|
+
startingIndex: X,
|
|
3321
|
+
disabledIndices: C
|
|
3322
|
+
})) : f ? S.current = X <= W ? g && X !== -1 ? i.current.length : Z : se(i, {
|
|
3323
|
+
startingIndex: X,
|
|
3324
|
+
decrement: !0,
|
|
3325
|
+
disabledIndices: C
|
|
3326
|
+
}) : S.current = Math.max(W, se(i, {
|
|
3327
|
+
startingIndex: X,
|
|
3328
|
+
decrement: !0,
|
|
3329
|
+
disabledIndices: C
|
|
3330
|
+
})), Ge(i, S.current) ? D(null) : D(S.current);
|
|
3331
|
+
}
|
|
3332
|
+
}), xe = d.useMemo(() => m && n && Q && {
|
|
3333
|
+
"aria-activedescendant": F || K
|
|
3334
|
+
}, [m, n, Q, F, K]), ge = d.useMemo(() => ({
|
|
3335
|
+
"aria-orientation": b === "both" ? void 0 : b,
|
|
3336
|
+
...!Fn(o.domReference) && xe,
|
|
3337
|
+
onKeyDown: ve,
|
|
3338
|
+
onPointerMove() {
|
|
3339
|
+
w.current = !0;
|
|
3340
|
+
}
|
|
3341
|
+
}), [xe, ve, o.domReference, b]), _e = d.useMemo(() => {
|
|
3342
|
+
function $(W) {
|
|
3343
|
+
p === "auto" && Dn(W.nativeEvent) && (M.current = !0);
|
|
3344
|
+
}
|
|
3345
|
+
function X(W) {
|
|
3346
|
+
M.current = p, p === "auto" && Bt(W.nativeEvent) && (M.current = !0);
|
|
3347
|
+
}
|
|
3348
|
+
return {
|
|
3349
|
+
...xe,
|
|
3350
|
+
onKeyDown(W) {
|
|
3351
|
+
w.current = !1;
|
|
3352
|
+
const Z = W.key.indexOf("Arrow") === 0, ue = zo(W.key, b, a), J = Cn(W.key, b, a), be = En(W.key, b), ot = (h ? ue : be) || W.key === "Enter" || W.key.trim() === "";
|
|
3353
|
+
if (m && n) {
|
|
3354
|
+
const Xt = O == null ? void 0 : O.nodesRef.current.find((st) => st.parentId == null), Te = O && Xt ? Po(O.nodesRef.current, Xt.id) : null;
|
|
3355
|
+
if (Z && Te && P) {
|
|
3356
|
+
const st = new KeyboardEvent("keydown", {
|
|
3357
|
+
key: W.key,
|
|
3358
|
+
bubbles: !0
|
|
3359
|
+
});
|
|
3360
|
+
if (ue || J) {
|
|
3361
|
+
var pe, Ie;
|
|
3362
|
+
const ir = ((pe = Te.context) == null ? void 0 : pe.elements.domReference) === W.currentTarget, Zt = J && !ir ? (Ie = Te.context) == null ? void 0 : Ie.elements.domReference : ue ? i.current.find((Jt) => (Jt == null ? void 0 : Jt.id) === K) : null;
|
|
3363
|
+
Zt && (oe(W), Zt.dispatchEvent(st), z(void 0));
|
|
3364
|
+
}
|
|
3365
|
+
if (be && Te.context && Te.context.open && Te.parentId && W.currentTarget !== Te.context.elements.domReference) {
|
|
3366
|
+
var it;
|
|
3367
|
+
oe(W), (it = Te.context.elements.domReference) == null || it.dispatchEvent(st);
|
|
3368
|
+
return;
|
|
3369
|
+
}
|
|
3370
|
+
}
|
|
3371
|
+
return ve(W);
|
|
3372
|
+
}
|
|
3373
|
+
if (!(!n && !E && Z)) {
|
|
3374
|
+
if (ot && (v.current = h && be ? null : W.key), h) {
|
|
3375
|
+
ue && (oe(W), n ? (S.current = Ot(i, q.current), D(S.current)) : r(!0, W.nativeEvent, "list-navigation"));
|
|
3376
|
+
return;
|
|
3377
|
+
}
|
|
3378
|
+
be && (l != null && (S.current = l), oe(W), !n && E ? r(!0, W.nativeEvent, "list-navigation") : ve(W), n && D(S.current));
|
|
3379
|
+
}
|
|
3380
|
+
},
|
|
3381
|
+
onFocus() {
|
|
3382
|
+
n && !m && D(null);
|
|
3383
|
+
},
|
|
3384
|
+
onPointerDown: X,
|
|
3385
|
+
onMouseDown: $,
|
|
3386
|
+
onClick: $
|
|
3387
|
+
};
|
|
3388
|
+
}, [K, xe, ve, q, p, i, h, D, r, n, E, b, a, l, O, m, P]);
|
|
3389
|
+
return d.useMemo(() => u ? {
|
|
3390
|
+
reference: _e,
|
|
3391
|
+
floating: ge,
|
|
3392
|
+
item: G
|
|
3393
|
+
} : {}, [u, _e, ge, G]);
|
|
3394
|
+
}
|
|
3395
|
+
const qo = /* @__PURE__ */ new Map([["select", "listbox"], ["combobox", "listbox"], ["label", !1]]);
|
|
3396
|
+
function yi(e, t) {
|
|
3397
|
+
var n;
|
|
3398
|
+
t === void 0 && (t = {});
|
|
3399
|
+
const {
|
|
3400
|
+
open: r,
|
|
3401
|
+
floatingId: o
|
|
3402
|
+
} = e, {
|
|
3403
|
+
enabled: i = !0,
|
|
3404
|
+
role: s = "dialog"
|
|
3405
|
+
} = t, c = (n = qo.get(s)) != null ? n : s, u = rt(), g = je() != null, f = d.useMemo(() => c === "tooltip" || s === "label" ? {
|
|
3406
|
+
["aria-" + (s === "label" ? "labelledby" : "describedby")]: r ? o : void 0
|
|
3407
|
+
} : {
|
|
3408
|
+
"aria-expanded": r ? "true" : "false",
|
|
3409
|
+
"aria-haspopup": c === "alertdialog" ? "dialog" : c,
|
|
3410
|
+
"aria-controls": r ? o : void 0,
|
|
3411
|
+
...c === "listbox" && {
|
|
3412
|
+
role: "combobox"
|
|
3413
|
+
},
|
|
3414
|
+
...c === "menu" && {
|
|
3415
|
+
id: u
|
|
3416
|
+
},
|
|
3417
|
+
...c === "menu" && g && {
|
|
3418
|
+
role: "menuitem"
|
|
3419
|
+
},
|
|
3420
|
+
...s === "select" && {
|
|
3421
|
+
"aria-autocomplete": "none"
|
|
3422
|
+
},
|
|
3423
|
+
...s === "combobox" && {
|
|
3424
|
+
"aria-autocomplete": "list"
|
|
3425
|
+
}
|
|
3426
|
+
}, [c, o, g, r, u, s]), h = d.useMemo(() => {
|
|
3427
|
+
const m = {
|
|
3428
|
+
id: o,
|
|
3429
|
+
...c && {
|
|
3430
|
+
role: c
|
|
3431
|
+
}
|
|
3432
|
+
};
|
|
3433
|
+
return c === "tooltip" || s === "label" ? m : {
|
|
3434
|
+
...m,
|
|
3435
|
+
...c === "menu" && {
|
|
3436
|
+
"aria-labelledby": u
|
|
3437
|
+
}
|
|
3438
|
+
};
|
|
3439
|
+
}, [c, o, u, s]), a = d.useCallback((m) => {
|
|
3440
|
+
let {
|
|
3441
|
+
active: p,
|
|
3442
|
+
selected: R
|
|
3443
|
+
} = m;
|
|
3444
|
+
const E = {
|
|
3445
|
+
role: "option",
|
|
3446
|
+
...p && {
|
|
3447
|
+
id: o + "-option"
|
|
3448
|
+
}
|
|
3449
|
+
};
|
|
3450
|
+
switch (s) {
|
|
3451
|
+
case "select":
|
|
3452
|
+
return {
|
|
3453
|
+
...E,
|
|
3454
|
+
"aria-selected": p && R
|
|
3455
|
+
};
|
|
3456
|
+
case "combobox":
|
|
3457
|
+
return {
|
|
3458
|
+
...E,
|
|
3459
|
+
...p && {
|
|
3460
|
+
"aria-selected": !0
|
|
3461
|
+
}
|
|
3462
|
+
};
|
|
3463
|
+
}
|
|
3464
|
+
return {};
|
|
3465
|
+
}, [o, s]);
|
|
3466
|
+
return d.useMemo(() => i ? {
|
|
3467
|
+
reference: f,
|
|
3468
|
+
floating: h,
|
|
3469
|
+
item: a
|
|
3470
|
+
} : {}, [i, f, h, a]);
|
|
3471
|
+
}
|
|
3472
|
+
function xi(e, t) {
|
|
3473
|
+
var n;
|
|
3474
|
+
const {
|
|
3475
|
+
open: r,
|
|
3476
|
+
dataRef: o
|
|
3477
|
+
} = e, {
|
|
3478
|
+
listRef: i,
|
|
3479
|
+
activeIndex: s,
|
|
3480
|
+
onMatch: c,
|
|
3481
|
+
onTypingChange: u,
|
|
3482
|
+
enabled: l = !0,
|
|
3483
|
+
findMatch: g = null,
|
|
3484
|
+
resetMs: f = 750,
|
|
3485
|
+
ignoreKeys: h = [],
|
|
3486
|
+
selectedIndex: a = null
|
|
3487
|
+
} = t, m = d.useRef(), p = d.useRef(""), R = d.useRef((n = a ?? s) != null ? n : -1), E = d.useRef(null), C = ie(c), b = ie(u), y = de(g), A = de(h);
|
|
3488
|
+
U(() => {
|
|
3489
|
+
r && (clearTimeout(m.current), E.current = null, p.current = "");
|
|
3490
|
+
}, [r]), U(() => {
|
|
3491
|
+
if (r && p.current === "") {
|
|
3492
|
+
var O;
|
|
3493
|
+
R.current = (O = a ?? s) != null ? O : -1;
|
|
3494
|
+
}
|
|
3495
|
+
}, [r, a, s]);
|
|
3496
|
+
const P = ie((O) => {
|
|
3497
|
+
O ? o.current.typing || (o.current.typing = O, b(O)) : o.current.typing && (o.current.typing = O, b(O));
|
|
3498
|
+
}), V = ie((O) => {
|
|
3499
|
+
function D(I, x, k) {
|
|
3500
|
+
const _ = y.current ? y.current(x, k) : x.find((T) => (T == null ? void 0 : T.toLocaleLowerCase().indexOf(k.toLocaleLowerCase())) === 0);
|
|
3501
|
+
return _ ? I.indexOf(_) : -1;
|
|
3502
|
+
}
|
|
3503
|
+
const M = i.current;
|
|
3504
|
+
if (p.current.length > 0 && p.current[0] !== " " && (D(M, M, p.current) === -1 ? P(!1) : O.key === " " && oe(O)), M == null || A.current.includes(O.key) || // Character key.
|
|
3505
|
+
O.key.length !== 1 || // Modifier key.
|
|
3506
|
+
O.ctrlKey || O.metaKey || O.altKey)
|
|
3507
|
+
return;
|
|
3508
|
+
r && O.key !== " " && (oe(O), P(!0)), M.every((I) => {
|
|
3509
|
+
var x, k;
|
|
3510
|
+
return I ? ((x = I[0]) == null ? void 0 : x.toLocaleLowerCase()) !== ((k = I[1]) == null ? void 0 : k.toLocaleLowerCase()) : !0;
|
|
3511
|
+
}) && p.current === O.key && (p.current = "", R.current = E.current), p.current += O.key, clearTimeout(m.current), m.current = setTimeout(() => {
|
|
3512
|
+
p.current = "", R.current = E.current, P(!1);
|
|
3513
|
+
}, f);
|
|
3514
|
+
const v = R.current, w = D(M, [...M.slice((v || 0) + 1), ...M.slice(0, (v || 0) + 1)], p.current);
|
|
3515
|
+
w !== -1 ? (C(w), E.current = w) : O.key !== " " && (p.current = "", P(!1));
|
|
3516
|
+
}), B = d.useMemo(() => ({
|
|
3517
|
+
onKeyDown: V
|
|
3518
|
+
}), [V]), H = d.useMemo(() => ({
|
|
3519
|
+
onKeyDown: V,
|
|
3520
|
+
onKeyUp(O) {
|
|
3521
|
+
O.key === " " && P(!1);
|
|
3522
|
+
}
|
|
3523
|
+
}), [V, P]);
|
|
3524
|
+
return d.useMemo(() => l ? {
|
|
3525
|
+
reference: B,
|
|
3526
|
+
floating: H
|
|
3527
|
+
} : {}, [l, B, H]);
|
|
3528
|
+
}
|
|
3529
|
+
function In(e, t) {
|
|
3530
|
+
const [n, r] = e;
|
|
3531
|
+
let o = !1;
|
|
3532
|
+
const i = t.length;
|
|
3533
|
+
for (let s = 0, c = i - 1; s < i; c = s++) {
|
|
3534
|
+
const [u, l] = t[s] || [0, 0], [g, f] = t[c] || [0, 0];
|
|
3535
|
+
l >= r != f >= r && n <= (g - u) * (r - l) / (f - l) + u && (o = !o);
|
|
3536
|
+
}
|
|
3537
|
+
return o;
|
|
3538
|
+
}
|
|
3539
|
+
function Uo(e, t) {
|
|
3540
|
+
return e[0] >= t.x && e[0] <= t.x + t.width && e[1] >= t.y && e[1] <= t.y + t.height;
|
|
3541
|
+
}
|
|
3542
|
+
function wi(e) {
|
|
3543
|
+
e === void 0 && (e = {});
|
|
3544
|
+
const {
|
|
3545
|
+
buffer: t = 0.5,
|
|
3546
|
+
blockPointerEvents: n = !1,
|
|
3547
|
+
requireIntent: r = !0
|
|
3548
|
+
} = e;
|
|
3549
|
+
let o, i = !1, s = null, c = null, u = performance.now();
|
|
3550
|
+
function l(f, h) {
|
|
3551
|
+
const a = performance.now(), m = a - u;
|
|
3552
|
+
if (s === null || c === null || m === 0)
|
|
3553
|
+
return s = f, c = h, u = a, null;
|
|
3554
|
+
const p = f - s, R = h - c, C = Math.sqrt(p * p + R * R) / m;
|
|
3555
|
+
return s = f, c = h, u = a, C;
|
|
3556
|
+
}
|
|
3557
|
+
const g = (f) => {
|
|
3558
|
+
let {
|
|
3559
|
+
x: h,
|
|
3560
|
+
y: a,
|
|
3561
|
+
placement: m,
|
|
3562
|
+
elements: p,
|
|
3563
|
+
onClose: R,
|
|
3564
|
+
nodeId: E,
|
|
3565
|
+
tree: C
|
|
3566
|
+
} = f;
|
|
3567
|
+
return function(y) {
|
|
3568
|
+
function A() {
|
|
3569
|
+
clearTimeout(o), R();
|
|
3570
|
+
}
|
|
3571
|
+
if (clearTimeout(o), !p.domReference || !p.floating || m == null || h == null || a == null)
|
|
3572
|
+
return;
|
|
3573
|
+
const {
|
|
3574
|
+
clientX: P,
|
|
3575
|
+
clientY: V
|
|
3576
|
+
} = y, B = [P, V], H = we(y), O = y.type === "mouseleave", D = ee(p.floating, H), M = ee(p.domReference, H), S = p.domReference.getBoundingClientRect(), v = p.floating.getBoundingClientRect(), w = m.split("-")[0], I = h > v.right - v.width / 2, x = a > v.bottom - v.height / 2, k = Uo(B, S), _ = v.width > S.width, T = v.height > S.height, q = (_ ? S : v).left, re = (_ ? S : v).right, ce = (T ? S : v).top, le = (T ? S : v).bottom;
|
|
3577
|
+
if (D && (i = !0, !O))
|
|
3578
|
+
return;
|
|
3579
|
+
if (M && (i = !1), M && !O) {
|
|
3580
|
+
i = !0;
|
|
3581
|
+
return;
|
|
3582
|
+
}
|
|
3583
|
+
if (O && Y(y.relatedTarget) && ee(p.floating, y.relatedTarget) || C && Ne(C.nodesRef.current, E).some((N) => {
|
|
3584
|
+
let {
|
|
3585
|
+
context: F
|
|
3586
|
+
} = N;
|
|
3587
|
+
return F == null ? void 0 : F.open;
|
|
3588
|
+
}))
|
|
3589
|
+
return;
|
|
3590
|
+
if (w === "top" && a >= S.bottom - 1 || w === "bottom" && a <= S.top + 1 || w === "left" && h >= S.right - 1 || w === "right" && h <= S.left + 1)
|
|
3591
|
+
return A();
|
|
3592
|
+
let L = [];
|
|
3593
|
+
switch (w) {
|
|
3594
|
+
case "top":
|
|
3595
|
+
L = [[q, S.top + 1], [q, v.bottom - 1], [re, v.bottom - 1], [re, S.top + 1]];
|
|
3596
|
+
break;
|
|
3597
|
+
case "bottom":
|
|
3598
|
+
L = [[q, v.top + 1], [q, S.bottom - 1], [re, S.bottom - 1], [re, v.top + 1]];
|
|
3599
|
+
break;
|
|
3600
|
+
case "left":
|
|
3601
|
+
L = [[v.right - 1, le], [v.right - 1, ce], [S.left + 1, ce], [S.left + 1, le]];
|
|
3602
|
+
break;
|
|
3603
|
+
case "right":
|
|
3604
|
+
L = [[S.right - 1, le], [S.right - 1, ce], [v.left + 1, ce], [v.left + 1, le]];
|
|
3605
|
+
break;
|
|
3606
|
+
}
|
|
3607
|
+
function K(N) {
|
|
3608
|
+
let [F, z] = N;
|
|
3609
|
+
switch (w) {
|
|
3610
|
+
case "top": {
|
|
3611
|
+
const j = [_ ? F + t / 2 : I ? F + t * 4 : F - t * 4, z + t + 1], Q = [_ ? F - t / 2 : I ? F + t * 4 : F - t * 4, z + t + 1], G = [[v.left, I || _ ? v.bottom - t : v.top], [v.right, I ? _ ? v.bottom - t : v.top : v.bottom - t]];
|
|
3612
|
+
return [j, Q, ...G];
|
|
3613
|
+
}
|
|
3614
|
+
case "bottom": {
|
|
3615
|
+
const j = [_ ? F + t / 2 : I ? F + t * 4 : F - t * 4, z - t], Q = [_ ? F - t / 2 : I ? F + t * 4 : F - t * 4, z - t], G = [[v.left, I || _ ? v.top + t : v.bottom], [v.right, I ? _ ? v.top + t : v.bottom : v.top + t]];
|
|
3616
|
+
return [j, Q, ...G];
|
|
3617
|
+
}
|
|
3618
|
+
case "left": {
|
|
3619
|
+
const j = [F + t + 1, T ? z + t / 2 : x ? z + t * 4 : z - t * 4], Q = [F + t + 1, T ? z - t / 2 : x ? z + t * 4 : z - t * 4];
|
|
3620
|
+
return [...[[x || T ? v.right - t : v.left, v.top], [x ? T ? v.right - t : v.left : v.right - t, v.bottom]], j, Q];
|
|
3621
|
+
}
|
|
3622
|
+
case "right": {
|
|
3623
|
+
const j = [F - t, T ? z + t / 2 : x ? z + t * 4 : z - t * 4], Q = [F - t, T ? z - t / 2 : x ? z + t * 4 : z - t * 4], G = [[x || T ? v.left + t : v.right, v.top], [x ? T ? v.left + t : v.right : v.left + t, v.bottom]];
|
|
3624
|
+
return [j, Q, ...G];
|
|
3625
|
+
}
|
|
3626
|
+
}
|
|
3627
|
+
}
|
|
3628
|
+
if (!In([P, V], L)) {
|
|
3629
|
+
if (i && !k)
|
|
3630
|
+
return A();
|
|
3631
|
+
if (!O && r) {
|
|
3632
|
+
const N = l(y.clientX, y.clientY);
|
|
3633
|
+
if (N !== null && N < 0.1)
|
|
3634
|
+
return A();
|
|
3635
|
+
}
|
|
3636
|
+
In([P, V], K([h, a])) ? !i && r && (o = window.setTimeout(A, 40)) : A();
|
|
3637
|
+
}
|
|
3638
|
+
};
|
|
3639
|
+
};
|
|
3640
|
+
return g.__options = {
|
|
3641
|
+
blockPointerEvents: n
|
|
3642
|
+
}, g;
|
|
3643
|
+
}
|
|
3644
|
+
export {
|
|
3645
|
+
si as A,
|
|
3646
|
+
ni as B,
|
|
3647
|
+
ci as C,
|
|
3648
|
+
ui as D,
|
|
3649
|
+
fi as F,
|
|
3650
|
+
di as a,
|
|
3651
|
+
oi as b,
|
|
3652
|
+
pi as c,
|
|
3653
|
+
Yo as d,
|
|
3654
|
+
Xo as e,
|
|
3655
|
+
Jo as f,
|
|
3656
|
+
ei as g,
|
|
3657
|
+
mi as h,
|
|
3658
|
+
li as i,
|
|
3659
|
+
wi as j,
|
|
3660
|
+
gi as k,
|
|
3661
|
+
Zo as l,
|
|
3662
|
+
yi as m,
|
|
3663
|
+
vi as n,
|
|
3664
|
+
Go as o,
|
|
3665
|
+
ai as p,
|
|
3666
|
+
Mo as q,
|
|
3667
|
+
hi as r,
|
|
3668
|
+
Qo as s,
|
|
3669
|
+
ri as t,
|
|
3670
|
+
ti as u,
|
|
3671
|
+
Ye as v,
|
|
3672
|
+
ii as w,
|
|
3673
|
+
je as x,
|
|
3674
|
+
bi as y,
|
|
3675
|
+
xi as z
|
|
3676
|
+
};
|
|
3677
|
+
//# sourceMappingURL=index-04060912.js.map
|