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