bootstrap-table-editable.js 63 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904
  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. function _slicedToArray(arr, i) {
  114. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
  115. }
  116. function _arrayWithHoles(arr) {
  117. if (Array.isArray(arr)) return arr;
  118. }
  119. function _iterableToArrayLimit(arr, i) {
  120. if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
  121. var _arr = [];
  122. var _n = true;
  123. var _d = false;
  124. var _e = undefined;
  125. try {
  126. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  127. _arr.push(_s.value);
  128. if (i && _arr.length === i) break;
  129. }
  130. } catch (err) {
  131. _d = true;
  132. _e = err;
  133. } finally {
  134. try {
  135. if (!_n && _i["return"] != null) _i["return"]();
  136. } finally {
  137. if (_d) throw _e;
  138. }
  139. }
  140. return _arr;
  141. }
  142. function _unsupportedIterableToArray(o, minLen) {
  143. if (!o) return;
  144. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  145. var n = Object.prototype.toString.call(o).slice(8, -1);
  146. if (n === "Object" && o.constructor) n = o.constructor.name;
  147. if (n === "Map" || n === "Set") return Array.from(o);
  148. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  149. }
  150. function _arrayLikeToArray(arr, len) {
  151. if (len == null || len > arr.length) len = arr.length;
  152. for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
  153. return arr2;
  154. }
  155. function _nonIterableRest() {
  156. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  157. }
  158. function _createForOfIteratorHelper(o, allowArrayLike) {
  159. var it;
  160. if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
  161. if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
  162. if (it) o = it;
  163. var i = 0;
  164. var F = function () {};
  165. return {
  166. s: F,
  167. n: function () {
  168. if (i >= o.length) return {
  169. done: true
  170. };
  171. return {
  172. done: false,
  173. value: o[i++]
  174. };
  175. },
  176. e: function (e) {
  177. throw e;
  178. },
  179. f: F
  180. };
  181. }
  182. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  183. }
  184. var normalCompletion = true,
  185. didErr = false,
  186. err;
  187. return {
  188. s: function () {
  189. it = o[Symbol.iterator]();
  190. },
  191. n: function () {
  192. var step = it.next();
  193. normalCompletion = step.done;
  194. return step;
  195. },
  196. e: function (e) {
  197. didErr = true;
  198. err = e;
  199. },
  200. f: function () {
  201. try {
  202. if (!normalCompletion && it.return != null) it.return();
  203. } finally {
  204. if (didErr) throw err;
  205. }
  206. }
  207. };
  208. }
  209. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  210. function createCommonjsModule(fn, module) {
  211. return module = { exports: {} }, fn(module, module.exports), module.exports;
  212. }
  213. var check = function (it) {
  214. return it && it.Math == Math && it;
  215. };
  216. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  217. var global_1 =
  218. /* global globalThis -- safe */
  219. check(typeof globalThis == 'object' && globalThis) ||
  220. check(typeof window == 'object' && window) ||
  221. check(typeof self == 'object' && self) ||
  222. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  223. // eslint-disable-next-line no-new-func -- fallback
  224. (function () { return this; })() || Function('return this')();
  225. var fails = function (exec) {
  226. try {
  227. return !!exec();
  228. } catch (error) {
  229. return true;
  230. }
  231. };
  232. // Detect IE8's incomplete defineProperty implementation
  233. var descriptors = !fails(function () {
  234. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  235. });
  236. var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
  237. var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  238. // Nashorn ~ JDK8 bug
  239. var NASHORN_BUG = getOwnPropertyDescriptor$1 && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
  240. // `Object.prototype.propertyIsEnumerable` method implementation
  241. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  242. var f$4 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  243. var descriptor = getOwnPropertyDescriptor$1(this, V);
  244. return !!descriptor && descriptor.enumerable;
  245. } : nativePropertyIsEnumerable;
  246. var objectPropertyIsEnumerable = {
  247. f: f$4
  248. };
  249. var createPropertyDescriptor = function (bitmap, value) {
  250. return {
  251. enumerable: !(bitmap & 1),
  252. configurable: !(bitmap & 2),
  253. writable: !(bitmap & 4),
  254. value: value
  255. };
  256. };
  257. var toString = {}.toString;
  258. var classofRaw = function (it) {
  259. return toString.call(it).slice(8, -1);
  260. };
  261. var split = ''.split;
  262. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  263. var indexedObject = fails(function () {
  264. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  265. // eslint-disable-next-line no-prototype-builtins -- safe
  266. return !Object('z').propertyIsEnumerable(0);
  267. }) ? function (it) {
  268. return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
  269. } : Object;
  270. // `RequireObjectCoercible` abstract operation
  271. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  272. var requireObjectCoercible = function (it) {
  273. if (it == undefined) throw TypeError("Can't call method on " + it);
  274. return it;
  275. };
  276. // toObject with fallback for non-array-like ES3 strings
  277. var toIndexedObject = function (it) {
  278. return indexedObject(requireObjectCoercible(it));
  279. };
  280. var isObject = function (it) {
  281. return typeof it === 'object' ? it !== null : typeof it === 'function';
  282. };
  283. // `ToPrimitive` abstract operation
  284. // https://tc39.es/ecma262/#sec-toprimitive
  285. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  286. // and the second argument - flag - preferred type is a string
  287. var toPrimitive = function (input, PREFERRED_STRING) {
  288. if (!isObject(input)) return input;
  289. var fn, val;
  290. if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  291. if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
  292. if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  293. throw TypeError("Can't convert object to primitive value");
  294. };
  295. var hasOwnProperty = {}.hasOwnProperty;
  296. var has$1 = function (it, key) {
  297. return hasOwnProperty.call(it, key);
  298. };
  299. var document$1 = global_1.document;
  300. // typeof document.createElement is 'object' in old IE
  301. var EXISTS = isObject(document$1) && isObject(document$1.createElement);
  302. var documentCreateElement = function (it) {
  303. return EXISTS ? document$1.createElement(it) : {};
  304. };
  305. // Thank's IE8 for his funny defineProperty
  306. var ie8DomDefine = !descriptors && !fails(function () {
  307. return Object.defineProperty(documentCreateElement('div'), 'a', {
  308. get: function () { return 7; }
  309. }).a != 7;
  310. });
  311. var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  312. // `Object.getOwnPropertyDescriptor` method
  313. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  314. var f$3 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  315. O = toIndexedObject(O);
  316. P = toPrimitive(P, true);
  317. if (ie8DomDefine) try {
  318. return nativeGetOwnPropertyDescriptor(O, P);
  319. } catch (error) { /* empty */ }
  320. if (has$1(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
  321. };
  322. var objectGetOwnPropertyDescriptor = {
  323. f: f$3
  324. };
  325. var anObject = function (it) {
  326. if (!isObject(it)) {
  327. throw TypeError(String(it) + ' is not an object');
  328. } return it;
  329. };
  330. var nativeDefineProperty = Object.defineProperty;
  331. // `Object.defineProperty` method
  332. // https://tc39.es/ecma262/#sec-object.defineproperty
  333. var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
  334. anObject(O);
  335. P = toPrimitive(P, true);
  336. anObject(Attributes);
  337. if (ie8DomDefine) try {
  338. return nativeDefineProperty(O, P, Attributes);
  339. } catch (error) { /* empty */ }
  340. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  341. if ('value' in Attributes) O[P] = Attributes.value;
  342. return O;
  343. };
  344. var objectDefineProperty = {
  345. f: f$2
  346. };
  347. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  348. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  349. } : function (object, key, value) {
  350. object[key] = value;
  351. return object;
  352. };
  353. var setGlobal = function (key, value) {
  354. try {
  355. createNonEnumerableProperty(global_1, key, value);
  356. } catch (error) {
  357. global_1[key] = value;
  358. } return value;
  359. };
  360. var SHARED = '__core-js_shared__';
  361. var store$1 = global_1[SHARED] || setGlobal(SHARED, {});
  362. var sharedStore = store$1;
  363. var functionToString = Function.toString;
  364. // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
  365. if (typeof sharedStore.inspectSource != 'function') {
  366. sharedStore.inspectSource = function (it) {
  367. return functionToString.call(it);
  368. };
  369. }
  370. var inspectSource = sharedStore.inspectSource;
  371. var WeakMap$1 = global_1.WeakMap;
  372. var nativeWeakMap = typeof WeakMap$1 === 'function' && /native code/.test(inspectSource(WeakMap$1));
  373. var shared = createCommonjsModule(function (module) {
  374. (module.exports = function (key, value) {
  375. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  376. })('versions', []).push({
  377. version: '3.9.1',
  378. mode: 'global',
  379. copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
  380. });
  381. });
  382. var id = 0;
  383. var postfix = Math.random();
  384. var uid = function (key) {
  385. return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
  386. };
  387. var keys = shared('keys');
  388. var sharedKey = function (key) {
  389. return keys[key] || (keys[key] = uid(key));
  390. };
  391. var hiddenKeys$1 = {};
  392. var WeakMap = global_1.WeakMap;
  393. var set, get, has;
  394. var enforce = function (it) {
  395. return has(it) ? get(it) : set(it, {});
  396. };
  397. var getterFor = function (TYPE) {
  398. return function (it) {
  399. var state;
  400. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  401. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  402. } return state;
  403. };
  404. };
  405. if (nativeWeakMap) {
  406. var store = sharedStore.state || (sharedStore.state = new WeakMap());
  407. var wmget = store.get;
  408. var wmhas = store.has;
  409. var wmset = store.set;
  410. set = function (it, metadata) {
  411. metadata.facade = it;
  412. wmset.call(store, it, metadata);
  413. return metadata;
  414. };
  415. get = function (it) {
  416. return wmget.call(store, it) || {};
  417. };
  418. has = function (it) {
  419. return wmhas.call(store, it);
  420. };
  421. } else {
  422. var STATE = sharedKey('state');
  423. hiddenKeys$1[STATE] = true;
  424. set = function (it, metadata) {
  425. metadata.facade = it;
  426. createNonEnumerableProperty(it, STATE, metadata);
  427. return metadata;
  428. };
  429. get = function (it) {
  430. return has$1(it, STATE) ? it[STATE] : {};
  431. };
  432. has = function (it) {
  433. return has$1(it, STATE);
  434. };
  435. }
  436. var internalState = {
  437. set: set,
  438. get: get,
  439. has: has,
  440. enforce: enforce,
  441. getterFor: getterFor
  442. };
  443. var redefine = createCommonjsModule(function (module) {
  444. var getInternalState = internalState.get;
  445. var enforceInternalState = internalState.enforce;
  446. var TEMPLATE = String(String).split('String');
  447. (module.exports = function (O, key, value, options) {
  448. var unsafe = options ? !!options.unsafe : false;
  449. var simple = options ? !!options.enumerable : false;
  450. var noTargetGet = options ? !!options.noTargetGet : false;
  451. var state;
  452. if (typeof value == 'function') {
  453. if (typeof key == 'string' && !has$1(value, 'name')) {
  454. createNonEnumerableProperty(value, 'name', key);
  455. }
  456. state = enforceInternalState(value);
  457. if (!state.source) {
  458. state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
  459. }
  460. }
  461. if (O === global_1) {
  462. if (simple) O[key] = value;
  463. else setGlobal(key, value);
  464. return;
  465. } else if (!unsafe) {
  466. delete O[key];
  467. } else if (!noTargetGet && O[key]) {
  468. simple = true;
  469. }
  470. if (simple) O[key] = value;
  471. else createNonEnumerableProperty(O, key, value);
  472. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  473. })(Function.prototype, 'toString', function toString() {
  474. return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
  475. });
  476. });
  477. var path = global_1;
  478. var aFunction$1 = function (variable) {
  479. return typeof variable == 'function' ? variable : undefined;
  480. };
  481. var getBuiltIn = function (namespace, method) {
  482. return arguments.length < 2 ? aFunction$1(path[namespace]) || aFunction$1(global_1[namespace])
  483. : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
  484. };
  485. var ceil = Math.ceil;
  486. var floor$1 = Math.floor;
  487. // `ToInteger` abstract operation
  488. // https://tc39.es/ecma262/#sec-tointeger
  489. var toInteger = function (argument) {
  490. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor$1 : ceil)(argument);
  491. };
  492. var min$2 = Math.min;
  493. // `ToLength` abstract operation
  494. // https://tc39.es/ecma262/#sec-tolength
  495. var toLength = function (argument) {
  496. return argument > 0 ? min$2(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  497. };
  498. var max$1 = Math.max;
  499. var min$1 = Math.min;
  500. // Helper for a popular repeating case of the spec:
  501. // Let integer be ? ToInteger(index).
  502. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  503. var toAbsoluteIndex = function (index, length) {
  504. var integer = toInteger(index);
  505. return integer < 0 ? max$1(integer + length, 0) : min$1(integer, length);
  506. };
  507. // `Array.prototype.{ indexOf, includes }` methods implementation
  508. var createMethod$3 = function (IS_INCLUDES) {
  509. return function ($this, el, fromIndex) {
  510. var O = toIndexedObject($this);
  511. var length = toLength(O.length);
  512. var index = toAbsoluteIndex(fromIndex, length);
  513. var value;
  514. // Array#includes uses SameValueZero equality algorithm
  515. // eslint-disable-next-line no-self-compare -- NaN check
  516. if (IS_INCLUDES && el != el) while (length > index) {
  517. value = O[index++];
  518. // eslint-disable-next-line no-self-compare -- NaN check
  519. if (value != value) return true;
  520. // Array#indexOf ignores holes, Array#includes - not
  521. } else for (;length > index; index++) {
  522. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  523. } return !IS_INCLUDES && -1;
  524. };
  525. };
  526. var arrayIncludes = {
  527. // `Array.prototype.includes` method
  528. // https://tc39.es/ecma262/#sec-array.prototype.includes
  529. includes: createMethod$3(true),
  530. // `Array.prototype.indexOf` method
  531. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  532. indexOf: createMethod$3(false)
  533. };
  534. var indexOf = arrayIncludes.indexOf;
  535. var objectKeysInternal = function (object, names) {
  536. var O = toIndexedObject(object);
  537. var i = 0;
  538. var result = [];
  539. var key;
  540. for (key in O) !has$1(hiddenKeys$1, key) && has$1(O, key) && result.push(key);
  541. // Don't enum bug & hidden keys
  542. while (names.length > i) if (has$1(O, key = names[i++])) {
  543. ~indexOf(result, key) || result.push(key);
  544. }
  545. return result;
  546. };
  547. // IE8- don't enum bug keys
  548. var enumBugKeys = [
  549. 'constructor',
  550. 'hasOwnProperty',
  551. 'isPrototypeOf',
  552. 'propertyIsEnumerable',
  553. 'toLocaleString',
  554. 'toString',
  555. 'valueOf'
  556. ];
  557. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  558. // `Object.getOwnPropertyNames` method
  559. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  560. var f$1 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  561. return objectKeysInternal(O, hiddenKeys);
  562. };
  563. var objectGetOwnPropertyNames = {
  564. f: f$1
  565. };
  566. var f = Object.getOwnPropertySymbols;
  567. var objectGetOwnPropertySymbols = {
  568. f: f
  569. };
  570. // all object keys, includes non-enumerable and symbols
  571. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  572. var keys = objectGetOwnPropertyNames.f(anObject(it));
  573. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  574. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  575. };
  576. var copyConstructorProperties = function (target, source) {
  577. var keys = ownKeys(source);
  578. var defineProperty = objectDefineProperty.f;
  579. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  580. for (var i = 0; i < keys.length; i++) {
  581. var key = keys[i];
  582. if (!has$1(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  583. }
  584. };
  585. var replacement = /#|\.prototype\./;
  586. var isForced = function (feature, detection) {
  587. var value = data[normalize(feature)];
  588. return value == POLYFILL ? true
  589. : value == NATIVE ? false
  590. : typeof detection == 'function' ? fails(detection)
  591. : !!detection;
  592. };
  593. var normalize = isForced.normalize = function (string) {
  594. return String(string).replace(replacement, '.').toLowerCase();
  595. };
  596. var data = isForced.data = {};
  597. var NATIVE = isForced.NATIVE = 'N';
  598. var POLYFILL = isForced.POLYFILL = 'P';
  599. var isForced_1 = isForced;
  600. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  601. /*
  602. options.target - name of the target object
  603. options.global - target is the global object
  604. options.stat - export as static methods of target
  605. options.proto - export as prototype methods of target
  606. options.real - real prototype method for the `pure` version
  607. options.forced - export even if the native feature is available
  608. options.bind - bind methods to the target, required for the `pure` version
  609. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  610. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  611. options.sham - add a flag to not completely full polyfills
  612. options.enumerable - export as enumerable property
  613. options.noTargetGet - prevent calling a getter on target
  614. */
  615. var _export = function (options, source) {
  616. var TARGET = options.target;
  617. var GLOBAL = options.global;
  618. var STATIC = options.stat;
  619. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  620. if (GLOBAL) {
  621. target = global_1;
  622. } else if (STATIC) {
  623. target = global_1[TARGET] || setGlobal(TARGET, {});
  624. } else {
  625. target = (global_1[TARGET] || {}).prototype;
  626. }
  627. if (target) for (key in source) {
  628. sourceProperty = source[key];
  629. if (options.noTargetGet) {
  630. descriptor = getOwnPropertyDescriptor(target, key);
  631. targetProperty = descriptor && descriptor.value;
  632. } else targetProperty = target[key];
  633. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  634. // contained in target
  635. if (!FORCED && targetProperty !== undefined) {
  636. if (typeof sourceProperty === typeof targetProperty) continue;
  637. copyConstructorProperties(sourceProperty, targetProperty);
  638. }
  639. // add a flag to not completely full polyfills
  640. if (options.sham || (targetProperty && targetProperty.sham)) {
  641. createNonEnumerableProperty(sourceProperty, 'sham', true);
  642. }
  643. // extend global
  644. redefine(target, key, sourceProperty, options);
  645. }
  646. };
  647. // `RegExp.prototype.flags` getter implementation
  648. // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
  649. var regexpFlags = function () {
  650. var that = anObject(this);
  651. var result = '';
  652. if (that.global) result += 'g';
  653. if (that.ignoreCase) result += 'i';
  654. if (that.multiline) result += 'm';
  655. if (that.dotAll) result += 's';
  656. if (that.unicode) result += 'u';
  657. if (that.sticky) result += 'y';
  658. return result;
  659. };
  660. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
  661. // so we use an intermediate function.
  662. function RE(s, f) {
  663. return RegExp(s, f);
  664. }
  665. var UNSUPPORTED_Y$1 = fails(function () {
  666. // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
  667. var re = RE('a', 'y');
  668. re.lastIndex = 2;
  669. return re.exec('abcd') != null;
  670. });
  671. var BROKEN_CARET = fails(function () {
  672. // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
  673. var re = RE('^r', 'gy');
  674. re.lastIndex = 2;
  675. return re.exec('str') != null;
  676. });
  677. var regexpStickyHelpers = {
  678. UNSUPPORTED_Y: UNSUPPORTED_Y$1,
  679. BROKEN_CARET: BROKEN_CARET
  680. };
  681. var nativeExec = RegExp.prototype.exec;
  682. // This always refers to the native implementation, because the
  683. // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
  684. // which loads this file before patching the method.
  685. var nativeReplace = String.prototype.replace;
  686. var patchedExec = nativeExec;
  687. var UPDATES_LAST_INDEX_WRONG = (function () {
  688. var re1 = /a/;
  689. var re2 = /b*/g;
  690. nativeExec.call(re1, 'a');
  691. nativeExec.call(re2, 'a');
  692. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  693. })();
  694. var UNSUPPORTED_Y = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET;
  695. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  696. // eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group -- required for testing
  697. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  698. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y;
  699. if (PATCH) {
  700. patchedExec = function exec(str) {
  701. var re = this;
  702. var lastIndex, reCopy, match, i;
  703. var sticky = UNSUPPORTED_Y && re.sticky;
  704. var flags = regexpFlags.call(re);
  705. var source = re.source;
  706. var charsAdded = 0;
  707. var strCopy = str;
  708. if (sticky) {
  709. flags = flags.replace('y', '');
  710. if (flags.indexOf('g') === -1) {
  711. flags += 'g';
  712. }
  713. strCopy = String(str).slice(re.lastIndex);
  714. // Support anchored sticky behavior.
  715. if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
  716. source = '(?: ' + source + ')';
  717. strCopy = ' ' + strCopy;
  718. charsAdded++;
  719. }
  720. // ^(? + rx + ) is needed, in combination with some str slicing, to
  721. // simulate the 'y' flag.
  722. reCopy = new RegExp('^(?:' + source + ')', flags);
  723. }
  724. if (NPCG_INCLUDED) {
  725. reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
  726. }
  727. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  728. match = nativeExec.call(sticky ? reCopy : re, strCopy);
  729. if (sticky) {
  730. if (match) {
  731. match.input = match.input.slice(charsAdded);
  732. match[0] = match[0].slice(charsAdded);
  733. match.index = re.lastIndex;
  734. re.lastIndex += match[0].length;
  735. } else re.lastIndex = 0;
  736. } else if (UPDATES_LAST_INDEX_WRONG && match) {
  737. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  738. }
  739. if (NPCG_INCLUDED && match && match.length > 1) {
  740. // Fix browsers whose `exec` methods don't consistently return `undefined`
  741. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  742. nativeReplace.call(match[0], reCopy, function () {
  743. for (i = 1; i < arguments.length - 2; i++) {
  744. if (arguments[i] === undefined) match[i] = undefined;
  745. }
  746. });
  747. }
  748. return match;
  749. };
  750. }
  751. var regexpExec = patchedExec;
  752. // `RegExp.prototype.exec` method
  753. // https://tc39.es/ecma262/#sec-regexp.prototype.exec
  754. _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
  755. exec: regexpExec
  756. });
  757. var engineIsNode = classofRaw(global_1.process) == 'process';
  758. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  759. var process = global_1.process;
  760. var versions = process && process.versions;
  761. var v8 = versions && versions.v8;
  762. var match, version;
  763. if (v8) {
  764. match = v8.split('.');
  765. version = match[0] + match[1];
  766. } else if (engineUserAgent) {
  767. match = engineUserAgent.match(/Edge\/(\d+)/);
  768. if (!match || match[1] >= 74) {
  769. match = engineUserAgent.match(/Chrome\/(\d+)/);
  770. if (match) version = match[1];
  771. }
  772. }
  773. var engineV8Version = version && +version;
  774. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  775. /* global Symbol -- required for testing */
  776. return !Symbol.sham &&
  777. // Chrome 38 Symbol has incorrect toString conversion
  778. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  779. (engineIsNode ? engineV8Version === 38 : engineV8Version > 37 && engineV8Version < 41);
  780. });
  781. var useSymbolAsUid = nativeSymbol
  782. /* global Symbol -- safe */
  783. && !Symbol.sham
  784. && typeof Symbol.iterator == 'symbol';
  785. var WellKnownSymbolsStore = shared('wks');
  786. var Symbol$1 = global_1.Symbol;
  787. var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
  788. var wellKnownSymbol = function (name) {
  789. if (!has$1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
  790. if (nativeSymbol && has$1(Symbol$1, name)) {
  791. WellKnownSymbolsStore[name] = Symbol$1[name];
  792. } else {
  793. WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
  794. }
  795. } return WellKnownSymbolsStore[name];
  796. };
  797. // TODO: Remove from `core-js@4` since it's moved to entry points
  798. var SPECIES$2 = wellKnownSymbol('species');
  799. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  800. // #replace needs built-in support for named groups.
  801. // #match works fine because it just return the exec results, even if it has
  802. // a "grops" property.
  803. var re = /./;
  804. re.exec = function () {
  805. var result = [];
  806. result.groups = { a: '7' };
  807. return result;
  808. };
  809. return ''.replace(re, '$<a>') !== '7';
  810. });
  811. // IE <= 11 replaces $0 with the whole match, as if it was $&
  812. // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
  813. var REPLACE_KEEPS_$0 = (function () {
  814. return 'a'.replace(/./, '$0') === '$0';
  815. })();
  816. var REPLACE = wellKnownSymbol('replace');
  817. // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
  818. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
  819. if (/./[REPLACE]) {
  820. return /./[REPLACE]('a', '$0') === '';
  821. }
  822. return false;
  823. })();
  824. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  825. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  826. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  827. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  828. var re = /(?:)/;
  829. var originalExec = re.exec;
  830. re.exec = function () { return originalExec.apply(this, arguments); };
  831. var result = 'ab'.split(re);
  832. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  833. });
  834. var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
  835. var SYMBOL = wellKnownSymbol(KEY);
  836. var DELEGATES_TO_SYMBOL = !fails(function () {
  837. // String methods call symbol-named RegEp methods
  838. var O = {};
  839. O[SYMBOL] = function () { return 7; };
  840. return ''[KEY](O) != 7;
  841. });
  842. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  843. // Symbol-named RegExp methods call .exec
  844. var execCalled = false;
  845. var re = /a/;
  846. if (KEY === 'split') {
  847. // We can't use real regex here since it causes deoptimization
  848. // and serious performance degradation in V8
  849. // https://github.com/zloirock/core-js/issues/306
  850. re = {};
  851. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  852. // a new one. We need to return the patched regex when creating the new one.
  853. re.constructor = {};
  854. re.constructor[SPECIES$2] = function () { return re; };
  855. re.flags = '';
  856. re[SYMBOL] = /./[SYMBOL];
  857. }
  858. re.exec = function () { execCalled = true; return null; };
  859. re[SYMBOL]('');
  860. return !execCalled;
  861. });
  862. if (
  863. !DELEGATES_TO_SYMBOL ||
  864. !DELEGATES_TO_EXEC ||
  865. (KEY === 'replace' && !(
  866. REPLACE_SUPPORTS_NAMED_GROUPS &&
  867. REPLACE_KEEPS_$0 &&
  868. !REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
  869. )) ||
  870. (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
  871. ) {
  872. var nativeRegExpMethod = /./[SYMBOL];
  873. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  874. if (regexp.exec === regexpExec) {
  875. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  876. // The native String method already delegates to @@method (this
  877. // polyfilled function), leasing to infinite recursion.
  878. // We avoid it by directly calling the native @@method method.
  879. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
  880. }
  881. return { done: true, value: nativeMethod.call(str, regexp, arg2) };
  882. }
  883. return { done: false };
  884. }, {
  885. REPLACE_KEEPS_$0: REPLACE_KEEPS_$0,
  886. REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
  887. });
  888. var stringMethod = methods[0];
  889. var regexMethod = methods[1];
  890. redefine(String.prototype, KEY, stringMethod);
  891. redefine(RegExp.prototype, SYMBOL, length == 2
  892. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  893. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  894. ? function (string, arg) { return regexMethod.call(string, this, arg); }
  895. // 21.2.5.6 RegExp.prototype[@@match](string)
  896. // 21.2.5.9 RegExp.prototype[@@search](string)
  897. : function (string) { return regexMethod.call(string, this); }
  898. );
  899. }
  900. if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
  901. };
  902. // `String.prototype.{ codePointAt, at }` methods implementation
  903. var createMethod$2 = function (CONVERT_TO_STRING) {
  904. return function ($this, pos) {
  905. var S = String(requireObjectCoercible($this));
  906. var position = toInteger(pos);
  907. var size = S.length;
  908. var first, second;
  909. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  910. first = S.charCodeAt(position);
  911. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  912. || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
  913. ? CONVERT_TO_STRING ? S.charAt(position) : first
  914. : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  915. };
  916. };
  917. var stringMultibyte = {
  918. // `String.prototype.codePointAt` method
  919. // https://tc39.es/ecma262/#sec-string.prototype.codepointat
  920. codeAt: createMethod$2(false),
  921. // `String.prototype.at` method
  922. // https://github.com/mathiasbynens/String.prototype.at
  923. charAt: createMethod$2(true)
  924. };
  925. var charAt = stringMultibyte.charAt;
  926. // `AdvanceStringIndex` abstract operation
  927. // https://tc39.es/ecma262/#sec-advancestringindex
  928. var advanceStringIndex = function (S, index, unicode) {
  929. return index + (unicode ? charAt(S, index).length : 1);
  930. };
  931. // `ToObject` abstract operation
  932. // https://tc39.es/ecma262/#sec-toobject
  933. var toObject = function (argument) {
  934. return Object(requireObjectCoercible(argument));
  935. };
  936. var floor = Math.floor;
  937. var replace = ''.replace;
  938. var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
  939. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
  940. // https://tc39.es/ecma262/#sec-getsubstitution
  941. var getSubstitution = function (matched, str, position, captures, namedCaptures, replacement) {
  942. var tailPos = position + matched.length;
  943. var m = captures.length;
  944. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  945. if (namedCaptures !== undefined) {
  946. namedCaptures = toObject(namedCaptures);
  947. symbols = SUBSTITUTION_SYMBOLS;
  948. }
  949. return replace.call(replacement, symbols, function (match, ch) {
  950. var capture;
  951. switch (ch.charAt(0)) {
  952. case '$': return '$';
  953. case '&': return matched;
  954. case '`': return str.slice(0, position);
  955. case "'": return str.slice(tailPos);
  956. case '<':
  957. capture = namedCaptures[ch.slice(1, -1)];
  958. break;
  959. default: // \d\d?
  960. var n = +ch;
  961. if (n === 0) return match;
  962. if (n > m) {
  963. var f = floor(n / 10);
  964. if (f === 0) return match;
  965. if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
  966. return match;
  967. }
  968. capture = captures[n - 1];
  969. }
  970. return capture === undefined ? '' : capture;
  971. });
  972. };
  973. // `RegExpExec` abstract operation
  974. // https://tc39.es/ecma262/#sec-regexpexec
  975. var regexpExecAbstract = function (R, S) {
  976. var exec = R.exec;
  977. if (typeof exec === 'function') {
  978. var result = exec.call(R, S);
  979. if (typeof result !== 'object') {
  980. throw TypeError('RegExp exec method returned something other than an Object or null');
  981. }
  982. return result;
  983. }
  984. if (classofRaw(R) !== 'RegExp') {
  985. throw TypeError('RegExp#exec called on incompatible receiver');
  986. }
  987. return regexpExec.call(R, S);
  988. };
  989. var max = Math.max;
  990. var min = Math.min;
  991. var maybeToString = function (it) {
  992. return it === undefined ? it : String(it);
  993. };
  994. // @@replace logic
  995. fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
  996. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE;
  997. var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0;
  998. var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
  999. return [
  1000. // `String.prototype.replace` method
  1001. // https://tc39.es/ecma262/#sec-string.prototype.replace
  1002. function replace(searchValue, replaceValue) {
  1003. var O = requireObjectCoercible(this);
  1004. var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
  1005. return replacer !== undefined
  1006. ? replacer.call(searchValue, O, replaceValue)
  1007. : nativeReplace.call(String(O), searchValue, replaceValue);
  1008. },
  1009. // `RegExp.prototype[@@replace]` method
  1010. // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
  1011. function (regexp, replaceValue) {
  1012. if (
  1013. (!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0) ||
  1014. (typeof replaceValue === 'string' && replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1)
  1015. ) {
  1016. var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
  1017. if (res.done) return res.value;
  1018. }
  1019. var rx = anObject(regexp);
  1020. var S = String(this);
  1021. var functionalReplace = typeof replaceValue === 'function';
  1022. if (!functionalReplace) replaceValue = String(replaceValue);
  1023. var global = rx.global;
  1024. if (global) {
  1025. var fullUnicode = rx.unicode;
  1026. rx.lastIndex = 0;
  1027. }
  1028. var results = [];
  1029. while (true) {
  1030. var result = regexpExecAbstract(rx, S);
  1031. if (result === null) break;
  1032. results.push(result);
  1033. if (!global) break;
  1034. var matchStr = String(result[0]);
  1035. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  1036. }
  1037. var accumulatedResult = '';
  1038. var nextSourcePosition = 0;
  1039. for (var i = 0; i < results.length; i++) {
  1040. result = results[i];
  1041. var matched = String(result[0]);
  1042. var position = max(min(toInteger(result.index), S.length), 0);
  1043. var captures = [];
  1044. // NOTE: This is equivalent to
  1045. // captures = result.slice(1).map(maybeToString)
  1046. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  1047. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  1048. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  1049. for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
  1050. var namedCaptures = result.groups;
  1051. if (functionalReplace) {
  1052. var replacerArgs = [matched].concat(captures, position, S);
  1053. if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
  1054. var replacement = String(replaceValue.apply(undefined, replacerArgs));
  1055. } else {
  1056. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  1057. }
  1058. if (position >= nextSourcePosition) {
  1059. accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
  1060. nextSourcePosition = position + matched.length;
  1061. }
  1062. }
  1063. return accumulatedResult + S.slice(nextSourcePosition);
  1064. }
  1065. ];
  1066. });
  1067. var arrayMethodIsStrict = function (METHOD_NAME, argument) {
  1068. var method = [][METHOD_NAME];
  1069. return !!method && fails(function () {
  1070. // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
  1071. method.call(null, argument || function () { throw 1; }, 1);
  1072. });
  1073. };
  1074. var $indexOf = arrayIncludes.indexOf;
  1075. var nativeIndexOf = [].indexOf;
  1076. var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
  1077. var STRICT_METHOD$1 = arrayMethodIsStrict('indexOf');
  1078. // `Array.prototype.indexOf` method
  1079. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  1080. _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD$1 }, {
  1081. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  1082. return NEGATIVE_ZERO
  1083. // convert -0 to +0
  1084. ? nativeIndexOf.apply(this, arguments) || 0
  1085. : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
  1086. }
  1087. });
  1088. // `IsArray` abstract operation
  1089. // https://tc39.es/ecma262/#sec-isarray
  1090. var isArray = Array.isArray || function isArray(arg) {
  1091. return classofRaw(arg) == 'Array';
  1092. };
  1093. var createProperty = function (object, key, value) {
  1094. var propertyKey = toPrimitive(key);
  1095. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  1096. else object[propertyKey] = value;
  1097. };
  1098. var SPECIES$1 = wellKnownSymbol('species');
  1099. // `ArraySpeciesCreate` abstract operation
  1100. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  1101. var arraySpeciesCreate = function (originalArray, length) {
  1102. var C;
  1103. if (isArray(originalArray)) {
  1104. C = originalArray.constructor;
  1105. // cross-realm fallback
  1106. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  1107. else if (isObject(C)) {
  1108. C = C[SPECIES$1];
  1109. if (C === null) C = undefined;
  1110. }
  1111. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  1112. };
  1113. var SPECIES = wellKnownSymbol('species');
  1114. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  1115. // We can't use this feature detection in V8 since it causes
  1116. // deoptimization and serious performance degradation
  1117. // https://github.com/zloirock/core-js/issues/677
  1118. return engineV8Version >= 51 || !fails(function () {
  1119. var array = [];
  1120. var constructor = array.constructor = {};
  1121. constructor[SPECIES] = function () {
  1122. return { foo: 1 };
  1123. };
  1124. return array[METHOD_NAME](Boolean).foo !== 1;
  1125. });
  1126. };
  1127. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  1128. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  1129. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  1130. // We can't use this feature detection in V8 since it causes
  1131. // deoptimization and serious performance degradation
  1132. // https://github.com/zloirock/core-js/issues/679
  1133. var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
  1134. var array = [];
  1135. array[IS_CONCAT_SPREADABLE] = false;
  1136. return array.concat()[0] !== array;
  1137. });
  1138. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  1139. var isConcatSpreadable = function (O) {
  1140. if (!isObject(O)) return false;
  1141. var spreadable = O[IS_CONCAT_SPREADABLE];
  1142. return spreadable !== undefined ? !!spreadable : isArray(O);
  1143. };
  1144. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  1145. // `Array.prototype.concat` method
  1146. // https://tc39.es/ecma262/#sec-array.prototype.concat
  1147. // with adding support of @@isConcatSpreadable and @@species
  1148. _export({ target: 'Array', proto: true, forced: FORCED }, {
  1149. // eslint-disable-next-line no-unused-vars -- required for `.length`
  1150. concat: function concat(arg) {
  1151. var O = toObject(this);
  1152. var A = arraySpeciesCreate(O, 0);
  1153. var n = 0;
  1154. var i, k, length, len, E;
  1155. for (i = -1, length = arguments.length; i < length; i++) {
  1156. E = i === -1 ? O : arguments[i];
  1157. if (isConcatSpreadable(E)) {
  1158. len = toLength(E.length);
  1159. if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1160. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  1161. } else {
  1162. if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1163. createProperty(A, n++, E);
  1164. }
  1165. }
  1166. A.length = n;
  1167. return A;
  1168. }
  1169. });
  1170. var nativeJoin = [].join;
  1171. var ES3_STRINGS = indexedObject != Object;
  1172. var STRICT_METHOD = arrayMethodIsStrict('join', ',');
  1173. // `Array.prototype.join` method
  1174. // https://tc39.es/ecma262/#sec-array.prototype.join
  1175. _export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
  1176. join: function join(separator) {
  1177. return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
  1178. }
  1179. });
  1180. var aFunction = function (it) {
  1181. if (typeof it != 'function') {
  1182. throw TypeError(String(it) + ' is not a function');
  1183. } return it;
  1184. };
  1185. // optional / simple context binding
  1186. var functionBindContext = function (fn, that, length) {
  1187. aFunction(fn);
  1188. if (that === undefined) return fn;
  1189. switch (length) {
  1190. case 0: return function () {
  1191. return fn.call(that);
  1192. };
  1193. case 1: return function (a) {
  1194. return fn.call(that, a);
  1195. };
  1196. case 2: return function (a, b) {
  1197. return fn.call(that, a, b);
  1198. };
  1199. case 3: return function (a, b, c) {
  1200. return fn.call(that, a, b, c);
  1201. };
  1202. }
  1203. return function (/* ...args */) {
  1204. return fn.apply(that, arguments);
  1205. };
  1206. };
  1207. var push = [].push;
  1208. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation
  1209. var createMethod$1 = function (TYPE) {
  1210. var IS_MAP = TYPE == 1;
  1211. var IS_FILTER = TYPE == 2;
  1212. var IS_SOME = TYPE == 3;
  1213. var IS_EVERY = TYPE == 4;
  1214. var IS_FIND_INDEX = TYPE == 6;
  1215. var IS_FILTER_OUT = TYPE == 7;
  1216. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  1217. return function ($this, callbackfn, that, specificCreate) {
  1218. var O = toObject($this);
  1219. var self = indexedObject(O);
  1220. var boundFunction = functionBindContext(callbackfn, that, 3);
  1221. var length = toLength(self.length);
  1222. var index = 0;
  1223. var create = specificCreate || arraySpeciesCreate;
  1224. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
  1225. var value, result;
  1226. for (;length > index; index++) if (NO_HOLES || index in self) {
  1227. value = self[index];
  1228. result = boundFunction(value, index, O);
  1229. if (TYPE) {
  1230. if (IS_MAP) target[index] = result; // map
  1231. else if (result) switch (TYPE) {
  1232. case 3: return true; // some
  1233. case 5: return value; // find
  1234. case 6: return index; // findIndex
  1235. case 2: push.call(target, value); // filter
  1236. } else switch (TYPE) {
  1237. case 4: return false; // every
  1238. case 7: push.call(target, value); // filterOut
  1239. }
  1240. }
  1241. }
  1242. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  1243. };
  1244. };
  1245. var arrayIteration = {
  1246. // `Array.prototype.forEach` method
  1247. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  1248. forEach: createMethod$1(0),
  1249. // `Array.prototype.map` method
  1250. // https://tc39.es/ecma262/#sec-array.prototype.map
  1251. map: createMethod$1(1),
  1252. // `Array.prototype.filter` method
  1253. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1254. filter: createMethod$1(2),
  1255. // `Array.prototype.some` method
  1256. // https://tc39.es/ecma262/#sec-array.prototype.some
  1257. some: createMethod$1(3),
  1258. // `Array.prototype.every` method
  1259. // https://tc39.es/ecma262/#sec-array.prototype.every
  1260. every: createMethod$1(4),
  1261. // `Array.prototype.find` method
  1262. // https://tc39.es/ecma262/#sec-array.prototype.find
  1263. find: createMethod$1(5),
  1264. // `Array.prototype.findIndex` method
  1265. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  1266. findIndex: createMethod$1(6),
  1267. // `Array.prototype.filterOut` method
  1268. // https://github.com/tc39/proposal-array-filtering
  1269. filterOut: createMethod$1(7)
  1270. };
  1271. // `Object.keys` method
  1272. // https://tc39.es/ecma262/#sec-object.keys
  1273. var objectKeys = Object.keys || function keys(O) {
  1274. return objectKeysInternal(O, enumBugKeys);
  1275. };
  1276. // `Object.defineProperties` method
  1277. // https://tc39.es/ecma262/#sec-object.defineproperties
  1278. var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
  1279. anObject(O);
  1280. var keys = objectKeys(Properties);
  1281. var length = keys.length;
  1282. var index = 0;
  1283. var key;
  1284. while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
  1285. return O;
  1286. };
  1287. var html = getBuiltIn('document', 'documentElement');
  1288. var GT = '>';
  1289. var LT = '<';
  1290. var PROTOTYPE = 'prototype';
  1291. var SCRIPT = 'script';
  1292. var IE_PROTO = sharedKey('IE_PROTO');
  1293. var EmptyConstructor = function () { /* empty */ };
  1294. var scriptTag = function (content) {
  1295. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  1296. };
  1297. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  1298. var NullProtoObjectViaActiveX = function (activeXDocument) {
  1299. activeXDocument.write(scriptTag(''));
  1300. activeXDocument.close();
  1301. var temp = activeXDocument.parentWindow.Object;
  1302. activeXDocument = null; // avoid memory leak
  1303. return temp;
  1304. };
  1305. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  1306. var NullProtoObjectViaIFrame = function () {
  1307. // Thrash, waste and sodomy: IE GC bug
  1308. var iframe = documentCreateElement('iframe');
  1309. var JS = 'java' + SCRIPT + ':';
  1310. var iframeDocument;
  1311. iframe.style.display = 'none';
  1312. html.appendChild(iframe);
  1313. // https://github.com/zloirock/core-js/issues/475
  1314. iframe.src = String(JS);
  1315. iframeDocument = iframe.contentWindow.document;
  1316. iframeDocument.open();
  1317. iframeDocument.write(scriptTag('document.F=Object'));
  1318. iframeDocument.close();
  1319. return iframeDocument.F;
  1320. };
  1321. // Check for document.domain and active x support
  1322. // No need to use active x approach when document.domain is not set
  1323. // see https://github.com/es-shims/es5-shim/issues/150
  1324. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  1325. // avoid IE GC bug
  1326. var activeXDocument;
  1327. var NullProtoObject = function () {
  1328. try {
  1329. /* global ActiveXObject -- old IE */
  1330. activeXDocument = document.domain && new ActiveXObject('htmlfile');
  1331. } catch (error) { /* ignore */ }
  1332. NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
  1333. var length = enumBugKeys.length;
  1334. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  1335. return NullProtoObject();
  1336. };
  1337. hiddenKeys$1[IE_PROTO] = true;
  1338. // `Object.create` method
  1339. // https://tc39.es/ecma262/#sec-object.create
  1340. var objectCreate = Object.create || function create(O, Properties) {
  1341. var result;
  1342. if (O !== null) {
  1343. EmptyConstructor[PROTOTYPE] = anObject(O);
  1344. result = new EmptyConstructor();
  1345. EmptyConstructor[PROTOTYPE] = null;
  1346. // add "__proto__" for Object.getPrototypeOf polyfill
  1347. result[IE_PROTO] = O;
  1348. } else result = NullProtoObject();
  1349. return Properties === undefined ? result : objectDefineProperties(result, Properties);
  1350. };
  1351. var UNSCOPABLES = wellKnownSymbol('unscopables');
  1352. var ArrayPrototype = Array.prototype;
  1353. // Array.prototype[@@unscopables]
  1354. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1355. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  1356. objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
  1357. configurable: true,
  1358. value: objectCreate(null)
  1359. });
  1360. }
  1361. // add a key to Array.prototype[@@unscopables]
  1362. var addToUnscopables = function (key) {
  1363. ArrayPrototype[UNSCOPABLES][key] = true;
  1364. };
  1365. var $find = arrayIteration.find;
  1366. var FIND = 'find';
  1367. var SKIPS_HOLES = true;
  1368. // Shouldn't skip holes
  1369. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  1370. // `Array.prototype.find` method
  1371. // https://tc39.es/ecma262/#sec-array.prototype.find
  1372. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  1373. find: function find(callbackfn /* , that = undefined */) {
  1374. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1375. }
  1376. });
  1377. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1378. addToUnscopables(FIND);
  1379. var propertyIsEnumerable = objectPropertyIsEnumerable.f;
  1380. // `Object.{ entries, values }` methods implementation
  1381. var createMethod = function (TO_ENTRIES) {
  1382. return function (it) {
  1383. var O = toIndexedObject(it);
  1384. var keys = objectKeys(O);
  1385. var length = keys.length;
  1386. var i = 0;
  1387. var result = [];
  1388. var key;
  1389. while (length > i) {
  1390. key = keys[i++];
  1391. if (!descriptors || propertyIsEnumerable.call(O, key)) {
  1392. result.push(TO_ENTRIES ? [key, O[key]] : O[key]);
  1393. }
  1394. }
  1395. return result;
  1396. };
  1397. };
  1398. var objectToArray = {
  1399. // `Object.entries` method
  1400. // https://tc39.es/ecma262/#sec-object.entries
  1401. entries: createMethod(true),
  1402. // `Object.values` method
  1403. // https://tc39.es/ecma262/#sec-object.values
  1404. values: createMethod(false)
  1405. };
  1406. var $entries = objectToArray.entries;
  1407. // `Object.entries` method
  1408. // https://tc39.es/ecma262/#sec-object.entries
  1409. _export({ target: 'Object', stat: true }, {
  1410. entries: function entries(O) {
  1411. return $entries(O);
  1412. }
  1413. });
  1414. /* eslint-disable no-unused-vars */
  1415. /**
  1416. * @author zhixin wen <wenzhixin2010@gmail.com>
  1417. * extensions: https://github.com/vitalets/x-editable
  1418. */
  1419. var Utils = $__default['default'].fn.bootstrapTable.utils;
  1420. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults, {
  1421. editable: true,
  1422. onEditableInit: function onEditableInit() {
  1423. return false;
  1424. },
  1425. onEditableSave: function onEditableSave(field, row, rowIndex, oldValue, $el) {
  1426. return false;
  1427. },
  1428. onEditableShown: function onEditableShown(field, row, $el, editable) {
  1429. return false;
  1430. },
  1431. onEditableHidden: function onEditableHidden(field, row, $el, reason) {
  1432. return false;
  1433. }
  1434. });
  1435. $__default['default'].extend($__default['default'].fn.bootstrapTable.columnDefaults, {
  1436. alwaysUseFormatter: false
  1437. });
  1438. $__default['default'].extend($__default['default'].fn.bootstrapTable.Constructor.EVENTS, {
  1439. 'editable-init.bs.table': 'onEditableInit',
  1440. 'editable-save.bs.table': 'onEditableSave',
  1441. 'editable-shown.bs.table': 'onEditableShown',
  1442. 'editable-hidden.bs.table': 'onEditableHidden'
  1443. });
  1444. $__default['default'].BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
  1445. _inherits(_class, _$$BootstrapTable);
  1446. var _super = _createSuper(_class);
  1447. function _class() {
  1448. _classCallCheck(this, _class);
  1449. return _super.apply(this, arguments);
  1450. }
  1451. _createClass(_class, [{
  1452. key: "initTable",
  1453. value: function initTable() {
  1454. var _this = this;
  1455. _get(_getPrototypeOf(_class.prototype), "initTable", this).call(this);
  1456. if (!this.options.editable) {
  1457. return;
  1458. }
  1459. this.editedCells = [];
  1460. $__default['default'].each(this.columns, function (i, column) {
  1461. if (!column.editable) {
  1462. return;
  1463. }
  1464. var editableOptions = {};
  1465. var editableDataMarkup = [];
  1466. var editableDataPrefix = 'editable-';
  1467. var processDataOptions = function processDataOptions(key, value) {
  1468. // Replace camel case with dashes.
  1469. var dashKey = key.replace(/([A-Z])/g, function ($1) {
  1470. return "-".concat($1.toLowerCase());
  1471. });
  1472. if (dashKey.indexOf(editableDataPrefix) === 0) {
  1473. editableOptions[dashKey.replace(editableDataPrefix, 'data-')] = value;
  1474. }
  1475. };
  1476. $__default['default'].each(_this.options, processDataOptions);
  1477. column.formatter = column.formatter || function (value) {
  1478. return value;
  1479. };
  1480. column._formatter = column._formatter ? column._formatter : column.formatter;
  1481. column.formatter = function (value, row, index) {
  1482. var result = Utils.calculateObjectValue(column, column._formatter, [value, row, index], value);
  1483. result = typeof result === 'undefined' || result === null ? _this.options.undefinedText : result;
  1484. if (_this.options.uniqueId !== undefined && !column.alwaysUseFormatter) {
  1485. var uniqueId = Utils.getItemField(row, _this.options.uniqueId, false);
  1486. if ($__default['default'].inArray(column.field + uniqueId, _this.editedCells) !== -1) {
  1487. result = value;
  1488. }
  1489. }
  1490. $__default['default'].each(column, processDataOptions);
  1491. $__default['default'].each(editableOptions, function (key, value) {
  1492. editableDataMarkup.push(" ".concat(key, "=\"").concat(value, "\""));
  1493. });
  1494. var noEditFormatter = false;
  1495. var editableOpts = Utils.calculateObjectValue(column, column.editable, [index, row], {});
  1496. if (editableOpts.hasOwnProperty('noEditFormatter')) {
  1497. noEditFormatter = editableOpts.noEditFormatter(value, row, index);
  1498. }
  1499. if (noEditFormatter === false) {
  1500. return "<a href=\"javascript:void(0)\"\n data-name=\"".concat(column.field, "\"\n data-pk=\"").concat(row[_this.options.idField], "\"\n data-value=\"").concat(result, "\"\n ").concat(editableDataMarkup.join(''), "></a>");
  1501. }
  1502. return noEditFormatter;
  1503. };
  1504. });
  1505. }
  1506. }, {
  1507. key: "initBody",
  1508. value: function initBody(fixedScroll) {
  1509. var _this2 = this;
  1510. _get(_getPrototypeOf(_class.prototype), "initBody", this).call(this, fixedScroll);
  1511. if (!this.options.editable) {
  1512. return;
  1513. }
  1514. $__default['default'].each(this.columns, function (i, column) {
  1515. if (!column.editable) {
  1516. return;
  1517. }
  1518. var data = _this2.getData({
  1519. escape: true
  1520. });
  1521. var $field = _this2.$body.find("a[data-name=\"".concat(column.field, "\"]"));
  1522. $field.each(function (i, element) {
  1523. var $element = $__default['default'](element);
  1524. var $tr = $element.closest('tr');
  1525. var index = $tr.data('index');
  1526. var row = data[index];
  1527. var editableOpts = Utils.calculateObjectValue(column, column.editable, [index, row, $element], {});
  1528. $element.editable(editableOpts);
  1529. });
  1530. $field.off('save').on('save', function (_ref, _ref2) {
  1531. var currentTarget = _ref.currentTarget;
  1532. var submitValue = _ref2.submitValue;
  1533. var $this = $__default['default'](currentTarget);
  1534. var data = _this2.getData();
  1535. var rowIndex = $this.parents('tr[data-index]').data('index');
  1536. var row = data[rowIndex];
  1537. var oldValue = row[column.field];
  1538. if (_this2.options.uniqueId !== undefined && !column.alwaysUseFormatter) {
  1539. var uniqueId = Utils.getItemField(row, _this2.options.uniqueId, false);
  1540. if ($__default['default'].inArray(column.field + uniqueId, _this2.editedCells) === -1) {
  1541. _this2.editedCells.push(column.field + uniqueId);
  1542. }
  1543. }
  1544. submitValue = Utils.escapeHTML(submitValue);
  1545. $this.data('value', submitValue);
  1546. row[column.field] = submitValue;
  1547. _this2.trigger('editable-save', column.field, row, rowIndex, oldValue, $this);
  1548. _this2.initBody();
  1549. });
  1550. $field.off('shown').on('shown', function (_ref3, editable) {
  1551. var currentTarget = _ref3.currentTarget;
  1552. var $this = $__default['default'](currentTarget);
  1553. var data = _this2.getData();
  1554. var rowIndex = $this.parents('tr[data-index]').data('index');
  1555. var row = data[rowIndex];
  1556. _this2.trigger('editable-shown', column.field, row, $this, editable);
  1557. });
  1558. $field.off('hidden').on('hidden', function (_ref4, reason) {
  1559. var currentTarget = _ref4.currentTarget;
  1560. var $this = $__default['default'](currentTarget);
  1561. var data = _this2.getData();
  1562. var rowIndex = $this.parents('tr[data-index]').data('index');
  1563. var row = data[rowIndex];
  1564. _this2.trigger('editable-hidden', column.field, row, $this, reason);
  1565. });
  1566. });
  1567. this.trigger('editable-init');
  1568. }
  1569. }, {
  1570. key: "getData",
  1571. value: function getData(params) {
  1572. var data = _get(_getPrototypeOf(_class.prototype), "getData", this).call(this, params);
  1573. if (params && params.escape) {
  1574. var _iterator = _createForOfIteratorHelper(data),
  1575. _step;
  1576. try {
  1577. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  1578. var row = _step.value;
  1579. for (var _i = 0, _Object$entries = Object.entries(row); _i < _Object$entries.length; _i++) {
  1580. var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
  1581. key = _Object$entries$_i[0],
  1582. value = _Object$entries$_i[1];
  1583. row[key] = Utils.unescapeHTML(value);
  1584. }
  1585. }
  1586. } catch (err) {
  1587. _iterator.e(err);
  1588. } finally {
  1589. _iterator.f();
  1590. }
  1591. }
  1592. return data;
  1593. }
  1594. }]);
  1595. return _class;
  1596. }($__default['default'].BootstrapTable);
  1597. })));