@everymatrix/casino-search 1.38.0 → 1.39.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.
@@ -777,7 +777,7 @@
777
777
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
778
778
  PERFORMANCE OF THIS SOFTWARE.
779
779
  ***************************************************************************** */
780
- /* global Reflect, Promise, SuppressedError, Symbol */
780
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
781
781
 
782
782
  var extendStatics$1 = function(d, b) {
783
783
  extendStatics$1 = Object.setPrototypeOf ||
@@ -5763,6 +5763,7 @@
5763
5763
 
5764
5764
  Response.error = function() {
5765
5765
  var response = new Response(null, {status: 200, statusText: ''});
5766
+ response.ok = false;
5766
5767
  response.status = 0;
5767
5768
  response.type = 'error';
5768
5769
  return response
@@ -5813,7 +5814,7 @@
5813
5814
  };
5814
5815
  // This check if specifically for when a user fetches a file locally from the file system
5815
5816
  // Only if the status is out of a normal range
5816
- if (request.url.startsWith('file://') && (xhr.status < 200 || xhr.status > 599)) {
5817
+ if (request.url.indexOf('file://') === 0 && (xhr.status < 200 || xhr.status > 599)) {
5817
5818
  options.status = 200;
5818
5819
  } else {
5819
5820
  options.status = xhr.status;
@@ -5947,7 +5948,7 @@
5947
5948
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
5948
5949
  PERFORMANCE OF THIS SOFTWARE.
5949
5950
  ***************************************************************************** */
5950
- /* global Reflect, Promise, SuppressedError, Symbol */
5951
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
5951
5952
 
5952
5953
  var extendStatics = function(d, b) {
5953
5954
  extendStatics = Object.setPrototypeOf ||
@@ -6943,24 +6944,25 @@
6943
6944
  }
6944
6945
 
6945
6946
  function isValid(m) {
6946
- if (m._isValid == null) {
6947
- var flags = getParsingFlags(m),
6948
- parsedParts = some.call(flags.parsedDateParts, function (i) {
6949
- return i != null;
6950
- }),
6951
- isNowValid =
6952
- !isNaN(m._d.getTime()) &&
6953
- flags.overflow < 0 &&
6954
- !flags.empty &&
6955
- !flags.invalidEra &&
6956
- !flags.invalidMonth &&
6957
- !flags.invalidWeekday &&
6958
- !flags.weekdayMismatch &&
6959
- !flags.nullInput &&
6960
- !flags.invalidFormat &&
6961
- !flags.userInvalidated &&
6962
- (!flags.meridiem || (flags.meridiem && parsedParts));
6963
-
6947
+ var flags = null,
6948
+ parsedParts = false,
6949
+ isNowValid = m._d && !isNaN(m._d.getTime());
6950
+ if (isNowValid) {
6951
+ flags = getParsingFlags(m);
6952
+ parsedParts = some.call(flags.parsedDateParts, function (i) {
6953
+ return i != null;
6954
+ });
6955
+ isNowValid =
6956
+ flags.overflow < 0 &&
6957
+ !flags.empty &&
6958
+ !flags.invalidEra &&
6959
+ !flags.invalidMonth &&
6960
+ !flags.invalidWeekday &&
6961
+ !flags.weekdayMismatch &&
6962
+ !flags.nullInput &&
6963
+ !flags.invalidFormat &&
6964
+ !flags.userInvalidated &&
6965
+ (!flags.meridiem || (flags.meridiem && parsedParts));
6964
6966
  if (m._strict) {
6965
6967
  isNowValid =
6966
6968
  isNowValid &&
@@ -6968,12 +6970,11 @@
6968
6970
  flags.unusedTokens.length === 0 &&
6969
6971
  flags.bigHour === undefined;
6970
6972
  }
6971
-
6972
- if (Object.isFrozen == null || !Object.isFrozen(m)) {
6973
- m._isValid = isNowValid;
6974
- } else {
6975
- return isNowValid;
6976
- }
6973
+ }
6974
+ if (Object.isFrozen == null || !Object.isFrozen(m)) {
6975
+ m._isValid = isNowValid;
6976
+ } else {
6977
+ return isNowValid;
6977
6978
  }
6978
6979
  return m._isValid;
6979
6980
  }
@@ -7418,12 +7419,56 @@
7418
7419
  return isFunction(format) ? format(output) : format.replace(/%s/i, output);
7419
7420
  }
7420
7421
 
7421
- var aliases = {};
7422
-
7423
- function addUnitAlias(unit, shorthand) {
7424
- var lowerCase = unit.toLowerCase();
7425
- aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
7426
- }
7422
+ var aliases = {
7423
+ D: 'date',
7424
+ dates: 'date',
7425
+ date: 'date',
7426
+ d: 'day',
7427
+ days: 'day',
7428
+ day: 'day',
7429
+ e: 'weekday',
7430
+ weekdays: 'weekday',
7431
+ weekday: 'weekday',
7432
+ E: 'isoWeekday',
7433
+ isoweekdays: 'isoWeekday',
7434
+ isoweekday: 'isoWeekday',
7435
+ DDD: 'dayOfYear',
7436
+ dayofyears: 'dayOfYear',
7437
+ dayofyear: 'dayOfYear',
7438
+ h: 'hour',
7439
+ hours: 'hour',
7440
+ hour: 'hour',
7441
+ ms: 'millisecond',
7442
+ milliseconds: 'millisecond',
7443
+ millisecond: 'millisecond',
7444
+ m: 'minute',
7445
+ minutes: 'minute',
7446
+ minute: 'minute',
7447
+ M: 'month',
7448
+ months: 'month',
7449
+ month: 'month',
7450
+ Q: 'quarter',
7451
+ quarters: 'quarter',
7452
+ quarter: 'quarter',
7453
+ s: 'second',
7454
+ seconds: 'second',
7455
+ second: 'second',
7456
+ gg: 'weekYear',
7457
+ weekyears: 'weekYear',
7458
+ weekyear: 'weekYear',
7459
+ GG: 'isoWeekYear',
7460
+ isoweekyears: 'isoWeekYear',
7461
+ isoweekyear: 'isoWeekYear',
7462
+ w: 'week',
7463
+ weeks: 'week',
7464
+ week: 'week',
7465
+ W: 'isoWeek',
7466
+ isoweeks: 'isoWeek',
7467
+ isoweek: 'isoWeek',
7468
+ y: 'year',
7469
+ years: 'year',
7470
+ year: 'year',
7471
+ };
7427
7472
 
7428
7473
  function normalizeUnits(units) {
7429
7474
  return typeof units === 'string'
@@ -7448,11 +7493,24 @@
7448
7493
  return normalizedInput;
7449
7494
  }
7450
7495
 
7451
- var priorities = {};
7452
-
7453
- function addUnitPriority(unit, priority) {
7454
- priorities[unit] = priority;
7455
- }
7496
+ var priorities = {
7497
+ date: 9,
7498
+ day: 11,
7499
+ weekday: 11,
7500
+ isoWeekday: 11,
7501
+ dayOfYear: 4,
7502
+ hour: 13,
7503
+ millisecond: 16,
7504
+ minute: 14,
7505
+ month: 8,
7506
+ quarter: 7,
7507
+ second: 15,
7508
+ weekYear: 1,
7509
+ isoWeekYear: 1,
7510
+ week: 5,
7511
+ isoWeek: 5,
7512
+ year: 1,
7513
+ };
7456
7514
 
7457
7515
  function getPrioritizedUnits(unitsObj) {
7458
7516
  var units = [],
@@ -7468,96 +7526,6 @@
7468
7526
  return units;
7469
7527
  }
7470
7528
 
7471
- function isLeapYear(year) {
7472
- return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
7473
- }
7474
-
7475
- function absFloor(number) {
7476
- if (number < 0) {
7477
- // -0 -> 0
7478
- return Math.ceil(number) || 0;
7479
- } else {
7480
- return Math.floor(number);
7481
- }
7482
- }
7483
-
7484
- function toInt(argumentForCoercion) {
7485
- var coercedNumber = +argumentForCoercion,
7486
- value = 0;
7487
-
7488
- if (coercedNumber !== 0 && isFinite(coercedNumber)) {
7489
- value = absFloor(coercedNumber);
7490
- }
7491
-
7492
- return value;
7493
- }
7494
-
7495
- function makeGetSet(unit, keepTime) {
7496
- return function (value) {
7497
- if (value != null) {
7498
- set$1(this, unit, value);
7499
- hooks.updateOffset(this, keepTime);
7500
- return this;
7501
- } else {
7502
- return get(this, unit);
7503
- }
7504
- };
7505
- }
7506
-
7507
- function get(mom, unit) {
7508
- return mom.isValid()
7509
- ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]()
7510
- : NaN;
7511
- }
7512
-
7513
- function set$1(mom, unit, value) {
7514
- if (mom.isValid() && !isNaN(value)) {
7515
- if (
7516
- unit === 'FullYear' &&
7517
- isLeapYear(mom.year()) &&
7518
- mom.month() === 1 &&
7519
- mom.date() === 29
7520
- ) {
7521
- value = toInt(value);
7522
- mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](
7523
- value,
7524
- mom.month(),
7525
- daysInMonth(value, mom.month())
7526
- );
7527
- } else {
7528
- mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
7529
- }
7530
- }
7531
- }
7532
-
7533
- // MOMENTS
7534
-
7535
- function stringGet(units) {
7536
- units = normalizeUnits(units);
7537
- if (isFunction(this[units])) {
7538
- return this[units]();
7539
- }
7540
- return this;
7541
- }
7542
-
7543
- function stringSet(units, value) {
7544
- if (typeof units === 'object') {
7545
- units = normalizeObjectUnits(units);
7546
- var prioritized = getPrioritizedUnits(units),
7547
- i,
7548
- prioritizedLen = prioritized.length;
7549
- for (i = 0; i < prioritizedLen; i++) {
7550
- this[prioritized[i].unit](units[prioritized[i].unit]);
7551
- }
7552
- } else {
7553
- units = normalizeUnits(units);
7554
- if (isFunction(this[units])) {
7555
- return this[units](value);
7556
- }
7557
- }
7558
- return this;
7559
- }
7560
-
7561
7529
  var match1 = /\d/, // 0 - 9
7562
7530
  match2 = /\d\d/, // 00 - 99
7563
7531
  match3 = /\d{3}/, // 000 - 999
@@ -7578,6 +7546,8 @@
7578
7546
  // includes scottish gaelic two word and hyphenated months
7579
7547
  matchWord =
7580
7548
  /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,
7549
+ match1to2NoLeadingZero = /^[1-9]\d?/, // 1-99
7550
+ match1to2HasZero = /^([1-9]\d|\d)/, // 0-99
7581
7551
  regexes;
7582
7552
 
7583
7553
  regexes = {};
@@ -7616,6 +7586,26 @@
7616
7586
  return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
7617
7587
  }
