@unchainedshop/admin-ui 4.8.31 → 4.8.32
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/out/403/index.html +3 -3
- package/out/404/index.html +3 -3
- package/out/404.html +3 -3
- package/out/423/index.html +3 -3
- package/out/500/index.html +3 -3
- package/out/_next/static/chunks/{0696190awbl-j.js → 0a5nr3-_q7xx1.js} +10 -10
- package/out/_next/static/chunks/{1m85ne6w_6tei.js → 11go520d1hcm5.js} +1 -1
- package/out/_next/static/chunks/{2-kvt9e7irukm.js → 182l1mlbf0glb.js} +1 -1
- package/out/_next/static/chunks/{09avk6mqdin_1.js → 1wnuiwsbi70eq.js} +1 -1
- package/out/_next/static/chunks/{0uls4bq8a7gyh.js → 2wmsx4gjbgvfv.js} +3 -3
- package/out/_next/static/chunks/{1_3e6x79fcyv3.js → 41p3ng89i5lem.js} +1 -1
- package/out/_next/static/{4ESrB8YpR2n44PFePtbgX → jOx5PlckLwWIJ5yrvePdU}/_buildManifest.js +2 -2
- package/out/_offline/index.html +3 -3
- package/out/account/forgot-password/index.html +3 -3
- package/out/account/index.html +3 -3
- package/out/assortments/AssortmentDetailPage/index.html +3 -3
- package/out/assortments/index.html +3 -3
- package/out/assortments/new/index.html +3 -3
- package/out/copilot/index.html +3 -3
- package/out/country/CountryDetailPage/index.html +3 -3
- package/out/country/index.html +3 -3
- package/out/country/new/index.html +3 -3
- package/out/currency/CurrencyDetailPage/index.html +3 -3
- package/out/currency/index.html +3 -3
- package/out/currency/new/index.html +3 -3
- package/out/delivery-provider/DeliveryProviderDetailPage/index.html +3 -3
- package/out/delivery-provider/index.html +3 -3
- package/out/delivery-provider/new/index.html +3 -3
- package/out/enrollments/EnrollmentDetailPage/index.html +3 -3
- package/out/enrollments/index.html +3 -3
- package/out/events/EventDetailPage/index.html +3 -3
- package/out/events/index.html +3 -3
- package/out/exports/index.html +3 -3
- package/out/external/index.html +3 -3
- package/out/filters/FilterDetailPage/index.html +3 -3
- package/out/filters/index.html +3 -3
- package/out/filters/new/index.html +3 -3
- package/out/index.html +3 -3
- package/out/install/index.html +3 -3
- package/out/language/LanguageDetailPage/index.html +3 -3
- package/out/language/index.html +3 -3
- package/out/language/new/index.html +3 -3
- package/out/log-in/index.html +3 -3
- package/out/orders/OrderDetailPage/index.html +3 -3
- package/out/orders/index.html +3 -3
- package/out/payment-provider/PaymentProviderDetailPage/index.html +3 -3
- package/out/payment-provider/index.html +3 -3
- package/out/payment-provider/new/index.html +3 -3
- package/out/products/ProductDetailPage/index.html +3 -3
- package/out/products/index.html +3 -3
- package/out/products/new/index.html +3 -3
- package/out/quotations/QuotationDetailPage/index.html +3 -3
- package/out/quotations/index.html +3 -3
- package/out/reset-password/index.html +3 -3
- package/out/sign-up/index.html +3 -3
- package/out/styleguide/index.html +3 -3
- package/out/tokens/TokenDetailPage/index.html +3 -3
- package/out/tokens/index.html +3 -3
- package/out/users/UserDetailPage/index.html +3 -3
- package/out/users/index.html +3 -3
- package/out/users/new/index.html +3 -3
- package/out/verify-email/index.html +3 -3
- package/out/warehousing-provider/WarehousingProviderDetailPage/index.html +3 -3
- package/out/warehousing-provider/index.html +3 -3
- package/out/warehousing-provider/new/index.html +3 -3
- package/out/works/WorkDetailPage/index.html +3 -3
- package/out/works/WorkQueueListView/index.html +3 -3
- package/out/works/index.html +3 -3
- package/out/works/management/index.html +3 -3
- package/package.json +31 -31
- package/dist/chunk-3L6EZQ6P.js +0 -135
- package/dist/chunk-54DKBWXV.js +0 -33
- package/dist/chunk-5WPFHQZN.js +0 -388
- package/dist/chunk-6UGLNLJG.js +0 -44
- package/dist/chunk-BMDNY67T.js +0 -22547
- package/dist/chunk-BOMSMJF2.js +0 -77
- package/dist/chunk-COV7BREX.js +0 -50
- package/dist/chunk-E77YIMGR.js +0 -2083
- package/dist/chunk-EJDZRZSZ.js +0 -59
- package/dist/chunk-ELPURWDC.js +0 -75
- package/dist/chunk-F6LBNV3H.js +0 -9
- package/dist/chunk-FDHXLNZQ.js +0 -44
- package/dist/chunk-GY2DRQGW.js +0 -166
- package/dist/chunk-HERLM47Z.js +0 -309
- package/dist/chunk-HJKRGBDG.js +0 -694
- package/dist/chunk-I64TXIE7.js +0 -618
- package/dist/chunk-IAQPLRXZ.js +0 -16
- package/dist/chunk-ICJH36K4.js +0 -326
- package/dist/chunk-ILYPJE4N.js +0 -57
- package/dist/chunk-IWKDBADX.js +0 -73
- package/dist/chunk-IXBMHOB5.js +0 -13
- package/dist/chunk-IYKPRAWC.js +0 -26
- package/dist/chunk-J23QSWDL.js +0 -8
- package/dist/chunk-KH5MK6ZW.js +0 -18
- package/dist/chunk-KRIRF7F6.js +0 -76
- package/dist/chunk-NT7RB7AK.js +0 -70
- package/dist/chunk-OKGJ6HDE.js +0 -26
- package/dist/chunk-OTXM2UCD.js +0 -19
- package/dist/chunk-PJLYVMUM.js +0 -3308
- package/dist/chunk-PUI5BIKO.js +0 -41
- package/dist/chunk-Q6S3LBUF.js +0 -180
- package/dist/chunk-QHR23GVH.js +0 -1099
- package/dist/chunk-QWQ3WJJN.js +0 -1
- package/dist/chunk-RAQV2GYF.js +0 -70
- package/dist/chunk-VBO377AY.js +0 -14
- package/dist/chunk-VYEXPG3M.js +0 -107
- package/dist/chunk-WPLOTFGW.js +0 -36
- package/dist/chunk-YO6PT7KD.js +0 -13
- package/dist/chunk-ZUOVKRKC.js +0 -957
- package/dist/components/ui/Accordion/Accordion.d.ts +0 -11
- package/dist/components/ui/Accordion/Accordion.d.ts.map +0 -1
- package/dist/components/ui/Accordion/AccordionHeader.d.ts +0 -6
- package/dist/components/ui/Accordion/AccordionHeader.d.ts.map +0 -1
- package/dist/components/ui/Accordion/AccordionItem.d.ts +0 -11
- package/dist/components/ui/Accordion/AccordionItem.d.ts.map +0 -1
- package/dist/components/ui/ActiveInActive.d.ts +0 -10
- package/dist/components/ui/ActiveInActive.d.ts.map +0 -1
- package/dist/components/ui/AnimatedCounter.d.ts +0 -7
- package/dist/components/ui/AnimatedCounter.d.ts.map +0 -1
- package/dist/components/ui/Badge.d.ts +0 -10
- package/dist/components/ui/Badge.d.ts.map +0 -1
- package/dist/components/ui/BreadCrumbs.d.ts +0 -7
- package/dist/components/ui/BreadCrumbs.d.ts.map +0 -1
- package/dist/components/ui/Button.d.ts +0 -36
- package/dist/components/ui/Button.d.ts.map +0 -1
- package/dist/components/ui/CopyableText.d.ts +0 -5
- package/dist/components/ui/CopyableText.d.ts.map +0 -1
- package/dist/components/ui/DateInput.d.ts +0 -15
- package/dist/components/ui/DateInput.d.ts.map +0 -1
- package/dist/components/ui/DateRangeFilterInput.d.ts +0 -4
- package/dist/components/ui/DateRangeFilterInput.d.ts.map +0 -1
- package/dist/components/ui/DetailHeader.d.ts +0 -6
- package/dist/components/ui/DetailHeader.d.ts.map +0 -1
- package/dist/components/ui/DraggableIcon.d.ts +0 -3
- package/dist/components/ui/DraggableIcon.d.ts.map +0 -1
- package/dist/components/ui/ErrorBoundary.d.ts +0 -18
- package/dist/components/ui/ErrorBoundary.d.ts.map +0 -1
- package/dist/components/ui/ErrorFallback.d.ts +0 -6
- package/dist/components/ui/ErrorFallback.d.ts.map +0 -1
- package/dist/components/ui/HelpText.d.ts +0 -11
- package/dist/components/ui/HelpText.d.ts.map +0 -1
- package/dist/components/ui/ImageWithFallback.d.ts +0 -7
- package/dist/components/ui/ImageWithFallback.d.ts.map +0 -1
- package/dist/components/ui/InfoTextBanner.d.ts +0 -6
- package/dist/components/ui/InfoTextBanner.d.ts.map +0 -1
- package/dist/components/ui/JSONView.d.ts +0 -6
- package/dist/components/ui/JSONView.d.ts.map +0 -1
- package/dist/components/ui/ListHeader.d.ts +0 -6
- package/dist/components/ui/ListHeader.d.ts.map +0 -1
- package/dist/components/ui/Loading.d.ts +0 -10
- package/dist/components/ui/Loading.d.ts.map +0 -1
- package/dist/components/ui/NoData.d.ts +0 -7
- package/dist/components/ui/NoData.d.ts.map +0 -1
- package/dist/components/ui/NoImage.d.ts +0 -7
- package/dist/components/ui/NoImage.d.ts.map +0 -1
- package/dist/components/ui/NoImageSvg.d.ts +0 -8
- package/dist/components/ui/NoImageSvg.d.ts.map +0 -1
- package/dist/components/ui/PageHeader.d.ts +0 -11
- package/dist/components/ui/PageHeader.d.ts.map +0 -1
- package/dist/components/ui/Pagination.d.ts +0 -8
- package/dist/components/ui/Pagination.d.ts.map +0 -1
- package/dist/components/ui/Portal/Portal.d.ts +0 -16
- package/dist/components/ui/Portal/Portal.d.ts.map +0 -1
- package/dist/components/ui/Portal/Portal.types.d.ts +0 -16
- package/dist/components/ui/Portal/Portal.types.d.ts.map +0 -1
- package/dist/components/ui/SaveAndCancelButtons.d.ts +0 -10
- package/dist/components/ui/SaveAndCancelButtons.d.ts.map +0 -1
- package/dist/components/ui/SearchField.d.ts +0 -7
- package/dist/components/ui/SearchField.d.ts.map +0 -1
- package/dist/components/ui/Tab.d.ts +0 -18
- package/dist/components/ui/Tab.d.ts.map +0 -1
- package/dist/components/ui/Tag/TagInput.d.ts +0 -19
- package/dist/components/ui/Tag/TagInput.d.ts.map +0 -1
- package/dist/components/ui/Tag/TagList.d.ts +0 -8
- package/dist/components/ui/Tag/TagList.d.ts.map +0 -1
- package/dist/components/ui/Tag/TagListForm.d.ts +0 -8
- package/dist/components/ui/Tag/TagListForm.d.ts.map +0 -1
- package/dist/components/ui/Toggle.d.ts +0 -11
- package/dist/components/ui/Toggle.d.ts.map +0 -1
- package/dist/components/ui/ToolTip.d.ts +0 -7
- package/dist/components/ui/ToolTip.d.ts.map +0 -1
- package/dist/components/ui/card.d.ts +0 -9
- package/dist/components/ui/card.d.ts.map +0 -1
- package/dist/components/ui/chart.d.ts +0 -42
- package/dist/components/ui/chart.d.ts.map +0 -1
- package/dist/components/ui/form/CheckboxField.d.ts +0 -4
- package/dist/components/ui/form/CheckboxField.d.ts.map +0 -1
- package/dist/components/ui/form/ChoicesField.d.ts +0 -12
- package/dist/components/ui/form/ChoicesField.d.ts.map +0 -1
- package/dist/components/ui/form/Combobox.d.ts +0 -20
- package/dist/components/ui/form/Combobox.d.ts.map +0 -1
- package/dist/components/ui/form/DatePickerField.d.ts +0 -4
- package/dist/components/ui/form/DatePickerField.d.ts.map +0 -1
- package/dist/components/ui/form/EmailField.d.ts +0 -7
- package/dist/components/ui/form/EmailField.d.ts.map +0 -1
- package/dist/components/ui/form/FieldWithHelp.d.ts +0 -10
- package/dist/components/ui/form/FieldWithHelp.d.ts.map +0 -1
- package/dist/components/ui/form/FieldWrapper.d.ts +0 -8
- package/dist/components/ui/form/FieldWrapper.d.ts.map +0 -1
- package/dist/components/ui/form/FormErrors.d.ts +0 -6
- package/dist/components/ui/form/FormErrors.d.ts.map +0 -1
- package/dist/components/ui/form/JSONAreaField.d.ts +0 -7
- package/dist/components/ui/form/JSONAreaField.d.ts.map +0 -1
- package/dist/components/ui/form/MarkdownTextAreaField.d.ts +0 -8
- package/dist/components/ui/form/MarkdownTextAreaField.d.ts.map +0 -1
- package/dist/components/ui/form/PasswordField.d.ts +0 -3
- package/dist/components/ui/form/PasswordField.d.ts.map +0 -1
- package/dist/components/ui/form/SelectField.d.ts +0 -11
- package/dist/components/ui/form/SelectField.d.ts.map +0 -1
- package/dist/components/ui/form/SubmitButton.d.ts +0 -9
- package/dist/components/ui/form/SubmitButton.d.ts.map +0 -1
- package/dist/components/ui/form/TagInputField.d.ts +0 -7
- package/dist/components/ui/form/TagInputField.d.ts.map +0 -1
- package/dist/components/ui/form/TextAreaField.d.ts +0 -8
- package/dist/components/ui/form/TextAreaField.d.ts.map +0 -1
- package/dist/components/ui/form/TextField.d.ts +0 -10
- package/dist/components/ui/form/TextField.d.ts.map +0 -1
- package/dist/components/ui/form/index.d.ts +0 -18
- package/dist/components/ui/form/index.d.ts.map +0 -1
- package/dist/components/ui/icons.d.ts +0 -4
- package/dist/components/ui/icons.d.ts.map +0 -1
- package/dist/components/ui/index.d.ts +0 -47
- package/dist/components/ui/index.d.ts.map +0 -1
- package/dist/form.js +0 -2617
- package/dist/gql/operation-types.d.ts +0 -13239
- package/dist/gql/operation-types.d.ts.map +0 -1
- package/dist/gql/schema-types.d.ts +0 -3876
- package/dist/gql/schema-types.d.ts.map +0 -1
- package/dist/gql/types.d.ts +0 -3
- package/dist/gql/types.d.ts.map +0 -1
- package/dist/hooks.js +0 -49
- package/dist/lib/utils.d.ts +0 -3
- package/dist/lib/utils.d.ts.map +0 -1
- package/dist/modal.js +0 -51
- package/dist/modules/Auth/AuthContext.d.ts +0 -9
- package/dist/modules/Auth/AuthContext.d.ts.map +0 -1
- package/dist/modules/Auth/useAuth.d.ts +0 -6
- package/dist/modules/Auth/useAuth.d.ts.map +0 -1
- package/dist/modules/UnchainedContext/UnchainedContext.d.ts +0 -8
- package/dist/modules/UnchainedContext/UnchainedContext.d.ts.map +0 -1
- package/dist/modules/UnchainedContext/useUnchainedContext.d.ts +0 -7
- package/dist/modules/UnchainedContext/useUnchainedContext.d.ts.map +0 -1
- package/dist/modules/accounts/fragment/MD5MetaDataFragment.d.ts +0 -3
- package/dist/modules/accounts/fragment/MD5MetaDataFragment.d.ts.map +0 -1
- package/dist/modules/accounts/fragment/UserFragment.d.ts +0 -3
- package/dist/modules/accounts/fragment/UserFragment.d.ts.map +0 -1
- package/dist/modules/accounts/hooks/useCurrentUser.d.ts +0 -10
- package/dist/modules/accounts/hooks/useCurrentUser.d.ts.map +0 -1
- package/dist/modules/accounts/hooks/useUsersCount.d.ts +0 -8
- package/dist/modules/accounts/hooks/useUsersCount.d.ts.map +0 -1
- package/dist/modules/accounts.js +0 -1349
- package/dist/modules/assortment/hooks/useAssortmentsCount.d.ts +0 -8
- package/dist/modules/assortment/hooks/useAssortmentsCount.d.ts.map +0 -1
- package/dist/modules/assortment.js +0 -1205
- package/dist/modules/common/components/AppContext.d.ts +0 -18
- package/dist/modules/common/components/AppContext.d.ts.map +0 -1
- package/dist/modules/common/components/FormWrapper.d.ts +0 -8
- package/dist/modules/common/components/FormWrapper.d.ts.map +0 -1
- package/dist/modules/common/components/LocaleWrapper.d.ts +0 -7
- package/dist/modules/common/components/LocaleWrapper.d.ts.map +0 -1
- package/dist/modules/common/components/MediaAvatar.d.ts +0 -6
- package/dist/modules/common/components/MediaAvatar.d.ts.map +0 -1
- package/dist/modules/common/components/SelectOptions.d.ts +0 -17
- package/dist/modules/common/components/SelectOptions.d.ts.map +0 -1
- package/dist/modules/common/components/Table.d.ts +0 -25
- package/dist/modules/common/components/Table.d.ts.map +0 -1
- package/dist/modules/common/components/TableCell.d.ts +0 -12
- package/dist/modules/common/components/TableCell.d.ts.map +0 -1
- package/dist/modules/common/components/TableRow.d.ts +0 -10
- package/dist/modules/common/components/TableRow.d.ts.map +0 -1
- package/dist/modules/common/components/ThemeWrapper.d.ts +0 -10
- package/dist/modules/common/components/ThemeWrapper.d.ts.map +0 -1
- package/dist/modules/common/data/iso-codes.d.ts +0 -4
- package/dist/modules/common/data/iso-codes.d.ts.map +0 -1
- package/dist/modules/common/data/miscellaneous.d.ts +0 -52
- package/dist/modules/common/data/miscellaneous.d.ts.map +0 -1
- package/dist/modules/common/fragments/AddressFragment.d.ts +0 -3
- package/dist/modules/common/fragments/AddressFragment.d.ts.map +0 -1
- package/dist/modules/common/hooks/useApp.d.ts +0 -11
- package/dist/modules/common/hooks/useApp.d.ts.map +0 -1
- package/dist/modules/common/hooks/useBulkResultHandler.d.ts +0 -8
- package/dist/modules/common/hooks/useBulkResultHandler.d.ts.map +0 -1
- package/dist/modules/common/hooks/useBulkSelection.d.ts +0 -12
- package/dist/modules/common/hooks/useBulkSelection.d.ts.map +0 -1
- package/dist/modules/common/hooks/useCSVExport.d.ts +0 -10
- package/dist/modules/common/hooks/useCSVExport.d.ts.map +0 -1
- package/dist/modules/common/hooks/useCSVImport.d.ts +0 -18
- package/dist/modules/common/hooks/useCSVImport.d.ts.map +0 -1
- package/dist/modules/common/hooks/useChatEndpointChecker.d.ts +0 -5
- package/dist/modules/common/hooks/useChatEndpointChecker.d.ts.map +0 -1
- package/dist/modules/common/hooks/useConfirmMediaUpload.d.ts +0 -10
- package/dist/modules/common/hooks/useConfirmMediaUpload.d.ts.map +0 -1
- package/dist/modules/common/hooks/useDashboardMetrics.d.ts +0 -23
- package/dist/modules/common/hooks/useDashboardMetrics.d.ts.map +0 -1
- package/dist/modules/common/hooks/useLocalStorage.d.ts +0 -3
- package/dist/modules/common/hooks/useLocalStorage.d.ts.map +0 -1
- package/dist/modules/common/hooks/useOrderAnalytics.d.ts +0 -25
- package/dist/modules/common/hooks/useOrderAnalytics.d.ts.map +0 -1
- package/dist/modules/common/hooks/useOrderItemsAnalytics.d.ts +0 -16
- package/dist/modules/common/hooks/useOrderItemsAnalytics.d.ts.map +0 -1
- package/dist/modules/common/hooks/useOutsideClick.d.ts +0 -3
- package/dist/modules/common/hooks/useOutsideClick.d.ts.map +0 -1
- package/dist/modules/common/hooks/usePortal.d.ts +0 -20
- package/dist/modules/common/hooks/usePortal.d.ts.map +0 -1
- package/dist/modules/common/hooks/useScrollRestoration.d.ts +0 -8
- package/dist/modules/common/hooks/useScrollRestoration.d.ts.map +0 -1
- package/dist/modules/common/hooks/useShopConfiguration.d.ts +0 -8
- package/dist/modules/common/hooks/useShopConfiguration.d.ts.map +0 -1
- package/dist/modules/common/hooks/useShopInfo.d.ts +0 -41
- package/dist/modules/common/hooks/useShopInfo.d.ts.map +0 -1
- package/dist/modules/common/hooks/useStatusTypes.d.ts +0 -10
- package/dist/modules/common/hooks/useStatusTypes.d.ts.map +0 -1
- package/dist/modules/common/hooks/useSystemRoles.d.ts +0 -7
- package/dist/modules/common/hooks/useSystemRoles.d.ts.map +0 -1
- package/dist/modules/common/hooks/useTheme.d.ts +0 -7
- package/dist/modules/common/hooks/useTheme.d.ts.map +0 -1
- package/dist/modules/common/utils/deBounce.d.ts +0 -3
- package/dist/modules/common/utils/deBounce.d.ts.map +0 -1
- package/dist/modules/common/utils/defaultNextImageLoader.d.ts +0 -7
- package/dist/modules/common/utils/defaultNextImageLoader.d.ts.map +0 -1
- package/dist/modules/common/utils/formatUsername.d.ts +0 -3
- package/dist/modules/common/utils/formatUsername.d.ts.map +0 -1
- package/dist/modules/common/utils/getSetupStepsConfigurationsMeta.d.ts +0 -30
- package/dist/modules/common/utils/getSetupStepsConfigurationsMeta.d.ts.map +0 -1
- package/dist/modules/common/utils/normalizeFilterKeys.d.ts +0 -4
- package/dist/modules/common/utils/normalizeFilterKeys.d.ts.map +0 -1
- package/dist/modules/common/utils/sharedContext.d.ts +0 -9
- package/dist/modules/common/utils/sharedContext.d.ts.map +0 -1
- package/dist/modules/common/utils/useFormatDateTime.d.ts +0 -16
- package/dist/modules/common/utils/useFormatDateTime.d.ts.map +0 -1
- package/dist/modules/common/utils/utils.d.ts +0 -21
- package/dist/modules/common/utils/utils.d.ts.map +0 -1
- package/dist/modules/country/fragments/CountryFragment.d.ts +0 -3
- package/dist/modules/country/fragments/CountryFragment.d.ts.map +0 -1
- package/dist/modules/country/hooks/useCountries.d.ts +0 -22
- package/dist/modules/country/hooks/useCountries.d.ts.map +0 -1
- package/dist/modules/country.js +0 -108
- package/dist/modules/currency.js +0 -119
- package/dist/modules/delivery-provider.js +0 -269
- package/dist/modules/enrollment.js +0 -431
- package/dist/modules/event.js +0 -123
- package/dist/modules/filter.js +0 -497
- package/dist/modules/forms/components/Form.d.ts +0 -8
- package/dist/modules/forms/components/Form.d.ts.map +0 -1
- package/dist/modules/forms/hooks/useField.d.ts +0 -35
- package/dist/modules/forms/hooks/useField.d.ts.map +0 -1
- package/dist/modules/forms/hooks/useForm.d.ts +0 -44
- package/dist/modules/forms/hooks/useForm.d.ts.map +0 -1
- package/dist/modules/forms/hooks/useFormContext.d.ts +0 -3
- package/dist/modules/forms/hooks/useFormContext.d.ts.map +0 -1
- package/dist/modules/forms/lib/FormContext.d.ts +0 -13
- package/dist/modules/forms/lib/FormContext.d.ts.map +0 -1
- package/dist/modules/forms/lib/clean.d.ts +0 -3
- package/dist/modules/forms/lib/clean.d.ts.map +0 -1
- package/dist/modules/forms/lib/validators.d.ts +0 -20
- package/dist/modules/forms/lib/validators.d.ts.map +0 -1
- package/dist/modules/language/fragments/LanguageFragment.d.ts +0 -3
- package/dist/modules/language/fragments/LanguageFragment.d.ts.map +0 -1
- package/dist/modules/language/hooks/useLanguages.d.ts +0 -19
- package/dist/modules/language/hooks/useLanguages.d.ts.map +0 -1
- package/dist/modules/language.js +0 -106
- package/dist/modules/modal/components/AlertMessage.d.ts +0 -9
- package/dist/modules/modal/components/AlertMessage.d.ts.map +0 -1
- package/dist/modules/modal/components/DangerMessage.d.ts +0 -13
- package/dist/modules/modal/components/DangerMessage.d.ts.map +0 -1
- package/dist/modules/modal/components/ImportResultMessage.d.ts +0 -14
- package/dist/modules/modal/components/ImportResultMessage.d.ts.map +0 -1
- package/dist/modules/modal/components/Modal.d.ts +0 -10
- package/dist/modules/modal/components/Modal.d.ts.map +0 -1
- package/dist/modules/modal/components/ModalWrapper.d.ts +0 -6
- package/dist/modules/modal/components/ModalWrapper.d.ts.map +0 -1
- package/dist/modules/modal/hooks/useModal.d.ts +0 -7
- package/dist/modules/modal/hooks/useModal.d.ts.map +0 -1
- package/dist/modules/modal/utils/ModalContext.d.ts +0 -9
- package/dist/modules/modal/utils/ModalContext.d.ts.map +0 -1
- package/dist/modules/order/fragments/OrderDetailFragment.d.ts +0 -3
- package/dist/modules/order/fragments/OrderDetailFragment.d.ts.map +0 -1
- package/dist/modules/order/fragments/OrderFragment.d.ts +0 -3
- package/dist/modules/order/fragments/OrderFragment.d.ts.map +0 -1
- package/dist/modules/order/hooks/useOrders.d.ts +0 -46
- package/dist/modules/order/hooks/useOrders.d.ts.map +0 -1
- package/dist/modules/order.js +0 -569
- package/dist/modules/payment-providers.js +0 -206
- package/dist/modules/product/hooks/useProductsCount.d.ts +0 -8
- package/dist/modules/product/hooks/useProductsCount.d.ts.map +0 -1
- package/dist/modules/product-review.js +0 -270
- package/dist/modules/product.js +0 -6914
- package/dist/modules/quotation.js +0 -324
- package/dist/modules/token.js +0 -143
- package/dist/modules/warehousing-providers.js +0 -206
- package/dist/modules/work/fragments/WorkFragment.d.ts +0 -3
- package/dist/modules/work/fragments/WorkFragment.d.ts.map +0 -1
- package/dist/modules/work/hooks/useAddWork.d.ts +0 -6
- package/dist/modules/work/hooks/useAddWork.d.ts.map +0 -1
- package/dist/modules/work/hooks/useWork.d.ts +0 -32
- package/dist/modules/work/hooks/useWork.d.ts.map +0 -1
- package/dist/modules/work.js +0 -232
- package/dist/plugins.js +0 -13
- package/dist/providers.js +0 -9
- package/dist/sdk/hooks.d.ts +0 -12
- package/dist/sdk/hooks.d.ts.map +0 -1
- package/dist/sdk/modal.d.ts +0 -7
- package/dist/sdk/modal.d.ts.map +0 -1
- package/dist/sdk/plugins.d.ts +0 -78
- package/dist/sdk/plugins.d.ts.map +0 -1
- package/dist/sdk/providers.d.ts +0 -5
- package/dist/sdk/providers.d.ts.map +0 -1
- package/dist/sdk/shims/admin-ui-plugins.d.ts +0 -3
- package/dist/sdk/shims/admin-ui-plugins.d.ts.map +0 -1
- package/dist/sdk/shims/apollo-client-react.d.ts +0 -3
- package/dist/sdk/shims/apollo-client-react.d.ts.map +0 -1
- package/dist/sdk/shims/apollo-client.d.ts +0 -3
- package/dist/sdk/shims/apollo-client.d.ts.map +0 -1
- package/dist/sdk/shims/host.d.ts +0 -17
- package/dist/sdk/shims/host.d.ts.map +0 -1
- package/dist/sdk/shims/next-head.d.ts +0 -3
- package/dist/sdk/shims/next-head.d.ts.map +0 -1
- package/dist/sdk/shims/next-image.d.ts +0 -3
- package/dist/sdk/shims/next-image.d.ts.map +0 -1
- package/dist/sdk/shims/next-link.d.ts +0 -3
- package/dist/sdk/shims/next-link.d.ts.map +0 -1
- package/dist/sdk/shims/next-router.d.ts +0 -3
- package/dist/sdk/shims/next-router.d.ts.map +0 -1
- package/dist/sdk/shims/react-dom-client.d.ts +0 -3
- package/dist/sdk/shims/react-dom-client.d.ts.map +0 -1
- package/dist/sdk/shims/react-dom.d.ts +0 -3
- package/dist/sdk/shims/react-dom.d.ts.map +0 -1
- package/dist/sdk/shims/react-hook-form.d.ts +0 -3
- package/dist/sdk/shims/react-hook-form.d.ts.map +0 -1
- package/dist/sdk/shims/react-intl.d.ts +0 -3
- package/dist/sdk/shims/react-intl.d.ts.map +0 -1
- package/dist/sdk/shims/react-jsx-runtime.d.ts +0 -3
- package/dist/sdk/shims/react-jsx-runtime.d.ts.map +0 -1
- package/dist/sdk/shims/react-toastify.d.ts +0 -3
- package/dist/sdk/shims/react-toastify.d.ts.map +0 -1
- package/dist/sdk/shims/react.d.ts +0 -3
- package/dist/sdk/shims/react.d.ts.map +0 -1
- package/dist/sdk/theme.d.ts +0 -26
- package/dist/sdk/theme.d.ts.map +0 -1
- package/dist/shims/admin-ui-plugins.js +0 -9
- package/dist/shims/apollo-client-react.js +0 -25
- package/dist/shims/apollo-client.js +0 -55
- package/dist/shims/next-head.js +0 -9
- package/dist/shims/next-image.js +0 -9
- package/dist/shims/next-link.js +0 -9
- package/dist/shims/next-router.js +0 -13
- package/dist/shims/react-dom-client.js +0 -11
- package/dist/shims/react-dom.js +0 -22
- package/dist/shims/react-hook-form.js +0 -25
- package/dist/shims/react-intl.js +0 -37
- package/dist/shims/react-jsx-runtime.js +0 -11
- package/dist/shims/react-toastify.js +0 -16
- package/dist/shims/react.js +0 -52
- package/dist/theme.js +0 -34
- package/dist/ui.js +0 -19764
- package/out/manifest.json +0 -48
- /package/out/_next/static/{4ESrB8YpR2n44PFePtbgX → jOx5PlckLwWIJ5yrvePdU}/_clientMiddlewareManifest.js +0 -0
- /package/out/_next/static/{4ESrB8YpR2n44PFePtbgX → jOx5PlckLwWIJ5yrvePdU}/_ssgManifest.js +0 -0
package/dist/chunk-PJLYVMUM.js
DELETED
|
@@ -1,3308 +0,0 @@
|
|
|
1
|
-
import { clsx_default } from './chunk-HJKRGBDG.js';
|
|
2
|
-
import { Y, r, a, y, n, o2, L, m2, l2, n2, K, p, l, f, s2 as s2$1, m, o, i2, o3, i, a2, E, n3 } from './chunk-QHR23GVH.js';
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
import * as React2 from 'react';
|
|
5
|
-
import React2__default, { createContext, isValidElement, cloneElement, useContext, useState, useRef, useCallback, useEffect, useMemo, useLayoutEffect } from 'react';
|
|
6
|
-
import * as ReactDOM2 from 'react-dom';
|
|
7
|
-
import { flushSync, createPortal } from 'react-dom';
|
|
8
|
-
|
|
9
|
-
var JSONView = ({
|
|
10
|
-
value,
|
|
11
|
-
className,
|
|
12
|
-
onChange = () => {
|
|
13
|
-
},
|
|
14
|
-
rows: defaultRows = 7,
|
|
15
|
-
...props
|
|
16
|
-
}) => {
|
|
17
|
-
const lineCount = value ? value.split("\n").length : 1;
|
|
18
|
-
const rows = Math.max(lineCount, defaultRows);
|
|
19
|
-
return /* @__PURE__ */ jsx(
|
|
20
|
-
"textarea",
|
|
21
|
-
{
|
|
22
|
-
className: clsx_default(
|
|
23
|
-
"text-black dark:bg-slate-900 dark:text-slate-200 border-transparent border-t border-t-border-subtle resize-y",
|
|
24
|
-
className
|
|
25
|
-
),
|
|
26
|
-
value,
|
|
27
|
-
onChange,
|
|
28
|
-
rows,
|
|
29
|
-
...props
|
|
30
|
-
}
|
|
31
|
-
);
|
|
32
|
-
};
|
|
33
|
-
var JSONView_default = JSONView;
|
|
34
|
-
|
|
35
|
-
// ../node_modules/react-aria/dist/private/utils/domHelpers.mjs
|
|
36
|
-
var $d447af545b77c9f1$export$b204af158042fbac = (target) => {
|
|
37
|
-
if ($d447af545b77c9f1$var$isWindow(target)) return target.document;
|
|
38
|
-
if ($d447af545b77c9f1$export$62858bae88b53fd0(target)) return target;
|
|
39
|
-
return target?.ownerDocument ?? (typeof document !== "undefined" ? document : void 0);
|
|
40
|
-
};
|
|
41
|
-
var $d447af545b77c9f1$export$f21a1ffae260145a = (target) => {
|
|
42
|
-
let ownerDocument = $d447af545b77c9f1$export$b204af158042fbac(target);
|
|
43
|
-
return ownerDocument?.defaultView ?? (typeof window !== "undefined" ? window : void 0);
|
|
44
|
-
};
|
|
45
|
-
function $d447af545b77c9f1$export$8ee0fc9ee280b4ee(value) {
|
|
46
|
-
return value !== null && typeof value === "object" && "nodeType" in value && typeof value.nodeType === "number";
|
|
47
|
-
}
|
|
48
|
-
function $d447af545b77c9f1$var$isWindow(value) {
|
|
49
|
-
return typeof value === "object" && value != null && "window" in value && value.window === value;
|
|
50
|
-
}
|
|
51
|
-
function $d447af545b77c9f1$export$62858bae88b53fd0(value) {
|
|
52
|
-
return $d447af545b77c9f1$export$8ee0fc9ee280b4ee(value) && value.nodeType === 9;
|
|
53
|
-
}
|
|
54
|
-
function $d447af545b77c9f1$export$af51f0f06c0f328a(value) {
|
|
55
|
-
return $d447af545b77c9f1$export$8ee0fc9ee280b4ee(value) && value.nodeType === 11 && "host" in value;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// ../node_modules/react-stately/dist/private/flags/flags.mjs
|
|
59
|
-
var $6a20a7989e6c817a$var$_shadowDOM = false;
|
|
60
|
-
function $6a20a7989e6c817a$export$98658e8c59125e6a() {
|
|
61
|
-
return $6a20a7989e6c817a$var$_shadowDOM;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// ../node_modules/react-aria/dist/private/utils/shadowdom/DOMFunctions.mjs
|
|
65
|
-
function $23f2114a1b82827e$export$4282f70798064fe0(node, otherNode) {
|
|
66
|
-
if (!($6a20a7989e6c817a$export$98658e8c59125e6a)()) return otherNode && node ? node.contains(otherNode) : false;
|
|
67
|
-
if (!node || !otherNode) return false;
|
|
68
|
-
let currentNode = otherNode;
|
|
69
|
-
while (currentNode != null) {
|
|
70
|
-
if (currentNode === node) return true;
|
|
71
|
-
if (typeof currentNode.assignedElements !== "function" && currentNode.assignedSlot?.parentNode)
|
|
72
|
-
currentNode = currentNode.assignedSlot.parentNode;
|
|
73
|
-
else if (($d447af545b77c9f1$export$af51f0f06c0f328a)(currentNode))
|
|
74
|
-
currentNode = currentNode.host;
|
|
75
|
-
else currentNode = currentNode.parentNode;
|
|
76
|
-
}
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
var $23f2114a1b82827e$export$cd4e5573fbe2b576 = (doc = document) => {
|
|
80
|
-
if (!($6a20a7989e6c817a$export$98658e8c59125e6a)()) return doc.activeElement;
|
|
81
|
-
let activeElement2 = doc.activeElement;
|
|
82
|
-
while (activeElement2 && "shadowRoot" in activeElement2 && activeElement2.shadowRoot?.activeElement) activeElement2 = activeElement2.shadowRoot.activeElement;
|
|
83
|
-
return activeElement2;
|
|
84
|
-
};
|
|
85
|
-
function $23f2114a1b82827e$export$e58f029f0fbfdb29(event) {
|
|
86
|
-
if (($6a20a7989e6c817a$export$98658e8c59125e6a)() && event.target instanceof Element && event.target.shadowRoot) {
|
|
87
|
-
if ("composedPath" in event) return event.composedPath()[0] ?? null;
|
|
88
|
-
else if ("composedPath" in event.nativeEvent) return event.nativeEvent.composedPath()[0] ?? null;
|
|
89
|
-
}
|
|
90
|
-
return event.target;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// ../node_modules/react-aria/dist/private/utils/focusWithoutScrolling.mjs
|
|
94
|
-
function $1969ac565cfec8d0$export$de79e2c695e052f3(element) {
|
|
95
|
-
element.focus({
|
|
96
|
-
preventScroll: true
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
var $c4867b2f328c2698$export$e5c5a5f917a5871c = typeof document !== "undefined" ? (React2__default).useLayoutEffect : () => {
|
|
100
|
-
};
|
|
101
|
-
function $a92dc41f639950be$export$525bc4921d56d4a(nativeEvent) {
|
|
102
|
-
let event = nativeEvent;
|
|
103
|
-
event.nativeEvent = nativeEvent;
|
|
104
|
-
event.isDefaultPrevented = () => event.defaultPrevented;
|
|
105
|
-
event.isPropagationStopped = () => event.cancelBubble;
|
|
106
|
-
event.persist = () => {
|
|
107
|
-
};
|
|
108
|
-
return event;
|
|
109
|
-
}
|
|
110
|
-
function $a92dc41f639950be$export$c2b7abe5d61ec696(event, target) {
|
|
111
|
-
Object.defineProperty(event, "target", {
|
|
112
|
-
value: target
|
|
113
|
-
});
|
|
114
|
-
Object.defineProperty(event, "currentTarget", {
|
|
115
|
-
value: target
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
function $a92dc41f639950be$export$715c682d09d639cc(onBlur) {
|
|
119
|
-
let stateRef = (useRef)({
|
|
120
|
-
isFocused: false,
|
|
121
|
-
observer: null
|
|
122
|
-
});
|
|
123
|
-
($c4867b2f328c2698$export$e5c5a5f917a5871c)(() => {
|
|
124
|
-
const state = stateRef.current;
|
|
125
|
-
return () => {
|
|
126
|
-
if (state.observer) {
|
|
127
|
-
state.observer.disconnect();
|
|
128
|
-
state.observer = null;
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
}, []);
|
|
132
|
-
return (useCallback)((e3) => {
|
|
133
|
-
let eventTarget = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e3);
|
|
134
|
-
if (eventTarget instanceof HTMLButtonElement || eventTarget instanceof HTMLInputElement || eventTarget instanceof HTMLTextAreaElement || eventTarget instanceof HTMLSelectElement) {
|
|
135
|
-
stateRef.current.isFocused = true;
|
|
136
|
-
let target = eventTarget;
|
|
137
|
-
let onBlurHandler = (e4) => {
|
|
138
|
-
stateRef.current.isFocused = false;
|
|
139
|
-
if (target.disabled) {
|
|
140
|
-
let event = $a92dc41f639950be$export$525bc4921d56d4a(e4);
|
|
141
|
-
onBlur?.(event);
|
|
142
|
-
}
|
|
143
|
-
if (stateRef.current.observer) {
|
|
144
|
-
stateRef.current.observer.disconnect();
|
|
145
|
-
stateRef.current.observer = null;
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
target.addEventListener("focusout", onBlurHandler, {
|
|
149
|
-
once: true
|
|
150
|
-
});
|
|
151
|
-
stateRef.current.observer = new MutationObserver(() => {
|
|
152
|
-
if (stateRef.current.isFocused && target.disabled) {
|
|
153
|
-
stateRef.current.observer?.disconnect();
|
|
154
|
-
let relatedTargetEl = target === ($23f2114a1b82827e$export$cd4e5573fbe2b576)() ? null : ($23f2114a1b82827e$export$cd4e5573fbe2b576)();
|
|
155
|
-
target.dispatchEvent(new FocusEvent("blur", {
|
|
156
|
-
relatedTarget: relatedTargetEl
|
|
157
|
-
}));
|
|
158
|
-
target.dispatchEvent(new FocusEvent("focusout", {
|
|
159
|
-
bubbles: true,
|
|
160
|
-
relatedTarget: relatedTargetEl
|
|
161
|
-
}));
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
stateRef.current.observer.observe(target, {
|
|
165
|
-
attributes: true,
|
|
166
|
-
attributeFilter: [
|
|
167
|
-
"disabled"
|
|
168
|
-
]
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
}, [
|
|
172
|
-
onBlur
|
|
173
|
-
]);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
// ../node_modules/react-aria/dist/private/utils/platform.mjs
|
|
177
|
-
function $2add3ce32c6007eb$var$testUserAgent(re) {
|
|
178
|
-
if (typeof window === "undefined" || window.navigator == null) return false;
|
|
179
|
-
let brands = window.navigator["userAgentData"]?.brands;
|
|
180
|
-
return Array.isArray(brands) && brands.some((brand) => re.test(brand.brand)) || re.test(window.navigator.userAgent);
|
|
181
|
-
}
|
|
182
|
-
function $2add3ce32c6007eb$var$testPlatform(re) {
|
|
183
|
-
return typeof window !== "undefined" && window.navigator != null ? re.test(window.navigator["userAgentData"]?.platform || window.navigator.platform) : false;
|
|
184
|
-
}
|
|
185
|
-
function $2add3ce32c6007eb$var$cached(fn) {
|
|
186
|
-
let res = null;
|
|
187
|
-
return () => {
|
|
188
|
-
if (res == null) res = fn();
|
|
189
|
-
return res;
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
var $2add3ce32c6007eb$export$9ac100e40613ea10 = $2add3ce32c6007eb$var$cached(function() {
|
|
193
|
-
return $2add3ce32c6007eb$var$testPlatform(/^Mac/i);
|
|
194
|
-
});
|
|
195
|
-
var $2add3ce32c6007eb$export$186c6964ca17d99 = $2add3ce32c6007eb$var$cached(function() {
|
|
196
|
-
return $2add3ce32c6007eb$var$testPlatform(/^iPhone/i);
|
|
197
|
-
});
|
|
198
|
-
var $2add3ce32c6007eb$export$7bef049ce92e4224 = $2add3ce32c6007eb$var$cached(function() {
|
|
199
|
-
return $2add3ce32c6007eb$var$testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
|
200
|
-
$2add3ce32c6007eb$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;
|
|
201
|
-
});
|
|
202
|
-
var $2add3ce32c6007eb$export$fedb369cb70207f1 = $2add3ce32c6007eb$var$cached(function() {
|
|
203
|
-
return $2add3ce32c6007eb$export$186c6964ca17d99() || $2add3ce32c6007eb$export$7bef049ce92e4224();
|
|
204
|
-
});
|
|
205
|
-
var $2add3ce32c6007eb$export$78551043582a6a98 = $2add3ce32c6007eb$var$cached(function() {
|
|
206
|
-
return $2add3ce32c6007eb$var$testUserAgent(/AppleWebKit/i) && ($2add3ce32c6007eb$export$fedb369cb70207f1() || !$2add3ce32c6007eb$export$6446a186d09e379e());
|
|
207
|
-
});
|
|
208
|
-
var $2add3ce32c6007eb$export$6446a186d09e379e = $2add3ce32c6007eb$var$cached(function() {
|
|
209
|
-
return $2add3ce32c6007eb$var$testUserAgent(/Chrome|CriOS|CrMo/i);
|
|
210
|
-
});
|
|
211
|
-
var $2add3ce32c6007eb$export$a11b0059900ceec8 = $2add3ce32c6007eb$var$cached(function() {
|
|
212
|
-
return $2add3ce32c6007eb$var$testUserAgent(/Android/i);
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
// ../node_modules/react-aria/dist/private/utils/isVirtualEvent.mjs
|
|
216
|
-
function $b5c62b033c25b96d$export$60278871457622de(event) {
|
|
217
|
-
if (event.pointerType === "" && event.isTrusted) return true;
|
|
218
|
-
if (($2add3ce32c6007eb$export$a11b0059900ceec8)() && event.pointerType) return event.type === "click" && event.buttons === 1;
|
|
219
|
-
return event.detail === 0 && !event.pointerType;
|
|
220
|
-
}
|
|
221
|
-
function $caaf0dd3060ed57c$export$95185d699e05d4d7(target, modifiers, setOpening = true) {
|
|
222
|
-
let { metaKey, ctrlKey, altKey, shiftKey } = modifiers;
|
|
223
|
-
let event = ($2add3ce32c6007eb$export$78551043582a6a98)() && ($2add3ce32c6007eb$export$9ac100e40613ea10)() && !($2add3ce32c6007eb$export$7bef049ce92e4224)() && true ? new KeyboardEvent("keydown", {
|
|
224
|
-
keyIdentifier: "Enter",
|
|
225
|
-
metaKey,
|
|
226
|
-
ctrlKey,
|
|
227
|
-
altKey,
|
|
228
|
-
shiftKey
|
|
229
|
-
}) : new MouseEvent("click", {
|
|
230
|
-
metaKey,
|
|
231
|
-
ctrlKey,
|
|
232
|
-
altKey,
|
|
233
|
-
shiftKey,
|
|
234
|
-
detail: 1,
|
|
235
|
-
bubbles: true,
|
|
236
|
-
cancelable: true
|
|
237
|
-
});
|
|
238
|
-
$caaf0dd3060ed57c$export$95185d699e05d4d7.isOpening = setOpening;
|
|
239
|
-
($1969ac565cfec8d0$export$de79e2c695e052f3)(target);
|
|
240
|
-
target.dispatchEvent(event);
|
|
241
|
-
$caaf0dd3060ed57c$export$95185d699e05d4d7.isOpening = false;
|
|
242
|
-
}
|
|
243
|
-
$caaf0dd3060ed57c$export$95185d699e05d4d7.isOpening = false;
|
|
244
|
-
var $8f5a2122b0992be3$var$currentModality = null;
|
|
245
|
-
var $8f5a2122b0992be3$export$901e90a13c50a14e = /* @__PURE__ */ new Set();
|
|
246
|
-
var $8f5a2122b0992be3$export$d90243b58daecda7 = /* @__PURE__ */ new Map();
|
|
247
|
-
var $8f5a2122b0992be3$var$hasEventBeforeFocus = false;
|
|
248
|
-
var $8f5a2122b0992be3$var$hasBlurredWindowRecently = false;
|
|
249
|
-
var $8f5a2122b0992be3$var$FOCUS_VISIBLE_INPUT_KEYS = {
|
|
250
|
-
Tab: true,
|
|
251
|
-
Escape: true
|
|
252
|
-
};
|
|
253
|
-
function $8f5a2122b0992be3$var$triggerChangeHandlers(modality, e3) {
|
|
254
|
-
for (let handler of $8f5a2122b0992be3$export$901e90a13c50a14e) handler(modality, e3);
|
|
255
|
-
}
|
|
256
|
-
function $8f5a2122b0992be3$var$isValidKey(e3) {
|
|
257
|
-
return !(e3.metaKey || !($2add3ce32c6007eb$export$9ac100e40613ea10)() && e3.altKey || e3.ctrlKey || e3.key === "Control" || e3.key === "Shift" || e3.key === "Meta");
|
|
258
|
-
}
|
|
259
|
-
function $8f5a2122b0992be3$var$handleKeyboardEvent(e3) {
|
|
260
|
-
$8f5a2122b0992be3$var$hasEventBeforeFocus = true;
|
|
261
|
-
if (!($caaf0dd3060ed57c$export$95185d699e05d4d7).isOpening && $8f5a2122b0992be3$var$isValidKey(e3)) {
|
|
262
|
-
$8f5a2122b0992be3$var$currentModality = "keyboard";
|
|
263
|
-
$8f5a2122b0992be3$var$triggerChangeHandlers("keyboard", e3);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
function $8f5a2122b0992be3$var$handlePointerEvent(e3) {
|
|
267
|
-
$8f5a2122b0992be3$var$currentModality = "pointer";
|
|
268
|
-
"pointerType" in e3 ? e3.pointerType : "mouse";
|
|
269
|
-
if (e3.type === "mousedown" || e3.type === "pointerdown") {
|
|
270
|
-
$8f5a2122b0992be3$var$hasEventBeforeFocus = true;
|
|
271
|
-
$8f5a2122b0992be3$var$triggerChangeHandlers("pointer", e3);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
function $8f5a2122b0992be3$var$handleClickEvent(e3) {
|
|
275
|
-
if (!($caaf0dd3060ed57c$export$95185d699e05d4d7).isOpening && ($b5c62b033c25b96d$export$60278871457622de)(e3)) {
|
|
276
|
-
$8f5a2122b0992be3$var$hasEventBeforeFocus = true;
|
|
277
|
-
$8f5a2122b0992be3$var$currentModality = "virtual";
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
function $8f5a2122b0992be3$var$handleFocusEvent(e3) {
|
|
281
|
-
let target = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e3);
|
|
282
|
-
let ownerWindow = ($d447af545b77c9f1$export$f21a1ffae260145a)(target);
|
|
283
|
-
let ownerDocument = ($d447af545b77c9f1$export$b204af158042fbac)(target);
|
|
284
|
-
if (target === ownerWindow) {
|
|
285
|
-
$8f5a2122b0992be3$var$hasBlurredWindowRecently = true;
|
|
286
|
-
return;
|
|
287
|
-
}
|
|
288
|
-
if (target === ownerDocument || !e3.isTrusted) return;
|
|
289
|
-
if (!$8f5a2122b0992be3$var$hasEventBeforeFocus && !$8f5a2122b0992be3$var$hasBlurredWindowRecently) {
|
|
290
|
-
$8f5a2122b0992be3$var$currentModality = "virtual";
|
|
291
|
-
$8f5a2122b0992be3$var$triggerChangeHandlers("virtual", e3);
|
|
292
|
-
}
|
|
293
|
-
$8f5a2122b0992be3$var$hasEventBeforeFocus = false;
|
|
294
|
-
$8f5a2122b0992be3$var$hasBlurredWindowRecently = false;
|
|
295
|
-
}
|
|
296
|
-
function $8f5a2122b0992be3$var$handleWindowBlur() {
|
|
297
|
-
$8f5a2122b0992be3$var$hasEventBeforeFocus = false;
|
|
298
|
-
$8f5a2122b0992be3$var$hasBlurredWindowRecently = true;
|
|
299
|
-
}
|
|
300
|
-
function $8f5a2122b0992be3$var$handleInvalidEvent(e3) {
|
|
301
|
-
let startingActiveElement = ($23f2114a1b82827e$export$cd4e5573fbe2b576)(($d447af545b77c9f1$export$b204af158042fbac)(($23f2114a1b82827e$export$e58f029f0fbfdb29)(e3)));
|
|
302
|
-
queueMicrotask(() => {
|
|
303
|
-
if (($23f2114a1b82827e$export$cd4e5573fbe2b576)(($d447af545b77c9f1$export$b204af158042fbac)(($23f2114a1b82827e$export$e58f029f0fbfdb29)(e3))) !== startingActiveElement) $8f5a2122b0992be3$export$8397ddfc504fdb9a("keyboard");
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
|
-
function $8f5a2122b0992be3$var$setupGlobalFocusEvents(element) {
|
|
307
|
-
if (typeof window === "undefined" || typeof document === "undefined") return;
|
|
308
|
-
const windowObject = ($d447af545b77c9f1$export$f21a1ffae260145a)(element);
|
|
309
|
-
const documentObject = ($d447af545b77c9f1$export$b204af158042fbac)(element);
|
|
310
|
-
if ($8f5a2122b0992be3$export$d90243b58daecda7.get(windowObject)) return;
|
|
311
|
-
let focus = windowObject.HTMLElement.prototype.focus;
|
|
312
|
-
Reflect.defineProperty(windowObject.HTMLElement.prototype, "focus", {
|
|
313
|
-
configurable: true,
|
|
314
|
-
writable: true,
|
|
315
|
-
value: function() {
|
|
316
|
-
$8f5a2122b0992be3$var$hasEventBeforeFocus = true;
|
|
317
|
-
focus.apply(this, arguments);
|
|
318
|
-
}
|
|
319
|
-
});
|
|
320
|
-
documentObject.addEventListener("keydown", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
|
|
321
|
-
documentObject.addEventListener("keyup", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
|
|
322
|
-
documentObject.addEventListener("click", $8f5a2122b0992be3$var$handleClickEvent, true);
|
|
323
|
-
documentObject.addEventListener("invalid", $8f5a2122b0992be3$var$handleInvalidEvent, true);
|
|
324
|
-
windowObject.addEventListener("focus", $8f5a2122b0992be3$var$handleFocusEvent, true);
|
|
325
|
-
windowObject.addEventListener("blur", $8f5a2122b0992be3$var$handleWindowBlur, false);
|
|
326
|
-
if (typeof PointerEvent !== "undefined") {
|
|
327
|
-
documentObject.addEventListener("pointerdown", $8f5a2122b0992be3$var$handlePointerEvent, true);
|
|
328
|
-
documentObject.addEventListener("pointermove", $8f5a2122b0992be3$var$handlePointerEvent, true);
|
|
329
|
-
documentObject.addEventListener("pointerup", $8f5a2122b0992be3$var$handlePointerEvent, true);
|
|
330
|
-
}
|
|
331
|
-
windowObject.addEventListener("beforeunload", () => {
|
|
332
|
-
$8f5a2122b0992be3$var$tearDownWindowFocusTracking(element);
|
|
333
|
-
}, {
|
|
334
|
-
once: true
|
|
335
|
-
});
|
|
336
|
-
$8f5a2122b0992be3$export$d90243b58daecda7.set(windowObject, {
|
|
337
|
-
focus
|
|
338
|
-
});
|
|
339
|
-
}
|
|
340
|
-
var $8f5a2122b0992be3$var$tearDownWindowFocusTracking = (element, loadListener) => {
|
|
341
|
-
const windowObject = ($d447af545b77c9f1$export$f21a1ffae260145a)(element);
|
|
342
|
-
const documentObject = ($d447af545b77c9f1$export$b204af158042fbac)(element);
|
|
343
|
-
if (loadListener) documentObject.removeEventListener("DOMContentLoaded", loadListener);
|
|
344
|
-
if (!$8f5a2122b0992be3$export$d90243b58daecda7.has(windowObject)) return;
|
|
345
|
-
Reflect.defineProperty(windowObject.HTMLElement.prototype, "focus", {
|
|
346
|
-
configurable: true,
|
|
347
|
-
writable: true,
|
|
348
|
-
value: $8f5a2122b0992be3$export$d90243b58daecda7.get(windowObject).focus
|
|
349
|
-
});
|
|
350
|
-
documentObject.removeEventListener("keydown", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
|
|
351
|
-
documentObject.removeEventListener("keyup", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
|
|
352
|
-
documentObject.removeEventListener("click", $8f5a2122b0992be3$var$handleClickEvent, true);
|
|
353
|
-
documentObject.removeEventListener("invalid", $8f5a2122b0992be3$var$handleInvalidEvent, true);
|
|
354
|
-
windowObject.removeEventListener("focus", $8f5a2122b0992be3$var$handleFocusEvent, true);
|
|
355
|
-
windowObject.removeEventListener("blur", $8f5a2122b0992be3$var$handleWindowBlur, false);
|
|
356
|
-
if (typeof PointerEvent !== "undefined") {
|
|
357
|
-
documentObject.removeEventListener("pointerdown", $8f5a2122b0992be3$var$handlePointerEvent, true);
|
|
358
|
-
documentObject.removeEventListener("pointermove", $8f5a2122b0992be3$var$handlePointerEvent, true);
|
|
359
|
-
documentObject.removeEventListener("pointerup", $8f5a2122b0992be3$var$handlePointerEvent, true);
|
|
360
|
-
}
|
|
361
|
-
$8f5a2122b0992be3$export$d90243b58daecda7.delete(windowObject);
|
|
362
|
-
};
|
|
363
|
-
function $8f5a2122b0992be3$export$2f1888112f558a7d(element) {
|
|
364
|
-
const documentObject = ($d447af545b77c9f1$export$b204af158042fbac)(element);
|
|
365
|
-
let loadListener;
|
|
366
|
-
if (documentObject.readyState !== "loading") $8f5a2122b0992be3$var$setupGlobalFocusEvents(element);
|
|
367
|
-
else {
|
|
368
|
-
loadListener = () => {
|
|
369
|
-
$8f5a2122b0992be3$var$setupGlobalFocusEvents(element);
|
|
370
|
-
};
|
|
371
|
-
documentObject.addEventListener("DOMContentLoaded", loadListener);
|
|
372
|
-
}
|
|
373
|
-
return () => $8f5a2122b0992be3$var$tearDownWindowFocusTracking(element, loadListener);
|
|
374
|
-
}
|
|
375
|
-
if (typeof document !== "undefined") $8f5a2122b0992be3$export$2f1888112f558a7d();
|
|
376
|
-
function $8f5a2122b0992be3$export$b9b3dfddab17db27() {
|
|
377
|
-
return $8f5a2122b0992be3$var$currentModality !== "pointer";
|
|
378
|
-
}
|
|
379
|
-
function $8f5a2122b0992be3$export$8397ddfc504fdb9a(modality) {
|
|
380
|
-
$8f5a2122b0992be3$var$currentModality = modality;
|
|
381
|
-
$8f5a2122b0992be3$var$triggerChangeHandlers(modality, null);
|
|
382
|
-
}
|
|
383
|
-
var $8f5a2122b0992be3$var$nonTextInputTypes = /* @__PURE__ */ new Set([
|
|
384
|
-
"checkbox",
|
|
385
|
-
"radio",
|
|
386
|
-
"range",
|
|
387
|
-
"color",
|
|
388
|
-
"file",
|
|
389
|
-
"image",
|
|
390
|
-
"button",
|
|
391
|
-
"submit",
|
|
392
|
-
"reset"
|
|
393
|
-
]);
|
|
394
|
-
function $8f5a2122b0992be3$var$isKeyboardFocusEvent(isTextInput, modality, e3) {
|
|
395
|
-
let eventTarget = e3 ? ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e3) : void 0;
|
|
396
|
-
let ownerDocument = ($d447af545b77c9f1$export$b204af158042fbac)(eventTarget);
|
|
397
|
-
let ownerWindow = ($d447af545b77c9f1$export$f21a1ffae260145a)(eventTarget);
|
|
398
|
-
const IHTMLInputElement = typeof ownerWindow !== "undefined" ? ownerWindow.HTMLInputElement : HTMLInputElement;
|
|
399
|
-
const IHTMLTextAreaElement = typeof ownerWindow !== "undefined" ? ownerWindow.HTMLTextAreaElement : HTMLTextAreaElement;
|
|
400
|
-
const IHTMLElement = typeof ownerWindow !== "undefined" ? ownerWindow.HTMLElement : HTMLElement;
|
|
401
|
-
const IKeyboardEvent = typeof ownerWindow !== "undefined" ? ownerWindow.KeyboardEvent : KeyboardEvent;
|
|
402
|
-
let activeElement2 = ($23f2114a1b82827e$export$cd4e5573fbe2b576)(ownerDocument);
|
|
403
|
-
isTextInput = isTextInput || activeElement2 instanceof IHTMLInputElement && !$8f5a2122b0992be3$var$nonTextInputTypes.has(activeElement2.type) || activeElement2 instanceof IHTMLTextAreaElement || activeElement2 instanceof IHTMLElement && activeElement2.isContentEditable;
|
|
404
|
-
return !(isTextInput && modality === "keyboard" && e3 instanceof IKeyboardEvent && !$8f5a2122b0992be3$var$FOCUS_VISIBLE_INPUT_KEYS[e3.key]);
|
|
405
|
-
}
|
|
406
|
-
function $8f5a2122b0992be3$export$ec71b4b83ac08ec3(fn, deps, opts) {
|
|
407
|
-
$8f5a2122b0992be3$var$setupGlobalFocusEvents();
|
|
408
|
-
(useEffect)(() => {
|
|
409
|
-
if (opts?.enabled === false) return;
|
|
410
|
-
let handler = (modality, e3) => {
|
|
411
|
-
if (!$8f5a2122b0992be3$var$isKeyboardFocusEvent(!!opts?.isTextInput, modality, e3)) return;
|
|
412
|
-
fn($8f5a2122b0992be3$export$b9b3dfddab17db27());
|
|
413
|
-
};
|
|
414
|
-
$8f5a2122b0992be3$export$901e90a13c50a14e.add(handler);
|
|
415
|
-
return () => {
|
|
416
|
-
$8f5a2122b0992be3$export$901e90a13c50a14e.delete(handler);
|
|
417
|
-
};
|
|
418
|
-
}, deps);
|
|
419
|
-
}
|
|
420
|
-
function $1e74c67db218ce67$export$f8168d8dd8fd66e6(props) {
|
|
421
|
-
let { isDisabled, onFocus: onFocusProp, onBlur: onBlurProp, onFocusChange } = props;
|
|
422
|
-
const onBlur = (useCallback)((e3) => {
|
|
423
|
-
if (($23f2114a1b82827e$export$e58f029f0fbfdb29)(e3) === e3.currentTarget) {
|
|
424
|
-
if (onBlurProp) onBlurProp(e3);
|
|
425
|
-
if (onFocusChange) onFocusChange(false);
|
|
426
|
-
return true;
|
|
427
|
-
}
|
|
428
|
-
}, [
|
|
429
|
-
onBlurProp,
|
|
430
|
-
onFocusChange
|
|
431
|
-
]);
|
|
432
|
-
const onSyntheticFocus = ($a92dc41f639950be$export$715c682d09d639cc)(onBlur);
|
|
433
|
-
const onFocus = (useCallback)((e3) => {
|
|
434
|
-
let eventTarget = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e3);
|
|
435
|
-
const ownerDocument = ($d447af545b77c9f1$export$b204af158042fbac)(eventTarget);
|
|
436
|
-
const activeElement2 = ownerDocument ? ($23f2114a1b82827e$export$cd4e5573fbe2b576)(ownerDocument) : ($23f2114a1b82827e$export$cd4e5573fbe2b576)();
|
|
437
|
-
if (eventTarget === e3.currentTarget && eventTarget === activeElement2) {
|
|
438
|
-
if (onFocusProp) onFocusProp(e3);
|
|
439
|
-
if (onFocusChange) onFocusChange(true);
|
|
440
|
-
onSyntheticFocus(e3);
|
|
441
|
-
}
|
|
442
|
-
}, [
|
|
443
|
-
onFocusChange,
|
|
444
|
-
onFocusProp,
|
|
445
|
-
onSyntheticFocus
|
|
446
|
-
]);
|
|
447
|
-
return {
|
|
448
|
-
focusProps: {
|
|
449
|
-
onFocus: !isDisabled && (onFocusProp || onFocusChange || onBlurProp) ? onFocus : void 0,
|
|
450
|
-
onBlur: !isDisabled && (onBlurProp || onFocusChange) ? onBlur : void 0
|
|
451
|
-
}
|
|
452
|
-
};
|
|
453
|
-
}
|
|
454
|
-
function $48a7d519b337145d$export$4eaf04e54aa8eed6() {
|
|
455
|
-
let globalListeners = (useRef)(/* @__PURE__ */ new Map());
|
|
456
|
-
let addGlobalListener = (useCallback)((eventTarget, type, listener, options) => {
|
|
457
|
-
let fn = options?.once ? (...args) => {
|
|
458
|
-
globalListeners.current.delete(listener);
|
|
459
|
-
listener(...args);
|
|
460
|
-
} : listener;
|
|
461
|
-
globalListeners.current.set(listener, {
|
|
462
|
-
type,
|
|
463
|
-
eventTarget,
|
|
464
|
-
fn,
|
|
465
|
-
options
|
|
466
|
-
});
|
|
467
|
-
eventTarget.addEventListener(type, fn, options);
|
|
468
|
-
}, []);
|
|
469
|
-
let removeGlobalListener = (useCallback)((eventTarget, type, listener, options) => {
|
|
470
|
-
let fn = globalListeners.current.get(listener)?.fn || listener;
|
|
471
|
-
eventTarget.removeEventListener(type, fn, options);
|
|
472
|
-
globalListeners.current.delete(listener);
|
|
473
|
-
}, []);
|
|
474
|
-
let removeAllGlobalListeners = (useCallback)(() => {
|
|
475
|
-
globalListeners.current.forEach((value, key) => {
|
|
476
|
-
removeGlobalListener(value.eventTarget, value.type, key, value.options);
|
|
477
|
-
});
|
|
478
|
-
}, [
|
|
479
|
-
removeGlobalListener
|
|
480
|
-
]);
|
|
481
|
-
(useEffect)(() => {
|
|
482
|
-
return removeAllGlobalListeners;
|
|
483
|
-
}, [
|
|
484
|
-
removeAllGlobalListeners
|
|
485
|
-
]);
|
|
486
|
-
return {
|
|
487
|
-
addGlobalListener,
|
|
488
|
-
removeGlobalListener,
|
|
489
|
-
removeAllGlobalListeners
|
|
490
|
-
};
|
|
491
|
-
}
|
|
492
|
-
function $2c9edc598a03d523$export$420e68273165f4ec(props) {
|
|
493
|
-
let { isDisabled, onBlurWithin, onFocusWithin, onFocusWithinChange } = props;
|
|
494
|
-
let state = (useRef)({
|
|
495
|
-
isFocusWithin: false
|
|
496
|
-
});
|
|
497
|
-
let { addGlobalListener, removeAllGlobalListeners } = ($48a7d519b337145d$export$4eaf04e54aa8eed6)();
|
|
498
|
-
let onBlur = (useCallback)((e3) => {
|
|
499
|
-
if (!($23f2114a1b82827e$export$4282f70798064fe0)(e3.currentTarget, ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e3))) return;
|
|
500
|
-
if (state.current.isFocusWithin && !($23f2114a1b82827e$export$4282f70798064fe0)(e3.currentTarget, e3.relatedTarget)) {
|
|
501
|
-
state.current.isFocusWithin = false;
|
|
502
|
-
removeAllGlobalListeners();
|
|
503
|
-
if (onBlurWithin) onBlurWithin(e3);
|
|
504
|
-
if (onFocusWithinChange) onFocusWithinChange(false);
|
|
505
|
-
}
|
|
506
|
-
}, [
|
|
507
|
-
onBlurWithin,
|
|
508
|
-
onFocusWithinChange,
|
|
509
|
-
state,
|
|
510
|
-
removeAllGlobalListeners
|
|
511
|
-
]);
|
|
512
|
-
let onSyntheticFocus = ($a92dc41f639950be$export$715c682d09d639cc)(onBlur);
|
|
513
|
-
let onFocus = (useCallback)((e3) => {
|
|
514
|
-
if (!($23f2114a1b82827e$export$4282f70798064fe0)(e3.currentTarget, ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e3))) return;
|
|
515
|
-
let eventTarget = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e3);
|
|
516
|
-
const ownerDocument = ($d447af545b77c9f1$export$b204af158042fbac)(eventTarget);
|
|
517
|
-
const activeElement2 = ($23f2114a1b82827e$export$cd4e5573fbe2b576)(ownerDocument);
|
|
518
|
-
if (!state.current.isFocusWithin && activeElement2 === eventTarget) {
|
|
519
|
-
if (onFocusWithin) onFocusWithin(e3);
|
|
520
|
-
if (onFocusWithinChange) onFocusWithinChange(true);
|
|
521
|
-
state.current.isFocusWithin = true;
|
|
522
|
-
onSyntheticFocus(e3);
|
|
523
|
-
let currentTarget = e3.currentTarget;
|
|
524
|
-
addGlobalListener(ownerDocument, "focus", (e4) => {
|
|
525
|
-
let eventTarget2 = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e4);
|
|
526
|
-
if (state.current.isFocusWithin && !($23f2114a1b82827e$export$4282f70798064fe0)(currentTarget, eventTarget2)) {
|
|
527
|
-
let nativeEvent = new ownerDocument.defaultView.FocusEvent("blur", {
|
|
528
|
-
relatedTarget: eventTarget2
|
|
529
|
-
});
|
|
530
|
-
($a92dc41f639950be$export$c2b7abe5d61ec696)(nativeEvent, currentTarget);
|
|
531
|
-
let event = ($a92dc41f639950be$export$525bc4921d56d4a)(nativeEvent);
|
|
532
|
-
onBlur(event);
|
|
533
|
-
}
|
|
534
|
-
}, {
|
|
535
|
-
capture: true
|
|
536
|
-
});
|
|
537
|
-
}
|
|
538
|
-
}, [
|
|
539
|
-
onFocusWithin,
|
|
540
|
-
onFocusWithinChange,
|
|
541
|
-
onSyntheticFocus,
|
|
542
|
-
addGlobalListener,
|
|
543
|
-
onBlur
|
|
544
|
-
]);
|
|
545
|
-
if (isDisabled) return {
|
|
546
|
-
focusWithinProps: {
|
|
547
|
-
// These cannot be null, that would conflict in mergeProps
|
|
548
|
-
onFocus: void 0,
|
|
549
|
-
onBlur: void 0
|
|
550
|
-
}
|
|
551
|
-
};
|
|
552
|
-
return {
|
|
553
|
-
focusWithinProps: {
|
|
554
|
-
onFocus,
|
|
555
|
-
onBlur
|
|
556
|
-
}
|
|
557
|
-
};
|
|
558
|
-
}
|
|
559
|
-
function $0c4a58759813079a$export$4e328f61c538687f(props = {}) {
|
|
560
|
-
let { autoFocus = false, isTextInput, within } = props;
|
|
561
|
-
let state = (useRef)({
|
|
562
|
-
isFocused: false,
|
|
563
|
-
isFocusVisible: autoFocus || ($8f5a2122b0992be3$export$b9b3dfddab17db27)()
|
|
564
|
-
});
|
|
565
|
-
let [isFocused, setFocused] = (useState)(false);
|
|
566
|
-
let [isFocusVisibleState, setFocusVisible] = (useState)(
|
|
567
|
-
// oxlint-disable-next-line react/react-compiler
|
|
568
|
-
() => state.current.isFocused && state.current.isFocusVisible
|
|
569
|
-
);
|
|
570
|
-
let updateState = (useCallback)(() => setFocusVisible(state.current.isFocused && state.current.isFocusVisible), []);
|
|
571
|
-
let onFocusChange = (useCallback)((isFocused2) => {
|
|
572
|
-
state.current.isFocused = isFocused2;
|
|
573
|
-
state.current.isFocusVisible = ($8f5a2122b0992be3$export$b9b3dfddab17db27)();
|
|
574
|
-
setFocused(isFocused2);
|
|
575
|
-
updateState();
|
|
576
|
-
}, [
|
|
577
|
-
updateState
|
|
578
|
-
]);
|
|
579
|
-
($8f5a2122b0992be3$export$ec71b4b83ac08ec3)((isFocusVisible) => {
|
|
580
|
-
state.current.isFocusVisible = isFocusVisible;
|
|
581
|
-
updateState();
|
|
582
|
-
}, [
|
|
583
|
-
isTextInput,
|
|
584
|
-
isFocused
|
|
585
|
-
], {
|
|
586
|
-
enabled: isFocused,
|
|
587
|
-
isTextInput
|
|
588
|
-
});
|
|
589
|
-
let { focusProps } = ($1e74c67db218ce67$export$f8168d8dd8fd66e6)({
|
|
590
|
-
isDisabled: within,
|
|
591
|
-
onFocusChange
|
|
592
|
-
});
|
|
593
|
-
let { focusWithinProps } = ($2c9edc598a03d523$export$420e68273165f4ec)({
|
|
594
|
-
isDisabled: !within,
|
|
595
|
-
onFocusWithinChange: onFocusChange
|
|
596
|
-
});
|
|
597
|
-
return {
|
|
598
|
-
isFocused,
|
|
599
|
-
isFocusVisible: isFocusVisibleState,
|
|
600
|
-
focusProps: within ? focusWithinProps : focusProps
|
|
601
|
-
};
|
|
602
|
-
}
|
|
603
|
-
var $e969f22b6713ca4a$var$globalIgnoreEmulatedMouseEvents = false;
|
|
604
|
-
var $e969f22b6713ca4a$var$hoverCount = 0;
|
|
605
|
-
function $e969f22b6713ca4a$var$setGlobalIgnoreEmulatedMouseEvents() {
|
|
606
|
-
$e969f22b6713ca4a$var$globalIgnoreEmulatedMouseEvents = true;
|
|
607
|
-
setTimeout(() => {
|
|
608
|
-
$e969f22b6713ca4a$var$globalIgnoreEmulatedMouseEvents = false;
|
|
609
|
-
}, 500);
|
|
610
|
-
}
|
|
611
|
-
function $e969f22b6713ca4a$var$handleGlobalPointerEvent(e3) {
|
|
612
|
-
if (e3.pointerType === "touch") $e969f22b6713ca4a$var$setGlobalIgnoreEmulatedMouseEvents();
|
|
613
|
-
}
|
|
614
|
-
function $e969f22b6713ca4a$var$setupGlobalTouchEvents() {
|
|
615
|
-
let ownerDocument = ($d447af545b77c9f1$export$b204af158042fbac)(null);
|
|
616
|
-
if (typeof ownerDocument === "undefined") return;
|
|
617
|
-
if ($e969f22b6713ca4a$var$hoverCount === 0) {
|
|
618
|
-
if (typeof PointerEvent !== "undefined") ownerDocument.addEventListener("pointerup", $e969f22b6713ca4a$var$handleGlobalPointerEvent);
|
|
619
|
-
}
|
|
620
|
-
$e969f22b6713ca4a$var$hoverCount++;
|
|
621
|
-
return () => {
|
|
622
|
-
$e969f22b6713ca4a$var$hoverCount--;
|
|
623
|
-
if ($e969f22b6713ca4a$var$hoverCount > 0) return;
|
|
624
|
-
if (typeof PointerEvent !== "undefined") ownerDocument.removeEventListener("pointerup", $e969f22b6713ca4a$var$handleGlobalPointerEvent);
|
|
625
|
-
};
|
|
626
|
-
}
|
|
627
|
-
function $e969f22b6713ca4a$export$ae780daf29e6d456(props) {
|
|
628
|
-
let { onHoverStart, onHoverChange, onHoverEnd, isDisabled } = props;
|
|
629
|
-
let [isHovered, setHovered] = (useState)(false);
|
|
630
|
-
let state = (useRef)({
|
|
631
|
-
isHovered: false,
|
|
632
|
-
ignoreEmulatedMouseEvents: false,
|
|
633
|
-
pointerType: "",
|
|
634
|
-
target: null
|
|
635
|
-
}).current;
|
|
636
|
-
(useEffect)($e969f22b6713ca4a$var$setupGlobalTouchEvents, []);
|
|
637
|
-
let { addGlobalListener, removeAllGlobalListeners } = ($48a7d519b337145d$export$4eaf04e54aa8eed6)();
|
|
638
|
-
let { hoverProps, triggerHoverEnd } = (useMemo)(() => {
|
|
639
|
-
let triggerHoverStart = (event, pointerType) => {
|
|
640
|
-
state.pointerType = pointerType;
|
|
641
|
-
if (isDisabled || pointerType === "touch" || state.isHovered || !($23f2114a1b82827e$export$4282f70798064fe0)(event.currentTarget, ($23f2114a1b82827e$export$e58f029f0fbfdb29)(event))) return;
|
|
642
|
-
state.isHovered = true;
|
|
643
|
-
let target = event.currentTarget;
|
|
644
|
-
state.target = target;
|
|
645
|
-
addGlobalListener(($d447af545b77c9f1$export$b204af158042fbac)(($23f2114a1b82827e$export$e58f029f0fbfdb29)(event)), "pointerover", (e3) => {
|
|
646
|
-
if (state.isHovered && state.target && !($23f2114a1b82827e$export$4282f70798064fe0)(state.target, ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e3)))
|
|
647
|
-
triggerHoverEnd2(e3, e3.pointerType);
|
|
648
|
-
}, {
|
|
649
|
-
capture: true
|
|
650
|
-
});
|
|
651
|
-
if (onHoverStart) onHoverStart({
|
|
652
|
-
type: "hoverstart",
|
|
653
|
-
target,
|
|
654
|
-
pointerType
|
|
655
|
-
});
|
|
656
|
-
if (onHoverChange) onHoverChange(true);
|
|
657
|
-
setHovered(true);
|
|
658
|
-
};
|
|
659
|
-
let triggerHoverEnd2 = (event, pointerType) => {
|
|
660
|
-
let target = state.target;
|
|
661
|
-
state.pointerType = "";
|
|
662
|
-
state.target = null;
|
|
663
|
-
if (pointerType === "touch" || !state.isHovered || !target) return;
|
|
664
|
-
state.isHovered = false;
|
|
665
|
-
removeAllGlobalListeners();
|
|
666
|
-
if (onHoverEnd) onHoverEnd({
|
|
667
|
-
type: "hoverend",
|
|
668
|
-
target,
|
|
669
|
-
pointerType
|
|
670
|
-
});
|
|
671
|
-
if (onHoverChange) onHoverChange(false);
|
|
672
|
-
setHovered(false);
|
|
673
|
-
};
|
|
674
|
-
let hoverProps2 = {};
|
|
675
|
-
if (typeof PointerEvent !== "undefined") {
|
|
676
|
-
hoverProps2.onPointerEnter = (e3) => {
|
|
677
|
-
if ($e969f22b6713ca4a$var$globalIgnoreEmulatedMouseEvents && e3.pointerType === "mouse") return;
|
|
678
|
-
triggerHoverStart(e3, e3.pointerType);
|
|
679
|
-
};
|
|
680
|
-
hoverProps2.onPointerLeave = (e3) => {
|
|
681
|
-
if (!isDisabled && ($23f2114a1b82827e$export$4282f70798064fe0)(e3.currentTarget, ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e3))) triggerHoverEnd2(e3, e3.pointerType);
|
|
682
|
-
};
|
|
683
|
-
}
|
|
684
|
-
return {
|
|
685
|
-
hoverProps: hoverProps2,
|
|
686
|
-
triggerHoverEnd: triggerHoverEnd2
|
|
687
|
-
};
|
|
688
|
-
}, [
|
|
689
|
-
onHoverStart,
|
|
690
|
-
onHoverChange,
|
|
691
|
-
onHoverEnd,
|
|
692
|
-
isDisabled,
|
|
693
|
-
state,
|
|
694
|
-
addGlobalListener,
|
|
695
|
-
removeAllGlobalListeners
|
|
696
|
-
]);
|
|
697
|
-
(useEffect)(() => {
|
|
698
|
-
if (isDisabled) triggerHoverEnd({
|
|
699
|
-
currentTarget: state.target
|
|
700
|
-
}, state.pointerType);
|
|
701
|
-
}, [
|
|
702
|
-
isDisabled
|
|
703
|
-
]);
|
|
704
|
-
return {
|
|
705
|
-
hoverProps,
|
|
706
|
-
isHovered
|
|
707
|
-
};
|
|
708
|
-
}
|
|
709
|
-
function E2(e3) {
|
|
710
|
-
let t2 = e3.width / 2, n6 = e3.height / 2;
|
|
711
|
-
return { top: e3.clientY - n6, right: e3.clientX + t2, bottom: e3.clientY + n6, left: e3.clientX - t2 };
|
|
712
|
-
}
|
|
713
|
-
function P(e3, t2) {
|
|
714
|
-
return !(!e3 || !t2 || e3.right < t2.left || e3.left > t2.right || e3.bottom < t2.top || e3.top > t2.bottom);
|
|
715
|
-
}
|
|
716
|
-
function w({ disabled: e3 = false } = {}) {
|
|
717
|
-
let t2 = useRef(null), [n6, l8] = useState(false), r5 = p(), o8 = o2(() => {
|
|
718
|
-
t2.current = null, l8(false), r5.dispose();
|
|
719
|
-
}), f8 = o2((s6) => {
|
|
720
|
-
if (r5.dispose(), t2.current === null) {
|
|
721
|
-
t2.current = s6.currentTarget, l8(true);
|
|
722
|
-
{
|
|
723
|
-
let i4 = l(s6.currentTarget);
|
|
724
|
-
r5.addEventListener(i4, "pointerup", o8, false), r5.addEventListener(i4, "pointermove", (c6) => {
|
|
725
|
-
if (t2.current) {
|
|
726
|
-
let p4 = E2(c6);
|
|
727
|
-
l8(P(p4, t2.current.getBoundingClientRect()));
|
|
728
|
-
}
|
|
729
|
-
}, false), r5.addEventListener(i4, "pointercancel", o8, false);
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
});
|
|
733
|
-
return { pressed: n6, pressProps: e3 ? {} : { onPointerDown: f8, onPointerUp: o8, onClick: o8 } };
|
|
734
|
-
}
|
|
735
|
-
function b(l8, r5, c6) {
|
|
736
|
-
let [i4, s6] = useState(c6), e3 = l8 !== void 0, t2 = useRef(e3), u8 = useRef(false), d2 = useRef(false);
|
|
737
|
-
return e3 && !t2.current && !u8.current ? (u8.current = true, t2.current = e3, console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")) : !e3 && t2.current && !d2.current && (d2.current = true, t2.current = e3, console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")), [e3 ? l8 : i4, o2((n6) => (e3 || flushSync(() => s6(n6)), r5 == null ? void 0 : r5(n6)))];
|
|
738
|
-
}
|
|
739
|
-
function l3(e3) {
|
|
740
|
-
let [t2] = useState(e3);
|
|
741
|
-
return t2;
|
|
742
|
-
}
|
|
743
|
-
function p2(t2 = {}, i4 = null, n6 = []) {
|
|
744
|
-
for (let [e3, o8] of Object.entries(t2)) s2(n6, r2(i4, e3), o8);
|
|
745
|
-
return n6;
|
|
746
|
-
}
|
|
747
|
-
function r2(t2, i4) {
|
|
748
|
-
return t2 ? t2 + "[" + i4 + "]" : i4;
|
|
749
|
-
}
|
|
750
|
-
function s2(t2, i4, n6) {
|
|
751
|
-
if (Array.isArray(n6)) for (let [e3, o8] of n6.entries()) s2(t2, r2(i4, e3.toString()), o8);
|
|
752
|
-
else n6 instanceof Date ? t2.push([i4, n6.toISOString()]) : typeof n6 == "boolean" ? t2.push([i4, n6 ? "1" : "0"]) : typeof n6 == "string" ? t2.push([i4, n6]) : typeof n6 == "number" ? t2.push([i4, `${n6}`]) : n6 == null ? t2.push([i4, ""]) : c(n6) && !isValidElement(n6) && p2(n6, i4, t2);
|
|
753
|
-
}
|
|
754
|
-
function g(t2) {
|
|
755
|
-
var n6, e3;
|
|
756
|
-
let i4 = (n6 = t2 == null ? void 0 : t2.form) != null ? n6 : t2.closest("form");
|
|
757
|
-
if (i4) {
|
|
758
|
-
for (let o8 of i4.elements) if (o8 !== t2 && (o8.tagName === "INPUT" && o8.type === "submit" || o8.tagName === "BUTTON" && o8.type === "submit" || o8.nodeName === "INPUT" && o8.type === "image")) {
|
|
759
|
-
o8.click();
|
|
760
|
-
return;
|
|
761
|
-
}
|
|
762
|
-
(e3 = i4.requestSubmit) == null || e3.call(i4);
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
function c(t2) {
|
|
766
|
-
if (Object.prototype.toString.call(t2) !== "[object Object]") return false;
|
|
767
|
-
let i4 = Object.getPrototypeOf(t2);
|
|
768
|
-
return i4 === null || Object.getPrototypeOf(i4) === null;
|
|
769
|
-
}
|
|
770
|
-
var f4 = createContext(null);
|
|
771
|
-
function c2({ children: t2 }) {
|
|
772
|
-
let e3 = useContext(f4);
|
|
773
|
-
if (!e3) return React2__default.createElement(React2__default.Fragment, null, t2);
|
|
774
|
-
let { target: r5 } = e3;
|
|
775
|
-
return r5 ? createPortal(React2__default.createElement(React2__default.Fragment, null, t2), r5) : null;
|
|
776
|
-
}
|
|
777
|
-
function j({ data: t2, form: e3, disabled: r5, onReset: n6, overrides: F }) {
|
|
778
|
-
let [i4, a8] = useState(null), p4 = p();
|
|
779
|
-
return useEffect(() => {
|
|
780
|
-
if (n6 && i4) return p4.addEventListener(i4, "reset", n6);
|
|
781
|
-
}, [i4, e3, n6]), React2__default.createElement(c2, null, React2__default.createElement(C, { setForm: a8, formId: e3 }), p2(t2).map(([s6, v3]) => React2__default.createElement(f, { features: s2$1.Hidden, ...m({ key: s6, as: "input", type: "hidden", hidden: true, readOnly: true, form: e3, disabled: r5, name: s6, value: v3, ...F }) })));
|
|
782
|
-
}
|
|
783
|
-
function C({ setForm: t2, formId: e3 }) {
|
|
784
|
-
return useEffect(() => {
|
|
785
|
-
if (e3) {
|
|
786
|
-
let r5 = document.getElementById(e3);
|
|
787
|
-
r5 && t2(r5);
|
|
788
|
-
}
|
|
789
|
-
}, [t2, e3]), e3 ? null : React2__default.createElement(f, { features: s2$1.Hidden, as: "input", type: "hidden", hidden: true, readOnly: true, ref: (r5) => {
|
|
790
|
-
if (!r5) return;
|
|
791
|
-
let n6 = r5.closest("form");
|
|
792
|
-
n6 && t2(n6);
|
|
793
|
-
} });
|
|
794
|
-
}
|
|
795
|
-
var e = createContext(void 0);
|
|
796
|
-
function u3() {
|
|
797
|
-
return useContext(e);
|
|
798
|
-
}
|
|
799
|
-
var L2 = createContext(null);
|
|
800
|
-
L2.displayName = "LabelContext";
|
|
801
|
-
function C2() {
|
|
802
|
-
let n6 = useContext(L2);
|
|
803
|
-
if (n6 === null) {
|
|
804
|
-
let l8 = new Error("You used a <Label /> component, but it is not inside a relevant parent.");
|
|
805
|
-
throw Error.captureStackTrace && Error.captureStackTrace(l8, C2), l8;
|
|
806
|
-
}
|
|
807
|
-
return n6;
|
|
808
|
-
}
|
|
809
|
-
function N(n6) {
|
|
810
|
-
var a8, e3, o8;
|
|
811
|
-
let l8 = (e3 = (a8 = useContext(L2)) == null ? void 0 : a8.value) != null ? e3 : void 0;
|
|
812
|
-
return ((o8 = n6 == null ? void 0 : n6.length) != null ? o8 : 0) > 0 ? [l8, ...n6].filter(Boolean).join(" ") : l8;
|
|
813
|
-
}
|
|
814
|
-
function V({ inherit: n6 = false } = {}) {
|
|
815
|
-
let l8 = N(), [a8, e3] = useState([]), o8 = n6 ? [l8, ...a8].filter(Boolean) : a8;
|
|
816
|
-
return [o8.length > 0 ? o8.join(" ") : void 0, useMemo(() => function(t2) {
|
|
817
|
-
let p4 = o2((i4) => (e3((u8) => [...u8, i4]), () => e3((u8) => {
|
|
818
|
-
let d2 = u8.slice(), f8 = d2.indexOf(i4);
|
|
819
|
-
return f8 !== -1 && d2.splice(f8, 1), d2;
|
|
820
|
-
}))), b2 = useMemo(() => ({ register: p4, slot: t2.slot, name: t2.name, props: t2.props, value: t2.value }), [p4, t2.slot, t2.name, t2.props, t2.value]);
|
|
821
|
-
return React2__default.createElement(L2.Provider, { value: b2 }, t2.children);
|
|
822
|
-
}, [e3])];
|
|
823
|
-
}
|
|
824
|
-
var G = "label";
|
|
825
|
-
function U(n6, l8) {
|
|
826
|
-
var y3;
|
|
827
|
-
let a8 = r(), e3 = C2(), o8 = u3(), T2 = a(), { id: t2 = `headlessui-label-${a8}`, htmlFor: p4 = o8 != null ? o8 : (y3 = e3.props) == null ? void 0 : y3.htmlFor, passive: b2 = false, ...i4 } = n6, u8 = y(l8);
|
|
828
|
-
n(() => e3.register(t2), [t2, e3.register]);
|
|
829
|
-
let d2 = o2((s6) => {
|
|
830
|
-
let g4 = s6.currentTarget;
|
|
831
|
-
if (!(s6.target !== s6.currentTarget && L(s6.target)) && (m2(g4) && s6.preventDefault(), e3.props && "onClick" in e3.props && typeof e3.props.onClick == "function" && e3.props.onClick(s6), m2(g4))) {
|
|
832
|
-
let r5 = document.getElementById(g4.htmlFor);
|
|
833
|
-
if (r5) {
|
|
834
|
-
let E4 = r5.getAttribute("disabled");
|
|
835
|
-
if (E4 === "true" || E4 === "") return;
|
|
836
|
-
let x = r5.getAttribute("aria-disabled");
|
|
837
|
-
if (x === "true" || x === "") return;
|
|
838
|
-
(l2(r5) && (r5.type === "file" || r5.type === "radio" || r5.type === "checkbox") || r5.role === "radio" || r5.role === "checkbox" || r5.role === "switch") && r5.click(), r5.focus({ preventScroll: true });
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
|
-
}), f8 = n2({ ...e3.slot, disabled: T2 || false }), c6 = { ref: u8, ...e3.props, id: t2, htmlFor: p4, onClick: d2 };
|
|
842
|
-
return b2 && ("onClick" in c6 && (delete c6.htmlFor, delete c6.onClick), "onClick" in i4 && delete i4.onClick), K()({ ourProps: c6, theirProps: i4, slot: f8, defaultTag: p4 ? G : "div", name: e3.name || "Label" });
|
|
843
|
-
}
|
|
844
|
-
var j2 = Y(U);
|
|
845
|
-
var Z = Object.assign(j2, {});
|
|
846
|
-
function l4(e3, r5) {
|
|
847
|
-
return e3 !== null && r5 !== null && typeof e3 == "object" && typeof r5 == "object" && "id" in e3 && "id" in r5 ? e3.id === r5.id : e3 === r5;
|
|
848
|
-
}
|
|
849
|
-
function u4(e3 = l4) {
|
|
850
|
-
return useCallback((r5, t2) => {
|
|
851
|
-
if (typeof e3 == "string") {
|
|
852
|
-
let o8 = e3;
|
|
853
|
-
return (r5 == null ? void 0 : r5[o8]) === (t2 == null ? void 0 : t2[o8]);
|
|
854
|
-
}
|
|
855
|
-
return e3(r5, t2);
|
|
856
|
-
}, [e3]);
|
|
857
|
-
}
|
|
858
|
-
function h2(i4) {
|
|
859
|
-
if (i4 === null) return { width: 0, height: 0 };
|
|
860
|
-
let { width: t2, height: e3 } = i4.getBoundingClientRect();
|
|
861
|
-
return { width: t2, height: e3 };
|
|
862
|
-
}
|
|
863
|
-
function w2(i4, t2, e3 = false) {
|
|
864
|
-
let [r5, f8] = useState(() => h2(t2));
|
|
865
|
-
return n(() => {
|
|
866
|
-
if (!t2 || !i4) return;
|
|
867
|
-
let n6 = o();
|
|
868
|
-
return n6.requestAnimationFrame(function s6() {
|
|
869
|
-
n6.requestAnimationFrame(s6), f8((u8) => {
|
|
870
|
-
let o8 = h2(t2);
|
|
871
|
-
return o8.width === u8.width && o8.height === u8.height ? u8 : o8;
|
|
872
|
-
});
|
|
873
|
-
}), () => {
|
|
874
|
-
n6.dispose();
|
|
875
|
-
};
|
|
876
|
-
}, [t2, i4]), e3 ? { width: `${r5.width}px`, height: `${r5.height}px` } : r5;
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
// ../node_modules/@headlessui/react/dist/components/mouse.js
|
|
880
|
-
var g3 = ((f8) => (f8[f8.Left = 0] = "Left", f8[f8.Right = 2] = "Right", f8))(g3 || {});
|
|
881
|
-
|
|
882
|
-
// ../node_modules/@headlessui/react/dist/utils/bugs.js
|
|
883
|
-
function s3(l8) {
|
|
884
|
-
let e3 = l8.parentElement, t2 = null;
|
|
885
|
-
for (; e3 && !a2(e3); ) E(e3) && (t2 = e3), e3 = e3.parentElement;
|
|
886
|
-
let i4 = (e3 == null ? void 0 : e3.getAttribute("disabled")) === "";
|
|
887
|
-
return i4 && r3(t2) ? false : i4;
|
|
888
|
-
}
|
|
889
|
-
function r3(l8) {
|
|
890
|
-
if (!l8) return false;
|
|
891
|
-
let e3 = l8.previousElementSibling;
|
|
892
|
-
for (; e3 !== null; ) {
|
|
893
|
-
if (E(e3)) return false;
|
|
894
|
-
e3 = e3.previousElementSibling;
|
|
895
|
-
}
|
|
896
|
-
return true;
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
// ../node_modules/@headlessui/react/dist/hooks/use-handle-toggle.js
|
|
900
|
-
function s4(t2) {
|
|
901
|
-
let r5 = useRef(null), u8 = o2((e3) => {
|
|
902
|
-
r5.current = e3.pointerType, !s3(e3.currentTarget) && e3.pointerType === "mouse" && e3.button === g3.Left && (e3.preventDefault(), t2(e3));
|
|
903
|
-
}), i4 = o2((e3) => {
|
|
904
|
-
r5.current !== "mouse" && (s3(e3.currentTarget) || t2(e3));
|
|
905
|
-
});
|
|
906
|
-
return { onPointerDown: u8, onClick: i4 };
|
|
907
|
-
}
|
|
908
|
-
var H2 = ((e3) => (e3[e3.Ignore = 0] = "Ignore", e3[e3.Select = 1] = "Select", e3[e3.Close = 2] = "Close", e3))(H2 || {});
|
|
909
|
-
var S = { Ignore: { kind: 0 }, Select: (r5) => ({ kind: 1, target: r5 }), Close: { kind: 2 } };
|
|
910
|
-
var M = 200;
|
|
911
|
-
var f5 = 5;
|
|
912
|
-
function L3(r5, { trigger: n6, action: T2, close: e3, select: p4 }) {
|
|
913
|
-
let l8 = useRef(null), i4 = useRef(null), u8 = useRef(null);
|
|
914
|
-
i2(r5 && n6 !== null, "pointerdown", (t2) => {
|
|
915
|
-
o3(t2 == null ? void 0 : t2.target) && n6 != null && n6.contains(t2.target) && (i4.current = t2.x, u8.current = t2.y, l8.current = t2.timeStamp);
|
|
916
|
-
}), i2(r5 && n6 !== null, "pointerup", (t2) => {
|
|
917
|
-
var s6, m5;
|
|
918
|
-
let c6 = l8.current;
|
|
919
|
-
if (c6 === null || (l8.current = null, !i(t2.target)) || Math.abs(t2.x - ((s6 = i4.current) != null ? s6 : t2.x)) < f5 && Math.abs(t2.y - ((m5 = u8.current) != null ? m5 : t2.y)) < f5) return;
|
|
920
|
-
let a8 = T2(t2);
|
|
921
|
-
switch (a8.kind) {
|
|
922
|
-
case 0:
|
|
923
|
-
return;
|
|
924
|
-
case 1: {
|
|
925
|
-
t2.timeStamp - c6 > M && (p4(a8.target), e3());
|
|
926
|
-
break;
|
|
927
|
-
}
|
|
928
|
-
case 2: {
|
|
929
|
-
e3();
|
|
930
|
-
break;
|
|
931
|
-
}
|
|
932
|
-
}
|
|
933
|
-
}, { capture: true });
|
|
934
|
-
}
|
|
935
|
-
function e2(t2, u8) {
|
|
936
|
-
return useMemo(() => {
|
|
937
|
-
var n6;
|
|
938
|
-
if (t2.type) return t2.type;
|
|
939
|
-
let r5 = (n6 = t2.as) != null ? n6 : "button";
|
|
940
|
-
if (typeof r5 == "string" && r5.toLowerCase() === "button" || (u8 == null ? void 0 : u8.tagName) === "BUTTON" && !u8.hasAttribute("type")) return "button";
|
|
941
|
-
}, [t2.type, t2.as, u8]);
|
|
942
|
-
}
|
|
943
|
-
function t(e3) {
|
|
944
|
-
return [e3.screenX, e3.screenY];
|
|
945
|
-
}
|
|
946
|
-
function u5() {
|
|
947
|
-
let e3 = useRef([-1, -1]);
|
|
948
|
-
return { wasMoved(r5) {
|
|
949
|
-
let n6 = t(r5);
|
|
950
|
-
return e3.current[0] === n6[0] && e3.current[1] === n6[1] ? false : (e3.current = n6, true);
|
|
951
|
-
}, update(r5) {
|
|
952
|
-
e3.current = t(r5);
|
|
953
|
-
} };
|
|
954
|
-
}
|
|
955
|
-
|
|
956
|
-
// ../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
|
|
957
|
-
function hasWindow() {
|
|
958
|
-
return typeof window !== "undefined";
|
|
959
|
-
}
|
|
960
|
-
function getNodeName(node) {
|
|
961
|
-
if (isNode(node)) {
|
|
962
|
-
return (node.nodeName || "").toLowerCase();
|
|
963
|
-
}
|
|
964
|
-
return "#document";
|
|
965
|
-
}
|
|
966
|
-
function getWindow(node) {
|
|
967
|
-
var _node$ownerDocument;
|
|
968
|
-
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
969
|
-
}
|
|
970
|
-
function getDocumentElement(node) {
|
|
971
|
-
var _ref;
|
|
972
|
-
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
973
|
-
}
|
|
974
|
-
function isNode(value) {
|
|
975
|
-
if (!hasWindow()) {
|
|
976
|
-
return false;
|
|
977
|
-
}
|
|
978
|
-
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
979
|
-
}
|
|
980
|
-
function isElement(value) {
|
|
981
|
-
if (!hasWindow()) {
|
|
982
|
-
return false;
|
|
983
|
-
}
|
|
984
|
-
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
985
|
-
}
|
|
986
|
-
function isHTMLElement(value) {
|
|
987
|
-
if (!hasWindow()) {
|
|
988
|
-
return false;
|
|
989
|
-
}
|
|
990
|
-
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
991
|
-
}
|
|
992
|
-
function isShadowRoot(value) {
|
|
993
|
-
if (!hasWindow() || typeof ShadowRoot === "undefined") {
|
|
994
|
-
return false;
|
|
995
|
-
}
|
|
996
|
-
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
997
|
-
}
|
|
998
|
-
function isOverflowElement(element) {
|
|
999
|
-
const {
|
|
1000
|
-
overflow,
|
|
1001
|
-
overflowX,
|
|
1002
|
-
overflowY,
|
|
1003
|
-
display
|
|
1004
|
-
} = getComputedStyle2(element);
|
|
1005
|
-
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== "inline" && display !== "contents";
|
|
1006
|
-
}
|
|
1007
|
-
function isTableElement(element) {
|
|
1008
|
-
return /^(table|td|th)$/.test(getNodeName(element));
|
|
1009
|
-
}
|
|
1010
|
-
function isTopLayer(element) {
|
|
1011
|
-
try {
|
|
1012
|
-
if (element.matches(":popover-open")) {
|
|
1013
|
-
return true;
|
|
1014
|
-
}
|
|
1015
|
-
} catch (_e) {
|
|
1016
|
-
}
|
|
1017
|
-
try {
|
|
1018
|
-
return element.matches(":modal");
|
|
1019
|
-
} catch (_e) {
|
|
1020
|
-
return false;
|
|
1021
|
-
}
|
|
1022
|
-
}
|
|
1023
|
-
var willChangeRe = /transform|translate|scale|rotate|perspective|filter/;
|
|
1024
|
-
var containRe = /paint|layout|strict|content/;
|
|
1025
|
-
var isNotNone = (value) => !!value && value !== "none";
|
|
1026
|
-
var isWebKitValue;
|
|
1027
|
-
function isContainingBlock(elementOrCss) {
|
|
1028
|
-
const css = isElement(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss;
|
|
1029
|
-
return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || "") || containRe.test(css.contain || "");
|
|
1030
|
-
}
|
|
1031
|
-
function getContainingBlock(element) {
|
|
1032
|
-
let currentNode = getParentNode(element);
|
|
1033
|
-
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
1034
|
-
if (isContainingBlock(currentNode)) {
|
|
1035
|
-
return currentNode;
|
|
1036
|
-
} else if (isTopLayer(currentNode)) {
|
|
1037
|
-
return null;
|
|
1038
|
-
}
|
|
1039
|
-
currentNode = getParentNode(currentNode);
|
|
1040
|
-
}
|
|
1041
|
-
return null;
|
|
1042
|
-
}
|
|
1043
|
-
function isWebKit() {
|
|
1044
|
-
if (isWebKitValue == null) {
|
|
1045
|
-
isWebKitValue = typeof CSS !== "undefined" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none");
|
|
1046
|
-
}
|
|
1047
|
-
return isWebKitValue;
|
|
1048
|
-
}
|
|
1049
|
-
function isLastTraversableNode(node) {
|
|
1050
|
-
return /^(html|body|#document)$/.test(getNodeName(node));
|
|
1051
|
-
}
|
|
1052
|
-
function getComputedStyle2(element) {
|
|
1053
|
-
return getWindow(element).getComputedStyle(element);
|
|
1054
|
-
}
|
|
1055
|
-
function getNodeScroll(element) {
|
|
1056
|
-
if (isElement(element)) {
|
|
1057
|
-
return {
|
|
1058
|
-
scrollLeft: element.scrollLeft,
|
|
1059
|
-
scrollTop: element.scrollTop
|
|
1060
|
-
};
|
|
1061
|
-
}
|
|
1062
|
-
return {
|
|
1063
|
-
scrollLeft: element.scrollX,
|
|
1064
|
-
scrollTop: element.scrollY
|
|
1065
|
-
};
|
|
1066
|
-
}
|
|
1067
|
-
function getParentNode(node) {
|
|
1068
|
-
if (getNodeName(node) === "html") {
|
|
1069
|
-
return node;
|
|
1070
|
-
}
|
|
1071
|
-
const result = (
|
|
1072
|
-
// Step into the shadow DOM of the parent of a slotted node.
|
|
1073
|
-
node.assignedSlot || // DOM Element detected.
|
|
1074
|
-
node.parentNode || // ShadowRoot detected.
|
|
1075
|
-
isShadowRoot(node) && node.host || // Fallback.
|
|
1076
|
-
getDocumentElement(node)
|
|
1077
|
-
);
|
|
1078
|
-
return isShadowRoot(result) ? result.host : result;
|
|
1079
|
-
}
|
|
1080
|
-
function getNearestOverflowAncestor(node) {
|
|
1081
|
-
const parentNode = getParentNode(node);
|
|
1082
|
-
if (isLastTraversableNode(parentNode)) {
|
|
1083
|
-
return (node.ownerDocument || node).body;
|
|
1084
|
-
}
|
|
1085
|
-
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
1086
|
-
return parentNode;
|
|
1087
|
-
}
|
|
1088
|
-
return getNearestOverflowAncestor(parentNode);
|
|
1089
|
-
}
|
|
1090
|
-
function getOverflowAncestors(node, list, traverseIframes) {
|
|
1091
|
-
var _node$ownerDocument2;
|
|
1092
|
-
if (list === void 0) {
|
|
1093
|
-
list = [];
|
|
1094
|
-
}
|
|
1095
|
-
if (traverseIframes === void 0) {
|
|
1096
|
-
traverseIframes = true;
|
|
1097
|
-
}
|
|
1098
|
-
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
1099
|
-
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
1100
|
-
const win = getWindow(scrollableAncestor);
|
|
1101
|
-
if (isBody) {
|
|
1102
|
-
const frameElement = getFrameElement(win);
|
|
1103
|
-
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
1104
|
-
} else {
|
|
1105
|
-
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
1106
|
-
}
|
|
1107
|
-
}
|
|
1108
|
-
function getFrameElement(win) {
|
|
1109
|
-
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
1110
|
-
}
|
|
1111
|
-
|
|
1112
|
-
// ../node_modules/@floating-ui/react/dist/floating-ui.react.utils.mjs
|
|
1113
|
-
function getUserAgent() {
|
|
1114
|
-
const uaData = navigator.userAgentData;
|
|
1115
|
-
if (uaData && Array.isArray(uaData.brands)) {
|
|
1116
|
-
return uaData.brands.map((_ref) => {
|
|
1117
|
-
let {
|
|
1118
|
-
brand,
|
|
1119
|
-
version
|
|
1120
|
-
} = _ref;
|
|
1121
|
-
return brand + "/" + version;
|
|
1122
|
-
}).join(" ");
|
|
1123
|
-
}
|
|
1124
|
-
return navigator.userAgent;
|
|
1125
|
-
}
|
|
1126
|
-
|
|
1127
|
-
// ../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
1128
|
-
var min = Math.min;
|
|
1129
|
-
var max = Math.max;
|
|
1130
|
-
var round = Math.round;
|
|
1131
|
-
var floor = Math.floor;
|
|
1132
|
-
var createCoords = (v3) => ({
|
|
1133
|
-
x: v3,
|
|
1134
|
-
y: v3
|
|
1135
|
-
});
|
|
1136
|
-
var oppositeSideMap = {
|
|
1137
|
-
left: "right",
|
|
1138
|
-
right: "left",
|
|
1139
|
-
bottom: "top",
|
|
1140
|
-
top: "bottom"
|
|
1141
|
-
};
|
|
1142
|
-
function clamp(start, value, end) {
|
|
1143
|
-
return max(start, min(value, end));
|
|
1144
|
-
}
|
|
1145
|
-
function evaluate(value, param) {
|
|
1146
|
-
return typeof value === "function" ? value(param) : value;
|
|
1147
|
-
}
|
|
1148
|
-
function getSide(placement) {
|
|
1149
|
-
return placement.split("-")[0];
|
|
1150
|
-
}
|
|
1151
|
-
function getAlignment(placement) {
|
|
1152
|
-
return placement.split("-")[1];
|
|
1153
|
-
}
|
|
1154
|
-
function getOppositeAxis(axis) {
|
|
1155
|
-
return axis === "x" ? "y" : "x";
|
|
1156
|
-
}
|
|
1157
|
-
function getAxisLength(axis) {
|
|
1158
|
-
return axis === "y" ? "height" : "width";
|
|
1159
|
-
}
|
|
1160
|
-
function getSideAxis(placement) {
|
|
1161
|
-
const firstChar = placement[0];
|
|
1162
|
-
return firstChar === "t" || firstChar === "b" ? "y" : "x";
|
|
1163
|
-
}
|
|
1164
|
-
function getAlignmentAxis(placement) {
|
|
1165
|
-
return getOppositeAxis(getSideAxis(placement));
|
|
1166
|
-
}
|
|
1167
|
-
function getAlignmentSides(placement, rects, rtl) {
|
|
1168
|
-
if (rtl === void 0) {
|
|
1169
|
-
rtl = false;
|
|
1170
|
-
}
|
|
1171
|
-
const alignment = getAlignment(placement);
|
|
1172
|
-
const alignmentAxis = getAlignmentAxis(placement);
|
|
1173
|
-
const length = getAxisLength(alignmentAxis);
|
|
1174
|
-
let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
|
|
1175
|
-
if (rects.reference[length] > rects.floating[length]) {
|
|
1176
|
-
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
1177
|
-
}
|
|
1178
|
-
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
1179
|
-
}
|
|
1180
|
-
function getExpandedPlacements(placement) {
|
|
1181
|
-
const oppositePlacement = getOppositePlacement(placement);
|
|
1182
|
-
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
1183
|
-
}
|
|
1184
|
-
function getOppositeAlignmentPlacement(placement) {
|
|
1185
|
-
return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start");
|
|
1186
|
-
}
|
|
1187
|
-
var lrPlacement = ["left", "right"];
|
|
1188
|
-
var rlPlacement = ["right", "left"];
|
|
1189
|
-
var tbPlacement = ["top", "bottom"];
|
|
1190
|
-
var btPlacement = ["bottom", "top"];
|
|
1191
|
-
function getSideList(side, isStart, rtl) {
|
|
1192
|
-
switch (side) {
|
|
1193
|
-
case "top":
|
|
1194
|
-
case "bottom":
|
|
1195
|
-
if (rtl) return isStart ? rlPlacement : lrPlacement;
|
|
1196
|
-
return isStart ? lrPlacement : rlPlacement;
|
|
1197
|
-
case "left":
|
|
1198
|
-
case "right":
|
|
1199
|
-
return isStart ? tbPlacement : btPlacement;
|
|
1200
|
-
default:
|
|
1201
|
-
return [];
|
|
1202
|
-
}
|
|
1203
|
-
}
|
|
1204
|
-
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
1205
|
-
const alignment = getAlignment(placement);
|
|
1206
|
-
let list = getSideList(getSide(placement), direction === "start", rtl);
|
|
1207
|
-
if (alignment) {
|
|
1208
|
-
list = list.map((side) => side + "-" + alignment);
|
|
1209
|
-
if (flipAlignment) {
|
|
1210
|
-
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
1211
|
-
}
|
|
1212
|
-
}
|
|
1213
|
-
return list;
|
|
1214
|
-
}
|
|
1215
|
-
function getOppositePlacement(placement) {
|
|
1216
|
-
const side = getSide(placement);
|
|
1217
|
-
return oppositeSideMap[side] + placement.slice(side.length);
|
|
1218
|
-
}
|
|
1219
|
-
function expandPaddingObject(padding) {
|
|
1220
|
-
var _padding$top, _padding$right, _padding$bottom, _padding$left;
|
|
1221
|
-
return {
|
|
1222
|
-
top: (_padding$top = padding.top) != null ? _padding$top : 0,
|
|
1223
|
-
right: (_padding$right = padding.right) != null ? _padding$right : 0,
|
|
1224
|
-
bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0,
|
|
1225
|
-
left: (_padding$left = padding.left) != null ? _padding$left : 0
|
|
1226
|
-
};
|
|
1227
|
-
}
|
|
1228
|
-
function getPaddingObject(padding) {
|
|
1229
|
-
return typeof padding !== "number" ? expandPaddingObject(padding) : {
|
|
1230
|
-
top: padding,
|
|
1231
|
-
right: padding,
|
|
1232
|
-
bottom: padding,
|
|
1233
|
-
left: padding
|
|
1234
|
-
};
|
|
1235
|
-
}
|
|
1236
|
-
function rectToClientRect(rect) {
|
|
1237
|
-
const {
|
|
1238
|
-
x,
|
|
1239
|
-
y: y3,
|
|
1240
|
-
width,
|
|
1241
|
-
height
|
|
1242
|
-
} = rect;
|
|
1243
|
-
return {
|
|
1244
|
-
width,
|
|
1245
|
-
height,
|
|
1246
|
-
top: y3,
|
|
1247
|
-
left: x,
|
|
1248
|
-
right: x + width,
|
|
1249
|
-
bottom: y3 + height,
|
|
1250
|
-
x,
|
|
1251
|
-
y: y3
|
|
1252
|
-
};
|
|
1253
|
-
}
|
|
1254
|
-
|
|
1255
|
-
// ../node_modules/@floating-ui/core/dist/floating-ui.core.mjs
|
|
1256
|
-
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
1257
|
-
let {
|
|
1258
|
-
reference,
|
|
1259
|
-
floating
|
|
1260
|
-
} = _ref;
|
|
1261
|
-
const sideAxis = getSideAxis(placement);
|
|
1262
|
-
const alignmentAxis = getAlignmentAxis(placement);
|
|
1263
|
-
const alignLength = getAxisLength(alignmentAxis);
|
|
1264
|
-
const side = getSide(placement);
|
|
1265
|
-
const isVertical = sideAxis === "y";
|
|
1266
|
-
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
1267
|
-
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
1268
|
-
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
|
1269
|
-
let coords;
|
|
1270
|
-
switch (side) {
|
|
1271
|
-
case "top":
|
|
1272
|
-
coords = {
|
|
1273
|
-
x: commonX,
|
|
1274
|
-
y: reference.y - floating.height
|
|
1275
|
-
};
|
|
1276
|
-
break;
|
|
1277
|
-
case "bottom":
|
|
1278
|
-
coords = {
|
|
1279
|
-
x: commonX,
|
|
1280
|
-
y: reference.y + reference.height
|
|
1281
|
-
};
|
|
1282
|
-
break;
|
|
1283
|
-
case "right":
|
|
1284
|
-
coords = {
|
|
1285
|
-
x: reference.x + reference.width,
|
|
1286
|
-
y: commonY
|
|
1287
|
-
};
|
|
1288
|
-
break;
|
|
1289
|
-
case "left":
|
|
1290
|
-
coords = {
|
|
1291
|
-
x: reference.x - floating.width,
|
|
1292
|
-
y: commonY
|
|
1293
|
-
};
|
|
1294
|
-
break;
|
|
1295
|
-
default:
|
|
1296
|
-
coords = {
|
|
1297
|
-
x: reference.x,
|
|
1298
|
-
y: reference.y
|
|
1299
|
-
};
|
|
1300
|
-
}
|
|
1301
|
-
const alignment = getAlignment(placement);
|
|
1302
|
-
if (alignment) {
|
|
1303
|
-
coords[alignmentAxis] += commonAlign * (alignment === "end" ? 1 : -1) * (rtl && isVertical ? -1 : 1);
|
|
1304
|
-
}
|
|
1305
|
-
return coords;
|
|
1306
|
-
}
|
|
1307
|
-
async function detectOverflow(state, options) {
|
|
1308
|
-
var _await$platform$isEle;
|
|
1309
|
-
if (options === void 0) {
|
|
1310
|
-
options = {};
|
|
1311
|
-
}
|
|
1312
|
-
const {
|
|
1313
|
-
x,
|
|
1314
|
-
y: y3,
|
|
1315
|
-
platform: platform2,
|
|
1316
|
-
rects,
|
|
1317
|
-
elements,
|
|
1318
|
-
strategy
|
|
1319
|
-
} = state;
|
|
1320
|
-
const {
|
|
1321
|
-
boundary = "clippingAncestors",
|
|
1322
|
-
rootBoundary = "viewport",
|
|
1323
|
-
elementContext = "floating",
|
|
1324
|
-
altBoundary = false,
|
|
1325
|
-
padding = 0
|
|
1326
|
-
} = evaluate(options, state);
|
|
1327
|
-
const paddingObject = getPaddingObject(padding);
|
|
1328
|
-
const altContext = elementContext === "floating" ? "reference" : "floating";
|
|
1329
|
-
const element = elements[altBoundary ? altContext : elementContext];
|
|
1330
|
-
const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
|
|
1331
|
-
element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)),
|
|
1332
|
-
boundary,
|
|
1333
|
-
rootBoundary,
|
|
1334
|
-
strategy
|
|
1335
|
-
}));
|
|
1336
|
-
const rect = elementContext === "floating" ? {
|
|
1337
|
-
x,
|
|
1338
|
-
y: y3,
|
|
1339
|
-
width: rects.floating.width,
|
|
1340
|
-
height: rects.floating.height
|
|
1341
|
-
} : rects.reference;
|
|
1342
|
-
const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
|
|
1343
|
-
const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) && await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
|
|
1344
|
-
x: 1,
|
|
1345
|
-
y: 1
|
|
1346
|
-
};
|
|
1347
|
-
const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
1348
|
-
elements,
|
|
1349
|
-
rect,
|
|
1350
|
-
offsetParent,
|
|
1351
|
-
strategy
|
|
1352
|
-
}) : rect);
|
|
1353
|
-
return {
|
|
1354
|
-
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
1355
|
-
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
1356
|
-
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
1357
|
-
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
1358
|
-
};
|
|
1359
|
-
}
|
|
1360
|
-
var MAX_RESET_COUNT = 50;
|
|
1361
|
-
var computePosition = async (reference, floating, config) => {
|
|
1362
|
-
const {
|
|
1363
|
-
placement = "bottom",
|
|
1364
|
-
strategy = "absolute",
|
|
1365
|
-
middleware = [],
|
|
1366
|
-
platform: platform2
|
|
1367
|
-
} = config;
|
|
1368
|
-
const platformWithDetectOverflow = platform2.detectOverflow ? platform2 : {
|
|
1369
|
-
...platform2,
|
|
1370
|
-
detectOverflow
|
|
1371
|
-
};
|
|
1372
|
-
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
|
|
1373
|
-
let rects = await platform2.getElementRects({
|
|
1374
|
-
reference,
|
|
1375
|
-
floating,
|
|
1376
|
-
strategy
|
|
1377
|
-
});
|
|
1378
|
-
let {
|
|
1379
|
-
x,
|
|
1380
|
-
y: y3
|
|
1381
|
-
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
1382
|
-
let statefulPlacement = placement;
|
|
1383
|
-
let resetCount = 0;
|
|
1384
|
-
const middlewareData = {};
|
|
1385
|
-
for (let i4 = 0; i4 < middleware.length; i4++) {
|
|
1386
|
-
const currentMiddleware = middleware[i4];
|
|
1387
|
-
if (!currentMiddleware) {
|
|
1388
|
-
continue;
|
|
1389
|
-
}
|
|
1390
|
-
const {
|
|
1391
|
-
name,
|
|
1392
|
-
fn
|
|
1393
|
-
} = currentMiddleware;
|
|
1394
|
-
const {
|
|
1395
|
-
x: nextX,
|
|
1396
|
-
y: nextY,
|
|
1397
|
-
data,
|
|
1398
|
-
reset
|
|
1399
|
-
} = await fn({
|
|
1400
|
-
x,
|
|
1401
|
-
y: y3,
|
|
1402
|
-
initialPlacement: placement,
|
|
1403
|
-
placement: statefulPlacement,
|
|
1404
|
-
strategy,
|
|
1405
|
-
middlewareData,
|
|
1406
|
-
rects,
|
|
1407
|
-
platform: platformWithDetectOverflow,
|
|
1408
|
-
elements: {
|
|
1409
|
-
reference,
|
|
1410
|
-
floating
|
|
1411
|
-
}
|
|
1412
|
-
});
|
|
1413
|
-
x = nextX != null ? nextX : x;
|
|
1414
|
-
y3 = nextY != null ? nextY : y3;
|
|
1415
|
-
middlewareData[name] = {
|
|
1416
|
-
...middlewareData[name],
|
|
1417
|
-
...data
|
|
1418
|
-
};
|
|
1419
|
-
if (reset && resetCount < MAX_RESET_COUNT) {
|
|
1420
|
-
resetCount++;
|
|
1421
|
-
if (typeof reset === "object") {
|
|
1422
|
-
if (reset.placement) {
|
|
1423
|
-
statefulPlacement = reset.placement;
|
|
1424
|
-
}
|
|
1425
|
-
if (reset.rects) {
|
|
1426
|
-
rects = reset.rects === true ? await platform2.getElementRects({
|
|
1427
|
-
reference,
|
|
1428
|
-
floating,
|
|
1429
|
-
strategy
|
|
1430
|
-
}) : reset.rects;
|
|
1431
|
-
}
|
|
1432
|
-
({
|
|
1433
|
-
x,
|
|
1434
|
-
y: y3
|
|
1435
|
-
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
1436
|
-
}
|
|
1437
|
-
i4 = -1;
|
|
1438
|
-
}
|
|
1439
|
-
}
|
|
1440
|
-
return {
|
|
1441
|
-
x,
|
|
1442
|
-
y: y3,
|
|
1443
|
-
placement: statefulPlacement,
|
|
1444
|
-
strategy,
|
|
1445
|
-
middlewareData
|
|
1446
|
-
};
|
|
1447
|
-
};
|
|
1448
|
-
var flip = function(options) {
|
|
1449
|
-
if (options === void 0) {
|
|
1450
|
-
options = {};
|
|
1451
|
-
}
|
|
1452
|
-
return {
|
|
1453
|
-
name: "flip",
|
|
1454
|
-
options,
|
|
1455
|
-
async fn(state) {
|
|
1456
|
-
var _middlewareData$arrow, _middlewareData$flip;
|
|
1457
|
-
const {
|
|
1458
|
-
placement,
|
|
1459
|
-
middlewareData,
|
|
1460
|
-
rects,
|
|
1461
|
-
initialPlacement,
|
|
1462
|
-
platform: platform2,
|
|
1463
|
-
elements
|
|
1464
|
-
} = state;
|
|
1465
|
-
const {
|
|
1466
|
-
mainAxis: checkMainAxis = true,
|
|
1467
|
-
crossAxis: checkCrossAxis = true,
|
|
1468
|
-
fallbackPlacements: specifiedFallbackPlacements,
|
|
1469
|
-
fallbackStrategy = "bestFit",
|
|
1470
|
-
fallbackAxisSideDirection = "none",
|
|
1471
|
-
flipAlignment = true,
|
|
1472
|
-
...detectOverflowOptions
|
|
1473
|
-
} = evaluate(options, state);
|
|
1474
|
-
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
1475
|
-
return {};
|
|
1476
|
-
}
|
|
1477
|
-
const side = getSide(placement);
|
|
1478
|
-
const initialSideAxis = getSideAxis(initialPlacement);
|
|
1479
|
-
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
1480
|
-
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
|
|
1481
|
-
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
1482
|
-
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
|
|
1483
|
-
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
|
|
1484
|
-
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
1485
|
-
}
|
|
1486
|
-
const placements2 = [initialPlacement, ...fallbackPlacements];
|
|
1487
|
-
const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
|
|
1488
|
-
const overflows = [];
|
|
1489
|
-
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
1490
|
-
if (checkMainAxis) {
|
|
1491
|
-
overflows.push(overflow[side]);
|
|
1492
|
-
}
|
|
1493
|
-
if (checkCrossAxis) {
|
|
1494
|
-
const sides2 = getAlignmentSides(placement, rects, rtl);
|
|
1495
|
-
overflows.push(overflow[sides2[0]], overflow[sides2[1]]);
|
|
1496
|
-
}
|
|
1497
|
-
overflowsData = [...overflowsData, {
|
|
1498
|
-
placement,
|
|
1499
|
-
overflows
|
|
1500
|
-
}];
|
|
1501
|
-
if (!overflows.every((side2) => side2 <= 0)) {
|
|
1502
|
-
var _middlewareData$flip2, _overflowsData$filter;
|
|
1503
|
-
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
1504
|
-
const nextPlacement = placements2[nextIndex];
|
|
1505
|
-
if (nextPlacement) {
|
|
1506
|
-
const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false;
|
|
1507
|
-
if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis
|
|
1508
|
-
// overflows the main axis.
|
|
1509
|
-
overflowsData.every((d2) => getSideAxis(d2.placement) === initialSideAxis ? d2.overflows[0] > 0 : true)) {
|
|
1510
|
-
return {
|
|
1511
|
-
data: {
|
|
1512
|
-
index: nextIndex,
|
|
1513
|
-
overflows: overflowsData
|
|
1514
|
-
},
|
|
1515
|
-
reset: {
|
|
1516
|
-
placement: nextPlacement
|
|
1517
|
-
}
|
|
1518
|
-
};
|
|
1519
|
-
}
|
|
1520
|
-
}
|
|
1521
|
-
let resetPlacement = (_overflowsData$filter = overflowsData.filter((d2) => d2.overflows[0] <= 0).sort((a8, b2) => a8.overflows[1] - b2.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
1522
|
-
if (!resetPlacement) {
|
|
1523
|
-
switch (fallbackStrategy) {
|
|
1524
|
-
case "bestFit": {
|
|
1525
|
-
var _overflowsData$filter2;
|
|
1526
|
-
const placement2 = (_overflowsData$filter2 = overflowsData.filter((d2) => {
|
|
1527
|
-
if (hasFallbackAxisSideDirection) {
|
|
1528
|
-
const currentSideAxis = getSideAxis(d2.placement);
|
|
1529
|
-
return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
|
|
1530
|
-
// reading directions favoring greater width.
|
|
1531
|
-
currentSideAxis === "y";
|
|
1532
|
-
}
|
|
1533
|
-
return true;
|
|
1534
|
-
}).map((d2) => [d2.placement, d2.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a8, b2) => a8[1] - b2[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
|
|
1535
|
-
if (placement2) {
|
|
1536
|
-
resetPlacement = placement2;
|
|
1537
|
-
}
|
|
1538
|
-
break;
|
|
1539
|
-
}
|
|
1540
|
-
case "initialPlacement":
|
|
1541
|
-
resetPlacement = initialPlacement;
|
|
1542
|
-
break;
|
|
1543
|
-
}
|
|
1544
|
-
}
|
|
1545
|
-
if (placement !== resetPlacement) {
|
|
1546
|
-
return {
|
|
1547
|
-
reset: {
|
|
1548
|
-
placement: resetPlacement
|
|
1549
|
-
}
|
|
1550
|
-
};
|
|
1551
|
-
}
|
|
1552
|
-
}
|
|
1553
|
-
return {};
|
|
1554
|
-
}
|
|
1555
|
-
};
|
|
1556
|
-
};
|
|
1557
|
-
var originSides = /* @__PURE__ */ new Set(["left", "top"]);
|
|
1558
|
-
async function convertValueToCoords(state, options) {
|
|
1559
|
-
const {
|
|
1560
|
-
placement,
|
|
1561
|
-
platform: platform2,
|
|
1562
|
-
elements
|
|
1563
|
-
} = state;
|
|
1564
|
-
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
|
|
1565
|
-
const side = getSide(placement);
|
|
1566
|
-
const alignment = getAlignment(placement);
|
|
1567
|
-
const isVertical = getSideAxis(placement) === "y";
|
|
1568
|
-
const mainAxisMulti = originSides.has(side) ? -1 : 1;
|
|
1569
|
-
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
1570
|
-
const rawValue = evaluate(options, state);
|
|
1571
|
-
let {
|
|
1572
|
-
mainAxis,
|
|
1573
|
-
crossAxis,
|
|
1574
|
-
alignmentAxis
|
|
1575
|
-
} = typeof rawValue === "number" ? {
|
|
1576
|
-
mainAxis: rawValue,
|
|
1577
|
-
crossAxis: 0,
|
|
1578
|
-
alignmentAxis: null
|
|
1579
|
-
} : {
|
|
1580
|
-
mainAxis: rawValue.mainAxis || 0,
|
|
1581
|
-
crossAxis: rawValue.crossAxis || 0,
|
|
1582
|
-
alignmentAxis: rawValue.alignmentAxis
|
|
1583
|
-
};
|
|
1584
|
-
if (alignment && typeof alignmentAxis === "number") {
|
|
1585
|
-
crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
|
|
1586
|
-
}
|
|
1587
|
-
return isVertical ? {
|
|
1588
|
-
x: crossAxis * crossAxisMulti,
|
|
1589
|
-
y: mainAxis * mainAxisMulti
|
|
1590
|
-
} : {
|
|
1591
|
-
x: mainAxis * mainAxisMulti,
|
|
1592
|
-
y: crossAxis * crossAxisMulti
|
|
1593
|
-
};
|
|
1594
|
-
}
|
|
1595
|
-
var offset = function(options) {
|
|
1596
|
-
if (options === void 0) {
|
|
1597
|
-
options = 0;
|
|
1598
|
-
}
|
|
1599
|
-
return {
|
|
1600
|
-
name: "offset",
|
|
1601
|
-
options,
|
|
1602
|
-
async fn(state) {
|
|
1603
|
-
var _middlewareData$offse, _middlewareData$arrow;
|
|
1604
|
-
const {
|
|
1605
|
-
x,
|
|
1606
|
-
y: y3,
|
|
1607
|
-
placement,
|
|
1608
|
-
middlewareData
|
|
1609
|
-
} = state;
|
|
1610
|
-
const diffCoords = await convertValueToCoords(state, options);
|
|
1611
|
-
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
1612
|
-
return {};
|
|
1613
|
-
}
|
|
1614
|
-
return {
|
|
1615
|
-
x: x + diffCoords.x,
|
|
1616
|
-
y: y3 + diffCoords.y,
|
|
1617
|
-
data: {
|
|
1618
|
-
...diffCoords,
|
|
1619
|
-
placement
|
|
1620
|
-
}
|
|
1621
|
-
};
|
|
1622
|
-
}
|
|
1623
|
-
};
|
|
1624
|
-
};
|
|
1625
|
-
var shift = function(options) {
|
|
1626
|
-
if (options === void 0) {
|
|
1627
|
-
options = {};
|
|
1628
|
-
}
|
|
1629
|
-
return {
|
|
1630
|
-
name: "shift",
|
|
1631
|
-
options,
|
|
1632
|
-
async fn(state) {
|
|
1633
|
-
const {
|
|
1634
|
-
x,
|
|
1635
|
-
y: y3,
|
|
1636
|
-
placement,
|
|
1637
|
-
platform: platform2
|
|
1638
|
-
} = state;
|
|
1639
|
-
const {
|
|
1640
|
-
mainAxis: checkMainAxis = true,
|
|
1641
|
-
crossAxis: checkCrossAxis = false,
|
|
1642
|
-
limiter = {
|
|
1643
|
-
fn: (_ref) => {
|
|
1644
|
-
let {
|
|
1645
|
-
x: x2,
|
|
1646
|
-
y: y4
|
|
1647
|
-
} = _ref;
|
|
1648
|
-
return {
|
|
1649
|
-
x: x2,
|
|
1650
|
-
y: y4
|
|
1651
|
-
};
|
|
1652
|
-
}
|
|
1653
|
-
},
|
|
1654
|
-
...detectOverflowOptions
|
|
1655
|
-
} = evaluate(options, state);
|
|
1656
|
-
const coords = {
|
|
1657
|
-
x,
|
|
1658
|
-
y: y3
|
|
1659
|
-
};
|
|
1660
|
-
const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
|
|
1661
|
-
const crossAxis = getSideAxis(placement);
|
|
1662
|
-
const mainAxis = getOppositeAxis(crossAxis);
|
|
1663
|
-
let mainAxisCoord = coords[mainAxis];
|
|
1664
|
-
let crossAxisCoord = coords[crossAxis];
|
|
1665
|
-
const clampCoord = (axis, coord) => clamp(coord + overflow[axis === "y" ? "top" : "left"], coord, coord - overflow[axis === "y" ? "bottom" : "right"]);
|
|
1666
|
-
if (checkMainAxis) {
|
|
1667
|
-
mainAxisCoord = clampCoord(mainAxis, mainAxisCoord);
|
|
1668
|
-
}
|
|
1669
|
-
if (checkCrossAxis) {
|
|
1670
|
-
crossAxisCoord = clampCoord(crossAxis, crossAxisCoord);
|
|
1671
|
-
}
|
|
1672
|
-
const limitedCoords = limiter.fn({
|
|
1673
|
-
...state,
|
|
1674
|
-
[mainAxis]: mainAxisCoord,
|
|
1675
|
-
[crossAxis]: crossAxisCoord
|
|
1676
|
-
});
|
|
1677
|
-
return {
|
|
1678
|
-
...limitedCoords,
|
|
1679
|
-
data: {
|
|
1680
|
-
x: limitedCoords.x - x,
|
|
1681
|
-
y: limitedCoords.y - y3,
|
|
1682
|
-
enabled: {
|
|
1683
|
-
[mainAxis]: checkMainAxis,
|
|
1684
|
-
[crossAxis]: checkCrossAxis
|
|
1685
|
-
}
|
|
1686
|
-
}
|
|
1687
|
-
};
|
|
1688
|
-
}
|
|
1689
|
-
};
|
|
1690
|
-
};
|
|
1691
|
-
var size = function(options) {
|
|
1692
|
-
if (options === void 0) {
|
|
1693
|
-
options = {};
|
|
1694
|
-
}
|
|
1695
|
-
return {
|
|
1696
|
-
name: "size",
|
|
1697
|
-
options,
|
|
1698
|
-
async fn(state) {
|
|
1699
|
-
const {
|
|
1700
|
-
placement,
|
|
1701
|
-
rects,
|
|
1702
|
-
platform: platform2,
|
|
1703
|
-
elements
|
|
1704
|
-
} = state;
|
|
1705
|
-
const {
|
|
1706
|
-
apply = () => {
|
|
1707
|
-
},
|
|
1708
|
-
...detectOverflowOptions
|
|
1709
|
-
} = evaluate(options, state);
|
|
1710
|
-
const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
|
|
1711
|
-
const side = getSide(placement);
|
|
1712
|
-
const alignment = getAlignment(placement);
|
|
1713
|
-
const isYAxis = getSideAxis(placement) === "y";
|
|
1714
|
-
const {
|
|
1715
|
-
width,
|
|
1716
|
-
height
|
|
1717
|
-
} = rects.floating;
|
|
1718
|
-
let heightSide;
|
|
1719
|
-
let widthSide;
|
|
1720
|
-
if (side === "top" || side === "bottom") {
|
|
1721
|
-
heightSide = side;
|
|
1722
|
-
widthSide = alignment === (await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right";
|
|
1723
|
-
} else {
|
|
1724
|
-
widthSide = side;
|
|
1725
|
-
heightSide = alignment === "end" ? "top" : "bottom";
|
|
1726
|
-
}
|
|
1727
|
-
const maximumClippingHeight = height - overflow.top - overflow.bottom;
|
|
1728
|
-
const maximumClippingWidth = width - overflow.left - overflow.right;
|
|
1729
|
-
const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
|
|
1730
|
-
const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
|
|
1731
|
-
const shiftData = state.middlewareData.shift;
|
|
1732
|
-
const noShift = !shiftData;
|
|
1733
|
-
let availableHeight = overflowAvailableHeight;
|
|
1734
|
-
let availableWidth = overflowAvailableWidth;
|
|
1735
|
-
if (shiftData != null && shiftData.enabled.x) {
|
|
1736
|
-
availableWidth = maximumClippingWidth;
|
|
1737
|
-
}
|
|
1738
|
-
if (shiftData != null && shiftData.enabled.y) {
|
|
1739
|
-
availableHeight = maximumClippingHeight;
|
|
1740
|
-
}
|
|
1741
|
-
if (noShift && !alignment) {
|
|
1742
|
-
if (isYAxis) {
|
|
1743
|
-
availableWidth = width - 2 * max(overflow.left, overflow.right);
|
|
1744
|
-
} else {
|
|
1745
|
-
availableHeight = height - 2 * max(overflow.top, overflow.bottom);
|
|
1746
|
-
}
|
|
1747
|
-
}
|
|
1748
|
-
await apply({
|
|
1749
|
-
...state,
|
|
1750
|
-
availableWidth,
|
|
1751
|
-
availableHeight
|
|
1752
|
-
});
|
|
1753
|
-
const nextDimensions = await platform2.getDimensions(elements.floating);
|
|
1754
|
-
if (width !== nextDimensions.width || height !== nextDimensions.height) {
|
|
1755
|
-
return {
|
|
1756
|
-
reset: {
|
|
1757
|
-
rects: true
|
|
1758
|
-
}
|
|
1759
|
-
};
|
|
1760
|
-
}
|
|
1761
|
-
return {};
|
|
1762
|
-
}
|
|
1763
|
-
};
|
|
1764
|
-
};
|
|
1765
|
-
|
|
1766
|
-
// ../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
|
|
1767
|
-
function getCssDimensions(element) {
|
|
1768
|
-
const css = getComputedStyle2(element);
|
|
1769
|
-
let width = parseFloat(css.width) || 0;
|
|
1770
|
-
let height = parseFloat(css.height) || 0;
|
|
1771
|
-
const hasOffset = isHTMLElement(element);
|
|
1772
|
-
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
1773
|
-
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
1774
|
-
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
1775
|
-
if (shouldFallback) {
|
|
1776
|
-
width = offsetWidth;
|
|
1777
|
-
height = offsetHeight;
|
|
1778
|
-
}
|
|
1779
|
-
return {
|
|
1780
|
-
width,
|
|
1781
|
-
height,
|
|
1782
|
-
$: shouldFallback
|
|
1783
|
-
};
|
|
1784
|
-
}
|
|
1785
|
-
function unwrapElement(element) {
|
|
1786
|
-
return !isElement(element) ? element.contextElement : element;
|
|
1787
|
-
}
|
|
1788
|
-
function getScale(element) {
|
|
1789
|
-
const domElement = unwrapElement(element);
|
|
1790
|
-
if (!isHTMLElement(domElement)) {
|
|
1791
|
-
return createCoords(1);
|
|
1792
|
-
}
|
|
1793
|
-
const rect = domElement.getBoundingClientRect();
|
|
1794
|
-
const {
|
|
1795
|
-
width,
|
|
1796
|
-
height,
|
|
1797
|
-
$: $2
|
|
1798
|
-
} = getCssDimensions(domElement);
|
|
1799
|
-
let x = ($2 ? round(rect.width) : rect.width) / width;
|
|
1800
|
-
let y3 = ($2 ? round(rect.height) : rect.height) / height;
|
|
1801
|
-
if (!x || !Number.isFinite(x)) {
|
|
1802
|
-
x = 1;
|
|
1803
|
-
}
|
|
1804
|
-
if (!y3 || !Number.isFinite(y3)) {
|
|
1805
|
-
y3 = 1;
|
|
1806
|
-
}
|
|
1807
|
-
return {
|
|
1808
|
-
x,
|
|
1809
|
-
y: y3
|
|
1810
|
-
};
|
|
1811
|
-
}
|
|
1812
|
-
var noOffsets = /* @__PURE__ */ createCoords(0);
|
|
1813
|
-
function getVisualOffsets(element) {
|
|
1814
|
-
const win = getWindow(element);
|
|
1815
|
-
if (!isWebKit() || !win.visualViewport) {
|
|
1816
|
-
return noOffsets;
|
|
1817
|
-
}
|
|
1818
|
-
return {
|
|
1819
|
-
x: win.visualViewport.offsetLeft,
|
|
1820
|
-
y: win.visualViewport.offsetTop
|
|
1821
|
-
};
|
|
1822
|
-
}
|
|
1823
|
-
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
1824
|
-
if (isFixed === void 0) {
|
|
1825
|
-
isFixed = false;
|
|
1826
|
-
}
|
|
1827
|
-
return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element);
|
|
1828
|
-
}
|
|
1829
|
-
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
1830
|
-
if (includeScale === void 0) {
|
|
1831
|
-
includeScale = false;
|
|
1832
|
-
}
|
|
1833
|
-
if (isFixedStrategy === void 0) {
|
|
1834
|
-
isFixedStrategy = false;
|
|
1835
|
-
}
|
|
1836
|
-
const clientRect = element.getBoundingClientRect();
|
|
1837
|
-
const domElement = unwrapElement(element);
|
|
1838
|
-
let scale = createCoords(1);
|
|
1839
|
-
if (includeScale) {
|
|
1840
|
-
if (offsetParent) {
|
|
1841
|
-
if (isElement(offsetParent)) {
|
|
1842
|
-
scale = getScale(offsetParent);
|
|
1843
|
-
}
|
|
1844
|
-
} else {
|
|
1845
|
-
scale = getScale(element);
|
|
1846
|
-
}
|
|
1847
|
-
}
|
|
1848
|
-
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
1849
|
-
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
1850
|
-
let y3 = (clientRect.top + visualOffsets.y) / scale.y;
|
|
1851
|
-
let width = clientRect.width / scale.x;
|
|
1852
|
-
let height = clientRect.height / scale.y;
|
|
1853
|
-
if (domElement && offsetParent) {
|
|
1854
|
-
const win = getWindow(domElement);
|
|
1855
|
-
const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
1856
|
-
let currentWin = win;
|
|
1857
|
-
let currentIFrame = getFrameElement(currentWin);
|
|
1858
|
-
while (currentIFrame && offsetWin !== currentWin) {
|
|
1859
|
-
const iframeScale = getScale(currentIFrame);
|
|
1860
|
-
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
1861
|
-
const css = getComputedStyle2(currentIFrame);
|
|
1862
|
-
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
1863
|
-
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
1864
|
-
x *= iframeScale.x;
|
|
1865
|
-
y3 *= iframeScale.y;
|
|
1866
|
-
width *= iframeScale.x;
|
|
1867
|
-
height *= iframeScale.y;
|
|
1868
|
-
x += left;
|
|
1869
|
-
y3 += top;
|
|
1870
|
-
currentWin = getWindow(currentIFrame);
|
|
1871
|
-
currentIFrame = getFrameElement(currentWin);
|
|
1872
|
-
}
|
|
1873
|
-
}
|
|
1874
|
-
return rectToClientRect({
|
|
1875
|
-
width,
|
|
1876
|
-
height,
|
|
1877
|
-
x,
|
|
1878
|
-
y: y3
|
|
1879
|
-
});
|
|
1880
|
-
}
|
|
1881
|
-
function getWindowScrollBarX(element, rect) {
|
|
1882
|
-
const leftScroll = getNodeScroll(element).scrollLeft;
|
|
1883
|
-
if (!rect) {
|
|
1884
|
-
return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
|
|
1885
|
-
}
|
|
1886
|
-
return rect.left + leftScroll;
|
|
1887
|
-
}
|
|
1888
|
-
function getHTMLOffset(documentElement, scroll) {
|
|
1889
|
-
const htmlRect = documentElement.getBoundingClientRect();
|
|
1890
|
-
const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
|
|
1891
|
-
const y3 = htmlRect.top + scroll.scrollTop;
|
|
1892
|
-
return {
|
|
1893
|
-
x,
|
|
1894
|
-
y: y3
|
|
1895
|
-
};
|
|
1896
|
-
}
|
|
1897
|
-
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
1898
|
-
let {
|
|
1899
|
-
elements,
|
|
1900
|
-
rect,
|
|
1901
|
-
offsetParent,
|
|
1902
|
-
strategy
|
|
1903
|
-
} = _ref;
|
|
1904
|
-
const isFixed = strategy === "fixed";
|
|
1905
|
-
const documentElement = getDocumentElement(offsetParent);
|
|
1906
|
-
const topLayer = elements ? isTopLayer(elements.floating) : false;
|
|
1907
|
-
if (offsetParent === documentElement || topLayer && isFixed) {
|
|
1908
|
-
return rect;
|
|
1909
|
-
}
|
|
1910
|
-
let scroll = {
|
|
1911
|
-
scrollLeft: 0,
|
|
1912
|
-
scrollTop: 0
|
|
1913
|
-
};
|
|
1914
|
-
let scale = createCoords(1);
|
|
1915
|
-
const offsets = createCoords(0);
|
|
1916
|
-
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1917
|
-
if (isOffsetParentAnElement || !isFixed) {
|
|
1918
|
-
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
1919
|
-
scroll = getNodeScroll(offsetParent);
|
|
1920
|
-
}
|
|
1921
|
-
if (isOffsetParentAnElement) {
|
|
1922
|
-
const offsetRect = getBoundingClientRect(offsetParent);
|
|
1923
|
-
scale = getScale(offsetParent);
|
|
1924
|
-
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1925
|
-
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1926
|
-
}
|
|
1927
|
-
}
|
|
1928
|
-
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
1929
|
-
return {
|
|
1930
|
-
width: rect.width * scale.x,
|
|
1931
|
-
height: rect.height * scale.y,
|
|
1932
|
-
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
|
|
1933
|
-
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
|
|
1934
|
-
};
|
|
1935
|
-
}
|
|
1936
|
-
function getClientRects(element) {
|
|
1937
|
-
return element.getClientRects ? Array.from(element.getClientRects()) : [];
|
|
1938
|
-
}
|
|
1939
|
-
function getDocumentRect(html) {
|
|
1940
|
-
const scroll = getNodeScroll(html);
|
|
1941
|
-
const body = html.ownerDocument.body;
|
|
1942
|
-
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
1943
|
-
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
1944
|
-
let x = -scroll.scrollLeft + getWindowScrollBarX(html);
|
|
1945
|
-
const y3 = -scroll.scrollTop;
|
|
1946
|
-
if (getComputedStyle2(body).direction === "rtl") {
|
|
1947
|
-
x += max(html.clientWidth, body.clientWidth) - width;
|
|
1948
|
-
}
|
|
1949
|
-
return {
|
|
1950
|
-
width,
|
|
1951
|
-
height,
|
|
1952
|
-
x,
|
|
1953
|
-
y: y3
|
|
1954
|
-
};
|
|
1955
|
-
}
|
|
1956
|
-
var SCROLLBAR_MAX = 25;
|
|
1957
|
-
function getViewportRect(element, strategy, rootBoundary) {
|
|
1958
|
-
if (rootBoundary === void 0) {
|
|
1959
|
-
rootBoundary = "viewport";
|
|
1960
|
-
}
|
|
1961
|
-
const isLayoutViewport = rootBoundary === "layoutViewport";
|
|
1962
|
-
const win = getWindow(element);
|
|
1963
|
-
const html = getDocumentElement(element);
|
|
1964
|
-
const visualViewport = win.visualViewport;
|
|
1965
|
-
let width = html.clientWidth;
|
|
1966
|
-
let height = html.clientHeight;
|
|
1967
|
-
let x = 0;
|
|
1968
|
-
let y3 = 0;
|
|
1969
|
-
if (visualViewport) {
|
|
1970
|
-
const layoutRelativeClientCoords = !isWebKit() || strategy === "fixed";
|
|
1971
|
-
if (isLayoutViewport) {
|
|
1972
|
-
if (!layoutRelativeClientCoords) {
|
|
1973
|
-
x = -visualViewport.offsetLeft;
|
|
1974
|
-
y3 = -visualViewport.offsetTop;
|
|
1975
|
-
}
|
|
1976
|
-
} else {
|
|
1977
|
-
width = visualViewport.width;
|
|
1978
|
-
height = visualViewport.height;
|
|
1979
|
-
if (layoutRelativeClientCoords) {
|
|
1980
|
-
x = visualViewport.offsetLeft;
|
|
1981
|
-
y3 = visualViewport.offsetTop;
|
|
1982
|
-
}
|
|
1983
|
-
}
|
|
1984
|
-
}
|
|
1985
|
-
const windowScrollbarX = getWindowScrollBarX(html);
|
|
1986
|
-
if (windowScrollbarX <= 0) {
|
|
1987
|
-
const doc = html.ownerDocument;
|
|
1988
|
-
const body = doc.body;
|
|
1989
|
-
const bodyStyles = getComputedStyle(body);
|
|
1990
|
-
const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
|
|
1991
|
-
const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
|
|
1992
|
-
const gutter = getComputedStyle(html).scrollbarGutter === "stable both-edges" ? reservedWidth / 2 : reservedWidth;
|
|
1993
|
-
if (gutter <= SCROLLBAR_MAX) {
|
|
1994
|
-
width -= gutter;
|
|
1995
|
-
}
|
|
1996
|
-
}
|
|
1997
|
-
return {
|
|
1998
|
-
width,
|
|
1999
|
-
height,
|
|
2000
|
-
x,
|
|
2001
|
-
y: y3
|
|
2002
|
-
};
|
|
2003
|
-
}
|
|
2004
|
-
function getInnerBoundingClientRect(element, strategy) {
|
|
2005
|
-
const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
|
|
2006
|
-
const top = clientRect.top + element.clientTop;
|
|
2007
|
-
const left = clientRect.left + element.clientLeft;
|
|
2008
|
-
const scale = getScale(element);
|
|
2009
|
-
const width = element.clientWidth * scale.x;
|
|
2010
|
-
const height = element.clientHeight * scale.y;
|
|
2011
|
-
const x = left * scale.x;
|
|
2012
|
-
const y3 = top * scale.y;
|
|
2013
|
-
return {
|
|
2014
|
-
width,
|
|
2015
|
-
height,
|
|
2016
|
-
x,
|
|
2017
|
-
y: y3
|
|
2018
|
-
};
|
|
2019
|
-
}
|
|
2020
|
-
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
2021
|
-
let rect;
|
|
2022
|
-
if (clippingAncestor === "viewport" || clippingAncestor === "layoutViewport") {
|
|
2023
|
-
rect = getViewportRect(element, strategy, clippingAncestor);
|
|
2024
|
-
} else if (clippingAncestor === "document") {
|
|
2025
|
-
rect = getDocumentRect(getDocumentElement(element));
|
|
2026
|
-
} else if (isElement(clippingAncestor)) {
|
|
2027
|
-
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
2028
|
-
} else {
|
|
2029
|
-
const visualOffsets = getVisualOffsets(element);
|
|
2030
|
-
rect = {
|
|
2031
|
-
x: clippingAncestor.x - visualOffsets.x,
|
|
2032
|
-
y: clippingAncestor.y - visualOffsets.y,
|
|
2033
|
-
width: clippingAncestor.width,
|
|
2034
|
-
height: clippingAncestor.height
|
|
2035
|
-
};
|
|
2036
|
-
}
|
|
2037
|
-
return rectToClientRect(rect);
|
|
2038
|
-
}
|
|
2039
|
-
function getClippingElementAncestors(element, cache) {
|
|
2040
|
-
const cachedResult = cache.get(element);
|
|
2041
|
-
if (cachedResult) {
|
|
2042
|
-
return cachedResult;
|
|
2043
|
-
}
|
|
2044
|
-
let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
|
|
2045
|
-
let lastKeptComputedStyle = null;
|
|
2046
|
-
const elementIsFixed = getComputedStyle2(element).position === "fixed";
|
|
2047
|
-
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
2048
|
-
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
2049
|
-
const computedStyle = getComputedStyle2(currentNode);
|
|
2050
|
-
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
2051
|
-
const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? "fixed" : "";
|
|
2052
|
-
const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === "fixed" || lastPosition === "absolute" && computedStyle.position === "static");
|
|
2053
|
-
if (shouldDropCurrentNode) {
|
|
2054
|
-
result = result.filter((ancestor) => ancestor !== currentNode);
|
|
2055
|
-
} else {
|
|
2056
|
-
lastKeptComputedStyle = computedStyle;
|
|
2057
|
-
}
|
|
2058
|
-
currentNode = getParentNode(currentNode);
|
|
2059
|
-
}
|
|
2060
|
-
cache.set(element, result);
|
|
2061
|
-
return result;
|
|
2062
|
-
}
|
|
2063
|
-
function getClippingRect(_ref) {
|
|
2064
|
-
let {
|
|
2065
|
-
element,
|
|
2066
|
-
boundary,
|
|
2067
|
-
rootBoundary,
|
|
2068
|
-
strategy
|
|
2069
|
-
} = _ref;
|
|
2070
|
-
const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
2071
|
-
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
2072
|
-
const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);
|
|
2073
|
-
let top = firstRect.top;
|
|
2074
|
-
let right = firstRect.right;
|
|
2075
|
-
let bottom = firstRect.bottom;
|
|
2076
|
-
let left = firstRect.left;
|
|
2077
|
-
for (let i4 = 1; i4 < clippingAncestors.length; i4++) {
|
|
2078
|
-
const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i4], strategy);
|
|
2079
|
-
top = max(rect.top, top);
|
|
2080
|
-
right = min(rect.right, right);
|
|
2081
|
-
bottom = min(rect.bottom, bottom);
|
|
2082
|
-
left = max(rect.left, left);
|
|
2083
|
-
}
|
|
2084
|
-
return {
|
|
2085
|
-
width: right - left,
|
|
2086
|
-
height: bottom - top,
|
|
2087
|
-
x: left,
|
|
2088
|
-
y: top
|
|
2089
|
-
};
|
|
2090
|
-
}
|
|
2091
|
-
function getDimensions(element) {
|
|
2092
|
-
const {
|
|
2093
|
-
width,
|
|
2094
|
-
height
|
|
2095
|
-
} = getCssDimensions(element);
|
|
2096
|
-
return {
|
|
2097
|
-
width,
|
|
2098
|
-
height
|
|
2099
|
-
};
|
|
2100
|
-
}
|
|
2101
|
-
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
2102
|
-
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
2103
|
-
const documentElement = getDocumentElement(offsetParent);
|
|
2104
|
-
const isFixed = strategy === "fixed";
|
|
2105
|
-
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
2106
|
-
let scroll = {
|
|
2107
|
-
scrollLeft: 0,
|
|
2108
|
-
scrollTop: 0
|
|
2109
|
-
};
|
|
2110
|
-
const offsets = createCoords(0);
|
|
2111
|
-
if (isOffsetParentAnElement || !isFixed) {
|
|
2112
|
-
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
2113
|
-
scroll = getNodeScroll(offsetParent);
|
|
2114
|
-
}
|
|
2115
|
-
if (isOffsetParentAnElement) {
|
|
2116
|
-
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
2117
|
-
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
2118
|
-
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
2119
|
-
}
|
|
2120
|
-
}
|
|
2121
|
-
if (!isOffsetParentAnElement && documentElement) {
|
|
2122
|
-
offsets.x = getWindowScrollBarX(documentElement);
|
|
2123
|
-
}
|
|
2124
|
-
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
2125
|
-
const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
|
|
2126
|
-
const y3 = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
|
|
2127
|
-
return {
|
|
2128
|
-
x,
|
|
2129
|
-
y: y3,
|
|
2130
|
-
width: rect.width,
|
|
2131
|
-
height: rect.height
|
|
2132
|
-
};
|
|
2133
|
-
}
|
|
2134
|
-
function isStaticPositioned(element) {
|
|
2135
|
-
return getComputedStyle2(element).position === "static";
|
|
2136
|
-
}
|
|
2137
|
-
function getTrueOffsetParent(element, polyfill) {
|
|
2138
|
-
if (!isHTMLElement(element) || getComputedStyle2(element).position === "fixed") {
|
|
2139
|
-
return null;
|
|
2140
|
-
}
|
|
2141
|
-
if (polyfill) {
|
|
2142
|
-
return polyfill(element);
|
|
2143
|
-
}
|
|
2144
|
-
let rawOffsetParent = element.offsetParent;
|
|
2145
|
-
if (getDocumentElement(element) === rawOffsetParent) {
|
|
2146
|
-
rawOffsetParent = rawOffsetParent.ownerDocument.body;
|
|
2147
|
-
}
|
|
2148
|
-
return rawOffsetParent;
|
|
2149
|
-
}
|
|
2150
|
-
function getOffsetParent(element, polyfill) {
|
|
2151
|
-
const win = getWindow(element);
|
|
2152
|
-
if (isTopLayer(element)) {
|
|
2153
|
-
return win;
|
|
2154
|
-
}
|
|
2155
|
-
if (!isHTMLElement(element)) {
|
|
2156
|
-
let svgOffsetParent = getParentNode(element);
|
|
2157
|
-
while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
|
|
2158
|
-
if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
|
|
2159
|
-
return svgOffsetParent;
|
|
2160
|
-
}
|
|
2161
|
-
svgOffsetParent = getParentNode(svgOffsetParent);
|
|
2162
|
-
}
|
|
2163
|
-
return win;
|
|
2164
|
-
}
|
|
2165
|
-
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
2166
|
-
while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
|
|
2167
|
-
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
2168
|
-
}
|
|
2169
|
-
if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
|
|
2170
|
-
return win;
|
|
2171
|
-
}
|
|
2172
|
-
return offsetParent || getContainingBlock(element) || win;
|
|
2173
|
-
}
|
|
2174
|
-
var getElementRects = async function(data) {
|
|
2175
|
-
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
2176
|
-
const getDimensionsFn = this.getDimensions;
|
|
2177
|
-
const floatingDimensions = await getDimensionsFn(data.floating);
|
|
2178
|
-
return {
|
|
2179
|
-
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
|
|
2180
|
-
floating: {
|
|
2181
|
-
x: 0,
|
|
2182
|
-
y: 0,
|
|
2183
|
-
width: floatingDimensions.width,
|
|
2184
|
-
height: floatingDimensions.height
|
|
2185
|
-
}
|
|
2186
|
-
};
|
|
2187
|
-
};
|
|
2188
|
-
function isRTL(element) {
|
|
2189
|
-
return getComputedStyle2(element).direction === "rtl";
|
|
2190
|
-
}
|
|
2191
|
-
var platform = {
|
|
2192
|
-
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
2193
|
-
getDocumentElement,
|
|
2194
|
-
getClippingRect,
|
|
2195
|
-
getOffsetParent,
|
|
2196
|
-
getElementRects,
|
|
2197
|
-
getClientRects,
|
|
2198
|
-
getDimensions,
|
|
2199
|
-
getScale,
|
|
2200
|
-
isElement,
|
|
2201
|
-
isRTL
|
|
2202
|
-
};
|
|
2203
|
-
function rectsAreEqual(a8, b2) {
|
|
2204
|
-
return a8.x === b2.x && a8.y === b2.y && a8.width === b2.width && a8.height === b2.height;
|
|
2205
|
-
}
|
|
2206
|
-
function observeMove(element, onMove, ancestorResize) {
|
|
2207
|
-
let io = null;
|
|
2208
|
-
let timeoutId;
|
|
2209
|
-
const root = getDocumentElement(element);
|
|
2210
|
-
function cleanup() {
|
|
2211
|
-
var _io;
|
|
2212
|
-
clearTimeout(timeoutId);
|
|
2213
|
-
(_io = io) == null || _io.disconnect();
|
|
2214
|
-
io = null;
|
|
2215
|
-
}
|
|
2216
|
-
function refresh(skip, threshold) {
|
|
2217
|
-
if (skip === void 0) {
|
|
2218
|
-
skip = false;
|
|
2219
|
-
}
|
|
2220
|
-
if (threshold === void 0) {
|
|
2221
|
-
threshold = 1;
|
|
2222
|
-
}
|
|
2223
|
-
cleanup();
|
|
2224
|
-
const elementRectForRootMargin = element.getBoundingClientRect();
|
|
2225
|
-
const {
|
|
2226
|
-
left,
|
|
2227
|
-
top,
|
|
2228
|
-
width,
|
|
2229
|
-
height
|
|
2230
|
-
} = elementRectForRootMargin;
|
|
2231
|
-
if (!skip) {
|
|
2232
|
-
onMove();
|
|
2233
|
-
}
|
|
2234
|
-
if (!width || !height) {
|
|
2235
|
-
return;
|
|
2236
|
-
}
|
|
2237
|
-
const insetTop = floor(top);
|
|
2238
|
-
const insetRight = floor(root.clientWidth - (left + width));
|
|
2239
|
-
const insetBottom = floor(root.clientHeight - (top + height));
|
|
2240
|
-
const insetLeft = floor(left);
|
|
2241
|
-
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
|
2242
|
-
const options = {
|
|
2243
|
-
rootMargin,
|
|
2244
|
-
threshold: max(0, min(1, threshold)) || 1
|
|
2245
|
-
};
|
|
2246
|
-
let isFirstUpdate = true;
|
|
2247
|
-
function handleObserve(entries) {
|
|
2248
|
-
const ratio = entries[0].intersectionRatio;
|
|
2249
|
-
if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
2250
|
-
return refresh();
|
|
2251
|
-
}
|
|
2252
|
-
if (ratio !== threshold) {
|
|
2253
|
-
if (!isFirstUpdate) {
|
|
2254
|
-
return refresh();
|
|
2255
|
-
}
|
|
2256
|
-
if (!ratio) {
|
|
2257
|
-
timeoutId = setTimeout(() => {
|
|
2258
|
-
refresh(false, 1e-7);
|
|
2259
|
-
}, 1e3);
|
|
2260
|
-
} else {
|
|
2261
|
-
refresh(false, ratio);
|
|
2262
|
-
}
|
|
2263
|
-
}
|
|
2264
|
-
isFirstUpdate = false;
|
|
2265
|
-
}
|
|
2266
|
-
try {
|
|
2267
|
-
io = new IntersectionObserver(handleObserve, {
|
|
2268
|
-
...options,
|
|
2269
|
-
// Handle <iframe>s
|
|
2270
|
-
root: root.ownerDocument
|
|
2271
|
-
});
|
|
2272
|
-
} catch (_e) {
|
|
2273
|
-
io = new IntersectionObserver(handleObserve, options);
|
|
2274
|
-
}
|
|
2275
|
-
io.observe(element);
|
|
2276
|
-
}
|
|
2277
|
-
const win = getWindow(element);
|
|
2278
|
-
const handleResize = () => refresh(ancestorResize);
|
|
2279
|
-
win.addEventListener("resize", handleResize);
|
|
2280
|
-
refresh(true);
|
|
2281
|
-
return () => {
|
|
2282
|
-
win.removeEventListener("resize", handleResize);
|
|
2283
|
-
cleanup();
|
|
2284
|
-
};
|
|
2285
|
-
}
|
|
2286
|
-
function autoUpdate(reference, floating, update, options) {
|
|
2287
|
-
if (options === void 0) {
|
|
2288
|
-
options = {};
|
|
2289
|
-
}
|
|
2290
|
-
const {
|
|
2291
|
-
ancestorScroll = true,
|
|
2292
|
-
ancestorResize = true,
|
|
2293
|
-
elementResize = typeof ResizeObserver === "function",
|
|
2294
|
-
layoutShift = typeof IntersectionObserver === "function",
|
|
2295
|
-
animationFrame = false
|
|
2296
|
-
} = options;
|
|
2297
|
-
const referenceEl = unwrapElement(reference);
|
|
2298
|
-
const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : [];
|
|
2299
|
-
ancestors.forEach((ancestor) => {
|
|
2300
|
-
ancestorScroll && ancestor.addEventListener("scroll", update);
|
|
2301
|
-
ancestorResize && ancestor.addEventListener("resize", update);
|
|
2302
|
-
});
|
|
2303
|
-
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update, ancestorResize) : null;
|
|
2304
|
-
let reobserveFrame = -1;
|
|
2305
|
-
let resizeObserver = null;
|
|
2306
|
-
if (elementResize) {
|
|
2307
|
-
resizeObserver = new ResizeObserver((_ref) => {
|
|
2308
|
-
let [firstEntry] = _ref;
|
|
2309
|
-
if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {
|
|
2310
|
-
resizeObserver.unobserve(floating);
|
|
2311
|
-
cancelAnimationFrame(reobserveFrame);
|
|
2312
|
-
reobserveFrame = requestAnimationFrame(() => {
|
|
2313
|
-
var _resizeObserver;
|
|
2314
|
-
(_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
|
|
2315
|
-
});
|
|
2316
|
-
}
|
|
2317
|
-
update();
|
|
2318
|
-
});
|
|
2319
|
-
if (referenceEl && !animationFrame) {
|
|
2320
|
-
resizeObserver.observe(referenceEl);
|
|
2321
|
-
}
|
|
2322
|
-
if (floating) {
|
|
2323
|
-
resizeObserver.observe(floating);
|
|
2324
|
-
}
|
|
2325
|
-
}
|
|
2326
|
-
let frameId;
|
|
2327
|
-
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
2328
|
-
if (animationFrame) {
|
|
2329
|
-
frameLoop();
|
|
2330
|
-
}
|
|
2331
|
-
function frameLoop() {
|
|
2332
|
-
const nextRefRect = getBoundingClientRect(reference);
|
|
2333
|
-
if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
|
|
2334
|
-
update();
|
|
2335
|
-
}
|
|
2336
|
-
prevRefRect = nextRefRect;
|
|
2337
|
-
frameId = requestAnimationFrame(frameLoop);
|
|
2338
|
-
}
|
|
2339
|
-
update();
|
|
2340
|
-
return () => {
|
|
2341
|
-
var _resizeObserver2;
|
|
2342
|
-
ancestors.forEach((ancestor) => {
|
|
2343
|
-
ancestorScroll && ancestor.removeEventListener("scroll", update);
|
|
2344
|
-
ancestorResize && ancestor.removeEventListener("resize", update);
|
|
2345
|
-
});
|
|
2346
|
-
cleanupIo == null || cleanupIo();
|
|
2347
|
-
(_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
|
|
2348
|
-
resizeObserver = null;
|
|
2349
|
-
if (animationFrame) {
|
|
2350
|
-
cancelAnimationFrame(frameId);
|
|
2351
|
-
}
|
|
2352
|
-
};
|
|
2353
|
-
}
|
|
2354
|
-
var detectOverflow2 = detectOverflow;
|
|
2355
|
-
var offset2 = offset;
|
|
2356
|
-
var shift2 = shift;
|
|
2357
|
-
var flip2 = flip;
|
|
2358
|
-
var size2 = size;
|
|
2359
|
-
var computePosition2 = (reference, floating, options) => {
|
|
2360
|
-
const cache = /* @__PURE__ */ new Map();
|
|
2361
|
-
const mergedOptions = options != null ? options : {};
|
|
2362
|
-
const platformWithCache = {
|
|
2363
|
-
...platform,
|
|
2364
|
-
...mergedOptions.platform,
|
|
2365
|
-
_c: cache
|
|
2366
|
-
};
|
|
2367
|
-
return computePosition(reference, floating, {
|
|
2368
|
-
...mergedOptions,
|
|
2369
|
-
platform: platformWithCache
|
|
2370
|
-
});
|
|
2371
|
-
};
|
|
2372
|
-
var isClient = typeof document !== "undefined";
|
|
2373
|
-
var noop = function noop2() {
|
|
2374
|
-
};
|
|
2375
|
-
var index = isClient ? useLayoutEffect : noop;
|
|
2376
|
-
function deepEqual(a8, b2) {
|
|
2377
|
-
if (a8 === b2) {
|
|
2378
|
-
return true;
|
|
2379
|
-
}
|
|
2380
|
-
if (typeof a8 !== typeof b2) {
|
|
2381
|
-
return false;
|
|
2382
|
-
}
|
|
2383
|
-
if (typeof a8 === "function" && a8.toString() === b2.toString()) {
|
|
2384
|
-
return true;
|
|
2385
|
-
}
|
|
2386
|
-
let length;
|
|
2387
|
-
let i4;
|
|
2388
|
-
let keys;
|
|
2389
|
-
if (a8 && b2 && typeof a8 === "object") {
|
|
2390
|
-
if (Array.isArray(a8)) {
|
|
2391
|
-
length = a8.length;
|
|
2392
|
-
if (length !== b2.length) return false;
|
|
2393
|
-
for (i4 = length; i4-- !== 0; ) {
|
|
2394
|
-
if (!deepEqual(a8[i4], b2[i4])) {
|
|
2395
|
-
return false;
|
|
2396
|
-
}
|
|
2397
|
-
}
|
|
2398
|
-
return true;
|
|
2399
|
-
}
|
|
2400
|
-
keys = Object.keys(a8);
|
|
2401
|
-
length = keys.length;
|
|
2402
|
-
if (length !== Object.keys(b2).length) {
|
|
2403
|
-
return false;
|
|
2404
|
-
}
|
|
2405
|
-
for (i4 = length; i4-- !== 0; ) {
|
|
2406
|
-
if (!{}.hasOwnProperty.call(b2, keys[i4])) {
|
|
2407
|
-
return false;
|
|
2408
|
-
}
|
|
2409
|
-
}
|
|
2410
|
-
for (i4 = length; i4-- !== 0; ) {
|
|
2411
|
-
const key = keys[i4];
|
|
2412
|
-
if (key === "_owner" && a8.$$typeof) {
|
|
2413
|
-
continue;
|
|
2414
|
-
}
|
|
2415
|
-
if (!deepEqual(a8[key], b2[key])) {
|
|
2416
|
-
return false;
|
|
2417
|
-
}
|
|
2418
|
-
}
|
|
2419
|
-
return true;
|
|
2420
|
-
}
|
|
2421
|
-
return a8 !== a8 && b2 !== b2;
|
|
2422
|
-
}
|
|
2423
|
-
function getDPR(element) {
|
|
2424
|
-
if (typeof window === "undefined") {
|
|
2425
|
-
return 1;
|
|
2426
|
-
}
|
|
2427
|
-
const win = element.ownerDocument.defaultView || window;
|
|
2428
|
-
return win.devicePixelRatio || 1;
|
|
2429
|
-
}
|
|
2430
|
-
function roundByDPR(element, value) {
|
|
2431
|
-
const dpr = getDPR(element);
|
|
2432
|
-
return Math.round(value * dpr) / dpr;
|
|
2433
|
-
}
|
|
2434
|
-
function useLatestRef(value) {
|
|
2435
|
-
const ref = React2.useRef(value);
|
|
2436
|
-
index(() => {
|
|
2437
|
-
ref.current = value;
|
|
2438
|
-
});
|
|
2439
|
-
return ref;
|
|
2440
|
-
}
|
|
2441
|
-
function useFloating(options) {
|
|
2442
|
-
if (options === void 0) {
|
|
2443
|
-
options = {};
|
|
2444
|
-
}
|
|
2445
|
-
const {
|
|
2446
|
-
placement = "bottom",
|
|
2447
|
-
strategy = "absolute",
|
|
2448
|
-
middleware = [],
|
|
2449
|
-
platform: platform2,
|
|
2450
|
-
elements: {
|
|
2451
|
-
reference: externalReference,
|
|
2452
|
-
floating: externalFloating
|
|
2453
|
-
} = {},
|
|
2454
|
-
transform = true,
|
|
2455
|
-
whileElementsMounted,
|
|
2456
|
-
open
|
|
2457
|
-
} = options;
|
|
2458
|
-
const [data, setData] = React2.useState({
|
|
2459
|
-
x: 0,
|
|
2460
|
-
y: 0,
|
|
2461
|
-
strategy,
|
|
2462
|
-
placement,
|
|
2463
|
-
middlewareData: {},
|
|
2464
|
-
isPositioned: false
|
|
2465
|
-
});
|
|
2466
|
-
const [latestMiddleware, setLatestMiddleware] = React2.useState(middleware);
|
|
2467
|
-
if (!deepEqual(latestMiddleware, middleware)) {
|
|
2468
|
-
setLatestMiddleware(middleware);
|
|
2469
|
-
}
|
|
2470
|
-
const [_reference, _setReference] = React2.useState(null);
|
|
2471
|
-
const [_floating, _setFloating] = React2.useState(null);
|
|
2472
|
-
const setReference = React2.useCallback((node) => {
|
|
2473
|
-
if (node !== referenceRef.current) {
|
|
2474
|
-
referenceRef.current = node;
|
|
2475
|
-
_setReference(node);
|
|
2476
|
-
}
|
|
2477
|
-
}, []);
|
|
2478
|
-
const setFloating = React2.useCallback((node) => {
|
|
2479
|
-
if (node !== floatingRef.current) {
|
|
2480
|
-
floatingRef.current = node;
|
|
2481
|
-
_setFloating(node);
|
|
2482
|
-
}
|
|
2483
|
-
}, []);
|
|
2484
|
-
const referenceEl = externalReference || _reference;
|
|
2485
|
-
const floatingEl = externalFloating || _floating;
|
|
2486
|
-
const referenceRef = React2.useRef(null);
|
|
2487
|
-
const floatingRef = React2.useRef(null);
|
|
2488
|
-
const dataRef = React2.useRef(data);
|
|
2489
|
-
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
2490
|
-
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
2491
|
-
const platformRef = useLatestRef(platform2);
|
|
2492
|
-
const openRef = useLatestRef(open);
|
|
2493
|
-
const update = React2.useCallback(() => {
|
|
2494
|
-
if (!referenceRef.current || !floatingRef.current) {
|
|
2495
|
-
return;
|
|
2496
|
-
}
|
|
2497
|
-
const config = {
|
|
2498
|
-
placement,
|
|
2499
|
-
strategy,
|
|
2500
|
-
middleware: latestMiddleware
|
|
2501
|
-
};
|
|
2502
|
-
if (platformRef.current) {
|
|
2503
|
-
config.platform = platformRef.current;
|
|
2504
|
-
}
|
|
2505
|
-
computePosition2(referenceRef.current, floatingRef.current, config).then((data2) => {
|
|
2506
|
-
const fullData = {
|
|
2507
|
-
...data2,
|
|
2508
|
-
// The floating element's position may be recomputed while it's closed
|
|
2509
|
-
// but still mounted (such as when transitioning out). To ensure
|
|
2510
|
-
// `isPositioned` will be `false` initially on the next open, avoid
|
|
2511
|
-
// setting it to `true` when `open === false` (must be specified).
|
|
2512
|
-
isPositioned: openRef.current !== false
|
|
2513
|
-
};
|
|
2514
|
-
if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
|
|
2515
|
-
dataRef.current = fullData;
|
|
2516
|
-
ReactDOM2.flushSync(() => {
|
|
2517
|
-
setData(fullData);
|
|
2518
|
-
});
|
|
2519
|
-
}
|
|
2520
|
-
});
|
|
2521
|
-
}, [latestMiddleware, placement, strategy, platformRef, openRef]);
|
|
2522
|
-
index(() => {
|
|
2523
|
-
if (open === false && dataRef.current.isPositioned) {
|
|
2524
|
-
dataRef.current.isPositioned = false;
|
|
2525
|
-
setData((data2) => ({
|
|
2526
|
-
...data2,
|
|
2527
|
-
isPositioned: false
|
|
2528
|
-
}));
|
|
2529
|
-
}
|
|
2530
|
-
}, [open]);
|
|
2531
|
-
const isMountedRef = React2.useRef(false);
|
|
2532
|
-
index(() => {
|
|
2533
|
-
isMountedRef.current = true;
|
|
2534
|
-
return () => {
|
|
2535
|
-
isMountedRef.current = false;
|
|
2536
|
-
};
|
|
2537
|
-
}, []);
|
|
2538
|
-
index(() => {
|
|
2539
|
-
if (referenceEl) referenceRef.current = referenceEl;
|
|
2540
|
-
if (floatingEl) floatingRef.current = floatingEl;
|
|
2541
|
-
if (referenceEl && floatingEl) {
|
|
2542
|
-
if (whileElementsMountedRef.current) {
|
|
2543
|
-
return whileElementsMountedRef.current(referenceEl, floatingEl, update);
|
|
2544
|
-
}
|
|
2545
|
-
update();
|
|
2546
|
-
}
|
|
2547
|
-
}, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
|
|
2548
|
-
const refs = React2.useMemo(() => ({
|
|
2549
|
-
reference: referenceRef,
|
|
2550
|
-
floating: floatingRef,
|
|
2551
|
-
setReference,
|
|
2552
|
-
setFloating
|
|
2553
|
-
}), [setReference, setFloating]);
|
|
2554
|
-
const elements = React2.useMemo(() => ({
|
|
2555
|
-
reference: referenceEl,
|
|
2556
|
-
floating: floatingEl
|
|
2557
|
-
}), [referenceEl, floatingEl]);
|
|
2558
|
-
const floatingStyles = React2.useMemo(() => {
|
|
2559
|
-
const initialStyles = {
|
|
2560
|
-
position: strategy,
|
|
2561
|
-
left: 0,
|
|
2562
|
-
top: 0
|
|
2563
|
-
};
|
|
2564
|
-
if (!elements.floating) {
|
|
2565
|
-
return initialStyles;
|
|
2566
|
-
}
|
|
2567
|
-
const x = roundByDPR(elements.floating, data.x);
|
|
2568
|
-
const y3 = roundByDPR(elements.floating, data.y);
|
|
2569
|
-
if (transform) {
|
|
2570
|
-
return {
|
|
2571
|
-
...initialStyles,
|
|
2572
|
-
transform: "translate(" + x + "px, " + y3 + "px)",
|
|
2573
|
-
...getDPR(elements.floating) >= 1.5 && {
|
|
2574
|
-
willChange: "transform"
|
|
2575
|
-
}
|
|
2576
|
-
};
|
|
2577
|
-
}
|
|
2578
|
-
return {
|
|
2579
|
-
position: strategy,
|
|
2580
|
-
left: x,
|
|
2581
|
-
top: y3
|
|
2582
|
-
};
|
|
2583
|
-
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
2584
|
-
return React2.useMemo(() => ({
|
|
2585
|
-
...data,
|
|
2586
|
-
update,
|
|
2587
|
-
refs,
|
|
2588
|
-
elements,
|
|
2589
|
-
floatingStyles
|
|
2590
|
-
}), [data, update, refs, elements, floatingStyles]);
|
|
2591
|
-
}
|
|
2592
|
-
var offset3 = (options, deps) => {
|
|
2593
|
-
const result = offset2(options);
|
|
2594
|
-
return {
|
|
2595
|
-
name: result.name,
|
|
2596
|
-
fn: result.fn,
|
|
2597
|
-
options: [options, deps]
|
|
2598
|
-
};
|
|
2599
|
-
};
|
|
2600
|
-
var shift3 = (options, deps) => {
|
|
2601
|
-
const result = shift2(options);
|
|
2602
|
-
return {
|
|
2603
|
-
name: result.name,
|
|
2604
|
-
fn: result.fn,
|
|
2605
|
-
options: [options, deps]
|
|
2606
|
-
};
|
|
2607
|
-
};
|
|
2608
|
-
var flip3 = (options, deps) => {
|
|
2609
|
-
const result = flip2(options);
|
|
2610
|
-
return {
|
|
2611
|
-
name: result.name,
|
|
2612
|
-
fn: result.fn,
|
|
2613
|
-
options: [options, deps]
|
|
2614
|
-
};
|
|
2615
|
-
};
|
|
2616
|
-
var size3 = (options, deps) => {
|
|
2617
|
-
const result = size2(options);
|
|
2618
|
-
return {
|
|
2619
|
-
name: result.name,
|
|
2620
|
-
fn: result.fn,
|
|
2621
|
-
options: [options, deps]
|
|
2622
|
-
};
|
|
2623
|
-
};
|
|
2624
|
-
|
|
2625
|
-
// ../node_modules/@floating-ui/react/dist/floating-ui.react.mjs
|
|
2626
|
-
var SafeReact = {
|
|
2627
|
-
...React2
|
|
2628
|
-
};
|
|
2629
|
-
var useInsertionEffect = SafeReact.useInsertionEffect;
|
|
2630
|
-
var useSafeInsertionEffect = useInsertionEffect || ((fn) => fn());
|
|
2631
|
-
function useEffectEvent(callback) {
|
|
2632
|
-
const ref = React2.useRef(() => {
|
|
2633
|
-
{
|
|
2634
|
-
throw new Error("Cannot call an event handler while rendering.");
|
|
2635
|
-
}
|
|
2636
|
-
});
|
|
2637
|
-
useSafeInsertionEffect(() => {
|
|
2638
|
-
ref.current = callback;
|
|
2639
|
-
});
|
|
2640
|
-
return React2.useCallback(function() {
|
|
2641
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2642
|
-
args[_key] = arguments[_key];
|
|
2643
|
-
}
|
|
2644
|
-
return ref.current == null ? void 0 : ref.current(...args);
|
|
2645
|
-
}, []);
|
|
2646
|
-
}
|
|
2647
|
-
var index2 = typeof document !== "undefined" ? useLayoutEffect : useEffect;
|
|
2648
|
-
var serverHandoffComplete = false;
|
|
2649
|
-
var count = 0;
|
|
2650
|
-
var genId = () => (
|
|
2651
|
-
// Ensure the id is unique with multiple independent versions of Floating UI
|
|
2652
|
-
// on <React 18
|
|
2653
|
-
"floating-ui-" + Math.random().toString(36).slice(2, 6) + count++
|
|
2654
|
-
);
|
|
2655
|
-
function useFloatingId() {
|
|
2656
|
-
const [id, setId] = React2.useState(() => serverHandoffComplete ? genId() : void 0);
|
|
2657
|
-
index2(() => {
|
|
2658
|
-
if (id == null) {
|
|
2659
|
-
setId(genId());
|
|
2660
|
-
}
|
|
2661
|
-
}, []);
|
|
2662
|
-
React2.useEffect(() => {
|
|
2663
|
-
serverHandoffComplete = true;
|
|
2664
|
-
}, []);
|
|
2665
|
-
return id;
|
|
2666
|
-
}
|
|
2667
|
-
var useReactId = SafeReact.useId;
|
|
2668
|
-
var useId = useReactId || useFloatingId;
|
|
2669
|
-
var devMessageSet;
|
|
2670
|
-
{
|
|
2671
|
-
devMessageSet = /* @__PURE__ */ new Set();
|
|
2672
|
-
}
|
|
2673
|
-
function warn() {
|
|
2674
|
-
var _devMessageSet;
|
|
2675
|
-
for (var _len = arguments.length, messages = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2676
|
-
messages[_key] = arguments[_key];
|
|
2677
|
-
}
|
|
2678
|
-
const message = "Floating UI: " + messages.join(" ");
|
|
2679
|
-
if (!((_devMessageSet = devMessageSet) != null && _devMessageSet.has(message))) {
|
|
2680
|
-
var _devMessageSet2;
|
|
2681
|
-
(_devMessageSet2 = devMessageSet) == null || _devMessageSet2.add(message);
|
|
2682
|
-
console.warn(message);
|
|
2683
|
-
}
|
|
2684
|
-
}
|
|
2685
|
-
function error() {
|
|
2686
|
-
var _devMessageSet3;
|
|
2687
|
-
for (var _len2 = arguments.length, messages = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
2688
|
-
messages[_key2] = arguments[_key2];
|
|
2689
|
-
}
|
|
2690
|
-
const message = "Floating UI: " + messages.join(" ");
|
|
2691
|
-
if (!((_devMessageSet3 = devMessageSet) != null && _devMessageSet3.has(message))) {
|
|
2692
|
-
var _devMessageSet4;
|
|
2693
|
-
(_devMessageSet4 = devMessageSet) == null || _devMessageSet4.add(message);
|
|
2694
|
-
console.error(message);
|
|
2695
|
-
}
|
|
2696
|
-
}
|
|
2697
|
-
function createPubSub() {
|
|
2698
|
-
const map = /* @__PURE__ */ new Map();
|
|
2699
|
-
return {
|
|
2700
|
-
emit(event, data) {
|
|
2701
|
-
var _map$get;
|
|
2702
|
-
(_map$get = map.get(event)) == null || _map$get.forEach((handler) => handler(data));
|
|
2703
|
-
},
|
|
2704
|
-
on(event, listener) {
|
|
2705
|
-
map.set(event, [...map.get(event) || [], listener]);
|
|
2706
|
-
},
|
|
2707
|
-
off(event, listener) {
|
|
2708
|
-
var _map$get2;
|
|
2709
|
-
map.set(event, ((_map$get2 = map.get(event)) == null ? void 0 : _map$get2.filter((l8) => l8 !== listener)) || []);
|
|
2710
|
-
}
|
|
2711
|
-
};
|
|
2712
|
-
}
|
|
2713
|
-
var FloatingNodeContext = /* @__PURE__ */ React2.createContext(null);
|
|
2714
|
-
var FloatingTreeContext = /* @__PURE__ */ React2.createContext(null);
|
|
2715
|
-
var useFloatingParentNodeId = () => {
|
|
2716
|
-
var _React$useContext;
|
|
2717
|
-
return ((_React$useContext = React2.useContext(FloatingNodeContext)) == null ? void 0 : _React$useContext.id) || null;
|
|
2718
|
-
};
|
|
2719
|
-
var useFloatingTree = () => React2.useContext(FloatingTreeContext);
|
|
2720
|
-
var FOCUSABLE_ATTRIBUTE = "data-floating-ui-focusable";
|
|
2721
|
-
function useFloatingRootContext(options) {
|
|
2722
|
-
const {
|
|
2723
|
-
open = false,
|
|
2724
|
-
onOpenChange: onOpenChangeProp,
|
|
2725
|
-
elements: elementsProp
|
|
2726
|
-
} = options;
|
|
2727
|
-
const floatingId = useId();
|
|
2728
|
-
const dataRef = React2.useRef({});
|
|
2729
|
-
const [events] = React2.useState(() => createPubSub());
|
|
2730
|
-
const nested = useFloatingParentNodeId() != null;
|
|
2731
|
-
{
|
|
2732
|
-
const optionDomReference = elementsProp.reference;
|
|
2733
|
-
if (optionDomReference && !isElement(optionDomReference)) {
|
|
2734
|
-
error("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
|
|
2735
|
-
}
|
|
2736
|
-
}
|
|
2737
|
-
const [positionReference, setPositionReference] = React2.useState(elementsProp.reference);
|
|
2738
|
-
const onOpenChange = useEffectEvent((open2, event, reason) => {
|
|
2739
|
-
dataRef.current.openEvent = open2 ? event : void 0;
|
|
2740
|
-
events.emit("openchange", {
|
|
2741
|
-
open: open2,
|
|
2742
|
-
event,
|
|
2743
|
-
reason,
|
|
2744
|
-
nested
|
|
2745
|
-
});
|
|
2746
|
-
onOpenChangeProp == null || onOpenChangeProp(open2, event, reason);
|
|
2747
|
-
});
|
|
2748
|
-
const refs = React2.useMemo(() => ({
|
|
2749
|
-
setPositionReference
|
|
2750
|
-
}), []);
|
|
2751
|
-
const elements = React2.useMemo(() => ({
|
|
2752
|
-
reference: positionReference || elementsProp.reference || null,
|
|
2753
|
-
floating: elementsProp.floating || null,
|
|
2754
|
-
domReference: elementsProp.reference
|
|
2755
|
-
}), [positionReference, elementsProp.reference, elementsProp.floating]);
|
|
2756
|
-
return React2.useMemo(() => ({
|
|
2757
|
-
dataRef,
|
|
2758
|
-
open,
|
|
2759
|
-
onOpenChange,
|
|
2760
|
-
elements,
|
|
2761
|
-
events,
|
|
2762
|
-
floatingId,
|
|
2763
|
-
refs
|
|
2764
|
-
}), [open, onOpenChange, elements, events, floatingId, refs]);
|
|
2765
|
-
}
|
|
2766
|
-
function useFloating2(options) {
|
|
2767
|
-
if (options === void 0) {
|
|
2768
|
-
options = {};
|
|
2769
|
-
}
|
|
2770
|
-
const {
|
|
2771
|
-
nodeId
|
|
2772
|
-
} = options;
|
|
2773
|
-
const internalRootContext = useFloatingRootContext({
|
|
2774
|
-
...options,
|
|
2775
|
-
elements: {
|
|
2776
|
-
reference: null,
|
|
2777
|
-
floating: null,
|
|
2778
|
-
...options.elements
|
|
2779
|
-
}
|
|
2780
|
-
});
|
|
2781
|
-
const rootContext = options.rootContext || internalRootContext;
|
|
2782
|
-
const computedElements = rootContext.elements;
|
|
2783
|
-
const [_domReference, setDomReference] = React2.useState(null);
|
|
2784
|
-
const [positionReference, _setPositionReference] = React2.useState(null);
|
|
2785
|
-
const optionDomReference = computedElements == null ? void 0 : computedElements.domReference;
|
|
2786
|
-
const domReference = optionDomReference || _domReference;
|
|
2787
|
-
const domReferenceRef = React2.useRef(null);
|
|
2788
|
-
const tree = useFloatingTree();
|
|
2789
|
-
index2(() => {
|
|
2790
|
-
if (domReference) {
|
|
2791
|
-
domReferenceRef.current = domReference;
|
|
2792
|
-
}
|
|
2793
|
-
}, [domReference]);
|
|
2794
|
-
const position = useFloating({
|
|
2795
|
-
...options,
|
|
2796
|
-
elements: {
|
|
2797
|
-
...computedElements,
|
|
2798
|
-
...positionReference && {
|
|
2799
|
-
reference: positionReference
|
|
2800
|
-
}
|
|
2801
|
-
}
|
|
2802
|
-
});
|
|
2803
|
-
const setPositionReference = React2.useCallback((node) => {
|
|
2804
|
-
const computedPositionReference = isElement(node) ? {
|
|
2805
|
-
getBoundingClientRect: () => node.getBoundingClientRect(),
|
|
2806
|
-
contextElement: node
|
|
2807
|
-
} : node;
|
|
2808
|
-
_setPositionReference(computedPositionReference);
|
|
2809
|
-
position.refs.setReference(computedPositionReference);
|
|
2810
|
-
}, [position.refs]);
|
|
2811
|
-
const setReference = React2.useCallback((node) => {
|
|
2812
|
-
if (isElement(node) || node === null) {
|
|
2813
|
-
domReferenceRef.current = node;
|
|
2814
|
-
setDomReference(node);
|
|
2815
|
-
}
|
|
2816
|
-
if (isElement(position.refs.reference.current) || position.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
|
|
2817
|
-
// `null` to support `positionReference` + an unstable `reference`
|
|
2818
|
-
// callback ref.
|
|
2819
|
-
node !== null && !isElement(node)) {
|
|
2820
|
-
position.refs.setReference(node);
|
|
2821
|
-
}
|
|
2822
|
-
}, [position.refs]);
|
|
2823
|
-
const refs = React2.useMemo(() => ({
|
|
2824
|
-
...position.refs,
|
|
2825
|
-
setReference,
|
|
2826
|
-
setPositionReference,
|
|
2827
|
-
domReference: domReferenceRef
|
|
2828
|
-
}), [position.refs, setReference, setPositionReference]);
|
|
2829
|
-
const elements = React2.useMemo(() => ({
|
|
2830
|
-
...position.elements,
|
|
2831
|
-
domReference
|
|
2832
|
-
}), [position.elements, domReference]);
|
|
2833
|
-
const context = React2.useMemo(() => ({
|
|
2834
|
-
...position,
|
|
2835
|
-
...rootContext,
|
|
2836
|
-
refs,
|
|
2837
|
-
elements,
|
|
2838
|
-
nodeId
|
|
2839
|
-
}), [position, refs, elements, nodeId, rootContext]);
|
|
2840
|
-
index2(() => {
|
|
2841
|
-
rootContext.dataRef.current.floatingContext = context;
|
|
2842
|
-
const node = tree == null ? void 0 : tree.nodesRef.current.find((node2) => node2.id === nodeId);
|
|
2843
|
-
if (node) {
|
|
2844
|
-
node.context = context;
|
|
2845
|
-
}
|
|
2846
|
-
});
|
|
2847
|
-
return React2.useMemo(() => ({
|
|
2848
|
-
...position,
|
|
2849
|
-
context,
|
|
2850
|
-
refs,
|
|
2851
|
-
elements
|
|
2852
|
-
}), [position, refs, elements, context]);
|
|
2853
|
-
}
|
|
2854
|
-
var ACTIVE_KEY = "active";
|
|
2855
|
-
var SELECTED_KEY = "selected";
|
|
2856
|
-
function mergeProps(userProps, propsList, elementKey) {
|
|
2857
|
-
const map = /* @__PURE__ */ new Map();
|
|
2858
|
-
const isItem = elementKey === "item";
|
|
2859
|
-
let domUserProps = userProps;
|
|
2860
|
-
if (isItem && userProps) {
|
|
2861
|
-
const {
|
|
2862
|
-
[ACTIVE_KEY]: _2,
|
|
2863
|
-
[SELECTED_KEY]: __,
|
|
2864
|
-
...validProps
|
|
2865
|
-
} = userProps;
|
|
2866
|
-
domUserProps = validProps;
|
|
2867
|
-
}
|
|
2868
|
-
return {
|
|
2869
|
-
...elementKey === "floating" && {
|
|
2870
|
-
tabIndex: -1,
|
|
2871
|
-
[FOCUSABLE_ATTRIBUTE]: ""
|
|
2872
|
-
},
|
|
2873
|
-
...domUserProps,
|
|
2874
|
-
...propsList.map((value) => {
|
|
2875
|
-
const propsOrGetProps = value ? value[elementKey] : null;
|
|
2876
|
-
if (typeof propsOrGetProps === "function") {
|
|
2877
|
-
return userProps ? propsOrGetProps(userProps) : null;
|
|
2878
|
-
}
|
|
2879
|
-
return propsOrGetProps;
|
|
2880
|
-
}).concat(userProps).reduce((acc, props) => {
|
|
2881
|
-
if (!props) {
|
|
2882
|
-
return acc;
|
|
2883
|
-
}
|
|
2884
|
-
Object.entries(props).forEach((_ref) => {
|
|
2885
|
-
let [key, value] = _ref;
|
|
2886
|
-
if (isItem && [ACTIVE_KEY, SELECTED_KEY].includes(key)) {
|
|
2887
|
-
return;
|
|
2888
|
-
}
|
|
2889
|
-
if (key.indexOf("on") === 0) {
|
|
2890
|
-
if (!map.has(key)) {
|
|
2891
|
-
map.set(key, []);
|
|
2892
|
-
}
|
|
2893
|
-
if (typeof value === "function") {
|
|
2894
|
-
var _map$get;
|
|
2895
|
-
(_map$get = map.get(key)) == null || _map$get.push(value);
|
|
2896
|
-
acc[key] = function() {
|
|
2897
|
-
var _map$get2;
|
|
2898
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2899
|
-
args[_key] = arguments[_key];
|
|
2900
|
-
}
|
|
2901
|
-
return (_map$get2 = map.get(key)) == null ? void 0 : _map$get2.map((fn) => fn(...args)).find((val) => val !== void 0);
|
|
2902
|
-
};
|
|
2903
|
-
}
|
|
2904
|
-
} else {
|
|
2905
|
-
acc[key] = value;
|
|
2906
|
-
}
|
|
2907
|
-
});
|
|
2908
|
-
return acc;
|
|
2909
|
-
}, {})
|
|
2910
|
-
};
|
|
2911
|
-
}
|
|
2912
|
-
function useInteractions(propsList) {
|
|
2913
|
-
if (propsList === void 0) {
|
|
2914
|
-
propsList = [];
|
|
2915
|
-
}
|
|
2916
|
-
const referenceDeps = propsList.map((key) => key == null ? void 0 : key.reference);
|
|
2917
|
-
const floatingDeps = propsList.map((key) => key == null ? void 0 : key.floating);
|
|
2918
|
-
const itemDeps = propsList.map((key) => key == null ? void 0 : key.item);
|
|
2919
|
-
const getReferenceProps = React2.useCallback(
|
|
2920
|
-
(userProps) => mergeProps(userProps, propsList, "reference"),
|
|
2921
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2922
|
-
referenceDeps
|
|
2923
|
-
);
|
|
2924
|
-
const getFloatingProps = React2.useCallback(
|
|
2925
|
-
(userProps) => mergeProps(userProps, propsList, "floating"),
|
|
2926
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2927
|
-
floatingDeps
|
|
2928
|
-
);
|
|
2929
|
-
const getItemProps = React2.useCallback(
|
|
2930
|
-
(userProps) => mergeProps(userProps, propsList, "item"),
|
|
2931
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2932
|
-
itemDeps
|
|
2933
|
-
);
|
|
2934
|
-
return React2.useMemo(() => ({
|
|
2935
|
-
getReferenceProps,
|
|
2936
|
-
getFloatingProps,
|
|
2937
|
-
getItemProps
|
|
2938
|
-
}), [getReferenceProps, getFloatingProps, getItemProps]);
|
|
2939
|
-
}
|
|
2940
|
-
function getArgsWithCustomFloatingHeight(state, height) {
|
|
2941
|
-
return {
|
|
2942
|
-
...state,
|
|
2943
|
-
rects: {
|
|
2944
|
-
...state.rects,
|
|
2945
|
-
floating: {
|
|
2946
|
-
...state.rects.floating,
|
|
2947
|
-
height
|
|
2948
|
-
}
|
|
2949
|
-
}
|
|
2950
|
-
};
|
|
2951
|
-
}
|
|
2952
|
-
var inner = (props) => ({
|
|
2953
|
-
name: "inner",
|
|
2954
|
-
options: props,
|
|
2955
|
-
async fn(state) {
|
|
2956
|
-
const {
|
|
2957
|
-
listRef,
|
|
2958
|
-
overflowRef,
|
|
2959
|
-
onFallbackChange,
|
|
2960
|
-
offset: innerOffset = 0,
|
|
2961
|
-
index: index3 = 0,
|
|
2962
|
-
minItemsVisible = 4,
|
|
2963
|
-
referenceOverflowThreshold = 0,
|
|
2964
|
-
scrollRef,
|
|
2965
|
-
...detectOverflowOptions
|
|
2966
|
-
} = evaluate(props, state);
|
|
2967
|
-
const {
|
|
2968
|
-
rects,
|
|
2969
|
-
elements: {
|
|
2970
|
-
floating
|
|
2971
|
-
}
|
|
2972
|
-
} = state;
|
|
2973
|
-
const item = listRef.current[index3];
|
|
2974
|
-
const scrollEl = (scrollRef == null ? void 0 : scrollRef.current) || floating;
|
|
2975
|
-
const clientTop = floating.clientTop || scrollEl.clientTop;
|
|
2976
|
-
const floatingIsBordered = floating.clientTop !== 0;
|
|
2977
|
-
const scrollElIsBordered = scrollEl.clientTop !== 0;
|
|
2978
|
-
const floatingIsScrollEl = floating === scrollEl;
|
|
2979
|
-
{
|
|
2980
|
-
if (!state.placement.startsWith("bottom")) {
|
|
2981
|
-
warn('`placement` side must be "bottom" when using the `inner`', "middleware.");
|
|
2982
|
-
}
|
|
2983
|
-
}
|
|
2984
|
-
if (!item) {
|
|
2985
|
-
return {};
|
|
2986
|
-
}
|
|
2987
|
-
const nextArgs = {
|
|
2988
|
-
...state,
|
|
2989
|
-
...await offset3(-item.offsetTop - floating.clientTop - rects.reference.height / 2 - item.offsetHeight / 2 - innerOffset).fn(state)
|
|
2990
|
-
};
|
|
2991
|
-
const overflow = await detectOverflow2(getArgsWithCustomFloatingHeight(nextArgs, scrollEl.scrollHeight + clientTop + floating.clientTop), detectOverflowOptions);
|
|
2992
|
-
const refOverflow = await detectOverflow2(nextArgs, {
|
|
2993
|
-
...detectOverflowOptions,
|
|
2994
|
-
elementContext: "reference"
|
|
2995
|
-
});
|
|
2996
|
-
const diffY = max(0, overflow.top);
|
|
2997
|
-
const nextY = nextArgs.y + diffY;
|
|
2998
|
-
const isScrollable = scrollEl.scrollHeight > scrollEl.clientHeight;
|
|
2999
|
-
const rounder = isScrollable ? (v3) => v3 : round;
|
|
3000
|
-
const maxHeight = rounder(max(0, scrollEl.scrollHeight + (floatingIsBordered && floatingIsScrollEl || scrollElIsBordered ? clientTop * 2 : 0) - diffY - max(0, overflow.bottom)));
|
|
3001
|
-
scrollEl.style.maxHeight = maxHeight + "px";
|
|
3002
|
-
scrollEl.scrollTop = diffY;
|
|
3003
|
-
if (onFallbackChange) {
|
|
3004
|
-
const shouldFallback = scrollEl.offsetHeight < item.offsetHeight * min(minItemsVisible, listRef.current.length) - 1 || refOverflow.top >= -referenceOverflowThreshold || refOverflow.bottom >= -referenceOverflowThreshold;
|
|
3005
|
-
ReactDOM2.flushSync(() => onFallbackChange(shouldFallback));
|
|
3006
|
-
}
|
|
3007
|
-
if (overflowRef) {
|
|
3008
|
-
overflowRef.current = await detectOverflow2(getArgsWithCustomFloatingHeight({
|
|
3009
|
-
...nextArgs,
|
|
3010
|
-
y: nextY
|
|
3011
|
-
}, scrollEl.offsetHeight + clientTop + floating.clientTop), detectOverflowOptions);
|
|
3012
|
-
}
|
|
3013
|
-
return {
|
|
3014
|
-
y: nextY
|
|
3015
|
-
};
|
|
3016
|
-
}
|
|
3017
|
-
});
|
|
3018
|
-
function useInnerOffset(context, props) {
|
|
3019
|
-
const {
|
|
3020
|
-
open,
|
|
3021
|
-
elements
|
|
3022
|
-
} = context;
|
|
3023
|
-
const {
|
|
3024
|
-
enabled = true,
|
|
3025
|
-
overflowRef,
|
|
3026
|
-
scrollRef,
|
|
3027
|
-
onChange: unstable_onChange
|
|
3028
|
-
} = props;
|
|
3029
|
-
const onChange = useEffectEvent(unstable_onChange);
|
|
3030
|
-
const controlledScrollingRef = React2.useRef(false);
|
|
3031
|
-
const prevScrollTopRef = React2.useRef(null);
|
|
3032
|
-
const initialOverflowRef = React2.useRef(null);
|
|
3033
|
-
React2.useEffect(() => {
|
|
3034
|
-
if (!enabled) return;
|
|
3035
|
-
function onWheel(e3) {
|
|
3036
|
-
if (e3.ctrlKey || !el || overflowRef.current == null) {
|
|
3037
|
-
return;
|
|
3038
|
-
}
|
|
3039
|
-
const dY = e3.deltaY;
|
|
3040
|
-
const isAtTop = overflowRef.current.top >= -0.5;
|
|
3041
|
-
const isAtBottom = overflowRef.current.bottom >= -0.5;
|
|
3042
|
-
const remainingScroll = el.scrollHeight - el.clientHeight;
|
|
3043
|
-
const sign = dY < 0 ? -1 : 1;
|
|
3044
|
-
const method = dY < 0 ? "max" : "min";
|
|
3045
|
-
if (el.scrollHeight <= el.clientHeight) {
|
|
3046
|
-
return;
|
|
3047
|
-
}
|
|
3048
|
-
if (!isAtTop && dY > 0 || !isAtBottom && dY < 0) {
|
|
3049
|
-
e3.preventDefault();
|
|
3050
|
-
ReactDOM2.flushSync(() => {
|
|
3051
|
-
onChange((d2) => d2 + Math[method](dY, remainingScroll * sign));
|
|
3052
|
-
});
|
|
3053
|
-
} else if (/firefox/i.test(getUserAgent())) {
|
|
3054
|
-
el.scrollTop += dY;
|
|
3055
|
-
}
|
|
3056
|
-
}
|
|
3057
|
-
const el = (scrollRef == null ? void 0 : scrollRef.current) || elements.floating;
|
|
3058
|
-
if (open && el) {
|
|
3059
|
-
el.addEventListener("wheel", onWheel);
|
|
3060
|
-
requestAnimationFrame(() => {
|
|
3061
|
-
prevScrollTopRef.current = el.scrollTop;
|
|
3062
|
-
if (overflowRef.current != null) {
|
|
3063
|
-
initialOverflowRef.current = {
|
|
3064
|
-
...overflowRef.current
|
|
3065
|
-
};
|
|
3066
|
-
}
|
|
3067
|
-
});
|
|
3068
|
-
return () => {
|
|
3069
|
-
prevScrollTopRef.current = null;
|
|
3070
|
-
initialOverflowRef.current = null;
|
|
3071
|
-
el.removeEventListener("wheel", onWheel);
|
|
3072
|
-
};
|
|
3073
|
-
}
|
|
3074
|
-
}, [enabled, open, elements.floating, overflowRef, scrollRef, onChange]);
|
|
3075
|
-
const floating = React2.useMemo(() => ({
|
|
3076
|
-
onKeyDown() {
|
|
3077
|
-
controlledScrollingRef.current = true;
|
|
3078
|
-
},
|
|
3079
|
-
onWheel() {
|
|
3080
|
-
controlledScrollingRef.current = false;
|
|
3081
|
-
},
|
|
3082
|
-
onPointerMove() {
|
|
3083
|
-
controlledScrollingRef.current = false;
|
|
3084
|
-
},
|
|
3085
|
-
onScroll() {
|
|
3086
|
-
const el = (scrollRef == null ? void 0 : scrollRef.current) || elements.floating;
|
|
3087
|
-
if (!overflowRef.current || !el || !controlledScrollingRef.current) {
|
|
3088
|
-
return;
|
|
3089
|
-
}
|
|
3090
|
-
if (prevScrollTopRef.current !== null) {
|
|
3091
|
-
const scrollDiff = el.scrollTop - prevScrollTopRef.current;
|
|
3092
|
-
if (overflowRef.current.bottom < -0.5 && scrollDiff < -1 || overflowRef.current.top < -0.5 && scrollDiff > 1) {
|
|
3093
|
-
ReactDOM2.flushSync(() => onChange((d2) => d2 + scrollDiff));
|
|
3094
|
-
}
|
|
3095
|
-
}
|
|
3096
|
-
requestAnimationFrame(() => {
|
|
3097
|
-
prevScrollTopRef.current = el.scrollTop;
|
|
3098
|
-
});
|
|
3099
|
-
}
|
|
3100
|
-
}), [elements.floating, onChange, overflowRef, scrollRef]);
|
|
3101
|
-
return React2.useMemo(() => enabled ? {
|
|
3102
|
-
floating
|
|
3103
|
-
} : {}, [enabled, floating]);
|
|
3104
|
-
}
|
|
3105
|
-
var y2 = createContext({ styles: void 0, setReference: () => {
|
|
3106
|
-
}, setFloating: () => {
|
|
3107
|
-
}, getReferenceProps: () => ({}), getFloatingProps: () => ({}), slot: {} });
|
|
3108
|
-
y2.displayName = "FloatingContext";
|
|
3109
|
-
var $ = createContext(null);
|
|
3110
|
-
$.displayName = "PlacementContext";
|
|
3111
|
-
function ye(e3) {
|
|
3112
|
-
return useMemo(() => e3 ? typeof e3 == "string" ? { to: e3 } : e3 : null, [e3]);
|
|
3113
|
-
}
|
|
3114
|
-
function Fe() {
|
|
3115
|
-
return useContext(y2).setReference;
|
|
3116
|
-
}
|
|
3117
|
-
function be() {
|
|
3118
|
-
return useContext(y2).getReferenceProps;
|
|
3119
|
-
}
|
|
3120
|
-
function Te() {
|
|
3121
|
-
let { getFloatingProps: e3, slot: t2 } = useContext(y2);
|
|
3122
|
-
return useCallback((...n6) => Object.assign({}, e3(...n6), { "data-anchor": t2.anchor }), [e3, t2]);
|
|
3123
|
-
}
|
|
3124
|
-
function Re(e3 = null) {
|
|
3125
|
-
e3 === false && (e3 = null), typeof e3 == "string" && (e3 = { to: e3 });
|
|
3126
|
-
let t2 = useContext($), n6 = useMemo(() => e3, [JSON.stringify(e3, (l8, o8) => {
|
|
3127
|
-
var u8;
|
|
3128
|
-
return (u8 = o8 == null ? void 0 : o8.outerHTML) != null ? u8 : o8;
|
|
3129
|
-
})]);
|
|
3130
|
-
n(() => {
|
|
3131
|
-
t2 == null || t2(n6 != null ? n6 : null);
|
|
3132
|
-
}, [t2, n6]);
|
|
3133
|
-
let r5 = useContext(y2);
|
|
3134
|
-
return useMemo(() => [r5.setFloating, e3 ? r5.styles : {}], [r5.setFloating, e3, r5.styles]);
|
|
3135
|
-
}
|
|
3136
|
-
var D2 = 4;
|
|
3137
|
-
function Ae({ children: e3, enabled: t2 = true }) {
|
|
3138
|
-
let [n6, r5] = useState(null), [l8, o8] = useState(0), u8 = useRef(null), [f8, s6] = useState(null);
|
|
3139
|
-
ce(f8);
|
|
3140
|
-
let i4 = t2 && n6 !== null && f8 !== null, { to: F = "bottom", gap: E4 = 0, offset: A = 0, padding: c6 = 0, inner: h3 } = ge(n6, f8), [a8, p4 = "center"] = F.split(" ");
|
|
3141
|
-
n(() => {
|
|
3142
|
-
i4 && o8(0);
|
|
3143
|
-
}, [i4]);
|
|
3144
|
-
let { refs: b2, floatingStyles: S2, context: g4 } = useFloating2({ open: i4, placement: a8 === "selection" ? p4 === "center" ? "bottom" : `bottom-${p4}` : p4 === "center" ? `${a8}` : `${a8}-${p4}`, strategy: "absolute", transform: false, middleware: [offset3({ mainAxis: a8 === "selection" ? 0 : E4, crossAxis: A }), shift3({ padding: c6 }), a8 !== "selection" && flip3({ padding: c6 }), a8 === "selection" && h3 ? inner({ ...h3, padding: c6, overflowRef: u8, offset: l8, minItemsVisible: D2, referenceOverflowThreshold: c6, onFallbackChange(P2) {
|
|
3145
|
-
var L4, N2;
|
|
3146
|
-
if (!P2) return;
|
|
3147
|
-
let d2 = g4.elements.floating;
|
|
3148
|
-
if (!d2) return;
|
|
3149
|
-
let M2 = parseFloat(getComputedStyle(d2).scrollPaddingBottom) || 0, I = Math.min(D2, d2.childElementCount), W = 0, B = 0;
|
|
3150
|
-
for (let m5 of (N2 = (L4 = g4.elements.floating) == null ? void 0 : L4.childNodes) != null ? N2 : []) if (n3(m5)) {
|
|
3151
|
-
let x = m5.offsetTop, k2 = x + m5.clientHeight + M2, H3 = d2.scrollTop, U2 = H3 + d2.clientHeight;
|
|
3152
|
-
if (x >= H3 && k2 <= U2) I--;
|
|
3153
|
-
else {
|
|
3154
|
-
B = Math.max(0, Math.min(k2, U2) - Math.max(x, H3)), W = m5.clientHeight;
|
|
3155
|
-
break;
|
|
3156
|
-
}
|
|
3157
|
-
}
|
|
3158
|
-
I >= 1 && o8((m5) => {
|
|
3159
|
-
let x = W * I - B + M2;
|
|
3160
|
-
return m5 >= x ? m5 : x;
|
|
3161
|
-
});
|
|
3162
|
-
} }) : null, size3({ padding: c6, apply({ availableWidth: P2, availableHeight: d2, elements: M2 }) {
|
|
3163
|
-
Object.assign(M2.floating.style, { overflow: "auto", maxWidth: `${P2}px`, maxHeight: `min(var(--anchor-max-height, 100vh), ${d2}px)` });
|
|
3164
|
-
} })].filter(Boolean), whileElementsMounted: autoUpdate }), [w3 = a8, V2 = p4] = g4.placement.split("-");
|
|
3165
|
-
a8 === "selection" && (w3 = "selection");
|
|
3166
|
-
let G2 = useMemo(() => ({ anchor: [w3, V2].filter(Boolean).join(" ") }), [w3, V2]), K2 = useInnerOffset(g4, { overflowRef: u8, onChange: o8 }), { getReferenceProps: Q, getFloatingProps: X } = useInteractions([K2]), Y2 = o2((P2) => {
|
|
3167
|
-
s6(P2), b2.setFloating(P2);
|
|
3168
|
-
});
|
|
3169
|
-
return React2.createElement($.Provider, { value: r5 }, React2.createElement(y2.Provider, { value: { setFloating: Y2, setReference: b2.setReference, styles: S2, getReferenceProps: Q, getFloatingProps: X, slot: G2 } }, e3));
|
|
3170
|
-
}
|
|
3171
|
-
function ce(e3) {
|
|
3172
|
-
n(() => {
|
|
3173
|
-
if (!e3) return;
|
|
3174
|
-
let t2 = new MutationObserver(() => {
|
|
3175
|
-
let n6 = window.getComputedStyle(e3).maxHeight, r5 = parseFloat(n6);
|
|
3176
|
-
if (isNaN(r5)) return;
|
|
3177
|
-
let l8 = parseInt(n6);
|
|
3178
|
-
isNaN(l8) || r5 !== l8 && (e3.style.maxHeight = `${Math.ceil(r5)}px`);
|
|
3179
|
-
});
|
|
3180
|
-
return t2.observe(e3, { attributes: true, attributeFilter: ["style"] }), () => {
|
|
3181
|
-
t2.disconnect();
|
|
3182
|
-
};
|
|
3183
|
-
}, [e3]);
|
|
3184
|
-
}
|
|
3185
|
-
function ge(e3, t2) {
|
|
3186
|
-
var o8, u8, f8;
|
|
3187
|
-
let n6 = O((o8 = e3 == null ? void 0 : e3.gap) != null ? o8 : "var(--anchor-gap, 0)", t2), r5 = O((u8 = e3 == null ? void 0 : e3.offset) != null ? u8 : "var(--anchor-offset, 0)", t2), l8 = O((f8 = e3 == null ? void 0 : e3.padding) != null ? f8 : "var(--anchor-padding, 0)", t2);
|
|
3188
|
-
return { ...e3, gap: n6, offset: r5, padding: l8 };
|
|
3189
|
-
}
|
|
3190
|
-
function O(e3, t2, n6 = void 0) {
|
|
3191
|
-
let r5 = p(), l8 = o2((s6, i4) => {
|
|
3192
|
-
if (s6 == null) return [n6, null];
|
|
3193
|
-
if (typeof s6 == "number") return [s6, null];
|
|
3194
|
-
if (typeof s6 == "string") {
|
|
3195
|
-
if (!i4) return [n6, null];
|
|
3196
|
-
let F = J(s6, i4);
|
|
3197
|
-
return [F, (E4) => {
|
|
3198
|
-
let A = q(s6);
|
|
3199
|
-
{
|
|
3200
|
-
let c6 = A.map((h3) => window.getComputedStyle(i4).getPropertyValue(h3));
|
|
3201
|
-
r5.requestAnimationFrame(function h3() {
|
|
3202
|
-
r5.nextFrame(h3);
|
|
3203
|
-
let a8 = false;
|
|
3204
|
-
for (let [b2, S2] of A.entries()) {
|
|
3205
|
-
let g4 = window.getComputedStyle(i4).getPropertyValue(S2);
|
|
3206
|
-
if (c6[b2] !== g4) {
|
|
3207
|
-
c6[b2] = g4, a8 = true;
|
|
3208
|
-
break;
|
|
3209
|
-
}
|
|
3210
|
-
}
|
|
3211
|
-
if (!a8) return;
|
|
3212
|
-
let p4 = J(s6, i4);
|
|
3213
|
-
F !== p4 && (E4(p4), F = p4);
|
|
3214
|
-
});
|
|
3215
|
-
}
|
|
3216
|
-
return r5.dispose;
|
|
3217
|
-
}];
|
|
3218
|
-
}
|
|
3219
|
-
return [n6, null];
|
|
3220
|
-
}), o8 = useMemo(() => l8(e3, t2)[0], [e3, t2]), [u8 = o8, f8] = useState();
|
|
3221
|
-
return n(() => {
|
|
3222
|
-
let [s6, i4] = l8(e3, t2);
|
|
3223
|
-
if (f8(s6), !!i4) return i4(f8);
|
|
3224
|
-
}, [e3, t2]), u8;
|
|
3225
|
-
}
|
|
3226
|
-
function q(e3) {
|
|
3227
|
-
let t2 = /var\((.*)\)/.exec(e3);
|
|
3228
|
-
if (t2) {
|
|
3229
|
-
let n6 = t2[1].indexOf(",");
|
|
3230
|
-
if (n6 === -1) return [t2[1]];
|
|
3231
|
-
let r5 = t2[1].slice(0, n6).trim(), l8 = t2[1].slice(n6 + 1).trim();
|
|
3232
|
-
return l8 ? [r5, ...q(l8)] : [r5];
|
|
3233
|
-
}
|
|
3234
|
-
return [];
|
|
3235
|
-
}
|
|
3236
|
-
function J(e3, t2) {
|
|
3237
|
-
let n6 = document.createElement("div");
|
|
3238
|
-
t2.appendChild(n6), n6.style.setProperty("margin-top", "0px", "important"), n6.style.setProperty("margin-top", e3, "important");
|
|
3239
|
-
let r5 = parseFloat(window.getComputedStyle(n6).marginTop) || 0;
|
|
3240
|
-
return t2.removeChild(n6), r5;
|
|
3241
|
-
}
|
|
3242
|
-
function f6({ children: t2, freeze: e3 }, o8) {
|
|
3243
|
-
let n6 = u6(e3, t2);
|
|
3244
|
-
return isValidElement(n6) ? cloneElement(n6, { ref: o8 }) : React2__default.createElement(React2__default.Fragment, null, n6);
|
|
3245
|
-
}
|
|
3246
|
-
var s5 = React2__default.forwardRef(f6);
|
|
3247
|
-
function u6(t2, e3) {
|
|
3248
|
-
let [o8, n6] = useState(e3);
|
|
3249
|
-
return !t2 && o8 !== e3 && n6(e3), t2 ? o8 : e3;
|
|
3250
|
-
}
|
|
3251
|
-
|
|
3252
|
-
// ../node_modules/@headlessui/react/dist/utils/calculate-active-index.js
|
|
3253
|
-
function u7(l8) {
|
|
3254
|
-
throw new Error("Unexpected object: " + l8);
|
|
3255
|
-
}
|
|
3256
|
-
var c4 = ((i4) => (i4[i4.First = 0] = "First", i4[i4.Previous = 1] = "Previous", i4[i4.Next = 2] = "Next", i4[i4.Last = 3] = "Last", i4[i4.Specific = 4] = "Specific", i4[i4.Nothing = 5] = "Nothing", i4))(c4 || {});
|
|
3257
|
-
function f7(l8, n6) {
|
|
3258
|
-
let t2 = n6.resolveItems();
|
|
3259
|
-
if (t2.length <= 0) return null;
|
|
3260
|
-
let r5 = n6.resolveActiveIndex(), s6 = r5 != null ? r5 : -1;
|
|
3261
|
-
switch (l8.focus) {
|
|
3262
|
-
case 0: {
|
|
3263
|
-
for (let e3 = 0; e3 < t2.length; ++e3) if (!n6.resolveDisabled(t2[e3], e3, t2)) return e3;
|
|
3264
|
-
return r5;
|
|
3265
|
-
}
|
|
3266
|
-
case 1: {
|
|
3267
|
-
s6 === -1 && (s6 = t2.length);
|
|
3268
|
-
for (let e3 = s6 - 1; e3 >= 0; --e3) if (!n6.resolveDisabled(t2[e3], e3, t2)) return e3;
|
|
3269
|
-
return r5;
|
|
3270
|
-
}
|
|
3271
|
-
case 2: {
|
|
3272
|
-
for (let e3 = s6 + 1; e3 < t2.length; ++e3) if (!n6.resolveDisabled(t2[e3], e3, t2)) return e3;
|
|
3273
|
-
return r5;
|
|
3274
|
-
}
|
|
3275
|
-
case 3: {
|
|
3276
|
-
for (let e3 = t2.length - 1; e3 >= 0; --e3) if (!n6.resolveDisabled(t2[e3], e3, t2)) return e3;
|
|
3277
|
-
return r5;
|
|
3278
|
-
}
|
|
3279
|
-
case 4: {
|
|
3280
|
-
for (let e3 = 0; e3 < t2.length; ++e3) if (n6.resolveId(t2[e3], e3, t2) === l8.id) return e3;
|
|
3281
|
-
return r5;
|
|
3282
|
-
}
|
|
3283
|
-
case 5:
|
|
3284
|
-
return null;
|
|
3285
|
-
default:
|
|
3286
|
-
u7(l8);
|
|
3287
|
-
}
|
|
3288
|
-
}
|
|
3289
|
-
|
|
3290
|
-
// ../node_modules/@headlessui/react/dist/utils/element-movement.js
|
|
3291
|
-
var c5 = { Idle: { kind: "Idle" }, Tracked: (e3) => ({ kind: "Tracked", position: e3 }), Moved: { kind: "Moved" } };
|
|
3292
|
-
function a7(e3) {
|
|
3293
|
-
let t2 = e3.getBoundingClientRect();
|
|
3294
|
-
return `${t2.x},${t2.y}`;
|
|
3295
|
-
}
|
|
3296
|
-
function p3(e3, t2, i4) {
|
|
3297
|
-
let n6 = o();
|
|
3298
|
-
if (t2.kind === "Tracked") {
|
|
3299
|
-
let o8 = function() {
|
|
3300
|
-
d2 !== a7(e3) && (n6.dispose(), i4());
|
|
3301
|
-
};
|
|
3302
|
-
let { position: d2 } = t2, s6 = new ResizeObserver(o8);
|
|
3303
|
-
s6.observe(e3), n6.add(() => s6.disconnect()), n6.addEventListener(window, "scroll", o8, { passive: true }), n6.addEventListener(window, "resize", o8);
|
|
3304
|
-
}
|
|
3305
|
-
return () => n6.dispose();
|
|
3306
|
-
}
|
|
3307
|
-
|
|
3308
|
-
export { $0c4a58759813079a$export$4e328f61c538687f, $e969f22b6713ca4a$export$ae780daf29e6d456, Ae, Fe, JSONView_default, L3 as L, N, Re, S, Te, V, Z, a7 as a, b, be, c4 as c, c5 as c2, e2 as e, f7 as f, g, g3 as g2, j, l3 as l, p3 as p, s4 as s, s5 as s2, u3 as u, u4 as u2, u5 as u3, u6 as u4, w, w2, ye };
|