@hero-design/rn 8.63.0 → 8.63.1-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.
package/lib/index.js CHANGED
@@ -392,14 +392,14 @@ function _regeneratorRuntime() {
392
392
  }
393
393
  }, e;
394
394
  }
395
- function _typeof(o) {
395
+ function _typeof$1(o) {
396
396
  "@babel/helpers - typeof";
397
397
 
398
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
398
+ return _typeof$1 = "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(o);
402
+ }, _typeof$1(o);
403
403
  }
404
404
  function _classCallCheck(instance, Constructor) {
405
405
  if (!(instance instanceof Constructor)) {
@@ -1323,7 +1323,9 @@ var BASE_COLORS = {
1323
1323
  theatreGold: '#a56822',
1324
1324
  uniformGreen: '#4d4628',
1325
1325
  yellow: '#fadb14',
1326
- windsorGrey: '#606065'
1326
+ windsorGrey: '#606065',
1327
+ mist: '#e8e9f8',
1328
+ cloud: '#ccd9f5'
1327
1329
  };
1328
1330
  var colorScales = Object.entries(BASE_COLORS).reduce(function (acc, _ref16) {
1329
1331
  var _ref17 = _slicedToArray(_ref16, 2),
@@ -1332,15 +1334,17 @@ var colorScales = Object.entries(BASE_COLORS).reduce(function (acc, _ref16) {
1332
1334
  return Object.assign(Object.assign({}, acc), _defineProperty({}, key, createColorScales(value)));
1333
1335
  }, {});
1334
1336
  var blue$1 = colorScales.blue,
1335
- ultramarineBlue$2 = colorScales.ultramarineBlue,
1337
+ cloud = colorScales.cloud,
1338
+ deepSaffron$2 = colorScales.deepSaffron,
1336
1339
  green$1 = colorScales.green,
1337
1340
  grey$2 = colorScales.grey,
1338
1341
  grotesqueGreen = colorScales.grotesqueGreen,
1339
- deepSaffron$2 = colorScales.deepSaffron,
1342
+ mist = colorScales.mist,
1340
1343
  pink$1 = colorScales.pink,
1341
1344
  purple$1 = colorScales.purple,
1342
- vermilion$2 = colorScales.vermilion,
1343
1345
  smalt = colorScales.smalt,
1346
+ ultramarineBlue$2 = colorScales.ultramarineBlue,
1347
+ vermilion$2 = colorScales.vermilion,
1344
1348
  violet$1 = colorScales.violet,
1345
1349
  yellow$1 = colorScales.yellow;
1346
1350
  var palette$b = {
@@ -1359,9 +1363,11 @@ var palette$b = {
1359
1363
  blueLight60: blue$1.lighten60,
1360
1364
  blueLight75: blue$1.lighten75,
1361
1365
  blueLight90: blue$1.lighten90,
1366
+ cloudLight90: cloud.lighten90,
1362
1367
  dodgerBlue: ultramarineBlue$2.base,
1363
1368
  dodgerBlueDark15: ultramarineBlue$2.darken15,
1364
1369
  dodgerBlueDark30: ultramarineBlue$2.darken30,
1370
+ dodgerBlueDark60: ultramarineBlue$2.darken60,
1365
1371
  dodgerBlueLight30: ultramarineBlue$2.lighten30,
1366
1372
  dodgerBlueLight45: ultramarineBlue$2.lighten45,
1367
1373
  dodgerBlueLight60: ultramarineBlue$2.lighten60,
@@ -1370,6 +1376,7 @@ var palette$b = {
1370
1376
  green: green$1.base,
1371
1377
  greenDark15: green$1.darken15,
1372
1378
  greenDark30: green$1.darken30,
1379
+ greenDark60: green$1.darken60,
1373
1380
  greenDark75: green$1.darken75,
1374
1381
  greenLight30: green$1.lighten30,
1375
1382
  greenLight75: green$1.lighten75,
@@ -1380,6 +1387,7 @@ var palette$b = {
1380
1387
  greyDark45: grey$2.darken45,
1381
1388
  greyDark60: grey$2.darken60,
1382
1389
  greyDark75: grey$2.darken75,
1390
+ greyLight30: grey$2.lighten30,
1383
1391
  greyLight45: grey$2.lighten45,
1384
1392
  greyLight60: grey$2.lighten60,
1385
1393
  greyLight75: grey$2.lighten75,
@@ -1393,20 +1401,27 @@ var palette$b = {
1393
1401
  grotesqueGreenLight60: grotesqueGreen.lighten60,
1394
1402
  grotesqueGreenLight75: grotesqueGreen.lighten75,
1395
1403
  grotesqueGreenLight90: grotesqueGreen.lighten90,
1404
+ mistLight30: mist.lighten30,
1405
+ mistLight60: mist.lighten60,
1406
+ mistLight90: mist.lighten90,
1396
1407
  orange: deepSaffron$2.base,
1397
1408
  orangeDark15: deepSaffron$2.darken15,
1398
1409
  orangeDark30: deepSaffron$2.darken30,
1410
+ orangeDark60: deepSaffron$2.darken60,
1399
1411
  orangeDark75: deepSaffron$2.darken75,
1400
1412
  orangeLight30: deepSaffron$2.lighten30,
1413
+ orangeLight60: deepSaffron$2.lighten60,
1401
1414
  orangeLight75: deepSaffron$2.lighten75,
1402
1415
  orangeLight90: deepSaffron$2.lighten90,
1403
1416
  pink: pink$1.base,
1404
1417
  pinkDark15: pink$1.darken15,
1405
1418
  pinkDark30: pink$1.darken30,
1406
1419
  pinkDark45: pink$1.darken45,
1420
+ pinkDark60: pink$1.darken60,
1407
1421
  pinkDark75: pink$1.darken75,
1408
1422
  pinkLight30: pink$1.lighten30,
1409
1423
  pinkLight45: pink$1.lighten45,
1424
+ pinkLight60: pink$1.lighten60,
1410
1425
  pinkLight75: pink$1.lighten75,
1411
1426
  pinkLight90: pink$1.lighten90,
1412
1427
  purple: purple$1.base,
@@ -1449,6 +1464,7 @@ var palette$b = {
1449
1464
  yellow: yellow$1.base,
1450
1465
  yellowDark15: yellow$1.darken15,
1451
1466
  yellowDark30: yellow$1.darken30,
1467
+ yellowDark45: yellow$1.darken45,
1452
1468
  yellowDark75: yellow$1.darken75,
1453
1469
  yellowLight30: yellow$1.lighten30,
1454
1470
  yellowLight45: yellow$1.lighten45,
@@ -5366,8 +5382,8 @@ var camelize = function camelize(obj) {
5366
5382
  return walk(obj);
5367
5383
  };
5368
5384
  function walk(obj) {
5369
- if (!obj || _typeof(obj) !== 'object') return obj;
5370
- if (isDate(obj) || isRegex(obj)) return obj;
5385
+ if (!obj || _typeof$1(obj) !== 'object') return obj;
5386
+ if (isDate$1(obj) || isRegex(obj)) return obj;
5371
5387
  if (isArray(obj)) return map(obj, walk);
5372
5388
  return reduce(objectKeys(obj), function (acc, key) {
5373
5389
  var camel = camelCase(key);
@@ -5383,7 +5399,7 @@ function camelCase(str) {
5383
5399
  var isArray = Array.isArray || function (obj) {
5384
5400
  return Object.prototype.toString.call(obj) === '[object Array]';
5385
5401
  };
5386
- var isDate = function isDate(obj) {
5402
+ var isDate$1 = function isDate(obj) {
5387
5403
  return Object.prototype.toString.call(obj) === '[object Date]';
5388
5404
  };
5389
5405
  var isRegex = function isRegex(obj) {
@@ -5716,7 +5732,7 @@ var cssColorKeywords = require$$0;
5716
5732
  value: true
5717
5733
  });
5718
5734
  function _interopDefault(ex) {
5719
- return ex && _typeof(ex) === 'object' && 'default' in ex ? ex['default'] : ex;
5735
+ return ex && _typeof$1(ex) === 'object' && 'default' in ex ? ex['default'] : ex;
5720
5736
  }
5721
5737
  var parse = lib$1;
5722
5738
  var parse__default = _interopDefault(parse);
@@ -6436,7 +6452,7 @@ var generated = {};
6436
6452
  var buffer = '';
6437
6453
  var lastType;
6438
6454
  function handleInterpolation(interpolation, i, arr) {
6439
- var type = _typeof(interpolation);
6455
+ var type = _typeof$1(interpolation);
6440
6456
  if (type === 'string') {
6441
6457
  // strip comments
6442
6458
  interpolation = interpolation.replace(/\/\*[\s\S]*?\*\/|\/\/.*$/gm, '');
@@ -9328,12 +9344,59 @@ var BottomSheet$1 = Object.assign(BottomSheet, {
9328
9344
  ScrollView: BottomSheetScrollView
9329
9345
  });
9330
9346
 
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
+
9331
9357
  function requiredArgs(required, args) {
9332
9358
  if (args.length < required) {
9333
9359
  throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
9334
9360
  }
9335
9361
  }
9336
9362
 
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
+
9337
9400
  /**
9338
9401
  * @name toDate
9339
9402
  * @category Common Helpers
@@ -9364,11 +9427,11 @@ function requiredArgs(required, args) {
9364
9427
  * const result = toDate(1392098430000)
9365
9428
  * //=> Tue Feb 11 2014 11:30:30
9366
9429
  */
9367
-
9368
9430
  function toDate(argument) {
9369
9431
  requiredArgs(1, arguments);
9370
- var argStr = Object.prototype.toString.call(argument); // Clone the date
9432
+ var argStr = Object.prototype.toString.call(argument);
9371
9433
 
9434
+ // Clone the date
9372
9435
  if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
9373
9436
  // Prevent the date to lose the milliseconds when passed to new Date() in IE10
9374
9437
  return new Date(argument.getTime());
@@ -9377,8 +9440,8 @@ function toDate(argument) {
9377
9440
  } else {
9378
9441
  if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
9379
9442
  // 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
-
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
9382
9445
  console.warn(new Error().stack);
9383
9446
  }
9384
9447
  return new Date(NaN);
@@ -9397,616 +9460,235 @@ function toDate(argument) {
9397
9460
  *
9398
9461
  * Time value of Date: http://es5.github.io/#x15.9.1.1
9399
9462
  *
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
- *
9426
9463
  * @param {*} date - the date to check
9427
9464
  * @returns {Boolean} the date is valid
9428
9465
  * @throws {TypeError} 1 argument required
9429
9466
  *
9430
9467
  * @example
9431
9468
  * // For the valid date:
9432
- * var result = isValid(new Date(2014, 1, 31))
9469
+ * const result = isValid(new Date(2014, 1, 31))
9433
9470
  * //=> true
9434
9471
  *
9435
9472
  * @example
9436
9473
  * // For the value, convertable into a date:
9437
- * var result = isValid(1393804800000)
9474
+ * const result = isValid(1393804800000)
9438
9475
  * //=> true
9439
9476
  *
9440
9477
  * @example
9441
9478
  * // For the invalid date:
9442
- * var result = isValid(new Date(''))
9479
+ * const result = isValid(new Date(''))
9443
9480
  * //=> false
9444
9481
  */
9445
-
9446
9482
  function isValid(dirtyDate) {
9447
9483
  requiredArgs(1, arguments);
9484
+ if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
9485
+ return false;
9486
+ }
9448
9487
  var date = toDate(dirtyDate);
9449
- return !isNaN(date);
9488
+ return !isNaN(Number(date));
9450
9489
  }
9451
9490
 
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);
9491
+ function toInteger(dirtyNumber) {
9492
+ if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
9493
+ return NaN;
9524
9494
  }
9525
- if (options.addSuffix) {
9526
- if (options.comparison > 0) {
9527
- return 'in ' + result;
9528
- } else {
9529
- return result + ' ago';
9530
- }
9495
+ var number = Number(dirtyNumber);
9496
+ if (isNaN(number)) {
9497
+ return number;
9531
9498
  }
9532
- return result;
9499
+ return number < 0 ? Math.ceil(number) : Math.floor(number);
9533
9500
  }
9534
9501
 
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
- };
9502
+ /**
9503
+ * @name addMilliseconds
9504
+ * @category Millisecond Helpers
9505
+ * @summary Add the specified number of milliseconds to the given date.
9506
+ *
9507
+ * @description
9508
+ * Add the specified number of milliseconds to the given date.
9509
+ *
9510
+ * @param {Date|Number} date - the date to be changed
9511
+ * @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
+ * @returns {Date} the new date with the milliseconds added
9513
+ * @throws {TypeError} 2 arguments required
9514
+ *
9515
+ * @example
9516
+ * // 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)
9518
+ * //=> Thu Jul 10 2014 12:45:30.750
9519
+ */
9520
+ function addMilliseconds(dirtyDate, dirtyAmount) {
9521
+ requiredArgs(2, arguments);
9522
+ var timestamp = toDate(dirtyDate).getTime();
9523
+ var amount = toInteger(dirtyAmount);
9524
+ return new Date(timestamp + amount);
9542
9525
  }
9543
9526
 
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;
9527
+ /**
9528
+ * @name subMilliseconds
9529
+ * @category Millisecond Helpers
9530
+ * @summary Subtract the specified number of milliseconds from the given date.
9531
+ *
9532
+ * @description
9533
+ * Subtract the specified number of milliseconds from the given date.
9534
+ *
9535
+ * @param {Date|Number} date - the date to be changed
9536
+ * @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
+ * @returns {Date} the new date with the milliseconds subtracted
9538
+ * @throws {TypeError} 2 arguments required
9539
+ *
9540
+ * @example
9541
+ * // 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)
9543
+ * //=> Thu Jul 10 2014 12:45:29.250
9544
+ */
9545
+ function subMilliseconds(dirtyDate, dirtyAmount) {
9546
+ requiredArgs(2, arguments);
9547
+ var amount = toInteger(dirtyAmount);
9548
+ return addMilliseconds(dirtyDate, -amount);
9549
+ }
9577
9550
 
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];
9551
+ var MILLISECONDS_IN_DAY = 86400000;
9552
+ function getUTCDayOfYear(dirtyDate) {
9553
+ requiredArgs(1, arguments);
9554
+ var date = toDate(dirtyDate);
9555
+ var timestamp = date.getTime();
9556
+ date.setUTCMonth(0, 1);
9557
+ date.setUTCHours(0, 0, 0, 0);
9558
+ var startOfYearTimestamp = date.getTime();
9559
+ var difference = timestamp - startOfYearTimestamp;
9560
+ return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
9588
9561
  }
9589
9562
 
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
- };
9563
+ function startOfUTCISOWeek(dirtyDate) {
9564
+ requiredArgs(1, arguments);
9565
+ var weekStartsOn = 1;
9566
+ var date = toDate(dirtyDate);
9567
+ var day = date.getUTCDay();
9568
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
9569
+ date.setUTCDate(date.getUTCDate() - diff);
9570
+ date.setUTCHours(0, 0, 0, 0);
9571
+ return date;
9607
9572
  }
9608
9573
 
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'
9574
+ function getUTCISOWeekYear(dirtyDate) {
9575
+ requiredArgs(1, arguments);
9576
+ var date = toDate(dirtyDate);
9577
+ var year = date.getUTCFullYear();
9578
+ var fourthOfJanuaryOfNextYear = new Date(0);
9579
+ fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
9580
+ fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
9581
+ var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
9582
+ var fourthOfJanuaryOfThisYear = new Date(0);
9583
+ fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
9584
+ fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
9585
+ var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
9586
+ if (date.getTime() >= startOfNextYear.getTime()) {
9587
+ return year + 1;
9588
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
9589
+ return year;
9590
+ } else {
9591
+ return year - 1;
9696
9592
  }
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'
9593
+ }
9708
9594
 
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';
9595
+ function startOfUTCISOWeekYear(dirtyDate) {
9596
+ requiredArgs(1, arguments);
9597
+ var year = getUTCISOWeekYear(dirtyDate);
9598
+ var fourthOfJanuary = new Date(0);
9599
+ fourthOfJanuary.setUTCFullYear(year, 0, 4);
9600
+ fourthOfJanuary.setUTCHours(0, 0, 0, 0);
9601
+ var date = startOfUTCISOWeek(fourthOfJanuary);
9602
+ return date;
9721
9603
  }
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
9604
 
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
- };
9605
+ var MILLISECONDS_IN_WEEK$1 = 604800000;
9606
+ function getUTCISOWeek(dirtyDate) {
9607
+ requiredArgs(1, arguments);
9608
+ var date = toDate(dirtyDate);
9609
+ var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime();
9610
+
9611
+ // Round the number of days to the nearest integer
9612
+ // because the number of milliseconds in a week is not constant
9613
+ // (e.g. it's different in the week of the daylight saving time clock shift)
9614
+ return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
9772
9615
  }
9773
9616
 
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
- };
9617
+ var defaultOptions = {};
9618
+ function getDefaultOptions() {
9619
+ return defaultOptions;
9803
9620
  }
9804
- function findKey(object, predicate) {
9805
- for (var key in object) {
9806
- if (object.hasOwnProperty(key) && predicate(object[key])) {
9807
- return key;
9808
- }
9621
+
9622
+ function startOfUTCWeek(dirtyDate, options) {
9623
+ var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
9624
+ 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);
9627
+
9628
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
9629
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
9630
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
9809
9631
  }
9632
+ var date = toDate(dirtyDate);
9633
+ var day = date.getUTCDay();
9634
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
9635
+ date.setUTCDate(date.getUTCDate() - diff);
9636
+ date.setUTCHours(0, 0, 0, 0);
9637
+ return date;
9810
9638
  }
9811
- function findIndex(array, predicate) {
9812
- for (var key = 0; key < array.length; key++) {
9813
- if (predicate(array[key])) {
9814
- return key;
9815
- }
9639
+
9640
+ function getUTCWeekYear(dirtyDate, options) {
9641
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
9642
+ requiredArgs(1, arguments);
9643
+ var date = toDate(dirtyDate);
9644
+ 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);
9647
+
9648
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
9649
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
9650
+ throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
9651
+ }
9652
+ var firstWeekOfNextYear = new Date(0);
9653
+ firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
9654
+ firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
9655
+ var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, options);
9656
+ var firstWeekOfThisYear = new Date(0);
9657
+ firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
9658
+ firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
9659
+ var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);
9660
+ if (date.getTime() >= startOfNextYear.getTime()) {
9661
+ return year + 1;
9662
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
9663
+ return year;
9664
+ } else {
9665
+ return year - 1;
9816
9666
  }
9817
9667
  }
9818
9668
 
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
-
9942
- function toInteger(dirtyNumber) {
9943
- if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
9944
- return NaN;
9945
- }
9946
- var number = Number(dirtyNumber);
9947
- if (isNaN(number)) {
9948
- return number;
9949
- }
9950
- return number < 0 ? Math.ceil(number) : Math.floor(number);
9951
- }
9952
-
9953
- /**
9954
- * @name addMilliseconds
9955
- * @category Millisecond Helpers
9956
- * @summary Add the specified number of milliseconds to the given date.
9957
- *
9958
- * @description
9959
- * Add the specified number of milliseconds to the given date.
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
- *
9965
- * @param {Date|Number} date - the date to be changed
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`.
9967
- * @returns {Date} the new date with the milliseconds added
9968
- * @throws {TypeError} 2 arguments required
9969
- *
9970
- * @example
9971
- * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
9972
- * var result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
9973
- * //=> Thu Jul 10 2014 12:45:30.750
9974
- */
9975
-
9976
- function addMilliseconds(dirtyDate, dirtyAmount) {
9977
- requiredArgs(2, arguments);
9978
- var timestamp = toDate(dirtyDate).getTime();
9979
- var amount = toInteger(dirtyAmount);
9980
- return new Date(timestamp + amount);
9669
+ function startOfUTCWeekYear(dirtyDate, options) {
9670
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
9671
+ 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);
9675
+ var firstWeek = new Date(0);
9676
+ firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
9677
+ firstWeek.setUTCHours(0, 0, 0, 0);
9678
+ var date = startOfUTCWeek(firstWeek, options);
9679
+ return date;
9981
9680
  }
9982
9681
 
9983
- /**
9984
- * @name subMilliseconds
9985
- * @category Millisecond Helpers
9986
- * @summary Subtract the specified number of milliseconds from the given date.
9987
- *
9988
- * @description
9989
- * Subtract the specified number of milliseconds from the given date.
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
- *
9995
- * @param {Date|Number} date - the date to be changed
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`.
9997
- * @returns {Date} the new date with the milliseconds subtracted
9998
- * @throws {TypeError} 2 arguments required
9999
- *
10000
- * @example
10001
- * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
10002
- * var result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
10003
- * //=> Thu Jul 10 2014 12:45:29.250
10004
- */
9682
+ var MILLISECONDS_IN_WEEK = 604800000;
9683
+ function getUTCWeek(dirtyDate, options) {
9684
+ requiredArgs(1, arguments);
9685
+ var date = toDate(dirtyDate);
9686
+ var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime();
10005
9687
 
10006
- function subMilliseconds(dirtyDate, dirtyAmount) {
10007
- requiredArgs(2, arguments);
10008
- var amount = toInteger(dirtyAmount);
10009
- return addMilliseconds(dirtyDate, -amount);
9688
+ // Round the number of days to the nearest integer
9689
+ // because the number of milliseconds in a week is not constant
9690
+ // (e.g. it's different in the week of the daylight saving time clock shift)
9691
+ return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
10010
9692
  }
10011
9693
 
10012
9694
  function addLeadingZeros(number, targetLength) {
@@ -10030,7 +9712,6 @@ function addLeadingZeros(number, targetLength) {
10030
9712
  *
10031
9713
  * Letters marked by * are not implemented but reserved by Unicode standard.
10032
9714
  */
10033
-
10034
9715
  var formatters$2 = {
10035
9716
  // Year
10036
9717
  y: function y(date, token) {
@@ -10042,8 +9723,9 @@ var formatters$2 = {
10042
9723
  // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
10043
9724
  // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
10044
9725
  // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
10045
- var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
10046
9726
 
9727
+ var signedYear = date.getUTCFullYear();
9728
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
10047
9729
  var year = signedYear > 0 ? signedYear : 1 - signedYear;
10048
9730
  return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
10049
9731
  },
@@ -10062,8 +9744,9 @@ var formatters$2 = {
10062
9744
  switch (token) {
10063
9745
  case 'a':
10064
9746
  case 'aa':
10065
- case 'aaa':
10066
9747
  return dayPeriodEnumValue.toUpperCase();
9748
+ case 'aaa':
9749
+ return dayPeriodEnumValue;
10067
9750
  case 'aaaaa':
10068
9751
  return dayPeriodEnumValue[0];
10069
9752
  case 'aaaa':
@@ -10097,283 +9780,127 @@ var formatters$2 = {
10097
9780
  };
10098
9781
  var lightFormatters = formatters$2;
10099
9782
 
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
-
10103
- function getUTCDayOfYear(dirtyDate) {
10104
- requiredArgs(1, arguments);
10105
- var date = toDate(dirtyDate);
10106
- var timestamp = date.getTime();
10107
- date.setUTCMonth(0, 1);
10108
- date.setUTCHours(0, 0, 0, 0);
10109
- var startOfYearTimestamp = date.getTime();
10110
- var difference = timestamp - startOfYearTimestamp;
10111
- return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
10112
- }
9783
+ var dayPeriodEnum = {
9784
+ am: 'am',
9785
+ pm: 'pm',
9786
+ midnight: 'midnight',
9787
+ noon: 'noon',
9788
+ morning: 'morning',
9789
+ afternoon: 'afternoon',
9790
+ evening: 'evening',
9791
+ night: 'night'
9792
+ };
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
+ */
10113
9838
 
10114
- // See issue: https://github.com/date-fns/date-fns/issues/376
9839
+ var formatters = {
9840
+ // Era
9841
+ G: function G(date, token, localize) {
9842
+ var era = date.getUTCFullYear() > 0 ? 1 : 0;
9843
+ switch (token) {
9844
+ // AD, BC
9845
+ case 'G':
9846
+ case 'GG':
9847
+ case 'GGG':
9848
+ return localize.era(era, {
9849
+ width: 'abbreviated'
9850
+ });
9851
+ // A, B
9852
+ case 'GGGGG':
9853
+ return localize.era(era, {
9854
+ width: 'narrow'
9855
+ });
9856
+ // Anno Domini, Before Christ
9857
+ case 'GGGG':
9858
+ default:
9859
+ return localize.era(era, {
9860
+ width: 'wide'
9861
+ });
9862
+ }
9863
+ },
9864
+ // Year
9865
+ y: function y(date, token, localize) {
9866
+ // Ordinal number
9867
+ if (token === 'yo') {
9868
+ var signedYear = date.getUTCFullYear();
9869
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
9870
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
9871
+ return localize.ordinalNumber(year, {
9872
+ unit: 'year'
9873
+ });
9874
+ }
9875
+ return lightFormatters.y(date, token);
9876
+ },
9877
+ // Local week-numbering year
9878
+ 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;
10115
9882
 
10116
- function startOfUTCISOWeek(dirtyDate) {
10117
- requiredArgs(1, arguments);
10118
- var weekStartsOn = 1;
10119
- var date = toDate(dirtyDate);
10120
- var day = date.getUTCDay();
10121
- var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
10122
- date.setUTCDate(date.getUTCDate() - diff);
10123
- date.setUTCHours(0, 0, 0, 0);
10124
- return date;
10125
- }
9883
+ // Two digit year
9884
+ if (token === 'YY') {
9885
+ var twoDigitYear = weekYear % 100;
9886
+ return addLeadingZeros(twoDigitYear, 2);
9887
+ }
10126
9888
 
10127
- // See issue: https://github.com/date-fns/date-fns/issues/376
10128
-
10129
- function getUTCISOWeekYear(dirtyDate) {
10130
- requiredArgs(1, arguments);
10131
- var date = toDate(dirtyDate);
10132
- var year = date.getUTCFullYear();
10133
- var fourthOfJanuaryOfNextYear = new Date(0);
10134
- fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
10135
- fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
10136
- var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
10137
- var fourthOfJanuaryOfThisYear = new Date(0);
10138
- fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
10139
- fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
10140
- var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
10141
- if (date.getTime() >= startOfNextYear.getTime()) {
10142
- return year + 1;
10143
- } else if (date.getTime() >= startOfThisYear.getTime()) {
10144
- return year;
10145
- } else {
10146
- return year - 1;
10147
- }
10148
- }
10149
-
10150
- // See issue: https://github.com/date-fns/date-fns/issues/376
10151
-
10152
- function startOfUTCISOWeekYear(dirtyDate) {
10153
- requiredArgs(1, arguments);
10154
- var year = getUTCISOWeekYear(dirtyDate);
10155
- var fourthOfJanuary = new Date(0);
10156
- fourthOfJanuary.setUTCFullYear(year, 0, 4);
10157
- fourthOfJanuary.setUTCHours(0, 0, 0, 0);
10158
- var date = startOfUTCISOWeek(fourthOfJanuary);
10159
- return date;
10160
- }
10161
-
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
-
10165
- function getUTCISOWeek(dirtyDate) {
10166
- requiredArgs(1, arguments);
10167
- var date = toDate(dirtyDate);
10168
- var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer
10169
- // because the number of milliseconds in a week is not constant
10170
- // (e.g. it's different in the week of the daylight saving time clock shift)
10171
-
10172
- return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
10173
- }
10174
-
10175
- // See issue: https://github.com/date-fns/date-fns/issues/376
10176
-
10177
- function startOfUTCWeek(dirtyDate, dirtyOptions) {
10178
- requiredArgs(1, arguments);
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
10184
-
10185
- if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
10186
- throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
10187
- }
10188
- var date = toDate(dirtyDate);
10189
- var day = date.getUTCDay();
10190
- var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
10191
- date.setUTCDate(date.getUTCDate() - diff);
10192
- date.setUTCHours(0, 0, 0, 0);
10193
- return date;
10194
- }
10195
-
10196
- // See issue: https://github.com/date-fns/date-fns/issues/376
10197
-
10198
- function getUTCWeekYear(dirtyDate, dirtyOptions) {
10199
- requiredArgs(1, arguments);
10200
- var date = toDate(dirtyDate, dirtyOptions);
10201
- var year = date.getUTCFullYear();
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
10207
-
10208
- if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
10209
- throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
10210
- }
10211
- var firstWeekOfNextYear = new Date(0);
10212
- firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
10213
- firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
10214
- var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions);
10215
- var firstWeekOfThisYear = new Date(0);
10216
- firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
10217
- firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
10218
- var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions);
10219
- if (date.getTime() >= startOfNextYear.getTime()) {
10220
- return year + 1;
10221
- } else if (date.getTime() >= startOfThisYear.getTime()) {
10222
- return year;
10223
- } else {
10224
- return year - 1;
10225
- }
10226
- }
10227
-
10228
- // See issue: https://github.com/date-fns/date-fns/issues/376
10229
-
10230
- function startOfUTCWeekYear(dirtyDate, dirtyOptions) {
10231
- requiredArgs(1, arguments);
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);
10238
- var firstWeek = new Date(0);
10239
- firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
10240
- firstWeek.setUTCHours(0, 0, 0, 0);
10241
- var date = startOfUTCWeek(firstWeek, dirtyOptions);
10242
- return date;
10243
- }
10244
-
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
-
10248
- function getUTCWeek(dirtyDate, options) {
10249
- requiredArgs(1, arguments);
10250
- var date = toDate(dirtyDate);
10251
- var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer
10252
- // because the number of milliseconds in a week is not constant
10253
- // (e.g. it's different in the week of the daylight saving time clock shift)
10254
-
10255
- return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
10256
- }
10257
-
10258
- var dayPeriodEnum = {
10259
- am: 'am',
10260
- pm: 'pm',
10261
- midnight: 'midnight',
10262
- noon: 'noon',
10263
- morning: 'morning',
10264
- afternoon: 'afternoon',
10265
- evening: 'evening',
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
- */
10312
- };
10313
-
10314
- var formatters = {
10315
- // Era
10316
- G: function G(date, token, localize) {
10317
- var era = date.getUTCFullYear() > 0 ? 1 : 0;
10318
- switch (token) {
10319
- // AD, BC
10320
- case 'G':
10321
- case 'GG':
10322
- case 'GGG':
10323
- return localize.era(era, {
10324
- width: 'abbreviated'
10325
- });
10326
- // A, B
10327
-
10328
- case 'GGGGG':
10329
- return localize.era(era, {
10330
- width: 'narrow'
10331
- });
10332
- // Anno Domini, Before Christ
10333
-
10334
- case 'GGGG':
10335
- default:
10336
- return localize.era(era, {
10337
- width: 'wide'
10338
- });
10339
- }
10340
- },
10341
- // Year
10342
- y: function y(date, token, localize) {
10343
- // Ordinal number
10344
- if (token === 'yo') {
10345
- var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
10346
-
10347
- var year = signedYear > 0 ? signedYear : 1 - signedYear;
10348
- return localize.ordinalNumber(year, {
10349
- unit: 'year'
10350
- });
10351
- }
10352
- return lightFormatters.y(date, token);
10353
- },
10354
- // Local week-numbering year
10355
- Y: function Y(date, token, localize, options) {
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
10359
-
10360
- if (token === 'YY') {
10361
- var twoDigitYear = weekYear % 100;
10362
- return addLeadingZeros(twoDigitYear, 2);
10363
- } // Ordinal number
10364
-
10365
- if (token === 'Yo') {
10366
- return localize.ordinalNumber(weekYear, {
10367
- unit: 'year'
10368
- });
10369
- } // Padding
9889
+ // Ordinal number
9890
+ if (token === 'Yo') {
9891
+ return localize.ordinalNumber(weekYear, {
9892
+ unit: 'year'
9893
+ });
9894
+ }
10370
9895
 
9896
+ // Padding
10371
9897
  return addLeadingZeros(weekYear, token.length);
10372
9898
  },
10373
9899
  // ISO week-numbering year
10374
9900
  R: function R(date, token) {
10375
- var isoWeekYear = getUTCISOWeekYear(date); // Padding
9901
+ var isoWeekYear = getUTCISOWeekYear(date);
10376
9902
 
9903
+ // Padding
10377
9904
  return addLeadingZeros(isoWeekYear, token.length);
10378
9905
  },
10379
9906
  // Extended year. This is a single number designating the year of this calendar system.
@@ -10397,31 +9924,26 @@ var formatters = {
10397
9924
  case 'Q':
10398
9925
  return String(quarter);
10399
9926
  // 01, 02, 03, 04
10400
-
10401
9927
  case 'QQ':
10402
9928
  return addLeadingZeros(quarter, 2);
10403
9929
  // 1st, 2nd, 3rd, 4th
10404
-
10405
9930
  case 'Qo':
10406
9931
  return localize.ordinalNumber(quarter, {
10407
9932
  unit: 'quarter'
10408
9933
  });
10409
9934
  // Q1, Q2, Q3, Q4
10410
-
10411
9935
  case 'QQQ':
10412
9936
  return localize.quarter(quarter, {
10413
9937
  width: 'abbreviated',
10414
9938
  context: 'formatting'
10415
9939
  });
10416
9940
  // 1, 2, 3, 4 (narrow quarter; could be not numerical)
10417
-
10418
9941
  case 'QQQQQ':
10419
9942
  return localize.quarter(quarter, {
10420
9943
  width: 'narrow',
10421
9944
  context: 'formatting'
10422
9945
  });
10423
9946
  // 1st quarter, 2nd quarter, ...
10424
-
10425
9947
  case 'QQQQ':
10426
9948
  default:
10427
9949
  return localize.quarter(quarter, {
@@ -10438,31 +9960,26 @@ var formatters = {
10438
9960
  case 'q':
10439
9961
  return String(quarter);
10440
9962
  // 01, 02, 03, 04
10441
-
10442
9963
  case 'qq':
10443
9964
  return addLeadingZeros(quarter, 2);
10444
9965
  // 1st, 2nd, 3rd, 4th
10445
-
10446
9966
  case 'qo':
10447
9967
  return localize.ordinalNumber(quarter, {
10448
9968
  unit: 'quarter'
10449
9969
  });
10450
9970
  // Q1, Q2, Q3, Q4
10451
-
10452
9971
  case 'qqq':
10453
9972
  return localize.quarter(quarter, {
10454
9973
  width: 'abbreviated',
10455
9974
  context: 'standalone'
10456
9975
  });
10457
9976
  // 1, 2, 3, 4 (narrow quarter; could be not numerical)
10458
-
10459
9977
  case 'qqqqq':
10460
9978
  return localize.quarter(quarter, {
10461
9979
  width: 'narrow',
10462
9980
  context: 'standalone'
10463
9981
  });
10464
9982
  // 1st quarter, 2nd quarter, ...
10465
-
10466
9983
  case 'qqqq':
10467
9984
  default:
10468
9985
  return localize.quarter(quarter, {
@@ -10479,27 +9996,23 @@ var formatters = {
10479
9996
  case 'MM':
10480
9997
  return lightFormatters.M(date, token);
10481
9998
  // 1st, 2nd, ..., 12th
10482
-
10483
9999
  case 'Mo':
10484
10000
  return localize.ordinalNumber(month + 1, {
10485
10001
  unit: 'month'
10486
10002
  });
10487
10003
  // Jan, Feb, ..., Dec
10488
-
10489
10004
  case 'MMM':
10490
10005
  return localize.month(month, {
10491
10006
  width: 'abbreviated',
10492
10007
  context: 'formatting'
10493
10008
  });
10494
10009
  // J, F, ..., D
10495
-
10496
10010
  case 'MMMMM':
10497
10011
  return localize.month(month, {
10498
10012
  width: 'narrow',
10499
10013
  context: 'formatting'
10500
10014
  });
10501
10015
  // January, February, ..., December
10502
-
10503
10016
  case 'MMMM':
10504
10017
  default:
10505
10018
  return localize.month(month, {
@@ -10516,31 +10029,26 @@ var formatters = {
10516
10029
  case 'L':
10517
10030
  return String(month + 1);
10518
10031
  // 01, 02, ..., 12
10519
-
10520
10032
  case 'LL':
10521
10033
  return addLeadingZeros(month + 1, 2);
10522
10034
  // 1st, 2nd, ..., 12th
10523
-
10524
10035
  case 'Lo':
10525
10036
  return localize.ordinalNumber(month + 1, {
10526
10037
  unit: 'month'
10527
10038
  });
10528
10039
  // Jan, Feb, ..., Dec
10529
-
10530
10040
  case 'LLL':
10531
10041
  return localize.month(month, {
10532
10042
  width: 'abbreviated',
10533
10043
  context: 'standalone'
10534
10044
  });
10535
10045
  // J, F, ..., D
10536
-
10537
10046
  case 'LLLLL':
10538
10047
  return localize.month(month, {
10539
10048
  width: 'narrow',
10540
10049
  context: 'standalone'
10541
10050
  });
10542
10051
  // January, February, ..., December
10543
-
10544
10052
  case 'LLLL':
10545
10053
  default:
10546
10054
  return localize.month(month, {
@@ -10601,21 +10109,18 @@ var formatters = {
10601
10109
  context: 'formatting'
10602
10110
  });
10603
10111
  // T
10604
-
10605
10112
  case 'EEEEE':
10606
10113
  return localize.day(dayOfWeek, {
10607
10114
  width: 'narrow',
10608
10115
  context: 'formatting'
10609
10116
  });
10610
10117
  // Tu
10611
-
10612
10118
  case 'EEEEEE':
10613
10119
  return localize.day(dayOfWeek, {
10614
10120
  width: 'short',
10615
10121
  context: 'formatting'
10616
10122
  });
10617
10123
  // Tuesday
10618
-
10619
10124
  case 'EEEE':
10620
10125
  default:
10621
10126
  return localize.day(dayOfWeek, {
@@ -10633,11 +10138,9 @@ var formatters = {
10633
10138
  case 'e':
10634
10139
  return String(localDayOfWeek);
10635
10140
  // Padded numerical value
10636
-
10637
10141
  case 'ee':
10638
10142
  return addLeadingZeros(localDayOfWeek, 2);
10639
10143
  // 1st, 2nd, ..., 7th
10640
-
10641
10144
  case 'eo':
10642
10145
  return localize.ordinalNumber(localDayOfWeek, {
10643
10146
  unit: 'day'
@@ -10648,21 +10151,18 @@ var formatters = {
10648
10151
  context: 'formatting'
10649
10152
  });
10650
10153
  // T
10651
-
10652
10154
  case 'eeeee':
10653
10155
  return localize.day(dayOfWeek, {
10654
10156
  width: 'narrow',
10655
10157
  context: 'formatting'
10656
10158
  });
10657
10159
  // Tu
10658
-
10659
10160
  case 'eeeeee':
10660
10161
  return localize.day(dayOfWeek, {
10661
10162
  width: 'short',
10662
10163
  context: 'formatting'
10663
10164
  });
10664
10165
  // Tuesday
10665
-
10666
10166
  case 'eeee':
10667
10167
  default:
10668
10168
  return localize.day(dayOfWeek, {
@@ -10680,11 +10180,9 @@ var formatters = {
10680
10180
  case 'c':
10681
10181
  return String(localDayOfWeek);
10682
10182
  // Padded numerical value
10683
-
10684
10183
  case 'cc':
10685
10184
  return addLeadingZeros(localDayOfWeek, token.length);
10686
10185
  // 1st, 2nd, ..., 7th
10687
-
10688
10186
  case 'co':
10689
10187
  return localize.ordinalNumber(localDayOfWeek, {
10690
10188
  unit: 'day'
@@ -10695,21 +10193,18 @@ var formatters = {
10695
10193
  context: 'standalone'
10696
10194
  });
10697
10195
  // T
10698
-
10699
10196
  case 'ccccc':
10700
10197
  return localize.day(dayOfWeek, {
10701
10198
  width: 'narrow',
10702
10199
  context: 'standalone'
10703
10200
  });
10704
10201
  // Tu
10705
-
10706
10202
  case 'cccccc':
10707
10203
  return localize.day(dayOfWeek, {
10708
10204
  width: 'short',
10709
10205
  context: 'standalone'
10710
10206
  });
10711
10207
  // Tuesday
10712
-
10713
10208
  case 'cccc':
10714
10209
  default:
10715
10210
  return localize.day(dayOfWeek, {
@@ -10727,38 +10222,32 @@ var formatters = {
10727
10222
  case 'i':
10728
10223
  return String(isoDayOfWeek);
10729
10224
  // 02
10730
-
10731
10225
  case 'ii':
10732
10226
  return addLeadingZeros(isoDayOfWeek, token.length);
10733
10227
  // 2nd
10734
-
10735
10228
  case 'io':
10736
10229
  return localize.ordinalNumber(isoDayOfWeek, {
10737
10230
  unit: 'day'
10738
10231
  });
10739
10232
  // Tue
10740
-
10741
10233
  case 'iii':
10742
10234
  return localize.day(dayOfWeek, {
10743
10235
  width: 'abbreviated',
10744
10236
  context: 'formatting'
10745
10237
  });
10746
10238
  // T
10747
-
10748
10239
  case 'iiiii':
10749
10240
  return localize.day(dayOfWeek, {
10750
10241
  width: 'narrow',
10751
10242
  context: 'formatting'
10752
10243
  });
10753
10244
  // Tu
10754
-
10755
10245
  case 'iiiiii':
10756
10246
  return localize.day(dayOfWeek, {
10757
10247
  width: 'short',
10758
10248
  context: 'formatting'
10759
10249
  });
10760
10250
  // Tuesday
10761
-
10762
10251
  case 'iiii':
10763
10252
  default:
10764
10253
  return localize.day(dayOfWeek, {
@@ -10767,417 +10256,897 @@ var formatters = {
10767
10256
  });
10768
10257
  }
10769
10258
  },
10770
- // AM or PM
10771
- a: function a(date, token, localize) {
10772
- var hours = date.getUTCHours();
10773
- var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
10774
- switch (token) {
10775
- case 'a':
10776
- case 'aa':
10777
- case 'aaa':
10778
- return localize.dayPeriod(dayPeriodEnumValue, {
10779
- width: 'abbreviated',
10780
- context: 'formatting'
10781
- });
10782
- case 'aaaaa':
10783
- return localize.dayPeriod(dayPeriodEnumValue, {
10784
- width: 'narrow',
10785
- context: 'formatting'
10786
- });
10787
- case 'aaaa':
10788
- default:
10789
- return localize.dayPeriod(dayPeriodEnumValue, {
10790
- width: 'wide',
10791
- context: 'formatting'
10792
- });
10793
- }
10259
+ // AM or PM
10260
+ a: function a(date, token, localize) {
10261
+ var hours = date.getUTCHours();
10262
+ var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
10263
+ switch (token) {
10264
+ case 'a':
10265
+ case 'aa':
10266
+ return localize.dayPeriod(dayPeriodEnumValue, {
10267
+ width: 'abbreviated',
10268
+ context: 'formatting'
10269
+ });
10270
+ case 'aaa':
10271
+ return localize.dayPeriod(dayPeriodEnumValue, {
10272
+ width: 'abbreviated',
10273
+ context: 'formatting'
10274
+ }).toLowerCase();
10275
+ case 'aaaaa':
10276
+ return localize.dayPeriod(dayPeriodEnumValue, {
10277
+ width: 'narrow',
10278
+ context: 'formatting'
10279
+ });
10280
+ case 'aaaa':
10281
+ default:
10282
+ return localize.dayPeriod(dayPeriodEnumValue, {
10283
+ width: 'wide',
10284
+ context: 'formatting'
10285
+ });
10286
+ }
10287
+ },
10288
+ // AM, PM, midnight, noon
10289
+ b: function b(date, token, localize) {
10290
+ var hours = date.getUTCHours();
10291
+ var dayPeriodEnumValue;
10292
+ if (hours === 12) {
10293
+ dayPeriodEnumValue = dayPeriodEnum.noon;
10294
+ } else if (hours === 0) {
10295
+ dayPeriodEnumValue = dayPeriodEnum.midnight;
10296
+ } else {
10297
+ dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
10298
+ }
10299
+ switch (token) {
10300
+ case 'b':
10301
+ case 'bb':
10302
+ return localize.dayPeriod(dayPeriodEnumValue, {
10303
+ width: 'abbreviated',
10304
+ context: 'formatting'
10305
+ });
10306
+ case 'bbb':
10307
+ return localize.dayPeriod(dayPeriodEnumValue, {
10308
+ width: 'abbreviated',
10309
+ context: 'formatting'
10310
+ }).toLowerCase();
10311
+ case 'bbbbb':
10312
+ return localize.dayPeriod(dayPeriodEnumValue, {
10313
+ width: 'narrow',
10314
+ context: 'formatting'
10315
+ });
10316
+ case 'bbbb':
10317
+ default:
10318
+ return localize.dayPeriod(dayPeriodEnumValue, {
10319
+ width: 'wide',
10320
+ context: 'formatting'
10321
+ });
10322
+ }
10323
+ },
10324
+ // in the morning, in the afternoon, in the evening, at night
10325
+ B: function B(date, token, localize) {
10326
+ var hours = date.getUTCHours();
10327
+ var dayPeriodEnumValue;
10328
+ if (hours >= 17) {
10329
+ dayPeriodEnumValue = dayPeriodEnum.evening;
10330
+ } else if (hours >= 12) {
10331
+ dayPeriodEnumValue = dayPeriodEnum.afternoon;
10332
+ } else if (hours >= 4) {
10333
+ dayPeriodEnumValue = dayPeriodEnum.morning;
10334
+ } else {
10335
+ dayPeriodEnumValue = dayPeriodEnum.night;
10336
+ }
10337
+ switch (token) {
10338
+ case 'B':
10339
+ case 'BB':
10340
+ case 'BBB':
10341
+ return localize.dayPeriod(dayPeriodEnumValue, {
10342
+ width: 'abbreviated',
10343
+ context: 'formatting'
10344
+ });
10345
+ case 'BBBBB':
10346
+ return localize.dayPeriod(dayPeriodEnumValue, {
10347
+ width: 'narrow',
10348
+ context: 'formatting'
10349
+ });
10350
+ case 'BBBB':
10351
+ default:
10352
+ return localize.dayPeriod(dayPeriodEnumValue, {
10353
+ width: 'wide',
10354
+ context: 'formatting'
10355
+ });
10356
+ }
10357
+ },
10358
+ // Hour [1-12]
10359
+ h: function h(date, token, localize) {
10360
+ if (token === 'ho') {
10361
+ var hours = date.getUTCHours() % 12;
10362
+ if (hours === 0) hours = 12;
10363
+ return localize.ordinalNumber(hours, {
10364
+ unit: 'hour'
10365
+ });
10366
+ }
10367
+ return lightFormatters.h(date, token);
10368
+ },
10369
+ // Hour [0-23]
10370
+ H: function H(date, token, localize) {
10371
+ if (token === 'Ho') {
10372
+ return localize.ordinalNumber(date.getUTCHours(), {
10373
+ unit: 'hour'
10374
+ });
10375
+ }
10376
+ return lightFormatters.H(date, token);
10377
+ },
10378
+ // Hour [0-11]
10379
+ K: function K(date, token, localize) {
10380
+ var hours = date.getUTCHours() % 12;
10381
+ if (token === 'Ko') {
10382
+ return localize.ordinalNumber(hours, {
10383
+ unit: 'hour'
10384
+ });
10385
+ }
10386
+ return addLeadingZeros(hours, token.length);
10387
+ },
10388
+ // Hour [1-24]
10389
+ k: function k(date, token, localize) {
10390
+ var hours = date.getUTCHours();
10391
+ if (hours === 0) hours = 24;
10392
+ if (token === 'ko') {
10393
+ return localize.ordinalNumber(hours, {
10394
+ unit: 'hour'
10395
+ });
10396
+ }
10397
+ return addLeadingZeros(hours, token.length);
10398
+ },
10399
+ // Minute
10400
+ m: function m(date, token, localize) {
10401
+ if (token === 'mo') {
10402
+ return localize.ordinalNumber(date.getUTCMinutes(), {
10403
+ unit: 'minute'
10404
+ });
10405
+ }
10406
+ return lightFormatters.m(date, token);
10407
+ },
10408
+ // Second
10409
+ s: function s(date, token, localize) {
10410
+ if (token === 'so') {
10411
+ return localize.ordinalNumber(date.getUTCSeconds(), {
10412
+ unit: 'second'
10413
+ });
10414
+ }
10415
+ return lightFormatters.s(date, token);
10416
+ },
10417
+ // Fraction of second
10418
+ S: function S(date, token) {
10419
+ return lightFormatters.S(date, token);
10420
+ },
10421
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
10422
+ X: function X(date, token, _localize, options) {
10423
+ var originalDate = options._originalDate || date;
10424
+ var timezoneOffset = originalDate.getTimezoneOffset();
10425
+ if (timezoneOffset === 0) {
10426
+ return 'Z';
10427
+ }
10428
+ switch (token) {
10429
+ // Hours and optional minutes
10430
+ case 'X':
10431
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
10432
+
10433
+ // Hours, minutes and optional seconds without `:` delimiter
10434
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10435
+ // so this token always has the same output as `XX`
10436
+ case 'XXXX':
10437
+ case 'XX':
10438
+ // Hours and minutes without `:` delimiter
10439
+ return formatTimezone(timezoneOffset);
10440
+
10441
+ // Hours, minutes and optional seconds with `:` delimiter
10442
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10443
+ // so this token always has the same output as `XXX`
10444
+ case 'XXXXX':
10445
+ case 'XXX': // Hours and minutes with `:` delimiter
10446
+ default:
10447
+ return formatTimezone(timezoneOffset, ':');
10448
+ }
10449
+ },
10450
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
10451
+ x: function x(date, token, _localize, options) {
10452
+ var originalDate = options._originalDate || date;
10453
+ var timezoneOffset = originalDate.getTimezoneOffset();
10454
+ switch (token) {
10455
+ // Hours and optional minutes
10456
+ case 'x':
10457
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
10458
+
10459
+ // Hours, minutes and optional seconds without `:` delimiter
10460
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10461
+ // so this token always has the same output as `xx`
10462
+ case 'xxxx':
10463
+ case 'xx':
10464
+ // Hours and minutes without `:` delimiter
10465
+ return formatTimezone(timezoneOffset);
10466
+
10467
+ // Hours, minutes and optional seconds with `:` delimiter
10468
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10469
+ // so this token always has the same output as `xxx`
10470
+ case 'xxxxx':
10471
+ case 'xxx': // Hours and minutes with `:` delimiter
10472
+ default:
10473
+ return formatTimezone(timezoneOffset, ':');
10474
+ }
10475
+ },
10476
+ // Timezone (GMT)
10477
+ O: function O(date, token, _localize, options) {
10478
+ var originalDate = options._originalDate || date;
10479
+ var timezoneOffset = originalDate.getTimezoneOffset();
10480
+ switch (token) {
10481
+ // Short
10482
+ case 'O':
10483
+ case 'OO':
10484
+ case 'OOO':
10485
+ return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
10486
+ // Long
10487
+ case 'OOOO':
10488
+ default:
10489
+ return 'GMT' + formatTimezone(timezoneOffset, ':');
10490
+ }
10491
+ },
10492
+ // Timezone (specific non-location)
10493
+ z: function z(date, token, _localize, options) {
10494
+ var originalDate = options._originalDate || date;
10495
+ var timezoneOffset = originalDate.getTimezoneOffset();
10496
+ switch (token) {
10497
+ // Short
10498
+ case 'z':
10499
+ case 'zz':
10500
+ case 'zzz':
10501
+ return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
10502
+ // Long
10503
+ case 'zzzz':
10504
+ default:
10505
+ return 'GMT' + formatTimezone(timezoneOffset, ':');
10506
+ }
10507
+ },
10508
+ // Seconds timestamp
10509
+ t: function t(date, token, _localize, options) {
10510
+ var originalDate = options._originalDate || date;
10511
+ var timestamp = Math.floor(originalDate.getTime() / 1000);
10512
+ return addLeadingZeros(timestamp, token.length);
10513
+ },
10514
+ // Milliseconds timestamp
10515
+ T: function T(date, token, _localize, options) {
10516
+ var originalDate = options._originalDate || date;
10517
+ var timestamp = originalDate.getTime();
10518
+ return addLeadingZeros(timestamp, token.length);
10519
+ }
10520
+ };
10521
+ function formatTimezoneShort(offset, dirtyDelimiter) {
10522
+ var sign = offset > 0 ? '-' : '+';
10523
+ var absOffset = Math.abs(offset);
10524
+ var hours = Math.floor(absOffset / 60);
10525
+ var minutes = absOffset % 60;
10526
+ if (minutes === 0) {
10527
+ return sign + String(hours);
10528
+ }
10529
+ var delimiter = dirtyDelimiter || '';
10530
+ return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
10531
+ }
10532
+ function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
10533
+ if (offset % 60 === 0) {
10534
+ var sign = offset > 0 ? '-' : '+';
10535
+ return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
10536
+ }
10537
+ return formatTimezone(offset, dirtyDelimiter);
10538
+ }
10539
+ function formatTimezone(offset, dirtyDelimiter) {
10540
+ var delimiter = dirtyDelimiter || '';
10541
+ var sign = offset > 0 ? '-' : '+';
10542
+ var absOffset = Math.abs(offset);
10543
+ var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
10544
+ var minutes = addLeadingZeros(absOffset % 60, 2);
10545
+ return sign + hours + delimiter + minutes;
10546
+ }
10547
+ var formatters$1 = formatters;
10548
+
10549
+ var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
10550
+ switch (pattern) {
10551
+ case 'P':
10552
+ return formatLong.date({
10553
+ width: 'short'
10554
+ });
10555
+ case 'PP':
10556
+ return formatLong.date({
10557
+ width: 'medium'
10558
+ });
10559
+ case 'PPP':
10560
+ return formatLong.date({
10561
+ width: 'long'
10562
+ });
10563
+ case 'PPPP':
10564
+ default:
10565
+ return formatLong.date({
10566
+ width: 'full'
10567
+ });
10568
+ }
10569
+ };
10570
+ var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
10571
+ switch (pattern) {
10572
+ case 'p':
10573
+ return formatLong.time({
10574
+ width: 'short'
10575
+ });
10576
+ case 'pp':
10577
+ return formatLong.time({
10578
+ width: 'medium'
10579
+ });
10580
+ case 'ppp':
10581
+ return formatLong.time({
10582
+ width: 'long'
10583
+ });
10584
+ case 'pppp':
10585
+ default:
10586
+ return formatLong.time({
10587
+ width: 'full'
10588
+ });
10589
+ }
10590
+ };
10591
+ var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong) {
10592
+ var matchResult = pattern.match(/(P+)(p+)?/) || [];
10593
+ var datePattern = matchResult[1];
10594
+ var timePattern = matchResult[2];
10595
+ if (!timePattern) {
10596
+ return dateLongFormatter(pattern, formatLong);
10597
+ }
10598
+ var dateTimeFormat;
10599
+ switch (datePattern) {
10600
+ case 'P':
10601
+ dateTimeFormat = formatLong.dateTime({
10602
+ width: 'short'
10603
+ });
10604
+ break;
10605
+ case 'PP':
10606
+ dateTimeFormat = formatLong.dateTime({
10607
+ width: 'medium'
10608
+ });
10609
+ break;
10610
+ case 'PPP':
10611
+ dateTimeFormat = formatLong.dateTime({
10612
+ width: 'long'
10613
+ });
10614
+ break;
10615
+ case 'PPPP':
10616
+ default:
10617
+ dateTimeFormat = formatLong.dateTime({
10618
+ width: 'full'
10619
+ });
10620
+ break;
10621
+ }
10622
+ return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
10623
+ };
10624
+ var longFormatters = {
10625
+ p: timeLongFormatter,
10626
+ P: dateTimeLongFormatter
10627
+ };
10628
+ var longFormatters$1 = longFormatters;
10629
+
10630
+ /**
10631
+ * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
10632
+ * They usually appear for dates that denote time before the timezones were introduced
10633
+ * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
10634
+ * and GMT+01:00:00 after that date)
10635
+ *
10636
+ * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
10637
+ * which would lead to incorrect calculations.
10638
+ *
10639
+ * This function returns the timezone offset in milliseconds that takes seconds in account.
10640
+ */
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();
10645
+ }
10646
+
10647
+ var protectedDayOfYearTokens = ['D', 'DD'];
10648
+ var protectedWeekYearTokens = ['YY', 'YYYY'];
10649
+ function isProtectedDayOfYearToken(token) {
10650
+ return protectedDayOfYearTokens.indexOf(token) !== -1;
10651
+ }
10652
+ function isProtectedWeekYearToken(token) {
10653
+ return protectedWeekYearTokens.indexOf(token) !== -1;
10654
+ }
10655
+ function throwProtectedError(token, format, input) {
10656
+ 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"));
10658
+ } 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"));
10660
+ } 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"));
10662
+ } 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'
10794
10680
  },
10795
- // AM, PM, midnight, noon
10796
- b: function b(date, token, localize) {
10797
- var hours = date.getUTCHours();
10798
- var dayPeriodEnumValue;
10799
- if (hours === 12) {
10800
- dayPeriodEnumValue = dayPeriodEnum.noon;
10801
- } else if (hours === 0) {
10802
- dayPeriodEnumValue = dayPeriodEnum.midnight;
10803
- } else {
10804
- dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
10805
- }
10806
- switch (token) {
10807
- case 'b':
10808
- case 'bb':
10809
- case 'bbb':
10810
- return localize.dayPeriod(dayPeriodEnumValue, {
10811
- width: 'abbreviated',
10812
- context: 'formatting'
10813
- });
10814
- case 'bbbbb':
10815
- return localize.dayPeriod(dayPeriodEnumValue, {
10816
- width: 'narrow',
10817
- context: 'formatting'
10818
- });
10819
- case 'bbbb':
10820
- default:
10821
- return localize.dayPeriod(dayPeriodEnumValue, {
10822
- width: 'wide',
10823
- context: 'formatting'
10824
- });
10825
- }
10681
+ xMinutes: {
10682
+ one: '1 minute',
10683
+ other: '{{count}} minutes'
10826
10684
  },
10827
- // in the morning, in the afternoon, in the evening, at night
10828
- B: function B(date, token, localize) {
10829
- var hours = date.getUTCHours();
10830
- var dayPeriodEnumValue;
10831
- if (hours >= 17) {
10832
- dayPeriodEnumValue = dayPeriodEnum.evening;
10833
- } else if (hours >= 12) {
10834
- dayPeriodEnumValue = dayPeriodEnum.afternoon;
10835
- } else if (hours >= 4) {
10836
- dayPeriodEnumValue = dayPeriodEnum.morning;
10837
- } else {
10838
- dayPeriodEnumValue = dayPeriodEnum.night;
10839
- }
10840
- switch (token) {
10841
- case 'B':
10842
- case 'BB':
10843
- case 'BBB':
10844
- return localize.dayPeriod(dayPeriodEnumValue, {
10845
- width: 'abbreviated',
10846
- context: 'formatting'
10847
- });
10848
- case 'BBBBB':
10849
- return localize.dayPeriod(dayPeriodEnumValue, {
10850
- width: 'narrow',
10851
- context: 'formatting'
10852
- });
10853
- case 'BBBB':
10854
- default:
10855
- return localize.dayPeriod(dayPeriodEnumValue, {
10856
- width: 'wide',
10857
- context: 'formatting'
10858
- });
10859
- }
10685
+ aboutXHours: {
10686
+ one: 'about 1 hour',
10687
+ other: 'about {{count}} hours'
10860
10688
  },
10861
- // Hour [1-12]
10862
- h: function h(date, token, localize) {
10863
- if (token === 'ho') {
10864
- var hours = date.getUTCHours() % 12;
10865
- if (hours === 0) hours = 12;
10866
- return localize.ordinalNumber(hours, {
10867
- unit: 'hour'
10868
- });
10869
- }
10870
- return lightFormatters.h(date, token);
10689
+ xHours: {
10690
+ one: '1 hour',
10691
+ other: '{{count}} hours'
10871
10692
  },
10872
- // Hour [0-23]
10873
- H: function H(date, token, localize) {
10874
- if (token === 'Ho') {
10875
- return localize.ordinalNumber(date.getUTCHours(), {
10876
- unit: 'hour'
10877
- });
10878
- }
10879
- return lightFormatters.H(date, token);
10693
+ xDays: {
10694
+ one: '1 day',
10695
+ other: '{{count}} days'
10880
10696
  },
10881
- // Hour [0-11]
10882
- K: function K(date, token, localize) {
10883
- var hours = date.getUTCHours() % 12;
10884
- if (token === 'Ko') {
10885
- return localize.ordinalNumber(hours, {
10886
- unit: 'hour'
10887
- });
10888
- }
10889
- return addLeadingZeros(hours, token.length);
10697
+ aboutXWeeks: {
10698
+ one: 'about 1 week',
10699
+ other: 'about {{count}} weeks'
10890
10700
  },
10891
- // Hour [1-24]
10892
- k: function k(date, token, localize) {
10893
- var hours = date.getUTCHours();
10894
- if (hours === 0) hours = 24;
10895
- if (token === 'ko') {
10896
- return localize.ordinalNumber(hours, {
10897
- unit: 'hour'
10898
- });
10899
- }
10900
- return addLeadingZeros(hours, token.length);
10701
+ xWeeks: {
10702
+ one: '1 week',
10703
+ other: '{{count}} weeks'
10901
10704
  },
10902
- // Minute
10903
- m: function m(date, token, localize) {
10904
- if (token === 'mo') {
10905
- return localize.ordinalNumber(date.getUTCMinutes(), {
10906
- unit: 'minute'
10907
- });
10908
- }
10909
- return lightFormatters.m(date, token);
10705
+ aboutXMonths: {
10706
+ one: 'about 1 month',
10707
+ other: 'about {{count}} months'
10910
10708
  },
10911
- // Second
10912
- s: function s(date, token, localize) {
10913
- if (token === 'so') {
10914
- return localize.ordinalNumber(date.getUTCSeconds(), {
10915
- unit: 'second'
10916
- });
10917
- }
10918
- return lightFormatters.s(date, token);
10709
+ xMonths: {
10710
+ one: '1 month',
10711
+ other: '{{count}} months'
10919
10712
  },
10920
- // Fraction of second
10921
- S: function S(date, token) {
10922
- return lightFormatters.S(date, token);
10713
+ aboutXYears: {
10714
+ one: 'about 1 year',
10715
+ other: 'about {{count}} years'
10923
10716
  },
10924
- // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
10925
- X: function X(date, token, _localize, options) {
10926
- var originalDate = options._originalDate || date;
10927
- var timezoneOffset = originalDate.getTimezoneOffset();
10928
- if (timezoneOffset === 0) {
10929
- return 'Z';
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';
10930
10745
  }
10931
- switch (token) {
10932
- // Hours and optional minutes
10933
- case 'X':
10934
- return formatTimezoneWithOptionalMinutes(timezoneOffset);
10935
- // Hours, minutes and optional seconds without `:` delimiter
10936
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10937
- // so this token always has the same output as `XX`
10746
+ }
10747
+ return result;
10748
+ };
10749
+ var formatDistance$1 = formatDistance;
10938
10750
 
10939
- case 'XXXX':
10940
- case 'XX':
10941
- // Hours and minutes without `:` delimiter
10942
- return formatTimezone(timezoneOffset);
10943
- // Hours, minutes and optional seconds with `:` delimiter
10944
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10945
- // so this token always has the same output as `XXX`
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
+ }
10760
+
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;
10946
10794
 
10947
- case 'XXXXX':
10948
- case 'XXX': // Hours and minutes with `:` delimiter
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;
10949
10807
 
10950
- default:
10951
- return formatTimezone(timezoneOffset, ':');
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];
10952
10820
  }
10953
- },
10954
- // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
10955
- x: function x(date, token, _localize, options) {
10956
- var originalDate = options._originalDate || date;
10957
- var timezoneOffset = originalDate.getTimezoneOffset();
10958
- switch (token) {
10959
- // Hours and optional minutes
10960
- case 'x':
10961
- return formatTimezoneWithOptionalMinutes(timezoneOffset);
10962
- // Hours, minutes and optional seconds without `:` delimiter
10963
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10964
- // so this token always has the same output as `xx`
10965
-
10966
- case 'xxxx':
10967
- case 'xx':
10968
- // Hours and minutes without `:` delimiter
10969
- return formatTimezone(timezoneOffset);
10970
- // Hours, minutes and optional seconds with `:` delimiter
10971
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10972
- // so this token always has the same output as `xxx`
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
+ }
10973
10826
 
10974
- case 'xxxxx':
10975
- case 'xxx': // Hours and minutes with `:` delimiter
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
+ };
10976
10837
 
10977
- default:
10978
- return formatTimezone(timezoneOffset, ':');
10979
- }
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'
10980
10863
  },
10981
- // Timezone (GMT)
10982
- O: function O(date, token, _localize, options) {
10983
- var originalDate = options._originalDate || date;
10984
- var timezoneOffset = originalDate.getTimezoneOffset();
10985
- switch (token) {
10986
- // Short
10987
- case 'O':
10988
- case 'OO':
10989
- case 'OOO':
10990
- return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
10991
- // Long
10992
-
10993
- case 'OOOO':
10994
- default:
10995
- return 'GMT' + formatTimezone(timezoneOffset, ':');
10996
- }
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'
10997
10873
  },
10998
- // Timezone (specific non-location)
10999
- z: function z(date, token, _localize, options) {
11000
- var originalDate = options._originalDate || date;
11001
- var timezoneOffset = originalDate.getTimezoneOffset();
11002
- switch (token) {
11003
- // Short
11004
- case 'z':
11005
- case 'zz':
11006
- case 'zzz':
11007
- return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
11008
- // Long
11009
-
11010
- case 'zzzz':
11011
- default:
11012
- return 'GMT' + formatTimezone(timezoneOffset, ':');
11013
- }
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'
11014
10895
  },
11015
- // Seconds timestamp
11016
- t: function t(date, token, _localize, options) {
11017
- var originalDate = options._originalDate || date;
11018
- var timestamp = Math.floor(originalDate.getTime() / 1000);
11019
- return addLeadingZeros(timestamp, token.length);
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'
11020
10905
  },
11021
- // Milliseconds timestamp
11022
- T: function T(date, token, _localize, options) {
11023
- var originalDate = options._originalDate || date;
11024
- var timestamp = originalDate.getTime();
11025
- return addLeadingZeros(timestamp, token.length);
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'
11026
10915
  }
11027
10916
  };
11028
- function formatTimezoneShort(offset, dirtyDelimiter) {
11029
- var sign = offset > 0 ? '-' : '+';
11030
- var absOffset = Math.abs(offset);
11031
- var hours = Math.floor(absOffset / 60);
11032
- var minutes = absOffset % 60;
11033
- if (minutes === 0) {
11034
- return sign + String(hours);
11035
- }
11036
- var delimiter = dirtyDelimiter || '';
11037
- return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
11038
- }
11039
- function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
11040
- if (offset % 60 === 0) {
11041
- var sign = offset > 0 ? '-' : '+';
11042
- return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
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
+ }
11043
10937
  }
11044
- return formatTimezone(offset, dirtyDelimiter);
11045
- }
11046
- function formatTimezone(offset, dirtyDelimiter) {
11047
- var delimiter = dirtyDelimiter || '';
11048
- var sign = offset > 0 ? '-' : '+';
11049
- var absOffset = Math.abs(offset);
11050
- var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
11051
- var minutes = addLeadingZeros(absOffset % 60, 2);
11052
- return sign + hours + delimiter + minutes;
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
+ };
11053
10995
  }
11054
- var formatters$1 = formatters;
11055
-
11056
- function dateLongFormatter(pattern, formatLong) {
11057
- switch (pattern) {
11058
- case 'P':
11059
- return formatLong.date({
11060
- width: 'short'
11061
- });
11062
- case 'PP':
11063
- return formatLong.date({
11064
- width: 'medium'
11065
- });
11066
- case 'PPP':
11067
- return formatLong.date({
11068
- width: 'long'
11069
- });
11070
- case 'PPPP':
11071
- default:
11072
- return formatLong.date({
11073
- width: 'full'
11074
- });
10996
+ function findKey(object, predicate) {
10997
+ for (var key in object) {
10998
+ if (object.hasOwnProperty(key) && predicate(object[key])) {
10999
+ return key;
11000
+ }
11075
11001
  }
11002
+ return undefined;
11076
11003
  }
11077
- function timeLongFormatter(pattern, formatLong) {
11078
- switch (pattern) {
11079
- case 'p':
11080
- return formatLong.time({
11081
- width: 'short'
11082
- });
11083
- case 'pp':
11084
- return formatLong.time({
11085
- width: 'medium'
11086
- });
11087
- case 'ppp':
11088
- return formatLong.time({
11089
- width: 'long'
11090
- });
11091
- case 'pppp':
11092
- default:
11093
- return formatLong.time({
11094
- width: 'full'
11095
- });
11004
+ function findIndex(array, predicate) {
11005
+ for (var key = 0; key < array.length; key++) {
11006
+ if (predicate(array[key])) {
11007
+ return key;
11008
+ }
11096
11009
  }
11010
+ return undefined;
11097
11011
  }
11098
- function dateTimeLongFormatter(pattern, formatLong) {
11099
- var matchResult = pattern.match(/(P+)(p+)?/);
11100
- var datePattern = matchResult[1];
11101
- var timePattern = matchResult[2];
11102
- if (!timePattern) {
11103
- return dateLongFormatter(pattern, formatLong);
11104
- }
11105
- var dateTimeFormat;
11106
- switch (datePattern) {
11107
- case 'P':
11108
- dateTimeFormat = formatLong.dateTime({
11109
- width: 'short'
11110
- });
11111
- break;
11112
- case 'PP':
11113
- dateTimeFormat = formatLong.dateTime({
11114
- width: 'medium'
11115
- });
11116
- break;
11117
- case 'PPP':
11118
- dateTimeFormat = formatLong.dateTime({
11119
- width: 'long'
11120
- });
11121
- break;
11122
- case 'PPPP':
11123
- default:
11124
- dateTimeFormat = formatLong.dateTime({
11125
- width: 'full'
11126
- });
11127
- break;
11128
- }
11129
- return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
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
+ };
11130
11029
  }
11131
- var longFormatters = {
11132
- p: timeLongFormatter,
11133
- P: dateTimeLongFormatter
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
11134
11037
  };
11135
- var longFormatters$1 = longFormatters;
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;
11136
11127
 
11137
- var MILLISECONDS_IN_MINUTE = 60000;
11138
- function getDateMillisecondsPart(date) {
11139
- return date.getTime() % MILLISECONDS_IN_MINUTE;
11140
- }
11141
11128
  /**
11142
- * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
11143
- * They usually appear for dates that denote time before the timezones were introduced
11144
- * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
11145
- * and GMT+01:00:00 after that date)
11146
- *
11147
- * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
11148
- * which would lead to incorrect calculations.
11149
- *
11150
- * This function returns the timezone offset in milliseconds that takes seconds in account.
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}
11151
11136
  */
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;
11160
- }
11161
-
11162
- var protectedDayOfYearTokens = ['D', 'DD'];
11163
- var protectedWeekYearTokens = ['YY', 'YYYY'];
11164
- function isProtectedDayOfYearToken(token) {
11165
- return protectedDayOfYearTokens.indexOf(token) !== -1;
11166
- }
11167
- function isProtectedWeekYearToken(token) {
11168
- return protectedWeekYearTokens.indexOf(token) !== -1;
11169
- }
11170
- function throwProtectedError(token, format, input) {
11171
- if (token === 'YYYY') {
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"));
11173
- } else if (token === 'YY') {
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"));
11175
- } else if (token === 'D') {
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"));
11177
- } else if (token === 'DD') {
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"));
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
11179
11147
  }
11180
- }
11148
+ };
11149
+ var defaultLocale = locale;
11181
11150
 
11182
11151
  // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
11183
11152
  // (one of the certain letters followed by `o`)
@@ -11189,14 +11158,15 @@ function throwProtectedError(token, format, input) {
11189
11158
  // If there is no matching single quote
11190
11159
  // then the sequence will continue until the end of the string.
11191
11160
  // - . matches any single character unmatched by previous parts of the RegExps
11161
+ var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
11192
11162
 
11193
- var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also
11163
+ // This RegExp catches symbols escaped by quotes, and also
11194
11164
  // sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
11195
-
11196
11165
  var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
11197
11166
  var escapedStringRegExp = /^'([^]*?)'?$/;
11198
11167
  var doubleQuoteRegExp = /''/g;
11199
11168
  var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11169
+
11200
11170
  /**
11201
11171
  * @name format
11202
11172
  * @category Common Helpers
@@ -11206,7 +11176,7 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11206
11176
  * Return the formatted date string in the given format. The result may vary by locale.
11207
11177
  *
11208
11178
  * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
11209
- * > See: https://git.io/fxCyr
11179
+ * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
11210
11180
  *
11211
11181
  * The characters wrapped between two single quotes characters (') are escaped.
11212
11182
  * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
@@ -11285,32 +11255,34 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11285
11255
  * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
11286
11256
  * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
11287
11257
  * | | EEEEE | M, T, W, T, F, S, S | |
11288
- * | | EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | |
11258
+ * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
11289
11259
  * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
11290
11260
  * | | io | 1st, 2nd, ..., 7th | 7 |
11291
11261
  * | | ii | 01, 02, ..., 07 | 7 |
11292
11262
  * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
11293
11263
  * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
11294
11264
  * | | iiiii | M, T, W, T, F, S, S | 7 |
11295
- * | | iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | 7 |
11265
+ * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
11296
11266
  * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
11297
11267
  * | | eo | 2nd, 3rd, ..., 1st | 7 |
11298
11268
  * | | ee | 02, 03, ..., 01 | |
11299
11269
  * | | eee | Mon, Tue, Wed, ..., Sun | |
11300
11270
  * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
11301
11271
  * | | eeeee | M, T, W, T, F, S, S | |
11302
- * | | eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | |
11272
+ * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
11303
11273
  * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
11304
11274
  * | | co | 2nd, 3rd, ..., 1st | 7 |
11305
11275
  * | | cc | 02, 03, ..., 01 | |
11306
11276
  * | | ccc | Mon, Tue, Wed, ..., Sun | |
11307
11277
  * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
11308
11278
  * | | ccccc | M, T, W, T, F, S, S | |
11309
- * | | cccccc | Mo, Tu, We, Th, Fr, Su, Sa | |
11310
- * | AM, PM | a..aaa | AM, PM | |
11279
+ * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
11280
+ * | AM, PM | a..aa | AM, PM | |
11281
+ * | | aaa | am, pm | |
11311
11282
  * | | aaaa | a.m., p.m. | 2 |
11312
11283
  * | | aaaaa | a, p | |
11313
- * | AM, PM, noon, midnight | b..bbb | AM, PM, noon, midnight | |
11284
+ * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
11285
+ * | | bbb | am, pm, noon, midnight | |
11314
11286
  * | | bbbb | a.m., p.m., noon, midnight | 2 |
11315
11287
  * | | bbbbb | a, p, n, mi | |
11316
11288
  * | Flexible day period | B..BBB | at night, in the morning, ... | |
@@ -11336,7 +11308,7 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11336
11308
  * | | ss | 00, 01, ..., 59 | |
11337
11309
  * | Fraction of second | S | 0, 1, ..., 9 | |
11338
11310
  * | | SS | 00, 01, ..., 99 | |
11339
- * | | SSS | 000, 0001, ..., 999 | |
11311
+ * | | SSS | 000, 001, ..., 999 | |
11340
11312
  * | | SSSS | ... | 3 |
11341
11313
  * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
11342
11314
  * | | XX | -0800, +0530, Z | |
@@ -11356,18 +11328,18 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11356
11328
  * | | tt | ... | 3,7 |
11357
11329
  * | Milliseconds timestamp | T | 512969520900 | 7 |
11358
11330
  * | | TT | ... | 3,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 |
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 |
11363
11335
  * | Long localized time | p | 12:00 AM | 7 |
11364
11336
  * | | pp | 12:00:00 AM | 7 |
11365
11337
  * | | ppp | 12:00:00 AM GMT+2 | 7 |
11366
11338
  * | | pppp | 12:00:00 AM GMT+02:00 | 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 |
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 |
11371
11343
  * Notes:
11372
11344
  * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
11373
11345
  * are the same as "stand-alone" units, but are different in some languages.
@@ -11440,30 +11412,10 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11440
11412
  * - `p`: long localized time
11441
11413
  *
11442
11414
  * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
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))
11457
- *
11458
- * // v2.0.0 onward
11459
- * format(new Date(2016, 0, 1), "yyyy-MM-dd'T'HH:mm:ss.SSSxxx")
11460
- * ```
11415
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
11461
11416
  *
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.
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
11467
11419
  *
11468
11420
  * @param {Date|Number} date - the original date
11469
11421
  * @param {String} format - the string of tokens
@@ -11472,9 +11424,9 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11472
11424
  * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
11473
11425
  * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
11474
11426
  * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
11475
- * see: https://git.io/fxCyr
11427
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
11476
11428
  * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
11477
- * see: https://git.io/fxCyr
11429
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
11478
11430
  * @returns {String} the formatted date string
11479
11431
  * @throws {TypeError} 2 arguments required
11480
11432
  * @throws {RangeError} `date` must not be Invalid Date
@@ -11482,47 +11434,46 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11482
11434
  * @throws {RangeError} `options.locale` must contain `formatLong` property
11483
11435
  * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
11484
11436
  * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
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
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
11489
11441
  * @throws {RangeError} format string contains an unescaped latin alphabet character
11490
11442
  *
11491
11443
  * @example
11492
11444
  * // Represent 11 February 2014 in middle-endian format:
11493
- * var result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
11445
+ * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
11494
11446
  * //=> '02/11/2014'
11495
11447
  *
11496
11448
  * @example
11497
11449
  * // Represent 2 July 2014 in Esperanto:
11498
11450
  * import { eoLocale } from 'date-fns/locale/eo'
11499
- * var result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
11451
+ * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
11500
11452
  * locale: eoLocale
11501
11453
  * })
11502
11454
  * //=> '2-a de julio 2014'
11503
11455
  *
11504
11456
  * @example
11505
11457
  * // Escape string by single quote characters:
11506
- * var result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
11458
+ * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
11507
11459
  * //=> "3 o'clock"
11508
11460
  */
11509
11461
 
11510
- function format$1(dirtyDate, dirtyFormatStr, dirtyOptions) {
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;
11511
11464
  requiredArgs(2, arguments);
11512
11465
  var formatStr = String(dirtyFormatStr);
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
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);
11518
11469
 
11470
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
11519
11471
  if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
11520
11472
  throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
11521
11473
  }
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
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);
11525
11475
 
11476
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
11526
11477
  if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
11527
11478
  throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
11528
11479
  }
@@ -11535,10 +11486,11 @@ function format$1(dirtyDate, dirtyFormatStr, dirtyOptions) {
11535
11486
  var originalDate = toDate(dirtyDate);
11536
11487
  if (!isValid(originalDate)) {
11537
11488
  throw new RangeError('Invalid time value');
11538
- } // Convert the date in system timezone to the same date in UTC+00:00 timezone.
11489
+ }
11490
+
11491
+ // Convert the date in system timezone to the same date in UTC+00:00 timezone.
11539
11492
  // This ensures that when UTC functions will be implemented, locales will be compatible with them.
11540
11493
  // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
11541
-
11542
11494
  var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
11543
11495
  var utcDate = subMilliseconds(originalDate, timezoneOffset);
11544
11496
  var formatterOptions = {
@@ -11551,7 +11503,7 @@ function format$1(dirtyDate, dirtyFormatStr, dirtyOptions) {
11551
11503
  var firstCharacter = substring[0];
11552
11504
  if (firstCharacter === 'p' || firstCharacter === 'P') {
11553
11505
  var longFormatter = longFormatters$1[firstCharacter];
11554
- return longFormatter(substring, locale.formatLong, formatterOptions);
11506
+ return longFormatter(substring, locale.formatLong);
11555
11507
  }
11556
11508
  return substring;
11557
11509
  }).join('').match(formattingTokensRegExp).map(function (substring) {
@@ -11565,11 +11517,11 @@ function format$1(dirtyDate, dirtyFormatStr, dirtyOptions) {
11565
11517
  }
11566
11518
  var formatter = formatters$1[firstCharacter];
11567
11519
  if (formatter) {
11568
- if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {
11569
- throwProtectedError(substring, dirtyFormatStr, dirtyDate);
11520
+ if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) {
11521
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
11570
11522
  }
11571
- if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {
11572
- throwProtectedError(substring, dirtyFormatStr, dirtyDate);
11523
+ if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) {
11524
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
11573
11525
  }
11574
11526
  return formatter(utcDate, substring, locale.localize, formatterOptions);
11575
11527
  }
@@ -11581,23 +11533,28 @@ function format$1(dirtyDate, dirtyFormatStr, dirtyOptions) {
11581
11533
  return result;
11582
11534
  }
11583
11535
  function cleanEscapedString(input) {
11584
- return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
11536
+ var matched = input.match(escapedStringRegExp);
11537
+ if (!matched) {
11538
+ return input;
11539
+ }
11540
+ return matched[1].replace(doubleQuoteRegExp, "'");
11585
11541
  }
11586
11542
 
11587
- function convertToFP(fn, arity, a) {
11588
- a = a || [];
11543
+ function convertToFP(fn, arity) {
11544
+ var a = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
11589
11545
  if (a.length >= arity) {
11590
11546
  return fn.apply(null, a.slice(0, arity).reverse());
11591
11547
  }
11592
11548
  return function () {
11593
- var args = Array.prototype.slice.call(arguments);
11549
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
11550
+ args[_key] = arguments[_key];
11551
+ }
11594
11552
  return convertToFP(fn, arity, a.concat(args));
11595
11553
  };
11596
11554
  }
11597
11555
 
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;
11556
+ // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
11557
+ var formatTime = convertToFP(format, 2);
11601
11558
 
11602
11559
  var Wrapper = index$9(reactNative.View)(function () {
11603
11560
  return {
@@ -12363,7 +12320,7 @@ var StyledPageControlWrapper = index$9(reactNative.View)(function (_ref7) {
12363
12320
  });
12364
12321
 
12365
12322
  function isCarouselImageProps(image) {
12366
- return _typeof(image) === 'object';
12323
+ return _typeof$1(image) === 'object';
12367
12324
  }
12368
12325
  var CarouselItem = function CarouselItem(_ref) {
12369
12326
  var width = _ref.width,
@@ -18824,7 +18781,7 @@ var scheduler_production_min = {};
18824
18781
  var c = a.sortIndex - b.sortIndex;
18825
18782
  return 0 !== c ? c : a.id - b.id;
18826
18783
  }
18827
- if ("object" === (typeof performance === "undefined" ? "undefined" : _typeof(performance)) && "function" === typeof performance.now) {
18784
+ if ("object" === (typeof performance === "undefined" ? "undefined" : _typeof$1(performance)) && "function" === typeof performance.now) {
18828
18785
  var l = performance;
18829
18786
  exports.unstable_now = function () {
18830
18787
  return l.now();
@@ -18995,7 +18952,7 @@ var scheduler_production_min = {};
18995
18952
  };
18996
18953
  exports.unstable_scheduleCallback = function (a, b, c) {
18997
18954
  var d = exports.unstable_now();
18998
- "object" === _typeof(c) && null !== c ? (c = c.delay, c = "number" === typeof c && 0 < c ? d + c : d) : c = d;
18955
+ "object" === _typeof$1(c) && null !== c ? (c = c.delay, c = "number" === typeof c && 0 < c ? d + c : d) : c = d;
18999
18956
  switch (a) {
19000
18957
  case 1:
19001
18958
  var e = -1;
@@ -19073,7 +19030,7 @@ function oa(a) {
19073
19030
  }
19074
19031
  function pa(a, b, c, d) {
19075
19032
  if (null !== c && 0 === c.type) return !1;
19076
- switch (_typeof(b)) {
19033
+ switch (_typeof$1(b)) {
19077
19034
  case "function":
19078
19035
  case "symbol":
19079
19036
  return !0;
@@ -19183,7 +19140,7 @@ var ua = aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
19183
19140
  var Ia = Symbol["for"]("react.offscreen");
19184
19141
  var Ja = Symbol.iterator;
19185
19142
  function Ka(a) {
19186
- if (null === a || "object" !== _typeof(a)) return null;
19143
+ if (null === a || "object" !== _typeof$1(a)) return null;
19187
19144
  a = Ja && a[Ja] || a["@@iterator"];
19188
19145
  return "function" === typeof a ? a : null;
19189
19146
  }
@@ -19212,7 +19169,7 @@ function Oa(a, b) {
19212
19169
  set: function set() {
19213
19170
  throw Error();
19214
19171
  }
19215
- }), "object" === (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && Reflect.construct) {
19172
+ }), "object" === (typeof Reflect === "undefined" ? "undefined" : _typeof$1(Reflect)) && Reflect.construct) {
19216
19173
  try {
19217
19174
  Reflect.construct(b, []);
19218
19175
  } catch (l) {
@@ -19294,7 +19251,7 @@ function Qa(a) {
19294
19251
  case Fa:
19295
19252
  return "SuspenseList";
19296
19253
  }
19297
- if ("object" === _typeof(a)) switch (a.$$typeof) {
19254
+ if ("object" === _typeof$1(a)) switch (a.$$typeof) {
19298
19255
  case Ca:
19299
19256
  return (a.displayName || "Context") + ".Consumer";
19300
19257
  case Ba:
@@ -19366,7 +19323,7 @@ function Ra(a) {
19366
19323
  return null;
19367
19324
  }
19368
19325
  function Sa(a) {
19369
- switch (_typeof(a)) {
19326
+ switch (_typeof$1(a)) {
19370
19327
  case "boolean":
19371
19328
  case "number":
19372
19329
  case "string":
@@ -19677,9 +19634,9 @@ function ub(a, b) {
19677
19634
  if (tb[a] && (null != b.children || null != b.dangerouslySetInnerHTML)) throw Error(p(137, a));
19678
19635
  if (null != b.dangerouslySetInnerHTML) {
19679
19636
  if (null != b.children) throw Error(p(60));
19680
- if ("object" !== _typeof(b.dangerouslySetInnerHTML) || !("__html" in b.dangerouslySetInnerHTML)) throw Error(p(61));
19637
+ if ("object" !== _typeof$1(b.dangerouslySetInnerHTML) || !("__html" in b.dangerouslySetInnerHTML)) throw Error(p(61));
19681
19638
  }
19682
- if (null != b.style && "object" !== _typeof(b.style)) throw Error(p(62));
19639
+ if (null != b.style && "object" !== _typeof$1(b.style)) throw Error(p(62));
19683
19640
  }
19684
19641
  }
19685
19642
  function vb(a, b) {
@@ -19765,7 +19722,7 @@ function Kb(a, b) {
19765
19722
  a = !1;
19766
19723
  }
19767
19724
  if (a) return null;
19768
- if (c && "function" !== typeof c) throw Error(p(231, b, _typeof(c)));
19725
+ if (c && "function" !== typeof c) throw Error(p(231, b, _typeof$1(c)));
19769
19726
  return c;
19770
19727
  }
19771
19728
  var Lb = !1;
@@ -20679,7 +20636,7 @@ function ge(a, b) {
20679
20636
  }
20680
20637
  function he(a) {
20681
20638
  a = a.detail;
20682
- return "object" === _typeof(a) && "data" in a ? a.data : null;
20639
+ return "object" === _typeof$1(a) && "data" in a ? a.data : null;
20683
20640
  }
20684
20641
  var ie = !1;
20685
20642
  function je(a, b) {
@@ -20796,7 +20753,7 @@ function Ge(a, b) {
20796
20753
  var He = "function" === typeof Object.is ? Object.is : Ge;
20797
20754
  function Ie(a, b) {
20798
20755
  if (He(a, b)) return !0;
20799
- if ("object" !== _typeof(a) || null === a || "object" !== _typeof(b) || null === b) return !1;
20756
+ if ("object" !== _typeof$1(a) || null === a || "object" !== _typeof$1(b) || null === b) return !1;
20800
20757
  var c = Object.keys(a),
20801
20758
  d = Object.keys(b);
20802
20759
  if (c.length !== d.length) return !1;
@@ -21323,7 +21280,7 @@ function Bf() {}
21323
21280
  var Cf = null,
21324
21281
  Df = null;
21325
21282
  function Ef(a, b) {
21326
- return "textarea" === a || "noscript" === a || "string" === typeof b.children || "number" === typeof b.children || "object" === _typeof(b.dangerouslySetInnerHTML) && null !== b.dangerouslySetInnerHTML && null != b.dangerouslySetInnerHTML.__html;
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;
21327
21284
  }
21328
21285
  var Ff = "function" === typeof setTimeout ? setTimeout : void 0,
21329
21286
  Gf = "function" === typeof clearTimeout ? clearTimeout : void 0,
@@ -21971,7 +21928,7 @@ function ph(a, b, c) {
21971
21928
  var d = !1,
21972
21929
  e = Vf;
21973
21930
  var f = b.contextType;
21974
- "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);
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);
21975
21932
  b = new b(c, f);
21976
21933
  a.memoizedState = null !== b.state && void 0 !== b.state ? b.state : null;
21977
21934
  b.updater = nh;
@@ -21993,7 +21950,7 @@ function rh(a, b, c, d) {
21993
21950
  e.refs = jh;
21994
21951
  ah(a);
21995
21952
  var f = b.contextType;
21996
- "object" === _typeof(f) && null !== f ? e.context = Vg(f) : (f = Zf(b) ? Xf : H.current, e.context = Yf(a, f));
21953
+ "object" === _typeof$1(f) && null !== f ? e.context = Vg(f) : (f = Zf(b) ? Xf : H.current, e.context = Yf(a, f));
21997
21954
  e.state = a.memoizedState;
21998
21955
  f = b.getDerivedStateFromProps;
21999
21956
  "function" === typeof f && (kh(a, b, f, c), e.state = a.memoizedState);
@@ -22002,7 +21959,7 @@ function rh(a, b, c, d) {
22002
21959
  }
22003
21960
  function sh(a, b, c) {
22004
21961
  a = c.ref;
22005
- if (null !== a && "function" !== typeof a && "object" !== _typeof(a)) {
21962
+ if (null !== a && "function" !== typeof a && "object" !== _typeof$1(a)) {
22006
21963
  if (c._owner) {
22007
21964
  c = c._owner;
22008
21965
  if (c) {
@@ -22077,7 +22034,7 @@ function vh(a) {
22077
22034
  function k(a, b, c, d) {
22078
22035
  var f = c.type;
22079
22036
  if (f === ya) return m(a, b, c.props.children, d, c.key);
22080
- 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;
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;
22081
22038
  d = yh(c.type, c.key, c.props, null, a.mode, d);
22082
22039
  d.ref = sh(a, b, c);
22083
22040
  d["return"] = a;
@@ -22097,7 +22054,7 @@ function vh(a) {
22097
22054
  }
22098
22055
  function q(a, b, c) {
22099
22056
  if ("string" === typeof b && "" !== b || "number" === typeof b) return b = xh("" + b, a.mode, c), b["return"] = a, b;
22100
- if ("object" === _typeof(b) && null !== b) {
22057
+ if ("object" === _typeof$1(b) && null !== b) {
22101
22058
  switch (b.$$typeof) {
22102
22059
  case va:
22103
22060
  return c = yh(b.type, b.key, b.props, null, a.mode, c), c.ref = sh(a, null, b), c["return"] = a, c;
@@ -22115,7 +22072,7 @@ function vh(a) {
22115
22072
  function r(a, b, c, d) {
22116
22073
  var e = null !== b ? b.key : null;
22117
22074
  if ("string" === typeof c && "" !== c || "number" === typeof c) return null !== e ? null : h(a, b, "" + c, d);
22118
- if ("object" === _typeof(c) && null !== c) {
22075
+ if ("object" === _typeof$1(c) && null !== c) {
22119
22076
  switch (c.$$typeof) {
22120
22077
  case va:
22121
22078
  return c.key === e ? k(a, b, c, d) : null;
@@ -22131,7 +22088,7 @@ function vh(a) {
22131
22088
  }
22132
22089
  function y(a, b, c, d, e) {
22133
22090
  if ("string" === typeof d && "" !== d || "number" === typeof d) return a = a.get(c) || null, h(b, a, "" + d, e);
22134
- if ("object" === _typeof(d) && null !== d) {
22091
+ if ("object" === _typeof$1(d) && null !== d) {
22135
22092
  switch (d.$$typeof) {
22136
22093
  case va:
22137
22094
  return a = a.get(null === d.key ? c : d.key) || null, k(b, a, d, e);
@@ -22205,8 +22162,8 @@ function vh(a) {
22205
22162
  return l;
22206
22163
  }
22207
22164
  function J(a, d, f, h) {
22208
- "object" === _typeof(f) && null !== f && f.type === ya && null === f.key && (f = f.props.children);
22209
- if ("object" === _typeof(f) && null !== f) {
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
22167
  switch (f.$$typeof) {
22211
22168
  case va:
22212
22169
  a: {
@@ -22221,7 +22178,7 @@ function vh(a) {
22221
22178
  a = d;
22222
22179
  break a;
22223
22180
  }
22224
- } else if (l.elementType === k || "object" === _typeof(k) && null !== k && k.$$typeof === Ha && uh(k) === l.type) {
22181
+ } else if (l.elementType === k || "object" === _typeof$1(k) && null !== k && k.$$typeof === Ha && uh(k) === l.type) {
22225
22182
  c(a, l.sibling);
22226
22183
  d = e(l, f.props);
22227
22184
  d.ref = sh(a, l, f);
@@ -23106,7 +23063,7 @@ function ij(a, b, c, d, e) {
23106
23063
  g.props = h;
23107
23064
  var k = g.context,
23108
23065
  l = c.contextType;
23109
- "object" === _typeof(l) && null !== l ? l = Vg(l) : (l = Zf(c) ? Xf : H.current, l = Yf(b, l));
23066
+ "object" === _typeof$1(l) && null !== l ? l = Vg(l) : (l = Zf(c) ? Xf : H.current, l = Yf(b, l));
23110
23067
  var m = c.getDerivedStateFromProps,
23111
23068
  q = "function" === typeof m || "function" === typeof g.getSnapshotBeforeUpdate;
23112
23069
  q || "function" !== typeof g.UNSAFE_componentWillReceiveProps && "function" !== typeof g.componentWillReceiveProps || (h !== d || k !== l) && qh(b, g, d, l);
@@ -23125,7 +23082,7 @@ function ij(a, b, c, d, e) {
23125
23082
  q = b.pendingProps;
23126
23083
  r = g.context;
23127
23084
  k = c.contextType;
23128
- "object" === _typeof(k) && null !== k ? k = Vg(k) : (k = Zf(c) ? Xf : H.current, k = Yf(b, k));
23085
+ "object" === _typeof$1(k) && null !== k ? k = Vg(k) : (k = Zf(c) ? Xf : H.current, k = Yf(b, k));
23129
23086
  var y = c.getDerivedStateFromProps;
23130
23087
  (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);
23131
23088
  $g = !1;
@@ -25038,7 +24995,7 @@ function Nk(a, b) {
25038
24995
  k = b;
25039
24996
  b = Z;
25040
24997
  h.flags |= 32768;
25041
- if (null !== k && "object" === _typeof(k) && "function" === typeof k.then) {
24998
+ if (null !== k && "object" === _typeof$1(k) && "function" === typeof k.then) {
25042
24999
  var l = k,
25043
25000
  m = h,
25044
25001
  q = m.tag;
@@ -25459,7 +25416,7 @@ Wk = function Wk(a, b, c) {
25459
25416
  e = Xh(null, b, d, a, e, c);
25460
25417
  var f = bi();
25461
25418
  b.flags |= 1;
25462
- "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);
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);
25463
25420
  return b;
25464
25421
  case 16:
25465
25422
  d = b.elementType;
@@ -25700,7 +25657,7 @@ function yh(a, b, c, d, e, f) {
25700
25657
  case Ia:
25701
25658
  return qj(c, e, f, b);
25702
25659
  default:
25703
- if ("object" === _typeof(a) && null !== a) switch (a.$$typeof) {
25660
+ if ("object" === _typeof$1(a) && null !== a) switch (a.$$typeof) {
25704
25661
  case Ba:
25705
25662
  g = 10;
25706
25663
  break a;
@@ -25718,7 +25675,7 @@ function yh(a, b, c, d, e, f) {
25718
25675
  d = null;
25719
25676
  break a;
25720
25677
  }
25721
- throw Error(p(130, null == a ? a : _typeof(a), ""));
25678
+ throw Error(p(130, null == a ? a : _typeof$1(a), ""));
25722
25679
  }
25723
25680
  b = Bg(g, c, b, e);
25724
25681
  b.elementType = a;
@@ -26212,7 +26169,7 @@ function checkDCE() {
26212
26169
  });
26213
26170
  }, r.t = function (e, t) {
26214
26171
  if (1 & t && (e = r(e)), 8 & t) return e;
26215
- if (4 & t && "object" == _typeof(e) && e && e.__esModule) return e;
26172
+ if (4 & t && "object" == _typeof$1(e) && e && e.__esModule) return e;
26216
26173
  var n = Object.create(null);
26217
26174
  if (r.r(n), Object.defineProperty(n, "default", {
26218
26175
  enumerable: !0,
@@ -26434,7 +26391,7 @@ function checkDCE() {
26434
26391
  }, t.parseHotkey = c, t.compareHotkey = l, t.toKeyCode = d, t.toKeyName = f;
26435
26392
  }, function (e, t) {
26436
26393
  e.exports = function (e) {
26437
- var t = _typeof(e);
26394
+ var t = _typeof$1(e);
26438
26395
  return null != e && ("object" == t || "function" == t);
26439
26396
  };
26440
26397
  }, function (e, t, r) {
@@ -26462,7 +26419,7 @@ function checkDCE() {
26462
26419
  };
26463
26420
  }, function (e, t, r) {
26464
26421
  var n = r(11),
26465
- u = "object" == (typeof self === "undefined" ? "undefined" : _typeof(self)) && self && self.Object === Object && self,
26422
+ u = "object" == (typeof self === "undefined" ? "undefined" : _typeof$1(self)) && self && self.Object === Object && self,
26466
26423
  o = n || u || Function("return this")();
26467
26424
  e.exports = o;
26468
26425
  }, function (e, t, r) {
@@ -26477,7 +26434,7 @@ function checkDCE() {
26477
26434
  };
26478
26435
  }, function (e, t, r) {
26479
26436
  (function (t) {
26480
- var r = "object" == _typeof(t) && t && t.Object === Object && t;
26437
+ var r = "object" == _typeof$1(t) && t && t.Object === Object && t;
26481
26438
  e.exports = r;
26482
26439
  }).call(this, r(12));
26483
26440
  }, function (e, t) {
@@ -26488,7 +26445,7 @@ function checkDCE() {
26488
26445
  try {
26489
26446
  r = r || new Function("return this")();
26490
26447
  } catch (e) {
26491
- "object" == (typeof window === "undefined" ? "undefined" : _typeof(window)) && (r = window);
26448
+ "object" == (typeof window === "undefined" ? "undefined" : _typeof$1(window)) && (r = window);
26492
26449
  }
26493
26450
  e.exports = r;
26494
26451
  }, function (e, t, r) {
@@ -26515,7 +26472,7 @@ function checkDCE() {
26515
26472
  var n = r(15),
26516
26473
  u = r(18);
26517
26474
  e.exports = function (e) {
26518
- return "symbol" == _typeof(e) || u(e) && "[object Symbol]" == n(e);
26475
+ return "symbol" == _typeof$1(e) || u(e) && "[object Symbol]" == n(e);
26519
26476
  };
26520
26477
  }, function (e, t, r) {
26521
26478
  var n = r(8),
@@ -26548,7 +26505,7 @@ function checkDCE() {
26548
26505
  };
26549
26506
  }, function (e, t) {
26550
26507
  e.exports = function (e) {
26551
- return null != e && "object" == _typeof(e);
26508
+ return null != e && "object" == _typeof$1(e);
26552
26509
  };
26553
26510
  }, function (e, t, r) {
26554
26511
 
@@ -26629,7 +26586,7 @@ function checkDCE() {
26629
26586
  }
26630
26587
  function c(e) {
26631
26588
  return !!e && (function (e) {
26632
- if (!e || "object" != _typeof(e)) return !1;
26589
+ if (!e || "object" != _typeof$1(e)) return !1;
26633
26590
  var t = Object.getPrototypeOf(e);
26634
26591
  if (null === t) return !0;
26635
26592
  var r = Object.hasOwnProperty.call(t, "constructor") && t.constructor;
@@ -26638,7 +26595,7 @@ function checkDCE() {
26638
26595
  }
26639
26596
  function l(e, t, r) {
26640
26597
  void 0 === r && (r = !1), 0 === d(e) ? (r ? Object.keys : Z)(e).forEach(function (n) {
26641
- r && "symbol" == _typeof(n) || t(n, e[n], e);
26598
+ r && "symbol" == _typeof$1(n) || t(n, e[n], e);
26642
26599
  }) : e.forEach(function (r, n) {
26643
26600
  return t(n, r, e);
26644
26601
  });
@@ -26694,7 +26651,7 @@ function checkDCE() {
26694
26651
  i(2);
26695
26652
  }
26696
26653
  function b(e) {
26697
- return null == e || "object" != _typeof(e) || Object.isFrozen(e);
26654
+ return null == e || "object" != _typeof$1(e) || Object.isFrozen(e);
26698
26655
  }
26699
26656
  function y(e) {
26700
26657
  var t = Q[e];
@@ -26831,7 +26788,7 @@ function checkDCE() {
26831
26788
  }
26832
26789
  var W,
26833
26790
  V,
26834
- q = "undefined" != typeof Symbol && "symbol" == _typeof(Symbol("x")),
26791
+ q = "undefined" != typeof Symbol && "symbol" == _typeof$1(Symbol("x")),
26835
26792
  H = "undefined" != typeof Map,
26836
26793
  U = "undefined" != typeof Set,
26837
26794
  K = "undefined" != typeof Proxy && void 0 !== Proxy.revocable && "undefined" != typeof Reflect,
@@ -26946,7 +26903,7 @@ function checkDCE() {
26946
26903
  throw w(s), e;
26947
26904
  }) : (F(s, n), k(a, s));
26948
26905
  }
26949
- if (!e || "object" != _typeof(e)) {
26906
+ if (!e || "object" != _typeof$1(e)) {
26950
26907
  if ((a = r(e)) === $) return;
26951
26908
  return void 0 === a && (a = e), t.F && m(a, !0), a;
26952
26909
  }
@@ -31181,7 +31138,7 @@ function checkDCE() {
31181
31138
  Ut = r(6),
31182
31139
  Kt = r.n(Ut);
31183
31140
  function $t(e) {
31184
- return null != e && "object" == _typeof(e) && 1 === e.nodeType;
31141
+ return null != e && "object" == _typeof$1(e) && 1 === e.nodeType;
31185
31142
  }
31186
31143
  function Jt(e, t) {
31187
31144
  return (!t || "hidden" !== e) && "visible" !== e && "clip" !== e;