bootstrap-table.js 323 KB

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