7618
7588
 
7589
+ function absFloor(number) {
7590
+ if (number < 0) {
7591
+ // -0 -> 0
7592
+ return Math.ceil(number) || 0;
7593
+ } else {
7594
+ return Math.floor(number);
7595
+ }
7596
+ }
7597
+
7598
+ function toInt(argumentForCoercion) {
7599
+ var coercedNumber = +argumentForCoercion,
7600
+ value = 0;
7601
+
7602
+ if (coercedNumber !== 0 && isFinite(coercedNumber)) {
7603
+ value = absFloor(coercedNumber);
7604
+ }
7605
+
7606
+ return value;
7607
+ }
7608
+
7619
7609
  var tokens = {};
7620
7610
 
7621
7611
  function addParseToken(token, callback) {
@@ -7649,6 +7639,10 @@
7649
7639
  }
7650
7640
  }
7651
7641
 
7642
+ function isLeapYear(year) {
7643
+ return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
7644
+ }
7645
+
7652
7646
  var YEAR = 0,
7653
7647
  MONTH = 1,
7654
7648
  DATE = 2,
@@ -7659,6 +7653,173 @@
7659
7653
  WEEK = 7,
7660
7654
  WEEKDAY = 8;
7661
7655
 
7656
+ // FORMATTING
7657
+
7658
+ addFormatToken('Y', 0, 0, function () {
7659
+ var y = this.year();
7660
+ return y <= 9999 ? zeroFill(y, 4) : '+' + y;
7661
+ });
7662
+
7663
+ addFormatToken(0, ['YY', 2], 0, function () {
7664
+ return this.year() % 100;
7665
+ });
7666
+
7667
+ addFormatToken(0, ['YYYY', 4], 0, 'year');
7668
+ addFormatToken(0, ['YYYYY', 5], 0, 'year');
7669
+ addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
7670
+
7671
+ // PARSING
7672
+
7673
+ addRegexToken('Y', matchSigned);
7674
+ addRegexToken('YY', match1to2, match2);
7675
+ addRegexToken('YYYY', match1to4, match4);
7676
+ addRegexToken('YYYYY', match1to6, match6);
7677
+ addRegexToken('YYYYYY', match1to6, match6);
7678
+
7679
+ addParseToken(['YYYYY', 'YYYYYY'], YEAR);
7680
+ addParseToken('YYYY', function (input, array) {
7681
+ array[YEAR] =
7682
+ input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
7683
+ });
7684
+ addParseToken('YY', function (input, array) {
7685
+ array[YEAR] = hooks.parseTwoDigitYear(input);
7686
+ });
7687
+ addParseToken('Y', function (input, array) {
7688
+ array[YEAR] = parseInt(input, 10);
7689
+ });
7690
+
7691
+ // HELPERS
7692
+
7693
+ function daysInYear(year) {
7694
+ return isLeapYear(year) ? 366 : 365;
7695
+ }
7696
+
7697
+ // HOOKS
7698
+
7699
+ hooks.parseTwoDigitYear = function (input) {
7700
+ return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
7701
+ };
7702
+
7703
+ // MOMENTS
7704
+
7705
+ var getSetYear = makeGetSet('FullYear', true);
7706
+
7707
+ function getIsLeapYear() {
7708
+ return isLeapYear(this.year());
7709
+ }
7710
+
7711
+ function makeGetSet(unit, keepTime) {
7712
+ return function (value) {
7713
+ if (value != null) {
7714
+ set$1(this, unit, value);
7715
+ hooks.updateOffset(this, keepTime);
7716
+ return this;
7717
+ } else {
7718
+ return get(this, unit);
7719
+ }
7720
+ };
7721
+ }
7722
+
7723
+ function get(mom, unit) {
7724
+ if (!mom.isValid()) {
7725
+ return NaN;
7726
+ }
7727
+
7728
+ var d = mom._d,
7729
+ isUTC = mom._isUTC;
7730
+
7731
+ switch (unit) {
7732
+ case 'Milliseconds':
7733
+ return isUTC ? d.getUTCMilliseconds() : d.getMilliseconds();
7734
+ case 'Seconds':
7735
+ return isUTC ? d.getUTCSeconds() : d.getSeconds();
7736
+ case 'Minutes':
7737
+ return isUTC ? d.getUTCMinutes() : d.getMinutes();
7738
+ case 'Hours':
7739
+ return isUTC ? d.getUTCHours() : d.getHours();
7740
+ case 'Date':
7741
+ return isUTC ? d.getUTCDate() : d.getDate();
7742
+ case 'Day':
7743
+ return isUTC ? d.getUTCDay() : d.getDay();
7744
+ case 'Month':
7745
+ return isUTC ? d.getUTCMonth() : d.getMonth();
7746
+ case 'FullYear':
7747
+ return isUTC ? d.getUTCFullYear() : d.getFullYear();
7748
+ default:
7749
+ return NaN; // Just in case
7750
+ }
7751
+ }
7752
+
7753
+ function set$1(mom, unit, value) {
7754
+ var d, isUTC, year, month, date;
7755
+
7756
+ if (!mom.isValid() || isNaN(value)) {
7757
+ return;
7758
+ }
7759
+
7760
+ d = mom._d;
7761
+ isUTC = mom._isUTC;
7762
+
7763
+ switch (unit) {
7764
+ case 'Milliseconds':
7765
+ return void (isUTC
7766
+ ? d.setUTCMilliseconds(value)
7767
+ : d.setMilliseconds(value));
7768
+ case 'Seconds':
7769
+ return void (isUTC ? d.setUTCSeconds(value) : d.setSeconds(value));
7770
+ case 'Minutes':
7771
+ return void (isUTC ? d.setUTCMinutes(value) : d.setMinutes(value));
7772
+ case 'Hours':
7773
+ return void (isUTC ? d.setUTCHours(value) : d.setHours(value));
7774
+ case 'Date':
7775
+ return void (isUTC ? d.setUTCDate(value) : d.setDate(value));
7776
+ // case 'Day': // Not real
7777
+ // return void (isUTC ? d.setUTCDay(value) : d.setDay(value));
7778
+ // case 'Month': // Not used because we need to pass two variables
7779
+ // return void (isUTC ? d.setUTCMonth(value) : d.setMonth(value));
7780
+ case 'FullYear':
7781
+ break; // See below ...
7782
+ default:
7783
+ return; // Just in case
7784
+ }
7785
+
7786
+ year = value;
7787
+ month = mom.month();
7788
+ date = mom.date();
7789
+ date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date;
7790
+ void (isUTC
7791
+ ? d.setUTCFullYear(year, month, date)
7792
+ : d.setFullYear(year, month, date));
7793
+ }
7794
+
7795
+ // MOMENTS
7796
+
7797
+ function stringGet(units) {
7798
+ units = normalizeUnits(units);
7799
+ if (isFunction(this[units])) {
7800
+ return this[units]();
7801
+ }
7802
+ return this;
7803
+ }
7804
+
7805
+ function stringSet(units, value) {
7806
+ if (typeof units === 'object') {
7807
+ units = normalizeObjectUnits(units);
7808
+ var prioritized = getPrioritizedUnits(units),
7809
+ i,
7810
+ prioritizedLen = prioritized.length;
7811
+ for (i = 0; i < prioritizedLen; i++) {
7812
+ this[prioritized[i].unit](units[prioritized[i].unit]);
7813
+ }
7814
+ } else {
7815
+ units = normalizeUnits(units);
7816
+ if (isFunction(this[units])) {
7817
+ return this[units](value);
7818
+ }
7819
+ }
7820
+ return this;
7821
+ }
7822
+
7662
7823
  function mod(n, x) {
7663
7824
  return ((n % x) + x) % x;
7664
7825
  }
