@auth0/auth0-spa-js 1.19.2 → 1.19.3

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.
@@ -162,6 +162,12 @@
162
162
  return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
163
163
  });
164
164
 
165
+ var call$2 = Function.prototype.call;
166
+
167
+ var functionCall = call$2.bind ? call$2.bind(call$2) : function () {
168
+ return call$2.apply(call$2, arguments);
169
+ };
170
+
165
171
  var $propertyIsEnumerable$1 = {}.propertyIsEnumerable;
166
172
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
167
173
  var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
@@ -189,27 +195,44 @@
189
195
  };
190
196
  };
191
197
 
192
- var toString$1 = {}.toString;
198
+ var FunctionPrototype$2 = Function.prototype;
199
+ var bind$3 = FunctionPrototype$2.bind;
200
+ var call$1 = FunctionPrototype$2.call;
201
+ var callBind = bind$3 && bind$3.bind(call$1);
202
+
203
+ var functionUncurryThis = bind$3 ? function (fn) {
204
+ return fn && callBind(call$1, fn);
205
+ } : function (fn) {
206
+ return fn && function () {
207
+ return call$1.apply(fn, arguments);
208
+ };
209
+ };
210
+
211
+ var toString$1 = functionUncurryThis({}.toString);
212
+ var stringSlice$3 = functionUncurryThis(''.slice);
193
213
 
194
214
  var classofRaw = function (it) {
195
- return toString$1.call(it).slice(8, -1);
215
+ return stringSlice$3(toString$1(it), 8, -1);
196
216
  };
197
217
 
198
- var split = ''.split;
218
+ var Object$5 = global_1.Object;
219
+ var split = functionUncurryThis(''.split);
199
220
 
200
221
  // fallback for non-array-like ES3 and non-enumerable old V8 strings
201
222
  var indexedObject = fails(function () {
202
223
  // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
203
224
  // eslint-disable-next-line no-prototype-builtins -- safe
204
- return !Object('z').propertyIsEnumerable(0);
225
+ return !Object$5('z').propertyIsEnumerable(0);
205
226
  }) ? function (it) {
206
- return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
207
- } : Object;
227
+ return classofRaw(it) == 'String' ? split(it, '') : Object$5(it);
228
+ } : Object$5;
229
+
230
+ var TypeError$g = global_1.TypeError;
208
231
 
209
232
  // `RequireObjectCoercible` abstract operation
210
233
  // https://tc39.es/ecma262/#sec-requireobjectcoercible
211
234
  var requireObjectCoercible = function (it) {
212
- if (it == undefined) throw TypeError("Can't call method on " + it);
235
+ if (it == undefined) throw TypeError$g("Can't call method on " + it);
213
236
  return it;
214
237
  };
215
238
 
@@ -224,11 +247,11 @@
224
247
  // `IsCallable` abstract operation
225
248
  // https://tc39.es/ecma262/#sec-iscallable
226
249
  var isCallable = function (argument) {
227
- return typeof argument === 'function';
250
+ return typeof argument == 'function';
228
251
  };
229
252
 
230
253
  var isObject = function (it) {
231
- return typeof it === 'object' ? it !== null : isCallable(it);
254
+ return typeof it == 'object' ? it !== null : isCallable(it);
232
255
  };
233
256
 
234
257
  var aFunction = function (argument) {
@@ -239,6 +262,8 @@
239
262
  return arguments.length < 2 ? aFunction(global_1[namespace]) : global_1[namespace] && global_1[namespace][method];
240
263
  };
241
264
 
265
+ var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
266
+
242
267
  var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
243
268
 
244
269
  var process = global_1.process;
@@ -249,23 +274,29 @@
249
274
 
250
275
  if (v8) {
251
276
  match = v8.split('.');
252
- version$1 = match[0] < 4 ? 1 : match[0] + match[1];
253
- } else if (engineUserAgent) {
277
+ // in old Chrome, versions of V8 isn't V8 = Chrome / 10
278
+ // but their correct versions are not interesting for us
279
+ version$1 = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
280
+ }
281
+
282
+ // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
283
+ // so check `userAgent` even if `.v8` exists, but 0
284
+ if (!version$1 && engineUserAgent) {
254
285
  match = engineUserAgent.match(/Edge\/(\d+)/);
255
286
  if (!match || match[1] >= 74) {
256
287
  match = engineUserAgent.match(/Chrome\/(\d+)/);
257
- if (match) version$1 = match[1];
288
+ if (match) version$1 = +match[1];
258
289
  }
259
290
  }
260
291
 
261
- var engineV8Version = version$1 && +version$1;
292
+ var engineV8Version = version$1;
262
293
 
263
294
  /* eslint-disable es/no-symbol -- required for testing */
264
295
 
265
296
 
266
297
 
267
298
  // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
268
- var nativeSymbol$1 = !!Object.getOwnPropertySymbols && !fails(function () {
299
+ var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
269
300
  var symbol = Symbol();
270
301
  // Chrome 38 Symbol has incorrect toString conversion
271
302
  // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
@@ -277,29 +308,35 @@
277
308
  /* eslint-disable es/no-symbol -- required for testing */
278
309
 
279
310
 
280
- var useSymbolAsUid = nativeSymbol$1
311
+ var useSymbolAsUid = nativeSymbol
281
312
  && !Symbol.sham
282
313
  && typeof Symbol.iterator == 'symbol';
283
314
 
315
+ var Object$4 = global_1.Object;
316
+
284
317
  var isSymbol = useSymbolAsUid ? function (it) {
285
318
  return typeof it == 'symbol';
286
319
  } : function (it) {
287
320
  var $Symbol = getBuiltIn('Symbol');
288
- return isCallable($Symbol) && Object(it) instanceof $Symbol;
321
+ return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, Object$4(it));
289
322
  };
290
323
 
324
+ var String$4 = global_1.String;
325
+
291
326
  var tryToString = function (argument) {
292
327
  try {
293
- return String(argument);
328
+ return String$4(argument);
294
329
  } catch (error) {
295
330
  return 'Object';
296
331
  }
297
332
  };
298
333
 
334
+ var TypeError$f = global_1.TypeError;
335
+
299
336
  // `Assert: IsCallable(argument) is true`
300
337
  var aCallable = function (argument) {
301
338
  if (isCallable(argument)) return argument;
302
- throw TypeError(tryToString(argument) + ' is not a function');
339
+ throw TypeError$f(tryToString(argument) + ' is not a function');
303
340
  };
304
341
 
305
342
  // `GetMethod` abstract operation
@@ -309,20 +346,24 @@
309
346
  return func == null ? undefined : aCallable(func);
310
347
  };
311
348
 
349
+ var TypeError$e = global_1.TypeError;
350
+
312
351
  // `OrdinaryToPrimitive` abstract operation
313
352
  // https://tc39.es/ecma262/#sec-ordinarytoprimitive
314
353
  var ordinaryToPrimitive = function (input, pref) {
315
354
  var fn, val;
316
- if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = fn.call(input))) return val;
317
- if (isCallable(fn = input.valueOf) && !isObject(val = fn.call(input))) return val;
318
- if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = fn.call(input))) return val;
319
- throw TypeError("Can't convert object to primitive value");
355
+ if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
356
+ if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
357
+ if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
358
+ throw TypeError$e("Can't convert object to primitive value");
320
359
  };
321
360
 
361
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
362
+ var defineProperty$5 = Object.defineProperty;
363
+
322
364
  var setGlobal = function (key, value) {
323
365
  try {
324
- // eslint-disable-next-line es/no-object-defineproperty -- safe
325
- Object.defineProperty(global_1, key, { value: value, configurable: true, writable: true });
366
+ defineProperty$5(global_1, key, { value: value, configurable: true, writable: true });
326
367
  } catch (error) {
327
368
  global_1[key] = value;
328
369
  } return value;
@@ -337,47 +378,55 @@
337
378
  (module.exports = function (key, value) {
338
379
  return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
339
380
  })('versions', []).push({
340
- version: '3.18.2',
381
+ version: '3.19.1',
341
382
  mode: 'global',
342
383
  copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
343
384
  });
344
385
  });
345
386
 
387
+ var Object$3 = global_1.Object;
388
+
346
389
  // `ToObject` abstract operation
347
390
  // https://tc39.es/ecma262/#sec-toobject
348
391
  var toObject = function (argument) {
349
- return Object(requireObjectCoercible(argument));
392
+ return Object$3(requireObjectCoercible(argument));
350
393
  };
351
394
 
352
- var hasOwnProperty = {}.hasOwnProperty;
395
+ var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
353
396
 
354
397
  // `HasOwnProperty` abstract operation
355
398
  // https://tc39.es/ecma262/#sec-hasownproperty
356
399
  var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
357
- return hasOwnProperty.call(toObject(it), key);
400
+ return hasOwnProperty(toObject(it), key);
358
401
  };
359
402
 
360
403
  var id = 0;
361
404
  var postfix = Math.random();
405
+ var toString = functionUncurryThis(1.0.toString);
362
406
 
363
407
  var uid = function (key) {
364
- return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
408
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
365
409
  };
366
410
 
367
411
  var WellKnownSymbolsStore$1 = shared('wks');
368
412
  var Symbol$1 = global_1.Symbol;
413
+ var symbolFor = Symbol$1 && Symbol$1['for'];
369
414
  var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
370
415
 
