@tryghost/content-api 1.7.3 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/content-api.js CHANGED
@@ -48,9 +48,15 @@ var descriptors = !fails(function () {
48
48
  return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
49
49
  });
50
50
 
51
+ var functionBindNative = !fails(function () {
52
+ var test = (function () { /* empty */ }).bind();
53
+ // eslint-disable-next-line no-prototype-builtins -- safe
54
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
55
+ });
56
+
51
57
  var call$2 = Function.prototype.call;
52
58
 
53
- var functionCall = call$2.bind ? call$2.bind(call$2) : function () {
59
+ var functionCall = functionBindNative ? call$2.bind(call$2) : function () {
54
60
  return call$2.apply(call$2, arguments);
55
61
  };
56
62
 
@@ -63,13 +69,13 @@ var NASHORN_BUG = getOwnPropertyDescriptor$4 && !$propertyIsEnumerable.call({ 1:
63
69
 
64
70
  // `Object.prototype.propertyIsEnumerable` method implementation
65
71
  // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
66
- var f$5 = NASHORN_BUG ? function propertyIsEnumerable(V) {
72
+ var f$6 = NASHORN_BUG ? function propertyIsEnumerable(V) {
67
73
  var descriptor = getOwnPropertyDescriptor$4(this, V);
68
74
  return !!descriptor && descriptor.enumerable;
69
75
  } : $propertyIsEnumerable;
70
76
 
71
77
  var objectPropertyIsEnumerable = {
72
- f: f$5
78
+ f: f$6
73
79
  };
74
80
 
75
81
  var createPropertyDescriptor = function (bitmap, value) {
@@ -82,12 +88,12 @@ var createPropertyDescriptor = function (bitmap, value) {
82
88
  };
83
89
 
84
90
  var FunctionPrototype$3 = Function.prototype;
85
- var bind$4 = FunctionPrototype$3.bind;
91
+ var bind$3 = FunctionPrototype$3.bind;
86
92
  var call$1 = FunctionPrototype$3.call;
87
- var callBind = bind$4 && bind$4.bind(call$1);
93
+ var uncurryThis = functionBindNative && bind$3.bind(call$1, call$1);
88
94
 
89
- var functionUncurryThis = bind$4 ? function (fn) {
90
- return fn && callBind(call$1, fn);
95
+ var functionUncurryThis = functionBindNative ? function (fn) {
96
+ return fn && uncurryThis(fn);
91
97
  } : function (fn) {
92
98
  return fn && function () {
93
99
  return call$1.apply(fn, arguments);
@@ -95,10 +101,10 @@ var functionUncurryThis = bind$4 ? function (fn) {
95
101
  };
96
102
 
97
103
  var toString$2 = functionUncurryThis({}.toString);
98
- var stringSlice$2 = functionUncurryThis(''.slice);
104
+ var stringSlice$3 = functionUncurryThis(''.slice);
99
105
 
100
106
  var classofRaw = function (it) {
101
- return stringSlice$2(toString$2(it), 8, -1);
107
+ return stringSlice$3(toString$2(it), 8, -1);
102
108
  };
103
109
 
104
110
  var Object$4 = global_1.Object;
@@ -113,12 +119,12 @@ var indexedObject = fails(function () {
113
119
  return classofRaw(it) == 'String' ? split(it, '') : Object$4(it);
114
120
  } : Object$4;
115
121
 
116
- var TypeError$f = global_1.TypeError;
122
+ var TypeError$h = global_1.TypeError;
117
123
 
118
124
  // `RequireObjectCoercible` abstract operation
119
125
  // https://tc39.es/ecma262/#sec-requireobjectcoercible
120
126
  var requireObjectCoercible = function (it) {
121
- if (it == undefined) throw TypeError$f("Can't call method on " + it);
127
+ if (it == undefined) throw TypeError$h("Can't call method on " + it);
122
128
  return it;
123
129
  };
124
130
 
@@ -217,12 +223,12 @@ var tryToString = function (argument) {
217
223
  }
218
224
  };
219
225
 
220
- var TypeError$e = global_1.TypeError;
226
+ var TypeError$g = global_1.TypeError;
221
227
 
222
228
  // `Assert: IsCallable(argument) is true`
223
229
  var aCallable = function (argument) {
224
230
  if (isCallable(argument)) return argument;
225
- throw TypeError$e(tryToString(argument) + ' is not a function');
231
+ throw TypeError$g(tryToString(argument) + ' is not a function');
226
232
  };
227
233
 
228
234
  // `GetMethod` abstract operation
@@ -232,7 +238,7 @@ var getMethod = function (V, P) {
232
238
  return func == null ? undefined : aCallable(func);
233
239
  };
234
240
 
235
- var TypeError$d = global_1.TypeError;
241
+ var TypeError$f = global_1.TypeError;
236
242
 
237
243
  // `OrdinaryToPrimitive` abstract operation
238
244
  // https://tc39.es/ecma262/#sec-ordinarytoprimitive
@@ -241,7 +247,7 @@ var ordinaryToPrimitive = function (input, pref) {
241
247
  if (pref === 'string' && isCallable(fn = input.toString) && !isObject$1(val = functionCall(fn, input))) return val;
242
248
  if (isCallable(fn = input.valueOf) && !isObject$1(val = functionCall(fn, input))) return val;
243
249
  if (pref !== 'string' && isCallable(fn = input.toString) && !isObject$1(val = functionCall(fn, input))) return val;
244
- throw TypeError$d("Can't convert object to primitive value");
250
+ throw TypeError$f("Can't convert object to primitive value");
245
251
  };
246
252
 
247
253
  // eslint-disable-next-line es/no-object-defineproperty -- safe
@@ -264,9 +270,11 @@ var shared = createCommonjsModule(function (module) {
264
270
  (module.exports = function (key, value) {
265
271
  return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
266
272
  })('versions', []).push({
267
- version: '3.19.1',
273
+ version: '3.21.1',
268
274
  mode: 'global',
269
- copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
275
+ copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
276
+ license: 'https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE',
277
+ source: 'https://github.com/zloirock/core-js'
270
278
  });
271
279
  });
272
280
 
@@ -312,7 +320,7 @@ var wellKnownSymbol = function (name) {
312
320
  } return WellKnownSymbolsStore[name];
313
321
  };
314
322
 
315
- var TypeError$c = global_1.TypeError;
323
+ var TypeError$e = global_1.TypeError;
316
324
  var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
317
325
 
318
326
  // `ToPrimitive` abstract operation
@@ -325,7 +333,7 @@ var toPrimitive = function (input, pref) {
325
333
  if (pref === undefined) pref = 'default';
326
334
  result = functionCall(exoticToPrim, input, pref);
327
335
  if (!isObject$1(result) || isSymbol(result)) return result;
328
- throw TypeError$c("Can't convert object to primitive value");
336
+ throw TypeError$e("Can't convert object to primitive value");
329
337
  }
330
338
  if (pref === undefined) pref = 'number';
331
339
  return ordinaryToPrimitive(input, pref);
@@ -346,61 +354,91 @@ var documentCreateElement = function (it) {
346
354
  return EXISTS$1 ? document$3.createElement(it) : {};
347
355
  };
348
356
 
349
- // Thank's IE8 for his funny defineProperty
357
+ // Thanks to IE8 for its funny defineProperty
350
358
  var ie8DomDefine = !descriptors && !fails(function () {
351
- // eslint-disable-next-line es/no-object-defineproperty -- requied for testing
359
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
352
360
  return Object.defineProperty(documentCreateElement('div'), 'a', {
353
361
  get: function () { return 7; }
354
362
  }).a != 7;
355
363
  });
356
364
 
357
365
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
358
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
366
+ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
359
367
 
360
368
  // `Object.getOwnPropertyDescriptor` method
361
369
  // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
362
- var f$4 = descriptors ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
370
+ var f$5 = descriptors ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
363
371
  O = toIndexedObject(O);
364
372
  P = toPropertyKey(P);
365
373
  if (ie8DomDefine) try {
366
- return $getOwnPropertyDescriptor(O, P);
374
+ return $getOwnPropertyDescriptor$1(O, P);
367
375
  } catch (error) { /* empty */ }
368
376
  if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
369
377
  };
370
378
 
371
379
  var objectGetOwnPropertyDescriptor = {
372
- f: f$4
380
+ f: f$5
373
381
  };
374
382
 
383
+ // V8 ~ Chrome 36-
384
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
385
+ var v8PrototypeDefineBug = descriptors && fails(function () {
386
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
387
+ return Object.defineProperty(function () { /* empty */ }, 'prototype', {
388
+ value: 42,
389
+ writable: false
390
+ }).prototype != 42;
391
+ });
392
+
375
393
  var String$4 = global_1.String;
376
- var TypeError$b = global_1.TypeError;
394
+ var TypeError$d = global_1.TypeError;
377
395
 
378
396
  // `Assert: Type(argument) is Object`
379
397
  var anObject = function (argument) {
380
398
  if (isObject$1(argument)) return argument;
381
- throw TypeError$b(String$4(argument) + ' is not an object');
399
+ throw TypeError$d(String$4(argument) + ' is not an object');
382
400
  };
383
401
 
384
- var TypeError$a = global_1.TypeError;
402
+ var TypeError$c = global_1.TypeError;
385
403
  // eslint-disable-next-line es/no-object-defineproperty -- safe
386
404
  var $defineProperty = Object.defineProperty;
405
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
406
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
407
+ var ENUMERABLE = 'enumerable';
408
+ var CONFIGURABLE$1 = 'configurable';
409
+ var WRITABLE = 'writable';
387
410
 
388
411
  // `Object.defineProperty` method
389
412
  // https://tc39.es/ecma262/#sec-object.defineproperty
390
- var f$3 = descriptors ? $defineProperty : function defineProperty(O, P, Attributes) {
413
+ var f$4 = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) {
414
+ anObject(O);
415
+ P = toPropertyKey(P);
416
+ anObject(Attributes);
417
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
418
+ var current = $getOwnPropertyDescriptor(O, P);
419
+ if (current && current[WRITABLE]) {
420
+ O[P] = Attributes.value;
421
+ Attributes = {
422
+ configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
423
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
424
+ writable: false
425
+ };
426
+ }
427
+ } return $defineProperty(O, P, Attributes);
428
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
391
429
  anObject(O);
392
430
  P = toPropertyKey(P);
393
431
  anObject(Attributes);
394
432
  if (ie8DomDefine) try {
395
433
  return $defineProperty(O, P, Attributes);
396
434
  } catch (error) { /* empty */ }
397
- if ('get' in Attributes || 'set' in Attributes) throw TypeError$a('Accessors not supported');
435
+ if ('get' in Attributes || 'set' in Attributes) throw TypeError$c('Accessors not supported');
398
436
  if ('value' in Attributes) O[P] = Attributes.value;
399
437
  return O;
400
438
  };
401
439
 
402
440
  var objectDefineProperty = {
403
- f: f$3
441
+ f: f$4
404
442
  };
405
443
 
406
444
  var createNonEnumerableProperty = descriptors ? function (object, key, value) {
@@ -434,7 +472,7 @@ var sharedKey = function (key) {
434
472
  var hiddenKeys$1 = {};
435
473
 
436
474
  var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
437
- var TypeError$9 = global_1.TypeError;
475
+ var TypeError$b = global_1.TypeError;
438
476
  var WeakMap = global_1.WeakMap;
439
477
  var set$1, get, has;
440
478
 
@@ -446,7 +484,7 @@ var getterFor = function (TYPE) {
446
484
  return function (it) {
447
485
  var state;
448
486
  if (!isObject$1(it) || (state = get(it)).type !== TYPE) {
449
- throw TypeError$9('Incompatible receiver, ' + TYPE + ' required');
487
+ throw TypeError$b('Incompatible receiver, ' + TYPE + ' required');
450
488
  } return state;
451
489
  };
452
490
  };
@@ -457,7 +495,7 @@ if (nativeWeakMap || sharedStore.state) {
457
495
  var wmhas = functionUncurryThis(store.has);
458
496
  var wmset = functionUncurryThis(store.set);
459
497
  set$1 = function (it, metadata) {
460
- if (wmhas(store, it)) throw new TypeError$9(OBJECT_ALREADY_INITIALIZED);
498
+ if (wmhas(store, it)) throw new TypeError$b(OBJECT_ALREADY_INITIALIZED);
461
499
  metadata.facade = it;
462
500
  wmset(store, it, metadata);
463
501
  return metadata;
@@ -472,7 +510,7 @@ if (nativeWeakMap || sharedStore.state) {
472
510
  var STATE = sharedKey('state');
473
511
  hiddenKeys$1[STATE] = true;
474
512
  set$1 = function (it, metadata) {
475
- if (hasOwnProperty_1(it, STATE)) throw new TypeError$9(OBJECT_ALREADY_INITIALIZED);
513
+ if (hasOwnProperty_1(it, STATE)) throw new TypeError$b(OBJECT_ALREADY_INITIALIZED);
476
514
  metadata.facade = it;
477
515
  createNonEnumerableProperty(it, STATE, metadata);
478
516
  return metadata;
@@ -587,7 +625,7 @@ var lengthOfArrayLike = function (obj) {
587
625
  };
588
626
 
589
627
  // `Array.prototype.{ indexOf, includes }` methods implementation
590
- var createMethod$1 = function (IS_INCLUDES) {
628
+ var createMethod$2 = function (IS_INCLUDES) {
591
629
  return function ($this, el, fromIndex) {
592
630
  var O = toIndexedObject($this);
593
631
  var length = lengthOfArrayLike(O);
@@ -609,10 +647,10 @@ var createMethod$1 = function (IS_INCLUDES) {
609
647
  var arrayIncludes = {
610
648
  // `Array.prototype.includes` method
611
649
  // https://tc39.es/ecma262/#sec-array.prototype.includes
612
- includes: createMethod$1(true),
650
+ includes: createMethod$2(true),
613
651
  // `Array.prototype.indexOf` method
614
652
  // https://tc39.es/ecma262/#sec-array.prototype.indexof
615
- indexOf: createMethod$1(false)
653
+ indexOf: createMethod$2(false)
616
654
  };
617
655
 
618
656
  var indexOf$1 = arrayIncludes.indexOf;
@@ -649,19 +687,19 @@ var hiddenKeys = enumBugKeys.concat('length', 'prototype');
649
687
  // `Object.getOwnPropertyNames` method
650
688
  // https://tc39.es/ecma262/#sec-object.getownpropertynames
651
689
  // eslint-disable-next-line es/no-object-getownpropertynames -- safe
652
- var f$2 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
690
+ var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
653
691
  return objectKeysInternal(O, hiddenKeys);
654
692
  };
655
693
 
656
694
  var objectGetOwnPropertyNames = {
657
- f: f$2
695
+ f: f$3
658
696
  };
659
697
 
660
698
  // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
661
- var f$1 = Object.getOwnPropertySymbols;
699
+ var f$2 = Object.getOwnPropertySymbols;
662
700
 
663
701
  var objectGetOwnPropertySymbols = {
664
- f: f$1
702
+ f: f$2
665
703
  };
666
704
 
667
705
  var concat$1 = functionUncurryThis([].concat);
@@ -673,13 +711,15 @@ var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
673
711
  return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
674
712
  };
675
713
 
676
- var copyConstructorProperties = function (target, source) {
714
+ var copyConstructorProperties = function (target, source, exceptions) {
677
715
  var keys = ownKeys(source);
678
716
  var defineProperty = objectDefineProperty.f;
679
717
  var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
680
718
  for (var i = 0; i < keys.length; i++) {
681
719
  var key = keys[i];
682
- if (!hasOwnProperty_1(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
720
+ if (!hasOwnProperty_1(target, key) && !(exceptions && hasOwnProperty_1(exceptions, key))) {
721
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
722
+ }
683
723
  }
684
724
  };
685
725
 
@@ -761,8 +801,8 @@ var _export = function (options, source) {
761
801
  var arrayMethodIsStrict = function (METHOD_NAME, argument) {
762
802
  var method = [][METHOD_NAME];
763
803
  return !!method && fails(function () {
764
- // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
765
- method.call(null, argument || function () { throw 1; }, 1);
804
+ // eslint-disable-next-line no-useless-call -- required for testing
805
+ method.call(null, argument || function () { return 1; }, 1);
766
806
  });
767
807
  };
768
808
 
@@ -860,7 +900,7 @@ var constructorRegExp = /^\s*(?:class|function)\b/;
860
900
  var exec = functionUncurryThis(constructorRegExp.exec);
861
901
  var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
862
902
 
863
- var isConstructorModern = function (argument) {
903
+ var isConstructorModern = function isConstructor(argument) {
864
904
  if (!isCallable(argument)) return false;
865
905
  try {
866
906
  construct(noop, empty, argument);
@@ -870,16 +910,25 @@ var isConstructorModern = function (argument) {
870
910
  }
871
911
  };
872
912
 
873
- var isConstructorLegacy = function (argument) {
913
+ var isConstructorLegacy = function isConstructor(argument) {
874
914
  if (!isCallable(argument)) return false;
875
915
  switch (classof(argument)) {
876
916
  case 'AsyncFunction':
877
917
  case 'GeneratorFunction':
878
918
  case 'AsyncGeneratorFunction': return false;
919
+ }
920
+ try {
879
921
  // we can't check .prototype since constructors produced by .bind haven't it
880
- } return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
922
+ // `Function#toString` throws on some built-it function in some legacy engines
923
+ // (for example, `DOMQuad` and similar in FF41-)
924
+ return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
925
+ } catch (error) {
926
+ return true;
927
+ }
881
928
  };
882
929
 
930
+ isConstructorLegacy.sham = true;
931
+
883
932
  // `IsConstructor` abstract operation
884
933
  // https://tc39.es/ecma262/#sec-isconstructor
885
934
  var isConstructor = !construct || fails(function () {
@@ -890,7 +939,7 @@ var isConstructor = !construct || fails(function () {
890
939
  || called;
891
940
  }) ? isConstructorLegacy : isConstructorModern;
892
941
 
893
- var SPECIES$4 = wellKnownSymbol('species');
942
+ var SPECIES$5 = wellKnownSymbol('species');
894
943
  var Array$1 = global_1.Array;
895
944
 
896
945
  // a part of `ArraySpeciesCreate` abstract operation
@@ -902,7 +951,7 @@ var arraySpeciesConstructor = function (originalArray) {
902
951
  // cross-realm fallback
903
952
  if (isConstructor(C) && (C === Array$1 || isArray$1(C.prototype))) C = undefined;
904
953
  else if (isObject$1(C)) {
905
- C = C[SPECIES$4];
954
+ C = C[SPECIES$5];
906
955
  if (C === null) C = undefined;
907
956
  }
908
957
  } return C === undefined ? Array$1 : C;
@@ -914,7 +963,7 @@ var arraySpeciesCreate = function (originalArray, length) {
914
963
  return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
915
964
  };
916
965
 
917
- var SPECIES$3 = wellKnownSymbol('species');
966
+ var SPECIES$4 = wellKnownSymbol('species');
918
967
 
919
968
  var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
920
969
  // We can't use this feature detection in V8 since it causes
@@ -923,7 +972,7 @@ var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
923
972
  return engineV8Version >= 51 || !fails(function () {
924
973
  var array = [];
925
974
  var constructor = array.constructor = {};
926
- constructor[SPECIES$3] = function () {
975
+ constructor[SPECIES$4] = function () {
927
976
  return { foo: 1 };
928
977
  };
929
978
  return array[METHOD_NAME](Boolean).foo !== 1;
@@ -933,7 +982,7 @@ var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
933
982
  var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
934
983
  var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
935
984
  var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
936
- var TypeError$8 = global_1.TypeError;
985
+ var TypeError$a = global_1.TypeError;
937
986
 
938
987
  // We can't use this feature detection in V8 since it causes
939
988
  // deoptimization and serious performance degradation
@@ -968,10 +1017,10 @@ _export({ target: 'Array', proto: true, forced: FORCED$1 }, {
968
1017
  E = i === -1 ? O : arguments[i];
969
1018
  if (isConcatSpreadable(E)) {
970
1019
  len = lengthOfArrayLike(E);
971
- if (n + len > MAX_SAFE_INTEGER) throw TypeError$8(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
1020
+ if (n + len > MAX_SAFE_INTEGER) throw TypeError$a(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
972
1021
  for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
973
1022
  } else {
974
- if (n >= MAX_SAFE_INTEGER) throw TypeError$8(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
1023
+ if (n >= MAX_SAFE_INTEGER) throw TypeError$a(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
975
1024
  createProperty(A, n++, E);
976
1025
  }
977
1026
  }
@@ -983,7 +1032,7 @@ _export({ target: 'Array', proto: true, forced: FORCED$1 }, {
983
1032
  // `Object.defineProperties` method
984
1033
  // https://tc39.es/ecma262/#sec-object.defineproperties
985
1034
  // eslint-disable-next-line es/no-object-defineproperties -- safe
986
- var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
1035
+ var f$1 = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
987
1036
  anObject(O);
988
1037
  var props = toIndexedObject(Properties);
989
1038
  var keys = objectKeys(Properties);
@@ -994,6 +1043,10 @@ var objectDefineProperties = descriptors ? Object.defineProperties : function de
994
1043
  return O;
995
1044
  };
996
1045
 
1046
+ var objectDefineProperties = {
1047
+ f: f$1
1048
+ };
1049
+
997
1050
  var html = getBuiltIn('document', 'documentElement');
998
1051
 
999
1052
  /* global ActiveXObject -- old IE, WSH */
@@ -1076,7 +1129,7 @@ var objectCreate = Object.create || function create(O, Properties) {
1076
1129
  // add "__proto__" for Object.getPrototypeOf polyfill
1077
1130
  result[IE_PROTO] = O;
1078
1131
  } else result = NullProtoObject();
1079
- return Properties === undefined ? result : objectDefineProperties(result, Properties);
1132
+ return Properties === undefined ? result : objectDefineProperties.f(result, Properties);
1080
1133
  };
1081
1134
 
1082
1135
  var UNSCOPABLES = wellKnownSymbol('unscopables');
@@ -1140,7 +1193,13 @@ var UNSUPPORTED_Y$1 = fails(function () {
1140
1193
  return re.exec('abcd') != null;
1141
1194
  });
1142
1195
 
1143
- var BROKEN_CARET = fails(function () {
1196
+ // UC Browser bug
1197
+ // https://github.com/zloirock/core-js/issues/1008
1198
+ var MISSED_STICKY = UNSUPPORTED_Y$1 || fails(function () {
1199
+ return !$RegExp$2('a', 'y').sticky;
1200
+ });
1201
+
1202
+ var BROKEN_CARET = UNSUPPORTED_Y$1 || fails(function () {
1144
1203
  // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
1145
1204
  var re = $RegExp$2('^r', 'gy');
1146
1205
  re.lastIndex = 2;
@@ -1148,8 +1207,9 @@ var BROKEN_CARET = fails(function () {
1148
1207
  });
1149
1208
 
1150
1209
  var regexpStickyHelpers = {
1151
- UNSUPPORTED_Y: UNSUPPORTED_Y$1,
1152
- BROKEN_CARET: BROKEN_CARET
1210
+ BROKEN_CARET: BROKEN_CARET,
1211
+ MISSED_STICKY: MISSED_STICKY,
1212
+ UNSUPPORTED_Y: UNSUPPORTED_Y$1
1153
1213
  };
1154
1214
 
1155
1215
  // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
@@ -1185,10 +1245,10 @@ var getInternalState$1 = internalState.get;
1185
1245
  var nativeReplace = shared('native-string-replace', String.prototype.replace);
1186
1246
  var nativeExec = RegExp.prototype.exec;
1187
1247
  var patchedExec = nativeExec;
1188
- var charAt = functionUncurryThis(''.charAt);
1248
+ var charAt$2 = functionUncurryThis(''.charAt);
1189
1249
  var indexOf = functionUncurryThis(''.indexOf);
1190
1250
  var replace = functionUncurryThis(''.replace);
1191
- var stringSlice$1 = functionUncurryThis(''.slice);
1251
+ var stringSlice$2 = functionUncurryThis(''.slice);
1192
1252
 
1193
1253
  var UPDATES_LAST_INDEX_WRONG = (function () {
1194
1254
  var re1 = /a/;
@@ -1198,7 +1258,7 @@ var UPDATES_LAST_INDEX_WRONG = (function () {
1198
1258
  return re1.lastIndex !== 0 || re2.lastIndex !== 0;
1199
1259
  })();
1200
1260
 
1201
- var UNSUPPORTED_Y = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET;
1261
+ var UNSUPPORTED_Y = regexpStickyHelpers.BROKEN_CARET;
1202
1262
 
1203
1263
  // nonparticipating capturing group, copied from es5-shim's String#split patch.
1204
1264
  var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
@@ -1206,7 +1266,6 @@ var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
1206
1266
  var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || regexpUnsupportedDotAll || regexpUnsupportedNcg;
1207
1267
 
1208
1268
  if (PATCH) {
1209
- // eslint-disable-next-line max-statements -- TODO
1210
1269
  patchedExec = function exec(string) {
1211
1270
  var re = this;
1212
1271
  var state = getInternalState$1(re);
@@ -1234,9 +1293,9 @@ if (PATCH) {
1234
1293
  flags += 'g';
1235
1294
  }
1236
1295
 
1237
- strCopy = stringSlice$1(str, re.lastIndex);
1296
+ strCopy = stringSlice$2(str, re.lastIndex);
1238
1297
  // Support anchored sticky behavior.
1239
- if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt(str, re.lastIndex - 1) !== '\n')) {
1298
+ if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$2(str, re.lastIndex - 1) !== '\n')) {
1240
1299
  source = '(?: ' + source + ')';
1241
1300
  strCopy = ' ' + strCopy;
1242
1301
  charsAdded++;
@@ -1255,8 +1314,8 @@ if (PATCH) {
1255
1314
 
1256
1315
  if (sticky) {
1257
1316
  if (match) {
1258
- match.input = stringSlice$1(match.input, charsAdded);
1259
- match[0] = stringSlice$1(match[0], charsAdded);
1317
+ match.input = stringSlice$2(match.input, charsAdded);
1318
+ match[0] = stringSlice$2(match[0], charsAdded);
1260
1319
  match.index = re.lastIndex;
1261
1320
  re.lastIndex += match[0].length;
1262
1321
  } else re.lastIndex = 0;
@@ -1293,6 +1352,172 @@ _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
1293
1352
  exec: regexpExec
1294
1353
  });
1295
1354
 
1355
+ // TODO: Remove from `core-js@4` since it's moved to entry points
1356
+
1357
+
1358
+
1359
+
1360
+
1361
+
1362
+
1363
+
1364
+ var SPECIES$3 = wellKnownSymbol('species');
1365
+ var RegExpPrototype = RegExp.prototype;
1366
+
1367
+ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
1368
+ var SYMBOL = wellKnownSymbol(KEY);
1369
+
1370
+ var DELEGATES_TO_SYMBOL = !fails(function () {
1371
+ // String methods call symbol-named RegEp methods
1372
+ var O = {};
1373
+ O[SYMBOL] = function () { return 7; };
1374
+ return ''[KEY](O) != 7;
1375
+ });
1376
+
1377
+ var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
1378
+ // Symbol-named RegExp methods call .exec
1379
+ var execCalled = false;
1380
+ var re = /a/;
1381
+
1382
+ if (KEY === 'split') {
1383
+ // We can't use real regex here since it causes deoptimization
1384
+ // and serious performance degradation in V8
1385
+ // https://github.com/zloirock/core-js/issues/306
1386
+ re = {};
1387
+ // RegExp[@@split] doesn't call the regex's exec method, but first creates
1388
+ // a new one. We need to return the patched regex when creating the new one.
1389
+ re.constructor = {};
1390
+ re.constructor[SPECIES$3] = function () { return re; };
1391
+ re.flags = '';
1392
+ re[SYMBOL] = /./[SYMBOL];
1393
+ }
1394
+
1395
+ re.exec = function () { execCalled = true; return null; };
1396
+
1397
+ re[SYMBOL]('');
1398
+ return !execCalled;
1399
+ });
1400
+
1401
+ if (
1402
+ !DELEGATES_TO_SYMBOL ||
1403
+ !DELEGATES_TO_EXEC ||
1404
+ FORCED
1405
+ ) {
1406
+ var uncurriedNativeRegExpMethod = functionUncurryThis(/./[SYMBOL]);
1407
+ var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
1408
+ var uncurriedNativeMethod = functionUncurryThis(nativeMethod);
1409
+ var $exec = regexp.exec;
1410
+ if ($exec === regexpExec || $exec === RegExpPrototype.exec) {
1411
+ if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
1412
+ // The native String method already delegates to @@method (this
1413
+ // polyfilled function), leasing to infinite recursion.
1414
+ // We avoid it by directly calling the native @@method method.
1415
+ return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
1416
+ }
1417
+ return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
1418
+ }
1419
+ return { done: false };
1420
+ });
1421
+
1422
+ redefine(String.prototype, KEY, methods[0]);
1423
+ redefine(RegExpPrototype, SYMBOL, methods[1]);
1424
+ }
1425
+
1426
+ if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
1427
+ };
1428
+
1429
+ var charAt$1 = functionUncurryThis(''.charAt);
1430
+ var charCodeAt = functionUncurryThis(''.charCodeAt);
1431
+ var stringSlice$1 = functionUncurryThis(''.slice);
1432
+
1433
+ var createMethod$1 = function (CONVERT_TO_STRING) {
1434
+ return function ($this, pos) {
1435
+ var S = toString_1(requireObjectCoercible($this));
1436
+ var position = toIntegerOrInfinity(pos);
1437
+ var size = S.length;
1438
+ var first, second;
1439
+ if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
1440
+ first = charCodeAt(S, position);
1441
+ return first < 0xD800 || first > 0xDBFF || position + 1 === size
1442
+ || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
1443
+ ? CONVERT_TO_STRING
1444
+ ? charAt$1(S, position)
1445
+ : first
1446
+ : CONVERT_TO_STRING
1447
+ ? stringSlice$1(S, position, position + 2)
1448
+ : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
1449
+ };
1450
+ };
1451
+
1452
+ var stringMultibyte = {
1453
+ // `String.prototype.codePointAt` method
1454
+ // https://tc39.es/ecma262/#sec-string.prototype.codepointat
1455
+ codeAt: createMethod$1(false),
1456
+ // `String.prototype.at` method
1457
+ // https://github.com/mathiasbynens/String.prototype.at
1458
+ charAt: createMethod$1(true)
1459
+ };
1460
+
1461
+ var charAt = stringMultibyte.charAt;
1462
+
1463
+ // `AdvanceStringIndex` abstract operation
1464
+ // https://tc39.es/ecma262/#sec-advancestringindex
1465
+ var advanceStringIndex = function (S, index, unicode) {
1466
+ return index + (unicode ? charAt(S, index).length : 1);
1467
+ };
1468
+
1469
+ var TypeError$9 = global_1.TypeError;
1470
+
1471
+ // `RegExpExec` abstract operation
1472
+ // https://tc39.es/ecma262/#sec-regexpexec
1473
+ var regexpExecAbstract = function (R, S) {
1474
+ var exec = R.exec;
1475
+ if (isCallable(exec)) {
1476
+ var result = functionCall(exec, R, S);
1477
+ if (result !== null) anObject(result);
1478
+ return result;
1479
+ }
1480
+ if (classofRaw(R) === 'RegExp') return functionCall(regexpExec, R, S);
1481
+ throw TypeError$9('RegExp#exec called on incompatible receiver');
1482
+ };
1483
+
1484
+ // @@match logic
1485
+ fixRegexpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {
1486
+ return [
1487
+ // `String.prototype.match` method
1488
+ // https://tc39.es/ecma262/#sec-string.prototype.match
1489
+ function match(regexp) {
1490
+ var O = requireObjectCoercible(this);
1491
+ var matcher = regexp == undefined ? undefined : getMethod(regexp, MATCH);
1492
+ return matcher ? functionCall(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString_1(O));
1493
+ },
1494
+ // `RegExp.prototype[@@match]` method
1495
+ // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
1496
+ function (string) {
1497
+ var rx = anObject(this);
1498
+ var S = toString_1(string);
1499
+ var res = maybeCallNative(nativeMatch, rx, S);
1500
+
1501
+ if (res.done) return res.value;
1502
+
1503
+ if (!rx.global) return regexpExecAbstract(rx, S);
1504
+
1505
+ var fullUnicode = rx.unicode;
1506
+ rx.lastIndex = 0;
1507
+ var A = [];
1508
+ var n = 0;
1509
+ var result;
1510
+ while ((result = regexpExecAbstract(rx, S)) !== null) {
1511
+ var matchStr = toString_1(result[0]);
1512
+ A[n] = matchStr;
1513
+ if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
1514
+ n++;
1515
+ }
1516
+ return n === 0 ? null : A;
1517
+ }
1518
+ ];
1519
+ });
1520
+
1296
1521
  var MATCH$1 = wellKnownSymbol('match');
1297
1522
 
1298
1523
  // `IsRegExp` abstract operation
@@ -1302,11 +1527,11 @@ var isRegexp = function (it) {
1302
1527
  return isObject$1(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
1303
1528
  };
1304
1529
 
1305
- var TypeError$7 = global_1.TypeError;
1530
+ var TypeError$8 = global_1.TypeError;
1306
1531
 
1307
1532
  var notARegexp = function (it) {
1308
1533
  if (isRegexp(it)) {
1309
- throw TypeError$7("The method doesn't accept regular expressions");
1534
+ throw TypeError$8("The method doesn't accept regular expressions");
1310
1535
  } return it;
1311
1536
  };
1312
1537
 
@@ -1402,11 +1627,11 @@ var redefineAll = function (target, src, options) {
1402
1627
  };
1403
1628
 
1404
1629
  var String$2 = global_1.String;
1405
- var TypeError$6 = global_1.TypeError;
1630
+ var TypeError$7 = global_1.TypeError;
1406
1631
 
1407
1632
  var aPossiblePrototype = function (argument) {
1408
1633
  if (typeof argument == 'object' || isCallable(argument)) return argument;
1409
- throw TypeError$6("Can't set " + String$2(argument) + ' as a prototype');
1634
+ throw TypeError$7("Can't set " + String$2(argument) + ' as a prototype');
1410
1635
  };
1411
1636
 
1412
1637
  /* eslint-disable no-proto -- safe */
@@ -1443,9 +1668,10 @@ var defineProperty$2 = objectDefineProperty.f;
1443
1668
 
1444
1669
  var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1445
1670
 
1446
- var setToStringTag = function (it, TAG, STATIC) {
1447
- if (it && !hasOwnProperty_1(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
1448
- defineProperty$2(it, TO_STRING_TAG, { configurable: true, value: TAG });
1671
+ var setToStringTag = function (target, TAG, STATIC) {
1672
+ if (target && !STATIC) target = target.prototype;
1673
+ if (target && !hasOwnProperty_1(target, TO_STRING_TAG)) {
1674
+ defineProperty$2(target, TO_STRING_TAG, { configurable: true, value: TAG });
1449
1675
  }
1450
1676
  };
1451
1677
 
@@ -1463,19 +1689,19 @@ var setSpecies = function (CONSTRUCTOR_NAME) {
1463
1689
  }
1464
1690
  };
1465
1691
 
1466
- var TypeError$5 = global_1.TypeError;
1692
+ var TypeError$6 = global_1.TypeError;
1467
1693
 
1468
1694
  var anInstance = function (it, Prototype) {
1469
1695
  if (objectIsPrototypeOf(Prototype, it)) return it;
1470
- throw TypeError$5('Incorrect invocation');
1696
+ throw TypeError$6('Incorrect invocation');
1471
1697
  };
1472
1698
 
1473
- var bind$3 = functionUncurryThis(functionUncurryThis.bind);
1699
+ var bind$2 = functionUncurryThis(functionUncurryThis.bind);
1474
1700
 
1475
1701
  // optional / simple context binding
1476
1702
  var functionBindContext = function (fn, that) {
1477
1703
  aCallable(fn);
1478
- return that === undefined ? fn : bind$3 ? bind$3(fn, that) : function (/* ...args */) {
1704
+ return that === undefined ? fn : functionBindNative ? bind$2(fn, that) : function (/* ...args */) {
1479
1705
  return fn.apply(that, arguments);
1480
1706
  };
1481
1707
  };
@@ -1498,12 +1724,12 @@ var getIteratorMethod = function (it) {
1498
1724
  || iterators[classof(it)];
1499
1725
  };
1500
1726
 
1501
- var TypeError$4 = global_1.TypeError;
1727
+ var TypeError$5 = global_1.TypeError;
1502
1728
 
1503
1729
  var getIterator = function (argument, usingIterator) {
1504
1730
  var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
1505
1731
  if (aCallable(iteratorMethod)) return anObject(functionCall(iteratorMethod, argument));
1506
- throw TypeError$4(tryToString(argument) + ' is not iterable');
1732
+ throw TypeError$5(tryToString(argument) + ' is not iterable');
1507
1733
  };
1508
1734
 
1509
1735
  var iteratorClose = function (iterator, kind, value) {
@@ -1526,7 +1752,7 @@ var iteratorClose = function (iterator, kind, value) {
1526
1752
  return value;
1527
1753
  };
1528
1754
 
1529
- var TypeError$3 = global_1.TypeError;
1755
+ var TypeError$4 = global_1.TypeError;
1530
1756
 
1531
1757
  var Result = function (stopped, result) {
1532
1758
  this.stopped = stopped;
@@ -1559,7 +1785,7 @@ var iterate = function (iterable, unboundFunction, options) {
1559
1785
  iterator = iterable;
1560
1786
  } else {
1561
1787
  iterFn = getIteratorMethod(iterable);
1562
- if (!iterFn) throw TypeError$3(tryToString(iterable) + ' is not iterable');
1788
+ if (!iterFn) throw TypeError$4(tryToString(iterable) + ' is not iterable');
1563
1789
  // optimisation for array iterators
1564
1790
  if (isArrayIteratorMethod(iterFn)) {
1565
1791
  for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
@@ -1618,12 +1844,12 @@ var checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) {
1618
1844
  return ITERATION_SUPPORT;
1619
1845
  };
1620
1846
 
1621
- var TypeError$2 = global_1.TypeError;
1847
+ var TypeError$3 = global_1.TypeError;
1622
1848
 
1623
1849
  // `Assert: IsConstructor(argument) is true`
1624
1850
  var aConstructor = function (argument) {
1625
1851
  if (isConstructor(argument)) return argument;
1626
- throw TypeError$2(tryToString(argument) + ' is not a constructor');
1852
+ throw TypeError$3(tryToString(argument) + ' is not a constructor');
1627
1853
  };
1628
1854
 
1629
1855
  var SPECIES$1 = wellKnownSymbol('species');
@@ -1638,16 +1864,22 @@ var speciesConstructor = function (O, defaultConstructor) {
1638
1864
 
1639
1865
  var FunctionPrototype$1 = Function.prototype;
1640
1866
  var apply = FunctionPrototype$1.apply;
1641
- var bind$2 = FunctionPrototype$1.bind;
1642
1867
  var call = FunctionPrototype$1.call;
1643
1868
 
1644
1869
  // eslint-disable-next-line es/no-reflect -- safe
1645
- var functionApply = typeof Reflect == 'object' && Reflect.apply || (bind$2 ? call.bind(apply) : function () {
1870
+ var functionApply = typeof Reflect == 'object' && Reflect.apply || (functionBindNative ? call.bind(apply) : function () {
1646
1871
  return call.apply(apply, arguments);
1647
1872
  });
1648
1873
 
1649
1874
  var arraySlice = functionUncurryThis([].slice);
1650
1875
 
1876
+ var TypeError$2 = global_1.TypeError;
1877
+
1878
+ var validateArgumentsLength = function (passed, required) {
1879
+ if (passed < required) throw TypeError$2('Not enough arguments');
1880
+ return passed;
1881
+ };
1882
+
1651
1883
  var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(engineUserAgent);
1652
1884
 
1653
1885
  var engineIsNode = classofRaw(global_1.process) == 'process';
@@ -1660,7 +1892,7 @@ var Function$1 = global_1.Function;
1660
1892
  var MessageChannel = global_1.MessageChannel;
1661
1893
  var String$1 = global_1.String;
1662
1894
  var counter = 0;
1663
- var queue = {};
1895
+ var queue$1 = {};
1664
1896
  var ONREADYSTATECHANGE = 'onreadystatechange';
1665
1897
  var location, defer, channel, port;
1666
1898
 
@@ -1670,9 +1902,9 @@ try {
1670
1902
  } catch (error) { /* empty */ }
1671
1903
 
1672
1904
  var run = function (id) {
1673
- if (hasOwnProperty_1(queue, id)) {
1674
- var fn = queue[id];
1675
- delete queue[id];
1905
+ if (hasOwnProperty_1(queue$1, id)) {
1906
+ var fn = queue$1[id];
1907
+ delete queue$1[id];
1676
1908
  fn();
1677
1909
  }
1678
1910
  };
@@ -1694,16 +1926,18 @@ var post = function (id) {
1694
1926
 
1695
1927
  // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
1696
1928
  if (!set || !clear) {
1697
- set = function setImmediate(fn) {
1929
+ set = function setImmediate(handler) {
1930
+ validateArgumentsLength(arguments.length, 1);
1931
+ var fn = isCallable(handler) ? handler : Function$1(handler);
1698
1932
  var args = arraySlice(arguments, 1);
1699
- queue[++counter] = function () {
1700
- functionApply(isCallable(fn) ? fn : Function$1(fn), undefined, args);
1933
+ queue$1[++counter] = function () {
1934
+ functionApply(fn, undefined, args);
1701
1935
  };
1702
1936
  defer(counter);
1703
1937
  return counter;
1704
1938
  };
1705
1939
  clear = function clearImmediate(id) {
1706
- delete queue[id];
1940
+ delete queue$1[id];
1707
1941
  };
1708
1942
  // Node.js 0.8-
1709
1943
  if (engineIsNode) {
@@ -1887,6 +2121,30 @@ var perform = function (exec) {
1887
2121
  }
1888
2122
  };
1889
2123
 
2124
+ var Queue = function () {
2125
+ this.head = null;
2126
+ this.tail = null;
2127
+ };
2128
+
2129
+ Queue.prototype = {
2130
+ add: function (item) {
2131
+ var entry = { item: item, next: null };
2132
+ if (this.head) this.tail.next = entry;
2133
+ else this.head = entry;
2134
+ this.tail = entry;
2135
+ },
2136
+ get: function () {
2137
+ var entry = this.head;
2138
+ if (entry) {
2139
+ this.head = entry.next;
2140
+ if (this.tail === entry) this.tail = null;
2141
+ return entry.item;
2142
+ }
2143
+ }
2144
+ };
2145
+
2146
+ var queue = Queue;
2147
+
1890
2148
  var engineIsBrowser = typeof window == 'object';
1891
2149
 
1892
2150
  var task = task$1.set;
@@ -1902,10 +2160,11 @@ var task = task$1.set;
1902
2160
 
1903
2161
 
1904
2162
 
2163
+
1905
2164
  var SPECIES = wellKnownSymbol('species');
1906
2165
  var PROMISE = 'Promise';
1907
2166
 
1908
- var getInternalState = internalState.get;
2167
+ var getInternalState = internalState.getterFor(PROMISE);
1909
2168
  var setInternalState = internalState.set;
1910
2169
  var getInternalPromiseState = internalState.getterFor(PROMISE);
1911
2170
  var NativePromisePrototype = nativePromiseConstructor && nativePromiseConstructor.prototype;
@@ -1964,49 +2223,50 @@ var isThenable = function (it) {
1964
2223
  return isObject$1(it) && isCallable(then = it.then) ? then : false;
1965
2224
  };
1966
2225
 
2226
+ var callReaction = function (reaction, state) {
2227
+ var value = state.value;
2228
+ var ok = state.state == FULFILLED;
2229
+ var handler = ok ? reaction.ok : reaction.fail;
2230
+ var resolve = reaction.resolve;
2231
+ var reject = reaction.reject;
2232
+ var domain = reaction.domain;
2233
+ var result, then, exited;
2234
+ try {
2235
+ if (handler) {
2236
+ if (!ok) {
2237
+ if (state.rejection === UNHANDLED) onHandleUnhandled(state);
2238
+ state.rejection = HANDLED;
2239
+ }
2240
+ if (handler === true) result = value;
2241
+ else {
2242
+ if (domain) domain.enter();
2243
+ result = handler(value); // can throw
2244
+ if (domain) {
2245
+ domain.exit();
2246
+ exited = true;
2247
+ }
2248
+ }
2249
+ if (result === reaction.promise) {
2250
+ reject(TypeError$1('Promise-chain cycle'));
2251
+ } else if (then = isThenable(result)) {
2252
+ functionCall(then, result, resolve, reject);
2253
+ } else resolve(result);
2254
+ } else reject(value);
2255
+ } catch (error) {
2256
+ if (domain && !exited) domain.exit();
2257
+ reject(error);
2258
+ }
2259
+ };
2260
+
1967
2261
  var notify = function (state, isReject) {
1968
2262
  if (state.notified) return;
1969
2263
  state.notified = true;
1970
- var chain = state.reactions;
1971
2264
  microtask(function () {
1972
- var value = state.value;
1973
- var ok = state.state == FULFILLED;
1974
- var index = 0;
1975
- // variable length - can't use forEach
1976
- while (chain.length > index) {
1977
- var reaction = chain[index++];
1978
- var handler = ok ? reaction.ok : reaction.fail;
1979
- var resolve = reaction.resolve;
1980
- var reject = reaction.reject;
1981
- var domain = reaction.domain;
1982
- var result, then, exited;
1983
- try {
1984
- if (handler) {
1985
- if (!ok) {
1986
- if (state.rejection === UNHANDLED) onHandleUnhandled(state);
1987
- state.rejection = HANDLED;
1988
- }
1989
- if (handler === true) result = value;
1990
- else {
1991
- if (domain) domain.enter();
1992
- result = handler(value); // can throw
1993
- if (domain) {
1994
- domain.exit();
1995
- exited = true;
1996
- }
1997
- }
1998
- if (result === reaction.promise) {
1999
- reject(TypeError$1('Promise-chain cycle'));
2000
- } else if (then = isThenable(result)) {
2001
- functionCall(then, result, resolve, reject);
2002
- } else resolve(result);
2003
- } else reject(value);
2004
- } catch (error) {
2005
- if (domain && !exited) domain.exit();
2006
- reject(error);
2007
- }
2265
+ var reactions = state.reactions;
2266
+ var reaction;
2267
+ while (reaction = reactions.get()) {
2268
+ callReaction(reaction, state);
2008
2269
  }
2009
- state.reactions = [];
2010
2270
  state.notified = false;
2011
2271
  if (isReject && !state.rejection) onUnhandled(state);
2012
2272
  });
@@ -2123,7 +2383,7 @@ if (FORCED) {
2123
2383
  done: false,
2124
2384
  notified: false,
2125
2385
  parent: false,
2126
- reactions: [],
2386
+ reactions: new queue(),
2127
2387
  rejection: false,
2128
2388
  state: PENDING,
2129
2389
  value: undefined
@@ -2132,16 +2392,18 @@ if (FORCED) {
2132
2392
  Internal.prototype = redefineAll(PromisePrototype, {
2133
2393
  // `Promise.prototype.then` method
2134
2394
  // https://tc39.es/ecma262/#sec-promise.prototype.then
2395
+ // eslint-disable-next-line unicorn/no-thenable -- safe
2135
2396
  then: function then(onFulfilled, onRejected) {
2136
2397
  var state = getInternalPromiseState(this);
2137
- var reactions = state.reactions;
2138
2398
  var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
2399
+ state.parent = true;
2139
2400
  reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
2140
2401
  reaction.fail = isCallable(onRejected) && onRejected;
2141
2402
  reaction.domain = engineIsNode ? process$1.domain : undefined;
2142
- state.parent = true;
2143
- reactions[reactions.length] = reaction;
2144
- if (state.state != PENDING) notify(state, false);
2403
+ if (state.state == PENDING) state.reactions.add(reaction);
2404
+ else microtask(function () {
2405
+ callReaction(reaction, state);
2406
+ });
2145
2407
  return reaction.promise;
2146
2408
  },
2147
2409
  // `Promise.prototype.catch` method
@@ -2326,7 +2588,7 @@ var defineProperty = objectDefineProperty.f;
2326
2588
 
2327
2589
  var FunctionPrototype = Function.prototype;
2328
2590
  var functionToString = functionUncurryThis(FunctionPrototype.toString);
2329
- var nameRE = /^\s*function ([^ (]*)/;
2591
+ var nameRE = /function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/;
2330
2592
  var regExpExec = functionUncurryThis(nameRE.exec);
2331
2593
  var NAME = 'name';
2332
2594
 
@@ -3942,6 +4204,7 @@ axios_1.default = default_1;
3942
4204
 
3943
4205
  var axios = axios_1;
3944
4206
 
4207
+ var defaultAcceptVersionHeader = 'v4.0';
3945
4208
  var supportedVersions = ['v2', 'v3', 'v4', 'v5', 'canary'];
3946
4209
  var name = '@tryghost/content-api';
3947
4210
 
@@ -3967,7 +4230,7 @@ var defaultMakeRequest = function defaultMakeRequest(_ref) {
3967
4230
  * @param {String} options.url
3968
4231
  * @param {String} options.key
3969
4232
  * @param {String} [options.ghostPath]
3970
- * @param {String} [options.version]
4233
+ * @param {String|Boolean} options.version - a version string like v3, v4, v5 or boolean value identifying presence of Accept-Version header
3971
4234
  * @param {Function} [options.makeRequest]
3972
4235
  * @param {String} [options.host] Deprecated
3973
4236
  */
@@ -4006,8 +4269,32 @@ function GhostContentAPI(_ref2) {
4006
4269
  });
4007
4270
  }
4008
4271
 
4009
- if (version && !supportedVersions.includes(version)) {
4272
+ if (version === undefined) {
4273
+ throw new Error("".concat(name, " Config Missing: 'version' is required. E.g. ").concat(supportedVersions.join(',')));
4274
+ }
4275
+
4276
+ var acceptVersionHeader;
4277
+
4278
+ if (typeof version === 'boolean') {
4279
+ if (version === true) {
4280
+ acceptVersionHeader = defaultAcceptVersionHeader;
4281
+ }
4282
+
4283
+ version = undefined;
4284
+ } else if (version && !supportedVersions.includes(version) && !version.match(/^v\d+\.\d+/)) {
4010
4285
  throw new Error("".concat(name, " Config Invalid: 'version' ").concat(version, " is not supported"));
4286
+ } else {
4287
+ if (version === 'canary') {
4288
+ // eslint-disable-next-line
4289
+ console.warn("".concat(name, ": The 'version' parameter has a deprecated format 'canary', please use 'v{major}.{minor}' format instead"));
4290
+ acceptVersionHeader = defaultAcceptVersionHeader;
4291
+ } else if (version.match(/^v\d+$/)) {
4292
+ // eslint-disable-next-line
4293
+ console.warn("".concat(name, ": The 'version' parameter has a deprecated format 'v{major}', please use 'v{major}.{minor}' format instead"));
4294
+ acceptVersionHeader = "".concat(version, ".0");
4295
+ } else {
4296
+ acceptVersionHeader = version;
4297
+ }
4011
4298
  }
4012
4299
 
4013
4300
  if (!url) {
@@ -4069,8 +4356,8 @@ function GhostContentAPI(_ref2) {
4069
4356
  Authorization: "GhostMembers ".concat(membersToken)
4070
4357
  } : {};
4071
4358
 
4072
- if (!version || ['v4', 'v5', 'canary'].includes(version)) {
4073
- headers['Accept-Version'] = version || 'v5';
4359
+ if (acceptVersionHeader) {
4360
+ headers['Accept-Version'] = acceptVersionHeader;
4074
4361
  }
4075
4362
 
4076
4363
  params = Object.assign({