bootstrap-table-key-events.js 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) :
  3. typeof define === 'function' && define.amd ? define(['jquery'], factory) :
  4. (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jQuery));
  5. }(this, (function ($) { 'use strict';
  6. function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
  7. var $__default = /*#__PURE__*/_interopDefaultLegacy($);
  8. function _classCallCheck(instance, Constructor) {
  9. if (!(instance instanceof Constructor)) {
  10. throw new TypeError("Cannot call a class as a function");
  11. }
  12. }
  13. function _defineProperties(target, props) {
  14. for (var i = 0; i < props.length; i++) {
  15. var descriptor = props[i];
  16. descriptor.enumerable = descriptor.enumerable || false;
  17. descriptor.configurable = true;
  18. if ("value" in descriptor) descriptor.writable = true;
  19. Object.defineProperty(target, descriptor.key, descriptor);
  20. }
  21. }
  22. function _createClass(Constructor, protoProps, staticProps) {
  23. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  24. if (staticProps) _defineProperties(Constructor, staticProps);
  25. return Constructor;
  26. }
  27. function _inherits(subClass, superClass) {
  28. if (typeof superClass !== "function" && superClass !== null) {
  29. throw new TypeError("Super expression must either be null or a function");
  30. }
  31. subClass.prototype = Object.create(superClass && superClass.prototype, {
  32. constructor: {
  33. value: subClass,
  34. writable: true,
  35. configurable: true
  36. }
  37. });
  38. if (superClass) _setPrototypeOf(subClass, superClass);
  39. }
  40. function _getPrototypeOf(o) {
  41. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  42. return o.__proto__ || Object.getPrototypeOf(o);
  43. };
  44. return _getPrototypeOf(o);
  45. }
  46. function _setPrototypeOf(o, p) {
  47. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  48. o.__proto__ = p;
  49. return o;
  50. };
  51. return _setPrototypeOf(o, p);
  52. }
  53. function _isNativeReflectConstruct() {
  54. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  55. if (Reflect.construct.sham) return false;
  56. if (typeof Proxy === "function") return true;
  57. try {
  58. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  59. return true;
  60. } catch (e) {
  61. return false;
  62. }
  63. }
  64. function _assertThisInitialized(self) {
  65. if (self === void 0) {
  66. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  67. }
  68. return self;
  69. }
  70. function _possibleConstructorReturn(self, call) {
  71. if (call && (typeof call === "object" || typeof call === "function")) {
  72. return call;
  73. }
  74. return _assertThisInitialized(self);
  75. }
  76. function _createSuper(Derived) {
  77. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  78. return function _createSuperInternal() {
  79. var Super = _getPrototypeOf(Derived),
  80. result;
  81. if (hasNativeReflectConstruct) {
  82. var NewTarget = _getPrototypeOf(this).constructor;
  83. result = Reflect.construct(Super, arguments, NewTarget);
  84. } else {
  85. result = Super.apply(this, arguments);
  86. }
  87. return _possibleConstructorReturn(this, result);
  88. };
  89. }
  90. function _superPropBase(object, property) {
  91. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  92. object = _getPrototypeOf(object);
  93. if (object === null) break;
  94. }
  95. return object;
  96. }
  97. function _get(target, property, receiver) {
  98. if (typeof Reflect !== "undefined" && Reflect.get) {
  99. _get = Reflect.get;
  100. } else {
  101. _get = function _get(target, property, receiver) {
  102. var base = _superPropBase(target, property);
  103. if (!base) return;
  104. var desc = Object.getOwnPropertyDescriptor(base, property);
  105. if (desc.get) {
  106. return desc.get.call(receiver);
  107. }
  108. return desc.value;
  109. };
  110. }
  111. return _get(target, property, receiver || target);
  112. }
  113. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  114. function createCommonjsModule(fn, module) {
  115. return module = { exports: {} }, fn(module, module.exports), module.exports;
  116. }
  117. var check = function (it) {
  118. return it && it.Math == Math && it;
  119. };
  120. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  121. var global_1 =
  122. // eslint-disable-next-line es/no-global-this -- safe
  123. check(typeof globalThis == 'object' && globalThis) ||
  124. check(typeof window == 'object' && window) ||
  125. // eslint-disable-next-line no-restricted-globals -- safe
  126. check(typeof self == 'object' && self) ||
  127. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  128. // eslint-disable-next-line no-new-func -- fallback
  129. (function () { return this; })() || Function('return this')();
  130. var fails = function (exec) {
  131. try {
  132. return !!exec();
  133. } catch (error) {
  134. return true;
  135. }
  136. };
  137. // Detect IE8's incomplete defineProperty implementation
  138. var descriptors = !fails(function () {
  139. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  140. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  141. });
  142. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  143. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  144. var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  145. // Nashorn ~ JDK8 bug
  146. var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  147. // `Object.prototype.propertyIsEnumerable` method implementation
  148. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  149. var f$4 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  150. var descriptor = getOwnPropertyDescriptor$1(this, V);
  151. return !!descriptor && descriptor.enumerable;
  152. } : $propertyIsEnumerable;
  153. var objectPropertyIsEnumerable = {
  154. f: f$4
  155. };
  156. var createPropertyDescriptor = function (bitmap, value) {
  157. return {
  158. enumerable: !(bitmap & 1),
  159. configurable: !(bitmap & 2),
  160. writable: !(bitmap & 4),
  161. value: value
  162. };
  163. };
  164. var toString = {}.toString;
  165. var classofRaw = function (it) {
  166. return toString.call(it).slice(8, -1);
  167. };
  168. var split = ''.split;
  169. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  170. var indexedObject = fails(function () {
  171. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  172. // eslint-disable-next-line no-prototype-builtins -- safe
  173. return !Object('z').propertyIsEnumerable(0);
  174. }) ? function (it) {
  175. return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
  176. } : Object;
  177. // `RequireObjectCoercible` abstract operation
  178. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  179. var requireObjectCoercible = function (it) {
  180. if (it == undefined) throw TypeError("Can't call method on " + it);
  181. return it;
  182. };
  183. // toObject with fallback for non-array-like ES3 strings
  184. var toIndexedObject = function (it) {
  185. return indexedObject(requireObjectCoercible(it));
  186. };
  187. var isObject = function (it) {
  188. return typeof it === 'object' ? it !== null : typeof it === 'function';
  189. };
  190. // `ToPrimitive` abstract operation
  191. // https://tc39.es/ecma262/#sec-toprimitive
  192. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  193. // and the second argument - flag - preferred type is a string
  194. var toPrimitive = function (input, PREFERRED_STRING) {
  195. if (!isObject(input)) return input;
  196. var fn, val;
  197. if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  198. if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
  199. if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  200. throw TypeError("Can't convert object to primitive value");
  201. };
  202. var hasOwnProperty = {}.hasOwnProperty;
  203. var has$1 = function (it, key) {
  204. return hasOwnProperty.call(it, key);
  205. };
  206. var document$1 = global_1.document;
  207. // typeof document.createElement is 'object' in old IE
  208. var EXISTS = isObject(document$1) && isObject(document$1.createElement);
  209. var documentCreateElement = function (it) {
  210. return EXISTS ? document$1.createElement(it) : {};
  211. };
  212. // Thank's IE8 for his funny defineProperty
  213. var ie8DomDefine = !descriptors && !fails(function () {
  214. // eslint-disable-next-line es/no-object-defineproperty -- requied for testing
  215. return Object.defineProperty(documentCreateElement('div'), 'a', {
  216. get: function () { return 7; }
  217. }).a != 7;
  218. });
  219. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  220. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  221. // `Object.getOwnPropertyDescriptor` method
  222. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  223. var f$3 = descriptors ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  224. O = toIndexedObject(O);
  225. P = toPrimitive(P, true);
  226. if (ie8DomDefine) try {
  227. return $getOwnPropertyDescriptor(O, P);
  228. } catch (error) { /* empty */ }
  229. if (has$1(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
  230. };
  231. var objectGetOwnPropertyDescriptor = {
  232. f: f$3
  233. };
  234. var anObject = function (it) {
  235. if (!isObject(it)) {
  236. throw TypeError(String(it) + ' is not an object');
  237. } return it;
  238. };
  239. // eslint-disable-next-line es/no-object-defineproperty -- safe
  240. var $defineProperty = Object.defineProperty;
  241. // `Object.defineProperty` method
  242. // https://tc39.es/ecma262/#sec-object.defineproperty
  243. var f$2 = descriptors ? $defineProperty : function defineProperty(O, P, Attributes) {
  244. anObject(O);
  245. P = toPrimitive(P, true);
  246. anObject(Attributes);
  247. if (ie8DomDefine) try {
  248. return $defineProperty(O, P, Attributes);
  249. } catch (error) { /* empty */ }
  250. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  251. if ('value' in Attributes) O[P] = Attributes.value;
  252. return O;
  253. };
  254. var objectDefineProperty = {
  255. f: f$2
  256. };
  257. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  258. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  259. } : function (object, key, value) {
  260. object[key] = value;
  261. return object;
  262. };
  263. var setGlobal = function (key, value) {
  264. try {
  265. createNonEnumerableProperty(global_1, key, value);
  266. } catch (error) {
  267. global_1[key] = value;
  268. } return value;
  269. };
  270. var SHARED = '__core-js_shared__';
  271. var store$1 = global_1[SHARED] || setGlobal(SHARED, {});
  272. var sharedStore = store$1;
  273. var functionToString = Function.toString;
  274. // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
  275. if (typeof sharedStore.inspectSource != 'function') {
  276. sharedStore.inspectSource = function (it) {
  277. return functionToString.call(it);
  278. };
  279. }
  280. var inspectSource = sharedStore.inspectSource;
  281. var WeakMap$1 = global_1.WeakMap;
  282. var nativeWeakMap = typeof WeakMap$1 === 'function' && /native code/.test(inspectSource(WeakMap$1));
  283. var shared = createCommonjsModule(function (module) {
  284. (module.exports = function (key, value) {
  285. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  286. })('versions', []).push({
  287. version: '3.10.1',
  288. mode: 'global',
  289. copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
  290. });
  291. });
  292. var id = 0;
  293. var postfix = Math.random();
  294. var uid = function (key) {
  295. return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
  296. };
  297. var keys = shared('keys');
  298. var sharedKey = function (key) {
  299. return keys[key] || (keys[key] = uid(key));
  300. };
  301. var hiddenKeys$1 = {};
  302. var WeakMap = global_1.WeakMap;
  303. var set, get, has;
  304. var enforce = function (it) {
  305. return has(it) ? get(it) : set(it, {});
  306. };
  307. var getterFor = function (TYPE) {
  308. return function (it) {
  309. var state;
  310. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  311. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  312. } return state;
  313. };
  314. };
  315. if (nativeWeakMap) {
  316. var store = sharedStore.state || (sharedStore.state = new WeakMap());
  317. var wmget = store.get;
  318. var wmhas = store.has;
  319. var wmset = store.set;
  320. set = function (it, metadata) {
  321. metadata.facade = it;
  322. wmset.call(store, it, metadata);
  323. return metadata;
  324. };
  325. get = function (it) {
  326. return wmget.call(store, it) || {};
  327. };
  328. has = function (it) {
  329. return wmhas.call(store, it);
  330. };
  331. } else {
  332. var STATE = sharedKey('state');
  333. hiddenKeys$1[STATE] = true;
  334. set = function (it, metadata) {
  335. metadata.facade = it;
  336. createNonEnumerableProperty(it, STATE, metadata);
  337. return metadata;
  338. };
  339. get = function (it) {
  340. return has$1(it, STATE) ? it[STATE] : {};
  341. };
  342. has = function (it) {
  343. return has$1(it, STATE);
  344. };
  345. }
  346. var internalState = {
  347. set: set,
  348. get: get,
  349. has: has,
  350. enforce: enforce,
  351. getterFor: getterFor
  352. };
  353. var redefine = createCommonjsModule(function (module) {
  354. var getInternalState = internalState.get;
  355. var enforceInternalState = internalState.enforce;
  356. var TEMPLATE = String(String).split('String');
  357. (module.exports = function (O, key, value, options) {
  358. var unsafe = options ? !!options.unsafe : false;
  359. var simple = options ? !!options.enumerable : false;
  360. var noTargetGet = options ? !!options.noTargetGet : false;
  361. var state;
  362. if (typeof value == 'function') {
  363. if (typeof key == 'string' && !has$1(value, 'name')) {
  364. createNonEnumerableProperty(value, 'name', key);
  365. }
  366. state = enforceInternalState(value);
  367. if (!state.source) {
  368. state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
  369. }
  370. }
  371. if (O === global_1) {
  372. if (simple) O[key] = value;
  373. else setGlobal(key, value);
  374. return;
  375. } else if (!unsafe) {
  376. delete O[key];
  377. } else if (!noTargetGet && O[key]) {
  378. simple = true;
  379. }
  380. if (simple) O[key] = value;
  381. else createNonEnumerableProperty(O, key, value);
  382. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  383. })(Function.prototype, 'toString', function toString() {
  384. return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
  385. });
  386. });
  387. var path = global_1;
  388. var aFunction$1 = function (variable) {
  389. return typeof variable == 'function' ? variable : undefined;
  390. };
  391. var getBuiltIn = function (namespace, method) {
  392. return arguments.length < 2 ? aFunction$1(path[namespace]) || aFunction$1(global_1[namespace])
  393. : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
  394. };
  395. var ceil = Math.ceil;
  396. var floor = Math.floor;
  397. // `ToInteger` abstract operation
  398. // https://tc39.es/ecma262/#sec-tointeger
  399. var toInteger = function (argument) {
  400. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
  401. };
  402. var min$1 = Math.min;
  403. // `ToLength` abstract operation
  404. // https://tc39.es/ecma262/#sec-tolength
  405. var toLength = function (argument) {
  406. return argument > 0 ? min$1(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  407. };
  408. var max = Math.max;
  409. var min = Math.min;
  410. // Helper for a popular repeating case of the spec:
  411. // Let integer be ? ToInteger(index).
  412. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  413. var toAbsoluteIndex = function (index, length) {
  414. var integer = toInteger(index);
  415. return integer < 0 ? max(integer + length, 0) : min(integer, length);
  416. };
  417. // `Array.prototype.{ indexOf, includes }` methods implementation
  418. var createMethod$1 = function (IS_INCLUDES) {
  419. return function ($this, el, fromIndex) {
  420. var O = toIndexedObject($this);
  421. var length = toLength(O.length);
  422. var index = toAbsoluteIndex(fromIndex, length);
  423. var value;
  424. // Array#includes uses SameValueZero equality algorithm
  425. // eslint-disable-next-line no-self-compare -- NaN check
  426. if (IS_INCLUDES && el != el) while (length > index) {
  427. value = O[index++];
  428. // eslint-disable-next-line no-self-compare -- NaN check
  429. if (value != value) return true;
  430. // Array#indexOf ignores holes, Array#includes - not
  431. } else for (;length > index; index++) {
  432. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  433. } return !IS_INCLUDES && -1;
  434. };
  435. };
  436. var arrayIncludes = {
  437. // `Array.prototype.includes` method
  438. // https://tc39.es/ecma262/#sec-array.prototype.includes
  439. includes: createMethod$1(true),
  440. // `Array.prototype.indexOf` method
  441. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  442. indexOf: createMethod$1(false)
  443. };
  444. var indexOf = arrayIncludes.indexOf;
  445. var objectKeysInternal = function (object, names) {
  446. var O = toIndexedObject(object);
  447. var i = 0;
  448. var result = [];
  449. var key;
  450. for (key in O) !has$1(hiddenKeys$1, key) && has$1(O, key) && result.push(key);
  451. // Don't enum bug & hidden keys
  452. while (names.length > i) if (has$1(O, key = names[i++])) {
  453. ~indexOf(result, key) || result.push(key);
  454. }
  455. return result;
  456. };
  457. // IE8- don't enum bug keys
  458. var enumBugKeys = [
  459. 'constructor',
  460. 'hasOwnProperty',
  461. 'isPrototypeOf',
  462. 'propertyIsEnumerable',
  463. 'toLocaleString',
  464. 'toString',
  465. 'valueOf'
  466. ];
  467. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  468. // `Object.getOwnPropertyNames` method
  469. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  470. // eslint-disable-next-line es/no-object-getownpropertynames -- safe
  471. var f$1 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  472. return objectKeysInternal(O, hiddenKeys);
  473. };
  474. var objectGetOwnPropertyNames = {
  475. f: f$1
  476. };
  477. // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
  478. var f = Object.getOwnPropertySymbols;
  479. var objectGetOwnPropertySymbols = {
  480. f: f
  481. };
  482. // all object keys, includes non-enumerable and symbols
  483. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  484. var keys = objectGetOwnPropertyNames.f(anObject(it));
  485. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  486. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  487. };
  488. var copyConstructorProperties = function (target, source) {
  489. var keys = ownKeys(source);
  490. var defineProperty = objectDefineProperty.f;
  491. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  492. for (var i = 0; i < keys.length; i++) {
  493. var key = keys[i];
  494. if (!has$1(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  495. }
  496. };
  497. var replacement = /#|\.prototype\./;
  498. var isForced = function (feature, detection) {
  499. var value = data[normalize(feature)];
  500. return value == POLYFILL ? true
  501. : value == NATIVE ? false
  502. : typeof detection == 'function' ? fails(detection)
  503. : !!detection;
  504. };
  505. var normalize = isForced.normalize = function (string) {
  506. return String(string).replace(replacement, '.').toLowerCase();
  507. };
  508. var data = isForced.data = {};
  509. var NATIVE = isForced.NATIVE = 'N';
  510. var POLYFILL = isForced.POLYFILL = 'P';
  511. var isForced_1 = isForced;
  512. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  513. /*
  514. options.target - name of the target object
  515. options.global - target is the global object
  516. options.stat - export as static methods of target
  517. options.proto - export as prototype methods of target
  518. options.real - real prototype method for the `pure` version
  519. options.forced - export even if the native feature is available
  520. options.bind - bind methods to the target, required for the `pure` version
  521. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  522. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  523. options.sham - add a flag to not completely full polyfills
  524. options.enumerable - export as enumerable property
  525. options.noTargetGet - prevent calling a getter on target
  526. */
  527. var _export = function (options, source) {
  528. var TARGET = options.target;
  529. var GLOBAL = options.global;
  530. var STATIC = options.stat;
  531. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  532. if (GLOBAL) {
  533. target = global_1;
  534. } else if (STATIC) {
  535. target = global_1[TARGET] || setGlobal(TARGET, {});
  536. } else {
  537. target = (global_1[TARGET] || {}).prototype;
  538. }
  539. if (target) for (key in source) {
  540. sourceProperty = source[key];
  541. if (options.noTargetGet) {
  542. descriptor = getOwnPropertyDescriptor(target, key);
  543. targetProperty = descriptor && descriptor.value;
  544. } else targetProperty = target[key];
  545. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  546. // contained in target
  547. if (!FORCED && targetProperty !== undefined) {
  548. if (typeof sourceProperty === typeof targetProperty) continue;
  549. copyConstructorProperties(sourceProperty, targetProperty);
  550. }
  551. // add a flag to not completely full polyfills
  552. if (options.sham || (targetProperty && targetProperty.sham)) {
  553. createNonEnumerableProperty(sourceProperty, 'sham', true);
  554. }
  555. // extend global
  556. redefine(target, key, sourceProperty, options);
  557. }
  558. };
  559. // `IsArray` abstract operation
  560. // https://tc39.es/ecma262/#sec-isarray
  561. // eslint-disable-next-line es/no-array-isarray -- safe
  562. var isArray = Array.isArray || function isArray(arg) {
  563. return classofRaw(arg) == 'Array';
  564. };
  565. // `ToObject` abstract operation
  566. // https://tc39.es/ecma262/#sec-toobject
  567. var toObject = function (argument) {
  568. return Object(requireObjectCoercible(argument));
  569. };
  570. var createProperty = function (object, key, value) {
  571. var propertyKey = toPrimitive(key);
  572. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  573. else object[propertyKey] = value;
  574. };
  575. var engineIsNode = classofRaw(global_1.process) == 'process';
  576. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  577. var process = global_1.process;
  578. var versions = process && process.versions;
  579. var v8 = versions && versions.v8;
  580. var match, version;
  581. if (v8) {
  582. match = v8.split('.');
  583. version = match[0] + match[1];
  584. } else if (engineUserAgent) {
  585. match = engineUserAgent.match(/Edge\/(\d+)/);
  586. if (!match || match[1] >= 74) {
  587. match = engineUserAgent.match(/Chrome\/(\d+)/);
  588. if (match) version = match[1];
  589. }
  590. }
  591. var engineV8Version = version && +version;
  592. // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
  593. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  594. // eslint-disable-next-line es/no-symbol -- required for testing
  595. return !Symbol.sham &&
  596. // Chrome 38 Symbol has incorrect toString conversion
  597. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  598. (engineIsNode ? engineV8Version === 38 : engineV8Version > 37 && engineV8Version < 41);
  599. });
  600. /* eslint-disable es/no-symbol -- required for testing */
  601. var useSymbolAsUid = nativeSymbol
  602. && !Symbol.sham
  603. && typeof Symbol.iterator == 'symbol';
  604. var WellKnownSymbolsStore = shared('wks');
  605. var Symbol$1 = global_1.Symbol;
  606. var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
  607. var wellKnownSymbol = function (name) {
  608. if (!has$1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
  609. if (nativeSymbol && has$1(Symbol$1, name)) {
  610. WellKnownSymbolsStore[name] = Symbol$1[name];
  611. } else {
  612. WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
  613. }
  614. } return WellKnownSymbolsStore[name];
  615. };
  616. var SPECIES$2 = wellKnownSymbol('species');
  617. // `ArraySpeciesCreate` abstract operation
  618. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  619. var arraySpeciesCreate = function (originalArray, length) {
  620. var C;
  621. if (isArray(originalArray)) {
  622. C = originalArray.constructor;
  623. // cross-realm fallback
  624. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  625. else if (isObject(C)) {
  626. C = C[SPECIES$2];
  627. if (C === null) C = undefined;
  628. }
  629. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  630. };
  631. var SPECIES$1 = wellKnownSymbol('species');
  632. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  633. // We can't use this feature detection in V8 since it causes
  634. // deoptimization and serious performance degradation
  635. // https://github.com/zloirock/core-js/issues/677
  636. return engineV8Version >= 51 || !fails(function () {
  637. var array = [];
  638. var constructor = array.constructor = {};
  639. constructor[SPECIES$1] = function () {
  640. return { foo: 1 };
  641. };
  642. return array[METHOD_NAME](Boolean).foo !== 1;
  643. });
  644. };
  645. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  646. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  647. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  648. // We can't use this feature detection in V8 since it causes
  649. // deoptimization and serious performance degradation
  650. // https://github.com/zloirock/core-js/issues/679
  651. var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
  652. var array = [];
  653. array[IS_CONCAT_SPREADABLE] = false;
  654. return array.concat()[0] !== array;
  655. });
  656. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  657. var isConcatSpreadable = function (O) {
  658. if (!isObject(O)) return false;
  659. var spreadable = O[IS_CONCAT_SPREADABLE];
  660. return spreadable !== undefined ? !!spreadable : isArray(O);
  661. };
  662. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  663. // `Array.prototype.concat` method
  664. // https://tc39.es/ecma262/#sec-array.prototype.concat
  665. // with adding support of @@isConcatSpreadable and @@species
  666. _export({ target: 'Array', proto: true, forced: FORCED }, {
  667. // eslint-disable-next-line no-unused-vars -- required for `.length`
  668. concat: function concat(arg) {
  669. var O = toObject(this);
  670. var A = arraySpeciesCreate(O, 0);
  671. var n = 0;
  672. var i, k, length, len, E;
  673. for (i = -1, length = arguments.length; i < length; i++) {
  674. E = i === -1 ? O : arguments[i];
  675. if (isConcatSpreadable(E)) {
  676. len = toLength(E.length);
  677. if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  678. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  679. } else {
  680. if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  681. createProperty(A, n++, E);
  682. }
  683. }
  684. A.length = n;
  685. return A;
  686. }
  687. });
  688. var aFunction = function (it) {
  689. if (typeof it != 'function') {
  690. throw TypeError(String(it) + ' is not a function');
  691. } return it;
  692. };
  693. // optional / simple context binding
  694. var functionBindContext = function (fn, that, length) {
  695. aFunction(fn);
  696. if (that === undefined) return fn;
  697. switch (length) {
  698. case 0: return function () {
  699. return fn.call(that);
  700. };
  701. case 1: return function (a) {
  702. return fn.call(that, a);
  703. };
  704. case 2: return function (a, b) {
  705. return fn.call(that, a, b);
  706. };
  707. case 3: return function (a, b, c) {
  708. return fn.call(that, a, b, c);
  709. };
  710. }
  711. return function (/* ...args */) {
  712. return fn.apply(that, arguments);
  713. };
  714. };
  715. var push = [].push;
  716. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation
  717. var createMethod = function (TYPE) {
  718. var IS_MAP = TYPE == 1;
  719. var IS_FILTER = TYPE == 2;
  720. var IS_SOME = TYPE == 3;
  721. var IS_EVERY = TYPE == 4;
  722. var IS_FIND_INDEX = TYPE == 6;
  723. var IS_FILTER_OUT = TYPE == 7;
  724. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  725. return function ($this, callbackfn, that, specificCreate) {
  726. var O = toObject($this);
  727. var self = indexedObject(O);
  728. var boundFunction = functionBindContext(callbackfn, that, 3);
  729. var length = toLength(self.length);
  730. var index = 0;
  731. var create = specificCreate || arraySpeciesCreate;
  732. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
  733. var value, result;
  734. for (;length > index; index++) if (NO_HOLES || index in self) {
  735. value = self[index];
  736. result = boundFunction(value, index, O);
  737. if (TYPE) {
  738. if (IS_MAP) target[index] = result; // map
  739. else if (result) switch (TYPE) {
  740. case 3: return true; // some
  741. case 5: return value; // find
  742. case 6: return index; // findIndex
  743. case 2: push.call(target, value); // filter
  744. } else switch (TYPE) {
  745. case 4: return false; // every
  746. case 7: push.call(target, value); // filterOut
  747. }
  748. }
  749. }
  750. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  751. };
  752. };
  753. var arrayIteration = {
  754. // `Array.prototype.forEach` method
  755. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  756. forEach: createMethod(0),
  757. // `Array.prototype.map` method
  758. // https://tc39.es/ecma262/#sec-array.prototype.map
  759. map: createMethod(1),
  760. // `Array.prototype.filter` method
  761. // https://tc39.es/ecma262/#sec-array.prototype.filter
  762. filter: createMethod(2),
  763. // `Array.prototype.some` method
  764. // https://tc39.es/ecma262/#sec-array.prototype.some
  765. some: createMethod(3),
  766. // `Array.prototype.every` method
  767. // https://tc39.es/ecma262/#sec-array.prototype.every
  768. every: createMethod(4),
  769. // `Array.prototype.find` method
  770. // https://tc39.es/ecma262/#sec-array.prototype.find
  771. find: createMethod(5),
  772. // `Array.prototype.findIndex` method
  773. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  774. findIndex: createMethod(6),
  775. // `Array.prototype.filterOut` method
  776. // https://github.com/tc39/proposal-array-filtering
  777. filterOut: createMethod(7)
  778. };
  779. // `Object.keys` method
  780. // https://tc39.es/ecma262/#sec-object.keys
  781. // eslint-disable-next-line es/no-object-keys -- safe
  782. var objectKeys = Object.keys || function keys(O) {
  783. return objectKeysInternal(O, enumBugKeys);
  784. };
  785. // `Object.defineProperties` method
  786. // https://tc39.es/ecma262/#sec-object.defineproperties
  787. // eslint-disable-next-line es/no-object-defineproperties -- safe
  788. var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
  789. anObject(O);
  790. var keys = objectKeys(Properties);
  791. var length = keys.length;
  792. var index = 0;
  793. var key;
  794. while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
  795. return O;
  796. };
  797. var html = getBuiltIn('document', 'documentElement');
  798. var GT = '>';
  799. var LT = '<';
  800. var PROTOTYPE = 'prototype';
  801. var SCRIPT = 'script';
  802. var IE_PROTO = sharedKey('IE_PROTO');
  803. var EmptyConstructor = function () { /* empty */ };
  804. var scriptTag = function (content) {
  805. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  806. };
  807. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  808. var NullProtoObjectViaActiveX = function (activeXDocument) {
  809. activeXDocument.write(scriptTag(''));
  810. activeXDocument.close();
  811. var temp = activeXDocument.parentWindow.Object;
  812. activeXDocument = null; // avoid memory leak
  813. return temp;
  814. };
  815. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  816. var NullProtoObjectViaIFrame = function () {
  817. // Thrash, waste and sodomy: IE GC bug
  818. var iframe = documentCreateElement('iframe');
  819. var JS = 'java' + SCRIPT + ':';
  820. var iframeDocument;
  821. iframe.style.display = 'none';
  822. html.appendChild(iframe);
  823. // https://github.com/zloirock/core-js/issues/475
  824. iframe.src = String(JS);
  825. iframeDocument = iframe.contentWindow.document;
  826. iframeDocument.open();
  827. iframeDocument.write(scriptTag('document.F=Object'));
  828. iframeDocument.close();
  829. return iframeDocument.F;
  830. };
  831. // Check for document.domain and active x support
  832. // No need to use active x approach when document.domain is not set
  833. // see https://github.com/es-shims/es5-shim/issues/150
  834. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  835. // avoid IE GC bug
  836. var activeXDocument;
  837. var NullProtoObject = function () {
  838. try {
  839. /* global ActiveXObject -- old IE */
  840. activeXDocument = document.domain && new ActiveXObject('htmlfile');
  841. } catch (error) { /* ignore */ }
  842. NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
  843. var length = enumBugKeys.length;
  844. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  845. return NullProtoObject();
  846. };
  847. hiddenKeys$1[IE_PROTO] = true;
  848. // `Object.create` method
  849. // https://tc39.es/ecma262/#sec-object.create
  850. var objectCreate = Object.create || function create(O, Properties) {
  851. var result;
  852. if (O !== null) {
  853. EmptyConstructor[PROTOTYPE] = anObject(O);
  854. result = new EmptyConstructor();
  855. EmptyConstructor[PROTOTYPE] = null;
  856. // add "__proto__" for Object.getPrototypeOf polyfill
  857. result[IE_PROTO] = O;
  858. } else result = NullProtoObject();
  859. return Properties === undefined ? result : objectDefineProperties(result, Properties);
  860. };
  861. var UNSCOPABLES = wellKnownSymbol('unscopables');
  862. var ArrayPrototype = Array.prototype;
  863. // Array.prototype[@@unscopables]
  864. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  865. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  866. objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
  867. configurable: true,
  868. value: objectCreate(null)
  869. });
  870. }
  871. // add a key to Array.prototype[@@unscopables]
  872. var addToUnscopables = function (key) {
  873. ArrayPrototype[UNSCOPABLES][key] = true;
  874. };
  875. var $find = arrayIteration.find;
  876. var FIND = 'find';
  877. var SKIPS_HOLES = true;
  878. // Shouldn't skip holes
  879. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  880. // `Array.prototype.find` method
  881. // https://tc39.es/ecma262/#sec-array.prototype.find
  882. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  883. find: function find(callbackfn /* , that = undefined */) {
  884. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  885. }
  886. });
  887. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  888. addToUnscopables(FIND);
  889. // `RegExp.prototype.flags` getter implementation
  890. // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
  891. var regexpFlags = function () {
  892. var that = anObject(this);
  893. var result = '';
  894. if (that.global) result += 'g';
  895. if (that.ignoreCase) result += 'i';
  896. if (that.multiline) result += 'm';
  897. if (that.dotAll) result += 's';
  898. if (that.unicode) result += 'u';
  899. if (that.sticky) result += 'y';
  900. return result;
  901. };
  902. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
  903. // so we use an intermediate function.
  904. function RE(s, f) {
  905. return RegExp(s, f);
  906. }
  907. var UNSUPPORTED_Y$1 = fails(function () {
  908. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
  909. var re = RE('a', 'y');
  910. re.lastIndex = 2;
  911. return re.exec('abcd') != null;
  912. });
  913. var BROKEN_CARET = fails(function () {
  914. // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
  915. var re = RE('^r', 'gy');
  916. re.lastIndex = 2;
  917. return re.exec('str') != null;
  918. });
  919. var regexpStickyHelpers = {
  920. UNSUPPORTED_Y: UNSUPPORTED_Y$1,
  921. BROKEN_CARET: BROKEN_CARET
  922. };
  923. var nativeExec = RegExp.prototype.exec;
  924. var nativeReplace = shared('native-string-replace', String.prototype.replace);
  925. var patchedExec = nativeExec;
  926. var UPDATES_LAST_INDEX_WRONG = (function () {
  927. var re1 = /a/;
  928. var re2 = /b*/g;
  929. nativeExec.call(re1, 'a');
  930. nativeExec.call(re2, 'a');
  931. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  932. })();
  933. var UNSUPPORTED_Y = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET;
  934. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  935. // eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group -- required for testing
  936. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  937. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y;
  938. if (PATCH) {
  939. patchedExec = function exec(str) {
  940. var re = this;
  941. var lastIndex, reCopy, match, i;
  942. var sticky = UNSUPPORTED_Y && re.sticky;
  943. var flags = regexpFlags.call(re);
  944. var source = re.source;
  945. var charsAdded = 0;
  946. var strCopy = str;
  947. if (sticky) {
  948. flags = flags.replace('y', '');
  949. if (flags.indexOf('g') === -1) {
  950. flags += 'g';
  951. }
  952. strCopy = String(str).slice(re.lastIndex);
  953. // Support anchored sticky behavior.
  954. if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
  955. source = '(?: ' + source + ')';
  956. strCopy = ' ' + strCopy;
  957. charsAdded++;
  958. }
  959. // ^(? + rx + ) is needed, in combination with some str slicing, to
  960. // simulate the 'y' flag.
  961. reCopy = new RegExp('^(?:' + source + ')', flags);
  962. }
  963. if (NPCG_INCLUDED) {
  964. reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
  965. }
  966. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  967. match = nativeExec.call(sticky ? reCopy : re, strCopy);
  968. if (sticky) {
  969. if (match) {
  970. match.input = match.input.slice(charsAdded);
  971. match[0] = match[0].slice(charsAdded);
  972. match.index = re.lastIndex;
  973. re.lastIndex += match[0].length;
  974. } else re.lastIndex = 0;
  975. } else if (UPDATES_LAST_INDEX_WRONG && match) {
  976. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  977. }
  978. if (NPCG_INCLUDED && match && match.length > 1) {
  979. // Fix browsers whose `exec` methods don't consistently return `undefined`
  980. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  981. nativeReplace.call(match[0], reCopy, function () {
  982. for (i = 1; i < arguments.length - 2; i++) {
  983. if (arguments[i] === undefined) match[i] = undefined;
  984. }
  985. });
  986. }
  987. return match;
  988. };
  989. }
  990. var regexpExec = patchedExec;
  991. // `RegExp.prototype.exec` method
  992. // https://tc39.es/ecma262/#sec-regexp.prototype.exec
  993. _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
  994. exec: regexpExec
  995. });
  996. // TODO: Remove from `core-js@4` since it's moved to entry points
  997. var SPECIES = wellKnownSymbol('species');
  998. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  999. // #replace needs built-in support for named groups.
  1000. // #match works fine because it just return the exec results, even if it has
  1001. // a "grops" property.
  1002. var re = /./;
  1003. re.exec = function () {
  1004. var result = [];
  1005. result.groups = { a: '7' };
  1006. return result;
  1007. };
  1008. return ''.replace(re, '$<a>') !== '7';
  1009. });
  1010. // IE <= 11 replaces $0 with the whole match, as if it was $&
  1011. // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
  1012. var REPLACE_KEEPS_$0 = (function () {
  1013. // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
  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. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  1028. var re = /(?:)/;
  1029. var originalExec = re.exec;
  1030. re.exec = function () { return originalExec.apply(this, arguments); };
  1031. var result = 'ab'.split(re);
  1032. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  1033. });
  1034. var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
  1035. var SYMBOL = wellKnownSymbol(KEY);
  1036. var DELEGATES_TO_SYMBOL = !fails(function () {
  1037. // String methods call symbol-named RegEp methods
  1038. var O = {};
  1039. O[SYMBOL] = function () { return 7; };
  1040. return ''[KEY](O) != 7;
  1041. });
  1042. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  1043. // Symbol-named RegExp methods call .exec
  1044. var execCalled = false;
  1045. var re = /a/;
  1046. if (KEY === 'split') {
  1047. // We can't use real regex here since it causes deoptimization
  1048. // and serious performance degradation in V8
  1049. // https://github.com/zloirock/core-js/issues/306
  1050. re = {};
  1051. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  1052. // a new one. We need to return the patched regex when creating the new one.
  1053. re.constructor = {};
  1054. re.constructor[SPECIES] = function () { return re; };
  1055. re.flags = '';
  1056. re[SYMBOL] = /./[SYMBOL];
  1057. }
  1058. re.exec = function () { execCalled = true; return null; };
  1059. re[SYMBOL]('');
  1060. return !execCalled;
  1061. });
  1062. if (
  1063. !DELEGATES_TO_SYMBOL ||
  1064. !DELEGATES_TO_EXEC ||
  1065. (KEY === 'replace' && !(
  1066. REPLACE_SUPPORTS_NAMED_GROUPS &&
  1067. REPLACE_KEEPS_$0 &&
  1068. !REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
  1069. )) ||
  1070. (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
  1071. ) {
  1072. var nativeRegExpMethod = /./[SYMBOL];
  1073. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  1074. if (regexp.exec === RegExp.prototype.exec) {
  1075. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  1076. // The native String method already delegates to @@method (this
  1077. // polyfilled function), leasing to infinite recursion.
  1078. // We avoid it by directly calling the native @@method method.
  1079. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
  1080. }
  1081. return { done: true, value: nativeMethod.call(str, regexp, arg2) };
  1082. }
  1083. return { done: false };
  1084. }, {
  1085. REPLACE_KEEPS_$0: REPLACE_KEEPS_$0,
  1086. REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
  1087. });
  1088. var stringMethod = methods[0];
  1089. var regexMethod = methods[1];
  1090. redefine(String.prototype, KEY, stringMethod);
  1091. redefine(RegExp.prototype, SYMBOL, length == 2
  1092. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  1093. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  1094. ? function (string, arg) { return regexMethod.call(string, this, arg); }
  1095. // 21.2.5.6 RegExp.prototype[@@match](string)
  1096. // 21.2.5.9 RegExp.prototype[@@search](string)
  1097. : function (string) { return regexMethod.call(string, this); }
  1098. );
  1099. }
  1100. if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
  1101. };
  1102. // `SameValue` abstract operation
  1103. // https://tc39.es/ecma262/#sec-samevalue
  1104. // eslint-disable-next-line es/no-object-is -- safe
  1105. var sameValue = Object.is || function is(x, y) {
  1106. // eslint-disable-next-line no-self-compare -- NaN check
  1107. return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
  1108. };
  1109. // `RegExpExec` abstract operation
  1110. // https://tc39.es/ecma262/#sec-regexpexec
  1111. var regexpExecAbstract = function (R, S) {
  1112. var exec = R.exec;
  1113. if (typeof exec === 'function') {
  1114. var result = exec.call(R, S);
  1115. if (typeof result !== 'object') {
  1116. throw TypeError('RegExp exec method returned something other than an Object or null');
  1117. }
  1118. return result;
  1119. }
  1120. if (classofRaw(R) !== 'RegExp') {
  1121. throw TypeError('RegExp#exec called on incompatible receiver');
  1122. }
  1123. return regexpExec.call(R, S);
  1124. };
  1125. // @@search logic
  1126. fixRegexpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) {
  1127. return [
  1128. // `String.prototype.search` method
  1129. // https://tc39.es/ecma262/#sec-string.prototype.search
  1130. function search(regexp) {
  1131. var O = requireObjectCoercible(this);
  1132. var searcher = regexp == undefined ? undefined : regexp[SEARCH];
  1133. return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
  1134. },
  1135. // `RegExp.prototype[@@search]` method
  1136. // https://tc39.es/ecma262/#sec-regexp.prototype-@@search
  1137. function (regexp) {
  1138. var res = maybeCallNative(nativeSearch, regexp, this);
  1139. if (res.done) return res.value;
  1140. var rx = anObject(regexp);
  1141. var S = String(this);
  1142. var previousLastIndex = rx.lastIndex;
  1143. if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
  1144. var result = regexpExecAbstract(rx, S);
  1145. if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
  1146. return result === null ? -1 : result.index;
  1147. }
  1148. ];
  1149. });
  1150. /**
  1151. * @author: Dennis Hernández
  1152. * @webSite: http://djhvscf.github.io/Blog
  1153. * @update zhixin wen <wenzhixin2010@gmail.com>
  1154. */
  1155. var Utils = $__default['default'].fn.bootstrapTable.utils;
  1156. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults, {
  1157. keyEvents: false
  1158. });
  1159. $__default['default'].BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
  1160. _inherits(_class, _$$BootstrapTable);
  1161. var _super = _createSuper(_class);
  1162. function _class() {
  1163. _classCallCheck(this, _class);
  1164. return _super.apply(this, arguments);
  1165. }
  1166. _createClass(_class, [{
  1167. key: "init",
  1168. value: function init() {
  1169. var _get2;
  1170. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1171. args[_key] = arguments[_key];
  1172. }
  1173. (_get2 = _get(_getPrototypeOf(_class.prototype), "init", this)).call.apply(_get2, [this].concat(args));
  1174. if (this.options.keyEvents) {
  1175. this.initKeyEvents();
  1176. }
  1177. }
  1178. }, {
  1179. key: "initKeyEvents",
  1180. value: function initKeyEvents() {
  1181. var _this = this;
  1182. $__default['default'](document).off('keydown').on('keydown', function (e) {
  1183. var $search = Utils.getSearchInput(_this);
  1184. var $refresh = _this.$toolbar.find('button[name="refresh"]');
  1185. var $toggle = _this.$toolbar.find('button[name="toggle"]');
  1186. var $paginationSwitch = _this.$toolbar.find('button[name="paginationSwitch"]');
  1187. if (document.activeElement === $search.get(0) || !$__default['default'].contains(document.activeElement, _this.$toolbar.get(0))) {
  1188. return true;
  1189. }
  1190. switch (e.keyCode) {
  1191. case 83:
  1192. // s
  1193. if (!_this.options.search) {
  1194. return;
  1195. }
  1196. $search.focus();
  1197. return false;
  1198. case 82:
  1199. // r
  1200. if (!_this.options.showRefresh) {
  1201. return;
  1202. }
  1203. $refresh.click();
  1204. return false;
  1205. case 84:
  1206. // t
  1207. if (!_this.options.showToggle) {
  1208. return;
  1209. }
  1210. $toggle.click();
  1211. return false;
  1212. case 80:
  1213. // p
  1214. if (!_this.options.showPaginationSwitch) {
  1215. return;
  1216. }
  1217. $paginationSwitch.click();
  1218. return false;
  1219. case 37:
  1220. // left
  1221. if (!_this.options.pagination) {
  1222. return;
  1223. }
  1224. _this.prevPage();
  1225. return false;
  1226. case 39:
  1227. // right
  1228. if (!_this.options.pagination) {
  1229. return;
  1230. }
  1231. _this.nextPage();
  1232. return;
  1233. }
  1234. });
  1235. }
  1236. }]);
  1237. return _class;
  1238. }($__default['default'].BootstrapTable);
  1239. })));