bootstrap-table-export.js 92 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) :
  3. typeof define === 'function' && define.amd ? define(['jquery'], factory) :
  4. (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jQuery));
  5. })(this, (function ($) { 'use strict';
  6. function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
  7. var $__default = /*#__PURE__*/_interopDefaultLegacy($);
  8. function _classCallCheck(instance, Constructor) {
  9. if (!(instance instanceof Constructor)) {
  10. throw new TypeError("Cannot call a class as a function");
  11. }
  12. }
  13. function _defineProperties(target, props) {
  14. for (var i = 0; i < props.length; i++) {
  15. var descriptor = props[i];
  16. descriptor.enumerable = descriptor.enumerable || false;
  17. descriptor.configurable = true;
  18. if ("value" in descriptor) descriptor.writable = true;
  19. Object.defineProperty(target, descriptor.key, descriptor);
  20. }
  21. }
  22. function _createClass(Constructor, protoProps, staticProps) {
  23. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  24. if (staticProps) _defineProperties(Constructor, staticProps);
  25. Object.defineProperty(Constructor, "prototype", {
  26. writable: false
  27. });
  28. return Constructor;
  29. }
  30. function _defineProperty(obj, key, value) {
  31. if (key in obj) {
  32. Object.defineProperty(obj, key, {
  33. value: value,
  34. enumerable: true,
  35. configurable: true,
  36. writable: true
  37. });
  38. } else {
  39. obj[key] = value;
  40. }
  41. return obj;
  42. }
  43. function _inherits(subClass, superClass) {
  44. if (typeof superClass !== "function" && superClass !== null) {
  45. throw new TypeError("Super expression must either be null or a function");
  46. }
  47. subClass.prototype = Object.create(superClass && superClass.prototype, {
  48. constructor: {
  49. value: subClass,
  50. writable: true,
  51. configurable: true
  52. }
  53. });
  54. Object.defineProperty(subClass, "prototype", {
  55. writable: false
  56. });
  57. if (superClass) _setPrototypeOf(subClass, superClass);
  58. }
  59. function _getPrototypeOf(o) {
  60. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  61. return o.__proto__ || Object.getPrototypeOf(o);
  62. };
  63. return _getPrototypeOf(o);
  64. }
  65. function _setPrototypeOf(o, p) {
  66. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  67. o.__proto__ = p;
  68. return o;
  69. };
  70. return _setPrototypeOf(o, p);
  71. }
  72. function _isNativeReflectConstruct() {
  73. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  74. if (Reflect.construct.sham) return false;
  75. if (typeof Proxy === "function") return true;
  76. try {
  77. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  78. return true;
  79. } catch (e) {
  80. return false;
  81. }
  82. }
  83. function _assertThisInitialized(self) {
  84. if (self === void 0) {
  85. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  86. }
  87. return self;
  88. }
  89. function _possibleConstructorReturn(self, call) {
  90. if (call && (typeof call === "object" || typeof call === "function")) {
  91. return call;
  92. } else if (call !== void 0) {
  93. throw new TypeError("Derived constructors may only return object or undefined");
  94. }
  95. return _assertThisInitialized(self);
  96. }
  97. function _createSuper(Derived) {
  98. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  99. return function _createSuperInternal() {
  100. var Super = _getPrototypeOf(Derived),
  101. result;
  102. if (hasNativeReflectConstruct) {
  103. var NewTarget = _getPrototypeOf(this).constructor;
  104. result = Reflect.construct(Super, arguments, NewTarget);
  105. } else {
  106. result = Super.apply(this, arguments);
  107. }
  108. return _possibleConstructorReturn(this, result);
  109. };
  110. }
  111. function _superPropBase(object, property) {
  112. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  113. object = _getPrototypeOf(object);
  114. if (object === null) break;
  115. }
  116. return object;
  117. }
  118. function _get() {
  119. if (typeof Reflect !== "undefined" && Reflect.get) {
  120. _get = Reflect.get;
  121. } else {
  122. _get = function _get(target, property, receiver) {
  123. var base = _superPropBase(target, property);
  124. if (!base) return;
  125. var desc = Object.getOwnPropertyDescriptor(base, property);
  126. if (desc.get) {
  127. return desc.get.call(arguments.length < 3 ? target : receiver);
  128. }
  129. return desc.value;
  130. };
  131. }
  132. return _get.apply(this, arguments);
  133. }
  134. function _unsupportedIterableToArray(o, minLen) {
  135. if (!o) return;
  136. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  137. var n = Object.prototype.toString.call(o).slice(8, -1);
  138. if (n === "Object" && o.constructor) n = o.constructor.name;
  139. if (n === "Map" || n === "Set") return Array.from(o);
  140. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  141. }
  142. function _arrayLikeToArray(arr, len) {
  143. if (len == null || len > arr.length) len = arr.length;
  144. for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
  145. return arr2;
  146. }
  147. function _createForOfIteratorHelper(o, allowArrayLike) {
  148. var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
  149. if (!it) {
  150. if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
  151. if (it) o = it;
  152. var i = 0;
  153. var F = function () {};
  154. return {
  155. s: F,
  156. n: function () {
  157. if (i >= o.length) return {
  158. done: true
  159. };
  160. return {
  161. done: false,
  162. value: o[i++]
  163. };
  164. },
  165. e: function (e) {
  166. throw e;
  167. },
  168. f: F
  169. };
  170. }
  171. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  172. }
  173. var normalCompletion = true,
  174. didErr = false,
  175. err;
  176. return {
  177. s: function () {
  178. it = it.call(o);
  179. },
  180. n: function () {
  181. var step = it.next();
  182. normalCompletion = step.done;
  183. return step;
  184. },
  185. e: function (e) {
  186. didErr = true;
  187. err = e;
  188. },
  189. f: function () {
  190. try {
  191. if (!normalCompletion && it.return != null) it.return();
  192. } finally {
  193. if (didErr) throw err;
  194. }
  195. }
  196. };
  197. }
  198. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  199. function createCommonjsModule(fn, module) {
  200. return module = { exports: {} }, fn(module, module.exports), module.exports;
  201. }
  202. var check = function (it) {
  203. return it && it.Math == Math && it;
  204. };
  205. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  206. var global_1 =
  207. // eslint-disable-next-line es-x/no-global-this -- safe
  208. check(typeof globalThis == 'object' && globalThis) ||
  209. check(typeof window == 'object' && window) ||
  210. // eslint-disable-next-line no-restricted-globals -- safe
  211. check(typeof self == 'object' && self) ||
  212. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  213. // eslint-disable-next-line no-new-func -- fallback
  214. (function () { return this; })() || Function('return this')();
  215. var fails = function (exec) {
  216. try {
  217. return !!exec();
  218. } catch (error) {
  219. return true;
  220. }
  221. };
  222. // Detect IE8's incomplete defineProperty implementation
  223. var descriptors = !fails(function () {
  224. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  225. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  226. });
  227. var functionBindNative = !fails(function () {
  228. // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
  229. var test = (function () { /* empty */ }).bind();
  230. // eslint-disable-next-line no-prototype-builtins -- safe
  231. return typeof test != 'function' || test.hasOwnProperty('prototype');
  232. });
  233. var call$2 = Function.prototype.call;
  234. var functionCall = functionBindNative ? call$2.bind(call$2) : function () {
  235. return call$2.apply(call$2, arguments);
  236. };
  237. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  238. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  239. var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  240. // Nashorn ~ JDK8 bug
  241. var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  242. // `Object.prototype.propertyIsEnumerable` method implementation
  243. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  244. var f$5 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  245. var descriptor = getOwnPropertyDescriptor$1(this, V);
  246. return !!descriptor && descriptor.enumerable;
  247. } : $propertyIsEnumerable;
  248. var objectPropertyIsEnumerable = {
  249. f: f$5
  250. };
  251. var createPropertyDescriptor = function (bitmap, value) {
  252. return {
  253. enumerable: !(bitmap & 1),
  254. configurable: !(bitmap & 2),
  255. writable: !(bitmap & 4),
  256. value: value
  257. };
  258. };
  259. var FunctionPrototype$2 = Function.prototype;
  260. var bind$1 = FunctionPrototype$2.bind;
  261. var call$1 = FunctionPrototype$2.call;
  262. var uncurryThis = functionBindNative && bind$1.bind(call$1, call$1);
  263. var functionUncurryThis = functionBindNative ? function (fn) {
  264. return fn && uncurryThis(fn);
  265. } : function (fn) {
  266. return fn && function () {
  267. return call$1.apply(fn, arguments);
  268. };
  269. };
  270. var toString$1 = functionUncurryThis({}.toString);
  271. var stringSlice$5 = functionUncurryThis(''.slice);
  272. var classofRaw = function (it) {
  273. return stringSlice$5(toString$1(it), 8, -1);
  274. };
  275. var Object$4 = global_1.Object;
  276. var split = functionUncurryThis(''.split);
  277. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  278. var indexedObject = fails(function () {
  279. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  280. // eslint-disable-next-line no-prototype-builtins -- safe
  281. return !Object$4('z').propertyIsEnumerable(0);
  282. }) ? function (it) {
  283. return classofRaw(it) == 'String' ? split(it, '') : Object$4(it);
  284. } : Object$4;
  285. var TypeError$a = global_1.TypeError;
  286. // `RequireObjectCoercible` abstract operation
  287. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  288. var requireObjectCoercible = function (it) {
  289. if (it == undefined) throw TypeError$a("Can't call method on " + it);
  290. return it;
  291. };
  292. // toObject with fallback for non-array-like ES3 strings
  293. var toIndexedObject = function (it) {
  294. return indexedObject(requireObjectCoercible(it));
  295. };
  296. // `IsCallable` abstract operation
  297. // https://tc39.es/ecma262/#sec-iscallable
  298. var isCallable = function (argument) {
  299. return typeof argument == 'function';
  300. };
  301. var isObject = function (it) {
  302. return typeof it == 'object' ? it !== null : isCallable(it);
  303. };
  304. var aFunction = function (argument) {
  305. return isCallable(argument) ? argument : undefined;
  306. };
  307. var getBuiltIn = function (namespace, method) {
  308. return arguments.length < 2 ? aFunction(global_1[namespace]) : global_1[namespace] && global_1[namespace][method];
  309. };
  310. var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
  311. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  312. var process = global_1.process;
  313. var Deno = global_1.Deno;
  314. var versions = process && process.versions || Deno && Deno.version;
  315. var v8 = versions && versions.v8;
  316. var match, version;
  317. if (v8) {
  318. match = v8.split('.');
  319. // in old Chrome, versions of V8 isn't V8 = Chrome / 10
  320. // but their correct versions are not interesting for us
  321. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  322. }
  323. // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
  324. // so check `userAgent` even if `.v8` exists, but 0
  325. if (!version && engineUserAgent) {
  326. match = engineUserAgent.match(/Edge\/(\d+)/);
  327. if (!match || match[1] >= 74) {
  328. match = engineUserAgent.match(/Chrome\/(\d+)/);
  329. if (match) version = +match[1];
  330. }
  331. }
  332. var engineV8Version = version;
  333. /* eslint-disable es-x/no-symbol -- required for testing */
  334. // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
  335. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  336. var symbol = Symbol();
  337. // Chrome 38 Symbol has incorrect toString conversion
  338. // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
  339. return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
  340. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  341. !Symbol.sham && engineV8Version && engineV8Version < 41;
  342. });
  343. /* eslint-disable es-x/no-symbol -- required for testing */
  344. var useSymbolAsUid = nativeSymbol
  345. && !Symbol.sham
  346. && typeof Symbol.iterator == 'symbol';
  347. var Object$3 = global_1.Object;
  348. var isSymbol = useSymbolAsUid ? function (it) {
  349. return typeof it == 'symbol';
  350. } : function (it) {
  351. var $Symbol = getBuiltIn('Symbol');
  352. return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, Object$3(it));
  353. };
  354. var String$3 = global_1.String;
  355. var tryToString = function (argument) {
  356. try {
  357. return String$3(argument);
  358. } catch (error) {
  359. return 'Object';
  360. }
  361. };
  362. var TypeError$9 = global_1.TypeError;
  363. // `Assert: IsCallable(argument) is true`
  364. var aCallable = function (argument) {
  365. if (isCallable(argument)) return argument;
  366. throw TypeError$9(tryToString(argument) + ' is not a function');
  367. };
  368. // `GetMethod` abstract operation
  369. // https://tc39.es/ecma262/#sec-getmethod
  370. var getMethod = function (V, P) {
  371. var func = V[P];
  372. return func == null ? undefined : aCallable(func);
  373. };
  374. var TypeError$8 = global_1.TypeError;
  375. // `OrdinaryToPrimitive` abstract operation
  376. // https://tc39.es/ecma262/#sec-ordinarytoprimitive
  377. var ordinaryToPrimitive = function (input, pref) {
  378. var fn, val;
  379. if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
  380. if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
  381. if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
  382. throw TypeError$8("Can't convert object to primitive value");
  383. };
  384. // eslint-disable-next-line es-x/no-object-defineproperty -- safe
  385. var defineProperty$1 = Object.defineProperty;
  386. var setGlobal = function (key, value) {
  387. try {
  388. defineProperty$1(global_1, key, { value: value, configurable: true, writable: true });
  389. } catch (error) {
  390. global_1[key] = value;
  391. } return value;
  392. };
  393. var SHARED = '__core-js_shared__';
  394. var store$1 = global_1[SHARED] || setGlobal(SHARED, {});
  395. var sharedStore = store$1;
  396. var shared = createCommonjsModule(function (module) {
  397. (module.exports = function (key, value) {
  398. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  399. })('versions', []).push({
  400. version: '3.22.4',
  401. mode: 'global',
  402. copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
  403. license: 'https://github.com/zloirock/core-js/blob/v3.22.4/LICENSE',
  404. source: 'https://github.com/zloirock/core-js'
  405. });
  406. });
  407. var Object$2 = global_1.Object;
  408. // `ToObject` abstract operation
  409. // https://tc39.es/ecma262/#sec-toobject
  410. var toObject = function (argument) {
  411. return Object$2(requireObjectCoercible(argument));
  412. };
  413. var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
  414. // `HasOwnProperty` abstract operation
  415. // https://tc39.es/ecma262/#sec-hasownproperty
  416. // eslint-disable-next-line es-x/no-object-hasown -- safe
  417. var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
  418. return hasOwnProperty(toObject(it), key);
  419. };
  420. var id = 0;
  421. var postfix = Math.random();
  422. var toString = functionUncurryThis(1.0.toString);
  423. var uid = function (key) {
  424. return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
  425. };
  426. var WellKnownSymbolsStore = shared('wks');
  427. var Symbol$1 = global_1.Symbol;
  428. var symbolFor = Symbol$1 && Symbol$1['for'];
  429. var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
  430. var wellKnownSymbol = function (name) {
  431. if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
  432. var description = 'Symbol.' + name;
  433. if (nativeSymbol && hasOwnProperty_1(Symbol$1, name)) {
  434. WellKnownSymbolsStore[name] = Symbol$1[name];
  435. } else if (useSymbolAsUid && symbolFor) {
  436. WellKnownSymbolsStore[name] = symbolFor(description);
  437. } else {
  438. WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
  439. }
  440. } return WellKnownSymbolsStore[name];
  441. };
  442. var TypeError$7 = global_1.TypeError;
  443. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  444. // `ToPrimitive` abstract operation
  445. // https://tc39.es/ecma262/#sec-toprimitive
  446. var toPrimitive = function (input, pref) {
  447. if (!isObject(input) || isSymbol(input)) return input;
  448. var exoticToPrim = getMethod(input, TO_PRIMITIVE);
  449. var result;
  450. if (exoticToPrim) {
  451. if (pref === undefined) pref = 'default';
  452. result = functionCall(exoticToPrim, input, pref);
  453. if (!isObject(result) || isSymbol(result)) return result;
  454. throw TypeError$7("Can't convert object to primitive value");
  455. }
  456. if (pref === undefined) pref = 'number';
  457. return ordinaryToPrimitive(input, pref);
  458. };
  459. // `ToPropertyKey` abstract operation
  460. // https://tc39.es/ecma262/#sec-topropertykey
  461. var toPropertyKey = function (argument) {
  462. var key = toPrimitive(argument, 'string');
  463. return isSymbol(key) ? key : key + '';
  464. };
  465. var document$1 = global_1.document;
  466. // typeof document.createElement is 'object' in old IE
  467. var EXISTS$1 = isObject(document$1) && isObject(document$1.createElement);
  468. var documentCreateElement = function (it) {
  469. return EXISTS$1 ? document$1.createElement(it) : {};
  470. };
  471. // Thanks to IE8 for its funny defineProperty
  472. var ie8DomDefine = !descriptors && !fails(function () {
  473. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  474. return Object.defineProperty(documentCreateElement('div'), 'a', {
  475. get: function () { return 7; }
  476. }).a != 7;
  477. });
  478. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  479. var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  480. // `Object.getOwnPropertyDescriptor` method
  481. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  482. var f$4 = descriptors ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
  483. O = toIndexedObject(O);
  484. P = toPropertyKey(P);
  485. if (ie8DomDefine) try {
  486. return $getOwnPropertyDescriptor$1(O, P);
  487. } catch (error) { /* empty */ }
  488. if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
  489. };
  490. var objectGetOwnPropertyDescriptor = {
  491. f: f$4
  492. };
  493. // V8 ~ Chrome 36-
  494. // https://bugs.chromium.org/p/v8/issues/detail?id=3334
  495. var v8PrototypeDefineBug = descriptors && fails(function () {
  496. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  497. return Object.defineProperty(function () { /* empty */ }, 'prototype', {
  498. value: 42,
  499. writable: false
  500. }).prototype != 42;
  501. });
  502. var String$2 = global_1.String;
  503. var TypeError$6 = global_1.TypeError;
  504. // `Assert: Type(argument) is Object`
  505. var anObject = function (argument) {
  506. if (isObject(argument)) return argument;
  507. throw TypeError$6(String$2(argument) + ' is not an object');
  508. };
  509. var TypeError$5 = global_1.TypeError;
  510. // eslint-disable-next-line es-x/no-object-defineproperty -- safe
  511. var $defineProperty = Object.defineProperty;
  512. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  513. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  514. var ENUMERABLE = 'enumerable';
  515. var CONFIGURABLE$1 = 'configurable';
  516. var WRITABLE = 'writable';
  517. // `Object.defineProperty` method
  518. // https://tc39.es/ecma262/#sec-object.defineproperty
  519. var f$3 = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) {
  520. anObject(O);
  521. P = toPropertyKey(P);
  522. anObject(Attributes);
  523. if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  524. var current = $getOwnPropertyDescriptor(O, P);
  525. if (current && current[WRITABLE]) {
  526. O[P] = Attributes.value;
  527. Attributes = {
  528. configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
  529. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  530. writable: false
  531. };
  532. }
  533. } return $defineProperty(O, P, Attributes);
  534. } : $defineProperty : function defineProperty(O, P, Attributes) {
  535. anObject(O);
  536. P = toPropertyKey(P);
  537. anObject(Attributes);
  538. if (ie8DomDefine) try {
  539. return $defineProperty(O, P, Attributes);
  540. } catch (error) { /* empty */ }
  541. if ('get' in Attributes || 'set' in Attributes) throw TypeError$5('Accessors not supported');
  542. if ('value' in Attributes) O[P] = Attributes.value;
  543. return O;
  544. };
  545. var objectDefineProperty = {
  546. f: f$3
  547. };
  548. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  549. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  550. } : function (object, key, value) {
  551. object[key] = value;
  552. return object;
  553. };
  554. var FunctionPrototype$1 = Function.prototype;
  555. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  556. var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
  557. var EXISTS = hasOwnProperty_1(FunctionPrototype$1, 'name');
  558. // additional protection from minified / mangled / dropped function names
  559. var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
  560. var CONFIGURABLE = EXISTS && (!descriptors || (descriptors && getDescriptor(FunctionPrototype$1, 'name').configurable));
  561. var functionName = {
  562. EXISTS: EXISTS,
  563. PROPER: PROPER,
  564. CONFIGURABLE: CONFIGURABLE
  565. };
  566. var functionToString = functionUncurryThis(Function.toString);
  567. // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
  568. if (!isCallable(sharedStore.inspectSource)) {
  569. sharedStore.inspectSource = function (it) {
  570. return functionToString(it);
  571. };
  572. }
  573. var inspectSource = sharedStore.inspectSource;
  574. var WeakMap$1 = global_1.WeakMap;
  575. var nativeWeakMap = isCallable(WeakMap$1) && /native code/.test(inspectSource(WeakMap$1));
  576. var keys = shared('keys');
  577. var sharedKey = function (key) {
  578. return keys[key] || (keys[key] = uid(key));
  579. };
  580. var hiddenKeys$1 = {};
  581. var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
  582. var TypeError$4 = global_1.TypeError;
  583. var WeakMap = global_1.WeakMap;
  584. var set, get, has;
  585. var enforce = function (it) {
  586. return has(it) ? get(it) : set(it, {});
  587. };
  588. var getterFor = function (TYPE) {
  589. return function (it) {
  590. var state;
  591. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  592. throw TypeError$4('Incompatible receiver, ' + TYPE + ' required');
  593. } return state;
  594. };
  595. };
  596. if (nativeWeakMap || sharedStore.state) {
  597. var store = sharedStore.state || (sharedStore.state = new WeakMap());
  598. var wmget = functionUncurryThis(store.get);
  599. var wmhas = functionUncurryThis(store.has);
  600. var wmset = functionUncurryThis(store.set);
  601. set = function (it, metadata) {
  602. if (wmhas(store, it)) throw new TypeError$4(OBJECT_ALREADY_INITIALIZED);
  603. metadata.facade = it;
  604. wmset(store, it, metadata);
  605. return metadata;
  606. };
  607. get = function (it) {
  608. return wmget(store, it) || {};
  609. };
  610. has = function (it) {
  611. return wmhas(store, it);
  612. };
  613. } else {
  614. var STATE = sharedKey('state');
  615. hiddenKeys$1[STATE] = true;
  616. set = function (it, metadata) {
  617. if (hasOwnProperty_1(it, STATE)) throw new TypeError$4(OBJECT_ALREADY_INITIALIZED);
  618. metadata.facade = it;
  619. createNonEnumerableProperty(it, STATE, metadata);
  620. return metadata;
  621. };
  622. get = function (it) {
  623. return hasOwnProperty_1(it, STATE) ? it[STATE] : {};
  624. };
  625. has = function (it) {
  626. return hasOwnProperty_1(it, STATE);
  627. };
  628. }
  629. var internalState = {
  630. set: set,
  631. get: get,
  632. has: has,
  633. enforce: enforce,
  634. getterFor: getterFor
  635. };
  636. var makeBuiltIn_1 = createCommonjsModule(function (module) {
  637. var defineProperty = objectDefineProperty.f;
  638. var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
  639. var enforceInternalState = internalState.enforce;
  640. var getInternalState = internalState.get;
  641. var CONFIGURABLE_LENGTH = !fails(function () {
  642. return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
  643. });
  644. var TEMPLATE = String(String).split('String');
  645. var makeBuiltIn = module.exports = function (value, name, options) {
  646. if (String(name).slice(0, 7) === 'Symbol(') {
  647. name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
  648. }
  649. if (options && options.getter) name = 'get ' + name;
  650. if (options && options.setter) name = 'set ' + name;
  651. if (!hasOwnProperty_1(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
  652. defineProperty(value, 'name', { value: name, configurable: true });
  653. }
  654. if (CONFIGURABLE_LENGTH && options && hasOwnProperty_1(options, 'arity') && value.length !== options.arity) {
  655. defineProperty(value, 'length', { value: options.arity });
  656. }
  657. var state = enforceInternalState(value);
  658. if (!hasOwnProperty_1(state, 'source')) {
  659. state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
  660. } return value;
  661. };
  662. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  663. // eslint-disable-next-line no-extend-native -- required
  664. Function.prototype.toString = makeBuiltIn(function toString() {
  665. return isCallable(this) && getInternalState(this).source || inspectSource(this);
  666. }, 'toString');
  667. });
  668. var defineBuiltIn = function (O, key, value, options) {
  669. var unsafe = options ? !!options.unsafe : false;
  670. var simple = options ? !!options.enumerable : false;
  671. var noTargetGet = options ? !!options.noTargetGet : false;
  672. var name = options && options.name !== undefined ? options.name : key;
  673. if (isCallable(value)) makeBuiltIn_1(value, name, options);
  674. if (O === global_1) {
  675. if (simple) O[key] = value;
  676. else setGlobal(key, value);
  677. return O;
  678. } else if (!unsafe) {
  679. delete O[key];
  680. } else if (!noTargetGet && O[key]) {
  681. simple = true;
  682. }
  683. if (simple) O[key] = value;
  684. else createNonEnumerableProperty(O, key, value);
  685. return O;
  686. };
  687. var ceil = Math.ceil;
  688. var floor$1 = Math.floor;
  689. // `ToIntegerOrInfinity` abstract operation
  690. // https://tc39.es/ecma262/#sec-tointegerorinfinity
  691. var toIntegerOrInfinity = function (argument) {
  692. var number = +argument;
  693. // eslint-disable-next-line no-self-compare -- safe
  694. return number !== number || number === 0 ? 0 : (number > 0 ? floor$1 : ceil)(number);
  695. };
  696. var max$3 = Math.max;
  697. var min$3 = Math.min;
  698. // Helper for a popular repeating case of the spec:
  699. // Let integer be ? ToInteger(index).
  700. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  701. var toAbsoluteIndex = function (index, length) {
  702. var integer = toIntegerOrInfinity(index);
  703. return integer < 0 ? max$3(integer + length, 0) : min$3(integer, length);
  704. };
  705. var min$2 = Math.min;
  706. // `ToLength` abstract operation
  707. // https://tc39.es/ecma262/#sec-tolength
  708. var toLength = function (argument) {
  709. return argument > 0 ? min$2(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  710. };
  711. // `LengthOfArrayLike` abstract operation
  712. // https://tc39.es/ecma262/#sec-lengthofarraylike
  713. var lengthOfArrayLike = function (obj) {
  714. return toLength(obj.length);
  715. };
  716. // `Array.prototype.{ indexOf, includes }` methods implementation
  717. var createMethod$2 = function (IS_INCLUDES) {
  718. return function ($this, el, fromIndex) {
  719. var O = toIndexedObject($this);
  720. var length = lengthOfArrayLike(O);
  721. var index = toAbsoluteIndex(fromIndex, length);
  722. var value;
  723. // Array#includes uses SameValueZero equality algorithm
  724. // eslint-disable-next-line no-self-compare -- NaN check
  725. if (IS_INCLUDES && el != el) while (length > index) {
  726. value = O[index++];
  727. // eslint-disable-next-line no-self-compare -- NaN check
  728. if (value != value) return true;
  729. // Array#indexOf ignores holes, Array#includes - not
  730. } else for (;length > index; index++) {
  731. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  732. } return !IS_INCLUDES && -1;
  733. };
  734. };
  735. var arrayIncludes = {
  736. // `Array.prototype.includes` method
  737. // https://tc39.es/ecma262/#sec-array.prototype.includes
  738. includes: createMethod$2(true),
  739. // `Array.prototype.indexOf` method
  740. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  741. indexOf: createMethod$2(false)
  742. };
  743. var indexOf$1 = arrayIncludes.indexOf;
  744. var push$3 = functionUncurryThis([].push);
  745. var objectKeysInternal = function (object, names) {
  746. var O = toIndexedObject(object);
  747. var i = 0;
  748. var result = [];
  749. var key;
  750. for (key in O) !hasOwnProperty_1(hiddenKeys$1, key) && hasOwnProperty_1(O, key) && push$3(result, key);
  751. // Don't enum bug & hidden keys
  752. while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) {
  753. ~indexOf$1(result, key) || push$3(result, key);
  754. }
  755. return result;
  756. };
  757. // IE8- don't enum bug keys
  758. var enumBugKeys = [
  759. 'constructor',
  760. 'hasOwnProperty',
  761. 'isPrototypeOf',
  762. 'propertyIsEnumerable',
  763. 'toLocaleString',
  764. 'toString',
  765. 'valueOf'
  766. ];
  767. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  768. // `Object.getOwnPropertyNames` method
  769. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  770. // eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
  771. var f$2 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  772. return objectKeysInternal(O, hiddenKeys);
  773. };
  774. var objectGetOwnPropertyNames = {
  775. f: f$2
  776. };
  777. // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
  778. var f$1 = Object.getOwnPropertySymbols;
  779. var objectGetOwnPropertySymbols = {
  780. f: f$1
  781. };
  782. var concat$2 = functionUncurryThis([].concat);
  783. // all object keys, includes non-enumerable and symbols
  784. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  785. var keys = objectGetOwnPropertyNames.f(anObject(it));
  786. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  787. return getOwnPropertySymbols ? concat$2(keys, getOwnPropertySymbols(it)) : keys;
  788. };
  789. var copyConstructorProperties = function (target, source, exceptions) {
  790. var keys = ownKeys(source);
  791. var defineProperty = objectDefineProperty.f;
  792. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  793. for (var i = 0; i < keys.length; i++) {
  794. var key = keys[i];
  795. if (!hasOwnProperty_1(target, key) && !(exceptions && hasOwnProperty_1(exceptions, key))) {
  796. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  797. }
  798. }
  799. };
  800. var replacement = /#|\.prototype\./;
  801. var isForced = function (feature, detection) {
  802. var value = data[normalize(feature)];
  803. return value == POLYFILL ? true
  804. : value == NATIVE ? false
  805. : isCallable(detection) ? fails(detection)
  806. : !!detection;
  807. };
  808. var normalize = isForced.normalize = function (string) {
  809. return String(string).replace(replacement, '.').toLowerCase();
  810. };
  811. var data = isForced.data = {};
  812. var NATIVE = isForced.NATIVE = 'N';
  813. var POLYFILL = isForced.POLYFILL = 'P';
  814. var isForced_1 = isForced;
  815. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  816. /*
  817. options.target - name of the target object
  818. options.global - target is the global object
  819. options.stat - export as static methods of target
  820. options.proto - export as prototype methods of target
  821. options.real - real prototype method for the `pure` version
  822. options.forced - export even if the native feature is available
  823. options.bind - bind methods to the target, required for the `pure` version
  824. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  825. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  826. options.sham - add a flag to not completely full polyfills
  827. options.enumerable - export as enumerable property
  828. options.noTargetGet - prevent calling a getter on target
  829. options.name - the .name of the function if it does not match the key
  830. */
  831. var _export = function (options, source) {
  832. var TARGET = options.target;
  833. var GLOBAL = options.global;
  834. var STATIC = options.stat;
  835. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  836. if (GLOBAL) {
  837. target = global_1;
  838. } else if (STATIC) {
  839. target = global_1[TARGET] || setGlobal(TARGET, {});
  840. } else {
  841. target = (global_1[TARGET] || {}).prototype;
  842. }
  843. if (target) for (key in source) {
  844. sourceProperty = source[key];
  845. if (options.noTargetGet) {
  846. descriptor = getOwnPropertyDescriptor(target, key);
  847. targetProperty = descriptor && descriptor.value;
  848. } else targetProperty = target[key];
  849. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  850. // contained in target
  851. if (!FORCED && targetProperty !== undefined) {
  852. if (typeof sourceProperty == typeof targetProperty) continue;
  853. copyConstructorProperties(sourceProperty, targetProperty);
  854. }
  855. // add a flag to not completely full polyfills
  856. if (options.sham || (targetProperty && targetProperty.sham)) {
  857. createNonEnumerableProperty(sourceProperty, 'sham', true);
  858. }
  859. defineBuiltIn(target, key, sourceProperty, options);
  860. }
  861. };
  862. var bind = functionUncurryThis(functionUncurryThis.bind);
  863. // optional / simple context binding
  864. var functionBindContext = function (fn, that) {
  865. aCallable(fn);
  866. return that === undefined ? fn : functionBindNative ? bind(fn, that) : function (/* ...args */) {
  867. return fn.apply(that, arguments);
  868. };
  869. };
  870. // `IsArray` abstract operation
  871. // https://tc39.es/ecma262/#sec-isarray
  872. // eslint-disable-next-line es-x/no-array-isarray -- safe
  873. var isArray = Array.isArray || function isArray(argument) {
  874. return classofRaw(argument) == 'Array';
  875. };
  876. var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
  877. var test = {};
  878. test[TO_STRING_TAG$1] = 'z';
  879. var toStringTagSupport = String(test) === '[object z]';
  880. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  881. var Object$1 = global_1.Object;
  882. // ES3 wrong here
  883. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  884. // fallback for IE11 Script Access Denied error
  885. var tryGet = function (it, key) {
  886. try {
  887. return it[key];
  888. } catch (error) { /* empty */ }
  889. };
  890. // getting tag from ES6+ `Object.prototype.toString`
  891. var classof = toStringTagSupport ? classofRaw : function (it) {
  892. var O, tag, result;
  893. return it === undefined ? 'Undefined' : it === null ? 'Null'
  894. // @@toStringTag case
  895. : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
  896. // builtinTag case
  897. : CORRECT_ARGUMENTS ? classofRaw(O)
  898. // ES3 arguments fallback
  899. : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
  900. };
  901. var noop = function () { /* empty */ };
  902. var empty = [];
  903. var construct = getBuiltIn('Reflect', 'construct');
  904. var constructorRegExp = /^\s*(?:class|function)\b/;
  905. var exec$1 = functionUncurryThis(constructorRegExp.exec);
  906. var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
  907. var isConstructorModern = function isConstructor(argument) {
  908. if (!isCallable(argument)) return false;
  909. try {
  910. construct(noop, empty, argument);
  911. return true;
  912. } catch (error) {
  913. return false;
  914. }
  915. };
  916. var isConstructorLegacy = function isConstructor(argument) {
  917. if (!isCallable(argument)) return false;
  918. switch (classof(argument)) {
  919. case 'AsyncFunction':
  920. case 'GeneratorFunction':
  921. case 'AsyncGeneratorFunction': return false;
  922. }
  923. try {
  924. // we can't check .prototype since constructors produced by .bind haven't it
  925. // `Function#toString` throws on some built-it function in some legacy engines
  926. // (for example, `DOMQuad` and similar in FF41-)
  927. return INCORRECT_TO_STRING || !!exec$1(constructorRegExp, inspectSource(argument));
  928. } catch (error) {
  929. return true;
  930. }
  931. };
  932. isConstructorLegacy.sham = true;
  933. // `IsConstructor` abstract operation
  934. // https://tc39.es/ecma262/#sec-isconstructor
  935. var isConstructor = !construct || fails(function () {
  936. var called;
  937. return isConstructorModern(isConstructorModern.call)
  938. || !isConstructorModern(Object)
  939. || !isConstructorModern(function () { called = true; })
  940. || called;
  941. }) ? isConstructorLegacy : isConstructorModern;
  942. var SPECIES$4 = wellKnownSymbol('species');
  943. var Array$3 = global_1.Array;
  944. // a part of `ArraySpeciesCreate` abstract operation
  945. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  946. var arraySpeciesConstructor = function (originalArray) {
  947. var C;
  948. if (isArray(originalArray)) {
  949. C = originalArray.constructor;
  950. // cross-realm fallback
  951. if (isConstructor(C) && (C === Array$3 || isArray(C.prototype))) C = undefined;
  952. else if (isObject(C)) {
  953. C = C[SPECIES$4];
  954. if (C === null) C = undefined;
  955. }
  956. } return C === undefined ? Array$3 : C;
  957. };
  958. // `ArraySpeciesCreate` abstract operation
  959. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  960. var arraySpeciesCreate = function (originalArray, length) {
  961. return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
  962. };
  963. var push$2 = functionUncurryThis([].push);
  964. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
  965. var createMethod$1 = function (TYPE) {
  966. var IS_MAP = TYPE == 1;
  967. var IS_FILTER = TYPE == 2;
  968. var IS_SOME = TYPE == 3;
  969. var IS_EVERY = TYPE == 4;
  970. var IS_FIND_INDEX = TYPE == 6;
  971. var IS_FILTER_REJECT = TYPE == 7;
  972. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  973. return function ($this, callbackfn, that, specificCreate) {
  974. var O = toObject($this);
  975. var self = indexedObject(O);
  976. var boundFunction = functionBindContext(callbackfn, that);
  977. var length = lengthOfArrayLike(self);
  978. var index = 0;
  979. var create = specificCreate || arraySpeciesCreate;
  980. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
  981. var value, result;
  982. for (;length > index; index++) if (NO_HOLES || index in self) {
  983. value = self[index];
  984. result = boundFunction(value, index, O);
  985. if (TYPE) {
  986. if (IS_MAP) target[index] = result; // map
  987. else if (result) switch (TYPE) {
  988. case 3: return true; // some
  989. case 5: return value; // find
  990. case 6: return index; // findIndex
  991. case 2: push$2(target, value); // filter
  992. } else switch (TYPE) {
  993. case 4: return false; // every
  994. case 7: push$2(target, value); // filterReject
  995. }
  996. }
  997. }
  998. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  999. };
  1000. };
  1001. var arrayIteration = {
  1002. // `Array.prototype.forEach` method
  1003. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  1004. forEach: createMethod$1(0),
  1005. // `Array.prototype.map` method
  1006. // https://tc39.es/ecma262/#sec-array.prototype.map
  1007. map: createMethod$1(1),
  1008. // `Array.prototype.filter` method
  1009. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1010. filter: createMethod$1(2),
  1011. // `Array.prototype.some` method
  1012. // https://tc39.es/ecma262/#sec-array.prototype.some
  1013. some: createMethod$1(3),
  1014. // `Array.prototype.every` method
  1015. // https://tc39.es/ecma262/#sec-array.prototype.every
  1016. every: createMethod$1(4),
  1017. // `Array.prototype.find` method
  1018. // https://tc39.es/ecma262/#sec-array.prototype.find
  1019. find: createMethod$1(5),
  1020. // `Array.prototype.findIndex` method
  1021. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  1022. findIndex: createMethod$1(6),
  1023. // `Array.prototype.filterReject` method
  1024. // https://github.com/tc39/proposal-array-filtering
  1025. filterReject: createMethod$1(7)
  1026. };
  1027. // `Object.keys` method
  1028. // https://tc39.es/ecma262/#sec-object.keys
  1029. // eslint-disable-next-line es-x/no-object-keys -- safe
  1030. var objectKeys = Object.keys || function keys(O) {
  1031. return objectKeysInternal(O, enumBugKeys);
  1032. };
  1033. // `Object.defineProperties` method
  1034. // https://tc39.es/ecma262/#sec-object.defineproperties
  1035. // eslint-disable-next-line es-x/no-object-defineproperties -- safe
  1036. var f = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
  1037. anObject(O);
  1038. var props = toIndexedObject(Properties);
  1039. var keys = objectKeys(Properties);
  1040. var length = keys.length;
  1041. var index = 0;
  1042. var key;
  1043. while (length > index) objectDefineProperty.f(O, key = keys[index++], props[key]);
  1044. return O;
  1045. };
  1046. var objectDefineProperties = {
  1047. f: f
  1048. };
  1049. var html = getBuiltIn('document', 'documentElement');
  1050. /* global ActiveXObject -- old IE, WSH */
  1051. var GT = '>';
  1052. var LT = '<';
  1053. var PROTOTYPE = 'prototype';
  1054. var SCRIPT = 'script';
  1055. var IE_PROTO = sharedKey('IE_PROTO');
  1056. var EmptyConstructor = function () { /* empty */ };
  1057. var scriptTag = function (content) {
  1058. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  1059. };
  1060. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  1061. var NullProtoObjectViaActiveX = function (activeXDocument) {
  1062. activeXDocument.write(scriptTag(''));
  1063. activeXDocument.close();
  1064. var temp = activeXDocument.parentWindow.Object;
  1065. activeXDocument = null; // avoid memory leak
  1066. return temp;
  1067. };
  1068. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  1069. var NullProtoObjectViaIFrame = function () {
  1070. // Thrash, waste and sodomy: IE GC bug
  1071. var iframe = documentCreateElement('iframe');
  1072. var JS = 'java' + SCRIPT + ':';
  1073. var iframeDocument;
  1074. iframe.style.display = 'none';
  1075. html.appendChild(iframe);
  1076. // https://github.com/zloirock/core-js/issues/475
  1077. iframe.src = String(JS);
  1078. iframeDocument = iframe.contentWindow.document;
  1079. iframeDocument.open();
  1080. iframeDocument.write(scriptTag('document.F=Object'));
  1081. iframeDocument.close();
  1082. return iframeDocument.F;
  1083. };
  1084. // Check for document.domain and active x support
  1085. // No need to use active x approach when document.domain is not set
  1086. // see https://github.com/es-shims/es5-shim/issues/150
  1087. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  1088. // avoid IE GC bug
  1089. var activeXDocument;
  1090. var NullProtoObject = function () {
  1091. try {
  1092. activeXDocument = new ActiveXObject('htmlfile');
  1093. } catch (error) { /* ignore */ }
  1094. NullProtoObject = typeof document != 'undefined'
  1095. ? document.domain && activeXDocument
  1096. ? NullProtoObjectViaActiveX(activeXDocument) // old IE
  1097. : NullProtoObjectViaIFrame()
  1098. : NullProtoObjectViaActiveX(activeXDocument); // WSH
  1099. var length = enumBugKeys.length;
  1100. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  1101. return NullProtoObject();
  1102. };
  1103. hiddenKeys$1[IE_PROTO] = true;
  1104. // `Object.create` method
  1105. // https://tc39.es/ecma262/#sec-object.create
  1106. // eslint-disable-next-line es-x/no-object-create -- safe
  1107. var objectCreate = Object.create || function create(O, Properties) {
  1108. var result;
  1109. if (O !== null) {
  1110. EmptyConstructor[PROTOTYPE] = anObject(O);
  1111. result = new EmptyConstructor();
  1112. EmptyConstructor[PROTOTYPE] = null;
  1113. // add "__proto__" for Object.getPrototypeOf polyfill
  1114. result[IE_PROTO] = O;
  1115. } else result = NullProtoObject();
  1116. return Properties === undefined ? result : objectDefineProperties.f(result, Properties);
  1117. };
  1118. var UNSCOPABLES = wellKnownSymbol('unscopables');
  1119. var ArrayPrototype = Array.prototype;
  1120. // Array.prototype[@@unscopables]
  1121. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1122. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  1123. objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
  1124. configurable: true,
  1125. value: objectCreate(null)
  1126. });
  1127. }
  1128. // add a key to Array.prototype[@@unscopables]
  1129. var addToUnscopables = function (key) {
  1130. ArrayPrototype[UNSCOPABLES][key] = true;
  1131. };
  1132. var $find = arrayIteration.find;
  1133. var FIND = 'find';
  1134. var SKIPS_HOLES = true;
  1135. // Shouldn't skip holes
  1136. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  1137. // `Array.prototype.find` method
  1138. // https://tc39.es/ecma262/#sec-array.prototype.find
  1139. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  1140. find: function find(callbackfn /* , that = undefined */) {
  1141. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1142. }
  1143. });
  1144. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1145. addToUnscopables(FIND);
  1146. // `Object.prototype.toString` method implementation
  1147. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  1148. var objectToString = toStringTagSupport ? {}.toString : function toString() {
  1149. return '[object ' + classof(this) + ']';
  1150. };
  1151. // `Object.prototype.toString` method
  1152. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  1153. if (!toStringTagSupport) {
  1154. defineBuiltIn(Object.prototype, 'toString', objectToString, { unsafe: true });
  1155. }
  1156. var String$1 = global_1.String;
  1157. var toString_1 = function (argument) {
  1158. if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
  1159. return String$1(argument);
  1160. };
  1161. // `RegExp.prototype.flags` getter implementation
  1162. // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
  1163. var regexpFlags = function () {
  1164. var that = anObject(this);
  1165. var result = '';
  1166. if (that.hasIndices) result += 'd';
  1167. if (that.global) result += 'g';
  1168. if (that.ignoreCase) result += 'i';
  1169. if (that.multiline) result += 'm';
  1170. if (that.dotAll) result += 's';
  1171. if (that.unicode) result += 'u';
  1172. if (that.sticky) result += 'y';
  1173. return result;
  1174. };
  1175. // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
  1176. var $RegExp$2 = global_1.RegExp;
  1177. var UNSUPPORTED_Y$2 = fails(function () {
  1178. var re = $RegExp$2('a', 'y');
  1179. re.lastIndex = 2;
  1180. return re.exec('abcd') != null;
  1181. });
  1182. // UC Browser bug
  1183. // https://github.com/zloirock/core-js/issues/1008
  1184. var MISSED_STICKY = UNSUPPORTED_Y$2 || fails(function () {
  1185. return !$RegExp$2('a', 'y').sticky;
  1186. });
  1187. var BROKEN_CARET = UNSUPPORTED_Y$2 || fails(function () {
  1188. // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
  1189. var re = $RegExp$2('^r', 'gy');
  1190. re.lastIndex = 2;
  1191. return re.exec('str') != null;
  1192. });
  1193. var regexpStickyHelpers = {
  1194. BROKEN_CARET: BROKEN_CARET,
  1195. MISSED_STICKY: MISSED_STICKY,
  1196. UNSUPPORTED_Y: UNSUPPORTED_Y$2
  1197. };
  1198. // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
  1199. var $RegExp$1 = global_1.RegExp;
  1200. var regexpUnsupportedDotAll = fails(function () {
  1201. var re = $RegExp$1('.', 's');
  1202. return !(re.dotAll && re.exec('\n') && re.flags === 's');
  1203. });
  1204. // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
  1205. var $RegExp = global_1.RegExp;
  1206. var regexpUnsupportedNcg = fails(function () {
  1207. var re = $RegExp('(?<a>b)', 'g');
  1208. return re.exec('b').groups.a !== 'b' ||
  1209. 'b'.replace(re, '$<a>c') !== 'bc';
  1210. });
  1211. /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
  1212. /* eslint-disable regexp/no-useless-quantifier -- testing */
  1213. var getInternalState = internalState.get;
  1214. var nativeReplace = shared('native-string-replace', String.prototype.replace);
  1215. var nativeExec = RegExp.prototype.exec;
  1216. var patchedExec = nativeExec;
  1217. var charAt$3 = functionUncurryThis(''.charAt);
  1218. var indexOf = functionUncurryThis(''.indexOf);
  1219. var replace$1 = functionUncurryThis(''.replace);
  1220. var stringSlice$4 = functionUncurryThis(''.slice);
  1221. var UPDATES_LAST_INDEX_WRONG = (function () {
  1222. var re1 = /a/;
  1223. var re2 = /b*/g;
  1224. functionCall(nativeExec, re1, 'a');
  1225. functionCall(nativeExec, re2, 'a');
  1226. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  1227. })();
  1228. var UNSUPPORTED_Y$1 = regexpStickyHelpers.BROKEN_CARET;
  1229. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  1230. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  1231. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1 || regexpUnsupportedDotAll || regexpUnsupportedNcg;
  1232. if (PATCH) {
  1233. patchedExec = function exec(string) {
  1234. var re = this;
  1235. var state = getInternalState(re);
  1236. var str = toString_1(string);
  1237. var raw = state.raw;
  1238. var result, reCopy, lastIndex, match, i, object, group;
  1239. if (raw) {
  1240. raw.lastIndex = re.lastIndex;
  1241. result = functionCall(patchedExec, raw, str);
  1242. re.lastIndex = raw.lastIndex;
  1243. return result;
  1244. }
  1245. var groups = state.groups;
  1246. var sticky = UNSUPPORTED_Y$1 && re.sticky;
  1247. var flags = functionCall(regexpFlags, re);
  1248. var source = re.source;
  1249. var charsAdded = 0;
  1250. var strCopy = str;
  1251. if (sticky) {
  1252. flags = replace$1(flags, 'y', '');
  1253. if (indexOf(flags, 'g') === -1) {
  1254. flags += 'g';
  1255. }
  1256. strCopy = stringSlice$4(str, re.lastIndex);
  1257. // Support anchored sticky behavior.
  1258. if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$3(str, re.lastIndex - 1) !== '\n')) {
  1259. source = '(?: ' + source + ')';
  1260. strCopy = ' ' + strCopy;
  1261. charsAdded++;
  1262. }
  1263. // ^(? + rx + ) is needed, in combination with some str slicing, to
  1264. // simulate the 'y' flag.
  1265. reCopy = new RegExp('^(?:' + source + ')', flags);
  1266. }
  1267. if (NPCG_INCLUDED) {
  1268. reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
  1269. }
  1270. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  1271. match = functionCall(nativeExec, sticky ? reCopy : re, strCopy);
  1272. if (sticky) {
  1273. if (match) {
  1274. match.input = stringSlice$4(match.input, charsAdded);
  1275. match[0] = stringSlice$4(match[0], charsAdded);
  1276. match.index = re.lastIndex;
  1277. re.lastIndex += match[0].length;
  1278. } else re.lastIndex = 0;
  1279. } else if (UPDATES_LAST_INDEX_WRONG && match) {
  1280. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  1281. }
  1282. if (NPCG_INCLUDED && match && match.length > 1) {
  1283. // Fix browsers whose `exec` methods don't consistently return `undefined`
  1284. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  1285. functionCall(nativeReplace, match[0], reCopy, function () {
  1286. for (i = 1; i < arguments.length - 2; i++) {
  1287. if (arguments[i] === undefined) match[i] = undefined;
  1288. }
  1289. });
  1290. }
  1291. if (match && groups) {
  1292. match.groups = object = objectCreate(null);
  1293. for (i = 0; i < groups.length; i++) {
  1294. group = groups[i];
  1295. object[group[0]] = match[group[1]];
  1296. }
  1297. }
  1298. return match;
  1299. };
  1300. }
  1301. var regexpExec = patchedExec;
  1302. // `RegExp.prototype.exec` method
  1303. // https://tc39.es/ecma262/#sec-regexp.prototype.exec
  1304. _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
  1305. exec: regexpExec
  1306. });
  1307. var FunctionPrototype = Function.prototype;
  1308. var apply = FunctionPrototype.apply;
  1309. var call = FunctionPrototype.call;
  1310. // eslint-disable-next-line es-x/no-reflect -- safe
  1311. var functionApply = typeof Reflect == 'object' && Reflect.apply || (functionBindNative ? call.bind(apply) : function () {
  1312. return call.apply(apply, arguments);
  1313. });
  1314. // TODO: Remove from `core-js@4` since it's moved to entry points
  1315. var SPECIES$3 = wellKnownSymbol('species');
  1316. var RegExpPrototype = RegExp.prototype;
  1317. var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
  1318. var SYMBOL = wellKnownSymbol(KEY);
  1319. var DELEGATES_TO_SYMBOL = !fails(function () {
  1320. // String methods call symbol-named RegEp methods
  1321. var O = {};
  1322. O[SYMBOL] = function () { return 7; };
  1323. return ''[KEY](O) != 7;
  1324. });
  1325. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  1326. // Symbol-named RegExp methods call .exec
  1327. var execCalled = false;
  1328. var re = /a/;
  1329. if (KEY === 'split') {
  1330. // We can't use real regex here since it causes deoptimization
  1331. // and serious performance degradation in V8
  1332. // https://github.com/zloirock/core-js/issues/306
  1333. re = {};
  1334. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  1335. // a new one. We need to return the patched regex when creating the new one.
  1336. re.constructor = {};
  1337. re.constructor[SPECIES$3] = function () { return re; };
  1338. re.flags = '';
  1339. re[SYMBOL] = /./[SYMBOL];
  1340. }
  1341. re.exec = function () { execCalled = true; return null; };
  1342. re[SYMBOL]('');
  1343. return !execCalled;
  1344. });
  1345. if (
  1346. !DELEGATES_TO_SYMBOL ||
  1347. !DELEGATES_TO_EXEC ||
  1348. FORCED
  1349. ) {
  1350. var uncurriedNativeRegExpMethod = functionUncurryThis(/./[SYMBOL]);
  1351. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  1352. var uncurriedNativeMethod = functionUncurryThis(nativeMethod);
  1353. var $exec = regexp.exec;
  1354. if ($exec === regexpExec || $exec === RegExpPrototype.exec) {
  1355. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  1356. // The native String method already delegates to @@method (this
  1357. // polyfilled function), leasing to infinite recursion.
  1358. // We avoid it by directly calling the native @@method method.
  1359. return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
  1360. }
  1361. return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
  1362. }
  1363. return { done: false };
  1364. });
  1365. defineBuiltIn(String.prototype, KEY, methods[0]);
  1366. defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]);
  1367. }
  1368. if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
  1369. };
  1370. var MATCH = wellKnownSymbol('match');
  1371. // `IsRegExp` abstract operation
  1372. // https://tc39.es/ecma262/#sec-isregexp
  1373. var isRegexp = function (it) {
  1374. var isRegExp;
  1375. return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
  1376. };
  1377. var TypeError$3 = global_1.TypeError;
  1378. // `Assert: IsConstructor(argument) is true`
  1379. var aConstructor = function (argument) {
  1380. if (isConstructor(argument)) return argument;
  1381. throw TypeError$3(tryToString(argument) + ' is not a constructor');
  1382. };
  1383. var SPECIES$2 = wellKnownSymbol('species');
  1384. // `SpeciesConstructor` abstract operation
  1385. // https://tc39.es/ecma262/#sec-speciesconstructor
  1386. var speciesConstructor = function (O, defaultConstructor) {
  1387. var C = anObject(O).constructor;
  1388. var S;
  1389. return C === undefined || (S = anObject(C)[SPECIES$2]) == undefined ? defaultConstructor : aConstructor(S);
  1390. };
  1391. var charAt$2 = functionUncurryThis(''.charAt);
  1392. var charCodeAt = functionUncurryThis(''.charCodeAt);
  1393. var stringSlice$3 = functionUncurryThis(''.slice);
  1394. var createMethod = function (CONVERT_TO_STRING) {
  1395. return function ($this, pos) {
  1396. var S = toString_1(requireObjectCoercible($this));
  1397. var position = toIntegerOrInfinity(pos);
  1398. var size = S.length;
  1399. var first, second;
  1400. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  1401. first = charCodeAt(S, position);
  1402. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  1403. || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
  1404. ? CONVERT_TO_STRING
  1405. ? charAt$2(S, position)
  1406. : first
  1407. : CONVERT_TO_STRING
  1408. ? stringSlice$3(S, position, position + 2)
  1409. : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  1410. };
  1411. };
  1412. var stringMultibyte = {
  1413. // `String.prototype.codePointAt` method
  1414. // https://tc39.es/ecma262/#sec-string.prototype.codepointat
  1415. codeAt: createMethod(false),
  1416. // `String.prototype.at` method
  1417. // https://github.com/mathiasbynens/String.prototype.at
  1418. charAt: createMethod(true)
  1419. };
  1420. var charAt$1 = stringMultibyte.charAt;
  1421. // `AdvanceStringIndex` abstract operation
  1422. // https://tc39.es/ecma262/#sec-advancestringindex
  1423. var advanceStringIndex = function (S, index, unicode) {
  1424. return index + (unicode ? charAt$1(S, index).length : 1);
  1425. };
  1426. var createProperty = function (object, key, value) {
  1427. var propertyKey = toPropertyKey(key);
  1428. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  1429. else object[propertyKey] = value;
  1430. };
  1431. var Array$2 = global_1.Array;
  1432. var max$2 = Math.max;
  1433. var arraySliceSimple = function (O, start, end) {
  1434. var length = lengthOfArrayLike(O);
  1435. var k = toAbsoluteIndex(start, length);
  1436. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  1437. var result = Array$2(max$2(fin - k, 0));
  1438. for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
  1439. result.length = n;
  1440. return result;
  1441. };
  1442. var TypeError$2 = global_1.TypeError;
  1443. // `RegExpExec` abstract operation
  1444. // https://tc39.es/ecma262/#sec-regexpexec
  1445. var regexpExecAbstract = function (R, S) {
  1446. var exec = R.exec;
  1447. if (isCallable(exec)) {
  1448. var result = functionCall(exec, R, S);
  1449. if (result !== null) anObject(result);
  1450. return result;
  1451. }
  1452. if (classofRaw(R) === 'RegExp') return functionCall(regexpExec, R, S);
  1453. throw TypeError$2('RegExp#exec called on incompatible receiver');
  1454. };
  1455. var UNSUPPORTED_Y = regexpStickyHelpers.UNSUPPORTED_Y;
  1456. var MAX_UINT32 = 0xFFFFFFFF;
  1457. var min$1 = Math.min;
  1458. var $push = [].push;
  1459. var exec = functionUncurryThis(/./.exec);
  1460. var push$1 = functionUncurryThis($push);
  1461. var stringSlice$2 = functionUncurryThis(''.slice);
  1462. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  1463. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  1464. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  1465. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  1466. var re = /(?:)/;
  1467. var originalExec = re.exec;
  1468. re.exec = function () { return originalExec.apply(this, arguments); };
  1469. var result = 'ab'.split(re);
  1470. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  1471. });
  1472. // @@split logic
  1473. fixRegexpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {
  1474. var internalSplit;
  1475. if (
  1476. 'abbc'.split(/(b)*/)[1] == 'c' ||
  1477. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  1478. 'test'.split(/(?:)/, -1).length != 4 ||
  1479. 'ab'.split(/(?:ab)*/).length != 2 ||
  1480. '.'.split(/(.?)(.?)/).length != 4 ||
  1481. // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
  1482. '.'.split(/()()/).length > 1 ||
  1483. ''.split(/.?/).length
  1484. ) {
  1485. // based on es5-shim implementation, need to rework it
  1486. internalSplit = function (separator, limit) {
  1487. var string = toString_1(requireObjectCoercible(this));
  1488. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  1489. if (lim === 0) return [];
  1490. if (separator === undefined) return [string];
  1491. // If `separator` is not a regex, use native split
  1492. if (!isRegexp(separator)) {
  1493. return functionCall(nativeSplit, string, separator, lim);
  1494. }
  1495. var output = [];
  1496. var flags = (separator.ignoreCase ? 'i' : '') +
  1497. (separator.multiline ? 'm' : '') +
  1498. (separator.unicode ? 'u' : '') +
  1499. (separator.sticky ? 'y' : '');
  1500. var lastLastIndex = 0;
  1501. // Make `global` and avoid `lastIndex` issues by working with a copy
  1502. var separatorCopy = new RegExp(separator.source, flags + 'g');
  1503. var match, lastIndex, lastLength;
  1504. while (match = functionCall(regexpExec, separatorCopy, string)) {
  1505. lastIndex = separatorCopy.lastIndex;
  1506. if (lastIndex > lastLastIndex) {
  1507. push$1(output, stringSlice$2(string, lastLastIndex, match.index));
  1508. if (match.length > 1 && match.index < string.length) functionApply($push, output, arraySliceSimple(match, 1));
  1509. lastLength = match[0].length;
  1510. lastLastIndex = lastIndex;
  1511. if (output.length >= lim) break;
  1512. }
  1513. if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
  1514. }
  1515. if (lastLastIndex === string.length) {
  1516. if (lastLength || !exec(separatorCopy, '')) push$1(output, '');
  1517. } else push$1(output, stringSlice$2(string, lastLastIndex));
  1518. return output.length > lim ? arraySliceSimple(output, 0, lim) : output;
  1519. };
  1520. // Chakra, V8
  1521. } else if ('0'.split(undefined, 0).length) {
  1522. internalSplit = function (separator, limit) {
  1523. return separator === undefined && limit === 0 ? [] : functionCall(nativeSplit, this, separator, limit);
  1524. };
  1525. } else internalSplit = nativeSplit;
  1526. return [
  1527. // `String.prototype.split` method
  1528. // https://tc39.es/ecma262/#sec-string.prototype.split
  1529. function split(separator, limit) {
  1530. var O = requireObjectCoercible(this);
  1531. var splitter = separator == undefined ? undefined : getMethod(separator, SPLIT);
  1532. return splitter
  1533. ? functionCall(splitter, separator, O, limit)
  1534. : functionCall(internalSplit, toString_1(O), separator, limit);
  1535. },
  1536. // `RegExp.prototype[@@split]` method
  1537. // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
  1538. //
  1539. // NOTE: This cannot be properly polyfilled in engines that don't support
  1540. // the 'y' flag.
  1541. function (string, limit) {
  1542. var rx = anObject(this);
  1543. var S = toString_1(string);
  1544. var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
  1545. if (res.done) return res.value;
  1546. var C = speciesConstructor(rx, RegExp);
  1547. var unicodeMatching = rx.unicode;
  1548. var flags = (rx.ignoreCase ? 'i' : '') +
  1549. (rx.multiline ? 'm' : '') +
  1550. (rx.unicode ? 'u' : '') +
  1551. (UNSUPPORTED_Y ? 'g' : 'y');
  1552. // ^(? + rx + ) is needed, in combination with some S slicing, to
  1553. // simulate the 'y' flag.
  1554. var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
  1555. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  1556. if (lim === 0) return [];
  1557. if (S.length === 0) return regexpExecAbstract(splitter, S) === null ? [S] : [];
  1558. var p = 0;
  1559. var q = 0;
  1560. var A = [];
  1561. while (q < S.length) {
  1562. splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
  1563. var z = regexpExecAbstract(splitter, UNSUPPORTED_Y ? stringSlice$2(S, q) : S);
  1564. var e;
  1565. if (
  1566. z === null ||
  1567. (e = min$1(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p
  1568. ) {
  1569. q = advanceStringIndex(S, q, unicodeMatching);
  1570. } else {
  1571. push$1(A, stringSlice$2(S, p, q));
  1572. if (A.length === lim) return A;
  1573. for (var i = 1; i <= z.length - 1; i++) {
  1574. push$1(A, z[i]);
  1575. if (A.length === lim) return A;
  1576. }
  1577. q = p = e;
  1578. }
  1579. }
  1580. push$1(A, stringSlice$2(S, p));
  1581. return A;
  1582. }
  1583. ];
  1584. }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
  1585. var floor = Math.floor;
  1586. var charAt = functionUncurryThis(''.charAt);
  1587. var replace = functionUncurryThis(''.replace);
  1588. var stringSlice$1 = functionUncurryThis(''.slice);
  1589. var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
  1590. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
  1591. // `GetSubstitution` abstract operation
  1592. // https://tc39.es/ecma262/#sec-getsubstitution
  1593. var getSubstitution = function (matched, str, position, captures, namedCaptures, replacement) {
  1594. var tailPos = position + matched.length;
  1595. var m = captures.length;
  1596. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  1597. if (namedCaptures !== undefined) {
  1598. namedCaptures = toObject(namedCaptures);
  1599. symbols = SUBSTITUTION_SYMBOLS;
  1600. }
  1601. return replace(replacement, symbols, function (match, ch) {
  1602. var capture;
  1603. switch (charAt(ch, 0)) {
  1604. case '$': return '$';
  1605. case '&': return matched;
  1606. case '`': return stringSlice$1(str, 0, position);
  1607. case "'": return stringSlice$1(str, tailPos);
  1608. case '<':
  1609. capture = namedCaptures[stringSlice$1(ch, 1, -1)];
  1610. break;
  1611. default: // \d\d?
  1612. var n = +ch;
  1613. if (n === 0) return match;
  1614. if (n > m) {
  1615. var f = floor(n / 10);
  1616. if (f === 0) return match;
  1617. if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
  1618. return match;
  1619. }
  1620. capture = captures[n - 1];
  1621. }
  1622. return capture === undefined ? '' : capture;
  1623. });
  1624. };
  1625. var REPLACE = wellKnownSymbol('replace');
  1626. var max$1 = Math.max;
  1627. var min = Math.min;
  1628. var concat$1 = functionUncurryThis([].concat);
  1629. var push = functionUncurryThis([].push);
  1630. var stringIndexOf = functionUncurryThis(''.indexOf);
  1631. var stringSlice = functionUncurryThis(''.slice);
  1632. var maybeToString = function (it) {
  1633. return it === undefined ? it : String(it);
  1634. };
  1635. // IE <= 11 replaces $0 with the whole match, as if it was $&
  1636. // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
  1637. var REPLACE_KEEPS_$0 = (function () {
  1638. // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
  1639. return 'a'.replace(/./, '$0') === '$0';
  1640. })();
  1641. // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
  1642. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
  1643. if (/./[REPLACE]) {
  1644. return /./[REPLACE]('a', '$0') === '';
  1645. }
  1646. return false;
  1647. })();
  1648. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  1649. var re = /./;
  1650. re.exec = function () {
  1651. var result = [];
  1652. result.groups = { a: '7' };
  1653. return result;
  1654. };
  1655. // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
  1656. return ''.replace(re, '$<a>') !== '7';
  1657. });
  1658. // @@replace logic
  1659. fixRegexpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
  1660. var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
  1661. return [
  1662. // `String.prototype.replace` method
  1663. // https://tc39.es/ecma262/#sec-string.prototype.replace
  1664. function replace(searchValue, replaceValue) {
  1665. var O = requireObjectCoercible(this);
  1666. var replacer = searchValue == undefined ? undefined : getMethod(searchValue, REPLACE);
  1667. return replacer
  1668. ? functionCall(replacer, searchValue, O, replaceValue)
  1669. : functionCall(nativeReplace, toString_1(O), searchValue, replaceValue);
  1670. },
  1671. // `RegExp.prototype[@@replace]` method
  1672. // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
  1673. function (string, replaceValue) {
  1674. var rx = anObject(this);
  1675. var S = toString_1(string);
  1676. if (
  1677. typeof replaceValue == 'string' &&
  1678. stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
  1679. stringIndexOf(replaceValue, '$<') === -1
  1680. ) {
  1681. var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
  1682. if (res.done) return res.value;
  1683. }
  1684. var functionalReplace = isCallable(replaceValue);
  1685. if (!functionalReplace) replaceValue = toString_1(replaceValue);
  1686. var global = rx.global;
  1687. if (global) {
  1688. var fullUnicode = rx.unicode;
  1689. rx.lastIndex = 0;
  1690. }
  1691. var results = [];
  1692. while (true) {
  1693. var result = regexpExecAbstract(rx, S);
  1694. if (result === null) break;
  1695. push(results, result);
  1696. if (!global) break;
  1697. var matchStr = toString_1(result[0]);
  1698. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  1699. }
  1700. var accumulatedResult = '';
  1701. var nextSourcePosition = 0;
  1702. for (var i = 0; i < results.length; i++) {
  1703. result = results[i];
  1704. var matched = toString_1(result[0]);
  1705. var position = max$1(min(toIntegerOrInfinity(result.index), S.length), 0);
  1706. var captures = [];
  1707. // NOTE: This is equivalent to
  1708. // captures = result.slice(1).map(maybeToString)
  1709. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  1710. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  1711. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  1712. for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j]));
  1713. var namedCaptures = result.groups;
  1714. if (functionalReplace) {
  1715. var replacerArgs = concat$1([matched], captures, position, S);
  1716. if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);
  1717. var replacement = toString_1(functionApply(replaceValue, undefined, replacerArgs));
  1718. } else {
  1719. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  1720. }
  1721. if (position >= nextSourcePosition) {
  1722. accumulatedResult += stringSlice(S, nextSourcePosition, position) + replacement;
  1723. nextSourcePosition = position + matched.length;
  1724. }
  1725. }
  1726. return accumulatedResult + stringSlice(S, nextSourcePosition);
  1727. }
  1728. ];
  1729. }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
  1730. var SPECIES$1 = wellKnownSymbol('species');
  1731. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  1732. // We can't use this feature detection in V8 since it causes
  1733. // deoptimization and serious performance degradation
  1734. // https://github.com/zloirock/core-js/issues/677
  1735. return engineV8Version >= 51 || !fails(function () {
  1736. var array = [];
  1737. var constructor = array.constructor = {};
  1738. constructor[SPECIES$1] = function () {
  1739. return { foo: 1 };
  1740. };
  1741. return array[METHOD_NAME](Boolean).foo !== 1;
  1742. });
  1743. };
  1744. var arraySlice = functionUncurryThis([].slice);
  1745. var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('slice');
  1746. var SPECIES = wellKnownSymbol('species');
  1747. var Array$1 = global_1.Array;
  1748. var max = Math.max;
  1749. // `Array.prototype.slice` method
  1750. // https://tc39.es/ecma262/#sec-array.prototype.slice
  1751. // fallback for not array-like ES3 strings and DOM objects
  1752. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
  1753. slice: function slice(start, end) {
  1754. var O = toIndexedObject(this);
  1755. var length = lengthOfArrayLike(O);
  1756. var k = toAbsoluteIndex(start, length);
  1757. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  1758. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  1759. var Constructor, result, n;
  1760. if (isArray(O)) {
  1761. Constructor = O.constructor;
  1762. // cross-realm fallback
  1763. if (isConstructor(Constructor) && (Constructor === Array$1 || isArray(Constructor.prototype))) {
  1764. Constructor = undefined;
  1765. } else if (isObject(Constructor)) {
  1766. Constructor = Constructor[SPECIES];
  1767. if (Constructor === null) Constructor = undefined;
  1768. }
  1769. if (Constructor === Array$1 || Constructor === undefined) {
  1770. return arraySlice(O, k, fin);
  1771. }
  1772. }
  1773. result = new (Constructor === undefined ? Array$1 : Constructor)(max(fin - k, 0));
  1774. for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
  1775. result.length = n;
  1776. return result;
  1777. }
  1778. });
  1779. var $map = arrayIteration.map;
  1780. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
  1781. // `Array.prototype.map` method
  1782. // https://tc39.es/ecma262/#sec-array.prototype.map
  1783. // with adding support of @@species
  1784. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  1785. map: function map(callbackfn /* , thisArg */) {
  1786. return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1787. }
  1788. });
  1789. // eslint-disable-next-line es-x/no-object-assign -- safe
  1790. var $assign = Object.assign;
  1791. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  1792. var defineProperty = Object.defineProperty;
  1793. var concat = functionUncurryThis([].concat);
  1794. // `Object.assign` method
  1795. // https://tc39.es/ecma262/#sec-object.assign
  1796. var objectAssign = !$assign || fails(function () {
  1797. // should have correct order of operations (Edge bug)
  1798. if (descriptors && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
  1799. enumerable: true,
  1800. get: function () {
  1801. defineProperty(this, 'b', {
  1802. value: 3,
  1803. enumerable: false
  1804. });
  1805. }
  1806. }), { b: 2 })).b !== 1) return true;
  1807. // should work with symbols and should have deterministic property order (V8 bug)
  1808. var A = {};
  1809. var B = {};
  1810. // eslint-disable-next-line es-x/no-symbol -- safe
  1811. var symbol = Symbol();
  1812. var alphabet = 'abcdefghijklmnopqrst';
  1813. A[symbol] = 7;
  1814. alphabet.split('').forEach(function (chr) { B[chr] = chr; });
  1815. return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
  1816. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
  1817. var T = toObject(target);
  1818. var argumentsLength = arguments.length;
  1819. var index = 1;
  1820. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  1821. var propertyIsEnumerable = objectPropertyIsEnumerable.f;
  1822. while (argumentsLength > index) {
  1823. var S = indexedObject(arguments[index++]);
  1824. var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
  1825. var length = keys.length;
  1826. var j = 0;
  1827. var key;
  1828. while (length > j) {
  1829. key = keys[j++];
  1830. if (!descriptors || functionCall(propertyIsEnumerable, S, key)) T[key] = S[key];
  1831. }
  1832. } return T;
  1833. } : $assign;
  1834. // `Object.assign` method
  1835. // https://tc39.es/ecma262/#sec-object.assign
  1836. // eslint-disable-next-line es-x/no-object-assign -- required for testing
  1837. _export({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== objectAssign }, {
  1838. assign: objectAssign
  1839. });
  1840. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  1841. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  1842. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  1843. var TypeError$1 = global_1.TypeError;
  1844. // We can't use this feature detection in V8 since it causes
  1845. // deoptimization and serious performance degradation
  1846. // https://github.com/zloirock/core-js/issues/679
  1847. var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
  1848. var array = [];
  1849. array[IS_CONCAT_SPREADABLE] = false;
  1850. return array.concat()[0] !== array;
  1851. });
  1852. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  1853. var isConcatSpreadable = function (O) {
  1854. if (!isObject(O)) return false;
  1855. var spreadable = O[IS_CONCAT_SPREADABLE];
  1856. return spreadable !== undefined ? !!spreadable : isArray(O);
  1857. };
  1858. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  1859. // `Array.prototype.concat` method
  1860. // https://tc39.es/ecma262/#sec-array.prototype.concat
  1861. // with adding support of @@isConcatSpreadable and @@species
  1862. _export({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
  1863. // eslint-disable-next-line no-unused-vars -- required for `.length`
  1864. concat: function concat(arg) {
  1865. var O = toObject(this);
  1866. var A = arraySpeciesCreate(O, 0);
  1867. var n = 0;
  1868. var i, k, length, len, E;
  1869. for (i = -1, length = arguments.length; i < length; i++) {
  1870. E = i === -1 ? O : arguments[i];
  1871. if (isConcatSpreadable(E)) {
  1872. len = lengthOfArrayLike(E);
  1873. if (n + len > MAX_SAFE_INTEGER) throw TypeError$1(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1874. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  1875. } else {
  1876. if (n >= MAX_SAFE_INTEGER) throw TypeError$1(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1877. createProperty(A, n++, E);
  1878. }
  1879. }
  1880. A.length = n;
  1881. return A;
  1882. }
  1883. });
  1884. var arrayMethodIsStrict = function (METHOD_NAME, argument) {
  1885. var method = [][METHOD_NAME];
  1886. return !!method && fails(function () {
  1887. // eslint-disable-next-line no-useless-call -- required for testing
  1888. method.call(null, argument || function () { return 1; }, 1);
  1889. });
  1890. };
  1891. var un$Join = functionUncurryThis([].join);
  1892. var ES3_STRINGS = indexedObject != Object;
  1893. var STRICT_METHOD$1 = arrayMethodIsStrict('join', ',');
  1894. // `Array.prototype.join` method
  1895. // https://tc39.es/ecma262/#sec-array.prototype.join
  1896. _export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD$1 }, {
  1897. join: function join(separator) {
  1898. return un$Join(toIndexedObject(this), separator === undefined ? ',' : separator);
  1899. }
  1900. });
  1901. // iterable DOM collections
  1902. // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
  1903. var domIterables = {
  1904. CSSRuleList: 0,
  1905. CSSStyleDeclaration: 0,
  1906. CSSValueList: 0,
  1907. ClientRectList: 0,
  1908. DOMRectList: 0,
  1909. DOMStringList: 0,
  1910. DOMTokenList: 1,
  1911. DataTransferItemList: 0,
  1912. FileList: 0,
  1913. HTMLAllCollection: 0,
  1914. HTMLCollection: 0,
  1915. HTMLFormElement: 0,
  1916. HTMLSelectElement: 0,
  1917. MediaList: 0,
  1918. MimeTypeArray: 0,
  1919. NamedNodeMap: 0,
  1920. NodeList: 1,
  1921. PaintRequestList: 0,
  1922. Plugin: 0,
  1923. PluginArray: 0,
  1924. SVGLengthList: 0,
  1925. SVGNumberList: 0,
  1926. SVGPathSegList: 0,
  1927. SVGPointList: 0,
  1928. SVGStringList: 0,
  1929. SVGTransformList: 0,
  1930. SourceBufferList: 0,
  1931. StyleSheetList: 0,
  1932. TextTrackCueList: 0,
  1933. TextTrackList: 0,
  1934. TouchList: 0
  1935. };
  1936. // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
  1937. var classList = documentCreateElement('span').classList;
  1938. var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype;
  1939. var domTokenListPrototype = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype;
  1940. var $forEach = arrayIteration.forEach;
  1941. var STRICT_METHOD = arrayMethodIsStrict('forEach');
  1942. // `Array.prototype.forEach` method implementation
  1943. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  1944. var arrayForEach = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) {
  1945. return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1946. // eslint-disable-next-line es-x/no-array-prototype-foreach -- safe
  1947. } : [].forEach;
  1948. var handlePrototype = function (CollectionPrototype) {
  1949. // some Chrome versions have non-configurable methods on DOMTokenList
  1950. if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
  1951. createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
  1952. } catch (error) {
  1953. CollectionPrototype.forEach = arrayForEach;
  1954. }
  1955. };
  1956. for (var COLLECTION_NAME in domIterables) {
  1957. if (domIterables[COLLECTION_NAME]) {
  1958. handlePrototype(global_1[COLLECTION_NAME] && global_1[COLLECTION_NAME].prototype);
  1959. }
  1960. }
  1961. handlePrototype(domTokenListPrototype);
  1962. /**
  1963. * @author zhixin wen <wenzhixin2010@gmail.com>
  1964. * extensions: https://github.com/hhurz/tableExport.jquery.plugin
  1965. */
  1966. var Utils = $__default["default"].fn.bootstrapTable.utils;
  1967. var TYPE_NAME = {
  1968. json: 'JSON',
  1969. xml: 'XML',
  1970. png: 'PNG',
  1971. csv: 'CSV',
  1972. txt: 'TXT',
  1973. sql: 'SQL',
  1974. doc: 'MS-Word',
  1975. excel: 'MS-Excel',
  1976. xlsx: 'MS-Excel (OpenXML)',
  1977. powerpoint: 'MS-Powerpoint',
  1978. pdf: 'PDF'
  1979. };
  1980. $__default["default"].extend($__default["default"].fn.bootstrapTable.defaults, {
  1981. showExport: false,
  1982. exportDataType: 'basic',
  1983. // basic, all, selected
  1984. exportTypes: ['json', 'xml', 'csv', 'txt', 'sql', 'excel'],
  1985. exportOptions: {
  1986. onCellHtmlData: function onCellHtmlData(cell, rowIndex, colIndex, htmlData) {
  1987. if (cell.is('th')) {
  1988. return cell.find('.th-inner').text();
  1989. }
  1990. return htmlData;
  1991. }
  1992. },
  1993. exportFooter: false
  1994. });
  1995. $__default["default"].extend($__default["default"].fn.bootstrapTable.columnDefaults, {
  1996. forceExport: false,
  1997. forceHide: false
  1998. });
  1999. $__default["default"].extend($__default["default"].fn.bootstrapTable.defaults.icons, {
  2000. export: {
  2001. bootstrap3: 'glyphicon-export icon-share',
  2002. bootstrap5: 'bi-download',
  2003. materialize: 'file_download',
  2004. 'bootstrap-table': 'icon-download'
  2005. }[$__default["default"].fn.bootstrapTable.theme] || 'fa-download'
  2006. });
  2007. $__default["default"].extend($__default["default"].fn.bootstrapTable.locales, {
  2008. formatExport: function formatExport() {
  2009. return 'Export data';
  2010. }
  2011. });
  2012. $__default["default"].extend($__default["default"].fn.bootstrapTable.defaults, $__default["default"].fn.bootstrapTable.locales);
  2013. $__default["default"].fn.bootstrapTable.methods.push('exportTable');
  2014. $__default["default"].extend($__default["default"].fn.bootstrapTable.defaults, {
  2015. // eslint-disable-next-line no-unused-vars
  2016. onExportSaved: function onExportSaved(exportedRows) {
  2017. return false;
  2018. }
  2019. });
  2020. $__default["default"].extend($__default["default"].fn.bootstrapTable.Constructor.EVENTS, {
  2021. 'export-saved.bs.table': 'onExportSaved'
  2022. });
  2023. $__default["default"].BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
  2024. _inherits(_class, _$$BootstrapTable);
  2025. var _super = _createSuper(_class);
  2026. function _class() {
  2027. _classCallCheck(this, _class);
  2028. return _super.apply(this, arguments);
  2029. }
  2030. _createClass(_class, [{
  2031. key: "initToolbar",
  2032. value: function initToolbar() {
  2033. var _this = this,
  2034. _get2;
  2035. var o = this.options;
  2036. var exportTypes = o.exportTypes;
  2037. this.showToolbar = this.showToolbar || o.showExport;
  2038. if (this.options.showExport) {
  2039. if (typeof exportTypes === 'string') {
  2040. var types = exportTypes.slice(1, -1).replace(/ /g, '').split(',');
  2041. exportTypes = types.map(function (t) {
  2042. return t.slice(1, -1);
  2043. });
  2044. }
  2045. if (typeof o.exportOptions === 'string') {
  2046. o.exportOptions = Utils.calculateObjectValue(null, o.exportOptions);
  2047. }
  2048. this.$export = this.$toolbar.find('>.columns div.export');
  2049. if (this.$export.length) {
  2050. this.updateExportButton();
  2051. return;
  2052. }
  2053. this.buttons = Object.assign(this.buttons, {
  2054. export: {
  2055. html: function html() {
  2056. if (exportTypes.length === 1) {
  2057. return "\n <div class=\"export ".concat(_this.constants.classes.buttonsDropdown, "\"\n data-type=\"").concat(exportTypes[0], "\">\n <button class=\"").concat(_this.constants.buttonsClass, "\"\n aria-label=\"Export\"\n type=\"button\"\n title=\"").concat(o.formatExport(), "\">\n ").concat(o.showButtonIcons ? Utils.sprintf(_this.constants.html.icon, o.iconsPrefix, o.icons.export) : '', "\n ").concat(o.showButtonText ? o.formatExport() : '', "\n </button>\n </div>\n ");
  2058. }
  2059. var html = [];
  2060. html.push("\n <div class=\"export ".concat(_this.constants.classes.buttonsDropdown, "\">\n <button class=\"").concat(_this.constants.buttonsClass, " dropdown-toggle\"\n aria-label=\"Export\"\n ").concat(_this.constants.dataToggle, "=\"dropdown\"\n type=\"button\"\n title=\"").concat(o.formatExport(), "\">\n ").concat(o.showButtonIcons ? Utils.sprintf(_this.constants.html.icon, o.iconsPrefix, o.icons.export) : '', "\n ").concat(o.showButtonText ? o.formatExport() : '', "\n ").concat(_this.constants.html.dropdownCaret, "\n </button>\n ").concat(_this.constants.html.toolbarDropdown[0], "\n "));
  2061. var _iterator = _createForOfIteratorHelper(exportTypes),
  2062. _step;
  2063. try {
  2064. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  2065. var type = _step.value;
  2066. if (TYPE_NAME.hasOwnProperty(type)) {
  2067. var $item = $__default["default"](Utils.sprintf(_this.constants.html.pageDropdownItem, '', TYPE_NAME[type]));
  2068. $item.attr('data-type', type);
  2069. html.push($item.prop('outerHTML'));
  2070. }
  2071. }
  2072. } catch (err) {
  2073. _iterator.e(err);
  2074. } finally {
  2075. _iterator.f();
  2076. }
  2077. html.push(_this.constants.html.toolbarDropdown[1], '</div>');
  2078. return html.join('');
  2079. }
  2080. }
  2081. });
  2082. }
  2083. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  2084. args[_key] = arguments[_key];
  2085. }
  2086. (_get2 = _get(_getPrototypeOf(_class.prototype), "initToolbar", this)).call.apply(_get2, [this].concat(args));
  2087. this.$export = this.$toolbar.find('>.columns div.export');
  2088. if (!this.options.showExport) {
  2089. return;
  2090. }
  2091. this.updateExportButton();
  2092. var $exportButtons = this.$export.find('[data-type]');
  2093. if (exportTypes.length === 1) {
  2094. $exportButtons = this.$export;
  2095. }
  2096. $exportButtons.click(function (e) {
  2097. e.preventDefault();
  2098. var type = $__default["default"](e.currentTarget).data('type');
  2099. var exportOptions = {
  2100. type: type,
  2101. escape: false
  2102. };
  2103. _this.exportTable(exportOptions);
  2104. });
  2105. this.handleToolbar();
  2106. }
  2107. }, {
  2108. key: "handleToolbar",
  2109. value: function handleToolbar() {
  2110. if (!this.$export) {
  2111. return;
  2112. }
  2113. if (_get(_getPrototypeOf(_class.prototype), "handleToolbar", this)) {
  2114. _get(_getPrototypeOf(_class.prototype), "handleToolbar", this).call(this);
  2115. }
  2116. }
  2117. }, {
  2118. key: "exportTable",
  2119. value: function exportTable(options) {
  2120. var _this2 = this;
  2121. var o = this.options;
  2122. var stateField = this.header.stateField;
  2123. var isCardView = o.cardView;
  2124. var doExport = function doExport(callback) {
  2125. if (stateField) {
  2126. _this2.hideColumn(stateField);
  2127. }
  2128. if (isCardView) {
  2129. _this2.toggleView();
  2130. }
  2131. _this2.columns.forEach(function (row) {
  2132. if (row.forceHide) {
  2133. _this2.hideColumn(row.field);
  2134. }
  2135. });
  2136. var data = _this2.getData();
  2137. if (o.detailView && o.detailViewIcon) {
  2138. var detailViewIndex = o.detailViewAlign === 'left' ? 0 : _this2.getVisibleFields().length + Utils.getDetailViewIndexOffset(_this2.options);
  2139. o.exportOptions.ignoreColumn = [detailViewIndex].concat(o.exportOptions.ignoreColumn || []);
  2140. }
  2141. if (o.exportFooter) {
  2142. var $footerRow = _this2.$tableFooter.find('tr').first();
  2143. var footerData = {};
  2144. var footerHtml = [];
  2145. $__default["default"].each($footerRow.children(), function (index, footerCell) {
  2146. var footerCellHtml = $__default["default"](footerCell).children('.th-inner').first().html();
  2147. footerData[_this2.columns[index].field] = footerCellHtml === '&nbsp;' ? null : footerCellHtml; // grab footer cell text into cell index-based array
  2148. footerHtml.push(footerCellHtml);
  2149. });
  2150. _this2.$body.append(_this2.$body.children().last()[0].outerHTML);
  2151. var $lastTableRow = _this2.$body.children().last();
  2152. $__default["default"].each($lastTableRow.children(), function (index, lastTableRowCell) {
  2153. $__default["default"](lastTableRowCell).html(footerHtml[index]);
  2154. });
  2155. }
  2156. var hiddenColumns = _this2.getHiddenColumns();
  2157. hiddenColumns.forEach(function (row) {
  2158. if (row.forceExport) {
  2159. _this2.showColumn(row.field);
  2160. }
  2161. });
  2162. if (typeof o.exportOptions.fileName === 'function') {
  2163. options.fileName = o.exportOptions.fileName();
  2164. }
  2165. _this2.$el.tableExport($__default["default"].extend({
  2166. onAfterSaveToFile: function onAfterSaveToFile() {
  2167. if (o.exportFooter) {
  2168. _this2.load(data);
  2169. }
  2170. if (stateField) {
  2171. _this2.showColumn(stateField);
  2172. }
  2173. if (isCardView) {
  2174. _this2.toggleView();
  2175. }
  2176. hiddenColumns.forEach(function (row) {
  2177. if (row.forceExport) {
  2178. _this2.hideColumn(row.field);
  2179. }
  2180. });
  2181. _this2.columns.forEach(function (row) {
  2182. if (row.forceHide) {
  2183. _this2.showColumn(row.field);
  2184. }
  2185. });
  2186. if (callback) callback();
  2187. }
  2188. }, o.exportOptions, options));
  2189. };
  2190. if (o.exportDataType === 'all' && o.pagination) {
  2191. var eventName = o.sidePagination === 'server' ? 'post-body.bs.table' : 'page-change.bs.table';
  2192. var virtualScroll = this.options.virtualScroll;
  2193. this.$el.one(eventName, function () {
  2194. setTimeout(function () {
  2195. doExport(function () {
  2196. _this2.options.virtualScroll = virtualScroll;
  2197. _this2.togglePagination();
  2198. });
  2199. }, 0);
  2200. });
  2201. this.options.virtualScroll = false;
  2202. this.togglePagination();
  2203. this.trigger('export-saved', this.getData());
  2204. } else if (o.exportDataType === 'selected') {
  2205. var data = this.getData();
  2206. var selectedData = this.getSelections();
  2207. var pagination = o.pagination;
  2208. if (!selectedData.length) {
  2209. return;
  2210. }
  2211. if (o.sidePagination === 'server') {
  2212. data = _defineProperty({
  2213. total: o.totalRows
  2214. }, this.options.dataField, data);
  2215. selectedData = _defineProperty({
  2216. total: selectedData.length
  2217. }, this.options.dataField, selectedData);
  2218. }
  2219. this.load(selectedData);
  2220. if (pagination) {
  2221. this.togglePagination();
  2222. }
  2223. doExport(function () {
  2224. if (pagination) {
  2225. _this2.togglePagination();
  2226. }
  2227. _this2.load(data);
  2228. });
  2229. this.trigger('export-saved', selectedData);
  2230. } else {
  2231. doExport();
  2232. this.trigger('export-saved', this.getData(true));
  2233. }
  2234. }
  2235. }, {
  2236. key: "updateSelected",
  2237. value: function updateSelected() {
  2238. _get(_getPrototypeOf(_class.prototype), "updateSelected", this).call(this);
  2239. this.updateExportButton();
  2240. }
  2241. }, {
  2242. key: "updateExportButton",
  2243. value: function updateExportButton() {
  2244. if (this.options.exportDataType === 'selected') {
  2245. this.$export.find('> button').prop('disabled', !this.getSelections().length);
  2246. }
  2247. }
  2248. }]);
  2249. return _class;
  2250. }($__default["default"].BootstrapTable);
  2251. }));