utils.js 105 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery')) :
  3. typeof define === 'function' && define.amd ? define(['exports', 'jquery'], factory) :
  4. (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.BootstrapTable = {}, global.jQuery));
  5. })(this, (function (exports, $) { 'use strict';
  6. function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
  7. var $__default = /*#__PURE__*/_interopDefaultLegacy($);
  8. function _typeof(obj) {
  9. "@babel/helpers - typeof";
  10. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  11. return typeof obj;
  12. } : function (obj) {
  13. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  14. }, _typeof(obj);
  15. }
  16. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  17. function createCommonjsModule(fn, module) {
  18. return module = { exports: {} }, fn(module, module.exports), module.exports;
  19. }
  20. var check = function (it) {
  21. return it && it.Math == Math && it;
  22. };
  23. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  24. var global_1 =
  25. // eslint-disable-next-line es-x/no-global-this -- safe
  26. check(typeof globalThis == 'object' && globalThis) ||
  27. check(typeof window == 'object' && window) ||
  28. // eslint-disable-next-line no-restricted-globals -- safe
  29. check(typeof self == 'object' && self) ||
  30. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  31. // eslint-disable-next-line no-new-func -- fallback
  32. (function () { return this; })() || Function('return this')();
  33. var fails = function (exec) {
  34. try {
  35. return !!exec();
  36. } catch (error) {
  37. return true;
  38. }
  39. };
  40. // Detect IE8's incomplete defineProperty implementation
  41. var descriptors = !fails(function () {
  42. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  43. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  44. });
  45. var functionBindNative = !fails(function () {
  46. // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
  47. var test = (function () { /* empty */ }).bind();
  48. // eslint-disable-next-line no-prototype-builtins -- safe
  49. return typeof test != 'function' || test.hasOwnProperty('prototype');
  50. });
  51. var call$2 = Function.prototype.call;
  52. var functionCall = functionBindNative ? call$2.bind(call$2) : function () {
  53. return call$2.apply(call$2, arguments);
  54. };
  55. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  56. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  57. var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  58. // Nashorn ~ JDK8 bug
  59. var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  60. // `Object.prototype.propertyIsEnumerable` method implementation
  61. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  62. var f$5 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  63. var descriptor = getOwnPropertyDescriptor$1(this, V);
  64. return !!descriptor && descriptor.enumerable;
  65. } : $propertyIsEnumerable;
  66. var objectPropertyIsEnumerable = {
  67. f: f$5
  68. };
  69. var createPropertyDescriptor = function (bitmap, value) {
  70. return {
  71. enumerable: !(bitmap & 1),
  72. configurable: !(bitmap & 2),
  73. writable: !(bitmap & 4),
  74. value: value
  75. };
  76. };
  77. var FunctionPrototype$2 = Function.prototype;
  78. var bind$1 = FunctionPrototype$2.bind;
  79. var call$1 = FunctionPrototype$2.call;
  80. var uncurryThis = functionBindNative && bind$1.bind(call$1, call$1);
  81. var functionUncurryThis = functionBindNative ? function (fn) {
  82. return fn && uncurryThis(fn);
  83. } : function (fn) {
  84. return fn && function () {
  85. return call$1.apply(fn, arguments);
  86. };
  87. };
  88. var toString$1 = functionUncurryThis({}.toString);
  89. var stringSlice$5 = functionUncurryThis(''.slice);
  90. var classofRaw = function (it) {
  91. return stringSlice$5(toString$1(it), 8, -1);
  92. };
  93. var Object$4 = global_1.Object;
  94. var split = functionUncurryThis(''.split);
  95. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  96. var indexedObject = fails(function () {
  97. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  98. // eslint-disable-next-line no-prototype-builtins -- safe
  99. return !Object$4('z').propertyIsEnumerable(0);
  100. }) ? function (it) {
  101. return classofRaw(it) == 'String' ? split(it, '') : Object$4(it);
  102. } : Object$4;
  103. var TypeError$a = global_1.TypeError;
  104. // `RequireObjectCoercible` abstract operation
  105. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  106. var requireObjectCoercible = function (it) {
  107. if (it == undefined) throw TypeError$a("Can't call method on " + it);
  108. return it;
  109. };
  110. // toObject with fallback for non-array-like ES3 strings
  111. var toIndexedObject = function (it) {
  112. return indexedObject(requireObjectCoercible(it));
  113. };
  114. // `IsCallable` abstract operation
  115. // https://tc39.es/ecma262/#sec-iscallable
  116. var isCallable = function (argument) {
  117. return typeof argument == 'function';
  118. };
  119. var isObject = function (it) {
  120. return typeof it == 'object' ? it !== null : isCallable(it);
  121. };
  122. var aFunction = function (argument) {
  123. return isCallable(argument) ? argument : undefined;
  124. };
  125. var getBuiltIn = function (namespace, method) {
  126. return arguments.length < 2 ? aFunction(global_1[namespace]) : global_1[namespace] && global_1[namespace][method];
  127. };
  128. var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
  129. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  130. var process = global_1.process;
  131. var Deno = global_1.Deno;
  132. var versions = process && process.versions || Deno && Deno.version;
  133. var v8 = versions && versions.v8;
  134. var match, version;
  135. if (v8) {
  136. match = v8.split('.');
  137. // in old Chrome, versions of V8 isn't V8 = Chrome / 10
  138. // but their correct versions are not interesting for us
  139. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  140. }
  141. // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
  142. // so check `userAgent` even if `.v8` exists, but 0
  143. if (!version && engineUserAgent) {
  144. match = engineUserAgent.match(/Edge\/(\d+)/);
  145. if (!match || match[1] >= 74) {
  146. match = engineUserAgent.match(/Chrome\/(\d+)/);
  147. if (match) version = +match[1];
  148. }
  149. }
  150. var engineV8Version = version;
  151. /* eslint-disable es-x/no-symbol -- required for testing */
  152. // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
  153. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  154. var symbol = Symbol();
  155. // Chrome 38 Symbol has incorrect toString conversion
  156. // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
  157. return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
  158. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  159. !Symbol.sham && engineV8Version && engineV8Version < 41;
  160. });
  161. /* eslint-disable es-x/no-symbol -- required for testing */
  162. var useSymbolAsUid = nativeSymbol
  163. && !Symbol.sham
  164. && typeof Symbol.iterator == 'symbol';
  165. var Object$3 = global_1.Object;
  166. var isSymbol = useSymbolAsUid ? function (it) {
  167. return typeof it == 'symbol';
  168. } : function (it) {
  169. var $Symbol = getBuiltIn('Symbol');
  170. return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, Object$3(it));
  171. };
  172. var String$3 = global_1.String;
  173. var tryToString = function (argument) {
  174. try {
  175. return String$3(argument);
  176. } catch (error) {
  177. return 'Object';
  178. }
  179. };
  180. var TypeError$9 = global_1.TypeError;
  181. // `Assert: IsCallable(argument) is true`
  182. var aCallable = function (argument) {
  183. if (isCallable(argument)) return argument;
  184. throw TypeError$9(tryToString(argument) + ' is not a function');
  185. };
  186. // `GetMethod` abstract operation
  187. // https://tc39.es/ecma262/#sec-getmethod
  188. var getMethod = function (V, P) {
  189. var func = V[P];
  190. return func == null ? undefined : aCallable(func);
  191. };
  192. var TypeError$8 = global_1.TypeError;
  193. // `OrdinaryToPrimitive` abstract operation
  194. // https://tc39.es/ecma262/#sec-ordinarytoprimitive
  195. var ordinaryToPrimitive = function (input, pref) {
  196. var fn, val;
  197. if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
  198. if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
  199. if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
  200. throw TypeError$8("Can't convert object to primitive value");
  201. };
  202. // eslint-disable-next-line es-x/no-object-defineproperty -- safe
  203. var defineProperty = Object.defineProperty;
  204. var setGlobal = function (key, value) {
  205. try {
  206. defineProperty(global_1, key, { value: value, configurable: true, writable: true });
  207. } catch (error) {
  208. global_1[key] = value;
  209. } return value;
  210. };
  211. var SHARED = '__core-js_shared__';
  212. var store$1 = global_1[SHARED] || setGlobal(SHARED, {});
  213. var sharedStore = store$1;
  214. var shared = createCommonjsModule(function (module) {
  215. (module.exports = function (key, value) {
  216. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  217. })('versions', []).push({
  218. version: '3.22.4',
  219. mode: 'global',
  220. copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
  221. license: 'https://github.com/zloirock/core-js/blob/v3.22.4/LICENSE',
  222. source: 'https://github.com/zloirock/core-js'
  223. });
  224. });
  225. var Object$2 = global_1.Object;
  226. // `ToObject` abstract operation
  227. // https://tc39.es/ecma262/#sec-toobject
  228. var toObject = function (argument) {
  229. return Object$2(requireObjectCoercible(argument));
  230. };
  231. var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
  232. // `HasOwnProperty` abstract operation
  233. // https://tc39.es/ecma262/#sec-hasownproperty
  234. // eslint-disable-next-line es-x/no-object-hasown -- safe
  235. var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
  236. return hasOwnProperty(toObject(it), key);
  237. };
  238. var id = 0;
  239. var postfix = Math.random();
  240. var toString = functionUncurryThis(1.0.toString);
  241. var uid = function (key) {
  242. return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
  243. };
  244. var WellKnownSymbolsStore = shared('wks');
  245. var Symbol$1 = global_1.Symbol;
  246. var symbolFor = Symbol$1 && Symbol$1['for'];
  247. var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
  248. var wellKnownSymbol = function (name) {
  249. if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
  250. var description = 'Symbol.' + name;
  251. if (nativeSymbol && hasOwnProperty_1(Symbol$1, name)) {
  252. WellKnownSymbolsStore[name] = Symbol$1[name];
  253. } else if (useSymbolAsUid && symbolFor) {
  254. WellKnownSymbolsStore[name] = symbolFor(description);
  255. } else {
  256. WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
  257. }
  258. } return WellKnownSymbolsStore[name];
  259. };
  260. var TypeError$7 = global_1.TypeError;
  261. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  262. // `ToPrimitive` abstract operation
  263. // https://tc39.es/ecma262/#sec-toprimitive
  264. var toPrimitive = function (input, pref) {
  265. if (!isObject(input) || isSymbol(input)) return input;
  266. var exoticToPrim = getMethod(input, TO_PRIMITIVE);
  267. var result;
  268. if (exoticToPrim) {
  269. if (pref === undefined) pref = 'default';
  270. result = functionCall(exoticToPrim, input, pref);
  271. if (!isObject(result) || isSymbol(result)) return result;
  272. throw TypeError$7("Can't convert object to primitive value");
  273. }
  274. if (pref === undefined) pref = 'number';
  275. return ordinaryToPrimitive(input, pref);
  276. };
  277. // `ToPropertyKey` abstract operation
  278. // https://tc39.es/ecma262/#sec-topropertykey
  279. var toPropertyKey = function (argument) {
  280. var key = toPrimitive(argument, 'string');
  281. return isSymbol(key) ? key : key + '';
  282. };
  283. var document$1 = global_1.document;
  284. // typeof document.createElement is 'object' in old IE
  285. var EXISTS$1 = isObject(document$1) && isObject(document$1.createElement);
  286. var documentCreateElement = function (it) {
  287. return EXISTS$1 ? document$1.createElement(it) : {};
  288. };
  289. // Thanks to IE8 for its funny defineProperty
  290. var ie8DomDefine = !descriptors && !fails(function () {
  291. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  292. return Object.defineProperty(documentCreateElement('div'), 'a', {
  293. get: function () { return 7; }
  294. }).a != 7;
  295. });
  296. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  297. var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  298. // `Object.getOwnPropertyDescriptor` method
  299. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  300. var f$4 = descriptors ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
  301. O = toIndexedObject(O);
  302. P = toPropertyKey(P);
  303. if (ie8DomDefine) try {
  304. return $getOwnPropertyDescriptor$1(O, P);
  305. } catch (error) { /* empty */ }
  306. if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
  307. };
  308. var objectGetOwnPropertyDescriptor = {
  309. f: f$4
  310. };
  311. // V8 ~ Chrome 36-
  312. // https://bugs.chromium.org/p/v8/issues/detail?id=3334
  313. var v8PrototypeDefineBug = descriptors && fails(function () {
  314. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  315. return Object.defineProperty(function () { /* empty */ }, 'prototype', {
  316. value: 42,
  317. writable: false
  318. }).prototype != 42;
  319. });
  320. var String$2 = global_1.String;
  321. var TypeError$6 = global_1.TypeError;
  322. // `Assert: Type(argument) is Object`
  323. var anObject = function (argument) {
  324. if (isObject(argument)) return argument;
  325. throw TypeError$6(String$2(argument) + ' is not an object');
  326. };
  327. var TypeError$5 = global_1.TypeError;
  328. // eslint-disable-next-line es-x/no-object-defineproperty -- safe
  329. var $defineProperty = Object.defineProperty;
  330. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  331. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  332. var ENUMERABLE = 'enumerable';
  333. var CONFIGURABLE$1 = 'configurable';
  334. var WRITABLE = 'writable';
  335. // `Object.defineProperty` method
  336. // https://tc39.es/ecma262/#sec-object.defineproperty
  337. var f$3 = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) {
  338. anObject(O);
  339. P = toPropertyKey(P);
  340. anObject(Attributes);
  341. if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  342. var current = $getOwnPropertyDescriptor(O, P);
  343. if (current && current[WRITABLE]) {
  344. O[P] = Attributes.value;
  345. Attributes = {
  346. configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
  347. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  348. writable: false
  349. };
  350. }
  351. } return $defineProperty(O, P, Attributes);
  352. } : $defineProperty : function defineProperty(O, P, Attributes) {
  353. anObject(O);
  354. P = toPropertyKey(P);
  355. anObject(Attributes);
  356. if (ie8DomDefine) try {
  357. return $defineProperty(O, P, Attributes);
  358. } catch (error) { /* empty */ }
  359. if ('get' in Attributes || 'set' in Attributes) throw TypeError$5('Accessors not supported');
  360. if ('value' in Attributes) O[P] = Attributes.value;
  361. return O;
  362. };
  363. var objectDefineProperty = {
  364. f: f$3
  365. };
  366. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  367. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  368. } : function (object, key, value) {
  369. object[key] = value;
  370. return object;
  371. };
  372. var FunctionPrototype$1 = Function.prototype;
  373. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  374. var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
  375. var EXISTS = hasOwnProperty_1(FunctionPrototype$1, 'name');
  376. // additional protection from minified / mangled / dropped function names
  377. var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
  378. var CONFIGURABLE = EXISTS && (!descriptors || (descriptors && getDescriptor(FunctionPrototype$1, 'name').configurable));
  379. var functionName = {
  380. EXISTS: EXISTS,
  381. PROPER: PROPER,
  382. CONFIGURABLE: CONFIGURABLE
  383. };
  384. var functionToString = functionUncurryThis(Function.toString);
  385. // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
  386. if (!isCallable(sharedStore.inspectSource)) {
  387. sharedStore.inspectSource = function (it) {
  388. return functionToString(it);
  389. };
  390. }
  391. var inspectSource = sharedStore.inspectSource;
  392. var WeakMap$1 = global_1.WeakMap;
  393. var nativeWeakMap = isCallable(WeakMap$1) && /native code/.test(inspectSource(WeakMap$1));
  394. var keys = shared('keys');
  395. var sharedKey = function (key) {
  396. return keys[key] || (keys[key] = uid(key));
  397. };
  398. var hiddenKeys$1 = {};
  399. var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
  400. var TypeError$4 = global_1.TypeError;
  401. var WeakMap = global_1.WeakMap;
  402. var set, get, has;
  403. var enforce = function (it) {
  404. return has(it) ? get(it) : set(it, {});
  405. };
  406. var getterFor = function (TYPE) {
  407. return function (it) {
  408. var state;
  409. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  410. throw TypeError$4('Incompatible receiver, ' + TYPE + ' required');
  411. } return state;
  412. };
  413. };
  414. if (nativeWeakMap || sharedStore.state) {
  415. var store = sharedStore.state || (sharedStore.state = new WeakMap());
  416. var wmget = functionUncurryThis(store.get);
  417. var wmhas = functionUncurryThis(store.has);
  418. var wmset = functionUncurryThis(store.set);
  419. set = function (it, metadata) {
  420. if (wmhas(store, it)) throw new TypeError$4(OBJECT_ALREADY_INITIALIZED);
  421. metadata.facade = it;
  422. wmset(store, it, metadata);
  423. return metadata;
  424. };
  425. get = function (it) {
  426. return wmget(store, it) || {};
  427. };
  428. has = function (it) {
  429. return wmhas(store, it);
  430. };
  431. } else {
  432. var STATE = sharedKey('state');
  433. hiddenKeys$1[STATE] = true;
  434. set = function (it, metadata) {
  435. if (hasOwnProperty_1(it, STATE)) throw new TypeError$4(OBJECT_ALREADY_INITIALIZED);
  436. metadata.facade = it;
  437. createNonEnumerableProperty(it, STATE, metadata);
  438. return metadata;
  439. };
  440. get = function (it) {
  441. return hasOwnProperty_1(it, STATE) ? it[STATE] : {};
  442. };
  443. has = function (it) {
  444. return hasOwnProperty_1(it, STATE);
  445. };
  446. }
  447. var internalState = {
  448. set: set,
  449. get: get,
  450. has: has,
  451. enforce: enforce,
  452. getterFor: getterFor
  453. };
  454. var makeBuiltIn_1 = createCommonjsModule(function (module) {
  455. var defineProperty = objectDefineProperty.f;
  456. var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
  457. var enforceInternalState = internalState.enforce;
  458. var getInternalState = internalState.get;
  459. var CONFIGURABLE_LENGTH = !fails(function () {
  460. return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
  461. });
  462. var TEMPLATE = String(String).split('String');
  463. var makeBuiltIn = module.exports = function (value, name, options) {
  464. if (String(name).slice(0, 7) === 'Symbol(') {
  465. name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
  466. }
  467. if (options && options.getter) name = 'get ' + name;
  468. if (options && options.setter) name = 'set ' + name;
  469. if (!hasOwnProperty_1(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
  470. defineProperty(value, 'name', { value: name, configurable: true });
  471. }
  472. if (CONFIGURABLE_LENGTH && options && hasOwnProperty_1(options, 'arity') && value.length !== options.arity) {
  473. defineProperty(value, 'length', { value: options.arity });
  474. }
  475. var state = enforceInternalState(value);
  476. if (!hasOwnProperty_1(state, 'source')) {
  477. state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
  478. } return value;
  479. };
  480. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  481. // eslint-disable-next-line no-extend-native -- required
  482. Function.prototype.toString = makeBuiltIn(function toString() {
  483. return isCallable(this) && getInternalState(this).source || inspectSource(this);
  484. }, 'toString');
  485. });
  486. var defineBuiltIn = function (O, key, value, options) {
  487. var unsafe = options ? !!options.unsafe : false;
  488. var simple = options ? !!options.enumerable : false;
  489. var noTargetGet = options ? !!options.noTargetGet : false;
  490. var name = options && options.name !== undefined ? options.name : key;
  491. if (isCallable(value)) makeBuiltIn_1(value, name, options);
  492. if (O === global_1) {
  493. if (simple) O[key] = value;
  494. else setGlobal(key, value);
  495. return O;
  496. } else if (!unsafe) {
  497. delete O[key];
  498. } else if (!noTargetGet && O[key]) {
  499. simple = true;
  500. }
  501. if (simple) O[key] = value;
  502. else createNonEnumerableProperty(O, key, value);
  503. return O;
  504. };
  505. var ceil = Math.ceil;
  506. var floor$2 = Math.floor;
  507. // `ToIntegerOrInfinity` abstract operation
  508. // https://tc39.es/ecma262/#sec-tointegerorinfinity
  509. var toIntegerOrInfinity = function (argument) {
  510. var number = +argument;
  511. // eslint-disable-next-line no-self-compare -- safe
  512. return number !== number || number === 0 ? 0 : (number > 0 ? floor$2 : ceil)(number);
  513. };
  514. var max$2 = Math.max;
  515. var min$3 = Math.min;
  516. // Helper for a popular repeating case of the spec:
  517. // Let integer be ? ToInteger(index).
  518. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  519. var toAbsoluteIndex = function (index, length) {
  520. var integer = toIntegerOrInfinity(index);
  521. return integer < 0 ? max$2(integer + length, 0) : min$3(integer, length);
  522. };
  523. var min$2 = Math.min;
  524. // `ToLength` abstract operation
  525. // https://tc39.es/ecma262/#sec-tolength
  526. var toLength = function (argument) {
  527. return argument > 0 ? min$2(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  528. };
  529. // `LengthOfArrayLike` abstract operation
  530. // https://tc39.es/ecma262/#sec-lengthofarraylike
  531. var lengthOfArrayLike = function (obj) {
  532. return toLength(obj.length);
  533. };
  534. // `Array.prototype.{ indexOf, includes }` methods implementation
  535. var createMethod$3 = function (IS_INCLUDES) {
  536. return function ($this, el, fromIndex) {
  537. var O = toIndexedObject($this);
  538. var length = lengthOfArrayLike(O);
  539. var index = toAbsoluteIndex(fromIndex, length);
  540. var value;
  541. // Array#includes uses SameValueZero equality algorithm
  542. // eslint-disable-next-line no-self-compare -- NaN check
  543. if (IS_INCLUDES && el != el) while (length > index) {
  544. value = O[index++];
  545. // eslint-disable-next-line no-self-compare -- NaN check
  546. if (value != value) return true;
  547. // Array#indexOf ignores holes, Array#includes - not
  548. } else for (;length > index; index++) {
  549. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  550. } return !IS_INCLUDES && -1;
  551. };
  552. };
  553. var arrayIncludes = {
  554. // `Array.prototype.includes` method
  555. // https://tc39.es/ecma262/#sec-array.prototype.includes
  556. includes: createMethod$3(true),
  557. // `Array.prototype.indexOf` method
  558. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  559. indexOf: createMethod$3(false)
  560. };
  561. var indexOf$1 = arrayIncludes.indexOf;
  562. var push$4 = functionUncurryThis([].push);
  563. var objectKeysInternal = function (object, names) {
  564. var O = toIndexedObject(object);
  565. var i = 0;
  566. var result = [];
  567. var key;
  568. for (key in O) !hasOwnProperty_1(hiddenKeys$1, key) && hasOwnProperty_1(O, key) && push$4(result, key);
  569. // Don't enum bug & hidden keys
  570. while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) {
  571. ~indexOf$1(result, key) || push$4(result, key);
  572. }
  573. return result;
  574. };
  575. // IE8- don't enum bug keys
  576. var enumBugKeys = [
  577. 'constructor',
  578. 'hasOwnProperty',
  579. 'isPrototypeOf',
  580. 'propertyIsEnumerable',
  581. 'toLocaleString',
  582. 'toString',
  583. 'valueOf'
  584. ];
  585. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  586. // `Object.getOwnPropertyNames` method
  587. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  588. // eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
  589. var f$2 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  590. return objectKeysInternal(O, hiddenKeys);
  591. };
  592. var objectGetOwnPropertyNames = {
  593. f: f$2
  594. };
  595. // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
  596. var f$1 = Object.getOwnPropertySymbols;
  597. var objectGetOwnPropertySymbols = {
  598. f: f$1
  599. };
  600. var concat$1 = functionUncurryThis([].concat);
  601. // all object keys, includes non-enumerable and symbols
  602. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  603. var keys = objectGetOwnPropertyNames.f(anObject(it));
  604. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  605. return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
  606. };
  607. var copyConstructorProperties = function (target, source, exceptions) {
  608. var keys = ownKeys(source);
  609. var defineProperty = objectDefineProperty.f;
  610. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  611. for (var i = 0; i < keys.length; i++) {
  612. var key = keys[i];
  613. if (!hasOwnProperty_1(target, key) && !(exceptions && hasOwnProperty_1(exceptions, key))) {
  614. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  615. }
  616. }
  617. };
  618. var replacement = /#|\.prototype\./;
  619. var isForced = function (feature, detection) {
  620. var value = data[normalize(feature)];
  621. return value == POLYFILL ? true
  622. : value == NATIVE ? false
  623. : isCallable(detection) ? fails(detection)
  624. : !!detection;
  625. };
  626. var normalize = isForced.normalize = function (string) {
  627. return String(string).replace(replacement, '.').toLowerCase();
  628. };
  629. var data = isForced.data = {};
  630. var NATIVE = isForced.NATIVE = 'N';
  631. var POLYFILL = isForced.POLYFILL = 'P';
  632. var isForced_1 = isForced;
  633. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  634. /*
  635. options.target - name of the target object
  636. options.global - target is the global object
  637. options.stat - export as static methods of target
  638. options.proto - export as prototype methods of target
  639. options.real - real prototype method for the `pure` version
  640. options.forced - export even if the native feature is available
  641. options.bind - bind methods to the target, required for the `pure` version
  642. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  643. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  644. options.sham - add a flag to not completely full polyfills
  645. options.enumerable - export as enumerable property
  646. options.noTargetGet - prevent calling a getter on target
  647. options.name - the .name of the function if it does not match the key
  648. */
  649. var _export = function (options, source) {
  650. var TARGET = options.target;
  651. var GLOBAL = options.global;
  652. var STATIC = options.stat;
  653. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  654. if (GLOBAL) {
  655. target = global_1;
  656. } else if (STATIC) {
  657. target = global_1[TARGET] || setGlobal(TARGET, {});
  658. } else {
  659. target = (global_1[TARGET] || {}).prototype;
  660. }
  661. if (target) for (key in source) {
  662. sourceProperty = source[key];
  663. if (options.noTargetGet) {
  664. descriptor = getOwnPropertyDescriptor(target, key);
  665. targetProperty = descriptor && descriptor.value;
  666. } else targetProperty = target[key];
  667. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  668. // contained in target
  669. if (!FORCED && targetProperty !== undefined) {
  670. if (typeof sourceProperty == typeof targetProperty) continue;
  671. copyConstructorProperties(sourceProperty, targetProperty);
  672. }
  673. // add a flag to not completely full polyfills
  674. if (options.sham || (targetProperty && targetProperty.sham)) {
  675. createNonEnumerableProperty(sourceProperty, 'sham', true);
  676. }
  677. defineBuiltIn(target, key, sourceProperty, options);
  678. }
  679. };
  680. var bind = functionUncurryThis(functionUncurryThis.bind);
  681. // optional / simple context binding
  682. var functionBindContext = function (fn, that) {
  683. aCallable(fn);
  684. return that === undefined ? fn : functionBindNative ? bind(fn, that) : function (/* ...args */) {
  685. return fn.apply(that, arguments);
  686. };
  687. };
  688. // `IsArray` abstract operation
  689. // https://tc39.es/ecma262/#sec-isarray
  690. // eslint-disable-next-line es-x/no-array-isarray -- safe
  691. var isArray = Array.isArray || function isArray(argument) {
  692. return classofRaw(argument) == 'Array';
  693. };
  694. var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
  695. var test$1 = {};
  696. test$1[TO_STRING_TAG$1] = 'z';
  697. var toStringTagSupport = String(test$1) === '[object z]';
  698. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  699. var Object$1 = global_1.Object;
  700. // ES3 wrong here
  701. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  702. // fallback for IE11 Script Access Denied error
  703. var tryGet = function (it, key) {
  704. try {
  705. return it[key];
  706. } catch (error) { /* empty */ }
  707. };
  708. // getting tag from ES6+ `Object.prototype.toString`
  709. var classof = toStringTagSupport ? classofRaw : function (it) {
  710. var O, tag, result;
  711. return it === undefined ? 'Undefined' : it === null ? 'Null'
  712. // @@toStringTag case
  713. : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
  714. // builtinTag case
  715. : CORRECT_ARGUMENTS ? classofRaw(O)
  716. // ES3 arguments fallback
  717. : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
  718. };
  719. var noop = function () { /* empty */ };
  720. var empty = [];
  721. var construct = getBuiltIn('Reflect', 'construct');
  722. var constructorRegExp = /^\s*(?:class|function)\b/;
  723. var exec$1 = functionUncurryThis(constructorRegExp.exec);
  724. var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
  725. var isConstructorModern = function isConstructor(argument) {
  726. if (!isCallable(argument)) return false;
  727. try {
  728. construct(noop, empty, argument);
  729. return true;
  730. } catch (error) {
  731. return false;
  732. }
  733. };
  734. var isConstructorLegacy = function isConstructor(argument) {
  735. if (!isCallable(argument)) return false;
  736. switch (classof(argument)) {
  737. case 'AsyncFunction':
  738. case 'GeneratorFunction':
  739. case 'AsyncGeneratorFunction': return false;
  740. }
  741. try {
  742. // we can't check .prototype since constructors produced by .bind haven't it
  743. // `Function#toString` throws on some built-it function in some legacy engines
  744. // (for example, `DOMQuad` and similar in FF41-)
  745. return INCORRECT_TO_STRING || !!exec$1(constructorRegExp, inspectSource(argument));
  746. } catch (error) {
  747. return true;
  748. }
  749. };
  750. isConstructorLegacy.sham = true;
  751. // `IsConstructor` abstract operation
  752. // https://tc39.es/ecma262/#sec-isconstructor
  753. var isConstructor = !construct || fails(function () {
  754. var called;
  755. return isConstructorModern(isConstructorModern.call)
  756. || !isConstructorModern(Object)
  757. || !isConstructorModern(function () { called = true; })
  758. || called;
  759. }) ? isConstructorLegacy : isConstructorModern;
  760. var SPECIES$3 = wellKnownSymbol('species');
  761. var Array$2 = global_1.Array;
  762. // a part of `ArraySpeciesCreate` abstract operation
  763. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  764. var arraySpeciesConstructor = function (originalArray) {
  765. var C;
  766. if (isArray(originalArray)) {
  767. C = originalArray.constructor;
  768. // cross-realm fallback
  769. if (isConstructor(C) && (C === Array$2 || isArray(C.prototype))) C = undefined;
  770. else if (isObject(C)) {
  771. C = C[SPECIES$3];
  772. if (C === null) C = undefined;
  773. }
  774. } return C === undefined ? Array$2 : C;
  775. };
  776. // `ArraySpeciesCreate` abstract operation
  777. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  778. var arraySpeciesCreate = function (originalArray, length) {
  779. return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
  780. };
  781. var push$3 = functionUncurryThis([].push);
  782. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
  783. var createMethod$2 = function (TYPE) {
  784. var IS_MAP = TYPE == 1;
  785. var IS_FILTER = TYPE == 2;
  786. var IS_SOME = TYPE == 3;
  787. var IS_EVERY = TYPE == 4;
  788. var IS_FIND_INDEX = TYPE == 6;
  789. var IS_FILTER_REJECT = TYPE == 7;
  790. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  791. return function ($this, callbackfn, that, specificCreate) {
  792. var O = toObject($this);
  793. var self = indexedObject(O);
  794. var boundFunction = functionBindContext(callbackfn, that);
  795. var length = lengthOfArrayLike(self);
  796. var index = 0;
  797. var create = specificCreate || arraySpeciesCreate;
  798. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
  799. var value, result;
  800. for (;length > index; index++) if (NO_HOLES || index in self) {
  801. value = self[index];
  802. result = boundFunction(value, index, O);
  803. if (TYPE) {
  804. if (IS_MAP) target[index] = result; // map
  805. else if (result) switch (TYPE) {
  806. case 3: return true; // some
  807. case 5: return value; // find
  808. case 6: return index; // findIndex
  809. case 2: push$3(target, value); // filter
  810. } else switch (TYPE) {
  811. case 4: return false; // every
  812. case 7: push$3(target, value); // filterReject
  813. }
  814. }
  815. }
  816. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  817. };
  818. };
  819. var arrayIteration = {
  820. // `Array.prototype.forEach` method
  821. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  822. forEach: createMethod$2(0),
  823. // `Array.prototype.map` method
  824. // https://tc39.es/ecma262/#sec-array.prototype.map
  825. map: createMethod$2(1),
  826. // `Array.prototype.filter` method
  827. // https://tc39.es/ecma262/#sec-array.prototype.filter
  828. filter: createMethod$2(2),
  829. // `Array.prototype.some` method
  830. // https://tc39.es/ecma262/#sec-array.prototype.some
  831. some: createMethod$2(3),
  832. // `Array.prototype.every` method
  833. // https://tc39.es/ecma262/#sec-array.prototype.every
  834. every: createMethod$2(4),
  835. // `Array.prototype.find` method
  836. // https://tc39.es/ecma262/#sec-array.prototype.find
  837. find: createMethod$2(5),
  838. // `Array.prototype.findIndex` method
  839. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  840. findIndex: createMethod$2(6),
  841. // `Array.prototype.filterReject` method
  842. // https://github.com/tc39/proposal-array-filtering
  843. filterReject: createMethod$2(7)
  844. };
  845. // `Object.keys` method
  846. // https://tc39.es/ecma262/#sec-object.keys
  847. // eslint-disable-next-line es-x/no-object-keys -- safe
  848. var objectKeys = Object.keys || function keys(O) {
  849. return objectKeysInternal(O, enumBugKeys);
  850. };
  851. // `Object.defineProperties` method
  852. // https://tc39.es/ecma262/#sec-object.defineproperties
  853. // eslint-disable-next-line es-x/no-object-defineproperties -- safe
  854. var f = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
  855. anObject(O);
  856. var props = toIndexedObject(Properties);
  857. var keys = objectKeys(Properties);
  858. var length = keys.length;
  859. var index = 0;
  860. var key;
  861. while (length > index) objectDefineProperty.f(O, key = keys[index++], props[key]);
  862. return O;
  863. };
  864. var objectDefineProperties = {
  865. f: f
  866. };
  867. var html = getBuiltIn('document', 'documentElement');
  868. /* global ActiveXObject -- old IE, WSH */
  869. var GT = '>';
  870. var LT = '<';
  871. var PROTOTYPE = 'prototype';
  872. var SCRIPT = 'script';
  873. var IE_PROTO = sharedKey('IE_PROTO');
  874. var EmptyConstructor = function () { /* empty */ };
  875. var scriptTag = function (content) {
  876. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  877. };
  878. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  879. var NullProtoObjectViaActiveX = function (activeXDocument) {
  880. activeXDocument.write(scriptTag(''));
  881. activeXDocument.close();
  882. var temp = activeXDocument.parentWindow.Object;
  883. activeXDocument = null; // avoid memory leak
  884. return temp;
  885. };
  886. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  887. var NullProtoObjectViaIFrame = function () {
  888. // Thrash, waste and sodomy: IE GC bug
  889. var iframe = documentCreateElement('iframe');
  890. var JS = 'java' + SCRIPT + ':';
  891. var iframeDocument;
  892. iframe.style.display = 'none';
  893. html.appendChild(iframe);
  894. // https://github.com/zloirock/core-js/issues/475
  895. iframe.src = String(JS);
  896. iframeDocument = iframe.contentWindow.document;
  897. iframeDocument.open();
  898. iframeDocument.write(scriptTag('document.F=Object'));
  899. iframeDocument.close();
  900. return iframeDocument.F;
  901. };
  902. // Check for document.domain and active x support
  903. // No need to use active x approach when document.domain is not set
  904. // see https://github.com/es-shims/es5-shim/issues/150
  905. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  906. // avoid IE GC bug
  907. var activeXDocument;
  908. var NullProtoObject = function () {
  909. try {
  910. activeXDocument = new ActiveXObject('htmlfile');
  911. } catch (error) { /* ignore */ }
  912. NullProtoObject = typeof document != 'undefined'
  913. ? document.domain && activeXDocument
  914. ? NullProtoObjectViaActiveX(activeXDocument) // old IE
  915. : NullProtoObjectViaIFrame()
  916. : NullProtoObjectViaActiveX(activeXDocument); // WSH
  917. var length = enumBugKeys.length;
  918. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  919. return NullProtoObject();
  920. };
  921. hiddenKeys$1[IE_PROTO] = true;
  922. // `Object.create` method
  923. // https://tc39.es/ecma262/#sec-object.create
  924. // eslint-disable-next-line es-x/no-object-create -- safe
  925. var objectCreate = Object.create || function create(O, Properties) {
  926. var result;
  927. if (O !== null) {
  928. EmptyConstructor[PROTOTYPE] = anObject(O);
  929. result = new EmptyConstructor();
  930. EmptyConstructor[PROTOTYPE] = null;
  931. // add "__proto__" for Object.getPrototypeOf polyfill
  932. result[IE_PROTO] = O;
  933. } else result = NullProtoObject();
  934. return Properties === undefined ? result : objectDefineProperties.f(result, Properties);
  935. };
  936. var UNSCOPABLES = wellKnownSymbol('unscopables');
  937. var ArrayPrototype = Array.prototype;
  938. // Array.prototype[@@unscopables]
  939. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  940. if (ArrayPrototype[UNSCOPABLES] == undefined) {
  941. objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
  942. configurable: true,
  943. value: objectCreate(null)
  944. });
  945. }
  946. // add a key to Array.prototype[@@unscopables]
  947. var addToUnscopables = function (key) {
  948. ArrayPrototype[UNSCOPABLES][key] = true;
  949. };
  950. var $find = arrayIteration.find;
  951. var FIND = 'find';
  952. var SKIPS_HOLES = true;
  953. // Shouldn't skip holes
  954. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  955. // `Array.prototype.find` method
  956. // https://tc39.es/ecma262/#sec-array.prototype.find
  957. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  958. find: function find(callbackfn /* , that = undefined */) {
  959. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  960. }
  961. });
  962. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  963. addToUnscopables(FIND);
  964. // `Object.prototype.toString` method implementation
  965. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  966. var objectToString = toStringTagSupport ? {}.toString : function toString() {
  967. return '[object ' + classof(this) + ']';
  968. };
  969. // `Object.prototype.toString` method
  970. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  971. if (!toStringTagSupport) {
  972. defineBuiltIn(Object.prototype, 'toString', objectToString, { unsafe: true });
  973. }
  974. var String$1 = global_1.String;
  975. var toString_1 = function (argument) {
  976. if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
  977. return String$1(argument);
  978. };
  979. // a string of all valid unicode whitespaces
  980. var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
  981. '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  982. var replace$2 = functionUncurryThis(''.replace);
  983. var whitespace = '[' + whitespaces + ']';
  984. var ltrim = RegExp('^' + whitespace + whitespace + '*');
  985. var rtrim = RegExp(whitespace + whitespace + '*$');
  986. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  987. var createMethod$1 = function (TYPE) {
  988. return function ($this) {
  989. var string = toString_1(requireObjectCoercible($this));
  990. if (TYPE & 1) string = replace$2(string, ltrim, '');
  991. if (TYPE & 2) string = replace$2(string, rtrim, '');
  992. return string;
  993. };
  994. };
  995. var stringTrim = {
  996. // `String.prototype.{ trimLeft, trimStart }` methods
  997. // https://tc39.es/ecma262/#sec-string.prototype.trimstart
  998. start: createMethod$1(1),
  999. // `String.prototype.{ trimRight, trimEnd }` methods
  1000. // https://tc39.es/ecma262/#sec-string.prototype.trimend
  1001. end: createMethod$1(2),
  1002. // `String.prototype.trim` method
  1003. // https://tc39.es/ecma262/#sec-string.prototype.trim
  1004. trim: createMethod$1(3)
  1005. };
  1006. var PROPER_FUNCTION_NAME$1 = functionName.PROPER;
  1007. var non = '\u200B\u0085\u180E';
  1008. // check that a method works with the correct list
  1009. // of whitespaces and has a correct name
  1010. var stringTrimForced = function (METHOD_NAME) {
  1011. return fails(function () {
  1012. return !!whitespaces[METHOD_NAME]()
  1013. || non[METHOD_NAME]() !== non
  1014. || (PROPER_FUNCTION_NAME$1 && whitespaces[METHOD_NAME].name !== METHOD_NAME);
  1015. });
  1016. };
  1017. var $trim = stringTrim.trim;
  1018. // `String.prototype.trim` method
  1019. // https://tc39.es/ecma262/#sec-string.prototype.trim
  1020. _export({ target: 'String', proto: true, forced: stringTrimForced('trim') }, {
  1021. trim: function trim() {
  1022. return $trim(this);
  1023. }
  1024. });
  1025. // `RegExp.prototype.flags` getter implementation
  1026. // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
  1027. var regexpFlags = function () {
  1028. var that = anObject(this);
  1029. var result = '';
  1030. if (that.hasIndices) result += 'd';
  1031. if (that.global) result += 'g';
  1032. if (that.ignoreCase) result += 'i';
  1033. if (that.multiline) result += 'm';
  1034. if (that.dotAll) result += 's';
  1035. if (that.unicode) result += 'u';
  1036. if (that.sticky) result += 'y';
  1037. return result;
  1038. };
  1039. var RegExpPrototype$2 = RegExp.prototype;
  1040. var regexpGetFlags = function (R) {
  1041. var flags = R.flags;
  1042. return flags === undefined && !('flags' in RegExpPrototype$2) && !hasOwnProperty_1(R, 'flags') && objectIsPrototypeOf(RegExpPrototype$2, R)
  1043. ? functionCall(regexpFlags, R) : flags;
  1044. };
  1045. var PROPER_FUNCTION_NAME = functionName.PROPER;
  1046. var TO_STRING = 'toString';
  1047. var RegExpPrototype$1 = RegExp.prototype;
  1048. var n$ToString = RegExpPrototype$1[TO_STRING];
  1049. var NOT_GENERIC = fails(function () { return n$ToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
  1050. // FF44- RegExp#toString has a wrong name
  1051. var INCORRECT_NAME = PROPER_FUNCTION_NAME && n$ToString.name != TO_STRING;
  1052. // `RegExp.prototype.toString` method
  1053. // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
  1054. if (NOT_GENERIC || INCORRECT_NAME) {
  1055. defineBuiltIn(RegExp.prototype, TO_STRING, function toString() {
  1056. var R = anObject(this);
  1057. var pattern = toString_1(R.source);
  1058. var flags = toString_1(regexpGetFlags(R));
  1059. return '/' + pattern + '/' + flags;
  1060. }, { unsafe: true });
  1061. }
  1062. var createProperty = function (object, key, value) {
  1063. var propertyKey = toPropertyKey(key);
  1064. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  1065. else object[propertyKey] = value;
  1066. };
  1067. var Array$1 = global_1.Array;
  1068. var max$1 = Math.max;
  1069. var arraySliceSimple = function (O, start, end) {
  1070. var length = lengthOfArrayLike(O);
  1071. var k = toAbsoluteIndex(start, length);
  1072. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  1073. var result = Array$1(max$1(fin - k, 0));
  1074. for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
  1075. result.length = n;
  1076. return result;
  1077. };
  1078. var floor$1 = Math.floor;
  1079. var mergeSort = function (array, comparefn) {
  1080. var length = array.length;
  1081. var middle = floor$1(length / 2);
  1082. return length < 8 ? insertionSort(array, comparefn) : merge(
  1083. array,
  1084. mergeSort(arraySliceSimple(array, 0, middle), comparefn),
  1085. mergeSort(arraySliceSimple(array, middle), comparefn),
  1086. comparefn
  1087. );
  1088. };
  1089. var insertionSort = function (array, comparefn) {
  1090. var length = array.length;
  1091. var i = 1;
  1092. var element, j;
  1093. while (i < length) {
  1094. j = i;
  1095. element = array[i];
  1096. while (j && comparefn(array[j - 1], element) > 0) {
  1097. array[j] = array[--j];
  1098. }
  1099. if (j !== i++) array[j] = element;
  1100. } return array;
  1101. };
  1102. var merge = function (array, left, right, comparefn) {
  1103. var llength = left.length;
  1104. var rlength = right.length;
  1105. var lindex = 0;
  1106. var rindex = 0;
  1107. while (lindex < llength || rindex < rlength) {
  1108. array[lindex + rindex] = (lindex < llength && rindex < rlength)
  1109. ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
  1110. : lindex < llength ? left[lindex++] : right[rindex++];
  1111. } return array;
  1112. };
  1113. var arraySort = mergeSort;
  1114. var arrayMethodIsStrict = function (METHOD_NAME, argument) {
  1115. var method = [][METHOD_NAME];
  1116. return !!method && fails(function () {
  1117. // eslint-disable-next-line no-useless-call -- required for testing
  1118. method.call(null, argument || function () { return 1; }, 1);
  1119. });
  1120. };
  1121. var firefox = engineUserAgent.match(/firefox\/(\d+)/i);
  1122. var engineFfVersion = !!firefox && +firefox[1];
  1123. var engineIsIeOrEdge = /MSIE|Trident/.test(engineUserAgent);
  1124. var webkit = engineUserAgent.match(/AppleWebKit\/(\d+)\./);
  1125. var engineWebkitVersion = !!webkit && +webkit[1];
  1126. var test = [];
  1127. var un$Sort = functionUncurryThis(test.sort);
  1128. var push$2 = functionUncurryThis(test.push);
  1129. // IE8-
  1130. var FAILS_ON_UNDEFINED = fails(function () {
  1131. test.sort(undefined);
  1132. });
  1133. // V8 bug
  1134. var FAILS_ON_NULL = fails(function () {
  1135. test.sort(null);
  1136. });
  1137. // Old WebKit
  1138. var STRICT_METHOD$3 = arrayMethodIsStrict('sort');
  1139. var STABLE_SORT = !fails(function () {
  1140. // feature detection can be too slow, so check engines versions
  1141. if (engineV8Version) return engineV8Version < 70;
  1142. if (engineFfVersion && engineFfVersion > 3) return;
  1143. if (engineIsIeOrEdge) return true;
  1144. if (engineWebkitVersion) return engineWebkitVersion < 603;
  1145. var result = '';
  1146. var code, chr, value, index;
  1147. // generate an array with more 512 elements (Chakra and old V8 fails only in this case)
  1148. for (code = 65; code < 76; code++) {
  1149. chr = String.fromCharCode(code);
  1150. switch (code) {
  1151. case 66: case 69: case 70: case 72: value = 3; break;
  1152. case 68: case 71: value = 4; break;
  1153. default: value = 2;
  1154. }
  1155. for (index = 0; index < 47; index++) {
  1156. test.push({ k: chr + index, v: value });
  1157. }
  1158. }
  1159. test.sort(function (a, b) { return b.v - a.v; });
  1160. for (index = 0; index < test.length; index++) {
  1161. chr = test[index].k.charAt(0);
  1162. if (result.charAt(result.length - 1) !== chr) result += chr;
  1163. }
  1164. return result !== 'DGBEFHACIJK';
  1165. });
  1166. var FORCED$1 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD$3 || !STABLE_SORT;
  1167. var getSortCompare = function (comparefn) {
  1168. return function (x, y) {
  1169. if (y === undefined) return -1;
  1170. if (x === undefined) return 1;
  1171. if (comparefn !== undefined) return +comparefn(x, y) || 0;
  1172. return toString_1(x) > toString_1(y) ? 1 : -1;
  1173. };
  1174. };
  1175. // `Array.prototype.sort` method
  1176. // https://tc39.es/ecma262/#sec-array.prototype.sort
  1177. _export({ target: 'Array', proto: true, forced: FORCED$1 }, {
  1178. sort: function sort(comparefn) {
  1179. if (comparefn !== undefined) aCallable(comparefn);
  1180. var array = toObject(this);
  1181. if (STABLE_SORT) return comparefn === undefined ? un$Sort(array) : un$Sort(array, comparefn);
  1182. var items = [];
  1183. var arrayLength = lengthOfArrayLike(array);
  1184. var itemsLength, index;
  1185. for (index = 0; index < arrayLength; index++) {
  1186. if (index in array) push$2(items, array[index]);
  1187. }
  1188. arraySort(items, getSortCompare(comparefn));
  1189. itemsLength = items.length;
  1190. index = 0;
  1191. while (index < itemsLength) array[index] = items[index++];
  1192. while (index < arrayLength) delete array[index++];
  1193. return array;
  1194. }
  1195. });
  1196. // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
  1197. var $RegExp$2 = global_1.RegExp;
  1198. var UNSUPPORTED_Y$2 = fails(function () {
  1199. var re = $RegExp$2('a', 'y');
  1200. re.lastIndex = 2;
  1201. return re.exec('abcd') != null;
  1202. });
  1203. // UC Browser bug
  1204. // https://github.com/zloirock/core-js/issues/1008
  1205. var MISSED_STICKY = UNSUPPORTED_Y$2 || fails(function () {
  1206. return !$RegExp$2('a', 'y').sticky;
  1207. });
  1208. var BROKEN_CARET = UNSUPPORTED_Y$2 || fails(function () {
  1209. // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
  1210. var re = $RegExp$2('^r', 'gy');
  1211. re.lastIndex = 2;
  1212. return re.exec('str') != null;
  1213. });
  1214. var regexpStickyHelpers = {
  1215. BROKEN_CARET: BROKEN_CARET,
  1216. MISSED_STICKY: MISSED_STICKY,
  1217. UNSUPPORTED_Y: UNSUPPORTED_Y$2
  1218. };
  1219. // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
  1220. var $RegExp$1 = global_1.RegExp;
  1221. var regexpUnsupportedDotAll = fails(function () {
  1222. var re = $RegExp$1('.', 's');
  1223. return !(re.dotAll && re.exec('\n') && re.flags === 's');
  1224. });
  1225. // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
  1226. var $RegExp = global_1.RegExp;
  1227. var regexpUnsupportedNcg = fails(function () {
  1228. var re = $RegExp('(?<a>b)', 'g');
  1229. return re.exec('b').groups.a !== 'b' ||
  1230. 'b'.replace(re, '$<a>c') !== 'bc';
  1231. });
  1232. /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
  1233. /* eslint-disable regexp/no-useless-quantifier -- testing */
  1234. var getInternalState = internalState.get;
  1235. var nativeReplace = shared('native-string-replace', String.prototype.replace);
  1236. var nativeExec = RegExp.prototype.exec;
  1237. var patchedExec = nativeExec;
  1238. var charAt$3 = functionUncurryThis(''.charAt);
  1239. var indexOf = functionUncurryThis(''.indexOf);
  1240. var replace$1 = functionUncurryThis(''.replace);
  1241. var stringSlice$4 = functionUncurryThis(''.slice);
  1242. var UPDATES_LAST_INDEX_WRONG = (function () {
  1243. var re1 = /a/;
  1244. var re2 = /b*/g;
  1245. functionCall(nativeExec, re1, 'a');
  1246. functionCall(nativeExec, re2, 'a');
  1247. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  1248. })();
  1249. var UNSUPPORTED_Y$1 = regexpStickyHelpers.BROKEN_CARET;
  1250. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  1251. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  1252. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1 || regexpUnsupportedDotAll || regexpUnsupportedNcg;
  1253. if (PATCH) {
  1254. patchedExec = function exec(string) {
  1255. var re = this;
  1256. var state = getInternalState(re);
  1257. var str = toString_1(string);
  1258. var raw = state.raw;
  1259. var result, reCopy, lastIndex, match, i, object, group;
  1260. if (raw) {
  1261. raw.lastIndex = re.lastIndex;
  1262. result = functionCall(patchedExec, raw, str);
  1263. re.lastIndex = raw.lastIndex;
  1264. return result;
  1265. }
  1266. var groups = state.groups;
  1267. var sticky = UNSUPPORTED_Y$1 && re.sticky;
  1268. var flags = functionCall(regexpFlags, re);
  1269. var source = re.source;
  1270. var charsAdded = 0;
  1271. var strCopy = str;
  1272. if (sticky) {
  1273. flags = replace$1(flags, 'y', '');
  1274. if (indexOf(flags, 'g') === -1) {
  1275. flags += 'g';
  1276. }
  1277. strCopy = stringSlice$4(str, re.lastIndex);
  1278. // Support anchored sticky behavior.
  1279. if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$3(str, re.lastIndex - 1) !== '\n')) {
  1280. source = '(?: ' + source + ')';
  1281. strCopy = ' ' + strCopy;
  1282. charsAdded++;
  1283. }
  1284. // ^(? + rx + ) is needed, in combination with some str slicing, to
  1285. // simulate the 'y' flag.
  1286. reCopy = new RegExp('^(?:' + source + ')', flags);
  1287. }
  1288. if (NPCG_INCLUDED) {
  1289. reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
  1290. }
  1291. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  1292. match = functionCall(nativeExec, sticky ? reCopy : re, strCopy);
  1293. if (sticky) {
  1294. if (match) {
  1295. match.input = stringSlice$4(match.input, charsAdded);
  1296. match[0] = stringSlice$4(match[0], charsAdded);
  1297. match.index = re.lastIndex;
  1298. re.lastIndex += match[0].length;
  1299. } else re.lastIndex = 0;
  1300. } else if (UPDATES_LAST_INDEX_WRONG && match) {
  1301. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  1302. }
  1303. if (NPCG_INCLUDED && match && match.length > 1) {
  1304. // Fix browsers whose `exec` methods don't consistently return `undefined`
  1305. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  1306. functionCall(nativeReplace, match[0], reCopy, function () {
  1307. for (i = 1; i < arguments.length - 2; i++) {
  1308. if (arguments[i] === undefined) match[i] = undefined;
  1309. }
  1310. });
  1311. }
  1312. if (match && groups) {
  1313. match.groups = object = objectCreate(null);
  1314. for (i = 0; i < groups.length; i++) {
  1315. group = groups[i];
  1316. object[group[0]] = match[group[1]];
  1317. }
  1318. }
  1319. return match;
  1320. };
  1321. }
  1322. var regexpExec = patchedExec;
  1323. // `RegExp.prototype.exec` method
  1324. // https://tc39.es/ecma262/#sec-regexp.prototype.exec
  1325. _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
  1326. exec: regexpExec
  1327. });
  1328. var FunctionPrototype = Function.prototype;
  1329. var apply = FunctionPrototype.apply;
  1330. var call = FunctionPrototype.call;
  1331. // eslint-disable-next-line es-x/no-reflect -- safe
  1332. var functionApply = typeof Reflect == 'object' && Reflect.apply || (functionBindNative ? call.bind(apply) : function () {
  1333. return call.apply(apply, arguments);
  1334. });
  1335. // TODO: Remove from `core-js@4` since it's moved to entry points
  1336. var SPECIES$2 = wellKnownSymbol('species');
  1337. var RegExpPrototype = RegExp.prototype;
  1338. var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
  1339. var SYMBOL = wellKnownSymbol(KEY);
  1340. var DELEGATES_TO_SYMBOL = !fails(function () {
  1341. // String methods call symbol-named RegEp methods
  1342. var O = {};
  1343. O[SYMBOL] = function () { return 7; };
  1344. return ''[KEY](O) != 7;
  1345. });
  1346. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  1347. // Symbol-named RegExp methods call .exec
  1348. var execCalled = false;
  1349. var re = /a/;
  1350. if (KEY === 'split') {
  1351. // We can't use real regex here since it causes deoptimization
  1352. // and serious performance degradation in V8
  1353. // https://github.com/zloirock/core-js/issues/306
  1354. re = {};
  1355. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  1356. // a new one. We need to return the patched regex when creating the new one.
  1357. re.constructor = {};
  1358. re.constructor[SPECIES$2] = function () { return re; };
  1359. re.flags = '';
  1360. re[SYMBOL] = /./[SYMBOL];
  1361. }
  1362. re.exec = function () { execCalled = true; return null; };
  1363. re[SYMBOL]('');
  1364. return !execCalled;
  1365. });
  1366. if (
  1367. !DELEGATES_TO_SYMBOL ||
  1368. !DELEGATES_TO_EXEC ||
  1369. FORCED
  1370. ) {
  1371. var uncurriedNativeRegExpMethod = functionUncurryThis(/./[SYMBOL]);
  1372. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  1373. var uncurriedNativeMethod = functionUncurryThis(nativeMethod);
  1374. var $exec = regexp.exec;
  1375. if ($exec === regexpExec || $exec === RegExpPrototype.exec) {
  1376. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  1377. // The native String method already delegates to @@method (this
  1378. // polyfilled function), leasing to infinite recursion.
  1379. // We avoid it by directly calling the native @@method method.
  1380. return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
  1381. }
  1382. return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
  1383. }
  1384. return { done: false };
  1385. });
  1386. defineBuiltIn(String.prototype, KEY, methods[0]);
  1387. defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]);
  1388. }
  1389. if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
  1390. };
  1391. var charAt$2 = functionUncurryThis(''.charAt);
  1392. var charCodeAt = functionUncurryThis(''.charCodeAt);
  1393. var stringSlice$3 = functionUncurryThis(''.slice);
  1394. var createMethod = function (CONVERT_TO_STRING) {
  1395. return function ($this, pos) {
  1396. var S = toString_1(requireObjectCoercible($this));
  1397. var position = toIntegerOrInfinity(pos);
  1398. var size = S.length;
  1399. var first, second;
  1400. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  1401. first = charCodeAt(S, position);
  1402. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  1403. || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
  1404. ? CONVERT_TO_STRING
  1405. ? charAt$2(S, position)
  1406. : first
  1407. : CONVERT_TO_STRING
  1408. ? stringSlice$3(S, position, position + 2)
  1409. : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  1410. };
  1411. };
  1412. var stringMultibyte = {
  1413. // `String.prototype.codePointAt` method
  1414. // https://tc39.es/ecma262/#sec-string.prototype.codepointat
  1415. codeAt: createMethod(false),
  1416. // `String.prototype.at` method
  1417. // https://github.com/mathiasbynens/String.prototype.at
  1418. charAt: createMethod(true)
  1419. };
  1420. var charAt$1 = stringMultibyte.charAt;
  1421. // `AdvanceStringIndex` abstract operation
  1422. // https://tc39.es/ecma262/#sec-advancestringindex
  1423. var advanceStringIndex = function (S, index, unicode) {
  1424. return index + (unicode ? charAt$1(S, index).length : 1);
  1425. };
  1426. var floor = Math.floor;
  1427. var charAt = functionUncurryThis(''.charAt);
  1428. var replace = functionUncurryThis(''.replace);
  1429. var stringSlice$2 = functionUncurryThis(''.slice);
  1430. var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
  1431. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
  1432. // `GetSubstitution` abstract operation
  1433. // https://tc39.es/ecma262/#sec-getsubstitution
  1434. var getSubstitution = function (matched, str, position, captures, namedCaptures, replacement) {
  1435. var tailPos = position + matched.length;
  1436. var m = captures.length;
  1437. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  1438. if (namedCaptures !== undefined) {
  1439. namedCaptures = toObject(namedCaptures);
  1440. symbols = SUBSTITUTION_SYMBOLS;
  1441. }
  1442. return replace(replacement, symbols, function (match, ch) {
  1443. var capture;
  1444. switch (charAt(ch, 0)) {
  1445. case '$': return '$';
  1446. case '&': return matched;
  1447. case '`': return stringSlice$2(str, 0, position);
  1448. case "'": return stringSlice$2(str, tailPos);
  1449. case '<':
  1450. capture = namedCaptures[stringSlice$2(ch, 1, -1)];
  1451. break;
  1452. default: // \d\d?
  1453. var n = +ch;
  1454. if (n === 0) return match;
  1455. if (n > m) {
  1456. var f = floor(n / 10);
  1457. if (f === 0) return match;
  1458. if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
  1459. return match;
  1460. }
  1461. capture = captures[n - 1];
  1462. }
  1463. return capture === undefined ? '' : capture;
  1464. });
  1465. };
  1466. var TypeError$3 = global_1.TypeError;
  1467. // `RegExpExec` abstract operation
  1468. // https://tc39.es/ecma262/#sec-regexpexec
  1469. var regexpExecAbstract = function (R, S) {
  1470. var exec = R.exec;
  1471. if (isCallable(exec)) {
  1472. var result = functionCall(exec, R, S);
  1473. if (result !== null) anObject(result);
  1474. return result;
  1475. }
  1476. if (classofRaw(R) === 'RegExp') return functionCall(regexpExec, R, S);
  1477. throw TypeError$3('RegExp#exec called on incompatible receiver');
  1478. };
  1479. var REPLACE = wellKnownSymbol('replace');
  1480. var max = Math.max;
  1481. var min$1 = Math.min;
  1482. var concat = functionUncurryThis([].concat);
  1483. var push$1 = functionUncurryThis([].push);
  1484. var stringIndexOf = functionUncurryThis(''.indexOf);
  1485. var stringSlice$1 = functionUncurryThis(''.slice);
  1486. var maybeToString = function (it) {
  1487. return it === undefined ? it : String(it);
  1488. };
  1489. // IE <= 11 replaces $0 with the whole match, as if it was $&
  1490. // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
  1491. var REPLACE_KEEPS_$0 = (function () {
  1492. // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
  1493. return 'a'.replace(/./, '$0') === '$0';
  1494. })();
  1495. // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
  1496. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
  1497. if (/./[REPLACE]) {
  1498. return /./[REPLACE]('a', '$0') === '';
  1499. }
  1500. return false;
  1501. })();
  1502. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  1503. var re = /./;
  1504. re.exec = function () {
  1505. var result = [];
  1506. result.groups = { a: '7' };
  1507. return result;
  1508. };
  1509. // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
  1510. return ''.replace(re, '$<a>') !== '7';
  1511. });
  1512. // @@replace logic
  1513. fixRegexpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
  1514. var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
  1515. return [
  1516. // `String.prototype.replace` method
  1517. // https://tc39.es/ecma262/#sec-string.prototype.replace
  1518. function replace(searchValue, replaceValue) {
  1519. var O = requireObjectCoercible(this);
  1520. var replacer = searchValue == undefined ? undefined : getMethod(searchValue, REPLACE);
  1521. return replacer
  1522. ? functionCall(replacer, searchValue, O, replaceValue)
  1523. : functionCall(nativeReplace, toString_1(O), searchValue, replaceValue);
  1524. },
  1525. // `RegExp.prototype[@@replace]` method
  1526. // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
  1527. function (string, replaceValue) {
  1528. var rx = anObject(this);
  1529. var S = toString_1(string);
  1530. if (
  1531. typeof replaceValue == 'string' &&
  1532. stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
  1533. stringIndexOf(replaceValue, '$<') === -1
  1534. ) {
  1535. var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
  1536. if (res.done) return res.value;
  1537. }
  1538. var functionalReplace = isCallable(replaceValue);
  1539. if (!functionalReplace) replaceValue = toString_1(replaceValue);
  1540. var global = rx.global;
  1541. if (global) {
  1542. var fullUnicode = rx.unicode;
  1543. rx.lastIndex = 0;
  1544. }
  1545. var results = [];
  1546. while (true) {
  1547. var result = regexpExecAbstract(rx, S);
  1548. if (result === null) break;
  1549. push$1(results, result);
  1550. if (!global) break;
  1551. var matchStr = toString_1(result[0]);
  1552. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  1553. }
  1554. var accumulatedResult = '';
  1555. var nextSourcePosition = 0;
  1556. for (var i = 0; i < results.length; i++) {
  1557. result = results[i];
  1558. var matched = toString_1(result[0]);
  1559. var position = max(min$1(toIntegerOrInfinity(result.index), S.length), 0);
  1560. var captures = [];
  1561. // NOTE: This is equivalent to
  1562. // captures = result.slice(1).map(maybeToString)
  1563. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  1564. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  1565. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  1566. for (var j = 1; j < result.length; j++) push$1(captures, maybeToString(result[j]));
  1567. var namedCaptures = result.groups;
  1568. if (functionalReplace) {
  1569. var replacerArgs = concat([matched], captures, position, S);
  1570. if (namedCaptures !== undefined) push$1(replacerArgs, namedCaptures);
  1571. var replacement = toString_1(functionApply(replaceValue, undefined, replacerArgs));
  1572. } else {
  1573. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  1574. }
  1575. if (position >= nextSourcePosition) {
  1576. accumulatedResult += stringSlice$1(S, nextSourcePosition, position) + replacement;
  1577. nextSourcePosition = position + matched.length;
  1578. }
  1579. }
  1580. return accumulatedResult + stringSlice$1(S, nextSourcePosition);
  1581. }
  1582. ];
  1583. }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
  1584. var SPECIES$1 = wellKnownSymbol('species');
  1585. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  1586. // We can't use this feature detection in V8 since it causes
  1587. // deoptimization and serious performance degradation
  1588. // https://github.com/zloirock/core-js/issues/677
  1589. return engineV8Version >= 51 || !fails(function () {
  1590. var array = [];
  1591. var constructor = array.constructor = {};
  1592. constructor[SPECIES$1] = function () {
  1593. return { foo: 1 };
  1594. };
  1595. return array[METHOD_NAME](Boolean).foo !== 1;
  1596. });
  1597. };
  1598. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  1599. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  1600. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  1601. var TypeError$2 = global_1.TypeError;
  1602. // We can't use this feature detection in V8 since it causes
  1603. // deoptimization and serious performance degradation
  1604. // https://github.com/zloirock/core-js/issues/679
  1605. var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
  1606. var array = [];
  1607. array[IS_CONCAT_SPREADABLE] = false;
  1608. return array.concat()[0] !== array;
  1609. });
  1610. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  1611. var isConcatSpreadable = function (O) {
  1612. if (!isObject(O)) return false;
  1613. var spreadable = O[IS_CONCAT_SPREADABLE];
  1614. return spreadable !== undefined ? !!spreadable : isArray(O);
  1615. };
  1616. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  1617. // `Array.prototype.concat` method
  1618. // https://tc39.es/ecma262/#sec-array.prototype.concat
  1619. // with adding support of @@isConcatSpreadable and @@species
  1620. _export({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
  1621. // eslint-disable-next-line no-unused-vars -- required for `.length`
  1622. concat: function concat(arg) {
  1623. var O = toObject(this);
  1624. var A = arraySpeciesCreate(O, 0);
  1625. var n = 0;
  1626. var i, k, length, len, E;
  1627. for (i = -1, length = arguments.length; i < length; i++) {
  1628. E = i === -1 ? O : arguments[i];
  1629. if (isConcatSpreadable(E)) {
  1630. len = lengthOfArrayLike(E);
  1631. if (n + len > MAX_SAFE_INTEGER) throw TypeError$2(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1632. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  1633. } else {
  1634. if (n >= MAX_SAFE_INTEGER) throw TypeError$2(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1635. createProperty(A, n++, E);
  1636. }
  1637. }
  1638. A.length = n;
  1639. return A;
  1640. }
  1641. });
  1642. var $filter = arrayIteration.filter;
  1643. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
  1644. // `Array.prototype.filter` method
  1645. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1646. // with adding support of @@species
  1647. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  1648. filter: function filter(callbackfn /* , thisArg */) {
  1649. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1650. }
  1651. });
  1652. // @@match logic
  1653. fixRegexpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {
  1654. return [
  1655. // `String.prototype.match` method
  1656. // https://tc39.es/ecma262/#sec-string.prototype.match
  1657. function match(regexp) {
  1658. var O = requireObjectCoercible(this);
  1659. var matcher = regexp == undefined ? undefined : getMethod(regexp, MATCH);
  1660. return matcher ? functionCall(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString_1(O));
  1661. },
  1662. // `RegExp.prototype[@@match]` method
  1663. // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
  1664. function (string) {
  1665. var rx = anObject(this);
  1666. var S = toString_1(string);
  1667. var res = maybeCallNative(nativeMatch, rx, S);
  1668. if (res.done) return res.value;
  1669. if (!rx.global) return regexpExecAbstract(rx, S);
  1670. var fullUnicode = rx.unicode;
  1671. rx.lastIndex = 0;
  1672. var A = [];
  1673. var n = 0;
  1674. var result;
  1675. while ((result = regexpExecAbstract(rx, S)) !== null) {
  1676. var matchStr = toString_1(result[0]);
  1677. A[n] = matchStr;
  1678. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  1679. n++;
  1680. }
  1681. return n === 0 ? null : A;
  1682. }
  1683. ];
  1684. });
  1685. var MATCH = wellKnownSymbol('match');
  1686. // `IsRegExp` abstract operation
  1687. // https://tc39.es/ecma262/#sec-isregexp
  1688. var isRegexp = function (it) {
  1689. var isRegExp;
  1690. return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
  1691. };
  1692. var TypeError$1 = global_1.TypeError;
  1693. // `Assert: IsConstructor(argument) is true`
  1694. var aConstructor = function (argument) {
  1695. if (isConstructor(argument)) return argument;
  1696. throw TypeError$1(tryToString(argument) + ' is not a constructor');
  1697. };
  1698. var SPECIES = wellKnownSymbol('species');
  1699. // `SpeciesConstructor` abstract operation
  1700. // https://tc39.es/ecma262/#sec-speciesconstructor
  1701. var speciesConstructor = function (O, defaultConstructor) {
  1702. var C = anObject(O).constructor;
  1703. var S;
  1704. return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aConstructor(S);
  1705. };
  1706. var UNSUPPORTED_Y = regexpStickyHelpers.UNSUPPORTED_Y;
  1707. var MAX_UINT32 = 0xFFFFFFFF;
  1708. var min = Math.min;
  1709. var $push = [].push;
  1710. var exec = functionUncurryThis(/./.exec);
  1711. var push = functionUncurryThis($push);
  1712. var stringSlice = functionUncurryThis(''.slice);
  1713. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  1714. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  1715. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  1716. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  1717. var re = /(?:)/;
  1718. var originalExec = re.exec;
  1719. re.exec = function () { return originalExec.apply(this, arguments); };
  1720. var result = 'ab'.split(re);
  1721. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  1722. });
  1723. // @@split logic
  1724. fixRegexpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {
  1725. var internalSplit;
  1726. if (
  1727. 'abbc'.split(/(b)*/)[1] == 'c' ||
  1728. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  1729. 'test'.split(/(?:)/, -1).length != 4 ||
  1730. 'ab'.split(/(?:ab)*/).length != 2 ||
  1731. '.'.split(/(.?)(.?)/).length != 4 ||
  1732. // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
  1733. '.'.split(/()()/).length > 1 ||
  1734. ''.split(/.?/).length
  1735. ) {
  1736. // based on es5-shim implementation, need to rework it
  1737. internalSplit = function (separator, limit) {
  1738. var string = toString_1(requireObjectCoercible(this));
  1739. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  1740. if (lim === 0) return [];
  1741. if (separator === undefined) return [string];
  1742. // If `separator` is not a regex, use native split
  1743. if (!isRegexp(separator)) {
  1744. return functionCall(nativeSplit, string, separator, lim);
  1745. }
  1746. var output = [];
  1747. var flags = (separator.ignoreCase ? 'i' : '') +
  1748. (separator.multiline ? 'm' : '') +
  1749. (separator.unicode ? 'u' : '') +
  1750. (separator.sticky ? 'y' : '');
  1751. var lastLastIndex = 0;
  1752. // Make `global` and avoid `lastIndex` issues by working with a copy
  1753. var separatorCopy = new RegExp(separator.source, flags + 'g');
  1754. var match, lastIndex, lastLength;
  1755. while (match = functionCall(regexpExec, separatorCopy, string)) {
  1756. lastIndex = separatorCopy.lastIndex;
  1757. if (lastIndex > lastLastIndex) {
  1758. push(output, stringSlice(string, lastLastIndex, match.index));
  1759. if (match.length > 1 && match.index < string.length) functionApply($push, output, arraySliceSimple(match, 1));
  1760. lastLength = match[0].length;
  1761. lastLastIndex = lastIndex;
  1762. if (output.length >= lim) break;
  1763. }
  1764. if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
  1765. }
  1766. if (lastLastIndex === string.length) {
  1767. if (lastLength || !exec(separatorCopy, '')) push(output, '');
  1768. } else push(output, stringSlice(string, lastLastIndex));
  1769. return output.length > lim ? arraySliceSimple(output, 0, lim) : output;
  1770. };
  1771. // Chakra, V8
  1772. } else if ('0'.split(undefined, 0).length) {
  1773. internalSplit = function (separator, limit) {
  1774. return separator === undefined && limit === 0 ? [] : functionCall(nativeSplit, this, separator, limit);
  1775. };
  1776. } else internalSplit = nativeSplit;
  1777. return [
  1778. // `String.prototype.split` method
  1779. // https://tc39.es/ecma262/#sec-string.prototype.split
  1780. function split(separator, limit) {
  1781. var O = requireObjectCoercible(this);
  1782. var splitter = separator == undefined ? undefined : getMethod(separator, SPLIT);
  1783. return splitter
  1784. ? functionCall(splitter, separator, O, limit)
  1785. : functionCall(internalSplit, toString_1(O), separator, limit);
  1786. },
  1787. // `RegExp.prototype[@@split]` method
  1788. // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
  1789. //
  1790. // NOTE: This cannot be properly polyfilled in engines that don't support
  1791. // the 'y' flag.
  1792. function (string, limit) {
  1793. var rx = anObject(this);
  1794. var S = toString_1(string);
  1795. var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
  1796. if (res.done) return res.value;
  1797. var C = speciesConstructor(rx, RegExp);
  1798. var unicodeMatching = rx.unicode;
  1799. var flags = (rx.ignoreCase ? 'i' : '') +
  1800. (rx.multiline ? 'm' : '') +
  1801. (rx.unicode ? 'u' : '') +
  1802. (UNSUPPORTED_Y ? 'g' : 'y');
  1803. // ^(? + rx + ) is needed, in combination with some S slicing, to
  1804. // simulate the 'y' flag.
  1805. var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
  1806. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  1807. if (lim === 0) return [];
  1808. if (S.length === 0) return regexpExecAbstract(splitter, S) === null ? [S] : [];
  1809. var p = 0;
  1810. var q = 0;
  1811. var A = [];
  1812. while (q < S.length) {
  1813. splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
  1814. var z = regexpExecAbstract(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S);
  1815. var e;
  1816. if (
  1817. z === null ||
  1818. (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p
  1819. ) {
  1820. q = advanceStringIndex(S, q, unicodeMatching);
  1821. } else {
  1822. push(A, stringSlice(S, p, q));
  1823. if (A.length === lim) return A;
  1824. for (var i = 1; i <= z.length - 1; i++) {
  1825. push(A, z[i]);
  1826. if (A.length === lim) return A;
  1827. }
  1828. q = p = e;
  1829. }
  1830. }
  1831. push(A, stringSlice(S, p));
  1832. return A;
  1833. }
  1834. ];
  1835. }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
  1836. var $includes = arrayIncludes.includes;
  1837. // FF99+ bug
  1838. var BROKEN_ON_SPARSE = fails(function () {
  1839. return !Array(1).includes();
  1840. });
  1841. // `Array.prototype.includes` method
  1842. // https://tc39.es/ecma262/#sec-array.prototype.includes
  1843. _export({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
  1844. includes: function includes(el /* , fromIndex = 0 */) {
  1845. return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  1846. }
  1847. });
  1848. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1849. addToUnscopables('includes');
  1850. // iterable DOM collections
  1851. // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
  1852. var domIterables = {
  1853. CSSRuleList: 0,
  1854. CSSStyleDeclaration: 0,
  1855. CSSValueList: 0,
  1856. ClientRectList: 0,
  1857. DOMRectList: 0,
  1858. DOMStringList: 0,
  1859. DOMTokenList: 1,
  1860. DataTransferItemList: 0,
  1861. FileList: 0,
  1862. HTMLAllCollection: 0,
  1863. HTMLCollection: 0,
  1864. HTMLFormElement: 0,
  1865. HTMLSelectElement: 0,
  1866. MediaList: 0,
  1867. MimeTypeArray: 0,
  1868. NamedNodeMap: 0,
  1869. NodeList: 1,
  1870. PaintRequestList: 0,
  1871. Plugin: 0,
  1872. PluginArray: 0,
  1873. SVGLengthList: 0,
  1874. SVGNumberList: 0,
  1875. SVGPathSegList: 0,
  1876. SVGPointList: 0,
  1877. SVGStringList: 0,
  1878. SVGTransformList: 0,
  1879. SourceBufferList: 0,
  1880. StyleSheetList: 0,
  1881. TextTrackCueList: 0,
  1882. TextTrackList: 0,
  1883. TouchList: 0
  1884. };
  1885. // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
  1886. var classList = documentCreateElement('span').classList;
  1887. var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype;
  1888. var domTokenListPrototype = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype;
  1889. var $forEach = arrayIteration.forEach;
  1890. var STRICT_METHOD$2 = arrayMethodIsStrict('forEach');
  1891. // `Array.prototype.forEach` method implementation
  1892. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  1893. var arrayForEach = !STRICT_METHOD$2 ? function forEach(callbackfn /* , thisArg */) {
  1894. return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1895. // eslint-disable-next-line es-x/no-array-prototype-foreach -- safe
  1896. } : [].forEach;
  1897. var handlePrototype = function (CollectionPrototype) {
  1898. // some Chrome versions have non-configurable methods on DOMTokenList
  1899. if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
  1900. createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
  1901. } catch (error) {
  1902. CollectionPrototype.forEach = arrayForEach;
  1903. }
  1904. };
  1905. for (var COLLECTION_NAME in domIterables) {
  1906. if (domIterables[COLLECTION_NAME]) {
  1907. handlePrototype(global_1[COLLECTION_NAME] && global_1[COLLECTION_NAME].prototype);
  1908. }
  1909. }
  1910. handlePrototype(domTokenListPrototype);
  1911. var FAILS_ON_PRIMITIVES = fails(function () { objectKeys(1); });
  1912. // `Object.keys` method
  1913. // https://tc39.es/ecma262/#sec-object.keys
  1914. _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
  1915. keys: function keys(it) {
  1916. return objectKeys(toObject(it));
  1917. }
  1918. });
  1919. var un$Join = functionUncurryThis([].join);
  1920. var ES3_STRINGS = indexedObject != Object;
  1921. var STRICT_METHOD$1 = arrayMethodIsStrict('join', ',');
  1922. // `Array.prototype.join` method
  1923. // https://tc39.es/ecma262/#sec-array.prototype.join
  1924. _export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD$1 }, {
  1925. join: function join(separator) {
  1926. return un$Join(toIndexedObject(this), separator === undefined ? ',' : separator);
  1927. }
  1928. });
  1929. /* eslint-disable es-x/no-array-prototype-indexof -- required for testing */
  1930. var $IndexOf = arrayIncludes.indexOf;
  1931. var un$IndexOf = functionUncurryThis([].indexOf);
  1932. var NEGATIVE_ZERO = !!un$IndexOf && 1 / un$IndexOf([1], 1, -0) < 0;
  1933. var STRICT_METHOD = arrayMethodIsStrict('indexOf');
  1934. // `Array.prototype.indexOf` method
  1935. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  1936. _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
  1937. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  1938. var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
  1939. return NEGATIVE_ZERO
  1940. // convert -0 to +0
  1941. ? un$IndexOf(this, searchElement, fromIndex) || 0
  1942. : $IndexOf(this, searchElement, fromIndex);
  1943. }
  1944. });
  1945. /* eslint-disable no-use-before-define */
  1946. var Utils = $__default["default"].fn.bootstrapTable.utils;
  1947. var searchControls = 'select, input:not([type="checkbox"]):not([type="radio"])';
  1948. function getInputClass(that) {
  1949. var isSelect = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  1950. var formControlClass = isSelect ? that.constants.classes.select : that.constants.classes.input;
  1951. return that.options.iconSize ? Utils.sprintf('%s-%s', formControlClass, that.options.iconSize) : formControlClass;
  1952. }
  1953. function getOptionsFromSelectControl(selectControl) {
  1954. return selectControl[0].options;
  1955. }
  1956. function getControlContainer(that) {
  1957. if (that.options.filterControlContainer) {
  1958. return $__default["default"]("".concat(that.options.filterControlContainer));
  1959. }
  1960. if (that.options.height && that._initialized) {
  1961. return $__default["default"]('.fixed-table-header table thead');
  1962. }
  1963. return that.$header;
  1964. }
  1965. function isKeyAllowed(keyCode) {
  1966. return $__default["default"].inArray(keyCode, [37, 38, 39, 40]) > -1;
  1967. }
  1968. function getSearchControls(that) {
  1969. return getControlContainer(that).find(searchControls);
  1970. }
  1971. function hideUnusedSelectOptions(selectControl, uniqueValues) {
  1972. var options = getOptionsFromSelectControl(selectControl);
  1973. for (var i = 0; i < options.length; i++) {
  1974. if (options[i].value !== '') {
  1975. if (!uniqueValues.hasOwnProperty(options[i].value)) {
  1976. selectControl.find(Utils.sprintf('option[value=\'%s\']', options[i].value)).hide();
  1977. } else {
  1978. selectControl.find(Utils.sprintf('option[value=\'%s\']', options[i].value)).show();
  1979. }
  1980. }
  1981. }
  1982. }
  1983. function existOptionInSelectControl(selectControl, value) {
  1984. var options = getOptionsFromSelectControl(selectControl);
  1985. for (var i = 0; i < options.length; i++) {
  1986. if (options[i].value === Utils.unescapeHTML(value)) {
  1987. // The value is not valid to add
  1988. return true;
  1989. }
  1990. } // If we get here, the value is valid to add
  1991. return false;
  1992. }
  1993. function addOptionToSelectControl(selectControl, _value, text, selected, shouldCompareText) {
  1994. var value = _value === undefined || _value === null ? '' : _value.toString().trim();
  1995. value = Utils.removeHTML(value);
  1996. text = Utils.removeHTML(text);
  1997. if (existOptionInSelectControl(selectControl, value)) {
  1998. return;
  1999. }
  2000. var isSelected = shouldCompareText ? value === selected || text === selected : value === selected;
  2001. var option = new Option(text, value, false, isSelected);
  2002. selectControl.get(0).add(option);
  2003. }
  2004. function sortSelectControl(selectControl, orderBy) {
  2005. var $selectControl = selectControl.get(0);
  2006. if (orderBy === 'server') {
  2007. return;
  2008. }
  2009. var tmpAry = new Array();
  2010. for (var i = 0; i < $selectControl.options.length; i++) {
  2011. tmpAry[i] = new Array();
  2012. tmpAry[i][0] = $selectControl.options[i].text;
  2013. tmpAry[i][1] = $selectControl.options[i].value;
  2014. tmpAry[i][2] = $selectControl.options[i].selected;
  2015. }
  2016. tmpAry.sort(function (a, b) {
  2017. return Utils.sort(a[0], b[0], orderBy === 'desc' ? -1 : 1);
  2018. });
  2019. while ($selectControl.options.length > 0) {
  2020. $selectControl.options[0] = null;
  2021. }
  2022. for (var _i = 0; _i < tmpAry.length; _i++) {
  2023. var op = new Option(tmpAry[_i][0], tmpAry[_i][1], false, tmpAry[_i][2]);
  2024. $selectControl.add(op);
  2025. }
  2026. }
  2027. function fixHeaderCSS(_ref) {
  2028. var $tableHeader = _ref.$tableHeader;
  2029. $tableHeader.css('height', $tableHeader.find('table').outerHeight(true));
  2030. }
  2031. function getElementClass($element) {
  2032. return $element.attr('class').replace('form-control', '').replace('focus-temp', '').replace('search-input', '').trim();
  2033. }
  2034. function getCursorPosition(el) {
  2035. if ($__default["default"](el).is('input[type=search]')) {
  2036. var pos = 0;
  2037. if ('selectionStart' in el) {
  2038. pos = el.selectionStart;
  2039. } else if ('selection' in document) {
  2040. el.focus();
  2041. var Sel = document.selection.createRange();
  2042. var SelLength = document.selection.createRange().text.length;
  2043. Sel.moveStart('character', -el.value.length);
  2044. pos = Sel.text.length - SelLength;
  2045. }
  2046. return pos;
  2047. }
  2048. return -1;
  2049. }
  2050. function cacheValues(that) {
  2051. var searchControls = getSearchControls(that);
  2052. that._valuesFilterControl = [];
  2053. searchControls.each(function () {
  2054. var $field = $__default["default"](this);
  2055. var fieldClass = getElementClass($field);
  2056. if (that.options.height && !that.options.filterControlContainer) {
  2057. $field = $__default["default"](".fixed-table-header .".concat(fieldClass));
  2058. } else if (that.options.filterControlContainer) {
  2059. $field = $__default["default"]("".concat(that.options.filterControlContainer, " .").concat(fieldClass));
  2060. } else {
  2061. $field = $__default["default"](".".concat(fieldClass));
  2062. }
  2063. that._valuesFilterControl.push({
  2064. field: $field.closest('[data-field]').data('field'),
  2065. value: $field.val(),
  2066. position: getCursorPosition($field.get(0)),
  2067. hasFocus: $field.is(':focus')
  2068. });
  2069. });
  2070. }
  2071. function setCaretPosition(elem, caretPos) {
  2072. try {
  2073. if (elem) {
  2074. if (elem.createTextRange) {
  2075. var range = elem.createTextRange();
  2076. range.move('character', caretPos);
  2077. range.select();
  2078. } else {
  2079. elem.setSelectionRange(caretPos, caretPos);
  2080. }
  2081. }
  2082. } catch (ex) {// ignored
  2083. }
  2084. }
  2085. function setValues(that) {
  2086. var field = null;
  2087. var result = [];
  2088. var searchControls = getSearchControls(that);
  2089. if (that._valuesFilterControl.length > 0) {
  2090. // Callback to apply after settings fields values
  2091. var callbacks = [];
  2092. searchControls.each(function (i, el) {
  2093. var $this = $__default["default"](el);
  2094. field = $this.closest('[data-field]').data('field');
  2095. result = that._valuesFilterControl.filter(function (valueObj) {
  2096. return valueObj.field === field;
  2097. });
  2098. if (result.length > 0) {
  2099. if (result[0].hasFocus || result[0].value) {
  2100. var fieldToFocusCallback = function (element, cacheElementInfo) {
  2101. // Closure here to capture the field information
  2102. var closedCallback = function closedCallback() {
  2103. if (cacheElementInfo.hasFocus) {
  2104. element.focus();
  2105. }
  2106. if (Array.isArray(cacheElementInfo.value)) {
  2107. var $element = $__default["default"](element);
  2108. $__default["default"].each(cacheElementInfo.value, function (i, e) {
  2109. $element.find(Utils.sprintf('option[value=\'%s\']', e)).prop('selected', true);
  2110. });
  2111. } else {
  2112. element.value = cacheElementInfo.value;
  2113. }
  2114. setCaretPosition(element, cacheElementInfo.position);
  2115. };
  2116. return closedCallback;
  2117. }($this.get(0), result[0]);
  2118. callbacks.push(fieldToFocusCallback);
  2119. }
  2120. }
  2121. }); // Callback call.
  2122. if (callbacks.length > 0) {
  2123. callbacks.forEach(function (callback) {
  2124. return callback();
  2125. });
  2126. }
  2127. }
  2128. }
  2129. function collectBootstrapTableFilterCookies() {
  2130. var cookies = [];
  2131. var foundCookies = document.cookie.match(/bs\.table\.(filterControl|searchText)/g);
  2132. var foundLocalStorage = localStorage;
  2133. if (foundCookies) {
  2134. $__default["default"].each(foundCookies, function (i, _cookie) {
  2135. var cookie = _cookie;
  2136. if (/./.test(cookie)) {
  2137. cookie = cookie.split('.').pop();
  2138. }
  2139. if ($__default["default"].inArray(cookie, cookies) === -1) {
  2140. cookies.push(cookie);
  2141. }
  2142. });
  2143. }
  2144. if (foundLocalStorage) {
  2145. for (var i = 0; i < foundLocalStorage.length; i++) {
  2146. var cookie = foundLocalStorage.key(i);
  2147. if (/./.test(cookie)) {
  2148. cookie = cookie.split('.').pop();
  2149. }
  2150. if (!cookies.includes(cookie)) {
  2151. cookies.push(cookie);
  2152. }
  2153. }
  2154. }
  2155. return cookies;
  2156. }
  2157. function escapeID(id) {
  2158. // eslint-disable-next-line no-useless-escape
  2159. return String(id).replace(/([:.\[\],])/g, '\\$1');
  2160. }
  2161. function isColumnSearchableViaSelect(_ref2) {
  2162. var filterControl = _ref2.filterControl,
  2163. searchable = _ref2.searchable;
  2164. return filterControl && filterControl.toLowerCase() === 'select' && searchable;
  2165. }
  2166. function isFilterDataNotGiven(_ref3) {
  2167. var filterData = _ref3.filterData;
  2168. return filterData === undefined || filterData.toLowerCase() === 'column';
  2169. }
  2170. function hasSelectControlElement(selectControl) {
  2171. return selectControl && selectControl.length > 0;
  2172. }
  2173. function initFilterSelectControls(that) {
  2174. var data = that.options.data;
  2175. $__default["default"].each(that.header.fields, function (j, field) {
  2176. var column = that.columns[that.fieldsColumnsIndex[field]];
  2177. var selectControl = getControlContainer(that).find("select.bootstrap-table-filter-control-".concat(escapeID(column.field)));
  2178. if (isColumnSearchableViaSelect(column) && isFilterDataNotGiven(column) && hasSelectControlElement(selectControl)) {
  2179. if (!selectControl[0].multiple && selectControl.get(selectControl.length - 1).options.length === 0) {
  2180. // Added the default option, must use a non-breaking space(&nbsp;) to pass the W3C validator
  2181. addOptionToSelectControl(selectControl, '', column.filterControlPlaceholder || ' ', column.filterDefault);
  2182. }
  2183. var uniqueValues = {};
  2184. for (var i = 0; i < data.length; i++) {
  2185. // Added a new value
  2186. var fieldValue = Utils.getItemField(data[i], field, false);
  2187. var formatter = that.options.editable && column.editable ? column._formatter : that.header.formatters[j];
  2188. var formattedValue = Utils.calculateObjectValue(that.header, formatter, [fieldValue, data[i], i], fieldValue);
  2189. if (!fieldValue) {
  2190. fieldValue = formattedValue;
  2191. column._forceFormatter = true;
  2192. }
  2193. if (column.filterDataCollector) {
  2194. formattedValue = Utils.calculateObjectValue(that.header, column.filterDataCollector, [fieldValue, data[i], formattedValue], formattedValue);
  2195. }
  2196. if (column.searchFormatter) {
  2197. fieldValue = formattedValue;
  2198. }
  2199. uniqueValues[formattedValue] = fieldValue;
  2200. if (_typeof(formattedValue) === 'object' && formattedValue !== null) {
  2201. formattedValue.forEach(function (value) {
  2202. addOptionToSelectControl(selectControl, value, value, column.filterDefault);
  2203. });
  2204. continue;
  2205. }
  2206. } // eslint-disable-next-line guard-for-in
  2207. for (var key in uniqueValues) {
  2208. addOptionToSelectControl(selectControl, uniqueValues[key], key, column.filterDefault);
  2209. }
  2210. }
  2211. });
  2212. }
  2213. function getFilterDataMethod(objFilterDataMethod, searchTerm) {
  2214. var keys = Object.keys(objFilterDataMethod);
  2215. for (var i = 0; i < keys.length; i++) {
  2216. if (keys[i] === searchTerm) {
  2217. return objFilterDataMethod[searchTerm];
  2218. }
  2219. }
  2220. return null;
  2221. }
  2222. function createControls(that, header) {
  2223. var addedFilterControl = false;
  2224. var html;
  2225. $__default["default"].each(that.columns, function (_, column) {
  2226. html = [];
  2227. if (!column.visible) {
  2228. return;
  2229. }
  2230. if (!column.filterControl && !that.options.filterControlContainer) {
  2231. html.push('<div class="no-filter-control"></div>');
  2232. } else if (that.options.filterControlContainer) {
  2233. // Use a filter control container instead of th
  2234. var $filterControls = $__default["default"](".bootstrap-table-filter-control-".concat(column.field));
  2235. $__default["default"].each($filterControls, function (_, filterControl) {
  2236. var $filterControl = $__default["default"](filterControl);
  2237. if (!$filterControl.is('[type=radio]')) {
  2238. var placeholder = column.filterControlPlaceholder || '';
  2239. $filterControl.attr('placeholder', placeholder).val(column.filterDefault);
  2240. }
  2241. $filterControl.attr('data-field', column.field);
  2242. });
  2243. addedFilterControl = true;
  2244. } else {
  2245. // Create the control based on the html defined in the filterTemplate array.
  2246. var nameControl = column.filterControl.toLowerCase();
  2247. html.push('<div class="filter-control">');
  2248. addedFilterControl = true;
  2249. if (column.searchable && that.options.filterTemplate[nameControl]) {
  2250. html.push(that.options.filterTemplate[nameControl](that, column, column.filterControlPlaceholder ? column.filterControlPlaceholder : '', column.filterDefault));
  2251. }
  2252. } // Filtering by default when it is set.
  2253. if (column.filterControl && '' !== column.filterDefault && 'undefined' !== typeof column.filterDefault) {
  2254. if ($__default["default"].isEmptyObject(that.filterColumnsPartial)) {
  2255. that.filterColumnsPartial = {};
  2256. }
  2257. that.filterColumnsPartial[column.field] = column.filterDefault;
  2258. }
  2259. $__default["default"].each(header.find('th'), function (_, th) {
  2260. var $th = $__default["default"](th);
  2261. if ($th.data('field') === column.field) {
  2262. $th.find('.filter-control').remove();
  2263. $th.find('.fht-cell').html(html.join(''));
  2264. return false;
  2265. }
  2266. });
  2267. if (column.filterData && column.filterData.toLowerCase() !== 'column') {
  2268. var filterDataType = getFilterDataMethod(filterDataMethods, column.filterData.substring(0, column.filterData.indexOf(':')));
  2269. var filterDataSource;
  2270. var selectControl;
  2271. if (filterDataType) {
  2272. filterDataSource = column.filterData.substring(column.filterData.indexOf(':') + 1, column.filterData.length);
  2273. selectControl = header.find(".bootstrap-table-filter-control-".concat(escapeID(column.field)));
  2274. addOptionToSelectControl(selectControl, '', column.filterControlPlaceholder, column.filterDefault, true);
  2275. filterDataType(that, filterDataSource, selectControl, that.options.filterOrderBy, column.filterDefault);
  2276. } else {
  2277. throw new SyntaxError('Error. You should use any of these allowed filter data methods: var, obj, json, url, func.' + ' Use like this: var: {key: "value"}');
  2278. }
  2279. }
  2280. });
  2281. if (addedFilterControl) {
  2282. header.off('keyup', 'input').on('keyup', 'input', function (_ref4, obj) {
  2283. var currentTarget = _ref4.currentTarget,
  2284. keyCode = _ref4.keyCode;
  2285. keyCode = obj ? obj.keyCode : keyCode;
  2286. if (that.options.searchOnEnterKey && keyCode !== 13) {
  2287. return;
  2288. }
  2289. if (isKeyAllowed(keyCode)) {
  2290. return;
  2291. }
  2292. var $currentTarget = $__default["default"](currentTarget);
  2293. if ($currentTarget.is(':checkbox') || $currentTarget.is(':radio')) {
  2294. return;
  2295. }
  2296. clearTimeout(currentTarget.timeoutId || 0);
  2297. currentTarget.timeoutId = setTimeout(function () {
  2298. that.onColumnSearch({
  2299. currentTarget: currentTarget,
  2300. keyCode: keyCode
  2301. });
  2302. }, that.options.searchTimeOut);
  2303. });
  2304. header.off('change', 'select', '.fc-multipleselect').on('change', 'select', '.fc-multipleselect', function (_ref5) {
  2305. var currentTarget = _ref5.currentTarget,
  2306. keyCode = _ref5.keyCode;
  2307. var $selectControl = $__default["default"](currentTarget);
  2308. var value = $selectControl.val();
  2309. if (Array.isArray(value)) {
  2310. for (var i = 0; i < value.length; i++) {
  2311. if (value[i] && value[i].length > 0 && value[i].trim()) {
  2312. $selectControl.find("option[value=\"".concat(value[i], "\"]")).attr('selected', true);
  2313. }
  2314. }
  2315. } else if (value && value.length > 0 && value.trim()) {
  2316. $selectControl.find('option[selected]').removeAttr('selected');
  2317. $selectControl.find("option[value=\"".concat(value, "\"]")).attr('selected', true);
  2318. } else {
  2319. $selectControl.find('option[selected]').removeAttr('selected');
  2320. }
  2321. clearTimeout(currentTarget.timeoutId || 0);
  2322. currentTarget.timeoutId = setTimeout(function () {
  2323. that.onColumnSearch({
  2324. currentTarget: currentTarget,
  2325. keyCode: keyCode
  2326. });
  2327. }, that.options.searchTimeOut);
  2328. });
  2329. header.off('mouseup', 'input:not([type=radio])').on('mouseup', 'input:not([type=radio])', function (_ref6) {
  2330. var currentTarget = _ref6.currentTarget,
  2331. keyCode = _ref6.keyCode;
  2332. var $input = $__default["default"](currentTarget);
  2333. var oldValue = $input.val();
  2334. if (oldValue === '') {
  2335. return;
  2336. }
  2337. setTimeout(function () {
  2338. var newValue = $input.val();
  2339. if (newValue === '') {
  2340. clearTimeout(currentTarget.timeoutId || 0);
  2341. currentTarget.timeoutId = setTimeout(function () {
  2342. that.onColumnSearch({
  2343. currentTarget: currentTarget,
  2344. keyCode: keyCode
  2345. });
  2346. }, that.options.searchTimeOut);
  2347. }
  2348. }, 1);
  2349. });
  2350. header.off('change', 'input[type=radio]').on('change', 'input[type=radio]', function (_ref7) {
  2351. var currentTarget = _ref7.currentTarget,
  2352. keyCode = _ref7.keyCode;
  2353. clearTimeout(currentTarget.timeoutId || 0);
  2354. currentTarget.timeoutId = setTimeout(function () {
  2355. that.onColumnSearch({
  2356. currentTarget: currentTarget,
  2357. keyCode: keyCode
  2358. });
  2359. }, that.options.searchTimeOut);
  2360. }); // See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date
  2361. if (header.find('.date-filter-control').length > 0) {
  2362. $__default["default"].each(that.columns, function (i, _ref8) {
  2363. var filterDefault = _ref8.filterDefault,
  2364. filterControl = _ref8.filterControl,
  2365. field = _ref8.field,
  2366. filterDatepickerOptions = _ref8.filterDatepickerOptions;
  2367. if (filterControl !== undefined && filterControl.toLowerCase() === 'datepicker') {
  2368. var $datepicker = header.find(".date-filter-control.bootstrap-table-filter-control-".concat(field));
  2369. if (filterDefault) {
  2370. $datepicker.value(filterDefault);
  2371. }
  2372. if (filterDatepickerOptions.min) {
  2373. $datepicker.attr('min', filterDatepickerOptions.min);
  2374. }
  2375. if (filterDatepickerOptions.max) {
  2376. $datepicker.attr('max', filterDatepickerOptions.max);
  2377. }
  2378. if (filterDatepickerOptions.step) {
  2379. $datepicker.attr('step', filterDatepickerOptions.step);
  2380. }
  2381. if (filterDatepickerOptions.pattern) {
  2382. $datepicker.attr('pattern', filterDatepickerOptions.pattern);
  2383. }
  2384. $datepicker.on('change', function (_ref9) {
  2385. var currentTarget = _ref9.currentTarget;
  2386. clearTimeout(currentTarget.timeoutId || 0);
  2387. currentTarget.timeoutId = setTimeout(function () {
  2388. that.onColumnSearch({
  2389. currentTarget: currentTarget
  2390. });
  2391. }, that.options.searchTimeOut);
  2392. });
  2393. }
  2394. });
  2395. }
  2396. if (that.options.sidePagination !== 'server') {
  2397. that.triggerSearch();
  2398. }
  2399. if (!that.options.filterControlVisible) {
  2400. header.find('.filter-control, .no-filter-control').hide();
  2401. }
  2402. } else {
  2403. header.find('.filter-control, .no-filter-control').hide();
  2404. }
  2405. that.trigger('created-controls');
  2406. }
  2407. function getDirectionOfSelectOptions(_alignment) {
  2408. var alignment = _alignment === undefined ? 'left' : _alignment.toLowerCase();
  2409. switch (alignment) {
  2410. case 'left':
  2411. return 'ltr';
  2412. case 'right':
  2413. return 'rtl';
  2414. case 'auto':
  2415. return 'auto';
  2416. default:
  2417. return 'ltr';
  2418. }
  2419. }
  2420. function syncHeaders(that) {
  2421. if (!that.options.height) {
  2422. return;
  2423. }
  2424. var fixedHeader = $__default["default"]('.fixed-table-header table thead');
  2425. if (fixedHeader.length === 0) {
  2426. return;
  2427. }
  2428. that.$header.children().find('th[data-field]').each(function (_, element) {
  2429. if (element.classList[0] !== 'bs-checkbox') {
  2430. var $element = $__default["default"](element);
  2431. var $field = $element.data('field');
  2432. var $fixedField = $__default["default"]("th[data-field='".concat($field, "']")).not($element);
  2433. var input = $element.find('input');
  2434. var fixedInput = $fixedField.find('input');
  2435. if (input.length > 0 && fixedInput.length > 0) {
  2436. if (input.val() !== fixedInput.val()) {
  2437. input.val(fixedInput.val());
  2438. }
  2439. }
  2440. }
  2441. });
  2442. }
  2443. var filterDataMethods = {
  2444. func: function func(that, filterDataSource, selectControl, filterOrderBy, selected) {
  2445. var variableValues = window[filterDataSource].apply(); // eslint-disable-next-line guard-for-in
  2446. for (var key in variableValues) {
  2447. addOptionToSelectControl(selectControl, key, variableValues[key], selected);
  2448. }
  2449. if (that.options.sortSelectOptions) {
  2450. sortSelectControl(selectControl, filterOrderBy);
  2451. }
  2452. setValues(that);
  2453. },
  2454. obj: function obj(that, filterDataSource, selectControl, filterOrderBy, selected) {
  2455. var objectKeys = filterDataSource.split('.');
  2456. var variableName = objectKeys.shift();
  2457. var variableValues = window[variableName];
  2458. if (objectKeys.length > 0) {
  2459. objectKeys.forEach(function (key) {
  2460. variableValues = variableValues[key];
  2461. });
  2462. } // eslint-disable-next-line guard-for-in
  2463. for (var key in variableValues) {
  2464. addOptionToSelectControl(selectControl, key, variableValues[key], selected);
  2465. }
  2466. if (that.options.sortSelectOptions) {
  2467. sortSelectControl(selectControl, filterOrderBy);
  2468. }
  2469. setValues(that);
  2470. },
  2471. var: function _var(that, filterDataSource, selectControl, filterOrderBy, selected) {
  2472. var variableValues = window[filterDataSource];
  2473. var isArray = Array.isArray(variableValues);
  2474. for (var key in variableValues) {
  2475. if (isArray) {
  2476. addOptionToSelectControl(selectControl, variableValues[key], variableValues[key], selected, true);
  2477. } else {
  2478. addOptionToSelectControl(selectControl, key, variableValues[key], selected, true);
  2479. }
  2480. }
  2481. if (that.options.sortSelectOptions) {
  2482. sortSelectControl(selectControl, filterOrderBy);
  2483. }
  2484. setValues(that);
  2485. },
  2486. url: function url(that, filterDataSource, selectControl, filterOrderBy, selected) {
  2487. $__default["default"].ajax({
  2488. url: filterDataSource,
  2489. dataType: 'json',
  2490. success: function success(data) {
  2491. // eslint-disable-next-line guard-for-in
  2492. for (var key in data) {
  2493. addOptionToSelectControl(selectControl, key, data[key], selected);
  2494. }
  2495. if (that.options.sortSelectOptions) {
  2496. sortSelectControl(selectControl, filterOrderBy);
  2497. }
  2498. setValues(that);
  2499. }
  2500. });
  2501. },
  2502. json: function json(that, filterDataSource, selectControl, filterOrderBy, selected) {
  2503. var variableValues = JSON.parse(filterDataSource); // eslint-disable-next-line guard-for-in
  2504. for (var key in variableValues) {
  2505. addOptionToSelectControl(selectControl, key, variableValues[key], selected);
  2506. }
  2507. if (that.options.sortSelectOptions) {
  2508. sortSelectControl(selectControl, filterOrderBy);
  2509. }
  2510. setValues(that);
  2511. }
  2512. };
  2513. exports.addOptionToSelectControl = addOptionToSelectControl;
  2514. exports.cacheValues = cacheValues;
  2515. exports.collectBootstrapTableFilterCookies = collectBootstrapTableFilterCookies;
  2516. exports.createControls = createControls;
  2517. exports.escapeID = escapeID;
  2518. exports.existOptionInSelectControl = existOptionInSelectControl;
  2519. exports.fixHeaderCSS = fixHeaderCSS;
  2520. exports.getControlContainer = getControlContainer;
  2521. exports.getCursorPosition = getCursorPosition;
  2522. exports.getDirectionOfSelectOptions = getDirectionOfSelectOptions;
  2523. exports.getElementClass = getElementClass;
  2524. exports.getFilterDataMethod = getFilterDataMethod;
  2525. exports.getInputClass = getInputClass;
  2526. exports.getOptionsFromSelectControl = getOptionsFromSelectControl;
  2527. exports.getSearchControls = getSearchControls;
  2528. exports.hasSelectControlElement = hasSelectControlElement;
  2529. exports.hideUnusedSelectOptions = hideUnusedSelectOptions;
  2530. exports.initFilterSelectControls = initFilterSelectControls;
  2531. exports.isColumnSearchableViaSelect = isColumnSearchableViaSelect;
  2532. exports.isFilterDataNotGiven = isFilterDataNotGiven;
  2533. exports.isKeyAllowed = isKeyAllowed;
  2534. exports.setCaretPosition = setCaretPosition;
  2535. exports.setValues = setValues;
  2536. exports.sortSelectControl = sortSelectControl;
  2537. exports.syncHeaders = syncHeaders;
  2538. Object.defineProperty(exports, '__esModule', { value: true });
  2539. }));