bootstrap-table-treegrid.js 51 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546
  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. Object.defineProperty(Constructor, "prototype", {
  26. writable: false
  27. });
  28. return Constructor;
  29. }
  30. function _inherits(subClass, superClass) {
  31. if (typeof superClass !== "function" && superClass !== null) {
  32. throw new TypeError("Super expression must either be null or a function");
  33. }
  34. subClass.prototype = Object.create(superClass && superClass.prototype, {
  35. constructor: {
  36. value: subClass,
  37. writable: true,
  38. configurable: true
  39. }
  40. });
  41. Object.defineProperty(subClass, "prototype", {
  42. writable: false
  43. });
  44. if (superClass) _setPrototypeOf(subClass, superClass);
  45. }
  46. function _getPrototypeOf(o) {
  47. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  48. return o.__proto__ || Object.getPrototypeOf(o);
  49. };
  50. return _getPrototypeOf(o);
  51. }
  52. function _setPrototypeOf(o, p) {
  53. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  54. o.__proto__ = p;
  55. return o;
  56. };
  57. return _setPrototypeOf(o, p);
  58. }
  59. function _isNativeReflectConstruct() {
  60. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  61. if (Reflect.construct.sham) return false;
  62. if (typeof Proxy === "function") return true;
  63. try {
  64. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  65. return true;
  66. } catch (e) {
  67. return false;
  68. }
  69. }
  70. function _assertThisInitialized(self) {
  71. if (self === void 0) {
  72. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  73. }
  74. return self;
  75. }
  76. function _possibleConstructorReturn(self, call) {
  77. if (call && (typeof call === "object" || typeof call === "function")) {
  78. return call;
  79. } else if (call !== void 0) {
  80. throw new TypeError("Derived constructors may only return object or undefined");
  81. }
  82. return _assertThisInitialized(self);
  83. }
  84. function _createSuper(Derived) {
  85. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  86. return function _createSuperInternal() {
  87. var Super = _getPrototypeOf(Derived),
  88. result;
  89. if (hasNativeReflectConstruct) {
  90. var NewTarget = _getPrototypeOf(this).constructor;
  91. result = Reflect.construct(Super, arguments, NewTarget);
  92. } else {
  93. result = Super.apply(this, arguments);
  94. }
  95. return _possibleConstructorReturn(this, result);
  96. };
  97. }
  98. function _superPropBase(object, property) {
  99. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  100. object = _getPrototypeOf(object);
  101. if (object === null) break;
  102. }
  103. return object;
  104. }
  105. function _get() {
  106. if (typeof Reflect !== "undefined" && Reflect.get) {
  107. _get = Reflect.get;
  108. } else {
  109. _get = function _get(target, property, receiver) {
  110. var base = _superPropBase(target, property);
  111. if (!base) return;
  112. var desc = Object.getOwnPropertyDescriptor(base, property);
  113. if (desc.get) {
  114. return desc.get.call(arguments.length < 3 ? target : receiver);
  115. }
  116. return desc.value;
  117. };
  118. }
  119. return _get.apply(this, arguments);
  120. }
  121. function _unsupportedIterableToArray(o, minLen) {
  122. if (!o) return;
  123. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  124. var n = Object.prototype.toString.call(o).slice(8, -1);
  125. if (n === "Object" && o.constructor) n = o.constructor.name;
  126. if (n === "Map" || n === "Set") return Array.from(o);
  127. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  128. }
  129. function _arrayLikeToArray(arr, len) {
  130. if (len == null || len > arr.length) len = arr.length;
  131. for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
  132. return arr2;
  133. }
  134. function _createForOfIteratorHelper(o, allowArrayLike) {
  135. var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
  136. if (!it) {
  137. if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
  138. if (it) o = it;
  139. var i = 0;
  140. var F = function () {};
  141. return {
  142. s: F,
  143. n: function () {
  144. if (i >= o.length) return {
  145. done: true
  146. };
  147. return {
  148. done: false,
  149. value: o[i++]
  150. };
  151. },
  152. e: function (e) {
  153. throw e;
  154. },
  155. f: F
  156. };
  157. }
  158. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  159. }
  160. var normalCompletion = true,
  161. didErr = false,
  162. err;
  163. return {
  164. s: function () {
  165. it = it.call(o);
  166. },
  167. n: function () {
  168. var step = it.next();
  169. normalCompletion = step.done;
  170. return step;
  171. },
  172. e: function (e) {
  173. didErr = true;
  174. err = e;
  175. },
  176. f: function () {
  177. try {
  178. if (!normalCompletion && it.return != null) it.return();
  179. } finally {
  180. if (didErr) throw err;
  181. }
  182. }
  183. };
  184. }
  185. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  186. function createCommonjsModule(fn, module) {
  187. return module = { exports: {} }, fn(module, module.exports), module.exports;
  188. }
  189. var check = function (it) {
  190. return it && it.Math == Math && it;
  191. };
  192. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  193. var global_1 =
  194. // eslint-disable-next-line es/no-global-this -- safe
  195. check(typeof globalThis == 'object' && globalThis) ||
  196. check(typeof window == 'object' && window) ||
  197. // eslint-disable-next-line no-restricted-globals -- safe
  198. check(typeof self == 'object' && self) ||
  199. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  200. // eslint-disable-next-line no-new-func -- fallback
  201. (function () { return this; })() || Function('return this')();
  202. var fails = function (exec) {
  203. try {
  204. return !!exec();
  205. } catch (error) {
  206. return true;
  207. }
  208. };
  209. // Detect IE8's incomplete defineProperty implementation
  210. var descriptors = !fails(function () {
  211. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  212. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  213. });
  214. var functionBindNative = !fails(function () {
  215. var test = (function () { /* empty */ }).bind();
  216. // eslint-disable-next-line no-prototype-builtins -- safe
  217. return typeof test != 'function' || test.hasOwnProperty('prototype');
  218. });
  219. var call$1 = Function.prototype.call;
  220. var functionCall = functionBindNative ? call$1.bind(call$1) : function () {
  221. return call$1.apply(call$1, arguments);
  222. };
  223. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  224. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  225. var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  226. // Nashorn ~ JDK8 bug
  227. var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  228. // `Object.prototype.propertyIsEnumerable` method implementation
  229. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  230. var f$4 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  231. var descriptor = getOwnPropertyDescriptor$1(this, V);
  232. return !!descriptor && descriptor.enumerable;
  233. } : $propertyIsEnumerable;
  234. var objectPropertyIsEnumerable = {
  235. f: f$4
  236. };
  237. var createPropertyDescriptor = function (bitmap, value) {
  238. return {
  239. enumerable: !(bitmap & 1),
  240. configurable: !(bitmap & 2),
  241. writable: !(bitmap & 4),
  242. value: value
  243. };
  244. };
  245. var FunctionPrototype$1 = Function.prototype;
  246. var bind$1 = FunctionPrototype$1.bind;
  247. var call = FunctionPrototype$1.call;
  248. var uncurryThis = functionBindNative && bind$1.bind(call, call);
  249. var functionUncurryThis = functionBindNative ? function (fn) {
  250. return fn && uncurryThis(fn);
  251. } : function (fn) {
  252. return fn && function () {
  253. return call.apply(fn, arguments);
  254. };
  255. };
  256. var toString$1 = functionUncurryThis({}.toString);
  257. var stringSlice = functionUncurryThis(''.slice);
  258. var classofRaw = function (it) {
  259. return stringSlice(toString$1(it), 8, -1);
  260. };
  261. var Object$4 = global_1.Object;
  262. var split = functionUncurryThis(''.split);
  263. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  264. var indexedObject = fails(function () {
  265. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  266. // eslint-disable-next-line no-prototype-builtins -- safe
  267. return !Object$4('z').propertyIsEnumerable(0);
  268. }) ? function (it) {
  269. return classofRaw(it) == 'String' ? split(it, '') : Object$4(it);
  270. } : Object$4;
  271. var TypeError$8 = global_1.TypeError;
  272. // `RequireObjectCoercible` abstract operation
  273. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  274. var requireObjectCoercible = function (it) {
  275. if (it == undefined) throw TypeError$8("Can't call method on " + it);
  276. return it;
  277. };
  278. // toObject with fallback for non-array-like ES3 strings
  279. var toIndexedObject = function (it) {
  280. return indexedObject(requireObjectCoercible(it));
  281. };
  282. // `IsCallable` abstract operation
  283. // https://tc39.es/ecma262/#sec-iscallable
  284. var isCallable = function (argument) {
  285. return typeof argument == 'function';
  286. };
  287. var isObject = function (it) {
  288. return typeof it == 'object' ? it !== null : isCallable(it);
  289. };
  290. var aFunction = function (argument) {
  291. return isCallable(argument) ? argument : undefined;
  292. };
  293. var getBuiltIn = function (namespace, method) {
  294. return arguments.length < 2 ? aFunction(global_1[namespace]) : global_1[namespace] && global_1[namespace][method];
  295. };
  296. var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
  297. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  298. var process = global_1.process;
  299. var Deno = global_1.Deno;
  300. var versions = process && process.versions || Deno && Deno.version;
  301. var v8 = versions && versions.v8;
  302. var match, version;
  303. if (v8) {
  304. match = v8.split('.');
  305. // in old Chrome, versions of V8 isn't V8 = Chrome / 10
  306. // but their correct versions are not interesting for us
  307. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  308. }
  309. // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
  310. // so check `userAgent` even if `.v8` exists, but 0
  311. if (!version && engineUserAgent) {
  312. match = engineUserAgent.match(/Edge\/(\d+)/);
  313. if (!match || match[1] >= 74) {
  314. match = engineUserAgent.match(/Chrome\/(\d+)/);
  315. if (match) version = +match[1];
  316. }
  317. }
  318. var engineV8Version = version;
  319. /* eslint-disable es/no-symbol -- required for testing */
  320. // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
  321. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  322. var symbol = Symbol();
  323. // Chrome 38 Symbol has incorrect toString conversion
  324. // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
  325. return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
  326. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  327. !Symbol.sham && engineV8Version && engineV8Version < 41;
  328. });
  329. /* eslint-disable es/no-symbol -- required for testing */
  330. var useSymbolAsUid = nativeSymbol
  331. && !Symbol.sham
  332. && typeof Symbol.iterator == 'symbol';
  333. var Object$3 = global_1.Object;
  334. var isSymbol = useSymbolAsUid ? function (it) {
  335. return typeof it == 'symbol';
  336. } : function (it) {
  337. var $Symbol = getBuiltIn('Symbol');
  338. return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, Object$3(it));
  339. };
  340. var String$3 = global_1.String;
  341. var tryToString = function (argument) {
  342. try {
  343. return String$3(argument);
  344. } catch (error) {
  345. return 'Object';
  346. }
  347. };
  348. var TypeError$7 = global_1.TypeError;
  349. // `Assert: IsCallable(argument) is true`
  350. var aCallable = function (argument) {
  351. if (isCallable(argument)) return argument;
  352. throw TypeError$7(tryToString(argument) + ' is not a function');
  353. };
  354. // `GetMethod` abstract operation
  355. // https://tc39.es/ecma262/#sec-getmethod
  356. var getMethod = function (V, P) {
  357. var func = V[P];
  358. return func == null ? undefined : aCallable(func);
  359. };
  360. var TypeError$6 = global_1.TypeError;
  361. // `OrdinaryToPrimitive` abstract operation
  362. // https://tc39.es/ecma262/#sec-ordinarytoprimitive
  363. var ordinaryToPrimitive = function (input, pref) {
  364. var fn, val;
  365. if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
  366. if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
  367. if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
  368. throw TypeError$6("Can't convert object to primitive value");
  369. };
  370. // eslint-disable-next-line es/no-object-defineproperty -- safe
  371. var defineProperty = Object.defineProperty;
  372. var setGlobal = function (key, value) {
  373. try {
  374. defineProperty(global_1, key, { value: value, configurable: true, writable: true });
  375. } catch (error) {
  376. global_1[key] = value;
  377. } return value;
  378. };
  379. var SHARED = '__core-js_shared__';
  380. var store$1 = global_1[SHARED] || setGlobal(SHARED, {});
  381. var sharedStore = store$1;
  382. var shared = createCommonjsModule(function (module) {
  383. (module.exports = function (key, value) {
  384. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  385. })('versions', []).push({
  386. version: '3.21.1',
  387. mode: 'global',
  388. copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
  389. license: 'https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE',
  390. source: 'https://github.com/zloirock/core-js'
  391. });
  392. });
  393. var Object$2 = global_1.Object;
  394. // `ToObject` abstract operation
  395. // https://tc39.es/ecma262/#sec-toobject
  396. var toObject = function (argument) {
  397. return Object$2(requireObjectCoercible(argument));
  398. };
  399. var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
  400. // `HasOwnProperty` abstract operation
  401. // https://tc39.es/ecma262/#sec-hasownproperty
  402. var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
  403. return hasOwnProperty(toObject(it), key);
  404. };
  405. var id = 0;
  406. var postfix = Math.random();
  407. var toString = functionUncurryThis(1.0.toString);
  408. var uid = function (key) {
  409. return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
  410. };
  411. var WellKnownSymbolsStore = shared('wks');
  412. var Symbol$2 = global_1.Symbol;
  413. var symbolFor = Symbol$2 && Symbol$2['for'];
  414. var createWellKnownSymbol = useSymbolAsUid ? Symbol$2 : Symbol$2 && Symbol$2.withoutSetter || uid;
  415. var wellKnownSymbol = function (name) {
  416. if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
  417. var description = 'Symbol.' + name;
  418. if (nativeSymbol && hasOwnProperty_1(Symbol$2, name)) {
  419. WellKnownSymbolsStore[name] = Symbol$2[name];
  420. } else if (useSymbolAsUid && symbolFor) {
  421. WellKnownSymbolsStore[name] = symbolFor(description);
  422. } else {
  423. WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
  424. }
  425. } return WellKnownSymbolsStore[name];
  426. };
  427. var TypeError$5 = global_1.TypeError;
  428. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  429. // `ToPrimitive` abstract operation
  430. // https://tc39.es/ecma262/#sec-toprimitive
  431. var toPrimitive = function (input, pref) {
  432. if (!isObject(input) || isSymbol(input)) return input;
  433. var exoticToPrim = getMethod(input, TO_PRIMITIVE);
  434. var result;
  435. if (exoticToPrim) {
  436. if (pref === undefined) pref = 'default';
  437. result = functionCall(exoticToPrim, input, pref);
  438. if (!isObject(result) || isSymbol(result)) return result;
  439. throw TypeError$5("Can't convert object to primitive value");
  440. }
  441. if (pref === undefined) pref = 'number';
  442. return ordinaryToPrimitive(input, pref);
  443. };
  444. // `ToPropertyKey` abstract operation
  445. // https://tc39.es/ecma262/#sec-topropertykey
  446. var toPropertyKey = function (argument) {
  447. var key = toPrimitive(argument, 'string');
  448. return isSymbol(key) ? key : key + '';
  449. };
  450. var document = global_1.document;
  451. // typeof document.createElement is 'object' in old IE
  452. var EXISTS$1 = isObject(document) && isObject(document.createElement);
  453. var documentCreateElement = function (it) {
  454. return EXISTS$1 ? document.createElement(it) : {};
  455. };
  456. // Thanks to IE8 for its funny defineProperty
  457. var ie8DomDefine = !descriptors && !fails(function () {
  458. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  459. return Object.defineProperty(documentCreateElement('div'), 'a', {
  460. get: function () { return 7; }
  461. }).a != 7;
  462. });
  463. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  464. var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  465. // `Object.getOwnPropertyDescriptor` method
  466. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  467. var f$3 = descriptors ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
  468. O = toIndexedObject(O);
  469. P = toPropertyKey(P);
  470. if (ie8DomDefine) try {
  471. return $getOwnPropertyDescriptor$1(O, P);
  472. } catch (error) { /* empty */ }
  473. if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
  474. };
  475. var objectGetOwnPropertyDescriptor = {
  476. f: f$3
  477. };
  478. // V8 ~ Chrome 36-
  479. // https://bugs.chromium.org/p/v8/issues/detail?id=3334
  480. var v8PrototypeDefineBug = descriptors && fails(function () {
  481. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  482. return Object.defineProperty(function () { /* empty */ }, 'prototype', {
  483. value: 42,
  484. writable: false
  485. }).prototype != 42;
  486. });
  487. var String$2 = global_1.String;
  488. var TypeError$4 = global_1.TypeError;
  489. // `Assert: Type(argument) is Object`
  490. var anObject = function (argument) {
  491. if (isObject(argument)) return argument;
  492. throw TypeError$4(String$2(argument) + ' is not an object');
  493. };
  494. var TypeError$3 = global_1.TypeError;
  495. // eslint-disable-next-line es/no-object-defineproperty -- safe
  496. var $defineProperty = Object.defineProperty;
  497. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  498. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  499. var ENUMERABLE = 'enumerable';
  500. var CONFIGURABLE$1 = 'configurable';
  501. var WRITABLE = 'writable';
  502. // `Object.defineProperty` method
  503. // https://tc39.es/ecma262/#sec-object.defineproperty
  504. var f$2 = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) {
  505. anObject(O);
  506. P = toPropertyKey(P);
  507. anObject(Attributes);
  508. if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  509. var current = $getOwnPropertyDescriptor(O, P);
  510. if (current && current[WRITABLE]) {
  511. O[P] = Attributes.value;
  512. Attributes = {
  513. configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
  514. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  515. writable: false
  516. };
  517. }
  518. } return $defineProperty(O, P, Attributes);
  519. } : $defineProperty : function defineProperty(O, P, Attributes) {
  520. anObject(O);
  521. P = toPropertyKey(P);
  522. anObject(Attributes);
  523. if (ie8DomDefine) try {
  524. return $defineProperty(O, P, Attributes);
  525. } catch (error) { /* empty */ }
  526. if ('get' in Attributes || 'set' in Attributes) throw TypeError$3('Accessors not supported');
  527. if ('value' in Attributes) O[P] = Attributes.value;
  528. return O;
  529. };
  530. var objectDefineProperty = {
  531. f: f$2
  532. };
  533. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  534. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  535. } : function (object, key, value) {
  536. object[key] = value;
  537. return object;
  538. };
  539. var functionToString = functionUncurryThis(Function.toString);
  540. // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
  541. if (!isCallable(sharedStore.inspectSource)) {
  542. sharedStore.inspectSource = function (it) {
  543. return functionToString(it);
  544. };
  545. }
  546. var inspectSource = sharedStore.inspectSource;
  547. var WeakMap$1 = global_1.WeakMap;
  548. var nativeWeakMap = isCallable(WeakMap$1) && /native code/.test(inspectSource(WeakMap$1));
  549. var keys = shared('keys');
  550. var sharedKey = function (key) {
  551. return keys[key] || (keys[key] = uid(key));
  552. };
  553. var hiddenKeys$1 = {};
  554. var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
  555. var TypeError$2 = global_1.TypeError;
  556. var WeakMap = global_1.WeakMap;
  557. var set, get, has;
  558. var enforce = function (it) {
  559. return has(it) ? get(it) : set(it, {});
  560. };
  561. var getterFor = function (TYPE) {
  562. return function (it) {
  563. var state;
  564. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  565. throw TypeError$2('Incompatible receiver, ' + TYPE + ' required');
  566. } return state;
  567. };
  568. };
  569. if (nativeWeakMap || sharedStore.state) {
  570. var store = sharedStore.state || (sharedStore.state = new WeakMap());
  571. var wmget = functionUncurryThis(store.get);
  572. var wmhas = functionUncurryThis(store.has);
  573. var wmset = functionUncurryThis(store.set);
  574. set = function (it, metadata) {
  575. if (wmhas(store, it)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
  576. metadata.facade = it;
  577. wmset(store, it, metadata);
  578. return metadata;
  579. };
  580. get = function (it) {
  581. return wmget(store, it) || {};
  582. };
  583. has = function (it) {
  584. return wmhas(store, it);
  585. };
  586. } else {
  587. var STATE = sharedKey('state');
  588. hiddenKeys$1[STATE] = true;
  589. set = function (it, metadata) {
  590. if (hasOwnProperty_1(it, STATE)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
  591. metadata.facade = it;
  592. createNonEnumerableProperty(it, STATE, metadata);
  593. return metadata;
  594. };
  595. get = function (it) {
  596. return hasOwnProperty_1(it, STATE) ? it[STATE] : {};
  597. };
  598. has = function (it) {
  599. return hasOwnProperty_1(it, STATE);
  600. };
  601. }
  602. var internalState = {
  603. set: set,
  604. get: get,
  605. has: has,
  606. enforce: enforce,
  607. getterFor: getterFor
  608. };
  609. var FunctionPrototype = Function.prototype;
  610. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  611. var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
  612. var EXISTS = hasOwnProperty_1(FunctionPrototype, 'name');
  613. // additional protection from minified / mangled / dropped function names
  614. var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
  615. var CONFIGURABLE = EXISTS && (!descriptors || (descriptors && getDescriptor(FunctionPrototype, 'name').configurable));
  616. var functionName = {
  617. EXISTS: EXISTS,
  618. PROPER: PROPER,
  619. CONFIGURABLE: CONFIGURABLE
  620. };
  621. var redefine = createCommonjsModule(function (module) {
  622. var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
  623. var getInternalState = internalState.get;
  624. var enforceInternalState = internalState.enforce;
  625. var TEMPLATE = String(String).split('String');
  626. (module.exports = function (O, key, value, options) {
  627. var unsafe = options ? !!options.unsafe : false;
  628. var simple = options ? !!options.enumerable : false;
  629. var noTargetGet = options ? !!options.noTargetGet : false;
  630. var name = options && options.name !== undefined ? options.name : key;
  631. var state;
  632. if (isCallable(value)) {
  633. if (String(name).slice(0, 7) === 'Symbol(') {
  634. name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
  635. }
  636. if (!hasOwnProperty_1(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
  637. createNonEnumerableProperty(value, 'name', name);
  638. }
  639. state = enforceInternalState(value);
  640. if (!state.source) {
  641. state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
  642. }
  643. }
  644. if (O === global_1) {
  645. if (simple) O[key] = value;
  646. else setGlobal(key, value);
  647. return;
  648. } else if (!unsafe) {
  649. delete O[key];
  650. } else if (!noTargetGet && O[key]) {
  651. simple = true;
  652. }
  653. if (simple) O[key] = value;
  654. else createNonEnumerableProperty(O, key, value);
  655. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  656. })(Function.prototype, 'toString', function toString() {
  657. return isCallable(this) && getInternalState(this).source || inspectSource(this);
  658. });
  659. });
  660. var ceil = Math.ceil;
  661. var floor = Math.floor;
  662. // `ToIntegerOrInfinity` abstract operation
  663. // https://tc39.es/ecma262/#sec-tointegerorinfinity
  664. var toIntegerOrInfinity = function (argument) {
  665. var number = +argument;
  666. // eslint-disable-next-line no-self-compare -- safe
  667. return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
  668. };
  669. var max = Math.max;
  670. var min$1 = Math.min;
  671. // Helper for a popular repeating case of the spec:
  672. // Let integer be ? ToInteger(index).
  673. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  674. var toAbsoluteIndex = function (index, length) {
  675. var integer = toIntegerOrInfinity(index);
  676. return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
  677. };
  678. var min = Math.min;
  679. // `ToLength` abstract operation
  680. // https://tc39.es/ecma262/#sec-tolength
  681. var toLength = function (argument) {
  682. return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  683. };
  684. // `LengthOfArrayLike` abstract operation
  685. // https://tc39.es/ecma262/#sec-lengthofarraylike
  686. var lengthOfArrayLike = function (obj) {
  687. return toLength(obj.length);
  688. };
  689. // `Array.prototype.{ indexOf, includes }` methods implementation
  690. var createMethod$2 = function (IS_INCLUDES) {
  691. return function ($this, el, fromIndex) {
  692. var O = toIndexedObject($this);
  693. var length = lengthOfArrayLike(O);
  694. var index = toAbsoluteIndex(fromIndex, length);
  695. var value;
  696. // Array#includes uses SameValueZero equality algorithm
  697. // eslint-disable-next-line no-self-compare -- NaN check
  698. if (IS_INCLUDES && el != el) while (length > index) {
  699. value = O[index++];
  700. // eslint-disable-next-line no-self-compare -- NaN check
  701. if (value != value) return true;
  702. // Array#indexOf ignores holes, Array#includes - not
  703. } else for (;length > index; index++) {
  704. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  705. } return !IS_INCLUDES && -1;
  706. };
  707. };
  708. var arrayIncludes = {
  709. // `Array.prototype.includes` method
  710. // https://tc39.es/ecma262/#sec-array.prototype.includes
  711. includes: createMethod$2(true),
  712. // `Array.prototype.indexOf` method
  713. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  714. indexOf: createMethod$2(false)
  715. };
  716. var indexOf = arrayIncludes.indexOf;
  717. var push$1 = functionUncurryThis([].push);
  718. var objectKeysInternal = function (object, names) {
  719. var O = toIndexedObject(object);
  720. var i = 0;
  721. var result = [];
  722. var key;
  723. for (key in O) !hasOwnProperty_1(hiddenKeys$1, key) && hasOwnProperty_1(O, key) && push$1(result, key);
  724. // Don't enum bug & hidden keys
  725. while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) {
  726. ~indexOf(result, key) || push$1(result, key);
  727. }
  728. return result;
  729. };
  730. // IE8- don't enum bug keys
  731. var enumBugKeys = [
  732. 'constructor',
  733. 'hasOwnProperty',
  734. 'isPrototypeOf',
  735. 'propertyIsEnumerable',
  736. 'toLocaleString',
  737. 'toString',
  738. 'valueOf'
  739. ];
  740. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  741. // `Object.getOwnPropertyNames` method
  742. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  743. // eslint-disable-next-line es/no-object-getownpropertynames -- safe
  744. var f$1 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  745. return objectKeysInternal(O, hiddenKeys);
  746. };
  747. var objectGetOwnPropertyNames = {
  748. f: f$1
  749. };
  750. // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
  751. var f = Object.getOwnPropertySymbols;
  752. var objectGetOwnPropertySymbols = {
  753. f: f
  754. };
  755. var concat = functionUncurryThis([].concat);
  756. // all object keys, includes non-enumerable and symbols
  757. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  758. var keys = objectGetOwnPropertyNames.f(anObject(it));
  759. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  760. return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
  761. };
  762. var copyConstructorProperties = function (target, source, exceptions) {
  763. var keys = ownKeys(source);
  764. var defineProperty = objectDefineProperty.f;
  765. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  766. for (var i = 0; i < keys.length; i++) {
  767. var key = keys[i];
  768. if (!hasOwnProperty_1(target, key) && !(exceptions && hasOwnProperty_1(exceptions, key))) {
  769. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  770. }
  771. }
  772. };
  773. var replacement = /#|\.prototype\./;
  774. var isForced = function (feature, detection) {
  775. var value = data[normalize(feature)];
  776. return value == POLYFILL ? true
  777. : value == NATIVE ? false
  778. : isCallable(detection) ? fails(detection)
  779. : !!detection;
  780. };
  781. var normalize = isForced.normalize = function (string) {
  782. return String(string).replace(replacement, '.').toLowerCase();
  783. };
  784. var data = isForced.data = {};
  785. var NATIVE = isForced.NATIVE = 'N';
  786. var POLYFILL = isForced.POLYFILL = 'P';
  787. var isForced_1 = isForced;
  788. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  789. /*
  790. options.target - name of the target object
  791. options.global - target is the global object
  792. options.stat - export as static methods of target
  793. options.proto - export as prototype methods of target
  794. options.real - real prototype method for the `pure` version
  795. options.forced - export even if the native feature is available
  796. options.bind - bind methods to the target, required for the `pure` version
  797. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  798. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  799. options.sham - add a flag to not completely full polyfills
  800. options.enumerable - export as enumerable property
  801. options.noTargetGet - prevent calling a getter on target
  802. options.name - the .name of the function if it does not match the key
  803. */
  804. var _export = function (options, source) {
  805. var TARGET = options.target;
  806. var GLOBAL = options.global;
  807. var STATIC = options.stat;
  808. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  809. if (GLOBAL) {
  810. target = global_1;
  811. } else if (STATIC) {
  812. target = global_1[TARGET] || setGlobal(TARGET, {});
  813. } else {
  814. target = (global_1[TARGET] || {}).prototype;
  815. }
  816. if (target) for (key in source) {
  817. sourceProperty = source[key];
  818. if (options.noTargetGet) {
  819. descriptor = getOwnPropertyDescriptor(target, key);
  820. targetProperty = descriptor && descriptor.value;
  821. } else targetProperty = target[key];
  822. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  823. // contained in target
  824. if (!FORCED && targetProperty !== undefined) {
  825. if (typeof sourceProperty == typeof targetProperty) continue;
  826. copyConstructorProperties(sourceProperty, targetProperty);
  827. }
  828. // add a flag to not completely full polyfills
  829. if (options.sham || (targetProperty && targetProperty.sham)) {
  830. createNonEnumerableProperty(sourceProperty, 'sham', true);
  831. }
  832. // extend global
  833. redefine(target, key, sourceProperty, options);
  834. }
  835. };
  836. // `IsArray` abstract operation
  837. // https://tc39.es/ecma262/#sec-isarray
  838. // eslint-disable-next-line es/no-array-isarray -- safe
  839. var isArray = Array.isArray || function isArray(argument) {
  840. return classofRaw(argument) == 'Array';
  841. };
  842. var createProperty = function (object, key, value) {
  843. var propertyKey = toPropertyKey(key);
  844. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  845. else object[propertyKey] = value;
  846. };
  847. var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
  848. var test = {};
  849. test[TO_STRING_TAG$1] = 'z';
  850. var toStringTagSupport = String(test) === '[object z]';
  851. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  852. var Object$1 = global_1.Object;
  853. // ES3 wrong here
  854. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  855. // fallback for IE11 Script Access Denied error
  856. var tryGet = function (it, key) {
  857. try {
  858. return it[key];
  859. } catch (error) { /* empty */ }
  860. };
  861. // getting tag from ES6+ `Object.prototype.toString`
  862. var classof = toStringTagSupport ? classofRaw : function (it) {
  863. var O, tag, result;
  864. return it === undefined ? 'Undefined' : it === null ? 'Null'
  865. // @@toStringTag case
  866. : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
  867. // builtinTag case
  868. : CORRECT_ARGUMENTS ? classofRaw(O)
  869. // ES3 arguments fallback
  870. : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
  871. };
  872. var noop = function () { /* empty */ };
  873. var empty = [];
  874. var construct = getBuiltIn('Reflect', 'construct');
  875. var constructorRegExp = /^\s*(?:class|function)\b/;
  876. var exec$1 = functionUncurryThis(constructorRegExp.exec);
  877. var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
  878. var isConstructorModern = function isConstructor(argument) {
  879. if (!isCallable(argument)) return false;
  880. try {
  881. construct(noop, empty, argument);
  882. return true;
  883. } catch (error) {
  884. return false;
  885. }
  886. };
  887. var isConstructorLegacy = function isConstructor(argument) {
  888. if (!isCallable(argument)) return false;
  889. switch (classof(argument)) {
  890. case 'AsyncFunction':
  891. case 'GeneratorFunction':
  892. case 'AsyncGeneratorFunction': return false;
  893. }
  894. try {
  895. // we can't check .prototype since constructors produced by .bind haven't it
  896. // `Function#toString` throws on some built-it function in some legacy engines
  897. // (for example, `DOMQuad` and similar in FF41-)
  898. return INCORRECT_TO_STRING || !!exec$1(constructorRegExp, inspectSource(argument));
  899. } catch (error) {
  900. return true;
  901. }
  902. };
  903. isConstructorLegacy.sham = true;
  904. // `IsConstructor` abstract operation
  905. // https://tc39.es/ecma262/#sec-isconstructor
  906. var isConstructor = !construct || fails(function () {
  907. var called;
  908. return isConstructorModern(isConstructorModern.call)
  909. || !isConstructorModern(Object)
  910. || !isConstructorModern(function () { called = true; })
  911. || called;
  912. }) ? isConstructorLegacy : isConstructorModern;
  913. var SPECIES$1 = wellKnownSymbol('species');
  914. var Array$1 = global_1.Array;
  915. // a part of `ArraySpeciesCreate` abstract operation
  916. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  917. var arraySpeciesConstructor = function (originalArray) {
  918. var C;
  919. if (isArray(originalArray)) {
  920. C = originalArray.constructor;
  921. // cross-realm fallback
  922. if (isConstructor(C) && (C === Array$1 || isArray(C.prototype))) C = undefined;
  923. else if (isObject(C)) {
  924. C = C[SPECIES$1];
  925. if (C === null) C = undefined;
  926. }
  927. } return C === undefined ? Array$1 : C;
  928. };
  929. // `ArraySpeciesCreate` abstract operation
  930. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  931. var arraySpeciesCreate = function (originalArray, length) {
  932. return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
  933. };
  934. var SPECIES = wellKnownSymbol('species');
  935. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  936. // We can't use this feature detection in V8 since it causes
  937. // deoptimization and serious performance degradation
  938. // https://github.com/zloirock/core-js/issues/677
  939. return engineV8Version >= 51 || !fails(function () {
  940. var array = [];
  941. var constructor = array.constructor = {};
  942. constructor[SPECIES] = function () {
  943. return { foo: 1 };
  944. };
  945. return array[METHOD_NAME](Boolean).foo !== 1;
  946. });
  947. };
  948. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  949. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  950. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  951. var TypeError$1 = global_1.TypeError;
  952. // We can't use this feature detection in V8 since it causes
  953. // deoptimization and serious performance degradation
  954. // https://github.com/zloirock/core-js/issues/679
  955. var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
  956. var array = [];
  957. array[IS_CONCAT_SPREADABLE] = false;
  958. return array.concat()[0] !== array;
  959. });
  960. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  961. var isConcatSpreadable = function (O) {
  962. if (!isObject(O)) return false;
  963. var spreadable = O[IS_CONCAT_SPREADABLE];
  964. return spreadable !== undefined ? !!spreadable : isArray(O);
  965. };
  966. var FORCED$1 = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  967. // `Array.prototype.concat` method
  968. // https://tc39.es/ecma262/#sec-array.prototype.concat
  969. // with adding support of @@isConcatSpreadable and @@species
  970. _export({ target: 'Array', proto: true, forced: FORCED$1 }, {
  971. // eslint-disable-next-line no-unused-vars -- required for `.length`
  972. concat: function concat(arg) {
  973. var O = toObject(this);
  974. var A = arraySpeciesCreate(O, 0);
  975. var n = 0;
  976. var i, k, length, len, E;
  977. for (i = -1, length = arguments.length; i < length; i++) {
  978. E = i === -1 ? O : arguments[i];
  979. if (isConcatSpreadable(E)) {
  980. len = lengthOfArrayLike(E);
  981. if (n + len > MAX_SAFE_INTEGER) throw TypeError$1(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  982. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  983. } else {
  984. if (n >= MAX_SAFE_INTEGER) throw TypeError$1(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  985. createProperty(A, n++, E);
  986. }
  987. }
  988. A.length = n;
  989. return A;
  990. }
  991. });
  992. var bind = functionUncurryThis(functionUncurryThis.bind);
  993. // optional / simple context binding
  994. var functionBindContext = function (fn, that) {
  995. aCallable(fn);
  996. return that === undefined ? fn : functionBindNative ? bind(fn, that) : function (/* ...args */) {
  997. return fn.apply(that, arguments);
  998. };
  999. };
  1000. var push = functionUncurryThis([].push);
  1001. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
  1002. var createMethod$1 = function (TYPE) {
  1003. var IS_MAP = TYPE == 1;
  1004. var IS_FILTER = TYPE == 2;
  1005. var IS_SOME = TYPE == 3;
  1006. var IS_EVERY = TYPE == 4;
  1007. var IS_FIND_INDEX = TYPE == 6;
  1008. var IS_FILTER_REJECT = TYPE == 7;
  1009. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  1010. return function ($this, callbackfn, that, specificCreate) {
  1011. var O = toObject($this);
  1012. var self = indexedObject(O);
  1013. var boundFunction = functionBindContext(callbackfn, that);
  1014. var length = lengthOfArrayLike(self);
  1015. var index = 0;
  1016. var create = specificCreate || arraySpeciesCreate;
  1017. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
  1018. var value, result;
  1019. for (;length > index; index++) if (NO_HOLES || index in self) {
  1020. value = self[index];
  1021. result = boundFunction(value, index, O);
  1022. if (TYPE) {
  1023. if (IS_MAP) target[index] = result; // map
  1024. else if (result) switch (TYPE) {
  1025. case 3: return true; // some
  1026. case 5: return value; // find
  1027. case 6: return index; // findIndex
  1028. case 2: push(target, value); // filter
  1029. } else switch (TYPE) {
  1030. case 4: return false; // every
  1031. case 7: push(target, value); // filterReject
  1032. }
  1033. }
  1034. }
  1035. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  1036. };
  1037. };
  1038. var arrayIteration = {
  1039. // `Array.prototype.forEach` method
  1040. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  1041. forEach: createMethod$1(0),
  1042. // `Array.prototype.map` method
  1043. // https://tc39.es/ecma262/#sec-array.prototype.map
  1044. map: createMethod$1(1),
  1045. // `Array.prototype.filter` method
  1046. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1047. filter: createMethod$1(2),
  1048. // `Array.prototype.some` method
  1049. // https://tc39.es/ecma262/#sec-array.prototype.some
  1050. some: createMethod$1(3),
  1051. // `Array.prototype.every` method
  1052. // https://tc39.es/ecma262/#sec-array.prototype.every
  1053. every: createMethod$1(4),
  1054. // `Array.prototype.find` method
  1055. // https://tc39.es/ecma262/#sec-array.prototype.find
  1056. find: createMethod$1(5),
  1057. // `Array.prototype.findIndex` method
  1058. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  1059. findIndex: createMethod$1(6),
  1060. // `Array.prototype.filterReject` method
  1061. // https://github.com/tc39/proposal-array-filtering
  1062. filterReject: createMethod$1(7)
  1063. };
  1064. var $filter = arrayIteration.filter;
  1065. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
  1066. // `Array.prototype.filter` method
  1067. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1068. // with adding support of @@species
  1069. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  1070. filter: function filter(callbackfn /* , thisArg */) {
  1071. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1072. }
  1073. });
  1074. // `Object.prototype.toString` method implementation
  1075. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  1076. var objectToString = toStringTagSupport ? {}.toString : function toString() {
  1077. return '[object ' + classof(this) + ']';
  1078. };
  1079. // `Object.prototype.toString` method
  1080. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  1081. if (!toStringTagSupport) {
  1082. redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
  1083. }
  1084. var arrayMethodIsStrict = function (METHOD_NAME, argument) {
  1085. var method = [][METHOD_NAME];
  1086. return !!method && fails(function () {
  1087. // eslint-disable-next-line no-useless-call -- required for testing
  1088. method.call(null, argument || function () { return 1; }, 1);
  1089. });
  1090. };
  1091. var un$Join = functionUncurryThis([].join);
  1092. var ES3_STRINGS = indexedObject != Object;
  1093. var STRICT_METHOD = arrayMethodIsStrict('join', ',');
  1094. // `Array.prototype.join` method
  1095. // https://tc39.es/ecma262/#sec-array.prototype.join
  1096. _export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
  1097. join: function join(separator) {
  1098. return un$Join(toIndexedObject(this), separator === undefined ? ',' : separator);
  1099. }
  1100. });
  1101. var String$1 = global_1.String;
  1102. var toString_1 = function (argument) {
  1103. if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
  1104. return String$1(argument);
  1105. };
  1106. // a string of all valid unicode whitespaces
  1107. var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
  1108. '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  1109. var replace = functionUncurryThis(''.replace);
  1110. var whitespace = '[' + whitespaces + ']';
  1111. var ltrim = RegExp('^' + whitespace + whitespace + '*');
  1112. var rtrim = RegExp(whitespace + whitespace + '*$');
  1113. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  1114. var createMethod = function (TYPE) {
  1115. return function ($this) {
  1116. var string = toString_1(requireObjectCoercible($this));
  1117. if (TYPE & 1) string = replace(string, ltrim, '');
  1118. if (TYPE & 2) string = replace(string, rtrim, '');
  1119. return string;
  1120. };
  1121. };
  1122. var stringTrim = {
  1123. // `String.prototype.{ trimLeft, trimStart }` methods
  1124. // https://tc39.es/ecma262/#sec-string.prototype.trimstart
  1125. start: createMethod(1),
  1126. // `String.prototype.{ trimRight, trimEnd }` methods
  1127. // https://tc39.es/ecma262/#sec-string.prototype.trimend
  1128. end: createMethod(2),
  1129. // `String.prototype.trim` method
  1130. // https://tc39.es/ecma262/#sec-string.prototype.trim
  1131. trim: createMethod(3)
  1132. };
  1133. var trim = stringTrim.trim;
  1134. var $parseInt = global_1.parseInt;
  1135. var Symbol$1 = global_1.Symbol;
  1136. var ITERATOR = Symbol$1 && Symbol$1.iterator;
  1137. var hex = /^[+-]?0x/i;
  1138. var exec = functionUncurryThis(hex.exec);
  1139. var FORCED = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22
  1140. // MS Edge 18- broken with boxed symbols
  1141. || (ITERATOR && !fails(function () { $parseInt(Object(ITERATOR)); }));
  1142. // `parseInt` method
  1143. // https://tc39.es/ecma262/#sec-parseint-string-radix
  1144. var numberParseInt = FORCED ? function parseInt(string, radix) {
  1145. var S = trim(toString_1(string));
  1146. return $parseInt(S, (radix >>> 0) || (exec(hex, S) ? 16 : 10));
  1147. } : $parseInt;
  1148. // `parseInt` method
  1149. // https://tc39.es/ecma262/#sec-parseint-string-radix
  1150. _export({ global: true, forced: parseInt != numberParseInt }, {
  1151. parseInt: numberParseInt
  1152. });
  1153. /**
  1154. * @author: YL
  1155. * @update: zhixin wen <wenzhixin2010@gmail.com>
  1156. */
  1157. $__default["default"].extend($__default["default"].fn.bootstrapTable.defaults, {
  1158. treeEnable: false,
  1159. treeShowField: null,
  1160. idField: 'id',
  1161. parentIdField: 'pid',
  1162. rootParentId: null
  1163. });
  1164. $__default["default"].BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
  1165. _inherits(_class, _$$BootstrapTable);
  1166. var _super = _createSuper(_class);
  1167. function _class() {
  1168. _classCallCheck(this, _class);
  1169. return _super.apply(this, arguments);
  1170. }
  1171. _createClass(_class, [{
  1172. key: "init",
  1173. value: function init() {
  1174. var _get2;
  1175. this._rowStyle = this.options.rowStyle;
  1176. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1177. args[_key] = arguments[_key];
  1178. }
  1179. (_get2 = _get(_getPrototypeOf(_class.prototype), "init", this)).call.apply(_get2, [this].concat(args));
  1180. }
  1181. }, {
  1182. key: "initHeader",
  1183. value: function initHeader() {
  1184. var _get3;
  1185. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  1186. args[_key2] = arguments[_key2];
  1187. }
  1188. (_get3 = _get(_getPrototypeOf(_class.prototype), "initHeader", this)).call.apply(_get3, [this].concat(args));
  1189. var treeShowField = this.options.treeShowField;
  1190. if (treeShowField) {
  1191. var _iterator = _createForOfIteratorHelper(this.header.fields),
  1192. _step;
  1193. try {
  1194. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  1195. var field = _step.value;
  1196. if (treeShowField === field) {
  1197. this.treeEnable = true;
  1198. break;
  1199. }
  1200. }
  1201. } catch (err) {
  1202. _iterator.e(err);
  1203. } finally {
  1204. _iterator.f();
  1205. }
  1206. }
  1207. }
  1208. }, {
  1209. key: "initBody",
  1210. value: function initBody() {
  1211. var _get4;
  1212. if (this.treeEnable) {
  1213. this.options.virtualScroll = false;
  1214. }
  1215. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  1216. args[_key3] = arguments[_key3];
  1217. }
  1218. (_get4 = _get(_getPrototypeOf(_class.prototype), "initBody", this)).call.apply(_get4, [this].concat(args));
  1219. }
  1220. }, {
  1221. key: "initTr",
  1222. value: function initTr(item, idx, data, parentDom) {
  1223. var _this = this;
  1224. var nodes = data.filter(function (it) {
  1225. return item[_this.options.idField] === it[_this.options.parentIdField];
  1226. });
  1227. parentDom.append(_get(_getPrototypeOf(_class.prototype), "initRow", this).call(this, item, idx, data, parentDom)); // init sub node
  1228. var len = nodes.length - 1;
  1229. for (var i = 0; i <= len; i++) {
  1230. var node = nodes[i];
  1231. var defaultItem = $__default["default"].extend(true, {}, item);
  1232. node._level = defaultItem._level + 1;
  1233. node._parent = defaultItem;
  1234. if (i === len) {
  1235. node._last = 1;
  1236. } // jquery.treegrid.js
  1237. this.options.rowStyle = function (item, idx) {
  1238. var res = _this._rowStyle(item, idx);
  1239. var id = item[_this.options.idField] ? item[_this.options.idField] : 0;
  1240. var pid = item[_this.options.parentIdField] ? item[_this.options.parentIdField] : 0;
  1241. res.classes = [res.classes || '', "treegrid-".concat(id), "treegrid-parent-".concat(pid)].join(' ');
  1242. return res;
  1243. };
  1244. this.initTr(node, $__default["default"].inArray(node, data), data, parentDom);
  1245. }
  1246. }
  1247. }, {
  1248. key: "initRow",
  1249. value: function initRow(item, idx, data, parentDom) {
  1250. var _this2 = this;
  1251. if (this.treeEnable) {
  1252. var parentId = parseInt(item[this.options.parentIdField], 10);
  1253. if (this.options.rootParentId === parentId || !parentId) {
  1254. if (item._level === undefined) {
  1255. item._level = 0;
  1256. } // jquery.treegrid.js
  1257. this.options.rowStyle = function (item, idx) {
  1258. var res = _this2._rowStyle(item, idx);
  1259. var x = item[_this2.options.idField] ? item[_this2.options.idField] : 0;
  1260. res.classes = [res.classes || '', "treegrid-".concat(x)].join(' ');
  1261. return res;
  1262. };
  1263. this.initTr(item, idx, data, parentDom);
  1264. return true;
  1265. }
  1266. return false;
  1267. }
  1268. return _get(_getPrototypeOf(_class.prototype), "initRow", this).call(this, item, idx, data, parentDom);
  1269. }
  1270. }, {
  1271. key: "destroy",
  1272. value: function destroy() {
  1273. var _get5;
  1274. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  1275. args[_key4] = arguments[_key4];
  1276. }
  1277. (_get5 = _get(_getPrototypeOf(_class.prototype), "destroy", this)).call.apply(_get5, [this].concat(args));
  1278. this.options.rowStyle = this._rowStyle;
  1279. }
  1280. }]);
  1281. return _class;
  1282. }($__default["default"].BootstrapTable);
  1283. }));