371
416
  var wellKnownSymbol = function (name) {
372
- if (!hasOwnProperty_1(WellKnownSymbolsStore$1, name) || !(nativeSymbol$1 || typeof WellKnownSymbolsStore$1[name] == 'string')) {
373
- if (nativeSymbol$1 && hasOwnProperty_1(Symbol$1, name)) {
417
+ if (!hasOwnProperty_1(WellKnownSymbolsStore$1, name) || !(nativeSymbol || typeof WellKnownSymbolsStore$1[name] == 'string')) {
418
+ var description = 'Symbol.' + name;
419
+ if (nativeSymbol && hasOwnProperty_1(Symbol$1, name)) {
374
420
  WellKnownSymbolsStore$1[name] = Symbol$1[name];
421
+ } else if (useSymbolAsUid && symbolFor) {
422
+ WellKnownSymbolsStore$1[name] = symbolFor(description);
375
423
  } else {
376
- WellKnownSymbolsStore$1[name] = createWellKnownSymbol('Symbol.' + name);
424
+ WellKnownSymbolsStore$1[name] = createWellKnownSymbol(description);
377
425
  }
378
426
  } return WellKnownSymbolsStore$1[name];
379
427
  };
380
428
 
429
+ var TypeError$d = global_1.TypeError;
381
430
  var TO_PRIMITIVE$1 = wellKnownSymbol('toPrimitive');
382
431
 
383
432
  // `ToPrimitive` abstract operation
@@ -388,9 +437,9 @@
388
437
  var result;
389
438
  if (exoticToPrim) {
390
439
  if (pref === undefined) pref = 'default';
391
- result = exoticToPrim.call(input, pref);
440
+ result = functionCall(exoticToPrim, input, pref);
392
441
  if (!isObject(result) || isSymbol(result)) return result;
393
- throw TypeError("Can't convert object to primitive value");
442
+ throw TypeError$d("Can't convert object to primitive value");
394
443
  }
395
444
  if (pref === undefined) pref = 'number';
396
445
  return ordinaryToPrimitive(input, pref);
@@ -400,7 +449,7 @@
400
449
  // https://tc39.es/ecma262/#sec-topropertykey
401
450
  var toPropertyKey = function (argument) {
402
451
  var key = toPrimitive(argument, 'string');
403
- return isSymbol(key) ? key : String(key);
452
+ return isSymbol(key) ? key : key + '';
404
453
  };
405
454
 
406
455
  var document$1 = global_1.document;
@@ -430,19 +479,23 @@
430
479
  if (ie8DomDefine) try {
431
480
  return $getOwnPropertyDescriptor$1(O, P);
432
481
  } catch (error) { /* empty */ }
433
- if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
482
+ if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
434
483
  };
435
484
 
436
485
  var objectGetOwnPropertyDescriptor = {
437
486
  f: f$5
438
487
  };
439
488
 
489
+ var String$3 = global_1.String;
490
+ var TypeError$c = global_1.TypeError;
491
+
440
492
  // `Assert: Type(argument) is Object`
441
493
  var anObject = function (argument) {
442
494
  if (isObject(argument)) return argument;
443
- throw TypeError(String(argument) + ' is not an object');
495
+ throw TypeError$c(String$3(argument) + ' is not an object');
444
496
  };
445
497
 
498
+ var TypeError$b = global_1.TypeError;
446
499
  // eslint-disable-next-line es/no-object-defineproperty -- safe
447
500
  var $defineProperty$1 = Object.defineProperty;
448
501
 
@@ -455,7 +508,7 @@
455
508
  if (ie8DomDefine) try {
456
509
  return $defineProperty$1(O, P, Attributes);
457
510
  } catch (error) { /* empty */ }
458
- if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
511
+ if ('get' in Attributes || 'set' in Attributes) throw TypeError$b('Accessors not supported');
459
512
  if ('value' in Attributes) O[P] = Attributes.value;
460
513
  return O;
461
514
  };
@@ -471,12 +524,12 @@
471
524
  return object;
472
525
  };
473
526
 
474
- var functionToString = Function.toString;
527
+ var functionToString = functionUncurryThis(Function.toString);
475
528
 
476
529
  // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
477
530
  if (!isCallable(sharedStore.inspectSource)) {
478
531
  sharedStore.inspectSource = function (it) {
479
- return functionToString.call(it);
532
+ return functionToString(it);
480
533
  };
481
534
  }
482
535
 
@@ -495,6 +548,7 @@
495
548
  var hiddenKeys$1 = {};
496
549
 
497
550
  var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
551
+ var TypeError$a = global_1.TypeError;
498
552
  var WeakMap = global_1.WeakMap;
499
553
  var set, get, has;
500
554
 
@@ -506,33 +560,33 @@
506
560
  return function (it) {
507
561
  var state;
508
562
  if (!isObject(it) || (state = get(it)).type !== TYPE) {
509
- throw TypeError('Incompatible receiver, ' + TYPE + ' required');
563
+ throw TypeError$a('Incompatible receiver, ' + TYPE + ' required');
510
564
  } return state;
511
565
  };
512
566
  };
513
567
 
514
568
  if (nativeWeakMap || sharedStore.state) {
515
569
  var store = sharedStore.state || (sharedStore.state = new WeakMap());
516
- var wmget = store.get;
517
- var wmhas = store.has;
518
- var wmset = store.set;
570
+ var wmget = functionUncurryThis(store.get);
571
+ var wmhas = functionUncurryThis(store.has);
572
+ var wmset = functionUncurryThis(store.set);
519
573
  set = function (it, metadata) {
520
- if (wmhas.call(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
574
+ if (wmhas(store, it)) throw new TypeError$a(OBJECT_ALREADY_INITIALIZED);
521
575
  metadata.facade = it;
522
- wmset.call(store, it, metadata);
576
+ wmset(store, it, metadata);
523
577
  return metadata;
524
578
  };
525
579
  get = function (it) {
526
- return wmget.call(store, it) || {};
580
+ return wmget(store, it) || {};
527
581
  };
528
582
  has = function (it) {
529
- return wmhas.call(store, it);
583
+ return wmhas(store, it);
530
584
  };
531
585
  } else {
532
586
  var STATE = sharedKey('state');
533
587
  hiddenKeys$1[STATE] = true;
534
588
  set = function (it, metadata) {
535
- if (hasOwnProperty_1(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
589
+ if (hasOwnProperty_1(it, STATE)) throw new TypeError$a(OBJECT_ALREADY_INITIALIZED);
536
590
  metadata.facade = it;
537
591
  createNonEnumerableProperty(it, STATE, metadata);
538
592
  return metadata;
@@ -553,14 +607,14 @@
553
607
  getterFor: getterFor
554
608
  };
555
609
 
556
- var FunctionPrototype = Function.prototype;
610
+ var FunctionPrototype$1 = Function.prototype;
557
611
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
558
612
  var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
559
613
 
560
- var EXISTS = hasOwnProperty_1(FunctionPrototype, 'name');
614
+ var EXISTS = hasOwnProperty_1(FunctionPrototype$1, 'name');
561
615
  // additional protection from minified / mangled / dropped function names
562
616
  var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
563
- var CONFIGURABLE = EXISTS && (!descriptors || (descriptors && getDescriptor(FunctionPrototype, 'name').configurable));
617
+ var CONFIGURABLE = EXISTS && (!descriptors || (descriptors && getDescriptor(FunctionPrototype$1, 'name').configurable));
564
618
 
565
619
  var functionName = {
566
620
  EXISTS: EXISTS,
@@ -678,15 +732,17 @@
678
732
  var indexOf = arrayIncludes.indexOf;
679
733
 
680
734
 
735
+ var push$2 = functionUncurryThis([].push);
736
+
681
737
  var objectKeysInternal = function (object, names) {
682
738
  var O = toIndexedObject(object);
683
739
  var i = 0;
684
740
  var result = [];
685
741
  var key;
686
- for (key in O) !hasOwnProperty_1(hiddenKeys$1, key) && hasOwnProperty_1(O, key) && result.push(key);
742
+ for (key in O) !hasOwnProperty_1(hiddenKeys$1, key) && hasOwnProperty_1(O, key) && push$2(result, key);
687
743
  // Don't enum bug & hidden keys
688
744
  while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) {
689
- ~indexOf(result, key) || result.push(key);
745
+ ~indexOf(result, key) || push$2(result, key);
690
746
  }
691
747
  return result;
692
748
  };
@@ -722,11 +778,13 @@
722
778
  f: f$2
723
779
  };
724
780
 
781
+ var concat = functionUncurryThis([].concat);
782
+
725
783
  // all object keys, includes non-enumerable and symbols
726
784
  var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
727
785
  var keys = objectGetOwnPropertyNames.f(anObject(it));
728
786
  var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
729
- return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
787
+ return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
730
788
  };
731
789
 
732
790
  var copyConstructorProperties = function (target, source) {
@@ -802,7 +860,7 @@
802
860
  FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
803
861
  // contained in target
804
862
  if (!FORCED && targetProperty !== undefined) {
805
- if (typeof sourceProperty === typeof targetProperty) continue;
863
+ if (typeof sourceProperty == typeof targetProperty) continue;
806
864
  copyConstructorProperties(sourceProperty, targetProperty);
807
865
  }
808
866
  // add a flag to not completely full polyfills
@@ -822,6 +880,8 @@
822
880
  var toStringTagSupport = String(test) === '[object z]';
823
881
 
824
882
  var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
883
+ var Object$2 = global_1.Object;
884
+
825
885
  // ES3 wrong here
826
886
  var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
827
887
 
@@ -837,16 +897,18 @@
837
897
  var O, tag, result;
838
898
  return it === undefined ? 'Undefined' : it === null ? 'Null'
839
899
  // @@toStringTag case
840
- : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$2)) == 'string' ? tag
900
+ : typeof (tag = tryGet(O = Object$2(it), TO_STRING_TAG$2)) == 'string' ? tag
841
901
  // builtinTag case
842
902
  : CORRECT_ARGUMENTS ? classofRaw(O)
843
903
  // ES3 arguments fallback
844
904
  : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
845
905
  };
846
906
 
907
+ var String$2 = global_1.String;
908
+
847
909
  var toString_1 = function (argument) {
848
910
  if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
849
- return String(argument);
911
+ return String$2(argument);
850
912
  };
851
913
 
852
914
  var MATCH$1 = wellKnownSymbol('match');
@@ -858,9 +920,11 @@
858
920
  return isObject(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
859
921
  };
860
922
 
923
+ var TypeError$9 = global_1.TypeError;
924
+
861
925
  var notARegexp = function (it) {
862
926
  if (isRegexp(it)) {
863
- throw TypeError("The method doesn't accept regular expressions");
927
+ throw TypeError$9("The method doesn't accept regular expressions");
864
928
  } return it;
865
929
  };
866
930
 
@@ -887,7 +951,8 @@
887
951
 
888
952
 
889
953
  // eslint-disable-next-line es/no-string-prototype-startswith -- safe
890
- var $startsWith = ''.startsWith;
954
+ var un$StartsWith = functionUncurryThis(''.startsWith);
955
+ var stringSlice$2 = functionUncurryThis(''.slice);
891
956
  var min = Math.min;
892
957
 
893
958
  var CORRECT_IS_REGEXP_LOGIC = correctIsRegexpLogic('startsWith');
@@ -905,39 +970,14 @@
905
970
  notARegexp(searchString);
906
971
  var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length));
907
972
  var search = toString_1(searchString);
908
- return $startsWith
909
- ? $startsWith.call(that, search, index)
910
- : that.slice(index, index + search.length) === search;
973
+ return un$StartsWith
974
+ ? un$StartsWith(that, search, index)
975
+ : stringSlice$2(that, index, index + search.length) === search;
911
976
  }
912
977
  });
913
978
 
