browser.js 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865
  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":14}],2:[function(require,module,exports){
  9. 'use strict';
  10. // modified from https://github.com/es-shims/es6-shim
  11. var keys = require('object-keys');
  12. var canBeObject = function (obj) {
  13. return typeof obj !== 'undefined' && obj !== null;
  14. };
  15. var hasSymbols = require('has-symbols/shams')();
  16. var callBound = require('call-bind/callBound');
  17. var toObject = Object;
  18. var $push = callBound('Array.prototype.push');
  19. var $propIsEnumerable = callBound('Object.prototype.propertyIsEnumerable');
  20. var originalGetSymbols = hasSymbols ? Object.getOwnPropertySymbols : null;
  21. // eslint-disable-next-line no-unused-vars
  22. module.exports = function assign(target, source1) {
  23. if (!canBeObject(target)) { throw new TypeError('target must be an object'); }
  24. var objTarget = toObject(target);
  25. var s, source, i, props, syms, value, key;
  26. for (s = 1; s < arguments.length; ++s) {
  27. source = toObject(arguments[s]);
  28. props = keys(source);
  29. var getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols);
  30. if (getSymbols) {
  31. syms = getSymbols(source);
  32. for (i = 0; i < syms.length; ++i) {
  33. key = syms[i];
  34. if ($propIsEnumerable(source, key)) {
  35. $push(props, key);
  36. }
  37. }
  38. }
  39. for (i = 0; i < props.length; ++i) {
  40. key = props[i];
  41. value = source[key];
  42. if ($propIsEnumerable(source, key)) {
  43. objTarget[key] = value;
  44. }
  45. }
  46. }
  47. return objTarget;
  48. };
  49. },{"call-bind/callBound":4,"has-symbols/shams":11,"object-keys":14}],3:[function(require,module,exports){
  50. 'use strict';
  51. var defineProperties = require('define-properties');
  52. var callBind = require('call-bind');
  53. var implementation = require('./implementation');
  54. var getPolyfill = require('./polyfill');
  55. var shim = require('./shim');
  56. var polyfill = callBind.apply(getPolyfill());
  57. // eslint-disable-next-line no-unused-vars
  58. var bound = function assign(target, source1) {
  59. return polyfill(Object, arguments);
  60. };
  61. defineProperties(bound, {
  62. getPolyfill: getPolyfill,
  63. implementation: implementation,
  64. shim: shim
  65. });
  66. module.exports = bound;
  67. },{"./implementation":2,"./polyfill":16,"./shim":17,"call-bind":5,"define-properties":6}],4:[function(require,module,exports){
  68. 'use strict';
  69. var GetIntrinsic = require('get-intrinsic');
  70. var callBind = require('./');
  71. var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
  72. module.exports = function callBoundIntrinsic(name, allowMissing) {
  73. var intrinsic = GetIntrinsic(name, !!allowMissing);
  74. if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
  75. return callBind(intrinsic);
  76. }
  77. return intrinsic;
  78. };
  79. },{"./":5,"get-intrinsic":9}],5:[function(require,module,exports){
  80. 'use strict';
  81. var bind = require('function-bind');
  82. var GetIntrinsic = require('get-intrinsic');
  83. var $apply = GetIntrinsic('%Function.prototype.apply%');
  84. var $call = GetIntrinsic('%Function.prototype.call%');
  85. var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
  86. var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
  87. if ($defineProperty) {
  88. try {
  89. $defineProperty({}, 'a', { value: 1 });
  90. } catch (e) {
  91. // IE 8 has a broken defineProperty
  92. $defineProperty = null;
  93. }
  94. }
  95. module.exports = function callBind() {
  96. return $reflectApply(bind, $call, arguments);
  97. };
  98. var applyBind = function applyBind() {
  99. return $reflectApply(bind, $apply, arguments);
  100. };
  101. if ($defineProperty) {
  102. $defineProperty(module.exports, 'apply', { value: applyBind });
  103. } else {
  104. module.exports.apply = applyBind;
  105. }
  106. },{"function-bind":8,"get-intrinsic":9}],6:[function(require,module,exports){
  107. 'use strict';
  108. var keys = require('object-keys');
  109. var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
  110. var toStr = Object.prototype.toString;
  111. var concat = Array.prototype.concat;
  112. var origDefineProperty = Object.defineProperty;
  113. var isFunction = function (fn) {
  114. return typeof fn === 'function' && toStr.call(fn) === '[object Function]';
  115. };
  116. var arePropertyDescriptorsSupported = function () {
  117. var obj = {};
  118. try {
  119. origDefineProperty(obj, 'x', { enumerable: false, value: obj });
  120. // eslint-disable-next-line no-unused-vars, no-restricted-syntax
  121. for (var _ in obj) { // jscs:ignore disallowUnusedVariables
  122. return false;
  123. }
  124. return obj.x === obj;
  125. } catch (e) { /* this is IE 8. */
  126. return false;
  127. }
  128. };
  129. var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();
  130. var defineProperty = function (object, name, value, predicate) {
  131. if (name in object && (!isFunction(predicate) || !predicate())) {
  132. return;
  133. }
  134. if (supportsDescriptors) {
  135. origDefineProperty(object, name, {
  136. configurable: true,
  137. enumerable: false,
  138. value: value,
  139. writable: true
  140. });
  141. } else {
  142. object[name] = value;
  143. }
  144. };
  145. var defineProperties = function (object, map) {
  146. var predicates = arguments.length > 2 ? arguments[2] : {};
  147. var props = keys(map);
  148. if (hasSymbols) {
  149. props = concat.call(props, Object.getOwnPropertySymbols(map));
  150. }
  151. for (var i = 0; i < props.length; i += 1) {
  152. defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
  153. }
  154. };
  155. defineProperties.supportsDescriptors = !!supportsDescriptors;
  156. module.exports = defineProperties;
  157. },{"object-keys":14}],7:[function(require,module,exports){
  158. 'use strict';
  159. /* eslint no-invalid-this: 1 */
  160. var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
  161. var slice = Array.prototype.slice;
  162. var toStr = Object.prototype.toString;
  163. var funcType = '[object Function]';
  164. module.exports = function bind(that) {
  165. var target = this;
  166. if (typeof target !== 'function' || toStr.call(target) !== funcType) {
  167. throw new TypeError(ERROR_MESSAGE + target);
  168. }
  169. var args = slice.call(arguments, 1);
  170. var bound;
  171. var binder = function () {
  172. if (this instanceof bound) {
  173. var result = target.apply(
  174. this,
  175. args.concat(slice.call(arguments))
  176. );
  177. if (Object(result) === result) {
  178. return result;
  179. }
  180. return this;
  181. } else {
  182. return target.apply(
  183. that,
  184. args.concat(slice.call(arguments))
  185. );
  186. }
  187. };
  188. var boundLength = Math.max(0, target.length - args.length);
  189. var boundArgs = [];
  190. for (var i = 0; i < boundLength; i++) {
  191. boundArgs.push('$' + i);
  192. }
  193. bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
  194. if (target.prototype) {
  195. var Empty = function Empty() {};
  196. Empty.prototype = target.prototype;
  197. bound.prototype = new Empty();
  198. Empty.prototype = null;
  199. }
  200. return bound;
  201. };
  202. },{}],8:[function(require,module,exports){
  203. 'use strict';
  204. var implementation = require('./implementation');
  205. module.exports = Function.prototype.bind || implementation;
  206. },{"./implementation":7}],9:[function(require,module,exports){
  207. 'use strict';
  208. /* globals
  209. AggregateError,
  210. Atomics,
  211. FinalizationRegistry,
  212. SharedArrayBuffer,
  213. WeakRef,
  214. */
  215. var undefined;
  216. var $SyntaxError = SyntaxError;
  217. var $Function = Function;
  218. var $TypeError = TypeError;
  219. // eslint-disable-next-line consistent-return
  220. var getEvalledConstructor = function (expressionSyntax) {
  221. try {
  222. // eslint-disable-next-line no-new-func
  223. return Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
  224. } catch (e) {}
  225. };
  226. var $gOPD = Object.getOwnPropertyDescriptor;
  227. if ($gOPD) {
  228. try {
  229. $gOPD({}, '');
  230. } catch (e) {
  231. $gOPD = null; // this is IE 8, which has a broken gOPD
  232. }
  233. }
  234. var throwTypeError = function () {
  235. throw new $TypeError();
  236. };
  237. var ThrowTypeError = $gOPD
  238. ? (function () {
  239. try {
  240. // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
  241. arguments.callee; // IE 8 does not throw here
  242. return throwTypeError;
  243. } catch (calleeThrows) {
  244. try {
  245. // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
  246. return $gOPD(arguments, 'callee').get;
  247. } catch (gOPDthrows) {
  248. return throwTypeError;
  249. }
  250. }
  251. }())
  252. : throwTypeError;
  253. var hasSymbols = require('has-symbols')();
  254. var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
  255. var asyncGenFunction = getEvalledConstructor('async function* () {}');
  256. var asyncGenFunctionPrototype = asyncGenFunction ? asyncGenFunction.prototype : undefined;
  257. var asyncGenPrototype = asyncGenFunctionPrototype ? asyncGenFunctionPrototype.prototype : undefined;
  258. var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
  259. var INTRINSICS = {
  260. '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
  261. '%Array%': Array,
  262. '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
  263. '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
  264. '%AsyncFromSyncIteratorPrototype%': undefined,
  265. '%AsyncFunction%': getEvalledConstructor('async function () {}'),
  266. '%AsyncGenerator%': asyncGenFunctionPrototype,
  267. '%AsyncGeneratorFunction%': asyncGenFunction,
  268. '%AsyncIteratorPrototype%': asyncGenPrototype ? getProto(asyncGenPrototype) : undefined,
  269. '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
  270. '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
  271. '%Boolean%': Boolean,
  272. '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
  273. '%Date%': Date,
  274. '%decodeURI%': decodeURI,
  275. '%decodeURIComponent%': decodeURIComponent,
  276. '%encodeURI%': encodeURI,
  277. '%encodeURIComponent%': encodeURIComponent,
  278. '%Error%': Error,
  279. '%eval%': eval, // eslint-disable-line no-eval
  280. '%EvalError%': EvalError,
  281. '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
  282. '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
  283. '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
  284. '%Function%': $Function,
  285. '%GeneratorFunction%': getEvalledConstructor('function* () {}'),
  286. '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
  287. '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
  288. '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
  289. '%isFinite%': isFinite,
  290. '%isNaN%': isNaN,
  291. '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
  292. '%JSON%': typeof JSON === 'object' ? JSON : undefined,
  293. '%Map%': typeof Map === 'undefined' ? undefined : Map,
  294. '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
  295. '%Math%': Math,
  296. '%Number%': Number,
  297. '%Object%': Object,
  298. '%parseFloat%': parseFloat,
  299. '%parseInt%': parseInt,
  300. '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
  301. '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
  302. '%RangeError%': RangeError,
  303. '%ReferenceError%': ReferenceError,
  304. '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
  305. '%RegExp%': RegExp,
  306. '%Set%': typeof Set === 'undefined' ? undefined : Set,
  307. '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
  308. '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
  309. '%String%': String,
  310. '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
  311. '%Symbol%': hasSymbols ? Symbol : undefined,
  312. '%SyntaxError%': $SyntaxError,
  313. '%ThrowTypeError%': ThrowTypeError,
  314. '%TypedArray%': TypedArray,
  315. '%TypeError%': $TypeError,
  316. '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
  317. '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
  318. '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
  319. '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
  320. '%URIError%': URIError,
  321. '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
  322. '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
  323. '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
  324. };
  325. var LEGACY_ALIASES = {
  326. '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
  327. '%ArrayPrototype%': ['Array', 'prototype'],
  328. '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
  329. '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
  330. '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
  331. '%ArrayProto_values%': ['Array', 'prototype', 'values'],
  332. '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
  333. '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
  334. '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
  335. '%BooleanPrototype%': ['Boolean', 'prototype'],
  336. '%DataViewPrototype%': ['DataView', 'prototype'],
  337. '%DatePrototype%': ['Date', 'prototype'],
  338. '%ErrorPrototype%': ['Error', 'prototype'],
  339. '%EvalErrorPrototype%': ['EvalError', 'prototype'],
  340. '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
  341. '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
  342. '%FunctionPrototype%': ['Function', 'prototype'],
  343. '%Generator%': ['GeneratorFunction', 'prototype'],
  344. '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
  345. '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
  346. '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
  347. '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
  348. '%JSONParse%': ['JSON', 'parse'],
  349. '%JSONStringify%': ['JSON', 'stringify'],
  350. '%MapPrototype%': ['Map', 'prototype'],
  351. '%NumberPrototype%': ['Number', 'prototype'],
  352. '%ObjectPrototype%': ['Object', 'prototype'],
  353. '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
  354. '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
  355. '%PromisePrototype%': ['Promise', 'prototype'],
  356. '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
  357. '%Promise_all%': ['Promise', 'all'],
  358. '%Promise_reject%': ['Promise', 'reject'],
  359. '%Promise_resolve%': ['Promise', 'resolve'],
  360. '%RangeErrorPrototype%': ['RangeError', 'prototype'],
  361. '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
  362. '%RegExpPrototype%': ['RegExp', 'prototype'],
  363. '%SetPrototype%': ['Set', 'prototype'],
  364. '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
  365. '%StringPrototype%': ['String', 'prototype'],
  366. '%SymbolPrototype%': ['Symbol', 'prototype'],
  367. '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
  368. '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
  369. '%TypeErrorPrototype%': ['TypeError', 'prototype'],
  370. '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
  371. '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
  372. '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
  373. '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
  374. '%URIErrorPrototype%': ['URIError', 'prototype'],
  375. '%WeakMapPrototype%': ['WeakMap', 'prototype'],
  376. '%WeakSetPrototype%': ['WeakSet', 'prototype']
  377. };
  378. var bind = require('function-bind');
  379. var hasOwn = require('has');
  380. var $concat = bind.call(Function.call, Array.prototype.concat);
  381. var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
  382. var $replace = bind.call(Function.call, String.prototype.replace);
  383. /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
  384. var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
  385. var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
  386. var stringToPath = function stringToPath(string) {
  387. var result = [];
  388. $replace(string, rePropName, function (match, number, quote, subString) {
  389. result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
  390. });
  391. return result;
  392. };
  393. /* end adaptation */
  394. var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
  395. var intrinsicName = name;
  396. var alias;
  397. if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
  398. alias = LEGACY_ALIASES[intrinsicName];
  399. intrinsicName = '%' + alias[0] + '%';
  400. }
  401. if (hasOwn(INTRINSICS, intrinsicName)) {
  402. var value = INTRINSICS[intrinsicName];
  403. if (typeof value === 'undefined' && !allowMissing) {
  404. throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
  405. }
  406. return {
  407. alias: alias,
  408. name: intrinsicName,
  409. value: value
  410. };
  411. }
  412. throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
  413. };
  414. module.exports = function GetIntrinsic(name, allowMissing) {
  415. if (typeof name !== 'string' || name.length === 0) {
  416. throw new $TypeError('intrinsic name must be a non-empty string');
  417. }
  418. if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
  419. throw new $TypeError('"allowMissing" argument must be a boolean');
  420. }
  421. var parts = stringToPath(name);
  422. var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
  423. var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
  424. var intrinsicRealName = intrinsic.name;
  425. var value = intrinsic.value;
  426. var skipFurtherCaching = false;
  427. var alias = intrinsic.alias;
  428. if (alias) {
  429. intrinsicBaseName = alias[0];
  430. $spliceApply(parts, $concat([0, 1], alias));
  431. }
  432. for (var i = 1, isOwn = true; i < parts.length; i += 1) {
  433. var part = parts[i];
  434. if (part === 'constructor' || !isOwn) {
  435. skipFurtherCaching = true;
  436. }
  437. intrinsicBaseName += '.' + part;
  438. intrinsicRealName = '%' + intrinsicBaseName + '%';
  439. if (hasOwn(INTRINSICS, intrinsicRealName)) {
  440. value = INTRINSICS[intrinsicRealName];
  441. } else if (value != null) {
  442. if ($gOPD && (i + 1) >= parts.length) {
  443. var desc = $gOPD(value, part);
  444. isOwn = !!desc;
  445. if (!allowMissing && !(part in value)) {
  446. throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
  447. }
  448. // By convention, when a data property is converted to an accessor
  449. // property to emulate a data property that does not suffer from
  450. // the override mistake, that accessor's getter is marked with
  451. // an `originalValue` property. Here, when we detect this, we
  452. // uphold the illusion by pretending to see that original data
  453. // property, i.e., returning the value rather than the getter
  454. // itself.
  455. if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
  456. value = desc.get;
  457. } else {
  458. value = value[part];
  459. }
  460. } else {
  461. isOwn = hasOwn(value, part);
  462. value = value[part];
  463. }
  464. if (isOwn && !skipFurtherCaching) {
  465. INTRINSICS[intrinsicRealName] = value;
  466. }
  467. }
  468. }
  469. return value;
  470. };
  471. },{"function-bind":8,"has":12,"has-symbols":10}],10:[function(require,module,exports){
  472. (function (global){(function (){
  473. 'use strict';
  474. var origSymbol = global.Symbol;
  475. var hasSymbolSham = require('./shams');
  476. module.exports = function hasNativeSymbols() {
  477. if (typeof origSymbol !== 'function') { return false; }
  478. if (typeof Symbol !== 'function') { return false; }
  479. if (typeof origSymbol('foo') !== 'symbol') { return false; }
  480. if (typeof Symbol('bar') !== 'symbol') { return false; }
  481. return hasSymbolSham();
  482. };
  483. }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  484. },{"./shams":11}],11:[function(require,module,exports){
  485. 'use strict';
  486. /* eslint complexity: [2, 18], max-statements: [2, 33] */
  487. module.exports = function hasSymbols() {
  488. if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
  489. if (typeof Symbol.iterator === 'symbol') { return true; }
  490. var obj = {};
  491. var sym = Symbol('test');
  492. var symObj = Object(sym);
  493. if (typeof sym === 'string') { return false; }
  494. if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
  495. if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
  496. // temp disabled per https://github.com/ljharb/object.assign/issues/17
  497. // if (sym instanceof Symbol) { return false; }
  498. // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
  499. // if (!(symObj instanceof Symbol)) { return false; }
  500. // if (typeof Symbol.prototype.toString !== 'function') { return false; }
  501. // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
  502. var symVal = 42;
  503. obj[sym] = symVal;
  504. for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax
  505. if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
  506. if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
  507. var syms = Object.getOwnPropertySymbols(obj);
  508. if (syms.length !== 1 || syms[0] !== sym) { return false; }
  509. if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
  510. if (typeof Object.getOwnPropertyDescriptor === 'function') {
  511. var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
  512. if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
  513. }
  514. return true;
  515. };
  516. },{}],12:[function(require,module,exports){
  517. 'use strict';
  518. var bind = require('function-bind');
  519. module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
  520. },{"function-bind":8}],13:[function(require,module,exports){
  521. 'use strict';
  522. var keysShim;
  523. if (!Object.keys) {
  524. // modified from https://github.com/es-shims/es5-shim
  525. var has = Object.prototype.hasOwnProperty;
  526. var toStr = Object.prototype.toString;
  527. var isArgs = require('./isArguments'); // eslint-disable-line global-require
  528. var isEnumerable = Object.prototype.propertyIsEnumerable;
  529. var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
  530. var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
  531. var dontEnums = [
  532. 'toString',
  533. 'toLocaleString',
  534. 'valueOf',
  535. 'hasOwnProperty',
  536. 'isPrototypeOf',
  537. 'propertyIsEnumerable',
  538. 'constructor'
  539. ];
  540. var equalsConstructorPrototype = function (o) {
  541. var ctor = o.constructor;
  542. return ctor && ctor.prototype === o;
  543. };
  544. var excludedKeys = {
  545. $applicationCache: true,
  546. $console: true,
  547. $external: true,
  548. $frame: true,
  549. $frameElement: true,
  550. $frames: true,
  551. $innerHeight: true,
  552. $innerWidth: true,
  553. $onmozfullscreenchange: true,
  554. $onmozfullscreenerror: true,
  555. $outerHeight: true,
  556. $outerWidth: true,
  557. $pageXOffset: true,
  558. $pageYOffset: true,
  559. $parent: true,
  560. $scrollLeft: true,
  561. $scrollTop: true,
  562. $scrollX: true,
  563. $scrollY: true,
  564. $self: true,
  565. $webkitIndexedDB: true,
  566. $webkitStorageInfo: true,
  567. $window: true
  568. };
  569. var hasAutomationEqualityBug = (function () {
  570. /* global window */
  571. if (typeof window === 'undefined') { return false; }
  572. for (var k in window) {
  573. try {
  574. if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
  575. try {
  576. equalsConstructorPrototype(window[k]);
  577. } catch (e) {
  578. return true;
  579. }
  580. }
  581. } catch (e) {
  582. return true;
  583. }
  584. }
  585. return false;
  586. }());
  587. var equalsConstructorPrototypeIfNotBuggy = function (o) {
  588. /* global window */
  589. if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
  590. return equalsConstructorPrototype(o);
  591. }
  592. try {
  593. return equalsConstructorPrototype(o);
  594. } catch (e) {
  595. return false;
  596. }
  597. };
  598. keysShim = function keys(object) {
  599. var isObject = object !== null && typeof object === 'object';
  600. var isFunction = toStr.call(object) === '[object Function]';
  601. var isArguments = isArgs(object);
  602. var isString = isObject && toStr.call(object) === '[object String]';
  603. var theKeys = [];
  604. if (!isObject && !isFunction && !isArguments) {
  605. throw new TypeError('Object.keys called on a non-object');
  606. }
  607. var skipProto = hasProtoEnumBug && isFunction;
  608. if (isString && object.length > 0 && !has.call(object, 0)) {
  609. for (var i = 0; i < object.length; ++i) {
  610. theKeys.push(String(i));
  611. }
  612. }
  613. if (isArguments && object.length > 0) {
  614. for (var j = 0; j < object.length; ++j) {
  615. theKeys.push(String(j));
  616. }
  617. } else {
  618. for (var name in object) {
  619. if (!(skipProto && name === 'prototype') && has.call(object, name)) {
  620. theKeys.push(String(name));
  621. }
  622. }
  623. }
  624. if (hasDontEnumBug) {
  625. var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
  626. for (var k = 0; k < dontEnums.length; ++k) {
  627. if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
  628. theKeys.push(dontEnums[k]);
  629. }
  630. }
  631. }
  632. return theKeys;
  633. };
  634. }
  635. module.exports = keysShim;
  636. },{"./isArguments":15}],14:[function(require,module,exports){
  637. 'use strict';
  638. var slice = Array.prototype.slice;
  639. var isArgs = require('./isArguments');
  640. var origKeys = Object.keys;
  641. var keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');
  642. var originalKeys = Object.keys;
  643. keysShim.shim = function shimObjectKeys() {
  644. if (Object.keys) {
  645. var keysWorksWithArguments = (function () {
  646. // Safari 5.0 bug
  647. var args = Object.keys(arguments);
  648. return args && args.length === arguments.length;
  649. }(1, 2));
  650. if (!keysWorksWithArguments) {
  651. Object.keys = function keys(object) { // eslint-disable-line func-name-matching
  652. if (isArgs(object)) {
  653. return originalKeys(slice.call(object));
  654. }
  655. return originalKeys(object);
  656. };
  657. }
  658. } else {
  659. Object.keys = keysShim;
  660. }
  661. return Object.keys || keysShim;
  662. };
  663. module.exports = keysShim;
  664. },{"./implementation":13,"./isArguments":15}],15:[function(require,module,exports){
  665. 'use strict';
  666. var toStr = Object.prototype.toString;
  667. module.exports = function isArguments(value) {
  668. var str = toStr.call(value);
  669. var isArgs = str === '[object Arguments]';
  670. if (!isArgs) {
  671. isArgs = str !== '[object Array]' &&
  672. value !== null &&
  673. typeof value === 'object' &&
  674. typeof value.length === 'number' &&
  675. value.length >= 0 &&
  676. toStr.call(value.callee) === '[object Function]';
  677. }
  678. return isArgs;
  679. };
  680. },{}],16:[function(require,module,exports){
  681. 'use strict';
  682. var implementation = require('./implementation');
  683. var lacksProperEnumerationOrder = function () {
  684. if (!Object.assign) {
  685. return false;
  686. }
  687. /*
  688. * v8, specifically in node 4.x, has a bug with incorrect property enumeration order
  689. * note: this does not detect the bug unless there's 20 characters
  690. */
  691. var str = 'abcdefghijklmnopqrst';
  692. var letters = str.split('');
  693. var map = {};
  694. for (var i = 0; i < letters.length; ++i) {
  695. map[letters[i]] = letters[i];
  696. }
  697. var obj = Object.assign({}, map);
  698. var actual = '';
  699. for (var k in obj) {
  700. actual += k;
  701. }
  702. return str !== actual;
  703. };
  704. var assignHasPendingExceptions = function () {
  705. if (!Object.assign || !Object.preventExtensions) {
  706. return false;
  707. }
  708. /*
  709. * Firefox 37 still has "pending exception" logic in its Object.assign implementation,
  710. * which is 72% slower than our shim, and Firefox 40's native implementation.
  711. */
  712. var thrower = Object.preventExtensions({ 1: 2 });
  713. try {
  714. Object.assign(thrower, 'xy');
  715. } catch (e) {
  716. return thrower[1] === 'y';
  717. }
  718. return false;
  719. };
  720. module.exports = function getPolyfill() {
  721. if (!Object.assign) {
  722. return implementation;
  723. }
  724. if (lacksProperEnumerationOrder()) {
  725. return implementation;
  726. }
  727. if (assignHasPendingExceptions()) {
  728. return implementation;
  729. }
  730. return Object.assign;
  731. };
  732. },{"./implementation":2}],17:[function(require,module,exports){
  733. 'use strict';
  734. var define = require('define-properties');
  735. var getPolyfill = require('./polyfill');
  736. module.exports = function shimAssign() {
  737. var polyfill = getPolyfill();
  738. define(
  739. Object,
  740. { assign: polyfill },
  741. { assign: function () { return Object.assign !== polyfill; } }
  742. );
  743. return polyfill;
  744. };
  745. },{"./polyfill":16,"define-properties":6}]},{},[1]);