bootstrap-table.js 322 KB

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