bootstrap-table.js 322 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) :
  3. typeof define === 'function' && define.amd ? define(['jquery'], factory) :
  4. (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.BootstrapTable = factory(global.jQuery));
  5. })(this, (function ($$q) { 'use strict';
  6. function _iterableToArrayLimit(r, l) {
  7. var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
  8. if (null != t) {
  9. var e,
  10. n,
  11. i,
  12. u,
  13. a = [],
  14. f = !0,
  15. o = !1;
  16. try {
  17. if (i = (t = t.call(r)).next, 0 === l) {
  18. if (Object(t) !== t) return;
  19. f = !1;
  20. } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
  21. } catch (r) {
  22. o = !0, n = r;
  23. } finally {
  24. try {
  25. if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
  26. } finally {
  27. if (o) throw n;
  28. }
  29. }
  30. return a;
  31. }
  32. }
  33. function _toPrimitive(t, r) {
  34. if ("object" != typeof t || !t) return t;
  35. var e = t[Symbol.toPrimitive];
  36. if (void 0 !== e) {
  37. var i = e.call(t, r || "default");
  38. if ("object" != typeof i) return i;
  39. throw new TypeError("@@toPrimitive must return a primitive value.");
  40. }
  41. return ("string" === r ? String : Number)(t);
  42. }
  43. function _toPropertyKey(t) {
  44. var i = _toPrimitive(t, "string");
  45. return "symbol" == typeof i ? i : i + "";
  46. }
  47. function _typeof(o) {
  48. "@babel/helpers - typeof";
  49. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
  50. return typeof o;
  51. } : function (o) {
  52. return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
  53. }, _typeof(o);
  54. }
  55. function _classCallCheck(instance, Constructor) {
  56. if (!(instance instanceof Constructor)) {
  57. throw new TypeError("Cannot call a class as a function");
  58. }
  59. }
  60. function _defineProperties(target, props) {
  61. for (var i = 0; i < props.length; i++) {
  62. var descriptor = props[i];
  63. descriptor.enumerable = descriptor.enumerable || false;
  64. descriptor.configurable = true;
  65. if ("value" in descriptor) descriptor.writable = true;
  66. Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
  67. }
  68. }
  69. function _createClass(Constructor, protoProps, staticProps) {
  70. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  71. if (staticProps) _defineProperties(Constructor, staticProps);
  72. Object.defineProperty(Constructor, "prototype", {
  73. writable: false
  74. });
  75. return Constructor;
  76. }
  77. function _slicedToArray(arr, i) {
  78. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
  79. }
  80. function _toConsumableArray(arr) {
  81. return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
  82. }
  83. function _arrayWithoutHoles(arr) {
  84. if (Array.isArray(arr)) return _arrayLikeToArray(arr);
  85. }
  86. function _arrayWithHoles(arr) {
  87. if (Array.isArray(arr)) return arr;
  88. }
  89. function _iterableToArray(iter) {
  90. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  91. }
  92. function _unsupportedIterableToArray(o, minLen) {
  93. if (!o) return;
  94. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  95. var n = Object.prototype.toString.call(o).slice(8, -1);
  96. if (n === "Object" && o.constructor) n = o.constructor.name;
  97. if (n === "Map" || n === "Set") return Array.from(o);
  98. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  99. }
  100. function _arrayLikeToArray(arr, len) {
  101. if (len == null || len > arr.length) len = arr.length;
  102. for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
  103. return arr2;
  104. }
  105. function _nonIterableSpread() {
  106. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  107. }
  108. function _nonIterableRest() {
  109. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  110. }
  111. function _createForOfIteratorHelper(o, allowArrayLike) {
  112. var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
  113. if (!it) {
  114. if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
  115. if (it) o = it;
  116. var i = 0;
  117. var F = function () {};
  118. return {
  119. s: F,
  120. n: function () {
  121. if (i >= o.length) return {
  122. done: true
  123. };
  124. return {
  125. done: false,
  126. value: o[i++]
  127. };
  128. },
  129. e: function (e) {
  130. throw e;
  131. },
  132. f: F
  133. };
  134. }
  135. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  136. }
  137. var normalCompletion = true,
  138. didErr = false,
  139. err;
  140. return {
  141. s: function () {
  142. it = it.call(o);
  143. },
  144. n: function () {
  145. var step = it.next();
  146. normalCompletion = step.done;
  147. return step;
  148. },
  149. e: function (e) {
  150. didErr = true;
  151. err = e;
  152. },
  153. f: function () {
  154. try {
  155. if (!normalCompletion && it.return != null) it.return();
  156. } finally {
  157. if (didErr) throw err;
  158. }
  159. }
  160. };
  161. }
  162. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  163. var check = function (it) {
  164. return it && it.Math === Math && it;
  165. };
  166. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  167. var global$k =
  168. // eslint-disable-next-line es/no-global-this -- safe
  169. check(typeof globalThis == 'object' && globalThis) ||
  170. check(typeof window == 'object' && window) ||
  171. // eslint-disable-next-line no-restricted-globals -- safe
  172. check(typeof self == 'object' && self) ||
  173. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  174. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  175. // eslint-disable-next-line no-new-func -- fallback
  176. (function () { return this; })() || Function('return this')();
  177. var objectGetOwnPropertyDescriptor = {};
  178. var fails$x = function (exec) {
  179. try {
  180. return !!exec();
  181. } catch (error) {
  182. return true;
  183. }
  184. };
  185. var fails$w = fails$x;
  186. // Detect IE8's incomplete defineProperty implementation
  187. var descriptors = !fails$w(function () {
  188. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  189. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
  190. });
  191. var fails$v = fails$x;
  192. var functionBindNative = !fails$v(function () {
  193. // eslint-disable-next-line es/no-function-prototype-bind -- safe
  194. var test = (function () { /* empty */ }).bind();
  195. // eslint-disable-next-line no-prototype-builtins -- safe
  196. return typeof test != 'function' || test.hasOwnProperty('prototype');
  197. });
  198. var NATIVE_BIND$3 = functionBindNative;
  199. var call$f = Function.prototype.call;
  200. var functionCall = NATIVE_BIND$3 ? call$f.bind(call$f) : function () {
  201. return call$f.apply(call$f, arguments);
  202. };
  203. var objectPropertyIsEnumerable = {};
  204. var $propertyIsEnumerable$1 = {}.propertyIsEnumerable;
  205. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  206. var getOwnPropertyDescriptor$5 = Object.getOwnPropertyDescriptor;
  207. // Nashorn ~ JDK8 bug
  208. var NASHORN_BUG = getOwnPropertyDescriptor$5 && !$propertyIsEnumerable$1.call({ 1: 2 }, 1);
  209. // `Object.prototype.propertyIsEnumerable` method implementation
  210. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  211. objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  212. var descriptor = getOwnPropertyDescriptor$5(this, V);
  213. return !!descriptor && descriptor.enumerable;
  214. } : $propertyIsEnumerable$1;
  215. var createPropertyDescriptor$4 = function (bitmap, value) {
  216. return {
  217. enumerable: !(bitmap & 1),
  218. configurable: !(bitmap & 2),
  219. writable: !(bitmap & 4),
  220. value: value
  221. };
  222. };
  223. var NATIVE_BIND$2 = functionBindNative;
  224. var FunctionPrototype$2 = Function.prototype;
  225. var call$e = FunctionPrototype$2.call;
  226. var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$e, call$e);
  227. var functionUncurryThis = NATIVE_BIND$2 ? uncurryThisWithBind : function (fn) {
  228. return function () {
  229. return call$e.apply(fn, arguments);
  230. };
  231. };
  232. var uncurryThis$y = functionUncurryThis;
  233. var toString$h = uncurryThis$y({}.toString);
  234. var stringSlice$9 = uncurryThis$y(''.slice);
  235. var classofRaw$2 = function (it) {
  236. return stringSlice$9(toString$h(it), 8, -1);
  237. };
  238. var uncurryThis$x = functionUncurryThis;
  239. var fails$u = fails$x;
  240. var classof$7 = classofRaw$2;
  241. var $Object$4 = Object;
  242. var split = uncurryThis$x(''.split);
  243. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  244. var indexedObject = fails$u(function () {
  245. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  246. // eslint-disable-next-line no-prototype-builtins -- safe
  247. return !$Object$4('z').propertyIsEnumerable(0);
  248. }) ? function (it) {
  249. return classof$7(it) === 'String' ? split(it, '') : $Object$4(it);
  250. } : $Object$4;
  251. // we can't use just `it == null` since of `document.all` special case
  252. // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
  253. var isNullOrUndefined$7 = function (it) {
  254. return it === null || it === undefined;
  255. };
  256. var isNullOrUndefined$6 = isNullOrUndefined$7;
  257. var $TypeError$c = TypeError;
  258. // `RequireObjectCoercible` abstract operation
  259. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  260. var requireObjectCoercible$c = function (it) {
  261. if (isNullOrUndefined$6(it)) throw new $TypeError$c("Can't call method on " + it);
  262. return it;
  263. };
  264. // toObject with fallback for non-array-like ES3 strings
  265. var IndexedObject$3 = indexedObject;
  266. var requireObjectCoercible$b = requireObjectCoercible$c;
  267. var toIndexedObject$8 = function (it) {
  268. return IndexedObject$3(requireObjectCoercible$b(it));
  269. };
  270. // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
  271. var documentAll = typeof document == 'object' && document.all;
  272. // `IsCallable` abstract operation
  273. // https://tc39.es/ecma262/#sec-iscallable
  274. // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
  275. var isCallable$i = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
  276. return typeof argument == 'function' || argument === documentAll;
  277. } : function (argument) {
  278. return typeof argument == 'function';
  279. };
  280. var isCallable$h = isCallable$i;
  281. var isObject$d = function (it) {
  282. return typeof it == 'object' ? it !== null : isCallable$h(it);
  283. };
  284. var global$j = global$k;
  285. var isCallable$g = isCallable$i;
  286. var aFunction = function (argument) {
  287. return isCallable$g(argument) ? argument : undefined;
  288. };
  289. var getBuiltIn$5 = function (namespace, method) {
  290. return arguments.length < 2 ? aFunction(global$j[namespace]) : global$j[namespace] && global$j[namespace][method];
  291. };
  292. var uncurryThis$w = functionUncurryThis;
  293. var objectIsPrototypeOf = uncurryThis$w({}.isPrototypeOf);
  294. var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
  295. var global$i = global$k;
  296. var userAgent$2 = engineUserAgent;
  297. var process = global$i.process;
  298. var Deno = global$i.Deno;
  299. var versions = process && process.versions || Deno && Deno.version;
  300. var v8 = versions && versions.v8;
  301. var match, version;
  302. if (v8) {
  303. match = v8.split('.');
  304. // in old Chrome, versions of V8 isn't V8 = Chrome / 10
  305. // but their correct versions are not interesting for us
  306. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  307. }
  308. // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
  309. // so check `userAgent` even if `.v8` exists, but 0
  310. if (!version && userAgent$2) {
  311. match = userAgent$2.match(/Edge\/(\d+)/);
  312. if (!match || match[1] >= 74) {
  313. match = userAgent$2.match(/Chrome\/(\d+)/);
  314. if (match) version = +match[1];
  315. }
  316. }
  317. var engineV8Version = version;
  318. /* eslint-disable es/no-symbol -- required for testing */
  319. var V8_VERSION$2 = engineV8Version;
  320. var fails$t = fails$x;
  321. var global$h = global$k;
  322. var $String$5 = global$h.String;
  323. // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
  324. var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$t(function () {
  325. var symbol = Symbol('symbol detection');
  326. // Chrome 38 Symbol has incorrect toString conversion
  327. // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
  328. // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
  329. // of course, fail.
  330. return !$String$5(symbol) || !(Object(symbol) instanceof Symbol) ||
  331. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  332. !Symbol.sham && V8_VERSION$2 && V8_VERSION$2 < 41;
  333. });
  334. /* eslint-disable es/no-symbol -- required for testing */
  335. var NATIVE_SYMBOL$1 = symbolConstructorDetection;
  336. var useSymbolAsUid = NATIVE_SYMBOL$1
  337. && !Symbol.sham
  338. && typeof Symbol.iterator == 'symbol';
  339. var getBuiltIn$4 = getBuiltIn$5;
  340. var isCallable$f = isCallable$i;
  341. var isPrototypeOf$3 = objectIsPrototypeOf;
  342. var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
  343. var $Object$3 = Object;
  344. var isSymbol$3 = USE_SYMBOL_AS_UID$1 ? function (it) {
  345. return typeof it == 'symbol';
  346. } : function (it) {
  347. var $Symbol = getBuiltIn$4('Symbol');
  348. return isCallable$f($Symbol) && isPrototypeOf$3($Symbol.prototype, $Object$3(it));
  349. };
  350. var $String$4 = String;
  351. var tryToString$3 = function (argument) {
  352. try {
  353. return $String$4(argument);
  354. } catch (error) {
  355. return 'Object';
  356. }
  357. };
  358. var isCallable$e = isCallable$i;
  359. var tryToString$2 = tryToString$3;
  360. var $TypeError$b = TypeError;
  361. // `Assert: IsCallable(argument) is true`
  362. var aCallable$4 = function (argument) {
  363. if (isCallable$e(argument)) return argument;
  364. throw new $TypeError$b(tryToString$2(argument) + ' is not a function');
  365. };
  366. var aCallable$3 = aCallable$4;
  367. var isNullOrUndefined$5 = isNullOrUndefined$7;
  368. // `GetMethod` abstract operation
  369. // https://tc39.es/ecma262/#sec-getmethod
  370. var getMethod$5 = function (V, P) {
  371. var func = V[P];
  372. return isNullOrUndefined$5(func) ? undefined : aCallable$3(func);
  373. };
  374. var call$d = functionCall;
  375. var isCallable$d = isCallable$i;
  376. var isObject$c = isObject$d;
  377. var $TypeError$a = TypeError;
  378. // `OrdinaryToPrimitive` abstract operation
  379. // https://tc39.es/ecma262/#sec-ordinarytoprimitive
  380. var ordinaryToPrimitive$1 = function (input, pref) {
  381. var fn, val;
  382. if (pref === 'string' && isCallable$d(fn = input.toString) && !isObject$c(val = call$d(fn, input))) return val;
  383. if (isCallable$d(fn = input.valueOf) && !isObject$c(val = call$d(fn, input))) return val;
  384. if (pref !== 'string' && isCallable$d(fn = input.toString) && !isObject$c(val = call$d(fn, input))) return val;
  385. throw new $TypeError$a("Can't convert object to primitive value");
  386. };
  387. var sharedStore = {exports: {}};
  388. var isPure = false;
  389. var global$g = global$k;
  390. // eslint-disable-next-line es/no-object-defineproperty -- safe
  391. var defineProperty$8 = Object.defineProperty;
  392. var defineGlobalProperty$3 = function (key, value) {
  393. try {
  394. defineProperty$8(global$g, key, { value: value, configurable: true, writable: true });
  395. } catch (error) {
  396. global$g[key] = value;
  397. } return value;
  398. };
  399. var globalThis$1 = global$k;
  400. var defineGlobalProperty$2 = defineGlobalProperty$3;
  401. var SHARED = '__core-js_shared__';
  402. var store$3 = sharedStore.exports = globalThis$1[SHARED] || defineGlobalProperty$2(SHARED, {});
  403. (store$3.versions || (store$3.versions = [])).push({
  404. version: '3.36.1',
  405. mode: 'global',
  406. copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
  407. license: 'https://github.com/zloirock/core-js/blob/v3.36.1/LICENSE',
  408. source: 'https://github.com/zloirock/core-js'
  409. });
  410. var sharedStoreExports = sharedStore.exports;
  411. var store$2 = sharedStoreExports;
  412. var shared$4 = function (key, value) {
  413. return store$2[key] || (store$2[key] = value || {});
  414. };
  415. var requireObjectCoercible$a = requireObjectCoercible$c;
  416. var $Object$2 = Object;
  417. // `ToObject` abstract operation
  418. // https://tc39.es/ecma262/#sec-toobject
  419. var toObject$b = function (argument) {
  420. return $Object$2(requireObjectCoercible$a(argument));
  421. };
  422. var uncurryThis$v = functionUncurryThis;
  423. var toObject$a = toObject$b;
  424. var hasOwnProperty = uncurryThis$v({}.hasOwnProperty);
  425. // `HasOwnProperty` abstract operation
  426. // https://tc39.es/ecma262/#sec-hasownproperty
  427. // eslint-disable-next-line es/no-object-hasown -- safe
  428. var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
  429. return hasOwnProperty(toObject$a(it), key);
  430. };
  431. var uncurryThis$u = functionUncurryThis;
  432. var id = 0;
  433. var postfix = Math.random();
  434. var toString$g = uncurryThis$u(1.0.toString);
  435. var uid$2 = function (key) {
  436. return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$g(++id + postfix, 36);
  437. };
  438. var global$f = global$k;
  439. var shared$3 = shared$4;
  440. var hasOwn$b = hasOwnProperty_1;
  441. var uid$1 = uid$2;
  442. var NATIVE_SYMBOL = symbolConstructorDetection;
  443. var USE_SYMBOL_AS_UID = useSymbolAsUid;
  444. var Symbol$3 = global$f.Symbol;
  445. var WellKnownSymbolsStore = shared$3('wks');
  446. var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$3['for'] || Symbol$3 : Symbol$3 && Symbol$3.withoutSetter || uid$1;
  447. var wellKnownSymbol$j = function (name) {
  448. if (!hasOwn$b(WellKnownSymbolsStore, name)) {
  449. WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$b(Symbol$3, name)
  450. ? Symbol$3[name]
  451. : createWellKnownSymbol('Symbol.' + name);
  452. } return WellKnownSymbolsStore[name];
  453. };
  454. var call$c = functionCall;
  455. var isObject$b = isObject$d;
  456. var isSymbol$2 = isSymbol$3;
  457. var getMethod$4 = getMethod$5;
  458. var ordinaryToPrimitive = ordinaryToPrimitive$1;
  459. var wellKnownSymbol$i = wellKnownSymbol$j;
  460. var $TypeError$9 = TypeError;
  461. var TO_PRIMITIVE = wellKnownSymbol$i('toPrimitive');
  462. // `ToPrimitive` abstract operation
  463. // https://tc39.es/ecma262/#sec-toprimitive
  464. var toPrimitive$3 = function (input, pref) {
  465. if (!isObject$b(input) || isSymbol$2(input)) return input;
  466. var exoticToPrim = getMethod$4(input, TO_PRIMITIVE);
  467. var result;
  468. if (exoticToPrim) {
  469. if (pref === undefined) pref = 'default';
  470. result = call$c(exoticToPrim, input, pref);
  471. if (!isObject$b(result) || isSymbol$2(result)) return result;
  472. throw new $TypeError$9("Can't convert object to primitive value");
  473. }
  474. if (pref === undefined) pref = 'number';
  475. return ordinaryToPrimitive(input, pref);
  476. };
  477. var toPrimitive$2 = toPrimitive$3;
  478. var isSymbol$1 = isSymbol$3;
  479. // `ToPropertyKey` abstract operation
  480. // https://tc39.es/ecma262/#sec-topropertykey
  481. var toPropertyKey$2 = function (argument) {
  482. var key = toPrimitive$2(argument, 'string');
  483. return isSymbol$1(key) ? key : key + '';
  484. };
  485. var global$e = global$k;
  486. var isObject$a = isObject$d;
  487. var document$1 = global$e.document;
  488. // typeof document.createElement is 'object' in old IE
  489. var EXISTS$1 = isObject$a(document$1) && isObject$a(document$1.createElement);
  490. var documentCreateElement$2 = function (it) {
  491. return EXISTS$1 ? document$1.createElement(it) : {};
  492. };
  493. var DESCRIPTORS$f = descriptors;
  494. var fails$s = fails$x;
  495. var createElement = documentCreateElement$2;
  496. // Thanks to IE8 for its funny defineProperty
  497. var ie8DomDefine = !DESCRIPTORS$f && !fails$s(function () {
  498. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  499. return Object.defineProperty(createElement('div'), 'a', {
  500. get: function () { return 7; }
  501. }).a !== 7;
  502. });
  503. var DESCRIPTORS$e = descriptors;
  504. var call$b = functionCall;
  505. var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
  506. var createPropertyDescriptor$3 = createPropertyDescriptor$4;
  507. var toIndexedObject$7 = toIndexedObject$8;
  508. var toPropertyKey$1 = toPropertyKey$2;
  509. var hasOwn$a = hasOwnProperty_1;
  510. var IE8_DOM_DEFINE$1 = ie8DomDefine;
  511. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  512. var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  513. // `Object.getOwnPropertyDescriptor` method
  514. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  515. objectGetOwnPropertyDescriptor.f = DESCRIPTORS$e ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
  516. O = toIndexedObject$7(O);
  517. P = toPropertyKey$1(P);
  518. if (IE8_DOM_DEFINE$1) try {
  519. return $getOwnPropertyDescriptor$1(O, P);
  520. } catch (error) { /* empty */ }
  521. if (hasOwn$a(O, P)) return createPropertyDescriptor$3(!call$b(propertyIsEnumerableModule$1.f, O, P), O[P]);
  522. };
  523. var objectDefineProperty = {};
  524. var DESCRIPTORS$d = descriptors;
  525. var fails$r = fails$x;
  526. // V8 ~ Chrome 36-
  527. // https://bugs.chromium.org/p/v8/issues/detail?id=3334
  528. var v8PrototypeDefineBug = DESCRIPTORS$d && fails$r(function () {
  529. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  530. return Object.defineProperty(function () { /* empty */ }, 'prototype', {
  531. value: 42,
  532. writable: false
  533. }).prototype !== 42;
  534. });
  535. var isObject$9 = isObject$d;
  536. var $String$3 = String;
  537. var $TypeError$8 = TypeError;
  538. // `Assert: Type(argument) is Object`
  539. var anObject$c = function (argument) {
  540. if (isObject$9(argument)) return argument;
  541. throw new $TypeError$8($String$3(argument) + ' is not an object');
  542. };
  543. var DESCRIPTORS$c = descriptors;
  544. var IE8_DOM_DEFINE = ie8DomDefine;
  545. var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
  546. var anObject$b = anObject$c;
  547. var toPropertyKey = toPropertyKey$2;
  548. var $TypeError$7 = TypeError;
  549. // eslint-disable-next-line es/no-object-defineproperty -- safe
  550. var $defineProperty = Object.defineProperty;
  551. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  552. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  553. var ENUMERABLE = 'enumerable';
  554. var CONFIGURABLE$1 = 'configurable';
  555. var WRITABLE = 'writable';
  556. // `Object.defineProperty` method
  557. // https://tc39.es/ecma262/#sec-object.defineproperty
  558. objectDefineProperty.f = DESCRIPTORS$c ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
  559. anObject$b(O);
  560. P = toPropertyKey(P);
  561. anObject$b(Attributes);
  562. if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  563. var current = $getOwnPropertyDescriptor(O, P);
  564. if (current && current[WRITABLE]) {
  565. O[P] = Attributes.value;
  566. Attributes = {
  567. configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
  568. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  569. writable: false
  570. };
  571. }
  572. } return $defineProperty(O, P, Attributes);
  573. } : $defineProperty : function defineProperty(O, P, Attributes) {
  574. anObject$b(O);
  575. P = toPropertyKey(P);
  576. anObject$b(Attributes);
  577. if (IE8_DOM_DEFINE) try {
  578. return $defineProperty(O, P, Attributes);
  579. } catch (error) { /* empty */ }
  580. if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$7('Accessors not supported');
  581. if ('value' in Attributes) O[P] = Attributes.value;
  582. return O;
  583. };
  584. var DESCRIPTORS$b = descriptors;
  585. var definePropertyModule$4 = objectDefineProperty;
  586. var createPropertyDescriptor$2 = createPropertyDescriptor$4;
  587. var createNonEnumerableProperty$7 = DESCRIPTORS$b ? function (object, key, value) {
  588. return definePropertyModule$4.f(object, key, createPropertyDescriptor$2(1, value));
  589. } : function (object, key, value) {
  590. object[key] = value;
  591. return object;
  592. };
  593. var makeBuiltIn$3 = {exports: {}};
  594. var DESCRIPTORS$a = descriptors;
  595. var hasOwn$9 = hasOwnProperty_1;
  596. var FunctionPrototype$1 = Function.prototype;
  597. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  598. var getDescriptor = DESCRIPTORS$a && Object.getOwnPropertyDescriptor;
  599. var EXISTS = hasOwn$9(FunctionPrototype$1, 'name');
  600. // additional protection from minified / mangled / dropped function names
  601. var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
  602. var CONFIGURABLE = EXISTS && (!DESCRIPTORS$a || (DESCRIPTORS$a && getDescriptor(FunctionPrototype$1, 'name').configurable));
  603. var functionName = {
  604. EXISTS: EXISTS,
  605. PROPER: PROPER,
  606. CONFIGURABLE: CONFIGURABLE
  607. };
  608. var uncurryThis$t = functionUncurryThis;
  609. var isCallable$c = isCallable$i;
  610. var store$1 = sharedStoreExports;
  611. var functionToString = uncurryThis$t(Function.toString);
  612. // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
  613. if (!isCallable$c(store$1.inspectSource)) {
  614. store$1.inspectSource = function (it) {
  615. return functionToString(it);
  616. };
  617. }
  618. var inspectSource$2 = store$1.inspectSource;
  619. var global$d = global$k;
  620. var isCallable$b = isCallable$i;
  621. var WeakMap$1 = global$d.WeakMap;
  622. var weakMapBasicDetection = isCallable$b(WeakMap$1) && /native code/.test(String(WeakMap$1));
  623. var shared$2 = shared$4;
  624. var uid = uid$2;
  625. var keys$1 = shared$2('keys');
  626. var sharedKey$3 = function (key) {
  627. return keys$1[key] || (keys$1[key] = uid(key));
  628. };
  629. var hiddenKeys$4 = {};
  630. var NATIVE_WEAK_MAP = weakMapBasicDetection;
  631. var global$c = global$k;
  632. var isObject$8 = isObject$d;
  633. var createNonEnumerableProperty$6 = createNonEnumerableProperty$7;
  634. var hasOwn$8 = hasOwnProperty_1;
  635. var shared$1 = sharedStoreExports;
  636. var sharedKey$2 = sharedKey$3;
  637. var hiddenKeys$3 = hiddenKeys$4;
  638. var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
  639. var TypeError$2 = global$c.TypeError;
  640. var WeakMap = global$c.WeakMap;
  641. var set, get, has;
  642. var enforce = function (it) {
  643. return has(it) ? get(it) : set(it, {});
  644. };
  645. var getterFor = function (TYPE) {
  646. return function (it) {
  647. var state;
  648. if (!isObject$8(it) || (state = get(it)).type !== TYPE) {
  649. throw new TypeError$2('Incompatible receiver, ' + TYPE + ' required');
  650. } return state;
  651. };
  652. };
  653. if (NATIVE_WEAK_MAP || shared$1.state) {
  654. var store = shared$1.state || (shared$1.state = new WeakMap());
  655. /* eslint-disable no-self-assign -- prototype methods protection */
  656. store.get = store.get;
  657. store.has = store.has;
  658. store.set = store.set;
  659. /* eslint-enable no-self-assign -- prototype methods protection */
  660. set = function (it, metadata) {
  661. if (store.has(it)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
  662. metadata.facade = it;
  663. store.set(it, metadata);
  664. return metadata;
  665. };
  666. get = function (it) {
  667. return store.get(it) || {};
  668. };
  669. has = function (it) {
  670. return store.has(it);
  671. };
  672. } else {
  673. var STATE = sharedKey$2('state');
  674. hiddenKeys$3[STATE] = true;
  675. set = function (it, metadata) {
  676. if (hasOwn$8(it, STATE)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
  677. metadata.facade = it;
  678. createNonEnumerableProperty$6(it, STATE, metadata);
  679. return metadata;
  680. };
  681. get = function (it) {
  682. return hasOwn$8(it, STATE) ? it[STATE] : {};
  683. };
  684. has = function (it) {
  685. return hasOwn$8(it, STATE);
  686. };
  687. }
  688. var internalState = {
  689. set: set,
  690. get: get,
  691. has: has,
  692. enforce: enforce,
  693. getterFor: getterFor
  694. };
  695. var uncurryThis$s = functionUncurryThis;
  696. var fails$q = fails$x;
  697. var isCallable$a = isCallable$i;
  698. var hasOwn$7 = hasOwnProperty_1;
  699. var DESCRIPTORS$9 = descriptors;
  700. var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
  701. var inspectSource$1 = inspectSource$2;
  702. var InternalStateModule$1 = internalState;
  703. var enforceInternalState$1 = InternalStateModule$1.enforce;
  704. var getInternalState$2 = InternalStateModule$1.get;
  705. var $String$2 = String;
  706. // eslint-disable-next-line es/no-object-defineproperty -- safe
  707. var defineProperty$7 = Object.defineProperty;
  708. var stringSlice$8 = uncurryThis$s(''.slice);
  709. var replace$4 = uncurryThis$s(''.replace);
  710. var join = uncurryThis$s([].join);
  711. var CONFIGURABLE_LENGTH = DESCRIPTORS$9 && !fails$q(function () {
  712. return defineProperty$7(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
  713. });
  714. var TEMPLATE = String(String).split('String');
  715. var makeBuiltIn$2 = makeBuiltIn$3.exports = function (value, name, options) {
  716. if (stringSlice$8($String$2(name), 0, 7) === 'Symbol(') {
  717. name = '[' + replace$4($String$2(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
  718. }
  719. if (options && options.getter) name = 'get ' + name;
  720. if (options && options.setter) name = 'set ' + name;
  721. if (!hasOwn$7(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
  722. if (DESCRIPTORS$9) defineProperty$7(value, 'name', { value: name, configurable: true });
  723. else value.name = name;
  724. }
  725. if (CONFIGURABLE_LENGTH && options && hasOwn$7(options, 'arity') && value.length !== options.arity) {
  726. defineProperty$7(value, 'length', { value: options.arity });
  727. }
  728. try {
  729. if (options && hasOwn$7(options, 'constructor') && options.constructor) {
  730. if (DESCRIPTORS$9) defineProperty$7(value, 'prototype', { writable: false });
  731. // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
  732. } else if (value.prototype) value.prototype = undefined;
  733. } catch (error) { /* empty */ }
  734. var state = enforceInternalState$1(value);
  735. if (!hasOwn$7(state, 'source')) {
  736. state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
  737. } return value;
  738. };
  739. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  740. // eslint-disable-next-line no-extend-native -- required
  741. Function.prototype.toString = makeBuiltIn$2(function toString() {
  742. return isCallable$a(this) && getInternalState$2(this).source || inspectSource$1(this);
  743. }, 'toString');
  744. var makeBuiltInExports = makeBuiltIn$3.exports;
  745. var isCallable$9 = isCallable$i;
  746. var definePropertyModule$3 = objectDefineProperty;
  747. var makeBuiltIn$1 = makeBuiltInExports;
  748. var defineGlobalProperty$1 = defineGlobalProperty$3;
  749. var defineBuiltIn$7 = function (O, key, value, options) {
  750. if (!options) options = {};
  751. var simple = options.enumerable;
  752. var name = options.name !== undefined ? options.name : key;
  753. if (isCallable$9(value)) makeBuiltIn$1(value, name, options);
  754. if (options.global) {
  755. if (simple) O[key] = value;
  756. else defineGlobalProperty$1(key, value);
  757. } else {
  758. try {
  759. if (!options.unsafe) delete O[key];
  760. else if (O[key]) simple = true;
  761. } catch (error) { /* empty */ }
  762. if (simple) O[key] = value;
  763. else definePropertyModule$3.f(O, key, {
  764. value: value,
  765. enumerable: false,
  766. configurable: !options.nonConfigurable,
  767. writable: !options.nonWritable
  768. });
  769. } return O;
  770. };
  771. var objectGetOwnPropertyNames = {};
  772. var ceil = Math.ceil;
  773. var floor$2 = Math.floor;
  774. // `Math.trunc` method
  775. // https://tc39.es/ecma262/#sec-math.trunc
  776. // eslint-disable-next-line es/no-math-trunc -- safe
  777. var mathTrunc = Math.trunc || function trunc(x) {
  778. var n = +x;
  779. return (n > 0 ? floor$2 : ceil)(n);
  780. };
  781. var trunc = mathTrunc;
  782. // `ToIntegerOrInfinity` abstract operation
  783. // https://tc39.es/ecma262/#sec-tointegerorinfinity
  784. var toIntegerOrInfinity$5 = function (argument) {
  785. var number = +argument;
  786. // eslint-disable-next-line no-self-compare -- NaN check
  787. return number !== number || number === 0 ? 0 : trunc(number);
  788. };
  789. var toIntegerOrInfinity$4 = toIntegerOrInfinity$5;
  790. var max$3 = Math.max;
  791. var min$6 = Math.min;
  792. // Helper for a popular repeating case of the spec:
  793. // Let integer be ? ToInteger(index).
  794. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  795. var toAbsoluteIndex$3 = function (index, length) {
  796. var integer = toIntegerOrInfinity$4(index);
  797. return integer < 0 ? max$3(integer + length, 0) : min$6(integer, length);
  798. };
  799. var toIntegerOrInfinity$3 = toIntegerOrInfinity$5;
  800. var min$5 = Math.min;
  801. // `ToLength` abstract operation
  802. // https://tc39.es/ecma262/#sec-tolength
  803. var toLength$6 = function (argument) {
  804. var len = toIntegerOrInfinity$3(argument);
  805. return len > 0 ? min$5(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  806. };
  807. var toLength$5 = toLength$6;
  808. // `LengthOfArrayLike` abstract operation
  809. // https://tc39.es/ecma262/#sec-lengthofarraylike
  810. var lengthOfArrayLike$6 = function (obj) {
  811. return toLength$5(obj.length);
  812. };
  813. var toIndexedObject$6 = toIndexedObject$8;
  814. var toAbsoluteIndex$2 = toAbsoluteIndex$3;
  815. var lengthOfArrayLike$5 = lengthOfArrayLike$6;
  816. // `Array.prototype.{ indexOf, includes }` methods implementation
  817. var createMethod$4 = function (IS_INCLUDES) {
  818. return function ($this, el, fromIndex) {
  819. var O = toIndexedObject$6($this);
  820. var length = lengthOfArrayLike$5(O);
  821. if (length === 0) return !IS_INCLUDES && -1;
  822. var index = toAbsoluteIndex$2(fromIndex, length);
  823. var value;
  824. // Array#includes uses SameValueZero equality algorithm
  825. // eslint-disable-next-line no-self-compare -- NaN check
  826. if (IS_INCLUDES && el !== el) while (length > index) {
  827. value = O[index++];
  828. // eslint-disable-next-line no-self-compare -- NaN check
  829. if (value !== value) return true;
  830. // Array#indexOf ignores holes, Array#includes - not
  831. } else for (;length > index; index++) {
  832. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  833. } return !IS_INCLUDES && -1;
  834. };
  835. };
  836. var arrayIncludes = {
  837. // `Array.prototype.includes` method
  838. // https://tc39.es/ecma262/#sec-array.prototype.includes
  839. includes: createMethod$4(true),
  840. // `Array.prototype.indexOf` method
  841. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  842. indexOf: createMethod$4(false)
  843. };
  844. var uncurryThis$r = functionUncurryThis;
  845. var hasOwn$6 = hasOwnProperty_1;
  846. var toIndexedObject$5 = toIndexedObject$8;
  847. var indexOf$1 = arrayIncludes.indexOf;
  848. var hiddenKeys$2 = hiddenKeys$4;
  849. var push$5 = uncurryThis$r([].push);
  850. var objectKeysInternal = function (object, names) {
  851. var O = toIndexedObject$5(object);
  852. var i = 0;
  853. var result = [];
  854. var key;
  855. for (key in O) !hasOwn$6(hiddenKeys$2, key) && hasOwn$6(O, key) && push$5(result, key);
  856. // Don't enum bug & hidden keys
  857. while (names.length > i) if (hasOwn$6(O, key = names[i++])) {
  858. ~indexOf$1(result, key) || push$5(result, key);
  859. }
  860. return result;
  861. };
  862. // IE8- don't enum bug keys
  863. var enumBugKeys$3 = [
  864. 'constructor',
  865. 'hasOwnProperty',
  866. 'isPrototypeOf',
  867. 'propertyIsEnumerable',
  868. 'toLocaleString',
  869. 'toString',
  870. 'valueOf'
  871. ];
  872. var internalObjectKeys$1 = objectKeysInternal;
  873. var enumBugKeys$2 = enumBugKeys$3;
  874. var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
  875. // `Object.getOwnPropertyNames` method
  876. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  877. // eslint-disable-next-line es/no-object-getownpropertynames -- safe
  878. objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  879. return internalObjectKeys$1(O, hiddenKeys$1);
  880. };
  881. var objectGetOwnPropertySymbols = {};
  882. // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
  883. objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
  884. var getBuiltIn$3 = getBuiltIn$5;
  885. var uncurryThis$q = functionUncurryThis;
  886. var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
  887. var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
  888. var anObject$a = anObject$c;
  889. var concat$2 = uncurryThis$q([].concat);
  890. // all object keys, includes non-enumerable and symbols
  891. var ownKeys$1 = getBuiltIn$3('Reflect', 'ownKeys') || function ownKeys(it) {
  892. var keys = getOwnPropertyNamesModule.f(anObject$a(it));
  893. var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
  894. return getOwnPropertySymbols ? concat$2(keys, getOwnPropertySymbols(it)) : keys;
  895. };
  896. var hasOwn$5 = hasOwnProperty_1;
  897. var ownKeys = ownKeys$1;
  898. var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
  899. var definePropertyModule$2 = objectDefineProperty;
  900. var copyConstructorProperties$2 = function (target, source, exceptions) {
  901. var keys = ownKeys(source);
  902. var defineProperty = definePropertyModule$2.f;
  903. var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  904. for (var i = 0; i < keys.length; i++) {
  905. var key = keys[i];
  906. if (!hasOwn$5(target, key) && !(exceptions && hasOwn$5(exceptions, key))) {
  907. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  908. }
  909. }
  910. };
  911. var fails$p = fails$x;
  912. var isCallable$8 = isCallable$i;
  913. var replacement = /#|\.prototype\./;
  914. var isForced$3 = function (feature, detection) {
  915. var value = data[normalize(feature)];
  916. return value === POLYFILL ? true
  917. : value === NATIVE ? false
  918. : isCallable$8(detection) ? fails$p(detection)
  919. : !!detection;
  920. };
  921. var normalize = isForced$3.normalize = function (string) {
  922. return String(string).replace(replacement, '.').toLowerCase();
  923. };
  924. var data = isForced$3.data = {};
  925. var NATIVE = isForced$3.NATIVE = 'N';
  926. var POLYFILL = isForced$3.POLYFILL = 'P';
  927. var isForced_1 = isForced$3;
  928. var global$b = global$k;
  929. var getOwnPropertyDescriptor$4 = objectGetOwnPropertyDescriptor.f;
  930. var createNonEnumerableProperty$5 = createNonEnumerableProperty$7;
  931. var defineBuiltIn$6 = defineBuiltIn$7;
  932. var defineGlobalProperty = defineGlobalProperty$3;
  933. var copyConstructorProperties$1 = copyConstructorProperties$2;
  934. var isForced$2 = isForced_1;
  935. /*
  936. options.target - name of the target object
  937. options.global - target is the global object
  938. options.stat - export as static methods of target
  939. options.proto - export as prototype methods of target
  940. options.real - real prototype method for the `pure` version
  941. options.forced - export even if the native feature is available
  942. options.bind - bind methods to the target, required for the `pure` version
  943. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  944. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  945. options.sham - add a flag to not completely full polyfills
  946. options.enumerable - export as enumerable property
  947. options.dontCallGetSet - prevent calling a getter on target
  948. options.name - the .name of the function if it does not match the key
  949. */
  950. var _export = function (options, source) {
  951. var TARGET = options.target;
  952. var GLOBAL = options.global;
  953. var STATIC = options.stat;
  954. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  955. if (GLOBAL) {
  956. target = global$b;
  957. } else if (STATIC) {
  958. target = global$b[TARGET] || defineGlobalProperty(TARGET, {});
  959. } else {
  960. target = global$b[TARGET] && global$b[TARGET].prototype;
  961. }
  962. if (target) for (key in source) {
  963. sourceProperty = source[key];
  964. if (options.dontCallGetSet) {
  965. descriptor = getOwnPropertyDescriptor$4(target, key);
  966. targetProperty = descriptor && descriptor.value;
  967. } else targetProperty = target[key];
  968. FORCED = isForced$2(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  969. // contained in target
  970. if (!FORCED && targetProperty !== undefined) {
  971. if (typeof sourceProperty == typeof targetProperty) continue;
  972. copyConstructorProperties$1(sourceProperty, targetProperty);
  973. }
  974. // add a flag to not completely full polyfills
  975. if (options.sham || (targetProperty && targetProperty.sham)) {
  976. createNonEnumerableProperty$5(sourceProperty, 'sham', true);
  977. }
  978. defineBuiltIn$6(target, key, sourceProperty, options);
  979. }
  980. };
  981. var classof$6 = classofRaw$2;
  982. // `IsArray` abstract operation
  983. // https://tc39.es/ecma262/#sec-isarray
  984. // eslint-disable-next-line es/no-array-isarray -- safe
  985. var isArray$5 = Array.isArray || function isArray(argument) {
  986. return classof$6(argument) === 'Array';
  987. };
  988. var $TypeError$6 = TypeError;
  989. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
  990. var doesNotExceedSafeInteger$2 = function (it) {
  991. if (it > MAX_SAFE_INTEGER) throw $TypeError$6('Maximum allowed index exceeded');
  992. return it;
  993. };
  994. var DESCRIPTORS$8 = descriptors;
  995. var definePropertyModule$1 = objectDefineProperty;
  996. var createPropertyDescriptor$1 = createPropertyDescriptor$4;
  997. var createProperty$3 = function (object, key, value) {
  998. if (DESCRIPTORS$8) definePropertyModule$1.f(object, key, createPropertyDescriptor$1(0, value));
  999. else object[key] = value;
  1000. };
  1001. var wellKnownSymbol$h = wellKnownSymbol$j;
  1002. var TO_STRING_TAG$2 = wellKnownSymbol$h('toStringTag');
  1003. var test$2 = {};
  1004. test$2[TO_STRING_TAG$2] = 'z';
  1005. var toStringTagSupport = String(test$2) === '[object z]';
  1006. var TO_STRING_TAG_SUPPORT$2 = toStringTagSupport;
  1007. var isCallable$7 = isCallable$i;
  1008. var classofRaw$1 = classofRaw$2;
  1009. var wellKnownSymbol$g = wellKnownSymbol$j;
  1010. var TO_STRING_TAG$1 = wellKnownSymbol$g('toStringTag');
  1011. var $Object$1 = Object;
  1012. // ES3 wrong here
  1013. var CORRECT_ARGUMENTS = classofRaw$1(function () { return arguments; }()) === 'Arguments';
  1014. // fallback for IE11 Script Access Denied error
  1015. var tryGet = function (it, key) {
  1016. try {
  1017. return it[key];
  1018. } catch (error) { /* empty */ }
  1019. };
  1020. // getting tag from ES6+ `Object.prototype.toString`
  1021. var classof$5 = TO_STRING_TAG_SUPPORT$2 ? classofRaw$1 : function (it) {
  1022. var O, tag, result;
  1023. return it === undefined ? 'Undefined' : it === null ? 'Null'
  1024. // @@toStringTag case
  1025. : typeof (tag = tryGet(O = $Object$1(it), TO_STRING_TAG$1)) == 'string' ? tag
  1026. // builtinTag case
  1027. : CORRECT_ARGUMENTS ? classofRaw$1(O)
  1028. // ES3 arguments fallback
  1029. : (result = classofRaw$1(O)) === 'Object' && isCallable$7(O.callee) ? 'Arguments' : result;
  1030. };
  1031. var uncurryThis$p = functionUncurryThis;
  1032. var fails$o = fails$x;
  1033. var isCallable$6 = isCallable$i;
  1034. var classof$4 = classof$5;
  1035. var getBuiltIn$2 = getBuiltIn$5;
  1036. var inspectSource = inspectSource$2;
  1037. var noop = function () { /* empty */ };
  1038. var construct = getBuiltIn$2('Reflect', 'construct');
  1039. var constructorRegExp = /^\s*(?:class|function)\b/;
  1040. var exec$3 = uncurryThis$p(constructorRegExp.exec);
  1041. var INCORRECT_TO_STRING = !constructorRegExp.test(noop);
  1042. var isConstructorModern = function isConstructor(argument) {
  1043. if (!isCallable$6(argument)) return false;
  1044. try {
  1045. construct(noop, [], argument);
  1046. return true;
  1047. } catch (error) {
  1048. return false;
  1049. }
  1050. };
  1051. var isConstructorLegacy = function isConstructor(argument) {
  1052. if (!isCallable$6(argument)) return false;
  1053. switch (classof$4(argument)) {
  1054. case 'AsyncFunction':
  1055. case 'GeneratorFunction':
  1056. case 'AsyncGeneratorFunction': return false;
  1057. }
  1058. try {
  1059. // we can't check .prototype since constructors produced by .bind haven't it
  1060. // `Function#toString` throws on some built-it function in some legacy engines
  1061. // (for example, `DOMQuad` and similar in FF41-)
  1062. return INCORRECT_TO_STRING || !!exec$3(constructorRegExp, inspectSource(argument));
  1063. } catch (error) {
  1064. return true;
  1065. }
  1066. };
  1067. isConstructorLegacy.sham = true;
  1068. // `IsConstructor` abstract operation
  1069. // https://tc39.es/ecma262/#sec-isconstructor
  1070. var isConstructor$3 = !construct || fails$o(function () {
  1071. var called;
  1072. return isConstructorModern(isConstructorModern.call)
  1073. || !isConstructorModern(Object)
  1074. || !isConstructorModern(function () { called = true; })
  1075. || called;
  1076. }) ? isConstructorLegacy : isConstructorModern;
  1077. var isArray$4 = isArray$5;
  1078. var isConstructor$2 = isConstructor$3;
  1079. var isObject$7 = isObject$d;
  1080. var wellKnownSymbol$f = wellKnownSymbol$j;
  1081. var SPECIES$5 = wellKnownSymbol$f('species');
  1082. var $Array$1 = Array;
  1083. // a part of `ArraySpeciesCreate` abstract operation
  1084. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  1085. var arraySpeciesConstructor$1 = function (originalArray) {
  1086. var C;
  1087. if (isArray$4(originalArray)) {
  1088. C = originalArray.constructor;
  1089. // cross-realm fallback
  1090. if (isConstructor$2(C) && (C === $Array$1 || isArray$4(C.prototype))) C = undefined;
  1091. else if (isObject$7(C)) {
  1092. C = C[SPECIES$5];
  1093. if (C === null) C = undefined;
  1094. }
  1095. } return C === undefined ? $Array$1 : C;
  1096. };
  1097. var arraySpeciesConstructor = arraySpeciesConstructor$1;
  1098. // `ArraySpeciesCreate` abstract operation
  1099. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  1100. var arraySpeciesCreate$3 = function (originalArray, length) {
  1101. return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
  1102. };
  1103. var fails$n = fails$x;
  1104. var wellKnownSymbol$e = wellKnownSymbol$j;
  1105. var V8_VERSION$1 = engineV8Version;
  1106. var SPECIES$4 = wellKnownSymbol$e('species');
  1107. var arrayMethodHasSpeciesSupport$5 = function (METHOD_NAME) {
  1108. // We can't use this feature detection in V8 since it causes
  1109. // deoptimization and serious performance degradation
  1110. // https://github.com/zloirock/core-js/issues/677
  1111. return V8_VERSION$1 >= 51 || !fails$n(function () {
  1112. var array = [];
  1113. var constructor = array.constructor = {};
  1114. constructor[SPECIES$4] = function () {
  1115. return { foo: 1 };
  1116. };
  1117. return array[METHOD_NAME](Boolean).foo !== 1;
  1118. });
  1119. };
  1120. var $$p = _export;
  1121. var fails$m = fails$x;
  1122. var isArray$3 = isArray$5;
  1123. var isObject$6 = isObject$d;
  1124. var toObject$9 = toObject$b;
  1125. var lengthOfArrayLike$4 = lengthOfArrayLike$6;
  1126. var doesNotExceedSafeInteger$1 = doesNotExceedSafeInteger$2;
  1127. var createProperty$2 = createProperty$3;
  1128. var arraySpeciesCreate$2 = arraySpeciesCreate$3;
  1129. var arrayMethodHasSpeciesSupport$4 = arrayMethodHasSpeciesSupport$5;
  1130. var wellKnownSymbol$d = wellKnownSymbol$j;
  1131. var V8_VERSION = engineV8Version;
  1132. var IS_CONCAT_SPREADABLE = wellKnownSymbol$d('isConcatSpreadable');
  1133. // We can't use this feature detection in V8 since it causes
  1134. // deoptimization and serious performance degradation
  1135. // https://github.com/zloirock/core-js/issues/679
  1136. var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails$m(function () {
  1137. var array = [];
  1138. array[IS_CONCAT_SPREADABLE] = false;
  1139. return array.concat()[0] !== array;
  1140. });
  1141. var isConcatSpreadable = function (O) {
  1142. if (!isObject$6(O)) return false;
  1143. var spreadable = O[IS_CONCAT_SPREADABLE];
  1144. return spreadable !== undefined ? !!spreadable : isArray$3(O);
  1145. };
  1146. var FORCED$7 = !IS_CONCAT_SPREADABLE_SUPPORT || !arrayMethodHasSpeciesSupport$4('concat');
  1147. // `Array.prototype.concat` method
  1148. // https://tc39.es/ecma262/#sec-array.prototype.concat
  1149. // with adding support of @@isConcatSpreadable and @@species
  1150. $$p({ target: 'Array', proto: true, arity: 1, forced: FORCED$7 }, {
  1151. // eslint-disable-next-line no-unused-vars -- required for `.length`
  1152. concat: function concat(arg) {
  1153. var O = toObject$9(this);
  1154. var A = arraySpeciesCreate$2(O, 0);
  1155. var n = 0;
  1156. var i, k, length, len, E;
  1157. for (i = -1, length = arguments.length; i < length; i++) {
  1158. E = i === -1 ? O : arguments[i];
  1159. if (isConcatSpreadable(E)) {
  1160. len = lengthOfArrayLike$4(E);
  1161. doesNotExceedSafeInteger$1(n + len);
  1162. for (k = 0; k < len; k++, n++) if (k in E) createProperty$2(A, n, E[k]);
  1163. } else {
  1164. doesNotExceedSafeInteger$1(n + 1);
  1165. createProperty$2(A, n++, E);
  1166. }
  1167. }
  1168. A.length = n;
  1169. return A;
  1170. }
  1171. });
  1172. var classofRaw = classofRaw$2;
  1173. var uncurryThis$o = functionUncurryThis;
  1174. var functionUncurryThisClause = function (fn) {
  1175. // Nashorn bug:
  1176. // https://github.com/zloirock/core-js/issues/1128
  1177. // https://github.com/zloirock/core-js/issues/1130
  1178. if (classofRaw(fn) === 'Function') return uncurryThis$o(fn);
  1179. };
  1180. var uncurryThis$n = functionUncurryThisClause;
  1181. var aCallable$2 = aCallable$4;
  1182. var NATIVE_BIND$1 = functionBindNative;
  1183. var bind$1 = uncurryThis$n(uncurryThis$n.bind);
  1184. // optional / simple context binding
  1185. var functionBindContext = function (fn, that) {
  1186. aCallable$2(fn);
  1187. return that === undefined ? fn : NATIVE_BIND$1 ? bind$1(fn, that) : function (/* ...args */) {
  1188. return fn.apply(that, arguments);
  1189. };
  1190. };
  1191. var bind = functionBindContext;
  1192. var uncurryThis$m = functionUncurryThis;
  1193. var IndexedObject$2 = indexedObject;
  1194. var toObject$8 = toObject$b;
  1195. var lengthOfArrayLike$3 = lengthOfArrayLike$6;
  1196. var arraySpeciesCreate$1 = arraySpeciesCreate$3;
  1197. var push$4 = uncurryThis$m([].push);
  1198. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
  1199. var createMethod$3 = function (TYPE) {
  1200. var IS_MAP = TYPE === 1;
  1201. var IS_FILTER = TYPE === 2;
  1202. var IS_SOME = TYPE === 3;
  1203. var IS_EVERY = TYPE === 4;
  1204. var IS_FIND_INDEX = TYPE === 6;
  1205. var IS_FILTER_REJECT = TYPE === 7;
  1206. var NO_HOLES = TYPE === 5 || IS_FIND_INDEX;
  1207. return function ($this, callbackfn, that, specificCreate) {
  1208. var O = toObject$8($this);
  1209. var self = IndexedObject$2(O);
  1210. var length = lengthOfArrayLike$3(self);
  1211. var boundFunction = bind(callbackfn, that);
  1212. var index = 0;
  1213. var create = specificCreate || arraySpeciesCreate$1;
  1214. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
  1215. var value, result;
  1216. for (;length > index; index++) if (NO_HOLES || index in self) {
  1217. value = self[index];
  1218. result = boundFunction(value, index, O);
  1219. if (TYPE) {
  1220. if (IS_MAP) target[index] = result; // map
  1221. else if (result) switch (TYPE) {
  1222. case 3: return true; // some
  1223. case 5: return value; // find
  1224. case 6: return index; // findIndex
  1225. case 2: push$4(target, value); // filter
  1226. } else switch (TYPE) {
  1227. case 4: return false; // every
  1228. case 7: push$4(target, value); // filterReject
  1229. }
  1230. }
  1231. }
  1232. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  1233. };
  1234. };
  1235. var arrayIteration = {
  1236. // `Array.prototype.forEach` method
  1237. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  1238. forEach: createMethod$3(0),
  1239. // `Array.prototype.map` method
  1240. // https://tc39.es/ecma262/#sec-array.prototype.map
  1241. map: createMethod$3(1),
  1242. // `Array.prototype.filter` method
  1243. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1244. filter: createMethod$3(2),
  1245. // `Array.prototype.some` method
  1246. // https://tc39.es/ecma262/#sec-array.prototype.some
  1247. some: createMethod$3(3),
  1248. // `Array.prototype.every` method
  1249. // https://tc39.es/ecma262/#sec-array.prototype.every
  1250. every: createMethod$3(4),
  1251. // `Array.prototype.find` method
  1252. // https://tc39.es/ecma262/#sec-array.prototype.find
  1253. find: createMethod$3(5),
  1254. // `Array.prototype.findIndex` method
  1255. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  1256. findIndex: createMethod$3(6),
  1257. // `Array.prototype.filterReject` method
  1258. // https://github.com/tc39/proposal-array-filtering
  1259. filterReject: createMethod$3(7)
  1260. };
  1261. var $$o = _export;
  1262. var $filter = arrayIteration.filter;
  1263. var arrayMethodHasSpeciesSupport$3 = arrayMethodHasSpeciesSupport$5;
  1264. var HAS_SPECIES_SUPPORT$3 = arrayMethodHasSpeciesSupport$3('filter');
  1265. // `Array.prototype.filter` method
  1266. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1267. // with adding support of @@species
  1268. $$o({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$3 }, {
  1269. filter: function filter(callbackfn /* , thisArg */) {
  1270. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1271. }
  1272. });
  1273. var objectDefineProperties = {};
  1274. var internalObjectKeys = objectKeysInternal;
  1275. var enumBugKeys$1 = enumBugKeys$3;
  1276. // `Object.keys` method
  1277. // https://tc39.es/ecma262/#sec-object.keys
  1278. // eslint-disable-next-line es/no-object-keys -- safe
  1279. var objectKeys$3 = Object.keys || function keys(O) {
  1280. return internalObjectKeys(O, enumBugKeys$1);
  1281. };
  1282. var DESCRIPTORS$7 = descriptors;
  1283. var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
  1284. var definePropertyModule = objectDefineProperty;
  1285. var anObject$9 = anObject$c;
  1286. var toIndexedObject$4 = toIndexedObject$8;
  1287. var objectKeys$2 = objectKeys$3;
  1288. // `Object.defineProperties` method
  1289. // https://tc39.es/ecma262/#sec-object.defineproperties
  1290. // eslint-disable-next-line es/no-object-defineproperties -- safe
  1291. objectDefineProperties.f = DESCRIPTORS$7 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
  1292. anObject$9(O);
  1293. var props = toIndexedObject$4(Properties);
  1294. var keys = objectKeys$2(Properties);
  1295. var length = keys.length;
  1296. var index = 0;
  1297. var key;
  1298. while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
  1299. return O;
  1300. };
  1301. var getBuiltIn$1 = getBuiltIn$5;
  1302. var html$1 = getBuiltIn$1('document', 'documentElement');
  1303. /* global ActiveXObject -- old IE, WSH */
  1304. var anObject$8 = anObject$c;
  1305. var definePropertiesModule = objectDefineProperties;
  1306. var enumBugKeys = enumBugKeys$3;
  1307. var hiddenKeys = hiddenKeys$4;
  1308. var html = html$1;
  1309. var documentCreateElement$1 = documentCreateElement$2;
  1310. var sharedKey$1 = sharedKey$3;
  1311. var GT = '>';
  1312. var LT = '<';
  1313. var PROTOTYPE = 'prototype';
  1314. var SCRIPT = 'script';
  1315. var IE_PROTO$1 = sharedKey$1('IE_PROTO');
  1316. var EmptyConstructor = function () { /* empty */ };
  1317. var scriptTag = function (content) {
  1318. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  1319. };
  1320. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  1321. var NullProtoObjectViaActiveX = function (activeXDocument) {
  1322. activeXDocument.write(scriptTag(''));
  1323. activeXDocument.close();
  1324. var temp = activeXDocument.parentWindow.Object;
  1325. activeXDocument = null; // avoid memory leak
  1326. return temp;
  1327. };
  1328. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  1329. var NullProtoObjectViaIFrame = function () {
  1330. // Thrash, waste and sodomy: IE GC bug
  1331. var iframe = documentCreateElement$1('iframe');
  1332. var JS = 'java' + SCRIPT + ':';
  1333. var iframeDocument;
  1334. iframe.style.display = 'none';
  1335. html.appendChild(iframe);
  1336. // https://github.com/zloirock/core-js/issues/475
  1337. iframe.src = String(JS);
  1338. iframeDocument = iframe.contentWindow.document;
  1339. iframeDocument.open();
  1340. iframeDocument.write(scriptTag('document.F=Object'));
  1341. iframeDocument.close();
  1342. return iframeDocument.F;
  1343. };
  1344. // Check for document.domain and active x support
  1345. // No need to use active x approach when document.domain is not set
  1346. // see https://github.com/es-shims/es5-shim/issues/150
  1347. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  1348. // avoid IE GC bug
  1349. var activeXDocument;
  1350. var NullProtoObject = function () {
  1351. try {
  1352. activeXDocument = new ActiveXObject('htmlfile');
  1353. } catch (error) { /* ignore */ }
  1354. NullProtoObject = typeof document != 'undefined'
  1355. ? document.domain && activeXDocument
  1356. ? NullProtoObjectViaActiveX(activeXDocument) // old IE
  1357. : NullProtoObjectViaIFrame()
  1358. : NullProtoObjectViaActiveX(activeXDocument); // WSH
  1359. var length = enumBugKeys.length;
  1360. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  1361. return NullProtoObject();
  1362. };
  1363. hiddenKeys[IE_PROTO$1] = true;
  1364. // `Object.create` method
  1365. // https://tc39.es/ecma262/#sec-object.create
  1366. // eslint-disable-next-line es/no-object-create -- safe
  1367. var objectCreate = Object.create || function create(O, Properties) {
  1368. var result;
  1369. if (O !== null) {
  1370. EmptyConstructor[PROTOTYPE] = anObject$8(O);
  1371. result = new EmptyConstructor();
  1372. EmptyConstructor[PROTOTYPE] = null;
  1373. // add "__proto__" for Object.getPrototypeOf polyfill
  1374. result[IE_PROTO$1] = O;
  1375. } else result = NullProtoObject();
  1376. return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
  1377. };
  1378. var wellKnownSymbol$c = wellKnownSymbol$j;
  1379. var create$3 = objectCreate;
  1380. var defineProperty$6 = objectDefineProperty.f;
  1381. var UNSCOPABLES = wellKnownSymbol$c('unscopables');
  1382. var ArrayPrototype = Array.prototype;
  1383. // Array.prototype[@@unscopables]
  1384. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1385. if (ArrayPrototype[UNSCOPABLES] === undefined) {
  1386. defineProperty$6(ArrayPrototype, UNSCOPABLES, {
  1387. configurable: true,
  1388. value: create$3(null)
  1389. });
  1390. }
  1391. // add a key to Array.prototype[@@unscopables]
  1392. var addToUnscopables$4 = function (key) {
  1393. ArrayPrototype[UNSCOPABLES][key] = true;
  1394. };
  1395. var $$n = _export;
  1396. var $find = arrayIteration.find;
  1397. var addToUnscopables$3 = addToUnscopables$4;
  1398. var FIND = 'find';
  1399. var SKIPS_HOLES$1 = true;
  1400. // Shouldn't skip holes
  1401. // eslint-disable-next-line es/no-array-prototype-find -- testing
  1402. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES$1 = false; });
  1403. // `Array.prototype.find` method
  1404. // https://tc39.es/ecma262/#sec-array.prototype.find
  1405. $$n({ target: 'Array', proto: true, forced: SKIPS_HOLES$1 }, {
  1406. find: function find(callbackfn /* , that = undefined */) {
  1407. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1408. }
  1409. });
  1410. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1411. addToUnscopables$3(FIND);
  1412. var $$m = _export;
  1413. var $findIndex = arrayIteration.findIndex;
  1414. var addToUnscopables$2 = addToUnscopables$4;
  1415. var FIND_INDEX = 'findIndex';
  1416. var SKIPS_HOLES = true;
  1417. // Shouldn't skip holes
  1418. // eslint-disable-next-line es/no-array-prototype-findindex -- testing
  1419. if (FIND_INDEX in []) Array(1)[FIND_INDEX](function () { SKIPS_HOLES = false; });
  1420. // `Array.prototype.findIndex` method
  1421. // https://tc39.es/ecma262/#sec-array.prototype.findindex
  1422. $$m({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  1423. findIndex: function findIndex(callbackfn /* , that = undefined */) {
  1424. return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1425. }
  1426. });
  1427. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1428. addToUnscopables$2(FIND_INDEX);
  1429. var $$l = _export;
  1430. var $includes = arrayIncludes.includes;
  1431. var fails$l = fails$x;
  1432. var addToUnscopables$1 = addToUnscopables$4;
  1433. // FF99+ bug
  1434. var BROKEN_ON_SPARSE = fails$l(function () {
  1435. // eslint-disable-next-line es/no-array-prototype-includes -- detection
  1436. return !Array(1).includes();
  1437. });
  1438. // `Array.prototype.includes` method
  1439. // https://tc39.es/ecma262/#sec-array.prototype.includes
  1440. $$l({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
  1441. includes: function includes(el /* , fromIndex = 0 */) {
  1442. return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  1443. }
  1444. });
  1445. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1446. addToUnscopables$1('includes');
  1447. var fails$k = fails$x;
  1448. var arrayMethodIsStrict$4 = function (METHOD_NAME, argument) {
  1449. var method = [][METHOD_NAME];
  1450. return !!method && fails$k(function () {
  1451. // eslint-disable-next-line no-useless-call -- required for testing
  1452. method.call(null, argument || function () { return 1; }, 1);
  1453. });
  1454. };
  1455. /* eslint-disable es/no-array-prototype-indexof -- required for testing */
  1456. var $$k = _export;
  1457. var uncurryThis$l = functionUncurryThisClause;
  1458. var $indexOf = arrayIncludes.indexOf;
  1459. var arrayMethodIsStrict$3 = arrayMethodIsStrict$4;
  1460. var nativeIndexOf = uncurryThis$l([].indexOf);
  1461. var NEGATIVE_ZERO = !!nativeIndexOf && 1 / nativeIndexOf([1], 1, -0) < 0;
  1462. var FORCED$6 = NEGATIVE_ZERO || !arrayMethodIsStrict$3('indexOf');
  1463. // `Array.prototype.indexOf` method
  1464. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  1465. $$k({ target: 'Array', proto: true, forced: FORCED$6 }, {
  1466. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  1467. var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
  1468. return NEGATIVE_ZERO
  1469. // convert -0 to +0
  1470. ? nativeIndexOf(this, searchElement, fromIndex) || 0
  1471. : $indexOf(this, searchElement, fromIndex);
  1472. }
  1473. });
  1474. var iterators = {};
  1475. var fails$j = fails$x;
  1476. var correctPrototypeGetter = !fails$j(function () {
  1477. function F() { /* empty */ }
  1478. F.prototype.constructor = null;
  1479. // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
  1480. return Object.getPrototypeOf(new F()) !== F.prototype;
  1481. });
  1482. var hasOwn$4 = hasOwnProperty_1;
  1483. var isCallable$5 = isCallable$i;
  1484. var toObject$7 = toObject$b;
  1485. var sharedKey = sharedKey$3;
  1486. var CORRECT_PROTOTYPE_GETTER$1 = correctPrototypeGetter;
  1487. var IE_PROTO = sharedKey('IE_PROTO');
  1488. var $Object = Object;
  1489. var ObjectPrototype = $Object.prototype;
  1490. // `Object.getPrototypeOf` method
  1491. // https://tc39.es/ecma262/#sec-object.getprototypeof
  1492. // eslint-disable-next-line es/no-object-getprototypeof -- safe
  1493. var objectGetPrototypeOf$1 = CORRECT_PROTOTYPE_GETTER$1 ? $Object.getPrototypeOf : function (O) {
  1494. var object = toObject$7(O);
  1495. if (hasOwn$4(object, IE_PROTO)) return object[IE_PROTO];
  1496. var constructor = object.constructor;
  1497. if (isCallable$5(constructor) && object instanceof constructor) {
  1498. return constructor.prototype;
  1499. } return object instanceof $Object ? ObjectPrototype : null;
  1500. };
  1501. var fails$i = fails$x;
  1502. var isCallable$4 = isCallable$i;
  1503. var isObject$5 = isObject$d;
  1504. var getPrototypeOf$1 = objectGetPrototypeOf$1;
  1505. var defineBuiltIn$5 = defineBuiltIn$7;
  1506. var wellKnownSymbol$b = wellKnownSymbol$j;
  1507. var ITERATOR$4 = wellKnownSymbol$b('iterator');
  1508. var BUGGY_SAFARI_ITERATORS$1 = false;
  1509. // `%IteratorPrototype%` object
  1510. // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
  1511. var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
  1512. /* eslint-disable es/no-array-prototype-keys -- safe */
  1513. if ([].keys) {
  1514. arrayIterator = [].keys();
  1515. // Safari 8 has buggy iterators w/o `next`
  1516. if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
  1517. else {
  1518. PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
  1519. if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
  1520. }
  1521. }
  1522. var NEW_ITERATOR_PROTOTYPE = !isObject$5(IteratorPrototype$2) || fails$i(function () {
  1523. var test = {};
  1524. // FF44- legacy iterators case
  1525. return IteratorPrototype$2[ITERATOR$4].call(test) !== test;
  1526. });
  1527. if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
  1528. // `%IteratorPrototype%[@@iterator]()` method
  1529. // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
  1530. if (!isCallable$4(IteratorPrototype$2[ITERATOR$4])) {
  1531. defineBuiltIn$5(IteratorPrototype$2, ITERATOR$4, function () {
  1532. return this;
  1533. });
  1534. }
  1535. var iteratorsCore = {
  1536. IteratorPrototype: IteratorPrototype$2,
  1537. BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
  1538. };
  1539. var defineProperty$5 = objectDefineProperty.f;
  1540. var hasOwn$3 = hasOwnProperty_1;
  1541. var wellKnownSymbol$a = wellKnownSymbol$j;
  1542. var TO_STRING_TAG = wellKnownSymbol$a('toStringTag');
  1543. var setToStringTag$3 = function (target, TAG, STATIC) {
  1544. if (target && !STATIC) target = target.prototype;
  1545. if (target && !hasOwn$3(target, TO_STRING_TAG)) {
  1546. defineProperty$5(target, TO_STRING_TAG, { configurable: true, value: TAG });
  1547. }
  1548. };
  1549. var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
  1550. var create$2 = objectCreate;
  1551. var createPropertyDescriptor = createPropertyDescriptor$4;
  1552. var setToStringTag$2 = setToStringTag$3;
  1553. var Iterators$2 = iterators;
  1554. var returnThis$1 = function () { return this; };
  1555. var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
  1556. var TO_STRING_TAG = NAME + ' Iterator';
  1557. IteratorConstructor.prototype = create$2(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
  1558. setToStringTag$2(IteratorConstructor, TO_STRING_TAG, false);
  1559. Iterators$2[TO_STRING_TAG] = returnThis$1;
  1560. return IteratorConstructor;
  1561. };
  1562. var uncurryThis$k = functionUncurryThis;
  1563. var aCallable$1 = aCallable$4;
  1564. var functionUncurryThisAccessor = function (object, key, method) {
  1565. try {
  1566. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  1567. return uncurryThis$k(aCallable$1(Object.getOwnPropertyDescriptor(object, key)[method]));
  1568. } catch (error) { /* empty */ }
  1569. };
  1570. var isObject$4 = isObject$d;
  1571. var isPossiblePrototype$1 = function (argument) {
  1572. return isObject$4(argument) || argument === null;
  1573. };
  1574. var isPossiblePrototype = isPossiblePrototype$1;
  1575. var $String$1 = String;
  1576. var $TypeError$5 = TypeError;
  1577. var aPossiblePrototype$1 = function (argument) {
  1578. if (isPossiblePrototype(argument)) return argument;
  1579. throw new $TypeError$5("Can't set " + $String$1(argument) + ' as a prototype');
  1580. };
  1581. /* eslint-disable no-proto -- safe */
  1582. var uncurryThisAccessor = functionUncurryThisAccessor;
  1583. var isObject$3 = isObject$d;
  1584. var requireObjectCoercible$9 = requireObjectCoercible$c;
  1585. var aPossiblePrototype = aPossiblePrototype$1;
  1586. // `Object.setPrototypeOf` method
  1587. // https://tc39.es/ecma262/#sec-object.setprototypeof
  1588. // Works with __proto__ only. Old v8 can't work with null proto objects.
  1589. // eslint-disable-next-line es/no-object-setprototypeof -- safe
  1590. var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
  1591. var CORRECT_SETTER = false;
  1592. var test = {};
  1593. var setter;
  1594. try {
  1595. setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');
  1596. setter(test, []);
  1597. CORRECT_SETTER = test instanceof Array;
  1598. } catch (error) { /* empty */ }
  1599. return function setPrototypeOf(O, proto) {
  1600. requireObjectCoercible$9(O);
  1601. aPossiblePrototype(proto);
  1602. if (!isObject$3(O)) return O;
  1603. if (CORRECT_SETTER) setter(O, proto);
  1604. else O.__proto__ = proto;
  1605. return O;
  1606. };
  1607. }() : undefined);
  1608. var $$j = _export;
  1609. var call$a = functionCall;
  1610. var FunctionName = functionName;
  1611. var isCallable$3 = isCallable$i;
  1612. var createIteratorConstructor = iteratorCreateConstructor;
  1613. var getPrototypeOf = objectGetPrototypeOf$1;
  1614. var setPrototypeOf$1 = objectSetPrototypeOf;
  1615. var setToStringTag$1 = setToStringTag$3;
  1616. var createNonEnumerableProperty$4 = createNonEnumerableProperty$7;
  1617. var defineBuiltIn$4 = defineBuiltIn$7;
  1618. var wellKnownSymbol$9 = wellKnownSymbol$j;
  1619. var Iterators$1 = iterators;
  1620. var IteratorsCore = iteratorsCore;
  1621. var PROPER_FUNCTION_NAME$2 = FunctionName.PROPER;
  1622. var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
  1623. var IteratorPrototype = IteratorsCore.IteratorPrototype;
  1624. var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
  1625. var ITERATOR$3 = wellKnownSymbol$9('iterator');
  1626. var KEYS = 'keys';
  1627. var VALUES = 'values';
  1628. var ENTRIES = 'entries';
  1629. var returnThis = function () { return this; };
  1630. var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
  1631. createIteratorConstructor(IteratorConstructor, NAME, next);
  1632. var getIterationMethod = function (KIND) {
  1633. if (KIND === DEFAULT && defaultIterator) return defaultIterator;
  1634. if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
  1635. switch (KIND) {
  1636. case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
  1637. case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
  1638. case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
  1639. }
  1640. return function () { return new IteratorConstructor(this); };
  1641. };
  1642. var TO_STRING_TAG = NAME + ' Iterator';
  1643. var INCORRECT_VALUES_NAME = false;
  1644. var IterablePrototype = Iterable.prototype;
  1645. var nativeIterator = IterablePrototype[ITERATOR$3]
  1646. || IterablePrototype['@@iterator']
  1647. || DEFAULT && IterablePrototype[DEFAULT];
  1648. var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
  1649. var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
  1650. var CurrentIteratorPrototype, methods, KEY;
  1651. // fix native
  1652. if (anyNativeIterator) {
  1653. CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
  1654. if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
  1655. if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
  1656. if (setPrototypeOf$1) {
  1657. setPrototypeOf$1(CurrentIteratorPrototype, IteratorPrototype);
  1658. } else if (!isCallable$3(CurrentIteratorPrototype[ITERATOR$3])) {
  1659. defineBuiltIn$4(CurrentIteratorPrototype, ITERATOR$3, returnThis);
  1660. }
  1661. }
  1662. // Set @@toStringTag to native iterators
  1663. setToStringTag$1(CurrentIteratorPrototype, TO_STRING_TAG, true);
  1664. }
  1665. }
  1666. // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
  1667. if (PROPER_FUNCTION_NAME$2 && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
  1668. if (CONFIGURABLE_FUNCTION_NAME) {
  1669. createNonEnumerableProperty$4(IterablePrototype, 'name', VALUES);
  1670. } else {
  1671. INCORRECT_VALUES_NAME = true;
  1672. defaultIterator = function values() { return call$a(nativeIterator, this); };
  1673. }
  1674. }
  1675. // export additional methods
  1676. if (DEFAULT) {
  1677. methods = {
  1678. values: getIterationMethod(VALUES),
  1679. keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
  1680. entries: getIterationMethod(ENTRIES)
  1681. };
  1682. if (FORCED) for (KEY in methods) {
  1683. if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
  1684. defineBuiltIn$4(IterablePrototype, KEY, methods[KEY]);
  1685. }
  1686. } else $$j({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
  1687. }
  1688. // define iterator
  1689. if (IterablePrototype[ITERATOR$3] !== defaultIterator) {
  1690. defineBuiltIn$4(IterablePrototype, ITERATOR$3, defaultIterator, { name: DEFAULT });
  1691. }
  1692. Iterators$1[NAME] = defaultIterator;
  1693. return methods;
  1694. };
  1695. // `CreateIterResultObject` abstract operation
  1696. // https://tc39.es/ecma262/#sec-createiterresultobject
  1697. var createIterResultObject$1 = function (value, done) {
  1698. return { value: value, done: done };
  1699. };
  1700. var toIndexedObject$3 = toIndexedObject$8;
  1701. var addToUnscopables = addToUnscopables$4;
  1702. var Iterators = iterators;
  1703. var InternalStateModule = internalState;
  1704. var defineProperty$4 = objectDefineProperty.f;
  1705. var defineIterator = iteratorDefine;
  1706. var createIterResultObject = createIterResultObject$1;
  1707. var DESCRIPTORS$6 = descriptors;
  1708. var ARRAY_ITERATOR = 'Array Iterator';
  1709. var setInternalState = InternalStateModule.set;
  1710. var getInternalState$1 = InternalStateModule.getterFor(ARRAY_ITERATOR);
  1711. // `Array.prototype.entries` method
  1712. // https://tc39.es/ecma262/#sec-array.prototype.entries
  1713. // `Array.prototype.keys` method
  1714. // https://tc39.es/ecma262/#sec-array.prototype.keys
  1715. // `Array.prototype.values` method
  1716. // https://tc39.es/ecma262/#sec-array.prototype.values
  1717. // `Array.prototype[@@iterator]` method
  1718. // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
  1719. // `CreateArrayIterator` internal method
  1720. // https://tc39.es/ecma262/#sec-createarrayiterator
  1721. var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
  1722. setInternalState(this, {
  1723. type: ARRAY_ITERATOR,
  1724. target: toIndexedObject$3(iterated), // target
  1725. index: 0, // next index
  1726. kind: kind // kind
  1727. });
  1728. // `%ArrayIteratorPrototype%.next` method
  1729. // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
  1730. }, function () {
  1731. var state = getInternalState$1(this);
  1732. var target = state.target;
  1733. var index = state.index++;
  1734. if (!target || index >= target.length) {
  1735. state.target = undefined;
  1736. return createIterResultObject(undefined, true);
  1737. }
  1738. switch (state.kind) {
  1739. case 'keys': return createIterResultObject(index, false);
  1740. case 'values': return createIterResultObject(target[index], false);
  1741. } return createIterResultObject([index, target[index]], false);
  1742. }, 'values');
  1743. // argumentsList[@@iterator] is %ArrayProto_values%
  1744. // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
  1745. // https://tc39.es/ecma262/#sec-createmappedargumentsobject
  1746. var values = Iterators.Arguments = Iterators.Array;
  1747. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1748. addToUnscopables('keys');
  1749. addToUnscopables('values');
  1750. addToUnscopables('entries');
  1751. // V8 ~ Chrome 45- bug
  1752. if (DESCRIPTORS$6 && values.name !== 'values') try {
  1753. defineProperty$4(values, 'name', { value: 'values' });
  1754. } catch (error) { /* empty */ }
  1755. var $$i = _export;
  1756. var uncurryThis$j = functionUncurryThis;
  1757. var IndexedObject$1 = indexedObject;
  1758. var toIndexedObject$2 = toIndexedObject$8;
  1759. var arrayMethodIsStrict$2 = arrayMethodIsStrict$4;
  1760. var nativeJoin = uncurryThis$j([].join);
  1761. var ES3_STRINGS = IndexedObject$1 !== Object;
  1762. var FORCED$5 = ES3_STRINGS || !arrayMethodIsStrict$2('join', ',');
  1763. // `Array.prototype.join` method
  1764. // https://tc39.es/ecma262/#sec-array.prototype.join
  1765. $$i({ target: 'Array', proto: true, forced: FORCED$5 }, {
  1766. join: function join(separator) {
  1767. return nativeJoin(toIndexedObject$2(this), separator === undefined ? ',' : separator);
  1768. }
  1769. });
  1770. var $$h = _export;
  1771. var $map = arrayIteration.map;
  1772. var arrayMethodHasSpeciesSupport$2 = arrayMethodHasSpeciesSupport$5;
  1773. var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport$2('map');
  1774. // `Array.prototype.map` method
  1775. // https://tc39.es/ecma262/#sec-array.prototype.map
  1776. // with adding support of @@species
  1777. $$h({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 }, {
  1778. map: function map(callbackfn /* , thisArg */) {
  1779. return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1780. }
  1781. });
  1782. var $$g = _export;
  1783. var uncurryThis$i = functionUncurryThis;
  1784. var isArray$2 = isArray$5;
  1785. var nativeReverse = uncurryThis$i([].reverse);
  1786. var test$1 = [1, 2];
  1787. // `Array.prototype.reverse` method
  1788. // https://tc39.es/ecma262/#sec-array.prototype.reverse
  1789. // fix for Safari 12.0 bug
  1790. // https://bugs.webkit.org/show_bug.cgi?id=188794
  1791. $$g({ target: 'Array', proto: true, forced: String(test$1) === String(test$1.reverse()) }, {
  1792. reverse: function reverse() {
  1793. // eslint-disable-next-line no-self-assign -- dirty hack
  1794. if (isArray$2(this)) this.length = this.length;
  1795. return nativeReverse(this);
  1796. }
  1797. });
  1798. var uncurryThis$h = functionUncurryThis;
  1799. var arraySlice$1 = uncurryThis$h([].slice);
  1800. var $$f = _export;
  1801. var isArray$1 = isArray$5;
  1802. var isConstructor$1 = isConstructor$3;
  1803. var isObject$2 = isObject$d;
  1804. var toAbsoluteIndex$1 = toAbsoluteIndex$3;
  1805. var lengthOfArrayLike$2 = lengthOfArrayLike$6;
  1806. var toIndexedObject$1 = toIndexedObject$8;
  1807. var createProperty$1 = createProperty$3;
  1808. var wellKnownSymbol$8 = wellKnownSymbol$j;
  1809. var arrayMethodHasSpeciesSupport$1 = arrayMethodHasSpeciesSupport$5;
  1810. var nativeSlice = arraySlice$1;
  1811. var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport$1('slice');
  1812. var SPECIES$3 = wellKnownSymbol$8('species');
  1813. var $Array = Array;
  1814. var max$2 = Math.max;
  1815. // `Array.prototype.slice` method
  1816. // https://tc39.es/ecma262/#sec-array.prototype.slice
  1817. // fallback for not array-like ES3 strings and DOM objects
  1818. $$f({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
  1819. slice: function slice(start, end) {
  1820. var O = toIndexedObject$1(this);
  1821. var length = lengthOfArrayLike$2(O);
  1822. var k = toAbsoluteIndex$1(start, length);
  1823. var fin = toAbsoluteIndex$1(end === undefined ? length : end, length);
  1824. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  1825. var Constructor, result, n;
  1826. if (isArray$1(O)) {
  1827. Constructor = O.constructor;
  1828. // cross-realm fallback
  1829. if (isConstructor$1(Constructor) && (Constructor === $Array || isArray$1(Constructor.prototype))) {
  1830. Constructor = undefined;
  1831. } else if (isObject$2(Constructor)) {
  1832. Constructor = Constructor[SPECIES$3];
  1833. if (Constructor === null) Constructor = undefined;
  1834. }
  1835. if (Constructor === $Array || Constructor === undefined) {
  1836. return nativeSlice(O, k, fin);
  1837. }
  1838. }
  1839. result = new (Constructor === undefined ? $Array : Constructor)(max$2(fin - k, 0));
  1840. for (n = 0; k < fin; k++, n++) if (k in O) createProperty$1(result, n, O[k]);
  1841. result.length = n;
  1842. return result;
  1843. }
  1844. });
  1845. var tryToString$1 = tryToString$3;
  1846. var $TypeError$4 = TypeError;
  1847. var deletePropertyOrThrow$2 = function (O, P) {
  1848. if (!delete O[P]) throw new $TypeError$4('Cannot delete property ' + tryToString$1(P) + ' of ' + tryToString$1(O));
  1849. };
  1850. var classof$3 = classof$5;
  1851. var $String = String;
  1852. var toString$f = function (argument) {
  1853. if (classof$3(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
  1854. return $String(argument);
  1855. };
  1856. var arraySlice = arraySlice$1;
  1857. var floor$1 = Math.floor;
  1858. var sort = function (array, comparefn) {
  1859. var length = array.length;
  1860. if (length < 8) {
  1861. // insertion sort
  1862. var i = 1;
  1863. var element, j;
  1864. while (i < length) {
  1865. j = i;
  1866. element = array[i];
  1867. while (j && comparefn(array[j - 1], element) > 0) {
  1868. array[j] = array[--j];
  1869. }
  1870. if (j !== i++) array[j] = element;
  1871. }
  1872. } else {
  1873. // merge sort
  1874. var middle = floor$1(length / 2);
  1875. var left = sort(arraySlice(array, 0, middle), comparefn);
  1876. var right = sort(arraySlice(array, middle), comparefn);
  1877. var llength = left.length;
  1878. var rlength = right.length;
  1879. var lindex = 0;
  1880. var rindex = 0;
  1881. while (lindex < llength || rindex < rlength) {
  1882. array[lindex + rindex] = (lindex < llength && rindex < rlength)
  1883. ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
  1884. : lindex < llength ? left[lindex++] : right[rindex++];
  1885. }
  1886. }
  1887. return array;
  1888. };
  1889. var arraySort = sort;
  1890. var userAgent$1 = engineUserAgent;
  1891. var firefox = userAgent$1.match(/firefox\/(\d+)/i);
  1892. var engineFfVersion = !!firefox && +firefox[1];
  1893. var UA = engineUserAgent;
  1894. var engineIsIeOrEdge = /MSIE|Trident/.test(UA);
  1895. var userAgent = engineUserAgent;
  1896. var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
  1897. var engineWebkitVersion = !!webkit && +webkit[1];
  1898. var $$e = _export;
  1899. var uncurryThis$g = functionUncurryThis;
  1900. var aCallable = aCallable$4;
  1901. var toObject$6 = toObject$b;
  1902. var lengthOfArrayLike$1 = lengthOfArrayLike$6;
  1903. var deletePropertyOrThrow$1 = deletePropertyOrThrow$2;
  1904. var toString$e = toString$f;
  1905. var fails$h = fails$x;
  1906. var internalSort = arraySort;
  1907. var arrayMethodIsStrict$1 = arrayMethodIsStrict$4;
  1908. var FF = engineFfVersion;
  1909. var IE_OR_EDGE = engineIsIeOrEdge;
  1910. var V8 = engineV8Version;
  1911. var WEBKIT = engineWebkitVersion;
  1912. var test = [];
  1913. var nativeSort = uncurryThis$g(test.sort);
  1914. var push$3 = uncurryThis$g(test.push);
  1915. // IE8-
  1916. var FAILS_ON_UNDEFINED = fails$h(function () {
  1917. test.sort(undefined);
  1918. });
  1919. // V8 bug
  1920. var FAILS_ON_NULL = fails$h(function () {
  1921. test.sort(null);
  1922. });
  1923. // Old WebKit
  1924. var STRICT_METHOD$1 = arrayMethodIsStrict$1('sort');
  1925. var STABLE_SORT = !fails$h(function () {
  1926. // feature detection can be too slow, so check engines versions
  1927. if (V8) return V8 < 70;
  1928. if (FF && FF > 3) return;
  1929. if (IE_OR_EDGE) return true;
  1930. if (WEBKIT) return WEBKIT < 603;
  1931. var result = '';
  1932. var code, chr, value, index;
  1933. // generate an array with more 512 elements (Chakra and old V8 fails only in this case)
  1934. for (code = 65; code < 76; code++) {
  1935. chr = String.fromCharCode(code);
  1936. switch (code) {
  1937. case 66: case 69: case 70: case 72: value = 3; break;
  1938. case 68: case 71: value = 4; break;
  1939. default: value = 2;
  1940. }
  1941. for (index = 0; index < 47; index++) {
  1942. test.push({ k: chr + index, v: value });
  1943. }
  1944. }
  1945. test.sort(function (a, b) { return b.v - a.v; });
  1946. for (index = 0; index < test.length; index++) {
  1947. chr = test[index].k.charAt(0);
  1948. if (result.charAt(result.length - 1) !== chr) result += chr;
  1949. }
  1950. return result !== 'DGBEFHACIJK';
  1951. });
  1952. var FORCED$4 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD$1 || !STABLE_SORT;
  1953. var getSortCompare = function (comparefn) {
  1954. return function (x, y) {
  1955. if (y === undefined) return -1;
  1956. if (x === undefined) return 1;
  1957. if (comparefn !== undefined) return +comparefn(x, y) || 0;
  1958. return toString$e(x) > toString$e(y) ? 1 : -1;
  1959. };
  1960. };
  1961. // `Array.prototype.sort` method
  1962. // https://tc39.es/ecma262/#sec-array.prototype.sort
  1963. $$e({ target: 'Array', proto: true, forced: FORCED$4 }, {
  1964. sort: function sort(comparefn) {
  1965. if (comparefn !== undefined) aCallable(comparefn);
  1966. var array = toObject$6(this);
  1967. if (STABLE_SORT) return comparefn === undefined ? nativeSort(array) : nativeSort(array, comparefn);
  1968. var items = [];
  1969. var arrayLength = lengthOfArrayLike$1(array);
  1970. var itemsLength, index;
  1971. for (index = 0; index < arrayLength; index++) {
  1972. if (index in array) push$3(items, array[index]);
  1973. }
  1974. internalSort(items, getSortCompare(comparefn));
  1975. itemsLength = lengthOfArrayLike$1(items);
  1976. index = 0;
  1977. while (index < itemsLength) array[index] = items[index++];
  1978. while (index < arrayLength) deletePropertyOrThrow$1(array, index++);
  1979. return array;
  1980. }
  1981. });
  1982. var DESCRIPTORS$5 = descriptors;
  1983. var isArray = isArray$5;
  1984. var $TypeError$3 = TypeError;
  1985. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  1986. var getOwnPropertyDescriptor$3 = Object.getOwnPropertyDescriptor;
  1987. // Safari < 13 does not throw an error in this case
  1988. var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS$5 && !function () {
  1989. // makes no sense without proper strict mode support
  1990. if (this !== undefined) return true;
  1991. try {
  1992. // eslint-disable-next-line es/no-object-defineproperty -- safe
  1993. Object.defineProperty([], 'length', { writable: false }).length = 1;
  1994. } catch (error) {
  1995. return error instanceof TypeError;
  1996. }
  1997. }();
  1998. var arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
  1999. if (isArray(O) && !getOwnPropertyDescriptor$3(O, 'length').writable) {
  2000. throw new $TypeError$3('Cannot set read only .length');
  2001. } return O.length = length;
  2002. } : function (O, length) {
  2003. return O.length = length;
  2004. };
  2005. var $$d = _export;
  2006. var toObject$5 = toObject$b;
  2007. var toAbsoluteIndex = toAbsoluteIndex$3;
  2008. var toIntegerOrInfinity$2 = toIntegerOrInfinity$5;
  2009. var lengthOfArrayLike = lengthOfArrayLike$6;
  2010. var setArrayLength = arraySetLength;
  2011. var doesNotExceedSafeInteger = doesNotExceedSafeInteger$2;
  2012. var arraySpeciesCreate = arraySpeciesCreate$3;
  2013. var createProperty = createProperty$3;
  2014. var deletePropertyOrThrow = deletePropertyOrThrow$2;
  2015. var arrayMethodHasSpeciesSupport = arrayMethodHasSpeciesSupport$5;
  2016. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
  2017. var max$1 = Math.max;
  2018. var min$4 = Math.min;
  2019. // `Array.prototype.splice` method
  2020. // https://tc39.es/ecma262/#sec-array.prototype.splice
  2021. // with adding support of @@species
  2022. $$d({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  2023. splice: function splice(start, deleteCount /* , ...items */) {
  2024. var O = toObject$5(this);
  2025. var len = lengthOfArrayLike(O);
  2026. var actualStart = toAbsoluteIndex(start, len);
  2027. var argumentsLength = arguments.length;
  2028. var insertCount, actualDeleteCount, A, k, from, to;
  2029. if (argumentsLength === 0) {
  2030. insertCount = actualDeleteCount = 0;
  2031. } else if (argumentsLength === 1) {
  2032. insertCount = 0;
  2033. actualDeleteCount = len - actualStart;
  2034. } else {
  2035. insertCount = argumentsLength - 2;
  2036. actualDeleteCount = min$4(max$1(toIntegerOrInfinity$2(deleteCount), 0), len - actualStart);
  2037. }
  2038. doesNotExceedSafeInteger(len + insertCount - actualDeleteCount);
  2039. A = arraySpeciesCreate(O, actualDeleteCount);
  2040. for (k = 0; k < actualDeleteCount; k++) {
  2041. from = actualStart + k;
  2042. if (from in O) createProperty(A, k, O[from]);
  2043. }
  2044. A.length = actualDeleteCount;
  2045. if (insertCount < actualDeleteCount) {
  2046. for (k = actualStart; k < len - actualDeleteCount; k++) {
  2047. from = k + actualDeleteCount;
  2048. to = k + insertCount;
  2049. if (from in O) O[to] = O[from];
  2050. else deletePropertyOrThrow(O, to);
  2051. }
  2052. for (k = len; k > len - actualDeleteCount + insertCount; k--) deletePropertyOrThrow(O, k - 1);
  2053. } else if (insertCount > actualDeleteCount) {
  2054. for (k = len - actualDeleteCount; k > actualStart; k--) {
  2055. from = k + actualDeleteCount - 1;
  2056. to = k + insertCount - 1;
  2057. if (from in O) O[to] = O[from];
  2058. else deletePropertyOrThrow(O, to);
  2059. }
  2060. }
  2061. for (k = 0; k < insertCount; k++) {
  2062. O[k + actualStart] = arguments[k + 2];
  2063. }
  2064. setArrayLength(O, len - actualDeleteCount + insertCount);
  2065. return A;
  2066. }
  2067. });
  2068. var $$c = _export;
  2069. var fails$g = fails$x;
  2070. var toObject$4 = toObject$b;
  2071. var toPrimitive$1 = toPrimitive$3;
  2072. var FORCED$3 = fails$g(function () {
  2073. return new Date(NaN).toJSON() !== null
  2074. || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1;
  2075. });
  2076. // `Date.prototype.toJSON` method
  2077. // https://tc39.es/ecma262/#sec-date.prototype.tojson
  2078. $$c({ target: 'Date', proto: true, arity: 1, forced: FORCED$3 }, {
  2079. // eslint-disable-next-line no-unused-vars -- required for `.length`
  2080. toJSON: function toJSON(key) {
  2081. var O = toObject$4(this);
  2082. var pv = toPrimitive$1(O, 'number');
  2083. return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();
  2084. }
  2085. });
  2086. var global$a = global$k;
  2087. var path$1 = global$a;
  2088. var isCallable$2 = isCallable$i;
  2089. var isObject$1 = isObject$d;
  2090. var setPrototypeOf = objectSetPrototypeOf;
  2091. // makes subclassing work correct for wrapped built-ins
  2092. var inheritIfRequired$2 = function ($this, dummy, Wrapper) {
  2093. var NewTarget, NewTargetPrototype;
  2094. if (
  2095. // it can work only with native `setPrototypeOf`
  2096. setPrototypeOf &&
  2097. // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
  2098. isCallable$2(NewTarget = dummy.constructor) &&
  2099. NewTarget !== Wrapper &&
  2100. isObject$1(NewTargetPrototype = NewTarget.prototype) &&
  2101. NewTargetPrototype !== Wrapper.prototype
  2102. ) setPrototypeOf($this, NewTargetPrototype);
  2103. return $this;
  2104. };
  2105. var uncurryThis$f = functionUncurryThis;
  2106. // `thisNumberValue` abstract operation
  2107. // https://tc39.es/ecma262/#sec-thisnumbervalue
  2108. var thisNumberValue$1 = uncurryThis$f(1.0.valueOf);
  2109. // a string of all valid unicode whitespaces
  2110. var whitespaces$4 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
  2111. '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  2112. var uncurryThis$e = functionUncurryThis;
  2113. var requireObjectCoercible$8 = requireObjectCoercible$c;
  2114. var toString$d = toString$f;
  2115. var whitespaces$3 = whitespaces$4;
  2116. var replace$3 = uncurryThis$e(''.replace);
  2117. var ltrim = RegExp('^[' + whitespaces$3 + ']+');
  2118. var rtrim = RegExp('(^|[^' + whitespaces$3 + '])[' + whitespaces$3 + ']+$');
  2119. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  2120. var createMethod$2 = function (TYPE) {
  2121. return function ($this) {
  2122. var string = toString$d(requireObjectCoercible$8($this));
  2123. if (TYPE & 1) string = replace$3(string, ltrim, '');
  2124. if (TYPE & 2) string = replace$3(string, rtrim, '$1');
  2125. return string;
  2126. };
  2127. };
  2128. var stringTrim = {
  2129. // `String.prototype.{ trimLeft, trimStart }` methods
  2130. // https://tc39.es/ecma262/#sec-string.prototype.trimstart
  2131. start: createMethod$2(1),
  2132. // `String.prototype.{ trimRight, trimEnd }` methods
  2133. // https://tc39.es/ecma262/#sec-string.prototype.trimend
  2134. end: createMethod$2(2),
  2135. // `String.prototype.trim` method
  2136. // https://tc39.es/ecma262/#sec-string.prototype.trim
  2137. trim: createMethod$2(3)
  2138. };
  2139. var $$b = _export;
  2140. var IS_PURE = isPure;
  2141. var DESCRIPTORS$4 = descriptors;
  2142. var global$9 = global$k;
  2143. var path = path$1;
  2144. var uncurryThis$d = functionUncurryThis;
  2145. var isForced$1 = isForced_1;
  2146. var hasOwn$2 = hasOwnProperty_1;
  2147. var inheritIfRequired$1 = inheritIfRequired$2;
  2148. var isPrototypeOf$2 = objectIsPrototypeOf;
  2149. var isSymbol = isSymbol$3;
  2150. var toPrimitive = toPrimitive$3;
  2151. var fails$f = fails$x;
  2152. var getOwnPropertyNames$1 = objectGetOwnPropertyNames.f;
  2153. var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f;
  2154. var defineProperty$3 = objectDefineProperty.f;
  2155. var thisNumberValue = thisNumberValue$1;
  2156. var trim$2 = stringTrim.trim;
  2157. var NUMBER = 'Number';
  2158. var NativeNumber = global$9[NUMBER];
  2159. path[NUMBER];
  2160. var NumberPrototype = NativeNumber.prototype;
  2161. var TypeError$1 = global$9.TypeError;
  2162. var stringSlice$7 = uncurryThis$d(''.slice);
  2163. var charCodeAt$1 = uncurryThis$d(''.charCodeAt);
  2164. // `ToNumeric` abstract operation
  2165. // https://tc39.es/ecma262/#sec-tonumeric
  2166. var toNumeric = function (value) {
  2167. var primValue = toPrimitive(value, 'number');
  2168. return typeof primValue == 'bigint' ? primValue : toNumber(primValue);
  2169. };
  2170. // `ToNumber` abstract operation
  2171. // https://tc39.es/ecma262/#sec-tonumber
  2172. var toNumber = function (argument) {
  2173. var it = toPrimitive(argument, 'number');
  2174. var first, third, radix, maxCode, digits, length, index, code;
  2175. if (isSymbol(it)) throw new TypeError$1('Cannot convert a Symbol value to a number');
  2176. if (typeof it == 'string' && it.length > 2) {
  2177. it = trim$2(it);
  2178. first = charCodeAt$1(it, 0);
  2179. if (first === 43 || first === 45) {
  2180. third = charCodeAt$1(it, 2);
  2181. if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
  2182. } else if (first === 48) {
  2183. switch (charCodeAt$1(it, 1)) {
  2184. // fast equal of /^0b[01]+$/i
  2185. case 66:
  2186. case 98:
  2187. radix = 2;
  2188. maxCode = 49;
  2189. break;
  2190. // fast equal of /^0o[0-7]+$/i
  2191. case 79:
  2192. case 111:
  2193. radix = 8;
  2194. maxCode = 55;
  2195. break;
  2196. default:
  2197. return +it;
  2198. }
  2199. digits = stringSlice$7(it, 2);
  2200. length = digits.length;
  2201. for (index = 0; index < length; index++) {
  2202. code = charCodeAt$1(digits, index);
  2203. // parseInt parses a string to a first unavailable symbol
  2204. // but ToNumber should return NaN if a string contains unavailable symbols
  2205. if (code < 48 || code > maxCode) return NaN;
  2206. } return parseInt(digits, radix);
  2207. }
  2208. } return +it;
  2209. };
  2210. var FORCED$2 = isForced$1(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'));
  2211. var calledWithNew = function (dummy) {
  2212. // includes check on 1..constructor(foo) case
  2213. return isPrototypeOf$2(NumberPrototype, dummy) && fails$f(function () { thisNumberValue(dummy); });
  2214. };
  2215. // `Number` constructor
  2216. // https://tc39.es/ecma262/#sec-number-constructor
  2217. var NumberWrapper = function Number(value) {
  2218. var n = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value));
  2219. return calledWithNew(this) ? inheritIfRequired$1(Object(n), this, NumberWrapper) : n;
  2220. };
  2221. NumberWrapper.prototype = NumberPrototype;
  2222. if (FORCED$2 && !IS_PURE) NumberPrototype.constructor = NumberWrapper;
  2223. $$b({ global: true, constructor: true, wrap: true, forced: FORCED$2 }, {
  2224. Number: NumberWrapper
  2225. });
  2226. // Use `internal/copy-constructor-properties` helper in `core-js@4`
  2227. var copyConstructorProperties = function (target, source) {
  2228. for (var keys = DESCRIPTORS$4 ? getOwnPropertyNames$1(source) : (
  2229. // ES3:
  2230. 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
  2231. // ES2015 (in case, if modules with ES2015 Number statics required before):
  2232. 'EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,' +
  2233. // ESNext
  2234. 'fromString,range'
  2235. ).split(','), j = 0, key; keys.length > j; j++) {
  2236. if (hasOwn$2(source, key = keys[j]) && !hasOwn$2(target, key)) {
  2237. defineProperty$3(target, key, getOwnPropertyDescriptor$2(source, key));
  2238. }
  2239. }
  2240. };
  2241. if (FORCED$2 || IS_PURE) copyConstructorProperties(path[NUMBER], NativeNumber);
  2242. var DESCRIPTORS$3 = descriptors;
  2243. var uncurryThis$c = functionUncurryThis;
  2244. var call$9 = functionCall;
  2245. var fails$e = fails$x;
  2246. var objectKeys$1 = objectKeys$3;
  2247. var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
  2248. var propertyIsEnumerableModule = objectPropertyIsEnumerable;
  2249. var toObject$3 = toObject$b;
  2250. var IndexedObject = indexedObject;
  2251. // eslint-disable-next-line es/no-object-assign -- safe
  2252. var $assign = Object.assign;
  2253. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  2254. var defineProperty$2 = Object.defineProperty;
  2255. var concat$1 = uncurryThis$c([].concat);
  2256. // `Object.assign` method
  2257. // https://tc39.es/ecma262/#sec-object.assign
  2258. var objectAssign = !$assign || fails$e(function () {
  2259. // should have correct order of operations (Edge bug)
  2260. if (DESCRIPTORS$3 && $assign({ b: 1 }, $assign(defineProperty$2({}, 'a', {
  2261. enumerable: true,
  2262. get: function () {
  2263. defineProperty$2(this, 'b', {
  2264. value: 3,
  2265. enumerable: false
  2266. });
  2267. }
  2268. }), { b: 2 })).b !== 1) return true;
  2269. // should work with symbols and should have deterministic property order (V8 bug)
  2270. var A = {};
  2271. var B = {};
  2272. // eslint-disable-next-line es/no-symbol -- safe
  2273. var symbol = Symbol('assign detection');
  2274. var alphabet = 'abcdefghijklmnopqrst';
  2275. A[symbol] = 7;
  2276. alphabet.split('').forEach(function (chr) { B[chr] = chr; });
  2277. return $assign({}, A)[symbol] !== 7 || objectKeys$1($assign({}, B)).join('') !== alphabet;
  2278. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
  2279. var T = toObject$3(target);
  2280. var argumentsLength = arguments.length;
  2281. var index = 1;
  2282. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  2283. var propertyIsEnumerable = propertyIsEnumerableModule.f;
  2284. while (argumentsLength > index) {
  2285. var S = IndexedObject(arguments[index++]);
  2286. var keys = getOwnPropertySymbols ? concat$1(objectKeys$1(S), getOwnPropertySymbols(S)) : objectKeys$1(S);
  2287. var length = keys.length;
  2288. var j = 0;
  2289. var key;
  2290. while (length > j) {
  2291. key = keys[j++];
  2292. if (!DESCRIPTORS$3 || call$9(propertyIsEnumerable, S, key)) T[key] = S[key];
  2293. }
  2294. } return T;
  2295. } : $assign;
  2296. var $$a = _export;
  2297. var assign = objectAssign;
  2298. // `Object.assign` method
  2299. // https://tc39.es/ecma262/#sec-object.assign
  2300. // eslint-disable-next-line es/no-object-assign -- required for testing
  2301. $$a({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
  2302. assign: assign
  2303. });
  2304. var DESCRIPTORS$2 = descriptors;
  2305. var fails$d = fails$x;
  2306. var uncurryThis$b = functionUncurryThis;
  2307. var objectGetPrototypeOf = objectGetPrototypeOf$1;
  2308. var objectKeys = objectKeys$3;
  2309. var toIndexedObject = toIndexedObject$8;
  2310. var $propertyIsEnumerable = objectPropertyIsEnumerable.f;
  2311. var propertyIsEnumerable = uncurryThis$b($propertyIsEnumerable);
  2312. var push$2 = uncurryThis$b([].push);
  2313. // in some IE versions, `propertyIsEnumerable` returns incorrect result on integer keys
  2314. // of `null` prototype objects
  2315. var IE_BUG = DESCRIPTORS$2 && fails$d(function () {
  2316. // eslint-disable-next-line es/no-object-create -- safe
  2317. var O = Object.create(null);
  2318. O[2] = 2;
  2319. return !propertyIsEnumerable(O, 2);
  2320. });
  2321. // `Object.{ entries, values }` methods implementation
  2322. var createMethod$1 = function (TO_ENTRIES) {
  2323. return function (it) {
  2324. var O = toIndexedObject(it);
  2325. var keys = objectKeys(O);
  2326. var IE_WORKAROUND = IE_BUG && objectGetPrototypeOf(O) === null;
  2327. var length = keys.length;
  2328. var i = 0;
  2329. var result = [];
  2330. var key;
  2331. while (length > i) {
  2332. key = keys[i++];
  2333. if (!DESCRIPTORS$2 || (IE_WORKAROUND ? key in O : propertyIsEnumerable(O, key))) {
  2334. push$2(result, TO_ENTRIES ? [key, O[key]] : O[key]);
  2335. }
  2336. }
  2337. return result;
  2338. };
  2339. };
  2340. var objectToArray = {
  2341. // `Object.entries` method
  2342. // https://tc39.es/ecma262/#sec-object.entries
  2343. entries: createMethod$1(true),
  2344. // `Object.values` method
  2345. // https://tc39.es/ecma262/#sec-object.values
  2346. values: createMethod$1(false)
  2347. };
  2348. var $$9 = _export;
  2349. var $entries = objectToArray.entries;
  2350. // `Object.entries` method
  2351. // https://tc39.es/ecma262/#sec-object.entries
  2352. $$9({ target: 'Object', stat: true }, {
  2353. entries: function entries(O) {
  2354. return $entries(O);
  2355. }
  2356. });
  2357. var $$8 = _export;
  2358. var toObject$2 = toObject$b;
  2359. var nativeKeys = objectKeys$3;
  2360. var fails$c = fails$x;
  2361. var FAILS_ON_PRIMITIVES$1 = fails$c(function () { nativeKeys(1); });
  2362. // `Object.keys` method
  2363. // https://tc39.es/ecma262/#sec-object.keys
  2364. $$8({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$1 }, {
  2365. keys: function keys(it) {
  2366. return nativeKeys(toObject$2(it));
  2367. }
  2368. });
  2369. var TO_STRING_TAG_SUPPORT$1 = toStringTagSupport;
  2370. var classof$2 = classof$5;
  2371. // `Object.prototype.toString` method implementation
  2372. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  2373. var objectToString = TO_STRING_TAG_SUPPORT$1 ? {}.toString : function toString() {
  2374. return '[object ' + classof$2(this) + ']';
  2375. };
  2376. var TO_STRING_TAG_SUPPORT = toStringTagSupport;
  2377. var defineBuiltIn$3 = defineBuiltIn$7;
  2378. var toString$c = objectToString;
  2379. // `Object.prototype.toString` method
  2380. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  2381. if (!TO_STRING_TAG_SUPPORT) {
  2382. defineBuiltIn$3(Object.prototype, 'toString', toString$c, { unsafe: true });
  2383. }
  2384. var global$8 = global$k;
  2385. var fails$b = fails$x;
  2386. var uncurryThis$a = functionUncurryThis;
  2387. var toString$b = toString$f;
  2388. var trim$1 = stringTrim.trim;
  2389. var whitespaces$2 = whitespaces$4;
  2390. var charAt$5 = uncurryThis$a(''.charAt);
  2391. var $parseFloat$1 = global$8.parseFloat;
  2392. var Symbol$2 = global$8.Symbol;
  2393. var ITERATOR$2 = Symbol$2 && Symbol$2.iterator;
  2394. var FORCED$1 = 1 / $parseFloat$1(whitespaces$2 + '-0') !== -Infinity
  2395. // MS Edge 18- broken with boxed symbols
  2396. || (ITERATOR$2 && !fails$b(function () { $parseFloat$1(Object(ITERATOR$2)); }));
  2397. // `parseFloat` method
  2398. // https://tc39.es/ecma262/#sec-parsefloat-string
  2399. var numberParseFloat = FORCED$1 ? function parseFloat(string) {
  2400. var trimmedString = trim$1(toString$b(string));
  2401. var result = $parseFloat$1(trimmedString);
  2402. return result === 0 && charAt$5(trimmedString, 0) === '-' ? -0 : result;
  2403. } : $parseFloat$1;
  2404. var $$7 = _export;
  2405. var $parseFloat = numberParseFloat;
  2406. // `parseFloat` method
  2407. // https://tc39.es/ecma262/#sec-parsefloat-string
  2408. $$7({ global: true, forced: parseFloat !== $parseFloat }, {
  2409. parseFloat: $parseFloat
  2410. });
  2411. var global$7 = global$k;
  2412. var fails$a = fails$x;
  2413. var uncurryThis$9 = functionUncurryThis;
  2414. var toString$a = toString$f;
  2415. var trim = stringTrim.trim;
  2416. var whitespaces$1 = whitespaces$4;
  2417. var $parseInt$1 = global$7.parseInt;
  2418. var Symbol$1 = global$7.Symbol;
  2419. var ITERATOR$1 = Symbol$1 && Symbol$1.iterator;
  2420. var hex = /^[+-]?0x/i;
  2421. var exec$2 = uncurryThis$9(hex.exec);
  2422. var FORCED = $parseInt$1(whitespaces$1 + '08') !== 8 || $parseInt$1(whitespaces$1 + '0x16') !== 22
  2423. // MS Edge 18- broken with boxed symbols
  2424. || (ITERATOR$1 && !fails$a(function () { $parseInt$1(Object(ITERATOR$1)); }));
  2425. // `parseInt` method
  2426. // https://tc39.es/ecma262/#sec-parseint-string-radix
  2427. var numberParseInt = FORCED ? function parseInt(string, radix) {
  2428. var S = trim(toString$a(string));
  2429. return $parseInt$1(S, (radix >>> 0) || (exec$2(hex, S) ? 16 : 10));
  2430. } : $parseInt$1;
  2431. var $$6 = _export;
  2432. var $parseInt = numberParseInt;
  2433. // `parseInt` method
  2434. // https://tc39.es/ecma262/#sec-parseint-string-radix
  2435. $$6({ global: true, forced: parseInt !== $parseInt }, {
  2436. parseInt: $parseInt
  2437. });
  2438. var isObject = isObject$d;
  2439. var classof$1 = classofRaw$2;
  2440. var wellKnownSymbol$7 = wellKnownSymbol$j;
  2441. var MATCH$2 = wellKnownSymbol$7('match');
  2442. // `IsRegExp` abstract operation
  2443. // https://tc39.es/ecma262/#sec-isregexp
  2444. var isRegexp = function (it) {
  2445. var isRegExp;
  2446. return isObject(it) && ((isRegExp = it[MATCH$2]) !== undefined ? !!isRegExp : classof$1(it) === 'RegExp');
  2447. };
  2448. var anObject$7 = anObject$c;
  2449. // `RegExp.prototype.flags` getter implementation
  2450. // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
  2451. var regexpFlags$1 = function () {
  2452. var that = anObject$7(this);
  2453. var result = '';
  2454. if (that.hasIndices) result += 'd';
  2455. if (that.global) result += 'g';
  2456. if (that.ignoreCase) result += 'i';
  2457. if (that.multiline) result += 'm';
  2458. if (that.dotAll) result += 's';
  2459. if (that.unicode) result += 'u';
  2460. if (that.unicodeSets) result += 'v';
  2461. if (that.sticky) result += 'y';
  2462. return result;
  2463. };
  2464. var call$8 = functionCall;
  2465. var hasOwn$1 = hasOwnProperty_1;
  2466. var isPrototypeOf$1 = objectIsPrototypeOf;
  2467. var regExpFlags = regexpFlags$1;
  2468. var RegExpPrototype$3 = RegExp.prototype;
  2469. var regexpGetFlags = function (R) {
  2470. var flags = R.flags;
  2471. return flags === undefined && !('flags' in RegExpPrototype$3) && !hasOwn$1(R, 'flags') && isPrototypeOf$1(RegExpPrototype$3, R)
  2472. ? call$8(regExpFlags, R) : flags;
  2473. };
  2474. var fails$9 = fails$x;
  2475. var global$6 = global$k;
  2476. // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
  2477. var $RegExp$2 = global$6.RegExp;
  2478. var UNSUPPORTED_Y$3 = fails$9(function () {
  2479. var re = $RegExp$2('a', 'y');
  2480. re.lastIndex = 2;
  2481. return re.exec('abcd') !== null;
  2482. });
  2483. // UC Browser bug
  2484. // https://github.com/zloirock/core-js/issues/1008
  2485. var MISSED_STICKY$1 = UNSUPPORTED_Y$3 || fails$9(function () {
  2486. return !$RegExp$2('a', 'y').sticky;
  2487. });
  2488. var BROKEN_CARET = UNSUPPORTED_Y$3 || fails$9(function () {
  2489. // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
  2490. var re = $RegExp$2('^r', 'gy');
  2491. re.lastIndex = 2;
  2492. return re.exec('str') !== null;
  2493. });
  2494. var regexpStickyHelpers = {
  2495. BROKEN_CARET: BROKEN_CARET,
  2496. MISSED_STICKY: MISSED_STICKY$1,
  2497. UNSUPPORTED_Y: UNSUPPORTED_Y$3
  2498. };
  2499. var defineProperty$1 = objectDefineProperty.f;
  2500. var proxyAccessor$1 = function (Target, Source, key) {
  2501. key in Target || defineProperty$1(Target, key, {
  2502. configurable: true,
  2503. get: function () { return Source[key]; },
  2504. set: function (it) { Source[key] = it; }
  2505. });
  2506. };
  2507. var makeBuiltIn = makeBuiltInExports;
  2508. var defineProperty = objectDefineProperty;
  2509. var defineBuiltInAccessor$1 = function (target, name, descriptor) {
  2510. if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });
  2511. if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });
  2512. return defineProperty.f(target, name, descriptor);
  2513. };
  2514. var getBuiltIn = getBuiltIn$5;
  2515. var defineBuiltInAccessor = defineBuiltInAccessor$1;
  2516. var wellKnownSymbol$6 = wellKnownSymbol$j;
  2517. var DESCRIPTORS$1 = descriptors;
  2518. var SPECIES$2 = wellKnownSymbol$6('species');
  2519. var setSpecies$1 = function (CONSTRUCTOR_NAME) {
  2520. var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
  2521. if (DESCRIPTORS$1 && Constructor && !Constructor[SPECIES$2]) {
  2522. defineBuiltInAccessor(Constructor, SPECIES$2, {
  2523. configurable: true,
  2524. get: function () { return this; }
  2525. });
  2526. }
  2527. };
  2528. var fails$8 = fails$x;
  2529. var global$5 = global$k;
  2530. // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
  2531. var $RegExp$1 = global$5.RegExp;
  2532. var regexpUnsupportedDotAll = fails$8(function () {
  2533. var re = $RegExp$1('.', 's');
  2534. return !(re.dotAll && re.test('\n') && re.flags === 's');
  2535. });
  2536. var fails$7 = fails$x;
  2537. var global$4 = global$k;
  2538. // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
  2539. var $RegExp = global$4.RegExp;
  2540. var regexpUnsupportedNcg = fails$7(function () {
  2541. var re = $RegExp('(?<a>b)', 'g');
  2542. return re.exec('b').groups.a !== 'b' ||
  2543. 'b'.replace(re, '$<a>c') !== 'bc';
  2544. });
  2545. var DESCRIPTORS = descriptors;
  2546. var global$3 = global$k;
  2547. var uncurryThis$8 = functionUncurryThis;
  2548. var isForced = isForced_1;
  2549. var inheritIfRequired = inheritIfRequired$2;
  2550. var createNonEnumerableProperty$3 = createNonEnumerableProperty$7;
  2551. var create$1 = objectCreate;
  2552. var getOwnPropertyNames = objectGetOwnPropertyNames.f;
  2553. var isPrototypeOf = objectIsPrototypeOf;
  2554. var isRegExp$1 = isRegexp;
  2555. var toString$9 = toString$f;
  2556. var getRegExpFlags$1 = regexpGetFlags;
  2557. var stickyHelpers$2 = regexpStickyHelpers;
  2558. var proxyAccessor = proxyAccessor$1;
  2559. var defineBuiltIn$2 = defineBuiltIn$7;
  2560. var fails$6 = fails$x;
  2561. var hasOwn = hasOwnProperty_1;
  2562. var enforceInternalState = internalState.enforce;
  2563. var setSpecies = setSpecies$1;
  2564. var wellKnownSymbol$5 = wellKnownSymbol$j;
  2565. var UNSUPPORTED_DOT_ALL$1 = regexpUnsupportedDotAll;
  2566. var UNSUPPORTED_NCG$1 = regexpUnsupportedNcg;
  2567. var MATCH$1 = wellKnownSymbol$5('match');
  2568. var NativeRegExp = global$3.RegExp;
  2569. var RegExpPrototype$2 = NativeRegExp.prototype;
  2570. var SyntaxError = global$3.SyntaxError;
  2571. var exec$1 = uncurryThis$8(RegExpPrototype$2.exec);
  2572. var charAt$4 = uncurryThis$8(''.charAt);
  2573. var replace$2 = uncurryThis$8(''.replace);
  2574. var stringIndexOf$2 = uncurryThis$8(''.indexOf);
  2575. var stringSlice$6 = uncurryThis$8(''.slice);
  2576. // TODO: Use only proper RegExpIdentifierName
  2577. var IS_NCG = /^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/;
  2578. var re1 = /a/g;
  2579. var re2 = /a/g;
  2580. // "new" should create a new object, old webkit bug
  2581. var CORRECT_NEW = new NativeRegExp(re1) !== re1;
  2582. var MISSED_STICKY = stickyHelpers$2.MISSED_STICKY;
  2583. var UNSUPPORTED_Y$2 = stickyHelpers$2.UNSUPPORTED_Y;
  2584. var BASE_FORCED = DESCRIPTORS &&
  2585. (!CORRECT_NEW || MISSED_STICKY || UNSUPPORTED_DOT_ALL$1 || UNSUPPORTED_NCG$1 || fails$6(function () {
  2586. re2[MATCH$1] = false;
  2587. // RegExp constructor can alter flags and IsRegExp works correct with @@match
  2588. return NativeRegExp(re1) !== re1 || NativeRegExp(re2) === re2 || String(NativeRegExp(re1, 'i')) !== '/a/i';
  2589. }));
  2590. var handleDotAll = function (string) {
  2591. var length = string.length;
  2592. var index = 0;
  2593. var result = '';
  2594. var brackets = false;
  2595. var chr;
  2596. for (; index <= length; index++) {
  2597. chr = charAt$4(string, index);
  2598. if (chr === '\\') {
  2599. result += chr + charAt$4(string, ++index);
  2600. continue;
  2601. }
  2602. if (!brackets && chr === '.') {
  2603. result += '[\\s\\S]';
  2604. } else {
  2605. if (chr === '[') {
  2606. brackets = true;
  2607. } else if (chr === ']') {
  2608. brackets = false;
  2609. } result += chr;
  2610. }
  2611. } return result;
  2612. };
  2613. var handleNCG = function (string) {
  2614. var length = string.length;
  2615. var index = 0;
  2616. var result = '';
  2617. var named = [];
  2618. var names = create$1(null);
  2619. var brackets = false;
  2620. var ncg = false;
  2621. var groupid = 0;
  2622. var groupname = '';
  2623. var chr;
  2624. for (; index <= length; index++) {
  2625. chr = charAt$4(string, index);
  2626. if (chr === '\\') {
  2627. chr += charAt$4(string, ++index);
  2628. } else if (chr === ']') {
  2629. brackets = false;
  2630. } else if (!brackets) switch (true) {
  2631. case chr === '[':
  2632. brackets = true;
  2633. break;
  2634. case chr === '(':
  2635. if (exec$1(IS_NCG, stringSlice$6(string, index + 1))) {
  2636. index += 2;
  2637. ncg = true;
  2638. }
  2639. result += chr;
  2640. groupid++;
  2641. continue;
  2642. case chr === '>' && ncg:
  2643. if (groupname === '' || hasOwn(names, groupname)) {
  2644. throw new SyntaxError('Invalid capture group name');
  2645. }
  2646. names[groupname] = true;
  2647. named[named.length] = [groupname, groupid];
  2648. ncg = false;
  2649. groupname = '';
  2650. continue;
  2651. }
  2652. if (ncg) groupname += chr;
  2653. else result += chr;
  2654. } return [result, named];
  2655. };
  2656. // `RegExp` constructor
  2657. // https://tc39.es/ecma262/#sec-regexp-constructor
  2658. if (isForced('RegExp', BASE_FORCED)) {
  2659. var RegExpWrapper = function RegExp(pattern, flags) {
  2660. var thisIsRegExp = isPrototypeOf(RegExpPrototype$2, this);
  2661. var patternIsRegExp = isRegExp$1(pattern);
  2662. var flagsAreUndefined = flags === undefined;
  2663. var groups = [];
  2664. var rawPattern = pattern;
  2665. var rawFlags, dotAll, sticky, handled, result, state;
  2666. if (!thisIsRegExp && patternIsRegExp && flagsAreUndefined && pattern.constructor === RegExpWrapper) {
  2667. return pattern;
  2668. }
  2669. if (patternIsRegExp || isPrototypeOf(RegExpPrototype$2, pattern)) {
  2670. pattern = pattern.source;
  2671. if (flagsAreUndefined) flags = getRegExpFlags$1(rawPattern);
  2672. }
  2673. pattern = pattern === undefined ? '' : toString$9(pattern);
  2674. flags = flags === undefined ? '' : toString$9(flags);
  2675. rawPattern = pattern;
  2676. if (UNSUPPORTED_DOT_ALL$1 && 'dotAll' in re1) {
  2677. dotAll = !!flags && stringIndexOf$2(flags, 's') > -1;
  2678. if (dotAll) flags = replace$2(flags, /s/g, '');
  2679. }
  2680. rawFlags = flags;
  2681. if (MISSED_STICKY && 'sticky' in re1) {
  2682. sticky = !!flags && stringIndexOf$2(flags, 'y') > -1;
  2683. if (sticky && UNSUPPORTED_Y$2) flags = replace$2(flags, /y/g, '');
  2684. }
  2685. if (UNSUPPORTED_NCG$1) {
  2686. handled = handleNCG(pattern);
  2687. pattern = handled[0];
  2688. groups = handled[1];
  2689. }
  2690. result = inheritIfRequired(NativeRegExp(pattern, flags), thisIsRegExp ? this : RegExpPrototype$2, RegExpWrapper);
  2691. if (dotAll || sticky || groups.length) {
  2692. state = enforceInternalState(result);
  2693. if (dotAll) {
  2694. state.dotAll = true;
  2695. state.raw = RegExpWrapper(handleDotAll(pattern), rawFlags);
  2696. }
  2697. if (sticky) state.sticky = true;
  2698. if (groups.length) state.groups = groups;
  2699. }
  2700. if (pattern !== rawPattern) try {
  2701. // fails in old engines, but we have no alternatives for unsupported regex syntax
  2702. createNonEnumerableProperty$3(result, 'source', rawPattern === '' ? '(?:)' : rawPattern);
  2703. } catch (error) { /* empty */ }
  2704. return result;
  2705. };
  2706. for (var keys = getOwnPropertyNames(NativeRegExp), index = 0; keys.length > index;) {
  2707. proxyAccessor(RegExpWrapper, NativeRegExp, keys[index++]);
  2708. }
  2709. RegExpPrototype$2.constructor = RegExpWrapper;
  2710. RegExpWrapper.prototype = RegExpPrototype$2;
  2711. defineBuiltIn$2(global$3, 'RegExp', RegExpWrapper, { constructor: true });
  2712. }
  2713. // https://tc39.es/ecma262/#sec-get-regexp-@@species
  2714. setSpecies('RegExp');
  2715. /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
  2716. /* eslint-disable regexp/no-useless-quantifier -- testing */
  2717. var call$7 = functionCall;
  2718. var uncurryThis$7 = functionUncurryThis;
  2719. var toString$8 = toString$f;
  2720. var regexpFlags = regexpFlags$1;
  2721. var stickyHelpers$1 = regexpStickyHelpers;
  2722. var shared = shared$4;
  2723. var create = objectCreate;
  2724. var getInternalState = internalState.get;
  2725. var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
  2726. var UNSUPPORTED_NCG = regexpUnsupportedNcg;
  2727. var nativeReplace = shared('native-string-replace', String.prototype.replace);
  2728. var nativeExec = RegExp.prototype.exec;
  2729. var patchedExec = nativeExec;
  2730. var charAt$3 = uncurryThis$7(''.charAt);
  2731. var indexOf = uncurryThis$7(''.indexOf);
  2732. var replace$1 = uncurryThis$7(''.replace);
  2733. var stringSlice$5 = uncurryThis$7(''.slice);
  2734. var UPDATES_LAST_INDEX_WRONG = (function () {
  2735. var re1 = /a/;
  2736. var re2 = /b*/g;
  2737. call$7(nativeExec, re1, 'a');
  2738. call$7(nativeExec, re2, 'a');
  2739. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  2740. })();
  2741. var UNSUPPORTED_Y$1 = stickyHelpers$1.BROKEN_CARET;
  2742. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  2743. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  2744. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1 || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
  2745. if (PATCH) {
  2746. patchedExec = function exec(string) {
  2747. var re = this;
  2748. var state = getInternalState(re);
  2749. var str = toString$8(string);
  2750. var raw = state.raw;
  2751. var result, reCopy, lastIndex, match, i, object, group;
  2752. if (raw) {
  2753. raw.lastIndex = re.lastIndex;
  2754. result = call$7(patchedExec, raw, str);
  2755. re.lastIndex = raw.lastIndex;
  2756. return result;
  2757. }
  2758. var groups = state.groups;
  2759. var sticky = UNSUPPORTED_Y$1 && re.sticky;
  2760. var flags = call$7(regexpFlags, re);
  2761. var source = re.source;
  2762. var charsAdded = 0;
  2763. var strCopy = str;
  2764. if (sticky) {
  2765. flags = replace$1(flags, 'y', '');
  2766. if (indexOf(flags, 'g') === -1) {
  2767. flags += 'g';
  2768. }
  2769. strCopy = stringSlice$5(str, re.lastIndex);
  2770. // Support anchored sticky behavior.
  2771. if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$3(str, re.lastIndex - 1) !== '\n')) {
  2772. source = '(?: ' + source + ')';
  2773. strCopy = ' ' + strCopy;
  2774. charsAdded++;
  2775. }
  2776. // ^(? + rx + ) is needed, in combination with some str slicing, to
  2777. // simulate the 'y' flag.
  2778. reCopy = new RegExp('^(?:' + source + ')', flags);
  2779. }
  2780. if (NPCG_INCLUDED) {
  2781. reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
  2782. }
  2783. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  2784. match = call$7(nativeExec, sticky ? reCopy : re, strCopy);
  2785. if (sticky) {
  2786. if (match) {
  2787. match.input = stringSlice$5(match.input, charsAdded);
  2788. match[0] = stringSlice$5(match[0], charsAdded);
  2789. match.index = re.lastIndex;
  2790. re.lastIndex += match[0].length;
  2791. } else re.lastIndex = 0;
  2792. } else if (UPDATES_LAST_INDEX_WRONG && match) {
  2793. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  2794. }
  2795. if (NPCG_INCLUDED && match && match.length > 1) {
  2796. // Fix browsers whose `exec` methods don't consistently return `undefined`
  2797. // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
  2798. call$7(nativeReplace, match[0], reCopy, function () {
  2799. for (i = 1; i < arguments.length - 2; i++) {
  2800. if (arguments[i] === undefined) match[i] = undefined;
  2801. }
  2802. });
  2803. }
  2804. if (match && groups) {
  2805. match.groups = object = create(null);
  2806. for (i = 0; i < groups.length; i++) {
  2807. group = groups[i];
  2808. object[group[0]] = match[group[1]];
  2809. }
  2810. }
  2811. return match;
  2812. };
  2813. }
  2814. var regexpExec$2 = patchedExec;
  2815. var $$5 = _export;
  2816. var exec = regexpExec$2;
  2817. // `RegExp.prototype.exec` method
  2818. // https://tc39.es/ecma262/#sec-regexp.prototype.exec
  2819. $$5({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
  2820. exec: exec
  2821. });
  2822. var PROPER_FUNCTION_NAME$1 = functionName.PROPER;
  2823. var defineBuiltIn$1 = defineBuiltIn$7;
  2824. var anObject$6 = anObject$c;
  2825. var $toString = toString$f;
  2826. var fails$5 = fails$x;
  2827. var getRegExpFlags = regexpGetFlags;
  2828. var TO_STRING = 'toString';
  2829. var RegExpPrototype$1 = RegExp.prototype;
  2830. var nativeToString = RegExpPrototype$1[TO_STRING];
  2831. var NOT_GENERIC = fails$5(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; });
  2832. // FF44- RegExp#toString has a wrong name
  2833. var INCORRECT_NAME = PROPER_FUNCTION_NAME$1 && nativeToString.name !== TO_STRING;
  2834. // `RegExp.prototype.toString` method
  2835. // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
  2836. if (NOT_GENERIC || INCORRECT_NAME) {
  2837. defineBuiltIn$1(RegExpPrototype$1, TO_STRING, function toString() {
  2838. var R = anObject$6(this);
  2839. var pattern = $toString(R.source);
  2840. var flags = $toString(getRegExpFlags(R));
  2841. return '/' + pattern + '/' + flags;
  2842. }, { unsafe: true });
  2843. }
  2844. var isRegExp = isRegexp;
  2845. var $TypeError$2 = TypeError;
  2846. var notARegexp = function (it) {
  2847. if (isRegExp(it)) {
  2848. throw new $TypeError$2("The method doesn't accept regular expressions");
  2849. } return it;
  2850. };
  2851. var wellKnownSymbol$4 = wellKnownSymbol$j;
  2852. var MATCH = wellKnownSymbol$4('match');
  2853. var correctIsRegexpLogic = function (METHOD_NAME) {
  2854. var regexp = /./;
  2855. try {
  2856. '/./'[METHOD_NAME](regexp);
  2857. } catch (error1) {
  2858. try {
  2859. regexp[MATCH] = false;
  2860. return '/./'[METHOD_NAME](regexp);
  2861. } catch (error2) { /* empty */ }
  2862. } return false;
  2863. };
  2864. var $$4 = _export;
  2865. var uncurryThis$6 = functionUncurryThis;
  2866. var notARegExp$2 = notARegexp;
  2867. var requireObjectCoercible$7 = requireObjectCoercible$c;
  2868. var toString$7 = toString$f;
  2869. var correctIsRegExpLogic$2 = correctIsRegexpLogic;
  2870. var stringIndexOf$1 = uncurryThis$6(''.indexOf);
  2871. // `String.prototype.includes` method
  2872. // https://tc39.es/ecma262/#sec-string.prototype.includes
  2873. $$4({ target: 'String', proto: true, forced: !correctIsRegExpLogic$2('includes') }, {
  2874. includes: function includes(searchString /* , position = 0 */) {
  2875. return !!~stringIndexOf$1(
  2876. toString$7(requireObjectCoercible$7(this)),
  2877. toString$7(notARegExp$2(searchString)),
  2878. arguments.length > 1 ? arguments[1] : undefined
  2879. );
  2880. }
  2881. });
  2882. var NATIVE_BIND = functionBindNative;
  2883. var FunctionPrototype = Function.prototype;
  2884. var apply$1 = FunctionPrototype.apply;
  2885. var call$6 = FunctionPrototype.call;
  2886. // eslint-disable-next-line es/no-reflect -- safe
  2887. var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call$6.bind(apply$1) : function () {
  2888. return call$6.apply(apply$1, arguments);
  2889. });
  2890. // TODO: Remove from `core-js@4` since it's moved to entry points
  2891. var call$5 = functionCall;
  2892. var defineBuiltIn = defineBuiltIn$7;
  2893. var regexpExec$1 = regexpExec$2;
  2894. var fails$4 = fails$x;
  2895. var wellKnownSymbol$3 = wellKnownSymbol$j;
  2896. var createNonEnumerableProperty$2 = createNonEnumerableProperty$7;
  2897. var SPECIES$1 = wellKnownSymbol$3('species');
  2898. var RegExpPrototype = RegExp.prototype;
  2899. var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
  2900. var SYMBOL = wellKnownSymbol$3(KEY);
  2901. var DELEGATES_TO_SYMBOL = !fails$4(function () {
  2902. // String methods call symbol-named RegExp methods
  2903. var O = {};
  2904. O[SYMBOL] = function () { return 7; };
  2905. return ''[KEY](O) !== 7;
  2906. });
  2907. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$4(function () {
  2908. // Symbol-named RegExp methods call .exec
  2909. var execCalled = false;
  2910. var re = /a/;
  2911. if (KEY === 'split') {
  2912. // We can't use real regex here since it causes deoptimization
  2913. // and serious performance degradation in V8
  2914. // https://github.com/zloirock/core-js/issues/306
  2915. re = {};
  2916. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  2917. // a new one. We need to return the patched regex when creating the new one.
  2918. re.constructor = {};
  2919. re.constructor[SPECIES$1] = function () { return re; };
  2920. re.flags = '';
  2921. re[SYMBOL] = /./[SYMBOL];
  2922. }
  2923. re.exec = function () {
  2924. execCalled = true;
  2925. return null;
  2926. };
  2927. re[SYMBOL]('');
  2928. return !execCalled;
  2929. });
  2930. if (
  2931. !DELEGATES_TO_SYMBOL ||
  2932. !DELEGATES_TO_EXEC ||
  2933. FORCED
  2934. ) {
  2935. var nativeRegExpMethod = /./[SYMBOL];
  2936. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  2937. var $exec = regexp.exec;
  2938. if ($exec === regexpExec$1 || $exec === RegExpPrototype.exec) {
  2939. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  2940. // The native String method already delegates to @@method (this
  2941. // polyfilled function), leasing to infinite recursion.
  2942. // We avoid it by directly calling the native @@method method.
  2943. return { done: true, value: call$5(nativeRegExpMethod, regexp, str, arg2) };
  2944. }
  2945. return { done: true, value: call$5(nativeMethod, str, regexp, arg2) };
  2946. }
  2947. return { done: false };
  2948. });
  2949. defineBuiltIn(String.prototype, KEY, methods[0]);
  2950. defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]);
  2951. }
  2952. if (SHAM) createNonEnumerableProperty$2(RegExpPrototype[SYMBOL], 'sham', true);
  2953. };
  2954. var uncurryThis$5 = functionUncurryThis;
  2955. var toIntegerOrInfinity$1 = toIntegerOrInfinity$5;
  2956. var toString$6 = toString$f;
  2957. var requireObjectCoercible$6 = requireObjectCoercible$c;
  2958. var charAt$2 = uncurryThis$5(''.charAt);
  2959. var charCodeAt = uncurryThis$5(''.charCodeAt);
  2960. var stringSlice$4 = uncurryThis$5(''.slice);
  2961. var createMethod = function (CONVERT_TO_STRING) {
  2962. return function ($this, pos) {
  2963. var S = toString$6(requireObjectCoercible$6($this));
  2964. var position = toIntegerOrInfinity$1(pos);
  2965. var size = S.length;
  2966. var first, second;
  2967. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  2968. first = charCodeAt(S, position);
  2969. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  2970. || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
  2971. ? CONVERT_TO_STRING
  2972. ? charAt$2(S, position)
  2973. : first
  2974. : CONVERT_TO_STRING
  2975. ? stringSlice$4(S, position, position + 2)
  2976. : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  2977. };
  2978. };
  2979. var stringMultibyte = {
  2980. // `String.prototype.codePointAt` method
  2981. // https://tc39.es/ecma262/#sec-string.prototype.codepointat
  2982. codeAt: createMethod(false),
  2983. // `String.prototype.at` method
  2984. // https://github.com/mathiasbynens/String.prototype.at
  2985. charAt: createMethod(true)
  2986. };
  2987. var charAt$1 = stringMultibyte.charAt;
  2988. // `AdvanceStringIndex` abstract operation
  2989. // https://tc39.es/ecma262/#sec-advancestringindex
  2990. var advanceStringIndex$3 = function (S, index, unicode) {
  2991. return index + (unicode ? charAt$1(S, index).length : 1);
  2992. };
  2993. var uncurryThis$4 = functionUncurryThis;
  2994. var toObject$1 = toObject$b;
  2995. var floor = Math.floor;
  2996. var charAt = uncurryThis$4(''.charAt);
  2997. var replace = uncurryThis$4(''.replace);
  2998. var stringSlice$3 = uncurryThis$4(''.slice);
  2999. // eslint-disable-next-line redos/no-vulnerable -- safe
  3000. var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
  3001. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
  3002. // `GetSubstitution` abstract operation
  3003. // https://tc39.es/ecma262/#sec-getsubstitution
  3004. var getSubstitution$1 = function (matched, str, position, captures, namedCaptures, replacement) {
  3005. var tailPos = position + matched.length;
  3006. var m = captures.length;
  3007. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  3008. if (namedCaptures !== undefined) {
  3009. namedCaptures = toObject$1(namedCaptures);
  3010. symbols = SUBSTITUTION_SYMBOLS;
  3011. }
  3012. return replace(replacement, symbols, function (match, ch) {
  3013. var capture;
  3014. switch (charAt(ch, 0)) {
  3015. case '$': return '$';
  3016. case '&': return matched;
  3017. case '`': return stringSlice$3(str, 0, position);
  3018. case "'": return stringSlice$3(str, tailPos);
  3019. case '<':
  3020. capture = namedCaptures[stringSlice$3(ch, 1, -1)];
  3021. break;
  3022. default: // \d\d?
  3023. var n = +ch;
  3024. if (n === 0) return match;
  3025. if (n > m) {
  3026. var f = floor(n / 10);
  3027. if (f === 0) return match;
  3028. if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
  3029. return match;
  3030. }
  3031. capture = captures[n - 1];
  3032. }
  3033. return capture === undefined ? '' : capture;
  3034. });
  3035. };
  3036. var call$4 = functionCall;
  3037. var anObject$5 = anObject$c;
  3038. var isCallable$1 = isCallable$i;
  3039. var classof = classofRaw$2;
  3040. var regexpExec = regexpExec$2;
  3041. var $TypeError$1 = TypeError;
  3042. // `RegExpExec` abstract operation
  3043. // https://tc39.es/ecma262/#sec-regexpexec
  3044. var regexpExecAbstract = function (R, S) {
  3045. var exec = R.exec;
  3046. if (isCallable$1(exec)) {
  3047. var result = call$4(exec, R, S);
  3048. if (result !== null) anObject$5(result);
  3049. return result;
  3050. }
  3051. if (classof(R) === 'RegExp') return call$4(regexpExec, R, S);
  3052. throw new $TypeError$1('RegExp#exec called on incompatible receiver');
  3053. };
  3054. var apply = functionApply;
  3055. var call$3 = functionCall;
  3056. var uncurryThis$3 = functionUncurryThis;
  3057. var fixRegExpWellKnownSymbolLogic$3 = fixRegexpWellKnownSymbolLogic;
  3058. var fails$3 = fails$x;
  3059. var anObject$4 = anObject$c;
  3060. var isCallable = isCallable$i;
  3061. var isNullOrUndefined$4 = isNullOrUndefined$7;
  3062. var toIntegerOrInfinity = toIntegerOrInfinity$5;
  3063. var toLength$4 = toLength$6;
  3064. var toString$5 = toString$f;
  3065. var requireObjectCoercible$5 = requireObjectCoercible$c;
  3066. var advanceStringIndex$2 = advanceStringIndex$3;
  3067. var getMethod$3 = getMethod$5;
  3068. var getSubstitution = getSubstitution$1;
  3069. var regExpExec$3 = regexpExecAbstract;
  3070. var wellKnownSymbol$2 = wellKnownSymbol$j;
  3071. var REPLACE = wellKnownSymbol$2('replace');
  3072. var max = Math.max;
  3073. var min$3 = Math.min;
  3074. var concat = uncurryThis$3([].concat);
  3075. var push$1 = uncurryThis$3([].push);
  3076. var stringIndexOf = uncurryThis$3(''.indexOf);
  3077. var stringSlice$2 = uncurryThis$3(''.slice);
  3078. var maybeToString = function (it) {
  3079. return it === undefined ? it : String(it);
  3080. };
  3081. // IE <= 11 replaces $0 with the whole match, as if it was $&
  3082. // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
  3083. var REPLACE_KEEPS_$0 = (function () {
  3084. // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
  3085. return 'a'.replace(/./, '$0') === '$0';
  3086. })();
  3087. // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
  3088. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
  3089. if (/./[REPLACE]) {
  3090. return /./[REPLACE]('a', '$0') === '';
  3091. }
  3092. return false;
  3093. })();
  3094. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$3(function () {
  3095. var re = /./;
  3096. re.exec = function () {
  3097. var result = [];
  3098. result.groups = { a: '7' };
  3099. return result;
  3100. };
  3101. // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
  3102. return ''.replace(re, '$<a>') !== '7';
  3103. });
  3104. // @@replace logic
  3105. fixRegExpWellKnownSymbolLogic$3('replace', function (_, nativeReplace, maybeCallNative) {
  3106. var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
  3107. return [
  3108. // `String.prototype.replace` method
  3109. // https://tc39.es/ecma262/#sec-string.prototype.replace
  3110. function replace(searchValue, replaceValue) {
  3111. var O = requireObjectCoercible$5(this);
  3112. var replacer = isNullOrUndefined$4(searchValue) ? undefined : getMethod$3(searchValue, REPLACE);
  3113. return replacer
  3114. ? call$3(replacer, searchValue, O, replaceValue)
  3115. : call$3(nativeReplace, toString$5(O), searchValue, replaceValue);
  3116. },
  3117. // `RegExp.prototype[@@replace]` method
  3118. // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
  3119. function (string, replaceValue) {
  3120. var rx = anObject$4(this);
  3121. var S = toString$5(string);
  3122. if (
  3123. typeof replaceValue == 'string' &&
  3124. stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
  3125. stringIndexOf(replaceValue, '$<') === -1
  3126. ) {
  3127. var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
  3128. if (res.done) return res.value;
  3129. }
  3130. var functionalReplace = isCallable(replaceValue);
  3131. if (!functionalReplace) replaceValue = toString$5(replaceValue);
  3132. var global = rx.global;
  3133. var fullUnicode;
  3134. if (global) {
  3135. fullUnicode = rx.unicode;
  3136. rx.lastIndex = 0;
  3137. }
  3138. var results = [];
  3139. var result;
  3140. while (true) {
  3141. result = regExpExec$3(rx, S);
  3142. if (result === null) break;
  3143. push$1(results, result);
  3144. if (!global) break;
  3145. var matchStr = toString$5(result[0]);
  3146. if (matchStr === '') rx.lastIndex = advanceStringIndex$2(S, toLength$4(rx.lastIndex), fullUnicode);
  3147. }
  3148. var accumulatedResult = '';
  3149. var nextSourcePosition = 0;
  3150. for (var i = 0; i < results.length; i++) {
  3151. result = results[i];
  3152. var matched = toString$5(result[0]);
  3153. var position = max(min$3(toIntegerOrInfinity(result.index), S.length), 0);
  3154. var captures = [];
  3155. var replacement;
  3156. // NOTE: This is equivalent to
  3157. // captures = result.slice(1).map(maybeToString)
  3158. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  3159. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  3160. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  3161. for (var j = 1; j < result.length; j++) push$1(captures, maybeToString(result[j]));
  3162. var namedCaptures = result.groups;
  3163. if (functionalReplace) {
  3164. var replacerArgs = concat([matched], captures, position, S);
  3165. if (namedCaptures !== undefined) push$1(replacerArgs, namedCaptures);
  3166. replacement = toString$5(apply(replaceValue, undefined, replacerArgs));
  3167. } else {
  3168. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  3169. }
  3170. if (position >= nextSourcePosition) {
  3171. accumulatedResult += stringSlice$2(S, nextSourcePosition, position) + replacement;
  3172. nextSourcePosition = position + matched.length;
  3173. }
  3174. }
  3175. return accumulatedResult + stringSlice$2(S, nextSourcePosition);
  3176. }
  3177. ];
  3178. }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
  3179. // `SameValue` abstract operation
  3180. // https://tc39.es/ecma262/#sec-samevalue
  3181. // eslint-disable-next-line es/no-object-is -- safe
  3182. var sameValue$1 = Object.is || function is(x, y) {
  3183. // eslint-disable-next-line no-self-compare -- NaN check
  3184. return x === y ? x !== 0 || 1 / x === 1 / y : x !== x && y !== y;
  3185. };
  3186. var call$2 = functionCall;
  3187. var fixRegExpWellKnownSymbolLogic$2 = fixRegexpWellKnownSymbolLogic;
  3188. var anObject$3 = anObject$c;
  3189. var isNullOrUndefined$3 = isNullOrUndefined$7;
  3190. var requireObjectCoercible$4 = requireObjectCoercible$c;
  3191. var sameValue = sameValue$1;
  3192. var toString$4 = toString$f;
  3193. var getMethod$2 = getMethod$5;
  3194. var regExpExec$2 = regexpExecAbstract;
  3195. // @@search logic
  3196. fixRegExpWellKnownSymbolLogic$2('search', function (SEARCH, nativeSearch, maybeCallNative) {
  3197. return [
  3198. // `String.prototype.search` method
  3199. // https://tc39.es/ecma262/#sec-string.prototype.search
  3200. function search(regexp) {
  3201. var O = requireObjectCoercible$4(this);
  3202. var searcher = isNullOrUndefined$3(regexp) ? undefined : getMethod$2(regexp, SEARCH);
  3203. return searcher ? call$2(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString$4(O));
  3204. },
  3205. // `RegExp.prototype[@@search]` method
  3206. // https://tc39.es/ecma262/#sec-regexp.prototype-@@search
  3207. function (string) {
  3208. var rx = anObject$3(this);
  3209. var S = toString$4(string);
  3210. var res = maybeCallNative(nativeSearch, rx, S);
  3211. if (res.done) return res.value;
  3212. var previousLastIndex = rx.lastIndex;
  3213. if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
  3214. var result = regExpExec$2(rx, S);
  3215. if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
  3216. return result === null ? -1 : result.index;
  3217. }
  3218. ];
  3219. });
  3220. var isConstructor = isConstructor$3;
  3221. var tryToString = tryToString$3;
  3222. var $TypeError = TypeError;
  3223. // `Assert: IsConstructor(argument) is true`
  3224. var aConstructor$1 = function (argument) {
  3225. if (isConstructor(argument)) return argument;
  3226. throw new $TypeError(tryToString(argument) + ' is not a constructor');
  3227. };
  3228. var anObject$2 = anObject$c;
  3229. var aConstructor = aConstructor$1;
  3230. var isNullOrUndefined$2 = isNullOrUndefined$7;
  3231. var wellKnownSymbol$1 = wellKnownSymbol$j;
  3232. var SPECIES = wellKnownSymbol$1('species');
  3233. // `SpeciesConstructor` abstract operation
  3234. // https://tc39.es/ecma262/#sec-speciesconstructor
  3235. var speciesConstructor$1 = function (O, defaultConstructor) {
  3236. var C = anObject$2(O).constructor;
  3237. var S;
  3238. return C === undefined || isNullOrUndefined$2(S = anObject$2(C)[SPECIES]) ? defaultConstructor : aConstructor(S);
  3239. };
  3240. var call$1 = functionCall;
  3241. var uncurryThis$2 = functionUncurryThis;
  3242. var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic;
  3243. var anObject$1 = anObject$c;
  3244. var isNullOrUndefined$1 = isNullOrUndefined$7;
  3245. var requireObjectCoercible$3 = requireObjectCoercible$c;
  3246. var speciesConstructor = speciesConstructor$1;
  3247. var advanceStringIndex$1 = advanceStringIndex$3;
  3248. var toLength$3 = toLength$6;
  3249. var toString$3 = toString$f;
  3250. var getMethod$1 = getMethod$5;
  3251. var regExpExec$1 = regexpExecAbstract;
  3252. var stickyHelpers = regexpStickyHelpers;
  3253. var fails$2 = fails$x;
  3254. var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
  3255. var MAX_UINT32 = 0xFFFFFFFF;
  3256. var min$2 = Math.min;
  3257. var push = uncurryThis$2([].push);
  3258. var stringSlice$1 = uncurryThis$2(''.slice);
  3259. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  3260. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  3261. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails$2(function () {
  3262. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  3263. var re = /(?:)/;
  3264. var originalExec = re.exec;
  3265. re.exec = function () { return originalExec.apply(this, arguments); };
  3266. var result = 'ab'.split(re);
  3267. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  3268. });
  3269. var BUGGY = 'abbc'.split(/(b)*/)[1] === 'c' ||
  3270. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  3271. 'test'.split(/(?:)/, -1).length !== 4 ||
  3272. 'ab'.split(/(?:ab)*/).length !== 2 ||
  3273. '.'.split(/(.?)(.?)/).length !== 4 ||
  3274. // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
  3275. '.'.split(/()()/).length > 1 ||
  3276. ''.split(/.?/).length;
  3277. // @@split logic
  3278. fixRegExpWellKnownSymbolLogic$1('split', function (SPLIT, nativeSplit, maybeCallNative) {
  3279. var internalSplit = '0'.split(undefined, 0).length ? function (separator, limit) {
  3280. return separator === undefined && limit === 0 ? [] : call$1(nativeSplit, this, separator, limit);
  3281. } : nativeSplit;
  3282. return [
  3283. // `String.prototype.split` method
  3284. // https://tc39.es/ecma262/#sec-string.prototype.split
  3285. function split(separator, limit) {
  3286. var O = requireObjectCoercible$3(this);
  3287. var splitter = isNullOrUndefined$1(separator) ? undefined : getMethod$1(separator, SPLIT);
  3288. return splitter
  3289. ? call$1(splitter, separator, O, limit)
  3290. : call$1(internalSplit, toString$3(O), separator, limit);
  3291. },
  3292. // `RegExp.prototype[@@split]` method
  3293. // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
  3294. //
  3295. // NOTE: This cannot be properly polyfilled in engines that don't support
  3296. // the 'y' flag.
  3297. function (string, limit) {
  3298. var rx = anObject$1(this);
  3299. var S = toString$3(string);
  3300. if (!BUGGY) {
  3301. var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
  3302. if (res.done) return res.value;
  3303. }
  3304. var C = speciesConstructor(rx, RegExp);
  3305. var unicodeMatching = rx.unicode;
  3306. var flags = (rx.ignoreCase ? 'i' : '') +
  3307. (rx.multiline ? 'm' : '') +
  3308. (rx.unicode ? 'u' : '') +
  3309. (UNSUPPORTED_Y ? 'g' : 'y');
  3310. // ^(? + rx + ) is needed, in combination with some S slicing, to
  3311. // simulate the 'y' flag.
  3312. var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
  3313. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  3314. if (lim === 0) return [];
  3315. if (S.length === 0) return regExpExec$1(splitter, S) === null ? [S] : [];
  3316. var p = 0;
  3317. var q = 0;
  3318. var A = [];
  3319. while (q < S.length) {
  3320. splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
  3321. var z = regExpExec$1(splitter, UNSUPPORTED_Y ? stringSlice$1(S, q) : S);
  3322. var e;
  3323. if (
  3324. z === null ||
  3325. (e = min$2(toLength$3(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p
  3326. ) {
  3327. q = advanceStringIndex$1(S, q, unicodeMatching);
  3328. } else {
  3329. push(A, stringSlice$1(S, p, q));
  3330. if (A.length === lim) return A;
  3331. for (var i = 1; i <= z.length - 1; i++) {
  3332. push(A, z[i]);
  3333. if (A.length === lim) return A;
  3334. }
  3335. q = p = e;
  3336. }
  3337. }
  3338. push(A, stringSlice$1(S, p));
  3339. return A;
  3340. }
  3341. ];
  3342. }, BUGGY || !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
  3343. var PROPER_FUNCTION_NAME = functionName.PROPER;
  3344. var fails$1 = fails$x;
  3345. var whitespaces = whitespaces$4;
  3346. var non = '\u200B\u0085\u180E';
  3347. // check that a method works with the correct list
  3348. // of whitespaces and has a correct name
  3349. var stringTrimForced = function (METHOD_NAME) {
  3350. return fails$1(function () {
  3351. return !!whitespaces[METHOD_NAME]()
  3352. || non[METHOD_NAME]() !== non
  3353. || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);
  3354. });
  3355. };
  3356. var $$3 = _export;
  3357. var $trim = stringTrim.trim;
  3358. var forcedStringTrimMethod = stringTrimForced;
  3359. // `String.prototype.trim` method
  3360. // https://tc39.es/ecma262/#sec-string.prototype.trim
  3361. $$3({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
  3362. trim: function trim() {
  3363. return $trim(this);
  3364. }
  3365. });
  3366. // iterable DOM collections
  3367. // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
  3368. var domIterables = {
  3369. CSSRuleList: 0,
  3370. CSSStyleDeclaration: 0,
  3371. CSSValueList: 0,
  3372. ClientRectList: 0,
  3373. DOMRectList: 0,
  3374. DOMStringList: 0,
  3375. DOMTokenList: 1,
  3376. DataTransferItemList: 0,
  3377. FileList: 0,
  3378. HTMLAllCollection: 0,
  3379. HTMLCollection: 0,
  3380. HTMLFormElement: 0,
  3381. HTMLSelectElement: 0,
  3382. MediaList: 0,
  3383. MimeTypeArray: 0,
  3384. NamedNodeMap: 0,
  3385. NodeList: 1,
  3386. PaintRequestList: 0,
  3387. Plugin: 0,
  3388. PluginArray: 0,
  3389. SVGLengthList: 0,
  3390. SVGNumberList: 0,
  3391. SVGPathSegList: 0,
  3392. SVGPointList: 0,
  3393. SVGStringList: 0,
  3394. SVGTransformList: 0,
  3395. SourceBufferList: 0,
  3396. StyleSheetList: 0,
  3397. TextTrackCueList: 0,
  3398. TextTrackList: 0,
  3399. TouchList: 0
  3400. };
  3401. // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
  3402. var documentCreateElement = documentCreateElement$2;
  3403. var classList = documentCreateElement('span').classList;
  3404. var DOMTokenListPrototype$2 = classList && classList.constructor && classList.constructor.prototype;
  3405. var domTokenListPrototype = DOMTokenListPrototype$2 === Object.prototype ? undefined : DOMTokenListPrototype$2;
  3406. var $forEach = arrayIteration.forEach;
  3407. var arrayMethodIsStrict = arrayMethodIsStrict$4;
  3408. var STRICT_METHOD = arrayMethodIsStrict('forEach');
  3409. // `Array.prototype.forEach` method implementation
  3410. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  3411. var arrayForEach = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) {
  3412. return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  3413. // eslint-disable-next-line es/no-array-prototype-foreach -- safe
  3414. } : [].forEach;
  3415. var global$2 = global$k;
  3416. var DOMIterables$1 = domIterables;
  3417. var DOMTokenListPrototype$1 = domTokenListPrototype;
  3418. var forEach = arrayForEach;
  3419. var createNonEnumerableProperty$1 = createNonEnumerableProperty$7;
  3420. var handlePrototype$1 = function (CollectionPrototype) {
  3421. // some Chrome versions have non-configurable methods on DOMTokenList
  3422. if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {
  3423. createNonEnumerableProperty$1(CollectionPrototype, 'forEach', forEach);
  3424. } catch (error) {
  3425. CollectionPrototype.forEach = forEach;
  3426. }
  3427. };
  3428. for (var COLLECTION_NAME$1 in DOMIterables$1) {
  3429. if (DOMIterables$1[COLLECTION_NAME$1]) {
  3430. handlePrototype$1(global$2[COLLECTION_NAME$1] && global$2[COLLECTION_NAME$1].prototype);
  3431. }
  3432. }
  3433. handlePrototype$1(DOMTokenListPrototype$1);
  3434. var global$1 = global$k;
  3435. var DOMIterables = domIterables;
  3436. var DOMTokenListPrototype = domTokenListPrototype;
  3437. var ArrayIteratorMethods = es_array_iterator;
  3438. var createNonEnumerableProperty = createNonEnumerableProperty$7;
  3439. var setToStringTag = setToStringTag$3;
  3440. var wellKnownSymbol = wellKnownSymbol$j;
  3441. var ITERATOR = wellKnownSymbol('iterator');
  3442. var ArrayValues = ArrayIteratorMethods.values;
  3443. var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
  3444. if (CollectionPrototype) {
  3445. // some Chrome versions have non-configurable methods on DOMTokenList
  3446. if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
  3447. createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
  3448. } catch (error) {
  3449. CollectionPrototype[ITERATOR] = ArrayValues;
  3450. }
  3451. setToStringTag(CollectionPrototype, COLLECTION_NAME, true);
  3452. if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
  3453. // some Chrome versions have non-configurable methods on DOMTokenList
  3454. if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
  3455. createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
  3456. } catch (error) {
  3457. CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
  3458. }
  3459. }
  3460. }
  3461. };
  3462. for (var COLLECTION_NAME in DOMIterables) {
  3463. handlePrototype(global$1[COLLECTION_NAME] && global$1[COLLECTION_NAME].prototype, COLLECTION_NAME);
  3464. }
  3465. handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
  3466. var $$2 = _export;
  3467. var fails = fails$x;
  3468. var toObject = toObject$b;
  3469. var nativeGetPrototypeOf = objectGetPrototypeOf$1;
  3470. var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
  3471. var FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); });
  3472. // `Object.getPrototypeOf` method
  3473. // https://tc39.es/ecma262/#sec-object.getprototypeof
  3474. $$2({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {
  3475. getPrototypeOf: function getPrototypeOf(it) {
  3476. return nativeGetPrototypeOf(toObject(it));
  3477. }
  3478. });
  3479. var $$1 = _export;
  3480. var uncurryThis$1 = functionUncurryThisClause;
  3481. var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
  3482. var toLength$2 = toLength$6;
  3483. var toString$2 = toString$f;
  3484. var notARegExp$1 = notARegexp;
  3485. var requireObjectCoercible$2 = requireObjectCoercible$c;
  3486. var correctIsRegExpLogic$1 = correctIsRegexpLogic;
  3487. var slice = uncurryThis$1(''.slice);
  3488. var min$1 = Math.min;
  3489. var CORRECT_IS_REGEXP_LOGIC$1 = correctIsRegExpLogic$1('endsWith');
  3490. // https://github.com/zloirock/core-js/pull/702
  3491. var MDN_POLYFILL_BUG$1 = !CORRECT_IS_REGEXP_LOGIC$1 && !!function () {
  3492. var descriptor = getOwnPropertyDescriptor$1(String.prototype, 'endsWith');
  3493. return descriptor && !descriptor.writable;
  3494. }();
  3495. // `String.prototype.endsWith` method
  3496. // https://tc39.es/ecma262/#sec-string.prototype.endswith
  3497. $$1({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG$1 && !CORRECT_IS_REGEXP_LOGIC$1 }, {
  3498. endsWith: function endsWith(searchString /* , endPosition = @length */) {
  3499. var that = toString$2(requireObjectCoercible$2(this));
  3500. notARegExp$1(searchString);
  3501. var endPosition = arguments.length > 1 ? arguments[1] : undefined;
  3502. var len = that.length;
  3503. var end = endPosition === undefined ? len : min$1(toLength$2(endPosition), len);
  3504. var search = toString$2(searchString);
  3505. return slice(that, end - search.length, end) === search;
  3506. }
  3507. });
  3508. var call = functionCall;
  3509. var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
  3510. var anObject = anObject$c;
  3511. var isNullOrUndefined = isNullOrUndefined$7;
  3512. var toLength$1 = toLength$6;
  3513. var toString$1 = toString$f;
  3514. var requireObjectCoercible$1 = requireObjectCoercible$c;
  3515. var getMethod = getMethod$5;
  3516. var advanceStringIndex = advanceStringIndex$3;
  3517. var regExpExec = regexpExecAbstract;
  3518. // @@match logic
  3519. fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {
  3520. return [
  3521. // `String.prototype.match` method
  3522. // https://tc39.es/ecma262/#sec-string.prototype.match
  3523. function match(regexp) {
  3524. var O = requireObjectCoercible$1(this);
  3525. var matcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, MATCH);
  3526. return matcher ? call(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString$1(O));
  3527. },
  3528. // `RegExp.prototype[@@match]` method
  3529. // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
  3530. function (string) {
  3531. var rx = anObject(this);
  3532. var S = toString$1(string);
  3533. var res = maybeCallNative(nativeMatch, rx, S);
  3534. if (res.done) return res.value;
  3535. if (!rx.global) return regExpExec(rx, S);
  3536. var fullUnicode = rx.unicode;
  3537. rx.lastIndex = 0;
  3538. var A = [];
  3539. var n = 0;
  3540. var result;
  3541. while ((result = regExpExec(rx, S)) !== null) {
  3542. var matchStr = toString$1(result[0]);
  3543. A[n] = matchStr;
  3544. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength$1(rx.lastIndex), fullUnicode);
  3545. n++;
  3546. }
  3547. return n === 0 ? null : A;
  3548. }
  3549. ];
  3550. });
  3551. var $ = _export;
  3552. var uncurryThis = functionUncurryThisClause;
  3553. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  3554. var toLength = toLength$6;
  3555. var toString = toString$f;
  3556. var notARegExp = notARegexp;
  3557. var requireObjectCoercible = requireObjectCoercible$c;
  3558. var correctIsRegExpLogic = correctIsRegexpLogic;
  3559. var stringSlice = uncurryThis(''.slice);
  3560. var min = Math.min;
  3561. var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith');
  3562. // https://github.com/zloirock/core-js/pull/702
  3563. var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () {
  3564. var descriptor = getOwnPropertyDescriptor(String.prototype, 'startsWith');
  3565. return descriptor && !descriptor.writable;
  3566. }();
  3567. // `String.prototype.startsWith` method
  3568. // https://tc39.es/ecma262/#sec-string.prototype.startswith
  3569. $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
  3570. startsWith: function startsWith(searchString /* , position = 0 */) {
  3571. var that = toString(requireObjectCoercible(this));
  3572. notARegExp(searchString);
  3573. var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length));
  3574. var search = toString(searchString);
  3575. return stringSlice(that, index, index + search.length) === search;
  3576. }
  3577. });
  3578. var Utils = {
  3579. getBootstrapVersion: function getBootstrapVersion() {
  3580. var bootstrapVersion = 5;
  3581. try {
  3582. var rawVersion = $$q.fn.dropdown.Constructor.VERSION;
  3583. // Only try to parse VERSION if it is defined.
  3584. // It is undefined in older versions of Bootstrap (tested with 3.1.1).
  3585. if (rawVersion !== undefined) {
  3586. bootstrapVersion = parseInt(rawVersion, 10);
  3587. }
  3588. } catch (e) {
  3589. // ignore
  3590. }
  3591. try {
  3592. // eslint-disable-next-line no-undef
  3593. var _rawVersion = bootstrap.Tooltip.VERSION;
  3594. if (_rawVersion !== undefined) {
  3595. bootstrapVersion = parseInt(_rawVersion, 10);
  3596. }
  3597. } catch (e) {
  3598. // ignore
  3599. }
  3600. return bootstrapVersion;
  3601. },
  3602. getIconsPrefix: function getIconsPrefix(theme) {
  3603. return {
  3604. bootstrap3: 'glyphicon',
  3605. bootstrap4: 'fa',
  3606. bootstrap5: 'bi',
  3607. 'bootstrap-table': 'icon',
  3608. bulma: 'fa',
  3609. foundation: 'fa',
  3610. materialize: 'material-icons',
  3611. semantic: 'fa'
  3612. }[theme] || 'fa';
  3613. },
  3614. getIcons: function getIcons(prefix) {
  3615. return {
  3616. glyphicon: {
  3617. paginationSwitchDown: 'glyphicon-collapse-down icon-chevron-down',
  3618. paginationSwitchUp: 'glyphicon-collapse-up icon-chevron-up',
  3619. refresh: 'glyphicon-refresh icon-refresh',
  3620. toggleOff: 'glyphicon-list-alt icon-list-alt',
  3621. toggleOn: 'glyphicon-list-alt icon-list-alt',
  3622. columns: 'glyphicon-th icon-th',
  3623. detailOpen: 'glyphicon-plus icon-plus',
  3624. detailClose: 'glyphicon-minus icon-minus',
  3625. fullscreen: 'glyphicon-fullscreen',
  3626. search: 'glyphicon-search',
  3627. clearSearch: 'glyphicon-trash'
  3628. },
  3629. fa: {
  3630. paginationSwitchDown: 'fa-caret-square-down',
  3631. paginationSwitchUp: 'fa-caret-square-up',
  3632. refresh: 'fa-sync',
  3633. toggleOff: 'fa-toggle-off',
  3634. toggleOn: 'fa-toggle-on',
  3635. columns: 'fa-th-list',
  3636. detailOpen: 'fa-plus',
  3637. detailClose: 'fa-minus',
  3638. fullscreen: 'fa-arrows-alt',
  3639. search: 'fa-search',
  3640. clearSearch: 'fa-trash'
  3641. },
  3642. bi: {
  3643. paginationSwitchDown: 'bi-caret-down-square',
  3644. paginationSwitchUp: 'bi-caret-up-square',
  3645. refresh: 'bi-arrow-clockwise',
  3646. toggleOff: 'bi-toggle-off',
  3647. toggleOn: 'bi-toggle-on',
  3648. columns: 'bi-list-ul',
  3649. detailOpen: 'bi-plus',
  3650. detailClose: 'bi-dash',
  3651. fullscreen: 'bi-arrows-move',
  3652. search: 'bi-search',
  3653. clearSearch: 'bi-trash'
  3654. },
  3655. icon: {
  3656. paginationSwitchDown: 'icon-arrow-up-circle',
  3657. paginationSwitchUp: 'icon-arrow-down-circle',
  3658. refresh: 'icon-refresh-cw',
  3659. toggleOff: 'icon-toggle-right',
  3660. toggleOn: 'icon-toggle-right',
  3661. columns: 'icon-list',
  3662. detailOpen: 'icon-plus',
  3663. detailClose: 'icon-minus',
  3664. fullscreen: 'icon-maximize',
  3665. search: 'icon-search',
  3666. clearSearch: 'icon-trash-2'
  3667. },
  3668. 'material-icons': {
  3669. paginationSwitchDown: 'grid_on',
  3670. paginationSwitchUp: 'grid_off',
  3671. refresh: 'refresh',
  3672. toggleOff: 'tablet',
  3673. toggleOn: 'tablet_android',
  3674. columns: 'view_list',
  3675. detailOpen: 'add',
  3676. detailClose: 'remove',
  3677. fullscreen: 'fullscreen',
  3678. sort: 'sort',
  3679. search: 'search',
  3680. clearSearch: 'delete'
  3681. }
  3682. }[prefix] || {};
  3683. },
  3684. getSearchInput: function getSearchInput(that) {
  3685. if (typeof that.options.searchSelector === 'string') {
  3686. return $$q(that.options.searchSelector);
  3687. }
  3688. return that.$toolbar.find('.search input');
  3689. },
  3690. // $.extend: https://github.com/jquery/jquery/blob/3.6.2/src/core.js#L132
  3691. extend: function extend() {
  3692. var _this = this;
  3693. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  3694. args[_key] = arguments[_key];
  3695. }
  3696. var target = args[0] || {};
  3697. var i = 1;
  3698. var deep = false;
  3699. var clone;
  3700. // Handle a deep copy situation
  3701. if (typeof target === 'boolean') {
  3702. deep = target;
  3703. // Skip the boolean and the target
  3704. target = args[i] || {};
  3705. i++;
  3706. }
  3707. // Handle case when target is a string or something (possible in deep copy)
  3708. if (_typeof(target) !== 'object' && typeof target !== 'function') {
  3709. target = {};
  3710. }
  3711. for (; i < args.length; i++) {
  3712. var options = args[i];
  3713. // Ignore undefined/null values
  3714. if (typeof options === 'undefined' || options === null) {
  3715. continue;
  3716. }
  3717. // Extend the base object
  3718. // eslint-disable-next-line guard-for-in
  3719. for (var name in options) {
  3720. var copy = options[name];
  3721. // Prevent Object.prototype pollution
  3722. // Prevent never-ending loop
  3723. if (name === '__proto__' || target === copy) {
  3724. continue;
  3725. }
  3726. var copyIsArray = Array.isArray(copy);
  3727. // Recurse if we're merging plain objects or arrays
  3728. if (deep && copy && (this.isObject(copy) || copyIsArray)) {
  3729. var src = target[name];
  3730. if (copyIsArray && Array.isArray(src)) {
  3731. if (src.every(function (it) {
  3732. return !_this.isObject(it) && !Array.isArray(it);
  3733. })) {
  3734. target[name] = copy;
  3735. continue;
  3736. }
  3737. }
  3738. if (copyIsArray && !Array.isArray(src)) {
  3739. clone = [];
  3740. } else if (!copyIsArray && !this.isObject(src)) {
  3741. clone = {};
  3742. } else {
  3743. clone = src;
  3744. }
  3745. // Never move original objects, clone them
  3746. target[name] = this.extend(deep, clone, copy);
  3747. // Don't bring in undefined values
  3748. } else if (copy !== undefined) {
  3749. target[name] = copy;
  3750. }
  3751. }
  3752. }
  3753. return target;
  3754. },
  3755. // it only does '%s', and return '' when arguments are undefined
  3756. sprintf: function sprintf(_str) {
  3757. for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  3758. args[_key2 - 1] = arguments[_key2];
  3759. }
  3760. var flag = true;
  3761. var i = 0;
  3762. var str = _str.replace(/%s/g, function () {
  3763. var arg = args[i++];
  3764. if (typeof arg === 'undefined') {
  3765. flag = false;
  3766. return '';
  3767. }
  3768. return arg;
  3769. });
  3770. return flag ? str : '';
  3771. },
  3772. isObject: function isObject(obj) {
  3773. if (_typeof(obj) !== 'object' || obj === null) {
  3774. return false;
  3775. }
  3776. var proto = obj;
  3777. while (Object.getPrototypeOf(proto) !== null) {
  3778. proto = Object.getPrototypeOf(proto);
  3779. }
  3780. return Object.getPrototypeOf(obj) === proto;
  3781. },
  3782. isEmptyObject: function isEmptyObject() {
  3783. var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  3784. return Object.entries(obj).length === 0 && obj.constructor === Object;
  3785. },
  3786. isNumeric: function isNumeric(n) {
  3787. return !isNaN(parseFloat(n)) && isFinite(n);
  3788. },
  3789. getFieldTitle: function getFieldTitle(list, value) {
  3790. var _iterator = _createForOfIteratorHelper(list),
  3791. _step;
  3792. try {
  3793. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  3794. var item = _step.value;
  3795. if (item.field === value) {
  3796. return item.title;
  3797. }
  3798. }
  3799. } catch (err) {
  3800. _iterator.e(err);
  3801. } finally {
  3802. _iterator.f();
  3803. }
  3804. return '';
  3805. },
  3806. setFieldIndex: function setFieldIndex(columns) {
  3807. var totalCol = 0;
  3808. var flag = [];
  3809. var _iterator2 = _createForOfIteratorHelper(columns[0]),
  3810. _step2;
  3811. try {
  3812. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  3813. var column = _step2.value;
  3814. totalCol += column.colspan || 1;
  3815. }
  3816. } catch (err) {
  3817. _iterator2.e(err);
  3818. } finally {
  3819. _iterator2.f();
  3820. }
  3821. for (var i = 0; i < columns.length; i++) {
  3822. flag[i] = [];
  3823. for (var j = 0; j < totalCol; j++) {
  3824. flag[i][j] = false;
  3825. }
  3826. }
  3827. for (var _i = 0; _i < columns.length; _i++) {
  3828. var _iterator3 = _createForOfIteratorHelper(columns[_i]),
  3829. _step3;
  3830. try {
  3831. for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
  3832. var r = _step3.value;
  3833. var rowspan = r.rowspan || 1;
  3834. var colspan = r.colspan || 1;
  3835. var index = flag[_i].indexOf(false);
  3836. r.colspanIndex = index;
  3837. if (colspan === 1) {
  3838. r.fieldIndex = index;
  3839. // when field is undefined, use index instead
  3840. if (typeof r.field === 'undefined') {
  3841. r.field = index;
  3842. }
  3843. } else {
  3844. r.colspanGroup = r.colspan;
  3845. }
  3846. for (var _j = 0; _j < rowspan; _j++) {
  3847. for (var k = 0; k < colspan; k++) {
  3848. flag[_i + _j][index + k] = true;
  3849. }
  3850. }
  3851. }
  3852. } catch (err) {
  3853. _iterator3.e(err);
  3854. } finally {
  3855. _iterator3.f();
  3856. }
  3857. }
  3858. },
  3859. normalizeAccent: function normalizeAccent(value) {
  3860. if (typeof value !== 'string') {
  3861. return value;
  3862. }
  3863. return value.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
  3864. },
  3865. updateFieldGroup: function updateFieldGroup(columns, fieldColumns) {
  3866. var _ref;
  3867. var allColumns = (_ref = []).concat.apply(_ref, _toConsumableArray(columns));
  3868. var _iterator4 = _createForOfIteratorHelper(columns),
  3869. _step4;
  3870. try {
  3871. for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
  3872. var c = _step4.value;
  3873. var _iterator6 = _createForOfIteratorHelper(c),
  3874. _step6;
  3875. try {
  3876. for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
  3877. var r = _step6.value;
  3878. if (r.colspanGroup > 1) {
  3879. var colspan = 0;
  3880. var _loop = function _loop(i) {
  3881. var underColumns = allColumns.filter(function (col) {
  3882. return col.fieldIndex === i;
  3883. });
  3884. var column = underColumns[underColumns.length - 1];
  3885. if (underColumns.length > 1) {
  3886. for (var j = 0; j < underColumns.length - 1; j++) {
  3887. underColumns[j].visible = column.visible;
  3888. }
  3889. }
  3890. if (column.visible) {
  3891. colspan++;
  3892. }
  3893. };
  3894. for (var i = r.colspanIndex; i < r.colspanIndex + r.colspanGroup; i++) {
  3895. _loop(i);
  3896. }
  3897. r.colspan = colspan;
  3898. r.visible = colspan > 0;
  3899. }
  3900. }
  3901. } catch (err) {
  3902. _iterator6.e(err);
  3903. } finally {
  3904. _iterator6.f();
  3905. }
  3906. }
  3907. } catch (err) {
  3908. _iterator4.e(err);
  3909. } finally {
  3910. _iterator4.f();
  3911. }
  3912. if (columns.length < 2) {
  3913. return;
  3914. }
  3915. var _iterator5 = _createForOfIteratorHelper(fieldColumns),
  3916. _step5;
  3917. try {
  3918. var _loop2 = function _loop2() {
  3919. var column = _step5.value;
  3920. var sameColumns = allColumns.filter(function (col) {
  3921. return col.fieldIndex === column.fieldIndex;
  3922. });
  3923. if (sameColumns.length > 1) {
  3924. var _iterator7 = _createForOfIteratorHelper(sameColumns),
  3925. _step7;
  3926. try {
  3927. for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
  3928. var _c = _step7.value;
  3929. _c.visible = column.visible;
  3930. }
  3931. } catch (err) {
  3932. _iterator7.e(err);
  3933. } finally {
  3934. _iterator7.f();
  3935. }
  3936. }
  3937. };
  3938. for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
  3939. _loop2();
  3940. }
  3941. } catch (err) {
  3942. _iterator5.e(err);
  3943. } finally {
  3944. _iterator5.f();
  3945. }
  3946. },
  3947. getScrollBarWidth: function getScrollBarWidth() {
  3948. if (this.cachedWidth === undefined) {
  3949. var $inner = $$q('<div/>').addClass('fixed-table-scroll-inner');
  3950. var $outer = $$q('<div/>').addClass('fixed-table-scroll-outer');
  3951. $outer.append($inner);
  3952. $$q('body').append($outer);
  3953. var w1 = $inner[0].offsetWidth;
  3954. $outer.css('overflow', 'scroll');
  3955. var w2 = $inner[0].offsetWidth;
  3956. if (w1 === w2) {
  3957. w2 = $outer[0].clientWidth;
  3958. }
  3959. $outer.remove();
  3960. this.cachedWidth = w1 - w2;
  3961. }
  3962. return this.cachedWidth;
  3963. },
  3964. calculateObjectValue: function calculateObjectValue(self, name, args, defaultValue) {
  3965. var func = name;
  3966. if (typeof name === 'string') {
  3967. // support obj.func1.func2
  3968. var names = name.split('.');
  3969. if (names.length > 1) {
  3970. func = window;
  3971. var _iterator8 = _createForOfIteratorHelper(names),
  3972. _step8;
  3973. try {
  3974. for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
  3975. var f = _step8.value;
  3976. func = func[f];
  3977. }
  3978. } catch (err) {
  3979. _iterator8.e(err);
  3980. } finally {
  3981. _iterator8.f();
  3982. }
  3983. } else {
  3984. func = window[name];
  3985. }
  3986. }
  3987. if (func !== null && _typeof(func) === 'object') {
  3988. return func;
  3989. }
  3990. if (typeof func === 'function') {
  3991. return func.apply(self, args || []);
  3992. }
  3993. if (!func && typeof name === 'string' && args && this.sprintf.apply(this, [name].concat(_toConsumableArray(args)))) {
  3994. return this.sprintf.apply(this, [name].concat(_toConsumableArray(args)));
  3995. }
  3996. return defaultValue;
  3997. },
  3998. compareObjects: function compareObjects(objectA, objectB, compareLength) {
  3999. var aKeys = Object.keys(objectA);
  4000. var bKeys = Object.keys(objectB);
  4001. if (compareLength && aKeys.length !== bKeys.length) {
  4002. return false;
  4003. }
  4004. for (var _i2 = 0, _aKeys = aKeys; _i2 < _aKeys.length; _i2++) {
  4005. var key = _aKeys[_i2];
  4006. if (bKeys.includes(key) && objectA[key] !== objectB[key]) {
  4007. return false;
  4008. }
  4009. }
  4010. return true;
  4011. },
  4012. regexCompare: function regexCompare(value, search) {
  4013. try {
  4014. var regexpParts = search.match(/^\/(.*?)\/([gim]*)$/);
  4015. if (value.toString().search(regexpParts ? new RegExp(regexpParts[1], regexpParts[2]) : new RegExp(search, 'gim')) !== -1) {
  4016. return true;
  4017. }
  4018. } catch (e) {
  4019. return false;
  4020. }
  4021. return false;
  4022. },
  4023. escapeApostrophe: function escapeApostrophe(value) {
  4024. return value.toString().replace(/'/g, '&#39;');
  4025. },
  4026. escapeHTML: function escapeHTML(text) {
  4027. if (!text) {
  4028. return text;
  4029. }
  4030. return text.toString().replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#39;');
  4031. },
  4032. unescapeHTML: function unescapeHTML(text) {
  4033. if (typeof text !== 'string' || !text) {
  4034. return text;
  4035. }
  4036. return text.toString().replace(/&amp;/g, '&').replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&quot;/g, '"').replace(/&#39;/g, '\'');
  4037. },
  4038. removeHTML: function removeHTML(text) {
  4039. if (!text) {
  4040. return text;
  4041. }
  4042. return text.toString().replace(/(<([^>]+)>)/ig, '').replace(/&[#A-Za-z0-9]+;/gi, '').trim();
  4043. },
  4044. getRealDataAttr: function getRealDataAttr(dataAttr) {
  4045. for (var _i3 = 0, _Object$entries = Object.entries(dataAttr); _i3 < _Object$entries.length; _i3++) {
  4046. var _Object$entries$_i = _slicedToArray(_Object$entries[_i3], 2),
  4047. attr = _Object$entries$_i[0],
  4048. value = _Object$entries$_i[1];
  4049. var auxAttr = attr.split(/(?=[A-Z])/).join('-').toLowerCase();
  4050. if (auxAttr !== attr) {
  4051. dataAttr[auxAttr] = value;
  4052. delete dataAttr[attr];
  4053. }
  4054. }
  4055. return dataAttr;
  4056. },
  4057. getItemField: function getItemField(item, field, escape) {
  4058. var columnEscape = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
  4059. var value = item;
  4060. // use column escape if it is defined
  4061. if (typeof columnEscape !== 'undefined') {
  4062. escape = columnEscape;
  4063. }
  4064. if (typeof field !== 'string' || item.hasOwnProperty(field)) {
  4065. return escape ? this.escapeHTML(item[field]) : item[field];
  4066. }
  4067. var props = field.split('.');
  4068. var _iterator9 = _createForOfIteratorHelper(props),
  4069. _step9;
  4070. try {
  4071. for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
  4072. var p = _step9.value;
  4073. value = value && value[p];
  4074. }
  4075. } catch (err) {
  4076. _iterator9.e(err);
  4077. } finally {
  4078. _iterator9.f();
  4079. }
  4080. return escape ? this.escapeHTML(value) : value;
  4081. },
  4082. isIEBrowser: function isIEBrowser() {
  4083. return navigator.userAgent.includes('MSIE ') || /Trident.*rv:11\./.test(navigator.userAgent);
  4084. },
  4085. findIndex: function findIndex(items, item) {
  4086. var _iterator10 = _createForOfIteratorHelper(items),
  4087. _step10;
  4088. try {
  4089. for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
  4090. var it = _step10.value;
  4091. if (JSON.stringify(it) === JSON.stringify(item)) {
  4092. return items.indexOf(it);
  4093. }
  4094. }
  4095. } catch (err) {
  4096. _iterator10.e(err);
  4097. } finally {
  4098. _iterator10.f();
  4099. }
  4100. return -1;
  4101. },
  4102. trToData: function trToData(columns, $els) {
  4103. var _this2 = this;
  4104. var data = [];
  4105. var m = [];
  4106. $els.each(function (y, el) {
  4107. var $el = $$q(el);
  4108. var row = {};
  4109. // save tr's id, class and data-* attributes
  4110. row._id = $el.attr('id');
  4111. row._class = $el.attr('class');
  4112. row._data = _this2.getRealDataAttr($el.data());
  4113. row._style = $el.attr('style');
  4114. $el.find('>td,>th').each(function (_x, el) {
  4115. var $el = $$q(el);
  4116. var colspan = +$el.attr('colspan') || 1;
  4117. var rowspan = +$el.attr('rowspan') || 1;
  4118. var x = _x;
  4119. // skip already occupied cells in current row
  4120. for (; m[y] && m[y][x]; x++) {
  4121. // ignore
  4122. }
  4123. // mark matrix elements occupied by current cell with true
  4124. for (var tx = x; tx < x + colspan; tx++) {
  4125. for (var ty = y; ty < y + rowspan; ty++) {
  4126. if (!m[ty]) {
  4127. // fill missing rows
  4128. m[ty] = [];
  4129. }
  4130. m[ty][tx] = true;
  4131. }
  4132. }
  4133. var field = columns[x].field;
  4134. row[field] = _this2.escapeApostrophe($el.html().trim());
  4135. // save td's id, class and data-* attributes
  4136. row["_".concat(field, "_id")] = $el.attr('id');
  4137. row["_".concat(field, "_class")] = $el.attr('class');
  4138. row["_".concat(field, "_rowspan")] = $el.attr('rowspan');
  4139. row["_".concat(field, "_colspan")] = $el.attr('colspan');
  4140. row["_".concat(field, "_title")] = $el.attr('title');
  4141. row["_".concat(field, "_data")] = _this2.getRealDataAttr($el.data());
  4142. row["_".concat(field, "_style")] = $el.attr('style');
  4143. });
  4144. data.push(row);
  4145. });
  4146. return data;
  4147. },
  4148. sort: function sort(a, b, order, options, aPosition, bPosition) {
  4149. if (a === undefined || a === null) {
  4150. a = '';
  4151. }
  4152. if (b === undefined || b === null) {
  4153. b = '';
  4154. }
  4155. if (options.sortStable && a === b) {
  4156. a = aPosition;
  4157. b = bPosition;
  4158. }
  4159. // If both values are numeric, do a numeric comparison
  4160. if (this.isNumeric(a) && this.isNumeric(b)) {
  4161. // Convert numerical values form string to float.
  4162. a = parseFloat(a);
  4163. b = parseFloat(b);
  4164. if (a < b) {
  4165. return order * -1;
  4166. }
  4167. if (a > b) {
  4168. return order;
  4169. }
  4170. return 0;
  4171. }
  4172. if (options.sortEmptyLast) {
  4173. if (a === '') {
  4174. return 1;
  4175. }
  4176. if (b === '') {
  4177. return -1;
  4178. }
  4179. }
  4180. if (a === b) {
  4181. return 0;
  4182. }
  4183. // If value is not a string, convert to string
  4184. if (typeof a !== 'string') {
  4185. a = a.toString();
  4186. }
  4187. if (a.localeCompare(b) === -1) {
  4188. return order * -1;
  4189. }
  4190. return order;
  4191. },
  4192. getEventName: function getEventName(eventPrefix) {
  4193. var id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  4194. id = id || "".concat(+new Date()).concat(~~(Math.random() * 1000000));
  4195. return "".concat(eventPrefix, "-").concat(id);
  4196. },
  4197. hasDetailViewIcon: function hasDetailViewIcon(options) {
  4198. return options.detailView && options.detailViewIcon && !options.cardView;
  4199. },
  4200. getDetailViewIndexOffset: function getDetailViewIndexOffset(options) {
  4201. return this.hasDetailViewIcon(options) && options.detailViewAlign !== 'right' ? 1 : 0;
  4202. },
  4203. checkAutoMergeCells: function checkAutoMergeCells(data) {
  4204. var _iterator11 = _createForOfIteratorHelper(data),
  4205. _step11;
  4206. try {
  4207. for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
  4208. var row = _step11.value;
  4209. for (var _i4 = 0, _Object$keys = Object.keys(row); _i4 < _Object$keys.length; _i4++) {
  4210. var key = _Object$keys[_i4];
  4211. if (key.startsWith('_') && (key.endsWith('_rowspan') || key.endsWith('_colspan'))) {
  4212. return true;
  4213. }
  4214. }
  4215. }
  4216. } catch (err) {
  4217. _iterator11.e(err);
  4218. } finally {
  4219. _iterator11.f();
  4220. }
  4221. return false;
  4222. },
  4223. deepCopy: function deepCopy(arg) {
  4224. if (arg === undefined) {
  4225. return arg;
  4226. }
  4227. return this.extend(true, Array.isArray(arg) ? [] : {}, arg);
  4228. },
  4229. debounce: function debounce(func, wait, immediate) {
  4230. var timeout;
  4231. return function executedFunction() {
  4232. var context = this;
  4233. var args = arguments;
  4234. var later = function later() {
  4235. timeout = null;
  4236. if (!immediate) func.apply(context, args);
  4237. };
  4238. var callNow = immediate && !timeout;
  4239. clearTimeout(timeout);
  4240. timeout = setTimeout(later, wait);
  4241. if (callNow) func.apply(context, args);
  4242. };
  4243. }
  4244. };
  4245. var VERSION = '1.22.6';
  4246. var bootstrapVersion = Utils.getBootstrapVersion();
  4247. var CONSTANTS = {
  4248. 3: {
  4249. classes: {
  4250. buttonsPrefix: 'btn',
  4251. buttons: 'default',
  4252. buttonsGroup: 'btn-group',
  4253. buttonsDropdown: 'btn-group',
  4254. pull: 'pull',
  4255. inputGroup: 'input-group',
  4256. inputPrefix: 'input-',
  4257. input: 'form-control',
  4258. select: 'form-control',
  4259. paginationDropdown: 'btn-group dropdown',
  4260. dropup: 'dropup',
  4261. dropdownActive: 'active',
  4262. paginationActive: 'active',
  4263. buttonActive: 'active'
  4264. },
  4265. html: {
  4266. toolbarDropdown: ['<ul class="dropdown-menu" role="menu">', '</ul>'],
  4267. toolbarDropdownItem: '<li class="dropdown-item-marker" role="menuitem"><label>%s</label></li>',
  4268. toolbarDropdownSeparator: '<li class="divider"></li>',
  4269. pageDropdown: ['<ul class="dropdown-menu" role="menu">', '</ul>'],
  4270. pageDropdownItem: '<li role="menuitem" class="%s"><a href="#">%s</a></li>',
  4271. dropdownCaret: '<span class="caret"></span>',
  4272. pagination: ['<ul class="pagination%s">', '</ul>'],
  4273. paginationItem: '<li class="page-item%s"><a class="page-link" aria-label="%s" href="javascript:void(0)">%s</a></li>',
  4274. icon: '<i class="%s %s"></i>',
  4275. inputGroup: '<div class="input-group">%s<span class="input-group-btn">%s</span></div>',
  4276. searchInput: '<input class="%s%s" type="text" placeholder="%s">',
  4277. searchButton: '<button class="%s" type="button" name="search" title="%s">%s %s</button>',
  4278. searchClearButton: '<button class="%s" type="button" name="clearSearch" title="%s">%s %s</button>'
  4279. }
  4280. },
  4281. 4: {
  4282. classes: {
  4283. buttonsPrefix: 'btn',
  4284. buttons: 'secondary',
  4285. buttonsGroup: 'btn-group',
  4286. buttonsDropdown: 'btn-group',
  4287. pull: 'float',
  4288. inputGroup: 'btn-group',
  4289. inputPrefix: 'form-control-',
  4290. input: 'form-control',
  4291. select: 'form-control',
  4292. paginationDropdown: 'btn-group dropdown',
  4293. dropup: 'dropup',
  4294. dropdownActive: 'active',
  4295. paginationActive: 'active',
  4296. buttonActive: 'active'
  4297. },
  4298. html: {
  4299. toolbarDropdown: ['<div class="dropdown-menu dropdown-menu-right">', '</div>'],
  4300. toolbarDropdownItem: '<label class="dropdown-item dropdown-item-marker">%s</label>',
  4301. pageDropdown: ['<div class="dropdown-menu">', '</div>'],
  4302. pageDropdownItem: '<a class="dropdown-item %s" href="#">%s</a>',
  4303. toolbarDropdownSeparator: '<div class="dropdown-divider"></div>',
  4304. dropdownCaret: '<span class="caret"></span>',
  4305. pagination: ['<ul class="pagination%s">', '</ul>'],
  4306. paginationItem: '<li class="page-item%s"><a class="page-link" aria-label="%s" href="javascript:void(0)">%s</a></li>',
  4307. icon: '<i class="%s %s"></i>',
  4308. inputGroup: '<div class="input-group">%s<div class="input-group-append">%s</div></div>',
  4309. searchInput: '<input class="%s%s" type="text" placeholder="%s">',
  4310. searchButton: '<button class="%s" type="button" name="search" title="%s">%s %s</button>',
  4311. searchClearButton: '<button class="%s" type="button" name="clearSearch" title="%s">%s %s</button>'
  4312. }
  4313. },
  4314. 5: {
  4315. classes: {
  4316. buttonsPrefix: 'btn',
  4317. buttons: 'secondary',
  4318. buttonsGroup: 'btn-group',
  4319. buttonsDropdown: 'btn-group',
  4320. pull: 'float',
  4321. inputGroup: 'btn-group',
  4322. inputPrefix: 'form-control-',
  4323. input: 'form-control',
  4324. select: 'form-select',
  4325. paginationDropdown: 'btn-group dropdown',
  4326. dropup: 'dropup',
  4327. dropdownActive: 'active',
  4328. paginationActive: 'active',
  4329. buttonActive: 'active'
  4330. },
  4331. html: {
  4332. dataToggle: 'data-bs-toggle',
  4333. toolbarDropdown: ['<div class="dropdown-menu dropdown-menu-end">', '</div>'],
  4334. toolbarDropdownItem: '<label class="dropdown-item dropdown-item-marker">%s</label>',
  4335. pageDropdown: ['<div class="dropdown-menu">', '</div>'],
  4336. pageDropdownItem: '<a class="dropdown-item %s" href="#">%s</a>',
  4337. toolbarDropdownSeparator: '<div class="dropdown-divider"></div>',
  4338. dropdownCaret: '<span class="caret"></span>',
  4339. pagination: ['<ul class="pagination%s">', '</ul>'],
  4340. paginationItem: '<li class="page-item%s"><a class="page-link" aria-label="%s" href="javascript:void(0)">%s</a></li>',
  4341. icon: '<i class="%s %s"></i>',
  4342. inputGroup: '<div class="input-group">%s%s</div>',
  4343. searchInput: '<input class="%s%s" type="text" placeholder="%s">',
  4344. searchButton: '<button class="%s" type="button" name="search" title="%s">%s %s</button>',
  4345. searchClearButton: '<button class="%s" type="button" name="clearSearch" title="%s">%s %s</button>'
  4346. }
  4347. }
  4348. }[bootstrapVersion];
  4349. var DEFAULTS = {
  4350. height: undefined,
  4351. classes: 'table table-bordered table-hover',
  4352. buttons: {},
  4353. theadClasses: '',
  4354. headerStyle: function headerStyle(column) {
  4355. return {};
  4356. },
  4357. rowStyle: function rowStyle(row, index) {
  4358. return {};
  4359. },
  4360. rowAttributes: function rowAttributes(row, index) {
  4361. return {};
  4362. },
  4363. undefinedText: '-',
  4364. locale: undefined,
  4365. virtualScroll: false,
  4366. virtualScrollItemHeight: undefined,
  4367. sortable: true,
  4368. sortClass: undefined,
  4369. silentSort: true,
  4370. sortEmptyLast: false,
  4371. sortName: undefined,
  4372. sortOrder: undefined,
  4373. sortReset: false,
  4374. sortStable: false,
  4375. sortResetPage: false,
  4376. rememberOrder: false,
  4377. serverSort: true,
  4378. customSort: undefined,
  4379. columns: [[]],
  4380. data: [],
  4381. url: undefined,
  4382. method: 'get',
  4383. cache: true,
  4384. contentType: 'application/json',
  4385. dataType: 'json',
  4386. ajax: undefined,
  4387. ajaxOptions: {},
  4388. queryParams: function queryParams(params) {
  4389. return params;
  4390. },
  4391. queryParamsType: 'limit',
  4392. // 'limit', undefined
  4393. responseHandler: function responseHandler(res) {
  4394. return res;
  4395. },
  4396. totalField: 'total',
  4397. totalNotFilteredField: 'totalNotFiltered',
  4398. dataField: 'rows',
  4399. footerField: 'footer',
  4400. pagination: false,
  4401. paginationParts: ['pageInfo', 'pageSize', 'pageList'],
  4402. showExtendedPagination: false,
  4403. paginationLoop: true,
  4404. sidePagination: 'client',
  4405. // client or server
  4406. totalRows: 0,
  4407. totalNotFiltered: 0,
  4408. pageNumber: 1,
  4409. pageSize: 10,
  4410. pageList: [10, 25, 50, 100],
  4411. paginationHAlign: 'right',
  4412. // right, left
  4413. paginationVAlign: 'bottom',
  4414. // bottom, top, both
  4415. paginationDetailHAlign: 'left',
  4416. // right, left
  4417. paginationPreText: '&lsaquo;',
  4418. paginationNextText: '&rsaquo;',
  4419. paginationSuccessivelySize: 5,
  4420. // Maximum successively number of pages in a row
  4421. paginationPagesBySide: 1,
  4422. // Number of pages on each side (right, left) of the current page.
  4423. paginationUseIntermediate: false,
  4424. // Calculate intermediate pages for quick access
  4425. paginationLoadMore: false,
  4426. search: false,
  4427. searchable: false,
  4428. searchHighlight: false,
  4429. searchOnEnterKey: false,
  4430. strictSearch: false,
  4431. regexSearch: false,
  4432. searchSelector: false,
  4433. visibleSearch: false,
  4434. showButtonIcons: true,
  4435. showButtonText: false,
  4436. showSearchButton: false,
  4437. showSearchClearButton: false,
  4438. trimOnSearch: true,
  4439. searchAlign: 'right',
  4440. searchTimeOut: 500,
  4441. searchText: '',
  4442. customSearch: undefined,
  4443. showHeader: true,
  4444. showFooter: false,
  4445. footerStyle: function footerStyle(column) {
  4446. return {};
  4447. },
  4448. searchAccentNeutralise: false,
  4449. showColumns: false,
  4450. showColumnsToggleAll: false,
  4451. showColumnsSearch: false,
  4452. minimumCountColumns: 1,
  4453. showPaginationSwitch: false,
  4454. showRefresh: false,
  4455. showToggle: false,
  4456. showFullscreen: false,
  4457. smartDisplay: true,
  4458. escape: false,
  4459. escapeTitle: true,
  4460. filterOptions: {
  4461. filterAlgorithm: 'and'
  4462. },
  4463. idField: undefined,
  4464. selectItemName: 'btSelectItem',
  4465. clickToSelect: false,
  4466. ignoreClickToSelectOn: function ignoreClickToSelectOn(_ref) {
  4467. var tagName = _ref.tagName;
  4468. return ['A', 'BUTTON'].includes(tagName);
  4469. },
  4470. singleSelect: false,
  4471. checkboxHeader: true,
  4472. maintainMetaData: false,
  4473. multipleSelectRow: false,
  4474. uniqueId: undefined,
  4475. cardView: false,
  4476. detailView: false,
  4477. detailViewIcon: true,
  4478. detailViewByClick: false,
  4479. detailViewAlign: 'left',
  4480. detailFormatter: function detailFormatter(index, row) {
  4481. return '';
  4482. },
  4483. detailFilter: function detailFilter(index, row) {
  4484. return true;
  4485. },
  4486. toolbar: undefined,
  4487. toolbarAlign: 'left',
  4488. buttonsToolbar: undefined,
  4489. buttonsAlign: 'right',
  4490. buttonsOrder: ['paginationSwitch', 'refresh', 'toggle', 'fullscreen', 'columns'],
  4491. buttonsPrefix: CONSTANTS.classes.buttonsPrefix,
  4492. buttonsClass: CONSTANTS.classes.buttons,
  4493. iconsPrefix: undefined,
  4494. // init in initConstants
  4495. icons: {},
  4496. // init in initConstants
  4497. iconSize: undefined,
  4498. fixedScroll: false,
  4499. loadingFontSize: 'auto',
  4500. loadingTemplate: function loadingTemplate(loadingMessage) {
  4501. return "<span class=\"loading-wrap\">\n <span class=\"loading-text\">".concat(loadingMessage, "</span>\n <span class=\"animation-wrap\"><span class=\"animation-dot\"></span></span>\n </span>\n ");
  4502. },
  4503. onAll: function onAll(name, args) {
  4504. return false;
  4505. },
  4506. onClickCell: function onClickCell(field, value, row, $element) {
  4507. return false;
  4508. },
  4509. onDblClickCell: function onDblClickCell(field, value, row, $element) {
  4510. return false;
  4511. },
  4512. onClickRow: function onClickRow(item, $element) {
  4513. return false;
  4514. },
  4515. onDblClickRow: function onDblClickRow(item, $element) {
  4516. return false;
  4517. },
  4518. onSort: function onSort(name, order) {
  4519. return false;
  4520. },
  4521. onCheck: function onCheck(row) {
  4522. return false;
  4523. },
  4524. onUncheck: function onUncheck(row) {
  4525. return false;
  4526. },
  4527. onCheckAll: function onCheckAll(rows) {
  4528. return false;
  4529. },
  4530. onUncheckAll: function onUncheckAll(rows) {
  4531. return false;
  4532. },
  4533. onCheckSome: function onCheckSome(rows) {
  4534. return false;
  4535. },
  4536. onUncheckSome: function onUncheckSome(rows) {
  4537. return false;
  4538. },
  4539. onLoadSuccess: function onLoadSuccess(data) {
  4540. return false;
  4541. },
  4542. onLoadError: function onLoadError(status) {
  4543. return false;
  4544. },
  4545. onColumnSwitch: function onColumnSwitch(field, checked) {
  4546. return false;
  4547. },
  4548. onColumnSwitchAll: function onColumnSwitchAll(checked) {
  4549. return false;
  4550. },
  4551. onPageChange: function onPageChange(number, size) {
  4552. return false;
  4553. },
  4554. onSearch: function onSearch(text) {
  4555. return false;
  4556. },
  4557. onToggle: function onToggle(cardView) {
  4558. return false;
  4559. },
  4560. onPreBody: function onPreBody(data) {
  4561. return false;
  4562. },
  4563. onPostBody: function onPostBody() {
  4564. return false;
  4565. },
  4566. onPostHeader: function onPostHeader() {
  4567. return false;
  4568. },
  4569. onPostFooter: function onPostFooter() {
  4570. return false;
  4571. },
  4572. onExpandRow: function onExpandRow(index, row, $detail) {
  4573. return false;
  4574. },
  4575. onCollapseRow: function onCollapseRow(index, row) {
  4576. return false;
  4577. },
  4578. onRefreshOptions: function onRefreshOptions(options) {
  4579. return false;
  4580. },
  4581. onRefresh: function onRefresh(params) {
  4582. return false;
  4583. },
  4584. onResetView: function onResetView() {
  4585. return false;
  4586. },
  4587. onScrollBody: function onScrollBody() {
  4588. return false;
  4589. },
  4590. onTogglePagination: function onTogglePagination(newState) {
  4591. return false;
  4592. },
  4593. onVirtualScroll: function onVirtualScroll(startIndex, endIndex) {
  4594. return false;
  4595. }
  4596. };
  4597. var EN = {
  4598. formatLoadingMessage: function formatLoadingMessage() {
  4599. return 'Loading, please wait';
  4600. },
  4601. formatRecordsPerPage: function formatRecordsPerPage(pageNumber) {
  4602. return "".concat(pageNumber, " rows per page");
  4603. },
  4604. formatShowingRows: function formatShowingRows(pageFrom, pageTo, totalRows, totalNotFiltered) {
  4605. if (totalNotFiltered !== undefined && totalNotFiltered > 0 && totalNotFiltered > totalRows) {
  4606. return "Showing ".concat(pageFrom, " to ").concat(pageTo, " of ").concat(totalRows, " rows (filtered from ").concat(totalNotFiltered, " total rows)");
  4607. }
  4608. return "Showing ".concat(pageFrom, " to ").concat(pageTo, " of ").concat(totalRows, " rows");
  4609. },
  4610. formatSRPaginationPreText: function formatSRPaginationPreText() {
  4611. return 'previous page';
  4612. },
  4613. formatSRPaginationPageText: function formatSRPaginationPageText(page) {
  4614. return "to page ".concat(page);
  4615. },
  4616. formatSRPaginationNextText: function formatSRPaginationNextText() {
  4617. return 'next page';
  4618. },
  4619. formatDetailPagination: function formatDetailPagination(totalRows) {
  4620. return "Showing ".concat(totalRows, " rows");
  4621. },
  4622. formatSearch: function formatSearch() {
  4623. return 'Search';
  4624. },
  4625. formatClearSearch: function formatClearSearch() {
  4626. return 'Clear Search';
  4627. },
  4628. formatNoMatches: function formatNoMatches() {
  4629. return 'No matching records found';
  4630. },
  4631. formatPaginationSwitch: function formatPaginationSwitch() {
  4632. return 'Hide/Show pagination';
  4633. },
  4634. formatPaginationSwitchDown: function formatPaginationSwitchDown() {
  4635. return 'Show pagination';
  4636. },
  4637. formatPaginationSwitchUp: function formatPaginationSwitchUp() {
  4638. return 'Hide pagination';
  4639. },
  4640. formatRefresh: function formatRefresh() {
  4641. return 'Refresh';
  4642. },
  4643. formatToggleOn: function formatToggleOn() {
  4644. return 'Show card view';
  4645. },
  4646. formatToggleOff: function formatToggleOff() {
  4647. return 'Hide card view';
  4648. },
  4649. formatColumns: function formatColumns() {
  4650. return 'Columns';
  4651. },
  4652. formatColumnsToggleAll: function formatColumnsToggleAll() {
  4653. return 'Toggle all';
  4654. },
  4655. formatFullscreen: function formatFullscreen() {
  4656. return 'Fullscreen';
  4657. },
  4658. formatAllRows: function formatAllRows() {
  4659. return 'All';
  4660. }
  4661. };
  4662. var COLUMN_DEFAULTS = {
  4663. field: undefined,
  4664. title: undefined,
  4665. titleTooltip: undefined,
  4666. class: undefined,
  4667. width: undefined,
  4668. widthUnit: 'px',
  4669. rowspan: undefined,
  4670. colspan: undefined,
  4671. align: undefined,
  4672. // left, right, center
  4673. halign: undefined,
  4674. // left, right, center
  4675. falign: undefined,
  4676. // left, right, center
  4677. valign: undefined,
  4678. // top, middle, bottom
  4679. cellStyle: undefined,
  4680. radio: false,
  4681. checkbox: false,
  4682. checkboxEnabled: true,
  4683. clickToSelect: true,
  4684. showSelectTitle: false,
  4685. sortable: false,
  4686. sortName: undefined,
  4687. order: 'asc',
  4688. // asc, desc
  4689. sorter: undefined,
  4690. visible: true,
  4691. switchable: true,
  4692. switchableLabel: undefined,
  4693. cardVisible: true,
  4694. searchable: true,
  4695. formatter: undefined,
  4696. footerFormatter: undefined,
  4697. footerStyle: undefined,
  4698. detailFormatter: undefined,
  4699. searchFormatter: true,
  4700. searchHighlightFormatter: false,
  4701. escape: undefined,
  4702. events: undefined
  4703. };
  4704. var METHODS = ['getOptions', 'refreshOptions', 'getData', 'getSelections', 'load', 'append', 'prepend', 'remove', 'removeAll', 'insertRow', 'updateRow', 'getRowByUniqueId', 'updateByUniqueId', 'removeByUniqueId', 'updateCell', 'updateCellByUniqueId', 'showRow', 'hideRow', 'getHiddenRows', 'showColumn', 'hideColumn', 'getVisibleColumns', 'getHiddenColumns', 'showAllColumns', 'hideAllColumns', 'mergeCells', 'checkAll', 'uncheckAll', 'checkInvert', 'check', 'uncheck', 'checkBy', 'uncheckBy', 'refresh', 'destroy', 'resetView', 'showLoading', 'hideLoading', 'togglePagination', 'toggleFullscreen', 'toggleView', 'resetSearch', 'filterBy', 'sortBy', 'scrollTo', 'getScrollPosition', 'selectPage', 'prevPage', 'nextPage', 'toggleDetailView', 'expandRow', 'collapseRow', 'expandRowByUniqueId', 'collapseRowByUniqueId', 'expandAllRows', 'collapseAllRows', 'updateColumnTitle', 'updateFormatText'];
  4705. var EVENTS = {
  4706. 'all.bs.table': 'onAll',
  4707. 'click-row.bs.table': 'onClickRow',
  4708. 'dbl-click-row.bs.table': 'onDblClickRow',
  4709. 'click-cell.bs.table': 'onClickCell',
  4710. 'dbl-click-cell.bs.table': 'onDblClickCell',
  4711. 'sort.bs.table': 'onSort',
  4712. 'check.bs.table': 'onCheck',
  4713. 'uncheck.bs.table': 'onUncheck',
  4714. 'check-all.bs.table': 'onCheckAll',
  4715. 'uncheck-all.bs.table': 'onUncheckAll',
  4716. 'check-some.bs.table': 'onCheckSome',
  4717. 'uncheck-some.bs.table': 'onUncheckSome',
  4718. 'load-success.bs.table': 'onLoadSuccess',
  4719. 'load-error.bs.table': 'onLoadError',
  4720. 'column-switch.bs.table': 'onColumnSwitch',
  4721. 'column-switch-all.bs.table': 'onColumnSwitchAll',
  4722. 'page-change.bs.table': 'onPageChange',
  4723. 'search.bs.table': 'onSearch',
  4724. 'toggle.bs.table': 'onToggle',
  4725. 'pre-body.bs.table': 'onPreBody',
  4726. 'post-body.bs.table': 'onPostBody',
  4727. 'post-header.bs.table': 'onPostHeader',
  4728. 'post-footer.bs.table': 'onPostFooter',
  4729. 'expand-row.bs.table': 'onExpandRow',
  4730. 'collapse-row.bs.table': 'onCollapseRow',
  4731. 'refresh-options.bs.table': 'onRefreshOptions',
  4732. 'reset-view.bs.table': 'onResetView',
  4733. 'refresh.bs.table': 'onRefresh',
  4734. 'scroll-body.bs.table': 'onScrollBody',
  4735. 'toggle-pagination.bs.table': 'onTogglePagination',
  4736. 'virtual-scroll.bs.table': 'onVirtualScroll'
  4737. };
  4738. Object.assign(DEFAULTS, EN);
  4739. var Constants = {
  4740. VERSION: VERSION,
  4741. THEME: "bootstrap".concat(bootstrapVersion),
  4742. CONSTANTS: CONSTANTS,
  4743. DEFAULTS: DEFAULTS,
  4744. COLUMN_DEFAULTS: COLUMN_DEFAULTS,
  4745. METHODS: METHODS,
  4746. EVENTS: EVENTS,
  4747. LOCALES: {
  4748. en: EN,
  4749. 'en-US': EN
  4750. }
  4751. };
  4752. var BLOCK_ROWS = 50;
  4753. var CLUSTER_BLOCKS = 4;
  4754. var VirtualScroll = /*#__PURE__*/function () {
  4755. function VirtualScroll(options) {
  4756. var _this = this;
  4757. _classCallCheck(this, VirtualScroll);
  4758. this.rows = options.rows;
  4759. this.scrollEl = options.scrollEl;
  4760. this.contentEl = options.contentEl;
  4761. this.callback = options.callback;
  4762. this.itemHeight = options.itemHeight;
  4763. this.cache = {};
  4764. this.scrollTop = this.scrollEl.scrollTop;
  4765. this.initDOM(this.rows, options.fixedScroll);
  4766. this.scrollEl.scrollTop = this.scrollTop;
  4767. this.lastCluster = 0;
  4768. var onScroll = function onScroll() {
  4769. if (_this.lastCluster !== (_this.lastCluster = _this.getNum())) {
  4770. _this.initDOM(_this.rows);
  4771. _this.callback(_this.startIndex, _this.endIndex);
  4772. }
  4773. };
  4774. this.scrollEl.addEventListener('scroll', onScroll, false);
  4775. this.destroy = function () {
  4776. _this.contentEl.innerHtml = '';
  4777. _this.scrollEl.removeEventListener('scroll', onScroll, false);
  4778. };
  4779. }
  4780. return _createClass(VirtualScroll, [{
  4781. key: "initDOM",
  4782. value: function initDOM(rows, fixedScroll) {
  4783. if (typeof this.clusterHeight === 'undefined') {
  4784. this.cache.scrollTop = this.scrollEl.scrollTop;
  4785. this.cache.data = this.contentEl.innerHTML = rows[0] + rows[0] + rows[0];
  4786. this.getRowsHeight(rows);
  4787. } else if (this.blockHeight === 0) {
  4788. this.getRowsHeight(rows);
  4789. }
  4790. var data = this.initData(rows, this.getNum(fixedScroll));
  4791. var thisRows = data.rows.join('');
  4792. var dataChanged = this.checkChanges('data', thisRows);
  4793. var topOffsetChanged = this.checkChanges('top', data.topOffset);
  4794. var bottomOffsetChanged = this.checkChanges('bottom', data.bottomOffset);
  4795. var html = [];
  4796. if (dataChanged && topOffsetChanged) {
  4797. if (data.topOffset) {
  4798. html.push(this.getExtra('top', data.topOffset));
  4799. }
  4800. html.push(thisRows);
  4801. if (data.bottomOffset) {
  4802. html.push(this.getExtra('bottom', data.bottomOffset));
  4803. }
  4804. this.startIndex = data.start;
  4805. this.endIndex = data.end;
  4806. this.contentEl.innerHTML = html.join('');
  4807. if (fixedScroll) {
  4808. this.contentEl.scrollTop = this.cache.scrollTop;
  4809. }
  4810. } else if (bottomOffsetChanged) {
  4811. this.contentEl.lastChild.style.height = "".concat(data.bottomOffset, "px");
  4812. }
  4813. }
  4814. }, {
  4815. key: "getRowsHeight",
  4816. value: function getRowsHeight() {
  4817. if (typeof this.itemHeight === 'undefined' || this.itemHeight === 0) {
  4818. var nodes = this.contentEl.children;
  4819. var node = nodes[Math.floor(nodes.length / 2)];
  4820. this.itemHeight = node.offsetHeight;
  4821. }
  4822. this.blockHeight = this.itemHeight * BLOCK_ROWS;
  4823. this.clusterRows = BLOCK_ROWS * CLUSTER_BLOCKS;
  4824. this.clusterHeight = this.blockHeight * CLUSTER_BLOCKS;
  4825. }
  4826. }, {
  4827. key: "getNum",
  4828. value: function getNum(fixedScroll) {
  4829. this.scrollTop = fixedScroll ? this.cache.scrollTop : this.scrollEl.scrollTop;
  4830. return Math.floor(this.scrollTop / (this.clusterHeight - this.blockHeight)) || 0;
  4831. }
  4832. }, {
  4833. key: "initData",
  4834. value: function initData(rows, num) {
  4835. if (rows.length < BLOCK_ROWS) {
  4836. return {
  4837. topOffset: 0,
  4838. bottomOffset: 0,
  4839. rowsAbove: 0,
  4840. rows: rows
  4841. };
  4842. }
  4843. var start = Math.max((this.clusterRows - BLOCK_ROWS) * num, 0);
  4844. var end = start + this.clusterRows;
  4845. var topOffset = Math.max(start * this.itemHeight, 0);
  4846. var bottomOffset = Math.max((rows.length - end) * this.itemHeight, 0);
  4847. var thisRows = [];
  4848. var rowsAbove = start;
  4849. if (topOffset < 1) {
  4850. rowsAbove++;
  4851. }
  4852. for (var i = start; i < end; i++) {
  4853. rows[i] && thisRows.push(rows[i]);
  4854. }
  4855. return {
  4856. start: start,
  4857. end: end,
  4858. topOffset: topOffset,
  4859. bottomOffset: bottomOffset,
  4860. rowsAbove: rowsAbove,
  4861. rows: thisRows
  4862. };
  4863. }
  4864. }, {
  4865. key: "checkChanges",
  4866. value: function checkChanges(type, value) {
  4867. var changed = value !== this.cache[type];
  4868. this.cache[type] = value;
  4869. return changed;
  4870. }
  4871. }, {
  4872. key: "getExtra",
  4873. value: function getExtra(className, height) {
  4874. var tag = document.createElement('tr');
  4875. tag.className = "virtual-scroll-".concat(className);
  4876. if (height) {
  4877. tag.style.height = "".concat(height, "px");
  4878. }
  4879. return tag.outerHTML;
  4880. }
  4881. }]);
  4882. }();
  4883. var BootstrapTable = /*#__PURE__*/function () {
  4884. function BootstrapTable(el, options) {
  4885. _classCallCheck(this, BootstrapTable);
  4886. this.options = options;
  4887. this.$el = $$q(el);
  4888. this.$el_ = this.$el.clone();
  4889. this.timeoutId_ = 0;
  4890. this.timeoutFooter_ = 0;
  4891. }
  4892. return _createClass(BootstrapTable, [{
  4893. key: "init",
  4894. value: function init() {
  4895. this.initConstants();
  4896. this.initLocale();
  4897. this.initContainer();
  4898. this.initTable();
  4899. this.initHeader();
  4900. this.initData();
  4901. this.initHiddenRows();
  4902. this.initToolbar();
  4903. this.initPagination();
  4904. this.initBody();
  4905. this.initSearchText();
  4906. this.initServer();
  4907. }
  4908. }, {
  4909. key: "initConstants",
  4910. value: function initConstants() {
  4911. var opts = this.options;
  4912. this.constants = Constants.CONSTANTS;
  4913. this.constants.theme = $$q.fn.bootstrapTable.theme;
  4914. this.constants.dataToggle = this.constants.html.dataToggle || 'data-toggle';
  4915. // init iconsPrefix and icons
  4916. var iconsPrefix = Utils.getIconsPrefix($$q.fn.bootstrapTable.theme);
  4917. if (typeof opts.icons === 'string') {
  4918. opts.icons = Utils.calculateObjectValue(null, opts.icons);
  4919. }
  4920. opts.iconsPrefix = opts.iconsPrefix || $$q.fn.bootstrapTable.defaults.iconsPrefix || iconsPrefix;
  4921. opts.icons = Object.assign(Utils.getIcons(opts.iconsPrefix), $$q.fn.bootstrapTable.defaults.icons, opts.icons);
  4922. // init buttons class
  4923. var buttonsPrefix = opts.buttonsPrefix ? "".concat(opts.buttonsPrefix, "-") : '';
  4924. this.constants.buttonsClass = [opts.buttonsPrefix, buttonsPrefix + opts.buttonsClass, Utils.sprintf("".concat(buttonsPrefix, "%s"), opts.iconSize)].join(' ').trim();
  4925. this.buttons = Utils.calculateObjectValue(this, opts.buttons, [], {});
  4926. if (_typeof(this.buttons) !== 'object') {
  4927. this.buttons = {};
  4928. }
  4929. }
  4930. }, {
  4931. key: "initLocale",
  4932. value: function initLocale() {
  4933. if (this.options.locale) {
  4934. var locales = $$q.fn.bootstrapTable.locales;
  4935. var parts = this.options.locale.split(/-|_/);
  4936. parts[0] = parts[0].toLowerCase();
  4937. if (parts[1]) {
  4938. parts[1] = parts[1].toUpperCase();
  4939. }
  4940. var localesToExtend = {};
  4941. if (locales[this.options.locale]) {
  4942. localesToExtend = locales[this.options.locale];
  4943. } else if (locales[parts.join('-')]) {
  4944. localesToExtend = locales[parts.join('-')];
  4945. } else if (locales[parts[0]]) {
  4946. localesToExtend = locales[parts[0]];
  4947. }
  4948. this._defaultLocales = this._defaultLocales || {};
  4949. for (var _i = 0, _Object$entries = Object.entries(localesToExtend); _i < _Object$entries.length; _i++) {
  4950. var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
  4951. formatName = _Object$entries$_i[0],
  4952. func = _Object$entries$_i[1];
  4953. var defaultLocale = this._defaultLocales.hasOwnProperty(formatName) ? this._defaultLocales[formatName] : BootstrapTable.DEFAULTS[formatName];
  4954. if (this.options[formatName] !== defaultLocale) {
  4955. continue;
  4956. }
  4957. this.options[formatName] = func;
  4958. this._defaultLocales[formatName] = func;
  4959. }
  4960. }
  4961. }
  4962. }, {
  4963. key: "initContainer",
  4964. value: function initContainer() {
  4965. var topPagination = ['top', 'both'].includes(this.options.paginationVAlign) ? '<div class="fixed-table-pagination clearfix"></div>' : '';
  4966. var bottomPagination = ['bottom', 'both'].includes(this.options.paginationVAlign) ? '<div class="fixed-table-pagination"></div>' : '';
  4967. var loadingTemplate = Utils.calculateObjectValue(this.options, this.options.loadingTemplate, [this.options.formatLoadingMessage()]);
  4968. this.$container = $$q("\n <div class=\"bootstrap-table ".concat(this.constants.theme, "\">\n <div class=\"fixed-table-toolbar\"></div>\n ").concat(topPagination, "\n <div class=\"fixed-table-container\">\n <div class=\"fixed-table-header\"><table></table></div>\n <div class=\"fixed-table-body\">\n <div class=\"fixed-table-loading\">\n ").concat(loadingTemplate, "\n </div>\n </div>\n <div class=\"fixed-table-footer\"></div>\n </div>\n ").concat(bottomPagination, "\n </div>\n "));
  4969. this.$container.insertAfter(this.$el);
  4970. this.$tableContainer = this.$container.find('.fixed-table-container');
  4971. this.$tableHeader = this.$container.find('.fixed-table-header');
  4972. this.$tableBody = this.$container.find('.fixed-table-body');
  4973. this.$tableLoading = this.$container.find('.fixed-table-loading');
  4974. this.$tableFooter = this.$el.find('tfoot');
  4975. // checking if custom table-toolbar exists or not
  4976. if (this.options.buttonsToolbar) {
  4977. this.$toolbar = $$q('body').find(this.options.buttonsToolbar);
  4978. } else {
  4979. this.$toolbar = this.$container.find('.fixed-table-toolbar');
  4980. }
  4981. this.$pagination = this.$container.find('.fixed-table-pagination');
  4982. this.$tableBody.append(this.$el);
  4983. this.$container.after('<div class="clearfix"></div>');
  4984. this.$el.addClass(this.options.classes);
  4985. this.$tableLoading.addClass(this.options.classes);
  4986. if (this.options.height) {
  4987. this.$tableContainer.addClass('fixed-height');
  4988. if (this.options.showFooter) {
  4989. this.$tableContainer.addClass('has-footer');
  4990. }
  4991. if (this.options.classes.split(' ').includes('table-bordered')) {
  4992. this.$tableBody.append('<div class="fixed-table-border"></div>');
  4993. this.$tableBorder = this.$tableBody.find('.fixed-table-border');
  4994. this.$tableLoading.addClass('fixed-table-border');
  4995. }
  4996. this.$tableFooter = this.$container.find('.fixed-table-footer');
  4997. }
  4998. }
  4999. }, {
  5000. key: "initTable",
  5001. value: function initTable() {
  5002. var _this = this;
  5003. var columns = [];
  5004. this.$header = this.$el.find('>thead');
  5005. if (!this.$header.length) {
  5006. this.$header = $$q("<thead class=\"".concat(this.options.theadClasses, "\"></thead>")).appendTo(this.$el);
  5007. } else if (this.options.theadClasses) {
  5008. this.$header.addClass(this.options.theadClasses);
  5009. }
  5010. this._headerTrClasses = [];
  5011. this._headerTrStyles = [];
  5012. this.$header.find('tr').each(function (i, el) {
  5013. var $tr = $$q(el);
  5014. var column = [];
  5015. $tr.find('th').each(function (i, el) {
  5016. var $th = $$q(el);
  5017. // #2014: getFieldIndex and elsewhere assume this is string, causes issues if not
  5018. if (typeof $th.data('field') !== 'undefined') {
  5019. $th.data('field', "".concat($th.data('field')));
  5020. }
  5021. var _data = Object.assign({}, $th.data());
  5022. for (var key in _data) {
  5023. if ($$q.fn.bootstrapTable.columnDefaults.hasOwnProperty(key)) {
  5024. delete _data[key];
  5025. }
  5026. }
  5027. column.push(Utils.extend({}, {
  5028. _data: Utils.getRealDataAttr(_data),
  5029. title: $th.html(),
  5030. class: $th.attr('class'),
  5031. titleTooltip: $th.attr('title'),
  5032. rowspan: $th.attr('rowspan') ? +$th.attr('rowspan') : undefined,
  5033. colspan: $th.attr('colspan') ? +$th.attr('colspan') : undefined
  5034. }, $th.data()));
  5035. });
  5036. columns.push(column);
  5037. if ($tr.attr('class')) {
  5038. _this._headerTrClasses.push($tr.attr('class'));
  5039. }
  5040. if ($tr.attr('style')) {
  5041. _this._headerTrStyles.push($tr.attr('style'));
  5042. }
  5043. });
  5044. if (!Array.isArray(this.options.columns[0])) {
  5045. this.options.columns = [this.options.columns];
  5046. }
  5047. this.options.columns = Utils.extend(true, [], columns, this.options.columns);
  5048. this.columns = [];
  5049. this.fieldsColumnsIndex = [];
  5050. Utils.setFieldIndex(this.options.columns);
  5051. this.options.columns.forEach(function (columns, i) {
  5052. columns.forEach(function (_column, j) {
  5053. var column = Utils.extend({}, BootstrapTable.COLUMN_DEFAULTS, _column, {
  5054. passed: _column
  5055. });
  5056. if (typeof column.fieldIndex !== 'undefined') {
  5057. _this.columns[column.fieldIndex] = column;
  5058. _this.fieldsColumnsIndex[column.field] = column.fieldIndex;
  5059. }
  5060. _this.options.columns[i][j] = column;
  5061. });
  5062. });
  5063. // if options.data is setting, do not process tbody and tfoot data
  5064. if (!this.options.data.length) {
  5065. var htmlData = Utils.trToData(this.columns, this.$el.find('>tbody>tr'));
  5066. if (htmlData.length) {
  5067. this.options.data = htmlData;
  5068. this.fromHtml = true;
  5069. }
  5070. }
  5071. if (!(this.options.pagination && this.options.sidePagination !== 'server')) {
  5072. this.footerData = Utils.trToData(this.columns, this.$el.find('>tfoot>tr'));
  5073. }
  5074. if (this.footerData) {
  5075. this.$el.find('tfoot').html('<tr></tr>');
  5076. }
  5077. if (!this.options.showFooter || this.options.cardView) {
  5078. this.$tableFooter.hide();
  5079. } else {
  5080. this.$tableFooter.show();
  5081. }
  5082. }
  5083. }, {
  5084. key: "initHeader",
  5085. value: function initHeader() {
  5086. var _this2 = this;
  5087. var visibleColumns = {};
  5088. var headerHtml = [];
  5089. this.header = {
  5090. fields: [],
  5091. styles: [],
  5092. classes: [],
  5093. formatters: [],
  5094. detailFormatters: [],
  5095. events: [],
  5096. sorters: [],
  5097. sortNames: [],
  5098. cellStyles: [],
  5099. searchables: []
  5100. };
  5101. Utils.updateFieldGroup(this.options.columns, this.columns);
  5102. this.options.columns.forEach(function (columns, i) {
  5103. var html = [];
  5104. html.push("<tr".concat(Utils.sprintf(' class="%s"', _this2._headerTrClasses[i]), " ").concat(Utils.sprintf(' style="%s"', _this2._headerTrStyles[i]), ">"));
  5105. var detailViewTemplate = '';
  5106. if (i === 0 && Utils.hasDetailViewIcon(_this2.options)) {
  5107. var rowspan = _this2.options.columns.length > 1 ? " rowspan=\"".concat(_this2.options.columns.length, "\"") : '';
  5108. detailViewTemplate = "<th class=\"detail\"".concat(rowspan, ">\n <div class=\"fht-cell\"></div>\n </th>");
  5109. }
  5110. if (detailViewTemplate && _this2.options.detailViewAlign !== 'right') {
  5111. html.push(detailViewTemplate);
  5112. }
  5113. columns.forEach(function (column, j) {
  5114. var class_ = Utils.sprintf(' class="%s"', column['class']);
  5115. var unitWidth = column.widthUnit;
  5116. var width = parseFloat(column.width);
  5117. var columnHalign = column.halign ? column.halign : column.align;
  5118. var halign = Utils.sprintf('text-align: %s; ', columnHalign);
  5119. var align = Utils.sprintf('text-align: %s; ', column.align);
  5120. var style = Utils.sprintf('vertical-align: %s; ', column.valign);
  5121. style += Utils.sprintf('width: %s; ', (column.checkbox || column.radio) && !width ? !column.showSelectTitle ? '36px' : undefined : width ? width + unitWidth : undefined);
  5122. if (typeof column.fieldIndex === 'undefined' && !column.visible) {
  5123. return;
  5124. }
  5125. var headerStyle = Utils.calculateObjectValue(null, _this2.options.headerStyle, [column]);
  5126. var csses = [];
  5127. var data_ = [];
  5128. var classes = '';
  5129. if (headerStyle && headerStyle.css) {
  5130. for (var _i2 = 0, _Object$entries2 = Object.entries(headerStyle.css); _i2 < _Object$entries2.length; _i2++) {
  5131. var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),
  5132. key = _Object$entries2$_i[0],
  5133. value = _Object$entries2$_i[1];
  5134. csses.push("".concat(key, ": ").concat(value));
  5135. }
  5136. }
  5137. if (headerStyle && headerStyle.classes) {
  5138. classes = Utils.sprintf(' class="%s"', column['class'] ? [column['class'], headerStyle.classes].join(' ') : headerStyle.classes);
  5139. }
  5140. if (typeof column.fieldIndex !== 'undefined') {
  5141. _this2.header.fields[column.fieldIndex] = column.field;
  5142. _this2.header.styles[column.fieldIndex] = align + style;
  5143. _this2.header.classes[column.fieldIndex] = class_;
  5144. _this2.header.formatters[column.fieldIndex] = column.formatter;
  5145. _this2.header.detailFormatters[column.fieldIndex] = column.detailFormatter;
  5146. _this2.header.events[column.fieldIndex] = column.events;
  5147. _this2.header.sorters[column.fieldIndex] = column.sorter;
  5148. _this2.header.sortNames[column.fieldIndex] = column.sortName;
  5149. _this2.header.cellStyles[column.fieldIndex] = column.cellStyle;
  5150. _this2.header.searchables[column.fieldIndex] = column.searchable;
  5151. if (!column.visible) {
  5152. return;
  5153. }
  5154. if (_this2.options.cardView && !column.cardVisible) {
  5155. return;
  5156. }
  5157. visibleColumns[column.field] = column;
  5158. }
  5159. if (Object.keys(column._data || {}).length > 0) {
  5160. for (var _i3 = 0, _Object$entries3 = Object.entries(column._data); _i3 < _Object$entries3.length; _i3++) {
  5161. var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i3], 2),
  5162. k = _Object$entries3$_i[0],
  5163. v = _Object$entries3$_i[1];
  5164. data_.push("data-".concat(k, "='").concat(_typeof(v) === 'object' ? JSON.stringify(v) : v, "'"));
  5165. }
  5166. }
  5167. html.push("<th".concat(Utils.sprintf(' title="%s"', column.titleTooltip)), column.checkbox || column.radio ? Utils.sprintf(' class="bs-checkbox %s"', column['class'] || '') : classes || class_, Utils.sprintf(' style="%s"', halign + style + csses.join('; ') || undefined), Utils.sprintf(' rowspan="%s"', column.rowspan), Utils.sprintf(' colspan="%s"', column.colspan), Utils.sprintf(' data-field="%s"', column.field),
  5168. // If `column` is not the first element of `this.options.columns[0]`, then className 'data-not-first-th' should be added.
  5169. j === 0 && i > 0 ? ' data-not-first-th' : '', data_.length > 0 ? data_.join(' ') : '', '>');
  5170. html.push(Utils.sprintf('<div class="th-inner %s">', _this2.options.sortable && column.sortable ? "sortable".concat(columnHalign === 'center' ? ' sortable-center' : '', " both") : ''));
  5171. var text = _this2.options.escape && _this2.options.escapeTitle ? Utils.escapeHTML(column.title) : column.title;
  5172. var title = text;
  5173. if (column.checkbox) {
  5174. text = '';
  5175. if (!_this2.options.singleSelect && _this2.options.checkboxHeader) {
  5176. text = '<label><input name="btSelectAll" type="checkbox" /><span></span></label>';
  5177. }
  5178. _this2.header.stateField = column.field;
  5179. }
  5180. if (column.radio) {
  5181. text = '';
  5182. _this2.header.stateField = column.field;
  5183. }
  5184. if (!text && column.showSelectTitle) {
  5185. text += title;
  5186. }
  5187. html.push(text);
  5188. html.push('</div>');
  5189. html.push('<div class="fht-cell"></div>');
  5190. html.push('</div>');
  5191. html.push('</th>');
  5192. });
  5193. if (detailViewTemplate && _this2.options.detailViewAlign === 'right') {
  5194. html.push(detailViewTemplate);
  5195. }
  5196. html.push('</tr>');
  5197. if (html.length > 3) {
  5198. headerHtml.push(html.join(''));
  5199. }
  5200. });
  5201. this.$header.html(headerHtml.join(''));
  5202. this.$header.find('th[data-field]').each(function (i, el) {
  5203. $$q(el).data(visibleColumns[$$q(el).data('field')]);
  5204. });
  5205. this.$container.off('click', '.th-inner').on('click', '.th-inner', function (e) {
  5206. var $this = $$q(e.currentTarget);
  5207. if (_this2.options.detailView && !$this.parent().hasClass('bs-checkbox')) {
  5208. if ($this.closest('.bootstrap-table')[0] !== _this2.$container[0]) {
  5209. return false;
  5210. }
  5211. }
  5212. if (_this2.options.sortable && $this.parent().data().sortable) {
  5213. _this2.onSort(e);
  5214. }
  5215. });
  5216. var resizeEvent = Utils.getEventName('resize.bootstrap-table', this.$el.attr('id'));
  5217. $$q(window).off(resizeEvent);
  5218. if (!this.options.showHeader || this.options.cardView) {
  5219. this.$header.hide();
  5220. this.$tableHeader.hide();
  5221. this.$tableLoading.css('top', 0);
  5222. } else {
  5223. this.$header.show();
  5224. this.$tableHeader.show();
  5225. this.$tableLoading.css('top', this.$header.outerHeight() + 1);
  5226. // Assign the correct sortable arrow
  5227. this.getCaret();
  5228. $$q(window).on(resizeEvent, function () {
  5229. return _this2.resetView();
  5230. });
  5231. }
  5232. this.$selectAll = this.$header.find('[name="btSelectAll"]');
  5233. this.$selectAll.off('click').on('click', function (e) {
  5234. e.stopPropagation();
  5235. var checked = $$q(e.currentTarget).prop('checked');
  5236. _this2[checked ? 'checkAll' : 'uncheckAll']();
  5237. _this2.updateSelected();
  5238. });
  5239. }
  5240. }, {
  5241. key: "initData",
  5242. value: function initData(data, type) {
  5243. if (type === 'append') {
  5244. this.options.data = this.options.data.concat(data);
  5245. } else if (type === 'prepend') {
  5246. this.options.data = [].concat(data).concat(this.options.data);
  5247. } else {
  5248. data = data || Utils.deepCopy(this.options.data);
  5249. this.options.data = Array.isArray(data) ? data : data[this.options.dataField];
  5250. }
  5251. this.data = _toConsumableArray(this.options.data);
  5252. if (this.options.sortReset) {
  5253. this.unsortedData = _toConsumableArray(this.data);
  5254. }
  5255. if (this.options.sidePagination === 'server') {
  5256. return;
  5257. }
  5258. this.initSort();
  5259. }
  5260. }, {
  5261. key: "initSort",
  5262. value: function initSort() {
  5263. var _this3 = this;
  5264. var name = this.options.sortName;
  5265. var order = this.options.sortOrder === 'desc' ? -1 : 1;
  5266. var index = this.header.fields.indexOf(this.options.sortName);
  5267. var timeoutId = 0;
  5268. if (index !== -1) {
  5269. if (this.options.sortStable) {
  5270. this.data.forEach(function (row, i) {
  5271. if (!row.hasOwnProperty('_position')) {
  5272. row._position = i;
  5273. }
  5274. });
  5275. }
  5276. if (this.options.customSort) {
  5277. Utils.calculateObjectValue(this.options, this.options.customSort, [this.options.sortName, this.options.sortOrder, this.data]);
  5278. } else {
  5279. this.data.sort(function (a, b) {
  5280. if (_this3.header.sortNames[index]) {
  5281. name = _this3.header.sortNames[index];
  5282. }
  5283. var aa = Utils.getItemField(a, name, _this3.options.escape);
  5284. var bb = Utils.getItemField(b, name, _this3.options.escape);
  5285. var value = Utils.calculateObjectValue(_this3.header, _this3.header.sorters[index], [aa, bb, a, b]);
  5286. if (value !== undefined) {
  5287. if (_this3.options.sortStable && value === 0) {
  5288. return order * (a._position - b._position);
  5289. }
  5290. return order * value;
  5291. }
  5292. return Utils.sort(aa, bb, order, _this3.options, a._position, b._position);
  5293. });
  5294. }
  5295. if (this.options.sortClass !== undefined) {
  5296. clearTimeout(timeoutId);
  5297. timeoutId = setTimeout(function () {
  5298. _this3.$el.removeClass(_this3.options.sortClass);
  5299. var index = _this3.$header.find("[data-field=\"".concat(_this3.options.sortName, "\"]")).index();
  5300. _this3.$el.find("tr td:nth-child(".concat(index + 1, ")")).addClass(_this3.options.sortClass);
  5301. }, 250);
  5302. }
  5303. } else if (this.options.sortReset) {
  5304. this.data = _toConsumableArray(this.unsortedData);
  5305. }
  5306. }
  5307. }, {
  5308. key: "sortBy",
  5309. value: function sortBy(params) {
  5310. this.options.sortName = params.field;
  5311. this.options.sortOrder = params.hasOwnProperty('sortOrder') ? params.sortOrder : 'asc';
  5312. this._sort();
  5313. }
  5314. }, {
  5315. key: "onSort",
  5316. value: function onSort(_ref) {
  5317. var type = _ref.type,
  5318. currentTarget = _ref.currentTarget;
  5319. var $this = type === 'keypress' ? $$q(currentTarget) : $$q(currentTarget).parent();
  5320. var $this_ = this.$header.find('th').eq($this.index());
  5321. this.$header.add(this.$header_).find('span.order').remove();
  5322. if (this.options.sortName === $this.data('field')) {
  5323. var currentSortOrder = this.options.sortOrder;
  5324. var initialSortOrder = this.columns[this.fieldsColumnsIndex[$this.data('field')]].sortOrder || this.columns[this.fieldsColumnsIndex[$this.data('field')]].order;
  5325. if (currentSortOrder === undefined) {
  5326. this.options.sortOrder = 'asc';
  5327. } else if (currentSortOrder === 'asc') {
  5328. this.options.sortOrder = this.options.sortReset ? initialSortOrder === 'asc' ? 'desc' : undefined : 'desc';
  5329. } else if (this.options.sortOrder === 'desc') {
  5330. this.options.sortOrder = this.options.sortReset ? initialSortOrder === 'desc' ? 'asc' : undefined : 'asc';
  5331. }
  5332. if (this.options.sortOrder === undefined) {
  5333. this.options.sortName = undefined;
  5334. }
  5335. } else {
  5336. this.options.sortName = $this.data('field');
  5337. if (this.options.rememberOrder) {
  5338. this.options.sortOrder = $this.data('order') === 'asc' ? 'desc' : 'asc';
  5339. } else {
  5340. this.options.sortOrder = this.columns[this.fieldsColumnsIndex[$this.data('field')]].sortOrder || this.columns[this.fieldsColumnsIndex[$this.data('field')]].order;
  5341. }
  5342. }
  5343. $this.add($this_).data('order', this.options.sortOrder);
  5344. // Assign the correct sortable arrow
  5345. this.getCaret();
  5346. this._sort();
  5347. }
  5348. }, {
  5349. key: "_sort",
  5350. value: function _sort() {
  5351. if (this.options.sidePagination === 'server' && this.options.serverSort) {
  5352. this.options.pageNumber = 1;
  5353. this.trigger('sort', this.options.sortName, this.options.sortOrder);
  5354. this.initServer(this.options.silentSort);
  5355. return;
  5356. }
  5357. if (this.options.pagination && this.options.sortResetPage) {
  5358. this.options.pageNumber = 1;
  5359. this.initPagination();
  5360. }
  5361. this.trigger('sort', this.options.sortName, this.options.sortOrder);
  5362. this.initSort();
  5363. this.initBody();
  5364. }
  5365. }, {
  5366. key: "initToolbar",
  5367. value: function initToolbar() {
  5368. var _this4 = this;
  5369. var opts = this.options;
  5370. var html = [];
  5371. var timeoutId = 0;
  5372. var $keepOpen;
  5373. var switchableCount = 0;
  5374. if (this.$toolbar.find('.bs-bars').children().length) {
  5375. $$q('body').append($$q(opts.toolbar));
  5376. }
  5377. this.$toolbar.html('');
  5378. if (typeof opts.toolbar === 'string' || _typeof(opts.toolbar) === 'object') {
  5379. $$q(Utils.sprintf('<div class="bs-bars %s-%s"></div>', this.constants.classes.pull, opts.toolbarAlign)).appendTo(this.$toolbar).append($$q(opts.toolbar));
  5380. }
  5381. // showColumns, showToggle, showRefresh
  5382. html = ["<div class=\"".concat(['columns', "columns-".concat(opts.buttonsAlign), this.constants.classes.buttonsGroup, "".concat(this.constants.classes.pull, "-").concat(opts.buttonsAlign)].join(' '), "\">")];
  5383. if (typeof opts.buttonsOrder === 'string') {
  5384. opts.buttonsOrder = opts.buttonsOrder.replace(/\[|\]| |'/g, '').split(',');
  5385. }
  5386. this.buttons = Object.assign(this.buttons, {
  5387. paginationSwitch: {
  5388. text: opts.pagination ? opts.formatPaginationSwitchUp() : opts.formatPaginationSwitchDown(),
  5389. icon: opts.pagination ? opts.icons.paginationSwitchDown : opts.icons.paginationSwitchUp,
  5390. render: false,
  5391. event: this.togglePagination,
  5392. attributes: {
  5393. 'aria-label': opts.formatPaginationSwitch(),
  5394. title: opts.formatPaginationSwitch()
  5395. }
  5396. },
  5397. refresh: {
  5398. text: opts.formatRefresh(),
  5399. icon: opts.icons.refresh,
  5400. render: false,
  5401. event: this.refresh,
  5402. attributes: {
  5403. 'aria-label': opts.formatRefresh(),
  5404. title: opts.formatRefresh()
  5405. }
  5406. },
  5407. toggle: {
  5408. text: opts.formatToggleOn(),
  5409. icon: opts.icons.toggleOff,
  5410. render: false,
  5411. event: this.toggleView,
  5412. attributes: {
  5413. 'aria-label': opts.formatToggleOn(),
  5414. title: opts.formatToggleOn()
  5415. }
  5416. },
  5417. fullscreen: {
  5418. text: opts.formatFullscreen(),
  5419. icon: opts.icons.fullscreen,
  5420. render: false,
  5421. event: this.toggleFullscreen,
  5422. attributes: {
  5423. 'aria-label': opts.formatFullscreen(),
  5424. title: opts.formatFullscreen()
  5425. }
  5426. },
  5427. columns: {
  5428. render: false,
  5429. html: function html() {
  5430. var html = [];
  5431. html.push("<div class=\"keep-open ".concat(_this4.constants.classes.buttonsDropdown, "\">\n <button class=\"").concat(_this4.constants.buttonsClass, " dropdown-toggle\" type=\"button\" ").concat(_this4.constants.dataToggle, "=\"dropdown\"\n aria-label=\"").concat(opts.formatColumns(), "\" title=\"").concat(opts.formatColumns(), "\">\n ").concat(opts.showButtonIcons ? Utils.sprintf(_this4.constants.html.icon, opts.iconsPrefix, opts.icons.columns) : '', "\n ").concat(opts.showButtonText ? opts.formatColumns() : '', "\n ").concat(_this4.constants.html.dropdownCaret, "\n </button>\n ").concat(_this4.constants.html.toolbarDropdown[0]));
  5432. if (opts.showColumnsSearch) {
  5433. html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="text" class="%s" name="columnsSearch" placeholder="%s" autocomplete="off">', _this4.constants.classes.input, opts.formatSearch())));
  5434. html.push(_this4.constants.html.toolbarDropdownSeparator);
  5435. }
  5436. if (opts.showColumnsToggleAll) {
  5437. var allFieldsVisible = _this4.getVisibleColumns().length === _this4.columns.filter(function (column) {
  5438. return !_this4.isSelectionColumn(column);
  5439. }).length;
  5440. html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="checkbox" class="toggle-all" %s> <span>%s</span>', allFieldsVisible ? 'checked="checked"' : '', opts.formatColumnsToggleAll())));
  5441. html.push(_this4.constants.html.toolbarDropdownSeparator);
  5442. }
  5443. var visibleColumns = 0;
  5444. _this4.columns.forEach(function (column) {
  5445. if (column.visible) {
  5446. visibleColumns++;
  5447. }
  5448. });
  5449. _this4.columns.forEach(function (column, i) {
  5450. if (_this4.isSelectionColumn(column)) {
  5451. return;
  5452. }
  5453. if (opts.cardView && !column.cardVisible) {
  5454. return;
  5455. }
  5456. var checked = column.visible ? ' checked="checked"' : '';
  5457. var disabled = visibleColumns <= opts.minimumCountColumns && checked ? ' disabled="disabled"' : '';
  5458. if (column.switchable) {
  5459. html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="checkbox" data-field="%s" value="%s"%s%s> <span>%s</span>', column.field, i, checked, disabled, column.switchableLabel || column.title)));
  5460. switchableCount++;
  5461. }
  5462. });
  5463. html.push(_this4.constants.html.toolbarDropdown[1], '</div>');
  5464. return html.join('');
  5465. }
  5466. }
  5467. });
  5468. var buttonsHtml = {};
  5469. for (var _i4 = 0, _Object$entries4 = Object.entries(this.buttons); _i4 < _Object$entries4.length; _i4++) {
  5470. var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i4], 2),
  5471. buttonName = _Object$entries4$_i[0],
  5472. buttonConfig = _Object$entries4$_i[1];
  5473. var buttonHtml = void 0;
  5474. if (buttonConfig.hasOwnProperty('html')) {
  5475. if (typeof buttonConfig.html === 'function') {
  5476. buttonHtml = buttonConfig.html();
  5477. } else if (typeof buttonConfig.html === 'string') {
  5478. buttonHtml = buttonConfig.html;
  5479. }
  5480. } else {
  5481. var buttonClass = this.constants.buttonsClass;
  5482. if (buttonConfig.hasOwnProperty('attributes') && buttonConfig.attributes.class) {
  5483. buttonClass += " ".concat(buttonConfig.attributes.class);
  5484. }
  5485. buttonHtml = "<button class=\"".concat(buttonClass, "\" type=\"button\" name=\"").concat(buttonName, "\"");
  5486. if (buttonConfig.hasOwnProperty('attributes')) {
  5487. for (var _i5 = 0, _Object$entries5 = Object.entries(buttonConfig.attributes); _i5 < _Object$entries5.length; _i5++) {
  5488. var _Object$entries5$_i = _slicedToArray(_Object$entries5[_i5], 2),
  5489. attributeName = _Object$entries5$_i[0],
  5490. value = _Object$entries5$_i[1];
  5491. if (attributeName === 'class') {
  5492. continue;
  5493. }
  5494. buttonHtml += " ".concat(attributeName, "=\"").concat(value, "\"");
  5495. }
  5496. }
  5497. buttonHtml += '>';
  5498. if (opts.showButtonIcons && buttonConfig.hasOwnProperty('icon')) {
  5499. buttonHtml += "".concat(Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, buttonConfig.icon), " ");
  5500. }
  5501. if (opts.showButtonText && buttonConfig.hasOwnProperty('text')) {
  5502. buttonHtml += buttonConfig.text;
  5503. }
  5504. buttonHtml += '</button>';
  5505. }
  5506. buttonsHtml[buttonName] = buttonHtml;
  5507. var optionName = "show".concat(buttonName.charAt(0).toUpperCase()).concat(buttonName.substring(1));
  5508. var showOption = opts[optionName];
  5509. if ((!buttonConfig.hasOwnProperty('render') || buttonConfig.hasOwnProperty('render') && buttonConfig.render) && (showOption === undefined || showOption === true)) {
  5510. opts[optionName] = true;
  5511. }
  5512. if (!opts.buttonsOrder.includes(buttonName)) {
  5513. opts.buttonsOrder.push(buttonName);
  5514. }
  5515. }
  5516. // Adding the button html to the final toolbar html when the showOption is true
  5517. var _iterator = _createForOfIteratorHelper(opts.buttonsOrder),
  5518. _step;
  5519. try {
  5520. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  5521. var button = _step.value;
  5522. var _showOption = opts["show".concat(button.charAt(0).toUpperCase()).concat(button.substring(1))];
  5523. if (_showOption) {
  5524. html.push(buttonsHtml[button]);
  5525. }
  5526. }
  5527. } catch (err) {
  5528. _iterator.e(err);
  5529. } finally {
  5530. _iterator.f();
  5531. }
  5532. html.push('</div>');
  5533. // Fix #188: this.showToolbar is for extensions
  5534. if (this.showToolbar || html.length > 2) {
  5535. this.$toolbar.append(html.join(''));
  5536. }
  5537. var _loop = function _loop() {
  5538. var _Object$entries6$_i = _slicedToArray(_Object$entries6[_i6], 2),
  5539. buttonName = _Object$entries6$_i[0],
  5540. buttonConfig = _Object$entries6$_i[1];
  5541. if (buttonConfig.hasOwnProperty('event')) {
  5542. if (typeof buttonConfig.event === 'function' || typeof buttonConfig.event === 'string') {
  5543. var event = typeof buttonConfig.event === 'string' ? window[buttonConfig.event] : buttonConfig.event;
  5544. _this4.$toolbar.find("button[name=\"".concat(buttonName, "\"]")).off('click').on('click', function () {
  5545. return event.call(_this4);
  5546. });
  5547. return 1; // continue
  5548. }
  5549. var _loop2 = function _loop2() {
  5550. var _Object$entries7$_i = _slicedToArray(_Object$entries7[_i7], 2),
  5551. eventType = _Object$entries7$_i[0],
  5552. eventFunction = _Object$entries7$_i[1];
  5553. var event = typeof eventFunction === 'string' ? window[eventFunction] : eventFunction;
  5554. _this4.$toolbar.find("button[name=\"".concat(buttonName, "\"]")).off(eventType).on(eventType, function () {
  5555. return event.call(_this4);
  5556. });
  5557. };
  5558. for (var _i7 = 0, _Object$entries7 = Object.entries(buttonConfig.event); _i7 < _Object$entries7.length; _i7++) {
  5559. _loop2();
  5560. }
  5561. }
  5562. };
  5563. for (var _i6 = 0, _Object$entries6 = Object.entries(this.buttons); _i6 < _Object$entries6.length; _i6++) {
  5564. if (_loop()) continue;
  5565. }
  5566. if (opts.showColumns) {
  5567. $keepOpen = this.$toolbar.find('.keep-open');
  5568. var $checkboxes = $keepOpen.find('input[type="checkbox"]:not(".toggle-all")');
  5569. var $toggleAll = $keepOpen.find('input[type="checkbox"].toggle-all');
  5570. if (switchableCount <= opts.minimumCountColumns) {
  5571. $keepOpen.find('input').prop('disabled', true);
  5572. }
  5573. $keepOpen.find('li, label').off('click').on('click', function (e) {
  5574. e.stopImmediatePropagation();
  5575. });
  5576. $checkboxes.off('click').on('click', function (_ref2) {
  5577. var currentTarget = _ref2.currentTarget;
  5578. var $this = $$q(currentTarget);
  5579. _this4._toggleColumn($this.val(), $this.prop('checked'), false);
  5580. _this4.trigger('column-switch', $this.data('field'), $this.prop('checked'));
  5581. $toggleAll.prop('checked', $checkboxes.filter(':checked').length === _this4.columns.filter(function (column) {
  5582. return !_this4.isSelectionColumn(column);
  5583. }).length);
  5584. });
  5585. $toggleAll.off('click').on('click', function (_ref3) {
  5586. var currentTarget = _ref3.currentTarget;
  5587. _this4._toggleAllColumns($$q(currentTarget).prop('checked'));
  5588. _this4.trigger('column-switch-all', $$q(currentTarget).prop('checked'));
  5589. });
  5590. if (opts.showColumnsSearch) {
  5591. var $columnsSearch = $keepOpen.find('[name="columnsSearch"]');
  5592. var $listItems = $keepOpen.find('.dropdown-item-marker');
  5593. $columnsSearch.on('keyup paste change', function (_ref4) {
  5594. var currentTarget = _ref4.currentTarget;
  5595. var $this = $$q(currentTarget);
  5596. var searchValue = $this.val().toLowerCase();
  5597. $listItems.show();
  5598. $checkboxes.each(function (i, el) {
  5599. var $checkbox = $$q(el);
  5600. var $listItem = $checkbox.parents('.dropdown-item-marker');
  5601. var text = $listItem.text().toLowerCase();
  5602. if (!text.includes(searchValue)) {
  5603. $listItem.hide();
  5604. }
  5605. });
  5606. });
  5607. }
  5608. }
  5609. var handleInputEvent = function handleInputEvent($searchInput) {
  5610. var eventTriggers = $searchInput.is('select') ? 'change' : 'keyup drop blur mouseup';
  5611. $searchInput.off(eventTriggers).on(eventTriggers, function (event) {
  5612. if (opts.searchOnEnterKey && event.keyCode !== 13) {
  5613. return;
  5614. }
  5615. if ([37, 38, 39, 40].includes(event.keyCode)) {
  5616. return;
  5617. }
  5618. clearTimeout(timeoutId); // doesn't matter if it's 0
  5619. timeoutId = setTimeout(function () {
  5620. _this4.onSearch({
  5621. currentTarget: event.currentTarget
  5622. });
  5623. }, opts.searchTimeOut);
  5624. });
  5625. };
  5626. // Fix #4516: this.showSearchClearButton is for extensions
  5627. if ((opts.search || this.showSearchClearButton) && typeof opts.searchSelector !== 'string') {
  5628. html = [];
  5629. var showSearchButton = Utils.sprintf(this.constants.html.searchButton, this.constants.buttonsClass, opts.formatSearch(), opts.showButtonIcons ? Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, opts.icons.search) : '', opts.showButtonText ? opts.formatSearch() : '');
  5630. var showSearchClearButton = Utils.sprintf(this.constants.html.searchClearButton, this.constants.buttonsClass, opts.formatClearSearch(), opts.showButtonIcons ? Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, opts.icons.clearSearch) : '', opts.showButtonText ? opts.formatClearSearch() : '');
  5631. var searchInputHtml = "<input class=\"".concat(this.constants.classes.input, "\n ").concat(Utils.sprintf(' %s%s', this.constants.classes.inputPrefix, opts.iconSize), "\n search-input\" type=\"search\" aria-label=\"").concat(opts.formatSearch(), "\" placeholder=\"").concat(opts.formatSearch(), "\" autocomplete=\"off\">");
  5632. var searchInputFinalHtml = searchInputHtml;
  5633. if (opts.showSearchButton || opts.showSearchClearButton) {
  5634. var _buttonsHtml = (opts.showSearchButton ? showSearchButton : '') + (opts.showSearchClearButton ? showSearchClearButton : '');
  5635. searchInputFinalHtml = opts.search ? Utils.sprintf(this.constants.html.inputGroup, searchInputHtml, _buttonsHtml) : _buttonsHtml;
  5636. }
  5637. html.push(Utils.sprintf("\n <div class=\"".concat(this.constants.classes.pull, "-").concat(opts.searchAlign, " search ").concat(this.constants.classes.inputGroup, "\">\n %s\n </div>\n "), searchInputFinalHtml));
  5638. this.$toolbar.append(html.join(''));
  5639. var $searchInput = Utils.getSearchInput(this);
  5640. if (opts.showSearchButton) {
  5641. this.$toolbar.find('.search button[name=search]').off('click').on('click', function () {
  5642. clearTimeout(timeoutId); // doesn't matter if it's 0
  5643. timeoutId = setTimeout(function () {
  5644. _this4.onSearch({
  5645. currentTarget: $searchInput
  5646. });
  5647. }, opts.searchTimeOut);
  5648. });
  5649. if (opts.searchOnEnterKey) {
  5650. handleInputEvent($searchInput);
  5651. }
  5652. } else {
  5653. handleInputEvent($searchInput);
  5654. }
  5655. if (opts.showSearchClearButton) {
  5656. this.$toolbar.find('.search button[name=clearSearch]').click(function () {
  5657. _this4.resetSearch();
  5658. });
  5659. }
  5660. } else if (typeof opts.searchSelector === 'string') {
  5661. handleInputEvent(Utils.getSearchInput(this));
  5662. }
  5663. }
  5664. }, {
  5665. key: "onSearch",
  5666. value: function onSearch() {
  5667. var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  5668. currentTarget = _ref5.currentTarget,
  5669. firedByInitSearchText = _ref5.firedByInitSearchText;
  5670. var overwriteSearchText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  5671. if (currentTarget !== undefined && $$q(currentTarget).length && overwriteSearchText) {
  5672. var text = $$q(currentTarget).val().trim();
  5673. if (this.options.trimOnSearch && $$q(currentTarget).val() !== text) {
  5674. $$q(currentTarget).val(text);
  5675. }
  5676. if (this.searchText === text) {
  5677. return;
  5678. }
  5679. var $searchInput = Utils.getSearchInput(this);
  5680. var $currentTarget = currentTarget instanceof jQuery ? currentTarget : $$q(currentTarget);
  5681. if ($currentTarget.is($searchInput) || $currentTarget.hasClass('search-input')) {
  5682. this.searchText = text;
  5683. this.options.searchText = text;
  5684. }
  5685. }
  5686. if (!firedByInitSearchText) {
  5687. this.options.pageNumber = 1;
  5688. }
  5689. this.initSearch();
  5690. if (firedByInitSearchText) {
  5691. if (this.options.sidePagination === 'client') {
  5692. this.updatePagination();
  5693. }
  5694. } else {
  5695. this.updatePagination();
  5696. }
  5697. this.trigger('search', this.searchText);
  5698. }
  5699. }, {
  5700. key: "initSearch",
  5701. value: function initSearch() {
  5702. var _this5 = this;
  5703. this.filterOptions = this.filterOptions || this.options.filterOptions;
  5704. if (this.options.sidePagination !== 'server') {
  5705. if (this.options.customSearch) {
  5706. this.data = Utils.calculateObjectValue(this.options, this.options.customSearch, [this.options.data, this.searchText, this.filterColumns]);
  5707. if (this.options.sortReset) {
  5708. this.unsortedData = _toConsumableArray(this.data);
  5709. }
  5710. this.initSort();
  5711. return;
  5712. }
  5713. var rawSearchText = this.searchText && (this.fromHtml ? Utils.escapeHTML(this.searchText) : this.searchText);
  5714. var searchText = rawSearchText ? rawSearchText.toLowerCase() : '';
  5715. var f = Utils.isEmptyObject(this.filterColumns) ? null : this.filterColumns;
  5716. if (this.options.searchAccentNeutralise) {
  5717. searchText = Utils.normalizeAccent(searchText);
  5718. }
  5719. // Check filter
  5720. if (typeof this.filterOptions.filterAlgorithm === 'function') {
  5721. this.data = this.options.data.filter(function (item) {
  5722. return _this5.filterOptions.filterAlgorithm.apply(null, [item, f]);
  5723. });
  5724. } else if (typeof this.filterOptions.filterAlgorithm === 'string') {
  5725. this.data = f ? this.options.data.filter(function (item) {
  5726. var filterAlgorithm = _this5.filterOptions.filterAlgorithm;
  5727. if (filterAlgorithm === 'and') {
  5728. for (var key in f) {
  5729. if (Array.isArray(f[key]) && !f[key].includes(item[key]) || !Array.isArray(f[key]) && item[key] !== f[key]) {
  5730. return false;
  5731. }
  5732. }
  5733. } else if (filterAlgorithm === 'or') {
  5734. var match = false;
  5735. for (var _key in f) {
  5736. if (Array.isArray(f[_key]) && f[_key].includes(item[_key]) || !Array.isArray(f[_key]) && item[_key] === f[_key]) {
  5737. match = true;
  5738. }
  5739. }
  5740. return match;
  5741. }
  5742. return true;
  5743. }) : _toConsumableArray(this.options.data);
  5744. }
  5745. var visibleFields = this.getVisibleFields();
  5746. this.data = searchText ? this.data.filter(function (item, i) {
  5747. for (var j = 0; j < _this5.header.fields.length; j++) {
  5748. if (!_this5.header.searchables[j] || _this5.options.visibleSearch && visibleFields.indexOf(_this5.header.fields[j]) === -1) {
  5749. continue;
  5750. }
  5751. var key = Utils.isNumeric(_this5.header.fields[j]) ? parseInt(_this5.header.fields[j], 10) : _this5.header.fields[j];
  5752. var column = _this5.columns[_this5.fieldsColumnsIndex[key]];
  5753. var value = void 0;
  5754. if (typeof key === 'string' && !item.hasOwnProperty(key)) {
  5755. value = item;
  5756. var props = key.split('.');
  5757. for (var _i8 = 0; _i8 < props.length; _i8++) {
  5758. if (value[props[_i8]] !== null) {
  5759. value = value[props[_i8]];
  5760. } else {
  5761. value = null;
  5762. break;
  5763. }
  5764. }
  5765. } else {
  5766. value = item[key];
  5767. }
  5768. if (_this5.options.searchAccentNeutralise) {
  5769. value = Utils.normalizeAccent(value);
  5770. }
  5771. // Fix #142: respect searchFormatter boolean
  5772. if (column && column.searchFormatter) {
  5773. value = Utils.calculateObjectValue(column, _this5.header.formatters[j], [value, item, i, column.field], value);
  5774. }
  5775. if (typeof value === 'string' || typeof value === 'number') {
  5776. if (_this5.options.strictSearch && "".concat(value).toLowerCase() === searchText || _this5.options.regexSearch && Utils.regexCompare(value, rawSearchText)) {
  5777. return true;
  5778. }
  5779. var largerSmallerEqualsRegex = /(?:(<=|=>|=<|>=|>|<)(?:\s+)?(-?\d+)?|(-?\d+)?(\s+)?(<=|=>|=<|>=|>|<))/gm;
  5780. var matches = largerSmallerEqualsRegex.exec(_this5.searchText);
  5781. var comparisonCheck = false;
  5782. if (matches) {
  5783. var operator = matches[1] || "".concat(matches[5], "l");
  5784. var comparisonValue = matches[2] || matches[3];
  5785. var int = parseInt(value, 10);
  5786. var comparisonInt = parseInt(comparisonValue, 10);
  5787. switch (operator) {
  5788. case '>':
  5789. case '<l':
  5790. comparisonCheck = int > comparisonInt;
  5791. break;
  5792. case '<':
  5793. case '>l':
  5794. comparisonCheck = int < comparisonInt;
  5795. break;
  5796. case '<=':
  5797. case '=<':
  5798. case '>=l':
  5799. case '=>l':
  5800. comparisonCheck = int <= comparisonInt;
  5801. break;
  5802. case '>=':
  5803. case '=>':
  5804. case '<=l':
  5805. case '=<l':
  5806. comparisonCheck = int >= comparisonInt;
  5807. break;
  5808. }
  5809. }
  5810. if (comparisonCheck || "".concat(value).toLowerCase().includes(searchText)) {
  5811. return true;
  5812. }
  5813. }
  5814. }
  5815. return false;
  5816. }) : this.data;
  5817. if (this.options.sortReset) {
  5818. this.unsortedData = _toConsumableArray(this.data);
  5819. }
  5820. this.initSort();
  5821. }
  5822. }
  5823. }, {
  5824. key: "initPagination",
  5825. value: function initPagination() {
  5826. var _this6 = this;
  5827. var opts = this.options;
  5828. if (!opts.pagination) {
  5829. this.$pagination.hide();
  5830. return;
  5831. }
  5832. this.$pagination.show();
  5833. var html = [];
  5834. var allSelected = false;
  5835. var i;
  5836. var from;
  5837. var to;
  5838. var $pageList;
  5839. var $pre;
  5840. var $next;
  5841. var $number;
  5842. var data = this.getData({
  5843. includeHiddenRows: false
  5844. });
  5845. var pageList = opts.pageList;
  5846. if (typeof pageList === 'string') {
  5847. pageList = pageList.replace(/\[|\]| /g, '').toLowerCase().split(',');
  5848. }
  5849. pageList = pageList.map(function (value) {
  5850. if (typeof value === 'string') {
  5851. return value.toLowerCase() === opts.formatAllRows().toLowerCase() || ['all', 'unlimited'].includes(value.toLowerCase()) ? opts.formatAllRows() : +value;
  5852. }
  5853. return value;
  5854. });
  5855. this.paginationParts = opts.paginationParts;
  5856. if (typeof this.paginationParts === 'string') {
  5857. this.paginationParts = this.paginationParts.replace(/\[|\]| |'/g, '').split(',');
  5858. }
  5859. if (opts.sidePagination !== 'server') {
  5860. opts.totalRows = data.length;
  5861. }
  5862. this.totalPages = 0;
  5863. if (opts.totalRows) {
  5864. if (opts.pageSize === opts.formatAllRows()) {
  5865. opts.pageSize = opts.totalRows;
  5866. allSelected = true;
  5867. }
  5868. this.totalPages = ~~((opts.totalRows - 1) / opts.pageSize) + 1;
  5869. opts.totalPages = this.totalPages;
  5870. }
  5871. if (this.totalPages > 0 && opts.pageNumber > this.totalPages) {
  5872. opts.pageNumber = this.totalPages;
  5873. }
  5874. this.pageFrom = (opts.pageNumber - 1) * opts.pageSize + 1;
  5875. this.pageTo = opts.pageNumber * opts.pageSize;
  5876. if (this.pageTo > opts.totalRows) {
  5877. this.pageTo = opts.totalRows;
  5878. }
  5879. if (this.options.pagination && this.options.sidePagination !== 'server') {
  5880. this.options.totalNotFiltered = this.options.data.length;
  5881. }
  5882. if (!this.options.showExtendedPagination) {
  5883. this.options.totalNotFiltered = undefined;
  5884. }
  5885. if (this.paginationParts.includes('pageInfo') || this.paginationParts.includes('pageInfoShort') || this.paginationParts.includes('pageSize')) {
  5886. html.push("<div class=\"".concat(this.constants.classes.pull, "-").concat(opts.paginationDetailHAlign, " pagination-detail\">"));
  5887. }
  5888. if (this.paginationParts.includes('pageInfo') || this.paginationParts.includes('pageInfoShort')) {
  5889. var totalRows = this.options.totalRows + (this.options.sidePagination === 'client' && this.options.paginationLoadMore && !this._paginationLoaded ? ' +' : '');
  5890. var paginationInfo = this.paginationParts.includes('pageInfoShort') ? opts.formatDetailPagination(totalRows) : opts.formatShowingRows(this.pageFrom, this.pageTo, totalRows, opts.totalNotFiltered);
  5891. html.push("<span class=\"pagination-info\">\n ".concat(paginationInfo, "\n </span>"));
  5892. }
  5893. if (this.paginationParts.includes('pageSize')) {
  5894. html.push('<div class="page-list">');
  5895. var pageNumber = ["<div class=\"".concat(this.constants.classes.paginationDropdown, "\">\n <button class=\"").concat(this.constants.buttonsClass, " dropdown-toggle\" type=\"button\" ").concat(this.constants.dataToggle, "=\"dropdown\">\n <span class=\"page-size\">\n ").concat(allSelected ? opts.formatAllRows() : opts.pageSize, "\n </span>\n ").concat(this.constants.html.dropdownCaret, "\n </button>\n ").concat(this.constants.html.pageDropdown[0])];
  5896. pageList.forEach(function (page, i) {
  5897. if (!opts.smartDisplay || i === 0 || pageList[i - 1] < opts.totalRows || page === opts.formatAllRows()) {
  5898. var active;
  5899. if (allSelected) {
  5900. active = page === opts.formatAllRows() ? _this6.constants.classes.dropdownActive : '';
  5901. } else {
  5902. active = page === opts.pageSize ? _this6.constants.classes.dropdownActive : '';
  5903. }
  5904. pageNumber.push(Utils.sprintf(_this6.constants.html.pageDropdownItem, active, page));
  5905. }
  5906. });
  5907. pageNumber.push("".concat(this.constants.html.pageDropdown[1], "</div>"));
  5908. html.push(opts.formatRecordsPerPage(pageNumber.join('')));
  5909. }
  5910. if (this.paginationParts.includes('pageInfo') || this.paginationParts.includes('pageInfoShort') || this.paginationParts.includes('pageSize')) {
  5911. html.push('</div></div>');
  5912. }
  5913. if (this.paginationParts.includes('pageList')) {
  5914. html.push("<div class=\"".concat(this.constants.classes.pull, "-").concat(opts.paginationHAlign, " pagination\">"), Utils.sprintf(this.constants.html.pagination[0], Utils.sprintf(' pagination-%s', opts.iconSize)), Utils.sprintf(this.constants.html.paginationItem, ' page-pre', opts.formatSRPaginationPreText(), opts.paginationPreText));
  5915. if (this.totalPages < opts.paginationSuccessivelySize) {
  5916. from = 1;
  5917. to = this.totalPages;
  5918. } else {
  5919. from = opts.pageNumber - opts.paginationPagesBySide;
  5920. to = from + opts.paginationPagesBySide * 2;
  5921. }
  5922. if (opts.pageNumber < opts.paginationSuccessivelySize - 1) {
  5923. to = opts.paginationSuccessivelySize;
  5924. }
  5925. if (opts.paginationSuccessivelySize > this.totalPages - from) {
  5926. from = from - (opts.paginationSuccessivelySize - (this.totalPages - from)) + 1;
  5927. }
  5928. if (from < 1) {
  5929. from = 1;
  5930. }
  5931. if (to > this.totalPages) {
  5932. to = this.totalPages;
  5933. }
  5934. var middleSize = Math.round(opts.paginationPagesBySide / 2);
  5935. var pageItem = function pageItem(i) {
  5936. var classes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  5937. return Utils.sprintf(_this6.constants.html.paginationItem, classes + (i === opts.pageNumber ? " ".concat(_this6.constants.classes.paginationActive) : ''), opts.formatSRPaginationPageText(i), i);
  5938. };
  5939. if (from > 1) {
  5940. var max = opts.paginationPagesBySide;
  5941. if (max >= from) max = from - 1;
  5942. for (i = 1; i <= max; i++) {
  5943. html.push(pageItem(i));
  5944. }
  5945. if (from - 1 === max + 1) {
  5946. i = from - 1;
  5947. html.push(pageItem(i));
  5948. } else if (from - 1 > max) {
  5949. if (from - opts.paginationPagesBySide * 2 > opts.paginationPagesBySide && opts.paginationUseIntermediate) {
  5950. i = Math.round((from - middleSize) / 2 + middleSize);
  5951. html.push(pageItem(i, ' page-intermediate'));
  5952. } else {
  5953. html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-first-separator disabled', '', '...'));
  5954. }
  5955. }
  5956. }
  5957. for (i = from; i <= to; i++) {
  5958. html.push(pageItem(i));
  5959. }
  5960. if (this.totalPages > to) {
  5961. var min = this.totalPages - (opts.paginationPagesBySide - 1);
  5962. if (to >= min) min = to + 1;
  5963. if (to + 1 === min - 1) {
  5964. i = to + 1;
  5965. html.push(pageItem(i));
  5966. } else if (min > to + 1) {
  5967. if (this.totalPages - to > opts.paginationPagesBySide * 2 && opts.paginationUseIntermediate) {
  5968. i = Math.round((this.totalPages - middleSize - to) / 2 + to);
  5969. html.push(pageItem(i, ' page-intermediate'));
  5970. } else {
  5971. html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-last-separator disabled', '', '...'));
  5972. }
  5973. }
  5974. for (i = min; i <= this.totalPages; i++) {
  5975. html.push(pageItem(i));
  5976. }
  5977. }
  5978. html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-next', opts.formatSRPaginationNextText(), opts.paginationNextText));
  5979. html.push(this.constants.html.pagination[1], '</div>');
  5980. }
  5981. this.$pagination.html(html.join(''));
  5982. var dropupClass = ['bottom', 'both'].includes(opts.paginationVAlign) ? " ".concat(this.constants.classes.dropup) : '';
  5983. this.$pagination.last().find('.page-list > div').addClass(dropupClass);
  5984. if (!opts.onlyInfoPagination) {
  5985. $pageList = this.$pagination.find('.page-list a');
  5986. $pre = this.$pagination.find('.page-pre');
  5987. $next = this.$pagination.find('.page-next');
  5988. $number = this.$pagination.find('.page-item').not('.page-next, .page-pre, .page-last-separator, .page-first-separator');
  5989. if (this.totalPages <= 1) {
  5990. this.$pagination.find('div.pagination').hide();
  5991. }
  5992. if (opts.smartDisplay) {
  5993. if (pageList.length < 2 || opts.totalRows <= pageList[0]) {
  5994. this.$pagination.find('div.page-list').hide();
  5995. }
  5996. }
  5997. // when data is empty, hide the pagination
  5998. this.$pagination[this.getData().length ? 'show' : 'hide']();
  5999. if (!opts.paginationLoop) {
  6000. if (opts.pageNumber === 1) {
  6001. $pre.addClass('disabled');
  6002. }
  6003. if (opts.pageNumber === this.totalPages) {
  6004. $next.addClass('disabled');
  6005. }
  6006. }
  6007. if (allSelected) {
  6008. opts.pageSize = opts.formatAllRows();
  6009. }
  6010. $pageList.off('click').on('click', function (e) {
  6011. return _this6.onPageListChange(e);
  6012. });
  6013. $pre.off('click').on('click', function (e) {
  6014. return _this6.onPagePre(e);
  6015. });
  6016. $next.off('click').on('click', function (e) {
  6017. return _this6.onPageNext(e);
  6018. });
  6019. $number.off('click').on('click', function (e) {
  6020. return _this6.onPageNumber(e);
  6021. });
  6022. }
  6023. }
  6024. }, {
  6025. key: "updatePagination",
  6026. value: function updatePagination(event) {
  6027. // Fix #171: IE disabled button can be clicked bug.
  6028. if (event && $$q(event.currentTarget).hasClass('disabled')) {
  6029. return;
  6030. }
  6031. if (!this.options.maintainMetaData) {
  6032. this.resetRows();
  6033. }
  6034. this.initPagination();
  6035. this.trigger('page-change', this.options.pageNumber, this.options.pageSize);
  6036. if (this.options.sidePagination === 'server' || this.options.sidePagination === 'client' && this.options.paginationLoadMore && !this._paginationLoaded && this.options.pageNumber === this.totalPages) {
  6037. this.initServer();
  6038. } else {
  6039. this.initBody();
  6040. }
  6041. }
  6042. }, {
  6043. key: "onPageListChange",
  6044. value: function onPageListChange(event) {
  6045. event.preventDefault();
  6046. var $this = $$q(event.currentTarget);
  6047. $this.parent().addClass(this.constants.classes.dropdownActive).siblings().removeClass(this.constants.classes.dropdownActive);
  6048. this.options.pageSize = $this.text().toUpperCase() === this.options.formatAllRows().toUpperCase() ? this.options.formatAllRows() : +$this.text();
  6049. this.$toolbar.find('.page-size').text(this.options.pageSize);
  6050. this.updatePagination(event);
  6051. return false;
  6052. }
  6053. }, {
  6054. key: "onPagePre",
  6055. value: function onPagePre(event) {
  6056. if ($$q(event.target).hasClass('disabled')) {
  6057. return;
  6058. }
  6059. event.preventDefault();
  6060. if (this.options.pageNumber - 1 === 0) {
  6061. this.options.pageNumber = this.options.totalPages;
  6062. } else {
  6063. this.options.pageNumber--;
  6064. }
  6065. this.updatePagination(event);
  6066. return false;
  6067. }
  6068. }, {
  6069. key: "onPageNext",
  6070. value: function onPageNext(event) {
  6071. if ($$q(event.target).hasClass('disabled')) {
  6072. return;
  6073. }
  6074. event.preventDefault();
  6075. if (this.options.pageNumber + 1 > this.options.totalPages) {
  6076. this.options.pageNumber = 1;
  6077. } else {
  6078. this.options.pageNumber++;
  6079. }
  6080. this.updatePagination(event);
  6081. return false;
  6082. }
  6083. }, {
  6084. key: "onPageNumber",
  6085. value: function onPageNumber(event) {
  6086. event.preventDefault();
  6087. if (this.options.pageNumber === +$$q(event.currentTarget).text()) {
  6088. return;
  6089. }
  6090. this.options.pageNumber = +$$q(event.currentTarget).text();
  6091. this.updatePagination(event);
  6092. return false;
  6093. }
  6094. // eslint-disable-next-line no-unused-vars
  6095. }, {
  6096. key: "initRow",
  6097. value: function initRow(item, i, data, trFragments) {
  6098. var _this7 = this;
  6099. var html = [];
  6100. var style = {};
  6101. var csses = [];
  6102. var data_ = '';
  6103. var attributes = {};
  6104. var htmlAttributes = [];
  6105. if (Utils.findIndex(this.hiddenRows, item) > -1) {
  6106. return;
  6107. }
  6108. style = Utils.calculateObjectValue(this.options, this.options.rowStyle, [item, i], style);
  6109. if (style && style.css) {
  6110. for (var _i9 = 0, _Object$entries8 = Object.entries(style.css); _i9 < _Object$entries8.length; _i9++) {
  6111. var _Object$entries8$_i = _slicedToArray(_Object$entries8[_i9], 2),
  6112. key = _Object$entries8$_i[0],
  6113. value = _Object$entries8$_i[1];
  6114. csses.push("".concat(key, ": ").concat(value));
  6115. }
  6116. }
  6117. attributes = Utils.calculateObjectValue(this.options, this.options.rowAttributes, [item, i], attributes);
  6118. if (attributes) {
  6119. for (var _i10 = 0, _Object$entries9 = Object.entries(attributes); _i10 < _Object$entries9.length; _i10++) {
  6120. var _Object$entries9$_i = _slicedToArray(_Object$entries9[_i10], 2),
  6121. _key2 = _Object$entries9$_i[0],
  6122. _value = _Object$entries9$_i[1];
  6123. htmlAttributes.push("".concat(_key2, "=\"").concat(Utils.escapeHTML(_value), "\""));
  6124. }
  6125. }
  6126. if (item._data && !Utils.isEmptyObject(item._data)) {
  6127. for (var _i11 = 0, _Object$entries10 = Object.entries(item._data); _i11 < _Object$entries10.length; _i11++) {
  6128. var _Object$entries10$_i = _slicedToArray(_Object$entries10[_i11], 2),
  6129. k = _Object$entries10$_i[0],
  6130. v = _Object$entries10$_i[1];
  6131. // ignore data-index
  6132. if (k === 'index') {
  6133. return;
  6134. }
  6135. data_ += " data-".concat(k, "='").concat(_typeof(v) === 'object' ? JSON.stringify(v) : v, "'");
  6136. }
  6137. }
  6138. html.push('<tr', Utils.sprintf(' %s', htmlAttributes.length ? htmlAttributes.join(' ') : undefined), Utils.sprintf(' id="%s"', Array.isArray(item) ? undefined : item._id), Utils.sprintf(' class="%s"', style.classes || (Array.isArray(item) ? undefined : item._class)), Utils.sprintf(' style="%s"', Array.isArray(item) ? undefined : item._style), " data-index=\"".concat(i, "\""), Utils.sprintf(' data-uniqueid="%s"', Utils.getItemField(item, this.options.uniqueId, false)), Utils.sprintf(' data-has-detail-view="%s"', this.options.detailView && Utils.calculateObjectValue(null, this.options.detailFilter, [i, item]) ? 'true' : undefined), Utils.sprintf('%s', data_), '>');
  6139. if (this.options.cardView) {
  6140. html.push("<td colspan=\"".concat(this.header.fields.length, "\"><div class=\"card-views\">"));
  6141. }
  6142. var detailViewTemplate = '';
  6143. if (Utils.hasDetailViewIcon(this.options)) {
  6144. detailViewTemplate = '<td>';
  6145. if (Utils.calculateObjectValue(null, this.options.detailFilter, [i, item])) {
  6146. detailViewTemplate += "\n <a class=\"detail-icon\" href=\"#\">\n ".concat(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.detailOpen), "\n </a>\n ");
  6147. }
  6148. detailViewTemplate += '</td>';
  6149. }
  6150. if (detailViewTemplate && this.options.detailViewAlign !== 'right') {
  6151. html.push(detailViewTemplate);
  6152. }
  6153. this.header.fields.forEach(function (field, j) {
  6154. var column = _this7.columns[j];
  6155. var text = '';
  6156. var value_ = Utils.getItemField(item, field, _this7.options.escape, column.escape);
  6157. var value = '';
  6158. var type = '';
  6159. var cellStyle = {};
  6160. var id_ = '';
  6161. var class_ = _this7.header.classes[j];
  6162. var style_ = '';
  6163. var styleToAdd_ = '';
  6164. var data_ = '';
  6165. var rowspan_ = '';
  6166. var colspan_ = '';
  6167. var title_ = '';
  6168. if ((_this7.fromHtml || _this7.autoMergeCells) && typeof value_ === 'undefined') {
  6169. if (!column.checkbox && !column.radio) {
  6170. return;
  6171. }
  6172. }
  6173. if (!column.visible) {
  6174. return;
  6175. }
  6176. if (_this7.options.cardView && !column.cardVisible) {
  6177. return;
  6178. }
  6179. // Style concat
  6180. if (csses.concat([_this7.header.styles[j]]).length) {
  6181. styleToAdd_ += "".concat(csses.concat([_this7.header.styles[j]]).join('; '));
  6182. }
  6183. if (item["_".concat(field, "_style")]) {
  6184. styleToAdd_ += "".concat(item["_".concat(field, "_style")]);
  6185. }
  6186. if (styleToAdd_) {
  6187. style_ = " style=\"".concat(styleToAdd_, "\"");
  6188. }
  6189. // Style concat
  6190. // handle id and class of td
  6191. if (item["_".concat(field, "_id")]) {
  6192. id_ = Utils.sprintf(' id="%s"', item["_".concat(field, "_id")]);
  6193. }
  6194. if (item["_".concat(field, "_class")]) {
  6195. class_ = Utils.sprintf(' class="%s"', item["_".concat(field, "_class")]);
  6196. }
  6197. if (item["_".concat(field, "_rowspan")]) {
  6198. rowspan_ = Utils.sprintf(' rowspan="%s"', item["_".concat(field, "_rowspan")]);
  6199. }
  6200. if (item["_".concat(field, "_colspan")]) {
  6201. colspan_ = Utils.sprintf(' colspan="%s"', item["_".concat(field, "_colspan")]);
  6202. }
  6203. if (item["_".concat(field, "_title")]) {
  6204. title_ = Utils.sprintf(' title="%s"', item["_".concat(field, "_title")]);
  6205. }
  6206. cellStyle = Utils.calculateObjectValue(_this7.header, _this7.header.cellStyles[j], [value_, item, i, field], cellStyle);
  6207. if (cellStyle.classes) {
  6208. class_ = " class=\"".concat(cellStyle.classes, "\"");
  6209. }
  6210. if (cellStyle.css) {
  6211. var csses_ = [];
  6212. for (var _i12 = 0, _Object$entries11 = Object.entries(cellStyle.css); _i12 < _Object$entries11.length; _i12++) {
  6213. var _Object$entries11$_i = _slicedToArray(_Object$entries11[_i12], 2),
  6214. _key3 = _Object$entries11$_i[0],
  6215. _value2 = _Object$entries11$_i[1];
  6216. csses_.push("".concat(_key3, ": ").concat(_value2));
  6217. }
  6218. style_ = " style=\"".concat(csses_.concat(_this7.header.styles[j]).join('; '), "\"");
  6219. }
  6220. value = Utils.calculateObjectValue(column, _this7.header.formatters[j], [value_, item, i, field], value_);
  6221. if (!(column.checkbox || column.radio)) {
  6222. value = typeof value === 'undefined' || value === null ? _this7.options.undefinedText : value;
  6223. }
  6224. if (column.searchable && _this7.searchText && _this7.options.searchHighlight && !(column.checkbox || column.radio)) {
  6225. var defValue = '';
  6226. var searchText = _this7.searchText.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
  6227. if (_this7.options.searchAccentNeutralise) {
  6228. var indexRegex = new RegExp("".concat(Utils.normalizeAccent(searchText)), 'gmi');
  6229. var match = indexRegex.exec(Utils.normalizeAccent(value));
  6230. if (match) {
  6231. searchText = value.substring(match.index, match.index + searchText.length);
  6232. }
  6233. }
  6234. var regExp = new RegExp("(".concat(searchText, ")"), 'gim');
  6235. var marker = '<mark>$1</mark>';
  6236. var isHTML = value && /<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i.test(value);
  6237. if (isHTML) {
  6238. // value can contains a HTML tags
  6239. var textContent = new DOMParser().parseFromString(value.toString(), 'text/html').documentElement.textContent;
  6240. var textReplaced = textContent.replace(regExp, marker);
  6241. textContent = textContent.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
  6242. defValue = value.replace(new RegExp("(>\\s*)(".concat(textContent, ")(\\s*)"), 'gm'), "$1".concat(textReplaced, "$3"));
  6243. } else {
  6244. // but usually not
  6245. defValue = value.toString().replace(regExp, marker);
  6246. }
  6247. value = Utils.calculateObjectValue(column, column.searchHighlightFormatter, [value, _this7.searchText], defValue);
  6248. }
  6249. if (item["_".concat(field, "_data")] && !Utils.isEmptyObject(item["_".concat(field, "_data")])) {
  6250. for (var _i13 = 0, _Object$entries12 = Object.entries(item["_".concat(field, "_data")]); _i13 < _Object$entries12.length; _i13++) {
  6251. var _Object$entries12$_i = _slicedToArray(_Object$entries12[_i13], 2),
  6252. _k = _Object$entries12$_i[0],
  6253. _v = _Object$entries12$_i[1];
  6254. // ignore data-index
  6255. if (_k === 'index') {
  6256. return;
  6257. }
  6258. data_ += " data-".concat(_k, "=\"").concat(_v, "\"");
  6259. }
  6260. }
  6261. if (column.checkbox || column.radio) {
  6262. type = column.checkbox ? 'checkbox' : type;
  6263. type = column.radio ? 'radio' : type;
  6264. var c = column['class'] || '';
  6265. var isChecked = Utils.isObject(value) && value.hasOwnProperty('checked') ? value.checked : (value === true || value_) && value !== false;
  6266. var isDisabled = !column.checkboxEnabled || value && value.disabled;
  6267. text = [_this7.options.cardView ? "<div class=\"card-view ".concat(c, "\">") : "<td class=\"bs-checkbox ".concat(c, "\"").concat(class_).concat(style_, ">"), "<label>\n <input\n data-index=\"".concat(i, "\"\n name=\"").concat(_this7.options.selectItemName, "\"\n type=\"").concat(type, "\"\n ").concat(Utils.sprintf('value="%s"', item[_this7.options.idField]), "\n ").concat(Utils.sprintf('checked="%s"', isChecked ? 'checked' : undefined), "\n ").concat(Utils.sprintf('disabled="%s"', isDisabled ? 'disabled' : undefined), " />\n <span></span>\n </label>"), _this7.header.formatters[j] && typeof value === 'string' ? value : '', _this7.options.cardView ? '</div>' : '</td>'].join('');
  6268. item[_this7.header.stateField] = value === true || !!value_ || value && value.checked;
  6269. } else if (_this7.options.cardView) {
  6270. var cardTitle = _this7.options.showHeader ? "<span class=\"card-view-title ".concat(cellStyle.classes || '', "\"").concat(style_, ">").concat(Utils.getFieldTitle(_this7.columns, field), "</span>") : '';
  6271. text = "<div class=\"card-view\">".concat(cardTitle, "<span class=\"card-view-value ").concat(cellStyle.classes || '', "\"").concat(style_, ">").concat(value, "</span></div>");
  6272. if (_this7.options.smartDisplay && value === '') {
  6273. text = '<div class="card-view"></div>';
  6274. }
  6275. } else {
  6276. text = "<td".concat(id_).concat(class_).concat(style_).concat(data_).concat(rowspan_).concat(colspan_).concat(title_, ">").concat(value, "</td>");
  6277. }
  6278. html.push(text);
  6279. });
  6280. if (detailViewTemplate && this.options.detailViewAlign === 'right') {
  6281. html.push(detailViewTemplate);
  6282. }
  6283. if (this.options.cardView) {
  6284. html.push('</div></td>');
  6285. }
  6286. html.push('</tr>');
  6287. return html.join('');
  6288. }
  6289. }, {
  6290. key: "initBody",
  6291. value: function initBody(fixedScroll, updatedUid) {
  6292. var _this8 = this;
  6293. var data = this.getData();
  6294. this.trigger('pre-body', data);
  6295. this.$body = this.$el.find('>tbody');
  6296. if (!this.$body.length) {
  6297. this.$body = $$q('<tbody></tbody>').appendTo(this.$el);
  6298. }
  6299. // Fix #389 Bootstrap-table-flatJSON is not working
  6300. if (!this.options.pagination || this.options.sidePagination === 'server') {
  6301. this.pageFrom = 1;
  6302. this.pageTo = data.length;
  6303. }
  6304. var rows = [];
  6305. var trFragments = $$q(document.createDocumentFragment());
  6306. var hasTr = false;
  6307. var toExpand = [];
  6308. this.autoMergeCells = Utils.checkAutoMergeCells(data.slice(this.pageFrom - 1, this.pageTo));
  6309. for (var i = this.pageFrom - 1; i < this.pageTo; i++) {
  6310. var item = data[i];
  6311. var tr = this.initRow(item, i, data, trFragments);
  6312. hasTr = hasTr || !!tr;
  6313. if (tr && typeof tr === 'string') {
  6314. var uniqueId = this.options.uniqueId;
  6315. if (uniqueId && item.hasOwnProperty(uniqueId)) {
  6316. var itemUniqueId = item[uniqueId];
  6317. var oldTr = this.$body.find(Utils.sprintf('> tr[data-uniqueid="%s"][data-has-detail-view]', itemUniqueId));
  6318. var oldTrNext = oldTr.next();
  6319. if (oldTrNext.is('tr.detail-view')) {
  6320. toExpand.push(i);
  6321. if (!updatedUid || itemUniqueId !== updatedUid) {
  6322. tr += oldTrNext[0].outerHTML;
  6323. }
  6324. }
  6325. }
  6326. if (!this.options.virtualScroll) {
  6327. trFragments.append(tr);
  6328. } else {
  6329. rows.push(tr);
  6330. }
  6331. }
  6332. }
  6333. // show no records
  6334. if (!hasTr) {
  6335. this.$body.html("<tr class=\"no-records-found\">".concat(Utils.sprintf('<td colspan="%s">%s</td>', this.getVisibleFields().length + Utils.getDetailViewIndexOffset(this.options), this.options.formatNoMatches()), "</tr>"));
  6336. } else if (!this.options.virtualScroll) {
  6337. this.$body.html(trFragments);
  6338. } else {
  6339. if (this.virtualScroll) {
  6340. this.virtualScroll.destroy();
  6341. }
  6342. this.virtualScroll = new VirtualScroll({
  6343. rows: rows,
  6344. fixedScroll: fixedScroll,
  6345. scrollEl: this.$tableBody[0],
  6346. contentEl: this.$body[0],
  6347. itemHeight: this.options.virtualScrollItemHeight,
  6348. callback: function callback(startIndex, endIndex) {
  6349. _this8.fitHeader();
  6350. _this8.initBodyEvent();
  6351. _this8.trigger('virtual-scroll', startIndex, endIndex);
  6352. }
  6353. });
  6354. }
  6355. toExpand.forEach(function (index) {
  6356. _this8.expandRow(index);
  6357. });
  6358. if (!fixedScroll) {
  6359. this.scrollTo(0);
  6360. }
  6361. this.initBodyEvent();
  6362. this.initFooter();
  6363. this.resetView();
  6364. this.updateSelected();
  6365. if (this.options.sidePagination !== 'server') {
  6366. this.options.totalRows = data.length;
  6367. }
  6368. this.trigger('post-body', data);
  6369. }
  6370. }, {
  6371. key: "initBodyEvent",
  6372. value: function initBodyEvent() {
  6373. var _this9 = this;
  6374. // click to select by column
  6375. this.$body.find('> tr[data-index] > td').off('click dblclick').on('click dblclick', function (e) {
  6376. var $td = $$q(e.currentTarget);
  6377. if ($td.find('.detail-icon').length || $td.index() - Utils.getDetailViewIndexOffset(_this9.options) < 0) {
  6378. return;
  6379. }
  6380. var $tr = $td.parent();
  6381. var $cardViewArr = $$q(e.target).parents('.card-views').children();
  6382. var $cardViewTarget = $$q(e.target).parents('.card-view');
  6383. var rowIndex = $tr.data('index');
  6384. var item = _this9.data[rowIndex];
  6385. var index = _this9.options.cardView ? $cardViewArr.index($cardViewTarget) : $td[0].cellIndex;
  6386. var fields = _this9.getVisibleFields();
  6387. var field = fields[index - Utils.getDetailViewIndexOffset(_this9.options)];
  6388. var column = _this9.columns[_this9.fieldsColumnsIndex[field]];
  6389. var value = Utils.getItemField(item, field, _this9.options.escape, column.escape);
  6390. _this9.trigger(e.type === 'click' ? 'click-cell' : 'dbl-click-cell', field, value, item, $td);
  6391. _this9.trigger(e.type === 'click' ? 'click-row' : 'dbl-click-row', item, $tr, field);
  6392. // if click to select - then trigger the checkbox/radio click
  6393. if (e.type === 'click' && _this9.options.clickToSelect && column.clickToSelect && !Utils.calculateObjectValue(_this9.options, _this9.options.ignoreClickToSelectOn, [e.target])) {
  6394. var $selectItem = $tr.find(Utils.sprintf('[name="%s"]', _this9.options.selectItemName));
  6395. if ($selectItem.length) {
  6396. $selectItem[0].click();
  6397. }
  6398. }
  6399. if (e.type === 'click' && _this9.options.detailViewByClick) {
  6400. _this9.toggleDetailView(rowIndex, _this9.header.detailFormatters[_this9.fieldsColumnsIndex[field]]);
  6401. }
  6402. }).off('mousedown').on('mousedown', function (e) {
  6403. // https://github.com/jquery/jquery/issues/1741
  6404. _this9.multipleSelectRowCtrlKey = e.ctrlKey || e.metaKey;
  6405. _this9.multipleSelectRowShiftKey = e.shiftKey;
  6406. });
  6407. this.$body.find('> tr[data-index] > td > .detail-icon').off('click').on('click', function (e) {
  6408. e.preventDefault();
  6409. _this9.toggleDetailView($$q(e.currentTarget).parent().parent().data('index'));
  6410. return false;
  6411. });
  6412. this.$selectItem = this.$body.find(Utils.sprintf('[name="%s"]', this.options.selectItemName));
  6413. this.$selectItem.off('click').on('click', function (e) {
  6414. e.stopImmediatePropagation();
  6415. var $this = $$q(e.currentTarget);
  6416. _this9._toggleCheck($this.prop('checked'), $this.data('index'));
  6417. });
  6418. this.header.events.forEach(function (_events, i) {
  6419. var events = _events;
  6420. if (!events) {
  6421. return;
  6422. }
  6423. // fix bug, if events is defined with namespace
  6424. if (typeof events === 'string') {
  6425. events = Utils.calculateObjectValue(null, events);
  6426. }
  6427. if (!events) {
  6428. throw new Error("Unknown event in the scope: ".concat(_events));
  6429. }
  6430. var field = _this9.header.fields[i];
  6431. var fieldIndex = _this9.getVisibleFields().indexOf(field);
  6432. if (fieldIndex === -1) {
  6433. return;
  6434. }
  6435. fieldIndex += Utils.getDetailViewIndexOffset(_this9.options);
  6436. var _loop3 = function _loop3(key) {
  6437. if (!events.hasOwnProperty(key)) {
  6438. return 1; // continue
  6439. }
  6440. var event = events[key];
  6441. _this9.$body.find('>tr:not(.no-records-found)').each(function (i, tr) {
  6442. var $tr = $$q(tr);
  6443. var $td = $tr.find(_this9.options.cardView ? '.card-views>.card-view' : '>td').eq(fieldIndex);
  6444. var index = key.indexOf(' ');
  6445. var name = key.substring(0, index);
  6446. var el = key.substring(index + 1);
  6447. $td.find(el).off(name).on(name, function (e) {
  6448. var index = $tr.data('index');
  6449. var row = _this9.data[index];
  6450. var value = row[field];
  6451. event.apply(_this9, [e, value, row, index]);
  6452. });
  6453. });
  6454. };
  6455. for (var key in events) {
  6456. if (_loop3(key)) continue;
  6457. }
  6458. });
  6459. }
  6460. }, {
  6461. key: "initServer",
  6462. value: function initServer(silent, query, url) {
  6463. var _this10 = this;
  6464. var data = {};
  6465. var index = this.header.fields.indexOf(this.options.sortName);
  6466. var params = {
  6467. searchText: this.searchText,
  6468. sortName: this.options.sortName,
  6469. sortOrder: this.options.sortOrder
  6470. };
  6471. if (this.header.sortNames[index]) {
  6472. params.sortName = this.header.sortNames[index];
  6473. }
  6474. if (this.options.pagination && this.options.sidePagination === 'server') {
  6475. params.pageSize = this.options.pageSize === this.options.formatAllRows() ? this.options.totalRows : this.options.pageSize;
  6476. params.pageNumber = this.options.pageNumber;
  6477. }
  6478. if (!(url || this.options.url) && !this.options.ajax) {
  6479. return;
  6480. }
  6481. if (this.options.queryParamsType === 'limit') {
  6482. params = {
  6483. search: params.searchText,
  6484. sort: params.sortName,
  6485. order: params.sortOrder
  6486. };
  6487. if (this.options.pagination && this.options.sidePagination === 'server') {
  6488. params.offset = this.options.pageSize === this.options.formatAllRows() ? 0 : this.options.pageSize * (this.options.pageNumber - 1);
  6489. params.limit = this.options.pageSize;
  6490. if (params.limit === 0 || this.options.pageSize === this.options.formatAllRows()) {
  6491. delete params.limit;
  6492. }
  6493. }
  6494. }
  6495. if (this.options.search && this.options.sidePagination === 'server' && this.options.searchable && this.columns.filter(function (column) {
  6496. return column.searchable;
  6497. }).length) {
  6498. params.searchable = [];
  6499. var _iterator2 = _createForOfIteratorHelper(this.columns),
  6500. _step2;
  6501. try {
  6502. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  6503. var column = _step2.value;
  6504. if (!column.checkbox && column.searchable && (this.options.visibleSearch && column.visible || !this.options.visibleSearch)) {
  6505. params.searchable.push(column.field);
  6506. }
  6507. }
  6508. } catch (err) {
  6509. _iterator2.e(err);
  6510. } finally {
  6511. _iterator2.f();
  6512. }
  6513. }
  6514. if (!Utils.isEmptyObject(this.filterColumnsPartial)) {
  6515. params.filter = JSON.stringify(this.filterColumnsPartial, null);
  6516. }
  6517. Utils.extend(params, query || {});
  6518. data = Utils.calculateObjectValue(this.options, this.options.queryParams, [params], data);
  6519. // false to stop request
  6520. if (data === false) {
  6521. return;
  6522. }
  6523. if (!silent) {
  6524. this.showLoading();
  6525. }
  6526. var request = Utils.extend({}, Utils.calculateObjectValue(null, this.options.ajaxOptions), {
  6527. type: this.options.method,
  6528. url: url || this.options.url,
  6529. data: this.options.contentType === 'application/json' && this.options.method === 'post' ? JSON.stringify(data) : data,
  6530. cache: this.options.cache,
  6531. contentType: this.options.contentType,
  6532. dataType: this.options.dataType,
  6533. success: function success(_res, textStatus, jqXHR) {
  6534. var res = Utils.calculateObjectValue(_this10.options, _this10.options.responseHandler, [_res, jqXHR], _res);
  6535. if (_this10.options.sidePagination === 'client' && _this10.options.paginationLoadMore) {
  6536. _this10._paginationLoaded = _this10.data.length === res.length;
  6537. }
  6538. _this10.load(res);
  6539. _this10.trigger('load-success', res, jqXHR && jqXHR.status, jqXHR);
  6540. if (!silent) {
  6541. _this10.hideLoading();
  6542. }
  6543. if (_this10.options.sidePagination === 'server' && _this10.options.pageNumber > 1 && res[_this10.options.totalField] > 0 && !res[_this10.options.dataField].length) {
  6544. _this10.updatePagination();
  6545. }
  6546. },
  6547. error: function error(jqXHR) {
  6548. // abort ajax by multiple request
  6549. if (jqXHR && jqXHR.status === 0 && _this10._xhrAbort) {
  6550. _this10._xhrAbort = false;
  6551. return;
  6552. }
  6553. var data = [];
  6554. if (_this10.options.sidePagination === 'server') {
  6555. data = {};
  6556. data[_this10.options.totalField] = 0;
  6557. data[_this10.options.dataField] = [];
  6558. }
  6559. _this10.load(data);
  6560. _this10.trigger('load-error', jqXHR && jqXHR.status, jqXHR);
  6561. if (!silent) {
  6562. _this10.hideLoading();
  6563. }
  6564. }
  6565. });
  6566. if (this.options.ajax) {
  6567. Utils.calculateObjectValue(this, this.options.ajax, [request], null);
  6568. } else {
  6569. if (this._xhr && this._xhr.readyState !== 4) {
  6570. this._xhrAbort = true;
  6571. this._xhr.abort();
  6572. }
  6573. this._xhr = $$q.ajax(request);
  6574. }
  6575. return data;
  6576. }
  6577. }, {
  6578. key: "initSearchText",
  6579. value: function initSearchText() {
  6580. if (this.options.search) {
  6581. this.searchText = '';
  6582. if (this.options.searchText !== '') {
  6583. var $search = Utils.getSearchInput(this);
  6584. $search.val(this.options.searchText);
  6585. this.onSearch({
  6586. currentTarget: $search,
  6587. firedByInitSearchText: true
  6588. });
  6589. }
  6590. }
  6591. }
  6592. }, {
  6593. key: "getCaret",
  6594. value: function getCaret() {
  6595. var _this11 = this;
  6596. this.$header.find('th').each(function (i, th) {
  6597. $$q(th).find('.sortable').removeClass('desc asc').addClass($$q(th).data('field') === _this11.options.sortName ? _this11.options.sortOrder : 'both');
  6598. });
  6599. }
  6600. }, {
  6601. key: "updateSelected",
  6602. value: function updateSelected() {
  6603. var checkAll = this.$selectItem.filter(':enabled').length && this.$selectItem.filter(':enabled').length === this.$selectItem.filter(':enabled').filter(':checked').length;
  6604. this.$selectAll.add(this.$selectAll_).prop('checked', checkAll);
  6605. this.$selectItem.each(function (i, el) {
  6606. $$q(el).closest('tr')[$$q(el).prop('checked') ? 'addClass' : 'removeClass']('selected');
  6607. });
  6608. }
  6609. }, {
  6610. key: "updateRows",
  6611. value: function updateRows() {
  6612. var _this12 = this;
  6613. this.$selectItem.each(function (i, el) {
  6614. _this12.data[$$q(el).data('index')][_this12.header.stateField] = $$q(el).prop('checked');
  6615. });
  6616. }
  6617. }, {
  6618. key: "resetRows",
  6619. value: function resetRows() {
  6620. var _iterator3 = _createForOfIteratorHelper(this.data),
  6621. _step3;
  6622. try {
  6623. for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
  6624. var row = _step3.value;
  6625. this.$selectAll.prop('checked', false);
  6626. this.$selectItem.prop('checked', false);
  6627. if (this.header.stateField) {
  6628. row[this.header.stateField] = false;
  6629. }
  6630. }
  6631. } catch (err) {
  6632. _iterator3.e(err);
  6633. } finally {
  6634. _iterator3.f();
  6635. }
  6636. this.initHiddenRows();
  6637. }
  6638. }, {
  6639. key: "trigger",
  6640. value: function trigger(_name) {
  6641. var _this$options, _this$options2;
  6642. var name = "".concat(_name, ".bs.table");
  6643. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key4 = 1; _key4 < _len; _key4++) {
  6644. args[_key4 - 1] = arguments[_key4];
  6645. }
  6646. (_this$options = this.options)[BootstrapTable.EVENTS[name]].apply(_this$options, [].concat(args, [this]));
  6647. this.$el.trigger($$q.Event(name, {
  6648. sender: this
  6649. }), args);
  6650. (_this$options2 = this.options).onAll.apply(_this$options2, [name].concat([].concat(args, [this])));
  6651. this.$el.trigger($$q.Event('all.bs.table', {
  6652. sender: this
  6653. }), [name, args]);
  6654. }
  6655. }, {
  6656. key: "resetHeader",
  6657. value: function resetHeader() {
  6658. var _this13 = this;
  6659. // fix #61: the hidden table reset header bug.
  6660. // fix bug: get $el.css('width') error sometime (height = 500)
  6661. clearTimeout(this.timeoutId_);
  6662. this.timeoutId_ = setTimeout(function () {
  6663. return _this13.fitHeader();
  6664. }, this.$el.is(':hidden') ? 100 : 0);
  6665. }
  6666. }, {
  6667. key: "fitHeader",
  6668. value: function fitHeader() {
  6669. var _this14 = this;
  6670. if (this.$el.is(':hidden')) {
  6671. this.timeoutId_ = setTimeout(function () {
  6672. return _this14.fitHeader();
  6673. }, 100);
  6674. return;
  6675. }
  6676. var fixedBody = this.$tableBody.get(0);
  6677. var scrollWidth = this.hasScrollBar && fixedBody.scrollHeight > fixedBody.clientHeight + this.$header.outerHeight() ? Utils.getScrollBarWidth() : 0;
  6678. this.$el.css('margin-top', -this.$header.outerHeight());
  6679. var focused = this.$tableHeader.find(':focus');
  6680. if (focused.length > 0) {
  6681. var $th = focused.parents('th');
  6682. if ($th.length > 0) {
  6683. var dataField = $th.attr('data-field');
  6684. if (dataField !== undefined) {
  6685. var $headerTh = this.$header.find("[data-field='".concat(dataField, "']"));
  6686. if ($headerTh.length > 0) {
  6687. $headerTh.find(':input').addClass('focus-temp');
  6688. }
  6689. }
  6690. }
  6691. }
  6692. this.$header_ = this.$header.clone(true, true);
  6693. this.$selectAll_ = this.$header_.find('[name="btSelectAll"]');
  6694. this.$tableHeader.css('margin-right', scrollWidth).find('table').css('width', this.$el.outerWidth()).html('').attr('class', this.$el.attr('class')).append(this.$header_);
  6695. this.$tableLoading.css('width', this.$el.outerWidth());
  6696. var focusedTemp = $$q('.focus-temp:visible:eq(0)');
  6697. if (focusedTemp.length > 0) {
  6698. focusedTemp.focus();
  6699. this.$header.find('.focus-temp').removeClass('focus-temp');
  6700. }
  6701. // fix bug: $.data() is not working as expected after $.append()
  6702. this.$header.find('th[data-field]').each(function (i, el) {
  6703. _this14.$header_.find(Utils.sprintf('th[data-field="%s"]', $$q(el).data('field'))).data($$q(el).data());
  6704. });
  6705. var visibleFields = this.getVisibleFields();
  6706. var $ths = this.$header_.find('th');
  6707. var $tr = this.$body.find('>tr:not(.no-records-found,.virtual-scroll-top)').eq(0);
  6708. while ($tr.length && $tr.find('>td[colspan]:not([colspan="1"])').length) {
  6709. $tr = $tr.next();
  6710. }
  6711. var trLength = $tr.find('> *').length;
  6712. $tr.find('> *').each(function (i, el) {
  6713. var $this = $$q(el);
  6714. if (Utils.hasDetailViewIcon(_this14.options)) {
  6715. if (i === 0 && _this14.options.detailViewAlign !== 'right' || i === trLength - 1 && _this14.options.detailViewAlign === 'right') {
  6716. var $thDetail = $ths.filter('.detail');
  6717. var _zoomWidth = $thDetail.innerWidth() - $thDetail.find('.fht-cell').width();
  6718. $thDetail.find('.fht-cell').width($this.innerWidth() - _zoomWidth);
  6719. return;
  6720. }
  6721. }
  6722. var index = i - Utils.getDetailViewIndexOffset(_this14.options);
  6723. var $th = _this14.$header_.find(Utils.sprintf('th[data-field="%s"]', visibleFields[index]));
  6724. if ($th.length > 1) {
  6725. $th = $$q($ths[$this[0].cellIndex]);
  6726. }
  6727. var zoomWidth = $th.innerWidth() - $th.find('.fht-cell').width();
  6728. $th.find('.fht-cell').width($this.innerWidth() - zoomWidth);
  6729. });
  6730. this.horizontalScroll();
  6731. this.trigger('post-header');
  6732. }
  6733. }, {
  6734. key: "initFooter",
  6735. value: function initFooter() {
  6736. if (!this.options.showFooter || this.options.cardView) {
  6737. // do nothing
  6738. return;
  6739. }
  6740. var data = this.getData();
  6741. var html = [];
  6742. var detailTemplate = '';
  6743. if (Utils.hasDetailViewIcon(this.options)) {
  6744. detailTemplate = '<th class="detail"><div class="th-inner"></div><div class="fht-cell"></div></th>';
  6745. }
  6746. if (detailTemplate && this.options.detailViewAlign !== 'right') {
  6747. html.push(detailTemplate);
  6748. }
  6749. var _iterator4 = _createForOfIteratorHelper(this.columns),
  6750. _step4;
  6751. try {
  6752. for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
  6753. var column = _step4.value;
  6754. var falign = '';
  6755. var valign = '';
  6756. var csses = [];
  6757. var style = {};
  6758. var class_ = Utils.sprintf(' class="%s"', column['class']);
  6759. if (!column.visible || this.footerData && this.footerData.length > 0 && !(column.field in this.footerData[0])) {
  6760. continue;
  6761. }
  6762. if (this.options.cardView && !column.cardVisible) {
  6763. return;
  6764. }
  6765. falign = Utils.sprintf('text-align: %s; ', column.falign ? column.falign : column.align);
  6766. valign = Utils.sprintf('vertical-align: %s; ', column.valign);
  6767. style = Utils.calculateObjectValue(null, column.footerStyle || this.options.footerStyle, [column]);
  6768. if (style && style.css) {
  6769. for (var _i14 = 0, _Object$entries13 = Object.entries(style.css); _i14 < _Object$entries13.length; _i14++) {
  6770. var _Object$entries13$_i = _slicedToArray(_Object$entries13[_i14], 2),
  6771. key = _Object$entries13$_i[0],
  6772. _value3 = _Object$entries13$_i[1];
  6773. csses.push("".concat(key, ": ").concat(_value3));
  6774. }
  6775. }
  6776. if (style && style.classes) {
  6777. class_ = Utils.sprintf(' class="%s"', column['class'] ? [column['class'], style.classes].join(' ') : style.classes);
  6778. }
  6779. html.push('<th', class_, Utils.sprintf(' style="%s"', falign + valign + csses.concat().join('; ') || undefined));
  6780. var colspan = 0;
  6781. if (this.footerData && this.footerData.length > 0) {
  6782. colspan = this.footerData[0]["_".concat(column.field, "_colspan")] || 0;
  6783. }
  6784. if (colspan) {
  6785. html.push(" colspan=\"".concat(colspan, "\" "));
  6786. }
  6787. html.push('>');
  6788. html.push('<div class="th-inner">');
  6789. var value = '';
  6790. if (this.footerData && this.footerData.length > 0) {
  6791. value = this.footerData[0][column.field] || '';
  6792. }
  6793. html.push(Utils.calculateObjectValue(column, column.footerFormatter, [data, value], value));
  6794. html.push('</div>');
  6795. html.push('<div class="fht-cell"></div>');
  6796. html.push('</div>');
  6797. html.push('</th>');
  6798. }
  6799. } catch (err) {
  6800. _iterator4.e(err);
  6801. } finally {
  6802. _iterator4.f();
  6803. }
  6804. if (detailTemplate && this.options.detailViewAlign === 'right') {
  6805. html.push(detailTemplate);
  6806. }
  6807. if (!this.options.height && !this.$tableFooter.length) {
  6808. this.$el.append('<tfoot><tr></tr></tfoot>');
  6809. this.$tableFooter = this.$el.find('tfoot');
  6810. }
  6811. if (!this.$tableFooter.find('tr').length) {
  6812. this.$tableFooter.html('<table><thead><tr></tr></thead></table>');
  6813. }
  6814. this.$tableFooter.find('tr').html(html.join(''));
  6815. this.trigger('post-footer', this.$tableFooter);
  6816. }
  6817. }, {
  6818. key: "fitFooter",
  6819. value: function fitFooter() {
  6820. var _this15 = this;
  6821. if (this.$el.is(':hidden')) {
  6822. setTimeout(function () {
  6823. return _this15.fitFooter();
  6824. }, 100);
  6825. return;
  6826. }
  6827. var fixedBody = this.$tableBody.get(0);
  6828. var scrollWidth = this.hasScrollBar && fixedBody.scrollHeight > fixedBody.clientHeight + this.$header.outerHeight() ? Utils.getScrollBarWidth() : 0;
  6829. this.$tableFooter.css('margin-right', scrollWidth).find('table').css('width', this.$el.outerWidth()).attr('class', this.$el.attr('class'));
  6830. var $ths = this.$tableFooter.find('th');
  6831. var $tr = this.$body.find('>tr:first-child:not(.no-records-found)');
  6832. $ths.find('.fht-cell').width('auto');
  6833. while ($tr.length && $tr.find('>td[colspan]:not([colspan="1"])').length) {
  6834. $tr = $tr.next();
  6835. }
  6836. var trLength = $tr.find('> *').length;
  6837. $tr.find('> *').each(function (i, el) {
  6838. var $this = $$q(el);
  6839. if (Utils.hasDetailViewIcon(_this15.options)) {
  6840. if (i === 0 && _this15.options.detailViewAlign === 'left' || i === trLength - 1 && _this15.options.detailViewAlign === 'right') {
  6841. var $thDetail = $ths.filter('.detail');
  6842. var _zoomWidth2 = $thDetail.innerWidth() - $thDetail.find('.fht-cell').width();
  6843. $thDetail.find('.fht-cell').width($this.innerWidth() - _zoomWidth2);
  6844. return;
  6845. }
  6846. }
  6847. var $th = $ths.eq(i);
  6848. var zoomWidth = $th.innerWidth() - $th.find('.fht-cell').width();
  6849. $th.find('.fht-cell').width($this.innerWidth() - zoomWidth);
  6850. });
  6851. this.horizontalScroll();
  6852. }
  6853. }, {
  6854. key: "horizontalScroll",
  6855. value: function horizontalScroll() {
  6856. var _this16 = this;
  6857. // horizontal scroll event
  6858. // TODO: it's probably better improving the layout than binding to scroll event
  6859. this.$tableBody.off('scroll').on('scroll', function () {
  6860. var scrollLeft = _this16.$tableBody.scrollLeft();
  6861. if (_this16.options.showHeader && _this16.options.height) {
  6862. _this16.$tableHeader.scrollLeft(scrollLeft);
  6863. }
  6864. if (_this16.options.showFooter && !_this16.options.cardView) {
  6865. _this16.$tableFooter.scrollLeft(scrollLeft);
  6866. }
  6867. _this16.trigger('scroll-body', _this16.$tableBody);
  6868. });
  6869. }
  6870. }, {
  6871. key: "getVisibleFields",
  6872. value: function getVisibleFields() {
  6873. var visibleFields = [];
  6874. var _iterator5 = _createForOfIteratorHelper(this.header.fields),
  6875. _step5;
  6876. try {
  6877. for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
  6878. var field = _step5.value;
  6879. var column = this.columns[this.fieldsColumnsIndex[field]];
  6880. if (!column || !column.visible || this.options.cardView && !column.cardVisible) {
  6881. continue;
  6882. }
  6883. visibleFields.push(field);
  6884. }
  6885. } catch (err) {
  6886. _iterator5.e(err);
  6887. } finally {
  6888. _iterator5.f();
  6889. }
  6890. return visibleFields;
  6891. }
  6892. }, {
  6893. key: "initHiddenRows",
  6894. value: function initHiddenRows() {
  6895. this.hiddenRows = [];
  6896. }
  6897. // PUBLIC FUNCTION DEFINITION
  6898. // =======================
  6899. }, {
  6900. key: "getOptions",
  6901. value: function getOptions() {
  6902. // deep copy and remove data
  6903. var options = Utils.extend({}, this.options);
  6904. delete options.data;
  6905. return Utils.extend(true, {}, options);
  6906. }
  6907. }, {
  6908. key: "refreshOptions",
  6909. value: function refreshOptions(options) {
  6910. // If the objects are equivalent then avoid the call of destroy / init methods
  6911. if (Utils.compareObjects(this.options, options, true)) {
  6912. return;
  6913. }
  6914. this.options = Utils.extend(this.options, options);
  6915. this.trigger('refresh-options', this.options);
  6916. this.destroy();
  6917. this.init();
  6918. }
  6919. }, {
  6920. key: "getData",
  6921. value: function getData(params) {
  6922. var _this17 = this;
  6923. var data = this.options.data;
  6924. if ((this.searchText || this.options.customSearch || this.options.sortName !== undefined || this.enableCustomSort ||
  6925. // Fix #4616: this.enableCustomSort is for extensions
  6926. !Utils.isEmptyObject(this.filterColumns) || typeof this.options.filterOptions.filterAlgorithm === 'function' || !Utils.isEmptyObject(this.filterColumnsPartial)) && (!params || !params.unfiltered)) {
  6927. data = this.data;
  6928. }
  6929. if (params && !params.includeHiddenRows) {
  6930. var hiddenRows = this.getHiddenRows();
  6931. data = data.filter(function (row) {
  6932. return Utils.findIndex(hiddenRows, row) === -1;
  6933. });
  6934. }
  6935. if (params && params.useCurrentPage) {
  6936. data = data.slice(this.pageFrom - 1, this.pageTo);
  6937. }
  6938. if (params && params.formatted) {
  6939. data.forEach(function (row) {
  6940. for (var _i15 = 0, _Object$entries14 = Object.entries(row); _i15 < _Object$entries14.length; _i15++) {
  6941. var _Object$entries14$_i = _slicedToArray(_Object$entries14[_i15], 2),
  6942. key = _Object$entries14$_i[0],
  6943. value = _Object$entries14$_i[1];
  6944. var column = _this17.columns[_this17.fieldsColumnsIndex[key]];
  6945. if (!column) {
  6946. return;
  6947. }
  6948. row[key] = Utils.calculateObjectValue(column, _this17.header.formatters[column.fieldIndex], [value, row, row.index, column.field], value);
  6949. }
  6950. });
  6951. }
  6952. return data;
  6953. }
  6954. }, {
  6955. key: "getSelections",
  6956. value: function getSelections() {
  6957. var _this18 = this;
  6958. return (this.options.maintainMetaData ? this.options.data : this.data).filter(function (row) {
  6959. return row[_this18.header.stateField] === true;
  6960. });
  6961. }
  6962. }, {
  6963. key: "load",
  6964. value: function load(_data) {
  6965. var fixedScroll = false;
  6966. var data = _data;
  6967. // #431: support pagination
  6968. if (this.options.pagination && this.options.sidePagination === 'server') {
  6969. this.options.totalRows = data[this.options.totalField];
  6970. this.options.totalNotFiltered = data[this.options.totalNotFilteredField];
  6971. this.footerData = data[this.options.footerField] ? [data[this.options.footerField]] : undefined;
  6972. }
  6973. fixedScroll = this.options.fixedScroll || data.fixedScroll;
  6974. data = Array.isArray(data) ? data : data[this.options.dataField];
  6975. this.initData(data);
  6976. this.initSearch();
  6977. this.initPagination();
  6978. this.initBody(fixedScroll);
  6979. }
  6980. }, {
  6981. key: "append",
  6982. value: function append(data) {
  6983. this.initData(data, 'append');
  6984. this.initSearch();
  6985. this.initPagination();
  6986. this.initSort();
  6987. this.initBody(true);
  6988. }
  6989. }, {
  6990. key: "prepend",
  6991. value: function prepend(data) {
  6992. this.initData(data, 'prepend');
  6993. this.initSearch();
  6994. this.initPagination();
  6995. this.initSort();
  6996. this.initBody(true);
  6997. }
  6998. }, {
  6999. key: "remove",
  7000. value: function remove(params) {
  7001. var removed = 0;
  7002. for (var i = this.options.data.length - 1; i >= 0; i--) {
  7003. var row = this.options.data[i];
  7004. var value = Utils.getItemField(row, params.field, this.options.escape, row.escape);
  7005. if (value === undefined && params.field !== '$index') {
  7006. continue;
  7007. }
  7008. if (!row.hasOwnProperty(params.field) && params.field === '$index' && params.values.includes(i) || params.values.includes(value)) {
  7009. removed++;
  7010. this.options.data.splice(i, 1);
  7011. }
  7012. }
  7013. if (!removed) {
  7014. return;
  7015. }
  7016. if (this.options.sidePagination === 'server') {
  7017. this.options.totalRows -= removed;
  7018. this.data = _toConsumableArray(this.options.data);
  7019. }
  7020. this.initSearch();
  7021. this.initPagination();
  7022. this.initSort();
  7023. this.initBody(true);
  7024. }
  7025. }, {
  7026. key: "removeAll",
  7027. value: function removeAll() {
  7028. if (this.options.data.length > 0) {
  7029. this.options.data.splice(0, this.options.data.length);
  7030. this.initSearch();
  7031. this.initPagination();
  7032. this.initBody(true);
  7033. }
  7034. }
  7035. }, {
  7036. key: "insertRow",
  7037. value: function insertRow(params) {
  7038. if (!params.hasOwnProperty('index') || !params.hasOwnProperty('row')) {
  7039. return;
  7040. }
  7041. this.options.data.splice(params.index, 0, params.row);
  7042. this.initSearch();
  7043. this.initPagination();
  7044. this.initSort();
  7045. this.initBody(true);
  7046. }
  7047. }, {
  7048. key: "updateRow",
  7049. value: function updateRow(params) {
  7050. var allParams = Array.isArray(params) ? params : [params];
  7051. var _iterator6 = _createForOfIteratorHelper(allParams),
  7052. _step6;
  7053. try {
  7054. for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
  7055. var _params = _step6.value;
  7056. if (!_params.hasOwnProperty('index') || !_params.hasOwnProperty('row')) {
  7057. continue;
  7058. }
  7059. if (_params.hasOwnProperty('replace') && _params.replace) {
  7060. this.options.data[_params.index] = _params.row;
  7061. } else {
  7062. Utils.extend(this.options.data[_params.index], _params.row);
  7063. }
  7064. }
  7065. } catch (err) {
  7066. _iterator6.e(err);
  7067. } finally {
  7068. _iterator6.f();
  7069. }
  7070. this.initSearch();
  7071. this.initPagination();
  7072. this.initSort();
  7073. this.initBody(true);
  7074. }
  7075. }, {
  7076. key: "getRowByUniqueId",
  7077. value: function getRowByUniqueId(_id) {
  7078. var uniqueId = this.options.uniqueId;
  7079. var len = this.options.data.length;
  7080. var id = _id;
  7081. var dataRow = null;
  7082. var i;
  7083. var row;
  7084. for (i = len - 1; i >= 0; i--) {
  7085. row = this.options.data[i];
  7086. var rowUniqueId = Utils.getItemField(row, uniqueId, this.options.escape, row.escape);
  7087. if (rowUniqueId === undefined) {
  7088. continue;
  7089. }
  7090. if (typeof rowUniqueId === 'string') {
  7091. id = _id.toString();
  7092. } else if (typeof rowUniqueId === 'number') {
  7093. if (Number(rowUniqueId) === rowUniqueId && rowUniqueId % 1 === 0) {
  7094. id = parseInt(_id, 10);
  7095. } else if (rowUniqueId === Number(rowUniqueId) && rowUniqueId !== 0) {
  7096. id = parseFloat(_id);
  7097. }
  7098. }
  7099. if (rowUniqueId === id) {
  7100. dataRow = row;
  7101. break;
  7102. }
  7103. }
  7104. return dataRow;
  7105. }
  7106. }, {
  7107. key: "updateByUniqueId",
  7108. value: function updateByUniqueId(params) {
  7109. var allParams = Array.isArray(params) ? params : [params];
  7110. var updatedUid = null;
  7111. var _iterator7 = _createForOfIteratorHelper(allParams),
  7112. _step7;
  7113. try {
  7114. for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
  7115. var _params2 = _step7.value;
  7116. if (!_params2.hasOwnProperty('id') || !_params2.hasOwnProperty('row')) {
  7117. continue;
  7118. }
  7119. var rowId = this.options.data.indexOf(this.getRowByUniqueId(_params2.id));
  7120. if (rowId === -1) {
  7121. continue;
  7122. }
  7123. if (_params2.hasOwnProperty('replace') && _params2.replace) {
  7124. this.options.data[rowId] = _params2.row;
  7125. } else {
  7126. Utils.extend(this.options.data[rowId], _params2.row);
  7127. }
  7128. updatedUid = _params2.id;
  7129. }
  7130. } catch (err) {
  7131. _iterator7.e(err);
  7132. } finally {
  7133. _iterator7.f();
  7134. }
  7135. this.initSearch();
  7136. this.initPagination();
  7137. this.initSort();
  7138. this.initBody(true, updatedUid);
  7139. }
  7140. }, {
  7141. key: "removeByUniqueId",
  7142. value: function removeByUniqueId(id) {
  7143. var len = this.options.data.length;
  7144. var row = this.getRowByUniqueId(id);
  7145. if (row) {
  7146. this.options.data.splice(this.options.data.indexOf(row), 1);
  7147. }
  7148. if (len === this.options.data.length) {
  7149. return;
  7150. }
  7151. if (this.options.sidePagination === 'server') {
  7152. this.options.totalRows -= 1;
  7153. this.data = _toConsumableArray(this.options.data);
  7154. }
  7155. this.initSearch();
  7156. this.initPagination();
  7157. this.initBody(true);
  7158. }
  7159. }, {
  7160. key: "_updateCellOnly",
  7161. value: function _updateCellOnly(field, index) {
  7162. var rowHtml = this.initRow(this.options.data[index], index);
  7163. var fieldIndex = this.getVisibleFields().indexOf(field);
  7164. if (fieldIndex === -1) {
  7165. return;
  7166. }
  7167. fieldIndex += Utils.getDetailViewIndexOffset(this.options);
  7168. this.$body.find(">tr[data-index=".concat(index, "]")).find(">td:eq(".concat(fieldIndex, ")")).replaceWith($$q(rowHtml).find(">td:eq(".concat(fieldIndex, ")")));
  7169. this.initBodyEvent();
  7170. this.initFooter();
  7171. this.resetView();
  7172. this.updateSelected();
  7173. }
  7174. }, {
  7175. key: "updateCell",
  7176. value: function updateCell(params) {
  7177. if (!params.hasOwnProperty('index') || !params.hasOwnProperty('field') || !params.hasOwnProperty('value')) {
  7178. return;
  7179. }
  7180. this.options.data[params.index][params.field] = params.value;
  7181. if (params.reinit === false) {
  7182. this._updateCellOnly(params.field, params.index);
  7183. return;
  7184. }
  7185. this.initSort();
  7186. this.initBody(true);
  7187. }
  7188. }, {
  7189. key: "updateCellByUniqueId",
  7190. value: function updateCellByUniqueId(params) {
  7191. var _this19 = this;
  7192. var allParams = Array.isArray(params) ? params : [params];
  7193. allParams.forEach(function (_ref6) {
  7194. var id = _ref6.id,
  7195. field = _ref6.field,
  7196. value = _ref6.value;
  7197. var index = _this19.options.data.indexOf(_this19.getRowByUniqueId(id));
  7198. if (index === -1) {
  7199. return;
  7200. }
  7201. _this19.options.data[index][field] = value;
  7202. });
  7203. if (params.reinit === false) {
  7204. this._updateCellOnly(params.field, this.options.data.indexOf(this.getRowByUniqueId(params.id)));
  7205. return;
  7206. }
  7207. this.initSort();
  7208. this.initBody(true);
  7209. }
  7210. }, {
  7211. key: "showRow",
  7212. value: function showRow(params) {
  7213. this._toggleRow(params, true);
  7214. }
  7215. }, {
  7216. key: "hideRow",
  7217. value: function hideRow(params) {
  7218. this._toggleRow(params, false);
  7219. }
  7220. }, {
  7221. key: "_toggleRow",
  7222. value: function _toggleRow(params, visible) {
  7223. var row;
  7224. if (params.hasOwnProperty('index')) {
  7225. row = this.getData()[params.index];
  7226. } else if (params.hasOwnProperty('uniqueId')) {
  7227. row = this.getRowByUniqueId(params.uniqueId);
  7228. }
  7229. if (!row) {
  7230. return;
  7231. }
  7232. var index = Utils.findIndex(this.hiddenRows, row);
  7233. if (!visible && index === -1) {
  7234. this.hiddenRows.push(row);
  7235. } else if (visible && index > -1) {
  7236. this.hiddenRows.splice(index, 1);
  7237. }
  7238. this.initBody(true);
  7239. this.initPagination();
  7240. }
  7241. }, {
  7242. key: "getHiddenRows",
  7243. value: function getHiddenRows(show) {
  7244. if (show) {
  7245. this.initHiddenRows();
  7246. this.initBody(true);
  7247. this.initPagination();
  7248. return;
  7249. }
  7250. var data = this.getData();
  7251. var rows = [];
  7252. var _iterator8 = _createForOfIteratorHelper(data),
  7253. _step8;
  7254. try {
  7255. for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
  7256. var row = _step8.value;
  7257. if (this.hiddenRows.includes(row)) {
  7258. rows.push(row);
  7259. }
  7260. }
  7261. } catch (err) {
  7262. _iterator8.e(err);
  7263. } finally {
  7264. _iterator8.f();
  7265. }
  7266. this.hiddenRows = rows;
  7267. return rows;
  7268. }
  7269. }, {
  7270. key: "showColumn",
  7271. value: function showColumn(field) {
  7272. var _this20 = this;
  7273. var fields = Array.isArray(field) ? field : [field];
  7274. fields.forEach(function (field) {
  7275. _this20._toggleColumn(_this20.fieldsColumnsIndex[field], true, true);
  7276. });
  7277. }
  7278. }, {
  7279. key: "hideColumn",
  7280. value: function hideColumn(field) {
  7281. var _this21 = this;
  7282. var fields = Array.isArray(field) ? field : [field];
  7283. fields.forEach(function (field) {
  7284. _this21._toggleColumn(_this21.fieldsColumnsIndex[field], false, true);
  7285. });
  7286. }
  7287. }, {
  7288. key: "_toggleColumn",
  7289. value: function _toggleColumn(index, checked, needUpdate) {
  7290. if (index === -1 || this.columns[index].visible === checked) {
  7291. return;
  7292. }
  7293. this.columns[index].visible = checked;
  7294. this.initHeader();
  7295. this.initSearch();
  7296. this.initPagination();
  7297. this.initBody();
  7298. if (this.options.showColumns) {
  7299. var $items = this.$toolbar.find('.keep-open input:not(".toggle-all")').prop('disabled', false);
  7300. if (needUpdate) {
  7301. $items.filter(Utils.sprintf('[value="%s"]', index)).prop('checked', checked);
  7302. }
  7303. if ($items.filter(':checked').length <= this.options.minimumCountColumns) {
  7304. $items.filter(':checked').prop('disabled', true);
  7305. }
  7306. }
  7307. }
  7308. }, {
  7309. key: "getVisibleColumns",
  7310. value: function getVisibleColumns() {
  7311. var _this22 = this;
  7312. return this.columns.filter(function (column) {
  7313. return column.visible && !_this22.isSelectionColumn(column);
  7314. });
  7315. }
  7316. }, {
  7317. key: "getHiddenColumns",
  7318. value: function getHiddenColumns() {
  7319. return this.columns.filter(function (_ref7) {
  7320. var visible = _ref7.visible;
  7321. return !visible;
  7322. });
  7323. }
  7324. }, {
  7325. key: "isSelectionColumn",
  7326. value: function isSelectionColumn(column) {
  7327. return column.radio || column.checkbox;
  7328. }
  7329. }, {
  7330. key: "showAllColumns",
  7331. value: function showAllColumns() {
  7332. this._toggleAllColumns(true);
  7333. }
  7334. }, {
  7335. key: "hideAllColumns",
  7336. value: function hideAllColumns() {
  7337. this._toggleAllColumns(false);
  7338. }
  7339. }, {
  7340. key: "_toggleAllColumns",
  7341. value: function _toggleAllColumns(visible) {
  7342. var _this23 = this;
  7343. var _iterator9 = _createForOfIteratorHelper(this.columns.slice().reverse()),
  7344. _step9;
  7345. try {
  7346. for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
  7347. var column = _step9.value;
  7348. if (column.switchable) {
  7349. if (!visible && this.options.showColumns && this.getVisibleColumns().filter(function (it) {
  7350. return it.switchable;
  7351. }).length === this.options.minimumCountColumns) {
  7352. continue;
  7353. }
  7354. column.visible = visible;
  7355. }
  7356. }
  7357. } catch (err) {
  7358. _iterator9.e(err);
  7359. } finally {
  7360. _iterator9.f();
  7361. }
  7362. this.initHeader();
  7363. this.initSearch();
  7364. this.initPagination();
  7365. this.initBody();
  7366. if (this.options.showColumns) {
  7367. var $items = this.$toolbar.find('.keep-open input[type="checkbox"]:not(".toggle-all")').prop('disabled', false);
  7368. if (visible) {
  7369. $items.prop('checked', visible);
  7370. } else {
  7371. $items.get().reverse().forEach(function (item) {
  7372. if ($items.filter(':checked').length > _this23.options.minimumCountColumns) {
  7373. $$q(item).prop('checked', visible);
  7374. }
  7375. });
  7376. }
  7377. if ($items.filter(':checked').length <= this.options.minimumCountColumns) {
  7378. $items.filter(':checked').prop('disabled', true);
  7379. }
  7380. }
  7381. }
  7382. }, {
  7383. key: "mergeCells",
  7384. value: function mergeCells(options) {
  7385. var row = options.index;
  7386. var col = this.getVisibleFields().indexOf(options.field);
  7387. var rowspan = options.rowspan || 1;
  7388. var colspan = options.colspan || 1;
  7389. var i;
  7390. var j;
  7391. var $tr = this.$body.find('>tr[data-index]');
  7392. col += Utils.getDetailViewIndexOffset(this.options);
  7393. var $td = $tr.eq(row).find('>td').eq(col);
  7394. if (row < 0 || col < 0 || row >= this.data.length) {
  7395. return;
  7396. }
  7397. for (i = row; i < row + rowspan; i++) {
  7398. for (j = col; j < col + colspan; j++) {
  7399. $tr.eq(i).find('>td').eq(j).hide();
  7400. }
  7401. }
  7402. $td.attr('rowspan', rowspan).attr('colspan', colspan).show();
  7403. }
  7404. }, {
  7405. key: "checkAll",
  7406. value: function checkAll() {
  7407. this._toggleCheckAll(true);
  7408. }
  7409. }, {
  7410. key: "uncheckAll",
  7411. value: function uncheckAll() {
  7412. this._toggleCheckAll(false);
  7413. }
  7414. }, {
  7415. key: "_toggleCheckAll",
  7416. value: function _toggleCheckAll(checked) {
  7417. var rowsBefore = this.getSelections();
  7418. this.$selectAll.add(this.$selectAll_).prop('checked', checked);
  7419. this.$selectItem.filter(':enabled').prop('checked', checked);
  7420. this.updateRows();
  7421. this.updateSelected();
  7422. var rowsAfter = this.getSelections();
  7423. if (checked) {
  7424. this.trigger('check-all', rowsAfter, rowsBefore);
  7425. return;
  7426. }
  7427. this.trigger('uncheck-all', rowsAfter, rowsBefore);
  7428. }
  7429. }, {
  7430. key: "checkInvert",
  7431. value: function checkInvert() {
  7432. var $items = this.$selectItem.filter(':enabled');
  7433. var checked = $items.filter(':checked');
  7434. $items.each(function (i, el) {
  7435. $$q(el).prop('checked', !$$q(el).prop('checked'));
  7436. });
  7437. this.updateRows();
  7438. this.updateSelected();
  7439. this.trigger('uncheck-some', checked);
  7440. checked = this.getSelections();
  7441. this.trigger('check-some', checked);
  7442. }
  7443. }, {
  7444. key: "check",
  7445. value: function check(index) {
  7446. this._toggleCheck(true, index);
  7447. }
  7448. }, {
  7449. key: "uncheck",
  7450. value: function uncheck(index) {
  7451. this._toggleCheck(false, index);
  7452. }
  7453. }, {
  7454. key: "_toggleCheck",
  7455. value: function _toggleCheck(checked, index) {
  7456. var $el = this.$selectItem.filter("[data-index=\"".concat(index, "\"]"));
  7457. var row = this.data[index];
  7458. if ($el.is(':radio') || this.options.singleSelect || this.options.multipleSelectRow && !this.multipleSelectRowCtrlKey && !this.multipleSelectRowShiftKey) {
  7459. var _iterator10 = _createForOfIteratorHelper(this.options.data),
  7460. _step10;
  7461. try {
  7462. for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
  7463. var r = _step10.value;
  7464. r[this.header.stateField] = false;
  7465. }
  7466. } catch (err) {
  7467. _iterator10.e(err);
  7468. } finally {
  7469. _iterator10.f();
  7470. }
  7471. this.$selectItem.filter(':checked').not($el).prop('checked', false);
  7472. }
  7473. row[this.header.stateField] = checked;
  7474. if (this.options.multipleSelectRow) {
  7475. if (this.multipleSelectRowShiftKey && this.multipleSelectRowLastSelectedIndex >= 0) {
  7476. var _ref8 = this.multipleSelectRowLastSelectedIndex < index ? [this.multipleSelectRowLastSelectedIndex, index] : [index, this.multipleSelectRowLastSelectedIndex],
  7477. _ref9 = _slicedToArray(_ref8, 2),
  7478. fromIndex = _ref9[0],
  7479. toIndex = _ref9[1];
  7480. for (var i = fromIndex + 1; i < toIndex; i++) {
  7481. this.data[i][this.header.stateField] = true;
  7482. this.$selectItem.filter("[data-index=\"".concat(i, "\"]")).prop('checked', true);
  7483. }
  7484. }
  7485. this.multipleSelectRowCtrlKey = false;
  7486. this.multipleSelectRowShiftKey = false;
  7487. this.multipleSelectRowLastSelectedIndex = checked ? index : -1;
  7488. }
  7489. $el.prop('checked', checked);
  7490. this.updateSelected();
  7491. this.trigger(checked ? 'check' : 'uncheck', this.data[index], $el);
  7492. }
  7493. }, {
  7494. key: "checkBy",
  7495. value: function checkBy(obj) {
  7496. this._toggleCheckBy(true, obj);
  7497. }
  7498. }, {
  7499. key: "uncheckBy",
  7500. value: function uncheckBy(obj) {
  7501. this._toggleCheckBy(false, obj);
  7502. }
  7503. }, {
  7504. key: "_toggleCheckBy",
  7505. value: function _toggleCheckBy(checked, obj) {
  7506. var _this24 = this;
  7507. if (!obj.hasOwnProperty('field') || !obj.hasOwnProperty('values')) {
  7508. return;
  7509. }
  7510. var rows = [];
  7511. this.data.forEach(function (row, i) {
  7512. if (!row.hasOwnProperty(obj.field)) {
  7513. return false;
  7514. }
  7515. if (obj.values.includes(row[obj.field])) {
  7516. var $el = _this24.$selectItem.filter(':enabled').filter(Utils.sprintf('[data-index="%s"]', i));
  7517. var onlyCurrentPage = obj.hasOwnProperty('onlyCurrentPage') ? obj.onlyCurrentPage : false;
  7518. $el = checked ? $el.not(':checked') : $el.filter(':checked');
  7519. if (!$el.length && onlyCurrentPage) {
  7520. return;
  7521. }
  7522. $el.prop('checked', checked);
  7523. row[_this24.header.stateField] = checked;
  7524. rows.push(row);
  7525. _this24.trigger(checked ? 'check' : 'uncheck', row, $el);
  7526. }
  7527. });
  7528. this.updateSelected();
  7529. this.trigger(checked ? 'check-some' : 'uncheck-some', rows);
  7530. }
  7531. }, {
  7532. key: "refresh",
  7533. value: function refresh(params) {
  7534. if (params && params.url) {
  7535. this.options.url = params.url;
  7536. }
  7537. if (params && params.pageNumber) {
  7538. this.options.pageNumber = params.pageNumber;
  7539. }
  7540. if (params && params.pageSize) {
  7541. this.options.pageSize = params.pageSize;
  7542. }
  7543. this.trigger('refresh', this.initServer(params && params.silent, params && params.query, params && params.url));
  7544. }
  7545. }, {
  7546. key: "destroy",
  7547. value: function destroy() {
  7548. this.$el.insertBefore(this.$container);
  7549. $$q(this.options.toolbar).insertBefore(this.$el);
  7550. this.$container.next().remove();
  7551. this.$container.remove();
  7552. this.$el.html(this.$el_.html()).css('margin-top', '0').attr('class', this.$el_.attr('class') || ''); // reset the class
  7553. var resizeEvent = Utils.getEventName('resize.bootstrap-table', this.$el.attr('id'));
  7554. $$q(window).off(resizeEvent);
  7555. }
  7556. }, {
  7557. key: "resetView",
  7558. value: function resetView(params) {
  7559. var padding = 0;
  7560. if (params && params.height) {
  7561. this.options.height = params.height;
  7562. }
  7563. this.$tableContainer.toggleClass('has-card-view', this.options.cardView);
  7564. if (this.options.height) {
  7565. var fixedBody = this.$tableBody.get(0);
  7566. this.hasScrollBar = fixedBody.scrollWidth > fixedBody.clientWidth;
  7567. }
  7568. if (!this.options.cardView && this.options.showHeader && this.options.height) {
  7569. this.$tableHeader.show();
  7570. this.resetHeader();
  7571. padding += this.$header.outerHeight(true) + 1;
  7572. } else {
  7573. this.$tableHeader.hide();
  7574. this.trigger('post-header');
  7575. }
  7576. if (!this.options.cardView && this.options.showFooter) {
  7577. this.$tableFooter.show();
  7578. this.fitFooter();
  7579. if (this.options.height) {
  7580. padding += this.$tableFooter.outerHeight(true);
  7581. }
  7582. }
  7583. if (this.$container.hasClass('fullscreen')) {
  7584. this.$tableContainer.css('height', '');
  7585. this.$tableContainer.css('width', '');
  7586. } else if (this.options.height) {
  7587. if (this.$tableBorder) {
  7588. this.$tableBorder.css('width', '');
  7589. this.$tableBorder.css('height', '');
  7590. }
  7591. var toolbarHeight = this.$toolbar.outerHeight(true);
  7592. var paginationHeight = this.$pagination.outerHeight(true);
  7593. var height = this.options.height - toolbarHeight - paginationHeight;
  7594. var $bodyTable = this.$tableBody.find('>table');
  7595. var tableHeight = $bodyTable.outerHeight();
  7596. this.$tableContainer.css('height', "".concat(height, "px"));
  7597. if (this.$tableBorder && $bodyTable.is(':visible')) {
  7598. var tableBorderHeight = height - tableHeight - 2;
  7599. if (this.hasScrollBar) {
  7600. tableBorderHeight -= Utils.getScrollBarWidth();
  7601. }
  7602. this.$tableBorder.css('width', "".concat($bodyTable.outerWidth(), "px"));
  7603. this.$tableBorder.css('height', "".concat(tableBorderHeight, "px"));
  7604. }
  7605. }
  7606. if (this.options.cardView) {
  7607. // remove the element css
  7608. this.$el.css('margin-top', '0');
  7609. this.$tableContainer.css('padding-bottom', '0');
  7610. this.$tableFooter.hide();
  7611. } else {
  7612. // Assign the correct sortable arrow
  7613. this.getCaret();
  7614. this.$tableContainer.css('padding-bottom', "".concat(padding, "px"));
  7615. }
  7616. this.trigger('reset-view');
  7617. }
  7618. }, {
  7619. key: "showLoading",
  7620. value: function showLoading() {
  7621. this.$tableLoading.toggleClass('open', true);
  7622. var fontSize = this.options.loadingFontSize;
  7623. if (this.options.loadingFontSize === 'auto') {
  7624. fontSize = this.$tableLoading.width() * 0.04;
  7625. fontSize = Math.max(12, fontSize);
  7626. fontSize = Math.min(32, fontSize);
  7627. fontSize = "".concat(fontSize, "px");
  7628. }
  7629. this.$tableLoading.find('.loading-text').css('font-size', fontSize);
  7630. }
  7631. }, {
  7632. key: "hideLoading",
  7633. value: function hideLoading() {
  7634. this.$tableLoading.toggleClass('open', false);
  7635. }
  7636. }, {
  7637. key: "togglePagination",
  7638. value: function togglePagination() {
  7639. this.options.pagination = !this.options.pagination;
  7640. var icon = this.options.showButtonIcons ? this.options.pagination ? this.options.icons.paginationSwitchDown : this.options.icons.paginationSwitchUp : '';
  7641. var text = this.options.showButtonText ? this.options.pagination ? this.options.formatPaginationSwitchUp() : this.options.formatPaginationSwitchDown() : '';
  7642. this.$toolbar.find('button[name="paginationSwitch"]').html("".concat(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, icon), " ").concat(text));
  7643. this.updatePagination();
  7644. this.trigger('toggle-pagination', this.options.pagination);
  7645. }
  7646. }, {
  7647. key: "toggleFullscreen",
  7648. value: function toggleFullscreen() {
  7649. this.$el.closest('.bootstrap-table').toggleClass('fullscreen');
  7650. this.resetView();
  7651. }
  7652. }, {
  7653. key: "toggleView",
  7654. value: function toggleView() {
  7655. this.options.cardView = !this.options.cardView;
  7656. this.initHeader();
  7657. var icon = this.options.showButtonIcons ? this.options.cardView ? this.options.icons.toggleOn : this.options.icons.toggleOff : '';
  7658. var text = this.options.showButtonText ? this.options.cardView ? this.options.formatToggleOff() : this.options.formatToggleOn() : '';
  7659. this.$toolbar.find('button[name="toggle"]').html("".concat(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, icon), " ").concat(text)).attr('aria-label', text).attr('title', text);
  7660. this.initBody();
  7661. this.trigger('toggle', this.options.cardView);
  7662. }
  7663. }, {
  7664. key: "resetSearch",
  7665. value: function resetSearch(text) {
  7666. var $search = Utils.getSearchInput(this);
  7667. var textToUse = text || '';
  7668. $search.val(textToUse);
  7669. this.searchText = textToUse;
  7670. this.onSearch({
  7671. currentTarget: $search
  7672. }, false);
  7673. }
  7674. }, {
  7675. key: "filterBy",
  7676. value: function filterBy(columns, options) {
  7677. this.filterOptions = Utils.isEmptyObject(options) ? this.options.filterOptions : Utils.extend(this.options.filterOptions, options);
  7678. this.filterColumns = Utils.isEmptyObject(columns) ? {} : columns;
  7679. this.options.pageNumber = 1;
  7680. this.initSearch();
  7681. this.updatePagination();
  7682. }
  7683. }, {
  7684. key: "scrollTo",
  7685. value: function scrollTo(params) {
  7686. var options = {
  7687. unit: 'px',
  7688. value: 0
  7689. };
  7690. if (_typeof(params) === 'object') {
  7691. options = Object.assign(options, params);
  7692. } else if (typeof params === 'string' && params === 'bottom') {
  7693. options.value = this.$tableBody[0].scrollHeight;
  7694. } else if (typeof params === 'string' || typeof params === 'number') {
  7695. options.value = params;
  7696. }
  7697. var scrollTo = options.value;
  7698. if (options.unit === 'rows') {
  7699. scrollTo = 0;
  7700. this.$body.find("> tr:lt(".concat(options.value, ")")).each(function (i, el) {
  7701. scrollTo += $$q(el).outerHeight(true);
  7702. });
  7703. }
  7704. this.$tableBody.scrollTop(scrollTo);
  7705. }
  7706. }, {
  7707. key: "getScrollPosition",
  7708. value: function getScrollPosition() {
  7709. return this.$tableBody.scrollTop();
  7710. }
  7711. }, {
  7712. key: "selectPage",
  7713. value: function selectPage(page) {
  7714. if (page > 0 && page <= this.options.totalPages) {
  7715. this.options.pageNumber = page;
  7716. this.updatePagination();
  7717. }
  7718. }
  7719. }, {
  7720. key: "prevPage",
  7721. value: function prevPage() {
  7722. if (this.options.pageNumber > 1) {
  7723. this.options.pageNumber--;
  7724. this.updatePagination();
  7725. }
  7726. }
  7727. }, {
  7728. key: "nextPage",
  7729. value: function nextPage() {
  7730. if (this.options.pageNumber < this.options.totalPages) {
  7731. this.options.pageNumber++;
  7732. this.updatePagination();
  7733. }
  7734. }
  7735. }, {
  7736. key: "toggleDetailView",
  7737. value: function toggleDetailView(index, _columnDetailFormatter) {
  7738. var $tr = this.$body.find(Utils.sprintf('> tr[data-index="%s"]', index));
  7739. if ($tr.next().is('tr.detail-view')) {
  7740. this.collapseRow(index);
  7741. } else {
  7742. this.expandRow(index, _columnDetailFormatter);
  7743. }
  7744. this.resetView();
  7745. }
  7746. }, {
  7747. key: "expandRow",
  7748. value: function expandRow(index, _columnDetailFormatter) {
  7749. var row = this.data[index];
  7750. var $tr = this.$body.find(Utils.sprintf('> tr[data-index="%s"][data-has-detail-view]', index));
  7751. if (this.options.detailViewIcon) {
  7752. $tr.find('a.detail-icon').html(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.detailClose));
  7753. }
  7754. if ($tr.next().is('tr.detail-view')) {
  7755. return;
  7756. }
  7757. $tr.after(Utils.sprintf('<tr class="detail-view"><td colspan="%s"></td></tr>', $tr.children('td').length));
  7758. var $element = $tr.next().find('td');
  7759. var detailFormatter = _columnDetailFormatter || this.options.detailFormatter;
  7760. var content = Utils.calculateObjectValue(this.options, detailFormatter, [index, row, $element], '');
  7761. if ($element.length === 1) {
  7762. $element.append(content);
  7763. }
  7764. this.trigger('expand-row', index, row, $element);
  7765. }
  7766. }, {
  7767. key: "expandRowByUniqueId",
  7768. value: function expandRowByUniqueId(uniqueId) {
  7769. var row = this.getRowByUniqueId(uniqueId);
  7770. if (!row) {
  7771. return;
  7772. }
  7773. this.expandRow(this.data.indexOf(row));
  7774. }
  7775. }, {
  7776. key: "collapseRow",
  7777. value: function collapseRow(index) {
  7778. var row = this.data[index];
  7779. var $tr = this.$body.find(Utils.sprintf('> tr[data-index="%s"][data-has-detail-view]', index));
  7780. if (!$tr.next().is('tr.detail-view')) {
  7781. return;
  7782. }
  7783. if (this.options.detailViewIcon) {
  7784. $tr.find('a.detail-icon').html(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.detailOpen));
  7785. }
  7786. this.trigger('collapse-row', index, row, $tr.next());
  7787. $tr.next().remove();
  7788. }
  7789. }, {
  7790. key: "collapseRowByUniqueId",
  7791. value: function collapseRowByUniqueId(uniqueId) {
  7792. var row = this.getRowByUniqueId(uniqueId);
  7793. if (!row) {
  7794. return;
  7795. }
  7796. this.collapseRow(this.data.indexOf(row));
  7797. }
  7798. }, {
  7799. key: "expandAllRows",
  7800. value: function expandAllRows() {
  7801. var trs = this.$body.find('> tr[data-index][data-has-detail-view]');
  7802. for (var i = 0; i < trs.length; i++) {
  7803. this.expandRow($$q(trs[i]).data('index'));
  7804. }
  7805. }
  7806. }, {
  7807. key: "collapseAllRows",
  7808. value: function collapseAllRows() {
  7809. var trs = this.$body.find('> tr[data-index][data-has-detail-view]');
  7810. for (var i = 0; i < trs.length; i++) {
  7811. this.collapseRow($$q(trs[i]).data('index'));
  7812. }
  7813. }
  7814. }, {
  7815. key: "updateColumnTitle",
  7816. value: function updateColumnTitle(params) {
  7817. if (!params.hasOwnProperty('field') || !params.hasOwnProperty('title')) {
  7818. return;
  7819. }
  7820. this.columns[this.fieldsColumnsIndex[params.field]].title = this.options.escape && this.options.escapeTitle ? Utils.escapeHTML(params.title) : params.title;
  7821. if (this.columns[this.fieldsColumnsIndex[params.field]].visible) {
  7822. this.$header.find('th[data-field]').each(function (i, el) {
  7823. if ($$q(el).data('field') === params.field) {
  7824. $$q($$q(el).find('.th-inner')[0]).html(params.title);
  7825. return false;
  7826. }
  7827. });
  7828. this.resetView();
  7829. }
  7830. }
  7831. }, {
  7832. key: "updateFormatText",
  7833. value: function updateFormatText(formatName, text) {
  7834. if (!/^format/.test(formatName) || !this.options[formatName]) {
  7835. return;
  7836. }
  7837. if (typeof text === 'string') {
  7838. this.options[formatName] = function () {
  7839. return text;
  7840. };
  7841. } else if (typeof text === 'function') {
  7842. this.options[formatName] = text;
  7843. }
  7844. this.initToolbar();
  7845. this.initPagination();
  7846. this.initBody();
  7847. }
  7848. }]);
  7849. }();
  7850. BootstrapTable.VERSION = Constants.VERSION;
  7851. BootstrapTable.DEFAULTS = Constants.DEFAULTS;
  7852. BootstrapTable.LOCALES = Constants.LOCALES;
  7853. BootstrapTable.COLUMN_DEFAULTS = Constants.COLUMN_DEFAULTS;
  7854. BootstrapTable.METHODS = Constants.METHODS;
  7855. BootstrapTable.EVENTS = Constants.EVENTS;
  7856. // BOOTSTRAP TABLE PLUGIN DEFINITION
  7857. // =======================
  7858. $$q.BootstrapTable = BootstrapTable;
  7859. $$q.fn.bootstrapTable = function (option) {
  7860. for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key5 = 1; _key5 < _len2; _key5++) {
  7861. args[_key5 - 1] = arguments[_key5];
  7862. }
  7863. var value;
  7864. this.each(function (i, el) {
  7865. var data = $$q(el).data('bootstrap.table');
  7866. if (typeof option === 'string') {
  7867. var _data2;
  7868. if (!Constants.METHODS.includes(option)) {
  7869. throw new Error("Unknown method: ".concat(option));
  7870. }
  7871. if (!data) {
  7872. return;
  7873. }
  7874. value = (_data2 = data)[option].apply(_data2, args);
  7875. if (option === 'destroy') {
  7876. $$q(el).removeData('bootstrap.table');
  7877. }
  7878. return;
  7879. }
  7880. if (data) {
  7881. console.warn('You cannot initialize the table more than once!');
  7882. return;
  7883. }
  7884. var options = Utils.extend(true, {}, BootstrapTable.DEFAULTS, $$q(el).data(), _typeof(option) === 'object' && option);
  7885. data = new $$q.BootstrapTable(el, options);
  7886. $$q(el).data('bootstrap.table', data);
  7887. data.init();
  7888. });
  7889. return typeof value === 'undefined' ? this : value;
  7890. };
  7891. $$q.fn.bootstrapTable.Constructor = BootstrapTable;
  7892. $$q.fn.bootstrapTable.theme = Constants.THEME;
  7893. $$q.fn.bootstrapTable.VERSION = Constants.VERSION;
  7894. $$q.fn.bootstrapTable.defaults = BootstrapTable.DEFAULTS;
  7895. $$q.fn.bootstrapTable.columnDefaults = BootstrapTable.COLUMN_DEFAULTS;
  7896. $$q.fn.bootstrapTable.events = BootstrapTable.EVENTS;
  7897. $$q.fn.bootstrapTable.locales = BootstrapTable.LOCALES;
  7898. $$q.fn.bootstrapTable.methods = BootstrapTable.METHODS;
  7899. $$q.fn.bootstrapTable.utils = Utils;
  7900. // BOOTSTRAP TABLE INIT
  7901. // =======================
  7902. $$q(function () {
  7903. $$q('[data-toggle="table"]').bootstrapTable();
  7904. });
  7905. return BootstrapTable;
  7906. }));