@hero-design/rn 8.63.1-alpha.0 → 8.63.2-alpha.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.
Files changed (103) hide show
  1. package/CHANGELOG.md +5 -11
  2. package/es/index.js +943 -898
  3. package/lib/index.js +943 -898
  4. package/package.json +21 -21
  5. package/src/components/AnimatedScroller/__tests__/__snapshots__/ScrollablesWithFAB.spec.tsx.snap +0 -21
  6. package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +0 -12
  7. package/src/components/DatePicker/__tests__/__snapshots__/DatePicker.spec.tsx.snap +0 -12
  8. package/src/components/Error/index.tsx +2 -2
  9. package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +0 -7
  10. package/src/components/RichTextEditor/__tests__/__snapshots__/MentionList.spec.tsx.snap +1 -1
  11. package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +4 -4
  12. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +4 -16
  13. package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +4 -4
  14. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +3 -15
  15. package/src/components/Tabs/ScrollableTabs.tsx +5 -3
  16. package/src/components/Tabs/StyledScrollableTabs.tsx +0 -6
  17. package/src/components/Tabs/StyledTabs.tsx +0 -8
  18. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +12 -9
  19. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabsHeader.spec.tsx.snap +2 -2
  20. package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +9 -6
  21. package/src/components/Tabs/index.tsx +6 -3
  22. package/types/components/Accordion/StyledAccordion.d.ts +0 -1
  23. package/types/components/Alert/StyledAlert.d.ts +0 -1
  24. package/types/components/Attachment/StyledAttachment.d.ts +0 -1
  25. package/types/components/Avatar/AvatarStack/StyledAvatarStack.d.ts +0 -1
  26. package/types/components/Avatar/StyledAvatar.d.ts +0 -1
  27. package/types/components/Avatar/index.d.ts +0 -1
  28. package/types/components/Badge/StyledBadge.d.ts +0 -1
  29. package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +0 -1
  30. package/types/components/BottomSheet/BottomSheetContext.d.ts +0 -1
  31. package/types/components/BottomSheet/ScrollView.d.ts +0 -1
  32. package/types/components/BottomSheet/StyledBottomSheet.d.ts +0 -1
  33. package/types/components/Box/StyledBox.d.ts +0 -1
  34. package/types/components/Box/types.d.ts +0 -1
  35. package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +0 -1
  36. package/types/components/Button/StyledButton.d.ts +0 -1
  37. package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +0 -1
  38. package/types/components/Calendar/StyledCalendar.d.ts +1 -2
  39. package/types/components/Card/DataCard/StyledDataCard.d.ts +0 -1
  40. package/types/components/Card/StyledCard.d.ts +0 -1
  41. package/types/components/Carousel/StyledCardCarousel.d.ts +0 -1
  42. package/types/components/Carousel/StyledCarousel.d.ts +0 -1
  43. package/types/components/Checkbox/StyledCheckbox.d.ts +0 -1
  44. package/types/components/Chip/StyledChip.d.ts +0 -1
  45. package/types/components/Collapse/StyledCollapse.d.ts +0 -1
  46. package/types/components/ContentNavigator/StyledContentNavigator.d.ts +0 -1
  47. package/types/components/DatePicker/StyledDatePicker.d.ts +0 -1
  48. package/types/components/Divider/StyledDivider.d.ts +0 -1
  49. package/types/components/Drawer/StyledDrawer.d.ts +0 -1
  50. package/types/components/Empty/StyledEmpty.d.ts +0 -1
  51. package/types/components/Error/StyledError.d.ts +0 -1
  52. package/types/components/Error/index.d.ts +2 -2
  53. package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +0 -1
  54. package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +0 -1
  55. package/types/components/FAB/StyledFAB.d.ts +0 -1
  56. package/types/components/FAB/index.d.ts +0 -1
  57. package/types/components/Icon/HeroIcon/index.d.ts +0 -1
  58. package/types/components/Icon/utils.d.ts +1 -1
  59. package/types/components/Image/index.d.ts +0 -1
  60. package/types/components/List/StyledBasicListItem.d.ts +0 -1
  61. package/types/components/List/StyledListItem.d.ts +0 -1
  62. package/types/components/PageControl/StyledPageControl.d.ts +0 -1
  63. package/types/components/PinInput/StyledPinInput.d.ts +0 -1
  64. package/types/components/Progress/ProgressBar.d.ts +0 -1
  65. package/types/components/Progress/StyledProgressBar.d.ts +0 -1
  66. package/types/components/Progress/StyledProgressCircle.d.ts +0 -1
  67. package/types/components/Progress/index.d.ts +0 -1
  68. package/types/components/Radio/StyledRadio.d.ts +0 -1
  69. package/types/components/Radio/index.d.ts +0 -1
  70. package/types/components/Rate/StyledRate.d.ts +0 -1
  71. package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +0 -1
  72. package/types/components/RichTextEditor/StyledToolbar.d.ts +0 -1
  73. package/types/components/RichTextEditor/index.d.ts +0 -1
  74. package/types/components/SectionHeading/StyledHeading.d.ts +0 -1
  75. package/types/components/Select/SingleSelect/StyledSingleSelect.d.ts +0 -1
  76. package/types/components/Select/StyledSelect.d.ts +0 -1
  77. package/types/components/Select/index.d.ts +0 -1
  78. package/types/components/Skeleton/StyledSkeleton.d.ts +0 -1
  79. package/types/components/Spinner/StyledSpinner.d.ts +0 -1
  80. package/types/components/Success/StyledSuccess.d.ts +0 -1
  81. package/types/components/Swipeable/StyledSwipeable.d.ts +0 -1
  82. package/types/components/Swipeable/index.d.ts +2 -2
  83. package/types/components/Switch/SelectorSwitch/StyledSelectorSwitch.d.ts +0 -1
  84. package/types/components/Switch/StyledSwitch.d.ts +0 -1
  85. package/types/components/Tabs/StyledScrollableTabs.d.ts +1 -9
  86. package/types/components/Tabs/StyledTabs.d.ts +1 -7
  87. package/types/components/Tag/StyledTag.d.ts +0 -1
  88. package/types/components/TextInput/StyledTextInput.d.ts +0 -1
  89. package/types/components/TextInput/index.d.ts +3 -3
  90. package/types/components/TimePicker/StyledTimePicker.d.ts +0 -1
  91. package/types/components/Toast/StyledToast.d.ts +0 -1
  92. package/types/components/Toast/Toast.d.ts +0 -1
  93. package/types/components/Toast/ToastContext.d.ts +0 -1
  94. package/types/components/Toast/index.d.ts +0 -1
  95. package/types/components/Toolbar/StyledToolbar.d.ts +0 -1
  96. package/types/components/Typography/Body/StyledBody.d.ts +0 -1
  97. package/types/components/Typography/Caption/StyledCaption.d.ts +0 -1
  98. package/types/components/Typography/Label/StyledLabel.d.ts +0 -1
  99. package/types/components/Typography/Text/StyledText.d.ts +0 -1
  100. package/types/components/Typography/Title/StyledTitle.d.ts +0 -1
  101. package/types/testHelpers/renderWithTheme.d.ts +0 -1
  102. package/types/theme/ThemeProvider.d.ts +0 -1
  103. package/.turbo/turbo-build.log +0 -5
package/lib/index.js CHANGED
@@ -392,14 +392,14 @@ function _regeneratorRuntime() {
392
392
  }
393
393
  }, e;
394
394
  }
395
- function _typeof$1(o) {
395
+ function _typeof(o) {
396
396
  "@babel/helpers - typeof";
397
397
 
398
- return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
398
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
399
399
  return typeof o;
400
400
  } : function (o) {
401
401
  return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
402
- }, _typeof$1(o);
402
+ }, _typeof(o);
403
403
  }