@@ -7707,17 +7868,9 @@
7707
7868
  return this.localeData().months(this, format);
7708
7869
  });
7709
7870
 
7710
- // ALIASES
7711
-
7712
- addUnitAlias('month', 'M');
7713
-
7714
- // PRIORITY
7715
-
7716
- addUnitPriority('month', 8);
7717
-
7718
7871
  // PARSING
7719
7872
 
7720
- addRegexToken('M', match1to2);
7873
+ addRegexToken('M', match1to2, match1to2NoLeadingZero);
7721
7874
  addRegexToken('MM', match1to2, match2);
7722
7875
  addRegexToken('MMM', function (isStrict, locale) {
7723
7876
  return locale.monthsShortRegex(isStrict);
@@ -7883,8 +8036,6 @@
7883
8036
  // MOMENTS
7884
8037
 
7885
8038
  function setMonth(mom, value) {
7886
- var dayOfMonth;
7887
-
7888
8039
  if (!mom.isValid()) {
7889
8040
  // No op
7890
8041
  return mom;
@@ -7902,8 +8053,13 @@
7902
8053
  }
7903
8054
  }
7904
8055
 
7905
- dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
7906
- mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
8056
+ var month = value,
8057
+ date = mom.date();
8058
+
8059
+ date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month));
8060
+ void (mom._isUTC
8061
+ ? mom._d.setUTCMonth(month, date)
8062
+ : mom._d.setMonth(month, date));
7907
8063
  return mom;
