browser.js 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141
  1. (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
  2. 'use strict';
  3. var keys = require('object-keys').shim();
  4. delete keys.shim;
  5. var assign = require('./');
  6. module.exports = assign.shim();
  7. delete assign.shim;
  8. },{"./":3,"object-keys":18}],2:[function(require,module,exports){
  9. 'use strict';
  10. // modified from https://github.com/es-shims/es6-shim
  11. var objectKeys = require('object-keys');
  12. var hasSymbols = require('has-symbols/shams')();
  13. var callBound = require('call-bind/callBound');
  14. var toObject = Object;
  15. var $push = callBound('Array.prototype.push');
  16. var $propIsEnumerable = callBound('Object.prototype.propertyIsEnumerable');
  17. var originalGetSymbols = hasSymbols ? Object.getOwnPropertySymbols : null;
  18. // eslint-disable-next-line no-unused-vars
  19. module.exports = function assign(target, source1) {
  20. if (target == null) { throw new TypeError('target must be an object'); }
  21. var to = toObject(target); // step 1
  22. if (arguments.length === 1) {
  23. return to; // step 2
  24. }
  25. for (var s = 1; s < arguments.length; ++s) {
  26. var from = toObject(arguments[s]); // step 3.a.i
  27. // step 3.a.ii:
  28. var keys = objectKeys(from);
  29. var getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols);
  30. if (getSymbols) {
  31. var syms = getSymbols(from);
  32. for (var j = 0; j < syms.length; ++j) {
  33. var key = syms[j];
  34. if ($propIsEnumerable(from, key)) {
  35. $push(keys, key);
  36. }
  37. }
  38. }
  39. // step 3.a.iii:
  40. for (var i = 0; i < keys.length; ++i) {
  41. var nextKey = keys[i];
  42. if ($propIsEnumerable(from, nextKey)) { // step 3.a.iii.2
  43. var propValue = from[nextKey]; // step 3.a.iii.2.a
  44. to[nextKey] = propValue; // step 3.a.iii.2.b
  45. }
  46. }
  47. }
  48. return to; // step 4
  49. };
  50. },{"call-bind/callBound":4,"has-symbols/shams":15,"object-keys":18}],3:[function(require,module,exports){
  51. 'use strict';
  52. var defineProperties = require('define-properties');
  53. var callBind = require('call-bind');
  54. var implementation = require('./implementation');
  55. var getPolyfill = require('./polyfill');
  56. var shim = require('./shim');
  57. var polyfill = callBind.apply(getPolyfill());
  58. // eslint-disable-next-line no-unused-vars
  59. var bound = function assign(target, source1) {
  60. return polyfill(Object, arguments);
  61. };
  62. defineProperties(bound, {
  63. getPolyfill: getPolyfill,
  64. implementation: implementation,
  65. shim: shim
  66. });
  67. module.exports = bound;
  68. },{"./implementation":2,"./polyfill":21,"./shim":22,"call-bind":5,"define-properties":7}],4:[function(require,module,exports){
  69. 'use strict';
  70. var GetIntrinsic = require('get-intrinsic');
  71. var callBind = require('./');
  72. var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
  73. module.exports = function callBoundIntrinsic(name, allowMissing) {
  74. var intrinsic = GetIntrinsic(name, !!allowMissing);
  75. if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
  76. return callBind(intrinsic);
  77. }
  78. return intrinsic;
  79. };
  80. },{"./":5,"get-intrinsic":10}],5:[function(require,module,exports){
  81. 'use strict';
  82. var bind = require('function-bind');
  83. var GetIntrinsic = require('get-intrinsic');
  84. var setFunctionLength = require('set-function-length');
  85. var $TypeError = GetIntrinsic('%TypeError%');
  86. var $apply = GetIntrinsic('%Function.prototype.apply%');
  87. var $call = GetIntrinsic('%Function.prototype.call%');
  88. var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
  89. var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
  90. var $max = GetIntrinsic('%Math.max%');
  91. if ($defineProperty) {
  92. try {
  93. $defineProperty({}, 'a', { value: 1 });
  94. } catch (e) {
  95. // IE 8 has a broken defineProperty
  96. $defineProperty = null;
  97. }
  98. }
  99. module.exports = function callBind(originalFunction) {
  100. if (typeof originalFunction !== 'function') {
  101. throw new $TypeError('a function is required');
  102. }
  103. var func = $reflectApply(bind, $call, arguments);
  104. return setFunctionLength(
  105. func,
  106. 1 + $max(0, originalFunction.length - (arguments.length - 1)),
  107. true
  108. );
  109. };
  110. var applyBind = function applyBind() {
  111. return $reflectApply(bind, $apply, arguments);
  112. };
  113. if ($defineProperty) {
  114. $defineProperty(module.exports, 'apply', { value: applyBind });
  115. } else {
  116. module.exports.apply = applyBind;
  117. }
  118. },{"function-bind":9,"get-intrinsic":10,"set-function-length":20}],6:[function(require,module,exports){
  119. 'use strict';
  120. var hasPropertyDescriptors = require('has-property-descriptors')();
  121. var GetIntrinsic = require('get-intrinsic');
  122. var $defineProperty = hasPropertyDescriptors && GetIntrinsic('%Object.defineProperty%', true);
  123. if ($defineProperty) {
  124. try {
  125. $defineProperty({}, 'a', { value: 1 });
  126. } catch (e) {
  127. // IE 8 has a broken defineProperty
  128. $defineProperty = false;
  129. }
  130. }
  131. var $SyntaxError = GetIntrinsic('%SyntaxError%');
  132. var $TypeError = GetIntrinsic('%TypeError%');
  133. var gopd = require('gopd');
  134. /** @type {(obj: Record<PropertyKey, unknown>, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */
  135. module.exports = function defineDataProperty(
  136. obj,
  137. property,
  138. value
  139. ) {
  140. if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
  141. throw new $TypeError('`obj` must be an object or a function`');
  142. }
  143. if (typeof property !== 'string' && typeof property !== 'symbol') {
  144. throw new $TypeError('`property` must be a string or a symbol`');
  145. }
  146. if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {
  147. throw new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');
  148. }
  149. if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {
  150. throw new $TypeError('`nonWritable`, if provided, must be a boolean or null');
  151. }
  152. if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {
  153. throw new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');
  154. }
  155. if (arguments.length > 6 && typeof arguments[6] !== 'boolean') {
  156. throw new $TypeError('`loose`, if provided, must be a boolean');
  157. }
  158. var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
  159. var nonWritable = arguments.length > 4 ? arguments[4] : null;
  160. var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
  161. var loose = arguments.length > 6 ? arguments[6] : false;
  162. /* @type {false | TypedPropertyDescriptor<unknown>} */
  163. var desc = !!gopd && gopd(obj, property);
  164. if ($defineProperty) {
  165. $defineProperty(obj, property, {
  166. configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
  167. enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
  168. value: value,
  169. writable: nonWritable === null && desc ? desc.writable : !nonWritable
  170. });
  171. } else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {
  172. // must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable
  173. obj[property] = value; // eslint-disable-line no-param-reassign
  174. } else {
  175. throw new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');
  176. }
  177. };
  178. },{"get-intrinsic":10,"gopd":11,"has-property-descriptors":12}],7:[function(require,module,exports){
  179. 'use strict';
  180. var keys = require('object-keys');
  181. var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
  182. var toStr = Object.prototype.toString;
  183. var concat = Array.prototype.concat;
  184. var defineDataProperty = require('define-data-property');
  185. var isFunction = function (fn) {
  186. return typeof fn === 'function' && toStr.call(fn) === '[object Function]';
  187. };
  188. var supportsDescriptors = require('has-property-descriptors')();
  189. var defineProperty = function (object, name, value, predicate) {
  190. if (name in object) {
  191. if (predicate === true) {
  192. if (object[name] === value) {
  193. return;
  194. }
  195. } else if (!isFunction(predicate) || !predicate()) {
  196. return;
  197. }
  198. }
  199. if (supportsDescriptors) {
  200. defineDataProperty(object, name, value, true);
  201. } else {
  202. defineDataProperty(object, name, value);
  203. }
  204. };
  205. var defineProperties = function (object, map) {
  206. var predicates = arguments.length > 2 ? arguments[2] : {};
  207. var props = keys(map);
  208. if (hasSymbols) {
  209. props = concat.call(props, Object.getOwnPropertySymbols(map));
  210. }
  211. for (var i = 0; i < props.length; i += 1) {
  212. defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
  213. }
  214. };
  215. defineProperties.supportsDescriptors = !!supportsDescriptors;
  216. module.exports = defineProperties;
  217. },{"define-data-property":6,"has-property-descriptors":12,"object-keys":18}],8:[function(require,module,exports){
  218. 'use strict';
  219. /* eslint no-invalid-this: 1 */
  220. var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
  221. var toStr = Object.prototype.toString;
  222. var max = Math.max;
  223. var funcType = '[object Function]';
  224. var concatty = function concatty(a, b) {
  225. var arr = [];
  226. for (var i = 0; i < a.length; i += 1) {
  227. arr[i] = a[i];
  228. }
  229. for (var j = 0; j < b.length; j += 1) {
  230. arr[j + a.length] = b[j];
  231. }
  232. return arr;
  233. };
  234. var slicy = function slicy(arrLike, offset) {
  235. var arr = [];
  236. for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
  237. arr[j] = arrLike[i];
  238. }
  239. return arr;
  240. };
  241. var joiny = function (arr, joiner) {
  242. var str = '';
  243. for (var i = 0; i < arr.length; i += 1) {
  244. str += arr[i];
  245. if (i + 1 < arr.length) {
  246. str += joiner;
  247. }
  248. }
  249. return str;
  250. };
  251. module.exports = function bind(that) {
  252. var target = this;
  253. if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
  254. throw new TypeError(ERROR_MESSAGE + target);
  255. }
  256. var args = slicy(arguments, 1);
  257. var bound;
  258. var binder = function () {
  259. if (this instanceof bound) {
  260. var result = target.apply(
  261. this,
  262. concatty(args, arguments)
  263. );
  264. if (Object(result) === result) {
  265. return result;
  266. }
  267. return this;
  268. }
  269. return target.apply(
  270. that,
  271. concatty(args, arguments)
  272. );
  273. };
  274. var boundLength = max(0, target.length - args.length);
  275. var boundArgs = [];
  276. for (var i = 0; i < boundLength; i++) {
  277. boundArgs[i] = '$' + i;
  278. }
  279. bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
  280. if (target.prototype) {
  281. var Empty = function Empty() {};
  282. Empty.prototype = target.prototype;
  283. bound.prototype = new Empty();
  284. Empty.prototype = null;
  285. }
  286. return bound;
  287. };
  288. },{}],9:[function(require,module,exports){
  289. 'use strict';
  290. var implementation = require('./implementation');
  291. module.exports = Function.prototype.bind || implementation;
  292. },{"./implementation":8}],10:[function(require,module,exports){
  293. 'use strict';
  294. var undefined;
  295. var $SyntaxError = SyntaxError;
  296. var $Function = Function;
  297. var $TypeError = TypeError;
  298. // eslint-disable-next-line consistent-return
  299. var getEvalledConstructor = function (expressionSyntax) {
  300. try {
  301. return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
  302. } catch (e) {}
  303. };
  304. var $gOPD = Object.getOwnPropertyDescriptor;
  305. if ($gOPD) {
  306. try {
  307. $gOPD({}, '');
  308. } catch (e) {
  309. $gOPD = null; // this is IE 8, which has a broken gOPD
  310. }
  311. }
  312. var throwTypeError = function () {
  313. throw new $TypeError();
  314. };
  315. var ThrowTypeError = $gOPD
  316. ? (function () {
  317. try {
  318. // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
  319. arguments.callee; // IE 8 does not throw here
  320. return throwTypeError;
  321. } catch (calleeThrows) {
  322. try {
  323. // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
  324. return $gOPD(arguments, 'callee').get;
  325. } catch (gOPDthrows) {
  326. return throwTypeError;
  327. }
  328. }
  329. }())
  330. : throwTypeError;
  331. var hasSymbols = require('has-symbols')();
  332. var hasProto = require('has-proto')();
  333. var getProto = Object.getPrototypeOf || (
  334. hasProto
  335. ? function (x) { return x.__proto__; } // eslint-disable-line no-proto
  336. : null
  337. );
  338. var needsEval = {};
  339. var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);
  340. var INTRINSICS = {
  341. '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
  342. '%Array%': Array,
  343. '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
  344. '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,
  345. '%AsyncFromSyncIteratorPrototype%': undefined,
  346. '%AsyncFunction%': needsEval,
  347. '%AsyncGenerator%': needsEval,
  348. '%AsyncGeneratorFunction%': needsEval,
  349. '%AsyncIteratorPrototype%': needsEval,
  350. '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
  351. '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
  352. '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,
  353. '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,
  354. '%Boolean%': Boolean,
  355. '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
  356. '%Date%': Date,
  357. '%decodeURI%': decodeURI,
  358. '%decodeURIComponent%': decodeURIComponent,
  359. '%encodeURI%': encodeURI,
  360. '%encodeURIComponent%': encodeURIComponent,
  361. '%Error%': Error,
  362. '%eval%': eval, // eslint-disable-line no-eval
  363. '%EvalError%': EvalError,
  364. '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
  365. '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
  366. '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
  367. '%Function%': $Function,
  368. '%GeneratorFunction%': needsEval,
  369. '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
  370. '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
  371. '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
  372. '%isFinite%': isFinite,
  373. '%isNaN%': isNaN,
  374. '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,
  375. '%JSON%': typeof JSON === 'object' ? JSON : undefined,
  376. '%Map%': typeof Map === 'undefined' ? undefined : Map,
  377. '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),
  378. '%Math%': Math,
  379. '%Number%': Number,
  380. '%Object%': Object,
  381. '%parseFloat%': parseFloat,
  382. '%parseInt%': parseInt,
  383. '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
  384. '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
  385. '%RangeError%': RangeError,
  386. '%ReferenceError%': ReferenceError,
  387. '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
  388. '%RegExp%': RegExp,
  389. '%Set%': typeof Set === 'undefined' ? undefined : Set,
  390. '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),
  391. '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
  392. '%String%': String,
  393. '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,
  394. '%Symbol%': hasSymbols ? Symbol : undefined,
  395. '%SyntaxError%': $SyntaxError,
  396. '%ThrowTypeError%': ThrowTypeError,
  397. '%TypedArray%': TypedArray,
  398. '%TypeError%': $TypeError,
  399. '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
  400. '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
  401. '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
  402. '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
  403. '%URIError%': URIError,
  404. '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
  405. '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
  406. '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
  407. };
  408. if (getProto) {
  409. try {
  410. null.error; // eslint-disable-line no-unused-expressions
  411. } catch (e) {
  412. // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
  413. var errorProto = getProto(getProto(e));
  414. INTRINSICS['%Error.prototype%'] = errorProto;
  415. }
  416. }
  417. var doEval = function doEval(name) {
  418. var value;
  419. if (name === '%AsyncFunction%') {
  420. value = getEvalledConstructor('async function () {}');
  421. } else if (name === '%GeneratorFunction%') {
  422. value = getEvalledConstructor('function* () {}');
  423. } else if (name === '%AsyncGeneratorFunction%') {
  424. value = getEvalledConstructor('async function* () {}');
  425. } else if (name === '%AsyncGenerator%') {
  426. var fn = doEval('%AsyncGeneratorFunction%');
  427. if (fn) {
  428. value = fn.prototype;
  429. }
  430. } else if (name === '%AsyncIteratorPrototype%') {
  431. var gen = doEval('%AsyncGenerator%');
  432. if (gen && getProto) {
  433. value = getProto(gen.prototype);
  434. }
  435. }
  436. INTRINSICS[name] = value;
  437. return value;
  438. };
  439. var LEGACY_ALIASES = {
  440. '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
  441. '%ArrayPrototype%': ['Array', 'prototype'],
  442. '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
  443. '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
  444. '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
  445. '%ArrayProto_values%': ['Array', 'prototype', 'values'],
  446. '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
  447. '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
  448. '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
  449. '%BooleanPrototype%': ['Boolean', 'prototype'],
  450. '%DataViewPrototype%': ['DataView', 'prototype'],
  451. '%DatePrototype%': ['Date', 'prototype'],
  452. '%ErrorPrototype%': ['Error', 'prototype'],
  453. '%EvalErrorPrototype%': ['EvalError', 'prototype'],
  454. '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
  455. '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
  456. '%FunctionPrototype%': ['Function', 'prototype'],
  457. '%Generator%': ['GeneratorFunction', 'prototype'],
  458. '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
  459. '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
  460. '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
  461. '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
  462. '%JSONParse%': ['JSON', 'parse'],
  463. '%JSONStringify%': ['JSON', 'stringify'],
  464. '%MapPrototype%': ['Map', 'prototype'],
  465. '%NumberPrototype%': ['Number', 'prototype'],
  466. '%ObjectPrototype%': ['Object', 'prototype'],
  467. '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
  468. '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
  469. '%PromisePrototype%': ['Promise', 'prototype'],
  470. '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
  471. '%Promise_all%': ['Promise', 'all'],
  472. '%Promise_reject%': ['Promise', 'reject'],
  473. '%Promise_resolve%': ['Promise', 'resolve'],
  474. '%RangeErrorPrototype%': ['RangeError', 'prototype'],
  475. '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
  476. '%RegExpPrototype%': ['RegExp', 'prototype'],
  477. '%SetPrototype%': ['Set', 'prototype'],
  478. '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
  479. '%StringPrototype%': ['String', 'prototype'],
  480. '%SymbolPrototype%': ['Symbol', 'prototype'],
  481. '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
  482. '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
  483. '%TypeErrorPrototype%': ['TypeError', 'prototype'],
  484. '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
  485. '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
  486. '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
  487. '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
  488. '%URIErrorPrototype%': ['URIError', 'prototype'],
  489. '%WeakMapPrototype%': ['WeakMap', 'prototype'],
  490. '%WeakSetPrototype%': ['WeakSet', 'prototype']
  491. };
  492. var bind = require('function-bind');
  493. var hasOwn = require('hasown');
  494. var $concat = bind.call(Function.call, Array.prototype.concat);
  495. var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
  496. var $replace = bind.call(Function.call, String.prototype.replace);
  497. var $strSlice = bind.call(Function.call, String.prototype.slice);
  498. var $exec = bind.call(Function.call, RegExp.prototype.exec);
  499. /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
  500. var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
  501. var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
  502. var stringToPath = function stringToPath(string) {
  503. var first = $strSlice(string, 0, 1);
  504. var last = $strSlice(string, -1);
  505. if (first === '%' && last !== '%') {
  506. throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
  507. } else if (last === '%' && first !== '%') {
  508. throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
  509. }
  510. var result = [];
  511. $replace(string, rePropName, function (match, number, quote, subString) {
  512. result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
  513. });
  514. return result;
  515. };
  516. /* end adaptation */
  517. var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
  518. var intrinsicName = name;
  519. var alias;
  520. if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
  521. alias = LEGACY_ALIASES[intrinsicName];
  522. intrinsicName = '%' + alias[0] + '%';
  523. }
  524. if (hasOwn(INTRINSICS, intrinsicName)) {
  525. var value = INTRINSICS[intrinsicName];
  526. if (value === needsEval) {
  527. value = doEval(intrinsicName);
  528. }
  529. if (typeof value === 'undefined' && !allowMissing) {
  530. throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
  531. }
  532. return {
  533. alias: alias,
  534. name: intrinsicName,
  535. value: value
  536. };
  537. }
  538. throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
  539. };
  540. module.exports = function GetIntrinsic(name, allowMissing) {
  541. if (typeof name !== 'string' || name.length === 0) {
  542. throw new $TypeError('intrinsic name must be a non-empty string');
  543. }
  544. if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
  545. throw new $TypeError('"allowMissing" argument must be a boolean');
  546. }
  547. if ($exec(/^%?[^%]*%?$/, name) === null) {
  548. throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
  549. }
  550. var parts = stringToPath(name);
  551. var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
  552. var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
  553. var intrinsicRealName = intrinsic.name;
  554. var value = intrinsic.value;
  555. var skipFurtherCaching = false;
  556. var alias = intrinsic.alias;
  557. if (alias) {
  558. intrinsicBaseName = alias[0];
  559. $spliceApply(parts, $concat([0, 1], alias));
  560. }
  561. for (var i = 1, isOwn = true; i < parts.length; i += 1) {
  562. var part = parts[i];
  563. var first = $strSlice(part, 0, 1);
  564. var last = $strSlice(part, -1);
  565. if (
  566. (
  567. (first === '"' || first === "'" || first === '`')
  568. || (last === '"' || last === "'" || last === '`')
  569. )
  570. && first !== last
  571. ) {
  572. throw new $SyntaxError('property names with quotes must have matching quotes');
  573. }
  574. if (part === 'constructor' || !isOwn) {
  575. skipFurtherCaching = true;
  576. }
  577. intrinsicBaseName += '.' + part;
  578. intrinsicRealName = '%' + intrinsicBaseName + '%';
  579. if (hasOwn(INTRINSICS, intrinsicRealName)) {
  580. value = INTRINSICS[intrinsicRealName];
  581. } else if (value != null) {
  582. if (!(part in value)) {
  583. if (!allowMissing) {
  584. throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
  585. }
  586. return void undefined;
  587. }
  588. if ($gOPD && (i + 1) >= parts.length) {
  589. var desc = $gOPD(value, part);
  590. isOwn = !!desc;
  591. // By convention, when a data property is converted to an accessor
  592. // property to emulate a data property that does not suffer from
  593. // the override mistake, that accessor's getter is marked with
  594. // an `originalValue` property. Here, when we detect this, we
  595. // uphold the illusion by pretending to see that original data
  596. // property, i.e., returning the value rather than the getter
  597. // itself.
  598. if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
  599. value = desc.get;
  600. } else {
  601. value = value[part];
  602. }
  603. } else {
  604. isOwn = hasOwn(value, part);
  605. value = value[part];
  606. }
  607. if (isOwn && !skipFurtherCaching) {
  608. INTRINSICS[intrinsicRealName] = value;
  609. }
  610. }
  611. }
  612. return value;
  613. };
  614. },{"function-bind":9,"has-proto":13,"has-symbols":14,"hasown":16}],11:[function(require,module,exports){
  615. 'use strict';
  616. var GetIntrinsic = require('get-intrinsic');
  617. var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
  618. if ($gOPD) {
  619. try {
  620. $gOPD([], 'length');
  621. } catch (e) {
  622. // IE 8 has a broken gOPD
  623. $gOPD = null;
  624. }
  625. }
  626. module.exports = $gOPD;
  627. },{"get-intrinsic":10}],12:[function(require,module,exports){
  628. 'use strict';
  629. var GetIntrinsic = require('get-intrinsic');
  630. var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
  631. var hasPropertyDescriptors = function hasPropertyDescriptors() {
  632. if ($defineProperty) {
  633. try {
  634. $defineProperty({}, 'a', { value: 1 });
  635. return true;
  636. } catch (e) {
  637. // IE 8 has a broken defineProperty
  638. return false;
  639. }
  640. }
  641. return false;
  642. };
  643. hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
  644. // node v0.6 has a bug where array lengths can be Set but not Defined
  645. if (!hasPropertyDescriptors()) {
  646. return null;
  647. }
  648. try {
  649. return $defineProperty([], 'length', { value: 1 }).length !== 1;
  650. } catch (e) {
  651. // In Firefox 4-22, defining length on an array throws an exception.
  652. return true;
  653. }
  654. };
  655. module.exports = hasPropertyDescriptors;
  656. },{"get-intrinsic":10}],13:[function(require,module,exports){
  657. 'use strict';
  658. var test = {
  659. foo: {}
  660. };
  661. var $Object = Object;
  662. module.exports = function hasProto() {
  663. return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);
  664. };
  665. },{}],14:[function(require,module,exports){
  666. 'use strict';
  667. var origSymbol = typeof Symbol !== 'undefined' && Symbol;
  668. var hasSymbolSham = require('./shams');
  669. module.exports = function hasNativeSymbols() {
  670. if (typeof origSymbol !== 'function') { return false; }
  671. if (typeof Symbol !== 'function') { return false; }
  672. if (typeof origSymbol('foo') !== 'symbol') { return false; }
  673. if (typeof Symbol('bar') !== 'symbol') { return false; }
  674. return hasSymbolSham();
  675. };
  676. },{"./shams":15}],15:[function(require,module,exports){
  677. 'use strict';
  678. /* eslint complexity: [2, 18], max-statements: [2, 33] */
  679. module.exports = function hasSymbols() {
  680. if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
  681. if (typeof Symbol.iterator === 'symbol') { return true; }
  682. var obj = {};
  683. var sym = Symbol('test');
  684. var symObj = Object(sym);
  685. if (typeof sym === 'string') { return false; }
  686. if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
  687. if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
  688. // temp disabled per https://github.com/ljharb/object.assign/issues/17
  689. // if (sym instanceof Symbol) { return false; }
  690. // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
  691. // if (!(symObj instanceof Symbol)) { return false; }
  692. // if (typeof Symbol.prototype.toString !== 'function') { return false; }
  693. // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
  694. var symVal = 42;
  695. obj[sym] = symVal;
  696. for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
  697. if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
  698. if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
  699. var syms = Object.getOwnPropertySymbols(obj);
  700. if (syms.length !== 1 || syms[0] !== sym) { return false; }
  701. if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
  702. if (typeof Object.getOwnPropertyDescriptor === 'function') {
  703. var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
  704. if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
  705. }
  706. return true;
  707. };
  708. },{}],16:[function(require,module,exports){
  709. 'use strict';
  710. var call = Function.prototype.call;
  711. var $hasOwn = Object.prototype.hasOwnProperty;
  712. var bind = require('function-bind');
  713. /** @type {(o: {}, p: PropertyKey) => p is keyof o} */
  714. module.exports = bind.call(call, $hasOwn);
  715. },{"function-bind":9}],17:[function(require,module,exports){
  716. 'use strict';
  717. var keysShim;
  718. if (!Object.keys) {
  719. // modified from https://github.com/es-shims/es5-shim
  720. var has = Object.prototype.hasOwnProperty;
  721. var toStr = Object.prototype.toString;
  722. var isArgs = require('./isArguments'); // eslint-disable-line global-require
  723. var isEnumerable = Object.prototype.propertyIsEnumerable;
  724. var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
  725. var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
  726. var dontEnums = [
  727. 'toString',
  728. 'toLocaleString',
  729. 'valueOf',
  730. 'hasOwnProperty',
  731. 'isPrototypeOf',
  732. 'propertyIsEnumerable',
  733. 'constructor'
  734. ];
  735. var equalsConstructorPrototype = function (o) {
  736. var ctor = o.constructor;
  737. return ctor && ctor.prototype === o;
  738. };
  739. var excludedKeys = {
  740. $applicationCache: true,
  741. $console: true,
  742. $external: true,
  743. $frame: true,
  744. $frameElement: true,
  745. $frames: true,
  746. $innerHeight: true,
  747. $innerWidth: true,
  748. $onmozfullscreenchange: true,
  749. $onmozfullscreenerror: true,
  750. $outerHeight: true,
  751. $outerWidth: true,
  752. $pageXOffset: true,
  753. $pageYOffset: true,
  754. $parent: true,
  755. $scrollLeft: true,
  756. $scrollTop: true,
  757. $scrollX: true,
  758. $scrollY: true,
  759. $self: true,
  760. $webkitIndexedDB: true,
  761. $webkitStorageInfo: true,
  762. $window: true
  763. };
  764. var hasAutomationEqualityBug = (function () {
  765. /* global window */
  766. if (typeof window === 'undefined') { return false; }
  767. for (var k in window) {
  768. try {
  769. if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
  770. try {
  771. equalsConstructorPrototype(window[k]);
  772. } catch (e) {
  773. return true;
  774. }
  775. }
  776. } catch (e) {
  777. return true;
  778. }
  779. }
  780. return false;
  781. }());
  782. var equalsConstructorPrototypeIfNotBuggy = function (o) {
  783. /* global window */
  784. if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
  785. return equalsConstructorPrototype(o);
  786. }
  787. try {
  788. return equalsConstructorPrototype(o);
  789. } catch (e) {
  790. return false;
  791. }
  792. };
  793. keysShim = function keys(object) {
  794. var isObject = object !== null && typeof object === 'object';
  795. var isFunction = toStr.call(object) === '[object Function]';
  796. var isArguments = isArgs(object);
  797. var isString = isObject && toStr.call(object) === '[object String]';
  798. var theKeys = [];
  799. if (!isObject && !isFunction && !isArguments) {
  800. throw new TypeError('Object.keys called on a non-object');
  801. }
  802. var skipProto = hasProtoEnumBug && isFunction;
  803. if (isString && object.length > 0 && !has.call(object, 0)) {
  804. for (var i = 0; i < object.length; ++i) {
  805. theKeys.push(String(i));
  806. }
  807. }
  808. if (isArguments && object.length > 0) {
  809. for (var j = 0; j < object.length; ++j) {
  810. theKeys.push(String(j));
  811. }
  812. } else {
  813. for (var name in object) {
  814. if (!(skipProto && name === 'prototype') && has.call(object, name)) {
  815. theKeys.push(String(name));
  816. }
  817. }
  818. }
  819. if (hasDontEnumBug) {
  820. var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
  821. for (var k = 0; k < dontEnums.length; ++k) {
  822. if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
  823. theKeys.push(dontEnums[k]);
  824. }
  825. }
  826. }
  827. return theKeys;
  828. };
  829. }
  830. module.exports = keysShim;
  831. },{"./isArguments":19}],18:[function(require,module,exports){
  832. 'use strict';
  833. var slice = Array.prototype.slice;
  834. var isArgs = require('./isArguments');
  835. var origKeys = Object.keys;
  836. var keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');
  837. var originalKeys = Object.keys;
  838. keysShim.shim = function shimObjectKeys() {
  839. if (Object.keys) {
  840. var keysWorksWithArguments = (function () {
  841. // Safari 5.0 bug
  842. var args = Object.keys(arguments);
  843. return args && args.length === arguments.length;
  844. }(1, 2));
  845. if (!keysWorksWithArguments) {
  846. Object.keys = function keys(object) { // eslint-disable-line func-name-matching
  847. if (isArgs(object)) {
  848. return originalKeys(slice.call(object));
  849. }
  850. return originalKeys(object);
  851. };
  852. }
  853. } else {
  854. Object.keys = keysShim;
  855. }
  856. return Object.keys || keysShim;
  857. };
  858. module.exports = keysShim;
  859. },{"./implementation":17,"./isArguments":19}],19:[function(require,module,exports){
  860. 'use strict';
  861. var toStr = Object.prototype.toString;
  862. module.exports = function isArguments(value) {
  863. var str = toStr.call(value);
  864. var isArgs = str === '[object Arguments]';
  865. if (!isArgs) {
  866. isArgs = str !== '[object Array]' &&
  867. value !== null &&
  868. typeof value === 'object' &&
  869. typeof value.length === 'number' &&
  870. value.length >= 0 &&
  871. toStr.call(value.callee) === '[object Function]';
  872. }
  873. return isArgs;
  874. };
  875. },{}],20:[function(require,module,exports){
  876. 'use strict';
  877. var GetIntrinsic = require('get-intrinsic');
  878. var define = require('define-data-property');
  879. var hasDescriptors = require('has-property-descriptors')();
  880. var gOPD = require('gopd');
  881. var $TypeError = GetIntrinsic('%TypeError%');
  882. var $floor = GetIntrinsic('%Math.floor%');
  883. module.exports = function setFunctionLength(fn, length) {
  884. if (typeof fn !== 'function') {
  885. throw new $TypeError('`fn` is not a function');
  886. }
  887. if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) {
  888. throw new $TypeError('`length` must be a positive 32-bit integer');
  889. }
  890. var loose = arguments.length > 2 && !!arguments[2];
  891. var functionLengthIsConfigurable = true;
  892. var functionLengthIsWritable = true;
  893. if ('length' in fn && gOPD) {
  894. var desc = gOPD(fn, 'length');
  895. if (desc && !desc.configurable) {
  896. functionLengthIsConfigurable = false;
  897. }
  898. if (desc && !desc.writable) {
  899. functionLengthIsWritable = false;
  900. }
  901. }
  902. if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
  903. if (hasDescriptors) {
  904. define(fn, 'length', length, true, true);
  905. } else {
  906. define(fn, 'length', length);
  907. }
  908. }
  909. return fn;
  910. };
  911. },{"define-data-property":6,"get-intrinsic":10,"gopd":11,"has-property-descriptors":12}],21:[function(require,module,exports){
  912. 'use strict';
  913. var implementation = require('./implementation');
  914. var lacksProperEnumerationOrder = function () {
  915. if (!Object.assign) {
  916. return false;
  917. }
  918. /*
  919. * v8, specifically in node 4.x, has a bug with incorrect property enumeration order
  920. * note: this does not detect the bug unless there's 20 characters
  921. */
  922. var str = 'abcdefghijklmnopqrst';
  923. var letters = str.split('');
  924. var map = {};
  925. for (var i = 0; i < letters.length; ++i) {
  926. map[letters[i]] = letters[i];
  927. }
  928. var obj = Object.assign({}, map);
  929. var actual = '';
  930. for (var k in obj) {
  931. actual += k;
  932. }
  933. return str !== actual;
  934. };
  935. var assignHasPendingExceptions = function () {
  936. if (!Object.assign || !Object.preventExtensions) {
  937. return false;
  938. }
  939. /*
  940. * Firefox 37 still has "pending exception" logic in its Object.assign implementation,
  941. * which is 72% slower than our shim, and Firefox 40's native implementation.
  942. */
  943. var thrower = Object.preventExtensions({ 1: 2 });
  944. try {
  945. Object.assign(thrower, 'xy');
  946. } catch (e) {
  947. return thrower[1] === 'y';
  948. }
  949. return false;
  950. };
  951. module.exports = function getPolyfill() {
  952. if (!Object.assign) {
  953. return implementation;
  954. }
  955. if (lacksProperEnumerationOrder()) {
  956. return implementation;
  957. }
  958. if (assignHasPendingExceptions()) {
  959. return implementation;
  960. }
  961. return Object.assign;
  962. };
  963. },{"./implementation":2}],22:[function(require,module,exports){
  964. 'use strict';
  965. var define = require('define-properties');
  966. var getPolyfill = require('./polyfill');
  967. module.exports = function shimAssign() {
  968. var polyfill = getPolyfill();
  969. define(
  970. Object,
  971. { assign: polyfill },
  972. { assign: function () { return Object.assign !== polyfill; } }
  973. );
  974. return polyfill;
  975. };
  976. },{"./polyfill":21,"define-properties":7}]},{},[1]);