bootstrap-table-filter-control.js 163 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) :
  3. typeof define === 'function' && define.amd ? define(['jquery'], factory) :
  4. (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jQuery));
  5. })(this, (function ($) { 'use strict';
  6. function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
  7. var $__default = /*#__PURE__*/_interopDefaultLegacy($);
  8. function _typeof(obj) {
  9. "@babel/helpers - typeof";
  10. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  11. return typeof obj;
  12. } : function (obj) {
  13. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  14. }, _typeof(obj);
  15. }
  16. function _classCallCheck(instance, Constructor) {
  17. if (!(instance instanceof Constructor)) {
  18. throw new TypeError("Cannot call a class as a function");
  19. }
  20. }
  21. function _defineProperties(target, props) {
  22. for (var i = 0; i < props.length; i++) {
  23. var descriptor = props[i];
  24. descriptor.enumerable = descriptor.enumerable || false;
  25. descriptor.configurable = true;
  26. if ("value" in descriptor) descriptor.writable = true;
  27. Object.defineProperty(target, descriptor.key, descriptor);
  28. }
  29. }
  30. function _createClass(Constructor, protoProps, staticProps) {
  31. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  32. if (staticProps) _defineProperties(Constructor, staticProps);
  33. Object.defineProperty(Constructor, "prototype", {
  34. writable: false
  35. });
  36. return Constructor;
  37. }
  38. function _inherits(subClass, superClass) {
  39. if (typeof superClass !== "function" && superClass !== null) {
  40. throw new TypeError("Super expression must either be null or a function");
  41. }
  42. subClass.prototype = Object.create(superClass && superClass.prototype, {
  43. constructor: {
  44. value: subClass,
  45. writable: true,
  46. configurable: true
  47. }
  48. });
  49. Object.defineProperty(subClass, "prototype", {
  50. writable: false
  51. });
  52. if (superClass) _setPrototypeOf(subClass, superClass);
  53. }
  54. function _getPrototypeOf(o) {
  55. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  56. return o.__proto__ || Object.getPrototypeOf(o);
  57. };
  58. return _getPrototypeOf(o);
  59. }
  60. function _setPrototypeOf(o, p) {
  61. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  62. o.__proto__ = p;
  63. return o;
  64. };
  65. return _setPrototypeOf(o, p);
  66. }
  67. function _isNativeReflectConstruct() {
  68. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  69. if (Reflect.construct.sham) return false;
  70. if (typeof Proxy === "function") return true;
  71. try {
  72. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  73. return true;
  74. } catch (e) {
  75. return false;
  76. }
  77. }
  78. function _assertThisInitialized(self) {
  79. if (self === void 0) {
  80. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  81. }
  82. return self;
  83. }
  84. function _possibleConstructorReturn(self, call) {
  85. if (call && (typeof call === "object" || typeof call === "function")) {
  86. return call;
  87. } else if (call !== void 0) {
  88. throw new TypeError("Derived constructors may only return object or undefined");
  89. }
  90. return _assertThisInitialized(self);
  91. }
  92. function _createSuper(Derived) {
  93. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  94. return function _createSuperInternal() {
  95. var Super = _getPrototypeOf(Derived),
  96. result;
  97. if (hasNativeReflectConstruct) {
  98. var NewTarget = _getPrototypeOf(this).constructor;
  99. result = Reflect.construct(Super, arguments, NewTarget);
  100. } else {
  101. result = Super.apply(this, arguments);
  102. }
  103. return _possibleConstructorReturn(this, result);
  104. };
  105. }
  106. function _superPropBase(object, property) {
  107. while (!Object.prototype.hasOwnProperty.call(object, property)) {
  108. object = _getPrototypeOf(object);
  109. if (object === null) break;
  110. }
  111. return object;
  112. }
  113. function _get() {
  114. if (typeof Reflect !== "undefined" && Reflect.get) {
  115. _get = Reflect.get;
  116. } else {
  117. _get = function _get(target, property, receiver) {
  118. var base = _superPropBase(target, property);
  119. if (!base) return;
  120. var desc = Object.getOwnPropertyDescriptor(base, property);
  121. if (desc.get) {
  122. return desc.get.call(arguments.length < 3 ? target : receiver);
  123. }
  124. return desc.value;
  125. };
  126. }
  127. return _get.apply(this, arguments);
  128. }
  129. function _toConsumableArray(arr) {
  130. return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
  131. }
  132. function _arrayWithoutHoles(arr) {
  133. if (Array.isArray(arr)) return _arrayLikeToArray(arr);
  134. }
  135. function _iterableToArray(iter) {
  136. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  137. }
  138. function _unsupportedIterableToArray(o, minLen) {
  139. if (!o) return;
  140. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  141. var n = Object.prototype.toString.call(o).slice(8, -1);
  142. if (n === "Object" && o.constructor) n = o.constructor.name;
  143. if (n === "Map" || n === "Set") return Array.from(o);
  144. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  145. }
  146. function _arrayLikeToArray(arr, len) {
  147. if (len == null || len > arr.length) len = arr.length;
  148. for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
  149. return arr2;
  150. }
  151. function _nonIterableSpread() {
  152. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  153. }
  154. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  155. function createCommonjsModule(fn, module) {
  156. return module = { exports: {} }, fn(module, module.exports), module.exports;
  157. }
  158. var check = function (it) {
  159. return it && it.Math == Math && it;
  160. };
  161. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  162. var global_1 =
  163. // eslint-disable-next-line es-x/no-global-this -- safe
  164. check(typeof globalThis == 'object' && globalThis) ||
  165. check(typeof window == 'object' && window) ||
  166. // eslint-disable-next-line no-restricted-globals -- safe
  167. check(typeof self == 'object' && self) ||
  168. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  169. // eslint-disable-next-line no-new-func -- fallback
  170. (function () { return this; })() || Function('return this')();
  171. var fails = function (exec) {
  172. try {
  173. return !!exec();
  174. } catch (error) {
  175. return true;
  176. }
  177. };
  178. // Detect IE8's incomplete defineProperty implementation
  179. var descriptors = !fails(function () {
  180. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  181. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  182. });
  183. var functionBindNative = !fails(function () {
  184. // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
  185. var test = (function () { /* empty */ }).bind();
  186. // eslint-disable-next-line no-prototype-builtins -- safe
  187. return typeof test != 'function' || test.hasOwnProperty('prototype');
  188. });
  189. var call$2 = Function.prototype.call;
  190. var functionCall = functionBindNative ? call$2.bind(call$2) : function () {
  191. return call$2.apply(call$2, arguments);
  192. };
  193. var $propertyIsEnumerable$1 = {}.propertyIsEnumerable;
  194. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  195. var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
  196. // Nashorn ~ JDK8 bug
  197. var NASHORN_BUG = getOwnPropertyDescriptor$2 && !$propertyIsEnumerable$1.call({ 1: 2 }, 1);
  198. // `Object.prototype.propertyIsEnumerable` method implementation
  199. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  200. var f$6 = NASHORN_BUG ? function propertyIsEnumerable(V) {
  201. var descriptor = getOwnPropertyDescriptor$2(this, V);
  202. return !!descriptor && descriptor.enumerable;
  203. } : $propertyIsEnumerable$1;
  204. var objectPropertyIsEnumerable = {
  205. f: f$6
  206. };
  207. var createPropertyDescriptor = function (bitmap, value) {
  208. return {
  209. enumerable: !(bitmap & 1),
  210. configurable: !(bitmap & 2),
  211. writable: !(bitmap & 4),
  212. value: value
  213. };
  214. };
  215. var FunctionPrototype$2 = Function.prototype;
  216. var bind$2 = FunctionPrototype$2.bind;
  217. var call$1 = FunctionPrototype$2.call;
  218. var uncurryThis = functionBindNative && bind$2.bind(call$1, call$1);
  219. var functionUncurryThis = functionBindNative ? function (fn) {
  220. return fn && uncurryThis(fn);
  221. } : function (fn) {
  222. return fn && function () {
  223. return call$1.apply(fn, arguments);
  224. };
  225. };
  226. var toString$1 = functionUncurryThis({}.toString);
  227. var stringSlice$5 = functionUncurryThis(''.slice);
  228. var classofRaw = function (it) {
  229. return stringSlice$5(toString$1(it), 8, -1);
  230. };
  231. var Object$4 = global_1.Object;
  232. var split = functionUncurryThis(''.split);
  233. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  234. var indexedObject = fails(function () {
  235. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  236. // eslint-disable-next-line no-prototype-builtins -- safe
  237. return !Object$4('z').propertyIsEnumerable(0);
  238. }) ? function (it) {
  239. return classofRaw(it) == 'String' ? split(it, '') : Object$4(it);
  240. } : Object$4;
  241. var TypeError$h = global_1.TypeError;
  242. // `RequireObjectCoercible` abstract operation
  243. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  244. var requireObjectCoercible = function (it) {
  245. if (it == undefined) throw TypeError$h("Can't call method on " + it);
  246. return it;
  247. };
  248. // toObject with fallback for non-array-like ES3 strings
  249. var toIndexedObject = function (it) {
  250. return indexedObject(requireObjectCoercible(it));
  251. };
  252. // `IsCallable` abstract operation
  253. // https://tc39.es/ecma262/#sec-iscallable
  254. var isCallable = function (argument) {
  255. return typeof argument == 'function';
  256. };
  257. var isObject = function (it) {
  258. return typeof it == 'object' ? it !== null : isCallable(it);
  259. };
  260. var aFunction = function (argument) {
  261. return isCallable(argument) ? argument : undefined;
  262. };
  263. var getBuiltIn = function (namespace, method) {
  264. return arguments.length < 2 ? aFunction(global_1[namespace]) : global_1[namespace] && global_1[namespace][method];
  265. };
  266. var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
  267. var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
  268. var process$3 = global_1.process;
  269. var Deno$1 = global_1.Deno;
  270. var versions = process$3 && process$3.versions || Deno$1 && Deno$1.version;
  271. var v8 = versions && versions.v8;
  272. var match, version;
  273. if (v8) {
  274. match = v8.split('.');
  275. // in old Chrome, versions of V8 isn't V8 = Chrome / 10
  276. // but their correct versions are not interesting for us
  277. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  278. }
  279. // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
  280. // so check `userAgent` even if `.v8` exists, but 0
  281. if (!version && engineUserAgent) {
  282. match = engineUserAgent.match(/Edge\/(\d+)/);
  283. if (!match || match[1] >= 74) {
  284. match = engineUserAgent.match(/Chrome\/(\d+)/);
  285. if (match) version = +match[1];
  286. }
  287. }
  288. var engineV8Version = version;
  289. /* eslint-disable es-x/no-symbol -- required for testing */
  290. // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
  291. var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
  292. var symbol = Symbol();
  293. // Chrome 38 Symbol has incorrect toString conversion
  294. // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
  295. return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
  296. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  297. !Symbol.sham && engineV8Version && engineV8Version < 41;
  298. });
  299. /* eslint-disable es-x/no-symbol -- required for testing */
  300. var useSymbolAsUid = nativeSymbol
  301. && !Symbol.sham
  302. && typeof Symbol.iterator == 'symbol';
  303. var Object$3 = global_1.Object;
  304. var isSymbol = useSymbolAsUid ? function (it) {
  305. return typeof it == 'symbol';
  306. } : function (it) {
  307. var $Symbol = getBuiltIn('Symbol');
  308. return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, Object$3(it));
  309. };
  310. var String$5 = global_1.String;
  311. var tryToString = function (argument) {
  312. try {
  313. return String$5(argument);
  314. } catch (error) {
  315. return 'Object';
  316. }
  317. };
  318. var TypeError$g = global_1.TypeError;
  319. // `Assert: IsCallable(argument) is true`
  320. var aCallable = function (argument) {
  321. if (isCallable(argument)) return argument;
  322. throw TypeError$g(tryToString(argument) + ' is not a function');
  323. };
  324. // `GetMethod` abstract operation
  325. // https://tc39.es/ecma262/#sec-getmethod
  326. var getMethod = function (V, P) {
  327. var func = V[P];
  328. return func == null ? undefined : aCallable(func);
  329. };
  330. var TypeError$f = global_1.TypeError;
  331. // `OrdinaryToPrimitive` abstract operation
  332. // https://tc39.es/ecma262/#sec-ordinarytoprimitive
  333. var ordinaryToPrimitive = function (input, pref) {
  334. var fn, val;
  335. if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
  336. if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
  337. if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
  338. throw TypeError$f("Can't convert object to primitive value");
  339. };
  340. // eslint-disable-next-line es-x/no-object-defineproperty -- safe
  341. var defineProperty$2 = Object.defineProperty;
  342. var setGlobal = function (key, value) {
  343. try {
  344. defineProperty$2(global_1, key, { value: value, configurable: true, writable: true });
  345. } catch (error) {
  346. global_1[key] = value;
  347. } return value;
  348. };
  349. var SHARED = '__core-js_shared__';
  350. var store$1 = global_1[SHARED] || setGlobal(SHARED, {});
  351. var sharedStore = store$1;
  352. var shared = createCommonjsModule(function (module) {
  353. (module.exports = function (key, value) {
  354. return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
  355. })('versions', []).push({
  356. version: '3.22.4',
  357. mode: 'global',
  358. copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
  359. license: 'https://github.com/zloirock/core-js/blob/v3.22.4/LICENSE',
  360. source: 'https://github.com/zloirock/core-js'
  361. });
  362. });
  363. var Object$2 = global_1.Object;
  364. // `ToObject` abstract operation
  365. // https://tc39.es/ecma262/#sec-toobject
  366. var toObject = function (argument) {
  367. return Object$2(requireObjectCoercible(argument));
  368. };
  369. var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
  370. // `HasOwnProperty` abstract operation
  371. // https://tc39.es/ecma262/#sec-hasownproperty
  372. // eslint-disable-next-line es-x/no-object-hasown -- safe
  373. var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
  374. return hasOwnProperty(toObject(it), key);
  375. };
  376. var id = 0;
  377. var postfix = Math.random();
  378. var toString = functionUncurryThis(1.0.toString);
  379. var uid = function (key) {
  380. return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
  381. };
  382. var WellKnownSymbolsStore = shared('wks');
  383. var Symbol$2 = global_1.Symbol;
  384. var symbolFor = Symbol$2 && Symbol$2['for'];
  385. var createWellKnownSymbol = useSymbolAsUid ? Symbol$2 : Symbol$2 && Symbol$2.withoutSetter || uid;
  386. var wellKnownSymbol = function (name) {
  387. if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
  388. var description = 'Symbol.' + name;
  389. if (nativeSymbol && hasOwnProperty_1(Symbol$2, name)) {
  390. WellKnownSymbolsStore[name] = Symbol$2[name];
  391. } else if (useSymbolAsUid && symbolFor) {
  392. WellKnownSymbolsStore[name] = symbolFor(description);
  393. } else {
  394. WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
  395. }
  396. } return WellKnownSymbolsStore[name];
  397. };
  398. var TypeError$e = global_1.TypeError;
  399. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  400. // `ToPrimitive` abstract operation
  401. // https://tc39.es/ecma262/#sec-toprimitive
  402. var toPrimitive = function (input, pref) {
  403. if (!isObject(input) || isSymbol(input)) return input;
  404. var exoticToPrim = getMethod(input, TO_PRIMITIVE);
  405. var result;
  406. if (exoticToPrim) {
  407. if (pref === undefined) pref = 'default';
  408. result = functionCall(exoticToPrim, input, pref);
  409. if (!isObject(result) || isSymbol(result)) return result;
  410. throw TypeError$e("Can't convert object to primitive value");
  411. }
  412. if (pref === undefined) pref = 'number';
  413. return ordinaryToPrimitive(input, pref);
  414. };
  415. // `ToPropertyKey` abstract operation
  416. // https://tc39.es/ecma262/#sec-topropertykey
  417. var toPropertyKey = function (argument) {
  418. var key = toPrimitive(argument, 'string');
  419. return isSymbol(key) ? key : key + '';
  420. };
  421. var document$3 = global_1.document;
  422. // typeof document.createElement is 'object' in old IE
  423. var EXISTS$1 = isObject(document$3) && isObject(document$3.createElement);
  424. var documentCreateElement = function (it) {
  425. return EXISTS$1 ? document$3.createElement(it) : {};
  426. };
  427. // Thanks to IE8 for its funny defineProperty
  428. var ie8DomDefine = !descriptors && !fails(function () {
  429. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  430. return Object.defineProperty(documentCreateElement('div'), 'a', {
  431. get: function () { return 7; }
  432. }).a != 7;
  433. });
  434. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  435. var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  436. // `Object.getOwnPropertyDescriptor` method
  437. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  438. var f$5 = descriptors ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
  439. O = toIndexedObject(O);
  440. P = toPropertyKey(P);
  441. if (ie8DomDefine) try {
  442. return $getOwnPropertyDescriptor$1(O, P);
  443. } catch (error) { /* empty */ }
  444. if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
  445. };
  446. var objectGetOwnPropertyDescriptor = {
  447. f: f$5
  448. };
  449. // V8 ~ Chrome 36-
  450. // https://bugs.chromium.org/p/v8/issues/detail?id=3334
  451. var v8PrototypeDefineBug = descriptors && fails(function () {
  452. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  453. return Object.defineProperty(function () { /* empty */ }, 'prototype', {
  454. value: 42,
  455. writable: false
  456. }).prototype != 42;
  457. });
  458. var String$4 = global_1.String;
  459. var TypeError$d = global_1.TypeError;
  460. // `Assert: Type(argument) is Object`
  461. var anObject = function (argument) {
  462. if (isObject(argument)) return argument;
  463. throw TypeError$d(String$4(argument) + ' is not an object');
  464. };
  465. var TypeError$c = global_1.TypeError;
  466. // eslint-disable-next-line es-x/no-object-defineproperty -- safe
  467. var $defineProperty = Object.defineProperty;
  468. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  469. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  470. var ENUMERABLE = 'enumerable';
  471. var CONFIGURABLE$1 = 'configurable';
  472. var WRITABLE = 'writable';
  473. // `Object.defineProperty` method
  474. // https://tc39.es/ecma262/#sec-object.defineproperty
  475. var f$4 = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) {
  476. anObject(O);
  477. P = toPropertyKey(P);
  478. anObject(Attributes);
  479. if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  480. var current = $getOwnPropertyDescriptor(O, P);
  481. if (current && current[WRITABLE]) {
  482. O[P] = Attributes.value;
  483. Attributes = {
  484. configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
  485. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  486. writable: false
  487. };
  488. }
  489. } return $defineProperty(O, P, Attributes);
  490. } : $defineProperty : function defineProperty(O, P, Attributes) {
  491. anObject(O);
  492. P = toPropertyKey(P);
  493. anObject(Attributes);
  494. if (ie8DomDefine) try {
  495. return $defineProperty(O, P, Attributes);
  496. } catch (error) { /* empty */ }
  497. if ('get' in Attributes || 'set' in Attributes) throw TypeError$c('Accessors not supported');
  498. if ('value' in Attributes) O[P] = Attributes.value;
  499. return O;
  500. };
  501. var objectDefineProperty = {
  502. f: f$4
  503. };
  504. var createNonEnumerableProperty = descriptors ? function (object, key, value) {
  505. return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
  506. } : function (object, key, value) {
  507. object[key] = value;
  508. return object;
  509. };
  510. var FunctionPrototype$1 = Function.prototype;
  511. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  512. var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
  513. var EXISTS = hasOwnProperty_1(FunctionPrototype$1, 'name');
  514. // additional protection from minified / mangled / dropped function names
  515. var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
  516. var CONFIGURABLE = EXISTS && (!descriptors || (descriptors && getDescriptor(FunctionPrototype$1, 'name').configurable));
  517. var functionName = {
  518. EXISTS: EXISTS,
  519. PROPER: PROPER,
  520. CONFIGURABLE: CONFIGURABLE
  521. };
  522. var functionToString = functionUncurryThis(Function.toString);
  523. // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
  524. if (!isCallable(sharedStore.inspectSource)) {
  525. sharedStore.inspectSource = function (it) {
  526. return functionToString(it);
  527. };
  528. }
  529. var inspectSource = sharedStore.inspectSource;
  530. var WeakMap$1 = global_1.WeakMap;
  531. var nativeWeakMap = isCallable(WeakMap$1) && /native code/.test(inspectSource(WeakMap$1));
  532. var keys = shared('keys');
  533. var sharedKey = function (key) {
  534. return keys[key] || (keys[key] = uid(key));
  535. };
  536. var hiddenKeys$1 = {};
  537. var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
  538. var TypeError$b = global_1.TypeError;
  539. var WeakMap = global_1.WeakMap;
  540. var set$1, get, has;
  541. var enforce = function (it) {
  542. return has(it) ? get(it) : set$1(it, {});
  543. };
  544. var getterFor = function (TYPE) {
  545. return function (it) {
  546. var state;
  547. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  548. throw TypeError$b('Incompatible receiver, ' + TYPE + ' required');
  549. } return state;
  550. };
  551. };
  552. if (nativeWeakMap || sharedStore.state) {
  553. var store = sharedStore.state || (sharedStore.state = new WeakMap());
  554. var wmget = functionUncurryThis(store.get);
  555. var wmhas = functionUncurryThis(store.has);
  556. var wmset = functionUncurryThis(store.set);
  557. set$1 = function (it, metadata) {
  558. if (wmhas(store, it)) throw new TypeError$b(OBJECT_ALREADY_INITIALIZED);
  559. metadata.facade = it;
  560. wmset(store, it, metadata);
  561. return metadata;
  562. };
  563. get = function (it) {
  564. return wmget(store, it) || {};
  565. };
  566. has = function (it) {
  567. return wmhas(store, it);
  568. };
  569. } else {
  570. var STATE = sharedKey('state');
  571. hiddenKeys$1[STATE] = true;
  572. set$1 = function (it, metadata) {
  573. if (hasOwnProperty_1(it, STATE)) throw new TypeError$b(OBJECT_ALREADY_INITIALIZED);
  574. metadata.facade = it;
  575. createNonEnumerableProperty(it, STATE, metadata);
  576. return metadata;
  577. };
  578. get = function (it) {
  579. return hasOwnProperty_1(it, STATE) ? it[STATE] : {};
  580. };
  581. has = function (it) {
  582. return hasOwnProperty_1(it, STATE);
  583. };
  584. }
  585. var internalState = {
  586. set: set$1,
  587. get: get,
  588. has: has,
  589. enforce: enforce,
  590. getterFor: getterFor
  591. };
  592. var makeBuiltIn_1 = createCommonjsModule(function (module) {
  593. var defineProperty = objectDefineProperty.f;
  594. var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
  595. var enforceInternalState = internalState.enforce;
  596. var getInternalState = internalState.get;
  597. var CONFIGURABLE_LENGTH = !fails(function () {
  598. return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
  599. });
  600. var TEMPLATE = String(String).split('String');
  601. var makeBuiltIn = module.exports = function (value, name, options) {
  602. if (String(name).slice(0, 7) === 'Symbol(') {
  603. name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
  604. }
  605. if (options && options.getter) name = 'get ' + name;
  606. if (options && options.setter) name = 'set ' + name;
  607. if (!hasOwnProperty_1(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
  608. defineProperty(value, 'name', { value: name, configurable: true });
  609. }
  610. if (CONFIGURABLE_LENGTH && options && hasOwnProperty_1(options, 'arity') && value.length !== options.arity) {
  611. defineProperty(value, 'length', { value: options.arity });
  612. }
  613. var state = enforceInternalState(value);
  614. if (!hasOwnProperty_1(state, 'source')) {
  615. state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
  616. } return value;
  617. };
  618. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  619. // eslint-disable-next-line no-extend-native -- required
  620. Function.prototype.toString = makeBuiltIn(function toString() {
  621. return isCallable(this) && getInternalState(this).source || inspectSource(this);
  622. }, 'toString');
  623. });
  624. var defineBuiltIn = function (O, key, value, options) {
  625. var unsafe = options ? !!options.unsafe : false;
  626. var simple = options ? !!options.enumerable : false;
  627. var noTargetGet = options ? !!options.noTargetGet : false;
  628. var name = options && options.name !== undefined ? options.name : key;
  629. if (isCallable(value)) makeBuiltIn_1(value, name, options);
  630. if (O === global_1) {
  631. if (simple) O[key] = value;
  632. else setGlobal(key, value);
  633. return O;
  634. } else if (!unsafe) {
  635. delete O[key];
  636. } else if (!noTargetGet && O[key]) {
  637. simple = true;
  638. }
  639. if (simple) O[key] = value;
  640. else createNonEnumerableProperty(O, key, value);
  641. return O;
  642. };
  643. var ceil = Math.ceil;
  644. var floor$2 = Math.floor;
  645. // `ToIntegerOrInfinity` abstract operation
  646. // https://tc39.es/ecma262/#sec-tointegerorinfinity
  647. var toIntegerOrInfinity = function (argument) {
  648. var number = +argument;
  649. // eslint-disable-next-line no-self-compare -- safe
  650. return number !== number || number === 0 ? 0 : (number > 0 ? floor$2 : ceil)(number);
  651. };
  652. var max$2 = Math.max;
  653. var min$3 = Math.min;
  654. // Helper for a popular repeating case of the spec:
  655. // Let integer be ? ToInteger(index).
  656. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  657. var toAbsoluteIndex = function (index, length) {
  658. var integer = toIntegerOrInfinity(index);
  659. return integer < 0 ? max$2(integer + length, 0) : min$3(integer, length);
  660. };
  661. var min$2 = Math.min;
  662. // `ToLength` abstract operation
  663. // https://tc39.es/ecma262/#sec-tolength
  664. var toLength = function (argument) {
  665. return argument > 0 ? min$2(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  666. };
  667. // `LengthOfArrayLike` abstract operation
  668. // https://tc39.es/ecma262/#sec-lengthofarraylike
  669. var lengthOfArrayLike = function (obj) {
  670. return toLength(obj.length);
  671. };
  672. // `Array.prototype.{ indexOf, includes }` methods implementation
  673. var createMethod$4 = function (IS_INCLUDES) {
  674. return function ($this, el, fromIndex) {
  675. var O = toIndexedObject($this);
  676. var length = lengthOfArrayLike(O);
  677. var index = toAbsoluteIndex(fromIndex, length);
  678. var value;
  679. // Array#includes uses SameValueZero equality algorithm
  680. // eslint-disable-next-line no-self-compare -- NaN check
  681. if (IS_INCLUDES && el != el) while (length > index) {
  682. value = O[index++];
  683. // eslint-disable-next-line no-self-compare -- NaN check
  684. if (value != value) return true;
  685. // Array#indexOf ignores holes, Array#includes - not
  686. } else for (;length > index; index++) {
  687. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  688. } return !IS_INCLUDES && -1;
  689. };
  690. };
  691. var arrayIncludes = {
  692. // `Array.prototype.includes` method
  693. // https://tc39.es/ecma262/#sec-array.prototype.includes
  694. includes: createMethod$4(true),
  695. // `Array.prototype.indexOf` method
  696. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  697. indexOf: createMethod$4(false)
  698. };
  699. var indexOf$1 = arrayIncludes.indexOf;
  700. var push$5 = functionUncurryThis([].push);
  701. var objectKeysInternal = function (object, names) {
  702. var O = toIndexedObject(object);
  703. var i = 0;
  704. var result = [];
  705. var key;
  706. for (key in O) !hasOwnProperty_1(hiddenKeys$1, key) && hasOwnProperty_1(O, key) && push$5(result, key);
  707. // Don't enum bug & hidden keys
  708. while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) {
  709. ~indexOf$1(result, key) || push$5(result, key);
  710. }
  711. return result;
  712. };
  713. // IE8- don't enum bug keys
  714. var enumBugKeys = [
  715. 'constructor',
  716. 'hasOwnProperty',
  717. 'isPrototypeOf',
  718. 'propertyIsEnumerable',
  719. 'toLocaleString',
  720. 'toString',
  721. 'valueOf'
  722. ];
  723. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  724. // `Object.getOwnPropertyNames` method
  725. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  726. // eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
  727. var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  728. return objectKeysInternal(O, hiddenKeys);
  729. };
  730. var objectGetOwnPropertyNames = {
  731. f: f$3
  732. };
  733. // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
  734. var f$2 = Object.getOwnPropertySymbols;
  735. var objectGetOwnPropertySymbols = {
  736. f: f$2
  737. };
  738. var concat$2 = functionUncurryThis([].concat);
  739. // all object keys, includes non-enumerable and symbols
  740. var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  741. var keys = objectGetOwnPropertyNames.f(anObject(it));
  742. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  743. return getOwnPropertySymbols ? concat$2(keys, getOwnPropertySymbols(it)) : keys;
  744. };
  745. var copyConstructorProperties = function (target, source, exceptions) {
  746. var keys = ownKeys(source);
  747. var defineProperty = objectDefineProperty.f;
  748. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  749. for (var i = 0; i < keys.length; i++) {
  750. var key = keys[i];
  751. if (!hasOwnProperty_1(target, key) && !(exceptions && hasOwnProperty_1(exceptions, key))) {
  752. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  753. }
  754. }
  755. };
  756. var replacement = /#|\.prototype\./;
  757. var isForced = function (feature, detection) {
  758. var value = data[normalize(feature)];
  759. return value == POLYFILL ? true
  760. : value == NATIVE ? false
  761. : isCallable(detection) ? fails(detection)
  762. : !!detection;
  763. };
  764. var normalize = isForced.normalize = function (string) {
  765. return String(string).replace(replacement, '.').toLowerCase();
  766. };
  767. var data = isForced.data = {};
  768. var NATIVE = isForced.NATIVE = 'N';
  769. var POLYFILL = isForced.POLYFILL = 'P';
  770. var isForced_1 = isForced;
  771. var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
  772. /*
  773. options.target - name of the target object
  774. options.global - target is the global object
  775. options.stat - export as static methods of target
  776. options.proto - export as prototype methods of target
  777. options.real - real prototype method for the `pure` version
  778. options.forced - export even if the native feature is available
  779. options.bind - bind methods to the target, required for the `pure` version
  780. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  781. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  782. options.sham - add a flag to not completely full polyfills
  783. options.enumerable - export as enumerable property
  784. options.noTargetGet - prevent calling a getter on target
  785. options.name - the .name of the function if it does not match the key
  786. */
  787. var _export = function (options, source) {
  788. var TARGET = options.target;
  789. var GLOBAL = options.global;
  790. var STATIC = options.stat;
  791. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  792. if (GLOBAL) {
  793. target = global_1;
  794. } else if (STATIC) {
  795. target = global_1[TARGET] || setGlobal(TARGET, {});
  796. } else {
  797. target = (global_1[TARGET] || {}).prototype;
  798. }
  799. if (target) for (key in source) {
  800. sourceProperty = source[key];
  801. if (options.noTargetGet) {
  802. descriptor = getOwnPropertyDescriptor$1(target, key);
  803. targetProperty = descriptor && descriptor.value;
  804. } else targetProperty = target[key];
  805. FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  806. // contained in target
  807. if (!FORCED && targetProperty !== undefined) {
  808. if (typeof sourceProperty == typeof targetProperty) continue;
  809. copyConstructorProperties(sourceProperty, targetProperty);
  810. }
  811. // add a flag to not completely full polyfills
  812. if (options.sham || (targetProperty && targetProperty.sham)) {
  813. createNonEnumerableProperty(sourceProperty, 'sham', true);
  814. }
  815. defineBuiltIn(target, key, sourceProperty, options);
  816. }
  817. };
  818. var bind$1 = functionUncurryThis(functionUncurryThis.bind);
  819. // optional / simple context binding
  820. var functionBindContext = function (fn, that) {
  821. aCallable(fn);
  822. return that === undefined ? fn : functionBindNative ? bind$1(fn, that) : function (/* ...args */) {
  823. return fn.apply(that, arguments);
  824. };
  825. };
  826. // `IsArray` abstract operation
  827. // https://tc39.es/ecma262/#sec-isarray
  828. // eslint-disable-next-line es-x/no-array-isarray -- safe
  829. var isArray = Array.isArray || function isArray(argument) {
  830. return classofRaw(argument) == 'Array';
  831. };
  832. var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
  833. var test$1 = {};
  834. test$1[TO_STRING_TAG$2] = 'z';
  835. var toStringTagSupport = String(test$1) === '[object z]';
  836. var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
  837. var Object$1 = global_1.Object;
  838. // ES3 wrong here
  839. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  840. // fallback for IE11 Script Access Denied error
  841. var tryGet = function (it, key) {
  842. try {
  843. return it[key];
  844. } catch (error) { /* empty */ }
  845. };
  846. // getting tag from ES6+ `Object.prototype.toString`
  847. var classof = toStringTagSupport ? classofRaw : function (it) {
  848. var O, tag, result;
  849. return it === undefined ? 'Undefined' : it === null ? 'Null'
  850. // @@toStringTag case
  851. : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG$1)) == 'string' ? tag
  852. // builtinTag case
  853. : CORRECT_ARGUMENTS ? classofRaw(O)
  854. // ES3 arguments fallback
  855. : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
  856. };
  857. var noop = function () { /* empty */ };
  858. var empty = [];
  859. var construct = getBuiltIn('Reflect', 'construct');
  860. var constructorRegExp = /^\s*(?:class|function)\b/;
  861. var exec$2 = functionUncurryThis(constructorRegExp.exec);
  862. var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
  863. var isConstructorModern = function isConstructor(argument) {
  864. if (!isCallable(argument)) return false;
  865. try {
  866. construct(noop, empty, argument);
  867. return true;
  868. } catch (error) {
  869. return false;
  870. }
  871. };
  872. var isConstructorLegacy = function isConstructor(argument) {
  873. if (!isCallable(argument)) return false;
  874. switch (classof(argument)) {
  875. case 'AsyncFunction':
  876. case 'GeneratorFunction':
  877. case 'AsyncGeneratorFunction': return false;
  878. }
  879. try {
  880. // we can't check .prototype since constructors produced by .bind haven't it
  881. // `Function#toString` throws on some built-it function in some legacy engines
  882. // (for example, `DOMQuad` and similar in FF41-)
  883. return INCORRECT_TO_STRING || !!exec$2(constructorRegExp, inspectSource(argument));
  884. } catch (error) {
  885. return true;
  886. }
  887. };
  888. isConstructorLegacy.sham = true;
  889. // `IsConstructor` abstract operation
  890. // https://tc39.es/ecma262/#sec-isconstructor
  891. var isConstructor = !construct || fails(function () {
  892. var called;
  893. return isConstructorModern(isConstructorModern.call)
  894. || !isConstructorModern(Object)
  895. || !isConstructorModern(function () { called = true; })
  896. || called;
  897. }) ? isConstructorLegacy : isConstructorModern;
  898. var SPECIES$5 = wellKnownSymbol('species');
  899. var Array$2 = global_1.Array;
  900. // a part of `ArraySpeciesCreate` abstract operation
  901. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  902. var arraySpeciesConstructor = function (originalArray) {
  903. var C;
  904. if (isArray(originalArray)) {
  905. C = originalArray.constructor;
  906. // cross-realm fallback
  907. if (isConstructor(C) && (C === Array$2 || isArray(C.prototype))) C = undefined;
  908. else if (isObject(C)) {
  909. C = C[SPECIES$5];
  910. if (C === null) C = undefined;
  911. }
  912. } return C === undefined ? Array$2 : C;
  913. };
  914. // `ArraySpeciesCreate` abstract operation
  915. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  916. var arraySpeciesCreate = function (originalArray, length) {
  917. return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
  918. };
  919. var push$4 = functionUncurryThis([].push);
  920. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
  921. var createMethod$3 = function (TYPE) {
  922. var IS_MAP = TYPE == 1;
  923. var IS_FILTER = TYPE == 2;
  924. var IS_SOME = TYPE == 3;
  925. var IS_EVERY = TYPE == 4;
  926. var IS_FIND_INDEX = TYPE == 6;
  927. var IS_FILTER_REJECT = TYPE == 7;
  928. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  929. return function ($this, callbackfn, that, specificCreate) {
  930. var O = toObject($this);
  931. var self = indexedObject(O);
  932. var boundFunction = functionBindContext(callbackfn, that);
  933. var length = lengthOfArrayLike(self);
  934. var index = 0;
  935. var create = specificCreate || arraySpeciesCreate;
  936. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
  937. var value, result;
  938. for (;length > index; index++) if (NO_HOLES || index in self) {
  939. value = self[index];
  940. result = boundFunction(value, index, O);
  941. if (TYPE) {
  942. if (IS_MAP) target[index] = result; // map
  943. else if (result) switch (TYPE) {
  944. case 3: return true; // some
  945. case 5: return value; // find
  946. case 6: return index; // findIndex
  947. case 2: push$4(target, value); // filter
  948. } else switch (TYPE) {
  949. case 4: return false; // every
  950. case 7: push$4(target, value); // filterReject
  951. }
  952. }
  953. }
  954. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  955. };
  956. };
  957. var arrayIteration = {
  958. // `Array.prototype.forEach` method
  959. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  960. forEach: createMethod$3(0),
  961. // `Array.prototype.map` method
  962. // https://tc39.es/ecma262/#sec-array.prototype.map
  963. map: createMethod$3(1),
  964. // `Array.prototype.filter` method
  965. // https://tc39.es/ecma262/#sec-array.prototype.filter
  966. filter: createMethod$3(2),
  967. // `Array.prototype.some` method
  968. // https://tc39.es/ecma262/#sec-array.prototype.some
  969. some: createMethod$3(3),
  970. // `Array.prototype.every` method
  971. // https://tc39.es/ecma262/#sec-array.prototype.every
  972. every: createMethod$3(4),
  973. // `Array.prototype.find` method
  974. // https://tc39.es/ecma262/#sec-array.prototype.find
  975. find: createMethod$3(5),
  976. // `Array.prototype.findIndex` method
  977. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  978. findIndex: createMethod$3(6),
  979. // `Array.prototype.filterReject` method
  980. // https://github.com/tc39/proposal-array-filtering
  981. filterReject: createMethod$3(7)
  982. };
  983. var SPECIES$4 = wellKnownSymbol('species');
  984. var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
  985. // We can't use this feature detection in V8 since it causes
  986. // deoptimization and serious performance degradation
  987. // https://github.com/zloirock/core-js/issues/677
  988. return engineV8Version >= 51 || !fails(function () {
  989. var array = [];
  990. var constructor = array.constructor = {};
  991. constructor[SPECIES$4] = function () {
  992. return { foo: 1 };
  993. };
  994. return array[METHOD_NAME](Boolean).foo !== 1;
  995. });
  996. };
  997. var $filter = arrayIteration.filter;
  998. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
  999. // `Array.prototype.filter` method
  1000. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1001. // with adding support of @@species
  1002. _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  1003. filter: function filter(callbackfn /* , thisArg */) {
  1004. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1005. }
  1006. });
  1007. // `Object.prototype.toString` method implementation
  1008. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  1009. var objectToString = toStringTagSupport ? {}.toString : function toString() {
  1010. return '[object ' + classof(this) + ']';
  1011. };
  1012. // `Object.prototype.toString` method
  1013. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  1014. if (!toStringTagSupport) {
  1015. defineBuiltIn(Object.prototype, 'toString', objectToString, { unsafe: true });
  1016. }
  1017. // `Object.keys` method
  1018. // https://tc39.es/ecma262/#sec-object.keys
  1019. // eslint-disable-next-line es-x/no-object-keys -- safe
  1020. var objectKeys = Object.keys || function keys(O) {
  1021. return objectKeysInternal(O, enumBugKeys);
  1022. };
  1023. var FAILS_ON_PRIMITIVES = fails(function () { objectKeys(1); });
  1024. // `Object.keys` method
  1025. // https://tc39.es/ecma262/#sec-object.keys
  1026. _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
  1027. keys: function keys(it) {
  1028. return objectKeys(toObject(it));
  1029. }
  1030. });
  1031. var createProperty = function (object, key, value) {
  1032. var propertyKey = toPropertyKey(key);
  1033. if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
  1034. else object[propertyKey] = value;
  1035. };
  1036. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  1037. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
  1038. var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
  1039. var TypeError$a = global_1.TypeError;
  1040. // We can't use this feature detection in V8 since it causes
  1041. // deoptimization and serious performance degradation
  1042. // https://github.com/zloirock/core-js/issues/679
  1043. var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
  1044. var array = [];
  1045. array[IS_CONCAT_SPREADABLE] = false;
  1046. return array.concat()[0] !== array;
  1047. });
  1048. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  1049. var isConcatSpreadable = function (O) {
  1050. if (!isObject(O)) return false;
  1051. var spreadable = O[IS_CONCAT_SPREADABLE];
  1052. return spreadable !== undefined ? !!spreadable : isArray(O);
  1053. };
  1054. var FORCED$2 = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  1055. // `Array.prototype.concat` method
  1056. // https://tc39.es/ecma262/#sec-array.prototype.concat
  1057. // with adding support of @@isConcatSpreadable and @@species
  1058. _export({ target: 'Array', proto: true, arity: 1, forced: FORCED$2 }, {
  1059. // eslint-disable-next-line no-unused-vars -- required for `.length`
  1060. concat: function concat(arg) {
  1061. var O = toObject(this);
  1062. var A = arraySpeciesCreate(O, 0);
  1063. var n = 0;
  1064. var i, k, length, len, E;
  1065. for (i = -1, length = arguments.length; i < length; i++) {
  1066. E = i === -1 ? O : arguments[i];
  1067. if (isConcatSpreadable(E)) {
  1068. len = lengthOfArrayLike(E);
  1069. if (n + len > MAX_SAFE_INTEGER) throw TypeError$a(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1070. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  1071. } else {
  1072. if (n >= MAX_SAFE_INTEGER) throw TypeError$a(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
  1073. createProperty(A, n++, E);
  1074. }
  1075. }
  1076. A.length = n;
  1077. return A;
  1078. }
  1079. });
  1080. // `Object.defineProperties` method
  1081. // https://tc39.es/ecma262/#sec-object.defineproperties
  1082. // eslint-disable-next-line es-x/no-object-defineproperties -- safe
  1083. var f$1 = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
  1084. anObject(O);
  1085. var props = toIndexedObject(Properties);
  1086. var keys = objectKeys(Properties);
  1087. var length = keys.length;
  1088. var index = 0;
  1089. var key;
  1090. while (length > index) objectDefineProperty.f(O, key = keys[index++], props[key]);
  1091. return O;
  1092. };
  1093. var objectDefineProperties = {
  1094. f: f$1
  1095. };
  1096. var html = getBuiltIn('document', 'documentElement');
  1097. /* global ActiveXObject -- old IE, WSH */
  1098. var GT = '>';
  1099. var LT = '<';
  1100. var PROTOTYPE = 'prototype';
  1101. var SCRIPT = 'script';
  1102. var IE_PROTO = sharedKey('IE_PROTO');
  1103. var EmptyConstructor = function () { /* empty */ };
  1104. var scriptTag = function (content) {
  1105. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  1106. };
  1107. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  1108. var NullProtoObjectViaActiveX = function (activeXDocument) {
  1109. activeXDocument.write(scriptTag(''));
  1110. activeXDocument.close();
  1111. var temp = activeXDocument.parentWindow.Object;
  1112. activeXDocument = null; // avoid memory leak
  1113. return temp;
  1114. };
  1115. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  1116. var NullProtoObjectViaIFrame = function () {
  1117. // Thrash, waste and sodomy: IE GC bug
  1118. var iframe = documentCreateElement('iframe');
  1119. var JS = 'java' + SCRIPT + ':';
  1120. var iframeDocument;
  1121. iframe.style.display = 'none';
  1122. html.appendChild(iframe);
  1123. // https://github.com/zloirock/core-js/issues/475
  1124. iframe.src = String(JS);
  1125. iframeDocument = iframe.contentWindow.document;
  1126. iframeDocument.open();
  1127. iframeDocument.write(scriptTag('document.F=Object'));
  1128. iframeDocument.close();
  1129. return iframeDocument.F;
  1130. };
  1131. // Check for document.domain and active x support
  1132. // No need to use active x approach when document.domain is not set
  1133. // see https://github.com/es-shims/es5-shim/issues/150
  1134. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  1135. // avoid IE GC bug
  1136. var activeXDocument;
  1137. var NullProtoObject = function () {
  1138. try {
  1139. activeXDocument = new ActiveXObject('htmlfile');
  1140. } catch (error) { /* ignore */ }
  1141. NullProtoObject = typeof document != 'undefined'
  1142. ? document.domain && activeXDocument
  1143. ? NullProtoObjectViaActiveX(activeXDocument) // old IE
  1144. : NullProtoObjectViaIFrame()
  1145. : NullProtoObjectViaActiveX(activeXDocument); // WSH
  1146. var length = enumBugKeys.length;
  1147. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  1148. return NullProtoObject();
  1149. };
  1150. hiddenKeys$1[IE_PROTO] = true;
  1151. // `Object.create` method
  1152. // https://tc39.es/ecma262/#sec-object.create
  1153. // eslint-disable-next-line es-x/no-object-create -- safe
  1154. var objectCreate = Object.create || function create(O, Properties) {
  1155. var result;
  1156. if (O !== null) {
  1157. EmptyConstructor[PROTOTYPE] = anObject(O);
  1158. result = new EmptyConstructor();
  1159. EmptyConstructor[PROTOTYPE] = null;
  1160. // add "__proto__" for Object.getPrototypeOf polyfill
  1161. result[IE_PROTO] = O;
  1162. } else result = NullProtoObject();
  1163. return Properties === undefined ? result : objectDefineProperties.f(result, Properties);
  1164. };
  1165. var UNSCOPABLES = wellKnownSymbol('unscopables');
  1166. var ArrayPrototype$1 = Array.prototype;
  1167. // Array.prototype[@@unscopables]
  1168. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1169. if (ArrayPrototype$1[UNSCOPABLES] == undefined) {
  1170. objectDefineProperty.f(ArrayPrototype$1, UNSCOPABLES, {
  1171. configurable: true,
  1172. value: objectCreate(null)
  1173. });
  1174. }
  1175. // add a key to Array.prototype[@@unscopables]
  1176. var addToUnscopables = function (key) {
  1177. ArrayPrototype$1[UNSCOPABLES][key] = true;
  1178. };
  1179. var $includes = arrayIncludes.includes;
  1180. // FF99+ bug
  1181. var BROKEN_ON_SPARSE = fails(function () {
  1182. return !Array(1).includes();
  1183. });
  1184. // `Array.prototype.includes` method
  1185. // https://tc39.es/ecma262/#sec-array.prototype.includes
  1186. _export({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
  1187. includes: function includes(el /* , fromIndex = 0 */) {
  1188. return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  1189. }
  1190. });
  1191. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1192. addToUnscopables('includes');
  1193. var MATCH$1 = wellKnownSymbol('match');
  1194. // `IsRegExp` abstract operation
  1195. // https://tc39.es/ecma262/#sec-isregexp
  1196. var isRegexp = function (it) {
  1197. var isRegExp;
  1198. return isObject(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
  1199. };
  1200. var TypeError$9 = global_1.TypeError;
  1201. var notARegexp = function (it) {
  1202. if (isRegexp(it)) {
  1203. throw TypeError$9("The method doesn't accept regular expressions");
  1204. } return it;
  1205. };
  1206. var String$3 = global_1.String;
  1207. var toString_1 = function (argument) {
  1208. if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
  1209. return String$3(argument);
  1210. };
  1211. var MATCH = wellKnownSymbol('match');
  1212. var correctIsRegexpLogic = function (METHOD_NAME) {
  1213. var regexp = /./;
  1214. try {
  1215. '/./'[METHOD_NAME](regexp);
  1216. } catch (error1) {
  1217. try {
  1218. regexp[MATCH] = false;
  1219. return '/./'[METHOD_NAME](regexp);
  1220. } catch (error2) { /* empty */ }
  1221. } return false;
  1222. };
  1223. var stringIndexOf$1 = functionUncurryThis(''.indexOf);
  1224. // `String.prototype.includes` method
  1225. // https://tc39.es/ecma262/#sec-string.prototype.includes
  1226. _export({ target: 'String', proto: true, forced: !correctIsRegexpLogic('includes') }, {
  1227. includes: function includes(searchString /* , position = 0 */) {
  1228. return !!~stringIndexOf$1(
  1229. toString_1(requireObjectCoercible(this)),
  1230. toString_1(notARegexp(searchString)),
  1231. arguments.length > 1 ? arguments[1] : undefined
  1232. );
  1233. }
  1234. });
  1235. // iterable DOM collections
  1236. // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
  1237. var domIterables = {
  1238. CSSRuleList: 0,
  1239. CSSStyleDeclaration: 0,
  1240. CSSValueList: 0,
  1241. ClientRectList: 0,
  1242. DOMRectList: 0,
  1243. DOMStringList: 0,
  1244. DOMTokenList: 1,
  1245. DataTransferItemList: 0,
  1246. FileList: 0,
  1247. HTMLAllCollection: 0,
  1248. HTMLCollection: 0,
  1249. HTMLFormElement: 0,
  1250. HTMLSelectElement: 0,
  1251. MediaList: 0,
  1252. MimeTypeArray: 0,
  1253. NamedNodeMap: 0,
  1254. NodeList: 1,
  1255. PaintRequestList: 0,
  1256. Plugin: 0,
  1257. PluginArray: 0,
  1258. SVGLengthList: 0,
  1259. SVGNumberList: 0,
  1260. SVGPathSegList: 0,
  1261. SVGPointList: 0,
  1262. SVGStringList: 0,
  1263. SVGTransformList: 0,
  1264. SourceBufferList: 0,
  1265. StyleSheetList: 0,
  1266. TextTrackCueList: 0,
  1267. TextTrackList: 0,
  1268. TouchList: 0
  1269. };
  1270. // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
  1271. var classList = documentCreateElement('span').classList;
  1272. var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype;
  1273. var domTokenListPrototype = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype;
  1274. var arrayMethodIsStrict = function (METHOD_NAME, argument) {
  1275. var method = [][METHOD_NAME];
  1276. return !!method && fails(function () {
  1277. // eslint-disable-next-line no-useless-call -- required for testing
  1278. method.call(null, argument || function () { return 1; }, 1);
  1279. });
  1280. };
  1281. var $forEach = arrayIteration.forEach;
  1282. var STRICT_METHOD$3 = arrayMethodIsStrict('forEach');
  1283. // `Array.prototype.forEach` method implementation
  1284. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  1285. var arrayForEach = !STRICT_METHOD$3 ? function forEach(callbackfn /* , thisArg */) {
  1286. return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1287. // eslint-disable-next-line es-x/no-array-prototype-foreach -- safe
  1288. } : [].forEach;
  1289. var handlePrototype = function (CollectionPrototype) {
  1290. // some Chrome versions have non-configurable methods on DOMTokenList
  1291. if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
  1292. createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
  1293. } catch (error) {
  1294. CollectionPrototype.forEach = arrayForEach;
  1295. }
  1296. };
  1297. for (var COLLECTION_NAME in domIterables) {
  1298. if (domIterables[COLLECTION_NAME]) {
  1299. handlePrototype(global_1[COLLECTION_NAME] && global_1[COLLECTION_NAME].prototype);
  1300. }
  1301. }
  1302. handlePrototype(domTokenListPrototype);
  1303. var $propertyIsEnumerable = objectPropertyIsEnumerable.f;
  1304. var propertyIsEnumerable = functionUncurryThis($propertyIsEnumerable);
  1305. var push$3 = functionUncurryThis([].push);
  1306. // `Object.{ entries, values }` methods implementation
  1307. var createMethod$2 = function (TO_ENTRIES) {
  1308. return function (it) {
  1309. var O = toIndexedObject(it);
  1310. var keys = objectKeys(O);
  1311. var length = keys.length;
  1312. var i = 0;
  1313. var result = [];
  1314. var key;
  1315. while (length > i) {
  1316. key = keys[i++];
  1317. if (!descriptors || propertyIsEnumerable(O, key)) {
  1318. push$3(result, TO_ENTRIES ? [key, O[key]] : O[key]);
  1319. }
  1320. }
  1321. return result;
  1322. };
  1323. };
  1324. var objectToArray = {
  1325. // `Object.entries` method
  1326. // https://tc39.es/ecma262/#sec-object.entries
  1327. entries: createMethod$2(true),
  1328. // `Object.values` method
  1329. // https://tc39.es/ecma262/#sec-object.values
  1330. values: createMethod$2(false)
  1331. };
  1332. var $values = objectToArray.values;
  1333. // `Object.values` method
  1334. // https://tc39.es/ecma262/#sec-object.values
  1335. _export({ target: 'Object', stat: true }, {
  1336. values: function values(O) {
  1337. return $values(O);
  1338. }
  1339. });
  1340. // `RegExp.prototype.flags` getter implementation
  1341. // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
  1342. var regexpFlags = function () {
  1343. var that = anObject(this);
  1344. var result = '';
  1345. if (that.hasIndices) result += 'd';
  1346. if (that.global) result += 'g';
  1347. if (that.ignoreCase) result += 'i';
  1348. if (that.multiline) result += 'm';
  1349. if (that.dotAll) result += 's';
  1350. if (that.unicode) result += 'u';
  1351. if (that.sticky) result += 'y';
  1352. return result;
  1353. };
  1354. var RegExpPrototype$2 = RegExp.prototype;
  1355. var regexpGetFlags = function (R) {
  1356. var flags = R.flags;
  1357. return flags === undefined && !('flags' in RegExpPrototype$2) && !hasOwnProperty_1(R, 'flags') && objectIsPrototypeOf(RegExpPrototype$2, R)
  1358. ? functionCall(regexpFlags, R) : flags;
  1359. };
  1360. var PROPER_FUNCTION_NAME$1 = functionName.PROPER;
  1361. var TO_STRING = 'toString';
  1362. var RegExpPrototype$1 = RegExp.prototype;
  1363. var n$ToString = RegExpPrototype$1[TO_STRING];
  1364. var NOT_GENERIC = fails(function () { return n$ToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
  1365. // FF44- RegExp#toString has a wrong name
  1366. var INCORRECT_NAME = PROPER_FUNCTION_NAME$1 && n$ToString.name != TO_STRING;
  1367. // `RegExp.prototype.toString` method
  1368. // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
  1369. if (NOT_GENERIC || INCORRECT_NAME) {
  1370. defineBuiltIn(RegExp.prototype, TO_STRING, function toString() {
  1371. var R = anObject(this);
  1372. var pattern = toString_1(R.source);
  1373. var flags = toString_1(regexpGetFlags(R));
  1374. return '/' + pattern + '/' + flags;
  1375. }, { unsafe: true });
  1376. }
  1377. /* eslint-disable es-x/no-array-prototype-indexof -- required for testing */
  1378. var $IndexOf = arrayIncludes.indexOf;
  1379. var un$IndexOf = functionUncurryThis([].indexOf);
  1380. var NEGATIVE_ZERO = !!un$IndexOf && 1 / un$IndexOf([1], 1, -0) < 0;
  1381. var STRICT_METHOD$2 = arrayMethodIsStrict('indexOf');
  1382. // `Array.prototype.indexOf` method
  1383. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  1384. _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD$2 }, {
  1385. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  1386. var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
  1387. return NEGATIVE_ZERO
  1388. // convert -0 to +0
  1389. ? un$IndexOf(this, searchElement, fromIndex) || 0
  1390. : $IndexOf(this, searchElement, fromIndex);
  1391. }
  1392. });
  1393. // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
  1394. var $RegExp$2 = global_1.RegExp;
  1395. var UNSUPPORTED_Y$2 = fails(function () {
  1396. var re = $RegExp$2('a', 'y');
  1397. re.lastIndex = 2;
  1398. return re.exec('abcd') != null;
  1399. });
  1400. // UC Browser bug
  1401. // https://github.com/zloirock/core-js/issues/1008
  1402. var MISSED_STICKY = UNSUPPORTED_Y$2 || fails(function () {
  1403. return !$RegExp$2('a', 'y').sticky;
  1404. });
  1405. var BROKEN_CARET = UNSUPPORTED_Y$2 || fails(function () {
  1406. // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
  1407. var re = $RegExp$2('^r', 'gy');
  1408. re.lastIndex = 2;
  1409. return re.exec('str') != null;
  1410. });
  1411. var regexpStickyHelpers = {
  1412. BROKEN_CARET: BROKEN_CARET,
  1413. MISSED_STICKY: MISSED_STICKY,
  1414. UNSUPPORTED_Y: UNSUPPORTED_Y$2
  1415. };
  1416. // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
  1417. var $RegExp$1 = global_1.RegExp;
  1418. var regexpUnsupportedDotAll = fails(function () {
  1419. var re = $RegExp$1('.', 's');
  1420. return !(re.dotAll && re.exec('\n') && re.flags === 's');
  1421. });
  1422. // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
  1423. var $RegExp = global_1.RegExp;
  1424. var regexpUnsupportedNcg = fails(function () {
  1425. var re = $RegExp('(?<a>b)', 'g');
  1426. return re.exec('b').groups.a !== 'b' ||
  1427. 'b'.replace(re, '$<a>c') !== 'bc';
  1428. });
  1429. /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
  1430. /* eslint-disable regexp/no-useless-quantifier -- testing */
  1431. var getInternalState = internalState.get;
  1432. var nativeReplace = shared('native-string-replace', String.prototype.replace);
  1433. var nativeExec = RegExp.prototype.exec;
  1434. var patchedExec = nativeExec;
  1435. var charAt$3 = functionUncurryThis(''.charAt);
  1436. var indexOf = functionUncurryThis(''.indexOf);
  1437. var replace$2 = functionUncurryThis(''.replace);
  1438. var stringSlice$4 = functionUncurryThis(''.slice);
  1439. var UPDATES_LAST_INDEX_WRONG = (function () {
  1440. var re1 = /a/;
  1441. var re2 = /b*/g;
  1442. functionCall(nativeExec, re1, 'a');
  1443. functionCall(nativeExec, re2, 'a');
  1444. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  1445. })();
  1446. var UNSUPPORTED_Y$1 = regexpStickyHelpers.BROKEN_CARET;
  1447. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  1448. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  1449. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1 || regexpUnsupportedDotAll || regexpUnsupportedNcg;
  1450. if (PATCH) {
  1451. patchedExec = function exec(string) {
  1452. var re = this;
  1453. var state = getInternalState(re);
  1454. var str = toString_1(string);
  1455. var raw = state.raw;
  1456. var result, reCopy, lastIndex, match, i, object, group;
  1457. if (raw) {
  1458. raw.lastIndex = re.lastIndex;
  1459. result = functionCall(patchedExec, raw, str);
  1460. re.lastIndex = raw.lastIndex;
  1461. return result;
  1462. }
  1463. var groups = state.groups;
  1464. var sticky = UNSUPPORTED_Y$1 && re.sticky;
  1465. var flags = functionCall(regexpFlags, re);
  1466. var source = re.source;
  1467. var charsAdded = 0;
  1468. var strCopy = str;
  1469. if (sticky) {
  1470. flags = replace$2(flags, 'y', '');
  1471. if (indexOf(flags, 'g') === -1) {
  1472. flags += 'g';
  1473. }
  1474. strCopy = stringSlice$4(str, re.lastIndex);
  1475. // Support anchored sticky behavior.
  1476. if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$3(str, re.lastIndex - 1) !== '\n')) {
  1477. source = '(?: ' + source + ')';
  1478. strCopy = ' ' + strCopy;
  1479. charsAdded++;
  1480. }
  1481. // ^(? + rx + ) is needed, in combination with some str slicing, to
  1482. // simulate the 'y' flag.
  1483. reCopy = new RegExp('^(?:' + source + ')', flags);
  1484. }
  1485. if (NPCG_INCLUDED) {
  1486. reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
  1487. }
  1488. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  1489. match = functionCall(nativeExec, sticky ? reCopy : re, strCopy);
  1490. if (sticky) {
  1491. if (match) {
  1492. match.input = stringSlice$4(match.input, charsAdded);
  1493. match[0] = stringSlice$4(match[0], charsAdded);
  1494. match.index = re.lastIndex;
  1495. re.lastIndex += match[0].length;
  1496. } else re.lastIndex = 0;
  1497. } else if (UPDATES_LAST_INDEX_WRONG && match) {
  1498. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  1499. }
  1500. if (NPCG_INCLUDED && match && match.length > 1) {
  1501. // Fix browsers whose `exec` methods don't consistently return `undefined`
  1502. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  1503. functionCall(nativeReplace, match[0], reCopy, function () {
  1504. for (i = 1; i < arguments.length - 2; i++) {
  1505. if (arguments[i] === undefined) match[i] = undefined;
  1506. }
  1507. });
  1508. }
  1509. if (match && groups) {
  1510. match.groups = object = objectCreate(null);
  1511. for (i = 0; i < groups.length; i++) {
  1512. group = groups[i];
  1513. object[group[0]] = match[group[1]];
  1514. }
  1515. }
  1516. return match;
  1517. };
  1518. }
  1519. var regexpExec = patchedExec;
  1520. // `RegExp.prototype.exec` method
  1521. // https://tc39.es/ecma262/#sec-regexp.prototype.exec
  1522. _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
  1523. exec: regexpExec
  1524. });
  1525. // a string of all valid unicode whitespaces
  1526. var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
  1527. '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  1528. var replace$1 = functionUncurryThis(''.replace);
  1529. var whitespace = '[' + whitespaces + ']';
  1530. var ltrim = RegExp('^' + whitespace + whitespace + '*');
  1531. var rtrim = RegExp(whitespace + whitespace + '*$');
  1532. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  1533. var createMethod$1 = function (TYPE) {
  1534. return function ($this) {
  1535. var string = toString_1(requireObjectCoercible($this));
  1536. if (TYPE & 1) string = replace$1(string, ltrim, '');
  1537. if (TYPE & 2) string = replace$1(string, rtrim, '');
  1538. return string;
  1539. };
  1540. };
  1541. var stringTrim = {
  1542. // `String.prototype.{ trimLeft, trimStart }` methods
  1543. // https://tc39.es/ecma262/#sec-string.prototype.trimstart
  1544. start: createMethod$1(1),
  1545. // `String.prototype.{ trimRight, trimEnd }` methods
  1546. // https://tc39.es/ecma262/#sec-string.prototype.trimend
  1547. end: createMethod$1(2),
  1548. // `String.prototype.trim` method
  1549. // https://tc39.es/ecma262/#sec-string.prototype.trim
  1550. trim: createMethod$1(3)
  1551. };
  1552. var trim = stringTrim.trim;
  1553. var $parseInt = global_1.parseInt;
  1554. var Symbol$1 = global_1.Symbol;
  1555. var ITERATOR$3 = Symbol$1 && Symbol$1.iterator;
  1556. var hex = /^[+-]?0x/i;
  1557. var exec$1 = functionUncurryThis(hex.exec);
  1558. var FORCED$1 = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22
  1559. // MS Edge 18- broken with boxed symbols
  1560. || (ITERATOR$3 && !fails(function () { $parseInt(Object(ITERATOR$3)); }));
  1561. // `parseInt` method
  1562. // https://tc39.es/ecma262/#sec-parseint-string-radix
  1563. var numberParseInt = FORCED$1 ? function parseInt(string, radix) {
  1564. var S = trim(toString_1(string));
  1565. return $parseInt(S, (radix >>> 0) || (exec$1(hex, S) ? 16 : 10));
  1566. } : $parseInt;
  1567. // `parseInt` method
  1568. // https://tc39.es/ecma262/#sec-parseint-string-radix
  1569. _export({ global: true, forced: parseInt != numberParseInt }, {
  1570. parseInt: numberParseInt
  1571. });
  1572. // eslint-disable-next-line es-x/no-object-assign -- safe
  1573. var $assign = Object.assign;
  1574. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  1575. var defineProperty$1 = Object.defineProperty;
  1576. var concat$1 = functionUncurryThis([].concat);
  1577. // `Object.assign` method
  1578. // https://tc39.es/ecma262/#sec-object.assign
  1579. var objectAssign = !$assign || fails(function () {
  1580. // should have correct order of operations (Edge bug)
  1581. if (descriptors && $assign({ b: 1 }, $assign(defineProperty$1({}, 'a', {
  1582. enumerable: true,
  1583. get: function () {
  1584. defineProperty$1(this, 'b', {
  1585. value: 3,
  1586. enumerable: false
  1587. });
  1588. }
  1589. }), { b: 2 })).b !== 1) return true;
  1590. // should work with symbols and should have deterministic property order (V8 bug)
  1591. var A = {};
  1592. var B = {};
  1593. // eslint-disable-next-line es-x/no-symbol -- safe
  1594. var symbol = Symbol();
  1595. var alphabet = 'abcdefghijklmnopqrst';
  1596. A[symbol] = 7;
  1597. alphabet.split('').forEach(function (chr) { B[chr] = chr; });
  1598. return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
  1599. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
  1600. var T = toObject(target);
  1601. var argumentsLength = arguments.length;
  1602. var index = 1;
  1603. var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
  1604. var propertyIsEnumerable = objectPropertyIsEnumerable.f;
  1605. while (argumentsLength > index) {
  1606. var S = indexedObject(arguments[index++]);
  1607. var keys = getOwnPropertySymbols ? concat$1(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
  1608. var length = keys.length;
  1609. var j = 0;
  1610. var key;
  1611. while (length > j) {
  1612. key = keys[j++];
  1613. if (!descriptors || functionCall(propertyIsEnumerable, S, key)) T[key] = S[key];
  1614. }
  1615. } return T;
  1616. } : $assign;
  1617. // `Object.assign` method
  1618. // https://tc39.es/ecma262/#sec-object.assign
  1619. // eslint-disable-next-line es-x/no-object-assign -- required for testing
  1620. _export({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== objectAssign }, {
  1621. assign: objectAssign
  1622. });
  1623. var $find = arrayIteration.find;
  1624. var FIND = 'find';
  1625. var SKIPS_HOLES = true;
  1626. // Shouldn't skip holes
  1627. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  1628. // `Array.prototype.find` method
  1629. // https://tc39.es/ecma262/#sec-array.prototype.find
  1630. _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  1631. find: function find(callbackfn /* , that = undefined */) {
  1632. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1633. }
  1634. });
  1635. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1636. addToUnscopables(FIND);
  1637. var engineIsNode = classofRaw(global_1.process) == 'process';
  1638. var String$2 = global_1.String;
  1639. var TypeError$8 = global_1.TypeError;
  1640. var aPossiblePrototype = function (argument) {
  1641. if (typeof argument == 'object' || isCallable(argument)) return argument;
  1642. throw TypeError$8("Can't set " + String$2(argument) + ' as a prototype');
  1643. };
  1644. /* eslint-disable no-proto -- safe */
  1645. // `Object.setPrototypeOf` method
  1646. // https://tc39.es/ecma262/#sec-object.setprototypeof
  1647. // Works with __proto__ only. Old v8 can't work with null proto objects.
  1648. // eslint-disable-next-line es-x/no-object-setprototypeof -- safe
  1649. var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
  1650. var CORRECT_SETTER = false;
  1651. var test = {};
  1652. var setter;
  1653. try {
  1654. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  1655. setter = functionUncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
  1656. setter(test, []);
  1657. CORRECT_SETTER = test instanceof Array;
  1658. } catch (error) { /* empty */ }
  1659. return function setPrototypeOf(O, proto) {
  1660. anObject(O);
  1661. aPossiblePrototype(proto);
  1662. if (CORRECT_SETTER) setter(O, proto);
  1663. else O.__proto__ = proto;
  1664. return O;
  1665. };
  1666. }() : undefined);
  1667. var defineProperty = objectDefineProperty.f;
  1668. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  1669. var setToStringTag = function (target, TAG, STATIC) {
  1670. if (target && !STATIC) target = target.prototype;
  1671. if (target && !hasOwnProperty_1(target, TO_STRING_TAG)) {
  1672. defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });
  1673. }
  1674. };
  1675. var SPECIES$3 = wellKnownSymbol('species');
  1676. var setSpecies = function (CONSTRUCTOR_NAME) {
  1677. var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
  1678. var defineProperty = objectDefineProperty.f;
  1679. if (descriptors && Constructor && !Constructor[SPECIES$3]) {
  1680. defineProperty(Constructor, SPECIES$3, {
  1681. configurable: true,
  1682. get: function () { return this; }
  1683. });
  1684. }
  1685. };
  1686. var TypeError$7 = global_1.TypeError;
  1687. var anInstance = function (it, Prototype) {
  1688. if (objectIsPrototypeOf(Prototype, it)) return it;
  1689. throw TypeError$7('Incorrect invocation');
  1690. };
  1691. var TypeError$6 = global_1.TypeError;
  1692. // `Assert: IsConstructor(argument) is true`
  1693. var aConstructor = function (argument) {
  1694. if (isConstructor(argument)) return argument;
  1695. throw TypeError$6(tryToString(argument) + ' is not a constructor');
  1696. };
  1697. var SPECIES$2 = wellKnownSymbol('species');
  1698. // `SpeciesConstructor` abstract operation
  1699. // https://tc39.es/ecma262/#sec-speciesconstructor
  1700. var speciesConstructor = function (O, defaultConstructor) {
  1701. var C = anObject(O).constructor;
  1702. var S;
  1703. return C === undefined || (S = anObject(C)[SPECIES$2]) == undefined ? defaultConstructor : aConstructor(S);
  1704. };
  1705. var FunctionPrototype = Function.prototype;
  1706. var apply = FunctionPrototype.apply;
  1707. var call = FunctionPrototype.call;
  1708. // eslint-disable-next-line es-x/no-reflect -- safe
  1709. var functionApply = typeof Reflect == 'object' && Reflect.apply || (functionBindNative ? call.bind(apply) : function () {
  1710. return call.apply(apply, arguments);
  1711. });
  1712. var arraySlice = functionUncurryThis([].slice);
  1713. var TypeError$5 = global_1.TypeError;
  1714. var validateArgumentsLength = function (passed, required) {
  1715. if (passed < required) throw TypeError$5('Not enough arguments');
  1716. return passed;
  1717. };
  1718. var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(engineUserAgent);
  1719. var set = global_1.setImmediate;
  1720. var clear = global_1.clearImmediate;
  1721. var process$2 = global_1.process;
  1722. var Dispatch = global_1.Dispatch;
  1723. var Function$1 = global_1.Function;
  1724. var MessageChannel = global_1.MessageChannel;
  1725. var String$1 = global_1.String;
  1726. var counter = 0;
  1727. var queue$1 = {};
  1728. var ONREADYSTATECHANGE = 'onreadystatechange';
  1729. var location, defer, channel, port;
  1730. try {
  1731. // Deno throws a ReferenceError on `location` access without `--location` flag
  1732. location = global_1.location;
  1733. } catch (error) { /* empty */ }
  1734. var run = function (id) {
  1735. if (hasOwnProperty_1(queue$1, id)) {
  1736. var fn = queue$1[id];
  1737. delete queue$1[id];
  1738. fn();
  1739. }
  1740. };
  1741. var runner = function (id) {
  1742. return function () {
  1743. run(id);
  1744. };
  1745. };
  1746. var listener = function (event) {
  1747. run(event.data);
  1748. };
  1749. var post = function (id) {
  1750. // old engines have not location.origin
  1751. global_1.postMessage(String$1(id), location.protocol + '//' + location.host);
  1752. };
  1753. // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
  1754. if (!set || !clear) {
  1755. set = function setImmediate(handler) {
  1756. validateArgumentsLength(arguments.length, 1);
  1757. var fn = isCallable(handler) ? handler : Function$1(handler);
  1758. var args = arraySlice(arguments, 1);
  1759. queue$1[++counter] = function () {
  1760. functionApply(fn, undefined, args);
  1761. };
  1762. defer(counter);
  1763. return counter;
  1764. };
  1765. clear = function clearImmediate(id) {
  1766. delete queue$1[id];
  1767. };
  1768. // Node.js 0.8-
  1769. if (engineIsNode) {
  1770. defer = function (id) {
  1771. process$2.nextTick(runner(id));
  1772. };
  1773. // Sphere (JS game engine) Dispatch API
  1774. } else if (Dispatch && Dispatch.now) {
  1775. defer = function (id) {
  1776. Dispatch.now(runner(id));
  1777. };
  1778. // Browsers with MessageChannel, includes WebWorkers
  1779. // except iOS - https://github.com/zloirock/core-js/issues/624
  1780. } else if (MessageChannel && !engineIsIos) {
  1781. channel = new MessageChannel();
  1782. port = channel.port2;
  1783. channel.port1.onmessage = listener;
  1784. defer = functionBindContext(port.postMessage, port);
  1785. // Browsers with postMessage, skip WebWorkers
  1786. // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
  1787. } else if (
  1788. global_1.addEventListener &&
  1789. isCallable(global_1.postMessage) &&
  1790. !global_1.importScripts &&
  1791. location && location.protocol !== 'file:' &&
  1792. !fails(post)
  1793. ) {
  1794. defer = post;
  1795. global_1.addEventListener('message', listener, false);
  1796. // IE8-
  1797. } else if (ONREADYSTATECHANGE in documentCreateElement('script')) {
  1798. defer = function (id) {
  1799. html.appendChild(documentCreateElement('script'))[ONREADYSTATECHANGE] = function () {
  1800. html.removeChild(this);
  1801. run(id);
  1802. };
  1803. };
  1804. // Rest old browsers
  1805. } else {
  1806. defer = function (id) {
  1807. setTimeout(runner(id), 0);
  1808. };
  1809. }
  1810. }
  1811. var task$1 = {
  1812. set: set,
  1813. clear: clear
  1814. };
  1815. var engineIsIosPebble = /ipad|iphone|ipod/i.test(engineUserAgent) && global_1.Pebble !== undefined;
  1816. var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(engineUserAgent);
  1817. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  1818. var macrotask = task$1.set;
  1819. var MutationObserver = global_1.MutationObserver || global_1.WebKitMutationObserver;
  1820. var document$2 = global_1.document;
  1821. var process$1 = global_1.process;
  1822. var Promise$1 = global_1.Promise;
  1823. // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
  1824. var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global_1, 'queueMicrotask');
  1825. var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
  1826. var flush, head, last, notify$1, toggle, node, promise, then;
  1827. // modern engines have queueMicrotask method
  1828. if (!queueMicrotask) {
  1829. flush = function () {
  1830. var parent, fn;
  1831. if (engineIsNode && (parent = process$1.domain)) parent.exit();
  1832. while (head) {
  1833. fn = head.fn;
  1834. head = head.next;
  1835. try {
  1836. fn();
  1837. } catch (error) {
  1838. if (head) notify$1();
  1839. else last = undefined;
  1840. throw error;
  1841. }
  1842. } last = undefined;
  1843. if (parent) parent.enter();
  1844. };
  1845. // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
  1846. // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
  1847. if (!engineIsIos && !engineIsNode && !engineIsWebosWebkit && MutationObserver && document$2) {
  1848. toggle = true;
  1849. node = document$2.createTextNode('');
  1850. new MutationObserver(flush).observe(node, { characterData: true });
  1851. notify$1 = function () {
  1852. node.data = toggle = !toggle;
  1853. };
  1854. // environments with maybe non-completely correct, but existent Promise
  1855. } else if (!engineIsIosPebble && Promise$1 && Promise$1.resolve) {
  1856. // Promise.resolve without an argument throws an error in LG WebOS 2
  1857. promise = Promise$1.resolve(undefined);
  1858. // workaround of WebKit ~ iOS Safari 10.1 bug
  1859. promise.constructor = Promise$1;
  1860. then = functionBindContext(promise.then, promise);
  1861. notify$1 = function () {
  1862. then(flush);
  1863. };
  1864. // Node.js without promises
  1865. } else if (engineIsNode) {
  1866. notify$1 = function () {
  1867. process$1.nextTick(flush);
  1868. };
  1869. // for other environments - macrotask based on:
  1870. // - setImmediate
  1871. // - MessageChannel
  1872. // - window.postMessage
  1873. // - onreadystatechange
  1874. // - setTimeout
  1875. } else {
  1876. // strange IE + webpack dev server bug - use .bind(global)
  1877. macrotask = functionBindContext(macrotask, global_1);
  1878. notify$1 = function () {
  1879. macrotask(flush);
  1880. };
  1881. }
  1882. }
  1883. var microtask = queueMicrotask || function (fn) {
  1884. var task = { fn: fn, next: undefined };
  1885. if (last) last.next = task;
  1886. if (!head) {
  1887. head = task;
  1888. notify$1();
  1889. } last = task;
  1890. };
  1891. var hostReportErrors = function (a, b) {
  1892. var console = global_1.console;
  1893. if (console && console.error) {
  1894. arguments.length == 1 ? console.error(a) : console.error(a, b);
  1895. }
  1896. };
  1897. var perform = function (exec) {
  1898. try {
  1899. return { error: false, value: exec() };
  1900. } catch (error) {
  1901. return { error: true, value: error };
  1902. }
  1903. };
  1904. var Queue = function () {
  1905. this.head = null;
  1906. this.tail = null;
  1907. };
  1908. Queue.prototype = {
  1909. add: function (item) {
  1910. var entry = { item: item, next: null };
  1911. if (this.head) this.tail.next = entry;
  1912. else this.head = entry;
  1913. this.tail = entry;
  1914. },
  1915. get: function () {
  1916. var entry = this.head;
  1917. if (entry) {
  1918. this.head = entry.next;
  1919. if (this.tail === entry) this.tail = null;
  1920. return entry.item;
  1921. }
  1922. }
  1923. };
  1924. var queue = Queue;
  1925. var promiseNativeConstructor = global_1.Promise;
  1926. var engineIsBrowser = typeof window == 'object' && typeof Deno != 'object';
  1927. promiseNativeConstructor && promiseNativeConstructor.prototype;
  1928. var SPECIES$1 = wellKnownSymbol('species');
  1929. var SUBCLASSING = false;
  1930. var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable(global_1.PromiseRejectionEvent);
  1931. var FORCED_PROMISE_CONSTRUCTOR$5 = isForced_1('Promise', function () {
  1932. var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(promiseNativeConstructor);
  1933. var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(promiseNativeConstructor);
  1934. // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
  1935. // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
  1936. // We can't detect it synchronously, so just check versions
  1937. if (!GLOBAL_CORE_JS_PROMISE && engineV8Version === 66) return true;
  1938. // We can't use @@species feature detection in V8 since it causes
  1939. // deoptimization and performance degradation
  1940. // https://github.com/zloirock/core-js/issues/679
  1941. if (engineV8Version >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false;
  1942. // Detect correctness of subclassing with @@species support
  1943. var promise = new promiseNativeConstructor(function (resolve) { resolve(1); });
  1944. var FakePromise = function (exec) {
  1945. exec(function () { /* empty */ }, function () { /* empty */ });
  1946. };
  1947. var constructor = promise.constructor = {};
  1948. constructor[SPECIES$1] = FakePromise;
  1949. SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
  1950. if (!SUBCLASSING) return true;
  1951. // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
  1952. return !GLOBAL_CORE_JS_PROMISE && engineIsBrowser && !NATIVE_PROMISE_REJECTION_EVENT$1;
  1953. });
  1954. var promiseConstructorDetection = {
  1955. CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR$5,
  1956. REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT$1,
  1957. SUBCLASSING: SUBCLASSING
  1958. };
  1959. var PromiseCapability = function (C) {
  1960. var resolve, reject;
  1961. this.promise = new C(function ($$resolve, $$reject) {
  1962. if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
  1963. resolve = $$resolve;
  1964. reject = $$reject;
  1965. });
  1966. this.resolve = aCallable(resolve);
  1967. this.reject = aCallable(reject);
  1968. };
  1969. // `NewPromiseCapability` abstract operation
  1970. // https://tc39.es/ecma262/#sec-newpromisecapability
  1971. var f = function (C) {
  1972. return new PromiseCapability(C);
  1973. };
  1974. var newPromiseCapability$1 = {
  1975. f: f
  1976. };
  1977. var task = task$1.set;
  1978. var PROMISE = 'Promise';
  1979. var FORCED_PROMISE_CONSTRUCTOR$4 = promiseConstructorDetection.CONSTRUCTOR;
  1980. var NATIVE_PROMISE_REJECTION_EVENT = promiseConstructorDetection.REJECTION_EVENT;
  1981. var NATIVE_PROMISE_SUBCLASSING = promiseConstructorDetection.SUBCLASSING;
  1982. var getInternalPromiseState = internalState.getterFor(PROMISE);
  1983. var setInternalState = internalState.set;
  1984. var NativePromisePrototype$1 = promiseNativeConstructor && promiseNativeConstructor.prototype;
  1985. var PromiseConstructor = promiseNativeConstructor;
  1986. var PromisePrototype = NativePromisePrototype$1;
  1987. var TypeError$4 = global_1.TypeError;
  1988. var document$1 = global_1.document;
  1989. var process = global_1.process;
  1990. var newPromiseCapability = newPromiseCapability$1.f;
  1991. var newGenericPromiseCapability = newPromiseCapability;
  1992. var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && global_1.dispatchEvent);
  1993. var UNHANDLED_REJECTION = 'unhandledrejection';
  1994. var REJECTION_HANDLED = 'rejectionhandled';
  1995. var PENDING = 0;
  1996. var FULFILLED = 1;
  1997. var REJECTED = 2;
  1998. var HANDLED = 1;
  1999. var UNHANDLED = 2;
  2000. var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
  2001. // helpers
  2002. var isThenable = function (it) {
  2003. var then;
  2004. return isObject(it) && isCallable(then = it.then) ? then : false;
  2005. };
  2006. var callReaction = function (reaction, state) {
  2007. var value = state.value;
  2008. var ok = state.state == FULFILLED;
  2009. var handler = ok ? reaction.ok : reaction.fail;
  2010. var resolve = reaction.resolve;
  2011. var reject = reaction.reject;
  2012. var domain = reaction.domain;
  2013. var result, then, exited;
  2014. try {
  2015. if (handler) {
  2016. if (!ok) {
  2017. if (state.rejection === UNHANDLED) onHandleUnhandled(state);
  2018. state.rejection = HANDLED;
  2019. }
  2020. if (handler === true) result = value;
  2021. else {
  2022. if (domain) domain.enter();
  2023. result = handler(value); // can throw
  2024. if (domain) {
  2025. domain.exit();
  2026. exited = true;
  2027. }
  2028. }
  2029. if (result === reaction.promise) {
  2030. reject(TypeError$4('Promise-chain cycle'));
  2031. } else if (then = isThenable(result)) {
  2032. functionCall(then, result, resolve, reject);
  2033. } else resolve(result);
  2034. } else reject(value);
  2035. } catch (error) {
  2036. if (domain && !exited) domain.exit();
  2037. reject(error);
  2038. }
  2039. };
  2040. var notify = function (state, isReject) {
  2041. if (state.notified) return;
  2042. state.notified = true;
  2043. microtask(function () {
  2044. var reactions = state.reactions;
  2045. var reaction;
  2046. while (reaction = reactions.get()) {
  2047. callReaction(reaction, state);
  2048. }
  2049. state.notified = false;
  2050. if (isReject && !state.rejection) onUnhandled(state);
  2051. });
  2052. };
  2053. var dispatchEvent = function (name, promise, reason) {
  2054. var event, handler;
  2055. if (DISPATCH_EVENT) {
  2056. event = document$1.createEvent('Event');
  2057. event.promise = promise;
  2058. event.reason = reason;
  2059. event.initEvent(name, false, true);
  2060. global_1.dispatchEvent(event);
  2061. } else event = { promise: promise, reason: reason };
  2062. if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global_1['on' + name])) handler(event);
  2063. else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
  2064. };
  2065. var onUnhandled = function (state) {
  2066. functionCall(task, global_1, function () {
  2067. var promise = state.facade;
  2068. var value = state.value;
  2069. var IS_UNHANDLED = isUnhandled(state);
  2070. var result;
  2071. if (IS_UNHANDLED) {
  2072. result = perform(function () {
  2073. if (engineIsNode) {
  2074. process.emit('unhandledRejection', value, promise);
  2075. } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
  2076. });
  2077. // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
  2078. state.rejection = engineIsNode || isUnhandled(state) ? UNHANDLED : HANDLED;
  2079. if (result.error) throw result.value;
  2080. }
  2081. });
  2082. };
  2083. var isUnhandled = function (state) {
  2084. return state.rejection !== HANDLED && !state.parent;
  2085. };
  2086. var onHandleUnhandled = function (state) {
  2087. functionCall(task, global_1, function () {
  2088. var promise = state.facade;
  2089. if (engineIsNode) {
  2090. process.emit('rejectionHandled', promise);
  2091. } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
  2092. });
  2093. };
  2094. var bind = function (fn, state, unwrap) {
  2095. return function (value) {
  2096. fn(state, value, unwrap);
  2097. };
  2098. };
  2099. var internalReject = function (state, value, unwrap) {
  2100. if (state.done) return;
  2101. state.done = true;
  2102. if (unwrap) state = unwrap;
  2103. state.value = value;
  2104. state.state = REJECTED;
  2105. notify(state, true);
  2106. };
  2107. var internalResolve = function (state, value, unwrap) {
  2108. if (state.done) return;
  2109. state.done = true;
  2110. if (unwrap) state = unwrap;
  2111. try {
  2112. if (state.facade === value) throw TypeError$4("Promise can't be resolved itself");
  2113. var then = isThenable(value);
  2114. if (then) {
  2115. microtask(function () {
  2116. var wrapper = { done: false };
  2117. try {
  2118. functionCall(then, value,
  2119. bind(internalResolve, wrapper, state),
  2120. bind(internalReject, wrapper, state)
  2121. );
  2122. } catch (error) {
  2123. internalReject(wrapper, error, state);
  2124. }
  2125. });
  2126. } else {
  2127. state.value = value;
  2128. state.state = FULFILLED;
  2129. notify(state, false);
  2130. }
  2131. } catch (error) {
  2132. internalReject({ done: false }, error, state);
  2133. }
  2134. };
  2135. // constructor polyfill
  2136. if (FORCED_PROMISE_CONSTRUCTOR$4) {
  2137. // 25.4.3.1 Promise(executor)
  2138. PromiseConstructor = function Promise(executor) {
  2139. anInstance(this, PromisePrototype);
  2140. aCallable(executor);
  2141. functionCall(Internal, this);
  2142. var state = getInternalPromiseState(this);
  2143. try {
  2144. executor(bind(internalResolve, state), bind(internalReject, state));
  2145. } catch (error) {
  2146. internalReject(state, error);
  2147. }
  2148. };
  2149. PromisePrototype = PromiseConstructor.prototype;
  2150. // eslint-disable-next-line no-unused-vars -- required for `.length`
  2151. Internal = function Promise(executor) {
  2152. setInternalState(this, {
  2153. type: PROMISE,
  2154. done: false,
  2155. notified: false,
  2156. parent: false,
  2157. reactions: new queue(),
  2158. rejection: false,
  2159. state: PENDING,
  2160. value: undefined
  2161. });
  2162. };
  2163. // `Promise.prototype.then` method
  2164. // https://tc39.es/ecma262/#sec-promise.prototype.then
  2165. Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
  2166. var state = getInternalPromiseState(this);
  2167. var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
  2168. state.parent = true;
  2169. reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
  2170. reaction.fail = isCallable(onRejected) && onRejected;
  2171. reaction.domain = engineIsNode ? process.domain : undefined;
  2172. if (state.state == PENDING) state.reactions.add(reaction);
  2173. else microtask(function () {
  2174. callReaction(reaction, state);
  2175. });
  2176. return reaction.promise;
  2177. });
  2178. OwnPromiseCapability = function () {
  2179. var promise = new Internal();
  2180. var state = getInternalPromiseState(promise);
  2181. this.promise = promise;
  2182. this.resolve = bind(internalResolve, state);
  2183. this.reject = bind(internalReject, state);
  2184. };
  2185. newPromiseCapability$1.f = newPromiseCapability = function (C) {
  2186. return C === PromiseConstructor || C === PromiseWrapper
  2187. ? new OwnPromiseCapability(C)
  2188. : newGenericPromiseCapability(C);
  2189. };
  2190. if (isCallable(promiseNativeConstructor) && NativePromisePrototype$1 !== Object.prototype) {
  2191. nativeThen = NativePromisePrototype$1.then;
  2192. if (!NATIVE_PROMISE_SUBCLASSING) {
  2193. // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
  2194. defineBuiltIn(NativePromisePrototype$1, 'then', function then(onFulfilled, onRejected) {
  2195. var that = this;
  2196. return new PromiseConstructor(function (resolve, reject) {
  2197. functionCall(nativeThen, that, resolve, reject);
  2198. }).then(onFulfilled, onRejected);
  2199. // https://github.com/zloirock/core-js/issues/640
  2200. }, { unsafe: true });
  2201. }
  2202. // make `.constructor === Promise` work for native promise-based APIs
  2203. try {
  2204. delete NativePromisePrototype$1.constructor;
  2205. } catch (error) { /* empty */ }
  2206. // make `instanceof Promise` work for native promise-based APIs
  2207. if (objectSetPrototypeOf) {
  2208. objectSetPrototypeOf(NativePromisePrototype$1, PromisePrototype);
  2209. }
  2210. }
  2211. }
  2212. _export({ global: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, {
  2213. Promise: PromiseConstructor
  2214. });
  2215. setToStringTag(PromiseConstructor, PROMISE, false);
  2216. setSpecies(PROMISE);
  2217. var iterators = {};
  2218. var ITERATOR$2 = wellKnownSymbol('iterator');
  2219. var ArrayPrototype = Array.prototype;
  2220. // check on default Array iterator
  2221. var isArrayIteratorMethod = function (it) {
  2222. return it !== undefined && (iterators.Array === it || ArrayPrototype[ITERATOR$2] === it);
  2223. };
  2224. var ITERATOR$1 = wellKnownSymbol('iterator');
  2225. var getIteratorMethod = function (it) {
  2226. if (it != undefined) return getMethod(it, ITERATOR$1)
  2227. || getMethod(it, '@@iterator')
  2228. || iterators[classof(it)];
  2229. };
  2230. var TypeError$3 = global_1.TypeError;
  2231. var getIterator = function (argument, usingIterator) {
  2232. var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
  2233. if (aCallable(iteratorMethod)) return anObject(functionCall(iteratorMethod, argument));
  2234. throw TypeError$3(tryToString(argument) + ' is not iterable');
  2235. };
  2236. var iteratorClose = function (iterator, kind, value) {
  2237. var innerResult, innerError;
  2238. anObject(iterator);
  2239. try {
  2240. innerResult = getMethod(iterator, 'return');
  2241. if (!innerResult) {
  2242. if (kind === 'throw') throw value;
  2243. return value;
  2244. }
  2245. innerResult = functionCall(innerResult, iterator);
  2246. } catch (error) {
  2247. innerError = true;
  2248. innerResult = error;
  2249. }
  2250. if (kind === 'throw') throw value;
  2251. if (innerError) throw innerResult;
  2252. anObject(innerResult);
  2253. return value;
  2254. };
  2255. var TypeError$2 = global_1.TypeError;
  2256. var Result = function (stopped, result) {
  2257. this.stopped = stopped;
  2258. this.result = result;
  2259. };
  2260. var ResultPrototype = Result.prototype;
  2261. var iterate = function (iterable, unboundFunction, options) {
  2262. var that = options && options.that;
  2263. var AS_ENTRIES = !!(options && options.AS_ENTRIES);
  2264. var IS_ITERATOR = !!(options && options.IS_ITERATOR);
  2265. var INTERRUPTED = !!(options && options.INTERRUPTED);
  2266. var fn = functionBindContext(unboundFunction, that);
  2267. var iterator, iterFn, index, length, result, next, step;
  2268. var stop = function (condition) {
  2269. if (iterator) iteratorClose(iterator, 'normal', condition);
  2270. return new Result(true, condition);
  2271. };
  2272. var callFn = function (value) {
  2273. if (AS_ENTRIES) {
  2274. anObject(value);
  2275. return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
  2276. } return INTERRUPTED ? fn(value, stop) : fn(value);
  2277. };
  2278. if (IS_ITERATOR) {
  2279. iterator = iterable;
  2280. } else {
  2281. iterFn = getIteratorMethod(iterable);
  2282. if (!iterFn) throw TypeError$2(tryToString(iterable) + ' is not iterable');
  2283. // optimisation for array iterators
  2284. if (isArrayIteratorMethod(iterFn)) {
  2285. for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
  2286. result = callFn(iterable[index]);
  2287. if (result && objectIsPrototypeOf(ResultPrototype, result)) return result;
  2288. } return new Result(false);
  2289. }
  2290. iterator = getIterator(iterable, iterFn);
  2291. }
  2292. next = iterator.next;
  2293. while (!(step = functionCall(next, iterator)).done) {
  2294. try {
  2295. result = callFn(step.value);
  2296. } catch (error) {
  2297. iteratorClose(iterator, 'throw', error);
  2298. }
  2299. if (typeof result == 'object' && result && objectIsPrototypeOf(ResultPrototype, result)) return result;
  2300. } return new Result(false);
  2301. };
  2302. var ITERATOR = wellKnownSymbol('iterator');
  2303. var SAFE_CLOSING = false;
  2304. try {
  2305. var called = 0;
  2306. var iteratorWithReturn = {
  2307. next: function () {
  2308. return { done: !!called++ };
  2309. },
  2310. 'return': function () {
  2311. SAFE_CLOSING = true;
  2312. }
  2313. };
  2314. iteratorWithReturn[ITERATOR] = function () {
  2315. return this;
  2316. };
  2317. // eslint-disable-next-line es-x/no-array-from, no-throw-literal -- required for testing
  2318. Array.from(iteratorWithReturn, function () { throw 2; });
  2319. } catch (error) { /* empty */ }
  2320. var checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) {
  2321. if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
  2322. var ITERATION_SUPPORT = false;
  2323. try {
  2324. var object = {};
  2325. object[ITERATOR] = function () {
  2326. return {
  2327. next: function () {
  2328. return { done: ITERATION_SUPPORT = true };
  2329. }
  2330. };
  2331. };
  2332. exec(object);
  2333. } catch (error) { /* empty */ }
  2334. return ITERATION_SUPPORT;
  2335. };
  2336. var FORCED_PROMISE_CONSTRUCTOR$3 = promiseConstructorDetection.CONSTRUCTOR;
  2337. var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCorrectnessOfIteration(function (iterable) {
  2338. promiseNativeConstructor.all(iterable).then(undefined, function () { /* empty */ });
  2339. });
  2340. // `Promise.all` method
  2341. // https://tc39.es/ecma262/#sec-promise.all
  2342. _export({ target: 'Promise', stat: true, forced: promiseStaticsIncorrectIteration }, {
  2343. all: function all(iterable) {
  2344. var C = this;
  2345. var capability = newPromiseCapability$1.f(C);
  2346. var resolve = capability.resolve;
  2347. var reject = capability.reject;
  2348. var result = perform(function () {
  2349. var $promiseResolve = aCallable(C.resolve);
  2350. var values = [];
  2351. var counter = 0;
  2352. var remaining = 1;
  2353. iterate(iterable, function (promise) {
  2354. var index = counter++;
  2355. var alreadyCalled = false;
  2356. remaining++;
  2357. functionCall($promiseResolve, C, promise).then(function (value) {
  2358. if (alreadyCalled) return;
  2359. alreadyCalled = true;
  2360. values[index] = value;
  2361. --remaining || resolve(values);
  2362. }, reject);
  2363. });
  2364. --remaining || resolve(values);
  2365. });
  2366. if (result.error) reject(result.value);
  2367. return capability.promise;
  2368. }
  2369. });
  2370. var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
  2371. var NativePromisePrototype = promiseNativeConstructor && promiseNativeConstructor.prototype;
  2372. // `Promise.prototype.catch` method
  2373. // https://tc39.es/ecma262/#sec-promise.prototype.catch
  2374. _export({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, {
  2375. 'catch': function (onRejected) {
  2376. return this.then(undefined, onRejected);
  2377. }
  2378. });
  2379. // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
  2380. if (isCallable(promiseNativeConstructor)) {
  2381. var method = getBuiltIn('Promise').prototype['catch'];
  2382. if (NativePromisePrototype['catch'] !== method) {
  2383. defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
  2384. }
  2385. }
  2386. // `Promise.race` method
  2387. // https://tc39.es/ecma262/#sec-promise.race
  2388. _export({ target: 'Promise', stat: true, forced: promiseStaticsIncorrectIteration }, {
  2389. race: function race(iterable) {
  2390. var C = this;
  2391. var capability = newPromiseCapability$1.f(C);
  2392. var reject = capability.reject;
  2393. var result = perform(function () {
  2394. var $promiseResolve = aCallable(C.resolve);
  2395. iterate(iterable, function (promise) {
  2396. functionCall($promiseResolve, C, promise).then(capability.resolve, reject);
  2397. });
  2398. });
  2399. if (result.error) reject(result.value);
  2400. return capability.promise;
  2401. }
  2402. });
  2403. var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR;
  2404. // `Promise.reject` method
  2405. // https://tc39.es/ecma262/#sec-promise.reject
  2406. _export({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
  2407. reject: function reject(r) {
  2408. var capability = newPromiseCapability$1.f(this);
  2409. functionCall(capability.reject, undefined, r);
  2410. return capability.promise;
  2411. }
  2412. });
  2413. var promiseResolve = function (C, x) {
  2414. anObject(C);
  2415. if (isObject(x) && x.constructor === C) return x;
  2416. var promiseCapability = newPromiseCapability$1.f(C);
  2417. var resolve = promiseCapability.resolve;
  2418. resolve(x);
  2419. return promiseCapability.promise;
  2420. };
  2421. var FORCED_PROMISE_CONSTRUCTOR = promiseConstructorDetection.CONSTRUCTOR;
  2422. getBuiltIn('Promise');
  2423. // `Promise.resolve` method
  2424. // https://tc39.es/ecma262/#sec-promise.resolve
  2425. _export({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
  2426. resolve: function resolve(x) {
  2427. return promiseResolve(this, x);
  2428. }
  2429. });
  2430. var PROPER_FUNCTION_NAME = functionName.PROPER;
  2431. var non = '\u200B\u0085\u180E';
  2432. // check that a method works with the correct list
  2433. // of whitespaces and has a correct name
  2434. var stringTrimForced = function (METHOD_NAME) {
  2435. return fails(function () {
  2436. return !!whitespaces[METHOD_NAME]()
  2437. || non[METHOD_NAME]() !== non
  2438. || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);
  2439. });
  2440. };
  2441. var $trim = stringTrim.trim;
  2442. // `String.prototype.trim` method
  2443. // https://tc39.es/ecma262/#sec-string.prototype.trim
  2444. _export({ target: 'String', proto: true, forced: stringTrimForced('trim') }, {
  2445. trim: function trim() {
  2446. return $trim(this);
  2447. }
  2448. });
  2449. var Array$1 = global_1.Array;
  2450. var max$1 = Math.max;
  2451. var arraySliceSimple = function (O, start, end) {
  2452. var length = lengthOfArrayLike(O);
  2453. var k = toAbsoluteIndex(start, length);
  2454. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  2455. var result = Array$1(max$1(fin - k, 0));
  2456. for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
  2457. result.length = n;
  2458. return result;
  2459. };
  2460. var floor$1 = Math.floor;
  2461. var mergeSort = function (array, comparefn) {
  2462. var length = array.length;
  2463. var middle = floor$1(length / 2);
  2464. return length < 8 ? insertionSort(array, comparefn) : merge(
  2465. array,
  2466. mergeSort(arraySliceSimple(array, 0, middle), comparefn),
  2467. mergeSort(arraySliceSimple(array, middle), comparefn),
  2468. comparefn
  2469. );
  2470. };
  2471. var insertionSort = function (array, comparefn) {
  2472. var length = array.length;
  2473. var i = 1;
  2474. var element, j;
  2475. while (i < length) {
  2476. j = i;
  2477. element = array[i];
  2478. while (j && comparefn(array[j - 1], element) > 0) {
  2479. array[j] = array[--j];
  2480. }
  2481. if (j !== i++) array[j] = element;
  2482. } return array;
  2483. };
  2484. var merge = function (array, left, right, comparefn) {
  2485. var llength = left.length;
  2486. var rlength = right.length;
  2487. var lindex = 0;
  2488. var rindex = 0;
  2489. while (lindex < llength || rindex < rlength) {
  2490. array[lindex + rindex] = (lindex < llength && rindex < rlength)
  2491. ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
  2492. : lindex < llength ? left[lindex++] : right[rindex++];
  2493. } return array;
  2494. };
  2495. var arraySort = mergeSort;
  2496. var firefox = engineUserAgent.match(/firefox\/(\d+)/i);
  2497. var engineFfVersion = !!firefox && +firefox[1];
  2498. var engineIsIeOrEdge = /MSIE|Trident/.test(engineUserAgent);
  2499. var webkit = engineUserAgent.match(/AppleWebKit\/(\d+)\./);
  2500. var engineWebkitVersion = !!webkit && +webkit[1];
  2501. var test = [];
  2502. var un$Sort = functionUncurryThis(test.sort);
  2503. var push$2 = functionUncurryThis(test.push);
  2504. // IE8-
  2505. var FAILS_ON_UNDEFINED = fails(function () {
  2506. test.sort(undefined);
  2507. });
  2508. // V8 bug
  2509. var FAILS_ON_NULL = fails(function () {
  2510. test.sort(null);
  2511. });
  2512. // Old WebKit
  2513. var STRICT_METHOD$1 = arrayMethodIsStrict('sort');
  2514. var STABLE_SORT = !fails(function () {
  2515. // feature detection can be too slow, so check engines versions
  2516. if (engineV8Version) return engineV8Version < 70;
  2517. if (engineFfVersion && engineFfVersion > 3) return;
  2518. if (engineIsIeOrEdge) return true;
  2519. if (engineWebkitVersion) return engineWebkitVersion < 603;
  2520. var result = '';
  2521. var code, chr, value, index;
  2522. // generate an array with more 512 elements (Chakra and old V8 fails only in this case)
  2523. for (code = 65; code < 76; code++) {
  2524. chr = String.fromCharCode(code);
  2525. switch (code) {
  2526. case 66: case 69: case 70: case 72: value = 3; break;
  2527. case 68: case 71: value = 4; break;
  2528. default: value = 2;
  2529. }
  2530. for (index = 0; index < 47; index++) {
  2531. test.push({ k: chr + index, v: value });
  2532. }
  2533. }
  2534. test.sort(function (a, b) { return b.v - a.v; });
  2535. for (index = 0; index < test.length; index++) {
  2536. chr = test[index].k.charAt(0);
  2537. if (result.charAt(result.length - 1) !== chr) result += chr;
  2538. }
  2539. return result !== 'DGBEFHACIJK';
  2540. });
  2541. var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD$1 || !STABLE_SORT;
  2542. var getSortCompare = function (comparefn) {
  2543. return function (x, y) {
  2544. if (y === undefined) return -1;
  2545. if (x === undefined) return 1;
  2546. if (comparefn !== undefined) return +comparefn(x, y) || 0;
  2547. return toString_1(x) > toString_1(y) ? 1 : -1;
  2548. };
  2549. };
  2550. // `Array.prototype.sort` method
  2551. // https://tc39.es/ecma262/#sec-array.prototype.sort
  2552. _export({ target: 'Array', proto: true, forced: FORCED }, {
  2553. sort: function sort(comparefn) {
  2554. if (comparefn !== undefined) aCallable(comparefn);
  2555. var array = toObject(this);
  2556. if (STABLE_SORT) return comparefn === undefined ? un$Sort(array) : un$Sort(array, comparefn);
  2557. var items = [];
  2558. var arrayLength = lengthOfArrayLike(array);
  2559. var itemsLength, index;
  2560. for (index = 0; index < arrayLength; index++) {
  2561. if (index in array) push$2(items, array[index]);
  2562. }
  2563. arraySort(items, getSortCompare(comparefn));
  2564. itemsLength = items.length;
  2565. index = 0;
  2566. while (index < itemsLength) array[index] = items[index++];
  2567. while (index < arrayLength) delete array[index++];
  2568. return array;
  2569. }
  2570. });
  2571. // TODO: Remove from `core-js@4` since it's moved to entry points
  2572. var SPECIES = wellKnownSymbol('species');
  2573. var RegExpPrototype = RegExp.prototype;
  2574. var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
  2575. var SYMBOL = wellKnownSymbol(KEY);
  2576. var DELEGATES_TO_SYMBOL = !fails(function () {
  2577. // String methods call symbol-named RegEp methods
  2578. var O = {};
  2579. O[SYMBOL] = function () { return 7; };
  2580. return ''[KEY](O) != 7;
  2581. });
  2582. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  2583. // Symbol-named RegExp methods call .exec
  2584. var execCalled = false;
  2585. var re = /a/;
  2586. if (KEY === 'split') {
  2587. // We can't use real regex here since it causes deoptimization
  2588. // and serious performance degradation in V8
  2589. // https://github.com/zloirock/core-js/issues/306
  2590. re = {};
  2591. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  2592. // a new one. We need to return the patched regex when creating the new one.
  2593. re.constructor = {};
  2594. re.constructor[SPECIES] = function () { return re; };
  2595. re.flags = '';
  2596. re[SYMBOL] = /./[SYMBOL];
  2597. }
  2598. re.exec = function () { execCalled = true; return null; };
  2599. re[SYMBOL]('');
  2600. return !execCalled;
  2601. });
  2602. if (
  2603. !DELEGATES_TO_SYMBOL ||
  2604. !DELEGATES_TO_EXEC ||
  2605. FORCED
  2606. ) {
  2607. var uncurriedNativeRegExpMethod = functionUncurryThis(/./[SYMBOL]);
  2608. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  2609. var uncurriedNativeMethod = functionUncurryThis(nativeMethod);
  2610. var $exec = regexp.exec;
  2611. if ($exec === regexpExec || $exec === RegExpPrototype.exec) {
  2612. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  2613. // The native String method already delegates to @@method (this
  2614. // polyfilled function), leasing to infinite recursion.
  2615. // We avoid it by directly calling the native @@method method.
  2616. return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
  2617. }
  2618. return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
  2619. }
  2620. return { done: false };
  2621. });
  2622. defineBuiltIn(String.prototype, KEY, methods[0]);
  2623. defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]);
  2624. }
  2625. if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
  2626. };
  2627. var charAt$2 = functionUncurryThis(''.charAt);
  2628. var charCodeAt = functionUncurryThis(''.charCodeAt);
  2629. var stringSlice$3 = functionUncurryThis(''.slice);
  2630. var createMethod = function (CONVERT_TO_STRING) {
  2631. return function ($this, pos) {
  2632. var S = toString_1(requireObjectCoercible($this));
  2633. var position = toIntegerOrInfinity(pos);
  2634. var size = S.length;
  2635. var first, second;
  2636. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  2637. first = charCodeAt(S, position);
  2638. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  2639. || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
  2640. ? CONVERT_TO_STRING
  2641. ? charAt$2(S, position)
  2642. : first
  2643. : CONVERT_TO_STRING
  2644. ? stringSlice$3(S, position, position + 2)
  2645. : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  2646. };
  2647. };
  2648. var stringMultibyte = {
  2649. // `String.prototype.codePointAt` method
  2650. // https://tc39.es/ecma262/#sec-string.prototype.codepointat
  2651. codeAt: createMethod(false),
  2652. // `String.prototype.at` method
  2653. // https://github.com/mathiasbynens/String.prototype.at
  2654. charAt: createMethod(true)
  2655. };
  2656. var charAt$1 = stringMultibyte.charAt;
  2657. // `AdvanceStringIndex` abstract operation
  2658. // https://tc39.es/ecma262/#sec-advancestringindex
  2659. var advanceStringIndex = function (S, index, unicode) {
  2660. return index + (unicode ? charAt$1(S, index).length : 1);
  2661. };
  2662. var floor = Math.floor;
  2663. var charAt = functionUncurryThis(''.charAt);
  2664. var replace = functionUncurryThis(''.replace);
  2665. var stringSlice$2 = functionUncurryThis(''.slice);
  2666. var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
  2667. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
  2668. // `GetSubstitution` abstract operation
  2669. // https://tc39.es/ecma262/#sec-getsubstitution
  2670. var getSubstitution = function (matched, str, position, captures, namedCaptures, replacement) {
  2671. var tailPos = position + matched.length;
  2672. var m = captures.length;
  2673. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  2674. if (namedCaptures !== undefined) {
  2675. namedCaptures = toObject(namedCaptures);
  2676. symbols = SUBSTITUTION_SYMBOLS;
  2677. }
  2678. return replace(replacement, symbols, function (match, ch) {
  2679. var capture;
  2680. switch (charAt(ch, 0)) {
  2681. case '$': return '$';
  2682. case '&': return matched;
  2683. case '`': return stringSlice$2(str, 0, position);
  2684. case "'": return stringSlice$2(str, tailPos);
  2685. case '<':
  2686. capture = namedCaptures[stringSlice$2(ch, 1, -1)];
  2687. break;
  2688. default: // \d\d?
  2689. var n = +ch;
  2690. if (n === 0) return match;
  2691. if (n > m) {
  2692. var f = floor(n / 10);
  2693. if (f === 0) return match;
  2694. if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
  2695. return match;
  2696. }
  2697. capture = captures[n - 1];
  2698. }
  2699. return capture === undefined ? '' : capture;
  2700. });
  2701. };
  2702. var TypeError$1 = global_1.TypeError;
  2703. // `RegExpExec` abstract operation
  2704. // https://tc39.es/ecma262/#sec-regexpexec
  2705. var regexpExecAbstract = function (R, S) {
  2706. var exec = R.exec;
  2707. if (isCallable(exec)) {
  2708. var result = functionCall(exec, R, S);
  2709. if (result !== null) anObject(result);
  2710. return result;
  2711. }
  2712. if (classofRaw(R) === 'RegExp') return functionCall(regexpExec, R, S);
  2713. throw TypeError$1('RegExp#exec called on incompatible receiver');
  2714. };
  2715. var REPLACE = wellKnownSymbol('replace');
  2716. var max = Math.max;
  2717. var min$1 = Math.min;
  2718. var concat = functionUncurryThis([].concat);
  2719. var push$1 = functionUncurryThis([].push);
  2720. var stringIndexOf = functionUncurryThis(''.indexOf);
  2721. var stringSlice$1 = functionUncurryThis(''.slice);
  2722. var maybeToString = function (it) {
  2723. return it === undefined ? it : String(it);
  2724. };
  2725. // IE <= 11 replaces $0 with the whole match, as if it was $&
  2726. // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
  2727. var REPLACE_KEEPS_$0 = (function () {
  2728. // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
  2729. return 'a'.replace(/./, '$0') === '$0';
  2730. })();
  2731. // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
  2732. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
  2733. if (/./[REPLACE]) {
  2734. return /./[REPLACE]('a', '$0') === '';
  2735. }
  2736. return false;
  2737. })();
  2738. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  2739. var re = /./;
  2740. re.exec = function () {
  2741. var result = [];
  2742. result.groups = { a: '7' };
  2743. return result;
  2744. };
  2745. // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
  2746. return ''.replace(re, '$<a>') !== '7';
  2747. });
  2748. // @@replace logic
  2749. fixRegexpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
  2750. var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
  2751. return [
  2752. // `String.prototype.replace` method
  2753. // https://tc39.es/ecma262/#sec-string.prototype.replace
  2754. function replace(searchValue, replaceValue) {
  2755. var O = requireObjectCoercible(this);
  2756. var replacer = searchValue == undefined ? undefined : getMethod(searchValue, REPLACE);
  2757. return replacer
  2758. ? functionCall(replacer, searchValue, O, replaceValue)
  2759. : functionCall(nativeReplace, toString_1(O), searchValue, replaceValue);
  2760. },
  2761. // `RegExp.prototype[@@replace]` method
  2762. // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
  2763. function (string, replaceValue) {
  2764. var rx = anObject(this);
  2765. var S = toString_1(string);
  2766. if (
  2767. typeof replaceValue == 'string' &&
  2768. stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
  2769. stringIndexOf(replaceValue, '$<') === -1
  2770. ) {
  2771. var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
  2772. if (res.done) return res.value;
  2773. }
  2774. var functionalReplace = isCallable(replaceValue);
  2775. if (!functionalReplace) replaceValue = toString_1(replaceValue);
  2776. var global = rx.global;
  2777. if (global) {
  2778. var fullUnicode = rx.unicode;
  2779. rx.lastIndex = 0;
  2780. }
  2781. var results = [];
  2782. while (true) {
  2783. var result = regexpExecAbstract(rx, S);
  2784. if (result === null) break;
  2785. push$1(results, result);
  2786. if (!global) break;
  2787. var matchStr = toString_1(result[0]);
  2788. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  2789. }
  2790. var accumulatedResult = '';
  2791. var nextSourcePosition = 0;
  2792. for (var i = 0; i < results.length; i++) {
  2793. result = results[i];
  2794. var matched = toString_1(result[0]);
  2795. var position = max(min$1(toIntegerOrInfinity(result.index), S.length), 0);
  2796. var captures = [];
  2797. // NOTE: This is equivalent to
  2798. // captures = result.slice(1).map(maybeToString)
  2799. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  2800. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  2801. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  2802. for (var j = 1; j < result.length; j++) push$1(captures, maybeToString(result[j]));
  2803. var namedCaptures = result.groups;
  2804. if (functionalReplace) {
  2805. var replacerArgs = concat([matched], captures, position, S);
  2806. if (namedCaptures !== undefined) push$1(replacerArgs, namedCaptures);
  2807. var replacement = toString_1(functionApply(replaceValue, undefined, replacerArgs));
  2808. } else {
  2809. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  2810. }
  2811. if (position >= nextSourcePosition) {
  2812. accumulatedResult += stringSlice$1(S, nextSourcePosition, position) + replacement;
  2813. nextSourcePosition = position + matched.length;
  2814. }
  2815. }
  2816. return accumulatedResult + stringSlice$1(S, nextSourcePosition);
  2817. }
  2818. ];
  2819. }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
  2820. // @@match logic
  2821. fixRegexpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {
  2822. return [
  2823. // `String.prototype.match` method
  2824. // https://tc39.es/ecma262/#sec-string.prototype.match
  2825. function match(regexp) {
  2826. var O = requireObjectCoercible(this);
  2827. var matcher = regexp == undefined ? undefined : getMethod(regexp, MATCH);
  2828. return matcher ? functionCall(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString_1(O));
  2829. },
  2830. // `RegExp.prototype[@@match]` method
  2831. // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
  2832. function (string) {
  2833. var rx = anObject(this);
  2834. var S = toString_1(string);
  2835. var res = maybeCallNative(nativeMatch, rx, S);
  2836. if (res.done) return res.value;
  2837. if (!rx.global) return regexpExecAbstract(rx, S);
  2838. var fullUnicode = rx.unicode;
  2839. rx.lastIndex = 0;
  2840. var A = [];
  2841. var n = 0;
  2842. var result;
  2843. while ((result = regexpExecAbstract(rx, S)) !== null) {
  2844. var matchStr = toString_1(result[0]);
  2845. A[n] = matchStr;
  2846. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  2847. n++;
  2848. }
  2849. return n === 0 ? null : A;
  2850. }
  2851. ];
  2852. });
  2853. var UNSUPPORTED_Y = regexpStickyHelpers.UNSUPPORTED_Y;
  2854. var MAX_UINT32 = 0xFFFFFFFF;
  2855. var min = Math.min;
  2856. var $push = [].push;
  2857. var exec = functionUncurryThis(/./.exec);
  2858. var push = functionUncurryThis($push);
  2859. var stringSlice = functionUncurryThis(''.slice);
  2860. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  2861. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  2862. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  2863. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  2864. var re = /(?:)/;
  2865. var originalExec = re.exec;
  2866. re.exec = function () { return originalExec.apply(this, arguments); };
  2867. var result = 'ab'.split(re);
  2868. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  2869. });
  2870. // @@split logic
  2871. fixRegexpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {
  2872. var internalSplit;
  2873. if (
  2874. 'abbc'.split(/(b)*/)[1] == 'c' ||
  2875. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  2876. 'test'.split(/(?:)/, -1).length != 4 ||
  2877. 'ab'.split(/(?:ab)*/).length != 2 ||
  2878. '.'.split(/(.?)(.?)/).length != 4 ||
  2879. // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
  2880. '.'.split(/()()/).length > 1 ||
  2881. ''.split(/.?/).length
  2882. ) {
  2883. // based on es5-shim implementation, need to rework it
  2884. internalSplit = function (separator, limit) {
  2885. var string = toString_1(requireObjectCoercible(this));
  2886. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  2887. if (lim === 0) return [];
  2888. if (separator === undefined) return [string];
  2889. // If `separator` is not a regex, use native split
  2890. if (!isRegexp(separator)) {
  2891. return functionCall(nativeSplit, string, separator, lim);
  2892. }
  2893. var output = [];
  2894. var flags = (separator.ignoreCase ? 'i' : '') +
  2895. (separator.multiline ? 'm' : '') +
  2896. (separator.unicode ? 'u' : '') +
  2897. (separator.sticky ? 'y' : '');
  2898. var lastLastIndex = 0;
  2899. // Make `global` and avoid `lastIndex` issues by working with a copy
  2900. var separatorCopy = new RegExp(separator.source, flags + 'g');
  2901. var match, lastIndex, lastLength;
  2902. while (match = functionCall(regexpExec, separatorCopy, string)) {
  2903. lastIndex = separatorCopy.lastIndex;
  2904. if (lastIndex > lastLastIndex) {
  2905. push(output, stringSlice(string, lastLastIndex, match.index));
  2906. if (match.length > 1 && match.index < string.length) functionApply($push, output, arraySliceSimple(match, 1));
  2907. lastLength = match[0].length;
  2908. lastLastIndex = lastIndex;
  2909. if (output.length >= lim) break;
  2910. }
  2911. if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
  2912. }
  2913. if (lastLastIndex === string.length) {
  2914. if (lastLength || !exec(separatorCopy, '')) push(output, '');
  2915. } else push(output, stringSlice(string, lastLastIndex));
  2916. return output.length > lim ? arraySliceSimple(output, 0, lim) : output;
  2917. };
  2918. // Chakra, V8
  2919. } else if ('0'.split(undefined, 0).length) {
  2920. internalSplit = function (separator, limit) {
  2921. return separator === undefined && limit === 0 ? [] : functionCall(nativeSplit, this, separator, limit);
  2922. };
  2923. } else internalSplit = nativeSplit;
  2924. return [
  2925. // `String.prototype.split` method
  2926. // https://tc39.es/ecma262/#sec-string.prototype.split
  2927. function split(separator, limit) {
  2928. var O = requireObjectCoercible(this);
  2929. var splitter = separator == undefined ? undefined : getMethod(separator, SPLIT);
  2930. return splitter
  2931. ? functionCall(splitter, separator, O, limit)
  2932. : functionCall(internalSplit, toString_1(O), separator, limit);
  2933. },
  2934. // `RegExp.prototype[@@split]` method
  2935. // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
  2936. //
  2937. // NOTE: This cannot be properly polyfilled in engines that don't support
  2938. // the 'y' flag.
  2939. function (string, limit) {
  2940. var rx = anObject(this);
  2941. var S = toString_1(string);
  2942. var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
  2943. if (res.done) return res.value;
  2944. var C = speciesConstructor(rx, RegExp);
  2945. var unicodeMatching = rx.unicode;
  2946. var flags = (rx.ignoreCase ? 'i' : '') +
  2947. (rx.multiline ? 'm' : '') +
  2948. (rx.unicode ? 'u' : '') +
  2949. (UNSUPPORTED_Y ? 'g' : 'y');
  2950. // ^(? + rx + ) is needed, in combination with some S slicing, to
  2951. // simulate the 'y' flag.
  2952. var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
  2953. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  2954. if (lim === 0) return [];
  2955. if (S.length === 0) return regexpExecAbstract(splitter, S) === null ? [S] : [];
  2956. var p = 0;
  2957. var q = 0;
  2958. var A = [];
  2959. while (q < S.length) {
  2960. splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
  2961. var z = regexpExecAbstract(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S);
  2962. var e;
  2963. if (
  2964. z === null ||
  2965. (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p
  2966. ) {
  2967. q = advanceStringIndex(S, q, unicodeMatching);
  2968. } else {
  2969. push(A, stringSlice(S, p, q));
  2970. if (A.length === lim) return A;
  2971. for (var i = 1; i <= z.length - 1; i++) {
  2972. push(A, z[i]);
  2973. if (A.length === lim) return A;
  2974. }
  2975. q = p = e;
  2976. }
  2977. }
  2978. push(A, stringSlice(S, p));
  2979. return A;
  2980. }
  2981. ];
  2982. }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
  2983. var un$Join = functionUncurryThis([].join);
  2984. var ES3_STRINGS = indexedObject != Object;
  2985. var STRICT_METHOD = arrayMethodIsStrict('join', ',');
  2986. // `Array.prototype.join` method
  2987. // https://tc39.es/ecma262/#sec-array.prototype.join
  2988. _export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
  2989. join: function join(separator) {
  2990. return un$Join(toIndexedObject(this), separator === undefined ? ',' : separator);
  2991. }
  2992. });
  2993. /* eslint-disable no-use-before-define */
  2994. var Utils$1 = $__default["default"].fn.bootstrapTable.utils;
  2995. var searchControls = 'select, input:not([type="checkbox"]):not([type="radio"])';
  2996. function getInputClass(that) {
  2997. var isSelect = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  2998. var formControlClass = isSelect ? that.constants.classes.select : that.constants.classes.input;
  2999. return that.options.iconSize ? Utils$1.sprintf('%s-%s', formControlClass, that.options.iconSize) : formControlClass;
  3000. }
  3001. function getOptionsFromSelectControl(selectControl) {
  3002. return selectControl[0].options;
  3003. }
  3004. function getControlContainer(that) {
  3005. if (that.options.filterControlContainer) {
  3006. return $__default["default"]("".concat(that.options.filterControlContainer));
  3007. }
  3008. if (that.options.height && that._initialized) {
  3009. return $__default["default"]('.fixed-table-header table thead');
  3010. }
  3011. return that.$header;
  3012. }
  3013. function isKeyAllowed(keyCode) {
  3014. return $__default["default"].inArray(keyCode, [37, 38, 39, 40]) > -1;
  3015. }
  3016. function getSearchControls(that) {
  3017. return getControlContainer(that).find(searchControls);
  3018. }
  3019. function existOptionInSelectControl(selectControl, value) {
  3020. var options = getOptionsFromSelectControl(selectControl);
  3021. for (var i = 0; i < options.length; i++) {
  3022. if (options[i].value === Utils$1.unescapeHTML(value)) {
  3023. // The value is not valid to add
  3024. return true;
  3025. }
  3026. } // If we get here, the value is valid to add
  3027. return false;
  3028. }
  3029. function addOptionToSelectControl(selectControl, _value, text, selected, shouldCompareText) {
  3030. var value = _value === undefined || _value === null ? '' : _value.toString().trim();
  3031. value = Utils$1.removeHTML(value);
  3032. text = Utils$1.removeHTML(text);
  3033. if (existOptionInSelectControl(selectControl, value)) {
  3034. return;
  3035. }
  3036. var isSelected = shouldCompareText ? value === selected || text === selected : value === selected;
  3037. var option = new Option(text, value, false, isSelected);
  3038. selectControl.get(0).add(option);
  3039. }
  3040. function sortSelectControl(selectControl, orderBy) {
  3041. var $selectControl = selectControl.get(0);
  3042. if (orderBy === 'server') {
  3043. return;
  3044. }
  3045. var tmpAry = new Array();
  3046. for (var i = 0; i < $selectControl.options.length; i++) {
  3047. tmpAry[i] = new Array();
  3048. tmpAry[i][0] = $selectControl.options[i].text;
  3049. tmpAry[i][1] = $selectControl.options[i].value;
  3050. tmpAry[i][2] = $selectControl.options[i].selected;
  3051. }
  3052. tmpAry.sort(function (a, b) {
  3053. return Utils$1.sort(a[0], b[0], orderBy === 'desc' ? -1 : 1);
  3054. });
  3055. while ($selectControl.options.length > 0) {
  3056. $selectControl.options[0] = null;
  3057. }
  3058. for (var _i = 0; _i < tmpAry.length; _i++) {
  3059. var op = new Option(tmpAry[_i][0], tmpAry[_i][1], false, tmpAry[_i][2]);
  3060. $selectControl.add(op);
  3061. }
  3062. }
  3063. function fixHeaderCSS(_ref) {
  3064. var $tableHeader = _ref.$tableHeader;
  3065. $tableHeader.css('height', $tableHeader.find('table').outerHeight(true));
  3066. }
  3067. function getElementClass($element) {
  3068. return $element.attr('class').replace('form-control', '').replace('focus-temp', '').replace('search-input', '').trim();
  3069. }
  3070. function getCursorPosition(el) {
  3071. if ($__default["default"](el).is('input[type=search]')) {
  3072. var pos = 0;
  3073. if ('selectionStart' in el) {
  3074. pos = el.selectionStart;
  3075. } else if ('selection' in document) {
  3076. el.focus();
  3077. var Sel = document.selection.createRange();
  3078. var SelLength = document.selection.createRange().text.length;
  3079. Sel.moveStart('character', -el.value.length);
  3080. pos = Sel.text.length - SelLength;
  3081. }
  3082. return pos;
  3083. }
  3084. return -1;
  3085. }
  3086. function cacheValues(that) {
  3087. var searchControls = getSearchControls(that);
  3088. that._valuesFilterControl = [];
  3089. searchControls.each(function () {
  3090. var $field = $__default["default"](this);
  3091. var fieldClass = getElementClass($field);
  3092. if (that.options.height && !that.options.filterControlContainer) {
  3093. $field = $__default["default"](".fixed-table-header .".concat(fieldClass));
  3094. } else if (that.options.filterControlContainer) {
  3095. $field = $__default["default"]("".concat(that.options.filterControlContainer, " .").concat(fieldClass));
  3096. } else {
  3097. $field = $__default["default"](".".concat(fieldClass));
  3098. }
  3099. that._valuesFilterControl.push({
  3100. field: $field.closest('[data-field]').data('field'),
  3101. value: $field.val(),
  3102. position: getCursorPosition($field.get(0)),
  3103. hasFocus: $field.is(':focus')
  3104. });
  3105. });
  3106. }
  3107. function setCaretPosition(elem, caretPos) {
  3108. try {
  3109. if (elem) {
  3110. if (elem.createTextRange) {
  3111. var range = elem.createTextRange();
  3112. range.move('character', caretPos);
  3113. range.select();
  3114. } else {
  3115. elem.setSelectionRange(caretPos, caretPos);
  3116. }
  3117. }
  3118. } catch (ex) {// ignored
  3119. }
  3120. }
  3121. function setValues(that) {
  3122. var field = null;
  3123. var result = [];
  3124. var searchControls = getSearchControls(that);
  3125. if (that._valuesFilterControl.length > 0) {
  3126. // Callback to apply after settings fields values
  3127. var callbacks = [];
  3128. searchControls.each(function (i, el) {
  3129. var $this = $__default["default"](el);
  3130. field = $this.closest('[data-field]').data('field');
  3131. result = that._valuesFilterControl.filter(function (valueObj) {
  3132. return valueObj.field === field;
  3133. });
  3134. if (result.length > 0) {
  3135. if (result[0].hasFocus || result[0].value) {
  3136. var fieldToFocusCallback = function (element, cacheElementInfo) {
  3137. // Closure here to capture the field information
  3138. var closedCallback = function closedCallback() {
  3139. if (cacheElementInfo.hasFocus) {
  3140. element.focus();
  3141. }
  3142. if (Array.isArray(cacheElementInfo.value)) {
  3143. var $element = $__default["default"](element);
  3144. $__default["default"].each(cacheElementInfo.value, function (i, e) {
  3145. $element.find(Utils$1.sprintf('option[value=\'%s\']', e)).prop('selected', true);
  3146. });
  3147. } else {
  3148. element.value = cacheElementInfo.value;
  3149. }
  3150. setCaretPosition(element, cacheElementInfo.position);
  3151. };
  3152. return closedCallback;
  3153. }($this.get(0), result[0]);
  3154. callbacks.push(fieldToFocusCallback);
  3155. }
  3156. }
  3157. }); // Callback call.
  3158. if (callbacks.length > 0) {
  3159. callbacks.forEach(function (callback) {
  3160. return callback();
  3161. });
  3162. }
  3163. }
  3164. }
  3165. function collectBootstrapTableFilterCookies() {
  3166. var cookies = [];
  3167. var foundCookies = document.cookie.match(/bs\.table\.(filterControl|searchText)/g);
  3168. var foundLocalStorage = localStorage;
  3169. if (foundCookies) {
  3170. $__default["default"].each(foundCookies, function (i, _cookie) {
  3171. var cookie = _cookie;
  3172. if (/./.test(cookie)) {
  3173. cookie = cookie.split('.').pop();
  3174. }
  3175. if ($__default["default"].inArray(cookie, cookies) === -1) {
  3176. cookies.push(cookie);
  3177. }
  3178. });
  3179. }
  3180. if (foundLocalStorage) {
  3181. for (var i = 0; i < foundLocalStorage.length; i++) {
  3182. var cookie = foundLocalStorage.key(i);
  3183. if (/./.test(cookie)) {
  3184. cookie = cookie.split('.').pop();
  3185. }
  3186. if (!cookies.includes(cookie)) {
  3187. cookies.push(cookie);
  3188. }
  3189. }
  3190. }
  3191. return cookies;
  3192. }
  3193. function escapeID(id) {
  3194. // eslint-disable-next-line no-useless-escape
  3195. return String(id).replace(/([:.\[\],])/g, '\\$1');
  3196. }
  3197. function isColumnSearchableViaSelect(_ref2) {
  3198. var filterControl = _ref2.filterControl,
  3199. searchable = _ref2.searchable;
  3200. return filterControl && filterControl.toLowerCase() === 'select' && searchable;
  3201. }
  3202. function isFilterDataNotGiven(_ref3) {
  3203. var filterData = _ref3.filterData;
  3204. return filterData === undefined || filterData.toLowerCase() === 'column';
  3205. }
  3206. function hasSelectControlElement(selectControl) {
  3207. return selectControl && selectControl.length > 0;
  3208. }
  3209. function initFilterSelectControls(that) {
  3210. var data = that.options.data;
  3211. $__default["default"].each(that.header.fields, function (j, field) {
  3212. var column = that.columns[that.fieldsColumnsIndex[field]];
  3213. var selectControl = getControlContainer(that).find("select.bootstrap-table-filter-control-".concat(escapeID(column.field)));
  3214. if (isColumnSearchableViaSelect(column) && isFilterDataNotGiven(column) && hasSelectControlElement(selectControl)) {
  3215. if (!selectControl[0].multiple && selectControl.get(selectControl.length - 1).options.length === 0) {
  3216. // Added the default option, must use a non-breaking space(&nbsp;) to pass the W3C validator
  3217. addOptionToSelectControl(selectControl, '', column.filterControlPlaceholder || ' ', column.filterDefault);
  3218. }
  3219. var uniqueValues = {};
  3220. for (var i = 0; i < data.length; i++) {
  3221. // Added a new value
  3222. var fieldValue = Utils$1.getItemField(data[i], field, false);
  3223. var formatter = that.options.editable && column.editable ? column._formatter : that.header.formatters[j];
  3224. var formattedValue = Utils$1.calculateObjectValue(that.header, formatter, [fieldValue, data[i], i], fieldValue);
  3225. if (!fieldValue) {
  3226. fieldValue = formattedValue;
  3227. column._forceFormatter = true;
  3228. }
  3229. if (column.filterDataCollector) {
  3230. formattedValue = Utils$1.calculateObjectValue(that.header, column.filterDataCollector, [fieldValue, data[i], formattedValue], formattedValue);
  3231. }
  3232. if (column.searchFormatter) {
  3233. fieldValue = formattedValue;
  3234. }
  3235. uniqueValues[formattedValue] = fieldValue;
  3236. if (_typeof(formattedValue) === 'object' && formattedValue !== null) {
  3237. formattedValue.forEach(function (value) {
  3238. addOptionToSelectControl(selectControl, value, value, column.filterDefault);
  3239. });
  3240. continue;
  3241. }
  3242. } // eslint-disable-next-line guard-for-in
  3243. for (var key in uniqueValues) {
  3244. addOptionToSelectControl(selectControl, uniqueValues[key], key, column.filterDefault);
  3245. }
  3246. }
  3247. });
  3248. }
  3249. function getFilterDataMethod(objFilterDataMethod, searchTerm) {
  3250. var keys = Object.keys(objFilterDataMethod);
  3251. for (var i = 0; i < keys.length; i++) {
  3252. if (keys[i] === searchTerm) {
  3253. return objFilterDataMethod[searchTerm];
  3254. }
  3255. }
  3256. return null;
  3257. }
  3258. function createControls(that, header) {
  3259. var addedFilterControl = false;
  3260. var html;
  3261. $__default["default"].each(that.columns, function (_, column) {
  3262. html = [];
  3263. if (!column.visible) {
  3264. return;
  3265. }
  3266. if (!column.filterControl && !that.options.filterControlContainer) {
  3267. html.push('<div class="no-filter-control"></div>');
  3268. } else if (that.options.filterControlContainer) {
  3269. // Use a filter control container instead of th
  3270. var $filterControls = $__default["default"](".bootstrap-table-filter-control-".concat(column.field));
  3271. $__default["default"].each($filterControls, function (_, filterControl) {
  3272. var $filterControl = $__default["default"](filterControl);
  3273. if (!$filterControl.is('[type=radio]')) {
  3274. var placeholder = column.filterControlPlaceholder || '';
  3275. $filterControl.attr('placeholder', placeholder).val(column.filterDefault);
  3276. }
  3277. $filterControl.attr('data-field', column.field);
  3278. });
  3279. addedFilterControl = true;
  3280. } else {
  3281. // Create the control based on the html defined in the filterTemplate array.
  3282. var nameControl = column.filterControl.toLowerCase();
  3283. html.push('<div class="filter-control">');
  3284. addedFilterControl = true;
  3285. if (column.searchable && that.options.filterTemplate[nameControl]) {
  3286. html.push(that.options.filterTemplate[nameControl](that, column, column.filterControlPlaceholder ? column.filterControlPlaceholder : '', column.filterDefault));
  3287. }
  3288. } // Filtering by default when it is set.
  3289. if (column.filterControl && '' !== column.filterDefault && 'undefined' !== typeof column.filterDefault) {
  3290. if ($__default["default"].isEmptyObject(that.filterColumnsPartial)) {
  3291. that.filterColumnsPartial = {};
  3292. }
  3293. that.filterColumnsPartial[column.field] = column.filterDefault;
  3294. }
  3295. $__default["default"].each(header.find('th'), function (_, th) {
  3296. var $th = $__default["default"](th);
  3297. if ($th.data('field') === column.field) {
  3298. $th.find('.filter-control').remove();
  3299. $th.find('.fht-cell').html(html.join(''));
  3300. return false;
  3301. }
  3302. });
  3303. if (column.filterData && column.filterData.toLowerCase() !== 'column') {
  3304. var filterDataType = getFilterDataMethod(filterDataMethods, column.filterData.substring(0, column.filterData.indexOf(':')));
  3305. var filterDataSource;
  3306. var selectControl;
  3307. if (filterDataType) {
  3308. filterDataSource = column.filterData.substring(column.filterData.indexOf(':') + 1, column.filterData.length);
  3309. selectControl = header.find(".bootstrap-table-filter-control-".concat(escapeID(column.field)));
  3310. addOptionToSelectControl(selectControl, '', column.filterControlPlaceholder, column.filterDefault, true);
  3311. filterDataType(that, filterDataSource, selectControl, that.options.filterOrderBy, column.filterDefault);
  3312. } else {
  3313. throw new SyntaxError('Error. You should use any of these allowed filter data methods: var, obj, json, url, func.' + ' Use like this: var: {key: "value"}');
  3314. }
  3315. }
  3316. });
  3317. if (addedFilterControl) {
  3318. header.off('keyup', 'input').on('keyup', 'input', function (_ref4, obj) {
  3319. var currentTarget = _ref4.currentTarget,
  3320. keyCode = _ref4.keyCode;
  3321. keyCode = obj ? obj.keyCode : keyCode;
  3322. if (that.options.searchOnEnterKey && keyCode !== 13) {
  3323. return;
  3324. }
  3325. if (isKeyAllowed(keyCode)) {
  3326. return;
  3327. }
  3328. var $currentTarget = $__default["default"](currentTarget);
  3329. if ($currentTarget.is(':checkbox') || $currentTarget.is(':radio')) {
  3330. return;
  3331. }
  3332. clearTimeout(currentTarget.timeoutId || 0);
  3333. currentTarget.timeoutId = setTimeout(function () {
  3334. that.onColumnSearch({
  3335. currentTarget: currentTarget,
  3336. keyCode: keyCode
  3337. });
  3338. }, that.options.searchTimeOut);
  3339. });
  3340. header.off('change', 'select', '.fc-multipleselect').on('change', 'select', '.fc-multipleselect', function (_ref5) {
  3341. var currentTarget = _ref5.currentTarget,
  3342. keyCode = _ref5.keyCode;
  3343. var $selectControl = $__default["default"](currentTarget);
  3344. var value = $selectControl.val();
  3345. if (Array.isArray(value)) {
  3346. for (var i = 0; i < value.length; i++) {
  3347. if (value[i] && value[i].length > 0 && value[i].trim()) {
  3348. $selectControl.find("option[value=\"".concat(value[i], "\"]")).attr('selected', true);
  3349. }
  3350. }
  3351. } else if (value && value.length > 0 && value.trim()) {
  3352. $selectControl.find('option[selected]').removeAttr('selected');
  3353. $selectControl.find("option[value=\"".concat(value, "\"]")).attr('selected', true);
  3354. } else {
  3355. $selectControl.find('option[selected]').removeAttr('selected');
  3356. }
  3357. clearTimeout(currentTarget.timeoutId || 0);
  3358. currentTarget.timeoutId = setTimeout(function () {
  3359. that.onColumnSearch({
  3360. currentTarget: currentTarget,
  3361. keyCode: keyCode
  3362. });
  3363. }, that.options.searchTimeOut);
  3364. });
  3365. header.off('mouseup', 'input:not([type=radio])').on('mouseup', 'input:not([type=radio])', function (_ref6) {
  3366. var currentTarget = _ref6.currentTarget,
  3367. keyCode = _ref6.keyCode;
  3368. var $input = $__default["default"](currentTarget);
  3369. var oldValue = $input.val();
  3370. if (oldValue === '') {
  3371. return;
  3372. }
  3373. setTimeout(function () {
  3374. var newValue = $input.val();
  3375. if (newValue === '') {
  3376. clearTimeout(currentTarget.timeoutId || 0);
  3377. currentTarget.timeoutId = setTimeout(function () {
  3378. that.onColumnSearch({
  3379. currentTarget: currentTarget,
  3380. keyCode: keyCode
  3381. });
  3382. }, that.options.searchTimeOut);
  3383. }
  3384. }, 1);
  3385. });
  3386. header.off('change', 'input[type=radio]').on('change', 'input[type=radio]', function (_ref7) {
  3387. var currentTarget = _ref7.currentTarget,
  3388. keyCode = _ref7.keyCode;
  3389. clearTimeout(currentTarget.timeoutId || 0);
  3390. currentTarget.timeoutId = setTimeout(function () {
  3391. that.onColumnSearch({
  3392. currentTarget: currentTarget,
  3393. keyCode: keyCode
  3394. });
  3395. }, that.options.searchTimeOut);
  3396. }); // See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date
  3397. if (header.find('.date-filter-control').length > 0) {
  3398. $__default["default"].each(that.columns, function (i, _ref8) {
  3399. var filterDefault = _ref8.filterDefault,
  3400. filterControl = _ref8.filterControl,
  3401. field = _ref8.field,
  3402. filterDatepickerOptions = _ref8.filterDatepickerOptions;
  3403. if (filterControl !== undefined && filterControl.toLowerCase() === 'datepicker') {
  3404. var $datepicker = header.find(".date-filter-control.bootstrap-table-filter-control-".concat(field));
  3405. if (filterDefault) {
  3406. $datepicker.value(filterDefault);
  3407. }
  3408. if (filterDatepickerOptions.min) {
  3409. $datepicker.attr('min', filterDatepickerOptions.min);
  3410. }
  3411. if (filterDatepickerOptions.max) {
  3412. $datepicker.attr('max', filterDatepickerOptions.max);
  3413. }
  3414. if (filterDatepickerOptions.step) {
  3415. $datepicker.attr('step', filterDatepickerOptions.step);
  3416. }
  3417. if (filterDatepickerOptions.pattern) {
  3418. $datepicker.attr('pattern', filterDatepickerOptions.pattern);
  3419. }
  3420. $datepicker.on('change', function (_ref9) {
  3421. var currentTarget = _ref9.currentTarget;
  3422. clearTimeout(currentTarget.timeoutId || 0);
  3423. currentTarget.timeoutId = setTimeout(function () {
  3424. that.onColumnSearch({
  3425. currentTarget: currentTarget
  3426. });
  3427. }, that.options.searchTimeOut);
  3428. });
  3429. }
  3430. });
  3431. }
  3432. if (that.options.sidePagination !== 'server') {
  3433. that.triggerSearch();
  3434. }
  3435. if (!that.options.filterControlVisible) {
  3436. header.find('.filter-control, .no-filter-control').hide();
  3437. }
  3438. } else {
  3439. header.find('.filter-control, .no-filter-control').hide();
  3440. }
  3441. that.trigger('created-controls');
  3442. }
  3443. function getDirectionOfSelectOptions(_alignment) {
  3444. var alignment = _alignment === undefined ? 'left' : _alignment.toLowerCase();
  3445. switch (alignment) {
  3446. case 'left':
  3447. return 'ltr';
  3448. case 'right':
  3449. return 'rtl';
  3450. case 'auto':
  3451. return 'auto';
  3452. default:
  3453. return 'ltr';
  3454. }
  3455. }
  3456. function syncHeaders(that) {
  3457. if (!that.options.height) {
  3458. return;
  3459. }
  3460. var fixedHeader = $__default["default"]('.fixed-table-header table thead');
  3461. if (fixedHeader.length === 0) {
  3462. return;
  3463. }
  3464. that.$header.children().find('th[data-field]').each(function (_, element) {
  3465. if (element.classList[0] !== 'bs-checkbox') {
  3466. var $element = $__default["default"](element);
  3467. var $field = $element.data('field');
  3468. var $fixedField = $__default["default"]("th[data-field='".concat($field, "']")).not($element);
  3469. var input = $element.find('input');
  3470. var fixedInput = $fixedField.find('input');
  3471. if (input.length > 0 && fixedInput.length > 0) {
  3472. if (input.val() !== fixedInput.val()) {
  3473. input.val(fixedInput.val());
  3474. }
  3475. }
  3476. }
  3477. });
  3478. }
  3479. var filterDataMethods = {
  3480. func: function func(that, filterDataSource, selectControl, filterOrderBy, selected) {
  3481. var variableValues = window[filterDataSource].apply(); // eslint-disable-next-line guard-for-in
  3482. for (var key in variableValues) {
  3483. addOptionToSelectControl(selectControl, key, variableValues[key], selected);
  3484. }
  3485. if (that.options.sortSelectOptions) {
  3486. sortSelectControl(selectControl, filterOrderBy);
  3487. }
  3488. setValues(that);
  3489. },
  3490. obj: function obj(that, filterDataSource, selectControl, filterOrderBy, selected) {
  3491. var objectKeys = filterDataSource.split('.');
  3492. var variableName = objectKeys.shift();
  3493. var variableValues = window[variableName];
  3494. if (objectKeys.length > 0) {
  3495. objectKeys.forEach(function (key) {
  3496. variableValues = variableValues[key];
  3497. });
  3498. } // eslint-disable-next-line guard-for-in
  3499. for (var key in variableValues) {
  3500. addOptionToSelectControl(selectControl, key, variableValues[key], selected);
  3501. }
  3502. if (that.options.sortSelectOptions) {
  3503. sortSelectControl(selectControl, filterOrderBy);
  3504. }
  3505. setValues(that);
  3506. },
  3507. var: function _var(that, filterDataSource, selectControl, filterOrderBy, selected) {
  3508. var variableValues = window[filterDataSource];
  3509. var isArray = Array.isArray(variableValues);
  3510. for (var key in variableValues) {
  3511. if (isArray) {
  3512. addOptionToSelectControl(selectControl, variableValues[key], variableValues[key], selected, true);
  3513. } else {
  3514. addOptionToSelectControl(selectControl, key, variableValues[key], selected, true);
  3515. }
  3516. }
  3517. if (that.options.sortSelectOptions) {
  3518. sortSelectControl(selectControl, filterOrderBy);
  3519. }
  3520. setValues(that);
  3521. },
  3522. url: function url(that, filterDataSource, selectControl, filterOrderBy, selected) {
  3523. $__default["default"].ajax({
  3524. url: filterDataSource,
  3525. dataType: 'json',
  3526. success: function success(data) {
  3527. // eslint-disable-next-line guard-for-in
  3528. for (var key in data) {
  3529. addOptionToSelectControl(selectControl, key, data[key], selected);
  3530. }
  3531. if (that.options.sortSelectOptions) {
  3532. sortSelectControl(selectControl, filterOrderBy);
  3533. }
  3534. setValues(that);
  3535. }
  3536. });
  3537. },
  3538. json: function json(that, filterDataSource, selectControl, filterOrderBy, selected) {
  3539. var variableValues = JSON.parse(filterDataSource); // eslint-disable-next-line guard-for-in
  3540. for (var key in variableValues) {
  3541. addOptionToSelectControl(selectControl, key, variableValues[key], selected);
  3542. }
  3543. if (that.options.sortSelectOptions) {
  3544. sortSelectControl(selectControl, filterOrderBy);
  3545. }
  3546. setValues(that);
  3547. }
  3548. };
  3549. var Utils = $__default["default"].fn.bootstrapTable.utils;
  3550. $__default["default"].extend($__default["default"].fn.bootstrapTable.defaults, {
  3551. filterControl: false,
  3552. filterControlVisible: true,
  3553. // eslint-disable-next-line no-unused-vars
  3554. onColumnSearch: function onColumnSearch(field, text) {
  3555. return false;
  3556. },
  3557. onCreatedControls: function onCreatedControls() {
  3558. return false;
  3559. },
  3560. alignmentSelectControlOptions: undefined,
  3561. filterTemplate: {
  3562. input: function input(that, column, placeholder, value) {
  3563. return Utils.sprintf('<input type="search" class="%s bootstrap-table-filter-control-%s search-input" style="width: 100%;" placeholder="%s" value="%s">', getInputClass(that), column.field, 'undefined' === typeof placeholder ? '' : placeholder, 'undefined' === typeof value ? '' : value);
  3564. },
  3565. select: function select(that, column) {
  3566. return Utils.sprintf('<select class="%s bootstrap-table-filter-control-%s %s" %s style="width: 100%;" dir="%s"></select>', getInputClass(that, true), column.field, '', '', getDirectionOfSelectOptions(that.options.alignmentSelectControlOptions));
  3567. },
  3568. datepicker: function datepicker(that, column, value) {
  3569. return Utils.sprintf('<input type="date" class="%s date-filter-control bootstrap-table-filter-control-%s" style="width: 100%;" value="%s">', getInputClass(that), column.field, 'undefined' === typeof value ? '' : value);
  3570. }
  3571. },
  3572. searchOnEnterKey: false,
  3573. showFilterControlSwitch: false,
  3574. sortSelectOptions: false,
  3575. // internal variables
  3576. _valuesFilterControl: [],
  3577. _initialized: false,
  3578. _isRendering: false,
  3579. _usingMultipleSelect: false
  3580. });
  3581. $__default["default"].extend($__default["default"].fn.bootstrapTable.columnDefaults, {
  3582. filterControl: undefined,
  3583. // input, select, datepicker
  3584. filterControlMultipleSelect: false,
  3585. filterControlMultipleSelectOptions: {},
  3586. filterDataCollector: undefined,
  3587. filterData: undefined,
  3588. filterDatepickerOptions: {},
  3589. filterStrictSearch: false,
  3590. filterStartsWithSearch: false,
  3591. filterControlPlaceholder: '',
  3592. filterDefault: '',
  3593. filterOrderBy: 'asc',
  3594. // asc || desc
  3595. filterCustomSearch: undefined
  3596. });
  3597. $__default["default"].extend($__default["default"].fn.bootstrapTable.Constructor.EVENTS, {
  3598. 'column-search.bs.table': 'onColumnSearch',
  3599. 'created-controls.bs.table': 'onCreatedControls'
  3600. });
  3601. $__default["default"].extend($__default["default"].fn.bootstrapTable.defaults.icons, {
  3602. filterControlSwitchHide: {
  3603. bootstrap3: 'glyphicon-zoom-out icon-zoom-out',
  3604. bootstrap5: 'bi-zoom-out',
  3605. materialize: 'zoom_out'
  3606. }[$__default["default"].fn.bootstrapTable.theme] || 'fa-search-minus',
  3607. filterControlSwitchShow: {
  3608. bootstrap3: 'glyphicon-zoom-in icon-zoom-in',
  3609. bootstrap5: 'bi-zoom-in',
  3610. materialize: 'zoom_in'
  3611. }[$__default["default"].fn.bootstrapTable.theme] || 'fa-search-plus'
  3612. });
  3613. $__default["default"].extend($__default["default"].fn.bootstrapTable.locales, {
  3614. formatFilterControlSwitch: function formatFilterControlSwitch() {
  3615. return 'Hide/Show controls';
  3616. },
  3617. formatFilterControlSwitchHide: function formatFilterControlSwitchHide() {
  3618. return 'Hide controls';
  3619. },
  3620. formatFilterControlSwitchShow: function formatFilterControlSwitchShow() {
  3621. return 'Show controls';
  3622. }
  3623. });
  3624. $__default["default"].extend($__default["default"].fn.bootstrapTable.defaults, $__default["default"].fn.bootstrapTable.locales);
  3625. $__default["default"].extend($__default["default"].fn.bootstrapTable.defaults, {
  3626. formatClearSearch: function formatClearSearch() {
  3627. return 'Clear filters';
  3628. }
  3629. });
  3630. $__default["default"].fn.bootstrapTable.methods.push('triggerSearch');
  3631. $__default["default"].fn.bootstrapTable.methods.push('clearFilterControl');
  3632. $__default["default"].fn.bootstrapTable.methods.push('toggleFilterControl');
  3633. $__default["default"].BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
  3634. _inherits(_class, _$$BootstrapTable);
  3635. var _super = _createSuper(_class);
  3636. function _class() {
  3637. _classCallCheck(this, _class);
  3638. return _super.apply(this, arguments);
  3639. }
  3640. _createClass(_class, [{
  3641. key: "init",
  3642. value: function init() {
  3643. var _this = this;
  3644. // Make sure that the filterControl option is set
  3645. if (this.options.filterControl) {
  3646. // Make sure that the internal variables are set correctly
  3647. this._valuesFilterControl = [];
  3648. this._initialized = false;
  3649. this._usingMultipleSelect = false;
  3650. this._isRendering = false;
  3651. this.$el.on('reset-view.bs.table', Utils.debounce(function () {
  3652. initFilterSelectControls(_this);
  3653. setValues(_this);
  3654. }, 3)).on('toggle.bs.table', Utils.debounce(function (_, cardView) {
  3655. _this._initialized = false;
  3656. if (!cardView) {
  3657. initFilterSelectControls(_this);
  3658. setValues(_this);
  3659. _this._initialized = true;
  3660. }
  3661. }, 1)).on('post-header.bs.table', Utils.debounce(function () {
  3662. initFilterSelectControls(_this);
  3663. setValues(_this);
  3664. }, 3)).on('column-switch.bs.table', Utils.debounce(function () {
  3665. setValues(_this);
  3666. if (_this.options.height) {
  3667. _this.fitHeader();
  3668. }
  3669. }, 1)).on('post-body.bs.table', Utils.debounce(function () {
  3670. if (_this.options.height && !_this.options.filterControlContainer && _this.options.filterControlVisible) {
  3671. fixHeaderCSS(_this);
  3672. }
  3673. _this.$tableLoading.css('top', _this.$header.outerHeight() + 1);
  3674. }, 1)).on('all.bs.table', function () {
  3675. syncHeaders(_this);
  3676. });
  3677. }
  3678. _get(_getPrototypeOf(_class.prototype), "init", this).call(this);
  3679. }
  3680. }, {
  3681. key: "initBody",
  3682. value: function initBody() {
  3683. var _this2 = this;
  3684. _get(_getPrototypeOf(_class.prototype), "initBody", this).call(this);
  3685. if (!this.options.filterControl) {
  3686. return;
  3687. }
  3688. setTimeout(function () {
  3689. initFilterSelectControls(_this2);
  3690. setValues(_this2);
  3691. }, 3);
  3692. }
  3693. }, {
  3694. key: "load",
  3695. value: function load(data) {
  3696. _get(_getPrototypeOf(_class.prototype), "load", this).call(this, data);
  3697. if (!this.options.filterControl) {
  3698. return;
  3699. }
  3700. createControls(this, getControlContainer(this));
  3701. setValues(this);
  3702. }
  3703. }, {
  3704. key: "initHeader",
  3705. value: function initHeader() {
  3706. _get(_getPrototypeOf(_class.prototype), "initHeader", this).call(this);
  3707. if (!this.options.filterControl) {
  3708. return;
  3709. }
  3710. createControls(this, getControlContainer(this));
  3711. this._initialized = true;
  3712. }
  3713. }, {
  3714. key: "initSearch",
  3715. value: function initSearch() {
  3716. var _this3 = this;
  3717. var that = this;
  3718. var filterPartial = $__default["default"].isEmptyObject(that.filterColumnsPartial) ? null : that.filterColumnsPartial;
  3719. _get(_getPrototypeOf(_class.prototype), "initSearch", this).call(this);
  3720. if (this.options.sidePagination === 'server' || filterPartial === null) {
  3721. return;
  3722. } // Check partial column filter
  3723. that.data = filterPartial ? that.data.filter(function (item, i) {
  3724. var itemIsExpected = [];
  3725. var keys1 = Object.keys(item);
  3726. var keys2 = Object.keys(filterPartial);
  3727. var keys = keys1.concat(keys2.filter(function (item) {
  3728. return !keys1.includes(item);
  3729. }));
  3730. keys.forEach(function (key) {
  3731. var thisColumn = that.columns[that.fieldsColumnsIndex[key]];
  3732. var rawFilterValue = filterPartial[key] || '';
  3733. var filterValue = rawFilterValue.toLowerCase();
  3734. var value = Utils.unescapeHTML(Utils.getItemField(item, key, false));
  3735. var tmpItemIsExpected;
  3736. if (filterValue === '') {
  3737. tmpItemIsExpected = true;
  3738. } else {
  3739. // Fix #142: search use formatted data
  3740. if (thisColumn) {
  3741. if (thisColumn.searchFormatter || thisColumn._forceFormatter) {
  3742. value = $__default["default"].fn.bootstrapTable.utils.calculateObjectValue(that.header, that.header.formatters[$__default["default"].inArray(key, that.header.fields)], [value, item, i], value);
  3743. }
  3744. }
  3745. if ($__default["default"].inArray(key, that.header.fields) !== -1) {
  3746. if (value === undefined || value === null) {
  3747. tmpItemIsExpected = false;
  3748. } else if (_typeof(value) === 'object' && thisColumn.filterCustomSearch) {
  3749. itemIsExpected.push(that.isValueExpected(rawFilterValue, value, thisColumn, key));
  3750. return;
  3751. } else if (_typeof(value) === 'object' && Array.isArray(value)) {
  3752. value.forEach(function (objectValue) {
  3753. if (tmpItemIsExpected) {
  3754. return;
  3755. }
  3756. if (_this3.options.searchAccentNeutralise) {
  3757. objectValue = Utils.normalizeAccent(objectValue);
  3758. }
  3759. tmpItemIsExpected = that.isValueExpected(filterValue, objectValue, thisColumn, key);
  3760. });
  3761. } else if (_typeof(value) === 'object' && !Array.isArray(value)) {
  3762. Object.values(value).forEach(function (objectValue) {
  3763. if (tmpItemIsExpected) {
  3764. return;
  3765. }
  3766. if (_this3.options.searchAccentNeutralise) {
  3767. objectValue = Utils.normalizeAccent(objectValue);
  3768. }
  3769. tmpItemIsExpected = that.isValueExpected(filterValue, objectValue, thisColumn, key);
  3770. });
  3771. } else if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
  3772. if (_this3.options.searchAccentNeutralise) {
  3773. value = Utils.normalizeAccent(value);
  3774. }
  3775. tmpItemIsExpected = that.isValueExpected(filterValue, value, thisColumn, key);
  3776. }
  3777. }
  3778. }
  3779. itemIsExpected.push(tmpItemIsExpected);
  3780. });
  3781. return !itemIsExpected.includes(false);
  3782. }) : that.data;
  3783. that.unsortedData = _toConsumableArray(that.data);
  3784. }
  3785. }, {
  3786. key: "isValueExpected",
  3787. value: function isValueExpected(searchValue, value, column, key) {
  3788. var tmpItemIsExpected = false;
  3789. if (column.filterStrictSearch) {
  3790. tmpItemIsExpected = value.toString().toLowerCase() === searchValue.toString().toLowerCase();
  3791. } else if (column.filterStartsWithSearch) {
  3792. tmpItemIsExpected = "".concat(value).toLowerCase().indexOf(searchValue) === 0;
  3793. } else if (column.filterControl === 'datepicker') {
  3794. tmpItemIsExpected = new Date(value) === new Date(searchValue);
  3795. } else if (this.options.regexSearch) {
  3796. tmpItemIsExpected = Utils.regexCompare(value, searchValue);
  3797. } else {
  3798. tmpItemIsExpected = "".concat(value).toLowerCase().includes(searchValue);
  3799. }
  3800. var largerSmallerEqualsRegex = /(?:(<=|=>|=<|>=|>|<)(?:\s+)?(\d+)?|(\d+)?(\s+)?(<=|=>|=<|>=|>|<))/gm;
  3801. var matches = largerSmallerEqualsRegex.exec(searchValue);
  3802. if (matches) {
  3803. var operator = matches[1] || "".concat(matches[5], "l");
  3804. var comparisonValue = matches[2] || matches[3];
  3805. var int = parseInt(value, 10);
  3806. var comparisonInt = parseInt(comparisonValue, 10);
  3807. switch (operator) {
  3808. case '>':
  3809. case '<l':
  3810. tmpItemIsExpected = int > comparisonInt;
  3811. break;
  3812. case '<':
  3813. case '>l':
  3814. tmpItemIsExpected = int < comparisonInt;
  3815. break;
  3816. case '<=':
  3817. case '=<':
  3818. case '>=l':
  3819. case '=>l':
  3820. tmpItemIsExpected = int <= comparisonInt;
  3821. break;
  3822. case '>=':
  3823. case '=>':
  3824. case '<=l':
  3825. case '=<l':
  3826. tmpItemIsExpected = int >= comparisonInt;
  3827. break;
  3828. }
  3829. }
  3830. if (column.filterCustomSearch) {
  3831. var customSearchResult = Utils.calculateObjectValue(this, column.filterCustomSearch, [searchValue, value, key, this.options.data], true);
  3832. if (customSearchResult !== null) {
  3833. tmpItemIsExpected = customSearchResult;
  3834. }
  3835. }
  3836. return tmpItemIsExpected;
  3837. }
  3838. }, {
  3839. key: "initColumnSearch",
  3840. value: function initColumnSearch(filterColumnsDefaults) {
  3841. cacheValues(this);
  3842. if (filterColumnsDefaults) {
  3843. this.filterColumnsPartial = filterColumnsDefaults;
  3844. this.updatePagination(); // eslint-disable-next-line guard-for-in
  3845. for (var filter in filterColumnsDefaults) {
  3846. this.trigger('column-search', filter, filterColumnsDefaults[filter]);
  3847. }
  3848. }
  3849. }
  3850. }, {
  3851. key: "initToolbar",
  3852. value: function initToolbar() {
  3853. this.showToolbar = this.showToolbar || this.options.showFilterControlSwitch;
  3854. this.showSearchClearButton = this.options.filterControl && this.options.showSearchClearButton;
  3855. if (this.options.showFilterControlSwitch) {
  3856. this.buttons = Object.assign(this.buttons, {
  3857. filterControlSwitch: {
  3858. text: this.options.filterControlVisible ? this.options.formatFilterControlSwitchHide() : this.options.formatFilterControlSwitchShow(),
  3859. icon: this.options.filterControlVisible ? this.options.icons.filterControlSwitchHide : this.options.icons.filterControlSwitchShow,
  3860. event: this.toggleFilterControl,
  3861. attributes: {
  3862. 'aria-label': this.options.formatFilterControlSwitch(),
  3863. title: this.options.formatFilterControlSwitch()
  3864. }
  3865. }
  3866. });
  3867. }
  3868. _get(_getPrototypeOf(_class.prototype), "initToolbar", this).call(this);
  3869. }
  3870. }, {
  3871. key: "resetSearch",
  3872. value: function resetSearch(text) {
  3873. if (this.options.filterControl && this.options.showSearchClearButton) {
  3874. this.clearFilterControl();
  3875. }
  3876. _get(_getPrototypeOf(_class.prototype), "resetSearch", this).call(this, text);
  3877. }
  3878. }, {
  3879. key: "clearFilterControl",
  3880. value: function clearFilterControl() {
  3881. if (!this.options.filterControl) {
  3882. return;
  3883. }
  3884. var that = this;
  3885. var table = this.$el.closest('table');
  3886. var cookies = collectBootstrapTableFilterCookies();
  3887. var controls = getSearchControls(that); // const search = Utils.getSearchInput(this)
  3888. var hasValues = false;
  3889. var timeoutId = 0; // Clear cache values
  3890. $__default["default"].each(that._valuesFilterControl, function (i, item) {
  3891. hasValues = hasValues ? true : item.value !== '';
  3892. item.value = '';
  3893. }); // Clear controls in UI
  3894. $__default["default"].each(controls, function (i, item) {
  3895. item.value = '';
  3896. }); // Cache controls again
  3897. setValues(that); // clear cookies once the filters are clean
  3898. clearTimeout(timeoutId);
  3899. timeoutId = setTimeout(function () {
  3900. if (cookies && cookies.length > 0) {
  3901. $__default["default"].each(cookies, function (i, item) {
  3902. if (that.deleteCookie !== undefined) {
  3903. that.deleteCookie(item);
  3904. }
  3905. });
  3906. }
  3907. }, that.options.searchTimeOut); // If there is not any value in the controls exit this method
  3908. if (!hasValues) {
  3909. return;
  3910. } // Clear each type of filter if it exists.
  3911. // Requires the body to reload each time a type of filter is found because we never know
  3912. // which ones are going to be present.
  3913. if (controls.length > 0) {
  3914. this.filterColumnsPartial = {};
  3915. controls.eq(0).trigger(this.tagName === 'INPUT' ? 'keyup' : 'change', {
  3916. keyCode: 13
  3917. });
  3918. /* controls.each(function () {
  3919. $(this).trigger(this.tagName === 'INPUT' ? 'keyup' : 'change', { keyCode: 13 })
  3920. })*/
  3921. } else {
  3922. return;
  3923. }
  3924. /* if (search.length > 0) {
  3925. that.resetSearch('fc')
  3926. }*/
  3927. // use the default sort order if it exists. do nothing if it does not
  3928. if (that.options.sortName !== table.data('sortName') || that.options.sortOrder !== table.data('sortOrder')) {
  3929. var sorter = this.$header.find(Utils.sprintf('[data-field="%s"]', $__default["default"](controls[0]).closest('table').data('sortName')));
  3930. if (sorter.length > 0) {
  3931. that.onSort({
  3932. type: 'keypress',
  3933. currentTarget: sorter
  3934. });
  3935. $__default["default"](sorter).find('.sortable').trigger('click');
  3936. }
  3937. }
  3938. } // EVENTS
  3939. }, {
  3940. key: "onColumnSearch",
  3941. value: function onColumnSearch(_ref) {
  3942. var _this4 = this;
  3943. var currentTarget = _ref.currentTarget,
  3944. keyCode = _ref.keyCode;
  3945. if (isKeyAllowed(keyCode)) {
  3946. return;
  3947. }
  3948. cacheValues(this); // Cookie extension support
  3949. if (!this.options.cookie) {
  3950. this.options.pageNumber = 1;
  3951. } else {
  3952. // Force call the initServer method in Cookie extension
  3953. this._filterControlValuesLoaded = true;
  3954. }
  3955. if ($__default["default"].isEmptyObject(this.filterColumnsPartial)) {
  3956. this.filterColumnsPartial = {};
  3957. } // If searchOnEnterKey is set to true, then we need to iterate over all controls and grab their values.
  3958. var controls = this.options.searchOnEnterKey ? getSearchControls(this).toArray() : [currentTarget];
  3959. controls.forEach(function (element) {
  3960. var $element = $__default["default"](element);
  3961. var elementValue = $element.val();
  3962. var text = elementValue ? elementValue.trim() : '';
  3963. var $field = $element.closest('[data-field]').data('field');
  3964. _this4.trigger('column-search', $field, text);
  3965. if (text) {
  3966. _this4.filterColumnsPartial[$field] = text;
  3967. } else {
  3968. delete _this4.filterColumnsPartial[$field];
  3969. }
  3970. });
  3971. this.onSearch({
  3972. currentTarget: currentTarget
  3973. }, false);
  3974. }
  3975. }, {
  3976. key: "toggleFilterControl",
  3977. value: function toggleFilterControl() {
  3978. this.options.filterControlVisible = !this.options.filterControlVisible; // Controls in original header or container.
  3979. var $filterControls = getControlContainer(this).find('.filter-control, .no-filter-control');
  3980. if (this.options.filterControlVisible) {
  3981. $filterControls.show();
  3982. } else {
  3983. $filterControls.hide();
  3984. this.clearFilterControl();
  3985. } // Controls in fixed header
  3986. if (this.options.height) {
  3987. var $fixedControls = $__default["default"]('.fixed-table-header table thead').find('.filter-control, .no-filter-control');
  3988. $fixedControls.toggle(this.options.filterControlVisible);
  3989. fixHeaderCSS(this);
  3990. }
  3991. var icon = this.options.showButtonIcons ? this.options.filterControlVisible ? this.options.icons.filterControlSwitchHide : this.options.icons.filterControlSwitchShow : '';
  3992. var text = this.options.showButtonText ? this.options.filterControlVisible ? this.options.formatFilterControlSwitchHide() : this.options.formatFilterControlSwitchShow() : '';
  3993. this.$toolbar.find('>.columns').find('.filter-control-switch').html("".concat(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, icon), " ").concat(text));
  3994. }
  3995. }, {
  3996. key: "triggerSearch",
  3997. value: function triggerSearch() {
  3998. var searchControls = getSearchControls(this);
  3999. searchControls.each(function () {
  4000. var $element = $__default["default"](this);
  4001. if ($element.is('select')) {
  4002. $element.trigger('change');
  4003. } else {
  4004. $element.trigger('keyup');
  4005. }
  4006. });
  4007. }
  4008. }, {
  4009. key: "_toggleColumn",
  4010. value: function _toggleColumn(index, checked, needUpdate) {
  4011. this._initialized = false;
  4012. _get(_getPrototypeOf(_class.prototype), "_toggleColumn", this).call(this, index, checked, needUpdate);
  4013. syncHeaders(this);
  4014. }
  4015. }]);
  4016. return _class;
  4017. }($__default["default"].BootstrapTable);
  4018. }));