bootstrap-table-filter-control.js 160 KB

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