@salla.sa/twilight-components 2.14.392 → 2.14.393
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/app-globals-oehrC7QI.js +39 -0
- package/dist/cjs/{filepond-D-ur1GA-.js → filepond-D7RVR_w_.js} +10 -5
- package/dist/cjs/{filepond-plugin-file-poster-DigEeKId.js → filepond-plugin-file-poster-DTuZK2ot.js} +11 -7
- package/dist/cjs/{filepond-plugin-file-validate-size-R9el3Yro.js → filepond-plugin-file-validate-size-DHc6pF_j.js} +1 -1
- package/dist/cjs/filepond-plugin-file-validate-type-DnkcvJVc.js +271 -0
- package/dist/cjs/{filepond-plugin-image-edit-bhI8kqN_.js → filepond-plugin-image-edit-vrZ1s7kw.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-COXZUVRV.js → filepond-plugin-image-exif-orientation-Bn5JSzQK.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-COP8QJBf.js → filepond-plugin-image-preview-8qWUFe9n.js} +1 -1
- package/dist/cjs/{index-CGnPURjZ.js → index-C5VeFDQ0.js} +1966 -1344
- package/dist/cjs/{index-BILBEE9f.js → index-CwD81m7i.js} +1 -1
- package/dist/cjs/loader.cjs.js +4 -3
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +5 -5
- package/dist/cjs/salla-accordion_6.cjs.entry.js +19 -15
- package/dist/cjs/salla-add-product-button_4.cjs.entry.js +12 -10
- package/dist/cjs/salla-advertisement.cjs.entry.js +3 -3
- package/dist/cjs/salla-alert_2.cjs.entry.js +5 -5
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +3 -3
- package/dist/cjs/salla-apps-icons.cjs.entry.js +3 -3
- package/dist/cjs/salla-booking-field_7.cjs.entry.js +25 -23
- package/dist/cjs/salla-bullet-delivery.cjs.entry.js +3 -3
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +3 -3
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +5 -5
- package/dist/cjs/salla-comment-form_8.cjs.entry.js +17 -17
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +3 -3
- package/dist/cjs/salla-contacts.cjs.entry.js +3 -3
- package/dist/cjs/salla-cookies-bar.cjs.entry.js +3 -3
- package/dist/cjs/salla-count-down.cjs.entry.js +35 -11
- package/dist/cjs/salla-custom-fields.cjs.entry.js +3 -3
- package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +3 -3
- package/dist/cjs/salla-filters.cjs.entry.js +3 -3
- package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
- package/dist/cjs/salla-gifting.cjs.entry.js +3 -3
- package/dist/cjs/salla-hook.cjs.entry.js +5 -2
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +3 -3
- package/dist/cjs/salla-installment.cjs.entry.js +3 -3
- package/dist/cjs/salla-list-tile.cjs.entry.js +3 -3
- package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-login-modal.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty.cjs.entry.js +3 -3
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +3 -3
- package/dist/cjs/salla-map.cjs.entry.js +3 -3
- package/dist/cjs/salla-menu.cjs.entry.js +3 -3
- package/dist/cjs/salla-metadata.cjs.entry.js +3 -3
- package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +5 -5
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +8 -6
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +6 -4
- package/dist/cjs/salla-notification-item.cjs.entry.js +3 -3
- package/dist/cjs/salla-notifications.cjs.entry.js +50 -5
- package/dist/cjs/salla-offer-modal.cjs.entry.js +3 -3
- package/dist/cjs/salla-offer.cjs.entry.js +3 -3
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +3 -3
- package/dist/cjs/salla-order-details-options.cjs.entry.js +3 -3
- package/dist/cjs/salla-order-details.cjs.entry.js +6 -4
- package/dist/cjs/salla-order-edit-item.cjs.entry.js +3 -3
- package/dist/cjs/salla-order-edit.cjs.entry.js +3 -3
- package/dist/cjs/salla-order-summary.cjs.entry.js +3 -3
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +6 -4
- package/dist/cjs/salla-orders.cjs.entry.js +3 -3
- package/dist/cjs/salla-payments.cjs.entry.js +3 -3
- package/dist/cjs/salla-placeholder.cjs.entry.js +3 -3
- package/dist/cjs/salla-price-range.cjs.entry.js +3 -3
- package/dist/cjs/salla-product-card.cjs.entry.js +3 -3
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +3 -3
- package/dist/cjs/salla-products-list.cjs.entry.js +3 -3
- package/dist/cjs/salla-products-slider.cjs.entry.js +3 -3
- package/dist/cjs/salla-progress-bar.cjs.entry.js +3 -3
- package/dist/cjs/salla-quick-order.cjs.entry.js +3 -3
- package/dist/cjs/salla-rating-modal.cjs.entry.js +3 -3
- package/dist/cjs/salla-scopes.cjs.entry.js +3 -3
- package/dist/cjs/salla-search.cjs.entry.js +6 -4
- package/dist/cjs/salla-skeleton.cjs.entry.js +3 -3
- package/dist/cjs/salla-slider.cjs.entry.js +20 -14
- package/dist/cjs/salla-social-share.cjs.entry.js +3 -3
- package/dist/cjs/salla-social.cjs.entry.js +3 -3
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +7 -7
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +3 -3
- package/dist/cjs/salla-tooltip.cjs.entry.js +3 -3
- package/dist/cjs/salla-trust-badges.cjs.entry.js +3 -3
- package/dist/cjs/salla-user-menu.cjs.entry.js +3 -3
- package/dist/cjs/salla-user-profile.cjs.entry.js +3 -3
- package/dist/cjs/salla-user-settings.cjs.entry.js +3 -3
- package/dist/cjs/salla-verify.cjs.entry.js +3 -3
- package/dist/cjs/salla-wallet.cjs.entry.js +3 -3
- package/dist/cjs/twilight.cjs.js +5 -4
- package/dist/cjs/{vanilla-picker-DI3TImGd.js → vanilla-picker-yKERbLpx.js} +1 -1
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/salla-accordion/salla-accordion-head.js +2 -2
- package/dist/collection/components/salla-accordion/salla-accordion.js +4 -4
- package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +19 -19
- package/dist/collection/components/salla-alert/salla-alert.js +5 -5
- package/dist/collection/components/salla-apps-icons/salla-apps-icons.js +6 -6
- package/dist/collection/components/salla-booking-field/salla-booking-field.js +4 -4
- package/dist/collection/components/salla-bottom-alert/salla-bottom-alert.js +9 -9
- package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +6 -3
- package/dist/collection/components/salla-button/salla-button.js +11 -11
- package/dist/collection/components/salla-cart-coupons/salla-cart-coupons.js +2 -1
- package/dist/collection/components/salla-cart-item-offers/salla-cart-item-offers.js +8 -8
- package/dist/collection/components/salla-cart-summary/salla-cart-summary.js +2 -2
- package/dist/collection/components/salla-color-picker/salla-color-picker.js +20 -14
- package/dist/collection/components/salla-comment-form/salla-comment-form.js +6 -6
- package/dist/collection/components/salla-comments/salla-comment-item.js +2 -3
- package/dist/collection/components/salla-comments/salla-comments.js +18 -17
- package/dist/collection/components/salla-contacts/salla-contacts.js +10 -10
- package/dist/collection/components/salla-count-down/salla-count-down.js +66 -42
- package/dist/collection/components/salla-custom-fields/salla-custom-fields.js +9 -7
- package/dist/collection/components/salla-datetime-picker/salla-datetime-picker.js +69 -65
- package/dist/collection/components/salla-drawer/salla-drawer.js +11 -11
- package/dist/collection/components/salla-file-upload/salla-file-upload.css +1 -1
- package/dist/collection/components/salla-file-upload/salla-file-upload.js +85 -84
- package/dist/collection/components/salla-filters/salla-filters.js +2 -2
- package/dist/collection/components/salla-filters-widget/salla-filters-widget.js +4 -5
- package/dist/collection/components/salla-gifting/salla-gifting.js +11 -11
- package/dist/collection/components/salla-hook/salla-hook.js +2 -2
- package/dist/collection/components/salla-infinite-scroll/salla-infinite-scroll.js +6 -6
- package/dist/collection/components/salla-installment/salla-installment.js +5 -5
- package/dist/collection/components/salla-list-tile/salla-list-tile.js +2 -2
- package/dist/collection/components/salla-loading/salla-loading.js +4 -4
- package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +5 -5
- package/dist/collection/components/salla-login-modal/salla-login-modal.js +14 -14
- package/dist/collection/components/salla-loyalty/salla-loyalty-prize-item.js +4 -3
- package/dist/collection/components/salla-loyalty/salla-loyalty.js +13 -12
- package/dist/collection/components/salla-map/salla-map.js +14 -14
- package/dist/collection/components/salla-menu/salla-menu.js +10 -9
- package/dist/collection/components/salla-metadata/salla-metadata.js +3 -3
- package/dist/collection/components/salla-modal/salla-modal.js +11 -11
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-cart.js +2 -2
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.js +2 -2
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.js +4 -2
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.js +8 -7
- package/dist/collection/components/salla-multiple-bundle-product/salla-multiple-bundle-product.js +2 -2
- package/dist/collection/components/salla-notifications/salla-notification-item.js +2 -2
- package/dist/collection/components/salla-notifications/salla-notifications.js +50 -5
- package/dist/collection/components/salla-offer/salla-offer.js +1 -1
- package/dist/collection/components/salla-order-details/salla-order-details-multiple-bundle-product.js +5 -5
- package/dist/collection/components/salla-order-details/salla-order-details-options.js +6 -5
- package/dist/collection/components/salla-order-details/salla-order-details.js +4 -3
- package/dist/collection/components/salla-order-edit/salla-order-edit-item.js +4 -4
- package/dist/collection/components/salla-order-edit/salla-order-edit.js +4 -4
- package/dist/collection/components/salla-order-summary/salla-order-summary.js +2 -2
- package/dist/collection/components/salla-order-totals-card/salla-order-totals-card.js +4 -3
- package/dist/collection/components/salla-orders/salla-orders.js +4 -4
- package/dist/collection/components/salla-payments/salla-payments.js +0 -1
- package/dist/collection/components/salla-placeholder/salla-placeholder.js +3 -3
- package/dist/collection/components/salla-price-range/salla-price-range.js +8 -8
- package/dist/collection/components/salla-product-availability/salla-product-availability.js +6 -6
- package/dist/collection/components/salla-product-card/salla-product-card.js +18 -18
- package/dist/collection/components/salla-product-options/salla-product-options.js +15 -13
- package/dist/collection/components/salla-products-list/salla-products-list.js +20 -21
- package/dist/collection/components/salla-products-slider/salla-products-slider.js +22 -23
- package/dist/collection/components/salla-progress-bar/salla-progress-bar.js +21 -20
- package/dist/collection/components/salla-quantity-input/salla-quantity-input.js +2 -2
- package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +16 -17
- package/dist/collection/components/salla-quick-order/salla-quick-order.js +11 -11
- package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +2 -2
- package/dist/collection/components/salla-rating-stars/salla-rating-stars.js +8 -8
- package/dist/collection/components/salla-review-card/salla-review-card.js +3 -3
- package/dist/collection/components/salla-reviews/salla-reviews.js +16 -13
- package/dist/collection/components/salla-reviews-summary/salla-reviews-summary.js +2 -2
- package/dist/collection/components/salla-scopes/salla-scopes.js +2 -2
- package/dist/collection/components/salla-search/salla-search.js +6 -6
- package/dist/collection/components/salla-skeleton/salla-skeleton.js +3 -3
- package/dist/collection/components/salla-slider/salla-slider.css +9 -2
- package/dist/collection/components/salla-slider/salla-slider.js +25 -25
- package/dist/collection/components/salla-social-share/salla-social-share.js +3 -3
- package/dist/collection/components/salla-tabs/salla-tab-content.js +2 -2
- package/dist/collection/components/salla-tabs/salla-tab-header.js +5 -5
- package/dist/collection/components/salla-tabs/salla-tabs.js +2 -2
- package/dist/collection/components/salla-tel-input/salla-tel-input.js +9 -8
- package/dist/collection/components/salla-tooltip/salla-tooltip.js +5 -5
- package/dist/collection/components/salla-trust-badges/salla-trust-badges.js +1 -1
- package/dist/collection/components/salla-user-menu/salla-user-menu.js +5 -5
- package/dist/collection/components/salla-user-profile/salla-user-profile.js +1 -1
- package/dist/collection/components/salla-verify/salla-verify.js +4 -4
- package/dist/components/Helper.js +1 -432
- package/dist/components/_commonjsHelpers.js +1 -7
- package/dist/components/anime.es.js +1 -1310
- package/dist/components/arrow-left.js +1 -8
- package/dist/components/axios.js +2 -3908
- package/dist/components/bell-ring.js +1 -8
- package/dist/components/camera.js +1 -8
- package/dist/components/cancel.js +1 -8
- package/dist/components/cart.js +1 -8
- package/dist/components/check-circle2.js +1 -15
- package/dist/components/check.js +1 -8
- package/dist/components/facebook.js +1 -10
- package/dist/components/filepond-plugin-file-poster.js +3 -659
- package/dist/components/filepond-plugin-file-validate-size.js +2 -204
- package/dist/components/filepond-plugin-file-validate-type.js +3 -279
- package/dist/components/filepond-plugin-image-edit.js +2 -487
- package/dist/components/filepond-plugin-image-exif-orientation.js +2 -214
- package/dist/components/filepond-plugin-image-preview.js +2 -2237
- package/dist/components/filepond.js +3 -11282
- package/dist/components/gift.js +1 -8
- package/dist/components/image.js +1 -8
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -8163
- package/dist/components/index2.js +1 -1709
- package/dist/components/index3.js +1 -2550
- package/dist/components/interfaces.js +1 -12
- package/dist/components/isObject.js +1 -292
- package/dist/components/keyboard_arrow_down.js +1 -8
- package/dist/components/keyboard_arrow_right.js +1 -15
- package/dist/components/location.js +1 -11
- package/dist/components/mail.js +1 -8
- package/dist/components/minus.js +1 -15
- package/dist/components/salla-accordion-body.js +1 -6
- package/dist/components/salla-accordion-body2.js +1 -30
- package/dist/components/salla-accordion-head.js +1 -6
- package/dist/components/salla-accordion-head2.js +1 -63
- package/dist/components/salla-accordion.js +1 -6
- package/dist/components/salla-accordion2.js +1 -68
- package/dist/components/salla-add-product-button.js +1 -6
- package/dist/components/salla-add-product-button2.js +1 -306
- package/dist/components/salla-advertisement.js +1 -155
- package/dist/components/salla-alert.js +1 -59
- package/dist/components/salla-app-install-alert.js +1 -91
- package/dist/components/salla-apps-icons.js +1 -63
- package/dist/components/salla-booking-field.js +1 -6
- package/dist/components/salla-booking-field2.js +1 -221
- package/dist/components/salla-bottom-alert.js +1 -214
- package/dist/components/salla-breadcrumb.js +1 -226
- package/dist/components/salla-bullet-delivery.js +1 -2114
- package/dist/components/salla-button.js +1 -6
- package/dist/components/salla-button2.js +1 -174
- package/dist/components/salla-cart-coupons.js +1 -284
- package/dist/components/salla-cart-item-offers.js +1 -143
- package/dist/components/salla-cart-summary.js +1 -136
- package/dist/components/salla-color-picker.js +1 -6
- package/dist/components/salla-color-picker2.js +1 -260
- package/dist/components/salla-comment-form.js +1 -6
- package/dist/components/salla-comment-form2.js +1 -64
- package/dist/components/salla-comment-item.js +1 -6
- package/dist/components/salla-comment-item2.js +1 -217
- package/dist/components/salla-comments.js +1 -395
- package/dist/components/salla-conditional-fields.js +1 -6
- package/dist/components/salla-conditional-fields2.js +1 -137
- package/dist/components/salla-conditional-offer.js +1 -194
- package/dist/components/salla-contacts.js +1 -125
- package/dist/components/salla-cookies-bar.js +1 -107
- package/dist/components/salla-count-down.js +1 -6
- package/dist/components/salla-count-down2.js +1 -247
- package/dist/components/salla-custom-fields.js +1 -175
- package/dist/components/salla-datetime-picker.js +1 -6
- package/dist/components/salla-datetime-picker2.js +1 -342
- package/dist/components/salla-delivery-promise.js +1 -263
- package/dist/components/salla-drawer.js +1 -6
- package/dist/components/salla-drawer2.js +1 -214
- package/dist/components/salla-file-upload.js +1 -6
- package/dist/components/salla-file-upload2.js +1 -583
- package/dist/components/salla-filters-widget.js +1 -6
- package/dist/components/salla-filters-widget2.js +1 -245
- package/dist/components/salla-filters.js +1 -253
- package/dist/components/salla-fulfillment-methods.js +1 -61
- package/dist/components/salla-gifting.js +1 -732
- package/dist/components/salla-hook.js +1 -47
- package/dist/components/salla-infinite-scroll.js +1 -112
- package/dist/components/salla-installment.js +1 -306
- package/dist/components/salla-list-tile.js +1 -6
- package/dist/components/salla-list-tile2.js +1 -47
- package/dist/components/salla-loading.js +1 -6
- package/dist/components/salla-loading2.js +1 -51
- package/dist/components/salla-localization-modal.js +1 -296
- package/dist/components/salla-login-modal.js +1 -6
- package/dist/components/salla-login-modal2.js +1 -359
- package/dist/components/salla-loyalty-prize-item.js +1 -39
- package/dist/components/salla-loyalty-program.js +1 -115
- package/dist/components/salla-loyalty.js +1 -304
- package/dist/components/salla-maintenance-alert.js +1 -57
- package/dist/components/salla-map.js +1 -6
- package/dist/components/salla-map2.js +1 -766
- package/dist/components/salla-menu.js +1 -165
- package/dist/components/salla-metadata.js +1 -97
- package/dist/components/salla-modal.js +1 -6
- package/dist/components/salla-modal2.js +1 -215
- package/dist/components/salla-multiple-bundle-product-cart.js +1 -6
- package/dist/components/salla-multiple-bundle-product-cart2.js +1 -151
- package/dist/components/salla-multiple-bundle-product-details.js +1 -6
- package/dist/components/salla-multiple-bundle-product-details2.js +1 -296
- package/dist/components/salla-multiple-bundle-product-options-modal.js +1 -6
- package/dist/components/salla-multiple-bundle-product-options-modal2.js +1 -598
- package/dist/components/salla-multiple-bundle-product-slider.js +1 -6
- package/dist/components/salla-multiple-bundle-product-slider2.js +1 -136
- package/dist/components/salla-multiple-bundle-product.js +1 -207
- package/dist/components/salla-notification-item.js +1 -6
- package/dist/components/salla-notification-item2.js +1 -32
- package/dist/components/salla-notifications.js +1 -145
- package/dist/components/salla-offer-modal.js +1 -328
- package/dist/components/salla-offer.js +1 -478
- package/dist/components/salla-order-details-multiple-bundle-product.js +1 -6
- package/dist/components/salla-order-details-multiple-bundle-product2.js +1 -122
- package/dist/components/salla-order-details-options.js +1 -6
- package/dist/components/salla-order-details-options2.js +1 -140
- package/dist/components/salla-order-details.js +1 -122
- package/dist/components/salla-order-edit-item.js +1 -6
- package/dist/components/salla-order-edit-item2.js +1 -181
- package/dist/components/salla-order-edit.js +1 -288
- package/dist/components/salla-order-summary.js +1 -132
- package/dist/components/salla-order-totals-card.js +1 -87
- package/dist/components/salla-orders.js +1 -271
- package/dist/components/salla-payments.js +1 -76
- package/dist/components/salla-placeholder.js +1 -6
- package/dist/components/salla-placeholder2.js +1 -66
- package/dist/components/salla-price-range.js +1 -6
- package/dist/components/salla-price-range2.js +1 -204
- package/dist/components/salla-product-availability.js +1 -6
- package/dist/components/salla-product-availability2.js +1 -206
- package/dist/components/salla-product-card.js +1 -6
- package/dist/components/salla-product-card2.js +1 -241
- package/dist/components/salla-product-options.js +1 -6
- package/dist/components/salla-product-options2.js +1 -962
- package/dist/components/salla-product-size-guide.js +1 -130
- package/dist/components/salla-products-list.js +1 -6
- package/dist/components/salla-products-list2.js +1 -812
- package/dist/components/salla-products-slider.js +1 -6
- package/dist/components/salla-products-slider2.js +1 -215
- package/dist/components/salla-progress-bar.js +1 -6
- package/dist/components/salla-progress-bar2.js +1 -94
- package/dist/components/salla-quantity-input.js +1 -6
- package/dist/components/salla-quantity-input2.js +1 -127
- package/dist/components/salla-quick-buy.js +1 -6
- package/dist/components/salla-quick-buy2.js +1 -1181
- package/dist/components/salla-quick-order.js +1 -299
- package/dist/components/salla-rating-modal.js +1 -530
- package/dist/components/salla-rating-stars.js +1 -6
- package/dist/components/salla-rating-stars2.js +1 -162
- package/dist/components/salla-review-card.js +1 -6
- package/dist/components/salla-review-card2.js +1 -198
- package/dist/components/salla-reviews-page.js +1 -726
- package/dist/components/salla-reviews-summary.js +1 -6
- package/dist/components/salla-reviews-summary2.js +1 -132
- package/dist/components/salla-reviews.js +1 -143
- package/dist/components/salla-scopes.js +1 -249
- package/dist/components/salla-search.js +1 -213
- package/dist/components/salla-skeleton.js +1 -6
- package/dist/components/salla-skeleton2.js +1 -50
- package/dist/components/salla-slider.js +1 -6
- package/dist/components/salla-slider2.js +1 -10483
- package/dist/components/salla-social-share.js +1 -194
- package/dist/components/salla-social.js +1 -89
- package/dist/components/salla-tab-content.js +1 -6
- package/dist/components/salla-tab-content2.js +1 -55
- package/dist/components/salla-tab-header.js +1 -6
- package/dist/components/salla-tab-header2.js +1 -85
- package/dist/components/salla-tabs.js +1 -6
- package/dist/components/salla-tabs2.js +1 -75
- package/dist/components/salla-tel-input.js +1 -6
- package/dist/components/salla-tel-input2.js +1 -168
- package/dist/components/salla-tiered-offer.js +1 -366
- package/dist/components/salla-tooltip.js +1 -6
- package/dist/components/salla-tooltip2.js +1 -57
- package/dist/components/salla-trust-badges.js +1 -90
- package/dist/components/salla-user-menu.js +1 -344
- package/dist/components/salla-user-profile.js +1 -203
- package/dist/components/salla-user-settings.js +1 -139
- package/dist/components/salla-verify.js +1 -303
- package/dist/components/salla-wallet.js +1 -114
- package/dist/components/search.js +1 -8
- package/dist/components/shopping-bag.js +1 -8
- package/dist/components/special-discount.js +1 -8
- package/dist/components/star.js +1 -8
- package/dist/components/star2.js +1 -8
- package/dist/components/vanilla-picker.js +2 -1034
- package/dist/components/whatsapp2.js +1 -8
- package/dist/esm/app-globals-BFryt7-C.js +37 -0
- package/dist/esm/{filepond-kTbl0kuh.js → filepond-DlGaLh8N.js} +10 -5
- package/dist/esm/{filepond-plugin-file-poster-CyywnjKv.js → filepond-plugin-file-poster-BTVFYcQx.js} +11 -7
- package/dist/esm/{filepond-plugin-file-validate-size-DgteZhje.js → filepond-plugin-file-validate-size-DGryLmWv.js} +1 -1
- package/dist/esm/filepond-plugin-file-validate-type-DxKfCD0V.js +269 -0
- package/dist/esm/{filepond-plugin-image-edit-pZ_mETE7.js → filepond-plugin-image-edit-2W7pu9hn.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-CjKYl7HL.js → filepond-plugin-image-exif-orientation-OQu-IvPH.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-BzJTl_2A.js → filepond-plugin-image-preview-DEW_tSNR.js} +1 -1
- package/dist/esm/{index-3Kis_Ivk.js → index-BDqMkCqE.js} +1 -1
- package/dist/esm/{index-C23tPnnH.js → index-DYB20YqN.js} +1966 -1344
- package/dist/esm/loader.js +4 -3
- package/dist/esm/salla-accordion-body_2.entry.js +5 -5
- package/dist/esm/salla-accordion_6.entry.js +19 -15
- package/dist/esm/salla-add-product-button_4.entry.js +12 -10
- package/dist/esm/salla-advertisement.entry.js +3 -3
- package/dist/esm/salla-alert_2.entry.js +5 -5
- package/dist/esm/salla-app-install-alert.entry.js +3 -3
- package/dist/esm/salla-apps-icons.entry.js +3 -3
- package/dist/esm/salla-booking-field_7.entry.js +25 -23
- package/dist/esm/salla-bullet-delivery.entry.js +3 -3
- package/dist/esm/salla-cart-coupons.entry.js +3 -3
- package/dist/esm/salla-cart-item-offers_2.entry.js +5 -5
- package/dist/esm/salla-comment-form_8.entry.js +17 -17
- package/dist/esm/salla-conditional-offer.entry.js +3 -3
- package/dist/esm/salla-contacts.entry.js +3 -3
- package/dist/esm/salla-cookies-bar.entry.js +3 -3
- package/dist/esm/salla-count-down.entry.js +35 -11
- package/dist/esm/salla-custom-fields.entry.js +3 -3
- package/dist/esm/salla-delivery-promise.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +3 -3
- package/dist/esm/salla-filters.entry.js +3 -3
- package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
- package/dist/esm/salla-gifting.entry.js +3 -3
- package/dist/esm/salla-hook.entry.js +5 -2
- package/dist/esm/salla-infinite-scroll.entry.js +3 -3
- package/dist/esm/salla-installment.entry.js +3 -3
- package/dist/esm/salla-list-tile.entry.js +3 -3
- package/dist/esm/salla-localization-modal.entry.js +1 -1
- package/dist/esm/salla-login-modal.entry.js +3 -3
- package/dist/esm/salla-loyalty-prize-item.entry.js +3 -3
- package/dist/esm/salla-loyalty-program.entry.js +3 -3
- package/dist/esm/salla-loyalty.entry.js +3 -3
- package/dist/esm/salla-maintenance-alert.entry.js +3 -3
- package/dist/esm/salla-map.entry.js +3 -3
- package/dist/esm/salla-menu.entry.js +3 -3
- package/dist/esm/salla-metadata.entry.js +3 -3
- package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +5 -5
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +8 -6
- package/dist/esm/salla-multiple-bundle-product.entry.js +6 -4
- package/dist/esm/salla-notification-item.entry.js +3 -3
- package/dist/esm/salla-notifications.entry.js +50 -5
- package/dist/esm/salla-offer-modal.entry.js +3 -3
- package/dist/esm/salla-offer.entry.js +3 -3
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +3 -3
- package/dist/esm/salla-order-details-options.entry.js +3 -3
- package/dist/esm/salla-order-details.entry.js +6 -4
- package/dist/esm/salla-order-edit-item.entry.js +3 -3
- package/dist/esm/salla-order-edit.entry.js +3 -3
- package/dist/esm/salla-order-summary.entry.js +3 -3
- package/dist/esm/salla-order-totals-card.entry.js +6 -4
- package/dist/esm/salla-orders.entry.js +3 -3
- package/dist/esm/salla-payments.entry.js +3 -3
- package/dist/esm/salla-placeholder.entry.js +3 -3
- package/dist/esm/salla-price-range.entry.js +3 -3
- package/dist/esm/salla-product-card.entry.js +3 -3
- package/dist/esm/salla-product-size-guide.entry.js +3 -3
- package/dist/esm/salla-products-list.entry.js +3 -3
- package/dist/esm/salla-products-slider.entry.js +3 -3
- package/dist/esm/salla-progress-bar.entry.js +3 -3
- package/dist/esm/salla-quick-order.entry.js +3 -3
- package/dist/esm/salla-rating-modal.entry.js +3 -3
- package/dist/esm/salla-scopes.entry.js +3 -3
- package/dist/esm/salla-search.entry.js +6 -4
- package/dist/esm/salla-skeleton.entry.js +3 -3
- package/dist/esm/salla-slider.entry.js +20 -14
- package/dist/esm/salla-social-share.entry.js +3 -3
- package/dist/esm/salla-social.entry.js +3 -3
- package/dist/esm/salla-tab-content_3.entry.js +7 -7
- package/dist/esm/salla-tiered-offer.entry.js +3 -3
- package/dist/esm/salla-tooltip.entry.js +3 -3
- package/dist/esm/salla-trust-badges.entry.js +3 -3
- package/dist/esm/salla-user-menu.entry.js +3 -3
- package/dist/esm/salla-user-profile.entry.js +3 -3
- package/dist/esm/salla-user-settings.entry.js +3 -3
- package/dist/esm/salla-verify.entry.js +3 -3
- package/dist/esm/salla-wallet.entry.js +3 -3
- package/dist/esm/twilight.js +5 -4
- package/dist/esm/{vanilla-picker-CEy5x8Cf.js → vanilla-picker-Dt9vZPZF.js} +1 -1
- package/dist/twilight/{p-651fe6e4.entry.js → p-06fa7327.entry.js} +1 -1
- package/dist/twilight/{p-a50f7f70.entry.js → p-09d39785.entry.js} +1 -1
- package/dist/twilight/{p-744d6394.entry.js → p-0add06f9.entry.js} +1 -1
- package/dist/twilight/{p-f251e744.entry.js → p-105b1dab.entry.js} +1 -1
- package/dist/twilight/{p-407828e4.entry.js → p-108d8c8b.entry.js} +1 -1
- package/dist/twilight/{p-2a1871c2.entry.js → p-1875537e.entry.js} +1 -1
- package/dist/twilight/{p-ff6f769c.entry.js → p-18bb0181.entry.js} +1 -1
- package/dist/twilight/p-1daeed6e.entry.js +4 -0
- package/dist/twilight/{p-2aa48902.entry.js → p-1ef2602d.entry.js} +1 -1
- package/dist/twilight/{p-27f34c85.entry.js → p-2881bb33.entry.js} +1 -1
- package/dist/twilight/{p-c3d0c062.entry.js → p-293c6cf3.entry.js} +1 -1
- package/dist/twilight/{p-866b297b.entry.js → p-296d2dd0.entry.js} +1 -1
- package/dist/twilight/{p-3a5aaa20.entry.js → p-2abaa633.entry.js} +1 -1
- package/dist/twilight/p-2ddb3fce.entry.js +4 -0
- package/dist/twilight/{p-81f648a2.entry.js → p-2fe01e44.entry.js} +1 -1
- package/dist/twilight/p-33779828.entry.js +4 -0
- package/dist/twilight/p-34968e31.entry.js +4 -0
- package/dist/twilight/{p-3745a7d0.entry.js → p-34b670fc.entry.js} +1 -1
- package/dist/twilight/{p-9f23dd30.entry.js → p-3ccc532d.entry.js} +1 -1
- package/dist/twilight/{p-f2ee9ceb.entry.js → p-41c733c2.entry.js} +1 -1
- package/dist/twilight/{p-67fe5680.entry.js → p-44fa7521.entry.js} +1 -1
- package/dist/twilight/{p-b4f07395.entry.js → p-4932857d.entry.js} +1 -1
- package/dist/twilight/{p-81f6638f.entry.js → p-4fa4547a.entry.js} +1 -1
- package/dist/twilight/{p-ba4b672c.entry.js → p-542d3277.entry.js} +1 -1
- package/dist/twilight/{p-a00e249b.entry.js → p-57ff1f25.entry.js} +1 -1
- package/dist/twilight/{p-827edf95.entry.js → p-59ae82bd.entry.js} +1 -1
- package/dist/twilight/{p-82e3c734.entry.js → p-647b6d76.entry.js} +1 -1
- package/dist/twilight/p-665189b4.entry.js +4 -0
- package/dist/twilight/{p-b55da21d.entry.js → p-6f36541a.entry.js} +1 -1
- package/dist/twilight/{p-c8aa5377.entry.js → p-7093a427.entry.js} +1 -1
- package/dist/twilight/{p-f201122a.entry.js → p-748df7e6.entry.js} +1 -1
- package/dist/twilight/p-776c9d33.entry.js +4 -0
- package/dist/twilight/{p-ce9fee6d.entry.js → p-7abddca8.entry.js} +1 -1
- package/dist/twilight/p-7b8313ef.entry.js +4 -0
- package/dist/twilight/p-7bd0ede5.entry.js +4 -0
- package/dist/twilight/p-817b8ba5.entry.js +4 -0
- package/dist/twilight/{p-5ef1b170.entry.js → p-87c0ca91.entry.js} +1 -1
- package/dist/twilight/p-8e8d9d7d.entry.js +4 -0
- package/dist/twilight/{p-BHjlzmYy.js → p-8r0S6BcZ.js} +1 -1
- package/dist/twilight/{p-face0448.entry.js → p-94dbc1e9.entry.js} +1 -1
- package/dist/twilight/{p-4e00f827.entry.js → p-96a20515.entry.js} +1 -1
- package/dist/twilight/{p-81f76d49.entry.js → p-96d03a28.entry.js} +1 -1
- package/dist/twilight/{p-97df32eb.entry.js → p-96e78428.entry.js} +1 -1
- package/dist/twilight/{p-CU-HtXWh.js → p-BZnoSB1s.js} +1 -1
- package/dist/twilight/p-BkClxrC4.js +9 -0
- package/dist/twilight/p-Ck4zxCil.js +9 -0
- package/dist/twilight/{p-IoI86ovS.js → p-Cw3UBzjl.js} +1 -1
- package/dist/twilight/p-D1vqXXNX.js +9 -0
- package/dist/twilight/p-DYB20YqN.js +5 -0
- package/dist/twilight/p-Vl6qpttb.js +4 -0
- package/dist/twilight/{p-BgG5eq1x.js → p-X6Yi3bYP.js} +1 -1
- package/dist/twilight/{p-d022b6ec.entry.js → p-a01f1992.entry.js} +1 -1
- package/dist/twilight/{p-5d37cc33.entry.js → p-aa7c5de0.entry.js} +1 -1
- package/dist/twilight/{p-b6ded196.entry.js → p-aaa0c743.entry.js} +1 -1
- package/dist/twilight/{p-713590e2.entry.js → p-ad041ab5.entry.js} +1 -1
- package/dist/twilight/{p-d1dd1db6.entry.js → p-ad07f67a.entry.js} +1 -1
- package/dist/twilight/{p-f1f74b41.entry.js → p-af3c74f4.entry.js} +1 -1
- package/dist/twilight/p-af60e72a.entry.js +4 -0
- package/dist/twilight/{p-bdcf3926.entry.js → p-b17d055d.entry.js} +1 -1
- package/dist/twilight/{p-c68f3054.entry.js → p-b598c0f7.entry.js} +1 -1
- package/dist/twilight/{p-8c6db6d7.entry.js → p-b64f3155.entry.js} +1 -1
- package/dist/twilight/p-bNzv71Xl.js +9 -0
- package/dist/twilight/{p-BqCmPfAo.js → p-bScl0xMh.js} +2 -2
- package/dist/twilight/{p-344c1910.entry.js → p-bff4c7b3.entry.js} +1 -1
- package/dist/twilight/{p-1b1f9f71.entry.js → p-c091e2dc.entry.js} +1 -1
- package/dist/twilight/{p-775b42ec.entry.js → p-c1fd45b1.entry.js} +1 -1
- package/dist/twilight/{p-1c215c8c.entry.js → p-c3ffb88a.entry.js} +1 -1
- package/dist/twilight/{p-9deae4f4.entry.js → p-c87951a2.entry.js} +1 -1
- package/dist/twilight/{p-1899f283.entry.js → p-ccfe5308.entry.js} +1 -1
- package/dist/twilight/{p-98eb495e.entry.js → p-d337c399.entry.js} +1 -1
- package/dist/twilight/{p-7b717899.entry.js → p-d371d450.entry.js} +1 -1
- package/dist/twilight/{p-f8b6967f.entry.js → p-d4a242f8.entry.js} +1 -1
- package/dist/twilight/{p-194d87c6.entry.js → p-d9f5a8cd.entry.js} +1 -1
- package/dist/twilight/{p-ff9b33bb.entry.js → p-dd2bd5dc.entry.js} +1 -1
- package/dist/twilight/{p-e89812d8.entry.js → p-df6853b5.entry.js} +1 -1
- package/dist/twilight/{p-05663bb1.entry.js → p-e28c0773.entry.js} +1 -1
- package/dist/twilight/{p-a76b3dba.entry.js → p-e3b8e0e1.entry.js} +1 -1
- package/dist/twilight/p-e679884a.entry.js +4 -0
- package/dist/twilight/{p-11767786.entry.js → p-e6bbf50d.entry.js} +1 -1
- package/dist/twilight/{p-1ca75c99.entry.js → p-e94f217b.entry.js} +1 -1
- package/dist/twilight/{p-d81ad2c3.entry.js → p-eac718cd.entry.js} +1 -1
- package/dist/twilight/{p-85ceef78.entry.js → p-ede67a08.entry.js} +1 -1
- package/dist/twilight/p-efab88c5.entry.js +4 -0
- package/dist/twilight/{p-1dbaefb8.entry.js → p-f176d41d.entry.js} +1 -1
- package/dist/twilight/p-f5d15e71.entry.js +4 -0
- package/dist/twilight/{p-50621375.entry.js → p-f7999a6d.entry.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-count-down/salla-count-down.d.ts +6 -0
- package/dist/types/components/salla-notifications/interfaces.d.ts +20 -0
- package/dist/types/components/salla-notifications/salla-notifications.d.ts +17 -0
- package/dist/types/components.d.ts +763 -177
- package/dist/types/stencil-public-runtime.d.ts +169 -11
- package/package.json +5 -5
- package/dist/cjs/filepond-plugin-file-validate-type-Dfy66STE.js +0 -287
- package/dist/esm/filepond-plugin-file-validate-type-BYs_scJr.js +0 -285
- package/dist/twilight/p-0652987b.entry.js +0 -4
- package/dist/twilight/p-14529fd6.entry.js +0 -4
- package/dist/twilight/p-1c8394db.entry.js +0 -4
- package/dist/twilight/p-346b55d6.entry.js +0 -4
- package/dist/twilight/p-3962c34c.entry.js +0 -4
- package/dist/twilight/p-4e9e3ab1.entry.js +0 -4
- package/dist/twilight/p-549f59ed.entry.js +0 -4
- package/dist/twilight/p-54f65187.entry.js +0 -4
- package/dist/twilight/p-726513f8.entry.js +0 -4
- package/dist/twilight/p-753464fd.entry.js +0 -4
- package/dist/twilight/p-AfW2b46_.js +0 -9
- package/dist/twilight/p-C23tPnnH.js +0 -5
- package/dist/twilight/p-CrYUKEsF.js +0 -9
- package/dist/twilight/p-HWjjIZ9_.js +0 -9
- package/dist/twilight/p-Ig1Tafsp.js +0 -9
- package/dist/twilight/p-c9001d7f.entry.js +0 -4
- package/dist/twilight/p-cf9573fd.entry.js +0 -4
- package/dist/twilight/p-e6124fab.entry.js +0 -4
- package/dist/twilight/p-eb5a8329.entry.js +0 -4
|
@@ -1,2553 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
var HOOKS = [
|
|
5
|
-
"onChange",
|
|
6
|
-
"onClose",
|
|
7
|
-
"onDayCreate",
|
|
8
|
-
"onDestroy",
|
|
9
|
-
"onKeyDown",
|
|
10
|
-
"onMonthChange",
|
|
11
|
-
"onOpen",
|
|
12
|
-
"onParseConfig",
|
|
13
|
-
"onReady",
|
|
14
|
-
"onValueUpdate",
|
|
15
|
-
"onYearChange",
|
|
16
|
-
"onPreCalendarPosition",
|
|
17
|
-
];
|
|
18
|
-
var defaults = {
|
|
19
|
-
_disable: [],
|
|
20
|
-
allowInput: false,
|
|
21
|
-
allowInvalidPreload: false,
|
|
22
|
-
altFormat: "F j, Y",
|
|
23
|
-
altInput: false,
|
|
24
|
-
altInputClass: "form-control input",
|
|
25
|
-
animate: typeof window === "object" &&
|
|
26
|
-
window.navigator.userAgent.indexOf("MSIE") === -1,
|
|
27
|
-
ariaDateFormat: "F j, Y",
|
|
28
|
-
autoFillDefaultTime: true,
|
|
29
|
-
clickOpens: true,
|
|
30
|
-
closeOnSelect: true,
|
|
31
|
-
conjunction: ", ",
|
|
32
|
-
dateFormat: "Y-m-d",
|
|
33
|
-
defaultHour: 12,
|
|
34
|
-
defaultMinute: 0,
|
|
35
|
-
defaultSeconds: 0,
|
|
36
|
-
disable: [],
|
|
37
|
-
disableMobile: false,
|
|
38
|
-
enableSeconds: false,
|
|
39
|
-
enableTime: false,
|
|
40
|
-
errorHandler: function (err) {
|
|
41
|
-
return typeof console !== "undefined" && console.warn(err);
|
|
42
|
-
},
|
|
43
|
-
getWeek: function (givenDate) {
|
|
44
|
-
var date = new Date(givenDate.getTime());
|
|
45
|
-
date.setHours(0, 0, 0, 0);
|
|
46
|
-
date.setDate(date.getDate() + 3 - ((date.getDay() + 6) % 7));
|
|
47
|
-
var week1 = new Date(date.getFullYear(), 0, 4);
|
|
48
|
-
return (1 +
|
|
49
|
-
Math.round(((date.getTime() - week1.getTime()) / 86400000 -
|
|
50
|
-
3 +
|
|
51
|
-
((week1.getDay() + 6) % 7)) /
|
|
52
|
-
7));
|
|
53
|
-
},
|
|
54
|
-
hourIncrement: 1,
|
|
55
|
-
ignoredFocusElements: [],
|
|
56
|
-
inline: false,
|
|
57
|
-
locale: "default",
|
|
58
|
-
minuteIncrement: 5,
|
|
59
|
-
mode: "single",
|
|
60
|
-
monthSelectorType: "dropdown",
|
|
61
|
-
nextArrow: "<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",
|
|
62
|
-
noCalendar: false,
|
|
63
|
-
now: new Date(),
|
|
64
|
-
onChange: [],
|
|
65
|
-
onClose: [],
|
|
66
|
-
onDayCreate: [],
|
|
67
|
-
onDestroy: [],
|
|
68
|
-
onKeyDown: [],
|
|
69
|
-
onMonthChange: [],
|
|
70
|
-
onOpen: [],
|
|
71
|
-
onParseConfig: [],
|
|
72
|
-
onReady: [],
|
|
73
|
-
onValueUpdate: [],
|
|
74
|
-
onYearChange: [],
|
|
75
|
-
onPreCalendarPosition: [],
|
|
76
|
-
plugins: [],
|
|
77
|
-
position: "auto",
|
|
78
|
-
positionElement: undefined,
|
|
79
|
-
prevArrow: "<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",
|
|
80
|
-
shorthandCurrentMonth: false,
|
|
81
|
-
showMonths: 1,
|
|
82
|
-
static: false,
|
|
83
|
-
time_24hr: false,
|
|
84
|
-
weekNumbers: false,
|
|
85
|
-
wrap: false,
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
var english = {
|
|
89
|
-
weekdays: {
|
|
90
|
-
shorthand: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
91
|
-
longhand: [
|
|
92
|
-
"Sunday",
|
|
93
|
-
"Monday",
|
|
94
|
-
"Tuesday",
|
|
95
|
-
"Wednesday",
|
|
96
|
-
"Thursday",
|
|
97
|
-
"Friday",
|
|
98
|
-
"Saturday",
|
|
99
|
-
],
|
|
100
|
-
},
|
|
101
|
-
months: {
|
|
102
|
-
shorthand: [
|
|
103
|
-
"Jan",
|
|
104
|
-
"Feb",
|
|
105
|
-
"Mar",
|
|
106
|
-
"Apr",
|
|
107
|
-
"May",
|
|
108
|
-
"Jun",
|
|
109
|
-
"Jul",
|
|
110
|
-
"Aug",
|
|
111
|
-
"Sep",
|
|
112
|
-
"Oct",
|
|
113
|
-
"Nov",
|
|
114
|
-
"Dec",
|
|
115
|
-
],
|
|
116
|
-
longhand: [
|
|
117
|
-
"January",
|
|
118
|
-
"February",
|
|
119
|
-
"March",
|
|
120
|
-
"April",
|
|
121
|
-
"May",
|
|
122
|
-
"June",
|
|
123
|
-
"July",
|
|
124
|
-
"August",
|
|
125
|
-
"September",
|
|
126
|
-
"October",
|
|
127
|
-
"November",
|
|
128
|
-
"December",
|
|
129
|
-
],
|
|
130
|
-
},
|
|
131
|
-
daysInMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
|
|
132
|
-
firstDayOfWeek: 0,
|
|
133
|
-
ordinal: function (nth) {
|
|
134
|
-
var s = nth % 100;
|
|
135
|
-
if (s > 3 && s < 21)
|
|
136
|
-
return "th";
|
|
137
|
-
switch (s % 10) {
|
|
138
|
-
case 1:
|
|
139
|
-
return "st";
|
|
140
|
-
case 2:
|
|
141
|
-
return "nd";
|
|
142
|
-
case 3:
|
|
143
|
-
return "rd";
|
|
144
|
-
default:
|
|
145
|
-
return "th";
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
rangeSeparator: " to ",
|
|
149
|
-
weekAbbreviation: "Wk",
|
|
150
|
-
scrollTitle: "Scroll to increment",
|
|
151
|
-
toggleTitle: "Click to toggle",
|
|
152
|
-
amPM: ["AM", "PM"],
|
|
153
|
-
yearAriaLabel: "Year",
|
|
154
|
-
monthAriaLabel: "Month",
|
|
155
|
-
hourAriaLabel: "Hour",
|
|
156
|
-
minuteAriaLabel: "Minute",
|
|
157
|
-
time_24hr: false,
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
var pad = function (number, length) {
|
|
161
|
-
if (length === void 0) { length = 2; }
|
|
162
|
-
return ("000" + number).slice(length * -1);
|
|
163
|
-
};
|
|
164
|
-
var int = function (bool) { return (bool === true ? 1 : 0); };
|
|
165
|
-
function debounce(fn, wait) {
|
|
166
|
-
var t;
|
|
167
|
-
return function () {
|
|
168
|
-
var _this = this;
|
|
169
|
-
var args = arguments;
|
|
170
|
-
clearTimeout(t);
|
|
171
|
-
t = setTimeout(function () { return fn.apply(_this, args); }, wait);
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
var arrayify = function (obj) {
|
|
175
|
-
return obj instanceof Array ? obj : [obj];
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
function toggleClass(elem, className, bool) {
|
|
179
|
-
if (bool === true)
|
|
180
|
-
return elem.classList.add(className);
|
|
181
|
-
elem.classList.remove(className);
|
|
182
|
-
}
|
|
183
|
-
function createElement(tag, className, content) {
|
|
184
|
-
var e = window.document.createElement(tag);
|
|
185
|
-
className = className || "";
|
|
186
|
-
content = content || "";
|
|
187
|
-
e.className = className;
|
|
188
|
-
if (content !== undefined)
|
|
189
|
-
e.textContent = content;
|
|
190
|
-
return e;
|
|
191
|
-
}
|
|
192
|
-
function clearNode(node) {
|
|
193
|
-
while (node.firstChild)
|
|
194
|
-
node.removeChild(node.firstChild);
|
|
195
|
-
}
|
|
196
|
-
function findParent(node, condition) {
|
|
197
|
-
if (condition(node))
|
|
198
|
-
return node;
|
|
199
|
-
else if (node.parentNode)
|
|
200
|
-
return findParent(node.parentNode, condition);
|
|
201
|
-
return undefined;
|
|
202
|
-
}
|
|
203
|
-
function createNumberInput(inputClassName, opts) {
|
|
204
|
-
var wrapper = createElement("div", "numInputWrapper"), numInput = createElement("input", "numInput " + inputClassName), arrowUp = createElement("span", "arrowUp"), arrowDown = createElement("span", "arrowDown");
|
|
205
|
-
if (navigator.userAgent.indexOf("MSIE 9.0") === -1) {
|
|
206
|
-
numInput.type = "number";
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
numInput.type = "text";
|
|
210
|
-
numInput.pattern = "\\d*";
|
|
211
|
-
}
|
|
212
|
-
if (opts !== undefined)
|
|
213
|
-
for (var key in opts)
|
|
214
|
-
numInput.setAttribute(key, opts[key]);
|
|
215
|
-
wrapper.appendChild(numInput);
|
|
216
|
-
wrapper.appendChild(arrowUp);
|
|
217
|
-
wrapper.appendChild(arrowDown);
|
|
218
|
-
return wrapper;
|
|
219
|
-
}
|
|
220
|
-
function getEventTarget(event) {
|
|
221
|
-
try {
|
|
222
|
-
if (typeof event.composedPath === "function") {
|
|
223
|
-
var path = event.composedPath();
|
|
224
|
-
return path[0];
|
|
225
|
-
}
|
|
226
|
-
return event.target;
|
|
227
|
-
}
|
|
228
|
-
catch (error) {
|
|
229
|
-
return event.target;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
var doNothing = function () { return undefined; };
|
|
234
|
-
var monthToStr = function (monthNumber, shorthand, locale) { return locale.months[shorthand ? "shorthand" : "longhand"][monthNumber]; };
|
|
235
|
-
var revFormat = {
|
|
236
|
-
D: doNothing,
|
|
237
|
-
F: function (dateObj, monthName, locale) {
|
|
238
|
-
dateObj.setMonth(locale.months.longhand.indexOf(monthName));
|
|
239
|
-
},
|
|
240
|
-
G: function (dateObj, hour) {
|
|
241
|
-
dateObj.setHours((dateObj.getHours() >= 12 ? 12 : 0) + parseFloat(hour));
|
|
242
|
-
},
|
|
243
|
-
H: function (dateObj, hour) {
|
|
244
|
-
dateObj.setHours(parseFloat(hour));
|
|
245
|
-
},
|
|
246
|
-
J: function (dateObj, day) {
|
|
247
|
-
dateObj.setDate(parseFloat(day));
|
|
248
|
-
},
|
|
249
|
-
K: function (dateObj, amPM, locale) {
|
|
250
|
-
dateObj.setHours((dateObj.getHours() % 12) +
|
|
251
|
-
12 * int(new RegExp(locale.amPM[1], "i").test(amPM)));
|
|
252
|
-
},
|
|
253
|
-
M: function (dateObj, shortMonth, locale) {
|
|
254
|
-
dateObj.setMonth(locale.months.shorthand.indexOf(shortMonth));
|
|
255
|
-
},
|
|
256
|
-
S: function (dateObj, seconds) {
|
|
257
|
-
dateObj.setSeconds(parseFloat(seconds));
|
|
258
|
-
},
|
|
259
|
-
U: function (_, unixSeconds) { return new Date(parseFloat(unixSeconds) * 1000); },
|
|
260
|
-
W: function (dateObj, weekNum, locale) {
|
|
261
|
-
var weekNumber = parseInt(weekNum);
|
|
262
|
-
var date = new Date(dateObj.getFullYear(), 0, 2 + (weekNumber - 1) * 7, 0, 0, 0, 0);
|
|
263
|
-
date.setDate(date.getDate() - date.getDay() + locale.firstDayOfWeek);
|
|
264
|
-
return date;
|
|
265
|
-
},
|
|
266
|
-
Y: function (dateObj, year) {
|
|
267
|
-
dateObj.setFullYear(parseFloat(year));
|
|
268
|
-
},
|
|
269
|
-
Z: function (_, ISODate) { return new Date(ISODate); },
|
|
270
|
-
d: function (dateObj, day) {
|
|
271
|
-
dateObj.setDate(parseFloat(day));
|
|
272
|
-
},
|
|
273
|
-
h: function (dateObj, hour) {
|
|
274
|
-
dateObj.setHours((dateObj.getHours() >= 12 ? 12 : 0) + parseFloat(hour));
|
|
275
|
-
},
|
|
276
|
-
i: function (dateObj, minutes) {
|
|
277
|
-
dateObj.setMinutes(parseFloat(minutes));
|
|
278
|
-
},
|
|
279
|
-
j: function (dateObj, day) {
|
|
280
|
-
dateObj.setDate(parseFloat(day));
|
|
281
|
-
},
|
|
282
|
-
l: doNothing,
|
|
283
|
-
m: function (dateObj, month) {
|
|
284
|
-
dateObj.setMonth(parseFloat(month) - 1);
|
|
285
|
-
},
|
|
286
|
-
n: function (dateObj, month) {
|
|
287
|
-
dateObj.setMonth(parseFloat(month) - 1);
|
|
288
|
-
},
|
|
289
|
-
s: function (dateObj, seconds) {
|
|
290
|
-
dateObj.setSeconds(parseFloat(seconds));
|
|
291
|
-
},
|
|
292
|
-
u: function (_, unixMillSeconds) {
|
|
293
|
-
return new Date(parseFloat(unixMillSeconds));
|
|
294
|
-
},
|
|
295
|
-
w: doNothing,
|
|
296
|
-
y: function (dateObj, year) {
|
|
297
|
-
dateObj.setFullYear(2000 + parseFloat(year));
|
|
298
|
-
},
|
|
299
|
-
};
|
|
300
|
-
var tokenRegex = {
|
|
301
|
-
D: "",
|
|
302
|
-
F: "",
|
|
303
|
-
G: "(\\d\\d|\\d)",
|
|
304
|
-
H: "(\\d\\d|\\d)",
|
|
305
|
-
J: "(\\d\\d|\\d)\\w+",
|
|
306
|
-
K: "",
|
|
307
|
-
M: "",
|
|
308
|
-
S: "(\\d\\d|\\d)",
|
|
309
|
-
U: "(.+)",
|
|
310
|
-
W: "(\\d\\d|\\d)",
|
|
311
|
-
Y: "(\\d{4})",
|
|
312
|
-
Z: "(.+)",
|
|
313
|
-
d: "(\\d\\d|\\d)",
|
|
314
|
-
h: "(\\d\\d|\\d)",
|
|
315
|
-
i: "(\\d\\d|\\d)",
|
|
316
|
-
j: "(\\d\\d|\\d)",
|
|
317
|
-
l: "",
|
|
318
|
-
m: "(\\d\\d|\\d)",
|
|
319
|
-
n: "(\\d\\d|\\d)",
|
|
320
|
-
s: "(\\d\\d|\\d)",
|
|
321
|
-
u: "(.+)",
|
|
322
|
-
w: "(\\d\\d|\\d)",
|
|
323
|
-
y: "(\\d{2})",
|
|
324
|
-
};
|
|
325
|
-
var formats = {
|
|
326
|
-
Z: function (date) { return date.toISOString(); },
|
|
327
|
-
D: function (date, locale, options) {
|
|
328
|
-
return locale.weekdays.shorthand[formats.w(date, locale, options)];
|
|
329
|
-
},
|
|
330
|
-
F: function (date, locale, options) {
|
|
331
|
-
return monthToStr(formats.n(date, locale, options) - 1, false, locale);
|
|
332
|
-
},
|
|
333
|
-
G: function (date, locale, options) {
|
|
334
|
-
return pad(formats.h(date, locale, options));
|
|
335
|
-
},
|
|
336
|
-
H: function (date) { return pad(date.getHours()); },
|
|
337
|
-
J: function (date, locale) {
|
|
338
|
-
return locale.ordinal !== undefined
|
|
339
|
-
? date.getDate() + locale.ordinal(date.getDate())
|
|
340
|
-
: date.getDate();
|
|
341
|
-
},
|
|
342
|
-
K: function (date, locale) { return locale.amPM[int(date.getHours() > 11)]; },
|
|
343
|
-
M: function (date, locale) {
|
|
344
|
-
return monthToStr(date.getMonth(), true, locale);
|
|
345
|
-
},
|
|
346
|
-
S: function (date) { return pad(date.getSeconds()); },
|
|
347
|
-
U: function (date) { return date.getTime() / 1000; },
|
|
348
|
-
W: function (date, _, options) {
|
|
349
|
-
return options.getWeek(date);
|
|
350
|
-
},
|
|
351
|
-
Y: function (date) { return pad(date.getFullYear(), 4); },
|
|
352
|
-
d: function (date) { return pad(date.getDate()); },
|
|
353
|
-
h: function (date) { return (date.getHours() % 12 ? date.getHours() % 12 : 12); },
|
|
354
|
-
i: function (date) { return pad(date.getMinutes()); },
|
|
355
|
-
j: function (date) { return date.getDate(); },
|
|
356
|
-
l: function (date, locale) {
|
|
357
|
-
return locale.weekdays.longhand[date.getDay()];
|
|
358
|
-
},
|
|
359
|
-
m: function (date) { return pad(date.getMonth() + 1); },
|
|
360
|
-
n: function (date) { return date.getMonth() + 1; },
|
|
361
|
-
s: function (date) { return date.getSeconds(); },
|
|
362
|
-
u: function (date) { return date.getTime(); },
|
|
363
|
-
w: function (date) { return date.getDay(); },
|
|
364
|
-
y: function (date) { return String(date.getFullYear()).substring(2); },
|
|
365
|
-
};
|
|
366
|
-
|
|
367
|
-
var createDateFormatter = function (_a) {
|
|
368
|
-
var _b = _a.config, config = _b === void 0 ? defaults : _b, _c = _a.l10n, l10n = _c === void 0 ? english : _c, _d = _a.isMobile, isMobile = _d === void 0 ? false : _d;
|
|
369
|
-
return function (dateObj, frmt, overrideLocale) {
|
|
370
|
-
var locale = overrideLocale || l10n;
|
|
371
|
-
if (config.formatDate !== undefined && !isMobile) {
|
|
372
|
-
return config.formatDate(dateObj, frmt, locale);
|
|
373
|
-
}
|
|
374
|
-
return frmt
|
|
375
|
-
.split("")
|
|
376
|
-
.map(function (c, i, arr) {
|
|
377
|
-
return formats[c] && arr[i - 1] !== "\\"
|
|
378
|
-
? formats[c](dateObj, locale, config)
|
|
379
|
-
: c !== "\\"
|
|
380
|
-
? c
|
|
381
|
-
: "";
|
|
382
|
-
})
|
|
383
|
-
.join("");
|
|
384
|
-
};
|
|
385
|
-
};
|
|
386
|
-
var createDateParser = function (_a) {
|
|
387
|
-
var _b = _a.config, config = _b === void 0 ? defaults : _b, _c = _a.l10n, l10n = _c === void 0 ? english : _c;
|
|
388
|
-
return function (date, givenFormat, timeless, customLocale) {
|
|
389
|
-
if (date !== 0 && !date)
|
|
390
|
-
return undefined;
|
|
391
|
-
var locale = customLocale || l10n;
|
|
392
|
-
var parsedDate;
|
|
393
|
-
var dateOrig = date;
|
|
394
|
-
if (date instanceof Date)
|
|
395
|
-
parsedDate = new Date(date.getTime());
|
|
396
|
-
else if (typeof date !== "string" &&
|
|
397
|
-
date.toFixed !== undefined)
|
|
398
|
-
parsedDate = new Date(date);
|
|
399
|
-
else if (typeof date === "string") {
|
|
400
|
-
var format = givenFormat || (config || defaults).dateFormat;
|
|
401
|
-
var datestr = String(date).trim();
|
|
402
|
-
if (datestr === "today") {
|
|
403
|
-
parsedDate = new Date();
|
|
404
|
-
timeless = true;
|
|
405
|
-
}
|
|
406
|
-
else if (config && config.parseDate) {
|
|
407
|
-
parsedDate = config.parseDate(date, format);
|
|
408
|
-
}
|
|
409
|
-
else if (/Z$/.test(datestr) ||
|
|
410
|
-
/GMT$/.test(datestr)) {
|
|
411
|
-
parsedDate = new Date(date);
|
|
412
|
-
}
|
|
413
|
-
else {
|
|
414
|
-
var matched = void 0, ops = [];
|
|
415
|
-
for (var i = 0, matchIndex = 0, regexStr = ""; i < format.length; i++) {
|
|
416
|
-
var token = format[i];
|
|
417
|
-
var isBackSlash = token === "\\";
|
|
418
|
-
var escaped = format[i - 1] === "\\" || isBackSlash;
|
|
419
|
-
if (tokenRegex[token] && !escaped) {
|
|
420
|
-
regexStr += tokenRegex[token];
|
|
421
|
-
var match = new RegExp(regexStr).exec(date);
|
|
422
|
-
if (match && (matched = true)) {
|
|
423
|
-
ops[token !== "Y" ? "push" : "unshift"]({
|
|
424
|
-
fn: revFormat[token],
|
|
425
|
-
val: match[++matchIndex],
|
|
426
|
-
});
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
else if (!isBackSlash)
|
|
430
|
-
regexStr += ".";
|
|
431
|
-
}
|
|
432
|
-
parsedDate =
|
|
433
|
-
!config || !config.noCalendar
|
|
434
|
-
? new Date(new Date().getFullYear(), 0, 1, 0, 0, 0, 0)
|
|
435
|
-
: new Date(new Date().setHours(0, 0, 0, 0));
|
|
436
|
-
ops.forEach(function (_a) {
|
|
437
|
-
var fn = _a.fn, val = _a.val;
|
|
438
|
-
return (parsedDate = fn(parsedDate, val, locale) || parsedDate);
|
|
439
|
-
});
|
|
440
|
-
parsedDate = matched ? parsedDate : undefined;
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
if (!(parsedDate instanceof Date && !isNaN(parsedDate.getTime()))) {
|
|
444
|
-
config.errorHandler(new Error("Invalid date provided: " + dateOrig));
|
|
445
|
-
return undefined;
|
|
446
|
-
}
|
|
447
|
-
if (timeless === true)
|
|
448
|
-
parsedDate.setHours(0, 0, 0, 0);
|
|
449
|
-
return parsedDate;
|
|
450
|
-
};
|
|
451
|
-
};
|
|
452
|
-
function compareDates(date1, date2, timeless) {
|
|
453
|
-
if (timeless === void 0) { timeless = true; }
|
|
454
|
-
if (timeless !== false) {
|
|
455
|
-
return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -
|
|
456
|
-
new Date(date2.getTime()).setHours(0, 0, 0, 0));
|
|
457
|
-
}
|
|
458
|
-
return date1.getTime() - date2.getTime();
|
|
459
|
-
}
|
|
460
|
-
var isBetween = function (ts, ts1, ts2) {
|
|
461
|
-
return ts > Math.min(ts1, ts2) && ts < Math.max(ts1, ts2);
|
|
462
|
-
};
|
|
463
|
-
var calculateSecondsSinceMidnight = function (hours, minutes, seconds) {
|
|
464
|
-
return hours * 3600 + minutes * 60 + seconds;
|
|
465
|
-
};
|
|
466
|
-
var parseSeconds = function (secondsSinceMidnight) {
|
|
467
|
-
var hours = Math.floor(secondsSinceMidnight / 3600), minutes = (secondsSinceMidnight - hours * 3600) / 60;
|
|
468
|
-
return [hours, minutes, secondsSinceMidnight - hours * 3600 - minutes * 60];
|
|
469
|
-
};
|
|
470
|
-
var duration = {
|
|
471
|
-
DAY: 86400000,
|
|
472
|
-
};
|
|
473
|
-
function getDefaultHours(config) {
|
|
474
|
-
var hours = config.defaultHour;
|
|
475
|
-
var minutes = config.defaultMinute;
|
|
476
|
-
var seconds = config.defaultSeconds;
|
|
477
|
-
if (config.minDate !== undefined) {
|
|
478
|
-
var minHour = config.minDate.getHours();
|
|
479
|
-
var minMinutes = config.minDate.getMinutes();
|
|
480
|
-
var minSeconds = config.minDate.getSeconds();
|
|
481
|
-
if (hours < minHour) {
|
|
482
|
-
hours = minHour;
|
|
483
|
-
}
|
|
484
|
-
if (hours === minHour && minutes < minMinutes) {
|
|
485
|
-
minutes = minMinutes;
|
|
486
|
-
}
|
|
487
|
-
if (hours === minHour && minutes === minMinutes && seconds < minSeconds)
|
|
488
|
-
seconds = config.minDate.getSeconds();
|
|
489
|
-
}
|
|
490
|
-
if (config.maxDate !== undefined) {
|
|
491
|
-
var maxHr = config.maxDate.getHours();
|
|
492
|
-
var maxMinutes = config.maxDate.getMinutes();
|
|
493
|
-
hours = Math.min(hours, maxHr);
|
|
494
|
-
if (hours === maxHr)
|
|
495
|
-
minutes = Math.min(maxMinutes, minutes);
|
|
496
|
-
if (hours === maxHr && minutes === maxMinutes)
|
|
497
|
-
seconds = config.maxDate.getSeconds();
|
|
498
|
-
}
|
|
499
|
-
return { hours: hours, minutes: minutes, seconds: seconds };
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
if (typeof Object.assign !== "function") {
|
|
503
|
-
Object.assign = function (target) {
|
|
504
|
-
var args = [];
|
|
505
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
506
|
-
args[_i - 1] = arguments[_i];
|
|
507
|
-
}
|
|
508
|
-
if (!target) {
|
|
509
|
-
throw TypeError("Cannot convert undefined or null to object");
|
|
510
|
-
}
|
|
511
|
-
var _loop_1 = function (source) {
|
|
512
|
-
if (source) {
|
|
513
|
-
Object.keys(source).forEach(function (key) { return (target[key] = source[key]); });
|
|
514
|
-
}
|
|
515
|
-
};
|
|
516
|
-
for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {
|
|
517
|
-
var source = args_1[_a];
|
|
518
|
-
_loop_1(source);
|
|
519
|
-
}
|
|
520
|
-
return target;
|
|
521
|
-
};
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
var __assign = (undefined && undefined.__assign) || function () {
|
|
525
|
-
__assign = Object.assign || function(t) {
|
|
526
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
527
|
-
s = arguments[i];
|
|
528
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
529
|
-
t[p] = s[p];
|
|
530
|
-
}
|
|
531
|
-
return t;
|
|
532
|
-
};
|
|
533
|
-
return __assign.apply(this, arguments);
|
|
534
|
-
};
|
|
535
|
-
var __spreadArrays = (undefined && undefined.__spreadArrays) || function () {
|
|
536
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
537
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
538
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
539
|
-
r[k] = a[j];
|
|
540
|
-
return r;
|
|
541
|
-
};
|
|
542
|
-
var DEBOUNCED_CHANGE_MS = 300;
|
|
543
|
-
function FlatpickrInstance(element, instanceConfig) {
|
|
544
|
-
var self = {
|
|
545
|
-
config: __assign(__assign({}, defaults), flatpickr.defaultConfig),
|
|
546
|
-
l10n: english,
|
|
547
|
-
};
|
|
548
|
-
self.parseDate = createDateParser({ config: self.config, l10n: self.l10n });
|
|
549
|
-
self._handlers = [];
|
|
550
|
-
self.pluginElements = [];
|
|
551
|
-
self.loadedPlugins = [];
|
|
552
|
-
self._bind = bind;
|
|
553
|
-
self._setHoursFromDate = setHoursFromDate;
|
|
554
|
-
self._positionCalendar = positionCalendar;
|
|
555
|
-
self.changeMonth = changeMonth;
|
|
556
|
-
self.changeYear = changeYear;
|
|
557
|
-
self.clear = clear;
|
|
558
|
-
self.close = close;
|
|
559
|
-
self.onMouseOver = onMouseOver;
|
|
560
|
-
self._createElement = createElement;
|
|
561
|
-
self.createDay = createDay;
|
|
562
|
-
self.destroy = destroy;
|
|
563
|
-
self.isEnabled = isEnabled;
|
|
564
|
-
self.jumpToDate = jumpToDate;
|
|
565
|
-
self.updateValue = updateValue;
|
|
566
|
-
self.open = open;
|
|
567
|
-
self.redraw = redraw;
|
|
568
|
-
self.set = set;
|
|
569
|
-
self.setDate = setDate;
|
|
570
|
-
self.toggle = toggle;
|
|
571
|
-
function setupHelperFunctions() {
|
|
572
|
-
self.utils = {
|
|
573
|
-
getDaysInMonth: function (month, yr) {
|
|
574
|
-
if (month === void 0) { month = self.currentMonth; }
|
|
575
|
-
if (yr === void 0) { yr = self.currentYear; }
|
|
576
|
-
if (month === 1 && ((yr % 4 === 0 && yr % 100 !== 0) || yr % 400 === 0))
|
|
577
|
-
return 29;
|
|
578
|
-
return self.l10n.daysInMonth[month];
|
|
579
|
-
},
|
|
580
|
-
};
|
|
581
|
-
}
|
|
582
|
-
function init() {
|
|
583
|
-
self.element = self.input = element;
|
|
584
|
-
self.isOpen = false;
|
|
585
|
-
parseConfig();
|
|
586
|
-
setupLocale();
|
|
587
|
-
setupInputs();
|
|
588
|
-
setupDates();
|
|
589
|
-
setupHelperFunctions();
|
|
590
|
-
if (!self.isMobile)
|
|
591
|
-
build();
|
|
592
|
-
bindEvents();
|
|
593
|
-
if (self.selectedDates.length || self.config.noCalendar) {
|
|
594
|
-
if (self.config.enableTime) {
|
|
595
|
-
setHoursFromDate(self.config.noCalendar ? self.latestSelectedDateObj : undefined);
|
|
596
|
-
}
|
|
597
|
-
updateValue(false);
|
|
598
|
-
}
|
|
599
|
-
setCalendarWidth();
|
|
600
|
-
var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
601
|
-
if (!self.isMobile && isSafari) {
|
|
602
|
-
positionCalendar();
|
|
603
|
-
}
|
|
604
|
-
triggerEvent("onReady");
|
|
605
|
-
}
|
|
606
|
-
function getClosestActiveElement() {
|
|
607
|
-
var _a;
|
|
608
|
-
return (((_a = self.calendarContainer) === null || _a === void 0 ? void 0 : _a.getRootNode())
|
|
609
|
-
.activeElement || document.activeElement);
|
|
610
|
-
}
|
|
611
|
-
function bindToInstance(fn) {
|
|
612
|
-
return fn.bind(self);
|
|
613
|
-
}
|
|
614
|
-
function setCalendarWidth() {
|
|
615
|
-
var config = self.config;
|
|
616
|
-
if (config.weekNumbers === false && config.showMonths === 1) {
|
|
617
|
-
return;
|
|
618
|
-
}
|
|
619
|
-
else if (config.noCalendar !== true) {
|
|
620
|
-
window.requestAnimationFrame(function () {
|
|
621
|
-
if (self.calendarContainer !== undefined) {
|
|
622
|
-
self.calendarContainer.style.visibility = "hidden";
|
|
623
|
-
self.calendarContainer.style.display = "block";
|
|
624
|
-
}
|
|
625
|
-
if (self.daysContainer !== undefined) {
|
|
626
|
-
var daysWidth = (self.days.offsetWidth + 1) * config.showMonths;
|
|
627
|
-
self.daysContainer.style.width = daysWidth + "px";
|
|
628
|
-
self.calendarContainer.style.width =
|
|
629
|
-
daysWidth +
|
|
630
|
-
(self.weekWrapper !== undefined
|
|
631
|
-
? self.weekWrapper.offsetWidth
|
|
632
|
-
: 0) +
|
|
633
|
-
"px";
|
|
634
|
-
self.calendarContainer.style.removeProperty("visibility");
|
|
635
|
-
self.calendarContainer.style.removeProperty("display");
|
|
636
|
-
}
|
|
637
|
-
});
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
function updateTime(e) {
|
|
641
|
-
if (self.selectedDates.length === 0) {
|
|
642
|
-
var defaultDate = self.config.minDate === undefined ||
|
|
643
|
-
compareDates(new Date(), self.config.minDate) >= 0
|
|
644
|
-
? new Date()
|
|
645
|
-
: new Date(self.config.minDate.getTime());
|
|
646
|
-
var defaults = getDefaultHours(self.config);
|
|
647
|
-
defaultDate.setHours(defaults.hours, defaults.minutes, defaults.seconds, defaultDate.getMilliseconds());
|
|
648
|
-
self.selectedDates = [defaultDate];
|
|
649
|
-
self.latestSelectedDateObj = defaultDate;
|
|
650
|
-
}
|
|
651
|
-
if (e !== undefined && e.type !== "blur") {
|
|
652
|
-
timeWrapper(e);
|
|
653
|
-
}
|
|
654
|
-
var prevValue = self._input.value;
|
|
655
|
-
setHoursFromInputs();
|
|
656
|
-
updateValue();
|
|
657
|
-
if (self._input.value !== prevValue) {
|
|
658
|
-
self._debouncedChange();
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
function ampm2military(hour, amPM) {
|
|
662
|
-
return (hour % 12) + 12 * int(amPM === self.l10n.amPM[1]);
|
|
663
|
-
}
|
|
664
|
-
function military2ampm(hour) {
|
|
665
|
-
switch (hour % 24) {
|
|
666
|
-
case 0:
|
|
667
|
-
case 12:
|
|
668
|
-
return 12;
|
|
669
|
-
default:
|
|
670
|
-
return hour % 12;
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
function setHoursFromInputs() {
|
|
674
|
-
if (self.hourElement === undefined || self.minuteElement === undefined)
|
|
675
|
-
return;
|
|
676
|
-
var hours = (parseInt(self.hourElement.value.slice(-2), 10) || 0) % 24, minutes = (parseInt(self.minuteElement.value, 10) || 0) % 60, seconds = self.secondElement !== undefined
|
|
677
|
-
? (parseInt(self.secondElement.value, 10) || 0) % 60
|
|
678
|
-
: 0;
|
|
679
|
-
if (self.amPM !== undefined) {
|
|
680
|
-
hours = ampm2military(hours, self.amPM.textContent);
|
|
681
|
-
}
|
|
682
|
-
var limitMinHours = self.config.minTime !== undefined ||
|
|
683
|
-
(self.config.minDate &&
|
|
684
|
-
self.minDateHasTime &&
|
|
685
|
-
self.latestSelectedDateObj &&
|
|
686
|
-
compareDates(self.latestSelectedDateObj, self.config.minDate, true) ===
|
|
687
|
-
0);
|
|
688
|
-
var limitMaxHours = self.config.maxTime !== undefined ||
|
|
689
|
-
(self.config.maxDate &&
|
|
690
|
-
self.maxDateHasTime &&
|
|
691
|
-
self.latestSelectedDateObj &&
|
|
692
|
-
compareDates(self.latestSelectedDateObj, self.config.maxDate, true) ===
|
|
693
|
-
0);
|
|
694
|
-
if (self.config.maxTime !== undefined &&
|
|
695
|
-
self.config.minTime !== undefined &&
|
|
696
|
-
self.config.minTime > self.config.maxTime) {
|
|
697
|
-
var minBound = calculateSecondsSinceMidnight(self.config.minTime.getHours(), self.config.minTime.getMinutes(), self.config.minTime.getSeconds());
|
|
698
|
-
var maxBound = calculateSecondsSinceMidnight(self.config.maxTime.getHours(), self.config.maxTime.getMinutes(), self.config.maxTime.getSeconds());
|
|
699
|
-
var currentTime = calculateSecondsSinceMidnight(hours, minutes, seconds);
|
|
700
|
-
if (currentTime > maxBound && currentTime < minBound) {
|
|
701
|
-
var result = parseSeconds(minBound);
|
|
702
|
-
hours = result[0];
|
|
703
|
-
minutes = result[1];
|
|
704
|
-
seconds = result[2];
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
else {
|
|
708
|
-
if (limitMaxHours) {
|
|
709
|
-
var maxTime = self.config.maxTime !== undefined
|
|
710
|
-
? self.config.maxTime
|
|
711
|
-
: self.config.maxDate;
|
|
712
|
-
hours = Math.min(hours, maxTime.getHours());
|
|
713
|
-
if (hours === maxTime.getHours())
|
|
714
|
-
minutes = Math.min(minutes, maxTime.getMinutes());
|
|
715
|
-
if (minutes === maxTime.getMinutes())
|
|
716
|
-
seconds = Math.min(seconds, maxTime.getSeconds());
|
|
717
|
-
}
|
|
718
|
-
if (limitMinHours) {
|
|
719
|
-
var minTime = self.config.minTime !== undefined
|
|
720
|
-
? self.config.minTime
|
|
721
|
-
: self.config.minDate;
|
|
722
|
-
hours = Math.max(hours, minTime.getHours());
|
|
723
|
-
if (hours === minTime.getHours() && minutes < minTime.getMinutes())
|
|
724
|
-
minutes = minTime.getMinutes();
|
|
725
|
-
if (minutes === minTime.getMinutes())
|
|
726
|
-
seconds = Math.max(seconds, minTime.getSeconds());
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
setHours(hours, minutes, seconds);
|
|
730
|
-
}
|
|
731
|
-
function setHoursFromDate(dateObj) {
|
|
732
|
-
var date = dateObj || self.latestSelectedDateObj;
|
|
733
|
-
if (date && date instanceof Date) {
|
|
734
|
-
setHours(date.getHours(), date.getMinutes(), date.getSeconds());
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
function setHours(hours, minutes, seconds) {
|
|
738
|
-
if (self.latestSelectedDateObj !== undefined) {
|
|
739
|
-
self.latestSelectedDateObj.setHours(hours % 24, minutes, seconds || 0, 0);
|
|
740
|
-
}
|
|
741
|
-
if (!self.hourElement || !self.minuteElement || self.isMobile)
|
|
742
|
-
return;
|
|
743
|
-
self.hourElement.value = pad(!self.config.time_24hr
|
|
744
|
-
? ((12 + hours) % 12) + 12 * int(hours % 12 === 0)
|
|
745
|
-
: hours);
|
|
746
|
-
self.minuteElement.value = pad(minutes);
|
|
747
|
-
if (self.amPM !== undefined)
|
|
748
|
-
self.amPM.textContent = self.l10n.amPM[int(hours >= 12)];
|
|
749
|
-
if (self.secondElement !== undefined)
|
|
750
|
-
self.secondElement.value = pad(seconds);
|
|
751
|
-
}
|
|
752
|
-
function onYearInput(event) {
|
|
753
|
-
var eventTarget = getEventTarget(event);
|
|
754
|
-
var year = parseInt(eventTarget.value) + (event.delta || 0);
|
|
755
|
-
if (year / 1000 > 1 ||
|
|
756
|
-
(event.key === "Enter" && !/[^\d]/.test(year.toString()))) {
|
|
757
|
-
changeYear(year);
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
function bind(element, event, handler, options) {
|
|
761
|
-
if (event instanceof Array)
|
|
762
|
-
return event.forEach(function (ev) { return bind(element, ev, handler, options); });
|
|
763
|
-
if (element instanceof Array)
|
|
764
|
-
return element.forEach(function (el) { return bind(el, event, handler, options); });
|
|
765
|
-
element.addEventListener(event, handler, options);
|
|
766
|
-
self._handlers.push({
|
|
767
|
-
remove: function () { return element.removeEventListener(event, handler, options); },
|
|
768
|
-
});
|
|
769
|
-
}
|
|
770
|
-
function triggerChange() {
|
|
771
|
-
triggerEvent("onChange");
|
|
772
|
-
}
|
|
773
|
-
function bindEvents() {
|
|
774
|
-
if (self.config.wrap) {
|
|
775
|
-
["open", "close", "toggle", "clear"].forEach(function (evt) {
|
|
776
|
-
Array.prototype.forEach.call(self.element.querySelectorAll("[data-" + evt + "]"), function (el) {
|
|
777
|
-
return bind(el, "click", self[evt]);
|
|
778
|
-
});
|
|
779
|
-
});
|
|
780
|
-
}
|
|
781
|
-
if (self.isMobile) {
|
|
782
|
-
setupMobile();
|
|
783
|
-
return;
|
|
784
|
-
}
|
|
785
|
-
var debouncedResize = debounce(onResize, 50);
|
|
786
|
-
self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS);
|
|
787
|
-
if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent))
|
|
788
|
-
bind(self.daysContainer, "mouseover", function (e) {
|
|
789
|
-
if (self.config.mode === "range")
|
|
790
|
-
onMouseOver(getEventTarget(e));
|
|
791
|
-
});
|
|
792
|
-
bind(self._input, "keydown", onKeyDown);
|
|
793
|
-
if (self.calendarContainer !== undefined) {
|
|
794
|
-
bind(self.calendarContainer, "keydown", onKeyDown);
|
|
795
|
-
}
|
|
796
|
-
if (!self.config.inline && !self.config.static)
|
|
797
|
-
bind(window, "resize", debouncedResize);
|
|
798
|
-
if (window.ontouchstart !== undefined)
|
|
799
|
-
bind(window.document, "touchstart", documentClick);
|
|
800
|
-
else
|
|
801
|
-
bind(window.document, "mousedown", documentClick);
|
|
802
|
-
bind(window.document, "focus", documentClick, { capture: true });
|
|
803
|
-
if (self.config.clickOpens === true) {
|
|
804
|
-
bind(self._input, "focus", self.open);
|
|
805
|
-
bind(self._input, "click", self.open);
|
|
806
|
-
}
|
|
807
|
-
if (self.daysContainer !== undefined) {
|
|
808
|
-
bind(self.monthNav, "click", onMonthNavClick);
|
|
809
|
-
bind(self.monthNav, ["keyup", "increment"], onYearInput);
|
|
810
|
-
bind(self.daysContainer, "click", selectDate);
|
|
811
|
-
}
|
|
812
|
-
if (self.timeContainer !== undefined &&
|
|
813
|
-
self.minuteElement !== undefined &&
|
|
814
|
-
self.hourElement !== undefined) {
|
|
815
|
-
var selText = function (e) {
|
|
816
|
-
return getEventTarget(e).select();
|
|
817
|
-
};
|
|
818
|
-
bind(self.timeContainer, ["increment"], updateTime);
|
|
819
|
-
bind(self.timeContainer, "blur", updateTime, { capture: true });
|
|
820
|
-
bind(self.timeContainer, "click", timeIncrement);
|
|
821
|
-
bind([self.hourElement, self.minuteElement], ["focus", "click"], selText);
|
|
822
|
-
if (self.secondElement !== undefined)
|
|
823
|
-
bind(self.secondElement, "focus", function () { return self.secondElement && self.secondElement.select(); });
|
|
824
|
-
if (self.amPM !== undefined) {
|
|
825
|
-
bind(self.amPM, "click", function (e) {
|
|
826
|
-
updateTime(e);
|
|
827
|
-
});
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
if (self.config.allowInput) {
|
|
831
|
-
bind(self._input, "blur", onBlur);
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
function jumpToDate(jumpDate, triggerChange) {
|
|
835
|
-
var jumpTo = jumpDate !== undefined
|
|
836
|
-
? self.parseDate(jumpDate)
|
|
837
|
-
: self.latestSelectedDateObj ||
|
|
838
|
-
(self.config.minDate && self.config.minDate > self.now
|
|
839
|
-
? self.config.minDate
|
|
840
|
-
: self.config.maxDate && self.config.maxDate < self.now
|
|
841
|
-
? self.config.maxDate
|
|
842
|
-
: self.now);
|
|
843
|
-
var oldYear = self.currentYear;
|
|
844
|
-
var oldMonth = self.currentMonth;
|
|
845
|
-
try {
|
|
846
|
-
if (jumpTo !== undefined) {
|
|
847
|
-
self.currentYear = jumpTo.getFullYear();
|
|
848
|
-
self.currentMonth = jumpTo.getMonth();
|
|
849
|
-
}
|
|
850
|
-
}
|
|
851
|
-
catch (e) {
|
|
852
|
-
e.message = "Invalid date supplied: " + jumpTo;
|
|
853
|
-
self.config.errorHandler(e);
|
|
854
|
-
}
|
|
855
|
-
if (triggerChange && self.currentYear !== oldYear) {
|
|
856
|
-
triggerEvent("onYearChange");
|
|
857
|
-
buildMonthSwitch();
|
|
858
|
-
}
|
|
859
|
-
if (triggerChange &&
|
|
860
|
-
(self.currentYear !== oldYear || self.currentMonth !== oldMonth)) {
|
|
861
|
-
triggerEvent("onMonthChange");
|
|
862
|
-
}
|
|
863
|
-
self.redraw();
|
|
864
|
-
}
|
|
865
|
-
function timeIncrement(e) {
|
|
866
|
-
var eventTarget = getEventTarget(e);
|
|
867
|
-
if (~eventTarget.className.indexOf("arrow"))
|
|
868
|
-
incrementNumInput(e, eventTarget.classList.contains("arrowUp") ? 1 : -1);
|
|
869
|
-
}
|
|
870
|
-
function incrementNumInput(e, delta, inputElem) {
|
|
871
|
-
var target = e && getEventTarget(e);
|
|
872
|
-
var input = inputElem ||
|
|
873
|
-
(target && target.parentNode && target.parentNode.firstChild);
|
|
874
|
-
var event = createEvent("increment");
|
|
875
|
-
event.delta = delta;
|
|
876
|
-
input && input.dispatchEvent(event);
|
|
877
|
-
}
|
|
878
|
-
function build() {
|
|
879
|
-
var fragment = window.document.createDocumentFragment();
|
|
880
|
-
self.calendarContainer = createElement("div", "flatpickr-calendar");
|
|
881
|
-
self.calendarContainer.tabIndex = -1;
|
|
882
|
-
if (!self.config.noCalendar) {
|
|
883
|
-
fragment.appendChild(buildMonthNav());
|
|
884
|
-
self.innerContainer = createElement("div", "flatpickr-innerContainer");
|
|
885
|
-
if (self.config.weekNumbers) {
|
|
886
|
-
var _a = buildWeeks(), weekWrapper = _a.weekWrapper, weekNumbers = _a.weekNumbers;
|
|
887
|
-
self.innerContainer.appendChild(weekWrapper);
|
|
888
|
-
self.weekNumbers = weekNumbers;
|
|
889
|
-
self.weekWrapper = weekWrapper;
|
|
890
|
-
}
|
|
891
|
-
self.rContainer = createElement("div", "flatpickr-rContainer");
|
|
892
|
-
self.rContainer.appendChild(buildWeekdays());
|
|
893
|
-
if (!self.daysContainer) {
|
|
894
|
-
self.daysContainer = createElement("div", "flatpickr-days");
|
|
895
|
-
self.daysContainer.tabIndex = -1;
|
|
896
|
-
}
|
|
897
|
-
buildDays();
|
|
898
|
-
self.rContainer.appendChild(self.daysContainer);
|
|
899
|
-
self.innerContainer.appendChild(self.rContainer);
|
|
900
|
-
fragment.appendChild(self.innerContainer);
|
|
901
|
-
}
|
|
902
|
-
if (self.config.enableTime) {
|
|
903
|
-
fragment.appendChild(buildTime());
|
|
904
|
-
}
|
|
905
|
-
toggleClass(self.calendarContainer, "rangeMode", self.config.mode === "range");
|
|
906
|
-
toggleClass(self.calendarContainer, "animate", self.config.animate === true);
|
|
907
|
-
toggleClass(self.calendarContainer, "multiMonth", self.config.showMonths > 1);
|
|
908
|
-
self.calendarContainer.appendChild(fragment);
|
|
909
|
-
var customAppend = self.config.appendTo !== undefined &&
|
|
910
|
-
self.config.appendTo.nodeType !== undefined;
|
|
911
|
-
if (self.config.inline || self.config.static) {
|
|
912
|
-
self.calendarContainer.classList.add(self.config.inline ? "inline" : "static");
|
|
913
|
-
if (self.config.inline) {
|
|
914
|
-
if (!customAppend && self.element.parentNode)
|
|
915
|
-
self.element.parentNode.insertBefore(self.calendarContainer, self._input.nextSibling);
|
|
916
|
-
else if (self.config.appendTo !== undefined)
|
|
917
|
-
self.config.appendTo.appendChild(self.calendarContainer);
|
|
918
|
-
}
|
|
919
|
-
if (self.config.static) {
|
|
920
|
-
var wrapper = createElement("div", "flatpickr-wrapper");
|
|
921
|
-
if (self.element.parentNode)
|
|
922
|
-
self.element.parentNode.insertBefore(wrapper, self.element);
|
|
923
|
-
wrapper.appendChild(self.element);
|
|
924
|
-
if (self.altInput)
|
|
925
|
-
wrapper.appendChild(self.altInput);
|
|
926
|
-
wrapper.appendChild(self.calendarContainer);
|
|
927
|
-
}
|
|
928
|
-
}
|
|
929
|
-
if (!self.config.static && !self.config.inline)
|
|
930
|
-
(self.config.appendTo !== undefined
|
|
931
|
-
? self.config.appendTo
|
|
932
|
-
: window.document.body).appendChild(self.calendarContainer);
|
|
933
|
-
}
|
|
934
|
-
function createDay(className, date, _dayNumber, i) {
|
|
935
|
-
var dateIsEnabled = isEnabled(date, true), dayElement = createElement("span", className, date.getDate().toString());
|
|
936
|
-
dayElement.dateObj = date;
|
|
937
|
-
dayElement.$i = i;
|
|
938
|
-
dayElement.setAttribute("aria-label", self.formatDate(date, self.config.ariaDateFormat));
|
|
939
|
-
if (className.indexOf("hidden") === -1 &&
|
|
940
|
-
compareDates(date, self.now) === 0) {
|
|
941
|
-
self.todayDateElem = dayElement;
|
|
942
|
-
dayElement.classList.add("today");
|
|
943
|
-
dayElement.setAttribute("aria-current", "date");
|
|
944
|
-
}
|
|
945
|
-
if (dateIsEnabled) {
|
|
946
|
-
dayElement.tabIndex = -1;
|
|
947
|
-
if (isDateSelected(date)) {
|
|
948
|
-
dayElement.classList.add("selected");
|
|
949
|
-
self.selectedDateElem = dayElement;
|
|
950
|
-
if (self.config.mode === "range") {
|
|
951
|
-
toggleClass(dayElement, "startRange", self.selectedDates[0] &&
|
|
952
|
-
compareDates(date, self.selectedDates[0], true) === 0);
|
|
953
|
-
toggleClass(dayElement, "endRange", self.selectedDates[1] &&
|
|
954
|
-
compareDates(date, self.selectedDates[1], true) === 0);
|
|
955
|
-
if (className === "nextMonthDay")
|
|
956
|
-
dayElement.classList.add("inRange");
|
|
957
|
-
}
|
|
958
|
-
}
|
|
959
|
-
}
|
|
960
|
-
else {
|
|
961
|
-
dayElement.classList.add("flatpickr-disabled");
|
|
962
|
-
}
|
|
963
|
-
if (self.config.mode === "range") {
|
|
964
|
-
if (isDateInRange(date) && !isDateSelected(date))
|
|
965
|
-
dayElement.classList.add("inRange");
|
|
966
|
-
}
|
|
967
|
-
if (self.weekNumbers &&
|
|
968
|
-
self.config.showMonths === 1 &&
|
|
969
|
-
className !== "prevMonthDay" &&
|
|
970
|
-
i % 7 === 6) {
|
|
971
|
-
self.weekNumbers.insertAdjacentHTML("beforeend", "<span class='flatpickr-day'>" + self.config.getWeek(date) + "</span>");
|
|
972
|
-
}
|
|
973
|
-
triggerEvent("onDayCreate", dayElement);
|
|
974
|
-
return dayElement;
|
|
975
|
-
}
|
|
976
|
-
function focusOnDayElem(targetNode) {
|
|
977
|
-
targetNode.focus();
|
|
978
|
-
if (self.config.mode === "range")
|
|
979
|
-
onMouseOver(targetNode);
|
|
980
|
-
}
|
|
981
|
-
function getFirstAvailableDay(delta) {
|
|
982
|
-
var startMonth = delta > 0 ? 0 : self.config.showMonths - 1;
|
|
983
|
-
var endMonth = delta > 0 ? self.config.showMonths : -1;
|
|
984
|
-
for (var m = startMonth; m != endMonth; m += delta) {
|
|
985
|
-
var month = self.daysContainer.children[m];
|
|
986
|
-
var startIndex = delta > 0 ? 0 : month.children.length - 1;
|
|
987
|
-
var endIndex = delta > 0 ? month.children.length : -1;
|
|
988
|
-
for (var i = startIndex; i != endIndex; i += delta) {
|
|
989
|
-
var c = month.children[i];
|
|
990
|
-
if (c.className.indexOf("hidden") === -1 && isEnabled(c.dateObj))
|
|
991
|
-
return c;
|
|
992
|
-
}
|
|
993
|
-
}
|
|
994
|
-
return undefined;
|
|
995
|
-
}
|
|
996
|
-
function getNextAvailableDay(current, delta) {
|
|
997
|
-
var givenMonth = current.className.indexOf("Month") === -1
|
|
998
|
-
? current.dateObj.getMonth()
|
|
999
|
-
: self.currentMonth;
|
|
1000
|
-
var endMonth = delta > 0 ? self.config.showMonths : -1;
|
|
1001
|
-
var loopDelta = delta > 0 ? 1 : -1;
|
|
1002
|
-
for (var m = givenMonth - self.currentMonth; m != endMonth; m += loopDelta) {
|
|
1003
|
-
var month = self.daysContainer.children[m];
|
|
1004
|
-
var startIndex = givenMonth - self.currentMonth === m
|
|
1005
|
-
? current.$i + delta
|
|
1006
|
-
: delta < 0
|
|
1007
|
-
? month.children.length - 1
|
|
1008
|
-
: 0;
|
|
1009
|
-
var numMonthDays = month.children.length;
|
|
1010
|
-
for (var i = startIndex; i >= 0 && i < numMonthDays && i != (delta > 0 ? numMonthDays : -1); i += loopDelta) {
|
|
1011
|
-
var c = month.children[i];
|
|
1012
|
-
if (c.className.indexOf("hidden") === -1 &&
|
|
1013
|
-
isEnabled(c.dateObj) &&
|
|
1014
|
-
Math.abs(current.$i - i) >= Math.abs(delta))
|
|
1015
|
-
return focusOnDayElem(c);
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
1018
|
-
self.changeMonth(loopDelta);
|
|
1019
|
-
focusOnDay(getFirstAvailableDay(loopDelta), 0);
|
|
1020
|
-
return undefined;
|
|
1021
|
-
}
|
|
1022
|
-
function focusOnDay(current, offset) {
|
|
1023
|
-
var activeElement = getClosestActiveElement();
|
|
1024
|
-
var dayFocused = isInView(activeElement || document.body);
|
|
1025
|
-
var startElem = current !== undefined
|
|
1026
|
-
? current
|
|
1027
|
-
: dayFocused
|
|
1028
|
-
? activeElement
|
|
1029
|
-
: self.selectedDateElem !== undefined && isInView(self.selectedDateElem)
|
|
1030
|
-
? self.selectedDateElem
|
|
1031
|
-
: self.todayDateElem !== undefined && isInView(self.todayDateElem)
|
|
1032
|
-
? self.todayDateElem
|
|
1033
|
-
: getFirstAvailableDay(offset > 0 ? 1 : -1);
|
|
1034
|
-
if (startElem === undefined) {
|
|
1035
|
-
self._input.focus();
|
|
1036
|
-
}
|
|
1037
|
-
else if (!dayFocused) {
|
|
1038
|
-
focusOnDayElem(startElem);
|
|
1039
|
-
}
|
|
1040
|
-
else {
|
|
1041
|
-
getNextAvailableDay(startElem, offset);
|
|
1042
|
-
}
|
|
1043
|
-
}
|
|
1044
|
-
function buildMonthDays(year, month) {
|
|
1045
|
-
var firstOfMonth = (new Date(year, month, 1).getDay() - self.l10n.firstDayOfWeek + 7) % 7;
|
|
1046
|
-
var prevMonthDays = self.utils.getDaysInMonth((month - 1 + 12) % 12, year);
|
|
1047
|
-
var daysInMonth = self.utils.getDaysInMonth(month, year), days = window.document.createDocumentFragment(), isMultiMonth = self.config.showMonths > 1, prevMonthDayClass = isMultiMonth ? "prevMonthDay hidden" : "prevMonthDay", nextMonthDayClass = isMultiMonth ? "nextMonthDay hidden" : "nextMonthDay";
|
|
1048
|
-
var dayNumber = prevMonthDays + 1 - firstOfMonth, dayIndex = 0;
|
|
1049
|
-
for (; dayNumber <= prevMonthDays; dayNumber++, dayIndex++) {
|
|
1050
|
-
days.appendChild(createDay("flatpickr-day " + prevMonthDayClass, new Date(year, month - 1, dayNumber), dayNumber, dayIndex));
|
|
1051
|
-
}
|
|
1052
|
-
for (dayNumber = 1; dayNumber <= daysInMonth; dayNumber++, dayIndex++) {
|
|
1053
|
-
days.appendChild(createDay("flatpickr-day", new Date(year, month, dayNumber), dayNumber, dayIndex));
|
|
1054
|
-
}
|
|
1055
|
-
for (var dayNum = daysInMonth + 1; dayNum <= 42 - firstOfMonth &&
|
|
1056
|
-
(self.config.showMonths === 1 || dayIndex % 7 !== 0); dayNum++, dayIndex++) {
|
|
1057
|
-
days.appendChild(createDay("flatpickr-day " + nextMonthDayClass, new Date(year, month + 1, dayNum % daysInMonth), dayNum, dayIndex));
|
|
1058
|
-
}
|
|
1059
|
-
var dayContainer = createElement("div", "dayContainer");
|
|
1060
|
-
dayContainer.appendChild(days);
|
|
1061
|
-
return dayContainer;
|
|
1062
|
-
}
|
|
1063
|
-
function buildDays() {
|
|
1064
|
-
if (self.daysContainer === undefined) {
|
|
1065
|
-
return;
|
|
1066
|
-
}
|
|
1067
|
-
clearNode(self.daysContainer);
|
|
1068
|
-
if (self.weekNumbers)
|
|
1069
|
-
clearNode(self.weekNumbers);
|
|
1070
|
-
var frag = document.createDocumentFragment();
|
|
1071
|
-
for (var i = 0; i < self.config.showMonths; i++) {
|
|
1072
|
-
var d = new Date(self.currentYear, self.currentMonth, 1);
|
|
1073
|
-
d.setMonth(self.currentMonth + i);
|
|
1074
|
-
frag.appendChild(buildMonthDays(d.getFullYear(), d.getMonth()));
|
|
1075
|
-
}
|
|
1076
|
-
self.daysContainer.appendChild(frag);
|
|
1077
|
-
self.days = self.daysContainer.firstChild;
|
|
1078
|
-
if (self.config.mode === "range" && self.selectedDates.length === 1) {
|
|
1079
|
-
onMouseOver();
|
|
1080
|
-
}
|
|
1081
|
-
}
|
|
1082
|
-
function buildMonthSwitch() {
|
|
1083
|
-
if (self.config.showMonths > 1 ||
|
|
1084
|
-
self.config.monthSelectorType !== "dropdown")
|
|
1085
|
-
return;
|
|
1086
|
-
var shouldBuildMonth = function (month) {
|
|
1087
|
-
if (self.config.minDate !== undefined &&
|
|
1088
|
-
self.currentYear === self.config.minDate.getFullYear() &&
|
|
1089
|
-
month < self.config.minDate.getMonth()) {
|
|
1090
|
-
return false;
|
|
1091
|
-
}
|
|
1092
|
-
return !(self.config.maxDate !== undefined &&
|
|
1093
|
-
self.currentYear === self.config.maxDate.getFullYear() &&
|
|
1094
|
-
month > self.config.maxDate.getMonth());
|
|
1095
|
-
};
|
|
1096
|
-
self.monthsDropdownContainer.tabIndex = -1;
|
|
1097
|
-
self.monthsDropdownContainer.innerHTML = "";
|
|
1098
|
-
for (var i = 0; i < 12; i++) {
|
|
1099
|
-
if (!shouldBuildMonth(i))
|
|
1100
|
-
continue;
|
|
1101
|
-
var month = createElement("option", "flatpickr-monthDropdown-month");
|
|
1102
|
-
month.value = new Date(self.currentYear, i).getMonth().toString();
|
|
1103
|
-
month.textContent = monthToStr(i, self.config.shorthandCurrentMonth, self.l10n);
|
|
1104
|
-
month.tabIndex = -1;
|
|
1105
|
-
if (self.currentMonth === i) {
|
|
1106
|
-
month.selected = true;
|
|
1107
|
-
}
|
|
1108
|
-
self.monthsDropdownContainer.appendChild(month);
|
|
1109
|
-
}
|
|
1110
|
-
}
|
|
1111
|
-
function buildMonth() {
|
|
1112
|
-
var container = createElement("div", "flatpickr-month");
|
|
1113
|
-
var monthNavFragment = window.document.createDocumentFragment();
|
|
1114
|
-
var monthElement;
|
|
1115
|
-
if (self.config.showMonths > 1 ||
|
|
1116
|
-
self.config.monthSelectorType === "static") {
|
|
1117
|
-
monthElement = createElement("span", "cur-month");
|
|
1118
|
-
}
|
|
1119
|
-
else {
|
|
1120
|
-
self.monthsDropdownContainer = createElement("select", "flatpickr-monthDropdown-months");
|
|
1121
|
-
self.monthsDropdownContainer.setAttribute("aria-label", self.l10n.monthAriaLabel);
|
|
1122
|
-
bind(self.monthsDropdownContainer, "change", function (e) {
|
|
1123
|
-
var target = getEventTarget(e);
|
|
1124
|
-
var selectedMonth = parseInt(target.value, 10);
|
|
1125
|
-
self.changeMonth(selectedMonth - self.currentMonth);
|
|
1126
|
-
triggerEvent("onMonthChange");
|
|
1127
|
-
});
|
|
1128
|
-
buildMonthSwitch();
|
|
1129
|
-
monthElement = self.monthsDropdownContainer;
|
|
1130
|
-
}
|
|
1131
|
-
var yearInput = createNumberInput("cur-year", { tabindex: "-1" });
|
|
1132
|
-
var yearElement = yearInput.getElementsByTagName("input")[0];
|
|
1133
|
-
yearElement.setAttribute("aria-label", self.l10n.yearAriaLabel);
|
|
1134
|
-
if (self.config.minDate) {
|
|
1135
|
-
yearElement.setAttribute("min", self.config.minDate.getFullYear().toString());
|
|
1136
|
-
}
|
|
1137
|
-
if (self.config.maxDate) {
|
|
1138
|
-
yearElement.setAttribute("max", self.config.maxDate.getFullYear().toString());
|
|
1139
|
-
yearElement.disabled =
|
|
1140
|
-
!!self.config.minDate &&
|
|
1141
|
-
self.config.minDate.getFullYear() === self.config.maxDate.getFullYear();
|
|
1142
|
-
}
|
|
1143
|
-
var currentMonth = createElement("div", "flatpickr-current-month");
|
|
1144
|
-
currentMonth.appendChild(monthElement);
|
|
1145
|
-
currentMonth.appendChild(yearInput);
|
|
1146
|
-
monthNavFragment.appendChild(currentMonth);
|
|
1147
|
-
container.appendChild(monthNavFragment);
|
|
1148
|
-
return {
|
|
1149
|
-
container: container,
|
|
1150
|
-
yearElement: yearElement,
|
|
1151
|
-
monthElement: monthElement,
|
|
1152
|
-
};
|
|
1153
|
-
}
|
|
1154
|
-
function buildMonths() {
|
|
1155
|
-
clearNode(self.monthNav);
|
|
1156
|
-
self.monthNav.appendChild(self.prevMonthNav);
|
|
1157
|
-
if (self.config.showMonths) {
|
|
1158
|
-
self.yearElements = [];
|
|
1159
|
-
self.monthElements = [];
|
|
1160
|
-
}
|
|
1161
|
-
for (var m = self.config.showMonths; m--;) {
|
|
1162
|
-
var month = buildMonth();
|
|
1163
|
-
self.yearElements.push(month.yearElement);
|
|
1164
|
-
self.monthElements.push(month.monthElement);
|
|
1165
|
-
self.monthNav.appendChild(month.container);
|
|
1166
|
-
}
|
|
1167
|
-
self.monthNav.appendChild(self.nextMonthNav);
|
|
1168
|
-
}
|
|
1169
|
-
function buildMonthNav() {
|
|
1170
|
-
self.monthNav = createElement("div", "flatpickr-months");
|
|
1171
|
-
self.yearElements = [];
|
|
1172
|
-
self.monthElements = [];
|
|
1173
|
-
self.prevMonthNav = createElement("span", "flatpickr-prev-month");
|
|
1174
|
-
self.prevMonthNav.innerHTML = self.config.prevArrow;
|
|
1175
|
-
self.nextMonthNav = createElement("span", "flatpickr-next-month");
|
|
1176
|
-
self.nextMonthNav.innerHTML = self.config.nextArrow;
|
|
1177
|
-
buildMonths();
|
|
1178
|
-
Object.defineProperty(self, "_hidePrevMonthArrow", {
|
|
1179
|
-
get: function () { return self.__hidePrevMonthArrow; },
|
|
1180
|
-
set: function (bool) {
|
|
1181
|
-
if (self.__hidePrevMonthArrow !== bool) {
|
|
1182
|
-
toggleClass(self.prevMonthNav, "flatpickr-disabled", bool);
|
|
1183
|
-
self.__hidePrevMonthArrow = bool;
|
|
1184
|
-
}
|
|
1185
|
-
},
|
|
1186
|
-
});
|
|
1187
|
-
Object.defineProperty(self, "_hideNextMonthArrow", {
|
|
1188
|
-
get: function () { return self.__hideNextMonthArrow; },
|
|
1189
|
-
set: function (bool) {
|
|
1190
|
-
if (self.__hideNextMonthArrow !== bool) {
|
|
1191
|
-
toggleClass(self.nextMonthNav, "flatpickr-disabled", bool);
|
|
1192
|
-
self.__hideNextMonthArrow = bool;
|
|
1193
|
-
}
|
|
1194
|
-
},
|
|
1195
|
-
});
|
|
1196
|
-
self.currentYearElement = self.yearElements[0];
|
|
1197
|
-
updateNavigationCurrentMonth();
|
|
1198
|
-
return self.monthNav;
|
|
1199
|
-
}
|
|
1200
|
-
function buildTime() {
|
|
1201
|
-
self.calendarContainer.classList.add("hasTime");
|
|
1202
|
-
if (self.config.noCalendar)
|
|
1203
|
-
self.calendarContainer.classList.add("noCalendar");
|
|
1204
|
-
var defaults = getDefaultHours(self.config);
|
|
1205
|
-
self.timeContainer = createElement("div", "flatpickr-time");
|
|
1206
|
-
self.timeContainer.tabIndex = -1;
|
|
1207
|
-
var separator = createElement("span", "flatpickr-time-separator", ":");
|
|
1208
|
-
var hourInput = createNumberInput("flatpickr-hour", {
|
|
1209
|
-
"aria-label": self.l10n.hourAriaLabel,
|
|
1210
|
-
});
|
|
1211
|
-
self.hourElement = hourInput.getElementsByTagName("input")[0];
|
|
1212
|
-
var minuteInput = createNumberInput("flatpickr-minute", {
|
|
1213
|
-
"aria-label": self.l10n.minuteAriaLabel,
|
|
1214
|
-
});
|
|
1215
|
-
self.minuteElement = minuteInput.getElementsByTagName("input")[0];
|
|
1216
|
-
self.hourElement.tabIndex = self.minuteElement.tabIndex = -1;
|
|
1217
|
-
self.hourElement.value = pad(self.latestSelectedDateObj
|
|
1218
|
-
? self.latestSelectedDateObj.getHours()
|
|
1219
|
-
: self.config.time_24hr
|
|
1220
|
-
? defaults.hours
|
|
1221
|
-
: military2ampm(defaults.hours));
|
|
1222
|
-
self.minuteElement.value = pad(self.latestSelectedDateObj
|
|
1223
|
-
? self.latestSelectedDateObj.getMinutes()
|
|
1224
|
-
: defaults.minutes);
|
|
1225
|
-
self.hourElement.setAttribute("step", self.config.hourIncrement.toString());
|
|
1226
|
-
self.minuteElement.setAttribute("step", self.config.minuteIncrement.toString());
|
|
1227
|
-
self.hourElement.setAttribute("min", self.config.time_24hr ? "0" : "1");
|
|
1228
|
-
self.hourElement.setAttribute("max", self.config.time_24hr ? "23" : "12");
|
|
1229
|
-
self.hourElement.setAttribute("maxlength", "2");
|
|
1230
|
-
self.minuteElement.setAttribute("min", "0");
|
|
1231
|
-
self.minuteElement.setAttribute("max", "59");
|
|
1232
|
-
self.minuteElement.setAttribute("maxlength", "2");
|
|
1233
|
-
self.timeContainer.appendChild(hourInput);
|
|
1234
|
-
self.timeContainer.appendChild(separator);
|
|
1235
|
-
self.timeContainer.appendChild(minuteInput);
|
|
1236
|
-
if (self.config.time_24hr)
|
|
1237
|
-
self.timeContainer.classList.add("time24hr");
|
|
1238
|
-
if (self.config.enableSeconds) {
|
|
1239
|
-
self.timeContainer.classList.add("hasSeconds");
|
|
1240
|
-
var secondInput = createNumberInput("flatpickr-second");
|
|
1241
|
-
self.secondElement = secondInput.getElementsByTagName("input")[0];
|
|
1242
|
-
self.secondElement.value = pad(self.latestSelectedDateObj
|
|
1243
|
-
? self.latestSelectedDateObj.getSeconds()
|
|
1244
|
-
: defaults.seconds);
|
|
1245
|
-
self.secondElement.setAttribute("step", self.minuteElement.getAttribute("step"));
|
|
1246
|
-
self.secondElement.setAttribute("min", "0");
|
|
1247
|
-
self.secondElement.setAttribute("max", "59");
|
|
1248
|
-
self.secondElement.setAttribute("maxlength", "2");
|
|
1249
|
-
self.timeContainer.appendChild(createElement("span", "flatpickr-time-separator", ":"));
|
|
1250
|
-
self.timeContainer.appendChild(secondInput);
|
|
1251
|
-
}
|
|
1252
|
-
if (!self.config.time_24hr) {
|
|
1253
|
-
self.amPM = createElement("span", "flatpickr-am-pm", self.l10n.amPM[int((self.latestSelectedDateObj
|
|
1254
|
-
? self.hourElement.value
|
|
1255
|
-
: self.config.defaultHour) > 11)]);
|
|
1256
|
-
self.amPM.title = self.l10n.toggleTitle;
|
|
1257
|
-
self.amPM.tabIndex = -1;
|
|
1258
|
-
self.timeContainer.appendChild(self.amPM);
|
|
1259
|
-
}
|
|
1260
|
-
return self.timeContainer;
|
|
1261
|
-
}
|
|
1262
|
-
function buildWeekdays() {
|
|
1263
|
-
if (!self.weekdayContainer)
|
|
1264
|
-
self.weekdayContainer = createElement("div", "flatpickr-weekdays");
|
|
1265
|
-
else
|
|
1266
|
-
clearNode(self.weekdayContainer);
|
|
1267
|
-
for (var i = self.config.showMonths; i--;) {
|
|
1268
|
-
var container = createElement("div", "flatpickr-weekdaycontainer");
|
|
1269
|
-
self.weekdayContainer.appendChild(container);
|
|
1270
|
-
}
|
|
1271
|
-
updateWeekdays();
|
|
1272
|
-
return self.weekdayContainer;
|
|
1273
|
-
}
|
|
1274
|
-
function updateWeekdays() {
|
|
1275
|
-
if (!self.weekdayContainer) {
|
|
1276
|
-
return;
|
|
1277
|
-
}
|
|
1278
|
-
var firstDayOfWeek = self.l10n.firstDayOfWeek;
|
|
1279
|
-
var weekdays = __spreadArrays(self.l10n.weekdays.shorthand);
|
|
1280
|
-
if (firstDayOfWeek > 0 && firstDayOfWeek < weekdays.length) {
|
|
1281
|
-
weekdays = __spreadArrays(weekdays.splice(firstDayOfWeek, weekdays.length), weekdays.splice(0, firstDayOfWeek));
|
|
1282
|
-
}
|
|
1283
|
-
for (var i = self.config.showMonths; i--;) {
|
|
1284
|
-
self.weekdayContainer.children[i].innerHTML = "\n <span class='flatpickr-weekday'>\n " + weekdays.join("</span><span class='flatpickr-weekday'>") + "\n </span>\n ";
|
|
1285
|
-
}
|
|
1286
|
-
}
|
|
1287
|
-
function buildWeeks() {
|
|
1288
|
-
self.calendarContainer.classList.add("hasWeeks");
|
|
1289
|
-
var weekWrapper = createElement("div", "flatpickr-weekwrapper");
|
|
1290
|
-
weekWrapper.appendChild(createElement("span", "flatpickr-weekday", self.l10n.weekAbbreviation));
|
|
1291
|
-
var weekNumbers = createElement("div", "flatpickr-weeks");
|
|
1292
|
-
weekWrapper.appendChild(weekNumbers);
|
|
1293
|
-
return {
|
|
1294
|
-
weekWrapper: weekWrapper,
|
|
1295
|
-
weekNumbers: weekNumbers,
|
|
1296
|
-
};
|
|
1297
|
-
}
|
|
1298
|
-
function changeMonth(value, isOffset) {
|
|
1299
|
-
if (isOffset === void 0) { isOffset = true; }
|
|
1300
|
-
var delta = isOffset ? value : value - self.currentMonth;
|
|
1301
|
-
if ((delta < 0 && self._hidePrevMonthArrow === true) ||
|
|
1302
|
-
(delta > 0 && self._hideNextMonthArrow === true))
|
|
1303
|
-
return;
|
|
1304
|
-
self.currentMonth += delta;
|
|
1305
|
-
if (self.currentMonth < 0 || self.currentMonth > 11) {
|
|
1306
|
-
self.currentYear += self.currentMonth > 11 ? 1 : -1;
|
|
1307
|
-
self.currentMonth = (self.currentMonth + 12) % 12;
|
|
1308
|
-
triggerEvent("onYearChange");
|
|
1309
|
-
buildMonthSwitch();
|
|
1310
|
-
}
|
|
1311
|
-
buildDays();
|
|
1312
|
-
triggerEvent("onMonthChange");
|
|
1313
|
-
updateNavigationCurrentMonth();
|
|
1314
|
-
}
|
|
1315
|
-
function clear(triggerChangeEvent, toInitial) {
|
|
1316
|
-
if (triggerChangeEvent === void 0) { triggerChangeEvent = true; }
|
|
1317
|
-
if (toInitial === void 0) { toInitial = true; }
|
|
1318
|
-
self.input.value = "";
|
|
1319
|
-
if (self.altInput !== undefined)
|
|
1320
|
-
self.altInput.value = "";
|
|
1321
|
-
if (self.mobileInput !== undefined)
|
|
1322
|
-
self.mobileInput.value = "";
|
|
1323
|
-
self.selectedDates = [];
|
|
1324
|
-
self.latestSelectedDateObj = undefined;
|
|
1325
|
-
if (toInitial === true) {
|
|
1326
|
-
self.currentYear = self._initialDate.getFullYear();
|
|
1327
|
-
self.currentMonth = self._initialDate.getMonth();
|
|
1328
|
-
}
|
|
1329
|
-
if (self.config.enableTime === true) {
|
|
1330
|
-
var _a = getDefaultHours(self.config), hours = _a.hours, minutes = _a.minutes, seconds = _a.seconds;
|
|
1331
|
-
setHours(hours, minutes, seconds);
|
|
1332
|
-
}
|
|
1333
|
-
self.redraw();
|
|
1334
|
-
if (triggerChangeEvent)
|
|
1335
|
-
triggerEvent("onChange");
|
|
1336
|
-
}
|
|
1337
|
-
function close() {
|
|
1338
|
-
self.isOpen = false;
|
|
1339
|
-
if (!self.isMobile) {
|
|
1340
|
-
if (self.calendarContainer !== undefined) {
|
|
1341
|
-
self.calendarContainer.classList.remove("open");
|
|
1342
|
-
}
|
|
1343
|
-
if (self._input !== undefined) {
|
|
1344
|
-
self._input.classList.remove("active");
|
|
1345
|
-
}
|
|
1346
|
-
}
|
|
1347
|
-
triggerEvent("onClose");
|
|
1348
|
-
}
|
|
1349
|
-
function destroy() {
|
|
1350
|
-
if (self.config !== undefined)
|
|
1351
|
-
triggerEvent("onDestroy");
|
|
1352
|
-
for (var i = self._handlers.length; i--;) {
|
|
1353
|
-
self._handlers[i].remove();
|
|
1354
|
-
}
|
|
1355
|
-
self._handlers = [];
|
|
1356
|
-
if (self.mobileInput) {
|
|
1357
|
-
if (self.mobileInput.parentNode)
|
|
1358
|
-
self.mobileInput.parentNode.removeChild(self.mobileInput);
|
|
1359
|
-
self.mobileInput = undefined;
|
|
1360
|
-
}
|
|
1361
|
-
else if (self.calendarContainer && self.calendarContainer.parentNode) {
|
|
1362
|
-
if (self.config.static && self.calendarContainer.parentNode) {
|
|
1363
|
-
var wrapper = self.calendarContainer.parentNode;
|
|
1364
|
-
wrapper.lastChild && wrapper.removeChild(wrapper.lastChild);
|
|
1365
|
-
if (wrapper.parentNode) {
|
|
1366
|
-
while (wrapper.firstChild)
|
|
1367
|
-
wrapper.parentNode.insertBefore(wrapper.firstChild, wrapper);
|
|
1368
|
-
wrapper.parentNode.removeChild(wrapper);
|
|
1369
|
-
}
|
|
1370
|
-
}
|
|
1371
|
-
else
|
|
1372
|
-
self.calendarContainer.parentNode.removeChild(self.calendarContainer);
|
|
1373
|
-
}
|
|
1374
|
-
if (self.altInput) {
|
|
1375
|
-
self.input.type = "text";
|
|
1376
|
-
if (self.altInput.parentNode)
|
|
1377
|
-
self.altInput.parentNode.removeChild(self.altInput);
|
|
1378
|
-
delete self.altInput;
|
|
1379
|
-
}
|
|
1380
|
-
if (self.input) {
|
|
1381
|
-
self.input.type = self.input._type;
|
|
1382
|
-
self.input.classList.remove("flatpickr-input");
|
|
1383
|
-
self.input.removeAttribute("readonly");
|
|
1384
|
-
}
|
|
1385
|
-
[
|
|
1386
|
-
"_showTimeInput",
|
|
1387
|
-
"latestSelectedDateObj",
|
|
1388
|
-
"_hideNextMonthArrow",
|
|
1389
|
-
"_hidePrevMonthArrow",
|
|
1390
|
-
"__hideNextMonthArrow",
|
|
1391
|
-
"__hidePrevMonthArrow",
|
|
1392
|
-
"isMobile",
|
|
1393
|
-
"isOpen",
|
|
1394
|
-
"selectedDateElem",
|
|
1395
|
-
"minDateHasTime",
|
|
1396
|
-
"maxDateHasTime",
|
|
1397
|
-
"days",
|
|
1398
|
-
"daysContainer",
|
|
1399
|
-
"_input",
|
|
1400
|
-
"_positionElement",
|
|
1401
|
-
"innerContainer",
|
|
1402
|
-
"rContainer",
|
|
1403
|
-
"monthNav",
|
|
1404
|
-
"todayDateElem",
|
|
1405
|
-
"calendarContainer",
|
|
1406
|
-
"weekdayContainer",
|
|
1407
|
-
"prevMonthNav",
|
|
1408
|
-
"nextMonthNav",
|
|
1409
|
-
"monthsDropdownContainer",
|
|
1410
|
-
"currentMonthElement",
|
|
1411
|
-
"currentYearElement",
|
|
1412
|
-
"navigationCurrentMonth",
|
|
1413
|
-
"selectedDateElem",
|
|
1414
|
-
"config",
|
|
1415
|
-
].forEach(function (k) {
|
|
1416
|
-
try {
|
|
1417
|
-
delete self[k];
|
|
1418
|
-
}
|
|
1419
|
-
catch (_) { }
|
|
1420
|
-
});
|
|
1421
|
-
}
|
|
1422
|
-
function isCalendarElem(elem) {
|
|
1423
|
-
return self.calendarContainer.contains(elem);
|
|
1424
|
-
}
|
|
1425
|
-
function documentClick(e) {
|
|
1426
|
-
if (self.isOpen && !self.config.inline) {
|
|
1427
|
-
var eventTarget_1 = getEventTarget(e);
|
|
1428
|
-
var isCalendarElement = isCalendarElem(eventTarget_1);
|
|
1429
|
-
var isInput = eventTarget_1 === self.input ||
|
|
1430
|
-
eventTarget_1 === self.altInput ||
|
|
1431
|
-
self.element.contains(eventTarget_1) ||
|
|
1432
|
-
(e.path &&
|
|
1433
|
-
e.path.indexOf &&
|
|
1434
|
-
(~e.path.indexOf(self.input) ||
|
|
1435
|
-
~e.path.indexOf(self.altInput)));
|
|
1436
|
-
var lostFocus = !isInput &&
|
|
1437
|
-
!isCalendarElement &&
|
|
1438
|
-
!isCalendarElem(e.relatedTarget);
|
|
1439
|
-
var isIgnored = !self.config.ignoredFocusElements.some(function (elem) {
|
|
1440
|
-
return elem.contains(eventTarget_1);
|
|
1441
|
-
});
|
|
1442
|
-
if (lostFocus && isIgnored) {
|
|
1443
|
-
if (self.config.allowInput) {
|
|
1444
|
-
self.setDate(self._input.value, false, self.config.altInput
|
|
1445
|
-
? self.config.altFormat
|
|
1446
|
-
: self.config.dateFormat);
|
|
1447
|
-
}
|
|
1448
|
-
if (self.timeContainer !== undefined &&
|
|
1449
|
-
self.minuteElement !== undefined &&
|
|
1450
|
-
self.hourElement !== undefined &&
|
|
1451
|
-
self.input.value !== "" &&
|
|
1452
|
-
self.input.value !== undefined) {
|
|
1453
|
-
updateTime();
|
|
1454
|
-
}
|
|
1455
|
-
self.close();
|
|
1456
|
-
if (self.config &&
|
|
1457
|
-
self.config.mode === "range" &&
|
|
1458
|
-
self.selectedDates.length === 1)
|
|
1459
|
-
self.clear(false);
|
|
1460
|
-
}
|
|
1461
|
-
}
|
|
1462
|
-
}
|
|
1463
|
-
function changeYear(newYear) {
|
|
1464
|
-
if (!newYear ||
|
|
1465
|
-
(self.config.minDate && newYear < self.config.minDate.getFullYear()) ||
|
|
1466
|
-
(self.config.maxDate && newYear > self.config.maxDate.getFullYear()))
|
|
1467
|
-
return;
|
|
1468
|
-
var newYearNum = newYear, isNewYear = self.currentYear !== newYearNum;
|
|
1469
|
-
self.currentYear = newYearNum || self.currentYear;
|
|
1470
|
-
if (self.config.maxDate &&
|
|
1471
|
-
self.currentYear === self.config.maxDate.getFullYear()) {
|
|
1472
|
-
self.currentMonth = Math.min(self.config.maxDate.getMonth(), self.currentMonth);
|
|
1473
|
-
}
|
|
1474
|
-
else if (self.config.minDate &&
|
|
1475
|
-
self.currentYear === self.config.minDate.getFullYear()) {
|
|
1476
|
-
self.currentMonth = Math.max(self.config.minDate.getMonth(), self.currentMonth);
|
|
1477
|
-
}
|
|
1478
|
-
if (isNewYear) {
|
|
1479
|
-
self.redraw();
|
|
1480
|
-
triggerEvent("onYearChange");
|
|
1481
|
-
buildMonthSwitch();
|
|
1482
|
-
}
|
|
1483
|
-
}
|
|
1484
|
-
function isEnabled(date, timeless) {
|
|
1485
|
-
var _a;
|
|
1486
|
-
if (timeless === void 0) { timeless = true; }
|
|
1487
|
-
var dateToCheck = self.parseDate(date, undefined, timeless);
|
|
1488
|
-
if ((self.config.minDate &&
|
|
1489
|
-
dateToCheck &&
|
|
1490
|
-
compareDates(dateToCheck, self.config.minDate, timeless !== undefined ? timeless : !self.minDateHasTime) < 0) ||
|
|
1491
|
-
(self.config.maxDate &&
|
|
1492
|
-
dateToCheck &&
|
|
1493
|
-
compareDates(dateToCheck, self.config.maxDate, timeless !== undefined ? timeless : !self.maxDateHasTime) > 0))
|
|
1494
|
-
return false;
|
|
1495
|
-
if (!self.config.enable && self.config.disable.length === 0)
|
|
1496
|
-
return true;
|
|
1497
|
-
if (dateToCheck === undefined)
|
|
1498
|
-
return false;
|
|
1499
|
-
var bool = !!self.config.enable, array = (_a = self.config.enable) !== null && _a !== void 0 ? _a : self.config.disable;
|
|
1500
|
-
for (var i = 0, d = void 0; i < array.length; i++) {
|
|
1501
|
-
d = array[i];
|
|
1502
|
-
if (typeof d === "function" &&
|
|
1503
|
-
d(dateToCheck))
|
|
1504
|
-
return bool;
|
|
1505
|
-
else if (d instanceof Date &&
|
|
1506
|
-
dateToCheck !== undefined &&
|
|
1507
|
-
d.getTime() === dateToCheck.getTime())
|
|
1508
|
-
return bool;
|
|
1509
|
-
else if (typeof d === "string") {
|
|
1510
|
-
var parsed = self.parseDate(d, undefined, true);
|
|
1511
|
-
return parsed && parsed.getTime() === dateToCheck.getTime()
|
|
1512
|
-
? bool
|
|
1513
|
-
: !bool;
|
|
1514
|
-
}
|
|
1515
|
-
else if (typeof d === "object" &&
|
|
1516
|
-
dateToCheck !== undefined &&
|
|
1517
|
-
d.from &&
|
|
1518
|
-
d.to &&
|
|
1519
|
-
dateToCheck.getTime() >= d.from.getTime() &&
|
|
1520
|
-
dateToCheck.getTime() <= d.to.getTime())
|
|
1521
|
-
return bool;
|
|
1522
|
-
}
|
|
1523
|
-
return !bool;
|
|
1524
|
-
}
|
|
1525
|
-
function isInView(elem) {
|
|
1526
|
-
if (self.daysContainer !== undefined)
|
|
1527
|
-
return (elem.className.indexOf("hidden") === -1 &&
|
|
1528
|
-
elem.className.indexOf("flatpickr-disabled") === -1 &&
|
|
1529
|
-
self.daysContainer.contains(elem));
|
|
1530
|
-
return false;
|
|
1531
|
-
}
|
|
1532
|
-
function onBlur(e) {
|
|
1533
|
-
var isInput = e.target === self._input;
|
|
1534
|
-
var valueChanged = self._input.value.trimEnd() !== getDateStr();
|
|
1535
|
-
if (isInput &&
|
|
1536
|
-
valueChanged &&
|
|
1537
|
-
!(e.relatedTarget && isCalendarElem(e.relatedTarget))) {
|
|
1538
|
-
self.setDate(self._input.value, true, e.target === self.altInput
|
|
1539
|
-
? self.config.altFormat
|
|
1540
|
-
: self.config.dateFormat);
|
|
1541
|
-
}
|
|
1542
|
-
}
|
|
1543
|
-
function onKeyDown(e) {
|
|
1544
|
-
var eventTarget = getEventTarget(e);
|
|
1545
|
-
var isInput = self.config.wrap
|
|
1546
|
-
? element.contains(eventTarget)
|
|
1547
|
-
: eventTarget === self._input;
|
|
1548
|
-
var allowInput = self.config.allowInput;
|
|
1549
|
-
var allowKeydown = self.isOpen && (!allowInput || !isInput);
|
|
1550
|
-
var allowInlineKeydown = self.config.inline && isInput && !allowInput;
|
|
1551
|
-
if (e.keyCode === 13 && isInput) {
|
|
1552
|
-
if (allowInput) {
|
|
1553
|
-
self.setDate(self._input.value, true, eventTarget === self.altInput
|
|
1554
|
-
? self.config.altFormat
|
|
1555
|
-
: self.config.dateFormat);
|
|
1556
|
-
self.close();
|
|
1557
|
-
return eventTarget.blur();
|
|
1558
|
-
}
|
|
1559
|
-
else {
|
|
1560
|
-
self.open();
|
|
1561
|
-
}
|
|
1562
|
-
}
|
|
1563
|
-
else if (isCalendarElem(eventTarget) ||
|
|
1564
|
-
allowKeydown ||
|
|
1565
|
-
allowInlineKeydown) {
|
|
1566
|
-
var isTimeObj = !!self.timeContainer &&
|
|
1567
|
-
self.timeContainer.contains(eventTarget);
|
|
1568
|
-
switch (e.keyCode) {
|
|
1569
|
-
case 13:
|
|
1570
|
-
if (isTimeObj) {
|
|
1571
|
-
e.preventDefault();
|
|
1572
|
-
updateTime();
|
|
1573
|
-
focusAndClose();
|
|
1574
|
-
}
|
|
1575
|
-
else
|
|
1576
|
-
selectDate(e);
|
|
1577
|
-
break;
|
|
1578
|
-
case 27:
|
|
1579
|
-
e.preventDefault();
|
|
1580
|
-
focusAndClose();
|
|
1581
|
-
break;
|
|
1582
|
-
case 8:
|
|
1583
|
-
case 46:
|
|
1584
|
-
if (isInput && !self.config.allowInput) {
|
|
1585
|
-
e.preventDefault();
|
|
1586
|
-
self.clear();
|
|
1587
|
-
}
|
|
1588
|
-
break;
|
|
1589
|
-
case 37:
|
|
1590
|
-
case 39:
|
|
1591
|
-
if (!isTimeObj && !isInput) {
|
|
1592
|
-
e.preventDefault();
|
|
1593
|
-
var activeElement = getClosestActiveElement();
|
|
1594
|
-
if (self.daysContainer !== undefined &&
|
|
1595
|
-
(allowInput === false ||
|
|
1596
|
-
(activeElement && isInView(activeElement)))) {
|
|
1597
|
-
var delta_1 = e.keyCode === 39 ? 1 : -1;
|
|
1598
|
-
if (!e.ctrlKey)
|
|
1599
|
-
focusOnDay(undefined, delta_1);
|
|
1600
|
-
else {
|
|
1601
|
-
e.stopPropagation();
|
|
1602
|
-
changeMonth(delta_1);
|
|
1603
|
-
focusOnDay(getFirstAvailableDay(1), 0);
|
|
1604
|
-
}
|
|
1605
|
-
}
|
|
1606
|
-
}
|
|
1607
|
-
else if (self.hourElement)
|
|
1608
|
-
self.hourElement.focus();
|
|
1609
|
-
break;
|
|
1610
|
-
case 38:
|
|
1611
|
-
case 40:
|
|
1612
|
-
e.preventDefault();
|
|
1613
|
-
var delta = e.keyCode === 40 ? 1 : -1;
|
|
1614
|
-
if ((self.daysContainer &&
|
|
1615
|
-
eventTarget.$i !== undefined) ||
|
|
1616
|
-
eventTarget === self.input ||
|
|
1617
|
-
eventTarget === self.altInput) {
|
|
1618
|
-
if (e.ctrlKey) {
|
|
1619
|
-
e.stopPropagation();
|
|
1620
|
-
changeYear(self.currentYear - delta);
|
|
1621
|
-
focusOnDay(getFirstAvailableDay(1), 0);
|
|
1622
|
-
}
|
|
1623
|
-
else if (!isTimeObj)
|
|
1624
|
-
focusOnDay(undefined, delta * 7);
|
|
1625
|
-
}
|
|
1626
|
-
else if (eventTarget === self.currentYearElement) {
|
|
1627
|
-
changeYear(self.currentYear - delta);
|
|
1628
|
-
}
|
|
1629
|
-
else if (self.config.enableTime) {
|
|
1630
|
-
if (!isTimeObj && self.hourElement)
|
|
1631
|
-
self.hourElement.focus();
|
|
1632
|
-
updateTime(e);
|
|
1633
|
-
self._debouncedChange();
|
|
1634
|
-
}
|
|
1635
|
-
break;
|
|
1636
|
-
case 9:
|
|
1637
|
-
if (isTimeObj) {
|
|
1638
|
-
var elems = [
|
|
1639
|
-
self.hourElement,
|
|
1640
|
-
self.minuteElement,
|
|
1641
|
-
self.secondElement,
|
|
1642
|
-
self.amPM,
|
|
1643
|
-
]
|
|
1644
|
-
.concat(self.pluginElements)
|
|
1645
|
-
.filter(function (x) { return x; });
|
|
1646
|
-
var i = elems.indexOf(eventTarget);
|
|
1647
|
-
if (i !== -1) {
|
|
1648
|
-
var target = elems[i + (e.shiftKey ? -1 : 1)];
|
|
1649
|
-
e.preventDefault();
|
|
1650
|
-
(target || self._input).focus();
|
|
1651
|
-
}
|
|
1652
|
-
}
|
|
1653
|
-
else if (!self.config.noCalendar &&
|
|
1654
|
-
self.daysContainer &&
|
|
1655
|
-
self.daysContainer.contains(eventTarget) &&
|
|
1656
|
-
e.shiftKey) {
|
|
1657
|
-
e.preventDefault();
|
|
1658
|
-
self._input.focus();
|
|
1659
|
-
}
|
|
1660
|
-
break;
|
|
1661
|
-
}
|
|
1662
|
-
}
|
|
1663
|
-
if (self.amPM !== undefined && eventTarget === self.amPM) {
|
|
1664
|
-
switch (e.key) {
|
|
1665
|
-
case self.l10n.amPM[0].charAt(0):
|
|
1666
|
-
case self.l10n.amPM[0].charAt(0).toLowerCase():
|
|
1667
|
-
self.amPM.textContent = self.l10n.amPM[0];
|
|
1668
|
-
setHoursFromInputs();
|
|
1669
|
-
updateValue();
|
|
1670
|
-
break;
|
|
1671
|
-
case self.l10n.amPM[1].charAt(0):
|
|
1672
|
-
case self.l10n.amPM[1].charAt(0).toLowerCase():
|
|
1673
|
-
self.amPM.textContent = self.l10n.amPM[1];
|
|
1674
|
-
setHoursFromInputs();
|
|
1675
|
-
updateValue();
|
|
1676
|
-
break;
|
|
1677
|
-
}
|
|
1678
|
-
}
|
|
1679
|
-
if (isInput || isCalendarElem(eventTarget)) {
|
|
1680
|
-
triggerEvent("onKeyDown", e);
|
|
1681
|
-
}
|
|
1682
|
-
}
|
|
1683
|
-
function onMouseOver(elem, cellClass) {
|
|
1684
|
-
if (cellClass === void 0) { cellClass = "flatpickr-day"; }
|
|
1685
|
-
if (self.selectedDates.length !== 1 ||
|
|
1686
|
-
(elem &&
|
|
1687
|
-
(!elem.classList.contains(cellClass) ||
|
|
1688
|
-
elem.classList.contains("flatpickr-disabled"))))
|
|
1689
|
-
return;
|
|
1690
|
-
var hoverDate = elem
|
|
1691
|
-
? elem.dateObj.getTime()
|
|
1692
|
-
: self.days.firstElementChild.dateObj.getTime(), initialDate = self.parseDate(self.selectedDates[0], undefined, true).getTime(), rangeStartDate = Math.min(hoverDate, self.selectedDates[0].getTime()), rangeEndDate = Math.max(hoverDate, self.selectedDates[0].getTime());
|
|
1693
|
-
var containsDisabled = false;
|
|
1694
|
-
var minRange = 0, maxRange = 0;
|
|
1695
|
-
for (var t = rangeStartDate; t < rangeEndDate; t += duration.DAY) {
|
|
1696
|
-
if (!isEnabled(new Date(t), true)) {
|
|
1697
|
-
containsDisabled =
|
|
1698
|
-
containsDisabled || (t > rangeStartDate && t < rangeEndDate);
|
|
1699
|
-
if (t < initialDate && (!minRange || t > minRange))
|
|
1700
|
-
minRange = t;
|
|
1701
|
-
else if (t > initialDate && (!maxRange || t < maxRange))
|
|
1702
|
-
maxRange = t;
|
|
1703
|
-
}
|
|
1704
|
-
}
|
|
1705
|
-
var hoverableCells = Array.from(self.rContainer.querySelectorAll("*:nth-child(-n+" + self.config.showMonths + ") > ." + cellClass));
|
|
1706
|
-
hoverableCells.forEach(function (dayElem) {
|
|
1707
|
-
var date = dayElem.dateObj;
|
|
1708
|
-
var timestamp = date.getTime();
|
|
1709
|
-
var outOfRange = (minRange > 0 && timestamp < minRange) ||
|
|
1710
|
-
(maxRange > 0 && timestamp > maxRange);
|
|
1711
|
-
if (outOfRange) {
|
|
1712
|
-
dayElem.classList.add("notAllowed");
|
|
1713
|
-
["inRange", "startRange", "endRange"].forEach(function (c) {
|
|
1714
|
-
dayElem.classList.remove(c);
|
|
1715
|
-
});
|
|
1716
|
-
return;
|
|
1717
|
-
}
|
|
1718
|
-
else if (containsDisabled && !outOfRange)
|
|
1719
|
-
return;
|
|
1720
|
-
["startRange", "inRange", "endRange", "notAllowed"].forEach(function (c) {
|
|
1721
|
-
dayElem.classList.remove(c);
|
|
1722
|
-
});
|
|
1723
|
-
if (elem !== undefined) {
|
|
1724
|
-
elem.classList.add(hoverDate <= self.selectedDates[0].getTime()
|
|
1725
|
-
? "startRange"
|
|
1726
|
-
: "endRange");
|
|
1727
|
-
if (initialDate < hoverDate && timestamp === initialDate)
|
|
1728
|
-
dayElem.classList.add("startRange");
|
|
1729
|
-
else if (initialDate > hoverDate && timestamp === initialDate)
|
|
1730
|
-
dayElem.classList.add("endRange");
|
|
1731
|
-
if (timestamp >= minRange &&
|
|
1732
|
-
(maxRange === 0 || timestamp <= maxRange) &&
|
|
1733
|
-
isBetween(timestamp, initialDate, hoverDate))
|
|
1734
|
-
dayElem.classList.add("inRange");
|
|
1735
|
-
}
|
|
1736
|
-
});
|
|
1737
|
-
}
|
|
1738
|
-
function onResize() {
|
|
1739
|
-
if (self.isOpen && !self.config.static && !self.config.inline)
|
|
1740
|
-
positionCalendar();
|
|
1741
|
-
}
|
|
1742
|
-
function open(e, positionElement) {
|
|
1743
|
-
if (positionElement === void 0) { positionElement = self._positionElement; }
|
|
1744
|
-
if (self.isMobile === true) {
|
|
1745
|
-
if (e) {
|
|
1746
|
-
e.preventDefault();
|
|
1747
|
-
var eventTarget = getEventTarget(e);
|
|
1748
|
-
if (eventTarget) {
|
|
1749
|
-
eventTarget.blur();
|
|
1750
|
-
}
|
|
1751
|
-
}
|
|
1752
|
-
if (self.mobileInput !== undefined) {
|
|
1753
|
-
self.mobileInput.focus();
|
|
1754
|
-
self.mobileInput.click();
|
|
1755
|
-
}
|
|
1756
|
-
triggerEvent("onOpen");
|
|
1757
|
-
return;
|
|
1758
|
-
}
|
|
1759
|
-
else if (self._input.disabled || self.config.inline) {
|
|
1760
|
-
return;
|
|
1761
|
-
}
|
|
1762
|
-
var wasOpen = self.isOpen;
|
|
1763
|
-
self.isOpen = true;
|
|
1764
|
-
if (!wasOpen) {
|
|
1765
|
-
self.calendarContainer.classList.add("open");
|
|
1766
|
-
self._input.classList.add("active");
|
|
1767
|
-
triggerEvent("onOpen");
|
|
1768
|
-
positionCalendar(positionElement);
|
|
1769
|
-
}
|
|
1770
|
-
if (self.config.enableTime === true && self.config.noCalendar === true) {
|
|
1771
|
-
if (self.config.allowInput === false &&
|
|
1772
|
-
(e === undefined ||
|
|
1773
|
-
!self.timeContainer.contains(e.relatedTarget))) {
|
|
1774
|
-
setTimeout(function () { return self.hourElement.select(); }, 50);
|
|
1775
|
-
}
|
|
1776
|
-
}
|
|
1777
|
-
}
|
|
1778
|
-
function minMaxDateSetter(type) {
|
|
1779
|
-
return function (date) {
|
|
1780
|
-
var dateObj = (self.config["_" + type + "Date"] = self.parseDate(date, self.config.dateFormat));
|
|
1781
|
-
var inverseDateObj = self.config["_" + (type === "min" ? "max" : "min") + "Date"];
|
|
1782
|
-
if (dateObj !== undefined) {
|
|
1783
|
-
self[type === "min" ? "minDateHasTime" : "maxDateHasTime"] =
|
|
1784
|
-
dateObj.getHours() > 0 ||
|
|
1785
|
-
dateObj.getMinutes() > 0 ||
|
|
1786
|
-
dateObj.getSeconds() > 0;
|
|
1787
|
-
}
|
|
1788
|
-
if (self.selectedDates) {
|
|
1789
|
-
self.selectedDates = self.selectedDates.filter(function (d) { return isEnabled(d); });
|
|
1790
|
-
if (!self.selectedDates.length && type === "min")
|
|
1791
|
-
setHoursFromDate(dateObj);
|
|
1792
|
-
updateValue();
|
|
1793
|
-
}
|
|
1794
|
-
if (self.daysContainer) {
|
|
1795
|
-
redraw();
|
|
1796
|
-
if (dateObj !== undefined)
|
|
1797
|
-
self.currentYearElement[type] = dateObj.getFullYear().toString();
|
|
1798
|
-
else
|
|
1799
|
-
self.currentYearElement.removeAttribute(type);
|
|
1800
|
-
self.currentYearElement.disabled =
|
|
1801
|
-
!!inverseDateObj &&
|
|
1802
|
-
dateObj !== undefined &&
|
|
1803
|
-
inverseDateObj.getFullYear() === dateObj.getFullYear();
|
|
1804
|
-
}
|
|
1805
|
-
};
|
|
1806
|
-
}
|
|
1807
|
-
function parseConfig() {
|
|
1808
|
-
var boolOpts = [
|
|
1809
|
-
"wrap",
|
|
1810
|
-
"weekNumbers",
|
|
1811
|
-
"allowInput",
|
|
1812
|
-
"allowInvalidPreload",
|
|
1813
|
-
"clickOpens",
|
|
1814
|
-
"time_24hr",
|
|
1815
|
-
"enableTime",
|
|
1816
|
-
"noCalendar",
|
|
1817
|
-
"altInput",
|
|
1818
|
-
"shorthandCurrentMonth",
|
|
1819
|
-
"inline",
|
|
1820
|
-
"static",
|
|
1821
|
-
"enableSeconds",
|
|
1822
|
-
"disableMobile",
|
|
1823
|
-
];
|
|
1824
|
-
var userConfig = __assign(__assign({}, JSON.parse(JSON.stringify(element.dataset || {}))), instanceConfig);
|
|
1825
|
-
var formats = {};
|
|
1826
|
-
self.config.parseDate = userConfig.parseDate;
|
|
1827
|
-
self.config.formatDate = userConfig.formatDate;
|
|
1828
|
-
Object.defineProperty(self.config, "enable", {
|
|
1829
|
-
get: function () { return self.config._enable; },
|
|
1830
|
-
set: function (dates) {
|
|
1831
|
-
self.config._enable = parseDateRules(dates);
|
|
1832
|
-
},
|
|
1833
|
-
});
|
|
1834
|
-
Object.defineProperty(self.config, "disable", {
|
|
1835
|
-
get: function () { return self.config._disable; },
|
|
1836
|
-
set: function (dates) {
|
|
1837
|
-
self.config._disable = parseDateRules(dates);
|
|
1838
|
-
},
|
|
1839
|
-
});
|
|
1840
|
-
var timeMode = userConfig.mode === "time";
|
|
1841
|
-
if (!userConfig.dateFormat && (userConfig.enableTime || timeMode)) {
|
|
1842
|
-
var defaultDateFormat = flatpickr.defaultConfig.dateFormat || defaults.dateFormat;
|
|
1843
|
-
formats.dateFormat =
|
|
1844
|
-
userConfig.noCalendar || timeMode
|
|
1845
|
-
? "H:i" + (userConfig.enableSeconds ? ":S" : "")
|
|
1846
|
-
: defaultDateFormat + " H:i" + (userConfig.enableSeconds ? ":S" : "");
|
|
1847
|
-
}
|
|
1848
|
-
if (userConfig.altInput &&
|
|
1849
|
-
(userConfig.enableTime || timeMode) &&
|
|
1850
|
-
!userConfig.altFormat) {
|
|
1851
|
-
var defaultAltFormat = flatpickr.defaultConfig.altFormat || defaults.altFormat;
|
|
1852
|
-
formats.altFormat =
|
|
1853
|
-
userConfig.noCalendar || timeMode
|
|
1854
|
-
? "h:i" + (userConfig.enableSeconds ? ":S K" : " K")
|
|
1855
|
-
: defaultAltFormat + (" h:i" + (userConfig.enableSeconds ? ":S" : "") + " K");
|
|
1856
|
-
}
|
|
1857
|
-
Object.defineProperty(self.config, "minDate", {
|
|
1858
|
-
get: function () { return self.config._minDate; },
|
|
1859
|
-
set: minMaxDateSetter("min"),
|
|
1860
|
-
});
|
|
1861
|
-
Object.defineProperty(self.config, "maxDate", {
|
|
1862
|
-
get: function () { return self.config._maxDate; },
|
|
1863
|
-
set: minMaxDateSetter("max"),
|
|
1864
|
-
});
|
|
1865
|
-
var minMaxTimeSetter = function (type) { return function (val) {
|
|
1866
|
-
self.config[type === "min" ? "_minTime" : "_maxTime"] = self.parseDate(val, "H:i:S");
|
|
1867
|
-
}; };
|
|
1868
|
-
Object.defineProperty(self.config, "minTime", {
|
|
1869
|
-
get: function () { return self.config._minTime; },
|
|
1870
|
-
set: minMaxTimeSetter("min"),
|
|
1871
|
-
});
|
|
1872
|
-
Object.defineProperty(self.config, "maxTime", {
|
|
1873
|
-
get: function () { return self.config._maxTime; },
|
|
1874
|
-
set: minMaxTimeSetter("max"),
|
|
1875
|
-
});
|
|
1876
|
-
if (userConfig.mode === "time") {
|
|
1877
|
-
self.config.noCalendar = true;
|
|
1878
|
-
self.config.enableTime = true;
|
|
1879
|
-
}
|
|
1880
|
-
Object.assign(self.config, formats, userConfig);
|
|
1881
|
-
for (var i = 0; i < boolOpts.length; i++)
|
|
1882
|
-
self.config[boolOpts[i]] =
|
|
1883
|
-
self.config[boolOpts[i]] === true ||
|
|
1884
|
-
self.config[boolOpts[i]] === "true";
|
|
1885
|
-
HOOKS.filter(function (hook) { return self.config[hook] !== undefined; }).forEach(function (hook) {
|
|
1886
|
-
self.config[hook] = arrayify(self.config[hook] || []).map(bindToInstance);
|
|
1887
|
-
});
|
|
1888
|
-
self.isMobile =
|
|
1889
|
-
!self.config.disableMobile &&
|
|
1890
|
-
!self.config.inline &&
|
|
1891
|
-
self.config.mode === "single" &&
|
|
1892
|
-
!self.config.disable.length &&
|
|
1893
|
-
!self.config.enable &&
|
|
1894
|
-
!self.config.weekNumbers &&
|
|
1895
|
-
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
1896
|
-
for (var i = 0; i < self.config.plugins.length; i++) {
|
|
1897
|
-
var pluginConf = self.config.plugins[i](self) || {};
|
|
1898
|
-
for (var key in pluginConf) {
|
|
1899
|
-
if (HOOKS.indexOf(key) > -1) {
|
|
1900
|
-
self.config[key] = arrayify(pluginConf[key])
|
|
1901
|
-
.map(bindToInstance)
|
|
1902
|
-
.concat(self.config[key]);
|
|
1903
|
-
}
|
|
1904
|
-
else if (typeof userConfig[key] === "undefined")
|
|
1905
|
-
self.config[key] = pluginConf[key];
|
|
1906
|
-
}
|
|
1907
|
-
}
|
|
1908
|
-
if (!userConfig.altInputClass) {
|
|
1909
|
-
self.config.altInputClass =
|
|
1910
|
-
getInputElem().className + " " + self.config.altInputClass;
|
|
1911
|
-
}
|
|
1912
|
-
triggerEvent("onParseConfig");
|
|
1913
|
-
}
|
|
1914
|
-
function getInputElem() {
|
|
1915
|
-
return self.config.wrap
|
|
1916
|
-
? element.querySelector("[data-input]")
|
|
1917
|
-
: element;
|
|
1918
|
-
}
|
|
1919
|
-
function setupLocale() {
|
|
1920
|
-
if (typeof self.config.locale !== "object" &&
|
|
1921
|
-
typeof flatpickr.l10ns[self.config.locale] === "undefined")
|
|
1922
|
-
self.config.errorHandler(new Error("flatpickr: invalid locale " + self.config.locale));
|
|
1923
|
-
self.l10n = __assign(__assign({}, flatpickr.l10ns.default), (typeof self.config.locale === "object"
|
|
1924
|
-
? self.config.locale
|
|
1925
|
-
: self.config.locale !== "default"
|
|
1926
|
-
? flatpickr.l10ns[self.config.locale]
|
|
1927
|
-
: undefined));
|
|
1928
|
-
tokenRegex.D = "(" + self.l10n.weekdays.shorthand.join("|") + ")";
|
|
1929
|
-
tokenRegex.l = "(" + self.l10n.weekdays.longhand.join("|") + ")";
|
|
1930
|
-
tokenRegex.M = "(" + self.l10n.months.shorthand.join("|") + ")";
|
|
1931
|
-
tokenRegex.F = "(" + self.l10n.months.longhand.join("|") + ")";
|
|
1932
|
-
tokenRegex.K = "(" + self.l10n.amPM[0] + "|" + self.l10n.amPM[1] + "|" + self.l10n.amPM[0].toLowerCase() + "|" + self.l10n.amPM[1].toLowerCase() + ")";
|
|
1933
|
-
var userConfig = __assign(__assign({}, instanceConfig), JSON.parse(JSON.stringify(element.dataset || {})));
|
|
1934
|
-
if (userConfig.time_24hr === undefined &&
|
|
1935
|
-
flatpickr.defaultConfig.time_24hr === undefined) {
|
|
1936
|
-
self.config.time_24hr = self.l10n.time_24hr;
|
|
1937
|
-
}
|
|
1938
|
-
self.formatDate = createDateFormatter(self);
|
|
1939
|
-
self.parseDate = createDateParser({ config: self.config, l10n: self.l10n });
|
|
1940
|
-
}
|
|
1941
|
-
function positionCalendar(customPositionElement) {
|
|
1942
|
-
if (typeof self.config.position === "function") {
|
|
1943
|
-
return void self.config.position(self, customPositionElement);
|
|
1944
|
-
}
|
|
1945
|
-
if (self.calendarContainer === undefined)
|
|
1946
|
-
return;
|
|
1947
|
-
triggerEvent("onPreCalendarPosition");
|
|
1948
|
-
var positionElement = customPositionElement || self._positionElement;
|
|
1949
|
-
var calendarHeight = Array.prototype.reduce.call(self.calendarContainer.children, (function (acc, child) { return acc + child.offsetHeight; }), 0), calendarWidth = self.calendarContainer.offsetWidth, configPos = self.config.position.split(" "), configPosVertical = configPos[0], configPosHorizontal = configPos.length > 1 ? configPos[1] : null, inputBounds = positionElement.getBoundingClientRect(), distanceFromBottom = window.innerHeight - inputBounds.bottom, showOnTop = configPosVertical === "above" ||
|
|
1950
|
-
(configPosVertical !== "below" &&
|
|
1951
|
-
distanceFromBottom < calendarHeight &&
|
|
1952
|
-
inputBounds.top > calendarHeight);
|
|
1953
|
-
var top = window.pageYOffset +
|
|
1954
|
-
inputBounds.top +
|
|
1955
|
-
(!showOnTop ? positionElement.offsetHeight + 2 : -calendarHeight - 2);
|
|
1956
|
-
toggleClass(self.calendarContainer, "arrowTop", !showOnTop);
|
|
1957
|
-
toggleClass(self.calendarContainer, "arrowBottom", showOnTop);
|
|
1958
|
-
if (self.config.inline)
|
|
1959
|
-
return;
|
|
1960
|
-
var left = window.pageXOffset + inputBounds.left;
|
|
1961
|
-
var isCenter = false;
|
|
1962
|
-
var isRight = false;
|
|
1963
|
-
if (configPosHorizontal === "center") {
|
|
1964
|
-
left -= (calendarWidth - inputBounds.width) / 2;
|
|
1965
|
-
isCenter = true;
|
|
1966
|
-
}
|
|
1967
|
-
else if (configPosHorizontal === "right") {
|
|
1968
|
-
left -= calendarWidth - inputBounds.width;
|
|
1969
|
-
isRight = true;
|
|
1970
|
-
}
|
|
1971
|
-
toggleClass(self.calendarContainer, "arrowLeft", !isCenter && !isRight);
|
|
1972
|
-
toggleClass(self.calendarContainer, "arrowCenter", isCenter);
|
|
1973
|
-
toggleClass(self.calendarContainer, "arrowRight", isRight);
|
|
1974
|
-
var right = window.document.body.offsetWidth -
|
|
1975
|
-
(window.pageXOffset + inputBounds.right);
|
|
1976
|
-
var rightMost = left + calendarWidth > window.document.body.offsetWidth;
|
|
1977
|
-
var centerMost = right + calendarWidth > window.document.body.offsetWidth;
|
|
1978
|
-
toggleClass(self.calendarContainer, "rightMost", rightMost);
|
|
1979
|
-
if (self.config.static)
|
|
1980
|
-
return;
|
|
1981
|
-
self.calendarContainer.style.top = top + "px";
|
|
1982
|
-
if (!rightMost) {
|
|
1983
|
-
self.calendarContainer.style.left = left + "px";
|
|
1984
|
-
self.calendarContainer.style.right = "auto";
|
|
1985
|
-
}
|
|
1986
|
-
else if (!centerMost) {
|
|
1987
|
-
self.calendarContainer.style.left = "auto";
|
|
1988
|
-
self.calendarContainer.style.right = right + "px";
|
|
1989
|
-
}
|
|
1990
|
-
else {
|
|
1991
|
-
var doc = getDocumentStyleSheet();
|
|
1992
|
-
if (doc === undefined)
|
|
1993
|
-
return;
|
|
1994
|
-
var bodyWidth = window.document.body.offsetWidth;
|
|
1995
|
-
var centerLeft = Math.max(0, bodyWidth / 2 - calendarWidth / 2);
|
|
1996
|
-
var centerBefore = ".flatpickr-calendar.centerMost:before";
|
|
1997
|
-
var centerAfter = ".flatpickr-calendar.centerMost:after";
|
|
1998
|
-
var centerIndex = doc.cssRules.length;
|
|
1999
|
-
var centerStyle = "{left:" + inputBounds.left + "px;right:auto;}";
|
|
2000
|
-
toggleClass(self.calendarContainer, "rightMost", false);
|
|
2001
|
-
toggleClass(self.calendarContainer, "centerMost", true);
|
|
2002
|
-
doc.insertRule(centerBefore + "," + centerAfter + centerStyle, centerIndex);
|
|
2003
|
-
self.calendarContainer.style.left = centerLeft + "px";
|
|
2004
|
-
self.calendarContainer.style.right = "auto";
|
|
2005
|
-
}
|
|
2006
|
-
}
|
|
2007
|
-
function getDocumentStyleSheet() {
|
|
2008
|
-
var editableSheet = null;
|
|
2009
|
-
for (var i = 0; i < document.styleSheets.length; i++) {
|
|
2010
|
-
var sheet = document.styleSheets[i];
|
|
2011
|
-
if (!sheet.cssRules)
|
|
2012
|
-
continue;
|
|
2013
|
-
editableSheet = sheet;
|
|
2014
|
-
break;
|
|
2015
|
-
}
|
|
2016
|
-
return editableSheet != null ? editableSheet : createStyleSheet();
|
|
2017
|
-
}
|
|
2018
|
-
function createStyleSheet() {
|
|
2019
|
-
var style = document.createElement("style");
|
|
2020
|
-
document.head.appendChild(style);
|
|
2021
|
-
return style.sheet;
|
|
2022
|
-
}
|
|
2023
|
-
function redraw() {
|
|
2024
|
-
if (self.config.noCalendar || self.isMobile)
|
|
2025
|
-
return;
|
|
2026
|
-
buildMonthSwitch();
|
|
2027
|
-
updateNavigationCurrentMonth();
|
|
2028
|
-
buildDays();
|
|
2029
|
-
}
|
|
2030
|
-
function focusAndClose() {
|
|
2031
|
-
self._input.focus();
|
|
2032
|
-
if (window.navigator.userAgent.indexOf("MSIE") !== -1 ||
|
|
2033
|
-
navigator.msMaxTouchPoints !== undefined) {
|
|
2034
|
-
setTimeout(self.close, 0);
|
|
2035
|
-
}
|
|
2036
|
-
else {
|
|
2037
|
-
self.close();
|
|
2038
|
-
}
|
|
2039
|
-
}
|
|
2040
|
-
function selectDate(e) {
|
|
2041
|
-
e.preventDefault();
|
|
2042
|
-
e.stopPropagation();
|
|
2043
|
-
var isSelectable = function (day) {
|
|
2044
|
-
return day.classList &&
|
|
2045
|
-
day.classList.contains("flatpickr-day") &&
|
|
2046
|
-
!day.classList.contains("flatpickr-disabled") &&
|
|
2047
|
-
!day.classList.contains("notAllowed");
|
|
2048
|
-
};
|
|
2049
|
-
var t = findParent(getEventTarget(e), isSelectable);
|
|
2050
|
-
if (t === undefined)
|
|
2051
|
-
return;
|
|
2052
|
-
var target = t;
|
|
2053
|
-
var selectedDate = (self.latestSelectedDateObj = new Date(target.dateObj.getTime()));
|
|
2054
|
-
var shouldChangeMonth = (selectedDate.getMonth() < self.currentMonth ||
|
|
2055
|
-
selectedDate.getMonth() >
|
|
2056
|
-
self.currentMonth + self.config.showMonths - 1) &&
|
|
2057
|
-
self.config.mode !== "range";
|
|
2058
|
-
self.selectedDateElem = target;
|
|
2059
|
-
if (self.config.mode === "single")
|
|
2060
|
-
self.selectedDates = [selectedDate];
|
|
2061
|
-
else if (self.config.mode === "multiple") {
|
|
2062
|
-
var selectedIndex = isDateSelected(selectedDate);
|
|
2063
|
-
if (selectedIndex)
|
|
2064
|
-
self.selectedDates.splice(parseInt(selectedIndex), 1);
|
|
2065
|
-
else
|
|
2066
|
-
self.selectedDates.push(selectedDate);
|
|
2067
|
-
}
|
|
2068
|
-
else if (self.config.mode === "range") {
|
|
2069
|
-
if (self.selectedDates.length === 2) {
|
|
2070
|
-
self.clear(false, false);
|
|
2071
|
-
}
|
|
2072
|
-
self.latestSelectedDateObj = selectedDate;
|
|
2073
|
-
self.selectedDates.push(selectedDate);
|
|
2074
|
-
if (compareDates(selectedDate, self.selectedDates[0], true) !== 0)
|
|
2075
|
-
self.selectedDates.sort(function (a, b) { return a.getTime() - b.getTime(); });
|
|
2076
|
-
}
|
|
2077
|
-
setHoursFromInputs();
|
|
2078
|
-
if (shouldChangeMonth) {
|
|
2079
|
-
var isNewYear = self.currentYear !== selectedDate.getFullYear();
|
|
2080
|
-
self.currentYear = selectedDate.getFullYear();
|
|
2081
|
-
self.currentMonth = selectedDate.getMonth();
|
|
2082
|
-
if (isNewYear) {
|
|
2083
|
-
triggerEvent("onYearChange");
|
|
2084
|
-
buildMonthSwitch();
|
|
2085
|
-
}
|
|
2086
|
-
triggerEvent("onMonthChange");
|
|
2087
|
-
}
|
|
2088
|
-
updateNavigationCurrentMonth();
|
|
2089
|
-
buildDays();
|
|
2090
|
-
updateValue();
|
|
2091
|
-
if (!shouldChangeMonth &&
|
|
2092
|
-
self.config.mode !== "range" &&
|
|
2093
|
-
self.config.showMonths === 1)
|
|
2094
|
-
focusOnDayElem(target);
|
|
2095
|
-
else if (self.selectedDateElem !== undefined &&
|
|
2096
|
-
self.hourElement === undefined) {
|
|
2097
|
-
self.selectedDateElem && self.selectedDateElem.focus();
|
|
2098
|
-
}
|
|
2099
|
-
if (self.hourElement !== undefined)
|
|
2100
|
-
self.hourElement !== undefined && self.hourElement.focus();
|
|
2101
|
-
if (self.config.closeOnSelect) {
|
|
2102
|
-
var single = self.config.mode === "single" && !self.config.enableTime;
|
|
2103
|
-
var range = self.config.mode === "range" &&
|
|
2104
|
-
self.selectedDates.length === 2 &&
|
|
2105
|
-
!self.config.enableTime;
|
|
2106
|
-
if (single || range) {
|
|
2107
|
-
focusAndClose();
|
|
2108
|
-
}
|
|
2109
|
-
}
|
|
2110
|
-
triggerChange();
|
|
2111
|
-
}
|
|
2112
|
-
var CALLBACKS = {
|
|
2113
|
-
locale: [setupLocale, updateWeekdays],
|
|
2114
|
-
showMonths: [buildMonths, setCalendarWidth, buildWeekdays],
|
|
2115
|
-
minDate: [jumpToDate],
|
|
2116
|
-
maxDate: [jumpToDate],
|
|
2117
|
-
positionElement: [updatePositionElement],
|
|
2118
|
-
clickOpens: [
|
|
2119
|
-
function () {
|
|
2120
|
-
if (self.config.clickOpens === true) {
|
|
2121
|
-
bind(self._input, "focus", self.open);
|
|
2122
|
-
bind(self._input, "click", self.open);
|
|
2123
|
-
}
|
|
2124
|
-
else {
|
|
2125
|
-
self._input.removeEventListener("focus", self.open);
|
|
2126
|
-
self._input.removeEventListener("click", self.open);
|
|
2127
|
-
}
|
|
2128
|
-
},
|
|
2129
|
-
],
|
|
2130
|
-
};
|
|
2131
|
-
function set(option, value) {
|
|
2132
|
-
if (option !== null && typeof option === "object") {
|
|
2133
|
-
Object.assign(self.config, option);
|
|
2134
|
-
for (var key in option) {
|
|
2135
|
-
if (CALLBACKS[key] !== undefined)
|
|
2136
|
-
CALLBACKS[key].forEach(function (x) { return x(); });
|
|
2137
|
-
}
|
|
2138
|
-
}
|
|
2139
|
-
else {
|
|
2140
|
-
self.config[option] = value;
|
|
2141
|
-
if (CALLBACKS[option] !== undefined)
|
|
2142
|
-
CALLBACKS[option].forEach(function (x) { return x(); });
|
|
2143
|
-
else if (HOOKS.indexOf(option) > -1)
|
|
2144
|
-
self.config[option] = arrayify(value);
|
|
2145
|
-
}
|
|
2146
|
-
self.redraw();
|
|
2147
|
-
updateValue(true);
|
|
2148
|
-
}
|
|
2149
|
-
function setSelectedDate(inputDate, format) {
|
|
2150
|
-
var dates = [];
|
|
2151
|
-
if (inputDate instanceof Array)
|
|
2152
|
-
dates = inputDate.map(function (d) { return self.parseDate(d, format); });
|
|
2153
|
-
else if (inputDate instanceof Date || typeof inputDate === "number")
|
|
2154
|
-
dates = [self.parseDate(inputDate, format)];
|
|
2155
|
-
else if (typeof inputDate === "string") {
|
|
2156
|
-
switch (self.config.mode) {
|
|
2157
|
-
case "single":
|
|
2158
|
-
case "time":
|
|
2159
|
-
dates = [self.parseDate(inputDate, format)];
|
|
2160
|
-
break;
|
|
2161
|
-
case "multiple":
|
|
2162
|
-
dates = inputDate
|
|
2163
|
-
.split(self.config.conjunction)
|
|
2164
|
-
.map(function (date) { return self.parseDate(date, format); });
|
|
2165
|
-
break;
|
|
2166
|
-
case "range":
|
|
2167
|
-
dates = inputDate
|
|
2168
|
-
.split(self.l10n.rangeSeparator)
|
|
2169
|
-
.map(function (date) { return self.parseDate(date, format); });
|
|
2170
|
-
break;
|
|
2171
|
-
}
|
|
2172
|
-
}
|
|
2173
|
-
else
|
|
2174
|
-
self.config.errorHandler(new Error("Invalid date supplied: " + JSON.stringify(inputDate)));
|
|
2175
|
-
self.selectedDates = (self.config.allowInvalidPreload
|
|
2176
|
-
? dates
|
|
2177
|
-
: dates.filter(function (d) { return d instanceof Date && isEnabled(d, false); }));
|
|
2178
|
-
if (self.config.mode === "range")
|
|
2179
|
-
self.selectedDates.sort(function (a, b) { return a.getTime() - b.getTime(); });
|
|
2180
|
-
}
|
|
2181
|
-
function setDate(date, triggerChange, format) {
|
|
2182
|
-
if (triggerChange === void 0) { triggerChange = false; }
|
|
2183
|
-
if (format === void 0) { format = self.config.dateFormat; }
|
|
2184
|
-
if ((date !== 0 && !date) || (date instanceof Array && date.length === 0))
|
|
2185
|
-
return self.clear(triggerChange);
|
|
2186
|
-
setSelectedDate(date, format);
|
|
2187
|
-
self.latestSelectedDateObj =
|
|
2188
|
-
self.selectedDates[self.selectedDates.length - 1];
|
|
2189
|
-
self.redraw();
|
|
2190
|
-
jumpToDate(undefined, triggerChange);
|
|
2191
|
-
setHoursFromDate();
|
|
2192
|
-
if (self.selectedDates.length === 0) {
|
|
2193
|
-
self.clear(false);
|
|
2194
|
-
}
|
|
2195
|
-
updateValue(triggerChange);
|
|
2196
|
-
if (triggerChange)
|
|
2197
|
-
triggerEvent("onChange");
|
|
2198
|
-
}
|
|
2199
|
-
function parseDateRules(arr) {
|
|
2200
|
-
return arr
|
|
2201
|
-
.slice()
|
|
2202
|
-
.map(function (rule) {
|
|
2203
|
-
if (typeof rule === "string" ||
|
|
2204
|
-
typeof rule === "number" ||
|
|
2205
|
-
rule instanceof Date) {
|
|
2206
|
-
return self.parseDate(rule, undefined, true);
|
|
2207
|
-
}
|
|
2208
|
-
else if (rule &&
|
|
2209
|
-
typeof rule === "object" &&
|
|
2210
|
-
rule.from &&
|
|
2211
|
-
rule.to)
|
|
2212
|
-
return {
|
|
2213
|
-
from: self.parseDate(rule.from, undefined),
|
|
2214
|
-
to: self.parseDate(rule.to, undefined),
|
|
2215
|
-
};
|
|
2216
|
-
return rule;
|
|
2217
|
-
})
|
|
2218
|
-
.filter(function (x) { return x; });
|
|
2219
|
-
}
|
|
2220
|
-
function setupDates() {
|
|
2221
|
-
self.selectedDates = [];
|
|
2222
|
-
self.now = self.parseDate(self.config.now) || new Date();
|
|
2223
|
-
var preloadedDate = self.config.defaultDate ||
|
|
2224
|
-
((self.input.nodeName === "INPUT" ||
|
|
2225
|
-
self.input.nodeName === "TEXTAREA") &&
|
|
2226
|
-
self.input.placeholder &&
|
|
2227
|
-
self.input.value === self.input.placeholder
|
|
2228
|
-
? null
|
|
2229
|
-
: self.input.value);
|
|
2230
|
-
if (preloadedDate)
|
|
2231
|
-
setSelectedDate(preloadedDate, self.config.dateFormat);
|
|
2232
|
-
self._initialDate =
|
|
2233
|
-
self.selectedDates.length > 0
|
|
2234
|
-
? self.selectedDates[0]
|
|
2235
|
-
: self.config.minDate &&
|
|
2236
|
-
self.config.minDate.getTime() > self.now.getTime()
|
|
2237
|
-
? self.config.minDate
|
|
2238
|
-
: self.config.maxDate &&
|
|
2239
|
-
self.config.maxDate.getTime() < self.now.getTime()
|
|
2240
|
-
? self.config.maxDate
|
|
2241
|
-
: self.now;
|
|
2242
|
-
self.currentYear = self._initialDate.getFullYear();
|
|
2243
|
-
self.currentMonth = self._initialDate.getMonth();
|
|
2244
|
-
if (self.selectedDates.length > 0)
|
|
2245
|
-
self.latestSelectedDateObj = self.selectedDates[0];
|
|
2246
|
-
if (self.config.minTime !== undefined)
|
|
2247
|
-
self.config.minTime = self.parseDate(self.config.minTime, "H:i");
|
|
2248
|
-
if (self.config.maxTime !== undefined)
|
|
2249
|
-
self.config.maxTime = self.parseDate(self.config.maxTime, "H:i");
|
|
2250
|
-
self.minDateHasTime =
|
|
2251
|
-
!!self.config.minDate &&
|
|
2252
|
-
(self.config.minDate.getHours() > 0 ||
|
|
2253
|
-
self.config.minDate.getMinutes() > 0 ||
|
|
2254
|
-
self.config.minDate.getSeconds() > 0);
|
|
2255
|
-
self.maxDateHasTime =
|
|
2256
|
-
!!self.config.maxDate &&
|
|
2257
|
-
(self.config.maxDate.getHours() > 0 ||
|
|
2258
|
-
self.config.maxDate.getMinutes() > 0 ||
|
|
2259
|
-
self.config.maxDate.getSeconds() > 0);
|
|
2260
|
-
}
|
|
2261
|
-
function setupInputs() {
|
|
2262
|
-
self.input = getInputElem();
|
|
2263
|
-
if (!self.input) {
|
|
2264
|
-
self.config.errorHandler(new Error("Invalid input element specified"));
|
|
2265
|
-
return;
|
|
2266
|
-
}
|
|
2267
|
-
self.input._type = self.input.type;
|
|
2268
|
-
self.input.type = "text";
|
|
2269
|
-
self.input.classList.add("flatpickr-input");
|
|
2270
|
-
self._input = self.input;
|
|
2271
|
-
if (self.config.altInput) {
|
|
2272
|
-
self.altInput = createElement(self.input.nodeName, self.config.altInputClass);
|
|
2273
|
-
self._input = self.altInput;
|
|
2274
|
-
self.altInput.placeholder = self.input.placeholder;
|
|
2275
|
-
self.altInput.disabled = self.input.disabled;
|
|
2276
|
-
self.altInput.required = self.input.required;
|
|
2277
|
-
self.altInput.tabIndex = self.input.tabIndex;
|
|
2278
|
-
self.altInput.type = "text";
|
|
2279
|
-
self.input.setAttribute("type", "hidden");
|
|
2280
|
-
if (!self.config.static && self.input.parentNode)
|
|
2281
|
-
self.input.parentNode.insertBefore(self.altInput, self.input.nextSibling);
|
|
2282
|
-
}
|
|
2283
|
-
if (!self.config.allowInput)
|
|
2284
|
-
self._input.setAttribute("readonly", "readonly");
|
|
2285
|
-
updatePositionElement();
|
|
2286
|
-
}
|
|
2287
|
-
function updatePositionElement() {
|
|
2288
|
-
self._positionElement = self.config.positionElement || self._input;
|
|
2289
|
-
}
|
|
2290
|
-
function setupMobile() {
|
|
2291
|
-
var inputType = self.config.enableTime
|
|
2292
|
-
? self.config.noCalendar
|
|
2293
|
-
? "time"
|
|
2294
|
-
: "datetime-local"
|
|
2295
|
-
: "date";
|
|
2296
|
-
self.mobileInput = createElement("input", self.input.className + " flatpickr-mobile");
|
|
2297
|
-
self.mobileInput.tabIndex = 1;
|
|
2298
|
-
self.mobileInput.type = inputType;
|
|
2299
|
-
self.mobileInput.disabled = self.input.disabled;
|
|
2300
|
-
self.mobileInput.required = self.input.required;
|
|
2301
|
-
self.mobileInput.placeholder = self.input.placeholder;
|
|
2302
|
-
self.mobileFormatStr =
|
|
2303
|
-
inputType === "datetime-local"
|
|
2304
|
-
? "Y-m-d\\TH:i:S"
|
|
2305
|
-
: inputType === "date"
|
|
2306
|
-
? "Y-m-d"
|
|
2307
|
-
: "H:i:S";
|
|
2308
|
-
if (self.selectedDates.length > 0) {
|
|
2309
|
-
self.mobileInput.defaultValue = self.mobileInput.value = self.formatDate(self.selectedDates[0], self.mobileFormatStr);
|
|
2310
|
-
}
|
|
2311
|
-
if (self.config.minDate)
|
|
2312
|
-
self.mobileInput.min = self.formatDate(self.config.minDate, "Y-m-d");
|
|
2313
|
-
if (self.config.maxDate)
|
|
2314
|
-
self.mobileInput.max = self.formatDate(self.config.maxDate, "Y-m-d");
|
|
2315
|
-
if (self.input.getAttribute("step"))
|
|
2316
|
-
self.mobileInput.step = String(self.input.getAttribute("step"));
|
|
2317
|
-
self.input.type = "hidden";
|
|
2318
|
-
if (self.altInput !== undefined)
|
|
2319
|
-
self.altInput.type = "hidden";
|
|
2320
|
-
try {
|
|
2321
|
-
if (self.input.parentNode)
|
|
2322
|
-
self.input.parentNode.insertBefore(self.mobileInput, self.input.nextSibling);
|
|
2323
|
-
}
|
|
2324
|
-
catch (_a) { }
|
|
2325
|
-
bind(self.mobileInput, "change", function (e) {
|
|
2326
|
-
self.setDate(getEventTarget(e).value, false, self.mobileFormatStr);
|
|
2327
|
-
triggerEvent("onChange");
|
|
2328
|
-
triggerEvent("onClose");
|
|
2329
|
-
});
|
|
2330
|
-
}
|
|
2331
|
-
function toggle(e) {
|
|
2332
|
-
if (self.isOpen === true)
|
|
2333
|
-
return self.close();
|
|
2334
|
-
self.open(e);
|
|
2335
|
-
}
|
|
2336
|
-
function triggerEvent(event, data) {
|
|
2337
|
-
if (self.config === undefined)
|
|
2338
|
-
return;
|
|
2339
|
-
var hooks = self.config[event];
|
|
2340
|
-
if (hooks !== undefined && hooks.length > 0) {
|
|
2341
|
-
for (var i = 0; hooks[i] && i < hooks.length; i++)
|
|
2342
|
-
hooks[i](self.selectedDates, self.input.value, self, data);
|
|
2343
|
-
}
|
|
2344
|
-
if (event === "onChange") {
|
|
2345
|
-
self.input.dispatchEvent(createEvent("change"));
|
|
2346
|
-
self.input.dispatchEvent(createEvent("input"));
|
|
2347
|
-
}
|
|
2348
|
-
}
|
|
2349
|
-
function createEvent(name) {
|
|
2350
|
-
var e = document.createEvent("Event");
|
|
2351
|
-
e.initEvent(name, true, true);
|
|
2352
|
-
return e;
|
|
2353
|
-
}
|
|
2354
|
-
function isDateSelected(date) {
|
|
2355
|
-
for (var i = 0; i < self.selectedDates.length; i++) {
|
|
2356
|
-
var selectedDate = self.selectedDates[i];
|
|
2357
|
-
if (selectedDate instanceof Date &&
|
|
2358
|
-
compareDates(selectedDate, date) === 0)
|
|
2359
|
-
return "" + i;
|
|
2360
|
-
}
|
|
2361
|
-
return false;
|
|
2362
|
-
}
|
|
2363
|
-
function isDateInRange(date) {
|
|
2364
|
-
if (self.config.mode !== "range" || self.selectedDates.length < 2)
|
|
2365
|
-
return false;
|
|
2366
|
-
return (compareDates(date, self.selectedDates[0]) >= 0 &&
|
|
2367
|
-
compareDates(date, self.selectedDates[1]) <= 0);
|
|
2368
|
-
}
|
|
2369
|
-
function updateNavigationCurrentMonth() {
|
|
2370
|
-
if (self.config.noCalendar || self.isMobile || !self.monthNav)
|
|
2371
|
-
return;
|
|
2372
|
-
self.yearElements.forEach(function (yearElement, i) {
|
|
2373
|
-
var d = new Date(self.currentYear, self.currentMonth, 1);
|
|
2374
|
-
d.setMonth(self.currentMonth + i);
|
|
2375
|
-
if (self.config.showMonths > 1 ||
|
|
2376
|
-
self.config.monthSelectorType === "static") {
|
|
2377
|
-
self.monthElements[i].textContent =
|
|
2378
|
-
monthToStr(d.getMonth(), self.config.shorthandCurrentMonth, self.l10n) + " ";
|
|
2379
|
-
}
|
|
2380
|
-
else {
|
|
2381
|
-
self.monthsDropdownContainer.value = d.getMonth().toString();
|
|
2382
|
-
}
|
|
2383
|
-
yearElement.value = d.getFullYear().toString();
|
|
2384
|
-
});
|
|
2385
|
-
self._hidePrevMonthArrow =
|
|
2386
|
-
self.config.minDate !== undefined &&
|
|
2387
|
-
(self.currentYear === self.config.minDate.getFullYear()
|
|
2388
|
-
? self.currentMonth <= self.config.minDate.getMonth()
|
|
2389
|
-
: self.currentYear < self.config.minDate.getFullYear());
|
|
2390
|
-
self._hideNextMonthArrow =
|
|
2391
|
-
self.config.maxDate !== undefined &&
|
|
2392
|
-
(self.currentYear === self.config.maxDate.getFullYear()
|
|
2393
|
-
? self.currentMonth + 1 > self.config.maxDate.getMonth()
|
|
2394
|
-
: self.currentYear > self.config.maxDate.getFullYear());
|
|
2395
|
-
}
|
|
2396
|
-
function getDateStr(specificFormat) {
|
|
2397
|
-
var format = specificFormat ||
|
|
2398
|
-
(self.config.altInput ? self.config.altFormat : self.config.dateFormat);
|
|
2399
|
-
return self.selectedDates
|
|
2400
|
-
.map(function (dObj) { return self.formatDate(dObj, format); })
|
|
2401
|
-
.filter(function (d, i, arr) {
|
|
2402
|
-
return self.config.mode !== "range" ||
|
|
2403
|
-
self.config.enableTime ||
|
|
2404
|
-
arr.indexOf(d) === i;
|
|
2405
|
-
})
|
|
2406
|
-
.join(self.config.mode !== "range"
|
|
2407
|
-
? self.config.conjunction
|
|
2408
|
-
: self.l10n.rangeSeparator);
|
|
2409
|
-
}
|
|
2410
|
-
function updateValue(triggerChange) {
|
|
2411
|
-
if (triggerChange === void 0) { triggerChange = true; }
|
|
2412
|
-
if (self.mobileInput !== undefined && self.mobileFormatStr) {
|
|
2413
|
-
self.mobileInput.value =
|
|
2414
|
-
self.latestSelectedDateObj !== undefined
|
|
2415
|
-
? self.formatDate(self.latestSelectedDateObj, self.mobileFormatStr)
|
|
2416
|
-
: "";
|
|
2417
|
-
}
|
|
2418
|
-
self.input.value = getDateStr(self.config.dateFormat);
|
|
2419
|
-
if (self.altInput !== undefined) {
|
|
2420
|
-
self.altInput.value = getDateStr(self.config.altFormat);
|
|
2421
|
-
}
|
|
2422
|
-
if (triggerChange !== false)
|
|
2423
|
-
triggerEvent("onValueUpdate");
|
|
2424
|
-
}
|
|
2425
|
-
function onMonthNavClick(e) {
|
|
2426
|
-
var eventTarget = getEventTarget(e);
|
|
2427
|
-
var isPrevMonth = self.prevMonthNav.contains(eventTarget);
|
|
2428
|
-
var isNextMonth = self.nextMonthNav.contains(eventTarget);
|
|
2429
|
-
if (isPrevMonth || isNextMonth) {
|
|
2430
|
-
changeMonth(isPrevMonth ? -1 : 1);
|
|
2431
|
-
}
|
|
2432
|
-
else if (self.yearElements.indexOf(eventTarget) >= 0) {
|
|
2433
|
-
eventTarget.select();
|
|
2434
|
-
}
|
|
2435
|
-
else if (eventTarget.classList.contains("arrowUp")) {
|
|
2436
|
-
self.changeYear(self.currentYear + 1);
|
|
2437
|
-
}
|
|
2438
|
-
else if (eventTarget.classList.contains("arrowDown")) {
|
|
2439
|
-
self.changeYear(self.currentYear - 1);
|
|
2440
|
-
}
|
|
2441
|
-
}
|
|
2442
|
-
function timeWrapper(e) {
|
|
2443
|
-
e.preventDefault();
|
|
2444
|
-
var isKeyDown = e.type === "keydown", eventTarget = getEventTarget(e), input = eventTarget;
|
|
2445
|
-
if (self.amPM !== undefined && eventTarget === self.amPM) {
|
|
2446
|
-
self.amPM.textContent =
|
|
2447
|
-
self.l10n.amPM[int(self.amPM.textContent === self.l10n.amPM[0])];
|
|
2448
|
-
}
|
|
2449
|
-
var min = parseFloat(input.getAttribute("min")), max = parseFloat(input.getAttribute("max")), step = parseFloat(input.getAttribute("step")), curValue = parseInt(input.value, 10), delta = e.delta ||
|
|
2450
|
-
(isKeyDown ? (e.which === 38 ? 1 : -1) : 0);
|
|
2451
|
-
var newValue = curValue + step * delta;
|
|
2452
|
-
if (typeof input.value !== "undefined" && input.value.length === 2) {
|
|
2453
|
-
var isHourElem = input === self.hourElement, isMinuteElem = input === self.minuteElement;
|
|
2454
|
-
if (newValue < min) {
|
|
2455
|
-
newValue =
|
|
2456
|
-
max +
|
|
2457
|
-
newValue +
|
|
2458
|
-
int(!isHourElem) +
|
|
2459
|
-
(int(isHourElem) && int(!self.amPM));
|
|
2460
|
-
if (isMinuteElem)
|
|
2461
|
-
incrementNumInput(undefined, -1, self.hourElement);
|
|
2462
|
-
}
|
|
2463
|
-
else if (newValue > max) {
|
|
2464
|
-
newValue =
|
|
2465
|
-
input === self.hourElement ? newValue - max - int(!self.amPM) : min;
|
|
2466
|
-
if (isMinuteElem)
|
|
2467
|
-
incrementNumInput(undefined, 1, self.hourElement);
|
|
2468
|
-
}
|
|
2469
|
-
if (self.amPM &&
|
|
2470
|
-
isHourElem &&
|
|
2471
|
-
(step === 1
|
|
2472
|
-
? newValue + curValue === 23
|
|
2473
|
-
: Math.abs(newValue - curValue) > step)) {
|
|
2474
|
-
self.amPM.textContent =
|
|
2475
|
-
self.l10n.amPM[int(self.amPM.textContent === self.l10n.amPM[0])];
|
|
2476
|
-
}
|
|
2477
|
-
input.value = pad(newValue);
|
|
2478
|
-
}
|
|
2479
|
-
}
|
|
2480
|
-
init();
|
|
2481
|
-
return self;
|
|
2482
|
-
}
|
|
2483
|
-
function _flatpickr(nodeList, config) {
|
|
2484
|
-
var nodes = Array.prototype.slice
|
|
2485
|
-
.call(nodeList)
|
|
2486
|
-
.filter(function (x) { return x instanceof HTMLElement; });
|
|
2487
|
-
var instances = [];
|
|
2488
|
-
for (var i = 0; i < nodes.length; i++) {
|
|
2489
|
-
var node = nodes[i];
|
|
2490
|
-
try {
|
|
2491
|
-
if (node.getAttribute("data-fp-omit") !== null)
|
|
2492
|
-
continue;
|
|
2493
|
-
if (node._flatpickr !== undefined) {
|
|
2494
|
-
node._flatpickr.destroy();
|
|
2495
|
-
node._flatpickr = undefined;
|
|
2496
|
-
}
|
|
2497
|
-
node._flatpickr = FlatpickrInstance(node, config || {});
|
|
2498
|
-
instances.push(node._flatpickr);
|
|
2499
|
-
}
|
|
2500
|
-
catch (e) {
|
|
2501
|
-
console.error(e);
|
|
2502
|
-
}
|
|
2503
|
-
}
|
|
2504
|
-
return instances.length === 1 ? instances[0] : instances;
|
|
2505
|
-
}
|
|
2506
|
-
if (typeof HTMLElement !== "undefined" &&
|
|
2507
|
-
typeof HTMLCollection !== "undefined" &&
|
|
2508
|
-
typeof NodeList !== "undefined") {
|
|
2509
|
-
HTMLCollection.prototype.flatpickr = NodeList.prototype.flatpickr = function (config) {
|
|
2510
|
-
return _flatpickr(this, config);
|
|
2511
|
-
};
|
|
2512
|
-
HTMLElement.prototype.flatpickr = function (config) {
|
|
2513
|
-
return _flatpickr([this], config);
|
|
2514
|
-
};
|
|
2515
|
-
}
|
|
2516
|
-
var flatpickr = function (selector, config) {
|
|
2517
|
-
if (typeof selector === "string") {
|
|
2518
|
-
return _flatpickr(window.document.querySelectorAll(selector), config);
|
|
2519
|
-
}
|
|
2520
|
-
else if (selector instanceof Node) {
|
|
2521
|
-
return _flatpickr([selector], config);
|
|
2522
|
-
}
|
|
2523
|
-
else {
|
|
2524
|
-
return _flatpickr(selector, config);
|
|
2525
|
-
}
|
|
2526
|
-
};
|
|
2527
|
-
flatpickr.defaultConfig = {};
|
|
2528
|
-
flatpickr.l10ns = {
|
|
2529
|
-
en: __assign({}, english),
|
|
2530
|
-
default: __assign({}, english),
|
|
2531
|
-
};
|
|
2532
|
-
flatpickr.localize = function (l10n) {
|
|
2533
|
-
flatpickr.l10ns.default = __assign(__assign({}, flatpickr.l10ns.default), l10n);
|
|
2534
|
-
};
|
|
2535
|
-
flatpickr.setDefaults = function (config) {
|
|
2536
|
-
flatpickr.defaultConfig = __assign(__assign({}, flatpickr.defaultConfig), config);
|
|
2537
|
-
};
|
|
2538
|
-
flatpickr.parseDate = createDateParser({});
|
|
2539
|
-
flatpickr.formatDate = createDateFormatter({});
|
|
2540
|
-
flatpickr.compareDates = compareDates;
|
|
2541
|
-
if (typeof jQuery !== "undefined" && typeof jQuery.fn !== "undefined") {
|
|
2542
|
-
jQuery.fn.flatpickr = function (config) {
|
|
2543
|
-
return _flatpickr(this, config);
|
|
2544
|
-
};
|
|
2545
|
-
}
|
|
2546
|
-
Date.prototype.fp_incr = function (days) {
|
|
2547
|
-
return new Date(this.getFullYear(), this.getMonth(), this.getDate() + (typeof days === "string" ? parseInt(days, 10) : days));
|
|
2548
|
-
};
|
|
2549
|
-
if (typeof window !== "undefined") {
|
|
2550
|
-
window.flatpickr = flatpickr;
|
|
2551
|
-
}
|
|
2552
|
-
|
|
2553
|
-
export { flatpickr as default };
|
|
4
|
+
var n=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],e={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return"undefined"!=typeof console&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},t={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},r=function(n,e){return void 0===e&&(e=2),("000"+n).slice(-1*e)},i=function(n){return!0===n?1:0};function o(n,e){var t;return function(){var r=this,i=arguments;clearTimeout(t),t=setTimeout((function(){return n.apply(r,i)}),e)}}var a=function(n){return n instanceof Array?n:[n]};function u(n,e,t){if(!0===t)return n.classList.add(e);n.classList.remove(e)}function f(n,e,t){var r=window.document.createElement(n);return t=t||"",r.className=e=e||"",void 0!==t&&(r.textContent=t),r}function c(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function d(n,e){return e(n)?n:n.parentNode?d(n.parentNode,e):void 0}function v(n,e){var t=f("div","numInputWrapper"),r=f("input","numInput "+n),i=f("span","arrowUp"),o=f("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?r.type="number":(r.type="text",r.pattern="\\d*"),void 0!==e)for(var a in e)r.setAttribute(a,e[a]);return t.appendChild(r),t.appendChild(i),t.appendChild(o),t}function l(n){try{return"function"==typeof n.composedPath?n.composedPath()[0]:n.target}catch(e){return n.target}}var s=function(){},p=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},w={D:s,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*i(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(1e3*parseFloat(e))},W:function(n,e,t){var r=parseInt(e),i=new Date(n.getFullYear(),0,2+7*(r-1),0,0,0,0);return i.setDate(i.getDate()-i.getDay()+t.firstDayOfWeek),i},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:s,m:function(n,e){n.setMonth(parseFloat(e)-1)},n:function(n,e){n.setMonth(parseFloat(e)-1)},s:function(n,e){n.setSeconds(parseFloat(e))},u:function(n,e){return new Date(parseFloat(e))},w:s,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},h={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},m={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[m.w(n,e,t)]},F:function(n,e,t){return p(m.n(n,e,t)-1,!1,e)},G:function(n,e,t){return r(m.h(n,e,t))},H:function(n){return r(n.getHours())},J:function(n,e){return void 0!==e.ordinal?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[i(n.getHours()>11)]},M:function(n,e){return p(n.getMonth(),!0,e)},S:function(n){return r(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return r(n.getFullYear(),4)},d:function(n){return r(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return r(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return r(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},g=function(n){var r=n.config,i=void 0===r?e:r,o=n.l10n,a=void 0===o?t:o,u=n.isMobile,f=void 0!==u&&u;return function(n,e,t){var r=t||a;return void 0===i.formatDate||f?e.split("").map((function(e,t,o){return m[e]&&"\\"!==o[t-1]?m[e](n,r,i):"\\"!==e?e:""})).join(""):i.formatDate(n,e,r)}},y=function(n){var r=n.config,i=void 0===r?e:r,o=n.l10n,a=void 0===o?t:o;return function(n,t,r,o){if(0===n||n){var u,f=o||a,c=n;if(n instanceof Date)u=new Date(n.getTime());else if("string"!=typeof n&&void 0!==n.toFixed)u=new Date(n);else if("string"==typeof n){var d=t||(i||e).dateFormat,v=String(n).trim();if("today"===v)u=new Date,r=!0;else if(i&&i.parseDate)u=i.parseDate(n,d);else if(/Z$/.test(v)||/GMT$/.test(v))u=new Date(n);else{for(var l=void 0,s=[],p=0,m=0,g="";p<d.length;p++){var y=d[p],k="\\"===y;if(h[y]&&"\\"!==d[p-1]&&!k){g+=h[y];var b=new RegExp(g).exec(n);b&&(l=!0)&&s["Y"!==y?"push":"unshift"]({fn:w[y],val:b[++m]})}else k||(g+=".")}u=i&&i.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0),s.forEach((function(n){return u=(0,n.fn)(u,n.val,f)||u})),u=l?u:void 0}}if(u instanceof Date&&!isNaN(u.getTime()))return!0===r&&u.setHours(0,0,0,0),u;i.errorHandler(new Error("Invalid date provided: "+c))}}};function k(n,e,t){return void 0===t&&(t=!0),!1!==t?new Date(n.getTime()).setHours(0,0,0,0)-new Date(e.getTime()).setHours(0,0,0,0):n.getTime()-e.getTime()}var b=function(n,e,t){return 3600*n+60*e+t};function M(n){var e=n.defaultHour,t=n.defaultMinute,r=n.defaultSeconds;if(void 0!==n.minDate){var i=n.minDate.getHours(),o=n.minDate.getMinutes(),a=n.minDate.getSeconds();e<i&&(e=i),e===i&&t<o&&(t=o),e===i&&t===o&&r<a&&(r=n.minDate.getSeconds())}if(void 0!==n.maxDate){var u=n.maxDate.getHours(),f=n.maxDate.getMinutes();(e=Math.min(e,u))===u&&(t=Math.min(f,t)),e===u&&t===f&&(r=n.maxDate.getSeconds())}return{hours:e,minutes:t,seconds:r}}"function"!=typeof Object.assign&&(Object.assign=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!n)throw TypeError("Cannot convert undefined or null to object");for(var r=function(e){e&&Object.keys(e).forEach((function(t){return n[t]=e[t]}))},i=0,o=e;i<o.length;i++)r(o[i]);return n});var D=function(){return D=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n},D.apply(this,arguments)},C=function(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;var r=Array(n),i=0;for(e=0;e<t;e++)for(var o=arguments[e],a=0,u=o.length;a<u;a++,i++)r[i]=o[a];return r};function x(s,w){var m={config:D(D({},e),O.defaultConfig),l10n:t};function x(){var n;return(null===(n=m.calendarContainer)||void 0===n?void 0:n.getRootNode()).activeElement||document.activeElement}function S(n){return n.bind(m)}function A(){var n=m.config;!1===n.weekNumbers&&1===n.showMonths||!0!==n.noCalendar&&window.requestAnimationFrame((function(){if(void 0!==m.calendarContainer&&(m.calendarContainer.style.visibility="hidden",m.calendarContainer.style.display="block"),void 0!==m.daysContainer){var e=(m.days.offsetWidth+1)*n.showMonths;m.daysContainer.style.width=e+"px",m.calendarContainer.style.width=e+(void 0!==m.weekWrapper?m.weekWrapper.offsetWidth:0)+"px",m.calendarContainer.style.removeProperty("visibility"),m.calendarContainer.style.removeProperty("display")}}))}function j(n){if(0===m.selectedDates.length){var e=void 0===m.config.minDate||k(new Date,m.config.minDate)>=0?new Date:new Date(m.config.minDate.getTime()),t=M(m.config);e.setHours(t.hours,t.minutes,t.seconds,e.getMilliseconds()),m.selectedDates=[e],m.latestSelectedDateObj=e}void 0!==n&&"blur"!==n.type&&function(n){n.preventDefault();var e="keydown"===n.type,t=l(n),o=t;void 0!==m.amPM&&t===m.amPM&&(m.amPM.textContent=m.l10n.amPM[i(m.amPM.textContent===m.l10n.amPM[0])]);var a=parseFloat(o.getAttribute("min")),u=parseFloat(o.getAttribute("max")),f=parseFloat(o.getAttribute("step")),c=parseInt(o.value,10),d=c+f*(n.delta||(e?38===n.which?1:-1:0));if(void 0!==o.value&&2===o.value.length){var v=o===m.hourElement,s=o===m.minuteElement;d<a?(d=u+d+i(!v)+(i(v)&&i(!m.amPM)),s&&Y(void 0,-1,m.hourElement)):d>u&&(d=o===m.hourElement?d-u-i(!m.amPM):a,s&&Y(void 0,1,m.hourElement)),m.amPM&&v&&(1===f?d+c===23:Math.abs(d-c)>f)&&(m.amPM.textContent=m.l10n.amPM[i(m.amPM.textContent===m.l10n.amPM[0])]),o.value=r(d)}}(n);var o=m._input.value;F(),Dn(),m._input.value!==o&&m._debouncedChange()}function F(){if(void 0!==m.hourElement&&void 0!==m.minuteElement){var n=(parseInt(m.hourElement.value.slice(-2),10)||0)%24,e=(parseInt(m.minuteElement.value,10)||0)%60,t=void 0!==m.secondElement?(parseInt(m.secondElement.value,10)||0)%60:0;void 0!==m.amPM&&(n=n%12+12*i(m.amPM.textContent===m.l10n.amPM[1]));var r=void 0!==m.config.minTime||m.config.minDate&&m.minDateHasTime&&m.latestSelectedDateObj&&0===k(m.latestSelectedDateObj,m.config.minDate,!0),o=void 0!==m.config.maxTime||m.config.maxDate&&m.maxDateHasTime&&m.latestSelectedDateObj&&0===k(m.latestSelectedDateObj,m.config.maxDate,!0);if(void 0!==m.config.maxTime&&void 0!==m.config.minTime&&m.config.minTime>m.config.maxTime){var a=b(m.config.minTime.getHours(),m.config.minTime.getMinutes(),m.config.minTime.getSeconds()),u=b(m.config.maxTime.getHours(),m.config.maxTime.getMinutes(),m.config.maxTime.getSeconds()),f=b(n,e,t);if(f>u&&f<a){var c=function(n){var e=Math.floor(n/3600),t=(n-3600*e)/60;return[e,t,n-3600*e-60*t]}(a);n=c[0],e=c[1],t=c[2]}}else{if(o){var d=void 0!==m.config.maxTime?m.config.maxTime:m.config.maxDate;(n=Math.min(n,d.getHours()))===d.getHours()&&(e=Math.min(e,d.getMinutes())),e===d.getMinutes()&&(t=Math.min(t,d.getSeconds()))}if(r){var v=void 0!==m.config.minTime?m.config.minTime:m.config.minDate;(n=Math.max(n,v.getHours()))===v.getHours()&&e<v.getMinutes()&&(e=v.getMinutes()),e===v.getMinutes()&&(t=Math.max(t,v.getSeconds()))}}T(n,e,t)}}function I(n){var e=n||m.latestSelectedDateObj;e&&e instanceof Date&&T(e.getHours(),e.getMinutes(),e.getSeconds())}function T(n,e,t){void 0!==m.latestSelectedDateObj&&m.latestSelectedDateObj.setHours(n%24,e,t||0,0),m.hourElement&&m.minuteElement&&!m.isMobile&&(m.hourElement.value=r(m.config.time_24hr?n:(12+n)%12+12*i(n%12==0)),m.minuteElement.value=r(e),void 0!==m.amPM&&(m.amPM.textContent=m.l10n.amPM[i(n>=12)]),void 0!==m.secondElement&&(m.secondElement.value=r(t)))}function E(n){var e=l(n),t=parseInt(e.value)+(n.delta||0);(t/1e3>1||"Enter"===n.key&&!/[^\d]/.test(t.toString()))&&q(t)}function P(n,e,t,r){return e instanceof Array?e.forEach((function(e){return P(n,e,t,r)})):n instanceof Array?n.forEach((function(n){return P(n,e,t,r)})):(n.addEventListener(e,t,r),void m._handlers.push({remove:function(){return n.removeEventListener(e,t,r)}}))}function N(){gn("onChange")}function R(n,e){var t=void 0!==n?m.parseDate(n):m.latestSelectedDateObj||(m.config.minDate&&m.config.minDate>m.now?m.config.minDate:m.config.maxDate&&m.config.maxDate<m.now?m.config.maxDate:m.now),r=m.currentYear,i=m.currentMonth;try{void 0!==t&&(m.currentYear=t.getFullYear(),m.currentMonth=t.getMonth())}catch(n){n.message="Invalid date supplied: "+t,m.config.errorHandler(n)}e&&m.currentYear!==r&&(gn("onYearChange"),B()),!e||m.currentYear===r&&m.currentMonth===i||gn("onMonthChange"),m.redraw()}function H(n){var e=l(n);~e.className.indexOf("arrow")&&Y(n,e.classList.contains("arrowUp")?1:-1)}function Y(n,e,t){var r=n&&l(n),i=t||r&&r.parentNode&&r.parentNode.firstChild,o=yn("increment");o.delta=e,i&&i.dispatchEvent(o)}function _(n,e,t,r){var i=nn(e,!0),o=f("span",n,e.getDate().toString());return o.dateObj=e,o.$i=r,o.setAttribute("aria-label",m.formatDate(e,m.config.ariaDateFormat)),-1===n.indexOf("hidden")&&0===k(e,m.now)&&(m.todayDateElem=o,o.classList.add("today"),o.setAttribute("aria-current","date")),i?(o.tabIndex=-1,kn(e)&&(o.classList.add("selected"),m.selectedDateElem=o,"range"===m.config.mode&&(u(o,"startRange",m.selectedDates[0]&&0===k(e,m.selectedDates[0],!0)),u(o,"endRange",m.selectedDates[1]&&0===k(e,m.selectedDates[1],!0)),"nextMonthDay"===n&&o.classList.add("inRange")))):o.classList.add("flatpickr-disabled"),"range"===m.config.mode&&function(n){return!("range"!==m.config.mode||m.selectedDates.length<2)&&k(n,m.selectedDates[0])>=0&&k(n,m.selectedDates[1])<=0}(e)&&!kn(e)&&o.classList.add("inRange"),m.weekNumbers&&1===m.config.showMonths&&"prevMonthDay"!==n&&r%7==6&&m.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+m.config.getWeek(e)+"</span>"),gn("onDayCreate",o),o}function J(n){n.focus(),"range"===m.config.mode&&on(n)}function L(n){for(var e=n>0?m.config.showMonths:-1,t=n>0?0:m.config.showMonths-1;t!=e;t+=n)for(var r=m.daysContainer.children[t],i=n>0?r.children.length:-1,o=n>0?0:r.children.length-1;o!=i;o+=n){var a=r.children[o];if(-1===a.className.indexOf("hidden")&&nn(a.dateObj))return a}}function W(n,e){var t=x(),r=en(t||document.body),i=void 0!==n?n:r?t:void 0!==m.selectedDateElem&&en(m.selectedDateElem)?m.selectedDateElem:void 0!==m.todayDateElem&&en(m.todayDateElem)?m.todayDateElem:L(e>0?1:-1);void 0===i?m._input.focus():r?function(n,e){for(var t=-1===n.className.indexOf("Month")?n.dateObj.getMonth():m.currentMonth,r=e>0?m.config.showMonths:-1,i=e>0?1:-1,o=t-m.currentMonth;o!=r;o+=i)for(var a=m.daysContainer.children[o],u=a.children.length,f=t-m.currentMonth===o?n.$i+e:e<0?a.children.length-1:0;f>=0&&f<u&&f!=(e>0?u:-1);f+=i){var c=a.children[f];if(-1===c.className.indexOf("hidden")&&nn(c.dateObj)&&Math.abs(n.$i-f)>=Math.abs(e))return J(c)}m.changeMonth(i),W(L(i),0)}(i,e):J(i)}function U(n,e){for(var t=(new Date(n,e,1).getDay()-m.l10n.firstDayOfWeek+7)%7,r=m.utils.getDaysInMonth((e-1+12)%12,n),i=m.utils.getDaysInMonth(e,n),o=window.document.createDocumentFragment(),a=m.config.showMonths>1,u=a?"prevMonthDay hidden":"prevMonthDay",c=a?"nextMonthDay hidden":"nextMonthDay",d=r+1-t,v=0;d<=r;d++,v++)o.appendChild(_("flatpickr-day "+u,new Date(n,e-1,d),0,v));for(d=1;d<=i;d++,v++)o.appendChild(_("flatpickr-day",new Date(n,e,d),0,v));for(var l=i+1;l<=42-t&&(1===m.config.showMonths||v%7!=0);l++,v++)o.appendChild(_("flatpickr-day "+c,new Date(n,e+1,l%i),0,v));var s=f("div","dayContainer");return s.appendChild(o),s}function K(){if(void 0!==m.daysContainer){c(m.daysContainer),m.weekNumbers&&c(m.weekNumbers);for(var n=document.createDocumentFragment(),e=0;e<m.config.showMonths;e++){var t=new Date(m.currentYear,m.currentMonth,1);t.setMonth(m.currentMonth+e),n.appendChild(U(t.getFullYear(),t.getMonth()))}m.daysContainer.appendChild(n),m.days=m.daysContainer.firstChild,"range"===m.config.mode&&1===m.selectedDates.length&&on()}}function B(){if(!(m.config.showMonths>1||"dropdown"!==m.config.monthSelectorType)){var n=function(n){return!(void 0!==m.config.minDate&&m.currentYear===m.config.minDate.getFullYear()&&n<m.config.minDate.getMonth()||void 0!==m.config.maxDate&&m.currentYear===m.config.maxDate.getFullYear()&&n>m.config.maxDate.getMonth())};m.monthsDropdownContainer.tabIndex=-1,m.monthsDropdownContainer.innerHTML="";for(var e=0;e<12;e++)if(n(e)){var t=f("option","flatpickr-monthDropdown-month");t.value=new Date(m.currentYear,e).getMonth().toString(),t.textContent=p(e,m.config.shorthandCurrentMonth,m.l10n),t.tabIndex=-1,m.currentMonth===e&&(t.selected=!0),m.monthsDropdownContainer.appendChild(t)}}}function G(){var n,e=f("div","flatpickr-month"),t=window.document.createDocumentFragment();m.config.showMonths>1||"static"===m.config.monthSelectorType?n=f("span","cur-month"):(m.monthsDropdownContainer=f("select","flatpickr-monthDropdown-months"),m.monthsDropdownContainer.setAttribute("aria-label",m.l10n.monthAriaLabel),P(m.monthsDropdownContainer,"change",(function(n){var e=l(n),t=parseInt(e.value,10);m.changeMonth(t-m.currentMonth),gn("onMonthChange")})),B(),n=m.monthsDropdownContainer);var r=v("cur-year",{tabindex:"-1"}),i=r.getElementsByTagName("input")[0];i.setAttribute("aria-label",m.l10n.yearAriaLabel),m.config.minDate&&i.setAttribute("min",m.config.minDate.getFullYear().toString()),m.config.maxDate&&(i.setAttribute("max",m.config.maxDate.getFullYear().toString()),i.disabled=!!m.config.minDate&&m.config.minDate.getFullYear()===m.config.maxDate.getFullYear());var o=f("div","flatpickr-current-month");return o.appendChild(n),o.appendChild(r),t.appendChild(o),e.appendChild(t),{container:e,yearElement:i,monthElement:n}}function Z(){c(m.monthNav),m.monthNav.appendChild(m.prevMonthNav),m.config.showMonths&&(m.yearElements=[],m.monthElements=[]);for(var n=m.config.showMonths;n--;){var e=G();m.yearElements.push(e.yearElement),m.monthElements.push(e.monthElement),m.monthNav.appendChild(e.container)}m.monthNav.appendChild(m.nextMonthNav)}function z(){m.weekdayContainer?c(m.weekdayContainer):m.weekdayContainer=f("div","flatpickr-weekdays");for(var n=m.config.showMonths;n--;){var e=f("div","flatpickr-weekdaycontainer");m.weekdayContainer.appendChild(e)}return Q(),m.weekdayContainer}function Q(){if(m.weekdayContainer){var n=m.l10n.firstDayOfWeek,e=C(m.l10n.weekdays.shorthand);n>0&&n<e.length&&(e=C(e.splice(n,e.length),e.splice(0,n)));for(var t=m.config.showMonths;t--;)m.weekdayContainer.children[t].innerHTML="\n <span class='flatpickr-weekday'>\n "+e.join("</span><span class='flatpickr-weekday'>")+"\n </span>\n "}}function V(n,e){void 0===e&&(e=!0);var t=e?n:n-m.currentMonth;t<0&&!0===m._hidePrevMonthArrow||t>0&&!0===m._hideNextMonthArrow||(m.currentMonth+=t,(m.currentMonth<0||m.currentMonth>11)&&(m.currentYear+=m.currentMonth>11?1:-1,m.currentMonth=(m.currentMonth+12)%12,gn("onYearChange"),B()),K(),gn("onMonthChange"),bn())}function $(n){return m.calendarContainer.contains(n)}function X(n){if(m.isOpen&&!m.config.inline){var e=l(n),t=$(e),r=!(e===m.input||e===m.altInput||m.element.contains(e)||n.path&&n.path.indexOf&&(~n.path.indexOf(m.input)||~n.path.indexOf(m.altInput))||t||$(n.relatedTarget)),i=!m.config.ignoredFocusElements.some((function(n){return n.contains(e)}));r&&i&&(m.config.allowInput&&m.setDate(m._input.value,!1,m.config.altInput?m.config.altFormat:m.config.dateFormat),void 0!==m.timeContainer&&void 0!==m.minuteElement&&void 0!==m.hourElement&&""!==m.input.value&&void 0!==m.input.value&&j(),m.close(),m.config&&"range"===m.config.mode&&1===m.selectedDates.length&&m.clear(!1))}}function q(n){if(!(!n||m.config.minDate&&n<m.config.minDate.getFullYear()||m.config.maxDate&&n>m.config.maxDate.getFullYear())){var e=m.currentYear!==n;m.currentYear=n||m.currentYear,m.config.maxDate&&m.currentYear===m.config.maxDate.getFullYear()?m.currentMonth=Math.min(m.config.maxDate.getMonth(),m.currentMonth):m.config.minDate&&m.currentYear===m.config.minDate.getFullYear()&&(m.currentMonth=Math.max(m.config.minDate.getMonth(),m.currentMonth)),e&&(m.redraw(),gn("onYearChange"),B())}}function nn(n,e){var t;void 0===e&&(e=!0);var r=m.parseDate(n,void 0,e);if(m.config.minDate&&r&&k(r,m.config.minDate,void 0!==e?e:!m.minDateHasTime)<0||m.config.maxDate&&r&&k(r,m.config.maxDate,void 0!==e?e:!m.maxDateHasTime)>0)return!1;if(!m.config.enable&&0===m.config.disable.length)return!0;if(void 0===r)return!1;for(var i=!!m.config.enable,o=null!==(t=m.config.enable)&&void 0!==t?t:m.config.disable,a=0,u=void 0;a<o.length;a++){if("function"==typeof(u=o[a])&&u(r))return i;if(u instanceof Date&&void 0!==r&&u.getTime()===r.getTime())return i;if("string"==typeof u){var f=m.parseDate(u,void 0,!0);return f&&f.getTime()===r.getTime()?i:!i}if("object"==typeof u&&void 0!==r&&u.from&&u.to&&r.getTime()>=u.from.getTime()&&r.getTime()<=u.to.getTime())return i}return!i}function en(n){return void 0!==m.daysContainer&&-1===n.className.indexOf("hidden")&&-1===n.className.indexOf("flatpickr-disabled")&&m.daysContainer.contains(n)}function tn(n){var e=n.target===m._input,t=m._input.value.trimEnd()!==Mn();!e||!t||n.relatedTarget&&$(n.relatedTarget)||m.setDate(m._input.value,!0,n.target===m.altInput?m.config.altFormat:m.config.dateFormat)}function rn(n){var e=l(n),t=m.config.wrap?s.contains(e):e===m._input,r=m.config.allowInput,i=m.isOpen&&(!r||!t),o=m.config.inline&&t&&!r;if(13===n.keyCode&&t){if(r)return m.setDate(m._input.value,!0,e===m.altInput?m.config.altFormat:m.config.dateFormat),m.close(),e.blur();m.open()}else if($(e)||i||o){var a=!!m.timeContainer&&m.timeContainer.contains(e);switch(n.keyCode){case 13:a?(n.preventDefault(),j(),ln()):sn(n);break;case 27:n.preventDefault(),ln();break;case 8:case 46:t&&!m.config.allowInput&&(n.preventDefault(),m.clear());break;case 37:case 39:if(a||t)m.hourElement&&m.hourElement.focus();else{n.preventDefault();var u=x();if(void 0!==m.daysContainer&&(!1===r||u&&en(u))){var f=39===n.keyCode?1:-1;n.ctrlKey?(n.stopPropagation(),V(f),W(L(1),0)):W(void 0,f)}}break;case 38:case 40:n.preventDefault();var c=40===n.keyCode?1:-1;m.daysContainer&&void 0!==e.$i||e===m.input||e===m.altInput?n.ctrlKey?(n.stopPropagation(),q(m.currentYear-c),W(L(1),0)):a||W(void 0,7*c):e===m.currentYearElement?q(m.currentYear-c):m.config.enableTime&&(!a&&m.hourElement&&m.hourElement.focus(),j(n),m._debouncedChange());break;case 9:if(a){var d=[m.hourElement,m.minuteElement,m.secondElement,m.amPM].concat(m.pluginElements).filter((function(n){return n})),v=d.indexOf(e);if(-1!==v){var p=d[v+(n.shiftKey?-1:1)];n.preventDefault(),(p||m._input).focus()}}else!m.config.noCalendar&&m.daysContainer&&m.daysContainer.contains(e)&&n.shiftKey&&(n.preventDefault(),m._input.focus())}}if(void 0!==m.amPM&&e===m.amPM)switch(n.key){case m.l10n.amPM[0].charAt(0):case m.l10n.amPM[0].charAt(0).toLowerCase():m.amPM.textContent=m.l10n.amPM[0],F(),Dn();break;case m.l10n.amPM[1].charAt(0):case m.l10n.amPM[1].charAt(0).toLowerCase():m.amPM.textContent=m.l10n.amPM[1],F(),Dn()}(t||$(e))&&gn("onKeyDown",n)}function on(n,e){if(void 0===e&&(e="flatpickr-day"),1===m.selectedDates.length&&(!n||n.classList.contains(e)&&!n.classList.contains("flatpickr-disabled"))){for(var t=n?n.dateObj.getTime():m.days.firstElementChild.dateObj.getTime(),r=m.parseDate(m.selectedDates[0],void 0,!0).getTime(),i=Math.min(t,m.selectedDates[0].getTime()),o=Math.max(t,m.selectedDates[0].getTime()),a=!1,u=0,f=0,c=i;c<o;c+=864e5)nn(new Date(c),!0)||(a=a||c>i&&c<o,c<r&&(!u||c>u)?u=c:c>r&&(!f||c<f)&&(f=c));Array.from(m.rContainer.querySelectorAll("*:nth-child(-n+"+m.config.showMonths+") > ."+e)).forEach((function(e){var i,o,c,d=e.dateObj.getTime(),v=u>0&&d<u||f>0&&d>f;if(v)return e.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach((function(n){e.classList.remove(n)}));a&&!v||(["startRange","inRange","endRange","notAllowed"].forEach((function(n){e.classList.remove(n)})),void 0!==n&&(n.classList.add(t<=m.selectedDates[0].getTime()?"startRange":"endRange"),r<t&&d===r?e.classList.add("startRange"):r>t&&d===r&&e.classList.add("endRange"),d>=u&&(0===f||d<=f)&&(o=r,c=t,(i=d)>Math.min(o,c)&&i<Math.max(o,c))&&e.classList.add("inRange")))}))}}function an(){!m.isOpen||m.config.static||m.config.inline||dn()}function un(n){return function(e){var t=m.config["_"+n+"Date"]=m.parseDate(e,m.config.dateFormat),r=m.config["_"+("min"===n?"max":"min")+"Date"];void 0!==t&&(m["min"===n?"minDateHasTime":"maxDateHasTime"]=t.getHours()>0||t.getMinutes()>0||t.getSeconds()>0),m.selectedDates&&(m.selectedDates=m.selectedDates.filter((function(n){return nn(n)})),m.selectedDates.length||"min"!==n||I(t),Dn()),m.daysContainer&&(vn(),void 0!==t?m.currentYearElement[n]=t.getFullYear().toString():m.currentYearElement.removeAttribute(n),m.currentYearElement.disabled=!!r&&void 0!==t&&r.getFullYear()===t.getFullYear())}}function fn(){return m.config.wrap?s.querySelector("[data-input]"):s}function cn(){"object"!=typeof m.config.locale&&void 0===O.l10ns[m.config.locale]&&m.config.errorHandler(new Error("flatpickr: invalid locale "+m.config.locale)),m.l10n=D(D({},O.l10ns.default),"object"==typeof m.config.locale?m.config.locale:"default"!==m.config.locale?O.l10ns[m.config.locale]:void 0),h.D="("+m.l10n.weekdays.shorthand.join("|")+")",h.l="("+m.l10n.weekdays.longhand.join("|")+")",h.M="("+m.l10n.months.shorthand.join("|")+")",h.F="("+m.l10n.months.longhand.join("|")+")",h.K="("+m.l10n.amPM[0]+"|"+m.l10n.amPM[1]+"|"+m.l10n.amPM[0].toLowerCase()+"|"+m.l10n.amPM[1].toLowerCase()+")",void 0===D(D({},w),JSON.parse(JSON.stringify(s.dataset||{}))).time_24hr&&void 0===O.defaultConfig.time_24hr&&(m.config.time_24hr=m.l10n.time_24hr),m.formatDate=g(m),m.parseDate=y({config:m.config,l10n:m.l10n})}function dn(n){if("function"!=typeof m.config.position){if(void 0!==m.calendarContainer){gn("onPreCalendarPosition");var e=n||m._positionElement,t=Array.prototype.reduce.call(m.calendarContainer.children,(function(n,e){return n+e.offsetHeight}),0),r=m.calendarContainer.offsetWidth,i=m.config.position.split(" "),o=i[0],a=i.length>1?i[1]:null,f=e.getBoundingClientRect(),c=window.innerHeight-f.bottom,d="above"===o||"below"!==o&&c<t&&f.top>t,v=window.pageYOffset+f.top+(d?-t-2:e.offsetHeight+2);if(u(m.calendarContainer,"arrowTop",!d),u(m.calendarContainer,"arrowBottom",d),!m.config.inline){var l=window.pageXOffset+f.left,s=!1,p=!1;"center"===a?(l-=(r-f.width)/2,s=!0):"right"===a&&(l-=r-f.width,p=!0),u(m.calendarContainer,"arrowLeft",!s&&!p),u(m.calendarContainer,"arrowCenter",s),u(m.calendarContainer,"arrowRight",p);var w=window.document.body.offsetWidth-(window.pageXOffset+f.right),h=l+r>window.document.body.offsetWidth,g=w+r>window.document.body.offsetWidth;if(u(m.calendarContainer,"rightMost",h),!m.config.static)if(m.calendarContainer.style.top=v+"px",h)if(g){var y=function(){for(var n=null,e=0;e<document.styleSheets.length;e++){var t=document.styleSheets[e];if(t.cssRules){n=t;break}}return null!=n?n:(r=document.createElement("style"),document.head.appendChild(r),r.sheet);var r}();if(void 0===y)return;var k=window.document.body.offsetWidth,b=Math.max(0,k/2-r/2),M=y.cssRules.length,D="{left:"+f.left+"px;right:auto;}";u(m.calendarContainer,"rightMost",!1),u(m.calendarContainer,"centerMost",!0),y.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+D,M),m.calendarContainer.style.left=b+"px",m.calendarContainer.style.right="auto"}else m.calendarContainer.style.left="auto",m.calendarContainer.style.right=w+"px";else m.calendarContainer.style.left=l+"px",m.calendarContainer.style.right="auto"}}}else m.config.position(m,n)}function vn(){m.config.noCalendar||m.isMobile||(B(),bn(),K())}function ln(){m._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(m.close,0):m.close()}function sn(n){n.preventDefault(),n.stopPropagation();var e=d(l(n),(function(n){return n.classList&&n.classList.contains("flatpickr-day")&&!n.classList.contains("flatpickr-disabled")&&!n.classList.contains("notAllowed")}));if(void 0!==e){var t=e,r=m.latestSelectedDateObj=new Date(t.dateObj.getTime()),i=(r.getMonth()<m.currentMonth||r.getMonth()>m.currentMonth+m.config.showMonths-1)&&"range"!==m.config.mode;if(m.selectedDateElem=t,"single"===m.config.mode)m.selectedDates=[r];else if("multiple"===m.config.mode){var o=kn(r);o?m.selectedDates.splice(parseInt(o),1):m.selectedDates.push(r)}else"range"===m.config.mode&&(2===m.selectedDates.length&&m.clear(!1,!1),m.latestSelectedDateObj=r,m.selectedDates.push(r),0!==k(r,m.selectedDates[0],!0)&&m.selectedDates.sort((function(n,e){return n.getTime()-e.getTime()})));if(F(),i){var a=m.currentYear!==r.getFullYear();m.currentYear=r.getFullYear(),m.currentMonth=r.getMonth(),a&&(gn("onYearChange"),B()),gn("onMonthChange")}bn(),K(),Dn(),i||"range"===m.config.mode||1!==m.config.showMonths?void 0!==m.selectedDateElem&&void 0===m.hourElement&&m.selectedDateElem&&m.selectedDateElem.focus():J(t),void 0!==m.hourElement&&void 0!==m.hourElement&&m.hourElement.focus(),m.config.closeOnSelect&&("single"===m.config.mode&&!m.config.enableTime||"range"===m.config.mode&&2===m.selectedDates.length&&!m.config.enableTime)&&ln(),N()}}m.parseDate=y({config:m.config,l10n:m.l10n}),m._handlers=[],m.pluginElements=[],m.loadedPlugins=[],m._bind=P,m._setHoursFromDate=I,m._positionCalendar=dn,m.changeMonth=V,m.changeYear=q,m.clear=function(n,e){if(void 0===n&&(n=!0),void 0===e&&(e=!0),m.input.value="",void 0!==m.altInput&&(m.altInput.value=""),void 0!==m.mobileInput&&(m.mobileInput.value=""),m.selectedDates=[],m.latestSelectedDateObj=void 0,!0===e&&(m.currentYear=m._initialDate.getFullYear(),m.currentMonth=m._initialDate.getMonth()),!0===m.config.enableTime){var t=M(m.config);T(t.hours,t.minutes,t.seconds)}m.redraw(),n&&gn("onChange")},m.close=function(){m.isOpen=!1,m.isMobile||(void 0!==m.calendarContainer&&m.calendarContainer.classList.remove("open"),void 0!==m._input&&m._input.classList.remove("active")),gn("onClose")},m.onMouseOver=on,m._createElement=f,m.createDay=_,m.destroy=function(){void 0!==m.config&&gn("onDestroy");for(var n=m._handlers.length;n--;)m._handlers[n].remove();if(m._handlers=[],m.mobileInput)m.mobileInput.parentNode&&m.mobileInput.parentNode.removeChild(m.mobileInput),m.mobileInput=void 0;else if(m.calendarContainer&&m.calendarContainer.parentNode)if(m.config.static&&m.calendarContainer.parentNode){var e=m.calendarContainer.parentNode;if(e.lastChild&&e.removeChild(e.lastChild),e.parentNode){for(;e.firstChild;)e.parentNode.insertBefore(e.firstChild,e);e.parentNode.removeChild(e)}}else m.calendarContainer.parentNode.removeChild(m.calendarContainer);m.altInput&&(m.input.type="text",m.altInput.parentNode&&m.altInput.parentNode.removeChild(m.altInput),delete m.altInput),m.input&&(m.input.type=m.input._type,m.input.classList.remove("flatpickr-input"),m.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(n){try{delete m[n]}catch(n){}}))},m.isEnabled=nn,m.jumpToDate=R,m.updateValue=Dn,m.open=function(n,e){if(void 0===e&&(e=m._positionElement),!0===m.isMobile){if(n){n.preventDefault();var t=l(n);t&&t.blur()}return void 0!==m.mobileInput&&(m.mobileInput.focus(),m.mobileInput.click()),void gn("onOpen")}if(!m._input.disabled&&!m.config.inline){var r=m.isOpen;m.isOpen=!0,r||(m.calendarContainer.classList.add("open"),m._input.classList.add("active"),gn("onOpen"),dn(e)),!0===m.config.enableTime&&!0===m.config.noCalendar&&(!1!==m.config.allowInput||void 0!==n&&m.timeContainer.contains(n.relatedTarget)||setTimeout((function(){return m.hourElement.select()}),50))}},m.redraw=vn,m.set=function(e,t){if(null!==e&&"object"==typeof e)for(var r in Object.assign(m.config,e),e)void 0!==pn[r]&&pn[r].forEach((function(n){return n()}));else m.config[e]=t,void 0!==pn[e]?pn[e].forEach((function(n){return n()})):n.indexOf(e)>-1&&(m.config[e]=a(t));m.redraw(),Dn(!0)},m.setDate=function(n,e,t){if(void 0===e&&(e=!1),void 0===t&&(t=m.config.dateFormat),0!==n&&!n||n instanceof Array&&0===n.length)return m.clear(e);wn(n,t),m.latestSelectedDateObj=m.selectedDates[m.selectedDates.length-1],m.redraw(),R(void 0,e),I(),0===m.selectedDates.length&&m.clear(!1),Dn(e),e&&gn("onChange")},m.toggle=function(n){if(!0===m.isOpen)return m.close();m.open(n)};var pn={locale:[cn,Q],showMonths:[Z,A,z],minDate:[R],maxDate:[R],positionElement:[mn],clickOpens:[function(){!0===m.config.clickOpens?(P(m._input,"focus",m.open),P(m._input,"click",m.open)):(m._input.removeEventListener("focus",m.open),m._input.removeEventListener("click",m.open))}]};function wn(n,e){var t=[];if(n instanceof Array)t=n.map((function(n){return m.parseDate(n,e)}));else if(n instanceof Date||"number"==typeof n)t=[m.parseDate(n,e)];else if("string"==typeof n)switch(m.config.mode){case"single":case"time":t=[m.parseDate(n,e)];break;case"multiple":t=n.split(m.config.conjunction).map((function(n){return m.parseDate(n,e)}));break;case"range":t=n.split(m.l10n.rangeSeparator).map((function(n){return m.parseDate(n,e)}))}else m.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(n)));m.selectedDates=m.config.allowInvalidPreload?t:t.filter((function(n){return n instanceof Date&&nn(n,!1)})),"range"===m.config.mode&&m.selectedDates.sort((function(n,e){return n.getTime()-e.getTime()}))}function hn(n){return n.slice().map((function(n){return"string"==typeof n||"number"==typeof n||n instanceof Date?m.parseDate(n,void 0,!0):n&&"object"==typeof n&&n.from&&n.to?{from:m.parseDate(n.from,void 0),to:m.parseDate(n.to,void 0)}:n})).filter((function(n){return n}))}function mn(){m._positionElement=m.config.positionElement||m._input}function gn(n,e){if(void 0!==m.config){var t=m.config[n];if(void 0!==t&&t.length>0)for(var r=0;t[r]&&r<t.length;r++)t[r](m.selectedDates,m.input.value,m,e);"onChange"===n&&(m.input.dispatchEvent(yn("change")),m.input.dispatchEvent(yn("input")))}}function yn(n){var e=document.createEvent("Event");return e.initEvent(n,!0,!0),e}function kn(n){for(var e=0;e<m.selectedDates.length;e++){var t=m.selectedDates[e];if(t instanceof Date&&0===k(t,n))return""+e}return!1}function bn(){m.config.noCalendar||m.isMobile||!m.monthNav||(m.yearElements.forEach((function(n,e){var t=new Date(m.currentYear,m.currentMonth,1);t.setMonth(m.currentMonth+e),m.config.showMonths>1||"static"===m.config.monthSelectorType?m.monthElements[e].textContent=p(t.getMonth(),m.config.shorthandCurrentMonth,m.l10n)+" ":m.monthsDropdownContainer.value=t.getMonth().toString(),n.value=t.getFullYear().toString()})),m._hidePrevMonthArrow=void 0!==m.config.minDate&&(m.currentYear===m.config.minDate.getFullYear()?m.currentMonth<=m.config.minDate.getMonth():m.currentYear<m.config.minDate.getFullYear()),m._hideNextMonthArrow=void 0!==m.config.maxDate&&(m.currentYear===m.config.maxDate.getFullYear()?m.currentMonth+1>m.config.maxDate.getMonth():m.currentYear>m.config.maxDate.getFullYear()))}function Mn(n){var e=n||(m.config.altInput?m.config.altFormat:m.config.dateFormat);return m.selectedDates.map((function(n){return m.formatDate(n,e)})).filter((function(n,e,t){return"range"!==m.config.mode||m.config.enableTime||t.indexOf(n)===e})).join("range"!==m.config.mode?m.config.conjunction:m.l10n.rangeSeparator)}function Dn(n){void 0===n&&(n=!0),void 0!==m.mobileInput&&m.mobileFormatStr&&(m.mobileInput.value=void 0!==m.latestSelectedDateObj?m.formatDate(m.latestSelectedDateObj,m.mobileFormatStr):""),m.input.value=Mn(m.config.dateFormat),void 0!==m.altInput&&(m.altInput.value=Mn(m.config.altFormat)),!1!==n&&gn("onValueUpdate")}function Cn(n){var e=l(n),t=m.prevMonthNav.contains(e),r=m.nextMonthNav.contains(e);t||r?V(t?-1:1):m.yearElements.indexOf(e)>=0?e.select():e.classList.contains("arrowUp")?m.changeYear(m.currentYear+1):e.classList.contains("arrowDown")&&m.changeYear(m.currentYear-1)}return function(){m.element=m.input=s,m.isOpen=!1,function(){var t=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],r=D(D({},JSON.parse(JSON.stringify(s.dataset||{}))),w),i={};m.config.parseDate=r.parseDate,m.config.formatDate=r.formatDate,Object.defineProperty(m.config,"enable",{get:function(){return m.config._enable},set:function(n){m.config._enable=hn(n)}}),Object.defineProperty(m.config,"disable",{get:function(){return m.config._disable},set:function(n){m.config._disable=hn(n)}});var o="time"===r.mode;r.dateFormat||!r.enableTime&&!o||(i.dateFormat=r.noCalendar||o?"H:i"+(r.enableSeconds?":S":""):(O.defaultConfig.dateFormat||e.dateFormat)+" H:i"+(r.enableSeconds?":S":"")),r.altInput&&(r.enableTime||o)&&!r.altFormat&&(i.altFormat=r.noCalendar||o?"h:i"+(r.enableSeconds?":S K":" K"):(O.defaultConfig.altFormat||e.altFormat)+" h:i"+(r.enableSeconds?":S":"")+" K"),Object.defineProperty(m.config,"minDate",{get:function(){return m.config._minDate},set:un("min")}),Object.defineProperty(m.config,"maxDate",{get:function(){return m.config._maxDate},set:un("max")});var u=function(n){return function(e){m.config["min"===n?"_minTime":"_maxTime"]=m.parseDate(e,"H:i:S")}};Object.defineProperty(m.config,"minTime",{get:function(){return m.config._minTime},set:u("min")}),Object.defineProperty(m.config,"maxTime",{get:function(){return m.config._maxTime},set:u("max")}),"time"===r.mode&&(m.config.noCalendar=!0,m.config.enableTime=!0),Object.assign(m.config,i,r);for(var f=0;f<t.length;f++)m.config[t[f]]=!0===m.config[t[f]]||"true"===m.config[t[f]];for(n.filter((function(n){return void 0!==m.config[n]})).forEach((function(n){m.config[n]=a(m.config[n]||[]).map(S)})),m.isMobile=!m.config.disableMobile&&!m.config.inline&&"single"===m.config.mode&&!m.config.disable.length&&!m.config.enable&&!m.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),f=0;f<m.config.plugins.length;f++){var c=m.config.plugins[f](m)||{};for(var d in c)n.indexOf(d)>-1?m.config[d]=a(c[d]).map(S).concat(m.config[d]):void 0===r[d]&&(m.config[d]=c[d])}r.altInputClass||(m.config.altInputClass=fn().className+" "+m.config.altInputClass),gn("onParseConfig")}(),cn(),m.input=fn(),m.input?(m.input._type=m.input.type,m.input.type="text",m.input.classList.add("flatpickr-input"),m._input=m.input,m.config.altInput&&(m.altInput=f(m.input.nodeName,m.config.altInputClass),m._input=m.altInput,m.altInput.placeholder=m.input.placeholder,m.altInput.disabled=m.input.disabled,m.altInput.required=m.input.required,m.altInput.tabIndex=m.input.tabIndex,m.altInput.type="text",m.input.setAttribute("type","hidden"),!m.config.static&&m.input.parentNode&&m.input.parentNode.insertBefore(m.altInput,m.input.nextSibling)),m.config.allowInput||m._input.setAttribute("readonly","readonly"),mn()):m.config.errorHandler(new Error("Invalid input element specified")),function(){m.selectedDates=[],m.now=m.parseDate(m.config.now)||new Date;var n=m.config.defaultDate||("INPUT"!==m.input.nodeName&&"TEXTAREA"!==m.input.nodeName||!m.input.placeholder||m.input.value!==m.input.placeholder?m.input.value:null);n&&wn(n,m.config.dateFormat),m._initialDate=m.selectedDates.length>0?m.selectedDates[0]:m.config.minDate&&m.config.minDate.getTime()>m.now.getTime()?m.config.minDate:m.config.maxDate&&m.config.maxDate.getTime()<m.now.getTime()?m.config.maxDate:m.now,m.currentYear=m._initialDate.getFullYear(),m.currentMonth=m._initialDate.getMonth(),m.selectedDates.length>0&&(m.latestSelectedDateObj=m.selectedDates[0]),void 0!==m.config.minTime&&(m.config.minTime=m.parseDate(m.config.minTime,"H:i")),void 0!==m.config.maxTime&&(m.config.maxTime=m.parseDate(m.config.maxTime,"H:i")),m.minDateHasTime=!!m.config.minDate&&(m.config.minDate.getHours()>0||m.config.minDate.getMinutes()>0||m.config.minDate.getSeconds()>0),m.maxDateHasTime=!!m.config.maxDate&&(m.config.maxDate.getHours()>0||m.config.maxDate.getMinutes()>0||m.config.maxDate.getSeconds()>0)}(),m.utils={getDaysInMonth:function(n,e){return void 0===n&&(n=m.currentMonth),void 0===e&&(e=m.currentYear),1===n&&(e%4==0&&e%100!=0||e%400==0)?29:m.l10n.daysInMonth[n]}},m.isMobile||function(){var n=window.document.createDocumentFragment();if(m.calendarContainer=f("div","flatpickr-calendar"),m.calendarContainer.tabIndex=-1,!m.config.noCalendar){if(n.appendChild((m.monthNav=f("div","flatpickr-months"),m.yearElements=[],m.monthElements=[],m.prevMonthNav=f("span","flatpickr-prev-month"),m.prevMonthNav.innerHTML=m.config.prevArrow,m.nextMonthNav=f("span","flatpickr-next-month"),m.nextMonthNav.innerHTML=m.config.nextArrow,Z(),Object.defineProperty(m,"_hidePrevMonthArrow",{get:function(){return m.__hidePrevMonthArrow},set:function(n){m.__hidePrevMonthArrow!==n&&(u(m.prevMonthNav,"flatpickr-disabled",n),m.__hidePrevMonthArrow=n)}}),Object.defineProperty(m,"_hideNextMonthArrow",{get:function(){return m.__hideNextMonthArrow},set:function(n){m.__hideNextMonthArrow!==n&&(u(m.nextMonthNav,"flatpickr-disabled",n),m.__hideNextMonthArrow=n)}}),m.currentYearElement=m.yearElements[0],bn(),m.monthNav)),m.innerContainer=f("div","flatpickr-innerContainer"),m.config.weekNumbers){var e=function(){m.calendarContainer.classList.add("hasWeeks");var n=f("div","flatpickr-weekwrapper");n.appendChild(f("span","flatpickr-weekday",m.l10n.weekAbbreviation));var e=f("div","flatpickr-weeks");return n.appendChild(e),{weekWrapper:n,weekNumbers:e}}(),t=e.weekWrapper,o=e.weekNumbers;m.innerContainer.appendChild(t),m.weekNumbers=o,m.weekWrapper=t}m.rContainer=f("div","flatpickr-rContainer"),m.rContainer.appendChild(z()),m.daysContainer||(m.daysContainer=f("div","flatpickr-days"),m.daysContainer.tabIndex=-1),K(),m.rContainer.appendChild(m.daysContainer),m.innerContainer.appendChild(m.rContainer),n.appendChild(m.innerContainer)}m.config.enableTime&&n.appendChild(function(){m.calendarContainer.classList.add("hasTime"),m.config.noCalendar&&m.calendarContainer.classList.add("noCalendar");var n=M(m.config);m.timeContainer=f("div","flatpickr-time"),m.timeContainer.tabIndex=-1;var e=f("span","flatpickr-time-separator",":"),t=v("flatpickr-hour",{"aria-label":m.l10n.hourAriaLabel});m.hourElement=t.getElementsByTagName("input")[0];var o=v("flatpickr-minute",{"aria-label":m.l10n.minuteAriaLabel});if(m.minuteElement=o.getElementsByTagName("input")[0],m.hourElement.tabIndex=m.minuteElement.tabIndex=-1,m.hourElement.value=r(m.latestSelectedDateObj?m.latestSelectedDateObj.getHours():m.config.time_24hr?n.hours:function(n){switch(n%24){case 0:case 12:return 12;default:return n%12}}(n.hours)),m.minuteElement.value=r(m.latestSelectedDateObj?m.latestSelectedDateObj.getMinutes():n.minutes),m.hourElement.setAttribute("step",m.config.hourIncrement.toString()),m.minuteElement.setAttribute("step",m.config.minuteIncrement.toString()),m.hourElement.setAttribute("min",m.config.time_24hr?"0":"1"),m.hourElement.setAttribute("max",m.config.time_24hr?"23":"12"),m.hourElement.setAttribute("maxlength","2"),m.minuteElement.setAttribute("min","0"),m.minuteElement.setAttribute("max","59"),m.minuteElement.setAttribute("maxlength","2"),m.timeContainer.appendChild(t),m.timeContainer.appendChild(e),m.timeContainer.appendChild(o),m.config.time_24hr&&m.timeContainer.classList.add("time24hr"),m.config.enableSeconds){m.timeContainer.classList.add("hasSeconds");var a=v("flatpickr-second");m.secondElement=a.getElementsByTagName("input")[0],m.secondElement.value=r(m.latestSelectedDateObj?m.latestSelectedDateObj.getSeconds():n.seconds),m.secondElement.setAttribute("step",m.minuteElement.getAttribute("step")),m.secondElement.setAttribute("min","0"),m.secondElement.setAttribute("max","59"),m.secondElement.setAttribute("maxlength","2"),m.timeContainer.appendChild(f("span","flatpickr-time-separator",":")),m.timeContainer.appendChild(a)}return m.config.time_24hr||(m.amPM=f("span","flatpickr-am-pm",m.l10n.amPM[i((m.latestSelectedDateObj?m.hourElement.value:m.config.defaultHour)>11)]),m.amPM.title=m.l10n.toggleTitle,m.amPM.tabIndex=-1,m.timeContainer.appendChild(m.amPM)),m.timeContainer}()),u(m.calendarContainer,"rangeMode","range"===m.config.mode),u(m.calendarContainer,"animate",!0===m.config.animate),u(m.calendarContainer,"multiMonth",m.config.showMonths>1),m.calendarContainer.appendChild(n);var a=void 0!==m.config.appendTo&&void 0!==m.config.appendTo.nodeType;if((m.config.inline||m.config.static)&&(m.calendarContainer.classList.add(m.config.inline?"inline":"static"),m.config.inline&&(!a&&m.element.parentNode?m.element.parentNode.insertBefore(m.calendarContainer,m._input.nextSibling):void 0!==m.config.appendTo&&m.config.appendTo.appendChild(m.calendarContainer)),m.config.static)){var c=f("div","flatpickr-wrapper");m.element.parentNode&&m.element.parentNode.insertBefore(c,m.element),c.appendChild(m.element),m.altInput&&c.appendChild(m.altInput),c.appendChild(m.calendarContainer)}m.config.static||m.config.inline||(void 0!==m.config.appendTo?m.config.appendTo:window.document.body).appendChild(m.calendarContainer)}(),function(){if(m.config.wrap&&["open","close","toggle","clear"].forEach((function(n){Array.prototype.forEach.call(m.element.querySelectorAll("[data-"+n+"]"),(function(e){return P(e,"click",m[n])}))})),m.isMobile)!function(){var n=m.config.enableTime?m.config.noCalendar?"time":"datetime-local":"date";m.mobileInput=f("input",m.input.className+" flatpickr-mobile"),m.mobileInput.tabIndex=1,m.mobileInput.type=n,m.mobileInput.disabled=m.input.disabled,m.mobileInput.required=m.input.required,m.mobileInput.placeholder=m.input.placeholder,m.mobileFormatStr="datetime-local"===n?"Y-m-d\\TH:i:S":"date"===n?"Y-m-d":"H:i:S",m.selectedDates.length>0&&(m.mobileInput.defaultValue=m.mobileInput.value=m.formatDate(m.selectedDates[0],m.mobileFormatStr)),m.config.minDate&&(m.mobileInput.min=m.formatDate(m.config.minDate,"Y-m-d")),m.config.maxDate&&(m.mobileInput.max=m.formatDate(m.config.maxDate,"Y-m-d")),m.input.getAttribute("step")&&(m.mobileInput.step=String(m.input.getAttribute("step"))),m.input.type="hidden",void 0!==m.altInput&&(m.altInput.type="hidden");try{m.input.parentNode&&m.input.parentNode.insertBefore(m.mobileInput,m.input.nextSibling)}catch(n){}P(m.mobileInput,"change",(function(n){m.setDate(l(n).value,!1,m.mobileFormatStr),gn("onChange"),gn("onClose")}))}();else{var n=o(an,50);if(m._debouncedChange=o(N,300),m.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&P(m.daysContainer,"mouseover",(function(n){"range"===m.config.mode&&on(l(n))})),P(m._input,"keydown",rn),void 0!==m.calendarContainer&&P(m.calendarContainer,"keydown",rn),m.config.inline||m.config.static||P(window,"resize",n),void 0!==window.ontouchstart?P(window.document,"touchstart",X):P(window.document,"mousedown",X),P(window.document,"focus",X,{capture:!0}),!0===m.config.clickOpens&&(P(m._input,"focus",m.open),P(m._input,"click",m.open)),void 0!==m.daysContainer&&(P(m.monthNav,"click",Cn),P(m.monthNav,["keyup","increment"],E),P(m.daysContainer,"click",sn)),void 0!==m.timeContainer&&void 0!==m.minuteElement&&void 0!==m.hourElement){P(m.timeContainer,["increment"],j),P(m.timeContainer,"blur",j,{capture:!0}),P(m.timeContainer,"click",H),P([m.hourElement,m.minuteElement],["focus","click"],(function(n){return l(n).select()})),void 0!==m.secondElement&&P(m.secondElement,"focus",(function(){return m.secondElement&&m.secondElement.select()})),void 0!==m.amPM&&P(m.amPM,"click",(function(n){j(n)}))}m.config.allowInput&&P(m._input,"blur",tn)}}(),(m.selectedDates.length||m.config.noCalendar)&&(m.config.enableTime&&I(m.config.noCalendar?m.latestSelectedDateObj:void 0),Dn(!1)),A();var t=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!m.isMobile&&t&&dn(),gn("onReady")}(),m}function S(n,e){for(var t=Array.prototype.slice.call(n).filter((function(n){return n instanceof HTMLElement})),r=[],i=0;i<t.length;i++){var o=t[i];try{if(null!==o.getAttribute("data-fp-omit"))continue;void 0!==o._flatpickr&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=x(o,e||{}),r.push(o._flatpickr)}catch(n){console.error(n)}}return 1===r.length?r[0]:r}"undefined"!=typeof HTMLElement&&"undefined"!=typeof HTMLCollection&&"undefined"!=typeof NodeList&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(n){return S(this,n)},HTMLElement.prototype.flatpickr=function(n){return S([this],n)});var O=function(n,e){return"string"==typeof n?S(window.document.querySelectorAll(n),e):n instanceof Node?S([n],e):S(n,e)};O.defaultConfig={},O.l10ns={en:D({},t),default:D({},t)},O.localize=function(n){O.l10ns.default=D(D({},O.l10ns.default),n)},O.setDefaults=function(n){O.defaultConfig=D(D({},O.defaultConfig),n)},O.parseDate=y({}),O.formatDate=g({}),O.compareDates=k,"undefined"!=typeof jQuery&&void 0!==jQuery.fn&&(jQuery.fn.flatpickr=function(n){return S(this,n)}),Date.prototype.fp_incr=function(n){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof n?parseInt(n,10):n))},"undefined"!=typeof window&&(window.flatpickr=O);export{O as default}
|