bootstrap-table-group-by.js 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) :
  3. typeof define === 'function' && define.amd ? define(['jquery'], factory) :
  4. (global = global || self, factory(global.jQuery));
  5. }(this, (function ($) { 'use strict';
  6. $ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
  7. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  8. function createCommonjsModule(fn, module) {
  9. return module = { exports: {} }, fn(module, module.exports), module.exports;
  10. }
  11. var check = function (it) {
  12. return it && it.Math == Math && it;
  13. };
  14. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  15. var global_1 =
  16. // eslint-disable-next-line no-undef
  17. check(typeof globalThis == 'object' && globalThis) ||
  18. check(typeof window == 'object' && window) ||
  19. check(typeof self == 'object' && self) ||
  20. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  21. // eslint-disable-next-line no-new-func
  22. Function('return this')();
  23. var fails = function (exec) {
  24. try {
  25. return !!exec();
  26. } catch (error) {
  27. return true;
  28. }
  29. };
  30. // Thank's IE8 for his funny defineProperty
  31. var descriptors = !fails(function () {
  32. return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
  33. });
  34. var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
  35. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  36. // Nashorn ~ JDK8 bug
  37. var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
  38. // `Object.prototype.propertyIsEnumerable` method implementation
  39. // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
  40. var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  41. var descriptor = getOwnPropertyDescriptor(this, V);
  42. return !!descriptor && descriptor.enumerable;
  43. } : nativePropertyIsEnumerable;
  44. var objectPropertyIsEnumerable = {
  45. f: f
  46. };
  47. var createPropertyDescriptor = function (bitmap, value) {
  48. return {
  49. enumerable: !(bitmap & 1),
  50. configurable: !(bitmap & 2),
  51. writable: !(bitmap & 4),
  52. value: value
  53. };
  54. };
  55. var toString = {}.toString;
  56. var classofRaw = function (it) {
  57. return toString.call(it).slice(8, -1);
  58. };
  59. var split = ''.split;
  60. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  61. var indexedObject = fails(function () {
  62. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  63. // eslint-disable-next-line no-prototype-builtins
  64. return !Object('z').propertyIsEnumerable(0);
  65. }) ? function (it) {
  66. return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
  67. } : Object;
  68. // `RequireObjectCoercible` abstract operation
  69. // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
  70. var requireObjectCoercible = function (it) {
  71. if (it == undefined) throw TypeError("Can't call method on " + it);
  72. return it;
  73. };
  74. // toObject with fallback for non-array-like ES3 strings
  75. var toIndexedObject = function (it) {
  76. return indexedObject(requireObjectCoercible(it));
  77. };
  78. var isObject = function (it) {
  79. return typeof it === 'object' ? it !== null : typeof it === 'function';
  80. };
  81. // `ToPrimitive` abstract operation
  82. // https://tc39.github.io/ecma262/#sec-toprimitive
  83. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  84. // and the second argument - flag - preferred type is a string
  85. var toPrimitive = function (input, PREFERRED_STRING) {
  86. if (!isObject(input)) return input;
  87. var fn, val;
  88. if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  89. if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
  90. if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  91. throw TypeError("Can't convert object to primitive value");
  92. };
  93. var hasOwnProperty = {}.hasOwnProperty;
  94. var has = function (it, key) {
  95. return hasOwnProperty.call(it, key);
  96. };
  97. var document$1 = global_1.document;
  98. // typeof document.createElement is 'object' in old IE
  99. var EXISTS = isObject(document$1) && isObject(document$1.createElement);
  100. var documentCreateElement = function (it) {
  101. return EXISTS ? document$1.createElement(it) : {};
  102. };
  103. // Thank's IE8 for his funny defineProperty
  104. var ie8DomDefine = !descriptors && !fails(function () {
  105. return Object.defineProperty(documentCreateElement('div'), 'a', {
  106. get: function () { return 7; }
  107. }).a != 7;
  108. });
  109. var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  110. // `Object.getOwnPropertyDescriptor` method
  111. // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
  112. var f$1 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  113. O = toIndexedObject(O);
  114. P = toPrimitive(P, true);
  115. if (ie8DomDefine) try {
  116. return nativeGetOwnPropertyDescriptor(O, P);
  117. } catch (error) { /* empty */ }
  118. if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
  119. };
  120. var objectGetOwnPropertyDescriptor = {
  121. f: f$1
  122. };
  123. var anObject = function (it) {
  124. if (!isObject(it)) {
  125. throw TypeError(String(it) + ' is not an object');
  126. } return it;
  127. };
  128. var nativeDefineProperty = Object.defineProperty;
  129. // `Object.defineProperty` method
  130. // https://tc39.github.io/ecma262/#sec-object.defineproperty
  131. var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
  132. anObject(O);
  133. P = toPrimitive(P, true);
  134. anObject(Attributes);
  135. if (ie8DomDefine) try {
  136. return nativeDefineProperty(O, P, Attributes);
  137. } catch (error) { /* empty */ }
  138. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  139. if ('value' in Attributes) O[P] = Attributes.value;
  140. return O;
  141. };
  142. var objectDefineProperty = {
  143. f: f$2
  144. };
  145. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  146. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  147. } : function (object, key, value) {
  148. object[key] = value;
  149. return object;
  150. };
  151. var setGlobal = function (key, value) {
  152. try {
  153. createNonEnumerableProperty(global_1, key, value);
  154. } catch (error) {
  155. global_1[key] = value;
  156. } return value;
  157. };
  158. var SHARED = '__core-js_shared__';
  159. var store = global_1[SHARED] || setGlobal(SHARED, {});
  160. var sharedStore = store;
  161. var functionToString = Function.toString;
  162. // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
  163. if (typeof sharedStore.inspectSource != 'function') {
  164. sharedStore.inspectSource = function (it) {
  165. return functionToString.call(it);
  166. };
  167. }
  168. var inspectSource = sharedStore.inspectSource;
  169. var WeakMap = global_1.WeakMap;
  170. var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
  171. var shared = createCommonjsModule(function (module) {
  172. (module.exports = function (key, value) {
  173. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  174. })('versions', []).push({
  175. version: '3.6.0',
  176. mode: 'global',
  177. copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
  178. });
  179. });
  180. var id = 0;
  181. var postfix = Math.random();
  182. var uid = function (key) {
  183. return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
  184. };
  185. var keys = shared('keys');
  186. var sharedKey = function (key) {
  187. return keys[key] || (keys[key] = uid(key));
  188. };
  189. var hiddenKeys = {};
  190. var WeakMap$1 = global_1.WeakMap;
  191. var set, get, has$1;
  192. var enforce = function (it) {
  193. return has$1(it) ? get(it) : set(it, {});
  194. };
  195. var getterFor = function (TYPE) {
  196. return function (it) {
  197. var state;
  198. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  199. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  200. } return state;
  201. };
  202. };
  203. if (nativeWeakMap) {
  204. var store$1 = new WeakMap$1();
  205. var wmget = store$1.get;
  206. var wmhas = store$1.has;
  207. var wmset = store$1.set;
  208. set = function (it, metadata) {
  209. wmset.call(store$1, it, metadata);
  210. return metadata;
  211. };
  212. get = function (it) {
  213. return wmget.call(store$1, it) || {};
  214. };
  215. has$1 = function (it) {
  216. return wmhas.call(store$1, it);
  217. };
  218. } else {
  219. var STATE = sharedKey('state');
  220. hiddenKeys[STATE] = true;
  221. set = function (it, metadata) {
  222. createNonEnumerableProperty(it, STATE, metadata);
  223. return metadata;
  224. };
  225. get = function (it) {
  226. return has(it, STATE) ? it[STATE] : {};
  227. };
  228. has$1 = function (it) {
  229. return has(it, STATE);
  230. };
  231. }
  232. var internalState = {
  233. set: set,
  234. get: get,
  235. has: has$1,
  236. enforce: enforce,
  237. getterFor: getterFor
  238. };
  239. var redefine = createCommonjsModule(function (module) {
  240. var getInternalState = internalState.get;
  241. var enforceInternalState = internalState.enforce;
  242. var TEMPLATE = String(String).split('String');
  243. (module.exports = function (O, key, value, options) {
  244. var unsafe = options ? !!options.unsafe : false;
  245. var simple = options ? !!options.enumerable : false;
  246. var noTargetGet = options ? !!options.noTargetGet : false;
  247. if (typeof value == 'function') {
  248. if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key);
  249. enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
  250. }
  251. if (O === global_1) {
  252. if (simple) O[key] = value;
  253. else setGlobal(key, value);
  254. return;
  255. } else if (!unsafe) {
  256. delete O[key];
  257. } else if (!noTargetGet && O[key]) {
  258. simple = true;
  259. }
  260. if (simple) O[key] = value;
  261. else createNonEnumerableProperty(O, key, value);
  262. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  263. })(Function.prototype, 'toString', function toString() {
  264. return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
  265. });
  266. });
  267. var path = global_1;
  268. var aFunction = function (variable) {
  269. return typeof variable == 'function' ? variable : undefined;
  270. };
  271. var getBuiltIn = function (namespace, method) {
  272. return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace])
  273. : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
  274. };
  275. var ceil = Math.ceil;
  276. var floor = Math.floor;
  277. // `ToInteger` abstract operation
  278. // https://tc39.github.io/ecma262/#sec-tointeger
  279. var toInteger = function (argument) {
  280. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
  281. };
  282. var min = Math.min;
  283. // `ToLength` abstract operation
  284. // https://tc39.github.io/ecma262/#sec-tolength
  285. var toLength = function (argument) {
  286. return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  287. };
  288. var max = Math.max;
  289. var min$1 = Math.min;
  290. // Helper for a popular repeating case of the spec:
  291. // Let integer be ? ToInteger(index).
  292. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  293. var toAbsoluteIndex = function (index, length) {
  294. var integer = toInteger(index);
  295. return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
  296. };
  297. // `Array.prototype.{ indexOf, includes }` methods implementation
  298. var createMethod = function (IS_INCLUDES) {
  299. return function ($this, el, fromIndex) {
  300. var O = toIndexedObject($this);
  301. var length = toLength(O.length);
  302. var index = toAbsoluteIndex(fromIndex, length);
  303. var value;
  304. // Array#includes uses SameValueZero equality algorithm
  305. // eslint-disable-next-line no-self-compare
  306. if (IS_INCLUDES && el != el) while (length > index) {
  307. value = O[index++];
  308. // eslint-disable-next-line no-self-compare
  309. if (value != value) return true;
  310. // Array#indexOf ignores holes, Array#includes - not
  311. } else for (;length > index; index++) {
  312. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  313. } return !IS_INCLUDES && -1;
  314. };
  315. };
  316. var arrayIncludes = {
  317. // `Array.prototype.includes` method
  318. // https://tc39.github.io/ecma262/#sec-array.prototype.includes
  319. includes: createMethod(true),
  320. // `Array.prototype.indexOf` method
  321. // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
  322. indexOf: createMethod(false)
  323. };
  324. var indexOf = arrayIncludes.indexOf;
  325. var objectKeysInternal = function (object, names) {
  326. var O = toIndexedObject(object);
  327. var i = 0;
  328. var result = [];
  329. var key;
  330. for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
  331. // Don't enum bug & hidden keys
  332. while (names.length > i) if (has(O, key = names[i++])) {
  333. ~indexOf(result, key) || result.push(key);
  334. }
  335. return result;
  336. };
  337. // IE8- don't enum bug keys
  338. var enumBugKeys = [
  339. 'constructor',
  340. 'hasOwnProperty',
  341. 'isPrototypeOf',
  342. 'propertyIsEnumerable',
  343. 'toLocaleString',
  344. 'toString',
  345. 'valueOf'
  346. ];
  347. var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
  348. // `Object.getOwnPropertyNames` method
  349. // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
  350. var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  351. return objectKeysInternal(O, hiddenKeys$1);
  352. };
  353. var objectGetOwnPropertyNames = {
  354. f: f$3
  355. };
  356. var f$4 = Object.getOwnPropertySymbols;
  357. var objectGetOwnPropertySymbols = {
  358. f: f$4
  359. };
  360. // all object keys, includes non-enumerable and symbols
  361. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  362. var keys = objectGetOwnPropertyNames.f(anObject(it));
  363. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  364. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  365. };
  366. var copyConstructorProperties = function (target, source) {
  367. var keys = ownKeys(source);
  368. var defineProperty = objectDefineProperty.f;
  369. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  370. for (var i = 0; i < keys.length; i++) {
  371. var key = keys[i];
  372. if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  373. }
  374. };
  375. var replacement = /#|\.prototype\./;
  376. var isForced = function (feature, detection) {
  377. var value = data[normalize(feature)];
  378. return value == POLYFILL ? true
  379. : value == NATIVE ? false
  380. : typeof detection == 'function' ? fails(detection)
  381. : !!detection;
  382. };
  383. var normalize = isForced.normalize = function (string) {
  384. return String(string).replace(replacement, '.').toLowerCase();
  385. };
  386. var data = isForced.data = {};
  387. var NATIVE = isForced.NATIVE = 'N';
  388. var POLYFILL = isForced.POLYFILL = 'P';
  389. var isForced_1 = isForced;
  390. var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
  391. /*
  392. options.target - name of the target object
  393. options.global - target is the global object
  394. options.stat - export as static methods of target
  395. options.proto - export as prototype methods of target
  396. options.real - real prototype method for the `pure` version
  397. options.forced - export even if the native feature is available
  398. options.bind - bind methods to the target, required for the `pure` version
  399. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  400. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  401. options.sham - add a flag to not completely full polyfills
  402. options.enumerable - export as enumerable property
  403. options.noTargetGet - prevent calling a getter on target
  404. */
  405. var _export = function (options, source) {
  406. var TARGET = options.target;
  407. var GLOBAL = options.global;
  408. var STATIC = options.stat;
  409. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  410. if (GLOBAL) {
  411. target = global_1;
  412. } else if (STATIC) {
  413. target = global_1[TARGET] || setGlobal(TARGET, {});
  414. } else {
  415. target = (global_1[TARGET] || {}).prototype;
  416. }
  417. if (target) for (key in source) {
  418. sourceProperty = source[key];
  419. if (options.noTargetGet) {
  420. descriptor = getOwnPropertyDescriptor$1(target, key);
  421. targetProperty = descriptor && descriptor.value;
  422. } else targetProperty = target[key];
  423. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  424. // contained in target
  425. if (!FORCED && targetProperty !== undefined) {
  426. if (typeof sourceProperty === typeof targetProperty) continue;
  427. copyConstructorProperties(sourceProperty, targetProperty);
  428. }
  429. // add a flag to not completely full polyfills
  430. if (options.sham || (targetProperty && targetProperty.sham)) {
  431. createNonEnumerableProperty(sourceProperty, 'sham', true);
  432. }
  433. // extend global
  434. redefine(target, key, sourceProperty, options);
  435. }
  436. };
  437. // `IsArray` abstract operation
  438. // https://tc39.github.io/ecma262/#sec-isarray
  439. var isArray = Array.isArray || function isArray(arg) {
  440. return classofRaw(arg) == 'Array';
  441. };
  442. // `ToObject` abstract operation
  443. // https://tc39.github.io/ecma262/#sec-toobject
  444. var toObject = function (argument) {
  445. return Object(requireObjectCoercible(argument));
  446. };
  447. var createProperty = function (object, key, value) {
  448. var propertyKey = toPrimitive(key);
  449. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  450. else object[propertyKey] = value;
  451. };
  452. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  453. // Chrome 38 Symbol has incorrect toString conversion
  454. // eslint-disable-next-line no-undef
  455. return !String(Symbol());
  456. });
  457. var useSymbolAsUid = nativeSymbol
  458. // eslint-disable-next-line no-undef
  459. && !Symbol.sham
  460. // eslint-disable-next-line no-undef
  461. && typeof Symbol() == 'symbol';
  462. var WellKnownSymbolsStore = shared('wks');
  463. var Symbol$1 = global_1.Symbol;
  464. var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : uid;
  465. var wellKnownSymbol = function (name) {
  466. if (!has(WellKnownSymbolsStore, name)) {
  467. if (nativeSymbol && has(Symbol$1, name)) WellKnownSymbolsStore[name] = Symbol$1[name];
  468. else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
  469. } return WellKnownSymbolsStore[name];
  470. };
  471. var SPECIES = wellKnownSymbol('species');
  472. // `ArraySpeciesCreate` abstract operation
  473. // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
  474. var arraySpeciesCreate = function (originalArray, length) {
  475. var C;
  476. if (isArray(originalArray)) {
  477. C = originalArray.constructor;
  478. // cross-realm fallback
  479. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  480. else if (isObject(C)) {
  481. C = C[SPECIES];
  482. if (C === null) C = undefined;
  483. }
  484. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  485. };
  486. var userAgent = getBuiltIn('navigator', 'userAgent') || '';
  487. var process = global_1.process;
  488. var versions = process && process.versions;
  489. var v8 = versions && versions.v8;
  490. var match, version;
  491. if (v8) {
  492. match = v8.split('.');
  493. version = match[0] + match[1];
  494. } else if (userAgent) {
  495. match = userAgent.match(/Edge\/(\d+)/);
  496. if (!match || match[1] >= 74) {
  497. match = userAgent.match(/Chrome\/(\d+)/);
  498. if (match) version = match[1];
  499. }
  500. }
  501. var v8Version = version && +version;
  502. var SPECIES$1 = wellKnownSymbol('species');
  503. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  504. // We can't use this feature detection in V8 since it causes
  505. // deoptimization and serious performance degradation
  506. // https://github.com/zloirock/core-js/issues/677
  507. return v8Version >= 51 || !fails(function () {
  508. var array = [];
  509. var constructor = array.constructor = {};
  510. constructor[SPECIES$1] = function () {
  511. return { foo: 1 };
  512. };
  513. return array[METHOD_NAME](Boolean).foo !== 1;
  514. });
  515. };
  516. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  517. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  518. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  519. // We can't use this feature detection in V8 since it causes
  520. // deoptimization and serious performance degradation
  521. // https://github.com/zloirock/core-js/issues/679
  522. var IS_CONCAT_SPREADABLE_SUPPORT = v8Version >= 51 || !fails(function () {
  523. var array = [];
  524. array[IS_CONCAT_SPREADABLE] = false;
  525. return array.concat()[0] !== array;
  526. });
  527. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  528. var isConcatSpreadable = function (O) {
  529. if (!isObject(O)) return false;
  530. var spreadable = O[IS_CONCAT_SPREADABLE];
  531. return spreadable !== undefined ? !!spreadable : isArray(O);
  532. };
  533. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  534. // `Array.prototype.concat` method
  535. // https://tc39.github.io/ecma262/#sec-array.prototype.concat
  536. // with adding support of @@isConcatSpreadable and @@species
  537. _export({ target: 'Array', proto: true, forced: FORCED }, {
  538. concat: function concat(arg) { // eslint-disable-line no-unused-vars
  539. var O = toObject(this);
  540. var A = arraySpeciesCreate(O, 0);
  541. var n = 0;
  542. var i, k, length, len, E;
  543. for (i = -1, length = arguments.length; i < length; i++) {
  544. E = i === -1 ? O : arguments[i];
  545. if (isConcatSpreadable(E)) {
  546. len = toLength(E.length);
  547. if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  548. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  549. } else {
  550. if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  551. createProperty(A, n++, E);
  552. }
  553. }
  554. A.length = n;
  555. return A;
  556. }
  557. });
  558. var aFunction$1 = function (it) {
  559. if (typeof it != 'function') {
  560. throw TypeError(String(it) + ' is not a function');
  561. } return it;
  562. };
  563. // optional / simple context binding
  564. var bindContext = function (fn, that, length) {
  565. aFunction$1(fn);
  566. if (that === undefined) return fn;
  567. switch (length) {
  568. case 0: return function () {
  569. return fn.call(that);
  570. };
  571. case 1: return function (a) {
  572. return fn.call(that, a);
  573. };
  574. case 2: return function (a, b) {
  575. return fn.call(that, a, b);
  576. };
  577. case 3: return function (a, b, c) {
  578. return fn.call(that, a, b, c);
  579. };
  580. }
  581. return function (/* ...args */) {
  582. return fn.apply(that, arguments);
  583. };
  584. };
  585. var push = [].push;
  586. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation
  587. var createMethod$1 = function (TYPE) {
  588. var IS_MAP = TYPE == 1;
  589. var IS_FILTER = TYPE == 2;
  590. var IS_SOME = TYPE == 3;
  591. var IS_EVERY = TYPE == 4;
  592. var IS_FIND_INDEX = TYPE == 6;
  593. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  594. return function ($this, callbackfn, that, specificCreate) {
  595. var O = toObject($this);
  596. var self = indexedObject(O);
  597. var boundFunction = bindContext(callbackfn, that, 3);
  598. var length = toLength(self.length);
  599. var index = 0;
  600. var create = specificCreate || arraySpeciesCreate;
  601. var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
  602. var value, result;
  603. for (;length > index; index++) if (NO_HOLES || index in self) {
  604. value = self[index];
  605. result = boundFunction(value, index, O);
  606. if (TYPE) {
  607. if (IS_MAP) target[index] = result; // map
  608. else if (result) switch (TYPE) {
  609. case 3: return true; // some
  610. case 5: return value; // find
  611. case 6: return index; // findIndex
  612. case 2: push.call(target, value); // filter
  613. } else if (IS_EVERY) return false; // every
  614. }
  615. }
  616. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  617. };
  618. };
  619. var arrayIteration = {
  620. // `Array.prototype.forEach` method
  621. // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
  622. forEach: createMethod$1(0),
  623. // `Array.prototype.map` method
  624. // https://tc39.github.io/ecma262/#sec-array.prototype.map
  625. map: createMethod$1(1),
  626. // `Array.prototype.filter` method
  627. // https://tc39.github.io/ecma262/#sec-array.prototype.filter
  628. filter: createMethod$1(2),
  629. // `Array.prototype.some` method
  630. // https://tc39.github.io/ecma262/#sec-array.prototype.some
  631. some: createMethod$1(3),
  632. // `Array.prototype.every` method
  633. // https://tc39.github.io/ecma262/#sec-array.prototype.every
  634. every: createMethod$1(4),
  635. // `Array.prototype.find` method
  636. // https://tc39.github.io/ecma262/#sec-array.prototype.find
  637. find: createMethod$1(5),
  638. // `Array.prototype.findIndex` method
  639. // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
  640. findIndex: createMethod$1(6)
  641. };
  642. var $filter = arrayIteration.filter;
  643. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
  644. // Edge 14- issue
  645. var USES_TO_LENGTH = HAS_SPECIES_SUPPORT && !fails(function () {
  646. [].filter.call({ length: -1, 0: 1 }, function (it) { throw it; });
  647. });
  648. // `Array.prototype.filter` method
  649. // https://tc39.github.io/ecma262/#sec-array.prototype.filter
  650. // with adding support of @@species
  651. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
  652. filter: function filter(callbackfn /* , thisArg */) {
  653. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  654. }
  655. });
  656. // `Object.keys` method
  657. // https://tc39.github.io/ecma262/#sec-object.keys
  658. var objectKeys = Object.keys || function keys(O) {
  659. return objectKeysInternal(O, enumBugKeys);
  660. };
  661. // `Object.defineProperties` method
  662. // https://tc39.github.io/ecma262/#sec-object.defineproperties
  663. var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
  664. anObject(O);
  665. var keys = objectKeys(Properties);
  666. var length = keys.length;
  667. var index = 0;
  668. var key;
  669. while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
  670. return O;
  671. };
  672. var html = getBuiltIn('document', 'documentElement');
  673. var GT = '>';
  674. var LT = '<';
  675. var PROTOTYPE = 'prototype';
  676. var SCRIPT = 'script';
  677. var IE_PROTO = sharedKey('IE_PROTO');
  678. var EmptyConstructor = function () { /* empty */ };
  679. var scriptTag = function (content) {
  680. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  681. };
  682. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  683. var NullProtoObjectViaActiveX = function (activeXDocument) {
  684. activeXDocument.write(scriptTag(''));
  685. activeXDocument.close();
  686. var temp = activeXDocument.parentWindow.Object;
  687. activeXDocument = null; // avoid memory leak
  688. return temp;
  689. };
  690. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  691. var NullProtoObjectViaIFrame = function () {
  692. // Thrash, waste and sodomy: IE GC bug
  693. var iframe = documentCreateElement('iframe');
  694. var JS = 'java' + SCRIPT + ':';
  695. var iframeDocument;
  696. iframe.style.display = 'none';
  697. html.appendChild(iframe);
  698. // https://github.com/zloirock/core-js/issues/475
  699. iframe.src = String(JS);
  700. iframeDocument = iframe.contentWindow.document;
  701. iframeDocument.open();
  702. iframeDocument.write(scriptTag('document.F=Object'));
  703. iframeDocument.close();
  704. return iframeDocument.F;
  705. };
  706. // Check for document.domain and active x support
  707. // No need to use active x approach when document.domain is not set
  708. // see https://github.com/es-shims/es5-shim/issues/150
  709. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  710. // avoid IE GC bug
  711. var activeXDocument;
  712. var NullProtoObject = function () {
  713. try {
  714. /* global ActiveXObject */
  715. activeXDocument = document.domain && new ActiveXObject('htmlfile');
  716. } catch (error) { /* ignore */ }
  717. NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
  718. var length = enumBugKeys.length;
  719. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  720. return NullProtoObject();
  721. };
  722. hiddenKeys[IE_PROTO] = true;
  723. // `Object.create` method
  724. // https://tc39.github.io/ecma262/#sec-object.create
  725. var objectCreate = Object.create || function create(O, Properties) {
  726. var result;
  727. if (O !== null) {
  728. EmptyConstructor[PROTOTYPE] = anObject(O);
  729. result = new EmptyConstructor();
  730. EmptyConstructor[PROTOTYPE] = null;
  731. // add "__proto__" for Object.getPrototypeOf polyfill
  732. result[IE_PROTO] = O;
  733. } else result = NullProtoObject();
  734. return Properties === undefined ? result : objectDefineProperties(result, Properties);
  735. };
  736. var UNSCOPABLES = wellKnownSymbol('unscopables');
  737. var ArrayPrototype = Array.prototype;
  738. // Array.prototype[@@unscopables]
  739. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  740. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  741. objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
  742. configurable: true,
  743. value: objectCreate(null)
  744. });
  745. }
  746. // add a key to Array.prototype[@@unscopables]
  747. var addToUnscopables = function (key) {
  748. ArrayPrototype[UNSCOPABLES][key] = true;
  749. };
  750. var $find = arrayIteration.find;
  751. var FIND = 'find';
  752. var SKIPS_HOLES = true;
  753. // Shouldn't skip holes
  754. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  755. // `Array.prototype.find` method
  756. // https://tc39.github.io/ecma262/#sec-array.prototype.find
  757. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  758. find: function find(callbackfn /* , that = undefined */) {
  759. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  760. }
  761. });
  762. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  763. addToUnscopables(FIND);
  764. var sloppyArrayMethod = function (METHOD_NAME, argument) {
  765. var method = [][METHOD_NAME];
  766. return !method || !fails(function () {
  767. // eslint-disable-next-line no-useless-call,no-throw-literal
  768. method.call(null, argument || function () { throw 1; }, 1);
  769. });
  770. };
  771. var nativeJoin = [].join;
  772. var ES3_STRINGS = indexedObject != Object;
  773. var SLOPPY_METHOD = sloppyArrayMethod('join', ',');
  774. // `Array.prototype.join` method
  775. // https://tc39.github.io/ecma262/#sec-array.prototype.join
  776. _export({ target: 'Array', proto: true, forced: ES3_STRINGS || SLOPPY_METHOD }, {
  777. join: function join(separator) {
  778. return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
  779. }
  780. });
  781. var SPECIES$2 = wellKnownSymbol('species');
  782. var nativeSlice = [].slice;
  783. var max$1 = Math.max;
  784. // `Array.prototype.slice` method
  785. // https://tc39.github.io/ecma262/#sec-array.prototype.slice
  786. // fallback for not array-like ES3 strings and DOM objects
  787. _export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('slice') }, {
  788. slice: function slice(start, end) {
  789. var O = toIndexedObject(this);
  790. var length = toLength(O.length);
  791. var k = toAbsoluteIndex(start, length);
  792. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  793. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  794. var Constructor, result, n;
  795. if (isArray(O)) {
  796. Constructor = O.constructor;
  797. // cross-realm fallback
  798. if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
  799. Constructor = undefined;
  800. } else if (isObject(Constructor)) {
  801. Constructor = Constructor[SPECIES$2];
  802. if (Constructor === null) Constructor = undefined;
  803. }
  804. if (Constructor === Array || Constructor === undefined) {
  805. return nativeSlice.call(O, k, fin);
  806. }
  807. }
  808. result = new (Constructor === undefined ? Array : Constructor)(max$1(fin - k, 0));
  809. for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
  810. result.length = n;
  811. return result;
  812. }
  813. });
  814. var test = [];
  815. var nativeSort = test.sort;
  816. // IE8-
  817. var FAILS_ON_UNDEFINED = fails(function () {
  818. test.sort(undefined);
  819. });
  820. // V8 bug
  821. var FAILS_ON_NULL = fails(function () {
  822. test.sort(null);
  823. });
  824. // Old WebKit
  825. var SLOPPY_METHOD$1 = sloppyArrayMethod('sort');
  826. var FORCED$1 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || SLOPPY_METHOD$1;
  827. // `Array.prototype.sort` method
  828. // https://tc39.github.io/ecma262/#sec-array.prototype.sort
  829. _export({ target: 'Array', proto: true, forced: FORCED$1 }, {
  830. sort: function sort(comparefn) {
  831. return comparefn === undefined
  832. ? nativeSort.call(toObject(this))
  833. : nativeSort.call(toObject(this), aFunction$1(comparefn));
  834. }
  835. });
  836. var defineProperty = objectDefineProperty.f;
  837. var FunctionPrototype = Function.prototype;
  838. var FunctionPrototypeToString = FunctionPrototype.toString;
  839. var nameRE = /^\s*function ([^ (]*)/;
  840. var NAME = 'name';
  841. // Function instances `.name` property
  842. // https://tc39.github.io/ecma262/#sec-function-instances-name
  843. if (descriptors && !(NAME in FunctionPrototype)) {
  844. defineProperty(FunctionPrototype, NAME, {
  845. configurable: true,
  846. get: function () {
  847. try {
  848. return FunctionPrototypeToString.call(this).match(nameRE)[1];
  849. } catch (error) {
  850. return '';
  851. }
  852. }
  853. });
  854. }
  855. var nativeAssign = Object.assign;
  856. var defineProperty$1 = Object.defineProperty;
  857. // `Object.assign` method
  858. // https://tc39.github.io/ecma262/#sec-object.assign
  859. var objectAssign = !nativeAssign || fails(function () {
  860. // should have correct order of operations (Edge bug)
  861. if (descriptors && nativeAssign({ b: 1 }, nativeAssign(defineProperty$1({}, 'a', {
  862. enumerable: true,
  863. get: function () {
  864. defineProperty$1(this, 'b', {
  865. value: 3,
  866. enumerable: false
  867. });
  868. }
  869. }), { b: 2 })).b !== 1) return true;
  870. // should work with symbols and should have deterministic property order (V8 bug)
  871. var A = {};
  872. var B = {};
  873. // eslint-disable-next-line no-undef
  874. var symbol = Symbol();
  875. var alphabet = 'abcdefghijklmnopqrst';
  876. A[symbol] = 7;
  877. alphabet.split('').forEach(function (chr) { B[chr] = chr; });
  878. return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
  879. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
  880. var T = toObject(target);
  881. var argumentsLength = arguments.length;
  882. var index = 1;
  883. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  884. var propertyIsEnumerable = objectPropertyIsEnumerable.f;
  885. while (argumentsLength > index) {
  886. var S = indexedObject(arguments[index++]);
  887. var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
  888. var length = keys.length;
  889. var j = 0;
  890. var key;
  891. while (length > j) {
  892. key = keys[j++];
  893. if (!descriptors || propertyIsEnumerable.call(S, key)) T[key] = S[key];
  894. }
  895. } return T;
  896. } : nativeAssign;
  897. // `Object.assign` method
  898. // https://tc39.github.io/ecma262/#sec-object.assign
  899. _export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, {
  900. assign: objectAssign
  901. });
  902. // iterable DOM collections
  903. // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
  904. var domIterables = {
  905. CSSRuleList: 0,
  906. CSSStyleDeclaration: 0,
  907. CSSValueList: 0,
  908. ClientRectList: 0,
  909. DOMRectList: 0,
  910. DOMStringList: 0,
  911. DOMTokenList: 1,
  912. DataTransferItemList: 0,
  913. FileList: 0,
  914. HTMLAllCollection: 0,
  915. HTMLCollection: 0,
  916. HTMLFormElement: 0,
  917. HTMLSelectElement: 0,
  918. MediaList: 0,
  919. MimeTypeArray: 0,
  920. NamedNodeMap: 0,
  921. NodeList: 1,
  922. PaintRequestList: 0,
  923. Plugin: 0,
  924. PluginArray: 0,
  925. SVGLengthList: 0,
  926. SVGNumberList: 0,
  927. SVGPathSegList: 0,
  928. SVGPointList: 0,
  929. SVGStringList: 0,
  930. SVGTransformList: 0,
  931. SourceBufferList: 0,
  932. StyleSheetList: 0,
  933. TextTrackCueList: 0,
  934. TextTrackList: 0,
  935. TouchList: 0
  936. };
  937. var $forEach = arrayIteration.forEach;
  938. // `Array.prototype.forEach` method implementation
  939. // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
  940. var arrayForEach = sloppyArrayMethod('forEach') ? function forEach(callbackfn /* , thisArg */) {
  941. return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  942. } : [].forEach;
  943. for (var COLLECTION_NAME in domIterables) {
  944. var Collection = global_1[COLLECTION_NAME];
  945. var CollectionPrototype = Collection && Collection.prototype;
  946. // some Chrome versions have non-configurable methods on DOMTokenList
  947. if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
  948. createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
  949. } catch (error) {
  950. CollectionPrototype.forEach = arrayForEach;
  951. }
  952. }
  953. function _typeof(obj) {
  954. if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
  955. _typeof = function (obj) {
  956. return typeof obj;
  957. };
  958. } else {
  959. _typeof = function (obj) {
  960. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  961. };
  962. }
  963. return _typeof(obj);
  964. }
  965. function _classCallCheck(instance, Constructor) {
  966. if (!(instance instanceof Constructor)) {
  967. throw new TypeError("Cannot call a class as a function");
  968. }
  969. }
  970. function _defineProperties(target, props) {
  971. for (var i = 0; i < props.length; i++) {
  972. var descriptor = props[i];
  973. descriptor.enumerable = descriptor.enumerable || false;
  974. descriptor.configurable = true;
  975. if ("value" in descriptor) descriptor.writable = true;
  976. Object.defineProperty(target, descriptor.key, descriptor);
  977. }
  978. }
  979. function _createClass(Constructor, protoProps, staticProps) {
  980. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  981. if (staticProps) _defineProperties(Constructor, staticProps);
  982. return Constructor;
  983. }
  984. function _inherits(subClass, superClass) {
  985. if (typeof superClass !== "function" && superClass !== null) {
  986. throw new TypeError("Super expression must either be null or a function");
  987. }
  988. subClass.prototype = Object.create(superClass && superClass.prototype, {
  989. constructor: {
  990. value: subClass,
  991. writable: true,
  992. configurable: true
  993. }
  994. });
  995. if (superClass) _setPrototypeOf(subClass, superClass);
  996. }
  997. function _getPrototypeOf(o) {
  998. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  999. return o.__proto__ || Object.getPrototypeOf(o);
  1000. };
  1001. return _getPrototypeOf(o);
  1002. }
  1003. function _setPrototypeOf(o, p) {
  1004. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  1005. o.__proto__ = p;
  1006. return o;
  1007. };
  1008. return _setPrototypeOf(o, p);
  1009. }
  1010. function _assertThisInitialized(self) {
  1011. if (self === void 0) {
  1012. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  1013. }
  1014. return self;
  1015. }
  1016. function _possibleConstructorReturn(self, call) {
  1017. if (call && (typeof call === "object" || typeof call === "function")) {
  1018. return call;
  1019. }
  1020. return _assertThisInitialized(self);
  1021. }
  1022. function _superPropBase(object, property) {
  1023. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  1024. object = _getPrototypeOf(object);
  1025. if (object === null) break;
  1026. }
  1027. return object;
  1028. }
  1029. function _get(target, property, receiver) {
  1030. if (typeof Reflect !== "undefined" && Reflect.get) {
  1031. _get = Reflect.get;
  1032. } else {
  1033. _get = function _get(target, property, receiver) {
  1034. var base = _superPropBase(target, property);
  1035. if (!base) return;
  1036. var desc = Object.getOwnPropertyDescriptor(base, property);
  1037. if (desc.get) {
  1038. return desc.get.call(receiver);
  1039. }
  1040. return desc.value;
  1041. };
  1042. }
  1043. return _get(target, property, receiver || target);
  1044. }
  1045. /**
  1046. * @author: Yura Knoxville
  1047. * @version: v1.1.0
  1048. */
  1049. var initBodyCaller;
  1050. var groupBy = function groupBy(array, f) {
  1051. var tmpGroups = {};
  1052. array.forEach(function (o) {
  1053. var groups = f(o);
  1054. tmpGroups[groups] = tmpGroups[groups] || [];
  1055. tmpGroups[groups].push(o);
  1056. });
  1057. return tmpGroups;
  1058. };
  1059. $.extend($.fn.bootstrapTable.defaults.icons, {
  1060. collapseGroup: {
  1061. bootstrap3: 'glyphicon-chevron-up',
  1062. materialize: 'arrow_drop_down'
  1063. }[$.fn.bootstrapTable.theme] || 'fa-angle-up',
  1064. expandGroup: {
  1065. bootstrap3: 'glyphicon-chevron-down',
  1066. materialize: 'arrow_drop_up'
  1067. }[$.fn.bootstrapTable.theme] || 'fa-angle-down'
  1068. });
  1069. $.extend($.fn.bootstrapTable.defaults, {
  1070. groupBy: false,
  1071. groupByField: '',
  1072. groupByFormatter: undefined,
  1073. groupByToggle: false,
  1074. groupByShowToggleIcon: false,
  1075. groupByCollapsedGroups: []
  1076. });
  1077. var Utils = $.fn.bootstrapTable.utils;
  1078. var BootstrapTable = $.fn.bootstrapTable.Constructor;
  1079. var _initSort = BootstrapTable.prototype.initSort;
  1080. var _initBody = BootstrapTable.prototype.initBody;
  1081. var _updateSelected = BootstrapTable.prototype.updateSelected;
  1082. BootstrapTable.prototype.initSort = function () {
  1083. var _this = this;
  1084. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1085. args[_key] = arguments[_key];
  1086. }
  1087. _initSort.apply(this, Array.prototype.slice.apply(args));
  1088. var that = this;
  1089. this.tableGroups = [];
  1090. if (this.options.groupBy && this.options.groupByField !== '') {
  1091. if (this.options.sortName !== this.options.groupByField) {
  1092. if (this.options.customSort) {
  1093. Utils.calculateObjectValue(this.options, this.options.customSort, [this.options.sortName, this.options.sortOrder, this.data]);
  1094. } else {
  1095. this.options.data.sort(function (a, b) {
  1096. var groupByFields = _this.getGroupByFields();
  1097. var fieldValuesA = [];
  1098. var fieldValuesB = [];
  1099. $.each(groupByFields, function (i, field) {
  1100. fieldValuesA.push(a[field]);
  1101. fieldValuesB.push(b[field]);
  1102. });
  1103. a = fieldValuesA.join();
  1104. b = fieldValuesB.join();
  1105. return a.localeCompare(b, undefined, {
  1106. numeric: true
  1107. });
  1108. });
  1109. }
  1110. }
  1111. var groups = groupBy(that.data, function (item) {
  1112. var groupByFields = _this.getGroupByFields();
  1113. var groupValues = [];
  1114. $.each(groupByFields, function (i, field) {
  1115. groupValues.push(item[field]);
  1116. });
  1117. return groupValues.join(', ');
  1118. });
  1119. var index = 0;
  1120. $.each(groups, function (key, value) {
  1121. _this.tableGroups.push({
  1122. id: index,
  1123. name: key,
  1124. data: value
  1125. });
  1126. value.forEach(function (item) {
  1127. if (!item._data) {
  1128. item._data = {};
  1129. }
  1130. if (_this.isCollapsed(key, value)) {
  1131. item._class = 'hidden';
  1132. }
  1133. item._data['parent-index'] = index;
  1134. });
  1135. index++;
  1136. });
  1137. }
  1138. };
  1139. BootstrapTable.prototype.initBody = function () {
  1140. var _this2 = this;
  1141. initBodyCaller = true;
  1142. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  1143. args[_key2] = arguments[_key2];
  1144. }
  1145. _initBody.apply(this, Array.prototype.slice.apply(args));
  1146. if (this.options.groupBy && this.options.groupByField !== '') {
  1147. var that = this;
  1148. var checkBox = false;
  1149. var visibleColumns = 0;
  1150. this.columns.forEach(function (column) {
  1151. if (column.checkbox) {
  1152. checkBox = true;
  1153. } else if (column.visible) {
  1154. visibleColumns += 1;
  1155. }
  1156. });
  1157. if (this.options.detailView && !this.options.cardView) {
  1158. visibleColumns += 1;
  1159. }
  1160. this.tableGroups.forEach(function (item) {
  1161. var html = [];
  1162. html.push(Utils.sprintf('<tr class="info groupBy %s" data-group-index="%s">', _this2.options.groupByToggle ? 'expanded' : '', item.id));
  1163. if (that.options.detailView && !that.options.cardView) {
  1164. html.push('<td class="detail"></td>');
  1165. }
  1166. if (checkBox) {
  1167. html.push('<td class="bs-checkbox">', '<input name="btSelectGroup" type="checkbox" />', '</td>');
  1168. }
  1169. var formattedValue = item.name;
  1170. if (that.options.groupByFormatter !== undefined) {
  1171. formattedValue = Utils.calculateObjectValue(that.options, that.options.groupByFormatter, [item.name, item.id, item.data]);
  1172. }
  1173. html.push('<td', Utils.sprintf(' colspan="%s"', visibleColumns), '>', formattedValue);
  1174. var icon = _this2.options.icons.collapseGroup;
  1175. if (_this2.isCollapsed(item.name, item.data)) {
  1176. icon = _this2.options.icons.expandGroup;
  1177. }
  1178. if (_this2.options.groupByToggle && _this2.options.groupByShowToggleIcon) {
  1179. html.push("<span class=\"float-right ".concat(_this2.options.iconsPrefix, " ").concat(icon, "\"></span>"));
  1180. }
  1181. html.push('</td></tr>');
  1182. that.$body.find("tr[data-parent-index=".concat(item.id, "]:first")).before($(html.join('')));
  1183. });
  1184. this.$selectGroup = [];
  1185. this.$body.find('[name="btSelectGroup"]').each(function () {
  1186. var self = $(this);
  1187. that.$selectGroup.push({
  1188. group: self,
  1189. item: that.$selectItem.filter(function () {
  1190. return $(this).closest('tr').data('parent-index') === self.closest('tr').data('group-index');
  1191. })
  1192. });
  1193. });
  1194. if (this.options.groupByToggle) {
  1195. this.$container.off('click', '.groupBy').on('click', '.groupBy', function () {
  1196. var $this = $(this);
  1197. var groupIndex = $this.closest('tr').data('group-index');
  1198. var $groupRows = that.$body.find("tr[data-parent-index=".concat(groupIndex, "]"));
  1199. $this.toggleClass('expanded collapsed');
  1200. $this.find('span').toggleClass("".concat(that.options.icons.collapseGroup, " ").concat(that.options.icons.expandGroup));
  1201. $groupRows.toggleClass('hidden');
  1202. $groupRows.each(function (i, element) {
  1203. return that.collapseRow($(element).data('index'));
  1204. });
  1205. });
  1206. }
  1207. this.$container.off('click', '[name="btSelectGroup"]').on('click', '[name="btSelectGroup"]', function (event) {
  1208. event.stopImmediatePropagation();
  1209. var self = $(this);
  1210. var checked = self.prop('checked');
  1211. that[checked ? 'checkGroup' : 'uncheckGroup']($(this).closest('tr').data('group-index'));
  1212. });
  1213. }
  1214. initBodyCaller = false;
  1215. this.updateSelected();
  1216. };
  1217. BootstrapTable.prototype.updateSelected = function () {
  1218. if (!initBodyCaller) {
  1219. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  1220. args[_key3] = arguments[_key3];
  1221. }
  1222. _updateSelected.apply(this, Array.prototype.slice.apply(args));
  1223. if (this.options.groupBy && this.options.groupByField !== '') {
  1224. this.$selectGroup.forEach(function (item) {
  1225. var checkGroup = item.item.filter(':enabled').length === item.item.filter(':enabled').filter(':checked').length;
  1226. item.group.prop('checked', checkGroup);
  1227. });
  1228. }
  1229. }
  1230. };
  1231. BootstrapTable.prototype.checkGroup = function (index) {
  1232. this.checkGroup_(index, true);
  1233. };
  1234. BootstrapTable.prototype.uncheckGroup = function (index) {
  1235. this.checkGroup_(index, false);
  1236. };
  1237. BootstrapTable.prototype.isCollapsed = function (groupKey, items) {
  1238. if (this.options.groupByCollapsedGroups) {
  1239. var collapsedGroups = Utils.calculateObjectValue(this, this.options.groupByCollapsedGroups, [groupKey, items], true);
  1240. if ($.inArray(groupKey, collapsedGroups) > -1) {
  1241. return true;
  1242. }
  1243. }
  1244. return false;
  1245. };
  1246. BootstrapTable.prototype.checkGroup_ = function (index, checked) {
  1247. var rowsBefore = this.getSelections();
  1248. var filter = function filter() {
  1249. return $(this).closest('tr').data('parent-index') === index;
  1250. };
  1251. this.$selectItem.filter(filter).prop('checked', checked);
  1252. this.updateRows();
  1253. this.updateSelected();
  1254. var rowsAfter = this.getSelections();
  1255. if (checked) {
  1256. this.trigger('check-all', rowsAfter, rowsBefore);
  1257. return;
  1258. }
  1259. this.trigger('uncheck-all', rowsAfter, rowsBefore);
  1260. };
  1261. BootstrapTable.prototype.getGroupByFields = function () {
  1262. var groupByFields = this.options.groupByField;
  1263. if (!$.isArray(this.options.groupByField)) {
  1264. groupByFields = [this.options.groupByField];
  1265. }
  1266. return groupByFields;
  1267. };
  1268. $.BootstrapTable =
  1269. /*#__PURE__*/
  1270. function (_$$BootstrapTable) {
  1271. _inherits(_class, _$$BootstrapTable);
  1272. function _class() {
  1273. _classCallCheck(this, _class);
  1274. return _possibleConstructorReturn(this, _getPrototypeOf(_class).apply(this, arguments));
  1275. }
  1276. _createClass(_class, [{
  1277. key: "scrollTo",
  1278. value: function scrollTo(params) {
  1279. if (this.options.groupBy) {
  1280. var options = {
  1281. unit: 'px',
  1282. value: 0
  1283. };
  1284. if (_typeof(params) === 'object') {
  1285. options = Object.assign(options, params);
  1286. }
  1287. if (options.unit === 'rows') {
  1288. var scrollTo = 0;
  1289. this.$body.find("> tr:not(.groupBy):lt(".concat(options.value, ")")).each(function (i, el) {
  1290. scrollTo += $(el).outerHeight(true);
  1291. });
  1292. var $targetColumn = this.$body.find("> tr:not(.groupBy):eq(".concat(options.value, ")"));
  1293. $targetColumn.prevAll('.groupBy').each(function (i, el) {
  1294. scrollTo += $(el).outerHeight(true);
  1295. });
  1296. this.$tableBody.scrollTop(scrollTo);
  1297. return;
  1298. }
  1299. }
  1300. _get(_getPrototypeOf(_class.prototype), "scrollTo", this).call(this, params);
  1301. }
  1302. }]);
  1303. return _class;
  1304. }($.BootstrapTable);
  1305. })));