@vonage/vivid 5.0.0 → 5.2.0
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/{shared/definition2.cjs → accordion/definition.cjs} +20 -20
- package/{shared/definition2.js → accordion/definition.js} +5 -7
- package/accordion/index.cjs +5 -5
- package/accordion/index.js +129 -3
- package/accordion-item/definition.cjs +145 -0
- package/accordion-item/definition.js +139 -0
- package/accordion-item/index.cjs +1 -5
- package/accordion-item/index.js +2 -3
- package/{shared/definition3.cjs → action-group/definition.cjs} +12 -9
- package/{shared/definition3.js → action-group/definition.js} +5 -4
- package/action-group/index.cjs +6 -5
- package/action-group/index.js +49 -3
- package/{shared/definition4.cjs → alert/definition.cjs} +33 -31
- package/{shared/definition4.js → alert/definition.js} +11 -11
- package/alert/index.cjs +30 -5
- package/alert/index.js +158 -3
- package/{shared/definition5.cjs → audio-player/definition.cjs} +95 -61
- package/{shared/definition5.js → audio-player/definition.js} +48 -16
- package/audio-player/index.cjs +68 -4
- package/audio-player/index.js +333 -2
- package/{shared/definition6.cjs → avatar/definition.cjs} +28 -26
- package/{shared/definition6.js → avatar/definition.js} +7 -7
- package/avatar/index.cjs +18 -5
- package/avatar/index.js +93 -3
- package/{shared/definition7.cjs → badge/definition.cjs} +18 -16
- package/{shared/definition7.js → badge/definition.js} +6 -6
- package/badge/index.cjs +4 -5
- package/badge/index.js +66 -3
- package/{shared/definition8.cjs → banner/definition.cjs} +26 -25
- package/{shared/definition8.js → banner/definition.js} +10 -11
- package/banner/index.cjs +29 -4
- package/banner/index.js +128 -2
- package/{shared/definition10.cjs → breadcrumb/definition.cjs} +11 -9
- package/{shared/definition10.js → breadcrumb/definition.js} +5 -5
- package/breadcrumb/index.cjs +12 -5
- package/breadcrumb/index.js +69 -3
- package/{shared/definition9.cjs → breadcrumb-item/definition.cjs} +18 -15
- package/{shared/definition9.js → breadcrumb-item/definition.js} +7 -7
- package/breadcrumb-item/index.cjs +5 -5
- package/breadcrumb-item/index.js +33 -3
- package/bundled/_has.cjs +1 -0
- package/bundled/_has.js +34 -0
- package/bundled/affix.cjs +13 -0
- package/bundled/affix.js +63 -0
- package/bundled/anchored.cjs +4 -0
- package/bundled/anchored.js +67 -0
- package/bundled/aria.cjs +1 -0
- package/bundled/aria.js +7 -0
- package/bundled/attribute-binding-behaviour.cjs +1 -0
- package/bundled/attribute-binding-behaviour.js +27 -0
- package/bundled/base-progress.cjs +1 -0
- package/bundled/base-progress.js +57 -0
- package/bundled/breadcrumb-item.cjs +1 -0
- package/bundled/breadcrumb-item.js +21 -0
- package/bundled/button.cjs +1 -0
- package/bundled/button.js +106 -0
- package/bundled/calendar-event.cjs +1 -0
- package/bundled/calendar-event.js +34 -0
- package/bundled/calendar-picker.template.cjs +148 -0
- package/bundled/calendar-picker.template.js +3371 -0
- package/bundled/char-count.cjs +13 -0
- package/bundled/char-count.js +54 -0
- package/bundled/children.cjs +1 -0
- package/bundled/children.js +38 -0
- package/bundled/class-names.cjs +1 -0
- package/bundled/class-names.js +9 -0
- package/bundled/definition.cjs +39 -0
- package/bundled/definition.js +122 -0
- package/bundled/definition10.cjs +19 -0
- package/bundled/definition10.js +73 -0
- package/bundled/definition11.cjs +10 -0
- package/bundled/definition11.js +44 -0
- package/bundled/definition12.cjs +1 -0
- package/bundled/definition12.js +20 -0
- package/bundled/definition13.cjs +73 -0
- package/bundled/definition13.js +359 -0
- package/bundled/definition14.cjs +5 -0
- package/bundled/definition14.js +29 -0
- package/bundled/definition15.cjs +30 -0
- package/bundled/definition15.js +80 -0
- package/bundled/definition16.cjs +19 -0
- package/bundled/definition16.js +103 -0
- package/bundled/definition17.cjs +13 -0
- package/bundled/definition17.js +137 -0
- package/bundled/definition18.cjs +12 -0
- package/bundled/definition18.js +94 -0
- package/bundled/definition19.cjs +70 -0
- package/bundled/definition19.js +674 -0
- package/bundled/definition2.cjs +20 -0
- package/bundled/definition2.js +180 -0
- package/bundled/definition20.cjs +20 -0
- package/bundled/definition20.js +106 -0
- package/bundled/definition21.cjs +5 -0
- package/bundled/definition21.js +19 -0
- package/bundled/definition22.cjs +24 -0
- package/bundled/definition22.js +151 -0
- package/bundled/definition3.cjs +29 -0
- package/bundled/definition3.js +195 -0
- package/bundled/definition4.cjs +6 -0
- package/bundled/definition4.js +42 -0
- package/bundled/definition5.cjs +1 -0
- package/bundled/definition5.js +345 -0
- package/bundled/definition6.cjs +31 -0
- package/bundled/definition6.js +268 -0
- package/bundled/definition7.cjs +30 -0
- package/bundled/definition7.js +288 -0
- package/bundled/definition8.cjs +19 -0
- package/bundled/definition8.js +145 -0
- package/bundled/definition9.cjs +14 -0
- package/bundled/definition9.js +1406 -0
- package/bundled/delegates-aria.cjs +1 -0
- package/bundled/delegates-aria.js +77 -0
- package/bundled/divider.cjs +1 -0
- package/bundled/divider.js +34 -0
- package/bundled/dom.cjs +1 -0
- package/bundled/dom.js +6 -0
- package/bundled/enums.cjs +1 -0
- package/bundled/enums.js +9 -0
- package/bundled/form-associated.cjs +1 -0
- package/bundled/form-associated.js +320 -0
- package/bundled/form-element.cjs +1 -0
- package/bundled/form-element.js +56 -0
- package/bundled/host-semantics.cjs +1 -0
- package/bundled/host-semantics.js +57 -0
- package/bundled/index.cjs +1 -0
- package/bundled/index.js +6 -0
- package/bundled/key-codes.cjs +1 -0
- package/bundled/key-codes.js +16 -0
- package/bundled/linkable.cjs +15 -0
- package/bundled/linkable.js +49 -0
- package/bundled/listbox.cjs +1 -0
- package/bundled/listbox.js +345 -0
- package/bundled/localized.cjs +1 -0
- package/bundled/localized.js +460 -0
- package/bundled/mixins.cjs +33 -0
- package/bundled/mixins.js +226 -0
- package/bundled/numbers.cjs +1 -0
- package/bundled/numbers.js +14 -0
- package/bundled/option.cjs +1 -0
- package/bundled/option.js +158 -0
- package/bundled/picker-field.template.cjs +67 -0
- package/bundled/picker-field.template.js +242 -0
- package/bundled/playbackRates.cjs +1 -0
- package/bundled/playbackRates.js +11 -0
- package/bundled/ref.cjs +1 -0
- package/bundled/ref.js +32 -0
- package/bundled/repeat.cjs +1 -0
- package/bundled/repeat.js +341 -0
- package/bundled/scrollIntoView.cjs +1 -0
- package/bundled/scrollIntoView.js +33 -0
- package/bundled/single-date-picker.cjs +1 -0
- package/bundled/single-date-picker.js +39 -0
- package/bundled/single-value-picker.cjs +1 -0
- package/bundled/single-value-picker.js +87 -0
- package/bundled/slider.template.cjs +41 -0
- package/bundled/slider.template.js +100 -0
- package/bundled/slotted.cjs +1 -0
- package/bundled/slotted.js +81 -0
- package/bundled/strings.cjs +1 -0
- package/bundled/strings.js +7 -0
- package/bundled/text-field.cjs +1 -0
- package/bundled/text-field.js +4 -0
- package/bundled/time-selection-picker.template.cjs +46 -0
- package/bundled/time-selection-picker.template.js +575 -0
- package/bundled/vivid-element.cjs +1 -0
- package/bundled/vivid-element.js +1761 -0
- package/bundled/when.cjs +1 -0
- package/bundled/when.js +11 -0
- package/bundled/with-contextual-help.cjs +1 -0
- package/bundled/with-contextual-help.js +32 -0
- package/bundled/with-error-text.cjs +1 -0
- package/bundled/with-error-text.js +39 -0
- package/bundled/with-success-text.cjs +1 -0
- package/bundled/with-success-text.js +16 -0
- package/button/definition.cjs +14 -0
- package/button/definition.js +4 -0
- package/button/index.cjs +1 -5
- package/button/index.js +2 -3
- package/{shared/definition13.cjs → calendar/definition.cjs} +27 -449
- package/{shared/definition13.js → calendar/definition.js} +7 -431
- package/calendar/index.cjs +53 -5
- package/calendar/index.js +431 -3
- package/{shared/definition12.cjs → calendar-event/definition.cjs} +12 -9
- package/{shared/definition12.js → calendar-event/definition.js} +6 -6
- package/calendar-event/index.cjs +9 -5
- package/calendar-event/index.js +43 -3
- package/card/definition.cjs +186 -0
- package/{shared/definition14.js → card/definition.js} +10 -11
- package/card/index.cjs +47 -5
- package/card/index.js +163 -3
- package/{shared/definition15.cjs → checkbox/definition.cjs} +30 -29
- package/{shared/definition15.js → checkbox/definition.js} +12 -13
- package/checkbox/index.cjs +1 -5
- package/checkbox/index.js +2 -3
- package/{shared/definition16.cjs → combobox/definition.cjs} +61 -56
- package/{shared/definition16.js → combobox/definition.js} +30 -27
- package/combobox/index.cjs +69 -5
- package/combobox/index.js +519 -3
- package/contextual-help/definition.cjs +62 -0
- package/contextual-help/definition.js +57 -0
- package/contextual-help/index.cjs +1 -0
- package/contextual-help/index.js +2 -0
- package/custom-elements.json +2504 -335
- package/{shared/definition17.cjs → data-grid/definition.cjs} +111 -121
- package/{shared/definition17.js → data-grid/definition.js} +11 -23
- package/data-grid/index.cjs +81 -5
- package/data-grid/index.js +1011 -3
- package/{shared/definition18.cjs → date-picker/definition.cjs} +20 -17
- package/{shared/definition18.js → date-picker/definition.js} +12 -11
- package/date-picker/index.cjs +1 -5
- package/date-picker/index.js +115 -3
- package/{shared/definition19.cjs → date-range-picker/definition.cjs} +26 -23
- package/{shared/definition19.js → date-range-picker/definition.js} +10 -9
- package/date-range-picker/index.cjs +1 -5
- package/date-range-picker/index.js +335 -3
- package/{shared/definition20.cjs → date-time-picker/definition.cjs} +27 -24
- package/{shared/definition20.js → date-time-picker/definition.js} +13 -12
- package/date-time-picker/index.cjs +8 -5
- package/date-time-picker/index.js +216 -3
- package/{shared/definition21.cjs → dial-pad/definition.cjs} +89 -40
- package/{shared/definition21.js → dial-pad/definition.js} +60 -13
- package/dial-pad/index.cjs +57 -5
- package/dial-pad/index.js +245 -3
- package/{shared/definition22.cjs → dialog/definition.cjs} +48 -47
- package/{shared/definition22.js → dialog/definition.js} +10 -11
- package/dialog/index.cjs +44 -5
- package/dialog/index.js +257 -3
- package/{shared/definition23.cjs → divider/definition.cjs} +10 -6
- package/{shared/definition23.js → divider/definition.js} +6 -5
- package/divider/index.cjs +1 -5
- package/divider/index.js +2 -3
- package/elevation/definition.cjs +11 -0
- package/elevation/definition.js +2 -0
- package/elevation/index.cjs +1 -5
- package/elevation/index.js +2 -3
- package/empty-state/definition.cjs +81 -0
- package/empty-state/definition.js +75 -0
- package/empty-state/index.cjs +14 -5
- package/empty-state/index.js +64 -3
- package/fab/definition.cjs +105 -0
- package/fab/definition.js +99 -0
- package/fab/index.cjs +20 -5
- package/fab/index.js +86 -3
- package/file-picker/definition.cjs +519 -0
- package/file-picker/definition.js +513 -0
- package/file-picker/index.cjs +61 -5
- package/file-picker/index.js +391 -3
- package/{shared/definition27.cjs → header/definition.cjs} +14 -11
- package/{shared/definition27.js → header/definition.js} +6 -5
- package/header/index.cjs +19 -5
- package/header/index.js +57 -3
- package/{shared/definition28.cjs → icon/definition.cjs} +25 -149
- package/{shared/definition28.js → icon/definition.js} +6 -132
- package/icon/index.cjs +1 -5
- package/icon/index.js +2 -3
- package/index.cjs +268 -264
- package/index.js +72 -71
- package/{shared/definition29.cjs → layout/definition.cjs} +13 -10
- package/{shared/definition29.js → layout/definition.js} +4 -3
- package/layout/index.cjs +3 -5
- package/layout/index.js +52 -3
- package/lib/accordion-item/accordion-item.d.ts +0 -1
- package/lib/action-group/action-group.d.ts +0 -1
- package/lib/alert/alert.d.ts +0 -2
- package/lib/audio-player/audio-player.d.ts +4 -1
- package/lib/avatar/avatar.d.ts +0 -1
- package/lib/badge/badge.d.ts +0 -1
- package/lib/banner/banner.d.ts +0 -3
- package/lib/breadcrumb/breadcrumb.d.ts +0 -1
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +0 -1
- package/lib/button/button.d.ts +1 -3
- package/lib/calendar-event/calendar-event.d.ts +0 -1
- package/lib/card/card.d.ts +0 -1
- package/lib/checkbox/checkbox.d.ts +0 -6
- package/lib/combobox/combobox.d.ts +483 -72
- package/lib/components.d.ts +1 -0
- package/lib/contextual-help/contextual-help.d.ts +5 -0
- package/lib/contextual-help/contextual-help.template.d.ts +3 -0
- package/lib/contextual-help/definition.d.ts +1 -0
- package/lib/data-grid/data-grid-cell.d.ts +0 -2
- package/lib/data-grid/data-grid-row.d.ts +0 -1
- package/lib/date-picker/date-picker.d.ts +892 -888
- package/lib/date-range-picker/date-range-picker.d.ts +590 -588
- package/lib/date-time-picker/date-time-picker.d.ts +893 -889
- package/lib/dial-pad/dial-pad.d.ts +0 -1
- package/lib/dial-pad/dial-pad.template.d.ts +1 -1
- package/lib/dial-pad/locale.d.ts +1 -0
- package/lib/dialog/dialog.d.ts +0 -2
- package/lib/divider/divider.d.ts +0 -1
- package/lib/fab/fab.d.ts +1 -1
- package/lib/file-picker/accept.d.ts +1 -0
- package/lib/file-picker/data-transfer.d.ts +1 -0
- package/lib/file-picker/file-picker.d.ts +490 -91
- package/lib/header/header.d.ts +0 -1
- package/lib/menu/menu.d.ts +1 -2
- package/lib/menu-item/menu-item.d.ts +0 -2
- package/lib/nav/nav.d.ts +0 -1
- package/lib/nav-disclosure/nav-disclosure.d.ts +0 -2
- package/lib/nav-item/nav-item.d.ts +0 -2
- package/lib/note/note.d.ts +0 -1
- package/lib/number-field/number-field.d.ts +505 -96
- package/lib/option/option.d.ts +1 -2
- package/lib/pagination/pagination.d.ts +0 -1
- package/lib/progress/progress.d.ts +0 -1
- package/lib/progress-ring/progress-ring.d.ts +0 -1
- package/lib/radio/radio.d.ts +0 -3
- package/lib/radio-group/radio-group.d.ts +0 -1
- package/lib/range-slider/range-slider.d.ts +0 -3
- package/lib/rich-text-editor/menubar/menubar.d.ts +0 -1
- package/lib/rich-text-editor/rich-text-editor.d.ts +0 -1
- package/lib/searchable-select/option-tag.d.ts +0 -1
- package/lib/searchable-select/searchable-select.d.ts +505 -96
- package/lib/select/select.d.ts +470 -60
- package/lib/selectable-box/selectable-box.d.ts +0 -1
- package/lib/simple-color-picker/definition.d.ts +4 -0
- package/lib/simple-color-picker/locale.d.ts +4 -0
- package/lib/simple-color-picker/simple-color-picker.d.ts +1600 -0
- package/lib/simple-color-picker/simple-color-picker.template.d.ts +3 -0
- package/lib/slider/slider.d.ts +0 -3
- package/lib/split-button/split-button.d.ts +2 -3
- package/lib/switch/switch.d.ts +0 -2
- package/lib/tab/tab.d.ts +0 -3
- package/lib/tab-panel/tab-panel.d.ts +0 -1
- package/lib/tag/tag.d.ts +0 -3
- package/lib/tag-group/tag-group.d.ts +0 -1
- package/lib/tag-name-map.d.ts +2 -1
- package/lib/text-area/text-area.d.ts +494 -84
- package/lib/text-field/text-field.d.ts +505 -96
- package/lib/time-picker/time-picker.d.ts +571 -569
- package/lib/toggletip/toggletip.d.ts +0 -2
- package/lib/tooltip/tooltip.d.ts +0 -1
- package/lib/tree-item/tree-item.d.ts +0 -2
- package/lib/tree-view/tree-view.d.ts +0 -1
- package/lib/video-player/video-player.d.ts +0 -1
- package/locales/de-DE.cjs +13 -1
- package/locales/de-DE.js +13 -1
- package/locales/en-GB.cjs +13 -1
- package/locales/en-GB.js +13 -1
- package/locales/en-US.cjs +13 -1
- package/locales/en-US.js +13 -1
- package/locales/ja-JP.cjs +13 -1
- package/locales/ja-JP.js +13 -1
- package/locales/zh-CN.cjs +13 -1
- package/locales/zh-CN.js +13 -1
- package/{shared/definition31.cjs → menu/definition.cjs} +46 -42
- package/{shared/definition31.js → menu/definition.js} +16 -14
- package/menu/index.cjs +1 -5
- package/menu/index.js +2 -3
- package/menu-item/definition.cjs +14 -0
- package/menu-item/definition.js +3 -0
- package/menu-item/index.cjs +1 -5
- package/menu-item/index.js +2 -3
- package/{shared/definition34.cjs → nav/definition.cjs} +7 -4
- package/{shared/definition34.js → nav/definition.js} +4 -3
- package/nav/index.cjs +5 -5
- package/nav/index.js +13 -3
- package/nav-disclosure/definition.cjs +122 -0
- package/nav-disclosure/definition.js +116 -0
- package/nav-disclosure/index.cjs +16 -5
- package/nav-disclosure/index.js +96 -3
- package/{shared/definition33.cjs → nav-item/definition.cjs} +19 -16
- package/{shared/definition33.js → nav-item/definition.js} +9 -8
- package/nav-item/index.cjs +2 -5
- package/nav-item/index.js +59 -3
- package/{shared/definition35.cjs → note/definition.cjs} +15 -13
- package/{shared/definition35.js → note/definition.js} +6 -6
- package/note/index.cjs +9 -5
- package/note/index.js +44 -3
- package/{shared/definition36.cjs → number-field/definition.cjs} +66 -60
- package/{shared/definition36.js → number-field/definition.js} +31 -27
- package/number-field/index.cjs +60 -5
- package/number-field/index.js +370 -3
- package/option/definition.cjs +84 -0
- package/option/definition.js +78 -0
- package/option/index.cjs +1 -5
- package/option/index.js +2 -3
- package/package.json +15 -4
- package/{shared/definition38.cjs → pagination/definition.cjs} +31 -33
- package/{shared/definition38.js → pagination/definition.js} +7 -11
- package/pagination/index.cjs +43 -5
- package/pagination/index.js +194 -3
- package/popup/definition.cjs +13 -0
- package/popup/definition.js +4 -0
- package/popup/index.cjs +1 -5
- package/popup/index.js +2 -3
- package/{shared/definition40.cjs → progress/definition.cjs} +17 -15
- package/{shared/definition40.js → progress/definition.js} +6 -6
- package/progress/index.cjs +17 -5
- package/progress/index.js +69 -3
- package/{shared/definition39.cjs → progress-ring/definition.cjs} +17 -15
- package/{shared/definition39.js → progress-ring/definition.js} +7 -7
- package/progress-ring/index.cjs +1 -5
- package/progress-ring/index.js +2 -3
- package/{shared/definition42.cjs → radio/definition.cjs} +20 -19
- package/{shared/definition42.js → radio/definition.js} +8 -9
- package/radio/index.cjs +1 -5
- package/radio/index.js +2 -3
- package/{shared/definition41.cjs → radio-group/definition.cjs} +31 -30
- package/{shared/definition41.js → radio-group/definition.js} +8 -9
- package/radio-group/index.cjs +23 -5
- package/radio-group/index.js +255 -3
- package/{shared/definition43.cjs → range-slider/definition.cjs} +62 -61
- package/{shared/definition43.js → range-slider/definition.js} +13 -14
- package/range-slider/index.cjs +68 -5
- package/range-slider/index.js +456 -3
- package/rich-text-editor/definition.cjs +1206 -0
- package/rich-text-editor/definition.js +1200 -0
- package/rich-text-editor/index.cjs +133 -4
- package/rich-text-editor/index.js +10386 -2
- package/{shared/definition45.cjs → searchable-select/definition.cjs} +142 -130
- package/{shared/definition45.js → searchable-select/definition.js} +51 -41
- package/searchable-select/index.cjs +167 -5
- package/searchable-select/index.js +1034 -3
- package/{shared/definition46.cjs → select/definition.cjs} +92 -87
- package/{shared/definition46.js → select/definition.js} +32 -29
- package/select/index.cjs +1 -5
- package/select/index.js +2 -3
- package/{shared/definition47.cjs → selectable-box/definition.cjs} +26 -24
- package/{shared/definition47.js → selectable-box/definition.js} +9 -9
- package/selectable-box/index.cjs +28 -5
- package/selectable-box/index.js +136 -3
- package/shared/aria/aria-mixin.d.ts +0 -1
- package/shared/aria/delegates-aria.d.ts +0 -1
- package/shared/aria/host-semantics.d.ts +0 -1
- package/shared/color-picker/index.d.ts +2 -0
- package/shared/color-picker/types.d.ts +4 -0
- package/shared/color-picker/utils.d.ts +3 -0
- package/shared/feedback/feedback-message.d.ts +0 -1
- package/shared/feedback/mixins.d.ts +0 -2
- package/shared/foundation/button/button.d.ts +0 -2
- package/shared/foundation/form-associated/form-associated.d.ts +0 -2
- package/shared/foundation/vivid-element/vivid-element.d.ts +0 -1
- package/shared/localization/Locale.d.ts +2 -0
- package/shared/patterns/affix.d.ts +0 -2
- package/shared/patterns/anchored.d.ts +0 -2
- package/shared/patterns/char-count/char-count.d.ts +0 -1
- package/shared/patterns/form-elements/form-element.d.ts +0 -2
- package/shared/patterns/form-elements/index.d.ts +1 -0
- package/shared/patterns/form-elements/with-contextual-help.d.ts +1239 -0
- package/shared/patterns/form-elements/with-error-text.d.ts +0 -3
- package/shared/patterns/form-elements/with-success-text.d.ts +0 -1
- package/shared/patterns/linkable.d.ts +0 -1
- package/shared/patterns/localized.d.ts +0 -1
- package/shared/patterns/trapped-focus.d.ts +0 -1
- package/shared/picker-field/mixins/calendar-picker.d.ts +452 -451
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +452 -451
- package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +0 -1
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +594 -592
- package/shared/picker-field/mixins/single-date-picker.d.ts +734 -731
- package/shared/picker-field/mixins/single-value-picker.d.ts +449 -448
- package/shared/picker-field/mixins/time-selection-picker.d.ts +571 -569
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +571 -569
- package/shared/picker-field/picker-field.d.ts +483 -72
- package/{shared/definition48.cjs → side-drawer/definition.cjs} +16 -14
- package/{shared/definition48.js → side-drawer/definition.js} +5 -5
- package/side-drawer/index.cjs +17 -3
- package/side-drawer/index.js +100 -2
- package/simple-color-picker/definition.cjs +398 -0
- package/simple-color-picker/definition.js +392 -0
- package/simple-color-picker/index.cjs +31 -0
- package/simple-color-picker/index.js +250 -0
- package/{shared/definition49.cjs → slider/definition.cjs} +46 -53
- package/{shared/definition49.js → slider/definition.js} +11 -20
- package/slider/index.cjs +1 -5
- package/slider/index.js +2 -3
- package/split-button/definition.cjs +176 -0
- package/split-button/definition.js +170 -0
- package/split-button/index.cjs +26 -5
- package/split-button/index.js +149 -3
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/{shared/definition51.cjs → switch/definition.cjs} +20 -19
- package/{shared/definition51.js → switch/definition.js} +8 -9
- package/switch/index.cjs +16 -5
- package/switch/index.js +102 -3
- package/tab/definition.cjs +127 -0
- package/tab/definition.js +121 -0
- package/tab/index.cjs +1 -5
- package/tab/index.js +2 -3
- package/{shared/definition52.cjs → tab-panel/definition.cjs} +7 -4
- package/{shared/definition52.js → tab-panel/definition.js} +4 -3
- package/tab-panel/index.cjs +1 -5
- package/tab-panel/index.js +2 -3
- package/{shared/definition54.cjs → tabs/definition.cjs} +46 -39
- package/{shared/definition54.js → tabs/definition.js} +18 -13
- package/tabs/index.cjs +31 -5
- package/tabs/index.js +321 -3
- package/tag/definition.cjs +156 -0
- package/tag/definition.js +150 -0
- package/tag/index.cjs +19 -5
- package/tag/index.js +118 -3
- package/{shared/definition55.cjs → tag-group/definition.cjs} +9 -6
- package/{shared/definition55.js → tag-group/definition.js} +5 -4
- package/tag-group/index.cjs +8 -5
- package/tag-group/index.js +26 -3
- package/{shared/definition57.cjs → text-area/definition.cjs} +62 -42
- package/{shared/definition57.js → text-area/definition.js} +38 -20
- package/text-area/index.cjs +41 -5
- package/text-area/index.js +293 -3
- package/{shared/definition58.cjs → text-field/definition.cjs} +70 -52
- package/{shared/definition58.js → text-field/definition.js} +40 -24
- package/text-field/index.cjs +1 -5
- package/text-field/index.js +2 -3
- package/time-picker/definition.cjs +43 -0
- package/{shared/definition59.js → time-picker/definition.js} +9 -8
- package/time-picker/index.cjs +1 -5
- package/time-picker/index.js +29 -3
- package/{shared/definition60.cjs → toggletip/definition.cjs} +20 -18
- package/{shared/definition60.js → toggletip/definition.js} +8 -8
- package/toggletip/index.cjs +1 -5
- package/toggletip/index.js +2 -3
- package/{shared/definition61.cjs → tooltip/definition.cjs} +16 -13
- package/{shared/definition61.js → tooltip/definition.js} +7 -6
- package/tooltip/index.cjs +1 -5
- package/tooltip/index.js +2 -3
- package/tree-item/definition.cjs +13 -0
- package/tree-item/definition.js +3 -0
- package/tree-item/index.cjs +1 -5
- package/tree-item/index.js +2 -3
- package/{shared/definition63.cjs → tree-view/definition.cjs} +41 -42
- package/{shared/definition63.js → tree-view/definition.js} +6 -9
- package/tree-view/index.cjs +13 -5
- package/tree-view/index.js +171 -3
- package/{shared → unbundled}/affix.cjs +10 -11
- package/{shared → unbundled}/affix.js +2 -3
- package/{shared → unbundled}/anchored.cjs +7 -8
- package/{shared → unbundled}/anchored.js +1 -2
- package/{shared → unbundled}/attribute-binding-behaviour.cjs +3 -3
- package/{shared → unbundled}/attribute-binding-behaviour.js +1 -1
- package/{shared → unbundled}/base-progress.cjs +6 -5
- package/{shared → unbundled}/base-progress.js +2 -1
- package/{shared → unbundled}/breadcrumb-item.cjs +3 -2
- package/{shared → unbundled}/breadcrumb-item.js +2 -1
- package/{shared → unbundled}/button.cjs +10 -9
- package/{shared → unbundled}/button.js +2 -1
- package/{shared → unbundled}/calendar-event.cjs +8 -7
- package/{shared → unbundled}/calendar-event.js +2 -1
- package/unbundled/calendar-picker.template.cjs +917 -0
- package/unbundled/calendar-picker.template.js +906 -0
- package/{shared → unbundled}/char-count.cjs +6 -7
- package/{shared → unbundled}/char-count.js +2 -3
- package/unbundled/definition.cjs +225 -0
- package/unbundled/definition.js +220 -0
- package/{shared/definition30.cjs → unbundled/definition2.cjs} +41 -42
- package/{shared/definition30.js → unbundled/definition2.js} +6 -7
- package/unbundled/definition3.cjs +207 -0
- package/{shared/definition62.js → unbundled/definition3.js} +5 -9
- package/unbundled/definition4.cjs +298 -0
- package/unbundled/definition4.js +293 -0
- package/{shared/definition65.cjs → unbundled/definition5.cjs} +7 -6
- package/{shared/definition65.js → unbundled/definition5.js} +3 -2
- package/{shared → unbundled}/delegates-aria.cjs +4 -3
- package/{shared → unbundled}/delegates-aria.js +2 -1
- package/{shared → unbundled}/divider.cjs +5 -4
- package/{shared → unbundled}/divider.js +3 -2
- package/{shared → unbundled}/form-associated.cjs +13 -13
- package/{shared → unbundled}/form-associated.js +2 -2
- package/{shared → unbundled}/form-element.cjs +3 -3
- package/{shared → unbundled}/form-element.js +1 -1
- package/{shared → unbundled}/host-semantics.cjs +2 -1
- package/{shared → unbundled}/host-semantics.js +2 -1
- package/unbundled/key-codes.cjs +10 -0
- package/unbundled/key-codes.js +7 -0
- package/{shared → unbundled}/linkable.cjs +11 -12
- package/{shared → unbundled}/linkable.js +1 -2
- package/{shared → unbundled}/listbox.cjs +21 -37
- package/{shared → unbundled}/listbox.js +3 -19
- package/{shared → unbundled}/localized.cjs +2 -2
- package/{shared → unbundled}/localized.js +1 -1
- package/{shared → unbundled}/mixins.cjs +27 -83
- package/{shared → unbundled}/mixins.js +6 -62
- package/{shared → unbundled}/option.cjs +29 -17
- package/{shared → unbundled}/option.js +14 -2
- package/{shared → unbundled}/picker-field.template.cjs +32 -24
- package/{shared → unbundled}/picker-field.template.js +18 -10
- package/{shared → unbundled}/slider.template.cjs +15 -19
- package/{shared → unbundled}/slider.template.js +3 -7
- package/unbundled/text-field.cjs +5 -0
- package/unbundled/text-field.js +3 -0
- package/{shared → unbundled}/time-selection-picker.template.cjs +28 -30
- package/{shared → unbundled}/time-selection-picker.template.js +4 -6
- package/unbundled/vivid-element.cjs +283 -0
- package/unbundled/vivid-element.js +274 -0
- package/unbundled/with-contextual-help.cjs +40 -0
- package/unbundled/with-contextual-help.js +38 -0
- package/{shared → unbundled}/with-error-text.cjs +2 -2
- package/{shared → unbundled}/with-error-text.js +1 -1
- package/{shared → unbundled}/with-success-text.cjs +2 -2
- package/{shared → unbundled}/with-success-text.js +1 -1
- package/video-player/definition.cjs +536 -0
- package/video-player/definition.js +530 -0
- package/video-player/index.cjs +536 -3
- package/video-player/index.js +35912 -2
- package/{shared/definition66.cjs → visually-hidden/definition.cjs} +6 -3
- package/{shared/definition66.js → visually-hidden/definition.js} +3 -2
- package/visually-hidden/index.cjs +1 -5
- package/visually-hidden/index.js +2 -3
- package/vivid.api.json +722 -799
- package/shared/_has.cjs +0 -58
- package/shared/_has.js +0 -54
- package/shared/aria.cjs +0 -11
- package/shared/aria.js +0 -9
- package/shared/calendar-picker.template.cjs +0 -6377
- package/shared/calendar-picker.template.js +0 -6366
- package/shared/children.cjs +0 -61
- package/shared/children.js +0 -59
- package/shared/class-names.cjs +0 -17
- package/shared/class-names.js +0 -15
- package/shared/definition.cjs +0 -145
- package/shared/definition.js +0 -141
- package/shared/definition11.cjs +0 -220
- package/shared/definition11.js +0 -215
- package/shared/definition14.cjs +0 -185
- package/shared/definition24.cjs +0 -80
- package/shared/definition24.js +0 -76
- package/shared/definition25.cjs +0 -90
- package/shared/definition25.js +0 -86
- package/shared/definition26.cjs +0 -2549
- package/shared/definition26.js +0 -2545
- package/shared/definition32.cjs +0 -120
- package/shared/definition32.js +0 -116
- package/shared/definition37.cjs +0 -71
- package/shared/definition37.js +0 -68
- package/shared/definition44.cjs +0 -14666
- package/shared/definition44.js +0 -14662
- package/shared/definition50.cjs +0 -148
- package/shared/definition50.js +0 -144
- package/shared/definition53.cjs +0 -124
- package/shared/definition53.js +0 -120
- package/shared/definition56.cjs +0 -154
- package/shared/definition56.js +0 -150
- package/shared/definition59.cjs +0 -39
- package/shared/definition62.cjs +0 -211
- package/shared/definition64.cjs +0 -69579
- package/shared/definition64.js +0 -69575
- package/shared/definition67.cjs +0 -2227
- package/shared/definition67.js +0 -2222
- package/shared/dom.cjs +0 -10
- package/shared/dom.js +0 -8
- package/shared/key-codes.cjs +0 -32
- package/shared/key-codes.js +0 -18
- package/shared/numbers.cjs +0 -38
- package/shared/numbers.js +0 -34
- package/shared/ref.cjs +0 -43
- package/shared/ref.js +0 -41
- package/shared/repeat.cjs +0 -767
- package/shared/repeat.js +0 -764
- package/shared/slotted.cjs +0 -123
- package/shared/slotted.js +0 -119
- package/shared/strings.cjs +0 -11
- package/shared/strings.js +0 -9
- package/shared/text-field.cjs +0 -5
- package/shared/text-field.js +0 -3
- package/shared/vivid-element.cjs +0 -2822
- package/shared/vivid-element.js +0 -2799
- package/shared/when.cjs +0 -31
- package/shared/when.js +0 -29
- /package/{shared → unbundled}/enums.cjs +0 -0
- /package/{shared → unbundled}/enums.js +0 -0
- /package/{shared → unbundled}/index.cjs +0 -0
- /package/{shared → unbundled}/index.js +0 -0
- /package/{shared → unbundled}/playbackRates.cjs +0 -0
- /package/{shared → unbundled}/playbackRates.js +0 -0
- /package/{shared → unbundled}/scrollIntoView.cjs +0 -0
- /package/{shared → unbundled}/scrollIntoView.js +0 -0
- /package/{shared → unbundled}/single-date-picker.cjs +0 -0
- /package/{shared → unbundled}/single-date-picker.js +0 -0
- /package/{shared → unbundled}/single-value-picker.cjs +0 -0
- /package/{shared → unbundled}/single-value-picker.js +0 -0
|
@@ -0,0 +1,3371 @@
|
|
|
1
|
+
import { o as H, v as V, D as U, a as ue, h as x } from "./vivid-element.js";
|
|
2
|
+
import { D as _e } from "./divider.js";
|
|
3
|
+
import { B as Le } from "./definition3.js";
|
|
4
|
+
import { V as ve } from "./definition12.js";
|
|
5
|
+
import { r as F } from "./repeat.js";
|
|
6
|
+
import { w as D } from "./when.js";
|
|
7
|
+
import { c as Me } from "./class-names.js";
|
|
8
|
+
const lr = '.segments{display:inline-flex;gap:24px}.segment{display:flex;flex-direction:column;gap:12px}.segment .header{display:flex;align-items:center;padding-block:8px}.segment .title{display:flex;flex-grow:1;justify-content:center}.segment .title-action{border-radius:8px;block-size:24px;font:var(--vvd-typography-base-extended);padding-inline:8px}.calendar{display:flex;flex-direction:column;margin-top:8px;gap:4px}.calendar .calendar-separator{margin-inline:10px}.calendar .calendar-weekdays{display:flex;justify-content:center}.calendar .calendar-weekday{display:inline-flex;align-items:center;justify-content:center;block-size:16px;font:var(--vvd-typography-base-condensed);inline-size:40px}.calendar .calendar-week{display:flex;justify-content:center}.calendar .calendar-day{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;aspect-ratio:1/1;block-size:28px;font:var(--vvd-typography-base);margin-inline:6px}.calendar .calendar-day.start,.calendar .calendar-day.end{border:2px solid var(--vvd-color-cta-50);background-color:var(--vvd-color-cta-200)}.calendar:focus-visible .calendar .calendar-day.start,.calendar:focus-visible .calendar .calendar-day.end{border-width:3px}.calendar .calendar-day:before,.calendar .calendar-day:after{position:absolute;z-index:-1;display:block;width:20px;height:28px}.calendar .calendar-day:before{right:50%}.calendar .calendar-day:after{left:50%}.calendar .calendar-day.range:before,.calendar .calendar-day.range:after{background-color:var(--vvd-color-cta-50)}.calendar .calendar-day.range:not(.start):before,.calendar .calendar-day.range:not(.end):after{content:""}.calendar .calendar-day.outside-month,.calendar .calendar-day:disabled{color:var(--vvd-color-neutral-400)}.months-separator{margin-inline:-12px}.month-grid{display:flex;flex-direction:column;gap:34px}.month-grid .months-row{display:flex;justify-content:center;gap:29px}.month-grid .month{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;aspect-ratio:1/1;block-size:48px;font:var(--vvd-typography-base-extended);text-transform:uppercase}.month-grid .month:disabled{color:var(--vvd-color-neutral-400)}.button{--_connotation-color-primary: var(--vvd-date-picker-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-firm: var(--vvd-date-picker-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-faint: var(--vvd-date-picker-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-date-picker-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-dim: var(--vvd-date-picker-accent-dim, var(--vvd-color-neutral-200));--_connotation-color-pale: var(--vvd-date-picker-accent-pale, var(--vvd-color-neutral-300))}.button{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}@media (hover: hover){.button:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}}.button.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.button:active:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.button.active:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.button.selected:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}@media (hover: hover){.button.selected:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}}.button.selected.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}.button.selected:disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: transparent}.button.selected.disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: transparent}.button{position:relative;padding:0;border:none;background-color:var(--_appearance-color-fill);color:var(--_appearance-color-text);cursor:pointer}.button:disabled{cursor:not-allowed}.button:focus:not(.title-action),.button.title-action:focus-visible{--focus-stroke-gap-color: transparent;color:var(--vvd-color-canvas-text);box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}.button:focus:not(.title-action).start,.button:focus:not(.title-action).end,.button.title-action:focus-visible.start,.button.title-action:focus-visible.end{border-width:3px}.button.current{border:1px solid var(--vvd-color-neutral-200)}.button.selected{border:1px solid var(--vvd-color-neutral-900)}';
|
|
9
|
+
function _(r) {
|
|
10
|
+
const e = Object.prototype.toString.call(r);
|
|
11
|
+
return r instanceof Date || typeof r == "object" && e === "[object Date]" ? new r.constructor(+r) : typeof r == "number" || e === "[object Number]" || typeof r == "string" || e === "[object String]" ? new Date(r) : /* @__PURE__ */ new Date(NaN);
|
|
12
|
+
}
|
|
13
|
+
function w(r, e) {
|
|
14
|
+
return r instanceof Date ? new r.constructor(e) : new Date(e);
|
|
15
|
+
}
|
|
16
|
+
function ne(r, e) {
|
|
17
|
+
const n = _(r);
|
|
18
|
+
return isNaN(e) ? w(r, NaN) : (e && n.setDate(n.getDate() + e), n);
|
|
19
|
+
}
|
|
20
|
+
const ke = 6048e5, He = 864e5, Re = 6e4, Qe = 36e5, Be = 1e3;
|
|
21
|
+
let Ae = {};
|
|
22
|
+
function L() {
|
|
23
|
+
return Ae;
|
|
24
|
+
}
|
|
25
|
+
function $(r, e) {
|
|
26
|
+
const n = L(), t = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, a = _(r), o = a.getDay(), s = (o < t ? 7 : 0) + o - t;
|
|
27
|
+
return a.setDate(a.getDate() - s), a.setHours(0, 0, 0, 0), a;
|
|
28
|
+
}
|
|
29
|
+
function I(r) {
|
|
30
|
+
return $(r, { weekStartsOn: 1 });
|
|
31
|
+
}
|
|
32
|
+
function De(r) {
|
|
33
|
+
const e = _(r), n = e.getFullYear(), t = w(r, 0);
|
|
34
|
+
t.setFullYear(n + 1, 0, 4), t.setHours(0, 0, 0, 0);
|
|
35
|
+
const a = I(t), o = w(r, 0);
|
|
36
|
+
o.setFullYear(n, 0, 4), o.setHours(0, 0, 0, 0);
|
|
37
|
+
const s = I(o);
|
|
38
|
+
return e.getTime() >= a.getTime() ? n + 1 : e.getTime() >= s.getTime() ? n : n - 1;
|
|
39
|
+
}
|
|
40
|
+
function de(r) {
|
|
41
|
+
const e = _(r);
|
|
42
|
+
return e.setHours(0, 0, 0, 0), e;
|
|
43
|
+
}
|
|
44
|
+
function X(r) {
|
|
45
|
+
const e = _(r), n = new Date(
|
|
46
|
+
Date.UTC(
|
|
47
|
+
e.getFullYear(),
|
|
48
|
+
e.getMonth(),
|
|
49
|
+
e.getDate(),
|
|
50
|
+
e.getHours(),
|
|
51
|
+
e.getMinutes(),
|
|
52
|
+
e.getSeconds(),
|
|
53
|
+
e.getMilliseconds()
|
|
54
|
+
)
|
|
55
|
+
);
|
|
56
|
+
return n.setUTCFullYear(e.getFullYear()), +r - +n;
|
|
57
|
+
}
|
|
58
|
+
function Ve(r, e) {
|
|
59
|
+
const n = de(r), t = de(e), a = +n - X(n), o = +t - X(t);
|
|
60
|
+
return Math.round((a - o) / He);
|
|
61
|
+
}
|
|
62
|
+
function Ge(r) {
|
|
63
|
+
const e = De(r), n = w(r, 0);
|
|
64
|
+
return n.setFullYear(e, 0, 4), n.setHours(0, 0, 0, 0), I(n);
|
|
65
|
+
}
|
|
66
|
+
function Xe(r) {
|
|
67
|
+
return r instanceof Date || typeof r == "object" && Object.prototype.toString.call(r) === "[object Date]";
|
|
68
|
+
}
|
|
69
|
+
function je(r) {
|
|
70
|
+
if (!Xe(r) && typeof r != "number")
|
|
71
|
+
return !1;
|
|
72
|
+
const e = _(r);
|
|
73
|
+
return !isNaN(Number(e));
|
|
74
|
+
}
|
|
75
|
+
function ze(r) {
|
|
76
|
+
const e = _(r), n = w(r, 0);
|
|
77
|
+
return n.setFullYear(e.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
78
|
+
}
|
|
79
|
+
const Ke = {
|
|
80
|
+
lessThanXSeconds: {
|
|
81
|
+
one: "less than a second",
|
|
82
|
+
other: "less than {{count}} seconds"
|
|
83
|
+
},
|
|
84
|
+
xSeconds: {
|
|
85
|
+
one: "1 second",
|
|
86
|
+
other: "{{count}} seconds"
|
|
87
|
+
},
|
|
88
|
+
halfAMinute: "half a minute",
|
|
89
|
+
lessThanXMinutes: {
|
|
90
|
+
one: "less than a minute",
|
|
91
|
+
other: "less than {{count}} minutes"
|
|
92
|
+
},
|
|
93
|
+
xMinutes: {
|
|
94
|
+
one: "1 minute",
|
|
95
|
+
other: "{{count}} minutes"
|
|
96
|
+
},
|
|
97
|
+
aboutXHours: {
|
|
98
|
+
one: "about 1 hour",
|
|
99
|
+
other: "about {{count}} hours"
|
|
100
|
+
},
|
|
101
|
+
xHours: {
|
|
102
|
+
one: "1 hour",
|
|
103
|
+
other: "{{count}} hours"
|
|
104
|
+
},
|
|
105
|
+
xDays: {
|
|
106
|
+
one: "1 day",
|
|
107
|
+
other: "{{count}} days"
|
|
108
|
+
},
|
|
109
|
+
aboutXWeeks: {
|
|
110
|
+
one: "about 1 week",
|
|
111
|
+
other: "about {{count}} weeks"
|
|
112
|
+
},
|
|
113
|
+
xWeeks: {
|
|
114
|
+
one: "1 week",
|
|
115
|
+
other: "{{count}} weeks"
|
|
116
|
+
},
|
|
117
|
+
aboutXMonths: {
|
|
118
|
+
one: "about 1 month",
|
|
119
|
+
other: "about {{count}} months"
|
|
120
|
+
},
|
|
121
|
+
xMonths: {
|
|
122
|
+
one: "1 month",
|
|
123
|
+
other: "{{count}} months"
|
|
124
|
+
},
|
|
125
|
+
aboutXYears: {
|
|
126
|
+
one: "about 1 year",
|
|
127
|
+
other: "about {{count}} years"
|
|
128
|
+
},
|
|
129
|
+
xYears: {
|
|
130
|
+
one: "1 year",
|
|
131
|
+
other: "{{count}} years"
|
|
132
|
+
},
|
|
133
|
+
overXYears: {
|
|
134
|
+
one: "over 1 year",
|
|
135
|
+
other: "over {{count}} years"
|
|
136
|
+
},
|
|
137
|
+
almostXYears: {
|
|
138
|
+
one: "almost 1 year",
|
|
139
|
+
other: "almost {{count}} years"
|
|
140
|
+
}
|
|
141
|
+
}, Je = (r, e, n) => {
|
|
142
|
+
let t;
|
|
143
|
+
const a = Ke[r];
|
|
144
|
+
return typeof a == "string" ? t = a : e === 1 ? t = a.one : t = a.other.replace("{{count}}", e.toString()), n?.addSuffix ? n.comparison && n.comparison > 0 ? "in " + t : t + " ago" : t;
|
|
145
|
+
};
|
|
146
|
+
function Z(r) {
|
|
147
|
+
return (e = {}) => {
|
|
148
|
+
const n = e.width ? String(e.width) : r.defaultWidth;
|
|
149
|
+
return r.formats[n] || r.formats[r.defaultWidth];
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
const Ue = {
|
|
153
|
+
full: "EEEE, MMMM do, y",
|
|
154
|
+
long: "MMMM do, y",
|
|
155
|
+
medium: "MMM d, y",
|
|
156
|
+
short: "MM/dd/yyyy"
|
|
157
|
+
}, Ze = {
|
|
158
|
+
full: "h:mm:ss a zzzz",
|
|
159
|
+
long: "h:mm:ss a z",
|
|
160
|
+
medium: "h:mm:ss a",
|
|
161
|
+
short: "h:mm a"
|
|
162
|
+
}, Se = {
|
|
163
|
+
full: "{{date}} 'at' {{time}}",
|
|
164
|
+
long: "{{date}} 'at' {{time}}",
|
|
165
|
+
medium: "{{date}}, {{time}}",
|
|
166
|
+
short: "{{date}}, {{time}}"
|
|
167
|
+
}, et = {
|
|
168
|
+
date: Z({
|
|
169
|
+
formats: Ue,
|
|
170
|
+
defaultWidth: "full"
|
|
171
|
+
}),
|
|
172
|
+
time: Z({
|
|
173
|
+
formats: Ze,
|
|
174
|
+
defaultWidth: "full"
|
|
175
|
+
}),
|
|
176
|
+
dateTime: Z({
|
|
177
|
+
formats: Se,
|
|
178
|
+
defaultWidth: "full"
|
|
179
|
+
})
|
|
180
|
+
}, tt = {
|
|
181
|
+
lastWeek: "'last' eeee 'at' p",
|
|
182
|
+
yesterday: "'yesterday at' p",
|
|
183
|
+
today: "'today at' p",
|
|
184
|
+
tomorrow: "'tomorrow at' p",
|
|
185
|
+
nextWeek: "eeee 'at' p",
|
|
186
|
+
other: "P"
|
|
187
|
+
}, nt = (r, e, n, t) => tt[r];
|
|
188
|
+
function R(r) {
|
|
189
|
+
return (e, n) => {
|
|
190
|
+
const t = n?.context ? String(n.context) : "standalone";
|
|
191
|
+
let a;
|
|
192
|
+
if (t === "formatting" && r.formattingValues) {
|
|
193
|
+
const s = r.defaultFormattingWidth || r.defaultWidth, i = n?.width ? String(n.width) : s;
|
|
194
|
+
a = r.formattingValues[i] || r.formattingValues[s];
|
|
195
|
+
} else {
|
|
196
|
+
const s = r.defaultWidth, i = n?.width ? String(n.width) : r.defaultWidth;
|
|
197
|
+
a = r.values[i] || r.values[s];
|
|
198
|
+
}
|
|
199
|
+
const o = r.argumentCallback ? r.argumentCallback(e) : e;
|
|
200
|
+
return a[o];
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
const rt = {
|
|
204
|
+
narrow: ["B", "A"],
|
|
205
|
+
abbreviated: ["BC", "AD"],
|
|
206
|
+
wide: ["Before Christ", "Anno Domini"]
|
|
207
|
+
}, at = {
|
|
208
|
+
narrow: ["1", "2", "3", "4"],
|
|
209
|
+
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
210
|
+
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
211
|
+
}, ot = {
|
|
212
|
+
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
213
|
+
abbreviated: [
|
|
214
|
+
"Jan",
|
|
215
|
+
"Feb",
|
|
216
|
+
"Mar",
|
|
217
|
+
"Apr",
|
|
218
|
+
"May",
|
|
219
|
+
"Jun",
|
|
220
|
+
"Jul",
|
|
221
|
+
"Aug",
|
|
222
|
+
"Sep",
|
|
223
|
+
"Oct",
|
|
224
|
+
"Nov",
|
|
225
|
+
"Dec"
|
|
226
|
+
],
|
|
227
|
+
wide: [
|
|
228
|
+
"January",
|
|
229
|
+
"February",
|
|
230
|
+
"March",
|
|
231
|
+
"April",
|
|
232
|
+
"May",
|
|
233
|
+
"June",
|
|
234
|
+
"July",
|
|
235
|
+
"August",
|
|
236
|
+
"September",
|
|
237
|
+
"October",
|
|
238
|
+
"November",
|
|
239
|
+
"December"
|
|
240
|
+
]
|
|
241
|
+
}, st = {
|
|
242
|
+
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
243
|
+
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
244
|
+
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
245
|
+
wide: [
|
|
246
|
+
"Sunday",
|
|
247
|
+
"Monday",
|
|
248
|
+
"Tuesday",
|
|
249
|
+
"Wednesday",
|
|
250
|
+
"Thursday",
|
|
251
|
+
"Friday",
|
|
252
|
+
"Saturday"
|
|
253
|
+
]
|
|
254
|
+
}, it = {
|
|
255
|
+
narrow: {
|
|
256
|
+
am: "a",
|
|
257
|
+
pm: "p",
|
|
258
|
+
midnight: "mi",
|
|
259
|
+
noon: "n",
|
|
260
|
+
morning: "morning",
|
|
261
|
+
afternoon: "afternoon",
|
|
262
|
+
evening: "evening",
|
|
263
|
+
night: "night"
|
|
264
|
+
},
|
|
265
|
+
abbreviated: {
|
|
266
|
+
am: "AM",
|
|
267
|
+
pm: "PM",
|
|
268
|
+
midnight: "midnight",
|
|
269
|
+
noon: "noon",
|
|
270
|
+
morning: "morning",
|
|
271
|
+
afternoon: "afternoon",
|
|
272
|
+
evening: "evening",
|
|
273
|
+
night: "night"
|
|
274
|
+
},
|
|
275
|
+
wide: {
|
|
276
|
+
am: "a.m.",
|
|
277
|
+
pm: "p.m.",
|
|
278
|
+
midnight: "midnight",
|
|
279
|
+
noon: "noon",
|
|
280
|
+
morning: "morning",
|
|
281
|
+
afternoon: "afternoon",
|
|
282
|
+
evening: "evening",
|
|
283
|
+
night: "night"
|
|
284
|
+
}
|
|
285
|
+
}, ct = {
|
|
286
|
+
narrow: {
|
|
287
|
+
am: "a",
|
|
288
|
+
pm: "p",
|
|
289
|
+
midnight: "mi",
|
|
290
|
+
noon: "n",
|
|
291
|
+
morning: "in the morning",
|
|
292
|
+
afternoon: "in the afternoon",
|
|
293
|
+
evening: "in the evening",
|
|
294
|
+
night: "at night"
|
|
295
|
+
},
|
|
296
|
+
abbreviated: {
|
|
297
|
+
am: "AM",
|
|
298
|
+
pm: "PM",
|
|
299
|
+
midnight: "midnight",
|
|
300
|
+
noon: "noon",
|
|
301
|
+
morning: "in the morning",
|
|
302
|
+
afternoon: "in the afternoon",
|
|
303
|
+
evening: "in the evening",
|
|
304
|
+
night: "at night"
|
|
305
|
+
},
|
|
306
|
+
wide: {
|
|
307
|
+
am: "a.m.",
|
|
308
|
+
pm: "p.m.",
|
|
309
|
+
midnight: "midnight",
|
|
310
|
+
noon: "noon",
|
|
311
|
+
morning: "in the morning",
|
|
312
|
+
afternoon: "in the afternoon",
|
|
313
|
+
evening: "in the evening",
|
|
314
|
+
night: "at night"
|
|
315
|
+
}
|
|
316
|
+
}, lt = (r, e) => {
|
|
317
|
+
const n = Number(r), t = n % 100;
|
|
318
|
+
if (t > 20 || t < 10)
|
|
319
|
+
switch (t % 10) {
|
|
320
|
+
case 1:
|
|
321
|
+
return n + "st";
|
|
322
|
+
case 2:
|
|
323
|
+
return n + "nd";
|
|
324
|
+
case 3:
|
|
325
|
+
return n + "rd";
|
|
326
|
+
}
|
|
327
|
+
return n + "th";
|
|
328
|
+
}, ut = {
|
|
329
|
+
ordinalNumber: lt,
|
|
330
|
+
era: R({
|
|
331
|
+
values: rt,
|
|
332
|
+
defaultWidth: "wide"
|
|
333
|
+
}),
|
|
334
|
+
quarter: R({
|
|
335
|
+
values: at,
|
|
336
|
+
defaultWidth: "wide",
|
|
337
|
+
argumentCallback: (r) => r - 1
|
|
338
|
+
}),
|
|
339
|
+
month: R({
|
|
340
|
+
values: ot,
|
|
341
|
+
defaultWidth: "wide"
|
|
342
|
+
}),
|
|
343
|
+
day: R({
|
|
344
|
+
values: st,
|
|
345
|
+
defaultWidth: "wide"
|
|
346
|
+
}),
|
|
347
|
+
dayPeriod: R({
|
|
348
|
+
values: it,
|
|
349
|
+
defaultWidth: "wide",
|
|
350
|
+
formattingValues: ct,
|
|
351
|
+
defaultFormattingWidth: "wide"
|
|
352
|
+
})
|
|
353
|
+
};
|
|
354
|
+
function Q(r) {
|
|
355
|
+
return (e, n = {}) => {
|
|
356
|
+
const t = n.width, a = t && r.matchPatterns[t] || r.matchPatterns[r.defaultMatchWidth], o = e.match(a);
|
|
357
|
+
if (!o)
|
|
358
|
+
return null;
|
|
359
|
+
const s = o[0], i = t && r.parsePatterns[t] || r.parsePatterns[r.defaultParseWidth], h = Array.isArray(i) ? ht(i, (d) => d.test(s)) : (
|
|
360
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
|
361
|
+
dt(i, (d) => d.test(s))
|
|
362
|
+
);
|
|
363
|
+
let v;
|
|
364
|
+
v = r.valueCallback ? r.valueCallback(h) : h, v = n.valueCallback ? (
|
|
365
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
|
366
|
+
n.valueCallback(v)
|
|
367
|
+
) : v;
|
|
368
|
+
const f = e.slice(s.length);
|
|
369
|
+
return { value: v, rest: f };
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
function dt(r, e) {
|
|
373
|
+
for (const n in r)
|
|
374
|
+
if (Object.prototype.hasOwnProperty.call(r, n) && e(r[n]))
|
|
375
|
+
return n;
|
|
376
|
+
}
|
|
377
|
+
function ht(r, e) {
|
|
378
|
+
for (let n = 0; n < r.length; n++)
|
|
379
|
+
if (e(r[n]))
|
|
380
|
+
return n;
|
|
381
|
+
}
|
|
382
|
+
function ft(r) {
|
|
383
|
+
return (e, n = {}) => {
|
|
384
|
+
const t = e.match(r.matchPattern);
|
|
385
|
+
if (!t) return null;
|
|
386
|
+
const a = t[0], o = e.match(r.parsePattern);
|
|
387
|
+
if (!o) return null;
|
|
388
|
+
let s = r.valueCallback ? r.valueCallback(o[0]) : o[0];
|
|
389
|
+
s = n.valueCallback ? n.valueCallback(s) : s;
|
|
390
|
+
const i = e.slice(a.length);
|
|
391
|
+
return { value: s, rest: i };
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
const pt = /^(\d+)(th|st|nd|rd)?/i, mt = /\d+/i, wt = {
|
|
395
|
+
narrow: /^(b|a)/i,
|
|
396
|
+
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
397
|
+
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
398
|
+
}, bt = {
|
|
399
|
+
any: [/^b/i, /^(a|c)/i]
|
|
400
|
+
}, yt = {
|
|
401
|
+
narrow: /^[1234]/i,
|
|
402
|
+
abbreviated: /^q[1234]/i,
|
|
403
|
+
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
404
|
+
}, gt = {
|
|
405
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
406
|
+
}, xt = {
|
|
407
|
+
narrow: /^[jfmasond]/i,
|
|
408
|
+
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
409
|
+
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
410
|
+
}, _t = {
|
|
411
|
+
narrow: [
|
|
412
|
+
/^j/i,
|
|
413
|
+
/^f/i,
|
|
414
|
+
/^m/i,
|
|
415
|
+
/^a/i,
|
|
416
|
+
/^m/i,
|
|
417
|
+
/^j/i,
|
|
418
|
+
/^j/i,
|
|
419
|
+
/^a/i,
|
|
420
|
+
/^s/i,
|
|
421
|
+
/^o/i,
|
|
422
|
+
/^n/i,
|
|
423
|
+
/^d/i
|
|
424
|
+
],
|
|
425
|
+
any: [
|
|
426
|
+
/^ja/i,
|
|
427
|
+
/^f/i,
|
|
428
|
+
/^mar/i,
|
|
429
|
+
/^ap/i,
|
|
430
|
+
/^may/i,
|
|
431
|
+
/^jun/i,
|
|
432
|
+
/^jul/i,
|
|
433
|
+
/^au/i,
|
|
434
|
+
/^s/i,
|
|
435
|
+
/^o/i,
|
|
436
|
+
/^n/i,
|
|
437
|
+
/^d/i
|
|
438
|
+
]
|
|
439
|
+
}, vt = {
|
|
440
|
+
narrow: /^[smtwf]/i,
|
|
441
|
+
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
442
|
+
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
443
|
+
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
444
|
+
}, Mt = {
|
|
445
|
+
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
446
|
+
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
447
|
+
}, kt = {
|
|
448
|
+
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
449
|
+
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
450
|
+
}, Dt = {
|
|
451
|
+
any: {
|
|
452
|
+
am: /^a/i,
|
|
453
|
+
pm: /^p/i,
|
|
454
|
+
midnight: /^mi/i,
|
|
455
|
+
noon: /^no/i,
|
|
456
|
+
morning: /morning/i,
|
|
457
|
+
afternoon: /afternoon/i,
|
|
458
|
+
evening: /evening/i,
|
|
459
|
+
night: /night/i
|
|
460
|
+
}
|
|
461
|
+
}, Pt = {
|
|
462
|
+
ordinalNumber: ft({
|
|
463
|
+
matchPattern: pt,
|
|
464
|
+
parsePattern: mt,
|
|
465
|
+
valueCallback: (r) => parseInt(r, 10)
|
|
466
|
+
}),
|
|
467
|
+
era: Q({
|
|
468
|
+
matchPatterns: wt,
|
|
469
|
+
defaultMatchWidth: "wide",
|
|
470
|
+
parsePatterns: bt,
|
|
471
|
+
defaultParseWidth: "any"
|
|
472
|
+
}),
|
|
473
|
+
quarter: Q({
|
|
474
|
+
matchPatterns: yt,
|
|
475
|
+
defaultMatchWidth: "wide",
|
|
476
|
+
parsePatterns: gt,
|
|
477
|
+
defaultParseWidth: "any",
|
|
478
|
+
valueCallback: (r) => r + 1
|
|
479
|
+
}),
|
|
480
|
+
month: Q({
|
|
481
|
+
matchPatterns: xt,
|
|
482
|
+
defaultMatchWidth: "wide",
|
|
483
|
+
parsePatterns: _t,
|
|
484
|
+
defaultParseWidth: "any"
|
|
485
|
+
}),
|
|
486
|
+
day: Q({
|
|
487
|
+
matchPatterns: vt,
|
|
488
|
+
defaultMatchWidth: "wide",
|
|
489
|
+
parsePatterns: Mt,
|
|
490
|
+
defaultParseWidth: "any"
|
|
491
|
+
}),
|
|
492
|
+
dayPeriod: Q({
|
|
493
|
+
matchPatterns: kt,
|
|
494
|
+
defaultMatchWidth: "any",
|
|
495
|
+
parsePatterns: Dt,
|
|
496
|
+
defaultParseWidth: "any"
|
|
497
|
+
})
|
|
498
|
+
}, Pe = {
|
|
499
|
+
code: "en-US",
|
|
500
|
+
formatDistance: Je,
|
|
501
|
+
formatLong: et,
|
|
502
|
+
formatRelative: nt,
|
|
503
|
+
localize: ut,
|
|
504
|
+
match: Pt,
|
|
505
|
+
options: {
|
|
506
|
+
weekStartsOn: 0,
|
|
507
|
+
firstWeekContainsDate: 1
|
|
508
|
+
}
|
|
509
|
+
};
|
|
510
|
+
function Tt(r) {
|
|
511
|
+
const e = _(r);
|
|
512
|
+
return Ve(e, ze(e)) + 1;
|
|
513
|
+
}
|
|
514
|
+
function Te(r) {
|
|
515
|
+
const e = _(r), n = +I(e) - +Ge(e);
|
|
516
|
+
return Math.round(n / ke) + 1;
|
|
517
|
+
}
|
|
518
|
+
function re(r, e) {
|
|
519
|
+
const n = _(r), t = n.getFullYear(), a = L(), o = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? a.firstWeekContainsDate ?? a.locale?.options?.firstWeekContainsDate ?? 1, s = w(r, 0);
|
|
520
|
+
s.setFullYear(t + 1, 0, o), s.setHours(0, 0, 0, 0);
|
|
521
|
+
const i = $(s, e), h = w(r, 0);
|
|
522
|
+
h.setFullYear(t, 0, o), h.setHours(0, 0, 0, 0);
|
|
523
|
+
const v = $(h, e);
|
|
524
|
+
return n.getTime() >= i.getTime() ? t + 1 : n.getTime() >= v.getTime() ? t : t - 1;
|
|
525
|
+
}
|
|
526
|
+
function Yt(r, e) {
|
|
527
|
+
const n = L(), t = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, a = re(r, e), o = w(r, 0);
|
|
528
|
+
return o.setFullYear(a, 0, t), o.setHours(0, 0, 0, 0), $(o, e);
|
|
529
|
+
}
|
|
530
|
+
function Ye(r, e) {
|
|
531
|
+
const n = _(r), t = +$(n, e) - +Yt(n, e);
|
|
532
|
+
return Math.round(t / ke) + 1;
|
|
533
|
+
}
|
|
534
|
+
function l(r, e) {
|
|
535
|
+
const n = r < 0 ? "-" : "", t = Math.abs(r).toString().padStart(e, "0");
|
|
536
|
+
return n + t;
|
|
537
|
+
}
|
|
538
|
+
const C = {
|
|
539
|
+
// Year
|
|
540
|
+
y(r, e) {
|
|
541
|
+
const n = r.getFullYear(), t = n > 0 ? n : 1 - n;
|
|
542
|
+
return l(e === "yy" ? t % 100 : t, e.length);
|
|
543
|
+
},
|
|
544
|
+
// Month
|
|
545
|
+
M(r, e) {
|
|
546
|
+
const n = r.getMonth();
|
|
547
|
+
return e === "M" ? String(n + 1) : l(n + 1, 2);
|
|
548
|
+
},
|
|
549
|
+
// Day of the month
|
|
550
|
+
d(r, e) {
|
|
551
|
+
return l(r.getDate(), e.length);
|
|
552
|
+
},
|
|
553
|
+
// AM or PM
|
|
554
|
+
a(r, e) {
|
|
555
|
+
const n = r.getHours() / 12 >= 1 ? "pm" : "am";
|
|
556
|
+
switch (e) {
|
|
557
|
+
case "a":
|
|
558
|
+
case "aa":
|
|
559
|
+
return n.toUpperCase();
|
|
560
|
+
case "aaa":
|
|
561
|
+
return n;
|
|
562
|
+
case "aaaaa":
|
|
563
|
+
return n[0];
|
|
564
|
+
case "aaaa":
|
|
565
|
+
default:
|
|
566
|
+
return n === "am" ? "a.m." : "p.m.";
|
|
567
|
+
}
|
|
568
|
+
},
|
|
569
|
+
// Hour [1-12]
|
|
570
|
+
h(r, e) {
|
|
571
|
+
return l(r.getHours() % 12 || 12, e.length);
|
|
572
|
+
},
|
|
573
|
+
// Hour [0-23]
|
|
574
|
+
H(r, e) {
|
|
575
|
+
return l(r.getHours(), e.length);
|
|
576
|
+
},
|
|
577
|
+
// Minute
|
|
578
|
+
m(r, e) {
|
|
579
|
+
return l(r.getMinutes(), e.length);
|
|
580
|
+
},
|
|
581
|
+
// Second
|
|
582
|
+
s(r, e) {
|
|
583
|
+
return l(r.getSeconds(), e.length);
|
|
584
|
+
},
|
|
585
|
+
// Fraction of second
|
|
586
|
+
S(r, e) {
|
|
587
|
+
const n = e.length, t = r.getMilliseconds(), a = Math.trunc(
|
|
588
|
+
t * Math.pow(10, n - 3)
|
|
589
|
+
);
|
|
590
|
+
return l(a, e.length);
|
|
591
|
+
}
|
|
592
|
+
}, q = {
|
|
593
|
+
midnight: "midnight",
|
|
594
|
+
noon: "noon",
|
|
595
|
+
morning: "morning",
|
|
596
|
+
afternoon: "afternoon",
|
|
597
|
+
evening: "evening",
|
|
598
|
+
night: "night"
|
|
599
|
+
}, he = {
|
|
600
|
+
// Era
|
|
601
|
+
G: function(r, e, n) {
|
|
602
|
+
const t = r.getFullYear() > 0 ? 1 : 0;
|
|
603
|
+
switch (e) {
|
|
604
|
+
case "G":
|
|
605
|
+
case "GG":
|
|
606
|
+
case "GGG":
|
|
607
|
+
return n.era(t, { width: "abbreviated" });
|
|
608
|
+
case "GGGGG":
|
|
609
|
+
return n.era(t, { width: "narrow" });
|
|
610
|
+
case "GGGG":
|
|
611
|
+
default:
|
|
612
|
+
return n.era(t, { width: "wide" });
|
|
613
|
+
}
|
|
614
|
+
},
|
|
615
|
+
// Year
|
|
616
|
+
y: function(r, e, n) {
|
|
617
|
+
if (e === "yo") {
|
|
618
|
+
const t = r.getFullYear(), a = t > 0 ? t : 1 - t;
|
|
619
|
+
return n.ordinalNumber(a, { unit: "year" });
|
|
620
|
+
}
|
|
621
|
+
return C.y(r, e);
|
|
622
|
+
},
|
|
623
|
+
// Local week-numbering year
|
|
624
|
+
Y: function(r, e, n, t) {
|
|
625
|
+
const a = re(r, t), o = a > 0 ? a : 1 - a;
|
|
626
|
+
if (e === "YY") {
|
|
627
|
+
const s = o % 100;
|
|
628
|
+
return l(s, 2);
|
|
629
|
+
}
|
|
630
|
+
return e === "Yo" ? n.ordinalNumber(o, { unit: "year" }) : l(o, e.length);
|
|
631
|
+
},
|
|
632
|
+
// ISO week-numbering year
|
|
633
|
+
R: function(r, e) {
|
|
634
|
+
const n = De(r);
|
|
635
|
+
return l(n, e.length);
|
|
636
|
+
},
|
|
637
|
+
// Extended year. This is a single number designating the year of this calendar system.
|
|
638
|
+
// The main difference between `y` and `u` localizers are B.C. years:
|
|
639
|
+
// | Year | `y` | `u` |
|
|
640
|
+
// |------|-----|-----|
|
|
641
|
+
// | AC 1 | 1 | 1 |
|
|
642
|
+
// | BC 1 | 1 | 0 |
|
|
643
|
+
// | BC 2 | 2 | -1 |
|
|
644
|
+
// Also `yy` always returns the last two digits of a year,
|
|
645
|
+
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
646
|
+
u: function(r, e) {
|
|
647
|
+
const n = r.getFullYear();
|
|
648
|
+
return l(n, e.length);
|
|
649
|
+
},
|
|
650
|
+
// Quarter
|
|
651
|
+
Q: function(r, e, n) {
|
|
652
|
+
const t = Math.ceil((r.getMonth() + 1) / 3);
|
|
653
|
+
switch (e) {
|
|
654
|
+
case "Q":
|
|
655
|
+
return String(t);
|
|
656
|
+
case "QQ":
|
|
657
|
+
return l(t, 2);
|
|
658
|
+
case "Qo":
|
|
659
|
+
return n.ordinalNumber(t, { unit: "quarter" });
|
|
660
|
+
case "QQQ":
|
|
661
|
+
return n.quarter(t, {
|
|
662
|
+
width: "abbreviated",
|
|
663
|
+
context: "formatting"
|
|
664
|
+
});
|
|
665
|
+
case "QQQQQ":
|
|
666
|
+
return n.quarter(t, {
|
|
667
|
+
width: "narrow",
|
|
668
|
+
context: "formatting"
|
|
669
|
+
});
|
|
670
|
+
case "QQQQ":
|
|
671
|
+
default:
|
|
672
|
+
return n.quarter(t, {
|
|
673
|
+
width: "wide",
|
|
674
|
+
context: "formatting"
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
},
|
|
678
|
+
// Stand-alone quarter
|
|
679
|
+
q: function(r, e, n) {
|
|
680
|
+
const t = Math.ceil((r.getMonth() + 1) / 3);
|
|
681
|
+
switch (e) {
|
|
682
|
+
case "q":
|
|
683
|
+
return String(t);
|
|
684
|
+
case "qq":
|
|
685
|
+
return l(t, 2);
|
|
686
|
+
case "qo":
|
|
687
|
+
return n.ordinalNumber(t, { unit: "quarter" });
|
|
688
|
+
case "qqq":
|
|
689
|
+
return n.quarter(t, {
|
|
690
|
+
width: "abbreviated",
|
|
691
|
+
context: "standalone"
|
|
692
|
+
});
|
|
693
|
+
case "qqqqq":
|
|
694
|
+
return n.quarter(t, {
|
|
695
|
+
width: "narrow",
|
|
696
|
+
context: "standalone"
|
|
697
|
+
});
|
|
698
|
+
case "qqqq":
|
|
699
|
+
default:
|
|
700
|
+
return n.quarter(t, {
|
|
701
|
+
width: "wide",
|
|
702
|
+
context: "standalone"
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
},
|
|
706
|
+
// Month
|
|
707
|
+
M: function(r, e, n) {
|
|
708
|
+
const t = r.getMonth();
|
|
709
|
+
switch (e) {
|
|
710
|
+
case "M":
|
|
711
|
+
case "MM":
|
|
712
|
+
return C.M(r, e);
|
|
713
|
+
case "Mo":
|
|
714
|
+
return n.ordinalNumber(t + 1, { unit: "month" });
|
|
715
|
+
case "MMM":
|
|
716
|
+
return n.month(t, {
|
|
717
|
+
width: "abbreviated",
|
|
718
|
+
context: "formatting"
|
|
719
|
+
});
|
|
720
|
+
case "MMMMM":
|
|
721
|
+
return n.month(t, {
|
|
722
|
+
width: "narrow",
|
|
723
|
+
context: "formatting"
|
|
724
|
+
});
|
|
725
|
+
case "MMMM":
|
|
726
|
+
default:
|
|
727
|
+
return n.month(t, { width: "wide", context: "formatting" });
|
|
728
|
+
}
|
|
729
|
+
},
|
|
730
|
+
// Stand-alone month
|
|
731
|
+
L: function(r, e, n) {
|
|
732
|
+
const t = r.getMonth();
|
|
733
|
+
switch (e) {
|
|
734
|
+
case "L":
|
|
735
|
+
return String(t + 1);
|
|
736
|
+
case "LL":
|
|
737
|
+
return l(t + 1, 2);
|
|
738
|
+
case "Lo":
|
|
739
|
+
return n.ordinalNumber(t + 1, { unit: "month" });
|
|
740
|
+
case "LLL":
|
|
741
|
+
return n.month(t, {
|
|
742
|
+
width: "abbreviated",
|
|
743
|
+
context: "standalone"
|
|
744
|
+
});
|
|
745
|
+
case "LLLLL":
|
|
746
|
+
return n.month(t, {
|
|
747
|
+
width: "narrow",
|
|
748
|
+
context: "standalone"
|
|
749
|
+
});
|
|
750
|
+
case "LLLL":
|
|
751
|
+
default:
|
|
752
|
+
return n.month(t, { width: "wide", context: "standalone" });
|
|
753
|
+
}
|
|
754
|
+
},
|
|
755
|
+
// Local week of year
|
|
756
|
+
w: function(r, e, n, t) {
|
|
757
|
+
const a = Ye(r, t);
|
|
758
|
+
return e === "wo" ? n.ordinalNumber(a, { unit: "week" }) : l(a, e.length);
|
|
759
|
+
},
|
|
760
|
+
// ISO week of year
|
|
761
|
+
I: function(r, e, n) {
|
|
762
|
+
const t = Te(r);
|
|
763
|
+
return e === "Io" ? n.ordinalNumber(t, { unit: "week" }) : l(t, e.length);
|
|
764
|
+
},
|
|
765
|
+
// Day of the month
|
|
766
|
+
d: function(r, e, n) {
|
|
767
|
+
return e === "do" ? n.ordinalNumber(r.getDate(), { unit: "date" }) : C.d(r, e);
|
|
768
|
+
},
|
|
769
|
+
// Day of year
|
|
770
|
+
D: function(r, e, n) {
|
|
771
|
+
const t = Tt(r);
|
|
772
|
+
return e === "Do" ? n.ordinalNumber(t, { unit: "dayOfYear" }) : l(t, e.length);
|
|
773
|
+
},
|
|
774
|
+
// Day of week
|
|
775
|
+
E: function(r, e, n) {
|
|
776
|
+
const t = r.getDay();
|
|
777
|
+
switch (e) {
|
|
778
|
+
case "E":
|
|
779
|
+
case "EE":
|
|
780
|
+
case "EEE":
|
|
781
|
+
return n.day(t, {
|
|
782
|
+
width: "abbreviated",
|
|
783
|
+
context: "formatting"
|
|
784
|
+
});
|
|
785
|
+
case "EEEEE":
|
|
786
|
+
return n.day(t, {
|
|
787
|
+
width: "narrow",
|
|
788
|
+
context: "formatting"
|
|
789
|
+
});
|
|
790
|
+
case "EEEEEE":
|
|
791
|
+
return n.day(t, {
|
|
792
|
+
width: "short",
|
|
793
|
+
context: "formatting"
|
|
794
|
+
});
|
|
795
|
+
case "EEEE":
|
|
796
|
+
default:
|
|
797
|
+
return n.day(t, {
|
|
798
|
+
width: "wide",
|
|
799
|
+
context: "formatting"
|
|
800
|
+
});
|
|
801
|
+
}
|
|
802
|
+
},
|
|
803
|
+
// Local day of week
|
|
804
|
+
e: function(r, e, n, t) {
|
|
805
|
+
const a = r.getDay(), o = (a - t.weekStartsOn + 8) % 7 || 7;
|
|
806
|
+
switch (e) {
|
|
807
|
+
case "e":
|
|
808
|
+
return String(o);
|
|
809
|
+
case "ee":
|
|
810
|
+
return l(o, 2);
|
|
811
|
+
case "eo":
|
|
812
|
+
return n.ordinalNumber(o, { unit: "day" });
|
|
813
|
+
case "eee":
|
|
814
|
+
return n.day(a, {
|
|
815
|
+
width: "abbreviated",
|
|
816
|
+
context: "formatting"
|
|
817
|
+
});
|
|
818
|
+
case "eeeee":
|
|
819
|
+
return n.day(a, {
|
|
820
|
+
width: "narrow",
|
|
821
|
+
context: "formatting"
|
|
822
|
+
});
|
|
823
|
+
case "eeeeee":
|
|
824
|
+
return n.day(a, {
|
|
825
|
+
width: "short",
|
|
826
|
+
context: "formatting"
|
|
827
|
+
});
|
|
828
|
+
case "eeee":
|
|
829
|
+
default:
|
|
830
|
+
return n.day(a, {
|
|
831
|
+
width: "wide",
|
|
832
|
+
context: "formatting"
|
|
833
|
+
});
|
|
834
|
+
}
|
|
835
|
+
},
|
|
836
|
+
// Stand-alone local day of week
|
|
837
|
+
c: function(r, e, n, t) {
|
|
838
|
+
const a = r.getDay(), o = (a - t.weekStartsOn + 8) % 7 || 7;
|
|
839
|
+
switch (e) {
|
|
840
|
+
case "c":
|
|
841
|
+
return String(o);
|
|
842
|
+
case "cc":
|
|
843
|
+
return l(o, e.length);
|
|
844
|
+
case "co":
|
|
845
|
+
return n.ordinalNumber(o, { unit: "day" });
|
|
846
|
+
case "ccc":
|
|
847
|
+
return n.day(a, {
|
|
848
|
+
width: "abbreviated",
|
|
849
|
+
context: "standalone"
|
|
850
|
+
});
|
|
851
|
+
case "ccccc":
|
|
852
|
+
return n.day(a, {
|
|
853
|
+
width: "narrow",
|
|
854
|
+
context: "standalone"
|
|
855
|
+
});
|
|
856
|
+
case "cccccc":
|
|
857
|
+
return n.day(a, {
|
|
858
|
+
width: "short",
|
|
859
|
+
context: "standalone"
|
|
860
|
+
});
|
|
861
|
+
case "cccc":
|
|
862
|
+
default:
|
|
863
|
+
return n.day(a, {
|
|
864
|
+
width: "wide",
|
|
865
|
+
context: "standalone"
|
|
866
|
+
});
|
|
867
|
+
}
|
|
868
|
+
},
|
|
869
|
+
// ISO day of week
|
|
870
|
+
i: function(r, e, n) {
|
|
871
|
+
const t = r.getDay(), a = t === 0 ? 7 : t;
|
|
872
|
+
switch (e) {
|
|
873
|
+
case "i":
|
|
874
|
+
return String(a);
|
|
875
|
+
case "ii":
|
|
876
|
+
return l(a, e.length);
|
|
877
|
+
case "io":
|
|
878
|
+
return n.ordinalNumber(a, { unit: "day" });
|
|
879
|
+
case "iii":
|
|
880
|
+
return n.day(t, {
|
|
881
|
+
width: "abbreviated",
|
|
882
|
+
context: "formatting"
|
|
883
|
+
});
|
|
884
|
+
case "iiiii":
|
|
885
|
+
return n.day(t, {
|
|
886
|
+
width: "narrow",
|
|
887
|
+
context: "formatting"
|
|
888
|
+
});
|
|
889
|
+
case "iiiiii":
|
|
890
|
+
return n.day(t, {
|
|
891
|
+
width: "short",
|
|
892
|
+
context: "formatting"
|
|
893
|
+
});
|
|
894
|
+
case "iiii":
|
|
895
|
+
default:
|
|
896
|
+
return n.day(t, {
|
|
897
|
+
width: "wide",
|
|
898
|
+
context: "formatting"
|
|
899
|
+
});
|
|
900
|
+
}
|
|
901
|
+
},
|
|
902
|
+
// AM or PM
|
|
903
|
+
a: function(r, e, n) {
|
|
904
|
+
const a = r.getHours() / 12 >= 1 ? "pm" : "am";
|
|
905
|
+
switch (e) {
|
|
906
|
+
case "a":
|
|
907
|
+
case "aa":
|
|
908
|
+
return n.dayPeriod(a, {
|
|
909
|
+
width: "abbreviated",
|
|
910
|
+
context: "formatting"
|
|
911
|
+
});
|
|
912
|
+
case "aaa":
|
|
913
|
+
return n.dayPeriod(a, {
|
|
914
|
+
width: "abbreviated",
|
|
915
|
+
context: "formatting"
|
|
916
|
+
}).toLowerCase();
|
|
917
|
+
case "aaaaa":
|
|
918
|
+
return n.dayPeriod(a, {
|
|
919
|
+
width: "narrow",
|
|
920
|
+
context: "formatting"
|
|
921
|
+
});
|
|
922
|
+
case "aaaa":
|
|
923
|
+
default:
|
|
924
|
+
return n.dayPeriod(a, {
|
|
925
|
+
width: "wide",
|
|
926
|
+
context: "formatting"
|
|
927
|
+
});
|
|
928
|
+
}
|
|
929
|
+
},
|
|
930
|
+
// AM, PM, midnight, noon
|
|
931
|
+
b: function(r, e, n) {
|
|
932
|
+
const t = r.getHours();
|
|
933
|
+
let a;
|
|
934
|
+
switch (t === 12 ? a = q.noon : t === 0 ? a = q.midnight : a = t / 12 >= 1 ? "pm" : "am", e) {
|
|
935
|
+
case "b":
|
|
936
|
+
case "bb":
|
|
937
|
+
return n.dayPeriod(a, {
|
|
938
|
+
width: "abbreviated",
|
|
939
|
+
context: "formatting"
|
|
940
|
+
});
|
|
941
|
+
case "bbb":
|
|
942
|
+
return n.dayPeriod(a, {
|
|
943
|
+
width: "abbreviated",
|
|
944
|
+
context: "formatting"
|
|
945
|
+
}).toLowerCase();
|
|
946
|
+
case "bbbbb":
|
|
947
|
+
return n.dayPeriod(a, {
|
|
948
|
+
width: "narrow",
|
|
949
|
+
context: "formatting"
|
|
950
|
+
});
|
|
951
|
+
case "bbbb":
|
|
952
|
+
default:
|
|
953
|
+
return n.dayPeriod(a, {
|
|
954
|
+
width: "wide",
|
|
955
|
+
context: "formatting"
|
|
956
|
+
});
|
|
957
|
+
}
|
|
958
|
+
},
|
|
959
|
+
// in the morning, in the afternoon, in the evening, at night
|
|
960
|
+
B: function(r, e, n) {
|
|
961
|
+
const t = r.getHours();
|
|
962
|
+
let a;
|
|
963
|
+
switch (t >= 17 ? a = q.evening : t >= 12 ? a = q.afternoon : t >= 4 ? a = q.morning : a = q.night, e) {
|
|
964
|
+
case "B":
|
|
965
|
+
case "BB":
|
|
966
|
+
case "BBB":
|
|
967
|
+
return n.dayPeriod(a, {
|
|
968
|
+
width: "abbreviated",
|
|
969
|
+
context: "formatting"
|
|
970
|
+
});
|
|
971
|
+
case "BBBBB":
|
|
972
|
+
return n.dayPeriod(a, {
|
|
973
|
+
width: "narrow",
|
|
974
|
+
context: "formatting"
|
|
975
|
+
});
|
|
976
|
+
case "BBBB":
|
|
977
|
+
default:
|
|
978
|
+
return n.dayPeriod(a, {
|
|
979
|
+
width: "wide",
|
|
980
|
+
context: "formatting"
|
|
981
|
+
});
|
|
982
|
+
}
|
|
983
|
+
},
|
|
984
|
+
// Hour [1-12]
|
|
985
|
+
h: function(r, e, n) {
|
|
986
|
+
if (e === "ho") {
|
|
987
|
+
let t = r.getHours() % 12;
|
|
988
|
+
return t === 0 && (t = 12), n.ordinalNumber(t, { unit: "hour" });
|
|
989
|
+
}
|
|
990
|
+
return C.h(r, e);
|
|
991
|
+
},
|
|
992
|
+
// Hour [0-23]
|
|
993
|
+
H: function(r, e, n) {
|
|
994
|
+
return e === "Ho" ? n.ordinalNumber(r.getHours(), { unit: "hour" }) : C.H(r, e);
|
|
995
|
+
},
|
|
996
|
+
// Hour [0-11]
|
|
997
|
+
K: function(r, e, n) {
|
|
998
|
+
const t = r.getHours() % 12;
|
|
999
|
+
return e === "Ko" ? n.ordinalNumber(t, { unit: "hour" }) : l(t, e.length);
|
|
1000
|
+
},
|
|
1001
|
+
// Hour [1-24]
|
|
1002
|
+
k: function(r, e, n) {
|
|
1003
|
+
let t = r.getHours();
|
|
1004
|
+
return t === 0 && (t = 24), e === "ko" ? n.ordinalNumber(t, { unit: "hour" }) : l(t, e.length);
|
|
1005
|
+
},
|
|
1006
|
+
// Minute
|
|
1007
|
+
m: function(r, e, n) {
|
|
1008
|
+
return e === "mo" ? n.ordinalNumber(r.getMinutes(), { unit: "minute" }) : C.m(r, e);
|
|
1009
|
+
},
|
|
1010
|
+
// Second
|
|
1011
|
+
s: function(r, e, n) {
|
|
1012
|
+
return e === "so" ? n.ordinalNumber(r.getSeconds(), { unit: "second" }) : C.s(r, e);
|
|
1013
|
+
},
|
|
1014
|
+
// Fraction of second
|
|
1015
|
+
S: function(r, e) {
|
|
1016
|
+
return C.S(r, e);
|
|
1017
|
+
},
|
|
1018
|
+
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1019
|
+
X: function(r, e, n) {
|
|
1020
|
+
const t = r.getTimezoneOffset();
|
|
1021
|
+
if (t === 0)
|
|
1022
|
+
return "Z";
|
|
1023
|
+
switch (e) {
|
|
1024
|
+
case "X":
|
|
1025
|
+
return pe(t);
|
|
1026
|
+
case "XXXX":
|
|
1027
|
+
case "XX":
|
|
1028
|
+
return E(t);
|
|
1029
|
+
case "XXXXX":
|
|
1030
|
+
case "XXX":
|
|
1031
|
+
default:
|
|
1032
|
+
return E(t, ":");
|
|
1033
|
+
}
|
|
1034
|
+
},
|
|
1035
|
+
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
1036
|
+
x: function(r, e, n) {
|
|
1037
|
+
const t = r.getTimezoneOffset();
|
|
1038
|
+
switch (e) {
|
|
1039
|
+
case "x":
|
|
1040
|
+
return pe(t);
|
|
1041
|
+
case "xxxx":
|
|
1042
|
+
case "xx":
|
|
1043
|
+
return E(t);
|
|
1044
|
+
case "xxxxx":
|
|
1045
|
+
case "xxx":
|
|
1046
|
+
default:
|
|
1047
|
+
return E(t, ":");
|
|
1048
|
+
}
|
|
1049
|
+
},
|
|
1050
|
+
// Timezone (GMT)
|
|
1051
|
+
O: function(r, e, n) {
|
|
1052
|
+
const t = r.getTimezoneOffset();
|
|
1053
|
+
switch (e) {
|
|
1054
|
+
case "O":
|
|
1055
|
+
case "OO":
|
|
1056
|
+
case "OOO":
|
|
1057
|
+
return "GMT" + fe(t, ":");
|
|
1058
|
+
case "OOOO":
|
|
1059
|
+
default:
|
|
1060
|
+
return "GMT" + E(t, ":");
|
|
1061
|
+
}
|
|
1062
|
+
},
|
|
1063
|
+
// Timezone (specific non-location)
|
|
1064
|
+
z: function(r, e, n) {
|
|
1065
|
+
const t = r.getTimezoneOffset();
|
|
1066
|
+
switch (e) {
|
|
1067
|
+
case "z":
|
|
1068
|
+
case "zz":
|
|
1069
|
+
case "zzz":
|
|
1070
|
+
return "GMT" + fe(t, ":");
|
|
1071
|
+
case "zzzz":
|
|
1072
|
+
default:
|
|
1073
|
+
return "GMT" + E(t, ":");
|
|
1074
|
+
}
|
|
1075
|
+
},
|
|
1076
|
+
// Seconds timestamp
|
|
1077
|
+
t: function(r, e, n) {
|
|
1078
|
+
const t = Math.trunc(r.getTime() / 1e3);
|
|
1079
|
+
return l(t, e.length);
|
|
1080
|
+
},
|
|
1081
|
+
// Milliseconds timestamp
|
|
1082
|
+
T: function(r, e, n) {
|
|
1083
|
+
const t = r.getTime();
|
|
1084
|
+
return l(t, e.length);
|
|
1085
|
+
}
|
|
1086
|
+
};
|
|
1087
|
+
function fe(r, e = "") {
|
|
1088
|
+
const n = r > 0 ? "-" : "+", t = Math.abs(r), a = Math.trunc(t / 60), o = t % 60;
|
|
1089
|
+
return o === 0 ? n + String(a) : n + String(a) + e + l(o, 2);
|
|
1090
|
+
}
|
|
1091
|
+
function pe(r, e) {
|
|
1092
|
+
return r % 60 === 0 ? (r > 0 ? "-" : "+") + l(Math.abs(r) / 60, 2) : E(r, e);
|
|
1093
|
+
}
|
|
1094
|
+
function E(r, e = "") {
|
|
1095
|
+
const n = r > 0 ? "-" : "+", t = Math.abs(r), a = l(Math.trunc(t / 60), 2), o = l(t % 60, 2);
|
|
1096
|
+
return n + a + e + o;
|
|
1097
|
+
}
|
|
1098
|
+
const me = (r, e) => {
|
|
1099
|
+
switch (r) {
|
|
1100
|
+
case "P":
|
|
1101
|
+
return e.date({ width: "short" });
|
|
1102
|
+
case "PP":
|
|
1103
|
+
return e.date({ width: "medium" });
|
|
1104
|
+
case "PPP":
|
|
1105
|
+
return e.date({ width: "long" });
|
|
1106
|
+
case "PPPP":
|
|
1107
|
+
default:
|
|
1108
|
+
return e.date({ width: "full" });
|
|
1109
|
+
}
|
|
1110
|
+
}, Oe = (r, e) => {
|
|
1111
|
+
switch (r) {
|
|
1112
|
+
case "p":
|
|
1113
|
+
return e.time({ width: "short" });
|
|
1114
|
+
case "pp":
|
|
1115
|
+
return e.time({ width: "medium" });
|
|
1116
|
+
case "ppp":
|
|
1117
|
+
return e.time({ width: "long" });
|
|
1118
|
+
case "pppp":
|
|
1119
|
+
default:
|
|
1120
|
+
return e.time({ width: "full" });
|
|
1121
|
+
}
|
|
1122
|
+
}, Ot = (r, e) => {
|
|
1123
|
+
const n = r.match(/(P+)(p+)?/) || [], t = n[1], a = n[2];
|
|
1124
|
+
if (!a)
|
|
1125
|
+
return me(r, e);
|
|
1126
|
+
let o;
|
|
1127
|
+
switch (t) {
|
|
1128
|
+
case "P":
|
|
1129
|
+
o = e.dateTime({ width: "short" });
|
|
1130
|
+
break;
|
|
1131
|
+
case "PP":
|
|
1132
|
+
o = e.dateTime({ width: "medium" });
|
|
1133
|
+
break;
|
|
1134
|
+
case "PPP":
|
|
1135
|
+
o = e.dateTime({ width: "long" });
|
|
1136
|
+
break;
|
|
1137
|
+
case "PPPP":
|
|
1138
|
+
default:
|
|
1139
|
+
o = e.dateTime({ width: "full" });
|
|
1140
|
+
break;
|
|
1141
|
+
}
|
|
1142
|
+
return o.replace("{{date}}", me(t, e)).replace("{{time}}", Oe(a, e));
|
|
1143
|
+
}, ee = {
|
|
1144
|
+
p: Oe,
|
|
1145
|
+
P: Ot
|
|
1146
|
+
}, Ct = /^D+$/, $t = /^Y+$/, Et = ["D", "DD", "YY", "YYYY"];
|
|
1147
|
+
function Ce(r) {
|
|
1148
|
+
return Ct.test(r);
|
|
1149
|
+
}
|
|
1150
|
+
function $e(r) {
|
|
1151
|
+
return $t.test(r);
|
|
1152
|
+
}
|
|
1153
|
+
function te(r, e, n) {
|
|
1154
|
+
const t = Nt(r, e, n);
|
|
1155
|
+
if (console.warn(t), Et.includes(r)) throw new RangeError(t);
|
|
1156
|
+
}
|
|
1157
|
+
function Nt(r, e, n) {
|
|
1158
|
+
const t = r[0] === "Y" ? "years" : "days of the month";
|
|
1159
|
+
return `Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${e}\`) for formatting ${t} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
1160
|
+
}
|
|
1161
|
+
const Wt = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, qt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ft = /^'([^]*?)'?$/, It = /''/g, Lt = /[a-zA-Z]/;
|
|
1162
|
+
function Ht(r, e, n) {
|
|
1163
|
+
const t = L(), a = t.locale ?? Pe, o = t.firstWeekContainsDate ?? t.locale?.options?.firstWeekContainsDate ?? 1, s = t.weekStartsOn ?? t.locale?.options?.weekStartsOn ?? 0, i = _(r);
|
|
1164
|
+
if (!je(i))
|
|
1165
|
+
throw new RangeError("Invalid time value");
|
|
1166
|
+
let h = e.match(qt).map((f) => {
|
|
1167
|
+
const d = f[0];
|
|
1168
|
+
if (d === "p" || d === "P") {
|
|
1169
|
+
const O = ee[d];
|
|
1170
|
+
return O(f, a.formatLong);
|
|
1171
|
+
}
|
|
1172
|
+
return f;
|
|
1173
|
+
}).join("").match(Wt).map((f) => {
|
|
1174
|
+
if (f === "''")
|
|
1175
|
+
return { isToken: !1, value: "'" };
|
|
1176
|
+
const d = f[0];
|
|
1177
|
+
if (d === "'")
|
|
1178
|
+
return { isToken: !1, value: Rt(f) };
|
|
1179
|
+
if (he[d])
|
|
1180
|
+
return { isToken: !0, value: f };
|
|
1181
|
+
if (d.match(Lt))
|
|
1182
|
+
throw new RangeError(
|
|
1183
|
+
"Format string contains an unescaped latin alphabet character `" + d + "`"
|
|
1184
|
+
);
|
|
1185
|
+
return { isToken: !1, value: f };
|
|
1186
|
+
});
|
|
1187
|
+
a.localize.preprocessor && (h = a.localize.preprocessor(i, h));
|
|
1188
|
+
const v = {
|
|
1189
|
+
firstWeekContainsDate: o,
|
|
1190
|
+
weekStartsOn: s,
|
|
1191
|
+
locale: a
|
|
1192
|
+
};
|
|
1193
|
+
return h.map((f) => {
|
|
1194
|
+
if (!f.isToken) return f.value;
|
|
1195
|
+
const d = f.value;
|
|
1196
|
+
($e(d) || Ce(d)) && te(d, e, String(r));
|
|
1197
|
+
const O = he[d[0]];
|
|
1198
|
+
return O(i, d, a.localize, v);
|
|
1199
|
+
}).join("");
|
|
1200
|
+
}
|
|
1201
|
+
function Rt(r) {
|
|
1202
|
+
const e = r.match(Ft);
|
|
1203
|
+
return e ? e[1].replace(It, "'") : r;
|
|
1204
|
+
}
|
|
1205
|
+
function Qt(r, e) {
|
|
1206
|
+
const n = _(r);
|
|
1207
|
+
if (isNaN(n.getTime()))
|
|
1208
|
+
throw new RangeError("Invalid time value");
|
|
1209
|
+
const t = e?.format ?? "extended";
|
|
1210
|
+
let a = "";
|
|
1211
|
+
const o = t === "extended" ? "-" : "";
|
|
1212
|
+
{
|
|
1213
|
+
const s = l(n.getDate(), 2), i = l(n.getMonth() + 1, 2);
|
|
1214
|
+
a = `${l(n.getFullYear(), 4)}${o}${i}${o}${s}`;
|
|
1215
|
+
}
|
|
1216
|
+
return a;
|
|
1217
|
+
}
|
|
1218
|
+
function Bt() {
|
|
1219
|
+
return Object.assign({}, L());
|
|
1220
|
+
}
|
|
1221
|
+
function At(r) {
|
|
1222
|
+
let n = _(r).getDay();
|
|
1223
|
+
return n === 0 && (n = 7), n;
|
|
1224
|
+
}
|
|
1225
|
+
function Vt(r, e) {
|
|
1226
|
+
const n = e instanceof Date ? w(e, 0) : new e(0);
|
|
1227
|
+
return n.setFullYear(
|
|
1228
|
+
r.getFullYear(),
|
|
1229
|
+
r.getMonth(),
|
|
1230
|
+
r.getDate()
|
|
1231
|
+
), n.setHours(
|
|
1232
|
+
r.getHours(),
|
|
1233
|
+
r.getMinutes(),
|
|
1234
|
+
r.getSeconds(),
|
|
1235
|
+
r.getMilliseconds()
|
|
1236
|
+
), n;
|
|
1237
|
+
}
|
|
1238
|
+
const Gt = 10;
|
|
1239
|
+
class Ee {
|
|
1240
|
+
subPriority = 0;
|
|
1241
|
+
validate(e, n) {
|
|
1242
|
+
return !0;
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
class Xt extends Ee {
|
|
1246
|
+
constructor(e, n, t, a, o) {
|
|
1247
|
+
super(), this.value = e, this.validateValue = n, this.setValue = t, this.priority = a, o && (this.subPriority = o);
|
|
1248
|
+
}
|
|
1249
|
+
validate(e, n) {
|
|
1250
|
+
return this.validateValue(e, this.value, n);
|
|
1251
|
+
}
|
|
1252
|
+
set(e, n, t) {
|
|
1253
|
+
return this.setValue(e, n, this.value, t);
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
class jt extends Ee {
|
|
1257
|
+
priority = Gt;
|
|
1258
|
+
subPriority = -1;
|
|
1259
|
+
set(e, n) {
|
|
1260
|
+
return n.timestampIsSet ? e : w(e, Vt(e, Date));
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
class u {
|
|
1264
|
+
run(e, n, t, a) {
|
|
1265
|
+
const o = this.parse(e, n, t, a);
|
|
1266
|
+
return o ? {
|
|
1267
|
+
setter: new Xt(
|
|
1268
|
+
o.value,
|
|
1269
|
+
this.validate,
|
|
1270
|
+
this.set,
|
|
1271
|
+
this.priority,
|
|
1272
|
+
this.subPriority
|
|
1273
|
+
),
|
|
1274
|
+
rest: o.rest
|
|
1275
|
+
} : null;
|
|
1276
|
+
}
|
|
1277
|
+
validate(e, n, t) {
|
|
1278
|
+
return !0;
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
class zt extends u {
|
|
1282
|
+
priority = 140;
|
|
1283
|
+
parse(e, n, t) {
|
|
1284
|
+
switch (n) {
|
|
1285
|
+
case "G":
|
|
1286
|
+
case "GG":
|
|
1287
|
+
case "GGG":
|
|
1288
|
+
return t.era(e, { width: "abbreviated" }) || t.era(e, { width: "narrow" });
|
|
1289
|
+
case "GGGGG":
|
|
1290
|
+
return t.era(e, { width: "narrow" });
|
|
1291
|
+
case "GGGG":
|
|
1292
|
+
default:
|
|
1293
|
+
return t.era(e, { width: "wide" }) || t.era(e, { width: "abbreviated" }) || t.era(e, { width: "narrow" });
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
set(e, n, t) {
|
|
1297
|
+
return n.era = t, e.setFullYear(t, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
1298
|
+
}
|
|
1299
|
+
incompatibleTokens = ["R", "u", "t", "T"];
|
|
1300
|
+
}
|
|
1301
|
+
const y = {
|
|
1302
|
+
month: /^(1[0-2]|0?\d)/,
|
|
1303
|
+
// 0 to 12
|
|
1304
|
+
date: /^(3[0-1]|[0-2]?\d)/,
|
|
1305
|
+
// 0 to 31
|
|
1306
|
+
dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
|
|
1307
|
+
// 0 to 366
|
|
1308
|
+
week: /^(5[0-3]|[0-4]?\d)/,
|
|
1309
|
+
// 0 to 53
|
|
1310
|
+
hour23h: /^(2[0-3]|[0-1]?\d)/,
|
|
1311
|
+
// 0 to 23
|
|
1312
|
+
hour24h: /^(2[0-4]|[0-1]?\d)/,
|
|
1313
|
+
// 0 to 24
|
|
1314
|
+
hour11h: /^(1[0-1]|0?\d)/,
|
|
1315
|
+
// 0 to 11
|
|
1316
|
+
hour12h: /^(1[0-2]|0?\d)/,
|
|
1317
|
+
// 0 to 12
|
|
1318
|
+
minute: /^[0-5]?\d/,
|
|
1319
|
+
// 0 to 59
|
|
1320
|
+
second: /^[0-5]?\d/,
|
|
1321
|
+
// 0 to 59
|
|
1322
|
+
singleDigit: /^\d/,
|
|
1323
|
+
// 0 to 9
|
|
1324
|
+
twoDigits: /^\d{1,2}/,
|
|
1325
|
+
// 0 to 99
|
|
1326
|
+
threeDigits: /^\d{1,3}/,
|
|
1327
|
+
// 0 to 999
|
|
1328
|
+
fourDigits: /^\d{1,4}/,
|
|
1329
|
+
// 0 to 9999
|
|
1330
|
+
anyDigitsSigned: /^-?\d+/,
|
|
1331
|
+
singleDigitSigned: /^-?\d/,
|
|
1332
|
+
// 0 to 9, -0 to -9
|
|
1333
|
+
twoDigitsSigned: /^-?\d{1,2}/,
|
|
1334
|
+
// 0 to 99, -0 to -99
|
|
1335
|
+
threeDigitsSigned: /^-?\d{1,3}/,
|
|
1336
|
+
// 0 to 999, -0 to -999
|
|
1337
|
+
fourDigitsSigned: /^-?\d{1,4}/
|
|
1338
|
+
// 0 to 9999, -0 to -9999
|
|
1339
|
+
}, P = {
|
|
1340
|
+
basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
|
|
1341
|
+
basic: /^([+-])(\d{2})(\d{2})|Z/,
|
|
1342
|
+
basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
|
|
1343
|
+
extended: /^([+-])(\d{2}):(\d{2})|Z/,
|
|
1344
|
+
extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
|
|
1345
|
+
};
|
|
1346
|
+
function g(r, e) {
|
|
1347
|
+
return r && {
|
|
1348
|
+
value: e(r.value),
|
|
1349
|
+
rest: r.rest
|
|
1350
|
+
};
|
|
1351
|
+
}
|
|
1352
|
+
function p(r, e) {
|
|
1353
|
+
const n = e.match(r);
|
|
1354
|
+
return n ? {
|
|
1355
|
+
value: parseInt(n[0], 10),
|
|
1356
|
+
rest: e.slice(n[0].length)
|
|
1357
|
+
} : null;
|
|
1358
|
+
}
|
|
1359
|
+
function T(r, e) {
|
|
1360
|
+
const n = e.match(r);
|
|
1361
|
+
if (!n)
|
|
1362
|
+
return null;
|
|
1363
|
+
if (n[0] === "Z")
|
|
1364
|
+
return {
|
|
1365
|
+
value: 0,
|
|
1366
|
+
rest: e.slice(1)
|
|
1367
|
+
};
|
|
1368
|
+
const t = n[1] === "+" ? 1 : -1, a = n[2] ? parseInt(n[2], 10) : 0, o = n[3] ? parseInt(n[3], 10) : 0, s = n[5] ? parseInt(n[5], 10) : 0;
|
|
1369
|
+
return {
|
|
1370
|
+
value: t * (a * Qe + o * Re + s * Be),
|
|
1371
|
+
rest: e.slice(n[0].length)
|
|
1372
|
+
};
|
|
1373
|
+
}
|
|
1374
|
+
function Ne(r) {
|
|
1375
|
+
return p(y.anyDigitsSigned, r);
|
|
1376
|
+
}
|
|
1377
|
+
function b(r, e) {
|
|
1378
|
+
switch (r) {
|
|
1379
|
+
case 1:
|
|
1380
|
+
return p(y.singleDigit, e);
|
|
1381
|
+
case 2:
|
|
1382
|
+
return p(y.twoDigits, e);
|
|
1383
|
+
case 3:
|
|
1384
|
+
return p(y.threeDigits, e);
|
|
1385
|
+
case 4:
|
|
1386
|
+
return p(y.fourDigits, e);
|
|
1387
|
+
default:
|
|
1388
|
+
return p(new RegExp("^\\d{1," + r + "}"), e);
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
function j(r, e) {
|
|
1392
|
+
switch (r) {
|
|
1393
|
+
case 1:
|
|
1394
|
+
return p(y.singleDigitSigned, e);
|
|
1395
|
+
case 2:
|
|
1396
|
+
return p(y.twoDigitsSigned, e);
|
|
1397
|
+
case 3:
|
|
1398
|
+
return p(y.threeDigitsSigned, e);
|
|
1399
|
+
case 4:
|
|
1400
|
+
return p(y.fourDigitsSigned, e);
|
|
1401
|
+
default:
|
|
1402
|
+
return p(new RegExp("^-?\\d{1," + r + "}"), e);
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
function ae(r) {
|
|
1406
|
+
switch (r) {
|
|
1407
|
+
case "morning":
|
|
1408
|
+
return 4;
|
|
1409
|
+
case "evening":
|
|
1410
|
+
return 17;
|
|
1411
|
+
case "pm":
|
|
1412
|
+
case "noon":
|
|
1413
|
+
case "afternoon":
|
|
1414
|
+
return 12;
|
|
1415
|
+
case "am":
|
|
1416
|
+
case "midnight":
|
|
1417
|
+
case "night":
|
|
1418
|
+
default:
|
|
1419
|
+
return 0;
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
function We(r, e) {
|
|
1423
|
+
const n = e > 0, t = n ? e : 1 - e;
|
|
1424
|
+
let a;
|
|
1425
|
+
if (t <= 50)
|
|
1426
|
+
a = r || 100;
|
|
1427
|
+
else {
|
|
1428
|
+
const o = t + 50, s = Math.trunc(o / 100) * 100, i = r >= o % 100;
|
|
1429
|
+
a = r + s - (i ? 100 : 0);
|
|
1430
|
+
}
|
|
1431
|
+
return n ? a : 1 - a;
|
|
1432
|
+
}
|
|
1433
|
+
function qe(r) {
|
|
1434
|
+
return r % 400 === 0 || r % 4 === 0 && r % 100 !== 0;
|
|
1435
|
+
}
|
|
1436
|
+
class Kt extends u {
|
|
1437
|
+
priority = 130;
|
|
1438
|
+
incompatibleTokens = ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"];
|
|
1439
|
+
parse(e, n, t) {
|
|
1440
|
+
const a = (o) => ({
|
|
1441
|
+
year: o,
|
|
1442
|
+
isTwoDigitYear: n === "yy"
|
|
1443
|
+
});
|
|
1444
|
+
switch (n) {
|
|
1445
|
+
case "y":
|
|
1446
|
+
return g(b(4, e), a);
|
|
1447
|
+
case "yo":
|
|
1448
|
+
return g(
|
|
1449
|
+
t.ordinalNumber(e, {
|
|
1450
|
+
unit: "year"
|
|
1451
|
+
}),
|
|
1452
|
+
a
|
|
1453
|
+
);
|
|
1454
|
+
default:
|
|
1455
|
+
return g(b(n.length, e), a);
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
validate(e, n) {
|
|
1459
|
+
return n.isTwoDigitYear || n.year > 0;
|
|
1460
|
+
}
|
|
1461
|
+
set(e, n, t) {
|
|
1462
|
+
const a = e.getFullYear();
|
|
1463
|
+
if (t.isTwoDigitYear) {
|
|
1464
|
+
const s = We(
|
|
1465
|
+
t.year,
|
|
1466
|
+
a
|
|
1467
|
+
);
|
|
1468
|
+
return e.setFullYear(s, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
1469
|
+
}
|
|
1470
|
+
const o = !("era" in n) || n.era === 1 ? t.year : 1 - t.year;
|
|
1471
|
+
return e.setFullYear(o, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
1472
|
+
}
|
|
1473
|
+
}
|
|
1474
|
+
class Jt extends u {
|
|
1475
|
+
priority = 130;
|
|
1476
|
+
parse(e, n, t) {
|
|
1477
|
+
const a = (o) => ({
|
|
1478
|
+
year: o,
|
|
1479
|
+
isTwoDigitYear: n === "YY"
|
|
1480
|
+
});
|
|
1481
|
+
switch (n) {
|
|
1482
|
+
case "Y":
|
|
1483
|
+
return g(b(4, e), a);
|
|
1484
|
+
case "Yo":
|
|
1485
|
+
return g(
|
|
1486
|
+
t.ordinalNumber(e, {
|
|
1487
|
+
unit: "year"
|
|
1488
|
+
}),
|
|
1489
|
+
a
|
|
1490
|
+
);
|
|
1491
|
+
default:
|
|
1492
|
+
return g(b(n.length, e), a);
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
validate(e, n) {
|
|
1496
|
+
return n.isTwoDigitYear || n.year > 0;
|
|
1497
|
+
}
|
|
1498
|
+
set(e, n, t, a) {
|
|
1499
|
+
const o = re(e, a);
|
|
1500
|
+
if (t.isTwoDigitYear) {
|
|
1501
|
+
const i = We(
|
|
1502
|
+
t.year,
|
|
1503
|
+
o
|
|
1504
|
+
);
|
|
1505
|
+
return e.setFullYear(
|
|
1506
|
+
i,
|
|
1507
|
+
0,
|
|
1508
|
+
a.firstWeekContainsDate
|
|
1509
|
+
), e.setHours(0, 0, 0, 0), $(e, a);
|
|
1510
|
+
}
|
|
1511
|
+
const s = !("era" in n) || n.era === 1 ? t.year : 1 - t.year;
|
|
1512
|
+
return e.setFullYear(s, 0, a.firstWeekContainsDate), e.setHours(0, 0, 0, 0), $(e, a);
|
|
1513
|
+
}
|
|
1514
|
+
incompatibleTokens = [
|
|
1515
|
+
"y",
|
|
1516
|
+
"R",
|
|
1517
|
+
"u",
|
|
1518
|
+
"Q",
|
|
1519
|
+
"q",
|
|
1520
|
+
"M",
|
|
1521
|
+
"L",
|
|
1522
|
+
"I",
|
|
1523
|
+
"d",
|
|
1524
|
+
"D",
|
|
1525
|
+
"i",
|
|
1526
|
+
"t",
|
|
1527
|
+
"T"
|
|
1528
|
+
];
|
|
1529
|
+
}
|
|
1530
|
+
class Ut extends u {
|
|
1531
|
+
priority = 130;
|
|
1532
|
+
parse(e, n) {
|
|
1533
|
+
return j(n === "R" ? 4 : n.length, e);
|
|
1534
|
+
}
|
|
1535
|
+
set(e, n, t) {
|
|
1536
|
+
const a = w(e, 0);
|
|
1537
|
+
return a.setFullYear(t, 0, 4), a.setHours(0, 0, 0, 0), I(a);
|
|
1538
|
+
}
|
|
1539
|
+
incompatibleTokens = [
|
|
1540
|
+
"G",
|
|
1541
|
+
"y",
|
|
1542
|
+
"Y",
|
|
1543
|
+
"u",
|
|
1544
|
+
"Q",
|
|
1545
|
+
"q",
|
|
1546
|
+
"M",
|
|
1547
|
+
"L",
|
|
1548
|
+
"w",
|
|
1549
|
+
"d",
|
|
1550
|
+
"D",
|
|
1551
|
+
"e",
|
|
1552
|
+
"c",
|
|
1553
|
+
"t",
|
|
1554
|
+
"T"
|
|
1555
|
+
];
|
|
1556
|
+
}
|
|
1557
|
+
class Zt extends u {
|
|
1558
|
+
priority = 130;
|
|
1559
|
+
parse(e, n) {
|
|
1560
|
+
return j(n === "u" ? 4 : n.length, e);
|
|
1561
|
+
}
|
|
1562
|
+
set(e, n, t) {
|
|
1563
|
+
return e.setFullYear(t, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
1564
|
+
}
|
|
1565
|
+
incompatibleTokens = ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"];
|
|
1566
|
+
}
|
|
1567
|
+
class St extends u {
|
|
1568
|
+
priority = 120;
|
|
1569
|
+
parse(e, n, t) {
|
|
1570
|
+
switch (n) {
|
|
1571
|
+
case "Q":
|
|
1572
|
+
case "QQ":
|
|
1573
|
+
return b(n.length, e);
|
|
1574
|
+
case "Qo":
|
|
1575
|
+
return t.ordinalNumber(e, { unit: "quarter" });
|
|
1576
|
+
case "QQQ":
|
|
1577
|
+
return t.quarter(e, {
|
|
1578
|
+
width: "abbreviated",
|
|
1579
|
+
context: "formatting"
|
|
1580
|
+
}) || t.quarter(e, {
|
|
1581
|
+
width: "narrow",
|
|
1582
|
+
context: "formatting"
|
|
1583
|
+
});
|
|
1584
|
+
case "QQQQQ":
|
|
1585
|
+
return t.quarter(e, {
|
|
1586
|
+
width: "narrow",
|
|
1587
|
+
context: "formatting"
|
|
1588
|
+
});
|
|
1589
|
+
case "QQQQ":
|
|
1590
|
+
default:
|
|
1591
|
+
return t.quarter(e, {
|
|
1592
|
+
width: "wide",
|
|
1593
|
+
context: "formatting"
|
|
1594
|
+
}) || t.quarter(e, {
|
|
1595
|
+
width: "abbreviated",
|
|
1596
|
+
context: "formatting"
|
|
1597
|
+
}) || t.quarter(e, {
|
|
1598
|
+
width: "narrow",
|
|
1599
|
+
context: "formatting"
|
|
1600
|
+
});
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
validate(e, n) {
|
|
1604
|
+
return n >= 1 && n <= 4;
|
|
1605
|
+
}
|
|
1606
|
+
set(e, n, t) {
|
|
1607
|
+
return e.setMonth((t - 1) * 3, 1), e.setHours(0, 0, 0, 0), e;
|
|
1608
|
+
}
|
|
1609
|
+
incompatibleTokens = [
|
|
1610
|
+
"Y",
|
|
1611
|
+
"R",
|
|
1612
|
+
"q",
|
|
1613
|
+
"M",
|
|
1614
|
+
"L",
|
|
1615
|
+
"w",
|
|
1616
|
+
"I",
|
|
1617
|
+
"d",
|
|
1618
|
+
"D",
|
|
1619
|
+
"i",
|
|
1620
|
+
"e",
|
|
1621
|
+
"c",
|
|
1622
|
+
"t",
|
|
1623
|
+
"T"
|
|
1624
|
+
];
|
|
1625
|
+
}
|
|
1626
|
+
class en extends u {
|
|
1627
|
+
priority = 120;
|
|
1628
|
+
parse(e, n, t) {
|
|
1629
|
+
switch (n) {
|
|
1630
|
+
case "q":
|
|
1631
|
+
case "qq":
|
|
1632
|
+
return b(n.length, e);
|
|
1633
|
+
case "qo":
|
|
1634
|
+
return t.ordinalNumber(e, { unit: "quarter" });
|
|
1635
|
+
case "qqq":
|
|
1636
|
+
return t.quarter(e, {
|
|
1637
|
+
width: "abbreviated",
|
|
1638
|
+
context: "standalone"
|
|
1639
|
+
}) || t.quarter(e, {
|
|
1640
|
+
width: "narrow",
|
|
1641
|
+
context: "standalone"
|
|
1642
|
+
});
|
|
1643
|
+
case "qqqqq":
|
|
1644
|
+
return t.quarter(e, {
|
|
1645
|
+
width: "narrow",
|
|
1646
|
+
context: "standalone"
|
|
1647
|
+
});
|
|
1648
|
+
case "qqqq":
|
|
1649
|
+
default:
|
|
1650
|
+
return t.quarter(e, {
|
|
1651
|
+
width: "wide",
|
|
1652
|
+
context: "standalone"
|
|
1653
|
+
}) || t.quarter(e, {
|
|
1654
|
+
width: "abbreviated",
|
|
1655
|
+
context: "standalone"
|
|
1656
|
+
}) || t.quarter(e, {
|
|
1657
|
+
width: "narrow",
|
|
1658
|
+
context: "standalone"
|
|
1659
|
+
});
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
validate(e, n) {
|
|
1663
|
+
return n >= 1 && n <= 4;
|
|
1664
|
+
}
|
|
1665
|
+
set(e, n, t) {
|
|
1666
|
+
return e.setMonth((t - 1) * 3, 1), e.setHours(0, 0, 0, 0), e;
|
|
1667
|
+
}
|
|
1668
|
+
incompatibleTokens = [
|
|
1669
|
+
"Y",
|
|
1670
|
+
"R",
|
|
1671
|
+
"Q",
|
|
1672
|
+
"M",
|
|
1673
|
+
"L",
|
|
1674
|
+
"w",
|
|
1675
|
+
"I",
|
|
1676
|
+
"d",
|
|
1677
|
+
"D",
|
|
1678
|
+
"i",
|
|
1679
|
+
"e",
|
|
1680
|
+
"c",
|
|
1681
|
+
"t",
|
|
1682
|
+
"T"
|
|
1683
|
+
];
|
|
1684
|
+
}
|
|
1685
|
+
class tn extends u {
|
|
1686
|
+
incompatibleTokens = [
|
|
1687
|
+
"Y",
|
|
1688
|
+
"R",
|
|
1689
|
+
"q",
|
|
1690
|
+
"Q",
|
|
1691
|
+
"L",
|
|
1692
|
+
"w",
|
|
1693
|
+
"I",
|
|
1694
|
+
"D",
|
|
1695
|
+
"i",
|
|
1696
|
+
"e",
|
|
1697
|
+
"c",
|
|
1698
|
+
"t",
|
|
1699
|
+
"T"
|
|
1700
|
+
];
|
|
1701
|
+
priority = 110;
|
|
1702
|
+
parse(e, n, t) {
|
|
1703
|
+
const a = (o) => o - 1;
|
|
1704
|
+
switch (n) {
|
|
1705
|
+
case "M":
|
|
1706
|
+
return g(
|
|
1707
|
+
p(y.month, e),
|
|
1708
|
+
a
|
|
1709
|
+
);
|
|
1710
|
+
case "MM":
|
|
1711
|
+
return g(b(2, e), a);
|
|
1712
|
+
case "Mo":
|
|
1713
|
+
return g(
|
|
1714
|
+
t.ordinalNumber(e, {
|
|
1715
|
+
unit: "month"
|
|
1716
|
+
}),
|
|
1717
|
+
a
|
|
1718
|
+
);
|
|
1719
|
+
case "MMM":
|
|
1720
|
+
return t.month(e, {
|
|
1721
|
+
width: "abbreviated",
|
|
1722
|
+
context: "formatting"
|
|
1723
|
+
}) || t.month(e, { width: "narrow", context: "formatting" });
|
|
1724
|
+
case "MMMMM":
|
|
1725
|
+
return t.month(e, {
|
|
1726
|
+
width: "narrow",
|
|
1727
|
+
context: "formatting"
|
|
1728
|
+
});
|
|
1729
|
+
case "MMMM":
|
|
1730
|
+
default:
|
|
1731
|
+
return t.month(e, { width: "wide", context: "formatting" }) || t.month(e, {
|
|
1732
|
+
width: "abbreviated",
|
|
1733
|
+
context: "formatting"
|
|
1734
|
+
}) || t.month(e, { width: "narrow", context: "formatting" });
|
|
1735
|
+
}
|
|
1736
|
+
}
|
|
1737
|
+
validate(e, n) {
|
|
1738
|
+
return n >= 0 && n <= 11;
|
|
1739
|
+
}
|
|
1740
|
+
set(e, n, t) {
|
|
1741
|
+
return e.setMonth(t, 1), e.setHours(0, 0, 0, 0), e;
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
class nn extends u {
|
|
1745
|
+
priority = 110;
|
|
1746
|
+
parse(e, n, t) {
|
|
1747
|
+
const a = (o) => o - 1;
|
|
1748
|
+
switch (n) {
|
|
1749
|
+
case "L":
|
|
1750
|
+
return g(
|
|
1751
|
+
p(y.month, e),
|
|
1752
|
+
a
|
|
1753
|
+
);
|
|
1754
|
+
case "LL":
|
|
1755
|
+
return g(b(2, e), a);
|
|
1756
|
+
case "Lo":
|
|
1757
|
+
return g(
|
|
1758
|
+
t.ordinalNumber(e, {
|
|
1759
|
+
unit: "month"
|
|
1760
|
+
}),
|
|
1761
|
+
a
|
|
1762
|
+
);
|
|
1763
|
+
case "LLL":
|
|
1764
|
+
return t.month(e, {
|
|
1765
|
+
width: "abbreviated",
|
|
1766
|
+
context: "standalone"
|
|
1767
|
+
}) || t.month(e, { width: "narrow", context: "standalone" });
|
|
1768
|
+
case "LLLLL":
|
|
1769
|
+
return t.month(e, {
|
|
1770
|
+
width: "narrow",
|
|
1771
|
+
context: "standalone"
|
|
1772
|
+
});
|
|
1773
|
+
case "LLLL":
|
|
1774
|
+
default:
|
|
1775
|
+
return t.month(e, { width: "wide", context: "standalone" }) || t.month(e, {
|
|
1776
|
+
width: "abbreviated",
|
|
1777
|
+
context: "standalone"
|
|
1778
|
+
}) || t.month(e, { width: "narrow", context: "standalone" });
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
validate(e, n) {
|
|
1782
|
+
return n >= 0 && n <= 11;
|
|
1783
|
+
}
|
|
1784
|
+
set(e, n, t) {
|
|
1785
|
+
return e.setMonth(t, 1), e.setHours(0, 0, 0, 0), e;
|
|
1786
|
+
}
|
|
1787
|
+
incompatibleTokens = [
|
|
1788
|
+
"Y",
|
|
1789
|
+
"R",
|
|
1790
|
+
"q",
|
|
1791
|
+
"Q",
|
|
1792
|
+
"M",
|
|
1793
|
+
"w",
|
|
1794
|
+
"I",
|
|
1795
|
+
"D",
|
|
1796
|
+
"i",
|
|
1797
|
+
"e",
|
|
1798
|
+
"c",
|
|
1799
|
+
"t",
|
|
1800
|
+
"T"
|
|
1801
|
+
];
|
|
1802
|
+
}
|
|
1803
|
+
function rn(r, e, n) {
|
|
1804
|
+
const t = _(r), a = Ye(t, n) - e;
|
|
1805
|
+
return t.setDate(t.getDate() - a * 7), t;
|
|
1806
|
+
}
|
|
1807
|
+
class an extends u {
|
|
1808
|
+
priority = 100;
|
|
1809
|
+
parse(e, n, t) {
|
|
1810
|
+
switch (n) {
|
|
1811
|
+
case "w":
|
|
1812
|
+
return p(y.week, e);
|
|
1813
|
+
case "wo":
|
|
1814
|
+
return t.ordinalNumber(e, { unit: "week" });
|
|
1815
|
+
default:
|
|
1816
|
+
return b(n.length, e);
|
|
1817
|
+
}
|
|
1818
|
+
}
|
|
1819
|
+
validate(e, n) {
|
|
1820
|
+
return n >= 1 && n <= 53;
|
|
1821
|
+
}
|
|
1822
|
+
set(e, n, t, a) {
|
|
1823
|
+
return $(rn(e, t, a), a);
|
|
1824
|
+
}
|
|
1825
|
+
incompatibleTokens = [
|
|
1826
|
+
"y",
|
|
1827
|
+
"R",
|
|
1828
|
+
"u",
|
|
1829
|
+
"q",
|
|
1830
|
+
"Q",
|
|
1831
|
+
"M",
|
|
1832
|
+
"L",
|
|
1833
|
+
"I",
|
|
1834
|
+
"d",
|
|
1835
|
+
"D",
|
|
1836
|
+
"i",
|
|
1837
|
+
"t",
|
|
1838
|
+
"T"
|
|
1839
|
+
];
|
|
1840
|
+
}
|
|
1841
|
+
function on(r, e) {
|
|
1842
|
+
const n = _(r), t = Te(n) - e;
|
|
1843
|
+
return n.setDate(n.getDate() - t * 7), n;
|
|
1844
|
+
}
|
|
1845
|
+
class sn extends u {
|
|
1846
|
+
priority = 100;
|
|
1847
|
+
parse(e, n, t) {
|
|
1848
|
+
switch (n) {
|
|
1849
|
+
case "I":
|
|
1850
|
+
return p(y.week, e);
|
|
1851
|
+
case "Io":
|
|
1852
|
+
return t.ordinalNumber(e, { unit: "week" });
|
|
1853
|
+
default:
|
|
1854
|
+
return b(n.length, e);
|
|
1855
|
+
}
|
|
1856
|
+
}
|
|
1857
|
+
validate(e, n) {
|
|
1858
|
+
return n >= 1 && n <= 53;
|
|
1859
|
+
}
|
|
1860
|
+
set(e, n, t) {
|
|
1861
|
+
return I(on(e, t));
|
|
1862
|
+
}
|
|
1863
|
+
incompatibleTokens = [
|
|
1864
|
+
"y",
|
|
1865
|
+
"Y",
|
|
1866
|
+
"u",
|
|
1867
|
+
"q",
|
|
1868
|
+
"Q",
|
|
1869
|
+
"M",
|
|
1870
|
+
"L",
|
|
1871
|
+
"w",
|
|
1872
|
+
"d",
|
|
1873
|
+
"D",
|
|
1874
|
+
"e",
|
|
1875
|
+
"c",
|
|
1876
|
+
"t",
|
|
1877
|
+
"T"
|
|
1878
|
+
];
|
|
1879
|
+
}
|
|
1880
|
+
const cn = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], ln = [
|
|
1881
|
+
31,
|
|
1882
|
+
29,
|
|
1883
|
+
31,
|
|
1884
|
+
30,
|
|
1885
|
+
31,
|
|
1886
|
+
30,
|
|
1887
|
+
31,
|
|
1888
|
+
31,
|
|
1889
|
+
30,
|
|
1890
|
+
31,
|
|
1891
|
+
30,
|
|
1892
|
+
31
|
|
1893
|
+
];
|
|
1894
|
+
class un extends u {
|
|
1895
|
+
priority = 90;
|
|
1896
|
+
subPriority = 1;
|
|
1897
|
+
parse(e, n, t) {
|
|
1898
|
+
switch (n) {
|
|
1899
|
+
case "d":
|
|
1900
|
+
return p(y.date, e);
|
|
1901
|
+
case "do":
|
|
1902
|
+
return t.ordinalNumber(e, { unit: "date" });
|
|
1903
|
+
default:
|
|
1904
|
+
return b(n.length, e);
|
|
1905
|
+
}
|
|
1906
|
+
}
|
|
1907
|
+
validate(e, n) {
|
|
1908
|
+
const t = e.getFullYear(), a = qe(t), o = e.getMonth();
|
|
1909
|
+
return a ? n >= 1 && n <= ln[o] : n >= 1 && n <= cn[o];
|
|
1910
|
+
}
|
|
1911
|
+
set(e, n, t) {
|
|
1912
|
+
return e.setDate(t), e.setHours(0, 0, 0, 0), e;
|
|
1913
|
+
}
|
|
1914
|
+
incompatibleTokens = [
|
|
1915
|
+
"Y",
|
|
1916
|
+
"R",
|
|
1917
|
+
"q",
|
|
1918
|
+
"Q",
|
|
1919
|
+
"w",
|
|
1920
|
+
"I",
|
|
1921
|
+
"D",
|
|
1922
|
+
"i",
|
|
1923
|
+
"e",
|
|
1924
|
+
"c",
|
|
1925
|
+
"t",
|
|
1926
|
+
"T"
|
|
1927
|
+
];
|
|
1928
|
+
}
|
|
1929
|
+
class dn extends u {
|
|
1930
|
+
priority = 90;
|
|
1931
|
+
subpriority = 1;
|
|
1932
|
+
parse(e, n, t) {
|
|
1933
|
+
switch (n) {
|
|
1934
|
+
case "D":
|
|
1935
|
+
case "DD":
|
|
1936
|
+
return p(y.dayOfYear, e);
|
|
1937
|
+
case "Do":
|
|
1938
|
+
return t.ordinalNumber(e, { unit: "date" });
|
|
1939
|
+
default:
|
|
1940
|
+
return b(n.length, e);
|
|
1941
|
+
}
|
|
1942
|
+
}
|
|
1943
|
+
validate(e, n) {
|
|
1944
|
+
const t = e.getFullYear();
|
|
1945
|
+
return qe(t) ? n >= 1 && n <= 366 : n >= 1 && n <= 365;
|
|
1946
|
+
}
|
|
1947
|
+
set(e, n, t) {
|
|
1948
|
+
return e.setMonth(0, t), e.setHours(0, 0, 0, 0), e;
|
|
1949
|
+
}
|
|
1950
|
+
incompatibleTokens = [
|
|
1951
|
+
"Y",
|
|
1952
|
+
"R",
|
|
1953
|
+
"q",
|
|
1954
|
+
"Q",
|
|
1955
|
+
"M",
|
|
1956
|
+
"L",
|
|
1957
|
+
"w",
|
|
1958
|
+
"I",
|
|
1959
|
+
"d",
|
|
1960
|
+
"E",
|
|
1961
|
+
"i",
|
|
1962
|
+
"e",
|
|
1963
|
+
"c",
|
|
1964
|
+
"t",
|
|
1965
|
+
"T"
|
|
1966
|
+
];
|
|
1967
|
+
}
|
|
1968
|
+
function oe(r, e, n) {
|
|
1969
|
+
const t = L(), a = n?.weekStartsOn ?? n?.locale?.options?.weekStartsOn ?? t.weekStartsOn ?? t.locale?.options?.weekStartsOn ?? 0, o = _(r), s = o.getDay(), h = (e % 7 + 7) % 7, v = 7 - a, f = e < 0 || e > 6 ? e - (s + v) % 7 : (h + v) % 7 - (s + v) % 7;
|
|
1970
|
+
return ne(o, f);
|
|
1971
|
+
}
|
|
1972
|
+
class hn extends u {
|
|
1973
|
+
priority = 90;
|
|
1974
|
+
parse(e, n, t) {
|
|
1975
|
+
switch (n) {
|
|
1976
|
+
case "E":
|
|
1977
|
+
case "EE":
|
|
1978
|
+
case "EEE":
|
|
1979
|
+
return t.day(e, {
|
|
1980
|
+
width: "abbreviated",
|
|
1981
|
+
context: "formatting"
|
|
1982
|
+
}) || t.day(e, { width: "short", context: "formatting" }) || t.day(e, { width: "narrow", context: "formatting" });
|
|
1983
|
+
case "EEEEE":
|
|
1984
|
+
return t.day(e, {
|
|
1985
|
+
width: "narrow",
|
|
1986
|
+
context: "formatting"
|
|
1987
|
+
});
|
|
1988
|
+
case "EEEEEE":
|
|
1989
|
+
return t.day(e, { width: "short", context: "formatting" }) || t.day(e, { width: "narrow", context: "formatting" });
|
|
1990
|
+
case "EEEE":
|
|
1991
|
+
default:
|
|
1992
|
+
return t.day(e, { width: "wide", context: "formatting" }) || t.day(e, {
|
|
1993
|
+
width: "abbreviated",
|
|
1994
|
+
context: "formatting"
|
|
1995
|
+
}) || t.day(e, { width: "short", context: "formatting" }) || t.day(e, { width: "narrow", context: "formatting" });
|
|
1996
|
+
}
|
|
1997
|
+
}
|
|
1998
|
+
validate(e, n) {
|
|
1999
|
+
return n >= 0 && n <= 6;
|
|
2000
|
+
}
|
|
2001
|
+
set(e, n, t, a) {
|
|
2002
|
+
return e = oe(e, t, a), e.setHours(0, 0, 0, 0), e;
|
|
2003
|
+
}
|
|
2004
|
+
incompatibleTokens = ["D", "i", "e", "c", "t", "T"];
|
|
2005
|
+
}
|
|
2006
|
+
class fn extends u {
|
|
2007
|
+
priority = 90;
|
|
2008
|
+
parse(e, n, t, a) {
|
|
2009
|
+
const o = (s) => {
|
|
2010
|
+
const i = Math.floor((s - 1) / 7) * 7;
|
|
2011
|
+
return (s + a.weekStartsOn + 6) % 7 + i;
|
|
2012
|
+
};
|
|
2013
|
+
switch (n) {
|
|
2014
|
+
case "e":
|
|
2015
|
+
case "ee":
|
|
2016
|
+
return g(b(n.length, e), o);
|
|
2017
|
+
case "eo":
|
|
2018
|
+
return g(
|
|
2019
|
+
t.ordinalNumber(e, {
|
|
2020
|
+
unit: "day"
|
|
2021
|
+
}),
|
|
2022
|
+
o
|
|
2023
|
+
);
|
|
2024
|
+
case "eee":
|
|
2025
|
+
return t.day(e, {
|
|
2026
|
+
width: "abbreviated",
|
|
2027
|
+
context: "formatting"
|
|
2028
|
+
}) || t.day(e, { width: "short", context: "formatting" }) || t.day(e, { width: "narrow", context: "formatting" });
|
|
2029
|
+
case "eeeee":
|
|
2030
|
+
return t.day(e, {
|
|
2031
|
+
width: "narrow",
|
|
2032
|
+
context: "formatting"
|
|
2033
|
+
});
|
|
2034
|
+
case "eeeeee":
|
|
2035
|
+
return t.day(e, { width: "short", context: "formatting" }) || t.day(e, { width: "narrow", context: "formatting" });
|
|
2036
|
+
case "eeee":
|
|
2037
|
+
default:
|
|
2038
|
+
return t.day(e, { width: "wide", context: "formatting" }) || t.day(e, {
|
|
2039
|
+
width: "abbreviated",
|
|
2040
|
+
context: "formatting"
|
|
2041
|
+
}) || t.day(e, { width: "short", context: "formatting" }) || t.day(e, { width: "narrow", context: "formatting" });
|
|
2042
|
+
}
|
|
2043
|
+
}
|
|
2044
|
+
validate(e, n) {
|
|
2045
|
+
return n >= 0 && n <= 6;
|
|
2046
|
+
}
|
|
2047
|
+
set(e, n, t, a) {
|
|
2048
|
+
return e = oe(e, t, a), e.setHours(0, 0, 0, 0), e;
|
|
2049
|
+
}
|
|
2050
|
+
incompatibleTokens = [
|
|
2051
|
+
"y",
|
|
2052
|
+
"R",
|
|
2053
|
+
"u",
|
|
2054
|
+
"q",
|
|
2055
|
+
"Q",
|
|
2056
|
+
"M",
|
|
2057
|
+
"L",
|
|
2058
|
+
"I",
|
|
2059
|
+
"d",
|
|
2060
|
+
"D",
|
|
2061
|
+
"E",
|
|
2062
|
+
"i",
|
|
2063
|
+
"c",
|
|
2064
|
+
"t",
|
|
2065
|
+
"T"
|
|
2066
|
+
];
|
|
2067
|
+
}
|
|
2068
|
+
class pn extends u {
|
|
2069
|
+
priority = 90;
|
|
2070
|
+
parse(e, n, t, a) {
|
|
2071
|
+
const o = (s) => {
|
|
2072
|
+
const i = Math.floor((s - 1) / 7) * 7;
|
|
2073
|
+
return (s + a.weekStartsOn + 6) % 7 + i;
|
|
2074
|
+
};
|
|
2075
|
+
switch (n) {
|
|
2076
|
+
case "c":
|
|
2077
|
+
case "cc":
|
|
2078
|
+
return g(b(n.length, e), o);
|
|
2079
|
+
case "co":
|
|
2080
|
+
return g(
|
|
2081
|
+
t.ordinalNumber(e, {
|
|
2082
|
+
unit: "day"
|
|
2083
|
+
}),
|
|
2084
|
+
o
|
|
2085
|
+
);
|
|
2086
|
+
case "ccc":
|
|
2087
|
+
return t.day(e, {
|
|
2088
|
+
width: "abbreviated",
|
|
2089
|
+
context: "standalone"
|
|
2090
|
+
}) || t.day(e, { width: "short", context: "standalone" }) || t.day(e, { width: "narrow", context: "standalone" });
|
|
2091
|
+
case "ccccc":
|
|
2092
|
+
return t.day(e, {
|
|
2093
|
+
width: "narrow",
|
|
2094
|
+
context: "standalone"
|
|
2095
|
+
});
|
|
2096
|
+
case "cccccc":
|
|
2097
|
+
return t.day(e, { width: "short", context: "standalone" }) || t.day(e, { width: "narrow", context: "standalone" });
|
|
2098
|
+
case "cccc":
|
|
2099
|
+
default:
|
|
2100
|
+
return t.day(e, { width: "wide", context: "standalone" }) || t.day(e, {
|
|
2101
|
+
width: "abbreviated",
|
|
2102
|
+
context: "standalone"
|
|
2103
|
+
}) || t.day(e, { width: "short", context: "standalone" }) || t.day(e, { width: "narrow", context: "standalone" });
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
validate(e, n) {
|
|
2107
|
+
return n >= 0 && n <= 6;
|
|
2108
|
+
}
|
|
2109
|
+
set(e, n, t, a) {
|
|
2110
|
+
return e = oe(e, t, a), e.setHours(0, 0, 0, 0), e;
|
|
2111
|
+
}
|
|
2112
|
+
incompatibleTokens = [
|
|
2113
|
+
"y",
|
|
2114
|
+
"R",
|
|
2115
|
+
"u",
|
|
2116
|
+
"q",
|
|
2117
|
+
"Q",
|
|
2118
|
+
"M",
|
|
2119
|
+
"L",
|
|
2120
|
+
"I",
|
|
2121
|
+
"d",
|
|
2122
|
+
"D",
|
|
2123
|
+
"E",
|
|
2124
|
+
"i",
|
|
2125
|
+
"e",
|
|
2126
|
+
"t",
|
|
2127
|
+
"T"
|
|
2128
|
+
];
|
|
2129
|
+
}
|
|
2130
|
+
function mn(r, e) {
|
|
2131
|
+
const n = _(r), t = At(n), a = e - t;
|
|
2132
|
+
return ne(n, a);
|
|
2133
|
+
}
|
|
2134
|
+
class wn extends u {
|
|
2135
|
+
priority = 90;
|
|
2136
|
+
parse(e, n, t) {
|
|
2137
|
+
const a = (o) => o === 0 ? 7 : o;
|
|
2138
|
+
switch (n) {
|
|
2139
|
+
case "i":
|
|
2140
|
+
case "ii":
|
|
2141
|
+
return b(n.length, e);
|
|
2142
|
+
case "io":
|
|
2143
|
+
return t.ordinalNumber(e, { unit: "day" });
|
|
2144
|
+
case "iii":
|
|
2145
|
+
return g(
|
|
2146
|
+
t.day(e, {
|
|
2147
|
+
width: "abbreviated",
|
|
2148
|
+
context: "formatting"
|
|
2149
|
+
}) || t.day(e, {
|
|
2150
|
+
width: "short",
|
|
2151
|
+
context: "formatting"
|
|
2152
|
+
}) || t.day(e, {
|
|
2153
|
+
width: "narrow",
|
|
2154
|
+
context: "formatting"
|
|
2155
|
+
}),
|
|
2156
|
+
a
|
|
2157
|
+
);
|
|
2158
|
+
case "iiiii":
|
|
2159
|
+
return g(
|
|
2160
|
+
t.day(e, {
|
|
2161
|
+
width: "narrow",
|
|
2162
|
+
context: "formatting"
|
|
2163
|
+
}),
|
|
2164
|
+
a
|
|
2165
|
+
);
|
|
2166
|
+
case "iiiiii":
|
|
2167
|
+
return g(
|
|
2168
|
+
t.day(e, {
|
|
2169
|
+
width: "short",
|
|
2170
|
+
context: "formatting"
|
|
2171
|
+
}) || t.day(e, {
|
|
2172
|
+
width: "narrow",
|
|
2173
|
+
context: "formatting"
|
|
2174
|
+
}),
|
|
2175
|
+
a
|
|
2176
|
+
);
|
|
2177
|
+
case "iiii":
|
|
2178
|
+
default:
|
|
2179
|
+
return g(
|
|
2180
|
+
t.day(e, {
|
|
2181
|
+
width: "wide",
|
|
2182
|
+
context: "formatting"
|
|
2183
|
+
}) || t.day(e, {
|
|
2184
|
+
width: "abbreviated",
|
|
2185
|
+
context: "formatting"
|
|
2186
|
+
}) || t.day(e, {
|
|
2187
|
+
width: "short",
|
|
2188
|
+
context: "formatting"
|
|
2189
|
+
}) || t.day(e, {
|
|
2190
|
+
width: "narrow",
|
|
2191
|
+
context: "formatting"
|
|
2192
|
+
}),
|
|
2193
|
+
a
|
|
2194
|
+
);
|
|
2195
|
+
}
|
|
2196
|
+
}
|
|
2197
|
+
validate(e, n) {
|
|
2198
|
+
return n >= 1 && n <= 7;
|
|
2199
|
+
}
|
|
2200
|
+
set(e, n, t) {
|
|
2201
|
+
return e = mn(e, t), e.setHours(0, 0, 0, 0), e;
|
|
2202
|
+
}
|
|
2203
|
+
incompatibleTokens = [
|
|
2204
|
+
"y",
|
|
2205
|
+
"Y",
|
|
2206
|
+
"u",
|
|
2207
|
+
"q",
|
|
2208
|
+
"Q",
|
|
2209
|
+
"M",
|
|
2210
|
+
"L",
|
|
2211
|
+
"w",
|
|
2212
|
+
"d",
|
|
2213
|
+
"D",
|
|
2214
|
+
"E",
|
|
2215
|
+
"e",
|
|
2216
|
+
"c",
|
|
2217
|
+
"t",
|
|
2218
|
+
"T"
|
|
2219
|
+
];
|
|
2220
|
+
}
|
|
2221
|
+
class bn extends u {
|
|
2222
|
+
priority = 80;
|
|
2223
|
+
parse(e, n, t) {
|
|
2224
|
+
switch (n) {
|
|
2225
|
+
case "a":
|
|
2226
|
+
case "aa":
|
|
2227
|
+
case "aaa":
|
|
2228
|
+
return t.dayPeriod(e, {
|
|
2229
|
+
width: "abbreviated",
|
|
2230
|
+
context: "formatting"
|
|
2231
|
+
}) || t.dayPeriod(e, {
|
|
2232
|
+
width: "narrow",
|
|
2233
|
+
context: "formatting"
|
|
2234
|
+
});
|
|
2235
|
+
case "aaaaa":
|
|
2236
|
+
return t.dayPeriod(e, {
|
|
2237
|
+
width: "narrow",
|
|
2238
|
+
context: "formatting"
|
|
2239
|
+
});
|
|
2240
|
+
case "aaaa":
|
|
2241
|
+
default:
|
|
2242
|
+
return t.dayPeriod(e, {
|
|
2243
|
+
width: "wide",
|
|
2244
|
+
context: "formatting"
|
|
2245
|
+
}) || t.dayPeriod(e, {
|
|
2246
|
+
width: "abbreviated",
|
|
2247
|
+
context: "formatting"
|
|
2248
|
+
}) || t.dayPeriod(e, {
|
|
2249
|
+
width: "narrow",
|
|
2250
|
+
context: "formatting"
|
|
2251
|
+
});
|
|
2252
|
+
}
|
|
2253
|
+
}
|
|
2254
|
+
set(e, n, t) {
|
|
2255
|
+
return e.setHours(ae(t), 0, 0, 0), e;
|
|
2256
|
+
}
|
|
2257
|
+
incompatibleTokens = ["b", "B", "H", "k", "t", "T"];
|
|
2258
|
+
}
|
|
2259
|
+
class yn extends u {
|
|
2260
|
+
priority = 80;
|
|
2261
|
+
parse(e, n, t) {
|
|
2262
|
+
switch (n) {
|
|
2263
|
+
case "b":
|
|
2264
|
+
case "bb":
|
|
2265
|
+
case "bbb":
|
|
2266
|
+
return t.dayPeriod(e, {
|
|
2267
|
+
width: "abbreviated",
|
|
2268
|
+
context: "formatting"
|
|
2269
|
+
}) || t.dayPeriod(e, {
|
|
2270
|
+
width: "narrow",
|
|
2271
|
+
context: "formatting"
|
|
2272
|
+
});
|
|
2273
|
+
case "bbbbb":
|
|
2274
|
+
return t.dayPeriod(e, {
|
|
2275
|
+
width: "narrow",
|
|
2276
|
+
context: "formatting"
|
|
2277
|
+
});
|
|
2278
|
+
case "bbbb":
|
|
2279
|
+
default:
|
|
2280
|
+
return t.dayPeriod(e, {
|
|
2281
|
+
width: "wide",
|
|
2282
|
+
context: "formatting"
|
|
2283
|
+
}) || t.dayPeriod(e, {
|
|
2284
|
+
width: "abbreviated",
|
|
2285
|
+
context: "formatting"
|
|
2286
|
+
}) || t.dayPeriod(e, {
|
|
2287
|
+
width: "narrow",
|
|
2288
|
+
context: "formatting"
|
|
2289
|
+
});
|
|
2290
|
+
}
|
|
2291
|
+
}
|
|
2292
|
+
set(e, n, t) {
|
|
2293
|
+
return e.setHours(ae(t), 0, 0, 0), e;
|
|
2294
|
+
}
|
|
2295
|
+
incompatibleTokens = ["a", "B", "H", "k", "t", "T"];
|
|
2296
|
+
}
|
|
2297
|
+
class gn extends u {
|
|
2298
|
+
priority = 80;
|
|
2299
|
+
parse(e, n, t) {
|
|
2300
|
+
switch (n) {
|
|
2301
|
+
case "B":
|
|
2302
|
+
case "BB":
|
|
2303
|
+
case "BBB":
|
|
2304
|
+
return t.dayPeriod(e, {
|
|
2305
|
+
width: "abbreviated",
|
|
2306
|
+
context: "formatting"
|
|
2307
|
+
}) || t.dayPeriod(e, {
|
|
2308
|
+
width: "narrow",
|
|
2309
|
+
context: "formatting"
|
|
2310
|
+
});
|
|
2311
|
+
case "BBBBB":
|
|
2312
|
+
return t.dayPeriod(e, {
|
|
2313
|
+
width: "narrow",
|
|
2314
|
+
context: "formatting"
|
|
2315
|
+
});
|
|
2316
|
+
case "BBBB":
|
|
2317
|
+
default:
|
|
2318
|
+
return t.dayPeriod(e, {
|
|
2319
|
+
width: "wide",
|
|
2320
|
+
context: "formatting"
|
|
2321
|
+
}) || t.dayPeriod(e, {
|
|
2322
|
+
width: "abbreviated",
|
|
2323
|
+
context: "formatting"
|
|
2324
|
+
}) || t.dayPeriod(e, {
|
|
2325
|
+
width: "narrow",
|
|
2326
|
+
context: "formatting"
|
|
2327
|
+
});
|
|
2328
|
+
}
|
|
2329
|
+
}
|
|
2330
|
+
set(e, n, t) {
|
|
2331
|
+
return e.setHours(ae(t), 0, 0, 0), e;
|
|
2332
|
+
}
|
|
2333
|
+
incompatibleTokens = ["a", "b", "t", "T"];
|
|
2334
|
+
}
|
|
2335
|
+
class xn extends u {
|
|
2336
|
+
priority = 70;
|
|
2337
|
+
parse(e, n, t) {
|
|
2338
|
+
switch (n) {
|
|
2339
|
+
case "h":
|
|
2340
|
+
return p(y.hour12h, e);
|
|
2341
|
+
case "ho":
|
|
2342
|
+
return t.ordinalNumber(e, { unit: "hour" });
|
|
2343
|
+
default:
|
|
2344
|
+
return b(n.length, e);
|
|
2345
|
+
}
|
|
2346
|
+
}
|
|
2347
|
+
validate(e, n) {
|
|
2348
|
+
return n >= 1 && n <= 12;
|
|
2349
|
+
}
|
|
2350
|
+
set(e, n, t) {
|
|
2351
|
+
const a = e.getHours() >= 12;
|
|
2352
|
+
return a && t < 12 ? e.setHours(t + 12, 0, 0, 0) : !a && t === 12 ? e.setHours(0, 0, 0, 0) : e.setHours(t, 0, 0, 0), e;
|
|
2353
|
+
}
|
|
2354
|
+
incompatibleTokens = ["H", "K", "k", "t", "T"];
|
|
2355
|
+
}
|
|
2356
|
+
class _n extends u {
|
|
2357
|
+
priority = 70;
|
|
2358
|
+
parse(e, n, t) {
|
|
2359
|
+
switch (n) {
|
|
2360
|
+
case "H":
|
|
2361
|
+
return p(y.hour23h, e);
|
|
2362
|
+
case "Ho":
|
|
2363
|
+
return t.ordinalNumber(e, { unit: "hour" });
|
|
2364
|
+
default:
|
|
2365
|
+
return b(n.length, e);
|
|
2366
|
+
}
|
|
2367
|
+
}
|
|
2368
|
+
validate(e, n) {
|
|
2369
|
+
return n >= 0 && n <= 23;
|
|
2370
|
+
}
|
|
2371
|
+
set(e, n, t) {
|
|
2372
|
+
return e.setHours(t, 0, 0, 0), e;
|
|
2373
|
+
}
|
|
2374
|
+
incompatibleTokens = ["a", "b", "h", "K", "k", "t", "T"];
|
|
2375
|
+
}
|
|
2376
|
+
class vn extends u {
|
|
2377
|
+
priority = 70;
|
|
2378
|
+
parse(e, n, t) {
|
|
2379
|
+
switch (n) {
|
|
2380
|
+
case "K":
|
|
2381
|
+
return p(y.hour11h, e);
|
|
2382
|
+
case "Ko":
|
|
2383
|
+
return t.ordinalNumber(e, { unit: "hour" });
|
|
2384
|
+
default:
|
|
2385
|
+
return b(n.length, e);
|
|
2386
|
+
}
|
|
2387
|
+
}
|
|
2388
|
+
validate(e, n) {
|
|
2389
|
+
return n >= 0 && n <= 11;
|
|
2390
|
+
}
|
|
2391
|
+
set(e, n, t) {
|
|
2392
|
+
return e.getHours() >= 12 && t < 12 ? e.setHours(t + 12, 0, 0, 0) : e.setHours(t, 0, 0, 0), e;
|
|
2393
|
+
}
|
|
2394
|
+
incompatibleTokens = ["h", "H", "k", "t", "T"];
|
|
2395
|
+
}
|
|
2396
|
+
class Mn extends u {
|
|
2397
|
+
priority = 70;
|
|
2398
|
+
parse(e, n, t) {
|
|
2399
|
+
switch (n) {
|
|
2400
|
+
case "k":
|
|
2401
|
+
return p(y.hour24h, e);
|
|
2402
|
+
case "ko":
|
|
2403
|
+
return t.ordinalNumber(e, { unit: "hour" });
|
|
2404
|
+
default:
|
|
2405
|
+
return b(n.length, e);
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
2408
|
+
validate(e, n) {
|
|
2409
|
+
return n >= 1 && n <= 24;
|
|
2410
|
+
}
|
|
2411
|
+
set(e, n, t) {
|
|
2412
|
+
const a = t <= 24 ? t % 24 : t;
|
|
2413
|
+
return e.setHours(a, 0, 0, 0), e;
|
|
2414
|
+
}
|
|
2415
|
+
incompatibleTokens = ["a", "b", "h", "H", "K", "t", "T"];
|
|
2416
|
+
}
|
|
2417
|
+
class kn extends u {
|
|
2418
|
+
priority = 60;
|
|
2419
|
+
parse(e, n, t) {
|
|
2420
|
+
switch (n) {
|
|
2421
|
+
case "m":
|
|
2422
|
+
return p(y.minute, e);
|
|
2423
|
+
case "mo":
|
|
2424
|
+
return t.ordinalNumber(e, { unit: "minute" });
|
|
2425
|
+
default:
|
|
2426
|
+
return b(n.length, e);
|
|
2427
|
+
}
|
|
2428
|
+
}
|
|
2429
|
+
validate(e, n) {
|
|
2430
|
+
return n >= 0 && n <= 59;
|
|
2431
|
+
}
|
|
2432
|
+
set(e, n, t) {
|
|
2433
|
+
return e.setMinutes(t, 0, 0), e;
|
|
2434
|
+
}
|
|
2435
|
+
incompatibleTokens = ["t", "T"];
|
|
2436
|
+
}
|
|
2437
|
+
class Dn extends u {
|
|
2438
|
+
priority = 50;
|
|
2439
|
+
parse(e, n, t) {
|
|
2440
|
+
switch (n) {
|
|
2441
|
+
case "s":
|
|
2442
|
+
return p(y.second, e);
|
|
2443
|
+
case "so":
|
|
2444
|
+
return t.ordinalNumber(e, { unit: "second" });
|
|
2445
|
+
default:
|
|
2446
|
+
return b(n.length, e);
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
validate(e, n) {
|
|
2450
|
+
return n >= 0 && n <= 59;
|
|
2451
|
+
}
|
|
2452
|
+
set(e, n, t) {
|
|
2453
|
+
return e.setSeconds(t, 0), e;
|
|
2454
|
+
}
|
|
2455
|
+
incompatibleTokens = ["t", "T"];
|
|
2456
|
+
}
|
|
2457
|
+
class Pn extends u {
|
|
2458
|
+
priority = 30;
|
|
2459
|
+
parse(e, n) {
|
|
2460
|
+
const t = (a) => Math.trunc(a * Math.pow(10, -n.length + 3));
|
|
2461
|
+
return g(b(n.length, e), t);
|
|
2462
|
+
}
|
|
2463
|
+
set(e, n, t) {
|
|
2464
|
+
return e.setMilliseconds(t), e;
|
|
2465
|
+
}
|
|
2466
|
+
incompatibleTokens = ["t", "T"];
|
|
2467
|
+
}
|
|
2468
|
+
class Tn extends u {
|
|
2469
|
+
priority = 10;
|
|
2470
|
+
parse(e, n) {
|
|
2471
|
+
switch (n) {
|
|
2472
|
+
case "X":
|
|
2473
|
+
return T(
|
|
2474
|
+
P.basicOptionalMinutes,
|
|
2475
|
+
e
|
|
2476
|
+
);
|
|
2477
|
+
case "XX":
|
|
2478
|
+
return T(P.basic, e);
|
|
2479
|
+
case "XXXX":
|
|
2480
|
+
return T(
|
|
2481
|
+
P.basicOptionalSeconds,
|
|
2482
|
+
e
|
|
2483
|
+
);
|
|
2484
|
+
case "XXXXX":
|
|
2485
|
+
return T(
|
|
2486
|
+
P.extendedOptionalSeconds,
|
|
2487
|
+
e
|
|
2488
|
+
);
|
|
2489
|
+
case "XXX":
|
|
2490
|
+
default:
|
|
2491
|
+
return T(P.extended, e);
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
set(e, n, t) {
|
|
2495
|
+
return n.timestampIsSet ? e : w(
|
|
2496
|
+
e,
|
|
2497
|
+
e.getTime() - X(e) - t
|
|
2498
|
+
);
|
|
2499
|
+
}
|
|
2500
|
+
incompatibleTokens = ["t", "T", "x"];
|
|
2501
|
+
}
|
|
2502
|
+
class Yn extends u {
|
|
2503
|
+
priority = 10;
|
|
2504
|
+
parse(e, n) {
|
|
2505
|
+
switch (n) {
|
|
2506
|
+
case "x":
|
|
2507
|
+
return T(
|
|
2508
|
+
P.basicOptionalMinutes,
|
|
2509
|
+
e
|
|
2510
|
+
);
|
|
2511
|
+
case "xx":
|
|
2512
|
+
return T(P.basic, e);
|
|
2513
|
+
case "xxxx":
|
|
2514
|
+
return T(
|
|
2515
|
+
P.basicOptionalSeconds,
|
|
2516
|
+
e
|
|
2517
|
+
);
|
|
2518
|
+
case "xxxxx":
|
|
2519
|
+
return T(
|
|
2520
|
+
P.extendedOptionalSeconds,
|
|
2521
|
+
e
|
|
2522
|
+
);
|
|
2523
|
+
case "xxx":
|
|
2524
|
+
default:
|
|
2525
|
+
return T(P.extended, e);
|
|
2526
|
+
}
|
|
2527
|
+
}
|
|
2528
|
+
set(e, n, t) {
|
|
2529
|
+
return n.timestampIsSet ? e : w(
|
|
2530
|
+
e,
|
|
2531
|
+
e.getTime() - X(e) - t
|
|
2532
|
+
);
|
|
2533
|
+
}
|
|
2534
|
+
incompatibleTokens = ["t", "T", "X"];
|
|
2535
|
+
}
|
|
2536
|
+
class On extends u {
|
|
2537
|
+
priority = 40;
|
|
2538
|
+
parse(e) {
|
|
2539
|
+
return Ne(e);
|
|
2540
|
+
}
|
|
2541
|
+
set(e, n, t) {
|
|
2542
|
+
return [w(e, t * 1e3), { timestampIsSet: !0 }];
|
|
2543
|
+
}
|
|
2544
|
+
incompatibleTokens = "*";
|
|
2545
|
+
}
|
|
2546
|
+
class Cn extends u {
|
|
2547
|
+
priority = 20;
|
|
2548
|
+
parse(e) {
|
|
2549
|
+
return Ne(e);
|
|
2550
|
+
}
|
|
2551
|
+
set(e, n, t) {
|
|
2552
|
+
return [w(e, t), { timestampIsSet: !0 }];
|
|
2553
|
+
}
|
|
2554
|
+
incompatibleTokens = "*";
|
|
2555
|
+
}
|
|
2556
|
+
const $n = {
|
|
2557
|
+
G: new zt(),
|
|
2558
|
+
y: new Kt(),
|
|
2559
|
+
Y: new Jt(),
|
|
2560
|
+
R: new Ut(),
|
|
2561
|
+
u: new Zt(),
|
|
2562
|
+
Q: new St(),
|
|
2563
|
+
q: new en(),
|
|
2564
|
+
M: new tn(),
|
|
2565
|
+
L: new nn(),
|
|
2566
|
+
w: new an(),
|
|
2567
|
+
I: new sn(),
|
|
2568
|
+
d: new un(),
|
|
2569
|
+
D: new dn(),
|
|
2570
|
+
E: new hn(),
|
|
2571
|
+
e: new fn(),
|
|
2572
|
+
c: new pn(),
|
|
2573
|
+
i: new wn(),
|
|
2574
|
+
a: new bn(),
|
|
2575
|
+
b: new yn(),
|
|
2576
|
+
B: new gn(),
|
|
2577
|
+
h: new xn(),
|
|
2578
|
+
H: new _n(),
|
|
2579
|
+
K: new vn(),
|
|
2580
|
+
k: new Mn(),
|
|
2581
|
+
m: new kn(),
|
|
2582
|
+
s: new Dn(),
|
|
2583
|
+
S: new Pn(),
|
|
2584
|
+
X: new Tn(),
|
|
2585
|
+
x: new Yn(),
|
|
2586
|
+
t: new On(),
|
|
2587
|
+
T: new Cn()
|
|
2588
|
+
}, En = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Nn = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Wn = /^'([^]*?)'?$/, qn = /''/g, Fn = /\S/, In = /[a-zA-Z]/;
|
|
2589
|
+
function Ln(r, e, n, t) {
|
|
2590
|
+
const a = Bt(), o = a.locale ?? Pe, s = a.firstWeekContainsDate ?? a.locale?.options?.firstWeekContainsDate ?? 1, i = a.weekStartsOn ?? a.locale?.options?.weekStartsOn ?? 0;
|
|
2591
|
+
if (e === "")
|
|
2592
|
+
return r === "" ? _(n) : w(n, NaN);
|
|
2593
|
+
const h = {
|
|
2594
|
+
firstWeekContainsDate: s,
|
|
2595
|
+
weekStartsOn: i,
|
|
2596
|
+
locale: o
|
|
2597
|
+
}, v = [new jt()], f = e.match(Nn).map((c) => {
|
|
2598
|
+
const m = c[0];
|
|
2599
|
+
if (m in ee) {
|
|
2600
|
+
const k = ee[m];
|
|
2601
|
+
return k(c, o.formatLong);
|
|
2602
|
+
}
|
|
2603
|
+
return c;
|
|
2604
|
+
}).join("").match(En), d = [];
|
|
2605
|
+
for (let c of f) {
|
|
2606
|
+
$e(c) && te(c, e, r), Ce(c) && te(c, e, r);
|
|
2607
|
+
const m = c[0], k = $n[m];
|
|
2608
|
+
if (k) {
|
|
2609
|
+
const { incompatibleTokens: ie } = k;
|
|
2610
|
+
if (Array.isArray(ie)) {
|
|
2611
|
+
const ce = d.find(
|
|
2612
|
+
(le) => ie.includes(le.token) || le.token === m
|
|
2613
|
+
);
|
|
2614
|
+
if (ce)
|
|
2615
|
+
throw new RangeError(
|
|
2616
|
+
`The format string mustn't contain \`${ce.fullToken}\` and \`${c}\` at the same time`
|
|
2617
|
+
);
|
|
2618
|
+
} else if (k.incompatibleTokens === "*" && d.length > 0)
|
|
2619
|
+
throw new RangeError(
|
|
2620
|
+
`The format string mustn't contain \`${c}\` and any other token at the same time`
|
|
2621
|
+
);
|
|
2622
|
+
d.push({ token: m, fullToken: c });
|
|
2623
|
+
const J = k.run(
|
|
2624
|
+
r,
|
|
2625
|
+
c,
|
|
2626
|
+
o.match,
|
|
2627
|
+
h
|
|
2628
|
+
);
|
|
2629
|
+
if (!J)
|
|
2630
|
+
return w(n, NaN);
|
|
2631
|
+
v.push(J.setter), r = J.rest;
|
|
2632
|
+
} else {
|
|
2633
|
+
if (m.match(In))
|
|
2634
|
+
throw new RangeError(
|
|
2635
|
+
"Format string contains an unescaped latin alphabet character `" + m + "`"
|
|
2636
|
+
);
|
|
2637
|
+
if (c === "''" ? c = "'" : m === "'" && (c = Hn(c)), r.indexOf(c) === 0)
|
|
2638
|
+
r = r.slice(c.length);
|
|
2639
|
+
else
|
|
2640
|
+
return w(n, NaN);
|
|
2641
|
+
}
|
|
2642
|
+
}
|
|
2643
|
+
if (r.length > 0 && Fn.test(r))
|
|
2644
|
+
return w(n, NaN);
|
|
2645
|
+
const O = v.map((c) => c.priority).sort((c, m) => m - c).filter((c, m, k) => k.indexOf(c) === m).map(
|
|
2646
|
+
(c) => v.filter((m) => m.priority === c).sort((m, k) => k.subPriority - m.subPriority)
|
|
2647
|
+
).map((c) => c[0]);
|
|
2648
|
+
let W = _(n);
|
|
2649
|
+
if (isNaN(W.getTime()))
|
|
2650
|
+
return w(n, NaN);
|
|
2651
|
+
const se = {};
|
|
2652
|
+
for (const c of O) {
|
|
2653
|
+
if (!c.validate(W, h))
|
|
2654
|
+
return w(n, NaN);
|
|
2655
|
+
const m = c.set(W, se, h);
|
|
2656
|
+
Array.isArray(m) ? (W = m[0], Object.assign(se, m[1])) : W = m;
|
|
2657
|
+
}
|
|
2658
|
+
return w(n, W);
|
|
2659
|
+
}
|
|
2660
|
+
function Hn(r) {
|
|
2661
|
+
return r.match(Wn)[1].replace(qn, "'");
|
|
2662
|
+
}
|
|
2663
|
+
const z = (r) => Qt(r, {}), we = (r = /* @__PURE__ */ new Date()) => z(r), K = (r) => {
|
|
2664
|
+
const [e, n, t] = r.split("-");
|
|
2665
|
+
return new Date(parseInt(e), parseInt(n) - 1, parseInt(t));
|
|
2666
|
+
}, G = (r, e) => {
|
|
2667
|
+
const n = K(r), t = new Date(n);
|
|
2668
|
+
return t.setDate(t.getDate() + e), z(t);
|
|
2669
|
+
}, be = (r, e) => r > e ? 1 : r < e ? -1 : 0, Rn = (r) => r.length === 3, Qn = (r) => r.every((e) => /^\d+$/.test(e)), Bn = ([r, e, n]) => {
|
|
2670
|
+
const t = parseInt(r), a = parseInt(e) - 1, o = parseInt(n), s = new Date(t, a, o);
|
|
2671
|
+
return s.getFullYear() === t && s.getMonth() === a && s.getDate() === o;
|
|
2672
|
+
}, An = (r) => {
|
|
2673
|
+
const e = r.split("-");
|
|
2674
|
+
return Rn(e) && Qn(e) && Bn(e);
|
|
2675
|
+
}, ur = (r, e) => {
|
|
2676
|
+
const n = K(r);
|
|
2677
|
+
return Ht(n, e.dateFormat);
|
|
2678
|
+
}, dr = (r, e) => {
|
|
2679
|
+
const n = Ln(r, e.dateFormat, /* @__PURE__ */ new Date());
|
|
2680
|
+
return z(n);
|
|
2681
|
+
}, S = (r = /* @__PURE__ */ new Date()) => ({
|
|
2682
|
+
month: r.getMonth(),
|
|
2683
|
+
year: r.getFullYear()
|
|
2684
|
+
}), B = (r) => {
|
|
2685
|
+
const e = K(r);
|
|
2686
|
+
return { month: e.getMonth(), year: e.getFullYear() };
|
|
2687
|
+
}, M = ({ month: r, year: e }, n) => {
|
|
2688
|
+
const t = new Date(e, r);
|
|
2689
|
+
return t.setMonth(t.getMonth() + n), { month: t.getMonth(), year: t.getFullYear() };
|
|
2690
|
+
}, N = (r, e) => r.year === e.year ? r.month - e.month : r.year - e.year, A = (r, e) => N(r, e) === 0, Fe = ({ month: r, year: e }) => `${e.toString().padStart(4, "0")}-${(r + 1).toString().padStart(2, "0")}`, ye = (r) => K(r).getFullYear(), Ie = 4, Vn = (r, e) => {
|
|
2691
|
+
const n = [];
|
|
2692
|
+
let t = [];
|
|
2693
|
+
for (let a = 0; a < 12; a++) {
|
|
2694
|
+
const o = { month: a, year: r };
|
|
2695
|
+
t.push({
|
|
2696
|
+
label: e.months.shorthand[a],
|
|
2697
|
+
monthName: e.months.name[a],
|
|
2698
|
+
month: o
|
|
2699
|
+
}), t.length === Ie && (n.push(t), t = []);
|
|
2700
|
+
}
|
|
2701
|
+
return n;
|
|
2702
|
+
}, Gn = (r) => {
|
|
2703
|
+
const e = r.firstDayOfWeek, n = (a) => (a + e) % 7, t = [];
|
|
2704
|
+
for (let a = 0; a < 7; a++)
|
|
2705
|
+
t.push({
|
|
2706
|
+
name: r.weekdays.name[n(a)],
|
|
2707
|
+
shortName: r.weekdays.shorthand[n(a)]
|
|
2708
|
+
});
|
|
2709
|
+
return t;
|
|
2710
|
+
}, Xn = (r, e) => ({
|
|
2711
|
+
date: z(r),
|
|
2712
|
+
label: `${r.getDate()}`,
|
|
2713
|
+
isOutsideMonth: e
|
|
2714
|
+
});
|
|
2715
|
+
function jn(r, e) {
|
|
2716
|
+
return r < 0 || r >= e;
|
|
2717
|
+
}
|
|
2718
|
+
const zn = ({ month: r, year: e }, n) => {
|
|
2719
|
+
const t = [], a = new Date(e, r, 1), o = new Date(e, r + 1, 0), s = n(a), i = o.getDate(), h = 7 - n(o), v = i + s + h;
|
|
2720
|
+
let f = [];
|
|
2721
|
+
for (let d = 0; d < v; d++) {
|
|
2722
|
+
const O = d - s;
|
|
2723
|
+
f.push(
|
|
2724
|
+
Xn(
|
|
2725
|
+
ne(a, O),
|
|
2726
|
+
jn(O, i)
|
|
2727
|
+
)
|
|
2728
|
+
), f.length === 7 && (t.push(f), f = []);
|
|
2729
|
+
}
|
|
2730
|
+
return t;
|
|
2731
|
+
}, Kn = (r, e) => {
|
|
2732
|
+
const { firstDayOfWeek: n } = e, t = (a) => (a.getDay() - n + 7) % 7;
|
|
2733
|
+
return {
|
|
2734
|
+
weekdays: Gn(e),
|
|
2735
|
+
grid: zn(r, t)
|
|
2736
|
+
};
|
|
2737
|
+
};
|
|
2738
|
+
var Jn = Object.defineProperty, Un = Object.getOwnPropertyDescriptor, Y = (r, e, n, t) => {
|
|
2739
|
+
for (var a = t > 1 ? void 0 : t ? Un(e, n) : e, o = r.length - 1, s; o >= 0; o--)
|
|
2740
|
+
(s = r[o]) && (a = (t ? s(e, n, a) : s(a)) || a);
|
|
2741
|
+
return t && a && Jn(e, n, a), a;
|
|
2742
|
+
};
|
|
2743
|
+
const hr = (r) => {
|
|
2744
|
+
class e extends r {
|
|
2745
|
+
// --- Core ---
|
|
2746
|
+
constructor(...t) {
|
|
2747
|
+
super(...t), this._selectedMonth = S(), this._currentDate = we(), this._currentMonth = S(), this._numCalendars = 1, this._hideDatesOutsideMonth = !1, this._lastFocussedDate = null, this._monthPickerYear = null, this._lastFocussedMonth = null, this.value = "";
|
|
2748
|
+
}
|
|
2749
|
+
/**
|
|
2750
|
+
* @internal
|
|
2751
|
+
*/
|
|
2752
|
+
_adjustSelectedMonthToEnsureVisibilityOf(t) {
|
|
2753
|
+
const a = B(t), o = this._selectedMonth, s = M(
|
|
2754
|
+
this._selectedMonth,
|
|
2755
|
+
this._numCalendars - 1
|
|
2756
|
+
);
|
|
2757
|
+
return N(a, o) < 0 ? (this._selectedMonth = a, !0) : N(a, s) > 0 ? (this._selectedMonth = M(a, 1 - this._numCalendars), !0) : !1;
|
|
2758
|
+
}
|
|
2759
|
+
/**
|
|
2760
|
+
* @internal
|
|
2761
|
+
*/
|
|
2762
|
+
_isDateInValidRange(t) {
|
|
2763
|
+
return (!this._resolvedMinDate || be(t, this._resolvedMinDate) >= 0) && (!this._resolvedMaxDate || be(t, this._resolvedMaxDate) <= 0);
|
|
2764
|
+
}
|
|
2765
|
+
#e(t) {
|
|
2766
|
+
return this._resolvedMaxDate && N(t, B(this._resolvedMaxDate)) > 0;
|
|
2767
|
+
}
|
|
2768
|
+
#t(t) {
|
|
2769
|
+
return this._resolvedMinDate && N(t, B(this._resolvedMinDate)) < 0;
|
|
2770
|
+
}
|
|
2771
|
+
/**
|
|
2772
|
+
* @internal
|
|
2773
|
+
*/
|
|
2774
|
+
_isMonthInValidRange(t) {
|
|
2775
|
+
return !(this.#t(t) || this.#e(t));
|
|
2776
|
+
}
|
|
2777
|
+
/**
|
|
2778
|
+
* @internal
|
|
2779
|
+
*/
|
|
2780
|
+
_closePopup(t = !0) {
|
|
2781
|
+
super._closePopup(t), this._monthPickerYear = null;
|
|
2782
|
+
}
|
|
2783
|
+
/**
|
|
2784
|
+
* @internal
|
|
2785
|
+
*/
|
|
2786
|
+
_onPickerButtonClick() {
|
|
2787
|
+
if (super._onPickerButtonClick(), this._popupOpen) {
|
|
2788
|
+
U.processUpdates();
|
|
2789
|
+
const t = this._tabbableDate;
|
|
2790
|
+
t && this.shadowRoot.querySelector(
|
|
2791
|
+
`[data-date="${t}"]`
|
|
2792
|
+
).focus();
|
|
2793
|
+
}
|
|
2794
|
+
}
|
|
2795
|
+
// --- Calendar header ---
|
|
2796
|
+
/**
|
|
2797
|
+
* @internal
|
|
2798
|
+
*/
|
|
2799
|
+
_onTitleActionClick() {
|
|
2800
|
+
this._inMonthPicker ? this._monthPickerYear = null : this._monthPickerYear = this._selectedMonth.year;
|
|
2801
|
+
}
|
|
2802
|
+
get _isPrevYearDisabled() {
|
|
2803
|
+
const a = (this._inMonthPicker ? this._monthPickerYear : this._selectedMonth.year) - 1;
|
|
2804
|
+
return this._resolvedMinDate && a < ye(this._resolvedMinDate);
|
|
2805
|
+
}
|
|
2806
|
+
/**
|
|
2807
|
+
* @internal
|
|
2808
|
+
*/
|
|
2809
|
+
_onPrevYearClick() {
|
|
2810
|
+
this._inMonthPicker ? this._monthPickerYear = this._monthPickerYear - 1 : this._selectedMonth = {
|
|
2811
|
+
year: this._selectedMonth.year - 1,
|
|
2812
|
+
month: this._selectedMonth.month
|
|
2813
|
+
};
|
|
2814
|
+
}
|
|
2815
|
+
get _isNextYearDisabled() {
|
|
2816
|
+
const a = (this._inMonthPicker ? this._monthPickerYear : this._selectedMonth.year) + 1;
|
|
2817
|
+
return this._resolvedMaxDate && a > ye(this._resolvedMaxDate);
|
|
2818
|
+
}
|
|
2819
|
+
/**
|
|
2820
|
+
* @internal
|
|
2821
|
+
*/
|
|
2822
|
+
_onNextYearClick() {
|
|
2823
|
+
this._inMonthPicker ? this._monthPickerYear = this._monthPickerYear + 1 : this._selectedMonth = {
|
|
2824
|
+
year: this._selectedMonth.year + 1,
|
|
2825
|
+
month: this._selectedMonth.month
|
|
2826
|
+
};
|
|
2827
|
+
}
|
|
2828
|
+
/**
|
|
2829
|
+
* @internal
|
|
2830
|
+
*/
|
|
2831
|
+
get _isPrevMonthDisabled() {
|
|
2832
|
+
return this.#t(M(this._selectedMonth, -1));
|
|
2833
|
+
}
|
|
2834
|
+
/**
|
|
2835
|
+
* @internal
|
|
2836
|
+
*/
|
|
2837
|
+
_onPrevMonthClick() {
|
|
2838
|
+
this._selectedMonth = M(this._selectedMonth, -1);
|
|
2839
|
+
}
|
|
2840
|
+
/**
|
|
2841
|
+
* @internal
|
|
2842
|
+
*/
|
|
2843
|
+
get _isNextMonthDisabled() {
|
|
2844
|
+
return this.#e(M(this._selectedMonth, 1));
|
|
2845
|
+
}
|
|
2846
|
+
/**
|
|
2847
|
+
* @internal
|
|
2848
|
+
*/
|
|
2849
|
+
_onNextMonthClick() {
|
|
2850
|
+
this._selectedMonth = M(this._selectedMonth, 1);
|
|
2851
|
+
}
|
|
2852
|
+
/**
|
|
2853
|
+
* @internal
|
|
2854
|
+
*/
|
|
2855
|
+
get _segments() {
|
|
2856
|
+
const t = [];
|
|
2857
|
+
if (this._inMonthPicker)
|
|
2858
|
+
t.push({
|
|
2859
|
+
id: 0,
|
|
2860
|
+
type: "month-picker",
|
|
2861
|
+
title: `${this._monthPickerYear}`,
|
|
2862
|
+
titleClickable: !0,
|
|
2863
|
+
titleAriaLabel: this.locale.calendarPicker.showCalendarForMonthLabel(
|
|
2864
|
+
`${this.locale.calendarPicker.months.name[this._selectedMonth.month]} ${this._selectedMonth.year}`
|
|
2865
|
+
),
|
|
2866
|
+
prevYearButton: !0,
|
|
2867
|
+
nextYearButton: !0,
|
|
2868
|
+
months: Vn(
|
|
2869
|
+
this._monthPickerYear,
|
|
2870
|
+
this.locale.calendarPicker
|
|
2871
|
+
)
|
|
2872
|
+
});
|
|
2873
|
+
else
|
|
2874
|
+
for (let a = 0; a < this._numCalendars; a++) {
|
|
2875
|
+
const o = M(this._selectedMonth, a), s = this._numCalendars === 1, i = a === 0, h = a === this._numCalendars - 1;
|
|
2876
|
+
t.push({
|
|
2877
|
+
id: a,
|
|
2878
|
+
type: "calendar",
|
|
2879
|
+
title: `${this.locale.calendarPicker.months.name[o.month]} ${o.year}`,
|
|
2880
|
+
titleClickable: s,
|
|
2881
|
+
titleAriaLabel: this.locale.calendarPicker.changeMonthLabel(
|
|
2882
|
+
`${this.locale.calendarPicker.months.name[o.month]} ${o.year}`
|
|
2883
|
+
),
|
|
2884
|
+
prevYearButton: i && s,
|
|
2885
|
+
prevMonthButton: i,
|
|
2886
|
+
nextMonthButton: h,
|
|
2887
|
+
nextYearButton: h && s,
|
|
2888
|
+
calendar: Kn(o, this.locale.calendarPicker)
|
|
2889
|
+
});
|
|
2890
|
+
}
|
|
2891
|
+
return t;
|
|
2892
|
+
}
|
|
2893
|
+
/**
|
|
2894
|
+
* @internal
|
|
2895
|
+
*/
|
|
2896
|
+
_isDateSelected(t) {
|
|
2897
|
+
return !1;
|
|
2898
|
+
}
|
|
2899
|
+
/**
|
|
2900
|
+
* @internal
|
|
2901
|
+
* @private
|
|
2902
|
+
*/
|
|
2903
|
+
_isDateInSelectedRange(t) {
|
|
2904
|
+
return !1;
|
|
2905
|
+
}
|
|
2906
|
+
/**
|
|
2907
|
+
* @internal
|
|
2908
|
+
*/
|
|
2909
|
+
_isDateRangeStart(t) {
|
|
2910
|
+
return !1;
|
|
2911
|
+
}
|
|
2912
|
+
/**
|
|
2913
|
+
* @internal
|
|
2914
|
+
*/
|
|
2915
|
+
_isDateRangeEnd(t) {
|
|
2916
|
+
return !1;
|
|
2917
|
+
}
|
|
2918
|
+
/**
|
|
2919
|
+
* @internal
|
|
2920
|
+
*/
|
|
2921
|
+
_onDateMouseEnter(t) {
|
|
2922
|
+
}
|
|
2923
|
+
/**
|
|
2924
|
+
* @internal
|
|
2925
|
+
*/
|
|
2926
|
+
_onDateMouseLeave(t) {
|
|
2927
|
+
}
|
|
2928
|
+
/**
|
|
2929
|
+
* Handle keydown on a date in the calendar.
|
|
2930
|
+
* @internal
|
|
2931
|
+
*/
|
|
2932
|
+
_onDateKeydown(t, a) {
|
|
2933
|
+
let o = null;
|
|
2934
|
+
return a.key === "ArrowUp" ? o = G(t, -7) : a.key === "ArrowDown" ? o = G(t, 7) : a.key === "ArrowLeft" ? o = G(t, -1) : a.key === "ArrowRight" && (o = G(t, 1)), o && this._isDateInValidRange(o) ? (this._adjustSelectedMonthToEnsureVisibilityOf(o) && U.processUpdates(), this._dialogEl.querySelector(
|
|
2935
|
+
`[data-date="${o}"]`
|
|
2936
|
+
).focus(), !1) : !0;
|
|
2937
|
+
}
|
|
2938
|
+
/**
|
|
2939
|
+
* @internal
|
|
2940
|
+
*/
|
|
2941
|
+
_onDateFocus(t) {
|
|
2942
|
+
this._lastFocussedDate = t;
|
|
2943
|
+
}
|
|
2944
|
+
get _tabbableDate() {
|
|
2945
|
+
const t = this._segments.filter(
|
|
2946
|
+
(i) => i.type === "calendar"
|
|
2947
|
+
).flatMap((i) => i.calendar.grid.flat().map((h) => h.date)), a = [
|
|
2948
|
+
this._lastFocussedDate,
|
|
2949
|
+
...this._getSelectedDates(),
|
|
2950
|
+
we(),
|
|
2951
|
+
...t
|
|
2952
|
+
], o = this._selectedMonth, s = M(
|
|
2953
|
+
this._selectedMonth,
|
|
2954
|
+
this._numCalendars - 1
|
|
2955
|
+
);
|
|
2956
|
+
return a.find(
|
|
2957
|
+
(i) => i && N(B(i), o) >= 0 && N(B(i), s) <= 0 && this._isDateInValidRange(i)
|
|
2958
|
+
) ?? null;
|
|
2959
|
+
}
|
|
2960
|
+
/**
|
|
2961
|
+
* @internal
|
|
2962
|
+
*/
|
|
2963
|
+
get _inMonthPicker() {
|
|
2964
|
+
return this._monthPickerYear !== null;
|
|
2965
|
+
}
|
|
2966
|
+
/**
|
|
2967
|
+
* Handle month selected in the month picker.
|
|
2968
|
+
* @internal
|
|
2969
|
+
*/
|
|
2970
|
+
_onMonthClick(t) {
|
|
2971
|
+
this._selectedMonth = t, this._monthPickerYear = null;
|
|
2972
|
+
}
|
|
2973
|
+
/**
|
|
2974
|
+
* Handle keydown on a month in the month picker.
|
|
2975
|
+
* @internal
|
|
2976
|
+
*/
|
|
2977
|
+
_onMonthKeydown(t, a) {
|
|
2978
|
+
let o = null;
|
|
2979
|
+
return a.key === "ArrowUp" ? o = M(t, -4) : a.key === "ArrowDown" ? o = M(t, Ie) : a.key === "ArrowLeft" ? o = M(t, -1) : a.key === "ArrowRight" && (o = M(t, 1)), o && this._isMonthInValidRange(o) ? (o.year !== this._monthPickerYear && (this._monthPickerYear = o.year, U.processUpdates()), this._dialogEl.querySelector(
|
|
2980
|
+
`[data-month="${Fe(o)}"]`
|
|
2981
|
+
).focus(), !1) : !0;
|
|
2982
|
+
}
|
|
2983
|
+
/**
|
|
2984
|
+
* @internal
|
|
2985
|
+
*/
|
|
2986
|
+
_onMonthFocus(t) {
|
|
2987
|
+
this._lastFocussedMonth = t;
|
|
2988
|
+
}
|
|
2989
|
+
get _tabbableMonth() {
|
|
2990
|
+
const t = this._segments.filter(
|
|
2991
|
+
(o) => o.type === "month-picker"
|
|
2992
|
+
).flatMap((o) => o.months.flat().map((s) => s.month));
|
|
2993
|
+
return [
|
|
2994
|
+
this._lastFocussedMonth,
|
|
2995
|
+
this._selectedMonth,
|
|
2996
|
+
S(),
|
|
2997
|
+
...t
|
|
2998
|
+
].find(
|
|
2999
|
+
(o) => o && o.year === this._monthPickerYear && this._isMonthInValidRange(o)
|
|
3000
|
+
) ?? null;
|
|
3001
|
+
}
|
|
3002
|
+
}
|
|
3003
|
+
return Y([
|
|
3004
|
+
H
|
|
3005
|
+
], e.prototype, "_selectedMonth", 2), Y([
|
|
3006
|
+
V
|
|
3007
|
+
], e.prototype, "_isPrevYearDisabled", 1), Y([
|
|
3008
|
+
V
|
|
3009
|
+
], e.prototype, "_isNextYearDisabled", 1), Y([
|
|
3010
|
+
H
|
|
3011
|
+
], e.prototype, "_numCalendars", 2), Y([
|
|
3012
|
+
H
|
|
3013
|
+
], e.prototype, "_lastFocussedDate", 2), Y([
|
|
3014
|
+
V
|
|
3015
|
+
], e.prototype, "_tabbableDate", 1), Y([
|
|
3016
|
+
H
|
|
3017
|
+
], e.prototype, "_monthPickerYear", 2), Y([
|
|
3018
|
+
H
|
|
3019
|
+
], e.prototype, "_lastFocussedMonth", 2), Y([
|
|
3020
|
+
V
|
|
3021
|
+
], e.prototype, "_tabbableMonth", 1), e;
|
|
3022
|
+
};
|
|
3023
|
+
var Zn = Object.defineProperty, ge = (r, e, n, t) => {
|
|
3024
|
+
for (var a = void 0, o = r.length - 1, s; o >= 0; o--)
|
|
3025
|
+
(s = r[o]) && (a = s(e, n, a) || a);
|
|
3026
|
+
return a && Zn(e, n, a), a;
|
|
3027
|
+
};
|
|
3028
|
+
const xe = {
|
|
3029
|
+
fromView: (r) => r && An(r) ? r : "",
|
|
3030
|
+
toView(r) {
|
|
3031
|
+
return r;
|
|
3032
|
+
}
|
|
3033
|
+
}, fr = (r) => {
|
|
3034
|
+
class e extends r {
|
|
3035
|
+
/**
|
|
3036
|
+
* @internal
|
|
3037
|
+
*/
|
|
3038
|
+
minChanged(t, a) {
|
|
3039
|
+
this.proxy instanceof HTMLInputElement && (this.proxy.min = a, this.validate());
|
|
3040
|
+
}
|
|
3041
|
+
/**
|
|
3042
|
+
* @internal
|
|
3043
|
+
*/
|
|
3044
|
+
get _resolvedMinDate() {
|
|
3045
|
+
return this.min;
|
|
3046
|
+
}
|
|
3047
|
+
/**
|
|
3048
|
+
* @internal
|
|
3049
|
+
*/
|
|
3050
|
+
maxChanged(t, a) {
|
|
3051
|
+
this.proxy instanceof HTMLInputElement && (this.proxy.max = a, this.validate());
|
|
3052
|
+
}
|
|
3053
|
+
/**
|
|
3054
|
+
* The latest accepted date.
|
|
3055
|
+
* @internal
|
|
3056
|
+
*/
|
|
3057
|
+
get _resolvedMaxDate() {
|
|
3058
|
+
return this.max;
|
|
3059
|
+
}
|
|
3060
|
+
constructor(...t) {
|
|
3061
|
+
super(...t), this.min = "", this.max = "";
|
|
3062
|
+
}
|
|
3063
|
+
}
|
|
3064
|
+
return ge([
|
|
3065
|
+
ue({ converter: xe })
|
|
3066
|
+
], e.prototype, "min"), ge([
|
|
3067
|
+
ue({ converter: xe })
|
|
3068
|
+
], e.prototype, "max"), e;
|
|
3069
|
+
};
|
|
3070
|
+
function Sn(r) {
|
|
3071
|
+
const e = r.tagFor(Le);
|
|
3072
|
+
return x`<div class="header" tabindex="-1">
|
|
3073
|
+
${D(
|
|
3074
|
+
(n) => n.prevYearButton,
|
|
3075
|
+
x`
|
|
3076
|
+
<${e}
|
|
3077
|
+
tabindex='1'
|
|
3078
|
+
class='vwc-button'
|
|
3079
|
+
size='super-condensed'
|
|
3080
|
+
icon='${(n, t) => t.parent._inMonthPicker ? "chevron-left-line" : "double-chevron-left-line"}'
|
|
3081
|
+
aria-label='${(n, t) => t.parent.locale.calendarPicker.prevYearLabel}'
|
|
3082
|
+
?disabled='${(n, t) => t.parent._isPrevYearDisabled}'
|
|
3083
|
+
@click='${(n, t) => t.parent._onPrevYearClick()}'
|
|
3084
|
+
></${e}>
|
|
3085
|
+
`
|
|
3086
|
+
)}
|
|
3087
|
+
${D(
|
|
3088
|
+
(n) => n.prevMonthButton,
|
|
3089
|
+
x`
|
|
3090
|
+
<${e}
|
|
3091
|
+
tabindex='1'
|
|
3092
|
+
class='vwc-button'
|
|
3093
|
+
size='super-condensed'
|
|
3094
|
+
icon='chevron-left-line'
|
|
3095
|
+
aria-label='${(n, t) => t.parent.locale.calendarPicker.prevMonthLabel}'
|
|
3096
|
+
?disabled='${(n, t) => t.parent._isPrevMonthDisabled}'
|
|
3097
|
+
@click='${(n, t) => t.parent._onPrevMonthClick()}'
|
|
3098
|
+
></${e}>
|
|
3099
|
+
`
|
|
3100
|
+
)}
|
|
3101
|
+
<div class="title">
|
|
3102
|
+
${D(
|
|
3103
|
+
(n) => n.titleClickable,
|
|
3104
|
+
x`
|
|
3105
|
+
<button
|
|
3106
|
+
tabindex="1"
|
|
3107
|
+
id="${(n) => `grid-label-${n.id}`}"
|
|
3108
|
+
class="title-action button"
|
|
3109
|
+
aria-live="polite"
|
|
3110
|
+
aria-label="${(n) => n.titleAriaLabel}"
|
|
3111
|
+
@click="${(n, t) => t.parent._onTitleActionClick()}"
|
|
3112
|
+
>
|
|
3113
|
+
${(n) => n.title}
|
|
3114
|
+
</button>
|
|
3115
|
+
`
|
|
3116
|
+
)}
|
|
3117
|
+
${D(
|
|
3118
|
+
(n) => !n.titleClickable,
|
|
3119
|
+
x`
|
|
3120
|
+
<div
|
|
3121
|
+
id="${(n) => `grid-label-${n.id}`}"
|
|
3122
|
+
class="title-action"
|
|
3123
|
+
aria-live="polite"
|
|
3124
|
+
>
|
|
3125
|
+
${(n) => n.title}
|
|
3126
|
+
</div>
|
|
3127
|
+
`
|
|
3128
|
+
)}
|
|
3129
|
+
</div>
|
|
3130
|
+
|
|
3131
|
+
${D(
|
|
3132
|
+
(n) => n.nextMonthButton,
|
|
3133
|
+
x`
|
|
3134
|
+
<${e}
|
|
3135
|
+
tabindex='1'
|
|
3136
|
+
class='vwc-button'
|
|
3137
|
+
size='super-condensed'
|
|
3138
|
+
icon='chevron-right-line'
|
|
3139
|
+
aria-label='${(n, t) => t.parent.locale.calendarPicker.nextMonthLabel}'
|
|
3140
|
+
?disabled='${(n, t) => t.parent._isNextMonthDisabled}'
|
|
3141
|
+
@click='${(n, t) => t.parent._onNextMonthClick()}'
|
|
3142
|
+
></${e}>
|
|
3143
|
+
`
|
|
3144
|
+
)}
|
|
3145
|
+
${D(
|
|
3146
|
+
(n) => n.nextYearButton,
|
|
3147
|
+
x`
|
|
3148
|
+
<${e}
|
|
3149
|
+
tabindex='1'
|
|
3150
|
+
class='vwc-button'
|
|
3151
|
+
size='super-condensed'
|
|
3152
|
+
icon='${(n, t) => t.parent._inMonthPicker ? "chevron-right-line" : "double-chevron-right-line"}'
|
|
3153
|
+
aria-label='${(n, t) => t.parent.locale.calendarPicker.nextYearLabel}'
|
|
3154
|
+
?disabled='${(n, t) => t.parent._isNextYearDisabled}'
|
|
3155
|
+
@click='${(n, t) => t.parent._onNextYearClick()}'
|
|
3156
|
+
></${e}>
|
|
3157
|
+
`
|
|
3158
|
+
)}
|
|
3159
|
+
</div>`;
|
|
3160
|
+
}
|
|
3161
|
+
function er(r) {
|
|
3162
|
+
const e = r.tagFor(_e), n = r.tagFor(ve);
|
|
3163
|
+
return x`
|
|
3164
|
+
<div
|
|
3165
|
+
class='calendar'
|
|
3166
|
+
role='grid'
|
|
3167
|
+
aria-labelledby='${(t) => `grid-label-${t.id}`}'
|
|
3168
|
+
>
|
|
3169
|
+
<div class='calendar-weekdays' role='row'>
|
|
3170
|
+
${F(
|
|
3171
|
+
(t) => t.calendar.weekdays,
|
|
3172
|
+
x`
|
|
3173
|
+
<div
|
|
3174
|
+
class="calendar-weekday"
|
|
3175
|
+
role="columnheader"
|
|
3176
|
+
aria-label="${(t) => t.name}"
|
|
3177
|
+
>
|
|
3178
|
+
${(t) => t.shortName}
|
|
3179
|
+
</div>
|
|
3180
|
+
`
|
|
3181
|
+
)}
|
|
3182
|
+
</div>
|
|
3183
|
+
<${e} class='calendar-separator' role='presentation'></${e}>
|
|
3184
|
+
${F(
|
|
3185
|
+
(t) => t.calendar.grid,
|
|
3186
|
+
x` <div class="calendar-week" role="row">
|
|
3187
|
+
${F(
|
|
3188
|
+
(t) => t,
|
|
3189
|
+
x`
|
|
3190
|
+
${D(
|
|
3191
|
+
(t, a) => a.parentContext.parentContext.parent._hideDatesOutsideMonth && t.isOutsideMonth,
|
|
3192
|
+
x`<div class="calendar-day"></div>`
|
|
3193
|
+
)}
|
|
3194
|
+
${D(
|
|
3195
|
+
(t, a) => !a.parentContext.parentContext.parent._hideDatesOutsideMonth || !t.isOutsideMonth,
|
|
3196
|
+
x` <span role="gridcell">
|
|
3197
|
+
<button
|
|
3198
|
+
class="${(t, a) => Me(
|
|
3199
|
+
"calendar-day",
|
|
3200
|
+
"button",
|
|
3201
|
+
[
|
|
3202
|
+
"current",
|
|
3203
|
+
t.date === a.parentContext.parentContext.parent._currentDate
|
|
3204
|
+
],
|
|
3205
|
+
[
|
|
3206
|
+
"selected",
|
|
3207
|
+
a.parentContext.parentContext.parent._isDateSelected(
|
|
3208
|
+
t.date
|
|
3209
|
+
)
|
|
3210
|
+
],
|
|
3211
|
+
[
|
|
3212
|
+
"range",
|
|
3213
|
+
a.parentContext.parentContext.parent._isDateInSelectedRange(
|
|
3214
|
+
t.date
|
|
3215
|
+
)
|
|
3216
|
+
],
|
|
3217
|
+
[
|
|
3218
|
+
"start",
|
|
3219
|
+
a.parentContext.parentContext.parent._isDateRangeStart(
|
|
3220
|
+
t.date
|
|
3221
|
+
)
|
|
3222
|
+
],
|
|
3223
|
+
[
|
|
3224
|
+
"end",
|
|
3225
|
+
a.parentContext.parentContext.parent._isDateRangeEnd(
|
|
3226
|
+
t.date
|
|
3227
|
+
)
|
|
3228
|
+
],
|
|
3229
|
+
["outside-month", t.isOutsideMonth]
|
|
3230
|
+
)}"
|
|
3231
|
+
?disabled="${(t, a) => !a.parentContext.parentContext.parent._isDateInValidRange(
|
|
3232
|
+
t.date
|
|
3233
|
+
)}"
|
|
3234
|
+
tabindex="${(t, a) => t.date === a.parentContext.parentContext.parent._tabbableDate ? 1 : -1}"
|
|
3235
|
+
data-date="${(t) => t.date}"
|
|
3236
|
+
@click="${(t, a) => a.parentContext.parentContext.parent._onDateClick(t.date)}"
|
|
3237
|
+
@focus="${(t, a) => a.parentContext.parentContext.parent._onDateFocus(t.date)}"
|
|
3238
|
+
@mouseenter="${(t, a) => a.parentContext.parentContext.parent._onDateMouseEnter(
|
|
3239
|
+
t.date
|
|
3240
|
+
)}"
|
|
3241
|
+
@mouseleave="${(t, a) => a.parentContext.parentContext.parent._onDateMouseLeave(
|
|
3242
|
+
t.date
|
|
3243
|
+
)}"
|
|
3244
|
+
@keydown="${(t, a) => a.parentContext.parentContext.parent._onDateKeydown(
|
|
3245
|
+
t.date,
|
|
3246
|
+
a.event
|
|
3247
|
+
)}"
|
|
3248
|
+
>
|
|
3249
|
+
${(t) => t.label}
|
|
3250
|
+
<${n}>${(t, a) => {
|
|
3251
|
+
const o = a.parentContext.parentContext.parent, s = [];
|
|
3252
|
+
return t.date === o._currentDate && s.push(
|
|
3253
|
+
o.locale.calendarPicker.todayLabel
|
|
3254
|
+
), o._isDateAriaSelected(t.date) && s.push(
|
|
3255
|
+
o.locale.calendarPicker.selectedLabel
|
|
3256
|
+
), s.join(" ");
|
|
3257
|
+
}}</${n}>
|
|
3258
|
+
</button>
|
|
3259
|
+
</span>`
|
|
3260
|
+
)}
|
|
3261
|
+
</div>
|
|
3262
|
+
`
|
|
3263
|
+
)}
|
|
3264
|
+
</div>`
|
|
3265
|
+
)}`;
|
|
3266
|
+
}
|
|
3267
|
+
function tr(r) {
|
|
3268
|
+
const e = r.tagFor(_e), n = r.tagFor(ve);
|
|
3269
|
+
return x`
|
|
3270
|
+
<${e}
|
|
3271
|
+
class='months-separator'
|
|
3272
|
+
role='presentation'
|
|
3273
|
+
></${e}>
|
|
3274
|
+
<div
|
|
3275
|
+
class='month-grid'
|
|
3276
|
+
role='grid'
|
|
3277
|
+
aria-labelledby='grid-label'
|
|
3278
|
+
>
|
|
3279
|
+
${F(
|
|
3280
|
+
(t) => t.months,
|
|
3281
|
+
x`
|
|
3282
|
+
<div class="months-row" role="row">
|
|
3283
|
+
${F(
|
|
3284
|
+
(t) => t,
|
|
3285
|
+
x`
|
|
3286
|
+
<span role="gridcell">
|
|
3287
|
+
<button
|
|
3288
|
+
class="${(t, a) => Me(
|
|
3289
|
+
"month",
|
|
3290
|
+
"button",
|
|
3291
|
+
[
|
|
3292
|
+
"current",
|
|
3293
|
+
A(
|
|
3294
|
+
t.month,
|
|
3295
|
+
a.parentContext.parentContext.parent._currentMonth
|
|
3296
|
+
)
|
|
3297
|
+
],
|
|
3298
|
+
[
|
|
3299
|
+
"selected",
|
|
3300
|
+
A(
|
|
3301
|
+
t.month,
|
|
3302
|
+
a.parentContext.parentContext.parent._selectedMonth
|
|
3303
|
+
)
|
|
3304
|
+
]
|
|
3305
|
+
)}"
|
|
3306
|
+
tabindex="${(t, a) => a.parentContext.parentContext.parent._tabbableMonth && A(
|
|
3307
|
+
t.month,
|
|
3308
|
+
a.parentContext.parentContext.parent._tabbableMonth
|
|
3309
|
+
) ? 1 : -1}"
|
|
3310
|
+
aria-label="${(t) => t.monthName}"
|
|
3311
|
+
data-month="${(t) => Fe(t.month)}"
|
|
3312
|
+
?disabled="${(t, a) => !a.parentContext.parentContext.parent._isMonthInValidRange(
|
|
3313
|
+
t.month
|
|
3314
|
+
)}"
|
|
3315
|
+
@click="${(t, a) => a.parentContext.parentContext.parent._onMonthClick(
|
|
3316
|
+
t.month
|
|
3317
|
+
)}"
|
|
3318
|
+
@focus="${(t, a) => a.parentContext.parentContext.parent._onMonthFocus(
|
|
3319
|
+
t.month
|
|
3320
|
+
)}"
|
|
3321
|
+
@keydown="${(t, a) => a.parentContext.parentContext.parent._onMonthKeydown(
|
|
3322
|
+
t.month,
|
|
3323
|
+
a.event
|
|
3324
|
+
)}"
|
|
3325
|
+
>
|
|
3326
|
+
${(t) => t.label}
|
|
3327
|
+
<${n}>${(t, a) => {
|
|
3328
|
+
const o = a.parentContext.parentContext.parent, s = [];
|
|
3329
|
+
return A(t.month, o._currentMonth) && s.push(o.locale.calendarPicker.currentLabel), A(t.month, o._selectedMonth) && s.push(
|
|
3330
|
+
o.locale.calendarPicker.selectedLabel
|
|
3331
|
+
), s.join(" ");
|
|
3332
|
+
}}</${n}>
|
|
3333
|
+
</button>
|
|
3334
|
+
</span>
|
|
3335
|
+
`
|
|
3336
|
+
)}
|
|
3337
|
+
</div>
|
|
3338
|
+
`
|
|
3339
|
+
)}
|
|
3340
|
+
</div>`;
|
|
3341
|
+
}
|
|
3342
|
+
const pr = (r) => x`
|
|
3343
|
+
<div class="segments">
|
|
3344
|
+
${F(
|
|
3345
|
+
(e) => e._segments,
|
|
3346
|
+
x` <div class="segment">
|
|
3347
|
+
${Sn(r)}
|
|
3348
|
+
${D(
|
|
3349
|
+
(e) => e.type === "month-picker",
|
|
3350
|
+
x`${tr(r)}`
|
|
3351
|
+
)}
|
|
3352
|
+
${D(
|
|
3353
|
+
(e) => e.type === "calendar",
|
|
3354
|
+
x`${er(r)}`
|
|
3355
|
+
)}
|
|
3356
|
+
</div>`
|
|
3357
|
+
)}
|
|
3358
|
+
</div>
|
|
3359
|
+
`;
|
|
3360
|
+
export {
|
|
3361
|
+
hr as C,
|
|
3362
|
+
fr as M,
|
|
3363
|
+
xe as V,
|
|
3364
|
+
pr as a,
|
|
3365
|
+
be as b,
|
|
3366
|
+
lr as c,
|
|
3367
|
+
we as d,
|
|
3368
|
+
ur as f,
|
|
3369
|
+
An as i,
|
|
3370
|
+
dr as p
|
|
3371
|
+
};
|