@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/es/index.js CHANGED
@@ -362,14 +362,14 @@ function _regeneratorRuntime() {
362
362
  }
363
363
  }, e;
364
364
  }
365
- function _typeof(o) {
365
+ function _typeof$1(o) {
366
366
  "@babel/helpers - typeof";
367
367
 
368
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
368
+ return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
369
369
  return typeof o;
370
370
  } : function (o) {
371
371
  return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
372
- }, _typeof(o);
372
+ }, _typeof$1(o);
373
373
  }
374
374
  function _classCallCheck(instance, Constructor) {
375
375
  if (!(instance instanceof Constructor)) {
@@ -1293,7 +1293,9 @@ var BASE_COLORS = {
1293
1293
  theatreGold: '#a56822',
1294
1294
  uniformGreen: '#4d4628',
1295
1295
  yellow: '#fadb14',
1296
- windsorGrey: '#606065'
1296
+ windsorGrey: '#606065',
1297
+ mist: '#e8e9f8',
1298
+ cloud: '#ccd9f5'
1297
1299
  };
1298
1300
  var colorScales = Object.entries(BASE_COLORS).reduce(function (acc, _ref16) {
1299
1301
  var _ref17 = _slicedToArray(_ref16, 2),
@@ -1302,15 +1304,17 @@ var colorScales = Object.entries(BASE_COLORS).reduce(function (acc, _ref16) {
1302
1304
  return Object.assign(Object.assign({}, acc), _defineProperty({}, key, createColorScales(value)));
1303
1305
  }, {});
1304
1306
  var blue$1 = colorScales.blue,
1305
- ultramarineBlue$2 = colorScales.ultramarineBlue,
1307
+ cloud = colorScales.cloud,
1308
+ deepSaffron$2 = colorScales.deepSaffron,
1306
1309
  green$1 = colorScales.green,
1307
1310
  grey$2 = colorScales.grey,
1308
1311
  grotesqueGreen = colorScales.grotesqueGreen,
1309
- deepSaffron$2 = colorScales.deepSaffron,
1312
+ mist = colorScales.mist,
1310
1313
  pink$1 = colorScales.pink,
1311
1314
  purple$1 = colorScales.purple,
1312
- vermilion$2 = colorScales.vermilion,
1313
1315
  smalt = colorScales.smalt,
1316
+ ultramarineBlue$2 = colorScales.ultramarineBlue,
1317
+ vermilion$2 = colorScales.vermilion,
1314
1318
  violet$1 = colorScales.violet,
1315
1319
  yellow$1 = colorScales.yellow;
1316
1320
  var palette$b = {
@@ -1329,9 +1333,11 @@ var palette$b = {
1329
1333
  blueLight60: blue$1.lighten60,
1330
1334
  blueLight75: blue$1.lighten75,
1331
1335
  blueLight90: blue$1.lighten90,
1336
+ cloudLight90: cloud.lighten90,
1332
1337
  dodgerBlue: ultramarineBlue$2.base,
1333
1338
  dodgerBlueDark15: ultramarineBlue$2.darken15,
1334
1339
  dodgerBlueDark30: ultramarineBlue$2.darken30,
1340
+ dodgerBlueDark60: ultramarineBlue$2.darken60,
1335
1341
  dodgerBlueLight30: ultramarineBlue$2.lighten30,
1336
1342
  dodgerBlueLight45: ultramarineBlue$2.lighten45,
1337
1343
  dodgerBlueLight60: ultramarineBlue$2.lighten60,
@@ -1340,6 +1346,7 @@ var palette$b = {
1340
1346
  green: green$1.base,
1341
1347
  greenDark15: green$1.darken15,
1342
1348
  greenDark30: green$1.darken30,
1349
+ greenDark60: green$1.darken60,
1343
1350
  greenDark75: green$1.darken75,
1344
1351
  greenLight30: green$1.lighten30,
1345
1352
  greenLight75: green$1.lighten75,
@@ -1350,6 +1357,7 @@ var palette$b = {
1350
1357
  greyDark45: grey$2.darken45,
1351
1358
  greyDark60: grey$2.darken60,
1352
1359
  greyDark75: grey$2.darken75,
1360
+ greyLight30: grey$2.lighten30,
1353
1361
  greyLight45: grey$2.lighten45,
1354
1362
  greyLight60: grey$2.lighten60,
1355
1363
  greyLight75: grey$2.lighten75,
@@ -1363,20 +1371,27 @@ var palette$b = {
1363
1371
  grotesqueGreenLight60: grotesqueGreen.lighten60,
1364
1372
  grotesqueGreenLight75: grotesqueGreen.lighten75,
1365
1373
  grotesqueGreenLight90: grotesqueGreen.lighten90,
1374
+ mistLight30: mist.lighten30,
1375
+ mistLight60: mist.lighten60,
1376
+ mistLight90: mist.lighten90,
1366
1377
  orange: deepSaffron$2.base,
1367
1378
  orangeDark15: deepSaffron$2.darken15,
1368
1379
  orangeDark30: deepSaffron$2.darken30,
1380
+ orangeDark60: deepSaffron$2.darken60,
1369
1381
  orangeDark75: deepSaffron$2.darken75,
1370
1382
  orangeLight30: deepSaffron$2.lighten30,
1383
+ orangeLight60: deepSaffron$2.lighten60,
1371
1384
  orangeLight75: deepSaffron$2.lighten75,
1372
1385
  orangeLight90: deepSaffron$2.lighten90,
1373
1386
  pink: pink$1.base,
1374
1387
  pinkDark15: pink$1.darken15,
1375
1388
  pinkDark30: pink$1.darken30,
1376
1389
  pinkDark45: pink$1.darken45,
1390
+ pinkDark60: pink$1.darken60,
1377
1391
  pinkDark75: pink$1.darken75,
1378
1392
  pinkLight30: pink$1.lighten30,
1379
1393
  pinkLight45: pink$1.lighten45,
1394
+ pinkLight60: pink$1.lighten60,
1380
1395
  pinkLight75: pink$1.lighten75,
1381
1396
  pinkLight90: pink$1.lighten90,
1382
1397
  purple: purple$1.base,
@@ -1419,6 +1434,7 @@ var palette$b = {
1419
1434
  yellow: yellow$1.base,
1420
1435
  yellowDark15: yellow$1.darken15,
1421
1436
  yellowDark30: yellow$1.darken30,
1437
+ yellowDark45: yellow$1.darken45,
1422
1438
  yellowDark75: yellow$1.darken75,
1423
1439
  yellowLight30: yellow$1.lighten30,
1424
1440
  yellowLight45: yellow$1.lighten45,
@@ -5336,8 +5352,8 @@ var camelize = function camelize(obj) {
5336
5352
  return walk(obj);
5337
5353
  };
5338
5354
  function walk(obj) {
5339
- if (!obj || _typeof(obj) !== 'object') return obj;
5340
- if (isDate(obj) || isRegex(obj)) return obj;
5355
+ if (!obj || _typeof$1(obj) !== 'object') return obj;
5356
+ if (isDate$1(obj) || isRegex(obj)) return obj;
5341
5357
  if (isArray(obj)) return map(obj, walk);
5342
5358
  return reduce(objectKeys(obj), function (acc, key) {
5343
5359
  var camel = camelCase(key);
@@ -5353,7 +5369,7 @@ function camelCase(str) {
5353
5369
  var isArray = Array.isArray || function (obj) {
5354
5370
  return Object.prototype.toString.call(obj) === '[object Array]';
5355
5371
  };
5356
- var isDate = function isDate(obj) {
5372
+ var isDate$1 = function isDate(obj) {
5357
5373
  return Object.prototype.toString.call(obj) === '[object Date]';
5358
5374
  };
5359
5375
  var isRegex = function isRegex(obj) {
@@ -5686,7 +5702,7 @@ var cssColorKeywords = require$$0;
5686
5702
  value: true
5687
5703
  });
5688
5704
  function _interopDefault(ex) {
5689
- return ex && _typeof(ex) === 'object' && 'default' in ex ? ex['default'] : ex;
5705
+ return ex && _typeof$1(ex) === 'object' && 'default' in ex ? ex['default'] : ex;
5690
5706
  }
5691
5707
  var parse = lib$1;
5692
5708
  var parse__default = _interopDefault(parse);
@@ -6406,7 +6422,7 @@ var generated = {};
6406
6422
  var buffer = '';
6407
6423
  var lastType;
6408
6424
  function handleInterpolation(interpolation, i, arr) {
6409
- var type = _typeof(interpolation);
6425
+ var type = _typeof$1(interpolation);
6410
6426
  if (type === 'string') {
6411
6427
  // strip comments
6412
6428
  interpolation = interpolation.replace(/\/\*[\s\S]*?\*\/|\/\/.*$/gm, '');
@@ -9298,12 +9314,59 @@ var BottomSheet$1 = Object.assign(BottomSheet, {
9298
9314
  ScrollView: BottomSheetScrollView
9299
9315
  });
9300
9316
 
9317
+ function _typeof(o) {
9318
+ "@babel/helpers - typeof";
9319
+
9320
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
9321
+ return typeof o;
9322
+ } : function (o) {
9323
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
9324
+ }, _typeof(o);
9325
+ }
9326
+
9301
9327
  function requiredArgs(required, args) {
9302
9328
  if (args.length < required) {
9303
9329
  throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
9304
9330
  }
9305
9331
  }
9306
9332
 
9333
+ /**
9334
+ * @name isDate
9335
+ * @category Common Helpers
9336
+ * @summary Is the given value a date?
9337
+ *
9338
+ * @description
9339
+ * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
9340
+ *
9341
+ * @param {*} value - the value to check
9342
+ * @returns {boolean} true if the given value is a date
9343
+ * @throws {TypeError} 1 arguments required
9344
+ *
9345
+ * @example
9346
+ * // For a valid date:
9347
+ * const result = isDate(new Date())
9348
+ * //=> true
9349
+ *
9350
+ * @example
9351
+ * // For an invalid date:
9352
+ * const result = isDate(new Date(NaN))
9353
+ * //=> true
9354
+ *
9355
+ * @example
9356
+ * // For some value:
9357
+ * const result = isDate('2014-02-31')
9358
+ * //=> false
9359
+ *
9360
+ * @example
9361
+ * // For an object:
9362
+ * const result = isDate({})
9363
+ * //=> false
9364
+ */
9365
+ function isDate(value) {
9366
+ requiredArgs(1, arguments);
9367
+ return value instanceof Date || _typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]';
9368
+ }
9369
+
9307
9370
  /**
9308
9371
  * @name toDate
9309
9372
  * @category Common Helpers
@@ -9334,11 +9397,11 @@ function requiredArgs(required, args) {
9334
9397
  * const result = toDate(1392098430000)
9335
9398
  * //=> Tue Feb 11 2014 11:30:30
9336
9399
  */
9337
-
9338
9400
  function toDate(argument) {
9339
9401
  requiredArgs(1, arguments);
9340
- var argStr = Object.prototype.toString.call(argument); // Clone the date
9402
+ var argStr = Object.prototype.toString.call(argument);
9341
9403
 
9404
+ // Clone the date
9342
9405
  if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
9343
9406
  // Prevent the date to lose the milliseconds when passed to new Date() in IE10
9344
9407
  return new Date(argument.getTime());
@@ -9347,8 +9410,8 @@ function toDate(argument) {
9347
9410
  } else {
9348
9411
  if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
9349
9412
  // eslint-disable-next-line no-console
9350
- 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
9351
-
9413
+ 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");
9414
+ // eslint-disable-next-line no-console
9352
9415
  console.warn(new Error().stack);
9353
9416
  }
9354
9417
  return new Date(NaN);
@@ -9367,616 +9430,235 @@ function toDate(argument) {
9367
9430
  *
9368
9431
  * Time value of Date: http://es5.github.io/#x15.9.1.1
9369
9432
  *
9370
- * ### v2.0.0 breaking changes:
9371
- *
9372
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
9373
- *
9374
- * - Now `isValid` doesn't throw an exception
9375
- * if the first argument is not an instance of Date.
9376
- * Instead, argument is converted beforehand using `toDate`.
9377
- *
9378
- * Examples:
9379
- *
9380
- * | `isValid` argument | Before v2.0.0 | v2.0.0 onward |
9381
- * |---------------------------|---------------|---------------|
9382
- * | `new Date()` | `true` | `true` |
9383
- * | `new Date('2016-01-01')` | `true` | `true` |
9384
- * | `new Date('')` | `false` | `false` |
9385
- * | `new Date(1488370835081)` | `true` | `true` |
9386
- * | `new Date(NaN)` | `false` | `false` |
9387
- * | `'2016-01-01'` | `TypeError` | `false` |
9388
- * | `''` | `TypeError` | `false` |
9389
- * | `1488370835081` | `TypeError` | `true` |
9390
- * | `NaN` | `TypeError` | `false` |
9391
- *
9392
- * We introduce this change to make *date-fns* consistent with ECMAScript behavior
9393
- * that try to coerce arguments to the expected type
9394
- * (which is also the case with other *date-fns* functions).
9395
- *
9396
9433
  * @param {*} date - the date to check
9397
9434
  * @returns {Boolean} the date is valid
9398
9435
  * @throws {TypeError} 1 argument required
9399
9436
  *
9400
9437
  * @example
9401
9438
  * // For the valid date:
9402
- * var result = isValid(new Date(2014, 1, 31))
9439
+ * const result = isValid(new Date(2014, 1, 31))
9403
9440
  * //=> true
9404
9441
  *
9405
9442
  * @example
9406
9443
  * // For the value, convertable into a date:
9407
- * var result = isValid(1393804800000)
9444
+ * const result = isValid(1393804800000)
9408
9445
  * //=> true
9409
9446
  *
9410
9447
  * @example
9411
9448
  * // For the invalid date:
9412
- * var result = isValid(new Date(''))
9449
+ * const result = isValid(new Date(''))
9413
9450
  * //=> false
9414
9451
  */
9415
-
9416
9452
  function isValid(dirtyDate) {
9417
9453
  requiredArgs(1, arguments);
9454
+ if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
9455
+ return false;
9456
+ }
9418
9457
  var date = toDate(dirtyDate);
9419
- return !isNaN(date);
9458
+ return !isNaN(Number(date));
9420
9459
  }
9421
9460
 
9422
- var formatDistanceLocale = {
9423
- lessThanXSeconds: {
9424
- one: 'less than a second',
9425
- other: 'less than {{count}} seconds'
9426
- },
9427
- xSeconds: {
9428
- one: '1 second',
9429
- other: '{{count}} seconds'
9430
- },
9431
- halfAMinute: 'half a minute',
9432
- lessThanXMinutes: {
9433
- one: 'less than a minute',
9434
- other: 'less than {{count}} minutes'
9435
- },
9436
- xMinutes: {
9437
- one: '1 minute',
9438
- other: '{{count}} minutes'
9439
- },
9440
- aboutXHours: {
9441
- one: 'about 1 hour',
9442
- other: 'about {{count}} hours'
9443
- },
9444
- xHours: {
9445
- one: '1 hour',
9446
- other: '{{count}} hours'
9447
- },
9448
- xDays: {
9449
- one: '1 day',
9450
- other: '{{count}} days'
9451
- },
9452
- aboutXWeeks: {
9453
- one: 'about 1 week',
9454
- other: 'about {{count}} weeks'
9455
- },
9456
- xWeeks: {
9457
- one: '1 week',
9458
- other: '{{count}} weeks'
9459
- },
9460
- aboutXMonths: {
9461
- one: 'about 1 month',
9462
- other: 'about {{count}} months'
9463
- },
9464
- xMonths: {
9465
- one: '1 month',
9466
- other: '{{count}} months'
9467
- },
9468
- aboutXYears: {
9469
- one: 'about 1 year',
9470
- other: 'about {{count}} years'
9471
- },
9472
- xYears: {
9473
- one: '1 year',
9474
- other: '{{count}} years'
9475
- },
9476
- overXYears: {
9477
- one: 'over 1 year',
9478
- other: 'over {{count}} years'
9479
- },
9480
- almostXYears: {
9481
- one: 'almost 1 year',
9482
- other: 'almost {{count}} years'
9483
- }
9484
- };
9485
- function formatDistance(token, count, options) {
9486
- options = options || {};
9487
- var result;
9488
- if (typeof formatDistanceLocale[token] === 'string') {
9489
- result = formatDistanceLocale[token];
9490
- } else if (count === 1) {
9491
- result = formatDistanceLocale[token].one;
9492
- } else {
9493
- result = formatDistanceLocale[token].other.replace('{{count}}', count);
9461
+ function toInteger(dirtyNumber) {
9462
+ if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
9463
+ return NaN;
9494
9464
  }
9495
- if (options.addSuffix) {
9496
- if (options.comparison > 0) {
9497
- return 'in ' + result;
9498
- } else {
9499
- return result + ' ago';
9500
- }
9465
+ var number = Number(dirtyNumber);
9466
+ if (isNaN(number)) {
9467
+ return number;
9501
9468
  }
9502
- return result;
9469
+ return number < 0 ? Math.ceil(number) : Math.floor(number);
9503
9470
  }
9504
9471
 
9505
- function buildFormatLongFn(args) {
9506
- return function (dirtyOptions) {
9507
- var options = dirtyOptions || {};
9508
- var width = options.width ? String(options.width) : args.defaultWidth;
9509
- var format = args.formats[width] || args.formats[args.defaultWidth];
9510
- return format;
9511
- };
9472
+ /**
9473
+ * @name addMilliseconds
9474
+ * @category Millisecond Helpers
9475
+ * @summary Add the specified number of milliseconds to the given date.
9476
+ *
9477
+ * @description
9478
+ * Add the specified number of milliseconds to the given date.
9479
+ *
9480
+ * @param {Date|Number} date - the date to be changed
9481
+ * @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`.
9482
+ * @returns {Date} the new date with the milliseconds added
9483
+ * @throws {TypeError} 2 arguments required
9484
+ *
9485
+ * @example
9486
+ * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
9487
+ * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
9488
+ * //=> Thu Jul 10 2014 12:45:30.750
9489
+ */
9490
+ function addMilliseconds(dirtyDate, dirtyAmount) {
9491
+ requiredArgs(2, arguments);
9492
+ var timestamp = toDate(dirtyDate).getTime();
9493
+ var amount = toInteger(dirtyAmount);
9494
+ return new Date(timestamp + amount);
9512
9495
  }
9513
9496
 
9514
- var dateFormats = {
9515
- full: 'EEEE, MMMM do, y',
9516
- "long": 'MMMM do, y',
9517
- medium: 'MMM d, y',
9518
- "short": 'MM/dd/yyyy'
9519
- };
9520
- var timeFormats = {
9521
- full: 'h:mm:ss a zzzz',
9522
- "long": 'h:mm:ss a z',
9523
- medium: 'h:mm:ss a',
9524
- "short": 'h:mm a'
9525
- };
9526
- var dateTimeFormats = {
9527
- full: "{{date}} 'at' {{time}}",
9528
- "long": "{{date}} 'at' {{time}}",
9529
- medium: '{{date}}, {{time}}',
9530
- "short": '{{date}}, {{time}}'
9531
- };
9532
- var formatLong = {
9533
- date: buildFormatLongFn({
9534
- formats: dateFormats,
9535
- defaultWidth: 'full'
9536
- }),
9537
- time: buildFormatLongFn({
9538
- formats: timeFormats,
9539
- defaultWidth: 'full'
9540
- }),
9541
- dateTime: buildFormatLongFn({
9542
- formats: dateTimeFormats,
9543
- defaultWidth: 'full'
9544
- })
9545
- };
9546
- var formatLong$1 = formatLong;
9497
+ /**
9498
+ * @name subMilliseconds
9499
+ * @category Millisecond Helpers
9500
+ * @summary Subtract the specified number of milliseconds from the given date.
9501
+ *
9502
+ * @description
9503
+ * Subtract the specified number of milliseconds from the given date.
9504
+ *
9505
+ * @param {Date|Number} date - the date to be changed
9506
+ * @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`.
9507
+ * @returns {Date} the new date with the milliseconds subtracted
9508
+ * @throws {TypeError} 2 arguments required
9509
+ *
9510
+ * @example
9511
+ * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
9512
+ * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
9513
+ * //=> Thu Jul 10 2014 12:45:29.250
9514
+ */
9515
+ function subMilliseconds(dirtyDate, dirtyAmount) {
9516
+ requiredArgs(2, arguments);
9517
+ var amount = toInteger(dirtyAmount);
9518
+ return addMilliseconds(dirtyDate, -amount);
9519
+ }
9547
9520
 
9548
- var formatRelativeLocale = {
9549
- lastWeek: "'last' eeee 'at' p",
9550
- yesterday: "'yesterday at' p",
9551
- today: "'today at' p",
9552
- tomorrow: "'tomorrow at' p",
9553
- nextWeek: "eeee 'at' p",
9554
- other: 'P'
9555
- };
9556
- function formatRelative(token, _date, _baseDate, _options) {
9557
- return formatRelativeLocale[token];
9521
+ var MILLISECONDS_IN_DAY = 86400000;
9522
+ function getUTCDayOfYear(dirtyDate) {
9523
+ requiredArgs(1, arguments);
9524
+ var date = toDate(dirtyDate);
9525
+ var timestamp = date.getTime();
9526
+ date.setUTCMonth(0, 1);
9527
+ date.setUTCHours(0, 0, 0, 0);
9528
+ var startOfYearTimestamp = date.getTime();
9529
+ var difference = timestamp - startOfYearTimestamp;
9530
+ return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
9558
9531
  }
9559
9532
 
9560
- function buildLocalizeFn(args) {
9561
- return function (dirtyIndex, dirtyOptions) {
9562
- var options = dirtyOptions || {};
9563
- var context = options.context ? String(options.context) : 'standalone';
9564
- var valuesArray;
9565
- if (context === 'formatting' && args.formattingValues) {
9566
- var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
9567
- var width = options.width ? String(options.width) : defaultWidth;
9568
- valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
9569
- } else {
9570
- var _defaultWidth = args.defaultWidth;
9571
- var _width = options.width ? String(options.width) : args.defaultWidth;
9572
- valuesArray = args.values[_width] || args.values[_defaultWidth];
9573
- }
9574
- var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
9575
- return valuesArray[index];
9576
- };
9533
+ function startOfUTCISOWeek(dirtyDate) {
9534
+ requiredArgs(1, arguments);
9535
+ var weekStartsOn = 1;
9536
+ var date = toDate(dirtyDate);
9537
+ var day = date.getUTCDay();
9538
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
9539
+ date.setUTCDate(date.getUTCDate() - diff);
9540
+ date.setUTCHours(0, 0, 0, 0);
9541
+ return date;
9577
9542
  }
9578
9543
 
9579
- var eraValues = {
9580
- narrow: ['B', 'A'],
9581
- abbreviated: ['BC', 'AD'],
9582
- wide: ['Before Christ', 'Anno Domini']
9583
- };
9584
- var quarterValues = {
9585
- narrow: ['1', '2', '3', '4'],
9586
- abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
9587
- wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter'] // Note: in English, the names of days of the week and months are capitalized.
9588
- // If you are making a new locale based on this one, check if the same is true for the language you're working on.
9589
- // Generally, formatted dates should look like they are in the middle of a sentence,
9590
- // e.g. in Spanish language the weekdays and months should be in the lowercase.
9591
- };
9592
-
9593
- var monthValues = {
9594
- narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
9595
- abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
9596
- wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
9597
- };
9598
- var dayValues = {
9599
- narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
9600
- "short": ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
9601
- abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
9602
- wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
9603
- };
9604
- var dayPeriodValues = {
9605
- narrow: {
9606
- am: 'a',
9607
- pm: 'p',
9608
- midnight: 'mi',
9609
- noon: 'n',
9610
- morning: 'morning',
9611
- afternoon: 'afternoon',
9612
- evening: 'evening',
9613
- night: 'night'
9614
- },
9615
- abbreviated: {
9616
- am: 'AM',
9617
- pm: 'PM',
9618
- midnight: 'midnight',
9619
- noon: 'noon',
9620
- morning: 'morning',
9621
- afternoon: 'afternoon',
9622
- evening: 'evening',
9623
- night: 'night'
9624
- },
9625
- wide: {
9626
- am: 'a.m.',
9627
- pm: 'p.m.',
9628
- midnight: 'midnight',
9629
- noon: 'noon',
9630
- morning: 'morning',
9631
- afternoon: 'afternoon',
9632
- evening: 'evening',
9633
- night: 'night'
9634
- }
9635
- };
9636
- var formattingDayPeriodValues = {
9637
- narrow: {
9638
- am: 'a',
9639
- pm: 'p',
9640
- midnight: 'mi',
9641
- noon: 'n',
9642
- morning: 'in the morning',
9643
- afternoon: 'in the afternoon',
9644
- evening: 'in the evening',
9645
- night: 'at night'
9646
- },
9647
- abbreviated: {
9648
- am: 'AM',
9649
- pm: 'PM',
9650
- midnight: 'midnight',
9651
- noon: 'noon',
9652
- morning: 'in the morning',
9653
- afternoon: 'in the afternoon',
9654
- evening: 'in the evening',
9655
- night: 'at night'
9656
- },
9657
- wide: {
9658
- am: 'a.m.',
9659
- pm: 'p.m.',
9660
- midnight: 'midnight',
9661
- noon: 'noon',
9662
- morning: 'in the morning',
9663
- afternoon: 'in the afternoon',
9664
- evening: 'in the evening',
9665
- night: 'at night'
9544
+ function getUTCISOWeekYear(dirtyDate) {
9545
+ requiredArgs(1, arguments);
9546
+ var date = toDate(dirtyDate);
9547
+ var year = date.getUTCFullYear();
9548
+ var fourthOfJanuaryOfNextYear = new Date(0);
9549
+ fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
9550
+ fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
9551
+ var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
9552
+ var fourthOfJanuaryOfThisYear = new Date(0);
9553
+ fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
9554
+ fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
9555
+ var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
9556
+ if (date.getTime() >= startOfNextYear.getTime()) {
9557
+ return year + 1;
9558
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
9559
+ return year;
9560
+ } else {
9561
+ return year - 1;
9666
9562
  }
9667
- };
9668
- function ordinalNumber(dirtyNumber, _dirtyOptions) {
9669
- var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,
9670
- // if they are different for different grammatical genders,
9671
- // use `options.unit`:
9672
- //
9673
- // var options = dirtyOptions || {}
9674
- // var unit = String(options.unit)
9675
- //
9676
- // where `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
9677
- // 'day', 'hour', 'minute', 'second'
9563
+ }
9678
9564
 
9679
- var rem100 = number % 100;
9680
- if (rem100 > 20 || rem100 < 10) {
9681
- switch (rem100 % 10) {
9682
- case 1:
9683
- return number + 'st';
9684
- case 2:
9685
- return number + 'nd';
9686
- case 3:
9687
- return number + 'rd';
9688
- }
9689
- }
9690
- return number + 'th';
9565
+ function startOfUTCISOWeekYear(dirtyDate) {
9566
+ requiredArgs(1, arguments);
9567
+ var year = getUTCISOWeekYear(dirtyDate);
9568
+ var fourthOfJanuary = new Date(0);
9569
+ fourthOfJanuary.setUTCFullYear(year, 0, 4);
9570
+ fourthOfJanuary.setUTCHours(0, 0, 0, 0);
9571
+ var date = startOfUTCISOWeek(fourthOfJanuary);
9572
+ return date;
9691
9573
  }
9692
- var localize = {
9693
- ordinalNumber: ordinalNumber,
9694
- era: buildLocalizeFn({
9695
- values: eraValues,
9696
- defaultWidth: 'wide'
9697
- }),
9698
- quarter: buildLocalizeFn({
9699
- values: quarterValues,
9700
- defaultWidth: 'wide',
9701
- argumentCallback: function argumentCallback(quarter) {
9702
- return Number(quarter) - 1;
9703
- }
9704
- }),
9705
- month: buildLocalizeFn({
9706
- values: monthValues,
9707
- defaultWidth: 'wide'
9708
- }),
9709
- day: buildLocalizeFn({
9710
- values: dayValues,
9711
- defaultWidth: 'wide'
9712
- }),
9713
- dayPeriod: buildLocalizeFn({
9714
- values: dayPeriodValues,
9715
- defaultWidth: 'wide',
9716
- formattingValues: formattingDayPeriodValues,
9717
- defaultFormattingWidth: 'wide'
9718
- })
9719
- };
9720
- var localize$1 = localize;
9721
9574
 
9722
- function buildMatchPatternFn(args) {
9723
- return function (dirtyString, dirtyOptions) {
9724
- var string = String(dirtyString);
9725
- var options = dirtyOptions || {};
9726
- var matchResult = string.match(args.matchPattern);
9727
- if (!matchResult) {
9728
- return null;
9729
- }
9730
- var matchedString = matchResult[0];
9731
- var parseResult = string.match(args.parsePattern);
9732
- if (!parseResult) {
9733
- return null;
9734
- }
9735
- var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
9736
- value = options.valueCallback ? options.valueCallback(value) : value;
9737
- return {
9738
- value: value,
9739
- rest: string.slice(matchedString.length)
9740
- };
9741
- };
9575
+ var MILLISECONDS_IN_WEEK$1 = 604800000;
9576
+ function getUTCISOWeek(dirtyDate) {
9577
+ requiredArgs(1, arguments);
9578
+ var date = toDate(dirtyDate);
9579
+ var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime();
9580
+
9581
+ // Round the number of days to the nearest integer
9582
+ // because the number of milliseconds in a week is not constant
9583
+ // (e.g. it's different in the week of the daylight saving time clock shift)
9584
+ return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
9742
9585
  }
9743
9586
 
9744
- function buildMatchFn(args) {
9745
- return function (dirtyString, dirtyOptions) {
9746
- var string = String(dirtyString);
9747
- var options = dirtyOptions || {};
9748
- var width = options.width;
9749
- var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
9750
- var matchResult = string.match(matchPattern);
9751
- if (!matchResult) {
9752
- return null;
9753
- }
9754
- var matchedString = matchResult[0];
9755
- var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
9756
- var value;
9757
- if (Object.prototype.toString.call(parsePatterns) === '[object Array]') {
9758
- value = findIndex(parsePatterns, function (pattern) {
9759
- return pattern.test(matchedString);
9760
- });
9761
- } else {
9762
- value = findKey(parsePatterns, function (pattern) {
9763
- return pattern.test(matchedString);
9764
- });
9765
- }
9766
- value = args.valueCallback ? args.valueCallback(value) : value;
9767
- value = options.valueCallback ? options.valueCallback(value) : value;
9768
- return {
9769
- value: value,
9770
- rest: string.slice(matchedString.length)
9771
- };
9772
- };
9587
+ var defaultOptions = {};
9588
+ function getDefaultOptions() {
9589
+ return defaultOptions;
9773
9590
  }
9774
- function findKey(object, predicate) {
9775
- for (var key in object) {
9776
- if (object.hasOwnProperty(key) && predicate(object[key])) {
9777
- return key;
9778
- }
9591
+
9592
+ function startOfUTCWeek(dirtyDate, options) {
9593
+ var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
9594
+ requiredArgs(1, arguments);
9595
+ var defaultOptions = getDefaultOptions();
9596
+ 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);
9597
+
9598
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
9599
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
9600
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
9779
9601
  }
9602
+ var date = toDate(dirtyDate);
9603
+ var day = date.getUTCDay();
9604
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
9605
+ date.setUTCDate(date.getUTCDate() - diff);
9606
+ date.setUTCHours(0, 0, 0, 0);
9607
+ return date;
9780
9608
  }
9781
- function findIndex(array, predicate) {
9782
- for (var key = 0; key < array.length; key++) {
9783
- if (predicate(array[key])) {
9784
- return key;
9785
- }
9609
+
9610
+ function getUTCWeekYear(dirtyDate, options) {
9611
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
9612
+ requiredArgs(1, arguments);
9613
+ var date = toDate(dirtyDate);
9614
+ var year = date.getUTCFullYear();
9615
+ var defaultOptions = getDefaultOptions();
9616
+ 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);
9617
+
9618
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
9619
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
9620
+ throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
9621
+ }
9622
+ var firstWeekOfNextYear = new Date(0);
9623
+ firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
9624
+ firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
9625
+ var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, options);
9626
+ var firstWeekOfThisYear = new Date(0);
9627
+ firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
9628
+ firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
9629
+ var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);
9630
+ if (date.getTime() >= startOfNextYear.getTime()) {
9631
+ return year + 1;
9632
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
9633
+ return year;
9634
+ } else {
9635
+ return year - 1;
9786
9636
  }
9787
9637
  }
9788
9638
 
9789
- var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
9790
- var parseOrdinalNumberPattern = /\d+/i;
9791
- var matchEraPatterns = {
9792
- narrow: /^(b|a)/i,
9793
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
9794
- wide: /^(before christ|before common era|anno domini|common era)/i
9795
- };
9796
- var parseEraPatterns = {
9797
- any: [/^b/i, /^(a|c)/i]
9798
- };
9799
- var matchQuarterPatterns = {
9800
- narrow: /^[1234]/i,
9801
- abbreviated: /^q[1234]/i,
9802
- wide: /^[1234](th|st|nd|rd)? quarter/i
9803
- };
9804
- var parseQuarterPatterns = {
9805
- any: [/1/i, /2/i, /3/i, /4/i]
9806
- };
9807
- var matchMonthPatterns = {
9808
- narrow: /^[jfmasond]/i,
9809
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
9810
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
9811
- };
9812
- var parseMonthPatterns = {
9813
- 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],
9814
- 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]
9815
- };
9816
- var matchDayPatterns = {
9817
- narrow: /^[smtwf]/i,
9818
- "short": /^(su|mo|tu|we|th|fr|sa)/i,
9819
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
9820
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
9821
- };
9822
- var parseDayPatterns = {
9823
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
9824
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
9825
- };
9826
- var matchDayPeriodPatterns = {
9827
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
9828
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
9829
- };
9830
- var parseDayPeriodPatterns = {
9831
- any: {
9832
- am: /^a/i,
9833
- pm: /^p/i,
9834
- midnight: /^mi/i,
9835
- noon: /^no/i,
9836
- morning: /morning/i,
9837
- afternoon: /afternoon/i,
9838
- evening: /evening/i,
9839
- night: /night/i
9840
- }
9841
- };
9842
- var match = {
9843
- ordinalNumber: buildMatchPatternFn({
9844
- matchPattern: matchOrdinalNumberPattern,
9845
- parsePattern: parseOrdinalNumberPattern,
9846
- valueCallback: function valueCallback(value) {
9847
- return parseInt(value, 10);
9848
- }
9849
- }),
9850
- era: buildMatchFn({
9851
- matchPatterns: matchEraPatterns,
9852
- defaultMatchWidth: 'wide',
9853
- parsePatterns: parseEraPatterns,
9854
- defaultParseWidth: 'any'
9855
- }),
9856
- quarter: buildMatchFn({
9857
- matchPatterns: matchQuarterPatterns,
9858
- defaultMatchWidth: 'wide',
9859
- parsePatterns: parseQuarterPatterns,
9860
- defaultParseWidth: 'any',
9861
- valueCallback: function valueCallback(index) {
9862
- return index + 1;
9863
- }
9864
- }),
9865
- month: buildMatchFn({
9866
- matchPatterns: matchMonthPatterns,
9867
- defaultMatchWidth: 'wide',
9868
- parsePatterns: parseMonthPatterns,
9869
- defaultParseWidth: 'any'
9870
- }),
9871
- day: buildMatchFn({
9872
- matchPatterns: matchDayPatterns,
9873
- defaultMatchWidth: 'wide',
9874
- parsePatterns: parseDayPatterns,
9875
- defaultParseWidth: 'any'
9876
- }),
9877
- dayPeriod: buildMatchFn({
9878
- matchPatterns: matchDayPeriodPatterns,
9879
- defaultMatchWidth: 'any',
9880
- parsePatterns: parseDayPeriodPatterns,
9881
- defaultParseWidth: 'any'
9882
- })
9883
- };
9884
- var match$1 = match;
9885
-
9886
- /**
9887
- * @type {Locale}
9888
- * @category Locales
9889
- * @summary English locale (United States).
9890
- * @language English
9891
- * @iso-639-2 eng
9892
- * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
9893
- * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
9894
- */
9895
-
9896
- var locale = {
9897
- code: 'en-US',
9898
- formatDistance: formatDistance,
9899
- formatLong: formatLong$1,
9900
- formatRelative: formatRelative,
9901
- localize: localize$1,
9902
- match: match$1,
9903
- options: {
9904
- weekStartsOn: 0
9905
- /* Sunday */,
9906
-
9907
- firstWeekContainsDate: 1
9908
- }
9909
- };
9910
- var defaultLocale = locale;
9911
-
9912
- function toInteger(dirtyNumber) {
9913
- if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
9914
- return NaN;
9915
- }
9916
- var number = Number(dirtyNumber);
9917
- if (isNaN(number)) {
9918
- return number;
9919
- }
9920
- return number < 0 ? Math.ceil(number) : Math.floor(number);
9921
- }
9922
-
9923
- /**
9924
- * @name addMilliseconds
9925
- * @category Millisecond Helpers
9926
- * @summary Add the specified number of milliseconds to the given date.
9927
- *
9928
- * @description
9929
- * Add the specified number of milliseconds to the given date.
9930
- *
9931
- * ### v2.0.0 breaking changes:
9932
- *
9933
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
9934
- *
9935
- * @param {Date|Number} date - the date to be changed
9936
- * @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`.
9937
- * @returns {Date} the new date with the milliseconds added
9938
- * @throws {TypeError} 2 arguments required
9939
- *
9940
- * @example
9941
- * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
9942
- * var result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
9943
- * //=> Thu Jul 10 2014 12:45:30.750
9944
- */
9945
-
9946
- function addMilliseconds(dirtyDate, dirtyAmount) {
9947
- requiredArgs(2, arguments);
9948
- var timestamp = toDate(dirtyDate).getTime();
9949
- var amount = toInteger(dirtyAmount);
9950
- return new Date(timestamp + amount);
9639
+ function startOfUTCWeekYear(dirtyDate, options) {
9640
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
9641
+ requiredArgs(1, arguments);
9642
+ var defaultOptions = getDefaultOptions();
9643
+ 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);
9644
+ var year = getUTCWeekYear(dirtyDate, options);
9645
+ var firstWeek = new Date(0);
9646
+ firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
9647
+ firstWeek.setUTCHours(0, 0, 0, 0);
9648
+ var date = startOfUTCWeek(firstWeek, options);
9649
+ return date;
9951
9650
  }
9952
9651
 
9953
- /**
9954
- * @name subMilliseconds
9955
- * @category Millisecond Helpers
9956
- * @summary Subtract the specified number of milliseconds from the given date.
9957
- *
9958
- * @description
9959
- * Subtract the specified number of milliseconds from 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 subtracted. 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 subtracted
9968
- * @throws {TypeError} 2 arguments required
9969
- *
9970
- * @example
9971
- * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
9972
- * var result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
9973
- * //=> Thu Jul 10 2014 12:45:29.250
9974
- */
9652
+ var MILLISECONDS_IN_WEEK = 604800000;
9653
+ function getUTCWeek(dirtyDate, options) {
9654
+ requiredArgs(1, arguments);
9655
+ var date = toDate(dirtyDate);
9656
+ var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime();
9975
9657
 
9976
- function subMilliseconds(dirtyDate, dirtyAmount) {
9977
- requiredArgs(2, arguments);
9978
- var amount = toInteger(dirtyAmount);
9979
- return addMilliseconds(dirtyDate, -amount);
9658
+ // Round the number of days to the nearest integer
9659
+ // because the number of milliseconds in a week is not constant
9660
+ // (e.g. it's different in the week of the daylight saving time clock shift)
9661
+ return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
9980
9662
  }
9981
9663
 
9982
9664
  function addLeadingZeros(number, targetLength) {
@@ -10000,7 +9682,6 @@ function addLeadingZeros(number, targetLength) {
10000
9682
  *
10001
9683
  * Letters marked by * are not implemented but reserved by Unicode standard.
10002
9684
  */
10003
-
10004
9685
  var formatters$2 = {
10005
9686
  // Year
10006
9687
  y: function y(date, token) {
@@ -10012,8 +9693,9 @@ var formatters$2 = {
10012
9693
  // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
10013
9694
  // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
10014
9695
  // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
10015
- var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
10016
9696
 
9697
+ var signedYear = date.getUTCFullYear();
9698
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
10017
9699
  var year = signedYear > 0 ? signedYear : 1 - signedYear;
10018
9700
  return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
10019
9701
  },
@@ -10032,8 +9714,9 @@ var formatters$2 = {
10032
9714
  switch (token) {
10033
9715
  case 'a':
10034
9716
  case 'aa':
10035
- case 'aaa':
10036
9717
  return dayPeriodEnumValue.toUpperCase();
9718
+ case 'aaa':
9719
+ return dayPeriodEnumValue;
10037
9720
  case 'aaaaa':
10038
9721
  return dayPeriodEnumValue[0];
10039
9722
  case 'aaaa':
@@ -10067,283 +9750,127 @@ var formatters$2 = {
10067
9750
  };
10068
9751
  var lightFormatters = formatters$2;
10069
9752
 
10070
- var MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.
10071
- // See issue: https://github.com/date-fns/date-fns/issues/376
10072
-
10073
- function getUTCDayOfYear(dirtyDate) {
10074
- requiredArgs(1, arguments);
10075
- var date = toDate(dirtyDate);
10076
- var timestamp = date.getTime();
10077
- date.setUTCMonth(0, 1);
10078
- date.setUTCHours(0, 0, 0, 0);
10079
- var startOfYearTimestamp = date.getTime();
10080
- var difference = timestamp - startOfYearTimestamp;
10081
- return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
10082
- }
9753
+ var dayPeriodEnum = {
9754
+ am: 'am',
9755
+ pm: 'pm',
9756
+ midnight: 'midnight',
9757
+ noon: 'noon',
9758
+ morning: 'morning',
9759
+ afternoon: 'afternoon',
9760
+ evening: 'evening',
9761
+ night: 'night'
9762
+ };
9763
+ /*
9764
+ * | | Unit | | Unit |
9765
+ * |-----|--------------------------------|-----|--------------------------------|
9766
+ * | a | AM, PM | A* | Milliseconds in day |
9767
+ * | b | AM, PM, noon, midnight | B | Flexible day period |
9768
+ * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
9769
+ * | d | Day of month | D | Day of year |
9770
+ * | e | Local day of week | E | Day of week |
9771
+ * | f | | F* | Day of week in month |
9772
+ * | g* | Modified Julian day | G | Era |
9773
+ * | h | Hour [1-12] | H | Hour [0-23] |
9774
+ * | i! | ISO day of week | I! | ISO week of year |
9775
+ * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
9776
+ * | k | Hour [1-24] | K | Hour [0-11] |
9777
+ * | l* | (deprecated) | L | Stand-alone month |
9778
+ * | m | Minute | M | Month |
9779
+ * | n | | N | |
9780
+ * | o! | Ordinal number modifier | O | Timezone (GMT) |
9781
+ * | p! | Long localized time | P! | Long localized date |
9782
+ * | q | Stand-alone quarter | Q | Quarter |
9783
+ * | r* | Related Gregorian year | R! | ISO week-numbering year |
9784
+ * | s | Second | S | Fraction of second |
9785
+ * | t! | Seconds timestamp | T! | Milliseconds timestamp |
9786
+ * | u | Extended year | U* | Cyclic year |
9787
+ * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
9788
+ * | w | Local week of year | W* | Week of month |
9789
+ * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
9790
+ * | y | Year (abs) | Y | Local week-numbering year |
9791
+ * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
9792
+ *
9793
+ * Letters marked by * are not implemented but reserved by Unicode standard.
9794
+ *
9795
+ * Letters marked by ! are non-standard, but implemented by date-fns:
9796
+ * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
9797
+ * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
9798
+ * i.e. 7 for Sunday, 1 for Monday, etc.
9799
+ * - `I` is ISO week of year, as opposed to `w` which is local week of year.
9800
+ * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
9801
+ * `R` is supposed to be used in conjunction with `I` and `i`
9802
+ * for universal ISO week-numbering date, whereas
9803
+ * `Y` is supposed to be used in conjunction with `w` and `e`
9804
+ * for week-numbering date specific to the locale.
9805
+ * - `P` is long localized date format
9806
+ * - `p` is long localized time format
9807
+ */
10083
9808
 
10084
- // See issue: https://github.com/date-fns/date-fns/issues/376
9809
+ var formatters = {
9810
+ // Era
9811
+ G: function G(date, token, localize) {
9812
+ var era = date.getUTCFullYear() > 0 ? 1 : 0;
9813
+ switch (token) {
9814
+ // AD, BC
9815
+ case 'G':
9816
+ case 'GG':
9817
+ case 'GGG':
9818
+ return localize.era(era, {
9819
+ width: 'abbreviated'
9820
+ });
9821
+ // A, B
9822
+ case 'GGGGG':
9823
+ return localize.era(era, {
9824
+ width: 'narrow'
9825
+ });
9826
+ // Anno Domini, Before Christ
9827
+ case 'GGGG':
9828
+ default:
9829
+ return localize.era(era, {
9830
+ width: 'wide'
9831
+ });
9832
+ }
9833
+ },
9834
+ // Year
9835
+ y: function y(date, token, localize) {
9836
+ // Ordinal number
9837
+ if (token === 'yo') {
9838
+ var signedYear = date.getUTCFullYear();
9839
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
9840
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
9841
+ return localize.ordinalNumber(year, {
9842
+ unit: 'year'
9843
+ });
9844
+ }
9845
+ return lightFormatters.y(date, token);
9846
+ },
9847
+ // Local week-numbering year
9848
+ Y: function Y(date, token, localize, options) {
9849
+ var signedWeekYear = getUTCWeekYear(date, options);
9850
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
9851
+ var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
10085
9852
 
10086
- function startOfUTCISOWeek(dirtyDate) {
10087
- requiredArgs(1, arguments);
10088
- var weekStartsOn = 1;
10089
- var date = toDate(dirtyDate);
10090
- var day = date.getUTCDay();
10091
- var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
10092
- date.setUTCDate(date.getUTCDate() - diff);
10093
- date.setUTCHours(0, 0, 0, 0);
10094
- return date;
10095
- }
9853
+ // Two digit year
9854
+ if (token === 'YY') {
9855
+ var twoDigitYear = weekYear % 100;
9856
+ return addLeadingZeros(twoDigitYear, 2);
9857
+ }
10096
9858
 
10097
- // See issue: https://github.com/date-fns/date-fns/issues/376
10098
-
10099
- function getUTCISOWeekYear(dirtyDate) {
10100
- requiredArgs(1, arguments);
10101
- var date = toDate(dirtyDate);
10102
- var year = date.getUTCFullYear();
10103
- var fourthOfJanuaryOfNextYear = new Date(0);
10104
- fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
10105
- fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
10106
- var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
10107
- var fourthOfJanuaryOfThisYear = new Date(0);
10108
- fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
10109
- fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
10110
- var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
10111
- if (date.getTime() >= startOfNextYear.getTime()) {
10112
- return year + 1;
10113
- } else if (date.getTime() >= startOfThisYear.getTime()) {
10114
- return year;
10115
- } else {
10116
- return year - 1;
10117
- }
10118
- }
10119
-
10120
- // See issue: https://github.com/date-fns/date-fns/issues/376
10121
-
10122
- function startOfUTCISOWeekYear(dirtyDate) {
10123
- requiredArgs(1, arguments);
10124
- var year = getUTCISOWeekYear(dirtyDate);
10125
- var fourthOfJanuary = new Date(0);
10126
- fourthOfJanuary.setUTCFullYear(year, 0, 4);
10127
- fourthOfJanuary.setUTCHours(0, 0, 0, 0);
10128
- var date = startOfUTCISOWeek(fourthOfJanuary);
10129
- return date;
10130
- }
10131
-
10132
- var MILLISECONDS_IN_WEEK$1 = 604800000; // This function will be a part of public API when UTC function will be implemented.
10133
- // See issue: https://github.com/date-fns/date-fns/issues/376
10134
-
10135
- function getUTCISOWeek(dirtyDate) {
10136
- requiredArgs(1, arguments);
10137
- var date = toDate(dirtyDate);
10138
- var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer
10139
- // because the number of milliseconds in a week is not constant
10140
- // (e.g. it's different in the week of the daylight saving time clock shift)
10141
-
10142
- return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
10143
- }
10144
-
10145
- // See issue: https://github.com/date-fns/date-fns/issues/376
10146
-
10147
- function startOfUTCWeek(dirtyDate, dirtyOptions) {
10148
- requiredArgs(1, arguments);
10149
- var options = dirtyOptions || {};
10150
- var locale = options.locale;
10151
- var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;
10152
- var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
10153
- var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
10154
-
10155
- if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
10156
- throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
10157
- }
10158
- var date = toDate(dirtyDate);
10159
- var day = date.getUTCDay();
10160
- var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
10161
- date.setUTCDate(date.getUTCDate() - diff);
10162
- date.setUTCHours(0, 0, 0, 0);
10163
- return date;
10164
- }
10165
-
10166
- // See issue: https://github.com/date-fns/date-fns/issues/376
10167
-
10168
- function getUTCWeekYear(dirtyDate, dirtyOptions) {
10169
- requiredArgs(1, arguments);
10170
- var date = toDate(dirtyDate, dirtyOptions);
10171
- var year = date.getUTCFullYear();
10172
- var options = dirtyOptions || {};
10173
- var locale = options.locale;
10174
- var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
10175
- var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
10176
- var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
10177
-
10178
- if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
10179
- throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
10180
- }
10181
- var firstWeekOfNextYear = new Date(0);
10182
- firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
10183
- firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
10184
- var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions);
10185
- var firstWeekOfThisYear = new Date(0);
10186
- firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
10187
- firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
10188
- var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions);
10189
- if (date.getTime() >= startOfNextYear.getTime()) {
10190
- return year + 1;
10191
- } else if (date.getTime() >= startOfThisYear.getTime()) {
10192
- return year;
10193
- } else {
10194
- return year - 1;
10195
- }
10196
- }
10197
-
10198
- // See issue: https://github.com/date-fns/date-fns/issues/376
10199
-
10200
- function startOfUTCWeekYear(dirtyDate, dirtyOptions) {
10201
- requiredArgs(1, arguments);
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);
10207
- var year = getUTCWeekYear(dirtyDate, dirtyOptions);
10208
- var firstWeek = new Date(0);
10209
- firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
10210
- firstWeek.setUTCHours(0, 0, 0, 0);
10211
- var date = startOfUTCWeek(firstWeek, dirtyOptions);
10212
- return date;
10213
- }
10214
-
10215
- var MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.
10216
- // See issue: https://github.com/date-fns/date-fns/issues/376
10217
-
10218
- function getUTCWeek(dirtyDate, options) {
10219
- requiredArgs(1, arguments);
10220
- var date = toDate(dirtyDate);
10221
- var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer
10222
- // because the number of milliseconds in a week is not constant
10223
- // (e.g. it's different in the week of the daylight saving time clock shift)
10224
-
10225
- return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
10226
- }
10227
-
10228
- var dayPeriodEnum = {
10229
- am: 'am',
10230
- pm: 'pm',
10231
- midnight: 'midnight',
10232
- noon: 'noon',
10233
- morning: 'morning',
10234
- afternoon: 'afternoon',
10235
- evening: 'evening',
10236
- night: 'night'
10237
- /*
10238
- * | | Unit | | Unit |
10239
- * |-----|--------------------------------|-----|--------------------------------|
10240
- * | a | AM, PM | A* | Milliseconds in day |
10241
- * | b | AM, PM, noon, midnight | B | Flexible day period |
10242
- * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
10243
- * | d | Day of month | D | Day of year |
10244
- * | e | Local day of week | E | Day of week |
10245
- * | f | | F* | Day of week in month |
10246
- * | g* | Modified Julian day | G | Era |
10247
- * | h | Hour [1-12] | H | Hour [0-23] |
10248
- * | i! | ISO day of week | I! | ISO week of year |
10249
- * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
10250
- * | k | Hour [1-24] | K | Hour [0-11] |
10251
- * | l* | (deprecated) | L | Stand-alone month |
10252
- * | m | Minute | M | Month |
10253
- * | n | | N | |
10254
- * | o! | Ordinal number modifier | O | Timezone (GMT) |
10255
- * | p! | Long localized time | P! | Long localized date |
10256
- * | q | Stand-alone quarter | Q | Quarter |
10257
- * | r* | Related Gregorian year | R! | ISO week-numbering year |
10258
- * | s | Second | S | Fraction of second |
10259
- * | t! | Seconds timestamp | T! | Milliseconds timestamp |
10260
- * | u | Extended year | U* | Cyclic year |
10261
- * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
10262
- * | w | Local week of year | W* | Week of month |
10263
- * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
10264
- * | y | Year (abs) | Y | Local week-numbering year |
10265
- * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
10266
- *
10267
- * Letters marked by * are not implemented but reserved by Unicode standard.
10268
- *
10269
- * Letters marked by ! are non-standard, but implemented by date-fns:
10270
- * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
10271
- * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
10272
- * i.e. 7 for Sunday, 1 for Monday, etc.
10273
- * - `I` is ISO week of year, as opposed to `w` which is local week of year.
10274
- * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
10275
- * `R` is supposed to be used in conjunction with `I` and `i`
10276
- * for universal ISO week-numbering date, whereas
10277
- * `Y` is supposed to be used in conjunction with `w` and `e`
10278
- * for week-numbering date specific to the locale.
10279
- * - `P` is long localized date format
10280
- * - `p` is long localized time format
10281
- */
10282
- };
10283
-
10284
- var formatters = {
10285
- // Era
10286
- G: function G(date, token, localize) {
10287
- var era = date.getUTCFullYear() > 0 ? 1 : 0;
10288
- switch (token) {
10289
- // AD, BC
10290
- case 'G':
10291
- case 'GG':
10292
- case 'GGG':
10293
- return localize.era(era, {
10294
- width: 'abbreviated'
10295
- });
10296
- // A, B
10297
-
10298
- case 'GGGGG':
10299
- return localize.era(era, {
10300
- width: 'narrow'
10301
- });
10302
- // Anno Domini, Before Christ
10303
-
10304
- case 'GGGG':
10305
- default:
10306
- return localize.era(era, {
10307
- width: 'wide'
10308
- });
10309
- }
10310
- },
10311
- // Year
10312
- y: function y(date, token, localize) {
10313
- // Ordinal number
10314
- if (token === 'yo') {
10315
- var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
10316
-
10317
- var year = signedYear > 0 ? signedYear : 1 - signedYear;
10318
- return localize.ordinalNumber(year, {
10319
- unit: 'year'
10320
- });
10321
- }
10322
- return lightFormatters.y(date, token);
10323
- },
10324
- // Local week-numbering year
10325
- Y: function Y(date, token, localize, options) {
10326
- var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)
10327
-
10328
- var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year
10329
-
10330
- if (token === 'YY') {
10331
- var twoDigitYear = weekYear % 100;
10332
- return addLeadingZeros(twoDigitYear, 2);
10333
- } // Ordinal number
10334
-
10335
- if (token === 'Yo') {
10336
- return localize.ordinalNumber(weekYear, {
10337
- unit: 'year'
10338
- });
10339
- } // Padding
9859
+ // Ordinal number
9860
+ if (token === 'Yo') {
9861
+ return localize.ordinalNumber(weekYear, {
9862
+ unit: 'year'
9863
+ });
9864
+ }
10340
9865
 
9866
+ // Padding
10341
9867
  return addLeadingZeros(weekYear, token.length);
10342
9868
  },
10343
9869
  // ISO week-numbering year
10344
9870
  R: function R(date, token) {
10345
- var isoWeekYear = getUTCISOWeekYear(date); // Padding
9871
+ var isoWeekYear = getUTCISOWeekYear(date);
10346
9872
 
9873
+ // Padding
10347
9874
  return addLeadingZeros(isoWeekYear, token.length);
10348
9875
  },
10349
9876
  // Extended year. This is a single number designating the year of this calendar system.
@@ -10367,31 +9894,26 @@ var formatters = {
10367
9894
  case 'Q':
10368
9895
  return String(quarter);
10369
9896
  // 01, 02, 03, 04
10370
-
10371
9897
  case 'QQ':
10372
9898
  return addLeadingZeros(quarter, 2);
10373
9899
  // 1st, 2nd, 3rd, 4th
10374
-
10375
9900
  case 'Qo':
10376
9901
  return localize.ordinalNumber(quarter, {
10377
9902
  unit: 'quarter'
10378
9903
  });
10379
9904
  // Q1, Q2, Q3, Q4
10380
-
10381
9905
  case 'QQQ':
10382
9906
  return localize.quarter(quarter, {
10383
9907
  width: 'abbreviated',
10384
9908
  context: 'formatting'
10385
9909
  });
10386
9910
  // 1, 2, 3, 4 (narrow quarter; could be not numerical)
10387
-
10388
9911
  case 'QQQQQ':
10389
9912
  return localize.quarter(quarter, {
10390
9913
  width: 'narrow',
10391
9914
  context: 'formatting'
10392
9915
  });
10393
9916
  // 1st quarter, 2nd quarter, ...
10394
-
10395
9917
  case 'QQQQ':
10396
9918
  default:
10397
9919
  return localize.quarter(quarter, {
@@ -10408,31 +9930,26 @@ var formatters = {
10408
9930
  case 'q':
10409
9931
  return String(quarter);
10410
9932
  // 01, 02, 03, 04
10411
-
10412
9933
  case 'qq':
10413
9934
  return addLeadingZeros(quarter, 2);
10414
9935
  // 1st, 2nd, 3rd, 4th
10415
-
10416
9936
  case 'qo':
10417
9937
  return localize.ordinalNumber(quarter, {
10418
9938
  unit: 'quarter'
10419
9939
  });
10420
9940
  // Q1, Q2, Q3, Q4
10421
-
10422
9941
  case 'qqq':
10423
9942
  return localize.quarter(quarter, {
10424
9943
  width: 'abbreviated',
10425
9944
  context: 'standalone'
10426
9945
  });
10427
9946
  // 1, 2, 3, 4 (narrow quarter; could be not numerical)
10428
-
10429
9947
  case 'qqqqq':
10430
9948
  return localize.quarter(quarter, {
10431
9949
  width: 'narrow',
10432
9950
  context: 'standalone'
10433
9951
  });
10434
9952
  // 1st quarter, 2nd quarter, ...
10435
-
10436
9953
  case 'qqqq':
10437
9954
  default:
10438
9955
  return localize.quarter(quarter, {
@@ -10449,27 +9966,23 @@ var formatters = {
10449
9966
  case 'MM':
10450
9967
  return lightFormatters.M(date, token);
10451
9968
  // 1st, 2nd, ..., 12th
10452
-
10453
9969
  case 'Mo':
10454
9970
  return localize.ordinalNumber(month + 1, {
10455
9971
  unit: 'month'
10456
9972
  });
10457
9973
  // Jan, Feb, ..., Dec
10458
-
10459
9974
  case 'MMM':
10460
9975
  return localize.month(month, {
10461
9976
  width: 'abbreviated',
10462
9977
  context: 'formatting'
10463
9978
  });
10464
9979
  // J, F, ..., D
10465
-
10466
9980
  case 'MMMMM':
10467
9981
  return localize.month(month, {
10468
9982
  width: 'narrow',
10469
9983
  context: 'formatting'
10470
9984
  });
10471
9985
  // January, February, ..., December
10472
-
10473
9986
  case 'MMMM':
10474
9987
  default:
10475
9988
  return localize.month(month, {
@@ -10486,31 +9999,26 @@ var formatters = {
10486
9999
  case 'L':
10487
10000
  return String(month + 1);
10488
10001
  // 01, 02, ..., 12
10489
-
10490
10002
  case 'LL':
10491
10003
  return addLeadingZeros(month + 1, 2);
10492
10004
  // 1st, 2nd, ..., 12th
10493
-
10494
10005
  case 'Lo':
10495
10006
  return localize.ordinalNumber(month + 1, {
10496
10007
  unit: 'month'
10497
10008
  });
10498
10009
  // Jan, Feb, ..., Dec
10499
-
10500
10010
  case 'LLL':
10501
10011
  return localize.month(month, {
10502
10012
  width: 'abbreviated',
10503
10013
  context: 'standalone'
10504
10014
  });
10505
10015
  // J, F, ..., D
10506
-
10507
10016
  case 'LLLLL':
10508
10017
  return localize.month(month, {
10509
10018
  width: 'narrow',
10510
10019
  context: 'standalone'
10511
10020
  });
10512
10021
  // January, February, ..., December
10513
-
10514
10022
  case 'LLLL':
10515
10023
  default:
10516
10024
  return localize.month(month, {
@@ -10571,21 +10079,18 @@ var formatters = {
10571
10079
  context: 'formatting'
10572
10080
  });
10573
10081
  // T
10574
-
10575
10082
  case 'EEEEE':
10576
10083
  return localize.day(dayOfWeek, {
10577
10084
  width: 'narrow',
10578
10085
  context: 'formatting'
10579
10086
  });
10580
10087
  // Tu
10581
-
10582
10088
  case 'EEEEEE':
10583
10089
  return localize.day(dayOfWeek, {
10584
10090
  width: 'short',
10585
10091
  context: 'formatting'
10586
10092
  });
10587
10093
  // Tuesday
10588
-
10589
10094
  case 'EEEE':
10590
10095
  default:
10591
10096
  return localize.day(dayOfWeek, {
@@ -10603,11 +10108,9 @@ var formatters = {
10603
10108
  case 'e':
10604
10109
  return String(localDayOfWeek);
10605
10110
  // Padded numerical value
10606
-
10607
10111
  case 'ee':
10608
10112
  return addLeadingZeros(localDayOfWeek, 2);
10609
10113
  // 1st, 2nd, ..., 7th
10610
-
10611
10114
  case 'eo':
10612
10115
  return localize.ordinalNumber(localDayOfWeek, {
10613
10116
  unit: 'day'
@@ -10618,21 +10121,18 @@ var formatters = {
10618
10121
  context: 'formatting'
10619
10122
  });
10620
10123
  // T
10621
-
10622
10124
  case 'eeeee':
10623
10125
  return localize.day(dayOfWeek, {
10624
10126
  width: 'narrow',
10625
10127
  context: 'formatting'
10626
10128
  });
10627
10129
  // Tu
10628
-
10629
10130
  case 'eeeeee':
10630
10131
  return localize.day(dayOfWeek, {
10631
10132
  width: 'short',
10632
10133
  context: 'formatting'
10633
10134
  });
10634
10135
  // Tuesday
10635
-
10636
10136
  case 'eeee':
10637
10137
  default:
10638
10138
  return localize.day(dayOfWeek, {
@@ -10650,11 +10150,9 @@ var formatters = {
10650
10150
  case 'c':
10651
10151
  return String(localDayOfWeek);
10652
10152
  // Padded numerical value
10653
-
10654
10153
  case 'cc':
10655
10154
  return addLeadingZeros(localDayOfWeek, token.length);
10656
10155
  // 1st, 2nd, ..., 7th
10657
-
10658
10156
  case 'co':
10659
10157
  return localize.ordinalNumber(localDayOfWeek, {
10660
10158
  unit: 'day'
@@ -10665,21 +10163,18 @@ var formatters = {
10665
10163
  context: 'standalone'
10666
10164
  });
10667
10165
  // T
10668
-
10669
10166
  case 'ccccc':
10670
10167
  return localize.day(dayOfWeek, {
10671
10168
  width: 'narrow',
10672
10169
  context: 'standalone'
10673
10170
  });
10674
10171
  // Tu
10675
-
10676
10172
  case 'cccccc':
10677
10173
  return localize.day(dayOfWeek, {
10678
10174
  width: 'short',
10679
10175
  context: 'standalone'
10680
10176
  });
10681
10177
  // Tuesday
10682
-
10683
10178
  case 'cccc':
10684
10179
  default:
10685
10180
  return localize.day(dayOfWeek, {
@@ -10697,38 +10192,32 @@ var formatters = {
10697
10192
  case 'i':
10698
10193
  return String(isoDayOfWeek);
10699
10194
  // 02
10700
-
10701
10195
  case 'ii':
10702
10196
  return addLeadingZeros(isoDayOfWeek, token.length);
10703
10197
  // 2nd
10704
-
10705
10198
  case 'io':
10706
10199
  return localize.ordinalNumber(isoDayOfWeek, {
10707
10200
  unit: 'day'
10708
10201
  });
10709
10202
  // Tue
10710
-
10711
10203
  case 'iii':
10712
10204
  return localize.day(dayOfWeek, {
10713
10205
  width: 'abbreviated',
10714
10206
  context: 'formatting'
10715
10207
  });
10716
10208
  // T
10717
-
10718
10209
  case 'iiiii':
10719
10210
  return localize.day(dayOfWeek, {
10720
10211
  width: 'narrow',
10721
10212
  context: 'formatting'
10722
10213
  });
10723
10214
  // Tu
10724
-
10725
10215
  case 'iiiiii':
10726
10216
  return localize.day(dayOfWeek, {
10727
10217
  width: 'short',
10728
10218
  context: 'formatting'
10729
10219
  });
10730
10220
  // Tuesday
10731
-
10732
10221
  case 'iiii':
10733
10222
  default:
10734
10223
  return localize.day(dayOfWeek, {
@@ -10737,417 +10226,897 @@ var formatters = {
10737
10226
  });
10738
10227
  }
10739
10228
  },
10740
- // AM or PM
10741
- a: function a(date, token, localize) {
10742
- var hours = date.getUTCHours();
10743
- var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
10744
- switch (token) {
10745
- case 'a':
10746
- case 'aa':
10747
- case 'aaa':
10748
- return localize.dayPeriod(dayPeriodEnumValue, {
10749
- width: 'abbreviated',
10750
- context: 'formatting'
10751
- });
10752
- case 'aaaaa':
10753
- return localize.dayPeriod(dayPeriodEnumValue, {
10754
- width: 'narrow',
10755
- context: 'formatting'
10756
- });
10757
- case 'aaaa':
10758
- default:
10759
- return localize.dayPeriod(dayPeriodEnumValue, {
10760
- width: 'wide',
10761
- context: 'formatting'
10762
- });
10763
- }
10229
+ // AM or PM
10230
+ a: function a(date, token, localize) {
10231
+ var hours = date.getUTCHours();
10232
+ var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
10233
+ switch (token) {
10234
+ case 'a':
10235
+ case 'aa':
10236
+ return localize.dayPeriod(dayPeriodEnumValue, {
10237
+ width: 'abbreviated',
10238
+ context: 'formatting'
10239
+ });
10240
+ case 'aaa':
10241
+ return localize.dayPeriod(dayPeriodEnumValue, {
10242
+ width: 'abbreviated',
10243
+ context: 'formatting'
10244
+ }).toLowerCase();
10245
+ case 'aaaaa':
10246
+ return localize.dayPeriod(dayPeriodEnumValue, {
10247
+ width: 'narrow',
10248
+ context: 'formatting'
10249
+ });
10250
+ case 'aaaa':
10251
+ default:
10252
+ return localize.dayPeriod(dayPeriodEnumValue, {
10253
+ width: 'wide',
10254
+ context: 'formatting'
10255
+ });
10256
+ }
10257
+ },
10258
+ // AM, PM, midnight, noon
10259
+ b: function b(date, token, localize) {
10260
+ var hours = date.getUTCHours();
10261
+ var dayPeriodEnumValue;
10262
+ if (hours === 12) {
10263
+ dayPeriodEnumValue = dayPeriodEnum.noon;
10264
+ } else if (hours === 0) {
10265
+ dayPeriodEnumValue = dayPeriodEnum.midnight;
10266
+ } else {
10267
+ dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
10268
+ }
10269
+ switch (token) {
10270
+ case 'b':
10271
+ case 'bb':
10272
+ return localize.dayPeriod(dayPeriodEnumValue, {
10273
+ width: 'abbreviated',
10274
+ context: 'formatting'
10275
+ });
10276
+ case 'bbb':
10277
+ return localize.dayPeriod(dayPeriodEnumValue, {
10278
+ width: 'abbreviated',
10279
+ context: 'formatting'
10280
+ }).toLowerCase();
10281
+ case 'bbbbb':
10282
+ return localize.dayPeriod(dayPeriodEnumValue, {
10283
+ width: 'narrow',
10284
+ context: 'formatting'
10285
+ });
10286
+ case 'bbbb':
10287
+ default:
10288
+ return localize.dayPeriod(dayPeriodEnumValue, {
10289
+ width: 'wide',
10290
+ context: 'formatting'
10291
+ });
10292
+ }
10293
+ },
10294
+ // in the morning, in the afternoon, in the evening, at night
10295
+ B: function B(date, token, localize) {
10296
+ var hours = date.getUTCHours();
10297
+ var dayPeriodEnumValue;
10298
+ if (hours >= 17) {
10299
+ dayPeriodEnumValue = dayPeriodEnum.evening;
10300
+ } else if (hours >= 12) {
10301
+ dayPeriodEnumValue = dayPeriodEnum.afternoon;
10302
+ } else if (hours >= 4) {
10303
+ dayPeriodEnumValue = dayPeriodEnum.morning;
10304
+ } else {
10305
+ dayPeriodEnumValue = dayPeriodEnum.night;
10306
+ }
10307
+ switch (token) {
10308
+ case 'B':
10309
+ case 'BB':
10310
+ case 'BBB':
10311
+ return localize.dayPeriod(dayPeriodEnumValue, {
10312
+ width: 'abbreviated',
10313
+ context: 'formatting'
10314
+ });
10315
+ case 'BBBBB':
10316
+ return localize.dayPeriod(dayPeriodEnumValue, {
10317
+ width: 'narrow',
10318
+ context: 'formatting'
10319
+ });
10320
+ case 'BBBB':
10321
+ default:
10322
+ return localize.dayPeriod(dayPeriodEnumValue, {
10323
+ width: 'wide',
10324
+ context: 'formatting'
10325
+ });
10326
+ }
10327
+ },
10328
+ // Hour [1-12]
10329
+ h: function h(date, token, localize) {
10330
+ if (token === 'ho') {
10331
+ var hours = date.getUTCHours() % 12;
10332
+ if (hours === 0) hours = 12;
10333
+ return localize.ordinalNumber(hours, {
10334
+ unit: 'hour'
10335
+ });
10336
+ }
10337
+ return lightFormatters.h(date, token);
10338
+ },
10339
+ // Hour [0-23]
10340
+ H: function H(date, token, localize) {
10341
+ if (token === 'Ho') {
10342
+ return localize.ordinalNumber(date.getUTCHours(), {
10343
+ unit: 'hour'
10344
+ });
10345
+ }
10346
+ return lightFormatters.H(date, token);
10347
+ },
10348
+ // Hour [0-11]
10349
+ K: function K(date, token, localize) {
10350
+ var hours = date.getUTCHours() % 12;
10351
+ if (token === 'Ko') {
10352
+ return localize.ordinalNumber(hours, {
10353
+ unit: 'hour'
10354
+ });
10355
+ }
10356
+ return addLeadingZeros(hours, token.length);
10357
+ },
10358
+ // Hour [1-24]
10359
+ k: function k(date, token, localize) {
10360
+ var hours = date.getUTCHours();
10361
+ if (hours === 0) hours = 24;
10362
+ if (token === 'ko') {
10363
+ return localize.ordinalNumber(hours, {
10364
+ unit: 'hour'
10365
+ });
10366
+ }
10367
+ return addLeadingZeros(hours, token.length);
10368
+ },
10369
+ // Minute
10370
+ m: function m(date, token, localize) {
10371
+ if (token === 'mo') {
10372
+ return localize.ordinalNumber(date.getUTCMinutes(), {
10373
+ unit: 'minute'
10374
+ });
10375
+ }
10376
+ return lightFormatters.m(date, token);
10377
+ },
10378
+ // Second
10379
+ s: function s(date, token, localize) {
10380
+ if (token === 'so') {
10381
+ return localize.ordinalNumber(date.getUTCSeconds(), {
10382
+ unit: 'second'
10383
+ });
10384
+ }
10385
+ return lightFormatters.s(date, token);
10386
+ },
10387
+ // Fraction of second
10388
+ S: function S(date, token) {
10389
+ return lightFormatters.S(date, token);
10390
+ },
10391
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
10392
+ X: function X(date, token, _localize, options) {
10393
+ var originalDate = options._originalDate || date;
10394
+ var timezoneOffset = originalDate.getTimezoneOffset();
10395
+ if (timezoneOffset === 0) {
10396
+ return 'Z';
10397
+ }
10398
+ switch (token) {
10399
+ // Hours and optional minutes
10400
+ case 'X':
10401
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
10402
+
10403
+ // Hours, minutes and optional seconds without `:` delimiter
10404
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10405
+ // so this token always has the same output as `XX`
10406
+ case 'XXXX':
10407
+ case 'XX':
10408
+ // Hours and minutes without `:` delimiter
10409
+ return formatTimezone(timezoneOffset);
10410
+
10411
+ // Hours, minutes and optional seconds with `:` delimiter
10412
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10413
+ // so this token always has the same output as `XXX`
10414
+ case 'XXXXX':
10415
+ case 'XXX': // Hours and minutes with `:` delimiter
10416
+ default:
10417
+ return formatTimezone(timezoneOffset, ':');
10418
+ }
10419
+ },
10420
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
10421
+ x: function x(date, token, _localize, options) {
10422
+ var originalDate = options._originalDate || date;
10423
+ var timezoneOffset = originalDate.getTimezoneOffset();
10424
+ switch (token) {
10425
+ // Hours and optional minutes
10426
+ case 'x':
10427
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
10428
+
10429
+ // Hours, minutes and optional seconds without `:` delimiter
10430
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10431
+ // so this token always has the same output as `xx`
10432
+ case 'xxxx':
10433
+ case 'xx':
10434
+ // Hours and minutes without `:` delimiter
10435
+ return formatTimezone(timezoneOffset);
10436
+
10437
+ // Hours, minutes and optional seconds with `:` delimiter
10438
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10439
+ // so this token always has the same output as `xxx`
10440
+ case 'xxxxx':
10441
+ case 'xxx': // Hours and minutes with `:` delimiter
10442
+ default:
10443
+ return formatTimezone(timezoneOffset, ':');
10444
+ }
10445
+ },
10446
+ // Timezone (GMT)
10447
+ O: function O(date, token, _localize, options) {
10448
+ var originalDate = options._originalDate || date;
10449
+ var timezoneOffset = originalDate.getTimezoneOffset();
10450
+ switch (token) {
10451
+ // Short
10452
+ case 'O':
10453
+ case 'OO':
10454
+ case 'OOO':
10455
+ return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
10456
+ // Long
10457
+ case 'OOOO':
10458
+ default:
10459
+ return 'GMT' + formatTimezone(timezoneOffset, ':');
10460
+ }
10461
+ },
10462
+ // Timezone (specific non-location)
10463
+ z: function z(date, token, _localize, options) {
10464
+ var originalDate = options._originalDate || date;
10465
+ var timezoneOffset = originalDate.getTimezoneOffset();
10466
+ switch (token) {
10467
+ // Short
10468
+ case 'z':
10469
+ case 'zz':
10470
+ case 'zzz':
10471
+ return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
10472
+ // Long
10473
+ case 'zzzz':
10474
+ default:
10475
+ return 'GMT' + formatTimezone(timezoneOffset, ':');
10476
+ }
10477
+ },
10478
+ // Seconds timestamp
10479
+ t: function t(date, token, _localize, options) {
10480
+ var originalDate = options._originalDate || date;
10481
+ var timestamp = Math.floor(originalDate.getTime() / 1000);
10482
+ return addLeadingZeros(timestamp, token.length);
10483
+ },
10484
+ // Milliseconds timestamp
10485
+ T: function T(date, token, _localize, options) {
10486
+ var originalDate = options._originalDate || date;
10487
+ var timestamp = originalDate.getTime();
10488
+ return addLeadingZeros(timestamp, token.length);
10489
+ }
10490
+ };
10491
+ function formatTimezoneShort(offset, dirtyDelimiter) {
10492
+ var sign = offset > 0 ? '-' : '+';
10493
+ var absOffset = Math.abs(offset);
10494
+ var hours = Math.floor(absOffset / 60);
10495
+ var minutes = absOffset % 60;
10496
+ if (minutes === 0) {
10497
+ return sign + String(hours);
10498
+ }
10499
+ var delimiter = dirtyDelimiter || '';
10500
+ return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
10501
+ }
10502
+ function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
10503
+ if (offset % 60 === 0) {
10504
+ var sign = offset > 0 ? '-' : '+';
10505
+ return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
10506
+ }
10507
+ return formatTimezone(offset, dirtyDelimiter);
10508
+ }
10509
+ function formatTimezone(offset, dirtyDelimiter) {
10510
+ var delimiter = dirtyDelimiter || '';
10511
+ var sign = offset > 0 ? '-' : '+';
10512
+ var absOffset = Math.abs(offset);
10513
+ var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
10514
+ var minutes = addLeadingZeros(absOffset % 60, 2);
10515
+ return sign + hours + delimiter + minutes;
10516
+ }
10517
+ var formatters$1 = formatters;
10518
+
10519
+ var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
10520
+ switch (pattern) {
10521
+ case 'P':
10522
+ return formatLong.date({
10523
+ width: 'short'
10524
+ });
10525
+ case 'PP':
10526
+ return formatLong.date({
10527
+ width: 'medium'
10528
+ });
10529
+ case 'PPP':
10530
+ return formatLong.date({
10531
+ width: 'long'
10532
+ });
10533
+ case 'PPPP':
10534
+ default:
10535
+ return formatLong.date({
10536
+ width: 'full'
10537
+ });
10538
+ }
10539
+ };
10540
+ var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
10541
+ switch (pattern) {
10542
+ case 'p':
10543
+ return formatLong.time({
10544
+ width: 'short'
10545
+ });
10546
+ case 'pp':
10547
+ return formatLong.time({
10548
+ width: 'medium'
10549
+ });
10550
+ case 'ppp':
10551
+ return formatLong.time({
10552
+ width: 'long'
10553
+ });
10554
+ case 'pppp':
10555
+ default:
10556
+ return formatLong.time({
10557
+ width: 'full'
10558
+ });
10559
+ }
10560
+ };
10561
+ var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong) {
10562
+ var matchResult = pattern.match(/(P+)(p+)?/) || [];
10563
+ var datePattern = matchResult[1];
10564
+ var timePattern = matchResult[2];
10565
+ if (!timePattern) {
10566
+ return dateLongFormatter(pattern, formatLong);
10567
+ }
10568
+ var dateTimeFormat;
10569
+ switch (datePattern) {
10570
+ case 'P':
10571
+ dateTimeFormat = formatLong.dateTime({
10572
+ width: 'short'
10573
+ });
10574
+ break;
10575
+ case 'PP':
10576
+ dateTimeFormat = formatLong.dateTime({
10577
+ width: 'medium'
10578
+ });
10579
+ break;
10580
+ case 'PPP':
10581
+ dateTimeFormat = formatLong.dateTime({
10582
+ width: 'long'
10583
+ });
10584
+ break;
10585
+ case 'PPPP':
10586
+ default:
10587
+ dateTimeFormat = formatLong.dateTime({
10588
+ width: 'full'
10589
+ });
10590
+ break;
10591
+ }
10592
+ return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
10593
+ };
10594
+ var longFormatters = {
10595
+ p: timeLongFormatter,
10596
+ P: dateTimeLongFormatter
10597
+ };
10598
+ var longFormatters$1 = longFormatters;
10599
+
10600
+ /**
10601
+ * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
10602
+ * They usually appear for dates that denote time before the timezones were introduced
10603
+ * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
10604
+ * and GMT+01:00:00 after that date)
10605
+ *
10606
+ * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
10607
+ * which would lead to incorrect calculations.
10608
+ *
10609
+ * This function returns the timezone offset in milliseconds that takes seconds in account.
10610
+ */
10611
+ function getTimezoneOffsetInMilliseconds(date) {
10612
+ var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
10613
+ utcDate.setUTCFullYear(date.getFullYear());
10614
+ return date.getTime() - utcDate.getTime();
10615
+ }
10616
+
10617
+ var protectedDayOfYearTokens = ['D', 'DD'];
10618
+ var protectedWeekYearTokens = ['YY', 'YYYY'];
10619
+ function isProtectedDayOfYearToken(token) {
10620
+ return protectedDayOfYearTokens.indexOf(token) !== -1;
10621
+ }
10622
+ function isProtectedWeekYearToken(token) {
10623
+ return protectedWeekYearTokens.indexOf(token) !== -1;
10624
+ }
10625
+ function throwProtectedError(token, format, input) {
10626
+ if (token === 'YYYY') {
10627
+ 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"));
10628
+ } else if (token === 'YY') {
10629
+ 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"));
10630
+ } else if (token === 'D') {
10631
+ 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"));
10632
+ } else if (token === 'DD') {
10633
+ 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"));
10634
+ }
10635
+ }
10636
+
10637
+ var formatDistanceLocale = {
10638
+ lessThanXSeconds: {
10639
+ one: 'less than a second',
10640
+ other: 'less than {{count}} seconds'
10641
+ },
10642
+ xSeconds: {
10643
+ one: '1 second',
10644
+ other: '{{count}} seconds'
10645
+ },
10646
+ halfAMinute: 'half a minute',
10647
+ lessThanXMinutes: {
10648
+ one: 'less than a minute',
10649
+ other: 'less than {{count}} minutes'
10764
10650
  },
10765
- // AM, PM, midnight, noon
10766
- b: function b(date, token, localize) {
10767
- var hours = date.getUTCHours();
10768
- var dayPeriodEnumValue;
10769
- if (hours === 12) {
10770
- dayPeriodEnumValue = dayPeriodEnum.noon;
10771
- } else if (hours === 0) {
10772
- dayPeriodEnumValue = dayPeriodEnum.midnight;
10773
- } else {
10774
- dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
10775
- }
10776
- switch (token) {
10777
- case 'b':
10778
- case 'bb':
10779
- case 'bbb':
10780
- return localize.dayPeriod(dayPeriodEnumValue, {
10781
- width: 'abbreviated',
10782
- context: 'formatting'
10783
- });
10784
- case 'bbbbb':
10785
- return localize.dayPeriod(dayPeriodEnumValue, {
10786
- width: 'narrow',
10787
- context: 'formatting'
10788
- });
10789
- case 'bbbb':
10790
- default:
10791
- return localize.dayPeriod(dayPeriodEnumValue, {
10792
- width: 'wide',
10793
- context: 'formatting'
10794
- });
10795
- }
10651
+ xMinutes: {
10652
+ one: '1 minute',
10653
+ other: '{{count}} minutes'
10796
10654
  },
10797
- // in the morning, in the afternoon, in the evening, at night
10798
- B: function B(date, token, localize) {
10799
- var hours = date.getUTCHours();
10800
- var dayPeriodEnumValue;
10801
- if (hours >= 17) {
10802
- dayPeriodEnumValue = dayPeriodEnum.evening;
10803
- } else if (hours >= 12) {
10804
- dayPeriodEnumValue = dayPeriodEnum.afternoon;
10805
- } else if (hours >= 4) {
10806
- dayPeriodEnumValue = dayPeriodEnum.morning;
10807
- } else {
10808
- dayPeriodEnumValue = dayPeriodEnum.night;
10809
- }
10810
- switch (token) {
10811
- case 'B':
10812
- case 'BB':
10813
- case 'BBB':
10814
- return localize.dayPeriod(dayPeriodEnumValue, {
10815
- width: 'abbreviated',
10816
- context: 'formatting'
10817
- });
10818
- case 'BBBBB':
10819
- return localize.dayPeriod(dayPeriodEnumValue, {
10820
- width: 'narrow',
10821
- context: 'formatting'
10822
- });
10823
- case 'BBBB':
10824
- default:
10825
- return localize.dayPeriod(dayPeriodEnumValue, {
10826
- width: 'wide',
10827
- context: 'formatting'
10828
- });
10829
- }
10655
+ aboutXHours: {
10656
+ one: 'about 1 hour',
10657
+ other: 'about {{count}} hours'
10830
10658
  },
10831
- // Hour [1-12]
10832
- h: function h(date, token, localize) {
10833
- if (token === 'ho') {
10834
- var hours = date.getUTCHours() % 12;
10835
- if (hours === 0) hours = 12;
10836
- return localize.ordinalNumber(hours, {
10837
- unit: 'hour'
10838
- });
10839
- }
10840
- return lightFormatters.h(date, token);
10659
+ xHours: {
10660
+ one: '1 hour',
10661
+ other: '{{count}} hours'
10841
10662
  },
10842
- // Hour [0-23]
10843
- H: function H(date, token, localize) {
10844
- if (token === 'Ho') {
10845
- return localize.ordinalNumber(date.getUTCHours(), {
10846
- unit: 'hour'
10847
- });
10848
- }
10849
- return lightFormatters.H(date, token);
10663
+ xDays: {
10664
+ one: '1 day',
10665
+ other: '{{count}} days'
10850
10666
  },
10851
- // Hour [0-11]
10852
- K: function K(date, token, localize) {
10853
- var hours = date.getUTCHours() % 12;
10854
- if (token === 'Ko') {
10855
- return localize.ordinalNumber(hours, {
10856
- unit: 'hour'
10857
- });
10858
- }
10859
- return addLeadingZeros(hours, token.length);
10667
+ aboutXWeeks: {
10668
+ one: 'about 1 week',
10669
+ other: 'about {{count}} weeks'
10860
10670
  },
10861
- // Hour [1-24]
10862
- k: function k(date, token, localize) {
10863
- var hours = date.getUTCHours();
10864
- if (hours === 0) hours = 24;
10865
- if (token === 'ko') {
10866
- return localize.ordinalNumber(hours, {
10867
- unit: 'hour'
10868
- });
10869
- }
10870
- return addLeadingZeros(hours, token.length);
10671
+ xWeeks: {
10672
+ one: '1 week',
10673
+ other: '{{count}} weeks'
10871
10674
  },
10872
- // Minute
10873
- m: function m(date, token, localize) {
10874
- if (token === 'mo') {
10875
- return localize.ordinalNumber(date.getUTCMinutes(), {
10876
- unit: 'minute'
10877
- });
10878
- }
10879
- return lightFormatters.m(date, token);
10675
+ aboutXMonths: {
10676
+ one: 'about 1 month',
10677
+ other: 'about {{count}} months'
10880
10678
  },
10881
- // Second
10882
- s: function s(date, token, localize) {
10883
- if (token === 'so') {
10884
- return localize.ordinalNumber(date.getUTCSeconds(), {
10885
- unit: 'second'
10886
- });
10887
- }
10888
- return lightFormatters.s(date, token);
10679
+ xMonths: {
10680
+ one: '1 month',
10681
+ other: '{{count}} months'
10889
10682
  },
10890
- // Fraction of second
10891
- S: function S(date, token) {
10892
- return lightFormatters.S(date, token);
10683
+ aboutXYears: {
10684
+ one: 'about 1 year',
10685
+ other: 'about {{count}} years'
10893
10686
  },
10894
- // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
10895
- X: function X(date, token, _localize, options) {
10896
- var originalDate = options._originalDate || date;
10897
- var timezoneOffset = originalDate.getTimezoneOffset();
10898
- if (timezoneOffset === 0) {
10899
- return 'Z';
10687
+ xYears: {
10688
+ one: '1 year',
10689
+ other: '{{count}} years'
10690
+ },
10691
+ overXYears: {
10692
+ one: 'over 1 year',
10693
+ other: 'over {{count}} years'
10694
+ },
10695
+ almostXYears: {
10696
+ one: 'almost 1 year',
10697
+ other: 'almost {{count}} years'
10698
+ }
10699
+ };
10700
+ var formatDistance = function formatDistance(token, count, options) {
10701
+ var result;
10702
+ var tokenValue = formatDistanceLocale[token];
10703
+ if (typeof tokenValue === 'string') {
10704
+ result = tokenValue;
10705
+ } else if (count === 1) {
10706
+ result = tokenValue.one;
10707
+ } else {
10708
+ result = tokenValue.other.replace('{{count}}', count.toString());
10709
+ }
10710
+ if (options !== null && options !== void 0 && options.addSuffix) {
10711
+ if (options.comparison && options.comparison > 0) {
10712
+ return 'in ' + result;
10713
+ } else {
10714
+ return result + ' ago';
10900
10715
  }
10901
- switch (token) {
10902
- // Hours and optional minutes
10903
- case 'X':
10904
- return formatTimezoneWithOptionalMinutes(timezoneOffset);
10905
- // Hours, minutes and optional seconds without `:` delimiter
10906
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10907
- // so this token always has the same output as `XX`
10716
+ }
10717
+ return result;
10718
+ };
10719
+ var formatDistance$1 = formatDistance;
10908
10720
 
10909
- case 'XXXX':
10910
- case 'XX':
10911
- // Hours and minutes without `:` delimiter
10912
- return formatTimezone(timezoneOffset);
10913
- // Hours, minutes and optional seconds with `:` delimiter
10914
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10915
- // so this token always has the same output as `XXX`
10721
+ function buildFormatLongFn(args) {
10722
+ return function () {
10723
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
10724
+ // TODO: Remove String()
10725
+ var width = options.width ? String(options.width) : args.defaultWidth;
10726
+ var format = args.formats[width] || args.formats[args.defaultWidth];
10727
+ return format;
10728
+ };
10729
+ }
10730
+
10731
+ var dateFormats = {
10732
+ full: 'EEEE, MMMM do, y',
10733
+ "long": 'MMMM do, y',
10734
+ medium: 'MMM d, y',
10735
+ "short": 'MM/dd/yyyy'
10736
+ };
10737
+ var timeFormats = {
10738
+ full: 'h:mm:ss a zzzz',
10739
+ "long": 'h:mm:ss a z',
10740
+ medium: 'h:mm:ss a',
10741
+ "short": 'h:mm a'
10742
+ };
10743
+ var dateTimeFormats = {
10744
+ full: "{{date}} 'at' {{time}}",
10745
+ "long": "{{date}} 'at' {{time}}",
10746
+ medium: '{{date}}, {{time}}',
10747
+ "short": '{{date}}, {{time}}'
10748
+ };
10749
+ var formatLong = {
10750
+ date: buildFormatLongFn({
10751
+ formats: dateFormats,
10752
+ defaultWidth: 'full'
10753
+ }),
10754
+ time: buildFormatLongFn({
10755
+ formats: timeFormats,
10756
+ defaultWidth: 'full'
10757
+ }),
10758
+ dateTime: buildFormatLongFn({
10759
+ formats: dateTimeFormats,
10760
+ defaultWidth: 'full'
10761
+ })
10762
+ };
10763
+ var formatLong$1 = formatLong;
10916
10764
 
10917
- case 'XXXXX':
10918
- case 'XXX': // Hours and minutes with `:` delimiter
10765
+ var formatRelativeLocale = {
10766
+ lastWeek: "'last' eeee 'at' p",
10767
+ yesterday: "'yesterday at' p",
10768
+ today: "'today at' p",
10769
+ tomorrow: "'tomorrow at' p",
10770
+ nextWeek: "eeee 'at' p",
10771
+ other: 'P'
10772
+ };
10773
+ var formatRelative = function formatRelative(token, _date, _baseDate, _options) {
10774
+ return formatRelativeLocale[token];
10775
+ };
10776
+ var formatRelative$1 = formatRelative;
10919
10777
 
10920
- default:
10921
- return formatTimezone(timezoneOffset, ':');
10778
+ function buildLocalizeFn(args) {
10779
+ return function (dirtyIndex, options) {
10780
+ var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';
10781
+ var valuesArray;
10782
+ if (context === 'formatting' && args.formattingValues) {
10783
+ var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
10784
+ var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
10785
+ valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
10786
+ } else {
10787
+ var _defaultWidth = args.defaultWidth;
10788
+ var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
10789
+ valuesArray = args.values[_width] || args.values[_defaultWidth];
10922
10790
  }
10923
- },
10924
- // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
10925
- x: function x(date, token, _localize, options) {
10926
- var originalDate = options._originalDate || date;
10927
- var timezoneOffset = originalDate.getTimezoneOffset();
10928
- switch (token) {
10929
- // Hours and optional minutes
10930
- case 'x':
10931
- return formatTimezoneWithOptionalMinutes(timezoneOffset);
10932
- // Hours, minutes and optional seconds without `:` delimiter
10933
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10934
- // so this token always has the same output as `xx`
10935
-
10936
- case 'xxxx':
10937
- case 'xx':
10938
- // Hours and minutes without `:` delimiter
10939
- return formatTimezone(timezoneOffset);
10940
- // Hours, minutes and optional seconds with `:` delimiter
10941
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10942
- // so this token always has the same output as `xxx`
10791
+ var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
10792
+ // @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!
10793
+ return valuesArray[index];
10794
+ };
10795
+ }
10943
10796
 
10944
- case 'xxxxx':
10945
- case 'xxx': // Hours and minutes with `:` delimiter
10797
+ var eraValues = {
10798
+ narrow: ['B', 'A'],
10799
+ abbreviated: ['BC', 'AD'],
10800
+ wide: ['Before Christ', 'Anno Domini']
10801
+ };
10802
+ var quarterValues = {
10803
+ narrow: ['1', '2', '3', '4'],
10804
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
10805
+ wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
10806
+ };
10946
10807
 
10947
- default:
10948
- return formatTimezone(timezoneOffset, ':');
10949
- }
10808
+ // Note: in English, the names of days of the week and months are capitalized.
10809
+ // If you are making a new locale based on this one, check if the same is true for the language you're working on.
10810
+ // Generally, formatted dates should look like they are in the middle of a sentence,
10811
+ // e.g. in Spanish language the weekdays and months should be in the lowercase.
10812
+ var monthValues = {
10813
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
10814
+ abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
10815
+ wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
10816
+ };
10817
+ var dayValues = {
10818
+ narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
10819
+ "short": ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
10820
+ abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
10821
+ wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
10822
+ };
10823
+ var dayPeriodValues = {
10824
+ narrow: {
10825
+ am: 'a',
10826
+ pm: 'p',
10827
+ midnight: 'mi',
10828
+ noon: 'n',
10829
+ morning: 'morning',
10830
+ afternoon: 'afternoon',
10831
+ evening: 'evening',
10832
+ night: 'night'
10950
10833
  },
10951
- // Timezone (GMT)
10952
- O: function O(date, token, _localize, options) {
10953
- var originalDate = options._originalDate || date;
10954
- var timezoneOffset = originalDate.getTimezoneOffset();
10955
- switch (token) {
10956
- // Short
10957
- case 'O':
10958
- case 'OO':
10959
- case 'OOO':
10960
- return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
10961
- // Long
10962
-
10963
- case 'OOOO':
10964
- default:
10965
- return 'GMT' + formatTimezone(timezoneOffset, ':');
10966
- }
10834
+ abbreviated: {
10835
+ am: 'AM',
10836
+ pm: 'PM',
10837
+ midnight: 'midnight',
10838
+ noon: 'noon',
10839
+ morning: 'morning',
10840
+ afternoon: 'afternoon',
10841
+ evening: 'evening',
10842
+ night: 'night'
10967
10843
  },
10968
- // Timezone (specific non-location)
10969
- z: function z(date, token, _localize, options) {
10970
- var originalDate = options._originalDate || date;
10971
- var timezoneOffset = originalDate.getTimezoneOffset();
10972
- switch (token) {
10973
- // Short
10974
- case 'z':
10975
- case 'zz':
10976
- case 'zzz':
10977
- return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
10978
- // Long
10979
-
10980
- case 'zzzz':
10981
- default:
10982
- return 'GMT' + formatTimezone(timezoneOffset, ':');
10983
- }
10844
+ wide: {
10845
+ am: 'a.m.',
10846
+ pm: 'p.m.',
10847
+ midnight: 'midnight',
10848
+ noon: 'noon',
10849
+ morning: 'morning',
10850
+ afternoon: 'afternoon',
10851
+ evening: 'evening',
10852
+ night: 'night'
10853
+ }
10854
+ };
10855
+ var formattingDayPeriodValues = {
10856
+ narrow: {
10857
+ am: 'a',
10858
+ pm: 'p',
10859
+ midnight: 'mi',
10860
+ noon: 'n',
10861
+ morning: 'in the morning',
10862
+ afternoon: 'in the afternoon',
10863
+ evening: 'in the evening',
10864
+ night: 'at night'
10984
10865
  },
10985
- // Seconds timestamp
10986
- t: function t(date, token, _localize, options) {
10987
- var originalDate = options._originalDate || date;
10988
- var timestamp = Math.floor(originalDate.getTime() / 1000);
10989
- return addLeadingZeros(timestamp, token.length);
10866
+ abbreviated: {
10867
+ am: 'AM',
10868
+ pm: 'PM',
10869
+ midnight: 'midnight',
10870
+ noon: 'noon',
10871
+ morning: 'in the morning',
10872
+ afternoon: 'in the afternoon',
10873
+ evening: 'in the evening',
10874
+ night: 'at night'
10990
10875
  },
10991
- // Milliseconds timestamp
10992
- T: function T(date, token, _localize, options) {
10993
- var originalDate = options._originalDate || date;
10994
- var timestamp = originalDate.getTime();
10995
- return addLeadingZeros(timestamp, token.length);
10876
+ wide: {
10877
+ am: 'a.m.',
10878
+ pm: 'p.m.',
10879
+ midnight: 'midnight',
10880
+ noon: 'noon',
10881
+ morning: 'in the morning',
10882
+ afternoon: 'in the afternoon',
10883
+ evening: 'in the evening',
10884
+ night: 'at night'
10996
10885
  }
10997
10886
  };
10998
- function formatTimezoneShort(offset, dirtyDelimiter) {
10999
- var sign = offset > 0 ? '-' : '+';
11000
- var absOffset = Math.abs(offset);
11001
- var hours = Math.floor(absOffset / 60);
11002
- var minutes = absOffset % 60;
11003
- if (minutes === 0) {
11004
- return sign + String(hours);
11005
- }
11006
- var delimiter = dirtyDelimiter || '';
11007
- return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
11008
- }
11009
- function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
11010
- if (offset % 60 === 0) {
11011
- var sign = offset > 0 ? '-' : '+';
11012
- return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
10887
+ var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
10888
+ var number = Number(dirtyNumber);
10889
+
10890
+ // If ordinal numbers depend on context, for example,
10891
+ // if they are different for different grammatical genders,
10892
+ // use `options.unit`.
10893
+ //
10894
+ // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
10895
+ // 'day', 'hour', 'minute', 'second'.
10896
+
10897
+ var rem100 = number % 100;
10898
+ if (rem100 > 20 || rem100 < 10) {
10899
+ switch (rem100 % 10) {
10900
+ case 1:
10901
+ return number + 'st';
10902
+ case 2:
10903
+ return number + 'nd';
10904
+ case 3:
10905
+ return number + 'rd';
10906
+ }
11013
10907
  }
11014
- return formatTimezone(offset, dirtyDelimiter);
11015
- }
11016
- function formatTimezone(offset, dirtyDelimiter) {
11017
- var delimiter = dirtyDelimiter || '';
11018
- var sign = offset > 0 ? '-' : '+';
11019
- var absOffset = Math.abs(offset);
11020
- var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
11021
- var minutes = addLeadingZeros(absOffset % 60, 2);
11022
- return sign + hours + delimiter + minutes;
10908
+ return number + 'th';
10909
+ };
10910
+ var localize = {
10911
+ ordinalNumber: ordinalNumber,
10912
+ era: buildLocalizeFn({
10913
+ values: eraValues,
10914
+ defaultWidth: 'wide'
10915
+ }),
10916
+ quarter: buildLocalizeFn({
10917
+ values: quarterValues,
10918
+ defaultWidth: 'wide',
10919
+ argumentCallback: function argumentCallback(quarter) {
10920
+ return quarter - 1;
10921
+ }
10922
+ }),
10923
+ month: buildLocalizeFn({
10924
+ values: monthValues,
10925
+ defaultWidth: 'wide'
10926
+ }),
10927
+ day: buildLocalizeFn({
10928
+ values: dayValues,
10929
+ defaultWidth: 'wide'
10930
+ }),
10931
+ dayPeriod: buildLocalizeFn({
10932
+ values: dayPeriodValues,
10933
+ defaultWidth: 'wide',
10934
+ formattingValues: formattingDayPeriodValues,
10935
+ defaultFormattingWidth: 'wide'
10936
+ })
10937
+ };
10938
+ var localize$1 = localize;
10939
+
10940
+ function buildMatchFn(args) {
10941
+ return function (string) {
10942
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
10943
+ var width = options.width;
10944
+ var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
10945
+ var matchResult = string.match(matchPattern);
10946
+ if (!matchResult) {
10947
+ return null;
10948
+ }
10949
+ var matchedString = matchResult[0];
10950
+ var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
10951
+ var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
10952
+ return pattern.test(matchedString);
10953
+ }) : findKey(parsePatterns, function (pattern) {
10954
+ return pattern.test(matchedString);
10955
+ });
10956
+ var value;
10957
+ value = args.valueCallback ? args.valueCallback(key) : key;
10958
+ value = options.valueCallback ? options.valueCallback(value) : value;
10959
+ var rest = string.slice(matchedString.length);
10960
+ return {
10961
+ value: value,
10962
+ rest: rest
10963
+ };
10964
+ };
11023
10965
  }
11024
- var formatters$1 = formatters;
11025
-
11026
- function dateLongFormatter(pattern, formatLong) {
11027
- switch (pattern) {
11028
- case 'P':
11029
- return formatLong.date({
11030
- width: 'short'
11031
- });
11032
- case 'PP':
11033
- return formatLong.date({
11034
- width: 'medium'
11035
- });
11036
- case 'PPP':
11037
- return formatLong.date({
11038
- width: 'long'
11039
- });
11040
- case 'PPPP':
11041
- default:
11042
- return formatLong.date({
11043
- width: 'full'
11044
- });
10966
+ function findKey(object, predicate) {
10967
+ for (var key in object) {
10968
+ if (object.hasOwnProperty(key) && predicate(object[key])) {
10969
+ return key;
10970
+ }
11045
10971
  }
10972
+ return undefined;
11046
10973
  }
11047
- function timeLongFormatter(pattern, formatLong) {
11048
- switch (pattern) {
11049
- case 'p':
11050
- return formatLong.time({
11051
- width: 'short'
11052
- });
11053
- case 'pp':
11054
- return formatLong.time({
11055
- width: 'medium'
11056
- });
11057
- case 'ppp':
11058
- return formatLong.time({
11059
- width: 'long'
11060
- });
11061
- case 'pppp':
11062
- default:
11063
- return formatLong.time({
11064
- width: 'full'
11065
- });
10974
+ function findIndex(array, predicate) {
10975
+ for (var key = 0; key < array.length; key++) {
10976
+ if (predicate(array[key])) {
10977
+ return key;
10978
+ }
11066
10979
  }
10980
+ return undefined;
11067
10981
  }
11068
- function dateTimeLongFormatter(pattern, formatLong) {
11069
- var matchResult = pattern.match(/(P+)(p+)?/);
11070
- var datePattern = matchResult[1];
11071
- var timePattern = matchResult[2];
11072
- if (!timePattern) {
11073
- return dateLongFormatter(pattern, formatLong);
11074
- }
11075
- var dateTimeFormat;
11076
- switch (datePattern) {
11077
- case 'P':
11078
- dateTimeFormat = formatLong.dateTime({
11079
- width: 'short'
11080
- });
11081
- break;
11082
- case 'PP':
11083
- dateTimeFormat = formatLong.dateTime({
11084
- width: 'medium'
11085
- });
11086
- break;
11087
- case 'PPP':
11088
- dateTimeFormat = formatLong.dateTime({
11089
- width: 'long'
11090
- });
11091
- break;
11092
- case 'PPPP':
11093
- default:
11094
- dateTimeFormat = formatLong.dateTime({
11095
- width: 'full'
11096
- });
11097
- break;
11098
- }
11099
- return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
10982
+
10983
+ function buildMatchPatternFn(args) {
10984
+ return function (string) {
10985
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
10986
+ var matchResult = string.match(args.matchPattern);
10987
+ if (!matchResult) return null;
10988
+ var matchedString = matchResult[0];
10989
+ var parseResult = string.match(args.parsePattern);
10990
+ if (!parseResult) return null;
10991
+ var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
10992
+ value = options.valueCallback ? options.valueCallback(value) : value;
10993
+ var rest = string.slice(matchedString.length);
10994
+ return {
10995
+ value: value,
10996
+ rest: rest
10997
+ };
10998
+ };
11100
10999
  }
11101
- var longFormatters = {
11102
- p: timeLongFormatter,
11103
- P: dateTimeLongFormatter
11000
+
11001
+ var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
11002
+ var parseOrdinalNumberPattern = /\d+/i;
11003
+ var matchEraPatterns = {
11004
+ narrow: /^(b|a)/i,
11005
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
11006
+ wide: /^(before christ|before common era|anno domini|common era)/i
11104
11007
  };
11105
- var longFormatters$1 = longFormatters;
11008
+ var parseEraPatterns = {
11009
+ any: [/^b/i, /^(a|c)/i]
11010
+ };
11011
+ var matchQuarterPatterns = {
11012
+ narrow: /^[1234]/i,
11013
+ abbreviated: /^q[1234]/i,
11014
+ wide: /^[1234](th|st|nd|rd)? quarter/i
11015
+ };
11016
+ var parseQuarterPatterns = {
11017
+ any: [/1/i, /2/i, /3/i, /4/i]
11018
+ };
11019
+ var matchMonthPatterns = {
11020
+ narrow: /^[jfmasond]/i,
11021
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
11022
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
11023
+ };
11024
+ var parseMonthPatterns = {
11025
+ 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],
11026
+ 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]
11027
+ };
11028
+ var matchDayPatterns = {
11029
+ narrow: /^[smtwf]/i,
11030
+ "short": /^(su|mo|tu|we|th|fr|sa)/i,
11031
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
11032
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
11033
+ };
11034
+ var parseDayPatterns = {
11035
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
11036
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
11037
+ };
11038
+ var matchDayPeriodPatterns = {
11039
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
11040
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
11041
+ };
11042
+ var parseDayPeriodPatterns = {
11043
+ any: {
11044
+ am: /^a/i,
11045
+ pm: /^p/i,
11046
+ midnight: /^mi/i,
11047
+ noon: /^no/i,
11048
+ morning: /morning/i,
11049
+ afternoon: /afternoon/i,
11050
+ evening: /evening/i,
11051
+ night: /night/i
11052
+ }
11053
+ };
11054
+ var match = {
11055
+ ordinalNumber: buildMatchPatternFn({
11056
+ matchPattern: matchOrdinalNumberPattern,
11057
+ parsePattern: parseOrdinalNumberPattern,
11058
+ valueCallback: function valueCallback(value) {
11059
+ return parseInt(value, 10);
11060
+ }
11061
+ }),
11062
+ era: buildMatchFn({
11063
+ matchPatterns: matchEraPatterns,
11064
+ defaultMatchWidth: 'wide',
11065
+ parsePatterns: parseEraPatterns,
11066
+ defaultParseWidth: 'any'
11067
+ }),
11068
+ quarter: buildMatchFn({
11069
+ matchPatterns: matchQuarterPatterns,
11070
+ defaultMatchWidth: 'wide',
11071
+ parsePatterns: parseQuarterPatterns,
11072
+ defaultParseWidth: 'any',
11073
+ valueCallback: function valueCallback(index) {
11074
+ return index + 1;
11075
+ }
11076
+ }),
11077
+ month: buildMatchFn({
11078
+ matchPatterns: matchMonthPatterns,
11079
+ defaultMatchWidth: 'wide',
11080
+ parsePatterns: parseMonthPatterns,
11081
+ defaultParseWidth: 'any'
11082
+ }),
11083
+ day: buildMatchFn({
11084
+ matchPatterns: matchDayPatterns,
11085
+ defaultMatchWidth: 'wide',
11086
+ parsePatterns: parseDayPatterns,
11087
+ defaultParseWidth: 'any'
11088
+ }),
11089
+ dayPeriod: buildMatchFn({
11090
+ matchPatterns: matchDayPeriodPatterns,
11091
+ defaultMatchWidth: 'any',
11092
+ parsePatterns: parseDayPeriodPatterns,
11093
+ defaultParseWidth: 'any'
11094
+ })
11095
+ };
11096
+ var match$1 = match;
11106
11097
 
11107
- var MILLISECONDS_IN_MINUTE = 60000;
11108
- function getDateMillisecondsPart(date) {
11109
- return date.getTime() % MILLISECONDS_IN_MINUTE;
11110
- }
11111
11098
  /**
11112
- * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
11113
- * They usually appear for dates that denote time before the timezones were introduced
11114
- * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
11115
- * and GMT+01:00:00 after that date)
11116
- *
11117
- * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
11118
- * which would lead to incorrect calculations.
11119
- *
11120
- * This function returns the timezone offset in milliseconds that takes seconds in account.
11099
+ * @type {Locale}
11100
+ * @category Locales
11101
+ * @summary English locale (United States).
11102
+ * @language English
11103
+ * @iso-639-2 eng
11104
+ * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
11105
+ * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
11121
11106
  */
11122
-
11123
- function getTimezoneOffsetInMilliseconds(dirtyDate) {
11124
- var date = new Date(dirtyDate.getTime());
11125
- var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());
11126
- date.setSeconds(0, 0);
11127
- var hasNegativeUTCOffset = baseTimezoneOffset > 0;
11128
- var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);
11129
- return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;
11130
- }
11131
-
11132
- var protectedDayOfYearTokens = ['D', 'DD'];
11133
- var protectedWeekYearTokens = ['YY', 'YYYY'];
11134
- function isProtectedDayOfYearToken(token) {
11135
- return protectedDayOfYearTokens.indexOf(token) !== -1;
11136
- }
11137
- function isProtectedWeekYearToken(token) {
11138
- return protectedWeekYearTokens.indexOf(token) !== -1;
11139
- }
11140
- function throwProtectedError(token, format, input) {
11141
- if (token === 'YYYY') {
11142
- throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
11143
- } else if (token === 'YY') {
11144
- throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
11145
- } else if (token === 'D') {
11146
- 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"));
11147
- } else if (token === 'DD') {
11148
- 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"));
11107
+ var locale = {
11108
+ code: 'en-US',
11109
+ formatDistance: formatDistance$1,
11110
+ formatLong: formatLong$1,
11111
+ formatRelative: formatRelative$1,
11112
+ localize: localize$1,
11113
+ match: match$1,
11114
+ options: {
11115
+ weekStartsOn: 0 /* Sunday */,
11116
+ firstWeekContainsDate: 1
11149
11117
  }
11150
- }
11118
+ };
11119
+ var defaultLocale = locale;
11151
11120
 
11152
11121
  // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
11153
11122
  // (one of the certain letters followed by `o`)
@@ -11159,14 +11128,15 @@ function throwProtectedError(token, format, input) {
11159
11128
  // If there is no matching single quote
11160
11129
  // then the sequence will continue until the end of the string.
11161
11130
  // - . matches any single character unmatched by previous parts of the RegExps
11131
+ var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
11162
11132
 
11163
- var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also
11133
+ // This RegExp catches symbols escaped by quotes, and also
11164
11134
  // sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
11165
-
11166
11135
  var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
11167
11136
  var escapedStringRegExp = /^'([^]*?)'?$/;
11168
11137
  var doubleQuoteRegExp = /''/g;
11169
11138
  var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11139
+
11170
11140
  /**
11171
11141
  * @name format
11172
11142
  * @category Common Helpers
@@ -11176,7 +11146,7 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11176
11146
  * Return the formatted date string in the given format. The result may vary by locale.
11177
11147
  *
11178
11148
  * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
11179
- * > See: https://git.io/fxCyr
11149
+ * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
11180
11150
  *
11181
11151
  * The characters wrapped between two single quotes characters (') are escaped.
11182
11152
  * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
@@ -11255,32 +11225,34 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11255
11225
  * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
11256
11226
  * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
11257
11227
  * | | EEEEE | M, T, W, T, F, S, S | |
11258
- * | | EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | |
11228
+ * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
11259
11229
  * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
11260
11230
  * | | io | 1st, 2nd, ..., 7th | 7 |
11261
11231
  * | | ii | 01, 02, ..., 07 | 7 |
11262
11232
  * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
11263
11233
  * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
11264
11234
  * | | iiiii | M, T, W, T, F, S, S | 7 |
11265
- * | | iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | 7 |
11235
+ * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
11266
11236
  * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
11267
11237
  * | | eo | 2nd, 3rd, ..., 1st | 7 |
11268
11238
  * | | ee | 02, 03, ..., 01 | |
11269
11239
  * | | eee | Mon, Tue, Wed, ..., Sun | |
11270
11240
  * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
11271
11241
  * | | eeeee | M, T, W, T, F, S, S | |
11272
- * | | eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | |
11242
+ * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
11273
11243
  * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
11274
11244
  * | | co | 2nd, 3rd, ..., 1st | 7 |
11275
11245
  * | | cc | 02, 03, ..., 01 | |
11276
11246
  * | | ccc | Mon, Tue, Wed, ..., Sun | |
11277
11247
  * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
11278
11248
  * | | ccccc | M, T, W, T, F, S, S | |
11279
- * | | cccccc | Mo, Tu, We, Th, Fr, Su, Sa | |
11280
- * | AM, PM | a..aaa | AM, PM | |
11249
+ * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
11250
+ * | AM, PM | a..aa | AM, PM | |
11251
+ * | | aaa | am, pm | |
11281
11252
  * | | aaaa | a.m., p.m. | 2 |
11282
11253
  * | | aaaaa | a, p | |
11283
- * | AM, PM, noon, midnight | b..bbb | AM, PM, noon, midnight | |
11254
+ * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
11255
+ * | | bbb | am, pm, noon, midnight | |
11284
11256
  * | | bbbb | a.m., p.m., noon, midnight | 2 |
11285
11257
  * | | bbbbb | a, p, n, mi | |
11286
11258
  * | Flexible day period | B..BBB | at night, in the morning, ... | |
@@ -11306,7 +11278,7 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11306
11278
  * | | ss | 00, 01, ..., 59 | |
11307
11279
  * | Fraction of second | S | 0, 1, ..., 9 | |
11308
11280
  * | | SS | 00, 01, ..., 99 | |
11309
- * | | SSS | 000, 0001, ..., 999 | |
11281
+ * | | SSS | 000, 001, ..., 999 | |
11310
11282
  * | | SSSS | ... | 3 |
11311
11283
  * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
11312
11284
  * | | XX | -0800, +0530, Z | |
@@ -11326,18 +11298,18 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11326
11298
  * | | tt | ... | 3,7 |
11327
11299
  * | Milliseconds timestamp | T | 512969520900 | 7 |
11328
11300
  * | | TT | ... | 3,7 |
11329
- * | Long localized date | P | 05/29/1453 | 7 |
11330
- * | | PP | May 29, 1453 | 7 |
11331
- * | | PPP | May 29th, 1453 | 7 |
11332
- * | | PPPP | Sunday, May 29th, 1453 | 2,7 |
11301
+ * | Long localized date | P | 04/29/1453 | 7 |
11302
+ * | | PP | Apr 29, 1453 | 7 |
11303
+ * | | PPP | April 29th, 1453 | 7 |
11304
+ * | | PPPP | Friday, April 29th, 1453 | 2,7 |
11333
11305
  * | Long localized time | p | 12:00 AM | 7 |
11334
11306
  * | | pp | 12:00:00 AM | 7 |
11335
11307
  * | | ppp | 12:00:00 AM GMT+2 | 7 |
11336
11308
  * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
11337
- * | Combination of date and time | Pp | 05/29/1453, 12:00 AM | 7 |
11338
- * | | PPpp | May 29, 1453, 12:00:00 AM | 7 |
11339
- * | | PPPppp | May 29th, 1453 at ... | 7 |
11340
- * | | PPPPpppp| Sunday, May 29th, 1453 at ... | 2,7 |
11309
+ * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
11310
+ * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
11311
+ * | | PPPppp | April 29th, 1453 at ... | 7 |
11312
+ * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
11341
11313
  * Notes:
11342
11314
  * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
11343
11315
  * are the same as "stand-alone" units, but are different in some languages.
@@ -11410,30 +11382,10 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11410
11382
  * - `p`: long localized time
11411
11383
  *
11412
11384
  * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
11413
- * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr
11414
- *
11415
- * 9. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.
11416
- * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr
11417
- *
11418
- * ### v2.0.0 breaking changes:
11419
- *
11420
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
11421
- *
11422
- * - The second argument is now required for the sake of explicitness.
11423
- *
11424
- * ```javascript
11425
- * // Before v2.0.0
11426
- * format(new Date(2016, 0, 1))
11427
- *
11428
- * // v2.0.0 onward
11429
- * format(new Date(2016, 0, 1), "yyyy-MM-dd'T'HH:mm:ss.SSSxxx")
11430
- * ```
11385
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
11431
11386
  *
11432
- * - New format string API for `format` function
11433
- * which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).
11434
- * See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.
11435
- *
11436
- * - Characters are now escaped using single quote symbols (`'`) instead of square brackets.
11387
+ * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
11388
+ * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
11437
11389
  *
11438
11390
  * @param {Date|Number} date - the original date
11439
11391
  * @param {String} format - the string of tokens
@@ -11442,9 +11394,9 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11442
11394
  * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
11443
11395
  * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
11444
11396
  * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
11445
- * see: https://git.io/fxCyr
11397
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
11446
11398
  * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
11447
- * see: https://git.io/fxCyr
11399
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
11448
11400
  * @returns {String} the formatted date string
11449
11401
  * @throws {TypeError} 2 arguments required
11450
11402
  * @throws {RangeError} `date` must not be Invalid Date
@@ -11452,47 +11404,46 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11452
11404
  * @throws {RangeError} `options.locale` must contain `formatLong` property
11453
11405
  * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
11454
11406
  * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
11455
- * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
11456
- * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
11457
- * @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
11458
- * @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
11407
+ * @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
11408
+ * @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
11409
+ * @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
11410
+ * @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
11459
11411
  * @throws {RangeError} format string contains an unescaped latin alphabet character
11460
11412
  *
11461
11413
  * @example
11462
11414
  * // Represent 11 February 2014 in middle-endian format:
11463
- * var result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
11415
+ * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
11464
11416
  * //=> '02/11/2014'
11465
11417
  *
11466
11418
  * @example
11467
11419
  * // Represent 2 July 2014 in Esperanto:
11468
11420
  * import { eoLocale } from 'date-fns/locale/eo'
11469
- * var result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
11421
+ * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
11470
11422
  * locale: eoLocale
11471
11423
  * })
11472
11424
  * //=> '2-a de julio 2014'
11473
11425
  *
11474
11426
  * @example
11475
11427
  * // Escape string by single quote characters:
11476
- * var result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
11428
+ * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
11477
11429
  * //=> "3 o'clock"
11478
11430
  */
11479
11431
 
11480
- function format$1(dirtyDate, dirtyFormatStr, dirtyOptions) {
11432
+ function format(dirtyDate, dirtyFormatStr, options) {
11433
+ 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;
11481
11434
  requiredArgs(2, arguments);
11482
11435
  var formatStr = String(dirtyFormatStr);
11483
- var options = dirtyOptions || {};
11484
- var locale = options.locale || defaultLocale;
11485
- var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;
11486
- var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
11487
- var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
11436
+ var defaultOptions = getDefaultOptions();
11437
+ 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;
11438
+ 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);
11488
11439
 
11440
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
11489
11441
  if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
11490
11442
  throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
11491
11443
  }
11492
- var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;
11493
- var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
11494
- var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
11444
+ 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);
11495
11445
 
11446
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
11496
11447
  if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
11497
11448
  throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
11498
11449
  }
@@ -11505,10 +11456,11 @@ function format$1(dirtyDate, dirtyFormatStr, dirtyOptions) {
11505
11456
  var originalDate = toDate(dirtyDate);
11506
11457
  if (!isValid(originalDate)) {
11507
11458
  throw new RangeError('Invalid time value');
11508
- } // Convert the date in system timezone to the same date in UTC+00:00 timezone.
11459
+ }
11460
+
11461
+ // Convert the date in system timezone to the same date in UTC+00:00 timezone.
11509
11462
  // This ensures that when UTC functions will be implemented, locales will be compatible with them.
11510
11463
  // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
11511
-
11512
11464
  var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
11513
11465
  var utcDate = subMilliseconds(originalDate, timezoneOffset);
11514
11466
  var formatterOptions = {
@@ -11521,7 +11473,7 @@ function format$1(dirtyDate, dirtyFormatStr, dirtyOptions) {
11521
11473
  var firstCharacter = substring[0];
11522
11474
  if (firstCharacter === 'p' || firstCharacter === 'P') {
11523
11475
  var longFormatter = longFormatters$1[firstCharacter];
11524
- return longFormatter(substring, locale.formatLong, formatterOptions);
11476
+ return longFormatter(substring, locale.formatLong);
11525
11477
  }
11526
11478
  return substring;
11527
11479
  }).join('').match(formattingTokensRegExp).map(function (substring) {
@@ -11535,11 +11487,11 @@ function format$1(dirtyDate, dirtyFormatStr, dirtyOptions) {
11535
11487
  }
11536
11488
  var formatter = formatters$1[firstCharacter];
11537
11489
  if (formatter) {
11538
- if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {
11539
- throwProtectedError(substring, dirtyFormatStr, dirtyDate);
11490
+ if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) {
11491
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
11540
11492
  }
11541
- if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {
11542
- throwProtectedError(substring, dirtyFormatStr, dirtyDate);
11493
+ if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) {
11494
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
11543
11495
  }
11544
11496
  return formatter(utcDate, substring, locale.localize, formatterOptions);
11545
11497
  }
@@ -11551,23 +11503,28 @@ function format$1(dirtyDate, dirtyFormatStr, dirtyOptions) {
11551
11503
  return result;
11552
11504
  }
11553
11505
  function cleanEscapedString(input) {
11554
- return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
11506
+ var matched = input.match(escapedStringRegExp);
11507
+ if (!matched) {
11508
+ return input;
11509
+ }
11510
+ return matched[1].replace(doubleQuoteRegExp, "'");
11555
11511
  }
11556
11512
 
11557
- function convertToFP(fn, arity, a) {
11558
- a = a || [];
11513
+ function convertToFP(fn, arity) {
11514
+ var a = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
11559
11515
  if (a.length >= arity) {
11560
11516
  return fn.apply(null, a.slice(0, arity).reverse());
11561
11517
  }
11562
11518
  return function () {
11563
- var args = Array.prototype.slice.call(arguments);
11519
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
11520
+ args[_key] = arguments[_key];
11521
+ }
11564
11522
  return convertToFP(fn, arity, a.concat(args));
11565
11523
  };
11566
11524
  }
11567
11525
 
11568
- // This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
11569
- var format = convertToFP(format$1, 2);
11570
- var formatTime = format;
11526
+ // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
11527
+ var formatTime = convertToFP(format, 2);
11571
11528
 
11572
11529
  var Wrapper = index$9(View)(function () {
11573
11530
  return {
@@ -12333,7 +12290,7 @@ var StyledPageControlWrapper = index$9(View)(function (_ref7) {
12333
12290
  });
12334
12291
 
12335
12292
  function isCarouselImageProps(image) {
12336
- return _typeof(image) === 'object';
12293
+ return _typeof$1(image) === 'object';
12337
12294
  }
12338
12295
  var CarouselItem = function CarouselItem(_ref) {
12339
12296
  var width = _ref.width,
@@ -18794,7 +18751,7 @@ var scheduler_production_min = {};
18794
18751
  var c = a.sortIndex - b.sortIndex;
18795
18752
  return 0 !== c ? c : a.id - b.id;
18796
18753
  }
18797
- if ("object" === (typeof performance === "undefined" ? "undefined" : _typeof(performance)) && "function" === typeof performance.now) {
18754
+ if ("object" === (typeof performance === "undefined" ? "undefined" : _typeof$1(performance)) && "function" === typeof performance.now) {
18798
18755
  var l = performance;
18799
18756
  exports.unstable_now = function () {
18800
18757
  return l.now();
@@ -18965,7 +18922,7 @@ var scheduler_production_min = {};
18965
18922
  };
18966
18923
  exports.unstable_scheduleCallback = function (a, b, c) {
18967
18924
  var d = exports.unstable_now();
18968
- "object" === _typeof(c) && null !== c ? (c = c.delay, c = "number" === typeof c && 0 < c ? d + c : d) : c = d;
18925
+ "object" === _typeof$1(c) && null !== c ? (c = c.delay, c = "number" === typeof c && 0 < c ? d + c : d) : c = d;
18969
18926
  switch (a) {
18970
18927
  case 1:
18971
18928
  var e = -1;
@@ -19043,7 +19000,7 @@ function oa(a) {
19043
19000
  }
19044
19001
  function pa(a, b, c, d) {
19045
19002
  if (null !== c && 0 === c.type) return !1;
19046
- switch (_typeof(b)) {
19003
+ switch (_typeof$1(b)) {
19047
19004
  case "function":
19048
19005
  case "symbol":
19049
19006
  return !0;
@@ -19153,7 +19110,7 @@ var ua = aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
19153
19110
  var Ia = Symbol["for"]("react.offscreen");
19154
19111
  var Ja = Symbol.iterator;
19155
19112
  function Ka(a) {
19156
- if (null === a || "object" !== _typeof(a)) return null;
19113
+ if (null === a || "object" !== _typeof$1(a)) return null;
19157
19114
  a = Ja && a[Ja] || a["@@iterator"];
19158
19115
  return "function" === typeof a ? a : null;
19159
19116
  }
@@ -19182,7 +19139,7 @@ function Oa(a, b) {
19182
19139
  set: function set() {
19183
19140
  throw Error();
19184
19141
  }
19185
- }), "object" === (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && Reflect.construct) {
19142
+ }), "object" === (typeof Reflect === "undefined" ? "undefined" : _typeof$1(Reflect)) && Reflect.construct) {
19186
19143
  try {
19187
19144
  Reflect.construct(b, []);
19188
19145
  } catch (l) {
@@ -19264,7 +19221,7 @@ function Qa(a) {
19264
19221
  case Fa:
19265
19222
  return "SuspenseList";
19266
19223
  }
19267
- if ("object" === _typeof(a)) switch (a.$$typeof) {
19224
+ if ("object" === _typeof$1(a)) switch (a.$$typeof) {
19268
19225
  case Ca:
19269
19226
  return (a.displayName || "Context") + ".Consumer";
19270
19227
  case Ba:
@@ -19336,7 +19293,7 @@ function Ra(a) {
19336
19293
  return null;
19337
19294
  }
19338
19295
  function Sa(a) {
19339
- switch (_typeof(a)) {
19296
+ switch (_typeof$1(a)) {
19340
19297
  case "boolean":
19341
19298
  case "number":
19342
19299
  case "string":
@@ -19647,9 +19604,9 @@ function ub(a, b) {
19647
19604
  if (tb[a] && (null != b.children || null != b.dangerouslySetInnerHTML)) throw Error(p(137, a));
19648
19605
  if (null != b.dangerouslySetInnerHTML) {
19649
19606
  if (null != b.children) throw Error(p(60));
19650
- if ("object" !== _typeof(b.dangerouslySetInnerHTML) || !("__html" in b.dangerouslySetInnerHTML)) throw Error(p(61));
19607
+ if ("object" !== _typeof$1(b.dangerouslySetInnerHTML) || !("__html" in b.dangerouslySetInnerHTML)) throw Error(p(61));
19651
19608
  }
19652
- if (null != b.style && "object" !== _typeof(b.style)) throw Error(p(62));
19609
+ if (null != b.style && "object" !== _typeof$1(b.style)) throw Error(p(62));
19653
19610
  }
19654
19611
  }
19655
19612
  function vb(a, b) {
@@ -19735,7 +19692,7 @@ function Kb(a, b) {
19735
19692
  a = !1;
19736
19693
  }
19737
19694
  if (a) return null;
19738
- if (c && "function" !== typeof c) throw Error(p(231, b, _typeof(c)));
19695
+ if (c && "function" !== typeof c) throw Error(p(231, b, _typeof$1(c)));
19739
19696
  return c;
19740
19697
  }
19741
19698
  var Lb = !1;
@@ -20649,7 +20606,7 @@ function ge(a, b) {
20649
20606
  }
20650
20607
  function he(a) {
20651
20608
  a = a.detail;
20652
- return "object" === _typeof(a) && "data" in a ? a.data : null;
20609
+ return "object" === _typeof$1(a) && "data" in a ? a.data : null;
20653
20610
  }
20654
20611
  var ie = !1;
20655
20612
  function je(a, b) {
@@ -20766,7 +20723,7 @@ function Ge(a, b) {
20766
20723
  var He = "function" === typeof Object.is ? Object.is : Ge;
20767
20724
  function Ie(a, b) {
20768
20725
  if (He(a, b)) return !0;
20769
- if ("object" !== _typeof(a) || null === a || "object" !== _typeof(b) || null === b) return !1;
20726
+ if ("object" !== _typeof$1(a) || null === a || "object" !== _typeof$1(b) || null === b) return !1;
20770
20727
  var c = Object.keys(a),
20771
20728
  d = Object.keys(b);
20772
20729
  if (c.length !== d.length) return !1;
@@ -21293,7 +21250,7 @@ function Bf() {}
21293
21250
  var Cf = null,
21294
21251
  Df = null;
21295
21252
  function Ef(a, b) {
21296
- return "textarea" === a || "noscript" === a || "string" === typeof b.children || "number" === typeof b.children || "object" === _typeof(b.dangerouslySetInnerHTML) && null !== b.dangerouslySetInnerHTML && null != b.dangerouslySetInnerHTML.__html;
21253
+ 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;
21297
21254
  }
21298
21255
  var Ff = "function" === typeof setTimeout ? setTimeout : void 0,
21299
21256
  Gf = "function" === typeof clearTimeout ? clearTimeout : void 0,
@@ -21941,7 +21898,7 @@ function ph(a, b, c) {
21941
21898
  var d = !1,
21942
21899
  e = Vf;
21943
21900
  var f = b.contextType;
21944
- "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);
21901
+ "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);
21945
21902
  b = new b(c, f);
21946
21903
  a.memoizedState = null !== b.state && void 0 !== b.state ? b.state : null;
21947
21904
  b.updater = nh;
@@ -21963,7 +21920,7 @@ function rh(a, b, c, d) {
21963
21920
  e.refs = jh;
21964
21921
  ah(a);
21965
21922
  var f = b.contextType;
21966
- "object" === _typeof(f) && null !== f ? e.context = Vg(f) : (f = Zf(b) ? Xf : H.current, e.context = Yf(a, f));
21923
+ "object" === _typeof$1(f) && null !== f ? e.context = Vg(f) : (f = Zf(b) ? Xf : H.current, e.context = Yf(a, f));
21967
21924
  e.state = a.memoizedState;
21968
21925
  f = b.getDerivedStateFromProps;
21969
21926
  "function" === typeof f && (kh(a, b, f, c), e.state = a.memoizedState);
@@ -21972,7 +21929,7 @@ function rh(a, b, c, d) {
21972
21929
  }
21973
21930
  function sh(a, b, c) {
21974
21931
  a = c.ref;
21975
- if (null !== a && "function" !== typeof a && "object" !== _typeof(a)) {
21932
+ if (null !== a && "function" !== typeof a && "object" !== _typeof$1(a)) {
21976
21933
  if (c._owner) {
21977
21934
  c = c._owner;
21978
21935
  if (c) {
@@ -22047,7 +22004,7 @@ function vh(a) {
22047
22004
  function k(a, b, c, d) {
22048
22005
  var f = c.type;
22049
22006
  if (f === ya) return m(a, b, c.props.children, d, c.key);
22050
- 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;
22007
+ 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;
22051
22008
  d = yh(c.type, c.key, c.props, null, a.mode, d);
22052
22009
  d.ref = sh(a, b, c);
22053
22010
  d["return"] = a;
@@ -22067,7 +22024,7 @@ function vh(a) {
22067
22024
  }
22068
22025
  function q(a, b, c) {
22069
22026
  if ("string" === typeof b && "" !== b || "number" === typeof b) return b = xh("" + b, a.mode, c), b["return"] = a, b;
22070
- if ("object" === _typeof(b) && null !== b) {
22027
+ if ("object" === _typeof$1(b) && null !== b) {
22071
22028
  switch (b.$$typeof) {
22072
22029
  case va:
22073
22030
  return c = yh(b.type, b.key, b.props, null, a.mode, c), c.ref = sh(a, null, b), c["return"] = a, c;
@@ -22085,7 +22042,7 @@ function vh(a) {
22085
22042
  function r(a, b, c, d) {
22086
22043
  var e = null !== b ? b.key : null;
22087
22044
  if ("string" === typeof c && "" !== c || "number" === typeof c) return null !== e ? null : h(a, b, "" + c, d);
22088
- if ("object" === _typeof(c) && null !== c) {
22045
+ if ("object" === _typeof$1(c) && null !== c) {
22089
22046
  switch (c.$$typeof) {
22090
22047
  case va:
22091
22048
  return c.key === e ? k(a, b, c, d) : null;
@@ -22101,7 +22058,7 @@ function vh(a) {
22101
22058
  }
22102
22059
  function y(a, b, c, d, e) {
22103
22060
  if ("string" === typeof d && "" !== d || "number" === typeof d) return a = a.get(c) || null, h(b, a, "" + d, e);
22104
- if ("object" === _typeof(d) && null !== d) {
22061
+ if ("object" === _typeof$1(d) && null !== d) {
22105
22062
  switch (d.$$typeof) {
22106
22063
  case va:
22107
22064
  return a = a.get(null === d.key ? c : d.key) || null, k(b, a, d, e);
@@ -22175,8 +22132,8 @@ function vh(a) {
22175
22132
  return l;
22176
22133
  }
22177
22134
  function J(a, d, f, h) {
22178
- "object" === _typeof(f) && null !== f && f.type === ya && null === f.key && (f = f.props.children);
22179
- if ("object" === _typeof(f) && null !== f) {
22135
+ "object" === _typeof$1(f) && null !== f && f.type === ya && null === f.key && (f = f.props.children);
22136
+ if ("object" === _typeof$1(f) && null !== f) {
22180
22137
  switch (f.$$typeof) {
22181
22138
  case va:
22182
22139
  a: {
@@ -22191,7 +22148,7 @@ function vh(a) {
22191
22148
  a = d;
22192
22149
  break a;
22193
22150
  }
22194
- } else if (l.elementType === k || "object" === _typeof(k) && null !== k && k.$$typeof === Ha && uh(k) === l.type) {
22151
+ } else if (l.elementType === k || "object" === _typeof$1(k) && null !== k && k.$$typeof === Ha && uh(k) === l.type) {
22195
22152
  c(a, l.sibling);
22196
22153
  d = e(l, f.props);
22197
22154
  d.ref = sh(a, l, f);
@@ -23076,7 +23033,7 @@ function ij(a, b, c, d, e) {
23076
23033
  g.props = h;
23077
23034
  var k = g.context,
23078
23035
  l = c.contextType;
23079
- "object" === _typeof(l) && null !== l ? l = Vg(l) : (l = Zf(c) ? Xf : H.current, l = Yf(b, l));
23036
+ "object" === _typeof$1(l) && null !== l ? l = Vg(l) : (l = Zf(c) ? Xf : H.current, l = Yf(b, l));
23080
23037
  var m = c.getDerivedStateFromProps,
23081
23038
  q = "function" === typeof m || "function" === typeof g.getSnapshotBeforeUpdate;
23082
23039
  q || "function" !== typeof g.UNSAFE_componentWillReceiveProps && "function" !== typeof g.componentWillReceiveProps || (h !== d || k !== l) && qh(b, g, d, l);
@@ -23095,7 +23052,7 @@ function ij(a, b, c, d, e) {
23095
23052
  q = b.pendingProps;
23096
23053
  r = g.context;
23097
23054
  k = c.contextType;
23098
- "object" === _typeof(k) && null !== k ? k = Vg(k) : (k = Zf(c) ? Xf : H.current, k = Yf(b, k));
23055
+ "object" === _typeof$1(k) && null !== k ? k = Vg(k) : (k = Zf(c) ? Xf : H.current, k = Yf(b, k));
23099
23056
  var y = c.getDerivedStateFromProps;
23100
23057
  (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);
23101
23058
  $g = !1;
@@ -25008,7 +24965,7 @@ function Nk(a, b) {
25008
24965
  k = b;
25009
24966
  b = Z;
25010
24967
  h.flags |= 32768;
25011
- if (null !== k && "object" === _typeof(k) && "function" === typeof k.then) {
24968
+ if (null !== k && "object" === _typeof$1(k) && "function" === typeof k.then) {
25012
24969
  var l = k,
25013
24970
  m = h,
25014
24971
  q = m.tag;
@@ -25429,7 +25386,7 @@ Wk = function Wk(a, b, c) {
25429
25386
  e = Xh(null, b, d, a, e, c);
25430
25387
  var f = bi();
25431
25388
  b.flags |= 1;
25432
- "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);
25389
+ "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);
25433
25390
  return b;
25434
25391
  case 16:
25435
25392
  d = b.elementType;
@@ -25670,7 +25627,7 @@ function yh(a, b, c, d, e, f) {
25670
25627
  case Ia:
25671
25628
  return qj(c, e, f, b);
25672
25629
  default:
25673
- if ("object" === _typeof(a) && null !== a) switch (a.$$typeof) {
25630
+ if ("object" === _typeof$1(a) && null !== a) switch (a.$$typeof) {
25674
25631
  case Ba:
25675
25632
  g = 10;
25676
25633
  break a;
@@ -25688,7 +25645,7 @@ function yh(a, b, c, d, e, f) {
25688
25645
  d = null;
25689
25646
  break a;
25690
25647
  }
25691
- throw Error(p(130, null == a ? a : _typeof(a), ""));
25648
+ throw Error(p(130, null == a ? a : _typeof$1(a), ""));
25692
25649
  }
25693
25650
  b = Bg(g, c, b, e);
25694
25651
  b.elementType = a;
@@ -26182,7 +26139,7 @@ function checkDCE() {
26182
26139
  });
26183
26140
  }, r.t = function (e, t) {
26184
26141
  if (1 & t && (e = r(e)), 8 & t) return e;
26185
- if (4 & t && "object" == _typeof(e) && e && e.__esModule) return e;
26142
+ if (4 & t && "object" == _typeof$1(e) && e && e.__esModule) return e;
26186
26143
  var n = Object.create(null);
26187
26144
  if (r.r(n), Object.defineProperty(n, "default", {
26188
26145
  enumerable: !0,
@@ -26404,7 +26361,7 @@ function checkDCE() {
26404
26361
  }, t.parseHotkey = c, t.compareHotkey = l, t.toKeyCode = d, t.toKeyName = f;
26405
26362
  }, function (e, t) {
26406
26363
  e.exports = function (e) {
26407
- var t = _typeof(e);
26364
+ var t = _typeof$1(e);
26408
26365
  return null != e && ("object" == t || "function" == t);
26409
26366
  };
26410
26367
  }, function (e, t, r) {
@@ -26432,7 +26389,7 @@ function checkDCE() {
26432
26389
  };
26433
26390
  }, function (e, t, r) {
26434
26391
  var n = r(11),
26435
- u = "object" == (typeof self === "undefined" ? "undefined" : _typeof(self)) && self && self.Object === Object && self,
26392
+ u = "object" == (typeof self === "undefined" ? "undefined" : _typeof$1(self)) && self && self.Object === Object && self,
26436
26393
  o = n || u || Function("return this")();
26437
26394
  e.exports = o;
26438
26395
  }, function (e, t, r) {
@@ -26447,7 +26404,7 @@ function checkDCE() {
26447
26404
  };
26448
26405
  }, function (e, t, r) {
26449
26406
  (function (t) {
26450
- var r = "object" == _typeof(t) && t && t.Object === Object && t;
26407
+ var r = "object" == _typeof$1(t) && t && t.Object === Object && t;
26451
26408
  e.exports = r;
26452
26409
  }).call(this, r(12));
26453
26410
  }, function (e, t) {
@@ -26458,7 +26415,7 @@ function checkDCE() {
26458
26415
  try {
26459
26416
  r = r || new Function("return this")();
26460
26417
  } catch (e) {
26461
- "object" == (typeof window === "undefined" ? "undefined" : _typeof(window)) && (r = window);
26418
+ "object" == (typeof window === "undefined" ? "undefined" : _typeof$1(window)) && (r = window);
26462
26419
  }
26463
26420
  e.exports = r;
26464
26421
  }, function (e, t, r) {
@@ -26485,7 +26442,7 @@ function checkDCE() {
26485
26442
  var n = r(15),
26486
26443
  u = r(18);
26487
26444
  e.exports = function (e) {
26488
- return "symbol" == _typeof(e) || u(e) && "[object Symbol]" == n(e);
26445
+ return "symbol" == _typeof$1(e) || u(e) && "[object Symbol]" == n(e);
26489
26446
  };
26490
26447
  }, function (e, t, r) {
26491
26448
  var n = r(8),
@@ -26518,7 +26475,7 @@ function checkDCE() {
26518
26475
  };
26519
26476
  }, function (e, t) {
26520
26477
  e.exports = function (e) {
26521
- return null != e && "object" == _typeof(e);
26478
+ return null != e && "object" == _typeof$1(e);
26522
26479
  };
26523
26480
  }, function (e, t, r) {
26524
26481
 
@@ -26599,7 +26556,7 @@ function checkDCE() {
26599
26556
  }
26600
26557
  function c(e) {
26601
26558
  return !!e && (function (e) {
26602
- if (!e || "object" != _typeof(e)) return !1;
26559
+ if (!e || "object" != _typeof$1(e)) return !1;
26603
26560
  var t = Object.getPrototypeOf(e);
26604
26561
  if (null === t) return !0;
26605
26562
  var r = Object.hasOwnProperty.call(t, "constructor") && t.constructor;
@@ -26608,7 +26565,7 @@ function checkDCE() {
26608
26565
  }
26609
26566
  function l(e, t, r) {
26610
26567
  void 0 === r && (r = !1), 0 === d(e) ? (r ? Object.keys : Z)(e).forEach(function (n) {
26611
- r && "symbol" == _typeof(n) || t(n, e[n], e);
26568
+ r && "symbol" == _typeof$1(n) || t(n, e[n], e);
26612
26569
  }) : e.forEach(function (r, n) {
26613
26570
  return t(n, r, e);
26614
26571
  });
@@ -26664,7 +26621,7 @@ function checkDCE() {
26664
26621
  i(2);
26665
26622
  }
26666
26623
  function b(e) {
26667
- return null == e || "object" != _typeof(e) || Object.isFrozen(e);
26624
+ return null == e || "object" != _typeof$1(e) || Object.isFrozen(e);
26668
26625
  }
26669
26626
  function y(e) {
26670
26627
  var t = Q[e];
@@ -26801,7 +26758,7 @@ function checkDCE() {
26801
26758
  }
26802
26759
  var W,
26803
26760
  V,
26804
- q = "undefined" != typeof Symbol && "symbol" == _typeof(Symbol("x")),
26761
+ q = "undefined" != typeof Symbol && "symbol" == _typeof$1(Symbol("x")),
26805
26762
  H = "undefined" != typeof Map,
26806
26763
  U = "undefined" != typeof Set,
26807
26764
  K = "undefined" != typeof Proxy && void 0 !== Proxy.revocable && "undefined" != typeof Reflect,
@@ -26916,7 +26873,7 @@ function checkDCE() {
26916
26873
  throw w(s), e;
26917
26874
  }) : (F(s, n), k(a, s));
26918
26875
  }
26919
- if (!e || "object" != _typeof(e)) {
26876
+ if (!e || "object" != _typeof$1(e)) {
26920
26877
  if ((a = r(e)) === $) return;
26921
26878
  return void 0 === a && (a = e), t.F && m(a, !0), a;
26922
26879
  }
@@ -31151,7 +31108,7 @@ function checkDCE() {
31151
31108
  Ut = r(6),
31152
31109
  Kt = r.n(Ut);
31153
31110
  function $t(e) {
31154
- return null != e && "object" == _typeof(e) && 1 === e.nodeType;
31111
+ return null != e && "object" == _typeof$1(e) && 1 === e.nodeType;
31155
31112
  }
31156
31113
  function Jt(e, t) {
31157
31114
  return (!t || "hidden" !== e) && "visible" !== e && "clip" !== e;