404
404
  function _classCallCheck(instance, Constructor) {
405
405
  if (!(instance instanceof Constructor)) {
@@ -1323,9 +1323,7 @@ var BASE_COLORS = {
1323
1323
  theatreGold: '#a56822',
1324
1324
  uniformGreen: '#4d4628',
1325
1325
  yellow: '#fadb14',
1326
- windsorGrey: '#606065',
1327
- mist: '#e8e9f8',
1328
- cloud: '#ccd9f5'
1326
+ windsorGrey: '#606065'
1329
1327
  };
1330
1328
  var colorScales = Object.entries(BASE_COLORS).reduce(function (acc, _ref16) {
1331
1329
  var _ref17 = _slicedToArray(_ref16, 2),
@@ -1334,17 +1332,15 @@ var colorScales = Object.entries(BASE_COLORS).reduce(function (acc, _ref16) {
1334
1332
  return Object.assign(Object.assign({}, acc), _defineProperty({}, key, createColorScales(value)));
1335
1333
  }, {});
1336
1334
  var blue$1 = colorScales.blue,
1337
- cloud = colorScales.cloud,
1338
- deepSaffron$2 = colorScales.deepSaffron,
1335
+ ultramarineBlue$2 = colorScales.ultramarineBlue,
1339
1336
  green$1 = colorScales.green,
1340
1337
  grey$2 = colorScales.grey,
1341
1338
  grotesqueGreen = colorScales.grotesqueGreen,
1342
- mist = colorScales.mist,
1339
+ deepSaffron$2 = colorScales.deepSaffron,
1343
1340
  pink$1 = colorScales.pink,
1344
1341
  purple$1 = colorScales.purple,
1345
- smalt = colorScales.smalt,
1346
- ultramarineBlue$2 = colorScales.ultramarineBlue,
1347
1342
  vermilion$2 = colorScales.vermilion,
1343
+ smalt = colorScales.smalt,
1348
1344
  violet$1 = colorScales.violet,
1349
1345
  yellow$1 = colorScales.yellow;
1350
1346
  var palette$b = {
@@ -1363,11 +1359,9 @@ var palette$b = {
1363
1359
  blueLight60: blue$1.lighten60,
1364
1360
  blueLight75: blue$1.lighten75,
1365
1361
  blueLight90: blue$1.lighten90,
1366
- cloudLight90: cloud.lighten90,
1367
1362
  dodgerBlue: ultramarineBlue$2.base,
1368
1363
  dodgerBlueDark15: ultramarineBlue$2.darken15,
1369
1364
  dodgerBlueDark30: ultramarineBlue$2.darken30,
1370
- dodgerBlueDark60: ultramarineBlue$2.darken60,
1371
1365
  dodgerBlueLight30: ultramarineBlue$2.lighten30,
1372
1366
  dodgerBlueLight45: ultramarineBlue$2.lighten45,
1373
1367
  dodgerBlueLight60: ultramarineBlue$2.lighten60,
@@ -1376,7 +1370,6 @@ var palette$b = {
1376
1370
  green: green$1.base,
1377
1371
  greenDark15: green$1.darken15,
1378
1372
  greenDark30: green$1.darken30,
1379
- greenDark60: green$1.darken60,
1380
1373
  greenDark75: green$1.darken75,
1381
1374
  greenLight30: green$1.lighten30,
1382
1375
  greenLight75: green$1.lighten75,
@@ -1387,7 +1380,6 @@ var palette$b = {
1387
1380
  greyDark45: grey$2.darken45,
1388
1381
  greyDark60: grey$2.darken60,
1389
1382
  greyDark75: grey$2.darken75,
1390
- greyLight30: grey$2.lighten30,
1391
1383
  greyLight45: grey$2.lighten45,
1392
1384
  greyLight60: grey$2.lighten60,
1393
1385
  greyLight75: grey$2.lighten75,
@@ -1401,27 +1393,20 @@ var palette$b = {
1401
1393
  grotesqueGreenLight60: grotesqueGreen.lighten60,
1402
1394
  grotesqueGreenLight75: grotesqueGreen.lighten75,
1403
1395
  grotesqueGreenLight90: grotesqueGreen.lighten90,
1404
- mistLight30: mist.lighten30,
1405
- mistLight60: mist.lighten60,
1406
- mistLight90: mist.lighten90,
1407
1396
  orange: deepSaffron$2.base,
1408
1397
  orangeDark15: deepSaffron$2.darken15,
1409
1398
  orangeDark30: deepSaffron$2.darken30,
1410
- orangeDark60: deepSaffron$2.darken60,
1411
1399
  orangeDark75: deepSaffron$2.darken75,
1412
1400
  orangeLight30: deepSaffron$2.lighten30,
1413
- orangeLight60: deepSaffron$2.lighten60,
1414
1401
  orangeLight75: deepSaffron$2.lighten75,
1415
1402
  orangeLight90: deepSaffron$2.lighten90,
1416
1403
  pink: pink$1.base,
1417
1404
  pinkDark15: pink$1.darken15,
1418
1405
  pinkDark30: pink$1.darken30,
1419
1406
  pinkDark45: pink$1.darken45,
1420
- pinkDark60: pink$1.darken60,
1421
1407
  pinkDark75: pink$1.darken75,
1422
1408
  pinkLight30: pink$1.lighten30,
1423
1409
  pinkLight45: pink$1.lighten45,
1424
- pinkLight60: pink$1.lighten60,
1425
1410
  pinkLight75: pink$1.lighten75,
1426
1411
  pinkLight90: pink$1.lighten90,
1427
1412
  purple: purple$1.base,
@@ -1464,7 +1449,6 @@ var palette$b = {
1464
1449
  yellow: yellow$1.base,
1465
1450
  yellowDark15: yellow$1.darken15,
1466
1451
  yellowDark30: yellow$1.darken30,
1467
- yellowDark45: yellow$1.darken45,
1468
1452
  yellowDark75: yellow$1.darken75,
1469
1453
  yellowLight30: yellow$1.lighten30,
1470
1454
  yellowLight45: yellow$1.lighten45,
@@ -5382,8 +5366,8 @@ var camelize = function camelize(obj) {
5382
5366
  return walk(obj);
5383
5367
  };
5384
5368
  function walk(obj) {
5385
- if (!obj || _typeof$1(obj) !== 'object') return obj;
5386
- if (isDate$1(obj) || isRegex(obj)) return obj;
5369
+ if (!obj || _typeof(obj) !== 'object') return obj;
5370
+ if (isDate(obj) || isRegex(obj)) return obj;
5387
5371
  if (isArray(obj)) return map(obj, walk);
5388
5372
  return reduce(objectKeys(obj), function (acc, key) {
5389
5373
  var camel = camelCase(key);
@@ -5399,7 +5383,7 @@ function camelCase(str) {
5399
5383
  var isArray = Array.isArray || function (obj) {
5400
5384
  return Object.prototype.toString.call(obj) === '[object Array]';
5401
5385
  };
5402
- var isDate$1 = function isDate(obj) {
5386
+ var isDate = function isDate(obj) {
5403
5387
  return Object.prototype.toString.call(obj) === '[object Date]';
5404
5388
  };
5405
5389
  var isRegex = function isRegex(obj) {
@@ -5732,7 +5716,7 @@ var cssColorKeywords = require$$0;
5732
5716
  value: true
5733
5717
  });
5734
5718
  function _interopDefault(ex) {
5735
- return ex && _typeof$1(ex) === 'object' && 'default' in ex ? ex['default'] : ex;
5719
+ return ex && _typeof(ex) === 'object' && 'default' in ex ? ex['default'] : ex;
5736
5720
  }
5737
5721
  var parse = lib$1;
5738
5722
  var parse__default = _interopDefault(parse);
@@ -6452,7 +6436,7 @@ var generated = {};
6452
6436
  var buffer = '';
6453
6437
  var lastType;
6454
6438
  function handleInterpolation(interpolation, i, arr) {
6455
- var type = _typeof$1(interpolation);
6439
+ var type = _typeof(interpolation);
6456
6440
  if (type === 'string') {
6457
6441
  // strip comments
6458
6442
  interpolation = interpolation.replace(/\/\*[\s\S]*?\*\/|\/\/.*$/gm, '');
@@ -8469,7 +8453,7 @@ var BottomNavigationContainer = index$9(reactNative.View)({
8469
8453
  flex: 1,
8470
8454
  overflow: 'hidden'
8471
8455
  });
8472
- var ContentWrapper$2 = index$9(reactNative.View)({
8456
+ var ContentWrapper = index$9(reactNative.View)({
8473
8457
  flex: 1
8474
8458
  });
8475
8459
  var BottomBarWrapper = index$9(reactNative.View)(function (_ref2) {
@@ -8532,7 +8516,7 @@ var BottomNavigation = function BottomNavigation(_ref) {
8532
8516
  return [].concat(_toConsumableArray(loadedState), [selectedTabKey]);
8533
8517
  });
8534
8518
  }
8535
- return /*#__PURE__*/React__default["default"].createElement(BottomNavigationContainer, nativeProps, /*#__PURE__*/React__default["default"].createElement(ContentWrapper$2, null, tabs.map(function (tab) {
8519
+ return /*#__PURE__*/React__default["default"].createElement(BottomNavigationContainer, nativeProps, /*#__PURE__*/React__default["default"].createElement(ContentWrapper, null, tabs.map(function (tab) {
8536
8520
  var key = tab.key,
8537
8521
  component = tab.component,
8538
8522
  testID = tab.testID;
@@ -9344,59 +9328,12 @@ var BottomSheet$1 = Object.assign(BottomSheet, {
9344
9328
  ScrollView: BottomSheetScrollView
9345
9329
  });
9346
9330
 
9347
- function _typeof(o) {
9348
- "@babel/helpers - typeof";
9349
-
9350
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
9351
- return typeof o;
9352
- } : function (o) {
9353
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
9354
- }, _typeof(o);
9355
- }
9356
-
9357
9331
  function requiredArgs(required, args) {
9358
9332
  if (args.length < required) {
9359
9333
  throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
9360
9334
  }
9361
9335
  }
9362
9336
 
9363
- /**
9364
- * @name isDate
9365
- * @category Common Helpers
9366
- * @summary Is the given value a date?
9367
- *
9368
- * @description
9369
- * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
9370
- *
9371
- * @param {*} value - the value to check
9372
- * @returns {boolean} true if the given value is a date
9373
- * @throws {TypeError} 1 arguments required
9374
- *
9375
- * @example
9376
- * // For a valid date:
9377
- * const result = isDate(new Date())
9378
- * //=> true
9379
- *
9380
- * @example
9381
- * // For an invalid date:
9382
- * const result = isDate(new Date(NaN))
9383
- * //=> true
9384
- *
9385
- * @example
9386
- * // For some value:
9387
- * const result = isDate('2014-02-31')
9388
- * //=> false
9389
- *
9390
- * @example
9391
- * // For an object:
9392
- * const result = isDate({})
9393
- * //=> false
9394
- */
9395
- function isDate(value) {
9396
- requiredArgs(1, arguments);
9397
- return value instanceof Date || _typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]';
9398
- }
9399
-
9400
9337
  /**
9401
9338
  * @name toDate
9402
9339
  * @category Common Helpers
@@ -9427,11 +9364,11 @@ function isDate(value) {
9427
9364
  * const result = toDate(1392098430000)
9428
9365
  * //=> Tue Feb 11 2014 11:30:30
9429
9366
  */
9367
+
9430
9368
  function toDate(argument) {
9431
9369
  requiredArgs(1, arguments);
9432
- var argStr = Object.prototype.toString.call(argument);
9370
+ var argStr = Object.prototype.toString.call(argument); // Clone the date
9433
9371
 
9434
- // Clone the date
9435
9372
  if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
9436
9373
  // Prevent the date to lose the milliseconds when passed to new Date() in IE10
9437
9374
  return new Date(argument.getTime());
@@ -9440,8 +9377,8 @@ function toDate(argument) {
9440
9377
  } else {
9441
9378
  if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
9442
9379
  // eslint-disable-next-line no-console
9443
- console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
9444
- // eslint-disable-next-line no-console
9380
+ console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"); // eslint-disable-next-line no-console
9381
+
9445
9382
  console.warn(new Error().stack);
9446
9383
  }
9447
9384
  return new Date(NaN);
@@ -9460,34 +9397,548 @@ function toDate(argument) {
9460
9397
  *
9461
9398
  * Time value of Date: http://es5.github.io/#x15.9.1.1
9462
9399
  *
9400
+ * ### v2.0.0 breaking changes:
9401
+ *
9402
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
9403
+ *
9404
+ * - Now `isValid` doesn't throw an exception
9405
+ * if the first argument is not an instance of Date.
9406
+ * Instead, argument is converted beforehand using `toDate`.
9407
+ *
9408
+ * Examples:
9409
+ *
9410
+ * | `isValid` argument | Before v2.0.0 | v2.0.0 onward |
9411
+ * |---------------------------|---------------|---------------|
9412
+ * | `new Date()` | `true` | `true` |
9413
+ * | `new Date('2016-01-01')` | `true` | `true` |
9414
+ * | `new Date('')` | `false` | `false` |
9415
+ * | `new Date(1488370835081)` | `true` | `true` |
9416
+ * | `new Date(NaN)` | `false` | `false` |
9417
+ * | `'2016-01-01'` | `TypeError` | `false` |
9418
+ * | `''` | `TypeError` | `false` |
9419
+ * | `1488370835081` | `TypeError` | `true` |
9420
+ * | `NaN` | `TypeError` | `false` |
9421
+ *
9422
+ * We introduce this change to make *date-fns* consistent with ECMAScript behavior
9423
+ * that try to coerce arguments to the expected type
9424
+ * (which is also the case with other *date-fns* functions).
9425
+ *
9463
9426
  * @param {*} date - the date to check
9464
9427
  * @returns {Boolean} the date is valid
9465
9428
  * @throws {TypeError} 1 argument required
9466
9429
  *
9467
9430
  * @example
9468
9431
  * // For the valid date:
9469
- * const result = isValid(new Date(2014, 1, 31))
9432
+ * var result = isValid(new Date(2014, 1, 31))
9470
9433
  * //=> true
9471
9434
  *
9472
9435
  * @example
9473
9436
  * // For the value, convertable into a date:
9474
- * const result = isValid(1393804800000)
9437
+ * var result = isValid(1393804800000)
9475
9438
  * //=> true
9476
9439
  *
9477
9440
  * @example
9478
9441
  * // For the invalid date:
9479
- * const result = isValid(new Date(''))
9442
+ * var result = isValid(new Date(''))
9480
9443
  * //=> false
9481
9444
  */
9445
+
9482
9446
  function isValid(dirtyDate) {
9483
9447
  requiredArgs(1, arguments);
9484
- if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
9485
- return false;
9486
- }
9487
9448
  var date = toDate(dirtyDate);
9488
- return !isNaN(Number(date));
9449
+ return !isNaN(date);
9450
+ }
9451
+
9452
+ var formatDistanceLocale = {
9453
+ lessThanXSeconds: {
9454
+ one: 'less than a second',
9455
+ other: 'less than {{count}} seconds'
9456
+ },
9457
+ xSeconds: {
9458
+ one: '1 second',
9459
+ other: '{{count}} seconds'
9460
+ },
9461
+ halfAMinute: 'half a minute',
9462
+ lessThanXMinutes: {
9463
+ one: 'less than a minute',
9464
+ other: 'less than {{count}} minutes'
9465
+ },
9466
+ xMinutes: {
9467
+ one: '1 minute',
9468
+ other: '{{count}} minutes'
9469
+ },
9470
+ aboutXHours: {
9471
+ one: 'about 1 hour',
9472
+ other: 'about {{count}} hours'
9473
+ },
9474
+ xHours: {
9475
+ one: '1 hour',
9476
+ other: '{{count}} hours'
9477
+ },
9478
+ xDays: {
9479
+ one: '1 day',
9480
+ other: '{{count}} days'
9481
+ },
9482
+ aboutXWeeks: {
9483
+ one: 'about 1 week',
9484
+ other: 'about {{count}} weeks'
9485
+ },
9486
+ xWeeks: {
9487
+ one: '1 week',
9488
+ other: '{{count}} weeks'
9489
+ },
9490
+ aboutXMonths: {
9491
+ one: 'about 1 month',
9492
+ other: 'about {{count}} months'
9493
+ },
9494
+ xMonths: {
9495
+ one: '1 month',
9496
+ other: '{{count}} months'
9497
+ },
9498
+ aboutXYears: {
9499
+ one: 'about 1 year',
9500
+ other: 'about {{count}} years'
9501
+ },
9502
+ xYears: {
9503
+ one: '1 year',
9504
+ other: '{{count}} years'
9505
+ },
9506
+ overXYears: {
9507
+ one: 'over 1 year',
9508
+ other: 'over {{count}} years'
9509
+ },
9510
+ almostXYears: {
9511
+ one: 'almost 1 year',
9512
+ other: 'almost {{count}} years'
9513
+ }
9514
+ };
9515
+ function formatDistance(token, count, options) {
9516
+ options = options || {};
9517
+ var result;
9518
+ if (typeof formatDistanceLocale[token] === 'string') {
9519
+ result = formatDistanceLocale[token];
9520
+ } else if (count === 1) {
9521
+ result = formatDistanceLocale[token].one;
9522
+ } else {
9523
+ result = formatDistanceLocale[token].other.replace('{{count}}', count);
9524
+ }
9525
+ if (options.addSuffix) {
9526
+ if (options.comparison > 0) {
9527
+ return 'in ' + result;
9528
+ } else {
9529
+ return result + ' ago';
9530
+ }
9531
+ }
9532
+ return result;
9533
+ }
9534
+
9535
+ function buildFormatLongFn(args) {
9536
+ return function (dirtyOptions) {
9537
+ var options = dirtyOptions || {};
9538
+ var width = options.width ? String(options.width) : args.defaultWidth;
9539
+ var format = args.formats[width] || args.formats[args.defaultWidth];
9540
+ return format;
9541
+ };
9542
+ }
9543
+
9544
+ var dateFormats = {
9545
+ full: 'EEEE, MMMM do, y',
9546
+ "long": 'MMMM do, y',
9547
+ medium: 'MMM d, y',
9548
+ "short": 'MM/dd/yyyy'
9549
+ };
9550
+ var timeFormats = {
9551
+ full: 'h:mm:ss a zzzz',
9552
+ "long": 'h:mm:ss a z',
9553
+ medium: 'h:mm:ss a',
9554
+ "short": 'h:mm a'
9555
+ };
9556
+ var dateTimeFormats = {
9557
+ full: "{{date}} 'at' {{time}}",
9558
+ "long": "{{date}} 'at' {{time}}",
9559
+ medium: '{{date}}, {{time}}',
9560
+ "short": '{{date}}, {{time}}'
9561
+ };
9562
+ var formatLong = {
9563
+ date: buildFormatLongFn({
9564
+ formats: dateFormats,
9565
+ defaultWidth: 'full'
9566
+ }),
9567
+ time: buildFormatLongFn({
9568
+ formats: timeFormats,
9569
+ defaultWidth: 'full'
9570
+ }),
9571
+ dateTime: buildFormatLongFn({
9572
+ formats: dateTimeFormats,
9573
+ defaultWidth: 'full'
9574
+ })
9575
+ };
9576
+ var formatLong$1 = formatLong;
9577
+
9578
+ var formatRelativeLocale = {
9579
+ lastWeek: "'last' eeee 'at' p",
9580
+ yesterday: "'yesterday at' p",
9581
+ today: "'today at' p",
9582
+ tomorrow: "'tomorrow at' p",
9583
+ nextWeek: "eeee 'at' p",
9584
+ other: 'P'
9585
+ };
9586
+ function formatRelative(token, _date, _baseDate, _options) {
9587
+ return formatRelativeLocale[token];
9588
+ }
9589
+
9590
+ function buildLocalizeFn(args) {
9591
+ return function (dirtyIndex, dirtyOptions) {
9592
+ var options = dirtyOptions || {};
9593
+ var context = options.context ? String(options.context) : 'standalone';
9594
+ var valuesArray;
9595
+ if (context === 'formatting' && args.formattingValues) {
9596
+ var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
9597
+ var width = options.width ? String(options.width) : defaultWidth;
9598
+ valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
9599
+ } else {
9600
+ var _defaultWidth = args.defaultWidth;
9601
+ var _width = options.width ? String(options.width) : args.defaultWidth;
9602
+ valuesArray = args.values[_width] || args.values[_defaultWidth];
9603
+ }
9604
+ var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
9605
+ return valuesArray[index];
9606
+ };
9489
9607
  }
9490
9608
 
9609
+ var eraValues = {
9610
+ narrow: ['B', 'A'],
9611
+ abbreviated: ['BC', 'AD'],
9612
+ wide: ['Before Christ', 'Anno Domini']
9613
+ };
9614
+ var quarterValues = {
9615
+ narrow: ['1', '2', '3', '4'],
9616
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
9617
+ wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter'] // Note: in English, the names of days of the week and months are capitalized.
9618
+ // If you are making a new locale based on this one, check if the same is true for the language you're working on.
9619
+ // Generally, formatted dates should look like they are in the middle of a sentence,
9620
+ // e.g. in Spanish language the weekdays and months should be in the lowercase.
9621
+ };
9622
+
9623
+ var monthValues = {
9624
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
9625
+ abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
9626
+ wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
9627
+ };
9628
+ var dayValues = {
9629
+ narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
9630
+ "short": ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
9631
+ abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
9632
+ wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
9633
+ };
9634
+ var dayPeriodValues = {
9635
+ narrow: {
9636
+ am: 'a',
9637
+ pm: 'p',
9638
+ midnight: 'mi',
9639
+ noon: 'n',
9640
+ morning: 'morning',
9641
+ afternoon: 'afternoon',
9642
+ evening: 'evening',
9643
+ night: 'night'
9644
+ },
9645
+ abbreviated: {
9646
+ am: 'AM',
9647
+ pm: 'PM',
9648
+ midnight: 'midnight',
9649
+ noon: 'noon',
9650
+ morning: 'morning',
9651
+ afternoon: 'afternoon',
9652
+ evening: 'evening',
9653
+ night: 'night'
9654
+ },
9655
+ wide: {
9656
+ am: 'a.m.',
9657
+ pm: 'p.m.',
9658
+ midnight: 'midnight',
9659
+ noon: 'noon',
9660
+ morning: 'morning',
9661
+ afternoon: 'afternoon',
9662
+ evening: 'evening',
9663
+ night: 'night'
9664
+ }
9665
+ };
9666
+ var formattingDayPeriodValues = {
9667
+ narrow: {
9668
+ am: 'a',
9669
+ pm: 'p',
9670
+ midnight: 'mi',
9671
+ noon: 'n',
9672
+ morning: 'in the morning',
9673
+ afternoon: 'in the afternoon',
9674
+ evening: 'in the evening',
9675
+ night: 'at night'
9676
+ },
9677
+ abbreviated: {
9678
+ am: 'AM',
9679
+ pm: 'PM',
9680
+ midnight: 'midnight',
9681
+ noon: 'noon',
9682
+ morning: 'in the morning',
9683
+ afternoon: 'in the afternoon',
9684
+ evening: 'in the evening',
9685
+ night: 'at night'
9686
+ },
9687
+ wide: {
9688
+ am: 'a.m.',
9689
+ pm: 'p.m.',
9690
+ midnight: 'midnight',
9691
+ noon: 'noon',
9692
+ morning: 'in the morning',
9693
+ afternoon: 'in the afternoon',
9694
+ evening: 'in the evening',
9695
+ night: 'at night'
9696
+ }
9697
+ };
9698
+ function ordinalNumber(dirtyNumber, _dirtyOptions) {
9699
+ var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,
9700
+ // if they are different for different grammatical genders,
9701
+ // use `options.unit`:
9702
+ //
9703
+ // var options = dirtyOptions || {}
9704
+ // var unit = String(options.unit)
9705
+ //
9706
+ // where `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
9707
+ // 'day', 'hour', 'minute', 'second'
9708
+
9709
+ var rem100 = number % 100;
9710
+ if (rem100 > 20 || rem100 < 10) {
9711
+ switch (rem100 % 10) {
9712
+ case 1:
9713
+ return number + 'st';
9714
+ case 2:
9715
+ return number + 'nd';
9716
+ case 3:
9717
+ return number + 'rd';
9718
+ }
9719
+ }
9720
+ return number + 'th';
9721
+ }
9722
+ var localize = {
9723
+ ordinalNumber: ordinalNumber,
9724
+ era: buildLocalizeFn({
9725
+ values: eraValues,
9726
+ defaultWidth: 'wide'
9727
+ }),
9728
+ quarter: buildLocalizeFn({
9729
+ values: quarterValues,
9730
+ defaultWidth: 'wide',
9731
+ argumentCallback: function argumentCallback(quarter) {
9732
+ return Number(quarter) - 1;
9733
+ }
9734
+ }),
9735
+ month: buildLocalizeFn({
9736
+ values: monthValues,
9737
+ defaultWidth: 'wide'
9738
+ }),
9739
+ day: buildLocalizeFn({
9740
+ values: dayValues,
9741
+ defaultWidth: 'wide'
9742
+ }),
9743
+ dayPeriod: buildLocalizeFn({
9744
+ values: dayPeriodValues,
9745
+ defaultWidth: 'wide',
9746
+ formattingValues: formattingDayPeriodValues,
9747
+ defaultFormattingWidth: 'wide'
9748
+ })
9749
+ };
9750
+ var localize$1 = localize;
9751
+
9752
+ function buildMatchPatternFn(args) {
9753
+ return function (dirtyString, dirtyOptions) {
9754
+ var string = String(dirtyString);
9755
+ var options = dirtyOptions || {};
9756
+ var matchResult = string.match(args.matchPattern);
9757
+ if (!matchResult) {
9758
+ return null;
9759
+ }
9760
+ var matchedString = matchResult[0];
9761
+ var parseResult = string.match(args.parsePattern);
9762
+ if (!parseResult) {
9763
+ return null;
9764
+ }
9765
+ var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
9766
+ value = options.valueCallback ? options.valueCallback(value) : value;
9767
+ return {
9768
+ value: value,
9769
+ rest: string.slice(matchedString.length)
9770
+ };
9771
+ };
9772
+ }
9773
+
9774
+ function buildMatchFn(args) {
9775
+ return function (dirtyString, dirtyOptions) {
9776
+ var string = String(dirtyString);
9777
+ var options = dirtyOptions || {};
9778
+ var width = options.width;
9779
+ var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
9780
+ var matchResult = string.match(matchPattern);
9781
+ if (!matchResult) {
9782
+ return null;
9783
+ }
9784
+ var matchedString = matchResult[0];
9785
+ var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
9786
+ var value;
9787
+ if (Object.prototype.toString.call(parsePatterns) === '[object Array]') {
9788
+ value = findIndex(parsePatterns, function (pattern) {
9789
+ return pattern.test(matchedString);
9790
+ });
9791
+ } else {
9792
+ value = findKey(parsePatterns, function (pattern) {
9793
+ return pattern.test(matchedString);
9794
+ });
9795
+ }
9796
+ value = args.valueCallback ? args.valueCallback(value) : value;
9797
+ value = options.valueCallback ? options.valueCallback(value) : value;
9798
+ return {
9799
+ value: value,
9800
+ rest: string.slice(matchedString.length)
9801
+ };
9802
+ };
9803
+ }
9804
+ function findKey(object, predicate) {
9805
+ for (var key in object) {
9806
+ if (object.hasOwnProperty(key) && predicate(object[key])) {
9807
+ return key;
9808
+ }
9809
+ }
9810
+ }
9811
+ function findIndex(array, predicate) {
9812
+ for (var key = 0; key < array.length; key++) {
9813
+ if (predicate(array[key])) {
9814
+ return key;
9815
+ }
9816
+ }
9817
+ }
9818
+
9819
+ var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
9820
+ var parseOrdinalNumberPattern = /\d+/i;
9821
+ var matchEraPatterns = {
9822
+ narrow: /^(b|a)/i,
9823
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
9824
+ wide: /^(before christ|before common era|anno domini|common era)/i
9825
+ };
9826
+ var parseEraPatterns = {
9827
+ any: [/^b/i, /^(a|c)/i]
9828
+ };
9829
+ var matchQuarterPatterns = {
9830
+ narrow: /^[1234]/i,
9831
+ abbreviated: /^q[1234]/i,
9832
+ wide: /^[1234](th|st|nd|rd)? quarter/i
9833
+ };
9834
+ var parseQuarterPatterns = {
9835
+ any: [/1/i, /2/i, /3/i, /4/i]
9836
+ };
9837
+ var matchMonthPatterns = {
9838
+ narrow: /^[jfmasond]/i,
9839
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
9840
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
9841
+ };
9842
+ var parseMonthPatterns = {
9843
+ narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
9844
+ any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
9845
+ };
9846
+ var matchDayPatterns = {
9847
+ narrow: /^[smtwf]/i,
9848
+ "short": /^(su|mo|tu|we|th|fr|sa)/i,
9849
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
9850
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
9851
+ };
9852
+ var parseDayPatterns = {
9853
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
9854
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
9855
+ };
9856
+ var matchDayPeriodPatterns = {
9857
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
9858
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
9859
+ };
9860
+ var parseDayPeriodPatterns = {
9861
+ any: {
9862
+ am: /^a/i,
9863
+ pm: /^p/i,
9864
+ midnight: /^mi/i,
9865
+ noon: /^no/i,
9866
+ morning: /morning/i,
9867
+ afternoon: /afternoon/i,
9868
+ evening: /evening/i,
9869
+ night: /night/i
9870
+ }
9871
+ };
9872
+ var match = {
9873
+ ordinalNumber: buildMatchPatternFn({
9874
+ matchPattern: matchOrdinalNumberPattern,
9875
+ parsePattern: parseOrdinalNumberPattern,
9876
+ valueCallback: function valueCallback(value) {
9877
+ return parseInt(value, 10);
9878
+ }
9879
+ }),
9880
+ era: buildMatchFn({
9881
+ matchPatterns: matchEraPatterns,
9882
+ defaultMatchWidth: 'wide',
9883
+ parsePatterns: parseEraPatterns,
9884
+ defaultParseWidth: 'any'
9885
+ }),
9886
+ quarter: buildMatchFn({
9887
+ matchPatterns: matchQuarterPatterns,
9888
+ defaultMatchWidth: 'wide',
9889
+ parsePatterns: parseQuarterPatterns,
9890
+ defaultParseWidth: 'any',
9891
+ valueCallback: function valueCallback(index) {
9892
+ return index + 1;
9893
+ }
9894
+ }),
9895
+ month: buildMatchFn({
9896
+ matchPatterns: matchMonthPatterns,
9897
+ defaultMatchWidth: 'wide',
9898
+ parsePatterns: parseMonthPatterns,
9899
+ defaultParseWidth: 'any'
9900
+ }),
9901
+ day: buildMatchFn({
9902
+ matchPatterns: matchDayPatterns,
9903
+ defaultMatchWidth: 'wide',
9904
+ parsePatterns: parseDayPatterns,
9905
+ defaultParseWidth: 'any'
9906
+ }),
9907
+ dayPeriod: buildMatchFn({
9908
+ matchPatterns: matchDayPeriodPatterns,
9909
+ defaultMatchWidth: 'any',
9910
+ parsePatterns: parseDayPeriodPatterns,
9911
+ defaultParseWidth: 'any'
9912
+ })
9913
+ };
9914
+ var match$1 = match;
9915
+
9916
+ /**
9917
+ * @type {Locale}
9918
+ * @category Locales
9919
+ * @summary English locale (United States).
9920
+ * @language English
9921
+ * @iso-639-2 eng
9922
+ * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
9923
+ * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
9924
+ */
9925
+
9926
+ var locale = {
9927
+ code: 'en-US',
9928
+ formatDistance: formatDistance,
9929
+ formatLong: formatLong$1,
9930
+ formatRelative: formatRelative,
9931
+ localize: localize$1,
9932
+ match: match$1,
9933
+ options: {
9934
+ weekStartsOn: 0
9935
+ /* Sunday */,
9936
+
9937
+ firstWeekContainsDate: 1
9938
+ }
9939
+ };
9940
+ var defaultLocale = locale;
9941
+
9491
9942
  function toInteger(dirtyNumber) {
9492
9943
  if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
9493
9944
  return NaN;
@@ -9507,6 +9958,10 @@ function toInteger(dirtyNumber) {
9507
9958
  * @description
9508
9959
  * Add the specified number of milliseconds to the given date.
9509
9960
  *
9961
+ * ### v2.0.0 breaking changes:
9962
+ *
9963
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
9964
+ *
9510
9965
  * @param {Date|Number} date - the date to be changed
9511
9966
  * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
9512
9967
  * @returns {Date} the new date with the milliseconds added
@@ -9514,9 +9969,10 @@ function toInteger(dirtyNumber) {
9514
9969
  *
9515
9970
  * @example
9516
9971
  * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
9517
- * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
9972
+ * var result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
9518
9973
  * //=> Thu Jul 10 2014 12:45:30.750
9519
9974
  */
9975
+
9520
9976
  function addMilliseconds(dirtyDate, dirtyAmount) {
9521
9977
  requiredArgs(2, arguments);
9522
9978
  var timestamp = toDate(dirtyDate).getTime();
@@ -9532,6 +9988,10 @@ function addMilliseconds(dirtyDate, dirtyAmount) {
9532
9988
  * @description
9533
9989
  * Subtract the specified number of milliseconds from the given date.
9534
9990
  *
9991
+ * ### v2.0.0 breaking changes:
9992
+ *
9993
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
9994
+ *
9535
9995
  * @param {Date|Number} date - the date to be changed
9536
9996
  * @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
9537
9997
  * @returns {Date} the new date with the milliseconds subtracted
@@ -9539,16 +9999,107 @@ function addMilliseconds(dirtyDate, dirtyAmount) {
9539
9999
  *
9540
10000
  * @example
9541
10001
  * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
9542
- * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
10002
+ * var result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
9543
10003
  * //=> Thu Jul 10 2014 12:45:29.250
9544
10004
  */
10005
+
9545
10006
  function subMilliseconds(dirtyDate, dirtyAmount) {
9546
10007
  requiredArgs(2, arguments);
9547
10008
  var amount = toInteger(dirtyAmount);
9548
10009
  return addMilliseconds(dirtyDate, -amount);
9549
10010
  }
9550
10011
 
9551
- var MILLISECONDS_IN_DAY = 86400000;
10012
+ function addLeadingZeros(number, targetLength) {
10013
+ var sign = number < 0 ? '-' : '';
10014
+ var output = Math.abs(number).toString();
10015
+ while (output.length < targetLength) {
10016
+ output = '0' + output;
10017
+ }
10018
+ return sign + output;
10019
+ }
10020
+
10021
+ /*
10022
+ * | | Unit | | Unit |
10023
+ * |-----|--------------------------------|-----|--------------------------------|
10024
+ * | a | AM, PM | A* | |
10025
+ * | d | Day of month | D | |
10026
+ * | h | Hour [1-12] | H | Hour [0-23] |
10027
+ * | m | Minute | M | Month |
10028
+ * | s | Second | S | Fraction of second |
10029
+ * | y | Year (abs) | Y | |
10030
+ *
10031
+ * Letters marked by * are not implemented but reserved by Unicode standard.
10032
+ */
10033
+
10034
+ var formatters$2 = {
10035
+ // Year
10036
+ y: function y(date, token) {
10037
+ // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
10038
+ // | Year | y | yy | yyy | yyyy | yyyyy |
10039
+ // |----------|-------|----|-------|-------|-------|
10040
+ // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
10041
+ // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
10042
+ // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
10043
+ // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
10044
+ // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
10045
+ var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
10046
+
10047
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
10048
+ return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
10049
+ },
10050
+ // Month
10051
+ M: function M(date, token) {
10052
+ var month = date.getUTCMonth();
10053
+ return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
10054
+ },
10055
+ // Day of the month
10056
+ d: function d(date, token) {
10057
+ return addLeadingZeros(date.getUTCDate(), token.length);
10058
+ },
10059
+ // AM or PM
10060
+ a: function a(date, token) {
10061
+ var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
10062
+ switch (token) {
10063
+ case 'a':
10064
+ case 'aa':
10065
+ case 'aaa':
10066
+ return dayPeriodEnumValue.toUpperCase();
10067
+ case 'aaaaa':
10068
+ return dayPeriodEnumValue[0];
10069
+ case 'aaaa':
10070
+ default:
10071
+ return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
10072
+ }
10073
+ },
10074
+ // Hour [1-12]
10075
+ h: function h(date, token) {
10076
+ return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
10077
+ },
10078
+ // Hour [0-23]
10079
+ H: function H(date, token) {
10080
+ return addLeadingZeros(date.getUTCHours(), token.length);
10081
+ },
10082
+ // Minute
10083
+ m: function m(date, token) {
10084
+ return addLeadingZeros(date.getUTCMinutes(), token.length);
10085
+ },
10086
+ // Second
10087
+ s: function s(date, token) {
10088
+ return addLeadingZeros(date.getUTCSeconds(), token.length);
10089
+ },
10090
+ // Fraction of second
10091
+ S: function S(date, token) {
10092
+ var numberOfDigits = token.length;
10093
+ var milliseconds = date.getUTCMilliseconds();
10094
+ var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
10095
+ return addLeadingZeros(fractionalSeconds, token.length);
10096
+ }
10097
+ };
10098
+ var lightFormatters = formatters$2;
10099
+
10100
+ var MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.
10101
+ // See issue: https://github.com/date-fns/date-fns/issues/376
10102
+
9552
10103
  function getUTCDayOfYear(dirtyDate) {
9553
10104
  requiredArgs(1, arguments);
9554
10105
  var date = toDate(dirtyDate);
@@ -9560,6 +10111,8 @@ function getUTCDayOfYear(dirtyDate) {
9560
10111
  return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
9561
10112
  }
9562
10113
 
10114
+ // See issue: https://github.com/date-fns/date-fns/issues/376
10115
+
9563
10116
  function startOfUTCISOWeek(dirtyDate) {
9564
10117
  requiredArgs(1, arguments);
9565
10118
  var weekStartsOn = 1;
@@ -9571,6 +10124,8 @@ function startOfUTCISOWeek(dirtyDate) {
9571
10124
  return date;
9572
10125
  }
9573
10126
 
10127
+ // See issue: https://github.com/date-fns/date-fns/issues/376
10128
+
9574
10129
  function getUTCISOWeekYear(dirtyDate) {
9575
10130
  requiredArgs(1, arguments);
9576
10131
  var date = toDate(dirtyDate);
@@ -9592,6 +10147,8 @@ function getUTCISOWeekYear(dirtyDate) {
9592
10147
  }
9593
10148
  }
9594
10149
 
10150
+ // See issue: https://github.com/date-fns/date-fns/issues/376
10151
+
9595
10152
  function startOfUTCISOWeekYear(dirtyDate) {
9596
10153
  requiredArgs(1, arguments);
9597
10154
  var year = getUTCISOWeekYear(dirtyDate);
@@ -9602,30 +10159,29 @@ function startOfUTCISOWeekYear(dirtyDate) {
9602
10159
  return date;
9603
10160
  }
9604
10161
 
9605
- var MILLISECONDS_IN_WEEK$1 = 604800000;
10162
+ var MILLISECONDS_IN_WEEK$1 = 604800000; // This function will be a part of public API when UTC function will be implemented.
10163
+ // See issue: https://github.com/date-fns/date-fns/issues/376
10164
+
9606
10165
  function getUTCISOWeek(dirtyDate) {
9607
10166
  requiredArgs(1, arguments);
9608
10167
  var date = toDate(dirtyDate);
9609
- var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime();
9610
-
9611
- // Round the number of days to the nearest integer
10168
+ var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer
9612
10169
  // because the number of milliseconds in a week is not constant
9613
10170
  // (e.g. it's different in the week of the daylight saving time clock shift)
10171
+
9614
10172
  return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
9615
10173
  }
9616
10174
 
9617
- var defaultOptions = {};
9618
- function getDefaultOptions() {
9619
- return defaultOptions;
9620
- }
10175
+ // See issue: https://github.com/date-fns/date-fns/issues/376
9621
10176
 
9622
- function startOfUTCWeek(dirtyDate, options) {
9623
- var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
10177
+ function startOfUTCWeek(dirtyDate, dirtyOptions) {
9624
10178
  requiredArgs(1, arguments);
9625
- var defaultOptions = getDefaultOptions();
9626
- var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
10179
+ var options = dirtyOptions || {};
10180
+ var locale = options.locale;
10181
+ var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;
10182
+ var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
10183
+ var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
9627
10184
 
9628
- // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
9629
10185
  if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
9630
10186
  throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
9631
10187
  }
@@ -9637,26 +10193,29 @@ function startOfUTCWeek(dirtyDate, options) {
9637
10193
  return date;
9638
10194
  }
9639
10195
 
9640
- function getUTCWeekYear(dirtyDate, options) {
9641
- var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
10196
+ // See issue: https://github.com/date-fns/date-fns/issues/376
10197
+
10198
+ function getUTCWeekYear(dirtyDate, dirtyOptions) {
9642
10199
  requiredArgs(1, arguments);
9643
- var date = toDate(dirtyDate);
10200
+ var date = toDate(dirtyDate, dirtyOptions);
9644
10201
  var year = date.getUTCFullYear();
9645
- var defaultOptions = getDefaultOptions();
9646
- var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
10202
+ var options = dirtyOptions || {};
10203
+ var locale = options.locale;
10204
+ var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
10205
+ var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
10206
+ var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
9647
10207
 
9648
- // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
9649
10208
  if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
9650
10209
  throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
9651
10210
  }
9652
10211
  var firstWeekOfNextYear = new Date(0);
9653
10212
  firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
9654
10213
  firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
9655
- var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, options);
10214
+ var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions);
9656
10215
  var firstWeekOfThisYear = new Date(0);
9657
10216
  firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
9658
10217
  firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
9659
- var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);
10218
+ var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions);
9660
10219
  if (date.getTime() >= startOfNextYear.getTime()) {
9661
10220
  return year + 1;
9662
10221
  } else if (date.getTime() >= startOfThisYear.getTime()) {
@@ -9666,120 +10225,36 @@ function getUTCWeekYear(dirtyDate, options) {
9666
10225
  }
9667
10226
  }
9668
10227
 
9669
- function startOfUTCWeekYear(dirtyDate, options) {
9670
- var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
10228
+ // See issue: https://github.com/date-fns/date-fns/issues/376
10229
+
10230
+ function startOfUTCWeekYear(dirtyDate, dirtyOptions) {
9671
10231
  requiredArgs(1, arguments);
9672
- var defaultOptions = getDefaultOptions();
9673
- var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
9674
- var year = getUTCWeekYear(dirtyDate, options);
10232
+ var options = dirtyOptions || {};
10233
+ var locale = options.locale;
10234
+ var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
10235
+ var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
10236
+ var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);
10237
+ var year = getUTCWeekYear(dirtyDate, dirtyOptions);
9675
10238
  var firstWeek = new Date(0);
9676
10239
  firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
9677
10240
  firstWeek.setUTCHours(0, 0, 0, 0);
9678
- var date = startOfUTCWeek(firstWeek, options);
10241
+ var date = startOfUTCWeek(firstWeek, dirtyOptions);
9679
10242
  return date;
9680
10243
  }
9681
10244
 
9682
- var MILLISECONDS_IN_WEEK = 604800000;
10245
+ var MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.
10246
+ // See issue: https://github.com/date-fns/date-fns/issues/376
10247
+
9683
10248
  function getUTCWeek(dirtyDate, options) {
9684
10249
  requiredArgs(1, arguments);
9685
10250
  var date = toDate(dirtyDate);
9686
- var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime();
9687
-
9688
- // Round the number of days to the nearest integer
10251
+ var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer
9689
10252
  // because the number of milliseconds in a week is not constant
9690
10253
  // (e.g. it's different in the week of the daylight saving time clock shift)
9691
- return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
9692
- }
9693
10254
 
9694
- function addLeadingZeros(number, targetLength) {
9695
- var sign = number < 0 ? '-' : '';
9696
- var output = Math.abs(number).toString();
9697
- while (output.length < targetLength) {
9698
- output = '0' + output;
9699
- }
9700
- return sign + output;
10255
+ return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
9701
10256
  }
9702
10257
 
9703
- /*
9704
- * | | Unit | | Unit |
9705
- * |-----|--------------------------------|-----|--------------------------------|
9706
- * | a | AM, PM | A* | |
9707
- * | d | Day of month | D | |
9708
- * | h | Hour [1-12] | H | Hour [0-23] |
9709
- * | m | Minute | M | Month |
9710
- * | s | Second | S | Fraction of second |
9711
- * | y | Year (abs) | Y | |
9712
- *
9713
- * Letters marked by * are not implemented but reserved by Unicode standard.
9714
- */
9715
- var formatters$2 = {
9716
- // Year
9717
- y: function y(date, token) {
9718
- // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
9719
- // | Year | y | yy | yyy | yyyy | yyyyy |
9720
- // |----------|-------|----|-------|-------|-------|
9721
- // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
9722
- // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
9723
- // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
9724
- // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
9725
- // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
9726
-
9727
- var signedYear = date.getUTCFullYear();
9728
- // Returns 1 for 1 BC (which is year 0 in JavaScript)
9729
- var year = signedYear > 0 ? signedYear : 1 - signedYear;
9730
- return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
9731
- },
9732
- // Month
9733
- M: function M(date, token) {
9734
- var month = date.getUTCMonth();
9735
- return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
9736
- },
9737
- // Day of the month
9738
- d: function d(date, token) {
9739
- return addLeadingZeros(date.getUTCDate(), token.length);
9740
- },
9741
- // AM or PM
9742
- a: function a(date, token) {
9743
- var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
9744
- switch (token) {
9745
- case 'a':
9746
- case 'aa':
9747
- return dayPeriodEnumValue.toUpperCase();
9748
- case 'aaa':
9749
- return dayPeriodEnumValue;
9750
- case 'aaaaa':
9751
- return dayPeriodEnumValue[0];
9752
- case 'aaaa':
9753
- default:
9754
- return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
9755
- }
9756
- },
9757
- // Hour [1-12]
9758
- h: function h(date, token) {
9759
- return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
9760
- },
9761
- // Hour [0-23]
9762
- H: function H(date, token) {
9763
- return addLeadingZeros(date.getUTCHours(), token.length);
9764
- },
9765
- // Minute
9766
- m: function m(date, token) {
9767
- return addLeadingZeros(date.getUTCMinutes(), token.length);
9768
- },
9769
- // Second
9770
- s: function s(date, token) {
9771
- return addLeadingZeros(date.getUTCSeconds(), token.length);
9772
- },
9773
- // Fraction of second
9774
- S: function S(date, token) {
9775
- var numberOfDigits = token.length;
9776
- var milliseconds = date.getUTCMilliseconds();
9777
- var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
9778
- return addLeadingZeros(fractionalSeconds, token.length);
9779
- }
9780
- };
9781
- var lightFormatters = formatters$2;
9782
-
9783
10258
  var dayPeriodEnum = {
9784
10259
  am: 'am',
9785
10260
  pm: 'pm',
@@ -9789,52 +10264,52 @@ var dayPeriodEnum = {
9789
10264
  afternoon: 'afternoon',
9790
10265
  evening: 'evening',
9791
10266
  night: 'night'
10267
+ /*
10268
+ * | | Unit | | Unit |
10269
+ * |-----|--------------------------------|-----|--------------------------------|
10270
+ * | a | AM, PM | A* | Milliseconds in day |
10271
+ * | b | AM, PM, noon, midnight | B | Flexible day period |
10272
+ * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
10273
+ * | d | Day of month | D | Day of year |
10274
+ * | e | Local day of week | E | Day of week |
10275
+ * | f | | F* | Day of week in month |
10276
+ * | g* | Modified Julian day | G | Era |
10277
+ * | h | Hour [1-12] | H | Hour [0-23] |
10278
+ * | i! | ISO day of week | I! | ISO week of year |
10279
+ * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
10280
+ * | k | Hour [1-24] | K | Hour [0-11] |
10281
+ * | l* | (deprecated) | L | Stand-alone month |
10282
+ * | m | Minute | M | Month |
10283
+ * | n | | N | |
10284
+ * | o! | Ordinal number modifier | O | Timezone (GMT) |
10285
+ * | p! | Long localized time | P! | Long localized date |
10286
+ * | q | Stand-alone quarter | Q | Quarter |
10287
+ * | r* | Related Gregorian year | R! | ISO week-numbering year |
10288
+ * | s | Second | S | Fraction of second |
10289
+ * | t! | Seconds timestamp | T! | Milliseconds timestamp |
10290
+ * | u | Extended year | U* | Cyclic year |
10291
+ * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
10292
+ * | w | Local week of year | W* | Week of month |
10293
+ * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
10294
+ * | y | Year (abs) | Y | Local week-numbering year |
10295
+ * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
10296
+ *
10297
+ * Letters marked by * are not implemented but reserved by Unicode standard.
10298
+ *
10299
+ * Letters marked by ! are non-standard, but implemented by date-fns:
10300
+ * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
10301
+ * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
10302
+ * i.e. 7 for Sunday, 1 for Monday, etc.
10303
+ * - `I` is ISO week of year, as opposed to `w` which is local week of year.
10304
+ * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
10305
+ * `R` is supposed to be used in conjunction with `I` and `i`
10306
+ * for universal ISO week-numbering date, whereas
10307
+ * `Y` is supposed to be used in conjunction with `w` and `e`
10308
+ * for week-numbering date specific to the locale.
10309
+ * - `P` is long localized date format
10310
+ * - `p` is long localized time format
10311
+ */
9792
10312
  };
9793
- /*
9794
- * | | Unit | | Unit |
9795
- * |-----|--------------------------------|-----|--------------------------------|
9796
- * | a | AM, PM | A* | Milliseconds in day |
9797
- * | b | AM, PM, noon, midnight | B | Flexible day period |
9798
- * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
9799
- * | d | Day of month | D | Day of year |
9800
- * | e | Local day of week | E | Day of week |
9801
- * | f | | F* | Day of week in month |
9802
- * | g* | Modified Julian day | G | Era |
9803
- * | h | Hour [1-12] | H | Hour [0-23] |
9804
- * | i! | ISO day of week | I! | ISO week of year |
9805
- * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
9806
- * | k | Hour [1-24] | K | Hour [0-11] |
9807
- * | l* | (deprecated) | L | Stand-alone month |
9808
- * | m | Minute | M | Month |
9809
- * | n | | N | |
9810
- * | o! | Ordinal number modifier | O | Timezone (GMT) |
9811
- * | p! | Long localized time | P! | Long localized date |
9812
- * | q | Stand-alone quarter | Q | Quarter |
9813
- * | r* | Related Gregorian year | R! | ISO week-numbering year |
9814
- * | s | Second | S | Fraction of second |
9815
- * | t! | Seconds timestamp | T! | Milliseconds timestamp |
9816
- * | u | Extended year | U* | Cyclic year |
9817
- * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
9818
- * | w | Local week of year | W* | Week of month |
9819
- * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
9820
- * | y | Year (abs) | Y | Local week-numbering year |
9821
- * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
9822
- *
9823
- * Letters marked by * are not implemented but reserved by Unicode standard.
9824
- *
9825
- * Letters marked by ! are non-standard, but implemented by date-fns:
9826
- * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
9827
- * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
9828
- * i.e. 7 for Sunday, 1 for Monday, etc.
9829
- * - `I` is ISO week of year, as opposed to `w` which is local week of year.
9830
- * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
9831
- * `R` is supposed to be used in conjunction with `I` and `i`
9832
- * for universal ISO week-numbering date, whereas
9833
- * `Y` is supposed to be used in conjunction with `w` and `e`
9834
- * for week-numbering date specific to the locale.
9835
- * - `P` is long localized date format
9836
- * - `p` is long localized time format
9837
- */
9838
10313
 
9839
10314
  var formatters = {
9840
10315
  // Era
@@ -9849,11 +10324,13 @@ var formatters = {
9849
10324
  width: 'abbreviated'
9850
10325
  });
9851
10326
  // A, B
10327
+
9852
10328
  case 'GGGGG':
9853
10329
  return localize.era(era, {
9854
10330
  width: 'narrow'
9855
10331
  });
9856
10332
  // Anno Domini, Before Christ
10333
+
9857
10334
  case 'GGGG':
9858
10335
  default:
9859
10336
  return localize.era(era, {
@@ -9865,8 +10342,8 @@ var formatters = {
9865
10342
  y: function y(date, token, localize) {
9866
10343
  // Ordinal number
9867
10344
  if (token === 'yo') {
9868
- var signedYear = date.getUTCFullYear();
9869
- // Returns 1 for 1 BC (which is year 0 in JavaScript)
10345
+ var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
10346
+
9870
10347
  var year = signedYear > 0 ? signedYear : 1 - signedYear;
9871
10348
  return localize.ordinalNumber(year, {
9872
10349
  unit: 'year'
@@ -9876,31 +10353,27 @@ var formatters = {
9876
10353
  },
9877
10354
  // Local week-numbering year
9878
10355
  Y: function Y(date, token, localize, options) {
9879
- var signedWeekYear = getUTCWeekYear(date, options);
9880
- // Returns 1 for 1 BC (which is year 0 in JavaScript)
9881
- var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
10356
+ var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)
10357
+
10358
+ var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year
9882
10359
 
9883
- // Two digit year
9884
10360
  if (token === 'YY') {
9885
10361
  var twoDigitYear = weekYear % 100;
9886
10362
  return addLeadingZeros(twoDigitYear, 2);
9887
- }
10363
+ } // Ordinal number
9888
10364
 
9889
- // Ordinal number
9890
10365
  if (token === 'Yo') {
9891
10366
  return localize.ordinalNumber(weekYear, {
9892
10367
  unit: 'year'
9893
10368
  });
9894
- }
10369
+ } // Padding
9895
10370
 
9896
- // Padding
9897
10371
  return addLeadingZeros(weekYear, token.length);
9898
10372
  },
9899
10373
  // ISO week-numbering year
9900
10374
  R: function R(date, token) {
9901
- var isoWeekYear = getUTCISOWeekYear(date);
10375
+ var isoWeekYear = getUTCISOWeekYear(date); // Padding
9902
10376
 
9903
- // Padding
9904
10377
  return addLeadingZeros(isoWeekYear, token.length);
9905
10378
  },
9906
10379
  // Extended year. This is a single number designating the year of this calendar system.
@@ -9924,26 +10397,31 @@ var formatters = {
9924
10397
  case 'Q':
9925
10398
  return String(quarter);
9926
10399
  // 01, 02, 03, 04
10400
+
9927
10401
  case 'QQ':
9928
10402
  return addLeadingZeros(quarter, 2);
9929
10403
  // 1st, 2nd, 3rd, 4th
10404
+
9930
10405
  case 'Qo':
9931
10406
  return localize.ordinalNumber(quarter, {
9932
10407
  unit: 'quarter'
9933
10408
  });
9934
10409
  // Q1, Q2, Q3, Q4
10410
+
9935
10411
  case 'QQQ':
9936
10412
  return localize.quarter(quarter, {
9937
10413
  width: 'abbreviated',
9938
10414
  context: 'formatting'
9939
10415
  });
9940
10416
  // 1, 2, 3, 4 (narrow quarter; could be not numerical)
10417
+
9941
10418
  case 'QQQQQ':
9942
10419
  return localize.quarter(quarter, {
9943
10420
  width: 'narrow',
9944
10421
  context: 'formatting'
9945
10422
  });
9946
10423
  // 1st quarter, 2nd quarter, ...
10424
+
9947
10425
  case 'QQQQ':
9948
10426
  default:
9949
10427
  return localize.quarter(quarter, {
@@ -9960,26 +10438,31 @@ var formatters = {
9960
10438
  case 'q':
9961
10439
  return String(quarter);
9962
10440
  // 01, 02, 03, 04
10441
+
9963
10442
  case 'qq':
9964
10443
  return addLeadingZeros(quarter, 2);
9965
10444
  // 1st, 2nd, 3rd, 4th
10445
+
9966
10446
  case 'qo':
9967
10447
  return localize.ordinalNumber(quarter, {
9968
10448
  unit: 'quarter'
9969
10449
  });
9970
10450
  // Q1, Q2, Q3, Q4
10451
+
9971
10452
  case 'qqq':
9972
10453
  return localize.quarter(quarter, {
9973
10454
  width: 'abbreviated',
9974
10455
  context: 'standalone'
9975
10456
  });
9976
10457
  // 1, 2, 3, 4 (narrow quarter; could be not numerical)
10458
+
9977
10459
  case 'qqqqq':
9978
10460
  return localize.quarter(quarter, {
9979
10461
  width: 'narrow',
9980
10462
  context: 'standalone'
9981
10463
  });
9982
10464
  // 1st quarter, 2nd quarter, ...
10465
+
9983
10466
  case 'qqqq':
9984
10467
  default:
9985
10468
  return localize.quarter(quarter, {
@@ -9996,23 +10479,27 @@ var formatters = {
9996
10479
  case 'MM':
9997
10480
  return lightFormatters.M(date, token);
9998
10481
  // 1st, 2nd, ..., 12th
10482
+
9999
10483
  case 'Mo':
10000
10484
  return localize.ordinalNumber(month + 1, {
10001
10485
  unit: 'month'
10002
10486
  });
10003
10487
  // Jan, Feb, ..., Dec
10488
+
10004
10489
  case 'MMM':
10005
10490
  return localize.month(month, {
10006
10491
  width: 'abbreviated',
10007
10492
  context: 'formatting'
10008
10493
  });
10009
10494
  // J, F, ..., D
10495
+
10010
10496
  case 'MMMMM':
10011
10497
  return localize.month(month, {
10012
10498
  width: 'narrow',
10013
10499
  context: 'formatting'
10014
10500
  });
10015
10501
  // January, February, ..., December
10502
+
10016
10503
  case 'MMMM':
10017
10504
  default:
10018
10505
  return localize.month(month, {
@@ -10029,26 +10516,31 @@ var formatters = {
10029
10516
  case 'L':
10030
10517
  return String(month + 1);
10031
10518
  // 01, 02, ..., 12
10519
+
10032
10520
  case 'LL':
10033
10521
  return addLeadingZeros(month + 1, 2);
10034
10522
  // 1st, 2nd, ..., 12th
10523
+
10035
10524
  case 'Lo':
10036
10525
  return localize.ordinalNumber(month + 1, {
10037
10526
  unit: 'month'
10038
10527
  });
10039
10528
  // Jan, Feb, ..., Dec
10529
+
10040
10530
  case 'LLL':
10041
10531
  return localize.month(month, {
10042
10532
  width: 'abbreviated',
10043
10533
  context: 'standalone'
10044
10534
  });
10045
10535
  // J, F, ..., D
10536
+
10046
10537
  case 'LLLLL':
10047
10538
  return localize.month(month, {
10048
10539
  width: 'narrow',
10049
10540
  context: 'standalone'
10050
10541
  });
10051
10542
  // January, February, ..., December
10543
+
10052
10544
  case 'LLLL':
10053
10545
  default:
10054
10546
  return localize.month(month, {
@@ -10109,18 +10601,21 @@ var formatters = {
10109
10601
  context: 'formatting'
10110
10602
  });
10111
10603
  // T
10604
+
10112
10605
  case 'EEEEE':
10113
10606
  return localize.day(dayOfWeek, {
10114
10607
  width: 'narrow',
10115
10608
  context: 'formatting'
10116
10609
  });
10117
10610
  // Tu
10611
+
10118
10612
  case 'EEEEEE':
10119
10613
  return localize.day(dayOfWeek, {
10120
10614
  width: 'short',
10121
10615
  context: 'formatting'
10122
10616
  });
10123
10617
  // Tuesday
10618
+
10124
10619
  case 'EEEE':
10125
10620
  default:
10126
10621
  return localize.day(dayOfWeek, {
@@ -10138,9 +10633,11 @@ var formatters = {
10138
10633
  case 'e':
10139
10634
  return String(localDayOfWeek);
10140
10635
  // Padded numerical value
10636
+
10141
10637
  case 'ee':
10142
10638
  return addLeadingZeros(localDayOfWeek, 2);
10143
10639
  // 1st, 2nd, ..., 7th
10640
+
10144
10641
  case 'eo':
10145
10642
  return localize.ordinalNumber(localDayOfWeek, {
10146
10643
  unit: 'day'
@@ -10151,18 +10648,21 @@ var formatters = {
10151
10648
  context: 'formatting'
10152
10649
  });
10153
10650
  // T
10651
+
10154
10652
  case 'eeeee':
10155
10653
  return localize.day(dayOfWeek, {
10156
10654
  width: 'narrow',
10157
10655
  context: 'formatting'
10158
10656
  });
10159
10657
  // Tu
10658
+
10160
10659
  case 'eeeeee':
10161
10660
  return localize.day(dayOfWeek, {
10162
10661
  width: 'short',
10163
10662
  context: 'formatting'
10164
10663
  });
10165
10664
  // Tuesday
10665
+
10166
10666
  case 'eeee':
10167
10667
  default:
10168
10668
  return localize.day(dayOfWeek, {
@@ -10180,9 +10680,11 @@ var formatters = {
10180
10680
  case 'c':
10181
10681
  return String(localDayOfWeek);
10182
10682
  // Padded numerical value
10683
+
10183
10684
  case 'cc':
10184
10685
  return addLeadingZeros(localDayOfWeek, token.length);
10185
10686
  // 1st, 2nd, ..., 7th
10687
+
10186
10688
  case 'co':
10187
10689
  return localize.ordinalNumber(localDayOfWeek, {
10188
10690
  unit: 'day'
@@ -10193,18 +10695,21 @@ var formatters = {
10193
10695
  context: 'standalone'
10194
10696
  });
10195
10697
  // T
10698
+
10196
10699
  case 'ccccc':
10197
10700
  return localize.day(dayOfWeek, {
10198
10701
  width: 'narrow',
10199
10702
  context: 'standalone'
10200
10703
  });
10201
10704
  // Tu
10705
+
10202
10706
  case 'cccccc':
10203
10707
  return localize.day(dayOfWeek, {
10204
10708
  width: 'short',
10205
10709
  context: 'standalone'
10206
10710
  });
10207
10711
  // Tuesday
10712
+
10208
10713
  case 'cccc':
10209
10714
  default:
10210
10715
  return localize.day(dayOfWeek, {
@@ -10222,32 +10727,38 @@ var formatters = {
10222
10727
  case 'i':
10223
10728
  return String(isoDayOfWeek);
10224
10729
  // 02
10730
+
10225
10731
  case 'ii':
10226
10732
  return addLeadingZeros(isoDayOfWeek, token.length);
10227
10733
  // 2nd
10734
+
10228
10735
  case 'io':
10229
10736
  return localize.ordinalNumber(isoDayOfWeek, {
10230
10737
  unit: 'day'
10231
10738
  });
10232
10739
  // Tue
10740
+
10233
10741
  case 'iii':
10234
10742
  return localize.day(dayOfWeek, {
10235
10743
  width: 'abbreviated',
10236
10744
  context: 'formatting'
10237
10745
  });
10238
10746
  // T
10747
+
10239
10748
  case 'iiiii':
10240
10749
  return localize.day(dayOfWeek, {
10241
10750
  width: 'narrow',
10242
10751
  context: 'formatting'
10243
10752
  });
10244
10753
  // Tu
10754
+
10245
10755
  case 'iiiiii':
10246
10756
  return localize.day(dayOfWeek, {
10247
10757
  width: 'short',
10248
10758
  context: 'formatting'
10249
10759
  });
10250
10760
  // Tuesday
10761
+
10251
10762
  case 'iiii':
10252
10763
  default:
10253
10764
  return localize.day(dayOfWeek, {
@@ -10263,15 +10774,11 @@ var formatters = {
10263
10774
  switch (token) {
10264
10775
  case 'a':
10265
10776
  case 'aa':
10266
- return localize.dayPeriod(dayPeriodEnumValue, {
10267
- width: 'abbreviated',
10268
- context: 'formatting'
10269
- });
10270
10777
  case 'aaa':
10271
10778
  return localize.dayPeriod(dayPeriodEnumValue, {
10272
10779
  width: 'abbreviated',
10273
10780
  context: 'formatting'
10274
- }).toLowerCase();
10781
+ });
10275
10782
  case 'aaaaa':
10276
10783
  return localize.dayPeriod(dayPeriodEnumValue, {
10277
10784
  width: 'narrow',
@@ -10299,15 +10806,11 @@ var formatters = {
10299
10806
  switch (token) {
10300
10807
  case 'b':
10301
10808
  case 'bb':
10302
- return localize.dayPeriod(dayPeriodEnumValue, {
10303
- width: 'abbreviated',
10304
- context: 'formatting'
10305
- });
10306
10809
  case 'bbb':
10307
10810
  return localize.dayPeriod(dayPeriodEnumValue, {
10308
10811
  width: 'abbreviated',
10309
10812
  context: 'formatting'
10310
- }).toLowerCase();
10813
+ });
10311
10814
  case 'bbbbb':
10312
10815
  return localize.dayPeriod(dayPeriodEnumValue, {
10313
10816
  width: 'narrow',
@@ -10429,20 +10932,21 @@ var formatters = {
10429
10932
  // Hours and optional minutes
10430
10933
  case 'X':
10431
10934
  return formatTimezoneWithOptionalMinutes(timezoneOffset);
10432
-
10433
10935
  // Hours, minutes and optional seconds without `:` delimiter
10434
10936
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10435
10937
  // so this token always has the same output as `XX`
10938
+
10436
10939
  case 'XXXX':
10437
10940
  case 'XX':
10438
10941
  // Hours and minutes without `:` delimiter
10439
10942
  return formatTimezone(timezoneOffset);
10440
-
10441
10943
  // Hours, minutes and optional seconds with `:` delimiter
10442
10944
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10443
10945
  // so this token always has the same output as `XXX`
10946
+
10444
10947
  case 'XXXXX':
10445
10948
  case 'XXX': // Hours and minutes with `:` delimiter
10949
+
10446
10950
  default:
10447
10951
  return formatTimezone(timezoneOffset, ':');
10448
10952
  }
@@ -10455,20 +10959,21 @@ var formatters = {
10455
10959
  // Hours and optional minutes
10456
10960
  case 'x':
10457
10961
  return formatTimezoneWithOptionalMinutes(timezoneOffset);
10458
-
10459
10962
  // Hours, minutes and optional seconds without `:` delimiter
10460
10963
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10461
10964
  // so this token always has the same output as `xx`
10965
+
10462
10966
  case 'xxxx':
10463
10967
  case 'xx':
10464
10968
  // Hours and minutes without `:` delimiter
10465
10969
  return formatTimezone(timezoneOffset);
10466
-
10467
10970
  // Hours, minutes and optional seconds with `:` delimiter
10468
10971
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10469
10972
  // so this token always has the same output as `xxx`
10973
+
10470
10974
  case 'xxxxx':
10471
10975
  case 'xxx': // Hours and minutes with `:` delimiter
10976
+
10472
10977
  default:
10473
10978
  return formatTimezone(timezoneOffset, ':');
10474
10979
  }
@@ -10484,6 +10989,7 @@ var formatters = {
10484
10989
  case 'OOO':
10485
10990
  return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
10486
10991
  // Long
10992
+
10487
10993
  case 'OOOO':
10488
10994
  default:
10489
10995
  return 'GMT' + formatTimezone(timezoneOffset, ':');
@@ -10500,6 +11006,7 @@ var formatters = {
10500
11006
  case 'zzz':
10501
11007
  return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
10502
11008
  // Long
11009
+
10503
11010
  case 'zzzz':
10504
11011
  default:
10505
11012
  return 'GMT' + formatTimezone(timezoneOffset, ':');
@@ -10546,7 +11053,7 @@ function formatTimezone(offset, dirtyDelimiter) {
10546
11053
  }
10547
11054
  var formatters$1 = formatters;
10548
11055
 
10549
- var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
11056
+ function dateLongFormatter(pattern, formatLong) {
10550
11057
  switch (pattern) {
10551
11058
  case 'P':
10552
11059
  return formatLong.date({
@@ -10566,8 +11073,8 @@ var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
10566
11073
  width: 'full'
10567
11074
  });
10568
11075
  }
10569
- };
10570
- var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
11076
+ }
11077
+ function timeLongFormatter(pattern, formatLong) {
10571
11078
  switch (pattern) {
10572
11079
  case 'p':
10573
11080
  return formatLong.time({
@@ -10587,9 +11094,9 @@ var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
10587
11094
  width: 'full'
10588
11095
  });
10589
11096
  }
10590
- };
10591
- var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong) {
10592
- var matchResult = pattern.match(/(P+)(p+)?/) || [];
11097
+ }
11098
+ function dateTimeLongFormatter(pattern, formatLong) {
11099
+ var matchResult = pattern.match(/(P+)(p+)?/);
10593
11100
  var datePattern = matchResult[1];
10594
11101
  var timePattern = matchResult[2];
10595
11102
  if (!timePattern) {
@@ -10620,13 +11127,17 @@ var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong)
10620
11127
  break;
10621
11128
  }
10622
11129
  return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
10623
- };
11130
+ }
10624
11131
  var longFormatters = {
10625
11132
  p: timeLongFormatter,
10626
11133
  P: dateTimeLongFormatter
10627
11134
  };
10628
11135
  var longFormatters$1 = longFormatters;
10629
11136
 
11137
+ var MILLISECONDS_IN_MINUTE = 60000;
11138
+ function getDateMillisecondsPart(date) {
11139
+ return date.getTime() % MILLISECONDS_IN_MINUTE;
11140
+ }
10630
11141
  /**
10631
11142
  * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
10632
11143
  * They usually appear for dates that denote time before the timezones were introduced
@@ -10638,10 +11149,14 @@ var longFormatters$1 = longFormatters;
10638
11149
  *
10639
11150
  * This function returns the timezone offset in milliseconds that takes seconds in account.
10640
11151
  */
10641
- function getTimezoneOffsetInMilliseconds(date) {
10642
- var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
10643
- utcDate.setUTCFullYear(date.getFullYear());
10644
- return date.getTime() - utcDate.getTime();
11152
+
11153
+ function getTimezoneOffsetInMilliseconds(dirtyDate) {
11154
+ var date = new Date(dirtyDate.getTime());
11155
+ var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());
11156
+ date.setSeconds(0, 0);
11157
+ var hasNegativeUTCOffset = baseTimezoneOffset > 0;
11158
+ var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);
11159
+ return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;
10645
11160
  }
10646
11161
 
10647
11162
  var protectedDayOfYearTokens = ['D', 'DD'];
@@ -10654,500 +11169,16 @@ function isProtectedWeekYearToken(token) {
10654
11169
  }
10655
11170
  function throwProtectedError(token, format, input) {
10656
11171
  if (token === 'YYYY') {
10657
- throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
11172
+ throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
10658
11173
  } else if (token === 'YY') {
10659
- throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
11174
+ throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
10660
11175
  } else if (token === 'D') {
10661
- throw new RangeError("Use `d` instead of `D` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
11176
+ throw new RangeError("Use `d` instead of `D` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
10662
11177
  } else if (token === 'DD') {
10663
- throw new RangeError("Use `dd` instead of `DD` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
10664
- }
10665
- }
10666
-
10667
- var formatDistanceLocale = {
10668
- lessThanXSeconds: {
10669
- one: 'less than a second',
10670
- other: 'less than {{count}} seconds'
10671
- },
10672
- xSeconds: {
10673
- one: '1 second',
10674
- other: '{{count}} seconds'
10675
- },
10676
- halfAMinute: 'half a minute',
10677
- lessThanXMinutes: {
10678
- one: 'less than a minute',
10679
- other: 'less than {{count}} minutes'
10680
- },
10681
- xMinutes: {
10682
- one: '1 minute',
10683
- other: '{{count}} minutes'
10684
- },
10685
- aboutXHours: {
10686
- one: 'about 1 hour',
10687
- other: 'about {{count}} hours'
10688
- },
10689
- xHours: {
10690
- one: '1 hour',
10691
- other: '{{count}} hours'
10692
- },
10693
- xDays: {
10694
- one: '1 day',
10695
- other: '{{count}} days'
10696
- },
10697
- aboutXWeeks: {
10698
- one: 'about 1 week',
10699
- other: 'about {{count}} weeks'
10700
- },
10701
- xWeeks: {
10702
- one: '1 week',
10703
- other: '{{count}} weeks'
10704
- },
10705
- aboutXMonths: {
10706
- one: 'about 1 month',
10707
- other: 'about {{count}} months'
10708
- },
10709
- xMonths: {
10710
- one: '1 month',
10711
- other: '{{count}} months'
10712
- },
10713
- aboutXYears: {
10714
- one: 'about 1 year',
10715
- other: 'about {{count}} years'
10716
- },
10717
- xYears: {
10718
- one: '1 year',
10719
- other: '{{count}} years'
10720
- },
10721
- overXYears: {
10722
- one: 'over 1 year',
10723
- other: 'over {{count}} years'
10724
- },
10725
- almostXYears: {
10726
- one: 'almost 1 year',
10727
- other: 'almost {{count}} years'
10728
- }
10729
- };
10730
- var formatDistance = function formatDistance(token, count, options) {
10731
- var result;
10732
- var tokenValue = formatDistanceLocale[token];
10733
- if (typeof tokenValue === 'string') {
10734
- result = tokenValue;
10735
- } else if (count === 1) {
10736
- result = tokenValue.one;
10737
- } else {
10738
- result = tokenValue.other.replace('{{count}}', count.toString());
10739
- }
10740
- if (options !== null && options !== void 0 && options.addSuffix) {
10741
- if (options.comparison && options.comparison > 0) {
10742
- return 'in ' + result;
10743
- } else {
10744
- return result + ' ago';
10745
- }
11178
+ throw new RangeError("Use `dd` instead of `DD` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
10746
11179
  }
10747
- return result;
10748
- };
10749
- var formatDistance$1 = formatDistance;
10750
-
10751
- function buildFormatLongFn(args) {
10752
- return function () {
10753
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
10754
- // TODO: Remove String()
10755
- var width = options.width ? String(options.width) : args.defaultWidth;
10756
- var format = args.formats[width] || args.formats[args.defaultWidth];
10757
- return format;
10758
- };
10759
11180
  }
10760
11181
 
10761
- var dateFormats = {
10762
- full: 'EEEE, MMMM do, y',
10763
- "long": 'MMMM do, y',
10764
- medium: 'MMM d, y',
10765
- "short": 'MM/dd/yyyy'
10766
- };
10767
- var timeFormats = {
10768
- full: 'h:mm:ss a zzzz',
10769
- "long": 'h:mm:ss a z',
10770
- medium: 'h:mm:ss a',
10771
- "short": 'h:mm a'
10772
- };
10773
- var dateTimeFormats = {
10774
- full: "{{date}} 'at' {{time}}",
10775
- "long": "{{date}} 'at' {{time}}",
10776
- medium: '{{date}}, {{time}}',
10777
- "short": '{{date}}, {{time}}'
10778
- };
10779
- var formatLong = {
10780
- date: buildFormatLongFn({
10781
- formats: dateFormats,
10782
- defaultWidth: 'full'
10783
- }),
10784
- time: buildFormatLongFn({
10785
- formats: timeFormats,
10786
- defaultWidth: 'full'
10787
- }),
10788
- dateTime: buildFormatLongFn({
10789
- formats: dateTimeFormats,
10790
- defaultWidth: 'full'
10791
- })
10792
- };
10793
- var formatLong$1 = formatLong;
10794
-
10795
- var formatRelativeLocale = {
10796
- lastWeek: "'last' eeee 'at' p",
10797
- yesterday: "'yesterday at' p",
10798
- today: "'today at' p",
10799
- tomorrow: "'tomorrow at' p",
10800
- nextWeek: "eeee 'at' p",
10801
- other: 'P'
10802
- };
10803
- var formatRelative = function formatRelative(token, _date, _baseDate, _options) {
10804
- return formatRelativeLocale[token];
10805
- };
10806
- var formatRelative$1 = formatRelative;
10807
-
10808
- function buildLocalizeFn(args) {
10809
- return function (dirtyIndex, options) {
10810
- var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';
10811
- var valuesArray;
10812
- if (context === 'formatting' && args.formattingValues) {
10813
- var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
10814
- var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
10815
- valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
10816
- } else {
10817
- var _defaultWidth = args.defaultWidth;
10818
- var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
10819
- valuesArray = args.values[_width] || args.values[_defaultWidth];
10820
- }
10821
- var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
10822
- // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
10823
- return valuesArray[index];
10824
- };
10825
- }
10826
-
10827
- var eraValues = {
10828
- narrow: ['B', 'A'],
10829
- abbreviated: ['BC', 'AD'],
10830
- wide: ['Before Christ', 'Anno Domini']
10831
- };
10832
- var quarterValues = {
10833
- narrow: ['1', '2', '3', '4'],
10834
- abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
10835
- wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
10836
- };
10837
-
10838
- // Note: in English, the names of days of the week and months are capitalized.
10839
- // If you are making a new locale based on this one, check if the same is true for the language you're working on.
10840
- // Generally, formatted dates should look like they are in the middle of a sentence,
10841
- // e.g. in Spanish language the weekdays and months should be in the lowercase.
10842
- var monthValues = {
10843
- narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
10844
- abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
10845
- wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
10846
- };
10847
- var dayValues = {
10848
- narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
10849
- "short": ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
10850
- abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
10851
- wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
10852
- };
10853
- var dayPeriodValues = {
10854
- narrow: {
10855
- am: 'a',
10856
- pm: 'p',
10857
- midnight: 'mi',
10858
- noon: 'n',
10859
- morning: 'morning',
10860
- afternoon: 'afternoon',
10861
- evening: 'evening',
10862
- night: 'night'
10863
- },
10864
- abbreviated: {
10865
- am: 'AM',
10866
- pm: 'PM',
10867
- midnight: 'midnight',
10868
- noon: 'noon',
10869
- morning: 'morning',
10870
- afternoon: 'afternoon',
10871
- evening: 'evening',
10872
- night: 'night'
10873
- },
10874
- wide: {
10875
- am: 'a.m.',
10876
- pm: 'p.m.',
10877
- midnight: 'midnight',
10878
- noon: 'noon',
10879
- morning: 'morning',
10880
- afternoon: 'afternoon',
10881
- evening: 'evening',
10882
- night: 'night'
10883
- }
10884
- };
10885
- var formattingDayPeriodValues = {
10886
- narrow: {
10887
- am: 'a',
10888
- pm: 'p',
10889
- midnight: 'mi',
10890
- noon: 'n',
10891
- morning: 'in the morning',
10892
- afternoon: 'in the afternoon',
10893
- evening: 'in the evening',
10894
- night: 'at night'
10895
- },
10896
- abbreviated: {
10897
- am: 'AM',
10898
- pm: 'PM',
10899
- midnight: 'midnight',
10900
- noon: 'noon',
10901
- morning: 'in the morning',
10902
- afternoon: 'in the afternoon',
10903
- evening: 'in the evening',
10904
- night: 'at night'
10905
- },
10906
- wide: {
10907
- am: 'a.m.',
10908
- pm: 'p.m.',
10909
- midnight: 'midnight',
10910
- noon: 'noon',
10911
- morning: 'in the morning',
10912
- afternoon: 'in the afternoon',
10913
- evening: 'in the evening',
10914
- night: 'at night'
10915
- }
10916
- };
10917
- var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
10918
- var number = Number(dirtyNumber);
10919
-
10920
- // If ordinal numbers depend on context, for example,
10921
- // if they are different for different grammatical genders,
10922
- // use `options.unit`.
10923
- //
10924
- // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
10925
- // 'day', 'hour', 'minute', 'second'.
10926
-
10927
- var rem100 = number % 100;
10928
- if (rem100 > 20 || rem100 < 10) {
10929
- switch (rem100 % 10) {
10930
- case 1:
10931
- return number + 'st';
10932
- case 2:
10933
- return number + 'nd';
10934
- case 3:
10935
- return number + 'rd';
10936
- }
10937
- }
10938
- return number + 'th';
10939
- };
10940
- var localize = {
10941
- ordinalNumber: ordinalNumber,
10942
- era: buildLocalizeFn({
10943
- values: eraValues,
10944
- defaultWidth: 'wide'
10945
- }),
10946
- quarter: buildLocalizeFn({
10947
- values: quarterValues,
10948
- defaultWidth: 'wide',
10949
- argumentCallback: function argumentCallback(quarter) {
10950
- return quarter - 1;
10951
- }
10952
- }),
10953
- month: buildLocalizeFn({
10954
- values: monthValues,
10955
- defaultWidth: 'wide'
10956
- }),
10957
- day: buildLocalizeFn({
10958
- values: dayValues,
10959
- defaultWidth: 'wide'
10960
- }),
10961
- dayPeriod: buildLocalizeFn({
10962
- values: dayPeriodValues,
10963
- defaultWidth: 'wide',
10964
- formattingValues: formattingDayPeriodValues,
10965
- defaultFormattingWidth: 'wide'
10966
- })
10967
- };
10968
- var localize$1 = localize;
10969
-
10970
- function buildMatchFn(args) {
10971
- return function (string) {
10972
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
10973
- var width = options.width;
10974
- var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
10975
- var matchResult = string.match(matchPattern);
10976
- if (!matchResult) {
10977
- return null;
10978
- }
10979
- var matchedString = matchResult[0];
10980
- var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
10981
- var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
10982
- return pattern.test(matchedString);
10983
- }) : findKey(parsePatterns, function (pattern) {
10984
- return pattern.test(matchedString);
10985
- });
10986
- var value;
10987
- value = args.valueCallback ? args.valueCallback(key) : key;
10988
- value = options.valueCallback ? options.valueCallback(value) : value;
10989
- var rest = string.slice(matchedString.length);
10990
- return {
10991
- value: value,
10992
- rest: rest
10993
- };
10994
- };
10995
- }
10996
- function findKey(object, predicate) {
10997
- for (var key in object) {
10998
- if (object.hasOwnProperty(key) && predicate(object[key])) {
10999
- return key;
11000
- }
11001
- }
11002
- return undefined;
11003
- }
11004
- function findIndex(array, predicate) {
11005
- for (var key = 0; key < array.length; key++) {
11006
- if (predicate(array[key])) {
11007
- return key;
11008
- }
11009
- }
11010
- return undefined;
11011
- }
11012
-
11013
- function buildMatchPatternFn(args) {
11014
- return function (string) {
11015
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
11016
- var matchResult = string.match(args.matchPattern);
11017
- if (!matchResult) return null;
11018
- var matchedString = matchResult[0];
11019
- var parseResult = string.match(args.parsePattern);
11020
- if (!parseResult) return null;
11021
- var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
11022
- value = options.valueCallback ? options.valueCallback(value) : value;
11023
- var rest = string.slice(matchedString.length);
11024
- return {
11025
- value: value,
11026
- rest: rest
11027
- };
11028
- };
11029
- }
11030
-
11031
- var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
11032
- var parseOrdinalNumberPattern = /\d+/i;
11033
- var matchEraPatterns = {
11034
- narrow: /^(b|a)/i,
11035
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
11036
- wide: /^(before christ|before common era|anno domini|common era)/i
11037
- };
11038
- var parseEraPatterns = {
11039
- any: [/^b/i, /^(a|c)/i]
11040
- };
11041
- var matchQuarterPatterns = {
11042
- narrow: /^[1234]/i,
11043
- abbreviated: /^q[1234]/i,
11044
- wide: /^[1234](th|st|nd|rd)? quarter/i
11045
- };
11046
- var parseQuarterPatterns = {
11047
- any: [/1/i, /2/i, /3/i, /4/i]
11048
- };
11049
- var matchMonthPatterns = {
11050
- narrow: /^[jfmasond]/i,
11051
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
11052
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
11053
- };
11054
- var parseMonthPatterns = {
11055
- narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
11056
- any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
11057
- };
11058
- var matchDayPatterns = {
11059
- narrow: /^[smtwf]/i,
11060
- "short": /^(su|mo|tu|we|th|fr|sa)/i,
11061
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
11062
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
11063
- };
11064
- var parseDayPatterns = {
11065
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
11066
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
11067
- };
11068
- var matchDayPeriodPatterns = {
11069
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
11070
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
11071
- };
11072
- var parseDayPeriodPatterns = {
11073
- any: {
11074
- am: /^a/i,
11075
- pm: /^p/i,
11076
- midnight: /^mi/i,
11077
- noon: /^no/i,
11078
- morning: /morning/i,
11079
- afternoon: /afternoon/i,
11080
- evening: /evening/i,
11081
- night: /night/i
11082
- }
11083
- };
11084
- var match = {
11085
- ordinalNumber: buildMatchPatternFn({
11086
- matchPattern: matchOrdinalNumberPattern,
11087
- parsePattern: parseOrdinalNumberPattern,
11088
- valueCallback: function valueCallback(value) {
11089
- return parseInt(value, 10);
11090
- }
11091
- }),
11092
- era: buildMatchFn({
11093
- matchPatterns: matchEraPatterns,
11094
- defaultMatchWidth: 'wide',
11095
- parsePatterns: parseEraPatterns,
11096
- defaultParseWidth: 'any'
11097
- }),
11098
- quarter: buildMatchFn({
11099
- matchPatterns: matchQuarterPatterns,
11100
- defaultMatchWidth: 'wide',
11101
- parsePatterns: parseQuarterPatterns,
11102
- defaultParseWidth: 'any',
11103
- valueCallback: function valueCallback(index) {
11104
- return index + 1;
11105
- }
11106
- }),
11107
- month: buildMatchFn({
11108
- matchPatterns: matchMonthPatterns,
11109
- defaultMatchWidth: 'wide',
11110
- parsePatterns: parseMonthPatterns,
11111
- defaultParseWidth: 'any'
11112
- }),
11113
- day: buildMatchFn({
11114
- matchPatterns: matchDayPatterns,
11115
- defaultMatchWidth: 'wide',
11116
- parsePatterns: parseDayPatterns,
11117
- defaultParseWidth: 'any'
11118
- }),
11119
- dayPeriod: buildMatchFn({
11120
- matchPatterns: matchDayPeriodPatterns,
11121
- defaultMatchWidth: 'any',
11122
- parsePatterns: parseDayPeriodPatterns,
11123
- defaultParseWidth: 'any'
11124
- })
11125
- };
11126
- var match$1 = match;
11127
-
11128
- /**
11129
- * @type {Locale}
11130
- * @category Locales
11131
- * @summary English locale (United States).
11132
- * @language English
11133
- * @iso-639-2 eng
11134
- * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
11135
- * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
11136
- */
11137
- var locale = {
11138
- code: 'en-US',
11139
- formatDistance: formatDistance$1,
11140
- formatLong: formatLong$1,
11141
- formatRelative: formatRelative$1,
11142
- localize: localize$1,
11143
- match: match$1,
11144
- options: {
11145
- weekStartsOn: 0 /* Sunday */,
11146
- firstWeekContainsDate: 1
11147
- }
11148
- };
11149
- var defaultLocale = locale;
11150
-
11151
11182
  // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
11152
11183
  // (one of the certain letters followed by `o`)
11153
11184
  // - (\w)\1* matches any sequences of the same letter
@@ -11158,15 +11189,14 @@ var defaultLocale = locale;
11158
11189
  // If there is no matching single quote
11159
11190
  // then the sequence will continue until the end of the string.
11160
11191
  // - . matches any single character unmatched by previous parts of the RegExps
11161
- var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
11162
11192
 
11163
- // This RegExp catches symbols escaped by quotes, and also
11193
+ var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also
11164
11194
  // sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
11195
+
11165
11196
  var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
11166
11197
  var escapedStringRegExp = /^'([^]*?)'?$/;
11167
11198
  var doubleQuoteRegExp = /''/g;
11168
11199
  var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11169
-
11170
11200
  /**
11171
11201
  * @name format
11172
11202
  * @category Common Helpers
@@ -11176,7 +11206,7 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11176
11206
  * Return the formatted date string in the given format. The result may vary by locale.
11177
11207
  *
11178
11208
  * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
11179
- * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
11209
+ * > See: https://git.io/fxCyr
11180
11210
  *
11181
11211
  * The characters wrapped between two single quotes characters (') are escaped.
11182
11212
  * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
@@ -11255,34 +11285,32 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11255
11285
  * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
11256
11286
  * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
11257
11287
  * | | EEEEE | M, T, W, T, F, S, S | |
11258
- * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
11288
+ * | | EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | |
11259
11289
  * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
11260
11290
  * | | io | 1st, 2nd, ..., 7th | 7 |
11261
11291
  * | | ii | 01, 02, ..., 07 | 7 |
11262
11292
  * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
11263
11293
  * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
11264
11294
  * | | iiiii | M, T, W, T, F, S, S | 7 |
11265
- * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
11295
+ * | | iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | 7 |
11266
11296
  * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
11267
11297
  * | | eo | 2nd, 3rd, ..., 1st | 7 |
11268
11298
  * | | ee | 02, 03, ..., 01 | |
11269
11299
  * | | eee | Mon, Tue, Wed, ..., Sun | |
11270
11300
  * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
11271
11301
  * | | eeeee | M, T, W, T, F, S, S | |
11272
- * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
11302
+ * | | eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | |
11273
11303
  * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
11274
11304
  * | | co | 2nd, 3rd, ..., 1st | 7 |
11275
11305
  * | | cc | 02, 03, ..., 01 | |
11276
11306
  * | | ccc | Mon, Tue, Wed, ..., Sun | |
11277
11307
  * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
11278
11308
  * | | ccccc | M, T, W, T, F, S, S | |
11279
- * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
11280
- * | AM, PM | a..aa | AM, PM | |
11281
- * | | aaa | am, pm | |
11309
+ * | | cccccc | Mo, Tu, We, Th, Fr, Su, Sa | |
11310
+ * | AM, PM | a..aaa | AM, PM | |
11282
11311
  * | | aaaa | a.m., p.m. | 2 |
11283
11312
  * | | aaaaa | a, p | |
11284
- * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
11285
- * | | bbb | am, pm, noon, midnight | |
11313
+ * | AM, PM, noon, midnight | b..bbb | AM, PM, noon, midnight | |
11286
11314
  * | | bbbb | a.m., p.m., noon, midnight | 2 |
11287
11315
  * | | bbbbb | a, p, n, mi | |
11288
11316
  * | Flexible day period | B..BBB | at night, in the morning, ... | |
@@ -11308,7 +11336,7 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11308
11336
  * | | ss | 00, 01, ..., 59 | |
11309
11337
  * | Fraction of second | S | 0, 1, ..., 9 | |
11310
11338
  * | | SS | 00, 01, ..., 99 | |
11311
- * | | SSS | 000, 001, ..., 999 | |
11339
+ * | | SSS | 000, 0001, ..., 999 | |
11312
11340
  * | | SSSS | ... | 3 |
11313
11341
  * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
11314
11342
  * | | XX | -0800, +0530, Z | |
@@ -11328,18 +11356,18 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11328
11356
  * | | tt | ... | 3,7 |
11329
11357
  * | Milliseconds timestamp | T | 512969520900 | 7 |
11330
11358
  * | | TT | ... | 3,7 |
11331
- * | Long localized date | P | 04/29/1453 | 7 |
11332
- * | | PP | Apr 29, 1453 | 7 |
11333
- * | | PPP | April 29th, 1453 | 7 |
11334
- * | | PPPP | Friday, April 29th, 1453 | 2,7 |
11359
+ * | Long localized date | P | 05/29/1453 | 7 |
11360
+ * | | PP | May 29, 1453 | 7 |
11361
+ * | | PPP | May 29th, 1453 | 7 |
11362
+ * | | PPPP | Sunday, May 29th, 1453 | 2,7 |
11335
11363
  * | Long localized time | p | 12:00 AM | 7 |
11336
11364
  * | | pp | 12:00:00 AM | 7 |
11337
11365
  * | | ppp | 12:00:00 AM GMT+2 | 7 |
11338
11366
  * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
11339
- * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
11340
- * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
11341
- * | | PPPppp | April 29th, 1453 at ... | 7 |
11342
- * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
11367
+ * | Combination of date and time | Pp | 05/29/1453, 12:00 AM | 7 |
11368
+ * | | PPpp | May 29, 1453, 12:00:00 AM | 7 |
11369
+ * | | PPPppp | May 29th, 1453 at ... | 7 |
11370
+ * | | PPPPpppp| Sunday, May 29th, 1453 at ... | 2,7 |
11343
11371
  * Notes:
11344
11372
  * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
11345
11373
  * are the same as "stand-alone" units, but are different in some languages.
@@ -11412,10 +11440,30 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11412
11440
  * - `p`: long localized time
11413
11441
  *
11414
11442
  * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
11415
- * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
11443
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr
11444
+ *
11445
+ * 9. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.
11446
+ * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr
11447
+ *
11448
+ * ### v2.0.0 breaking changes:
11449
+ *
11450
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
11451
+ *
11452
+ * - The second argument is now required for the sake of explicitness.
11453
+ *
11454
+ * ```javascript
11455
+ * // Before v2.0.0
11456
+ * format(new Date(2016, 0, 1))
11416
11457
  *
11417
- * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
11418
- * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
11458
+ * // v2.0.0 onward
11459
+ * format(new Date(2016, 0, 1), "yyyy-MM-dd'T'HH:mm:ss.SSSxxx")
11460
+ * ```
11461
+ *
11462
+ * - New format string API for `format` function
11463
+ * which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).
11464
+ * See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.
11465
+ *
11466
+ * - Characters are now escaped using single quote symbols (`'`) instead of square brackets.
11419
11467
  *
11420
11468
  * @param {Date|Number} date - the original date
11421
11469
  * @param {String} format - the string of tokens
@@ -11424,9 +11472,9 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11424
11472
  * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
11425
11473
  * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
11426
11474
  * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
11427
- * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
11475
+ * see: https://git.io/fxCyr
11428
11476
  * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
11429
- * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
11477
+ * see: https://git.io/fxCyr
11430
11478
  * @returns {String} the formatted date string
11431
11479
  * @throws {TypeError} 2 arguments required
11432
11480
  * @throws {RangeError} `date` must not be Invalid Date
@@ -11434,46 +11482,47 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11434
11482
  * @throws {RangeError} `options.locale` must contain `formatLong` property
11435
11483
  * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
11436
11484
  * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
11437
- * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
11438
- * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
11439
- * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
11440
- * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
11485
+ * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
11486
+ * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
11487
+ * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr
11488
+ * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr
11441
11489
  * @throws {RangeError} format string contains an unescaped latin alphabet character
11442
11490
  *
11443
11491
  * @example
11444
11492
  * // Represent 11 February 2014 in middle-endian format:
11445
- * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
11493
+ * var result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
11446
11494
  * //=> '02/11/2014'
11447
11495
  *
11448
11496
  * @example
11449
11497
  * // Represent 2 July 2014 in Esperanto:
11450
11498
  * import { eoLocale } from 'date-fns/locale/eo'
11451
- * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
11499
+ * var result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
11452
11500
  * locale: eoLocale
11453
11501
  * })
11454
11502
  * //=> '2-a de julio 2014'
11455
11503
  *
11456
11504
  * @example
11457
11505
  * // Escape string by single quote characters:
11458
- * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
11506
+ * var result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
11459
11507
  * //=> "3 o'clock"
11460
11508
  */
11461
11509
 
11462
- function format(dirtyDate, dirtyFormatStr, options) {
11463
- var _ref, _options$locale, _ref2, _ref3, _ref4, _options$firstWeekCon, _options$locale2, _options$locale2$opti, _defaultOptions$local, _defaultOptions$local2, _ref5, _ref6, _ref7, _options$weekStartsOn, _options$locale3, _options$locale3$opti, _defaultOptions$local3, _defaultOptions$local4;
11510
+ function format$1(dirtyDate, dirtyFormatStr, dirtyOptions) {
11464
11511
  requiredArgs(2, arguments);
11465
11512
  var formatStr = String(dirtyFormatStr);
11466
- var defaultOptions = getDefaultOptions();
11467
- var locale = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : defaultLocale;
11468
- var firstWeekContainsDate = toInteger((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1);
11513
+ var options = dirtyOptions || {};
11514
+ var locale = options.locale || defaultLocale;
11515
+ var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;
11516
+ var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
11517
+ var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
11469
11518
 
11470
- // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
11471
11519
  if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
11472
11520
  throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
11473
11521
  }
11474
- var weekStartsOn = toInteger((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0);
11522
+ var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;
11523
+ var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
11524
+ var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
11475
11525
 
11476
- // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
11477
11526
  if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
11478
11527
  throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
11479
11528
  }
@@ -11486,11 +11535,10 @@ function format(dirtyDate, dirtyFormatStr, options) {
11486
11535
  var originalDate = toDate(dirtyDate);
11487
11536
  if (!isValid(originalDate)) {
11488
11537
  throw new RangeError('Invalid time value');
11489
- }
11490
-
11491
- // Convert the date in system timezone to the same date in UTC+00:00 timezone.
11538
+ } // Convert the date in system timezone to the same date in UTC+00:00 timezone.
11492
11539
  // This ensures that when UTC functions will be implemented, locales will be compatible with them.
11493
11540
  // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
11541
+
11494
11542
  var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
11495
11543
  var utcDate = subMilliseconds(originalDate, timezoneOffset);
11496
11544
  var formatterOptions = {
@@ -11503,7 +11551,7 @@ function format(dirtyDate, dirtyFormatStr, options) {
11503
11551
  var firstCharacter = substring[0];
11504
11552
  if (firstCharacter === 'p' || firstCharacter === 'P') {
11505
11553
  var longFormatter = longFormatters$1[firstCharacter];
11506
- return longFormatter(substring, locale.formatLong);
11554
+ return longFormatter(substring, locale.formatLong, formatterOptions);
11507
11555
  }
11508
11556
  return substring;
11509
11557
  }).join('').match(formattingTokensRegExp).map(function (substring) {
@@ -11517,11 +11565,11 @@ function format(dirtyDate, dirtyFormatStr, options) {
11517
11565
  }
11518
11566
  var formatter = formatters$1[firstCharacter];
11519
11567
  if (formatter) {
11520
- if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) {
11521
- throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
11568
+ if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {
11569
+ throwProtectedError(substring, dirtyFormatStr, dirtyDate);
11522
11570
  }
11523
- if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) {
11524
- throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
11571
+ if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {
11572
+ throwProtectedError(substring, dirtyFormatStr, dirtyDate);
11525
11573
  }
11526
11574
  return formatter(utcDate, substring, locale.localize, formatterOptions);
11527
11575
  }
@@ -11533,28 +11581,23 @@ function format(dirtyDate, dirtyFormatStr, options) {
11533
11581
  return result;
11534
11582
  }
11535
11583
  function cleanEscapedString(input) {
11536
- var matched = input.match(escapedStringRegExp);
11537
- if (!matched) {
11538
- return input;
11539
- }
11540
- return matched[1].replace(doubleQuoteRegExp, "'");
11584
+ return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
11541
11585
  }
11542
11586
 
11543
- function convertToFP(fn, arity) {
11544
- var a = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
11587
+ function convertToFP(fn, arity, a) {
11588
+ a = a || [];
11545
11589
  if (a.length >= arity) {
11546
11590
  return fn.apply(null, a.slice(0, arity).reverse());
11547
11591
  }
11548
11592
  return function () {
11549
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
11550
- args[_key] = arguments[_key];
11551
- }
11593
+ var args = Array.prototype.slice.call(arguments);
11552
11594
  return convertToFP(fn, arity, a.concat(args));
11553
11595
  };
11554
11596
  }
11555
11597
 
11556
- // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
11557
- var formatTime = convertToFP(format, 2);
11598
+ // This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
11599
+ var format = convertToFP(format$1, 2);
11600
+ var formatTime = format;
11558
11601
 
11559
11602
  var Wrapper = index$9(reactNative.View)(function () {
11560
11603
  return {
@@ -12320,7 +12363,7 @@ var StyledPageControlWrapper = index$9(reactNative.View)(function (_ref7) {
12320
12363
  });
12321
12364
 
12322
12365
  function isCarouselImageProps(image) {
12323
- return _typeof$1(image) === 'object';
12366
+ return _typeof(image) === 'object';
12324
12367
  }
12325
12368
  var CarouselItem = function CarouselItem(_ref) {
12326
12369
  var width = _ref.width,
@@ -14328,7 +14371,7 @@ var ErrorPage = function ErrorPage(_ref) {
14328
14371
  * @param {ErrorProps}
14329
14372
  * @return {*} {ReactElement}
14330
14373
  */
14331
- var Error$1 = function Error(_ref2) {
14374
+ var ErrorComponent = function ErrorComponent(_ref2) {
14332
14375
  var _ref2$visible = _ref2.visible,
14333
14376
  visible = _ref2$visible === void 0 ? true : _ref2$visible,
14334
14377
  _ref2$variant = _ref2.variant,
@@ -17361,7 +17404,6 @@ var index$3 = Object.assign(Switch, {
17361
17404
  Selector: SelectorSwitch
17362
17405
  });
17363
17406
 
17364
- var AnimatedPagerView = reactNative.Animated.createAnimatedComponent(PagerView__default["default"]);
17365
17407
  var TabContainer$1 = index$9(reactNative.View)({
17366
17408
  flex: 1,
17367
17409
  overflow: 'hidden'
@@ -17386,9 +17428,6 @@ var HeaderTabItem$1 = index$9(reactNative.View)(function (_ref2) {
17386
17428
  paddingVertical: theme.__hd__.tabs.space.itemVerticalPadding
17387
17429
  };
17388
17430
  });
17389
- var ContentWrapper$1 = index$9(AnimatedPagerView)({
17390
- flex: 1
17391
- });
17392
17431
  index$9(reactNative.View)({
17393
17432
  flex: 1
17394
17433
  });
@@ -17436,9 +17475,6 @@ var TabContainer = index$9(reactNative.View)({
17436
17475
  flex: 1,
17437
17476
  overflow: 'hidden'
17438
17477
  });
17439
- var ContentWrapper = index$9(PagerView__default["default"])({
17440
- flex: 1
17441
- });
17442
17478
  var HeaderTabWrapper = index$9(reactNative.View)(function (_ref) {
17443
17479
  var themeInsets = _ref.themeInsets;
17444
17480
  return {
@@ -17889,7 +17925,8 @@ var ScrollableTab = function ScrollableTab(_ref) {
17889
17925
  insets: insets,
17890
17926
  testID: componentTestID ? "".concat(componentTestID, "-tab-bar") : undefined,
17891
17927
  variant: variant
17892
- }), /*#__PURE__*/React__default["default"].createElement(ContentWrapper, {
17928
+ }), /*#__PURE__*/React__default["default"].createElement(PagerView__default["default"], {
17929
+ useNext: false,
17893
17930
  initialPage: selectedTabIndex,
17894
17931
  ref: pagerViewRef,
17895
17932
  onPageScrollStateChanged: function onPageScrollStateChanged(e) {
@@ -17906,7 +17943,10 @@ var ScrollableTab = function ScrollableTab(_ref) {
17906
17943
  });
17907
17944
  }
17908
17945
  },
17909
- scrollEnabled: swipeEnabled
17946
+ scrollEnabled: swipeEnabled,
17947
+ style: {
17948
+ flex: 1
17949
+ }
17910
17950
  }, tabs.map(function (tab, index) {
17911
17951
  var key = tab.key,
17912
17952
  component = tab.component,
@@ -17924,6 +17964,7 @@ var ScrollableTab = function ScrollableTab(_ref) {
17924
17964
  }))));
17925
17965
  };
17926
17966
 
17967
+ var AnimatedPagerView = reactNative.Animated.createAnimatedComponent(PagerView__default["default"]);
17927
17968
  var getTabItem = function getTabItem(_ref) {
17928
17969
  var item = _ref.item,
17929
17970
  color = _ref.color,
@@ -18021,7 +18062,8 @@ var Tabs = function Tabs(_ref2) {
18021
18062
  scrollOffsetAnimatedValue: scrollOffsetAnimatedValue,
18022
18063
  tabsLength: tabs.length,
18023
18064
  tabsWidth: tabsWidth
18024
- }))), /*#__PURE__*/React__default["default"].createElement(ContentWrapper$1, {
18065
+ }))), /*#__PURE__*/React__default["default"].createElement(AnimatedPagerView, {
18066
+ useNext: false,
18025
18067
  initialPage: selectedTabIndex,
18026
18068
  ref: pagerViewRef,
18027
18069
  onPageSelected: function onPageSelected(e) {
@@ -18039,7 +18081,10 @@ var Tabs = function Tabs(_ref2) {
18039
18081
  }], {
18040
18082
  useNativeDriver: true
18041
18083
  }),
18042
- scrollEnabled: swipeEnabled
18084
+ scrollEnabled: swipeEnabled,
18085
+ style: {
18086
+ flex: 1
18087
+ }
18043
18088
  }, tabs.map(function (tab, index) {
18044
18089
  var key = tab.key,
18045
18090
  component = tab.component,
@@ -18781,7 +18826,7 @@ var scheduler_production_min = {};
18781
18826
  var c = a.sortIndex - b.sortIndex;
18782
18827
  return 0 !== c ? c : a.id - b.id;
18783
18828
  }
18784
- if ("object" === (typeof performance === "undefined" ? "undefined" : _typeof$1(performance)) && "function" === typeof performance.now) {
18829
+ if ("object" === (typeof performance === "undefined" ? "undefined" : _typeof(performance)) && "function" === typeof performance.now) {
18785
18830
  var l = performance;
18786
18831
  exports.unstable_now = function () {
18787
18832
  return l.now();
@@ -18952,7 +18997,7 @@ var scheduler_production_min = {};
18952
18997
  };
18953
18998
  exports.unstable_scheduleCallback = function (a, b, c) {
18954
18999
  var d = exports.unstable_now();
18955
- "object" === _typeof$1(c) && null !== c ? (c = c.delay, c = "number" === typeof c && 0 < c ? d + c : d) : c = d;
19000
+ "object" === _typeof(c) && null !== c ? (c = c.delay, c = "number" === typeof c && 0 < c ? d + c : d) : c = d;
18956
19001
  switch (a) {
18957
19002
  case 1:
18958
19003
  var e = -1;
@@ -19030,7 +19075,7 @@ function oa(a) {
19030
19075
  }
19031
19076
  function pa(a, b, c, d) {
19032
19077
  if (null !== c && 0 === c.type) return !1;
19033
- switch (_typeof$1(b)) {
19078
+ switch (_typeof(b)) {
19034
19079
  case "function":
19035
19080
  case "symbol":
19036
19081
  return !0;
@@ -19140,7 +19185,7 @@ var ua = aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
19140
19185
  var Ia = Symbol["for"]("react.offscreen");
19141
19186
  var Ja = Symbol.iterator;
19142
19187
  function Ka(a) {
19143
- if (null === a || "object" !== _typeof$1(a)) return null;
19188
+ if (null === a || "object" !== _typeof(a)) return null;
19144
19189
  a = Ja && a[Ja] || a["@@iterator"];
19145
19190
  return "function" === typeof a ? a : null;
19146
19191
  }
@@ -19169,7 +19214,7 @@ function Oa(a, b) {
19169
19214
  set: function set() {
19170
19215
  throw Error();
19171
19216
  }
19172
- }), "object" === (typeof Reflect === "undefined" ? "undefined" : _typeof$1(Reflect)) && Reflect.construct) {
19217
+ }), "object" === (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && Reflect.construct) {
19173
19218
  try {
19174
19219
  Reflect.construct(b, []);
19175
19220
  } catch (l) {
@@ -19251,7 +19296,7 @@ function Qa(a) {
19251
19296
  case Fa:
19252
19297
  return "SuspenseList";
19253
19298
  }
19254
- if ("object" === _typeof$1(a)) switch (a.$$typeof) {
19299
+ if ("object" === _typeof(a)) switch (a.$$typeof) {
19255
19300
  case Ca:
19256
19301
  return (a.displayName || "Context") + ".Consumer";
19257
19302
  case Ba:
@@ -19323,7 +19368,7 @@ function Ra(a) {
19323
19368
  return null;
19324
19369
  }
19325
19370
  function Sa(a) {
19326
- switch (_typeof$1(a)) {
19371
+ switch (_typeof(a)) {
19327
19372
  case "boolean":
19328
19373
  case "number":
19329
19374
  case "string":
@@ -19634,9 +19679,9 @@ function ub(a, b) {
19634
19679
  if (tb[a] && (null != b.children || null != b.dangerouslySetInnerHTML)) throw Error(p(137, a));
19635
19680
  if (null != b.dangerouslySetInnerHTML) {
19636
19681
  if (null != b.children) throw Error(p(60));
19637
- if ("object" !== _typeof$1(b.dangerouslySetInnerHTML) || !("__html" in b.dangerouslySetInnerHTML)) throw Error(p(61));
19682
+ if ("object" !== _typeof(b.dangerouslySetInnerHTML) || !("__html" in b.dangerouslySetInnerHTML)) throw Error(p(61));
19638
19683
  }
19639
- if (null != b.style && "object" !== _typeof$1(b.style)) throw Error(p(62));
19684
+ if (null != b.style && "object" !== _typeof(b.style)) throw Error(p(62));
19640
19685
  }
19641
19686
  }
19642
19687
  function vb(a, b) {
@@ -19722,7 +19767,7 @@ function Kb(a, b) {
19722
19767
  a = !1;
19723
19768
  }
19724
19769
  if (a) return null;
19725
- if (c && "function" !== typeof c) throw Error(p(231, b, _typeof$1(c)));
19770
+ if (c && "function" !== typeof c) throw Error(p(231, b, _typeof(c)));
19726
19771
  return c;
19727
19772
  }
19728
19773
  var Lb = !1;
@@ -20636,7 +20681,7 @@ function ge(a, b) {
20636
20681
  }
20637
20682
  function he(a) {
20638
20683
  a = a.detail;
20639
- return "object" === _typeof$1(a) && "data" in a ? a.data : null;
20684
+ return "object" === _typeof(a) && "data" in a ? a.data : null;
20640
20685
  }
20641
20686
  var ie = !1;
20642
20687
  function je(a, b) {
@@ -20753,7 +20798,7 @@ function Ge(a, b) {
20753
20798
  var He = "function" === typeof Object.is ? Object.is : Ge;
20754
20799
  function Ie(a, b) {
20755
20800
  if (He(a, b)) return !0;
20756
- if ("object" !== _typeof$1(a) || null === a || "object" !== _typeof$1(b) || null === b) return !1;
20801
+ if ("object" !== _typeof(a) || null === a || "object" !== _typeof(b) || null === b) return !1;
20757
20802
  var c = Object.keys(a),
20758
20803
  d = Object.keys(b);
20759
20804
  if (c.length !== d.length) return !1;
@@ -21280,7 +21325,7 @@ function Bf() {}
21280
21325
  var Cf = null,
21281
21326
  Df = null;
21282
21327
  function Ef(a, b) {
21283
- return "textarea" === a || "noscript" === a || "string" === typeof b.children || "number" === typeof b.children || "object" === _typeof$1(b.dangerouslySetInnerHTML) && null !== b.dangerouslySetInnerHTML && null != b.dangerouslySetInnerHTML.__html;
21328
+ return "textarea" === a || "noscript" === a || "string" === typeof b.children || "number" === typeof b.children || "object" === _typeof(b.dangerouslySetInnerHTML) && null !== b.dangerouslySetInnerHTML && null != b.dangerouslySetInnerHTML.__html;
21284
21329
  }
21285
21330
  var Ff = "function" === typeof setTimeout ? setTimeout : void 0,
21286
21331
  Gf = "function" === typeof clearTimeout ? clearTimeout : void 0,
@@ -21928,7 +21973,7 @@ function ph(a, b, c) {
21928
21973
  var d = !1,
21929
21974
  e = Vf;
21930
21975
  var f = b.contextType;
21931
- "object" === _typeof$1(f) && null !== f ? f = Vg(f) : (e = Zf(b) ? Xf : H.current, d = b.contextTypes, f = (d = null !== d && void 0 !== d) ? Yf(a, e) : Vf);
21976
+ "object" === _typeof(f) && null !== f ? f = Vg(f) : (e = Zf(b) ? Xf : H.current, d = b.contextTypes, f = (d = null !== d && void 0 !== d) ? Yf(a, e) : Vf);
21932
21977
  b = new b(c, f);
21933
21978
  a.memoizedState = null !== b.state && void 0 !== b.state ? b.state : null;
21934
21979
  b.updater = nh;
@@ -21950,7 +21995,7 @@ function rh(a, b, c, d) {
21950
21995
  e.refs = jh;
21951
21996
  ah(a);
21952
21997
  var f = b.contextType;
21953
- "object" === _typeof$1(f) && null !== f ? e.context = Vg(f) : (f = Zf(b) ? Xf : H.current, e.context = Yf(a, f));
21998
+ "object" === _typeof(f) && null !== f ? e.context = Vg(f) : (f = Zf(b) ? Xf : H.current, e.context = Yf(a, f));
21954
21999
  e.state = a.memoizedState;
21955
22000
  f = b.getDerivedStateFromProps;
21956
22001
  "function" === typeof f && (kh(a, b, f, c), e.state = a.memoizedState);
@@ -21959,7 +22004,7 @@ function rh(a, b, c, d) {
21959
22004
  }
21960
22005
  function sh(a, b, c) {
21961
22006
  a = c.ref;
21962
- if (null !== a && "function" !== typeof a && "object" !== _typeof$1(a)) {
22007
+ if (null !== a && "function" !== typeof a && "object" !== _typeof(a)) {
21963
22008
  if (c._owner) {
21964
22009
  c = c._owner;
21965
22010
  if (c) {
@@ -22034,7 +22079,7 @@ function vh(a) {
22034
22079
  function k(a, b, c, d) {
22035
22080
  var f = c.type;
22036
22081
  if (f === ya) return m(a, b, c.props.children, d, c.key);
22037
- if (null !== b && (b.elementType === f || "object" === _typeof$1(f) && null !== f && f.$$typeof === Ha && uh(f) === b.type)) return d = e(b, c.props), d.ref = sh(a, b, c), d["return"] = a, d;
22082
+ if (null !== b && (b.elementType === f || "object" === _typeof(f) && null !== f && f.$$typeof === Ha && uh(f) === b.type)) return d = e(b, c.props), d.ref = sh(a, b, c), d["return"] = a, d;
22038
22083
  d = yh(c.type, c.key, c.props, null, a.mode, d);
22039
22084
  d.ref = sh(a, b, c);
22040
22085
  d["return"] = a;
@@ -22054,7 +22099,7 @@ function vh(a) {
22054
22099
  }
22055
22100
  function q(a, b, c) {
22056
22101
  if ("string" === typeof b && "" !== b || "number" === typeof b) return b = xh("" + b, a.mode, c), b["return"] = a, b;
22057
- if ("object" === _typeof$1(b) && null !== b) {
22102
+ if ("object" === _typeof(b) && null !== b) {
22058
22103
  switch (b.$$typeof) {
22059
22104
  case va:
22060
22105
  return c = yh(b.type, b.key, b.props, null, a.mode, c), c.ref = sh(a, null, b), c["return"] = a, c;
@@ -22072,7 +22117,7 @@ function vh(a) {
22072
22117
  function r(a, b, c, d) {
22073
22118
  var e = null !== b ? b.key : null;
22074
22119
  if ("string" === typeof c && "" !== c || "number" === typeof c) return null !== e ? null : h(a, b, "" + c, d);
22075
- if ("object" === _typeof$1(c) && null !== c) {
22120
+ if ("object" === _typeof(c) && null !== c) {
22076
22121
  switch (c.$$typeof) {
22077
22122
  case va:
22078
22123
  return c.key === e ? k(a, b, c, d) : null;
@@ -22088,7 +22133,7 @@ function vh(a) {
22088
22133
  }
22089
22134
  function y(a, b, c, d, e) {
22090
22135
  if ("string" === typeof d && "" !== d || "number" === typeof d) return a = a.get(c) || null, h(b, a, "" + d, e);
22091
- if ("object" === _typeof$1(d) && null !== d) {
22136
+ if ("object" === _typeof(d) && null !== d) {
22092
22137
  switch (d.$$typeof) {
22093
22138
  case va:
22094
22139
  return a = a.get(null === d.key ? c : d.key) || null, k(b, a, d, e);
@@ -22162,8 +22207,8 @@ function vh(a) {
22162
22207
  return l;
22163
22208
  }
22164
22209
  function J(a, d, f, h) {
22165
- "object" === _typeof$1(f) && null !== f && f.type === ya && null === f.key && (f = f.props.children);
22166
- if ("object" === _typeof$1(f) && null !== f) {
22210
+ "object" === _typeof(f) && null !== f && f.type === ya && null === f.key && (f = f.props.children);
22211
+ if ("object" === _typeof(f) && null !== f) {
22167
22212
  switch (f.$$typeof) {
22168
22213
  case va:
22169
22214
  a: {
@@ -22178,7 +22223,7 @@ function vh(a) {
22178
22223
  a = d;
22179
22224
  break a;
22180
22225
  }
22181
- } else if (l.elementType === k || "object" === _typeof$1(k) && null !== k && k.$$typeof === Ha && uh(k) === l.type) {
22226
+ } else if (l.elementType === k || "object" === _typeof(k) && null !== k && k.$$typeof === Ha && uh(k) === l.type) {
22182
22227
  c(a, l.sibling);
22183
22228
  d = e(l, f.props);
22184
22229
  d.ref = sh(a, l, f);
@@ -23063,7 +23108,7 @@ function ij(a, b, c, d, e) {
23063
23108
  g.props = h;
23064
23109
  var k = g.context,
23065
23110
  l = c.contextType;
23066
- "object" === _typeof$1(l) && null !== l ? l = Vg(l) : (l = Zf(c) ? Xf : H.current, l = Yf(b, l));
23111
+ "object" === _typeof(l) && null !== l ? l = Vg(l) : (l = Zf(c) ? Xf : H.current, l = Yf(b, l));
23067
23112
  var m = c.getDerivedStateFromProps,
23068
23113
  q = "function" === typeof m || "function" === typeof g.getSnapshotBeforeUpdate;
23069
23114
  q || "function" !== typeof g.UNSAFE_componentWillReceiveProps && "function" !== typeof g.componentWillReceiveProps || (h !== d || k !== l) && qh(b, g, d, l);
@@ -23082,7 +23127,7 @@ function ij(a, b, c, d, e) {
23082
23127
  q = b.pendingProps;
23083
23128
  r = g.context;
23084
23129
  k = c.contextType;
23085
- "object" === _typeof$1(k) && null !== k ? k = Vg(k) : (k = Zf(c) ? Xf : H.current, k = Yf(b, k));
23130
+ "object" === _typeof(k) && null !== k ? k = Vg(k) : (k = Zf(c) ? Xf : H.current, k = Yf(b, k));
23086
23131
  var y = c.getDerivedStateFromProps;
23087
23132
  (m = "function" === typeof y || "function" === typeof g.getSnapshotBeforeUpdate) || "function" !== typeof g.UNSAFE_componentWillReceiveProps && "function" !== typeof g.componentWillReceiveProps || (h !== q || r !== k) && qh(b, g, d, k);
23088
23133
  $g = !1;
@@ -24995,7 +25040,7 @@ function Nk(a, b) {
24995
25040
  k = b;
24996
25041
  b = Z;
24997
25042
  h.flags |= 32768;
24998
- if (null !== k && "object" === _typeof$1(k) && "function" === typeof k.then) {
25043
+ if (null !== k && "object" === _typeof(k) && "function" === typeof k.then) {
24999
25044
  var l = k,
25000
25045
  m = h,
25001
25046
  q = m.tag;
@@ -25416,7 +25461,7 @@ Wk = function Wk(a, b, c) {
25416
25461
  e = Xh(null, b, d, a, e, c);
25417
25462
  var f = bi();
25418
25463
  b.flags |= 1;
25419
- "object" === _typeof$1(e) && null !== e && "function" === typeof e.render && void 0 === e.$$typeof ? (b.tag = 1, b.memoizedState = null, b.updateQueue = null, Zf(d) ? (f = !0, cg(b)) : f = !1, b.memoizedState = null !== e.state && void 0 !== e.state ? e.state : null, ah(b), e.updater = nh, b.stateNode = e, e._reactInternals = b, rh(b, d, a, c), b = kj(null, b, d, !0, f, c)) : (b.tag = 0, I && f && vg(b), Yi(null, b, e, c), b = b.child);
25464
+ "object" === _typeof(e) && null !== e && "function" === typeof e.render && void 0 === e.$$typeof ? (b.tag = 1, b.memoizedState = null, b.updateQueue = null, Zf(d) ? (f = !0, cg(b)) : f = !1, b.memoizedState = null !== e.state && void 0 !== e.state ? e.state : null, ah(b), e.updater = nh, b.stateNode = e, e._reactInternals = b, rh(b, d, a, c), b = kj(null, b, d, !0, f, c)) : (b.tag = 0, I && f && vg(b), Yi(null, b, e, c), b = b.child);
25420
25465
  return b;
25421
25466
  case 16:
25422
25467
  d = b.elementType;
@@ -25657,7 +25702,7 @@ function yh(a, b, c, d, e, f) {
25657
25702
  case Ia:
25658
25703
  return qj(c, e, f, b);
25659
25704
  default:
25660
- if ("object" === _typeof$1(a) && null !== a) switch (a.$$typeof) {
25705
+ if ("object" === _typeof(a) && null !== a) switch (a.$$typeof) {
25661
25706
  case Ba:
25662
25707
  g = 10;
25663
25708
  break a;
@@ -25675,7 +25720,7 @@ function yh(a, b, c, d, e, f) {
25675
25720
  d = null;
25676
25721
  break a;
25677
25722
  }
25678
- throw Error(p(130, null == a ? a : _typeof$1(a), ""));
25723
+ throw Error(p(130, null == a ? a : _typeof(a), ""));
25679
25724
  }
25680
25725
  b = Bg(g, c, b, e);
25681
25726
  b.elementType = a;
@@ -26169,7 +26214,7 @@ function checkDCE() {
26169
26214
  });
26170
26215
  }, r.t = function (e, t) {
26171
26216
  if (1 & t && (e = r(e)), 8 & t) return e;
26172
- if (4 & t && "object" == _typeof$1(e) && e && e.__esModule) return e;
26217
+ if (4 & t && "object" == _typeof(e) && e && e.__esModule) return e;
26173
26218
  var n = Object.create(null);
26174
26219
  if (r.r(n), Object.defineProperty(n, "default", {
26175
26220
  enumerable: !0,
@@ -26391,7 +26436,7 @@ function checkDCE() {
26391
26436
  }, t.parseHotkey = c, t.compareHotkey = l, t.toKeyCode = d, t.toKeyName = f;
26392
26437
  }, function (e, t) {
26393
26438
  e.exports = function (e) {
26394
- var t = _typeof$1(e);
26439
+ var t = _typeof(e);
26395
26440
  return null != e && ("object" == t || "function" == t);
26396
26441
  };
26397
26442
  }, function (e, t, r) {
@@ -26419,7 +26464,7 @@ function checkDCE() {
26419
26464
  };
26420
26465
  }, function (e, t, r) {
26421
26466
  var n = r(11),
26422
- u = "object" == (typeof self === "undefined" ? "undefined" : _typeof$1(self)) && self && self.Object === Object && self,
26467
+ u = "object" == (typeof self === "undefined" ? "undefined" : _typeof(self)) && self && self.Object === Object && self,
26423
26468
  o = n || u || Function("return this")();
26424
26469
  e.exports = o;
26425
26470
  }, function (e, t, r) {
@@ -26434,7 +26479,7 @@ function checkDCE() {
26434
26479
  };
26435
26480
  }, function (e, t, r) {
26436
26481
  (function (t) {
26437
- var r = "object" == _typeof$1(t) && t && t.Object === Object && t;
26482
+ var r = "object" == _typeof(t) && t && t.Object === Object && t;
26438
26483
  e.exports = r;
26439
26484
  }).call(this, r(12));
26440
26485
  }, function (e, t) {
@@ -26445,7 +26490,7 @@ function checkDCE() {
26445
26490
  try {
26446
26491
  r = r || new Function("return this")();
26447
26492
  } catch (e) {
26448
- "object" == (typeof window === "undefined" ? "undefined" : _typeof$1(window)) && (r = window);
26493
+ "object" == (typeof window === "undefined" ? "undefined" : _typeof(window)) && (r = window);
26449
26494
  }
26450
26495
  e.exports = r;
26451
26496
  }, function (e, t, r) {
@@ -26472,7 +26517,7 @@ function checkDCE() {
26472
26517
  var n = r(15),
26473
26518
  u = r(18);
26474
26519
  e.exports = function (e) {
26475
- return "symbol" == _typeof$1(e) || u(e) && "[object Symbol]" == n(e);
26520
+ return "symbol" == _typeof(e) || u(e) && "[object Symbol]" == n(e);
26476
26521
  };
26477
26522
  }, function (e, t, r) {
26478
26523
  var n = r(8),
@@ -26505,7 +26550,7 @@ function checkDCE() {
26505
26550
  };
26506
26551
  }, function (e, t) {
26507
26552
  e.exports = function (e) {
26508
- return null != e && "object" == _typeof$1(e);
26553
+ return null != e && "object" == _typeof(e);
26509
26554
  };
26510
26555
  }, function (e, t, r) {
26511
26556
 
@@ -26586,7 +26631,7 @@ function checkDCE() {
26586
26631
  }
26587
26632
  function c(e) {
26588
26633
  return !!e && (function (e) {
26589
- if (!e || "object" != _typeof$1(e)) return !1;
26634
+ if (!e || "object" != _typeof(e)) return !1;
26590
26635
  var t = Object.getPrototypeOf(e);
26591
26636
  if (null === t) return !0;
26592
26637
  var r = Object.hasOwnProperty.call(t, "constructor") && t.constructor;
@@ -26595,7 +26640,7 @@ function checkDCE() {
26595
26640
  }
26596
26641
  function l(e, t, r) {
26597
26642
  void 0 === r && (r = !1), 0 === d(e) ? (r ? Object.keys : Z)(e).forEach(function (n) {
26598
- r && "symbol" == _typeof$1(n) || t(n, e[n], e);
26643
+ r && "symbol" == _typeof(n) || t(n, e[n], e);
26599
26644
  }) : e.forEach(function (r, n) {
26600
26645
  return t(n, r, e);
26601
26646
  });
@@ -26651,7 +26696,7 @@ function checkDCE() {
26651
26696
  i(2);
26652
26697
  }
26653
26698
  function b(e) {
26654
- return null == e || "object" != _typeof$1(e) || Object.isFrozen(e);
26699
+ return null == e || "object" != _typeof(e) || Object.isFrozen(e);
26655
26700
  }
26656
26701
  function y(e) {
26657
26702
  var t = Q[e];
@@ -26788,7 +26833,7 @@ function checkDCE() {
26788
26833
  }
26789
26834
  var W,
26790
26835
  V,
26791
- q = "undefined" != typeof Symbol && "symbol" == _typeof$1(Symbol("x")),
26836
+ q = "undefined" != typeof Symbol && "symbol" == _typeof(Symbol("x")),
26792
26837
  H = "undefined" != typeof Map,
26793
26838
  U = "undefined" != typeof Set,
26794
26839
  K = "undefined" != typeof Proxy && void 0 !== Proxy.revocable && "undefined" != typeof Reflect,
@@ -26903,7 +26948,7 @@ function checkDCE() {
26903
26948
  throw w(s), e;
26904
26949
  }) : (F(s, n), k(a, s));
26905
26950
  }
26906
- if (!e || "object" != _typeof$1(e)) {
26951
+ if (!e || "object" != _typeof(e)) {
26907
26952
  if ((a = r(e)) === $) return;
26908
26953
  return void 0 === a && (a = e), t.F && m(a, !0), a;
26909
26954
  }
@@ -31138,7 +31183,7 @@ function checkDCE() {
31138
31183
  Ut = r(6),
31139
31184
  Kt = r.n(Ut);
31140
31185
  function $t(e) {
31141
- return null != e && "object" == _typeof$1(e) && 1 === e.nodeType;
31186
+ return null != e && "object" == _typeof(e) && 1 === e.nodeType;
31142
31187
  }
31143
31188
  function Jt(e, t) {
31144
31189
  return (!t || "hidden" !== e) && "visible" !== e && "clip" !== e;
@@ -35847,7 +35892,7 @@ exports.DatePicker = DatePicker;
35847
35892
  exports.Divider = Divider;
35848
35893
  exports.Drawer = index$6;
35849
35894
  exports.Empty = Empty;
35850
- exports.Error = Error$1;
35895
+ exports.Error = ErrorComponent;
35851
35896
  exports.FAB = FAB;
35852
35897
  exports.FlatListWithFAB = FlatListWithFAB;
35853
35898
  exports.HeroDesignProvider = HeroDesignProvider;