@hero-design/rn 8.62.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, '');
@@ -6912,7 +6928,7 @@ var Typography = {
6912
6928
  };
6913
6929
 
6914
6930
  // 🔴 DO NOT EDIT — This file is generated automatically.
6915
- var IconList = ['activate', 'add-emoji', 'add-person', 'adjustment', 'alignment', 'antenna', 'archive', 'assignment-warning', 'bank', 'bell', 'billing', 'bolt', 'bookmark-added', 'bookmark', 'box-check', 'box', 'bpay', 'buildings', 'cake', 'calendar-clock', 'calendar', 'candy-box-menu', 'caret-down-small', 'caret-down', 'caret-left-small', 'caret-left', 'caret-right-small', 'caret-right', 'caret-up-small', 'caret-up', 'check-radio', 'circle-add', 'circle-cancel', 'circle-check', 'circle-down', 'circle-info', 'circle-left', 'circle-ok', 'circle-pencil', 'circle-question', 'circle-remove', 'circle-right', 'circle-up', 'circle-warning', 'clock-3', 'clock', 'cloud-download', 'cloud-upload', 'cog', 'coin', 'contacts', 'credit-card', 'diamond', 'direction-arrows', 'directory', 'document', 'dollar-coin-shine', 'double-buildings', 'edit-template', 'envelope', 'exclude', 'expand-content', 'expense', 'explore_nearby', 'eye-circle', 'eye-invisible', 'eye', 'face-meh', 'face-sad', 'face-smiley', 'feed', 'feedbacks', 'file-certified', 'file-clone', 'file-copy', 'file-csv', 'file-dispose', 'file-doc', 'file-excel', 'file-export', 'file-lock', 'file-pdf', 'file-powerpoint', 'file-search', 'file-secured', 'file-sheets', 'file-slide', 'file-verified', 'file-word', 'file', 'filter', 'folder-user', 'folder', 'format-bold', 'format-heading1', 'format-heading2', 'format-italic', 'format-list-bulleted', 'format-list-numbered', 'format-underlined', 'funnel-filter', 'global-dollar', 'globe', 'graduation-cap', 'graph', 'happy-sun', 'health-bag', 'heart', 'hero-points', 'home', 'image', 'import', 'incident-siren', 'instapay-daily', 'instapay-now', 'instapay', 'list', 'loading-2', 'loading', 'location-on', 'location', 'lock', 'looks-one', 'looks-two', 'media-content', 'menu', 'money-notes', 'moneybag', 'moon', 'multiple-stars', 'multiple-users', 'near-me', 'node', 'open-folder', 'paperclip', 'payment-summary', 'pencil', 'phone', 'piggy-bank', 'plane-up', 'plane', 'play-circle', 'print', 'raising-hands', 'reply-arrow', 'reply', 'reschedule', 'rostering', 'salary-sacrifice', 'save', 'schedule-send', 'schedule', 'search-person', 'send', 'speaker-active', 'speaker', 'star-award', 'star-badge', 'star-circle', 'star-medal', 'star', 'steps-circle', 'stopwatch', 'suitcase', 'surfing', 'survey', 'swag-pillar-benefit', 'swag-pillar-career', 'swag-pillar-money', 'swag-pillar-work', 'swag', 'swipe-right', 'switch', 'tag', 'target', 'teams', 'timesheet', 'touch-id', 'trash-bin', 'unlock', 'user', 'video-1', 'video-2', 'wallet', 'warning', 'activate-outlined', 'add-credit-card-outlined', 'add-person-outlined', 'add-section-outlined', 'add-time-outlined', 'add', 'adjustment-outlined', 'ai-outlined', 'alignment-2-outlined', 'alignment-outlined', 'all-caps', 'application-outlined', 'arrow-down', 'arrow-downwards', 'arrow-left', 'arrow-leftwards', 'arrow-right', 'arrow-rightwards', 'arrow-up', 'arrow-upwards', 'article-outlined', 'at-sign', 'auto-graph-outlined', 'beer-outlined', 'bell-active-outlined', 'bell-outlined', 'bell-slash-outlined', 'bill-management-outlined', 'billing-outlined', 'body-outlined', 'bold', 'bolt-outlined', 'book-outlined', 'bookmark-added-outlined', 'bookmark-outlined', 'box-check-outlined', 'box-outlined', 'bullet-points', 'cake-outlined', 'calendar-dates-outlined', 'calendar-star-outlined', 'call-outlined', 'call-split-outlined', 'camera-outlined', 'cancel', 'car-forward-outlined', 'cashback-outlined', 'charging-station-outlined', 'chat-bubble-outlined', 'chat-unread-outlined', 'checkmark', 'circle-add-outlined', 'circle-cancel-outlined', 'circle-down-outlined', 'circle-info-outlined', 'circle-left-outlined', 'circle-ok-outlined', 'circle-question-outlined', 'circle-remove-outlined', 'circle-right-outlined', 'circle-up-outlined', 'circle-warning-outlined', 'clock-2-outlined', 'clock-outlined', 'cog-outlined', 'coin-outlined', 'coin-super-outlined', 'comment-outlined', 'contacts-outlined', 'contacts-user-outlined', 'credit-card-outlined', 'cup-outlined', 'dentistry-outlined', 'direction-arrows-outlined', 'directory-outlined', 'document-outlined', 'dollar-box-outlined', 'dollar-card-outlined', 'dollar-coin-shine-outlined', 'dollar-credit-card-outlined', 'dollar-sign', 'double-buildings-outlined', 'double-left-arrows', 'double-right-arrows', 'download-box-outlined', 'download-outlined', 'edit-template-outlined', 'email-outlined', 'enter-arrow', 'envelope-outlined', 'expense-approval-outlined', 'expense-outlined', 'explore-outlined', 'extension-outlined', 'external-link', 'eye-invisible-outlined', 'eye-outlined', 'face-id', 'face-meh-outlined', 'face-open-smiley-outlined', 'face-sad-outlined', 'face-smiley-outlined', 'fastfood-outlined', 'feed-outlined', 'file-certified-outlined', 'file-clone-outlined', 'file-copy-outlined', 'file-dispose-outlined', 'file-dollar-certified-outlined', 'file-dollar-outlined', 'file-download-outlined', 'file-export-outlined', 'file-lock-outlined', 'file-outlined', 'file-search-outlined', 'file-secured-outlined', 'file-statutory-outlined', 'file-verified-outlined', 'filter-outlined', 'folder-outlined', 'folder-user-outlined', 'form-outlined', 'funnel-filter-outline', 'goal-outlined', 'graph-outlined', 'hand-holding-user-outlined', 'happy-sun-outlined', 'health-bag-outlined', 'heart-outlined', 'home-active-outlined', 'home-outlined', 'id-card-outlined', 'image-outlined', 'import-outlined', 'instapay-outlined', 'italic', 'job-search-outlined', 'leave-approval-outlined', 'link-1', 'link-2', 'list-outlined', 'live-help-outlined', 'local_mall_outlined', 'location-on-outlined', 'location-outlined', 'lock-outlined', 'locked-file-outlined', 'log-out', 'mail-outlined', 'map-outlined', 'media-content-outlined', 'menu-close', 'menu-expand', 'menu-fold-outlined', 'menu-unfold-outlined', 'moneybag-outlined', 'moon-outlined', 'more-horizontal', 'more-vertical', 'multiple-folders-outlined', 'multiple-users-outlined', 'near-me-outlined', 'node-outlined', 'number-points', 'number', 'overview-outlined', 'payment-summary-outlined', 'payslip-outlined', 'pencil-outlined', 'percentage', 'phone-outlined', 'piggy-bank-outlined', 'plane-outlined', 'play-circle-outlined', 'print-outlined', 'propane-tank-outlined', 'qr-code-outlined', 'qualification-outlined', 're-assign', 'redeem', 'refresh', 'remove', 'reply-outlined', 'restart', 'resume-outlined', 'return-arrow', 'rostering-outlined', 'safety-outlined', 'save-outlined', 'schedule-outlined', 'search-outlined', 'search-secured-outlined', 'send-outlined', 'share-1', 'share-2', 'share-outlined-2', 'share-outlined', 'shopping_basket_outlined', 'show-chart-outlined', 'single-down-arrow', 'single-left-arrow', 'single-right-arrow', 'single-up-arrow', 'smart-match-outlined', 'sparkle-outlined', 'speaker-active-outlined', 'speaker-outlined', 'star-circle-outlined', 'star-outlined', 'stash-outlined', 'stopwatch-outlined', 'strikethrough', 'styler-outlined', 'suitcase-clock-outlined', 'suitcase-outlined', 'survey-outlined', 'switch-outlined', 'sync', 'tag-outlined', 'target-outlined', 'tennis-outlined', 'ticket-outlined', 'timesheet-outlined', 'timesheets-outlined', 'today-outlined', 'transfer', 'trash-bin-outlined', 'umbrela-outlined', 'unavailability-outlined', 'unavailable', 'underline', 'union-outlined', 'unlock-outlined', 'upload-outlined', 'user-circle-outlined', 'user-gear-outlined', 'user-outlined', 'user-rectangle-outlined', 'video-1-outlined', 'video-2-outlined', 'volunteer-outlined', 'wallet-outlined', 'wellness-outlined'];
6931
+ var IconList = ['activate', 'add-emoji', 'add-person', 'adjustment', 'alignment', 'antenna', 'archive', 'assignment-warning', 'bank', 'bell', 'billing', 'bolt', 'bookmark-added', 'bookmark', 'box-check', 'box', 'bpay', 'buildings', 'cake', 'calendar-clock', 'calendar', 'candy-box-menu', 'caret-down-small', 'caret-down', 'caret-left-small', 'caret-left', 'caret-right-small', 'caret-right', 'caret-up-small', 'caret-up', 'check-radio', 'circle-add', 'circle-cancel', 'circle-check', 'circle-down', 'circle-info', 'circle-left', 'circle-ok', 'circle-pencil', 'circle-question', 'circle-remove', 'circle-right', 'circle-up', 'circle-warning', 'clock-3', 'clock', 'cloud-download', 'cloud-upload', 'cog', 'coin', 'contacts', 'credit-card', 'diamond', 'direction-arrows', 'directory', 'document', 'dollar-coin-shine', 'double-buildings', 'edit-template', 'envelope', 'exclude', 'expand-content', 'expense', 'explore_nearby', 'eye-circle', 'eye-invisible', 'eye', 'face-meh', 'face-sad', 'face-smiley', 'feed', 'feedbacks', 'file-certified', 'file-clone', 'file-copy', 'file-csv', 'file-dispose', 'file-doc', 'file-excel', 'file-export', 'file-lock', 'file-pdf', 'file-powerpoint', 'file-search', 'file-secured', 'file-sheets', 'file-slide', 'file-verified', 'file-word', 'file', 'filter', 'folder-user', 'folder', 'format-bold', 'format-heading1', 'format-heading2', 'format-italic', 'format-list-bulleted', 'format-list-numbered', 'format-underlined', 'funnel-filter', 'global-dollar', 'globe', 'graduation-cap', 'graph', 'happy-sun', 'health-bag', 'heart', 'hero-points', 'home', 'image', 'import', 'incident-siren', 'instapay-daily', 'instapay-now', 'instapay', 'list', 'loading-2', 'loading', 'location-on', 'location', 'lock', 'looks-one', 'looks-two', 'media-content', 'menu', 'money-notes', 'moneybag', 'moon', 'multiple-stars', 'multiple-users', 'near-me', 'node', 'open-folder', 'paperclip', 'payment-summary', 'pencil', 'phone', 'piggy-bank', 'plane-up', 'plane', 'play-circle', 'print', 'raising-hands', 'reply-arrow', 'reply', 'reschedule', 'rostering', 'salary-sacrifice', 'save', 'schedule-send', 'schedule', 'search-person', 'send', 'speaker-active', 'speaker', 'star-award', 'star-badge', 'star-circle', 'star-medal', 'star', 'steps-circle', 'stopwatch', 'suitcase', 'surfing', 'survey', 'swag-pillar-benefit', 'swag-pillar-career', 'swag-pillar-money', 'swag-pillar-work', 'swag', 'swipe-right', 'switch', 'tag', 'target', 'teams', 'timesheet', 'touch-id', 'trash-bin', 'unlock', 'user', 'video-1', 'video-2', 'wallet', 'warning', 'activate-outlined', 'add-credit-card-outlined', 'add-person-outlined', 'add-section-outlined', 'add-time-outlined', 'add', 'adjustment-outlined', 'ai-outlined', 'alignment-2-outlined', 'alignment-outlined', 'all-caps', 'application-outlined', 'arrow-down', 'arrow-downwards', 'arrow-left', 'arrow-leftwards', 'arrow-right', 'arrow-rightwards', 'arrow-up', 'arrow-upwards', 'article-outlined', 'at-sign', 'auto-graph-outlined', 'beer-outlined', 'bell-active-outlined', 'bell-outlined', 'bell-slash-outlined', 'bill-management-outlined', 'billing-outlined', 'body-outlined', 'bold', 'bolt-outlined', 'book-outlined', 'bookmark-added-outlined', 'bookmark-outlined', 'box-check-outlined', 'box-outlined', 'bullet-points', 'cake-outlined', 'calendar-dates-outlined', 'calendar-star-outlined', 'call-outlined', 'call-split-outlined', 'camera-outlined', 'cancel', 'car-forward-outlined', 'cashback-outlined', 'charging-station-outlined', 'chat-bubble-outlined', 'chat-unread-outlined', 'checkmark', 'circle-add-outlined', 'circle-cancel-outlined', 'circle-down-outlined', 'circle-info-outlined', 'circle-left-outlined', 'circle-ok-outlined', 'circle-question-outlined', 'circle-remove-outlined', 'circle-right-outlined', 'circle-up-outlined', 'circle-warning-outlined', 'clock-2-outlined', 'clock-in-outlined', 'clock-out-outlined', 'clock-outlined', 'cog-outlined', 'coin-outlined', 'coin-super-outlined', 'comment-outlined', 'contacts-outlined', 'contacts-user-outlined', 'credit-card-outlined', 'cup-outlined', 'dentistry-outlined', 'direction-arrows-outlined', 'directory-outlined', 'document-outlined', 'dollar-box-outlined', 'dollar-card-outlined', 'dollar-coin-shine-outlined', 'dollar-credit-card-outlined', 'dollar-sign', 'double-buildings-outlined', 'double-left-arrows', 'double-right-arrows', 'download-box-outlined', 'download-outlined', 'edit-template-outlined', 'email-outlined', 'end-break-outlined', 'enter-arrow', 'envelope-outlined', 'expense-approval-outlined', 'expense-outlined', 'explore-outlined', 'extension-outlined', 'external-link', 'eye-invisible-outlined', 'eye-outlined', 'face-id', 'face-meh-outlined', 'face-open-smiley-outlined', 'face-sad-outlined', 'face-smiley-outlined', 'fastfood-outlined', 'feed-outlined', 'file-certified-outlined', 'file-clone-outlined', 'file-copy-outlined', 'file-dispose-outlined', 'file-dollar-certified-outlined', 'file-dollar-outlined', 'file-download-outlined', 'file-export-outlined', 'file-lock-outlined', 'file-outlined', 'file-search-outlined', 'file-secured-outlined', 'file-statutory-outlined', 'file-verified-outlined', 'filter-outlined', 'folder-outlined', 'folder-user-outlined', 'form-outlined', 'funnel-filter-outline', 'goal-outlined', 'graph-outlined', 'hand-holding-user-outlined', 'happy-sun-outlined', 'health-bag-outlined', 'heart-outlined', 'home-active-outlined', 'home-outlined', 'id-card-outlined', 'image-outlined', 'import-outlined', 'instapay-outlined', 'italic', 'job-search-outlined', 'leave-approval-outlined', 'link-1', 'link-2', 'list-outlined', 'live-help-outlined', 'local_mall_outlined', 'location-on-outlined', 'location-outlined', 'lock-outlined', 'locked-file-outlined', 'log-out', 'mail-outlined', 'map-outlined', 'media-content-outlined', 'menu-close', 'menu-expand', 'menu-fold-outlined', 'menu-unfold-outlined', 'moneybag-outlined', 'moon-outlined', 'more-horizontal', 'more-vertical', 'multiple-folders-outlined', 'multiple-users-outlined', 'near-me-outlined', 'node-outlined', 'number-points', 'number', 'overview-outlined', 'payment-summary-outlined', 'payslip-outlined', 'pencil-outlined', 'percentage', 'phone-outlined', 'piggy-bank-outlined', 'plane-outlined', 'play-circle-outlined', 'print-outlined', 'propane-tank-outlined', 'qr-code-outlined', 'qualification-outlined', 're-assign', 'redeem', 'refresh', 'remove', 'reply-outlined', 'restart', 'resume-outlined', 'return-arrow', 'rostering-outlined', 'safety-outlined', 'save-outlined', 'schedule-outlined', 'search-outlined', 'search-secured-outlined', 'send-outlined', 'share-1', 'share-2', 'share-outlined-2', 'share-outlined', 'shopping_basket_outlined', 'show-chart-outlined', 'single-down-arrow', 'single-left-arrow', 'single-right-arrow', 'single-up-arrow', 'smart-match-outlined', 'sparkle-outlined', 'speaker-active-outlined', 'speaker-outlined', 'star-circle-outlined', 'star-outlined', 'start-break-outlined', 'stash-outlined', 'stopwatch-outlined', 'strikethrough', 'styler-outlined', 'suitcase-clock-outlined', 'suitcase-outlined', 'survey-outlined', 'switch-outlined', 'sync', 'tag-outlined', 'target-outlined', 'tennis-outlined', 'ticket-outlined', 'timesheet-outlined', 'timesheets-outlined', 'today-outlined', 'transfer', 'trash-bin-outlined', 'umbrela-outlined', 'unavailability-outlined', 'unavailable', 'underline', 'union-outlined', 'unlock-outlined', 'upload-outlined', 'user-circle-outlined', 'user-gear-outlined', 'user-outlined', 'user-rectangle-outlined', 'video-1-outlined', 'video-2-outlined', 'volunteer-outlined', 'wallet-outlined', 'wellness-outlined'];
6916
6932
 
