bootstrap-table-group-by.js 52 KB

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