914
- // optional / simple context binding
915
- var functionBindContext = function (fn, that, length) {
916
- aCallable(fn);
917
- if (that === undefined) return fn;
918
- switch (length) {
919
- case 0: return function () {
920
- return fn.call(that);
921
- };
922
- case 1: return function (a) {
923
- return fn.call(that, a);
924
- };
925
- case 2: return function (a, b) {
926
- return fn.call(that, a, b);
927
- };
928
- case 3: return function (a, b, c) {
929
- return fn.call(that, a, b, c);
930
- };
931
- }
932
- return function (/* ...args */) {
933
- return fn.apply(that, arguments);
934
- };
935
- };
936
-
937
- var call = Function.call;
938
-
939
- var entryUnbind = function (CONSTRUCTOR, METHOD, length) {
940
- return functionBindContext(call, global_1[CONSTRUCTOR].prototype[METHOD], length);
979
+ var entryUnbind = function (CONSTRUCTOR, METHOD) {
980
+ return functionUncurryThis(global_1[CONSTRUCTOR].prototype[METHOD]);
941
981
  };
942
982
 
943
983
  entryUnbind('String', 'startsWith');
@@ -955,16 +995,17 @@
955
995
  else object[propertyKey] = value;
956
996
  };
957
997
 
998
+ var noop$1 = function () { /* empty */ };
958
999
  var empty = [];
959
1000
  var construct = getBuiltIn('Reflect', 'construct');
960
1001
  var constructorRegExp = /^\s*(?:class|function)\b/;
961
- var exec = constructorRegExp.exec;
962
- var INCORRECT_TO_STRING = !constructorRegExp.exec(function () { /* empty */ });
1002
+ var exec = functionUncurryThis(constructorRegExp.exec);
1003
+ var INCORRECT_TO_STRING = !constructorRegExp.exec(noop$1);
963
1004
 
964
1005
  var isConstructorModern = function (argument) {
965
1006
  if (!isCallable(argument)) return false;
966
1007
  try {
967
- construct(Object, empty, argument);
1008
+ construct(noop$1, empty, argument);
968
1009
  return true;
969
1010
  } catch (error) {
970
1011
  return false;
@@ -978,7 +1019,7 @@
978
1019
  case 'GeneratorFunction':
979
1020
  case 'AsyncGeneratorFunction': return false;
980
1021
  // we can't check .prototype since constructors produced by .bind haven't it
981
- } return INCORRECT_TO_STRING || !!exec.call(constructorRegExp, inspectSource(argument));
1022
+ } return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
982
1023
  };
983
1024
 
984
1025
  // `IsConstructor` abstract operation
@@ -992,6 +1033,7 @@
992
1033
  }) ? isConstructorLegacy : isConstructorModern;
993
1034
 
994
1035
  var SPECIES$3 = wellKnownSymbol('species');
1036
+ var Array$2 = global_1.Array;
995
1037
 
996
1038
  // a part of `ArraySpeciesCreate` abstract operation
997
1039
  // https://tc39.es/ecma262/#sec-arrayspeciescreate
@@ -1000,12 +1042,12 @@
1000
1042
  if (isArray$1(originalArray)) {
1001
1043
  C = originalArray.constructor;
1002
1044
  // cross-realm fallback
1003
- if (isConstructor(C) && (C === Array || isArray$1(C.prototype))) C = undefined;
1045
+ if (isConstructor(C) && (C === Array$2 || isArray$1(C.prototype))) C = undefined;
1004
1046
  else if (isObject(C)) {
1005
1047
  C = C[SPECIES$3];
1006
1048
  if (C === null) C = undefined;
1007
1049
  }
1008
- } return C === undefined ? Array : C;
1050
+ } return C === undefined ? Array$2 : C;
1009
1051
  };
1010
1052
 
1011
1053
  // `ArraySpeciesCreate` abstract operation
@@ -1033,6 +1075,7 @@
1033
1075
  var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
1034
1076
  var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
1035
1077
  var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
1078
+ var TypeError$8 = global_1.TypeError;
1036
1079
 
1037
1080
  // We can't use this feature detection in V8 since it causes
1038
1081
  // deoptimization and serious performance degradation
@@ -1067,10 +1110,10 @@
1067
1110
  E = i === -1 ? O : arguments[i];
1068
1111
  if (isConcatSpreadable(E)) {
1069
1112
  len = lengthOfArrayLike(E);
1070
- if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
1113
+ if (n + len > MAX_SAFE_INTEGER) throw TypeError$8(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
1071
1114
  for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
1072
1115
  } else {
1073
- if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
1116
+ if (n >= MAX_SAFE_INTEGER) throw TypeError$8(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
1074
1117
  createProperty(A, n++, E);
1075
1118
  }
1076
1119
  }
@@ -1091,6 +1134,16 @@
1091
1134
  redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
1092
1135
  }
1093
1136
 
1137
+ var FunctionPrototype = Function.prototype;
1138
+ var apply = FunctionPrototype.apply;
1139
+ var bind$2 = FunctionPrototype.bind;
1140
+ var call = FunctionPrototype.call;
1141
+
1142
+ // eslint-disable-next-line es/no-reflect -- safe
1143
+ var functionApply = typeof Reflect == 'object' && Reflect.apply || (bind$2 ? call.bind(apply) : function () {
1144
+ return call.apply(apply, arguments);
1145
+ });
1146
+
1094
1147
  // `Object.keys` method
1095
1148
  // https://tc39.es/ecma262/#sec-object.keys
1096
1149
  // eslint-disable-next-line es/no-object-keys -- safe
@@ -1103,11 +1156,12 @@
1103
1156
  // eslint-disable-next-line es/no-object-defineproperties -- safe
1104
1157
  var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
1105
1158
  anObject(O);
1159
+ var props = toIndexedObject(Properties);
1106
1160
  var keys = objectKeys(Properties);
1107
1161
  var length = keys.length;
1108
1162
  var index = 0;
1109
1163
  var key;
1110
- while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
1164
+ while (length > index) objectDefineProperty.f(O, key = keys[index++], props[key]);
1111
1165
  return O;
1112
1166
  };
1113
1167
 
@@ -1196,11 +1250,13 @@
1196
1250
  return Properties === undefined ? result : objectDefineProperties(result, Properties);
1197
1251
  };
1198
1252
 
1253
+ var arraySlice = functionUncurryThis([].slice);
1254
+
1199
1255
  /* eslint-disable es/no-object-getownpropertynames -- safe */
1200
1256
 
1257
+
1201
1258
  var $getOwnPropertyNames$1 = objectGetOwnPropertyNames.f;
1202
1259
 
1203
- var toString = {}.toString;
1204
1260
 
1205
1261
  var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
1206
1262
  ? Object.getOwnPropertyNames(window) : [];
@@ -1209,13 +1265,13 @@
1209
1265
  try {
1210
1266
  return $getOwnPropertyNames$1(it);
1211
1267
  } catch (error) {
1212
- return windowNames.slice();
1268
+ return arraySlice(windowNames);
1213
1269
  }
1214
1270
  };
1215
1271
 
1216
1272
  // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
1217
1273
  var f$1 = function getOwnPropertyNames(it) {
1218
- return windowNames && toString.call(it) == '[object Window]'
1274
+ return windowNames && classofRaw(it) == 'Window'
1219
1275
  ? getWindowNames(it)
1220
1276
  : $getOwnPropertyNames$1(toIndexedObject(it));
1221
1277
  };
@@ -1253,7 +1309,17 @@
1253
1309
  }
1254
1310
  };
1255
1311
 
1256
- var push = [].push;
1312
+ var bind$1 = functionUncurryThis(functionUncurryThis.bind);
1313
+
1314
+ // optional / simple context binding
1315
+ var functionBindContext = function (fn, that) {
1316
+ aCallable(fn);
1317
+ return that === undefined ? fn : bind$1 ? bind$1(fn, that) : function (/* ...args */) {
1318
+ return fn.apply(that, arguments);
1319
+ };
1320
+ };
1321
+
1322
+ var push$1 = functionUncurryThis([].push);
1257
1323
 
1258
1324
  // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
1259
1325
  var createMethod$1 = function (TYPE) {
@@ -1267,7 +1333,7 @@
1267
1333
  return function ($this, callbackfn, that, specificCreate) {
1268
1334
  var O = toObject($this);
1269
1335
  var self = indexedObject(O);
1270
- var boundFunction = functionBindContext(callbackfn, that, 3);
1336
+ var boundFunction = functionBindContext(callbackfn, that);
1271
1337
  var length = lengthOfArrayLike(self);
1272
1338
  var index = 0;
1273
1339
  var create = specificCreate || arraySpeciesCreate;
@@ -1282,10 +1348,10 @@
1282
1348
  case 3: return true; // some
1283
1349
  case 5: return value; // find
1284
1350
  case 6: return index; // findIndex
1285
- case 2: push.call(target, value); // filter
1351
+ case 2: push$1(target, value); // filter
1286
1352
  } else switch (TYPE) {
1287
1353
  case 4: return false; // every
1288
- case 7: push.call(target, value); // filterReject
1354
+ case 7: push$1(target, value); // filterReject
1289
1355
  }
1290
1356
  }
1291
1357
  }
@@ -1326,21 +1392,28 @@
1326
1392
  var SYMBOL = 'Symbol';
1327
1393
  var PROTOTYPE = 'prototype';
1328
1394
  var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
1395
+
1329
1396
  var setInternalState$3 = internalState.set;
1330
1397
  var getInternalState$2 = internalState.getterFor(SYMBOL);
1398
+
1331
1399
  var ObjectPrototype$2 = Object[PROTOTYPE];
1332
1400
  var $Symbol = global_1.Symbol;
1401
+ var SymbolPrototype$1 = $Symbol && $Symbol[PROTOTYPE];
1402
+ var TypeError$7 = global_1.TypeError;
1403
+ var QObject = global_1.QObject;
1333
1404
  var $stringify = getBuiltIn('JSON', 'stringify');
1334
1405
  var nativeGetOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
1335
1406
  var nativeDefineProperty = objectDefineProperty.f;
1336
1407
  var nativeGetOwnPropertyNames = objectGetOwnPropertyNamesExternal.f;
1337
1408
  var nativePropertyIsEnumerable = objectPropertyIsEnumerable.f;
1409
+ var push = functionUncurryThis([].push);
1410
+
1338
1411
  var AllSymbols = shared('symbols');
1339
1412
  var ObjectPrototypeSymbols = shared('op-symbols');
1340
1413
  var StringToSymbolRegistry = shared('string-to-symbol-registry');
1341
1414
  var SymbolToStringRegistry = shared('symbol-to-string-registry');
1342
1415
  var WellKnownSymbolsStore = shared('wks');
1343
- var QObject = global_1.QObject;
1416
+
1344
1417
  // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