6917
6933
  var activate = 59000;
6918
6934
  var adjustment = 59003;
@@ -6990,20 +7006,20 @@ var add = 59190;
6990
7006
  var bold = 59215;
6991
7007
  var cancel = 59229;
6992
7008
  var checkmark = 59235;
6993
- var italic = 59320;
6994
- var local_mall_outlined = 59327;
6995
- var number = 59349;
6996
- var percentage = 59354;
6997
- var redeem = 59364;
6998
- var refresh = 59365;
6999
- var remove = 59366;
7000
- var restart = 59368;
7001
- var shopping_basket_outlined = 59382;
7002
- var strikethrough = 59396;
7003
- var sync = 59402;
7004
- var transfer = 59410;
7005
- var unavailable = 59414;
7006
- var underline = 59415;
7009
+ var italic = 59323;
7010
+ var local_mall_outlined = 59330;
7011
+ var number = 59352;
7012
+ var percentage = 59357;
7013
+ var redeem = 59367;
7014
+ var refresh = 59368;
7015
+ var remove = 59369;
7016
+ var restart = 59371;
7017
+ var shopping_basket_outlined = 59385;
7018
+ var strikethrough = 59400;
7019
+ var sync = 59406;
7020
+ var transfer = 59414;
7021
+ var unavailable = 59418;
7022
+ var underline = 59419;
7007
7023
  var glyphMap = {
7008
7024
  activate: activate,
7009
7025
  "add-emoji": 59001,
@@ -7253,186 +7269,190 @@ var glyphMap = {
7253
7269
  "circle-up-outlined": 59245,
7254
7270
  "circle-warning-outlined": 59246,
7255
7271
  "clock-2-outlined": 59247,
7256
- "clock-outlined": 59248,
7257
- "cog-outlined": 59249,
7258
- "coin-outlined": 59250,
7259
- "coin-super-outlined": 59251,
7260
- "comment-outlined": 59252,
7261
- "contacts-outlined": 59253,
7262
- "contacts-user-outlined": 59254,
7263
- "credit-card-outlined": 59255,
7264
- "cup-outlined": 59256,
7265
- "dentistry-outlined": 59257,
7266
- "direction-arrows-outlined": 59258,
7267
- "directory-outlined": 59259,
7268
- "document-outlined": 59260,
7269
- "dollar-box-outlined": 59261,
7270
- "dollar-card-outlined": 59262,
7271
- "dollar-coin-shine-outlined": 59263,
7272
- "dollar-credit-card-outlined": 59264,
7273
- "dollar-sign": 59265,
7274
- "double-buildings-outlined": 59266,
7275
- "double-left-arrows": 59267,
7276
- "double-right-arrows": 59268,
7277
- "download-box-outlined": 59269,
7278
- "download-outlined": 59270,
7279
- "edit-template-outlined": 59271,
7280
- "email-outlined": 59272,
7281
- "enter-arrow": 59273,
7282
- "envelope-outlined": 59274,
7283
- "expense-approval-outlined": 59275,
7284
- "expense-outlined": 59276,
7285
- "explore-outlined": 59277,
7286
- "extension-outlined": 59278,
7287
- "external-link": 59279,
7288
- "eye-invisible-outlined": 59280,
7289
- "eye-outlined": 59281,
7290
- "face-id": 59282,
7291
- "face-meh-outlined": 59283,
7292
- "face-open-smiley-outlined": 59284,
7293
- "face-sad-outlined": 59285,
7294
- "face-smiley-outlined": 59286,
7295
- "fastfood-outlined": 59287,
7296
- "feed-outlined": 59288,
7297
- "file-certified-outlined": 59289,
7298
- "file-clone-outlined": 59290,
7299
- "file-copy-outlined": 59291,
7300
- "file-dispose-outlined": 59292,
7301
- "file-dollar-certified-outlined": 59293,
7302
- "file-dollar-outlined": 59294,
7303
- "file-download-outlined": 59295,
7304
- "file-export-outlined": 59296,
7305
- "file-lock-outlined": 59297,
7306
- "file-outlined": 59298,
7307
- "file-search-outlined": 59299,
7308
- "file-secured-outlined": 59300,
7309
- "file-statutory-outlined": 59301,
7310
- "file-verified-outlined": 59302,
7311
- "filter-outlined": 59303,
7312
- "folder-outlined": 59304,
7313
- "folder-user-outlined": 59305,
7314
- "form-outlined": 59306,
7315
- "funnel-filter-outline": 59307,
7316
- "goal-outlined": 59308,
7317
- "graph-outlined": 59309,
7318
- "hand-holding-user-outlined": 59310,
7319
- "happy-sun-outlined": 59311,
7320
- "health-bag-outlined": 59312,
7321
- "heart-outlined": 59313,
7322
- "home-active-outlined": 59314,
7323
- "home-outlined": 59315,
7324
- "id-card-outlined": 59316,
7325
- "image-outlined": 59317,
7326
- "import-outlined": 59318,
7327
- "instapay-outlined": 59319,
7272
+ "clock-in-outlined": 59248,
7273
+ "clock-out-outlined": 59249,
7274
+ "clock-outlined": 59250,
7275
+ "cog-outlined": 59251,
7276
+ "coin-outlined": 59252,
7277
+ "coin-super-outlined": 59253,
7278
+ "comment-outlined": 59254,
7279
+ "contacts-outlined": 59255,
7280
+ "contacts-user-outlined": 59256,
7281
+ "credit-card-outlined": 59257,
7282
+ "cup-outlined": 59258,
7283
+ "dentistry-outlined": 59259,
7284
+ "direction-arrows-outlined": 59260,
7285
+ "directory-outlined": 59261,
7286
+ "document-outlined": 59262,
7287
+ "dollar-box-outlined": 59263,
7288
+ "dollar-card-outlined": 59264,
7289
+ "dollar-coin-shine-outlined": 59265,
7290
+ "dollar-credit-card-outlined": 59266,
7291
+ "dollar-sign": 59267,
7292
+ "double-buildings-outlined": 59268,
7293
+ "double-left-arrows": 59269,
7294
+ "double-right-arrows": 59270,
7295
+ "download-box-outlined": 59271,
7296
+ "download-outlined": 59272,
7297
+ "edit-template-outlined": 59273,
7298
+ "email-outlined": 59274,
7299
+ "end-break-outlined": 59275,
7300
+ "enter-arrow": 59276,
7301
+ "envelope-outlined": 59277,
7302
+ "expense-approval-outlined": 59278,
7303
+ "expense-outlined": 59279,
7304
+ "explore-outlined": 59280,
7305
+ "extension-outlined": 59281,
7306
+ "external-link": 59282,
7307
+ "eye-invisible-outlined": 59283,
7308
+ "eye-outlined": 59284,
7309
+ "face-id": 59285,
7310
+ "face-meh-outlined": 59286,
7311
+ "face-open-smiley-outlined": 59287,
7312
+ "face-sad-outlined": 59288,
7313
+ "face-smiley-outlined": 59289,
7314
+ "fastfood-outlined": 59290,
7315
+ "feed-outlined": 59291,
7316
+ "file-certified-outlined": 59292,
7317
+ "file-clone-outlined": 59293,
7318
+ "file-copy-outlined": 59294,
7319
+ "file-dispose-outlined": 59295,
7320
+ "file-dollar-certified-outlined": 59296,
7321
+ "file-dollar-outlined": 59297,
7322
+ "file-download-outlined": 59298,
7323
+ "file-export-outlined": 59299,
7324
+ "file-lock-outlined": 59300,
7325
+ "file-outlined": 59301,
7326
+ "file-search-outlined": 59302,
7327
+ "file-secured-outlined": 59303,
7328
+ "file-statutory-outlined": 59304,
7329
+ "file-verified-outlined": 59305,
7330
+ "filter-outlined": 59306,
7331
+ "folder-outlined": 59307,
7332
+ "folder-user-outlined": 59308,
7333
+ "form-outlined": 59309,
7334
+ "funnel-filter-outline": 59310,
7335
+ "goal-outlined": 59311,
7336
+ "graph-outlined": 59312,
7337
+ "hand-holding-user-outlined": 59313,
7338
+ "happy-sun-outlined": 59314,
7339
+ "health-bag-outlined": 59315,
7340
+ "heart-outlined": 59316,
7341
+ "home-active-outlined": 59317,
7342
+ "home-outlined": 59318,
7343
+ "id-card-outlined": 59319,
7344
+ "image-outlined": 59320,
7345
+ "import-outlined": 59321,
7346
+ "instapay-outlined": 59322,
7328
7347
  italic: italic,
7329
- "job-search-outlined": 59321,
7330
- "leave-approval-outlined": 59322,
7331
- "link-1": 59323,
7332
- "link-2": 59324,
7333
- "list-outlined": 59325,
7334
- "live-help-outlined": 59326,
7348
+ "job-search-outlined": 59324,
7349
+ "leave-approval-outlined": 59325,
7350
+ "link-1": 59326,
7351
+ "link-2": 59327,
7352
+ "list-outlined": 59328,
7353
+ "live-help-outlined": 59329,
7335
7354
  local_mall_outlined: local_mall_outlined,
7336
- "location-on-outlined": 59328,
7337
- "location-outlined": 59329,
7338
- "lock-outlined": 59330,
7339
- "locked-file-outlined": 59331,
7340
- "log-out": 59332,
7341
- "mail-outlined": 59333,
7342
- "map-outlined": 59334,
7343
- "media-content-outlined": 59335,
7344
- "menu-close": 59336,
7345
- "menu-expand": 59337,
7346
- "menu-fold-outlined": 59338,
7347
- "menu-unfold-outlined": 59339,
7348
- "moneybag-outlined": 59340,
7349
- "moon-outlined": 59341,
7350
- "more-horizontal": 59342,
7351
- "more-vertical": 59343,
7352
- "multiple-folders-outlined": 59344,
7353
- "multiple-users-outlined": 59345,
7354
- "near-me-outlined": 59346,
7355
- "node-outlined": 59347,
7356
- "number-points": 59348,
7355
+ "location-on-outlined": 59331,
7356
+ "location-outlined": 59332,
7357
+ "lock-outlined": 59333,
7358
+ "locked-file-outlined": 59334,
7359
+ "log-out": 59335,
7360
+ "mail-outlined": 59336,
7361
+ "map-outlined": 59337,
7362
+ "media-content-outlined": 59338,
7363
+ "menu-close": 59339,
7364
+ "menu-expand": 59340,
7365
+ "menu-fold-outlined": 59341,
7366
+ "menu-unfold-outlined": 59342,
7367
+ "moneybag-outlined": 59343,
7368
+ "moon-outlined": 59344,
7369
+ "more-horizontal": 59345,
7370
+ "more-vertical": 59346,
7371
+ "multiple-folders-outlined": 59347,
7372
+ "multiple-users-outlined": 59348,
7373
+ "near-me-outlined": 59349,
7374
+ "node-outlined": 59350,
7375
+ "number-points": 59351,
7357
7376
  number: number,
7358
- "overview-outlined": 59350,
7359
- "payment-summary-outlined": 59351,
7360
- "payslip-outlined": 59352,
7361
- "pencil-outlined": 59353,
7377
+ "overview-outlined": 59353,
7378
+ "payment-summary-outlined": 59354,
7379
+ "payslip-outlined": 59355,
7380
+ "pencil-outlined": 59356,
7362
7381
  percentage: percentage,
7363
- "phone-outlined": 59355,
7364
- "piggy-bank-outlined": 59356,
7365
- "plane-outlined": 59357,
7366
- "play-circle-outlined": 59358,
7367
- "print-outlined": 59359,
7368
- "propane-tank-outlined": 59360,
7369
- "qr-code-outlined": 59361,
7370
- "qualification-outlined": 59362,
7371
- "re-assign": 59363,
7382
+ "phone-outlined": 59358,
7383
+ "piggy-bank-outlined": 59359,
7384
+ "plane-outlined": 59360,
7385
+ "play-circle-outlined": 59361,
7386
+ "print-outlined": 59362,
7387
+ "propane-tank-outlined": 59363,
7388
+ "qr-code-outlined": 59364,
7389
+ "qualification-outlined": 59365,
7390
+ "re-assign": 59366,
7372
7391
  redeem: redeem,
7373
7392
  refresh: refresh,
7374
7393
  remove: remove,
7375
- "reply-outlined": 59367,
7394
+ "reply-outlined": 59370,
7376
7395
  restart: restart,
7377
- "resume-outlined": 59369,
7378
- "return-arrow": 59370,
7379
- "rostering-outlined": 59371,
7380
- "safety-outlined": 59372,
7381
- "save-outlined": 59373,
7382
- "schedule-outlined": 59374,
7383
- "search-outlined": 59375,
7384
- "search-secured-outlined": 59376,
7385
- "send-outlined": 59377,
7386
- "share-1": 59378,
7387
- "share-2": 59379,
7388
- "share-outlined-2": 59380,
7389
- "share-outlined": 59381,
7396
+ "resume-outlined": 59372,
7397
+ "return-arrow": 59373,
7398
+ "rostering-outlined": 59374,
7399
+ "safety-outlined": 59375,
7400
+ "save-outlined": 59376,
7401
+ "schedule-outlined": 59377,
7402
+ "search-outlined": 59378,
7403
+ "search-secured-outlined": 59379,
7404
+ "send-outlined": 59380,
7405
+ "share-1": 59381,
7406
+ "share-2": 59382,
7407
+ "share-outlined-2": 59383,
7408
+ "share-outlined": 59384,
7390
7409
  shopping_basket_outlined: shopping_basket_outlined,
7391
- "show-chart-outlined": 59383,
7392
- "single-down-arrow": 59384,
7393
- "single-left-arrow": 59385,
7394
- "single-right-arrow": 59386,
7395
- "single-up-arrow": 59387,
7396
- "smart-match-outlined": 59388,
7397
- "sparkle-outlined": 59389,
7398
- "speaker-active-outlined": 59390,
7399
- "speaker-outlined": 59391,
7400
- "star-circle-outlined": 59392,
7401
- "star-outlined": 59393,
7402
- "stash-outlined": 59394,
7403
- "stopwatch-outlined": 59395,
7410
+ "show-chart-outlined": 59386,
7411
+ "single-down-arrow": 59387,
7412
+ "single-left-arrow": 59388,
7413
+ "single-right-arrow": 59389,
7414
+ "single-up-arrow": 59390,
7415
+ "smart-match-outlined": 59391,
7416
+ "sparkle-outlined": 59392,
7417
+ "speaker-active-outlined": 59393,
7418
+ "speaker-outlined": 59394,
7419
+ "star-circle-outlined": 59395,
7420
+ "star-outlined": 59396,
7421
+ "start-break-outlined": 59397,
7422
+ "stash-outlined": 59398,
7423
+ "stopwatch-outlined": 59399,
7404
7424
  strikethrough: strikethrough,
7405
- "styler-outlined": 59397,
7406
- "suitcase-clock-outlined": 59398,
7407
- "suitcase-outlined": 59399,
7408
- "survey-outlined": 59400,
7409
- "switch-outlined": 59401,
7425
+ "styler-outlined": 59401,
7426
+ "suitcase-clock-outlined": 59402,
7427
+ "suitcase-outlined": 59403,
7428
+ "survey-outlined": 59404,
7429
+ "switch-outlined": 59405,
7410
7430
  sync: sync,
7411
- "tag-outlined": 59403,
7412
- "target-outlined": 59404,
7413
- "tennis-outlined": 59405,
7414
- "ticket-outlined": 59406,
7415
- "timesheet-outlined": 59407,
7416
- "timesheets-outlined": 59408,
7417
- "today-outlined": 59409,
7431
+ "tag-outlined": 59407,
7432
+ "target-outlined": 59408,
7433
+ "tennis-outlined": 59409,
7434
+ "ticket-outlined": 59410,
7435
+ "timesheet-outlined": 59411,
7436
+ "timesheets-outlined": 59412,
7437
+ "today-outlined": 59413,
7418
7438
  transfer: transfer,
7419
- "trash-bin-outlined": 59411,
7420
- "umbrela-outlined": 59412,
7421
- "unavailability-outlined": 59413,
7439
+ "trash-bin-outlined": 59415,
7440
+ "umbrela-outlined": 59416,
7441
+ "unavailability-outlined": 59417,
7422
7442
  unavailable: unavailable,
7423
7443
  underline: underline,
7424
- "union-outlined": 59416,
7425
- "unlock-outlined": 59417,
7426
- "upload-outlined": 59418,
7427
- "user-circle-outlined": 59419,
7428
- "user-gear-outlined": 59420,
7429
- "user-outlined": 59421,
7430
- "user-rectangle-outlined": 59422,
7431
- "video-1-outlined": 59423,
7432
- "video-2-outlined": 59424,
7433
- "volunteer-outlined": 59425,
7434
- "wallet-outlined": 59426,
7435
- "wellness-outlined": 59427
7444
+ "union-outlined": 59420,
7445
+ "unlock-outlined": 59421,
7446
+ "upload-outlined": 59422,
7447
+ "user-circle-outlined": 59423,
7448
+ "user-gear-outlined": 59424,
7449
+ "user-outlined": 59425,
7450
+ "user-rectangle-outlined": 59426,
7451
+ "video-1-outlined": 59427,
7452
+ "video-2-outlined": 59428,
7453
+ "volunteer-outlined": 59429,
7454
+ "wallet-outlined": 59430,
7455
+ "wellness-outlined": 59431
7436
7456
  };
7437
7457
 
7438
7458
  var HeroIcon = createIconSet(glyphMap, 'hero-icons-mobile', 'hero-icons-mobile.ttf');
@@ -7680,7 +7700,8 @@ var Alert = function Alert(_ref2) {
7680
7700
  _ref2$variant = _ref2.variant,
7681
7701
  variant = _ref2$variant === void 0 ? 'rounded' : _ref2$variant,
7682
7702
  style = _ref2.style,
7683
- testID = _ref2.testID;
7703
+ testID = _ref2.testID,
7704
+ actionLabel = _ref2.actionLabel;
7684
7705
  useDeprecation("Alert's notification intent is deprecated and will be removed in the next major release. Please use other intents instead.", intent === 'notification');
7685
7706
  return /*#__PURE__*/React__default.createElement(Container$1, {
7686
7707
  themeVariant: variant,
@@ -7698,7 +7719,9 @@ var Alert = function Alert(_ref2) {
7698
7719
  }, content) : content)), onClose ? /*#__PURE__*/React__default.createElement(CTAWrapper$1, {
7699
7720
  onPress: onClose,
7700
7721
  testID: "alert-close-icon"
7701
- }, /*#__PURE__*/React__default.createElement(Icon, {
7722
+ }, typeof actionLabel === 'string' ? /*#__PURE__*/React__default.createElement(Typography.Body, {
7723
+ variant: "small-bold"
7724
+ }, actionLabel) : /*#__PURE__*/React__default.createElement(Icon, {
7702
7725
  icon: "cancel",
7703
7726
  size: "small"
7704
7727
  })) : null);
@@ -9291,12 +9314,59 @@ var BottomSheet$1 = Object.assign(BottomSheet, {
9291
9314
  ScrollView: BottomSheetScrollView
9292
9315
  });
9293
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
+
9294
9327
  function requiredArgs(required, args) {
9295
9328
  if (args.length < required) {
9296
9329
  throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
9297
9330
  }
9298
9331
  }
9299
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
+
9300
9370
  /**
9301
9371
  * @name toDate
9302
9372
  * @category Common Helpers
@@ -9327,11 +9397,11 @@ function requiredArgs(required, args) {
9327
9397
  * const result = toDate(1392098430000)
9328
9398
  * //=> Tue Feb 11 2014 11:30:30
9329
9399
  */
9330
-
9331
9400
  function toDate(argument) {
9332
9401
  requiredArgs(1, arguments);
9333
- var argStr = Object.prototype.toString.call(argument); // Clone the date
9402
+ var argStr = Object.prototype.toString.call(argument);
9334
9403
 
9404
+ // Clone the date
9335
9405
  if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
9336
9406
  // Prevent the date to lose the milliseconds when passed to new Date() in IE10
9337
9407
  return new Date(argument.getTime());
@@ -9340,8 +9410,8 @@ function toDate(argument) {
9340
9410
  } else {
9341
9411
  if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
9342
9412
  // eslint-disable-next-line no-console
9343
- 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
9344
-
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
9345
9415
  console.warn(new Error().stack);
9346
9416
  }
9347
9417
  return new Date(NaN);
@@ -9360,616 +9430,235 @@ function toDate(argument) {
9360
9430
  *
9361
9431
  * Time value of Date: http://es5.github.io/#x15.9.1.1
9362
9432
  *
9363
- * ### v2.0.0 breaking changes:
9364
- *
9365
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
9366
- *
9367
- * - Now `isValid` doesn't throw an exception
9368
- * if the first argument is not an instance of Date.
9369
- * Instead, argument is converted beforehand using `toDate`.
9370
- *
9371
- * Examples:
9372
- *
9373
- * | `isValid` argument | Before v2.0.0 | v2.0.0 onward |
9374
- * |---------------------------|---------------|---------------|
9375
- * | `new Date()` | `true` | `true` |
9376
- * | `new Date('2016-01-01')` | `true` | `true` |
9377
- * | `new Date('')` | `false` | `false` |
9378
- * | `new Date(1488370835081)` | `true` | `true` |
9379
- * | `new Date(NaN)` | `false` | `false` |
9380
- * | `'2016-01-01'` | `TypeError` | `false` |
9381
- * | `''` | `TypeError` | `false` |
9382
- * | `1488370835081` | `TypeError` | `true` |
9383
- * | `NaN` | `TypeError` | `false` |
9384
- *
9385
- * We introduce this change to make *date-fns* consistent with ECMAScript behavior
9386
- * that try to coerce arguments to the expected type
9387
- * (which is also the case with other *date-fns* functions).
9388
- *
9389
9433
  * @param {*} date - the date to check
9390
9434
  * @returns {Boolean} the date is valid
9391
9435
  * @throws {TypeError} 1 argument required
9392
9436
  *
9393
9437
  * @example
9394
9438
  * // For the valid date:
9395
- * var result = isValid(new Date(2014, 1, 31))
9439
+ * const result = isValid(new Date(2014, 1, 31))
9396
9440
  * //=> true
9397
9441
  *
9398
9442
  * @example
9399
9443
  * // For the value, convertable into a date:
9400
- * var result = isValid(1393804800000)
9444
+ * const result = isValid(1393804800000)
9401
9445
  * //=> true
9402
9446
  *
9403
9447
  * @example
9404
9448
  * // For the invalid date:
9405
- * var result = isValid(new Date(''))
9449
+ * const result = isValid(new Date(''))
9406
9450
  * //=> false
9407
9451
  */
9408
-
9409
9452
  function isValid(dirtyDate) {
9410
9453
  requiredArgs(1, arguments);
9454
+ if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
9455
+ return false;
9456
+ }
9411
9457
  var date = toDate(dirtyDate);
9412
- return !isNaN(date);
9458
+ return !isNaN(Number(date));
9413
9459
  }
9414
9460
 
9415
- var formatDistanceLocale = {
9416
- lessThanXSeconds: {
9417
- one: 'less than a second',
9418
- other: 'less than {{count}} seconds'
9419
- },
9420
- xSeconds: {
9421
- one: '1 second',
9422
- other: '{{count}} seconds'
9423
- },
9424
- halfAMinute: 'half a minute',
9425
- lessThanXMinutes: {
9426
- one: 'less than a minute',
9427
- other: 'less than {{count}} minutes'
9428
- },
9429
- xMinutes: {
9430
- one: '1 minute',
9431
- other: '{{count}} minutes'
9432
- },
9433
- aboutXHours: {
9434
- one: 'about 1 hour',
9435
- other: 'about {{count}} hours'
9436
- },
9437
- xHours: {
9438
- one: '1 hour',
9439
- other: '{{count}} hours'
9440
- },
9441
- xDays: {
9442
- one: '1 day',
9443
- other: '{{count}} days'
9444
- },
9445
- aboutXWeeks: {
9446
- one: 'about 1 week',
9447
- other: 'about {{count}} weeks'
9448
- },
9449
- xWeeks: {
9450
- one: '1 week',
9451
- other: '{{count}} weeks'
9452
- },
9453
- aboutXMonths: {
9454
- one: 'about 1 month',
9455
- other: 'about {{count}} months'
9456
- },
9457
- xMonths: {
9458
- one: '1 month',
9459
- other: '{{count}} months'
9460
- },
9461
- aboutXYears: {
9462
- one: 'about 1 year',
9463
- other: 'about {{count}} years'
9464
- },
9465
- xYears: {
9466
- one: '1 year',
9467
- other: '{{count}} years'
9468
- },
9469
- overXYears: {
9470
- one: 'over 1 year',
9471
- other: 'over {{count}} years'
9472
- },
9473
- almostXYears: {
9474
- one: 'almost 1 year',
9475
- other: 'almost {{count}} years'
9476
- }
9477
- };
9478
- function formatDistance(token, count, options) {
9479
- options = options || {};
9480
- var result;
9481
- if (typeof formatDistanceLocale[token] === 'string') {
9482
- result = formatDistanceLocale[token];
9483
- } else if (count === 1) {
9484
- result = formatDistanceLocale[token].one;
9485
- } else {
9486
- result = formatDistanceLocale[token].other.replace('{{count}}', count);
9461
+ function toInteger(dirtyNumber) {
9462
+ if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
9463
+ return NaN;
9487
9464
  }
9488
- if (options.addSuffix) {
9489
- if (options.comparison > 0) {
9490
- return 'in ' + result;
9491
- } else {
9492
- return result + ' ago';
9493
- }
9465
+ var number = Number(dirtyNumber);
9466
+ if (isNaN(number)) {
9467
+ return number;
9494
9468
  }
9495
- return result;
9469
+ return number < 0 ? Math.ceil(number) : Math.floor(number);
9496
9470
  }
9497
9471
 
9498
- function buildFormatLongFn(args) {
9499
- return function (dirtyOptions) {
9500
- var options = dirtyOptions || {};
9501
- var width = options.width ? String(options.width) : args.defaultWidth;
9502
- var format = args.formats[width] || args.formats[args.defaultWidth];
9503
- return format;
9504
- };
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);
9505
9495
  }
9506
9496
 
9507
- var dateFormats = {
9508
- full: 'EEEE, MMMM do, y',
9509
- "long": 'MMMM do, y',
9510
- medium: 'MMM d, y',
9511
- "short": 'MM/dd/yyyy'
9512
- };
9513
- var timeFormats = {
9514
- full: 'h:mm:ss a zzzz',
9515
- "long": 'h:mm:ss a z',
9516
- medium: 'h:mm:ss a',
9517
- "short": 'h:mm a'
9518
- };
9519
- var dateTimeFormats = {
9520
- full: "{{date}} 'at' {{time}}",
9521
- "long": "{{date}} 'at' {{time}}",
9522
- medium: '{{date}}, {{time}}',
9523
- "short": '{{date}}, {{time}}'
9524
- };
9525
- var formatLong = {
9526
- date: buildFormatLongFn({
9527
- formats: dateFormats,
9528
- defaultWidth: 'full'
9529
- }),
9530
- time: buildFormatLongFn({
9531
- formats: timeFormats,
9532
- defaultWidth: 'full'
9533
- }),
9534
- dateTime: buildFormatLongFn({
9535
- formats: dateTimeFormats,
9536
- defaultWidth: 'full'
9537
- })
9538
- };
9539
- 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
+ }
9540
9520
 
9541
- var formatRelativeLocale = {
9542
- lastWeek: "'last' eeee 'at' p",
9543
- yesterday: "'yesterday at' p",
9544
- today: "'today at' p",
9545
- tomorrow: "'tomorrow at' p",
9546
- nextWeek: "eeee 'at' p",
9547
- other: 'P'
9548
- };
9549
- function formatRelative(token, _date, _baseDate, _options) {
9550
- 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;
9551
9531
  }
9552
9532
 
9553
- function buildLocalizeFn(args) {
9554
- return function (dirtyIndex, dirtyOptions) {
9555
- var options = dirtyOptions || {};
9556
- var context = options.context ? String(options.context) : 'standalone';
9557
- var valuesArray;
9558
- if (context === 'formatting' && args.formattingValues) {
9559
- var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
9560
- var width = options.width ? String(options.width) : defaultWidth;
9561
- valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
9562
- } else {
9563
- var _defaultWidth = args.defaultWidth;
9564
- var _width = options.width ? String(options.width) : args.defaultWidth;
9565
- valuesArray = args.values[_width] || args.values[_defaultWidth];
9566
- }
9567
- var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
9568
- return valuesArray[index];
9569
- };
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;
9570
9542
  }
9571
9543
 
9572
- var eraValues = {
9573
- narrow: ['B', 'A'],
9574
- abbreviated: ['BC', 'AD'],
9575
- wide: ['Before Christ', 'Anno Domini']
9576
- };
9577
- var quarterValues = {
9578
- narrow: ['1', '2', '3', '4'],
9579
- abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
9580
- wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter'] // Note: in English, the names of days of the week and months are capitalized.
9581
- // If you are making a new locale based on this one, check if the same is true for the language you're working on.
9582
- // Generally, formatted dates should look like they are in the middle of a sentence,
9583
- // e.g. in Spanish language the weekdays and months should be in the lowercase.
9584
- };
9585
-
9586
- var monthValues = {
9587
- narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
9588
- abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
9589
- wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
9590
- };
9591
- var dayValues = {
9592
- narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
9593
- "short": ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
9594
- abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
9595
- wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
9596
- };
9597
- var dayPeriodValues = {
9598
- narrow: {
9599
- am: 'a',
9600
- pm: 'p',
9601
- midnight: 'mi',
9602
- noon: 'n',
9603
- morning: 'morning',
9604
- afternoon: 'afternoon',
9605
- evening: 'evening',
9606
- night: 'night'
9607
- },
9608
- abbreviated: {
9609
- am: 'AM',
9610
- pm: 'PM',
9611
- midnight: 'midnight',
9612
- noon: 'noon',
9613
- morning: 'morning',
9614
- afternoon: 'afternoon',
9615
- evening: 'evening',
9616
- night: 'night'
9617
- },
9618
- wide: {
9619
- am: 'a.m.',
9620
- pm: 'p.m.',
9621
- midnight: 'midnight',
9622
- noon: 'noon',
9623
- morning: 'morning',
9624
- afternoon: 'afternoon',
9625
- evening: 'evening',
9626
- night: 'night'
9627
- }
9628
- };
9629
- var formattingDayPeriodValues = {
9630
- narrow: {
9631
- am: 'a',
9632
- pm: 'p',
9633
- midnight: 'mi',
9634
- noon: 'n',
9635
- morning: 'in the morning',
9636
- afternoon: 'in the afternoon',
9637
- evening: 'in the evening',
9638
- night: 'at night'
9639
- },
9640
- abbreviated: {
9641
- am: 'AM',
9642
- pm: 'PM',
9643
- midnight: 'midnight',
9644
- noon: 'noon',
9645
- morning: 'in the morning',
9646
- afternoon: 'in the afternoon',
9647
- evening: 'in the evening',
9648
- night: 'at night'
9649
- },
9650
- wide: {
9651
- am: 'a.m.',
9652
- pm: 'p.m.',
9653
- midnight: 'midnight',
9654
- noon: 'noon',
9655
- morning: 'in the morning',
9656
- afternoon: 'in the afternoon',
9657
- evening: 'in the evening',
9658
- 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;
9659
9562
  }
9660
- };
9661
- function ordinalNumber(dirtyNumber, _dirtyOptions) {
9662
- var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,
9663
- // if they are different for different grammatical genders,
9664
- // use `options.unit`:
9665
- //
9666
- // var options = dirtyOptions || {}
9667
- // var unit = String(options.unit)
9668
- //
9669
- // where `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
9670
- // 'day', 'hour', 'minute', 'second'
9563
+ }
9671
9564
 
9672
- var rem100 = number % 100;
9673
- if (rem100 > 20 || rem100 < 10) {
9674
- switch (rem100 % 10) {
9675
- case 1:
9676
- return number + 'st';
9677
- case 2:
9678
- return number + 'nd';
9679
- case 3:
9680
- return number + 'rd';
9681
- }
9682
- }
9683
- 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;
9684
9573
  }
9685
- var localize = {
9686
- ordinalNumber: ordinalNumber,
9687
- era: buildLocalizeFn({
9688
- values: eraValues,
9689
- defaultWidth: 'wide'
9690
- }),
9691
- quarter: buildLocalizeFn({
9692
- values: quarterValues,
9693
- defaultWidth: 'wide',
9694
- argumentCallback: function argumentCallback(quarter) {
9695
- return Number(quarter) - 1;
9696
- }
9697
- }),
9698
- month: buildLocalizeFn({
9699
- values: monthValues,
9700
- defaultWidth: 'wide'
9701
- }),
9702
- day: buildLocalizeFn({
9703
- values: dayValues,
9704
- defaultWidth: 'wide'
9705
- }),
9706
- dayPeriod: buildLocalizeFn({
9707
- values: dayPeriodValues,
9708
- defaultWidth: 'wide',
9709
- formattingValues: formattingDayPeriodValues,
9710
- defaultFormattingWidth: 'wide'
9711
- })
9712
- };
9713
- var localize$1 = localize;
9714
9574
 
9715
- function buildMatchPatternFn(args) {
9716
- return function (dirtyString, dirtyOptions) {
9717
- var string = String(dirtyString);
9718
- var options = dirtyOptions || {};
9719
- var matchResult = string.match(args.matchPattern);
9720
- if (!matchResult) {
9721
- return null;
9722
- }
9723
- var matchedString = matchResult[0];
9724
- var parseResult = string.match(args.parsePattern);
9725
- if (!parseResult) {
9726
- return null;
9727
- }
9728
- var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
9729
- value = options.valueCallback ? options.valueCallback(value) : value;
9730
- return {
9731
- value: value,
9732
- rest: string.slice(matchedString.length)
9733
- };
9734
- };
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;
9735
9585
  }
9736
9586
 
9737
- function buildMatchFn(args) {
9738
- return function (dirtyString, dirtyOptions) {
9739
- var string = String(dirtyString);
9740
- var options = dirtyOptions || {};
9741
- var width = options.width;
9742
- var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
9743
- var matchResult = string.match(matchPattern);
9744
- if (!matchResult) {
9745
- return null;
9746
- }
9747
- var matchedString = matchResult[0];
9748
- var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
9749
- var value;
9750
- if (Object.prototype.toString.call(parsePatterns) === '[object Array]') {
9751
- value = findIndex(parsePatterns, function (pattern) {
9752
- return pattern.test(matchedString);
9753
- });
9754
- } else {
9755
- value = findKey(parsePatterns, function (pattern) {
9756
- return pattern.test(matchedString);
9757
- });
9758
- }
9759
- value = args.valueCallback ? args.valueCallback(value) : value;
9760
- value = options.valueCallback ? options.valueCallback(value) : value;
9761
- return {
9762
- value: value,
9763
- rest: string.slice(matchedString.length)
9764
- };
9765
- };
9587
+ var defaultOptions = {};
9588
+ function getDefaultOptions() {
9589
+ return defaultOptions;
9766
9590
  }
9767
- function findKey(object, predicate) {
9768
- for (var key in object) {
9769
- if (object.hasOwnProperty(key) && predicate(object[key])) {
9770
- return key;
9771
- }
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');
9772
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;
9773
9608
  }
9774
- function findIndex(array, predicate) {
9775
- for (var key = 0; key < array.length; key++) {
9776
- if (predicate(array[key])) {
9777
- return key;
9778
- }
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;
9779
9636
  }
9780
9637
  }
9781
9638
 
9782
- var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
9783
- var parseOrdinalNumberPattern = /\d+/i;
9784
- var matchEraPatterns = {
9785
- narrow: /^(b|a)/i,
9786
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
9787
- wide: /^(before christ|before common era|anno domini|common era)/i
9788
- };
9789
- var parseEraPatterns = {
9790
- any: [/^b/i, /^(a|c)/i]
9791
- };
9792
- var matchQuarterPatterns = {
9793
- narrow: /^[1234]/i,
9794
- abbreviated: /^q[1234]/i,
9795
- wide: /^[1234](th|st|nd|rd)? quarter/i
9796
- };
9797
- var parseQuarterPatterns = {
9798
- any: [/1/i, /2/i, /3/i, /4/i]
9799
- };
9800
- var matchMonthPatterns = {
9801
- narrow: /^[jfmasond]/i,
9802
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
9803
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
9804
- };
9805
- var parseMonthPatterns = {
9806
- 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],
9807
- 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]
9808
- };
9809
- var matchDayPatterns = {
9810
- narrow: /^[smtwf]/i,
9811
- "short": /^(su|mo|tu|we|th|fr|sa)/i,
9812
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
9813
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
9814
- };
9815
- var parseDayPatterns = {
9816
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
9817
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
9818
- };
9819
- var matchDayPeriodPatterns = {
9820
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
9821
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
9822
- };
9823
- var parseDayPeriodPatterns = {
9824
- any: {
9825
- am: /^a/i,
9826
- pm: /^p/i,
9827
- midnight: /^mi/i,
9828
- noon: /^no/i,
9829
- morning: /morning/i,
9830
- afternoon: /afternoon/i,
9831
- evening: /evening/i,
9832
- night: /night/i
9833
- }
9834
- };
9835
- var match = {
9836
- ordinalNumber: buildMatchPatternFn({
9837
- matchPattern: matchOrdinalNumberPattern,
9838
- parsePattern: parseOrdinalNumberPattern,
9839
- valueCallback: function valueCallback(value) {
9840
- return parseInt(value, 10);
9841
- }
9842
- }),
9843
- era: buildMatchFn({
9844
- matchPatterns: matchEraPatterns,
9845
- defaultMatchWidth: 'wide',
9846
- parsePatterns: parseEraPatterns,
9847
- defaultParseWidth: 'any'
9848
- }),
9849
- quarter: buildMatchFn({
9850
- matchPatterns: matchQuarterPatterns,
9851
- defaultMatchWidth: 'wide',
9852
- parsePatterns: parseQuarterPatterns,
9853
- defaultParseWidth: 'any',
9854
- valueCallback: function valueCallback(index) {
9855
- return index + 1;
9856
- }
9857
- }),
9858
- month: buildMatchFn({
9859
- matchPatterns: matchMonthPatterns,
9860
- defaultMatchWidth: 'wide',
9861
- parsePatterns: parseMonthPatterns,
9862
- defaultParseWidth: 'any'
9863
- }),
9864
- day: buildMatchFn({
9865
- matchPatterns: matchDayPatterns,
9866
- defaultMatchWidth: 'wide',
9867
- parsePatterns: parseDayPatterns,
9868
- defaultParseWidth: 'any'
9869
- }),
9870
- dayPeriod: buildMatchFn({
9871
- matchPatterns: matchDayPeriodPatterns,
9872
- defaultMatchWidth: 'any',
9873
- parsePatterns: parseDayPeriodPatterns,
9874
- defaultParseWidth: 'any'
9875
- })
9876
- };
9877
- var match$1 = match;
9878
-
9879
- /**
9880
- * @type {Locale}
9881
- * @category Locales
9882
- * @summary English locale (United States).
9883
- * @language English
9884
- * @iso-639-2 eng
9885
- * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
9886
- * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
9887
- */
9888
-
9889
- var locale = {
9890
- code: 'en-US',
9891
- formatDistance: formatDistance,
9892
- formatLong: formatLong$1,
9893
- formatRelative: formatRelative,
9894
- localize: localize$1,
9895
- match: match$1,
9896
- options: {
9897
- weekStartsOn: 0
9898
- /* Sunday */,
9899
-
9900
- firstWeekContainsDate: 1
9901
- }
9902
- };
9903
- var defaultLocale = locale;
9904
-
9905
- function toInteger(dirtyNumber) {
9906
- if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
9907
- return NaN;
9908
- }
9909
- var number = Number(dirtyNumber);
9910
- if (isNaN(number)) {
9911
- return number;
9912
- }
9913
- return number < 0 ? Math.ceil(number) : Math.floor(number);
9914
- }
9915
-
9916
- /**
9917
- * @name addMilliseconds
9918
- * @category Millisecond Helpers
9919
- * @summary Add the specified number of milliseconds to the given date.
9920
- *
9921
- * @description
9922
- * Add the specified number of milliseconds to the given date.
9923
- *
9924
- * ### v2.0.0 breaking changes:
9925
- *
9926
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
9927
- *
9928
- * @param {Date|Number} date - the date to be changed
9929
- * @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`.
9930
- * @returns {Date} the new date with the milliseconds added
9931
- * @throws {TypeError} 2 arguments required
9932
- *
9933
- * @example
9934
- * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
9935
- * var result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
9936
- * //=> Thu Jul 10 2014 12:45:30.750
9937
- */
9938
-
9939
- function addMilliseconds(dirtyDate, dirtyAmount) {
9940
- requiredArgs(2, arguments);
9941
- var timestamp = toDate(dirtyDate).getTime();
9942
- var amount = toInteger(dirtyAmount);
9943
- 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;
9944
9650
  }
