react-asc 25.12.1 → 25.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
2
- import React, { useEffect, useRef, useState, useMemo, createContext, useContext, Component, Fragment as Fragment$2, createRef, cloneElement } from 'react';
2
+ import React, { useEffect, useRef, useState, useMemo, createContext, useContext, forwardRef, useCallback, useImperativeHandle, Fragment as Fragment$2, Component, createRef, cloneElement } from 'react';
3
3
  import reactDom, { createPortal } from 'react-dom';
4
4
  import { createPopper } from '@popperjs/core';
5
5
  import saveAs from 'file-saver';
@@ -10,7 +10,8 @@ var COLOR;
10
10
  COLOR["primary"] = "primary";
11
11
  COLOR["accent"] = "accent";
12
12
  COLOR["secondary"] = "secondary";
13
- COLOR["danger"] = "danger";
13
+ COLOR["success"] = "success";
14
+ COLOR["error"] = "error";
14
15
  COLOR["light"] = "light";
15
16
  COLOR["dark"] = "dark";
16
17
  })(COLOR || (COLOR = {}));
@@ -960,51 +961,69 @@ const CssTransition = (props) => {
960
961
  jsx("div", { ref: transitionConainter, className: getCssClasses(), children: children }) }));
961
962
  };
962
963
 
963
- /** @license React v16.13.1
964
- * react-is.production.min.js
965
- *
966
- * Copyright (c) Facebook, Inc. and its affiliates.
964
+ /**
965
+ * Copyright (c) 2013-present, Facebook, Inc.
967
966
  *
968
967
  * This source code is licensed under the MIT license found in the
969
968
  * LICENSE file in the root directory of this source tree.
970
969
  */
971
970
 
972
- var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
973
- Symbol.for("react.suspense_list"):60120,r$1=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
974
- function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r$1:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}var AsyncMode=l;var ConcurrentMode=m;var ContextConsumer=k;var ContextProvider=h;var Element=c;var ForwardRef=n;var Fragment=e;var Lazy=t;var Memo=r$1;var Portal=d;
975
- var Profiler=g;var StrictMode=f;var Suspense=p;var isAsyncMode=function(a){return A(a)||z(a)===l};var isConcurrentMode=A;var isContextConsumer=function(a){return z(a)===k};var isContextProvider=function(a){return z(a)===h};var isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};var isForwardRef=function(a){return z(a)===n};var isFragment=function(a){return z(a)===e};var isLazy=function(a){return z(a)===t};
976
- var isMemo=function(a){return z(a)===r$1};var isPortal=function(a){return z(a)===d};var isProfiler=function(a){return z(a)===g};var isStrictMode=function(a){return z(a)===f};var isSuspense=function(a){return z(a)===p};
977
- var isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r$1||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};var typeOf=z;
978
971
 
