@unchainedshop/admin-ui 4.8.32 → 4.8.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-2HTCKO4E.js +45 -0
- package/dist/chunk-4MXPTVDL.js +3308 -0
- package/dist/chunk-54DKBWXV.js +33 -0
- package/dist/chunk-6UGLNLJG.js +44 -0
- package/dist/chunk-ATZJXTRA.js +618 -0
- package/dist/chunk-BOMSMJF2.js +77 -0
- package/dist/chunk-COV7BREX.js +50 -0
- package/dist/chunk-CUYIP5XG.js +1099 -0
- package/dist/chunk-E6HDJYA6.js +388 -0
- package/dist/chunk-EAVP6XZQ.js +44 -0
- package/dist/chunk-ED2FP42R.js +2083 -0
- package/dist/chunk-EJDZRZSZ.js +59 -0
- package/dist/chunk-ELPURWDC.js +75 -0
- package/dist/chunk-F6LBNV3H.js +9 -0
- package/dist/chunk-GWMLIF3C.js +694 -0
- package/dist/chunk-GY2DRQGW.js +166 -0
- package/dist/chunk-HERLM47Z.js +309 -0
- package/dist/chunk-IAQPLRXZ.js +16 -0
- package/dist/chunk-ILYPJE4N.js +57 -0
- package/dist/chunk-IWKDBADX.js +73 -0
- package/dist/chunk-IXBMHOB5.js +13 -0
- package/dist/chunk-IYKPRAWC.js +26 -0
- package/dist/chunk-J23QSWDL.js +8 -0
- package/dist/chunk-KH5MK6ZW.js +18 -0
- package/dist/chunk-KRIRF7F6.js +76 -0
- package/dist/chunk-NFJE5EJG.js +135 -0
- package/dist/chunk-NT7RB7AK.js +70 -0
- package/dist/chunk-OKGJ6HDE.js +26 -0
- package/dist/chunk-OTXM2UCD.js +19 -0
- package/dist/chunk-PGJTFYBT.js +23000 -0
- package/dist/chunk-PUI5BIKO.js +41 -0
- package/dist/chunk-Q6S3LBUF.js +180 -0
- package/dist/chunk-QWQ3WJJN.js +1 -0
- package/dist/chunk-RAQV2GYF.js +70 -0
- package/dist/chunk-VBO377AY.js +14 -0
- package/dist/chunk-VYEXPG3M.js +107 -0
- package/dist/chunk-YO6PT7KD.js +13 -0
- package/dist/chunk-YUXHILXY.js +326 -0
- package/dist/chunk-ZUOVKRKC.js +957 -0
- package/dist/components/ui/Accordion/Accordion.d.ts +11 -0
- package/dist/components/ui/Accordion/Accordion.d.ts.map +1 -0
- package/dist/components/ui/Accordion/AccordionHeader.d.ts +6 -0
- package/dist/components/ui/Accordion/AccordionHeader.d.ts.map +1 -0
- package/dist/components/ui/Accordion/AccordionItem.d.ts +11 -0
- package/dist/components/ui/Accordion/AccordionItem.d.ts.map +1 -0
- package/dist/components/ui/ActiveInActive.d.ts +10 -0
- package/dist/components/ui/ActiveInActive.d.ts.map +1 -0
- package/dist/components/ui/AnimatedCounter.d.ts +7 -0
- package/dist/components/ui/AnimatedCounter.d.ts.map +1 -0
- package/dist/components/ui/Badge.d.ts +10 -0
- package/dist/components/ui/Badge.d.ts.map +1 -0
- package/dist/components/ui/BreadCrumbs.d.ts +7 -0
- package/dist/components/ui/BreadCrumbs.d.ts.map +1 -0
- package/dist/components/ui/Button.d.ts +36 -0
- package/dist/components/ui/Button.d.ts.map +1 -0
- package/dist/components/ui/CopyableText.d.ts +5 -0
- package/dist/components/ui/CopyableText.d.ts.map +1 -0
- package/dist/components/ui/DateInput.d.ts +15 -0
- package/dist/components/ui/DateInput.d.ts.map +1 -0
- package/dist/components/ui/DateRangeFilterInput.d.ts +4 -0
- package/dist/components/ui/DateRangeFilterInput.d.ts.map +1 -0
- package/dist/components/ui/DetailHeader.d.ts +6 -0
- package/dist/components/ui/DetailHeader.d.ts.map +1 -0
- package/dist/components/ui/DraggableIcon.d.ts +3 -0
- package/dist/components/ui/DraggableIcon.d.ts.map +1 -0
- package/dist/components/ui/ErrorBoundary.d.ts +18 -0
- package/dist/components/ui/ErrorBoundary.d.ts.map +1 -0
- package/dist/components/ui/ErrorFallback.d.ts +6 -0
- package/dist/components/ui/ErrorFallback.d.ts.map +1 -0
- package/dist/components/ui/HelpText.d.ts +11 -0
- package/dist/components/ui/HelpText.d.ts.map +1 -0
- package/dist/components/ui/ImageWithFallback.d.ts +7 -0
- package/dist/components/ui/ImageWithFallback.d.ts.map +1 -0
- package/dist/components/ui/InfoTextBanner.d.ts +6 -0
- package/dist/components/ui/InfoTextBanner.d.ts.map +1 -0
- package/dist/components/ui/JSONView.d.ts +6 -0
- package/dist/components/ui/JSONView.d.ts.map +1 -0
- package/dist/components/ui/ListHeader.d.ts +6 -0
- package/dist/components/ui/ListHeader.d.ts.map +1 -0
- package/dist/components/ui/Loading.d.ts +10 -0
- package/dist/components/ui/Loading.d.ts.map +1 -0
- package/dist/components/ui/NoData.d.ts +7 -0
- package/dist/components/ui/NoData.d.ts.map +1 -0
- package/dist/components/ui/NoImage.d.ts +7 -0
- package/dist/components/ui/NoImage.d.ts.map +1 -0
- package/dist/components/ui/NoImageSvg.d.ts +8 -0
- package/dist/components/ui/NoImageSvg.d.ts.map +1 -0
- package/dist/components/ui/PageHeader.d.ts +11 -0
- package/dist/components/ui/PageHeader.d.ts.map +1 -0
- package/dist/components/ui/Pagination.d.ts +8 -0
- package/dist/components/ui/Pagination.d.ts.map +1 -0
- package/dist/components/ui/Portal/Portal.d.ts +16 -0
- package/dist/components/ui/Portal/Portal.d.ts.map +1 -0
- package/dist/components/ui/Portal/Portal.types.d.ts +16 -0
- package/dist/components/ui/Portal/Portal.types.d.ts.map +1 -0
- package/dist/components/ui/SaveAndCancelButtons.d.ts +10 -0
- package/dist/components/ui/SaveAndCancelButtons.d.ts.map +1 -0
- package/dist/components/ui/SearchField.d.ts +7 -0
- package/dist/components/ui/SearchField.d.ts.map +1 -0
- package/dist/components/ui/Tab.d.ts +18 -0
- package/dist/components/ui/Tab.d.ts.map +1 -0
- package/dist/components/ui/Tag/TagInput.d.ts +19 -0
- package/dist/components/ui/Tag/TagInput.d.ts.map +1 -0
- package/dist/components/ui/Tag/TagList.d.ts +8 -0
- package/dist/components/ui/Tag/TagList.d.ts.map +1 -0
- package/dist/components/ui/Tag/TagListForm.d.ts +8 -0
- package/dist/components/ui/Tag/TagListForm.d.ts.map +1 -0
- package/dist/components/ui/Toggle.d.ts +11 -0
- package/dist/components/ui/Toggle.d.ts.map +1 -0
- package/dist/components/ui/ToolTip.d.ts +7 -0
- package/dist/components/ui/ToolTip.d.ts.map +1 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/chart.d.ts +42 -0
- package/dist/components/ui/chart.d.ts.map +1 -0
- package/dist/components/ui/form/CheckboxField.d.ts +4 -0
- package/dist/components/ui/form/CheckboxField.d.ts.map +1 -0
- package/dist/components/ui/form/ChoicesField.d.ts +12 -0
- package/dist/components/ui/form/ChoicesField.d.ts.map +1 -0
- package/dist/components/ui/form/Combobox.d.ts +20 -0
- package/dist/components/ui/form/Combobox.d.ts.map +1 -0
- package/dist/components/ui/form/DatePickerField.d.ts +4 -0
- package/dist/components/ui/form/DatePickerField.d.ts.map +1 -0
- package/dist/components/ui/form/EmailField.d.ts +7 -0
- package/dist/components/ui/form/EmailField.d.ts.map +1 -0
- package/dist/components/ui/form/FieldWithHelp.d.ts +10 -0
- package/dist/components/ui/form/FieldWithHelp.d.ts.map +1 -0
- package/dist/components/ui/form/FieldWrapper.d.ts +8 -0
- package/dist/components/ui/form/FieldWrapper.d.ts.map +1 -0
- package/dist/components/ui/form/FormErrors.d.ts +6 -0
- package/dist/components/ui/form/FormErrors.d.ts.map +1 -0
- package/dist/components/ui/form/JSONAreaField.d.ts +7 -0
- package/dist/components/ui/form/JSONAreaField.d.ts.map +1 -0
- package/dist/components/ui/form/MarkdownTextAreaField.d.ts +8 -0
- package/dist/components/ui/form/MarkdownTextAreaField.d.ts.map +1 -0
- package/dist/components/ui/form/PasswordField.d.ts +3 -0
- package/dist/components/ui/form/PasswordField.d.ts.map +1 -0
- package/dist/components/ui/form/SelectField.d.ts +11 -0
- package/dist/components/ui/form/SelectField.d.ts.map +1 -0
- package/dist/components/ui/form/SubmitButton.d.ts +9 -0
- package/dist/components/ui/form/SubmitButton.d.ts.map +1 -0
- package/dist/components/ui/form/TagInputField.d.ts +7 -0
- package/dist/components/ui/form/TagInputField.d.ts.map +1 -0
- package/dist/components/ui/form/TextAreaField.d.ts +8 -0
- package/dist/components/ui/form/TextAreaField.d.ts.map +1 -0
- package/dist/components/ui/form/TextField.d.ts +10 -0
- package/dist/components/ui/form/TextField.d.ts.map +1 -0
- package/dist/components/ui/form/index.d.ts +18 -0
- package/dist/components/ui/form/index.d.ts.map +1 -0
- package/dist/components/ui/icons.d.ts +4 -0
- package/dist/components/ui/icons.d.ts.map +1 -0
- package/dist/components/ui/index.d.ts +47 -0
- package/dist/components/ui/index.d.ts.map +1 -0
- package/dist/form.js +3128 -0
- package/dist/gql/operation-types.d.ts +13239 -0
- package/dist/gql/operation-types.d.ts.map +1 -0
- package/dist/gql/schema-types.d.ts +3876 -0
- package/dist/gql/schema-types.d.ts.map +1 -0
- package/dist/gql/types.d.ts +3 -0
- package/dist/gql/types.d.ts.map +1 -0
- package/dist/hooks.js +49 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/modal.js +51 -0
- package/dist/modules/Auth/AuthContext.d.ts +9 -0
- package/dist/modules/Auth/AuthContext.d.ts.map +1 -0
- package/dist/modules/Auth/useAuth.d.ts +6 -0
- package/dist/modules/Auth/useAuth.d.ts.map +1 -0
- package/dist/modules/UnchainedContext/UnchainedContext.d.ts +8 -0
- package/dist/modules/UnchainedContext/UnchainedContext.d.ts.map +1 -0
- package/dist/modules/UnchainedContext/useUnchainedContext.d.ts +7 -0
- package/dist/modules/UnchainedContext/useUnchainedContext.d.ts.map +1 -0
- package/dist/modules/accounts/fragment/MD5MetaDataFragment.d.ts +3 -0
- package/dist/modules/accounts/fragment/MD5MetaDataFragment.d.ts.map +1 -0
- package/dist/modules/accounts/fragment/UserFragment.d.ts +3 -0
- package/dist/modules/accounts/fragment/UserFragment.d.ts.map +1 -0
- package/dist/modules/accounts/hooks/useCurrentUser.d.ts +10 -0
- package/dist/modules/accounts/hooks/useCurrentUser.d.ts.map +1 -0
- package/dist/modules/accounts/hooks/useUsersCount.d.ts +8 -0
- package/dist/modules/accounts/hooks/useUsersCount.d.ts.map +1 -0
- package/dist/modules/accounts.js +1349 -0
- package/dist/modules/assortment/hooks/useAssortmentsCount.d.ts +8 -0
- package/dist/modules/assortment/hooks/useAssortmentsCount.d.ts.map +1 -0
- package/dist/modules/assortment.js +1205 -0
- package/dist/modules/common/components/AppContext.d.ts +18 -0
- package/dist/modules/common/components/AppContext.d.ts.map +1 -0
- package/dist/modules/common/components/FormWrapper.d.ts +8 -0
- package/dist/modules/common/components/FormWrapper.d.ts.map +1 -0
- package/dist/modules/common/components/LocaleWrapper.d.ts +7 -0
- package/dist/modules/common/components/LocaleWrapper.d.ts.map +1 -0
- package/dist/modules/common/components/MediaAvatar.d.ts +6 -0
- package/dist/modules/common/components/MediaAvatar.d.ts.map +1 -0
- package/dist/modules/common/components/SelectOptions.d.ts +17 -0
- package/dist/modules/common/components/SelectOptions.d.ts.map +1 -0
- package/dist/modules/common/components/Table.d.ts +25 -0
- package/dist/modules/common/components/Table.d.ts.map +1 -0
- package/dist/modules/common/components/TableCell.d.ts +12 -0
- package/dist/modules/common/components/TableCell.d.ts.map +1 -0
- package/dist/modules/common/components/TableRow.d.ts +10 -0
- package/dist/modules/common/components/TableRow.d.ts.map +1 -0
- package/dist/modules/common/components/ThemeWrapper.d.ts +10 -0
- package/dist/modules/common/components/ThemeWrapper.d.ts.map +1 -0
- package/dist/modules/common/data/iso-codes.d.ts +4 -0
- package/dist/modules/common/data/iso-codes.d.ts.map +1 -0
- package/dist/modules/common/data/miscellaneous.d.ts +52 -0
- package/dist/modules/common/data/miscellaneous.d.ts.map +1 -0
- package/dist/modules/common/fragments/AddressFragment.d.ts +3 -0
- package/dist/modules/common/fragments/AddressFragment.d.ts.map +1 -0
- package/dist/modules/common/hooks/useApp.d.ts +11 -0
- package/dist/modules/common/hooks/useApp.d.ts.map +1 -0
- package/dist/modules/common/hooks/useBulkResultHandler.d.ts +8 -0
- package/dist/modules/common/hooks/useBulkResultHandler.d.ts.map +1 -0
- package/dist/modules/common/hooks/useBulkSelection.d.ts +12 -0
- package/dist/modules/common/hooks/useBulkSelection.d.ts.map +1 -0
- package/dist/modules/common/hooks/useCSVExport.d.ts +10 -0
- package/dist/modules/common/hooks/useCSVExport.d.ts.map +1 -0
- package/dist/modules/common/hooks/useCSVImport.d.ts +18 -0
- package/dist/modules/common/hooks/useCSVImport.d.ts.map +1 -0
- package/dist/modules/common/hooks/useChatEndpointChecker.d.ts +5 -0
- package/dist/modules/common/hooks/useChatEndpointChecker.d.ts.map +1 -0
- package/dist/modules/common/hooks/useConfirmMediaUpload.d.ts +10 -0
- package/dist/modules/common/hooks/useConfirmMediaUpload.d.ts.map +1 -0
- package/dist/modules/common/hooks/useDashboardMetrics.d.ts +23 -0
- package/dist/modules/common/hooks/useDashboardMetrics.d.ts.map +1 -0
- package/dist/modules/common/hooks/useLocalStorage.d.ts +3 -0
- package/dist/modules/common/hooks/useLocalStorage.d.ts.map +1 -0
- package/dist/modules/common/hooks/useOrderAnalytics.d.ts +25 -0
- package/dist/modules/common/hooks/useOrderAnalytics.d.ts.map +1 -0
- package/dist/modules/common/hooks/useOrderItemsAnalytics.d.ts +16 -0
- package/dist/modules/common/hooks/useOrderItemsAnalytics.d.ts.map +1 -0
- package/dist/modules/common/hooks/useOutsideClick.d.ts +3 -0
- package/dist/modules/common/hooks/useOutsideClick.d.ts.map +1 -0
- package/dist/modules/common/hooks/usePortal.d.ts +20 -0
- package/dist/modules/common/hooks/usePortal.d.ts.map +1 -0
- package/dist/modules/common/hooks/useScrollRestoration.d.ts +8 -0
- package/dist/modules/common/hooks/useScrollRestoration.d.ts.map +1 -0
- package/dist/modules/common/hooks/useShopConfiguration.d.ts +8 -0
- package/dist/modules/common/hooks/useShopConfiguration.d.ts.map +1 -0
- package/dist/modules/common/hooks/useShopInfo.d.ts +41 -0
- package/dist/modules/common/hooks/useShopInfo.d.ts.map +1 -0
- package/dist/modules/common/hooks/useStatusTypes.d.ts +10 -0
- package/dist/modules/common/hooks/useStatusTypes.d.ts.map +1 -0
- package/dist/modules/common/hooks/useSystemRoles.d.ts +7 -0
- package/dist/modules/common/hooks/useSystemRoles.d.ts.map +1 -0
- package/dist/modules/common/hooks/useTheme.d.ts +7 -0
- package/dist/modules/common/hooks/useTheme.d.ts.map +1 -0
- package/dist/modules/common/utils/deBounce.d.ts +3 -0
- package/dist/modules/common/utils/deBounce.d.ts.map +1 -0
- package/dist/modules/common/utils/defaultNextImageLoader.d.ts +7 -0
- package/dist/modules/common/utils/defaultNextImageLoader.d.ts.map +1 -0
- package/dist/modules/common/utils/formatUsername.d.ts +3 -0
- package/dist/modules/common/utils/formatUsername.d.ts.map +1 -0
- package/dist/modules/common/utils/getSetupStepsConfigurationsMeta.d.ts +30 -0
- package/dist/modules/common/utils/getSetupStepsConfigurationsMeta.d.ts.map +1 -0
- package/dist/modules/common/utils/normalizeFilterKeys.d.ts +4 -0
- package/dist/modules/common/utils/normalizeFilterKeys.d.ts.map +1 -0
- package/dist/modules/common/utils/sharedContext.d.ts +9 -0
- package/dist/modules/common/utils/sharedContext.d.ts.map +1 -0
- package/dist/modules/common/utils/useFormatDateTime.d.ts +16 -0
- package/dist/modules/common/utils/useFormatDateTime.d.ts.map +1 -0
- package/dist/modules/common/utils/utils.d.ts +21 -0
- package/dist/modules/common/utils/utils.d.ts.map +1 -0
- package/dist/modules/country/fragments/CountryFragment.d.ts +3 -0
- package/dist/modules/country/fragments/CountryFragment.d.ts.map +1 -0
- package/dist/modules/country/hooks/useCountries.d.ts +22 -0
- package/dist/modules/country/hooks/useCountries.d.ts.map +1 -0
- package/dist/modules/country.js +108 -0
- package/dist/modules/currency.js +119 -0
- package/dist/modules/delivery-provider.js +269 -0
- package/dist/modules/enrollment.js +431 -0
- package/dist/modules/event.js +123 -0
- package/dist/modules/filter.js +497 -0
- package/dist/modules/forms/components/Form.d.ts +8 -0
- package/dist/modules/forms/components/Form.d.ts.map +1 -0
- package/dist/modules/forms/hooks/useField.d.ts +35 -0
- package/dist/modules/forms/hooks/useField.d.ts.map +1 -0
- package/dist/modules/forms/hooks/useForm.d.ts +44 -0
- package/dist/modules/forms/hooks/useForm.d.ts.map +1 -0
- package/dist/modules/forms/hooks/useFormContext.d.ts +3 -0
- package/dist/modules/forms/hooks/useFormContext.d.ts.map +1 -0
- package/dist/modules/forms/lib/FormContext.d.ts +13 -0
- package/dist/modules/forms/lib/FormContext.d.ts.map +1 -0
- package/dist/modules/forms/lib/clean.d.ts +3 -0
- package/dist/modules/forms/lib/clean.d.ts.map +1 -0
- package/dist/modules/forms/lib/validators.d.ts +20 -0
- package/dist/modules/forms/lib/validators.d.ts.map +1 -0
- package/dist/modules/language/fragments/LanguageFragment.d.ts +3 -0
- package/dist/modules/language/fragments/LanguageFragment.d.ts.map +1 -0
- package/dist/modules/language/hooks/useLanguages.d.ts +19 -0
- package/dist/modules/language/hooks/useLanguages.d.ts.map +1 -0
- package/dist/modules/language.js +106 -0
- package/dist/modules/modal/components/AlertMessage.d.ts +9 -0
- package/dist/modules/modal/components/AlertMessage.d.ts.map +1 -0
- package/dist/modules/modal/components/DangerMessage.d.ts +13 -0
- package/dist/modules/modal/components/DangerMessage.d.ts.map +1 -0
- package/dist/modules/modal/components/ImportResultMessage.d.ts +14 -0
- package/dist/modules/modal/components/ImportResultMessage.d.ts.map +1 -0
- package/dist/modules/modal/components/Modal.d.ts +10 -0
- package/dist/modules/modal/components/Modal.d.ts.map +1 -0
- package/dist/modules/modal/components/ModalWrapper.d.ts +6 -0
- package/dist/modules/modal/components/ModalWrapper.d.ts.map +1 -0
- package/dist/modules/modal/hooks/useModal.d.ts +7 -0
- package/dist/modules/modal/hooks/useModal.d.ts.map +1 -0
- package/dist/modules/modal/utils/ModalContext.d.ts +9 -0
- package/dist/modules/modal/utils/ModalContext.d.ts.map +1 -0
- package/dist/modules/order/fragments/OrderDetailFragment.d.ts +3 -0
- package/dist/modules/order/fragments/OrderDetailFragment.d.ts.map +1 -0
- package/dist/modules/order/fragments/OrderFragment.d.ts +3 -0
- package/dist/modules/order/fragments/OrderFragment.d.ts.map +1 -0
- package/dist/modules/order/hooks/useOrders.d.ts +46 -0
- package/dist/modules/order/hooks/useOrders.d.ts.map +1 -0
- package/dist/modules/order.js +569 -0
- package/dist/modules/payment-providers.js +206 -0
- package/dist/modules/product/hooks/useProductsCount.d.ts +8 -0
- package/dist/modules/product/hooks/useProductsCount.d.ts.map +1 -0
- package/dist/modules/product-review.js +270 -0
- package/dist/modules/product.js +6914 -0
- package/dist/modules/quotation.js +324 -0
- package/dist/modules/token.js +143 -0
- package/dist/modules/warehousing-providers.js +206 -0
- package/dist/modules/work/fragments/WorkFragment.d.ts +3 -0
- package/dist/modules/work/fragments/WorkFragment.d.ts.map +1 -0
- package/dist/modules/work/hooks/useAddWork.d.ts +6 -0
- package/dist/modules/work/hooks/useAddWork.d.ts.map +1 -0
- package/dist/modules/work/hooks/useWork.d.ts +32 -0
- package/dist/modules/work/hooks/useWork.d.ts.map +1 -0
- package/dist/modules/work.js +232 -0
- package/dist/plugins.js +13 -0
- package/dist/providers.js +9 -0
- package/dist/sdk/hooks.d.ts +12 -0
- package/dist/sdk/hooks.d.ts.map +1 -0
- package/dist/sdk/modal.d.ts +7 -0
- package/dist/sdk/modal.d.ts.map +1 -0
- package/dist/sdk/plugins.d.ts +78 -0
- package/dist/sdk/plugins.d.ts.map +1 -0
- package/dist/sdk/providers.d.ts +5 -0
- package/dist/sdk/providers.d.ts.map +1 -0
- package/dist/sdk/shims/admin-ui-plugins.d.ts +3 -0
- package/dist/sdk/shims/admin-ui-plugins.d.ts.map +1 -0
- package/dist/sdk/shims/apollo-client-react.d.ts +3 -0
- package/dist/sdk/shims/apollo-client-react.d.ts.map +1 -0
- package/dist/sdk/shims/apollo-client.d.ts +3 -0
- package/dist/sdk/shims/apollo-client.d.ts.map +1 -0
- package/dist/sdk/shims/host.d.ts +17 -0
- package/dist/sdk/shims/host.d.ts.map +1 -0
- package/dist/sdk/shims/next-head.d.ts +3 -0
- package/dist/sdk/shims/next-head.d.ts.map +1 -0
- package/dist/sdk/shims/next-image.d.ts +3 -0
- package/dist/sdk/shims/next-image.d.ts.map +1 -0
- package/dist/sdk/shims/next-link.d.ts +3 -0
- package/dist/sdk/shims/next-link.d.ts.map +1 -0
- package/dist/sdk/shims/next-router.d.ts +3 -0
- package/dist/sdk/shims/next-router.d.ts.map +1 -0
- package/dist/sdk/shims/react-dom-client.d.ts +3 -0
- package/dist/sdk/shims/react-dom-client.d.ts.map +1 -0
- package/dist/sdk/shims/react-dom.d.ts +3 -0
- package/dist/sdk/shims/react-dom.d.ts.map +1 -0
- package/dist/sdk/shims/react-hook-form.d.ts +3 -0
- package/dist/sdk/shims/react-hook-form.d.ts.map +1 -0
- package/dist/sdk/shims/react-intl.d.ts +3 -0
- package/dist/sdk/shims/react-intl.d.ts.map +1 -0
- package/dist/sdk/shims/react-jsx-runtime.d.ts +3 -0
- package/dist/sdk/shims/react-jsx-runtime.d.ts.map +1 -0
- package/dist/sdk/shims/react-toastify.d.ts +3 -0
- package/dist/sdk/shims/react-toastify.d.ts.map +1 -0
- package/dist/sdk/shims/react.d.ts +3 -0
- package/dist/sdk/shims/react.d.ts.map +1 -0
- package/dist/sdk/theme.d.ts +26 -0
- package/dist/sdk/theme.d.ts.map +1 -0
- package/dist/shims/admin-ui-plugins.js +9 -0
- package/dist/shims/apollo-client-react.js +25 -0
- package/dist/shims/apollo-client.js +55 -0
- package/dist/shims/next-head.js +9 -0
- package/dist/shims/next-image.js +9 -0
- package/dist/shims/next-link.js +9 -0
- package/dist/shims/next-router.js +13 -0
- package/dist/shims/react-dom-client.js +11 -0
- package/dist/shims/react-dom.js +22 -0
- package/dist/shims/react-hook-form.js +25 -0
- package/dist/shims/react-intl.js +37 -0
- package/dist/shims/react-jsx-runtime.js +11 -0
- package/dist/shims/react-toastify.js +16 -0
- package/dist/shims/react.js +52 -0
- package/dist/theme.js +34 -0
- package/dist/ui.js +20247 -0
- 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/DUswS2PYjGTW9uUGVJ6xd/_buildManifest.js +258 -0
- package/out/_next/static/chunks/0-e21p2v90828.js +23 -0
- package/out/_next/static/chunks/0-w25xfpw-_e9.js +44 -0
- package/out/_next/static/chunks/011h6mc3kuxq9.js +217 -0
- package/out/_next/static/chunks/01n5rd9ngv-t4.js +1 -0
- package/out/_next/static/chunks/01rghd4wcj4ex.js +5 -0
- package/out/_next/static/chunks/03omde6jo6sta.js +1 -0
- package/out/_next/static/chunks/06gyzyq56kw_2.js +6 -0
- package/out/_next/static/chunks/{2ajr0rk0_yax6.js → 06kqbwwnuu3te.js} +1 -1
- package/out/_next/static/chunks/07i53w2a3x0so.js +1 -0
- package/out/_next/static/chunks/09irjy-7k1922.js +1 -0
- package/out/_next/static/chunks/09kihj6ay6mqn.js +39 -0
- package/out/_next/static/chunks/09ml8g7-byzio.js +71 -0
- package/out/_next/static/chunks/09yk8jmltcqcd.js +5 -0
- package/out/_next/static/chunks/0_m0oaoy22un6.js +5 -0
- package/out/_next/static/chunks/0af-w950yl0l5.js +277 -0
- package/out/_next/static/chunks/0ah2m5cl87avs.js +935 -0
- package/out/_next/static/chunks/0ahfhl4hk0fuj.js +12 -0
- package/out/_next/static/chunks/0b4rcc2y1ex8j.js +12 -0
- package/out/_next/static/chunks/0buyef0vid-ym.js +224 -0
- package/out/_next/static/chunks/0czpir4zjwmos.js +1 -0
- package/out/_next/static/chunks/0duy5y86n4tl3.js +5 -0
- package/out/_next/static/chunks/0dzn-wes7gjdt.js +33 -0
- package/out/_next/static/chunks/{2rmgaa88-4bpb.js → 0e4nzgbtw6x_d.js} +4 -4
- package/out/_next/static/chunks/0eb98o1s1ojq7.js +5 -0
- package/out/_next/static/chunks/0gow2wyosbjb6.js +71 -0
- package/out/_next/static/chunks/0h4ehpg2f7fp2.js +46 -0
- package/out/_next/static/chunks/0hgha-mywwcsd.js +8 -0
- package/out/_next/static/chunks/0iliy1guwadr4.js +7 -0
- package/out/_next/static/chunks/0l0hzoqd-va5-.js +1 -0
- package/out/_next/static/chunks/0l1xycyhdztmy.js +46 -0
- package/out/_next/static/chunks/0lh8xbz1qulcr.js +15 -0
- package/out/_next/static/chunks/0mavm6oemhb-d.js +152 -0
- package/out/_next/static/chunks/0nk0kgnsiap5g.js +116 -0
- package/out/_next/static/chunks/0o3o1f00j5wxa.js +8 -0
- package/out/_next/static/chunks/0pny1c_ni8rn7.js +39 -0
- package/out/_next/static/chunks/0q62hlhpcumrt.js +33 -0
- package/out/_next/static/chunks/0qkdih-hi6c2m.js +15 -0
- package/out/_next/static/chunks/0qz61g2g6ijfh.js +54 -0
- package/out/_next/static/chunks/0raj1enjck-ex.js +4 -0
- package/out/_next/static/chunks/0rmomvc8u__n4.js +10 -0
- package/out/_next/static/chunks/0s0ufx1fl32v7.js +12 -0
- package/out/_next/static/chunks/0sgxa66r-iing.js +1 -0
- package/out/_next/static/chunks/0sv5w2_cae8tj.js +7 -0
- package/out/_next/static/chunks/0u_zr87ce7iu-.js +1 -0
- package/out/_next/static/chunks/0ub1l2hrjkz2-.js +1 -0
- package/out/_next/static/chunks/0uef4ugmc_g10.js +1 -0
- package/out/_next/static/chunks/0uksleo_xd7j5.js +1 -0
- package/out/_next/static/chunks/0wbciytf8tnsa.js +18 -0
- package/out/_next/static/chunks/0wd1l2f5cin-0.js +4 -0
- package/out/_next/static/chunks/0zfm51umxvjc6.js +1 -0
- package/out/_next/static/chunks/10enect1zh1vj.js +3 -0
- package/out/_next/static/chunks/11e6h7l-whxh3.js +7 -0
- package/out/_next/static/chunks/11vnr4kb9qkjr.js +1 -0
- package/out/_next/static/chunks/13bcbgywansr-.js +130 -0
- package/out/_next/static/chunks/13ytpmhxkpnwy.js +1 -0
- package/out/_next/static/chunks/14pnkf7som1m1.js +1 -0
- package/out/_next/static/chunks/17nr-ur3sbo_z.js +24 -0
- package/out/_next/static/chunks/1802-tohqffps.js +1 -0
- package/out/_next/static/chunks/181-yaruteuqm.js +61 -0
- package/out/_next/static/chunks/181zsbok_ljo_.js +4 -0
- package/out/_next/static/chunks/187p6ryym-x3i.js +5 -0
- package/out/_next/static/chunks/198-_r3as1j63.js +8 -0
- package/out/_next/static/chunks/19f7gu0kvm7xl.js +7 -0
- package/out/_next/static/chunks/19kin-dby998k.js +8 -0
- package/out/_next/static/chunks/1aojv48cs6ufj.js +6 -0
- package/out/_next/static/chunks/1cs-w7vppvm8o.js +1 -0
- package/out/_next/static/chunks/1cz2fp89ssu5d.js +4 -0
- package/out/_next/static/chunks/1dedrypk-h8qr.js +1 -0
- package/out/_next/static/chunks/1edk56b1rx05q.js +4 -0
- package/out/_next/static/chunks/1ew4i-mm087xs.js +4 -0
- package/out/_next/static/chunks/1ewn0p_wru2ra.js +15 -0
- package/out/_next/static/chunks/1g1na7eoafolj.js +1 -0
- package/out/_next/static/chunks/1gfocmey44pyr.js +7 -0
- package/out/_next/static/chunks/1grwyry6zqknr.js +100 -0
- package/out/_next/static/chunks/1gyt_0aw92ysk.js +5 -0
- package/out/_next/static/chunks/1hvvot0p0442h.js +5 -0
- package/out/_next/static/chunks/1inbspyz1wpdj.js +1 -0
- package/out/_next/static/chunks/1l2p87t0w4-yb.js +8 -0
- package/out/_next/static/chunks/1lew6f82bg1x1.js +1 -0
- package/out/_next/static/chunks/1nbc2o30_g9bj.js +95 -0
- package/out/_next/static/chunks/1nikeez809jr8.js +2 -0
- package/out/_next/static/chunks/1p1f35qy1lt0s.js +7 -0
- package/out/_next/static/chunks/1p3agrt0e0t9t.js +5 -0
- package/out/_next/static/chunks/1p6qsnui0zjik.js +44 -0
- package/out/_next/static/chunks/1pbfjibxvspoj.js +5 -0
- package/out/_next/static/chunks/1pcrg5m_9agof.js +5 -0
- package/out/_next/static/chunks/1rm2w7nvmejdw.js +31 -0
- package/out/_next/static/chunks/{1---h4b693b81.js → 1t5wlk2j9d4ss.js} +1 -1
- package/out/_next/static/chunks/{12yd8t4k6c0t1.js → 1t8jj0-6g8uyd.js} +1 -1
- package/out/_next/static/chunks/1ttpypjue-zdo.js +63 -0
- package/out/_next/static/chunks/1uzvaujlk79rn.js +145 -0
- package/out/_next/static/chunks/1xnlhfvi8m4a8.js +1 -0
- package/out/_next/static/chunks/1y0mbad52vao6.js +5 -0
- package/out/_next/static/chunks/1zfhgsywbsg2e.js +5 -0
- package/out/_next/static/chunks/1zhfbuv-et-34.js +13 -0
- package/out/_next/static/chunks/2-2kg667v82ek.js +171 -0
- package/out/_next/static/chunks/21z3-xqp62vs8.js +7 -0
- package/out/_next/static/chunks/22odam86c8kps.js +1 -0
- package/out/_next/static/chunks/23wfelj92rx3n.js +1 -0
- package/out/_next/static/chunks/243ubs_ig9hwo.js +13 -0
- package/out/_next/static/chunks/249u7sg_mycfl.js +24 -0
- package/out/_next/static/chunks/24_57hr3o_ll8.js +1 -0
- package/out/_next/static/chunks/252_8-fyz3vjh.js +9 -0
- package/out/_next/static/chunks/25_kx8fsd5k0d.js +5 -0
- package/out/_next/static/chunks/26wuxv_gsk3jb.js +30 -0
- package/out/_next/static/chunks/26x7o2gzms54c.js +6 -0
- package/out/_next/static/chunks/27h86ht8kvqop.js +267 -0
- package/out/_next/static/chunks/27tf612b6s-45.js +7 -0
- package/out/_next/static/chunks/{3qzrrjb48t2w3.js → 2893194r7ays6.js} +5 -5
- package/out/_next/static/chunks/294uscwjocbpf.js +5 -0
- package/out/_next/static/chunks/29c8fj1poxxec.js +39 -0
- package/out/_next/static/chunks/{439tz_ubj8h-g.js → 29fdom9djvjop.js} +9 -9
- package/out/_next/static/chunks/2__om5ddn5b91.js +7 -0
- package/out/_next/static/chunks/2_krlw-01uumq.js +119 -0
- package/out/_next/static/chunks/2a1m9ia2zp2t9.js +6 -0
- package/out/_next/static/chunks/2c2arjke9rx-g.js +14 -0
- package/out/_next/static/chunks/2de99go2pdzl3.js +12 -0
- package/out/_next/static/chunks/2dnn7jhe55iy8.js +32 -0
- package/out/_next/static/chunks/2eac98hmhj8tp.js +5 -0
- package/out/_next/static/chunks/2fxjo2s_nsjsa.js +5 -0
- package/out/_next/static/chunks/2h_j6q1pnhf07.js +16 -0
- package/out/_next/static/chunks/2hthxhwh84ls1.css +1 -0
- package/out/_next/static/chunks/2i07f6t3xq708.js +5 -0
- package/out/_next/static/chunks/2i6nzzm63658q.js +10 -0
- package/out/_next/static/chunks/2ksch2zc9k7uj.js +71 -0
- package/out/_next/static/chunks/{1gqd9vrno0rq4.js → 2lh-lsn2en0pp.js} +2 -2
- package/out/_next/static/chunks/2luj-95aqr25b.js +1 -0
- package/out/_next/static/chunks/2m_p_bx_gsrlf.js +5 -0
- package/out/_next/static/chunks/2of_ro6r-fwjx.js +16 -0
- package/out/_next/static/chunks/2oyujmi3aqs6f.js +5 -0
- package/out/_next/static/chunks/2pumckmhpvlo2.js +23 -0
- package/out/_next/static/chunks/2r4x7nghsoqhe.js +7 -0
- package/out/_next/static/chunks/2s-226q_lc70k.js +9 -0
- package/out/_next/static/chunks/2sc_zg0bvlmak.js +78 -0
- package/out/_next/static/chunks/2tlxpweh5c3fh.js +43 -0
- package/out/_next/static/chunks/{1_55km6vm5mc0.js → 2w_0wk23uirx6.js} +7 -7
- package/out/_next/static/chunks/2wg_0x11ef6uc.js +7 -0
- package/out/_next/static/chunks/2zx42lz8zcp91.js +6 -0
- package/out/_next/static/chunks/3-l_ott2smmqm.js +7 -0
- package/out/_next/static/chunks/30lpu8mp25ag1.js +41 -0
- package/out/_next/static/chunks/3168hp9w1h68h.js +68 -0
- package/out/_next/static/chunks/3180oblgqnad5.js +194 -0
- package/out/_next/static/chunks/32traobkc55z_.js +54 -0
- package/out/_next/static/chunks/33s24dpx0eo63.js +2 -0
- package/out/_next/static/chunks/{153ec1_-yt3jb.js → 343n05fzlb2an.js} +5 -5
- package/out/_next/static/chunks/35odkwyh-md-p.js +59 -0
- package/out/_next/static/chunks/35tgy8og7dw73.js +149 -0
- package/out/_next/static/chunks/36mjt8cgckx2r.js +1 -0
- package/out/_next/static/chunks/37j2g662wreov.js +108 -0
- package/out/_next/static/chunks/37vezmh4pf5j4.js +12 -0
- package/out/_next/static/chunks/37y01hdz8sxhr.js +1 -0
- package/out/_next/static/chunks/38uyt89jy0tt7.js +1 -0
- package/out/_next/static/chunks/39-pv-7i0kah_.js +155 -0
- package/out/_next/static/chunks/3__spmlu2_ez6.js +41 -0
- package/out/_next/static/chunks/3_zgl8ng3nj3g.js +9 -0
- package/out/_next/static/chunks/3a6ahlxxtjn1v.js +8 -0
- package/out/_next/static/chunks/{1tkvi0wb-x3v8.js → 3ae7hwg50q67p.js} +2 -2
- package/out/_next/static/chunks/3btzusax1chra.js +36 -0
- package/out/_next/static/chunks/3ciuktttw5i71.js +277 -0
- package/out/_next/static/chunks/{2ho4591ngh3y2.js → 3d0cucf7-qlz9.js} +6 -6
- package/out/_next/static/chunks/3d2mjl6ls12h_.js +5 -0
- package/out/_next/static/chunks/3dxz87hw4lx39.js +1 -0
- package/out/_next/static/chunks/3f2rrfc7u_j6o.js +1 -0
- package/out/_next/static/chunks/3fvf-l1-bp--9.js +5 -0
- package/out/_next/static/chunks/3hubf9lb56zls.js +7 -0
- package/out/_next/static/chunks/3hxp-xwv4g3ek.js +1 -0
- package/out/_next/static/chunks/3ljqspad_536i.js +4 -0
- package/out/_next/static/chunks/3mnca5jc1q8c_.js +43 -0
- package/out/_next/static/chunks/{0q2e8h8498pvo.js → 3qqhr2o1soxh_.js} +1 -1
- package/out/_next/static/chunks/3skw31vkshyt2.js +1 -0
- package/out/_next/static/chunks/3szdkqecej3fb.js +1 -0
- package/out/_next/static/chunks/3t-6admtmkzzy.js +39 -0
- package/out/_next/static/chunks/3t1q9dc-nlr3j.js +1 -0
- package/out/_next/static/chunks/3u6_-nj6i_l_r.js +1 -0
- package/out/_next/static/chunks/3uekb_s0jaboj.js +1 -0
- package/out/_next/static/chunks/3uql2yuaknc-3.js +1 -0
- package/out/_next/static/chunks/3vf-3rhaiq_n1.js +6 -0
- package/out/_next/static/chunks/3xtawjchyn0qb.js +1 -0
- package/out/_next/static/chunks/3xze13c1irm_5.js +1 -0
- package/out/_next/static/chunks/3ylglplnmhho2.js +5 -0
- package/out/_next/static/chunks/3ym4exwo-py5d.js +23 -0
- package/out/_next/static/chunks/3yre4w19nehxf.js +1 -0
- package/out/_next/static/chunks/3z51ql4pljujr.js +81 -0
- package/out/_next/static/chunks/3zhcq27e8jjni.js +28 -0
- package/out/_next/static/chunks/40fs5lh83_iox.js +1 -0
- package/out/_next/static/chunks/40kvqov4hgd5s.js +31 -0
- package/out/_next/static/chunks/40trlm34cnu6v.js +108 -0
- package/out/_next/static/chunks/43n5979c79f0d.js +1 -0
- package/out/_next/static/chunks/{turbopack-2c3mg3r-05n1w.js → turbopack-077hmtqrhcoji.js} +1 -1
- 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/manifest.json +48 -0
- 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 +2 -2
- package/out/_next/static/chunks/0-_s79k4_7ei_.js +0 -5
- package/out/_next/static/chunks/00aks9rqke2x0.js +0 -7
- package/out/_next/static/chunks/00az81dk4vdda.js +0 -54
- package/out/_next/static/chunks/01e4gd649r2tq.js +0 -7
- package/out/_next/static/chunks/01j2wi94k90x0.js +0 -5
- package/out/_next/static/chunks/043i-g05cyvrd.js +0 -1
- package/out/_next/static/chunks/04kyktzbxprj0.js +0 -61
- package/out/_next/static/chunks/05p330iybjojg.js +0 -44
- package/out/_next/static/chunks/05qk8ozexvlxp.js +0 -5
- package/out/_next/static/chunks/06i50j458a7g5.js +0 -12
- package/out/_next/static/chunks/07o9g5hqfpvjc.js +0 -12
- package/out/_next/static/chunks/08o61gwabp3h1.js +0 -33
- package/out/_next/static/chunks/0_bvgo8ev4gs7.js +0 -7
- package/out/_next/static/chunks/0a5nr3-_q7xx1.js +0 -100
- package/out/_next/static/chunks/0amj69l-d5-85.js +0 -1
- package/out/_next/static/chunks/0b05sca2hdcys.js +0 -30
- package/out/_next/static/chunks/0c3kwkqr9evm4.js +0 -5
- package/out/_next/static/chunks/0c4jv8pwvpxei.js +0 -1
- package/out/_next/static/chunks/0c7ljn9lo_0oh.js +0 -5
- package/out/_next/static/chunks/0ewr86ctcw7fx.js +0 -1
- package/out/_next/static/chunks/0jham55cr3rhy.js +0 -81
- package/out/_next/static/chunks/0lr7o7tyjmrmf.js +0 -8
- package/out/_next/static/chunks/0mx8opz23nwlb.js +0 -5
- package/out/_next/static/chunks/0n3ixknyc6_ma.js +0 -1
- package/out/_next/static/chunks/0o0e82-3pc7ur.js +0 -78
- package/out/_next/static/chunks/0ohk7l49gjm62.js +0 -5
- package/out/_next/static/chunks/0p31l6a9hynnt.js +0 -6
- package/out/_next/static/chunks/0qa-zbgmv-k3p.js +0 -9
- package/out/_next/static/chunks/0qj3xdz043z8l.js +0 -12
- package/out/_next/static/chunks/0skst735jufgh.js +0 -71
- package/out/_next/static/chunks/0t28q5fb2jp-6.js +0 -8
- package/out/_next/static/chunks/0tmamaq8exyij.js +0 -1
- package/out/_next/static/chunks/0ydy3ky15gx62.js +0 -1
- package/out/_next/static/chunks/0zh311lu9jf2x.js +0 -5
- package/out/_next/static/chunks/0zpyyygbqx3pf.js +0 -152
- package/out/_next/static/chunks/0zzoylv2rl1xu.js +0 -3
- package/out/_next/static/chunks/10m_etq9t2pkv.js +0 -7
- package/out/_next/static/chunks/11ehf3t7qzbua.js +0 -4
- package/out/_next/static/chunks/11go520d1hcm5.js +0 -1
- package/out/_next/static/chunks/16le3cqxj12u6.js +0 -5
- package/out/_next/static/chunks/16zxfacsu_jbq.js +0 -1
- package/out/_next/static/chunks/17fibl49qtd6c.js +0 -8
- package/out/_next/static/chunks/182l1mlbf0glb.js +0 -1
- package/out/_next/static/chunks/18xyj4i_i5lyn.js +0 -6
- package/out/_next/static/chunks/1aej6iqnlr74p.js +0 -1
- package/out/_next/static/chunks/1asbed4hne69c.js +0 -7
- package/out/_next/static/chunks/1c60nzy_x4kez.js +0 -277
- package/out/_next/static/chunks/1c77vl6xdqfd4.js +0 -15
- package/out/_next/static/chunks/1da89agg-nacc.js +0 -224
- package/out/_next/static/chunks/1f7-0l47bx76m.js +0 -13
- package/out/_next/static/chunks/1fbsyczyh9hwh.js +0 -1
- package/out/_next/static/chunks/1g96s7-fwvokd.js +0 -2
- package/out/_next/static/chunks/1hih2cxmgqcd3.js +0 -10
- package/out/_next/static/chunks/1hviha1jcz_og.js +0 -4
- package/out/_next/static/chunks/1il9vuoxtb2_n.js +0 -43
- package/out/_next/static/chunks/1jaatdt0mlypl.js +0 -16
- package/out/_next/static/chunks/1l4g6_of_bbr8.js +0 -5
- package/out/_next/static/chunks/1lezxecnoaxnn.js +0 -32
- package/out/_next/static/chunks/1m27au_nmk8_k.js +0 -71
- package/out/_next/static/chunks/1m4fwgl1mj4d-.js +0 -46
- package/out/_next/static/chunks/1ma82ip9shpkc.js +0 -24
- package/out/_next/static/chunks/1nbh1zkzirnuw.js +0 -1
- package/out/_next/static/chunks/1nohf8_cc6gmw.js +0 -9
- package/out/_next/static/chunks/1os6pvhjeb16o.js +0 -1
- package/out/_next/static/chunks/1qi5yjvzxspwv.js +0 -15
- package/out/_next/static/chunks/1rsexg6dg82f0.js +0 -7
- package/out/_next/static/chunks/1s9v5dndopkuz.js +0 -12
- package/out/_next/static/chunks/1sksqjru86hlm.js +0 -1
- package/out/_next/static/chunks/1u79pcgqjgjpq.js +0 -1
- package/out/_next/static/chunks/1uqiaqtv_0v2x.js +0 -5
- package/out/_next/static/chunks/1wnuiwsbi70eq.js +0 -116
- package/out/_next/static/chunks/1x8o-luxdxxk7.js +0 -1
- package/out/_next/static/chunks/1yjb7gogaf8po.js +0 -31
- package/out/_next/static/chunks/1zyhzessv0wtg.js +0 -1
- package/out/_next/static/chunks/2-pl31kdikt3k.js +0 -5
- package/out/_next/static/chunks/20c4_1i5r3kkz.js +0 -1
- package/out/_next/static/chunks/20f2gs8iua6fk.js +0 -1
- package/out/_next/static/chunks/20zdaln201w8j.js +0 -277
- package/out/_next/static/chunks/21l46nbaop06z.js +0 -39
- package/out/_next/static/chunks/22-o32hlte36e.js +0 -130
- package/out/_next/static/chunks/231j2_p-ha14w.js +0 -7
- package/out/_next/static/chunks/23s2f7_-ol94s.js +0 -8
- package/out/_next/static/chunks/26_mx-ritu68j.js +0 -24
- package/out/_next/static/chunks/26ckmxeluyknq.js +0 -1
- package/out/_next/static/chunks/26r0y7ldf3iqs.js +0 -6
- package/out/_next/static/chunks/27fzoozwycagi.js +0 -6
- package/out/_next/static/chunks/27jmq7a-vh0b4.js +0 -7
- package/out/_next/static/chunks/283567a82x9qi.js +0 -149
- package/out/_next/static/chunks/29he8uukp5s4u.js +0 -31
- package/out/_next/static/chunks/2adglo0sf0jcg.js +0 -905
- package/out/_next/static/chunks/2b4ewxxz6f462.js +0 -7
- package/out/_next/static/chunks/2bh2dv7j9m8c8.css +0 -1
- package/out/_next/static/chunks/2bi8v13lm76lr.js +0 -95
- package/out/_next/static/chunks/2burvpf9877y_.js +0 -44
- package/out/_next/static/chunks/2cj703xtrf5i6.js +0 -46
- package/out/_next/static/chunks/2cj8g3fxmitaa.js +0 -1
- package/out/_next/static/chunks/2ec7xatyld40t.js +0 -7
- package/out/_next/static/chunks/2hoi6cb1lromr.js +0 -4
- package/out/_next/static/chunks/2i5k6tlwd58hp.js +0 -1
- package/out/_next/static/chunks/2iy0jr00qhq-q.js +0 -5
- package/out/_next/static/chunks/2jonbba27xy3u.js +0 -14
- package/out/_next/static/chunks/2m0rrts8gwqwp.js +0 -1
- package/out/_next/static/chunks/2m_u12ggzosat.js +0 -5
- package/out/_next/static/chunks/2mdns56l5antm.js +0 -5
- package/out/_next/static/chunks/2mrbytgs3uetd.js +0 -4
- package/out/_next/static/chunks/2p9gwjxeui1zd.js +0 -71
- package/out/_next/static/chunks/2pfhy9qy_cijn.js +0 -5
- package/out/_next/static/chunks/2q5k4rozyr2wt.js +0 -4
- package/out/_next/static/chunks/2qx8nnki_qv5v.js +0 -171
- package/out/_next/static/chunks/2r_rj84l3cy7r.js +0 -119
- package/out/_next/static/chunks/2rb1-3t3-sv5s.js +0 -8
- package/out/_next/static/chunks/2swxmzb-xk_bo.js +0 -108
- package/out/_next/static/chunks/2t0biwx5e_4w_.js +0 -1
- package/out/_next/static/chunks/2ts3v72jkbcdr.js +0 -7
- package/out/_next/static/chunks/2vfexvltv2avy.js +0 -5
- package/out/_next/static/chunks/2vveotzevnkfp.js +0 -1
- package/out/_next/static/chunks/2wkg65dtx56je.js +0 -155
- package/out/_next/static/chunks/2wmsx4gjbgvfv.js +0 -18
- package/out/_next/static/chunks/2xixk0t9e9mnw.js +0 -1
- package/out/_next/static/chunks/2xz7hnr9ikqzq.js +0 -7
- package/out/_next/static/chunks/2y1lq1efnvcdt.js +0 -23
- package/out/_next/static/chunks/2ziasg8l_c9n7.js +0 -5
- package/out/_next/static/chunks/3-wsablhqgzoa.js +0 -1
- package/out/_next/static/chunks/30ppb2wc-m4ph.js +0 -1
- package/out/_next/static/chunks/336k08jwyc5i-.js +0 -1
- package/out/_next/static/chunks/33d061qpkafqm.js +0 -39
- package/out/_next/static/chunks/33fyy6d5mo55_.js +0 -8
- package/out/_next/static/chunks/33kh18frqc3b1.js +0 -5
- package/out/_next/static/chunks/33v05ol-ire9s.js +0 -10
- package/out/_next/static/chunks/33yzdcbu7w60l.js +0 -13
- package/out/_next/static/chunks/348l8p7-vo4l5.js +0 -63
- package/out/_next/static/chunks/35hu5vin0swdf.js +0 -41
- package/out/_next/static/chunks/37a6yquh875rn.js +0 -39
- package/out/_next/static/chunks/3_2i9du5-ffrp.js +0 -59
- package/out/_next/static/chunks/3_84h3z_tewmg.js +0 -145
- package/out/_next/static/chunks/3bo7uiy-wh63m.js +0 -108
- package/out/_next/static/chunks/3c-an5ft_3emc.js +0 -1
- package/out/_next/static/chunks/3d_222ci0_30_.js +0 -41
- package/out/_next/static/chunks/3dldch03dfaed.js +0 -1
- package/out/_next/static/chunks/3eedy49gsvv_t.js +0 -1
- package/out/_next/static/chunks/3fayuejnrsd90.js +0 -15
- package/out/_next/static/chunks/3fqonijzsxy8u.js +0 -28
- package/out/_next/static/chunks/3g1ale0hytu9q.js +0 -12
- package/out/_next/static/chunks/3k3gvr7-e3g_s.js +0 -5
- package/out/_next/static/chunks/3kwoyyxi_-q7m.js +0 -1
- package/out/_next/static/chunks/3le1bywe19_u9.js +0 -1
- package/out/_next/static/chunks/3lku4-9kpf-mj.js +0 -267
- package/out/_next/static/chunks/3lz5h1tw50wr_.js +0 -54
- package/out/_next/static/chunks/3oq-khgfpo0nx.js +0 -39
- package/out/_next/static/chunks/3ps25ocfalcap.js +0 -43
- package/out/_next/static/chunks/3q3m075m4bxz1.js +0 -2
- package/out/_next/static/chunks/3r0i-7zjuz9i1.js +0 -6
- package/out/_next/static/chunks/3rgn5xwtr51ul.js +0 -7
- package/out/_next/static/chunks/3ridg_u19b6ih.js +0 -8
- package/out/_next/static/chunks/3skzk-w2ytvku.js +0 -5
- package/out/_next/static/chunks/3srw10h0hcztd.js +0 -68
- package/out/_next/static/chunks/3tgrftdet8sna.js +0 -15
- package/out/_next/static/chunks/3uax_eq1kjjta.js +0 -1
- package/out/_next/static/chunks/3uj94afpsi6cs.js +0 -1
- package/out/_next/static/chunks/3vgurvjr6hkyv.js +0 -4
- package/out/_next/static/chunks/3viepyovs19ub.js +0 -23
- package/out/_next/static/chunks/3vnzp3n_wd3j_.js +0 -1
- package/out/_next/static/chunks/3w8h5lxnd0z4z.js +0 -1
- package/out/_next/static/chunks/3wh4xa9dnw-55.js +0 -194
- package/out/_next/static/chunks/3wlvio5id54ow.js +0 -5
- package/out/_next/static/chunks/3wzvscqui-9ml.js +0 -23
- package/out/_next/static/chunks/3y8h3g1tqukrv.js +0 -36
- package/out/_next/static/chunks/3zcilnj6p9-t5.js +0 -1
- package/out/_next/static/chunks/3zmmdm68s05-t.js +0 -217
- package/out/_next/static/chunks/40l5d7o95aw37.js +0 -4
- package/out/_next/static/chunks/417kn9hki8k81.js +0 -33
- package/out/_next/static/chunks/41p3ng89i5lem.js +0 -5
- package/out/_next/static/chunks/42mofxcd0l7qi.js +0 -1
- package/out/_next/static/chunks/43hfssep7ry-z.js +0 -5
- package/out/_next/static/chunks/45bcpjurhxb-j.js +0 -1
- package/out/_next/static/jOx5PlckLwWIJ5yrvePdU/_buildManifest.js +0 -258
- /package/out/_next/static/{jOx5PlckLwWIJ5yrvePdU → DUswS2PYjGTW9uUGVJ6xd}/_clientMiddlewareManifest.js +0 -0
- /package/out/_next/static/{jOx5PlckLwWIJ5yrvePdU → DUswS2PYjGTW9uUGVJ6xd}/_ssgManifest.js +0 -0
package/dist/form.js
ADDED
|
@@ -0,0 +1,3128 @@
|
|
|
1
|
+
import { TextField_default } from './chunk-PGJTFYBT.js';
|
|
2
|
+
export { FormErrors_default as FormErrors, MarkdownTextAreaField_default as MarkdownTextAreaField, TextField_default as TextField } from './chunk-PGJTFYBT.js';
|
|
3
|
+
import { Z, l, b, u2, V, Ae, j, L, S as S$1, c as c$1, s, N, $0c4a58759813079a$export$4e328f61c538687f, $e969f22b6713ca4a$export$ae780daf29e6d456, w, e, u as u$1, Fe, ye, Re, Te, w2, u4, s2, g2, u3 as u3$1, p as p$1, c2 as c2$1, f, a as a$1, JSONView_default } from './chunk-4MXPTVDL.js';
|
|
4
|
+
import { HelpText_default, FieldWrapper_default, clsx_default, Badge_default, ChevronUpDownIcon_default, CheckIcon_default } from './chunk-GWMLIF3C.js';
|
|
5
|
+
export { FieldWrapper_default as FieldWrapper, Form_default as Form, SubmitButton_default as SubmitButton, TagInputField_default as TagInputField } from './chunk-GWMLIF3C.js';
|
|
6
|
+
import './chunk-ZUOVKRKC.js';
|
|
7
|
+
import { useField_default, validateMaxLength, validateDate, validateEmail } from './chunk-ATZJXTRA.js';
|
|
8
|
+
import './chunk-HERLM47Z.js';
|
|
9
|
+
import { m, n as n$1, E } from './chunk-EAVP6XZQ.js';
|
|
10
|
+
import { A, Y, r, a, o2, u, S, n, x, k3 as k3$1, n2, K, c, i3, y, n3, o4, V as V$1, p, d, w as w$1, u2 as u2$1, u3, N as N$1, p2, f2, y2, x2, le, s as s$1, o, n4, c2, l2, l as l$1, T, k2, G } from './chunk-CUYIP5XG.js';
|
|
11
|
+
import './chunk-J23QSWDL.js';
|
|
12
|
+
import './chunk-2HTCKO4E.js';
|
|
13
|
+
import { jsxs, jsx, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
14
|
+
import * as L2 from 'react';
|
|
15
|
+
import L2__default, { createContext, useRef, useCallback, useMemo, Fragment, useState, useContext, useEffect } from 'react';
|
|
16
|
+
import { flushSync } from 'react-dom';
|
|
17
|
+
import { useIntl } from 'react-intl';
|
|
18
|
+
|
|
19
|
+
var FieldWithHelp = ({
|
|
20
|
+
helpKey,
|
|
21
|
+
helpText,
|
|
22
|
+
helpValues,
|
|
23
|
+
...textFieldProps
|
|
24
|
+
}) => {
|
|
25
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
26
|
+
/* @__PURE__ */ jsx(TextField_default, { ...textFieldProps }),
|
|
27
|
+
(helpKey || helpText) && /* @__PURE__ */ jsx(
|
|
28
|
+
HelpText_default,
|
|
29
|
+
{
|
|
30
|
+
messageKey: helpKey || `${textFieldProps.name}_help`,
|
|
31
|
+
defaultMessage: helpText,
|
|
32
|
+
values: helpValues,
|
|
33
|
+
className: "mt-1"
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
] });
|
|
37
|
+
};
|
|
38
|
+
var FieldWithHelp_default = FieldWithHelp;
|
|
39
|
+
var TextAreaField = ({
|
|
40
|
+
maxLength,
|
|
41
|
+
validators = [],
|
|
42
|
+
...props
|
|
43
|
+
}) => {
|
|
44
|
+
const field = useField_default({
|
|
45
|
+
validators: [...validators, maxLength && validateMaxLength(maxLength)],
|
|
46
|
+
...props
|
|
47
|
+
});
|
|
48
|
+
return /* @__PURE__ */ jsx(FieldWrapper_default, { ...field, children: /* @__PURE__ */ jsx(
|
|
49
|
+
"textarea",
|
|
50
|
+
{
|
|
51
|
+
className: clsx_default(
|
|
52
|
+
"relative mt-1 block w-full dark:focus:autofill dark:hover:autofill dark:autofill dark:placeholder:text-slate-400 dark:bg-slate-900 dark:text-slate-200 appearance-none rounded-md border-1 border-border-default px-4 py-2.5 text-sm text-slate-900 placeholder-slate-400 shadow-xs placeholder:text-slate-400 focus:outline-hidden focus:ring-2 focus:ring-focus-ring",
|
|
53
|
+
field.className,
|
|
54
|
+
{
|
|
55
|
+
"border-rose-700 placeholder:text-rose-300 placeholder-rose-300": !!field.error
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
disabled: field.disabled,
|
|
59
|
+
id: field.name,
|
|
60
|
+
name: field.name,
|
|
61
|
+
rows: field.rows || 10,
|
|
62
|
+
onChange: field.onChange,
|
|
63
|
+
onBlur: field.onBlur,
|
|
64
|
+
placeholder: field.placeholder,
|
|
65
|
+
autoComplete: field.autoComplete || "off",
|
|
66
|
+
value: field.value
|
|
67
|
+
}
|
|
68
|
+
) });
|
|
69
|
+
};
|
|
70
|
+
var TextAreaField_default = TextAreaField;
|
|
71
|
+
var SelectField = (props) => {
|
|
72
|
+
const { options, ...field } = useField_default(props);
|
|
73
|
+
const { className } = props || { className: "" };
|
|
74
|
+
return /* @__PURE__ */ jsx(FieldWrapper_default, { ...field, children: /* @__PURE__ */ jsx("div", { className: "select-wrap", children: /* @__PURE__ */ jsxs(
|
|
75
|
+
"select",
|
|
76
|
+
{
|
|
77
|
+
className: clsx_default(
|
|
78
|
+
"block w-full bg-surface-input rounded-md border-1 border-border-default py-2.5 pl-3 pr-10 text-base text-text-primary shadow-xs focus:outline-hidden focus:ring-2 focus:ring-focus-ring sm:text-sm",
|
|
79
|
+
className,
|
|
80
|
+
{
|
|
81
|
+
"border-rose-700 text-rose-600 dark:border-rose-500 dark:text-rose-400": !!field.error
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
disabled: field.disabled,
|
|
85
|
+
id: field.name,
|
|
86
|
+
name: field.name,
|
|
87
|
+
onChange: field.onChange,
|
|
88
|
+
onBlur: field.onBlur,
|
|
89
|
+
value: field.value,
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ jsx(
|
|
92
|
+
"option",
|
|
93
|
+
{
|
|
94
|
+
className: "text-text-secondary",
|
|
95
|
+
value: "",
|
|
96
|
+
disabled: field.required,
|
|
97
|
+
hidden: field.required,
|
|
98
|
+
children: field.placeholder || field.label
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
Object.entries(options).map(([value, display]) => /* @__PURE__ */ jsx("option", { className: "text-text-secondary", value, children: display }, value))
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
) }) });
|
|
105
|
+
};
|
|
106
|
+
var SelectField_default = SelectField;
|
|
107
|
+
var CheckboxField = (props) => {
|
|
108
|
+
const {
|
|
109
|
+
disabled,
|
|
110
|
+
labelClassName,
|
|
111
|
+
containerClassName,
|
|
112
|
+
inputClassName,
|
|
113
|
+
...checkboxProps
|
|
114
|
+
} = props;
|
|
115
|
+
const field = useField_default({ ...props, type: "checkbox" });
|
|
116
|
+
return /* @__PURE__ */ jsxs(
|
|
117
|
+
"div",
|
|
118
|
+
{
|
|
119
|
+
className: clsx_default(
|
|
120
|
+
"",
|
|
121
|
+
{
|
|
122
|
+
"text-rose-600": !!field.error,
|
|
123
|
+
checkbox: true,
|
|
124
|
+
disabled: field.disabled,
|
|
125
|
+
required: field.required
|
|
126
|
+
},
|
|
127
|
+
containerClassName
|
|
128
|
+
),
|
|
129
|
+
children: [
|
|
130
|
+
/* @__PURE__ */ jsx(
|
|
131
|
+
"input",
|
|
132
|
+
{
|
|
133
|
+
checked: !!field.value,
|
|
134
|
+
disabled,
|
|
135
|
+
id: field.name,
|
|
136
|
+
name: field.name,
|
|
137
|
+
onChange: field.onChange,
|
|
138
|
+
onBlur: field.onBlur,
|
|
139
|
+
type: "checkbox",
|
|
140
|
+
className: clsx_default(
|
|
141
|
+
"h-4 w-4 rounded-xs border-border-default bg-white dark:!bg-slate-800 text-indigo-600 dark:text-slate-200 focus:ring-focus-ring",
|
|
142
|
+
inputClassName,
|
|
143
|
+
props.className
|
|
144
|
+
),
|
|
145
|
+
...checkboxProps
|
|
146
|
+
}
|
|
147
|
+
),
|
|
148
|
+
/* @__PURE__ */ jsx(
|
|
149
|
+
"label",
|
|
150
|
+
{
|
|
151
|
+
htmlFor: field.name,
|
|
152
|
+
className: clsx_default("text-sm text-text-primary", labelClassName, {
|
|
153
|
+
"text-danger": !!field.error
|
|
154
|
+
}),
|
|
155
|
+
children: field.label
|
|
156
|
+
}
|
|
157
|
+
)
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
);
|
|
161
|
+
};
|
|
162
|
+
var CheckboxField_default = CheckboxField;
|
|
163
|
+
var ChoicesField = ({ multiple, options, ...props }) => {
|
|
164
|
+
const field = useField_default({ multiple, options, ...props });
|
|
165
|
+
const {
|
|
166
|
+
choiceClassName = "col-md-6 col-lg-4'",
|
|
167
|
+
choiceContainerClassName = "",
|
|
168
|
+
labelClassName = "",
|
|
169
|
+
inputClassName = ""
|
|
170
|
+
} = props;
|
|
171
|
+
const mappableValue = typeof field.value === "string" ? [field.value] : Array.isArray(field.value) ? field.value : [];
|
|
172
|
+
const handleChange = (event) => {
|
|
173
|
+
if (field.multiple) {
|
|
174
|
+
const clickedValue = event.target.value;
|
|
175
|
+
const newValues = event.target.checked ? [...mappableValue, clickedValue] : mappableValue.filter((v3) => v3 !== clickedValue);
|
|
176
|
+
field.setValue(newValues, true);
|
|
177
|
+
} else {
|
|
178
|
+
field.onChange(event);
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
const { className, hideLabel } = props;
|
|
182
|
+
return /* @__PURE__ */ jsxs(
|
|
183
|
+
"div",
|
|
184
|
+
{
|
|
185
|
+
className: clsx_default("container", className, {
|
|
186
|
+
"is-invalid": !!field.error,
|
|
187
|
+
disabled: field.disabled,
|
|
188
|
+
required: field.required
|
|
189
|
+
}),
|
|
190
|
+
children: [
|
|
191
|
+
/* @__PURE__ */ jsx(
|
|
192
|
+
"label",
|
|
193
|
+
{
|
|
194
|
+
className: clsx_default("text-sm", className, {
|
|
195
|
+
"text-rose-600": !!field.error,
|
|
196
|
+
"sr-only": hideLabel
|
|
197
|
+
}),
|
|
198
|
+
children: field.label
|
|
199
|
+
}
|
|
200
|
+
),
|
|
201
|
+
/* @__PURE__ */ jsx(
|
|
202
|
+
"div",
|
|
203
|
+
{
|
|
204
|
+
className: clsx_default(
|
|
205
|
+
`row flex flex-row gap-3 ${choiceContainerClassName}`,
|
|
206
|
+
className
|
|
207
|
+
),
|
|
208
|
+
children: Object.entries(field.options).map(([value, display]) => /* @__PURE__ */ jsx(
|
|
209
|
+
"div",
|
|
210
|
+
{
|
|
211
|
+
className: clsx_default(`-ml-2 ${choiceClassName}`, className),
|
|
212
|
+
children: /* @__PURE__ */ jsxs(
|
|
213
|
+
"label",
|
|
214
|
+
{
|
|
215
|
+
htmlFor: `${field.name}-${value}`,
|
|
216
|
+
className: clsx_default("", labelClassName),
|
|
217
|
+
children: [
|
|
218
|
+
/* @__PURE__ */ jsx(
|
|
219
|
+
"input",
|
|
220
|
+
{
|
|
221
|
+
value,
|
|
222
|
+
checked: mappableValue.includes(value),
|
|
223
|
+
className: clsx_default(
|
|
224
|
+
"mr-2 h-4 w-4 rounded-sm border-border-default bg-white dark:!bg-slate-800 text-slate-950 focus:ring-focus-ring",
|
|
225
|
+
inputClassName
|
|
226
|
+
),
|
|
227
|
+
disabled: field.disabled,
|
|
228
|
+
id: `${field.name}-${value}`,
|
|
229
|
+
name: field.name,
|
|
230
|
+
onChange: handleChange,
|
|
231
|
+
type: field.multiple ? "checkbox" : "radio"
|
|
232
|
+
}
|
|
233
|
+
),
|
|
234
|
+
/* @__PURE__ */ jsx("span", { children: display })
|
|
235
|
+
]
|
|
236
|
+
}
|
|
237
|
+
)
|
|
238
|
+
},
|
|
239
|
+
value
|
|
240
|
+
))
|
|
241
|
+
}
|
|
242
|
+
)
|
|
243
|
+
]
|
|
244
|
+
}
|
|
245
|
+
);
|
|
246
|
+
};
|
|
247
|
+
var ChoicesField_default = ChoicesField;
|
|
248
|
+
var DatePickerField = ({
|
|
249
|
+
validators = [],
|
|
250
|
+
className,
|
|
251
|
+
...props
|
|
252
|
+
}) => {
|
|
253
|
+
const field = useField_default({
|
|
254
|
+
validators: [...validators, validateDate],
|
|
255
|
+
...props
|
|
256
|
+
});
|
|
257
|
+
const formattedValue = field.value ? new Date(field.value).toISOString().split("T")[0] : "";
|
|
258
|
+
return /* @__PURE__ */ jsx(FieldWrapper_default, { ...field, className: props.containerClassName, children: /* @__PURE__ */ jsx(
|
|
259
|
+
"input",
|
|
260
|
+
{
|
|
261
|
+
type: "date",
|
|
262
|
+
id: field.id,
|
|
263
|
+
name: field.name,
|
|
264
|
+
disabled: field.disabled,
|
|
265
|
+
className: clsx_default(
|
|
266
|
+
"relative mt-0 block w-full appearance-none rounded-md rounded-b-md border-1 border-border-default px-4 py-2.5 text-sm text-text-primary dark:bg-slate-900 placeholder-slate-400 shadow-xs focus:z-10 focus:outline-hidden focus:ring-2 focus:ring-focus-ring",
|
|
267
|
+
className,
|
|
268
|
+
{
|
|
269
|
+
"border-rose-700 placeholder:text-rose-300": !!field.error
|
|
270
|
+
}
|
|
271
|
+
),
|
|
272
|
+
onChange: field.onChange,
|
|
273
|
+
onBlur: field.onBlur,
|
|
274
|
+
value: formattedValue,
|
|
275
|
+
placeholder: field.placeholder,
|
|
276
|
+
autoComplete: "off",
|
|
277
|
+
...props
|
|
278
|
+
}
|
|
279
|
+
) });
|
|
280
|
+
};
|
|
281
|
+
var DatePickerField_default = DatePickerField;
|
|
282
|
+
var EmailField = ({ validators = [], value = "", ...props }) => {
|
|
283
|
+
return /* @__PURE__ */ jsx(
|
|
284
|
+
TextField_default,
|
|
285
|
+
{
|
|
286
|
+
...{
|
|
287
|
+
value,
|
|
288
|
+
autoComplete: props?.autoComplete || "on",
|
|
289
|
+
name: "email",
|
|
290
|
+
validators: [...validators, validateEmail],
|
|
291
|
+
...props
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
);
|
|
295
|
+
};
|
|
296
|
+
var EmailField_default = EmailField;
|
|
297
|
+
var PasswordField = ({ autoComplete = "on", ...props }) => {
|
|
298
|
+
const [isPasswordVisible, setPasswordVisible] = useState(false);
|
|
299
|
+
const togglePassword = (event) => {
|
|
300
|
+
event.preventDefault();
|
|
301
|
+
setPasswordVisible(!isPasswordVisible);
|
|
302
|
+
};
|
|
303
|
+
return /* @__PURE__ */ jsxs("div", { className: clsx_default("relative", props.className), children: [
|
|
304
|
+
/* @__PURE__ */ jsx(
|
|
305
|
+
TextField_default,
|
|
306
|
+
{
|
|
307
|
+
...{
|
|
308
|
+
autoComplete: autoComplete || "on",
|
|
309
|
+
name: "password",
|
|
310
|
+
...props,
|
|
311
|
+
type: isPasswordVisible ? "text" : "password"
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
),
|
|
315
|
+
/* @__PURE__ */ jsx(
|
|
316
|
+
"span",
|
|
317
|
+
{
|
|
318
|
+
role: "button",
|
|
319
|
+
tabIndex: -1,
|
|
320
|
+
"aria-label": "toggle password visibility",
|
|
321
|
+
className: "absolute translate-y-[-137%] outline-hidden block right-3",
|
|
322
|
+
onClick: togglePassword,
|
|
323
|
+
onKeyUp: togglePassword,
|
|
324
|
+
children: isPasswordVisible ? /* @__PURE__ */ jsxs(
|
|
325
|
+
"svg",
|
|
326
|
+
{
|
|
327
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
328
|
+
className: "h-6 w-6 stroke-slate-700",
|
|
329
|
+
fill: "none",
|
|
330
|
+
viewBox: "0 0 24 24",
|
|
331
|
+
children: [
|
|
332
|
+
/* @__PURE__ */ jsx(
|
|
333
|
+
"path",
|
|
334
|
+
{
|
|
335
|
+
strokeLinecap: "round",
|
|
336
|
+
strokeLinejoin: "round",
|
|
337
|
+
strokeWidth: "2",
|
|
338
|
+
d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z"
|
|
339
|
+
}
|
|
340
|
+
),
|
|
341
|
+
/* @__PURE__ */ jsx(
|
|
342
|
+
"path",
|
|
343
|
+
{
|
|
344
|
+
strokeLinecap: "round",
|
|
345
|
+
strokeLinejoin: "round",
|
|
346
|
+
strokeWidth: "2",
|
|
347
|
+
d: "M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"
|
|
348
|
+
}
|
|
349
|
+
)
|
|
350
|
+
]
|
|
351
|
+
}
|
|
352
|
+
) : /* @__PURE__ */ jsx(
|
|
353
|
+
"svg",
|
|
354
|
+
{
|
|
355
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
356
|
+
className: "h-6 w-6 stroke-slate-700",
|
|
357
|
+
fill: "none",
|
|
358
|
+
viewBox: "0 0 24 24",
|
|
359
|
+
children: /* @__PURE__ */ jsx(
|
|
360
|
+
"path",
|
|
361
|
+
{
|
|
362
|
+
strokeLinecap: "round",
|
|
363
|
+
strokeLinejoin: "round",
|
|
364
|
+
strokeWidth: "2",
|
|
365
|
+
d: "M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"
|
|
366
|
+
}
|
|
367
|
+
)
|
|
368
|
+
}
|
|
369
|
+
)
|
|
370
|
+
}
|
|
371
|
+
)
|
|
372
|
+
] });
|
|
373
|
+
};
|
|
374
|
+
var PasswordField_default = PasswordField;
|
|
375
|
+
var JSONAreaField = ({
|
|
376
|
+
validators = [],
|
|
377
|
+
rows = 10,
|
|
378
|
+
...props
|
|
379
|
+
}) => {
|
|
380
|
+
const field = useField_default({
|
|
381
|
+
...props,
|
|
382
|
+
validators: [
|
|
383
|
+
...validators,
|
|
384
|
+
{
|
|
385
|
+
isValid: (v3) => {
|
|
386
|
+
try {
|
|
387
|
+
JSON?.parse(v3);
|
|
388
|
+
return true;
|
|
389
|
+
} catch (err) {
|
|
390
|
+
return false;
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
intlMessageDescriptor: {
|
|
394
|
+
id: "invalid_json_input",
|
|
395
|
+
defaultMessage: "Invalid JSON input"
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
]
|
|
399
|
+
});
|
|
400
|
+
const handleOnChange = (e2) => {
|
|
401
|
+
try {
|
|
402
|
+
JSON.parse(e2.target.value || "{}");
|
|
403
|
+
field.setError("");
|
|
404
|
+
} catch (err) {
|
|
405
|
+
field.setError(err.message?.replace("JSON.parse", ""));
|
|
406
|
+
} finally {
|
|
407
|
+
field.setValue(e2.target.value, true);
|
|
408
|
+
field.setTouched(true);
|
|
409
|
+
}
|
|
410
|
+
};
|
|
411
|
+
const handleOnBlur = (e2) => {
|
|
412
|
+
try {
|
|
413
|
+
field.setValue(
|
|
414
|
+
JSON.stringify(JSON.parse(e2.target.value), void 0, 2),
|
|
415
|
+
true
|
|
416
|
+
);
|
|
417
|
+
field.setError("");
|
|
418
|
+
} catch (err) {
|
|
419
|
+
field.setError(err.message);
|
|
420
|
+
}
|
|
421
|
+
};
|
|
422
|
+
return /* @__PURE__ */ jsx(FieldWrapper_default, { ...field, children: /* @__PURE__ */ jsx(
|
|
423
|
+
JSONView_default,
|
|
424
|
+
{
|
|
425
|
+
className: clsx_default(
|
|
426
|
+
"mt-1 block w-full max-w-full rounded-md border-1 border-border-default dark:bg-slate-900 dark:text-slate-200 shadow-xs dark:shadow-none focus:ring-focus-ring sm:text-sm",
|
|
427
|
+
{
|
|
428
|
+
"border-rose-300 text-rose-600 focus:border-rose-600 focus:ring-rose-600": !!field.error
|
|
429
|
+
},
|
|
430
|
+
props.className
|
|
431
|
+
),
|
|
432
|
+
disabled: field.disabled,
|
|
433
|
+
id: field.name,
|
|
434
|
+
name: field.name,
|
|
435
|
+
onChange: handleOnChange,
|
|
436
|
+
onBlur: handleOnBlur,
|
|
437
|
+
placeholder: field.placeholder,
|
|
438
|
+
autoComplete: field.autoComplete,
|
|
439
|
+
value: field.value
|
|
440
|
+
}
|
|
441
|
+
) });
|
|
442
|
+
};
|
|
443
|
+
var JSONAreaField_default = JSONAreaField;
|
|
444
|
+
|
|
445
|
+
// ../node_modules/@tanstack/virtual-core/dist/esm/lazy-measurements.js
|
|
446
|
+
function getMeasurementKey(item) {
|
|
447
|
+
return typeof item === "object" ? item.key : item;
|
|
448
|
+
}
|
|
449
|
+
function createLazyMeasurementsView(cache, flat) {
|
|
450
|
+
const count = cache.length;
|
|
451
|
+
return new Proxy(cache, {
|
|
452
|
+
get(target, prop, receiver) {
|
|
453
|
+
if (typeof prop === "string") {
|
|
454
|
+
const c5 = prop.charCodeAt(0);
|
|
455
|
+
if (c5 >= 48 && c5 <= 57) {
|
|
456
|
+
const i2 = +prop;
|
|
457
|
+
if (Number.isInteger(i2) && i2 >= 0 && i2 < count) {
|
|
458
|
+
let v3 = target[i2];
|
|
459
|
+
if (typeof v3 !== "object") {
|
|
460
|
+
const s4 = flat[i2 * 2];
|
|
461
|
+
v3 = target[i2] = {
|
|
462
|
+
index: i2,
|
|
463
|
+
key: v3,
|
|
464
|
+
start: s4,
|
|
465
|
+
size: flat[i2 * 2 + 1],
|
|
466
|
+
end: s4 + flat[i2 * 2 + 1],
|
|
467
|
+
lane: 0
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
return v3;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
if (prop === "length") return count;
|
|
474
|
+
}
|
|
475
|
+
return Reflect.get(target, prop, receiver);
|
|
476
|
+
}
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
// ../node_modules/@tanstack/virtual-core/dist/esm/utils.js
|
|
481
|
+
function memo(getDeps, fn, opts) {
|
|
482
|
+
let deps = opts.initialDeps ?? [];
|
|
483
|
+
let result;
|
|
484
|
+
let isInitial = true;
|
|
485
|
+
function memoizedFunction() {
|
|
486
|
+
var _a;
|
|
487
|
+
const debugEnabled = !!opts.key && !!((_a = opts.debug) == null ? void 0 : _a.call(opts));
|
|
488
|
+
let depTime = 0;
|
|
489
|
+
if (debugEnabled) depTime = Date.now();
|
|
490
|
+
const newDeps = getDeps();
|
|
491
|
+
const depsChanged = newDeps.length !== deps.length || newDeps.some((dep, index) => deps[index] !== dep);
|
|
492
|
+
if (!depsChanged) {
|
|
493
|
+
return result;
|
|
494
|
+
}
|
|
495
|
+
deps = newDeps;
|
|
496
|
+
let resultTime = 0;
|
|
497
|
+
if (debugEnabled) resultTime = Date.now();
|
|
498
|
+
result = fn(...newDeps);
|
|
499
|
+
if (debugEnabled) {
|
|
500
|
+
const depEndTime = Math.round((Date.now() - depTime) * 100) / 100;
|
|
501
|
+
const resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100;
|
|
502
|
+
const resultFpsPercentage = resultEndTime / 16;
|
|
503
|
+
const pad = (str, num) => {
|
|
504
|
+
str = String(str);
|
|
505
|
+
while (str.length < num) {
|
|
506
|
+
str = " " + str;
|
|
507
|
+
}
|
|
508
|
+
return str;
|
|
509
|
+
};
|
|
510
|
+
console.info(
|
|
511
|
+
`%c\u23F1 ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`,
|
|
512
|
+
`
|
|
513
|
+
font-size: .6rem;
|
|
514
|
+
font-weight: bold;
|
|
515
|
+
color: hsl(${Math.max(
|
|
516
|
+
0,
|
|
517
|
+
Math.min(120 - 120 * resultFpsPercentage, 120)
|
|
518
|
+
)}deg 100% 31%);`,
|
|
519
|
+
opts == null ? void 0 : opts.key
|
|
520
|
+
);
|
|
521
|
+
}
|
|
522
|
+
if ((opts == null ? void 0 : opts.onChange) && !(isInitial && opts.skipInitialOnChange)) {
|
|
523
|
+
opts.onChange(result);
|
|
524
|
+
}
|
|
525
|
+
isInitial = false;
|
|
526
|
+
return result;
|
|
527
|
+
}
|
|
528
|
+
memoizedFunction.updateDeps = (newDeps) => {
|
|
529
|
+
deps = newDeps;
|
|
530
|
+
};
|
|
531
|
+
return memoizedFunction;
|
|
532
|
+
}
|
|
533
|
+
function notUndefined(value, msg) {
|
|
534
|
+
if (value === void 0) {
|
|
535
|
+
throw new Error(`Unexpected undefined${""}`);
|
|
536
|
+
} else {
|
|
537
|
+
return value;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
var approxEqual = (a4, b3) => Math.abs(a4 - b3) < 1.01;
|
|
541
|
+
var debounce = (targetWindow, fn, ms) => {
|
|
542
|
+
let timeoutId;
|
|
543
|
+
return Object.assign(
|
|
544
|
+
function(...args) {
|
|
545
|
+
targetWindow.clearTimeout(timeoutId);
|
|
546
|
+
timeoutId = targetWindow.setTimeout(() => fn.apply(this, args), ms);
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
// The handle is closure-local, so a caller that has already
|
|
550
|
+
// unsubscribed has no way to stop a queued call. Teardown paths use
|
|
551
|
+
// this to drop the pending invocation instead of letting it land.
|
|
552
|
+
cancel: () => {
|
|
553
|
+
targetWindow.clearTimeout(timeoutId);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
);
|
|
557
|
+
};
|
|
558
|
+
|
|
559
|
+
// ../node_modules/@tanstack/virtual-core/dist/esm/scroll-classifier.js
|
|
560
|
+
function classifyScrollEvent({
|
|
561
|
+
offset,
|
|
562
|
+
isScrolling,
|
|
563
|
+
elementMax,
|
|
564
|
+
holdOffset,
|
|
565
|
+
scrollOffset,
|
|
566
|
+
pendingWrite,
|
|
567
|
+
clampedMaxAtWrite
|
|
568
|
+
}) {
|
|
569
|
+
var _a;
|
|
570
|
+
if (isScrolling && pendingWrite === null && offset === scrollOffset) {
|
|
571
|
+
return "spurious";
|
|
572
|
+
}
|
|
573
|
+
if (pendingWrite !== null && Math.abs(offset - pendingWrite.target) < 1.5) {
|
|
574
|
+
return "readBack";
|
|
575
|
+
}
|
|
576
|
+
if (pendingWrite !== null && !pendingWrite.smooth && elementMax !== null && pendingWrite.target > elementMax + holdOffset + 0.5 && Math.abs(offset - (elementMax + holdOffset)) < 1.5) {
|
|
577
|
+
return "clampedReadBack";
|
|
578
|
+
}
|
|
579
|
+
if (pendingWrite !== null && !pendingWrite.smooth && ((_a = pendingWrite.lowMaxes) == null ? void 0 : _a.some((max) => Math.abs(offset - max) < 1.5))) {
|
|
580
|
+
return "clampedReadBack";
|
|
581
|
+
}
|
|
582
|
+
if (clampedMaxAtWrite !== null && Math.abs(offset - clampedMaxAtWrite) < 1.5) {
|
|
583
|
+
return "clampedEcho";
|
|
584
|
+
}
|
|
585
|
+
return "external";
|
|
586
|
+
}
|
|
587
|
+
var isAnimating = (phase) => phase === "smooth" || phase === "smoothFinishing";
|
|
588
|
+
function externalRetiresCommand({
|
|
589
|
+
kind,
|
|
590
|
+
offset,
|
|
591
|
+
command,
|
|
592
|
+
target
|
|
593
|
+
}) {
|
|
594
|
+
return kind !== "spurious" && kind !== "readBack" && // Our own write, clamped (`clampedReadBack`, #1310): the command is not
|
|
595
|
+
// retired by it, and reconcile retargets below the new max.
|
|
596
|
+
kind !== "clampedReadBack" && (command == null ? void 0 : command.index) != null && // Nothing has been written for a command waiting for the tail; these
|
|
597
|
+
// are the fling's events.
|
|
598
|
+
command.phase !== "queued" && // A non-smooth write lands at once, so any other scroll event is the
|
|
599
|
+
// user's, even before reconcile saw the target reached (the target may
|
|
600
|
+
// keep moving, or iOS ignored the write under a finger). A write the
|
|
601
|
+
// browser clamped because the sizer hasn't grown yet reads back at the
|
|
602
|
+
// max, which is also where the fresh target clamps, so the check below
|
|
603
|
+
// keeps it reconciling (#1294). While a smooth scroll's animation may
|
|
604
|
+
// still report, its events look like a user's, so it yields only once it
|
|
605
|
+
// has landed.
|
|
606
|
+
!isAnimating(command.phase) && !approxEqual(offset, command.lastTargetOffset) && !approxEqual(offset, target()) && // A compensation write's clamped echo (#1258) keeps the command. The
|
|
607
|
+
// order is deliberate, not tidiness: this clause stays after `target()`
|
|
608
|
+
// (and `clampedReadBack` before it) because `target()` can rebuild the
|
|
609
|
+
// measurements, so it must run for exactly the events it always did.
|
|
610
|
+
kind !== "clampedEcho";
|
|
611
|
+
}
|
|
612
|
+
var FLING_WINDOW_MS = 40;
|
|
613
|
+
function flingSpedUp(samples) {
|
|
614
|
+
const last = samples[samples.length - 1];
|
|
615
|
+
if (last === void 0) return false;
|
|
616
|
+
let j3 = samples.length - 2;
|
|
617
|
+
while (j3 >= 0 && last.t - samples[j3].t < FLING_WINDOW_MS) j3--;
|
|
618
|
+
if (j3 < 0) return false;
|
|
619
|
+
const mid = samples[j3];
|
|
620
|
+
let k4 = j3 - 1;
|
|
621
|
+
while (k4 >= 0 && mid.t - samples[k4].t < FLING_WINDOW_MS) k4--;
|
|
622
|
+
if (k4 < 0) return false;
|
|
623
|
+
const first = samples[k4];
|
|
624
|
+
const recent = (last.offset - mid.offset) / (last.t - mid.t);
|
|
625
|
+
const before = (mid.offset - first.offset) / (mid.t - first.t);
|
|
626
|
+
return recent * before >= 0 && Math.abs(recent) >= 2 * Math.abs(before) && Math.abs(recent) - Math.abs(before) >= 0.8;
|
|
627
|
+
}
|
|
628
|
+
function flingCaught(samples) {
|
|
629
|
+
const last = samples[samples.length - 1];
|
|
630
|
+
if (last === void 0) return false;
|
|
631
|
+
let j3 = samples.length - 2;
|
|
632
|
+
while (j3 >= 0 && last.t - samples[j3].t < FLING_WINDOW_MS) j3--;
|
|
633
|
+
if (j3 < 0) return false;
|
|
634
|
+
const from = samples[j3];
|
|
635
|
+
return Math.abs(last.offset - from.offset) / (last.t - from.t) >= 0.05;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
// ../node_modules/@tanstack/virtual-core/dist/esm/ios-gesture.js
|
|
639
|
+
var _isIOSResult;
|
|
640
|
+
var isIOSWebKit = () => {
|
|
641
|
+
if (_isIOSResult !== void 0) return _isIOSResult;
|
|
642
|
+
if (typeof navigator === "undefined") return _isIOSResult = false;
|
|
643
|
+
if (/iP(hone|od|ad)/.test(navigator.userAgent)) return _isIOSResult = true;
|
|
644
|
+
const mtp = navigator.maxTouchPoints;
|
|
645
|
+
return _isIOSResult = navigator.platform === "MacIntel" && mtp !== void 0 && mtp > 0;
|
|
646
|
+
};
|
|
647
|
+
var _iosMomentumOverridesWritesResult;
|
|
648
|
+
var iosMomentumOverridesWrites = () => {
|
|
649
|
+
if (_iosMomentumOverridesWritesResult !== void 0) {
|
|
650
|
+
return _iosMomentumOverridesWritesResult;
|
|
651
|
+
}
|
|
652
|
+
return _iosMomentumOverridesWritesResult = isIOSWebKit() && typeof CSS !== "undefined" && typeof CSS.supports === "function" && CSS.supports("overflow-anchor: auto");
|
|
653
|
+
};
|
|
654
|
+
var momentumOverridesWrites = () => !isIOSWebKit() || iosMomentumOverridesWrites();
|
|
655
|
+
var touchListenerOptions = {
|
|
656
|
+
capture: true,
|
|
657
|
+
passive: true
|
|
658
|
+
};
|
|
659
|
+
var IosGesture = class {
|
|
660
|
+
constructor(host) {
|
|
661
|
+
this.host = host;
|
|
662
|
+
this._touch = null;
|
|
663
|
+
this.inMotion = () => this._touch !== null && this._touch.phase !== "lateFling";
|
|
664
|
+
this.dragging = () => {
|
|
665
|
+
var _a;
|
|
666
|
+
return ((_a = this._touch) == null ? void 0 : _a.phase) === "down" && this._touch.moved;
|
|
667
|
+
};
|
|
668
|
+
this.tail = () => {
|
|
669
|
+
var _a;
|
|
670
|
+
return ((_a = this._touch) == null ? void 0 : _a.phase) === "tail" ? this._touch.moved ? "fling" : "tap" : null;
|
|
671
|
+
};
|
|
672
|
+
this.onScroll = ({
|
|
673
|
+
isScrolling,
|
|
674
|
+
ownReadBack,
|
|
675
|
+
moved,
|
|
676
|
+
external
|
|
677
|
+
}) => {
|
|
678
|
+
var _a, _b, _c;
|
|
679
|
+
if (isScrolling && ((_a = this._touch) == null ? void 0 : _a.phase) === "tail") {
|
|
680
|
+
this._openTail(this._touch.moved || !ownReadBack, false);
|
|
681
|
+
} else if (((_b = this._touch) == null ? void 0 : _b.phase) === "lateFling") {
|
|
682
|
+
if (this.host.now() > this._touch.until) {
|
|
683
|
+
this._touch = null;
|
|
684
|
+
} else if (external && isScrolling && moved) {
|
|
685
|
+
this._openTail(true, false);
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
if (!ownReadBack && isScrolling && moved && ((_c = this._touch) == null ? void 0 : _c.phase) === "down") {
|
|
689
|
+
this._touch.moved = true;
|
|
690
|
+
return true;
|
|
691
|
+
}
|
|
692
|
+
return false;
|
|
693
|
+
};
|
|
694
|
+
this.touchStart = () => {
|
|
695
|
+
this.end();
|
|
696
|
+
this._touch = { phase: "down", moved: false };
|
|
697
|
+
};
|
|
698
|
+
this.touchEnd = () => {
|
|
699
|
+
var _a;
|
|
700
|
+
const moved = ((_a = this._touch) == null ? void 0 : _a.phase) === "down" && this._touch.moved;
|
|
701
|
+
this.end();
|
|
702
|
+
this._openTail(moved, moved);
|
|
703
|
+
};
|
|
704
|
+
this.end = () => {
|
|
705
|
+
var _a;
|
|
706
|
+
const win = this.host.getWindow();
|
|
707
|
+
if (((_a = this._touch) == null ? void 0 : _a.phase) === "tail" && win != null) {
|
|
708
|
+
win.clearTimeout(this._touch.timerId);
|
|
709
|
+
}
|
|
710
|
+
this._touch = null;
|
|
711
|
+
};
|
|
712
|
+
this.listen = (target) => {
|
|
713
|
+
const onTouchStart = () => this.touchStart();
|
|
714
|
+
const onTouchEnd = () => this.touchEnd();
|
|
715
|
+
target.addEventListener("touchstart", onTouchStart, touchListenerOptions);
|
|
716
|
+
target.addEventListener("touchend", onTouchEnd, touchListenerOptions);
|
|
717
|
+
target.addEventListener("touchcancel", onTouchEnd, touchListenerOptions);
|
|
718
|
+
return () => {
|
|
719
|
+
target.removeEventListener(
|
|
720
|
+
"touchstart",
|
|
721
|
+
onTouchStart,
|
|
722
|
+
touchListenerOptions
|
|
723
|
+
);
|
|
724
|
+
target.removeEventListener("touchend", onTouchEnd, touchListenerOptions);
|
|
725
|
+
target.removeEventListener(
|
|
726
|
+
"touchcancel",
|
|
727
|
+
onTouchEnd,
|
|
728
|
+
touchListenerOptions
|
|
729
|
+
);
|
|
730
|
+
this.end();
|
|
731
|
+
};
|
|
732
|
+
};
|
|
733
|
+
this._openTail = (moved, awaitingFling) => {
|
|
734
|
+
const win = this.host.getWindow();
|
|
735
|
+
if (win == null) return;
|
|
736
|
+
this.end();
|
|
737
|
+
const tail = {
|
|
738
|
+
phase: "tail",
|
|
739
|
+
moved,
|
|
740
|
+
awaitingFling,
|
|
741
|
+
// Only fires while this tail is current: `end` clears it otherwise.
|
|
742
|
+
timerId: win.setTimeout(() => {
|
|
743
|
+
if (this.host.tailStillMoving()) {
|
|
744
|
+
this._openTail(tail.moved, tail.awaitingFling);
|
|
745
|
+
return;
|
|
746
|
+
}
|
|
747
|
+
this._touch = tail.awaitingFling ? { phase: "lateFling", until: this.host.now() + 1e3 } : null;
|
|
748
|
+
this.host.onTailClosed();
|
|
749
|
+
}, 150)
|
|
750
|
+
};
|
|
751
|
+
this._touch = tail;
|
|
752
|
+
};
|
|
753
|
+
}
|
|
754
|
+
get touch() {
|
|
755
|
+
return this._touch;
|
|
756
|
+
}
|
|
757
|
+
};
|
|
758
|
+
|
|
759
|
+
// ../node_modules/@tanstack/virtual-core/dist/esm/index.js
|
|
760
|
+
var getRect = (element) => {
|
|
761
|
+
const { clientWidth, clientHeight } = element;
|
|
762
|
+
return { width: clientWidth, height: clientHeight };
|
|
763
|
+
};
|
|
764
|
+
var createFrameQueue = (targetWindow) => {
|
|
765
|
+
const ids = /* @__PURE__ */ new Set();
|
|
766
|
+
return {
|
|
767
|
+
schedule: (fn) => {
|
|
768
|
+
const id = targetWindow.requestAnimationFrame(() => {
|
|
769
|
+
ids.delete(id);
|
|
770
|
+
fn();
|
|
771
|
+
});
|
|
772
|
+
ids.add(id);
|
|
773
|
+
},
|
|
774
|
+
cancel: () => {
|
|
775
|
+
ids.forEach((id) => targetWindow.cancelAnimationFrame(id));
|
|
776
|
+
ids.clear();
|
|
777
|
+
}
|
|
778
|
+
};
|
|
779
|
+
};
|
|
780
|
+
var defaultKeyExtractor = (index) => index;
|
|
781
|
+
var defaultRangeExtractor = (range) => {
|
|
782
|
+
const overscan = range.overscan * Math.max(range.lanes ?? 1, 1);
|
|
783
|
+
const start = Math.max(range.startIndex - overscan, 0);
|
|
784
|
+
const end = Math.min(range.endIndex + overscan, range.count - 1);
|
|
785
|
+
const len = end - start + 1;
|
|
786
|
+
const arr = new Array(len);
|
|
787
|
+
for (let i2 = 0; i2 < len; i2++) {
|
|
788
|
+
arr[i2] = start + i2;
|
|
789
|
+
}
|
|
790
|
+
return arr;
|
|
791
|
+
};
|
|
792
|
+
var observeElementRect = (instance, cb) => {
|
|
793
|
+
const element = instance.scrollElement;
|
|
794
|
+
if (!element) {
|
|
795
|
+
return;
|
|
796
|
+
}
|
|
797
|
+
const targetWindow = instance.targetWindow;
|
|
798
|
+
if (!targetWindow) {
|
|
799
|
+
return;
|
|
800
|
+
}
|
|
801
|
+
const handler = (rect) => {
|
|
802
|
+
const { width, height } = rect;
|
|
803
|
+
cb({ width: Math.round(width), height: Math.round(height) });
|
|
804
|
+
};
|
|
805
|
+
handler(getRect(element));
|
|
806
|
+
if (!targetWindow.ResizeObserver) {
|
|
807
|
+
return () => {
|
|
808
|
+
};
|
|
809
|
+
}
|
|
810
|
+
const frames = createFrameQueue(targetWindow);
|
|
811
|
+
const observer = new targetWindow.ResizeObserver(() => {
|
|
812
|
+
const run = () => {
|
|
813
|
+
handler(getRect(element));
|
|
814
|
+
};
|
|
815
|
+
instance.options.useAnimationFrameWithResizeObserver ? frames.schedule(run) : run();
|
|
816
|
+
});
|
|
817
|
+
observer.observe(element, { box: "content-box" });
|
|
818
|
+
return () => {
|
|
819
|
+
observer.unobserve(element);
|
|
820
|
+
frames.cancel();
|
|
821
|
+
};
|
|
822
|
+
};
|
|
823
|
+
var addEventListenerOptions = {
|
|
824
|
+
passive: true
|
|
825
|
+
};
|
|
826
|
+
var supportsScrollend = typeof window == "undefined" ? true : "onscrollend" in window;
|
|
827
|
+
var observeOffset = (instance, cb, readOffset) => {
|
|
828
|
+
const element = instance.scrollElement;
|
|
829
|
+
if (!element) {
|
|
830
|
+
return;
|
|
831
|
+
}
|
|
832
|
+
const targetWindow = instance.targetWindow;
|
|
833
|
+
if (!targetWindow) {
|
|
834
|
+
return;
|
|
835
|
+
}
|
|
836
|
+
const registerScrollendEvent = instance.options.useScrollendEvent && supportsScrollend;
|
|
837
|
+
let offset = 0;
|
|
838
|
+
const fallback = registerScrollendEvent ? null : debounce(
|
|
839
|
+
targetWindow,
|
|
840
|
+
() => cb(readOffset(element), false),
|
|
841
|
+
instance.options.isScrollingResetDelay
|
|
842
|
+
);
|
|
843
|
+
const createHandler = (isScrolling) => () => {
|
|
844
|
+
offset = readOffset(element);
|
|
845
|
+
fallback == null ? void 0 : fallback();
|
|
846
|
+
cb(offset, isScrolling);
|
|
847
|
+
};
|
|
848
|
+
const handler = createHandler(true);
|
|
849
|
+
const endHandler = createHandler(false);
|
|
850
|
+
element.addEventListener("scroll", handler, addEventListenerOptions);
|
|
851
|
+
if (registerScrollendEvent) {
|
|
852
|
+
element.addEventListener("scrollend", endHandler, addEventListenerOptions);
|
|
853
|
+
}
|
|
854
|
+
return () => {
|
|
855
|
+
element.removeEventListener("scroll", handler);
|
|
856
|
+
if (registerScrollendEvent) {
|
|
857
|
+
element.removeEventListener("scrollend", endHandler);
|
|
858
|
+
}
|
|
859
|
+
fallback == null ? void 0 : fallback.cancel();
|
|
860
|
+
};
|
|
861
|
+
};
|
|
862
|
+
var observeElementOffset = (instance, cb) => observeOffset(instance, cb, (el) => {
|
|
863
|
+
const { horizontal, isRtl } = instance.options;
|
|
864
|
+
return horizontal ? el.scrollLeft * (isRtl && -1 || 1) : el.scrollTop;
|
|
865
|
+
});
|
|
866
|
+
var measureElement = (element, entry, instance) => {
|
|
867
|
+
if (instance.options.useCachedMeasurements) {
|
|
868
|
+
const index = instance.indexFromElement(element);
|
|
869
|
+
const key = instance.options.getItemKey(index);
|
|
870
|
+
return instance.itemSizeCache.get(key) ?? instance.options.estimateSize(index);
|
|
871
|
+
}
|
|
872
|
+
if (entry == null ? void 0 : entry.borderBoxSize) {
|
|
873
|
+
const box = entry.borderBoxSize[0];
|
|
874
|
+
if (box) {
|
|
875
|
+
const size = Math.round(
|
|
876
|
+
box[instance.options.horizontal ? "inlineSize" : "blockSize"]
|
|
877
|
+
);
|
|
878
|
+
return size;
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
if (!entry) {
|
|
882
|
+
const index = instance.indexFromElement(element);
|
|
883
|
+
const key = instance.options.getItemKey(index);
|
|
884
|
+
const cachedSize = instance.itemSizeCache.get(key);
|
|
885
|
+
if (cachedSize !== void 0) {
|
|
886
|
+
return cachedSize;
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
return element[instance.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
890
|
+
};
|
|
891
|
+
var scrollWithAdjustments = (offset, {
|
|
892
|
+
adjustments = 0,
|
|
893
|
+
behavior
|
|
894
|
+
}, instance) => {
|
|
895
|
+
var _a;
|
|
896
|
+
const { scrollElement, options } = instance;
|
|
897
|
+
const adjustedOffset = offset + adjustments;
|
|
898
|
+
const isRtlElement = options.horizontal && options.isRtl && scrollElement !== null && "ownerDocument" in scrollElement;
|
|
899
|
+
(_a = scrollElement == null ? void 0 : scrollElement.scrollTo) == null ? void 0 : _a.call(scrollElement, {
|
|
900
|
+
[options.horizontal ? "left" : "top"]: isRtlElement ? -adjustedOffset : adjustedOffset,
|
|
901
|
+
behavior
|
|
902
|
+
});
|
|
903
|
+
};
|
|
904
|
+
var elementScroll = scrollWithAdjustments;
|
|
905
|
+
var initialScrollPhase = (behavior, atTarget) => behavior === "smooth" ? atTarget ? "smoothLanded" : "smooth" : "instant";
|
|
906
|
+
var isSmoothScroll = (state) => (state == null ? void 0 : state.phase) === "smooth" || (state == null ? void 0 : state.phase) === "smoothLanded";
|
|
907
|
+
function isAppendWithTrim(prevCount, nextCount, getPreviousKey, getNextKey) {
|
|
908
|
+
if (nextCount === 0) return false;
|
|
909
|
+
const firstKey = getNextKey(0);
|
|
910
|
+
const removedKeys = /* @__PURE__ */ new Set();
|
|
911
|
+
let removedCount = 0;
|
|
912
|
+
while (removedCount < prevCount) {
|
|
913
|
+
const key = getPreviousKey(removedCount);
|
|
914
|
+
if (key === firstKey) break;
|
|
915
|
+
removedKeys.add(key);
|
|
916
|
+
removedCount++;
|
|
917
|
+
}
|
|
918
|
+
const retainedCount = prevCount - removedCount;
|
|
919
|
+
if (retainedCount === 0 || retainedCount >= nextCount) return false;
|
|
920
|
+
for (let i2 = 0; i2 < retainedCount; i2++) {
|
|
921
|
+
if (getNextKey(i2) !== getPreviousKey(removedCount + i2)) return false;
|
|
922
|
+
}
|
|
923
|
+
for (let i2 = retainedCount; i2 < nextCount; i2++) {
|
|
924
|
+
if (removedKeys.has(getNextKey(i2))) return false;
|
|
925
|
+
}
|
|
926
|
+
return true;
|
|
927
|
+
}
|
|
928
|
+
var Virtualizer = class {
|
|
929
|
+
constructor(opts) {
|
|
930
|
+
this.unsubs = [];
|
|
931
|
+
this.scrollElement = null;
|
|
932
|
+
this.targetWindow = null;
|
|
933
|
+
this.isScrolling = false;
|
|
934
|
+
this.scrollState = null;
|
|
935
|
+
this.measurementsCache = [];
|
|
936
|
+
this._singleLaneMeasurements = null;
|
|
937
|
+
this.itemSizeCache = /* @__PURE__ */ new Map();
|
|
938
|
+
this.itemSizeCacheVersion = 0;
|
|
939
|
+
this.laneAssignments = /* @__PURE__ */ new Map();
|
|
940
|
+
this.pendingMin = null;
|
|
941
|
+
this.prevLanes = void 0;
|
|
942
|
+
this.lanesChangedFlag = false;
|
|
943
|
+
this.lanesSettling = false;
|
|
944
|
+
this.pendingScrollAnchor = null;
|
|
945
|
+
this.scrollRect = null;
|
|
946
|
+
this.scrollOffset = null;
|
|
947
|
+
this.scrollDirection = null;
|
|
948
|
+
this._holdOffset = 0;
|
|
949
|
+
this._reportedOverscroll = false;
|
|
950
|
+
this._iosGesture = new IosGesture({
|
|
951
|
+
getWindow: () => this.targetWindow,
|
|
952
|
+
now: () => this.now(),
|
|
953
|
+
// The end of a fling can move less than a pixel per scroll event, so
|
|
954
|
+
// events can stop for 150ms while the fling is still running (seen on
|
|
955
|
+
// an iPhone, 27.0.1). A command waiting for it would then be written
|
|
956
|
+
// into the fling and overridden. The element having moved since the
|
|
957
|
+
// last event means it has not ended: wait again. Not while our own
|
|
958
|
+
// write has yet to report: that moved it.
|
|
959
|
+
tailStillMoving: () => {
|
|
960
|
+
const state = this.scrollState;
|
|
961
|
+
if ((state == null ? void 0 : state.phase) !== "queued" || this.pendingWrite !== null) {
|
|
962
|
+
return false;
|
|
963
|
+
}
|
|
964
|
+
const now = this._readElementOffset();
|
|
965
|
+
if (now === null || this._lastElementOffset === null || Math.abs(now - this._lastElementOffset) < 1) {
|
|
966
|
+
return false;
|
|
967
|
+
}
|
|
968
|
+
this._lastElementOffset = now;
|
|
969
|
+
state.samples = [...state.samples ?? [], { t: this.now(), offset: now }];
|
|
970
|
+
return true;
|
|
971
|
+
},
|
|
972
|
+
onTailClosed: () => {
|
|
973
|
+
const state = this.scrollState;
|
|
974
|
+
if ((state == null ? void 0 : state.phase) === "queued" && flingCaught(state.samples ?? [])) {
|
|
975
|
+
this.scrollState = null;
|
|
976
|
+
}
|
|
977
|
+
this._flushHoldIfReady(true);
|
|
978
|
+
this._writeAwaitingCommand();
|
|
979
|
+
this._retryClampedAdjustment();
|
|
980
|
+
}
|
|
981
|
+
});
|
|
982
|
+
this._lastElementOffset = null;
|
|
983
|
+
this.pendingWrite = null;
|
|
984
|
+
this._clampedAdjustment = null;
|
|
985
|
+
this.elementsCache = /* @__PURE__ */ new Map();
|
|
986
|
+
this._resizeBatch = null;
|
|
987
|
+
this.now = () => {
|
|
988
|
+
var _a, _b, _c;
|
|
989
|
+
return ((_c = (_b = (_a = this.targetWindow) == null ? void 0 : _a.performance) == null ? void 0 : _b.now) == null ? void 0 : _c.call(_b)) ?? Date.now();
|
|
990
|
+
};
|
|
991
|
+
this.observer = /* @__PURE__ */ (() => {
|
|
992
|
+
let _ro = null;
|
|
993
|
+
let _frames = null;
|
|
994
|
+
let delivering = false;
|
|
995
|
+
let observeQueued = false;
|
|
996
|
+
const pendingObservations = /* @__PURE__ */ new Set();
|
|
997
|
+
const get = () => {
|
|
998
|
+
if (_ro) {
|
|
999
|
+
return _ro;
|
|
1000
|
+
}
|
|
1001
|
+
const targetWindow = this.targetWindow;
|
|
1002
|
+
if (!targetWindow || !targetWindow.ResizeObserver) {
|
|
1003
|
+
return null;
|
|
1004
|
+
}
|
|
1005
|
+
const frames = _frames = createFrameQueue(targetWindow);
|
|
1006
|
+
return _ro = new targetWindow.ResizeObserver((entries) => {
|
|
1007
|
+
const run = () => {
|
|
1008
|
+
const batch = { sync: false };
|
|
1009
|
+
this._resizeBatch = batch;
|
|
1010
|
+
try {
|
|
1011
|
+
entries.forEach(measureEntry);
|
|
1012
|
+
} finally {
|
|
1013
|
+
this._resizeBatch = null;
|
|
1014
|
+
if (batch.notify) {
|
|
1015
|
+
this.notify(batch.sync);
|
|
1016
|
+
this._noteClampMax();
|
|
1017
|
+
this._flushHoldIfReady(true);
|
|
1018
|
+
this._retryClampedAdjustment();
|
|
1019
|
+
this.measureElement(null);
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
};
|
|
1023
|
+
if (this.options.useAnimationFrameWithResizeObserver) {
|
|
1024
|
+
frames.schedule(run);
|
|
1025
|
+
} else {
|
|
1026
|
+
delivering = true;
|
|
1027
|
+
try {
|
|
1028
|
+
run();
|
|
1029
|
+
} finally {
|
|
1030
|
+
delivering = false;
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
});
|
|
1034
|
+
};
|
|
1035
|
+
const measureEntry = (entry) => {
|
|
1036
|
+
const node = entry.target;
|
|
1037
|
+
const index = this.indexFromElement(node);
|
|
1038
|
+
if (!node.isConnected) {
|
|
1039
|
+
this.observer.unobserve(node);
|
|
1040
|
+
for (const [cacheKey, cachedNode] of this.elementsCache) {
|
|
1041
|
+
if (cachedNode === node) {
|
|
1042
|
+
this.elementsCache.delete(cacheKey);
|
|
1043
|
+
break;
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
return;
|
|
1047
|
+
}
|
|
1048
|
+
if (!this.isIndexInRange(index)) return;
|
|
1049
|
+
if (this.shouldMeasureDuringScroll(index)) {
|
|
1050
|
+
this.resizeItem(index, this.options.measureElement(node, entry, this));
|
|
1051
|
+
}
|
|
1052
|
+
};
|
|
1053
|
+
return {
|
|
1054
|
+
disconnect: () => {
|
|
1055
|
+
var _a;
|
|
1056
|
+
(_a = get()) == null ? void 0 : _a.disconnect();
|
|
1057
|
+
_frames == null ? void 0 : _frames.cancel();
|
|
1058
|
+
pendingObservations.clear();
|
|
1059
|
+
observeQueued = false;
|
|
1060
|
+
_ro = null;
|
|
1061
|
+
_frames = null;
|
|
1062
|
+
},
|
|
1063
|
+
observe: (target) => {
|
|
1064
|
+
const observer = get();
|
|
1065
|
+
if (!observer) return;
|
|
1066
|
+
if (!delivering) {
|
|
1067
|
+
observer.observe(target, { box: "border-box" });
|
|
1068
|
+
return;
|
|
1069
|
+
}
|
|
1070
|
+
pendingObservations.add(target);
|
|
1071
|
+
if (!observeQueued) {
|
|
1072
|
+
observeQueued = true;
|
|
1073
|
+
_frames == null ? void 0 : _frames.schedule(() => {
|
|
1074
|
+
observeQueued = false;
|
|
1075
|
+
pendingObservations.forEach((node) => {
|
|
1076
|
+
if (node.isConnected) _ro == null ? void 0 : _ro.observe(node, { box: "border-box" });
|
|
1077
|
+
});
|
|
1078
|
+
pendingObservations.clear();
|
|
1079
|
+
});
|
|
1080
|
+
}
|
|
1081
|
+
},
|
|
1082
|
+
unobserve: (target) => {
|
|
1083
|
+
var _a;
|
|
1084
|
+
pendingObservations.delete(target);
|
|
1085
|
+
(_a = get()) == null ? void 0 : _a.unobserve(target);
|
|
1086
|
+
}
|
|
1087
|
+
};
|
|
1088
|
+
})();
|
|
1089
|
+
this.range = null;
|
|
1090
|
+
this.setOptions = (opts2) => {
|
|
1091
|
+
var _a;
|
|
1092
|
+
const merged = {
|
|
1093
|
+
debug: false,
|
|
1094
|
+
initialOffset: 0,
|
|
1095
|
+
overscan: 1,
|
|
1096
|
+
paddingStart: 0,
|
|
1097
|
+
paddingEnd: 0,
|
|
1098
|
+
scrollPaddingStart: 0,
|
|
1099
|
+
scrollPaddingEnd: 0,
|
|
1100
|
+
horizontal: false,
|
|
1101
|
+
getItemKey: defaultKeyExtractor,
|
|
1102
|
+
rangeExtractor: defaultRangeExtractor,
|
|
1103
|
+
onChange: () => {
|
|
1104
|
+
},
|
|
1105
|
+
measureElement,
|
|
1106
|
+
initialRect: { width: 0, height: 0 },
|
|
1107
|
+
scrollMargin: 0,
|
|
1108
|
+
gap: 0,
|
|
1109
|
+
indexAttribute: "data-index",
|
|
1110
|
+
initialMeasurementsCache: [],
|
|
1111
|
+
lanes: 1,
|
|
1112
|
+
anchorTo: "start",
|
|
1113
|
+
followOnAppend: false,
|
|
1114
|
+
scrollEndThreshold: 1,
|
|
1115
|
+
isScrollingResetDelay: 150,
|
|
1116
|
+
enabled: true,
|
|
1117
|
+
isRtl: false,
|
|
1118
|
+
useScrollendEvent: false,
|
|
1119
|
+
useAnimationFrameWithResizeObserver: false,
|
|
1120
|
+
laneAssignmentMode: "estimate",
|
|
1121
|
+
useCachedMeasurements: false
|
|
1122
|
+
};
|
|
1123
|
+
for (const key in opts2) {
|
|
1124
|
+
const v3 = opts2[key];
|
|
1125
|
+
if (v3 !== void 0) merged[key] = v3;
|
|
1126
|
+
}
|
|
1127
|
+
const prevOptions = this.options;
|
|
1128
|
+
let anchor = null;
|
|
1129
|
+
let followOnAppend = null;
|
|
1130
|
+
let edgeKeysChanged = false;
|
|
1131
|
+
if (prevOptions !== void 0 && prevOptions.enabled && merged.enabled && merged.anchorTo === "end" && this.scrollElement !== null) {
|
|
1132
|
+
const prevCount = prevOptions.count;
|
|
1133
|
+
const nextCount = merged.count;
|
|
1134
|
+
const measurements = this.getMeasurements();
|
|
1135
|
+
const previousItems = ((_a = this._singleLaneMeasurements) == null ? void 0 : _a.items) ?? measurements;
|
|
1136
|
+
const getPreviousKey = (index) => getMeasurementKey(previousItems[index]);
|
|
1137
|
+
const prevFirstKey = prevCount > 0 ? getPreviousKey(0) : null;
|
|
1138
|
+
const prevLastKey = prevCount > 0 ? getPreviousKey(prevCount - 1) : null;
|
|
1139
|
+
const didCountChange = nextCount !== prevCount;
|
|
1140
|
+
const didEdgeKeysChange = didCountChange || prevCount > 0 && nextCount > 0 && (merged.getItemKey(0) !== prevFirstKey || merged.getItemKey(nextCount - 1) !== prevLastKey);
|
|
1141
|
+
if (didEdgeKeysChange) {
|
|
1142
|
+
edgeKeysChanged = true;
|
|
1143
|
+
const item = prevCount > 0 ? this.getVirtualItemForOffset(this.getScrollOffset()) ?? measurements[0] : null;
|
|
1144
|
+
if (item) {
|
|
1145
|
+
anchor = [item.key, this.getScrollOffset() - item.start];
|
|
1146
|
+
}
|
|
1147
|
+
const behavior = merged.followOnAppend === true ? "auto" : merged.followOnAppend || null;
|
|
1148
|
+
if (behavior && nextCount > 0 && this.isAtEnd(prevOptions.scrollEndThreshold) && (prevCount === 0 || merged.getItemKey(nextCount - 1) !== prevLastKey)) {
|
|
1149
|
+
if (nextCount > prevCount || isAppendWithTrim(
|
|
1150
|
+
prevCount,
|
|
1151
|
+
nextCount,
|
|
1152
|
+
getPreviousKey,
|
|
1153
|
+
merged.getItemKey
|
|
1154
|
+
)) {
|
|
1155
|
+
followOnAppend = behavior;
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
this.options = merged;
|
|
1161
|
+
if (edgeKeysChanged) {
|
|
1162
|
+
this.pendingMin = 0;
|
|
1163
|
+
this.itemSizeCacheVersion++;
|
|
1164
|
+
}
|
|
1165
|
+
let anchorDelta = null;
|
|
1166
|
+
if (anchor && this.scrollOffset !== null && !this._awaitingCommandReadBack()) {
|
|
1167
|
+
const [anchorKey, anchorOffset] = anchor;
|
|
1168
|
+
const newMeasurements = this.getMeasurements();
|
|
1169
|
+
const { count, getItemKey } = this.options;
|
|
1170
|
+
let idx = 0;
|
|
1171
|
+
while (idx < count && getItemKey(idx) !== anchorKey) {
|
|
1172
|
+
idx++;
|
|
1173
|
+
}
|
|
1174
|
+
if (idx < count) {
|
|
1175
|
+
const anchorItem = newMeasurements[idx];
|
|
1176
|
+
if (anchorItem) {
|
|
1177
|
+
const newOffset = Math.max(0, anchorItem.start + anchorOffset);
|
|
1178
|
+
if (!followOnAppend && newOffset !== this.scrollOffset) {
|
|
1179
|
+
anchorDelta = newOffset - this.scrollOffset;
|
|
1180
|
+
this.scrollOffset = newOffset;
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
if (followOnAppend) {
|
|
1186
|
+
this.pendingScrollAnchor = { kind: "follow", behavior: followOnAppend };
|
|
1187
|
+
} else if (anchorDelta !== null) {
|
|
1188
|
+
if (this._canWriteScroll()) {
|
|
1189
|
+
this.pendingScrollAnchor = { kind: "anchor", delta: anchorDelta };
|
|
1190
|
+
} else {
|
|
1191
|
+
this._holdOffset += anchorDelta;
|
|
1192
|
+
this._followOffsetTarget(anchorDelta);
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
};
|
|
1196
|
+
this.notify = (sync) => {
|
|
1197
|
+
var _a, _b;
|
|
1198
|
+
(_b = (_a = this.options).onChange) == null ? void 0 : _b.call(_a, this, sync);
|
|
1199
|
+
};
|
|
1200
|
+
this.maybeNotify = memo(
|
|
1201
|
+
() => {
|
|
1202
|
+
this.calculateRange();
|
|
1203
|
+
return [
|
|
1204
|
+
this.isScrolling,
|
|
1205
|
+
this.range ? this.range.startIndex : null,
|
|
1206
|
+
this.range ? this.range.endIndex : null
|
|
1207
|
+
];
|
|
1208
|
+
},
|
|
1209
|
+
(isScrolling) => {
|
|
1210
|
+
this.notify(isScrolling);
|
|
1211
|
+
},
|
|
1212
|
+
{
|
|
1213
|
+
key: "maybeNotify",
|
|
1214
|
+
debug: () => this.options.debug,
|
|
1215
|
+
initialDeps: [
|
|
1216
|
+
this.isScrolling,
|
|
1217
|
+
this.range ? this.range.startIndex : null,
|
|
1218
|
+
this.range ? this.range.endIndex : null
|
|
1219
|
+
]
|
|
1220
|
+
}
|
|
1221
|
+
);
|
|
1222
|
+
this.cleanup = () => {
|
|
1223
|
+
var _a;
|
|
1224
|
+
this.unsubs.filter(Boolean).forEach((d2) => d2());
|
|
1225
|
+
this.unsubs = [];
|
|
1226
|
+
this.observer.disconnect();
|
|
1227
|
+
if (this.rafId != null && this.targetWindow) {
|
|
1228
|
+
this.targetWindow.cancelAnimationFrame(this.rafId);
|
|
1229
|
+
this.rafId = null;
|
|
1230
|
+
}
|
|
1231
|
+
this.scrollState = null;
|
|
1232
|
+
(_a = this._momentumStop) == null ? void 0 : _a.restore();
|
|
1233
|
+
this._momentumStop = null;
|
|
1234
|
+
this.isScrolling = false;
|
|
1235
|
+
this.scrollDirection = null;
|
|
1236
|
+
this._holdOffset = 0;
|
|
1237
|
+
this._reportedOverscroll = false;
|
|
1238
|
+
this._clampedAdjustment = null;
|
|
1239
|
+
this.pendingWrite = null;
|
|
1240
|
+
this.scrollElement = null;
|
|
1241
|
+
this.targetWindow = null;
|
|
1242
|
+
};
|
|
1243
|
+
this._didMount = () => {
|
|
1244
|
+
return () => {
|
|
1245
|
+
this.cleanup();
|
|
1246
|
+
};
|
|
1247
|
+
};
|
|
1248
|
+
this._willUpdate = () => {
|
|
1249
|
+
var _a;
|
|
1250
|
+
const scrollElement = this.options.enabled ? this.options.getScrollElement() : null;
|
|
1251
|
+
if (this.scrollElement !== scrollElement) {
|
|
1252
|
+
this.cleanup();
|
|
1253
|
+
if (!scrollElement) {
|
|
1254
|
+
this.maybeNotify();
|
|
1255
|
+
return;
|
|
1256
|
+
}
|
|
1257
|
+
this.scrollElement = scrollElement;
|
|
1258
|
+
if (this.scrollElement && "ownerDocument" in this.scrollElement) {
|
|
1259
|
+
this.targetWindow = this.scrollElement.ownerDocument.defaultView;
|
|
1260
|
+
} else {
|
|
1261
|
+
this.targetWindow = ((_a = this.scrollElement) == null ? void 0 : _a.window) ?? null;
|
|
1262
|
+
}
|
|
1263
|
+
this.elementsCache.forEach((cached) => {
|
|
1264
|
+
this.observer.observe(cached);
|
|
1265
|
+
});
|
|
1266
|
+
this.unsubs.push(
|
|
1267
|
+
this.options.observeElementRect(this, (rect) => {
|
|
1268
|
+
this.scrollRect = rect;
|
|
1269
|
+
this.maybeNotify();
|
|
1270
|
+
})
|
|
1271
|
+
);
|
|
1272
|
+
this.unsubs.push(
|
|
1273
|
+
this.options.observeElementOffset(this, (offset, isScrolling) => {
|
|
1274
|
+
var _a2, _b, _c, _d;
|
|
1275
|
+
const elementMax = isScrolling ? this._elementMaxScrollOffset() : null;
|
|
1276
|
+
const wasOverscrolled = this._reportedOverscroll;
|
|
1277
|
+
this._reportedOverscroll = offset < 0 || elementMax !== null && offset > elementMax + 1;
|
|
1278
|
+
const elementOffset = offset;
|
|
1279
|
+
this._lastElementOffset = elementOffset;
|
|
1280
|
+
offset = this._toLayoutOffset(offset);
|
|
1281
|
+
const kind = this._classifyScrollEvent(
|
|
1282
|
+
offset,
|
|
1283
|
+
isScrolling,
|
|
1284
|
+
elementMax
|
|
1285
|
+
);
|
|
1286
|
+
if (kind === "spurious") return;
|
|
1287
|
+
if (kind === "readBack") {
|
|
1288
|
+
offset = this.pendingWrite.target;
|
|
1289
|
+
} else if (kind === "clampedReadBack" && ((_a2 = this.scrollState) == null ? void 0 : _a2.index) != null && // Not `elementMax`: an adapter can report the read-back at rest.
|
|
1290
|
+
offset < this.getMaxScrollOffset() - 1.5) {
|
|
1291
|
+
this.scrollState.lastTargetOffset = offset;
|
|
1292
|
+
} else if (externalRetiresCommand({
|
|
1293
|
+
kind,
|
|
1294
|
+
offset,
|
|
1295
|
+
command: this.scrollState,
|
|
1296
|
+
target: () => this.getScrollStateTarget(this.scrollState)
|
|
1297
|
+
})) {
|
|
1298
|
+
this.scrollState = null;
|
|
1299
|
+
}
|
|
1300
|
+
this.pendingWrite = null;
|
|
1301
|
+
if (this._clampedAdjustment !== null && Math.abs(offset - this._clampedAdjustment.maxAtWrite) >= 1.5) {
|
|
1302
|
+
this._clampedAdjustment = null;
|
|
1303
|
+
}
|
|
1304
|
+
const prevOffset = this.getScrollOffset();
|
|
1305
|
+
const prevDirection = this.scrollDirection;
|
|
1306
|
+
this.scrollDirection = isScrolling ? prevOffset === offset ? this.scrollDirection : prevOffset < offset ? "forward" : "backward" : null;
|
|
1307
|
+
this.scrollOffset = offset;
|
|
1308
|
+
this.isScrolling = isScrolling;
|
|
1309
|
+
const queued = this.scrollState;
|
|
1310
|
+
if ((queued == null ? void 0 : queued.phase) === "queued" && kind === "external" && isScrolling) {
|
|
1311
|
+
if (wasOverscrolled || this._reportedOverscroll) {
|
|
1312
|
+
queued.samples = [];
|
|
1313
|
+
} else {
|
|
1314
|
+
const t = this.now();
|
|
1315
|
+
queued.samples = [
|
|
1316
|
+
...(queued.samples ?? []).filter(
|
|
1317
|
+
(sample) => t - sample.t <= 200
|
|
1318
|
+
),
|
|
1319
|
+
{ t, offset: elementOffset }
|
|
1320
|
+
];
|
|
1321
|
+
if (prevDirection !== null && this.scrollDirection !== prevDirection || flingSpedUp(queued.samples)) {
|
|
1322
|
+
this.scrollState = null;
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
if (this._iosGesture.onScroll({
|
|
1327
|
+
isScrolling,
|
|
1328
|
+
ownReadBack: kind === "readBack",
|
|
1329
|
+
moved: offset !== prevOffset,
|
|
1330
|
+
// Neither our write's read-back nor a frame of our smooth
|
|
1331
|
+
// animation: the user or a fling moved it.
|
|
1332
|
+
external: kind === "external" && ((_b = this.scrollState) == null ? void 0 : _b.phase) !== "smooth" && ((_c = this.scrollState) == null ? void 0 : _c.phase) !== "smoothFinishing"
|
|
1333
|
+
}) && // The user scrolls: a command still waiting for the tail is
|
|
1334
|
+
// theirs to override, like a written one would be.
|
|
1335
|
+
((_d = this.scrollState) == null ? void 0 : _d.phase) === "queued") {
|
|
1336
|
+
this.scrollState = null;
|
|
1337
|
+
}
|
|
1338
|
+
this._flushHoldIfReady(true);
|
|
1339
|
+
if (this.scrollState) {
|
|
1340
|
+
this.scheduleScrollReconcile();
|
|
1341
|
+
}
|
|
1342
|
+
this.maybeNotify();
|
|
1343
|
+
})
|
|
1344
|
+
);
|
|
1345
|
+
if ("addEventListener" in this.scrollElement) {
|
|
1346
|
+
this.unsubs.push(
|
|
1347
|
+
this._iosGesture.listen(this.scrollElement)
|
|
1348
|
+
);
|
|
1349
|
+
}
|
|
1350
|
+
this._scrollToOffset(this.getScrollOffset());
|
|
1351
|
+
}
|
|
1352
|
+
this._noteClampMax();
|
|
1353
|
+
const anchor = this.pendingScrollAnchor;
|
|
1354
|
+
this.pendingScrollAnchor = null;
|
|
1355
|
+
if (anchor && this.scrollElement && this.options.enabled) {
|
|
1356
|
+
if (anchor.kind === "anchor") {
|
|
1357
|
+
if (!this._canWriteScroll()) {
|
|
1358
|
+
this._holdOffset += anchor.delta;
|
|
1359
|
+
this._followOffsetTarget(anchor.delta);
|
|
1360
|
+
this.notify(false);
|
|
1361
|
+
} else if (isSmoothScroll(this.scrollState) && !approxEqual(
|
|
1362
|
+
this.getScrollOffset() - anchor.delta,
|
|
1363
|
+
this.scrollState.lastTargetOffset
|
|
1364
|
+
)) ;
|
|
1365
|
+
else {
|
|
1366
|
+
this._followOffsetTarget(anchor.delta);
|
|
1367
|
+
this._scrollToOffset(this.getScrollOffset());
|
|
1368
|
+
}
|
|
1369
|
+
} else {
|
|
1370
|
+
this.scrollToEnd({ behavior: anchor.behavior });
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1373
|
+
this._flushHoldIfReady(false);
|
|
1374
|
+
this._retryClampedAdjustment();
|
|
1375
|
+
};
|
|
1376
|
+
this._classifyScrollEvent = (offset, isScrolling, elementMax) => {
|
|
1377
|
+
var _a;
|
|
1378
|
+
return classifyScrollEvent({
|
|
1379
|
+
offset,
|
|
1380
|
+
isScrolling,
|
|
1381
|
+
elementMax,
|
|
1382
|
+
holdOffset: this._holdOffset,
|
|
1383
|
+
scrollOffset: this.scrollOffset,
|
|
1384
|
+
pendingWrite: this.pendingWrite,
|
|
1385
|
+
clampedMaxAtWrite: ((_a = this._clampedAdjustment) == null ? void 0 : _a.maxAtWrite) ?? null
|
|
1386
|
+
});
|
|
1387
|
+
};
|
|
1388
|
+
this._retryClampedAdjustment = () => {
|
|
1389
|
+
if (this._clampedAdjustment === null || !this.scrollElement || !this.options.enabled || !this._canWriteScroll()) {
|
|
1390
|
+
return;
|
|
1391
|
+
}
|
|
1392
|
+
const { target, maxAtWrite } = this._clampedAdjustment;
|
|
1393
|
+
const max = this.getMaxScrollOffset();
|
|
1394
|
+
if (max > maxAtWrite + 0.5) {
|
|
1395
|
+
this._clampedAdjustment = target > max + 0.5 ? { target, maxAtWrite: max } : null;
|
|
1396
|
+
this._scrollToOffset(target);
|
|
1397
|
+
}
|
|
1398
|
+
};
|
|
1399
|
+
this._writeAwaitingCommand = () => {
|
|
1400
|
+
const state = this.scrollState;
|
|
1401
|
+
if (state === null || state.phase !== "queued") return;
|
|
1402
|
+
const { behavior } = state;
|
|
1403
|
+
this.getMeasurements();
|
|
1404
|
+
const offset = this.getScrollStateTarget(state);
|
|
1405
|
+
state.lastTargetOffset = offset;
|
|
1406
|
+
this._clampedAdjustment = null;
|
|
1407
|
+
state.phase = initialScrollPhase(
|
|
1408
|
+
behavior,
|
|
1409
|
+
state.index != null && approxEqual(offset, this.getScrollOffset())
|
|
1410
|
+
);
|
|
1411
|
+
this._scrollToOffset(offset, { behavior });
|
|
1412
|
+
this.scheduleScrollReconcile();
|
|
1413
|
+
};
|
|
1414
|
+
this._readElementOffset = () => {
|
|
1415
|
+
const el = this.scrollElement;
|
|
1416
|
+
if (el == null) return null;
|
|
1417
|
+
const { horizontal, isRtl } = this.options;
|
|
1418
|
+
if (typeof el.scrollTop === "number") {
|
|
1419
|
+
return horizontal ? el.scrollLeft * (isRtl && -1 || 1) : el.scrollTop;
|
|
1420
|
+
}
|
|
1421
|
+
if (typeof el.scrollY === "number") {
|
|
1422
|
+
return horizontal ? el.scrollX : el.scrollY;
|
|
1423
|
+
}
|
|
1424
|
+
return null;
|
|
1425
|
+
};
|
|
1426
|
+
this._canWriteScroll = () => !(isIOSWebKit() && this._iosGesture.inMotion()) && !this._reportedOverscroll;
|
|
1427
|
+
this._flushHoldIfReady = (sync) => {
|
|
1428
|
+
var _a;
|
|
1429
|
+
if (this._holdOffset === 0) return;
|
|
1430
|
+
if (!this.scrollElement || !this.options.enabled) return;
|
|
1431
|
+
if (!this._canWriteScroll()) return;
|
|
1432
|
+
if (((_a = this.scrollState) == null ? void 0 : _a.phase) === "smooth") return;
|
|
1433
|
+
this._holdOffset = 0;
|
|
1434
|
+
if (this.scrollOffset !== null && this.scrollOffset < 0) {
|
|
1435
|
+
this.scrollOffset = 0;
|
|
1436
|
+
}
|
|
1437
|
+
this.notify(sync);
|
|
1438
|
+
const target = this.getCommandWrittenOffset() ?? this.getScrollOffset();
|
|
1439
|
+
this._clampedAdjustment = this._clampedBy(target);
|
|
1440
|
+
this._scrollToOffset(target);
|
|
1441
|
+
};
|
|
1442
|
+
this.rafId = null;
|
|
1443
|
+
this.getSize = () => {
|
|
1444
|
+
if (!this.options.enabled) {
|
|
1445
|
+
this.scrollRect = null;
|
|
1446
|
+
return 0;
|
|
1447
|
+
}
|
|
1448
|
+
this.scrollRect = this.scrollRect ?? this.options.initialRect;
|
|
1449
|
+
return this.scrollRect[this.options.horizontal ? "width" : "height"];
|
|
1450
|
+
};
|
|
1451
|
+
this.getScrollOffset = () => {
|
|
1452
|
+
if (!this.options.enabled) {
|
|
1453
|
+
this.scrollOffset = null;
|
|
1454
|
+
return 0;
|
|
1455
|
+
}
|
|
1456
|
+
this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset === "function" ? this.options.initialOffset() : this.options.initialOffset);
|
|
1457
|
+
return this.scrollOffset;
|
|
1458
|
+
};
|
|
1459
|
+
this.getMeasurementOptions = memo(
|
|
1460
|
+
() => [
|
|
1461
|
+
this.options.count,
|
|
1462
|
+
this.options.paddingStart,
|
|
1463
|
+
this.options.scrollMargin,
|
|
1464
|
+
this.options.getItemKey,
|
|
1465
|
+
this.options.enabled,
|
|
1466
|
+
this.options.lanes,
|
|
1467
|
+
this.options.laneAssignmentMode,
|
|
1468
|
+
this.options.gap
|
|
1469
|
+
],
|
|
1470
|
+
(count, paddingStart, scrollMargin, getItemKey, enabled, lanes, laneAssignmentMode, gap) => {
|
|
1471
|
+
const lanesChanged = this.prevLanes !== void 0 && this.prevLanes !== lanes;
|
|
1472
|
+
if (lanesChanged) {
|
|
1473
|
+
this.lanesChangedFlag = true;
|
|
1474
|
+
}
|
|
1475
|
+
this.prevLanes = lanes;
|
|
1476
|
+
this.pendingMin = null;
|
|
1477
|
+
return {
|
|
1478
|
+
count,
|
|
1479
|
+
paddingStart,
|
|
1480
|
+
scrollMargin,
|
|
1481
|
+
getItemKey,
|
|
1482
|
+
enabled,
|
|
1483
|
+
lanes,
|
|
1484
|
+
laneAssignmentMode,
|
|
1485
|
+
gap
|
|
1486
|
+
};
|
|
1487
|
+
},
|
|
1488
|
+
{
|
|
1489
|
+
key: false
|
|
1490
|
+
}
|
|
1491
|
+
);
|
|
1492
|
+
this.isIndexInRange = (index) => index >= 0 && index < this.options.count;
|
|
1493
|
+
this.getMeasurements = memo(
|
|
1494
|
+
() => [this.getMeasurementOptions(), this.itemSizeCacheVersion],
|
|
1495
|
+
({
|
|
1496
|
+
count,
|
|
1497
|
+
paddingStart,
|
|
1498
|
+
scrollMargin,
|
|
1499
|
+
getItemKey,
|
|
1500
|
+
enabled,
|
|
1501
|
+
lanes,
|
|
1502
|
+
laneAssignmentMode,
|
|
1503
|
+
gap
|
|
1504
|
+
}, _itemSizeCacheVersion) => {
|
|
1505
|
+
var _a;
|
|
1506
|
+
const itemSizeCache = this.itemSizeCache;
|
|
1507
|
+
if (!enabled) {
|
|
1508
|
+
this.measurementsCache = [];
|
|
1509
|
+
this._singleLaneMeasurements = null;
|
|
1510
|
+
this.itemSizeCache.clear();
|
|
1511
|
+
this.laneAssignments.clear();
|
|
1512
|
+
return [];
|
|
1513
|
+
}
|
|
1514
|
+
if (this.laneAssignments.size > count) {
|
|
1515
|
+
for (const index of this.laneAssignments.keys()) {
|
|
1516
|
+
if (index >= count) {
|
|
1517
|
+
this.laneAssignments.delete(index);
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
if (this.lanesChangedFlag) {
|
|
1522
|
+
this.lanesChangedFlag = false;
|
|
1523
|
+
this.lanesSettling = true;
|
|
1524
|
+
this.measurementsCache = [];
|
|
1525
|
+
this._singleLaneMeasurements = null;
|
|
1526
|
+
this.itemSizeCache.clear();
|
|
1527
|
+
this.laneAssignments.clear();
|
|
1528
|
+
this.pendingMin = null;
|
|
1529
|
+
}
|
|
1530
|
+
if (this.measurementsCache.length === 0 && !this.lanesSettling) {
|
|
1531
|
+
this.measurementsCache = this.options.initialMeasurementsCache;
|
|
1532
|
+
this.measurementsCache.forEach((item) => {
|
|
1533
|
+
this.itemSizeCache.set(item.key, item.size);
|
|
1534
|
+
});
|
|
1535
|
+
}
|
|
1536
|
+
const min = this.lanesSettling ? 0 : this.pendingMin ?? 0;
|
|
1537
|
+
this.pendingMin = null;
|
|
1538
|
+
if (this.lanesSettling && this.measurementsCache.length === count) {
|
|
1539
|
+
this.lanesSettling = false;
|
|
1540
|
+
}
|
|
1541
|
+
if (lanes === 1) {
|
|
1542
|
+
const need = count * 2;
|
|
1543
|
+
let flat = (_a = this._singleLaneMeasurements) == null ? void 0 : _a.flat;
|
|
1544
|
+
if (!flat || flat.length < need) {
|
|
1545
|
+
const next = new Float64Array(need);
|
|
1546
|
+
if (flat && min > 0) next.set(flat.subarray(0, min * 2));
|
|
1547
|
+
flat = next;
|
|
1548
|
+
}
|
|
1549
|
+
const items = min === 0 ? new Array(count) : this._singleLaneMeasurements.items.slice();
|
|
1550
|
+
let runningStart;
|
|
1551
|
+
if (min === 0) {
|
|
1552
|
+
runningStart = paddingStart + scrollMargin;
|
|
1553
|
+
} else {
|
|
1554
|
+
const prevIdx = min - 1;
|
|
1555
|
+
runningStart = flat[prevIdx * 2] + flat[prevIdx * 2 + 1] + gap;
|
|
1556
|
+
}
|
|
1557
|
+
for (let i2 = min; i2 < count; i2++) {
|
|
1558
|
+
const key = getItemKey(i2);
|
|
1559
|
+
items[i2] = key;
|
|
1560
|
+
const measuredSize = itemSizeCache.get(key);
|
|
1561
|
+
const size = typeof measuredSize === "number" ? measuredSize : this.options.estimateSize(i2);
|
|
1562
|
+
flat[i2 * 2] = runningStart;
|
|
1563
|
+
flat[i2 * 2 + 1] = size;
|
|
1564
|
+
runningStart += size + gap;
|
|
1565
|
+
}
|
|
1566
|
+
this._singleLaneMeasurements = { flat, items };
|
|
1567
|
+
const view = createLazyMeasurementsView(items, flat);
|
|
1568
|
+
this.measurementsCache = view;
|
|
1569
|
+
return view;
|
|
1570
|
+
}
|
|
1571
|
+
const measurements = this.measurementsCache.slice(0, min);
|
|
1572
|
+
const laneLastIndex = new Array(lanes).fill(
|
|
1573
|
+
void 0
|
|
1574
|
+
);
|
|
1575
|
+
const laneEnds = new Float64Array(lanes);
|
|
1576
|
+
let filledLanes = 0;
|
|
1577
|
+
for (let m3 = 0; m3 < min; m3++) {
|
|
1578
|
+
const item = measurements[m3];
|
|
1579
|
+
if (item) {
|
|
1580
|
+
if (laneLastIndex[item.lane] === void 0) filledLanes++;
|
|
1581
|
+
laneLastIndex[item.lane] = m3;
|
|
1582
|
+
laneEnds[item.lane] = item.end;
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
for (let i2 = min; i2 < count; i2++) {
|
|
1586
|
+
const key = getItemKey(i2);
|
|
1587
|
+
const cachedLane = this.laneAssignments.get(i2);
|
|
1588
|
+
let lane;
|
|
1589
|
+
let start;
|
|
1590
|
+
const shouldCacheLane = laneAssignmentMode === "estimate" || itemSizeCache.has(key);
|
|
1591
|
+
if (cachedLane !== void 0 && this.options.lanes > 1) {
|
|
1592
|
+
lane = cachedLane;
|
|
1593
|
+
const prevIndex = laneLastIndex[lane];
|
|
1594
|
+
const prevInLane = prevIndex !== void 0 ? measurements[prevIndex] : void 0;
|
|
1595
|
+
start = prevInLane ? prevInLane.end + gap : paddingStart + scrollMargin;
|
|
1596
|
+
} else if (filledLanes === lanes) {
|
|
1597
|
+
let bestLane = 0;
|
|
1598
|
+
let bestEnd = laneEnds[0];
|
|
1599
|
+
let bestIdx = laneLastIndex[0];
|
|
1600
|
+
for (let l4 = 1; l4 < lanes; l4++) {
|
|
1601
|
+
const e2 = laneEnds[l4];
|
|
1602
|
+
if (e2 < bestEnd || e2 === bestEnd && laneLastIndex[l4] < bestIdx) {
|
|
1603
|
+
bestLane = l4;
|
|
1604
|
+
bestEnd = e2;
|
|
1605
|
+
bestIdx = laneLastIndex[l4];
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
lane = bestLane;
|
|
1609
|
+
start = bestEnd + gap;
|
|
1610
|
+
if (shouldCacheLane) {
|
|
1611
|
+
this.laneAssignments.set(i2, lane);
|
|
1612
|
+
}
|
|
1613
|
+
} else {
|
|
1614
|
+
lane = i2 % this.options.lanes;
|
|
1615
|
+
start = paddingStart + scrollMargin;
|
|
1616
|
+
if (shouldCacheLane) {
|
|
1617
|
+
this.laneAssignments.set(i2, lane);
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1620
|
+
const measuredSize = itemSizeCache.get(key);
|
|
1621
|
+
const size = typeof measuredSize === "number" ? measuredSize : this.options.estimateSize(i2);
|
|
1622
|
+
const end = start + size;
|
|
1623
|
+
measurements[i2] = {
|
|
1624
|
+
index: i2,
|
|
1625
|
+
start,
|
|
1626
|
+
size,
|
|
1627
|
+
end,
|
|
1628
|
+
key,
|
|
1629
|
+
lane
|
|
1630
|
+
};
|
|
1631
|
+
if (laneLastIndex[lane] === void 0) filledLanes++;
|
|
1632
|
+
laneLastIndex[lane] = i2;
|
|
1633
|
+
laneEnds[lane] = end;
|
|
1634
|
+
}
|
|
1635
|
+
this.measurementsCache = measurements;
|
|
1636
|
+
return measurements;
|
|
1637
|
+
},
|
|
1638
|
+
{
|
|
1639
|
+
key: "getMeasurements",
|
|
1640
|
+
debug: () => this.options.debug
|
|
1641
|
+
}
|
|
1642
|
+
);
|
|
1643
|
+
this.calculateRange = memo(
|
|
1644
|
+
() => [
|
|
1645
|
+
this.getMeasurements(),
|
|
1646
|
+
this.getSize(),
|
|
1647
|
+
this.getScrollOffset(),
|
|
1648
|
+
this.options.lanes,
|
|
1649
|
+
// scrollOffset is measured in the scroll element and the layout total
|
|
1650
|
+
// from the list start, so the list ends scrollMargin further down.
|
|
1651
|
+
this._getLayoutTotalSize() + this.options.scrollMargin
|
|
1652
|
+
],
|
|
1653
|
+
(measurements, outerSize, scrollOffset, lanes, listEnd) => {
|
|
1654
|
+
if (measurements.length === 0 || outerSize === 0) {
|
|
1655
|
+
this.range = null;
|
|
1656
|
+
return null;
|
|
1657
|
+
}
|
|
1658
|
+
const maxScrollOffset = Math.max(listEnd - outerSize, 0);
|
|
1659
|
+
this.range = calculateRangeImpl(
|
|
1660
|
+
measurements,
|
|
1661
|
+
outerSize,
|
|
1662
|
+
Math.min(scrollOffset, maxScrollOffset),
|
|
1663
|
+
lanes,
|
|
1664
|
+
// Pass the typed array so binary search + forward-walk can read
|
|
1665
|
+
// start/end directly from Float64Array, skipping the Proxy traps.
|
|
1666
|
+
lanes === 1 && this._singleLaneMeasurements !== null ? this._singleLaneMeasurements.flat : null
|
|
1667
|
+
);
|
|
1668
|
+
return this.range;
|
|
1669
|
+
},
|
|
1670
|
+
{
|
|
1671
|
+
key: "calculateRange",
|
|
1672
|
+
debug: () => this.options.debug
|
|
1673
|
+
}
|
|
1674
|
+
);
|
|
1675
|
+
this.getVirtualIndexes = memo(
|
|
1676
|
+
() => {
|
|
1677
|
+
let startIndex = null;
|
|
1678
|
+
let endIndex = null;
|
|
1679
|
+
const range = this.calculateRange();
|
|
1680
|
+
if (range) {
|
|
1681
|
+
startIndex = range.startIndex;
|
|
1682
|
+
endIndex = range.endIndex;
|
|
1683
|
+
}
|
|
1684
|
+
this.maybeNotify.updateDeps([this.isScrolling, startIndex, endIndex]);
|
|
1685
|
+
return [
|
|
1686
|
+
this.options.rangeExtractor,
|
|
1687
|
+
this.options.overscan,
|
|
1688
|
+
this.options.count,
|
|
1689
|
+
startIndex,
|
|
1690
|
+
endIndex,
|
|
1691
|
+
this.options.lanes
|
|
1692
|
+
];
|
|
1693
|
+
},
|
|
1694
|
+
(rangeExtractor, overscan, count, startIndex, endIndex, lanes) => {
|
|
1695
|
+
return startIndex === null || endIndex === null ? [] : rangeExtractor({
|
|
1696
|
+
startIndex,
|
|
1697
|
+
endIndex,
|
|
1698
|
+
overscan,
|
|
1699
|
+
count,
|
|
1700
|
+
lanes
|
|
1701
|
+
});
|
|
1702
|
+
},
|
|
1703
|
+
{
|
|
1704
|
+
key: "getVirtualIndexes",
|
|
1705
|
+
debug: () => this.options.debug
|
|
1706
|
+
}
|
|
1707
|
+
);
|
|
1708
|
+
this.indexFromElement = (node) => {
|
|
1709
|
+
const attributeName = this.options.indexAttribute;
|
|
1710
|
+
const indexStr = node.getAttribute(attributeName);
|
|
1711
|
+
if (!indexStr) {
|
|
1712
|
+
console.warn(
|
|
1713
|
+
`Missing attribute name '${attributeName}={index}' on measured element.`
|
|
1714
|
+
);
|
|
1715
|
+
return -1;
|
|
1716
|
+
}
|
|
1717
|
+
return parseInt(indexStr, 10);
|
|
1718
|
+
};
|
|
1719
|
+
this.shouldMeasureDuringScroll = (index) => {
|
|
1720
|
+
var _a;
|
|
1721
|
+
if (!isSmoothScroll(this.scrollState)) {
|
|
1722
|
+
return true;
|
|
1723
|
+
}
|
|
1724
|
+
const scrollIndex = this.scrollState.index ?? ((_a = this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)) == null ? void 0 : _a.index);
|
|
1725
|
+
if (scrollIndex !== void 0 && this.range) {
|
|
1726
|
+
const bufferSize = Math.max(
|
|
1727
|
+
this.options.overscan,
|
|
1728
|
+
Math.ceil((this.range.endIndex - this.range.startIndex) / 2)
|
|
1729
|
+
);
|
|
1730
|
+
const minIndex = Math.max(0, scrollIndex - bufferSize);
|
|
1731
|
+
const maxIndex = Math.min(
|
|
1732
|
+
this.options.count - 1,
|
|
1733
|
+
scrollIndex + bufferSize
|
|
1734
|
+
);
|
|
1735
|
+
return index >= minIndex && index <= maxIndex;
|
|
1736
|
+
}
|
|
1737
|
+
return true;
|
|
1738
|
+
};
|
|
1739
|
+
this.measureElement = (node) => {
|
|
1740
|
+
if (!node) {
|
|
1741
|
+
this.elementsCache.forEach((cached, key2) => {
|
|
1742
|
+
if (!cached.isConnected) {
|
|
1743
|
+
this.observer.unobserve(cached);
|
|
1744
|
+
this.elementsCache.delete(key2);
|
|
1745
|
+
}
|
|
1746
|
+
});
|
|
1747
|
+
return;
|
|
1748
|
+
}
|
|
1749
|
+
const index = this.indexFromElement(node);
|
|
1750
|
+
if (!this.isIndexInRange(index)) return;
|
|
1751
|
+
const key = this.options.getItemKey(index);
|
|
1752
|
+
const prevNode = this.elementsCache.get(key);
|
|
1753
|
+
if (prevNode !== node) {
|
|
1754
|
+
if (prevNode) {
|
|
1755
|
+
this.observer.unobserve(prevNode);
|
|
1756
|
+
}
|
|
1757
|
+
this.observer.observe(node);
|
|
1758
|
+
this.elementsCache.set(key, node);
|
|
1759
|
+
}
|
|
1760
|
+
if (node.isConnected && (!this.isScrolling || this.scrollState) && this.shouldMeasureDuringScroll(index)) {
|
|
1761
|
+
this.resizeItem(index, this.options.measureElement(node, void 0, this));
|
|
1762
|
+
}
|
|
1763
|
+
};
|
|
1764
|
+
this.resizeItem = (index, size) => {
|
|
1765
|
+
var _a, _b, _c;
|
|
1766
|
+
if (!this.isIndexInRange(index)) return;
|
|
1767
|
+
if ((_a = this._resizeBatch) == null ? void 0 : _a.sync) this.getMeasurements();
|
|
1768
|
+
let cachedSize;
|
|
1769
|
+
let itemStart;
|
|
1770
|
+
let key;
|
|
1771
|
+
const flat = (_b = this._singleLaneMeasurements) == null ? void 0 : _b.flat;
|
|
1772
|
+
if (this.options.lanes === 1 && flat != null) {
|
|
1773
|
+
key = this.options.getItemKey(index);
|
|
1774
|
+
itemStart = flat[index * 2];
|
|
1775
|
+
cachedSize = flat[index * 2 + 1];
|
|
1776
|
+
} else {
|
|
1777
|
+
const item = this.measurementsCache[index];
|
|
1778
|
+
if (!item) return;
|
|
1779
|
+
key = item.key;
|
|
1780
|
+
itemStart = item.start;
|
|
1781
|
+
cachedSize = item.size;
|
|
1782
|
+
}
|
|
1783
|
+
const itemSize = this.itemSizeCache.get(key) ?? cachedSize;
|
|
1784
|
+
const delta = size - itemSize;
|
|
1785
|
+
if (delta !== 0) {
|
|
1786
|
+
const wasAtEnd = this.options.anchorTo === "end" && !isSmoothScroll(this.scrollState) && this.getVirtualDistanceFromEnd() <= this.options.scrollEndThreshold;
|
|
1787
|
+
const prevTotalSize = wasAtEnd ? this._getLayoutTotalSize() : 0;
|
|
1788
|
+
const scrollOffset = this.getScrollOffset();
|
|
1789
|
+
const isFirstMeasure = !this.itemSizeCache.has(key);
|
|
1790
|
+
const defaultShouldAdjust = isFirstMeasure ? (
|
|
1791
|
+
// First measurement: compensate any item whose top sits above the
|
|
1792
|
+
// fold — the estimate→actual delta must be corrected regardless of
|
|
1793
|
+
// scroll direction, since the whole estimated block was above it.
|
|
1794
|
+
itemStart < scrollOffset
|
|
1795
|
+
) : (
|
|
1796
|
+
// Re-measurement: only compensate an item that is ENTIRELY above the
|
|
1797
|
+
// fold. An item that merely *spans* the fold (top above, bottom
|
|
1798
|
+
// below — e.g. a streaming chat message growing at its bottom)
|
|
1799
|
+
// changes size *below* the anchor point, so shifting scrollTop by the
|
|
1800
|
+
// delta would drag the viewport downward on every growth (#1218).
|
|
1801
|
+
// Also skip during backward scroll to avoid the "items jump while
|
|
1802
|
+
// scrolling up" cascade.
|
|
1803
|
+
itemStart + itemSize <= scrollOffset && this.scrollDirection !== "backward"
|
|
1804
|
+
);
|
|
1805
|
+
const shouldAdjustScroll = !isSmoothScroll(this.scrollState) && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(
|
|
1806
|
+
// The callback expects a VirtualItem; build one lazily only
|
|
1807
|
+
// when the consumer actually supplied a custom predicate.
|
|
1808
|
+
this.measurementsCache[index] ?? {
|
|
1809
|
+
index,
|
|
1810
|
+
key,
|
|
1811
|
+
start: itemStart,
|
|
1812
|
+
size: cachedSize,
|
|
1813
|
+
end: itemStart + cachedSize,
|
|
1814
|
+
lane: 0
|
|
1815
|
+
},
|
|
1816
|
+
delta,
|
|
1817
|
+
this
|
|
1818
|
+
) : defaultShouldAdjust);
|
|
1819
|
+
if (this.pendingMin === null || index < this.pendingMin) {
|
|
1820
|
+
this.pendingMin = index;
|
|
1821
|
+
}
|
|
1822
|
+
this.itemSizeCache.set(key, size);
|
|
1823
|
+
this.itemSizeCacheVersion++;
|
|
1824
|
+
let adjustedSync = false;
|
|
1825
|
+
if (!this._awaitingCommandReadBack()) {
|
|
1826
|
+
if (wasAtEnd) {
|
|
1827
|
+
adjustedSync = this.applyScrollAdjustment(
|
|
1828
|
+
this._getLayoutTotalSize() - prevTotalSize
|
|
1829
|
+
);
|
|
1830
|
+
} else if (shouldAdjustScroll) {
|
|
1831
|
+
adjustedSync = this.applyScrollAdjustment(delta);
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
if (this._resizeBatch) {
|
|
1835
|
+
this._resizeBatch.notify = true;
|
|
1836
|
+
(_c = this._resizeBatch).sync || (_c.sync = adjustedSync);
|
|
1837
|
+
return;
|
|
1838
|
+
}
|
|
1839
|
+
this.notify(adjustedSync);
|
|
1840
|
+
this._noteClampMax();
|
|
1841
|
+
this._flushHoldIfReady(true);
|
|
1842
|
+
this._retryClampedAdjustment();
|
|
1843
|
+
}
|
|
1844
|
+
};
|
|
1845
|
+
this.getVirtualItems = memo(
|
|
1846
|
+
() => [this.getVirtualIndexes(), this.getMeasurements(), this._holdOffset],
|
|
1847
|
+
(indexes, measurements, hold) => {
|
|
1848
|
+
const virtualItems = [];
|
|
1849
|
+
for (let k4 = 0, len = indexes.length; k4 < len; k4++) {
|
|
1850
|
+
const i2 = indexes[k4];
|
|
1851
|
+
const measurement = measurements[i2];
|
|
1852
|
+
virtualItems.push(
|
|
1853
|
+
hold === 0 ? measurement : {
|
|
1854
|
+
...measurement,
|
|
1855
|
+
start: measurement.start - hold,
|
|
1856
|
+
end: measurement.end - hold
|
|
1857
|
+
}
|
|
1858
|
+
);
|
|
1859
|
+
}
|
|
1860
|
+
return virtualItems;
|
|
1861
|
+
},
|
|
1862
|
+
{
|
|
1863
|
+
key: "getVirtualItems",
|
|
1864
|
+
debug: () => this.options.debug
|
|
1865
|
+
}
|
|
1866
|
+
);
|
|
1867
|
+
this.getVirtualItemForOffset = (offset) => {
|
|
1868
|
+
var _a;
|
|
1869
|
+
const measurements = this.getMeasurements();
|
|
1870
|
+
if (measurements.length === 0) {
|
|
1871
|
+
return void 0;
|
|
1872
|
+
}
|
|
1873
|
+
const flat = (_a = this._singleLaneMeasurements) == null ? void 0 : _a.flat;
|
|
1874
|
+
const useFlat = this.options.lanes === 1 && flat != null;
|
|
1875
|
+
const idx = findNearestBinarySearch(
|
|
1876
|
+
0,
|
|
1877
|
+
measurements.length - 1,
|
|
1878
|
+
useFlat ? (i2) => flat[i2 * 2] : (i2) => notUndefined(measurements[i2]).start,
|
|
1879
|
+
offset
|
|
1880
|
+
);
|
|
1881
|
+
return notUndefined(measurements[idx]);
|
|
1882
|
+
};
|
|
1883
|
+
this._noteClampMax = () => {
|
|
1884
|
+
if (!this._awaitingCommandReadBack()) return;
|
|
1885
|
+
const elementMax = this._elementMaxScrollOffset();
|
|
1886
|
+
if (elementMax === null) return;
|
|
1887
|
+
const write = this.pendingWrite;
|
|
1888
|
+
const max = Math.max(elementMax, 0) + this._holdOffset;
|
|
1889
|
+
if (max >= write.target) return;
|
|
1890
|
+
const lowMaxes = write.lowMaxes ?? (write.lowMaxes = []);
|
|
1891
|
+
if (lowMaxes[lowMaxes.length - 1] !== max) lowMaxes.push(max);
|
|
1892
|
+
};
|
|
1893
|
+
this.getMaxScrollOffset = () => (this._elementMaxScrollOffset() ?? 0) + this._holdOffset;
|
|
1894
|
+
this._toLayoutOffset = (elementOffset) => {
|
|
1895
|
+
var _a;
|
|
1896
|
+
let offset = elementOffset + this._holdOffset;
|
|
1897
|
+
if (((_a = this.pendingScrollAnchor) == null ? void 0 : _a.kind) === "anchor") {
|
|
1898
|
+
offset += this.pendingScrollAnchor.delta;
|
|
1899
|
+
}
|
|
1900
|
+
return offset;
|
|
1901
|
+
};
|
|
1902
|
+
this._elementMaxScrollOffset = () => {
|
|
1903
|
+
const el = this.scrollElement;
|
|
1904
|
+
if (el === null) return null;
|
|
1905
|
+
if ("scrollHeight" in el) {
|
|
1906
|
+
return this.options.horizontal ? el.scrollWidth - el.clientWidth : el.scrollHeight - el.clientHeight;
|
|
1907
|
+
}
|
|
1908
|
+
if ("document" in el) {
|
|
1909
|
+
const doc = el.document.documentElement;
|
|
1910
|
+
return this.options.horizontal ? doc.scrollWidth - el.innerWidth : doc.scrollHeight - el.innerHeight;
|
|
1911
|
+
}
|
|
1912
|
+
return null;
|
|
1913
|
+
};
|
|
1914
|
+
this._momentumStop = null;
|
|
1915
|
+
this._stopMomentum = (done) => {
|
|
1916
|
+
const el = this.scrollElement;
|
|
1917
|
+
const win = this.targetWindow;
|
|
1918
|
+
if (el === null || win === null) return;
|
|
1919
|
+
const scroller = "document" in el ? el.document.scrollingElement : el;
|
|
1920
|
+
if (!(scroller == null ? void 0 : scroller.style)) return;
|
|
1921
|
+
if (this._momentumStop) {
|
|
1922
|
+
this._momentumStop.done = done;
|
|
1923
|
+
return;
|
|
1924
|
+
}
|
|
1925
|
+
const { style } = scroller;
|
|
1926
|
+
const property = this.options.horizontal ? "overflow-x" : "overflow-y";
|
|
1927
|
+
const value = style.getPropertyValue(property);
|
|
1928
|
+
const priority = style.getPropertyPriority(property);
|
|
1929
|
+
const crossSize = () => this.options.horizontal ? scroller.clientHeight : scroller.clientWidth;
|
|
1930
|
+
const crossSizeBefore = crossSize();
|
|
1931
|
+
style.setProperty(property, "hidden", "important");
|
|
1932
|
+
if (crossSize() !== crossSizeBefore) {
|
|
1933
|
+
style.setProperty(property, value, priority);
|
|
1934
|
+
return;
|
|
1935
|
+
}
|
|
1936
|
+
const stop = {
|
|
1937
|
+
// False when the app replaced the hidden value: the fling may not
|
|
1938
|
+
// have stopped.
|
|
1939
|
+
restore: () => {
|
|
1940
|
+
if (style.getPropertyValue(property) !== "hidden" || style.getPropertyPriority(property) !== "important") {
|
|
1941
|
+
return false;
|
|
1942
|
+
}
|
|
1943
|
+
style.setProperty(property, value, priority);
|
|
1944
|
+
return true;
|
|
1945
|
+
},
|
|
1946
|
+
done
|
|
1947
|
+
};
|
|
1948
|
+
this._momentumStop = stop;
|
|
1949
|
+
win.requestAnimationFrame(
|
|
1950
|
+
() => win.requestAnimationFrame(() => {
|
|
1951
|
+
if (this._momentumStop !== stop) return;
|
|
1952
|
+
this._momentumStop = null;
|
|
1953
|
+
if (stop.restore()) stop.done();
|
|
1954
|
+
})
|
|
1955
|
+
);
|
|
1956
|
+
};
|
|
1957
|
+
this._clampedBy = (target) => {
|
|
1958
|
+
const elementMax = this._elementMaxScrollOffset();
|
|
1959
|
+
if (elementMax === null) return null;
|
|
1960
|
+
const maxAtWrite = elementMax + this._holdOffset;
|
|
1961
|
+
return target > maxAtWrite + 0.5 ? { target, maxAtWrite } : null;
|
|
1962
|
+
};
|
|
1963
|
+
this.getVirtualDistanceFromEnd = () => {
|
|
1964
|
+
return Math.max(
|
|
1965
|
+
this._getLayoutTotalSize() + this.options.scrollMargin - this.getSize() - this.getScrollOffset(),
|
|
1966
|
+
0
|
|
1967
|
+
);
|
|
1968
|
+
};
|
|
1969
|
+
this.getDistanceFromEnd = () => {
|
|
1970
|
+
return Math.max(this.getMaxScrollOffset() - this.getScrollOffset(), 0);
|
|
1971
|
+
};
|
|
1972
|
+
this.isAtEnd = (threshold = this.options.scrollEndThreshold) => {
|
|
1973
|
+
return this.getDistanceFromEnd() <= threshold;
|
|
1974
|
+
};
|
|
1975
|
+
this.getOffsetForAlignment = (toOffset, align, itemSize = 0) => {
|
|
1976
|
+
if (!this.scrollElement) return 0;
|
|
1977
|
+
const size = this.getSize();
|
|
1978
|
+
const scrollOffset = this.getScrollOffset();
|
|
1979
|
+
if (align === "auto") {
|
|
1980
|
+
align = toOffset >= scrollOffset + size ? "end" : "start";
|
|
1981
|
+
}
|
|
1982
|
+
if (align === "center") {
|
|
1983
|
+
toOffset += (itemSize - size) / 2;
|
|
1984
|
+
} else if (align === "end") {
|
|
1985
|
+
toOffset -= size;
|
|
1986
|
+
}
|
|
1987
|
+
const maxOffset = this.getMaxScrollOffset();
|
|
1988
|
+
return Math.max(Math.min(maxOffset, toOffset), 0);
|
|
1989
|
+
};
|
|
1990
|
+
this.getOffsetForIndex = (index, align = "auto") => {
|
|
1991
|
+
index = Math.max(0, Math.min(index, this.options.count - 1));
|
|
1992
|
+
const size = this.getSize();
|
|
1993
|
+
const scrollOffset = this.getScrollOffset();
|
|
1994
|
+
const item = this.getMeasurements()[index];
|
|
1995
|
+
if (!item) return;
|
|
1996
|
+
if (align === "auto") {
|
|
1997
|
+
if (item.end >= scrollOffset + size - this.options.scrollPaddingEnd) {
|
|
1998
|
+
align = "end";
|
|
1999
|
+
} else if (item.start <= scrollOffset + this.options.scrollPaddingStart) {
|
|
2000
|
+
align = "start";
|
|
2001
|
+
} else {
|
|
2002
|
+
return [scrollOffset, align];
|
|
2003
|
+
}
|
|
2004
|
+
}
|
|
2005
|
+
if (align === "end" && index === this.options.count - 1) {
|
|
2006
|
+
const maxOffset = this.getMaxScrollOffset();
|
|
2007
|
+
const toOffset2 = maxOffset - this.options.paddingEnd + this.options.scrollPaddingEnd;
|
|
2008
|
+
return [Math.max(Math.min(toOffset2, maxOffset), 0), align];
|
|
2009
|
+
}
|
|
2010
|
+
const toOffset = align === "end" ? item.end + this.options.scrollPaddingEnd : item.start - this.options.scrollPaddingStart;
|
|
2011
|
+
return [
|
|
2012
|
+
this.getOffsetForAlignment(toOffset, align, item.size),
|
|
2013
|
+
align
|
|
2014
|
+
];
|
|
2015
|
+
};
|
|
2016
|
+
this.scrollToOffset = (toOffset, { align = "start", behavior = "auto" } = {}) => {
|
|
2017
|
+
this._startScroll(
|
|
2018
|
+
{ index: null, align },
|
|
2019
|
+
this.getOffsetForAlignment(toOffset, align),
|
|
2020
|
+
behavior,
|
|
2021
|
+
"absolute"
|
|
2022
|
+
);
|
|
2023
|
+
};
|
|
2024
|
+
this.scrollToIndex = (index, {
|
|
2025
|
+
align: initialAlign = "auto",
|
|
2026
|
+
behavior = "auto"
|
|
2027
|
+
} = {}) => {
|
|
2028
|
+
index = Math.max(0, Math.min(index, this.options.count - 1));
|
|
2029
|
+
const offsetInfo = this.getOffsetForIndex(index, initialAlign);
|
|
2030
|
+
if (!offsetInfo) return;
|
|
2031
|
+
const [offset, align] = offsetInfo;
|
|
2032
|
+
this._startScroll({ index, align }, offset, behavior, "absolute");
|
|
2033
|
+
};
|
|
2034
|
+
this.scrollBy = (delta, { behavior = "auto" } = {}) => {
|
|
2035
|
+
const offset = this.getOffsetForAlignment(
|
|
2036
|
+
(this.getCommandWrittenOffset() ?? this.getScrollOffset()) + delta,
|
|
2037
|
+
"start"
|
|
2038
|
+
);
|
|
2039
|
+
this._startScroll(
|
|
2040
|
+
{ index: null, align: "start" },
|
|
2041
|
+
offset,
|
|
2042
|
+
behavior,
|
|
2043
|
+
"relative"
|
|
2044
|
+
);
|
|
2045
|
+
};
|
|
2046
|
+
this.scrollToEnd = ({ behavior = "auto" } = {}) => {
|
|
2047
|
+
if (this.options.count > 0) {
|
|
2048
|
+
this._startScroll(
|
|
2049
|
+
{ index: this.options.count - 1, align: "end", toEnd: true },
|
|
2050
|
+
Math.max(this.getMaxScrollOffset(), 0),
|
|
2051
|
+
behavior,
|
|
2052
|
+
"absolute"
|
|
2053
|
+
);
|
|
2054
|
+
return;
|
|
2055
|
+
}
|
|
2056
|
+
this.scrollToOffset(Math.max(this.getTotalSize() - this.getSize(), 0), {
|
|
2057
|
+
behavior
|
|
2058
|
+
});
|
|
2059
|
+
};
|
|
2060
|
+
this.cancelScroll = () => {
|
|
2061
|
+
if (this.rafId != null && this.targetWindow) {
|
|
2062
|
+
this.targetWindow.cancelAnimationFrame(this.rafId);
|
|
2063
|
+
this.rafId = null;
|
|
2064
|
+
}
|
|
2065
|
+
this.scrollState = null;
|
|
2066
|
+
};
|
|
2067
|
+
this.getTotalSize = () => Math.max(this._getLayoutTotalSize() - this._holdOffset, 0);
|
|
2068
|
+
this._getLayoutTotalSize = () => {
|
|
2069
|
+
var _a, _b;
|
|
2070
|
+
const measurements = this.getMeasurements();
|
|
2071
|
+
let end;
|
|
2072
|
+
if (measurements.length === 0) {
|
|
2073
|
+
end = this.options.paddingStart;
|
|
2074
|
+
} else if (this.options.lanes === 1) {
|
|
2075
|
+
const lastIdx = measurements.length - 1;
|
|
2076
|
+
const flat = (_a = this._singleLaneMeasurements) == null ? void 0 : _a.flat;
|
|
2077
|
+
if (flat != null) {
|
|
2078
|
+
end = flat[lastIdx * 2] + flat[lastIdx * 2 + 1];
|
|
2079
|
+
} else {
|
|
2080
|
+
end = ((_b = measurements[lastIdx]) == null ? void 0 : _b.end) ?? 0;
|
|
2081
|
+
}
|
|
2082
|
+
} else {
|
|
2083
|
+
const endByLane = Array(this.options.lanes).fill(null);
|
|
2084
|
+
let endIndex = measurements.length - 1;
|
|
2085
|
+
while (endIndex >= 0 && endByLane.some((val) => val === null)) {
|
|
2086
|
+
const item = measurements[endIndex];
|
|
2087
|
+
if (endByLane[item.lane] === null) {
|
|
2088
|
+
endByLane[item.lane] = item.end;
|
|
2089
|
+
}
|
|
2090
|
+
endIndex--;
|
|
2091
|
+
}
|
|
2092
|
+
end = Math.max(...endByLane.filter((val) => val !== null));
|
|
2093
|
+
}
|
|
2094
|
+
return Math.max(
|
|
2095
|
+
end - this.options.scrollMargin + this.options.paddingEnd,
|
|
2096
|
+
0
|
|
2097
|
+
);
|
|
2098
|
+
};
|
|
2099
|
+
this.takeSnapshot = () => {
|
|
2100
|
+
const snapshot = [];
|
|
2101
|
+
if (this.itemSizeCache.size === 0) return snapshot;
|
|
2102
|
+
const m3 = this.getMeasurements();
|
|
2103
|
+
for (const item of m3) {
|
|
2104
|
+
if (item && this.itemSizeCache.has(item.key)) {
|
|
2105
|
+
snapshot.push({
|
|
2106
|
+
index: item.index,
|
|
2107
|
+
key: item.key,
|
|
2108
|
+
start: item.start,
|
|
2109
|
+
size: item.size,
|
|
2110
|
+
end: item.end,
|
|
2111
|
+
lane: item.lane
|
|
2112
|
+
});
|
|
2113
|
+
}
|
|
2114
|
+
}
|
|
2115
|
+
return snapshot;
|
|
2116
|
+
};
|
|
2117
|
+
this._scrollToOffset = (offset, {
|
|
2118
|
+
adjustments,
|
|
2119
|
+
behavior
|
|
2120
|
+
} = {}) => {
|
|
2121
|
+
const write = {
|
|
2122
|
+
target: offset + (adjustments ?? 0),
|
|
2123
|
+
smooth: behavior === "smooth"
|
|
2124
|
+
};
|
|
2125
|
+
this.pendingWrite = write;
|
|
2126
|
+
this.options.scrollToFn(
|
|
2127
|
+
offset - this._holdOffset,
|
|
2128
|
+
{ behavior, adjustments },
|
|
2129
|
+
this
|
|
2130
|
+
);
|
|
2131
|
+
return write;
|
|
2132
|
+
};
|
|
2133
|
+
this.getCommandWrittenOffset = () => this.scrollState !== null && this.pendingWrite !== null && !this.pendingWrite.smooth ? this.pendingWrite.target : null;
|
|
2134
|
+
this._awaitingCommandReadBack = () => {
|
|
2135
|
+
const writtenOffset = this.getCommandWrittenOffset();
|
|
2136
|
+
return !(isIOSWebKit() && this._iosGesture.dragging()) && writtenOffset !== null && !approxEqual(writtenOffset, this.getScrollOffset());
|
|
2137
|
+
};
|
|
2138
|
+
this._followOffsetTarget = (delta) => {
|
|
2139
|
+
if (this.scrollState !== null && this.scrollState.index == null) {
|
|
2140
|
+
this.scrollState.lastTargetOffset += delta;
|
|
2141
|
+
}
|
|
2142
|
+
};
|
|
2143
|
+
this.measure = () => {
|
|
2144
|
+
this.pendingMin = null;
|
|
2145
|
+
this.itemSizeCache.clear();
|
|
2146
|
+
this.laneAssignments.clear();
|
|
2147
|
+
this.itemSizeCacheVersion++;
|
|
2148
|
+
this.notify(false);
|
|
2149
|
+
};
|
|
2150
|
+
this.setOptions(opts);
|
|
2151
|
+
}
|
|
2152
|
+
/**
|
|
2153
|
+
* @deprecated Always 0: a scroll correction is folded into `scrollOffset`
|
|
2154
|
+
* at once, so there is never an outstanding adjustment to add to it. Read
|
|
2155
|
+
* `scrollOffset` alone.
|
|
2156
|
+
*/
|
|
2157
|
+
get scrollAdjustments() {
|
|
2158
|
+
return 0;
|
|
2159
|
+
}
|
|
2160
|
+
// Returns `true` when it performed a synchronous `scrollTop` write this
|
|
2161
|
+
// tick, `false` when the delta was zero or the write was deferred (iOS).
|
|
2162
|
+
// `resizeItem` uses that to decide whether the follow-up `notify` must be
|
|
2163
|
+
// synchronous so the grown transforms commit in the same paint (#1227).
|
|
2164
|
+
applyScrollAdjustment(delta, behavior) {
|
|
2165
|
+
if (delta === 0) return false;
|
|
2166
|
+
if (this.options.debug) {
|
|
2167
|
+
console.info("correction", delta);
|
|
2168
|
+
}
|
|
2169
|
+
this._followOffsetTarget(delta);
|
|
2170
|
+
if (!this._canWriteScroll()) {
|
|
2171
|
+
this._holdOffset += delta;
|
|
2172
|
+
if (this.scrollOffset !== null) this.scrollOffset += delta;
|
|
2173
|
+
return true;
|
|
2174
|
+
} else {
|
|
2175
|
+
const offset = this.getScrollOffset();
|
|
2176
|
+
this._clampedAdjustment = this._clampedBy(offset + delta);
|
|
2177
|
+
const write = this._scrollToOffset(offset, {
|
|
2178
|
+
adjustments: delta,
|
|
2179
|
+
behavior
|
|
2180
|
+
});
|
|
2181
|
+
if (this.scrollOffset !== null) {
|
|
2182
|
+
if (this.pendingWrite === write) this.scrollOffset += delta;
|
|
2183
|
+
if (this.scrollOffset < 0) this.scrollOffset = 0;
|
|
2184
|
+
}
|
|
2185
|
+
return true;
|
|
2186
|
+
}
|
|
2187
|
+
}
|
|
2188
|
+
scheduleScrollReconcile() {
|
|
2189
|
+
if (!this.targetWindow) {
|
|
2190
|
+
this.scrollState = null;
|
|
2191
|
+
return;
|
|
2192
|
+
}
|
|
2193
|
+
if (this.rafId != null) return;
|
|
2194
|
+
this.rafId = this.targetWindow.requestAnimationFrame(() => {
|
|
2195
|
+
this.rafId = null;
|
|
2196
|
+
this.reconcileScroll();
|
|
2197
|
+
});
|
|
2198
|
+
}
|
|
2199
|
+
getScrollStateTarget(state) {
|
|
2200
|
+
const offsetInfo = state.toEnd ? [Math.max(this.getMaxScrollOffset(), 0)] : state.index != null ? this.getOffsetForIndex(state.index, state.align) : void 0;
|
|
2201
|
+
return offsetInfo ? offsetInfo[0] : state.lastTargetOffset;
|
|
2202
|
+
}
|
|
2203
|
+
reconcileScroll() {
|
|
2204
|
+
if (!this.scrollState) return;
|
|
2205
|
+
const el = this.scrollElement;
|
|
2206
|
+
if (!el) return;
|
|
2207
|
+
const MAX_RECONCILE_MS = 5e3;
|
|
2208
|
+
if (this.now() - this.scrollState.startedAt > MAX_RECONCILE_MS) {
|
|
2209
|
+
this.scrollState = null;
|
|
2210
|
+
return;
|
|
2211
|
+
}
|
|
2212
|
+
if (this.scrollState.phase === "queued") {
|
|
2213
|
+
this.scheduleScrollReconcile();
|
|
2214
|
+
return;
|
|
2215
|
+
}
|
|
2216
|
+
this.getMeasurements();
|
|
2217
|
+
const targetOffset = this.getScrollStateTarget(this.scrollState);
|
|
2218
|
+
const STABLE_FRAMES = this.scrollState.index == null ? 1 : this.options.useAnimationFrameWithResizeObserver ? 3 : 2;
|
|
2219
|
+
const targetChanged = targetOffset !== this.scrollState.lastTargetOffset;
|
|
2220
|
+
if (!targetChanged && approxEqual(targetOffset, this.getScrollOffset())) {
|
|
2221
|
+
if (this.scrollState.phase === "smooth") {
|
|
2222
|
+
this.scrollState.phase = "smoothLanded";
|
|
2223
|
+
} else if (this.scrollState.phase === "smoothFinishing") {
|
|
2224
|
+
this.scrollState.phase = "instant";
|
|
2225
|
+
}
|
|
2226
|
+
this.scrollState.stableFrames++;
|
|
2227
|
+
if (this.scrollState.stableFrames >= STABLE_FRAMES) {
|
|
2228
|
+
if (this.getScrollOffset() !== targetOffset) {
|
|
2229
|
+
this._scrollToOffset(targetOffset, { behavior: "auto" });
|
|
2230
|
+
}
|
|
2231
|
+
this.scrollState = null;
|
|
2232
|
+
return;
|
|
2233
|
+
}
|
|
2234
|
+
} else {
|
|
2235
|
+
this.scrollState.stableFrames = 0;
|
|
2236
|
+
if (targetChanged) {
|
|
2237
|
+
const viewport = this.getSize() || 600;
|
|
2238
|
+
const distance = Math.abs(targetOffset - this.getScrollOffset());
|
|
2239
|
+
const keepSmooth = isSmoothScroll(this.scrollState) && distance > viewport;
|
|
2240
|
+
this.scrollState.lastTargetOffset = targetOffset;
|
|
2241
|
+
if (keepSmooth) {
|
|
2242
|
+
this.scrollState.phase = "smooth";
|
|
2243
|
+
} else if (this.scrollState.phase === "smooth") {
|
|
2244
|
+
this.scrollState.phase = "smoothFinishing";
|
|
2245
|
+
} else if (this.scrollState.phase === "smoothLanded") {
|
|
2246
|
+
this.scrollState.phase = "instant";
|
|
2247
|
+
}
|
|
2248
|
+
this._scrollToOffset(targetOffset, {
|
|
2249
|
+
behavior: keepSmooth ? "smooth" : "auto"
|
|
2250
|
+
});
|
|
2251
|
+
}
|
|
2252
|
+
}
|
|
2253
|
+
this.scheduleScrollReconcile();
|
|
2254
|
+
}
|
|
2255
|
+
// Every scroll command starts here: it becomes the in-flight command,
|
|
2256
|
+
// writes its first target and leaves reconcile to retarget and retire it.
|
|
2257
|
+
//
|
|
2258
|
+
// Targets are layout offsets. A held correction is not dropped by a
|
|
2259
|
+
// command: the write lands the element `_holdOffset` short of the target,
|
|
2260
|
+
// under the rows exposed shifted by the same amount, and the flush moves
|
|
2261
|
+
// both together once a write is possible.
|
|
2262
|
+
//
|
|
2263
|
+
// An index or end target that is already at its offset starts a smooth
|
|
2264
|
+
// scroll as landed; an offset target never does, so its first scroll
|
|
2265
|
+
// event is read as the user's (see the scroll handler in `_willUpdate`).
|
|
2266
|
+
_startScroll(target, offset, behavior, kind) {
|
|
2267
|
+
this.pendingScrollAnchor = null;
|
|
2268
|
+
this._clampedAdjustment = null;
|
|
2269
|
+
const tail = this._iosGesture.tail();
|
|
2270
|
+
if (kind === "absolute" && tail !== null) {
|
|
2271
|
+
if (tail === "fling" && momentumOverridesWrites()) {
|
|
2272
|
+
this._stopMomentum(() => {
|
|
2273
|
+
const state = this.scrollState;
|
|
2274
|
+
if ((state == null ? void 0 : state.phase) !== "queued" || // A finger came down: it owns the scroll until it lifts.
|
|
2275
|
+
this._iosGesture.tail() !== "fling" || // In a bounce WebKit can drop the write (#1287): the tail
|
|
2276
|
+
// decides, as without the stop. (Not `flingCaught`: our stop
|
|
2277
|
+
// also ends the fling at speed, so a slow frame would read as
|
|
2278
|
+
// a catch and the tail would drop the command.)
|
|
2279
|
+
this._reportedOverscroll) {
|
|
2280
|
+
return;
|
|
2281
|
+
}
|
|
2282
|
+
this._iosGesture.end();
|
|
2283
|
+
this._flushHoldIfReady(true);
|
|
2284
|
+
this._writeAwaitingCommand();
|
|
2285
|
+
});
|
|
2286
|
+
this.scrollState = {
|
|
2287
|
+
...target,
|
|
2288
|
+
startedAt: this.now(),
|
|
2289
|
+
lastTargetOffset: offset,
|
|
2290
|
+
stableFrames: 0,
|
|
2291
|
+
phase: "queued",
|
|
2292
|
+
behavior,
|
|
2293
|
+
samples: []
|
|
2294
|
+
};
|
|
2295
|
+
this.scheduleScrollReconcile();
|
|
2296
|
+
return;
|
|
2297
|
+
}
|
|
2298
|
+
this._iosGesture.end();
|
|
2299
|
+
}
|
|
2300
|
+
this.scrollState = {
|
|
2301
|
+
...target,
|
|
2302
|
+
startedAt: this.now(),
|
|
2303
|
+
lastTargetOffset: offset,
|
|
2304
|
+
stableFrames: 0,
|
|
2305
|
+
behavior,
|
|
2306
|
+
phase: initialScrollPhase(
|
|
2307
|
+
behavior,
|
|
2308
|
+
target.index != null && approxEqual(offset, this.getScrollOffset())
|
|
2309
|
+
)
|
|
2310
|
+
};
|
|
2311
|
+
this._scrollToOffset(offset, { behavior });
|
|
2312
|
+
this.scheduleScrollReconcile();
|
|
2313
|
+
}
|
|
2314
|
+
};
|
|
2315
|
+
var findNearestBinarySearch = (low, high, getCurrentValue, value) => {
|
|
2316
|
+
while (low <= high) {
|
|
2317
|
+
const middle = (low + high) / 2 | 0;
|
|
2318
|
+
const currentValue = getCurrentValue(middle);
|
|
2319
|
+
if (currentValue < value) {
|
|
2320
|
+
low = middle + 1;
|
|
2321
|
+
} else if (currentValue > value) {
|
|
2322
|
+
high = middle - 1;
|
|
2323
|
+
} else {
|
|
2324
|
+
return middle;
|
|
2325
|
+
}
|
|
2326
|
+
}
|
|
2327
|
+
if (low > 0) {
|
|
2328
|
+
return low - 1;
|
|
2329
|
+
} else {
|
|
2330
|
+
return 0;
|
|
2331
|
+
}
|
|
2332
|
+
};
|
|
2333
|
+
function findNearestBinarySearchFlat(flat, high, value) {
|
|
2334
|
+
let low = 0;
|
|
2335
|
+
while (low <= high) {
|
|
2336
|
+
const middle = (low + high) / 2 | 0;
|
|
2337
|
+
const currentValue = flat[middle * 2];
|
|
2338
|
+
if (currentValue < value) {
|
|
2339
|
+
low = middle + 1;
|
|
2340
|
+
} else if (currentValue > value) {
|
|
2341
|
+
high = middle - 1;
|
|
2342
|
+
} else {
|
|
2343
|
+
return middle;
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
return low > 0 ? low - 1 : 0;
|
|
2347
|
+
}
|
|
2348
|
+
function calculateRangeImpl(measurements, outerSize, scrollOffset, lanes, flat) {
|
|
2349
|
+
const lastIndex = measurements.length - 1;
|
|
2350
|
+
if (measurements.length <= lanes) {
|
|
2351
|
+
return { startIndex: 0, endIndex: lastIndex };
|
|
2352
|
+
}
|
|
2353
|
+
if (lanes === 1 && flat !== null) {
|
|
2354
|
+
const startIndex2 = findNearestBinarySearchFlat(
|
|
2355
|
+
flat,
|
|
2356
|
+
lastIndex,
|
|
2357
|
+
scrollOffset
|
|
2358
|
+
);
|
|
2359
|
+
let endIndex2 = startIndex2;
|
|
2360
|
+
const limit = scrollOffset + outerSize;
|
|
2361
|
+
while (endIndex2 < lastIndex && flat[endIndex2 * 2] + flat[endIndex2 * 2 + 1] < limit) {
|
|
2362
|
+
endIndex2++;
|
|
2363
|
+
}
|
|
2364
|
+
return { startIndex: startIndex2, endIndex: endIndex2 };
|
|
2365
|
+
}
|
|
2366
|
+
const getStart = (index) => measurements[index].start;
|
|
2367
|
+
let startIndex = findNearestBinarySearch(0, lastIndex, getStart, scrollOffset);
|
|
2368
|
+
let endIndex = startIndex;
|
|
2369
|
+
if (lanes === 1) {
|
|
2370
|
+
while (endIndex < lastIndex && measurements[endIndex].end < scrollOffset + outerSize) {
|
|
2371
|
+
endIndex++;
|
|
2372
|
+
}
|
|
2373
|
+
} else if (lanes > 1) {
|
|
2374
|
+
const endPerLane = Array(lanes).fill(0);
|
|
2375
|
+
while (endIndex < lastIndex && endPerLane.some((pos) => pos < scrollOffset + outerSize)) {
|
|
2376
|
+
const item = measurements[endIndex];
|
|
2377
|
+
endPerLane[item.lane] = item.end;
|
|
2378
|
+
endIndex++;
|
|
2379
|
+
}
|
|
2380
|
+
const startPerLane = Array(lanes).fill(scrollOffset + outerSize);
|
|
2381
|
+
while (startIndex >= 0 && startPerLane.some((pos) => pos >= scrollOffset)) {
|
|
2382
|
+
const item = measurements[startIndex];
|
|
2383
|
+
startPerLane[item.lane] = item.start;
|
|
2384
|
+
startIndex--;
|
|
2385
|
+
}
|
|
2386
|
+
startIndex = Math.max(0, startIndex - startIndex % lanes);
|
|
2387
|
+
endIndex = Math.min(lastIndex, endIndex + (lanes - 1 - endIndex % lanes));
|
|
2388
|
+
}
|
|
2389
|
+
return { startIndex, endIndex };
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2392
|
+
// ../node_modules/@tanstack/react-virtual/dist/esm/index.js
|
|
2393
|
+
var useIsomorphicLayoutEffect = typeof document !== "undefined" ? L2.useLayoutEffect : L2.useEffect;
|
|
2394
|
+
function useVirtualizerBase({
|
|
2395
|
+
useFlushSync = true,
|
|
2396
|
+
directDomUpdates = false,
|
|
2397
|
+
directDomUpdatesMode = "transform",
|
|
2398
|
+
...options
|
|
2399
|
+
}) {
|
|
2400
|
+
const rerender = L2.useReducer((x3) => x3 + 1, 0)[1];
|
|
2401
|
+
const directRef = L2.useRef({
|
|
2402
|
+
enabled: directDomUpdates,
|
|
2403
|
+
mode: directDomUpdatesMode,
|
|
2404
|
+
container: null,
|
|
2405
|
+
lastSize: null,
|
|
2406
|
+
// Keyed by the element itself so a remounted node (same key, new DOM
|
|
2407
|
+
// node — e.g. when `enabled` is toggled off then on) is treated as fresh
|
|
2408
|
+
// and gets its style written.
|
|
2409
|
+
lastPositions: /* @__PURE__ */ new WeakMap(),
|
|
2410
|
+
prevRange: null
|
|
2411
|
+
});
|
|
2412
|
+
directRef.current.enabled = directDomUpdates;
|
|
2413
|
+
directRef.current.mode = directDomUpdatesMode;
|
|
2414
|
+
const measuringFromRef = L2.useRef(false);
|
|
2415
|
+
const applyContainerSize = (instance2) => {
|
|
2416
|
+
const state = directRef.current;
|
|
2417
|
+
if (!state.enabled || !state.container) return;
|
|
2418
|
+
const totalSize = instance2.getTotalSize();
|
|
2419
|
+
if (totalSize !== state.lastSize) {
|
|
2420
|
+
state.lastSize = totalSize;
|
|
2421
|
+
const sizeAxis = instance2.options.horizontal ? "width" : "height";
|
|
2422
|
+
state.container.style[sizeAxis] = `${totalSize}px`;
|
|
2423
|
+
}
|
|
2424
|
+
};
|
|
2425
|
+
const applyItemPosition = (instance2, item, el) => {
|
|
2426
|
+
const state = directRef.current;
|
|
2427
|
+
const horizontal = !!instance2.options.horizontal;
|
|
2428
|
+
const next = item.start - instance2.options.scrollMargin;
|
|
2429
|
+
if (state.lastPositions.get(el) === next) return;
|
|
2430
|
+
state.lastPositions.set(el, next);
|
|
2431
|
+
if (state.mode === "transform") {
|
|
2432
|
+
el.style.transform = horizontal ? `translate3d(${next}px, 0, 0)` : `translate3d(0, ${next}px, 0)`;
|
|
2433
|
+
} else {
|
|
2434
|
+
el.style[horizontal ? "left" : "top"] = `${next}px`;
|
|
2435
|
+
}
|
|
2436
|
+
};
|
|
2437
|
+
const applyDirectStyles = (instance2) => {
|
|
2438
|
+
const state = directRef.current;
|
|
2439
|
+
if (!state.enabled || !state.container) return;
|
|
2440
|
+
applyContainerSize(instance2);
|
|
2441
|
+
for (const item of instance2.getVirtualItems()) {
|
|
2442
|
+
const el = instance2.elementsCache.get(item.key);
|
|
2443
|
+
if (el) applyItemPosition(instance2, item, el);
|
|
2444
|
+
}
|
|
2445
|
+
};
|
|
2446
|
+
const resolvedOptions = {
|
|
2447
|
+
...options,
|
|
2448
|
+
onChange: (instance2, sync) => {
|
|
2449
|
+
var _a;
|
|
2450
|
+
const state = directRef.current;
|
|
2451
|
+
let shouldRerender = true;
|
|
2452
|
+
if (state.enabled) {
|
|
2453
|
+
applyDirectStyles(instance2);
|
|
2454
|
+
const range = instance2.range;
|
|
2455
|
+
const prev = state.prevRange;
|
|
2456
|
+
shouldRerender = !prev || prev.isScrolling !== instance2.isScrolling || prev.startIndex !== (range == null ? void 0 : range.startIndex) || prev.endIndex !== (range == null ? void 0 : range.endIndex);
|
|
2457
|
+
if (shouldRerender) {
|
|
2458
|
+
state.prevRange = range ? {
|
|
2459
|
+
startIndex: range.startIndex,
|
|
2460
|
+
endIndex: range.endIndex,
|
|
2461
|
+
isScrolling: instance2.isScrolling
|
|
2462
|
+
} : null;
|
|
2463
|
+
}
|
|
2464
|
+
}
|
|
2465
|
+
if (shouldRerender) {
|
|
2466
|
+
if (useFlushSync && sync && !measuringFromRef.current) {
|
|
2467
|
+
flushSync(rerender);
|
|
2468
|
+
} else {
|
|
2469
|
+
rerender();
|
|
2470
|
+
}
|
|
2471
|
+
}
|
|
2472
|
+
(_a = options.onChange) == null ? void 0 : _a.call(options, instance2, sync);
|
|
2473
|
+
}
|
|
2474
|
+
};
|
|
2475
|
+
const [instance] = L2.useState(() => {
|
|
2476
|
+
const v3 = new Virtualizer(resolvedOptions);
|
|
2477
|
+
const measureElement2 = v3.measureElement;
|
|
2478
|
+
v3.measureElement = (node) => {
|
|
2479
|
+
measuringFromRef.current = true;
|
|
2480
|
+
try {
|
|
2481
|
+
measureElement2(node);
|
|
2482
|
+
} finally {
|
|
2483
|
+
measuringFromRef.current = false;
|
|
2484
|
+
}
|
|
2485
|
+
const state = directRef.current;
|
|
2486
|
+
if (node !== null && state.enabled && state.container) {
|
|
2487
|
+
const item = v3.measurementsCache[v3.indexFromElement(node)];
|
|
2488
|
+
if (item) applyItemPosition(v3, item, node);
|
|
2489
|
+
}
|
|
2490
|
+
};
|
|
2491
|
+
return Object.assign(v3, {
|
|
2492
|
+
containerRef: (node) => {
|
|
2493
|
+
const state = directRef.current;
|
|
2494
|
+
state.container = node;
|
|
2495
|
+
state.lastSize = null;
|
|
2496
|
+
if (node !== null) {
|
|
2497
|
+
applyDirectStyles(v3);
|
|
2498
|
+
}
|
|
2499
|
+
}
|
|
2500
|
+
});
|
|
2501
|
+
});
|
|
2502
|
+
instance.setOptions(resolvedOptions);
|
|
2503
|
+
useIsomorphicLayoutEffect(() => {
|
|
2504
|
+
return instance._didMount();
|
|
2505
|
+
}, []);
|
|
2506
|
+
useIsomorphicLayoutEffect(() => {
|
|
2507
|
+
applyContainerSize(instance);
|
|
2508
|
+
return instance._willUpdate();
|
|
2509
|
+
});
|
|
2510
|
+
useIsomorphicLayoutEffect(() => {
|
|
2511
|
+
applyDirectStyles(instance);
|
|
2512
|
+
});
|
|
2513
|
+
return instance;
|
|
2514
|
+
}
|
|
2515
|
+
function useVirtualizer(options) {
|
|
2516
|
+
return useVirtualizerBase({
|
|
2517
|
+
observeElementRect,
|
|
2518
|
+
observeElementOffset,
|
|
2519
|
+
scrollToFn: elementScroll,
|
|
2520
|
+
...options
|
|
2521
|
+
});
|
|
2522
|
+
}
|
|
2523
|
+
function v(e2) {
|
|
2524
|
+
let l4 = useRef({ value: "", selectionStart: null, selectionEnd: null });
|
|
2525
|
+
return E(e2, "blur", (n6) => {
|
|
2526
|
+
let t = n6.target;
|
|
2527
|
+
l2(t) && (l4.current = { value: t.value, selectionStart: t.selectionStart, selectionEnd: t.selectionEnd });
|
|
2528
|
+
}), o2(() => {
|
|
2529
|
+
if (!d(e2) && l2(e2) && e2.isConnected) {
|
|
2530
|
+
if (e2.focus({ preventScroll: true }), e2.value !== l4.current.value) e2.setSelectionRange(e2.value.length, e2.value.length);
|
|
2531
|
+
else {
|
|
2532
|
+
let { selectionStart: n6, selectionEnd: t } = l4.current;
|
|
2533
|
+
n6 !== null && t !== null && e2.setSelectionRange(n6, t);
|
|
2534
|
+
}
|
|
2535
|
+
l4.current = { value: "", selectionStart: null, selectionEnd: null };
|
|
2536
|
+
}
|
|
2537
|
+
});
|
|
2538
|
+
}
|
|
2539
|
+
function F(c5, { container: e2, accept: t, walk: r3 }) {
|
|
2540
|
+
let o4 = useRef(t), l4 = useRef(r3);
|
|
2541
|
+
useEffect(() => {
|
|
2542
|
+
o4.current = t, l4.current = r3;
|
|
2543
|
+
}, [t, r3]), n(() => {
|
|
2544
|
+
if (!e2 || !c5) return;
|
|
2545
|
+
let n6 = l$1(e2);
|
|
2546
|
+
if (!n6) return;
|
|
2547
|
+
let f4 = o4.current, p5 = l4.current, i2 = Object.assign((m3) => f4(m3), { acceptNode: f4 }), u10 = n6.createTreeWalker(e2, NodeFilter.SHOW_ELEMENT, i2, false);
|
|
2548
|
+
for (; u10.nextNode(); ) p5(u10.currentNode);
|
|
2549
|
+
}, [e2, c5, o4, l4]);
|
|
2550
|
+
}
|
|
2551
|
+
|
|
2552
|
+
// ../node_modules/@headlessui/react/dist/components/combobox/combobox-machine.js
|
|
2553
|
+
var I = Object.defineProperty;
|
|
2554
|
+
var h = (t, i2, e2) => i2 in t ? I(t, i2, { enumerable: true, configurable: true, writable: true, value: e2 }) : t[i2] = e2;
|
|
2555
|
+
var f3 = (t, i2, e2) => (h(t, typeof i2 != "symbol" ? i2 + "" : i2, e2), e2);
|
|
2556
|
+
var P = ((e2) => (e2[e2.Open = 0] = "Open", e2[e2.Closed = 1] = "Closed", e2))(P || {});
|
|
2557
|
+
var k3 = ((e2) => (e2[e2.Single = 0] = "Single", e2[e2.Multi = 1] = "Multi", e2))(k3 || {});
|
|
2558
|
+
var _ = ((n6) => (n6[n6.Pointer = 0] = "Pointer", n6[n6.Focus = 1] = "Focus", n6[n6.Other = 2] = "Other", n6))(_ || {});
|
|
2559
|
+
var D = ((l4) => (l4[l4.OpenCombobox = 0] = "OpenCombobox", l4[l4.CloseCombobox = 1] = "CloseCombobox", l4[l4.GoToOption = 2] = "GoToOption", l4[l4.SetTyping = 3] = "SetTyping", l4[l4.RegisterOption = 4] = "RegisterOption", l4[l4.UnregisterOption = 5] = "UnregisterOption", l4[l4.DefaultToFirstOption = 6] = "DefaultToFirstOption", l4[l4.SetActivationTrigger = 7] = "SetActivationTrigger", l4[l4.UpdateVirtualConfiguration = 8] = "UpdateVirtualConfiguration", l4[l4.SetInputElement = 9] = "SetInputElement", l4[l4.SetButtonElement = 10] = "SetButtonElement", l4[l4.SetOptionsElement = 11] = "SetOptionsElement", l4[l4.MarkInputAsMoved = 12] = "MarkInputAsMoved", l4))(D || {});
|
|
2560
|
+
function v2(t, i2 = (e2) => e2) {
|
|
2561
|
+
let e2 = t.activeOptionIndex !== null ? t.options[t.activeOptionIndex] : null, n6 = i2(t.options.slice()), o4 = n6.length > 0 && n6[0].dataRef.current.order !== null ? n6.sort((u10, a4) => u10.dataRef.current.order - a4.dataRef.current.order) : G(n6, (u10) => u10.dataRef.current.domRef.current), r3 = e2 ? o4.indexOf(e2) : null;
|
|
2562
|
+
return r3 === -1 && (r3 = null), { options: o4, activeOptionIndex: r3 };
|
|
2563
|
+
}
|
|
2564
|
+
var j2 = { [1](t) {
|
|
2565
|
+
var e2;
|
|
2566
|
+
if ((e2 = t.dataRef.current) != null && e2.disabled || t.comboboxState === 1) return t;
|
|
2567
|
+
let i2 = t.inputElement ? c2$1.Tracked(a$1(t.inputElement)) : t.inputPositionState;
|
|
2568
|
+
return { ...t, activeOptionIndex: null, comboboxState: 1, isTyping: false, activationTrigger: 2, inputPositionState: i2, __demoMode: false };
|
|
2569
|
+
}, [0](t) {
|
|
2570
|
+
var i2, e2;
|
|
2571
|
+
if ((i2 = t.dataRef.current) != null && i2.disabled || t.comboboxState === 0) return t;
|
|
2572
|
+
if ((e2 = t.dataRef.current) != null && e2.value) {
|
|
2573
|
+
let n6 = t.dataRef.current.calculateIndex(t.dataRef.current.value);
|
|
2574
|
+
if (n6 !== -1) return { ...t, activeOptionIndex: n6, comboboxState: 0, __demoMode: false, inputPositionState: c2$1.Idle };
|
|
2575
|
+
}
|
|
2576
|
+
return { ...t, comboboxState: 0, inputPositionState: c2$1.Idle, __demoMode: false };
|
|
2577
|
+
}, [3](t, i2) {
|
|
2578
|
+
return t.isTyping === i2.isTyping ? t : { ...t, isTyping: i2.isTyping };
|
|
2579
|
+
}, [2](t, i2) {
|
|
2580
|
+
var r3, u10, a4, s4;
|
|
2581
|
+
if ((r3 = t.dataRef.current) != null && r3.disabled || t.optionsElement && !((u10 = t.dataRef.current) != null && u10.optionsPropsRef.current.static) && t.comboboxState === 1) return t;
|
|
2582
|
+
if (t.virtual) {
|
|
2583
|
+
let { options: p5, disabled: c5 } = t.virtual, m3 = i2.focus === c$1.Specific ? i2.idx : f(i2, { resolveItems: () => p5, resolveActiveIndex: () => {
|
|
2584
|
+
var l4, x3;
|
|
2585
|
+
return (x3 = (l4 = t.activeOptionIndex) != null ? l4 : p5.findIndex((S3) => !c5(S3))) != null ? x3 : null;
|
|
2586
|
+
}, resolveDisabled: c5, resolveId() {
|
|
2587
|
+
throw new Error("Function not implemented.");
|
|
2588
|
+
} }), b3 = (a4 = i2.trigger) != null ? a4 : 2;
|
|
2589
|
+
return t.activeOptionIndex === m3 && t.activationTrigger === b3 ? t : { ...t, activeOptionIndex: m3, activationTrigger: b3, isTyping: false, __demoMode: false };
|
|
2590
|
+
}
|
|
2591
|
+
let e2 = v2(t);
|
|
2592
|
+
if (e2.activeOptionIndex === null) {
|
|
2593
|
+
let p5 = e2.options.findIndex((c5) => !c5.dataRef.current.disabled);
|
|
2594
|
+
p5 !== -1 && (e2.activeOptionIndex = p5);
|
|
2595
|
+
}
|
|
2596
|
+
let n6 = i2.focus === c$1.Specific ? i2.idx : f(i2, { resolveItems: () => e2.options, resolveActiveIndex: () => e2.activeOptionIndex, resolveId: (p5) => p5.id, resolveDisabled: (p5) => p5.dataRef.current.disabled }), o4 = (s4 = i2.trigger) != null ? s4 : 2;
|
|
2597
|
+
return t.activeOptionIndex === n6 && t.activationTrigger === o4 ? t : { ...t, ...e2, isTyping: false, activeOptionIndex: n6, activationTrigger: o4, __demoMode: false };
|
|
2598
|
+
}, [4]: (t, i2) => {
|
|
2599
|
+
var r3, u10, a4, s4;
|
|
2600
|
+
if ((r3 = t.dataRef.current) != null && r3.virtual) return { ...t, options: [...t.options, i2.payload] };
|
|
2601
|
+
let e2 = i2.payload, n6 = v2(t, (p5) => (p5.push(e2), p5));
|
|
2602
|
+
t.activeOptionIndex === null && (a4 = (u10 = t.dataRef.current).isSelected) != null && a4.call(u10, i2.payload.dataRef.current.value) && (n6.activeOptionIndex = n6.options.indexOf(e2));
|
|
2603
|
+
let o4 = { ...t, ...n6, activationTrigger: 2 };
|
|
2604
|
+
return (s4 = t.dataRef.current) != null && s4.__demoMode && t.dataRef.current.value === void 0 && (o4.activeOptionIndex = 0), o4;
|
|
2605
|
+
}, [5]: (t, i2) => {
|
|
2606
|
+
var n6;
|
|
2607
|
+
if ((n6 = t.dataRef.current) != null && n6.virtual) return { ...t, options: t.options.filter((o4) => o4.id !== i2.id) };
|
|
2608
|
+
let e2 = v2(t, (o4) => {
|
|
2609
|
+
let r3 = o4.findIndex((u10) => u10.id === i2.id);
|
|
2610
|
+
return r3 !== -1 && o4.splice(r3, 1), o4;
|
|
2611
|
+
});
|
|
2612
|
+
return { ...t, ...e2, activationTrigger: 2 };
|
|
2613
|
+
}, [6]: (t, i2) => t.defaultToFirstOption === i2.value ? t : { ...t, defaultToFirstOption: i2.value }, [7]: (t, i2) => t.activationTrigger === i2.trigger ? t : { ...t, activationTrigger: i2.trigger }, [8]: (t, i2) => {
|
|
2614
|
+
var n6, o4;
|
|
2615
|
+
if (t.virtual === null) return { ...t, virtual: { options: i2.options, disabled: (n6 = i2.disabled) != null ? n6 : () => false } };
|
|
2616
|
+
if (t.virtual.options === i2.options && t.virtual.disabled === i2.disabled) return t;
|
|
2617
|
+
let e2 = t.activeOptionIndex;
|
|
2618
|
+
if (t.activeOptionIndex !== null) {
|
|
2619
|
+
let r3 = i2.options.indexOf(t.virtual.options[t.activeOptionIndex]);
|
|
2620
|
+
r3 !== -1 ? e2 = r3 : e2 = null;
|
|
2621
|
+
}
|
|
2622
|
+
return { ...t, activeOptionIndex: e2, virtual: { options: i2.options, disabled: (o4 = i2.disabled) != null ? o4 : () => false } };
|
|
2623
|
+
}, [9]: (t, i2) => t.inputElement === i2.element ? t : { ...t, inputElement: i2.element }, [10]: (t, i2) => t.buttonElement === i2.element ? t : { ...t, buttonElement: i2.element }, [11]: (t, i2) => t.optionsElement === i2.element ? t : { ...t, optionsElement: i2.element }, [12](t) {
|
|
2624
|
+
return t.inputPositionState.kind !== "Tracked" ? t : { ...t, inputPositionState: c2$1.Moved };
|
|
2625
|
+
} };
|
|
2626
|
+
var y3 = class _y extends T {
|
|
2627
|
+
constructor(e2) {
|
|
2628
|
+
super(e2);
|
|
2629
|
+
f3(this, "actions", { onChange: (e3) => {
|
|
2630
|
+
let { onChange: n6, compare: o4, mode: r3, value: u10 } = this.state.dataRef.current;
|
|
2631
|
+
return u(r3, { [0]: () => n6 == null ? void 0 : n6(e3), [1]: () => {
|
|
2632
|
+
let a4 = u10.slice(), s4 = a4.findIndex((p5) => o4(p5, e3));
|
|
2633
|
+
return s4 === -1 ? a4.push(e3) : a4.splice(s4, 1), n6 == null ? void 0 : n6(a4);
|
|
2634
|
+
} });
|
|
2635
|
+
}, registerOption: (e3, n6) => (this.send({ type: 4, payload: { id: e3, dataRef: n6 } }), () => {
|
|
2636
|
+
this.state.activeOptionIndex === this.state.dataRef.current.calculateIndex(n6.current.value) && this.send({ type: 6, value: true }), this.send({ type: 5, id: e3 });
|
|
2637
|
+
}), goToOption: (e3, n6) => (this.send({ type: 6, value: false }), this.send({ type: 2, ...e3, trigger: n6 })), setIsTyping: (e3) => {
|
|
2638
|
+
this.send({ type: 3, isTyping: e3 });
|
|
2639
|
+
}, closeCombobox: () => {
|
|
2640
|
+
var e3, n6;
|
|
2641
|
+
this.send({ type: 1 }), this.send({ type: 6, value: false }), (n6 = (e3 = this.state.dataRef.current).onClose) == null || n6.call(e3);
|
|
2642
|
+
}, openCombobox: () => {
|
|
2643
|
+
this.send({ type: 0 }), this.send({ type: 6, value: true });
|
|
2644
|
+
}, setActivationTrigger: (e3) => {
|
|
2645
|
+
this.send({ type: 7, trigger: e3 });
|
|
2646
|
+
}, selectActiveOption: () => {
|
|
2647
|
+
let e3 = this.selectors.activeOptionIndex(this.state);
|
|
2648
|
+
if (e3 !== null) {
|
|
2649
|
+
if (this.actions.setIsTyping(false), this.state.virtual) this.actions.onChange(this.state.virtual.options[e3]);
|
|
2650
|
+
else {
|
|
2651
|
+
let { dataRef: n6 } = this.state.options[e3];
|
|
2652
|
+
this.actions.onChange(n6.current.value);
|
|
2653
|
+
}
|
|
2654
|
+
this.actions.goToOption({ focus: c$1.Specific, idx: e3 });
|
|
2655
|
+
}
|
|
2656
|
+
}, setInputElement: (e3) => {
|
|
2657
|
+
this.send({ type: 9, element: e3 });
|
|
2658
|
+
}, setButtonElement: (e3) => {
|
|
2659
|
+
this.send({ type: 10, element: e3 });
|
|
2660
|
+
}, setOptionsElement: (e3) => {
|
|
2661
|
+
this.send({ type: 11, element: e3 });
|
|
2662
|
+
} });
|
|
2663
|
+
f3(this, "selectors", { activeDescendantId: (e3) => {
|
|
2664
|
+
var o4, r3;
|
|
2665
|
+
let n6 = this.selectors.activeOptionIndex(e3);
|
|
2666
|
+
if (n6 !== null) return e3.virtual ? (r3 = e3.options.find((u10) => !u10.dataRef.current.disabled && e3.dataRef.current.compare(u10.dataRef.current.value, e3.virtual.options[n6]))) == null ? void 0 : r3.id : (o4 = e3.options[n6]) == null ? void 0 : o4.id;
|
|
2667
|
+
}, activeOptionIndex: (e3) => {
|
|
2668
|
+
if (e3.defaultToFirstOption && e3.activeOptionIndex === null && (e3.virtual ? e3.virtual.options.length > 0 : e3.options.length > 0)) {
|
|
2669
|
+
if (e3.virtual) {
|
|
2670
|
+
let { options: o4, disabled: r3 } = e3.virtual, u10 = o4.findIndex((a4) => {
|
|
2671
|
+
var s4;
|
|
2672
|
+
return !((s4 = r3 == null ? void 0 : r3(a4)) != null && s4);
|
|
2673
|
+
});
|
|
2674
|
+
if (u10 !== -1) return u10;
|
|
2675
|
+
}
|
|
2676
|
+
let n6 = e3.options.findIndex((o4) => !o4.dataRef.current.disabled);
|
|
2677
|
+
if (n6 !== -1) return n6;
|
|
2678
|
+
}
|
|
2679
|
+
return e3.activeOptionIndex;
|
|
2680
|
+
}, activeOption: (e3) => {
|
|
2681
|
+
var o4, r3;
|
|
2682
|
+
let n6 = this.selectors.activeOptionIndex(e3);
|
|
2683
|
+
return n6 === null ? null : e3.virtual ? e3.virtual.options[n6 != null ? n6 : 0] : (r3 = (o4 = e3.options[n6]) == null ? void 0 : o4.dataRef.current.value) != null ? r3 : null;
|
|
2684
|
+
}, isActive: (e3, n6, o4) => {
|
|
2685
|
+
var u10;
|
|
2686
|
+
let r3 = this.selectors.activeOptionIndex(e3);
|
|
2687
|
+
return r3 === null ? false : e3.virtual ? r3 === e3.dataRef.current.calculateIndex(n6) : ((u10 = e3.options[r3]) == null ? void 0 : u10.id) === o4;
|
|
2688
|
+
}, shouldScrollIntoView: (e3, n6, o4) => !(e3.virtual || e3.__demoMode || e3.comboboxState !== 0 || e3.activationTrigger === 0 || !this.selectors.isActive(e3, n6, o4)), didInputMove(e3) {
|
|
2689
|
+
return e3.inputPositionState.kind === "Moved";
|
|
2690
|
+
} });
|
|
2691
|
+
{
|
|
2692
|
+
let n6 = this.state.id, o4 = x.get(null);
|
|
2693
|
+
this.disposables.add(o4.on(k2.Push, (r3) => {
|
|
2694
|
+
!o4.selectors.isTop(r3, n6) && this.state.comboboxState === 0 && this.actions.closeCombobox();
|
|
2695
|
+
})), this.on(0, () => o4.actions.push(n6)), this.on(1, () => o4.actions.pop(n6));
|
|
2696
|
+
}
|
|
2697
|
+
this.disposables.group((n6) => {
|
|
2698
|
+
this.on(1, (o4) => {
|
|
2699
|
+
o4.inputElement && (n6.dispose(), n6.add(p$1(o4.inputElement, o4.inputPositionState, () => {
|
|
2700
|
+
this.send({ type: 12 });
|
|
2701
|
+
})));
|
|
2702
|
+
});
|
|
2703
|
+
});
|
|
2704
|
+
}
|
|
2705
|
+
static new({ id: e2, virtual: n6 = null, __demoMode: o4 = false }) {
|
|
2706
|
+
var r3;
|
|
2707
|
+
return new _y({ id: e2, dataRef: { current: {} }, comboboxState: o4 ? 0 : 1, isTyping: false, options: [], virtual: n6 ? { options: n6.options, disabled: (r3 = n6.disabled) != null ? r3 : () => false } : null, activeOptionIndex: null, activationTrigger: 2, inputElement: null, buttonElement: null, optionsElement: null, __demoMode: o4, inputPositionState: c2$1.Idle });
|
|
2708
|
+
}
|
|
2709
|
+
reduce(e2, n6) {
|
|
2710
|
+
return u(n6.type, j2, e2, n6);
|
|
2711
|
+
}
|
|
2712
|
+
};
|
|
2713
|
+
var u9 = createContext(null);
|
|
2714
|
+
function p4(n6) {
|
|
2715
|
+
let o4 = useContext(u9);
|
|
2716
|
+
if (o4 === null) {
|
|
2717
|
+
let e2 = new Error(`<${n6} /> is missing a parent <Combobox /> component.`);
|
|
2718
|
+
throw Error.captureStackTrace && Error.captureStackTrace(e2, b2), e2;
|
|
2719
|
+
}
|
|
2720
|
+
return o4;
|
|
2721
|
+
}
|
|
2722
|
+
function b2({ id: n6, virtual: o4 = null, __demoMode: e2 = false }) {
|
|
2723
|
+
let t = useMemo(() => y3.new({ id: n6, virtual: o4, __demoMode: e2 }), []);
|
|
2724
|
+
return c2(() => t.dispose()), t;
|
|
2725
|
+
}
|
|
2726
|
+
|
|
2727
|
+
// ../node_modules/@headlessui/react/dist/components/combobox/combobox.js
|
|
2728
|
+
var de = createContext(null);
|
|
2729
|
+
de.displayName = "ComboboxDataContext";
|
|
2730
|
+
function te(T3) {
|
|
2731
|
+
let O = useContext(de);
|
|
2732
|
+
if (O === null) {
|
|
2733
|
+
let e2 = new Error(`<${T3} /> is missing a parent <Combobox /> component.`);
|
|
2734
|
+
throw Error.captureStackTrace && Error.captureStackTrace(e2, te), e2;
|
|
2735
|
+
}
|
|
2736
|
+
return O;
|
|
2737
|
+
}
|
|
2738
|
+
var Le = createContext(null);
|
|
2739
|
+
function Eo(T3) {
|
|
2740
|
+
let O = p4("VirtualProvider"), e2 = te("VirtualProvider"), { options: o4 } = e2.virtual, E3 = S(O, (a4) => a4.optionsElement), [R, y4] = useMemo(() => {
|
|
2741
|
+
let a4 = E3;
|
|
2742
|
+
if (!a4) return [0, 0];
|
|
2743
|
+
let u10 = window.getComputedStyle(a4);
|
|
2744
|
+
return [parseFloat(u10.paddingBlockStart || u10.paddingTop), parseFloat(u10.paddingBlockEnd || u10.paddingBottom)];
|
|
2745
|
+
}, [E3]), b3 = useVirtualizer({ enabled: o4.length !== 0, scrollPaddingStart: R, scrollPaddingEnd: y4, count: o4.length, estimateSize() {
|
|
2746
|
+
return 40;
|
|
2747
|
+
}, getScrollElement() {
|
|
2748
|
+
return O.state.optionsElement;
|
|
2749
|
+
}, overscan: 12 }), [h2, p5] = useState(0);
|
|
2750
|
+
n(() => {
|
|
2751
|
+
p5((a4) => a4 + 1);
|
|
2752
|
+
}, [o4]);
|
|
2753
|
+
let f4 = b3.getVirtualItems(), n6 = S(O, (a4) => a4.activationTrigger === _.Pointer), m3 = S(O, O.selectors.activeOptionIndex);
|
|
2754
|
+
return f4.length === 0 ? null : L2__default.createElement(Le.Provider, { value: b3 }, L2__default.createElement("div", { style: { position: "relative", width: "100%", height: `${b3.getTotalSize()}px` }, ref: (a4) => {
|
|
2755
|
+
a4 && (n6 || m3 !== null && o4.length > m3 && b3.scrollToIndex(m3));
|
|
2756
|
+
} }, f4.map((a4) => {
|
|
2757
|
+
var u10;
|
|
2758
|
+
return L2__default.createElement(Fragment, { key: a4.key }, L2__default.cloneElement((u10 = T3.children) == null ? void 0 : u10.call(T3, { ...T3.slot, option: o4[a4.index] }), { key: `${h2}-${a4.key}`, "data-index": a4.index, "aria-setsize": o4.length, "aria-posinset": a4.index + 1, style: { position: "absolute", top: 0, left: 0, transform: `translateY(${a4.start}px)`, overflowAnchor: "none" } }));
|
|
2759
|
+
})));
|
|
2760
|
+
}
|
|
2761
|
+
var ho = Fragment;
|
|
2762
|
+
function Ao(T3, O) {
|
|
2763
|
+
let e2 = r(), o4 = a(), { value: E3, defaultValue: R, onChange: y4, form: b3, name: h2, by: p5, invalid: f4 = false, disabled: n6 = o4 || false, onClose: m3, __demoMode: a4 = false, multiple: u10 = false, immediate: A2 = false, virtual: d2 = null, nullable: X, ...G2 } = T3, C = l(R), [x3 = u10 ? [] : void 0, v3] = b(E3, y4, C), c5 = b2({ id: e2, virtual: d2, __demoMode: a4 }), z = useRef({ static: false, hold: false }), D2 = u2(p5), K2 = o2((i2) => d2 ? p5 === null ? d2.options.indexOf(i2) : d2.options.findIndex((M) => D2(M, i2)) : c5.state.options.findIndex((M) => D2(M.dataRef.current.value, i2))), W = useCallback((i2) => u(l4.mode, { [k3.Multi]: () => x3.some((M) => D2(M, i2)), [k3.Single]: () => D2(x3, i2) }), [x3]), S3 = S(c5, (i2) => i2.virtual), j3 = o2(() => m3 == null ? void 0 : m3()), l4 = useMemo(() => ({ __demoMode: a4, immediate: A2, optionsPropsRef: z, value: x3, defaultValue: C, disabled: n6, invalid: f4, mode: u10 ? k3.Multi : k3.Single, virtual: d2 ? S3 : null, onChange: v3, isSelected: W, calculateIndex: K2, compare: D2, onClose: j3 }), [a4, A2, z, x3, C, n6, f4, u10, d2, S3, v3, W, K2, D2, j3]);
|
|
2764
|
+
n(() => {
|
|
2765
|
+
var i2;
|
|
2766
|
+
d2 && c5.send({ type: D.UpdateVirtualConfiguration, options: d2.options, disabled: (i2 = d2.disabled) != null ? i2 : null });
|
|
2767
|
+
}, [d2, d2 == null ? void 0 : d2.options, d2 == null ? void 0 : d2.disabled]), n(() => {
|
|
2768
|
+
c5.state.dataRef.current = l4;
|
|
2769
|
+
}, [l4]);
|
|
2770
|
+
let [k4, Y2, s4, U] = S(c5, (i2) => [i2.comboboxState, i2.buttonElement, i2.inputElement, i2.optionsElement]), $ = x.get(null), ne = S($, useCallback((i2) => $.selectors.isTop(i2, e2), [$, e2]));
|
|
2771
|
+
k3$1(ne, [Y2, s4, U], () => c5.actions.closeCombobox());
|
|
2772
|
+
let be = S(c5, c5.selectors.activeOptionIndex), ee = S(c5, c5.selectors.activeOption), q = n2({ open: k4 === P.Open, disabled: n6, invalid: f4, activeIndex: be, activeOption: ee, value: x3 }), [t, V3] = V(), P2 = O === null ? {} : { ref: O }, N3 = useCallback(() => {
|
|
2773
|
+
if (C !== void 0) return v3 == null ? void 0 : v3(C);
|
|
2774
|
+
}, [v3, C]), g2 = K();
|
|
2775
|
+
return L2__default.createElement(V3, { value: t, props: { htmlFor: s4 == null ? void 0 : s4.id }, slot: { open: k4 === P.Open, disabled: n6 } }, L2__default.createElement(Ae, null, L2__default.createElement(de.Provider, { value: l4 }, L2__default.createElement(u9.Provider, { value: c5 }, L2__default.createElement(c, { value: u(k4, { [P.Open]: i3.Open, [P.Closed]: i3.Closed }) }, h2 != null && L2__default.createElement(j, { disabled: n6, data: x3 != null ? { [h2]: x3 } : {}, form: b3, onReset: N3 }), g2({ ourProps: P2, theirProps: G2, slot: q, defaultTag: ho, name: "Combobox" }))))));
|
|
2776
|
+
}
|
|
2777
|
+
var Io = "input";
|
|
2778
|
+
function Ro(T3, O) {
|
|
2779
|
+
var ee, q;
|
|
2780
|
+
let e2 = p4("Combobox.Input"), o4$1 = te("Combobox.Input"), E3 = r(), R = u$1(), { id: y4 = R || `headlessui-combobox-input-${E3}`, onChange: b3, displayValue: h2, disabled: p5 = o4$1.disabled || false, autoFocus: f4 = false, type: n6 = "text", ...m3 } = T3, a4 = useRef(null), u10 = y(a4, O, Fe(), e2.actions.setInputElement), [A2, d2] = S(e2, (t) => [t.comboboxState, t.isTyping]), X = p(), G2 = o2(() => {
|
|
2781
|
+
e2.actions.onChange(null), e2.state.optionsElement && (e2.state.optionsElement.scrollTop = 0), e2.actions.goToOption({ focus: c$1.Nothing });
|
|
2782
|
+
}), C = useMemo(() => {
|
|
2783
|
+
var t;
|
|
2784
|
+
return typeof h2 == "function" && o4$1.value !== void 0 ? (t = h2(o4$1.value)) != null ? t : "" : typeof o4$1.value == "string" ? o4$1.value : "";
|
|
2785
|
+
}, [o4$1.value, h2]);
|
|
2786
|
+
m(([t, V3], [P2, N3]) => {
|
|
2787
|
+
if (e2.state.isTyping) return;
|
|
2788
|
+
let g2 = a4.current;
|
|
2789
|
+
g2 && ((N3 === P.Open && V3 === P.Closed || t !== P2) && (g2.value = t), requestAnimationFrame(() => {
|
|
2790
|
+
if (e2.state.isTyping || !g2 || d(g2)) return;
|
|
2791
|
+
let { selectionStart: i2, selectionEnd: M } = g2;
|
|
2792
|
+
Math.abs((M != null ? M : 0) - (i2 != null ? i2 : 0)) === 0 && i2 === 0 && g2.setSelectionRange(g2.value.length, g2.value.length);
|
|
2793
|
+
}));
|
|
2794
|
+
}, [C, A2, d2]), m(([t], [V3]) => {
|
|
2795
|
+
if (t === P.Open && V3 === P.Closed) {
|
|
2796
|
+
if (e2.state.isTyping) return;
|
|
2797
|
+
let P2 = a4.current;
|
|
2798
|
+
if (!P2) return;
|
|
2799
|
+
let N3 = P2.value, { selectionStart: g2, selectionEnd: i2, selectionDirection: M } = P2;
|
|
2800
|
+
P2.value = "", P2.value = N3, M !== null ? P2.setSelectionRange(g2, i2, M) : P2.setSelectionRange(g2, i2);
|
|
2801
|
+
}
|
|
2802
|
+
}, [A2]);
|
|
2803
|
+
let x3 = useRef(false), v3 = o2(() => {
|
|
2804
|
+
x3.current = true;
|
|
2805
|
+
}), c5 = o2(() => {
|
|
2806
|
+
X.nextFrame(() => {
|
|
2807
|
+
x3.current = false;
|
|
2808
|
+
});
|
|
2809
|
+
}), z = o2((t) => {
|
|
2810
|
+
switch (e2.actions.setIsTyping(true), t.key) {
|
|
2811
|
+
case o4.Enter:
|
|
2812
|
+
if (e2.state.comboboxState !== P.Open || x3.current) return;
|
|
2813
|
+
if (t.preventDefault(), t.stopPropagation(), e2.selectors.activeOptionIndex(e2.state) === null) {
|
|
2814
|
+
e2.actions.closeCombobox();
|
|
2815
|
+
return;
|
|
2816
|
+
}
|
|
2817
|
+
e2.actions.selectActiveOption(), o4$1.mode === k3.Single && e2.actions.closeCombobox();
|
|
2818
|
+
break;
|
|
2819
|
+
case o4.ArrowDown:
|
|
2820
|
+
return t.preventDefault(), t.stopPropagation(), u(e2.state.comboboxState, { [P.Open]: () => e2.actions.goToOption({ focus: c$1.Next }), [P.Closed]: () => e2.actions.openCombobox() });
|
|
2821
|
+
case o4.ArrowUp:
|
|
2822
|
+
return t.preventDefault(), t.stopPropagation(), u(e2.state.comboboxState, { [P.Open]: () => e2.actions.goToOption({ focus: c$1.Previous }), [P.Closed]: () => {
|
|
2823
|
+
flushSync(() => e2.actions.openCombobox()), o4$1.value || e2.actions.goToOption({ focus: c$1.Last });
|
|
2824
|
+
} });
|
|
2825
|
+
case o4.Home:
|
|
2826
|
+
if (e2.state.comboboxState === P.Closed || t.shiftKey) break;
|
|
2827
|
+
return t.preventDefault(), t.stopPropagation(), e2.actions.goToOption({ focus: c$1.First });
|
|
2828
|
+
case o4.PageUp:
|
|
2829
|
+
return t.preventDefault(), t.stopPropagation(), e2.actions.goToOption({ focus: c$1.First });
|
|
2830
|
+
case o4.End:
|
|
2831
|
+
if (e2.state.comboboxState === P.Closed || t.shiftKey) break;
|
|
2832
|
+
return t.preventDefault(), t.stopPropagation(), e2.actions.goToOption({ focus: c$1.Last });
|
|
2833
|
+
case o4.PageDown:
|
|
2834
|
+
return t.preventDefault(), t.stopPropagation(), e2.actions.goToOption({ focus: c$1.Last });
|
|
2835
|
+
case o4.Escape:
|
|
2836
|
+
return e2.state.comboboxState !== P.Open ? void 0 : (t.preventDefault(), e2.state.optionsElement && !o4$1.optionsPropsRef.current.static && t.stopPropagation(), o4$1.mode === k3.Single && o4$1.value === null && G2(), e2.actions.closeCombobox());
|
|
2837
|
+
case o4.Tab:
|
|
2838
|
+
if (e2.actions.setIsTyping(false), e2.state.comboboxState !== P.Open) return;
|
|
2839
|
+
o4$1.mode === k3.Single && e2.state.activationTrigger !== _.Focus && e2.actions.selectActiveOption(), e2.actions.closeCombobox();
|
|
2840
|
+
break;
|
|
2841
|
+
}
|
|
2842
|
+
}), D2 = o2((t) => {
|
|
2843
|
+
b3 == null || b3(t), o4$1.mode === k3.Single && t.target.value === "" && G2(), e2.actions.openCombobox();
|
|
2844
|
+
}), K2 = o2((t) => {
|
|
2845
|
+
var P2, N3, g2;
|
|
2846
|
+
let V3 = (P2 = t.relatedTarget) != null ? P2 : n$1.find((i2) => i2 !== t.currentTarget);
|
|
2847
|
+
if (!((N3 = e2.state.optionsElement) != null && N3.contains(V3)) && !((g2 = e2.state.buttonElement) != null && g2.contains(V3)) && e2.state.comboboxState === P.Open) return t.preventDefault(), o4$1.mode === k3.Single && o4$1.value === null && G2(), e2.actions.closeCombobox();
|
|
2848
|
+
}), W = o2((t) => {
|
|
2849
|
+
var P2, N3, g2;
|
|
2850
|
+
let V3 = (P2 = t.relatedTarget) != null ? P2 : n$1.find((i2) => i2 !== t.currentTarget);
|
|
2851
|
+
(N3 = e2.state.buttonElement) != null && N3.contains(V3) || (g2 = e2.state.optionsElement) != null && g2.contains(V3) || o4$1.disabled || o4$1.immediate && e2.state.comboboxState !== P.Open && X.microTask(() => {
|
|
2852
|
+
flushSync(() => e2.actions.openCombobox()), e2.actions.setActivationTrigger(_.Focus);
|
|
2853
|
+
});
|
|
2854
|
+
}), S3 = N(), j3 = w$1(), { isFocused: l4, focusProps: k4 } = $0c4a58759813079a$export$4e328f61c538687f({ autoFocus: f4 }), { isHovered: Y2, hoverProps: s4 } = $e969f22b6713ca4a$export$ae780daf29e6d456({ isDisabled: p5 }), U = S(e2, (t) => t.optionsElement), $ = n2({ open: A2 === P.Open, disabled: p5, invalid: o4$1.invalid, hover: Y2, focus: l4, autofocus: f4 }), ne = V$1({ ref: u10, id: y4, role: "combobox", type: n6, "aria-controls": U == null ? void 0 : U.id, "aria-expanded": A2 === P.Open, "aria-activedescendant": S(e2, e2.selectors.activeDescendantId), "aria-labelledby": S3, "aria-describedby": j3, "aria-autocomplete": "list", defaultValue: (q = (ee = T3.defaultValue) != null ? ee : o4$1.defaultValue !== void 0 ? h2 == null ? void 0 : h2(o4$1.defaultValue) : null) != null ? q : o4$1.defaultValue, disabled: p5 || void 0, autoFocus: f4, onCompositionStart: v3, onCompositionEnd: c5, onKeyDown: z, onChange: D2, onFocus: W, onBlur: K2 }, k4, s4);
|
|
2855
|
+
return K()({ ourProps: ne, theirProps: m3, slot: $, defaultTag: Io, name: "Combobox.Input" });
|
|
2856
|
+
}
|
|
2857
|
+
var _o = "button";
|
|
2858
|
+
function Fo(T3, O) {
|
|
2859
|
+
let e2 = p4("Combobox.Button"), o4$1 = te("Combobox.Button"), [E3, R] = useState(null), y4 = y(O, R, e2.actions.setButtonElement), b3 = r(), { id: h2 = `headlessui-combobox-button-${b3}`, disabled: p5 = o4$1.disabled || false, autoFocus: f4 = false, ...n6 } = T3, [m3, a4, u10] = S(e2, (l4) => [l4.comboboxState, l4.inputElement, l4.optionsElement]), A2 = v(a4), d2 = m3 === P.Open;
|
|
2860
|
+
L(d2, { trigger: E3, action: useCallback((l4) => {
|
|
2861
|
+
if (E3 != null && E3.contains(l4.target)) return S$1.Ignore;
|
|
2862
|
+
if (a4 != null && a4.contains(l4.target)) return S$1.Ignore;
|
|
2863
|
+
let k4 = l4.target.closest('[role="option"]:not([data-disabled])');
|
|
2864
|
+
return n3(k4) ? S$1.Select(k4) : u10 != null && u10.contains(l4.target) ? S$1.Ignore : S$1.Close;
|
|
2865
|
+
}, [E3, a4, u10]), close: e2.actions.closeCombobox, select: e2.actions.selectActiveOption });
|
|
2866
|
+
let X = o2((l4) => {
|
|
2867
|
+
switch (l4.key) {
|
|
2868
|
+
case o4.Space:
|
|
2869
|
+
case o4.Enter:
|
|
2870
|
+
l4.preventDefault(), l4.stopPropagation(), e2.state.comboboxState === P.Closed && flushSync(() => e2.actions.openCombobox()), A2();
|
|
2871
|
+
return;
|
|
2872
|
+
case o4.ArrowDown:
|
|
2873
|
+
l4.preventDefault(), l4.stopPropagation(), e2.state.comboboxState === P.Closed && (flushSync(() => e2.actions.openCombobox()), e2.state.dataRef.current.value || e2.actions.goToOption({ focus: c$1.First })), A2();
|
|
2874
|
+
return;
|
|
2875
|
+
case o4.ArrowUp:
|
|
2876
|
+
l4.preventDefault(), l4.stopPropagation(), e2.state.comboboxState === P.Closed && (flushSync(() => e2.actions.openCombobox()), e2.state.dataRef.current.value || e2.actions.goToOption({ focus: c$1.Last })), A2();
|
|
2877
|
+
return;
|
|
2878
|
+
case o4.Escape:
|
|
2879
|
+
if (e2.state.comboboxState !== P.Open) return;
|
|
2880
|
+
l4.preventDefault(), e2.state.optionsElement && !o4$1.optionsPropsRef.current.static && l4.stopPropagation(), flushSync(() => e2.actions.closeCombobox()), A2();
|
|
2881
|
+
return;
|
|
2882
|
+
default:
|
|
2883
|
+
return;
|
|
2884
|
+
}
|
|
2885
|
+
}), G2 = s(() => {
|
|
2886
|
+
e2.state.comboboxState === P.Open ? e2.actions.closeCombobox() : e2.actions.openCombobox(), A2();
|
|
2887
|
+
}), C = N([h2]), { isFocusVisible: x3, focusProps: v3 } = $0c4a58759813079a$export$4e328f61c538687f({ autoFocus: f4 }), { isHovered: c5, hoverProps: z } = $e969f22b6713ca4a$export$ae780daf29e6d456({ isDisabled: p5 }), { pressed: D2, pressProps: K2 } = w({ disabled: p5 }), W = n2({ open: m3 === P.Open, active: D2 || m3 === P.Open, disabled: p5, invalid: o4$1.invalid, value: o4$1.value, hover: c5, focus: x3 }), S3 = V$1({ ref: y4, id: h2, type: e(T3, E3), tabIndex: -1, "aria-haspopup": "listbox", "aria-controls": u10 == null ? void 0 : u10.id, "aria-expanded": m3 === P.Open, "aria-labelledby": C, disabled: p5 || void 0, autoFocus: f4, onKeyDown: X }, G2, v3, z, K2);
|
|
2888
|
+
return K()({ ourProps: S3, theirProps: n6, slot: W, defaultTag: _o, name: "Combobox.Button" });
|
|
2889
|
+
}
|
|
2890
|
+
var Do = "div";
|
|
2891
|
+
var So = A.RenderStrategy | A.Static;
|
|
2892
|
+
function Mo(T3, O) {
|
|
2893
|
+
var M, Ce, ve;
|
|
2894
|
+
let e2 = r(), { id: o4 = `headlessui-combobox-options-${e2}`, hold: E3 = false, anchor: R, portal: y4 = false, modal: b3 = true, transition: h2 = false, ...p5 } = T3, f4 = p4("Combobox.Options"), n6 = te("Combobox.Options"), m3 = ye(R);
|
|
2895
|
+
m3 && (y4 = true);
|
|
2896
|
+
let [a4, u10] = Re(m3), [A2, d2] = useState(null), X = Te(), G2 = y(O, m3 ? a4 : null, f4.actions.setOptionsElement, d2), [C, x3, v3, c5, z] = S(f4, (_2) => [_2.comboboxState, _2.inputElement, _2.buttonElement, _2.optionsElement, _2.activationTrigger]), D2 = u2$1(x3 || v3), K2 = u2$1(c5), W = u3(), [S3, j3] = N$1(h2, A2, W !== null ? (W & i3.Open) === i3.Open : C === P.Open);
|
|
2897
|
+
p2(S3, x3, f4.actions.closeCombobox);
|
|
2898
|
+
let l4 = n6.__demoMode ? false : b3 && C === P.Open;
|
|
2899
|
+
f2(l4, K2);
|
|
2900
|
+
let k4 = n6.__demoMode ? false : b3 && C === P.Open;
|
|
2901
|
+
y2(k4, { allowed: useCallback(() => [x3, v3, c5], [x3, v3, c5]) });
|
|
2902
|
+
let s4 = S(f4, f4.selectors.didInputMove) ? false : S3;
|
|
2903
|
+
n(() => {
|
|
2904
|
+
var _2;
|
|
2905
|
+
n6.optionsPropsRef.current.static = (_2 = T3.static) != null ? _2 : false;
|
|
2906
|
+
}, [n6.optionsPropsRef, T3.static]), n(() => {
|
|
2907
|
+
n6.optionsPropsRef.current.hold = E3;
|
|
2908
|
+
}, [n6.optionsPropsRef, E3]), F(C === P.Open, { container: c5, accept(_2) {
|
|
2909
|
+
return _2.getAttribute("role") === "option" ? NodeFilter.FILTER_REJECT : _2.hasAttribute("role") ? NodeFilter.FILTER_SKIP : NodeFilter.FILTER_ACCEPT;
|
|
2910
|
+
}, walk(_2) {
|
|
2911
|
+
_2.setAttribute("role", "none");
|
|
2912
|
+
} });
|
|
2913
|
+
let U = N([v3 == null ? void 0 : v3.id]), $ = n2({ open: C === P.Open, option: void 0 }), ne = o2(() => {
|
|
2914
|
+
f4.actions.setActivationTrigger(_.Pointer);
|
|
2915
|
+
}), be = o2((_2) => {
|
|
2916
|
+
_2.preventDefault(), f4.actions.setActivationTrigger(_.Pointer);
|
|
2917
|
+
}), ee = V$1(m3 ? X() : {}, { "aria-labelledby": U, role: "listbox", "aria-multiselectable": n6.mode === k3.Multi ? true : void 0, id: o4, ref: G2, style: { ...p5.style, ...u10, "--input-width": w2(S3, x3, true).width, "--button-width": w2(S3, v3, true).width }, onWheel: z === _.Pointer ? void 0 : ne, onMouseDown: be, ...x2(j3) }), q = S3 && C === P.Closed && !T3.static, t = u4(q, (M = n6.virtual) == null ? void 0 : M.options), V3 = u4(q, n6.value), P2 = useCallback((_2) => n6.compare(V3, _2), [n6.compare, V3]), N3 = useMemo(() => {
|
|
2918
|
+
if (!n6.virtual) return n6;
|
|
2919
|
+
if (t === void 0) throw new Error("Missing `options` in virtual mode");
|
|
2920
|
+
return t !== n6.virtual.options ? { ...n6, virtual: { ...n6.virtual, options: t } } : n6;
|
|
2921
|
+
}, [n6, t, (Ce = n6.virtual) == null ? void 0 : Ce.options]);
|
|
2922
|
+
n6.virtual && Object.assign(p5, { children: L2__default.createElement(de.Provider, { value: N3 }, L2__default.createElement(Eo, { slot: $ }, p5.children)) });
|
|
2923
|
+
let g2 = K(), i2 = useMemo(() => n6.mode === k3.Multi ? n6 : { ...n6, isSelected: P2 }, [n6, P2]);
|
|
2924
|
+
return L2__default.createElement(le, { enabled: y4 ? T3.static || S3 : false, ownerDocument: D2 }, L2__default.createElement(de.Provider, { value: i2 }, g2({ ourProps: ee, theirProps: { ...p5, children: L2__default.createElement(s2, { freeze: q }, typeof p5.children == "function" ? (ve = p5.children) == null ? void 0 : ve.call(p5, $) : p5.children) }, slot: $, defaultTag: Do, features: So, visible: s4, name: "Combobox.Options" })));
|
|
2925
|
+
}
|
|
2926
|
+
var Lo = "div";
|
|
2927
|
+
function Vo(T3, O) {
|
|
2928
|
+
var l4, k4, Y2;
|
|
2929
|
+
let e2 = te("Combobox.Option"), o4 = p4("Combobox.Option"), E3 = r(), { id: R = `headlessui-combobox-option-${E3}`, value: y4, disabled: b3 = (Y2 = (k4 = (l4 = e2.virtual) == null ? void 0 : l4.disabled) == null ? void 0 : k4.call(l4, y4)) != null ? Y2 : false, order: h2 = null, ...p5 } = T3, [f4] = S(o4, (s4) => [s4.inputElement]), n6 = v(f4), m3 = S(o4, useCallback((s4) => o4.selectors.isActive(s4, y4, R), [y4, R])), a4 = e2.isSelected(y4), u10 = useRef(null), A2 = s$1({ disabled: b3, value: y4, domRef: u10, order: h2 }), d2 = useContext(Le), X = y(O, u10, d2 ? d2.measureElement : null), G2 = o2(() => {
|
|
2930
|
+
o4.actions.setIsTyping(false), o4.actions.onChange(y4);
|
|
2931
|
+
});
|
|
2932
|
+
n(() => o4.actions.registerOption(R, A2), [A2, R]);
|
|
2933
|
+
let C = S(o4, useCallback((s4) => o4.selectors.shouldScrollIntoView(s4, y4, R), [y4, R]));
|
|
2934
|
+
n(() => {
|
|
2935
|
+
if (C) return o().requestAnimationFrame(() => {
|
|
2936
|
+
var s4, U;
|
|
2937
|
+
(U = (s4 = u10.current) == null ? void 0 : s4.scrollIntoView) == null || U.call(s4, { block: "nearest" });
|
|
2938
|
+
});
|
|
2939
|
+
}, [C, u10]);
|
|
2940
|
+
let x3 = o2((s4) => {
|
|
2941
|
+
s4.preventDefault(), s4.button === g2.Left && (b3 || (G2(), n4() || requestAnimationFrame(() => n6()), e2.mode === k3.Single && o4.actions.closeCombobox()));
|
|
2942
|
+
}), v3 = o2(() => {
|
|
2943
|
+
if (b3) return o4.actions.goToOption({ focus: c$1.Nothing });
|
|
2944
|
+
let s4 = e2.calculateIndex(y4);
|
|
2945
|
+
o4.actions.goToOption({ focus: c$1.Specific, idx: s4 });
|
|
2946
|
+
}), c5 = u3$1(), z = o2((s4) => c5.update(s4)), D2 = o2((s4) => {
|
|
2947
|
+
if (!c5.wasMoved(s4) || b3 || m3 && o4.state.activationTrigger === _.Pointer) return;
|
|
2948
|
+
let U = e2.calculateIndex(y4);
|
|
2949
|
+
o4.actions.goToOption({ focus: c$1.Specific, idx: U }, _.Pointer);
|
|
2950
|
+
}), K2 = o2((s4) => {
|
|
2951
|
+
c5.wasMoved(s4) && (b3 || m3 && (e2.optionsPropsRef.current.hold || o4.state.activationTrigger === _.Pointer && o4.actions.goToOption({ focus: c$1.Nothing })));
|
|
2952
|
+
}), W = n2({ active: m3, focus: m3, selected: a4, disabled: b3 }), S3 = { id: R, ref: X, role: "option", tabIndex: b3 === true ? void 0 : -1, "aria-disabled": b3 === true ? true : void 0, "aria-selected": a4, disabled: void 0, onMouseDown: x3, onFocus: v3, onPointerEnter: z, onMouseEnter: z, onPointerMove: D2, onMouseMove: D2, onPointerLeave: K2, onMouseLeave: K2 };
|
|
2953
|
+
return K()({ ourProps: S3, theirProps: p5, slot: W, defaultTag: Lo, name: "Combobox.Option" });
|
|
2954
|
+
}
|
|
2955
|
+
var wo = Y(Ao);
|
|
2956
|
+
var Bo = Y(Fo);
|
|
2957
|
+
var ko = Y(Ro);
|
|
2958
|
+
var No = Z;
|
|
2959
|
+
var Uo = Y(Mo);
|
|
2960
|
+
var Ho = Y(Vo);
|
|
2961
|
+
var Ht = Object.assign(wo, { Input: ko, Button: Bo, Label: No, Options: Uo, Option: Ho });
|
|
2962
|
+
var Combobox = ({
|
|
2963
|
+
options,
|
|
2964
|
+
value,
|
|
2965
|
+
onChange,
|
|
2966
|
+
onSearch,
|
|
2967
|
+
placeholder = "Search...",
|
|
2968
|
+
multiple = false,
|
|
2969
|
+
isLoading = false,
|
|
2970
|
+
disabled = false,
|
|
2971
|
+
name,
|
|
2972
|
+
id,
|
|
2973
|
+
className
|
|
2974
|
+
}) => {
|
|
2975
|
+
const { formatMessage } = useIntl();
|
|
2976
|
+
const [query, setQuery] = useState("");
|
|
2977
|
+
const filteredOptions = useMemo(() => {
|
|
2978
|
+
if (onSearch) return options;
|
|
2979
|
+
if (!query) return options;
|
|
2980
|
+
return options.filter(
|
|
2981
|
+
(opt) => opt.label.toLowerCase().includes(query.toLowerCase())
|
|
2982
|
+
);
|
|
2983
|
+
}, [options, query, onSearch]);
|
|
2984
|
+
const handleInputChange = (e2) => {
|
|
2985
|
+
const q = e2.target.value;
|
|
2986
|
+
setQuery(q);
|
|
2987
|
+
onSearch?.(q);
|
|
2988
|
+
};
|
|
2989
|
+
const selectedLabels = useMemo(() => {
|
|
2990
|
+
if (!multiple || !Array.isArray(value)) return [];
|
|
2991
|
+
return value.map((v3) => options.find((o4) => o4.value === v3)).filter(Boolean);
|
|
2992
|
+
}, [value, options, multiple]);
|
|
2993
|
+
const displayValue = useMemo(() => {
|
|
2994
|
+
if (multiple) return "";
|
|
2995
|
+
if (!value || Array.isArray(value)) return "";
|
|
2996
|
+
return options.find((o4) => o4.value === value)?.label || "";
|
|
2997
|
+
}, [value, options, multiple]);
|
|
2998
|
+
if (multiple) {
|
|
2999
|
+
return /* @__PURE__ */ jsxs("div", { className, children: [
|
|
3000
|
+
selectedLabels.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 mb-2", children: selectedLabels.map((opt) => /* @__PURE__ */ jsx(
|
|
3001
|
+
Badge_default,
|
|
3002
|
+
{
|
|
3003
|
+
text: opt.label,
|
|
3004
|
+
color: "slate",
|
|
3005
|
+
onClick: () => {
|
|
3006
|
+
const next = value.filter(
|
|
3007
|
+
(v3) => v3 !== opt.value
|
|
3008
|
+
);
|
|
3009
|
+
onChange(next);
|
|
3010
|
+
}
|
|
3011
|
+
},
|
|
3012
|
+
opt.value
|
|
3013
|
+
)) }),
|
|
3014
|
+
/* @__PURE__ */ jsx(
|
|
3015
|
+
Ht,
|
|
3016
|
+
{
|
|
3017
|
+
value: value || [],
|
|
3018
|
+
onChange,
|
|
3019
|
+
multiple: true,
|
|
3020
|
+
disabled,
|
|
3021
|
+
name,
|
|
3022
|
+
immediate: true,
|
|
3023
|
+
children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
3024
|
+
/* @__PURE__ */ jsx(
|
|
3025
|
+
ko,
|
|
3026
|
+
{
|
|
3027
|
+
id,
|
|
3028
|
+
className: "w-full rounded-md border border-border-default bg-surface-input py-2 pl-3 pr-10 text-sm text-text-primary placeholder:text-text-muted shadow-xs focus:outline-hidden focus:ring-2 focus:ring-focus-ring",
|
|
3029
|
+
placeholder,
|
|
3030
|
+
onChange: handleInputChange,
|
|
3031
|
+
displayValue: () => query
|
|
3032
|
+
}
|
|
3033
|
+
),
|
|
3034
|
+
/* @__PURE__ */ jsx(Bo, { className: "absolute inset-y-0 right-0 flex items-center pr-2", children: /* @__PURE__ */ jsx(
|
|
3035
|
+
ChevronUpDownIcon_default,
|
|
3036
|
+
{
|
|
3037
|
+
className: "h-5 w-5 text-text-muted",
|
|
3038
|
+
"aria-hidden": "true"
|
|
3039
|
+
}
|
|
3040
|
+
) }),
|
|
3041
|
+
/* @__PURE__ */ jsx(Uo, { className: "absolute z-50 mt-1 max-h-60 w-full overflow-auto rounded-md bg-surface border border-border-subtle py-1 text-sm shadow-lg focus:outline-hidden", children: isLoading ? /* @__PURE__ */ jsx("div", { className: "px-4 py-2 text-text-muted", children: formatMessage({
|
|
3042
|
+
id: "loading",
|
|
3043
|
+
defaultMessage: "Loading ..."
|
|
3044
|
+
}) }) : filteredOptions.length === 0 ? /* @__PURE__ */ jsx("div", { className: "px-4 py-2 text-text-muted", children: formatMessage({
|
|
3045
|
+
id: "no_results_found",
|
|
3046
|
+
defaultMessage: "No results found"
|
|
3047
|
+
}) }) : filteredOptions.map((opt) => /* @__PURE__ */ jsx(
|
|
3048
|
+
Ho,
|
|
3049
|
+
{
|
|
3050
|
+
value: opt.value,
|
|
3051
|
+
className: "group relative cursor-pointer select-none py-2 pl-10 pr-4 text-text-primary data-focus:bg-surface-raised",
|
|
3052
|
+
children: ({ selected }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
3053
|
+
/* @__PURE__ */ jsx(
|
|
3054
|
+
"span",
|
|
3055
|
+
{
|
|
3056
|
+
className: clsx_default(
|
|
3057
|
+
"block truncate",
|
|
3058
|
+
selected && "font-medium"
|
|
3059
|
+
),
|
|
3060
|
+
children: opt.label
|
|
3061
|
+
}
|
|
3062
|
+
),
|
|
3063
|
+
selected && /* @__PURE__ */ jsx("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-accent", children: /* @__PURE__ */ jsx(CheckIcon_default, { className: "h-5 w-5", "aria-hidden": "true" }) })
|
|
3064
|
+
] })
|
|
3065
|
+
},
|
|
3066
|
+
opt.value
|
|
3067
|
+
)) })
|
|
3068
|
+
] })
|
|
3069
|
+
}
|
|
3070
|
+
)
|
|
3071
|
+
] });
|
|
3072
|
+
}
|
|
3073
|
+
return /* @__PURE__ */ jsx(
|
|
3074
|
+
Ht,
|
|
3075
|
+
{
|
|
3076
|
+
value: value || null,
|
|
3077
|
+
onChange,
|
|
3078
|
+
disabled,
|
|
3079
|
+
name,
|
|
3080
|
+
children: /* @__PURE__ */ jsxs("div", { className: clsx_default("relative", className), children: [
|
|
3081
|
+
/* @__PURE__ */ jsx(
|
|
3082
|
+
ko,
|
|
3083
|
+
{
|
|
3084
|
+
id,
|
|
3085
|
+
className: "w-full rounded-md border border-border-default bg-surface-input py-2.5 pl-4 pr-10 text-sm text-text-primary placeholder:text-text-muted shadow-xs focus:outline-hidden focus:ring-2 focus:ring-focus-ring",
|
|
3086
|
+
placeholder,
|
|
3087
|
+
onChange: handleInputChange,
|
|
3088
|
+
displayValue: () => query || displayValue
|
|
3089
|
+
}
|
|
3090
|
+
),
|
|
3091
|
+
/* @__PURE__ */ jsx(Bo, { className: "absolute inset-y-0 right-0 flex items-center pr-2", children: /* @__PURE__ */ jsx(
|
|
3092
|
+
ChevronUpDownIcon_default,
|
|
3093
|
+
{
|
|
3094
|
+
className: "h-5 w-5 text-text-muted",
|
|
3095
|
+
"aria-hidden": "true"
|
|
3096
|
+
}
|
|
3097
|
+
) }),
|
|
3098
|
+
/* @__PURE__ */ jsx(Uo, { className: "absolute z-50 mt-1 max-h-60 w-full overflow-auto rounded-md bg-surface border border-border-subtle py-1 text-sm shadow-lg focus:outline-hidden", children: isLoading ? /* @__PURE__ */ jsx("div", { className: "px-4 py-2 text-text-muted", children: formatMessage({ id: "loading", defaultMessage: "Loading ..." }) }) : filteredOptions.length === 0 ? /* @__PURE__ */ jsx("div", { className: "px-4 py-2 text-text-muted", children: formatMessage({
|
|
3099
|
+
id: "no_results_found",
|
|
3100
|
+
defaultMessage: "No results found"
|
|
3101
|
+
}) }) : filteredOptions.map((opt) => /* @__PURE__ */ jsx(
|
|
3102
|
+
Ho,
|
|
3103
|
+
{
|
|
3104
|
+
value: opt.value,
|
|
3105
|
+
className: "group relative cursor-pointer select-none py-2 pl-10 pr-4 text-text-primary data-focus:bg-surface-raised",
|
|
3106
|
+
children: ({ selected }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
3107
|
+
/* @__PURE__ */ jsx(
|
|
3108
|
+
"span",
|
|
3109
|
+
{
|
|
3110
|
+
className: clsx_default(
|
|
3111
|
+
"block truncate",
|
|
3112
|
+
selected && "font-medium"
|
|
3113
|
+
),
|
|
3114
|
+
children: opt.label
|
|
3115
|
+
}
|
|
3116
|
+
),
|
|
3117
|
+
selected && /* @__PURE__ */ jsx("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-accent", children: /* @__PURE__ */ jsx(CheckIcon_default, { className: "h-5 w-5", "aria-hidden": "true" }) })
|
|
3118
|
+
] })
|
|
3119
|
+
},
|
|
3120
|
+
opt.value
|
|
3121
|
+
)) })
|
|
3122
|
+
] })
|
|
3123
|
+
}
|
|
3124
|
+
);
|
|
3125
|
+
};
|
|
3126
|
+
var Combobox_default = Combobox;
|
|
3127
|
+
|
|
3128
|
+
export { CheckboxField_default as CheckboxField, ChoicesField_default as ChoicesField, Combobox_default as Combobox, DatePickerField_default as DatePickerField, EmailField_default as EmailField, FieldWithHelp_default as FieldWithHelp, JSONAreaField_default as JSONAreaField, PasswordField_default as PasswordField, SelectField_default as SelectField, TextAreaField_default as TextAreaField };
|