prometeo-design-system 3.1.5 → 3.1.7
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/Avatar.d.ts +4 -0
- package/dist/Avatar.es.js +94 -0
- package/dist/Button.d.ts +6 -0
- package/dist/Button.es.js +400 -0
- package/dist/CardProfile-y9Knsg26.js +280 -0
- package/dist/CardProfile.d.ts +6 -0
- package/dist/CardProfile.es.js +5 -0
- package/dist/CheckBox.d.ts +6 -0
- package/dist/CheckBox.es.js +112 -0
- package/dist/DatePicker-6eb-0Ns5.js +3733 -0
- package/dist/DatePicker.d.ts +6 -0
- package/dist/DatePicker.es.js +5 -0
- package/dist/DialogModal.d.ts +6 -0
- package/dist/DialogModal.es.js +75 -0
- package/dist/DrawerDesktop.d.ts +6 -0
- package/dist/DrawerDesktop.es.js +217 -0
- package/dist/DrawerMobile.d.ts +6 -0
- package/dist/DrawerMobile.es.js +243 -0
- package/dist/DropZone.d.ts +6 -0
- package/dist/DropZone.es.js +88 -0
- package/dist/FAButton.d.ts +4 -0
- package/dist/FAButton.es.js +111 -0
- package/dist/Header.d.ts +6 -0
- package/dist/Header.es.js +32 -0
- package/dist/HelperComponent-ljsn0xD6.js +26 -0
- package/dist/Icons/AccountCircle.d.ts +6 -0
- package/dist/Icons/AccountCircle.es.js +21 -0
- package/dist/Icons/Add.d.ts +6 -0
- package/dist/Icons/Add.es.js +19 -0
- package/dist/Icons/ArrowLeft.d.ts +6 -0
- package/dist/Icons/ArrowLeft.es.js +19 -0
- package/dist/Icons/ArrowUpDown.d.ts +6 -0
- package/dist/Icons/ArrowUpDown.es.js +21 -0
- package/dist/Icons/AttachFile.d.ts +6 -0
- package/dist/Icons/AttachFile.es.js +19 -0
- package/dist/Icons/Boards.d.ts +6 -0
- package/dist/Icons/Boards.es.js +19 -0
- package/dist/Icons/Calendar.d.ts +6 -0
- package/dist/Icons/Calendar.es.js +19 -0
- package/dist/Icons/Cancel.d.ts +6 -0
- package/dist/Icons/Cancel.es.js +19 -0
- package/dist/Icons/Check.d.ts +6 -0
- package/dist/Icons/Check.es.js +19 -0
- package/dist/Icons/CheckCircle.d.ts +6 -0
- package/dist/Icons/CheckCircle.es.js +21 -0
- package/dist/Icons/CheckList.d.ts +6 -0
- package/dist/Icons/CheckList.es.js +25 -0
- package/dist/Icons/ChevronDown.d.ts +6 -0
- package/dist/Icons/ChevronDown.es.js +21 -0
- package/dist/Icons/Clock.d.ts +6 -0
- package/dist/Icons/Clock.es.js +19 -0
- package/dist/Icons/Close.d.ts +6 -0
- package/dist/Icons/Close.es.js +19 -0
- package/dist/Icons/CloseNavBarDesktop.d.ts +6 -0
- package/dist/Icons/CloseNavBarDesktop.es.js +36 -0
- package/dist/Icons/Collapse.d.ts +6 -0
- package/dist/Icons/Collapse.es.js +19 -0
- package/dist/Icons/Company.d.ts +6 -0
- package/dist/Icons/Company.es.js +25 -0
- package/dist/Icons/Copy.d.ts +6 -0
- package/dist/Icons/Copy.es.js +19 -0
- package/dist/Icons/CrevronLeft.d.ts +6 -0
- package/dist/Icons/CrevronLeft.es.js +21 -0
- package/dist/Icons/CrevronRight.d.ts +6 -0
- package/dist/Icons/CrevronRight.es.js +21 -0
- package/dist/Icons/DocumentFill.d.ts +6 -0
- package/dist/Icons/DocumentFill.es.js +27 -0
- package/dist/Icons/Download.d.ts +6 -0
- package/dist/Icons/Download.es.js +25 -0
- package/dist/Icons/Edit.d.ts +6 -0
- package/dist/Icons/Edit.es.js +19 -0
- package/dist/Icons/EditFill.d.ts +6 -0
- package/dist/Icons/EditFill.es.js +25 -0
- package/dist/Icons/Email.d.ts +6 -0
- package/dist/Icons/Email.es.js +25 -0
- package/dist/Icons/Error.d.ts +6 -0
- package/dist/Icons/Error.es.js +19 -0
- package/dist/Icons/EyeVisibility.d.ts +6 -0
- package/dist/Icons/EyeVisibility.es.js +21 -0
- package/dist/Icons/EyeVisibilityOff.d.ts +6 -0
- package/dist/Icons/EyeVisibilityOff.es.js +21 -0
- package/dist/Icons/FaLock.d.ts +6 -0
- package/dist/Icons/FaLock.es.js +19 -0
- package/dist/Icons/FastForward.d.ts +6 -0
- package/dist/Icons/FastForward.es.js +27 -0
- package/dist/Icons/File.d.ts +6 -0
- package/dist/Icons/File.es.js +25 -0
- package/dist/Icons/Filter.d.ts +6 -0
- package/dist/Icons/Filter.es.js +19 -0
- package/dist/Icons/FormatColorText.d.ts +6 -0
- package/dist/Icons/FormatColorText.es.js +26 -0
- package/dist/Icons/Help.d.ts +6 -0
- package/dist/Icons/Help.es.js +19 -0
- package/dist/Icons/HistoryActivity.d.ts +6 -0
- package/dist/Icons/HistoryActivity.es.js +21 -0
- package/dist/Icons/Home.d.ts +6 -0
- package/dist/Icons/Home.es.js +19 -0
- package/dist/Icons/Image.d.ts +6 -0
- package/dist/Icons/Image.es.js +25 -0
- package/dist/Icons/Info.d.ts +6 -0
- package/dist/Icons/Info.es.js +19 -0
- package/dist/Icons/Logout.d.ts +6 -0
- package/dist/Icons/Logout.es.js +19 -0
- package/dist/Icons/MessageSquare.d.ts +6 -0
- package/dist/Icons/MessageSquare.es.js +21 -0
- package/dist/Icons/MessageSquareFill.d.ts +6 -0
- package/dist/Icons/MessageSquareFill.es.js +27 -0
- package/dist/Icons/MoreVert.d.ts +6 -0
- package/dist/Icons/MoreVert.es.js +19 -0
- package/dist/Icons/Notifications.d.ts +6 -0
- package/dist/Icons/Notifications.es.js +21 -0
- package/dist/Icons/Pause.d.ts +6 -0
- package/dist/Icons/Pause.es.js +19 -0
- package/dist/Icons/Reassignment.d.ts +6 -0
- package/dist/Icons/Reassignment.es.js +22 -0
- package/dist/Icons/ReassignmentFill.d.ts +6 -0
- package/dist/Icons/ReassignmentFill.es.js +52 -0
- package/dist/Icons/Reload.d.ts +6 -0
- package/dist/Icons/Reload.es.js +25 -0
- package/dist/Icons/Search.d.ts +6 -0
- package/dist/Icons/Search.es.js +19 -0
- package/dist/Icons/Send.d.ts +6 -0
- package/dist/Icons/Send.es.js +24 -0
- package/dist/Icons/Settings.d.ts +6 -0
- package/dist/Icons/Settings.es.js +19 -0
- package/dist/Icons/Shared.d.ts +6 -0
- package/dist/Icons/Shared.es.js +19 -0
- package/dist/Icons/Sort.d.ts +6 -0
- package/dist/Icons/Sort.es.js +19 -0
- package/dist/Icons/Stars.d.ts +6 -0
- package/dist/Icons/Stars.es.js +19 -0
- package/dist/Icons/Ticket.d.ts +6 -0
- package/dist/Icons/Ticket.es.js +19 -0
- package/dist/Icons/TicketFilled.d.ts +6 -0
- package/dist/Icons/TicketFilled.es.js +21 -0
- package/dist/Icons/Trash.d.ts +6 -0
- package/dist/Icons/Trash.es.js +19 -0
- package/dist/Icons/TrashFill.d.ts +6 -0
- package/dist/Icons/TrashFill.es.js +25 -0
- package/dist/Icons/Upload.d.ts +6 -0
- package/dist/Icons/Upload.es.js +19 -0
- package/dist/Icons/UploadCloud.d.ts +6 -0
- package/dist/Icons/UploadCloud.es.js +21 -0
- package/dist/Icons/UserAdd.d.ts +6 -0
- package/dist/Icons/UserAdd.es.js +19 -0
- package/dist/Icons/UserAddFill.d.ts +6 -0
- package/dist/Icons/UserAddFill.es.js +27 -0
- package/dist/Icons/UserPerson.d.ts +6 -0
- package/dist/Icons/UserPerson.es.js +19 -0
- package/dist/Icons/WhatsApp.d.ts +6 -0
- package/dist/Icons/WhatsApp.es.js +76 -0
- package/dist/Icons/components/AccountCircle.d.ts +4 -0
- package/dist/Icons/components/Add.d.ts +4 -0
- package/dist/Icons/components/ArrowLeft.d.ts +4 -0
- package/dist/Icons/components/ArrowUpDown.d.ts +4 -0
- package/dist/Icons/components/AttachFile.d.ts +4 -0
- package/dist/Icons/components/Boards.d.ts +4 -0
- package/dist/Icons/components/Calendar.d.ts +4 -0
- package/dist/Icons/components/Cancel.d.ts +4 -0
- package/dist/Icons/components/Check.d.ts +4 -0
- package/dist/Icons/components/CheckCircle.d.ts +4 -0
- package/dist/Icons/components/CheckList.d.ts +4 -0
- package/dist/Icons/components/ChevronDown.d.ts +4 -0
- package/dist/Icons/components/Clock.d.ts +4 -0
- package/dist/Icons/components/Close.d.ts +4 -0
- package/dist/Icons/components/CloseNavBarDesktop.d.ts +4 -0
- package/dist/Icons/components/Collapse.d.ts +4 -0
- package/dist/Icons/components/Company.d.ts +4 -0
- package/dist/Icons/components/Copy.d.ts +4 -0
- package/dist/Icons/components/CrevronLeft.d.ts +4 -0
- package/dist/Icons/components/CrevronRight.d.ts +4 -0
- package/dist/Icons/components/DocumentFill.d.ts +4 -0
- package/dist/Icons/components/Download.d.ts +4 -0
- package/dist/Icons/components/Edit.d.ts +4 -0
- package/dist/Icons/components/EditFill.d.ts +4 -0
- package/dist/Icons/components/Email.d.ts +4 -0
- package/dist/Icons/components/Error.d.ts +4 -0
- package/dist/Icons/components/EyeVisibility.d.ts +4 -0
- package/dist/Icons/components/EyeVisibilityOff.d.ts +4 -0
- package/dist/Icons/components/FaLock.d.ts +4 -0
- package/dist/Icons/components/FastForward.d.ts +4 -0
- package/dist/Icons/components/File.d.ts +4 -0
- package/dist/Icons/components/Filter.d.ts +4 -0
- package/dist/Icons/components/FormatColorText.d.ts +4 -0
- package/dist/Icons/components/Help.d.ts +4 -0
- package/dist/Icons/components/HistoryActivity.d.ts +4 -0
- package/dist/Icons/components/Home.d.ts +4 -0
- package/dist/Icons/components/Image.d.ts +4 -0
- package/dist/Icons/components/Info.d.ts +4 -0
- package/dist/Icons/components/Logout.d.ts +4 -0
- package/dist/Icons/components/MessageSquare.d.ts +4 -0
- package/dist/Icons/components/MessageSquareFill.d.ts +4 -0
- package/dist/Icons/components/MoreVert.d.ts +4 -0
- package/dist/Icons/components/Notifications.d.ts +4 -0
- package/dist/Icons/components/Pause.d.ts +4 -0
- package/dist/Icons/components/Reassignment.d.ts +4 -0
- package/dist/Icons/components/ReassignmentFill.d.ts +4 -0
- package/dist/Icons/components/Reload.d.ts +4 -0
- package/dist/Icons/components/Search.d.ts +4 -0
- package/dist/Icons/components/Send.d.ts +4 -0
- package/dist/Icons/components/Settings.d.ts +4 -0
- package/dist/Icons/components/Shared.d.ts +4 -0
- package/dist/Icons/components/Sort.d.ts +4 -0
- package/dist/Icons/components/Stars.d.ts +4 -0
- package/dist/Icons/components/Ticket.d.ts +4 -0
- package/dist/Icons/components/TicketFilled.d.ts +4 -0
- package/dist/Icons/components/Trash.d.ts +4 -0
- package/dist/Icons/components/TrashFill.d.ts +4 -0
- package/dist/Icons/components/Upload.d.ts +4 -0
- package/dist/Icons/components/UploadCloud.d.ts +4 -0
- package/dist/Icons/components/UserAdd.d.ts +4 -0
- package/dist/Icons/components/UserAddFill.d.ts +4 -0
- package/dist/Icons/components/UserPerson.d.ts +4 -0
- package/dist/Icons/components/WhatsApp.d.ts +4 -0
- package/dist/Icons/iconUtils.d.ts +7 -0
- package/dist/Icons/index.d.ts +65 -0
- package/dist/Icons/types.d.ts +130 -0
- package/dist/Icons.d.ts +2 -0
- package/dist/Icons.es.js +128 -0
- package/dist/Image.d.ts +4 -0
- package/dist/Image.es.js +91 -0
- package/dist/ImageGallery-DG9ovlQ-.js +319 -0
- package/dist/ImageGallery.d.ts +6 -0
- package/dist/ImageGallery.es.js +23 -0
- package/dist/Input.d.ts +6 -0
- package/dist/Input.es.js +220 -0
- package/dist/InputMultiple.d.ts +6 -0
- package/dist/InputMultiple.es.js +265 -0
- package/dist/LayoutGeneric-CfWhV1ov.js +26 -0
- package/dist/LayoutGeneric.d.ts +6 -0
- package/dist/LayoutGeneric.es.js +4 -0
- package/dist/Logo.d.ts +4 -0
- package/dist/Logo.es.js +9 -0
- package/dist/Menu.d.ts +6 -0
- package/dist/Menu.es.js +77 -0
- package/dist/NotificationCard.d.ts +6 -0
- package/dist/NotificationCard.es.js +50 -0
- package/dist/OtpInput.d.ts +6 -0
- package/dist/OtpInput.es.js +302 -0
- package/dist/Pagination.d.ts +6 -0
- package/dist/Pagination.es.js +97 -0
- package/dist/ProfilePictureUpload.d.ts +6 -0
- package/dist/ProfilePictureUpload.es.js +189 -0
- package/dist/ProgressBar.d.ts +6 -0
- package/dist/ProgressBar.es.js +70 -0
- package/dist/PyrionNavigationDrawer.d.ts +6 -0
- package/dist/PyrionNavigationDrawer.es.js +962 -0
- package/dist/RadioButton.d.ts +6 -0
- package/dist/RadioButton.es.js +78 -0
- package/dist/RecurrentDatePicker.d.ts +2 -0
- package/dist/RecurrentDatePicker.es.js +694 -0
- package/dist/RecurrentDatePickerRRule.d.ts +2 -0
- package/dist/RecurrentDatePickerRRule.es.js +1682 -0
- package/dist/Scrollable.d.ts +2 -0
- package/dist/Scrollable.es.js +260 -0
- package/dist/SegmentedButton.d.ts +6 -0
- package/dist/SegmentedButton.es.js +185 -0
- package/dist/Select.d.ts +6 -0
- package/dist/Select.es.js +1061 -0
- package/dist/SelectSearch.d.ts +6 -0
- package/dist/SelectSearch.es.js +284 -0
- package/dist/Skeleton.d.ts +6 -0
- package/dist/Skeleton.es.js +74 -0
- package/dist/Spinner.d.ts +6 -0
- package/dist/Spinner.es.js +178 -0
- package/dist/Steps.d.ts +6 -0
- package/dist/Steps.es.js +214 -0
- package/dist/SwipeContainer.d.ts +4 -0
- package/dist/SwipeContainer.es.js +185 -0
- package/dist/Switch.d.ts +6 -0
- package/dist/Switch.es.js +97 -0
- package/dist/TabLinks.d.ts +4 -0
- package/dist/TabLinks.es.js +94 -0
- package/dist/Table.d.ts +2 -0
- package/dist/Table.es.js +121 -0
- package/dist/TextArea.d.ts +4 -0
- package/dist/TextArea.es.js +66 -0
- package/dist/TicketCard.d.ts +6 -0
- package/dist/TicketCard.es.js +130 -0
- package/dist/Toast.d.ts +6 -0
- package/dist/Toast.es.js +150 -0
- package/dist/ToastProvider.d.ts +6 -0
- package/dist/ToastProvider.es.js +6 -0
- package/dist/Tooltip.d.ts +6 -0
- package/dist/Tooltip.es.js +62 -0
- package/dist/assets/psmlogo.png +0 -0
- package/dist/badge-B1IK_-i5.js +87 -0
- package/dist/cn-B6yFEsav.js +8 -0
- package/dist/components/Autocomplete/Autocomplete.d.ts +20 -0
- package/dist/components/Autocomplete/useAutocomplete.d.ts +43 -0
- package/dist/components/Avatar/Avatar.d.ts +11 -0
- package/dist/components/Avatar/index.d.ts +1 -0
- package/dist/components/Button/Button.d.ts +23 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Card/Card.d.ts +12 -0
- package/dist/components/CardProfile/CardProfile.d.ts +55 -0
- package/dist/components/CheckBox/CheckBox.d.ts +11 -0
- package/dist/components/DatePicker/DatePicker.d.ts +82 -0
- package/dist/components/Dialog/Dialog.d.ts +35 -0
- package/dist/components/Dialog/DialogV2.d.ts +35 -0
- package/dist/components/Dialog/useDialogControl.d.ts +8 -0
- package/dist/components/Drawer/DrawerDesktop.d.ts +21 -0
- package/dist/components/Drawer/DrawerMobile.d.ts +24 -0
- package/dist/components/Drawer/useDrawerDesktop.d.ts +8 -0
- package/dist/components/Drawer/useDrawerMobile.d.ts +8 -0
- package/dist/components/DropZone/DropZone.d.ts +16 -0
- package/dist/components/DropZone/DropzoneCompossable.d.ts +54 -0
- package/dist/components/DropZone/useFileDropzone.d.ts +21 -0
- package/dist/components/FAB/FAButton.d.ts +21 -0
- package/dist/components/FileCard/FileCard.d.ts +52 -0
- package/dist/components/Header/Header.d.ts +11 -0
- package/dist/components/Image/GalleryPreview.d.ts +8 -0
- package/dist/components/Image/Image.d.ts +23 -0
- package/dist/components/Image/ImageGallery.d.ts +18 -0
- package/dist/components/Image/LightBox.d.ts +14 -0
- package/dist/components/Image/index.d.ts +5 -0
- package/dist/components/Image/useImageGallery.d.ts +10 -0
- package/dist/components/Input/Input.d.ts +34 -0
- package/dist/components/InputMultiple/InputMultiple.d.ts +25 -0
- package/dist/components/Layout/LayoutGeneric.d.ts +6 -0
- package/dist/components/Logo/Logo.d.ts +2 -0
- package/dist/components/Menu/MenuComposable.d.ts +15 -0
- package/dist/components/NavigationDrawer/NavItemSecondary.d.ts +10 -0
- package/dist/components/NavigationDrawer/NavigationDrawer.d.ts +49 -0
- package/dist/components/NavigationDrawer/NavigationDrawerActionItem.d.ts +16 -0
- package/dist/components/NavigationDrawer/NavigationDrawerActions.d.ts +9 -0
- package/dist/components/NavigationDrawer/NavigationDrawerItemBase.d.ts +18 -0
- package/dist/components/NavigationDrawer/NavigationDrawerLinkItem.d.ts +30 -0
- package/dist/components/NavigationDrawer/NavigationDrawerNavlinks.d.ts +11 -0
- package/dist/components/NavigationDrawer/index.d.ts +2 -0
- package/dist/components/NotificationCard/NotificationCard.d.ts +25 -0
- package/dist/components/NotificationCard/index.d.ts +3 -0
- package/dist/components/OtpInput/OtpInput.d.ts +30 -0
- package/dist/components/Pagination/Pagination.d.ts +6 -0
- package/dist/components/ProfilePictureUpload/ProfilePictureUpload.d.ts +19 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +18 -0
- package/dist/components/PyrionNavigationDrawer/PyrionHelpSection.d.ts +8 -0
- package/dist/components/PyrionNavigationDrawer/PyrionNavigationDrawer.d.ts +130 -0
- package/dist/components/PyrionNavigationDrawer/PyrionNavigationDrawerMobileAppSwitcher.d.ts +10 -0
- package/dist/components/PyrionNavigationDrawer/PyrionNavigationDrawerSystemLogo.d.ts +7 -0
- package/dist/components/PyrionNavigationDrawer/PyrionNotificationsList.d.ts +8 -0
- package/dist/components/PyrionNavigationDrawer/SidebarContent.d.ts +13 -0
- package/dist/components/PyrionNavigationDrawer/SystemSessions.d.ts +12 -0
- package/dist/components/PyrionNavigationDrawer/index.d.ts +3 -0
- package/dist/components/RadioButton/RadioButton.d.ts +14 -0
- package/dist/components/RecurrentDatePicker/CustomFrequencySettings.d.ts +40 -0
- package/dist/components/RecurrentDatePicker/FrequencySettings.d.ts +13 -0
- package/dist/components/RecurrentDatePicker/MonthlyFrequencySettings.d.ts +35 -0
- package/dist/components/RecurrentDatePicker/PreviewCalendar.d.ts +5 -0
- package/dist/components/RecurrentDatePicker/RecurrentDatePicker.d.ts +39 -0
- package/dist/components/RecurrentDatePicker/RecurrentDatePickerRRule.d.ts +13 -0
- package/dist/components/RecurrentDatePicker/WeekdaysSelector.d.ts +13 -0
- package/dist/components/RecurrentDatePicker/WeeklyFrequencySetting.d.ts +9 -0
- package/dist/components/RecurrentDatePicker/YearlyFrequencySettings.d.ts +21 -0
- package/dist/components/RecurrentDatePicker/recurrentDatePicker.validations.d.ts +69 -0
- package/dist/components/Scrollable/Scrollable.d.ts +31 -0
- package/dist/components/SegmentedButton/SegmentedButton.d.ts +20 -0
- package/dist/components/Select/Select.d.ts +123 -0
- package/dist/components/SelectSearch/SelectSearch.d.ts +40 -0
- package/dist/components/Shared/Chip.d.ts +15 -0
- package/dist/components/Shared/HelperComponent.d.ts +13 -0
- package/dist/components/Sidebar/SecondaryBar/SecondaryBar.d.ts +32 -0
- package/dist/components/Sidebar/SecondaryBar/hooks/useSecondaryBarAnimation.d.ts +2 -0
- package/dist/components/Sidebar/SecondaryBar/index.d.ts +1 -0
- package/dist/components/Sidebar/SidebarComposable.d.ts +43 -0
- package/dist/components/Sidebar/components/NavigationLink.d.ts +11 -0
- package/dist/components/Sidebar/components/badge.d.ts +10 -0
- package/dist/components/Sidebar/components/changue-account.d.ts +5 -0
- package/dist/components/Sidebar/components/collapse-button.d.ts +5 -0
- package/dist/components/Sidebar/components/company-logo.d.ts +5 -0
- package/dist/components/Sidebar/components/nav-actions.d.ts +7 -0
- package/dist/components/Sidebar/components/nav-links.d.ts +7 -0
- package/dist/components/Sidebar/context/SidebarContext.d.ts +13 -0
- package/dist/components/Sidebar/hooks/SidebarProvider.d.ts +3 -0
- package/dist/components/Sidebar/hooks/useNavBarActions.d.ts +9 -0
- package/dist/components/Sidebar/hooks/useNavBarCollapse.d.ts +4 -0
- package/dist/components/Sidebar/hooks/useNavLinks.d.ts +32 -0
- package/dist/components/Sidebar/hooks/useSidebarHook.d.ts +13 -0
- package/dist/components/Sidebar/index.d.ts +12 -0
- package/dist/components/Sidebar/ui/useNavbarAnimation.d.ts +2 -0
- package/dist/components/Skeleton/Skeleton.d.ts +13 -0
- package/dist/components/Spinner/Spinner.d.ts +12 -0
- package/dist/components/Steps/Steps.d.ts +21 -0
- package/dist/components/SwipeContainer/SwipeContainer.d.ts +19 -0
- package/dist/components/Switch/Switch.d.ts +11 -0
- package/dist/components/TabLinks/TabLinks.d.ts +23 -0
- package/dist/components/TabSwitch/TabSwitch.d.ts +16 -0
- package/dist/components/Table/Table.d.ts +14 -0
- package/dist/components/Table/TableWithPagination.d.ts +11 -0
- package/dist/components/TextArea/TextArea.d.ts +15 -0
- package/dist/components/TicketCard/TicketCard.d.ts +32 -0
- package/dist/components/TicketCard/index.d.ts +3 -0
- package/dist/components/Toaster/ToastProvider.d.ts +5 -0
- package/dist/components/Toaster/Toaster.d.ts +36 -0
- package/dist/components/Tooltip/Tootip.d.ts +10 -0
- package/dist/components/UserCard/UserCard.d.ts +12 -0
- package/dist/exports/Autocomplete.d.ts +1 -0
- package/dist/exports/Avatar.d.ts +1 -0
- package/dist/exports/Button.d.ts +2 -0
- package/dist/exports/CardProfile.d.ts +3 -0
- package/dist/exports/CheckBox.d.ts +2 -0
- package/dist/exports/DatePicker.d.ts +3 -0
- package/dist/exports/DialogModal.d.ts +2 -0
- package/dist/exports/DrawerDesktop.d.ts +4 -0
- package/dist/exports/DrawerMobile.d.ts +4 -0
- package/dist/exports/DropZone.d.ts +3 -0
- package/dist/exports/FAButton.d.ts +1 -0
- package/dist/exports/Header.d.ts +2 -0
- package/dist/exports/Icons.d.ts +1 -0
- package/dist/exports/Image.d.ts +1 -0
- package/dist/exports/ImageGallery.d.ts +2 -0
- package/dist/exports/Input.d.ts +2 -0
- package/dist/exports/InputMultiple.d.ts +3 -0
- package/dist/exports/LayoutGeneric.d.ts +2 -0
- package/dist/exports/Logo.d.ts +1 -0
- package/dist/exports/Menu.d.ts +3 -0
- package/dist/exports/NotificationCard.d.ts +2 -0
- package/dist/exports/OtpInput.d.ts +2 -0
- package/dist/exports/Pagination.d.ts +2 -0
- package/dist/exports/ProfilePictureUpload.d.ts +3 -0
- package/dist/exports/ProgressBar.d.ts +2 -0
- package/dist/exports/PyrionNavigationDrawer.d.ts +2 -0
- package/dist/exports/RadioButton.d.ts +3 -0
- package/dist/exports/RecurrentDatePicker.d.ts +5 -0
- package/dist/exports/RecurrentDatePickerRRule.d.ts +2 -0
- package/dist/exports/Scrollable.d.ts +2 -0
- package/dist/exports/SegmentedButton.d.ts +3 -0
- package/dist/exports/Select.d.ts +5 -0
- package/dist/exports/SelectSearch.d.ts +3 -0
- package/dist/exports/Skeleton.d.ts +3 -0
- package/dist/exports/Spinner.d.ts +3 -0
- package/dist/exports/Steps.d.ts +3 -0
- package/dist/exports/SwipeContainer.d.ts +1 -0
- package/dist/exports/Switch.d.ts +3 -0
- package/dist/exports/TabLinks.d.ts +1 -0
- package/dist/exports/Table.d.ts +1 -0
- package/dist/exports/TextArea.d.ts +1 -0
- package/dist/exports/TicketCard.d.ts +2 -0
- package/dist/exports/Toast.d.ts +3 -0
- package/dist/exports/ToastProvider.d.ts +2 -0
- package/dist/exports/Tooltip.d.ts +2 -0
- package/dist/exports/useDevice.d.ts +1 -0
- package/dist/exports/usePyrionNavigation.d.ts +1 -0
- package/dist/hooks/useClickOutside.d.ts +8 -0
- package/dist/hooks/useDevice.d.ts +1 -0
- package/dist/hooks/useDragScroll.d.ts +29 -0
- package/dist/hooks/useLabelBackground.d.ts +6 -0
- package/dist/iconUtils-D0lVAgGT.js +5 -0
- package/dist/index-BOQuZ0gG.js +34 -0
- package/dist/index.d.ts +104 -0
- package/dist/jsx-runtime-GkKLlHH4.js +263 -0
- package/dist/lib/cn.d.ts +2 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/prometeo-design-system.es.js +918 -0
- package/dist/styles.css +1 -0
- package/dist/styles.d.ts +1 -0
- package/dist/useDevice.d.ts +2 -0
- package/dist/useDevice.es.js +13 -0
- package/dist/useDragScroll-CHN9OMwn.js +165 -0
- package/dist/useLabelBackground-BDIHUdND.js +26 -0
- package/dist/usePyrionNavigation.d.ts +4 -0
- package/dist/usePyrionNavigation.es.js +4 -0
- package/dist/utils-X4-h3cum.js +54 -0
- package/dist/vite.svg +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,3733 @@
|
|
|
1
|
+
import { j as U } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
|
+
import h, { createContext as Tn, useContext as Yn, useCallback as q, useRef as Ee, useLayoutEffect as En, useState as Se, useEffect as _e, useMemo as ie, memo as Fn } from "react";
|
|
3
|
+
import _n from "./InputMultiple.es.js";
|
|
4
|
+
import In from "./Input.es.js";
|
|
5
|
+
import { createPortal as Bn } from "react-dom";
|
|
6
|
+
import { c as tt } from "./cn-B6yFEsav.js";
|
|
7
|
+
import { Calendar as Bt } from "./Icons/Calendar.es.js";
|
|
8
|
+
import jt from "./Button.es.js";
|
|
9
|
+
function jn(e, t, o = "long") {
|
|
10
|
+
return new Intl.DateTimeFormat("en-US", {
|
|
11
|
+
// Enforces engine to render the time. Without the option JavaScriptCore omits it.
|
|
12
|
+
hour: "numeric",
|
|
13
|
+
timeZone: e,
|
|
14
|
+
timeZoneName: o
|
|
15
|
+
}).format(t).split(/\s/g).slice(2).join(" ");
|
|
16
|
+
}
|
|
17
|
+
const $n = {}, Je = {};
|
|
18
|
+
function Be(e, t) {
|
|
19
|
+
try {
|
|
20
|
+
const n = ($n[e] ||= new Intl.DateTimeFormat("en-US", {
|
|
21
|
+
timeZone: e,
|
|
22
|
+
timeZoneName: "longOffset"
|
|
23
|
+
}).format)(t).split("GMT")[1];
|
|
24
|
+
return n in Je ? Je[n] : $t(n, n.split(":"));
|
|
25
|
+
} catch {
|
|
26
|
+
if (e in Je) return Je[e];
|
|
27
|
+
const o = e?.match(An);
|
|
28
|
+
return o ? $t(e, o.slice(1)) : NaN;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const An = /([+-]\d\d):?(\d\d)?/;
|
|
32
|
+
function $t(e, t) {
|
|
33
|
+
const o = +(t[0] || 0), n = +(t[1] || 0), r = +(t[2] || 0) / 60;
|
|
34
|
+
return Je[e] = o * 60 + n > 0 ? o * 60 + n + r : o * 60 - n - r;
|
|
35
|
+
}
|
|
36
|
+
class De extends Date {
|
|
37
|
+
//#region static
|
|
38
|
+
constructor(...t) {
|
|
39
|
+
super(), t.length > 1 && typeof t[t.length - 1] == "string" && (this.timeZone = t.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(Be(this.timeZone, this)) ? this.setTime(NaN) : t.length ? typeof t[0] == "number" && (t.length === 1 || t.length === 2 && typeof t[1] != "number") ? this.setTime(t[0]) : typeof t[0] == "string" ? this.setTime(+new Date(t[0])) : t[0] instanceof Date ? this.setTime(+t[0]) : (this.setTime(+new Date(...t)), Zt(this), Nt(this)) : this.setTime(Date.now());
|
|
40
|
+
}
|
|
41
|
+
static tz(t, ...o) {
|
|
42
|
+
return o.length ? new De(...o, t) : new De(Date.now(), t);
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region time zone
|
|
46
|
+
withTimeZone(t) {
|
|
47
|
+
return new De(+this, t);
|
|
48
|
+
}
|
|
49
|
+
getTimezoneOffset() {
|
|
50
|
+
const t = -Be(this.timeZone, this);
|
|
51
|
+
return t > 0 ? Math.floor(t) : Math.ceil(t);
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region time
|
|
55
|
+
setTime(t) {
|
|
56
|
+
return Date.prototype.setTime.apply(this, arguments), Nt(this), +this;
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region date-fns integration
|
|
60
|
+
[/* @__PURE__ */ Symbol.for("constructDateFrom")](t) {
|
|
61
|
+
return new De(+new Date(t), this.timeZone);
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
}
|
|
65
|
+
const At = /^(get|set)(?!UTC)/;
|
|
66
|
+
Object.getOwnPropertyNames(Date.prototype).forEach((e) => {
|
|
67
|
+
if (!At.test(e)) return;
|
|
68
|
+
const t = e.replace(At, "$1UTC");
|
|
69
|
+
De.prototype[t] && (e.startsWith("get") ? De.prototype[e] = function() {
|
|
70
|
+
return this.internal[t]();
|
|
71
|
+
} : (De.prototype[e] = function() {
|
|
72
|
+
return Date.prototype[t].apply(this.internal, arguments), Hn(this), +this;
|
|
73
|
+
}, De.prototype[t] = function() {
|
|
74
|
+
return Date.prototype[t].apply(this, arguments), Nt(this), +this;
|
|
75
|
+
}));
|
|
76
|
+
});
|
|
77
|
+
function Nt(e) {
|
|
78
|
+
e.internal.setTime(+e), e.internal.setUTCSeconds(e.internal.getUTCSeconds() - Math.round(-Be(e.timeZone, e) * 60));
|
|
79
|
+
}
|
|
80
|
+
function Hn(e) {
|
|
81
|
+
Date.prototype.setFullYear.call(e, e.internal.getUTCFullYear(), e.internal.getUTCMonth(), e.internal.getUTCDate()), Date.prototype.setHours.call(e, e.internal.getUTCHours(), e.internal.getUTCMinutes(), e.internal.getUTCSeconds(), e.internal.getUTCMilliseconds()), Zt(e);
|
|
82
|
+
}
|
|
83
|
+
function Zt(e) {
|
|
84
|
+
const t = Be(e.timeZone, e), o = t > 0 ? Math.floor(t) : Math.ceil(t), n = /* @__PURE__ */ new Date(+e);
|
|
85
|
+
n.setUTCHours(n.getUTCHours() - 1);
|
|
86
|
+
const r = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset(), i = -(/* @__PURE__ */ new Date(+n)).getTimezoneOffset(), s = r - i, a = Date.prototype.getHours.apply(e) !== e.internal.getUTCHours();
|
|
87
|
+
s && a && e.internal.setUTCMinutes(e.internal.getUTCMinutes() + s);
|
|
88
|
+
const c = r - o;
|
|
89
|
+
c && Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + c);
|
|
90
|
+
const l = /* @__PURE__ */ new Date(+e);
|
|
91
|
+
l.setUTCSeconds(0);
|
|
92
|
+
const d = r > 0 ? l.getSeconds() : (l.getSeconds() - 60) % 60, u = Math.round(-(Be(e.timeZone, e) * 60)) % 60;
|
|
93
|
+
(u || d) && (e.internal.setUTCSeconds(e.internal.getUTCSeconds() + u), Date.prototype.setUTCSeconds.call(e, Date.prototype.getUTCSeconds.call(e) + u + d));
|
|
94
|
+
const f = Be(e.timeZone, e), M = f > 0 ? Math.floor(f) : Math.ceil(f), C = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset() - M, W = M !== o, v = C - c;
|
|
95
|
+
if (W && v) {
|
|
96
|
+
Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + v);
|
|
97
|
+
const g = Be(e.timeZone, e), p = g > 0 ? Math.floor(g) : Math.ceil(g), S = M - p;
|
|
98
|
+
S && (e.internal.setUTCMinutes(e.internal.getUTCMinutes() + S), Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + S));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
class J extends De {
|
|
102
|
+
//#region static
|
|
103
|
+
static tz(t, ...o) {
|
|
104
|
+
return o.length ? new J(...o, t) : new J(Date.now(), t);
|
|
105
|
+
}
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region representation
|
|
108
|
+
toISOString() {
|
|
109
|
+
const [t, o, n] = this.tzComponents(), r = `${t}${o}:${n}`;
|
|
110
|
+
return this.internal.toISOString().slice(0, -1) + r;
|
|
111
|
+
}
|
|
112
|
+
toString() {
|
|
113
|
+
return `${this.toDateString()} ${this.toTimeString()}`;
|
|
114
|
+
}
|
|
115
|
+
toDateString() {
|
|
116
|
+
const [t, o, n, r] = this.internal.toUTCString().split(" ");
|
|
117
|
+
return `${t?.slice(0, -1)} ${n} ${o} ${r}`;
|
|
118
|
+
}
|
|
119
|
+
toTimeString() {
|
|
120
|
+
const t = this.internal.toUTCString().split(" ")[4], [o, n, r] = this.tzComponents();
|
|
121
|
+
return `${t} GMT${o}${n}${r} (${jn(this.timeZone, this)})`;
|
|
122
|
+
}
|
|
123
|
+
toLocaleString(t, o) {
|
|
124
|
+
return Date.prototype.toLocaleString.call(this, t, {
|
|
125
|
+
...o,
|
|
126
|
+
timeZone: o?.timeZone || this.timeZone
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
toLocaleDateString(t, o) {
|
|
130
|
+
return Date.prototype.toLocaleDateString.call(this, t, {
|
|
131
|
+
...o,
|
|
132
|
+
timeZone: o?.timeZone || this.timeZone
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
toLocaleTimeString(t, o) {
|
|
136
|
+
return Date.prototype.toLocaleTimeString.call(this, t, {
|
|
137
|
+
...o,
|
|
138
|
+
timeZone: o?.timeZone || this.timeZone
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
//#endregion
|
|
142
|
+
//#region private
|
|
143
|
+
tzComponents() {
|
|
144
|
+
const t = this.getTimezoneOffset(), o = t > 0 ? "-" : "+", n = String(Math.floor(Math.abs(t) / 60)).padStart(2, "0"), r = String(Math.abs(t) % 60).padStart(2, "0");
|
|
145
|
+
return [o, n, r];
|
|
146
|
+
}
|
|
147
|
+
//#endregion
|
|
148
|
+
withTimeZone(t) {
|
|
149
|
+
return new J(+this, t);
|
|
150
|
+
}
|
|
151
|
+
//#region date-fns integration
|
|
152
|
+
[/* @__PURE__ */ Symbol.for("constructDateFrom")](t) {
|
|
153
|
+
return new J(+new Date(t), this.timeZone);
|
|
154
|
+
}
|
|
155
|
+
//#endregion
|
|
156
|
+
}
|
|
157
|
+
const Jt = 6048e5, qn = 864e5, Ht = /* @__PURE__ */ Symbol.for("constructDateFrom");
|
|
158
|
+
function Q(e, t) {
|
|
159
|
+
return typeof e == "function" ? e(t) : e && typeof e == "object" && Ht in e ? e[Ht](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
|
|
160
|
+
}
|
|
161
|
+
function B(e, t) {
|
|
162
|
+
return Q(t || e, e);
|
|
163
|
+
}
|
|
164
|
+
function en(e, t, o) {
|
|
165
|
+
const n = B(e, o?.in);
|
|
166
|
+
return isNaN(t) ? Q(e, NaN) : (t && n.setDate(n.getDate() + t), n);
|
|
167
|
+
}
|
|
168
|
+
function tn(e, t, o) {
|
|
169
|
+
const n = B(e, o?.in);
|
|
170
|
+
if (isNaN(t)) return Q(e, NaN);
|
|
171
|
+
if (!t)
|
|
172
|
+
return n;
|
|
173
|
+
const r = n.getDate(), i = Q(e, n.getTime());
|
|
174
|
+
i.setMonth(n.getMonth() + t + 1, 0);
|
|
175
|
+
const s = i.getDate();
|
|
176
|
+
return r >= s ? i : (n.setFullYear(
|
|
177
|
+
i.getFullYear(),
|
|
178
|
+
i.getMonth(),
|
|
179
|
+
r
|
|
180
|
+
), n);
|
|
181
|
+
}
|
|
182
|
+
let Rn = {};
|
|
183
|
+
function rt() {
|
|
184
|
+
return Rn;
|
|
185
|
+
}
|
|
186
|
+
function Le(e, t) {
|
|
187
|
+
const o = rt(), n = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? o.weekStartsOn ?? o.locale?.options?.weekStartsOn ?? 0, r = B(e, t?.in), i = r.getDay(), s = (i < n ? 7 : 0) + i - n;
|
|
188
|
+
return r.setDate(r.getDate() - s), r.setHours(0, 0, 0, 0), r;
|
|
189
|
+
}
|
|
190
|
+
function nt(e, t) {
|
|
191
|
+
return Le(e, { ...t, weekStartsOn: 1 });
|
|
192
|
+
}
|
|
193
|
+
function nn(e, t) {
|
|
194
|
+
const o = B(e, t?.in), n = o.getFullYear(), r = Q(o, 0);
|
|
195
|
+
r.setFullYear(n + 1, 0, 4), r.setHours(0, 0, 0, 0);
|
|
196
|
+
const i = nt(r), s = Q(o, 0);
|
|
197
|
+
s.setFullYear(n, 0, 4), s.setHours(0, 0, 0, 0);
|
|
198
|
+
const a = nt(s);
|
|
199
|
+
return o.getTime() >= i.getTime() ? n + 1 : o.getTime() >= a.getTime() ? n : n - 1;
|
|
200
|
+
}
|
|
201
|
+
function qt(e) {
|
|
202
|
+
const t = B(e), o = new Date(
|
|
203
|
+
Date.UTC(
|
|
204
|
+
t.getFullYear(),
|
|
205
|
+
t.getMonth(),
|
|
206
|
+
t.getDate(),
|
|
207
|
+
t.getHours(),
|
|
208
|
+
t.getMinutes(),
|
|
209
|
+
t.getSeconds(),
|
|
210
|
+
t.getMilliseconds()
|
|
211
|
+
)
|
|
212
|
+
);
|
|
213
|
+
return o.setUTCFullYear(t.getFullYear()), +e - +o;
|
|
214
|
+
}
|
|
215
|
+
function Qe(e, ...t) {
|
|
216
|
+
const o = Q.bind(
|
|
217
|
+
null,
|
|
218
|
+
t.find((n) => typeof n == "object")
|
|
219
|
+
);
|
|
220
|
+
return t.map(o);
|
|
221
|
+
}
|
|
222
|
+
function ot(e, t) {
|
|
223
|
+
const o = B(e, t?.in);
|
|
224
|
+
return o.setHours(0, 0, 0, 0), o;
|
|
225
|
+
}
|
|
226
|
+
function xt(e, t, o) {
|
|
227
|
+
const [n, r] = Qe(
|
|
228
|
+
o?.in,
|
|
229
|
+
e,
|
|
230
|
+
t
|
|
231
|
+
), i = ot(n), s = ot(r), a = +i - qt(i), c = +s - qt(s);
|
|
232
|
+
return Math.round((a - c) / qn);
|
|
233
|
+
}
|
|
234
|
+
function zn(e, t) {
|
|
235
|
+
const o = nn(e, t), n = Q(e, 0);
|
|
236
|
+
return n.setFullYear(o, 0, 4), n.setHours(0, 0, 0, 0), nt(n);
|
|
237
|
+
}
|
|
238
|
+
function Gn(e, t, o) {
|
|
239
|
+
return en(e, t * 7, o);
|
|
240
|
+
}
|
|
241
|
+
function Vn(e, t, o) {
|
|
242
|
+
return tn(e, t * 12, o);
|
|
243
|
+
}
|
|
244
|
+
function Xn(e, t) {
|
|
245
|
+
let o, n = t?.in;
|
|
246
|
+
return e.forEach((r) => {
|
|
247
|
+
!n && typeof r == "object" && (n = Q.bind(null, r));
|
|
248
|
+
const i = B(r, n);
|
|
249
|
+
(!o || o < i || isNaN(+i)) && (o = i);
|
|
250
|
+
}), Q(n, o || NaN);
|
|
251
|
+
}
|
|
252
|
+
function Ln(e, t) {
|
|
253
|
+
let o, n = t?.in;
|
|
254
|
+
return e.forEach((r) => {
|
|
255
|
+
!n && typeof r == "object" && (n = Q.bind(null, r));
|
|
256
|
+
const i = B(r, n);
|
|
257
|
+
(!o || o > i || isNaN(+i)) && (o = i);
|
|
258
|
+
}), Q(n, o || NaN);
|
|
259
|
+
}
|
|
260
|
+
function Qn(e, t, o) {
|
|
261
|
+
const [n, r] = Qe(
|
|
262
|
+
o?.in,
|
|
263
|
+
e,
|
|
264
|
+
t
|
|
265
|
+
);
|
|
266
|
+
return +ot(n) == +ot(r);
|
|
267
|
+
}
|
|
268
|
+
function on(e) {
|
|
269
|
+
return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
|
|
270
|
+
}
|
|
271
|
+
function Un(e) {
|
|
272
|
+
return !(!on(e) && typeof e != "number" || isNaN(+B(e)));
|
|
273
|
+
}
|
|
274
|
+
function rn(e, t, o) {
|
|
275
|
+
const [n, r] = Qe(
|
|
276
|
+
o?.in,
|
|
277
|
+
e,
|
|
278
|
+
t
|
|
279
|
+
), i = n.getFullYear() - r.getFullYear(), s = n.getMonth() - r.getMonth();
|
|
280
|
+
return i * 12 + s;
|
|
281
|
+
}
|
|
282
|
+
function Kn(e, t) {
|
|
283
|
+
const o = B(e, t?.in), n = o.getMonth();
|
|
284
|
+
return o.setFullYear(o.getFullYear(), n + 1, 0), o.setHours(23, 59, 59, 999), o;
|
|
285
|
+
}
|
|
286
|
+
function an(e, t) {
|
|
287
|
+
const [o, n] = Qe(e, t.start, t.end);
|
|
288
|
+
return { start: o, end: n };
|
|
289
|
+
}
|
|
290
|
+
function Zn(e, t) {
|
|
291
|
+
const { start: o, end: n } = an(t?.in, e);
|
|
292
|
+
let r = +o > +n;
|
|
293
|
+
const i = r ? +o : +n, s = r ? n : o;
|
|
294
|
+
s.setHours(0, 0, 0, 0), s.setDate(1);
|
|
295
|
+
let a = 1;
|
|
296
|
+
const c = [];
|
|
297
|
+
for (; +s <= i; )
|
|
298
|
+
c.push(Q(o, s)), s.setMonth(s.getMonth() + a);
|
|
299
|
+
return r ? c.reverse() : c;
|
|
300
|
+
}
|
|
301
|
+
function Jn(e, t) {
|
|
302
|
+
const o = B(e, t?.in);
|
|
303
|
+
return o.setDate(1), o.setHours(0, 0, 0, 0), o;
|
|
304
|
+
}
|
|
305
|
+
function eo(e, t) {
|
|
306
|
+
const o = B(e, t?.in), n = o.getFullYear();
|
|
307
|
+
return o.setFullYear(n + 1, 0, 0), o.setHours(23, 59, 59, 999), o;
|
|
308
|
+
}
|
|
309
|
+
function sn(e, t) {
|
|
310
|
+
const o = B(e, t?.in);
|
|
311
|
+
return o.setFullYear(o.getFullYear(), 0, 1), o.setHours(0, 0, 0, 0), o;
|
|
312
|
+
}
|
|
313
|
+
function to(e, t) {
|
|
314
|
+
const { start: o, end: n } = an(t?.in, e);
|
|
315
|
+
let r = +o > +n;
|
|
316
|
+
const i = r ? +o : +n, s = r ? n : o;
|
|
317
|
+
s.setHours(0, 0, 0, 0), s.setMonth(0, 1);
|
|
318
|
+
let a = 1;
|
|
319
|
+
const c = [];
|
|
320
|
+
for (; +s <= i; )
|
|
321
|
+
c.push(Q(o, s)), s.setFullYear(s.getFullYear() + a);
|
|
322
|
+
return r ? c.reverse() : c;
|
|
323
|
+
}
|
|
324
|
+
function cn(e, t) {
|
|
325
|
+
const o = rt(), n = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? o.weekStartsOn ?? o.locale?.options?.weekStartsOn ?? 0, r = B(e, t?.in), i = r.getDay(), s = (i < n ? -7 : 0) + 6 - (i - n);
|
|
326
|
+
return r.setDate(r.getDate() + s), r.setHours(23, 59, 59, 999), r;
|
|
327
|
+
}
|
|
328
|
+
function no(e, t) {
|
|
329
|
+
return cn(e, { ...t, weekStartsOn: 1 });
|
|
330
|
+
}
|
|
331
|
+
const oo = {
|
|
332
|
+
lessThanXSeconds: {
|
|
333
|
+
one: "less than a second",
|
|
334
|
+
other: "less than {{count}} seconds"
|
|
335
|
+
},
|
|
336
|
+
xSeconds: {
|
|
337
|
+
one: "1 second",
|
|
338
|
+
other: "{{count}} seconds"
|
|
339
|
+
},
|
|
340
|
+
halfAMinute: "half a minute",
|
|
341
|
+
lessThanXMinutes: {
|
|
342
|
+
one: "less than a minute",
|
|
343
|
+
other: "less than {{count}} minutes"
|
|
344
|
+
},
|
|
345
|
+
xMinutes: {
|
|
346
|
+
one: "1 minute",
|
|
347
|
+
other: "{{count}} minutes"
|
|
348
|
+
},
|
|
349
|
+
aboutXHours: {
|
|
350
|
+
one: "about 1 hour",
|
|
351
|
+
other: "about {{count}} hours"
|
|
352
|
+
},
|
|
353
|
+
xHours: {
|
|
354
|
+
one: "1 hour",
|
|
355
|
+
other: "{{count}} hours"
|
|
356
|
+
},
|
|
357
|
+
xDays: {
|
|
358
|
+
one: "1 day",
|
|
359
|
+
other: "{{count}} days"
|
|
360
|
+
},
|
|
361
|
+
aboutXWeeks: {
|
|
362
|
+
one: "about 1 week",
|
|
363
|
+
other: "about {{count}} weeks"
|
|
364
|
+
},
|
|
365
|
+
xWeeks: {
|
|
366
|
+
one: "1 week",
|
|
367
|
+
other: "{{count}} weeks"
|
|
368
|
+
},
|
|
369
|
+
aboutXMonths: {
|
|
370
|
+
one: "about 1 month",
|
|
371
|
+
other: "about {{count}} months"
|
|
372
|
+
},
|
|
373
|
+
xMonths: {
|
|
374
|
+
one: "1 month",
|
|
375
|
+
other: "{{count}} months"
|
|
376
|
+
},
|
|
377
|
+
aboutXYears: {
|
|
378
|
+
one: "about 1 year",
|
|
379
|
+
other: "about {{count}} years"
|
|
380
|
+
},
|
|
381
|
+
xYears: {
|
|
382
|
+
one: "1 year",
|
|
383
|
+
other: "{{count}} years"
|
|
384
|
+
},
|
|
385
|
+
overXYears: {
|
|
386
|
+
one: "over 1 year",
|
|
387
|
+
other: "over {{count}} years"
|
|
388
|
+
},
|
|
389
|
+
almostXYears: {
|
|
390
|
+
one: "almost 1 year",
|
|
391
|
+
other: "almost {{count}} years"
|
|
392
|
+
}
|
|
393
|
+
}, ro = (e, t, o) => {
|
|
394
|
+
let n;
|
|
395
|
+
const r = oo[e];
|
|
396
|
+
return typeof r == "string" ? n = r : t === 1 ? n = r.one : n = r.other.replace("{{count}}", t.toString()), o?.addSuffix ? o.comparison && o.comparison > 0 ? "in " + n : n + " ago" : n;
|
|
397
|
+
};
|
|
398
|
+
function Xe(e) {
|
|
399
|
+
return (t = {}) => {
|
|
400
|
+
const o = t.width ? String(t.width) : e.defaultWidth;
|
|
401
|
+
return e.formats[o] || e.formats[e.defaultWidth];
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
const ao = {
|
|
405
|
+
full: "EEEE, MMMM do, y",
|
|
406
|
+
long: "MMMM do, y",
|
|
407
|
+
medium: "MMM d, y",
|
|
408
|
+
short: "MM/dd/yyyy"
|
|
409
|
+
}, so = {
|
|
410
|
+
full: "h:mm:ss a zzzz",
|
|
411
|
+
long: "h:mm:ss a z",
|
|
412
|
+
medium: "h:mm:ss a",
|
|
413
|
+
short: "h:mm a"
|
|
414
|
+
}, io = {
|
|
415
|
+
full: "{{date}} 'at' {{time}}",
|
|
416
|
+
long: "{{date}} 'at' {{time}}",
|
|
417
|
+
medium: "{{date}}, {{time}}",
|
|
418
|
+
short: "{{date}}, {{time}}"
|
|
419
|
+
}, co = {
|
|
420
|
+
date: Xe({
|
|
421
|
+
formats: ao,
|
|
422
|
+
defaultWidth: "full"
|
|
423
|
+
}),
|
|
424
|
+
time: Xe({
|
|
425
|
+
formats: so,
|
|
426
|
+
defaultWidth: "full"
|
|
427
|
+
}),
|
|
428
|
+
dateTime: Xe({
|
|
429
|
+
formats: io,
|
|
430
|
+
defaultWidth: "full"
|
|
431
|
+
})
|
|
432
|
+
}, lo = {
|
|
433
|
+
lastWeek: "'last' eeee 'at' p",
|
|
434
|
+
yesterday: "'yesterday at' p",
|
|
435
|
+
today: "'today at' p",
|
|
436
|
+
tomorrow: "'tomorrow at' p",
|
|
437
|
+
nextWeek: "eeee 'at' p",
|
|
438
|
+
other: "P"
|
|
439
|
+
}, uo = (e, t, o, n) => lo[e];
|
|
440
|
+
function we(e) {
|
|
441
|
+
return (t, o) => {
|
|
442
|
+
const n = o?.context ? String(o.context) : "standalone";
|
|
443
|
+
let r;
|
|
444
|
+
if (n === "formatting" && e.formattingValues) {
|
|
445
|
+
const s = e.defaultFormattingWidth || e.defaultWidth, a = o?.width ? String(o.width) : s;
|
|
446
|
+
r = e.formattingValues[a] || e.formattingValues[s];
|
|
447
|
+
} else {
|
|
448
|
+
const s = e.defaultWidth, a = o?.width ? String(o.width) : e.defaultWidth;
|
|
449
|
+
r = e.values[a] || e.values[s];
|
|
450
|
+
}
|
|
451
|
+
const i = e.argumentCallback ? e.argumentCallback(t) : t;
|
|
452
|
+
return r[i];
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
const fo = {
|
|
456
|
+
narrow: ["B", "A"],
|
|
457
|
+
abbreviated: ["BC", "AD"],
|
|
458
|
+
wide: ["Before Christ", "Anno Domini"]
|
|
459
|
+
}, ho = {
|
|
460
|
+
narrow: ["1", "2", "3", "4"],
|
|
461
|
+
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
462
|
+
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
463
|
+
}, mo = {
|
|
464
|
+
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
465
|
+
abbreviated: [
|
|
466
|
+
"Jan",
|
|
467
|
+
"Feb",
|
|
468
|
+
"Mar",
|
|
469
|
+
"Apr",
|
|
470
|
+
"May",
|
|
471
|
+
"Jun",
|
|
472
|
+
"Jul",
|
|
473
|
+
"Aug",
|
|
474
|
+
"Sep",
|
|
475
|
+
"Oct",
|
|
476
|
+
"Nov",
|
|
477
|
+
"Dec"
|
|
478
|
+
],
|
|
479
|
+
wide: [
|
|
480
|
+
"January",
|
|
481
|
+
"February",
|
|
482
|
+
"March",
|
|
483
|
+
"April",
|
|
484
|
+
"May",
|
|
485
|
+
"June",
|
|
486
|
+
"July",
|
|
487
|
+
"August",
|
|
488
|
+
"September",
|
|
489
|
+
"October",
|
|
490
|
+
"November",
|
|
491
|
+
"December"
|
|
492
|
+
]
|
|
493
|
+
}, yo = {
|
|
494
|
+
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
495
|
+
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
496
|
+
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
497
|
+
wide: [
|
|
498
|
+
"Sunday",
|
|
499
|
+
"Monday",
|
|
500
|
+
"Tuesday",
|
|
501
|
+
"Wednesday",
|
|
502
|
+
"Thursday",
|
|
503
|
+
"Friday",
|
|
504
|
+
"Saturday"
|
|
505
|
+
]
|
|
506
|
+
}, go = {
|
|
507
|
+
narrow: {
|
|
508
|
+
am: "a",
|
|
509
|
+
pm: "p",
|
|
510
|
+
midnight: "mi",
|
|
511
|
+
noon: "n",
|
|
512
|
+
morning: "morning",
|
|
513
|
+
afternoon: "afternoon",
|
|
514
|
+
evening: "evening",
|
|
515
|
+
night: "night"
|
|
516
|
+
},
|
|
517
|
+
abbreviated: {
|
|
518
|
+
am: "AM",
|
|
519
|
+
pm: "PM",
|
|
520
|
+
midnight: "midnight",
|
|
521
|
+
noon: "noon",
|
|
522
|
+
morning: "morning",
|
|
523
|
+
afternoon: "afternoon",
|
|
524
|
+
evening: "evening",
|
|
525
|
+
night: "night"
|
|
526
|
+
},
|
|
527
|
+
wide: {
|
|
528
|
+
am: "a.m.",
|
|
529
|
+
pm: "p.m.",
|
|
530
|
+
midnight: "midnight",
|
|
531
|
+
noon: "noon",
|
|
532
|
+
morning: "morning",
|
|
533
|
+
afternoon: "afternoon",
|
|
534
|
+
evening: "evening",
|
|
535
|
+
night: "night"
|
|
536
|
+
}
|
|
537
|
+
}, po = {
|
|
538
|
+
narrow: {
|
|
539
|
+
am: "a",
|
|
540
|
+
pm: "p",
|
|
541
|
+
midnight: "mi",
|
|
542
|
+
noon: "n",
|
|
543
|
+
morning: "in the morning",
|
|
544
|
+
afternoon: "in the afternoon",
|
|
545
|
+
evening: "in the evening",
|
|
546
|
+
night: "at night"
|
|
547
|
+
},
|
|
548
|
+
abbreviated: {
|
|
549
|
+
am: "AM",
|
|
550
|
+
pm: "PM",
|
|
551
|
+
midnight: "midnight",
|
|
552
|
+
noon: "noon",
|
|
553
|
+
morning: "in the morning",
|
|
554
|
+
afternoon: "in the afternoon",
|
|
555
|
+
evening: "in the evening",
|
|
556
|
+
night: "at night"
|
|
557
|
+
},
|
|
558
|
+
wide: {
|
|
559
|
+
am: "a.m.",
|
|
560
|
+
pm: "p.m.",
|
|
561
|
+
midnight: "midnight",
|
|
562
|
+
noon: "noon",
|
|
563
|
+
morning: "in the morning",
|
|
564
|
+
afternoon: "in the afternoon",
|
|
565
|
+
evening: "in the evening",
|
|
566
|
+
night: "at night"
|
|
567
|
+
}
|
|
568
|
+
}, bo = (e, t) => {
|
|
569
|
+
const o = Number(e), n = o % 100;
|
|
570
|
+
if (n > 20 || n < 10)
|
|
571
|
+
switch (n % 10) {
|
|
572
|
+
case 1:
|
|
573
|
+
return o + "st";
|
|
574
|
+
case 2:
|
|
575
|
+
return o + "nd";
|
|
576
|
+
case 3:
|
|
577
|
+
return o + "rd";
|
|
578
|
+
}
|
|
579
|
+
return o + "th";
|
|
580
|
+
}, wo = {
|
|
581
|
+
ordinalNumber: bo,
|
|
582
|
+
era: we({
|
|
583
|
+
values: fo,
|
|
584
|
+
defaultWidth: "wide"
|
|
585
|
+
}),
|
|
586
|
+
quarter: we({
|
|
587
|
+
values: ho,
|
|
588
|
+
defaultWidth: "wide",
|
|
589
|
+
argumentCallback: (e) => e - 1
|
|
590
|
+
}),
|
|
591
|
+
month: we({
|
|
592
|
+
values: mo,
|
|
593
|
+
defaultWidth: "wide"
|
|
594
|
+
}),
|
|
595
|
+
day: we({
|
|
596
|
+
values: yo,
|
|
597
|
+
defaultWidth: "wide"
|
|
598
|
+
}),
|
|
599
|
+
dayPeriod: we({
|
|
600
|
+
values: go,
|
|
601
|
+
defaultWidth: "wide",
|
|
602
|
+
formattingValues: po,
|
|
603
|
+
defaultFormattingWidth: "wide"
|
|
604
|
+
})
|
|
605
|
+
};
|
|
606
|
+
function Me(e) {
|
|
607
|
+
return (t, o = {}) => {
|
|
608
|
+
const n = o.width, r = n && e.matchPatterns[n] || e.matchPatterns[e.defaultMatchWidth], i = t.match(r);
|
|
609
|
+
if (!i)
|
|
610
|
+
return null;
|
|
611
|
+
const s = i[0], a = n && e.parsePatterns[n] || e.parsePatterns[e.defaultParseWidth], c = Array.isArray(a) ? Do(a, (u) => u.test(s)) : (
|
|
612
|
+
// [TODO] -- I challenge you to fix the type
|
|
613
|
+
Mo(a, (u) => u.test(s))
|
|
614
|
+
);
|
|
615
|
+
let l;
|
|
616
|
+
l = e.valueCallback ? e.valueCallback(c) : c, l = o.valueCallback ? (
|
|
617
|
+
// [TODO] -- I challenge you to fix the type
|
|
618
|
+
o.valueCallback(l)
|
|
619
|
+
) : l;
|
|
620
|
+
const d = t.slice(s.length);
|
|
621
|
+
return { value: l, rest: d };
|
|
622
|
+
};
|
|
623
|
+
}
|
|
624
|
+
function Mo(e, t) {
|
|
625
|
+
for (const o in e)
|
|
626
|
+
if (Object.prototype.hasOwnProperty.call(e, o) && t(e[o]))
|
|
627
|
+
return o;
|
|
628
|
+
}
|
|
629
|
+
function Do(e, t) {
|
|
630
|
+
for (let o = 0; o < e.length; o++)
|
|
631
|
+
if (t(e[o]))
|
|
632
|
+
return o;
|
|
633
|
+
}
|
|
634
|
+
function ln(e) {
|
|
635
|
+
return (t, o = {}) => {
|
|
636
|
+
const n = t.match(e.matchPattern);
|
|
637
|
+
if (!n) return null;
|
|
638
|
+
const r = n[0], i = t.match(e.parsePattern);
|
|
639
|
+
if (!i) return null;
|
|
640
|
+
let s = e.valueCallback ? e.valueCallback(i[0]) : i[0];
|
|
641
|
+
s = o.valueCallback ? o.valueCallback(s) : s;
|
|
642
|
+
const a = t.slice(r.length);
|
|
643
|
+
return { value: s, rest: a };
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
const vo = /^(\d+)(th|st|nd|rd)?/i, ko = /\d+/i, Oo = {
|
|
647
|
+
narrow: /^(b|a)/i,
|
|
648
|
+
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
649
|
+
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
650
|
+
}, Wo = {
|
|
651
|
+
any: [/^b/i, /^(a|c)/i]
|
|
652
|
+
}, So = {
|
|
653
|
+
narrow: /^[1234]/i,
|
|
654
|
+
abbreviated: /^q[1234]/i,
|
|
655
|
+
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
656
|
+
}, No = {
|
|
657
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
658
|
+
}, Co = {
|
|
659
|
+
narrow: /^[jfmasond]/i,
|
|
660
|
+
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
661
|
+
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
662
|
+
}, xo = {
|
|
663
|
+
narrow: [
|
|
664
|
+
/^j/i,
|
|
665
|
+
/^f/i,
|
|
666
|
+
/^m/i,
|
|
667
|
+
/^a/i,
|
|
668
|
+
/^m/i,
|
|
669
|
+
/^j/i,
|
|
670
|
+
/^j/i,
|
|
671
|
+
/^a/i,
|
|
672
|
+
/^s/i,
|
|
673
|
+
/^o/i,
|
|
674
|
+
/^n/i,
|
|
675
|
+
/^d/i
|
|
676
|
+
],
|
|
677
|
+
any: [
|
|
678
|
+
/^ja/i,
|
|
679
|
+
/^f/i,
|
|
680
|
+
/^mar/i,
|
|
681
|
+
/^ap/i,
|
|
682
|
+
/^may/i,
|
|
683
|
+
/^jun/i,
|
|
684
|
+
/^jul/i,
|
|
685
|
+
/^au/i,
|
|
686
|
+
/^s/i,
|
|
687
|
+
/^o/i,
|
|
688
|
+
/^n/i,
|
|
689
|
+
/^d/i
|
|
690
|
+
]
|
|
691
|
+
}, Po = {
|
|
692
|
+
narrow: /^[smtwf]/i,
|
|
693
|
+
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
694
|
+
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
695
|
+
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
696
|
+
}, To = {
|
|
697
|
+
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
698
|
+
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
699
|
+
}, Yo = {
|
|
700
|
+
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
701
|
+
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
702
|
+
}, Eo = {
|
|
703
|
+
any: {
|
|
704
|
+
am: /^a/i,
|
|
705
|
+
pm: /^p/i,
|
|
706
|
+
midnight: /^mi/i,
|
|
707
|
+
noon: /^no/i,
|
|
708
|
+
morning: /morning/i,
|
|
709
|
+
afternoon: /afternoon/i,
|
|
710
|
+
evening: /evening/i,
|
|
711
|
+
night: /night/i
|
|
712
|
+
}
|
|
713
|
+
}, Fo = {
|
|
714
|
+
ordinalNumber: ln({
|
|
715
|
+
matchPattern: vo,
|
|
716
|
+
parsePattern: ko,
|
|
717
|
+
valueCallback: (e) => parseInt(e, 10)
|
|
718
|
+
}),
|
|
719
|
+
era: Me({
|
|
720
|
+
matchPatterns: Oo,
|
|
721
|
+
defaultMatchWidth: "wide",
|
|
722
|
+
parsePatterns: Wo,
|
|
723
|
+
defaultParseWidth: "any"
|
|
724
|
+
}),
|
|
725
|
+
quarter: Me({
|
|
726
|
+
matchPatterns: So,
|
|
727
|
+
defaultMatchWidth: "wide",
|
|
728
|
+
parsePatterns: No,
|
|
729
|
+
defaultParseWidth: "any",
|
|
730
|
+
valueCallback: (e) => e + 1
|
|
731
|
+
}),
|
|
732
|
+
month: Me({
|
|
733
|
+
matchPatterns: Co,
|
|
734
|
+
defaultMatchWidth: "wide",
|
|
735
|
+
parsePatterns: xo,
|
|
736
|
+
defaultParseWidth: "any"
|
|
737
|
+
}),
|
|
738
|
+
day: Me({
|
|
739
|
+
matchPatterns: Po,
|
|
740
|
+
defaultMatchWidth: "wide",
|
|
741
|
+
parsePatterns: To,
|
|
742
|
+
defaultParseWidth: "any"
|
|
743
|
+
}),
|
|
744
|
+
dayPeriod: Me({
|
|
745
|
+
matchPatterns: Yo,
|
|
746
|
+
defaultMatchWidth: "any",
|
|
747
|
+
parsePatterns: Eo,
|
|
748
|
+
defaultParseWidth: "any"
|
|
749
|
+
})
|
|
750
|
+
}, Ve = {
|
|
751
|
+
code: "en-US",
|
|
752
|
+
formatDistance: ro,
|
|
753
|
+
formatLong: co,
|
|
754
|
+
formatRelative: uo,
|
|
755
|
+
localize: wo,
|
|
756
|
+
match: Fo,
|
|
757
|
+
options: {
|
|
758
|
+
weekStartsOn: 0,
|
|
759
|
+
firstWeekContainsDate: 1
|
|
760
|
+
}
|
|
761
|
+
};
|
|
762
|
+
function _o(e, t) {
|
|
763
|
+
const o = B(e, t?.in);
|
|
764
|
+
return xt(o, sn(o)) + 1;
|
|
765
|
+
}
|
|
766
|
+
function Pt(e, t) {
|
|
767
|
+
const o = B(e, t?.in), n = +nt(o) - +zn(o);
|
|
768
|
+
return Math.round(n / Jt) + 1;
|
|
769
|
+
}
|
|
770
|
+
function un(e, t) {
|
|
771
|
+
const o = B(e, t?.in), n = o.getFullYear(), r = rt(), i = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, s = Q(t?.in || e, 0);
|
|
772
|
+
s.setFullYear(n + 1, 0, i), s.setHours(0, 0, 0, 0);
|
|
773
|
+
const a = Le(s, t), c = Q(t?.in || e, 0);
|
|
774
|
+
c.setFullYear(n, 0, i), c.setHours(0, 0, 0, 0);
|
|
775
|
+
const l = Le(c, t);
|
|
776
|
+
return +o >= +a ? n + 1 : +o >= +l ? n : n - 1;
|
|
777
|
+
}
|
|
778
|
+
function Io(e, t) {
|
|
779
|
+
const o = rt(), n = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? o.firstWeekContainsDate ?? o.locale?.options?.firstWeekContainsDate ?? 1, r = un(e, t), i = Q(t?.in || e, 0);
|
|
780
|
+
return i.setFullYear(r, 0, n), i.setHours(0, 0, 0, 0), Le(i, t);
|
|
781
|
+
}
|
|
782
|
+
function Tt(e, t) {
|
|
783
|
+
const o = B(e, t?.in), n = +Le(o, t) - +Io(o, t);
|
|
784
|
+
return Math.round(n / Jt) + 1;
|
|
785
|
+
}
|
|
786
|
+
function I(e, t) {
|
|
787
|
+
const o = e < 0 ? "-" : "", n = Math.abs(e).toString().padStart(t, "0");
|
|
788
|
+
return o + n;
|
|
789
|
+
}
|
|
790
|
+
const Ye = {
|
|
791
|
+
// Year
|
|
792
|
+
y(e, t) {
|
|
793
|
+
const o = e.getFullYear(), n = o > 0 ? o : 1 - o;
|
|
794
|
+
return I(t === "yy" ? n % 100 : n, t.length);
|
|
795
|
+
},
|
|
796
|
+
// Month
|
|
797
|
+
M(e, t) {
|
|
798
|
+
const o = e.getMonth();
|
|
799
|
+
return t === "M" ? String(o + 1) : I(o + 1, 2);
|
|
800
|
+
},
|
|
801
|
+
// Day of the month
|
|
802
|
+
d(e, t) {
|
|
803
|
+
return I(e.getDate(), t.length);
|
|
804
|
+
},
|
|
805
|
+
// AM or PM
|
|
806
|
+
a(e, t) {
|
|
807
|
+
const o = e.getHours() / 12 >= 1 ? "pm" : "am";
|
|
808
|
+
switch (t) {
|
|
809
|
+
case "a":
|
|
810
|
+
case "aa":
|
|
811
|
+
return o.toUpperCase();
|
|
812
|
+
case "aaa":
|
|
813
|
+
return o;
|
|
814
|
+
case "aaaaa":
|
|
815
|
+
return o[0];
|
|
816
|
+
default:
|
|
817
|
+
return o === "am" ? "a.m." : "p.m.";
|
|
818
|
+
}
|
|
819
|
+
},
|
|
820
|
+
// Hour [1-12]
|
|
821
|
+
h(e, t) {
|
|
822
|
+
return I(e.getHours() % 12 || 12, t.length);
|
|
823
|
+
},
|
|
824
|
+
// Hour [0-23]
|
|
825
|
+
H(e, t) {
|
|
826
|
+
return I(e.getHours(), t.length);
|
|
827
|
+
},
|
|
828
|
+
// Minute
|
|
829
|
+
m(e, t) {
|
|
830
|
+
return I(e.getMinutes(), t.length);
|
|
831
|
+
},
|
|
832
|
+
// Second
|
|
833
|
+
s(e, t) {
|
|
834
|
+
return I(e.getSeconds(), t.length);
|
|
835
|
+
},
|
|
836
|
+
// Fraction of second
|
|
837
|
+
S(e, t) {
|
|
838
|
+
const o = t.length, n = e.getMilliseconds(), r = Math.trunc(
|
|
839
|
+
n * Math.pow(10, o - 3)
|
|
840
|
+
);
|
|
841
|
+
return I(r, t.length);
|
|
842
|
+
}
|
|
843
|
+
}, ze = {
|
|
844
|
+
midnight: "midnight",
|
|
845
|
+
noon: "noon",
|
|
846
|
+
morning: "morning",
|
|
847
|
+
afternoon: "afternoon",
|
|
848
|
+
evening: "evening",
|
|
849
|
+
night: "night"
|
|
850
|
+
}, Rt = {
|
|
851
|
+
// Era
|
|
852
|
+
G: function(e, t, o) {
|
|
853
|
+
const n = e.getFullYear() > 0 ? 1 : 0;
|
|
854
|
+
switch (t) {
|
|
855
|
+
// AD, BC
|
|
856
|
+
case "G":
|
|
857
|
+
case "GG":
|
|
858
|
+
case "GGG":
|
|
859
|
+
return o.era(n, { width: "abbreviated" });
|
|
860
|
+
// A, B
|
|
861
|
+
case "GGGGG":
|
|
862
|
+
return o.era(n, { width: "narrow" });
|
|
863
|
+
default:
|
|
864
|
+
return o.era(n, { width: "wide" });
|
|
865
|
+
}
|
|
866
|
+
},
|
|
867
|
+
// Year
|
|
868
|
+
y: function(e, t, o) {
|
|
869
|
+
if (t === "yo") {
|
|
870
|
+
const n = e.getFullYear(), r = n > 0 ? n : 1 - n;
|
|
871
|
+
return o.ordinalNumber(r, { unit: "year" });
|
|
872
|
+
}
|
|
873
|
+
return Ye.y(e, t);
|
|
874
|
+
},
|
|
875
|
+
// Local week-numbering year
|
|
876
|
+
Y: function(e, t, o, n) {
|
|
877
|
+
const r = un(e, n), i = r > 0 ? r : 1 - r;
|
|
878
|
+
if (t === "YY") {
|
|
879
|
+
const s = i % 100;
|
|
880
|
+
return I(s, 2);
|
|
881
|
+
}
|
|
882
|
+
return t === "Yo" ? o.ordinalNumber(i, { unit: "year" }) : I(i, t.length);
|
|
883
|
+
},
|
|
884
|
+
// ISO week-numbering year
|
|
885
|
+
R: function(e, t) {
|
|
886
|
+
const o = nn(e);
|
|
887
|
+
return I(o, t.length);
|
|
888
|
+
},
|
|
889
|
+
// Extended year. This is a single number designating the year of this calendar system.
|
|
890
|
+
// The main difference between `y` and `u` localizers are B.C. years:
|
|
891
|
+
// | Year | `y` | `u` |
|
|
892
|
+
// |------|-----|-----|
|
|
893
|
+
// | AC 1 | 1 | 1 |
|
|
894
|
+
// | BC 1 | 1 | 0 |
|
|
895
|
+
// | BC 2 | 2 | -1 |
|
|
896
|
+
// Also `yy` always returns the last two digits of a year,
|
|
897
|
+
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
898
|
+
u: function(e, t) {
|
|
899
|
+
const o = e.getFullYear();
|
|
900
|
+
return I(o, t.length);
|
|
901
|
+
},
|
|
902
|
+
// Quarter
|
|
903
|
+
Q: function(e, t, o) {
|
|
904
|
+
const n = Math.ceil((e.getMonth() + 1) / 3);
|
|
905
|
+
switch (t) {
|
|
906
|
+
// 1, 2, 3, 4
|
|
907
|
+
case "Q":
|
|
908
|
+
return String(n);
|
|
909
|
+
// 01, 02, 03, 04
|
|
910
|
+
case "QQ":
|
|
911
|
+
return I(n, 2);
|
|
912
|
+
// 1st, 2nd, 3rd, 4th
|
|
913
|
+
case "Qo":
|
|
914
|
+
return o.ordinalNumber(n, { unit: "quarter" });
|
|
915
|
+
// Q1, Q2, Q3, Q4
|
|
916
|
+
case "QQQ":
|
|
917
|
+
return o.quarter(n, {
|
|
918
|
+
width: "abbreviated",
|
|
919
|
+
context: "formatting"
|
|
920
|
+
});
|
|
921
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
922
|
+
case "QQQQQ":
|
|
923
|
+
return o.quarter(n, {
|
|
924
|
+
width: "narrow",
|
|
925
|
+
context: "formatting"
|
|
926
|
+
});
|
|
927
|
+
default:
|
|
928
|
+
return o.quarter(n, {
|
|
929
|
+
width: "wide",
|
|
930
|
+
context: "formatting"
|
|
931
|
+
});
|
|
932
|
+
}
|
|
933
|
+
},
|
|
934
|
+
// Stand-alone quarter
|
|
935
|
+
q: function(e, t, o) {
|
|
936
|
+
const n = Math.ceil((e.getMonth() + 1) / 3);
|
|
937
|
+
switch (t) {
|
|
938
|
+
// 1, 2, 3, 4
|
|
939
|
+
case "q":
|
|
940
|
+
return String(n);
|
|
941
|
+
// 01, 02, 03, 04
|
|
942
|
+
case "qq":
|
|
943
|
+
return I(n, 2);
|
|
944
|
+
// 1st, 2nd, 3rd, 4th
|
|
945
|
+
case "qo":
|
|
946
|
+
return o.ordinalNumber(n, { unit: "quarter" });
|
|
947
|
+
// Q1, Q2, Q3, Q4
|
|
948
|
+
case "qqq":
|
|
949
|
+
return o.quarter(n, {
|
|
950
|
+
width: "abbreviated",
|
|
951
|
+
context: "standalone"
|
|
952
|
+
});
|
|
953
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
954
|
+
case "qqqqq":
|
|
955
|
+
return o.quarter(n, {
|
|
956
|
+
width: "narrow",
|
|
957
|
+
context: "standalone"
|
|
958
|
+
});
|
|
959
|
+
default:
|
|
960
|
+
return o.quarter(n, {
|
|
961
|
+
width: "wide",
|
|
962
|
+
context: "standalone"
|
|
963
|
+
});
|
|
964
|
+
}
|
|
965
|
+
},
|
|
966
|
+
// Month
|
|
967
|
+
M: function(e, t, o) {
|
|
968
|
+
const n = e.getMonth();
|
|
969
|
+
switch (t) {
|
|
970
|
+
case "M":
|
|
971
|
+
case "MM":
|
|
972
|
+
return Ye.M(e, t);
|
|
973
|
+
// 1st, 2nd, ..., 12th
|
|
974
|
+
case "Mo":
|
|
975
|
+
return o.ordinalNumber(n + 1, { unit: "month" });
|
|
976
|
+
// Jan, Feb, ..., Dec
|
|
977
|
+
case "MMM":
|
|
978
|
+
return o.month(n, {
|
|
979
|
+
width: "abbreviated",
|
|
980
|
+
context: "formatting"
|
|
981
|
+
});
|
|
982
|
+
// J, F, ..., D
|
|
983
|
+
case "MMMMM":
|
|
984
|
+
return o.month(n, {
|
|
985
|
+
width: "narrow",
|
|
986
|
+
context: "formatting"
|
|
987
|
+
});
|
|
988
|
+
default:
|
|
989
|
+
return o.month(n, { width: "wide", context: "formatting" });
|
|
990
|
+
}
|
|
991
|
+
},
|
|
992
|
+
// Stand-alone month
|
|
993
|
+
L: function(e, t, o) {
|
|
994
|
+
const n = e.getMonth();
|
|
995
|
+
switch (t) {
|
|
996
|
+
// 1, 2, ..., 12
|
|
997
|
+
case "L":
|
|
998
|
+
return String(n + 1);
|
|
999
|
+
// 01, 02, ..., 12
|
|
1000
|
+
case "LL":
|
|
1001
|
+
return I(n + 1, 2);
|
|
1002
|
+
// 1st, 2nd, ..., 12th
|
|
1003
|
+
case "Lo":
|
|
1004
|
+
return o.ordinalNumber(n + 1, { unit: "month" });
|
|
1005
|
+
// Jan, Feb, ..., Dec
|
|
1006
|
+
case "LLL":
|
|
1007
|
+
return o.month(n, {
|
|
1008
|
+
width: "abbreviated",
|
|
1009
|
+
context: "standalone"
|
|
1010
|
+
});
|
|
1011
|
+
// J, F, ..., D
|
|
1012
|
+
case "LLLLL":
|
|
1013
|
+
return o.month(n, {
|
|
1014
|
+
width: "narrow",
|
|
1015
|
+
context: "standalone"
|
|
1016
|
+
});
|
|
1017
|
+
default:
|
|
1018
|
+
return o.month(n, { width: "wide", context: "standalone" });
|
|
1019
|
+
}
|
|
1020
|
+
},
|
|
1021
|
+
// Local week of year
|
|
1022
|
+
w: function(e, t, o, n) {
|
|
1023
|
+
const r = Tt(e, n);
|
|
1024
|
+
return t === "wo" ? o.ordinalNumber(r, { unit: "week" }) : I(r, t.length);
|
|
1025
|
+
},
|
|
1026
|
+
// ISO week of year
|
|
1027
|
+
I: function(e, t, o) {
|
|
1028
|
+
const n = Pt(e);
|
|
1029
|
+
return t === "Io" ? o.ordinalNumber(n, { unit: "week" }) : I(n, t.length);
|
|
1030
|
+
},
|
|
1031
|
+
// Day of the month
|
|
1032
|
+
d: function(e, t, o) {
|
|
1033
|
+
return t === "do" ? o.ordinalNumber(e.getDate(), { unit: "date" }) : Ye.d(e, t);
|
|
1034
|
+
},
|
|
1035
|
+
// Day of year
|
|
1036
|
+
D: function(e, t, o) {
|
|
1037
|
+
const n = _o(e);
|
|
1038
|
+
return t === "Do" ? o.ordinalNumber(n, { unit: "dayOfYear" }) : I(n, t.length);
|
|
1039
|
+
},
|
|
1040
|
+
// Day of week
|
|
1041
|
+
E: function(e, t, o) {
|
|
1042
|
+
const n = e.getDay();
|
|
1043
|
+
switch (t) {
|
|
1044
|
+
// Tue
|
|
1045
|
+
case "E":
|
|
1046
|
+
case "EE":
|
|
1047
|
+
case "EEE":
|
|
1048
|
+
return o.day(n, {
|
|
1049
|
+
width: "abbreviated",
|
|
1050
|
+
context: "formatting"
|
|
1051
|
+
});
|
|
1052
|
+
// T
|
|
1053
|
+
case "EEEEE":
|
|
1054
|
+
return o.day(n, {
|
|
1055
|
+
width: "narrow",
|
|
1056
|
+
context: "formatting"
|
|
1057
|
+
});
|
|
1058
|
+
// Tu
|
|
1059
|
+
case "EEEEEE":
|
|
1060
|
+
return o.day(n, {
|
|
1061
|
+
width: "short",
|
|
1062
|
+
context: "formatting"
|
|
1063
|
+
});
|
|
1064
|
+
default:
|
|
1065
|
+
return o.day(n, {
|
|
1066
|
+
width: "wide",
|
|
1067
|
+
context: "formatting"
|
|
1068
|
+
});
|
|
1069
|
+
}
|
|
1070
|
+
},
|
|
1071
|
+
// Local day of week
|
|
1072
|
+
e: function(e, t, o, n) {
|
|
1073
|
+
const r = e.getDay(), i = (r - n.weekStartsOn + 8) % 7 || 7;
|
|
1074
|
+
switch (t) {
|
|
1075
|
+
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
1076
|
+
case "e":
|
|
1077
|
+
return String(i);
|
|
1078
|
+
// Padded numerical value
|
|
1079
|
+
case "ee":
|
|
1080
|
+
return I(i, 2);
|
|
1081
|
+
// 1st, 2nd, ..., 7th
|
|
1082
|
+
case "eo":
|
|
1083
|
+
return o.ordinalNumber(i, { unit: "day" });
|
|
1084
|
+
case "eee":
|
|
1085
|
+
return o.day(r, {
|
|
1086
|
+
width: "abbreviated",
|
|
1087
|
+
context: "formatting"
|
|
1088
|
+
});
|
|
1089
|
+
// T
|
|
1090
|
+
case "eeeee":
|
|
1091
|
+
return o.day(r, {
|
|
1092
|
+
width: "narrow",
|
|
1093
|
+
context: "formatting"
|
|
1094
|
+
});
|
|
1095
|
+
// Tu
|
|
1096
|
+
case "eeeeee":
|
|
1097
|
+
return o.day(r, {
|
|
1098
|
+
width: "short",
|
|
1099
|
+
context: "formatting"
|
|
1100
|
+
});
|
|
1101
|
+
default:
|
|
1102
|
+
return o.day(r, {
|
|
1103
|
+
width: "wide",
|
|
1104
|
+
context: "formatting"
|
|
1105
|
+
});
|
|
1106
|
+
}
|
|
1107
|
+
},
|
|
1108
|
+
// Stand-alone local day of week
|
|
1109
|
+
c: function(e, t, o, n) {
|
|
1110
|
+
const r = e.getDay(), i = (r - n.weekStartsOn + 8) % 7 || 7;
|
|
1111
|
+
switch (t) {
|
|
1112
|
+
// Numerical value (same as in `e`)
|
|
1113
|
+
case "c":
|
|
1114
|
+
return String(i);
|
|
1115
|
+
// Padded numerical value
|
|
1116
|
+
case "cc":
|
|
1117
|
+
return I(i, t.length);
|
|
1118
|
+
// 1st, 2nd, ..., 7th
|
|
1119
|
+
case "co":
|
|
1120
|
+
return o.ordinalNumber(i, { unit: "day" });
|
|
1121
|
+
case "ccc":
|
|
1122
|
+
return o.day(r, {
|
|
1123
|
+
width: "abbreviated",
|
|
1124
|
+
context: "standalone"
|
|
1125
|
+
});
|
|
1126
|
+
// T
|
|
1127
|
+
case "ccccc":
|
|
1128
|
+
return o.day(r, {
|
|
1129
|
+
width: "narrow",
|
|
1130
|
+
context: "standalone"
|
|
1131
|
+
});
|
|
1132
|
+
// Tu
|
|
1133
|
+
case "cccccc":
|
|
1134
|
+
return o.day(r, {
|
|
1135
|
+
width: "short",
|
|
1136
|
+
context: "standalone"
|
|
1137
|
+
});
|
|
1138
|
+
default:
|
|
1139
|
+
return o.day(r, {
|
|
1140
|
+
width: "wide",
|
|
1141
|
+
context: "standalone"
|
|
1142
|
+
});
|
|
1143
|
+
}
|
|
1144
|
+
},
|
|
1145
|
+
// ISO day of week
|
|
1146
|
+
i: function(e, t, o) {
|
|
1147
|
+
const n = e.getDay(), r = n === 0 ? 7 : n;
|
|
1148
|
+
switch (t) {
|
|
1149
|
+
// 2
|
|
1150
|
+
case "i":
|
|
1151
|
+
return String(r);
|
|
1152
|
+
// 02
|
|
1153
|
+
case "ii":
|
|
1154
|
+
return I(r, t.length);
|
|
1155
|
+
// 2nd
|
|
1156
|
+
case "io":
|
|
1157
|
+
return o.ordinalNumber(r, { unit: "day" });
|
|
1158
|
+
// Tue
|
|
1159
|
+
case "iii":
|
|
1160
|
+
return o.day(n, {
|
|
1161
|
+
width: "abbreviated",
|
|
1162
|
+
context: "formatting"
|
|
1163
|
+
});
|
|
1164
|
+
// T
|
|
1165
|
+
case "iiiii":
|
|
1166
|
+
return o.day(n, {
|
|
1167
|
+
width: "narrow",
|
|
1168
|
+
context: "formatting"
|
|
1169
|
+
});
|
|
1170
|
+
// Tu
|
|
1171
|
+
case "iiiiii":
|
|
1172
|
+
return o.day(n, {
|
|
1173
|
+
width: "short",
|
|
1174
|
+
context: "formatting"
|
|
1175
|
+
});
|
|
1176
|
+
default:
|
|
1177
|
+
return o.day(n, {
|
|
1178
|
+
width: "wide",
|
|
1179
|
+
context: "formatting"
|
|
1180
|
+
});
|
|
1181
|
+
}
|
|
1182
|
+
},
|
|
1183
|
+
// AM or PM
|
|
1184
|
+
a: function(e, t, o) {
|
|
1185
|
+
const r = e.getHours() / 12 >= 1 ? "pm" : "am";
|
|
1186
|
+
switch (t) {
|
|
1187
|
+
case "a":
|
|
1188
|
+
case "aa":
|
|
1189
|
+
return o.dayPeriod(r, {
|
|
1190
|
+
width: "abbreviated",
|
|
1191
|
+
context: "formatting"
|
|
1192
|
+
});
|
|
1193
|
+
case "aaa":
|
|
1194
|
+
return o.dayPeriod(r, {
|
|
1195
|
+
width: "abbreviated",
|
|
1196
|
+
context: "formatting"
|
|
1197
|
+
}).toLowerCase();
|
|
1198
|
+
case "aaaaa":
|
|
1199
|
+
return o.dayPeriod(r, {
|
|
1200
|
+
width: "narrow",
|
|
1201
|
+
context: "formatting"
|
|
1202
|
+
});
|
|
1203
|
+
default:
|
|
1204
|
+
return o.dayPeriod(r, {
|
|
1205
|
+
width: "wide",
|
|
1206
|
+
context: "formatting"
|
|
1207
|
+
});
|
|
1208
|
+
}
|
|
1209
|
+
},
|
|
1210
|
+
// AM, PM, midnight, noon
|
|
1211
|
+
b: function(e, t, o) {
|
|
1212
|
+
const n = e.getHours();
|
|
1213
|
+
let r;
|
|
1214
|
+
switch (n === 12 ? r = ze.noon : n === 0 ? r = ze.midnight : r = n / 12 >= 1 ? "pm" : "am", t) {
|
|
1215
|
+
case "b":
|
|
1216
|
+
case "bb":
|
|
1217
|
+
return o.dayPeriod(r, {
|
|
1218
|
+
width: "abbreviated",
|
|
1219
|
+
context: "formatting"
|
|
1220
|
+
});
|
|
1221
|
+
case "bbb":
|
|
1222
|
+
return o.dayPeriod(r, {
|
|
1223
|
+
width: "abbreviated",
|
|
1224
|
+
context: "formatting"
|
|
1225
|
+
}).toLowerCase();
|
|
1226
|
+
case "bbbbb":
|
|
1227
|
+
return o.dayPeriod(r, {
|
|
1228
|
+
width: "narrow",
|
|
1229
|
+
context: "formatting"
|
|
1230
|
+
});
|
|
1231
|
+
default:
|
|
1232
|
+
return o.dayPeriod(r, {
|
|
1233
|
+
width: "wide",
|
|
1234
|
+
context: "formatting"
|
|
1235
|
+
});
|
|
1236
|
+
}
|
|
1237
|
+
},
|
|
1238
|
+
// in the morning, in the afternoon, in the evening, at night
|
|
1239
|
+
B: function(e, t, o) {
|
|
1240
|
+
const n = e.getHours();
|
|
1241
|
+
let r;
|
|
1242
|
+
switch (n >= 17 ? r = ze.evening : n >= 12 ? r = ze.afternoon : n >= 4 ? r = ze.morning : r = ze.night, t) {
|
|
1243
|
+
case "B":
|
|
1244
|
+
case "BB":
|
|
1245
|
+
case "BBB":
|
|
1246
|
+
return o.dayPeriod(r, {
|
|
1247
|
+
width: "abbreviated",
|
|
1248
|
+
context: "formatting"
|
|
1249
|
+
});
|
|
1250
|
+
case "BBBBB":
|
|
1251
|
+
return o.dayPeriod(r, {
|
|
1252
|
+
width: "narrow",
|
|
1253
|
+
context: "formatting"
|
|
1254
|
+
});
|
|
1255
|
+
default:
|
|
1256
|
+
return o.dayPeriod(r, {
|
|
1257
|
+
width: "wide",
|
|
1258
|
+
context: "formatting"
|
|
1259
|
+
});
|
|
1260
|
+
}
|
|
1261
|
+
},
|
|
1262
|
+
// Hour [1-12]
|
|
1263
|
+
h: function(e, t, o) {
|
|
1264
|
+
if (t === "ho") {
|
|
1265
|
+
let n = e.getHours() % 12;
|
|
1266
|
+
return n === 0 && (n = 12), o.ordinalNumber(n, { unit: "hour" });
|
|
1267
|
+
}
|
|
1268
|
+
return Ye.h(e, t);
|
|
1269
|
+
},
|
|
1270
|
+
// Hour [0-23]
|
|
1271
|
+
H: function(e, t, o) {
|
|
1272
|
+
return t === "Ho" ? o.ordinalNumber(e.getHours(), { unit: "hour" }) : Ye.H(e, t);
|
|
1273
|
+
},
|
|
1274
|
+
// Hour [0-11]
|
|
1275
|
+
K: function(e, t, o) {
|
|
1276
|
+
const n = e.getHours() % 12;
|
|
1277
|
+
return t === "Ko" ? o.ordinalNumber(n, { unit: "hour" }) : I(n, t.length);
|
|
1278
|
+
},
|
|
1279
|
+
// Hour [1-24]
|
|
1280
|
+
k: function(e, t, o) {
|
|
1281
|
+
let n = e.getHours();
|
|
1282
|
+
return n === 0 && (n = 24), t === "ko" ? o.ordinalNumber(n, { unit: "hour" }) : I(n, t.length);
|
|
1283
|
+
},
|
|
1284
|
+
// Minute
|
|
1285
|
+
m: function(e, t, o) {
|
|
1286
|
+
return t === "mo" ? o.ordinalNumber(e.getMinutes(), { unit: "minute" }) : Ye.m(e, t);
|
|
1287
|
+
},
|
|
1288
|
+
// Second
|
|
1289
|
+
s: function(e, t, o) {
|
|
1290
|
+
return t === "so" ? o.ordinalNumber(e.getSeconds(), { unit: "second" }) : Ye.s(e, t);
|
|
1291
|
+
},
|
|
1292
|
+
// Fraction of second
|
|
1293
|
+
S: function(e, t) {
|
|
1294
|
+
return Ye.S(e, t);
|
|
1295
|
+
},
|
|
1296
|
+
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1297
|
+
X: function(e, t, o) {
|
|
1298
|
+
const n = e.getTimezoneOffset();
|
|
1299
|
+
if (n === 0)
|
|
1300
|
+
return "Z";
|
|
1301
|
+
switch (t) {
|
|
1302
|
+
// Hours and optional minutes
|
|
1303
|
+
case "X":
|
|
1304
|
+
return Gt(n);
|
|
1305
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
|
1306
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1307
|
+
// so this token always has the same output as `XX`
|
|
1308
|
+
case "XXXX":
|
|
1309
|
+
case "XX":
|
|
1310
|
+
return Ie(n);
|
|
1311
|
+
// Hours and minutes with `:` delimiter
|
|
1312
|
+
default:
|
|
1313
|
+
return Ie(n, ":");
|
|
1314
|
+
}
|
|
1315
|
+
},
|
|
1316
|
+
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
1317
|
+
x: function(e, t, o) {
|
|
1318
|
+
const n = e.getTimezoneOffset();
|
|
1319
|
+
switch (t) {
|
|
1320
|
+
// Hours and optional minutes
|
|
1321
|
+
case "x":
|
|
1322
|
+
return Gt(n);
|
|
1323
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
|
1324
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1325
|
+
// so this token always has the same output as `xx`
|
|
1326
|
+
case "xxxx":
|
|
1327
|
+
case "xx":
|
|
1328
|
+
return Ie(n);
|
|
1329
|
+
// Hours and minutes with `:` delimiter
|
|
1330
|
+
default:
|
|
1331
|
+
return Ie(n, ":");
|
|
1332
|
+
}
|
|
1333
|
+
},
|
|
1334
|
+
// Timezone (GMT)
|
|
1335
|
+
O: function(e, t, o) {
|
|
1336
|
+
const n = e.getTimezoneOffset();
|
|
1337
|
+
switch (t) {
|
|
1338
|
+
// Short
|
|
1339
|
+
case "O":
|
|
1340
|
+
case "OO":
|
|
1341
|
+
case "OOO":
|
|
1342
|
+
return "GMT" + zt(n, ":");
|
|
1343
|
+
default:
|
|
1344
|
+
return "GMT" + Ie(n, ":");
|
|
1345
|
+
}
|
|
1346
|
+
},
|
|
1347
|
+
// Timezone (specific non-location)
|
|
1348
|
+
z: function(e, t, o) {
|
|
1349
|
+
const n = e.getTimezoneOffset();
|
|
1350
|
+
switch (t) {
|
|
1351
|
+
// Short
|
|
1352
|
+
case "z":
|
|
1353
|
+
case "zz":
|
|
1354
|
+
case "zzz":
|
|
1355
|
+
return "GMT" + zt(n, ":");
|
|
1356
|
+
default:
|
|
1357
|
+
return "GMT" + Ie(n, ":");
|
|
1358
|
+
}
|
|
1359
|
+
},
|
|
1360
|
+
// Seconds timestamp
|
|
1361
|
+
t: function(e, t, o) {
|
|
1362
|
+
const n = Math.trunc(+e / 1e3);
|
|
1363
|
+
return I(n, t.length);
|
|
1364
|
+
},
|
|
1365
|
+
// Milliseconds timestamp
|
|
1366
|
+
T: function(e, t, o) {
|
|
1367
|
+
return I(+e, t.length);
|
|
1368
|
+
}
|
|
1369
|
+
};
|
|
1370
|
+
function zt(e, t = "") {
|
|
1371
|
+
const o = e > 0 ? "-" : "+", n = Math.abs(e), r = Math.trunc(n / 60), i = n % 60;
|
|
1372
|
+
return i === 0 ? o + String(r) : o + String(r) + t + I(i, 2);
|
|
1373
|
+
}
|
|
1374
|
+
function Gt(e, t) {
|
|
1375
|
+
return e % 60 === 0 ? (e > 0 ? "-" : "+") + I(Math.abs(e) / 60, 2) : Ie(e, t);
|
|
1376
|
+
}
|
|
1377
|
+
function Ie(e, t = "") {
|
|
1378
|
+
const o = e > 0 ? "-" : "+", n = Math.abs(e), r = I(Math.trunc(n / 60), 2), i = I(n % 60, 2);
|
|
1379
|
+
return o + r + t + i;
|
|
1380
|
+
}
|
|
1381
|
+
const Vt = (e, t) => {
|
|
1382
|
+
switch (e) {
|
|
1383
|
+
case "P":
|
|
1384
|
+
return t.date({ width: "short" });
|
|
1385
|
+
case "PP":
|
|
1386
|
+
return t.date({ width: "medium" });
|
|
1387
|
+
case "PPP":
|
|
1388
|
+
return t.date({ width: "long" });
|
|
1389
|
+
default:
|
|
1390
|
+
return t.date({ width: "full" });
|
|
1391
|
+
}
|
|
1392
|
+
}, dn = (e, t) => {
|
|
1393
|
+
switch (e) {
|
|
1394
|
+
case "p":
|
|
1395
|
+
return t.time({ width: "short" });
|
|
1396
|
+
case "pp":
|
|
1397
|
+
return t.time({ width: "medium" });
|
|
1398
|
+
case "ppp":
|
|
1399
|
+
return t.time({ width: "long" });
|
|
1400
|
+
default:
|
|
1401
|
+
return t.time({ width: "full" });
|
|
1402
|
+
}
|
|
1403
|
+
}, Bo = (e, t) => {
|
|
1404
|
+
const o = e.match(/(P+)(p+)?/) || [], n = o[1], r = o[2];
|
|
1405
|
+
if (!r)
|
|
1406
|
+
return Vt(e, t);
|
|
1407
|
+
let i;
|
|
1408
|
+
switch (n) {
|
|
1409
|
+
case "P":
|
|
1410
|
+
i = t.dateTime({ width: "short" });
|
|
1411
|
+
break;
|
|
1412
|
+
case "PP":
|
|
1413
|
+
i = t.dateTime({ width: "medium" });
|
|
1414
|
+
break;
|
|
1415
|
+
case "PPP":
|
|
1416
|
+
i = t.dateTime({ width: "long" });
|
|
1417
|
+
break;
|
|
1418
|
+
default:
|
|
1419
|
+
i = t.dateTime({ width: "full" });
|
|
1420
|
+
break;
|
|
1421
|
+
}
|
|
1422
|
+
return i.replace("{{date}}", Vt(n, t)).replace("{{time}}", dn(r, t));
|
|
1423
|
+
}, jo = {
|
|
1424
|
+
p: dn,
|
|
1425
|
+
P: Bo
|
|
1426
|
+
}, $o = /^D+$/, Ao = /^Y+$/, Ho = ["D", "DD", "YY", "YYYY"];
|
|
1427
|
+
function qo(e) {
|
|
1428
|
+
return $o.test(e);
|
|
1429
|
+
}
|
|
1430
|
+
function Ro(e) {
|
|
1431
|
+
return Ao.test(e);
|
|
1432
|
+
}
|
|
1433
|
+
function zo(e, t, o) {
|
|
1434
|
+
const n = Go(e, t, o);
|
|
1435
|
+
if (console.warn(n), Ho.includes(e)) throw new RangeError(n);
|
|
1436
|
+
}
|
|
1437
|
+
function Go(e, t, o) {
|
|
1438
|
+
const n = e[0] === "Y" ? "years" : "days of the month";
|
|
1439
|
+
return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
1440
|
+
}
|
|
1441
|
+
const Vo = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Xo = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Lo = /^'([^]*?)'?$/, Qo = /''/g, Uo = /[a-zA-Z]/;
|
|
1442
|
+
function et(e, t, o) {
|
|
1443
|
+
const n = rt(), r = o?.locale ?? n.locale ?? Ve, i = o?.firstWeekContainsDate ?? o?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, s = o?.weekStartsOn ?? o?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, a = B(e, o?.in);
|
|
1444
|
+
if (!Un(a))
|
|
1445
|
+
throw new RangeError("Invalid time value");
|
|
1446
|
+
let c = t.match(Xo).map((d) => {
|
|
1447
|
+
const u = d[0];
|
|
1448
|
+
if (u === "p" || u === "P") {
|
|
1449
|
+
const f = jo[u];
|
|
1450
|
+
return f(d, r.formatLong);
|
|
1451
|
+
}
|
|
1452
|
+
return d;
|
|
1453
|
+
}).join("").match(Vo).map((d) => {
|
|
1454
|
+
if (d === "''")
|
|
1455
|
+
return { isToken: !1, value: "'" };
|
|
1456
|
+
const u = d[0];
|
|
1457
|
+
if (u === "'")
|
|
1458
|
+
return { isToken: !1, value: Ko(d) };
|
|
1459
|
+
if (Rt[u])
|
|
1460
|
+
return { isToken: !0, value: d };
|
|
1461
|
+
if (u.match(Uo))
|
|
1462
|
+
throw new RangeError(
|
|
1463
|
+
"Format string contains an unescaped latin alphabet character `" + u + "`"
|
|
1464
|
+
);
|
|
1465
|
+
return { isToken: !1, value: d };
|
|
1466
|
+
});
|
|
1467
|
+
r.localize.preprocessor && (c = r.localize.preprocessor(a, c));
|
|
1468
|
+
const l = {
|
|
1469
|
+
firstWeekContainsDate: i,
|
|
1470
|
+
weekStartsOn: s,
|
|
1471
|
+
locale: r
|
|
1472
|
+
};
|
|
1473
|
+
return c.map((d) => {
|
|
1474
|
+
if (!d.isToken) return d.value;
|
|
1475
|
+
const u = d.value;
|
|
1476
|
+
(!o?.useAdditionalWeekYearTokens && Ro(u) || !o?.useAdditionalDayOfYearTokens && qo(u)) && zo(u, t, String(e));
|
|
1477
|
+
const f = Rt[u[0]];
|
|
1478
|
+
return f(a, u, r.localize, l);
|
|
1479
|
+
}).join("");
|
|
1480
|
+
}
|
|
1481
|
+
function Ko(e) {
|
|
1482
|
+
const t = e.match(Lo);
|
|
1483
|
+
return t ? t[1].replace(Qo, "'") : e;
|
|
1484
|
+
}
|
|
1485
|
+
function Zo(e, t) {
|
|
1486
|
+
const o = B(e, t?.in), n = o.getFullYear(), r = o.getMonth(), i = Q(o, 0);
|
|
1487
|
+
return i.setFullYear(n, r + 1, 0), i.setHours(0, 0, 0, 0), i.getDate();
|
|
1488
|
+
}
|
|
1489
|
+
function Jo(e, t) {
|
|
1490
|
+
return B(e, t?.in).getMonth();
|
|
1491
|
+
}
|
|
1492
|
+
function er(e, t) {
|
|
1493
|
+
return B(e, t?.in).getFullYear();
|
|
1494
|
+
}
|
|
1495
|
+
function tr(e, t) {
|
|
1496
|
+
return +B(e) > +B(t);
|
|
1497
|
+
}
|
|
1498
|
+
function nr(e, t) {
|
|
1499
|
+
return +B(e) < +B(t);
|
|
1500
|
+
}
|
|
1501
|
+
function or(e, t, o) {
|
|
1502
|
+
const [n, r] = Qe(
|
|
1503
|
+
o?.in,
|
|
1504
|
+
e,
|
|
1505
|
+
t
|
|
1506
|
+
);
|
|
1507
|
+
return n.getFullYear() === r.getFullYear() && n.getMonth() === r.getMonth();
|
|
1508
|
+
}
|
|
1509
|
+
function rr(e, t, o) {
|
|
1510
|
+
const [n, r] = Qe(
|
|
1511
|
+
o?.in,
|
|
1512
|
+
e,
|
|
1513
|
+
t
|
|
1514
|
+
);
|
|
1515
|
+
return n.getFullYear() === r.getFullYear();
|
|
1516
|
+
}
|
|
1517
|
+
function ar(e, t, o) {
|
|
1518
|
+
const n = B(e, o?.in), r = n.getFullYear(), i = n.getDate(), s = Q(e, 0);
|
|
1519
|
+
s.setFullYear(r, t, 15), s.setHours(0, 0, 0, 0);
|
|
1520
|
+
const a = Zo(s);
|
|
1521
|
+
return n.setMonth(t, Math.min(i, a)), n;
|
|
1522
|
+
}
|
|
1523
|
+
function sr(e, t, o) {
|
|
1524
|
+
const n = B(e, o?.in);
|
|
1525
|
+
return isNaN(+n) ? Q(e, NaN) : (n.setFullYear(t), n);
|
|
1526
|
+
}
|
|
1527
|
+
const Xt = 5, ir = 4;
|
|
1528
|
+
function cr(e, t) {
|
|
1529
|
+
const o = t.startOfMonth(e), n = o.getDay() > 0 ? o.getDay() : 7, r = t.addDays(e, -n + 1), i = t.addDays(r, Xt * 7 - 1);
|
|
1530
|
+
return t.getMonth(e) === t.getMonth(i) ? Xt : ir;
|
|
1531
|
+
}
|
|
1532
|
+
function fn(e, t) {
|
|
1533
|
+
const o = t.startOfMonth(e), n = o.getDay();
|
|
1534
|
+
return n === 1 ? o : n === 0 ? t.addDays(o, -6) : t.addDays(o, -1 * (n - 1));
|
|
1535
|
+
}
|
|
1536
|
+
function lr(e, t) {
|
|
1537
|
+
const o = fn(e, t), n = cr(e, t);
|
|
1538
|
+
return t.addDays(o, n * 7 - 1);
|
|
1539
|
+
}
|
|
1540
|
+
const ur = {
|
|
1541
|
+
lessThanXSeconds: {
|
|
1542
|
+
one: "menos de un segundo",
|
|
1543
|
+
other: "menos de {{count}} segundos"
|
|
1544
|
+
},
|
|
1545
|
+
xSeconds: {
|
|
1546
|
+
one: "1 segundo",
|
|
1547
|
+
other: "{{count}} segundos"
|
|
1548
|
+
},
|
|
1549
|
+
halfAMinute: "medio minuto",
|
|
1550
|
+
lessThanXMinutes: {
|
|
1551
|
+
one: "menos de un minuto",
|
|
1552
|
+
other: "menos de {{count}} minutos"
|
|
1553
|
+
},
|
|
1554
|
+
xMinutes: {
|
|
1555
|
+
one: "1 minuto",
|
|
1556
|
+
other: "{{count}} minutos"
|
|
1557
|
+
},
|
|
1558
|
+
aboutXHours: {
|
|
1559
|
+
one: "alrededor de 1 hora",
|
|
1560
|
+
other: "alrededor de {{count}} horas"
|
|
1561
|
+
},
|
|
1562
|
+
xHours: {
|
|
1563
|
+
one: "1 hora",
|
|
1564
|
+
other: "{{count}} horas"
|
|
1565
|
+
},
|
|
1566
|
+
xDays: {
|
|
1567
|
+
one: "1 día",
|
|
1568
|
+
other: "{{count}} días"
|
|
1569
|
+
},
|
|
1570
|
+
aboutXWeeks: {
|
|
1571
|
+
one: "alrededor de 1 semana",
|
|
1572
|
+
other: "alrededor de {{count}} semanas"
|
|
1573
|
+
},
|
|
1574
|
+
xWeeks: {
|
|
1575
|
+
one: "1 semana",
|
|
1576
|
+
other: "{{count}} semanas"
|
|
1577
|
+
},
|
|
1578
|
+
aboutXMonths: {
|
|
1579
|
+
one: "alrededor de 1 mes",
|
|
1580
|
+
other: "alrededor de {{count}} meses"
|
|
1581
|
+
},
|
|
1582
|
+
xMonths: {
|
|
1583
|
+
one: "1 mes",
|
|
1584
|
+
other: "{{count}} meses"
|
|
1585
|
+
},
|
|
1586
|
+
aboutXYears: {
|
|
1587
|
+
one: "alrededor de 1 año",
|
|
1588
|
+
other: "alrededor de {{count}} años"
|
|
1589
|
+
},
|
|
1590
|
+
xYears: {
|
|
1591
|
+
one: "1 año",
|
|
1592
|
+
other: "{{count}} años"
|
|
1593
|
+
},
|
|
1594
|
+
overXYears: {
|
|
1595
|
+
one: "más de 1 año",
|
|
1596
|
+
other: "más de {{count}} años"
|
|
1597
|
+
},
|
|
1598
|
+
almostXYears: {
|
|
1599
|
+
one: "casi 1 año",
|
|
1600
|
+
other: "casi {{count}} años"
|
|
1601
|
+
}
|
|
1602
|
+
}, dr = (e, t, o) => {
|
|
1603
|
+
let n;
|
|
1604
|
+
const r = ur[e];
|
|
1605
|
+
return typeof r == "string" ? n = r : t === 1 ? n = r.one : n = r.other.replace("{{count}}", t.toString()), o?.addSuffix ? o.comparison && o.comparison > 0 ? "en " + n : "hace " + n : n;
|
|
1606
|
+
}, fr = {
|
|
1607
|
+
full: "EEEE, d 'de' MMMM 'de' y",
|
|
1608
|
+
long: "d 'de' MMMM 'de' y",
|
|
1609
|
+
medium: "d MMM y",
|
|
1610
|
+
short: "dd/MM/y"
|
|
1611
|
+
}, hr = {
|
|
1612
|
+
full: "HH:mm:ss zzzz",
|
|
1613
|
+
long: "HH:mm:ss z",
|
|
1614
|
+
medium: "HH:mm:ss",
|
|
1615
|
+
short: "HH:mm"
|
|
1616
|
+
}, mr = {
|
|
1617
|
+
full: "{{date}} 'a las' {{time}}",
|
|
1618
|
+
long: "{{date}} 'a las' {{time}}",
|
|
1619
|
+
medium: "{{date}}, {{time}}",
|
|
1620
|
+
short: "{{date}}, {{time}}"
|
|
1621
|
+
}, yr = {
|
|
1622
|
+
date: Xe({
|
|
1623
|
+
formats: fr,
|
|
1624
|
+
defaultWidth: "full"
|
|
1625
|
+
}),
|
|
1626
|
+
time: Xe({
|
|
1627
|
+
formats: hr,
|
|
1628
|
+
defaultWidth: "full"
|
|
1629
|
+
}),
|
|
1630
|
+
dateTime: Xe({
|
|
1631
|
+
formats: mr,
|
|
1632
|
+
defaultWidth: "full"
|
|
1633
|
+
})
|
|
1634
|
+
}, gr = {
|
|
1635
|
+
lastWeek: "'el' eeee 'pasado a la' p",
|
|
1636
|
+
yesterday: "'ayer a la' p",
|
|
1637
|
+
today: "'hoy a la' p",
|
|
1638
|
+
tomorrow: "'mañana a la' p",
|
|
1639
|
+
nextWeek: "eeee 'a la' p",
|
|
1640
|
+
other: "P"
|
|
1641
|
+
}, pr = {
|
|
1642
|
+
lastWeek: "'el' eeee 'pasado a las' p",
|
|
1643
|
+
yesterday: "'ayer a las' p",
|
|
1644
|
+
today: "'hoy a las' p",
|
|
1645
|
+
tomorrow: "'mañana a las' p",
|
|
1646
|
+
nextWeek: "eeee 'a las' p",
|
|
1647
|
+
other: "P"
|
|
1648
|
+
}, br = (e, t, o, n) => t.getHours() !== 1 ? pr[e] : gr[e], wr = {
|
|
1649
|
+
narrow: ["AC", "DC"],
|
|
1650
|
+
abbreviated: ["AC", "DC"],
|
|
1651
|
+
wide: ["antes de cristo", "después de cristo"]
|
|
1652
|
+
}, Mr = {
|
|
1653
|
+
narrow: ["1", "2", "3", "4"],
|
|
1654
|
+
abbreviated: ["T1", "T2", "T3", "T4"],
|
|
1655
|
+
wide: ["1º trimestre", "2º trimestre", "3º trimestre", "4º trimestre"]
|
|
1656
|
+
}, Dr = {
|
|
1657
|
+
narrow: ["e", "f", "m", "a", "m", "j", "j", "a", "s", "o", "n", "d"],
|
|
1658
|
+
abbreviated: [
|
|
1659
|
+
"ene",
|
|
1660
|
+
"feb",
|
|
1661
|
+
"mar",
|
|
1662
|
+
"abr",
|
|
1663
|
+
"may",
|
|
1664
|
+
"jun",
|
|
1665
|
+
"jul",
|
|
1666
|
+
"ago",
|
|
1667
|
+
"sep",
|
|
1668
|
+
"oct",
|
|
1669
|
+
"nov",
|
|
1670
|
+
"dic"
|
|
1671
|
+
],
|
|
1672
|
+
wide: [
|
|
1673
|
+
"enero",
|
|
1674
|
+
"febrero",
|
|
1675
|
+
"marzo",
|
|
1676
|
+
"abril",
|
|
1677
|
+
"mayo",
|
|
1678
|
+
"junio",
|
|
1679
|
+
"julio",
|
|
1680
|
+
"agosto",
|
|
1681
|
+
"septiembre",
|
|
1682
|
+
"octubre",
|
|
1683
|
+
"noviembre",
|
|
1684
|
+
"diciembre"
|
|
1685
|
+
]
|
|
1686
|
+
}, vr = {
|
|
1687
|
+
narrow: ["d", "l", "m", "m", "j", "v", "s"],
|
|
1688
|
+
short: ["do", "lu", "ma", "mi", "ju", "vi", "sá"],
|
|
1689
|
+
abbreviated: ["dom", "lun", "mar", "mié", "jue", "vie", "sáb"],
|
|
1690
|
+
wide: [
|
|
1691
|
+
"domingo",
|
|
1692
|
+
"lunes",
|
|
1693
|
+
"martes",
|
|
1694
|
+
"miércoles",
|
|
1695
|
+
"jueves",
|
|
1696
|
+
"viernes",
|
|
1697
|
+
"sábado"
|
|
1698
|
+
]
|
|
1699
|
+
}, kr = {
|
|
1700
|
+
narrow: {
|
|
1701
|
+
am: "a",
|
|
1702
|
+
pm: "p",
|
|
1703
|
+
midnight: "mn",
|
|
1704
|
+
noon: "md",
|
|
1705
|
+
morning: "mañana",
|
|
1706
|
+
afternoon: "tarde",
|
|
1707
|
+
evening: "tarde",
|
|
1708
|
+
night: "noche"
|
|
1709
|
+
},
|
|
1710
|
+
abbreviated: {
|
|
1711
|
+
am: "AM",
|
|
1712
|
+
pm: "PM",
|
|
1713
|
+
midnight: "medianoche",
|
|
1714
|
+
noon: "mediodia",
|
|
1715
|
+
morning: "mañana",
|
|
1716
|
+
afternoon: "tarde",
|
|
1717
|
+
evening: "tarde",
|
|
1718
|
+
night: "noche"
|
|
1719
|
+
},
|
|
1720
|
+
wide: {
|
|
1721
|
+
am: "a.m.",
|
|
1722
|
+
pm: "p.m.",
|
|
1723
|
+
midnight: "medianoche",
|
|
1724
|
+
noon: "mediodia",
|
|
1725
|
+
morning: "mañana",
|
|
1726
|
+
afternoon: "tarde",
|
|
1727
|
+
evening: "tarde",
|
|
1728
|
+
night: "noche"
|
|
1729
|
+
}
|
|
1730
|
+
}, Or = {
|
|
1731
|
+
narrow: {
|
|
1732
|
+
am: "a",
|
|
1733
|
+
pm: "p",
|
|
1734
|
+
midnight: "mn",
|
|
1735
|
+
noon: "md",
|
|
1736
|
+
morning: "de la mañana",
|
|
1737
|
+
afternoon: "de la tarde",
|
|
1738
|
+
evening: "de la tarde",
|
|
1739
|
+
night: "de la noche"
|
|
1740
|
+
},
|
|
1741
|
+
abbreviated: {
|
|
1742
|
+
am: "AM",
|
|
1743
|
+
pm: "PM",
|
|
1744
|
+
midnight: "medianoche",
|
|
1745
|
+
noon: "mediodia",
|
|
1746
|
+
morning: "de la mañana",
|
|
1747
|
+
afternoon: "de la tarde",
|
|
1748
|
+
evening: "de la tarde",
|
|
1749
|
+
night: "de la noche"
|
|
1750
|
+
},
|
|
1751
|
+
wide: {
|
|
1752
|
+
am: "a.m.",
|
|
1753
|
+
pm: "p.m.",
|
|
1754
|
+
midnight: "medianoche",
|
|
1755
|
+
noon: "mediodia",
|
|
1756
|
+
morning: "de la mañana",
|
|
1757
|
+
afternoon: "de la tarde",
|
|
1758
|
+
evening: "de la tarde",
|
|
1759
|
+
night: "de la noche"
|
|
1760
|
+
}
|
|
1761
|
+
}, Wr = (e, t) => Number(e) + "º", Sr = {
|
|
1762
|
+
ordinalNumber: Wr,
|
|
1763
|
+
era: we({
|
|
1764
|
+
values: wr,
|
|
1765
|
+
defaultWidth: "wide"
|
|
1766
|
+
}),
|
|
1767
|
+
quarter: we({
|
|
1768
|
+
values: Mr,
|
|
1769
|
+
defaultWidth: "wide",
|
|
1770
|
+
argumentCallback: (e) => Number(e) - 1
|
|
1771
|
+
}),
|
|
1772
|
+
month: we({
|
|
1773
|
+
values: Dr,
|
|
1774
|
+
defaultWidth: "wide"
|
|
1775
|
+
}),
|
|
1776
|
+
day: we({
|
|
1777
|
+
values: vr,
|
|
1778
|
+
defaultWidth: "wide"
|
|
1779
|
+
}),
|
|
1780
|
+
dayPeriod: we({
|
|
1781
|
+
values: kr,
|
|
1782
|
+
defaultWidth: "wide",
|
|
1783
|
+
formattingValues: Or,
|
|
1784
|
+
defaultFormattingWidth: "wide"
|
|
1785
|
+
})
|
|
1786
|
+
}, Nr = /^(\d+)(º)?/i, Cr = /\d+/i, xr = {
|
|
1787
|
+
narrow: /^(ac|dc|a|d)/i,
|
|
1788
|
+
abbreviated: /^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,
|
|
1789
|
+
wide: /^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i
|
|
1790
|
+
}, Pr = {
|
|
1791
|
+
any: [/^ac/i, /^dc/i],
|
|
1792
|
+
wide: [
|
|
1793
|
+
/^(antes de cristo|antes de la era com[uú]n)/i,
|
|
1794
|
+
/^(despu[eé]s de cristo|era com[uú]n)/i
|
|
1795
|
+
]
|
|
1796
|
+
}, Tr = {
|
|
1797
|
+
narrow: /^[1234]/i,
|
|
1798
|
+
abbreviated: /^T[1234]/i,
|
|
1799
|
+
wide: /^[1234](º)? trimestre/i
|
|
1800
|
+
}, Yr = {
|
|
1801
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
1802
|
+
}, Er = {
|
|
1803
|
+
narrow: /^[efmajsond]/i,
|
|
1804
|
+
abbreviated: /^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,
|
|
1805
|
+
wide: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i
|
|
1806
|
+
}, Fr = {
|
|
1807
|
+
narrow: [
|
|
1808
|
+
/^e/i,
|
|
1809
|
+
/^f/i,
|
|
1810
|
+
/^m/i,
|
|
1811
|
+
/^a/i,
|
|
1812
|
+
/^m/i,
|
|
1813
|
+
/^j/i,
|
|
1814
|
+
/^j/i,
|
|
1815
|
+
/^a/i,
|
|
1816
|
+
/^s/i,
|
|
1817
|
+
/^o/i,
|
|
1818
|
+
/^n/i,
|
|
1819
|
+
/^d/i
|
|
1820
|
+
],
|
|
1821
|
+
any: [
|
|
1822
|
+
/^en/i,
|
|
1823
|
+
/^feb/i,
|
|
1824
|
+
/^mar/i,
|
|
1825
|
+
/^abr/i,
|
|
1826
|
+
/^may/i,
|
|
1827
|
+
/^jun/i,
|
|
1828
|
+
/^jul/i,
|
|
1829
|
+
/^ago/i,
|
|
1830
|
+
/^sep/i,
|
|
1831
|
+
/^oct/i,
|
|
1832
|
+
/^nov/i,
|
|
1833
|
+
/^dic/i
|
|
1834
|
+
]
|
|
1835
|
+
}, _r = {
|
|
1836
|
+
narrow: /^[dlmjvs]/i,
|
|
1837
|
+
short: /^(do|lu|ma|mi|ju|vi|s[áa])/i,
|
|
1838
|
+
abbreviated: /^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,
|
|
1839
|
+
wide: /^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i
|
|
1840
|
+
}, Ir = {
|
|
1841
|
+
narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^j/i, /^v/i, /^s/i],
|
|
1842
|
+
any: [/^do/i, /^lu/i, /^ma/i, /^mi/i, /^ju/i, /^vi/i, /^sa/i]
|
|
1843
|
+
}, Br = {
|
|
1844
|
+
narrow: /^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,
|
|
1845
|
+
any: /^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i
|
|
1846
|
+
}, jr = {
|
|
1847
|
+
any: {
|
|
1848
|
+
am: /^a/i,
|
|
1849
|
+
pm: /^p/i,
|
|
1850
|
+
midnight: /^mn/i,
|
|
1851
|
+
noon: /^md/i,
|
|
1852
|
+
morning: /mañana/i,
|
|
1853
|
+
afternoon: /tarde/i,
|
|
1854
|
+
evening: /tarde/i,
|
|
1855
|
+
night: /noche/i
|
|
1856
|
+
}
|
|
1857
|
+
}, $r = {
|
|
1858
|
+
ordinalNumber: ln({
|
|
1859
|
+
matchPattern: Nr,
|
|
1860
|
+
parsePattern: Cr,
|
|
1861
|
+
valueCallback: function(e) {
|
|
1862
|
+
return parseInt(e, 10);
|
|
1863
|
+
}
|
|
1864
|
+
}),
|
|
1865
|
+
era: Me({
|
|
1866
|
+
matchPatterns: xr,
|
|
1867
|
+
defaultMatchWidth: "wide",
|
|
1868
|
+
parsePatterns: Pr,
|
|
1869
|
+
defaultParseWidth: "any"
|
|
1870
|
+
}),
|
|
1871
|
+
quarter: Me({
|
|
1872
|
+
matchPatterns: Tr,
|
|
1873
|
+
defaultMatchWidth: "wide",
|
|
1874
|
+
parsePatterns: Yr,
|
|
1875
|
+
defaultParseWidth: "any",
|
|
1876
|
+
valueCallback: (e) => e + 1
|
|
1877
|
+
}),
|
|
1878
|
+
month: Me({
|
|
1879
|
+
matchPatterns: Er,
|
|
1880
|
+
defaultMatchWidth: "wide",
|
|
1881
|
+
parsePatterns: Fr,
|
|
1882
|
+
defaultParseWidth: "any"
|
|
1883
|
+
}),
|
|
1884
|
+
day: Me({
|
|
1885
|
+
matchPatterns: _r,
|
|
1886
|
+
defaultMatchWidth: "wide",
|
|
1887
|
+
parsePatterns: Ir,
|
|
1888
|
+
defaultParseWidth: "any"
|
|
1889
|
+
}),
|
|
1890
|
+
dayPeriod: Me({
|
|
1891
|
+
matchPatterns: Br,
|
|
1892
|
+
defaultMatchWidth: "any",
|
|
1893
|
+
parsePatterns: jr,
|
|
1894
|
+
defaultParseWidth: "any"
|
|
1895
|
+
})
|
|
1896
|
+
}, Dt = {
|
|
1897
|
+
code: "es",
|
|
1898
|
+
formatDistance: dr,
|
|
1899
|
+
formatLong: yr,
|
|
1900
|
+
formatRelative: br,
|
|
1901
|
+
localize: Sr,
|
|
1902
|
+
match: $r,
|
|
1903
|
+
options: {
|
|
1904
|
+
weekStartsOn: 1,
|
|
1905
|
+
firstWeekContainsDate: 1
|
|
1906
|
+
}
|
|
1907
|
+
}, hn = {
|
|
1908
|
+
...Ve,
|
|
1909
|
+
labels: {
|
|
1910
|
+
labelDayButton: (e, t, o, n) => {
|
|
1911
|
+
let r;
|
|
1912
|
+
n && typeof n.format == "function" ? r = n.format.bind(n) : r = (s, a) => et(s, a, { locale: Ve, ...o });
|
|
1913
|
+
let i = r(e, "PPPP");
|
|
1914
|
+
return t.today && (i = `Today, ${i}`), t.selected && (i = `${i}, selected`), i;
|
|
1915
|
+
},
|
|
1916
|
+
labelMonthDropdown: "Choose the Month",
|
|
1917
|
+
labelNext: "Go to the Next Month",
|
|
1918
|
+
labelPrevious: "Go to the Previous Month",
|
|
1919
|
+
labelWeekNumber: (e) => `Week ${e}`,
|
|
1920
|
+
labelYearDropdown: "Choose the Year",
|
|
1921
|
+
labelGrid: (e, t, o) => {
|
|
1922
|
+
let n;
|
|
1923
|
+
return o && typeof o.format == "function" ? n = o.format.bind(o) : n = (r, i) => et(r, i, { locale: Ve, ...t }), n(e, "LLLL yyyy");
|
|
1924
|
+
},
|
|
1925
|
+
labelGridcell: (e, t, o, n) => {
|
|
1926
|
+
let r;
|
|
1927
|
+
n && typeof n.format == "function" ? r = n.format.bind(n) : r = (s, a) => et(s, a, { locale: Ve, ...o });
|
|
1928
|
+
let i = r(e, "PPPP");
|
|
1929
|
+
return t?.today && (i = `Today, ${i}`), i;
|
|
1930
|
+
},
|
|
1931
|
+
labelNav: "Navigation bar",
|
|
1932
|
+
labelWeekNumberHeader: "Week Number",
|
|
1933
|
+
labelWeekday: (e, t, o) => {
|
|
1934
|
+
let n;
|
|
1935
|
+
return o && typeof o.format == "function" ? n = o.format.bind(o) : n = (r, i) => et(r, i, { locale: Ve, ...t }), n(e, "cccc");
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
};
|
|
1939
|
+
class ce {
|
|
1940
|
+
/**
|
|
1941
|
+
* Creates an instance of `DateLib`.
|
|
1942
|
+
*
|
|
1943
|
+
* @param options Configuration options for the date library.
|
|
1944
|
+
* @param overrides Custom overrides for the date library functions.
|
|
1945
|
+
*/
|
|
1946
|
+
constructor(t, o) {
|
|
1947
|
+
this.Date = Date, this.today = () => this.overrides?.today ? this.overrides.today() : this.options.timeZone ? J.tz(this.options.timeZone) : new this.Date(), this.newDate = (n, r, i) => this.overrides?.newDate ? this.overrides.newDate(n, r, i) : this.options.timeZone ? new J(n, r, i, this.options.timeZone) : new Date(n, r, i), this.addDays = (n, r) => this.overrides?.addDays ? this.overrides.addDays(n, r) : en(n, r), this.addMonths = (n, r) => this.overrides?.addMonths ? this.overrides.addMonths(n, r) : tn(n, r), this.addWeeks = (n, r) => this.overrides?.addWeeks ? this.overrides.addWeeks(n, r) : Gn(n, r), this.addYears = (n, r) => this.overrides?.addYears ? this.overrides.addYears(n, r) : Vn(n, r), this.differenceInCalendarDays = (n, r) => this.overrides?.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(n, r) : xt(n, r), this.differenceInCalendarMonths = (n, r) => this.overrides?.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(n, r) : rn(n, r), this.eachMonthOfInterval = (n) => this.overrides?.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(n) : Zn(n), this.eachYearOfInterval = (n) => {
|
|
1948
|
+
const r = this.overrides?.eachYearOfInterval ? this.overrides.eachYearOfInterval(n) : to(n), i = new Set(r.map((a) => this.getYear(a)));
|
|
1949
|
+
if (i.size === r.length)
|
|
1950
|
+
return r;
|
|
1951
|
+
const s = [];
|
|
1952
|
+
return i.forEach((a) => {
|
|
1953
|
+
s.push(new Date(a, 0, 1));
|
|
1954
|
+
}), s;
|
|
1955
|
+
}, this.endOfBroadcastWeek = (n) => this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(n) : lr(n, this), this.endOfISOWeek = (n) => this.overrides?.endOfISOWeek ? this.overrides.endOfISOWeek(n) : no(n), this.endOfMonth = (n) => this.overrides?.endOfMonth ? this.overrides.endOfMonth(n) : Kn(n), this.endOfWeek = (n, r) => this.overrides?.endOfWeek ? this.overrides.endOfWeek(n, r) : cn(n, this.options), this.endOfYear = (n) => this.overrides?.endOfYear ? this.overrides.endOfYear(n) : eo(n), this.format = (n, r, i) => {
|
|
1956
|
+
const s = this.overrides?.format ? this.overrides.format(n, r, this.options) : et(n, r, this.options);
|
|
1957
|
+
return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(s) : s;
|
|
1958
|
+
}, this.getISOWeek = (n) => this.overrides?.getISOWeek ? this.overrides.getISOWeek(n) : Pt(n), this.getMonth = (n, r) => this.overrides?.getMonth ? this.overrides.getMonth(n, this.options) : Jo(n, this.options), this.getYear = (n, r) => this.overrides?.getYear ? this.overrides.getYear(n, this.options) : er(n, this.options), this.getWeek = (n, r) => this.overrides?.getWeek ? this.overrides.getWeek(n, this.options) : Tt(n, this.options), this.isAfter = (n, r) => this.overrides?.isAfter ? this.overrides.isAfter(n, r) : tr(n, r), this.isBefore = (n, r) => this.overrides?.isBefore ? this.overrides.isBefore(n, r) : nr(n, r), this.isDate = (n) => this.overrides?.isDate ? this.overrides.isDate(n) : on(n), this.isSameDay = (n, r) => this.overrides?.isSameDay ? this.overrides.isSameDay(n, r) : Qn(n, r), this.isSameMonth = (n, r) => this.overrides?.isSameMonth ? this.overrides.isSameMonth(n, r) : or(n, r), this.isSameYear = (n, r) => this.overrides?.isSameYear ? this.overrides.isSameYear(n, r) : rr(n, r), this.max = (n) => this.overrides?.max ? this.overrides.max(n) : Xn(n), this.min = (n) => this.overrides?.min ? this.overrides.min(n) : Ln(n), this.setMonth = (n, r) => this.overrides?.setMonth ? this.overrides.setMonth(n, r) : ar(n, r), this.setYear = (n, r) => this.overrides?.setYear ? this.overrides.setYear(n, r) : sr(n, r), this.startOfBroadcastWeek = (n, r) => this.overrides?.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(n, this) : fn(n, this), this.startOfDay = (n) => this.overrides?.startOfDay ? this.overrides.startOfDay(n) : ot(n), this.startOfISOWeek = (n) => this.overrides?.startOfISOWeek ? this.overrides.startOfISOWeek(n) : nt(n), this.startOfMonth = (n) => this.overrides?.startOfMonth ? this.overrides.startOfMonth(n) : Jn(n), this.startOfWeek = (n, r) => this.overrides?.startOfWeek ? this.overrides.startOfWeek(n, this.options) : Le(n, this.options), this.startOfYear = (n) => this.overrides?.startOfYear ? this.overrides.startOfYear(n) : sn(n), this.options = { locale: hn, ...t }, this.overrides = o;
|
|
1959
|
+
}
|
|
1960
|
+
/**
|
|
1961
|
+
* Generates a mapping of Arabic digits (0-9) to the target numbering system
|
|
1962
|
+
* digits.
|
|
1963
|
+
*
|
|
1964
|
+
* @since 9.5.0
|
|
1965
|
+
* @returns A record mapping Arabic digits to the target numerals.
|
|
1966
|
+
*/
|
|
1967
|
+
getDigitMap() {
|
|
1968
|
+
const { numerals: t = "latn" } = this.options, o = new Intl.NumberFormat("en-US", {
|
|
1969
|
+
numberingSystem: t
|
|
1970
|
+
}), n = {};
|
|
1971
|
+
for (let r = 0; r < 10; r++)
|
|
1972
|
+
n[r.toString()] = o.format(r);
|
|
1973
|
+
return n;
|
|
1974
|
+
}
|
|
1975
|
+
/**
|
|
1976
|
+
* Replaces Arabic digits in a string with the target numbering system digits.
|
|
1977
|
+
*
|
|
1978
|
+
* @since 9.5.0
|
|
1979
|
+
* @param input The string containing Arabic digits.
|
|
1980
|
+
* @returns The string with digits replaced.
|
|
1981
|
+
*/
|
|
1982
|
+
replaceDigits(t) {
|
|
1983
|
+
const o = this.getDigitMap();
|
|
1984
|
+
return t.replace(/\d/g, (n) => o[n] || n);
|
|
1985
|
+
}
|
|
1986
|
+
/**
|
|
1987
|
+
* Formats a number using the configured numbering system.
|
|
1988
|
+
*
|
|
1989
|
+
* @since 9.5.0
|
|
1990
|
+
* @param value The number to format.
|
|
1991
|
+
* @returns The formatted number as a string.
|
|
1992
|
+
*/
|
|
1993
|
+
formatNumber(t) {
|
|
1994
|
+
return this.replaceDigits(t.toString());
|
|
1995
|
+
}
|
|
1996
|
+
/**
|
|
1997
|
+
* Returns the preferred ordering for month and year labels for the current
|
|
1998
|
+
* locale.
|
|
1999
|
+
*/
|
|
2000
|
+
getMonthYearOrder() {
|
|
2001
|
+
const t = this.options.locale?.code;
|
|
2002
|
+
return t && ce.yearFirstLocales.has(t) ? "year-first" : "month-first";
|
|
2003
|
+
}
|
|
2004
|
+
/**
|
|
2005
|
+
* Formats the month/year pair respecting locale conventions.
|
|
2006
|
+
*
|
|
2007
|
+
* @since 9.11.0
|
|
2008
|
+
*/
|
|
2009
|
+
formatMonthYear(t) {
|
|
2010
|
+
const { locale: o, timeZone: n, numerals: r } = this.options, i = o?.code;
|
|
2011
|
+
if (i && ce.yearFirstLocales.has(i))
|
|
2012
|
+
try {
|
|
2013
|
+
return new Intl.DateTimeFormat(i, {
|
|
2014
|
+
month: "long",
|
|
2015
|
+
year: "numeric",
|
|
2016
|
+
timeZone: n,
|
|
2017
|
+
numberingSystem: r
|
|
2018
|
+
}).format(t);
|
|
2019
|
+
} catch {
|
|
2020
|
+
}
|
|
2021
|
+
const s = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
|
|
2022
|
+
return this.format(t, s);
|
|
2023
|
+
}
|
|
2024
|
+
}
|
|
2025
|
+
ce.yearFirstLocales = /* @__PURE__ */ new Set([
|
|
2026
|
+
"eu",
|
|
2027
|
+
"hu",
|
|
2028
|
+
"ja",
|
|
2029
|
+
"ja-Hira",
|
|
2030
|
+
"ja-JP",
|
|
2031
|
+
"ko",
|
|
2032
|
+
"ko-KR",
|
|
2033
|
+
"lt",
|
|
2034
|
+
"lt-LT",
|
|
2035
|
+
"lv",
|
|
2036
|
+
"lv-LV",
|
|
2037
|
+
"mn",
|
|
2038
|
+
"mn-MN",
|
|
2039
|
+
"zh",
|
|
2040
|
+
"zh-CN",
|
|
2041
|
+
"zh-HK",
|
|
2042
|
+
"zh-TW"
|
|
2043
|
+
]);
|
|
2044
|
+
const ve = new ce();
|
|
2045
|
+
class mn {
|
|
2046
|
+
constructor(t, o, n = ve) {
|
|
2047
|
+
this.date = t, this.displayMonth = o, this.outside = !!(o && !n.isSameMonth(t, o)), this.dateLib = n, this.isoDate = n.format(t, "yyyy-MM-dd"), this.displayMonthId = n.format(o, "yyyy-MM"), this.dateMonthId = n.format(t, "yyyy-MM");
|
|
2048
|
+
}
|
|
2049
|
+
/**
|
|
2050
|
+
* Checks if this day is equal to another `CalendarDay`, considering both the
|
|
2051
|
+
* date and the displayed month.
|
|
2052
|
+
*
|
|
2053
|
+
* @param day The `CalendarDay` to compare with.
|
|
2054
|
+
* @returns `true` if the days are equal, otherwise `false`.
|
|
2055
|
+
*/
|
|
2056
|
+
isEqualTo(t) {
|
|
2057
|
+
return this.dateLib.isSameDay(t.date, this.date) && this.dateLib.isSameMonth(t.displayMonth, this.displayMonth);
|
|
2058
|
+
}
|
|
2059
|
+
}
|
|
2060
|
+
class Ar {
|
|
2061
|
+
constructor(t, o) {
|
|
2062
|
+
this.date = t, this.weeks = o;
|
|
2063
|
+
}
|
|
2064
|
+
}
|
|
2065
|
+
class Hr {
|
|
2066
|
+
constructor(t, o) {
|
|
2067
|
+
this.days = o, this.weekNumber = t;
|
|
2068
|
+
}
|
|
2069
|
+
}
|
|
2070
|
+
function qr(e) {
|
|
2071
|
+
return h.createElement("button", { ...e });
|
|
2072
|
+
}
|
|
2073
|
+
function Rr(e) {
|
|
2074
|
+
return h.createElement("span", { ...e });
|
|
2075
|
+
}
|
|
2076
|
+
function zr(e) {
|
|
2077
|
+
const { size: t = 24, orientation: o = "left", className: n } = e;
|
|
2078
|
+
return (
|
|
2079
|
+
// biome-ignore lint/a11y/noSvgWithoutTitle: handled by the parent component
|
|
2080
|
+
h.createElement(
|
|
2081
|
+
"svg",
|
|
2082
|
+
{ className: n, width: t, height: t, viewBox: "0 0 24 24" },
|
|
2083
|
+
o === "up" && h.createElement("polygon", { points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28" }),
|
|
2084
|
+
o === "down" && h.createElement("polygon", { points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72" }),
|
|
2085
|
+
o === "left" && h.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" }),
|
|
2086
|
+
o === "right" && h.createElement("polygon", { points: "8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20" })
|
|
2087
|
+
)
|
|
2088
|
+
);
|
|
2089
|
+
}
|
|
2090
|
+
function Gr(e) {
|
|
2091
|
+
const { day: t, modifiers: o, ...n } = e;
|
|
2092
|
+
return h.createElement("td", { ...n });
|
|
2093
|
+
}
|
|
2094
|
+
function Vr(e) {
|
|
2095
|
+
const { day: t, modifiers: o, ...n } = e, r = h.useRef(null);
|
|
2096
|
+
return h.useEffect(() => {
|
|
2097
|
+
o.focused && r.current?.focus();
|
|
2098
|
+
}, [o.focused]), h.createElement("button", { ref: r, ...n });
|
|
2099
|
+
}
|
|
2100
|
+
var b;
|
|
2101
|
+
(function(e) {
|
|
2102
|
+
e.Root = "root", e.Chevron = "chevron", e.Day = "day", e.DayButton = "day_button", e.CaptionLabel = "caption_label", e.Dropdowns = "dropdowns", e.Dropdown = "dropdown", e.DropdownRoot = "dropdown_root", e.Footer = "footer", e.MonthGrid = "month_grid", e.MonthCaption = "month_caption", e.MonthsDropdown = "months_dropdown", e.Month = "month", e.Months = "months", e.Nav = "nav", e.NextMonthButton = "button_next", e.PreviousMonthButton = "button_previous", e.Week = "week", e.Weeks = "weeks", e.Weekday = "weekday", e.Weekdays = "weekdays", e.WeekNumber = "week_number", e.WeekNumberHeader = "week_number_header", e.YearsDropdown = "years_dropdown";
|
|
2103
|
+
})(b || (b = {}));
|
|
2104
|
+
var R;
|
|
2105
|
+
(function(e) {
|
|
2106
|
+
e.disabled = "disabled", e.hidden = "hidden", e.outside = "outside", e.focused = "focused", e.today = "today";
|
|
2107
|
+
})(R || (R = {}));
|
|
2108
|
+
var he;
|
|
2109
|
+
(function(e) {
|
|
2110
|
+
e.range_end = "range_end", e.range_middle = "range_middle", e.range_start = "range_start", e.selected = "selected";
|
|
2111
|
+
})(he || (he = {}));
|
|
2112
|
+
var se;
|
|
2113
|
+
(function(e) {
|
|
2114
|
+
e.weeks_before_enter = "weeks_before_enter", e.weeks_before_exit = "weeks_before_exit", e.weeks_after_enter = "weeks_after_enter", e.weeks_after_exit = "weeks_after_exit", e.caption_after_enter = "caption_after_enter", e.caption_after_exit = "caption_after_exit", e.caption_before_enter = "caption_before_enter", e.caption_before_exit = "caption_before_exit";
|
|
2115
|
+
})(se || (se = {}));
|
|
2116
|
+
function Xr(e) {
|
|
2117
|
+
const { options: t, className: o, components: n, classNames: r, ...i } = e, s = [r[b.Dropdown], o].join(" "), a = t?.find(({ value: c }) => c === i.value);
|
|
2118
|
+
return h.createElement(
|
|
2119
|
+
"span",
|
|
2120
|
+
{ "data-disabled": i.disabled, className: r[b.DropdownRoot] },
|
|
2121
|
+
h.createElement(n.Select, { className: s, ...i }, t?.map(({ value: c, label: l, disabled: d }) => h.createElement(n.Option, { key: c, value: c, disabled: d }, l))),
|
|
2122
|
+
h.createElement(
|
|
2123
|
+
"span",
|
|
2124
|
+
{ className: r[b.CaptionLabel], "aria-hidden": !0 },
|
|
2125
|
+
a?.label,
|
|
2126
|
+
h.createElement(n.Chevron, { orientation: "down", size: 18, className: r[b.Chevron] })
|
|
2127
|
+
)
|
|
2128
|
+
);
|
|
2129
|
+
}
|
|
2130
|
+
function Lr(e) {
|
|
2131
|
+
return h.createElement("div", { ...e });
|
|
2132
|
+
}
|
|
2133
|
+
function Qr(e) {
|
|
2134
|
+
return h.createElement("div", { ...e });
|
|
2135
|
+
}
|
|
2136
|
+
function Ur(e) {
|
|
2137
|
+
const { calendarMonth: t, displayIndex: o, ...n } = e;
|
|
2138
|
+
return h.createElement("div", { ...n }, e.children);
|
|
2139
|
+
}
|
|
2140
|
+
function Kr(e) {
|
|
2141
|
+
const { calendarMonth: t, displayIndex: o, ...n } = e;
|
|
2142
|
+
return h.createElement("div", { ...n });
|
|
2143
|
+
}
|
|
2144
|
+
function Zr(e) {
|
|
2145
|
+
return h.createElement("table", { ...e });
|
|
2146
|
+
}
|
|
2147
|
+
function Jr(e) {
|
|
2148
|
+
return h.createElement("div", { ...e });
|
|
2149
|
+
}
|
|
2150
|
+
const yn = Tn(void 0);
|
|
2151
|
+
function at() {
|
|
2152
|
+
const e = Yn(yn);
|
|
2153
|
+
if (e === void 0)
|
|
2154
|
+
throw new Error("useDayPicker() must be used within a custom component.");
|
|
2155
|
+
return e;
|
|
2156
|
+
}
|
|
2157
|
+
function ea(e) {
|
|
2158
|
+
const { components: t } = at();
|
|
2159
|
+
return h.createElement(t.Dropdown, { ...e });
|
|
2160
|
+
}
|
|
2161
|
+
function ta(e) {
|
|
2162
|
+
const { onPreviousClick: t, onNextClick: o, previousMonth: n, nextMonth: r, ...i } = e, { components: s, classNames: a, labels: { labelPrevious: c, labelNext: l } } = at(), d = q((f) => {
|
|
2163
|
+
r && o?.(f);
|
|
2164
|
+
}, [r, o]), u = q((f) => {
|
|
2165
|
+
n && t?.(f);
|
|
2166
|
+
}, [n, t]);
|
|
2167
|
+
return h.createElement(
|
|
2168
|
+
"nav",
|
|
2169
|
+
{ ...i },
|
|
2170
|
+
h.createElement(
|
|
2171
|
+
s.PreviousMonthButton,
|
|
2172
|
+
{ type: "button", className: a[b.PreviousMonthButton], tabIndex: n ? void 0 : -1, "aria-disabled": n ? void 0 : !0, "aria-label": c(n), onClick: u },
|
|
2173
|
+
h.createElement(s.Chevron, { disabled: n ? void 0 : !0, className: a[b.Chevron], orientation: "left" })
|
|
2174
|
+
),
|
|
2175
|
+
h.createElement(
|
|
2176
|
+
s.NextMonthButton,
|
|
2177
|
+
{ type: "button", className: a[b.NextMonthButton], tabIndex: r ? void 0 : -1, "aria-disabled": r ? void 0 : !0, "aria-label": l(r), onClick: d },
|
|
2178
|
+
h.createElement(s.Chevron, { disabled: r ? void 0 : !0, orientation: "right", className: a[b.Chevron] })
|
|
2179
|
+
)
|
|
2180
|
+
);
|
|
2181
|
+
}
|
|
2182
|
+
function na(e) {
|
|
2183
|
+
const { components: t } = at();
|
|
2184
|
+
return h.createElement(t.Button, { ...e });
|
|
2185
|
+
}
|
|
2186
|
+
function oa(e) {
|
|
2187
|
+
return h.createElement("option", { ...e });
|
|
2188
|
+
}
|
|
2189
|
+
function ra(e) {
|
|
2190
|
+
const { components: t } = at();
|
|
2191
|
+
return h.createElement(t.Button, { ...e });
|
|
2192
|
+
}
|
|
2193
|
+
function aa(e) {
|
|
2194
|
+
const { rootRef: t, ...o } = e;
|
|
2195
|
+
return h.createElement("div", { ...o, ref: t });
|
|
2196
|
+
}
|
|
2197
|
+
function sa(e) {
|
|
2198
|
+
return h.createElement("select", { ...e });
|
|
2199
|
+
}
|
|
2200
|
+
function ia(e) {
|
|
2201
|
+
const { week: t, ...o } = e;
|
|
2202
|
+
return h.createElement("tr", { ...o });
|
|
2203
|
+
}
|
|
2204
|
+
function ca(e) {
|
|
2205
|
+
return h.createElement("th", { ...e });
|
|
2206
|
+
}
|
|
2207
|
+
function la(e) {
|
|
2208
|
+
return h.createElement(
|
|
2209
|
+
"thead",
|
|
2210
|
+
{ "aria-hidden": !0 },
|
|
2211
|
+
h.createElement("tr", { ...e })
|
|
2212
|
+
);
|
|
2213
|
+
}
|
|
2214
|
+
function ua(e) {
|
|
2215
|
+
const { week: t, ...o } = e;
|
|
2216
|
+
return h.createElement("th", { ...o });
|
|
2217
|
+
}
|
|
2218
|
+
function da(e) {
|
|
2219
|
+
return h.createElement("th", { ...e });
|
|
2220
|
+
}
|
|
2221
|
+
function fa(e) {
|
|
2222
|
+
return h.createElement("tbody", { ...e });
|
|
2223
|
+
}
|
|
2224
|
+
function ha(e) {
|
|
2225
|
+
const { components: t } = at();
|
|
2226
|
+
return h.createElement(t.Dropdown, { ...e });
|
|
2227
|
+
}
|
|
2228
|
+
const ma = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2229
|
+
__proto__: null,
|
|
2230
|
+
Button: qr,
|
|
2231
|
+
CaptionLabel: Rr,
|
|
2232
|
+
Chevron: zr,
|
|
2233
|
+
Day: Gr,
|
|
2234
|
+
DayButton: Vr,
|
|
2235
|
+
Dropdown: Xr,
|
|
2236
|
+
DropdownNav: Lr,
|
|
2237
|
+
Footer: Qr,
|
|
2238
|
+
Month: Ur,
|
|
2239
|
+
MonthCaption: Kr,
|
|
2240
|
+
MonthGrid: Zr,
|
|
2241
|
+
Months: Jr,
|
|
2242
|
+
MonthsDropdown: ea,
|
|
2243
|
+
Nav: ta,
|
|
2244
|
+
NextMonthButton: na,
|
|
2245
|
+
Option: oa,
|
|
2246
|
+
PreviousMonthButton: ra,
|
|
2247
|
+
Root: aa,
|
|
2248
|
+
Select: sa,
|
|
2249
|
+
Week: ia,
|
|
2250
|
+
WeekNumber: ua,
|
|
2251
|
+
WeekNumberHeader: da,
|
|
2252
|
+
Weekday: ca,
|
|
2253
|
+
Weekdays: la,
|
|
2254
|
+
Weeks: fa,
|
|
2255
|
+
YearsDropdown: ha
|
|
2256
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
2257
|
+
function Ne(e, t, o = !1, n = ve) {
|
|
2258
|
+
let { from: r, to: i } = e;
|
|
2259
|
+
const { differenceInCalendarDays: s, isSameDay: a } = n;
|
|
2260
|
+
return r && i ? (s(i, r) < 0 && ([r, i] = [i, r]), s(t, r) >= (o ? 1 : 0) && s(i, t) >= (o ? 1 : 0)) : !o && i ? a(i, t) : !o && r ? a(r, t) : !1;
|
|
2261
|
+
}
|
|
2262
|
+
function Yt(e) {
|
|
2263
|
+
return !!(e && typeof e == "object" && "before" in e && "after" in e);
|
|
2264
|
+
}
|
|
2265
|
+
function dt(e) {
|
|
2266
|
+
return !!(e && typeof e == "object" && "from" in e);
|
|
2267
|
+
}
|
|
2268
|
+
function Et(e) {
|
|
2269
|
+
return !!(e && typeof e == "object" && "after" in e);
|
|
2270
|
+
}
|
|
2271
|
+
function Ft(e) {
|
|
2272
|
+
return !!(e && typeof e == "object" && "before" in e);
|
|
2273
|
+
}
|
|
2274
|
+
function gn(e) {
|
|
2275
|
+
return !!(e && typeof e == "object" && "dayOfWeek" in e);
|
|
2276
|
+
}
|
|
2277
|
+
function pn(e, t) {
|
|
2278
|
+
return Array.isArray(e) && e.every(t.isDate);
|
|
2279
|
+
}
|
|
2280
|
+
function Ce(e, t, o = ve) {
|
|
2281
|
+
const n = Array.isArray(t) ? t : [t], { isSameDay: r, differenceInCalendarDays: i, isAfter: s } = o;
|
|
2282
|
+
return n.some((a) => {
|
|
2283
|
+
if (typeof a == "boolean")
|
|
2284
|
+
return a;
|
|
2285
|
+
if (o.isDate(a))
|
|
2286
|
+
return r(e, a);
|
|
2287
|
+
if (pn(a, o))
|
|
2288
|
+
return a.some((c) => r(e, c));
|
|
2289
|
+
if (dt(a))
|
|
2290
|
+
return Ne(a, e, !1, o);
|
|
2291
|
+
if (gn(a))
|
|
2292
|
+
return Array.isArray(a.dayOfWeek) ? a.dayOfWeek.includes(e.getDay()) : a.dayOfWeek === e.getDay();
|
|
2293
|
+
if (Yt(a)) {
|
|
2294
|
+
const c = i(a.before, e), l = i(a.after, e), d = c > 0, u = l < 0;
|
|
2295
|
+
return s(a.before, a.after) ? u && d : d || u;
|
|
2296
|
+
}
|
|
2297
|
+
return Et(a) ? i(e, a.after) > 0 : Ft(a) ? i(a.before, e) > 0 : typeof a == "function" ? a(e) : !1;
|
|
2298
|
+
});
|
|
2299
|
+
}
|
|
2300
|
+
function ya(e, t, o, n, r) {
|
|
2301
|
+
const { disabled: i, hidden: s, modifiers: a, showOutsideDays: c, broadcastCalendar: l, today: d = r.today() } = t, { isSameDay: u, isSameMonth: f, startOfMonth: M, isBefore: w, endOfMonth: C, isAfter: W } = r, v = o && M(o), g = n && C(n), p = {
|
|
2302
|
+
[R.focused]: [],
|
|
2303
|
+
[R.outside]: [],
|
|
2304
|
+
[R.disabled]: [],
|
|
2305
|
+
[R.hidden]: [],
|
|
2306
|
+
[R.today]: []
|
|
2307
|
+
}, S = {};
|
|
2308
|
+
for (const D of e) {
|
|
2309
|
+
const { date: y, displayMonth: O } = D, x = !!(O && !f(y, O)), j = !!(v && w(y, v)), F = !!(g && W(y, g)), K = !!(i && Ce(y, i, r)), V = !!(s && Ce(y, s, r)) || j || F || // Broadcast calendar will show outside days as default
|
|
2310
|
+
!l && !c && x || l && c === !1 && x, z = u(y, d);
|
|
2311
|
+
x && p.outside.push(D), K && p.disabled.push(D), V && p.hidden.push(D), z && p.today.push(D), a && Object.keys(a).forEach((_) => {
|
|
2312
|
+
const me = a?.[_];
|
|
2313
|
+
me && Ce(y, me, r) && (S[_] ? S[_].push(D) : S[_] = [D]);
|
|
2314
|
+
});
|
|
2315
|
+
}
|
|
2316
|
+
return (D) => {
|
|
2317
|
+
const y = {
|
|
2318
|
+
[R.focused]: !1,
|
|
2319
|
+
[R.disabled]: !1,
|
|
2320
|
+
[R.hidden]: !1,
|
|
2321
|
+
[R.outside]: !1,
|
|
2322
|
+
[R.today]: !1
|
|
2323
|
+
}, O = {};
|
|
2324
|
+
for (const x in p) {
|
|
2325
|
+
const j = p[x];
|
|
2326
|
+
y[x] = j.some((F) => F === D);
|
|
2327
|
+
}
|
|
2328
|
+
for (const x in S)
|
|
2329
|
+
O[x] = S[x].some((j) => j === D);
|
|
2330
|
+
return {
|
|
2331
|
+
...y,
|
|
2332
|
+
// custom modifiers should override all the previous ones
|
|
2333
|
+
...O
|
|
2334
|
+
};
|
|
2335
|
+
};
|
|
2336
|
+
}
|
|
2337
|
+
function ga(e, t, o = {}) {
|
|
2338
|
+
return Object.entries(e).filter(([, r]) => r === !0).reduce((r, [i]) => (o[i] ? r.push(o[i]) : t[R[i]] ? r.push(t[R[i]]) : t[he[i]] && r.push(t[he[i]]), r), [t[b.Day]]);
|
|
2339
|
+
}
|
|
2340
|
+
function pa(e) {
|
|
2341
|
+
return {
|
|
2342
|
+
...ma,
|
|
2343
|
+
...e
|
|
2344
|
+
};
|
|
2345
|
+
}
|
|
2346
|
+
function ba(e) {
|
|
2347
|
+
const t = {
|
|
2348
|
+
"data-mode": e.mode ?? void 0,
|
|
2349
|
+
"data-required": "required" in e ? e.required : void 0,
|
|
2350
|
+
"data-multiple-months": e.numberOfMonths && e.numberOfMonths > 1 || void 0,
|
|
2351
|
+
"data-week-numbers": e.showWeekNumber || void 0,
|
|
2352
|
+
"data-broadcast-calendar": e.broadcastCalendar || void 0,
|
|
2353
|
+
"data-nav-layout": e.navLayout || void 0
|
|
2354
|
+
};
|
|
2355
|
+
return Object.entries(e).forEach(([o, n]) => {
|
|
2356
|
+
o.startsWith("data-") && (t[o] = n);
|
|
2357
|
+
}), t;
|
|
2358
|
+
}
|
|
2359
|
+
function wa() {
|
|
2360
|
+
const e = {};
|
|
2361
|
+
for (const t in b)
|
|
2362
|
+
e[b[t]] = `rdp-${b[t]}`;
|
|
2363
|
+
for (const t in R)
|
|
2364
|
+
e[R[t]] = `rdp-${R[t]}`;
|
|
2365
|
+
for (const t in he)
|
|
2366
|
+
e[he[t]] = `rdp-${he[t]}`;
|
|
2367
|
+
for (const t in se)
|
|
2368
|
+
e[se[t]] = `rdp-${se[t]}`;
|
|
2369
|
+
return e;
|
|
2370
|
+
}
|
|
2371
|
+
function bn(e, t, o) {
|
|
2372
|
+
return (o ?? new ce(t)).formatMonthYear(e);
|
|
2373
|
+
}
|
|
2374
|
+
const Ma = bn;
|
|
2375
|
+
function Da(e, t, o) {
|
|
2376
|
+
return (o ?? new ce(t)).format(e, "d");
|
|
2377
|
+
}
|
|
2378
|
+
function va(e, t = ve) {
|
|
2379
|
+
return t.format(e, "LLLL");
|
|
2380
|
+
}
|
|
2381
|
+
function ka(e, t, o) {
|
|
2382
|
+
return (o ?? new ce(t)).format(e, "cccccc");
|
|
2383
|
+
}
|
|
2384
|
+
function Oa(e, t = ve) {
|
|
2385
|
+
return e < 10 ? t.formatNumber(`0${e.toLocaleString()}`) : t.formatNumber(`${e.toLocaleString()}`);
|
|
2386
|
+
}
|
|
2387
|
+
function Wa() {
|
|
2388
|
+
return "";
|
|
2389
|
+
}
|
|
2390
|
+
function wn(e, t = ve) {
|
|
2391
|
+
return t.format(e, "yyyy");
|
|
2392
|
+
}
|
|
2393
|
+
const Sa = wn, Na = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2394
|
+
__proto__: null,
|
|
2395
|
+
formatCaption: bn,
|
|
2396
|
+
formatDay: Da,
|
|
2397
|
+
formatMonthCaption: Ma,
|
|
2398
|
+
formatMonthDropdown: va,
|
|
2399
|
+
formatWeekNumber: Oa,
|
|
2400
|
+
formatWeekNumberHeader: Wa,
|
|
2401
|
+
formatWeekdayName: ka,
|
|
2402
|
+
formatYearCaption: Sa,
|
|
2403
|
+
formatYearDropdown: wn
|
|
2404
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
2405
|
+
function Ca(e) {
|
|
2406
|
+
return e?.formatMonthCaption && !e.formatCaption && (e.formatCaption = e.formatMonthCaption), e?.formatYearCaption && !e.formatYearDropdown && (e.formatYearDropdown = e.formatYearCaption), {
|
|
2407
|
+
...Na,
|
|
2408
|
+
...e
|
|
2409
|
+
};
|
|
2410
|
+
}
|
|
2411
|
+
function _t(e, t, o, n) {
|
|
2412
|
+
let r = (n ?? new ce(o)).format(e, "PPPP");
|
|
2413
|
+
return t.today && (r = `Today, ${r}`), t.selected && (r = `${r}, selected`), r;
|
|
2414
|
+
}
|
|
2415
|
+
const xa = _t;
|
|
2416
|
+
function It(e, t, o) {
|
|
2417
|
+
return (o ?? new ce(t)).formatMonthYear(e);
|
|
2418
|
+
}
|
|
2419
|
+
const Pa = It;
|
|
2420
|
+
function Mn(e, t, o, n) {
|
|
2421
|
+
let r = (n ?? new ce(o)).format(e, "PPPP");
|
|
2422
|
+
return t?.today && (r = `Today, ${r}`), r;
|
|
2423
|
+
}
|
|
2424
|
+
function Dn(e) {
|
|
2425
|
+
return "Choose the Month";
|
|
2426
|
+
}
|
|
2427
|
+
function vn() {
|
|
2428
|
+
return "";
|
|
2429
|
+
}
|
|
2430
|
+
const Ta = "Go to the Next Month";
|
|
2431
|
+
function kn(e, t) {
|
|
2432
|
+
return Ta;
|
|
2433
|
+
}
|
|
2434
|
+
function On(e) {
|
|
2435
|
+
return "Go to the Previous Month";
|
|
2436
|
+
}
|
|
2437
|
+
function Wn(e, t, o) {
|
|
2438
|
+
return (o ?? new ce(t)).format(e, "cccc");
|
|
2439
|
+
}
|
|
2440
|
+
function Sn(e, t) {
|
|
2441
|
+
return `Week ${e}`;
|
|
2442
|
+
}
|
|
2443
|
+
function Nn(e) {
|
|
2444
|
+
return "Week Number";
|
|
2445
|
+
}
|
|
2446
|
+
function Cn(e) {
|
|
2447
|
+
return "Choose the Year";
|
|
2448
|
+
}
|
|
2449
|
+
const Ya = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2450
|
+
__proto__: null,
|
|
2451
|
+
labelCaption: Pa,
|
|
2452
|
+
labelDay: xa,
|
|
2453
|
+
labelDayButton: _t,
|
|
2454
|
+
labelGrid: It,
|
|
2455
|
+
labelGridcell: Mn,
|
|
2456
|
+
labelMonthDropdown: Dn,
|
|
2457
|
+
labelNav: vn,
|
|
2458
|
+
labelNext: kn,
|
|
2459
|
+
labelPrevious: On,
|
|
2460
|
+
labelWeekNumber: Sn,
|
|
2461
|
+
labelWeekNumberHeader: Nn,
|
|
2462
|
+
labelWeekday: Wn,
|
|
2463
|
+
labelYearDropdown: Cn
|
|
2464
|
+
}, Symbol.toStringTag, { value: "Module" })), fe = (e, t, o) => t || (o ? typeof o == "function" ? o : (...n) => o : e);
|
|
2465
|
+
function Ea(e, t) {
|
|
2466
|
+
const o = t.locale?.labels ?? {};
|
|
2467
|
+
return {
|
|
2468
|
+
...Ya,
|
|
2469
|
+
...e ?? {},
|
|
2470
|
+
labelDayButton: fe(_t, e?.labelDayButton, o.labelDayButton),
|
|
2471
|
+
labelMonthDropdown: fe(Dn, e?.labelMonthDropdown, o.labelMonthDropdown),
|
|
2472
|
+
labelNext: fe(kn, e?.labelNext, o.labelNext),
|
|
2473
|
+
labelPrevious: fe(On, e?.labelPrevious, o.labelPrevious),
|
|
2474
|
+
labelWeekNumber: fe(Sn, e?.labelWeekNumber, o.labelWeekNumber),
|
|
2475
|
+
labelYearDropdown: fe(Cn, e?.labelYearDropdown, o.labelYearDropdown),
|
|
2476
|
+
labelGrid: fe(It, e?.labelGrid, o.labelGrid),
|
|
2477
|
+
labelGridcell: fe(Mn, e?.labelGridcell, o.labelGridcell),
|
|
2478
|
+
labelNav: fe(vn, e?.labelNav, o.labelNav),
|
|
2479
|
+
labelWeekNumberHeader: fe(Nn, e?.labelWeekNumberHeader, o.labelWeekNumberHeader),
|
|
2480
|
+
labelWeekday: fe(Wn, e?.labelWeekday, o.labelWeekday)
|
|
2481
|
+
};
|
|
2482
|
+
}
|
|
2483
|
+
function Fa(e, t, o, n, r) {
|
|
2484
|
+
const { startOfMonth: i, startOfYear: s, endOfYear: a, eachMonthOfInterval: c, getMonth: l } = r;
|
|
2485
|
+
return c({
|
|
2486
|
+
start: s(e),
|
|
2487
|
+
end: a(e)
|
|
2488
|
+
}).map((f) => {
|
|
2489
|
+
const M = n.formatMonthDropdown(f, r), w = l(f), C = t && f < i(t) || o && f > i(o) || !1;
|
|
2490
|
+
return { value: w, label: M, disabled: C };
|
|
2491
|
+
});
|
|
2492
|
+
}
|
|
2493
|
+
function _a(e, t = {}, o = {}) {
|
|
2494
|
+
let n = { ...t?.[b.Day] };
|
|
2495
|
+
return Object.entries(e).filter(([, r]) => r === !0).forEach(([r]) => {
|
|
2496
|
+
n = {
|
|
2497
|
+
...n,
|
|
2498
|
+
...o?.[r]
|
|
2499
|
+
};
|
|
2500
|
+
}), n;
|
|
2501
|
+
}
|
|
2502
|
+
function Ia(e, t, o, n) {
|
|
2503
|
+
const r = n ?? e.today(), i = o ? e.startOfBroadcastWeek(r, e) : t ? e.startOfISOWeek(r) : e.startOfWeek(r), s = [];
|
|
2504
|
+
for (let a = 0; a < 7; a++) {
|
|
2505
|
+
const c = e.addDays(i, a);
|
|
2506
|
+
s.push(c);
|
|
2507
|
+
}
|
|
2508
|
+
return s;
|
|
2509
|
+
}
|
|
2510
|
+
function Ba(e, t, o, n, r = !1) {
|
|
2511
|
+
if (!e || !t)
|
|
2512
|
+
return;
|
|
2513
|
+
const { startOfYear: i, endOfYear: s, eachYearOfInterval: a, getYear: c } = n, l = i(e), d = s(t), u = a({ start: l, end: d });
|
|
2514
|
+
return r && u.reverse(), u.map((f) => {
|
|
2515
|
+
const M = o.formatYearDropdown(f, n);
|
|
2516
|
+
return {
|
|
2517
|
+
value: c(f),
|
|
2518
|
+
label: M,
|
|
2519
|
+
disabled: !1
|
|
2520
|
+
};
|
|
2521
|
+
});
|
|
2522
|
+
}
|
|
2523
|
+
function ja(e, t = {}) {
|
|
2524
|
+
const { weekStartsOn: o, locale: n } = t, r = o ?? n?.options?.weekStartsOn ?? 0, i = (a) => {
|
|
2525
|
+
const c = typeof a == "number" || typeof a == "string" ? new Date(a) : a;
|
|
2526
|
+
return new J(c.getFullYear(), c.getMonth(), c.getDate(), 12, 0, 0, e);
|
|
2527
|
+
}, s = (a) => {
|
|
2528
|
+
const c = i(a);
|
|
2529
|
+
return new Date(c.getFullYear(), c.getMonth(), c.getDate(), 0, 0, 0, 0);
|
|
2530
|
+
};
|
|
2531
|
+
return {
|
|
2532
|
+
today: () => i(J.tz(e)),
|
|
2533
|
+
newDate: (a, c, l) => new J(a, c, l, 12, 0, 0, e),
|
|
2534
|
+
startOfDay: (a) => i(a),
|
|
2535
|
+
startOfWeek: (a, c) => {
|
|
2536
|
+
const l = i(a), d = c?.weekStartsOn ?? r, u = (l.getDay() - d + 7) % 7;
|
|
2537
|
+
return l.setDate(l.getDate() - u), l;
|
|
2538
|
+
},
|
|
2539
|
+
startOfISOWeek: (a) => {
|
|
2540
|
+
const c = i(a), l = (c.getDay() - 1 + 7) % 7;
|
|
2541
|
+
return c.setDate(c.getDate() - l), c;
|
|
2542
|
+
},
|
|
2543
|
+
startOfMonth: (a) => {
|
|
2544
|
+
const c = i(a);
|
|
2545
|
+
return c.setDate(1), c;
|
|
2546
|
+
},
|
|
2547
|
+
startOfYear: (a) => {
|
|
2548
|
+
const c = i(a);
|
|
2549
|
+
return c.setMonth(0, 1), c;
|
|
2550
|
+
},
|
|
2551
|
+
endOfWeek: (a, c) => {
|
|
2552
|
+
const l = i(a), f = (((c?.weekStartsOn ?? r) + 6) % 7 - l.getDay() + 7) % 7;
|
|
2553
|
+
return l.setDate(l.getDate() + f), l;
|
|
2554
|
+
},
|
|
2555
|
+
endOfISOWeek: (a) => {
|
|
2556
|
+
const c = i(a), l = (7 - c.getDay()) % 7;
|
|
2557
|
+
return c.setDate(c.getDate() + l), c;
|
|
2558
|
+
},
|
|
2559
|
+
endOfMonth: (a) => {
|
|
2560
|
+
const c = i(a);
|
|
2561
|
+
return c.setMonth(c.getMonth() + 1, 0), c;
|
|
2562
|
+
},
|
|
2563
|
+
endOfYear: (a) => {
|
|
2564
|
+
const c = i(a);
|
|
2565
|
+
return c.setMonth(11, 31), c;
|
|
2566
|
+
},
|
|
2567
|
+
eachMonthOfInterval: (a) => {
|
|
2568
|
+
const c = i(a.start), l = i(a.end), d = [], u = new J(c.getFullYear(), c.getMonth(), 1, 12, 0, 0, e), f = l.getFullYear() * 12 + l.getMonth();
|
|
2569
|
+
for (; u.getFullYear() * 12 + u.getMonth() <= f; )
|
|
2570
|
+
d.push(new J(u, e)), u.setMonth(u.getMonth() + 1, 1);
|
|
2571
|
+
return d;
|
|
2572
|
+
},
|
|
2573
|
+
// Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
|
|
2574
|
+
// mutate the same TZDate, and return it.
|
|
2575
|
+
addDays: (a, c) => {
|
|
2576
|
+
const l = i(a);
|
|
2577
|
+
return l.setDate(l.getDate() + c), l;
|
|
2578
|
+
},
|
|
2579
|
+
addWeeks: (a, c) => {
|
|
2580
|
+
const l = i(a);
|
|
2581
|
+
return l.setDate(l.getDate() + c * 7), l;
|
|
2582
|
+
},
|
|
2583
|
+
addMonths: (a, c) => {
|
|
2584
|
+
const l = i(a);
|
|
2585
|
+
return l.setMonth(l.getMonth() + c), l;
|
|
2586
|
+
},
|
|
2587
|
+
addYears: (a, c) => {
|
|
2588
|
+
const l = i(a);
|
|
2589
|
+
return l.setFullYear(l.getFullYear() + c), l;
|
|
2590
|
+
},
|
|
2591
|
+
eachYearOfInterval: (a) => {
|
|
2592
|
+
const c = i(a.start), l = i(a.end), d = [], u = new J(c.getFullYear(), 0, 1, 12, 0, 0, e);
|
|
2593
|
+
for (; u.getFullYear() <= l.getFullYear(); )
|
|
2594
|
+
d.push(new J(u, e)), u.setFullYear(u.getFullYear() + 1, 0, 1);
|
|
2595
|
+
return d;
|
|
2596
|
+
},
|
|
2597
|
+
getWeek: (a, c) => {
|
|
2598
|
+
const l = s(a);
|
|
2599
|
+
return Tt(l, {
|
|
2600
|
+
weekStartsOn: c?.weekStartsOn ?? r,
|
|
2601
|
+
firstWeekContainsDate: c?.firstWeekContainsDate ?? n?.options?.firstWeekContainsDate ?? 1
|
|
2602
|
+
});
|
|
2603
|
+
},
|
|
2604
|
+
getISOWeek: (a) => {
|
|
2605
|
+
const c = s(a);
|
|
2606
|
+
return Pt(c);
|
|
2607
|
+
},
|
|
2608
|
+
differenceInCalendarDays: (a, c) => {
|
|
2609
|
+
const l = s(a), d = s(c);
|
|
2610
|
+
return xt(l, d);
|
|
2611
|
+
},
|
|
2612
|
+
differenceInCalendarMonths: (a, c) => {
|
|
2613
|
+
const l = s(a), d = s(c);
|
|
2614
|
+
return rn(l, d);
|
|
2615
|
+
}
|
|
2616
|
+
};
|
|
2617
|
+
}
|
|
2618
|
+
const st = (e) => e instanceof HTMLElement ? e : null, vt = (e) => [
|
|
2619
|
+
...e.querySelectorAll("[data-animated-month]") ?? []
|
|
2620
|
+
], $a = (e) => st(e.querySelector("[data-animated-month]")), kt = (e) => st(e.querySelector("[data-animated-caption]")), Ot = (e) => st(e.querySelector("[data-animated-weeks]")), Aa = (e) => st(e.querySelector("[data-animated-nav]")), Ha = (e) => st(e.querySelector("[data-animated-weekdays]"));
|
|
2621
|
+
function qa(e, t, { classNames: o, months: n, focused: r, dateLib: i }) {
|
|
2622
|
+
const s = Ee(null), a = Ee(n), c = Ee(!1);
|
|
2623
|
+
En(() => {
|
|
2624
|
+
const l = a.current;
|
|
2625
|
+
if (a.current = n, !t || !e.current || // safety check because the ref can be set to anything by consumers
|
|
2626
|
+
!(e.current instanceof HTMLElement) || // validation required for the animation to work as expected
|
|
2627
|
+
n.length === 0 || l.length === 0 || n.length !== l.length)
|
|
2628
|
+
return;
|
|
2629
|
+
const d = i.isSameMonth(n[0].date, l[0].date), u = i.isAfter(n[0].date, l[0].date), f = u ? o[se.caption_after_enter] : o[se.caption_before_enter], M = u ? o[se.weeks_after_enter] : o[se.weeks_before_enter], w = s.current, C = e.current.cloneNode(!0);
|
|
2630
|
+
if (C instanceof HTMLElement ? (vt(C).forEach((p) => {
|
|
2631
|
+
if (!(p instanceof HTMLElement))
|
|
2632
|
+
return;
|
|
2633
|
+
const S = $a(p);
|
|
2634
|
+
S && p.contains(S) && p.removeChild(S);
|
|
2635
|
+
const D = kt(p);
|
|
2636
|
+
D && D.classList.remove(f);
|
|
2637
|
+
const y = Ot(p);
|
|
2638
|
+
y && y.classList.remove(M);
|
|
2639
|
+
}), s.current = C) : s.current = null, c.current || d || // skip animation if a day is focused because it can cause issues to the animation and is better for a11y
|
|
2640
|
+
r)
|
|
2641
|
+
return;
|
|
2642
|
+
const W = w instanceof HTMLElement ? vt(w) : [], v = vt(e.current);
|
|
2643
|
+
if (v?.every((g) => g instanceof HTMLElement) && W && W.every((g) => g instanceof HTMLElement)) {
|
|
2644
|
+
c.current = !0, e.current.style.isolation = "isolate";
|
|
2645
|
+
const g = Aa(e.current);
|
|
2646
|
+
g && (g.style.zIndex = "1"), v.forEach((p, S) => {
|
|
2647
|
+
const D = W[S];
|
|
2648
|
+
if (!D)
|
|
2649
|
+
return;
|
|
2650
|
+
p.style.position = "relative", p.style.overflow = "hidden";
|
|
2651
|
+
const y = kt(p);
|
|
2652
|
+
y && y.classList.add(f);
|
|
2653
|
+
const O = Ot(p);
|
|
2654
|
+
O && O.classList.add(M);
|
|
2655
|
+
const x = () => {
|
|
2656
|
+
c.current = !1, e.current && (e.current.style.isolation = ""), g && (g.style.zIndex = ""), y && y.classList.remove(f), O && O.classList.remove(M), p.style.position = "", p.style.overflow = "", p.contains(D) && p.removeChild(D);
|
|
2657
|
+
};
|
|
2658
|
+
D.style.pointerEvents = "none", D.style.position = "absolute", D.style.overflow = "hidden", D.setAttribute("aria-hidden", "true");
|
|
2659
|
+
const j = Ha(D);
|
|
2660
|
+
j && (j.style.opacity = "0");
|
|
2661
|
+
const F = kt(D);
|
|
2662
|
+
F && (F.classList.add(u ? o[se.caption_before_exit] : o[se.caption_after_exit]), F.addEventListener("animationend", x));
|
|
2663
|
+
const K = Ot(D);
|
|
2664
|
+
K && K.classList.add(u ? o[se.weeks_before_exit] : o[se.weeks_after_exit]), p.insertBefore(D, p.firstChild);
|
|
2665
|
+
});
|
|
2666
|
+
}
|
|
2667
|
+
});
|
|
2668
|
+
}
|
|
2669
|
+
function Ra(e, t, o, n) {
|
|
2670
|
+
const r = e[0], i = e[e.length - 1], { ISOWeek: s, fixedWeeks: a, broadcastCalendar: c } = o ?? {}, { addDays: l, differenceInCalendarDays: d, differenceInCalendarMonths: u, endOfBroadcastWeek: f, endOfISOWeek: M, endOfMonth: w, endOfWeek: C, isAfter: W, startOfBroadcastWeek: v, startOfISOWeek: g, startOfWeek: p } = n, S = c ? v(r, n) : s ? g(r) : p(r), D = c ? f(i) : s ? M(w(i)) : C(w(i)), y = t && (c ? f(t) : s ? M(t) : C(t)), O = y && W(D, y) ? y : D, x = d(O, S), j = u(i, r) + 1, F = [];
|
|
2671
|
+
for (let z = 0; z <= x; z++) {
|
|
2672
|
+
const _ = l(S, z);
|
|
2673
|
+
F.push(_);
|
|
2674
|
+
}
|
|
2675
|
+
const V = (c ? 35 : 42) * j;
|
|
2676
|
+
if (a && F.length < V) {
|
|
2677
|
+
const z = V - F.length;
|
|
2678
|
+
for (let _ = 0; _ < z; _++) {
|
|
2679
|
+
const me = l(F[F.length - 1], 1);
|
|
2680
|
+
F.push(me);
|
|
2681
|
+
}
|
|
2682
|
+
}
|
|
2683
|
+
return F;
|
|
2684
|
+
}
|
|
2685
|
+
function za(e) {
|
|
2686
|
+
const t = [];
|
|
2687
|
+
return e.reduce((o, n) => {
|
|
2688
|
+
const r = n.weeks.reduce((i, s) => i.concat(s.days.slice()), t.slice());
|
|
2689
|
+
return o.concat(r.slice());
|
|
2690
|
+
}, t.slice());
|
|
2691
|
+
}
|
|
2692
|
+
function Ga(e, t, o, n) {
|
|
2693
|
+
const { numberOfMonths: r = 1 } = o, i = [];
|
|
2694
|
+
for (let s = 0; s < r; s++) {
|
|
2695
|
+
const a = n.addMonths(e, s);
|
|
2696
|
+
if (t && a > t)
|
|
2697
|
+
break;
|
|
2698
|
+
i.push(a);
|
|
2699
|
+
}
|
|
2700
|
+
return i;
|
|
2701
|
+
}
|
|
2702
|
+
function Lt(e, t, o, n) {
|
|
2703
|
+
const { month: r, defaultMonth: i, today: s = n.today(), numberOfMonths: a = 1 } = e;
|
|
2704
|
+
let c = r || i || s;
|
|
2705
|
+
const { differenceInCalendarMonths: l, addMonths: d, startOfMonth: u } = n;
|
|
2706
|
+
if (o && l(o, c) < a - 1) {
|
|
2707
|
+
const f = -1 * (a - 1);
|
|
2708
|
+
c = d(o, f);
|
|
2709
|
+
}
|
|
2710
|
+
return t && l(c, t) < 0 && (c = t), u(c);
|
|
2711
|
+
}
|
|
2712
|
+
function Va(e, t, o, n) {
|
|
2713
|
+
const { addDays: r, endOfBroadcastWeek: i, endOfISOWeek: s, endOfMonth: a, endOfWeek: c, getISOWeek: l, getWeek: d, startOfBroadcastWeek: u, startOfISOWeek: f, startOfWeek: M } = n, w = e.reduce((C, W) => {
|
|
2714
|
+
const v = o.broadcastCalendar ? u(W, n) : o.ISOWeek ? f(W) : M(W), g = o.broadcastCalendar ? i(W) : o.ISOWeek ? s(a(W)) : c(a(W)), p = t.filter((O) => O >= v && O <= g), S = o.broadcastCalendar ? 35 : 42;
|
|
2715
|
+
if (o.fixedWeeks && p.length < S) {
|
|
2716
|
+
const O = t.filter((x) => {
|
|
2717
|
+
const j = S - p.length;
|
|
2718
|
+
return x > g && x <= r(g, j);
|
|
2719
|
+
});
|
|
2720
|
+
p.push(...O);
|
|
2721
|
+
}
|
|
2722
|
+
const D = p.reduce((O, x) => {
|
|
2723
|
+
const j = o.ISOWeek ? l(x) : d(x), F = O.find((V) => V.weekNumber === j), K = new mn(x, W, n);
|
|
2724
|
+
return F ? F.days.push(K) : O.push(new Hr(j, [K])), O;
|
|
2725
|
+
}, []), y = new Ar(W, D);
|
|
2726
|
+
return C.push(y), C;
|
|
2727
|
+
}, []);
|
|
2728
|
+
return o.reverseMonths ? w.reverse() : w;
|
|
2729
|
+
}
|
|
2730
|
+
function Xa(e, t) {
|
|
2731
|
+
let { startMonth: o, endMonth: n } = e;
|
|
2732
|
+
const { startOfYear: r, startOfDay: i, startOfMonth: s, endOfMonth: a, addYears: c, endOfYear: l, newDate: d, today: u } = t, { fromYear: f, toYear: M, fromMonth: w, toMonth: C } = e;
|
|
2733
|
+
!o && w && (o = w), !o && f && (o = t.newDate(f, 0, 1)), !n && C && (n = C), !n && M && (n = d(M, 11, 31));
|
|
2734
|
+
const W = e.captionLayout === "dropdown" || e.captionLayout === "dropdown-years";
|
|
2735
|
+
return o ? o = s(o) : f ? o = d(f, 0, 1) : !o && W && (o = r(c(e.today ?? u(), -100))), n ? n = a(n) : M ? n = d(M, 11, 31) : !n && W && (n = l(e.today ?? u())), [
|
|
2736
|
+
o && i(o),
|
|
2737
|
+
n && i(n)
|
|
2738
|
+
];
|
|
2739
|
+
}
|
|
2740
|
+
function La(e, t, o, n) {
|
|
2741
|
+
if (o.disableNavigation)
|
|
2742
|
+
return;
|
|
2743
|
+
const { pagedNavigation: r, numberOfMonths: i = 1 } = o, { startOfMonth: s, addMonths: a, differenceInCalendarMonths: c } = n, l = r ? i : 1, d = s(e);
|
|
2744
|
+
if (!t)
|
|
2745
|
+
return a(d, l);
|
|
2746
|
+
if (!(c(t, e) < i))
|
|
2747
|
+
return a(d, l);
|
|
2748
|
+
}
|
|
2749
|
+
function Qa(e, t, o, n) {
|
|
2750
|
+
if (o.disableNavigation)
|
|
2751
|
+
return;
|
|
2752
|
+
const { pagedNavigation: r, numberOfMonths: i } = o, { startOfMonth: s, addMonths: a, differenceInCalendarMonths: c } = n, l = r ? i ?? 1 : 1, d = s(e);
|
|
2753
|
+
if (!t)
|
|
2754
|
+
return a(d, -l);
|
|
2755
|
+
if (!(c(d, t) <= 0))
|
|
2756
|
+
return a(d, -l);
|
|
2757
|
+
}
|
|
2758
|
+
function Ua(e) {
|
|
2759
|
+
const t = [];
|
|
2760
|
+
return e.reduce((o, n) => o.concat(n.weeks.slice()), t.slice());
|
|
2761
|
+
}
|
|
2762
|
+
function ft(e, t) {
|
|
2763
|
+
const [o, n] = Se(e);
|
|
2764
|
+
return [t === void 0 ? o : t, n];
|
|
2765
|
+
}
|
|
2766
|
+
function Ka(e, t) {
|
|
2767
|
+
const [o, n] = Xa(e, t), { startOfMonth: r, endOfMonth: i } = t, s = Lt(e, o, n, t), [a, c] = ft(
|
|
2768
|
+
s,
|
|
2769
|
+
// initialMonth is always computed from props.month if provided
|
|
2770
|
+
e.month ? s : void 0
|
|
2771
|
+
);
|
|
2772
|
+
_e(() => {
|
|
2773
|
+
const S = Lt(e, o, n, t);
|
|
2774
|
+
c(S);
|
|
2775
|
+
}, [e.timeZone]);
|
|
2776
|
+
const { months: l, weeks: d, days: u, previousMonth: f, nextMonth: M } = ie(() => {
|
|
2777
|
+
const S = Ga(a, n, { numberOfMonths: e.numberOfMonths }, t), D = Ra(S, e.endMonth ? i(e.endMonth) : void 0, {
|
|
2778
|
+
ISOWeek: e.ISOWeek,
|
|
2779
|
+
fixedWeeks: e.fixedWeeks,
|
|
2780
|
+
broadcastCalendar: e.broadcastCalendar
|
|
2781
|
+
}, t), y = Va(S, D, {
|
|
2782
|
+
broadcastCalendar: e.broadcastCalendar,
|
|
2783
|
+
fixedWeeks: e.fixedWeeks,
|
|
2784
|
+
ISOWeek: e.ISOWeek,
|
|
2785
|
+
reverseMonths: e.reverseMonths
|
|
2786
|
+
}, t), O = Ua(y), x = za(y), j = Qa(a, o, e, t), F = La(a, n, e, t);
|
|
2787
|
+
return {
|
|
2788
|
+
months: y,
|
|
2789
|
+
weeks: O,
|
|
2790
|
+
days: x,
|
|
2791
|
+
previousMonth: j,
|
|
2792
|
+
nextMonth: F
|
|
2793
|
+
};
|
|
2794
|
+
}, [
|
|
2795
|
+
t,
|
|
2796
|
+
a.getTime(),
|
|
2797
|
+
n?.getTime(),
|
|
2798
|
+
o?.getTime(),
|
|
2799
|
+
e.disableNavigation,
|
|
2800
|
+
e.broadcastCalendar,
|
|
2801
|
+
e.endMonth?.getTime(),
|
|
2802
|
+
e.fixedWeeks,
|
|
2803
|
+
e.ISOWeek,
|
|
2804
|
+
e.numberOfMonths,
|
|
2805
|
+
e.pagedNavigation,
|
|
2806
|
+
e.reverseMonths
|
|
2807
|
+
]), { disableNavigation: w, onMonthChange: C } = e, W = (S) => d.some((D) => D.days.some((y) => y.isEqualTo(S))), v = (S) => {
|
|
2808
|
+
if (w)
|
|
2809
|
+
return;
|
|
2810
|
+
let D = r(S);
|
|
2811
|
+
o && D < r(o) && (D = r(o)), n && D > r(n) && (D = r(n)), c(D), C?.(D);
|
|
2812
|
+
};
|
|
2813
|
+
return {
|
|
2814
|
+
months: l,
|
|
2815
|
+
weeks: d,
|
|
2816
|
+
days: u,
|
|
2817
|
+
navStart: o,
|
|
2818
|
+
navEnd: n,
|
|
2819
|
+
previousMonth: f,
|
|
2820
|
+
nextMonth: M,
|
|
2821
|
+
goToMonth: v,
|
|
2822
|
+
goToDay: (S) => {
|
|
2823
|
+
W(S) || v(S.date);
|
|
2824
|
+
}
|
|
2825
|
+
};
|
|
2826
|
+
}
|
|
2827
|
+
var be;
|
|
2828
|
+
(function(e) {
|
|
2829
|
+
e[e.Today = 0] = "Today", e[e.Selected = 1] = "Selected", e[e.LastFocused = 2] = "LastFocused", e[e.FocusedModifier = 3] = "FocusedModifier";
|
|
2830
|
+
})(be || (be = {}));
|
|
2831
|
+
function Qt(e) {
|
|
2832
|
+
return !e[R.disabled] && !e[R.hidden] && !e[R.outside];
|
|
2833
|
+
}
|
|
2834
|
+
function Za(e, t, o, n) {
|
|
2835
|
+
let r, i = -1;
|
|
2836
|
+
for (const s of e) {
|
|
2837
|
+
const a = t(s);
|
|
2838
|
+
Qt(a) && (a[R.focused] && i < be.FocusedModifier ? (r = s, i = be.FocusedModifier) : n?.isEqualTo(s) && i < be.LastFocused ? (r = s, i = be.LastFocused) : o(s.date) && i < be.Selected ? (r = s, i = be.Selected) : a[R.today] && i < be.Today && (r = s, i = be.Today));
|
|
2839
|
+
}
|
|
2840
|
+
return r || (r = e.find((s) => Qt(t(s)))), r;
|
|
2841
|
+
}
|
|
2842
|
+
function Ja(e, t, o, n, r, i, s) {
|
|
2843
|
+
const { ISOWeek: a, broadcastCalendar: c } = i, { addDays: l, addMonths: d, addWeeks: u, addYears: f, endOfBroadcastWeek: M, endOfISOWeek: w, endOfWeek: C, max: W, min: v, startOfBroadcastWeek: g, startOfISOWeek: p, startOfWeek: S } = s;
|
|
2844
|
+
let y = {
|
|
2845
|
+
day: l,
|
|
2846
|
+
week: u,
|
|
2847
|
+
month: d,
|
|
2848
|
+
year: f,
|
|
2849
|
+
startOfWeek: (O) => c ? g(O, s) : a ? p(O) : S(O),
|
|
2850
|
+
endOfWeek: (O) => c ? M(O) : a ? w(O) : C(O)
|
|
2851
|
+
}[e](o, t === "after" ? 1 : -1);
|
|
2852
|
+
return t === "before" && n ? y = W([n, y]) : t === "after" && r && (y = v([r, y])), y;
|
|
2853
|
+
}
|
|
2854
|
+
function xn(e, t, o, n, r, i, s, a = 0) {
|
|
2855
|
+
if (a > 365)
|
|
2856
|
+
return;
|
|
2857
|
+
const c = Ja(e, t, o.date, n, r, i, s), l = !!(i.disabled && Ce(c, i.disabled, s)), d = !!(i.hidden && Ce(c, i.hidden, s)), u = c, f = new mn(c, u, s);
|
|
2858
|
+
return !l && !d ? f : xn(e, t, f, n, r, i, s, a + 1);
|
|
2859
|
+
}
|
|
2860
|
+
function es(e, t, o, n, r) {
|
|
2861
|
+
const { autoFocus: i } = e, [s, a] = Se(), c = Za(t.days, o, n || (() => !1), s), [l, d] = Se(i ? c : void 0);
|
|
2862
|
+
return {
|
|
2863
|
+
isFocusTarget: (C) => !!c?.isEqualTo(C),
|
|
2864
|
+
setFocused: d,
|
|
2865
|
+
focused: l,
|
|
2866
|
+
blur: () => {
|
|
2867
|
+
a(l), d(void 0);
|
|
2868
|
+
},
|
|
2869
|
+
moveFocus: (C, W) => {
|
|
2870
|
+
if (!l)
|
|
2871
|
+
return;
|
|
2872
|
+
const v = xn(C, W, l, t.navStart, t.navEnd, e, r);
|
|
2873
|
+
v && (e.disableNavigation && !t.days.some((p) => p.isEqualTo(v)) || (t.goToDay(v), d(v)));
|
|
2874
|
+
}
|
|
2875
|
+
};
|
|
2876
|
+
}
|
|
2877
|
+
function ts(e, t) {
|
|
2878
|
+
const { selected: o, required: n, onSelect: r } = e, [i, s] = ft(o, r ? o : void 0), a = r ? o : i, { isSameDay: c } = t, l = (M) => a?.some((w) => c(w, M)) ?? !1, { min: d, max: u } = e;
|
|
2879
|
+
return {
|
|
2880
|
+
selected: a,
|
|
2881
|
+
select: (M, w, C) => {
|
|
2882
|
+
let W = [...a ?? []];
|
|
2883
|
+
if (l(M)) {
|
|
2884
|
+
if (a?.length === d || n && a?.length === 1)
|
|
2885
|
+
return;
|
|
2886
|
+
W = a?.filter((v) => !c(v, M));
|
|
2887
|
+
} else
|
|
2888
|
+
a?.length === u ? W = [M] : W = [...W, M];
|
|
2889
|
+
return r || s(W), r?.(W, M, w, C), W;
|
|
2890
|
+
},
|
|
2891
|
+
isSelected: l
|
|
2892
|
+
};
|
|
2893
|
+
}
|
|
2894
|
+
function ns(e, t, o = 0, n = 0, r = !1, i = ve) {
|
|
2895
|
+
const { from: s, to: a } = t || {}, { isSameDay: c, isAfter: l, isBefore: d } = i;
|
|
2896
|
+
let u;
|
|
2897
|
+
if (!s && !a)
|
|
2898
|
+
u = { from: e, to: o > 0 ? void 0 : e };
|
|
2899
|
+
else if (s && !a)
|
|
2900
|
+
c(s, e) ? o === 0 ? u = { from: s, to: e } : r ? u = { from: s, to: void 0 } : u = void 0 : d(e, s) ? u = { from: e, to: s } : u = { from: s, to: e };
|
|
2901
|
+
else if (s && a)
|
|
2902
|
+
if (c(s, e) && c(a, e))
|
|
2903
|
+
r ? u = { from: s, to: a } : u = void 0;
|
|
2904
|
+
else if (c(s, e))
|
|
2905
|
+
u = { from: s, to: o > 0 ? void 0 : e };
|
|
2906
|
+
else if (c(a, e))
|
|
2907
|
+
u = { from: e, to: o > 0 ? void 0 : e };
|
|
2908
|
+
else if (d(e, s))
|
|
2909
|
+
u = { from: e, to: a };
|
|
2910
|
+
else if (l(e, s))
|
|
2911
|
+
u = { from: s, to: e };
|
|
2912
|
+
else if (l(e, a))
|
|
2913
|
+
u = { from: s, to: e };
|
|
2914
|
+
else
|
|
2915
|
+
throw new Error("Invalid range");
|
|
2916
|
+
if (u?.from && u?.to) {
|
|
2917
|
+
const f = i.differenceInCalendarDays(u.to, u.from);
|
|
2918
|
+
n > 0 && f > n ? u = { from: e, to: void 0 } : o > 1 && f < o && (u = { from: e, to: void 0 });
|
|
2919
|
+
}
|
|
2920
|
+
return u;
|
|
2921
|
+
}
|
|
2922
|
+
function os(e, t, o = ve) {
|
|
2923
|
+
const n = Array.isArray(t) ? t : [t];
|
|
2924
|
+
let r = e.from;
|
|
2925
|
+
const i = o.differenceInCalendarDays(e.to, e.from), s = Math.min(i, 6);
|
|
2926
|
+
for (let a = 0; a <= s; a++) {
|
|
2927
|
+
if (n.includes(r.getDay()))
|
|
2928
|
+
return !0;
|
|
2929
|
+
r = o.addDays(r, 1);
|
|
2930
|
+
}
|
|
2931
|
+
return !1;
|
|
2932
|
+
}
|
|
2933
|
+
function Ut(e, t, o = ve) {
|
|
2934
|
+
return Ne(e, t.from, !1, o) || Ne(e, t.to, !1, o) || Ne(t, e.from, !1, o) || Ne(t, e.to, !1, o);
|
|
2935
|
+
}
|
|
2936
|
+
function rs(e, t, o = ve) {
|
|
2937
|
+
const n = Array.isArray(t) ? t : [t];
|
|
2938
|
+
if (n.filter((a) => typeof a != "function").some((a) => typeof a == "boolean" ? a : o.isDate(a) ? Ne(e, a, !1, o) : pn(a, o) ? a.some((c) => Ne(e, c, !1, o)) : dt(a) ? a.from && a.to ? Ut(e, { from: a.from, to: a.to }, o) : !1 : gn(a) ? os(e, a.dayOfWeek, o) : Yt(a) ? o.isAfter(a.before, a.after) ? Ut(e, {
|
|
2939
|
+
from: o.addDays(a.after, 1),
|
|
2940
|
+
to: o.addDays(a.before, -1)
|
|
2941
|
+
}, o) : Ce(e.from, a, o) || Ce(e.to, a, o) : Et(a) || Ft(a) ? Ce(e.from, a, o) || Ce(e.to, a, o) : !1))
|
|
2942
|
+
return !0;
|
|
2943
|
+
const s = n.filter((a) => typeof a == "function");
|
|
2944
|
+
if (s.length) {
|
|
2945
|
+
let a = e.from;
|
|
2946
|
+
const c = o.differenceInCalendarDays(e.to, e.from);
|
|
2947
|
+
for (let l = 0; l <= c; l++) {
|
|
2948
|
+
if (s.some((d) => d(a)))
|
|
2949
|
+
return !0;
|
|
2950
|
+
a = o.addDays(a, 1);
|
|
2951
|
+
}
|
|
2952
|
+
}
|
|
2953
|
+
return !1;
|
|
2954
|
+
}
|
|
2955
|
+
function as(e, t) {
|
|
2956
|
+
const { disabled: o, excludeDisabled: n, selected: r, required: i, onSelect: s } = e, [a, c] = ft(r, s ? r : void 0), l = s ? r : a;
|
|
2957
|
+
return {
|
|
2958
|
+
selected: l,
|
|
2959
|
+
select: (f, M, w) => {
|
|
2960
|
+
const { min: C, max: W } = e, v = f ? ns(f, l, C, W, i, t) : void 0;
|
|
2961
|
+
return n && o && v?.from && v.to && rs({ from: v.from, to: v.to }, o, t) && (v.from = f, v.to = void 0), s || c(v), s?.(v, f, M, w), v;
|
|
2962
|
+
},
|
|
2963
|
+
isSelected: (f) => l && Ne(l, f, !1, t)
|
|
2964
|
+
};
|
|
2965
|
+
}
|
|
2966
|
+
function ss(e, t) {
|
|
2967
|
+
const { selected: o, required: n, onSelect: r } = e, [i, s] = ft(o, r ? o : void 0), a = r ? o : i, { isSameDay: c } = t;
|
|
2968
|
+
return {
|
|
2969
|
+
selected: a,
|
|
2970
|
+
select: (u, f, M) => {
|
|
2971
|
+
let w = u;
|
|
2972
|
+
return !n && a && a && c(u, a) && (w = void 0), r || s(w), r?.(w, u, f, M), w;
|
|
2973
|
+
},
|
|
2974
|
+
isSelected: (u) => a ? c(a, u) : !1
|
|
2975
|
+
};
|
|
2976
|
+
}
|
|
2977
|
+
function is(e, t) {
|
|
2978
|
+
const o = ss(e, t), n = ts(e, t), r = as(e, t);
|
|
2979
|
+
switch (e.mode) {
|
|
2980
|
+
case "single":
|
|
2981
|
+
return o;
|
|
2982
|
+
case "multiple":
|
|
2983
|
+
return n;
|
|
2984
|
+
case "range":
|
|
2985
|
+
return r;
|
|
2986
|
+
default:
|
|
2987
|
+
return;
|
|
2988
|
+
}
|
|
2989
|
+
}
|
|
2990
|
+
function de(e, t) {
|
|
2991
|
+
return e instanceof J && e.timeZone === t ? e : new J(e, t);
|
|
2992
|
+
}
|
|
2993
|
+
function Ge(e, t, o) {
|
|
2994
|
+
return de(e, t);
|
|
2995
|
+
}
|
|
2996
|
+
function Kt(e, t, o) {
|
|
2997
|
+
return typeof e == "boolean" || typeof e == "function" ? e : e instanceof Date ? Ge(e, t) : Array.isArray(e) ? e.map((n) => n instanceof Date ? Ge(n, t) : n) : dt(e) ? {
|
|
2998
|
+
...e,
|
|
2999
|
+
from: e.from ? de(e.from, t) : e.from,
|
|
3000
|
+
to: e.to ? de(e.to, t) : e.to
|
|
3001
|
+
} : Yt(e) ? {
|
|
3002
|
+
before: Ge(e.before, t),
|
|
3003
|
+
after: Ge(e.after, t)
|
|
3004
|
+
} : Et(e) ? {
|
|
3005
|
+
after: Ge(e.after, t)
|
|
3006
|
+
} : Ft(e) ? {
|
|
3007
|
+
before: Ge(e.before, t)
|
|
3008
|
+
} : e;
|
|
3009
|
+
}
|
|
3010
|
+
function Wt(e, t, o) {
|
|
3011
|
+
return e && (Array.isArray(e) ? e.map((n) => Kt(n, t)) : Kt(e, t));
|
|
3012
|
+
}
|
|
3013
|
+
function St(e) {
|
|
3014
|
+
let t = e;
|
|
3015
|
+
const o = t.timeZone;
|
|
3016
|
+
if (o && (t = {
|
|
3017
|
+
...e,
|
|
3018
|
+
timeZone: o
|
|
3019
|
+
}, t.today && (t.today = de(t.today, o)), t.month && (t.month = de(t.month, o)), t.defaultMonth && (t.defaultMonth = de(t.defaultMonth, o)), t.startMonth && (t.startMonth = de(t.startMonth, o)), t.endMonth && (t.endMonth = de(t.endMonth, o)), t.mode === "single" && t.selected ? t.selected = de(t.selected, o) : t.mode === "multiple" && t.selected ? t.selected = t.selected?.map((N) => de(N, o)) : t.mode === "range" && t.selected && (t.selected = {
|
|
3020
|
+
from: t.selected.from ? de(t.selected.from, o) : t.selected.from,
|
|
3021
|
+
to: t.selected.to ? de(t.selected.to, o) : t.selected.to
|
|
3022
|
+
}), t.disabled !== void 0 && (t.disabled = Wt(t.disabled, o)), t.hidden !== void 0 && (t.hidden = Wt(t.hidden, o)), t.modifiers)) {
|
|
3023
|
+
const N = {};
|
|
3024
|
+
Object.keys(t.modifiers).forEach((E) => {
|
|
3025
|
+
N[E] = Wt(t.modifiers?.[E], o);
|
|
3026
|
+
}), t.modifiers = N;
|
|
3027
|
+
}
|
|
3028
|
+
const { components: n, formatters: r, labels: i, dateLib: s, locale: a, classNames: c } = ie(() => {
|
|
3029
|
+
const N = { ...hn, ...t.locale }, E = t.broadcastCalendar ? 1 : t.weekStartsOn, k = t.noonSafe && t.timeZone ? ja(t.timeZone, {
|
|
3030
|
+
weekStartsOn: E,
|
|
3031
|
+
locale: N
|
|
3032
|
+
}) : void 0, Y = t.dateLib && k ? { ...k, ...t.dateLib } : t.dateLib ?? k, ne = new ce({
|
|
3033
|
+
locale: N,
|
|
3034
|
+
weekStartsOn: E,
|
|
3035
|
+
firstWeekContainsDate: t.firstWeekContainsDate,
|
|
3036
|
+
useAdditionalWeekYearTokens: t.useAdditionalWeekYearTokens,
|
|
3037
|
+
useAdditionalDayOfYearTokens: t.useAdditionalDayOfYearTokens,
|
|
3038
|
+
timeZone: t.timeZone,
|
|
3039
|
+
numerals: t.numerals
|
|
3040
|
+
}, Y);
|
|
3041
|
+
return {
|
|
3042
|
+
dateLib: ne,
|
|
3043
|
+
components: pa(t.components),
|
|
3044
|
+
formatters: Ca(t.formatters),
|
|
3045
|
+
labels: Ea(t.labels, ne.options),
|
|
3046
|
+
locale: N,
|
|
3047
|
+
classNames: { ...wa(), ...t.classNames }
|
|
3048
|
+
};
|
|
3049
|
+
}, [
|
|
3050
|
+
t.locale,
|
|
3051
|
+
t.broadcastCalendar,
|
|
3052
|
+
t.weekStartsOn,
|
|
3053
|
+
t.firstWeekContainsDate,
|
|
3054
|
+
t.useAdditionalWeekYearTokens,
|
|
3055
|
+
t.useAdditionalDayOfYearTokens,
|
|
3056
|
+
t.timeZone,
|
|
3057
|
+
t.numerals,
|
|
3058
|
+
t.dateLib,
|
|
3059
|
+
t.noonSafe,
|
|
3060
|
+
t.components,
|
|
3061
|
+
t.formatters,
|
|
3062
|
+
t.labels,
|
|
3063
|
+
t.classNames
|
|
3064
|
+
]);
|
|
3065
|
+
t.today || (t = { ...t, today: s.today() });
|
|
3066
|
+
const { captionLayout: l, mode: d, navLayout: u, numberOfMonths: f = 1, onDayBlur: M, onDayClick: w, onDayFocus: C, onDayKeyDown: W, onDayMouseEnter: v, onDayMouseLeave: g, onNextClick: p, onPrevClick: S, showWeekNumber: D, styles: y } = t, { formatCaption: O, formatDay: x, formatMonthDropdown: j, formatWeekNumber: F, formatWeekNumberHeader: K, formatWeekdayName: V, formatYearDropdown: z } = r, _ = Ka(t, s), { days: me, months: ke, navStart: ye, navEnd: je, previousMonth: oe, nextMonth: X, goToMonth: Z } = _, Oe = ya(me, t, ye, je, s), { isSelected: $e, select: Fe, selected: ge } = is(t, s) ?? {}, { blur: Ae, focused: le, isFocusTarget: it, moveFocus: Ue, setFocused: pe } = es(t, _, Oe, $e ?? (() => !1), s), { labelDayButton: ht, labelGridcell: mt, labelGrid: ct, labelMonthDropdown: lt, labelNav: Ke, labelPrevious: xe, labelNext: We, labelWeekday: He, labelWeekNumber: Ze, labelWeekNumberHeader: yt, labelYearDropdown: gt } = i, pt = ie(() => Ia(s, t.ISOWeek, t.broadcastCalendar, t.today), [s, t.ISOWeek, t.broadcastCalendar, t.today]), m = d !== void 0 || w !== void 0, T = q(() => {
|
|
3067
|
+
oe && (Z(oe), S?.(oe));
|
|
3068
|
+
}, [oe, Z, S]), A = q(() => {
|
|
3069
|
+
X && (Z(X), p?.(X));
|
|
3070
|
+
}, [Z, X, p]), L = q((N, E) => (k) => {
|
|
3071
|
+
k.preventDefault(), k.stopPropagation(), pe(N), !E.disabled && (Fe?.(N.date, E, k), w?.(N.date, E, k));
|
|
3072
|
+
}, [Fe, w, pe]), G = q((N, E) => (k) => {
|
|
3073
|
+
pe(N), C?.(N.date, E, k);
|
|
3074
|
+
}, [C, pe]), ee = q((N, E) => (k) => {
|
|
3075
|
+
Ae(), M?.(N.date, E, k);
|
|
3076
|
+
}, [Ae, M]), ae = q((N, E) => (k) => {
|
|
3077
|
+
const Y = {
|
|
3078
|
+
ArrowLeft: [
|
|
3079
|
+
k.shiftKey ? "month" : "day",
|
|
3080
|
+
t.dir === "rtl" ? "after" : "before"
|
|
3081
|
+
],
|
|
3082
|
+
ArrowRight: [
|
|
3083
|
+
k.shiftKey ? "month" : "day",
|
|
3084
|
+
t.dir === "rtl" ? "before" : "after"
|
|
3085
|
+
],
|
|
3086
|
+
ArrowDown: [k.shiftKey ? "year" : "week", "after"],
|
|
3087
|
+
ArrowUp: [k.shiftKey ? "year" : "week", "before"],
|
|
3088
|
+
PageUp: [k.shiftKey ? "year" : "month", "before"],
|
|
3089
|
+
PageDown: [k.shiftKey ? "year" : "month", "after"],
|
|
3090
|
+
Home: ["startOfWeek", "before"],
|
|
3091
|
+
End: ["endOfWeek", "after"]
|
|
3092
|
+
};
|
|
3093
|
+
if (Y[k.key]) {
|
|
3094
|
+
k.preventDefault(), k.stopPropagation();
|
|
3095
|
+
const [ne, P] = Y[k.key];
|
|
3096
|
+
Ue(ne, P);
|
|
3097
|
+
}
|
|
3098
|
+
W?.(N.date, E, k);
|
|
3099
|
+
}, [Ue, W, t.dir]), re = q((N, E) => (k) => {
|
|
3100
|
+
v?.(N.date, E, k);
|
|
3101
|
+
}, [v]), $ = q((N, E) => (k) => {
|
|
3102
|
+
g?.(N.date, E, k);
|
|
3103
|
+
}, [g]), ue = q((N) => (E) => {
|
|
3104
|
+
const k = Number(E.target.value), Y = s.setMonth(s.startOfMonth(N), k);
|
|
3105
|
+
Z(Y);
|
|
3106
|
+
}, [s, Z]), te = q((N) => (E) => {
|
|
3107
|
+
const k = Number(E.target.value), Y = s.setYear(s.startOfMonth(N), k);
|
|
3108
|
+
Z(Y);
|
|
3109
|
+
}, [s, Z]), { className: H, style: qe } = ie(() => ({
|
|
3110
|
+
className: [c[b.Root], t.className].filter(Boolean).join(" "),
|
|
3111
|
+
style: { ...y?.[b.Root], ...t.style }
|
|
3112
|
+
}), [c, t.className, t.style, y]), Re = ba(t), Pe = Ee(null);
|
|
3113
|
+
qa(Pe, !!t.animate, {
|
|
3114
|
+
classNames: c,
|
|
3115
|
+
months: ke,
|
|
3116
|
+
focused: le,
|
|
3117
|
+
dateLib: s
|
|
3118
|
+
});
|
|
3119
|
+
const Te = {
|
|
3120
|
+
dayPickerProps: t,
|
|
3121
|
+
selected: ge,
|
|
3122
|
+
select: Fe,
|
|
3123
|
+
isSelected: $e,
|
|
3124
|
+
months: ke,
|
|
3125
|
+
nextMonth: X,
|
|
3126
|
+
previousMonth: oe,
|
|
3127
|
+
goToMonth: Z,
|
|
3128
|
+
getModifiers: Oe,
|
|
3129
|
+
components: n,
|
|
3130
|
+
classNames: c,
|
|
3131
|
+
styles: y,
|
|
3132
|
+
labels: i,
|
|
3133
|
+
formatters: r
|
|
3134
|
+
};
|
|
3135
|
+
return h.createElement(
|
|
3136
|
+
yn.Provider,
|
|
3137
|
+
{ value: Te },
|
|
3138
|
+
h.createElement(
|
|
3139
|
+
n.Root,
|
|
3140
|
+
{ rootRef: t.animate ? Pe : void 0, className: H, style: qe, dir: t.dir, id: t.id, lang: t.lang, nonce: t.nonce, title: t.title, role: t.role, "aria-label": t["aria-label"], "aria-labelledby": t["aria-labelledby"], ...Re },
|
|
3141
|
+
h.createElement(
|
|
3142
|
+
n.Months,
|
|
3143
|
+
{ className: c[b.Months], style: y?.[b.Months] },
|
|
3144
|
+
!t.hideNavigation && !u && h.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: c[b.Nav], style: y?.[b.Nav], "aria-label": Ke(), onPreviousClick: T, onNextClick: A, previousMonth: oe, nextMonth: X }),
|
|
3145
|
+
ke.map((N, E) => h.createElement(
|
|
3146
|
+
n.Month,
|
|
3147
|
+
{
|
|
3148
|
+
"data-animated-month": t.animate ? "true" : void 0,
|
|
3149
|
+
className: c[b.Month],
|
|
3150
|
+
style: y?.[b.Month],
|
|
3151
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: breaks animation
|
|
3152
|
+
key: E,
|
|
3153
|
+
displayIndex: E,
|
|
3154
|
+
calendarMonth: N
|
|
3155
|
+
},
|
|
3156
|
+
u === "around" && !t.hideNavigation && E === 0 && h.createElement(
|
|
3157
|
+
n.PreviousMonthButton,
|
|
3158
|
+
{ type: "button", className: c[b.PreviousMonthButton], tabIndex: oe ? void 0 : -1, "aria-disabled": oe ? void 0 : !0, "aria-label": xe(oe), onClick: T, "data-animated-button": t.animate ? "true" : void 0 },
|
|
3159
|
+
h.createElement(n.Chevron, { disabled: oe ? void 0 : !0, className: c[b.Chevron], orientation: t.dir === "rtl" ? "right" : "left" })
|
|
3160
|
+
),
|
|
3161
|
+
h.createElement(n.MonthCaption, { "data-animated-caption": t.animate ? "true" : void 0, className: c[b.MonthCaption], style: y?.[b.MonthCaption], calendarMonth: N, displayIndex: E }, l?.startsWith("dropdown") ? h.createElement(
|
|
3162
|
+
n.DropdownNav,
|
|
3163
|
+
{ className: c[b.Dropdowns], style: y?.[b.Dropdowns] },
|
|
3164
|
+
(() => {
|
|
3165
|
+
const k = l === "dropdown" || l === "dropdown-months" ? h.createElement(n.MonthsDropdown, { key: "month", className: c[b.MonthsDropdown], "aria-label": lt(), classNames: c, components: n, disabled: !!t.disableNavigation, onChange: ue(N.date), options: Fa(N.date, ye, je, r, s), style: y?.[b.Dropdown], value: s.getMonth(N.date) }) : h.createElement("span", { key: "month" }, j(N.date, s)), Y = l === "dropdown" || l === "dropdown-years" ? h.createElement(n.YearsDropdown, { key: "year", className: c[b.YearsDropdown], "aria-label": gt(s.options), classNames: c, components: n, disabled: !!t.disableNavigation, onChange: te(N.date), options: Ba(ye, je, r, s, !!t.reverseYears), style: y?.[b.Dropdown], value: s.getYear(N.date) }) : h.createElement("span", { key: "year" }, z(N.date, s));
|
|
3166
|
+
return s.getMonthYearOrder() === "year-first" ? [Y, k] : [k, Y];
|
|
3167
|
+
})(),
|
|
3168
|
+
h.createElement("span", { role: "status", "aria-live": "polite", style: {
|
|
3169
|
+
border: 0,
|
|
3170
|
+
clip: "rect(0 0 0 0)",
|
|
3171
|
+
height: "1px",
|
|
3172
|
+
margin: "-1px",
|
|
3173
|
+
overflow: "hidden",
|
|
3174
|
+
padding: 0,
|
|
3175
|
+
position: "absolute",
|
|
3176
|
+
width: "1px",
|
|
3177
|
+
whiteSpace: "nowrap",
|
|
3178
|
+
wordWrap: "normal"
|
|
3179
|
+
} }, O(N.date, s.options, s))
|
|
3180
|
+
) : h.createElement(n.CaptionLabel, { className: c[b.CaptionLabel], role: "status", "aria-live": "polite" }, O(N.date, s.options, s))),
|
|
3181
|
+
u === "around" && !t.hideNavigation && E === f - 1 && h.createElement(
|
|
3182
|
+
n.NextMonthButton,
|
|
3183
|
+
{ type: "button", className: c[b.NextMonthButton], tabIndex: X ? void 0 : -1, "aria-disabled": X ? void 0 : !0, "aria-label": We(X), onClick: A, "data-animated-button": t.animate ? "true" : void 0 },
|
|
3184
|
+
h.createElement(n.Chevron, { disabled: X ? void 0 : !0, className: c[b.Chevron], orientation: t.dir === "rtl" ? "left" : "right" })
|
|
3185
|
+
),
|
|
3186
|
+
E === f - 1 && u === "after" && !t.hideNavigation && h.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: c[b.Nav], style: y?.[b.Nav], "aria-label": Ke(), onPreviousClick: T, onNextClick: A, previousMonth: oe, nextMonth: X }),
|
|
3187
|
+
h.createElement(
|
|
3188
|
+
n.MonthGrid,
|
|
3189
|
+
{ role: "grid", "aria-multiselectable": d === "multiple" || d === "range", "aria-label": ct(N.date, s.options, s) || void 0, className: c[b.MonthGrid], style: y?.[b.MonthGrid] },
|
|
3190
|
+
!t.hideWeekdays && h.createElement(
|
|
3191
|
+
n.Weekdays,
|
|
3192
|
+
{ "data-animated-weekdays": t.animate ? "true" : void 0, className: c[b.Weekdays], style: y?.[b.Weekdays] },
|
|
3193
|
+
D && h.createElement(n.WeekNumberHeader, { "aria-label": yt(s.options), className: c[b.WeekNumberHeader], style: y?.[b.WeekNumberHeader], scope: "col" }, K()),
|
|
3194
|
+
pt.map((k) => h.createElement(n.Weekday, { "aria-label": He(k, s.options, s), className: c[b.Weekday], key: String(k), style: y?.[b.Weekday], scope: "col" }, V(k, s.options, s)))
|
|
3195
|
+
),
|
|
3196
|
+
h.createElement(n.Weeks, { "data-animated-weeks": t.animate ? "true" : void 0, className: c[b.Weeks], style: y?.[b.Weeks] }, N.weeks.map((k) => h.createElement(
|
|
3197
|
+
n.Week,
|
|
3198
|
+
{ className: c[b.Week], key: k.weekNumber, style: y?.[b.Week], week: k },
|
|
3199
|
+
D && h.createElement(n.WeekNumber, { week: k, style: y?.[b.WeekNumber], "aria-label": Ze(k.weekNumber, {
|
|
3200
|
+
locale: a
|
|
3201
|
+
}), className: c[b.WeekNumber], scope: "row", role: "rowheader" }, F(k.weekNumber, s)),
|
|
3202
|
+
k.days.map((Y) => {
|
|
3203
|
+
const { date: ne } = Y, P = Oe(Y);
|
|
3204
|
+
if (P[R.focused] = !P.hidden && !!le?.isEqualTo(Y), P[he.selected] = $e?.(ne) || P.selected, dt(ge)) {
|
|
3205
|
+
const { from: wt, to: Mt } = ge;
|
|
3206
|
+
P[he.range_start] = !!(wt && Mt && s.isSameDay(ne, wt)), P[he.range_end] = !!(wt && Mt && s.isSameDay(ne, Mt)), P[he.range_middle] = Ne(ge, ne, !0, s);
|
|
3207
|
+
}
|
|
3208
|
+
const ut = _a(P, y, t.modifiersStyles), bt = ga(P, c, t.modifiersClassNames), Pn = !m && !P.hidden ? mt(ne, P, s.options, s) : void 0;
|
|
3209
|
+
return h.createElement(n.Day, { key: `${Y.isoDate}_${Y.displayMonthId}`, day: Y, modifiers: P, className: bt.join(" "), style: ut, role: "gridcell", "aria-selected": P.selected || void 0, "aria-label": Pn, "data-day": Y.isoDate, "data-month": Y.outside ? Y.dateMonthId : void 0, "data-selected": P.selected || void 0, "data-disabled": P.disabled || void 0, "data-hidden": P.hidden || void 0, "data-outside": Y.outside || void 0, "data-focused": P.focused || void 0, "data-today": P.today || void 0 }, !P.hidden && m ? h.createElement(n.DayButton, { className: c[b.DayButton], style: y?.[b.DayButton], type: "button", day: Y, modifiers: P, disabled: !P.focused && P.disabled || void 0, "aria-disabled": P.focused && P.disabled || void 0, tabIndex: it(Y) ? 0 : -1, "aria-label": ht(ne, P, s.options, s), onClick: L(Y, P), onBlur: ee(Y, P), onFocus: G(Y, P), onKeyDown: ae(Y, P), onMouseEnter: re(Y, P), onMouseLeave: $(Y, P) }, x(ne, s.options, s)) : !P.hidden && x(Y.date, s.options, s));
|
|
3210
|
+
})
|
|
3211
|
+
)))
|
|
3212
|
+
)
|
|
3213
|
+
))
|
|
3214
|
+
),
|
|
3215
|
+
t.footer && h.createElement(n.Footer, { className: c[b.Footer], style: y?.[b.Footer], role: "status", "aria-live": "polite" }, t.footer)
|
|
3216
|
+
)
|
|
3217
|
+
);
|
|
3218
|
+
}
|
|
3219
|
+
const gs = (e) => {
|
|
3220
|
+
const {
|
|
3221
|
+
mode: t = "single",
|
|
3222
|
+
required: o = !1,
|
|
3223
|
+
selected: n,
|
|
3224
|
+
onSelect: r,
|
|
3225
|
+
disabledDates: i,
|
|
3226
|
+
header: s,
|
|
3227
|
+
footer: a,
|
|
3228
|
+
hideOutsideDays: c = !1,
|
|
3229
|
+
numberOfMonths: l = 1,
|
|
3230
|
+
startMonth: d,
|
|
3231
|
+
endMonth: u,
|
|
3232
|
+
showActionButtons: f = !1,
|
|
3233
|
+
applyLabel: M = "Aplicar",
|
|
3234
|
+
cancelLabel: w = "Cancelar",
|
|
3235
|
+
onApply: C,
|
|
3236
|
+
onCancel: W,
|
|
3237
|
+
hideFooter: v = !1,
|
|
3238
|
+
variant: g = "input",
|
|
3239
|
+
inputProps: p,
|
|
3240
|
+
label: S = "",
|
|
3241
|
+
name: D = "datepicker",
|
|
3242
|
+
className: y
|
|
3243
|
+
} = e, O = t === "range" || t === "multiple" ? e.min : void 0, x = t === "range" || t === "multiple" ? e.max : void 0, j = t === "range" ? e.excludeDisabled : void 0, [F, K] = Se({}), [V, z] = Se(!1), [_, me] = Se(!1), [ke, ye] = Se(n), [je, oe] = Se(!1), [X, Z] = Se(""), Oe = Ee(null), $e = Ee(null), Fe = Ee(null), ge = Ee(null), Ae = f ? ke : n, le = f ? n : Ae;
|
|
3244
|
+
_e(() => {
|
|
3245
|
+
window.innerWidth < 768 ? oe(!0) : oe(!1);
|
|
3246
|
+
}, []), _e(() => {
|
|
3247
|
+
f && ye(n);
|
|
3248
|
+
}, [n, f]), _e(() => {
|
|
3249
|
+
if (g !== "input" || !V) return;
|
|
3250
|
+
const m = (T) => {
|
|
3251
|
+
Oe.current && !Oe.current.contains(T.target) && (z(!1), f && ye(n));
|
|
3252
|
+
};
|
|
3253
|
+
return document.addEventListener("mousedown", m), () => {
|
|
3254
|
+
document.removeEventListener("mousedown", m);
|
|
3255
|
+
};
|
|
3256
|
+
}, [g, V, n, f]), _e(() => {
|
|
3257
|
+
if (!V || g !== "input" || !Oe.current) {
|
|
3258
|
+
me(!1);
|
|
3259
|
+
return;
|
|
3260
|
+
}
|
|
3261
|
+
const m = 16, T = () => {
|
|
3262
|
+
const G = Oe?.current?.getBoundingClientRect(), ee = $e?.current?.getBoundingClientRect();
|
|
3263
|
+
if (!G || !ee) return;
|
|
3264
|
+
const ae = window.innerHeight, re = window.innerWidth, $ = G.height, ue = G.width, te = ee.left, H = ee.bottom, qe = H, Re = ae - H, Pe = re - ee.left, Te = ue - Pe, N = Te > 0 && Pe >= ue + m, E = qe >= $ + m, k = Re >= $ + m, Y = !k && E, ne = !k && !E;
|
|
3265
|
+
let P = Y ? void 0 : `${H + 8}px`, ut = Y ? `${Re + ee.height + 8}px` : void 0;
|
|
3266
|
+
ne && (P = void 0, ut = `${m}px`);
|
|
3267
|
+
const bt = Te > 0 ? Te : 0;
|
|
3268
|
+
K(
|
|
3269
|
+
{
|
|
3270
|
+
top: P,
|
|
3271
|
+
bottom: ut,
|
|
3272
|
+
right: N ? "0" : void 0,
|
|
3273
|
+
left: N ? void 0 : `${te - bt}px`
|
|
3274
|
+
}
|
|
3275
|
+
), me(!0);
|
|
3276
|
+
}, A = () => {
|
|
3277
|
+
z(!1), me(!1);
|
|
3278
|
+
};
|
|
3279
|
+
window.addEventListener("scroll", A, !0);
|
|
3280
|
+
const L = setTimeout(T, 0);
|
|
3281
|
+
return () => {
|
|
3282
|
+
clearTimeout(L), window.removeEventListener("scroll", A, !0);
|
|
3283
|
+
};
|
|
3284
|
+
}, [V, g]);
|
|
3285
|
+
const it = q(() => {
|
|
3286
|
+
C?.(ke), r?.(ke), g === "input" && z(!1);
|
|
3287
|
+
}, [C, r, ke, g]), Ue = q(() => {
|
|
3288
|
+
ye(n), W?.(), g === "input" && z(!1);
|
|
3289
|
+
}, [W, n, g]), pe = ie(() => {
|
|
3290
|
+
if (!le) return "";
|
|
3291
|
+
if (t === "single")
|
|
3292
|
+
return le.toLocaleDateString("es-ES", { day: "2-digit", month: "2-digit", year: "numeric" });
|
|
3293
|
+
if (t === "range") {
|
|
3294
|
+
const m = le;
|
|
3295
|
+
if (!m.from) return "";
|
|
3296
|
+
const T = m.from.toLocaleDateString("es-ES", { day: "2-digit", month: "2-digit", year: "numeric" });
|
|
3297
|
+
if (!m.to) return T;
|
|
3298
|
+
const A = m.to.toLocaleDateString("es-ES", { day: "2-digit", month: "2-digit", year: "numeric" });
|
|
3299
|
+
return `${T} - ${A}`;
|
|
3300
|
+
}
|
|
3301
|
+
if (t === "multiple") {
|
|
3302
|
+
const m = le;
|
|
3303
|
+
return m.length === 0 ? "" : m.length === 1 ? m[0].toLocaleDateString("es-ES", { day: "2-digit", month: "2-digit", year: "numeric" }) : `${m.length} fechas seleccionadas`;
|
|
3304
|
+
}
|
|
3305
|
+
return "";
|
|
3306
|
+
}, [le, t]);
|
|
3307
|
+
_e(() => {
|
|
3308
|
+
Z(pe);
|
|
3309
|
+
}, [pe]), _e(() => {
|
|
3310
|
+
if (ge.current !== null && Fe.current) {
|
|
3311
|
+
const m = ge.current;
|
|
3312
|
+
Fe.current.setSelectionRange(m, m), ge.current = null;
|
|
3313
|
+
}
|
|
3314
|
+
}, [X]);
|
|
3315
|
+
const ht = ie(() => g === "input" || g === "input-and-calendar", [g]), mt = ie(() => g === "only-calendar" || g === "input-and-calendar" || g === "input", [g]), ct = q((m) => {
|
|
3316
|
+
r?.(m);
|
|
3317
|
+
}, [r]), lt = q((m) => {
|
|
3318
|
+
const T = new Date(parseInt(m.slice(6, 10)), parseInt(m.slice(3, 5)) - 1, parseInt(m.slice(0, 2)));
|
|
3319
|
+
if (t === "multiple") {
|
|
3320
|
+
const L = (le || []).filter((G) => G.getTime() !== T.getTime());
|
|
3321
|
+
f ? (r?.(L), ye(L)) : ct(L);
|
|
3322
|
+
}
|
|
3323
|
+
}, [t, le, f, r, ct]), Ke = q((m) => {
|
|
3324
|
+
if (f) {
|
|
3325
|
+
ye(m);
|
|
3326
|
+
return;
|
|
3327
|
+
}
|
|
3328
|
+
g === "input" && t === "single" && z(!1), r?.(m);
|
|
3329
|
+
}, [f, g, t, r]), xe = q((m) => {
|
|
3330
|
+
if (f) {
|
|
3331
|
+
ye(m);
|
|
3332
|
+
return;
|
|
3333
|
+
}
|
|
3334
|
+
r?.(m);
|
|
3335
|
+
}, [f, r]), We = q((m) => {
|
|
3336
|
+
const T = m.trim();
|
|
3337
|
+
if (!T) return null;
|
|
3338
|
+
const [A, L, G] = T.split("/").map((ue) => ue.trim()), ee = parseInt(A, 10), ae = parseInt(L, 10), re = parseInt(G, 10);
|
|
3339
|
+
if (Number.isNaN(ee) || Number.isNaN(ae) || Number.isNaN(re) || re < 1e3 || re > 9999) return null;
|
|
3340
|
+
const $ = new Date(re, ae - 1, ee);
|
|
3341
|
+
return $.getFullYear() !== re || $.getMonth() !== ae - 1 || $.getDate() !== ee ? null : $;
|
|
3342
|
+
}, []), He = q((m) => {
|
|
3343
|
+
const T = m.trim();
|
|
3344
|
+
if (!T) return null;
|
|
3345
|
+
const [A, L] = T.split("-"), G = We(A ?? "");
|
|
3346
|
+
if (!G) return null;
|
|
3347
|
+
const ee = L?.trim() ?? "", re = (ee ? We(ee) : void 0) || void 0;
|
|
3348
|
+
let $ = { from: G, to: re };
|
|
3349
|
+
if ($.to && $.from && $.to.getTime() < $.from.getTime()) {
|
|
3350
|
+
const ue = $.from;
|
|
3351
|
+
$ = { from: $.to, to: ue };
|
|
3352
|
+
}
|
|
3353
|
+
if (t === "range" && (O || x) && $.from && $.to) {
|
|
3354
|
+
const te = Math.round(($.to.getTime() - $.from.getTime()) / 864e5) + 1;
|
|
3355
|
+
if (O && te < O || x && te > x) return null;
|
|
3356
|
+
}
|
|
3357
|
+
return $;
|
|
3358
|
+
}, [t, O, x, We]), Ze = q(() => {
|
|
3359
|
+
const m = X.trim();
|
|
3360
|
+
if (!m) {
|
|
3361
|
+
(t === "single" || t === "range") && r?.(void 0);
|
|
3362
|
+
return;
|
|
3363
|
+
}
|
|
3364
|
+
if (t === "single") {
|
|
3365
|
+
const T = We(m);
|
|
3366
|
+
if (!T) {
|
|
3367
|
+
Z(pe);
|
|
3368
|
+
return;
|
|
3369
|
+
}
|
|
3370
|
+
xe(T);
|
|
3371
|
+
return;
|
|
3372
|
+
}
|
|
3373
|
+
if (t === "range") {
|
|
3374
|
+
const T = He(m);
|
|
3375
|
+
if (!T) {
|
|
3376
|
+
Z(pe);
|
|
3377
|
+
return;
|
|
3378
|
+
}
|
|
3379
|
+
xe(T);
|
|
3380
|
+
}
|
|
3381
|
+
}, [X, t, We, He, xe, pe]), yt = q((m) => {
|
|
3382
|
+
if (m.key === "Enter") {
|
|
3383
|
+
m.preventDefault(), Ze();
|
|
3384
|
+
return;
|
|
3385
|
+
}
|
|
3386
|
+
if (m.key === "ArrowUp" || m.key === "ArrowDown") {
|
|
3387
|
+
const T = m.key === "ArrowUp" ? 1 : -1, A = m.currentTarget.selectionStart ?? 0;
|
|
3388
|
+
if (t === "single") {
|
|
3389
|
+
const L = We(X);
|
|
3390
|
+
if (!L) return;
|
|
3391
|
+
m.preventDefault();
|
|
3392
|
+
const G = new Date(L);
|
|
3393
|
+
A <= 2 ? G.setDate(G.getDate() + T) : A <= 5 ? G.setMonth(G.getMonth() + T) : G.setFullYear(G.getFullYear() + T), ge.current = A, Z(G.toLocaleDateString("es-ES", { day: "2-digit", month: "2-digit", year: "numeric" })), xe(G);
|
|
3394
|
+
return;
|
|
3395
|
+
}
|
|
3396
|
+
if (t === "range") {
|
|
3397
|
+
const L = He(X);
|
|
3398
|
+
if (!L || !L.from) return;
|
|
3399
|
+
m.preventDefault();
|
|
3400
|
+
const ae = X.indexOf("-") === -1 || A <= 9, re = ae ? A : Math.max(0, A - 13), $ = new Date(L.from), ue = L.to ? new Date(L.to) : void 0, te = ae ? $ : ue ?? $;
|
|
3401
|
+
re <= 2 ? te.setDate(te.getDate() + T) : re <= 5 ? te.setMonth(te.getMonth() + T) : te.setFullYear(te.getFullYear() + T);
|
|
3402
|
+
let H = {
|
|
3403
|
+
from: ae ? te : $,
|
|
3404
|
+
to: ae ? ue : te
|
|
3405
|
+
};
|
|
3406
|
+
if (H.to && H.from && H.to.getTime() < H.from.getTime()) {
|
|
3407
|
+
const Pe = H.from;
|
|
3408
|
+
H = { from: H.to, to: Pe };
|
|
3409
|
+
}
|
|
3410
|
+
if ((O || x) && H.from && H.to) {
|
|
3411
|
+
const Te = Math.round((H.to.getTime() - H.from.getTime()) / 864e5) + 1;
|
|
3412
|
+
if (O && Te < O || x && Te > x) return;
|
|
3413
|
+
}
|
|
3414
|
+
if (!H.from) return;
|
|
3415
|
+
const qe = H.from.toLocaleDateString("es-ES", { day: "2-digit", month: "2-digit", year: "numeric" }), Re = H.to ? H.to.toLocaleDateString("es-ES", { day: "2-digit", month: "2-digit", year: "numeric" }) : "";
|
|
3416
|
+
ge.current = A, Z(H.to ? `${qe} - ${Re}` : qe), xe(H);
|
|
3417
|
+
return;
|
|
3418
|
+
}
|
|
3419
|
+
}
|
|
3420
|
+
}, [Ze, t, X, We, He, O, x, xe]), gt = q(() => {
|
|
3421
|
+
const m = le || [];
|
|
3422
|
+
return /* @__PURE__ */ U.jsx(
|
|
3423
|
+
_n,
|
|
3424
|
+
{
|
|
3425
|
+
label: S,
|
|
3426
|
+
placeholder: "Seleccione una o más fechas",
|
|
3427
|
+
name: D,
|
|
3428
|
+
value: m.sort((T, A) => T.getTime() - A.getTime()).map((T) => T.toLocaleDateString("es-ES", { day: "2-digit", month: "2-digit", year: "numeric" })),
|
|
3429
|
+
onChange: () => {
|
|
3430
|
+
},
|
|
3431
|
+
onClick: () => z(!0),
|
|
3432
|
+
className: tt("w-[360px]", p?.className),
|
|
3433
|
+
readonly: !0,
|
|
3434
|
+
onValueDelete: lt,
|
|
3435
|
+
icon: /* @__PURE__ */ U.jsx(Bt, {})
|
|
3436
|
+
}
|
|
3437
|
+
);
|
|
3438
|
+
}, [le, S, D, lt, p]), pt = ie(() => ({
|
|
3439
|
+
top: F?.top,
|
|
3440
|
+
left: F?.left,
|
|
3441
|
+
bottom: F?.bottom,
|
|
3442
|
+
right: F?.right,
|
|
3443
|
+
opacity: _ && V ? 1 : 0,
|
|
3444
|
+
transition: "opacity 0.15s linear",
|
|
3445
|
+
position: "fixed",
|
|
3446
|
+
zIndex: 1e3,
|
|
3447
|
+
pointerEvents: _ && V ? "auto" : "none"
|
|
3448
|
+
}), [F, _, V]);
|
|
3449
|
+
return /* @__PURE__ */ U.jsxs("div", { className: tt("relative w-max flex flex-col gap-2 lg:min-w-[360px] min-w-auto", p?.className), children: [
|
|
3450
|
+
ht && /* @__PURE__ */ U.jsx(
|
|
3451
|
+
"div",
|
|
3452
|
+
{
|
|
3453
|
+
ref: $e,
|
|
3454
|
+
className: "relative w-full",
|
|
3455
|
+
children: t === "multiple" ? gt() : /* @__PURE__ */ U.jsx(
|
|
3456
|
+
In,
|
|
3457
|
+
{
|
|
3458
|
+
...p,
|
|
3459
|
+
ref: Fe,
|
|
3460
|
+
readOnly: f || p?.readOnly,
|
|
3461
|
+
icon: /* @__PURE__ */ U.jsx(Bt, {}),
|
|
3462
|
+
iconPosition: "right",
|
|
3463
|
+
type: "text",
|
|
3464
|
+
inputMode: p?.inputMode ?? "numeric",
|
|
3465
|
+
value: X,
|
|
3466
|
+
onChange: (m) => {
|
|
3467
|
+
if (f) {
|
|
3468
|
+
p?.onChange?.(m);
|
|
3469
|
+
return;
|
|
3470
|
+
}
|
|
3471
|
+
Z(m.target.value);
|
|
3472
|
+
},
|
|
3473
|
+
name: D,
|
|
3474
|
+
label: S,
|
|
3475
|
+
onFocus: (m) => {
|
|
3476
|
+
m.stopPropagation(), p?.onFocus?.(m), g === "input" && z(!0);
|
|
3477
|
+
},
|
|
3478
|
+
onClick: (m) => {
|
|
3479
|
+
m.stopPropagation(), g === "input" && !V && z(!0);
|
|
3480
|
+
},
|
|
3481
|
+
onBlur: (m) => {
|
|
3482
|
+
p?.onBlur?.(m), f || Ze();
|
|
3483
|
+
},
|
|
3484
|
+
onKeyDown: (m) => {
|
|
3485
|
+
p?.onKeyDown?.(m), f || yt(m);
|
|
3486
|
+
}
|
|
3487
|
+
}
|
|
3488
|
+
)
|
|
3489
|
+
}
|
|
3490
|
+
),
|
|
3491
|
+
mt && (g === "input" ? document?.body && Bn(
|
|
3492
|
+
/* @__PURE__ */ U.jsx(
|
|
3493
|
+
Ct,
|
|
3494
|
+
{
|
|
3495
|
+
mode: t,
|
|
3496
|
+
footer: a,
|
|
3497
|
+
header: s,
|
|
3498
|
+
selected: n,
|
|
3499
|
+
ref: Oe,
|
|
3500
|
+
endMonth: u,
|
|
3501
|
+
required: o,
|
|
3502
|
+
onApply: it,
|
|
3503
|
+
onCancel: Ue,
|
|
3504
|
+
hideFooter: v,
|
|
3505
|
+
startMonth: d,
|
|
3506
|
+
applyLabel: M,
|
|
3507
|
+
cancelLabel: w,
|
|
3508
|
+
displayValue: Ae,
|
|
3509
|
+
disabledDates: i,
|
|
3510
|
+
numberOfMonths: je ? 1 : l,
|
|
3511
|
+
onSelect: Ke,
|
|
3512
|
+
hideOutsideDays: c,
|
|
3513
|
+
showActionButtons: f,
|
|
3514
|
+
min: O,
|
|
3515
|
+
max: x,
|
|
3516
|
+
excludeDisabled: j,
|
|
3517
|
+
className: tt("bg-neutral-strong-default text-neutral-default-default shadow", y),
|
|
3518
|
+
style: pt
|
|
3519
|
+
}
|
|
3520
|
+
),
|
|
3521
|
+
document.body
|
|
3522
|
+
) : /* @__PURE__ */ U.jsx(
|
|
3523
|
+
Ct,
|
|
3524
|
+
{
|
|
3525
|
+
min: O,
|
|
3526
|
+
max: x,
|
|
3527
|
+
mode: t,
|
|
3528
|
+
header: s,
|
|
3529
|
+
footer: a,
|
|
3530
|
+
required: o,
|
|
3531
|
+
endMonth: u,
|
|
3532
|
+
selected: n,
|
|
3533
|
+
className: y,
|
|
3534
|
+
onApply: it,
|
|
3535
|
+
startMonth: d,
|
|
3536
|
+
applyLabel: M,
|
|
3537
|
+
hideFooter: v,
|
|
3538
|
+
onCancel: Ue,
|
|
3539
|
+
cancelLabel: w,
|
|
3540
|
+
displayValue: Ae,
|
|
3541
|
+
disabledDates: i,
|
|
3542
|
+
numberOfMonths: je ? 1 : l,
|
|
3543
|
+
onSelect: Ke,
|
|
3544
|
+
hideOutsideDays: c,
|
|
3545
|
+
showActionButtons: f,
|
|
3546
|
+
excludeDisabled: j
|
|
3547
|
+
}
|
|
3548
|
+
))
|
|
3549
|
+
] });
|
|
3550
|
+
}, Ct = Fn((e) => {
|
|
3551
|
+
const {
|
|
3552
|
+
ref: t,
|
|
3553
|
+
min: o,
|
|
3554
|
+
max: n,
|
|
3555
|
+
style: r,
|
|
3556
|
+
header: i,
|
|
3557
|
+
footer: s,
|
|
3558
|
+
onApply: a,
|
|
3559
|
+
onCancel: c,
|
|
3560
|
+
onSelect: l,
|
|
3561
|
+
required: d,
|
|
3562
|
+
endMonth: u,
|
|
3563
|
+
className: f,
|
|
3564
|
+
startMonth: M,
|
|
3565
|
+
displayValue: w,
|
|
3566
|
+
disabledDates: C,
|
|
3567
|
+
excludeDisabled: W,
|
|
3568
|
+
mode: v = "single",
|
|
3569
|
+
readonly: g = !1,
|
|
3570
|
+
numberOfMonths: p = 1,
|
|
3571
|
+
hideFooter: S = !1,
|
|
3572
|
+
applyLabel: D = "Aplicar",
|
|
3573
|
+
cancelLabel: y = "Cancelar",
|
|
3574
|
+
hideOutsideDays: O = !1,
|
|
3575
|
+
showActionButtons: x = !1
|
|
3576
|
+
} = e, j = ie(() => {
|
|
3577
|
+
if (w) {
|
|
3578
|
+
if (v === "single")
|
|
3579
|
+
return w;
|
|
3580
|
+
if (v === "range") {
|
|
3581
|
+
const _ = w;
|
|
3582
|
+
return _.to ? _.to : _.from ? _.from : void 0;
|
|
3583
|
+
}
|
|
3584
|
+
if (v === "multiple") {
|
|
3585
|
+
const _ = w;
|
|
3586
|
+
return _.length > 0 ? _[_.length - 1] : void 0;
|
|
3587
|
+
}
|
|
3588
|
+
}
|
|
3589
|
+
}, [w, v]), F = ie(() => ({
|
|
3590
|
+
formatWeekdayName: (_) => _.toLocaleDateString("es-ES", { weekday: "narrow" }).toUpperCase()
|
|
3591
|
+
}), []), K = ie(() => ({
|
|
3592
|
+
// Días de la semana (cabecera)
|
|
3593
|
+
weekday: " prometeo-fonts-body-large text-neutral-default-default h-12 w-12 ",
|
|
3594
|
+
// Días del mes
|
|
3595
|
+
day: `w-12 h-12 p-1 prometeo-fonts-body-large text-neutral-default-default ${g ? "" : "active:text-neutral-default-focused"}`,
|
|
3596
|
+
day_button: `w-full h-full rounded-[4px] ${g ? "cursor-default" : "cursor-pointer"}`,
|
|
3597
|
+
// Día seleccionado
|
|
3598
|
+
selected: "selected-day-button",
|
|
3599
|
+
// Día de hoy
|
|
3600
|
+
today: `today-day-button text-primary-default-default! ${g ? "cursor-default" : "active:text-primary-default-focused! hover:text-primary-default-hover! cursor-pointer"} opacity-100`,
|
|
3601
|
+
// Rango de fechas
|
|
3602
|
+
range_start: "text-white rounded-l-lg range-start-day-button",
|
|
3603
|
+
range_end: "text-white rounded-r-lg range-end-day-button",
|
|
3604
|
+
range_middle: "text-neutral-default-default range-middle-day-button",
|
|
3605
|
+
// Día deshabilitado
|
|
3606
|
+
disabled: " opacity-10",
|
|
3607
|
+
// Días fuera del mes actual
|
|
3608
|
+
outside: "text-neutral-medium-default",
|
|
3609
|
+
//Contenedor
|
|
3610
|
+
months: "flex gap-4 justify-center relative w-full flex-wrap overflow-auto ",
|
|
3611
|
+
root: "px-2 text-neutral-default-default "
|
|
3612
|
+
}), [g]), V = ie(() => {
|
|
3613
|
+
if (u) return u;
|
|
3614
|
+
const _ = /* @__PURE__ */ new Date();
|
|
3615
|
+
return new Date(_.getFullYear() + 20, 11, 31);
|
|
3616
|
+
}, [u]), z = ie(() => {
|
|
3617
|
+
const _ = w ? JSON.stringify(w) : "empty";
|
|
3618
|
+
return `${v}-${_}`;
|
|
3619
|
+
}, [v, w]);
|
|
3620
|
+
return /* @__PURE__ */ U.jsxs(
|
|
3621
|
+
"div",
|
|
3622
|
+
{
|
|
3623
|
+
ref: t,
|
|
3624
|
+
className: tt(
|
|
3625
|
+
"border border-neutral-default-default rounded-lg",
|
|
3626
|
+
f
|
|
3627
|
+
),
|
|
3628
|
+
style: {
|
|
3629
|
+
...r,
|
|
3630
|
+
width: p * 360,
|
|
3631
|
+
overflowX: "auto"
|
|
3632
|
+
},
|
|
3633
|
+
children: [
|
|
3634
|
+
i && /* @__PURE__ */ U.jsx("div", { className: "pt-6 pl-6 pr-3 pb-2 min-h-[68px]", children: typeof i == "string" ? /* @__PURE__ */ U.jsx("p", { className: "prometeo-fonts-label-large text-neutral-medium-default w-64 ", children: i }) : i }),
|
|
3635
|
+
v === "single" && /* @__PURE__ */ U.jsx(
|
|
3636
|
+
St,
|
|
3637
|
+
{
|
|
3638
|
+
locale: Dt,
|
|
3639
|
+
mode: "single",
|
|
3640
|
+
captionLayout: "dropdown",
|
|
3641
|
+
formatters: F,
|
|
3642
|
+
classNames: K,
|
|
3643
|
+
required: d,
|
|
3644
|
+
disabled: C,
|
|
3645
|
+
selected: w,
|
|
3646
|
+
defaultMonth: j,
|
|
3647
|
+
className: "px-3",
|
|
3648
|
+
showOutsideDays: !O,
|
|
3649
|
+
numberOfMonths: p,
|
|
3650
|
+
startMonth: M,
|
|
3651
|
+
endMonth: V,
|
|
3652
|
+
onSelect: g ? () => {
|
|
3653
|
+
} : l
|
|
3654
|
+
},
|
|
3655
|
+
z
|
|
3656
|
+
),
|
|
3657
|
+
v === "range" && /* @__PURE__ */ U.jsx(
|
|
3658
|
+
St,
|
|
3659
|
+
{
|
|
3660
|
+
mode: "range",
|
|
3661
|
+
captionLayout: "dropdown",
|
|
3662
|
+
formatters: F,
|
|
3663
|
+
classNames: K,
|
|
3664
|
+
numberOfMonths: p,
|
|
3665
|
+
selected: w,
|
|
3666
|
+
defaultMonth: j,
|
|
3667
|
+
onSelect: g ? () => {
|
|
3668
|
+
} : l,
|
|
3669
|
+
required: d,
|
|
3670
|
+
disabled: C,
|
|
3671
|
+
startMonth: M,
|
|
3672
|
+
endMonth: V,
|
|
3673
|
+
min: o,
|
|
3674
|
+
max: n,
|
|
3675
|
+
pagedNavigation: !0,
|
|
3676
|
+
locale: Dt,
|
|
3677
|
+
excludeDisabled: W ?? !0
|
|
3678
|
+
},
|
|
3679
|
+
z
|
|
3680
|
+
),
|
|
3681
|
+
v === "multiple" && /* @__PURE__ */ U.jsx(
|
|
3682
|
+
St,
|
|
3683
|
+
{
|
|
3684
|
+
mode: "multiple",
|
|
3685
|
+
captionLayout: "dropdown",
|
|
3686
|
+
formatters: F,
|
|
3687
|
+
classNames: K,
|
|
3688
|
+
selected: w,
|
|
3689
|
+
defaultMonth: j,
|
|
3690
|
+
onSelect: g ? () => {
|
|
3691
|
+
} : l,
|
|
3692
|
+
required: d,
|
|
3693
|
+
disabled: C,
|
|
3694
|
+
startMonth: M,
|
|
3695
|
+
endMonth: u,
|
|
3696
|
+
min: o,
|
|
3697
|
+
max: n,
|
|
3698
|
+
locale: Dt
|
|
3699
|
+
},
|
|
3700
|
+
z
|
|
3701
|
+
),
|
|
3702
|
+
!S && /* @__PURE__ */ U.jsx("div", { className: tt(
|
|
3703
|
+
"w-full min-h-[40px] pt-2 px-3 pb-3 flex items-center relative"
|
|
3704
|
+
), children: typeof s == "string" ? /* @__PURE__ */ U.jsx("p", { className: "prometeo-fonts-label-large text-neutral-medium-default w-64 ", children: s }) : s }),
|
|
3705
|
+
x && /* @__PURE__ */ U.jsxs("div", { className: "w-full px-3 pb-3 pt-2 flex gap-2 justify-end ", children: [
|
|
3706
|
+
/* @__PURE__ */ U.jsx(
|
|
3707
|
+
jt,
|
|
3708
|
+
{
|
|
3709
|
+
variant: "text",
|
|
3710
|
+
onClick: c,
|
|
3711
|
+
color: "secondary",
|
|
3712
|
+
children: y
|
|
3713
|
+
}
|
|
3714
|
+
),
|
|
3715
|
+
/* @__PURE__ */ U.jsx(
|
|
3716
|
+
jt,
|
|
3717
|
+
{
|
|
3718
|
+
onClick: a,
|
|
3719
|
+
variant: "text",
|
|
3720
|
+
color: "primary",
|
|
3721
|
+
children: D
|
|
3722
|
+
}
|
|
3723
|
+
)
|
|
3724
|
+
] })
|
|
3725
|
+
]
|
|
3726
|
+
}
|
|
3727
|
+
);
|
|
3728
|
+
});
|
|
3729
|
+
Ct.displayName = "Calendar";
|
|
3730
|
+
export {
|
|
3731
|
+
Ct as C,
|
|
3732
|
+
gs as D
|
|
3733
|
+
};
|