bootstrap-table-toolbar.js 71 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061
  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. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  9. function createCommonjsModule(fn, module) {
  10. return module = { exports: {} }, fn(module, module.exports), module.exports;
  11. }
  12. var check = function (it) {
  13. return it && it.Math == Math && it;
  14. };
  15. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  16. var global_1 =
  17. // eslint-disable-next-line no-undef
  18. check(typeof globalThis == 'object' && globalThis) ||
  19. check(typeof window == 'object' && window) ||
  20. check(typeof self == 'object' && self) ||
  21. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  22. // eslint-disable-next-line no-new-func
  23. (function () { return this; })() || Function('return this')();
  24. var fails = function (exec) {
  25. try {
  26. return !!exec();
  27. } catch (error) {
  28. return true;
  29. }
  30. };
  31. // Thank's IE8 for his funny defineProperty
  32. var descriptors = !fails(function () {
  33. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  34. });
  35. var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
  36. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  37. // Nashorn ~ JDK8 bug
  38. var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
  39. // `Object.prototype.propertyIsEnumerable` method implementation
  40. // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
  41. var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  42. var descriptor = getOwnPropertyDescriptor(this, V);
  43. return !!descriptor && descriptor.enumerable;
  44. } : nativePropertyIsEnumerable;
  45. var objectPropertyIsEnumerable = {
  46. f: f
  47. };
  48. var createPropertyDescriptor = function (bitmap, value) {
  49. return {
  50. enumerable: !(bitmap & 1),
  51. configurable: !(bitmap & 2),
  52. writable: !(bitmap & 4),
  53. value: value
  54. };
  55. };
  56. var toString = {}.toString;
  57. var classofRaw = function (it) {
  58. return toString.call(it).slice(8, -1);
  59. };
  60. var split = ''.split;
  61. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  62. var indexedObject = fails(function () {
  63. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  64. // eslint-disable-next-line no-prototype-builtins
  65. return !Object('z').propertyIsEnumerable(0);
  66. }) ? function (it) {
  67. return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
  68. } : Object;
  69. // `RequireObjectCoercible` abstract operation
  70. // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
  71. var requireObjectCoercible = function (it) {
  72. if (it == undefined) throw TypeError("Can't call method on " + it);
  73. return it;
  74. };
  75. // toObject with fallback for non-array-like ES3 strings
  76. var toIndexedObject = function (it) {
  77. return indexedObject(requireObjectCoercible(it));
  78. };
  79. var isObject = function (it) {
  80. return typeof it === 'object' ? it !== null : typeof it === 'function';
  81. };
  82. // `ToPrimitive` abstract operation
  83. // https://tc39.github.io/ecma262/#sec-toprimitive
  84. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  85. // and the second argument - flag - preferred type is a string
  86. var toPrimitive = function (input, PREFERRED_STRING) {
  87. if (!isObject(input)) return input;
  88. var fn, val;
  89. if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  90. if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
  91. if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  92. throw TypeError("Can't convert object to primitive value");
  93. };
  94. var hasOwnProperty = {}.hasOwnProperty;
  95. var has = function (it, key) {
  96. return hasOwnProperty.call(it, key);
  97. };
  98. var document$1 = global_1.document;
  99. // typeof document.createElement is 'object' in old IE
  100. var EXISTS = isObject(document$1) && isObject(document$1.createElement);
  101. var documentCreateElement = function (it) {
  102. return EXISTS ? document$1.createElement(it) : {};
  103. };
  104. // Thank's IE8 for his funny defineProperty
  105. var ie8DomDefine = !descriptors && !fails(function () {
  106. return Object.defineProperty(documentCreateElement('div'), 'a', {
  107. get: function () { return 7; }
  108. }).a != 7;
  109. });
  110. var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  111. // `Object.getOwnPropertyDescriptor` method
  112. // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
  113. var f$1 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  114. O = toIndexedObject(O);
  115. P = toPrimitive(P, true);
  116. if (ie8DomDefine) try {
  117. return nativeGetOwnPropertyDescriptor(O, P);
  118. } catch (error) { /* empty */ }
  119. if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
  120. };
  121. var objectGetOwnPropertyDescriptor = {
  122. f: f$1
  123. };
  124. var anObject = function (it) {
  125. if (!isObject(it)) {
  126. throw TypeError(String(it) + ' is not an object');
  127. } return it;
  128. };
  129. var nativeDefineProperty = Object.defineProperty;
  130. // `Object.defineProperty` method
  131. // https://tc39.github.io/ecma262/#sec-object.defineproperty
  132. var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
  133. anObject(O);
  134. P = toPrimitive(P, true);
  135. anObject(Attributes);
  136. if (ie8DomDefine) try {
  137. return nativeDefineProperty(O, P, Attributes);
  138. } catch (error) { /* empty */ }
  139. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  140. if ('value' in Attributes) O[P] = Attributes.value;
  141. return O;
  142. };
  143. var objectDefineProperty = {
  144. f: f$2
  145. };
  146. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  147. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  148. } : function (object, key, value) {
  149. object[key] = value;
  150. return object;
  151. };
  152. var setGlobal = function (key, value) {
  153. try {
  154. createNonEnumerableProperty(global_1, key, value);
  155. } catch (error) {
  156. global_1[key] = value;
  157. } return value;
  158. };
  159. var SHARED = '__core-js_shared__';
  160. var store = global_1[SHARED] || setGlobal(SHARED, {});
  161. var sharedStore = store;
  162. var functionToString = Function.toString;
  163. // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
  164. if (typeof sharedStore.inspectSource != 'function') {
  165. sharedStore.inspectSource = function (it) {
  166. return functionToString.call(it);
  167. };
  168. }
  169. var inspectSource = sharedStore.inspectSource;
  170. var WeakMap = global_1.WeakMap;
  171. var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
  172. var shared = createCommonjsModule(function (module) {
  173. (module.exports = function (key, value) {
  174. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  175. })('versions', []).push({
  176. version: '3.8.1',
  177. mode: 'global',
  178. copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
  179. });
  180. });
  181. var id = 0;
  182. var postfix = Math.random();
  183. var uid = function (key) {
  184. return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
  185. };
  186. var keys = shared('keys');
  187. var sharedKey = function (key) {
  188. return keys[key] || (keys[key] = uid(key));
  189. };
  190. var hiddenKeys = {};
  191. var WeakMap$1 = global_1.WeakMap;
  192. var set, get, has$1;
  193. var enforce = function (it) {
  194. return has$1(it) ? get(it) : set(it, {});
  195. };
  196. var getterFor = function (TYPE) {
  197. return function (it) {
  198. var state;
  199. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  200. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  201. } return state;
  202. };
  203. };
  204. if (nativeWeakMap) {
  205. var store$1 = sharedStore.state || (sharedStore.state = new WeakMap$1());
  206. var wmget = store$1.get;
  207. var wmhas = store$1.has;
  208. var wmset = store$1.set;
  209. set = function (it, metadata) {
  210. metadata.facade = it;
  211. wmset.call(store$1, it, metadata);
  212. return metadata;
  213. };
  214. get = function (it) {
  215. return wmget.call(store$1, it) || {};
  216. };
  217. has$1 = function (it) {
  218. return wmhas.call(store$1, it);
  219. };
  220. } else {
  221. var STATE = sharedKey('state');
  222. hiddenKeys[STATE] = true;
  223. set = function (it, metadata) {
  224. metadata.facade = it;
  225. createNonEnumerableProperty(it, STATE, metadata);
  226. return metadata;
  227. };
  228. get = function (it) {
  229. return has(it, STATE) ? it[STATE] : {};
  230. };
  231. has$1 = function (it) {
  232. return has(it, STATE);
  233. };
  234. }
  235. var internalState = {
  236. set: set,
  237. get: get,
  238. has: has$1,
  239. enforce: enforce,
  240. getterFor: getterFor
  241. };
  242. var redefine = createCommonjsModule(function (module) {
  243. var getInternalState = internalState.get;
  244. var enforceInternalState = internalState.enforce;
  245. var TEMPLATE = String(String).split('String');
  246. (module.exports = function (O, key, value, options) {
  247. var unsafe = options ? !!options.unsafe : false;
  248. var simple = options ? !!options.enumerable : false;
  249. var noTargetGet = options ? !!options.noTargetGet : false;
  250. var state;
  251. if (typeof value == 'function') {
  252. if (typeof key == 'string' && !has(value, 'name')) {
  253. createNonEnumerableProperty(value, 'name', key);
  254. }
  255. state = enforceInternalState(value);
  256. if (!state.source) {
  257. state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
  258. }
  259. }
  260. if (O === global_1) {
  261. if (simple) O[key] = value;
  262. else setGlobal(key, value);
  263. return;
  264. } else if (!unsafe) {
  265. delete O[key];
  266. } else if (!noTargetGet && O[key]) {
  267. simple = true;
  268. }
  269. if (simple) O[key] = value;
  270. else createNonEnumerableProperty(O, key, value);
  271. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  272. })(Function.prototype, 'toString', function toString() {
  273. return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
  274. });
  275. });
  276. var path = global_1;
  277. var aFunction = function (variable) {
  278. return typeof variable == 'function' ? variable : undefined;
  279. };
  280. var getBuiltIn = function (namespace, method) {
  281. return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace])
  282. : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
  283. };
  284. var ceil = Math.ceil;
  285. var floor = Math.floor;
  286. // `ToInteger` abstract operation
  287. // https://tc39.github.io/ecma262/#sec-tointeger
  288. var toInteger = function (argument) {
  289. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
  290. };
  291. var min = Math.min;
  292. // `ToLength` abstract operation
  293. // https://tc39.github.io/ecma262/#sec-tolength
  294. var toLength = function (argument) {
  295. return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  296. };
  297. var max = Math.max;
  298. var min$1 = Math.min;
  299. // Helper for a popular repeating case of the spec:
  300. // Let integer be ? ToInteger(index).
  301. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  302. var toAbsoluteIndex = function (index, length) {
  303. var integer = toInteger(index);
  304. return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
  305. };
  306. // `Array.prototype.{ indexOf, includes }` methods implementation
  307. var createMethod = function (IS_INCLUDES) {
  308. return function ($this, el, fromIndex) {
  309. var O = toIndexedObject($this);
  310. var length = toLength(O.length);
  311. var index = toAbsoluteIndex(fromIndex, length);
  312. var value;
  313. // Array#includes uses SameValueZero equality algorithm
  314. // eslint-disable-next-line no-self-compare
  315. if (IS_INCLUDES && el != el) while (length > index) {
  316. value = O[index++];
  317. // eslint-disable-next-line no-self-compare
  318. if (value != value) return true;
  319. // Array#indexOf ignores holes, Array#includes - not
  320. } else for (;length > index; index++) {
  321. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  322. } return !IS_INCLUDES && -1;
  323. };
  324. };
  325. var arrayIncludes = {
  326. // `Array.prototype.includes` method
  327. // https://tc39.github.io/ecma262/#sec-array.prototype.includes
  328. includes: createMethod(true),
  329. // `Array.prototype.indexOf` method
  330. // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
  331. indexOf: createMethod(false)
  332. };
  333. var indexOf = arrayIncludes.indexOf;
  334. var objectKeysInternal = function (object, names) {
  335. var O = toIndexedObject(object);
  336. var i = 0;
  337. var result = [];
  338. var key;
  339. for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
  340. // Don't enum bug & hidden keys
  341. while (names.length > i) if (has(O, key = names[i++])) {
  342. ~indexOf(result, key) || result.push(key);
  343. }
  344. return result;
  345. };
  346. // IE8- don't enum bug keys
  347. var enumBugKeys = [
  348. 'constructor',
  349. 'hasOwnProperty',
  350. 'isPrototypeOf',
  351. 'propertyIsEnumerable',
  352. 'toLocaleString',
  353. 'toString',
  354. 'valueOf'
  355. ];
  356. var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
  357. // `Object.getOwnPropertyNames` method
  358. // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
  359. var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  360. return objectKeysInternal(O, hiddenKeys$1);
  361. };
  362. var objectGetOwnPropertyNames = {
  363. f: f$3
  364. };
  365. var f$4 = Object.getOwnPropertySymbols;
  366. var objectGetOwnPropertySymbols = {
  367. f: f$4
  368. };
  369. // all object keys, includes non-enumerable and symbols
  370. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  371. var keys = objectGetOwnPropertyNames.f(anObject(it));
  372. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  373. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  374. };
  375. var copyConstructorProperties = function (target, source) {
  376. var keys = ownKeys(source);
  377. var defineProperty = objectDefineProperty.f;
  378. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  379. for (var i = 0; i < keys.length; i++) {
  380. var key = keys[i];
  381. if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  382. }
  383. };
  384. var replacement = /#|\.prototype\./;
  385. var isForced = function (feature, detection) {
  386. var value = data[normalize(feature)];
  387. return value == POLYFILL ? true
  388. : value == NATIVE ? false
  389. : typeof detection == 'function' ? fails(detection)
  390. : !!detection;
  391. };
  392. var normalize = isForced.normalize = function (string) {
  393. return String(string).replace(replacement, '.').toLowerCase();
  394. };
  395. var data = isForced.data = {};
  396. var NATIVE = isForced.NATIVE = 'N';
  397. var POLYFILL = isForced.POLYFILL = 'P';
  398. var isForced_1 = isForced;
  399. var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
  400. /*
  401. options.target - name of the target object
  402. options.global - target is the global object
  403. options.stat - export as static methods of target
  404. options.proto - export as prototype methods of target
  405. options.real - real prototype method for the `pure` version
  406. options.forced - export even if the native feature is available
  407. options.bind - bind methods to the target, required for the `pure` version
  408. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  409. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  410. options.sham - add a flag to not completely full polyfills
  411. options.enumerable - export as enumerable property
  412. options.noTargetGet - prevent calling a getter on target
  413. */
  414. var _export = function (options, source) {
  415. var TARGET = options.target;
  416. var GLOBAL = options.global;
  417. var STATIC = options.stat;
  418. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  419. if (GLOBAL) {
  420. target = global_1;
  421. } else if (STATIC) {
  422. target = global_1[TARGET] || setGlobal(TARGET, {});
  423. } else {
  424. target = (global_1[TARGET] || {}).prototype;
  425. }
  426. if (target) for (key in source) {
  427. sourceProperty = source[key];
  428. if (options.noTargetGet) {
  429. descriptor = getOwnPropertyDescriptor$1(target, key);
  430. targetProperty = descriptor && descriptor.value;
  431. } else targetProperty = target[key];
  432. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  433. // contained in target
  434. if (!FORCED && targetProperty !== undefined) {
  435. if (typeof sourceProperty === typeof targetProperty) continue;
  436. copyConstructorProperties(sourceProperty, targetProperty);
  437. }
  438. // add a flag to not completely full polyfills
  439. if (options.sham || (targetProperty && targetProperty.sham)) {
  440. createNonEnumerableProperty(sourceProperty, 'sham', true);
  441. }
  442. // extend global
  443. redefine(target, key, sourceProperty, options);
  444. }
  445. };
  446. // `IsArray` abstract operation
  447. // https://tc39.github.io/ecma262/#sec-isarray
  448. var isArray = Array.isArray || function isArray(arg) {
  449. return classofRaw(arg) == 'Array';
  450. };
  451. // `ToObject` abstract operation
  452. // https://tc39.github.io/ecma262/#sec-toobject
  453. var toObject = function (argument) {
  454. return Object(requireObjectCoercible(argument));
  455. };
  456. var createProperty = function (object, key, value) {
  457. var propertyKey = toPrimitive(key);
  458. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  459. else object[propertyKey] = value;
  460. };
  461. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  462. // Chrome 38 Symbol has incorrect toString conversion
  463. // eslint-disable-next-line no-undef
  464. return !String(Symbol());
  465. });
  466. var useSymbolAsUid = nativeSymbol
  467. // eslint-disable-next-line no-undef
  468. && !Symbol.sham
  469. // eslint-disable-next-line no-undef
  470. && typeof Symbol.iterator == 'symbol';
  471. var WellKnownSymbolsStore = shared('wks');
  472. var Symbol$1 = global_1.Symbol;
  473. var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
  474. var wellKnownSymbol = function (name) {
  475. if (!has(WellKnownSymbolsStore, name)) {
  476. if (nativeSymbol && has(Symbol$1, name)) WellKnownSymbolsStore[name] = Symbol$1[name];
  477. else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
  478. } return WellKnownSymbolsStore[name];
  479. };
  480. var SPECIES = wellKnownSymbol('species');
  481. // `ArraySpeciesCreate` abstract operation
  482. // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
  483. var arraySpeciesCreate = function (originalArray, length) {
  484. var C;
  485. if (isArray(originalArray)) {
  486. C = originalArray.constructor;
  487. // cross-realm fallback
  488. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  489. else if (isObject(C)) {
  490. C = C[SPECIES];
  491. if (C === null) C = undefined;
  492. }
  493. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  494. };
  495. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  496. var process = global_1.process;
  497. var versions = process && process.versions;
  498. var v8 = versions && versions.v8;
  499. var match, version;
  500. if (v8) {
  501. match = v8.split('.');
  502. version = match[0] + match[1];
  503. } else if (engineUserAgent) {
  504. match = engineUserAgent.match(/Edge\/(\d+)/);
  505. if (!match || match[1] >= 74) {
  506. match = engineUserAgent.match(/Chrome\/(\d+)/);
  507. if (match) version = match[1];
  508. }
  509. }
  510. var engineV8Version = version && +version;
  511. var SPECIES$1 = wellKnownSymbol('species');
  512. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  513. // We can't use this feature detection in V8 since it causes
  514. // deoptimization and serious performance degradation
  515. // https://github.com/zloirock/core-js/issues/677
  516. return engineV8Version >= 51 || !fails(function () {
  517. var array = [];
  518. var constructor = array.constructor = {};
  519. constructor[SPECIES$1] = function () {
  520. return { foo: 1 };
  521. };
  522. return array[METHOD_NAME](Boolean).foo !== 1;
  523. });
  524. };
  525. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  526. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  527. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  528. // We can't use this feature detection in V8 since it causes
  529. // deoptimization and serious performance degradation
  530. // https://github.com/zloirock/core-js/issues/679
  531. var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
  532. var array = [];
  533. array[IS_CONCAT_SPREADABLE] = false;
  534. return array.concat()[0] !== array;
  535. });
  536. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  537. var isConcatSpreadable = function (O) {
  538. if (!isObject(O)) return false;
  539. var spreadable = O[IS_CONCAT_SPREADABLE];
  540. return spreadable !== undefined ? !!spreadable : isArray(O);
  541. };
  542. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  543. // `Array.prototype.concat` method
  544. // https://tc39.github.io/ecma262/#sec-array.prototype.concat
  545. // with adding support of @@isConcatSpreadable and @@species
  546. _export({ target: 'Array', proto: true, forced: FORCED }, {
  547. concat: function concat(arg) { // eslint-disable-line no-unused-vars
  548. var O = toObject(this);
  549. var A = arraySpeciesCreate(O, 0);
  550. var n = 0;
  551. var i, k, length, len, E;
  552. for (i = -1, length = arguments.length; i < length; i++) {
  553. E = i === -1 ? O : arguments[i];
  554. if (isConcatSpreadable(E)) {
  555. len = toLength(E.length);
  556. if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  557. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  558. } else {
  559. if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  560. createProperty(A, n++, E);
  561. }
  562. }
  563. A.length = n;
  564. return A;
  565. }
  566. });
  567. var aFunction$1 = function (it) {
  568. if (typeof it != 'function') {
  569. throw TypeError(String(it) + ' is not a function');
  570. } return it;
  571. };
  572. // optional / simple context binding
  573. var functionBindContext = function (fn, that, length) {
  574. aFunction$1(fn);
  575. if (that === undefined) return fn;
  576. switch (length) {
  577. case 0: return function () {
  578. return fn.call(that);
  579. };
  580. case 1: return function (a) {
  581. return fn.call(that, a);
  582. };
  583. case 2: return function (a, b) {
  584. return fn.call(that, a, b);
  585. };
  586. case 3: return function (a, b, c) {
  587. return fn.call(that, a, b, c);
  588. };
  589. }
  590. return function (/* ...args */) {
  591. return fn.apply(that, arguments);
  592. };
  593. };
  594. var push = [].push;
  595. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation
  596. var createMethod$1 = function (TYPE) {
  597. var IS_MAP = TYPE == 1;
  598. var IS_FILTER = TYPE == 2;
  599. var IS_SOME = TYPE == 3;
  600. var IS_EVERY = TYPE == 4;
  601. var IS_FIND_INDEX = TYPE == 6;
  602. var IS_FILTER_OUT = TYPE == 7;
  603. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  604. return function ($this, callbackfn, that, specificCreate) {
  605. var O = toObject($this);
  606. var self = indexedObject(O);
  607. var boundFunction = functionBindContext(callbackfn, that, 3);
  608. var length = toLength(self.length);
  609. var index = 0;
  610. var create = specificCreate || arraySpeciesCreate;
  611. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
  612. var value, result;
  613. for (;length > index; index++) if (NO_HOLES || index in self) {
  614. value = self[index];
  615. result = boundFunction(value, index, O);
  616. if (TYPE) {
  617. if (IS_MAP) target[index] = result; // map
  618. else if (result) switch (TYPE) {
  619. case 3: return true; // some
  620. case 5: return value; // find
  621. case 6: return index; // findIndex
  622. case 2: push.call(target, value); // filter
  623. } else switch (TYPE) {
  624. case 4: return false; // every
  625. case 7: push.call(target, value); // filterOut
  626. }
  627. }
  628. }
  629. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  630. };
  631. };
  632. var arrayIteration = {
  633. // `Array.prototype.forEach` method
  634. // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
  635. forEach: createMethod$1(0),
  636. // `Array.prototype.map` method
  637. // https://tc39.github.io/ecma262/#sec-array.prototype.map
  638. map: createMethod$1(1),
  639. // `Array.prototype.filter` method
  640. // https://tc39.github.io/ecma262/#sec-array.prototype.filter
  641. filter: createMethod$1(2),
  642. // `Array.prototype.some` method
  643. // https://tc39.github.io/ecma262/#sec-array.prototype.some
  644. some: createMethod$1(3),
  645. // `Array.prototype.every` method
  646. // https://tc39.github.io/ecma262/#sec-array.prototype.every
  647. every: createMethod$1(4),
  648. // `Array.prototype.find` method
  649. // https://tc39.github.io/ecma262/#sec-array.prototype.find
  650. find: createMethod$1(5),
  651. // `Array.prototype.findIndex` method
  652. // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
  653. findIndex: createMethod$1(6),
  654. // `Array.prototype.filterOut` method
  655. // https://github.com/tc39/proposal-array-filtering
  656. filterOut: createMethod$1(7)
  657. };
  658. var defineProperty = Object.defineProperty;
  659. var cache = {};
  660. var thrower = function (it) { throw it; };
  661. var arrayMethodUsesToLength = function (METHOD_NAME, options) {
  662. if (has(cache, METHOD_NAME)) return cache[METHOD_NAME];
  663. if (!options) options = {};
  664. var method = [][METHOD_NAME];
  665. var ACCESSORS = has(options, 'ACCESSORS') ? options.ACCESSORS : false;
  666. var argument0 = has(options, 0) ? options[0] : thrower;
  667. var argument1 = has(options, 1) ? options[1] : undefined;
  668. return cache[METHOD_NAME] = !!method && !fails(function () {
  669. if (ACCESSORS && !descriptors) return true;
  670. var O = { length: -1 };
  671. if (ACCESSORS) defineProperty(O, 1, { enumerable: true, get: thrower });
  672. else O[1] = 1;
  673. method.call(O, argument0, argument1);
  674. });
  675. };
  676. var $filter = arrayIteration.filter;
  677. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
  678. // Edge 14- issue
  679. var USES_TO_LENGTH = arrayMethodUsesToLength('filter');
  680. // `Array.prototype.filter` method
  681. // https://tc39.github.io/ecma262/#sec-array.prototype.filter
  682. // with adding support of @@species
  683. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
  684. filter: function filter(callbackfn /* , thisArg */) {
  685. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  686. }
  687. });
  688. // `Object.keys` method
  689. // https://tc39.github.io/ecma262/#sec-object.keys
  690. var objectKeys = Object.keys || function keys(O) {
  691. return objectKeysInternal(O, enumBugKeys);
  692. };
  693. // `Object.defineProperties` method
  694. // https://tc39.github.io/ecma262/#sec-object.defineproperties
  695. var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
  696. anObject(O);
  697. var keys = objectKeys(Properties);
  698. var length = keys.length;
  699. var index = 0;
  700. var key;
  701. while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
  702. return O;
  703. };
  704. var html = getBuiltIn('document', 'documentElement');
  705. var GT = '>';
  706. var LT = '<';
  707. var PROTOTYPE = 'prototype';
  708. var SCRIPT = 'script';
  709. var IE_PROTO = sharedKey('IE_PROTO');
  710. var EmptyConstructor = function () { /* empty */ };
  711. var scriptTag = function (content) {
  712. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  713. };
  714. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  715. var NullProtoObjectViaActiveX = function (activeXDocument) {
  716. activeXDocument.write(scriptTag(''));
  717. activeXDocument.close();
  718. var temp = activeXDocument.parentWindow.Object;
  719. activeXDocument = null; // avoid memory leak
  720. return temp;
  721. };
  722. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  723. var NullProtoObjectViaIFrame = function () {
  724. // Thrash, waste and sodomy: IE GC bug
  725. var iframe = documentCreateElement('iframe');
  726. var JS = 'java' + SCRIPT + ':';
  727. var iframeDocument;
  728. iframe.style.display = 'none';
  729. html.appendChild(iframe);
  730. // https://github.com/zloirock/core-js/issues/475
  731. iframe.src = String(JS);
  732. iframeDocument = iframe.contentWindow.document;
  733. iframeDocument.open();
  734. iframeDocument.write(scriptTag('document.F=Object'));
  735. iframeDocument.close();
  736. return iframeDocument.F;
  737. };
  738. // Check for document.domain and active x support
  739. // No need to use active x approach when document.domain is not set
  740. // see https://github.com/es-shims/es5-shim/issues/150
  741. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  742. // avoid IE GC bug
  743. var activeXDocument;
  744. var NullProtoObject = function () {
  745. try {
  746. /* global ActiveXObject */
  747. activeXDocument = document.domain && new ActiveXObject('htmlfile');
  748. } catch (error) { /* ignore */ }
  749. NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
  750. var length = enumBugKeys.length;
  751. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  752. return NullProtoObject();
  753. };
  754. hiddenKeys[IE_PROTO] = true;
  755. // `Object.create` method
  756. // https://tc39.github.io/ecma262/#sec-object.create
  757. var objectCreate = Object.create || function create(O, Properties) {
  758. var result;
  759. if (O !== null) {
  760. EmptyConstructor[PROTOTYPE] = anObject(O);
  761. result = new EmptyConstructor();
  762. EmptyConstructor[PROTOTYPE] = null;
  763. // add "__proto__" for Object.getPrototypeOf polyfill
  764. result[IE_PROTO] = O;
  765. } else result = NullProtoObject();
  766. return Properties === undefined ? result : objectDefineProperties(result, Properties);
  767. };
  768. var UNSCOPABLES = wellKnownSymbol('unscopables');
  769. var ArrayPrototype = Array.prototype;
  770. // Array.prototype[@@unscopables]
  771. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  772. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  773. objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
  774. configurable: true,
  775. value: objectCreate(null)
  776. });
  777. }
  778. // add a key to Array.prototype[@@unscopables]
  779. var addToUnscopables = function (key) {
  780. ArrayPrototype[UNSCOPABLES][key] = true;
  781. };
  782. var $find = arrayIteration.find;
  783. var FIND = 'find';
  784. var SKIPS_HOLES = true;
  785. var USES_TO_LENGTH$1 = arrayMethodUsesToLength(FIND);
  786. // Shouldn't skip holes
  787. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  788. // `Array.prototype.find` method
  789. // https://tc39.github.io/ecma262/#sec-array.prototype.find
  790. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES || !USES_TO_LENGTH$1 }, {
  791. find: function find(callbackfn /* , that = undefined */) {
  792. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  793. }
  794. });
  795. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  796. addToUnscopables(FIND);
  797. var $includes = arrayIncludes.includes;
  798. var USES_TO_LENGTH$2 = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
  799. // `Array.prototype.includes` method
  800. // https://tc39.github.io/ecma262/#sec-array.prototype.includes
  801. _export({ target: 'Array', proto: true, forced: !USES_TO_LENGTH$2 }, {
  802. includes: function includes(el /* , fromIndex = 0 */) {
  803. return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  804. }
  805. });
  806. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  807. addToUnscopables('includes');
  808. var arrayMethodIsStrict = function (METHOD_NAME, argument) {
  809. var method = [][METHOD_NAME];
  810. return !!method && fails(function () {
  811. // eslint-disable-next-line no-useless-call,no-throw-literal
  812. method.call(null, argument || function () { throw 1; }, 1);
  813. });
  814. };
  815. var $indexOf = arrayIncludes.indexOf;
  816. var nativeIndexOf = [].indexOf;
  817. var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
  818. var STRICT_METHOD = arrayMethodIsStrict('indexOf');
  819. var USES_TO_LENGTH$3 = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
  820. // `Array.prototype.indexOf` method
  821. // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
  822. _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH$3 }, {
  823. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  824. return NEGATIVE_ZERO
  825. // convert -0 to +0
  826. ? nativeIndexOf.apply(this, arguments) || 0
  827. : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
  828. }
  829. });
  830. var nativeJoin = [].join;
  831. var ES3_STRINGS = indexedObject != Object;
  832. var STRICT_METHOD$1 = arrayMethodIsStrict('join', ',');
  833. // `Array.prototype.join` method
  834. // https://tc39.github.io/ecma262/#sec-array.prototype.join
  835. _export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD$1 }, {
  836. join: function join(separator) {
  837. return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
  838. }
  839. });
  840. var nativeAssign = Object.assign;
  841. var defineProperty$1 = Object.defineProperty;
  842. // `Object.assign` method
  843. // https://tc39.github.io/ecma262/#sec-object.assign
  844. var objectAssign = !nativeAssign || fails(function () {
  845. // should have correct order of operations (Edge bug)
  846. if (descriptors && nativeAssign({ b: 1 }, nativeAssign(defineProperty$1({}, 'a', {
  847. enumerable: true,
  848. get: function () {
  849. defineProperty$1(this, 'b', {
  850. value: 3,
  851. enumerable: false
  852. });
  853. }
  854. }), { b: 2 })).b !== 1) return true;
  855. // should work with symbols and should have deterministic property order (V8 bug)
  856. var A = {};
  857. var B = {};
  858. // eslint-disable-next-line no-undef
  859. var symbol = Symbol();
  860. var alphabet = 'abcdefghijklmnopqrst';
  861. A[symbol] = 7;
  862. alphabet.split('').forEach(function (chr) { B[chr] = chr; });
  863. return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
  864. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
  865. var T = toObject(target);
  866. var argumentsLength = arguments.length;
  867. var index = 1;
  868. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  869. var propertyIsEnumerable = objectPropertyIsEnumerable.f;
  870. while (argumentsLength > index) {
  871. var S = indexedObject(arguments[index++]);
  872. var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
  873. var length = keys.length;
  874. var j = 0;
  875. var key;
  876. while (length > j) {
  877. key = keys[j++];
  878. if (!descriptors || propertyIsEnumerable.call(S, key)) T[key] = S[key];
  879. }
  880. } return T;
  881. } : nativeAssign;
  882. // `Object.assign` method
  883. // https://tc39.github.io/ecma262/#sec-object.assign
  884. _export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, {
  885. assign: objectAssign
  886. });
  887. var propertyIsEnumerable = objectPropertyIsEnumerable.f;
  888. // `Object.{ entries, values }` methods implementation
  889. var createMethod$2 = function (TO_ENTRIES) {
  890. return function (it) {
  891. var O = toIndexedObject(it);
  892. var keys = objectKeys(O);
  893. var length = keys.length;
  894. var i = 0;
  895. var result = [];
  896. var key;
  897. while (length > i) {
  898. key = keys[i++];
  899. if (!descriptors || propertyIsEnumerable.call(O, key)) {
  900. result.push(TO_ENTRIES ? [key, O[key]] : O[key]);
  901. }
  902. }
  903. return result;
  904. };
  905. };
  906. var objectToArray = {
  907. // `Object.entries` method
  908. // https://tc39.github.io/ecma262/#sec-object.entries
  909. entries: createMethod$2(true),
  910. // `Object.values` method
  911. // https://tc39.github.io/ecma262/#sec-object.values
  912. values: createMethod$2(false)
  913. };
  914. var $entries = objectToArray.entries;
  915. // `Object.entries` method
  916. // https://tc39.github.io/ecma262/#sec-object.entries
  917. _export({ target: 'Object', stat: true }, {
  918. entries: function entries(O) {
  919. return $entries(O);
  920. }
  921. });
  922. // `RegExp.prototype.flags` getter implementation
  923. // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
  924. var regexpFlags = function () {
  925. var that = anObject(this);
  926. var result = '';
  927. if (that.global) result += 'g';
  928. if (that.ignoreCase) result += 'i';
  929. if (that.multiline) result += 'm';
  930. if (that.dotAll) result += 's';
  931. if (that.unicode) result += 'u';
  932. if (that.sticky) result += 'y';
  933. return result;
  934. };
  935. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
  936. // so we use an intermediate function.
  937. function RE(s, f) {
  938. return RegExp(s, f);
  939. }
  940. var UNSUPPORTED_Y = fails(function () {
  941. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
  942. var re = RE('a', 'y');
  943. re.lastIndex = 2;
  944. return re.exec('abcd') != null;
  945. });
  946. var BROKEN_CARET = fails(function () {
  947. // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
  948. var re = RE('^r', 'gy');
  949. re.lastIndex = 2;
  950. return re.exec('str') != null;
  951. });
  952. var regexpStickyHelpers = {
  953. UNSUPPORTED_Y: UNSUPPORTED_Y,
  954. BROKEN_CARET: BROKEN_CARET
  955. };
  956. var nativeExec = RegExp.prototype.exec;
  957. // This always refers to the native implementation, because the
  958. // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
  959. // which loads this file before patching the method.
  960. var nativeReplace = String.prototype.replace;
  961. var patchedExec = nativeExec;
  962. var UPDATES_LAST_INDEX_WRONG = (function () {
  963. var re1 = /a/;
  964. var re2 = /b*/g;
  965. nativeExec.call(re1, 'a');
  966. nativeExec.call(re2, 'a');
  967. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  968. })();
  969. var UNSUPPORTED_Y$1 = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET;
  970. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  971. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  972. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1;
  973. if (PATCH) {
  974. patchedExec = function exec(str) {
  975. var re = this;
  976. var lastIndex, reCopy, match, i;
  977. var sticky = UNSUPPORTED_Y$1 && re.sticky;
  978. var flags = regexpFlags.call(re);
  979. var source = re.source;
  980. var charsAdded = 0;
  981. var strCopy = str;
  982. if (sticky) {
  983. flags = flags.replace('y', '');
  984. if (flags.indexOf('g') === -1) {
  985. flags += 'g';
  986. }
  987. strCopy = String(str).slice(re.lastIndex);
  988. // Support anchored sticky behavior.
  989. if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
  990. source = '(?: ' + source + ')';
  991. strCopy = ' ' + strCopy;
  992. charsAdded++;
  993. }
  994. // ^(? + rx + ) is needed, in combination with some str slicing, to
  995. // simulate the 'y' flag.
  996. reCopy = new RegExp('^(?:' + source + ')', flags);
  997. }
  998. if (NPCG_INCLUDED) {
  999. reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
  1000. }
  1001. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  1002. match = nativeExec.call(sticky ? reCopy : re, strCopy);
  1003. if (sticky) {
  1004. if (match) {
  1005. match.input = match.input.slice(charsAdded);
  1006. match[0] = match[0].slice(charsAdded);
  1007. match.index = re.lastIndex;
  1008. re.lastIndex += match[0].length;
  1009. } else re.lastIndex = 0;
  1010. } else if (UPDATES_LAST_INDEX_WRONG && match) {
  1011. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  1012. }
  1013. if (NPCG_INCLUDED && match && match.length > 1) {
  1014. // Fix browsers whose `exec` methods don't consistently return `undefined`
  1015. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  1016. nativeReplace.call(match[0], reCopy, function () {
  1017. for (i = 1; i < arguments.length - 2; i++) {
  1018. if (arguments[i] === undefined) match[i] = undefined;
  1019. }
  1020. });
  1021. }
  1022. return match;
  1023. };
  1024. }
  1025. var regexpExec = patchedExec;
  1026. _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
  1027. exec: regexpExec
  1028. });
  1029. var MATCH = wellKnownSymbol('match');
  1030. // `IsRegExp` abstract operation
  1031. // https://tc39.github.io/ecma262/#sec-isregexp
  1032. var isRegexp = function (it) {
  1033. var isRegExp;
  1034. return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
  1035. };
  1036. var notARegexp = function (it) {
  1037. if (isRegexp(it)) {
  1038. throw TypeError("The method doesn't accept regular expressions");
  1039. } return it;
  1040. };
  1041. var MATCH$1 = wellKnownSymbol('match');
  1042. var correctIsRegexpLogic = function (METHOD_NAME) {
  1043. var regexp = /./;
  1044. try {
  1045. '/./'[METHOD_NAME](regexp);
  1046. } catch (error1) {
  1047. try {
  1048. regexp[MATCH$1] = false;
  1049. return '/./'[METHOD_NAME](regexp);
  1050. } catch (error2) { /* empty */ }
  1051. } return false;
  1052. };
  1053. // `String.prototype.includes` method
  1054. // https://tc39.github.io/ecma262/#sec-string.prototype.includes
  1055. _export({ target: 'String', proto: true, forced: !correctIsRegexpLogic('includes') }, {
  1056. includes: function includes(searchString /* , position = 0 */) {
  1057. return !!~String(requireObjectCoercible(this))
  1058. .indexOf(notARegexp(searchString), arguments.length > 1 ? arguments[1] : undefined);
  1059. }
  1060. });
  1061. // TODO: Remove from `core-js@4` since it's moved to entry points
  1062. var SPECIES$2 = wellKnownSymbol('species');
  1063. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  1064. // #replace needs built-in support for named groups.
  1065. // #match works fine because it just return the exec results, even if it has
  1066. // a "grops" property.
  1067. var re = /./;
  1068. re.exec = function () {
  1069. var result = [];
  1070. result.groups = { a: '7' };
  1071. return result;
  1072. };
  1073. return ''.replace(re, '$<a>') !== '7';
  1074. });
  1075. // IE <= 11 replaces $0 with the whole match, as if it was $&
  1076. // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
  1077. var REPLACE_KEEPS_$0 = (function () {
  1078. return 'a'.replace(/./, '$0') === '$0';
  1079. })();
  1080. var REPLACE = wellKnownSymbol('replace');
  1081. // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
  1082. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
  1083. if (/./[REPLACE]) {
  1084. return /./[REPLACE]('a', '$0') === '';
  1085. }
  1086. return false;
  1087. })();
  1088. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  1089. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  1090. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  1091. var re = /(?:)/;
  1092. var originalExec = re.exec;
  1093. re.exec = function () { return originalExec.apply(this, arguments); };
  1094. var result = 'ab'.split(re);
  1095. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  1096. });
  1097. var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
  1098. var SYMBOL = wellKnownSymbol(KEY);
  1099. var DELEGATES_TO_SYMBOL = !fails(function () {
  1100. // String methods call symbol-named RegEp methods
  1101. var O = {};
  1102. O[SYMBOL] = function () { return 7; };
  1103. return ''[KEY](O) != 7;
  1104. });
  1105. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  1106. // Symbol-named RegExp methods call .exec
  1107. var execCalled = false;
  1108. var re = /a/;
  1109. if (KEY === 'split') {
  1110. // We can't use real regex here since it causes deoptimization
  1111. // and serious performance degradation in V8
  1112. // https://github.com/zloirock/core-js/issues/306
  1113. re = {};
  1114. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  1115. // a new one. We need to return the patched regex when creating the new one.
  1116. re.constructor = {};
  1117. re.constructor[SPECIES$2] = function () { return re; };
  1118. re.flags = '';
  1119. re[SYMBOL] = /./[SYMBOL];
  1120. }
  1121. re.exec = function () { execCalled = true; return null; };
  1122. re[SYMBOL]('');
  1123. return !execCalled;
  1124. });
  1125. if (
  1126. !DELEGATES_TO_SYMBOL ||
  1127. !DELEGATES_TO_EXEC ||
  1128. (KEY === 'replace' && !(
  1129. REPLACE_SUPPORTS_NAMED_GROUPS &&
  1130. REPLACE_KEEPS_$0 &&
  1131. !REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
  1132. )) ||
  1133. (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
  1134. ) {
  1135. var nativeRegExpMethod = /./[SYMBOL];
  1136. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  1137. if (regexp.exec === regexpExec) {
  1138. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  1139. // The native String method already delegates to @@method (this
  1140. // polyfilled function), leasing to infinite recursion.
  1141. // We avoid it by directly calling the native @@method method.
  1142. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
  1143. }
  1144. return { done: true, value: nativeMethod.call(str, regexp, arg2) };
  1145. }
  1146. return { done: false };
  1147. }, {
  1148. REPLACE_KEEPS_$0: REPLACE_KEEPS_$0,
  1149. REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
  1150. });
  1151. var stringMethod = methods[0];
  1152. var regexMethod = methods[1];
  1153. redefine(String.prototype, KEY, stringMethod);
  1154. redefine(RegExp.prototype, SYMBOL, length == 2
  1155. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  1156. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  1157. ? function (string, arg) { return regexMethod.call(string, this, arg); }
  1158. // 21.2.5.6 RegExp.prototype[@@match](string)
  1159. // 21.2.5.9 RegExp.prototype[@@search](string)
  1160. : function (string) { return regexMethod.call(string, this); }
  1161. );
  1162. }
  1163. if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
  1164. };
  1165. // `SameValue` abstract operation
  1166. // https://tc39.github.io/ecma262/#sec-samevalue
  1167. var sameValue = Object.is || function is(x, y) {
  1168. // eslint-disable-next-line no-self-compare
  1169. return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
  1170. };
  1171. // `RegExpExec` abstract operation
  1172. // https://tc39.github.io/ecma262/#sec-regexpexec
  1173. var regexpExecAbstract = function (R, S) {
  1174. var exec = R.exec;
  1175. if (typeof exec === 'function') {
  1176. var result = exec.call(R, S);
  1177. if (typeof result !== 'object') {
  1178. throw TypeError('RegExp exec method returned something other than an Object or null');
  1179. }
  1180. return result;
  1181. }
  1182. if (classofRaw(R) !== 'RegExp') {
  1183. throw TypeError('RegExp#exec called on incompatible receiver');
  1184. }
  1185. return regexpExec.call(R, S);
  1186. };
  1187. // @@search logic
  1188. fixRegexpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) {
  1189. return [
  1190. // `String.prototype.search` method
  1191. // https://tc39.github.io/ecma262/#sec-string.prototype.search
  1192. function search(regexp) {
  1193. var O = requireObjectCoercible(this);
  1194. var searcher = regexp == undefined ? undefined : regexp[SEARCH];
  1195. return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
  1196. },
  1197. // `RegExp.prototype[@@search]` method
  1198. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search
  1199. function (regexp) {
  1200. var res = maybeCallNative(nativeSearch, regexp, this);
  1201. if (res.done) return res.value;
  1202. var rx = anObject(regexp);
  1203. var S = String(this);
  1204. var previousLastIndex = rx.lastIndex;
  1205. if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
  1206. var result = regexpExecAbstract(rx, S);
  1207. if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
  1208. return result === null ? -1 : result.index;
  1209. }
  1210. ];
  1211. });
  1212. // a string of all valid unicode whitespaces
  1213. // eslint-disable-next-line max-len
  1214. var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  1215. var whitespace = '[' + whitespaces + ']';
  1216. var ltrim = RegExp('^' + whitespace + whitespace + '*');
  1217. var rtrim = RegExp(whitespace + whitespace + '*$');
  1218. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  1219. var createMethod$3 = function (TYPE) {
  1220. return function ($this) {
  1221. var string = String(requireObjectCoercible($this));
  1222. if (TYPE & 1) string = string.replace(ltrim, '');
  1223. if (TYPE & 2) string = string.replace(rtrim, '');
  1224. return string;
  1225. };
  1226. };
  1227. var stringTrim = {
  1228. // `String.prototype.{ trimLeft, trimStart }` methods
  1229. // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart
  1230. start: createMethod$3(1),
  1231. // `String.prototype.{ trimRight, trimEnd }` methods
  1232. // https://tc39.github.io/ecma262/#sec-string.prototype.trimend
  1233. end: createMethod$3(2),
  1234. // `String.prototype.trim` method
  1235. // https://tc39.github.io/ecma262/#sec-string.prototype.trim
  1236. trim: createMethod$3(3)
  1237. };
  1238. var non = '\u200B\u0085\u180E';
  1239. // check that a method works with the correct list
  1240. // of whitespaces and has a correct name
  1241. var stringTrimForced = function (METHOD_NAME) {
  1242. return fails(function () {
  1243. return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;
  1244. });
  1245. };
  1246. var $trim = stringTrim.trim;
  1247. // `String.prototype.trim` method
  1248. // https://tc39.github.io/ecma262/#sec-string.prototype.trim
  1249. _export({ target: 'String', proto: true, forced: stringTrimForced('trim') }, {
  1250. trim: function trim() {
  1251. return $trim(this);
  1252. }
  1253. });
  1254. function _classCallCheck(instance, Constructor) {
  1255. if (!(instance instanceof Constructor)) {
  1256. throw new TypeError("Cannot call a class as a function");
  1257. }
  1258. }
  1259. function _defineProperties(target, props) {
  1260. for (var i = 0; i < props.length; i++) {
  1261. var descriptor = props[i];
  1262. descriptor.enumerable = descriptor.enumerable || false;
  1263. descriptor.configurable = true;
  1264. if ("value" in descriptor) descriptor.writable = true;
  1265. Object.defineProperty(target, descriptor.key, descriptor);
  1266. }
  1267. }
  1268. function _createClass(Constructor, protoProps, staticProps) {
  1269. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  1270. if (staticProps) _defineProperties(Constructor, staticProps);
  1271. return Constructor;
  1272. }
  1273. function _inherits(subClass, superClass) {
  1274. if (typeof superClass !== "function" && superClass !== null) {
  1275. throw new TypeError("Super expression must either be null or a function");
  1276. }
  1277. subClass.prototype = Object.create(superClass && superClass.prototype, {
  1278. constructor: {
  1279. value: subClass,
  1280. writable: true,
  1281. configurable: true
  1282. }
  1283. });
  1284. if (superClass) _setPrototypeOf(subClass, superClass);
  1285. }
  1286. function _getPrototypeOf(o) {
  1287. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  1288. return o.__proto__ || Object.getPrototypeOf(o);
  1289. };
  1290. return _getPrototypeOf(o);
  1291. }
  1292. function _setPrototypeOf(o, p) {
  1293. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  1294. o.__proto__ = p;
  1295. return o;
  1296. };
  1297. return _setPrototypeOf(o, p);
  1298. }
  1299. function _isNativeReflectConstruct() {
  1300. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  1301. if (Reflect.construct.sham) return false;
  1302. if (typeof Proxy === "function") return true;
  1303. try {
  1304. Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
  1305. return true;
  1306. } catch (e) {
  1307. return false;
  1308. }
  1309. }
  1310. function _assertThisInitialized(self) {
  1311. if (self === void 0) {
  1312. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  1313. }
  1314. return self;
  1315. }
  1316. function _possibleConstructorReturn(self, call) {
  1317. if (call && (typeof call === "object" || typeof call === "function")) {
  1318. return call;
  1319. }
  1320. return _assertThisInitialized(self);
  1321. }
  1322. function _createSuper(Derived) {
  1323. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  1324. return function _createSuperInternal() {
  1325. var Super = _getPrototypeOf(Derived),
  1326. result;
  1327. if (hasNativeReflectConstruct) {
  1328. var NewTarget = _getPrototypeOf(this).constructor;
  1329. result = Reflect.construct(Super, arguments, NewTarget);
  1330. } else {
  1331. result = Super.apply(this, arguments);
  1332. }
  1333. return _possibleConstructorReturn(this, result);
  1334. };
  1335. }
  1336. function _superPropBase(object, property) {
  1337. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  1338. object = _getPrototypeOf(object);
  1339. if (object === null) break;
  1340. }
  1341. return object;
  1342. }
  1343. function _get(target, property, receiver) {
  1344. if (typeof Reflect !== "undefined" && Reflect.get) {
  1345. _get = Reflect.get;
  1346. } else {
  1347. _get = function _get(target, property, receiver) {
  1348. var base = _superPropBase(target, property);
  1349. if (!base) return;
  1350. var desc = Object.getOwnPropertyDescriptor(base, property);
  1351. if (desc.get) {
  1352. return desc.get.call(receiver);
  1353. }
  1354. return desc.value;
  1355. };
  1356. }
  1357. return _get(target, property, receiver || target);
  1358. }
  1359. function _slicedToArray(arr, i) {
  1360. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
  1361. }
  1362. function _toConsumableArray(arr) {
  1363. return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
  1364. }
  1365. function _arrayWithoutHoles(arr) {
  1366. if (Array.isArray(arr)) return _arrayLikeToArray(arr);
  1367. }
  1368. function _arrayWithHoles(arr) {
  1369. if (Array.isArray(arr)) return arr;
  1370. }
  1371. function _iterableToArray(iter) {
  1372. if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
  1373. }
  1374. function _iterableToArrayLimit(arr, i) {
  1375. if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
  1376. var _arr = [];
  1377. var _n = true;
  1378. var _d = false;
  1379. var _e = undefined;
  1380. try {
  1381. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  1382. _arr.push(_s.value);
  1383. if (i && _arr.length === i) break;
  1384. }
  1385. } catch (err) {
  1386. _d = true;
  1387. _e = err;
  1388. } finally {
  1389. try {
  1390. if (!_n && _i["return"] != null) _i["return"]();
  1391. } finally {
  1392. if (_d) throw _e;
  1393. }
  1394. }
  1395. return _arr;
  1396. }
  1397. function _unsupportedIterableToArray(o, minLen) {
  1398. if (!o) return;
  1399. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  1400. var n = Object.prototype.toString.call(o).slice(8, -1);
  1401. if (n === "Object" && o.constructor) n = o.constructor.name;
  1402. if (n === "Map" || n === "Set") return Array.from(o);
  1403. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  1404. }
  1405. function _arrayLikeToArray(arr, len) {
  1406. if (len == null || len > arr.length) len = arr.length;
  1407. for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
  1408. return arr2;
  1409. }
  1410. function _nonIterableSpread() {
  1411. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  1412. }
  1413. function _nonIterableRest() {
  1414. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  1415. }
  1416. function _createForOfIteratorHelper(o, allowArrayLike) {
  1417. var it;
  1418. if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
  1419. if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
  1420. if (it) o = it;
  1421. var i = 0;
  1422. var F = function () {};
  1423. return {
  1424. s: F,
  1425. n: function () {
  1426. if (i >= o.length) return {
  1427. done: true
  1428. };
  1429. return {
  1430. done: false,
  1431. value: o[i++]
  1432. };
  1433. },
  1434. e: function (e) {
  1435. throw e;
  1436. },
  1437. f: F
  1438. };
  1439. }
  1440. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  1441. }
  1442. var normalCompletion = true,
  1443. didErr = false,
  1444. err;
  1445. return {
  1446. s: function () {
  1447. it = o[Symbol.iterator]();
  1448. },
  1449. n: function () {
  1450. var step = it.next();
  1451. normalCompletion = step.done;
  1452. return step;
  1453. },
  1454. e: function (e) {
  1455. didErr = true;
  1456. err = e;
  1457. },
  1458. f: function () {
  1459. try {
  1460. if (!normalCompletion && it.return != null) it.return();
  1461. } finally {
  1462. if (didErr) throw err;
  1463. }
  1464. }
  1465. };
  1466. }
  1467. /**
  1468. * @author: aperez <aperez@datadec.es>
  1469. * @version: v2.0.0
  1470. *
  1471. * @update Dennis Hernández <http://djhvscf.github.io/Blog>
  1472. * @update zhixin wen <wenzhixin2010@gmail.com>
  1473. */
  1474. var Utils = $__default['default'].fn.bootstrapTable.utils;
  1475. var theme = {
  1476. bootstrap3: {
  1477. icons: {
  1478. advancedSearchIcon: 'glyphicon-chevron-down'
  1479. },
  1480. html: {
  1481. modal: "\n <div id=\"avdSearchModal_%s\" class=\"modal fade\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"mySmallModalLabel\" aria-hidden=\"true\">\n <div class=\"modal-dialog modal-xs\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h4 class=\"modal-title\">%s</h4>\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body modal-body-custom\">\n <div class=\"container-fluid\" id=\"avdSearchModalContent_%s\"\n style=\"padding-right: 0px; padding-left: 0px;\" >\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" id=\"btnCloseAvd_%s\" class=\"btn btn-%s\">%s</button>\n </div>\n </div>\n </div>\n </div>\n "
  1482. }
  1483. },
  1484. bootstrap4: {
  1485. icons: {
  1486. advancedSearchIcon: 'fa-chevron-down'
  1487. },
  1488. html: {
  1489. modal: "\n <div id=\"avdSearchModal_%s\" class=\"modal fade\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"mySmallModalLabel\" aria-hidden=\"true\">\n <div class=\"modal-dialog modal-xs\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h4 class=\"modal-title\">%s</h4>\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body modal-body-custom\">\n <div class=\"container-fluid\" id=\"avdSearchModalContent_%s\"\n style=\"padding-right: 0; padding-left: 0;\" >\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" id=\"btnCloseAvd_%s\" class=\"btn btn-%s\">%s</button>\n </div>\n </div>\n </div>\n </div>\n "
  1490. }
  1491. },
  1492. bootstrap5: {
  1493. icons: {
  1494. advancedSearchIcon: 'fa-chevron-down'
  1495. },
  1496. html: {
  1497. modal: "\n <div id=\"avdSearchModal_%s\" class=\"modal fade\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"mySmallModalLabel\" aria-hidden=\"true\">\n <div class=\"modal-dialog modal-xs\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h4 class=\"modal-title\">%s</h4>\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body modal-body-custom\">\n <div class=\"container-fluid\" id=\"avdSearchModalContent_%s\"\n style=\"padding-right: 0; padding-left: 0;\" >\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" id=\"btnCloseAvd_%s\" class=\"btn btn-%s\">%s</button>\n </div>\n </div>\n </div>\n </div>\n "
  1498. }
  1499. },
  1500. bulma: {
  1501. icons: {
  1502. advancedSearchIcon: 'fa-chevron-down'
  1503. },
  1504. html: {
  1505. modal: "\n <div class=\"modal\" id=\"avdSearchModal_%s\">\n <div class=\"modal-background\"></div>\n <div class=\"modal-card\">\n <header class=\"modal-card-head\">\n <p class=\"modal-card-title\">%s</p>\n <button class=\"delete\" aria-label=\"close\"></button>\n </header>\n <section class=\"modal-card-body\" id=\"avdSearchModalContent_%s\"></section>\n <footer class=\"modal-card-foot\">\n <button class=\"button\" id=\"btnCloseAvd_%s\" data-close=\"btn btn-%s\">%s</button>\n </footer>\n </div>\n </div>\n "
  1506. }
  1507. },
  1508. foundation: {
  1509. icons: {
  1510. advancedSearchIcon: 'fa-chevron-down'
  1511. },
  1512. html: {
  1513. modal: "\n <div class=\"reveal\" id=\"avdSearchModal_%s\" data-reveal>\n <h1>%s</h1>\n <div id=\"avdSearchModalContent_%s\">\n\n </div>\n <button class=\"close-button\" data-close aria-label=\"Close modal\" type=\"button\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n\n <button id=\"btnCloseAvd_%s\" class=\"%s\" type=\"button\">%s</button>\n </div>\n "
  1514. }
  1515. },
  1516. materialize: {
  1517. icons: {
  1518. advancedSearchIcon: 'expand_more'
  1519. },
  1520. html: {
  1521. modal: "\n <div id=\"avdSearchModal_%s\" class=\"modal\">\n <div class=\"modal-content\">\n <h4>%s</h4>\n <div id=\"avdSearchModalContent_%s\">\n\n </div>\n </div>\n <div class=\"modal-footer\">\n <a href=\"javascript:void(0)\"\" id=\"btnCloseAvd_%s\" class=\"modal-close waves-effect waves-green btn-flat %s\">%s</a>\n </div>\n </div>\n "
  1522. }
  1523. },
  1524. semantic: {
  1525. icons: {
  1526. advancedSearchIcon: 'fa-chevron-down'
  1527. },
  1528. html: {
  1529. modal: "\n <div class=\"ui modal\" id=\"avdSearchModal_%s\">\n <i class=\"close icon\"></i>\n <div class=\"header\">\n %s\n </div>\n <div class=\"image content ui form\" id=\"avdSearchModalContent_%s\"></div>\n <div class=\"actions\">\n <div id=\"btnCloseAvd_%s\" class=\"ui black deny button %s\">%s</div>\n </div>\n </div>\n "
  1530. }
  1531. }
  1532. }[$__default['default'].fn.bootstrapTable.theme];
  1533. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults, {
  1534. advancedSearch: false,
  1535. idForm: 'advancedSearch',
  1536. actionForm: '',
  1537. idTable: undefined,
  1538. // eslint-disable-next-line no-unused-vars
  1539. onColumnAdvancedSearch: function onColumnAdvancedSearch(field, text) {
  1540. return false;
  1541. }
  1542. });
  1543. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults.icons, {
  1544. advancedSearchIcon: theme.icons.advancedSearchIcon
  1545. });
  1546. $__default['default'].extend($__default['default'].fn.bootstrapTable.Constructor.EVENTS, {
  1547. 'column-advanced-search.bs.table': 'onColumnAdvancedSearch'
  1548. });
  1549. $__default['default'].extend($__default['default'].fn.bootstrapTable.locales, {
  1550. formatAdvancedSearch: function formatAdvancedSearch() {
  1551. return 'Advanced search';
  1552. },
  1553. formatAdvancedCloseButton: function formatAdvancedCloseButton() {
  1554. return 'Close';
  1555. }
  1556. });
  1557. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults, $__default['default'].fn.bootstrapTable.locales);
  1558. $__default['default'].BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
  1559. _inherits(_class, _$$BootstrapTable);
  1560. var _super = _createSuper(_class);
  1561. function _class() {
  1562. _classCallCheck(this, _class);
  1563. return _super.apply(this, arguments);
  1564. }
  1565. _createClass(_class, [{
  1566. key: "initToolbar",
  1567. value: function initToolbar() {
  1568. var o = this.options;
  1569. this.showToolbar = this.showToolbar || o.search && o.advancedSearch && o.idTable;
  1570. if (o.search && o.advancedSearch && o.idTable) {
  1571. this.buttons = Object.assign(this.buttons, {
  1572. advancedSearch: {
  1573. text: this.options.formatAdvancedSearch(),
  1574. icon: this.options.icons.advancedSearchIcon,
  1575. event: this.showAvdSearch,
  1576. attributes: {
  1577. 'aria-label': this.options.formatAdvancedSearch(),
  1578. title: this.options.formatAdvancedSearch()
  1579. }
  1580. }
  1581. });
  1582. }
  1583. _get(_getPrototypeOf(_class.prototype), "initToolbar", this).call(this);
  1584. }
  1585. }, {
  1586. key: "showAvdSearch",
  1587. value: function showAvdSearch() {
  1588. var _this = this;
  1589. var o = this.options;
  1590. var modalSelector = "#avdSearchModal_".concat(o.idTable);
  1591. if ($__default['default'](modalSelector).length <= 0) {
  1592. $__default['default']('body').append(Utils.sprintf(theme.html.modal, o.idTable, o.formatAdvancedSearch(), o.idTable, o.idTable, o.buttonsClass, o.formatAdvancedCloseButton()));
  1593. var timeoutId = 0;
  1594. $__default['default']("#avdSearchModalContent_".concat(o.idTable)).append(this.createFormAvd().join(''));
  1595. $__default['default']("#".concat(o.idForm)).off('keyup blur', 'input').on('keyup blur', 'input', function (e) {
  1596. if (o.sidePagination === 'server') {
  1597. _this.onColumnAdvancedSearch(e);
  1598. } else {
  1599. clearTimeout(timeoutId);
  1600. timeoutId = setTimeout(function () {
  1601. _this.onColumnAdvancedSearch(e);
  1602. }, o.searchTimeOut);
  1603. }
  1604. });
  1605. $__default['default']("#btnCloseAvd_".concat(o.idTable)).click(function () {
  1606. return _this.hideModal();
  1607. });
  1608. if ($__default['default'].fn.bootstrapTable.theme === 'bulma') {
  1609. $__default['default'](modalSelector).find('.delete').off('click').on('click', function () {
  1610. return _this.hideModal();
  1611. });
  1612. }
  1613. this.showModal();
  1614. } else {
  1615. this.showModal();
  1616. }
  1617. }
  1618. }, {
  1619. key: "showModal",
  1620. value: function showModal() {
  1621. var modalSelector = "#avdSearchModal_".concat(this.options.idTable);
  1622. if ($__default['default'].inArray($__default['default'].fn.bootstrapTable.theme, ['bootstrap3', 'bootstrap4']) !== -1) {
  1623. $__default['default'](modalSelector).modal();
  1624. } else if ($__default['default'].fn.bootstrapTable.theme === 'bootstrap5') {
  1625. if (!this.toolbarModal) {
  1626. // eslint-disable-next-line no-undef
  1627. this.toolbarModal = new bootstrap.Modal(document.getElementById("avdSearchModal_".concat(this.options.idTable)), {});
  1628. }
  1629. this.toolbarModal.show();
  1630. } else if ($__default['default'].fn.bootstrapTable.theme === 'bulma') {
  1631. $__default['default'](modalSelector).toggleClass('is-active');
  1632. } else if ($__default['default'].fn.bootstrapTable.theme === 'foundation') {
  1633. if (!this.toolbarModal) {
  1634. // eslint-disable-next-line no-undef
  1635. this.toolbarModal = new Foundation.Reveal($__default['default'](modalSelector));
  1636. }
  1637. this.toolbarModal.open();
  1638. } else if ($__default['default'].fn.bootstrapTable.theme === 'materialize') {
  1639. $__default['default'](modalSelector).modal();
  1640. $__default['default'](modalSelector).modal('open');
  1641. } else if ($__default['default'].fn.bootstrapTable.theme === 'semantic') {
  1642. $__default['default'](modalSelector).modal('show');
  1643. }
  1644. }
  1645. }, {
  1646. key: "hideModal",
  1647. value: function hideModal() {
  1648. var $closeModalButton = $__default['default']("#avdSearchModal_".concat(this.options.idTable));
  1649. var modalSelector = "#avdSearchModal_".concat(this.options.idTable);
  1650. if ($__default['default'].inArray($__default['default'].fn.bootstrapTable.theme, ['bootstrap3', 'bootstrap4']) !== -1) {
  1651. $closeModalButton.modal('hide');
  1652. } else if ($__default['default'].fn.bootstrapTable.theme === 'bootstrap5') {
  1653. this.toolbarModal.hide();
  1654. } else if ($__default['default'].fn.bootstrapTable.theme === 'bulma') {
  1655. $__default['default']('html').toggleClass('is-clipped');
  1656. $__default['default'](modalSelector).toggleClass('is-active');
  1657. } else if ($__default['default'].fn.bootstrapTable.theme === 'foundation') {
  1658. this.toolbarModal.close();
  1659. } else if ($__default['default'].fn.bootstrapTable.theme === 'materialize') {
  1660. $__default['default'](modalSelector).modal('open');
  1661. } else if ($__default['default'].fn.bootstrapTable.theme === 'semantic') {
  1662. $__default['default'](modalSelector).modal('close');
  1663. }
  1664. if (this.options.sidePagination === 'server') {
  1665. this.options.pageNumber = 1;
  1666. this.updatePagination();
  1667. this.trigger('column-advanced-search', this.filterColumnsPartial);
  1668. }
  1669. }
  1670. }, {
  1671. key: "createFormAvd",
  1672. value: function createFormAvd() {
  1673. var o = this.options;
  1674. var html = ["<form class=\"form-horizontal\" id=\"".concat(o.idForm, "\" action=\"").concat(o.actionForm, "\">")];
  1675. var _iterator = _createForOfIteratorHelper(this.columns),
  1676. _step;
  1677. try {
  1678. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  1679. var column = _step.value;
  1680. if (!column.checkbox && column.visible && column.searchable) {
  1681. html.push("\n <div class=\"form-group row\">\n <label class=\"col-sm-4 control-label\">".concat(column.title, "</label>\n <div class=\"col-sm-6\">\n <input type=\"text\" class=\"form-control ").concat(this.constants.classes.input, "\" name=\"").concat(column.field, "\" placeholder=\"").concat(column.title, "\" id=\"").concat(column.field, "\">\n </div>\n </div>\n "));
  1682. }
  1683. }
  1684. } catch (err) {
  1685. _iterator.e(err);
  1686. } finally {
  1687. _iterator.f();
  1688. }
  1689. html.push('</form>');
  1690. return html;
  1691. }
  1692. }, {
  1693. key: "initSearch",
  1694. value: function initSearch() {
  1695. var _this2 = this;
  1696. _get(_getPrototypeOf(_class.prototype), "initSearch", this).call(this);
  1697. if (!this.options.advancedSearch || this.options.sidePagination === 'server') {
  1698. return;
  1699. }
  1700. var fp = $__default['default'].isEmptyObject(this.filterColumnsPartial) ? null : this.filterColumnsPartial;
  1701. this.data = fp ? this.data.filter(function (item, i) {
  1702. for (var _i = 0, _Object$entries = Object.entries(fp); _i < _Object$entries.length; _i++) {
  1703. var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
  1704. key = _Object$entries$_i[0],
  1705. v = _Object$entries$_i[1];
  1706. var fval = v.toLowerCase();
  1707. var value = item[key];
  1708. var index = _this2.header.fields.indexOf(key);
  1709. value = Utils.calculateObjectValue(_this2.header, _this2.header.formatters[index], [value, item, i], value);
  1710. if (!(index !== -1 && (typeof value === 'string' || typeof value === 'number') && "".concat(value).toLowerCase().includes(fval))) {
  1711. return false;
  1712. }
  1713. }
  1714. return true;
  1715. }) : this.data;
  1716. this.unsortedData = _toConsumableArray(this.data);
  1717. }
  1718. }, {
  1719. key: "onColumnAdvancedSearch",
  1720. value: function onColumnAdvancedSearch(e) {
  1721. var text = $__default['default'].trim($__default['default'](e.currentTarget).val());
  1722. var $field = $__default['default'](e.currentTarget)[0].id;
  1723. if ($__default['default'].isEmptyObject(this.filterColumnsPartial)) {
  1724. this.filterColumnsPartial = {};
  1725. }
  1726. if (text) {
  1727. this.filterColumnsPartial[$field] = text;
  1728. } else {
  1729. delete this.filterColumnsPartial[$field];
  1730. }
  1731. if (this.options.sidePagination !== 'server') {
  1732. this.options.pageNumber = 1;
  1733. this.onSearch(e);
  1734. this.updatePagination();
  1735. this.trigger('column-advanced-search', $field, text);
  1736. }
  1737. }
  1738. }]);
  1739. return _class;
  1740. }($__default['default'].BootstrapTable);
  1741. })));