7908
8064
  }
7909
8065
 
@@ -7970,27 +8126,24 @@
7970
8126
  longPieces = [],
7971
8127
  mixedPieces = [],
7972
8128
  i,
7973
- mom;
8129
+ mom,
8130
+ shortP,
8131
+ longP;
7974
8132
  for (i = 0; i < 12; i++) {
7975
8133
  // make the regex if we don't have it already
7976
8134
  mom = createUTC([2000, i]);
7977
- shortPieces.push(this.monthsShort(mom, ''));
7978
- longPieces.push(this.months(mom, ''));
7979
- mixedPieces.push(this.months(mom, ''));
7980
- mixedPieces.push(this.monthsShort(mom, ''));
8135
+ shortP = regexEscape(this.monthsShort(mom, ''));
8136
+ longP = regexEscape(this.months(mom, ''));
8137
+ shortPieces.push(shortP);
8138
+ longPieces.push(longP);
8139
+ mixedPieces.push(longP);
8140
+ mixedPieces.push(shortP);
7981
8141
  }
7982
8142
  // Sorting makes sure if one month (or abbr) is a prefix of another it
7983
8143
  // will match the longer piece.
7984
8144
  shortPieces.sort(cmpLenRev);
7985
8145
  longPieces.sort(cmpLenRev);
