bootstrap-table-cookie.js 104 KB

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