9945
9651
 
9946
- /**
9947
- * @name subMilliseconds
9948
- * @category Millisecond Helpers
9949
- * @summary Subtract the specified number of milliseconds from the given date.
9950
- *
9951
- * @description
9952
- * Subtract the specified number of milliseconds from the given date.
9953
- *
9954
- * ### v2.0.0 breaking changes:
9955
- *
9956
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
9957
- *
9958
- * @param {Date|Number} date - the date to be changed
9959
- * @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`.
9960
- * @returns {Date} the new date with the milliseconds subtracted
9961
- * @throws {TypeError} 2 arguments required
9962
- *
9963
- * @example
9964
- * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
9965
- * var result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
9966
- * //=> Thu Jul 10 2014 12:45:29.250
9967
- */
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();
9968
9657
 
9969
- function subMilliseconds(dirtyDate, dirtyAmount) {
9970
- requiredArgs(2, arguments);
9971
- var amount = toInteger(dirtyAmount);
9972
- 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;
9973
9662
  }
9974
9663
 
9975
9664
  function addLeadingZeros(number, targetLength) {
@@ -9993,7 +9682,6 @@ function addLeadingZeros(number, targetLength) {
9993
9682
  *
9994
9683
  * Letters marked by * are not implemented but reserved by Unicode standard.
9995
9684
  */
9996
-
9997
9685
  var formatters$2 = {
9998
9686
  // Year
9999
9687
  y: function y(date, token) {
@@ -10005,8 +9693,9 @@ var formatters$2 = {
10005
9693
  // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
10006
9694
  // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
10007
9695
  // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
10008
- var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
10009
9696
 
9697
+ var signedYear = date.getUTCFullYear();
9698
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
10010
9699
  var year = signedYear > 0 ? signedYear : 1 - signedYear;
10011
9700
  return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
10012
9701
  },
@@ -10025,8 +9714,9 @@ var formatters$2 = {
10025
9714
  switch (token) {
10026
9715
  case 'a':
10027
9716
  case 'aa':
10028
- case 'aaa':
10029
9717
  return dayPeriodEnumValue.toUpperCase();
9718
+ case 'aaa':
9719
+ return dayPeriodEnumValue;
10030
9720
  case 'aaaaa':
10031
9721
  return dayPeriodEnumValue[0];
10032
9722
  case 'aaaa':
@@ -10060,283 +9750,127 @@ var formatters$2 = {
10060
9750
  };
10061
9751
  var lightFormatters = formatters$2;
10062
9752
 
10063
- var MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.
10064
- // See issue: https://github.com/date-fns/date-fns/issues/376
10065
-
10066
- function getUTCDayOfYear(dirtyDate) {
10067
- requiredArgs(1, arguments);
10068
- var date = toDate(dirtyDate);
10069
- var timestamp = date.getTime();
10070
- date.setUTCMonth(0, 1);
10071
- date.setUTCHours(0, 0, 0, 0);
10072
- var startOfYearTimestamp = date.getTime();
10073
- var difference = timestamp - startOfYearTimestamp;
10074
- return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
10075
- }
10076
-
10077
- // See issue: https://github.com/date-fns/date-fns/issues/376
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
+ */
10078
9808
 
10079
- function startOfUTCISOWeek(dirtyDate) {
10080
- requiredArgs(1, arguments);
10081
- var weekStartsOn = 1;
10082
- var date = toDate(dirtyDate);
10083
- var day = date.getUTCDay();
10084
- var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
10085
- date.setUTCDate(date.getUTCDate() - diff);
10086
- date.setUTCHours(0, 0, 0, 0);
10087
- return date;
10088
- }
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;
10089
9852
 
10090
- // See issue: https://github.com/date-fns/date-fns/issues/376
9853
+ // Two digit year
9854
+ if (token === 'YY') {
9855
+ var twoDigitYear = weekYear % 100;
9856
+ return addLeadingZeros(twoDigitYear, 2);
9857
+ }
10091
9858
 
10092
- function getUTCISOWeekYear(dirtyDate) {
10093
- requiredArgs(1, arguments);
10094
- var date = toDate(dirtyDate);
10095
- var year = date.getUTCFullYear();
10096
- var fourthOfJanuaryOfNextYear = new Date(0);
10097
- fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
10098
- fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
10099
- var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
10100
- var fourthOfJanuaryOfThisYear = new Date(0);
10101
- fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
10102
- fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
10103
- var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
10104
- if (date.getTime() >= startOfNextYear.getTime()) {
10105
- return year + 1;
10106
- } else if (date.getTime() >= startOfThisYear.getTime()) {
10107
- return year;
10108
- } else {
10109
- return year - 1;
10110
- }
10111
- }
10112
-
10113
- // See issue: https://github.com/date-fns/date-fns/issues/376
10114
-
10115
- function startOfUTCISOWeekYear(dirtyDate) {
10116
- requiredArgs(1, arguments);
10117
- var year = getUTCISOWeekYear(dirtyDate);
10118
- var fourthOfJanuary = new Date(0);
10119
- fourthOfJanuary.setUTCFullYear(year, 0, 4);
10120
- fourthOfJanuary.setUTCHours(0, 0, 0, 0);
10121
- var date = startOfUTCISOWeek(fourthOfJanuary);
10122
- return date;
10123
- }
10124
-
10125
- var MILLISECONDS_IN_WEEK$1 = 604800000; // This function will be a part of public API when UTC function will be implemented.
10126
- // See issue: https://github.com/date-fns/date-fns/issues/376
10127
-
10128
- function getUTCISOWeek(dirtyDate) {
10129
- requiredArgs(1, arguments);
10130
- var date = toDate(dirtyDate);
10131
- var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer
10132
- // because the number of milliseconds in a week is not constant
10133
- // (e.g. it's different in the week of the daylight saving time clock shift)
10134
-
10135
- return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
10136
- }
10137
-
10138
- // See issue: https://github.com/date-fns/date-fns/issues/376
10139
-
10140
- function startOfUTCWeek(dirtyDate, dirtyOptions) {
10141
- requiredArgs(1, arguments);
10142
- var options = dirtyOptions || {};
10143
- var locale = options.locale;
10144
- var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;
10145
- var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
10146
- var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
10147
-
10148
- if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
10149
- throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
10150
- }
10151
- var date = toDate(dirtyDate);
10152
- var day = date.getUTCDay();
10153
- var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
10154
- date.setUTCDate(date.getUTCDate() - diff);
10155
- date.setUTCHours(0, 0, 0, 0);
10156
- return date;
10157
- }
10158
-
10159
- // See issue: https://github.com/date-fns/date-fns/issues/376
10160
-
10161
- function getUTCWeekYear(dirtyDate, dirtyOptions) {
10162
- requiredArgs(1, arguments);
10163
- var date = toDate(dirtyDate, dirtyOptions);
10164
- var year = date.getUTCFullYear();
10165
- var options = dirtyOptions || {};
10166
- var locale = options.locale;
10167
- var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
10168
- var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
10169
- var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
10170
-
10171
- if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
10172
- throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
10173
- }
10174
- var firstWeekOfNextYear = new Date(0);
10175
- firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
10176
- firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
10177
- var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions);
10178
- var firstWeekOfThisYear = new Date(0);
10179
- firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
10180
- firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
10181
- var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions);
10182
- if (date.getTime() >= startOfNextYear.getTime()) {
10183
- return year + 1;
10184
- } else if (date.getTime() >= startOfThisYear.getTime()) {
10185
- return year;
10186
- } else {
10187
- return year - 1;
10188
- }
10189
- }
10190
-
10191
- // See issue: https://github.com/date-fns/date-fns/issues/376
10192
-
10193
- function startOfUTCWeekYear(dirtyDate, dirtyOptions) {
10194
- requiredArgs(1, arguments);
10195
- var options = dirtyOptions || {};
10196
- var locale = options.locale;
10197
- var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
10198
- var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
10199
- var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);
10200
- var year = getUTCWeekYear(dirtyDate, dirtyOptions);
10201
- var firstWeek = new Date(0);
10202
- firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
10203
- firstWeek.setUTCHours(0, 0, 0, 0);
10204
- var date = startOfUTCWeek(firstWeek, dirtyOptions);
10205
- return date;
10206
- }
10207
-
10208
- var MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.
10209
- // See issue: https://github.com/date-fns/date-fns/issues/376
10210
-
10211
- function getUTCWeek(dirtyDate, options) {
10212
- requiredArgs(1, arguments);
10213
- var date = toDate(dirtyDate);
10214
- var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer
10215
- // because the number of milliseconds in a week is not constant
10216
- // (e.g. it's different in the week of the daylight saving time clock shift)
10217
-
10218
- return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
10219
- }
10220
-
10221
- var dayPeriodEnum = {
10222
- am: 'am',
10223
- pm: 'pm',
10224
- midnight: 'midnight',
10225
- noon: 'noon',
10226
- morning: 'morning',
10227
- afternoon: 'afternoon',
10228
- evening: 'evening',
10229
- night: 'night'
10230
- /*
10231
- * | | Unit | | Unit |
10232
- * |-----|--------------------------------|-----|--------------------------------|
10233
- * | a | AM, PM | A* | Milliseconds in day |
10234
- * | b | AM, PM, noon, midnight | B | Flexible day period |
10235
- * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
10236
- * | d | Day of month | D | Day of year |
10237
- * | e | Local day of week | E | Day of week |
10238
- * | f | | F* | Day of week in month |
10239
- * | g* | Modified Julian day | G | Era |
10240
- * | h | Hour [1-12] | H | Hour [0-23] |
10241
- * | i! | ISO day of week | I! | ISO week of year |
10242
- * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
10243
- * | k | Hour [1-24] | K | Hour [0-11] |
10244
- * | l* | (deprecated) | L | Stand-alone month |
10245
- * | m | Minute | M | Month |
10246
- * | n | | N | |
10247
- * | o! | Ordinal number modifier | O | Timezone (GMT) |
10248
- * | p! | Long localized time | P! | Long localized date |
10249
- * | q | Stand-alone quarter | Q | Quarter |
10250
- * | r* | Related Gregorian year | R! | ISO week-numbering year |
10251
- * | s | Second | S | Fraction of second |
10252
- * | t! | Seconds timestamp | T! | Milliseconds timestamp |
10253
- * | u | Extended year | U* | Cyclic year |
10254
- * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
10255
- * | w | Local week of year | W* | Week of month |
10256
- * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
10257
- * | y | Year (abs) | Y | Local week-numbering year |
10258
- * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
10259
- *
10260
- * Letters marked by * are not implemented but reserved by Unicode standard.
10261
- *
10262
- * Letters marked by ! are non-standard, but implemented by date-fns:
10263
- * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
10264
- * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
10265
- * i.e. 7 for Sunday, 1 for Monday, etc.
10266
- * - `I` is ISO week of year, as opposed to `w` which is local week of year.
10267
- * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
10268
- * `R` is supposed to be used in conjunction with `I` and `i`
10269
- * for universal ISO week-numbering date, whereas
10270
- * `Y` is supposed to be used in conjunction with `w` and `e`
10271
- * for week-numbering date specific to the locale.
10272
- * - `P` is long localized date format
10273
- * - `p` is long localized time format
10274
- */
10275
- };
10276
-
10277
- var formatters = {
10278
- // Era
10279
- G: function G(date, token, localize) {
10280
- var era = date.getUTCFullYear() > 0 ? 1 : 0;
10281
- switch (token) {
10282
- // AD, BC
10283
- case 'G':
10284
- case 'GG':
10285
- case 'GGG':
10286
- return localize.era(era, {
10287
- width: 'abbreviated'
10288
- });
10289
- // A, B
10290
-
10291
- case 'GGGGG':
10292
- return localize.era(era, {
10293
- width: 'narrow'
10294
- });
10295
- // Anno Domini, Before Christ
10296
-
10297
- case 'GGGG':
10298
- default:
10299
- return localize.era(era, {
10300
- width: 'wide'
10301
- });
10302
- }
10303
- },
10304
- // Year
10305
- y: function y(date, token, localize) {
10306
9859
  // Ordinal number
10307
- if (token === 'yo') {
10308
- var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
10309
-
10310
- var year = signedYear > 0 ? signedYear : 1 - signedYear;
10311
- return localize.ordinalNumber(year, {
10312
- unit: 'year'
10313
- });
10314
- }
10315
- return lightFormatters.y(date, token);
10316
- },
10317
- // Local week-numbering year
10318
- Y: function Y(date, token, localize, options) {
10319
- var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)
10320
-
10321
- var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year
10322
-
10323
- if (token === 'YY') {
10324
- var twoDigitYear = weekYear % 100;
10325
- return addLeadingZeros(twoDigitYear, 2);
10326
- } // Ordinal number
10327
-
10328
9860
  if (token === 'Yo') {
10329
9861
  return localize.ordinalNumber(weekYear, {
10330
9862
  unit: 'year'
10331
9863
  });
10332
- } // Padding
9864
+ }
10333
9865
 
9866
+ // Padding
10334
9867
  return addLeadingZeros(weekYear, token.length);
10335
9868
  },
