bootstrap-table-cookie.js 87 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572
  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 arrayMethodIsStrict = function (METHOD_NAME, argument) {
  798. var method = [][METHOD_NAME];
  799. return !!method && fails(function () {
  800. // eslint-disable-next-line no-useless-call,no-throw-literal
  801. method.call(null, argument || function () { throw 1; }, 1);
  802. });
  803. };
  804. var $forEach = arrayIteration.forEach;
  805. var STRICT_METHOD = arrayMethodIsStrict('forEach');
  806. var USES_TO_LENGTH$2 = arrayMethodUsesToLength('forEach');
  807. // `Array.prototype.forEach` method implementation
  808. // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
  809. var arrayForEach = (!STRICT_METHOD || !USES_TO_LENGTH$2) ? function forEach(callbackfn /* , thisArg */) {
  810. return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  811. } : [].forEach;
  812. // `Array.prototype.forEach` method
  813. // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
  814. _export({ target: 'Array', proto: true, forced: [].forEach != arrayForEach }, {
  815. forEach: arrayForEach
  816. });
  817. var nativeJoin = [].join;
  818. var ES3_STRINGS = indexedObject != Object;
  819. var STRICT_METHOD$1 = arrayMethodIsStrict('join', ',');
  820. // `Array.prototype.join` method
  821. // https://tc39.github.io/ecma262/#sec-array.prototype.join
  822. _export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD$1 }, {
  823. join: function join(separator) {
  824. return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
  825. }
  826. });
  827. var $map = arrayIteration.map;
  828. var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('map');
  829. // FF49- issue
  830. var USES_TO_LENGTH$3 = arrayMethodUsesToLength('map');
  831. // `Array.prototype.map` method
  832. // https://tc39.github.io/ecma262/#sec-array.prototype.map
  833. // with adding support of @@species
  834. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 || !USES_TO_LENGTH$3 }, {
  835. map: function map(callbackfn /* , thisArg */) {
  836. return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  837. }
  838. });
  839. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  840. var test = {};
  841. test[TO_STRING_TAG] = 'z';
  842. var toStringTagSupport = String(test) === '[object z]';
  843. var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
  844. // ES3 wrong here
  845. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  846. // fallback for IE11 Script Access Denied error
  847. var tryGet = function (it, key) {
  848. try {
  849. return it[key];
  850. } catch (error) { /* empty */ }
  851. };
  852. // getting tag from ES6+ `Object.prototype.toString`
  853. var classof = toStringTagSupport ? classofRaw : function (it) {
  854. var O, tag, result;
  855. return it === undefined ? 'Undefined' : it === null ? 'Null'
  856. // @@toStringTag case
  857. : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$1)) == 'string' ? tag
  858. // builtinTag case
  859. : CORRECT_ARGUMENTS ? classofRaw(O)
  860. // ES3 arguments fallback
  861. : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
  862. };
  863. // `Object.prototype.toString` method implementation
  864. // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
  865. var objectToString = toStringTagSupport ? {}.toString : function toString() {
  866. return '[object ' + classof(this) + ']';
  867. };
  868. // `Object.prototype.toString` method
  869. // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
  870. if (!toStringTagSupport) {
  871. redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
  872. }
  873. // `RegExp.prototype.flags` getter implementation
  874. // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
  875. var regexpFlags = function () {
  876. var that = anObject(this);
  877. var result = '';
  878. if (that.global) result += 'g';
  879. if (that.ignoreCase) result += 'i';
  880. if (that.multiline) result += 'm';
  881. if (that.dotAll) result += 's';
  882. if (that.unicode) result += 'u';
  883. if (that.sticky) result += 'y';
  884. return result;
  885. };
  886. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
  887. // so we use an intermediate function.
  888. function RE(s, f) {
  889. return RegExp(s, f);
  890. }
  891. var UNSUPPORTED_Y = fails(function () {
  892. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
  893. var re = RE('a', 'y');
  894. re.lastIndex = 2;
  895. return re.exec('abcd') != null;
  896. });
  897. var BROKEN_CARET = fails(function () {
  898. // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
  899. var re = RE('^r', 'gy');
  900. re.lastIndex = 2;
  901. return re.exec('str') != null;
  902. });
  903. var regexpStickyHelpers = {
  904. UNSUPPORTED_Y: UNSUPPORTED_Y,
  905. BROKEN_CARET: BROKEN_CARET
  906. };
  907. var nativeExec = RegExp.prototype.exec;
  908. // This always refers to the native implementation, because the
  909. // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
  910. // which loads this file before patching the method.
  911. var nativeReplace = String.prototype.replace;
  912. var patchedExec = nativeExec;
  913. var UPDATES_LAST_INDEX_WRONG = (function () {
  914. var re1 = /a/;
  915. var re2 = /b*/g;
  916. nativeExec.call(re1, 'a');
  917. nativeExec.call(re2, 'a');
  918. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  919. })();
  920. var UNSUPPORTED_Y$1 = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET;
  921. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  922. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  923. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1;
  924. if (PATCH) {
  925. patchedExec = function exec(str) {
  926. var re = this;
  927. var lastIndex, reCopy, match, i;
  928. var sticky = UNSUPPORTED_Y$1 && re.sticky;
  929. var flags = regexpFlags.call(re);
  930. var source = re.source;
  931. var charsAdded = 0;
  932. var strCopy = str;
  933. if (sticky) {
  934. flags = flags.replace('y', '');
  935. if (flags.indexOf('g') === -1) {
  936. flags += 'g';
  937. }
  938. strCopy = String(str).slice(re.lastIndex);
  939. // Support anchored sticky behavior.
  940. if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
  941. source = '(?: ' + source + ')';
  942. strCopy = ' ' + strCopy;
  943. charsAdded++;
  944. }
  945. // ^(? + rx + ) is needed, in combination with some str slicing, to
  946. // simulate the 'y' flag.
  947. reCopy = new RegExp('^(?:' + source + ')', flags);
  948. }
  949. if (NPCG_INCLUDED) {
  950. reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
  951. }
  952. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  953. match = nativeExec.call(sticky ? reCopy : re, strCopy);
  954. if (sticky) {
  955. if (match) {
  956. match.input = match.input.slice(charsAdded);
  957. match[0] = match[0].slice(charsAdded);
  958. match.index = re.lastIndex;
  959. re.lastIndex += match[0].length;
  960. } else re.lastIndex = 0;
  961. } else if (UPDATES_LAST_INDEX_WRONG && match) {
  962. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  963. }
  964. if (NPCG_INCLUDED && match && match.length > 1) {
  965. // Fix browsers whose `exec` methods don't consistently return `undefined`
  966. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  967. nativeReplace.call(match[0], reCopy, function () {
  968. for (i = 1; i < arguments.length - 2; i++) {
  969. if (arguments[i] === undefined) match[i] = undefined;
  970. }
  971. });
  972. }
  973. return match;
  974. };
  975. }
  976. var regexpExec = patchedExec;
  977. _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
  978. exec: regexpExec
  979. });
  980. var TO_STRING = 'toString';
  981. var RegExpPrototype = RegExp.prototype;
  982. var nativeToString = RegExpPrototype[TO_STRING];
  983. var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
  984. // FF44- RegExp#toString has a wrong name
  985. var INCORRECT_NAME = nativeToString.name != TO_STRING;
  986. // `RegExp.prototype.toString` method
  987. // https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring
  988. if (NOT_GENERIC || INCORRECT_NAME) {
  989. redefine(RegExp.prototype, TO_STRING, function toString() {
  990. var R = anObject(this);
  991. var p = String(R.source);
  992. var rf = R.flags;
  993. var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? regexpFlags.call(R) : rf);
  994. return '/' + p + '/' + f;
  995. }, { unsafe: true });
  996. }
  997. // TODO: Remove from `core-js@4` since it's moved to entry points
  998. var SPECIES$2 = wellKnownSymbol('species');
  999. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  1000. // #replace needs built-in support for named groups.
  1001. // #match works fine because it just return the exec results, even if it has
  1002. // a "grops" property.
  1003. var re = /./;
  1004. re.exec = function () {
  1005. var result = [];
  1006. result.groups = { a: '7' };
  1007. return result;
  1008. };
  1009. return ''.replace(re, '$<a>') !== '7';
  1010. });
  1011. // IE <= 11 replaces $0 with the whole match, as if it was $&
  1012. // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
  1013. var REPLACE_KEEPS_$0 = (function () {
  1014. return 'a'.replace(/./, '$0') === '$0';
  1015. })();
  1016. var REPLACE = wellKnownSymbol('replace');
  1017. // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
  1018. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
  1019. if (/./[REPLACE]) {
  1020. return /./[REPLACE]('a', '$0') === '';
  1021. }
  1022. return false;
  1023. })();
  1024. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  1025. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  1026. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  1027. var re = /(?:)/;
  1028. var originalExec = re.exec;
  1029. re.exec = function () { return originalExec.apply(this, arguments); };
  1030. var result = 'ab'.split(re);
  1031. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  1032. });
  1033. var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
  1034. var SYMBOL = wellKnownSymbol(KEY);
  1035. var DELEGATES_TO_SYMBOL = !fails(function () {
  1036. // String methods call symbol-named RegEp methods
  1037. var O = {};
  1038. O[SYMBOL] = function () { return 7; };
  1039. return ''[KEY](O) != 7;
  1040. });
  1041. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  1042. // Symbol-named RegExp methods call .exec
  1043. var execCalled = false;
  1044. var re = /a/;
  1045. if (KEY === 'split') {
  1046. // We can't use real regex here since it causes deoptimization
  1047. // and serious performance degradation in V8
  1048. // https://github.com/zloirock/core-js/issues/306
  1049. re = {};
  1050. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  1051. // a new one. We need to return the patched regex when creating the new one.
  1052. re.constructor = {};
  1053. re.constructor[SPECIES$2] = function () { return re; };
  1054. re.flags = '';
  1055. re[SYMBOL] = /./[SYMBOL];
  1056. }
  1057. re.exec = function () { execCalled = true; return null; };
  1058. re[SYMBOL]('');
  1059. return !execCalled;
  1060. });
  1061. if (
  1062. !DELEGATES_TO_SYMBOL ||
  1063. !DELEGATES_TO_EXEC ||
  1064. (KEY === 'replace' && !(
  1065. REPLACE_SUPPORTS_NAMED_GROUPS &&
  1066. REPLACE_KEEPS_$0 &&
  1067. !REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
  1068. )) ||
  1069. (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
  1070. ) {
  1071. var nativeRegExpMethod = /./[SYMBOL];
  1072. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  1073. if (regexp.exec === regexpExec) {
  1074. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  1075. // The native String method already delegates to @@method (this
  1076. // polyfilled function), leasing to infinite recursion.
  1077. // We avoid it by directly calling the native @@method method.
  1078. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
  1079. }
  1080. return { done: true, value: nativeMethod.call(str, regexp, arg2) };
  1081. }
  1082. return { done: false };
  1083. }, {
  1084. REPLACE_KEEPS_$0: REPLACE_KEEPS_$0,
  1085. REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
  1086. });
  1087. var stringMethod = methods[0];
  1088. var regexMethod = methods[1];
  1089. redefine(String.prototype, KEY, stringMethod);
  1090. redefine(RegExp.prototype, SYMBOL, length == 2
  1091. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  1092. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  1093. ? function (string, arg) { return regexMethod.call(string, this, arg); }
  1094. // 21.2.5.6 RegExp.prototype[@@match](string)
  1095. // 21.2.5.9 RegExp.prototype[@@search](string)
  1096. : function (string) { return regexMethod.call(string, this); }
  1097. );
  1098. }
  1099. if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
  1100. };
  1101. // `String.prototype.{ codePointAt, at }` methods implementation
  1102. var createMethod$2 = function (CONVERT_TO_STRING) {
  1103. return function ($this, pos) {
  1104. var S = String(requireObjectCoercible($this));
  1105. var position = toInteger(pos);
  1106. var size = S.length;
  1107. var first, second;
  1108. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  1109. first = S.charCodeAt(position);
  1110. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  1111. || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
  1112. ? CONVERT_TO_STRING ? S.charAt(position) : first
  1113. : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  1114. };
  1115. };
  1116. var stringMultibyte = {
  1117. // `String.prototype.codePointAt` method
  1118. // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
  1119. codeAt: createMethod$2(false),
  1120. // `String.prototype.at` method
  1121. // https://github.com/mathiasbynens/String.prototype.at
  1122. charAt: createMethod$2(true)
  1123. };
  1124. var charAt = stringMultibyte.charAt;
  1125. // `AdvanceStringIndex` abstract operation
  1126. // https://tc39.github.io/ecma262/#sec-advancestringindex
  1127. var advanceStringIndex = function (S, index, unicode) {
  1128. return index + (unicode ? charAt(S, index).length : 1);
  1129. };
  1130. // `RegExpExec` abstract operation
  1131. // https://tc39.github.io/ecma262/#sec-regexpexec
  1132. var regexpExecAbstract = function (R, S) {
  1133. var exec = R.exec;
  1134. if (typeof exec === 'function') {
  1135. var result = exec.call(R, S);
  1136. if (typeof result !== 'object') {
  1137. throw TypeError('RegExp exec method returned something other than an Object or null');
  1138. }
  1139. return result;
  1140. }
  1141. if (classofRaw(R) !== 'RegExp') {
  1142. throw TypeError('RegExp#exec called on incompatible receiver');
  1143. }
  1144. return regexpExec.call(R, S);
  1145. };
  1146. var max$1 = Math.max;
  1147. var min$2 = Math.min;
  1148. var floor$1 = Math.floor;
  1149. var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
  1150. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
  1151. var maybeToString = function (it) {
  1152. return it === undefined ? it : String(it);
  1153. };
  1154. // @@replace logic
  1155. fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
  1156. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE;
  1157. var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0;
  1158. var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
  1159. return [
  1160. // `String.prototype.replace` method
  1161. // https://tc39.github.io/ecma262/#sec-string.prototype.replace
  1162. function replace(searchValue, replaceValue) {
  1163. var O = requireObjectCoercible(this);
  1164. var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
  1165. return replacer !== undefined
  1166. ? replacer.call(searchValue, O, replaceValue)
  1167. : nativeReplace.call(String(O), searchValue, replaceValue);
  1168. },
  1169. // `RegExp.prototype[@@replace]` method
  1170. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
  1171. function (regexp, replaceValue) {
  1172. if (
  1173. (!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0) ||
  1174. (typeof replaceValue === 'string' && replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1)
  1175. ) {
  1176. var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
  1177. if (res.done) return res.value;
  1178. }
  1179. var rx = anObject(regexp);
  1180. var S = String(this);
  1181. var functionalReplace = typeof replaceValue === 'function';
  1182. if (!functionalReplace) replaceValue = String(replaceValue);
  1183. var global = rx.global;
  1184. if (global) {
  1185. var fullUnicode = rx.unicode;
  1186. rx.lastIndex = 0;
  1187. }
  1188. var results = [];
  1189. while (true) {
  1190. var result = regexpExecAbstract(rx, S);
  1191. if (result === null) break;
  1192. results.push(result);
  1193. if (!global) break;
  1194. var matchStr = String(result[0]);
  1195. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  1196. }
  1197. var accumulatedResult = '';
  1198. var nextSourcePosition = 0;
  1199. for (var i = 0; i < results.length; i++) {
  1200. result = results[i];
  1201. var matched = String(result[0]);
  1202. var position = max$1(min$2(toInteger(result.index), S.length), 0);
  1203. var captures = [];
  1204. // NOTE: This is equivalent to
  1205. // captures = result.slice(1).map(maybeToString)
  1206. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  1207. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  1208. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  1209. for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
  1210. var namedCaptures = result.groups;
  1211. if (functionalReplace) {
  1212. var replacerArgs = [matched].concat(captures, position, S);
  1213. if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
  1214. var replacement = String(replaceValue.apply(undefined, replacerArgs));
  1215. } else {
  1216. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  1217. }
  1218. if (position >= nextSourcePosition) {
  1219. accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
  1220. nextSourcePosition = position + matched.length;
  1221. }
  1222. }
  1223. return accumulatedResult + S.slice(nextSourcePosition);
  1224. }
  1225. ];
  1226. // https://tc39.github.io/ecma262/#sec-getsubstitution
  1227. function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
  1228. var tailPos = position + matched.length;
  1229. var m = captures.length;
  1230. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  1231. if (namedCaptures !== undefined) {
  1232. namedCaptures = toObject(namedCaptures);
  1233. symbols = SUBSTITUTION_SYMBOLS;
  1234. }
  1235. return nativeReplace.call(replacement, symbols, function (match, ch) {
  1236. var capture;
  1237. switch (ch.charAt(0)) {
  1238. case '$': return '$';
  1239. case '&': return matched;
  1240. case '`': return str.slice(0, position);
  1241. case "'": return str.slice(tailPos);
  1242. case '<':
  1243. capture = namedCaptures[ch.slice(1, -1)];
  1244. break;
  1245. default: // \d\d?
  1246. var n = +ch;
  1247. if (n === 0) return match;
  1248. if (n > m) {
  1249. var f = floor$1(n / 10);
  1250. if (f === 0) return match;
  1251. if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
  1252. return match;
  1253. }
  1254. capture = captures[n - 1];
  1255. }
  1256. return capture === undefined ? '' : capture;
  1257. });
  1258. }
  1259. });
  1260. // `SameValue` abstract operation
  1261. // https://tc39.github.io/ecma262/#sec-samevalue
  1262. var sameValue = Object.is || function is(x, y) {
  1263. // eslint-disable-next-line no-self-compare
  1264. return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
  1265. };
  1266. // @@search logic
  1267. fixRegexpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) {
  1268. return [
  1269. // `String.prototype.search` method
  1270. // https://tc39.github.io/ecma262/#sec-string.prototype.search
  1271. function search(regexp) {
  1272. var O = requireObjectCoercible(this);
  1273. var searcher = regexp == undefined ? undefined : regexp[SEARCH];
  1274. return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
  1275. },
  1276. // `RegExp.prototype[@@search]` method
  1277. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search
  1278. function (regexp) {
  1279. var res = maybeCallNative(nativeSearch, regexp, this);
  1280. if (res.done) return res.value;
  1281. var rx = anObject(regexp);
  1282. var S = String(this);
  1283. var previousLastIndex = rx.lastIndex;
  1284. if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
  1285. var result = regexpExecAbstract(rx, S);
  1286. if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
  1287. return result === null ? -1 : result.index;
  1288. }
  1289. ];
  1290. });
  1291. var MATCH = wellKnownSymbol('match');
  1292. // `IsRegExp` abstract operation
  1293. // https://tc39.github.io/ecma262/#sec-isregexp
  1294. var isRegexp = function (it) {
  1295. var isRegExp;
  1296. return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
  1297. };
  1298. var SPECIES$3 = wellKnownSymbol('species');
  1299. // `SpeciesConstructor` abstract operation
  1300. // https://tc39.github.io/ecma262/#sec-speciesconstructor
  1301. var speciesConstructor = function (O, defaultConstructor) {
  1302. var C = anObject(O).constructor;
  1303. var S;
  1304. return C === undefined || (S = anObject(C)[SPECIES$3]) == undefined ? defaultConstructor : aFunction$1(S);
  1305. };
  1306. var arrayPush = [].push;
  1307. var min$3 = Math.min;
  1308. var MAX_UINT32 = 0xFFFFFFFF;
  1309. // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
  1310. var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); });
  1311. // @@split logic
  1312. fixRegexpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) {
  1313. var internalSplit;
  1314. if (
  1315. 'abbc'.split(/(b)*/)[1] == 'c' ||
  1316. 'test'.split(/(?:)/, -1).length != 4 ||
  1317. 'ab'.split(/(?:ab)*/).length != 2 ||
  1318. '.'.split(/(.?)(.?)/).length != 4 ||
  1319. '.'.split(/()()/).length > 1 ||
  1320. ''.split(/.?/).length
  1321. ) {
  1322. // based on es5-shim implementation, need to rework it
  1323. internalSplit = function (separator, limit) {
  1324. var string = String(requireObjectCoercible(this));
  1325. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  1326. if (lim === 0) return [];
  1327. if (separator === undefined) return [string];
  1328. // If `separator` is not a regex, use native split
  1329. if (!isRegexp(separator)) {
  1330. return nativeSplit.call(string, separator, lim);
  1331. }
  1332. var output = [];
  1333. var flags = (separator.ignoreCase ? 'i' : '') +
  1334. (separator.multiline ? 'm' : '') +
  1335. (separator.unicode ? 'u' : '') +
  1336. (separator.sticky ? 'y' : '');
  1337. var lastLastIndex = 0;
  1338. // Make `global` and avoid `lastIndex` issues by working with a copy
  1339. var separatorCopy = new RegExp(separator.source, flags + 'g');
  1340. var match, lastIndex, lastLength;
  1341. while (match = regexpExec.call(separatorCopy, string)) {
  1342. lastIndex = separatorCopy.lastIndex;
  1343. if (lastIndex > lastLastIndex) {
  1344. output.push(string.slice(lastLastIndex, match.index));
  1345. if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));
  1346. lastLength = match[0].length;
  1347. lastLastIndex = lastIndex;
  1348. if (output.length >= lim) break;
  1349. }
  1350. if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
  1351. }
  1352. if (lastLastIndex === string.length) {
  1353. if (lastLength || !separatorCopy.test('')) output.push('');
  1354. } else output.push(string.slice(lastLastIndex));
  1355. return output.length > lim ? output.slice(0, lim) : output;
  1356. };
  1357. // Chakra, V8
  1358. } else if ('0'.split(undefined, 0).length) {
  1359. internalSplit = function (separator, limit) {
  1360. return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);
  1361. };
  1362. } else internalSplit = nativeSplit;
  1363. return [
  1364. // `String.prototype.split` method
  1365. // https://tc39.github.io/ecma262/#sec-string.prototype.split
  1366. function split(separator, limit) {
  1367. var O = requireObjectCoercible(this);
  1368. var splitter = separator == undefined ? undefined : separator[SPLIT];
  1369. return splitter !== undefined
  1370. ? splitter.call(separator, O, limit)
  1371. : internalSplit.call(String(O), separator, limit);
  1372. },
  1373. // `RegExp.prototype[@@split]` method
  1374. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split
  1375. //
  1376. // NOTE: This cannot be properly polyfilled in engines that don't support
  1377. // the 'y' flag.
  1378. function (regexp, limit) {
  1379. var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit);
  1380. if (res.done) return res.value;
  1381. var rx = anObject(regexp);
  1382. var S = String(this);
  1383. var C = speciesConstructor(rx, RegExp);
  1384. var unicodeMatching = rx.unicode;
  1385. var flags = (rx.ignoreCase ? 'i' : '') +
  1386. (rx.multiline ? 'm' : '') +
  1387. (rx.unicode ? 'u' : '') +
  1388. (SUPPORTS_Y ? 'y' : 'g');
  1389. // ^(? + rx + ) is needed, in combination with some S slicing, to
  1390. // simulate the 'y' flag.
  1391. var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
  1392. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  1393. if (lim === 0) return [];
  1394. if (S.length === 0) return regexpExecAbstract(splitter, S) === null ? [S] : [];
  1395. var p = 0;
  1396. var q = 0;
  1397. var A = [];
  1398. while (q < S.length) {
  1399. splitter.lastIndex = SUPPORTS_Y ? q : 0;
  1400. var z = regexpExecAbstract(splitter, SUPPORTS_Y ? S : S.slice(q));
  1401. var e;
  1402. if (
  1403. z === null ||
  1404. (e = min$3(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
  1405. ) {
  1406. q = advanceStringIndex(S, q, unicodeMatching);
  1407. } else {
  1408. A.push(S.slice(p, q));
  1409. if (A.length === lim) return A;
  1410. for (var i = 1; i <= z.length - 1; i++) {
  1411. A.push(z[i]);
  1412. if (A.length === lim) return A;
  1413. }
  1414. q = p = e;
  1415. }
  1416. }
  1417. A.push(S.slice(p));
  1418. return A;
  1419. }
  1420. ];
  1421. }, !SUPPORTS_Y);
  1422. // iterable DOM collections
  1423. // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
  1424. var domIterables = {
  1425. CSSRuleList: 0,
  1426. CSSStyleDeclaration: 0,
  1427. CSSValueList: 0,
  1428. ClientRectList: 0,
  1429. DOMRectList: 0,
  1430. DOMStringList: 0,
  1431. DOMTokenList: 1,
  1432. DataTransferItemList: 0,
  1433. FileList: 0,
  1434. HTMLAllCollection: 0,
  1435. HTMLCollection: 0,
  1436. HTMLFormElement: 0,
  1437. HTMLSelectElement: 0,
  1438. MediaList: 0,
  1439. MimeTypeArray: 0,
  1440. NamedNodeMap: 0,
  1441. NodeList: 1,
  1442. PaintRequestList: 0,
  1443. Plugin: 0,
  1444. PluginArray: 0,
  1445. SVGLengthList: 0,
  1446. SVGNumberList: 0,
  1447. SVGPathSegList: 0,
  1448. SVGPointList: 0,
  1449. SVGStringList: 0,
  1450. SVGTransformList: 0,
  1451. SourceBufferList: 0,
  1452. StyleSheetList: 0,
  1453. TextTrackCueList: 0,
  1454. TextTrackList: 0,
  1455. TouchList: 0
  1456. };
  1457. for (var COLLECTION_NAME in domIterables) {
  1458. var Collection = global_1[COLLECTION_NAME];
  1459. var CollectionPrototype = Collection && Collection.prototype;
  1460. // some Chrome versions have non-configurable methods on DOMTokenList
  1461. if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
  1462. createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
  1463. } catch (error) {
  1464. CollectionPrototype.forEach = arrayForEach;
  1465. }
  1466. }
  1467. function _classCallCheck(instance, Constructor) {
  1468. if (!(instance instanceof Constructor)) {
  1469. throw new TypeError("Cannot call a class as a function");
  1470. }
  1471. }
  1472. function _defineProperties(target, props) {
  1473. for (var i = 0; i < props.length; i++) {
  1474. var descriptor = props[i];
  1475. descriptor.enumerable = descriptor.enumerable || false;
  1476. descriptor.configurable = true;
  1477. if ("value" in descriptor) descriptor.writable = true;
  1478. Object.defineProperty(target, descriptor.key, descriptor);
  1479. }
  1480. }
  1481. function _createClass(Constructor, protoProps, staticProps) {
  1482. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  1483. if (staticProps) _defineProperties(Constructor, staticProps);
  1484. return Constructor;
  1485. }
  1486. function _inherits(subClass, superClass) {
  1487. if (typeof superClass !== "function" && superClass !== null) {
  1488. throw new TypeError("Super expression must either be null or a function");
  1489. }
  1490. subClass.prototype = Object.create(superClass && superClass.prototype, {
  1491. constructor: {
  1492. value: subClass,
  1493. writable: true,
  1494. configurable: true
  1495. }
  1496. });
  1497. if (superClass) _setPrototypeOf(subClass, superClass);
  1498. }
  1499. function _getPrototypeOf(o) {
  1500. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  1501. return o.__proto__ || Object.getPrototypeOf(o);
  1502. };
  1503. return _getPrototypeOf(o);
  1504. }
  1505. function _setPrototypeOf(o, p) {
  1506. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  1507. o.__proto__ = p;
  1508. return o;
  1509. };
  1510. return _setPrototypeOf(o, p);
  1511. }
  1512. function _isNativeReflectConstruct() {
  1513. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  1514. if (Reflect.construct.sham) return false;
  1515. if (typeof Proxy === "function") return true;
  1516. try {
  1517. Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
  1518. return true;
  1519. } catch (e) {
  1520. return false;
  1521. }
  1522. }
  1523. function _assertThisInitialized(self) {
  1524. if (self === void 0) {
  1525. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  1526. }
  1527. return self;
  1528. }
  1529. function _possibleConstructorReturn(self, call) {
  1530. if (call && (typeof call === "object" || typeof call === "function")) {
  1531. return call;
  1532. }
  1533. return _assertThisInitialized(self);
  1534. }
  1535. function _createSuper(Derived) {
  1536. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  1537. return function _createSuperInternal() {
  1538. var Super = _getPrototypeOf(Derived),
  1539. result;
  1540. if (hasNativeReflectConstruct) {
  1541. var NewTarget = _getPrototypeOf(this).constructor;
  1542. result = Reflect.construct(Super, arguments, NewTarget);
  1543. } else {
  1544. result = Super.apply(this, arguments);
  1545. }
  1546. return _possibleConstructorReturn(this, result);
  1547. };
  1548. }
  1549. function _superPropBase(object, property) {
  1550. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  1551. object = _getPrototypeOf(object);
  1552. if (object === null) break;
  1553. }
  1554. return object;
  1555. }
  1556. function _get(target, property, receiver) {
  1557. if (typeof Reflect !== "undefined" && Reflect.get) {
  1558. _get = Reflect.get;
  1559. } else {
  1560. _get = function _get(target, property, receiver) {
  1561. var base = _superPropBase(target, property);
  1562. if (!base) return;
  1563. var desc = Object.getOwnPropertyDescriptor(base, property);
  1564. if (desc.get) {
  1565. return desc.get.call(receiver);
  1566. }
  1567. return desc.value;
  1568. };
  1569. }
  1570. return _get(target, property, receiver || target);
  1571. }
  1572. function _unsupportedIterableToArray(o, minLen) {
  1573. if (!o) return;
  1574. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  1575. var n = Object.prototype.toString.call(o).slice(8, -1);
  1576. if (n === "Object" && o.constructor) n = o.constructor.name;
  1577. if (n === "Map" || n === "Set") return Array.from(o);
  1578. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  1579. }
  1580. function _arrayLikeToArray(arr, len) {
  1581. if (len == null || len > arr.length) len = arr.length;
  1582. for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
  1583. return arr2;
  1584. }
  1585. function _createForOfIteratorHelper(o, allowArrayLike) {
  1586. var it;
  1587. if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
  1588. if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
  1589. if (it) o = it;
  1590. var i = 0;
  1591. var F = function () {};
  1592. return {
  1593. s: F,
  1594. n: function () {
  1595. if (i >= o.length) return {
  1596. done: true
  1597. };
  1598. return {
  1599. done: false,
  1600. value: o[i++]
  1601. };
  1602. },
  1603. e: function (e) {
  1604. throw e;
  1605. },
  1606. f: F
  1607. };
  1608. }
  1609. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  1610. }
  1611. var normalCompletion = true,
  1612. didErr = false,
  1613. err;
  1614. return {
  1615. s: function () {
  1616. it = o[Symbol.iterator]();
  1617. },
  1618. n: function () {
  1619. var step = it.next();
  1620. normalCompletion = step.done;
  1621. return step;
  1622. },
  1623. e: function (e) {
  1624. didErr = true;
  1625. err = e;
  1626. },
  1627. f: function () {
  1628. try {
  1629. if (!normalCompletion && it.return != null) it.return();
  1630. } finally {
  1631. if (didErr) throw err;
  1632. }
  1633. }
  1634. };
  1635. }
  1636. /**
  1637. * @author: Dennis Hernández
  1638. * @webSite: http://djhvscf.github.io/Blog
  1639. * @update zhixin wen <wenzhixin2010@gmail.com>
  1640. */
  1641. var Utils = $__default['default'].fn.bootstrapTable.utils;
  1642. var UtilsCookie = {
  1643. cookieIds: {
  1644. sortOrder: 'bs.table.sortOrder',
  1645. sortName: 'bs.table.sortName',
  1646. pageNumber: 'bs.table.pageNumber',
  1647. pageList: 'bs.table.pageList',
  1648. columns: 'bs.table.columns',
  1649. searchText: 'bs.table.searchText',
  1650. reorderColumns: 'bs.table.reorderColumns',
  1651. filterControl: 'bs.table.filterControl',
  1652. filterBy: 'bs.table.filterBy'
  1653. },
  1654. getCurrentHeader: function getCurrentHeader(that) {
  1655. var header = that.$header;
  1656. if (that.options.height) {
  1657. header = that.$tableHeader;
  1658. }
  1659. return header;
  1660. },
  1661. getCurrentSearchControls: function getCurrentSearchControls(that) {
  1662. var searchControls = 'select, input';
  1663. if (that.options.height) {
  1664. searchControls = 'table select, table input';
  1665. }
  1666. return searchControls;
  1667. },
  1668. cookieEnabled: function cookieEnabled() {
  1669. return !!navigator.cookieEnabled;
  1670. },
  1671. inArrayCookiesEnabled: function inArrayCookiesEnabled(cookieName, cookiesEnabled) {
  1672. var index = -1;
  1673. for (var i = 0; i < cookiesEnabled.length; i++) {
  1674. if (cookieName.toLowerCase() === cookiesEnabled[i].toLowerCase()) {
  1675. index = i;
  1676. break;
  1677. }
  1678. }
  1679. return index;
  1680. },
  1681. setCookie: function setCookie(that, cookieName, cookieValue) {
  1682. if (!that.options.cookie || !UtilsCookie.cookieEnabled() || that.options.cookieIdTable === '') {
  1683. return;
  1684. }
  1685. if (UtilsCookie.inArrayCookiesEnabled(cookieName, that.options.cookiesEnabled) === -1) {
  1686. return;
  1687. }
  1688. cookieName = "".concat(that.options.cookieIdTable, ".").concat(cookieName);
  1689. switch (that.options.cookieStorage) {
  1690. case 'cookieStorage':
  1691. document.cookie = [cookieName, '=', encodeURIComponent(cookieValue), "; expires=".concat(UtilsCookie.calculateExpiration(that.options.cookieExpire)), that.options.cookiePath ? "; path=".concat(that.options.cookiePath) : '', that.options.cookieDomain ? "; domain=".concat(that.options.cookieDomain) : '', that.options.cookieSecure ? '; secure' : '', ";SameSite=".concat(that.options.cookieSameSite)].join('');
  1692. break;
  1693. case 'localStorage':
  1694. localStorage.setItem(cookieName, cookieValue);
  1695. break;
  1696. case 'sessionStorage':
  1697. sessionStorage.setItem(cookieName, cookieValue);
  1698. break;
  1699. case 'customStorage':
  1700. if (!that.options.cookieCustomStorageSet || !that.options.cookieCustomStorageGet || !that.options.cookieCustomStorageDelete) {
  1701. throw new Error('The following options must be set while using the customStorage: cookieCustomStorageSet, cookieCustomStorageGet and cookieCustomStorageDelete');
  1702. }
  1703. Utils.calculateObjectValue(that.options, that.options.cookieCustomStorageSet, [cookieName, cookieValue], '');
  1704. break;
  1705. default:
  1706. return false;
  1707. }
  1708. return true;
  1709. },
  1710. getCookie: function getCookie(that, tableName, cookieName) {
  1711. if (!cookieName) {
  1712. return null;
  1713. }
  1714. if (UtilsCookie.inArrayCookiesEnabled(cookieName, that.options.cookiesEnabled) === -1) {
  1715. return null;
  1716. }
  1717. cookieName = "".concat(tableName, ".").concat(cookieName);
  1718. switch (that.options.cookieStorage) {
  1719. case 'cookieStorage':
  1720. var value = "; ".concat(document.cookie);
  1721. var parts = value.split("; ".concat(cookieName, "="));
  1722. return parts.length === 2 ? decodeURIComponent(parts.pop().split(';').shift()) : null;
  1723. case 'localStorage':
  1724. return localStorage.getItem(cookieName);
  1725. case 'sessionStorage':
  1726. return sessionStorage.getItem(cookieName);
  1727. case 'customStorage':
  1728. if (!that.options.cookieCustomStorageSet || !that.options.cookieCustomStorageGet || !that.options.cookieCustomStorageDelete) {
  1729. throw new Error('The following options must be set while using the customStorage: cookieCustomStorageSet, cookieCustomStorageGet and cookieCustomStorageDelete');
  1730. }
  1731. return Utils.calculateObjectValue(that.options, that.options.cookieCustomStorageGet, [cookieName], '');
  1732. default:
  1733. return null;
  1734. }
  1735. },
  1736. deleteCookie: function deleteCookie(that, tableName, cookieName) {
  1737. cookieName = "".concat(tableName, ".").concat(cookieName);
  1738. switch (that.options.cookieStorage) {
  1739. case 'cookieStorage':
  1740. document.cookie = [encodeURIComponent(cookieName), '=', '; expires=Thu, 01 Jan 1970 00:00:00 GMT', that.options.cookiePath ? "; path=".concat(that.options.cookiePath) : '', that.options.cookieDomain ? "; domain=".concat(that.options.cookieDomain) : '', ";SameSite=".concat(that.options.cookieSameSite)].join('');
  1741. break;
  1742. case 'localStorage':
  1743. localStorage.removeItem(cookieName);
  1744. break;
  1745. case 'sessionStorage':
  1746. sessionStorage.removeItem(cookieName);
  1747. break;
  1748. case 'customStorage':
  1749. if (!that.options.cookieCustomStorageSet || !that.options.cookieCustomStorageGet || !that.options.cookieCustomStorageDelete) {
  1750. throw new Error('The following options must be set while using the customStorage: cookieCustomStorageSet, cookieCustomStorageGet and cookieCustomStorageDelete');
  1751. }
  1752. Utils.calculateObjectValue(that.options, that.options.cookieCustomStorageDelete, [cookieName], '');
  1753. break;
  1754. default:
  1755. return false;
  1756. }
  1757. return true;
  1758. },
  1759. calculateExpiration: function calculateExpiration(cookieExpire) {
  1760. var time = cookieExpire.replace(/[0-9]*/, ''); // s,mi,h,d,m,y
  1761. cookieExpire = cookieExpire.replace(/[A-Za-z]{1,2}/, ''); // number
  1762. switch (time.toLowerCase()) {
  1763. case 's':
  1764. cookieExpire = +cookieExpire;
  1765. break;
  1766. case 'mi':
  1767. cookieExpire *= 60;
  1768. break;
  1769. case 'h':
  1770. cookieExpire = cookieExpire * 60 * 60;
  1771. break;
  1772. case 'd':
  1773. cookieExpire = cookieExpire * 24 * 60 * 60;
  1774. break;
  1775. case 'm':
  1776. cookieExpire = cookieExpire * 30 * 24 * 60 * 60;
  1777. break;
  1778. case 'y':
  1779. cookieExpire = cookieExpire * 365 * 24 * 60 * 60;
  1780. break;
  1781. default:
  1782. cookieExpire = undefined;
  1783. break;
  1784. }
  1785. if (!cookieExpire) {
  1786. return '';
  1787. }
  1788. var d = new Date();
  1789. d.setTime(d.getTime() + cookieExpire * 1000);
  1790. return d.toGMTString();
  1791. },
  1792. initCookieFilters: function initCookieFilters(bootstrapTable) {
  1793. setTimeout(function () {
  1794. var parsedCookieFilters = JSON.parse(UtilsCookie.getCookie(bootstrapTable, bootstrapTable.options.cookieIdTable, UtilsCookie.cookieIds.filterControl));
  1795. if (!bootstrapTable.options.filterControlValuesLoaded && parsedCookieFilters) {
  1796. var cachedFilters = {};
  1797. var header = UtilsCookie.getCurrentHeader(bootstrapTable);
  1798. var searchControls = UtilsCookie.getCurrentSearchControls(bootstrapTable);
  1799. var applyCookieFilters = function applyCookieFilters(element, filteredCookies) {
  1800. filteredCookies.forEach(function (cookie) {
  1801. if (cookie.text === '' || element.type === 'radio' && element.value.toString() !== cookie.text.toString()) {
  1802. return;
  1803. }
  1804. if (element.tagName === 'INPUT' && element.type === 'radio' && element.value.toString() === cookie.text.toString()) {
  1805. element.checked = true;
  1806. cachedFilters[cookie.field] = cookie.text;
  1807. } else if (element.tagName === 'INPUT') {
  1808. element.value = cookie.text;
  1809. cachedFilters[cookie.field] = cookie.text;
  1810. } else if (element.tagName === 'SELECT' && bootstrapTable.options.filterControlContainer) {
  1811. element.value = cookie.text;
  1812. cachedFilters[cookie.field] = cookie.text;
  1813. } else if (cookie.text !== '' && element.tagName === 'SELECT') {
  1814. for (var i = 0; i < element.length; i++) {
  1815. var currentElement = element[i];
  1816. if (currentElement.value === cookie.text) {
  1817. currentElement.selected = true;
  1818. return;
  1819. }
  1820. }
  1821. var option = document.createElement('option');
  1822. option.value = cookie.text;
  1823. option.text = cookie.text;
  1824. element.add(option, element[1]);
  1825. element.selectedIndex = 1;
  1826. cachedFilters[cookie.field] = cookie.text;
  1827. }
  1828. });
  1829. };
  1830. var filterContainer = header;
  1831. if (bootstrapTable.options.filterControlContainer) {
  1832. filterContainer = $__default['default']("".concat(bootstrapTable.options.filterControlContainer));
  1833. }
  1834. filterContainer.find(searchControls).each(function () {
  1835. var field = $__default['default'](this).closest('[data-field]').data('field');
  1836. var filteredCookies = parsedCookieFilters.filter(function (cookie) {
  1837. return cookie.field === field;
  1838. });
  1839. applyCookieFilters(this, filteredCookies);
  1840. });
  1841. bootstrapTable.initColumnSearch(cachedFilters);
  1842. bootstrapTable.options.filterControlValuesLoaded = true;
  1843. bootstrapTable.initServer();
  1844. }
  1845. }, 250);
  1846. }
  1847. };
  1848. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults, {
  1849. cookie: false,
  1850. cookieExpire: '2h',
  1851. cookiePath: null,
  1852. cookieDomain: null,
  1853. cookieSecure: null,
  1854. cookieSameSite: 'Lax',
  1855. cookieIdTable: '',
  1856. cookiesEnabled: ['bs.table.sortOrder', 'bs.table.sortName', 'bs.table.pageNumber', 'bs.table.pageList', 'bs.table.columns', 'bs.table.searchText', 'bs.table.filterControl', 'bs.table.filterBy', 'bs.table.reorderColumns'],
  1857. cookieStorage: 'cookieStorage',
  1858. // localStorage, sessionStorage, customStorage
  1859. cookieCustomStorageGet: null,
  1860. cookieCustomStorageSet: null,
  1861. cookieCustomStorageDelete: null,
  1862. // internal variable
  1863. filterControls: [],
  1864. filterControlValuesLoaded: false
  1865. });
  1866. $__default['default'].fn.bootstrapTable.methods.push('getCookies');
  1867. $__default['default'].fn.bootstrapTable.methods.push('deleteCookie');
  1868. $__default['default'].extend($__default['default'].fn.bootstrapTable.utils, {
  1869. setCookie: UtilsCookie.setCookie,
  1870. getCookie: UtilsCookie.getCookie
  1871. });
  1872. $__default['default'].BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
  1873. _inherits(_class, _$$BootstrapTable);
  1874. var _super = _createSuper(_class);
  1875. function _class() {
  1876. _classCallCheck(this, _class);
  1877. return _super.apply(this, arguments);
  1878. }
  1879. _createClass(_class, [{
  1880. key: "init",
  1881. value: function init() {
  1882. if (this.options.cookie) {
  1883. // FilterBy logic
  1884. var filterByCookieValue = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.filterBy);
  1885. if (typeof filterByCookieValue === 'boolean' && !filterByCookieValue) {
  1886. throw new Error('The cookie value of filterBy must be a json!');
  1887. }
  1888. var filterByCookie = {};
  1889. try {
  1890. filterByCookie = JSON.parse(filterByCookieValue);
  1891. } catch (e) {
  1892. throw new Error('Could not parse the json of the filterBy cookie!');
  1893. }
  1894. this.filterColumns = filterByCookie ? filterByCookie : {}; // FilterControl logic
  1895. this.options.filterControls = [];
  1896. this.options.filterControlValuesLoaded = false;
  1897. this.options.cookiesEnabled = typeof this.options.cookiesEnabled === 'string' ? this.options.cookiesEnabled.replace('[', '').replace(']', '').replace(/'/g, '').replace(/ /g, '').toLowerCase().split(',') : this.options.cookiesEnabled;
  1898. if (this.options.filterControl) {
  1899. var that = this;
  1900. this.$el.on('column-search.bs.table', function (e, field, text) {
  1901. var isNewField = true;
  1902. for (var i = 0; i < that.options.filterControls.length; i++) {
  1903. if (that.options.filterControls[i].field === field) {
  1904. that.options.filterControls[i].text = text;
  1905. isNewField = false;
  1906. break;
  1907. }
  1908. }
  1909. if (isNewField) {
  1910. that.options.filterControls.push({
  1911. field: field,
  1912. text: text
  1913. });
  1914. }
  1915. UtilsCookie.setCookie(that, UtilsCookie.cookieIds.filterControl, JSON.stringify(that.options.filterControls));
  1916. }).on('created-controls.bs.table', UtilsCookie.initCookieFilters(that));
  1917. }
  1918. }
  1919. _get(_getPrototypeOf(_class.prototype), "init", this).call(this);
  1920. }
  1921. }, {
  1922. key: "initServer",
  1923. value: function initServer() {
  1924. var _get2;
  1925. if (this.options.cookie && this.options.filterControl && !this.options.filterControlValuesLoaded) {
  1926. var cookie = JSON.parse(UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.filterControl));
  1927. if (cookie) {
  1928. return;
  1929. }
  1930. }
  1931. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1932. args[_key] = arguments[_key];
  1933. }
  1934. (_get2 = _get(_getPrototypeOf(_class.prototype), "initServer", this)).call.apply(_get2, [this].concat(args));
  1935. }
  1936. }, {
  1937. key: "initTable",
  1938. value: function initTable() {
  1939. var _get3;
  1940. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  1941. args[_key2] = arguments[_key2];
  1942. }
  1943. (_get3 = _get(_getPrototypeOf(_class.prototype), "initTable", this)).call.apply(_get3, [this].concat(args));
  1944. this.initCookie();
  1945. }
  1946. }, {
  1947. key: "onSort",
  1948. value: function onSort() {
  1949. var _get4;
  1950. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  1951. args[_key3] = arguments[_key3];
  1952. }
  1953. (_get4 = _get(_getPrototypeOf(_class.prototype), "onSort", this)).call.apply(_get4, [this].concat(args));
  1954. if (this.options.sortName === undefined || this.options.sortOrder === undefined) {
  1955. UtilsCookie.deleteCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.sortName);
  1956. UtilsCookie.deleteCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.sortOrder);
  1957. return;
  1958. }
  1959. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.sortOrder, this.options.sortOrder);
  1960. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.sortName, this.options.sortName);
  1961. }
  1962. }, {
  1963. key: "onPageNumber",
  1964. value: function onPageNumber() {
  1965. var _get5;
  1966. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  1967. args[_key4] = arguments[_key4];
  1968. }
  1969. (_get5 = _get(_getPrototypeOf(_class.prototype), "onPageNumber", this)).call.apply(_get5, [this].concat(args));
  1970. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
  1971. }
  1972. }, {
  1973. key: "onPageListChange",
  1974. value: function onPageListChange() {
  1975. var _get6;
  1976. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  1977. args[_key5] = arguments[_key5];
  1978. }
  1979. (_get6 = _get(_getPrototypeOf(_class.prototype), "onPageListChange", this)).call.apply(_get6, [this].concat(args));
  1980. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageList, this.options.pageSize);
  1981. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
  1982. }
  1983. }, {
  1984. key: "onPagePre",
  1985. value: function onPagePre() {
  1986. var _get7;
  1987. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  1988. args[_key6] = arguments[_key6];
  1989. }
  1990. (_get7 = _get(_getPrototypeOf(_class.prototype), "onPagePre", this)).call.apply(_get7, [this].concat(args));
  1991. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
  1992. }
  1993. }, {
  1994. key: "onPageNext",
  1995. value: function onPageNext() {
  1996. var _get8;
  1997. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  1998. args[_key7] = arguments[_key7];
  1999. }
  2000. (_get8 = _get(_getPrototypeOf(_class.prototype), "onPageNext", this)).call.apply(_get8, [this].concat(args));
  2001. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
  2002. }
  2003. }, {
  2004. key: "_toggleColumn",
  2005. value: function _toggleColumn() {
  2006. var _get9;
  2007. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  2008. args[_key8] = arguments[_key8];
  2009. }
  2010. (_get9 = _get(_getPrototypeOf(_class.prototype), "_toggleColumn", this)).call.apply(_get9, [this].concat(args));
  2011. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.columns, JSON.stringify(this.getVisibleColumns().map(function (column) {
  2012. return column.field;
  2013. })));
  2014. }
  2015. }, {
  2016. key: "_toggleAllColumns",
  2017. value: function _toggleAllColumns() {
  2018. var _get10;
  2019. for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
  2020. args[_key9] = arguments[_key9];
  2021. }
  2022. (_get10 = _get(_getPrototypeOf(_class.prototype), "_toggleAllColumns", this)).call.apply(_get10, [this].concat(args));
  2023. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.columns, JSON.stringify(this.getVisibleColumns().map(function (column) {
  2024. return column.field;
  2025. })));
  2026. }
  2027. }, {
  2028. key: "selectPage",
  2029. value: function selectPage(page) {
  2030. _get(_getPrototypeOf(_class.prototype), "selectPage", this).call(this, page);
  2031. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, page);
  2032. }
  2033. }, {
  2034. key: "onSearch",
  2035. value: function onSearch(event) {
  2036. _get(_getPrototypeOf(_class.prototype), "onSearch", this).call(this, event);
  2037. if (this.options.search) {
  2038. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.searchText, this.searchText);
  2039. }
  2040. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.pageNumber, this.options.pageNumber);
  2041. }
  2042. }, {
  2043. key: "initHeader",
  2044. value: function initHeader() {
  2045. var _get11;
  2046. if (this.options.reorderableColumns) {
  2047. this.columnsSortOrder = JSON.parse(UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.reorderColumns));
  2048. }
  2049. for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
  2050. args[_key10] = arguments[_key10];
  2051. }
  2052. (_get11 = _get(_getPrototypeOf(_class.prototype), "initHeader", this)).call.apply(_get11, [this].concat(args));
  2053. }
  2054. }, {
  2055. key: "persistReorderColumnsState",
  2056. value: function persistReorderColumnsState(that) {
  2057. UtilsCookie.setCookie(that, UtilsCookie.cookieIds.reorderColumns, JSON.stringify(that.columnsSortOrder));
  2058. }
  2059. }, {
  2060. key: "filterBy",
  2061. value: function filterBy() {
  2062. var _get12;
  2063. for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
  2064. args[_key11] = arguments[_key11];
  2065. }
  2066. (_get12 = _get(_getPrototypeOf(_class.prototype), "filterBy", this)).call.apply(_get12, [this].concat(args));
  2067. UtilsCookie.setCookie(this, UtilsCookie.cookieIds.filterBy, JSON.stringify(this.filterColumns));
  2068. }
  2069. }, {
  2070. key: "initCookie",
  2071. value: function initCookie() {
  2072. var _this = this;
  2073. if (!this.options.cookie) {
  2074. return;
  2075. }
  2076. if (this.options.cookieIdTable === '' || this.options.cookieExpire === '' || !UtilsCookie.cookieEnabled()) {
  2077. console.error('Configuration error. Please review the cookieIdTable and the cookieExpire property. If the properties are correct, then this browser does not support cookies.');
  2078. this.options.cookie = false; // Make sure that the cookie extension is disabled
  2079. return;
  2080. }
  2081. var sortOrderCookie = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.sortOrder);
  2082. var sortOrderNameCookie = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.sortName);
  2083. var pageNumberCookie = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.pageNumber);
  2084. var pageListCookie = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.pageList);
  2085. var searchTextCookie = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.searchText);
  2086. var columnsCookieValue = UtilsCookie.getCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds.columns);
  2087. if (typeof columnsCookieValue === 'boolean' && !columnsCookieValue) {
  2088. throw new Error('The cookie value of filterBy must be a json!');
  2089. }
  2090. var columnsCookie = {};
  2091. try {
  2092. columnsCookie = JSON.parse(columnsCookieValue);
  2093. } catch (e) {
  2094. throw new Error('Could not parse the json of the columns cookie!', columnsCookieValue);
  2095. } // sortOrder
  2096. this.options.sortOrder = sortOrderCookie ? sortOrderCookie : this.options.sortOrder; // sortName
  2097. this.options.sortName = sortOrderNameCookie ? sortOrderNameCookie : this.options.sortName; // pageNumber
  2098. this.options.pageNumber = pageNumberCookie ? +pageNumberCookie : this.options.pageNumber; // pageSize
  2099. this.options.pageSize = pageListCookie ? pageListCookie === this.options.formatAllRows() ? pageListCookie : +pageListCookie : this.options.pageSize; // searchText
  2100. this.options.searchText = searchTextCookie ? searchTextCookie : '';
  2101. if (columnsCookie) {
  2102. var _iterator = _createForOfIteratorHelper(this.columns),
  2103. _step;
  2104. try {
  2105. var _loop = function _loop() {
  2106. var column = _step.value;
  2107. column.visible = columnsCookie.filter(function (columnField) {
  2108. if (_this.isSelectionColumn(column)) {
  2109. return true;
  2110. }
  2111. /**
  2112. * This is needed for the old saved cookies or the table will show no columns!
  2113. * It can be removed in 2-3 Versions Later!!
  2114. * TODO: Remove this part some versions later e.g. 1.17.3
  2115. */
  2116. if (columnField instanceof Object) {
  2117. return columnField.field === column.field;
  2118. }
  2119. return columnField === column.field;
  2120. }).length > 0 || !column.switchable;
  2121. };
  2122. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  2123. _loop();
  2124. }
  2125. } catch (err) {
  2126. _iterator.e(err);
  2127. } finally {
  2128. _iterator.f();
  2129. }
  2130. }
  2131. }
  2132. }, {
  2133. key: "getCookies",
  2134. value: function getCookies() {
  2135. var bootstrapTable = this;
  2136. var cookies = {};
  2137. $__default['default'].each(UtilsCookie.cookieIds, function (key, value) {
  2138. cookies[key] = UtilsCookie.getCookie(bootstrapTable, bootstrapTable.options.cookieIdTable, value);
  2139. if (key === 'columns') {
  2140. cookies[key] = JSON.parse(cookies[key]);
  2141. }
  2142. });
  2143. return cookies;
  2144. }
  2145. }, {
  2146. key: "deleteCookie",
  2147. value: function deleteCookie(cookieName) {
  2148. if (cookieName === '' || !UtilsCookie.cookieEnabled()) {
  2149. return;
  2150. }
  2151. UtilsCookie.deleteCookie(this, this.options.cookieIdTable, UtilsCookie.cookieIds[cookieName]);
  2152. }
  2153. }]);
  2154. return _class;
  2155. }($__default['default'].BootstrapTable);
  2156. })));