1345
1418
  var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
1346
1419
 
@@ -1359,7 +1432,7 @@
1359
1432
  } : nativeDefineProperty;
1360
1433
 
1361
1434
  var wrap = function (tag, description) {
1362
- var symbol = AllSymbols[tag] = objectCreate($Symbol[PROTOTYPE]);
1435
+ var symbol = AllSymbols[tag] = objectCreate(SymbolPrototype$1);
1363
1436
  setInternalState$3(symbol, {
1364
1437
  type: SYMBOL,
1365
1438
  tag: tag,
@@ -1390,7 +1463,7 @@
1390
1463
  var properties = toIndexedObject(Properties);
1391
1464
  var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
1392
1465
  $forEach(keys, function (key) {
1393
- if (!descriptors || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]);
1466
+ if (!descriptors || functionCall($propertyIsEnumerable, properties, key)) $defineProperty(O, key, properties[key]);
1394
1467
  });
1395
1468
  return O;
1396
1469
  };
@@ -1401,7 +1474,7 @@
1401
1474
 
1402
1475
  var $propertyIsEnumerable = function propertyIsEnumerable(V) {
1403
1476
  var P = toPropertyKey(V);
1404
- var enumerable = nativePropertyIsEnumerable.call(this, P);
1477
+ var enumerable = functionCall(nativePropertyIsEnumerable, this, P);
1405
1478
  if (this === ObjectPrototype$2 && hasOwnProperty_1(AllSymbols, P) && !hasOwnProperty_1(ObjectPrototypeSymbols, P)) return false;
1406
1479
  return enumerable || !hasOwnProperty_1(this, P) || !hasOwnProperty_1(AllSymbols, P) || hasOwnProperty_1(this, HIDDEN) && this[HIDDEN][P]
1407
1480
  ? enumerable : true;
@@ -1422,7 +1495,7 @@
1422
1495
  var names = nativeGetOwnPropertyNames(toIndexedObject(O));
1423
1496
  var result = [];
1424
1497
  $forEach(names, function (key) {
1425
- if (!hasOwnProperty_1(AllSymbols, key) && !hasOwnProperty_1(hiddenKeys$1, key)) result.push(key);
1498
+ if (!hasOwnProperty_1(AllSymbols, key) && !hasOwnProperty_1(hiddenKeys$1, key)) push(result, key);
1426
1499
  });
1427
1500
  return result;
1428
1501
  };
@@ -1433,7 +1506,7 @@
1433
1506
  var result = [];
1434
1507
  $forEach(names, function (key) {
1435
1508
  if (hasOwnProperty_1(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwnProperty_1(ObjectPrototype$2, key))) {
1436
- result.push(AllSymbols[key]);
1509
+ push(result, AllSymbols[key]);
1437
1510
  }
1438
1511
  });
1439
1512
  return result;
@@ -1441,13 +1514,13 @@
1441
1514
 
1442
1515
  // `Symbol` constructor
1443
1516
  // https://tc39.es/ecma262/#sec-symbol-constructor
1444
- if (!nativeSymbol$1) {
1517
+ if (!nativeSymbol) {
1445
1518
  $Symbol = function Symbol() {
1446
- if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor');
1519
+ if (objectIsPrototypeOf(SymbolPrototype$1, this)) throw TypeError$7('Symbol is not a constructor');
1447
1520
  var description = !arguments.length || arguments[0] === undefined ? undefined : toString_1(arguments[0]);
1448
1521
  var tag = uid(description);
1449
1522
  var setter = function (value) {
1450
- if (this === ObjectPrototype$2) setter.call(ObjectPrototypeSymbols, value);
1523
+ if (this === ObjectPrototype$2) functionCall(setter, ObjectPrototypeSymbols, value);
1451
1524
  if (hasOwnProperty_1(this, HIDDEN) && hasOwnProperty_1(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
1452
1525
  setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
1453
1526
  };
@@ -1455,7 +1528,9 @@
1455
1528
  return wrap(tag, description);
1456
1529
  };
1457
1530
 
1458
- redefine($Symbol[PROTOTYPE], 'toString', function toString() {
1531
+ SymbolPrototype$1 = $Symbol[PROTOTYPE];
1532
+
1533
+ redefine(SymbolPrototype$1, 'toString', function toString() {
1459
1534
  return getInternalState$2(this).tag;
1460
1535
  });
1461
1536
 
@@ -1475,7 +1550,7 @@
1475
1550
 
1476
1551
  if (descriptors) {
1477
1552
  // https://github.com/tc39/proposal-Symbol-description
1478
- nativeDefineProperty($Symbol[PROTOTYPE], 'description', {
1553
+ nativeDefineProperty(SymbolPrototype$1, 'description', {
1479
1554
  configurable: true,
1480
1555
  get: function description() {
1481
1556
  return getInternalState$2(this).description;
@@ -1487,7 +1562,7 @@
1487
1562
  }
1488
1563
  }
1489
1564
 
1490
- _export({ global: true, wrap: true, forced: !nativeSymbol$1, sham: !nativeSymbol$1 }, {
1565
+ _export({ global: true, wrap: true, forced: !nativeSymbol, sham: !nativeSymbol }, {
1491
1566
  Symbol: $Symbol
1492
1567
  });
1493
1568
 
@@ -1495,7 +1570,7 @@
1495
1570
  defineWellKnownSymbol(name);
1496
1571
  });
1497
1572
 
1498
- _export({ target: SYMBOL, stat: true, forced: !nativeSymbol$1 }, {
1573
+ _export({ target: SYMBOL, stat: true, forced: !nativeSymbol }, {
1499
1574
  // `Symbol.for` method
1500
1575
  // https://tc39.es/ecma262/#sec-symbol.for
1501
1576
  'for': function (key) {
@@ -1509,14 +1584,14 @@
1509
1584
  // `Symbol.keyFor` method
1510
1585
  // https://tc39.es/ecma262/#sec-symbol.keyfor
1511
1586
  keyFor: function keyFor(sym) {
1512
- if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol');
1587
+ if (!isSymbol(sym)) throw TypeError$7(sym + ' is not a symbol');
1513
1588
  if (hasOwnProperty_1(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
1514
1589
  },
1515
1590
  useSetter: function () { USE_SETTER = true; },
1516
1591
  useSimple: function () { USE_SETTER = false; }
1517
1592
  });
1518
1593
 
1519
- _export({ target: 'Object', stat: true, forced: !nativeSymbol$1, sham: !descriptors }, {
1594
+ _export({ target: 'Object', stat: true, forced: !nativeSymbol, sham: !descriptors }, {
1520
1595
  // `Object.create` method
1521
1596
  // https://tc39.es/ecma262/#sec-object.create
1522
1597
  create: $create,
@@ -1531,7 +1606,7 @@
1531
1606
  getOwnPropertyDescriptor: $getOwnPropertyDescriptor
1532
1607
  });
1533
1608
 
1534
- _export({ target: 'Object', stat: true, forced: !nativeSymbol$1 }, {
1609
+ _export({ target: 'Object', stat: true, forced: !nativeSymbol }, {
1535
1610
  // `Object.getOwnPropertyNames` method
1536
1611
  // https://tc39.es/ecma262/#sec-object.getownpropertynames
1537
1612
  getOwnPropertyNames: $getOwnPropertyNames,
@@ -1551,7 +1626,7 @@
1551
1626
  // `JSON.stringify` method behavior with symbols
1552
1627
  // https://tc39.es/ecma262/#sec-json.stringify
1553
1628
  if ($stringify) {
1554
- var FORCED_JSON_STRINGIFY = !nativeSymbol$1 || fails(function () {
1629
+ var FORCED_JSON_STRINGIFY = !nativeSymbol || fails(function () {
1555
1630
  var symbol = $Symbol();
1556
1631
  // MS Edge converts symbol values to JSON as {}
1557
1632
  return $stringify([symbol]) != '[null]'
@@ -1564,28 +1639,27 @@
1564
1639
  _export({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, {
1565
1640
  // eslint-disable-next-line no-unused-vars -- required for `.length`
1566
1641
  stringify: function stringify(it, replacer, space) {
1567
- var args = [it];
1568
- var index = 1;
1569
- var $replacer;
1570
- while (arguments.length > index) args.push(arguments[index++]);
1571
- $replacer = replacer;
1642
+ var args = arraySlice(arguments);
1643
+ var $replacer = replacer;
1572
1644
  if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
1573
1645
  if (!isArray$1(replacer)) replacer = function (key, value) {
1574
- if (isCallable($replacer)) value = $replacer.call(this, key, value);
1646
+ if (isCallable($replacer)) value = functionCall($replacer, this, key, value);
1575
1647
  if (!isSymbol(value)) return value;
1576
1648
  };
1577
1649
  args[1] = replacer;
1578
- return $stringify.apply(null, args);
1650
+ return functionApply($stringify, null, args);
1579
1651
  }
1580
1652
  });
1581
1653
  }
1582
1654
 
1583
1655
  // `Symbol.prototype[@@toPrimitive]` method
1584
1656
  // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
1585
- if (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) {
1586
- var valueOf = $Symbol[PROTOTYPE].valueOf;
1587
- redefine($Symbol[PROTOTYPE], TO_PRIMITIVE, function () {
1588
- return valueOf.apply(this, arguments);
1657
+ if (!SymbolPrototype$1[TO_PRIMITIVE]) {
1658
+ var valueOf = SymbolPrototype$1.valueOf;
1659
+ // eslint-disable-next-line no-unused-vars -- required for .length
1660
+ redefine(SymbolPrototype$1, TO_PRIMITIVE, function (hint) {
1661
+ // TODO: improve hint logic
1662
+ return functionCall(valueOf, this);
1589
1663
  });
1590
1664
  }
1591
1665
  // `Symbol.prototype[@@toStringTag]` property
@@ -1602,36 +1676,42 @@
1602
1676
 
1603
1677
 
1604
1678
  var NativeSymbol = global_1.Symbol;
1679
+ var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
1605
1680
 
1606
- if (descriptors && isCallable(NativeSymbol) && (!('description' in NativeSymbol.prototype) ||
1681
+ if (descriptors && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) ||
1607
1682
  // Safari 12 bug
1608
1683
  NativeSymbol().description !== undefined
1609
1684
  )) {
1610
1685
  var EmptyStringDescriptionStore = {};
1611
1686
  // wrap Symbol constructor for correct work with undefined description
1612
1687
  var SymbolWrapper = function Symbol() {
1613
- var description = arguments.length < 1 || arguments[0] === undefined ? undefined : String(arguments[0]);
1614
- var result = this instanceof SymbolWrapper
1688
+ var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString_1(arguments[0]);
1689
+ var result = objectIsPrototypeOf(SymbolPrototype, this)
1615
1690
  ? new NativeSymbol(description)
1616
1691
  // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
1617
1692
  : description === undefined ? NativeSymbol() : NativeSymbol(description);
1618
1693
  if (description === '') EmptyStringDescriptionStore[result] = true;
1619
1694
  return result;
1620
1695
  };
1696
+
1621
1697
  copyConstructorProperties(SymbolWrapper, NativeSymbol);
1622
- var symbolPrototype = SymbolWrapper.prototype = NativeSymbol.prototype;
1623
- symbolPrototype.constructor = SymbolWrapper;
1698
+ SymbolWrapper.prototype = SymbolPrototype;
1699
+ SymbolPrototype.constructor = SymbolWrapper;
1624
1700
 
1625
- var symbolToString = symbolPrototype.toString;
1626
- var nativeSymbol = String(NativeSymbol('test')) == 'Symbol(test)';
1701
+ var NATIVE_SYMBOL = String(NativeSymbol('test')) == 'Symbol(test)';
1702
+ var symbolToString = functionUncurryThis(SymbolPrototype.toString);
1703
+ var symbolValueOf = functionUncurryThis(SymbolPrototype.valueOf);
1627
1704
  var regexp = /^Symbol\((.*)\)[^)]+$/;
1628
- defineProperty$2(symbolPrototype, 'description', {
1705
+ var replace = functionUncurryThis(''.replace);
1706
+ var stringSlice$1 = functionUncurryThis(''.slice);
1707
+
1708
+ defineProperty$2(SymbolPrototype, 'description', {
1629
1709
  configurable: true,
1630
1710
  get: function description() {
1631
- var symbol = isObject(this) ? this.valueOf() : this;
1632
- var string = symbolToString.call(symbol);
1711
+ var symbol = symbolValueOf(this);
1712
+ var string = symbolToString(symbol);
1633
1713
  if (hasOwnProperty_1(EmptyStringDescriptionStore, symbol)) return '';
1634
- var desc = nativeSymbol ? string.slice(7, -1) : string.replace(regexp, '$1');
1714
+ var desc = NATIVE_SYMBOL ? stringSlice$1(string, 7, -1) : replace(string, regexp, '$1');
1635
1715
  return desc === '' ? undefined : desc;
1636
1716
  }
1637
1717
  });
@@ -1705,6 +1785,10 @@
1705
1785
 
1706
1786
  path.Symbol;
1707
1787
 
1788
+ var charAt$1 = functionUncurryThis(''.charAt);
1789
+ var charCodeAt = functionUncurryThis(''.charCodeAt);
1790
+ var stringSlice = functionUncurryThis(''.slice);
1791
+
1708
1792
  var createMethod = function (CONVERT_TO_STRING) {
1709
1793
  return function ($this, pos) {
1710
1794
  var S = toString_1(requireObjectCoercible($this));
@@ -1712,11 +1796,15 @@
1712
1796
  var size = S.length;
1713
1797
  var first, second;
1714
1798
  if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
1715
- first = S.charCodeAt(position);
1799
+ first = charCodeAt(S, position);
1716
1800
  return first < 0xD800 || first > 0xDBFF || position + 1 === size
1717
- || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
1718
- ? CONVERT_TO_STRING ? S.charAt(position) : first
1719
- : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
1801
+ || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
1802
+ ? CONVERT_TO_STRING
1803
+ ? charAt$1(S, position)
1804
+ : first
1805
+ : CONVERT_TO_STRING
1806
+ ? stringSlice(S, position, position + 2)
1807
+ : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
1720
1808
  };
1721
1809
  };
1722
1810
 
@@ -1737,18 +1825,18 @@
1737
1825
  });
1738
1826
 
1739
1827
  var IE_PROTO = sharedKey('IE_PROTO');
1740
- var ObjectPrototype$1 = Object.prototype;
1828
+ var Object$1 = global_1.Object;
1829
+ var ObjectPrototype$1 = Object$1.prototype;
1741
1830
 
1742
1831
  // `Object.getPrototypeOf` method
1743
1832
  // https://tc39.es/ecma262/#sec-object.getprototypeof
1744
- // eslint-disable-next-line es/no-object-getprototypeof -- safe
1745
- var objectGetPrototypeOf = correctPrototypeGetter ? Object.getPrototypeOf : function (O) {
1833
+ var objectGetPrototypeOf = correctPrototypeGetter ? Object$1.getPrototypeOf : function (O) {
1746
1834
  var object = toObject(O);
1747
1835
  if (hasOwnProperty_1(object, IE_PROTO)) return object[IE_PROTO];
1748
1836
  var constructor = object.constructor;
1749
1837
  if (isCallable(constructor) && object instanceof constructor) {
1750
1838
  return constructor.prototype;
1751
- } return object instanceof Object ? ObjectPrototype$1 : null;
1839
+ } return object instanceof Object$1 ? ObjectPrototype$1 : null;
1752
1840
  };
1753
1841
 
1754
1842
  var ITERATOR$4 = wellKnownSymbol('iterator');
@@ -1808,15 +1896,19 @@
1808
1896
  return IteratorConstructor;
1809
1897
  };
1810
1898
 
1899
+ var String$1 = global_1.String;
1900
+ var TypeError$6 = global_1.TypeError;
1901
+
1811
1902
  var aPossiblePrototype = function (argument) {
1812
- if (typeof argument === 'object' || isCallable(argument)) return argument;
1813
- throw TypeError("Can't set " + String(argument) + ' as a prototype');
1903
+ if (typeof argument == 'object' || isCallable(argument)) return argument;
1904
+ throw TypeError$6("Can't set " + String$1(argument) + ' as a prototype');
1814
1905
  };
1815
1906
 
1816
1907
  /* eslint-disable no-proto -- safe */
1817
1908
 
1818
1909
 
1819
1910
 
1911
+
1820
1912
  // `Object.setPrototypeOf` method
1821
1913
  // https://tc39.es/ecma262/#sec-object.setprototypeof
1822
1914
  // Works with __proto__ only. Old v8 can't work with null proto objects.
@@ -1827,14 +1919,14 @@
1827
1919
  var setter;
1828
1920
  try {
1829
1921
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1830
- setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
1831
- setter.call(test, []);
1922
+ setter = functionUncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1923
+ setter(test, []);
1832
1924
  CORRECT_SETTER = test instanceof Array;
1833
1925
  } catch (error) { /* empty */ }
1834
1926
  return function setPrototypeOf(O, proto) {
1835
1927
  anObject(O);
1836
1928
  aPossiblePrototype(proto);
1837
- if (CORRECT_SETTER) setter.call(O, proto);
1929
+ if (CORRECT_SETTER) setter(O, proto);
1838
1930
  else O.__proto__ = proto;
1839
1931
  return O;
1840
1932
  };
@@ -1896,7 +1988,7 @@
1896
1988
  createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
1897
1989
  } else {
1898
1990
  INCORRECT_VALUES_NAME = true;
1899
- defaultIterator = function values() { return nativeIterator.call(this); };
1991
+ defaultIterator = function values() { return functionCall(nativeIterator, this); };
1900
1992
  }
1901
1993
  }
1902
1994
 
@@ -1962,7 +2054,7 @@
1962
2054
  if (kind === 'throw') throw value;
1963
2055
  return value;
1964
2056
  }
1965
- innerResult = innerResult.call(iterator);
2057
+ innerResult = functionCall(innerResult, iterator);
1966
2058
  } catch (error) {
1967
2059
  innerError = true;
1968
2060
  innerResult = error;
@@ -1998,12 +2090,16 @@
1998
2090
  || iterators[classof(it)];
1999
2091
  };
2000
2092
 
2093
+ var TypeError$5 = global_1.TypeError;
2094
+
2001
2095
  var getIterator = function (argument, usingIterator) {
2002
2096
  var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
2003
- if (aCallable(iteratorMethod)) return anObject(iteratorMethod.call(argument));
2004
- throw TypeError(String(argument) + ' is not iterable');
2097
+ if (aCallable(iteratorMethod)) return anObject(functionCall(iteratorMethod, argument));
2098
+ throw TypeError$5(tryToString(argument) + ' is not iterable');
2005
2099
  };
2006
2100
 
2101
+ var Array$1 = global_1.Array;
2102
+
2007
2103
  // `Array.from` method implementation
2008
2104
  // https://tc39.es/ecma262/#sec-array.from
2009
2105
  var arrayFrom = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
@@ -2012,22 +2108,22 @@
2012
2108
  var argumentsLength = arguments.length;
2013
2109
  var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
2014
2110
  var mapping = mapfn !== undefined;
2015
- if (mapping) mapfn = functionBindContext(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2);
2111
+ if (mapping) mapfn = functionBindContext(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
2016
2112
  var iteratorMethod = getIteratorMethod(O);
2017
2113
  var index = 0;
2018
2114
  var length, result, step, iterator, next, value;
2019
2115
  // if the target is not iterable or it's an array with the default iterator - use a simple case
2020
- if (iteratorMethod && !(this == Array && isArrayIteratorMethod(iteratorMethod))) {
2116
+ if (iteratorMethod && !(this == Array$1 && isArrayIteratorMethod(iteratorMethod))) {
2021
2117
  iterator = getIterator(O, iteratorMethod);
2022
2118
  next = iterator.next;
2023
2119
  result = IS_CONSTRUCTOR ? new this() : [];
2024
- for (;!(step = next.call(iterator)).done; index++) {
2120
+ for (;!(step = functionCall(next, iterator)).done; index++) {
2025
2121
  value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
2026
2122
  createProperty(result, index, value);
2027
2123
  }
2028
2124
  } else {
2029
2125
  length = lengthOfArrayLike(O);
2030
- result = IS_CONSTRUCTOR ? new this(length) : Array(length);
2126
+ result = IS_CONSTRUCTOR ? new this(length) : Array$1(length);
2031
2127
  for (;length > index; index++) {
2032
2128
  value = mapping ? mapfn(O[index], index) : O[index];
2033
2129
  createProperty(result, index, value);
@@ -2088,7 +2184,7 @@
2088
2184
  path.Array.from;
2089
2185
 
2090
2186
  // eslint-disable-next-line es/no-typed-arrays -- safe
2091
- var arrayBufferNative = typeof ArrayBuffer !== 'undefined' && typeof DataView !== 'undefined';
2187
+ var arrayBufferNative = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined';
2092
2188
 
2093
2189
  var defineProperty$1 = objectDefineProperty.f;
2094
2190
 
@@ -2096,6 +2192,7 @@
2096
2192
 
2097
2193
 
2098
2194
 
2195
+
2099
2196
  var Int8Array$1 = global_1.Int8Array;
2100
2197
  var Int8ArrayPrototype = Int8Array$1 && Int8Array$1.prototype;
2101
2198
  var Uint8ClampedArray = global_1.Uint8ClampedArray;
@@ -2103,7 +2200,7 @@
2103
2200
  var TypedArray = Int8Array$1 && objectGetPrototypeOf(Int8Array$1);
2104
2201
  var TypedArrayPrototype = Int8ArrayPrototype && objectGetPrototypeOf(Int8ArrayPrototype);
2105
2202
  var ObjectPrototype = Object.prototype;
2106
- var isPrototypeOf = ObjectPrototype.isPrototypeOf;
2203
+ var TypeError$4 = global_1.TypeError;
2107
2204
 
2108
2205
  var TO_STRING_TAG = wellKnownSymbol('toStringTag');
2109
2206
  var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');
@@ -2147,12 +2244,12 @@
2147
2244
 
2148
2245
  var aTypedArray$1 = function (it) {
2149
2246
  if (isTypedArray(it)) return it;
2150
- throw TypeError('Target is not a typed array');
2247
+ throw TypeError$4('Target is not a typed array');
2151
2248
  };
2152
2249
 
2153
2250
  var aTypedArrayConstructor$1 = function (C) {
2154
- if (isCallable(C) && (!objectSetPrototypeOf || isPrototypeOf.call(TypedArray, C))) return C;
2155
- throw TypeError(tryToString(C) + ' is not a typed array constructor');
2251
+ if (isCallable(C) && (!objectSetPrototypeOf || objectIsPrototypeOf(TypedArray, C))) return C;
2252
+ throw TypeError$4(tryToString(C) + ' is not a typed array constructor');
2156
2253
  };
2157
2254
 
2158
2255
  var exportTypedArrayMethod$1 = function (KEY, property, forced) {
@@ -2211,7 +2308,7 @@
2211
2308
  if (!NATIVE_ARRAY_BUFFER_VIEWS || !isCallable(TypedArray) || TypedArray === Function.prototype) {
2212
2309
  // eslint-disable-next-line no-shadow -- safe
2213
2310
  TypedArray = function TypedArray() {
2214
- throw TypeError('Incorrect invocation');
2311
+ throw TypeError$4('Incorrect invocation');
2215
2312
  };
2216
2313
  if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {
2217
2314
  if (global_1[NAME]) objectSetPrototypeOf(global_1[NAME], TypedArray);
@@ -2254,10 +2351,12 @@
2254
2351
  TypedArrayPrototype: TypedArrayPrototype
2255
2352
  };
2256
2353
 
2354
+ var TypeError$3 = global_1.TypeError;
2355
+
2257
2356
  // `Assert: IsConstructor(argument) is true`
2258
2357
  var aConstructor = function (argument) {
2259
2358
  if (isConstructor(argument)) return argument;
2260
- throw TypeError(tryToString(argument) + ' is not a constructor');
2359
+ throw TypeError$3(tryToString(argument) + ' is not a constructor');
2261
2360
  };
2262
2361
 
2263
2362
  var SPECIES$1 = wellKnownSymbol('species');
@@ -2281,7 +2380,6 @@
2281
2380
 
2282
2381
  var aTypedArray = arrayBufferViewCore.aTypedArray;
2283
2382
  var exportTypedArrayMethod = arrayBufferViewCore.exportTypedArrayMethod;
2284
- var $slice = [].slice;
2285
2383
 
2286
2384
  var FORCED = fails(function () {
2287
2385
  // eslint-disable-next-line es/no-typed-arrays -- required for testing
@@ -2291,7 +2389,7 @@
2291
2389
  // `%TypedArray%.prototype.slice` method
2292
2390
  // https://tc39.es/ecma262/#sec-%typedarray%.prototype.slice
2293
2391
  exportTypedArrayMethod('slice', function slice(start, end) {
2294
- var list = $slice.call(aTypedArray(this), start, end);
2392
+ var list = arraySlice(aTypedArray(this), start, end);
2295
2393
  var C = typedArraySpeciesConstructor(this);
2296
2394
  var index = 0;
2297
2395
  var length = list.length;
@@ -2333,12 +2431,17 @@
2333
2431
 
2334
2432
  entryUnbind('Array', 'includes');
2335
2433
 
2434
+ var stringIndexOf = functionUncurryThis(''.indexOf);
2435
+
2336
2436
  // `String.prototype.includes` method
2337
2437
  // https://tc39.es/ecma262/#sec-string.prototype.includes
2338
2438
  _export({ target: 'String', proto: true, forced: !correctIsRegexpLogic('includes') }, {
2339
2439
  includes: function includes(searchString /* , position = 0 */) {
2340
- return !!~toString_1(requireObjectCoercible(this))
2341
- .indexOf(toString_1(notARegexp(searchString)), arguments.length > 1 ? arguments[1] : undefined);
2440
+ return !!~stringIndexOf(
2441
+ toString_1(requireObjectCoercible(this)),
2442
+ toString_1(notARegexp(searchString)),
2443
+ arguments.length > 1 ? arguments[1] : undefined
2444
+ );
2342
2445
  }
2343
2446
  });
2344
2447
 
@@ -2391,6 +2494,29 @@
2391
2494
  addToUnscopables('values');
2392
2495
  addToUnscopables('entries');
2393
2496
 
2497
+ // FF26- bug: ArrayBuffers are non-extensible, but Object.isExtensible does not report it
2498
+
2499
+
2500
+ var arrayBufferNonExtensible = fails(function () {
2501
+ if (typeof ArrayBuffer == 'function') {
2502
+ var buffer = new ArrayBuffer(8);
2503
+ // eslint-disable-next-line es/no-object-isextensible, es/no-object-defineproperty -- safe
2504
+ if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 });
2505
+ }
2506
+ });
2507
+
2508
+ // eslint-disable-next-line es/no-object-isextensible -- safe
2509
+ var $isExtensible = Object.isExtensible;
2510
+ var FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); });
2511
+
2512
+ // `Object.isExtensible` method
2513
+ // https://tc39.es/ecma262/#sec-object.isextensible
2514
+ var objectIsExtensible = (FAILS_ON_PRIMITIVES || arrayBufferNonExtensible) ? function isExtensible(it) {
2515
+ if (!isObject(it)) return false;
2516
+ if (arrayBufferNonExtensible && classofRaw(it) == 'ArrayBuffer') return false;
2517
+ return $isExtensible ? $isExtensible(it) : true;
2518
+ } : $isExtensible;
2519
+
2394
2520
  var freezing = !fails(function () {
2395
2521
  // eslint-disable-next-line es/no-object-isextensible, es/no-object-preventextensions -- required for testing
2396
2522
  return Object.isExtensible(Object.preventExtensions({}));
@@ -2403,15 +2529,11 @@
2403
2529
 
2404
2530
 
2405
2531
 
2532
+
2406
2533
  var REQUIRED = false;
2407
2534
  var METADATA = uid('meta');
2408
2535
  var id = 0;
2409
2536
 
2410
- // eslint-disable-next-line es/no-object-isextensible -- safe
2411
- var isExtensible = Object.isExtensible || function () {
2412
- return true;
2413
- };
2414
-
2415
2537
  var setMetadata = function (it) {
2416
2538
  defineProperty(it, METADATA, { value: {
2417
2539
  objectID: 'O' + id++, // object ID
@@ -2424,7 +2546,7 @@
2424
2546
  if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
2425
2547
  if (!hasOwnProperty_1(it, METADATA)) {
2426
2548
  // can't set metadata to uncaught frozen object
2427
- if (!isExtensible(it)) return 'F';
2549
+ if (!objectIsExtensible(it)) return 'F';
2428
2550
  // not necessary to add metadata
2429
2551
  if (!create) return 'E';
2430
2552
  // add missing metadata
@@ -2436,7 +2558,7 @@
2436
2558
  var getWeakData = function (it, create) {
2437
2559
  if (!hasOwnProperty_1(it, METADATA)) {
2438
2560
  // can't set metadata to uncaught frozen object
2439
- if (!isExtensible(it)) return true;
2561
+ if (!objectIsExtensible(it)) return true;
2440
2562
  // not necessary to add metadata
2441
2563
  if (!create) return false;
2442
2564
  // add missing metadata
@@ -2447,7 +2569,7 @@
2447
2569
 
2448
2570
  // add metadata on freeze-family methods calling
2449
2571
  var onFreeze = function (it) {
2450
- if (freezing && REQUIRED && isExtensible(it) && !hasOwnProperty_1(it, METADATA)) setMetadata(it);
2572
+ if (freezing && REQUIRED && objectIsExtensible(it) && !hasOwnProperty_1(it, METADATA)) setMetadata(it);
2451
2573
  return it;
2452
2574
  };
2453
2575
 
@@ -2455,7 +2577,7 @@
2455
2577
  meta.enable = function () { /* empty */ };
2456
2578
  REQUIRED = true;
2457
2579
  var getOwnPropertyNames = objectGetOwnPropertyNames.f;
2458
- var splice = [].splice;
2580
+ var splice = functionUncurryThis([].splice);
2459
2581
  var test = {};
2460
2582
  test[METADATA] = 1;
2461
2583
 
@@ -2465,7 +2587,7 @@
2465
2587
  var result = getOwnPropertyNames(it);
2466
2588
  for (var i = 0, length = result.length; i < length; i++) {
2467
2589
  if (result[i] === METADATA) {
2468
- splice.call(result, i, 1);
2590
+ splice(result, i, 1);
2469
2591
  break;
2470
2592
  }
2471
2593
  } return result;
@@ -2491,17 +2613,21 @@
2491
2613
  internalMetadata.getWeakData;
2492
2614
  internalMetadata.onFreeze;
2493
2615
 
2616
+ var TypeError$2 = global_1.TypeError;
2617
+
2494
2618
  var Result = function (stopped, result) {
2495
2619
  this.stopped = stopped;
2496
2620
  this.result = result;
2497
2621
  };
2498
2622
 
2623
+ var ResultPrototype = Result.prototype;
2624
+
2499
2625
  var iterate = function (iterable, unboundFunction, options) {
2500
2626
  var that = options && options.that;
2501
2627
  var AS_ENTRIES = !!(options && options.AS_ENTRIES);
2502
2628
  var IS_ITERATOR = !!(options && options.IS_ITERATOR);
2503
2629
  var INTERRUPTED = !!(options && options.INTERRUPTED);
2504
- var fn = functionBindContext(unboundFunction, that, 1 + AS_ENTRIES + INTERRUPTED);
2630
+ var fn = functionBindContext(unboundFunction, that);
2505
2631
  var iterator, iterFn, index, length, result, next, step;
2506
2632
 
2507
2633
  var stop = function (condition) {
@@ -2520,31 +2646,33 @@
2520
2646
  iterator = iterable;
2521
2647
  } else {
2522
2648
  iterFn = getIteratorMethod(iterable);
2523
- if (!iterFn) throw TypeError(String(iterable) + ' is not iterable');
2649
+ if (!iterFn) throw TypeError$2(tryToString(iterable) + ' is not iterable');
2524
2650
  // optimisation for array iterators
2525
2651
  if (isArrayIteratorMethod(iterFn)) {
2526
2652
  for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
2527
2653
  result = callFn(iterable[index]);
2528
- if (result && result instanceof Result) return result;
2654
+ if (result && objectIsPrototypeOf(ResultPrototype, result)) return result;
2529
2655
  } return new Result(false);
2530
2656
  }
2531
2657
  iterator = getIterator(iterable, iterFn);
2532
2658
  }
2533
2659
 
2534
2660
  next = iterator.next;
2535
- while (!(step = next.call(iterator)).done) {
2661
+ while (!(step = functionCall(next, iterator)).done) {
2536
2662
  try {
2537
2663
  result = callFn(step.value);
2538
2664
  } catch (error) {
2539
2665
  iteratorClose(iterator, 'throw', error);
2540
2666
  }
2541
- if (typeof result == 'object' && result && result instanceof Result) return result;
2667
+ if (typeof result == 'object' && result && objectIsPrototypeOf(ResultPrototype, result)) return result;
2542
2668
  } return new Result(false);
2543
2669
  };
2544
2670
 
2545
- var anInstance = function (it, Constructor, name) {
2546
- if (it instanceof Constructor) return it;
2547
- throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');
2671
+ var TypeError$1 = global_1.TypeError;
2672
+
2673
+ var anInstance = function (it, Prototype) {
2674
+ if (objectIsPrototypeOf(Prototype, it)) return it;
2675
+ throw TypeError$1('Incorrect invocation');
2548
2676
  };
2549
2677
 
2550
2678
  // makes subclassing work correct for wrapped built-ins
@@ -2572,19 +2700,19 @@
2572
2700
  var exported = {};
2573
2701
 
2574
2702
  var fixMethod = function (KEY) {
2575
- var nativeMethod = NativePrototype[KEY];
2703
+ var uncurriedNativeMethod = functionUncurryThis(NativePrototype[KEY]);
2576
2704
  redefine(NativePrototype, KEY,
2577
2705
  KEY == 'add' ? function add(value) {
2578
- nativeMethod.call(this, value === 0 ? 0 : value);
2706
+ uncurriedNativeMethod(this, value === 0 ? 0 : value);
2579
2707
  return this;
2580
2708
  } : KEY == 'delete' ? function (key) {
2581
- return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
2709
+ return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
2582
2710
  } : KEY == 'get' ? function get(key) {
2583
- return IS_WEAK && !isObject(key) ? undefined : nativeMethod.call(this, key === 0 ? 0 : key);
2711
+ return IS_WEAK && !isObject(key) ? undefined : uncurriedNativeMethod(this, key === 0 ? 0 : key);
2584
2712
  } : KEY == 'has' ? function has(key) {
2585
- return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
2713
+ return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
2586
2714
  } : function set(key, value) {
2587
- nativeMethod.call(this, key === 0 ? 0 : key, value);
2715
+ uncurriedNativeMethod(this, key === 0 ? 0 : key, value);
2588
2716
  return this;
2589
2717
  }
2590
2718
  );
@@ -2621,7 +2749,7 @@
2621
2749
 
2622
2750
  if (!ACCEPT_ITERABLES) {
2623
2751
  Constructor = wrapper(function (dummy, iterable) {
2624
- anInstance(dummy, Constructor, CONSTRUCTOR_NAME);
2752
+ anInstance(dummy, NativePrototype);
2625
2753
  var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
2626
2754
  if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
2627
2755
  return that;
@@ -2688,8 +2816,8 @@
2688
2816
 
2689
2817
  var collectionStrong = {
2690
2818
  getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
2691
- var C = wrapper(function (that, iterable) {
2692
- anInstance(that, C, CONSTRUCTOR_NAME);
2819
+ var Constructor = wrapper(function (that, iterable) {
2820
+ anInstance(that, Prototype);
2693
2821
  setInternalState(that, {
2694
2822
  type: CONSTRUCTOR_NAME,
2695
2823
  index: objectCreate(null),
@@ -2701,6 +2829,8 @@
2701
2829
  if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
2702
2830
  });
2703
2831
 
2832
+ var Prototype = Constructor.prototype;
2833
+
2704
2834
  var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
2705
2835
 
2706
2836
  var define = function (that, key, value) {
@@ -2741,7 +2871,7 @@
2741
2871
  }
2742
2872
  };
2743
2873
 
2744
- redefineAll(C.prototype, {
2874
+ redefineAll(Prototype, {
2745
2875
  // `{ Map, Set }.prototype.clear()` methods
2746
2876
  // https://tc39.es/ecma262/#sec-map.prototype.clear
2747
2877
  // https://tc39.es/ecma262/#sec-set.prototype.clear
@@ -2785,7 +2915,7 @@
2785
2915
  // https://tc39.es/ecma262/#sec-set.prototype.foreach
2786
2916
  forEach: function forEach(callbackfn /* , that = undefined */) {
2787
2917
  var state = getInternalState(this);
2788
- var boundFunction = functionBindContext(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
2918
+ var boundFunction = functionBindContext(callbackfn, arguments.length > 1 ? arguments[1] : undefined);
2789
2919
  var entry;
2790
2920
  while (entry = entry ? entry.next : state.first) {
2791
2921
  boundFunction(entry.value, entry.key, this);
@@ -2801,7 +2931,7 @@
2801
2931
  }
2802
2932
  });
2803
2933
 
2804
- redefineAll(C.prototype, IS_MAP ? {
2934
+ redefineAll(Prototype, IS_MAP ? {
2805
2935
  // `Map.prototype.get(key)` method
2806
2936
  // https://tc39.es/ecma262/#sec-map.prototype.get
2807
2937
  get: function get(key) {
@@ -2820,14 +2950,14 @@
2820
2950
  return define(this, value = value === 0 ? 0 : value, value);
2821
2951
  }
2822
2952
  });
2823
- if (descriptors) defineProperty(C.prototype, 'size', {
2953
+ if (descriptors) defineProperty(Prototype, 'size', {
2824
2954
  get: function () {
2825
2955
  return getInternalState(this).size;
2826
2956
  }
2827
2957
  });
2828
- return C;
2958
+ return Constructor;
2829
2959
  },
2830
- setStrong: function (C, CONSTRUCTOR_NAME, IS_MAP) {
2960
+ setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) {
2831
2961
  var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
2832
2962
  var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
2833
2963
  var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
@@ -2840,7 +2970,7 @@
2840
2970
  // https://tc39.es/ecma262/#sec-set.prototype.keys
2841
2971
  // https://tc39.es/ecma262/#sec-set.prototype.values
2842
2972
  // https://tc39.es/ecma262/#sec-set.prototype-@@iterator
2843
- defineIterator(C, CONSTRUCTOR_NAME, function (iterated, kind) {
2973
+ defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) {
2844
2974
  setInternalState(this, {
2845
2975
  type: ITERATOR_NAME,
2846
2976
  target: iterated,
@@ -2956,6 +3086,8 @@
2956
3086
  // Store setTimeout reference so promise-polyfill will be unaffected by
2957
3087
  // other code modifying setTimeout (like sinon.useFakeTimers())
2958
3088
  var setTimeoutFunc = setTimeout;
3089
+ // @ts-ignore
3090
+ var setImmediateFunc = typeof setImmediate !== 'undefined' ? setImmediate : null;
2959
3091
 
2960
3092
  function isArray(x) {
2961
3093
  return Boolean(x && typeof x.length !== 'undefined');
@@ -3189,10 +3321,10 @@
3189
3321
  // Use polyfill for setImmediate for performance gains
3190
3322
  Promise$1._immediateFn =
3191
3323
  // @ts-ignore
3192
- (typeof setImmediate === 'function' &&
3324
+ (typeof setImmediateFunc === 'function' &&
3193
3325
  function(fn) {
3194
3326
  // @ts-ignore
3195
- setImmediate(fn);
3327
+ setImmediateFunc(fn);
3196
3328
  }) ||
3197
3329
  function(fn) {
3198
3330
  setTimeoutFunc(fn, 0);
@@ -3227,10 +3359,13 @@
3227
3359
  // https://github.com/taylorhakes/promise-polyfill/issues/114
3228
3360
  if (typeof globalNS['Promise'] !== 'function') {
3229
3361
  globalNS['Promise'] = Promise$1;
3230
- } else if (!globalNS.Promise.prototype['finally']) {
3231
- globalNS.Promise.prototype['finally'] = finallyConstructor;
3232
- } else if (!globalNS.Promise.allSettled) {
3233
- globalNS.Promise.allSettled = allSettled;
3362
+ } else {
3363
+ if (!globalNS.Promise.prototype['finally']) {
3364
+ globalNS.Promise.prototype['finally'] = finallyConstructor;
3365
+ }
3366
+ if (!globalNS.Promise.allSettled) {
3367
+ globalNS.Promise.allSettled = allSettled;
3368
+ }
3234
3369
  }
3235
3370
 
3236
3371
  (function(l){function m(){}function k(a,c){a=void 0===a?"utf-8":a;c=void 0===c?{fatal:!1}:c;if(-1===r.indexOf(a.toLowerCase()))throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+a+"') is invalid.");if(c.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.");}function t(a){return Buffer.from(a.buffer,a.byteOffset,a.byteLength).toString("utf-8")}function u(a){var c=URL.createObjectURL(new Blob([a],{type:"text/plain;charset=UTF-8"}));
@@ -4008,7 +4143,7 @@
4008
4143
 
4009
4144
  var Lock = unwrapExports(browserTabsLock);
4010
4145
 
4011
- var version = '1.19.2';
4146
+ var version = '1.19.3';
4012
4147
 
4013
4148
  /**
4014
4149
  * @ignore
@@ -4839,7 +4974,7 @@
4839
4974
  function TransactionManager(storage, clientId) {
4840
4975
  this.storage = storage;
4841
4976
  this.clientId = clientId;
4842
- this.storageKey = TRANSACTION_STORAGE_KEY_PREFIX + "." + clientId;
4977
+ this.storageKey = TRANSACTION_STORAGE_KEY_PREFIX + "." + this.clientId;
4843
4978
  this.transaction = this.storage.get(this.storageKey);
4844
4979
  }
4845
4980
  TransactionManager.prototype.create = function (transaction) {
@@ -5437,8 +5572,11 @@
5437
5572
  return "" + this.domainUrl + path + "&auth0Client=" + auth0Client;
5438
5573
  };
5439
5574
  Auth0Client.prototype._getParams = function (authorizeOptions, state, nonce, code_challenge, redirect_uri) {
5440
- var _a = this.options; _a.domain; _a.leeway; _a.useRefreshTokens; _a.useCookiesForTransactions; _a.useFormData; _a.auth0Client; _a.cacheLocation; _a.advancedOptions; var withoutClientOptions = __rest(_a, ["domain", "leeway", "useRefreshTokens", "useCookiesForTransactions", "useFormData", "auth0Client", "cacheLocation", "advancedOptions"]);
5441
- return __assign(__assign(__assign({}, withoutClientOptions), authorizeOptions), { scope: getUniqueScopes(this.defaultScope, this.scope, authorizeOptions.scope), response_type: 'code', response_mode: 'query', state: state, nonce: nonce, redirect_uri: redirect_uri || this.options.redirect_uri, code_challenge: code_challenge, code_challenge_method: 'S256' });
5575
+ // These options should be excluded from the authorize URL,
5576
+ // as they're options for the client and not for the IdP.
5577
+ // ** IMPORTANT ** If adding a new client option, include it in this destructure list.
5578
+ var _a = this.options; _a.useRefreshTokens; _a.useCookiesForTransactions; _a.useFormData; _a.auth0Client; _a.cacheLocation; _a.advancedOptions; _a.detailedResponse; _a.nowProvider; _a.authorizeTimeoutInSeconds; _a.legacySameSiteCookie; _a.sessionCheckExpiryDays; _a.domain; _a.leeway; var loginOptions = __rest(_a, ["useRefreshTokens", "useCookiesForTransactions", "useFormData", "auth0Client", "cacheLocation", "advancedOptions", "detailedResponse", "nowProvider", "authorizeTimeoutInSeconds", "legacySameSiteCookie", "sessionCheckExpiryDays", "domain", "leeway"]);
5579
+ return __assign(__assign(__assign({}, loginOptions), authorizeOptions), { scope: getUniqueScopes(this.defaultScope, this.scope, authorizeOptions.scope), response_type: 'code', response_mode: 'query', state: state, nonce: nonce, redirect_uri: redirect_uri || this.options.redirect_uri, code_challenge: code_challenge, code_challenge_method: 'S256' });
5442
5580
  };
5443
5581
  Auth0Client.prototype._authorizeUrl = function (authorizeOptions) {
5444
5582
  return this._url("/authorize?" + createQueryParams(authorizeOptions));
@@ -5509,7 +5647,7 @@
5509
5647
  params = this._getParams(authorizeOptions, stateIn, nonceIn, code_challenge, redirect_uri);
5510
5648
  url = this._authorizeUrl(params);
5511
5649
  organizationId = options.organization || this.options.organization;
5512
- this.transactionManager.create(__assign({ nonce: nonceIn, code_verifier: code_verifier, appState: appState, scope: params.scope, audience: params.audience || 'default', redirect_uri: params.redirect_uri }, (organizationId && { organizationId: organizationId })));
5650
+ this.transactionManager.create(__assign({ nonce: nonceIn, code_verifier: code_verifier, appState: appState, scope: params.scope, audience: params.audience || 'default', redirect_uri: params.redirect_uri, state: stateIn }, (organizationId && { organizationId: organizationId })));
5513
5651
  return [2 /*return*/, url + fragment];
5514
5652
  }
5515
5653
  });
@@ -5716,14 +5854,18 @@
5716
5854
  }
5717
5855
  _a = parseQueryResult(queryStringFragments.join('')), state = _a.state, code = _a.code, error = _a.error, error_description = _a.error_description;
5718
5856
  transaction = this.transactionManager.get();
5719
- // Transaction should have a `code_verifier` to do PKCE for CSRF protection
5720
- if (!transaction || !transaction.code_verifier) {
5857
+ if (!transaction) {
5721
5858
  throw new Error('Invalid state');
5722
5859
  }
5723
5860
  this.transactionManager.remove();
5724
5861
  if (error) {
5725
5862
  throw new AuthenticationError(error, error_description, state, transaction.appState);
5726
5863
  }
5864
+ // Transaction should have a `code_verifier` to do PKCE for CSRF protection
5865
+ if (!transaction.code_verifier ||
5866
+ (transaction.state && transaction.state !== state)) {
5867
+ throw new Error('Invalid state');
5868
+ }
5727
5869
  tokenOptions = {
5728
5870
  audience: transaction.audience,
5729
5871
  scope: transaction.scope,
@@ -5746,7 +5888,7 @@
5746
5888
  return [4 /*yield*/, this._verifyIdToken(authResult.id_token, transaction.nonce, transaction.organizationId)];
5747
5889
  case 2:
5748
5890
  decodedToken = _b.sent();
5749
- return [4 /*yield*/, this.cacheManager.set(__assign(__assign({}, authResult), { decodedToken: decodedToken, audience: transaction.audience, scope: transaction.scope, client_id: this.options.client_id }))];
5891
+ return [4 /*yield*/, this.cacheManager.set(__assign(__assign(__assign(__assign({}, authResult), { decodedToken: decodedToken, audience: transaction.audience, scope: transaction.scope }), (authResult.scope ? { oauthTokenScope: authResult.scope } : null)), { client_id: this.options.client_id }))];
5750
5892
  case 3:
5751
5893
  _b.sent();
5752
5894
  this.cookieStorage.save(this.isAuthenticatedCookieName, true, {
@@ -5777,6 +5919,12 @@
5777
5919
  * `Auth0Client` constructor. You should not need this if you are using the
5778
5920
  * `createAuth0Client` factory.
5779
5921
  *
5922
+ * **Note:** the cookie **may not** be present if running an app using a private tab, as some
5923
+ * browsers clear JS cookie data and local storage when the tab or page is closed, or on page reload. This effectively
5924
+ * means that `checkSession` could silently return without authenticating the user on page refresh when
5925
+ * using a private tab, despite having previously logged in. As a workaround, use `getTokenSilently` instead
5926
+ * and handle the possible `login_required` error [as shown in the readme](https://github.com/auth0/auth0-spa-js#creating-the-client).
5927
+ *
5780
5928
  * @param options
5781
5929
  */
5782
5930
  Auth0Client.prototype.checkSession = function (options) {
@@ -6055,7 +6203,7 @@
6055
6203
  };
6056
6204
  Auth0Client.prototype._getTokenFromIFrame = function (options) {
6057
6205
  return __awaiter(this, void 0, void 0, function () {
6058
- var stateIn, nonceIn, code_verifier, code_challengeBuffer, code_challenge, params, orgIdHint, url, timeout, codeResult, scope, audience, customOptions, tokenResult, decodedToken, e_1;
6206
+ var stateIn, nonceIn, code_verifier, code_challengeBuffer, code_challenge, withoutClientOptions, params, orgIdHint, url, timeout, codeResult, scope, audience, customOptions, tokenResult, decodedToken, e_1;
6059
6207
  return __generator(this, function (_a) {
6060
6208
  switch (_a.label) {
6061
6209
  case 0:
@@ -6066,7 +6214,8 @@
6066
6214
  case 1:
6067
6215
  code_challengeBuffer = _a.sent();
6068
6216
  code_challenge = bufferToBase64UrlEncoded(code_challengeBuffer);
6069
- params = this._getParams(options, stateIn, nonceIn, code_challenge, options.redirect_uri ||
6217
+ withoutClientOptions = __rest(options, ["detailedResponse"]);
6218
+ params = this._getParams(withoutClientOptions, stateIn, nonceIn, code_challenge, options.redirect_uri ||
6070
6219
  this.options.redirect_uri ||
6071
6220
  window.location.origin);
6072
6221
  orgIdHint = this.cookieStorage.get(this.orgHintCookieName);
@@ -6090,7 +6239,7 @@
6090
6239
  if (stateIn !== codeResult.state) {
6091
6240
  throw new Error('Invalid state');
6092
6241
  }
6093
- scope = options.scope, audience = options.audience, customOptions = __rest(options, ["scope", "audience", "redirect_uri", "ignoreCache", "timeoutInSeconds"]);
6242
+ scope = options.scope, audience = options.audience, customOptions = __rest(options, ["scope", "audience", "redirect_uri", "ignoreCache", "timeoutInSeconds", "detailedResponse"]);
6094
6243
  return [4 /*yield*/, oauthToken(__assign(__assign(__assign({}, this.customOptions), customOptions), { scope: scope, audience: audience, baseUrl: this.domainUrl, client_id: this.options.client_id, code_verifier: code_verifier, code: codeResult.code, grant_type: 'authorization_code', redirect_uri: params.redirect_uri, auth0Client: this.options.auth0Client, useFormData: this.options.useFormData }), this.worker)];
6095
6244
  case 4:
6096
6245
  tokenResult = _a.sent();
@@ -6133,7 +6282,7 @@
6133
6282
  redirect_uri = options.redirect_uri ||
6134
6283
  this.options.redirect_uri ||
6135
6284
  window.location.origin;
6136
- scope = options.scope, audience = options.audience, customOptions = __rest(options, ["scope", "audience", "ignoreCache", "timeoutInSeconds"]);
6285
+ scope = options.scope, audience = options.audience, customOptions = __rest(options, ["scope", "audience", "ignoreCache", "timeoutInSeconds", "detailedResponse"]);
6137
6286
  timeout = typeof options.timeoutInSeconds === 'number'
6138
6287
  ? options.timeoutInSeconds * 1000
6139
6288
  : null;
@@ -6197,6 +6346,15 @@
6197
6346
  return Auth0Client;
6198
6347
  }());
6199
6348
 
6349
+ /**
6350
+ * Asynchronously creates the Auth0Client instance and calls `checkSession`.
6351
+ *
6352
+ * **Note:** There are caveats to using this in a private browser tab, which may not silently authenticae
6353
+ * a user on page refresh. Please see [the checkSession docs](https://auth0.github.io/auth0-spa-js/classes/auth0client.html#checksession) for more info.
6354
+ *
6355
+ * @param options The client options
6356
+ * @returns An instance of Auth0Client
6357
+ */
6200
6358
  function createAuth0Client(options) {
6201
6359
  return __awaiter(this, void 0, void 0, function () {
6202
6360
  var auth0;