bootstrap-table-pipeline.js 60 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774
  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 ($$4) { 'use strict';
  6. function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
  7. var $__default = /*#__PURE__*/_interopDefaultLegacy($$4);
  8. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  9. var check = function (it) {
  10. return it && it.Math == Math && it;
  11. };
  12. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  13. var global$q =
  14. // eslint-disable-next-line es-x/no-global-this -- safe
  15. check(typeof globalThis == 'object' && globalThis) ||
  16. check(typeof window == 'object' && window) ||
  17. // eslint-disable-next-line no-restricted-globals -- safe
  18. check(typeof self == 'object' && self) ||
  19. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  20. // eslint-disable-next-line no-new-func -- fallback
  21. (function () { return this; })() || Function('return this')();
  22. var objectGetOwnPropertyDescriptor = {};
  23. var fails$c = function (exec) {
  24. try {
  25. return !!exec();
  26. } catch (error) {
  27. return true;
  28. }
  29. };
  30. var fails$b = fails$c;
  31. // Detect IE8's incomplete defineProperty implementation
  32. var descriptors = !fails$b(function () {
  33. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  34. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  35. });
  36. var fails$a = fails$c;
  37. var functionBindNative = !fails$a(function () {
  38. // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
  39. var test = (function () { /* empty */ }).bind();
  40. // eslint-disable-next-line no-prototype-builtins -- safe
  41. return typeof test != 'function' || test.hasOwnProperty('prototype');
  42. });
  43. var NATIVE_BIND$2 = functionBindNative;
  44. var call$4 = Function.prototype.call;
  45. var functionCall = NATIVE_BIND$2 ? call$4.bind(call$4) : function () {
  46. return call$4.apply(call$4, arguments);
  47. };
  48. var objectPropertyIsEnumerable = {};
  49. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  50. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  51. var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  52. // Nashorn ~ JDK8 bug
  53. var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  54. // `Object.prototype.propertyIsEnumerable` method implementation
  55. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  56. objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  57. var descriptor = getOwnPropertyDescriptor$1(this, V);
  58. return !!descriptor && descriptor.enumerable;
  59. } : $propertyIsEnumerable;
  60. var createPropertyDescriptor$3 = function (bitmap, value) {
  61. return {
  62. enumerable: !(bitmap & 1),
  63. configurable: !(bitmap & 2),
  64. writable: !(bitmap & 4),
  65. value: value
  66. };
  67. };
  68. var NATIVE_BIND$1 = functionBindNative;
  69. var FunctionPrototype$1 = Function.prototype;
  70. var bind$2 = FunctionPrototype$1.bind;
  71. var call$3 = FunctionPrototype$1.call;
  72. var uncurryThis$g = NATIVE_BIND$1 && bind$2.bind(call$3, call$3);
  73. var functionUncurryThis = NATIVE_BIND$1 ? function (fn) {
  74. return fn && uncurryThis$g(fn);
  75. } : function (fn) {
  76. return fn && function () {
  77. return call$3.apply(fn, arguments);
  78. };
  79. };
  80. var uncurryThis$f = functionUncurryThis;
  81. var toString$5 = uncurryThis$f({}.toString);
  82. var stringSlice = uncurryThis$f(''.slice);
  83. var classofRaw$1 = function (it) {
  84. return stringSlice(toString$5(it), 8, -1);
  85. };
  86. var global$p = global$q;
  87. var uncurryThis$e = functionUncurryThis;
  88. var fails$9 = fails$c;
  89. var classof$5 = classofRaw$1;
  90. var Object$4 = global$p.Object;
  91. var split = uncurryThis$e(''.split);
  92. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  93. var indexedObject = fails$9(function () {
  94. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  95. // eslint-disable-next-line no-prototype-builtins -- safe
  96. return !Object$4('z').propertyIsEnumerable(0);
  97. }) ? function (it) {
  98. return classof$5(it) == 'String' ? split(it, '') : Object$4(it);
  99. } : Object$4;
  100. var global$o = global$q;
  101. var TypeError$7 = global$o.TypeError;
  102. // `RequireObjectCoercible` abstract operation
  103. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  104. var requireObjectCoercible$3 = function (it) {
  105. if (it == undefined) throw TypeError$7("Can't call method on " + it);
  106. return it;
  107. };
  108. // toObject with fallback for non-array-like ES3 strings
  109. var IndexedObject$1 = indexedObject;
  110. var requireObjectCoercible$2 = requireObjectCoercible$3;
  111. var toIndexedObject$4 = function (it) {
  112. return IndexedObject$1(requireObjectCoercible$2(it));
  113. };
  114. // `IsCallable` abstract operation
  115. // https://tc39.es/ecma262/#sec-iscallable
  116. var isCallable$c = function (argument) {
  117. return typeof argument == 'function';
  118. };
  119. var isCallable$b = isCallable$c;
  120. var isObject$7 = function (it) {
  121. return typeof it == 'object' ? it !== null : isCallable$b(it);
  122. };
  123. var global$n = global$q;
  124. var isCallable$a = isCallable$c;
  125. var aFunction = function (argument) {
  126. return isCallable$a(argument) ? argument : undefined;
  127. };
  128. var getBuiltIn$4 = function (namespace, method) {
  129. return arguments.length < 2 ? aFunction(global$n[namespace]) : global$n[namespace] && global$n[namespace][method];
  130. };
  131. var uncurryThis$d = functionUncurryThis;
  132. var objectIsPrototypeOf = uncurryThis$d({}.isPrototypeOf);
  133. var getBuiltIn$3 = getBuiltIn$4;
  134. var engineUserAgent = getBuiltIn$3('navigator', 'userAgent') || '';
  135. var global$m = global$q;
  136. var userAgent = engineUserAgent;
  137. var process = global$m.process;
  138. var Deno = global$m.Deno;
  139. var versions = process && process.versions || Deno && Deno.version;
  140. var v8 = versions && versions.v8;
  141. var match, version;
  142. if (v8) {
  143. match = v8.split('.');
  144. // in old Chrome, versions of V8 isn't V8 = Chrome / 10
  145. // but their correct versions are not interesting for us
  146. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  147. }
  148. // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
  149. // so check `userAgent` even if `.v8` exists, but 0
  150. if (!version && userAgent) {
  151. match = userAgent.match(/Edge\/(\d+)/);
  152. if (!match || match[1] >= 74) {
  153. match = userAgent.match(/Chrome\/(\d+)/);
  154. if (match) version = +match[1];
  155. }
  156. }
  157. var engineV8Version = version;
  158. /* eslint-disable es-x/no-symbol -- required for testing */
  159. var V8_VERSION$1 = engineV8Version;
  160. var fails$8 = fails$c;
  161. // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
  162. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$8(function () {
  163. var symbol = Symbol();
  164. // Chrome 38 Symbol has incorrect toString conversion
  165. // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
  166. return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
  167. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  168. !Symbol.sham && V8_VERSION$1 && V8_VERSION$1 < 41;
  169. });
  170. /* eslint-disable es-x/no-symbol -- required for testing */
  171. var NATIVE_SYMBOL$1 = nativeSymbol;
  172. var useSymbolAsUid = NATIVE_SYMBOL$1
  173. && !Symbol.sham
  174. && typeof Symbol.iterator == 'symbol';
  175. var global$l = global$q;
  176. var getBuiltIn$2 = getBuiltIn$4;
  177. var isCallable$9 = isCallable$c;
  178. var isPrototypeOf = objectIsPrototypeOf;
  179. var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
  180. var Object$3 = global$l.Object;
  181. var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
  182. return typeof it == 'symbol';
  183. } : function (it) {
  184. var $Symbol = getBuiltIn$2('Symbol');
  185. return isCallable$9($Symbol) && isPrototypeOf($Symbol.prototype, Object$3(it));
  186. };
  187. var global$k = global$q;
  188. var String$3 = global$k.String;
  189. var tryToString$1 = function (argument) {
  190. try {
  191. return String$3(argument);
  192. } catch (error) {
  193. return 'Object';
  194. }
  195. };
  196. var global$j = global$q;
  197. var isCallable$8 = isCallable$c;
  198. var tryToString = tryToString$1;
  199. var TypeError$6 = global$j.TypeError;
  200. // `Assert: IsCallable(argument) is true`
  201. var aCallable$2 = function (argument) {
  202. if (isCallable$8(argument)) return argument;
  203. throw TypeError$6(tryToString(argument) + ' is not a function');
  204. };
  205. var aCallable$1 = aCallable$2;
  206. // `GetMethod` abstract operation
  207. // https://tc39.es/ecma262/#sec-getmethod
  208. var getMethod$1 = function (V, P) {
  209. var func = V[P];
  210. return func == null ? undefined : aCallable$1(func);
  211. };
  212. var global$i = global$q;
  213. var call$2 = functionCall;
  214. var isCallable$7 = isCallable$c;
  215. var isObject$6 = isObject$7;
  216. var TypeError$5 = global$i.TypeError;
  217. // `OrdinaryToPrimitive` abstract operation
  218. // https://tc39.es/ecma262/#sec-ordinarytoprimitive
  219. var ordinaryToPrimitive$1 = function (input, pref) {
  220. var fn, val;
  221. if (pref === 'string' && isCallable$7(fn = input.toString) && !isObject$6(val = call$2(fn, input))) return val;
  222. if (isCallable$7(fn = input.valueOf) && !isObject$6(val = call$2(fn, input))) return val;
  223. if (pref !== 'string' && isCallable$7(fn = input.toString) && !isObject$6(val = call$2(fn, input))) return val;
  224. throw TypeError$5("Can't convert object to primitive value");
  225. };
  226. var shared$3 = {exports: {}};
  227. var global$h = global$q;
  228. // eslint-disable-next-line es-x/no-object-defineproperty -- safe
  229. var defineProperty$1 = Object.defineProperty;
  230. var setGlobal$3 = function (key, value) {
  231. try {
  232. defineProperty$1(global$h, key, { value: value, configurable: true, writable: true });
  233. } catch (error) {
  234. global$h[key] = value;
  235. } return value;
  236. };
  237. var global$g = global$q;
  238. var setGlobal$2 = setGlobal$3;
  239. var SHARED = '__core-js_shared__';
  240. var store$3 = global$g[SHARED] || setGlobal$2(SHARED, {});
  241. var sharedStore = store$3;
  242. var store$2 = sharedStore;
  243. (shared$3.exports = function (key, value) {
  244. return store$2[key] || (store$2[key] = value !== undefined ? value : {});
  245. })('versions', []).push({
  246. version: '3.22.5',
  247. mode: 'global',
  248. copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
  249. license: 'https://github.com/zloirock/core-js/blob/v3.22.5/LICENSE',
  250. source: 'https://github.com/zloirock/core-js'
  251. });
  252. var global$f = global$q;
  253. var requireObjectCoercible$1 = requireObjectCoercible$3;
  254. var Object$2 = global$f.Object;
  255. // `ToObject` abstract operation
  256. // https://tc39.es/ecma262/#sec-toobject
  257. var toObject$2 = function (argument) {
  258. return Object$2(requireObjectCoercible$1(argument));
  259. };
  260. var uncurryThis$c = functionUncurryThis;
  261. var toObject$1 = toObject$2;
  262. var hasOwnProperty = uncurryThis$c({}.hasOwnProperty);
  263. // `HasOwnProperty` abstract operation
  264. // https://tc39.es/ecma262/#sec-hasownproperty
  265. // eslint-disable-next-line es-x/no-object-hasown -- safe
  266. var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
  267. return hasOwnProperty(toObject$1(it), key);
  268. };
  269. var uncurryThis$b = functionUncurryThis;
  270. var id = 0;
  271. var postfix = Math.random();
  272. var toString$4 = uncurryThis$b(1.0.toString);
  273. var uid$2 = function (key) {
  274. return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$4(++id + postfix, 36);
  275. };
  276. var global$e = global$q;
  277. var shared$2 = shared$3.exports;
  278. var hasOwn$6 = hasOwnProperty_1;
  279. var uid$1 = uid$2;
  280. var NATIVE_SYMBOL = nativeSymbol;
  281. var USE_SYMBOL_AS_UID = useSymbolAsUid;
  282. var WellKnownSymbolsStore = shared$2('wks');
  283. var Symbol$2 = global$e.Symbol;
  284. var symbolFor = Symbol$2 && Symbol$2['for'];
  285. var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$2 : Symbol$2 && Symbol$2.withoutSetter || uid$1;
  286. var wellKnownSymbol$6 = function (name) {
  287. if (!hasOwn$6(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
  288. var description = 'Symbol.' + name;
  289. if (NATIVE_SYMBOL && hasOwn$6(Symbol$2, name)) {
  290. WellKnownSymbolsStore[name] = Symbol$2[name];
  291. } else if (USE_SYMBOL_AS_UID && symbolFor) {
  292. WellKnownSymbolsStore[name] = symbolFor(description);
  293. } else {
  294. WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
  295. }
  296. } return WellKnownSymbolsStore[name];
  297. };
  298. var global$d = global$q;
  299. var call$1 = functionCall;
  300. var isObject$5 = isObject$7;
  301. var isSymbol$1 = isSymbol$2;
  302. var getMethod = getMethod$1;
  303. var ordinaryToPrimitive = ordinaryToPrimitive$1;
  304. var wellKnownSymbol$5 = wellKnownSymbol$6;
  305. var TypeError$4 = global$d.TypeError;
  306. var TO_PRIMITIVE = wellKnownSymbol$5('toPrimitive');
  307. // `ToPrimitive` abstract operation
  308. // https://tc39.es/ecma262/#sec-toprimitive
  309. var toPrimitive$1 = function (input, pref) {
  310. if (!isObject$5(input) || isSymbol$1(input)) return input;
  311. var exoticToPrim = getMethod(input, TO_PRIMITIVE);
  312. var result;
  313. if (exoticToPrim) {
  314. if (pref === undefined) pref = 'default';
  315. result = call$1(exoticToPrim, input, pref);
  316. if (!isObject$5(result) || isSymbol$1(result)) return result;
  317. throw TypeError$4("Can't convert object to primitive value");
  318. }
  319. if (pref === undefined) pref = 'number';
  320. return ordinaryToPrimitive(input, pref);
  321. };
  322. var toPrimitive = toPrimitive$1;
  323. var isSymbol = isSymbol$2;
  324. // `ToPropertyKey` abstract operation
  325. // https://tc39.es/ecma262/#sec-topropertykey
  326. var toPropertyKey$3 = function (argument) {
  327. var key = toPrimitive(argument, 'string');
  328. return isSymbol(key) ? key : key + '';
  329. };
  330. var global$c = global$q;
  331. var isObject$4 = isObject$7;
  332. var document = global$c.document;
  333. // typeof document.createElement is 'object' in old IE
  334. var EXISTS$1 = isObject$4(document) && isObject$4(document.createElement);
  335. var documentCreateElement = function (it) {
  336. return EXISTS$1 ? document.createElement(it) : {};
  337. };
  338. var DESCRIPTORS$6 = descriptors;
  339. var fails$7 = fails$c;
  340. var createElement = documentCreateElement;
  341. // Thanks to IE8 for its funny defineProperty
  342. var ie8DomDefine = !DESCRIPTORS$6 && !fails$7(function () {
  343. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  344. return Object.defineProperty(createElement('div'), 'a', {
  345. get: function () { return 7; }
  346. }).a != 7;
  347. });
  348. var DESCRIPTORS$5 = descriptors;
  349. var call = functionCall;
  350. var propertyIsEnumerableModule = objectPropertyIsEnumerable;
  351. var createPropertyDescriptor$2 = createPropertyDescriptor$3;
  352. var toIndexedObject$3 = toIndexedObject$4;
  353. var toPropertyKey$2 = toPropertyKey$3;
  354. var hasOwn$5 = hasOwnProperty_1;
  355. var IE8_DOM_DEFINE$1 = ie8DomDefine;
  356. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  357. var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  358. // `Object.getOwnPropertyDescriptor` method
  359. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  360. objectGetOwnPropertyDescriptor.f = DESCRIPTORS$5 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
  361. O = toIndexedObject$3(O);
  362. P = toPropertyKey$2(P);
  363. if (IE8_DOM_DEFINE$1) try {
  364. return $getOwnPropertyDescriptor$1(O, P);
  365. } catch (error) { /* empty */ }
  366. if (hasOwn$5(O, P)) return createPropertyDescriptor$2(!call(propertyIsEnumerableModule.f, O, P), O[P]);
  367. };
  368. var objectDefineProperty = {};
  369. var DESCRIPTORS$4 = descriptors;
  370. var fails$6 = fails$c;
  371. // V8 ~ Chrome 36-
  372. // https://bugs.chromium.org/p/v8/issues/detail?id=3334
  373. var v8PrototypeDefineBug = DESCRIPTORS$4 && fails$6(function () {
  374. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  375. return Object.defineProperty(function () { /* empty */ }, 'prototype', {
  376. value: 42,
  377. writable: false
  378. }).prototype != 42;
  379. });
  380. var global$b = global$q;
  381. var isObject$3 = isObject$7;
  382. var String$2 = global$b.String;
  383. var TypeError$3 = global$b.TypeError;
  384. // `Assert: Type(argument) is Object`
  385. var anObject$2 = function (argument) {
  386. if (isObject$3(argument)) return argument;
  387. throw TypeError$3(String$2(argument) + ' is not an object');
  388. };
  389. var global$a = global$q;
  390. var DESCRIPTORS$3 = descriptors;
  391. var IE8_DOM_DEFINE = ie8DomDefine;
  392. var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
  393. var anObject$1 = anObject$2;
  394. var toPropertyKey$1 = toPropertyKey$3;
  395. var TypeError$2 = global$a.TypeError;
  396. // eslint-disable-next-line es-x/no-object-defineproperty -- safe
  397. var $defineProperty = Object.defineProperty;
  398. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  399. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  400. var ENUMERABLE = 'enumerable';
  401. var CONFIGURABLE$1 = 'configurable';
  402. var WRITABLE = 'writable';
  403. // `Object.defineProperty` method
  404. // https://tc39.es/ecma262/#sec-object.defineproperty
  405. objectDefineProperty.f = DESCRIPTORS$3 ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
  406. anObject$1(O);
  407. P = toPropertyKey$1(P);
  408. anObject$1(Attributes);
  409. if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  410. var current = $getOwnPropertyDescriptor(O, P);
  411. if (current && current[WRITABLE]) {
  412. O[P] = Attributes.value;
  413. Attributes = {
  414. configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
  415. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  416. writable: false
  417. };
  418. }
  419. } return $defineProperty(O, P, Attributes);
  420. } : $defineProperty : function defineProperty(O, P, Attributes) {
  421. anObject$1(O);
  422. P = toPropertyKey$1(P);
  423. anObject$1(Attributes);
  424. if (IE8_DOM_DEFINE) try {
  425. return $defineProperty(O, P, Attributes);
  426. } catch (error) { /* empty */ }
  427. if ('get' in Attributes || 'set' in Attributes) throw TypeError$2('Accessors not supported');
  428. if ('value' in Attributes) O[P] = Attributes.value;
  429. return O;
  430. };
  431. var DESCRIPTORS$2 = descriptors;
  432. var definePropertyModule$2 = objectDefineProperty;
  433. var createPropertyDescriptor$1 = createPropertyDescriptor$3;
  434. var createNonEnumerableProperty$3 = DESCRIPTORS$2 ? function (object, key, value) {
  435. return definePropertyModule$2.f(object, key, createPropertyDescriptor$1(1, value));
  436. } : function (object, key, value) {
  437. object[key] = value;
  438. return object;
  439. };
  440. var makeBuiltIn$2 = {exports: {}};
  441. var DESCRIPTORS$1 = descriptors;
  442. var hasOwn$4 = hasOwnProperty_1;
  443. var FunctionPrototype = Function.prototype;
  444. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  445. var getDescriptor = DESCRIPTORS$1 && Object.getOwnPropertyDescriptor;
  446. var EXISTS = hasOwn$4(FunctionPrototype, 'name');
  447. // additional protection from minified / mangled / dropped function names
  448. var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
  449. var CONFIGURABLE = EXISTS && (!DESCRIPTORS$1 || (DESCRIPTORS$1 && getDescriptor(FunctionPrototype, 'name').configurable));
  450. var functionName = {
  451. EXISTS: EXISTS,
  452. PROPER: PROPER,
  453. CONFIGURABLE: CONFIGURABLE
  454. };
  455. var uncurryThis$a = functionUncurryThis;
  456. var isCallable$6 = isCallable$c;
  457. var store$1 = sharedStore;
  458. var functionToString = uncurryThis$a(Function.toString);
  459. // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
  460. if (!isCallable$6(store$1.inspectSource)) {
  461. store$1.inspectSource = function (it) {
  462. return functionToString(it);
  463. };
  464. }
  465. var inspectSource$3 = store$1.inspectSource;
  466. var global$9 = global$q;
  467. var isCallable$5 = isCallable$c;
  468. var inspectSource$2 = inspectSource$3;
  469. var WeakMap$1 = global$9.WeakMap;
  470. var nativeWeakMap = isCallable$5(WeakMap$1) && /native code/.test(inspectSource$2(WeakMap$1));
  471. var shared$1 = shared$3.exports;
  472. var uid = uid$2;
  473. var keys = shared$1('keys');
  474. var sharedKey$1 = function (key) {
  475. return keys[key] || (keys[key] = uid(key));
  476. };
  477. var hiddenKeys$3 = {};
  478. var NATIVE_WEAK_MAP = nativeWeakMap;
  479. var global$8 = global$q;
  480. var uncurryThis$9 = functionUncurryThis;
  481. var isObject$2 = isObject$7;
  482. var createNonEnumerableProperty$2 = createNonEnumerableProperty$3;
  483. var hasOwn$3 = hasOwnProperty_1;
  484. var shared = sharedStore;
  485. var sharedKey = sharedKey$1;
  486. var hiddenKeys$2 = hiddenKeys$3;
  487. var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
  488. var TypeError$1 = global$8.TypeError;
  489. var WeakMap = global$8.WeakMap;
  490. var set, get, has;
  491. var enforce = function (it) {
  492. return has(it) ? get(it) : set(it, {});
  493. };
  494. var getterFor = function (TYPE) {
  495. return function (it) {
  496. var state;
  497. if (!isObject$2(it) || (state = get(it)).type !== TYPE) {
  498. throw TypeError$1('Incompatible receiver, ' + TYPE + ' required');
  499. } return state;
  500. };
  501. };
  502. if (NATIVE_WEAK_MAP || shared.state) {
  503. var store = shared.state || (shared.state = new WeakMap());
  504. var wmget = uncurryThis$9(store.get);
  505. var wmhas = uncurryThis$9(store.has);
  506. var wmset = uncurryThis$9(store.set);
  507. set = function (it, metadata) {
  508. if (wmhas(store, it)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
  509. metadata.facade = it;
  510. wmset(store, it, metadata);
  511. return metadata;
  512. };
  513. get = function (it) {
  514. return wmget(store, it) || {};
  515. };
  516. has = function (it) {
  517. return wmhas(store, it);
  518. };
  519. } else {
  520. var STATE = sharedKey('state');
  521. hiddenKeys$2[STATE] = true;
  522. set = function (it, metadata) {
  523. if (hasOwn$3(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
  524. metadata.facade = it;
  525. createNonEnumerableProperty$2(it, STATE, metadata);
  526. return metadata;
  527. };
  528. get = function (it) {
  529. return hasOwn$3(it, STATE) ? it[STATE] : {};
  530. };
  531. has = function (it) {
  532. return hasOwn$3(it, STATE);
  533. };
  534. }
  535. var internalState = {
  536. set: set,
  537. get: get,
  538. has: has,
  539. enforce: enforce,
  540. getterFor: getterFor
  541. };
  542. var fails$5 = fails$c;
  543. var isCallable$4 = isCallable$c;
  544. var hasOwn$2 = hasOwnProperty_1;
  545. var DESCRIPTORS = descriptors;
  546. var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
  547. var inspectSource$1 = inspectSource$3;
  548. var InternalStateModule = internalState;
  549. var enforceInternalState = InternalStateModule.enforce;
  550. var getInternalState = InternalStateModule.get;
  551. // eslint-disable-next-line es-x/no-object-defineproperty -- safe
  552. var defineProperty = Object.defineProperty;
  553. var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails$5(function () {
  554. return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
  555. });
  556. var TEMPLATE = String(String).split('String');
  557. var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
  558. if (String(name).slice(0, 7) === 'Symbol(') {
  559. name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
  560. }
  561. if (options && options.getter) name = 'get ' + name;
  562. if (options && options.setter) name = 'set ' + name;
  563. if (!hasOwn$2(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
  564. defineProperty(value, 'name', { value: name, configurable: true });
  565. }
  566. if (CONFIGURABLE_LENGTH && options && hasOwn$2(options, 'arity') && value.length !== options.arity) {
  567. defineProperty(value, 'length', { value: options.arity });
  568. }
  569. if (options && hasOwn$2(options, 'constructor') && options.constructor) {
  570. if (DESCRIPTORS) try {
  571. defineProperty(value, 'prototype', { writable: false });
  572. } catch (error) { /* empty */ }
  573. } else value.prototype = undefined;
  574. var state = enforceInternalState(value);
  575. if (!hasOwn$2(state, 'source')) {
  576. state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
  577. } return value;
  578. };
  579. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  580. // eslint-disable-next-line no-extend-native -- required
  581. Function.prototype.toString = makeBuiltIn$1(function toString() {
  582. return isCallable$4(this) && getInternalState(this).source || inspectSource$1(this);
  583. }, 'toString');
  584. var global$7 = global$q;
  585. var isCallable$3 = isCallable$c;
  586. var createNonEnumerableProperty$1 = createNonEnumerableProperty$3;
  587. var makeBuiltIn = makeBuiltIn$2.exports;
  588. var setGlobal$1 = setGlobal$3;
  589. var defineBuiltIn$2 = function (O, key, value, options) {
  590. var unsafe = options ? !!options.unsafe : false;
  591. var simple = options ? !!options.enumerable : false;
  592. var noTargetGet = options ? !!options.noTargetGet : false;
  593. var name = options && options.name !== undefined ? options.name : key;
  594. if (isCallable$3(value)) makeBuiltIn(value, name, options);
  595. if (O === global$7) {
  596. if (simple) O[key] = value;
  597. else setGlobal$1(key, value);
  598. return O;
  599. } else if (!unsafe) {
  600. delete O[key];
  601. } else if (!noTargetGet && O[key]) {
  602. simple = true;
  603. }
  604. if (simple) O[key] = value;
  605. else createNonEnumerableProperty$1(O, key, value);
  606. return O;
  607. };
  608. var objectGetOwnPropertyNames = {};
  609. var ceil = Math.ceil;
  610. var floor = Math.floor;
  611. // `ToIntegerOrInfinity` abstract operation
  612. // https://tc39.es/ecma262/#sec-tointegerorinfinity
  613. var toIntegerOrInfinity$2 = function (argument) {
  614. var number = +argument;
  615. // eslint-disable-next-line no-self-compare -- safe
  616. return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
  617. };
  618. var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
  619. var max$1 = Math.max;
  620. var min$1 = Math.min;
  621. // Helper for a popular repeating case of the spec:
  622. // Let integer be ? ToInteger(index).
  623. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  624. var toAbsoluteIndex$2 = function (index, length) {
  625. var integer = toIntegerOrInfinity$1(index);
  626. return integer < 0 ? max$1(integer + length, 0) : min$1(integer, length);
  627. };
  628. var toIntegerOrInfinity = toIntegerOrInfinity$2;
  629. var min = Math.min;
  630. // `ToLength` abstract operation
  631. // https://tc39.es/ecma262/#sec-tolength
  632. var toLength$1 = function (argument) {
  633. return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  634. };
  635. var toLength = toLength$1;
  636. // `LengthOfArrayLike` abstract operation
  637. // https://tc39.es/ecma262/#sec-lengthofarraylike
  638. var lengthOfArrayLike$3 = function (obj) {
  639. return toLength(obj.length);
  640. };
  641. var toIndexedObject$2 = toIndexedObject$4;
  642. var toAbsoluteIndex$1 = toAbsoluteIndex$2;
  643. var lengthOfArrayLike$2 = lengthOfArrayLike$3;
  644. // `Array.prototype.{ indexOf, includes }` methods implementation
  645. var createMethod$2 = function (IS_INCLUDES) {
  646. return function ($this, el, fromIndex) {
  647. var O = toIndexedObject$2($this);
  648. var length = lengthOfArrayLike$2(O);
  649. var index = toAbsoluteIndex$1(fromIndex, length);
  650. var value;
  651. // Array#includes uses SameValueZero equality algorithm
  652. // eslint-disable-next-line no-self-compare -- NaN check
  653. if (IS_INCLUDES && el != el) while (length > index) {
  654. value = O[index++];
  655. // eslint-disable-next-line no-self-compare -- NaN check
  656. if (value != value) return true;
  657. // Array#indexOf ignores holes, Array#includes - not
  658. } else for (;length > index; index++) {
  659. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  660. } return !IS_INCLUDES && -1;
  661. };
  662. };
  663. var arrayIncludes = {
  664. // `Array.prototype.includes` method
  665. // https://tc39.es/ecma262/#sec-array.prototype.includes
  666. includes: createMethod$2(true),
  667. // `Array.prototype.indexOf` method
  668. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  669. indexOf: createMethod$2(false)
  670. };
  671. var uncurryThis$8 = functionUncurryThis;
  672. var hasOwn$1 = hasOwnProperty_1;
  673. var toIndexedObject$1 = toIndexedObject$4;
  674. var indexOf = arrayIncludes.indexOf;
  675. var hiddenKeys$1 = hiddenKeys$3;
  676. var push$1 = uncurryThis$8([].push);
  677. var objectKeysInternal = function (object, names) {
  678. var O = toIndexedObject$1(object);
  679. var i = 0;
  680. var result = [];
  681. var key;
  682. for (key in O) !hasOwn$1(hiddenKeys$1, key) && hasOwn$1(O, key) && push$1(result, key);
  683. // Don't enum bug & hidden keys
  684. while (names.length > i) if (hasOwn$1(O, key = names[i++])) {
  685. ~indexOf(result, key) || push$1(result, key);
  686. }
  687. return result;
  688. };
  689. // IE8- don't enum bug keys
  690. var enumBugKeys$1 = [
  691. 'constructor',
  692. 'hasOwnProperty',
  693. 'isPrototypeOf',
  694. 'propertyIsEnumerable',
  695. 'toLocaleString',
  696. 'toString',
  697. 'valueOf'
  698. ];
  699. var internalObjectKeys = objectKeysInternal;
  700. var enumBugKeys = enumBugKeys$1;
  701. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  702. // `Object.getOwnPropertyNames` method
  703. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  704. // eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
  705. objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  706. return internalObjectKeys(O, hiddenKeys);
  707. };
  708. var objectGetOwnPropertySymbols = {};
  709. // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
  710. objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
  711. var getBuiltIn$1 = getBuiltIn$4;
  712. var uncurryThis$7 = functionUncurryThis;
  713. var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
  714. var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
  715. var anObject = anObject$2;
  716. var concat = uncurryThis$7([].concat);
  717. // all object keys, includes non-enumerable and symbols
  718. var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
  719. var keys = getOwnPropertyNamesModule.f(anObject(it));
  720. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  721. return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
  722. };
  723. var hasOwn = hasOwnProperty_1;
  724. var ownKeys = ownKeys$1;
  725. var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
  726. var definePropertyModule$1 = objectDefineProperty;
  727. var copyConstructorProperties$1 = function (target, source, exceptions) {
  728. var keys = ownKeys(source);
  729. var defineProperty = definePropertyModule$1.f;
  730. var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  731. for (var i = 0; i < keys.length; i++) {
  732. var key = keys[i];
  733. if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
  734. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  735. }
  736. }
  737. };
  738. var fails$4 = fails$c;
  739. var isCallable$2 = isCallable$c;
  740. var replacement = /#|\.prototype\./;
  741. var isForced$1 = function (feature, detection) {
  742. var value = data[normalize(feature)];
  743. return value == POLYFILL ? true
  744. : value == NATIVE ? false
  745. : isCallable$2(detection) ? fails$4(detection)
  746. : !!detection;
  747. };
  748. var normalize = isForced$1.normalize = function (string) {
  749. return String(string).replace(replacement, '.').toLowerCase();
  750. };
  751. var data = isForced$1.data = {};
  752. var NATIVE = isForced$1.NATIVE = 'N';
  753. var POLYFILL = isForced$1.POLYFILL = 'P';
  754. var isForced_1 = isForced$1;
  755. var global$6 = global$q;
  756. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  757. var createNonEnumerableProperty = createNonEnumerableProperty$3;
  758. var defineBuiltIn$1 = defineBuiltIn$2;
  759. var setGlobal = setGlobal$3;
  760. var copyConstructorProperties = copyConstructorProperties$1;
  761. var isForced = isForced_1;
  762. /*
  763. options.target - name of the target object
  764. options.global - target is the global object
  765. options.stat - export as static methods of target
  766. options.proto - export as prototype methods of target
  767. options.real - real prototype method for the `pure` version
  768. options.forced - export even if the native feature is available
  769. options.bind - bind methods to the target, required for the `pure` version
  770. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  771. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  772. options.sham - add a flag to not completely full polyfills
  773. options.enumerable - export as enumerable property
  774. options.noTargetGet - prevent calling a getter on target
  775. options.name - the .name of the function if it does not match the key
  776. */
  777. var _export = function (options, source) {
  778. var TARGET = options.target;
  779. var GLOBAL = options.global;
  780. var STATIC = options.stat;
  781. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  782. if (GLOBAL) {
  783. target = global$6;
  784. } else if (STATIC) {
  785. target = global$6[TARGET] || setGlobal(TARGET, {});
  786. } else {
  787. target = (global$6[TARGET] || {}).prototype;
  788. }
  789. if (target) for (key in source) {
  790. sourceProperty = source[key];
  791. if (options.noTargetGet) {
  792. descriptor = getOwnPropertyDescriptor(target, key);
  793. targetProperty = descriptor && descriptor.value;
  794. } else targetProperty = target[key];
  795. FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  796. // contained in target
  797. if (!FORCED && targetProperty !== undefined) {
  798. if (typeof sourceProperty == typeof targetProperty) continue;
  799. copyConstructorProperties(sourceProperty, targetProperty);
  800. }
  801. // add a flag to not completely full polyfills
  802. if (options.sham || (targetProperty && targetProperty.sham)) {
  803. createNonEnumerableProperty(sourceProperty, 'sham', true);
  804. }
  805. defineBuiltIn$1(target, key, sourceProperty, options);
  806. }
  807. };
  808. var classof$4 = classofRaw$1;
  809. // `IsArray` abstract operation
  810. // https://tc39.es/ecma262/#sec-isarray
  811. // eslint-disable-next-line es-x/no-array-isarray -- safe
  812. var isArray$2 = Array.isArray || function isArray(argument) {
  813. return classof$4(argument) == 'Array';
  814. };
  815. var wellKnownSymbol$4 = wellKnownSymbol$6;
  816. var TO_STRING_TAG$1 = wellKnownSymbol$4('toStringTag');
  817. var test = {};
  818. test[TO_STRING_TAG$1] = 'z';
  819. var toStringTagSupport = String(test) === '[object z]';
  820. var global$5 = global$q;
  821. var TO_STRING_TAG_SUPPORT$2 = toStringTagSupport;
  822. var isCallable$1 = isCallable$c;
  823. var classofRaw = classofRaw$1;
  824. var wellKnownSymbol$3 = wellKnownSymbol$6;
  825. var TO_STRING_TAG = wellKnownSymbol$3('toStringTag');
  826. var Object$1 = global$5.Object;
  827. // ES3 wrong here
  828. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  829. // fallback for IE11 Script Access Denied error
  830. var tryGet = function (it, key) {
  831. try {
  832. return it[key];
  833. } catch (error) { /* empty */ }
  834. };
  835. // getting tag from ES6+ `Object.prototype.toString`
  836. var classof$3 = TO_STRING_TAG_SUPPORT$2 ? classofRaw : function (it) {
  837. var O, tag, result;
  838. return it === undefined ? 'Undefined' : it === null ? 'Null'
  839. // @@toStringTag case
  840. : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
  841. // builtinTag case
  842. : CORRECT_ARGUMENTS ? classofRaw(O)
  843. // ES3 arguments fallback
  844. : (result = classofRaw(O)) == 'Object' && isCallable$1(O.callee) ? 'Arguments' : result;
  845. };
  846. var uncurryThis$6 = functionUncurryThis;
  847. var fails$3 = fails$c;
  848. var isCallable = isCallable$c;
  849. var classof$2 = classof$3;
  850. var getBuiltIn = getBuiltIn$4;
  851. var inspectSource = inspectSource$3;
  852. var noop = function () { /* empty */ };
  853. var empty = [];
  854. var construct = getBuiltIn('Reflect', 'construct');
  855. var constructorRegExp = /^\s*(?:class|function)\b/;
  856. var exec$1 = uncurryThis$6(constructorRegExp.exec);
  857. var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
  858. var isConstructorModern = function isConstructor(argument) {
  859. if (!isCallable(argument)) return false;
  860. try {
  861. construct(noop, empty, argument);
  862. return true;
  863. } catch (error) {
  864. return false;
  865. }
  866. };
  867. var isConstructorLegacy = function isConstructor(argument) {
  868. if (!isCallable(argument)) return false;
  869. switch (classof$2(argument)) {
  870. case 'AsyncFunction':
  871. case 'GeneratorFunction':
  872. case 'AsyncGeneratorFunction': return false;
  873. }
  874. try {
  875. // we can't check .prototype since constructors produced by .bind haven't it
  876. // `Function#toString` throws on some built-it function in some legacy engines
  877. // (for example, `DOMQuad` and similar in FF41-)
  878. return INCORRECT_TO_STRING || !!exec$1(constructorRegExp, inspectSource(argument));
  879. } catch (error) {
  880. return true;
  881. }
  882. };
  883. isConstructorLegacy.sham = true;
  884. // `IsConstructor` abstract operation
  885. // https://tc39.es/ecma262/#sec-isconstructor
  886. var isConstructor$2 = !construct || fails$3(function () {
  887. var called;
  888. return isConstructorModern(isConstructorModern.call)
  889. || !isConstructorModern(Object)
  890. || !isConstructorModern(function () { called = true; })
  891. || called;
  892. }) ? isConstructorLegacy : isConstructorModern;
  893. var toPropertyKey = toPropertyKey$3;
  894. var definePropertyModule = objectDefineProperty;
  895. var createPropertyDescriptor = createPropertyDescriptor$3;
  896. var createProperty$1 = function (object, key, value) {
  897. var propertyKey = toPropertyKey(key);
  898. if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
  899. else object[propertyKey] = value;
  900. };
  901. var fails$2 = fails$c;
  902. var wellKnownSymbol$2 = wellKnownSymbol$6;
  903. var V8_VERSION = engineV8Version;
  904. var SPECIES$2 = wellKnownSymbol$2('species');
  905. var arrayMethodHasSpeciesSupport$2 = function (METHOD_NAME) {
  906. // We can't use this feature detection in V8 since it causes
  907. // deoptimization and serious performance degradation
  908. // https://github.com/zloirock/core-js/issues/677
  909. return V8_VERSION >= 51 || !fails$2(function () {
  910. var array = [];
  911. var constructor = array.constructor = {};
  912. constructor[SPECIES$2] = function () {
  913. return { foo: 1 };
  914. };
  915. return array[METHOD_NAME](Boolean).foo !== 1;
  916. });
  917. };
  918. var uncurryThis$5 = functionUncurryThis;
  919. var arraySlice = uncurryThis$5([].slice);
  920. var $$3 = _export;
  921. var global$4 = global$q;
  922. var isArray$1 = isArray$2;
  923. var isConstructor$1 = isConstructor$2;
  924. var isObject$1 = isObject$7;
  925. var toAbsoluteIndex = toAbsoluteIndex$2;
  926. var lengthOfArrayLike$1 = lengthOfArrayLike$3;
  927. var toIndexedObject = toIndexedObject$4;
  928. var createProperty = createProperty$1;
  929. var wellKnownSymbol$1 = wellKnownSymbol$6;
  930. var arrayMethodHasSpeciesSupport$1 = arrayMethodHasSpeciesSupport$2;
  931. var un$Slice = arraySlice;
  932. var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport$1('slice');
  933. var SPECIES$1 = wellKnownSymbol$1('species');
  934. var Array$2 = global$4.Array;
  935. var max = Math.max;
  936. // `Array.prototype.slice` method
  937. // https://tc39.es/ecma262/#sec-array.prototype.slice
  938. // fallback for not array-like ES3 strings and DOM objects
  939. $$3({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
  940. slice: function slice(start, end) {
  941. var O = toIndexedObject(this);
  942. var length = lengthOfArrayLike$1(O);
  943. var k = toAbsoluteIndex(start, length);
  944. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  945. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  946. var Constructor, result, n;
  947. if (isArray$1(O)) {
  948. Constructor = O.constructor;
  949. // cross-realm fallback
  950. if (isConstructor$1(Constructor) && (Constructor === Array$2 || isArray$1(Constructor.prototype))) {
  951. Constructor = undefined;
  952. } else if (isObject$1(Constructor)) {
  953. Constructor = Constructor[SPECIES$1];
  954. if (Constructor === null) Constructor = undefined;
  955. }
  956. if (Constructor === Array$2 || Constructor === undefined) {
  957. return un$Slice(O, k, fin);
  958. }
  959. }
  960. result = new (Constructor === undefined ? Array$2 : Constructor)(max(fin - k, 0));
  961. for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
  962. result.length = n;
  963. return result;
  964. }
  965. });
  966. var global$3 = global$q;
  967. var classof$1 = classof$3;
  968. var String$1 = global$3.String;
  969. var toString$3 = function (argument) {
  970. if (classof$1(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
  971. return String$1(argument);
  972. };
  973. // a string of all valid unicode whitespaces
  974. var whitespaces$2 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
  975. '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  976. var uncurryThis$4 = functionUncurryThis;
  977. var requireObjectCoercible = requireObjectCoercible$3;
  978. var toString$2 = toString$3;
  979. var whitespaces$1 = whitespaces$2;
  980. var replace = uncurryThis$4(''.replace);
  981. var whitespace = '[' + whitespaces$1 + ']';
  982. var ltrim = RegExp('^' + whitespace + whitespace + '*');
  983. var rtrim = RegExp(whitespace + whitespace + '*$');
  984. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  985. var createMethod$1 = function (TYPE) {
  986. return function ($this) {
  987. var string = toString$2(requireObjectCoercible($this));
  988. if (TYPE & 1) string = replace(string, ltrim, '');
  989. if (TYPE & 2) string = replace(string, rtrim, '');
  990. return string;
  991. };
  992. };
  993. var stringTrim = {
  994. // `String.prototype.{ trimLeft, trimStart }` methods
  995. // https://tc39.es/ecma262/#sec-string.prototype.trimstart
  996. start: createMethod$1(1),
  997. // `String.prototype.{ trimRight, trimEnd }` methods
  998. // https://tc39.es/ecma262/#sec-string.prototype.trimend
  999. end: createMethod$1(2),
  1000. // `String.prototype.trim` method
  1001. // https://tc39.es/ecma262/#sec-string.prototype.trim
  1002. trim: createMethod$1(3)
  1003. };
  1004. var global$2 = global$q;
  1005. var fails$1 = fails$c;
  1006. var uncurryThis$3 = functionUncurryThis;
  1007. var toString$1 = toString$3;
  1008. var trim = stringTrim.trim;
  1009. var whitespaces = whitespaces$2;
  1010. var $parseInt$1 = global$2.parseInt;
  1011. var Symbol$1 = global$2.Symbol;
  1012. var ITERATOR = Symbol$1 && Symbol$1.iterator;
  1013. var hex = /^[+-]?0x/i;
  1014. var exec = uncurryThis$3(hex.exec);
  1015. var FORCED = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22
  1016. // MS Edge 18- broken with boxed symbols
  1017. || (ITERATOR && !fails$1(function () { $parseInt$1(Object(ITERATOR)); }));
  1018. // `parseInt` method
  1019. // https://tc39.es/ecma262/#sec-parseint-string-radix
  1020. var numberParseInt = FORCED ? function parseInt(string, radix) {
  1021. var S = trim(toString$1(string));
  1022. return $parseInt$1(S, (radix >>> 0) || (exec(hex, S) ? 16 : 10));
  1023. } : $parseInt$1;
  1024. var $$2 = _export;
  1025. var $parseInt = numberParseInt;
  1026. // `parseInt` method
  1027. // https://tc39.es/ecma262/#sec-parseint-string-radix
  1028. $$2({ global: true, forced: parseInt != $parseInt }, {
  1029. parseInt: $parseInt
  1030. });
  1031. var fails = fails$c;
  1032. var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
  1033. var method = [][METHOD_NAME];
  1034. return !!method && fails(function () {
  1035. // eslint-disable-next-line no-useless-call -- required for testing
  1036. method.call(null, argument || function () { return 1; }, 1);
  1037. });
  1038. };
  1039. /* eslint-disable es-x/no-array-prototype-indexof -- required for testing */
  1040. var $$1 = _export;
  1041. var uncurryThis$2 = functionUncurryThis;
  1042. var $IndexOf = arrayIncludes.indexOf;
  1043. var arrayMethodIsStrict = arrayMethodIsStrict$1;
  1044. var un$IndexOf = uncurryThis$2([].indexOf);
  1045. var NEGATIVE_ZERO = !!un$IndexOf && 1 / un$IndexOf([1], 1, -0) < 0;
  1046. var STRICT_METHOD = arrayMethodIsStrict('indexOf');
  1047. // `Array.prototype.indexOf` method
  1048. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  1049. $$1({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
  1050. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  1051. var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
  1052. return NEGATIVE_ZERO
  1053. // convert -0 to +0
  1054. ? un$IndexOf(this, searchElement, fromIndex) || 0
  1055. : $IndexOf(this, searchElement, fromIndex);
  1056. }
  1057. });
  1058. var uncurryThis$1 = functionUncurryThis;
  1059. var aCallable = aCallable$2;
  1060. var NATIVE_BIND = functionBindNative;
  1061. var bind$1 = uncurryThis$1(uncurryThis$1.bind);
  1062. // optional / simple context binding
  1063. var functionBindContext = function (fn, that) {
  1064. aCallable(fn);
  1065. return that === undefined ? fn : NATIVE_BIND ? bind$1(fn, that) : function (/* ...args */) {
  1066. return fn.apply(that, arguments);
  1067. };
  1068. };
  1069. var global$1 = global$q;
  1070. var isArray = isArray$2;
  1071. var isConstructor = isConstructor$2;
  1072. var isObject = isObject$7;
  1073. var wellKnownSymbol = wellKnownSymbol$6;
  1074. var SPECIES = wellKnownSymbol('species');
  1075. var Array$1 = global$1.Array;
  1076. // a part of `ArraySpeciesCreate` abstract operation
  1077. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  1078. var arraySpeciesConstructor$1 = function (originalArray) {
  1079. var C;
  1080. if (isArray(originalArray)) {
  1081. C = originalArray.constructor;
  1082. // cross-realm fallback
  1083. if (isConstructor(C) && (C === Array$1 || isArray(C.prototype))) C = undefined;
  1084. else if (isObject(C)) {
  1085. C = C[SPECIES];
  1086. if (C === null) C = undefined;
  1087. }
  1088. } return C === undefined ? Array$1 : C;
  1089. };
  1090. var arraySpeciesConstructor = arraySpeciesConstructor$1;
  1091. // `ArraySpeciesCreate` abstract operation
  1092. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  1093. var arraySpeciesCreate$1 = function (originalArray, length) {
  1094. return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
  1095. };
  1096. var bind = functionBindContext;
  1097. var uncurryThis = functionUncurryThis;
  1098. var IndexedObject = indexedObject;
  1099. var toObject = toObject$2;
  1100. var lengthOfArrayLike = lengthOfArrayLike$3;
  1101. var arraySpeciesCreate = arraySpeciesCreate$1;
  1102. var push = uncurryThis([].push);
  1103. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
  1104. var createMethod = function (TYPE) {
  1105. var IS_MAP = TYPE == 1;
  1106. var IS_FILTER = TYPE == 2;
  1107. var IS_SOME = TYPE == 3;
  1108. var IS_EVERY = TYPE == 4;
  1109. var IS_FIND_INDEX = TYPE == 6;
  1110. var IS_FILTER_REJECT = TYPE == 7;
  1111. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  1112. return function ($this, callbackfn, that, specificCreate) {
  1113. var O = toObject($this);
  1114. var self = IndexedObject(O);
  1115. var boundFunction = bind(callbackfn, that);
  1116. var length = lengthOfArrayLike(self);
  1117. var index = 0;
  1118. var create = specificCreate || arraySpeciesCreate;
  1119. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
  1120. var value, result;
  1121. for (;length > index; index++) if (NO_HOLES || index in self) {
  1122. value = self[index];
  1123. result = boundFunction(value, index, O);
  1124. if (TYPE) {
  1125. if (IS_MAP) target[index] = result; // map
  1126. else if (result) switch (TYPE) {
  1127. case 3: return true; // some
  1128. case 5: return value; // find
  1129. case 6: return index; // findIndex
  1130. case 2: push(target, value); // filter
  1131. } else switch (TYPE) {
  1132. case 4: return false; // every
  1133. case 7: push(target, value); // filterReject
  1134. }
  1135. }
  1136. }
  1137. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  1138. };
  1139. };
  1140. var arrayIteration = {
  1141. // `Array.prototype.forEach` method
  1142. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  1143. forEach: createMethod(0),
  1144. // `Array.prototype.map` method
  1145. // https://tc39.es/ecma262/#sec-array.prototype.map
  1146. map: createMethod(1),
  1147. // `Array.prototype.filter` method
  1148. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1149. filter: createMethod(2),
  1150. // `Array.prototype.some` method
  1151. // https://tc39.es/ecma262/#sec-array.prototype.some
  1152. some: createMethod(3),
  1153. // `Array.prototype.every` method
  1154. // https://tc39.es/ecma262/#sec-array.prototype.every
  1155. every: createMethod(4),
  1156. // `Array.prototype.find` method
  1157. // https://tc39.es/ecma262/#sec-array.prototype.find
  1158. find: createMethod(5),
  1159. // `Array.prototype.findIndex` method
  1160. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  1161. findIndex: createMethod(6),
  1162. // `Array.prototype.filterReject` method
  1163. // https://github.com/tc39/proposal-array-filtering
  1164. filterReject: createMethod(7)
  1165. };
  1166. var $ = _export;
  1167. var $filter = arrayIteration.filter;
  1168. var arrayMethodHasSpeciesSupport = arrayMethodHasSpeciesSupport$2;
  1169. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
  1170. // `Array.prototype.filter` method
  1171. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1172. // with adding support of @@species
  1173. $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  1174. filter: function filter(callbackfn /* , thisArg */) {
  1175. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1176. }
  1177. });
  1178. var TO_STRING_TAG_SUPPORT$1 = toStringTagSupport;
  1179. var classof = classof$3;
  1180. // `Object.prototype.toString` method implementation
  1181. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  1182. var objectToString = TO_STRING_TAG_SUPPORT$1 ? {}.toString : function toString() {
  1183. return '[object ' + classof(this) + ']';
  1184. };
  1185. var TO_STRING_TAG_SUPPORT = toStringTagSupport;
  1186. var defineBuiltIn = defineBuiltIn$2;
  1187. var toString = objectToString;
  1188. // `Object.prototype.toString` method
  1189. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  1190. if (!TO_STRING_TAG_SUPPORT) {
  1191. defineBuiltIn(Object.prototype, 'toString', toString, { unsafe: true });
  1192. }
  1193. /**
  1194. * @author doug-the-guy
  1195. * @version v1.0.0
  1196. *
  1197. * Bootstrap Table Pipeline
  1198. * -----------------------
  1199. *
  1200. * This plugin enables client side data caching for server side requests which will
  1201. * eliminate the need to issue a new request every page change. This will allow
  1202. * for a performance balance for a large data set between returning all data at once
  1203. * (client side paging) and a new server side request (server side paging).
  1204. *
  1205. * There are two new options:
  1206. * - usePipeline: enables this feature
  1207. * - pipelineSize: the size of each cache window
  1208. *
  1209. * The size of the pipeline must be evenly divisible by the current page size. This is
  1210. * assured by rounding up to the nearest evenly divisible value. For example, if
  1211. * the pipeline size is 4990 and the current page size is 25, then pipeline size will
  1212. * be dynamically set to 5000.
  1213. *
  1214. * The cache windows are computed based on the pipeline size and the total number of rows
  1215. * returned by the server side query. For example, with pipeline size 500 and total rows
  1216. * 1300, the cache windows will be:
  1217. *
  1218. * [{'lower': 0, 'upper': 499}, {'lower': 500, 'upper': 999}, {'lower': 1000, 'upper': 1499}]
  1219. *
  1220. * Using the limit (i.e. the pipelineSize) and offset parameters, the server side request
  1221. * **MUST** return only the data in the requested cache window **AND** the total number of rows.
  1222. * To wit, the server side code must use the offset and limit parameters to prepare the response
  1223. * data.
  1224. *
  1225. * On a page change, the new offset is checked if it is within the current cache window. If so,
  1226. * the requested page data is returned from the cached data set. Otherwise, a new server side
  1227. * request will be issued for the new cache window.
  1228. *
  1229. * The current cached data is only invalidated on these events:
  1230. * * sorting
  1231. * * searching
  1232. * * page size change
  1233. * * page change moves into a new cache window
  1234. *
  1235. * There are two new events:
  1236. * - cached-data-hit.bs.table: issued when cached data is used on a page change
  1237. * - cached-data-reset.bs.table: issued when the cached data is invalidated and a
  1238. * new server side request is issued
  1239. *
  1240. **/
  1241. var Utils = $__default["default"].fn.bootstrapTable.utils;
  1242. $__default["default"].extend($__default["default"].fn.bootstrapTable.defaults, {
  1243. usePipeline: false,
  1244. pipelineSize: 1000,
  1245. // eslint-disable-next-line no-unused-vars
  1246. onCachedDataHit: function onCachedDataHit(data) {
  1247. return false;
  1248. },
  1249. // eslint-disable-next-line no-unused-vars
  1250. onCachedDataReset: function onCachedDataReset(data) {
  1251. return false;
  1252. }
  1253. });
  1254. $__default["default"].extend($__default["default"].fn.bootstrapTable.Constructor.EVENTS, {
  1255. 'cached-data-hit.bs.table': 'onCachedDataHit',
  1256. 'cached-data-reset.bs.table': 'onCachedDataReset'
  1257. });
  1258. var BootstrapTable = $__default["default"].fn.bootstrapTable.Constructor;
  1259. var _init = BootstrapTable.prototype.init;
  1260. var _onSearch = BootstrapTable.prototype.onSearch;
  1261. var _onSort = BootstrapTable.prototype.onSort;
  1262. var _onPageListChange = BootstrapTable.prototype.onPageListChange;
  1263. BootstrapTable.prototype.init = function () {
  1264. // needs to be called before initServer()
  1265. this.initPipeline();
  1266. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1267. args[_key] = arguments[_key];
  1268. }
  1269. _init.apply(this, Array.prototype.slice.apply(args));
  1270. };
  1271. BootstrapTable.prototype.initPipeline = function () {
  1272. this.cacheRequestJSON = {};
  1273. this.cacheWindows = [];
  1274. this.currWindow = 0;
  1275. this.resetCache = true;
  1276. };
  1277. BootstrapTable.prototype.onSearch = function () {
  1278. /* force a cache reset on search */
  1279. if (this.options.usePipeline) {
  1280. this.resetCache = true;
  1281. }
  1282. _onSearch.apply(this, Array.prototype.slice.apply(arguments));
  1283. };
  1284. BootstrapTable.prototype.onSort = function () {
  1285. /* force a cache reset on sort */
  1286. if (this.options.usePipeline) {
  1287. this.resetCache = true;
  1288. }
  1289. _onSort.apply(this, Array.prototype.slice.apply(arguments));
  1290. };
  1291. BootstrapTable.prototype.onPageListChange = function (event) {
  1292. /* rebuild cache window on page size change */
  1293. var target = $__default["default"](event.currentTarget);
  1294. var newPageSize = parseInt(target.text(), 10);
  1295. this.options.pipelineSize = this.calculatePipelineSize(this.options.pipelineSize, newPageSize);
  1296. this.resetCache = true;
  1297. _onPageListChange.apply(this, Array.prototype.slice.apply(arguments));
  1298. };
  1299. BootstrapTable.prototype.calculatePipelineSize = function (pipelineSize, pageSize) {
  1300. /* calculate pipeline size by rounding up to the nearest value evenly divisible
  1301. * by the pageSize */
  1302. if (pageSize === 0) return 0;
  1303. return Math.ceil(pipelineSize / pageSize) * pageSize;
  1304. };
  1305. BootstrapTable.prototype.setCacheWindows = function () {
  1306. /* set cache windows based on the total number of rows returned by server side
  1307. * request and the pipelineSize */
  1308. this.cacheWindows = [];
  1309. var numWindows = this.options.totalRows / this.options.pipelineSize;
  1310. for (var i = 0; i <= numWindows; i++) {
  1311. var b = i * this.options.pipelineSize;
  1312. this.cacheWindows[i] = {
  1313. lower: b,
  1314. upper: b + this.options.pipelineSize - 1
  1315. };
  1316. }
  1317. };
  1318. BootstrapTable.prototype.setCurrWindow = function (offset) {
  1319. /* set the current cache window index, based on where the current offset falls */
  1320. this.currWindow = 0;
  1321. for (var i = 0; i < this.cacheWindows.length; i++) {
  1322. if (this.cacheWindows[i].lower <= offset && offset <= this.cacheWindows[i].upper) {
  1323. this.currWindow = i;
  1324. break;
  1325. }
  1326. }
  1327. };
  1328. BootstrapTable.prototype.drawFromCache = function (offset, limit) {
  1329. /* draw rows from the cache using offset and limit */
  1330. var res = $__default["default"].extend(true, {}, this.cacheRequestJSON);
  1331. var drawStart = offset - this.cacheWindows[this.currWindow].lower;
  1332. var drawEnd = drawStart + limit;
  1333. res.rows = res.rows.slice(drawStart, drawEnd);
  1334. return res;
  1335. };
  1336. BootstrapTable.prototype.initServer = function (silent, query, url) {
  1337. /* determine if requested data is in cache (on paging) or if
  1338. * a new ajax request needs to be issued (sorting, searching, paging
  1339. * moving outside of cached data, page size change)
  1340. * initial version of this extension will entirely override base initServer
  1341. **/
  1342. var data = {};
  1343. var index = this.header.fields.indexOf(this.options.sortName);
  1344. var params = {
  1345. searchText: this.searchText,
  1346. sortName: this.options.sortName,
  1347. sortOrder: this.options.sortOrder
  1348. };
  1349. var request = null;
  1350. if (this.header.sortNames[index]) {
  1351. params.sortName = this.header.sortNames[index];
  1352. }
  1353. if (this.options.pagination && this.options.sidePagination === 'server') {
  1354. params.pageSize = this.options.pageSize === this.options.formatAllRows() ? this.options.totalRows : this.options.pageSize;
  1355. params.pageNumber = this.options.pageNumber;
  1356. }
  1357. if (!(url || this.options.url) && !this.options.ajax) {
  1358. return;
  1359. }
  1360. var useAjax = true;
  1361. if (this.options.queryParamsType === 'limit') {
  1362. params = {
  1363. searchText: params.searchText,
  1364. sortName: params.sortName,
  1365. sortOrder: params.sortOrder
  1366. };
  1367. if (this.options.pagination && this.options.sidePagination === 'server') {
  1368. params.limit = this.options.pageSize === this.options.formatAllRows() ? this.options.totalRows : this.options.pageSize;
  1369. params.offset = (this.options.pageSize === this.options.formatAllRows() ? this.options.totalRows : this.options.pageSize) * (this.options.pageNumber - 1);
  1370. if (this.options.usePipeline) {
  1371. // if cacheWindows is empty, this is the initial request
  1372. if (!this.cacheWindows.length) {
  1373. useAjax = true;
  1374. params.drawOffset = params.offset; // cache exists: determine if the page request is entirely within the current cached window
  1375. } else {
  1376. var w = this.cacheWindows[this.currWindow]; // case 1: reset cache but stay within current window (e.g. column sort)
  1377. // case 2: move outside of the current window (e.g. search or paging)
  1378. // since each cache window is aligned with the current page size
  1379. // checking if params.offset is outside the current window is sufficient.
  1380. // need to requery for preceding or succeeding cache window
  1381. // also handle case
  1382. if (this.resetCache || params.offset < w.lower || params.offset > w.upper) {
  1383. useAjax = true;
  1384. this.setCurrWindow(params.offset); // store the relative offset for drawing the page data afterwards
  1385. params.drawOffset = params.offset; // now set params.offset to the lower bound of the new cache window
  1386. // the server will return that whole cache window
  1387. params.offset = this.cacheWindows[this.currWindow].lower; // within current cache window
  1388. } else {
  1389. useAjax = false;
  1390. }
  1391. }
  1392. } else if (params.limit === 0) {
  1393. delete params.limit;
  1394. }
  1395. }
  1396. } // force an ajax call - this is on search, sort or page size change
  1397. if (this.resetCache) {
  1398. useAjax = true;
  1399. this.resetCache = false;
  1400. }
  1401. if (this.options.usePipeline && useAjax) {
  1402. /* in this scenario limit is used on the server to get the cache window
  1403. * and drawLimit is used to get the page data afterwards */
  1404. params.drawLimit = params.limit;
  1405. params.limit = this.options.pipelineSize;
  1406. } // cached results can be used
  1407. if (!useAjax) {
  1408. var res = this.drawFromCache(params.offset, params.limit);
  1409. this.load(res);
  1410. this.trigger('load-success', res);
  1411. this.trigger('cached-data-hit', res);
  1412. return;
  1413. } // cached results can't be used
  1414. // continue base initServer code
  1415. if (!$__default["default"].isEmptyObject(this.filterColumnsPartial)) {
  1416. params.filter = JSON.stringify(this.filterColumnsPartial, null);
  1417. }
  1418. data = Utils.calculateObjectValue(this.options, this.options.queryParams, [params], data);
  1419. $__default["default"].extend(data, query || {}); // false to stop request
  1420. if (data === false) {
  1421. return;
  1422. }
  1423. if (!silent) {
  1424. this.$tableLoading.show();
  1425. }
  1426. var self = this;
  1427. request = $__default["default"].extend({}, Utils.calculateObjectValue(null, this.options.ajaxOptions), {
  1428. type: this.options.method,
  1429. url: url || this.options.url,
  1430. data: this.options.contentType === 'application/json' && this.options.method === 'post' ? JSON.stringify(data) : data,
  1431. cache: this.options.cache,
  1432. contentType: this.options.contentType,
  1433. dataType: this.options.dataType,
  1434. success: function success(res) {
  1435. res = Utils.calculateObjectValue(self.options, self.options.responseHandler, [res], res); // cache results if using pipelining
  1436. if (self.options.usePipeline) {
  1437. // store entire request in cache
  1438. self.cacheRequestJSON = $__default["default"].extend(true, {}, res); // this gets set in load() also but needs to be set before
  1439. // setting cacheWindows
  1440. self.options.totalRows = res[self.options.totalField]; // if this is a search, potentially less results will be returned
  1441. // so cache windows need to be rebuilt. Otherwise it
  1442. // will come out the same
  1443. self.setCacheWindows();
  1444. self.setCurrWindow(params.drawOffset); // just load data for the page
  1445. res = self.drawFromCache(params.drawOffset, params.drawLimit);
  1446. self.trigger('cached-data-reset', res);
  1447. }
  1448. self.load(res);
  1449. self.trigger('load-success', res);
  1450. if (!silent) {
  1451. self.hideLoading();
  1452. }
  1453. },
  1454. error: function error(res) {
  1455. var data = [];
  1456. if (self.options.sidePagination === 'server') {
  1457. data = {};
  1458. data[self.options.totalField] = 0;
  1459. data[self.options.dataField] = [];
  1460. }
  1461. self.load(data);
  1462. self.trigger('load-error', res.status, res);
  1463. if (!silent) {
  1464. self.hideLoading();
  1465. }
  1466. }
  1467. });
  1468. if (this.options.ajax) {
  1469. Utils.calculateObjectValue(this, this.options.ajax, [request], null);
  1470. } else {
  1471. if (this._xhr && this._xhr.readyState !== 4) {
  1472. this._xhr.abort();
  1473. }
  1474. this._xhr = $__default["default"].ajax(request);
  1475. }
  1476. };
  1477. }));