@iress-oss/ids-components 5.20.8 → 5.20.9
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/dist/AutocompleteNoResults-B9WjoXJo.js +10 -0
- package/dist/Badge-BqaFutTZ.js +40 -0
- package/dist/CheckboxGroup-WLxp9nIX.js +79 -0
- package/dist/CheckboxMark.types-CW7xyywE.js +17 -0
- package/dist/ClearButton-s0_b3pvJ.js +25 -0
- package/dist/ComboboxHiddenInput-DH3V3Dyg.js +27 -0
- package/dist/Expander-B3_k6HJq.js +55 -0
- package/dist/InputBase-BnBuTYZm.js +48 -0
- package/dist/LabelBase-CV1O4V_d.js +51 -0
- package/dist/Loading.module-DdUL1FMv.js +16 -0
- package/dist/LogoFromSrc-7oPJTvAO.js +50 -0
- package/dist/LongLoading-Dw8sUYlh.js +117 -0
- package/dist/MenuItem.module-guf-3YyL.js +24 -0
- package/dist/Placeholder-C1YrHg4w.js +35 -0
- package/dist/Popover.module-6flgSLob.js +10 -0
- package/dist/PopoverProvider-DgUOscvy.js +109 -0
- package/dist/Progress-BypnLSGF.js +35 -0
- package/dist/RadioGroup-DtA0WE3l.js +78 -0
- package/dist/SelectControl-D8Y9Up2f.js +28 -0
- package/dist/Skeleton-D_iuo6Xw.js +34 -0
- package/dist/SkipLink-rElTLeMe.js +15 -0
- package/dist/SlideoutProvider-DnaE67W-.js +125 -0
- package/dist/SliderTicks-BqTI-XhQ.js +47 -0
- package/dist/StartUpLoading-DFAMmjg3.js +68 -0
- package/dist/Tab-C08D4jxr.js +68 -0
- package/dist/TabSet.module-q8a7ksiF.js +13 -0
- package/dist/Table.module-DnaTe51E.js +32 -0
- package/dist/Toggle-CF22OY-P.js +66 -0
- package/dist/Tooltip-BxM_1Wtq.js +60 -0
- package/dist/ValidationBase-A2Ed7iem.js +29 -0
- package/dist/ValidationSummary-D6Wa4vOf.js +38 -0
- package/dist/chunk-efA98nb6.js +13 -0
- package/dist/classnames-BTnCYmAN.js +31 -0
- package/dist/components/Alert/Alert.js +2 -11
- package/dist/components/Alert/Alert.types.js +8 -8
- package/dist/components/Alert/index.js +3 -6
- package/dist/components/Autocomplete/Autocomplete.js +2 -45
- package/dist/components/Autocomplete/Autocomplete.types.js +0 -1
- package/dist/components/Autocomplete/components/AutocompleteInstructions.js +10 -10
- package/dist/components/Autocomplete/components/AutocompleteNoResults.js +2 -5
- package/dist/components/Autocomplete/hooks/useAutocompleteSearch.js +2 -191
- package/dist/components/Autocomplete/index.js +3 -6
- package/dist/components/Badge/Badge.js +2 -49
- package/dist/components/Badge/Badge.types.js +14 -14
- package/dist/components/Badge/index.js +3 -7
- package/dist/components/Button/Button.js +2 -10
- package/dist/components/Button/Button.types.js +22 -20
- package/dist/components/Button/CloseButton/CloseButton.js +2 -7
- package/dist/components/Button/CloseButton/CloseButton.types.js +0 -1
- package/dist/components/Button/index.js +3 -11
- package/dist/components/ButtonGroup/ButtonGroup.js +2 -72
- package/dist/components/ButtonGroup/ButtonGroup.types.js +0 -1
- package/dist/components/ButtonGroup/ButtonGroupProvider.js +26 -33
- package/dist/components/ButtonGroup/hooks/useButtonGroup.js +6 -6
- package/dist/components/ButtonGroup/hooks/useIDSButtonGroupItem.js +2 -6
- package/dist/components/ButtonGroup/index.js +3 -6
- package/dist/components/Card/Card.js +34 -48
- package/dist/components/Card/Card.types.js +8 -5
- package/dist/components/Card/components/ButtonCard.js +29 -37
- package/dist/components/Card/components/LinkCard.js +28 -36
- package/dist/components/Card/helpers/composeIDSCard.js +18 -26
- package/dist/components/Card/helpers/composeIDSCardSlots.js +47 -32
- package/dist/components/Card/index.js +7 -15
- package/dist/components/Checkbox/Checkbox.js +2 -15
- package/dist/components/Checkbox/Checkbox.types.js +0 -1
- package/dist/components/Checkbox/helpers/mapCheckboxGroupOptions.js +12 -19
- package/dist/components/Checkbox/index.js +2 -4
- package/dist/components/CheckboxGroup/CheckboxGroup.js +2 -99
- package/dist/components/CheckboxGroup/CheckboxGroup.types.js +10 -10
- package/dist/components/CheckboxGroup/CheckboxGroupContext.js +5 -5
- package/dist/components/CheckboxGroup/index.js +3 -7
- package/dist/components/CheckboxMark/CheckboxMark.js +29 -40
- package/dist/components/CheckboxMark/CheckboxMark.types.js +2 -16
- package/dist/components/CheckboxMark/index.js +3 -6
- package/dist/components/Col/Col.js +14 -33
- package/dist/components/Col/Col.types.js +67 -65
- package/dist/components/Col/index.js +3 -12
- package/dist/components/Combobox/Combobox.js +2 -48
- package/dist/components/Combobox/Combobox.types.js +0 -1
- package/dist/components/Combobox/MultiCombobox/MultiCombobox.js +2 -46
- package/dist/components/Combobox/MultiCombobox/MultiCombobox.types.js +0 -1
- package/dist/components/Combobox/components/ComboboxHiddenInput.js +2 -8
- package/dist/components/Combobox/components/ComboboxResults.js +2 -41
- package/dist/components/Combobox/components/ComboboxResultsDescriptor.js +2 -40
- package/dist/components/Combobox/hooks/useComboboxFlags.js +11 -14
- package/dist/components/Combobox/hooks/useComboboxInlineCompletion.js +39 -59
- package/dist/components/Combobox/index.js +2 -5
- package/dist/components/Container/Container.js +12 -21
- package/dist/components/Container/Container.types.js +6 -4
- package/dist/components/Container/index.js +3 -6
- package/dist/components/Divider/Divider.js +14 -21
- package/dist/components/Divider/Divider.types.js +6 -4
- package/dist/components/Divider/index.js +2 -5
- package/dist/components/Expander/Expander.js +2 -80
- package/dist/components/Expander/Expander.types.js +10 -6
- package/dist/components/Expander/index.js +3 -7
- package/dist/components/Field/Field.js +2 -71
- package/dist/components/Field/Field.types.js +0 -1
- package/dist/components/Field/FieldGroup/FieldGroup.js +2 -77
- package/dist/components/Field/FieldGroup/FieldGroup.types.js +0 -1
- package/dist/components/Field/components/FieldAppendToLabel.js +2 -43
- package/dist/components/Field/components/FieldLegend.js +9 -6
- package/dist/components/Field/helpers/getUniqueItemsByKey.js +4 -8
- package/dist/components/Field/index.js +2 -6
- package/dist/components/Filter/Filter.js +2 -45
- package/dist/components/Filter/Filter.types.js +0 -1
- package/dist/components/Filter/components/FilterLabel.js +6 -10
- package/dist/components/Filter/components/FilterResetButton.js +2 -39
- package/dist/components/Filter/components/FilterSearch.js +2 -39
- package/dist/components/Filter/hooks/useFilterFlags.js +15 -24
- package/dist/components/Filter/index.js +2 -4
- package/dist/components/Form/Form.js +2 -6
- package/dist/components/Form/Form.types.js +6 -4
- package/dist/components/Form/FormContext.js +5 -7
- package/dist/components/Form/FormField/FormField.js +2 -91
- package/dist/components/Form/FormField/FormField.types.js +6 -4
- package/dist/components/Form/FormField/FormFieldset.js +2 -81
- package/dist/components/Form/FormField/helpers/getErrorTypeMessage.js +9 -19
- package/dist/components/Form/FormField/helpers/transformCustomRulesToValidateRule.js +23 -33
- package/dist/components/Form/HookForm/HookForm.js +2 -12
- package/dist/components/Form/components/FormValidationSummary.js +22 -22
- package/dist/components/Form/hooks/useNoDefaultValueInForms.js +6 -13
- package/dist/components/Form/index.js +4 -13
- package/dist/components/HeadingWithDeprecatedFallback/HeadingWithDeprecatedFallback.js +12 -14
- package/dist/components/Hide/Hide.js +2 -7
- package/dist/components/Hide/Hide.types.js +8 -5
- package/dist/components/Hide/helpers/composeHideClasses.js +2 -40
- package/dist/components/Hide/index.js +3 -7
- package/dist/components/Icon/Icon.js +2 -40
- package/dist/components/Icon/Icon.types.js +35 -30
- package/dist/components/Icon/index.js +3 -15
- package/dist/components/Inline/Inline.js +2 -41
- package/dist/components/Inline/Inline.types.js +6 -4
- package/dist/components/Inline/index.js +3 -6
- package/dist/components/Input/ClearButton/ClearButton.js +2 -20
- package/dist/components/Input/Input.js +2 -14
- package/dist/components/Input/Input.types.js +15 -15
- package/dist/components/Input/InputBase/InputBase.js +2 -9
- package/dist/components/Input/InputBase/InputBase.types.js +0 -1
- package/dist/components/Input/index.js +3 -7
- package/dist/components/InputCurrency/InputCurrency.js +2 -8
- package/dist/components/InputCurrency/InputCurrency.types.js +0 -1
- package/dist/components/InputCurrency/index.js +2 -4
- package/dist/components/Label/Label.js +9 -6
- package/dist/components/Label/Label.types.js +0 -1
- package/dist/components/Label/LabelBase/LabelBase.js +2 -70
- package/dist/components/Label/LabelBase/LabelBase.types.js +0 -1
- package/dist/components/Label/index.js +2 -4
- package/dist/components/Menu/Menu.js +49 -63
- package/dist/components/Menu/Menu.types.js +17 -10
- package/dist/components/Menu/MenuDivider/MenuDivider.js +2 -39
- package/dist/components/Menu/MenuHeading/MenuHeading.js +2 -8
- package/dist/components/Menu/MenuItem/MenuItem.js +2 -11
- package/dist/components/Menu/MenuItem/MenuItem.types.js +10 -6
- package/dist/components/Menu/MenuItem/hooks/useMenuItemAria.js +11 -16
- package/dist/components/Menu/MenuItem/hooks/useMenuItemButtonProps.js +44 -46
- package/dist/components/Menu/MenuItem/hooks/useMenuItemComposite.js +17 -14
- package/dist/components/Menu/MenuItem/hooks/useMenuItemInteractions.js +53 -64
- package/dist/components/Menu/MenuItem/hooks/useMenuItemRole.js +8 -8
- package/dist/components/Menu/MenuProvider.js +45 -66
- package/dist/components/Menu/MenuText/MenuText.js +2 -40
- package/dist/components/Menu/helpers/mapMenuItems.js +2 -47
- package/dist/components/Menu/hooks/useMenu.js +6 -6
- package/dist/components/Menu/hooks/useMenuAria.js +13 -18
- package/dist/components/Menu/hooks/useMenuComposite.js +7 -7
- package/dist/components/Menu/hooks/useMenuRole.js +11 -12
- package/dist/components/Menu/hooks/useMenuStyles.js +2 -26
- package/dist/components/Menu/index.js +10 -29
- package/dist/components/Modal/Modal.js +2 -16
- package/dist/components/Modal/Modal.types.js +9 -4
- package/dist/components/Modal/ModalProvider.js +26 -31
- package/dist/components/Modal/hooks/useIDSProvidedModal.js +12 -12
- package/dist/components/Modal/hooks/useModal.js +11 -19
- package/dist/components/Modal/index.js +5 -11
- package/dist/components/Navbar/Navbar.js +2 -13
- package/dist/components/Navbar/Navbar.types.js +6 -4
- package/dist/components/Navbar/components/HomeLinkContent.js +2 -6
- package/dist/components/Navbar/components/LogoFromSrc.js +2 -6
- package/dist/components/Navbar/components/NavbarLogo.js +2 -8
- package/dist/components/Navbar/index.js +3 -6
- package/dist/components/Panel/Panel.js +21 -35
- package/dist/components/Panel/Panel.types.js +12 -11
- package/dist/components/Panel/index.js +3 -8
- package/dist/components/Placeholder/Placeholder.js +2 -42
- package/dist/components/Placeholder/Placeholder.types.js +0 -1
- package/dist/components/Placeholder/index.js +2 -4
- package/dist/components/Popover/InputPopover/InputPopover.js +51 -87
- package/dist/components/Popover/InputPopover/InputPopover.types.js +0 -1
- package/dist/components/Popover/InputPopover/InputPopoverActivator.js +50 -58
- package/dist/components/Popover/InputPopover/InputPopoverProvider.js +86 -107
- package/dist/components/Popover/Popover.js +59 -97
- package/dist/components/Popover/Popover.types.js +14 -15
- package/dist/components/Popover/PopoverProvider.js +2 -15
- package/dist/components/Popover/components/NestedPopoverActivator.js +9 -9
- package/dist/components/Popover/components/PopoverActivator.js +63 -81
- package/dist/components/Popover/components/PopoverContent.js +51 -58
- package/dist/components/Popover/helpers/composeFloatingProps.js +42 -33
- package/dist/components/Popover/helpers/composePopoverWidth.js +7 -4
- package/dist/components/Popover/helpers/handlePopoverTabKey.js +23 -29
- package/dist/components/Popover/helpers/hasFocus.js +7 -7
- package/dist/components/Popover/helpers/waitUntilTrue.js +11 -11
- package/dist/components/Popover/hooks/usePopover.js +6 -6
- package/dist/components/Popover/hooks/usePopoverActivatorInteractions.js +23 -32
- package/dist/components/Popover/hooks/usePopoverAria.js +12 -17
- package/dist/components/Popover/hooks/usePopoverImperativeHandle.js +20 -24
- package/dist/components/Popover/hooks/usePopoverItem.js +20 -16
- package/dist/components/Popover/hooks/usePopoverNavigation.js +32 -31
- package/dist/components/Popover/hooks/usePopoverState.js +21 -28
- package/dist/components/Popover/index.js +5 -13
- package/dist/components/Progress/Progress.js +2 -48
- package/dist/components/Progress/Progress.types.js +0 -1
- package/dist/components/Progress/index.js +2 -4
- package/dist/components/Provider/Provider.js +2 -38
- package/dist/components/Provider/index.js +2 -4
- package/dist/components/Radio/Radio.js +2 -11
- package/dist/components/Radio/Radio.types.js +0 -1
- package/dist/components/Radio/helpers/mapRadioGroupOptions.js +12 -19
- package/dist/components/Radio/index.js +2 -4
- package/dist/components/RadioGroup/RadioGroup.js +2 -98
- package/dist/components/RadioGroup/RadioGroup.types.js +11 -11
- package/dist/components/RadioGroup/RadioGroupContext.js +5 -5
- package/dist/components/RadioGroup/index.js +3 -8
- package/dist/components/Readonly/Readonly.js +2 -43
- package/dist/components/Readonly/Readonly.types.js +0 -1
- package/dist/components/Readonly/index.js +2 -4
- package/dist/components/RichSelect/RichSelect.js +2 -42
- package/dist/components/RichSelect/RichSelect.types.js +0 -1
- package/dist/components/RichSelect/SelectBody/SelectBody.js +2 -56
- package/dist/components/RichSelect/SelectBody/SelectBody.types.js +0 -1
- package/dist/components/RichSelect/SelectCreate/SelectCreate.js +2 -63
- package/dist/components/RichSelect/SelectCreate/SelectCreate.types.js +0 -1
- package/dist/components/RichSelect/SelectHeading/SelectHeading.js +2 -40
- package/dist/components/RichSelect/SelectHeading/SelectHeading.types.js +0 -1
- package/dist/components/RichSelect/SelectLabel/SelectLabel.js +2 -12
- package/dist/components/RichSelect/SelectLabel/SelectLabel.types.js +0 -1
- package/dist/components/RichSelect/SelectMenu/SelectMenu.js +2 -44
- package/dist/components/RichSelect/SelectMenu/SelectMenu.types.js +0 -1
- package/dist/components/RichSelect/SelectMenu/SelectMenuItem.js +2 -39
- package/dist/components/RichSelect/SelectSearch/SelectSearch.js +2 -39
- package/dist/components/RichSelect/SelectSearch/SelectSearch.types.js +0 -1
- package/dist/components/RichSelect/SelectSearchInput/SelectSearchInput.js +2 -8
- package/dist/components/RichSelect/SelectSearchInput/SelectSearchInput.types.js +0 -1
- package/dist/components/RichSelect/SelectTags/SelectTags.js +2 -45
- package/dist/components/RichSelect/SelectTags/SelectTags.types.js +0 -1
- package/dist/components/RichSelect/components/SelectActivator.js +2 -7
- package/dist/components/RichSelect/components/SelectHiddenInput.js +18 -29
- package/dist/components/RichSelect/components/SelectOptions.js +2 -40
- package/dist/components/RichSelect/hooks/useRichSelectState.js +15 -17
- package/dist/components/RichSelect/index.js +3 -16
- package/dist/components/Row/Row.js +2 -41
- package/dist/components/Row/Row.types.js +6 -4
- package/dist/components/Row/index.js +3 -6
- package/dist/components/Select/Select.js +2 -14
- package/dist/components/Select/Select.types.js +0 -1
- package/dist/components/Select/SelectOption/SelectOption.js +8 -8
- package/dist/components/Select/components/SelectControl.js +2 -9
- package/dist/components/Select/components/SelectReadonly.js +2 -40
- package/dist/components/Select/helpers/mapSelectOptions.js +2 -21
- package/dist/components/Select/helpers/nodesToSelectOptions.js +2 -9
- package/dist/components/Select/index.js +3 -9
- package/dist/components/Skeleton/Skeleton.js +2 -44
- package/dist/components/Skeleton/Skeleton.types.js +10 -6
- package/dist/components/Skeleton/index.js +3 -7
- package/dist/components/SkipLink/SkipLink.js +2 -30
- package/dist/components/SkipLink/SkipLink.types.js +0 -1
- package/dist/components/SkipLink/index.js +2 -4
- package/dist/components/Slideout/Slideout.js +2 -18
- package/dist/components/Slideout/Slideout.types.js +14 -14
- package/dist/components/Slideout/SlideoutProvider.js +2 -8
- package/dist/components/Slideout/components/SlideoutInner.js +2 -8
- package/dist/components/Slideout/hooks/useIDSProvidedSlideout.js +12 -12
- package/dist/components/Slideout/hooks/useSlideout.js +11 -19
- package/dist/components/Slideout/index.js +5 -16
- package/dist/components/Slider/Slider.js +2 -12
- package/dist/components/Slider/Slider.types.js +0 -1
- package/dist/components/Slider/components/SliderTicks.js +2 -10
- package/dist/components/Slider/index.js +2 -4
- package/dist/components/Spinner/Spinner.js +2 -6
- package/dist/components/Spinner/Spinner.types.js +0 -1
- package/dist/components/Spinner/index.js +2 -4
- package/dist/components/Stack/Stack.js +15 -26
- package/dist/components/Stack/Stack.types.js +6 -4
- package/dist/components/Stack/index.js +3 -6
- package/dist/components/TabSet/Tab/Tab.js +2 -100
- package/dist/components/TabSet/Tab/Tab.types.js +0 -1
- package/dist/components/TabSet/TabSet.js +37 -58
- package/dist/components/TabSet/TabSet.types.js +10 -6
- package/dist/components/TabSet/TabSetProvider.js +45 -49
- package/dist/components/TabSet/components/TabSetItem.js +24 -44
- package/dist/components/TabSet/helpers/mapTabs.js +2 -33
- package/dist/components/TabSet/hooks/useTabSetItems.js +5 -5
- package/dist/components/TabSet/index.js +21 -11
- package/dist/components/Table/Table.js +2 -18
- package/dist/components/Table/Table.types.js +22 -22
- package/dist/components/Table/TableBody/TableBody.js +2 -125
- package/dist/components/Table/TableBody/TableBody.types.js +0 -1
- package/dist/components/Table/TableContext.js +9 -9
- package/dist/components/Table/TableFormattedValue/TableFormattedValue.js +11 -17
- package/dist/components/Table/TableFormattedValue/TableFormattedValue.types.js +0 -1
- package/dist/components/Table/TableProvider.js +31 -38
- package/dist/components/Table/components/TableBodyCell.js +16 -30
- package/dist/components/Table/components/TableEmpty.js +15 -11
- package/dist/components/Table/components/TableHeader.js +2 -8
- package/dist/components/Table/components/TableHeaderCell.js +2 -8
- package/dist/components/Table/components/TableRows.js +29 -48
- package/dist/components/Table/components/TableSortButton.js +2 -7
- package/dist/components/Table/helpers/composeIDSTableColumnDefs.js +29 -41
- package/dist/components/Table/helpers/composeIDSTableInitialSorting.js +6 -9
- package/dist/components/Table/helpers/findColumnByKey.js +4 -4
- package/dist/components/Table/helpers/getFormatFromValue.js +7 -10
- package/dist/components/Table/helpers/hasColumns.js +4 -4
- package/dist/components/Table/hooks/useIDSTableColumnSort.js +18 -23
- package/dist/components/Table/hooks/useIDSTableColumnStyles.js +21 -23
- package/dist/components/Table/hooks/useTable.js +5 -5
- package/dist/components/Table/index.js +4 -15
- package/dist/components/Tag/Tag.js +2 -8
- package/dist/components/Tag/Tag.types.js +0 -1
- package/dist/components/Tag/TagInput/TagInput.js +2 -8
- package/dist/components/Tag/TagInput/TagInput.types.js +0 -1
- package/dist/components/Tag/components/TagListInput/TagListInput.js +2 -8
- package/dist/components/Tag/components/TagListInput/TagListInput.types.js +0 -1
- package/dist/components/Tag/index.js +2 -5
- package/dist/components/Text/Text.js +19 -34
- package/dist/components/Text/Text.types.js +18 -18
- package/dist/components/Text/index.js +3 -6
- package/dist/components/Toaster/Toast/Toast.js +2 -13
- package/dist/components/Toaster/Toast/Toast.types.js +12 -9
- package/dist/components/Toaster/Toast/ToastAnimated.js +2 -9
- package/dist/components/Toaster/Toast/ToastIcon.js +2 -6
- package/dist/components/Toaster/Toaster.js +2 -11
- package/dist/components/Toaster/Toaster.types.js +23 -25
- package/dist/components/Toaster/ToasterProvider.js +2 -7
- package/dist/components/Toaster/hooks/useToaster.js +2 -26
- package/dist/components/Toaster/index.js +4 -17
- package/dist/components/Toggle/Toggle.js +2 -102
- package/dist/components/Toggle/Toggle.types.js +10 -10
- package/dist/components/Toggle/index.js +3 -7
- package/dist/components/Tooltip/Tooltip.js +2 -77
- package/dist/components/Tooltip/Tooltip.types.js +0 -1
- package/dist/components/Tooltip/index.js +2 -4
- package/dist/components/ValidationMessage/ValidationBase/ValidationBase.js +2 -51
- package/dist/components/ValidationMessage/ValidationBase/ValidationBase.types.js +0 -1
- package/dist/components/ValidationMessage/ValidationLink/ValidationLink.js +15 -21
- package/dist/components/ValidationMessage/ValidationLink/ValidationLink.types.js +0 -1
- package/dist/components/ValidationMessage/ValidationMessage.js +11 -8
- package/dist/components/ValidationMessage/ValidationMessage.types.js +0 -1
- package/dist/components/ValidationMessage/ValidationSummary/ValidationSummary.js +2 -69
- package/dist/components/ValidationMessage/ValidationSummary/ValidationSummary.types.js +0 -1
- package/dist/components/ValidationMessage/index.js +4 -8
- package/dist/constants-C4s0aMXs.js +161 -0
- package/dist/constants.js +2 -193
- package/dist/enums.js +42 -22
- package/dist/floating-ui.react-Dj2ev6bJ.js +3098 -0
- package/dist/fuzzysort-BZ6Yv-YR.js +377 -0
- package/dist/helpers/dom/closestCrossShadow.js +19 -24
- package/dist/helpers/dom/domUtils.js +10 -11
- package/dist/helpers/dom/focusableElements.js +7 -9
- package/dist/helpers/dom/getActiveElement.js +7 -7
- package/dist/helpers/dom/hasShadowDom.js +4 -4
- package/dist/helpers/form/getFormControlValueAsString.js +4 -4
- package/dist/helpers/form/getFormControlValueAsStringIfDefined.js +6 -7
- package/dist/helpers/form/getValueAsEvent.js +6 -6
- package/dist/helpers/form/isValidFormInputElement.js +4 -4
- package/dist/helpers/formatting/capitalizeFirstLetter.js +4 -4
- package/dist/helpers/formatting/formatCurrency.js +14 -21
- package/dist/helpers/formatting/formatDate.js +16 -22
- package/dist/helpers/formatting/formatDateTime.js +49 -54
- package/dist/helpers/formatting/formatObjectKey.js +4 -4
- package/dist/helpers/formatting/formatPercentage.js +6 -6
- package/dist/helpers/formatting/stringReplacer.js +8 -8
- package/dist/helpers/formatting/toArray.js +4 -4
- package/dist/helpers/formatting/toCSSLengthValue.js +6 -6
- package/dist/helpers/label-value/composeLabelValueDescriptor.js +9 -12
- package/dist/helpers/label-value/getQueryRangeExclusive.js +10 -13
- package/dist/helpers/label-value/getValueFromLabelValues.js +7 -7
- package/dist/helpers/label-value/highlightQueryInLabel.js +7 -6
- package/dist/helpers/label-value/highlightQueryInLabelValue.js +8 -8
- package/dist/helpers/label-value/searchLabelValues.js +12 -11
- package/dist/helpers/responsive/getResponsiveLayoutModifiers.js +8 -10
- package/dist/helpers/responsive/getResponsivePaddingClasses.js +6 -10
- package/dist/helpers/transition/getTransitionDuration.js +5 -7
- package/dist/helpers/transition/timeStringToNumber.js +4 -4
- package/dist/helpers/utility/generateScopedName.js +8 -9
- package/dist/helpers/utility/idsLogger.js +5 -9
- package/dist/helpers/utility/propagateTestid.js +4 -4
- package/dist/hooks/index.js +5 -11
- package/dist/hooks/useAriaRelationship.js +20 -35
- package/dist/hooks/useBreakpoint.js +16 -16
- package/dist/hooks/useControlledState.js +35 -53
- package/dist/hooks/useIdIfNeeded.js +7 -7
- package/dist/hooks/useResponsiveProps.js +25 -25
- package/dist/index.esm-BCkAygZA.js +169 -0
- package/dist/interfaces.js +0 -1
- package/dist/lib-CUMSFn3v.js +1415 -0
- package/dist/main-CTy1XcUn.js +4604 -0
- package/dist/main.js +88 -336
- package/dist/patterns/Loading/Loading.js +2 -8
- package/dist/patterns/Loading/LoadingSuspense.js +2 -7
- package/dist/patterns/Loading/components/ComponentLoading.js +2 -10
- package/dist/patterns/Loading/components/DefaultLoading.js +2 -9
- package/dist/patterns/Loading/components/LongLoading.js +2 -132
- package/dist/patterns/Loading/components/PageLoading.js +2 -14
- package/dist/patterns/Loading/components/StartUpLoading.js +2 -107
- package/dist/patterns/Loading/components/ValidateLoading.js +2 -9
- package/dist/patterns/Loading/hooks/useEstimatedProgressValue.js +25 -25
- package/dist/patterns/Loading/hooks/useShouldRenderLoading.js +26 -23
- package/dist/patterns/Loading/hooks/useShowIndicator.js +18 -19
- package/dist/patterns/Loading/hooks/useSuspenseResource.js +19 -26
- package/dist/patterns/Loading/index.js +2 -5
- package/dist/style.css +2 -1
- package/dist/types.js +0 -1
- package/dist/useAutocompleteSearch-CBgqGiKn.js +179 -0
- package/dist/useIDSButtonGroupItem-BkzYQzAi.js +21 -0
- package/dist/useMenuStyles-cry3mes_.js +20 -0
- package/package.json +15 -15
- package/dist/AutocompleteNoResults-B60rzwfa.js +0 -12
- package/dist/ComboboxHiddenInput-BUswpU00.js +0 -32
- package/dist/FieldAppendToLabel-BK8cAMZT.js +0 -77
- package/dist/InputBase-B6gEHXZ7.js +0 -56
- package/dist/Loading.module-BXP_0EH0.js +0 -13
- package/dist/LoadingSuspense-CuQm3zqO.js +0 -5740
- package/dist/LogoFromSrc-BvialtyP.js +0 -59
- package/dist/MenuItem.module-BFPHZtJl.js +0 -24
- package/dist/Popover.module-oIsv6lht.js +0 -11
- package/dist/PopoverProvider-BMBTLkRr.js +0 -142
- package/dist/SelectControl-Bf6qXlwP.js +0 -47
- package/dist/SlideoutProvider-CQh140HM.js +0 -200
- package/dist/SliderTicks-DRFLh0Rw.js +0 -74
- package/dist/TabSet.module-Dks7jQfN.js +0 -13
- package/dist/Table.module-BARl9Jy6.js +0 -32
- package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
- package/dist/floating-ui.react-DfIjfJIq.js +0 -3503
- package/dist/fuzzysort-BNka47rs.js +0 -395
- package/dist/index-BaVtNOfa.js +0 -1693
- package/dist/index-DLnR8XTt.js +0 -47
- package/dist/index-cbHCAGLB.js +0 -40
- package/dist/index.esm-CL8gh5wr.js +0 -192
- package/dist/useIDSButtonGroupItem-DXJpvTGd.js +0 -29
|
@@ -0,0 +1,3098 @@
|
|
|
1
|
+
import { n as e, r as t, t as n } from "./index.esm-BCkAygZA.js";
|
|
2
|
+
import * as r from "react";
|
|
3
|
+
import { useLayoutEffect as i } from "react";
|
|
4
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
|
+
import * as c from "react-dom";
|
|
6
|
+
//#region ../../node_modules/@floating-ui/react/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
|
|
7
|
+
function l() {
|
|
8
|
+
return typeof window < "u";
|
|
9
|
+
}
|
|
10
|
+
function u(e) {
|
|
11
|
+
return p(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
12
|
+
}
|
|
13
|
+
function d(e) {
|
|
14
|
+
var t;
|
|
15
|
+
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
16
|
+
}
|
|
17
|
+
function f(e) {
|
|
18
|
+
return ((p(e) ? e.ownerDocument : e.document) || window.document)?.documentElement;
|
|
19
|
+
}
|
|
20
|
+
function p(e) {
|
|
21
|
+
return l() ? e instanceof Node || e instanceof d(e).Node : !1;
|
|
22
|
+
}
|
|
23
|
+
function m(e) {
|
|
24
|
+
return l() ? e instanceof Element || e instanceof d(e).Element : !1;
|
|
25
|
+
}
|
|
26
|
+
function h(e) {
|
|
27
|
+
return l() ? e instanceof HTMLElement || e instanceof d(e).HTMLElement : !1;
|
|
28
|
+
}
|
|
29
|
+
function g(e) {
|
|
30
|
+
return !l() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof d(e).ShadowRoot;
|
|
31
|
+
}
|
|
32
|
+
function _(e) {
|
|
33
|
+
let { overflow: t, overflowX: n, overflowY: r, display: i } = O(e);
|
|
34
|
+
return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && i !== "inline" && i !== "contents";
|
|
35
|
+
}
|
|
36
|
+
function v(e) {
|
|
37
|
+
return /^(table|td|th)$/.test(u(e));
|
|
38
|
+
}
|
|
39
|
+
function y(e) {
|
|
40
|
+
try {
|
|
41
|
+
if (e.matches(":popover-open")) return !0;
|
|
42
|
+
} catch {}
|
|
43
|
+
try {
|
|
44
|
+
return e.matches(":modal");
|
|
45
|
+
} catch {
|
|
46
|
+
return !1;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
var b = /transform|translate|scale|rotate|perspective|filter/, x = /paint|layout|strict|content/, S = (e) => !!e && e !== "none", C;
|
|
50
|
+
function w(e) {
|
|
51
|
+
let t = m(e) ? O(e) : e;
|
|
52
|
+
return S(t.transform) || S(t.translate) || S(t.scale) || S(t.rotate) || S(t.perspective) || !E() && (S(t.backdropFilter) || S(t.filter)) || b.test(t.willChange || "") || x.test(t.contain || "");
|
|
53
|
+
}
|
|
54
|
+
function T(e) {
|
|
55
|
+
let t = A(e);
|
|
56
|
+
for (; h(t) && !D(t);) {
|
|
57
|
+
if (w(t)) return t;
|
|
58
|
+
if (y(t)) return null;
|
|
59
|
+
t = A(t);
|
|
60
|
+
}
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
function E() {
|
|
64
|
+
return C ??= typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"), C;
|
|
65
|
+
}
|
|
66
|
+
function D(e) {
|
|
67
|
+
return /^(html|body|#document)$/.test(u(e));
|
|
68
|
+
}
|
|
69
|
+
function O(e) {
|
|
70
|
+
return d(e).getComputedStyle(e);
|
|
71
|
+
}
|
|
72
|
+
function k(e) {
|
|
73
|
+
return m(e) ? {
|
|
74
|
+
scrollLeft: e.scrollLeft,
|
|
75
|
+
scrollTop: e.scrollTop
|
|
76
|
+
} : {
|
|
77
|
+
scrollLeft: e.scrollX,
|
|
78
|
+
scrollTop: e.scrollY
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function A(e) {
|
|
82
|
+
if (u(e) === "html") return e;
|
|
83
|
+
let t = e.assignedSlot || e.parentNode || g(e) && e.host || f(e);
|
|
84
|
+
return g(t) ? t.host : t;
|
|
85
|
+
}
|
|
86
|
+
function j(e) {
|
|
87
|
+
let t = A(e);
|
|
88
|
+
return D(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : h(t) && _(t) ? t : j(t);
|
|
89
|
+
}
|
|
90
|
+
function M(e, t, n) {
|
|
91
|
+
t === void 0 && (t = []), n === void 0 && (n = !0);
|
|
92
|
+
let r = j(e), i = r === e.ownerDocument?.body, a = d(r);
|
|
93
|
+
if (i) {
|
|
94
|
+
let e = N(a);
|
|
95
|
+
return t.concat(a, a.visualViewport || [], _(r) ? r : [], e && n ? M(e) : []);
|
|
96
|
+
} else return t.concat(r, M(r, [], n));
|
|
97
|
+
}
|
|
98
|
+
function N(e) {
|
|
99
|
+
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
100
|
+
}
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region ../../node_modules/@floating-ui/react/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
103
|
+
var P = [
|
|
104
|
+
"top",
|
|
105
|
+
"right",
|
|
106
|
+
"bottom",
|
|
107
|
+
"left"
|
|
108
|
+
], F = ["start", "end"], I = /* @__PURE__ */ P.reduce((e, t) => e.concat(t, t + "-" + F[0], t + "-" + F[1]), []), L = Math.min, R = Math.max, ee = Math.round, z = Math.floor, B = (e) => ({
|
|
109
|
+
x: e,
|
|
110
|
+
y: e
|
|
111
|
+
}), te = {
|
|
112
|
+
left: "right",
|
|
113
|
+
right: "left",
|
|
114
|
+
bottom: "top",
|
|
115
|
+
top: "bottom"
|
|
116
|
+
};
|
|
117
|
+
function ne(e, t, n) {
|
|
118
|
+
return R(e, L(t, n));
|
|
119
|
+
}
|
|
120
|
+
function V(e, t) {
|
|
121
|
+
return typeof e == "function" ? e(t) : e;
|
|
122
|
+
}
|
|
123
|
+
function H(e) {
|
|
124
|
+
return e.split("-")[0];
|
|
125
|
+
}
|
|
126
|
+
function U(e) {
|
|
127
|
+
return e.split("-")[1];
|
|
128
|
+
}
|
|
129
|
+
function W(e) {
|
|
130
|
+
return e === "x" ? "y" : "x";
|
|
131
|
+
}
|
|
132
|
+
function re(e) {
|
|
133
|
+
return e === "y" ? "height" : "width";
|
|
134
|
+
}
|
|
135
|
+
function G(e) {
|
|
136
|
+
let t = e[0];
|
|
137
|
+
return t === "t" || t === "b" ? "y" : "x";
|
|
138
|
+
}
|
|
139
|
+
function ie(e) {
|
|
140
|
+
return W(G(e));
|
|
141
|
+
}
|
|
142
|
+
function ae(e, t, n) {
|
|
143
|
+
n === void 0 && (n = !1);
|
|
144
|
+
let r = U(e), i = ie(e), a = re(i), o = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
|
|
145
|
+
return t.reference[a] > t.floating[a] && (o = me(o)), [o, me(o)];
|
|
146
|
+
}
|
|
147
|
+
function oe(e) {
|
|
148
|
+
let t = me(e);
|
|
149
|
+
return [
|
|
150
|
+
se(e),
|
|
151
|
+
t,
|
|
152
|
+
se(t)
|
|
153
|
+
];
|
|
154
|
+
}
|
|
155
|
+
function se(e) {
|
|
156
|
+
return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start");
|
|
157
|
+
}
|
|
158
|
+
var ce = ["left", "right"], le = ["right", "left"], ue = ["top", "bottom"], de = ["bottom", "top"];
|
|
159
|
+
function fe(e, t, n) {
|
|
160
|
+
switch (e) {
|
|
161
|
+
case "top":
|
|
162
|
+
case "bottom": return n ? t ? le : ce : t ? ce : le;
|
|
163
|
+
case "left":
|
|
164
|
+
case "right": return t ? ue : de;
|
|
165
|
+
default: return [];
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
function pe(e, t, n, r) {
|
|
169
|
+
let i = U(e), a = fe(H(e), n === "start", r);
|
|
170
|
+
return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(se)))), a;
|
|
171
|
+
}
|
|
172
|
+
function me(e) {
|
|
173
|
+
let t = H(e);
|
|
174
|
+
return te[t] + e.slice(t.length);
|
|
175
|
+
}
|
|
176
|
+
function he(e) {
|
|
177
|
+
return {
|
|
178
|
+
top: 0,
|
|
179
|
+
right: 0,
|
|
180
|
+
bottom: 0,
|
|
181
|
+
left: 0,
|
|
182
|
+
...e
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
function ge(e) {
|
|
186
|
+
return typeof e == "number" ? {
|
|
187
|
+
top: e,
|
|
188
|
+
right: e,
|
|
189
|
+
bottom: e,
|
|
190
|
+
left: e
|
|
191
|
+
} : he(e);
|
|
192
|
+
}
|
|
193
|
+
function _e(e) {
|
|
194
|
+
let { x: t, y: n, width: r, height: i } = e;
|
|
195
|
+
return {
|
|
196
|
+
width: r,
|
|
197
|
+
height: i,
|
|
198
|
+
top: n,
|
|
199
|
+
left: t,
|
|
200
|
+
right: t + r,
|
|
201
|
+
bottom: n + i,
|
|
202
|
+
x: t,
|
|
203
|
+
y: n
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
//#endregion
|
|
207
|
+
//#region ../../node_modules/@floating-ui/react/dist/floating-ui.react.utils.mjs
|
|
208
|
+
function ve() {
|
|
209
|
+
let e = navigator.userAgentData;
|
|
210
|
+
return e != null && e.platform ? e.platform : navigator.platform;
|
|
211
|
+
}
|
|
212
|
+
function ye() {
|
|
213
|
+
let e = navigator.userAgentData;
|
|
214
|
+
return e && Array.isArray(e.brands) ? e.brands.map((e) => {
|
|
215
|
+
let { brand: t, version: n } = e;
|
|
216
|
+
return t + "/" + n;
|
|
217
|
+
}).join(" ") : navigator.userAgent;
|
|
218
|
+
}
|
|
219
|
+
function be() {
|
|
220
|
+
return /apple/i.test(navigator.vendor);
|
|
221
|
+
}
|
|
222
|
+
function xe() {
|
|
223
|
+
let e = /android/i;
|
|
224
|
+
return e.test(ve()) || e.test(ye());
|
|
225
|
+
}
|
|
226
|
+
function Se() {
|
|
227
|
+
return ve().toLowerCase().startsWith("mac") && !navigator.maxTouchPoints;
|
|
228
|
+
}
|
|
229
|
+
function Ce() {
|
|
230
|
+
return ye().includes("jsdom/");
|
|
231
|
+
}
|
|
232
|
+
var we = "data-floating-ui-focusable", Te = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])", Ee = "ArrowLeft", De = "ArrowRight", Oe = "ArrowUp", ke = "ArrowDown";
|
|
233
|
+
function Ae(e) {
|
|
234
|
+
let t = e.activeElement;
|
|
235
|
+
for (; ((n = t) == null || (n = n.shadowRoot) == null ? void 0 : n.activeElement) != null;) {
|
|
236
|
+
var n;
|
|
237
|
+
t = t.shadowRoot.activeElement;
|
|
238
|
+
}
|
|
239
|
+
return t;
|
|
240
|
+
}
|
|
241
|
+
function K(e, t) {
|
|
242
|
+
if (!e || !t) return !1;
|
|
243
|
+
let n = t.getRootNode == null ? void 0 : t.getRootNode();
|
|
244
|
+
if (e.contains(t)) return !0;
|
|
245
|
+
if (n && g(n)) {
|
|
246
|
+
let n = t;
|
|
247
|
+
for (; n;) {
|
|
248
|
+
if (e === n) return !0;
|
|
249
|
+
n = n.parentNode || n.host;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
return !1;
|
|
253
|
+
}
|
|
254
|
+
function je(e) {
|
|
255
|
+
return "composedPath" in e ? e.composedPath()[0] : e.target;
|
|
256
|
+
}
|
|
257
|
+
function Me(e, t) {
|
|
258
|
+
if (t == null) return !1;
|
|
259
|
+
if ("composedPath" in e) return e.composedPath().includes(t);
|
|
260
|
+
let n = e;
|
|
261
|
+
return n.target != null && t.contains(n.target);
|
|
262
|
+
}
|
|
263
|
+
function Ne(e) {
|
|
264
|
+
return e.matches("html,body");
|
|
265
|
+
}
|
|
266
|
+
function q(e) {
|
|
267
|
+
return e?.ownerDocument || document;
|
|
268
|
+
}
|
|
269
|
+
function Pe(e) {
|
|
270
|
+
return h(e) && e.matches(Te);
|
|
271
|
+
}
|
|
272
|
+
function Fe(e) {
|
|
273
|
+
return e ? e.getAttribute("role") === "combobox" && Pe(e) : !1;
|
|
274
|
+
}
|
|
275
|
+
function Ie(e) {
|
|
276
|
+
if (!e || Ce()) return !0;
|
|
277
|
+
try {
|
|
278
|
+
return e.matches(":focus-visible");
|
|
279
|
+
} catch {
|
|
280
|
+
return !0;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
function Le(e) {
|
|
284
|
+
return e ? e.hasAttribute(we) ? e : e.querySelector("[" + we + "]") || e : null;
|
|
285
|
+
}
|
|
286
|
+
function Re(e, t, n) {
|
|
287
|
+
return n === void 0 && (n = !0), e.filter((e) => e.parentId === t && (!n || e.context?.open)).flatMap((t) => [t, ...Re(e, t.id, n)]);
|
|
288
|
+
}
|
|
289
|
+
function ze(e, t) {
|
|
290
|
+
let n, r = -1;
|
|
291
|
+
function i(t, a) {
|
|
292
|
+
a > r && (n = t, r = a), Re(e, t).forEach((e) => {
|
|
293
|
+
i(e.id, a + 1);
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
return i(t, 0), e.find((e) => e.id === n);
|
|
297
|
+
}
|
|
298
|
+
function Be(e, t) {
|
|
299
|
+
let n = [], r = e.find((e) => e.id === t)?.parentId;
|
|
300
|
+
for (; r;) {
|
|
301
|
+
let t = e.find((e) => e.id === r);
|
|
302
|
+
r = t?.parentId, t && (n = n.concat(t));
|
|
303
|
+
}
|
|
304
|
+
return n;
|
|
305
|
+
}
|
|
306
|
+
function J(e) {
|
|
307
|
+
e.preventDefault(), e.stopPropagation();
|
|
308
|
+
}
|
|
309
|
+
function Ve(e) {
|
|
310
|
+
return "nativeEvent" in e;
|
|
311
|
+
}
|
|
312
|
+
function He(e) {
|
|
313
|
+
return e.mozInputSource === 0 && e.isTrusted ? !0 : xe() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
|
|
314
|
+
}
|
|
315
|
+
function Ue(e) {
|
|
316
|
+
return Ce() ? !1 : !xe() && e.width === 0 && e.height === 0 || xe() && e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse" || e.width < 1 && e.height < 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "touch";
|
|
317
|
+
}
|
|
318
|
+
function We(e, t) {
|
|
319
|
+
let n = ["mouse", "pen"];
|
|
320
|
+
return t || n.push("", void 0), n.includes(e);
|
|
321
|
+
}
|
|
322
|
+
var Y = typeof document < "u" ? i : function() {}, Ge = { ...r };
|
|
323
|
+
function X(e) {
|
|
324
|
+
let t = r.useRef(e);
|
|
325
|
+
return Y(() => {
|
|
326
|
+
t.current = e;
|
|
327
|
+
}), t;
|
|
328
|
+
}
|
|
329
|
+
var Ke = Ge.useInsertionEffect || ((e) => e());
|
|
330
|
+
function Z(e) {
|
|
331
|
+
let t = r.useRef(() => {
|
|
332
|
+
if (process.env.NODE_ENV !== "production") throw Error("Cannot call an event handler while rendering.");
|
|
333
|
+
});
|
|
334
|
+
return Ke(() => {
|
|
335
|
+
t.current = e;
|
|
336
|
+
}), r.useCallback(function() {
|
|
337
|
+
var e = [...arguments];
|
|
338
|
+
return t.current == null ? void 0 : t.current(...e);
|
|
339
|
+
}, []);
|
|
340
|
+
}
|
|
341
|
+
function qe(e, t, n) {
|
|
342
|
+
return Math.floor(e / t) !== n;
|
|
343
|
+
}
|
|
344
|
+
function Je(e, t) {
|
|
345
|
+
return t < 0 || t >= e.current.length;
|
|
346
|
+
}
|
|
347
|
+
function Ye(e, t) {
|
|
348
|
+
return Q(e, { disabledIndices: t });
|
|
349
|
+
}
|
|
350
|
+
function Xe(e, t) {
|
|
351
|
+
return Q(e, {
|
|
352
|
+
decrement: !0,
|
|
353
|
+
startingIndex: e.current.length,
|
|
354
|
+
disabledIndices: t
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
function Q(e, t) {
|
|
358
|
+
let { startingIndex: n = -1, decrement: r = !1, disabledIndices: i, amount: a = 1 } = t === void 0 ? {} : t, o = n;
|
|
359
|
+
do
|
|
360
|
+
o += r ? -a : a;
|
|
361
|
+
while (o >= 0 && o <= e.current.length - 1 && tt(e, o, i));
|
|
362
|
+
return o;
|
|
363
|
+
}
|
|
364
|
+
function Ze(e, t) {
|
|
365
|
+
let { event: n, orientation: r, loop: i, rtl: a, cols: o, disabledIndices: s, minIndex: c, maxIndex: l, prevIndex: u, stopEvent: d = !1 } = t, f = u;
|
|
366
|
+
if (n.key === Oe) {
|
|
367
|
+
if (d && J(n), u === -1) f = l;
|
|
368
|
+
else if (f = Q(e, {
|
|
369
|
+
startingIndex: f,
|
|
370
|
+
amount: o,
|
|
371
|
+
decrement: !0,
|
|
372
|
+
disabledIndices: s
|
|
373
|
+
}), i && (u - o < c || f < 0)) {
|
|
374
|
+
let e = u % o, t = l % o, n = l - (t - e);
|
|
375
|
+
f = t === e ? l : t > e ? n : n - o;
|
|
376
|
+
}
|
|
377
|
+
Je(e, f) && (f = u);
|
|
378
|
+
}
|
|
379
|
+
if (n.key === ke && (d && J(n), u === -1 ? f = c : (f = Q(e, {
|
|
380
|
+
startingIndex: u,
|
|
381
|
+
amount: o,
|
|
382
|
+
disabledIndices: s
|
|
383
|
+
}), i && u + o > l && (f = Q(e, {
|
|
384
|
+
startingIndex: u % o - o,
|
|
385
|
+
amount: o,
|
|
386
|
+
disabledIndices: s
|
|
387
|
+
}))), Je(e, f) && (f = u)), r === "both") {
|
|
388
|
+
let t = z(u / o);
|
|
389
|
+
n.key === (a ? Ee : De) && (d && J(n), u % o === o - 1 ? i && (f = Q(e, {
|
|
390
|
+
startingIndex: u - u % o - 1,
|
|
391
|
+
disabledIndices: s
|
|
392
|
+
})) : (f = Q(e, {
|
|
393
|
+
startingIndex: u,
|
|
394
|
+
disabledIndices: s
|
|
395
|
+
}), i && qe(f, o, t) && (f = Q(e, {
|
|
396
|
+
startingIndex: u - u % o - 1,
|
|
397
|
+
disabledIndices: s
|
|
398
|
+
}))), qe(f, o, t) && (f = u)), n.key === (a ? De : Ee) && (d && J(n), u % o === 0 ? i && (f = Q(e, {
|
|
399
|
+
startingIndex: u + (o - u % o),
|
|
400
|
+
decrement: !0,
|
|
401
|
+
disabledIndices: s
|
|
402
|
+
})) : (f = Q(e, {
|
|
403
|
+
startingIndex: u,
|
|
404
|
+
decrement: !0,
|
|
405
|
+
disabledIndices: s
|
|
406
|
+
}), i && qe(f, o, t) && (f = Q(e, {
|
|
407
|
+
startingIndex: u + (o - u % o),
|
|
408
|
+
decrement: !0,
|
|
409
|
+
disabledIndices: s
|
|
410
|
+
}))), qe(f, o, t) && (f = u));
|
|
411
|
+
let r = z(l / o) === t;
|
|
412
|
+
Je(e, f) && (f = i && r ? n.key === (a ? De : Ee) ? l : Q(e, {
|
|
413
|
+
startingIndex: u - u % o - 1,
|
|
414
|
+
disabledIndices: s
|
|
415
|
+
}) : u);
|
|
416
|
+
}
|
|
417
|
+
return f;
|
|
418
|
+
}
|
|
419
|
+
function Qe(e, t, n) {
|
|
420
|
+
let r = [], i = 0;
|
|
421
|
+
return e.forEach((e, a) => {
|
|
422
|
+
let { width: o, height: s } = e;
|
|
423
|
+
if (o > t && process.env.NODE_ENV !== "production") throw Error("[Floating UI]: Invalid grid - item width at index " + a + " is greater than grid columns");
|
|
424
|
+
let c = !1;
|
|
425
|
+
for (n && (i = 0); !c;) {
|
|
426
|
+
let e = [];
|
|
427
|
+
for (let n = 0; n < o; n++) for (let r = 0; r < s; r++) e.push(i + n + r * t);
|
|
428
|
+
i % t + o <= t && e.every((e) => r[e] == null) ? (e.forEach((e) => {
|
|
429
|
+
r[e] = a;
|
|
430
|
+
}), c = !0) : i++;
|
|
431
|
+
}
|
|
432
|
+
}), [...r];
|
|
433
|
+
}
|
|
434
|
+
function $e(e, t, n, r, i) {
|
|
435
|
+
if (e === -1) return -1;
|
|
436
|
+
let a = n.indexOf(e), o = t[e];
|
|
437
|
+
switch (i) {
|
|
438
|
+
case "tl": return a;
|
|
439
|
+
case "tr": return o ? a + o.width - 1 : a;
|
|
440
|
+
case "bl": return o ? a + (o.height - 1) * r : a;
|
|
441
|
+
case "br": return n.lastIndexOf(e);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
function et(e, t) {
|
|
445
|
+
return t.flatMap((t, n) => e.includes(t) ? [n] : []);
|
|
446
|
+
}
|
|
447
|
+
function tt(e, t, n) {
|
|
448
|
+
if (typeof n == "function") return n(t);
|
|
449
|
+
if (n) return n.includes(t);
|
|
450
|
+
let r = e.current[t];
|
|
451
|
+
return r == null || r.hasAttribute("disabled") || r.getAttribute("aria-disabled") === "true";
|
|
452
|
+
}
|
|
453
|
+
var nt = () => ({
|
|
454
|
+
getShadowRoot: !0,
|
|
455
|
+
displayCheck: typeof ResizeObserver == "function" && ResizeObserver.toString().includes("[native code]") ? "full" : "none"
|
|
456
|
+
});
|
|
457
|
+
function rt(e, n) {
|
|
458
|
+
let r = t(e, nt()), i = r.length;
|
|
459
|
+
if (i === 0) return;
|
|
460
|
+
let a = Ae(q(e)), o = r.indexOf(a);
|
|
461
|
+
return r[o === -1 ? n === 1 ? 0 : i - 1 : o + n];
|
|
462
|
+
}
|
|
463
|
+
function it(e) {
|
|
464
|
+
return rt(q(e).body, 1) || e;
|
|
465
|
+
}
|
|
466
|
+
function at(e) {
|
|
467
|
+
return rt(q(e).body, -1) || e;
|
|
468
|
+
}
|
|
469
|
+
function ot(e, t) {
|
|
470
|
+
let n = t || e.currentTarget, r = e.relatedTarget;
|
|
471
|
+
return !r || !K(n, r);
|
|
472
|
+
}
|
|
473
|
+
function st(e) {
|
|
474
|
+
t(e, nt()).forEach((e) => {
|
|
475
|
+
e.dataset.tabindex = e.getAttribute("tabindex") || "", e.setAttribute("tabindex", "-1");
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
function ct(e) {
|
|
479
|
+
e.querySelectorAll("[data-tabindex]").forEach((e) => {
|
|
480
|
+
let t = e.dataset.tabindex;
|
|
481
|
+
delete e.dataset.tabindex, t ? e.setAttribute("tabindex", t) : e.removeAttribute("tabindex");
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
//#endregion
|
|
485
|
+
//#region ../../node_modules/@floating-ui/react/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
|
|
486
|
+
function lt(e, t, n) {
|
|
487
|
+
let { reference: r, floating: i } = e, a = G(t), o = ie(t), s = re(o), c = H(t), l = a === "y", u = r.x + r.width / 2 - i.width / 2, d = r.y + r.height / 2 - i.height / 2, f = r[s] / 2 - i[s] / 2, p;
|
|
488
|
+
switch (c) {
|
|
489
|
+
case "top":
|
|
490
|
+
p = {
|
|
491
|
+
x: u,
|
|
492
|
+
y: r.y - i.height
|
|
493
|
+
};
|
|
494
|
+
break;
|
|
495
|
+
case "bottom":
|
|
496
|
+
p = {
|
|
497
|
+
x: u,
|
|
498
|
+
y: r.y + r.height
|
|
499
|
+
};
|
|
500
|
+
break;
|
|
501
|
+
case "right":
|
|
502
|
+
p = {
|
|
503
|
+
x: r.x + r.width,
|
|
504
|
+
y: d
|
|
505
|
+
};
|
|
506
|
+
break;
|
|
507
|
+
case "left":
|
|
508
|
+
p = {
|
|
509
|
+
x: r.x - i.width,
|
|
510
|
+
y: d
|
|
511
|
+
};
|
|
512
|
+
break;
|
|
513
|
+
default: p = {
|
|
514
|
+
x: r.x,
|
|
515
|
+
y: r.y
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
switch (U(t)) {
|
|
519
|
+
case "start":
|
|
520
|
+
p[o] -= f * (n && l ? -1 : 1);
|
|
521
|
+
break;
|
|
522
|
+
case "end":
|
|
523
|
+
p[o] += f * (n && l ? -1 : 1);
|
|
524
|
+
break;
|
|
525
|
+
}
|
|
526
|
+
return p;
|
|
527
|
+
}
|
|
528
|
+
async function ut(e, t) {
|
|
529
|
+
t === void 0 && (t = {});
|
|
530
|
+
let { x: n, y: r, platform: i, rects: a, elements: o, strategy: s } = e, { boundary: c = "clippingAncestors", rootBoundary: l = "viewport", elementContext: u = "floating", altBoundary: d = !1, padding: f = 0 } = V(t, e), p = ge(f), m = o[d ? u === "floating" ? "reference" : "floating" : u], h = _e(await i.getClippingRect({
|
|
531
|
+
element: await (i.isElement == null ? void 0 : i.isElement(m)) ?? !0 ? m : m.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(o.floating)),
|
|
532
|
+
boundary: c,
|
|
533
|
+
rootBoundary: l,
|
|
534
|
+
strategy: s
|
|
535
|
+
})), g = u === "floating" ? {
|
|
536
|
+
x: n,
|
|
537
|
+
y: r,
|
|
538
|
+
width: a.floating.width,
|
|
539
|
+
height: a.floating.height
|
|
540
|
+
} : a.reference, _ = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(o.floating)), v = await (i.isElement == null ? void 0 : i.isElement(_)) && await (i.getScale == null ? void 0 : i.getScale(_)) || {
|
|
541
|
+
x: 1,
|
|
542
|
+
y: 1
|
|
543
|
+
}, y = _e(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
544
|
+
elements: o,
|
|
545
|
+
rect: g,
|
|
546
|
+
offsetParent: _,
|
|
547
|
+
strategy: s
|
|
548
|
+
}) : g);
|
|
549
|
+
return {
|
|
550
|
+
top: (h.top - y.top + p.top) / v.y,
|
|
551
|
+
bottom: (y.bottom - h.bottom + p.bottom) / v.y,
|
|
552
|
+
left: (h.left - y.left + p.left) / v.x,
|
|
553
|
+
right: (y.right - h.right + p.right) / v.x
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
var dt = 50, ft = async (e, t, n) => {
|
|
557
|
+
let { placement: r = "bottom", strategy: i = "absolute", middleware: a = [], platform: o } = n, s = o.detectOverflow ? o : {
|
|
558
|
+
...o,
|
|
559
|
+
detectOverflow: ut
|
|
560
|
+
}, c = await (o.isRTL == null ? void 0 : o.isRTL(t)), l = await o.getElementRects({
|
|
561
|
+
reference: e,
|
|
562
|
+
floating: t,
|
|
563
|
+
strategy: i
|
|
564
|
+
}), { x: u, y: d } = lt(l, r, c), f = r, p = 0, m = {};
|
|
565
|
+
for (let n = 0; n < a.length; n++) {
|
|
566
|
+
let h = a[n];
|
|
567
|
+
if (!h) continue;
|
|
568
|
+
let { name: g, fn: _ } = h, { x: v, y, data: b, reset: x } = await _({
|
|
569
|
+
x: u,
|
|
570
|
+
y: d,
|
|
571
|
+
initialPlacement: r,
|
|
572
|
+
placement: f,
|
|
573
|
+
strategy: i,
|
|
574
|
+
middlewareData: m,
|
|
575
|
+
rects: l,
|
|
576
|
+
platform: s,
|
|
577
|
+
elements: {
|
|
578
|
+
reference: e,
|
|
579
|
+
floating: t
|
|
580
|
+
}
|
|
581
|
+
});
|
|
582
|
+
u = v ?? u, d = y ?? d, m[g] = {
|
|
583
|
+
...m[g],
|
|
584
|
+
...b
|
|
585
|
+
}, x && p < dt && (p++, typeof x == "object" && (x.placement && (f = x.placement), x.rects && (l = x.rects === !0 ? await o.getElementRects({
|
|
586
|
+
reference: e,
|
|
587
|
+
floating: t,
|
|
588
|
+
strategy: i
|
|
589
|
+
}) : x.rects), {x: u, y: d} = lt(l, f, c)), n = -1);
|
|
590
|
+
}
|
|
591
|
+
return {
|
|
592
|
+
x: u,
|
|
593
|
+
y: d,
|
|
594
|
+
placement: f,
|
|
595
|
+
strategy: i,
|
|
596
|
+
middlewareData: m
|
|
597
|
+
};
|
|
598
|
+
};
|
|
599
|
+
function pt(e, t, n) {
|
|
600
|
+
return (e ? [...n.filter((t) => U(t) === e), ...n.filter((t) => U(t) !== e)] : n.filter((e) => H(e) === e)).filter((n) => e ? U(n) === e || (t ? se(n) !== n : !1) : !0);
|
|
601
|
+
}
|
|
602
|
+
var mt = function(e) {
|
|
603
|
+
return e === void 0 && (e = {}), {
|
|
604
|
+
name: "autoPlacement",
|
|
605
|
+
options: e,
|
|
606
|
+
async fn(t) {
|
|
607
|
+
let { rects: n, middlewareData: r, placement: i, platform: a, elements: o } = t, { crossAxis: s = !1, alignment: c, allowedPlacements: l = I, autoAlignment: u = !0, ...d } = V(e, t), f = c !== void 0 || l === I ? pt(c || null, u, l) : l, p = await a.detectOverflow(t, d), m = r.autoPlacement?.index || 0, h = f[m];
|
|
608
|
+
if (h == null) return {};
|
|
609
|
+
let g = ae(h, n, await (a.isRTL == null ? void 0 : a.isRTL(o.floating)));
|
|
610
|
+
if (i !== h) return { reset: { placement: f[0] } };
|
|
611
|
+
let _ = [
|
|
612
|
+
p[H(h)],
|
|
613
|
+
p[g[0]],
|
|
614
|
+
p[g[1]]
|
|
615
|
+
], v = [...r.autoPlacement?.overflows || [], {
|
|
616
|
+
placement: h,
|
|
617
|
+
overflows: _
|
|
618
|
+
}], y = f[m + 1];
|
|
619
|
+
if (y) return {
|
|
620
|
+
data: {
|
|
621
|
+
index: m + 1,
|
|
622
|
+
overflows: v
|
|
623
|
+
},
|
|
624
|
+
reset: { placement: y }
|
|
625
|
+
};
|
|
626
|
+
let b = v.map((e) => {
|
|
627
|
+
let t = U(e.placement);
|
|
628
|
+
return [
|
|
629
|
+
e.placement,
|
|
630
|
+
t && s ? e.overflows.slice(0, 2).reduce((e, t) => e + t, 0) : e.overflows[0],
|
|
631
|
+
e.overflows
|
|
632
|
+
];
|
|
633
|
+
}).sort((e, t) => e[1] - t[1]), x = b.filter((e) => e[2].slice(0, U(e[0]) ? 2 : 3).every((e) => e <= 0))[0]?.[0] || b[0][0];
|
|
634
|
+
return x === i ? {} : {
|
|
635
|
+
data: {
|
|
636
|
+
index: m + 1,
|
|
637
|
+
overflows: v
|
|
638
|
+
},
|
|
639
|
+
reset: { placement: x }
|
|
640
|
+
};
|
|
641
|
+
}
|
|
642
|
+
};
|
|
643
|
+
}, ht = function(e) {
|
|
644
|
+
return e === void 0 && (e = {}), {
|
|
645
|
+
name: "flip",
|
|
646
|
+
options: e,
|
|
647
|
+
async fn(t) {
|
|
648
|
+
var n;
|
|
649
|
+
let { placement: r, middlewareData: i, rects: a, initialPlacement: o, platform: s, elements: c } = t, { mainAxis: l = !0, crossAxis: u = !0, fallbackPlacements: d, fallbackStrategy: f = "bestFit", fallbackAxisSideDirection: p = "none", flipAlignment: m = !0, ...h } = V(e, t);
|
|
650
|
+
if ((n = i.arrow) != null && n.alignmentOffset) return {};
|
|
651
|
+
let g = H(r), _ = G(o), v = H(o) === o, y = await (s.isRTL == null ? void 0 : s.isRTL(c.floating)), b = d || (v || !m ? [me(o)] : oe(o)), x = p !== "none";
|
|
652
|
+
!d && x && b.push(...pe(o, m, p, y));
|
|
653
|
+
let S = [o, ...b], C = await s.detectOverflow(t, h), w = [], T = i.flip?.overflows || [];
|
|
654
|
+
if (l && w.push(C[g]), u) {
|
|
655
|
+
let e = ae(r, a, y);
|
|
656
|
+
w.push(C[e[0]], C[e[1]]);
|
|
657
|
+
}
|
|
658
|
+
if (T = [...T, {
|
|
659
|
+
placement: r,
|
|
660
|
+
overflows: w
|
|
661
|
+
}], !w.every((e) => e <= 0)) {
|
|
662
|
+
let e = (i.flip?.index || 0) + 1, t = S[e];
|
|
663
|
+
if (t && (!(u === "alignment" && _ !== G(t)) || T.every((e) => G(e.placement) === _ ? e.overflows[0] > 0 : !0))) return {
|
|
664
|
+
data: {
|
|
665
|
+
index: e,
|
|
666
|
+
overflows: T
|
|
667
|
+
},
|
|
668
|
+
reset: { placement: t }
|
|
669
|
+
};
|
|
670
|
+
let n = T.filter((e) => e.overflows[0] <= 0).sort((e, t) => e.overflows[1] - t.overflows[1])[0]?.placement;
|
|
671
|
+
if (!n) switch (f) {
|
|
672
|
+
case "bestFit": {
|
|
673
|
+
let e = T.filter((e) => {
|
|
674
|
+
if (x) {
|
|
675
|
+
let t = G(e.placement);
|
|
676
|
+
return t === _ || t === "y";
|
|
677
|
+
}
|
|
678
|
+
return !0;
|
|
679
|
+
}).map((e) => [e.placement, e.overflows.filter((e) => e > 0).reduce((e, t) => e + t, 0)]).sort((e, t) => e[1] - t[1])[0]?.[0];
|
|
680
|
+
e && (n = e);
|
|
681
|
+
break;
|
|
682
|
+
}
|
|
683
|
+
case "initialPlacement":
|
|
684
|
+
n = o;
|
|
685
|
+
break;
|
|
686
|
+
}
|
|
687
|
+
if (r !== n) return { reset: { placement: n } };
|
|
688
|
+
}
|
|
689
|
+
return {};
|
|
690
|
+
}
|
|
691
|
+
};
|
|
692
|
+
}, gt = /* @__PURE__ */ new Set(["left", "top"]);
|
|
693
|
+
async function _t(e, t) {
|
|
694
|
+
let { placement: n, platform: r, elements: i } = e, a = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), o = H(n), s = U(n), c = G(n) === "y", l = gt.has(o) ? -1 : 1, u = a && c ? -1 : 1, d = V(t, e), { mainAxis: f, crossAxis: p, alignmentAxis: m } = typeof d == "number" ? {
|
|
695
|
+
mainAxis: d,
|
|
696
|
+
crossAxis: 0,
|
|
697
|
+
alignmentAxis: null
|
|
698
|
+
} : {
|
|
699
|
+
mainAxis: d.mainAxis || 0,
|
|
700
|
+
crossAxis: d.crossAxis || 0,
|
|
701
|
+
alignmentAxis: d.alignmentAxis
|
|
702
|
+
};
|
|
703
|
+
return s && typeof m == "number" && (p = s === "end" ? m * -1 : m), c ? {
|
|
704
|
+
x: p * u,
|
|
705
|
+
y: f * l
|
|
706
|
+
} : {
|
|
707
|
+
x: f * l,
|
|
708
|
+
y: p * u
|
|
709
|
+
};
|
|
710
|
+
}
|
|
711
|
+
var vt = function(e) {
|
|
712
|
+
return e === void 0 && (e = 0), {
|
|
713
|
+
name: "offset",
|
|
714
|
+
options: e,
|
|
715
|
+
async fn(t) {
|
|
716
|
+
var n;
|
|
717
|
+
let { x: r, y: i, placement: a, middlewareData: o } = t, s = await _t(t, e);
|
|
718
|
+
return a === o.offset?.placement && (n = o.arrow) != null && n.alignmentOffset ? {} : {
|
|
719
|
+
x: r + s.x,
|
|
720
|
+
y: i + s.y,
|
|
721
|
+
data: {
|
|
722
|
+
...s,
|
|
723
|
+
placement: a
|
|
724
|
+
}
|
|
725
|
+
};
|
|
726
|
+
}
|
|
727
|
+
};
|
|
728
|
+
}, yt = function(e) {
|
|
729
|
+
return e === void 0 && (e = {}), {
|
|
730
|
+
name: "shift",
|
|
731
|
+
options: e,
|
|
732
|
+
async fn(t) {
|
|
733
|
+
let { x: n, y: r, placement: i, platform: a } = t, { mainAxis: o = !0, crossAxis: s = !1, limiter: c = { fn: (e) => {
|
|
734
|
+
let { x: t, y: n } = e;
|
|
735
|
+
return {
|
|
736
|
+
x: t,
|
|
737
|
+
y: n
|
|
738
|
+
};
|
|
739
|
+
} }, ...l } = V(e, t), u = {
|
|
740
|
+
x: n,
|
|
741
|
+
y: r
|
|
742
|
+
}, d = await a.detectOverflow(t, l), f = G(H(i)), p = W(f), m = u[p], h = u[f];
|
|
743
|
+
if (o) {
|
|
744
|
+
let e = p === "y" ? "top" : "left", t = p === "y" ? "bottom" : "right", n = m + d[e], r = m - d[t];
|
|
745
|
+
m = ne(n, m, r);
|
|
746
|
+
}
|
|
747
|
+
if (s) {
|
|
748
|
+
let e = f === "y" ? "top" : "left", t = f === "y" ? "bottom" : "right", n = h + d[e], r = h - d[t];
|
|
749
|
+
h = ne(n, h, r);
|
|
750
|
+
}
|
|
751
|
+
let g = c.fn({
|
|
752
|
+
...t,
|
|
753
|
+
[p]: m,
|
|
754
|
+
[f]: h
|
|
755
|
+
});
|
|
756
|
+
return {
|
|
757
|
+
...g,
|
|
758
|
+
data: {
|
|
759
|
+
x: g.x - n,
|
|
760
|
+
y: g.y - r,
|
|
761
|
+
enabled: {
|
|
762
|
+
[p]: o,
|
|
763
|
+
[f]: s
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
};
|
|
767
|
+
}
|
|
768
|
+
};
|
|
769
|
+
}, bt = function(e) {
|
|
770
|
+
return e === void 0 && (e = {}), {
|
|
771
|
+
name: "size",
|
|
772
|
+
options: e,
|
|
773
|
+
async fn(t) {
|
|
774
|
+
var n, r;
|
|
775
|
+
let { placement: i, rects: a, platform: o, elements: s } = t, { apply: c = () => {}, ...l } = V(e, t), u = await o.detectOverflow(t, l), d = H(i), f = U(i), p = G(i) === "y", { width: m, height: h } = a.floating, g, _;
|
|
776
|
+
d === "top" || d === "bottom" ? (g = d, _ = f === (await (o.isRTL == null ? void 0 : o.isRTL(s.floating)) ? "start" : "end") ? "left" : "right") : (_ = d, g = f === "end" ? "top" : "bottom");
|
|
777
|
+
let v = h - u.top - u.bottom, y = m - u.left - u.right, b = L(h - u[g], v), x = L(m - u[_], y), S = !t.middlewareData.shift, C = b, w = x;
|
|
778
|
+
if ((n = t.middlewareData.shift) != null && n.enabled.x && (w = y), (r = t.middlewareData.shift) != null && r.enabled.y && (C = v), S && !f) {
|
|
779
|
+
let e = R(u.left, 0), t = R(u.right, 0), n = R(u.top, 0), r = R(u.bottom, 0);
|
|
780
|
+
p ? w = m - 2 * (e !== 0 || t !== 0 ? e + t : R(u.left, u.right)) : C = h - 2 * (n !== 0 || r !== 0 ? n + r : R(u.top, u.bottom));
|
|
781
|
+
}
|
|
782
|
+
await c({
|
|
783
|
+
...t,
|
|
784
|
+
availableWidth: w,
|
|
785
|
+
availableHeight: C
|
|
786
|
+
});
|
|
787
|
+
let T = await o.getDimensions(s.floating);
|
|
788
|
+
return m !== T.width || h !== T.height ? { reset: { rects: !0 } } : {};
|
|
789
|
+
}
|
|
790
|
+
};
|
|
791
|
+
};
|
|
792
|
+
//#endregion
|
|
793
|
+
//#region ../../node_modules/@floating-ui/react/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
|
|
794
|
+
function xt(e) {
|
|
795
|
+
let t = O(e), n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0, i = h(e), a = i ? e.offsetWidth : n, o = i ? e.offsetHeight : r, s = ee(n) !== a || ee(r) !== o;
|
|
796
|
+
return s && (n = a, r = o), {
|
|
797
|
+
width: n,
|
|
798
|
+
height: r,
|
|
799
|
+
$: s
|
|
800
|
+
};
|
|
801
|
+
}
|
|
802
|
+
function St(e) {
|
|
803
|
+
return m(e) ? e : e.contextElement;
|
|
804
|
+
}
|
|
805
|
+
function Ct(e) {
|
|
806
|
+
let t = St(e);
|
|
807
|
+
if (!h(t)) return B(1);
|
|
808
|
+
let n = t.getBoundingClientRect(), { width: r, height: i, $: a } = xt(t), o = (a ? ee(n.width) : n.width) / r, s = (a ? ee(n.height) : n.height) / i;
|
|
809
|
+
return (!o || !Number.isFinite(o)) && (o = 1), (!s || !Number.isFinite(s)) && (s = 1), {
|
|
810
|
+
x: o,
|
|
811
|
+
y: s
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
var wt = /* @__PURE__ */ B(0);
|
|
815
|
+
function Tt(e) {
|
|
816
|
+
let t = d(e);
|
|
817
|
+
return !E() || !t.visualViewport ? wt : {
|
|
818
|
+
x: t.visualViewport.offsetLeft,
|
|
819
|
+
y: t.visualViewport.offsetTop
|
|
820
|
+
};
|
|
821
|
+
}
|
|
822
|
+
function Et(e, t, n) {
|
|
823
|
+
return t === void 0 && (t = !1), !n || t && n !== d(e) ? !1 : t;
|
|
824
|
+
}
|
|
825
|
+
function Dt(e, t, n, r) {
|
|
826
|
+
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
827
|
+
let i = e.getBoundingClientRect(), a = St(e), o = B(1);
|
|
828
|
+
t && (r ? m(r) && (o = Ct(r)) : o = Ct(e));
|
|
829
|
+
let s = Et(a, n, r) ? Tt(a) : B(0), c = (i.left + s.x) / o.x, l = (i.top + s.y) / o.y, u = i.width / o.x, f = i.height / o.y;
|
|
830
|
+
if (a) {
|
|
831
|
+
let e = d(a), t = r && m(r) ? d(r) : r, n = e, i = N(n);
|
|
832
|
+
for (; i && r && t !== n;) {
|
|
833
|
+
let e = Ct(i), t = i.getBoundingClientRect(), r = O(i), a = t.left + (i.clientLeft + parseFloat(r.paddingLeft)) * e.x, o = t.top + (i.clientTop + parseFloat(r.paddingTop)) * e.y;
|
|
834
|
+
c *= e.x, l *= e.y, u *= e.x, f *= e.y, c += a, l += o, n = d(i), i = N(n);
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
return _e({
|
|
838
|
+
width: u,
|
|
839
|
+
height: f,
|
|
840
|
+
x: c,
|
|
841
|
+
y: l
|
|
842
|
+
});
|
|
843
|
+
}
|
|
844
|
+
function Ot(e, t) {
|
|
845
|
+
let n = k(e).scrollLeft;
|
|
846
|
+
return t ? t.left + n : Dt(f(e)).left + n;
|
|
847
|
+
}
|
|
848
|
+
function kt(e, t) {
|
|
849
|
+
let n = e.getBoundingClientRect();
|
|
850
|
+
return {
|
|
851
|
+
x: n.left + t.scrollLeft - Ot(e, n),
|
|
852
|
+
y: n.top + t.scrollTop
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
function At(e) {
|
|
856
|
+
let { elements: t, rect: n, offsetParent: r, strategy: i } = e, a = i === "fixed", o = f(r), s = t ? y(t.floating) : !1;
|
|
857
|
+
if (r === o || s && a) return n;
|
|
858
|
+
let c = {
|
|
859
|
+
scrollLeft: 0,
|
|
860
|
+
scrollTop: 0
|
|
861
|
+
}, l = B(1), d = B(0), p = h(r);
|
|
862
|
+
if ((p || !p && !a) && ((u(r) !== "body" || _(o)) && (c = k(r)), p)) {
|
|
863
|
+
let e = Dt(r);
|
|
864
|
+
l = Ct(r), d.x = e.x + r.clientLeft, d.y = e.y + r.clientTop;
|
|
865
|
+
}
|
|
866
|
+
let m = o && !p && !a ? kt(o, c) : B(0);
|
|
867
|
+
return {
|
|
868
|
+
width: n.width * l.x,
|
|
869
|
+
height: n.height * l.y,
|
|
870
|
+
x: n.x * l.x - c.scrollLeft * l.x + d.x + m.x,
|
|
871
|
+
y: n.y * l.y - c.scrollTop * l.y + d.y + m.y
|
|
872
|
+
};
|
|
873
|
+
}
|
|
874
|
+
function jt(e) {
|
|
875
|
+
return Array.from(e.getClientRects());
|
|
876
|
+
}
|
|
877
|
+
function Mt(e) {
|
|
878
|
+
let t = f(e), n = k(e), r = e.ownerDocument.body, i = R(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), a = R(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight), o = -n.scrollLeft + Ot(e), s = -n.scrollTop;
|
|
879
|
+
return O(r).direction === "rtl" && (o += R(t.clientWidth, r.clientWidth) - i), {
|
|
880
|
+
width: i,
|
|
881
|
+
height: a,
|
|
882
|
+
x: o,
|
|
883
|
+
y: s
|
|
884
|
+
};
|
|
885
|
+
}
|
|
886
|
+
var Nt = 25;
|
|
887
|
+
function Pt(e, t) {
|
|
888
|
+
let n = d(e), r = f(e), i = n.visualViewport, a = r.clientWidth, o = r.clientHeight, s = 0, c = 0;
|
|
889
|
+
if (i) {
|
|
890
|
+
a = i.width, o = i.height;
|
|
891
|
+
let e = E();
|
|
892
|
+
(!e || e && t === "fixed") && (s = i.offsetLeft, c = i.offsetTop);
|
|
893
|
+
}
|
|
894
|
+
let l = Ot(r);
|
|
895
|
+
if (l <= 0) {
|
|
896
|
+
let e = r.ownerDocument, t = e.body, n = getComputedStyle(t), i = e.compatMode === "CSS1Compat" && parseFloat(n.marginLeft) + parseFloat(n.marginRight) || 0, o = Math.abs(r.clientWidth - t.clientWidth - i);
|
|
897
|
+
o <= Nt && (a -= o);
|
|
898
|
+
} else l <= Nt && (a += l);
|
|
899
|
+
return {
|
|
900
|
+
width: a,
|
|
901
|
+
height: o,
|
|
902
|
+
x: s,
|
|
903
|
+
y: c
|
|
904
|
+
};
|
|
905
|
+
}
|
|
906
|
+
function Ft(e, t) {
|
|
907
|
+
let n = Dt(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, a = h(e) ? Ct(e) : B(1);
|
|
908
|
+
return {
|
|
909
|
+
width: e.clientWidth * a.x,
|
|
910
|
+
height: e.clientHeight * a.y,
|
|
911
|
+
x: i * a.x,
|
|
912
|
+
y: r * a.y
|
|
913
|
+
};
|
|
914
|
+
}
|
|
915
|
+
function It(e, t, n) {
|
|
916
|
+
let r;
|
|
917
|
+
if (t === "viewport") r = Pt(e, n);
|
|
918
|
+
else if (t === "document") r = Mt(f(e));
|
|
919
|
+
else if (m(t)) r = Ft(t, n);
|
|
920
|
+
else {
|
|
921
|
+
let n = Tt(e);
|
|
922
|
+
r = {
|
|
923
|
+
x: t.x - n.x,
|
|
924
|
+
y: t.y - n.y,
|
|
925
|
+
width: t.width,
|
|
926
|
+
height: t.height
|
|
927
|
+
};
|
|
928
|
+
}
|
|
929
|
+
return _e(r);
|
|
930
|
+
}
|
|
931
|
+
function Lt(e, t) {
|
|
932
|
+
let n = A(e);
|
|
933
|
+
return n === t || !m(n) || D(n) ? !1 : O(n).position === "fixed" || Lt(n, t);
|
|
934
|
+
}
|
|
935
|
+
function Rt(e, t) {
|
|
936
|
+
let n = t.get(e);
|
|
937
|
+
if (n) return n;
|
|
938
|
+
let r = M(e, [], !1).filter((e) => m(e) && u(e) !== "body"), i = null, a = O(e).position === "fixed", o = a ? A(e) : e;
|
|
939
|
+
for (; m(o) && !D(o);) {
|
|
940
|
+
let t = O(o), n = w(o);
|
|
941
|
+
!n && t.position === "fixed" && (i = null), (a ? !n && !i : !n && t.position === "static" && i && (i.position === "absolute" || i.position === "fixed") || _(o) && !n && Lt(e, o)) ? r = r.filter((e) => e !== o) : i = t, o = A(o);
|
|
942
|
+
}
|
|
943
|
+
return t.set(e, r), r;
|
|
944
|
+
}
|
|
945
|
+
function zt(e) {
|
|
946
|
+
let { element: t, boundary: n, rootBoundary: r, strategy: i } = e, a = [...n === "clippingAncestors" ? y(t) ? [] : Rt(t, this._c) : [].concat(n), r], o = It(t, a[0], i), s = o.top, c = o.right, l = o.bottom, u = o.left;
|
|
947
|
+
for (let e = 1; e < a.length; e++) {
|
|
948
|
+
let n = It(t, a[e], i);
|
|
949
|
+
s = R(n.top, s), c = L(n.right, c), l = L(n.bottom, l), u = R(n.left, u);
|
|
950
|
+
}
|
|
951
|
+
return {
|
|
952
|
+
width: c - u,
|
|
953
|
+
height: l - s,
|
|
954
|
+
x: u,
|
|
955
|
+
y: s
|
|
956
|
+
};
|
|
957
|
+
}
|
|
958
|
+
function Bt(e) {
|
|
959
|
+
let { width: t, height: n } = xt(e);
|
|
960
|
+
return {
|
|
961
|
+
width: t,
|
|
962
|
+
height: n
|
|
963
|
+
};
|
|
964
|
+
}
|
|
965
|
+
function Vt(e, t, n) {
|
|
966
|
+
let r = h(t), i = f(t), a = n === "fixed", o = Dt(e, !0, a, t), s = {
|
|
967
|
+
scrollLeft: 0,
|
|
968
|
+
scrollTop: 0
|
|
969
|
+
}, c = B(0);
|
|
970
|
+
function l() {
|
|
971
|
+
c.x = Ot(i);
|
|
972
|
+
}
|
|
973
|
+
if (r || !r && !a) if ((u(t) !== "body" || _(i)) && (s = k(t)), r) {
|
|
974
|
+
let e = Dt(t, !0, a, t);
|
|
975
|
+
c.x = e.x + t.clientLeft, c.y = e.y + t.clientTop;
|
|
976
|
+
} else i && l();
|
|
977
|
+
a && !r && i && l();
|
|
978
|
+
let d = i && !r && !a ? kt(i, s) : B(0);
|
|
979
|
+
return {
|
|
980
|
+
x: o.left + s.scrollLeft - c.x - d.x,
|
|
981
|
+
y: o.top + s.scrollTop - c.y - d.y,
|
|
982
|
+
width: o.width,
|
|
983
|
+
height: o.height
|
|
984
|
+
};
|
|
985
|
+
}
|
|
986
|
+
function Ht(e) {
|
|
987
|
+
return O(e).position === "static";
|
|
988
|
+
}
|
|
989
|
+
function Ut(e, t) {
|
|
990
|
+
if (!h(e) || O(e).position === "fixed") return null;
|
|
991
|
+
if (t) return t(e);
|
|
992
|
+
let n = e.offsetParent;
|
|
993
|
+
return f(e) === n && (n = n.ownerDocument.body), n;
|
|
994
|
+
}
|
|
995
|
+
function Wt(e, t) {
|
|
996
|
+
let n = d(e);
|
|
997
|
+
if (y(e)) return n;
|
|
998
|
+
if (!h(e)) {
|
|
999
|
+
let t = A(e);
|
|
1000
|
+
for (; t && !D(t);) {
|
|
1001
|
+
if (m(t) && !Ht(t)) return t;
|
|
1002
|
+
t = A(t);
|
|
1003
|
+
}
|
|
1004
|
+
return n;
|
|
1005
|
+
}
|
|
1006
|
+
let r = Ut(e, t);
|
|
1007
|
+
for (; r && v(r) && Ht(r);) r = Ut(r, t);
|
|
1008
|
+
return r && D(r) && Ht(r) && !w(r) ? n : r || T(e) || n;
|
|
1009
|
+
}
|
|
1010
|
+
var Gt = async function(e) {
|
|
1011
|
+
let t = this.getOffsetParent || Wt, n = this.getDimensions, r = await n(e.floating);
|
|
1012
|
+
return {
|
|
1013
|
+
reference: Vt(e.reference, await t(e.floating), e.strategy),
|
|
1014
|
+
floating: {
|
|
1015
|
+
x: 0,
|
|
1016
|
+
y: 0,
|
|
1017
|
+
width: r.width,
|
|
1018
|
+
height: r.height
|
|
1019
|
+
}
|
|
1020
|
+
};
|
|
1021
|
+
};
|
|
1022
|
+
function Kt(e) {
|
|
1023
|
+
return O(e).direction === "rtl";
|
|
1024
|
+
}
|
|
1025
|
+
var qt = {
|
|
1026
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: At,
|
|
1027
|
+
getDocumentElement: f,
|
|
1028
|
+
getClippingRect: zt,
|
|
1029
|
+
getOffsetParent: Wt,
|
|
1030
|
+
getElementRects: Gt,
|
|
1031
|
+
getClientRects: jt,
|
|
1032
|
+
getDimensions: Bt,
|
|
1033
|
+
getScale: Ct,
|
|
1034
|
+
isElement: m,
|
|
1035
|
+
isRTL: Kt
|
|
1036
|
+
};
|
|
1037
|
+
function Jt(e, t) {
|
|
1038
|
+
return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
|
|
1039
|
+
}
|
|
1040
|
+
function Yt(e, t) {
|
|
1041
|
+
let n = null, r, i = f(e);
|
|
1042
|
+
function a() {
|
|
1043
|
+
var e;
|
|
1044
|
+
clearTimeout(r), (e = n) == null || e.disconnect(), n = null;
|
|
1045
|
+
}
|
|
1046
|
+
function o(s, c) {
|
|
1047
|
+
s === void 0 && (s = !1), c === void 0 && (c = 1), a();
|
|
1048
|
+
let l = e.getBoundingClientRect(), { left: u, top: d, width: f, height: p } = l;
|
|
1049
|
+
if (s || t(), !f || !p) return;
|
|
1050
|
+
let m = z(d), h = z(i.clientWidth - (u + f)), g = z(i.clientHeight - (d + p)), _ = z(u), v = {
|
|
1051
|
+
rootMargin: -m + "px " + -h + "px " + -g + "px " + -_ + "px",
|
|
1052
|
+
threshold: R(0, L(1, c)) || 1
|
|
1053
|
+
}, y = !0;
|
|
1054
|
+
function b(t) {
|
|
1055
|
+
let n = t[0].intersectionRatio;
|
|
1056
|
+
if (n !== c) {
|
|
1057
|
+
if (!y) return o();
|
|
1058
|
+
n ? o(!1, n) : r = setTimeout(() => {
|
|
1059
|
+
o(!1, 1e-7);
|
|
1060
|
+
}, 1e3);
|
|
1061
|
+
}
|
|
1062
|
+
n === 1 && !Jt(l, e.getBoundingClientRect()) && o(), y = !1;
|
|
1063
|
+
}
|
|
1064
|
+
try {
|
|
1065
|
+
n = new IntersectionObserver(b, {
|
|
1066
|
+
...v,
|
|
1067
|
+
root: i.ownerDocument
|
|
1068
|
+
});
|
|
1069
|
+
} catch {
|
|
1070
|
+
n = new IntersectionObserver(b, v);
|
|
1071
|
+
}
|
|
1072
|
+
n.observe(e);
|
|
1073
|
+
}
|
|
1074
|
+
return o(!0), a;
|
|
1075
|
+
}
|
|
1076
|
+
function Xt(e, t, n, r) {
|
|
1077
|
+
r === void 0 && (r = {});
|
|
1078
|
+
let { ancestorScroll: i = !0, ancestorResize: a = !0, elementResize: o = typeof ResizeObserver == "function", layoutShift: s = typeof IntersectionObserver == "function", animationFrame: c = !1 } = r, l = St(e), u = i || a ? [...l ? M(l) : [], ...t ? M(t) : []] : [];
|
|
1079
|
+
u.forEach((e) => {
|
|
1080
|
+
i && e.addEventListener("scroll", n, { passive: !0 }), a && e.addEventListener("resize", n);
|
|
1081
|
+
});
|
|
1082
|
+
let d = l && s ? Yt(l, n) : null, f = -1, p = null;
|
|
1083
|
+
o && (p = new ResizeObserver((e) => {
|
|
1084
|
+
let [r] = e;
|
|
1085
|
+
r && r.target === l && p && t && (p.unobserve(t), cancelAnimationFrame(f), f = requestAnimationFrame(() => {
|
|
1086
|
+
var e;
|
|
1087
|
+
(e = p) == null || e.observe(t);
|
|
1088
|
+
})), n();
|
|
1089
|
+
}), l && !c && p.observe(l), t && p.observe(t));
|
|
1090
|
+
let m, h = c ? Dt(e) : null;
|
|
1091
|
+
c && g();
|
|
1092
|
+
function g() {
|
|
1093
|
+
let t = Dt(e);
|
|
1094
|
+
h && !Jt(h, t) && n(), h = t, m = requestAnimationFrame(g);
|
|
1095
|
+
}
|
|
1096
|
+
return n(), () => {
|
|
1097
|
+
var e;
|
|
1098
|
+
u.forEach((e) => {
|
|
1099
|
+
i && e.removeEventListener("scroll", n), a && e.removeEventListener("resize", n);
|
|
1100
|
+
}), d?.(), (e = p) == null || e.disconnect(), p = null, c && cancelAnimationFrame(m);
|
|
1101
|
+
};
|
|
1102
|
+
}
|
|
1103
|
+
var Zt = vt, Qt = mt, $t = yt, en = ht, tn = bt, nn = (e, t, n) => {
|
|
1104
|
+
let r = /* @__PURE__ */ new Map(), i = {
|
|
1105
|
+
platform: qt,
|
|
1106
|
+
...n
|
|
1107
|
+
}, a = {
|
|
1108
|
+
...i.platform,
|
|
1109
|
+
_c: r
|
|
1110
|
+
};
|
|
1111
|
+
return ft(e, t, {
|
|
1112
|
+
...i,
|
|
1113
|
+
platform: a
|
|
1114
|
+
});
|
|
1115
|
+
}, rn = typeof document < "u" ? i : function() {};
|
|
1116
|
+
function an(e, t) {
|
|
1117
|
+
if (e === t) return !0;
|
|
1118
|
+
if (typeof e != typeof t) return !1;
|
|
1119
|
+
if (typeof e == "function" && e.toString() === t.toString()) return !0;
|
|
1120
|
+
let n, r, i;
|
|
1121
|
+
if (e && t && typeof e == "object") {
|
|
1122
|
+
if (Array.isArray(e)) {
|
|
1123
|
+
if (n = e.length, n !== t.length) return !1;
|
|
1124
|
+
for (r = n; r-- !== 0;) if (!an(e[r], t[r])) return !1;
|
|
1125
|
+
return !0;
|
|
1126
|
+
}
|
|
1127
|
+
if (i = Object.keys(e), n = i.length, n !== Object.keys(t).length) return !1;
|
|
1128
|
+
for (r = n; r-- !== 0;) if (!{}.hasOwnProperty.call(t, i[r])) return !1;
|
|
1129
|
+
for (r = n; r-- !== 0;) {
|
|
1130
|
+
let n = i[r];
|
|
1131
|
+
if (!(n === "_owner" && e.$$typeof) && !an(e[n], t[n])) return !1;
|
|
1132
|
+
}
|
|
1133
|
+
return !0;
|
|
1134
|
+
}
|
|
1135
|
+
return e !== e && t !== t;
|
|
1136
|
+
}
|
|
1137
|
+
function on(e) {
|
|
1138
|
+
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
1139
|
+
}
|
|
1140
|
+
function sn(e, t) {
|
|
1141
|
+
let n = on(e);
|
|
1142
|
+
return Math.round(t * n) / n;
|
|
1143
|
+
}
|
|
1144
|
+
function cn(e) {
|
|
1145
|
+
let t = r.useRef(e);
|
|
1146
|
+
return rn(() => {
|
|
1147
|
+
t.current = e;
|
|
1148
|
+
}), t;
|
|
1149
|
+
}
|
|
1150
|
+
function ln(e) {
|
|
1151
|
+
e === void 0 && (e = {});
|
|
1152
|
+
let { placement: t = "bottom", strategy: n = "absolute", middleware: i = [], platform: a, elements: { reference: o, floating: s } = {}, transform: l = !0, whileElementsMounted: u, open: d } = e, [f, p] = r.useState({
|
|
1153
|
+
x: 0,
|
|
1154
|
+
y: 0,
|
|
1155
|
+
strategy: n,
|
|
1156
|
+
placement: t,
|
|
1157
|
+
middlewareData: {},
|
|
1158
|
+
isPositioned: !1
|
|
1159
|
+
}), [m, h] = r.useState(i);
|
|
1160
|
+
an(m, i) || h(i);
|
|
1161
|
+
let [g, _] = r.useState(null), [v, y] = r.useState(null), b = r.useCallback((e) => {
|
|
1162
|
+
e !== w.current && (w.current = e, _(e));
|
|
1163
|
+
}, []), x = r.useCallback((e) => {
|
|
1164
|
+
e !== T.current && (T.current = e, y(e));
|
|
1165
|
+
}, []), S = o || g, C = s || v, w = r.useRef(null), T = r.useRef(null), E = r.useRef(f), D = u != null, O = cn(u), k = cn(a), A = cn(d), j = r.useCallback(() => {
|
|
1166
|
+
if (!w.current || !T.current) return;
|
|
1167
|
+
let e = {
|
|
1168
|
+
placement: t,
|
|
1169
|
+
strategy: n,
|
|
1170
|
+
middleware: m
|
|
1171
|
+
};
|
|
1172
|
+
k.current && (e.platform = k.current), nn(w.current, T.current, e).then((e) => {
|
|
1173
|
+
let t = {
|
|
1174
|
+
...e,
|
|
1175
|
+
isPositioned: A.current !== !1
|
|
1176
|
+
};
|
|
1177
|
+
M.current && !an(E.current, t) && (E.current = t, c.flushSync(() => {
|
|
1178
|
+
p(t);
|
|
1179
|
+
}));
|
|
1180
|
+
});
|
|
1181
|
+
}, [
|
|
1182
|
+
m,
|
|
1183
|
+
t,
|
|
1184
|
+
n,
|
|
1185
|
+
k,
|
|
1186
|
+
A
|
|
1187
|
+
]);
|
|
1188
|
+
rn(() => {
|
|
1189
|
+
d === !1 && E.current.isPositioned && (E.current.isPositioned = !1, p((e) => ({
|
|
1190
|
+
...e,
|
|
1191
|
+
isPositioned: !1
|
|
1192
|
+
})));
|
|
1193
|
+
}, [d]);
|
|
1194
|
+
let M = r.useRef(!1);
|
|
1195
|
+
rn(() => (M.current = !0, () => {
|
|
1196
|
+
M.current = !1;
|
|
1197
|
+
}), []), rn(() => {
|
|
1198
|
+
if (S && (w.current = S), C && (T.current = C), S && C) {
|
|
1199
|
+
if (O.current) return O.current(S, C, j);
|
|
1200
|
+
j();
|
|
1201
|
+
}
|
|
1202
|
+
}, [
|
|
1203
|
+
S,
|
|
1204
|
+
C,
|
|
1205
|
+
j,
|
|
1206
|
+
O,
|
|
1207
|
+
D
|
|
1208
|
+
]);
|
|
1209
|
+
let N = r.useMemo(() => ({
|
|
1210
|
+
reference: w,
|
|
1211
|
+
floating: T,
|
|
1212
|
+
setReference: b,
|
|
1213
|
+
setFloating: x
|
|
1214
|
+
}), [b, x]), P = r.useMemo(() => ({
|
|
1215
|
+
reference: S,
|
|
1216
|
+
floating: C
|
|
1217
|
+
}), [S, C]), F = r.useMemo(() => {
|
|
1218
|
+
let e = {
|
|
1219
|
+
position: n,
|
|
1220
|
+
left: 0,
|
|
1221
|
+
top: 0
|
|
1222
|
+
};
|
|
1223
|
+
if (!P.floating) return e;
|
|
1224
|
+
let t = sn(P.floating, f.x), r = sn(P.floating, f.y);
|
|
1225
|
+
return l ? {
|
|
1226
|
+
...e,
|
|
1227
|
+
transform: "translate(" + t + "px, " + r + "px)",
|
|
1228
|
+
...on(P.floating) >= 1.5 && { willChange: "transform" }
|
|
1229
|
+
} : {
|
|
1230
|
+
position: n,
|
|
1231
|
+
left: t,
|
|
1232
|
+
top: r
|
|
1233
|
+
};
|
|
1234
|
+
}, [
|
|
1235
|
+
n,
|
|
1236
|
+
l,
|
|
1237
|
+
P.floating,
|
|
1238
|
+
f.x,
|
|
1239
|
+
f.y
|
|
1240
|
+
]);
|
|
1241
|
+
return r.useMemo(() => ({
|
|
1242
|
+
...f,
|
|
1243
|
+
update: j,
|
|
1244
|
+
refs: N,
|
|
1245
|
+
elements: P,
|
|
1246
|
+
floatingStyles: F
|
|
1247
|
+
}), [
|
|
1248
|
+
f,
|
|
1249
|
+
j,
|
|
1250
|
+
N,
|
|
1251
|
+
P,
|
|
1252
|
+
F
|
|
1253
|
+
]);
|
|
1254
|
+
}
|
|
1255
|
+
var un = (e, t) => {
|
|
1256
|
+
let n = Zt(e);
|
|
1257
|
+
return {
|
|
1258
|
+
name: n.name,
|
|
1259
|
+
fn: n.fn,
|
|
1260
|
+
options: [e, t]
|
|
1261
|
+
};
|
|
1262
|
+
}, dn = (e, t) => {
|
|
1263
|
+
let n = $t(e);
|
|
1264
|
+
return {
|
|
1265
|
+
name: n.name,
|
|
1266
|
+
fn: n.fn,
|
|
1267
|
+
options: [e, t]
|
|
1268
|
+
};
|
|
1269
|
+
}, fn = (e, t) => {
|
|
1270
|
+
let n = en(e);
|
|
1271
|
+
return {
|
|
1272
|
+
name: n.name,
|
|
1273
|
+
fn: n.fn,
|
|
1274
|
+
options: [e, t]
|
|
1275
|
+
};
|
|
1276
|
+
}, pn = (e, t) => {
|
|
1277
|
+
let n = tn(e);
|
|
1278
|
+
return {
|
|
1279
|
+
name: n.name,
|
|
1280
|
+
fn: n.fn,
|
|
1281
|
+
options: [e, t]
|
|
1282
|
+
};
|
|
1283
|
+
}, mn = (e, t) => {
|
|
1284
|
+
let n = Qt(e);
|
|
1285
|
+
return {
|
|
1286
|
+
name: n.name,
|
|
1287
|
+
fn: n.fn,
|
|
1288
|
+
options: [e, t]
|
|
1289
|
+
};
|
|
1290
|
+
};
|
|
1291
|
+
//#endregion
|
|
1292
|
+
//#region ../../node_modules/@floating-ui/react/dist/floating-ui.react.mjs
|
|
1293
|
+
function hn(e) {
|
|
1294
|
+
let t = r.useRef(void 0), n = r.useCallback((t) => {
|
|
1295
|
+
let n = e.map((e) => {
|
|
1296
|
+
if (e != null) {
|
|
1297
|
+
if (typeof e == "function") {
|
|
1298
|
+
let n = e, r = n(t);
|
|
1299
|
+
return typeof r == "function" ? r : () => {
|
|
1300
|
+
n(null);
|
|
1301
|
+
};
|
|
1302
|
+
}
|
|
1303
|
+
return e.current = t, () => {
|
|
1304
|
+
e.current = null;
|
|
1305
|
+
};
|
|
1306
|
+
}
|
|
1307
|
+
});
|
|
1308
|
+
return () => {
|
|
1309
|
+
n.forEach((e) => e?.());
|
|
1310
|
+
};
|
|
1311
|
+
}, e);
|
|
1312
|
+
return r.useMemo(() => e.every((e) => e == null) ? null : (e) => {
|
|
1313
|
+
t.current &&= (t.current(), void 0), e != null && (t.current = n(e));
|
|
1314
|
+
}, e);
|
|
1315
|
+
}
|
|
1316
|
+
function gn(e, t) {
|
|
1317
|
+
let n = e.compareDocumentPosition(t);
|
|
1318
|
+
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;
|
|
1319
|
+
}
|
|
1320
|
+
var _n = /* @__PURE__ */ r.createContext({
|
|
1321
|
+
register: () => {},
|
|
1322
|
+
unregister: () => {},
|
|
1323
|
+
map: /* @__PURE__ */ new Map(),
|
|
1324
|
+
elementsRef: { current: [] }
|
|
1325
|
+
});
|
|
1326
|
+
function vn(e) {
|
|
1327
|
+
let { children: t, elementsRef: n, labelsRef: i } = e, [a, s] = r.useState(() => /* @__PURE__ */ new Set()), c = r.useCallback((e) => {
|
|
1328
|
+
s((t) => new Set(t).add(e));
|
|
1329
|
+
}, []), l = r.useCallback((e) => {
|
|
1330
|
+
s((t) => {
|
|
1331
|
+
let n = new Set(t);
|
|
1332
|
+
return n.delete(e), n;
|
|
1333
|
+
});
|
|
1334
|
+
}, []), u = r.useMemo(() => {
|
|
1335
|
+
let e = /* @__PURE__ */ new Map();
|
|
1336
|
+
return Array.from(a.keys()).sort(gn).forEach((t, n) => {
|
|
1337
|
+
e.set(t, n);
|
|
1338
|
+
}), e;
|
|
1339
|
+
}, [a]);
|
|
1340
|
+
return /* @__PURE__ */ o(_n.Provider, {
|
|
1341
|
+
value: r.useMemo(() => ({
|
|
1342
|
+
register: c,
|
|
1343
|
+
unregister: l,
|
|
1344
|
+
map: u,
|
|
1345
|
+
elementsRef: n,
|
|
1346
|
+
labelsRef: i
|
|
1347
|
+
}), [
|
|
1348
|
+
c,
|
|
1349
|
+
l,
|
|
1350
|
+
u,
|
|
1351
|
+
n,
|
|
1352
|
+
i
|
|
1353
|
+
]),
|
|
1354
|
+
children: t
|
|
1355
|
+
});
|
|
1356
|
+
}
|
|
1357
|
+
function yn(e) {
|
|
1358
|
+
e === void 0 && (e = {});
|
|
1359
|
+
let { label: t } = e, { register: n, unregister: i, map: a, elementsRef: o, labelsRef: s } = r.useContext(_n), [c, l] = r.useState(null), u = r.useRef(null), d = r.useCallback((e) => {
|
|
1360
|
+
if (u.current = e, c !== null && (o.current[c] = e, s)) {
|
|
1361
|
+
let n = t !== void 0;
|
|
1362
|
+
s.current[c] = n ? t : e?.textContent ?? null;
|
|
1363
|
+
}
|
|
1364
|
+
}, [
|
|
1365
|
+
c,
|
|
1366
|
+
o,
|
|
1367
|
+
s,
|
|
1368
|
+
t
|
|
1369
|
+
]);
|
|
1370
|
+
return Y(() => {
|
|
1371
|
+
let e = u.current;
|
|
1372
|
+
if (e) return n(e), () => {
|
|
1373
|
+
i(e);
|
|
1374
|
+
};
|
|
1375
|
+
}, [n, i]), Y(() => {
|
|
1376
|
+
let e = u.current ? a.get(u.current) : null;
|
|
1377
|
+
e != null && l(e);
|
|
1378
|
+
}, [a]), r.useMemo(() => ({
|
|
1379
|
+
ref: d,
|
|
1380
|
+
index: c ?? -1
|
|
1381
|
+
}), [c, d]);
|
|
1382
|
+
}
|
|
1383
|
+
var bn = "data-floating-ui-focusable", xn = "active", Sn = "selected", Cn = "ArrowLeft", wn = "ArrowRight", Tn = "ArrowUp", En = "ArrowDown";
|
|
1384
|
+
function Dn(e, t) {
|
|
1385
|
+
return typeof e == "function" ? e(t) : e ? /* @__PURE__ */ r.cloneElement(e, t) : /* @__PURE__ */ o("div", { ...t });
|
|
1386
|
+
}
|
|
1387
|
+
var On = /* @__PURE__ */ r.createContext({
|
|
1388
|
+
activeIndex: 0,
|
|
1389
|
+
onNavigate: () => {}
|
|
1390
|
+
}), kn = [Cn, wn], An = [Tn, En], jn = [...kn, ...An], Mn = /* @__PURE__ */ r.forwardRef(function(e, t) {
|
|
1391
|
+
let { render: n, orientation: i = "both", loop: a = !0, rtl: s = !1, cols: c = 1, disabledIndices: l, activeIndex: u, onNavigate: d, itemSizes: f, dense: p = !1, ...m } = e, [h, g] = r.useState(0), _ = u ?? h, v = Z(d ?? g), y = r.useRef([]), b = n && typeof n != "function" ? n.props : {}, x = r.useMemo(() => ({
|
|
1392
|
+
activeIndex: _,
|
|
1393
|
+
onNavigate: v
|
|
1394
|
+
}), [_, v]), S = c > 1;
|
|
1395
|
+
function C(e) {
|
|
1396
|
+
if (!jn.includes(e.key)) return;
|
|
1397
|
+
let t = _, n = Ye(y, l), r = Xe(y, l), o = s ? Cn : wn, u = s ? wn : Cn;
|
|
1398
|
+
if (S) {
|
|
1399
|
+
let u = f || Array.from({ length: y.current.length }, () => ({
|
|
1400
|
+
width: 1,
|
|
1401
|
+
height: 1
|
|
1402
|
+
})), d = Qe(u, c, p), m = d.findIndex((e) => e != null && !tt(y, e, l)), h = d.reduce((e, t, n) => t != null && !tt(y, t, l) ? n : e, -1), g = d[Ze({ current: d.map((e) => e ? y.current[e] : null) }, {
|
|
1403
|
+
event: e,
|
|
1404
|
+
orientation: i,
|
|
1405
|
+
loop: a,
|
|
1406
|
+
rtl: s,
|
|
1407
|
+
cols: c,
|
|
1408
|
+
disabledIndices: et([...(typeof l == "function" ? null : l) || y.current.map((e, t) => tt(y, t, l) ? t : void 0), void 0], d),
|
|
1409
|
+
minIndex: m,
|
|
1410
|
+
maxIndex: h,
|
|
1411
|
+
prevIndex: $e(_ > r ? n : _, u, d, c, e.key === En ? "bl" : e.key === o ? "tr" : "tl")
|
|
1412
|
+
})];
|
|
1413
|
+
g != null && (t = g);
|
|
1414
|
+
}
|
|
1415
|
+
let d = {
|
|
1416
|
+
horizontal: [o],
|
|
1417
|
+
vertical: [En],
|
|
1418
|
+
both: [o, En]
|
|
1419
|
+
}[i], m = {
|
|
1420
|
+
horizontal: [u],
|
|
1421
|
+
vertical: [Tn],
|
|
1422
|
+
both: [u, Tn]
|
|
1423
|
+
}[i], h = S ? jn : {
|
|
1424
|
+
horizontal: kn,
|
|
1425
|
+
vertical: An,
|
|
1426
|
+
both: jn
|
|
1427
|
+
}[i];
|
|
1428
|
+
if (t === _ && [...d, ...m].includes(e.key) && (t = a && t === r && d.includes(e.key) ? n : a && t === n && m.includes(e.key) ? r : Q(y, {
|
|
1429
|
+
startingIndex: t,
|
|
1430
|
+
decrement: m.includes(e.key),
|
|
1431
|
+
disabledIndices: l
|
|
1432
|
+
})), t !== _ && !Je(y, t)) {
|
|
1433
|
+
var g;
|
|
1434
|
+
e.stopPropagation(), h.includes(e.key) && e.preventDefault(), v(t), (g = y.current[t]) == null || g.focus();
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
let w = {
|
|
1438
|
+
...m,
|
|
1439
|
+
...b,
|
|
1440
|
+
ref: t,
|
|
1441
|
+
"aria-orientation": i === "both" ? void 0 : i,
|
|
1442
|
+
onKeyDown(e) {
|
|
1443
|
+
m.onKeyDown == null || m.onKeyDown(e), b.onKeyDown == null || b.onKeyDown(e), C(e);
|
|
1444
|
+
}
|
|
1445
|
+
};
|
|
1446
|
+
return /* @__PURE__ */ o(On.Provider, {
|
|
1447
|
+
value: x,
|
|
1448
|
+
children: /* @__PURE__ */ o(vn, {
|
|
1449
|
+
elementsRef: y,
|
|
1450
|
+
children: Dn(n, w)
|
|
1451
|
+
})
|
|
1452
|
+
});
|
|
1453
|
+
}), Nn = /* @__PURE__ */ r.forwardRef(function(e, t) {
|
|
1454
|
+
let { render: n, ...i } = e, a = n && typeof n != "function" ? n.props : {}, { activeIndex: o, onNavigate: s } = r.useContext(On), { ref: c, index: l } = yn(), u = hn([
|
|
1455
|
+
c,
|
|
1456
|
+
t,
|
|
1457
|
+
a.ref
|
|
1458
|
+
]), d = o === l;
|
|
1459
|
+
return Dn(n, {
|
|
1460
|
+
...i,
|
|
1461
|
+
...a,
|
|
1462
|
+
ref: u,
|
|
1463
|
+
tabIndex: d ? 0 : -1,
|
|
1464
|
+
"data-active": d ? "" : void 0,
|
|
1465
|
+
onFocus(e) {
|
|
1466
|
+
i.onFocus == null || i.onFocus(e), a.onFocus == null || a.onFocus(e), s(l);
|
|
1467
|
+
}
|
|
1468
|
+
});
|
|
1469
|
+
}), Pn = { ...r }, Fn = !1, In = 0, Ln = () => "floating-ui-" + Math.random().toString(36).slice(2, 6) + In++;
|
|
1470
|
+
function Rn() {
|
|
1471
|
+
let [e, t] = r.useState(() => Fn ? Ln() : void 0);
|
|
1472
|
+
return Y(() => {
|
|
1473
|
+
e ?? t(Ln());
|
|
1474
|
+
}, []), r.useEffect(() => {
|
|
1475
|
+
Fn = !0;
|
|
1476
|
+
}, []), e;
|
|
1477
|
+
}
|
|
1478
|
+
var zn = Pn.useId || Rn, Bn;
|
|
1479
|
+
process.env.NODE_ENV !== "production" && (Bn = /* @__PURE__ */ new Set());
|
|
1480
|
+
function Vn() {
|
|
1481
|
+
var e;
|
|
1482
|
+
let t = "Floating UI: " + [...arguments].join(" ");
|
|
1483
|
+
if (!((e = Bn) != null && e.has(t))) {
|
|
1484
|
+
var n;
|
|
1485
|
+
(n = Bn) == null || n.add(t), console.warn(t);
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
function Hn() {
|
|
1489
|
+
var e;
|
|
1490
|
+
let t = "Floating UI: " + [...arguments].join(" ");
|
|
1491
|
+
if (!((e = Bn) != null && e.has(t))) {
|
|
1492
|
+
var n;
|
|
1493
|
+
(n = Bn) == null || n.add(t), console.error(t);
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
function Un() {
|
|
1497
|
+
let e = /* @__PURE__ */ new Map();
|
|
1498
|
+
return {
|
|
1499
|
+
emit(t, n) {
|
|
1500
|
+
var r;
|
|
1501
|
+
(r = e.get(t)) == null || r.forEach((e) => e(n));
|
|
1502
|
+
},
|
|
1503
|
+
on(t, n) {
|
|
1504
|
+
e.has(t) || e.set(t, /* @__PURE__ */ new Set()), e.get(t).add(n);
|
|
1505
|
+
},
|
|
1506
|
+
off(t, n) {
|
|
1507
|
+
var r;
|
|
1508
|
+
(r = e.get(t)) == null || r.delete(n);
|
|
1509
|
+
}
|
|
1510
|
+
};
|
|
1511
|
+
}
|
|
1512
|
+
var Wn = /* @__PURE__ */ r.createContext(null), Gn = /* @__PURE__ */ r.createContext(null), Kn = () => r.useContext(Wn)?.id || null, qn = () => r.useContext(Gn);
|
|
1513
|
+
function Jn(e) {
|
|
1514
|
+
let t = zn(), n = qn(), r = Kn(), i = e || r;
|
|
1515
|
+
return Y(() => {
|
|
1516
|
+
if (!t) return;
|
|
1517
|
+
let e = {
|
|
1518
|
+
id: t,
|
|
1519
|
+
parentId: i
|
|
1520
|
+
};
|
|
1521
|
+
return n?.addNode(e), () => {
|
|
1522
|
+
n?.removeNode(e);
|
|
1523
|
+
};
|
|
1524
|
+
}, [
|
|
1525
|
+
n,
|
|
1526
|
+
t,
|
|
1527
|
+
i
|
|
1528
|
+
]), t;
|
|
1529
|
+
}
|
|
1530
|
+
function Yn(e) {
|
|
1531
|
+
let { children: t, id: n } = e, i = Kn();
|
|
1532
|
+
return /* @__PURE__ */ o(Wn.Provider, {
|
|
1533
|
+
value: r.useMemo(() => ({
|
|
1534
|
+
id: n,
|
|
1535
|
+
parentId: i
|
|
1536
|
+
}), [n, i]),
|
|
1537
|
+
children: t
|
|
1538
|
+
});
|
|
1539
|
+
}
|
|
1540
|
+
function Xn(e) {
|
|
1541
|
+
let { children: t } = e, n = r.useRef([]), i = r.useCallback((e) => {
|
|
1542
|
+
n.current = [...n.current, e];
|
|
1543
|
+
}, []), a = r.useCallback((e) => {
|
|
1544
|
+
n.current = n.current.filter((t) => t !== e);
|
|
1545
|
+
}, []), [s] = r.useState(() => Un());
|
|
1546
|
+
return /* @__PURE__ */ o(Gn.Provider, {
|
|
1547
|
+
value: r.useMemo(() => ({
|
|
1548
|
+
nodesRef: n,
|
|
1549
|
+
addNode: i,
|
|
1550
|
+
removeNode: a,
|
|
1551
|
+
events: s
|
|
1552
|
+
}), [
|
|
1553
|
+
i,
|
|
1554
|
+
a,
|
|
1555
|
+
s
|
|
1556
|
+
]),
|
|
1557
|
+
children: t
|
|
1558
|
+
});
|
|
1559
|
+
}
|
|
1560
|
+
function Zn(e) {
|
|
1561
|
+
return "data-floating-ui-" + e;
|
|
1562
|
+
}
|
|
1563
|
+
function $(e) {
|
|
1564
|
+
e.current !== -1 && (clearTimeout(e.current), e.current = -1);
|
|
1565
|
+
}
|
|
1566
|
+
var Qn = /* @__PURE__ */ Zn("safe-polygon");
|
|
1567
|
+
function $n(e, t, n) {
|
|
1568
|
+
if (n && !We(n)) return 0;
|
|
1569
|
+
if (typeof e == "number") return e;
|
|
1570
|
+
if (typeof e == "function") {
|
|
1571
|
+
let n = e();
|
|
1572
|
+
return typeof n == "number" ? n : n?.[t];
|
|
1573
|
+
}
|
|
1574
|
+
return e?.[t];
|
|
1575
|
+
}
|
|
1576
|
+
function er(e) {
|
|
1577
|
+
return typeof e == "function" ? e() : e;
|
|
1578
|
+
}
|
|
1579
|
+
function tr(e, t) {
|
|
1580
|
+
t === void 0 && (t = {});
|
|
1581
|
+
let { open: n, onOpenChange: i, dataRef: a, events: o, elements: s } = e, { enabled: c = !0, delay: l = 0, handleClose: u = null, mouseOnly: d = !1, restMs: f = 0, move: p = !0 } = t, h = qn(), g = Kn(), _ = X(u), v = X(l), y = X(n), b = X(f), x = r.useRef(), S = r.useRef(-1), C = r.useRef(), w = r.useRef(-1), T = r.useRef(!0), E = r.useRef(!1), D = r.useRef(() => {}), O = r.useRef(!1), k = Z(() => {
|
|
1582
|
+
let e = a.current.openEvent?.type;
|
|
1583
|
+
return e?.includes("mouse") && e !== "mousedown";
|
|
1584
|
+
});
|
|
1585
|
+
r.useEffect(() => {
|
|
1586
|
+
if (!c) return;
|
|
1587
|
+
function e(e) {
|
|
1588
|
+
let { open: t } = e;
|
|
1589
|
+
t || ($(S), $(w), T.current = !0, O.current = !1);
|
|
1590
|
+
}
|
|
1591
|
+
return o.on("openchange", e), () => {
|
|
1592
|
+
o.off("openchange", e);
|
|
1593
|
+
};
|
|
1594
|
+
}, [c, o]), r.useEffect(() => {
|
|
1595
|
+
if (!c || !_.current || !n) return;
|
|
1596
|
+
function e(e) {
|
|
1597
|
+
k() && i(!1, e, "hover");
|
|
1598
|
+
}
|
|
1599
|
+
let t = q(s.floating).documentElement;
|
|
1600
|
+
return t.addEventListener("mouseleave", e), () => {
|
|
1601
|
+
t.removeEventListener("mouseleave", e);
|
|
1602
|
+
};
|
|
1603
|
+
}, [
|
|
1604
|
+
s.floating,
|
|
1605
|
+
n,
|
|
1606
|
+
i,
|
|
1607
|
+
c,
|
|
1608
|
+
_,
|
|
1609
|
+
k
|
|
1610
|
+
]);
|
|
1611
|
+
let A = r.useCallback(function(e, t, n) {
|
|
1612
|
+
t === void 0 && (t = !0), n === void 0 && (n = "hover");
|
|
1613
|
+
let r = $n(v.current, "close", x.current);
|
|
1614
|
+
r && !C.current ? ($(S), S.current = window.setTimeout(() => i(!1, e, n), r)) : t && ($(S), i(!1, e, n));
|
|
1615
|
+
}, [v, i]), j = Z(() => {
|
|
1616
|
+
D.current(), C.current = void 0;
|
|
1617
|
+
}), M = Z(() => {
|
|
1618
|
+
if (E.current) {
|
|
1619
|
+
let e = q(s.floating).body;
|
|
1620
|
+
e.style.pointerEvents = "", e.removeAttribute(Qn), E.current = !1;
|
|
1621
|
+
}
|
|
1622
|
+
}), N = Z(() => a.current.openEvent ? ["click", "mousedown"].includes(a.current.openEvent.type) : !1);
|
|
1623
|
+
r.useEffect(() => {
|
|
1624
|
+
if (!c) return;
|
|
1625
|
+
function e(e) {
|
|
1626
|
+
if ($(S), T.current = !1, d && !We(x.current) || er(b.current) > 0 && !$n(v.current, "open")) return;
|
|
1627
|
+
let t = $n(v.current, "open", x.current);
|
|
1628
|
+
t ? S.current = window.setTimeout(() => {
|
|
1629
|
+
y.current || i(!0, e, "hover");
|
|
1630
|
+
}, t) : n || i(!0, e, "hover");
|
|
1631
|
+
}
|
|
1632
|
+
function t(e) {
|
|
1633
|
+
if (N()) {
|
|
1634
|
+
M();
|
|
1635
|
+
return;
|
|
1636
|
+
}
|
|
1637
|
+
D.current();
|
|
1638
|
+
let t = q(s.floating);
|
|
1639
|
+
if ($(w), O.current = !1, _.current && a.current.floatingContext) {
|
|
1640
|
+
n || $(S), C.current = _.current({
|
|
1641
|
+
...a.current.floatingContext,
|
|
1642
|
+
tree: h,
|
|
1643
|
+
x: e.clientX,
|
|
1644
|
+
y: e.clientY,
|
|
1645
|
+
onClose() {
|
|
1646
|
+
M(), j(), N() || A(e, !0, "safe-polygon");
|
|
1647
|
+
}
|
|
1648
|
+
});
|
|
1649
|
+
let r = C.current;
|
|
1650
|
+
t.addEventListener("mousemove", r), D.current = () => {
|
|
1651
|
+
t.removeEventListener("mousemove", r);
|
|
1652
|
+
};
|
|
1653
|
+
return;
|
|
1654
|
+
}
|
|
1655
|
+
(x.current !== "touch" || !K(s.floating, e.relatedTarget)) && A(e);
|
|
1656
|
+
}
|
|
1657
|
+
function r(e) {
|
|
1658
|
+
N() || a.current.floatingContext && (_.current == null || _.current({
|
|
1659
|
+
...a.current.floatingContext,
|
|
1660
|
+
tree: h,
|
|
1661
|
+
x: e.clientX,
|
|
1662
|
+
y: e.clientY,
|
|
1663
|
+
onClose() {
|
|
1664
|
+
M(), j(), N() || A(e);
|
|
1665
|
+
}
|
|
1666
|
+
})(e));
|
|
1667
|
+
}
|
|
1668
|
+
function o() {
|
|
1669
|
+
$(S);
|
|
1670
|
+
}
|
|
1671
|
+
function l(e) {
|
|
1672
|
+
N() || A(e, !1);
|
|
1673
|
+
}
|
|
1674
|
+
if (m(s.domReference)) {
|
|
1675
|
+
let i = s.domReference, a = s.floating;
|
|
1676
|
+
return n && i.addEventListener("mouseleave", r), p && i.addEventListener("mousemove", e, { once: !0 }), i.addEventListener("mouseenter", e), i.addEventListener("mouseleave", t), a && (a.addEventListener("mouseleave", r), a.addEventListener("mouseenter", o), a.addEventListener("mouseleave", l)), () => {
|
|
1677
|
+
n && i.removeEventListener("mouseleave", r), p && i.removeEventListener("mousemove", e), i.removeEventListener("mouseenter", e), i.removeEventListener("mouseleave", t), a && (a.removeEventListener("mouseleave", r), a.removeEventListener("mouseenter", o), a.removeEventListener("mouseleave", l));
|
|
1678
|
+
};
|
|
1679
|
+
}
|
|
1680
|
+
}, [
|
|
1681
|
+
s,
|
|
1682
|
+
c,
|
|
1683
|
+
e,
|
|
1684
|
+
d,
|
|
1685
|
+
p,
|
|
1686
|
+
A,
|
|
1687
|
+
j,
|
|
1688
|
+
M,
|
|
1689
|
+
i,
|
|
1690
|
+
n,
|
|
1691
|
+
y,
|
|
1692
|
+
h,
|
|
1693
|
+
v,
|
|
1694
|
+
_,
|
|
1695
|
+
a,
|
|
1696
|
+
N,
|
|
1697
|
+
b
|
|
1698
|
+
]), Y(() => {
|
|
1699
|
+
var e;
|
|
1700
|
+
if (c && n && (e = _.current) != null && (e = e.__options) != null && e.blockPointerEvents && k()) {
|
|
1701
|
+
E.current = !0;
|
|
1702
|
+
let e = s.floating;
|
|
1703
|
+
if (m(s.domReference) && e) {
|
|
1704
|
+
var t;
|
|
1705
|
+
let n = q(s.floating).body;
|
|
1706
|
+
n.setAttribute(Qn, "");
|
|
1707
|
+
let r = s.domReference, i = h == null || (t = h.nodesRef.current.find((e) => e.id === g)) == null || (t = t.context) == null ? void 0 : t.elements.floating;
|
|
1708
|
+
return i && (i.style.pointerEvents = ""), n.style.pointerEvents = "none", r.style.pointerEvents = "auto", e.style.pointerEvents = "auto", () => {
|
|
1709
|
+
n.style.pointerEvents = "", r.style.pointerEvents = "", e.style.pointerEvents = "";
|
|
1710
|
+
};
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
}, [
|
|
1714
|
+
c,
|
|
1715
|
+
n,
|
|
1716
|
+
g,
|
|
1717
|
+
s,
|
|
1718
|
+
h,
|
|
1719
|
+
_,
|
|
1720
|
+
k
|
|
1721
|
+
]), Y(() => {
|
|
1722
|
+
n || (x.current = void 0, O.current = !1, j(), M());
|
|
1723
|
+
}, [
|
|
1724
|
+
n,
|
|
1725
|
+
j,
|
|
1726
|
+
M
|
|
1727
|
+
]), r.useEffect(() => () => {
|
|
1728
|
+
j(), $(S), $(w), M();
|
|
1729
|
+
}, [
|
|
1730
|
+
c,
|
|
1731
|
+
s.domReference,
|
|
1732
|
+
j,
|
|
1733
|
+
M
|
|
1734
|
+
]);
|
|
1735
|
+
let P = r.useMemo(() => {
|
|
1736
|
+
function e(e) {
|
|
1737
|
+
x.current = e.pointerType;
|
|
1738
|
+
}
|
|
1739
|
+
return {
|
|
1740
|
+
onPointerDown: e,
|
|
1741
|
+
onPointerEnter: e,
|
|
1742
|
+
onMouseMove(e) {
|
|
1743
|
+
let { nativeEvent: t } = e;
|
|
1744
|
+
function r() {
|
|
1745
|
+
!T.current && !y.current && i(!0, t, "hover");
|
|
1746
|
+
}
|
|
1747
|
+
d && !We(x.current) || n || er(b.current) === 0 || O.current && e.movementX ** 2 + e.movementY ** 2 < 2 || ($(w), x.current === "touch" ? r() : (O.current = !0, w.current = window.setTimeout(r, er(b.current))));
|
|
1748
|
+
}
|
|
1749
|
+
};
|
|
1750
|
+
}, [
|
|
1751
|
+
d,
|
|
1752
|
+
i,
|
|
1753
|
+
n,
|
|
1754
|
+
y,
|
|
1755
|
+
b
|
|
1756
|
+
]);
|
|
1757
|
+
return r.useMemo(() => c ? { reference: P } : {}, [c, P]);
|
|
1758
|
+
}
|
|
1759
|
+
var nr = 0;
|
|
1760
|
+
function rr(e, t) {
|
|
1761
|
+
t === void 0 && (t = {});
|
|
1762
|
+
let { preventScroll: n = !1, cancelPrevious: r = !0, sync: i = !1 } = t;
|
|
1763
|
+
r && cancelAnimationFrame(nr);
|
|
1764
|
+
let a = () => e?.focus({ preventScroll: n });
|
|
1765
|
+
i ? a() : nr = requestAnimationFrame(a);
|
|
1766
|
+
}
|
|
1767
|
+
function ir(e) {
|
|
1768
|
+
return e?.ownerDocument || document;
|
|
1769
|
+
}
|
|
1770
|
+
var ar = {
|
|
1771
|
+
inert: /* @__PURE__ */ new WeakMap(),
|
|
1772
|
+
"aria-hidden": /* @__PURE__ */ new WeakMap(),
|
|
1773
|
+
none: /* @__PURE__ */ new WeakMap()
|
|
1774
|
+
};
|
|
1775
|
+
function or(e) {
|
|
1776
|
+
return e === "inert" ? ar.inert : e === "aria-hidden" ? ar["aria-hidden"] : ar.none;
|
|
1777
|
+
}
|
|
1778
|
+
var sr = /* @__PURE__ */ new WeakSet(), cr = {}, lr = 0, ur = () => typeof HTMLElement < "u" && "inert" in HTMLElement.prototype;
|
|
1779
|
+
function dr(e) {
|
|
1780
|
+
return e ? g(e) ? e.host : dr(e.parentNode) : null;
|
|
1781
|
+
}
|
|
1782
|
+
var fr = (e, t) => t.map((t) => {
|
|
1783
|
+
if (e.contains(t)) return t;
|
|
1784
|
+
let n = dr(t);
|
|
1785
|
+
return e.contains(n) ? n : null;
|
|
1786
|
+
}).filter((e) => e != null);
|
|
1787
|
+
function pr(e, t, n, r) {
|
|
1788
|
+
let i = "data-floating-ui-inert", a = r ? "inert" : n ? "aria-hidden" : null, o = fr(t, e), s = /* @__PURE__ */ new Set(), c = new Set(o), l = [];
|
|
1789
|
+
cr[i] || (cr[i] = /* @__PURE__ */ new WeakMap());
|
|
1790
|
+
let d = cr[i];
|
|
1791
|
+
o.forEach(f), p(t), s.clear();
|
|
1792
|
+
function f(e) {
|
|
1793
|
+
!e || s.has(e) || (s.add(e), e.parentNode && f(e.parentNode));
|
|
1794
|
+
}
|
|
1795
|
+
function p(e) {
|
|
1796
|
+
!e || c.has(e) || [].forEach.call(e.children, (e) => {
|
|
1797
|
+
if (u(e) !== "script") if (s.has(e)) p(e);
|
|
1798
|
+
else {
|
|
1799
|
+
let t = a ? e.getAttribute(a) : null, n = t !== null && t !== "false", r = or(a), o = (r.get(e) || 0) + 1, s = (d.get(e) || 0) + 1;
|
|
1800
|
+
r.set(e, o), d.set(e, s), l.push(e), o === 1 && n && sr.add(e), s === 1 && e.setAttribute(i, ""), !n && a && e.setAttribute(a, a === "inert" ? "" : "true");
|
|
1801
|
+
}
|
|
1802
|
+
});
|
|
1803
|
+
}
|
|
1804
|
+
return lr++, () => {
|
|
1805
|
+
l.forEach((e) => {
|
|
1806
|
+
let t = or(a), n = (t.get(e) || 0) - 1, r = (d.get(e) || 0) - 1;
|
|
1807
|
+
t.set(e, n), d.set(e, r), n || (!sr.has(e) && a && e.removeAttribute(a), sr.delete(e)), r || e.removeAttribute(i);
|
|
1808
|
+
}), lr--, lr || (ar.inert = /* @__PURE__ */ new WeakMap(), ar["aria-hidden"] = /* @__PURE__ */ new WeakMap(), ar.none = /* @__PURE__ */ new WeakMap(), sr = /* @__PURE__ */ new WeakSet(), cr = {});
|
|
1809
|
+
};
|
|
1810
|
+
}
|
|
1811
|
+
function mr(e, t, n) {
|
|
1812
|
+
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
1813
|
+
let r = ir(e[0]).body;
|
|
1814
|
+
return pr(e.concat(Array.from(r.querySelectorAll("[aria-live],[role=\"status\"],output"))), r, t, n);
|
|
1815
|
+
}
|
|
1816
|
+
var hr = {
|
|
1817
|
+
border: 0,
|
|
1818
|
+
clip: "rect(0 0 0 0)",
|
|
1819
|
+
height: "1px",
|
|
1820
|
+
margin: "-1px",
|
|
1821
|
+
overflow: "hidden",
|
|
1822
|
+
padding: 0,
|
|
1823
|
+
position: "fixed",
|
|
1824
|
+
whiteSpace: "nowrap",
|
|
1825
|
+
width: "1px",
|
|
1826
|
+
top: 0,
|
|
1827
|
+
left: 0
|
|
1828
|
+
}, gr = /* @__PURE__ */ r.forwardRef(function(e, t) {
|
|
1829
|
+
let [n, i] = r.useState();
|
|
1830
|
+
Y(() => {
|
|
1831
|
+
be() && i("button");
|
|
1832
|
+
}, []);
|
|
1833
|
+
let a = {
|
|
1834
|
+
ref: t,
|
|
1835
|
+
tabIndex: 0,
|
|
1836
|
+
role: n,
|
|
1837
|
+
"aria-hidden": n ? void 0 : !0,
|
|
1838
|
+
[Zn("focus-guard")]: "",
|
|
1839
|
+
style: hr
|
|
1840
|
+
};
|
|
1841
|
+
return /* @__PURE__ */ o("span", {
|
|
1842
|
+
...e,
|
|
1843
|
+
...a
|
|
1844
|
+
});
|
|
1845
|
+
}), _r = {
|
|
1846
|
+
clipPath: "inset(50%)",
|
|
1847
|
+
position: "fixed",
|
|
1848
|
+
top: 0,
|
|
1849
|
+
left: 0
|
|
1850
|
+
}, vr = /* @__PURE__ */ r.createContext(null), yr = /* @__PURE__ */ Zn("portal");
|
|
1851
|
+
function br(e) {
|
|
1852
|
+
e === void 0 && (e = {});
|
|
1853
|
+
let { id: t, root: n } = e, i = zn(), a = Sr(), [o, s] = r.useState(null), c = r.useRef(null);
|
|
1854
|
+
return Y(() => () => {
|
|
1855
|
+
o?.remove(), queueMicrotask(() => {
|
|
1856
|
+
c.current = null;
|
|
1857
|
+
});
|
|
1858
|
+
}, [o]), Y(() => {
|
|
1859
|
+
if (!i || c.current) return;
|
|
1860
|
+
let e = t ? document.getElementById(t) : null;
|
|
1861
|
+
if (!e) return;
|
|
1862
|
+
let n = document.createElement("div");
|
|
1863
|
+
n.id = i, n.setAttribute(yr, ""), e.appendChild(n), c.current = n, s(n);
|
|
1864
|
+
}, [t, i]), Y(() => {
|
|
1865
|
+
if (n === null || !i || c.current) return;
|
|
1866
|
+
let e = n || a?.portalNode;
|
|
1867
|
+
e && !p(e) && (e = e.current), e ||= document.body;
|
|
1868
|
+
let r = null;
|
|
1869
|
+
t && (r = document.createElement("div"), r.id = t, e.appendChild(r));
|
|
1870
|
+
let o = document.createElement("div");
|
|
1871
|
+
o.id = i, o.setAttribute(yr, ""), e = r || e, e.appendChild(o), c.current = o, s(o);
|
|
1872
|
+
}, [
|
|
1873
|
+
t,
|
|
1874
|
+
n,
|
|
1875
|
+
i,
|
|
1876
|
+
a
|
|
1877
|
+
]), o;
|
|
1878
|
+
}
|
|
1879
|
+
function xr(e) {
|
|
1880
|
+
let { children: t, id: n, root: i, preserveTabOrder: a = !0 } = e, l = br({
|
|
1881
|
+
id: n,
|
|
1882
|
+
root: i
|
|
1883
|
+
}), [u, d] = r.useState(null), f = r.useRef(null), p = r.useRef(null), m = r.useRef(null), h = r.useRef(null), g = u?.modal, _ = u?.open, v = !!u && !u.modal && u.open && a && !!(i || l);
|
|
1884
|
+
return r.useEffect(() => {
|
|
1885
|
+
if (!l || !a || g) return;
|
|
1886
|
+
function e(e) {
|
|
1887
|
+
l && ot(e) && (e.type === "focusin" ? ct : st)(l);
|
|
1888
|
+
}
|
|
1889
|
+
return l.addEventListener("focusin", e, !0), l.addEventListener("focusout", e, !0), () => {
|
|
1890
|
+
l.removeEventListener("focusin", e, !0), l.removeEventListener("focusout", e, !0);
|
|
1891
|
+
};
|
|
1892
|
+
}, [
|
|
1893
|
+
l,
|
|
1894
|
+
a,
|
|
1895
|
+
g
|
|
1896
|
+
]), r.useEffect(() => {
|
|
1897
|
+
l && (_ || ct(l));
|
|
1898
|
+
}, [_, l]), /* @__PURE__ */ s(vr.Provider, {
|
|
1899
|
+
value: r.useMemo(() => ({
|
|
1900
|
+
preserveTabOrder: a,
|
|
1901
|
+
beforeOutsideRef: f,
|
|
1902
|
+
afterOutsideRef: p,
|
|
1903
|
+
beforeInsideRef: m,
|
|
1904
|
+
afterInsideRef: h,
|
|
1905
|
+
portalNode: l,
|
|
1906
|
+
setFocusManagerState: d
|
|
1907
|
+
}), [a, l]),
|
|
1908
|
+
children: [
|
|
1909
|
+
v && l && /* @__PURE__ */ o(gr, {
|
|
1910
|
+
"data-type": "outside",
|
|
1911
|
+
ref: f,
|
|
1912
|
+
onFocus: (e) => {
|
|
1913
|
+
if (ot(e, l)) {
|
|
1914
|
+
var t;
|
|
1915
|
+
(t = m.current) == null || t.focus();
|
|
1916
|
+
} else at(u ? u.domReference : null)?.focus();
|
|
1917
|
+
}
|
|
1918
|
+
}),
|
|
1919
|
+
v && l && /* @__PURE__ */ o("span", {
|
|
1920
|
+
"aria-owns": l.id,
|
|
1921
|
+
style: _r
|
|
1922
|
+
}),
|
|
1923
|
+
l && /* @__PURE__ */ c.createPortal(t, l),
|
|
1924
|
+
v && l && /* @__PURE__ */ o(gr, {
|
|
1925
|
+
"data-type": "outside",
|
|
1926
|
+
ref: p,
|
|
1927
|
+
onFocus: (e) => {
|
|
1928
|
+
if (ot(e, l)) {
|
|
1929
|
+
var t;
|
|
1930
|
+
(t = h.current) == null || t.focus();
|
|
1931
|
+
} else it(u ? u.domReference : null)?.focus(), u != null && u.closeOnFocusOut && u?.onOpenChange(!1, e.nativeEvent, "focus-out");
|
|
1932
|
+
}
|
|
1933
|
+
})
|
|
1934
|
+
]
|
|
1935
|
+
});
|
|
1936
|
+
}
|
|
1937
|
+
var Sr = () => r.useContext(vr);
|
|
1938
|
+
function Cr(e) {
|
|
1939
|
+
return r.useMemo(() => (t) => {
|
|
1940
|
+
e.forEach((e) => {
|
|
1941
|
+
e && (e.current = t);
|
|
1942
|
+
});
|
|
1943
|
+
}, e);
|
|
1944
|
+
}
|
|
1945
|
+
var wr = 20, Tr = [];
|
|
1946
|
+
function Er() {
|
|
1947
|
+
Tr = Tr.filter((e) => e.deref()?.isConnected);
|
|
1948
|
+
}
|
|
1949
|
+
function Dr(e) {
|
|
1950
|
+
Er(), e && u(e) !== "body" && (Tr.push(new WeakRef(e)), Tr.length > wr && (Tr = Tr.slice(-wr)));
|
|
1951
|
+
}
|
|
1952
|
+
function Or() {
|
|
1953
|
+
return Er(), Tr[Tr.length - 1]?.deref();
|
|
1954
|
+
}
|
|
1955
|
+
function kr(n) {
|
|
1956
|
+
let r = nt();
|
|
1957
|
+
return e(n, r) ? n : t(n, r)[0] || n;
|
|
1958
|
+
}
|
|
1959
|
+
function Ar(t, r) {
|
|
1960
|
+
var i;
|
|
1961
|
+
if (!r.current.includes("floating") && !((i = t.getAttribute("role")) != null && i.includes("dialog"))) return;
|
|
1962
|
+
let a = nt(), o = n(t, a).filter((t) => {
|
|
1963
|
+
let n = t.getAttribute("data-tabindex") || "";
|
|
1964
|
+
return e(t, a) || t.hasAttribute("data-tabindex") && !n.startsWith("-");
|
|
1965
|
+
}), s = t.getAttribute("tabindex");
|
|
1966
|
+
r.current.includes("floating") || o.length === 0 ? s !== "0" && t.setAttribute("tabindex", "0") : (s !== "-1" || t.hasAttribute("data-tabindex") && t.getAttribute("data-tabindex") !== "-1") && (t.setAttribute("tabindex", "-1"), t.setAttribute("data-tabindex", "-1"));
|
|
1967
|
+
}
|
|
1968
|
+
var jr = /* @__PURE__ */ r.forwardRef(function(e, t) {
|
|
1969
|
+
return /* @__PURE__ */ o("button", {
|
|
1970
|
+
...e,
|
|
1971
|
+
type: "button",
|
|
1972
|
+
ref: t,
|
|
1973
|
+
tabIndex: -1,
|
|
1974
|
+
style: hr
|
|
1975
|
+
});
|
|
1976
|
+
});
|
|
1977
|
+
function Mr(e) {
|
|
1978
|
+
let { context: n, children: i, disabled: c = !1, order: l = ["content"], guards: u = !0, initialFocus: d = 0, returnFocus: f = !0, restoreFocus: p = !1, modal: m = !0, visuallyHiddenDismiss: g = !1, closeOnFocusOut: _ = !0, outsideElementsInert: v = !1, getInsideElements: y = () => [] } = e, { open: b, onOpenChange: x, events: S, dataRef: C, elements: { domReference: w, floating: T } } = n, E = Z(() => C.current.floatingContext?.nodeId), D = Z(y), O = typeof d == "number" && d < 0, k = Fe(w) && O, A = ur(), j = A ? u : !0, M = !j || A && v, N = X(l), P = X(d), F = X(f), I = qn(), L = Sr(), R = r.useRef(null), ee = r.useRef(null), z = r.useRef(!1), B = r.useRef(!1), te = r.useRef(-1), ne = r.useRef(-1), V = L != null, H = Le(T), U = Z(function(e) {
|
|
1979
|
+
return e === void 0 && (e = H), e ? t(e, nt()) : [];
|
|
1980
|
+
}), W = Z((e) => {
|
|
1981
|
+
let t = U(e);
|
|
1982
|
+
return N.current.map((e) => w && e === "reference" ? w : H && e === "floating" ? H : t).filter(Boolean).flat();
|
|
1983
|
+
});
|
|
1984
|
+
r.useEffect(() => {
|
|
1985
|
+
if (c || !m) return;
|
|
1986
|
+
function e(e) {
|
|
1987
|
+
if (e.key === "Tab") {
|
|
1988
|
+
K(H, Ae(q(H))) && U().length === 0 && !k && J(e);
|
|
1989
|
+
let t = W(), n = je(e);
|
|
1990
|
+
N.current[0] === "reference" && n === w && (J(e), e.shiftKey ? rr(t[t.length - 1]) : rr(t[1])), N.current[1] === "floating" && n === H && e.shiftKey && (J(e), rr(t[0]));
|
|
1991
|
+
}
|
|
1992
|
+
}
|
|
1993
|
+
let t = q(H);
|
|
1994
|
+
return t.addEventListener("keydown", e), () => {
|
|
1995
|
+
t.removeEventListener("keydown", e);
|
|
1996
|
+
};
|
|
1997
|
+
}, [
|
|
1998
|
+
c,
|
|
1999
|
+
w,
|
|
2000
|
+
H,
|
|
2001
|
+
m,
|
|
2002
|
+
N,
|
|
2003
|
+
k,
|
|
2004
|
+
U,
|
|
2005
|
+
W
|
|
2006
|
+
]), r.useEffect(() => {
|
|
2007
|
+
if (c || !T) return;
|
|
2008
|
+
function e(e) {
|
|
2009
|
+
let t = je(e), n = U().indexOf(t);
|
|
2010
|
+
n !== -1 && (te.current = n);
|
|
2011
|
+
}
|
|
2012
|
+
return T.addEventListener("focusin", e), () => {
|
|
2013
|
+
T.removeEventListener("focusin", e);
|
|
2014
|
+
};
|
|
2015
|
+
}, [
|
|
2016
|
+
c,
|
|
2017
|
+
T,
|
|
2018
|
+
U
|
|
2019
|
+
]), r.useEffect(() => {
|
|
2020
|
+
if (c || !_) return;
|
|
2021
|
+
function e() {
|
|
2022
|
+
B.current = !0, setTimeout(() => {
|
|
2023
|
+
B.current = !1;
|
|
2024
|
+
});
|
|
2025
|
+
}
|
|
2026
|
+
function t(e) {
|
|
2027
|
+
let t = e.relatedTarget, n = e.currentTarget, r = je(e);
|
|
2028
|
+
queueMicrotask(() => {
|
|
2029
|
+
let i = E(), a = !(K(w, t) || K(T, t) || K(t, T) || K(L?.portalNode, t) || t != null && t.hasAttribute(Zn("focus-guard")) || I && (Re(I.nodesRef.current, i).find((e) => K(e.context?.elements.floating, t) || K(e.context?.elements.domReference, t)) || Be(I.nodesRef.current, i).find((e) => [e.context?.elements.floating, Le(e.context?.elements.floating)].includes(t) || e.context?.elements.domReference === t)));
|
|
2030
|
+
if (n === w && H && Ar(H, N), p && n !== w && !(r != null && r.isConnected) && Ae(q(H)) === q(H).body) {
|
|
2031
|
+
h(H) && H.focus();
|
|
2032
|
+
let e = te.current, t = U(), n = t[e] || t[t.length - 1] || H;
|
|
2033
|
+
h(n) && n.focus();
|
|
2034
|
+
}
|
|
2035
|
+
if (C.current.insideReactTree) {
|
|
2036
|
+
C.current.insideReactTree = !1;
|
|
2037
|
+
return;
|
|
2038
|
+
}
|
|
2039
|
+
(k || !m) && t && a && !B.current && t !== Or() && (z.current = !0, x(!1, e, "focus-out"));
|
|
2040
|
+
});
|
|
2041
|
+
}
|
|
2042
|
+
let n = !!(!I && L);
|
|
2043
|
+
function r() {
|
|
2044
|
+
$(ne), C.current.insideReactTree = !0, ne.current = window.setTimeout(() => {
|
|
2045
|
+
C.current.insideReactTree = !1;
|
|
2046
|
+
});
|
|
2047
|
+
}
|
|
2048
|
+
if (T && h(w)) return w.addEventListener("focusout", t), w.addEventListener("pointerdown", e), T.addEventListener("focusout", t), n && T.addEventListener("focusout", r, !0), () => {
|
|
2049
|
+
w.removeEventListener("focusout", t), w.removeEventListener("pointerdown", e), T.removeEventListener("focusout", t), n && T.removeEventListener("focusout", r, !0);
|
|
2050
|
+
};
|
|
2051
|
+
}, [
|
|
2052
|
+
c,
|
|
2053
|
+
w,
|
|
2054
|
+
T,
|
|
2055
|
+
H,
|
|
2056
|
+
m,
|
|
2057
|
+
I,
|
|
2058
|
+
L,
|
|
2059
|
+
x,
|
|
2060
|
+
_,
|
|
2061
|
+
p,
|
|
2062
|
+
U,
|
|
2063
|
+
k,
|
|
2064
|
+
E,
|
|
2065
|
+
N,
|
|
2066
|
+
C
|
|
2067
|
+
]);
|
|
2068
|
+
let re = r.useRef(null), G = r.useRef(null), ie = Cr([re, L?.beforeInsideRef]), ae = Cr([G, L?.afterInsideRef]);
|
|
2069
|
+
r.useEffect(() => {
|
|
2070
|
+
var e, t;
|
|
2071
|
+
if (c || !T) return;
|
|
2072
|
+
let n = Array.from((L == null || (e = L.portalNode) == null ? void 0 : e.querySelectorAll("[" + Zn("portal") + "]")) || []), r = [
|
|
2073
|
+
T,
|
|
2074
|
+
(t = (I ? Be(I.nodesRef.current, E()) : []).find((e) => Fe(e.context?.elements.domReference || null))) == null || (t = t.context) == null ? void 0 : t.elements.domReference,
|
|
2075
|
+
...n,
|
|
2076
|
+
...D(),
|
|
2077
|
+
R.current,
|
|
2078
|
+
ee.current,
|
|
2079
|
+
re.current,
|
|
2080
|
+
G.current,
|
|
2081
|
+
L?.beforeOutsideRef.current,
|
|
2082
|
+
L?.afterOutsideRef.current,
|
|
2083
|
+
N.current.includes("reference") || k ? w : null
|
|
2084
|
+
].filter((e) => e != null), i = m || k ? mr(r, !M, M) : mr(r);
|
|
2085
|
+
return () => {
|
|
2086
|
+
i();
|
|
2087
|
+
};
|
|
2088
|
+
}, [
|
|
2089
|
+
c,
|
|
2090
|
+
w,
|
|
2091
|
+
T,
|
|
2092
|
+
m,
|
|
2093
|
+
N,
|
|
2094
|
+
L,
|
|
2095
|
+
k,
|
|
2096
|
+
j,
|
|
2097
|
+
M,
|
|
2098
|
+
I,
|
|
2099
|
+
E,
|
|
2100
|
+
D
|
|
2101
|
+
]), Y(() => {
|
|
2102
|
+
if (c || !h(H)) return;
|
|
2103
|
+
let e = Ae(q(H));
|
|
2104
|
+
queueMicrotask(() => {
|
|
2105
|
+
let t = W(H), n = P.current, r = (typeof n == "number" ? t[n] : n.current) || H, i = K(H, e);
|
|
2106
|
+
!O && !i && b && rr(r, { preventScroll: r === H });
|
|
2107
|
+
});
|
|
2108
|
+
}, [
|
|
2109
|
+
c,
|
|
2110
|
+
b,
|
|
2111
|
+
H,
|
|
2112
|
+
O,
|
|
2113
|
+
W,
|
|
2114
|
+
P
|
|
2115
|
+
]), Y(() => {
|
|
2116
|
+
if (c || !H) return;
|
|
2117
|
+
let e = q(H);
|
|
2118
|
+
Dr(Ae(e));
|
|
2119
|
+
function t(e) {
|
|
2120
|
+
let { reason: t, event: n, nested: r } = e;
|
|
2121
|
+
if (["hover", "safe-polygon"].includes(t) && n.type === "mouseleave" && (z.current = !0), t === "outside-press") if (r) z.current = !1;
|
|
2122
|
+
else if (He(n) || Ue(n)) z.current = !1;
|
|
2123
|
+
else {
|
|
2124
|
+
let e = !1;
|
|
2125
|
+
document.createElement("div").focus({ get preventScroll() {
|
|
2126
|
+
return e = !0, !1;
|
|
2127
|
+
} }), e ? z.current = !1 : z.current = !0;
|
|
2128
|
+
}
|
|
2129
|
+
}
|
|
2130
|
+
S.on("openchange", t);
|
|
2131
|
+
let n = e.createElement("span");
|
|
2132
|
+
n.setAttribute("tabindex", "-1"), n.setAttribute("aria-hidden", "true"), Object.assign(n.style, hr), V && w && w.insertAdjacentElement("afterend", n);
|
|
2133
|
+
function r() {
|
|
2134
|
+
if (typeof F.current == "boolean") {
|
|
2135
|
+
let e = w || Or();
|
|
2136
|
+
return e && e.isConnected ? e : n;
|
|
2137
|
+
}
|
|
2138
|
+
return F.current.current || n;
|
|
2139
|
+
}
|
|
2140
|
+
return () => {
|
|
2141
|
+
S.off("openchange", t);
|
|
2142
|
+
let i = Ae(e), a = K(T, i) || I && Re(I.nodesRef.current, E(), !1).some((e) => K(e.context?.elements.floating, i)), o = r();
|
|
2143
|
+
queueMicrotask(() => {
|
|
2144
|
+
let t = kr(o);
|
|
2145
|
+
F.current && !z.current && h(t) && (!(t !== i && i !== e.body) || a) && t.focus({ preventScroll: !0 }), n.remove();
|
|
2146
|
+
});
|
|
2147
|
+
};
|
|
2148
|
+
}, [
|
|
2149
|
+
c,
|
|
2150
|
+
T,
|
|
2151
|
+
H,
|
|
2152
|
+
F,
|
|
2153
|
+
C,
|
|
2154
|
+
S,
|
|
2155
|
+
I,
|
|
2156
|
+
V,
|
|
2157
|
+
w,
|
|
2158
|
+
E
|
|
2159
|
+
]), r.useEffect(() => (queueMicrotask(() => {
|
|
2160
|
+
z.current = !1;
|
|
2161
|
+
}), () => {
|
|
2162
|
+
queueMicrotask(Er);
|
|
2163
|
+
}), [c]), Y(() => {
|
|
2164
|
+
if (!c && L) return L.setFocusManagerState({
|
|
2165
|
+
modal: m,
|
|
2166
|
+
closeOnFocusOut: _,
|
|
2167
|
+
open: b,
|
|
2168
|
+
onOpenChange: x,
|
|
2169
|
+
domReference: w
|
|
2170
|
+
}), () => {
|
|
2171
|
+
L.setFocusManagerState(null);
|
|
2172
|
+
};
|
|
2173
|
+
}, [
|
|
2174
|
+
c,
|
|
2175
|
+
L,
|
|
2176
|
+
m,
|
|
2177
|
+
b,
|
|
2178
|
+
x,
|
|
2179
|
+
_,
|
|
2180
|
+
w
|
|
2181
|
+
]), Y(() => {
|
|
2182
|
+
c || H && Ar(H, N);
|
|
2183
|
+
}, [
|
|
2184
|
+
c,
|
|
2185
|
+
H,
|
|
2186
|
+
N
|
|
2187
|
+
]);
|
|
2188
|
+
function oe(e) {
|
|
2189
|
+
return c || !g || !m ? null : /* @__PURE__ */ o(jr, {
|
|
2190
|
+
ref: e === "start" ? R : ee,
|
|
2191
|
+
onClick: (e) => x(!1, e.nativeEvent),
|
|
2192
|
+
children: typeof g == "string" ? g : "Dismiss"
|
|
2193
|
+
});
|
|
2194
|
+
}
|
|
2195
|
+
let se = !c && j && (m ? !k : !0) && (V || m);
|
|
2196
|
+
return /* @__PURE__ */ s(a, { children: [
|
|
2197
|
+
se && /* @__PURE__ */ o(gr, {
|
|
2198
|
+
"data-type": "inside",
|
|
2199
|
+
ref: ie,
|
|
2200
|
+
onFocus: (e) => {
|
|
2201
|
+
if (m) {
|
|
2202
|
+
let e = W();
|
|
2203
|
+
rr(l[0] === "reference" ? e[0] : e[e.length - 1]);
|
|
2204
|
+
} else if (L != null && L.preserveTabOrder && L.portalNode) if (z.current = !1, ot(e, L.portalNode)) it(w)?.focus();
|
|
2205
|
+
else {
|
|
2206
|
+
var t;
|
|
2207
|
+
(t = L.beforeOutsideRef.current) == null || t.focus();
|
|
2208
|
+
}
|
|
2209
|
+
}
|
|
2210
|
+
}),
|
|
2211
|
+
!k && oe("start"),
|
|
2212
|
+
i,
|
|
2213
|
+
oe("end"),
|
|
2214
|
+
se && /* @__PURE__ */ o(gr, {
|
|
2215
|
+
"data-type": "inside",
|
|
2216
|
+
ref: ae,
|
|
2217
|
+
onFocus: (e) => {
|
|
2218
|
+
if (m) rr(W()[0]);
|
|
2219
|
+
else if (L != null && L.preserveTabOrder && L.portalNode) if (_ && (z.current = !0), ot(e, L.portalNode)) at(w)?.focus();
|
|
2220
|
+
else {
|
|
2221
|
+
var t;
|
|
2222
|
+
(t = L.afterOutsideRef.current) == null || t.focus();
|
|
2223
|
+
}
|
|
2224
|
+
}
|
|
2225
|
+
})
|
|
2226
|
+
] });
|
|
2227
|
+
}
|
|
2228
|
+
var Nr = 0, Pr = "--floating-ui-scrollbar-width";
|
|
2229
|
+
function Fr() {
|
|
2230
|
+
let e = ve(), t = /iP(hone|ad|od)|iOS/.test(e) || e === "MacIntel" && navigator.maxTouchPoints > 1, n = document.body.style, r = Math.round(document.documentElement.getBoundingClientRect().left) + document.documentElement.scrollLeft ? "paddingLeft" : "paddingRight", i = window.innerWidth - document.documentElement.clientWidth, a = n.left ? parseFloat(n.left) : window.scrollX, o = n.top ? parseFloat(n.top) : window.scrollY;
|
|
2231
|
+
if (n.overflow = "hidden", n.setProperty(Pr, i + "px"), i && (n[r] = i + "px"), t) {
|
|
2232
|
+
let e = window.visualViewport?.offsetLeft || 0, t = window.visualViewport?.offsetTop || 0;
|
|
2233
|
+
Object.assign(n, {
|
|
2234
|
+
position: "fixed",
|
|
2235
|
+
top: -(o - Math.floor(t)) + "px",
|
|
2236
|
+
left: -(a - Math.floor(e)) + "px",
|
|
2237
|
+
right: "0"
|
|
2238
|
+
});
|
|
2239
|
+
}
|
|
2240
|
+
return () => {
|
|
2241
|
+
Object.assign(n, {
|
|
2242
|
+
overflow: "",
|
|
2243
|
+
[r]: ""
|
|
2244
|
+
}), n.removeProperty(Pr), t && (Object.assign(n, {
|
|
2245
|
+
position: "",
|
|
2246
|
+
top: "",
|
|
2247
|
+
left: "",
|
|
2248
|
+
right: ""
|
|
2249
|
+
}), window.scrollTo(a, o));
|
|
2250
|
+
};
|
|
2251
|
+
}
|
|
2252
|
+
var Ir = () => {}, Lr = /* @__PURE__ */ r.forwardRef(function(e, t) {
|
|
2253
|
+
let { lockScroll: n = !1, ...r } = e;
|
|
2254
|
+
return Y(() => {
|
|
2255
|
+
if (n) return Nr++, Nr === 1 && (Ir = Fr()), () => {
|
|
2256
|
+
Nr--, Nr === 0 && Ir();
|
|
2257
|
+
};
|
|
2258
|
+
}, [n]), /* @__PURE__ */ o("div", {
|
|
2259
|
+
ref: t,
|
|
2260
|
+
...r,
|
|
2261
|
+
style: {
|
|
2262
|
+
position: "fixed",
|
|
2263
|
+
overflow: "auto",
|
|
2264
|
+
top: 0,
|
|
2265
|
+
right: 0,
|
|
2266
|
+
bottom: 0,
|
|
2267
|
+
left: 0,
|
|
2268
|
+
...r.style
|
|
2269
|
+
}
|
|
2270
|
+
});
|
|
2271
|
+
});
|
|
2272
|
+
function Rr(e) {
|
|
2273
|
+
return h(e.target) && e.target.tagName === "BUTTON";
|
|
2274
|
+
}
|
|
2275
|
+
function zr(e) {
|
|
2276
|
+
return h(e.target) && e.target.tagName === "A";
|
|
2277
|
+
}
|
|
2278
|
+
function Br(e) {
|
|
2279
|
+
return Pe(e);
|
|
2280
|
+
}
|
|
2281
|
+
function Vr(e, t) {
|
|
2282
|
+
t === void 0 && (t = {});
|
|
2283
|
+
let { open: n, onOpenChange: i, dataRef: a, elements: { domReference: o } } = e, { enabled: s = !0, event: c = "click", toggle: l = !0, ignoreMouse: u = !1, keyboardHandlers: d = !0, stickIfOpen: f = !0 } = t, p = r.useRef(), m = r.useRef(!1), h = r.useMemo(() => ({
|
|
2284
|
+
onPointerDown(e) {
|
|
2285
|
+
p.current = e.pointerType;
|
|
2286
|
+
},
|
|
2287
|
+
onMouseDown(e) {
|
|
2288
|
+
let t = p.current;
|
|
2289
|
+
e.button === 0 && c !== "click" && (We(t, !0) && u || (n && l && (!(a.current.openEvent && f) || a.current.openEvent.type === "mousedown") ? i(!1, e.nativeEvent, "click") : (e.preventDefault(), i(!0, e.nativeEvent, "click"))));
|
|
2290
|
+
},
|
|
2291
|
+
onClick(e) {
|
|
2292
|
+
let t = p.current;
|
|
2293
|
+
if (c === "mousedown" && p.current) {
|
|
2294
|
+
p.current = void 0;
|
|
2295
|
+
return;
|
|
2296
|
+
}
|
|
2297
|
+
We(t, !0) && u || (n && l && (!(a.current.openEvent && f) || a.current.openEvent.type === "click") ? i(!1, e.nativeEvent, "click") : i(!0, e.nativeEvent, "click"));
|
|
2298
|
+
},
|
|
2299
|
+
onKeyDown(e) {
|
|
2300
|
+
p.current = void 0, !(e.defaultPrevented || !d || Rr(e)) && (e.key === " " && !Br(o) && (e.preventDefault(), m.current = !0), !zr(e) && e.key === "Enter" && i(!(n && l), e.nativeEvent, "click"));
|
|
2301
|
+
},
|
|
2302
|
+
onKeyUp(e) {
|
|
2303
|
+
e.defaultPrevented || !d || Rr(e) || Br(o) || e.key === " " && m.current && (m.current = !1, i(!(n && l), e.nativeEvent, "click"));
|
|
2304
|
+
}
|
|
2305
|
+
}), [
|
|
2306
|
+
a,
|
|
2307
|
+
o,
|
|
2308
|
+
c,
|
|
2309
|
+
u,
|
|
2310
|
+
d,
|
|
2311
|
+
i,
|
|
2312
|
+
n,
|
|
2313
|
+
f,
|
|
2314
|
+
l
|
|
2315
|
+
]);
|
|
2316
|
+
return r.useMemo(() => s ? { reference: h } : {}, [s, h]);
|
|
2317
|
+
}
|
|
2318
|
+
var Hr = {
|
|
2319
|
+
pointerdown: "onPointerDown",
|
|
2320
|
+
mousedown: "onMouseDown",
|
|
2321
|
+
click: "onClick"
|
|
2322
|
+
}, Ur = {
|
|
2323
|
+
pointerdown: "onPointerDownCapture",
|
|
2324
|
+
mousedown: "onMouseDownCapture",
|
|
2325
|
+
click: "onClickCapture"
|
|
2326
|
+
}, Wr = (e) => ({
|
|
2327
|
+
escapeKey: typeof e == "boolean" ? e : e?.escapeKey ?? !1,
|
|
2328
|
+
outsidePress: typeof e == "boolean" ? e : e?.outsidePress ?? !0
|
|
2329
|
+
});
|
|
2330
|
+
function Gr(e, t) {
|
|
2331
|
+
t === void 0 && (t = {});
|
|
2332
|
+
let { open: n, onOpenChange: i, elements: a, dataRef: o } = e, { enabled: s = !0, escapeKey: c = !0, outsidePress: l = !0, outsidePressEvent: u = "pointerdown", referencePress: d = !1, referencePressEvent: f = "pointerdown", ancestorScroll: p = !1, bubbles: g, capture: _ } = t, v = qn(), y = Z(typeof l == "function" ? l : () => !1), b = typeof l == "function" ? y : l, x = r.useRef(!1), { escapeKey: S, outsidePress: C } = Wr(g), { escapeKey: w, outsidePress: T } = Wr(_), k = r.useRef(!1), j = Z((e) => {
|
|
2333
|
+
if (!n || !s || !c || e.key !== "Escape" || k.current) return;
|
|
2334
|
+
let t = o.current.floatingContext?.nodeId, r = v ? Re(v.nodesRef.current, t) : [];
|
|
2335
|
+
if (!S && (e.stopPropagation(), r.length > 0)) {
|
|
2336
|
+
let e = !0;
|
|
2337
|
+
if (r.forEach((t) => {
|
|
2338
|
+
var n;
|
|
2339
|
+
if ((n = t.context) != null && n.open && !t.context.dataRef.current.__escapeKeyBubbles) {
|
|
2340
|
+
e = !1;
|
|
2341
|
+
return;
|
|
2342
|
+
}
|
|
2343
|
+
}), !e) return;
|
|
2344
|
+
}
|
|
2345
|
+
i(!1, Ve(e) ? e.nativeEvent : e, "escape-key");
|
|
2346
|
+
}), N = Z((e) => {
|
|
2347
|
+
var t;
|
|
2348
|
+
let n = () => {
|
|
2349
|
+
var t;
|
|
2350
|
+
j(e), (t = je(e)) == null || t.removeEventListener("keydown", n);
|
|
2351
|
+
};
|
|
2352
|
+
(t = je(e)) == null || t.addEventListener("keydown", n);
|
|
2353
|
+
}), P = Z((e) => {
|
|
2354
|
+
let t = o.current.insideReactTree;
|
|
2355
|
+
o.current.insideReactTree = !1;
|
|
2356
|
+
let n = x.current;
|
|
2357
|
+
if (x.current = !1, u === "click" && n || t || typeof b == "function" && !b(e)) return;
|
|
2358
|
+
let r = je(e), s = "[" + Zn("inert") + "]", c = q(a.floating).querySelectorAll(s), l = m(r) ? r : null;
|
|
2359
|
+
for (; l && !D(l);) {
|
|
2360
|
+
let e = A(l);
|
|
2361
|
+
if (D(e) || !m(e)) break;
|
|
2362
|
+
l = e;
|
|
2363
|
+
}
|
|
2364
|
+
if (c.length && m(r) && !Ne(r) && !K(r, a.floating) && Array.from(c).every((e) => !K(l, e))) return;
|
|
2365
|
+
if (h(r) && L) {
|
|
2366
|
+
let t = D(r), n = O(r), i = /auto|scroll/, a = t || i.test(n.overflowX), o = t || i.test(n.overflowY), s = a && r.clientWidth > 0 && r.scrollWidth > r.clientWidth, c = o && r.clientHeight > 0 && r.scrollHeight > r.clientHeight, l = n.direction === "rtl", u = c && (l ? e.offsetX <= r.offsetWidth - r.clientWidth : e.offsetX > r.clientWidth), d = s && e.offsetY > r.clientHeight;
|
|
2367
|
+
if (u || d) return;
|
|
2368
|
+
}
|
|
2369
|
+
let d = o.current.floatingContext?.nodeId, f = v && Re(v.nodesRef.current, d).some((t) => Me(e, t.context?.elements.floating));
|
|
2370
|
+
if (Me(e, a.floating) || Me(e, a.domReference) || f) return;
|
|
2371
|
+
let p = v ? Re(v.nodesRef.current, d) : [];
|
|
2372
|
+
if (p.length > 0) {
|
|
2373
|
+
let e = !0;
|
|
2374
|
+
if (p.forEach((t) => {
|
|
2375
|
+
var n;
|
|
2376
|
+
if ((n = t.context) != null && n.open && !t.context.dataRef.current.__outsidePressBubbles) {
|
|
2377
|
+
e = !1;
|
|
2378
|
+
return;
|
|
2379
|
+
}
|
|
2380
|
+
}), !e) return;
|
|
2381
|
+
}
|
|
2382
|
+
i(!1, e, "outside-press");
|
|
2383
|
+
}), F = Z((e) => {
|
|
2384
|
+
var t;
|
|
2385
|
+
let n = () => {
|
|
2386
|
+
var t;
|
|
2387
|
+
P(e), (t = je(e)) == null || t.removeEventListener(u, n);
|
|
2388
|
+
};
|
|
2389
|
+
(t = je(e)) == null || t.addEventListener(u, n);
|
|
2390
|
+
});
|
|
2391
|
+
r.useEffect(() => {
|
|
2392
|
+
if (!n || !s) return;
|
|
2393
|
+
o.current.__escapeKeyBubbles = S, o.current.__outsidePressBubbles = C;
|
|
2394
|
+
let e = -1;
|
|
2395
|
+
function t(e) {
|
|
2396
|
+
i(!1, e, "ancestor-scroll");
|
|
2397
|
+
}
|
|
2398
|
+
function r() {
|
|
2399
|
+
window.clearTimeout(e), k.current = !0;
|
|
2400
|
+
}
|
|
2401
|
+
function l() {
|
|
2402
|
+
e = window.setTimeout(() => {
|
|
2403
|
+
k.current = !1;
|
|
2404
|
+
}, E() ? 5 : 0);
|
|
2405
|
+
}
|
|
2406
|
+
let d = q(a.floating);
|
|
2407
|
+
c && (d.addEventListener("keydown", w ? N : j, w), d.addEventListener("compositionstart", r), d.addEventListener("compositionend", l)), b && d.addEventListener(u, T ? F : P, T);
|
|
2408
|
+
let f = [];
|
|
2409
|
+
return p && (m(a.domReference) && (f = M(a.domReference)), m(a.floating) && (f = f.concat(M(a.floating))), !m(a.reference) && a.reference && a.reference.contextElement && (f = f.concat(M(a.reference.contextElement)))), f = f.filter((e) => e !== d.defaultView?.visualViewport), f.forEach((e) => {
|
|
2410
|
+
e.addEventListener("scroll", t, { passive: !0 });
|
|
2411
|
+
}), () => {
|
|
2412
|
+
c && (d.removeEventListener("keydown", w ? N : j, w), d.removeEventListener("compositionstart", r), d.removeEventListener("compositionend", l)), b && d.removeEventListener(u, T ? F : P, T), f.forEach((e) => {
|
|
2413
|
+
e.removeEventListener("scroll", t);
|
|
2414
|
+
}), window.clearTimeout(e);
|
|
2415
|
+
};
|
|
2416
|
+
}, [
|
|
2417
|
+
o,
|
|
2418
|
+
a,
|
|
2419
|
+
c,
|
|
2420
|
+
b,
|
|
2421
|
+
u,
|
|
2422
|
+
n,
|
|
2423
|
+
i,
|
|
2424
|
+
p,
|
|
2425
|
+
s,
|
|
2426
|
+
S,
|
|
2427
|
+
C,
|
|
2428
|
+
j,
|
|
2429
|
+
w,
|
|
2430
|
+
N,
|
|
2431
|
+
P,
|
|
2432
|
+
T,
|
|
2433
|
+
F
|
|
2434
|
+
]), r.useEffect(() => {
|
|
2435
|
+
o.current.insideReactTree = !1;
|
|
2436
|
+
}, [
|
|
2437
|
+
o,
|
|
2438
|
+
b,
|
|
2439
|
+
u
|
|
2440
|
+
]);
|
|
2441
|
+
let I = r.useMemo(() => ({
|
|
2442
|
+
onKeyDown: j,
|
|
2443
|
+
...d && {
|
|
2444
|
+
[Hr[f]]: (e) => {
|
|
2445
|
+
i(!1, e.nativeEvent, "reference-press");
|
|
2446
|
+
},
|
|
2447
|
+
...f !== "click" && { onClick(e) {
|
|
2448
|
+
i(!1, e.nativeEvent, "reference-press");
|
|
2449
|
+
} }
|
|
2450
|
+
}
|
|
2451
|
+
}), [
|
|
2452
|
+
j,
|
|
2453
|
+
i,
|
|
2454
|
+
d,
|
|
2455
|
+
f
|
|
2456
|
+
]), L = r.useMemo(() => {
|
|
2457
|
+
function e(e) {
|
|
2458
|
+
e.button === 0 && (x.current = !0);
|
|
2459
|
+
}
|
|
2460
|
+
return {
|
|
2461
|
+
onKeyDown: j,
|
|
2462
|
+
onMouseDown: e,
|
|
2463
|
+
onMouseUp: e,
|
|
2464
|
+
[Ur[u]]: () => {
|
|
2465
|
+
o.current.insideReactTree = !0;
|
|
2466
|
+
}
|
|
2467
|
+
};
|
|
2468
|
+
}, [
|
|
2469
|
+
j,
|
|
2470
|
+
u,
|
|
2471
|
+
o
|
|
2472
|
+
]);
|
|
2473
|
+
return r.useMemo(() => s ? {
|
|
2474
|
+
reference: I,
|
|
2475
|
+
floating: L
|
|
2476
|
+
} : {}, [
|
|
2477
|
+
s,
|
|
2478
|
+
I,
|
|
2479
|
+
L
|
|
2480
|
+
]);
|
|
2481
|
+
}
|
|
2482
|
+
function Kr(e) {
|
|
2483
|
+
let { open: t = !1, onOpenChange: n, elements: i } = e, a = zn(), o = r.useRef({}), [s] = r.useState(() => Un()), c = Kn() != null;
|
|
2484
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2485
|
+
let e = i.reference;
|
|
2486
|
+
e && !m(e) && Hn("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
|
|
2487
|
+
}
|
|
2488
|
+
let [l, u] = r.useState(i.reference), d = Z((e, t, r) => {
|
|
2489
|
+
o.current.openEvent = e ? t : void 0, s.emit("openchange", {
|
|
2490
|
+
open: e,
|
|
2491
|
+
event: t,
|
|
2492
|
+
reason: r,
|
|
2493
|
+
nested: c
|
|
2494
|
+
}), n?.(e, t, r);
|
|
2495
|
+
}), f = r.useMemo(() => ({ setPositionReference: u }), []), p = r.useMemo(() => ({
|
|
2496
|
+
reference: l || i.reference || null,
|
|
2497
|
+
floating: i.floating || null,
|
|
2498
|
+
domReference: i.reference
|
|
2499
|
+
}), [
|
|
2500
|
+
l,
|
|
2501
|
+
i.reference,
|
|
2502
|
+
i.floating
|
|
2503
|
+
]);
|
|
2504
|
+
return r.useMemo(() => ({
|
|
2505
|
+
dataRef: o,
|
|
2506
|
+
open: t,
|
|
2507
|
+
onOpenChange: d,
|
|
2508
|
+
elements: p,
|
|
2509
|
+
events: s,
|
|
2510
|
+
floatingId: a,
|
|
2511
|
+
refs: f
|
|
2512
|
+
}), [
|
|
2513
|
+
t,
|
|
2514
|
+
d,
|
|
2515
|
+
p,
|
|
2516
|
+
s,
|
|
2517
|
+
a,
|
|
2518
|
+
f
|
|
2519
|
+
]);
|
|
2520
|
+
}
|
|
2521
|
+
function qr(e) {
|
|
2522
|
+
e === void 0 && (e = {});
|
|
2523
|
+
let { nodeId: t } = e, n = Kr({
|
|
2524
|
+
...e,
|
|
2525
|
+
elements: {
|
|
2526
|
+
reference: null,
|
|
2527
|
+
floating: null,
|
|
2528
|
+
...e.elements
|
|
2529
|
+
}
|
|
2530
|
+
}), i = e.rootContext || n, a = i.elements, [o, s] = r.useState(null), [c, l] = r.useState(null), u = a?.domReference || o, d = r.useRef(null), f = qn();
|
|
2531
|
+
Y(() => {
|
|
2532
|
+
u && (d.current = u);
|
|
2533
|
+
}, [u]);
|
|
2534
|
+
let p = ln({
|
|
2535
|
+
...e,
|
|
2536
|
+
elements: {
|
|
2537
|
+
...a,
|
|
2538
|
+
...c && { reference: c }
|
|
2539
|
+
}
|
|
2540
|
+
}), h = r.useCallback((e) => {
|
|
2541
|
+
let t = m(e) ? {
|
|
2542
|
+
getBoundingClientRect: () => e.getBoundingClientRect(),
|
|
2543
|
+
getClientRects: () => e.getClientRects(),
|
|
2544
|
+
contextElement: e
|
|
2545
|
+
} : e;
|
|
2546
|
+
l(t), p.refs.setReference(t);
|
|
2547
|
+
}, [p.refs]), g = r.useCallback((e) => {
|
|
2548
|
+
(m(e) || e === null) && (d.current = e, s(e)), (m(p.refs.reference.current) || p.refs.reference.current === null || e !== null && !m(e)) && p.refs.setReference(e);
|
|
2549
|
+
}, [p.refs]), _ = r.useMemo(() => ({
|
|
2550
|
+
...p.refs,
|
|
2551
|
+
setReference: g,
|
|
2552
|
+
setPositionReference: h,
|
|
2553
|
+
domReference: d
|
|
2554
|
+
}), [
|
|
2555
|
+
p.refs,
|
|
2556
|
+
g,
|
|
2557
|
+
h
|
|
2558
|
+
]), v = r.useMemo(() => ({
|
|
2559
|
+
...p.elements,
|
|
2560
|
+
domReference: u
|
|
2561
|
+
}), [p.elements, u]), y = r.useMemo(() => ({
|
|
2562
|
+
...p,
|
|
2563
|
+
...i,
|
|
2564
|
+
refs: _,
|
|
2565
|
+
elements: v,
|
|
2566
|
+
nodeId: t
|
|
2567
|
+
}), [
|
|
2568
|
+
p,
|
|
2569
|
+
_,
|
|
2570
|
+
v,
|
|
2571
|
+
t,
|
|
2572
|
+
i
|
|
2573
|
+
]);
|
|
2574
|
+
return Y(() => {
|
|
2575
|
+
i.dataRef.current.floatingContext = y;
|
|
2576
|
+
let e = f?.nodesRef.current.find((e) => e.id === t);
|
|
2577
|
+
e && (e.context = y);
|
|
2578
|
+
}), r.useMemo(() => ({
|
|
2579
|
+
...p,
|
|
2580
|
+
context: y,
|
|
2581
|
+
refs: _,
|
|
2582
|
+
elements: v
|
|
2583
|
+
}), [
|
|
2584
|
+
p,
|
|
2585
|
+
_,
|
|
2586
|
+
v,
|
|
2587
|
+
y
|
|
2588
|
+
]);
|
|
2589
|
+
}
|
|
2590
|
+
function Jr() {
|
|
2591
|
+
return Se() && be();
|
|
2592
|
+
}
|
|
2593
|
+
function Yr(e, t) {
|
|
2594
|
+
t === void 0 && (t = {});
|
|
2595
|
+
let { open: n, onOpenChange: i, events: a, dataRef: o, elements: s } = e, { enabled: c = !0, visibleOnly: l = !0 } = t, u = r.useRef(!1), f = r.useRef(-1), p = r.useRef(!0);
|
|
2596
|
+
r.useEffect(() => {
|
|
2597
|
+
if (!c) return;
|
|
2598
|
+
let e = d(s.domReference);
|
|
2599
|
+
function t() {
|
|
2600
|
+
!n && h(s.domReference) && s.domReference === Ae(q(s.domReference)) && (u.current = !0);
|
|
2601
|
+
}
|
|
2602
|
+
function r() {
|
|
2603
|
+
p.current = !0;
|
|
2604
|
+
}
|
|
2605
|
+
function i() {
|
|
2606
|
+
p.current = !1;
|
|
2607
|
+
}
|
|
2608
|
+
return e.addEventListener("blur", t), Jr() && (e.addEventListener("keydown", r, !0), e.addEventListener("pointerdown", i, !0)), () => {
|
|
2609
|
+
e.removeEventListener("blur", t), Jr() && (e.removeEventListener("keydown", r, !0), e.removeEventListener("pointerdown", i, !0));
|
|
2610
|
+
};
|
|
2611
|
+
}, [
|
|
2612
|
+
s.domReference,
|
|
2613
|
+
n,
|
|
2614
|
+
c
|
|
2615
|
+
]), r.useEffect(() => {
|
|
2616
|
+
if (!c) return;
|
|
2617
|
+
function e(e) {
|
|
2618
|
+
let { reason: t } = e;
|
|
2619
|
+
(t === "reference-press" || t === "escape-key") && (u.current = !0);
|
|
2620
|
+
}
|
|
2621
|
+
return a.on("openchange", e), () => {
|
|
2622
|
+
a.off("openchange", e);
|
|
2623
|
+
};
|
|
2624
|
+
}, [a, c]), r.useEffect(() => () => {
|
|
2625
|
+
$(f);
|
|
2626
|
+
}, []);
|
|
2627
|
+
let g = r.useMemo(() => ({
|
|
2628
|
+
onMouseLeave() {
|
|
2629
|
+
u.current = !1;
|
|
2630
|
+
},
|
|
2631
|
+
onFocus(e) {
|
|
2632
|
+
if (u.current) return;
|
|
2633
|
+
let t = je(e.nativeEvent);
|
|
2634
|
+
if (l && m(t)) {
|
|
2635
|
+
if (Jr() && !e.relatedTarget) {
|
|
2636
|
+
if (!p.current && !Pe(t)) return;
|
|
2637
|
+
} else if (!Ie(t)) return;
|
|
2638
|
+
}
|
|
2639
|
+
i(!0, e.nativeEvent, "focus");
|
|
2640
|
+
},
|
|
2641
|
+
onBlur(e) {
|
|
2642
|
+
u.current = !1;
|
|
2643
|
+
let t = e.relatedTarget, n = e.nativeEvent, r = m(t) && t.hasAttribute(Zn("focus-guard")) && t.getAttribute("data-type") === "outside";
|
|
2644
|
+
f.current = window.setTimeout(() => {
|
|
2645
|
+
let e = Ae(s.domReference ? s.domReference.ownerDocument : document);
|
|
2646
|
+
!t && e === s.domReference || K(o.current.floatingContext?.refs.floating.current, e) || K(s.domReference, e) || r || i(!1, n, "focus");
|
|
2647
|
+
});
|
|
2648
|
+
}
|
|
2649
|
+
}), [
|
|
2650
|
+
o,
|
|
2651
|
+
s.domReference,
|
|
2652
|
+
i,
|
|
2653
|
+
l
|
|
2654
|
+
]);
|
|
2655
|
+
return r.useMemo(() => c ? { reference: g } : {}, [c, g]);
|
|
2656
|
+
}
|
|
2657
|
+
function Xr(e, t, n) {
|
|
2658
|
+
let r = /* @__PURE__ */ new Map(), i = n === "item", a = e;
|
|
2659
|
+
if (i && e) {
|
|
2660
|
+
let { [xn]: t, [Sn]: n, ...r } = e;
|
|
2661
|
+
a = r;
|
|
2662
|
+
}
|
|
2663
|
+
return {
|
|
2664
|
+
...n === "floating" && {
|
|
2665
|
+
tabIndex: -1,
|
|
2666
|
+
[bn]: ""
|
|
2667
|
+
},
|
|
2668
|
+
...a,
|
|
2669
|
+
...t.map((t) => {
|
|
2670
|
+
let r = t ? t[n] : null;
|
|
2671
|
+
return typeof r == "function" ? e ? r(e) : null : r;
|
|
2672
|
+
}).concat(e).reduce((e, t) => (t && Object.entries(t).forEach((t) => {
|
|
2673
|
+
let [n, a] = t;
|
|
2674
|
+
if (!(i && [xn, Sn].includes(n))) if (n.indexOf("on") === 0) {
|
|
2675
|
+
if (r.has(n) || r.set(n, []), typeof a == "function") {
|
|
2676
|
+
var o;
|
|
2677
|
+
(o = r.get(n)) == null || o.push(a), e[n] = function() {
|
|
2678
|
+
var e = [...arguments];
|
|
2679
|
+
return r.get(n)?.map((t) => t(...e)).find((e) => e !== void 0);
|
|
2680
|
+
};
|
|
2681
|
+
}
|
|
2682
|
+
} else e[n] = a;
|
|
2683
|
+
}), e), {})
|
|
2684
|
+
};
|
|
2685
|
+
}
|
|
2686
|
+
function Zr(e) {
|
|
2687
|
+
e === void 0 && (e = []);
|
|
2688
|
+
let t = e.map((e) => e?.reference), n = e.map((e) => e?.floating), i = e.map((e) => e?.item), a = r.useCallback((t) => Xr(t, e, "reference"), t), o = r.useCallback((t) => Xr(t, e, "floating"), n), s = r.useCallback((t) => Xr(t, e, "item"), i);
|
|
2689
|
+
return r.useMemo(() => ({
|
|
2690
|
+
getReferenceProps: a,
|
|
2691
|
+
getFloatingProps: o,
|
|
2692
|
+
getItemProps: s
|
|
2693
|
+
}), [
|
|
2694
|
+
a,
|
|
2695
|
+
o,
|
|
2696
|
+
s
|
|
2697
|
+
]);
|
|
2698
|
+
}
|
|
2699
|
+
var Qr = "Escape";
|
|
2700
|
+
function $r(e, t, n) {
|
|
2701
|
+
switch (e) {
|
|
2702
|
+
case "vertical": return t;
|
|
2703
|
+
case "horizontal": return n;
|
|
2704
|
+
default: return t || n;
|
|
2705
|
+
}
|
|
2706
|
+
}
|
|
2707
|
+
function ei(e, t) {
|
|
2708
|
+
return $r(t, e === Tn || e === En, e === Cn || e === wn);
|
|
2709
|
+
}
|
|
2710
|
+
function ti(e, t, n) {
|
|
2711
|
+
return $r(t, e === En, n ? e === Cn : e === wn) || e === "Enter" || e === " " || e === "";
|
|
2712
|
+
}
|
|
2713
|
+
function ni(e, t, n) {
|
|
2714
|
+
return $r(t, n ? e === Cn : e === wn, e === En);
|
|
2715
|
+
}
|
|
2716
|
+
function ri(e, t, n, r) {
|
|
2717
|
+
return t === "both" || t === "horizontal" && r && r > 1 ? e === Qr : $r(t, n ? e === wn : e === Cn, e === Tn);
|
|
2718
|
+
}
|
|
2719
|
+
function ii(e, t) {
|
|
2720
|
+
let { open: n, onOpenChange: i, elements: a, floatingId: o } = e, { listRef: s, activeIndex: c, onNavigate: l = () => {}, enabled: u = !0, selectedIndex: d = null, allowEscape: f = !1, loop: p = !1, nested: m = !1, rtl: g = !1, virtual: _ = !1, focusItemOnOpen: v = "auto", focusItemOnHover: y = !0, openOnArrowKeyDown: b = !0, disabledIndices: x = void 0, orientation: S = "vertical", parentOrientation: C, cols: w = 1, scrollItemIntoView: T = !0, virtualItemRef: E, itemSizes: D, dense: O = !1 } = t;
|
|
2721
|
+
process.env.NODE_ENV !== "production" && (f && (p || Vn("`useListNavigation` looping must be enabled to allow escaping."), _ || Vn("`useListNavigation` must be virtual to allow escaping.")), S === "vertical" && w > 1 && Vn("In grid list navigation mode (`cols` > 1), the `orientation` should", "be either \"horizontal\" or \"both\"."));
|
|
2722
|
+
let k = X(Le(a.floating)), A = Kn(), j = qn();
|
|
2723
|
+
Y(() => {
|
|
2724
|
+
e.dataRef.current.orientation = S;
|
|
2725
|
+
}, [e, S]);
|
|
2726
|
+
let M = Z(() => {
|
|
2727
|
+
l(F.current === -1 ? null : F.current);
|
|
2728
|
+
}), N = Fe(a.domReference), P = r.useRef(v), F = r.useRef(d ?? -1), I = r.useRef(null), L = r.useRef(!0), R = r.useRef(M), ee = r.useRef(!!a.floating), z = r.useRef(n), B = r.useRef(!1), te = r.useRef(!1), ne = X(x), V = X(n), H = X(T), U = X(d), [W, re] = r.useState(), [G, ie] = r.useState(), ae = Z(() => {
|
|
2729
|
+
function e(e) {
|
|
2730
|
+
if (_) {
|
|
2731
|
+
var t;
|
|
2732
|
+
(t = e.id) != null && t.endsWith("-fui-option") && (e.id = o + "-" + Math.random().toString(16).slice(2, 10)), re(e.id), j?.events.emit("virtualfocus", e), E && (E.current = e);
|
|
2733
|
+
} else rr(e, {
|
|
2734
|
+
sync: B.current,
|
|
2735
|
+
preventScroll: !0
|
|
2736
|
+
});
|
|
2737
|
+
}
|
|
2738
|
+
let t = s.current[F.current], n = te.current;
|
|
2739
|
+
t && e(t), (B.current ? (e) => e() : requestAnimationFrame)(() => {
|
|
2740
|
+
let r = s.current[F.current] || t;
|
|
2741
|
+
if (!r) return;
|
|
2742
|
+
t || e(r);
|
|
2743
|
+
let i = H.current;
|
|
2744
|
+
i && se && (n || !L.current) && (r.scrollIntoView == null || r.scrollIntoView(typeof i == "boolean" ? {
|
|
2745
|
+
block: "nearest",
|
|
2746
|
+
inline: "nearest"
|
|
2747
|
+
} : i));
|
|
2748
|
+
});
|
|
2749
|
+
});
|
|
2750
|
+
Y(() => {
|
|
2751
|
+
u && (n && a.floating ? P.current && d != null && (te.current = !0, F.current = d, M()) : ee.current && (F.current = -1, R.current()));
|
|
2752
|
+
}, [
|
|
2753
|
+
u,
|
|
2754
|
+
n,
|
|
2755
|
+
a.floating,
|
|
2756
|
+
d,
|
|
2757
|
+
M
|
|
2758
|
+
]), Y(() => {
|
|
2759
|
+
if (u && n && a.floating) if (c == null) {
|
|
2760
|
+
if (B.current = !1, U.current != null) return;
|
|
2761
|
+
if (ee.current && (F.current = -1, ae()), (!z.current || !ee.current) && P.current && (I.current != null || P.current === !0 && I.current == null)) {
|
|
2762
|
+
let e = 0, t = () => {
|
|
2763
|
+
s.current[0] == null ? (e < 2 && (e ? requestAnimationFrame : queueMicrotask)(t), e++) : (F.current = I.current == null || ti(I.current, S, g) || m ? Ye(s, ne.current) : Xe(s, ne.current), I.current = null, M());
|
|
2764
|
+
};
|
|
2765
|
+
t();
|
|
2766
|
+
}
|
|
2767
|
+
} else Je(s, c) || (F.current = c, ae(), te.current = !1);
|
|
2768
|
+
}, [
|
|
2769
|
+
u,
|
|
2770
|
+
n,
|
|
2771
|
+
a.floating,
|
|
2772
|
+
c,
|
|
2773
|
+
U,
|
|
2774
|
+
m,
|
|
2775
|
+
s,
|
|
2776
|
+
S,
|
|
2777
|
+
g,
|
|
2778
|
+
M,
|
|
2779
|
+
ae,
|
|
2780
|
+
ne
|
|
2781
|
+
]), Y(() => {
|
|
2782
|
+
var e;
|
|
2783
|
+
if (!u || a.floating || !j || _ || !ee.current) return;
|
|
2784
|
+
let t = j.nodesRef.current, n = (e = t.find((e) => e.id === A)) == null || (e = e.context) == null ? void 0 : e.elements.floating, r = Ae(q(a.floating)), i = t.some((e) => e.context && K(e.context.elements.floating, r));
|
|
2785
|
+
n && !i && L.current && n.focus({ preventScroll: !0 });
|
|
2786
|
+
}, [
|
|
2787
|
+
u,
|
|
2788
|
+
a.floating,
|
|
2789
|
+
j,
|
|
2790
|
+
A,
|
|
2791
|
+
_
|
|
2792
|
+
]), Y(() => {
|
|
2793
|
+
if (!u || !j || !_ || A) return;
|
|
2794
|
+
function e(e) {
|
|
2795
|
+
ie(e.id), E && (E.current = e);
|
|
2796
|
+
}
|
|
2797
|
+
return j.events.on("virtualfocus", e), () => {
|
|
2798
|
+
j.events.off("virtualfocus", e);
|
|
2799
|
+
};
|
|
2800
|
+
}, [
|
|
2801
|
+
u,
|
|
2802
|
+
j,
|
|
2803
|
+
_,
|
|
2804
|
+
A,
|
|
2805
|
+
E
|
|
2806
|
+
]), Y(() => {
|
|
2807
|
+
R.current = M, z.current = n, ee.current = !!a.floating;
|
|
2808
|
+
}), Y(() => {
|
|
2809
|
+
n || (I.current = null, P.current = v);
|
|
2810
|
+
}, [n, v]);
|
|
2811
|
+
let oe = c != null, se = r.useMemo(() => {
|
|
2812
|
+
function e(e) {
|
|
2813
|
+
if (!V.current) return;
|
|
2814
|
+
let t = s.current.indexOf(e);
|
|
2815
|
+
t !== -1 && F.current !== t && (F.current = t, M());
|
|
2816
|
+
}
|
|
2817
|
+
return {
|
|
2818
|
+
onFocus(t) {
|
|
2819
|
+
let { currentTarget: n } = t;
|
|
2820
|
+
B.current = !0, e(n);
|
|
2821
|
+
},
|
|
2822
|
+
onClick: (e) => {
|
|
2823
|
+
let { currentTarget: t } = e;
|
|
2824
|
+
return t.focus({ preventScroll: !0 });
|
|
2825
|
+
},
|
|
2826
|
+
onMouseMove(t) {
|
|
2827
|
+
let { currentTarget: n } = t;
|
|
2828
|
+
B.current = !0, te.current = !1, y && e(n);
|
|
2829
|
+
},
|
|
2830
|
+
onPointerLeave(e) {
|
|
2831
|
+
let { pointerType: t } = e;
|
|
2832
|
+
if (!(!L.current || t === "touch") && (B.current = !0, y && (F.current = -1, M(), !_))) {
|
|
2833
|
+
var n;
|
|
2834
|
+
(n = k.current) == null || n.focus({ preventScroll: !0 });
|
|
2835
|
+
}
|
|
2836
|
+
}
|
|
2837
|
+
};
|
|
2838
|
+
}, [
|
|
2839
|
+
V,
|
|
2840
|
+
k,
|
|
2841
|
+
y,
|
|
2842
|
+
s,
|
|
2843
|
+
M,
|
|
2844
|
+
_
|
|
2845
|
+
]), ce = r.useCallback(() => {
|
|
2846
|
+
var e;
|
|
2847
|
+
return C ?? (j == null || (e = j.nodesRef.current.find((e) => e.id === A)) == null || (e = e.context) == null || (e = e.dataRef) == null ? void 0 : e.current.orientation);
|
|
2848
|
+
}, [
|
|
2849
|
+
A,
|
|
2850
|
+
j,
|
|
2851
|
+
C
|
|
2852
|
+
]), le = Z((e) => {
|
|
2853
|
+
if (L.current = !1, B.current = !0, e.which === 229 || !V.current && e.currentTarget === k.current) return;
|
|
2854
|
+
if (m && ri(e.key, S, g, w)) {
|
|
2855
|
+
ei(e.key, ce()) || J(e), i(!1, e.nativeEvent, "list-navigation"), h(a.domReference) && (_ ? j?.events.emit("virtualfocus", a.domReference) : a.domReference.focus());
|
|
2856
|
+
return;
|
|
2857
|
+
}
|
|
2858
|
+
let t = F.current, r = Ye(s, x), o = Xe(s, x);
|
|
2859
|
+
if (N || (e.key === "Home" && (J(e), F.current = r, M()), e.key === "End" && (J(e), F.current = o, M())), w > 1) {
|
|
2860
|
+
let t = D || Array.from({ length: s.current.length }, () => ({
|
|
2861
|
+
width: 1,
|
|
2862
|
+
height: 1
|
|
2863
|
+
})), n = Qe(t, w, O), i = n.findIndex((e) => e != null && !tt(s, e, x)), a = n.reduce((e, t, n) => t != null && !tt(s, t, x) ? n : e, -1), c = n[Ze({ current: n.map((e) => e == null ? null : s.current[e]) }, {
|
|
2864
|
+
event: e,
|
|
2865
|
+
orientation: S,
|
|
2866
|
+
loop: p,
|
|
2867
|
+
rtl: g,
|
|
2868
|
+
cols: w,
|
|
2869
|
+
disabledIndices: et([...(typeof x == "function" ? null : x) || s.current.map((e, t) => tt(s, t, x) ? t : void 0), void 0], n),
|
|
2870
|
+
minIndex: i,
|
|
2871
|
+
maxIndex: a,
|
|
2872
|
+
prevIndex: $e(F.current > o ? r : F.current, t, n, w, e.key === En ? "bl" : e.key === (g ? Cn : wn) ? "tr" : "tl"),
|
|
2873
|
+
stopEvent: !0
|
|
2874
|
+
})];
|
|
2875
|
+
if (c != null && (F.current = c, M()), S === "both") return;
|
|
2876
|
+
}
|
|
2877
|
+
if (ei(e.key, S)) {
|
|
2878
|
+
if (J(e), n && !_ && Ae(e.currentTarget.ownerDocument) === e.currentTarget) {
|
|
2879
|
+
F.current = ti(e.key, S, g) ? r : o, M();
|
|
2880
|
+
return;
|
|
2881
|
+
}
|
|
2882
|
+
ti(e.key, S, g) ? p ? F.current = t >= o ? f && t !== s.current.length ? -1 : r : Q(s, {
|
|
2883
|
+
startingIndex: t,
|
|
2884
|
+
disabledIndices: x
|
|
2885
|
+
}) : F.current = Math.min(o, Q(s, {
|
|
2886
|
+
startingIndex: t,
|
|
2887
|
+
disabledIndices: x
|
|
2888
|
+
})) : p ? F.current = t <= r ? f && t !== -1 ? s.current.length : o : Q(s, {
|
|
2889
|
+
startingIndex: t,
|
|
2890
|
+
decrement: !0,
|
|
2891
|
+
disabledIndices: x
|
|
2892
|
+
}) : F.current = Math.max(r, Q(s, {
|
|
2893
|
+
startingIndex: t,
|
|
2894
|
+
decrement: !0,
|
|
2895
|
+
disabledIndices: x
|
|
2896
|
+
})), Je(s, F.current) && (F.current = -1), M();
|
|
2897
|
+
}
|
|
2898
|
+
}), ue = r.useMemo(() => _ && n && oe && { "aria-activedescendant": G || W }, [
|
|
2899
|
+
_,
|
|
2900
|
+
n,
|
|
2901
|
+
oe,
|
|
2902
|
+
G,
|
|
2903
|
+
W
|
|
2904
|
+
]), de = r.useMemo(() => ({
|
|
2905
|
+
"aria-orientation": S === "both" ? void 0 : S,
|
|
2906
|
+
...N ? {} : ue,
|
|
2907
|
+
onKeyDown: le,
|
|
2908
|
+
onPointerMove() {
|
|
2909
|
+
L.current = !0;
|
|
2910
|
+
}
|
|
2911
|
+
}), [
|
|
2912
|
+
ue,
|
|
2913
|
+
le,
|
|
2914
|
+
S,
|
|
2915
|
+
N
|
|
2916
|
+
]), fe = r.useMemo(() => {
|
|
2917
|
+
function e(e) {
|
|
2918
|
+
v === "auto" && He(e.nativeEvent) && (P.current = !0);
|
|
2919
|
+
}
|
|
2920
|
+
function t(e) {
|
|
2921
|
+
P.current = v, v === "auto" && Ue(e.nativeEvent) && (P.current = !0);
|
|
2922
|
+
}
|
|
2923
|
+
return {
|
|
2924
|
+
...ue,
|
|
2925
|
+
onKeyDown(e) {
|
|
2926
|
+
L.current = !1;
|
|
2927
|
+
let t = e.key.startsWith("Arrow"), r = ["Home", "End"].includes(e.key), a = t || r, o = ni(e.key, S, g), c = ri(e.key, S, g, w), l = ni(e.key, ce(), g), u = ei(e.key, S), f = (m ? l : u) || e.key === "Enter" || e.key.trim() === "";
|
|
2928
|
+
if (_ && n) {
|
|
2929
|
+
let t = j?.nodesRef.current.find((e) => e.parentId == null), n = j && t ? ze(j.nodesRef.current, t.id) : null;
|
|
2930
|
+
if (a && n && E) {
|
|
2931
|
+
let t = new KeyboardEvent("keydown", {
|
|
2932
|
+
key: e.key,
|
|
2933
|
+
bubbles: !0
|
|
2934
|
+
});
|
|
2935
|
+
if (o || c) {
|
|
2936
|
+
let r = n.context?.elements.domReference === e.currentTarget, i = c && !r ? n.context?.elements.domReference : o ? s.current.find((e) => e?.id === W) : null;
|
|
2937
|
+
i && (J(e), i.dispatchEvent(t), ie(void 0));
|
|
2938
|
+
}
|
|
2939
|
+
if ((u || r) && n.context && n.context.open && n.parentId && e.currentTarget !== n.context.elements.domReference) {
|
|
2940
|
+
var p;
|
|
2941
|
+
J(e), (p = n.context.elements.domReference) == null || p.dispatchEvent(t);
|
|
2942
|
+
return;
|
|
2943
|
+
}
|
|
2944
|
+
}
|
|
2945
|
+
return le(e);
|
|
2946
|
+
}
|
|
2947
|
+
if (!(!n && !b && t)) {
|
|
2948
|
+
if (f) {
|
|
2949
|
+
let t = ei(e.key, ce());
|
|
2950
|
+
I.current = m && t ? null : e.key;
|
|
2951
|
+
}
|
|
2952
|
+
if (m) {
|
|
2953
|
+
l && (J(e), n ? (F.current = Ye(s, ne.current), M()) : i(!0, e.nativeEvent, "list-navigation"));
|
|
2954
|
+
return;
|
|
2955
|
+
}
|
|
2956
|
+
u && (d != null && (F.current = d), J(e), !n && b ? i(!0, e.nativeEvent, "list-navigation") : le(e), n && M());
|
|
2957
|
+
}
|
|
2958
|
+
},
|
|
2959
|
+
onFocus() {
|
|
2960
|
+
n && !_ && (F.current = -1, M());
|
|
2961
|
+
},
|
|
2962
|
+
onPointerDown: t,
|
|
2963
|
+
onPointerEnter: t,
|
|
2964
|
+
onMouseDown: e,
|
|
2965
|
+
onClick: e
|
|
2966
|
+
};
|
|
2967
|
+
}, [
|
|
2968
|
+
W,
|
|
2969
|
+
ue,
|
|
2970
|
+
w,
|
|
2971
|
+
le,
|
|
2972
|
+
ne,
|
|
2973
|
+
v,
|
|
2974
|
+
s,
|
|
2975
|
+
m,
|
|
2976
|
+
M,
|
|
2977
|
+
i,
|
|
2978
|
+
n,
|
|
2979
|
+
b,
|
|
2980
|
+
S,
|
|
2981
|
+
ce,
|
|
2982
|
+
g,
|
|
2983
|
+
d,
|
|
2984
|
+
j,
|
|
2985
|
+
_,
|
|
2986
|
+
E
|
|
2987
|
+
]);
|
|
2988
|
+
return r.useMemo(() => u ? {
|
|
2989
|
+
reference: fe,
|
|
2990
|
+
floating: de,
|
|
2991
|
+
item: se
|
|
2992
|
+
} : {}, [
|
|
2993
|
+
u,
|
|
2994
|
+
fe,
|
|
2995
|
+
de,
|
|
2996
|
+
se
|
|
2997
|
+
]);
|
|
2998
|
+
}
|
|
2999
|
+
var ai = /* @__PURE__ */ new Map([
|
|
3000
|
+
["select", "listbox"],
|
|
3001
|
+
["combobox", "listbox"],
|
|
3002
|
+
["label", !1]
|
|
3003
|
+
]);
|
|
3004
|
+
function oi(e, t) {
|
|
3005
|
+
t === void 0 && (t = {});
|
|
3006
|
+
let { open: n, elements: i, floatingId: a } = e, { enabled: o = !0, role: s = "dialog" } = t, c = zn(), l = i.domReference?.id || c, u = r.useMemo(() => Le(i.floating)?.id || a, [i.floating, a]), d = ai.get(s) ?? s, f = Kn() != null, p = r.useMemo(() => d === "tooltip" || s === "label" ? { ["aria-" + (s === "label" ? "labelledby" : "describedby")]: n ? u : void 0 } : {
|
|
3007
|
+
"aria-expanded": n ? "true" : "false",
|
|
3008
|
+
"aria-haspopup": d === "alertdialog" ? "dialog" : d,
|
|
3009
|
+
"aria-controls": n ? u : void 0,
|
|
3010
|
+
...d === "listbox" && { role: "combobox" },
|
|
3011
|
+
...d === "menu" && { id: l },
|
|
3012
|
+
...d === "menu" && f && { role: "menuitem" },
|
|
3013
|
+
...s === "select" && { "aria-autocomplete": "none" },
|
|
3014
|
+
...s === "combobox" && { "aria-autocomplete": "list" }
|
|
3015
|
+
}, [
|
|
3016
|
+
d,
|
|
3017
|
+
u,
|
|
3018
|
+
f,
|
|
3019
|
+
n,
|
|
3020
|
+
l,
|
|
3021
|
+
s
|
|
3022
|
+
]), m = r.useMemo(() => {
|
|
3023
|
+
let e = {
|
|
3024
|
+
id: u,
|
|
3025
|
+
...d && { role: d }
|
|
3026
|
+
};
|
|
3027
|
+
return d === "tooltip" || s === "label" ? e : {
|
|
3028
|
+
...e,
|
|
3029
|
+
...d === "menu" && { "aria-labelledby": l }
|
|
3030
|
+
};
|
|
3031
|
+
}, [
|
|
3032
|
+
d,
|
|
3033
|
+
u,
|
|
3034
|
+
l,
|
|
3035
|
+
s
|
|
3036
|
+
]), h = r.useCallback((e) => {
|
|
3037
|
+
let { active: t, selected: n } = e, r = {
|
|
3038
|
+
role: "option",
|
|
3039
|
+
...t && { id: u + "-fui-option" }
|
|
3040
|
+
};
|
|
3041
|
+
switch (s) {
|
|
3042
|
+
case "select":
|
|
3043
|
+
case "combobox": return {
|
|
3044
|
+
...r,
|
|
3045
|
+
"aria-selected": n
|
|
3046
|
+
};
|
|
3047
|
+
}
|
|
3048
|
+
return {};
|
|
3049
|
+
}, [u, s]);
|
|
3050
|
+
return r.useMemo(() => o ? {
|
|
3051
|
+
reference: p,
|
|
3052
|
+
floating: m,
|
|
3053
|
+
item: h
|
|
3054
|
+
} : {}, [
|
|
3055
|
+
o,
|
|
3056
|
+
p,
|
|
3057
|
+
m,
|
|
3058
|
+
h
|
|
3059
|
+
]);
|
|
3060
|
+
}
|
|
3061
|
+
function si(e, t) {
|
|
3062
|
+
let [n, i] = r.useState(e);
|
|
3063
|
+
return e && !n && i(!0), r.useEffect(() => {
|
|
3064
|
+
if (!e && n) {
|
|
3065
|
+
let e = setTimeout(() => i(!1), t);
|
|
3066
|
+
return () => clearTimeout(e);
|
|
3067
|
+
}
|
|
3068
|
+
}, [
|
|
3069
|
+
e,
|
|
3070
|
+
n,
|
|
3071
|
+
t
|
|
3072
|
+
]), n;
|
|
3073
|
+
}
|
|
3074
|
+
function ci(e, t) {
|
|
3075
|
+
t === void 0 && (t = {});
|
|
3076
|
+
let { open: n, elements: { floating: i } } = e, { duration: a = 250 } = t, o = (typeof a == "number" ? a : a.close) || 0, [s, l] = r.useState("unmounted"), u = si(n, o);
|
|
3077
|
+
return !u && s === "close" && l("unmounted"), Y(() => {
|
|
3078
|
+
if (i) {
|
|
3079
|
+
if (n) {
|
|
3080
|
+
l("initial");
|
|
3081
|
+
let e = requestAnimationFrame(() => {
|
|
3082
|
+
c.flushSync(() => {
|
|
3083
|
+
l("open");
|
|
3084
|
+
});
|
|
3085
|
+
});
|
|
3086
|
+
return () => {
|
|
3087
|
+
cancelAnimationFrame(e);
|
|
3088
|
+
};
|
|
3089
|
+
}
|
|
3090
|
+
l("close");
|
|
3091
|
+
}
|
|
3092
|
+
}, [n, i]), {
|
|
3093
|
+
isMounted: u,
|
|
3094
|
+
status: s
|
|
3095
|
+
};
|
|
3096
|
+
}
|
|
3097
|
+
//#endregion
|
|
3098
|
+
export { un as C, Xt as E, fn as S, pn as T, yn as _, Yn as a, ci as b, Xn as c, qr as d, Jn as f, Zr as g, tr as h, vn as i, Vr as l, Yr as m, Nn as n, Lr as o, Kn as p, Mr as r, xr as s, Mn as t, Gr as u, ii as v, dn as w, mn as x, oi as y };
|