bootstrap-table.js 324 KB

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