bootstrap-table-multiple-sort.js 76 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819
  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. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  9. function createCommonjsModule(fn, module) {
  10. return module = { exports: {} }, fn(module, module.exports), module.exports;
  11. }
  12. var check = function (it) {
  13. return it && it.Math == Math && it;
  14. };
  15. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  16. var global_1 =
  17. // eslint-disable-next-line no-undef
  18. check(typeof globalThis == 'object' && globalThis) ||
  19. check(typeof window == 'object' && window) ||
  20. check(typeof self == 'object' && self) ||
  21. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  22. // eslint-disable-next-line no-new-func
  23. (function () { return this; })() || Function('return this')();
  24. var fails = function (exec) {
  25. try {
  26. return !!exec();
  27. } catch (error) {
  28. return true;
  29. }
  30. };
  31. // Thank's IE8 for his funny defineProperty
  32. var descriptors = !fails(function () {
  33. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  34. });
  35. var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
  36. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  37. // Nashorn ~ JDK8 bug
  38. var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
  39. // `Object.prototype.propertyIsEnumerable` method implementation
  40. // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
  41. var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  42. var descriptor = getOwnPropertyDescriptor(this, V);
  43. return !!descriptor && descriptor.enumerable;
  44. } : nativePropertyIsEnumerable;
  45. var objectPropertyIsEnumerable = {
  46. f: f
  47. };
  48. var createPropertyDescriptor = function (bitmap, value) {
  49. return {
  50. enumerable: !(bitmap & 1),
  51. configurable: !(bitmap & 2),
  52. writable: !(bitmap & 4),
  53. value: value
  54. };
  55. };
  56. var toString = {}.toString;
  57. var classofRaw = function (it) {
  58. return toString.call(it).slice(8, -1);
  59. };
  60. var split = ''.split;
  61. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  62. var indexedObject = fails(function () {
  63. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  64. // eslint-disable-next-line no-prototype-builtins
  65. return !Object('z').propertyIsEnumerable(0);
  66. }) ? function (it) {
  67. return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
  68. } : Object;
  69. // `RequireObjectCoercible` abstract operation
  70. // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
  71. var requireObjectCoercible = function (it) {
  72. if (it == undefined) throw TypeError("Can't call method on " + it);
  73. return it;
  74. };
  75. // toObject with fallback for non-array-like ES3 strings
  76. var toIndexedObject = function (it) {
  77. return indexedObject(requireObjectCoercible(it));
  78. };
  79. var isObject = function (it) {
  80. return typeof it === 'object' ? it !== null : typeof it === 'function';
  81. };
  82. // `ToPrimitive` abstract operation
  83. // https://tc39.github.io/ecma262/#sec-toprimitive
  84. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  85. // and the second argument - flag - preferred type is a string
  86. var toPrimitive = function (input, PREFERRED_STRING) {
  87. if (!isObject(input)) return input;
  88. var fn, val;
  89. if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  90. if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
  91. if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
  92. throw TypeError("Can't convert object to primitive value");
  93. };
  94. var hasOwnProperty = {}.hasOwnProperty;
  95. var has = function (it, key) {
  96. return hasOwnProperty.call(it, key);
  97. };
  98. var document$1 = global_1.document;
  99. // typeof document.createElement is 'object' in old IE
  100. var EXISTS = isObject(document$1) && isObject(document$1.createElement);
  101. var documentCreateElement = function (it) {
  102. return EXISTS ? document$1.createElement(it) : {};
  103. };
  104. // Thank's IE8 for his funny defineProperty
  105. var ie8DomDefine = !descriptors && !fails(function () {
  106. return Object.defineProperty(documentCreateElement('div'), 'a', {
  107. get: function () { return 7; }
  108. }).a != 7;
  109. });
  110. var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  111. // `Object.getOwnPropertyDescriptor` method
  112. // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
  113. var f$1 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  114. O = toIndexedObject(O);
  115. P = toPrimitive(P, true);
  116. if (ie8DomDefine) try {
  117. return nativeGetOwnPropertyDescriptor(O, P);
  118. } catch (error) { /* empty */ }
  119. if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
  120. };
  121. var objectGetOwnPropertyDescriptor = {
  122. f: f$1
  123. };
  124. var anObject = function (it) {
  125. if (!isObject(it)) {
  126. throw TypeError(String(it) + ' is not an object');
  127. } return it;
  128. };
  129. var nativeDefineProperty = Object.defineProperty;
  130. // `Object.defineProperty` method
  131. // https://tc39.github.io/ecma262/#sec-object.defineproperty
  132. var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
  133. anObject(O);
  134. P = toPrimitive(P, true);
  135. anObject(Attributes);
  136. if (ie8DomDefine) try {
  137. return nativeDefineProperty(O, P, Attributes);
  138. } catch (error) { /* empty */ }
  139. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
  140. if ('value' in Attributes) O[P] = Attributes.value;
  141. return O;
  142. };
  143. var objectDefineProperty = {
  144. f: f$2
  145. };
  146. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  147. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  148. } : function (object, key, value) {
  149. object[key] = value;
  150. return object;
  151. };
  152. var setGlobal = function (key, value) {
  153. try {
  154. createNonEnumerableProperty(global_1, key, value);
  155. } catch (error) {
  156. global_1[key] = value;
  157. } return value;
  158. };
  159. var SHARED = '__core-js_shared__';
  160. var store = global_1[SHARED] || setGlobal(SHARED, {});
  161. var sharedStore = store;
  162. var functionToString = Function.toString;
  163. // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
  164. if (typeof sharedStore.inspectSource != 'function') {
  165. sharedStore.inspectSource = function (it) {
  166. return functionToString.call(it);
  167. };
  168. }
  169. var inspectSource = sharedStore.inspectSource;
  170. var WeakMap = global_1.WeakMap;
  171. var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
  172. var shared = createCommonjsModule(function (module) {
  173. (module.exports = function (key, value) {
  174. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  175. })('versions', []).push({
  176. version: '3.8.1',
  177. mode: 'global',
  178. copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
  179. });
  180. });
  181. var id = 0;
  182. var postfix = Math.random();
  183. var uid = function (key) {
  184. return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
  185. };
  186. var keys = shared('keys');
  187. var sharedKey = function (key) {
  188. return keys[key] || (keys[key] = uid(key));
  189. };
  190. var hiddenKeys = {};
  191. var WeakMap$1 = global_1.WeakMap;
  192. var set, get, has$1;
  193. var enforce = function (it) {
  194. return has$1(it) ? get(it) : set(it, {});
  195. };
  196. var getterFor = function (TYPE) {
  197. return function (it) {
  198. var state;
  199. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  200. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  201. } return state;
  202. };
  203. };
  204. if (nativeWeakMap) {
  205. var store$1 = sharedStore.state || (sharedStore.state = new WeakMap$1());
  206. var wmget = store$1.get;
  207. var wmhas = store$1.has;
  208. var wmset = store$1.set;
  209. set = function (it, metadata) {
  210. metadata.facade = it;
  211. wmset.call(store$1, it, metadata);
  212. return metadata;
  213. };
  214. get = function (it) {
  215. return wmget.call(store$1, it) || {};
  216. };
  217. has$1 = function (it) {
  218. return wmhas.call(store$1, it);
  219. };
  220. } else {
  221. var STATE = sharedKey('state');
  222. hiddenKeys[STATE] = true;
  223. set = function (it, metadata) {
  224. metadata.facade = it;
  225. createNonEnumerableProperty(it, STATE, metadata);
  226. return metadata;
  227. };
  228. get = function (it) {
  229. return has(it, STATE) ? it[STATE] : {};
  230. };
  231. has$1 = function (it) {
  232. return has(it, STATE);
  233. };
  234. }
  235. var internalState = {
  236. set: set,
  237. get: get,
  238. has: has$1,
  239. enforce: enforce,
  240. getterFor: getterFor
  241. };
  242. var redefine = createCommonjsModule(function (module) {
  243. var getInternalState = internalState.get;
  244. var enforceInternalState = internalState.enforce;
  245. var TEMPLATE = String(String).split('String');
  246. (module.exports = function (O, key, value, options) {
  247. var unsafe = options ? !!options.unsafe : false;
  248. var simple = options ? !!options.enumerable : false;
  249. var noTargetGet = options ? !!options.noTargetGet : false;
  250. var state;
  251. if (typeof value == 'function') {
  252. if (typeof key == 'string' && !has(value, 'name')) {
  253. createNonEnumerableProperty(value, 'name', key);
  254. }
  255. state = enforceInternalState(value);
  256. if (!state.source) {
  257. state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
  258. }
  259. }
  260. if (O === global_1) {
  261. if (simple) O[key] = value;
  262. else setGlobal(key, value);
  263. return;
  264. } else if (!unsafe) {
  265. delete O[key];
  266. } else if (!noTargetGet && O[key]) {
  267. simple = true;
  268. }
  269. if (simple) O[key] = value;
  270. else createNonEnumerableProperty(O, key, value);
  271. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  272. })(Function.prototype, 'toString', function toString() {
  273. return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
  274. });
  275. });
  276. var path = global_1;
  277. var aFunction = function (variable) {
  278. return typeof variable == 'function' ? variable : undefined;
  279. };
  280. var getBuiltIn = function (namespace, method) {
  281. return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace])
  282. : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
  283. };
  284. var ceil = Math.ceil;
  285. var floor = Math.floor;
  286. // `ToInteger` abstract operation
  287. // https://tc39.github.io/ecma262/#sec-tointeger
  288. var toInteger = function (argument) {
  289. return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
  290. };
  291. var min = Math.min;
  292. // `ToLength` abstract operation
  293. // https://tc39.github.io/ecma262/#sec-tolength
  294. var toLength = function (argument) {
  295. return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  296. };
  297. var max = Math.max;
  298. var min$1 = Math.min;
  299. // Helper for a popular repeating case of the spec:
  300. // Let integer be ? ToInteger(index).
  301. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  302. var toAbsoluteIndex = function (index, length) {
  303. var integer = toInteger(index);
  304. return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
  305. };
  306. // `Array.prototype.{ indexOf, includes }` methods implementation
  307. var createMethod = function (IS_INCLUDES) {
  308. return function ($this, el, fromIndex) {
  309. var O = toIndexedObject($this);
  310. var length = toLength(O.length);
  311. var index = toAbsoluteIndex(fromIndex, length);
  312. var value;
  313. // Array#includes uses SameValueZero equality algorithm
  314. // eslint-disable-next-line no-self-compare
  315. if (IS_INCLUDES && el != el) while (length > index) {
  316. value = O[index++];
  317. // eslint-disable-next-line no-self-compare
  318. if (value != value) return true;
  319. // Array#indexOf ignores holes, Array#includes - not
  320. } else for (;length > index; index++) {
  321. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  322. } return !IS_INCLUDES && -1;
  323. };
  324. };
  325. var arrayIncludes = {
  326. // `Array.prototype.includes` method
  327. // https://tc39.github.io/ecma262/#sec-array.prototype.includes
  328. includes: createMethod(true),
  329. // `Array.prototype.indexOf` method
  330. // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
  331. indexOf: createMethod(false)
  332. };
  333. var indexOf = arrayIncludes.indexOf;
  334. var objectKeysInternal = function (object, names) {
  335. var O = toIndexedObject(object);
  336. var i = 0;
  337. var result = [];
  338. var key;
  339. for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
  340. // Don't enum bug & hidden keys
  341. while (names.length > i) if (has(O, key = names[i++])) {
  342. ~indexOf(result, key) || result.push(key);
  343. }
  344. return result;
  345. };
  346. // IE8- don't enum bug keys
  347. var enumBugKeys = [
  348. 'constructor',
  349. 'hasOwnProperty',
  350. 'isPrototypeOf',
  351. 'propertyIsEnumerable',
  352. 'toLocaleString',
  353. 'toString',
  354. 'valueOf'
  355. ];
  356. var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
  357. // `Object.getOwnPropertyNames` method
  358. // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
  359. var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  360. return objectKeysInternal(O, hiddenKeys$1);
  361. };
  362. var objectGetOwnPropertyNames = {
  363. f: f$3
  364. };
  365. var f$4 = Object.getOwnPropertySymbols;
  366. var objectGetOwnPropertySymbols = {
  367. f: f$4
  368. };
  369. // all object keys, includes non-enumerable and symbols
  370. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  371. var keys = objectGetOwnPropertyNames.f(anObject(it));
  372. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  373. return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
  374. };
  375. var copyConstructorProperties = function (target, source) {
  376. var keys = ownKeys(source);
  377. var defineProperty = objectDefineProperty.f;
  378. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  379. for (var i = 0; i < keys.length; i++) {
  380. var key = keys[i];
  381. if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  382. }
  383. };
  384. var replacement = /#|\.prototype\./;
  385. var isForced = function (feature, detection) {
  386. var value = data[normalize(feature)];
  387. return value == POLYFILL ? true
  388. : value == NATIVE ? false
  389. : typeof detection == 'function' ? fails(detection)
  390. : !!detection;
  391. };
  392. var normalize = isForced.normalize = function (string) {
  393. return String(string).replace(replacement, '.').toLowerCase();
  394. };
  395. var data = isForced.data = {};
  396. var NATIVE = isForced.NATIVE = 'N';
  397. var POLYFILL = isForced.POLYFILL = 'P';
  398. var isForced_1 = isForced;
  399. var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
  400. /*
  401. options.target - name of the target object
  402. options.global - target is the global object
  403. options.stat - export as static methods of target
  404. options.proto - export as prototype methods of target
  405. options.real - real prototype method for the `pure` version
  406. options.forced - export even if the native feature is available
  407. options.bind - bind methods to the target, required for the `pure` version
  408. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  409. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  410. options.sham - add a flag to not completely full polyfills
  411. options.enumerable - export as enumerable property
  412. options.noTargetGet - prevent calling a getter on target
  413. */
  414. var _export = function (options, source) {
  415. var TARGET = options.target;
  416. var GLOBAL = options.global;
  417. var STATIC = options.stat;
  418. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  419. if (GLOBAL) {
  420. target = global_1;
  421. } else if (STATIC) {
  422. target = global_1[TARGET] || setGlobal(TARGET, {});
  423. } else {
  424. target = (global_1[TARGET] || {}).prototype;
  425. }
  426. if (target) for (key in source) {
  427. sourceProperty = source[key];
  428. if (options.noTargetGet) {
  429. descriptor = getOwnPropertyDescriptor$1(target, key);
  430. targetProperty = descriptor && descriptor.value;
  431. } else targetProperty = target[key];
  432. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  433. // contained in target
  434. if (!FORCED && targetProperty !== undefined) {
  435. if (typeof sourceProperty === typeof targetProperty) continue;
  436. copyConstructorProperties(sourceProperty, targetProperty);
  437. }
  438. // add a flag to not completely full polyfills
  439. if (options.sham || (targetProperty && targetProperty.sham)) {
  440. createNonEnumerableProperty(sourceProperty, 'sham', true);
  441. }
  442. // extend global
  443. redefine(target, key, sourceProperty, options);
  444. }
  445. };
  446. // `IsArray` abstract operation
  447. // https://tc39.github.io/ecma262/#sec-isarray
  448. var isArray = Array.isArray || function isArray(arg) {
  449. return classofRaw(arg) == 'Array';
  450. };
  451. // `ToObject` abstract operation
  452. // https://tc39.github.io/ecma262/#sec-toobject
  453. var toObject = function (argument) {
  454. return Object(requireObjectCoercible(argument));
  455. };
  456. var createProperty = function (object, key, value) {
  457. var propertyKey = toPrimitive(key);
  458. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  459. else object[propertyKey] = value;
  460. };
  461. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  462. // Chrome 38 Symbol has incorrect toString conversion
  463. // eslint-disable-next-line no-undef
  464. return !String(Symbol());
  465. });
  466. var useSymbolAsUid = nativeSymbol
  467. // eslint-disable-next-line no-undef
  468. && !Symbol.sham
  469. // eslint-disable-next-line no-undef
  470. && typeof Symbol.iterator == 'symbol';
  471. var WellKnownSymbolsStore = shared('wks');
  472. var Symbol$1 = global_1.Symbol;
  473. var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
  474. var wellKnownSymbol = function (name) {
  475. if (!has(WellKnownSymbolsStore, name)) {
  476. if (nativeSymbol && has(Symbol$1, name)) WellKnownSymbolsStore[name] = Symbol$1[name];
  477. else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
  478. } return WellKnownSymbolsStore[name];
  479. };
  480. var SPECIES = wellKnownSymbol('species');
  481. // `ArraySpeciesCreate` abstract operation
  482. // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
  483. var arraySpeciesCreate = function (originalArray, length) {
  484. var C;
  485. if (isArray(originalArray)) {
  486. C = originalArray.constructor;
  487. // cross-realm fallback
  488. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  489. else if (isObject(C)) {
  490. C = C[SPECIES];
  491. if (C === null) C = undefined;
  492. }
  493. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  494. };
  495. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  496. var process = global_1.process;
  497. var versions = process && process.versions;
  498. var v8 = versions && versions.v8;
  499. var match, version;
  500. if (v8) {
  501. match = v8.split('.');
  502. version = match[0] + match[1];
  503. } else if (engineUserAgent) {
  504. match = engineUserAgent.match(/Edge\/(\d+)/);
  505. if (!match || match[1] >= 74) {
  506. match = engineUserAgent.match(/Chrome\/(\d+)/);
  507. if (match) version = match[1];
  508. }
  509. }
  510. var engineV8Version = version && +version;
  511. var SPECIES$1 = wellKnownSymbol('species');
  512. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  513. // We can't use this feature detection in V8 since it causes
  514. // deoptimization and serious performance degradation
  515. // https://github.com/zloirock/core-js/issues/677
  516. return engineV8Version >= 51 || !fails(function () {
  517. var array = [];
  518. var constructor = array.constructor = {};
  519. constructor[SPECIES$1] = function () {
  520. return { foo: 1 };
  521. };
  522. return array[METHOD_NAME](Boolean).foo !== 1;
  523. });
  524. };
  525. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  526. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  527. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  528. // We can't use this feature detection in V8 since it causes
  529. // deoptimization and serious performance degradation
  530. // https://github.com/zloirock/core-js/issues/679
  531. var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
  532. var array = [];
  533. array[IS_CONCAT_SPREADABLE] = false;
  534. return array.concat()[0] !== array;
  535. });
  536. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  537. var isConcatSpreadable = function (O) {
  538. if (!isObject(O)) return false;
  539. var spreadable = O[IS_CONCAT_SPREADABLE];
  540. return spreadable !== undefined ? !!spreadable : isArray(O);
  541. };
  542. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  543. // `Array.prototype.concat` method
  544. // https://tc39.github.io/ecma262/#sec-array.prototype.concat
  545. // with adding support of @@isConcatSpreadable and @@species
  546. _export({ target: 'Array', proto: true, forced: FORCED }, {
  547. concat: function concat(arg) { // eslint-disable-line no-unused-vars
  548. var O = toObject(this);
  549. var A = arraySpeciesCreate(O, 0);
  550. var n = 0;
  551. var i, k, length, len, E;
  552. for (i = -1, length = arguments.length; i < length; i++) {
  553. E = i === -1 ? O : arguments[i];
  554. if (isConcatSpreadable(E)) {
  555. len = toLength(E.length);
  556. if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  557. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  558. } else {
  559. if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  560. createProperty(A, n++, E);
  561. }
  562. }
  563. A.length = n;
  564. return A;
  565. }
  566. });
  567. var aFunction$1 = function (it) {
  568. if (typeof it != 'function') {
  569. throw TypeError(String(it) + ' is not a function');
  570. } return it;
  571. };
  572. // optional / simple context binding
  573. var functionBindContext = function (fn, that, length) {
  574. aFunction$1(fn);
  575. if (that === undefined) return fn;
  576. switch (length) {
  577. case 0: return function () {
  578. return fn.call(that);
  579. };
  580. case 1: return function (a) {
  581. return fn.call(that, a);
  582. };
  583. case 2: return function (a, b) {
  584. return fn.call(that, a, b);
  585. };
  586. case 3: return function (a, b, c) {
  587. return fn.call(that, a, b, c);
  588. };
  589. }
  590. return function (/* ...args */) {
  591. return fn.apply(that, arguments);
  592. };
  593. };
  594. var push = [].push;
  595. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation
  596. var createMethod$1 = function (TYPE) {
  597. var IS_MAP = TYPE == 1;
  598. var IS_FILTER = TYPE == 2;
  599. var IS_SOME = TYPE == 3;
  600. var IS_EVERY = TYPE == 4;
  601. var IS_FIND_INDEX = TYPE == 6;
  602. var IS_FILTER_OUT = TYPE == 7;
  603. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  604. return function ($this, callbackfn, that, specificCreate) {
  605. var O = toObject($this);
  606. var self = indexedObject(O);
  607. var boundFunction = functionBindContext(callbackfn, that, 3);
  608. var length = toLength(self.length);
  609. var index = 0;
  610. var create = specificCreate || arraySpeciesCreate;
  611. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
  612. var value, result;
  613. for (;length > index; index++) if (NO_HOLES || index in self) {
  614. value = self[index];
  615. result = boundFunction(value, index, O);
  616. if (TYPE) {
  617. if (IS_MAP) target[index] = result; // map
  618. else if (result) switch (TYPE) {
  619. case 3: return true; // some
  620. case 5: return value; // find
  621. case 6: return index; // findIndex
  622. case 2: push.call(target, value); // filter
  623. } else switch (TYPE) {
  624. case 4: return false; // every
  625. case 7: push.call(target, value); // filterOut
  626. }
  627. }
  628. }
  629. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  630. };
  631. };
  632. var arrayIteration = {
  633. // `Array.prototype.forEach` method
  634. // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
  635. forEach: createMethod$1(0),
  636. // `Array.prototype.map` method
  637. // https://tc39.github.io/ecma262/#sec-array.prototype.map
  638. map: createMethod$1(1),
  639. // `Array.prototype.filter` method
  640. // https://tc39.github.io/ecma262/#sec-array.prototype.filter
  641. filter: createMethod$1(2),
  642. // `Array.prototype.some` method
  643. // https://tc39.github.io/ecma262/#sec-array.prototype.some
  644. some: createMethod$1(3),
  645. // `Array.prototype.every` method
  646. // https://tc39.github.io/ecma262/#sec-array.prototype.every
  647. every: createMethod$1(4),
  648. // `Array.prototype.find` method
  649. // https://tc39.github.io/ecma262/#sec-array.prototype.find
  650. find: createMethod$1(5),
  651. // `Array.prototype.findIndex` method
  652. // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
  653. findIndex: createMethod$1(6),
  654. // `Array.prototype.filterOut` method
  655. // https://github.com/tc39/proposal-array-filtering
  656. filterOut: createMethod$1(7)
  657. };
  658. // `Object.keys` method
  659. // https://tc39.github.io/ecma262/#sec-object.keys
  660. var objectKeys = Object.keys || function keys(O) {
  661. return objectKeysInternal(O, enumBugKeys);
  662. };
  663. // `Object.defineProperties` method
  664. // https://tc39.github.io/ecma262/#sec-object.defineproperties
  665. var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
  666. anObject(O);
  667. var keys = objectKeys(Properties);
  668. var length = keys.length;
  669. var index = 0;
  670. var key;
  671. while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
  672. return O;
  673. };
  674. var html = getBuiltIn('document', 'documentElement');
  675. var GT = '>';
  676. var LT = '<';
  677. var PROTOTYPE = 'prototype';
  678. var SCRIPT = 'script';
  679. var IE_PROTO = sharedKey('IE_PROTO');
  680. var EmptyConstructor = function () { /* empty */ };
  681. var scriptTag = function (content) {
  682. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  683. };
  684. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  685. var NullProtoObjectViaActiveX = function (activeXDocument) {
  686. activeXDocument.write(scriptTag(''));
  687. activeXDocument.close();
  688. var temp = activeXDocument.parentWindow.Object;
  689. activeXDocument = null; // avoid memory leak
  690. return temp;
  691. };
  692. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  693. var NullProtoObjectViaIFrame = function () {
  694. // Thrash, waste and sodomy: IE GC bug
  695. var iframe = documentCreateElement('iframe');
  696. var JS = 'java' + SCRIPT + ':';
  697. var iframeDocument;
  698. iframe.style.display = 'none';
  699. html.appendChild(iframe);
  700. // https://github.com/zloirock/core-js/issues/475
  701. iframe.src = String(JS);
  702. iframeDocument = iframe.contentWindow.document;
  703. iframeDocument.open();
  704. iframeDocument.write(scriptTag('document.F=Object'));
  705. iframeDocument.close();
  706. return iframeDocument.F;
  707. };
  708. // Check for document.domain and active x support
  709. // No need to use active x approach when document.domain is not set
  710. // see https://github.com/es-shims/es5-shim/issues/150
  711. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  712. // avoid IE GC bug
  713. var activeXDocument;
  714. var NullProtoObject = function () {
  715. try {
  716. /* global ActiveXObject */
  717. activeXDocument = document.domain && new ActiveXObject('htmlfile');
  718. } catch (error) { /* ignore */ }
  719. NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
  720. var length = enumBugKeys.length;
  721. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  722. return NullProtoObject();
  723. };
  724. hiddenKeys[IE_PROTO] = true;
  725. // `Object.create` method
  726. // https://tc39.github.io/ecma262/#sec-object.create
  727. var objectCreate = Object.create || function create(O, Properties) {
  728. var result;
  729. if (O !== null) {
  730. EmptyConstructor[PROTOTYPE] = anObject(O);
  731. result = new EmptyConstructor();
  732. EmptyConstructor[PROTOTYPE] = null;
  733. // add "__proto__" for Object.getPrototypeOf polyfill
  734. result[IE_PROTO] = O;
  735. } else result = NullProtoObject();
  736. return Properties === undefined ? result : objectDefineProperties(result, Properties);
  737. };
  738. var UNSCOPABLES = wellKnownSymbol('unscopables');
  739. var ArrayPrototype = Array.prototype;
  740. // Array.prototype[@@unscopables]
  741. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  742. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  743. objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
  744. configurable: true,
  745. value: objectCreate(null)
  746. });
  747. }
  748. // add a key to Array.prototype[@@unscopables]
  749. var addToUnscopables = function (key) {
  750. ArrayPrototype[UNSCOPABLES][key] = true;
  751. };
  752. var defineProperty = Object.defineProperty;
  753. var cache = {};
  754. var thrower = function (it) { throw it; };
  755. var arrayMethodUsesToLength = function (METHOD_NAME, options) {
  756. if (has(cache, METHOD_NAME)) return cache[METHOD_NAME];
  757. if (!options) options = {};
  758. var method = [][METHOD_NAME];
  759. var ACCESSORS = has(options, 'ACCESSORS') ? options.ACCESSORS : false;
  760. var argument0 = has(options, 0) ? options[0] : thrower;
  761. var argument1 = has(options, 1) ? options[1] : undefined;
  762. return cache[METHOD_NAME] = !!method && !fails(function () {
  763. if (ACCESSORS && !descriptors) return true;
  764. var O = { length: -1 };
  765. if (ACCESSORS) defineProperty(O, 1, { enumerable: true, get: thrower });
  766. else O[1] = 1;
  767. method.call(O, argument0, argument1);
  768. });
  769. };
  770. var $find = arrayIteration.find;
  771. var FIND = 'find';
  772. var SKIPS_HOLES = true;
  773. var USES_TO_LENGTH = arrayMethodUsesToLength(FIND);
  774. // Shouldn't skip holes
  775. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  776. // `Array.prototype.find` method
  777. // https://tc39.github.io/ecma262/#sec-array.prototype.find
  778. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES || !USES_TO_LENGTH }, {
  779. find: function find(callbackfn /* , that = undefined */) {
  780. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  781. }
  782. });
  783. // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
  784. addToUnscopables(FIND);
  785. var arrayMethodIsStrict = function (METHOD_NAME, argument) {
  786. var method = [][METHOD_NAME];
  787. return !!method && fails(function () {
  788. // eslint-disable-next-line no-useless-call,no-throw-literal
  789. method.call(null, argument || function () { throw 1; }, 1);
  790. });
  791. };
  792. var $indexOf = arrayIncludes.indexOf;
  793. var nativeIndexOf = [].indexOf;
  794. var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
  795. var STRICT_METHOD = arrayMethodIsStrict('indexOf');
  796. var USES_TO_LENGTH$1 = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
  797. // `Array.prototype.indexOf` method
  798. // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
  799. _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH$1 }, {
  800. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  801. return NEGATIVE_ZERO
  802. // convert -0 to +0
  803. ? nativeIndexOf.apply(this, arguments) || 0
  804. : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
  805. }
  806. });
  807. var $map = arrayIteration.map;
  808. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
  809. // FF49- issue
  810. var USES_TO_LENGTH$2 = arrayMethodUsesToLength('map');
  811. // `Array.prototype.map` method
  812. // https://tc39.github.io/ecma262/#sec-array.prototype.map
  813. // with adding support of @@species
  814. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH$2 }, {
  815. map: function map(callbackfn /* , thisArg */) {
  816. return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  817. }
  818. });
  819. var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('slice');
  820. var USES_TO_LENGTH$3 = arrayMethodUsesToLength('slice', { ACCESSORS: true, 0: 0, 1: 2 });
  821. var SPECIES$2 = wellKnownSymbol('species');
  822. var nativeSlice = [].slice;
  823. var max$1 = Math.max;
  824. // `Array.prototype.slice` method
  825. // https://tc39.github.io/ecma262/#sec-array.prototype.slice
  826. // fallback for not array-like ES3 strings and DOM objects
  827. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 || !USES_TO_LENGTH$3 }, {
  828. slice: function slice(start, end) {
  829. var O = toIndexedObject(this);
  830. var length = toLength(O.length);
  831. var k = toAbsoluteIndex(start, length);
  832. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  833. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  834. var Constructor, result, n;
  835. if (isArray(O)) {
  836. Constructor = O.constructor;
  837. // cross-realm fallback
  838. if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
  839. Constructor = undefined;
  840. } else if (isObject(Constructor)) {
  841. Constructor = Constructor[SPECIES$2];
  842. if (Constructor === null) Constructor = undefined;
  843. }
  844. if (Constructor === Array || Constructor === undefined) {
  845. return nativeSlice.call(O, k, fin);
  846. }
  847. }
  848. result = new (Constructor === undefined ? Array : Constructor)(max$1(fin - k, 0));
  849. for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
  850. result.length = n;
  851. return result;
  852. }
  853. });
  854. var test = [];
  855. var nativeSort = test.sort;
  856. // IE8-
  857. var FAILS_ON_UNDEFINED = fails(function () {
  858. test.sort(undefined);
  859. });
  860. // V8 bug
  861. var FAILS_ON_NULL = fails(function () {
  862. test.sort(null);
  863. });
  864. // Old WebKit
  865. var STRICT_METHOD$1 = arrayMethodIsStrict('sort');
  866. var FORCED$1 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD$1;
  867. // `Array.prototype.sort` method
  868. // https://tc39.github.io/ecma262/#sec-array.prototype.sort
  869. _export({ target: 'Array', proto: true, forced: FORCED$1 }, {
  870. sort: function sort(comparefn) {
  871. return comparefn === undefined
  872. ? nativeSort.call(toObject(this))
  873. : nativeSort.call(toObject(this), aFunction$1(comparefn));
  874. }
  875. });
  876. var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport('splice');
  877. var USES_TO_LENGTH$4 = arrayMethodUsesToLength('splice', { ACCESSORS: true, 0: 0, 1: 2 });
  878. var max$2 = Math.max;
  879. var min$2 = Math.min;
  880. var MAX_SAFE_INTEGER$1 = 0x1FFFFFFFFFFFFF;
  881. var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded';
  882. // `Array.prototype.splice` method
  883. // https://tc39.github.io/ecma262/#sec-array.prototype.splice
  884. // with adding support of @@species
  885. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 || !USES_TO_LENGTH$4 }, {
  886. splice: function splice(start, deleteCount /* , ...items */) {
  887. var O = toObject(this);
  888. var len = toLength(O.length);
  889. var actualStart = toAbsoluteIndex(start, len);
  890. var argumentsLength = arguments.length;
  891. var insertCount, actualDeleteCount, A, k, from, to;
  892. if (argumentsLength === 0) {
  893. insertCount = actualDeleteCount = 0;
  894. } else if (argumentsLength === 1) {
  895. insertCount = 0;
  896. actualDeleteCount = len - actualStart;
  897. } else {
  898. insertCount = argumentsLength - 2;
  899. actualDeleteCount = min$2(max$2(toInteger(deleteCount), 0), len - actualStart);
  900. }
  901. if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER$1) {
  902. throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);
  903. }
  904. A = arraySpeciesCreate(O, actualDeleteCount);
  905. for (k = 0; k < actualDeleteCount; k++) {
  906. from = actualStart + k;
  907. if (from in O) createProperty(A, k, O[from]);
  908. }
  909. A.length = actualDeleteCount;
  910. if (insertCount < actualDeleteCount) {
  911. for (k = actualStart; k < len - actualDeleteCount; k++) {
  912. from = k + actualDeleteCount;
  913. to = k + insertCount;
  914. if (from in O) O[to] = O[from];
  915. else delete O[to];
  916. }
  917. for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1];
  918. } else if (insertCount > actualDeleteCount) {
  919. for (k = len - actualDeleteCount; k > actualStart; k--) {
  920. from = k + actualDeleteCount - 1;
  921. to = k + insertCount - 1;
  922. if (from in O) O[to] = O[from];
  923. else delete O[to];
  924. }
  925. }
  926. for (k = 0; k < insertCount; k++) {
  927. O[k + actualStart] = arguments[k + 2];
  928. }
  929. O.length = len - actualDeleteCount + insertCount;
  930. return A;
  931. }
  932. });
  933. var nativeAssign = Object.assign;
  934. var defineProperty$1 = Object.defineProperty;
  935. // `Object.assign` method
  936. // https://tc39.github.io/ecma262/#sec-object.assign
  937. var objectAssign = !nativeAssign || fails(function () {
  938. // should have correct order of operations (Edge bug)
  939. if (descriptors && nativeAssign({ b: 1 }, nativeAssign(defineProperty$1({}, 'a', {
  940. enumerable: true,
  941. get: function () {
  942. defineProperty$1(this, 'b', {
  943. value: 3,
  944. enumerable: false
  945. });
  946. }
  947. }), { b: 2 })).b !== 1) return true;
  948. // should work with symbols and should have deterministic property order (V8 bug)
  949. var A = {};
  950. var B = {};
  951. // eslint-disable-next-line no-undef
  952. var symbol = Symbol();
  953. var alphabet = 'abcdefghijklmnopqrst';
  954. A[symbol] = 7;
  955. alphabet.split('').forEach(function (chr) { B[chr] = chr; });
  956. return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
  957. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
  958. var T = toObject(target);
  959. var argumentsLength = arguments.length;
  960. var index = 1;
  961. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  962. var propertyIsEnumerable = objectPropertyIsEnumerable.f;
  963. while (argumentsLength > index) {
  964. var S = indexedObject(arguments[index++]);
  965. var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
  966. var length = keys.length;
  967. var j = 0;
  968. var key;
  969. while (length > j) {
  970. key = keys[j++];
  971. if (!descriptors || propertyIsEnumerable.call(S, key)) T[key] = S[key];
  972. }
  973. } return T;
  974. } : nativeAssign;
  975. // `Object.assign` method
  976. // https://tc39.github.io/ecma262/#sec-object.assign
  977. _export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, {
  978. assign: objectAssign
  979. });
  980. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  981. var test$1 = {};
  982. test$1[TO_STRING_TAG] = 'z';
  983. var toStringTagSupport = String(test$1) === '[object z]';
  984. var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
  985. // ES3 wrong here
  986. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  987. // fallback for IE11 Script Access Denied error
  988. var tryGet = function (it, key) {
  989. try {
  990. return it[key];
  991. } catch (error) { /* empty */ }
  992. };
  993. // getting tag from ES6+ `Object.prototype.toString`
  994. var classof = toStringTagSupport ? classofRaw : function (it) {
  995. var O, tag, result;
  996. return it === undefined ? 'Undefined' : it === null ? 'Null'
  997. // @@toStringTag case
  998. : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$1)) == 'string' ? tag
  999. // builtinTag case
  1000. : CORRECT_ARGUMENTS ? classofRaw(O)
  1001. // ES3 arguments fallback
  1002. : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
  1003. };
  1004. // `Object.prototype.toString` method implementation
  1005. // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
  1006. var objectToString = toStringTagSupport ? {}.toString : function toString() {
  1007. return '[object ' + classof(this) + ']';
  1008. };
  1009. // `Object.prototype.toString` method
  1010. // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
  1011. if (!toStringTagSupport) {
  1012. redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
  1013. }
  1014. // a string of all valid unicode whitespaces
  1015. // eslint-disable-next-line max-len
  1016. var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  1017. var whitespace = '[' + whitespaces + ']';
  1018. var ltrim = RegExp('^' + whitespace + whitespace + '*');
  1019. var rtrim = RegExp(whitespace + whitespace + '*$');
  1020. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  1021. var createMethod$2 = function (TYPE) {
  1022. return function ($this) {
  1023. var string = String(requireObjectCoercible($this));
  1024. if (TYPE & 1) string = string.replace(ltrim, '');
  1025. if (TYPE & 2) string = string.replace(rtrim, '');
  1026. return string;
  1027. };
  1028. };
  1029. var stringTrim = {
  1030. // `String.prototype.{ trimLeft, trimStart }` methods
  1031. // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart
  1032. start: createMethod$2(1),
  1033. // `String.prototype.{ trimRight, trimEnd }` methods
  1034. // https://tc39.github.io/ecma262/#sec-string.prototype.trimend
  1035. end: createMethod$2(2),
  1036. // `String.prototype.trim` method
  1037. // https://tc39.github.io/ecma262/#sec-string.prototype.trim
  1038. trim: createMethod$2(3)
  1039. };
  1040. var trim = stringTrim.trim;
  1041. var $parseFloat = global_1.parseFloat;
  1042. var FORCED$2 = 1 / $parseFloat(whitespaces + '-0') !== -Infinity;
  1043. // `parseFloat` method
  1044. // https://tc39.github.io/ecma262/#sec-parsefloat-string
  1045. var numberParseFloat = FORCED$2 ? function parseFloat(string) {
  1046. var trimmedString = trim(String(string));
  1047. var result = $parseFloat(trimmedString);
  1048. return result === 0 && trimmedString.charAt(0) == '-' ? -0 : result;
  1049. } : $parseFloat;
  1050. // `parseFloat` method
  1051. // https://tc39.github.io/ecma262/#sec-parsefloat-string
  1052. _export({ global: true, forced: parseFloat != numberParseFloat }, {
  1053. parseFloat: numberParseFloat
  1054. });
  1055. // `RegExp.prototype.flags` getter implementation
  1056. // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
  1057. var regexpFlags = function () {
  1058. var that = anObject(this);
  1059. var result = '';
  1060. if (that.global) result += 'g';
  1061. if (that.ignoreCase) result += 'i';
  1062. if (that.multiline) result += 'm';
  1063. if (that.dotAll) result += 's';
  1064. if (that.unicode) result += 'u';
  1065. if (that.sticky) result += 'y';
  1066. return result;
  1067. };
  1068. var TO_STRING = 'toString';
  1069. var RegExpPrototype = RegExp.prototype;
  1070. var nativeToString = RegExpPrototype[TO_STRING];
  1071. var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
  1072. // FF44- RegExp#toString has a wrong name
  1073. var INCORRECT_NAME = nativeToString.name != TO_STRING;
  1074. // `RegExp.prototype.toString` method
  1075. // https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring
  1076. if (NOT_GENERIC || INCORRECT_NAME) {
  1077. redefine(RegExp.prototype, TO_STRING, function toString() {
  1078. var R = anObject(this);
  1079. var p = String(R.source);
  1080. var rf = R.flags;
  1081. var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? regexpFlags.call(R) : rf);
  1082. return '/' + p + '/' + f;
  1083. }, { unsafe: true });
  1084. }
  1085. function _typeof(obj) {
  1086. "@babel/helpers - typeof";
  1087. if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
  1088. _typeof = function (obj) {
  1089. return typeof obj;
  1090. };
  1091. } else {
  1092. _typeof = function (obj) {
  1093. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  1094. };
  1095. }
  1096. return _typeof(obj);
  1097. }
  1098. /**
  1099. * @author Nadim Basalamah <dimbslmh@gmail.com>
  1100. * @version: v1.1.0
  1101. * https://github.com/dimbslmh/bootstrap-table/tree/master/src/extensions/multiple-sort/bootstrap-table-multiple-sort.js
  1102. * Modification: ErwannNevou <https://github.com/ErwannNevou>
  1103. */
  1104. var isSingleSort = false;
  1105. var Utils = $__default['default'].fn.bootstrapTable.utils;
  1106. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults.icons, {
  1107. plus: {
  1108. bootstrap3: 'glyphicon-plus',
  1109. bootstrap4: 'fa-plus',
  1110. bootstrap5: 'fa-plus',
  1111. semantic: 'fa-plus',
  1112. materialize: 'plus',
  1113. foundation: 'fa-plus',
  1114. bulma: 'fa-plus',
  1115. 'bootstrap-table': 'icon-plus'
  1116. }[$__default['default'].fn.bootstrapTable.theme] || 'fa-clock',
  1117. minus: {
  1118. bootstrap3: 'glyphicon-minus',
  1119. bootstrap4: 'fa-minus',
  1120. bootstrap5: 'fa-minus',
  1121. semantic: 'fa-minus',
  1122. materialize: 'minus',
  1123. foundation: 'fa-minus',
  1124. bulma: 'fa-minus',
  1125. 'bootstrap-table': 'icon-minus'
  1126. }[$__default['default'].fn.bootstrapTable.theme] || 'fa-clock',
  1127. sort: {
  1128. bootstrap3: 'glyphicon-sort',
  1129. bootstrap4: 'fa-sort',
  1130. bootstrap5: 'fa-sort',
  1131. semantic: 'fa-sort',
  1132. materialize: 'sort',
  1133. foundation: 'fa-sort',
  1134. bulma: 'fa-sort',
  1135. 'bootstrap-table': 'icon-sort-amount-asc'
  1136. }[$__default['default'].fn.bootstrapTable.theme] || 'fa-clock'
  1137. });
  1138. var theme = {
  1139. bootstrap3: {
  1140. html: {
  1141. multipleSortModal: "\n <div class=\"modal fade\" id=\"%s\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-dialog\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>\n <h4 class=\"modal-title\" id=\"%sLabel\">%s</h4>\n </div>\n <div class=\"modal-body\">\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\">\n <button id=\"add\" type=\"button\" class=\"btn btn-default\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"btn btn-default\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">%s</button>\n <button type=\"button\" class=\"btn btn-primary multi-sort-order-button\">%s</button>\n </div>\n </div>\n </div>\n </div>\n ",
  1142. multipleSortButton: '<button class="multi-sort btn btn-default" type="button" data-toggle="modal" data-target="#%s" title="%s">%s</button>',
  1143. multipleSortSelect: '<select class="%s %s form-control">'
  1144. }
  1145. },
  1146. bootstrap4: {
  1147. html: {
  1148. multipleSortModal: "\n <div class=\"modal fade\" id=\"%s\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-dialog\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\" id=\"%sLabel\">%s</h5>\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"pb-3\">\n <button id=\"add\" type=\"button\" class=\"btn btn-secondary\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"btn btn-secondary\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">%s</button>\n <button type=\"button\" class=\"btn btn-primary multi-sort-order-button\">%s</button>\n </div>\n </div>\n </div>\n </div>\n ",
  1149. multipleSortButton: '<button class="multi-sort btn btn-secondary" type="button" data-toggle="modal" data-target="#%s" title="%s">%s</button>',
  1150. multipleSortSelect: '<select class="%s %s form-control">'
  1151. }
  1152. },
  1153. bootstrap5: {
  1154. html: {
  1155. multipleSortModal: "\n <div class=\"modal fade\" id=\"%s\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-dialog\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\" id=\"%sLabel\">%s</h5>\n <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button>\n </div>\n <div class=\"modal-body\">\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"pb-3\">\n <button id=\"add\" type=\"button\" class=\"btn btn-secondary\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"btn btn-secondary\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">%s</button>\n <button type=\"button\" class=\"btn btn-primary multi-sort-order-button\">%s</button>\n </div>\n </div>\n </div>\n </div>\n ",
  1156. multipleSortButton: '<button class="multi-sort btn btn-secondary" type="button" data-bs-toggle="modal" data-target="#%s" title="%s">%s</button>',
  1157. multipleSortSelect: '<select class="%s %s form-control">'
  1158. }
  1159. },
  1160. semantic: {
  1161. html: {
  1162. multipleSortModal: "\n <div class=\"ui modal tiny\" id=\"%s\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <i class=\"close icon\"></i>\n <div class=\"header\" id=\"%sLabel\">\n %s\n </div>\n <div class=\"image content\">\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"pb-3\">\n <button id=\"add\" type=\"button\" class=\"ui button\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"ui button\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n </div>\n <div class=\"actions\">\n <div class=\"ui button deny\">%s</div>\n <div class=\"ui button approve multi-sort-order-button\">%s</div>\n </div>\n </div>\n ",
  1163. multipleSortButton: '<button class="multi-sort ui button" type="button" data-toggle="modal" data-target="#%s" title="%s">%s</button>',
  1164. multipleSortSelect: '<select class="%s %s">'
  1165. }
  1166. },
  1167. materialize: {
  1168. html: {
  1169. multipleSortModal: "\n <div id=\"%s\" class=\"modal\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-content\" id=\"%sLabel\">\n <h4>%s</h4>\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"pb-3\">\n <button id=\"add\" type=\"button\" class=\"waves-effect waves-light btn\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"waves-effect waves-light btn\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n <div class=\"modal-footer\">\n <a href=\"javascript:void(0)\" class=\"modal-close waves-effect waves-light btn\">%s</a>\n <a href=\"javascript:void(0)\" class=\"modal-close waves-effect waves-light btn multi-sort-order-button\">%s</a>\n </div>\n </div>\n </div>\n ",
  1170. multipleSortButton: '<a href="#%s" class="multi-sort waves-effect waves-light btn modal-trigger" type="button" data-toggle="modal" title="%s">%s</a>',
  1171. multipleSortSelect: '<select class="%s %s browser-default">'
  1172. }
  1173. },
  1174. foundation: {
  1175. html: {
  1176. multipleSortModal: "\n <div class=\"reveal\" id=\"%s\" data-reveal aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div id=\"%sLabel\">\n <h1>%s</h1>\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"padding-bottom-2\">\n <button id=\"add\" type=\"button\" class=\"waves-effect waves-light button\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"waves-effect waves-light button\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n\n <button class=\"waves-effect waves-light button\" data-close aria-label=\"Close modal\" type=\"button\">\n <span aria-hidden=\"true\">%s</span>\n </button>\n <button class=\"waves-effect waves-light button multi-sort-order-button\" data-close aria-label=\"Order\" type=\"button\">\n <span aria-hidden=\"true\">%s</span>\n </button>\n </div>\n </div>\n ",
  1177. multipleSortButton: '<button class="button multi-sort" data-open="%s" title="%s">%s</button>',
  1178. multipleSortSelect: '<select class="%s %s browser-default">'
  1179. }
  1180. },
  1181. bulma: {
  1182. html: {
  1183. multipleSortModal: "\n <div class=\"modal\" id=\"%s\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-background\"></div>\n <div class=\"modal-content\" id=\"%sLabel\">\n <div class=\"box\">\n <h2>%s</h2>\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"padding-bottom-2\">\n <button id=\"add\" type=\"button\" class=\"waves-effect waves-light button\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"waves-effect waves-light button\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n <button type=\"button\" class=\"waves-effect waves-light button\" data-close>%s</button>\n <button type=\"button\" class=\"waves-effect waves-light button multi-sort-order-button\" data-close>%s</button>\n </div>\n </div>\n </div>\n ",
  1184. multipleSortButton: '<button class="button multi-sort" data-target="%s" title="%s">%s</button>',
  1185. multipleSortSelect: '<select class="%s %s browser-default">'
  1186. }
  1187. },
  1188. 'bootstrap-table': {
  1189. html: {
  1190. multipleSortModal: "\n <div class=\"modal\" id=\"%s\" aria-labelledby=\"%sLabel\" aria-hidden=\"true\">\n <div class=\"modal-background\"></div>\n <div class=\"modal-content\" id=\"%sLabel\">\n <div class=\"box\">\n <h2>%s</h2>\n <div class=\"bootstrap-table\">\n <div class=\"fixed-table-toolbar\">\n <div class=\"bars\">\n <div id=\"toolbar\" class=\"padding-bottom-2\">\n <button id=\"add\" type=\"button\" class=\"btn\">%s %s</button>\n <button id=\"delete\" type=\"button\" class=\"btn\" disabled>%s %s</button>\n </div>\n </div>\n </div>\n <div class=\"fixed-table-container\">\n <table id=\"multi-sort\" class=\"table\">\n <thead>\n <tr>\n <th></th>\n <th><div class=\"th-inner\">%s</div></th>\n <th><div class=\"th-inner\">%s</div></th>\n </tr>\n </thead>\n <tbody></tbody>\n </table>\n </div>\n </div>\n <div class=\"mt-30\">\n <button type=\"button\" class=\"btn\" data-close>%s</button>\n <button type=\"button\" class=\"btn multi-sort-order-button\" data-close>%s</button>\n </div>\n </div>\n </div>\n </div>\n ",
  1191. multipleSortButton: '<button class="btn multi-sort" data-target="%s" title="%s">%s</button>',
  1192. multipleSortSelect: '<select class="%s %s browser-default">'
  1193. }
  1194. }
  1195. }[$__default['default'].fn.bootstrapTable.theme];
  1196. var showSortModal = function showSortModal(that) {
  1197. var _selector = that.sortModalSelector;
  1198. var _id = "#".concat(_selector);
  1199. var o = that.options;
  1200. if (!$__default['default'](_id).hasClass('modal')) {
  1201. var sModal = Utils.sprintf(theme.html.multipleSortModal, _selector, _selector, _selector, that.options.formatMultipleSort(), Utils.sprintf(that.constants.html.icon, o.iconsPrefix, o.icons.plus), that.options.formatAddLevel(), Utils.sprintf(that.constants.html.icon, o.iconsPrefix, o.icons.minus), that.options.formatDeleteLevel(), that.options.formatColumn(), that.options.formatOrder(), that.options.formatCancel(), that.options.formatSort());
  1202. $__default['default']('body').append($__default['default'](sModal));
  1203. that.$sortModal = $__default['default'](_id);
  1204. var $rows = that.$sortModal.find('tbody > tr');
  1205. that.$sortModal.off('click', '#add').on('click', '#add', function () {
  1206. var total = that.$sortModal.find('.multi-sort-name:first option').length;
  1207. var current = that.$sortModal.find('tbody tr').length;
  1208. if (current < total) {
  1209. current++;
  1210. that.addLevel();
  1211. that.setButtonStates();
  1212. }
  1213. });
  1214. that.$sortModal.off('click', '#delete').on('click', '#delete', function () {
  1215. var total = that.$sortModal.find('.multi-sort-name:first option').length;
  1216. var current = that.$sortModal.find('tbody tr').length;
  1217. if (current > 1 && current <= total) {
  1218. current--;
  1219. that.$sortModal.find('tbody tr:last').remove();
  1220. that.setButtonStates();
  1221. }
  1222. });
  1223. that.$sortModal.off('click', '.multi-sort-order-button').on('click', '.multi-sort-order-button', function () {
  1224. var $rows = that.$sortModal.find('tbody > tr');
  1225. var $alert = that.$sortModal.find('div.alert');
  1226. var fields = [];
  1227. var results = [];
  1228. var sortPriority = $__default['default'].map($rows, function (row) {
  1229. var $row = $__default['default'](row);
  1230. var name = $row.find('.multi-sort-name').val();
  1231. var order = $row.find('.multi-sort-order').val();
  1232. fields.push(name);
  1233. return {
  1234. sortName: name,
  1235. sortOrder: order
  1236. };
  1237. });
  1238. var sorted_fields = fields.sort();
  1239. for (var i = 0; i < fields.length - 1; i++) {
  1240. if (sorted_fields[i + 1] === sorted_fields[i]) {
  1241. results.push(sorted_fields[i]);
  1242. }
  1243. }
  1244. if (results.length > 0) {
  1245. if ($alert.length === 0) {
  1246. $alert = "<div class=\"alert alert-danger\" role=\"alert\"><strong>".concat(that.options.formatDuplicateAlertTitle(), "</strong> ").concat(that.options.formatDuplicateAlertDescription(), "</div>");
  1247. $__default['default']($alert).insertBefore(that.$sortModal.find('.bars'));
  1248. }
  1249. } else {
  1250. if ($alert.length === 1) {
  1251. $__default['default']($alert).remove();
  1252. }
  1253. if ($__default['default'].inArray($__default['default'].fn.bootstrapTable.theme, ['bootstrap3', 'bootstrap4']) !== -1) {
  1254. that.$sortModal.modal('hide');
  1255. }
  1256. that.multiSort(sortPriority);
  1257. }
  1258. });
  1259. if (that.options.sortPriority === null || that.options.sortPriority.length === 0) {
  1260. if (that.options.sortName) {
  1261. that.options.sortPriority = [{
  1262. sortName: that.options.sortName,
  1263. sortOrder: that.options.sortOrder
  1264. }];
  1265. }
  1266. }
  1267. if (that.options.sortPriority !== null && that.options.sortPriority.length > 0) {
  1268. if ($rows.length < that.options.sortPriority.length && _typeof(that.options.sortPriority) === 'object') {
  1269. for (var i = 0; i < that.options.sortPriority.length; i++) {
  1270. that.addLevel(i, that.options.sortPriority[i]);
  1271. }
  1272. }
  1273. } else {
  1274. that.addLevel(0);
  1275. }
  1276. that.setButtonStates();
  1277. }
  1278. };
  1279. $__default['default'].fn.bootstrapTable.methods.push('multipleSort');
  1280. $__default['default'].fn.bootstrapTable.methods.push('multiSort');
  1281. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults, {
  1282. showMultiSort: false,
  1283. showMultiSortButton: true,
  1284. multiSortStrictSort: false,
  1285. sortPriority: null,
  1286. onMultipleSort: function onMultipleSort() {
  1287. return false;
  1288. }
  1289. });
  1290. $__default['default'].extend($__default['default'].fn.bootstrapTable.Constructor.EVENTS, {
  1291. 'multiple-sort.bs.table': 'onMultipleSort'
  1292. });
  1293. $__default['default'].extend($__default['default'].fn.bootstrapTable.locales, {
  1294. formatMultipleSort: function formatMultipleSort() {
  1295. return 'Multiple Sort';
  1296. },
  1297. formatAddLevel: function formatAddLevel() {
  1298. return 'Add Level';
  1299. },
  1300. formatDeleteLevel: function formatDeleteLevel() {
  1301. return 'Delete Level';
  1302. },
  1303. formatColumn: function formatColumn() {
  1304. return 'Column';
  1305. },
  1306. formatOrder: function formatOrder() {
  1307. return 'Order';
  1308. },
  1309. formatSortBy: function formatSortBy() {
  1310. return 'Sort by';
  1311. },
  1312. formatThenBy: function formatThenBy() {
  1313. return 'Then by';
  1314. },
  1315. formatSort: function formatSort() {
  1316. return 'Sort';
  1317. },
  1318. formatCancel: function formatCancel() {
  1319. return 'Cancel';
  1320. },
  1321. formatDuplicateAlertTitle: function formatDuplicateAlertTitle() {
  1322. return 'Duplicate(s) detected!';
  1323. },
  1324. formatDuplicateAlertDescription: function formatDuplicateAlertDescription() {
  1325. return 'Please remove or change any duplicate column.';
  1326. },
  1327. formatSortOrders: function formatSortOrders() {
  1328. return {
  1329. asc: 'Ascending',
  1330. desc: 'Descending'
  1331. };
  1332. }
  1333. });
  1334. $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults, $__default['default'].fn.bootstrapTable.locales);
  1335. var BootstrapTable = $__default['default'].fn.bootstrapTable.Constructor;
  1336. var _initToolbar = BootstrapTable.prototype.initToolbar;
  1337. var _destroy = BootstrapTable.prototype.destroy;
  1338. BootstrapTable.prototype.initToolbar = function () {
  1339. var _this = this;
  1340. this.showToolbar = this.showToolbar || this.options.showMultiSort;
  1341. var that = this;
  1342. var sortModalSelector = "sortModal_".concat(this.$el.attr('id'));
  1343. var sortModalId = "#".concat(sortModalSelector);
  1344. var $multiSortBtn = this.$toolbar.find('div.multi-sort');
  1345. var o = this.options;
  1346. this.$sortModal = $__default['default'](sortModalId);
  1347. this.sortModalSelector = sortModalSelector;
  1348. if (that.options.sortPriority !== null) {
  1349. that.onMultipleSort();
  1350. }
  1351. if (this.options.showMultiSortButton) {
  1352. this.buttons = Object.assign(this.buttons, {
  1353. multipleSort: {
  1354. html: Utils.sprintf(theme.html.multipleSortButton, that.sortModalSelector, this.options.formatMultipleSort(), Utils.sprintf(that.constants.html.icon, o.iconsPrefix, o.icons.sort))
  1355. }
  1356. });
  1357. }
  1358. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1359. args[_key] = arguments[_key];
  1360. }
  1361. _initToolbar.apply(this, Array.prototype.slice.apply(args));
  1362. if (that.options.sidePagination === 'server' && !isSingleSort && that.options.sortPriority !== null) {
  1363. var t = that.options.queryParams;
  1364. that.options.queryParams = function (params) {
  1365. params.multiSort = that.options.sortPriority;
  1366. return t(params);
  1367. };
  1368. }
  1369. if (this.options.showMultiSort) {
  1370. if (!$multiSortBtn.length && this.options.showMultiSortButton) {
  1371. if ($__default['default'].fn.bootstrapTable.theme === 'semantic') {
  1372. this.$toolbar.find('.multi-sort').on('click', function () {
  1373. $__default['default'](sortModalId).modal('show');
  1374. });
  1375. } else if ($__default['default'].fn.bootstrapTable.theme === 'materialize') {
  1376. this.$toolbar.find('.multi-sort').on('click', function () {
  1377. $__default['default'](sortModalId).modal();
  1378. });
  1379. } else if ($__default['default'].fn.bootstrapTable.theme === 'bootstrap-table') {
  1380. this.$toolbar.find('.multi-sort').on('click', function () {
  1381. $__default['default'](sortModalId).addClass('show');
  1382. });
  1383. } else if ($__default['default'].fn.bootstrapTable.theme === 'foundation') {
  1384. this.$toolbar.find('.multi-sort').on('click', function () {
  1385. if (!_this.foundationModal) {
  1386. // eslint-disable-next-line no-undef
  1387. _this.foundationModal = new Foundation.Reveal($__default['default'](sortModalId));
  1388. }
  1389. _this.foundationModal.open();
  1390. });
  1391. } else if ($__default['default'].fn.bootstrapTable.theme === 'bulma') {
  1392. this.$toolbar.find('.multi-sort').on('click', function () {
  1393. $__default['default']('html').toggleClass('is-clipped');
  1394. $__default['default'](sortModalId).toggleClass('is-active');
  1395. $__default['default']('button[data-close]').one('click', function () {
  1396. $__default['default']('html').toggleClass('is-clipped');
  1397. $__default['default'](sortModalId).toggleClass('is-active');
  1398. });
  1399. });
  1400. }
  1401. showSortModal(that);
  1402. }
  1403. this.$el.on('sort.bs.table', function () {
  1404. isSingleSort = true;
  1405. });
  1406. this.$el.on('multiple-sort.bs.table', function () {
  1407. isSingleSort = false;
  1408. });
  1409. this.$el.on('load-success.bs.table', function () {
  1410. if (!isSingleSort && that.options.sortPriority !== null && _typeof(that.options.sortPriority) === 'object' && that.options.sidePagination !== 'server') {
  1411. that.onMultipleSort();
  1412. }
  1413. });
  1414. this.$el.on('column-switch.bs.table', function (field, checked) {
  1415. for (var i = 0; i < that.options.sortPriority.length; i++) {
  1416. if (that.options.sortPriority[i].sortName === checked) {
  1417. that.options.sortPriority.splice(i, 1);
  1418. }
  1419. }
  1420. that.assignSortableArrows();
  1421. that.$sortModal.remove();
  1422. showSortModal(that);
  1423. });
  1424. this.$el.on('reset-view.bs.table', function () {
  1425. if (!isSingleSort && that.options.sortPriority !== null && _typeof(that.options.sortPriority) === 'object') {
  1426. that.assignSortableArrows();
  1427. }
  1428. });
  1429. }
  1430. };
  1431. BootstrapTable.prototype.destroy = function () {
  1432. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  1433. args[_key2] = arguments[_key2];
  1434. }
  1435. _destroy.apply(this, Array.prototype.slice.apply(args));
  1436. if (this.options.showMultiSort) {
  1437. this.enableCustomSort = false;
  1438. this.$sortModal.remove();
  1439. }
  1440. };
  1441. BootstrapTable.prototype.multipleSort = function () {
  1442. var that = this;
  1443. if (!isSingleSort && that.options.sortPriority !== null && _typeof(that.options.sortPriority) === 'object' && that.options.sidePagination !== 'server') {
  1444. that.onMultipleSort();
  1445. }
  1446. };
  1447. BootstrapTable.prototype.onMultipleSort = function () {
  1448. var that = this;
  1449. var cmp = function cmp(x, y) {
  1450. return x > y ? 1 : x < y ? -1 : 0;
  1451. };
  1452. var arrayCmp = function arrayCmp(a, b) {
  1453. var arr1 = [];
  1454. var arr2 = [];
  1455. for (var i = 0; i < that.options.sortPriority.length; i++) {
  1456. var fieldName = that.options.sortPriority[i].sortName;
  1457. var fieldIndex = that.header.fields.indexOf(fieldName);
  1458. var sorterName = that.header.sorters[that.header.fields.indexOf(fieldName)];
  1459. if (that.header.sortNames[fieldIndex]) {
  1460. fieldName = that.header.sortNames[fieldIndex];
  1461. }
  1462. var order = that.options.sortPriority[i].sortOrder === 'desc' ? -1 : 1;
  1463. var aa = Utils.getItemField(a, fieldName);
  1464. var bb = Utils.getItemField(b, fieldName);
  1465. var value1 = $__default['default'].fn.bootstrapTable.utils.calculateObjectValue(that.header, sorterName, [aa, bb]);
  1466. var value2 = $__default['default'].fn.bootstrapTable.utils.calculateObjectValue(that.header, sorterName, [bb, aa]);
  1467. if (value1 !== undefined && value2 !== undefined) {
  1468. arr1.push(order * value1);
  1469. arr2.push(order * value2);
  1470. continue;
  1471. }
  1472. if (aa === undefined || aa === null) aa = '';
  1473. if (bb === undefined || bb === null) bb = '';
  1474. if ($__default['default'].isNumeric(aa) && $__default['default'].isNumeric(bb)) {
  1475. aa = parseFloat(aa);
  1476. bb = parseFloat(bb);
  1477. } else {
  1478. aa = aa.toString();
  1479. bb = bb.toString();
  1480. if (that.options.multiSortStrictSort) {
  1481. aa = aa.toLowerCase();
  1482. bb = bb.toLowerCase();
  1483. }
  1484. }
  1485. arr1.push(order * cmp(aa, bb));
  1486. arr2.push(order * cmp(bb, aa));
  1487. }
  1488. return cmp(arr1, arr2);
  1489. };
  1490. this.enableCustomSort = true;
  1491. this.data.sort(function (a, b) {
  1492. return arrayCmp(a, b);
  1493. });
  1494. this.initBody();
  1495. this.assignSortableArrows();
  1496. this.trigger('multiple-sort');
  1497. };
  1498. BootstrapTable.prototype.addLevel = function (index, sortPriority) {
  1499. var text = index === 0 ? this.options.formatSortBy() : this.options.formatThenBy();
  1500. this.$sortModal.find('tbody').append($__default['default']('<tr>').append($__default['default']('<td>').text(text)).append($__default['default']('<td>').append($__default['default'](Utils.sprintf(theme.html.multipleSortSelect, this.constants.classes.paginationDropdown, 'multi-sort-name')))).append($__default['default']('<td>').append($__default['default'](Utils.sprintf(theme.html.multipleSortSelect, this.constants.classes.paginationDropdown, 'multi-sort-order')))));
  1501. var $multiSortName = this.$sortModal.find('.multi-sort-name').last();
  1502. var $multiSortOrder = this.$sortModal.find('.multi-sort-order').last();
  1503. $__default['default'].each(this.columns, function (i, column) {
  1504. if (column.sortable === false || column.visible === false) {
  1505. return true;
  1506. }
  1507. $multiSortName.append("<option value=\"".concat(column.field, "\">").concat(column.title, "</option>"));
  1508. });
  1509. $__default['default'].each(this.options.formatSortOrders(), function (value, order) {
  1510. $multiSortOrder.append("<option value=\"".concat(value, "\">").concat(order, "</option>"));
  1511. });
  1512. if (sortPriority !== undefined) {
  1513. $multiSortName.find("option[value=\"".concat(sortPriority.sortName, "\"]")).attr('selected', true);
  1514. $multiSortOrder.find("option[value=\"".concat(sortPriority.sortOrder, "\"]")).attr('selected', true);
  1515. }
  1516. };
  1517. BootstrapTable.prototype.assignSortableArrows = function () {
  1518. var that = this;
  1519. var headers = that.$header.find('th');
  1520. for (var i = 0; i < headers.length; i++) {
  1521. for (var c = 0; c < that.options.sortPriority.length; c++) {
  1522. if ($__default['default'](headers[i]).data('field') === that.options.sortPriority[c].sortName) {
  1523. $__default['default'](headers[i]).find('.sortable').removeClass('desc asc').addClass(that.options.sortPriority[c].sortOrder);
  1524. }
  1525. }
  1526. }
  1527. };
  1528. BootstrapTable.prototype.setButtonStates = function () {
  1529. var total = this.$sortModal.find('.multi-sort-name:first option').length;
  1530. var current = this.$sortModal.find('tbody tr').length;
  1531. if (current === total) {
  1532. this.$sortModal.find('#add').attr('disabled', 'disabled');
  1533. }
  1534. if (current > 1) {
  1535. this.$sortModal.find('#delete').removeAttr('disabled');
  1536. }
  1537. if (current < total) {
  1538. this.$sortModal.find('#add').removeAttr('disabled');
  1539. }
  1540. if (current === 1) {
  1541. this.$sortModal.find('#delete').attr('disabled', 'disabled');
  1542. }
  1543. };
  1544. BootstrapTable.prototype.multiSort = function (sortPriority) {
  1545. var _this2 = this;
  1546. this.options.sortPriority = sortPriority;
  1547. this.options.sortName = undefined;
  1548. if (this.options.sidePagination === 'server') {
  1549. var queryParams = this.options.queryParams;
  1550. this.options.queryParams = function (params) {
  1551. params.multiSort = _this2.options.sortPriority;
  1552. return $__default['default'].fn.bootstrapTable.utils.calculateObjectValue(_this2.options, queryParams, [params]);
  1553. };
  1554. isSingleSort = false;
  1555. this.initServer(this.options.silentSort);
  1556. return;
  1557. }
  1558. this.onMultipleSort();
  1559. };
  1560. })));