979
- var reactIs_production_min = {
980
- AsyncMode: AsyncMode,
981
- ConcurrentMode: ConcurrentMode,
982
- ContextConsumer: ContextConsumer,
983
- ContextProvider: ContextProvider,
984
- Element: Element,
985
- ForwardRef: ForwardRef,
986
- Fragment: Fragment,
987
- Lazy: Lazy,
988
- Memo: Memo,
989
- Portal: Portal,
990
- Profiler: Profiler,
991
- StrictMode: StrictMode,
992
- Suspense: Suspense,
993
- isAsyncMode: isAsyncMode,
994
- isConcurrentMode: isConcurrentMode,
995
- isContextConsumer: isContextConsumer,
996
- isContextProvider: isContextProvider,
997
- isElement: isElement,
998
- isForwardRef: isForwardRef,
999
- isFragment: isFragment,
1000
- isLazy: isLazy,
1001
- isMemo: isMemo,
1002
- isPortal: isPortal,
1003
- isProfiler: isProfiler,
1004
- isStrictMode: isStrictMode,
1005
- isSuspense: isSuspense,
1006
- isValidElementType: isValidElementType,
1007
- typeOf: typeOf
972
+ var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
973
+
974
+ var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
975
+
976
+ function emptyFunction() {}
977
+ function emptyFunctionWithReset() {}
978
+ emptyFunctionWithReset.resetWarningCache = emptyFunction;
979
+
980
+ var factoryWithThrowingShims = function() {
981
+ function shim(props, propName, componentName, location, propFullName, secret) {
982
+ if (secret === ReactPropTypesSecret_1) {
983
+ // It is still safe when called from React.
984
+ return;
985
+ }
986
+ var err = new Error(
987
+ 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
988
+ 'Use PropTypes.checkPropTypes() to call them. ' +
989
+ 'Read more at http://fb.me/use-check-prop-types'
990
+ );
991
+ err.name = 'Invariant Violation';
992
+ throw err;
993
+ } shim.isRequired = shim;
994
+ function getShim() {
995
+ return shim;
996
+ } // Important!
997
+ // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
998
+ var ReactPropTypes = {
999
+ array: shim,
1000
+ bigint: shim,
1001
+ bool: shim,
1002
+ func: shim,
1003
+ number: shim,
1004
+ object: shim,
1005
+ string: shim,
1006
+ symbol: shim,
1007
+
1008
+ any: shim,
1009
+ arrayOf: getShim,
1010
+ element: shim,
1011
+ elementType: shim,
1012
+ instanceOf: getShim,
1013
+ node: shim,
1014
+ objectOf: getShim,
1015
+ oneOf: getShim,
1016
+ oneOfType: getShim,
1017
+ shape: getShim,
1018
+ exact: getShim,
1019
+
1020
+ checkPropTypes: emptyFunctionWithReset,
1021
+ resetWarningCache: emptyFunction
1022
+ };
1023
+
1024
+ ReactPropTypes.PropTypes = ReactPropTypes;
1025
+
1026
+ return ReactPropTypes;
1008
1027
  };
1009
1028
 
1010
1029
  var reactIs_development = createCommonjsModule(function (module, exports) {
@@ -1208,6 +1227,53 @@ reactIs_development.isSuspense;
1208
1227
  reactIs_development.isValidElementType;
1209
1228
  reactIs_development.typeOf;
1210
1229
 
1230
+ /** @license React v16.13.1
1231
+ * react-is.production.min.js
1232
+ *
1233
+ * Copyright (c) Facebook, Inc. and its affiliates.
1234
+ *
1235
+ * This source code is licensed under the MIT license found in the
1236
+ * LICENSE file in the root directory of this source tree.
1237
+ */
1238
+
1239
+ var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
1240
+ Symbol.for("react.suspense_list"):60120,r$1=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
1241
+ function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r$1:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}var AsyncMode=l;var ConcurrentMode=m;var ContextConsumer=k;var ContextProvider=h;var Element=c;var ForwardRef=n;var Fragment=e;var Lazy=t;var Memo=r$1;var Portal=d;
1242
+ var Profiler=g;var StrictMode=f;var Suspense=p;var isAsyncMode=function(a){return A(a)||z(a)===l};var isConcurrentMode=A;var isContextConsumer=function(a){return z(a)===k};var isContextProvider=function(a){return z(a)===h};var isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};var isForwardRef=function(a){return z(a)===n};var isFragment=function(a){return z(a)===e};var isLazy=function(a){return z(a)===t};
1243
+ var isMemo=function(a){return z(a)===r$1};var isPortal=function(a){return z(a)===d};var isProfiler=function(a){return z(a)===g};var isStrictMode=function(a){return z(a)===f};var isSuspense=function(a){return z(a)===p};
1244
+ var isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r$1||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};var typeOf=z;
1245
+
1246
+ var reactIs_production_min = {
1247
+ AsyncMode: AsyncMode,
1248
+ ConcurrentMode: ConcurrentMode,
1249
+ ContextConsumer: ContextConsumer,
1250
+ ContextProvider: ContextProvider,
1251
+ Element: Element,
1252
+ ForwardRef: ForwardRef,
1253
+ Fragment: Fragment,
1254
+ Lazy: Lazy,
1255
+ Memo: Memo,
1256
+ Portal: Portal,
1257
+ Profiler: Profiler,
1258
+ StrictMode: StrictMode,
1259
+ Suspense: Suspense,
1260
+ isAsyncMode: isAsyncMode,
1261
+ isConcurrentMode: isConcurrentMode,
1262
+ isContextConsumer: isContextConsumer,
1263
+ isContextProvider: isContextProvider,
1264
+ isElement: isElement,
1265
+ isForwardRef: isForwardRef,
1266
+ isFragment: isFragment,
1267
+ isLazy: isLazy,
1268
+ isMemo: isMemo,
1269
+ isPortal: isPortal,
1270
+ isProfiler: isProfiler,
1271
+ isStrictMode: isStrictMode,
1272
+ isSuspense: isSuspense,
1273
+ isValidElementType: isValidElementType,
1274
+ typeOf: typeOf
1275
+ };
1276
+
1211
1277
  var reactIs = createCommonjsModule(function (module) {
1212
1278
 
1213
1279
  if (process.env.NODE_ENV === 'production') {
@@ -1307,18 +1373,6 @@ var objectAssign = shouldUseNative() ? Object.assign : function (target, source)
1307
1373
  return to;
1308
1374
  };
1309
1375
 
1310
- /**
1311
- * Copyright (c) 2013-present, Facebook, Inc.
1312
- *
1313
- * This source code is licensed under the MIT license found in the
1314
- * LICENSE file in the root directory of this source tree.
1315
- */
1316
-
1317
-
1318
- var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
1319
-
1320
- var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
1321
-
1322
1376
  var has$1 = Function.call.bind(Object.prototype.hasOwnProperty);
1323
1377
 
1324
1378
  var printWarning$1 = function() {};
@@ -2011,59 +2065,6 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
2011
2065
  return ReactPropTypes;
2012
2066
  };
2013
2067
 
2014
- function emptyFunction() {}
2015
- function emptyFunctionWithReset() {}
2016
- emptyFunctionWithReset.resetWarningCache = emptyFunction;
2017
-
2018
- var factoryWithThrowingShims = function() {
2019
- function shim(props, propName, componentName, location, propFullName, secret) {
2020
- if (secret === ReactPropTypesSecret_1) {
2021
- // It is still safe when called from React.
2022
- return;
2023
- }
2024
- var err = new Error(
2025
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
2026
- 'Use PropTypes.checkPropTypes() to call them. ' +
2027
- 'Read more at http://fb.me/use-check-prop-types'
2028
- );
2029
- err.name = 'Invariant Violation';
2030
- throw err;
2031
- } shim.isRequired = shim;
2032
- function getShim() {
2033
- return shim;
2034
- } // Important!
2035
- // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
2036
- var ReactPropTypes = {
2037
- array: shim,
2038
- bigint: shim,
2039
- bool: shim,
2040
- func: shim,
2041
- number: shim,
2042
- object: shim,
2043
- string: shim,
2044
- symbol: shim,
2045
-
2046
- any: shim,
2047
- arrayOf: getShim,
2048
- element: shim,
2049
- elementType: shim,
2050
- instanceOf: getShim,
2051
- node: shim,
2052
- objectOf: getShim,
2053
- oneOf: getShim,
2054
- oneOfType: getShim,
2055
- shape: getShim,
2056
- exact: getShim,
2057
-
2058
- checkPropTypes: emptyFunctionWithReset,
2059
- resetWarningCache: emptyFunction
2060
- };
2061
-
2062
- ReactPropTypes.PropTypes = ReactPropTypes;
2063
-
2064
- return ReactPropTypes;
2065
- };
2066
-
2067
2068
  var propTypes = createCommonjsModule(function (module) {
2068
2069
  /**
2069
2070
  * Copyright (c) 2013-present, Facebook, Inc.
@@ -2772,29 +2773,60 @@ var memoize$1 = lodash_memoize;
2772
2773
  function resolver(options) {
2773
2774
  return JSON.stringify(options);
2774
2775
  }
2775
- function uniqDefined(arr) {
2776
- return arr.filter(function (el, index) { return el && arr.indexOf(el) === index; });
2776
+ function isString(el) {
2777
+ return typeof el === 'string';
2778
+ }
2779
+ function isUnique(el, index, arr) {
2780
+ return arr.indexOf(el) === index;
2777
2781
  }
2778
2782
  function isAllLowerCase(el) {
2779
2783
  return el.toLowerCase() === el;
2780
2784
  }
2781
- function normalizeLocale(el) {
2782
- if (!el || el.indexOf('-') === -1 || !isAllLowerCase(el)) {
2783
- return el;
2785
+ function fixCommas(el) {
2786
+ return el.indexOf(',') === -1 ? el : el.split(',');
2787
+ }
2788
+ function normalizeLocale(locale) {
2789
+ if (!locale) {
2790
+ return locale;
2791
+ }
2792
+ if (locale === 'C' || locale === 'posix' || locale === 'POSIX') {
2793
+ return 'en-US';
2794
+ }
2795
+ // If there's a dot (.) in the locale, it's likely in the format of "en-US.UTF-8", so we only take the first part
2796
+ if (locale.indexOf('.') !== -1) {
2797
+ var _a = locale.split('.')[0], actualLocale = _a === void 0 ? '' : _a;
2798
+ return normalizeLocale(actualLocale);
2784
2799
  }
2785
- var _a = el.split('-'), _b = _a[0], splitEl1 = _b === void 0 ? '' : _b, _c = _a[1], splitEl2 = _c === void 0 ? '' : _c;
2800
+ // If there's an at sign (@) in the locale, it's likely in the format of "en-US@posix", so we only take the first part
2801
+ if (locale.indexOf('@') !== -1) {
2802
+ var _b = locale.split('@')[0], actualLocale = _b === void 0 ? '' : _b;
2803
+ return normalizeLocale(actualLocale);
2804
+ }
2805
+ // If there's a dash (-) in the locale and it's not all lower case, it's already in the format of "en-US", so we return it
2806
+ if (locale.indexOf('-') === -1 || !isAllLowerCase(locale)) {
2807
+ return locale;
2808
+ }
2809
+ var _c = locale.split('-'), splitEl1 = _c[0], _d = _c[1], splitEl2 = _d === void 0 ? '' : _d;
2786
2810
  return "".concat(splitEl1, "-").concat(splitEl2.toUpperCase());
2787
2811
  }
2788
2812
  function getUserLocalesInternal(_a) {
2789
2813
  var _b = _a === void 0 ? {} : _a, _c = _b.useFallbackLocale, useFallbackLocale = _c === void 0 ? true : _c, _d = _b.fallbackLocale, fallbackLocale = _d === void 0 ? 'en-US' : _d;
2790
2814
  var languageList = [];
2791
2815
  if (typeof navigator !== 'undefined') {
2792
- languageList = languageList.concat(navigator.languages, navigator.language);
2816
+ var rawLanguages = navigator.languages || [];
2817
+ var languages = [];
2818
+ for (var _i = 0, rawLanguages_1 = rawLanguages; _i < rawLanguages_1.length; _i++) {
2819
+ var rawLanguagesItem = rawLanguages_1[_i];
2820
+ languages = languages.concat(fixCommas(rawLanguagesItem));
2821
+ }
2822
+ var rawLanguage = navigator.language;
2823
+ var language = rawLanguage ? fixCommas(rawLanguage) : rawLanguage;
2824
+ languageList = languageList.concat(languages, language);
2793
2825
  }
2794
2826
  if (useFallbackLocale) {
2795
2827
  languageList.push(fallbackLocale);
2796
2828
  }
2797
- return uniqDefined(languageList).map(normalizeLocale);
2829
+ return languageList.filter(isString).map(normalizeLocale).filter(isUnique);
2798
2830
  }
2799
2831
  var getUserLocales = memoize$1(getUserLocalesInternal, resolver);
2800
2832
  function getUserLocaleInternal(options) {
@@ -3150,15 +3182,21 @@ function getDaysInMonth(date) {
3150
3182
  return getDate(getMonthEnd(date));
3151
3183
  }
3152
3184
 
3153
- var _a;
3185
+ var _a$1;
3154
3186
  var CALENDAR_TYPES = {
3187
+ GREGORY: 'gregory',
3188
+ HEBREW: 'hebrew',
3189
+ ISLAMIC: 'islamic',
3190
+ ISO_8601: 'iso8601',
3191
+ };
3192
+ var DEPRECATED_CALENDAR_TYPES = {
3155
3193
  ARABIC: 'Arabic',
3156
3194
  HEBREW: 'Hebrew',
3157
3195
  ISO_8601: 'ISO 8601',
3158
3196
  US: 'US',
3159
3197
  };
3160
- var CALENDAR_TYPE_LOCALES = (_a = {},
3161
- _a[CALENDAR_TYPES.US] = [
3198
+ var CALENDAR_TYPE_LOCALES = (_a$1 = {},
3199
+ _a$1[CALENDAR_TYPES.GREGORY] = [
3162
3200
  'en-CA',
3163
3201
  'en-US',
3164
3202
  'es-AR',
@@ -3179,7 +3217,8 @@ var CALENDAR_TYPE_LOCALES = (_a = {},
3179
3217
  'es-VE',
3180
3218
  'pt-BR',
3181
3219
  ],
3182
- _a[CALENDAR_TYPES.ARABIC] = [
3220
+ _a$1[CALENDAR_TYPES.HEBREW] = ['he', 'he-IL'],
3221
+ _a$1[CALENDAR_TYPES.ISLAMIC] = [
3183
3222
  // ar-LB, ar-MA intentionally missing
3184
3223
  'ar',
3185
3224
  'ar-AE',
@@ -3201,8 +3240,7 @@ var CALENDAR_TYPE_LOCALES = (_a = {},
3201
3240
  'ps',
3202
3241
  'ps-AR',
3203
3242
  ],
3204
- _a[CALENDAR_TYPES.HEBREW] = ['he', 'he-IL'],
3205
- _a);
3243
+ _a$1);
3206
3244
  var WEEKDAYS = [0, 1, 2, 3, 4, 5, 6];
3207
3245
 
3208
3246
  var formatterCache = new Map();
@@ -3265,7 +3303,7 @@ var SATURDAY = WEEKDAYS[6];
3265
3303
  /**
3266
3304
  * Gets day of the week of a given date.
3267
3305
  * @param {Date} date Date.
3268
- * @param {CalendarType} [calendarType="ISO 8601"] Calendar type.
3306
+ * @param {CalendarType} [calendarType="iso8601"] Calendar type.
3269
3307
  * @returns {number} Day of the week.
3270
3308
  */
3271
3309
  function getDayOfWeek(date, calendarType) {
@@ -3275,10 +3313,10 @@ function getDayOfWeek(date, calendarType) {
3275
3313
  case CALENDAR_TYPES.ISO_8601:
3276
3314
  // Shifts days of the week so that Monday is 0, Sunday is 6
3277
3315
  return (weekday + 6) % 7;
3278
- case CALENDAR_TYPES.ARABIC:
3316
+ case CALENDAR_TYPES.ISLAMIC:
3279
3317
  return (weekday + 1) % 7;
3280
3318
  case CALENDAR_TYPES.HEBREW:
3281
- case CALENDAR_TYPES.US:
3319
+ case CALENDAR_TYPES.GREGORY:
3282
3320
  return weekday;
3283
3321
  default:
3284
3322
  throw new Error('Unsupported calendar type.');
@@ -3315,7 +3353,7 @@ function getBeginOfDecadeYear(date) {
3315
3353
  * Returns the beginning of a given week.
3316
3354
  *
3317
3355
  * @param {Date} date Date.
3318
- * @param {CalendarType} [calendarType="ISO 8601"] Calendar type.
3356
+ * @param {CalendarType} [calendarType="iso8601"] Calendar type.
3319
3357
  * @returns {Date} Beginning of a given week.
3320
3358
  */
3321
3359
  function getBeginOfWeek(date, calendarType) {
@@ -3331,12 +3369,12 @@ function getBeginOfWeek(date, calendarType) {
3331
3369
  * In US calendar week 1 is the one with January 1.
3332
3370
  *
3333
3371
  * @param {Date} date Date.
3334
- * @param {CalendarType} [calendarType="ISO 8601"] Calendar type.
3372
+ * @param {CalendarType} [calendarType="iso8601"] Calendar type.
3335
3373
  * @returns {number} Week number.
3336
3374
  */
3337
3375
  function getWeekNumber(date, calendarType) {
3338
3376
  if (calendarType === void 0) { calendarType = CALENDAR_TYPES.ISO_8601; }
3339
- var calendarTypeForWeekNumber = calendarType === CALENDAR_TYPES.US ? CALENDAR_TYPES.US : CALENDAR_TYPES.ISO_8601;
3377
+ var calendarTypeForWeekNumber = calendarType === CALENDAR_TYPES.GREGORY ? CALENDAR_TYPES.GREGORY : CALENDAR_TYPES.ISO_8601;
3340
3378
  var beginOfWeek = getBeginOfWeek(date, calendarType);
3341
3379
  var year = getYear(date) + 1;
3342
3380
  var dayInWeekOne;
@@ -3579,117 +3617,24 @@ function isCurrentDayOfWeek(date) {
3579
3617
  * Returns a boolean determining whether a given date is a weekend day.
3580
3618
  *
3581
3619
  * @param {Date} date Date.
3582
- * @param {CalendarType} [calendarType="ISO 8601"] Calendar type.
3620
+ * @param {CalendarType} [calendarType="iso8601"] Calendar type.
3583
3621
  * @returns {boolean} Whether a given date is a weekend day.
3584
3622
  */
3585
3623
  function isWeekend(date, calendarType) {
3586
3624
  if (calendarType === void 0) { calendarType = CALENDAR_TYPES.ISO_8601; }
3587
3625
  var weekday = date.getDay();
3588
3626
  switch (calendarType) {
3589
- case CALENDAR_TYPES.ARABIC:
3627
+ case CALENDAR_TYPES.ISLAMIC:
3590
3628
  case CALENDAR_TYPES.HEBREW:
3591
3629
  return weekday === FRIDAY || weekday === SATURDAY;
3592
3630
  case CALENDAR_TYPES.ISO_8601:
3593
- case CALENDAR_TYPES.US:
3631
+ case CALENDAR_TYPES.GREGORY:
3594
3632
  return weekday === SATURDAY || weekday === SUNDAY;
3595
3633
  default:
3596
3634
  throw new Error('Unsupported calendar type.');
3597
3635
  }
3598
3636
  }
3599
3637
 
3600
- var calendarTypes = Object.values(CALENDAR_TYPES);
3601
- var allViews$1 = ['century', 'decade', 'year', 'month'];
3602
- var isCalendarType = PropTypes.oneOf(calendarTypes);
3603
- var isClassName = PropTypes.oneOfType([
3604
- PropTypes.string,
3605
- PropTypes.arrayOf(PropTypes.string),
3606
- ]);
3607
- function isMinDate(props, propName, componentName) {
3608
- var _a = props, _b = propName, minDate = _a[_b];
3609
- if (!minDate) {
3610
- return null;
3611
- }
3612
- if (!(minDate instanceof Date)) {
3613
- return new Error("Invalid prop `".concat(propName, "` of type `").concat(typeof minDate, "` supplied to `").concat(componentName, "`, expected instance of `Date`."));
3614
- }
3615
- var maxDate = props.maxDate;
3616
- if (maxDate && minDate > maxDate) {
3617
- return new Error("Invalid prop `".concat(propName, "` of type `").concat(typeof minDate, "` supplied to `").concat(componentName, "`, minDate cannot be larger than maxDate."));
3618
- }
3619
- return null;
3620
- }
3621
- function isMaxDate(props, propName, componentName) {
3622
- var _a = props, _b = propName, maxDate = _a[_b];
3623
- if (!maxDate) {
3624
- return null;
3625
- }
3626
- if (!(maxDate instanceof Date)) {
3627
- return new Error("Invalid prop `".concat(propName, "` of type `").concat(typeof maxDate, "` supplied to `").concat(componentName, "`, expected instance of `Date`."));
3628
- }
3629
- var minDate = props.minDate;
3630
- if (minDate && maxDate < minDate) {
3631
- return new Error("Invalid prop `".concat(propName, "` of type `").concat(typeof maxDate, "` supplied to `").concat(componentName, "`, maxDate cannot be smaller than minDate."));
3632
- }
3633
- return null;
3634
- }
3635
- var isRef = PropTypes.oneOfType([
3636
- PropTypes.func,
3637
- PropTypes.shape({
3638
- current: PropTypes.any,
3639
- }),
3640
- ]);
3641
- var isValue$1 = PropTypes.oneOfType([
3642
- PropTypes.instanceOf(Date),
3643
- PropTypes.arrayOf(PropTypes.instanceOf(Date)),
3644
- ]);
3645
- var isViews = PropTypes.arrayOf(PropTypes.oneOf(allViews$1));
3646
- function isView(props, propName, componentName) {
3647
- var _a = props, _b = propName, view = _a[_b];
3648
- var views = props.views;
3649
- var allowedViews = views || allViews$1;
3650
- if (view !== undefined && (typeof view !== 'string' || allowedViews.indexOf(view) === -1)) {
3651
- return new Error("Invalid prop `".concat(propName, "` of value `").concat(view, "` supplied to `").concat(componentName, "`, expected one of [").concat(allowedViews
3652
- .map(function (a) { return "\"".concat(a, "\""); })
3653
- .join(', '), "]."));
3654
- }
3655
- // Everything is fine
3656
- return null;
3657
- }
3658
- isView.isRequired = function (props, propName, componentName) {
3659
- var _a = props, _b = propName, view = _a[_b];
3660
- if (!view) {
3661
- return new Error("The prop `".concat(propName, "` is marked as required in `").concat(componentName, "`, but its value is `").concat(view, "`."));
3662
- }
3663
- return isView(props, propName, componentName);
3664
- };
3665
- var tileGroupProps = {
3666
- activeStartDate: PropTypes.instanceOf(Date).isRequired,
3667
- hover: PropTypes.instanceOf(Date),
3668
- locale: PropTypes.string,
3669
- maxDate: isMaxDate,
3670
- minDate: isMinDate,
3671
- onClick: PropTypes.func,
3672
- onMouseOver: PropTypes.func,
3673
- tileClassName: PropTypes.oneOfType([PropTypes.func, isClassName]),
3674
- tileContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
3675
- value: isValue$1,
3676
- valueType: PropTypes.string,
3677
- };
3678
- var tileProps = {
3679
- activeStartDate: PropTypes.instanceOf(Date).isRequired,
3680
- classes: PropTypes.arrayOf(PropTypes.string).isRequired,
3681
- date: PropTypes.instanceOf(Date).isRequired,
3682
- locale: PropTypes.string,
3683
- maxDate: isMaxDate,
3684
- minDate: isMinDate,
3685
- onClick: PropTypes.func,
3686
- onMouseOver: PropTypes.func,
3687
- style: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
3688
- tileClassName: PropTypes.oneOfType([PropTypes.func, isClassName]),
3689
- tileContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
3690
- tileDisabled: PropTypes.func,
3691
- };
3692
-
3693
3638
  var className$6 = 'react-calendar__navigation';
3694
3639
  function Navigation(_a) {
3695
3640
  var activeStartDate = _a.activeStartDate, drillUp = _a.drillUp, _b = _a.formatMonthYear, formatMonthYear$1 = _b === void 0 ? formatMonthYear : _b, _c = _a.formatYear, formatYear$1 = _c === void 0 ? formatYear : _c, locale = _a.locale, maxDate = _a.maxDate, minDate = _a.minDate, _d = _a.navigationAriaLabel, navigationAriaLabel = _d === void 0 ? '' : _d, navigationAriaLive = _a.navigationAriaLive, navigationLabel = _a.navigationLabel, _e = _a.next2AriaLabel, next2AriaLabel = _e === void 0 ? '' : _e, _f = _a.next2Label, next2Label = _f === void 0 ? '»' : _f, _g = _a.nextAriaLabel, nextAriaLabel = _g === void 0 ? '' : _g, _h = _a.nextLabel, nextLabel = _h === void 0 ? '›' : _h, _j = _a.prev2AriaLabel, prev2AriaLabel = _j === void 0 ? '' : _j, _k = _a.prev2Label, prev2Label = _k === void 0 ? '«' : _k, _l = _a.prevAriaLabel, prevAriaLabel = _l === void 0 ? '' : _l, _m = _a.prevLabel, prevLabel = _m === void 0 ? '‹' : _m, setActiveStartDate = _a.setActiveStartDate, showDoubleView = _a.showDoubleView, view = _a.view, views = _a.views;
@@ -3771,33 +3716,9 @@ function Navigation(_a) {
3771
3716
  nextLabel !== null && (React.createElement("button", { "aria-label": nextAriaLabel, className: "".concat(className$6, "__arrow ").concat(className$6, "__next-button"), disabled: nextButtonDisabled, onClick: onClickNext, type: "button" }, nextLabel)),
3772
3717
  next2Label !== null && shouldShowPrevNext2Buttons ? (React.createElement("button", { "aria-label": next2AriaLabel, className: "".concat(className$6, "__arrow ").concat(className$6, "__next2-button"), disabled: next2ButtonDisabled, onClick: onClickNext2, type: "button" }, next2Label)) : null));
3773
3718
  }
3774
- Navigation.propTypes = {
3775
- activeStartDate: PropTypes.instanceOf(Date).isRequired,
3776
- drillUp: PropTypes.func.isRequired,
3777
- formatMonthYear: PropTypes.func,
3778
- formatYear: PropTypes.func,
3779
- locale: PropTypes.string,
3780
- maxDate: PropTypes.instanceOf(Date),
3781
- minDate: PropTypes.instanceOf(Date),
3782
- navigationAriaLabel: PropTypes.string,
3783
- navigationAriaLive: PropTypes.string,
3784
- navigationLabel: PropTypes.func,
3785
- next2AriaLabel: PropTypes.string,
3786
- next2Label: PropTypes.node,
3787
- nextAriaLabel: PropTypes.string,
3788
- nextLabel: PropTypes.node,
3789
- prev2AriaLabel: PropTypes.string,
3790
- prev2Label: PropTypes.node,
3791
- prevAriaLabel: PropTypes.string,
3792
- prevLabel: PropTypes.node,
3793
- setActiveStartDate: PropTypes.func.isRequired,
3794
- showDoubleView: PropTypes.bool,
3795
- view: isView.isRequired,
3796
- views: isViews.isRequired,
3797
- };
3798
3719
 
3799
- var __assign$g = (undefined && undefined.__assign) || function () {
3800
- __assign$g = Object.assign || function(t) {
3720
+ var __assign$e = (undefined && undefined.__assign) || function () {
3721
+ __assign$e = Object.assign || function(t) {
3801
3722
  for (var s, i = 1, n = arguments.length; i < n; i++) {
3802
3723
  s = arguments[i];
3803
3724
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
@@ -3805,9 +3726,9 @@ var __assign$g = (undefined && undefined.__assign) || function () {
3805
3726
  }
3806
3727
  return t;
3807
3728
  };
3808
- return __assign$g.apply(this, arguments);
3729
+ return __assign$e.apply(this, arguments);
3809
3730
  };
3810
- var __rest$9 = (undefined && undefined.__rest) || function (s, e) {
3731
+ var __rest$a = (undefined && undefined.__rest) || function (s, e) {
3811
3732
  var t = {};
3812
3733
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
3813
3734
  t[p] = s[p];
@@ -3822,27 +3743,41 @@ function toPercent(num) {
3822
3743
  return "".concat(num, "%");
3823
3744
  }
3824
3745
  function Flex(_a) {
3825
- var children = _a.children, className = _a.className, count = _a.count, direction = _a.direction, offset = _a.offset, style = _a.style, wrap = _a.wrap, otherProps = __rest$9(_a, ["children", "className", "count", "direction", "offset", "style", "wrap"]);
3826
- return (React.createElement("div", __assign$g({ className: className, style: __assign$g({ display: 'flex', flexDirection: direction, flexWrap: wrap ? 'wrap' : 'nowrap' }, style) }, otherProps), React.Children.map(children, function (child, index) {
3827
- return React.cloneElement(child, __assign$g(__assign$g({}, child.props), { style: {
3746
+ var children = _a.children, className = _a.className, count = _a.count, direction = _a.direction, offset = _a.offset, style = _a.style, wrap = _a.wrap, otherProps = __rest$a(_a, ["children", "className", "count", "direction", "offset", "style", "wrap"]);
3747
+ return (React.createElement("div", __assign$e({ className: className, style: __assign$e({ display: 'flex', flexDirection: direction, flexWrap: wrap ? 'wrap' : 'nowrap' }, style) }, otherProps), React.Children.map(children, function (child, index) {
3748
+ var marginInlineStart = offset && index === 0 ? toPercent((100 * offset) / count) : null;
3749
+ return React.cloneElement(child, __assign$e(__assign$e({}, child.props), { style: {
3828
3750
  flexBasis: toPercent(100 / count),
3829
3751
  flexShrink: 0,
3830
3752
  flexGrow: 0,
3831
3753
  overflow: 'hidden',
3832
- marginLeft: offset && index === 0 ? toPercent((100 * offset) / count) : null,
3754
+ marginLeft: marginInlineStart,
3755
+ marginInlineStart: marginInlineStart,
3756
+ marginInlineEnd: 0,
3833
3757
  } }));
3834
3758
  })));
3835
3759
  }
3836
- Flex.propTypes = {
3837
- children: PropTypes.node,
3838
- className: PropTypes.string,
3839
- count: PropTypes.number.isRequired,
3840
- direction: PropTypes.string,
3841
- offset: PropTypes.number,
3842
- style: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
3843
- wrap: PropTypes.bool,
3844
- };
3845
3760
 
3761
+ var isProduction = process.env.NODE_ENV === 'production';
3762
+ function warning(condition, message) {
3763
+ if (!isProduction) {
3764
+ if (condition) {
3765
+ return;
3766
+ }
3767
+
3768
+ var text = "Warning: " + message;
3769
+
3770
+ if (typeof console !== 'undefined') {
3771
+ console.warn(text);
3772
+ }
3773
+
3774
+ try {
3775
+ throw Error(text);
3776
+ } catch (x) {}
3777
+ }
3778
+ }
3779
+
3780
+ var _a;
3846
3781
  /**
3847
3782
  * Returns a value no smaller than min and no larger than max.
3848
3783
  *
@@ -3888,6 +3823,12 @@ function getRangeClassNames(valueRange, dateRange, baseClassName) {
3888
3823
  }
3889
3824
  return classes;
3890
3825
  }
3826
+ function isCompleteValue(value) {
3827
+ if (Array.isArray(value)) {
3828
+ return value[0] !== null && value[1] !== null;
3829
+ }
3830
+ return value !== null;
3831
+ }
3891
3832
  function getTileClasses(args) {
3892
3833
  if (!args) {
3893
3834
  throw new Error('args is required');
@@ -3912,7 +3853,7 @@ function getTileClasses(args) {
3912
3853
  if (isValueWithinRange(now, dateRange)) {
3913
3854
  classes.push("".concat(className, "--now"));
3914
3855
  }
3915
- if (!value) {
3856
+ if (!value || !isCompleteValue(value)) {
3916
3857
  return classes;
3917
3858
  }
3918
3859
  var valueRange = (function () {
@@ -3941,115 +3882,61 @@ function getTileClasses(args) {
3941
3882
  }
3942
3883
  return classes;
3943
3884
  }
3885
+ var calendarTypeMap = (_a = {},
3886
+ _a[DEPRECATED_CALENDAR_TYPES.ARABIC] = CALENDAR_TYPES.ISLAMIC,
3887
+ _a[DEPRECATED_CALENDAR_TYPES.HEBREW] = CALENDAR_TYPES.HEBREW,
3888
+ _a[DEPRECATED_CALENDAR_TYPES.ISO_8601] = CALENDAR_TYPES.ISO_8601,
3889
+ _a[DEPRECATED_CALENDAR_TYPES.US] = CALENDAR_TYPES.GREGORY,
3890
+ _a);
3891
+ function isDeprecatedCalendarType(calendarType) {
3892
+ return calendarType !== undefined && calendarType in DEPRECATED_CALENDAR_TYPES;
3893
+ }
3894
+ var warned = false;
3895
+ function mapCalendarType(calendarTypeOrDeprecatedCalendarType) {
3896
+ if (isDeprecatedCalendarType(calendarTypeOrDeprecatedCalendarType)) {
3897
+ var calendarType = calendarTypeMap[calendarTypeOrDeprecatedCalendarType];
3898
+ warning(warned, "Specifying calendarType=\"".concat(calendarTypeOrDeprecatedCalendarType, "\" is deprecated. Use calendarType=\"").concat(calendarType, "\" instead."));
3899
+ warned = true;
3900
+ return calendarType;
3901
+ }
3902
+ return calendarTypeOrDeprecatedCalendarType;
3903
+ }
3944
3904
 
3945
- var __assign$f = (undefined && undefined.__assign) || function () {
3946
- __assign$f = Object.assign || function(t) {
3947
- for (var s, i = 1, n = arguments.length; i < n; i++) {
3948
- s = arguments[i];
3949
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
3950
- t[p] = s[p];
3951
- }
3952
- return t;
3953
- };
3954
- return __assign$f.apply(this, arguments);
3955
- };
3956
- var __rest$8 = (undefined && undefined.__rest) || function (s, e) {
3957
- var t = {};
3958
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
3959
- t[p] = s[p];
3960
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
3961
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
3962
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
3963
- t[p[i]] = s[p[i]];
3964
- }
3965
- return t;
3966
- };
3967
3905
  function TileGroup(_a) {
3968
- var className = _a.className, _b = _a.count, count = _b === void 0 ? 3 : _b, dateTransform = _a.dateTransform, dateType = _a.dateType, end = _a.end, hover = _a.hover, offset = _a.offset, start = _a.start, _c = _a.step, step = _c === void 0 ? 1 : _c, Tile = _a.tile, value = _a.value, valueType = _a.valueType, tileProps = __rest$8(_a, ["className", "count", "dateTransform", "dateType", "end", "hover", "offset", "start", "step", "tile", "value", "valueType"]);
3906
+ var className = _a.className, _b = _a.count, count = _b === void 0 ? 3 : _b, dateTransform = _a.dateTransform, dateType = _a.dateType, end = _a.end, hover = _a.hover, offset = _a.offset, renderTile = _a.renderTile, start = _a.start, _c = _a.step, step = _c === void 0 ? 1 : _c, value = _a.value, valueType = _a.valueType;
3969
3907
  var tiles = [];
3970
3908
  for (var point = start; point <= end; point += step) {
3971
3909
  var date = dateTransform(point);
3972
- tiles.push(React.createElement(Tile, __assign$f({ key: date.getTime(), classes: getTileClasses({
3973
- value: value,
3974
- valueType: valueType,
3910
+ tiles.push(renderTile({
3911
+ classes: getTileClasses({
3975
3912
  date: date,
3976
3913
  dateType: dateType,
3977
3914
  hover: hover,
3978
- }), date: date, point: point }, tileProps)));
3915
+ value: value,
3916
+ valueType: valueType,
3917
+ }),
3918
+ date: date,
3919
+ }));
3979
3920
  }
3980
3921
  return (React.createElement(Flex, { className: className, count: count, offset: offset, wrap: true }, tiles));
3981
3922
  }
3982
- TileGroup.propTypes = __assign$f(__assign$f({}, tileGroupProps), { className: PropTypes.string, count: PropTypes.number, dateTransform: PropTypes.func.isRequired, dateType: PropTypes.string, end: PropTypes.number.isRequired, offset: PropTypes.number, step: PropTypes.number, start: PropTypes.number.isRequired, tile: PropTypes.func.isRequired });
3983
3923
 
3984
- var __extends$1 = (undefined && undefined.__extends) || (function () {
3985
- var extendStatics = function (d, b) {
3986
- extendStatics = Object.setPrototypeOf ||
3987
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
3988
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
3989
- return extendStatics(d, b);
3990
- };
3991
- return function (d, b) {
3992
- if (typeof b !== "function" && b !== null)
3993
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
3994
- extendStatics(d, b);
3995
- function __() { this.constructor = d; }
3996
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
3997
- };
3998
- })();
3999
- var __assign$e = (undefined && undefined.__assign) || function () {
4000
- __assign$e = Object.assign || function(t) {
4001
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4002
- s = arguments[i];
4003
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
4004
- t[p] = s[p];
4005
- }
4006
- return t;
4007
- };
4008
- return __assign$e.apply(this, arguments);
4009
- };
4010
- function datesAreDifferent(date1, date2) {
4011
- return ((date1 && !date2) ||
4012
- (!date1 && date2) ||
4013
- (date1 && date2 && date1.getTime() !== date2.getTime()));
4014
- }
4015
- var Tile = /** @class */ (function (_super) {
4016
- __extends$1(Tile, _super);
4017
- function Tile() {
4018
- var _this = _super !== null && _super.apply(this, arguments) || this;
4019
- _this.state = {};
4020
- return _this;
4021
- }
4022
- Tile.getDerivedStateFromProps = function (nextProps, prevState) {
4023
- var activeStartDate = nextProps.activeStartDate, date = nextProps.date, tileClassName = nextProps.tileClassName, tileContent = nextProps.tileContent, view = nextProps.view;
4024
- var nextState = {};
3924
+ function Tile(props) {
3925
+ var activeStartDate = props.activeStartDate, children = props.children, classes = props.classes, date = props.date, formatAbbr = props.formatAbbr, locale = props.locale, maxDate = props.maxDate, maxDateTransform = props.maxDateTransform, minDate = props.minDate, minDateTransform = props.minDateTransform, onClick = props.onClick, onMouseOver = props.onMouseOver, style = props.style, tileClassNameProps = props.tileClassName, tileContentProps = props.tileContent, tileDisabled = props.tileDisabled, view = props.view;
3926
+ var tileClassName = useMemo(function () {
3927
+ var args = { activeStartDate: activeStartDate, date: date, view: view };
3928
+ return typeof tileClassNameProps === 'function' ? tileClassNameProps(args) : tileClassNameProps;
3929
+ }, [activeStartDate, date, tileClassNameProps, view]);
3930
+ var tileContent = useMemo(function () {
4025
3931
  var args = { activeStartDate: activeStartDate, date: date, view: view };
4026
- if (tileClassName !== prevState.tileClassNameProps ||
4027
- datesAreDifferent(activeStartDate, prevState.activeStartDateProps)) {
4028
- nextState.tileClassName =
4029
- typeof tileClassName === 'function' ? tileClassName(args) : tileClassName;
4030
- nextState.tileClassNameProps = tileClassName;
4031
- }
4032
- if (tileContent !== prevState.tileContentProps ||
4033
- datesAreDifferent(activeStartDate, prevState.activeStartDateProps)) {
4034
- nextState.tileContent = typeof tileContent === 'function' ? tileContent(args) : tileContent;
4035
- nextState.tileContentProps = tileContent;
4036
- }
4037
- nextState.activeStartDateProps = activeStartDate;
4038
- return nextState;
4039
- };
4040
- Tile.prototype.render = function () {
4041
- var _a = this.props, activeStartDate = _a.activeStartDate, children = _a.children, classes = _a.classes, date = _a.date, formatAbbr = _a.formatAbbr, locale = _a.locale, maxDate = _a.maxDate, maxDateTransform = _a.maxDateTransform, minDate = _a.minDate, minDateTransform = _a.minDateTransform, onClick = _a.onClick, onMouseOver = _a.onMouseOver, style = _a.style, tileDisabled = _a.tileDisabled, view = _a.view;
4042
- var _b = this.state, tileClassName = _b.tileClassName, tileContent = _b.tileContent;
4043
- return (React.createElement("button", { className: clsx(classes, tileClassName), disabled: (minDate && minDateTransform(minDate) > date) ||
4044
- (maxDate && maxDateTransform(maxDate) < date) ||
4045
- (tileDisabled && tileDisabled({ activeStartDate: activeStartDate, date: date, view: view })), onClick: onClick ? function (event) { return onClick(date, event); } : undefined, onFocus: onMouseOver ? function () { return onMouseOver(date); } : undefined, onMouseOver: onMouseOver ? function () { return onMouseOver(date); } : undefined, style: style, type: "button" },
4046
- formatAbbr ? React.createElement("abbr", { "aria-label": formatAbbr(locale, date) }, children) : children,
4047
- tileContent));
4048
- };
4049
- Tile.propTypes = __assign$e(__assign$e({}, tileProps), { children: PropTypes.node.isRequired, formatAbbr: PropTypes.func, maxDateTransform: PropTypes.func.isRequired, minDateTransform: PropTypes.func.isRequired });
4050
- return Tile;
4051
- }(Component));
4052
- var Tile$1 = Tile;
3932
+ return typeof tileContentProps === 'function' ? tileContentProps(args) : tileContentProps;
3933
+ }, [activeStartDate, date, tileContentProps, view]);
3934
+ return (React.createElement("button", { className: clsx(classes, tileClassName), disabled: (minDate && minDateTransform(minDate) > date) ||
3935
+ (maxDate && maxDateTransform(maxDate) < date) ||
3936
+ (tileDisabled && tileDisabled({ activeStartDate: activeStartDate, date: date, view: view })), onClick: onClick ? function (event) { return onClick(date, event); } : undefined, onFocus: onMouseOver ? function () { return onMouseOver(date); } : undefined, onMouseOver: onMouseOver ? function () { return onMouseOver(date); } : undefined, style: style, type: "button" },
3937
+ formatAbbr ? React.createElement("abbr", { "aria-label": formatAbbr(locale, date) }, children) : children,
3938
+ tileContent));
3939
+ }
4053
3940
 
4054
3941
  var __assign$d = (undefined && undefined.__assign) || function () {
4055
3942
  __assign$d = Object.assign || function(t) {
@@ -4062,7 +3949,7 @@ var __assign$d = (undefined && undefined.__assign) || function () {
4062
3949
  };
4063
3950
  return __assign$d.apply(this, arguments);
4064
3951
  };
4065
- var __rest$7 = (undefined && undefined.__rest) || function (s, e) {
3952
+ var __rest$9 = (undefined && undefined.__rest) || function (s, e) {
4066
3953
  var t = {};
4067
3954
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4068
3955
  t[p] = s[p];
@@ -4073,7 +3960,7 @@ var __rest$7 = (undefined && undefined.__rest) || function (s, e) {
4073
3960
  }
4074
3961
  return t;
4075
3962
  };
4076
- var __spreadArray$2 = (undefined && undefined.__spreadArray) || function (to, from, pack) {
3963
+ var __spreadArray$3 = (undefined && undefined.__spreadArray) || function (to, from, pack) {
4077
3964
  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4078
3965
  if (ar || !(i in from)) {
4079
3966
  if (!ar) ar = Array.prototype.slice.call(from, 0, i);
@@ -4084,11 +3971,10 @@ var __spreadArray$2 = (undefined && undefined.__spreadArray) || function (to, fr
4084
3971
  };
4085
3972
  var className$5 = 'react-calendar__century-view__decades__decade';
4086
3973
  function Decade(_a) {
4087
- var _b = _a.classes, classes = _b === void 0 ? [] : _b, _c = _a.formatYear, formatYear$1 = _c === void 0 ? formatYear : _c, otherProps = __rest$7(_a, ["classes", "formatYear"]);
3974
+ var _b = _a.classes, classes = _b === void 0 ? [] : _b, _c = _a.formatYear, formatYear$1 = _c === void 0 ? formatYear : _c, otherProps = __rest$9(_a, ["classes", "formatYear"]);
4088
3975
  var date = otherProps.date, locale = otherProps.locale;
4089
- return (React.createElement(Tile$1, __assign$d({}, otherProps, { classes: __spreadArray$2(__spreadArray$2([], classes, true), [className$5], false), maxDateTransform: getDecadeEnd, minDateTransform: getDecadeStart, view: "century" }), getDecadeLabel(locale, formatYear$1, date)));
3976
+ return (React.createElement(Tile, __assign$d({}, otherProps, { classes: __spreadArray$3(__spreadArray$3([], classes, true), [className$5], false), maxDateTransform: getDecadeEnd, minDateTransform: getDecadeStart, view: "century" }), getDecadeLabel(locale, formatYear$1, date)));
4090
3977
  }
4091
- Decade.propTypes = __assign$d(__assign$d({}, tileProps), { formatYear: PropTypes.func });
4092
3978
 
4093
3979
  var __assign$c = (undefined && undefined.__assign) || function () {
4094
3980
  __assign$c = Object.assign || function(t) {
@@ -4101,13 +3987,132 @@ var __assign$c = (undefined && undefined.__assign) || function () {
4101
3987
  };
4102
3988
  return __assign$c.apply(this, arguments);
4103
3989
  };
3990
+ var __rest$8 = (undefined && undefined.__rest) || function (s, e) {
3991
+ var t = {};
3992
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
3993
+ t[p] = s[p];
3994
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
3995
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
3996
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
3997
+ t[p[i]] = s[p[i]];
3998
+ }
3999
+ return t;
4000
+ };
4104
4001
  function Decades(props) {
4105
- var activeStartDate = props.activeStartDate;
4002
+ var activeStartDate = props.activeStartDate, hover = props.hover, value = props.value, valueType = props.valueType, otherProps = __rest$8(props, ["activeStartDate", "hover", "value", "valueType"]);
4106
4003
  var start = getBeginOfCenturyYear(activeStartDate);
4107
4004
  var end = start + 99;
4108
- return (React.createElement(TileGroup, __assign$c({}, props, { className: "react-calendar__century-view__decades", dateTransform: getDecadeStart, dateType: "decade", end: end, start: start, step: 10, tile: Decade })));
4005
+ return (React.createElement(TileGroup, { className: "react-calendar__century-view__decades", dateTransform: getDecadeStart, dateType: "decade", end: end, hover: hover, renderTile: function (_a) {
4006
+ var date = _a.date, otherTileProps = __rest$8(_a, ["date"]);
4007
+ return (React.createElement(Decade, __assign$c({ key: date.getTime() }, otherProps, otherTileProps, { activeStartDate: activeStartDate, date: date })));
4008
+ }, start: start, step: 10, value: value, valueType: valueType }));
4109
4009
  }
4110
- Decades.propTypes = __assign$c({}, tileGroupProps);
4010
+
4011
+ var __spreadArray$2 = (undefined && undefined.__spreadArray) || function (to, from, pack) {
4012
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4013
+ if (ar || !(i in from)) {
4014
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
4015
+ ar[i] = from[i];
4016
+ }
4017
+ }
4018
+ return to.concat(ar || Array.prototype.slice.call(from));
4019
+ };
4020
+ var calendarTypes = Object.values(CALENDAR_TYPES);
4021
+ var deprecatedCalendarTypes = Object.values(DEPRECATED_CALENDAR_TYPES);
4022
+ var allViews$1 = ['century', 'decade', 'year', 'month'];
4023
+ var isCalendarType = PropTypes.oneOf(__spreadArray$2(__spreadArray$2([], calendarTypes, true), deprecatedCalendarTypes, true));
4024
+ var isClassName = PropTypes.oneOfType([
4025
+ PropTypes.string,
4026
+ PropTypes.arrayOf(PropTypes.string),
4027
+ ]);
4028
+ var isMinDate = function isMinDate(props, propName, componentName) {
4029
+ var _a = props, _b = propName, minDate = _a[_b];
4030
+ if (!minDate) {
4031
+ return null;
4032
+ }
4033
+ if (!(minDate instanceof Date)) {
4034
+ return new Error("Invalid prop `".concat(propName, "` of type `").concat(typeof minDate, "` supplied to `").concat(componentName, "`, expected instance of `Date`."));
4035
+ }
4036
+ var maxDate = props.maxDate;
4037
+ if (maxDate && minDate > maxDate) {
4038
+ return new Error("Invalid prop `".concat(propName, "` of type `").concat(typeof minDate, "` supplied to `").concat(componentName, "`, minDate cannot be larger than maxDate."));
4039
+ }
4040
+ return null;
4041
+ };
4042
+ var isMaxDate = function isMaxDate(props, propName, componentName) {
4043
+ var _a = props, _b = propName, maxDate = _a[_b];
4044
+ if (!maxDate) {
4045
+ return null;
4046
+ }
4047
+ if (!(maxDate instanceof Date)) {
4048
+ return new Error("Invalid prop `".concat(propName, "` of type `").concat(typeof maxDate, "` supplied to `").concat(componentName, "`, expected instance of `Date`."));
4049
+ }
4050
+ var minDate = props.minDate;
4051
+ if (minDate && maxDate < minDate) {
4052
+ return new Error("Invalid prop `".concat(propName, "` of type `").concat(typeof maxDate, "` supplied to `").concat(componentName, "`, maxDate cannot be smaller than minDate."));
4053
+ }
4054
+ return null;
4055
+ };
4056
+ var isRef = PropTypes.oneOfType([
4057
+ PropTypes.func,
4058
+ PropTypes.exact({
4059
+ current: PropTypes.any,
4060
+ }),
4061
+ ]);
4062
+ var isRange = PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.oneOf([null])]).isRequired);
4063
+ var isValue$1 = PropTypes.oneOfType([
4064
+ PropTypes.instanceOf(Date),
4065
+ PropTypes.oneOf([null]),
4066
+ isRange,
4067
+ ]);
4068
+ PropTypes.arrayOf(PropTypes.oneOf(allViews$1));
4069
+ var isView = function isView(props, propName, componentName) {
4070
+ var _a = props, _b = propName, view = _a[_b];
4071
+ if (view !== undefined && (typeof view !== 'string' || allViews$1.indexOf(view) === -1)) {
4072
+ return new Error("Invalid prop `".concat(propName, "` of value `").concat(view, "` supplied to `").concat(componentName, "`, expected one of [").concat(allViews$1
4073
+ .map(function (a) { return "\"".concat(a, "\""); })
4074
+ .join(', '), "]."));
4075
+ }
4076
+ // Everything is fine
4077
+ return null;
4078
+ };
4079
+ isView.isRequired = function isViewIsRequired(props, propName, componentName, location, propFullName) {
4080
+ var _a = props, _b = propName, view = _a[_b];
4081
+ if (!view) {
4082
+ return new Error("The prop `".concat(propName, "` is marked as required in `").concat(componentName, "`, but its value is `").concat(view, "`."));
4083
+ }
4084
+ return isView(props, propName, componentName);
4085
+ };
4086
+ var rangeOf = function (type) {
4087
+ return PropTypes.arrayOf(type);
4088
+ };
4089
+ var tileGroupProps = {
4090
+ activeStartDate: PropTypes.instanceOf(Date).isRequired,
4091
+ hover: PropTypes.instanceOf(Date),
4092
+ locale: PropTypes.string,
4093
+ maxDate: isMaxDate,
4094
+ minDate: isMinDate,
4095
+ onClick: PropTypes.func,
4096
+ onMouseOver: PropTypes.func,
4097
+ tileClassName: PropTypes.oneOfType([PropTypes.func, isClassName]),
4098
+ tileContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
4099
+ value: isValue$1,
4100
+ valueType: PropTypes.oneOf(['century', 'decade', 'year', 'month', 'day']).isRequired,
4101
+ };
4102
+ ({
4103
+ activeStartDate: PropTypes.instanceOf(Date).isRequired,
4104
+ classes: PropTypes.arrayOf(PropTypes.string.isRequired).isRequired,
4105
+ date: PropTypes.instanceOf(Date).isRequired,
4106
+ locale: PropTypes.string,
4107
+ maxDate: isMaxDate,
4108
+ minDate: isMinDate,
4109
+ onClick: PropTypes.func,
4110
+ onMouseOver: PropTypes.func,
4111
+ style: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
4112
+ tileClassName: PropTypes.oneOfType([PropTypes.func, isClassName]),
4113
+ tileContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
4114
+ tileDisabled: PropTypes.func,
4115
+ });
4111
4116
 
4112
4117
  var __assign$b = (undefined && undefined.__assign) || function () {
4113
4118
  __assign$b = Object.assign || function(t) {
@@ -4120,12 +4125,14 @@ var __assign$b = (undefined && undefined.__assign) || function () {
4120
4125
  };
4121
4126
  return __assign$b.apply(this, arguments);
4122
4127
  };
4123
- function CenturyView(props) {
4128
+ var CenturyView = function CenturyView(props) {
4124
4129
  function renderDecades() {
4125
4130
  return React.createElement(Decades, __assign$b({}, props));
4126
4131
  }
4127
4132
  return React.createElement("div", { className: "react-calendar__century-view" }, renderDecades());
4128
- }
4133
+ };
4134
+ CenturyView.propTypes = __assign$b({}, tileGroupProps);
4135
+ var CenturyView$1 = CenturyView;
4129
4136
 
4130
4137
  var __assign$a = (undefined && undefined.__assign) || function () {
4131
4138
  __assign$a = Object.assign || function(t) {
@@ -4138,7 +4145,7 @@ var __assign$a = (undefined && undefined.__assign) || function () {
4138
4145
  };
4139
4146
  return __assign$a.apply(this, arguments);
4140
4147
  };
4141
- var __rest$6 = (undefined && undefined.__rest) || function (s, e) {
4148
+ var __rest$7 = (undefined && undefined.__rest) || function (s, e) {
4142
4149
  var t = {};
4143
4150
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4144
4151
  t[p] = s[p];
@@ -4160,11 +4167,10 @@ var __spreadArray$1 = (undefined && undefined.__spreadArray) || function (to, fr
4160
4167
  };
4161
4168
  var className$4 = 'react-calendar__decade-view__years__year';
4162
4169
  function Year(_a) {
4163
- var _b = _a.classes, classes = _b === void 0 ? [] : _b, _c = _a.formatYear, formatYear$1 = _c === void 0 ? formatYear : _c, otherProps = __rest$6(_a, ["classes", "formatYear"]);
4170
+ var _b = _a.classes, classes = _b === void 0 ? [] : _b, _c = _a.formatYear, formatYear$1 = _c === void 0 ? formatYear : _c, otherProps = __rest$7(_a, ["classes", "formatYear"]);
4164
4171
  var date = otherProps.date, locale = otherProps.locale;
4165
- return (React.createElement(Tile$1, __assign$a({}, otherProps, { classes: __spreadArray$1(__spreadArray$1([], classes, true), [className$4], false), maxDateTransform: getYearEnd, minDateTransform: getYearStart, view: "decade" }), formatYear$1(locale, date)));
4172
+ return (React.createElement(Tile, __assign$a({}, otherProps, { classes: __spreadArray$1(__spreadArray$1([], classes, true), [className$4], false), maxDateTransform: getYearEnd, minDateTransform: getYearStart, view: "decade" }), formatYear$1(locale, date)));
4166
4173
  }
4167
- Year.propTypes = __assign$a(__assign$a({}, tileProps), { formatYear: PropTypes.func });
4168
4174
 
4169
4175
  var __assign$9 = (undefined && undefined.__assign) || function () {
4170
4176
  __assign$9 = Object.assign || function(t) {
@@ -4177,18 +4183,26 @@ var __assign$9 = (undefined && undefined.__assign) || function () {
4177
4183
  };
4178
4184
  return __assign$9.apply(this, arguments);
4179
4185
  };
4186
+ var __rest$6 = (undefined && undefined.__rest) || function (s, e) {
4187
+ var t = {};
4188
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4189
+ t[p] = s[p];
4190
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
4191
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
4192
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
4193
+ t[p[i]] = s[p[i]];
4194
+ }
4195
+ return t;
4196
+ };
4180
4197
  function Years(props) {
4181
- var activeStartDate = props.activeStartDate;
4198
+ var activeStartDate = props.activeStartDate, hover = props.hover, value = props.value, valueType = props.valueType, otherProps = __rest$6(props, ["activeStartDate", "hover", "value", "valueType"]);
4182
4199
  var start = getBeginOfDecadeYear(activeStartDate);
4183
4200
  var end = start + 9;
4184
- return (React.createElement(TileGroup, __assign$9({}, props, { className: "react-calendar__decade-view__years", dateTransform: function (year) {
4185
- var date = new Date();
4186
- date.setFullYear(year, 0, 1);
4187
- date.setHours(0, 0, 0, 0);
4188
- return date;
4189
- }, dateType: "year", end: end, start: start, tile: Year })));
4201
+ return (React.createElement(TileGroup, { className: "react-calendar__decade-view__years", dateTransform: getYearStart, dateType: "year", end: end, hover: hover, renderTile: function (_a) {
4202
+ var date = _a.date, otherTileProps = __rest$6(_a, ["date"]);
4203
+ return (React.createElement(Year, __assign$9({ key: date.getTime() }, otherProps, otherTileProps, { activeStartDate: activeStartDate, date: date })));
4204
+ }, start: start, value: value, valueType: valueType }));
4190
4205
  }
4191
- Years.propTypes = __assign$9({}, tileGroupProps);
4192
4206
 
4193
4207
  var __assign$8 = (undefined && undefined.__assign) || function () {
4194
4208
  __assign$8 = Object.assign || function(t) {
@@ -4201,12 +4215,14 @@ var __assign$8 = (undefined && undefined.__assign) || function () {
4201
4215
  };
4202
4216
  return __assign$8.apply(this, arguments);
4203
4217
  };
4204
- function DecadeView(props) {
4218
+ var DecadeView = function DecadeView(props) {
4205
4219
  function renderYears() {
4206
4220
  return React.createElement(Years, __assign$8({}, props));
4207
4221
  }
4208
4222
  return React.createElement("div", { className: "react-calendar__decade-view" }, renderYears());
4209
- }
4223
+ };
4224
+ DecadeView.propTypes = __assign$8({}, tileGroupProps);
4225
+ var DecadeView$1 = DecadeView;
4210
4226
 
4211
4227
  var __assign$7 = (undefined && undefined.__assign) || function () {
4212
4228
  __assign$7 = Object.assign || function(t) {
@@ -4243,9 +4259,8 @@ var className$3 = 'react-calendar__year-view__months__month';
4243
4259
  function Month(_a) {
4244
4260
  var _b = _a.classes, classes = _b === void 0 ? [] : _b, _c = _a.formatMonth, formatMonth$1 = _c === void 0 ? formatMonth : _c, _d = _a.formatMonthYear, formatMonthYear$1 = _d === void 0 ? formatMonthYear : _d, otherProps = __rest$5(_a, ["classes", "formatMonth", "formatMonthYear"]);
4245
4261
  var date = otherProps.date, locale = otherProps.locale;
4246
- return (React.createElement(Tile$1, __assign$7({}, otherProps, { classes: __spreadArray(__spreadArray([], classes, true), [className$3], false), formatAbbr: formatMonthYear$1, maxDateTransform: getMonthEnd, minDateTransform: getMonthStart, view: "year" }), formatMonth$1(locale, date)));
4262
+ return (React.createElement(Tile, __assign$7({}, otherProps, { classes: __spreadArray(__spreadArray([], classes, true), [className$3], false), formatAbbr: formatMonthYear$1, maxDateTransform: getMonthEnd, minDateTransform: getMonthStart, view: "year" }), formatMonth$1(locale, date)));
4247
4263
  }
4248
- Month.propTypes = __assign$7(__assign$7({}, tileProps), { formatMonth: PropTypes.func, formatMonthYear: PropTypes.func });
4249
4264
 
4250
4265
  var __assign$6 = (undefined && undefined.__assign) || function () {
4251
4266
  __assign$6 = Object.assign || function(t) {
@@ -4258,19 +4273,31 @@ var __assign$6 = (undefined && undefined.__assign) || function () {
4258
4273
  };
4259
4274
  return __assign$6.apply(this, arguments);
4260
4275
  };
4276
+ var __rest$4 = (undefined && undefined.__rest) || function (s, e) {
4277
+ var t = {};
4278
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4279
+ t[p] = s[p];
4280
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
4281
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
4282
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
4283
+ t[p[i]] = s[p[i]];
4284
+ }
4285
+ return t;
4286
+ };
4261
4287
  function Months(props) {
4262
- var activeStartDate = props.activeStartDate;
4288
+ var activeStartDate = props.activeStartDate, hover = props.hover, value = props.value, valueType = props.valueType, otherProps = __rest$4(props, ["activeStartDate", "hover", "value", "valueType"]);
4263
4289
  var start = 0;
4264
4290
  var end = 11;
4265
4291
  var year = getYear(activeStartDate);
4266
- return (React.createElement(TileGroup, __assign$6({}, props, { className: "react-calendar__year-view__months", dateTransform: function (monthIndex) {
4292
+ return (React.createElement(TileGroup, { className: "react-calendar__year-view__months", dateTransform: function (monthIndex) {
4267
4293
  var date = new Date();
4268
4294
  date.setFullYear(year, monthIndex, 1);
4269
- date.setHours(0, 0, 0, 0);
4270
- return date;
4271
- }, dateType: "month", end: end, start: start, tile: Month })));
4295
+ return getMonthStart(date);
4296
+ }, dateType: "month", end: end, hover: hover, renderTile: function (_a) {
4297
+ var date = _a.date, otherTileProps = __rest$4(_a, ["date"]);
4298
+ return (React.createElement(Month, __assign$6({ key: date.getTime() }, otherProps, otherTileProps, { activeStartDate: activeStartDate, date: date })));
4299
+ }, start: start, value: value, valueType: valueType }));
4272
4300
  }
4273
- Months.propTypes = __assign$6(__assign$6({}, tileGroupProps), { locale: PropTypes.string });
4274
4301
 
4275
4302
  var __assign$5 = (undefined && undefined.__assign) || function () {
4276
4303
  __assign$5 = Object.assign || function(t) {
@@ -4283,12 +4310,14 @@ var __assign$5 = (undefined && undefined.__assign) || function () {
4283
4310
  };
4284
4311
  return __assign$5.apply(this, arguments);
4285
4312
  };
4286
- function YearView(props) {
4313
+ var YearView = function YearView(props) {
4287
4314
  function renderMonths() {
4288
4315
  return React.createElement(Months, __assign$5({}, props));
4289
4316
  }
4290
4317
  return React.createElement("div", { className: "react-calendar__year-view" }, renderMonths());
4291
- }
4318
+ };
4319
+ YearView.propTypes = __assign$5({}, tileGroupProps);
4320
+ var YearView$1 = YearView;
4292
4321
 
4293
4322
  var __assign$4 = (undefined && undefined.__assign) || function () {
4294
4323
  __assign$4 = Object.assign || function(t) {
@@ -4301,7 +4330,7 @@ var __assign$4 = (undefined && undefined.__assign) || function () {
4301
4330
  };
4302
4331
  return __assign$4.apply(this, arguments);
4303
4332
  };
4304
- var __rest$4 = (undefined && undefined.__rest) || function (s, e) {
4333
+ var __rest$3 = (undefined && undefined.__rest) || function (s, e) {
4305
4334
  var t = {};
4306
4335
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4307
4336
  t[p] = s[p];
@@ -4314,7 +4343,8 @@ var __rest$4 = (undefined && undefined.__rest) || function (s, e) {
4314
4343
  };
4315
4344
  var className$2 = 'react-calendar__month-view__days__day';
4316
4345
  function Day(_a) {
4317
- var calendarType = _a.calendarType, _b = _a.classes, classes = _b === void 0 ? [] : _b, currentMonthIndex = _a.currentMonthIndex, _c = _a.formatDay, formatDay$1 = _c === void 0 ? formatDay : _c, _d = _a.formatLongDate, formatLongDate$1 = _d === void 0 ? formatLongDate : _d, otherProps = __rest$4(_a, ["calendarType", "classes", "currentMonthIndex", "formatDay", "formatLongDate"]);
4346
+ var calendarTypeOrDeprecatedCalendarType = _a.calendarType, _b = _a.classes, classes = _b === void 0 ? [] : _b, currentMonthIndex = _a.currentMonthIndex, _c = _a.formatDay, formatDay$1 = _c === void 0 ? formatDay : _c, _d = _a.formatLongDate, formatLongDate$1 = _d === void 0 ? formatLongDate : _d, otherProps = __rest$3(_a, ["calendarType", "classes", "currentMonthIndex", "formatDay", "formatLongDate"]);
4347
+ var calendarType = mapCalendarType(calendarTypeOrDeprecatedCalendarType);
4318
4348
  var date = otherProps.date, locale = otherProps.locale;
4319
4349
  var classesProps = [];
4320
4350
  if (classes) {
@@ -4329,9 +4359,8 @@ function Day(_a) {
4329
4359
  if (date.getMonth() !== currentMonthIndex) {
4330
4360
  classesProps.push("".concat(className$2, "--neighboringMonth"));
4331
4361
  }
4332
- return (React.createElement(Tile$1, __assign$4({}, otherProps, { classes: classesProps, formatAbbr: formatLongDate$1, maxDateTransform: getDayEnd, minDateTransform: getDayStart, view: "month" }), formatDay$1(locale, date)));
4362
+ return (React.createElement(Tile, __assign$4({}, otherProps, { classes: classesProps, formatAbbr: formatLongDate$1, maxDateTransform: getDayEnd, minDateTransform: getDayStart, view: "month" }), formatDay$1(locale, date)));
4333
4363
  }
4334
- Day.propTypes = __assign$4(__assign$4({}, tileProps), { currentMonthIndex: PropTypes.number.isRequired, formatDay: PropTypes.func, formatLongDate: PropTypes.func });
4335
4364
 
4336
4365
  var __assign$3 = (undefined && undefined.__assign) || function () {
4337
4366
  __assign$3 = Object.assign || function(t) {
@@ -4344,7 +4373,7 @@ var __assign$3 = (undefined && undefined.__assign) || function () {
4344
4373
  };
4345
4374
  return __assign$3.apply(this, arguments);
4346
4375
  };
4347
- var __rest$3 = (undefined && undefined.__rest) || function (s, e) {
4376
+ var __rest$2 = (undefined && undefined.__rest) || function (s, e) {
4348
4377
  var t = {};
4349
4378
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4350
4379
  t[p] = s[p];
@@ -4356,8 +4385,8 @@ var __rest$3 = (undefined && undefined.__rest) || function (s, e) {
4356
4385
  return t;
4357
4386
  };
4358
4387
  function Days(props) {
4359
- var activeStartDate = props.activeStartDate, calendarType = props.calendarType;
4360
- var showFixedNumberOfWeeks = props.showFixedNumberOfWeeks, showNeighboringMonth = props.showNeighboringMonth, otherProps = __rest$3(props, ["showFixedNumberOfWeeks", "showNeighboringMonth"]);
4388
+ var activeStartDate = props.activeStartDate, calendarTypeOrDeprecatedCalendarType = props.calendarType, hover = props.hover, showFixedNumberOfWeeks = props.showFixedNumberOfWeeks, showNeighboringMonth = props.showNeighboringMonth, value = props.value, valueType = props.valueType, otherProps = __rest$2(props, ["activeStartDate", "calendarType", "hover", "showFixedNumberOfWeeks", "showNeighboringMonth", "value", "valueType"]);
4389
+ var calendarType = mapCalendarType(calendarTypeOrDeprecatedCalendarType);
4361
4390
  var year = getYear(activeStartDate);
4362
4391
  var monthIndex = getMonth(activeStartDate);
4363
4392
  var hasFixedNumberOfWeeks = showFixedNumberOfWeeks || showNeighboringMonth;
@@ -4389,19 +4418,21 @@ function Days(props) {
4389
4418
  }
4390
4419
  return daysInMonth;
4391
4420
  })();
4392
- return (React.createElement(TileGroup, __assign$3({}, otherProps, { className: "react-calendar__month-view__days", count: 7, currentMonthIndex: monthIndex, dateTransform: function (day) {
4421
+ return (React.createElement(TileGroup, { className: "react-calendar__month-view__days", count: 7, dateTransform: function (day) {
4393
4422
  var date = new Date();
4394
4423
  date.setFullYear(year, monthIndex, day);
4395
- date.setHours(0, 0, 0, 0);
4396
- return date;
4397
- }, dateType: "day", end: end, offset: offset, start: start, tile: Day })));
4424
+ return getDayStart(date);
4425
+ }, dateType: "day", hover: hover, end: end, renderTile: function (_a) {
4426
+ var date = _a.date, otherTileProps = __rest$2(_a, ["date"]);
4427
+ return (React.createElement(Day, __assign$3({ key: date.getTime() }, otherProps, otherTileProps, { activeStartDate: activeStartDate, calendarType: calendarTypeOrDeprecatedCalendarType, currentMonthIndex: monthIndex, date: date })));
4428
+ }, offset: offset, start: start, value: value, valueType: valueType }));
4398
4429
  }
4399
- Days.propTypes = __assign$3({ calendarType: isCalendarType, showFixedNumberOfWeeks: PropTypes.bool, showNeighboringMonth: PropTypes.bool }, tileGroupProps);
4400
4430
 
4401
4431
  var className$1 = 'react-calendar__month-view__weekdays';
4402
4432
  var weekdayClassName = "".concat(className$1, "__weekday");
4403
4433
  function Weekdays(props) {
4404
- var calendarType = props.calendarType, _a = props.formatShortWeekday, formatShortWeekday$1 = _a === void 0 ? formatShortWeekday : _a, _b = props.formatWeekday, formatWeekday$1 = _b === void 0 ? formatWeekday : _b, locale = props.locale, onMouseLeave = props.onMouseLeave;
4434
+ var calendarTypeOrDeprecatedCalendarType = props.calendarType, _a = props.formatShortWeekday, formatShortWeekday$1 = _a === void 0 ? formatShortWeekday : _a, _b = props.formatWeekday, formatWeekday$1 = _b === void 0 ? formatWeekday : _b, locale = props.locale, onMouseLeave = props.onMouseLeave;
4435
+ var calendarType = mapCalendarType(calendarTypeOrDeprecatedCalendarType);
4405
4436
  var anyDate = new Date();
4406
4437
  var beginOfMonth = getMonthStart(anyDate);
4407
4438
  var year = getYear(beginOfMonth);
@@ -4415,13 +4446,6 @@ function Weekdays(props) {
4415
4446
  }
4416
4447
  return (React.createElement(Flex, { className: className$1, count: 7, onFocus: onMouseLeave, onMouseOver: onMouseLeave }, weekdays));
4417
4448
  }
4418
- Weekdays.propTypes = {
4419
- calendarType: isCalendarType,
4420
- formatShortWeekday: PropTypes.func,
4421
- formatWeekday: PropTypes.func,
4422
- locale: PropTypes.string,
4423
- onMouseLeave: PropTypes.func,
4424
- };
4425
4449
 
4426
4450
  var __assign$2 = (undefined && undefined.__assign) || function () {
4427
4451
  __assign$2 = Object.assign || function(t) {
@@ -4434,7 +4458,7 @@ var __assign$2 = (undefined && undefined.__assign) || function () {
4434
4458
  };
4435
4459
  return __assign$2.apply(this, arguments);
4436
4460
  };
4437
- var __rest$2 = (undefined && undefined.__rest) || function (s, e) {
4461
+ var __rest$1 = (undefined && undefined.__rest) || function (s, e) {
4438
4462
  var t = {};
4439
4463
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4440
4464
  t[p] = s[p];
@@ -4450,22 +4474,18 @@ function WeekNumber(props) {
4450
4474
  var onClickWeekNumber = props.onClickWeekNumber, weekNumber = props.weekNumber;
4451
4475
  var children = React.createElement("span", null, weekNumber);
4452
4476
  if (onClickWeekNumber) {
4453
- var date_1 = props.date, onClickWeekNumber_1 = props.onClickWeekNumber, weekNumber_1 = props.weekNumber, otherProps = __rest$2(props, ["date", "onClickWeekNumber", "weekNumber"]);
4477
+ var date_1 = props.date, onClickWeekNumber_1 = props.onClickWeekNumber, weekNumber_1 = props.weekNumber, otherProps = __rest$1(props, ["date", "onClickWeekNumber", "weekNumber"]);
4454
4478
  return (React.createElement("button", __assign$2({}, otherProps, { className: className, onClick: function (event) { return onClickWeekNumber_1(weekNumber_1, date_1, event); }, type: "button" }), children));
4455
4479
  }
4456
4480
  else {
4457
- props.date; props.onClickWeekNumber; props.weekNumber; var otherProps = __rest$2(props, ["date", "onClickWeekNumber", "weekNumber"]);
4481
+ props.date; props.onClickWeekNumber; props.weekNumber; var otherProps = __rest$1(props, ["date", "onClickWeekNumber", "weekNumber"]);
4458
4482
  return (React.createElement("div", __assign$2({}, otherProps, { className: className }), children));
4459
4483
  }
4460
4484
  }
4461
- WeekNumber.propTypes = {
4462
- date: PropTypes.instanceOf(Date).isRequired,
4463
- onClickWeekNumber: PropTypes.func,
4464
- weekNumber: PropTypes.node.isRequired,
4465
- };
4466
4485
 
4467
4486
  function WeekNumbers(props) {
4468
- var activeStartDate = props.activeStartDate, calendarType = props.calendarType, onClickWeekNumber = props.onClickWeekNumber, onMouseLeave = props.onMouseLeave, showFixedNumberOfWeeks = props.showFixedNumberOfWeeks;
4487
+ var activeStartDate = props.activeStartDate, calendarTypeOrDeprecatedCalendarType = props.calendarType, onClickWeekNumber = props.onClickWeekNumber, onMouseLeave = props.onMouseLeave, showFixedNumberOfWeeks = props.showFixedNumberOfWeeks;
4488
+ var calendarType = mapCalendarType(calendarTypeOrDeprecatedCalendarType);
4469
4489
  var numberOfWeeks = (function () {
4470
4490
  if (showFixedNumberOfWeeks) {
4471
4491
  return 6;
@@ -4494,13 +4514,6 @@ function WeekNumbers(props) {
4494
4514
  return (React.createElement(WeekNumber, { key: weekNumber, date: date, onClickWeekNumber: onClickWeekNumber, weekNumber: weekNumber }));
4495
4515
  })));
4496
4516
  }
4497
- WeekNumbers.propTypes = {
4498
- activeStartDate: PropTypes.instanceOf(Date).isRequired,
4499
- calendarType: isCalendarType,
4500
- onClickWeekNumber: PropTypes.func,
4501
- onMouseLeave: PropTypes.func,
4502
- showFixedNumberOfWeeks: PropTypes.bool,
4503
- };
4504
4517
 
4505
4518
  var __assign$1 = (undefined && undefined.__assign) || function () {
4506
4519
  __assign$1 = Object.assign || function(t) {
@@ -4513,7 +4526,7 @@ var __assign$1 = (undefined && undefined.__assign) || function () {
4513
4526
  };
4514
4527
  return __assign$1.apply(this, arguments);
4515
4528
  };
4516
- var __rest$1 = (undefined && undefined.__rest) || function (s, e) {
4529
+ var __rest = (undefined && undefined.__rest) || function (s, e) {
4517
4530
  var t = {};
4518
4531
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4519
4532
  t[p] = s[p];
@@ -4525,17 +4538,19 @@ var __rest$1 = (undefined && undefined.__rest) || function (s, e) {
4525
4538
  return t;
4526
4539
  };
4527
4540
  function getCalendarTypeFromLocale(locale) {
4528
- for (var _i = 0, _a = Object.entries(CALENDAR_TYPE_LOCALES); _i < _a.length; _i++) {
4529
- var _b = _a[_i], calendarType = _b[0], locales = _b[1];
4530
- if (locales.includes(locale)) {
4531
- return calendarType;
4541
+ if (locale) {
4542
+ for (var _i = 0, _a = Object.entries(CALENDAR_TYPE_LOCALES); _i < _a.length; _i++) {
4543
+ var _b = _a[_i], calendarType = _b[0], locales = _b[1];
4544
+ if (locales.includes(locale)) {
4545
+ return calendarType;
4546
+ }
4532
4547
  }
4533
4548
  }
4534
4549
  return CALENDAR_TYPES.ISO_8601;
4535
4550
  }
4536
- function MonthView(props) {
4551
+ var MonthView = function MonthView(props) {
4537
4552
  var activeStartDate = props.activeStartDate, locale = props.locale, onMouseLeave = props.onMouseLeave, showFixedNumberOfWeeks = props.showFixedNumberOfWeeks;
4538
- var _a = props.calendarType, calendarType = _a === void 0 ? getCalendarTypeFromLocale(locale) : _a, formatShortWeekday = props.formatShortWeekday, formatWeekday = props.formatWeekday, onClickWeekNumber = props.onClickWeekNumber, showWeekNumbers = props.showWeekNumbers, childProps = __rest$1(props, ["calendarType", "formatShortWeekday", "formatWeekday", "onClickWeekNumber", "showWeekNumbers"]);
4553
+ var _a = props.calendarType, calendarType = _a === void 0 ? getCalendarTypeFromLocale(locale) : _a, formatShortWeekday = props.formatShortWeekday, formatWeekday = props.formatWeekday, onClickWeekNumber = props.onClickWeekNumber, showWeekNumbers = props.showWeekNumbers, childProps = __rest(props, ["calendarType", "formatShortWeekday", "formatWeekday", "onClickWeekNumber", "showWeekNumbers"]);
4539
4554
  function renderWeekdays() {
4540
4555
  return (React.createElement(Weekdays, { calendarType: calendarType, formatShortWeekday: formatShortWeekday, formatWeekday: formatWeekday, locale: locale, onMouseLeave: onMouseLeave }));
4541
4556
  }
@@ -4561,24 +4576,10 @@ function MonthView(props) {
4561
4576
  } },
4562
4577
  renderWeekdays(),
4563
4578
  renderDays()))));
4564
- }
4579
+ };
4565
4580
  MonthView.propTypes = __assign$1(__assign$1({}, tileGroupProps), { calendarType: isCalendarType, formatDay: PropTypes.func, formatLongDate: PropTypes.func, formatShortWeekday: PropTypes.func, formatWeekday: PropTypes.func, onClickWeekNumber: PropTypes.func, onMouseLeave: PropTypes.func, showFixedNumberOfWeeks: PropTypes.bool, showNeighboringMonth: PropTypes.bool, showWeekNumbers: PropTypes.bool });
4581
+ var MonthView$1 = MonthView;
4566
4582
 
4567
- var __extends = (undefined && undefined.__extends) || (function () {
4568
- var extendStatics = function (d, b) {
4569
- extendStatics = Object.setPrototypeOf ||
4570
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
4571
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
4572
- return extendStatics(d, b);
4573
- };
4574
- return function (d, b) {
4575
- if (typeof b !== "function" && b !== null)
4576
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
4577
- extendStatics(d, b);
4578
- function __() { this.constructor = d; }
4579
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
4580
- };
4581
- })();
4582
4583
  var __assign = (undefined && undefined.__assign) || function () {
4583
4584
  __assign = Object.assign || function(t) {
4584
4585
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -4590,17 +4591,6 @@ var __assign = (undefined && undefined.__assign) || function () {
4590
4591
  };
4591
4592
  return __assign.apply(this, arguments);
4592
4593
  };
4593
- var __rest = (undefined && undefined.__rest) || function (s, e) {
4594
- var t = {};
4595
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4596
- t[p] = s[p];
4597
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
4598
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
4599
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
4600
- t[p[i]] = s[p[i]];
4601
- }
4602
- return t;
4603
- };
4604
4594
  var baseClassName = 'react-calendar';
4605
4595
  var allViews = ['century', 'decade', 'year', 'month'];
4606
4596
  var allValueTypes = ['decade', 'year', 'month', 'day'];
@@ -4608,16 +4598,6 @@ var defaultMinDate = new Date();
4608
4598
  defaultMinDate.setFullYear(1, 0, 1);
4609
4599
  defaultMinDate.setHours(0, 0, 0, 0);
4610
4600
  var defaultMaxDate = new Date(8.64e15);
4611
- var defaultProps = {
4612
- goToRangeStartOnSelect: true,
4613
- maxDate: defaultMaxDate,
4614
- maxDetail: 'month',
4615
- minDate: defaultMinDate,
4616
- minDetail: 'century',
4617
- returnValue: 'start',
4618
- showNavigation: true,
4619
- showNeighboringMonth: true,
4620
- };
4621
4601
  function toDate(value) {
4622
4602
  if (value instanceof Date) {
4623
4603
  return value;
@@ -4692,8 +4672,8 @@ var getDetailValueTo = function (args) { return getDetailValue(args, 1); };
4692
4672
  var getDetailValueArray = function (args) {
4693
4673
  return [getDetailValueFrom, getDetailValueTo].map(function (fn) { return fn(args); });
4694
4674
  };
4695
- function getActiveStartDate(props) {
4696
- var maxDate = props.maxDate, maxDetail = props.maxDetail, minDate = props.minDate, minDetail = props.minDetail, value = props.value, view = props.view;
4675
+ function getActiveStartDate(_a) {
4676
+ var maxDate = _a.maxDate, maxDetail = _a.maxDetail, minDate = _a.minDate, minDetail = _a.minDetail, value = _a.value, view = _a.view;
4697
4677
  var rangeType = getView(view, minDetail, maxDetail);
4698
4678
  var valueFrom = getDetailValueFrom({
4699
4679
  value: value,
@@ -4703,316 +4683,76 @@ function getActiveStartDate(props) {
4703
4683
  }) || new Date();
4704
4684
  return getBegin(rangeType, valueFrom);
4705
4685
  }
4706
- function getInitialActiveStartDate(props) {
4707
- var activeStartDate = props.activeStartDate, defaultActiveStartDate = props.defaultActiveStartDate, defaultValue = props.defaultValue, defaultView = props.defaultView, maxDetail = props.maxDetail, minDetail = props.minDetail, value = props.value, view = props.view, otherProps = __rest(props, ["activeStartDate", "defaultActiveStartDate", "defaultValue", "defaultView", "maxDetail", "minDetail", "value", "view"]);
4686
+ function getInitialActiveStartDate(_a) {
4687
+ var activeStartDate = _a.activeStartDate, defaultActiveStartDate = _a.defaultActiveStartDate, defaultValue = _a.defaultValue, defaultView = _a.defaultView, maxDate = _a.maxDate, maxDetail = _a.maxDetail, minDate = _a.minDate, minDetail = _a.minDetail, value = _a.value, view = _a.view;
4708
4688
  var rangeType = getView(view, minDetail, maxDetail);
4709
4689
  var valueFrom = activeStartDate || defaultActiveStartDate;
4710
4690
  if (valueFrom) {
4711
4691
  return getBegin(rangeType, valueFrom);
4712
4692
  }
4713
- return getActiveStartDate(__assign({ maxDetail: maxDetail, minDetail: minDetail, value: value || defaultValue, view: view || defaultView }, otherProps));
4693
+ return getActiveStartDate({
4694
+ maxDate: maxDate,
4695
+ maxDetail: maxDetail,
4696
+ minDate: minDate,
4697
+ minDetail: minDetail,
4698
+ value: value || defaultValue,
4699
+ view: view || defaultView,
4700
+ });
4714
4701
  }
4715
4702
  function getIsSingleValue(value) {
4716
4703
  return value && (!Array.isArray(value) || value.length === 1);
4717
4704
  }
4718
- var isActiveStartDate = PropTypes.instanceOf(Date);
4719
- var isValue = PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]);
4720
- var isValueOrValueArray = PropTypes.oneOfType([isValue, PropTypes.arrayOf(isValue)]);
4721
- var Calendar = /** @class */ (function (_super) {
4722
- __extends(Calendar, _super);
4723
- function Calendar() {
4724
- var _this = _super !== null && _super.apply(this, arguments) || this;
4725
- _this.state = {
4726
- activeStartDate: _this.props.defaultActiveStartDate,
4727
- hover: null,
4728
- value: Array.isArray(_this.props.defaultValue)
4729
- ? _this.props.defaultValue.map(function (el) { return (el !== null ? toDate(el) : el); })
4730
- : _this.props.defaultValue !== null && _this.props.defaultValue !== undefined
4731
- ? toDate(_this.props.defaultValue)
4732
- : _this.props.defaultValue,
4733
- view: _this.props.defaultView,
4734
- };
4735
- _this.setStateAndCallCallbacks = function (nextState, event, callback) {
4736
- var _a = _this, previousActiveStartDate = _a.activeStartDate, previousView = _a.view;
4737
- var _b = _this
4738
- .props, allowPartialRange = _b.allowPartialRange, onActiveStartDateChange = _b.onActiveStartDateChange, onChange = _b.onChange, onViewChange = _b.onViewChange, selectRange = _b.selectRange;
4739
- var prevArgs = {
4740
- action: undefined,
4741
- activeStartDate: previousActiveStartDate,
4742
- value: undefined,
4743
- view: previousView,
4744
- };
4745
- _this.setState(nextState, function () {
4746
- var args = {
4747
- action: nextState.action,
4748
- activeStartDate: nextState.activeStartDate || _this.activeStartDate,
4749
- value: ('value' in nextState && nextState.value) || _this.value,
4750
- view: ('view' in nextState && nextState.view) || _this.view,
4751
- };
4752
- function shouldUpdate(key) {
4753
- // Key must exist, and…
4754
- if (!(key in nextState)) {
4755
- return false;
4756
- }
4757
- var nextValue = nextState[key];
4758
- var prevValue = prevArgs[key];
4759
- // …key changed from defined to undefined or the other way around, or…
4760
- if (typeof nextValue !== typeof prevValue) {
4761
- return true;
4762
- }
4763
- // …value changed.
4764
- if (nextValue instanceof Date && prevValue instanceof Date) {
4765
- return nextValue.getTime() !== prevValue.getTime();
4766
- }
4767
- else {
4768
- return nextValue !== prevValue;
4769
- }
4770
- }
4771
- if (shouldUpdate('activeStartDate')) {
4772
- if (onActiveStartDateChange)
4773
- onActiveStartDateChange(args);
4774
- }
4775
- if (shouldUpdate('view')) {
4776
- if (onViewChange)
4777
- onViewChange(args);
4778
- }
4779
- if (shouldUpdate('value')) {
4780
- if (onChange) {
4781
- if (!event) {
4782
- throw new Error('event is required');
4783
- }
4784
- if (selectRange) {
4785
- var isSingleValue = getIsSingleValue(nextState.value);
4786
- if (!isSingleValue) {
4787
- onChange(nextState.value || null, event);
4788
- }
4789
- else if (allowPartialRange) {
4790
- if (Array.isArray(nextState.value)) {
4791
- throw new Error('value must not be an array');
4792
- }
4793
- onChange([nextState.value || null, null], event);
4794
- }
4795
- }
4796
- else {
4797
- onChange(nextState.value || null, event);
4798
- }
4799
- }
4800
- }
4801
- if (callback)
4802
- callback(args);
4803
- });
4804
- };
4805
- /**
4806
- * Called when the user uses navigation buttons.
4807
- */
4808
- _this.setActiveStartDate = function (nextActiveStartDate, action) {
4809
- _this.setStateAndCallCallbacks({
4810
- action: action,
4811
- activeStartDate: nextActiveStartDate,
4812
- });
4813
- };
4814
- _this.drillDown = function (nextActiveStartDate, event) {
4815
- if (!_this.drillDownAvailable) {
4816
- return;
4817
- }
4818
- _this.onClickTile(nextActiveStartDate, event);
4819
- var _a = _this, view = _a.view, views = _a.views;
4820
- var onDrillDown = _this.props.onDrillDown;
4821
- var nextView = views[views.indexOf(view) + 1];
4822
- if (!nextView) {
4823
- throw new Error('Attempted to drill down from the lowest view.');
4824
- }
4825
- _this.setStateAndCallCallbacks({
4826
- action: 'drillDown',
4827
- activeStartDate: nextActiveStartDate,
4828
- view: nextView,
4829
- }, undefined, onDrillDown);
4830
- };
4831
- _this.drillUp = function () {
4832
- if (!_this.drillUpAvailable) {
4833
- return;
4834
- }
4835
- var _a = _this, activeStartDate = _a.activeStartDate, view = _a.view, views = _a.views;
4836
- var onDrillUp = _this.props.onDrillUp;
4837
- var nextView = views[views.indexOf(view) - 1];
4838
- if (!nextView) {
4839
- throw new Error('Attempted to drill up from the highest view.');
4840
- }
4841
- var nextActiveStartDate = getBegin(nextView, activeStartDate);
4842
- _this.setStateAndCallCallbacks({
4843
- action: 'drillUp',
4844
- activeStartDate: nextActiveStartDate,
4845
- view: nextView,
4846
- }, undefined, onDrillUp);
4847
- };
4848
- _this.onChange = function (value, event) {
4849
- var previousValue = _this.value;
4850
- var _a = _this.props, goToRangeStartOnSelect = _a.goToRangeStartOnSelect, selectRange = _a.selectRange;
4851
- _this.onClickTile(value, event);
4852
- var isFirstValueInRange = selectRange && !getIsSingleValue(previousValue);
4853
- var nextValue;
4854
- if (selectRange) {
4855
- // Range selection turned on
4856
- var valueType = _this.valueType;
4857
- if (isFirstValueInRange) {
4858
- // Value has 0 or 2 elements - either way we're starting a new array
4859
- // First value
4860
- nextValue = getBegin(valueType, value);
4861
- }
4862
- else {
4863
- if (!previousValue) {
4864
- throw new Error('previousValue is required');
4865
- }
4866
- if (Array.isArray(previousValue)) {
4867
- throw new Error('previousValue must not be an array');
4868
- }
4869
- // Second value
4870
- nextValue = getValueRange(valueType, previousValue, value);
4871
- }
4872
- }
4873
- else {
4874
- // Range selection turned off
4875
- nextValue = _this.getProcessedValue(value);
4705
+ function areDatesEqual(date1, date2) {
4706
+ return date1 instanceof Date && date2 instanceof Date && date1.getTime() === date2.getTime();
4707
+ }
4708
+ var Calendar = forwardRef(function Calendar(props, ref) {
4709
+ var activeStartDateProps = props.activeStartDate, allowPartialRange = props.allowPartialRange, calendarType = props.calendarType, className = props.className, defaultActiveStartDate = props.defaultActiveStartDate, defaultValue = props.defaultValue, defaultView = props.defaultView, formatDay = props.formatDay, formatLongDate = props.formatLongDate, formatMonth = props.formatMonth, formatMonthYear = props.formatMonthYear, formatShortWeekday = props.formatShortWeekday, formatWeekday = props.formatWeekday, formatYear = props.formatYear, _a = props.goToRangeStartOnSelect, goToRangeStartOnSelect = _a === void 0 ? true : _a, inputRef = props.inputRef, locale = props.locale, _b = props.maxDate, maxDate = _b === void 0 ? defaultMaxDate : _b, _c = props.maxDetail, maxDetail = _c === void 0 ? 'month' : _c, _d = props.minDate, minDate = _d === void 0 ? defaultMinDate : _d, _e = props.minDetail, minDetail = _e === void 0 ? 'century' : _e, navigationAriaLabel = props.navigationAriaLabel, navigationAriaLive = props.navigationAriaLive, navigationLabel = props.navigationLabel, next2AriaLabel = props.next2AriaLabel, next2Label = props.next2Label, nextAriaLabel = props.nextAriaLabel, nextLabel = props.nextLabel, onActiveStartDateChange = props.onActiveStartDateChange, onChangeProps = props.onChange, onClickDay = props.onClickDay, onClickDecade = props.onClickDecade, onClickMonth = props.onClickMonth, onClickWeekNumber = props.onClickWeekNumber, onClickYear = props.onClickYear, onDrillDown = props.onDrillDown, onDrillUp = props.onDrillUp, onViewChange = props.onViewChange, prev2AriaLabel = props.prev2AriaLabel, prev2Label = props.prev2Label, prevAriaLabel = props.prevAriaLabel, prevLabel = props.prevLabel, _f = props.returnValue, returnValue = _f === void 0 ? 'start' : _f, selectRange = props.selectRange, showDoubleView = props.showDoubleView, showFixedNumberOfWeeks = props.showFixedNumberOfWeeks, _g = props.showNavigation, showNavigation = _g === void 0 ? true : _g, _h = props.showNeighboringMonth, showNeighboringMonth = _h === void 0 ? true : _h, showWeekNumbers = props.showWeekNumbers, tileClassName = props.tileClassName, tileContent = props.tileContent, tileDisabled = props.tileDisabled, valueProps = props.value, viewProps = props.view;
4710
+ var _j = useState(defaultActiveStartDate), activeStartDateState = _j[0], setActiveStartDateState = _j[1];
4711
+ var _k = useState(null), hoverState = _k[0], setHoverState = _k[1];
4712
+ var _l = useState(Array.isArray(defaultValue)
4713
+ ? defaultValue.map(function (el) { return (el !== null ? toDate(el) : null); })
4714
+ : defaultValue !== null && defaultValue !== undefined
4715
+ ? toDate(defaultValue)
4716
+ : null), valueState = _l[0], setValueState = _l[1];
4717
+ var _m = useState(defaultView), viewState = _m[0], setViewState = _m[1];
4718
+ var activeStartDate = activeStartDateProps ||
4719
+ activeStartDateState ||
4720
+ getInitialActiveStartDate({
4721
+ activeStartDate: activeStartDateProps,
4722
+ defaultActiveStartDate: defaultActiveStartDate,
4723
+ defaultValue: defaultValue,
4724
+ defaultView: defaultView,
4725
+ maxDate: maxDate,
4726
+ maxDetail: maxDetail,
4727
+ minDate: minDate,
4728
+ minDetail: minDetail,
4729
+ value: valueProps,
4730
+ view: viewProps,
4731
+ });
4732
+ var value = (function () {
4733
+ var rawValue = (function () {
4734
+ // In the middle of range selection, use value from state
4735
+ if (selectRange && getIsSingleValue(valueState)) {
4736
+ return valueState;
4876
4737
  }
4877
- var nextActiveStartDate =
4878
- // Range selection turned off
4879
- !selectRange ||
4880
- // Range selection turned on, first value
4881
- isFirstValueInRange ||
4882
- // Range selection turned on, second value, goToRangeStartOnSelect toggled on
4883
- goToRangeStartOnSelect
4884
- ? getActiveStartDate(__assign(__assign({}, _this.props), { value: nextValue }))
4738
+ return valueProps !== undefined ? valueProps : valueState;
4739
+ })();
4740
+ if (!rawValue) {
4741
+ return null;
4742
+ }
4743
+ return Array.isArray(rawValue)
4744
+ ? rawValue.map(function (el) { return (el !== null ? toDate(el) : null); })
4745
+ : rawValue !== null
4746
+ ? toDate(rawValue)
4885
4747
  : null;
4886
- event.persist();
4887
- _this.setStateAndCallCallbacks({
4888
- action: 'onChange',
4889
- activeStartDate: nextActiveStartDate,
4890
- value: nextValue,
4891
- }, event);
4892
- };
4893
- _this.onClickTile = function (value, event) {
4894
- var view = _this.view;
4895
- var _a = _this
4896
- .props, onClickDay = _a.onClickDay, onClickDecade = _a.onClickDecade, onClickMonth = _a.onClickMonth, onClickYear = _a.onClickYear;
4897
- var callback = (function () {
4898
- switch (view) {
4899
- case 'century':
4900
- return onClickDecade;
4901
- case 'decade':
4902
- return onClickYear;
4903
- case 'year':
4904
- return onClickMonth;
4905
- case 'month':
4906
- return onClickDay;
4907
- default:
4908
- throw new Error("Invalid view: ".concat(view, "."));
4909
- }
4910
- })();
4911
- if (callback)
4912
- callback(value, event);
4913
- };
4914
- _this.onMouseOver = function (value) {
4915
- _this.setState(function (prevState) {
4916
- if (prevState.hover && prevState.hover.getTime() === value.getTime()) {
4917
- return null;
4918
- }
4919
- return { hover: value };
4920
- });
4921
- };
4922
- _this.onMouseLeave = function () {
4923
- _this.setState({ hover: null });
4924
- };
4925
- return _this;
4926
- }
4927
- Object.defineProperty(Calendar.prototype, "activeStartDate", {
4928
- get: function () {
4929
- var activeStartDateProps = this.props.activeStartDate;
4930
- var activeStartDateState = this.state.activeStartDate;
4931
- return (activeStartDateProps ||
4932
- activeStartDateState ||
4933
- getInitialActiveStartDate(this.props));
4934
- },
4935
- enumerable: false,
4936
- configurable: true
4937
- });
4938
- Object.defineProperty(Calendar.prototype, "value", {
4939
- get: function () {
4940
- var _a = this.props, selectRange = _a.selectRange, valueProps = _a.value;
4941
- var valueState = this.state.value;
4942
- var rawValue = (function () {
4943
- // In the middle of range selection, use value from state
4944
- if (selectRange && getIsSingleValue(valueState)) {
4945
- return valueState;
4946
- }
4947
- return valueProps !== undefined ? valueProps : valueState;
4948
- })();
4949
- if (!rawValue) {
4950
- return null;
4951
- }
4952
- return Array.isArray(rawValue)
4953
- ? rawValue.map(function (el) { return (el !== null ? toDate(el) : el); })
4954
- : rawValue !== null
4955
- ? toDate(rawValue)
4956
- : rawValue;
4957
- },
4958
- enumerable: false,
4959
- configurable: true
4960
- });
4961
- Object.defineProperty(Calendar.prototype, "valueType", {
4962
- get: function () {
4963
- var maxDetail = this.props.maxDetail;
4964
- return getValueType(maxDetail);
4965
- },
4966
- enumerable: false,
4967
- configurable: true
4968
- });
4969
- Object.defineProperty(Calendar.prototype, "view", {
4970
- get: function () {
4971
- var _a = this.props, minDetail = _a.minDetail, maxDetail = _a.maxDetail, viewProps = _a.view;
4972
- var viewState = this.state.view;
4973
- return getView(viewProps || viewState, minDetail, maxDetail);
4974
- },
4975
- enumerable: false,
4976
- configurable: true
4977
- });
4978
- Object.defineProperty(Calendar.prototype, "views", {
4979
- get: function () {
4980
- var _a = this.props, minDetail = _a.minDetail, maxDetail = _a.maxDetail;
4981
- return getLimitedViews(minDetail, maxDetail);
4982
- },
4983
- enumerable: false,
4984
- configurable: true
4985
- });
4986
- Object.defineProperty(Calendar.prototype, "hover", {
4987
- get: function () {
4988
- var selectRange = this.props.selectRange;
4989
- var hover = this.state.hover;
4990
- return selectRange ? hover : null;
4991
- },
4992
- enumerable: false,
4993
- configurable: true
4994
- });
4995
- Object.defineProperty(Calendar.prototype, "drillDownAvailable", {
4996
- get: function () {
4997
- var _a = this, view = _a.view, views = _a.views;
4998
- return views.indexOf(view) < views.length - 1;
4999
- },
5000
- enumerable: false,
5001
- configurable: true
5002
- });
5003
- Object.defineProperty(Calendar.prototype, "drillUpAvailable", {
5004
- get: function () {
5005
- var _a = this, view = _a.view, views = _a.views;
5006
- return views.indexOf(view) > 0;
5007
- },
5008
- enumerable: false,
5009
- configurable: true
5010
- });
5011
- /**
5012
- * Gets current value in a desired format.
5013
- */
5014
- Calendar.prototype.getProcessedValue = function (value) {
5015
- var _a = this.props, minDate = _a.minDate, maxDate = _a.maxDate, maxDetail = _a.maxDetail, returnValue = _a.returnValue;
4748
+ })();
4749
+ var valueType = getValueType(maxDetail);
4750
+ var view = getView(viewProps || viewState, minDetail, maxDetail);
4751
+ var views = getLimitedViews(minDetail, maxDetail);
4752
+ var hover = selectRange ? hoverState : null;
4753
+ var drillDownAvailable = views.indexOf(view) < views.length - 1;
4754
+ var drillUpAvailable = views.indexOf(view) > 0;
4755
+ var getProcessedValue = useCallback(function (value) {
5016
4756
  var processFunction = (function () {
5017
4757
  switch (returnValue) {
5018
4758
  case 'start':
@@ -5026,28 +4766,232 @@ var Calendar = /** @class */ (function (_super) {
5026
4766
  }
5027
4767
  })();
5028
4768
  return processFunction({
5029
- value: value,
5030
- minDate: minDate,
5031
4769
  maxDate: maxDate,
5032
4770
  maxDetail: maxDetail,
4771
+ minDate: minDate,
4772
+ value: value,
5033
4773
  });
5034
- };
5035
- Calendar.prototype.renderContent = function (next) {
5036
- var _a = this, currentActiveStartDate = _a.activeStartDate, onMouseOver = _a.onMouseOver, valueType = _a.valueType, value = _a.value, view = _a.view;
5037
- var _b = this.props, calendarType = _b.calendarType, locale = _b.locale, maxDate = _b.maxDate, minDate = _b.minDate, selectRange = _b.selectRange, tileClassName = _b.tileClassName, tileContent = _b.tileContent, tileDisabled = _b.tileDisabled;
5038
- var hover = this.hover;
5039
- var activeStartDate = next
5040
- ? getBeginNext(view, currentActiveStartDate)
5041
- : getBegin(view, currentActiveStartDate);
5042
- var onClick = this.drillDownAvailable ? this.drillDown : this.onChange;
4774
+ }, [maxDate, maxDetail, minDate, returnValue]);
4775
+ var setActiveStartDate = useCallback(function (nextActiveStartDate, action) {
4776
+ setActiveStartDateState(nextActiveStartDate);
4777
+ var args = {
4778
+ action: action,
4779
+ activeStartDate: nextActiveStartDate,
4780
+ value: value,
4781
+ view: view,
4782
+ };
4783
+ if (onActiveStartDateChange && !areDatesEqual(activeStartDate, nextActiveStartDate)) {
4784
+ onActiveStartDateChange(args);
4785
+ }
4786
+ }, [activeStartDate, onActiveStartDateChange, value, view]);
4787
+ var onClickTile = useCallback(function (value, event) {
4788
+ var callback = (function () {
4789
+ switch (view) {
4790
+ case 'century':
4791
+ return onClickDecade;
4792
+ case 'decade':
4793
+ return onClickYear;
4794
+ case 'year':
4795
+ return onClickMonth;
4796
+ case 'month':
4797
+ return onClickDay;
4798
+ default:
4799
+ throw new Error("Invalid view: ".concat(view, "."));
4800
+ }
4801
+ })();
4802
+ if (callback)
4803
+ callback(value, event);
4804
+ }, [onClickDay, onClickDecade, onClickMonth, onClickYear, view]);
4805
+ var drillDown = useCallback(function (nextActiveStartDate, event) {
4806
+ if (!drillDownAvailable) {
4807
+ return;
4808
+ }
4809
+ onClickTile(nextActiveStartDate, event);
4810
+ var nextView = views[views.indexOf(view) + 1];
4811
+ if (!nextView) {
4812
+ throw new Error('Attempted to drill down from the lowest view.');
4813
+ }
4814
+ setActiveStartDateState(nextActiveStartDate);
4815
+ setViewState(nextView);
4816
+ var args = {
4817
+ action: 'drillDown',
4818
+ activeStartDate: nextActiveStartDate,
4819
+ value: value,
4820
+ view: nextView,
4821
+ };
4822
+ if (onActiveStartDateChange && !areDatesEqual(activeStartDate, nextActiveStartDate)) {
4823
+ onActiveStartDateChange(args);
4824
+ }
4825
+ if (onViewChange && view !== nextView) {
4826
+ onViewChange(args);
4827
+ }
4828
+ if (onDrillDown) {
4829
+ onDrillDown(args);
4830
+ }
4831
+ }, [
4832
+ activeStartDate,
4833
+ drillDownAvailable,
4834
+ onActiveStartDateChange,
4835
+ onClickTile,
4836
+ onDrillDown,
4837
+ onViewChange,
4838
+ value,
4839
+ view,
4840
+ views,
4841
+ ]);
4842
+ var drillUp = useCallback(function () {
4843
+ if (!drillUpAvailable) {
4844
+ return;
4845
+ }
4846
+ var nextView = views[views.indexOf(view) - 1];
4847
+ if (!nextView) {
4848
+ throw new Error('Attempted to drill up from the highest view.');
4849
+ }
4850
+ var nextActiveStartDate = getBegin(nextView, activeStartDate);
4851
+ setActiveStartDateState(nextActiveStartDate);
4852
+ setViewState(nextView);
4853
+ var args = {
4854
+ action: 'drillUp',
4855
+ activeStartDate: nextActiveStartDate,
4856
+ value: value,
4857
+ view: nextView,
4858
+ };
4859
+ if (onActiveStartDateChange && !areDatesEqual(activeStartDate, nextActiveStartDate)) {
4860
+ onActiveStartDateChange(args);
4861
+ }
4862
+ if (onViewChange && view !== nextView) {
4863
+ onViewChange(args);
4864
+ }
4865
+ if (onDrillUp) {
4866
+ onDrillUp(args);
4867
+ }
4868
+ }, [
4869
+ activeStartDate,
4870
+ drillUpAvailable,
4871
+ onActiveStartDateChange,
4872
+ onDrillUp,
4873
+ onViewChange,
4874
+ value,
4875
+ view,
4876
+ views,
4877
+ ]);
4878
+ var onChange = useCallback(function (rawNextValue, event) {
4879
+ var previousValue = value;
4880
+ onClickTile(rawNextValue, event);
4881
+ var isFirstValueInRange = selectRange && !getIsSingleValue(previousValue);
4882
+ var nextValue;
4883
+ if (selectRange) {
4884
+ // Range selection turned on
4885
+ if (isFirstValueInRange) {
4886
+ // Value has 0 or 2 elements - either way we're starting a new array
4887
+ // First value
4888
+ nextValue = getBegin(valueType, rawNextValue);
4889
+ }
4890
+ else {
4891
+ if (!previousValue) {
4892
+ throw new Error('previousValue is required');
4893
+ }
4894
+ if (Array.isArray(previousValue)) {
4895
+ throw new Error('previousValue must not be an array');
4896
+ }
4897
+ // Second value
4898
+ nextValue = getValueRange(valueType, previousValue, rawNextValue);
4899
+ }
4900
+ }
4901
+ else {
4902
+ // Range selection turned off
4903
+ nextValue = getProcessedValue(rawNextValue);
4904
+ }
4905
+ var nextActiveStartDate =
4906
+ // Range selection turned off
4907
+ !selectRange ||
4908
+ // Range selection turned on, first value
4909
+ isFirstValueInRange ||
4910
+ // Range selection turned on, second value, goToRangeStartOnSelect toggled on
4911
+ goToRangeStartOnSelect
4912
+ ? getActiveStartDate({
4913
+ maxDate: maxDate,
4914
+ maxDetail: maxDetail,
4915
+ minDate: minDate,
4916
+ minDetail: minDetail,
4917
+ value: nextValue,
4918
+ view: view,
4919
+ })
4920
+ : null;
4921
+ event.persist();
4922
+ setActiveStartDateState(nextActiveStartDate);
4923
+ setValueState(nextValue);
4924
+ var args = {
4925
+ action: 'onChange',
4926
+ activeStartDate: nextActiveStartDate,
4927
+ value: nextValue,
4928
+ view: view,
4929
+ };
4930
+ if (onActiveStartDateChange && !areDatesEqual(activeStartDate, nextActiveStartDate)) {
4931
+ onActiveStartDateChange(args);
4932
+ }
4933
+ if (onChangeProps) {
4934
+ if (selectRange) {
4935
+ var isSingleValue = getIsSingleValue(nextValue);
4936
+ if (!isSingleValue) {
4937
+ onChangeProps(nextValue || null, event);
4938
+ }
4939
+ else if (allowPartialRange) {
4940
+ if (Array.isArray(nextValue)) {
4941
+ throw new Error('value must not be an array');
4942
+ }
4943
+ onChangeProps([nextValue || null, null], event);
4944
+ }
4945
+ }
4946
+ else {
4947
+ onChangeProps(nextValue || null, event);
4948
+ }
4949
+ }
4950
+ }, [
4951
+ activeStartDate,
4952
+ allowPartialRange,
4953
+ getProcessedValue,
4954
+ goToRangeStartOnSelect,
4955
+ maxDate,
4956
+ maxDetail,
4957
+ minDate,
4958
+ minDetail,
4959
+ onActiveStartDateChange,
4960
+ onChangeProps,
4961
+ onClickTile,
4962
+ selectRange,
4963
+ value,
4964
+ valueType,
4965
+ view,
4966
+ ]);
4967
+ function onMouseOver(nextHover) {
4968
+ setHoverState(nextHover);
4969
+ }
4970
+ function onMouseLeave() {
4971
+ setHoverState(null);
4972
+ }
4973
+ useImperativeHandle(ref, function () { return ({
4974
+ activeStartDate: activeStartDate,
4975
+ drillDown: drillDown,
4976
+ drillUp: drillUp,
4977
+ onChange: onChange,
4978
+ setActiveStartDate: setActiveStartDate,
4979
+ value: value,
4980
+ view: view,
4981
+ }); }, [activeStartDate, drillDown, drillUp, onChange, setActiveStartDate, value, view]);
4982
+ function renderContent(next) {
4983
+ var currentActiveStartDate = next
4984
+ ? getBeginNext(view, activeStartDate)
4985
+ : getBegin(view, activeStartDate);
4986
+ var onClick = drillDownAvailable ? drillDown : onChange;
5043
4987
  var commonProps = {
5044
- activeStartDate: activeStartDate,
4988
+ activeStartDate: currentActiveStartDate,
5045
4989
  hover: hover,
5046
4990
  locale: locale,
5047
4991
  maxDate: maxDate,
5048
4992
  minDate: minDate,
5049
4993
  onClick: onClick,
5050
- onMouseOver: selectRange ? onMouseOver : null,
4994
+ onMouseOver: selectRange ? onMouseOver : undefined,
5051
4995
  tileClassName: tileClassName,
5052
4996
  tileContent: tileContent,
5053
4997
  tileDisabled: tileDisabled,
@@ -5056,107 +5000,95 @@ var Calendar = /** @class */ (function (_super) {
5056
5000
  };
5057
5001
  switch (view) {
5058
5002
  case 'century': {
5059
- var formatYear = this.props.formatYear;
5060
- return React.createElement(CenturyView, __assign({ formatYear: formatYear }, commonProps));
5003
+ return React.createElement(CenturyView$1, __assign({ formatYear: formatYear }, commonProps));
5061
5004
  }
5062
5005
  case 'decade': {
5063
- var formatYear = this.props.formatYear;
5064
- return React.createElement(DecadeView, __assign({ formatYear: formatYear }, commonProps));
5006
+ return React.createElement(DecadeView$1, __assign({ formatYear: formatYear }, commonProps));
5065
5007
  }
5066
5008
  case 'year': {
5067
- var _c = this.props, formatMonth = _c.formatMonth, formatMonthYear = _c.formatMonthYear;
5068
- return (React.createElement(YearView, __assign({ formatMonth: formatMonth, formatMonthYear: formatMonthYear }, commonProps)));
5009
+ return (React.createElement(YearView$1, __assign({ formatMonth: formatMonth, formatMonthYear: formatMonthYear }, commonProps)));
5069
5010
  }
5070
5011
  case 'month': {
5071
- var _d = this.props, formatDay = _d.formatDay, formatLongDate = _d.formatLongDate, formatShortWeekday = _d.formatShortWeekday, formatWeekday = _d.formatWeekday, onClickWeekNumber = _d.onClickWeekNumber, showDoubleView = _d.showDoubleView, showFixedNumberOfWeeks = _d.showFixedNumberOfWeeks, showNeighboringMonth = _d.showNeighboringMonth, showWeekNumbers = _d.showWeekNumbers;
5072
- var onMouseLeave = this.onMouseLeave;
5073
- return (React.createElement(MonthView, __assign({ calendarType: calendarType, formatDay: formatDay, formatLongDate: formatLongDate, formatShortWeekday: formatShortWeekday, formatWeekday: formatWeekday, onClickWeekNumber: onClickWeekNumber, onMouseLeave: selectRange ? onMouseLeave : null, showFixedNumberOfWeeks: typeof showFixedNumberOfWeeks !== 'undefined'
5012
+ return (React.createElement(MonthView$1, __assign({ calendarType: calendarType, formatDay: formatDay, formatLongDate: formatLongDate, formatShortWeekday: formatShortWeekday, formatWeekday: formatWeekday, onClickWeekNumber: onClickWeekNumber, onMouseLeave: selectRange ? onMouseLeave : undefined, showFixedNumberOfWeeks: typeof showFixedNumberOfWeeks !== 'undefined'
5074
5013
  ? showFixedNumberOfWeeks
5075
5014
  : showDoubleView, showNeighboringMonth: showNeighboringMonth, showWeekNumbers: showWeekNumbers }, commonProps)));
5076
5015
  }
5077
5016
  default:
5078
5017
  throw new Error("Invalid view: ".concat(view, "."));
5079
5018
  }
5080
- };
5081
- Calendar.prototype.renderNavigation = function () {
5082
- var showNavigation = this.props.showNavigation;
5019
+ }
5020
+ function renderNavigation() {
5083
5021
  if (!showNavigation) {
5084
5022
  return null;
5085
5023
  }
5086
- var _a = this, activeStartDate = _a.activeStartDate, view = _a.view, views = _a.views;
5087
- var _b = this.props, formatMonthYear = _b.formatMonthYear, formatYear = _b.formatYear, locale = _b.locale, maxDate = _b.maxDate, minDate = _b.minDate, navigationAriaLabel = _b.navigationAriaLabel, navigationAriaLive = _b.navigationAriaLive, navigationLabel = _b.navigationLabel, next2AriaLabel = _b.next2AriaLabel, next2Label = _b.next2Label, nextAriaLabel = _b.nextAriaLabel, nextLabel = _b.nextLabel, prev2AriaLabel = _b.prev2AriaLabel, prev2Label = _b.prev2Label, prevAriaLabel = _b.prevAriaLabel, prevLabel = _b.prevLabel, showDoubleView = _b.showDoubleView;
5088
- return (React.createElement(Navigation, { activeStartDate: activeStartDate, drillUp: this.drillUp, formatMonthYear: formatMonthYear, formatYear: formatYear, locale: locale, maxDate: maxDate, minDate: minDate, navigationAriaLabel: navigationAriaLabel, navigationAriaLive: navigationAriaLive, navigationLabel: navigationLabel, next2AriaLabel: next2AriaLabel, next2Label: next2Label, nextAriaLabel: nextAriaLabel, nextLabel: nextLabel, prev2AriaLabel: prev2AriaLabel, prev2Label: prev2Label, prevAriaLabel: prevAriaLabel, prevLabel: prevLabel, setActiveStartDate: this.setActiveStartDate, showDoubleView: showDoubleView, view: view, views: views }));
5089
- };
5090
- Calendar.prototype.render = function () {
5091
- var _a = this
5092
- .props, className = _a.className, inputRef = _a.inputRef, selectRange = _a.selectRange, showDoubleView = _a.showDoubleView;
5093
- var _b = this, onMouseLeave = _b.onMouseLeave, value = _b.value;
5094
- var valueArray = Array.isArray(value) ? value : [value];
5095
- return (React.createElement("div", { className: clsx(baseClassName, selectRange && valueArray.length === 1 && "".concat(baseClassName, "--selectRange"), showDoubleView && "".concat(baseClassName, "--doubleView"), className), ref: inputRef },
5096
- this.renderNavigation(),
5097
- React.createElement("div", { className: "".concat(baseClassName, "__viewContainer"), onBlur: selectRange ? onMouseLeave : undefined, onMouseLeave: selectRange ? onMouseLeave : undefined },
5098
- this.renderContent(),
5099
- showDoubleView ? this.renderContent(true) : null)));
5100
- };
5101
- Calendar.defaultProps = defaultProps;
5102
- Calendar.propTypes = {
5103
- activeStartDate: isActiveStartDate,
5104
- allowPartialRange: PropTypes.bool,
5105
- calendarType: isCalendarType,
5106
- className: isClassName,
5107
- defaultActiveStartDate: isActiveStartDate,
5108
- defaultValue: isValueOrValueArray,
5109
- defaultView: isView,
5110
- formatDay: PropTypes.func,
5111
- formatLongDate: PropTypes.func,
5112
- formatMonth: PropTypes.func,
5113
- formatMonthYear: PropTypes.func,
5114
- formatShortWeekday: PropTypes.func,
5115
- formatWeekday: PropTypes.func,
5116
- formatYear: PropTypes.func,
5117
- goToRangeStartOnSelect: PropTypes.bool,
5118
- inputRef: isRef,
5119
- locale: PropTypes.string,
5120
- maxDate: isMaxDate,
5121
- maxDetail: PropTypes.oneOf(allViews),
5122
- minDate: isMinDate,
5123
- minDetail: PropTypes.oneOf(allViews),
5124
- navigationAriaLabel: PropTypes.string,
5125
- navigationAriaLive: PropTypes.oneOf(['off', 'polite', 'assertive']),
5126
- navigationLabel: PropTypes.func,
5127
- next2AriaLabel: PropTypes.string,
5128
- next2Label: PropTypes.node,
5129
- nextAriaLabel: PropTypes.string,
5130
- nextLabel: PropTypes.node,
5131
- onActiveStartDateChange: PropTypes.func,
5132
- onChange: PropTypes.func,
5133
- onClickDay: PropTypes.func,
5134
- onClickDecade: PropTypes.func,
5135
- onClickMonth: PropTypes.func,
5136
- onClickWeekNumber: PropTypes.func,
5137
- onClickYear: PropTypes.func,
5138
- onDrillDown: PropTypes.func,
5139
- onDrillUp: PropTypes.func,
5140
- onViewChange: PropTypes.func,
5141
- prev2AriaLabel: PropTypes.string,
5142
- prev2Label: PropTypes.node,
5143
- prevAriaLabel: PropTypes.string,
5144
- prevLabel: PropTypes.node,
5145
- returnValue: PropTypes.oneOf(['start', 'end', 'range']),
5146
- selectRange: PropTypes.bool,
5147
- showDoubleView: PropTypes.bool,
5148
- showFixedNumberOfWeeks: PropTypes.bool,
5149
- showNavigation: PropTypes.bool,
5150
- showNeighboringMonth: PropTypes.bool,
5151
- showWeekNumbers: PropTypes.bool,
5152
- tileClassName: PropTypes.oneOfType([PropTypes.func, isClassName]),
5153
- tileContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
5154
- tileDisabled: PropTypes.func,
5155
- value: isValueOrValueArray,
5156
- view: isView,
5157
- };
5158
- return Calendar;
5159
- }(Component));
5024
+ return (React.createElement(Navigation, { activeStartDate: activeStartDate, drillUp: drillUp, formatMonthYear: formatMonthYear, formatYear: formatYear, locale: locale, maxDate: maxDate, minDate: minDate, navigationAriaLabel: navigationAriaLabel, navigationAriaLive: navigationAriaLive, navigationLabel: navigationLabel, next2AriaLabel: next2AriaLabel, next2Label: next2Label, nextAriaLabel: nextAriaLabel, nextLabel: nextLabel, prev2AriaLabel: prev2AriaLabel, prev2Label: prev2Label, prevAriaLabel: prevAriaLabel, prevLabel: prevLabel, setActiveStartDate: setActiveStartDate, showDoubleView: showDoubleView, view: view, views: views }));
5025
+ }
5026
+ var valueArray = Array.isArray(value) ? value : [value];
5027
+ return (React.createElement("div", { className: clsx(baseClassName, selectRange && valueArray.length === 1 && "".concat(baseClassName, "--selectRange"), showDoubleView && "".concat(baseClassName, "--doubleView"), className), ref: inputRef },
5028
+ renderNavigation(),
5029
+ React.createElement("div", { className: "".concat(baseClassName, "__viewContainer"), onBlur: selectRange ? onMouseLeave : undefined, onMouseLeave: selectRange ? onMouseLeave : undefined },
5030
+ renderContent(),
5031
+ showDoubleView ? renderContent(true) : null)));
5032
+ });
5033
+ var isActiveStartDate = PropTypes.instanceOf(Date);
5034
+ var isValue = PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]);
5035
+ var isValueOrValueArray = PropTypes.oneOfType([isValue, rangeOf(isValue)]);
5036
+ Calendar.propTypes = {
5037
+ activeStartDate: isActiveStartDate,
5038
+ allowPartialRange: PropTypes.bool,
5039
+ calendarType: isCalendarType,
5040
+ className: isClassName,
5041
+ defaultActiveStartDate: isActiveStartDate,
5042
+ defaultValue: isValueOrValueArray,
5043
+ defaultView: isView,
5044
+ formatDay: PropTypes.func,
5045
+ formatLongDate: PropTypes.func,
5046
+ formatMonth: PropTypes.func,
5047
+ formatMonthYear: PropTypes.func,
5048
+ formatShortWeekday: PropTypes.func,
5049
+ formatWeekday: PropTypes.func,
5050
+ formatYear: PropTypes.func,
5051
+ goToRangeStartOnSelect: PropTypes.bool,
5052
+ inputRef: isRef,
5053
+ locale: PropTypes.string,
5054
+ maxDate: isMaxDate,
5055
+ maxDetail: PropTypes.oneOf(allViews),
5056
+ minDate: isMinDate,
5057
+ minDetail: PropTypes.oneOf(allViews),
5058
+ navigationAriaLabel: PropTypes.string,
5059
+ navigationAriaLive: PropTypes.oneOf(['off', 'polite', 'assertive']),
5060
+ navigationLabel: PropTypes.func,
5061
+ next2AriaLabel: PropTypes.string,
5062
+ next2Label: PropTypes.node,
5063
+ nextAriaLabel: PropTypes.string,
5064
+ nextLabel: PropTypes.node,
5065
+ onActiveStartDateChange: PropTypes.func,
5066
+ onChange: PropTypes.func,
5067
+ onClickDay: PropTypes.func,
5068
+ onClickDecade: PropTypes.func,
5069
+ onClickMonth: PropTypes.func,
5070
+ onClickWeekNumber: PropTypes.func,
5071
+ onClickYear: PropTypes.func,
5072
+ onDrillDown: PropTypes.func,
5073
+ onDrillUp: PropTypes.func,
5074
+ onViewChange: PropTypes.func,
5075
+ prev2AriaLabel: PropTypes.string,
5076
+ prev2Label: PropTypes.node,
5077
+ prevAriaLabel: PropTypes.string,
5078
+ prevLabel: PropTypes.node,
5079
+ returnValue: PropTypes.oneOf(['start', 'end', 'range']),
5080
+ selectRange: PropTypes.bool,
5081
+ showDoubleView: PropTypes.bool,
5082
+ showFixedNumberOfWeeks: PropTypes.bool,
5083
+ showNavigation: PropTypes.bool,
5084
+ showNeighboringMonth: PropTypes.bool,
5085
+ showWeekNumbers: PropTypes.bool,
5086
+ tileClassName: PropTypes.oneOfType([PropTypes.func, isClassName]),
5087
+ tileContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
5088
+ tileDisabled: PropTypes.func,
5089
+ value: isValueOrValueArray,
5090
+ view: isView,
5091
+ };
5160
5092
  var Calendar$1 = Calendar;
5161
5093
 
5162
5094
  var css_248z$G = ".DatePicker-module_datePicker__mTJ3f {\n width: 100%;\n}";
@@ -7295,7 +7227,7 @@ Array.prototype.distinct = function (comparator) {
7295
7227
  };
7296
7228
 
7297
7229
  var dayjs_min = createCommonjsModule(function (module, exports) {
7298
- !function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p=function(t){return t instanceof _},S=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=v;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t);}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return O},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),l=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(h){case c:return r?l(1,0):l(31,11);case f:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),l=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,l=this;r=Number(r);var $=O.p(h),y=function(t){var e=w(l);return O.w(e.date(e.date()+Math.round(t*r)),l)};if($===f)return this.set(f,this.$M+r);if($===c)return this.set(c,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},$={YY:String(this.$y).slice(-2),YYYY:O.s(this.$y,4,"0"),M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||$[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,v=this-M,g=O.m(this,M);return g=($={},$[c]=g/12,$[f]=g,$[h]=g/3,$[o]=(v-m)/6048e5,$[a]=(v-m)/864e5,$[u]=v/n,$[s]=v/e,$[i]=v/t,$)[y]||v,l?g:O.a(g)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),T=_.prototype;return w.prototype=T,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){T[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=D[g],w.Ls=D,w.p={},w}));
7230
+ !function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
7299
7231
  });
7300
7232
 
7301
7233
  var localizedFormat = createCommonjsModule(function (module, exports) {