bootstrap-table-accent-neutralise.js 55 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757
  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 = global || self, factory(global.jQuery));
  5. }(this, function ($) { 'use strict';
  6. $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
  7. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  8. function createCommonjsModule(fn, module) {
  9. return module = { exports: {} }, fn(module, module.exports), module.exports;
  10. }
  11. var O = 'object';
  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 == O && globalThis) ||
  19. check(typeof window == O && window) ||
  20. check(typeof self == O && self) ||
  21. check(typeof commonjsGlobal == O && commonjsGlobal) ||
  22. // eslint-disable-next-line no-new-func
  23. 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({}, 'a', { get: function () { return 7; } }).a != 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 = global_1.document;
  99. // typeof document.createElement is 'object' in old IE
  100. var EXISTS = isObject(document) && isObject(document.createElement);
  101. var documentCreateElement = function (it) {
  102. return EXISTS ? document.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 hide = 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. hide(global_1, key, value);
  155. } catch (error) {
  156. global_1[key] = value;
  157. } return value;
  158. };
  159. var shared = createCommonjsModule(function (module) {
  160. var SHARED = '__core-js_shared__';
  161. var store = global_1[SHARED] || setGlobal(SHARED, {});
  162. (module.exports = function (key, value) {
  163. return store[key] || (store[key] = value !== undefined ? value : {});
  164. })('versions', []).push({
  165. version: '3.1.3',
  166. mode: 'global',
  167. copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
  168. });
  169. });
  170. var functionToString = shared('native-function-to-string', Function.toString);
  171. var WeakMap = global_1.WeakMap;
  172. var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(functionToString.call(WeakMap));
  173. var id = 0;
  174. var postfix = Math.random();
  175. var uid = function (key) {
  176. return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
  177. };
  178. var keys = shared('keys');
  179. var sharedKey = function (key) {
  180. return keys[key] || (keys[key] = uid(key));
  181. };
  182. var hiddenKeys = {};
  183. var WeakMap$1 = global_1.WeakMap;
  184. var set, get, has$1;
  185. var enforce = function (it) {
  186. return has$1(it) ? get(it) : set(it, {});
  187. };
  188. var getterFor = function (TYPE) {
  189. return function (it) {
  190. var state;
  191. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  192. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  193. } return state;
  194. };
  195. };
  196. if (nativeWeakMap) {
  197. var store = new WeakMap$1();
  198. var wmget = store.get;
  199. var wmhas = store.has;
  200. var wmset = store.set;
  201. set = function (it, metadata) {
  202. wmset.call(store, it, metadata);
  203. return metadata;
  204. };
  205. get = function (it) {
  206. return wmget.call(store, it) || {};
  207. };
  208. has$1 = function (it) {
  209. return wmhas.call(store, it);
  210. };
  211. } else {
  212. var STATE = sharedKey('state');
  213. hiddenKeys[STATE] = true;
  214. set = function (it, metadata) {
  215. hide(it, STATE, metadata);
  216. return metadata;
  217. };
  218. get = function (it) {
  219. return has(it, STATE) ? it[STATE] : {};
  220. };
  221. has$1 = function (it) {
  222. return has(it, STATE);
  223. };
  224. }
  225. var internalState = {
  226. set: set,
  227. get: get,
  228. has: has$1,
  229. enforce: enforce,
  230. getterFor: getterFor
  231. };
  232. var redefine = createCommonjsModule(function (module) {
  233. var getInternalState = internalState.get;
  234. var enforceInternalState = internalState.enforce;
  235. var TEMPLATE = String(functionToString).split('toString');
  236. shared('inspectSource', function (it) {
  237. return functionToString.call(it);
  238. });
  239. (module.exports = function (O, key, value, options) {
  240. var unsafe = options ? !!options.unsafe : false;
  241. var simple = options ? !!options.enumerable : false;
  242. var noTargetGet = options ? !!options.noTargetGet : false;
  243. if (typeof value == 'function') {
  244. if (typeof key == 'string' && !has(value, 'name')) hide(value, 'name', key);
  245. enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
  246. }
  247. if (O === global_1) {
  248. if (simple) O[key] = value;
  249. else setGlobal(key, value);
  250. return;
  251. } else if (!unsafe) {
  252. delete O[key];
  253. } else if (!noTargetGet && O[key]) {
  254. simple = true;
  255. }
  256. if (simple) O[key] = value;
  257. else hide(O, key, value);
  258. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  259. })(Function.prototype, 'toString', function toString() {
  260. return typeof this == 'function' && getInternalState(this).source || functionToString.call(this);
  261. });
  262. });
  263. var path = global_1;
  264. var aFunction = function (variable) {
  265. return typeof variable == 'function' ? variable : undefined;
  266. };
  267. var getBuiltIn = function (namespace, method) {
  268. return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace])
  269. : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
  270. };
  271. var ceil = Math.ceil;
  272. var floor = Math.floor;
  273. // `ToInteger` abstract operation
  274. // https://tc39.github.io/ecma262/#sec-tointeger
  275. var toInteger = function (argument) {
  276. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
  277. };
  278. var min = Math.min;
  279. // `ToLength` abstract operation
  280. // https://tc39.github.io/ecma262/#sec-tolength
  281. var toLength = function (argument) {
  282. return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  283. };
  284. var max = Math.max;
  285. var min$1 = Math.min;
  286. // Helper for a popular repeating case of the spec:
  287. // Let integer be ? ToInteger(index).
  288. // If integer < 0, let result be max((length + integer), 0); else let result be min(length, length).
  289. var toAbsoluteIndex = function (index, length) {
  290. var integer = toInteger(index);
  291. return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
  292. };
  293. // `Array.prototype.{ indexOf, includes }` methods implementation
  294. var createMethod = function (IS_INCLUDES) {
  295. return function ($this, el, fromIndex) {
  296. var O = toIndexedObject($this);
  297. var length = toLength(O.length);
  298. var index = toAbsoluteIndex(fromIndex, length);
  299. var value;
  300. // Array#includes uses SameValueZero equality algorithm
  301. // eslint-disable-next-line no-self-compare
  302. if (IS_INCLUDES && el != el) while (length > index) {
  303. value = O[index++];
  304. // eslint-disable-next-line no-self-compare
  305. if (value != value) return true;
  306. // Array#indexOf ignores holes, Array#includes - not
  307. } else for (;length > index; index++) {
  308. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  309. } return !IS_INCLUDES && -1;
  310. };
  311. };
  312. var arrayIncludes = {
  313. // `Array.prototype.includes` method
  314. // https://tc39.github.io/ecma262/#sec-array.prototype.includes
  315. includes: createMethod(true),
  316. // `Array.prototype.indexOf` method
  317. // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
  318. indexOf: createMethod(false)
  319. };
  320. var indexOf = arrayIncludes.indexOf;
  321. var objectKeysInternal = function (object, names) {
  322. var O = toIndexedObject(object);
  323. var i = 0;
  324. var result = [];
  325. var key;
  326. for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
  327. // Don't enum bug & hidden keys
  328. while (names.length > i) if (has(O, key = names[i++])) {
  329. ~indexOf(result, key) || result.push(key);
  330. }
  331. return result;
  332. };
  333. // IE8- don't enum bug keys
  334. var enumBugKeys = [
  335. 'constructor',
  336. 'hasOwnProperty',
  337. 'isPrototypeOf',
  338. 'propertyIsEnumerable',
  339. 'toLocaleString',
  340. 'toString',
  341. 'valueOf'
  342. ];
  343. var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
  344. // `Object.getOwnPropertyNames` method
  345. // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
  346. var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  347. return objectKeysInternal(O, hiddenKeys$1);
  348. };
  349. var objectGetOwnPropertyNames = {
  350. f: f$3
  351. };
  352. var f$4 = Object.getOwnPropertySymbols;
  353. var objectGetOwnPropertySymbols = {
  354. f: f$4
  355. };
  356. // all object keys, includes non-enumerable and symbols
  357. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  358. var keys = objectGetOwnPropertyNames.f(anObject(it));
  359. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  360. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  361. };
  362. var copyConstructorProperties = function (target, source) {
  363. var keys = ownKeys(source);
  364. var defineProperty = objectDefineProperty.f;
  365. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  366. for (var i = 0; i < keys.length; i++) {
  367. var key = keys[i];
  368. if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  369. }
  370. };
  371. var replacement = /#|\.prototype\./;
  372. var isForced = function (feature, detection) {
  373. var value = data[normalize(feature)];
  374. return value == POLYFILL ? true
  375. : value == NATIVE ? false
  376. : typeof detection == 'function' ? fails(detection)
  377. : !!detection;
  378. };
  379. var normalize = isForced.normalize = function (string) {
  380. return String(string).replace(replacement, '.').toLowerCase();
  381. };
  382. var data = isForced.data = {};
  383. var NATIVE = isForced.NATIVE = 'N';
  384. var POLYFILL = isForced.POLYFILL = 'P';
  385. var isForced_1 = isForced;
  386. var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
  387. /*
  388. options.target - name of the target object
  389. options.global - target is the global object
  390. options.stat - export as static methods of target
  391. options.proto - export as prototype methods of target
  392. options.real - real prototype method for the `pure` version
  393. options.forced - export even if the native feature is available
  394. options.bind - bind methods to the target, required for the `pure` version
  395. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  396. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  397. options.sham - add a flag to not completely full polyfills
  398. options.enumerable - export as enumerable property
  399. options.noTargetGet - prevent calling a getter on target
  400. */
  401. var _export = function (options, source) {
  402. var TARGET = options.target;
  403. var GLOBAL = options.global;
  404. var STATIC = options.stat;
  405. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  406. if (GLOBAL) {
  407. target = global_1;
  408. } else if (STATIC) {
  409. target = global_1[TARGET] || setGlobal(TARGET, {});
  410. } else {
  411. target = (global_1[TARGET] || {}).prototype;
  412. }
  413. if (target) for (key in source) {
  414. sourceProperty = source[key];
  415. if (options.noTargetGet) {
  416. descriptor = getOwnPropertyDescriptor$1(target, key);
  417. targetProperty = descriptor && descriptor.value;
  418. } else targetProperty = target[key];
  419. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  420. // contained in target
  421. if (!FORCED && targetProperty !== undefined) {
  422. if (typeof sourceProperty === typeof targetProperty) continue;
  423. copyConstructorProperties(sourceProperty, targetProperty);
  424. }
  425. // add a flag to not completely full polyfills
  426. if (options.sham || (targetProperty && targetProperty.sham)) {
  427. hide(sourceProperty, 'sham', true);
  428. }
  429. // extend global
  430. redefine(target, key, sourceProperty, options);
  431. }
  432. };
  433. var aFunction$1 = function (it) {
  434. if (typeof it != 'function') {
  435. throw TypeError(String(it) + ' is not a function');
  436. } return it;
  437. };
  438. // optional / simple context binding
  439. var bindContext = function (fn, that, length) {
  440. aFunction$1(fn);
  441. if (that === undefined) return fn;
  442. switch (length) {
  443. case 0: return function () {
  444. return fn.call(that);
  445. };
  446. case 1: return function (a) {
  447. return fn.call(that, a);
  448. };
  449. case 2: return function (a, b) {
  450. return fn.call(that, a, b);
  451. };
  452. case 3: return function (a, b, c) {
  453. return fn.call(that, a, b, c);
  454. };
  455. }
  456. return function (/* ...args */) {
  457. return fn.apply(that, arguments);
  458. };
  459. };
  460. // `ToObject` abstract operation
  461. // https://tc39.github.io/ecma262/#sec-toobject
  462. var toObject = function (argument) {
  463. return Object(requireObjectCoercible(argument));
  464. };
  465. // `IsArray` abstract operation
  466. // https://tc39.github.io/ecma262/#sec-isarray
  467. var isArray = Array.isArray || function isArray(arg) {
  468. return classofRaw(arg) == 'Array';
  469. };
  470. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  471. // Chrome 38 Symbol has incorrect toString conversion
  472. // eslint-disable-next-line no-undef
  473. return !String(Symbol());
  474. });
  475. var Symbol$1 = global_1.Symbol;
  476. var store$1 = shared('wks');
  477. var wellKnownSymbol = function (name) {
  478. return store$1[name] || (store$1[name] = nativeSymbol && Symbol$1[name]
  479. || (nativeSymbol ? Symbol$1 : uid)('Symbol.' + name));
  480. };
  481. var SPECIES = wellKnownSymbol('species');
  482. // `ArraySpeciesCreate` abstract operation
  483. // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
  484. var arraySpeciesCreate = function (originalArray, length) {
  485. var C;
  486. if (isArray(originalArray)) {
  487. C = originalArray.constructor;
  488. // cross-realm fallback
  489. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  490. else if (isObject(C)) {
  491. C = C[SPECIES];
  492. if (C === null) C = undefined;
  493. }
  494. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  495. };
  496. var push = [].push;
  497. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation
  498. var createMethod$1 = function (TYPE) {
  499. var IS_MAP = TYPE == 1;
  500. var IS_FILTER = TYPE == 2;
  501. var IS_SOME = TYPE == 3;
  502. var IS_EVERY = TYPE == 4;
  503. var IS_FIND_INDEX = TYPE == 6;
  504. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  505. return function ($this, callbackfn, that, specificCreate) {
  506. var O = toObject($this);
  507. var self = indexedObject(O);
  508. var boundFunction = bindContext(callbackfn, that, 3);
  509. var length = toLength(self.length);
  510. var index = 0;
  511. var create = specificCreate || arraySpeciesCreate;
  512. var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
  513. var value, result;
  514. for (;length > index; index++) if (NO_HOLES || index in self) {
  515. value = self[index];
  516. result = boundFunction(value, index, O);
  517. if (TYPE) {
  518. if (IS_MAP) target[index] = result; // map
  519. else if (result) switch (TYPE) {
  520. case 3: return true; // some
  521. case 5: return value; // find
  522. case 6: return index; // findIndex
  523. case 2: push.call(target, value); // filter
  524. } else if (IS_EVERY) return false; // every
  525. }
  526. }
  527. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  528. };
  529. };
  530. var arrayIteration = {
  531. // `Array.prototype.forEach` method
  532. // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
  533. forEach: createMethod$1(0),
  534. // `Array.prototype.map` method
  535. // https://tc39.github.io/ecma262/#sec-array.prototype.map
  536. map: createMethod$1(1),
  537. // `Array.prototype.filter` method
  538. // https://tc39.github.io/ecma262/#sec-array.prototype.filter
  539. filter: createMethod$1(2),
  540. // `Array.prototype.some` method
  541. // https://tc39.github.io/ecma262/#sec-array.prototype.some
  542. some: createMethod$1(3),
  543. // `Array.prototype.every` method
  544. // https://tc39.github.io/ecma262/#sec-array.prototype.every
  545. every: createMethod$1(4),
  546. // `Array.prototype.find` method
  547. // https://tc39.github.io/ecma262/#sec-array.prototype.find
  548. find: createMethod$1(5),
  549. // `Array.prototype.findIndex` method
  550. // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
  551. findIndex: createMethod$1(6)
  552. };
  553. var SPECIES$1 = wellKnownSymbol('species');
  554. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  555. return !fails(function () {
  556. var array = [];
  557. var constructor = array.constructor = {};
  558. constructor[SPECIES$1] = function () {
  559. return { foo: 1 };
  560. };
  561. return array[METHOD_NAME](Boolean).foo !== 1;
  562. });
  563. };
  564. var $filter = arrayIteration.filter;
  565. // `Array.prototype.filter` method
  566. // https://tc39.github.io/ecma262/#sec-array.prototype.filter
  567. // with adding support of @@species
  568. _export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('filter') }, {
  569. filter: function filter(callbackfn /* , thisArg */) {
  570. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  571. }
  572. });
  573. // `Object.keys` method
  574. // https://tc39.github.io/ecma262/#sec-object.keys
  575. var objectKeys = Object.keys || function keys(O) {
  576. return objectKeysInternal(O, enumBugKeys);
  577. };
  578. // `Object.defineProperties` method
  579. // https://tc39.github.io/ecma262/#sec-object.defineproperties
  580. var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
  581. anObject(O);
  582. var keys = objectKeys(Properties);
  583. var length = keys.length;
  584. var index = 0;
  585. var key;
  586. while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
  587. return O;
  588. };
  589. var html = getBuiltIn('document', 'documentElement');
  590. var IE_PROTO = sharedKey('IE_PROTO');
  591. var PROTOTYPE = 'prototype';
  592. var Empty = function () { /* empty */ };
  593. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  594. var createDict = function () {
  595. // Thrash, waste and sodomy: IE GC bug
  596. var iframe = documentCreateElement('iframe');
  597. var length = enumBugKeys.length;
  598. var lt = '<';
  599. var script = 'script';
  600. var gt = '>';
  601. var js = 'java' + script + ':';
  602. var iframeDocument;
  603. iframe.style.display = 'none';
  604. html.appendChild(iframe);
  605. iframe.src = String(js);
  606. iframeDocument = iframe.contentWindow.document;
  607. iframeDocument.open();
  608. iframeDocument.write(lt + script + gt + 'document.F=Object' + lt + '/' + script + gt);
  609. iframeDocument.close();
  610. createDict = iframeDocument.F;
  611. while (length--) delete createDict[PROTOTYPE][enumBugKeys[length]];
  612. return createDict();
  613. };
  614. // `Object.create` method
  615. // https://tc39.github.io/ecma262/#sec-object.create
  616. var objectCreate = Object.create || function create(O, Properties) {
  617. var result;
  618. if (O !== null) {
  619. Empty[PROTOTYPE] = anObject(O);
  620. result = new Empty();
  621. Empty[PROTOTYPE] = null;
  622. // add "__proto__" for Object.getPrototypeOf polyfill
  623. result[IE_PROTO] = O;
  624. } else result = createDict();
  625. return Properties === undefined ? result : objectDefineProperties(result, Properties);
  626. };
  627. hiddenKeys[IE_PROTO] = true;
  628. var UNSCOPABLES = wellKnownSymbol('unscopables');
  629. var ArrayPrototype = Array.prototype;
  630. // Array.prototype[@@unscopables]
  631. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  632. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  633. hide(ArrayPrototype, UNSCOPABLES, objectCreate(null));
  634. }
  635. // add a key to Array.prototype[@@unscopables]
  636. var addToUnscopables = function (key) {
  637. ArrayPrototype[UNSCOPABLES][key] = true;
  638. };
  639. var $includes = arrayIncludes.includes;
  640. // `Array.prototype.includes` method
  641. // https://tc39.github.io/ecma262/#sec-array.prototype.includes
  642. _export({ target: 'Array', proto: true }, {
  643. includes: function includes(el /* , fromIndex = 0 */) {
  644. return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  645. }
  646. });
  647. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  648. addToUnscopables('includes');
  649. var sloppyArrayMethod = function (METHOD_NAME, argument) {
  650. var method = [][METHOD_NAME];
  651. return !method || !fails(function () {
  652. // eslint-disable-next-line no-useless-call,no-throw-literal
  653. method.call(null, argument || function () { throw 1; }, 1);
  654. });
  655. };
  656. var $indexOf = arrayIncludes.indexOf;
  657. var nativeIndexOf = [].indexOf;
  658. var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
  659. var SLOPPY_METHOD = sloppyArrayMethod('indexOf');
  660. // `Array.prototype.indexOf` method
  661. // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
  662. _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || SLOPPY_METHOD }, {
  663. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  664. return NEGATIVE_ZERO
  665. // convert -0 to +0
  666. ? nativeIndexOf.apply(this, arguments) || 0
  667. : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
  668. }
  669. });
  670. var propertyIsEnumerable = objectPropertyIsEnumerable.f;
  671. // `Object.{ entries, values }` methods implementation
  672. var createMethod$2 = function (TO_ENTRIES) {
  673. return function (it) {
  674. var O = toIndexedObject(it);
  675. var keys = objectKeys(O);
  676. var length = keys.length;
  677. var i = 0;
  678. var result = [];
  679. var key;
  680. while (length > i) {
  681. key = keys[i++];
  682. if (!descriptors || propertyIsEnumerable.call(O, key)) {
  683. result.push(TO_ENTRIES ? [key, O[key]] : O[key]);
  684. }
  685. }
  686. return result;
  687. };
  688. };
  689. var objectToArray = {
  690. // `Object.entries` method
  691. // https://tc39.github.io/ecma262/#sec-object.entries
  692. entries: createMethod$2(true),
  693. // `Object.values` method
  694. // https://tc39.github.io/ecma262/#sec-object.values
  695. values: createMethod$2(false)
  696. };
  697. var $entries = objectToArray.entries;
  698. // `Object.entries` method
  699. // https://tc39.github.io/ecma262/#sec-object.entries
  700. _export({ target: 'Object', stat: true }, {
  701. entries: function entries(O) {
  702. return $entries(O);
  703. }
  704. });
  705. // a string of all valid unicode whitespaces
  706. // eslint-disable-next-line max-len
  707. var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  708. var whitespace = '[' + whitespaces + ']';
  709. var ltrim = RegExp('^' + whitespace + whitespace + '*');
  710. var rtrim = RegExp(whitespace + whitespace + '*$');
  711. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  712. var createMethod$3 = function (TYPE) {
  713. return function ($this) {
  714. var string = String(requireObjectCoercible($this));
  715. if (TYPE & 1) string = string.replace(ltrim, '');
  716. if (TYPE & 2) string = string.replace(rtrim, '');
  717. return string;
  718. };
  719. };
  720. var stringTrim = {
  721. // `String.prototype.{ trimLeft, trimStart }` methods
  722. // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart
  723. start: createMethod$3(1),
  724. // `String.prototype.{ trimRight, trimEnd }` methods
  725. // https://tc39.github.io/ecma262/#sec-string.prototype.trimend
  726. end: createMethod$3(2),
  727. // `String.prototype.trim` method
  728. // https://tc39.github.io/ecma262/#sec-string.prototype.trim
  729. trim: createMethod$3(3)
  730. };
  731. var trim = stringTrim.trim;
  732. var nativeParseInt = global_1.parseInt;
  733. var hex = /^[+-]?0[Xx]/;
  734. var FORCED = nativeParseInt(whitespaces + '08') !== 8 || nativeParseInt(whitespaces + '0x16') !== 22;
  735. // `parseInt` method
  736. // https://tc39.github.io/ecma262/#sec-parseint-string-radix
  737. var _parseInt = FORCED ? function parseInt(string, radix) {
  738. var S = trim(String(string));
  739. return nativeParseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10));
  740. } : nativeParseInt;
  741. // `parseInt` method
  742. // https://tc39.github.io/ecma262/#sec-parseint-string-radix
  743. _export({ global: true, forced: parseInt != _parseInt }, {
  744. parseInt: _parseInt
  745. });
  746. var MATCH = wellKnownSymbol('match');
  747. // `IsRegExp` abstract operation
  748. // https://tc39.github.io/ecma262/#sec-isregexp
  749. var isRegexp = function (it) {
  750. var isRegExp;
  751. return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
  752. };
  753. var notARegexp = function (it) {
  754. if (isRegexp(it)) {
  755. throw TypeError("The method doesn't accept regular expressions");
  756. } return it;
  757. };
  758. var MATCH$1 = wellKnownSymbol('match');
  759. var correctIsRegexpLogic = function (METHOD_NAME) {
  760. var regexp = /./;
  761. try {
  762. '/./'[METHOD_NAME](regexp);
  763. } catch (e) {
  764. try {
  765. regexp[MATCH$1] = false;
  766. return '/./'[METHOD_NAME](regexp);
  767. } catch (f) { /* empty */ }
  768. } return false;
  769. };
  770. // `String.prototype.includes` method
  771. // https://tc39.github.io/ecma262/#sec-string.prototype.includes
  772. _export({ target: 'String', proto: true, forced: !correctIsRegexpLogic('includes') }, {
  773. includes: function includes(searchString /* , position = 0 */) {
  774. return !!~String(requireObjectCoercible(this))
  775. .indexOf(notARegexp(searchString), arguments.length > 1 ? arguments[1] : undefined);
  776. }
  777. });
  778. // `RegExp.prototype.flags` getter implementation
  779. // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
  780. var regexpFlags = function () {
  781. var that = anObject(this);
  782. var result = '';
  783. if (that.global) result += 'g';
  784. if (that.ignoreCase) result += 'i';
  785. if (that.multiline) result += 'm';
  786. if (that.dotAll) result += 's';
  787. if (that.unicode) result += 'u';
  788. if (that.sticky) result += 'y';
  789. return result;
  790. };
  791. var nativeExec = RegExp.prototype.exec;
  792. // This always refers to the native implementation, because the
  793. // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
  794. // which loads this file before patching the method.
  795. var nativeReplace = String.prototype.replace;
  796. var patchedExec = nativeExec;
  797. var UPDATES_LAST_INDEX_WRONG = (function () {
  798. var re1 = /a/;
  799. var re2 = /b*/g;
  800. nativeExec.call(re1, 'a');
  801. nativeExec.call(re2, 'a');
  802. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  803. })();
  804. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  805. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  806. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
  807. if (PATCH) {
  808. patchedExec = function exec(str) {
  809. var re = this;
  810. var lastIndex, reCopy, match, i;
  811. if (NPCG_INCLUDED) {
  812. reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
  813. }
  814. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  815. match = nativeExec.call(re, str);
  816. if (UPDATES_LAST_INDEX_WRONG && match) {
  817. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  818. }
  819. if (NPCG_INCLUDED && match && match.length > 1) {
  820. // Fix browsers whose `exec` methods don't consistently return `undefined`
  821. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  822. nativeReplace.call(match[0], reCopy, function () {
  823. for (i = 1; i < arguments.length - 2; i++) {
  824. if (arguments[i] === undefined) match[i] = undefined;
  825. }
  826. });
  827. }
  828. return match;
  829. };
  830. }
  831. var regexpExec = patchedExec;
  832. var SPECIES$2 = wellKnownSymbol('species');
  833. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  834. // #replace needs built-in support for named groups.
  835. // #match works fine because it just return the exec results, even if it has
  836. // a "grops" property.
  837. var re = /./;
  838. re.exec = function () {
  839. var result = [];
  840. result.groups = { a: '7' };
  841. return result;
  842. };
  843. return ''.replace(re, '$<a>') !== '7';
  844. });
  845. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  846. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  847. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  848. var re = /(?:)/;
  849. var originalExec = re.exec;
  850. re.exec = function () { return originalExec.apply(this, arguments); };
  851. var result = 'ab'.split(re);
  852. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  853. });
  854. var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
  855. var SYMBOL = wellKnownSymbol(KEY);
  856. var DELEGATES_TO_SYMBOL = !fails(function () {
  857. // String methods call symbol-named RegEp methods
  858. var O = {};
  859. O[SYMBOL] = function () { return 7; };
  860. return ''[KEY](O) != 7;
  861. });
  862. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  863. // Symbol-named RegExp methods call .exec
  864. var execCalled = false;
  865. var re = /a/;
  866. re.exec = function () { execCalled = true; return null; };
  867. if (KEY === 'split') {
  868. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  869. // a new one. We need to return the patched regex when creating the new one.
  870. re.constructor = {};
  871. re.constructor[SPECIES$2] = function () { return re; };
  872. }
  873. re[SYMBOL]('');
  874. return !execCalled;
  875. });
  876. if (
  877. !DELEGATES_TO_SYMBOL ||
  878. !DELEGATES_TO_EXEC ||
  879. (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
  880. (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
  881. ) {
  882. var nativeRegExpMethod = /./[SYMBOL];
  883. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  884. if (regexp.exec === regexpExec) {
  885. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  886. // The native String method already delegates to @@method (this
  887. // polyfilled function), leasing to infinite recursion.
  888. // We avoid it by directly calling the native @@method method.
  889. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
  890. }
  891. return { done: true, value: nativeMethod.call(str, regexp, arg2) };
  892. }
  893. return { done: false };
  894. });
  895. var stringMethod = methods[0];
  896. var regexMethod = methods[1];
  897. redefine(String.prototype, KEY, stringMethod);
  898. redefine(RegExp.prototype, SYMBOL, length == 2
  899. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  900. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  901. ? function (string, arg) { return regexMethod.call(string, this, arg); }
  902. // 21.2.5.6 RegExp.prototype[@@match](string)
  903. // 21.2.5.9 RegExp.prototype[@@search](string)
  904. : function (string) { return regexMethod.call(string, this); }
  905. );
  906. if (sham) hide(RegExp.prototype[SYMBOL], 'sham', true);
  907. }
  908. };
  909. // `String.prototype.{ codePointAt, at }` methods implementation
  910. var createMethod$4 = function (CONVERT_TO_STRING) {
  911. return function ($this, pos) {
  912. var S = String(requireObjectCoercible($this));
  913. var position = toInteger(pos);
  914. var size = S.length;
  915. var first, second;
  916. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  917. first = S.charCodeAt(position);
  918. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  919. || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
  920. ? CONVERT_TO_STRING ? S.charAt(position) : first
  921. : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  922. };
  923. };
  924. var stringMultibyte = {
  925. // `String.prototype.codePointAt` method
  926. // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
  927. codeAt: createMethod$4(false),
  928. // `String.prototype.at` method
  929. // https://github.com/mathiasbynens/String.prototype.at
  930. charAt: createMethod$4(true)
  931. };
  932. var charAt = stringMultibyte.charAt;
  933. // `AdvanceStringIndex` abstract operation
  934. // https://tc39.github.io/ecma262/#sec-advancestringindex
  935. var advanceStringIndex = function (S, index, unicode) {
  936. return index + (unicode ? charAt(S, index).length : 1);
  937. };
  938. // `RegExpExec` abstract operation
  939. // https://tc39.github.io/ecma262/#sec-regexpexec
  940. var regexpExecAbstract = function (R, S) {
  941. var exec = R.exec;
  942. if (typeof exec === 'function') {
  943. var result = exec.call(R, S);
  944. if (typeof result !== 'object') {
  945. throw TypeError('RegExp exec method returned something other than an Object or null');
  946. }
  947. return result;
  948. }
  949. if (classofRaw(R) !== 'RegExp') {
  950. throw TypeError('RegExp#exec called on incompatible receiver');
  951. }
  952. return regexpExec.call(R, S);
  953. };
  954. var max$1 = Math.max;
  955. var min$2 = Math.min;
  956. var floor$1 = Math.floor;
  957. var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
  958. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
  959. var maybeToString = function (it) {
  960. return it === undefined ? it : String(it);
  961. };
  962. // @@replace logic
  963. fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative) {
  964. return [
  965. // `String.prototype.replace` method
  966. // https://tc39.github.io/ecma262/#sec-string.prototype.replace
  967. function replace(searchValue, replaceValue) {
  968. var O = requireObjectCoercible(this);
  969. var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
  970. return replacer !== undefined
  971. ? replacer.call(searchValue, O, replaceValue)
  972. : nativeReplace.call(String(O), searchValue, replaceValue);
  973. },
  974. // `RegExp.prototype[@@replace]` method
  975. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
  976. function (regexp, replaceValue) {
  977. var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
  978. if (res.done) return res.value;
  979. var rx = anObject(regexp);
  980. var S = String(this);
  981. var functionalReplace = typeof replaceValue === 'function';
  982. if (!functionalReplace) replaceValue = String(replaceValue);
  983. var global = rx.global;
  984. if (global) {
  985. var fullUnicode = rx.unicode;
  986. rx.lastIndex = 0;
  987. }
  988. var results = [];
  989. while (true) {
  990. var result = regexpExecAbstract(rx, S);
  991. if (result === null) break;
  992. results.push(result);
  993. if (!global) break;
  994. var matchStr = String(result[0]);
  995. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  996. }
  997. var accumulatedResult = '';
  998. var nextSourcePosition = 0;
  999. for (var i = 0; i < results.length; i++) {
  1000. result = results[i];
  1001. var matched = String(result[0]);
  1002. var position = max$1(min$2(toInteger(result.index), S.length), 0);
  1003. var captures = [];
  1004. // NOTE: This is equivalent to
  1005. // captures = result.slice(1).map(maybeToString)
  1006. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  1007. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  1008. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  1009. for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
  1010. var namedCaptures = result.groups;
  1011. if (functionalReplace) {
  1012. var replacerArgs = [matched].concat(captures, position, S);
  1013. if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
  1014. var replacement = String(replaceValue.apply(undefined, replacerArgs));
  1015. } else {
  1016. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  1017. }
  1018. if (position >= nextSourcePosition) {
  1019. accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
  1020. nextSourcePosition = position + matched.length;
  1021. }
  1022. }
  1023. return accumulatedResult + S.slice(nextSourcePosition);
  1024. }
  1025. ];
  1026. // https://tc39.github.io/ecma262/#sec-getsubstitution
  1027. function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
  1028. var tailPos = position + matched.length;
  1029. var m = captures.length;
  1030. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  1031. if (namedCaptures !== undefined) {
  1032. namedCaptures = toObject(namedCaptures);
  1033. symbols = SUBSTITUTION_SYMBOLS;
  1034. }
  1035. return nativeReplace.call(replacement, symbols, function (match, ch) {
  1036. var capture;
  1037. switch (ch.charAt(0)) {
  1038. case '$': return '$';
  1039. case '&': return matched;
  1040. case '`': return str.slice(0, position);
  1041. case "'": return str.slice(tailPos);
  1042. case '<':
  1043. capture = namedCaptures[ch.slice(1, -1)];
  1044. break;
  1045. default: // \d\d?
  1046. var n = +ch;
  1047. if (n === 0) return match;
  1048. if (n > m) {
  1049. var f = floor$1(n / 10);
  1050. if (f === 0) return match;
  1051. if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
  1052. return match;
  1053. }
  1054. capture = captures[n - 1];
  1055. }
  1056. return capture === undefined ? '' : capture;
  1057. });
  1058. }
  1059. });
  1060. function _classCallCheck(instance, Constructor) {
  1061. if (!(instance instanceof Constructor)) {
  1062. throw new TypeError("Cannot call a class as a function");
  1063. }
  1064. }
  1065. function _defineProperties(target, props) {
  1066. for (var i = 0; i < props.length; i++) {
  1067. var descriptor = props[i];
  1068. descriptor.enumerable = descriptor.enumerable || false;
  1069. descriptor.configurable = true;
  1070. if ("value" in descriptor) descriptor.writable = true;
  1071. Object.defineProperty(target, descriptor.key, descriptor);
  1072. }
  1073. }
  1074. function _createClass(Constructor, protoProps, staticProps) {
  1075. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  1076. if (staticProps) _defineProperties(Constructor, staticProps);
  1077. return Constructor;
  1078. }
  1079. function _inherits(subClass, superClass) {
  1080. if (typeof superClass !== "function" && superClass !== null) {
  1081. throw new TypeError("Super expression must either be null or a function");
  1082. }
  1083. subClass.prototype = Object.create(superClass && superClass.prototype, {
  1084. constructor: {
  1085. value: subClass,
  1086. writable: true,
  1087. configurable: true
  1088. }
  1089. });
  1090. if (superClass) _setPrototypeOf(subClass, superClass);
  1091. }
  1092. function _getPrototypeOf(o) {
  1093. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  1094. return o.__proto__ || Object.getPrototypeOf(o);
  1095. };
  1096. return _getPrototypeOf(o);
  1097. }
  1098. function _setPrototypeOf(o, p) {
  1099. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  1100. o.__proto__ = p;
  1101. return o;
  1102. };
  1103. return _setPrototypeOf(o, p);
  1104. }
  1105. function _assertThisInitialized(self) {
  1106. if (self === void 0) {
  1107. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  1108. }
  1109. return self;
  1110. }
  1111. function _possibleConstructorReturn(self, call) {
  1112. if (call && (typeof call === "object" || typeof call === "function")) {
  1113. return call;
  1114. }
  1115. return _assertThisInitialized(self);
  1116. }
  1117. function _superPropBase(object, property) {
  1118. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  1119. object = _getPrototypeOf(object);
  1120. if (object === null) break;
  1121. }
  1122. return object;
  1123. }
  1124. function _get(target, property, receiver) {
  1125. if (typeof Reflect !== "undefined" && Reflect.get) {
  1126. _get = Reflect.get;
  1127. } else {
  1128. _get = function _get(target, property, receiver) {
  1129. var base = _superPropBase(target, property);
  1130. if (!base) return;
  1131. var desc = Object.getOwnPropertyDescriptor(base, property);
  1132. if (desc.get) {
  1133. return desc.get.call(receiver);
  1134. }
  1135. return desc.value;
  1136. };
  1137. }
  1138. return _get(target, property, receiver || target);
  1139. }
  1140. function _slicedToArray(arr, i) {
  1141. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
  1142. }
  1143. function _arrayWithHoles(arr) {
  1144. if (Array.isArray(arr)) return arr;
  1145. }
  1146. function _iterableToArrayLimit(arr, i) {
  1147. var _arr = [];
  1148. var _n = true;
  1149. var _d = false;
  1150. var _e = undefined;
  1151. try {
  1152. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  1153. _arr.push(_s.value);
  1154. if (i && _arr.length === i) break;
  1155. }
  1156. } catch (err) {
  1157. _d = true;
  1158. _e = err;
  1159. } finally {
  1160. try {
  1161. if (!_n && _i["return"] != null) _i["return"]();
  1162. } finally {
  1163. if (_d) throw _e;
  1164. }
  1165. }
  1166. return _arr;
  1167. }
  1168. function _nonIterableRest() {
  1169. throw new TypeError("Invalid attempt to destructure non-iterable instance");
  1170. }
  1171. /**
  1172. * @author: Dennis Hernández
  1173. * @webSite: http://djhvscf.github.io/Blog
  1174. * @update: zhixin wen <wenzhixin2010@gmail.com>
  1175. */
  1176. var diacriticsMap = {};
  1177. var defaultAccentsDiacritics = [{
  1178. base: 'A',
  1179. letters: "A\u24B6\uFF21\xC0\xC1\xC2\u1EA6\u1EA4\u1EAA\u1EA8\xC3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\xC4\u01DE\u1EA2\xC5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F"
  1180. }, {
  1181. base: 'AA',
  1182. letters: "\uA732"
  1183. }, {
  1184. base: 'AE',
  1185. letters: "\xC6\u01FC\u01E2"
  1186. }, {
  1187. base: 'AO',
  1188. letters: "\uA734"
  1189. }, {
  1190. base: 'AU',
  1191. letters: "\uA736"
  1192. }, {
  1193. base: 'AV',
  1194. letters: "\uA738\uA73A"
  1195. }, {
  1196. base: 'AY',
  1197. letters: "\uA73C"
  1198. }, {
  1199. base: 'B',
  1200. letters: "B\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181"
  1201. }, {
  1202. base: 'C',
  1203. letters: "C\u24B8\uFF23\u0106\u0108\u010A\u010C\xC7\u1E08\u0187\u023B\uA73E"
  1204. }, {
  1205. base: 'D',
  1206. letters: "D\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779"
  1207. }, {
  1208. base: 'DZ',
  1209. letters: "\u01F1\u01C4"
  1210. }, {
  1211. base: 'Dz',
  1212. letters: "\u01F2\u01C5"
  1213. }, {
  1214. base: 'E',
  1215. letters: "E\u24BA\uFF25\xC8\xC9\xCA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\xCB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E"
  1216. }, {
  1217. base: 'F',
  1218. letters: "F\u24BB\uFF26\u1E1E\u0191\uA77B"
  1219. }, {
  1220. base: 'G',
  1221. letters: "G\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E"
  1222. }, {
  1223. base: 'H',
  1224. letters: "H\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D"
  1225. }, {
  1226. base: 'I',
  1227. letters: "I\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197"
  1228. }, {
  1229. base: 'J',
  1230. letters: "J\u24BF\uFF2A\u0134\u0248"
  1231. }, {
  1232. base: 'K',
  1233. letters: "K\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2"
  1234. }, {
  1235. base: 'L',
  1236. letters: "L\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780"
  1237. }, {
  1238. base: 'LJ',
  1239. letters: "\u01C7"
  1240. }, {
  1241. base: 'Lj',
  1242. letters: "\u01C8"
  1243. }, {
  1244. base: 'M',
  1245. letters: "M\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C"
  1246. }, {
  1247. base: 'N',
  1248. letters: "N\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4"
  1249. }, {
  1250. base: 'NJ',
  1251. letters: "\u01CA"
  1252. }, {
  1253. base: 'Nj',
  1254. letters: "\u01CB"
  1255. }, {
  1256. base: 'O',
  1257. letters: "O\u24C4\uFF2F\xD2\xD3\xD4\u1ED2\u1ED0\u1ED6\u1ED4\xD5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\xD6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\xD8\u01FE\u0186\u019F\uA74A\uA74C"
  1258. }, {
  1259. base: 'OI',
  1260. letters: "\u01A2"
  1261. }, {
  1262. base: 'OO',
  1263. letters: "\uA74E"
  1264. }, {
  1265. base: 'OU',
  1266. letters: "\u0222"
  1267. }, {
  1268. base: 'OE',
  1269. letters: "\x8C\u0152"
  1270. }, {
  1271. base: 'oe',
  1272. letters: "\x9C\u0153"
  1273. }, {
  1274. base: 'P',
  1275. letters: "P\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754"
  1276. }, {
  1277. base: 'Q',
  1278. letters: "Q\u24C6\uFF31\uA756\uA758\u024A"
  1279. }, {
  1280. base: 'R',
  1281. letters: "R\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782"
  1282. }, {
  1283. base: 'S',
  1284. letters: "S\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784"
  1285. }, {
  1286. base: 'T',
  1287. letters: "T\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786"
  1288. }, {
  1289. base: 'TZ',
  1290. letters: "\uA728"
  1291. }, {
  1292. base: 'U',
  1293. letters: "U\u24CA\uFF35\xD9\xDA\xDB\u0168\u1E78\u016A\u1E7A\u016C\xDC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244"
  1294. }, {
  1295. base: 'V',
  1296. letters: "V\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245"
  1297. }, {
  1298. base: 'VY',
  1299. letters: "\uA760"
  1300. }, {
  1301. base: 'W',
  1302. letters: "W\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72"
  1303. }, {
  1304. base: 'X',
  1305. letters: "X\u24CD\uFF38\u1E8A\u1E8C"
  1306. }, {
  1307. base: 'Y',
  1308. letters: "Y\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE"
  1309. }, {
  1310. base: 'Z',
  1311. letters: "Z\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762"
  1312. }, {
  1313. base: 'a',
  1314. letters: "a\u24D0\uFF41\u1E9A\xE0\xE1\xE2\u1EA7\u1EA5\u1EAB\u1EA9\xE3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\xE4\u01DF\u1EA3\xE5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250"
  1315. }, {
  1316. base: 'aa',
  1317. letters: "\uA733"
  1318. }, {
  1319. base: 'ae',
  1320. letters: "\xE6\u01FD\u01E3"
  1321. }, {
  1322. base: 'ao',
  1323. letters: "\uA735"
  1324. }, {
  1325. base: 'au',
  1326. letters: "\uA737"
  1327. }, {
  1328. base: 'av',
  1329. letters: "\uA739\uA73B"
  1330. }, {
  1331. base: 'ay',
  1332. letters: "\uA73D"
  1333. }, {
  1334. base: 'b',
  1335. letters: "b\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253"
  1336. }, {
  1337. base: 'c',
  1338. letters: "c\u24D2\uFF43\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184"
  1339. }, {
  1340. base: 'd',
  1341. letters: "d\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A"
  1342. }, {
  1343. base: 'dz',
  1344. letters: "\u01F3\u01C6"
  1345. }, {
  1346. base: 'e',
  1347. letters: "e\u24D4\uFF45\xE8\xE9\xEA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\xEB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD"
  1348. }, {
  1349. base: 'f',
  1350. letters: "f\u24D5\uFF46\u1E1F\u0192\uA77C"
  1351. }, {
  1352. base: 'g',
  1353. letters: "g\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F"
  1354. }, {
  1355. base: 'h',
  1356. letters: "h\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265"
  1357. }, {
  1358. base: 'hv',
  1359. letters: "\u0195"
  1360. }, {
  1361. base: 'i',
  1362. letters: "i\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131"
  1363. }, {
  1364. base: 'j',
  1365. letters: "j\u24D9\uFF4A\u0135\u01F0\u0249"
  1366. }, {
  1367. base: 'k',
  1368. letters: "k\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3"
  1369. }, {
  1370. base: 'l',
  1371. letters: "l\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747"
  1372. }, {
  1373. base: 'lj',
  1374. letters: "\u01C9"
  1375. }, {
  1376. base: 'm',
  1377. letters: "m\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F"
  1378. }, {
  1379. base: 'n',
  1380. letters: "n\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5"
  1381. }, {
  1382. base: 'nj',
  1383. letters: "\u01CC"
  1384. }, {
  1385. base: 'o',
  1386. letters: "o\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\u0254\uA74B\uA74D\u0275"
  1387. }, {
  1388. base: 'oi',
  1389. letters: "\u01A3"
  1390. }, {
  1391. base: 'ou',
  1392. letters: "\u0223"
  1393. }, {
  1394. base: 'oo',
  1395. letters: "\uA74F"
  1396. }, {
  1397. base: 'p',
  1398. letters: "p\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755"
  1399. }, {
  1400. base: 'q',
  1401. letters: "q\u24E0\uFF51\u024B\uA757\uA759"
  1402. }, {
  1403. base: 'r',
  1404. letters: "r\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783"
  1405. }, {
  1406. base: 's',
  1407. letters: "s\u24E2\uFF53\xDF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B"
  1408. }, {
  1409. base: 't',
  1410. letters: "t\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787"
  1411. }, {
  1412. base: 'tz',
  1413. letters: "\uA729"
  1414. }, {
  1415. base: 'u',
  1416. letters: "u\u24E4\uFF55\xF9\xFA\xFB\u0169\u1E79\u016B\u1E7B\u016D\xFC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289"
  1417. }, {
  1418. base: 'v',
  1419. letters: "v\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C"
  1420. }, {
  1421. base: 'vy',
  1422. letters: "\uA761"
  1423. }, {
  1424. base: 'w',
  1425. letters: "w\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73"
  1426. }, {
  1427. base: 'x',
  1428. letters: "x\u24E7\uFF58\u1E8B\u1E8D"
  1429. }, {
  1430. base: 'y',
  1431. letters: "y\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF"
  1432. }, {
  1433. base: 'z',
  1434. letters: "z\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763"
  1435. }];
  1436. var initNeutraliser = function initNeutraliser() {
  1437. for (var _i = 0, _defaultAccentsDiacri = defaultAccentsDiacritics; _i < _defaultAccentsDiacri.length; _i++) {
  1438. var diacritic = _defaultAccentsDiacri[_i];
  1439. var letters = diacritic.letters;
  1440. for (var i = 0; i < letters.length; i++) {
  1441. diacriticsMap[letters[i]] = diacritic.base;
  1442. }
  1443. }
  1444. };
  1445. /* eslint-disable no-control-regex */
  1446. var removeDiacritics = function removeDiacritics(str) {
  1447. return str.replace(/[^\u0000-\u007E]/g, function (a) {
  1448. return diacriticsMap[a] || a;
  1449. });
  1450. };
  1451. $.extend($.fn.bootstrapTable.defaults, {
  1452. searchAccentNeutralise: false
  1453. });
  1454. $.BootstrapTable =
  1455. /*#__PURE__*/
  1456. function (_$$BootstrapTable) {
  1457. _inherits(_class, _$$BootstrapTable);
  1458. function _class() {
  1459. _classCallCheck(this, _class);
  1460. return _possibleConstructorReturn(this, _getPrototypeOf(_class).apply(this, arguments));
  1461. }
  1462. _createClass(_class, [{
  1463. key: "init",
  1464. value: function init() {
  1465. if (this.options.searchAccentNeutralise) {
  1466. initNeutraliser();
  1467. }
  1468. _get(_getPrototypeOf(_class.prototype), "init", this).call(this);
  1469. }
  1470. }, {
  1471. key: "initSearch",
  1472. value: function initSearch() {
  1473. var _this = this;
  1474. if (this.options.sidePagination !== 'server') {
  1475. var s = this.searchText && this.searchText.toLowerCase();
  1476. var f = $.isEmptyObject(this.filterColumns) ? null : this.filterColumns; // Check filter
  1477. this.data = f ? this.options.data.filter(function (item, i) {
  1478. for (var key in f) {
  1479. if (item[key] !== f[key]) {
  1480. return false;
  1481. }
  1482. }
  1483. return true;
  1484. }) : this.options.data;
  1485. this.data = s ? this.options.data.filter(function (item, i) {
  1486. for (var _i2 = 0, _Object$entries = Object.entries(item); _i2 < _Object$entries.length; _i2++) {
  1487. var _Object$entries$_i = _slicedToArray(_Object$entries[_i2], 2),
  1488. key = _Object$entries$_i[0],
  1489. value = _Object$entries$_i[1];
  1490. key = $.isNumeric(key) ? parseInt(key, 10) : key;
  1491. var column = _this.columns[_this.fieldsColumnsIndex[key]];
  1492. var j = _this.header.fields.indexOf(key);
  1493. if (column && column.searchFormatter) {
  1494. value = $.fn.bootstrapTable.utils.calculateObjectValue(column, _this.header.formatters[j], [value, item, i], value);
  1495. }
  1496. var index = _this.header.fields.indexOf(key);
  1497. if (index !== -1 && _this.header.searchables[index] && typeof value === 'string') {
  1498. if (_this.options.searchAccentNeutralise) {
  1499. value = removeDiacritics(value);
  1500. s = removeDiacritics(s);
  1501. }
  1502. if (_this.options.strictSearch) {
  1503. if ("".concat(value).toLowerCase() === s) {
  1504. return true;
  1505. }
  1506. } else {
  1507. if ("".concat(value).toLowerCase().includes(s)) {
  1508. return true;
  1509. }
  1510. }
  1511. }
  1512. }
  1513. return false;
  1514. }) : this.data;
  1515. }
  1516. }
  1517. }]);
  1518. return _class;
  1519. }($.BootstrapTable);
  1520. }));