7986
8146
  mixedPieces.sort(cmpLenRev);
7987
- for (i = 0; i < 12; i++) {
7988
- shortPieces[i] = regexEscape(shortPieces[i]);
7989
- longPieces[i] = regexEscape(longPieces[i]);
7990
- }
7991
- for (i = 0; i < 24; i++) {
7992
- mixedPieces[i] = regexEscape(mixedPieces[i]);
7993
- }
7994
8147
 
7995
8148
  this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
7996
8149
  this._monthsShortRegex = this._monthsRegex;
@@ -8004,69 +8157,6 @@
8004
8157
  );
8005
8158
  }
8006
8159
 
8007
- // FORMATTING
8008
-
8009
- addFormatToken('Y', 0, 0, function () {
8010
- var y = this.year();
8011
- return y <= 9999 ? zeroFill(y, 4) : '+' + y;
8012
- });
8013
-
8014
- addFormatToken(0, ['YY', 2], 0, function () {
8015
- return this.year() % 100;
8016
- });
8017
-
8018
- addFormatToken(0, ['YYYY', 4], 0, 'year');
8019
- addFormatToken(0, ['YYYYY', 5], 0, 'year');
8020
- addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
8021
-
8022
- // ALIASES
8023
-
8024
- addUnitAlias('year', 'y');
8025
-
8026
- // PRIORITIES
8027
-
8028
- addUnitPriority('year', 1);
8029
-
8030
- // PARSING
8031
-
8032
- addRegexToken('Y', matchSigned);
8033
- addRegexToken('YY', match1to2, match2);
8034
- addRegexToken('YYYY', match1to4, match4);
8035
- addRegexToken('YYYYY', match1to6, match6);
8036
- addRegexToken('YYYYYY', match1to6, match6);
8037
-
8038
- addParseToken(['YYYYY', 'YYYYYY'], YEAR);
8039
- addParseToken('YYYY', function (input, array) {
8040
- array[YEAR] =
8041
- input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
8042
- });
8043
- addParseToken('YY', function (input, array) {
8044
- array[YEAR] = hooks.parseTwoDigitYear(input);
8045
- });
8046
- addParseToken('Y', function (input, array) {
8047
- array[YEAR] = parseInt(input, 10);
8048
- });
8049
-
8050
- // HELPERS
8051
-
8052
- function daysInYear(year) {
8053
- return isLeapYear(year) ? 366 : 365;
8054
- }
8055
-
8056
- // HOOKS
8057
-
8058
- hooks.parseTwoDigitYear = function (input) {
8059
- return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
8060
- };
8061
-
8062
- // MOMENTS
8063
-
8064
- var getSetYear = makeGetSet('FullYear', true);
8065
-
8066
- function getIsLeapYear() {
8067
- return isLeapYear(this.year());
8068
- }
8069
-
8070
8160
  function createDate(y, m, d, h, M, s, ms) {
8071
8161
  // can't just apply() to create a date:
8072
8162
  // https://stackoverflow.com/q/181348
@@ -8172,21 +8262,11 @@
8172
8262
  addFormatToken('w', ['ww', 2], 'wo', 'week');
8173
8263
  addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
8174
8264
 
8175
- // ALIASES
8176
-
8177
- addUnitAlias('week', 'w');
8178
- addUnitAlias('isoWeek', 'W');
8179
-
8180
- // PRIORITIES
8181
-
8182
- addUnitPriority('week', 5);
8183
- addUnitPriority('isoWeek', 5);
8184
-
8185
8265
  // PARSING
8186
8266
 
8187
- addRegexToken('w', match1to2);
8267
+ addRegexToken('w', match1to2, match1to2NoLeadingZero);
8188
8268
  addRegexToken('ww', match1to2, match2);
8189
- addRegexToken('W', match1to2);
8269
+ addRegexToken('W', match1to2, match1to2NoLeadingZero);
8190
8270
  addRegexToken('WW', match1to2, match2);
8191
8271
 
8192
8272
  addWeekParseToken(
@@ -8248,17 +8328,6 @@
8248
8328
  addFormatToken('e', 0, 0, 'weekday');
8249
8329
  addFormatToken('E', 0, 0, 'isoWeekday');
8250
8330
 
8251
- // ALIASES
8252
-
8253
- addUnitAlias('day', 'd');
8254
- addUnitAlias('weekday', 'e');
8255
- addUnitAlias('isoWeekday', 'E');
8256
-
8257
- // PRIORITY
8258
- addUnitPriority('day', 11);
8259
- addUnitPriority('weekday', 11);
8260
- addUnitPriority('isoWeekday', 11);
8261
-
8262
8331
  // PARSING
8263
8332
 
8264
8333
  addRegexToken('d', match1to2);
@@ -8338,24 +8407,24 @@
8338
8407
  return m === true
8339
8408
  ? shiftWeekdays(weekdays, this._week.dow)
8340
8409
  : m
8341
- ? weekdays[m.day()]
8342
- : weekdays;
8410
+ ? weekdays[m.day()]
8411
+ : weekdays;
8343
8412
  }
8344
8413
 
8345
8414
  function localeWeekdaysShort(m) {
8346
8415
  return m === true
8347
8416
  ? shiftWeekdays(this._weekdaysShort, this._week.dow)
8348
8417
  : m
8349
- ? this._weekdaysShort[m.day()]
8350
- : this._weekdaysShort;
8418
+ ? this._weekdaysShort[m.day()]
8419
+ : this._weekdaysShort;
8351
8420
  }
8352
8421
 
8353
8422
  function localeWeekdaysMin(m) {
8354
8423
  return m === true
8355
8424
  ? shiftWeekdays(this._weekdaysMin, this._week.dow)
8356
8425
  : m
8357
- ? this._weekdaysMin[m.day()]
8358
- : this._weekdaysMin;
8426
+ ? this._weekdaysMin[m.day()]
8427
+ : this._weekdaysMin;
8359
8428
  }
8360
8429
 
8361
8430
  function handleStrictParse$1(weekdayName, format, strict) {
@@ -8504,7 +8573,8 @@
8504
8573
  if (!this.isValid()) {
8505
8574
  return input != null ? this : NaN;
8506
8575
  }
8507
- var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
8576
+
8577
+ var day = get(this, 'Day');
8508
8578
  if (input != null) {
8509
8579
  input = parseWeekday(input, this.localeData());
8510
8580
  return this.add(input - day, 'd');
@@ -8703,13 +8773,6 @@
8703
8773
  meridiem('a', true);
8704
8774
  meridiem('A', false);
8705
8775
 
8706
- // ALIASES
8707
-
8708
- addUnitAlias('hour', 'h');
8709
-
8710
- // PRIORITY
8711
- addUnitPriority('hour', 13);
8712
-
8713
8776
  // PARSING
8714
8777
 
8715
8778
  function matchMeridiem(isStrict, locale) {
@@ -8718,9 +8781,9 @@
8718
8781
 
8719
8782
  addRegexToken('a', matchMeridiem);
8720
8783
  addRegexToken('A', matchMeridiem);
8721
- addRegexToken('H', match1to2);
8722
- addRegexToken('h', match1to2);
8723
- addRegexToken('k', match1to2);
8784
+ addRegexToken('H', match1to2, match1to2HasZero);
8785
+ addRegexToken('h', match1to2, match1to2NoLeadingZero);
8786
+ addRegexToken('k', match1to2, match1to2NoLeadingZero);
8724
8787
  addRegexToken('HH', match1to2, match2);
8725
8788
  addRegexToken('hh', match1to2, match2);
8726
8789
  addRegexToken('kk', match1to2, match2);
@@ -8870,7 +8933,8 @@
8870
8933
 
8871
8934
  function isLocaleNameSane(name) {
8872
8935
  // Prevent names that look like filesystem paths, i.e contain '/' or '\'
8873
- return name.match('^[^/\\\\]*$') != null;
8936
+ // Ensure name is available and function returns boolean
8937
+ return !!(name && name.match('^[^/\\\\]*$'));
8874
8938
  }
8875
8939
 
8876
8940
  function loadLocale(name) {
@@ -9062,21 +9126,21 @@
9062
9126
  a[MONTH] < 0 || a[MONTH] > 11
9063
9127
  ? MONTH
9064
9128
  : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH])
9065
- ? DATE
9066
- : a[HOUR] < 0 ||
9067
- a[HOUR] > 24 ||
9068
- (a[HOUR] === 24 &&
9069
- (a[MINUTE] !== 0 ||
9070
- a[SECOND] !== 0 ||
9071
- a[MILLISECOND] !== 0))
9072
- ? HOUR
9073
- : a[MINUTE] < 0 || a[MINUTE] > 59
9074
- ? MINUTE
9075
- : a[SECOND] < 0 || a[SECOND] > 59
9076
- ? SECOND
9077
- : a[MILLISECOND] < 0 || a[MILLISECOND] > 999
9078
- ? MILLISECOND
9079
- : -1;
9129
+ ? DATE
9130
+ : a[HOUR] < 0 ||
9131
+ a[HOUR] > 24 ||
9132
+ (a[HOUR] === 24 &&
9133
+ (a[MINUTE] !== 0 ||
9134
+ a[SECOND] !== 0 ||
9135
+ a[MILLISECOND] !== 0))
9136
+ ? HOUR
9137
+ : a[MINUTE] < 0 || a[MINUTE] > 59
9138
+ ? MINUTE
9139
+ : a[SECOND] < 0 || a[SECOND] > 59
9140
+ ? SECOND
9141
+ : a[MILLISECOND] < 0 || a[MILLISECOND] > 999
9142
+ ? MILLISECOND
9143
+ : -1;
9080
9144
 
9081
9145
  if (
9082
9146
  getParsingFlags(m)._overflowDayOfYear &&
@@ -10517,16 +10581,16 @@
10517
10581
  return diff < -6
10518
10582
  ? 'sameElse'
10519
10583
  : diff < -1
10520
- ? 'lastWeek'
10521
- : diff < 0
10522
- ? 'lastDay'
10523
- : diff < 1
10524
- ? 'sameDay'
10525
- : diff < 2
10526
- ? 'nextDay'
10527
- : diff < 7
10528
- ? 'nextWeek'
10529
- : 'sameElse';
10584
+ ? 'lastWeek'
10585
+ : diff < 0
10586
+ ? 'lastDay'
10587
+ : diff < 1
10588
+ ? 'sameDay'
10589
+ : diff < 2
10590
+ ? 'nextDay'
10591
+ : diff < 7
10592
+ ? 'nextWeek'
10593
+ : 'sameElse';
10530
10594
  }
10531
10595
 
10532
10596
  function calendar$1(time, formats) {
@@ -11334,16 +11398,22 @@
11334
11398
  mixedPieces = [],
11335
11399
  i,
11336
11400
  l,
11401
+ erasName,
11402
+ erasAbbr,
11403
+ erasNarrow,
11337
11404
  eras = this.eras();
11338
11405
 
11339
11406
  for (i = 0, l = eras.length; i < l; ++i) {
11340
- namePieces.push(regexEscape(eras[i].name));
11341
- abbrPieces.push(regexEscape(eras[i].abbr));
11342
- narrowPieces.push(regexEscape(eras[i].narrow));
11407
+ erasName = regexEscape(eras[i].name);
11408
+ erasAbbr = regexEscape(eras[i].abbr);
11409
+ erasNarrow = regexEscape(eras[i].narrow);
11343
11410
 
11344
- mixedPieces.push(regexEscape(eras[i].name));
11345
- mixedPieces.push(regexEscape(eras[i].abbr));
11346
- mixedPieces.push(regexEscape(eras[i].narrow));
11411
+ namePieces.push(erasName);
11412
+ abbrPieces.push(erasAbbr);
11413
+ narrowPieces.push(erasNarrow);
11414
+ mixedPieces.push(erasName);
11415
+ mixedPieces.push(erasAbbr);
11416
+ mixedPieces.push(erasNarrow);
11347
11417
  }
11348
11418
 
11349
11419
  this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
@@ -11376,14 +11446,6 @@
11376
11446
 
11377
11447
  // ALIASES
11378
11448
 
11379
- addUnitAlias('weekYear', 'gg');
11380
- addUnitAlias('isoWeekYear', 'GG');
11381
-
11382
- // PRIORITY
11383
-
11384
- addUnitPriority('weekYear', 1);
11385
- addUnitPriority('isoWeekYear', 1);
11386
-
11387
11449
  // PARSING
11388
11450
 
11389
11451
  addRegexToken('G', matchSigned);
@@ -11413,7 +11475,7 @@
11413
11475
  this,
11414
11476
  input,
11415
11477
  this.week(),
11416
- this.weekday(),
11478
+ this.weekday() + this.localeData()._week.dow,
11417
11479
  this.localeData()._week.dow,
11418
11480
  this.localeData()._week.doy
11419
11481
  );
@@ -11475,14 +11537,6 @@
11475
11537
 
11476
11538
  addFormatToken('Q', 0, 'Qo', 'quarter');
11477
11539
 
11478
- // ALIASES
11479
-
11480
- addUnitAlias('quarter', 'Q');
11481
-
11482
- // PRIORITY
11483
-
11484
- addUnitPriority('quarter', 7);
11485
-
11486
11540
  // PARSING
11487
11541
 
11488
11542
  addRegexToken('Q', match1);
@@ -11502,16 +11556,9 @@
11502
11556
 
11503
11557
  addFormatToken('D', ['DD', 2], 'Do', 'date');
11504
11558
 
11505
- // ALIASES
11506
-
11507
- addUnitAlias('date', 'D');
11508
-
11509
- // PRIORITY
11510
- addUnitPriority('date', 9);
11511
-
11512
11559
  // PARSING
11513
11560
 
11514
- addRegexToken('D', match1to2);
11561
+ addRegexToken('D', match1to2, match1to2NoLeadingZero);
11515
11562
  addRegexToken('DD', match1to2, match2);
11516
11563
  addRegexToken('Do', function (isStrict, locale) {
11517
11564
  // TODO: Remove "ordinalParse" fallback in next major release.
@@ -11533,13 +11580,6 @@
11533
11580
 
11534
11581
  addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
11535
11582
 
11536
- // ALIASES
11537
-
11538
- addUnitAlias('dayOfYear', 'DDD');
11539
-
11540
- // PRIORITY
11541
- addUnitPriority('dayOfYear', 4);
11542
-
11543
11583
  // PARSING
11544
11584
 
11545
11585
  addRegexToken('DDD', match1to3);
@@ -11564,17 +11604,9 @@
11564
11604
 
11565
11605
  addFormatToken('m', ['mm', 2], 0, 'minute');
11566
11606
 
11567
- // ALIASES
11568
-
11569
- addUnitAlias('minute', 'm');
11570
-
11571
- // PRIORITY
11572
-
11573
- addUnitPriority('minute', 14);
11574
-
11575
11607
  // PARSING
11576
11608
 
11577
- addRegexToken('m', match1to2);
11609
+ addRegexToken('m', match1to2, match1to2HasZero);
11578
11610
  addRegexToken('mm', match1to2, match2);
11579
11611
  addParseToken(['m', 'mm'], MINUTE);
11580
11612
 
@@ -11586,17 +11618,9 @@
11586
11618
 
11587
11619
  addFormatToken('s', ['ss', 2], 0, 'second');
11588
11620
 
11589
- // ALIASES
11590
-
11591
- addUnitAlias('second', 's');
11592
-
11593
- // PRIORITY
11594
-
11595
- addUnitPriority('second', 15);
11596
-
11597
11621
  // PARSING
11598
11622
 
11599
- addRegexToken('s', match1to2);
11623
+ addRegexToken('s', match1to2, match1to2HasZero);
11600
11624
  addRegexToken('ss', match1to2, match2);
11601
11625
  addParseToken(['s', 'ss'], SECOND);
11602
11626
 
@@ -11634,14 +11658,6 @@
11634
11658
  return this.millisecond() * 1000000;
11635
11659
  });
11636
11660
 
11637
- // ALIASES
11638
-
11639
- addUnitAlias('millisecond', 'ms');
11640
-
11641
- // PRIORITY
11642
-
11643
- addUnitPriority('millisecond', 16);
11644
-
11645
11661
  // PARSING
11646
11662
 
11647
11663
  addRegexToken('S', match1to3, match1);
@@ -11949,12 +11965,12 @@
11949
11965
  toInt((number % 100) / 10) === 1
11950
11966
  ? 'th'
11951
11967
  : b === 1
11952
- ? 'st'
11953
- : b === 2
11954
- ? 'nd'
11955
- : b === 3
11956
- ? 'rd'
11957
- : 'th';
11968
+ ? 'st'
11969
+ : b === 2
11970
+ ? 'nd'
11971
+ : b === 3
11972
+ ? 'rd'
11973
+ : 'th';
11958
11974
  return number + output;
11959
11975
  },
11960
11976
  });
