browser.js 41 KB

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