10336
9869
  // ISO week-numbering year
10337
9870
  R: function R(date, token) {
10338
- var isoWeekYear = getUTCISOWeekYear(date); // Padding
9871
+ var isoWeekYear = getUTCISOWeekYear(date);
10339
9872
 
9873
+ // Padding
10340
9874
  return addLeadingZeros(isoWeekYear, token.length);
10341
9875
  },
10342
9876
  // Extended year. This is a single number designating the year of this calendar system.
@@ -10360,31 +9894,26 @@ var formatters = {
10360
9894
  case 'Q':
10361
9895
  return String(quarter);
10362
9896
  // 01, 02, 03, 04
10363
-
10364
9897
  case 'QQ':
10365
9898
  return addLeadingZeros(quarter, 2);
10366
9899
  // 1st, 2nd, 3rd, 4th
10367
-
10368
9900
  case 'Qo':
10369
9901
  return localize.ordinalNumber(quarter, {
10370
9902
  unit: 'quarter'
10371
9903
  });
10372
9904
  // Q1, Q2, Q3, Q4
10373
-
10374
9905
  case 'QQQ':
10375
9906
  return localize.quarter(quarter, {
10376
9907
  width: 'abbreviated',
10377
9908
  context: 'formatting'
10378
9909
  });
10379
9910
  // 1, 2, 3, 4 (narrow quarter; could be not numerical)
10380
-
10381
9911
  case 'QQQQQ':
10382
9912
  return localize.quarter(quarter, {
10383
9913
  width: 'narrow',
10384
9914
  context: 'formatting'
10385
9915
  });
10386
9916
  // 1st quarter, 2nd quarter, ...
10387
-
10388
9917
  case 'QQQQ':
10389
9918
  default:
10390
9919
  return localize.quarter(quarter, {
@@ -10401,31 +9930,26 @@ var formatters = {
10401
9930
  case 'q':
10402
9931
  return String(quarter);
10403
9932
  // 01, 02, 03, 04
10404
-
10405
9933
  case 'qq':
10406
9934
  return addLeadingZeros(quarter, 2);
10407
9935
  // 1st, 2nd, 3rd, 4th
10408
-
10409
9936
  case 'qo':
10410
9937
  return localize.ordinalNumber(quarter, {
10411
9938
  unit: 'quarter'
10412
9939
  });
10413
9940
  // Q1, Q2, Q3, Q4
10414
-
10415
9941
  case 'qqq':
10416
9942
  return localize.quarter(quarter, {
10417
9943
  width: 'abbreviated',
10418
9944
  context: 'standalone'
10419
9945
  });
10420
9946
  // 1, 2, 3, 4 (narrow quarter; could be not numerical)
10421
-
10422
9947
  case 'qqqqq':
10423
9948
  return localize.quarter(quarter, {
10424
9949
  width: 'narrow',
10425
9950
  context: 'standalone'
10426
9951
  });
10427
9952
  // 1st quarter, 2nd quarter, ...
10428
-
10429
9953
  case 'qqqq':
10430
9954
  default:
10431
9955
  return localize.quarter(quarter, {
@@ -10442,27 +9966,23 @@ var formatters = {
10442
9966
  case 'MM':
10443
9967
  return lightFormatters.M(date, token);
10444
9968
  // 1st, 2nd, ..., 12th
10445
-
10446
9969
  case 'Mo':
10447
9970
  return localize.ordinalNumber(month + 1, {
10448
9971
  unit: 'month'
10449
9972
  });
10450
9973
  // Jan, Feb, ..., Dec
10451
-
10452
9974
  case 'MMM':
10453
9975
  return localize.month(month, {
10454
9976
  width: 'abbreviated',
10455
9977
  context: 'formatting'
10456
9978
  });
10457
9979
  // J, F, ..., D
10458
-
10459
9980
  case 'MMMMM':
10460
9981
  return localize.month(month, {
10461
9982
  width: 'narrow',
10462
9983
  context: 'formatting'
10463
9984
  });
10464
9985
  // January, February, ..., December
10465
-
10466
9986
  case 'MMMM':
10467
9987
  default:
10468
9988
  return localize.month(month, {
@@ -10479,31 +9999,26 @@ var formatters = {
10479
9999
  case 'L':
10480
10000
  return String(month + 1);
10481
10001
  // 01, 02, ..., 12
10482
-
10483
10002
  case 'LL':
10484
10003
  return addLeadingZeros(month + 1, 2);
10485
10004
  // 1st, 2nd, ..., 12th
10486
-
10487
10005
  case 'Lo':
10488
10006
  return localize.ordinalNumber(month + 1, {
10489
10007
  unit: 'month'
10490
10008
  });
10491
10009
  // Jan, Feb, ..., Dec
10492
-
10493
10010
  case 'LLL':
10494
10011
  return localize.month(month, {
10495
10012
  width: 'abbreviated',
10496
10013
  context: 'standalone'
10497
10014
  });
10498
10015
  // J, F, ..., D
10499
-
10500
10016
  case 'LLLLL':
10501
10017
  return localize.month(month, {
10502
10018
  width: 'narrow',
10503
10019
  context: 'standalone'
10504
10020
  });
10505
10021
  // January, February, ..., December
10506
-
10507
10022
  case 'LLLL':
10508
10023
  default:
10509
10024
  return localize.month(month, {
@@ -10564,21 +10079,18 @@ var formatters = {
10564
10079
  context: 'formatting'
10565
10080
  });
10566
10081
  // T
10567
-
10568
10082
  case 'EEEEE':
10569
10083
  return localize.day(dayOfWeek, {
10570
10084
  width: 'narrow',
10571
10085
  context: 'formatting'
10572
10086
  });
10573
10087
  // Tu
10574
-
10575
10088
  case 'EEEEEE':
10576
10089
  return localize.day(dayOfWeek, {
10577
10090
  width: 'short',
10578
10091
  context: 'formatting'
10579
10092
  });
10580
10093
  // Tuesday
10581
-
10582
10094
  case 'EEEE':
10583
10095
  default:
10584
10096
  return localize.day(dayOfWeek, {
@@ -10596,11 +10108,9 @@ var formatters = {
10596
10108
  case 'e':
10597
10109
  return String(localDayOfWeek);
10598
10110
  // Padded numerical value
10599
-
10600
10111
  case 'ee':
10601
10112
  return addLeadingZeros(localDayOfWeek, 2);
10602
10113
  // 1st, 2nd, ..., 7th
10603
-
10604
10114
  case 'eo':
10605
10115
  return localize.ordinalNumber(localDayOfWeek, {
10606
10116
  unit: 'day'
@@ -10611,21 +10121,18 @@ var formatters = {
10611
10121
  context: 'formatting'
10612
10122
  });
10613
10123
  // T
10614
-
10615
10124
  case 'eeeee':
10616
10125
  return localize.day(dayOfWeek, {
10617
10126
  width: 'narrow',
10618
10127
  context: 'formatting'
10619
10128
  });
10620
10129
  // Tu
10621
-
10622
10130
  case 'eeeeee':
10623
10131
  return localize.day(dayOfWeek, {
10624
10132
  width: 'short',
10625
10133
  context: 'formatting'
10626
10134
  });
10627
10135
  // Tuesday
10628
-
10629
10136
  case 'eeee':
10630
10137
  default:
10631
10138
  return localize.day(dayOfWeek, {
@@ -10643,11 +10150,9 @@ var formatters = {
10643
10150
  case 'c':
10644
10151
  return String(localDayOfWeek);
10645
10152
  // Padded numerical value
10646
-
10647
10153
  case 'cc':
10648
10154
  return addLeadingZeros(localDayOfWeek, token.length);
10649
10155
  // 1st, 2nd, ..., 7th
10650
-
10651
10156
  case 'co':
10652
10157
  return localize.ordinalNumber(localDayOfWeek, {
10653
10158
  unit: 'day'
@@ -10658,21 +10163,18 @@ var formatters = {
10658
10163
  context: 'standalone'
10659
10164
  });
10660
10165
  // T
10661
-
10662
10166
  case 'ccccc':
10663
10167
  return localize.day(dayOfWeek, {
10664
10168
  width: 'narrow',
10665
10169
  context: 'standalone'
10666
10170
  });
10667
10171
  // Tu
10668
-
10669
10172
  case 'cccccc':
10670
10173
  return localize.day(dayOfWeek, {
10671
10174
  width: 'short',
10672
10175
  context: 'standalone'
10673
10176
  });
10674
10177
  // Tuesday
10675
-
10676
10178
  case 'cccc':
10677
10179
  default:
10678
10180
  return localize.day(dayOfWeek, {
@@ -10690,38 +10192,32 @@ var formatters = {
10690
10192
  case 'i':
10691
10193
  return String(isoDayOfWeek);
10692
10194
  // 02
10693
-
10694
10195
  case 'ii':
10695
10196
  return addLeadingZeros(isoDayOfWeek, token.length);
10696
10197
  // 2nd
10697
-
10698
10198
  case 'io':
10699
10199
  return localize.ordinalNumber(isoDayOfWeek, {
10700
10200
  unit: 'day'
10701
10201
  });
10702
10202
  // Tue
10703
-
10704
10203
  case 'iii':
10705
10204
  return localize.day(dayOfWeek, {
10706
10205
  width: 'abbreviated',
10707
10206
  context: 'formatting'
10708
10207
  });
10709
10208
  // T
10710
-
10711
10209
  case 'iiiii':
10712
10210
  return localize.day(dayOfWeek, {
10713
10211
  width: 'narrow',
10714
10212
  context: 'formatting'
10715
10213
  });
10716
10214
  // Tu
10717
-
10718
10215
  case 'iiiiii':
10719
10216
  return localize.day(dayOfWeek, {
10720
10217
  width: 'short',
10721
10218
  context: 'formatting'
10722
10219
  });
10723
10220
  // Tuesday
10724
-
10725
10221
  case 'iiii':
10726
10222
  default:
10727
10223
  return localize.day(dayOfWeek, {
@@ -10730,417 +10226,897 @@ var formatters = {
10730
10226
  });
10731
10227
  }
10732
10228
  },
10733
- // AM or PM
10734
- a: function a(date, token, localize) {
10735
- var hours = date.getUTCHours();
10736
- var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
10737
- switch (token) {
10738
- case 'a':
10739
- case 'aa':
10740
- case 'aaa':
10741
- return localize.dayPeriod(dayPeriodEnumValue, {
10742
- width: 'abbreviated',
10743
- context: 'formatting'
10744
- });
10745
- case 'aaaaa':
10746
- return localize.dayPeriod(dayPeriodEnumValue, {
10747
- width: 'narrow',
10748
- context: 'formatting'
10749
- });
10750
- case 'aaaa':
10751
- default:
10752
- return localize.dayPeriod(dayPeriodEnumValue, {
10753
- width: 'wide',
10754
- context: 'formatting'
10755
- });
10756
- }
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'
10757
10650
  },
10758
- // AM, PM, midnight, noon
10759
- b: function b(date, token, localize) {
10760
- var hours = date.getUTCHours();
10761
- var dayPeriodEnumValue;
10762
- if (hours === 12) {
10763
- dayPeriodEnumValue = dayPeriodEnum.noon;
10764
- } else if (hours === 0) {
10765
- dayPeriodEnumValue = dayPeriodEnum.midnight;
10766
- } else {
10767
- dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
10768
- }
10769
- switch (token) {
10770
- case 'b':
10771
- case 'bb':
10772
- case 'bbb':
10773
- return localize.dayPeriod(dayPeriodEnumValue, {
10774
- width: 'abbreviated',
10775
- context: 'formatting'
10776
- });
10777
- case 'bbbbb':
10778
- return localize.dayPeriod(dayPeriodEnumValue, {
10779
- width: 'narrow',
10780
- context: 'formatting'
10781
- });
10782
- case 'bbbb':
10783
- default:
10784
- return localize.dayPeriod(dayPeriodEnumValue, {
10785
- width: 'wide',
10786
- context: 'formatting'
10787
- });
10788
- }
10651
+ xMinutes: {
10652
+ one: '1 minute',
10653
+ other: '{{count}} minutes'
10789
10654
  },
10790
- // in the morning, in the afternoon, in the evening, at night
10791
- B: function B(date, token, localize) {
10792
- var hours = date.getUTCHours();
10793
- var dayPeriodEnumValue;
10794
- if (hours >= 17) {
10795
- dayPeriodEnumValue = dayPeriodEnum.evening;
10796
- } else if (hours >= 12) {
10797
- dayPeriodEnumValue = dayPeriodEnum.afternoon;
10798
- } else if (hours >= 4) {
10799
- dayPeriodEnumValue = dayPeriodEnum.morning;
10800
- } else {
10801
- dayPeriodEnumValue = dayPeriodEnum.night;
10802
- }
10803
- switch (token) {
10804
- case 'B':
10805
- case 'BB':
10806
- case 'BBB':
10807
- return localize.dayPeriod(dayPeriodEnumValue, {
10808
- width: 'abbreviated',
10809
- context: 'formatting'
10810
- });
10811
- case 'BBBBB':
10812
- return localize.dayPeriod(dayPeriodEnumValue, {
10813
- width: 'narrow',
10814
- context: 'formatting'
10815
- });
10816
- case 'BBBB':
10817
- default:
10818
- return localize.dayPeriod(dayPeriodEnumValue, {
10819
- width: 'wide',
10820
- context: 'formatting'
10821
- });
10822
- }
10655
+ aboutXHours: {
10656
+ one: 'about 1 hour',
10657
+ other: 'about {{count}} hours'
10823
10658
  },
10824
- // Hour [1-12]
10825
- h: function h(date, token, localize) {
10826
- if (token === 'ho') {
10827
- var hours = date.getUTCHours() % 12;
10828
- if (hours === 0) hours = 12;
10829
- return localize.ordinalNumber(hours, {
10830
- unit: 'hour'
10831
- });
10832
- }
10833
- return lightFormatters.h(date, token);
10659
+ xHours: {
10660
+ one: '1 hour',
10661
+ other: '{{count}} hours'
10834
10662
  },
10835
- // Hour [0-23]
10836
- H: function H(date, token, localize) {
10837
- if (token === 'Ho') {
10838
- return localize.ordinalNumber(date.getUTCHours(), {
10839
- unit: 'hour'
10840
- });
10841
- }
10842
- return lightFormatters.H(date, token);
10663
+ xDays: {
10664
+ one: '1 day',
10665
+ other: '{{count}} days'
10843
10666
  },
10844
- // Hour [0-11]
10845
- K: function K(date, token, localize) {
10846
- var hours = date.getUTCHours() % 12;
10847
- if (token === 'Ko') {
10848
- return localize.ordinalNumber(hours, {
10849
- unit: 'hour'
10850
- });
10851
- }
10852
- return addLeadingZeros(hours, token.length);
10667
+ aboutXWeeks: {
10668
+ one: 'about 1 week',
10669
+ other: 'about {{count}} weeks'
10853
10670
  },
10854
- // Hour [1-24]
10855
- k: function k(date, token, localize) {
10856
- var hours = date.getUTCHours();
10857
- if (hours === 0) hours = 24;
10858
- if (token === 'ko') {
10859
- return localize.ordinalNumber(hours, {
10860
- unit: 'hour'
10861
- });
10862
- }
10863
- return addLeadingZeros(hours, token.length);
10671
+ xWeeks: {
10672
+ one: '1 week',
10673
+ other: '{{count}} weeks'
10864
10674
  },
10865
- // Minute
10866
- m: function m(date, token, localize) {
10867
- if (token === 'mo') {
10868
- return localize.ordinalNumber(date.getUTCMinutes(), {
10869
- unit: 'minute'
10870
- });
10871
- }
10872
- return lightFormatters.m(date, token);
10675
+ aboutXMonths: {
10676
+ one: 'about 1 month',
10677
+ other: 'about {{count}} months'
10873
10678
  },
10874
- // Second
10875
- s: function s(date, token, localize) {
10876
- if (token === 'so') {
10877
- return localize.ordinalNumber(date.getUTCSeconds(), {
10878
- unit: 'second'
10879
- });
10880
- }
10881
- return lightFormatters.s(date, token);
10679
+ xMonths: {
10680
+ one: '1 month',
10681
+ other: '{{count}} months'
10882
10682
  },
10883
- // Fraction of second
10884
- S: function S(date, token) {
10885
- return lightFormatters.S(date, token);
10683
+ aboutXYears: {
10684
+ one: 'about 1 year',
10685
+ other: 'about {{count}} years'
10886
10686
  },
10887
- // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
10888
- X: function X(date, token, _localize, options) {
10889
- var originalDate = options._originalDate || date;
10890
- var timezoneOffset = originalDate.getTimezoneOffset();
10891
- if (timezoneOffset === 0) {
10892
- 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';
10893
10715
  }
10894
- switch (token) {
10895
- // Hours and optional minutes
10896
- case 'X':
10897
- return formatTimezoneWithOptionalMinutes(timezoneOffset);
10898
- // Hours, minutes and optional seconds without `:` delimiter
10899
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10900
- // so this token always has the same output as `XX`
10716
+ }
10717
+ return result;
10718
+ };
10719
+ var formatDistance$1 = formatDistance;
10901
10720
 
10902
- case 'XXXX':
10903
- case 'XX':
10904
- // Hours and minutes without `:` delimiter
10905
- return formatTimezone(timezoneOffset);
10906
- // Hours, minutes and optional seconds with `:` delimiter
10907
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10908
- // 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;
10909
10764
 
10910
- case 'XXXXX':
10911
- 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;
10912
10777
 
10913
- default:
10914
- 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];
10915
10790
  }
10916
- },
10917
- // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
10918
- x: function x(date, token, _localize, options) {
10919
- var originalDate = options._originalDate || date;
10920
- var timezoneOffset = originalDate.getTimezoneOffset();
10921
- switch (token) {
10922
- // Hours and optional minutes
10923
- case 'x':
10924
- return formatTimezoneWithOptionalMinutes(timezoneOffset);
10925
- // Hours, minutes and optional seconds without `:` delimiter
10926
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10927
- // so this token always has the same output as `xx`
10928
-
10929
- case 'xxxx':
10930
- case 'xx':
10931
- // Hours and minutes without `:` delimiter
10932
- return formatTimezone(timezoneOffset);
10933
- // Hours, minutes and optional seconds with `:` delimiter
10934
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10935
- // 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
+ }
10936
10796
 
10937
- case 'xxxxx':
10938
- 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
+ };
10939
10807
 
10940
- default:
10941
- return formatTimezone(timezoneOffset, ':');
10942
- }
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'
10943
10833
  },
10944
- // Timezone (GMT)
10945
- O: function O(date, token, _localize, options) {
10946
- var originalDate = options._originalDate || date;
10947
- var timezoneOffset = originalDate.getTimezoneOffset();
10948
- switch (token) {
10949
- // Short
10950
- case 'O':
10951
- case 'OO':
10952
- case 'OOO':
10953
- return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
10954
- // Long
10955
-
10956
- case 'OOOO':
10957
- default:
10958
- return 'GMT' + formatTimezone(timezoneOffset, ':');
10959
- }
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'
10960
10843
  },
10961
- // Timezone (specific non-location)
10962
- z: function z(date, token, _localize, options) {
10963
- var originalDate = options._originalDate || date;
10964
- var timezoneOffset = originalDate.getTimezoneOffset();
10965
- switch (token) {
10966
- // Short
10967
- case 'z':
10968
- case 'zz':
10969
- case 'zzz':
10970
- return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
10971
- // Long
10972
-
10973
- case 'zzzz':
10974
- default:
10975
- return 'GMT' + formatTimezone(timezoneOffset, ':');
10976
- }
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'
10977
10865
  },
10978
- // Seconds timestamp
10979
- t: function t(date, token, _localize, options) {
10980
- var originalDate = options._originalDate || date;
10981
- var timestamp = Math.floor(originalDate.getTime() / 1000);
10982
- 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'
10983
10875
  },
10984
- // Milliseconds timestamp
10985
- T: function T(date, token, _localize, options) {
10986
- var originalDate = options._originalDate || date;
10987
- var timestamp = originalDate.getTime();
10988
- 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'
10989
10885
  }
10990
10886
  };
10991
- function formatTimezoneShort(offset, dirtyDelimiter) {
10992
- var sign = offset > 0 ? '-' : '+';
10993
- var absOffset = Math.abs(offset);
10994
- var hours = Math.floor(absOffset / 60);
10995
- var minutes = absOffset % 60;
10996
- if (minutes === 0) {
10997
- return sign + String(hours);
10998
- }
10999
- var delimiter = dirtyDelimiter || '';
11000
- return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
11001
- }
11002
- function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
11003
- if (offset % 60 === 0) {
11004
- var sign = offset > 0 ? '-' : '+';
11005
- 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
+ }
11006
10907
  }
11007
- return formatTimezone(offset, dirtyDelimiter);
11008
- }
11009
- function formatTimezone(offset, dirtyDelimiter) {
11010
- var delimiter = dirtyDelimiter || '';
11011
- var sign = offset > 0 ? '-' : '+';
11012
- var absOffset = Math.abs(offset);
11013
- var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
11014
- var minutes = addLeadingZeros(absOffset % 60, 2);
11015
- 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
+ };
11016
10965
  }
11017
- var formatters$1 = formatters;
11018
-
11019
- function dateLongFormatter(pattern, formatLong) {
11020
- switch (pattern) {
11021
- case 'P':
11022
- return formatLong.date({
11023
- width: 'short'
11024
- });
11025
- case 'PP':
11026
- return formatLong.date({
11027
- width: 'medium'
11028
- });
11029
- case 'PPP':
11030
- return formatLong.date({
11031
- width: 'long'
11032
- });
11033
- case 'PPPP':
11034
- default:
11035
- return formatLong.date({
11036
- width: 'full'
11037
- });
10966
+ function findKey(object, predicate) {
10967
+ for (var key in object) {
10968
+ if (object.hasOwnProperty(key) && predicate(object[key])) {
10969
+ return key;
10970
+ }
11038
10971
  }
10972
+ return undefined;
11039
10973
  }
11040
- function timeLongFormatter(pattern, formatLong) {
11041
- switch (pattern) {
11042
- case 'p':
11043
- return formatLong.time({
11044
- width: 'short'
11045
- });
11046
- case 'pp':
11047
- return formatLong.time({
11048
- width: 'medium'
11049
- });
11050
- case 'ppp':
11051
- return formatLong.time({
11052
- width: 'long'
11053
- });
11054
- case 'pppp':
11055
- default:
11056
- return formatLong.time({
11057
- width: 'full'
11058
- });
10974
+ function findIndex(array, predicate) {
10975
+ for (var key = 0; key < array.length; key++) {
10976
+ if (predicate(array[key])) {
10977
+ return key;
10978
+ }
11059
10979
  }
10980
+ return undefined;
11060
10981
  }
11061
- function dateTimeLongFormatter(pattern, formatLong) {
11062
- var matchResult = pattern.match(/(P+)(p+)?/);
11063
- var datePattern = matchResult[1];
11064
- var timePattern = matchResult[2];
11065
- if (!timePattern) {
11066
- return dateLongFormatter(pattern, formatLong);
11067
- }
11068
- var dateTimeFormat;
11069
- switch (datePattern) {
11070
- case 'P':
11071
- dateTimeFormat = formatLong.dateTime({
11072
- width: 'short'
11073
- });
11074
- break;
11075
- case 'PP':
11076
- dateTimeFormat = formatLong.dateTime({
11077
- width: 'medium'
11078
- });
11079
- break;
11080
- case 'PPP':
11081
- dateTimeFormat = formatLong.dateTime({
11082
- width: 'long'
11083
- });
11084
- break;
11085
- case 'PPPP':
11086
- default:
11087
- dateTimeFormat = formatLong.dateTime({
11088
- width: 'full'
11089
- });
11090
- break;
11091
- }
11092
- 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
+ };
11093
10999
  }
11094
- var longFormatters = {
11095
- p: timeLongFormatter,
11096
- 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
11097
11007
  };
11098
- 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;
11099
11097
 
11100
- var MILLISECONDS_IN_MINUTE = 60000;
11101
- function getDateMillisecondsPart(date) {
11102
- return date.getTime() % MILLISECONDS_IN_MINUTE;
11103
- }
11104
11098
  /**
11105
- * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
11106
- * They usually appear for dates that denote time before the timezones were introduced
11107
- * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
11108
- * and GMT+01:00:00 after that date)
11109
- *
11110
- * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
11111
- * which would lead to incorrect calculations.
11112
- *
11113
- * 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}
11114
11106
  */
11115
-
11116
- function getTimezoneOffsetInMilliseconds(dirtyDate) {
11117
- var date = new Date(dirtyDate.getTime());
11118
- var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());
11119
- date.setSeconds(0, 0);
11120
- var hasNegativeUTCOffset = baseTimezoneOffset > 0;
11121
- var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);
11122
- return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;
11123
- }
11124
-
11125
- var protectedDayOfYearTokens = ['D', 'DD'];
11126
- var protectedWeekYearTokens = ['YY', 'YYYY'];
11127
- function isProtectedDayOfYearToken(token) {
11128
- return protectedDayOfYearTokens.indexOf(token) !== -1;
11129
- }
11130
- function isProtectedWeekYearToken(token) {
11131
- return protectedWeekYearTokens.indexOf(token) !== -1;
11132
- }
11133
- function throwProtectedError(token, format, input) {
11134
- if (token === 'YYYY') {
11135
- throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
11136
- } else if (token === 'YY') {
11137
- throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
11138
- } else if (token === 'D') {
11139
- 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"));
11140
- } else if (token === 'DD') {
11141
- 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
11142
11117
  }
11143
- }
11118
+ };
11119
+ var defaultLocale = locale;
11144
11120
 
11145
11121
  // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
11146
11122
  // (one of the certain letters followed by `o`)
@@ -11152,14 +11128,15 @@ function throwProtectedError(token, format, input) {
11152
11128
  // If there is no matching single quote
11153
11129
  // then the sequence will continue until the end of the string.
11154
11130
  // - . matches any single character unmatched by previous parts of the RegExps
11131
+ var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
11155
11132
 
11156
- 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
11157
11134
  // sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
11158
-
11159
11135
  var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
11160
11136
  var escapedStringRegExp = /^'([^]*?)'?$/;
11161
11137
  var doubleQuoteRegExp = /''/g;
11162
11138
  var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11139
+
11163
11140
  /**
11164
11141
  * @name format
11165
11142
  * @category Common Helpers
@@ -11169,7 +11146,7 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11169
11146
  * Return the formatted date string in the given format. The result may vary by locale.
11170
11147
  *
11171
11148
  * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
11172
- * > See: https://git.io/fxCyr
11149
+ * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
11173
11150
  *
11174
11151
  * The characters wrapped between two single quotes characters (') are escaped.
11175
11152
  * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
@@ -11248,32 +11225,34 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11248
11225
  * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
11249
11226
  * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
11250
11227
  * | | EEEEE | M, T, W, T, F, S, S | |
11251
- * | | EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | |
11228
+ * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
11252
11229
  * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
11253
11230
  * | | io | 1st, 2nd, ..., 7th | 7 |
11254
11231
  * | | ii | 01, 02, ..., 07 | 7 |
11255
11232
  * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
11256
11233
  * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
11257
11234
  * | | iiiii | M, T, W, T, F, S, S | 7 |
11258
- * | | iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | 7 |
11235
+ * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
11259
11236
  * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
11260
11237
  * | | eo | 2nd, 3rd, ..., 1st | 7 |
11261
11238
  * | | ee | 02, 03, ..., 01 | |
11262
11239
  * | | eee | Mon, Tue, Wed, ..., Sun | |
11263
11240
  * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
11264
11241
  * | | eeeee | M, T, W, T, F, S, S | |
11265
- * | | eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | |
11242
+ * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
11266
11243
  * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
11267
11244
  * | | co | 2nd, 3rd, ..., 1st | 7 |
11268
11245
  * | | cc | 02, 03, ..., 01 | |
11269
11246
  * | | ccc | Mon, Tue, Wed, ..., Sun | |
11270
11247
  * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
11271
11248
  * | | ccccc | M, T, W, T, F, S, S | |
11272
- * | | cccccc | Mo, Tu, We, Th, Fr, Su, Sa | |
11273
- * | 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 | |
11274
11252
  * | | aaaa | a.m., p.m. | 2 |
11275
11253
  * | | aaaaa | a, p | |
11276
- * | 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 | |
11277
11256
  * | | bbbb | a.m., p.m., noon, midnight | 2 |
11278
11257
  * | | bbbbb | a, p, n, mi | |
11279
11258
  * | Flexible day period | B..BBB | at night, in the morning, ... | |
@@ -11299,7 +11278,7 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11299
11278
  * | | ss | 00, 01, ..., 59 | |
11300
11279
  * | Fraction of second | S | 0, 1, ..., 9 | |
11301
11280
  * | | SS | 00, 01, ..., 99 | |
11302
- * | | SSS | 000, 0001, ..., 999 | |
11281
+ * | | SSS | 000, 001, ..., 999 | |
11303
11282
  * | | SSSS | ... | 3 |
11304
11283
  * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
11305
11284
  * | | XX | -0800, +0530, Z | |
@@ -11319,18 +11298,18 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11319
11298
  * | | tt | ... | 3,7 |
11320
11299
  * | Milliseconds timestamp | T | 512969520900 | 7 |
11321
11300
  * | | TT | ... | 3,7 |
11322
- * | Long localized date | P | 05/29/1453 | 7 |
11323
- * | | PP | May 29, 1453 | 7 |
11324
- * | | PPP | May 29th, 1453 | 7 |
11325
- * | | 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 |
11326
11305
  * | Long localized time | p | 12:00 AM | 7 |
11327
11306
  * | | pp | 12:00:00 AM | 7 |
11328
11307
  * | | ppp | 12:00:00 AM GMT+2 | 7 |
11329
11308
  * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
11330
- * | Combination of date and time | Pp | 05/29/1453, 12:00 AM | 7 |
11331
- * | | PPpp | May 29, 1453, 12:00:00 AM | 7 |
11332
- * | | PPPppp | May 29th, 1453 at ... | 7 |
11333
- * | | 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 |
11334
11313
  * Notes:
11335
11314
  * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
11336
11315
  * are the same as "stand-alone" units, but are different in some languages.
@@ -11403,30 +11382,10 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11403
11382
  * - `p`: long localized time
11404
11383
  *
11405
11384
  * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
11406
- * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr
11407
- *
11408
- * 9. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.
11409
- * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr
11410
- *
11411
- * ### v2.0.0 breaking changes:
11412
- *
11413
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
11414
- *
11415
- * - The second argument is now required for the sake of explicitness.
11416
- *
11417
- * ```javascript
11418
- * // Before v2.0.0
11419
- * format(new Date(2016, 0, 1))
11420
- *
11421
- * // v2.0.0 onward
11422
- * format(new Date(2016, 0, 1), "yyyy-MM-dd'T'HH:mm:ss.SSSxxx")
11423
- * ```
11385
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
11424
11386
  *
11425
- * - New format string API for `format` function
11426
- * which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).
11427
- * See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.
11428
- *
11429
- * - 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
11430
11389
  *
11431
11390
  * @param {Date|Number} date - the original date
11432
11391
  * @param {String} format - the string of tokens
@@ -11435,9 +11394,9 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11435
11394
  * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
11436
11395
  * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
11437
11396
  * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
11438
- * see: https://git.io/fxCyr
11397
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
11439
11398
  * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
11440
- * see: https://git.io/fxCyr
11399
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
11441
11400
  * @returns {String} the formatted date string
11442
11401
  * @throws {TypeError} 2 arguments required
11443
11402
  * @throws {RangeError} `date` must not be Invalid Date
@@ -11445,47 +11404,46 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11445
11404
  * @throws {RangeError} `options.locale` must contain `formatLong` property
11446
11405
  * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
11447
11406
  * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
11448
- * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
11449
- * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
11450
- * @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
11451
- * @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
11452
11411
  * @throws {RangeError} format string contains an unescaped latin alphabet character
11453
11412
  *
11454
11413
  * @example
11455
11414
  * // Represent 11 February 2014 in middle-endian format:
11456
- * var result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
11415
+ * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
11457
11416
  * //=> '02/11/2014'
11458
11417
  *
11459
11418
  * @example
11460
11419
  * // Represent 2 July 2014 in Esperanto:
11461
11420
  * import { eoLocale } from 'date-fns/locale/eo'
11462
- * 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", {
11463
11422
  * locale: eoLocale
11464
11423
  * })
11465
11424
  * //=> '2-a de julio 2014'
11466
11425
  *
11467
11426
  * @example
11468
11427
  * // Escape string by single quote characters:
11469
- * 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'")
11470
11429
  * //=> "3 o'clock"
11471
11430
  */
11472
11431
 
11473
- 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;
11474
11434
  requiredArgs(2, arguments);
11475
11435
  var formatStr = String(dirtyFormatStr);
11476
- var options = dirtyOptions || {};
11477
- var locale = options.locale || defaultLocale;
11478
- var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;
11479
- var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
11480
- 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);
11481
11439
 
11440
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
11482
11441
  if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
11483
11442
  throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
11484
11443
  }
11485
- var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;
11486
- var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
11487
- 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);
11488
11445
 
11446
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
11489
11447
  if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
11490
11448
  throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
11491
11449
  }
@@ -11498,10 +11456,11 @@ function format$1(dirtyDate, dirtyFormatStr, dirtyOptions) {
11498
11456
  var originalDate = toDate(dirtyDate);
11499
11457
  if (!isValid(originalDate)) {
11500
11458
  throw new RangeError('Invalid time value');
11501
- } // 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.
11502
11462
  // This ensures that when UTC functions will be implemented, locales will be compatible with them.
11503
11463
  // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
11504
-
11505
11464
  var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
11506
11465
  var utcDate = subMilliseconds(originalDate, timezoneOffset);
11507
11466
  var formatterOptions = {
@@ -11514,7 +11473,7 @@ function format$1(dirtyDate, dirtyFormatStr, dirtyOptions) {
11514
11473
  var firstCharacter = substring[0];
11515
11474
  if (firstCharacter === 'p' || firstCharacter === 'P') {
11516
11475
  var longFormatter = longFormatters$1[firstCharacter];
11517
- return longFormatter(substring, locale.formatLong, formatterOptions);
11476
+ return longFormatter(substring, locale.formatLong);
11518
11477
  }
11519
11478
  return substring;
11520
11479
  }).join('').match(formattingTokensRegExp).map(function (substring) {
@@ -11528,11 +11487,11 @@ function format$1(dirtyDate, dirtyFormatStr, dirtyOptions) {
11528
11487
  }
11529
11488
  var formatter = formatters$1[firstCharacter];
11530
11489
  if (formatter) {
11531
- if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {
11532
- throwProtectedError(substring, dirtyFormatStr, dirtyDate);
11490
+ if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) {
11491
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
11533
11492
  }
11534
- if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {
11535
- throwProtectedError(substring, dirtyFormatStr, dirtyDate);
11493
+ if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) {
11494
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
11536
11495
  }
11537
11496
  return formatter(utcDate, substring, locale.localize, formatterOptions);
11538
11497
  }
@@ -11544,23 +11503,28 @@ function format$1(dirtyDate, dirtyFormatStr, dirtyOptions) {
11544
11503
  return result;
11545
11504
  }
11546
11505
  function cleanEscapedString(input) {
11547
- 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, "'");
11548
11511
  }
11549
11512
 
11550
- function convertToFP(fn, arity, a) {
11551
- a = a || [];
11513
+ function convertToFP(fn, arity) {
11514
+ var a = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
11552
11515
  if (a.length >= arity) {
11553
11516
  return fn.apply(null, a.slice(0, arity).reverse());
11554
11517
  }
11555
11518
  return function () {
11556
- 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
+ }
11557
11522
  return convertToFP(fn, arity, a.concat(args));
11558
11523
  };
11559
11524
  }
11560
11525
 
11561
- // This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
11562
- var format = convertToFP(format$1, 2);
11563
- 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);
11564
11528
 
11565
11529
  var Wrapper = index$9(View)(function () {
11566
11530
  return {
@@ -12326,7 +12290,7 @@ var StyledPageControlWrapper = index$9(View)(function (_ref7) {
12326
12290
  });
12327
12291
 
12328
12292
  function isCarouselImageProps(image) {
12329
- return _typeof(image) === 'object';
12293
+ return _typeof$1(image) === 'object';
12330
12294
  }
12331
12295
  var CarouselItem = function CarouselItem(_ref) {
12332
12296
  var width = _ref.width,
@@ -18787,7 +18751,7 @@ var scheduler_production_min = {};
18787
18751
  var c = a.sortIndex - b.sortIndex;
18788
18752
  return 0 !== c ? c : a.id - b.id;
18789
18753
  }
18790
- 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) {
18791
18755
  var l = performance;
18792
18756
  exports.unstable_now = function () {
18793
18757
  return l.now();
@@ -18958,7 +18922,7 @@ var scheduler_production_min = {};
18958
18922
  };
18959
18923
  exports.unstable_scheduleCallback = function (a, b, c) {
18960
18924
  var d = exports.unstable_now();
18961
- "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;
18962
18926
  switch (a) {
18963
18927
  case 1:
18964
18928
  var e = -1;
@@ -19036,7 +19000,7 @@ function oa(a) {
19036
19000
  }
19037
19001
  function pa(a, b, c, d) {
19038
19002
  if (null !== c && 0 === c.type) return !1;
19039
- switch (_typeof(b)) {
19003
+ switch (_typeof$1(b)) {
19040
19004
  case "function":
19041
19005
  case "symbol":
19042
19006
  return !0;
@@ -19146,7 +19110,7 @@ var ua = aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
19146
19110
  var Ia = Symbol["for"]("react.offscreen");
19147
19111
  var Ja = Symbol.iterator;
19148
19112
  function Ka(a) {
19149
- if (null === a || "object" !== _typeof(a)) return null;
19113
+ if (null === a || "object" !== _typeof$1(a)) return null;
19150
19114
  a = Ja && a[Ja] || a["@@iterator"];
19151
19115
  return "function" === typeof a ? a : null;
19152
19116
  }
@@ -19175,7 +19139,7 @@ function Oa(a, b) {
19175
19139
  set: function set() {
19176
19140
  throw Error();
19177
19141
  }
19178
- }), "object" === (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && Reflect.construct) {
19142
+ }), "object" === (typeof Reflect === "undefined" ? "undefined" : _typeof$1(Reflect)) && Reflect.construct) {
19179
19143
  try {
19180
19144
  Reflect.construct(b, []);
19181
19145
  } catch (l) {
@@ -19257,7 +19221,7 @@ function Qa(a) {
19257
19221
  case Fa:
19258
19222
  return "SuspenseList";
19259
19223
  }
19260
- if ("object" === _typeof(a)) switch (a.$$typeof) {
19224
+ if ("object" === _typeof$1(a)) switch (a.$$typeof) {
19261
19225
  case Ca:
19262
19226
  return (a.displayName || "Context") + ".Consumer";
19263
19227
  case Ba:
@@ -19329,7 +19293,7 @@ function Ra(a) {
19329
19293
  return null;
19330
19294
  }
19331
19295
  function Sa(a) {
19332
- switch (_typeof(a)) {
19296
+ switch (_typeof$1(a)) {
19333
19297
  case "boolean":
19334
19298
  case "number":
19335
19299
  case "string":
@@ -19640,9 +19604,9 @@ function ub(a, b) {
19640
19604
  if (tb[a] && (null != b.children || null != b.dangerouslySetInnerHTML)) throw Error(p(137, a));
19641
19605
  if (null != b.dangerouslySetInnerHTML) {
19642
19606
  if (null != b.children) throw Error(p(60));
19643
- 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));
19644
19608
  }
19645
- 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));
19646
19610
  }
19647
19611
  }
19648
19612
  function vb(a, b) {
@@ -19728,7 +19692,7 @@ function Kb(a, b) {
19728
19692
  a = !1;
19729
19693
  }
19730
19694
  if (a) return null;
19731
- 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)));
19732
19696
  return c;
19733
19697
  }
19734
19698
  var Lb = !1;
@@ -20642,7 +20606,7 @@ function ge(a, b) {
20642
20606
  }
20643
20607
  function he(a) {
20644
20608
  a = a.detail;
20645
- return "object" === _typeof(a) && "data" in a ? a.data : null;
20609
+ return "object" === _typeof$1(a) && "data" in a ? a.data : null;
20646
20610
  }
20647
20611
  var ie = !1;
20648
20612
  function je(a, b) {
@@ -20759,7 +20723,7 @@ function Ge(a, b) {
20759
20723
  var He = "function" === typeof Object.is ? Object.is : Ge;
20760
20724
  function Ie(a, b) {
20761
20725
  if (He(a, b)) return !0;
20762
- 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;
20763
20727
  var c = Object.keys(a),
20764
20728
  d = Object.keys(b);
20765
20729
  if (c.length !== d.length) return !1;
@@ -21286,7 +21250,7 @@ function Bf() {}
21286
21250
  var Cf = null,
21287
21251
  Df = null;
21288
21252
  function Ef(a, b) {
21289
- 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;
21290
21254
  }
21291
21255
  var Ff = "function" === typeof setTimeout ? setTimeout : void 0,
21292
21256
  Gf = "function" === typeof clearTimeout ? clearTimeout : void 0,
@@ -21934,7 +21898,7 @@ function ph(a, b, c) {
21934
21898
  var d = !1,
21935
21899
  e = Vf;
21936
21900
  var f = b.contextType;
21937
- "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);
21938
21902
  b = new b(c, f);
21939
21903
  a.memoizedState = null !== b.state && void 0 !== b.state ? b.state : null;
21940
21904
  b.updater = nh;
@@ -21956,7 +21920,7 @@ function rh(a, b, c, d) {
21956
21920
  e.refs = jh;
21957
21921
  ah(a);
21958
21922
  var f = b.contextType;
21959
- "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));
21960
21924
  e.state = a.memoizedState;
21961
21925
  f = b.getDerivedStateFromProps;
21962
21926
  "function" === typeof f && (kh(a, b, f, c), e.state = a.memoizedState);
@@ -21965,7 +21929,7 @@ function rh(a, b, c, d) {
21965
21929
  }
21966
21930
  function sh(a, b, c) {
21967
21931
  a = c.ref;
21968
- if (null !== a && "function" !== typeof a && "object" !== _typeof(a)) {
21932
+ if (null !== a && "function" !== typeof a && "object" !== _typeof$1(a)) {
21969
21933
  if (c._owner) {
21970
21934
  c = c._owner;
21971
21935
  if (c) {
@@ -22040,7 +22004,7 @@ function vh(a) {
22040
22004
  function k(a, b, c, d) {
22041
22005
  var f = c.type;
22042
22006
  if (f === ya) return m(a, b, c.props.children, d, c.key);
22043
- 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;
22044
22008
  d = yh(c.type, c.key, c.props, null, a.mode, d);
22045
22009
  d.ref = sh(a, b, c);
22046
22010
  d["return"] = a;
@@ -22060,7 +22024,7 @@ function vh(a) {
22060
22024
  }
22061
22025
  function q(a, b, c) {
22062
22026
  if ("string" === typeof b && "" !== b || "number" === typeof b) return b = xh("" + b, a.mode, c), b["return"] = a, b;
22063
- if ("object" === _typeof(b) && null !== b) {
22027
+ if ("object" === _typeof$1(b) && null !== b) {
22064
22028
  switch (b.$$typeof) {
22065
22029
  case va:
22066
22030
  return c = yh(b.type, b.key, b.props, null, a.mode, c), c.ref = sh(a, null, b), c["return"] = a, c;
@@ -22078,7 +22042,7 @@ function vh(a) {
22078
22042
  function r(a, b, c, d) {
22079
22043
  var e = null !== b ? b.key : null;
22080
22044
  if ("string" === typeof c && "" !== c || "number" === typeof c) return null !== e ? null : h(a, b, "" + c, d);
22081
- if ("object" === _typeof(c) && null !== c) {
22045
+ if ("object" === _typeof$1(c) && null !== c) {
22082
22046
  switch (c.$$typeof) {
22083
22047
  case va:
22084
22048
  return c.key === e ? k(a, b, c, d) : null;
@@ -22094,7 +22058,7 @@ function vh(a) {
22094
22058
  }
22095
22059
  function y(a, b, c, d, e) {
22096
22060
  if ("string" === typeof d && "" !== d || "number" === typeof d) return a = a.get(c) || null, h(b, a, "" + d, e);
22097
- if ("object" === _typeof(d) && null !== d) {
22061
+ if ("object" === _typeof$1(d) && null !== d) {
22098
22062
  switch (d.$$typeof) {
22099
22063
  case va:
22100
22064
  return a = a.get(null === d.key ? c : d.key) || null, k(b, a, d, e);
@@ -22168,8 +22132,8 @@ function vh(a) {
22168
22132
  return l;
22169
22133
  }
22170
22134
  function J(a, d, f, h) {
22171
- "object" === _typeof(f) && null !== f && f.type === ya && null === f.key && (f = f.props.children);
22172
- 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) {
22173
22137
  switch (f.$$typeof) {
22174
22138
  case va:
22175
22139
  a: {
@@ -22184,7 +22148,7 @@ function vh(a) {
22184
22148
  a = d;
22185
22149
  break a;
22186
22150
  }
22187
- } 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) {
22188
22152
  c(a, l.sibling);
22189
22153
  d = e(l, f.props);
22190
22154
  d.ref = sh(a, l, f);
@@ -23069,7 +23033,7 @@ function ij(a, b, c, d, e) {
23069
23033
  g.props = h;
23070
23034
  var k = g.context,
23071
23035
  l = c.contextType;
23072
- "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));
23073
23037
  var m = c.getDerivedStateFromProps,
23074
23038
  q = "function" === typeof m || "function" === typeof g.getSnapshotBeforeUpdate;
23075
23039
  q || "function" !== typeof g.UNSAFE_componentWillReceiveProps && "function" !== typeof g.componentWillReceiveProps || (h !== d || k !== l) && qh(b, g, d, l);
@@ -23088,7 +23052,7 @@ function ij(a, b, c, d, e) {
23088
23052
  q = b.pendingProps;
23089
23053
  r = g.context;
23090
23054
  k = c.contextType;
23091
- "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));
23092
23056
  var y = c.getDerivedStateFromProps;
23093
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);
23094
23058
  $g = !1;
@@ -25001,7 +24965,7 @@ function Nk(a, b) {
25001
24965
  k = b;
25002
24966
  b = Z;
25003
24967
  h.flags |= 32768;
25004
- if (null !== k && "object" === _typeof(k) && "function" === typeof k.then) {
24968
+ if (null !== k && "object" === _typeof$1(k) && "function" === typeof k.then) {
25005
24969
  var l = k,
25006
24970
  m = h,
25007
24971
  q = m.tag;
@@ -25422,7 +25386,7 @@ Wk = function Wk(a, b, c) {
25422
25386
  e = Xh(null, b, d, a, e, c);
25423
25387
  var f = bi();
25424
25388
  b.flags |= 1;
25425
- "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);
25426
25390
  return b;
25427
25391
  case 16:
25428
25392
  d = b.elementType;
@@ -25663,7 +25627,7 @@ function yh(a, b, c, d, e, f) {
25663
25627
  case Ia:
25664
25628
  return qj(c, e, f, b);
25665
25629
  default:
25666
- if ("object" === _typeof(a) && null !== a) switch (a.$$typeof) {
25630
+ if ("object" === _typeof$1(a) && null !== a) switch (a.$$typeof) {
25667
25631
  case Ba:
25668
25632
  g = 10;
25669
25633
  break a;
@@ -25681,7 +25645,7 @@ function yh(a, b, c, d, e, f) {
25681
25645
  d = null;
25682
25646
  break a;
25683
25647
  }
25684
- throw Error(p(130, null == a ? a : _typeof(a), ""));
25648
+ throw Error(p(130, null == a ? a : _typeof$1(a), ""));
25685
25649
  }
25686
25650
  b = Bg(g, c, b, e);
25687
25651
  b.elementType = a;
@@ -26175,7 +26139,7 @@ function checkDCE() {
26175
26139
  });
26176
26140
  }, r.t = function (e, t) {
26177
26141
  if (1 & t && (e = r(e)), 8 & t) return e;
26178
- if (4 & t && "object" == _typeof(e) && e && e.__esModule) return e;
26142
+ if (4 & t && "object" == _typeof$1(e) && e && e.__esModule) return e;
26179
26143
  var n = Object.create(null);
26180
26144
  if (r.r(n), Object.defineProperty(n, "default", {
26181
26145
  enumerable: !0,
@@ -26397,7 +26361,7 @@ function checkDCE() {
26397
26361
  }, t.parseHotkey = c, t.compareHotkey = l, t.toKeyCode = d, t.toKeyName = f;
26398
26362
  }, function (e, t) {
26399
26363
  e.exports = function (e) {
26400
- var t = _typeof(e);
26364
+ var t = _typeof$1(e);
26401
26365
  return null != e && ("object" == t || "function" == t);
26402
26366
  };
26403
26367
  }, function (e, t, r) {
@@ -26425,7 +26389,7 @@ function checkDCE() {
26425
26389
  };
26426
26390
  }, function (e, t, r) {
26427
26391
  var n = r(11),
26428
- 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,
26429
26393
  o = n || u || Function("return this")();
26430
26394
  e.exports = o;
26431
26395
  }, function (e, t, r) {
@@ -26440,7 +26404,7 @@ function checkDCE() {
26440
26404
  };
26441
26405
  }, function (e, t, r) {
26442
26406
  (function (t) {
26443
- var r = "object" == _typeof(t) && t && t.Object === Object && t;
26407
+ var r = "object" == _typeof$1(t) && t && t.Object === Object && t;
26444
26408
  e.exports = r;
26445
26409
  }).call(this, r(12));
26446
26410
  }, function (e, t) {
@@ -26451,7 +26415,7 @@ function checkDCE() {
26451
26415
  try {
26452
26416
  r = r || new Function("return this")();
26453
26417
  } catch (e) {
26454
- "object" == (typeof window === "undefined" ? "undefined" : _typeof(window)) && (r = window);
26418
+ "object" == (typeof window === "undefined" ? "undefined" : _typeof$1(window)) && (r = window);
26455
26419
  }
26456
26420
  e.exports = r;
26457
26421
  }, function (e, t, r) {
@@ -26478,7 +26442,7 @@ function checkDCE() {
26478
26442
  var n = r(15),
26479
26443
  u = r(18);
26480
26444
  e.exports = function (e) {
26481
- return "symbol" == _typeof(e) || u(e) && "[object Symbol]" == n(e);
26445
+ return "symbol" == _typeof$1(e) || u(e) && "[object Symbol]" == n(e);
26482
26446
  };
26483
26447
  }, function (e, t, r) {
26484
26448
  var n = r(8),
@@ -26511,7 +26475,7 @@ function checkDCE() {
26511
26475
  };
26512
26476
  }, function (e, t) {
26513
26477
  e.exports = function (e) {
26514
- return null != e && "object" == _typeof(e);
26478
+ return null != e && "object" == _typeof$1(e);
26515
26479
  };
26516
26480
  }, function (e, t, r) {
26517
26481
 
@@ -26592,7 +26556,7 @@ function checkDCE() {
26592
26556
  }
26593
26557
  function c(e) {
26594
26558
  return !!e && (function (e) {
26595
- if (!e || "object" != _typeof(e)) return !1;
26559
+ if (!e || "object" != _typeof$1(e)) return !1;
26596
26560
  var t = Object.getPrototypeOf(e);
26597
26561
  if (null === t) return !0;
26598
26562
  var r = Object.hasOwnProperty.call(t, "constructor") && t.constructor;
@@ -26601,7 +26565,7 @@ function checkDCE() {
26601
26565
  }
26602
26566
  function l(e, t, r) {
26603
26567
  void 0 === r && (r = !1), 0 === d(e) ? (r ? Object.keys : Z)(e).forEach(function (n) {
26604
- r && "symbol" == _typeof(n) || t(n, e[n], e);
26568
+ r && "symbol" == _typeof$1(n) || t(n, e[n], e);
26605
26569
  }) : e.forEach(function (r, n) {
26606
26570
  return t(n, r, e);
26607
26571
  });
@@ -26657,7 +26621,7 @@ function checkDCE() {
26657
26621
  i(2);
26658
26622
  }
26659
26623
  function b(e) {
26660
- return null == e || "object" != _typeof(e) || Object.isFrozen(e);
26624
+ return null == e || "object" != _typeof$1(e) || Object.isFrozen(e);
26661
26625
  }
26662
26626
  function y(e) {
26663
26627
  var t = Q[e];
@@ -26794,7 +26758,7 @@ function checkDCE() {
26794
26758
  }
26795
26759
  var W,
26796
26760
  V,
26797
- q = "undefined" != typeof Symbol && "symbol" == _typeof(Symbol("x")),
26761
+ q = "undefined" != typeof Symbol && "symbol" == _typeof$1(Symbol("x")),
26798
26762
  H = "undefined" != typeof Map,
26799
26763
  U = "undefined" != typeof Set,
26800
26764
  K = "undefined" != typeof Proxy && void 0 !== Proxy.revocable && "undefined" != typeof Reflect,
@@ -26909,7 +26873,7 @@ function checkDCE() {
26909
26873
  throw w(s), e;
26910
26874
  }) : (F(s, n), k(a, s));
26911
26875
  }
26912
- if (!e || "object" != _typeof(e)) {
26876
+ if (!e || "object" != _typeof$1(e)) {
26913
26877
  if ((a = r(e)) === $) return;
26914
26878
  return void 0 === a && (a = e), t.F && m(a, !0), a;
26915
26879
  }
@@ -31144,7 +31108,7 @@ function checkDCE() {
31144
31108
  Ut = r(6),
31145
31109
  Kt = r.n(Ut);
31146
31110
  function $t(e) {
31147
- return null != e && "object" == _typeof(e) && 1 === e.nodeType;
31111
+ return null != e && "object" == _typeof$1(e) && 1 === e.nodeType;
31148
31112
  }
31149
31113
  function Jt(e, t) {
31150
31114
  return (!t || "hidden" !== e) && "visible" !== e && "clip" !== e;