@@ -12127,19 +12143,6 @@
12127
12143
  }
12128
12144
  }
12129
12145
 
12130
- // TODO: Use this.as('ms')?
12131
- function valueOf$1() {
12132
- if (!this.isValid()) {
12133
- return NaN;
12134
- }
12135
- return (
12136
- this._milliseconds +
12137
- this._days * 864e5 +
12138
- (this._months % 12) * 2592e6 +
12139
- toInt(this._months / 12) * 31536e6
12140
- );
12141
- }
12142
-
12143
12146
  function makeAs(alias) {
12144
12147
  return function () {
12145
12148
  return this.as(alias);
@@ -12154,7 +12157,8 @@
12154
12157
  asWeeks = makeAs('w'),
12155
12158
  asMonths = makeAs('M'),
12156
12159
  asQuarters = makeAs('Q'),
12157
- asYears = makeAs('y');
12160
+ asYears = makeAs('y'),
12161
+ valueOf$1 = asMilliseconds;
12158
12162
 
12159
12163
  function clone$1() {
12160
12164
  return createDuration(this);
@@ -12423,7 +12427,7 @@
12423
12427
 
12424
12428
  //! moment.js
12425
12429
 
12426
- hooks.version = '2.29.4';
12430
+ hooks.version = '2.30.1';
12427
12431
 
12428
12432
  setHookCallback(createLocal);
12429
12433