es5-shim.js 66 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749
  1. import {
  2. __commonJS
  3. } from "./chunk-WFTEJBJX.js";
  4. // node_modules/es5-shim/es5-shim.js
  5. var require_es5_shim = __commonJS({
  6. "node_modules/es5-shim/es5-shim.js"(exports, module) {
  7. (function(root, factory) {
  8. "use strict";
  9. if (typeof define === "function" && define.amd) {
  10. define(factory);
  11. } else if (typeof exports === "object") {
  12. module.exports = factory();
  13. } else {
  14. root.returnExports = factory();
  15. }
  16. })(exports, function() {
  17. var $Array = Array;
  18. var ArrayPrototype = $Array.prototype;
  19. var $Object = Object;
  20. var ObjectPrototype = $Object.prototype;
  21. var $Function = Function;
  22. var FunctionPrototype = $Function.prototype;
  23. var $String = String;
  24. var StringPrototype = $String.prototype;
  25. var $Number = Number;
  26. var NumberPrototype = $Number.prototype;
  27. var array_slice = ArrayPrototype.slice;
  28. var array_splice = ArrayPrototype.splice;
  29. var array_push = ArrayPrototype.push;
  30. var array_unshift = ArrayPrototype.unshift;
  31. var array_concat = ArrayPrototype.concat;
  32. var array_join = ArrayPrototype.join;
  33. var call = FunctionPrototype.call;
  34. var apply = FunctionPrototype.apply;
  35. var max = Math.max;
  36. var min = Math.min;
  37. var floor = Math.floor;
  38. var abs = Math.abs;
  39. var pow = Math.pow;
  40. var round = Math.round;
  41. var log = Math.log;
  42. var LOG10E = Math.LOG10E;
  43. var log10 = Math.log10 || function log102(value) {
  44. return log(value) * LOG10E;
  45. };
  46. var to_string = ObjectPrototype.toString;
  47. var hasToStringTag = typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol";
  48. var isCallable;
  49. var fnToStr = Function.prototype.toString, constructorRegex = /^\s*class /, isES6ClassFn = function isES6ClassFn2(value) {
  50. try {
  51. var fnStr = fnToStr.call(value);
  52. var singleStripped = fnStr.replace(/\/\/.*\n/g, "");
  53. var multiStripped = singleStripped.replace(/\/\*[.\s\S]*\*\//g, "");
  54. var spaceStripped = multiStripped.replace(/\n/mg, " ").replace(/ {2}/g, " ");
  55. return constructorRegex.test(spaceStripped);
  56. } catch (e) {
  57. return false;
  58. }
  59. }, tryFunctionObject = function tryFunctionObject2(value) {
  60. try {
  61. if (isES6ClassFn(value)) {
  62. return false;
  63. }
  64. fnToStr.call(value);
  65. return true;
  66. } catch (e) {
  67. return false;
  68. }
  69. }, fnClass = "[object Function]", genClass = "[object GeneratorFunction]", isCallable = function isCallable2(value) {
  70. if (!value) {
  71. return false;
  72. }
  73. if (typeof value !== "function" && typeof value !== "object") {
  74. return false;
  75. }
  76. if (hasToStringTag) {
  77. return tryFunctionObject(value);
  78. }
  79. if (isES6ClassFn(value)) {
  80. return false;
  81. }
  82. var strClass = to_string.call(value);
  83. return strClass === fnClass || strClass === genClass;
  84. };
  85. var isRegex;
  86. var regexExec = RegExp.prototype.exec, tryRegexExec = function tryRegexExec2(value) {
  87. try {
  88. regexExec.call(value);
  89. return true;
  90. } catch (e) {
  91. return false;
  92. }
  93. }, regexClass = "[object RegExp]";
  94. isRegex = function isRegex2(value) {
  95. if (typeof value !== "object") {
  96. return false;
  97. }
  98. return hasToStringTag ? tryRegexExec(value) : to_string.call(value) === regexClass;
  99. };
  100. var isString;
  101. var strValue = String.prototype.valueOf, tryStringObject = function tryStringObject2(value) {
  102. try {
  103. strValue.call(value);
  104. return true;
  105. } catch (e) {
  106. return false;
  107. }
  108. }, stringClass = "[object String]";
  109. isString = function isString2(value) {
  110. if (typeof value === "string") {
  111. return true;
  112. }
  113. if (typeof value !== "object") {
  114. return false;
  115. }
  116. return hasToStringTag ? tryStringObject(value) : to_string.call(value) === stringClass;
  117. };
  118. var supportsDescriptors = $Object.defineProperty && function() {
  119. try {
  120. var obj = {};
  121. $Object.defineProperty(obj, "x", { enumerable: false, value: obj });
  122. for (var _ in obj) {
  123. return false;
  124. }
  125. return obj.x === obj;
  126. } catch (e) {
  127. return false;
  128. }
  129. }();
  130. var defineProperties = function(has) {
  131. var defineProperty;
  132. if (supportsDescriptors) {
  133. defineProperty = function(object, name, method, forceAssign) {
  134. if (!forceAssign && name in object) {
  135. return;
  136. }
  137. $Object.defineProperty(object, name, {
  138. configurable: true,
  139. enumerable: false,
  140. writable: true,
  141. value: method
  142. });
  143. };
  144. } else {
  145. defineProperty = function(object, name, method, forceAssign) {
  146. if (!forceAssign && name in object) {
  147. return;
  148. }
  149. object[name] = method;
  150. };
  151. }
  152. return function defineProperties2(object, map, forceAssign) {
  153. for (var name in map) {
  154. if (has.call(map, name)) {
  155. defineProperty(object, name, map[name], forceAssign);
  156. }
  157. }
  158. };
  159. }(ObjectPrototype.hasOwnProperty);
  160. if ($Object.defineProperty && supportsDescriptors) {
  161. var F = function() {
  162. };
  163. var toStringSentinel = {};
  164. var sentinel = { toString: toStringSentinel };
  165. $Object.defineProperty(F, "prototype", { value: sentinel, writable: false });
  166. if (new F().toString !== toStringSentinel) {
  167. var $dP = $Object.defineProperty;
  168. var $gOPD = $Object.getOwnPropertyDescriptor;
  169. defineProperties($Object, {
  170. defineProperty: function defineProperty(o, k, d) {
  171. var key = $String(k);
  172. if (typeof o === "function" && key === "prototype") {
  173. var desc = $gOPD(o, key);
  174. if (desc.writable && !d.writable && "value" in d) {
  175. try {
  176. o[key] = d.value;
  177. } catch (e) {
  178. }
  179. }
  180. return $dP(o, key, {
  181. configurable: "configurable" in d ? d.configurable : desc.configurable,
  182. enumerable: "enumerable" in d ? d.enumerable : desc.enumerable,
  183. writable: d.writable
  184. });
  185. }
  186. return $dP(o, key, d);
  187. }
  188. }, true);
  189. }
  190. }
  191. var isPrimitive = function isPrimitive2(input) {
  192. var type = typeof input;
  193. return input === null || type !== "object" && type !== "function";
  194. };
  195. var isActualNaN = $Number.isNaN || function isActualNaN2(x) {
  196. return x !== x;
  197. };
  198. var ES = {
  199. // ES5 9.4
  200. // https://es5.github.io/#x9.4
  201. // http://jsperf.com/to-integer
  202. /* replaceable with https://npmjs.com/package/es-abstract ES5.ToInteger */
  203. ToInteger: function ToInteger(num) {
  204. var n = +num;
  205. if (isActualNaN(n)) {
  206. n = 0;
  207. } else if (n !== 0 && n !== 1 / 0 && n !== -(1 / 0)) {
  208. n = (n > 0 || -1) * floor(abs(n));
  209. }
  210. return n;
  211. },
  212. /* replaceable with https://npmjs.com/package/es-abstract ES5.ToPrimitive */
  213. ToPrimitive: function ToPrimitive(input) {
  214. var val, valueOf, toStr2;
  215. if (isPrimitive(input)) {
  216. return input;
  217. }
  218. valueOf = input.valueOf;
  219. if (isCallable(valueOf)) {
  220. val = valueOf.call(input);
  221. if (isPrimitive(val)) {
  222. return val;
  223. }
  224. }
  225. toStr2 = input.toString;
  226. if (isCallable(toStr2)) {
  227. val = toStr2.call(input);
  228. if (isPrimitive(val)) {
  229. return val;
  230. }
  231. }
  232. throw new TypeError();
  233. },
  234. // ES5 9.9
  235. // https://es5.github.io/#x9.9
  236. /* replaceable with https://npmjs.com/package/es-abstract ES5.ToObject */
  237. ToObject: function(o) {
  238. if (o == null) {
  239. throw new TypeError("can't convert " + o + " to object");
  240. }
  241. return $Object(o);
  242. },
  243. /* replaceable with https://npmjs.com/package/es-abstract ES5.ToUint32 */
  244. ToUint32: function ToUint32(x) {
  245. return x >>> 0;
  246. }
  247. };
  248. var Empty = function Empty2() {
  249. };
  250. defineProperties(FunctionPrototype, {
  251. bind: function bind(that) {
  252. var target = this;
  253. if (!isCallable(target)) {
  254. throw new TypeError("Function.prototype.bind called on incompatible " + target);
  255. }
  256. var args = array_slice.call(arguments, 1);
  257. var bound;
  258. var binder = function() {
  259. if (this instanceof bound) {
  260. var result = apply.call(
  261. target,
  262. this,
  263. array_concat.call(args, array_slice.call(arguments))
  264. );
  265. if ($Object(result) === result) {
  266. return result;
  267. }
  268. return this;
  269. }
  270. return apply.call(
  271. target,
  272. that,
  273. array_concat.call(args, array_slice.call(arguments))
  274. );
  275. };
  276. var boundLength = max(0, target.length - args.length);
  277. var boundArgs = [];
  278. for (var i = 0; i < boundLength; i++) {
  279. array_push.call(boundArgs, "$" + i);
  280. }
  281. bound = $Function("binder", "return function (" + array_join.call(boundArgs, ",") + "){ return binder.apply(this, arguments); }")(binder);
  282. if (target.prototype) {
  283. Empty.prototype = target.prototype;
  284. bound.prototype = new Empty();
  285. Empty.prototype = null;
  286. }
  287. return bound;
  288. }
  289. });
  290. var owns = call.bind(ObjectPrototype.hasOwnProperty);
  291. var toStr = call.bind(ObjectPrototype.toString);
  292. var arraySlice = call.bind(array_slice);
  293. var arraySliceApply = apply.bind(array_slice);
  294. if (typeof document === "object" && document && document.documentElement) {
  295. try {
  296. arraySlice(document.documentElement.childNodes);
  297. } catch (e) {
  298. var origArraySlice = arraySlice;
  299. var origArraySliceApply = arraySliceApply;
  300. arraySlice = function arraySliceIE(arr) {
  301. var r = [];
  302. var i = arr.length;
  303. while (i-- > 0) {
  304. r[i] = arr[i];
  305. }
  306. return origArraySliceApply(r, origArraySlice(arguments, 1));
  307. };
  308. arraySliceApply = function arraySliceApplyIE(arr, args) {
  309. return origArraySliceApply(arraySlice(arr), args);
  310. };
  311. }
  312. }
  313. var strSlice = call.bind(StringPrototype.slice);
  314. var strSplit = call.bind(StringPrototype.split);
  315. var strIndexOf = call.bind(StringPrototype.indexOf);
  316. var pushCall = call.bind(array_push);
  317. var isEnum = call.bind(ObjectPrototype.propertyIsEnumerable);
  318. var arraySort = call.bind(ArrayPrototype.sort);
  319. var isArray = $Array.isArray || function isArray2(obj) {
  320. return toStr(obj) === "[object Array]";
  321. };
  322. var hasUnshiftReturnValueBug = [].unshift(0) !== 1;
  323. defineProperties(ArrayPrototype, {
  324. unshift: function() {
  325. array_unshift.apply(this, arguments);
  326. return this.length;
  327. }
  328. }, hasUnshiftReturnValueBug);
  329. defineProperties($Array, { isArray });
  330. var boxedString = $Object("a");
  331. var splitString = boxedString[0] !== "a" || !(0 in boxedString);
  332. var properlyBoxesContext = function properlyBoxed(method) {
  333. var properlyBoxesNonStrict = true;
  334. var properlyBoxesStrict = true;
  335. var threwException = false;
  336. if (method) {
  337. try {
  338. method.call("foo", function(_, __, context) {
  339. if (typeof context !== "object") {
  340. properlyBoxesNonStrict = false;
  341. }
  342. });
  343. method.call([1], function() {
  344. "use strict";
  345. properlyBoxesStrict = typeof this === "string";
  346. }, "x");
  347. } catch (e) {
  348. threwException = true;
  349. }
  350. }
  351. return !!method && !threwException && properlyBoxesNonStrict && properlyBoxesStrict;
  352. };
  353. defineProperties(ArrayPrototype, {
  354. forEach: function forEach(callbackfn) {
  355. var object = ES.ToObject(this);
  356. var self = splitString && isString(this) ? strSplit(this, "") : object;
  357. var i = -1;
  358. var length = ES.ToUint32(self.length);
  359. var T;
  360. if (arguments.length > 1) {
  361. T = arguments[1];
  362. }
  363. if (!isCallable(callbackfn)) {
  364. throw new TypeError("Array.prototype.forEach callback must be a function");
  365. }
  366. while (++i < length) {
  367. if (i in self) {
  368. if (typeof T === "undefined") {
  369. callbackfn(self[i], i, object);
  370. } else {
  371. callbackfn.call(T, self[i], i, object);
  372. }
  373. }
  374. }
  375. }
  376. }, !properlyBoxesContext(ArrayPrototype.forEach));
  377. defineProperties(ArrayPrototype, {
  378. map: function map(callbackfn) {
  379. var object = ES.ToObject(this);
  380. var self = splitString && isString(this) ? strSplit(this, "") : object;
  381. var length = ES.ToUint32(self.length);
  382. var result = $Array(length);
  383. var T;
  384. if (arguments.length > 1) {
  385. T = arguments[1];
  386. }
  387. if (!isCallable(callbackfn)) {
  388. throw new TypeError("Array.prototype.map callback must be a function");
  389. }
  390. for (var i = 0; i < length; i++) {
  391. if (i in self) {
  392. if (typeof T === "undefined") {
  393. result[i] = callbackfn(self[i], i, object);
  394. } else {
  395. result[i] = callbackfn.call(T, self[i], i, object);
  396. }
  397. }
  398. }
  399. return result;
  400. }
  401. }, !properlyBoxesContext(ArrayPrototype.map));
  402. defineProperties(ArrayPrototype, {
  403. filter: function filter(callbackfn) {
  404. var object = ES.ToObject(this);
  405. var self = splitString && isString(this) ? strSplit(this, "") : object;
  406. var length = ES.ToUint32(self.length);
  407. var result = [];
  408. var value;
  409. var T;
  410. if (arguments.length > 1) {
  411. T = arguments[1];
  412. }
  413. if (!isCallable(callbackfn)) {
  414. throw new TypeError("Array.prototype.filter callback must be a function");
  415. }
  416. for (var i = 0; i < length; i++) {
  417. if (i in self) {
  418. value = self[i];
  419. if (typeof T === "undefined" ? callbackfn(value, i, object) : callbackfn.call(T, value, i, object)) {
  420. pushCall(result, value);
  421. }
  422. }
  423. }
  424. return result;
  425. }
  426. }, !properlyBoxesContext(ArrayPrototype.filter));
  427. defineProperties(ArrayPrototype, {
  428. every: function every(callbackfn) {
  429. var object = ES.ToObject(this);
  430. var self = splitString && isString(this) ? strSplit(this, "") : object;
  431. var length = ES.ToUint32(self.length);
  432. var T;
  433. if (arguments.length > 1) {
  434. T = arguments[1];
  435. }
  436. if (!isCallable(callbackfn)) {
  437. throw new TypeError("Array.prototype.every callback must be a function");
  438. }
  439. for (var i = 0; i < length; i++) {
  440. if (i in self && !(typeof T === "undefined" ? callbackfn(self[i], i, object) : callbackfn.call(T, self[i], i, object))) {
  441. return false;
  442. }
  443. }
  444. return true;
  445. }
  446. }, !properlyBoxesContext(ArrayPrototype.every));
  447. defineProperties(ArrayPrototype, {
  448. some: function some(callbackfn) {
  449. var object = ES.ToObject(this);
  450. var self = splitString && isString(this) ? strSplit(this, "") : object;
  451. var length = ES.ToUint32(self.length);
  452. var T;
  453. if (arguments.length > 1) {
  454. T = arguments[1];
  455. }
  456. if (!isCallable(callbackfn)) {
  457. throw new TypeError("Array.prototype.some callback must be a function");
  458. }
  459. for (var i = 0; i < length; i++) {
  460. if (i in self && (typeof T === "undefined" ? callbackfn(self[i], i, object) : callbackfn.call(T, self[i], i, object))) {
  461. return true;
  462. }
  463. }
  464. return false;
  465. }
  466. }, !properlyBoxesContext(ArrayPrototype.some));
  467. var reduceCoercesToObject = false;
  468. if (ArrayPrototype.reduce) {
  469. reduceCoercesToObject = typeof ArrayPrototype.reduce.call("es5", function(_, __, ___, list) {
  470. return list;
  471. }) === "object";
  472. }
  473. defineProperties(ArrayPrototype, {
  474. reduce: function reduce(callbackfn) {
  475. var object = ES.ToObject(this);
  476. var self = splitString && isString(this) ? strSplit(this, "") : object;
  477. var length = ES.ToUint32(self.length);
  478. if (!isCallable(callbackfn)) {
  479. throw new TypeError("Array.prototype.reduce callback must be a function");
  480. }
  481. if (length === 0 && arguments.length === 1) {
  482. throw new TypeError("reduce of empty array with no initial value");
  483. }
  484. var i = 0;
  485. var result;
  486. if (arguments.length >= 2) {
  487. result = arguments[1];
  488. } else {
  489. do {
  490. if (i in self) {
  491. result = self[i++];
  492. break;
  493. }
  494. if (++i >= length) {
  495. throw new TypeError("reduce of empty array with no initial value");
  496. }
  497. } while (true);
  498. }
  499. for (; i < length; i++) {
  500. if (i in self) {
  501. result = callbackfn(result, self[i], i, object);
  502. }
  503. }
  504. return result;
  505. }
  506. }, !reduceCoercesToObject);
  507. var reduceRightCoercesToObject = false;
  508. if (ArrayPrototype.reduceRight) {
  509. reduceRightCoercesToObject = typeof ArrayPrototype.reduceRight.call("es5", function(_, __, ___, list) {
  510. return list;
  511. }) === "object";
  512. }
  513. defineProperties(ArrayPrototype, {
  514. reduceRight: function reduceRight(callbackfn) {
  515. var object = ES.ToObject(this);
  516. var self = splitString && isString(this) ? strSplit(this, "") : object;
  517. var length = ES.ToUint32(self.length);
  518. if (!isCallable(callbackfn)) {
  519. throw new TypeError("Array.prototype.reduceRight callback must be a function");
  520. }
  521. if (length === 0 && arguments.length === 1) {
  522. throw new TypeError("reduceRight of empty array with no initial value");
  523. }
  524. var result;
  525. var i = length - 1;
  526. if (arguments.length >= 2) {
  527. result = arguments[1];
  528. } else {
  529. do {
  530. if (i in self) {
  531. result = self[i--];
  532. break;
  533. }
  534. if (--i < 0) {
  535. throw new TypeError("reduceRight of empty array with no initial value");
  536. }
  537. } while (true);
  538. }
  539. if (i < 0) {
  540. return result;
  541. }
  542. do {
  543. if (i in self) {
  544. result = callbackfn(result, self[i], i, object);
  545. }
  546. } while (i--);
  547. return result;
  548. }
  549. }, !reduceRightCoercesToObject);
  550. var hasFirefox2IndexOfBug = ArrayPrototype.indexOf && [0, 1].indexOf(1, 2) !== -1;
  551. defineProperties(ArrayPrototype, {
  552. indexOf: function indexOf(searchElement) {
  553. var self = splitString && isString(this) ? strSplit(this, "") : ES.ToObject(this);
  554. var length = ES.ToUint32(self.length);
  555. if (length === 0) {
  556. return -1;
  557. }
  558. var i = 0;
  559. if (arguments.length > 1) {
  560. i = ES.ToInteger(arguments[1]);
  561. }
  562. i = i >= 0 ? i : max(0, length + i);
  563. for (; i < length; i++) {
  564. if (i in self && self[i] === searchElement) {
  565. return i;
  566. }
  567. }
  568. return -1;
  569. }
  570. }, hasFirefox2IndexOfBug);
  571. var hasFirefox2LastIndexOfBug = ArrayPrototype.lastIndexOf && [0, 1].lastIndexOf(0, -3) !== -1;
  572. defineProperties(ArrayPrototype, {
  573. lastIndexOf: function lastIndexOf(searchElement) {
  574. var self = splitString && isString(this) ? strSplit(this, "") : ES.ToObject(this);
  575. var length = ES.ToUint32(self.length);
  576. if (length === 0) {
  577. return -1;
  578. }
  579. var i = length - 1;
  580. if (arguments.length > 1) {
  581. i = min(i, ES.ToInteger(arguments[1]));
  582. }
  583. i = i >= 0 ? i : length - abs(i);
  584. for (; i >= 0; i--) {
  585. if (i in self && searchElement === self[i]) {
  586. return i;
  587. }
  588. }
  589. return -1;
  590. }
  591. }, hasFirefox2LastIndexOfBug);
  592. var spliceNoopReturnsEmptyArray = function() {
  593. var a = [1, 2];
  594. var result = a.splice();
  595. return a.length === 2 && isArray(result) && result.length === 0;
  596. }();
  597. defineProperties(ArrayPrototype, {
  598. // Safari 5.0 bug where .splice() returns undefined
  599. splice: function splice(start, deleteCount) {
  600. if (arguments.length === 0) {
  601. return [];
  602. }
  603. return array_splice.apply(this, arguments);
  604. }
  605. }, !spliceNoopReturnsEmptyArray);
  606. var spliceWorksWithEmptyObject = function() {
  607. var obj = {};
  608. ArrayPrototype.splice.call(obj, 0, 0, 1);
  609. return obj.length === 1;
  610. }();
  611. var hasES6Defaults = [0, 1, 2].splice(0).length === 3;
  612. defineProperties(ArrayPrototype, {
  613. splice: function splice(start, deleteCount) {
  614. if (arguments.length === 0) {
  615. return [];
  616. }
  617. var args = arguments;
  618. this.length = max(ES.ToInteger(this.length), 0);
  619. if (arguments.length > 0 && typeof deleteCount !== "number") {
  620. args = arraySlice(arguments);
  621. if (args.length < 2) {
  622. pushCall(args, this.length - start);
  623. } else {
  624. args[1] = ES.ToInteger(deleteCount);
  625. }
  626. }
  627. return array_splice.apply(this, args);
  628. }
  629. }, !spliceWorksWithEmptyObject || !hasES6Defaults);
  630. var spliceWorksWithLargeSparseArrays = function() {
  631. var arr = new $Array(1e5);
  632. arr[8] = "x";
  633. arr.splice(1, 1);
  634. return arr.indexOf("x") === 7;
  635. }();
  636. var spliceWorksWithSmallSparseArrays = function() {
  637. var n = 256;
  638. var arr = [];
  639. arr[n] = "a";
  640. arr.splice(n + 1, 0, "b");
  641. return arr[n] === "a";
  642. }();
  643. defineProperties(ArrayPrototype, {
  644. splice: function splice(start, deleteCount) {
  645. var O = ES.ToObject(this);
  646. var A = [];
  647. var len = ES.ToUint32(O.length);
  648. var relativeStart = ES.ToInteger(start);
  649. var actualStart = relativeStart < 0 ? max(len + relativeStart, 0) : min(relativeStart, len);
  650. var actualDeleteCount = arguments.length === 0 ? 0 : arguments.length === 1 ? len - actualStart : min(max(ES.ToInteger(deleteCount), 0), len - actualStart);
  651. var k = 0;
  652. var from;
  653. while (k < actualDeleteCount) {
  654. from = $String(actualStart + k);
  655. if (owns(O, from)) {
  656. A[k] = O[from];
  657. }
  658. k += 1;
  659. }
  660. var items = arraySlice(arguments, 2);
  661. var itemCount = items.length;
  662. var to;
  663. if (itemCount < actualDeleteCount) {
  664. k = actualStart;
  665. var maxK = len - actualDeleteCount;
  666. while (k < maxK) {
  667. from = $String(k + actualDeleteCount);
  668. to = $String(k + itemCount);
  669. if (owns(O, from)) {
  670. O[to] = O[from];
  671. } else {
  672. delete O[to];
  673. }
  674. k += 1;
  675. }
  676. k = len;
  677. var minK = len - actualDeleteCount + itemCount;
  678. while (k > minK) {
  679. delete O[k - 1];
  680. k -= 1;
  681. }
  682. } else if (itemCount > actualDeleteCount) {
  683. k = len - actualDeleteCount;
  684. while (k > actualStart) {
  685. from = $String(k + actualDeleteCount - 1);
  686. to = $String(k + itemCount - 1);
  687. if (owns(O, from)) {
  688. O[to] = O[from];
  689. } else {
  690. delete O[to];
  691. }
  692. k -= 1;
  693. }
  694. }
  695. k = actualStart;
  696. for (var i = 0; i < items.length; ++i) {
  697. O[k] = items[i];
  698. k += 1;
  699. }
  700. O.length = len - actualDeleteCount + itemCount;
  701. return A;
  702. }
  703. }, !spliceWorksWithLargeSparseArrays || !spliceWorksWithSmallSparseArrays);
  704. var originalJoin = ArrayPrototype.join;
  705. var hasStringJoinBug;
  706. try {
  707. hasStringJoinBug = Array.prototype.join.call("123", ",") !== "1,2,3";
  708. } catch (e) {
  709. hasStringJoinBug = true;
  710. }
  711. if (hasStringJoinBug) {
  712. defineProperties(ArrayPrototype, {
  713. join: function join(separator) {
  714. var sep = typeof separator === "undefined" ? "," : separator;
  715. return originalJoin.call(isString(this) ? strSplit(this, "") : this, sep);
  716. }
  717. }, hasStringJoinBug);
  718. }
  719. var hasJoinUndefinedBug = [1, 2].join(void 0) !== "1,2";
  720. if (hasJoinUndefinedBug) {
  721. defineProperties(ArrayPrototype, {
  722. join: function join(separator) {
  723. var sep = typeof separator === "undefined" ? "," : separator;
  724. return originalJoin.call(this, sep);
  725. }
  726. }, hasJoinUndefinedBug);
  727. }
  728. var pushShim = function push(item) {
  729. var O = ES.ToObject(this);
  730. var n = ES.ToUint32(O.length);
  731. var i = 0;
  732. while (i < arguments.length) {
  733. O[n + i] = arguments[i];
  734. i += 1;
  735. }
  736. O.length = n + i;
  737. return n + i;
  738. };
  739. var pushIsNotGeneric = function() {
  740. var obj = {};
  741. var result = Array.prototype.push.call(obj, void 0);
  742. return result !== 1 || obj.length !== 1 || typeof obj[0] !== "undefined" || !owns(obj, 0);
  743. }();
  744. defineProperties(ArrayPrototype, {
  745. push: function push(item) {
  746. if (isArray(this)) {
  747. return array_push.apply(this, arguments);
  748. }
  749. return pushShim.apply(this, arguments);
  750. }
  751. }, pushIsNotGeneric);
  752. var pushUndefinedIsWeird = function() {
  753. var arr = [];
  754. var result = arr.push(void 0);
  755. return result !== 1 || arr.length !== 1 || typeof arr[0] !== "undefined" || !owns(arr, 0);
  756. }();
  757. defineProperties(ArrayPrototype, { push: pushShim }, pushUndefinedIsWeird);
  758. defineProperties(ArrayPrototype, {
  759. slice: function(start, end) {
  760. var arr = isString(this) ? strSplit(this, "") : this;
  761. return arraySliceApply(arr, arguments);
  762. }
  763. }, splitString);
  764. var sortIgnoresNonFunctions = function() {
  765. try {
  766. [1, 2].sort(null);
  767. } catch (e) {
  768. try {
  769. [1, 2].sort({});
  770. } catch (e2) {
  771. return false;
  772. }
  773. }
  774. return true;
  775. }();
  776. var sortThrowsOnRegex = function() {
  777. try {
  778. [1, 2].sort(/a/);
  779. return false;
  780. } catch (e) {
  781. }
  782. return true;
  783. }();
  784. var sortIgnoresUndefined = function() {
  785. try {
  786. [1, 2].sort(void 0);
  787. return true;
  788. } catch (e) {
  789. }
  790. return false;
  791. }();
  792. defineProperties(ArrayPrototype, {
  793. sort: function sort(compareFn) {
  794. if (typeof compareFn === "undefined") {
  795. return arraySort(this);
  796. }
  797. if (!isCallable(compareFn)) {
  798. throw new TypeError("Array.prototype.sort callback must be a function");
  799. }
  800. return arraySort(this, compareFn);
  801. }
  802. }, sortIgnoresNonFunctions || !sortIgnoresUndefined || !sortThrowsOnRegex);
  803. var hasDontEnumBug = !isEnum({ "toString": null }, "toString");
  804. var hasProtoEnumBug = isEnum(function() {
  805. }, "prototype");
  806. var hasStringEnumBug = !owns("x", "0");
  807. var equalsConstructorPrototype = function(o) {
  808. var ctor = o.constructor;
  809. return ctor && ctor.prototype === o;
  810. };
  811. var excludedKeys = {
  812. $applicationCache: true,
  813. $console: true,
  814. $external: true,
  815. $frame: true,
  816. $frameElement: true,
  817. $frames: true,
  818. $innerHeight: true,
  819. $innerWidth: true,
  820. $onmozfullscreenchange: true,
  821. $onmozfullscreenerror: true,
  822. $outerHeight: true,
  823. $outerWidth: true,
  824. $pageXOffset: true,
  825. $pageYOffset: true,
  826. $parent: true,
  827. $scrollLeft: true,
  828. $scrollTop: true,
  829. $scrollX: true,
  830. $scrollY: true,
  831. $self: true,
  832. $webkitIndexedDB: true,
  833. $webkitStorageInfo: true,
  834. $window: true,
  835. $width: true,
  836. $height: true,
  837. $top: true,
  838. $localStorage: true
  839. };
  840. var hasAutomationEqualityBug = function() {
  841. if (typeof window === "undefined") {
  842. return false;
  843. }
  844. for (var k in window) {
  845. try {
  846. if (!excludedKeys["$" + k] && owns(window, k) && window[k] !== null && typeof window[k] === "object") {
  847. equalsConstructorPrototype(window[k]);
  848. }
  849. } catch (e) {
  850. return true;
  851. }
  852. }
  853. return false;
  854. }();
  855. var equalsConstructorPrototypeIfNotBuggy = function(object) {
  856. if (typeof window === "undefined" || !hasAutomationEqualityBug) {
  857. return equalsConstructorPrototype(object);
  858. }
  859. try {
  860. return equalsConstructorPrototype(object);
  861. } catch (e) {
  862. return false;
  863. }
  864. };
  865. var dontEnums = [
  866. "toString",
  867. "toLocaleString",
  868. "valueOf",
  869. "hasOwnProperty",
  870. "isPrototypeOf",
  871. "propertyIsEnumerable",
  872. "constructor"
  873. ];
  874. var dontEnumsLength = dontEnums.length;
  875. var isStandardArguments = function isArguments2(value) {
  876. return toStr(value) === "[object Arguments]";
  877. };
  878. var isLegacyArguments = function isArguments2(value) {
  879. return value !== null && typeof value === "object" && typeof value.length === "number" && value.length >= 0 && !isArray(value) && isCallable(value.callee);
  880. };
  881. var isArguments = isStandardArguments(arguments) ? isStandardArguments : isLegacyArguments;
  882. defineProperties($Object, {
  883. keys: function keys(object) {
  884. var isFn = isCallable(object);
  885. var isArgs = isArguments(object);
  886. var isObject = object !== null && typeof object === "object";
  887. var isStr = isObject && isString(object);
  888. if (!isObject && !isFn && !isArgs) {
  889. throw new TypeError("Object.keys called on a non-object");
  890. }
  891. var theKeys = [];
  892. var skipProto = hasProtoEnumBug && isFn;
  893. if (isStr && hasStringEnumBug || isArgs) {
  894. for (var i = 0; i < object.length; ++i) {
  895. pushCall(theKeys, $String(i));
  896. }
  897. }
  898. if (!isArgs) {
  899. for (var name in object) {
  900. if (!(skipProto && name === "prototype") && owns(object, name)) {
  901. pushCall(theKeys, $String(name));
  902. }
  903. }
  904. }
  905. if (hasDontEnumBug) {
  906. var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
  907. for (var j = 0; j < dontEnumsLength; j++) {
  908. var dontEnum = dontEnums[j];
  909. if (!(skipConstructor && dontEnum === "constructor") && owns(object, dontEnum)) {
  910. pushCall(theKeys, dontEnum);
  911. }
  912. }
  913. }
  914. return theKeys;
  915. }
  916. });
  917. var keysWorksWithArguments = $Object.keys && function() {
  918. return $Object.keys(arguments).length === 2;
  919. }(1, 2);
  920. var keysHasArgumentsLengthBug = $Object.keys && function() {
  921. var argKeys = $Object.keys(arguments);
  922. return arguments.length !== 1 || argKeys.length !== 1 || argKeys[0] !== 1;
  923. }(1);
  924. var originalKeys = $Object.keys;
  925. defineProperties($Object, {
  926. keys: function keys(object) {
  927. if (isArguments(object)) {
  928. return originalKeys(arraySlice(object));
  929. }
  930. return originalKeys(object);
  931. }
  932. }, !keysWorksWithArguments || keysHasArgumentsLengthBug);
  933. var hasNegativeMonthYearBug = (/* @__PURE__ */ new Date(-3509827329600292)).getUTCMonth() !== 0;
  934. var aNegativeTestDate = /* @__PURE__ */ new Date(-1509842289600292);
  935. var aPositiveTestDate = /* @__PURE__ */ new Date(14496624e5);
  936. var hasToUTCStringFormatBug = aNegativeTestDate.toUTCString() !== "Mon, 01 Jan -45875 11:59:59 GMT";
  937. var hasToDateStringFormatBug;
  938. var hasToStringFormatBug;
  939. var timeZoneOffset = aNegativeTestDate.getTimezoneOffset();
  940. if (timeZoneOffset < -720) {
  941. hasToDateStringFormatBug = aNegativeTestDate.toDateString() !== "Tue Jan 02 -45875";
  942. hasToStringFormatBug = !/^Thu Dec 10 2015 \d\d:\d\d:\d\d GMT[-+]\d\d\d\d(?: |$)/.test(String(aPositiveTestDate));
  943. } else {
  944. hasToDateStringFormatBug = aNegativeTestDate.toDateString() !== "Mon Jan 01 -45875";
  945. hasToStringFormatBug = !/^Wed Dec 09 2015 \d\d:\d\d:\d\d GMT[-+]\d\d\d\d(?: |$)/.test(String(aPositiveTestDate));
  946. }
  947. var originalGetFullYear = call.bind(Date.prototype.getFullYear);
  948. var originalGetMonth = call.bind(Date.prototype.getMonth);
  949. var originalGetDate = call.bind(Date.prototype.getDate);
  950. var originalGetUTCFullYear = call.bind(Date.prototype.getUTCFullYear);
  951. var originalGetUTCMonth = call.bind(Date.prototype.getUTCMonth);
  952. var originalGetUTCDate = call.bind(Date.prototype.getUTCDate);
  953. var originalGetUTCDay = call.bind(Date.prototype.getUTCDay);
  954. var originalGetUTCHours = call.bind(Date.prototype.getUTCHours);
  955. var originalGetUTCMinutes = call.bind(Date.prototype.getUTCMinutes);
  956. var originalGetUTCSeconds = call.bind(Date.prototype.getUTCSeconds);
  957. var originalGetUTCMilliseconds = call.bind(Date.prototype.getUTCMilliseconds);
  958. var dayName = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
  959. var monthName = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
  960. var daysInMonth = function daysInMonth2(month, year) {
  961. return originalGetDate(new Date(year, month, 0));
  962. };
  963. defineProperties(Date.prototype, {
  964. getFullYear: function getFullYear() {
  965. if (!this || !(this instanceof Date)) {
  966. throw new TypeError("this is not a Date object.");
  967. }
  968. var year = originalGetFullYear(this);
  969. if (year < 0 && originalGetMonth(this) > 11) {
  970. return year + 1;
  971. }
  972. return year;
  973. },
  974. getMonth: function getMonth() {
  975. if (!this || !(this instanceof Date)) {
  976. throw new TypeError("this is not a Date object.");
  977. }
  978. var year = originalGetFullYear(this);
  979. var month = originalGetMonth(this);
  980. if (year < 0 && month > 11) {
  981. return 0;
  982. }
  983. return month;
  984. },
  985. getDate: function getDate() {
  986. if (!this || !(this instanceof Date)) {
  987. throw new TypeError("this is not a Date object.");
  988. }
  989. var year = originalGetFullYear(this);
  990. var month = originalGetMonth(this);
  991. var date = originalGetDate(this);
  992. if (year < 0 && month > 11) {
  993. if (month === 12) {
  994. return date;
  995. }
  996. var days = daysInMonth(0, year + 1);
  997. return days - date + 1;
  998. }
  999. return date;
  1000. },
  1001. getUTCFullYear: function getUTCFullYear() {
  1002. if (!this || !(this instanceof Date)) {
  1003. throw new TypeError("this is not a Date object.");
  1004. }
  1005. var year = originalGetUTCFullYear(this);
  1006. if (year < 0 && originalGetUTCMonth(this) > 11) {
  1007. return year + 1;
  1008. }
  1009. return year;
  1010. },
  1011. getUTCMonth: function getUTCMonth() {
  1012. if (!this || !(this instanceof Date)) {
  1013. throw new TypeError("this is not a Date object.");
  1014. }
  1015. var year = originalGetUTCFullYear(this);
  1016. var month = originalGetUTCMonth(this);
  1017. if (year < 0 && month > 11) {
  1018. return 0;
  1019. }
  1020. return month;
  1021. },
  1022. getUTCDate: function getUTCDate() {
  1023. if (!this || !(this instanceof Date)) {
  1024. throw new TypeError("this is not a Date object.");
  1025. }
  1026. var year = originalGetUTCFullYear(this);
  1027. var month = originalGetUTCMonth(this);
  1028. var date = originalGetUTCDate(this);
  1029. if (year < 0 && month > 11) {
  1030. if (month === 12) {
  1031. return date;
  1032. }
  1033. var days = daysInMonth(0, year + 1);
  1034. return days - date + 1;
  1035. }
  1036. return date;
  1037. }
  1038. }, hasNegativeMonthYearBug);
  1039. defineProperties(Date.prototype, {
  1040. toUTCString: function toUTCString() {
  1041. if (!this || !(this instanceof Date)) {
  1042. throw new TypeError("this is not a Date object.");
  1043. }
  1044. var day = originalGetUTCDay(this);
  1045. var date = originalGetUTCDate(this);
  1046. var month = originalGetUTCMonth(this);
  1047. var year = originalGetUTCFullYear(this);
  1048. var hour = originalGetUTCHours(this);
  1049. var minute = originalGetUTCMinutes(this);
  1050. var second = originalGetUTCSeconds(this);
  1051. return dayName[day] + ", " + (date < 10 ? "0" + date : date) + " " + monthName[month] + " " + year + " " + (hour < 10 ? "0" + hour : hour) + ":" + (minute < 10 ? "0" + minute : minute) + ":" + (second < 10 ? "0" + second : second) + " GMT";
  1052. }
  1053. }, hasNegativeMonthYearBug || hasToUTCStringFormatBug);
  1054. defineProperties(Date.prototype, {
  1055. toDateString: function toDateString() {
  1056. if (!this || !(this instanceof Date)) {
  1057. throw new TypeError("this is not a Date object.");
  1058. }
  1059. var day = this.getDay();
  1060. var date = this.getDate();
  1061. var month = this.getMonth();
  1062. var year = this.getFullYear();
  1063. return dayName[day] + " " + monthName[month] + " " + (date < 10 ? "0" + date : date) + " " + year;
  1064. }
  1065. }, hasNegativeMonthYearBug || hasToDateStringFormatBug);
  1066. if (hasNegativeMonthYearBug || hasToStringFormatBug) {
  1067. Date.prototype.toString = function toString() {
  1068. if (!this || !(this instanceof Date)) {
  1069. throw new TypeError("this is not a Date object.");
  1070. }
  1071. var day = this.getDay();
  1072. var date = this.getDate();
  1073. var month = this.getMonth();
  1074. var year = this.getFullYear();
  1075. var hour = this.getHours();
  1076. var minute = this.getMinutes();
  1077. var second = this.getSeconds();
  1078. var timezoneOffset = this.getTimezoneOffset();
  1079. var hoursOffset = floor(abs(timezoneOffset) / 60);
  1080. var minutesOffset = floor(abs(timezoneOffset) % 60);
  1081. return dayName[day] + " " + monthName[month] + " " + (date < 10 ? "0" + date : date) + " " + year + " " + (hour < 10 ? "0" + hour : hour) + ":" + (minute < 10 ? "0" + minute : minute) + ":" + (second < 10 ? "0" + second : second) + " GMT" + (timezoneOffset > 0 ? "-" : "+") + (hoursOffset < 10 ? "0" + hoursOffset : hoursOffset) + (minutesOffset < 10 ? "0" + minutesOffset : minutesOffset);
  1082. };
  1083. if (supportsDescriptors) {
  1084. $Object.defineProperty(Date.prototype, "toString", {
  1085. configurable: true,
  1086. enumerable: false,
  1087. writable: true
  1088. });
  1089. }
  1090. }
  1091. var negativeDate = -621987552e5;
  1092. var negativeYearString = "-000001";
  1093. var hasNegativeDateBug = Date.prototype.toISOString && new Date(negativeDate).toISOString().indexOf(negativeYearString) === -1;
  1094. var hasSafari51DateBug = Date.prototype.toISOString && (/* @__PURE__ */ new Date(-1)).toISOString() !== "1969-12-31T23:59:59.999Z";
  1095. var getTime = call.bind(Date.prototype.getTime);
  1096. defineProperties(Date.prototype, {
  1097. toISOString: function toISOString() {
  1098. if (!isFinite(this) || !isFinite(getTime(this))) {
  1099. throw new RangeError("Date.prototype.toISOString called on non-finite value.");
  1100. }
  1101. var year = originalGetUTCFullYear(this);
  1102. var month = originalGetUTCMonth(this);
  1103. year += floor(month / 12);
  1104. month = (month % 12 + 12) % 12;
  1105. var result = [
  1106. month + 1,
  1107. originalGetUTCDate(this),
  1108. originalGetUTCHours(this),
  1109. originalGetUTCMinutes(this),
  1110. originalGetUTCSeconds(this)
  1111. ];
  1112. year = (year < 0 ? "-" : year > 9999 ? "+" : "") + strSlice("00000" + abs(year), 0 <= year && year <= 9999 ? -4 : -6);
  1113. for (var i = 0; i < result.length; ++i) {
  1114. result[i] = strSlice("00" + result[i], -2);
  1115. }
  1116. return year + "-" + arraySlice(result, 0, 2).join("-") + "T" + arraySlice(result, 2).join(":") + "." + strSlice("000" + originalGetUTCMilliseconds(this), -3) + "Z";
  1117. }
  1118. }, hasNegativeDateBug || hasSafari51DateBug);
  1119. var dateToJSONIsSupported = function() {
  1120. try {
  1121. return Date.prototype.toJSON && (/* @__PURE__ */ new Date(NaN)).toJSON() === null && new Date(negativeDate).toJSON().indexOf(negativeYearString) !== -1 && Date.prototype.toJSON.call({
  1122. // generic
  1123. toISOString: function() {
  1124. return true;
  1125. }
  1126. });
  1127. } catch (e) {
  1128. return false;
  1129. }
  1130. }();
  1131. if (!dateToJSONIsSupported) {
  1132. Date.prototype.toJSON = function toJSON(key) {
  1133. var O = $Object(this);
  1134. var tv = ES.ToPrimitive(O);
  1135. if (typeof tv === "number" && !isFinite(tv)) {
  1136. return null;
  1137. }
  1138. var toISO = O.toISOString;
  1139. if (!isCallable(toISO)) {
  1140. throw new TypeError("toISOString property is not callable");
  1141. }
  1142. return toISO.call(O);
  1143. };
  1144. }
  1145. var supportsExtendedYears = Date.parse("+033658-09-27T01:46:40.000Z") === 1e15;
  1146. var acceptsInvalidDates = !isNaN(Date.parse("2012-04-04T24:00:00.500Z")) || !isNaN(Date.parse("2012-11-31T23:59:59.000Z")) || !isNaN(Date.parse("2012-12-31T23:59:60.000Z"));
  1147. var doesNotParseY2KNewYear = isNaN(Date.parse("2000-01-01T00:00:00.000Z"));
  1148. if (doesNotParseY2KNewYear || acceptsInvalidDates || !supportsExtendedYears) {
  1149. var maxSafeUnsigned32Bit = pow(2, 31) - 1;
  1150. var hasSafariSignedIntBug = isActualNaN(new Date(1970, 0, 1, 0, 0, 0, maxSafeUnsigned32Bit + 1).getTime());
  1151. Date = function(NativeDate) {
  1152. var DateShim = function Date2(Y, M, D, h, m, s, ms) {
  1153. var length = arguments.length;
  1154. var date;
  1155. if (this instanceof NativeDate) {
  1156. var seconds = s;
  1157. var millis = ms;
  1158. if (hasSafariSignedIntBug && length >= 7 && ms > maxSafeUnsigned32Bit) {
  1159. var msToShift = floor(ms / maxSafeUnsigned32Bit) * maxSafeUnsigned32Bit;
  1160. var sToShift = floor(msToShift / 1e3);
  1161. seconds += sToShift;
  1162. millis -= sToShift * 1e3;
  1163. }
  1164. var parsed = DateShim.parse(Y);
  1165. var hasNegTimestampParseBug = isNaN(parsed);
  1166. date = length === 1 && $String(Y) === Y && !hasNegTimestampParseBug ? new NativeDate(parsed) : length >= 7 ? new NativeDate(Y, M, D, h, m, seconds, millis) : length >= 6 ? new NativeDate(Y, M, D, h, m, seconds) : length >= 5 ? new NativeDate(Y, M, D, h, m) : length >= 4 ? new NativeDate(Y, M, D, h) : length >= 3 ? new NativeDate(Y, M, D) : length >= 2 ? new NativeDate(Y, M) : length >= 1 ? new NativeDate(Y instanceof NativeDate ? +Y : Y) : new NativeDate();
  1167. } else {
  1168. date = NativeDate.apply(this, arguments);
  1169. }
  1170. if (!isPrimitive(date)) {
  1171. defineProperties(date, { constructor: DateShim }, true);
  1172. }
  1173. return date;
  1174. };
  1175. var isoDateExpression = new RegExp("^(\\d{4}|[+-]\\d{6})(?:-(\\d{2})(?:-(\\d{2})(?:T(\\d{2}):(\\d{2})(?::(\\d{2})(?:(\\.\\d{1,}))?)?(Z|(?:([-+])(\\d{2}):(\\d{2})))?)?)?)?$");
  1176. var months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365];
  1177. var dayFromMonth = function dayFromMonth2(year, month) {
  1178. var t = month > 1 ? 1 : 0;
  1179. return months[month] + floor((year - 1969 + t) / 4) - floor((year - 1901 + t) / 100) + floor((year - 1601 + t) / 400) + 365 * (year - 1970);
  1180. };
  1181. var toUTC = function toUTC2(t) {
  1182. var s = 0;
  1183. var ms = t;
  1184. if (hasSafariSignedIntBug && ms > maxSafeUnsigned32Bit) {
  1185. var msToShift = floor(ms / maxSafeUnsigned32Bit) * maxSafeUnsigned32Bit;
  1186. var sToShift = floor(msToShift / 1e3);
  1187. s += sToShift;
  1188. ms -= sToShift * 1e3;
  1189. }
  1190. return $Number(new NativeDate(1970, 0, 1, 0, 0, s, ms));
  1191. };
  1192. for (var key in NativeDate) {
  1193. if (owns(NativeDate, key)) {
  1194. DateShim[key] = NativeDate[key];
  1195. }
  1196. }
  1197. defineProperties(DateShim, {
  1198. now: NativeDate.now,
  1199. UTC: NativeDate.UTC
  1200. }, true);
  1201. DateShim.prototype = NativeDate.prototype;
  1202. defineProperties(DateShim.prototype, { constructor: DateShim }, true);
  1203. var parseShim = function parse(string) {
  1204. var match = isoDateExpression.exec(string);
  1205. if (match) {
  1206. var year = $Number(match[1]), month = $Number(match[2] || 1) - 1, day = $Number(match[3] || 1) - 1, hour = $Number(match[4] || 0), minute = $Number(match[5] || 0), second = $Number(match[6] || 0), millisecond = floor($Number(match[7] || 0) * 1e3), isLocalTime = Boolean(match[4] && !match[8]), signOffset = match[9] === "-" ? 1 : -1, hourOffset = $Number(match[10] || 0), minuteOffset = $Number(match[11] || 0), result;
  1207. var hasMinutesOrSecondsOrMilliseconds = minute > 0 || second > 0 || millisecond > 0;
  1208. if (hour < (hasMinutesOrSecondsOrMilliseconds ? 24 : 25) && minute < 60 && second < 60 && millisecond < 1e3 && month > -1 && month < 12 && hourOffset < 24 && minuteOffset < 60 && day > -1 && day < dayFromMonth(year, month + 1) - dayFromMonth(year, month)) {
  1209. result = ((dayFromMonth(year, month) + day) * 24 + hour + hourOffset * signOffset) * 60;
  1210. result = ((result + minute + minuteOffset * signOffset) * 60 + second) * 1e3 + millisecond;
  1211. if (isLocalTime) {
  1212. result = toUTC(result);
  1213. }
  1214. if (-864e13 <= result && result <= 864e13) {
  1215. return result;
  1216. }
  1217. }
  1218. return NaN;
  1219. }
  1220. return NativeDate.parse.apply(this, arguments);
  1221. };
  1222. defineProperties(DateShim, { parse: parseShim });
  1223. return DateShim;
  1224. }(Date);
  1225. }
  1226. if (!Date.now) {
  1227. Date.now = function now() {
  1228. return (/* @__PURE__ */ new Date()).getTime();
  1229. };
  1230. }
  1231. var hasToFixedBugs = NumberPrototype.toFixed && (8e-5.toFixed(3) !== "0.000" || 0.9.toFixed(0) !== "1" || 1.255.toFixed(2) !== "1.25" || 1000000000000000100 .toFixed(0) !== "1000000000000000128");
  1232. var toFixedHelpers = {
  1233. base: 1e7,
  1234. size: 6,
  1235. data: [0, 0, 0, 0, 0, 0],
  1236. multiply: function multiply(n, c) {
  1237. var i = -1;
  1238. var c2 = c;
  1239. while (++i < toFixedHelpers.size) {
  1240. c2 += n * toFixedHelpers.data[i];
  1241. toFixedHelpers.data[i] = c2 % toFixedHelpers.base;
  1242. c2 = floor(c2 / toFixedHelpers.base);
  1243. }
  1244. },
  1245. divide: function divide(n) {
  1246. var i = toFixedHelpers.size;
  1247. var c = 0;
  1248. while (--i >= 0) {
  1249. c += toFixedHelpers.data[i];
  1250. toFixedHelpers.data[i] = floor(c / n);
  1251. c = c % n * toFixedHelpers.base;
  1252. }
  1253. },
  1254. numToString: function numToString() {
  1255. var i = toFixedHelpers.size;
  1256. var s = "";
  1257. while (--i >= 0) {
  1258. if (s !== "" || i === 0 || toFixedHelpers.data[i] !== 0) {
  1259. var t = $String(toFixedHelpers.data[i]);
  1260. if (s === "") {
  1261. s = t;
  1262. } else {
  1263. s += strSlice("0000000", 0, 7 - t.length) + t;
  1264. }
  1265. }
  1266. }
  1267. return s;
  1268. },
  1269. pow: function pow2(x, n, acc) {
  1270. return n === 0 ? acc : n % 2 === 1 ? pow2(x, n - 1, acc * x) : pow2(x * x, n / 2, acc);
  1271. },
  1272. log: function log2(x) {
  1273. var n = 0;
  1274. var x2 = x;
  1275. while (x2 >= 4096) {
  1276. n += 12;
  1277. x2 /= 4096;
  1278. }
  1279. while (x2 >= 2) {
  1280. n += 1;
  1281. x2 /= 2;
  1282. }
  1283. return n;
  1284. }
  1285. };
  1286. var toFixedShim = function toFixed(fractionDigits) {
  1287. var f, x, s, m, e, z, j, k;
  1288. f = $Number(fractionDigits);
  1289. f = isActualNaN(f) ? 0 : floor(f);
  1290. if (f < 0 || f > 20) {
  1291. throw new RangeError("Number.toFixed called with invalid number of decimals");
  1292. }
  1293. x = $Number(this);
  1294. if (isActualNaN(x)) {
  1295. return "NaN";
  1296. }
  1297. if (x <= -1e21 || x >= 1e21) {
  1298. return $String(x);
  1299. }
  1300. s = "";
  1301. if (x < 0) {
  1302. s = "-";
  1303. x = -x;
  1304. }
  1305. m = "0";
  1306. if (x > 1e-21) {
  1307. e = toFixedHelpers.log(x * toFixedHelpers.pow(2, 69, 1)) - 69;
  1308. z = e < 0 ? x * toFixedHelpers.pow(2, -e, 1) : x / toFixedHelpers.pow(2, e, 1);
  1309. z *= 4503599627370496;
  1310. e = 52 - e;
  1311. if (e > 0) {
  1312. toFixedHelpers.multiply(0, z);
  1313. j = f;
  1314. while (j >= 7) {
  1315. toFixedHelpers.multiply(1e7, 0);
  1316. j -= 7;
  1317. }
  1318. toFixedHelpers.multiply(toFixedHelpers.pow(10, j, 1), 0);
  1319. j = e - 1;
  1320. while (j >= 23) {
  1321. toFixedHelpers.divide(1 << 23);
  1322. j -= 23;
  1323. }
  1324. toFixedHelpers.divide(1 << j);
  1325. toFixedHelpers.multiply(1, 1);
  1326. toFixedHelpers.divide(2);
  1327. m = toFixedHelpers.numToString();
  1328. } else {
  1329. toFixedHelpers.multiply(0, z);
  1330. toFixedHelpers.multiply(1 << -e, 0);
  1331. m = toFixedHelpers.numToString() + strSlice("0.00000000000000000000", 2, 2 + f);
  1332. }
  1333. }
  1334. if (f > 0) {
  1335. k = m.length;
  1336. if (k <= f) {
  1337. m = s + strSlice("0.0000000000000000000", 0, f - k + 2) + m;
  1338. } else {
  1339. m = s + strSlice(m, 0, k - f) + "." + strSlice(m, k - f);
  1340. }
  1341. } else {
  1342. m = s + m;
  1343. }
  1344. return m;
  1345. };
  1346. defineProperties(NumberPrototype, { toFixed: toFixedShim }, hasToFixedBugs);
  1347. var hasToExponentialRoundingBug = function() {
  1348. try {
  1349. return (-69e-12).toExponential(4) !== "-6.9000e-11";
  1350. } catch (e) {
  1351. return false;
  1352. }
  1353. }();
  1354. var toExponentialAllowsInfiniteDigits = function() {
  1355. try {
  1356. 1 .toExponential(Infinity);
  1357. 1 .toExponential(-Infinity);
  1358. return true;
  1359. } catch (e) {
  1360. return false;
  1361. }
  1362. }();
  1363. var originalToExponential = call.bind(NumberPrototype.toExponential);
  1364. var numberToString = call.bind(NumberPrototype.toString);
  1365. var numberValueOf = call.bind(NumberPrototype.valueOf);
  1366. defineProperties(NumberPrototype, {
  1367. toExponential: function toExponential(fractionDigits) {
  1368. var x = numberValueOf(this);
  1369. if (typeof fractionDigits === "undefined") {
  1370. return originalToExponential(x);
  1371. }
  1372. var f = ES.ToInteger(fractionDigits);
  1373. if (isActualNaN(x)) {
  1374. return "NaN";
  1375. }
  1376. if (f < 0 || f > 20) {
  1377. if (!isFinite(f)) {
  1378. throw new RangeError("toExponential() argument must be between 0 and 20");
  1379. }
  1380. return originalToExponential(x, f);
  1381. }
  1382. var s = "";
  1383. if (x < 0) {
  1384. s = "-";
  1385. x = -x;
  1386. }
  1387. if (x === Infinity) {
  1388. return s + "Infinity";
  1389. }
  1390. if (typeof fractionDigits !== "undefined" && (f < 0 || f > 20)) {
  1391. throw new RangeError("Fraction digits " + fractionDigits + " out of range");
  1392. }
  1393. var m = "";
  1394. var e = 0;
  1395. var c = "";
  1396. var d = "";
  1397. if (x === 0) {
  1398. e = 0;
  1399. f = 0;
  1400. m = "0";
  1401. } else {
  1402. var L = log10(x);
  1403. e = floor(L);
  1404. var n = 0;
  1405. if (typeof fractionDigits !== "undefined") {
  1406. var w = pow(10, e - f);
  1407. n = round(x / w);
  1408. if (2 * x >= (2 * n + 1) * w) {
  1409. n += 1;
  1410. }
  1411. if (n >= pow(10, f + 1)) {
  1412. n /= 10;
  1413. e += 1;
  1414. }
  1415. } else {
  1416. f = 16;
  1417. var guess_n = round(pow(10, L - e + f));
  1418. var target_f = f;
  1419. while (f-- > 0) {
  1420. guess_n = round(pow(10, L - e + f));
  1421. if (abs(guess_n * pow(10, e - f) - x) <= abs(n * pow(10, e - target_f) - x)) {
  1422. target_f = f;
  1423. n = guess_n;
  1424. }
  1425. }
  1426. }
  1427. m = numberToString(n, 10);
  1428. if (typeof fractionDigits === "undefined") {
  1429. while (strSlice(m, -1) === "0") {
  1430. m = strSlice(m, 0, -1);
  1431. d += 1;
  1432. }
  1433. }
  1434. }
  1435. if (f !== 0) {
  1436. m = strSlice(m, 0, 1) + "." + strSlice(m, 1);
  1437. }
  1438. if (e === 0) {
  1439. c = "+";
  1440. d = "0";
  1441. } else {
  1442. c = e > 0 ? "+" : "-";
  1443. d = numberToString(abs(e), 10);
  1444. }
  1445. m += "e" + c + d;
  1446. return s + m;
  1447. }
  1448. }, hasToExponentialRoundingBug || toExponentialAllowsInfiniteDigits);
  1449. var hasToPrecisionUndefinedBug = function() {
  1450. try {
  1451. return 1 .toPrecision(void 0) === "1";
  1452. } catch (e) {
  1453. return true;
  1454. }
  1455. }();
  1456. var originalToPrecision = call.bind(NumberPrototype.toPrecision);
  1457. defineProperties(NumberPrototype, {
  1458. toPrecision: function toPrecision(precision) {
  1459. return typeof precision === "undefined" ? originalToPrecision(this) : originalToPrecision(this, precision);
  1460. }
  1461. }, hasToPrecisionUndefinedBug);
  1462. if ("ab".split(/(?:ab)*/).length !== 2 || ".".split(/(.?)(.?)/).length !== 4 || "tesst".split(/(s)*/)[1] === "t" || "test".split(/(?:)/, -1).length !== 4 || "".split(/.?/).length || ".".split(/()()/).length > 1) {
  1463. (function() {
  1464. var compliantExecNpcg = typeof /()??/.exec("")[1] === "undefined";
  1465. var maxSafe32BitInt = pow(2, 32) - 1;
  1466. StringPrototype.split = function split(separator, limit) {
  1467. var string = String(this);
  1468. if (typeof separator === "undefined" && limit === 0) {
  1469. return [];
  1470. }
  1471. if (!isRegex(separator)) {
  1472. return strSplit(this, separator, limit);
  1473. }
  1474. var output = [];
  1475. var flags = (separator.ignoreCase ? "i" : "") + (separator.multiline ? "m" : "") + (separator.unicode ? "u" : "") + (separator.sticky ? "y" : ""), lastLastIndex = 0, separator2, match, lastIndex, lastLength;
  1476. var separatorCopy = new RegExp(separator.source, flags + "g");
  1477. if (!compliantExecNpcg) {
  1478. separator2 = new RegExp("^" + separatorCopy.source + "$(?!\\s)", flags);
  1479. }
  1480. var splitLimit = typeof limit === "undefined" ? maxSafe32BitInt : ES.ToUint32(limit);
  1481. match = separatorCopy.exec(string);
  1482. while (match) {
  1483. lastIndex = match.index + match[0].length;
  1484. if (lastIndex > lastLastIndex) {
  1485. pushCall(output, strSlice(string, lastLastIndex, match.index));
  1486. if (!compliantExecNpcg && match.length > 1) {
  1487. match[0].replace(separator2, function() {
  1488. for (var i = 1; i < arguments.length - 2; i++) {
  1489. if (typeof arguments[i] === "undefined") {
  1490. match[i] = void 0;
  1491. }
  1492. }
  1493. });
  1494. }
  1495. if (match.length > 1 && match.index < string.length) {
  1496. array_push.apply(output, arraySlice(match, 1));
  1497. }
  1498. lastLength = match[0].length;
  1499. lastLastIndex = lastIndex;
  1500. if (output.length >= splitLimit) {
  1501. break;
  1502. }
  1503. }
  1504. if (separatorCopy.lastIndex === match.index) {
  1505. separatorCopy.lastIndex++;
  1506. }
  1507. match = separatorCopy.exec(string);
  1508. }
  1509. if (lastLastIndex === string.length) {
  1510. if (lastLength || !separatorCopy.test("")) {
  1511. pushCall(output, "");
  1512. }
  1513. } else {
  1514. pushCall(output, strSlice(string, lastLastIndex));
  1515. }
  1516. return output.length > splitLimit ? arraySlice(output, 0, splitLimit) : output;
  1517. };
  1518. })();
  1519. } else if ("0".split(void 0, 0).length) {
  1520. StringPrototype.split = function split(separator, limit) {
  1521. if (typeof separator === "undefined" && limit === 0) {
  1522. return [];
  1523. }
  1524. return strSplit(this, separator, limit);
  1525. };
  1526. }
  1527. var str_replace = StringPrototype.replace;
  1528. var replaceReportsGroupsCorrectly = function() {
  1529. var groups = [];
  1530. "x".replace(/x(.)?/g, function(match, group) {
  1531. pushCall(groups, group);
  1532. });
  1533. return groups.length === 1 && typeof groups[0] === "undefined";
  1534. }();
  1535. if (!replaceReportsGroupsCorrectly) {
  1536. StringPrototype.replace = function replace(searchValue, replaceValue) {
  1537. var isFn = isCallable(replaceValue);
  1538. var hasCapturingGroups = isRegex(searchValue) && /\)[*?]/.test(searchValue.source);
  1539. if (!isFn || !hasCapturingGroups) {
  1540. return str_replace.call(this, searchValue, replaceValue);
  1541. }
  1542. var wrappedReplaceValue = function(match) {
  1543. var length = arguments.length;
  1544. var originalLastIndex = searchValue.lastIndex;
  1545. searchValue.lastIndex = 0;
  1546. var args = searchValue.exec(match) || [];
  1547. searchValue.lastIndex = originalLastIndex;
  1548. pushCall(args, arguments[length - 2], arguments[length - 1]);
  1549. return replaceValue.apply(this, args);
  1550. };
  1551. return str_replace.call(this, searchValue, wrappedReplaceValue);
  1552. };
  1553. }
  1554. var hasNegativeSubstrBug = "".substr && "0b".substr(-1) !== "b";
  1555. var string_substr = hasNegativeSubstrBug && call.bind(StringPrototype.substr);
  1556. defineProperties(StringPrototype, {
  1557. substr: function substr(start, length) {
  1558. var normalizedStart = start;
  1559. if (start < 0) {
  1560. normalizedStart = max(this.length + start, 0);
  1561. }
  1562. return string_substr(this, normalizedStart, length);
  1563. }
  1564. }, hasNegativeSubstrBug);
  1565. var mvs = "᠎";
  1566. var mvsIsWS = /\s/.test(mvs);
  1567. var ws = " \n\v\f\r   ᠎              \u2028\u2029\uFEFF".replace(/\S/g, "");
  1568. var zeroWidth = "​";
  1569. var wsRegexChars = "[" + ws + "]";
  1570. var trimBeginRegexp = new RegExp("^" + wsRegexChars + wsRegexChars + "*");
  1571. var trimEndRegexp = new RegExp(wsRegexChars + wsRegexChars + "*$");
  1572. var hasTrimWhitespaceBug = StringPrototype.trim && (ws.trim() !== "" || zeroWidth.trim() === "" || mvs.trim() !== (mvsIsWS ? "" : mvs));
  1573. defineProperties(StringPrototype, {
  1574. // https://blog.stevenlevithan.com/archives/faster-trim-javascript
  1575. // http://perfectionkills.com/whitespace-deviations/
  1576. trim: function trim2() {
  1577. "use strict";
  1578. if (typeof this === "undefined" || this === null) {
  1579. throw new TypeError("can't convert " + this + " to object");
  1580. }
  1581. return $String(this).replace(trimBeginRegexp, "").replace(trimEndRegexp, "");
  1582. }
  1583. }, hasTrimWhitespaceBug);
  1584. var trim = call.bind(String.prototype.trim);
  1585. var hasLastIndexBug = StringPrototype.lastIndexOf && "abcあい".lastIndexOf("あい", 2) !== -1;
  1586. defineProperties(StringPrototype, {
  1587. lastIndexOf: function lastIndexOf(searchString) {
  1588. if (typeof this === "undefined" || this === null) {
  1589. throw new TypeError("can't convert " + this + " to object");
  1590. }
  1591. var S = $String(this);
  1592. var searchStr = $String(searchString);
  1593. var numPos = arguments.length > 1 ? $Number(arguments[1]) : NaN;
  1594. var pos = isActualNaN(numPos) ? Infinity : ES.ToInteger(numPos);
  1595. var start = min(max(pos, 0), S.length);
  1596. var searchLen = searchStr.length;
  1597. var k = start + searchLen;
  1598. while (k > 0) {
  1599. k = max(0, k - searchLen);
  1600. var index = strIndexOf(strSlice(S, k, start + searchLen), searchStr);
  1601. if (index !== -1) {
  1602. return k + index;
  1603. }
  1604. }
  1605. return -1;
  1606. }
  1607. }, hasLastIndexBug);
  1608. var originalLastIndexOf = StringPrototype.lastIndexOf;
  1609. defineProperties(StringPrototype, {
  1610. lastIndexOf: function lastIndexOf(searchString) {
  1611. return originalLastIndexOf.apply(this, arguments);
  1612. }
  1613. }, StringPrototype.lastIndexOf.length !== 1);
  1614. var hexRegex = /^[-+]?0[xX]/;
  1615. if (parseInt(ws + "08") !== 8 || parseInt(ws + "0x16") !== 22 || (mvsIsWS ? parseInt(mvs + 1) !== 1 : !isNaN(parseInt(mvs + 1)))) {
  1616. parseInt = function(origParseInt) {
  1617. return function parseInt2(str, radix) {
  1618. if (this instanceof parseInt2) {
  1619. new origParseInt();
  1620. }
  1621. var string = trim(String(str));
  1622. var defaultedRadix = $Number(radix) || (hexRegex.test(string) ? 16 : 10);
  1623. return origParseInt(string, defaultedRadix);
  1624. };
  1625. }(parseInt);
  1626. }
  1627. var parseIntFailsToThrowOnBoxedSymbols = function() {
  1628. if (typeof Symbol !== "function") {
  1629. return false;
  1630. }
  1631. try {
  1632. parseInt(Object(Symbol.iterator));
  1633. return true;
  1634. } catch (e) {
  1635. }
  1636. try {
  1637. parseInt(Symbol.iterator);
  1638. return true;
  1639. } catch (e) {
  1640. }
  1641. return false;
  1642. }();
  1643. if (parseIntFailsToThrowOnBoxedSymbols) {
  1644. var symbolValueOf = Symbol.prototype.valueOf;
  1645. parseInt = function(origParseInt) {
  1646. return function parseInt2(str, radix) {
  1647. if (this instanceof parseInt2) {
  1648. new origParseInt();
  1649. }
  1650. var isSym = typeof str === "symbol";
  1651. if (!isSym && str && typeof str === "object") {
  1652. try {
  1653. symbolValueOf.call(str);
  1654. isSym = true;
  1655. } catch (e) {
  1656. }
  1657. }
  1658. if (isSym) {
  1659. "" + str;
  1660. }
  1661. var string = trim(String(str));
  1662. var defaultedRadix = $Number(radix) || (hexRegex.test(string) ? 16 : 10);
  1663. return origParseInt(string, defaultedRadix);
  1664. };
  1665. }(parseInt);
  1666. }
  1667. if (1 / parseFloat("-0") !== -Infinity) {
  1668. parseFloat = function(origParseFloat) {
  1669. return function parseFloat2(string) {
  1670. var inputString = trim(String(string));
  1671. var result = origParseFloat(inputString);
  1672. return result === 0 && strSlice(inputString, 0, 1) === "-" ? -0 : result;
  1673. };
  1674. }(parseFloat);
  1675. }
  1676. if (String(new RangeError("test")) !== "RangeError: test") {
  1677. var errorToStringShim = function toString() {
  1678. if (typeof this === "undefined" || this === null) {
  1679. throw new TypeError("can't convert " + this + " to object");
  1680. }
  1681. var name = this.name;
  1682. if (typeof name === "undefined") {
  1683. name = "Error";
  1684. } else if (typeof name !== "string") {
  1685. name = $String(name);
  1686. }
  1687. var msg = this.message;
  1688. if (typeof msg === "undefined") {
  1689. msg = "";
  1690. } else if (typeof msg !== "string") {
  1691. msg = $String(msg);
  1692. }
  1693. if (!name) {
  1694. return msg;
  1695. }
  1696. if (!msg) {
  1697. return name;
  1698. }
  1699. return name + ": " + msg;
  1700. };
  1701. Error.prototype.toString = errorToStringShim;
  1702. }
  1703. if (supportsDescriptors) {
  1704. var ensureNonEnumerable = function(obj, prop) {
  1705. if (isEnum(obj, prop)) {
  1706. var desc = Object.getOwnPropertyDescriptor(obj, prop);
  1707. if (desc.configurable) {
  1708. desc.enumerable = false;
  1709. Object.defineProperty(obj, prop, desc);
  1710. }
  1711. }
  1712. };
  1713. ensureNonEnumerable(Error.prototype, "message");
  1714. if (Error.prototype.message !== "") {
  1715. Error.prototype.message = "";
  1716. }
  1717. ensureNonEnumerable(Error.prototype, "name");
  1718. }
  1719. if (String(/a/mig) !== "/a/gim") {
  1720. var regexToString = function toString() {
  1721. var str = "/" + this.source + "/";
  1722. if (this.global) {
  1723. str += "g";
  1724. }
  1725. if (this.ignoreCase) {
  1726. str += "i";
  1727. }
  1728. if (this.multiline) {
  1729. str += "m";
  1730. }
  1731. return str;
  1732. };
  1733. RegExp.prototype.toString = regexToString;
  1734. }
  1735. });
  1736. }
  1737. });
  1738. export default require_es5_shim();
  1739. /*! Bundled license information:
  1740. es5-shim/es5-shim.js:
  1741. (*!
  1742. * https://github.com/es-shims/es5-shim
  1743. * @license es5-shim Copyright 2009-2020 by contributors, MIT License
  1744. * see https://github.com/es-shims/es5-shim/blob/master/LICENSE
  1745. *)
  1746. */
  1747. //# sourceMappingURL=es5-shim.js.map