bootstrap.bundle.js 207 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461
  1. /*!
  2. * Bootstrap v4.1.3 (https://getbootstrap.com/)
  3. * Copyright 2011-2018 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  4. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  5. */
  6. (function (global, factory) {
  7. typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery')) :
  8. typeof define === 'function' && define.amd ? define(['exports', 'jquery'], factory) :
  9. (factory((global.bootstrap = {}),global.jQuery));
  10. }(this, (function (exports,$) { 'use strict';
  11. $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
  12. function _defineProperties(target, props) {
  13. for (var i = 0; i < props.length; i++) {
  14. var descriptor = props[i];
  15. descriptor.enumerable = descriptor.enumerable || false;
  16. descriptor.configurable = true;
  17. if ("value" in descriptor) descriptor.writable = true;
  18. Object.defineProperty(target, descriptor.key, descriptor);
  19. }
  20. }
  21. function _createClass(Constructor, protoProps, staticProps) {
  22. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  23. if (staticProps) _defineProperties(Constructor, staticProps);
  24. return Constructor;
  25. }
  26. function _defineProperty(obj, key, value) {
  27. if (key in obj) {
  28. Object.defineProperty(obj, key, {
  29. value: value,
  30. enumerable: true,
  31. configurable: true,
  32. writable: true
  33. });
  34. } else {
  35. obj[key] = value;
  36. }
  37. return obj;
  38. }
  39. function _objectSpread(target) {
  40. for (var i = 1; i < arguments.length; i++) {
  41. var source = arguments[i] != null ? arguments[i] : {};
  42. var ownKeys = Object.keys(source);
  43. if (typeof Object.getOwnPropertySymbols === 'function') {
  44. ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
  45. return Object.getOwnPropertyDescriptor(source, sym).enumerable;
  46. }));
  47. }
  48. ownKeys.forEach(function (key) {
  49. _defineProperty(target, key, source[key]);
  50. });
  51. }
  52. return target;
  53. }
  54. function _inheritsLoose(subClass, superClass) {
  55. subClass.prototype = Object.create(superClass.prototype);
  56. subClass.prototype.constructor = subClass;
  57. subClass.__proto__ = superClass;
  58. }
  59. /**
  60. * --------------------------------------------------------------------------
  61. * Bootstrap (v4.1.3): util.js
  62. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  63. * --------------------------------------------------------------------------
  64. */
  65. var Util = function ($$$1) {
  66. /**
  67. * ------------------------------------------------------------------------
  68. * Private TransitionEnd Helpers
  69. * ------------------------------------------------------------------------
  70. */
  71. var TRANSITION_END = 'transitionend';
  72. var MAX_UID = 1000000;
  73. var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
  74. function toType(obj) {
  75. return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
  76. }
  77. function getSpecialTransitionEndEvent() {
  78. return {
  79. bindType: TRANSITION_END,
  80. delegateType: TRANSITION_END,
  81. handle: function handle(event) {
  82. if ($$$1(event.target).is(this)) {
  83. return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
  84. }
  85. return undefined; // eslint-disable-line no-undefined
  86. }
  87. };
  88. }
  89. function transitionEndEmulator(duration) {
  90. var _this = this;
  91. var called = false;
  92. $$$1(this).one(Util.TRANSITION_END, function () {
  93. called = true;
  94. });
  95. setTimeout(function () {
  96. if (!called) {
  97. Util.triggerTransitionEnd(_this);
  98. }
  99. }, duration);
  100. return this;
  101. }
  102. function setTransitionEndSupport() {
  103. $$$1.fn.emulateTransitionEnd = transitionEndEmulator;
  104. $$$1.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
  105. }
  106. /**
  107. * --------------------------------------------------------------------------
  108. * Public Util Api
  109. * --------------------------------------------------------------------------
  110. */
  111. var Util = {
  112. TRANSITION_END: 'bsTransitionEnd',
  113. getUID: function getUID(prefix) {
  114. do {
  115. // eslint-disable-next-line no-bitwise
  116. prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
  117. } while (document.getElementById(prefix));
  118. return prefix;
  119. },
  120. getSelectorFromElement: function getSelectorFromElement(element) {
  121. var selector = element.getAttribute('data-target');
  122. if (!selector || selector === '#') {
  123. selector = element.getAttribute('href') || '';
  124. }
  125. try {
  126. return document.querySelector(selector) ? selector : null;
  127. } catch (err) {
  128. return null;
  129. }
  130. },
  131. getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {
  132. if (!element) {
  133. return 0;
  134. } // Get transition-duration of the element
  135. var transitionDuration = $$$1(element).css('transition-duration');
  136. var floatTransitionDuration = parseFloat(transitionDuration); // Return 0 if element or transition duration is not found
  137. if (!floatTransitionDuration) {
  138. return 0;
  139. } // If multiple durations are defined, take the first
  140. transitionDuration = transitionDuration.split(',')[0];
  141. return parseFloat(transitionDuration) * MILLISECONDS_MULTIPLIER;
  142. },
  143. reflow: function reflow(element) {
  144. return element.offsetHeight;
  145. },
  146. triggerTransitionEnd: function triggerTransitionEnd(element) {
  147. $$$1(element).trigger(TRANSITION_END);
  148. },
  149. // TODO: Remove in v5
  150. supportsTransitionEnd: function supportsTransitionEnd() {
  151. return Boolean(TRANSITION_END);
  152. },
  153. isElement: function isElement(obj) {
  154. return (obj[0] || obj).nodeType;
  155. },
  156. typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
  157. for (var property in configTypes) {
  158. if (Object.prototype.hasOwnProperty.call(configTypes, property)) {
  159. var expectedTypes = configTypes[property];
  160. var value = config[property];
  161. var valueType = value && Util.isElement(value) ? 'element' : toType(value);
  162. if (!new RegExp(expectedTypes).test(valueType)) {
  163. throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
  164. }
  165. }
  166. }
  167. }
  168. };
  169. setTransitionEndSupport();
  170. return Util;
  171. }($);
  172. /**
  173. * --------------------------------------------------------------------------
  174. * Bootstrap (v4.1.3): alert.js
  175. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  176. * --------------------------------------------------------------------------
  177. */
  178. var Alert = function ($$$1) {
  179. /**
  180. * ------------------------------------------------------------------------
  181. * Constants
  182. * ------------------------------------------------------------------------
  183. */
  184. var NAME = 'alert';
  185. var VERSION = '4.1.3';
  186. var DATA_KEY = 'bs.alert';
  187. var EVENT_KEY = "." + DATA_KEY;
  188. var DATA_API_KEY = '.data-api';
  189. var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
  190. var Selector = {
  191. DISMISS: '[data-dismiss="alert"]'
  192. };
  193. var Event = {
  194. CLOSE: "close" + EVENT_KEY,
  195. CLOSED: "closed" + EVENT_KEY,
  196. CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
  197. };
  198. var ClassName = {
  199. ALERT: 'alert',
  200. FADE: 'fade',
  201. SHOW: 'show'
  202. /**
  203. * ------------------------------------------------------------------------
  204. * Class Definition
  205. * ------------------------------------------------------------------------
  206. */
  207. };
  208. var Alert =
  209. /*#__PURE__*/
  210. function () {
  211. function Alert(element) {
  212. this._element = element;
  213. } // Getters
  214. var _proto = Alert.prototype;
  215. // Public
  216. _proto.close = function close(element) {
  217. var rootElement = this._element;
  218. if (element) {
  219. rootElement = this._getRootElement(element);
  220. }
  221. var customEvent = this._triggerCloseEvent(rootElement);
  222. if (customEvent.isDefaultPrevented()) {
  223. return;
  224. }
  225. this._removeElement(rootElement);
  226. };
  227. _proto.dispose = function dispose() {
  228. $$$1.removeData(this._element, DATA_KEY);
  229. this._element = null;
  230. }; // Private
  231. _proto._getRootElement = function _getRootElement(element) {
  232. var selector = Util.getSelectorFromElement(element);
  233. var parent = false;
  234. if (selector) {
  235. parent = document.querySelector(selector);
  236. }
  237. if (!parent) {
  238. parent = $$$1(element).closest("." + ClassName.ALERT)[0];
  239. }
  240. return parent;
  241. };
  242. _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
  243. var closeEvent = $$$1.Event(Event.CLOSE);
  244. $$$1(element).trigger(closeEvent);
  245. return closeEvent;
  246. };
  247. _proto._removeElement = function _removeElement(element) {
  248. var _this = this;
  249. $$$1(element).removeClass(ClassName.SHOW);
  250. if (!$$$1(element).hasClass(ClassName.FADE)) {
  251. this._destroyElement(element);
  252. return;
  253. }
  254. var transitionDuration = Util.getTransitionDurationFromElement(element);
  255. $$$1(element).one(Util.TRANSITION_END, function (event) {
  256. return _this._destroyElement(element, event);
  257. }).emulateTransitionEnd(transitionDuration);
  258. };
  259. _proto._destroyElement = function _destroyElement(element) {
  260. $$$1(element).detach().trigger(Event.CLOSED).remove();
  261. }; // Static
  262. Alert._jQueryInterface = function _jQueryInterface(config) {
  263. return this.each(function () {
  264. var $element = $$$1(this);
  265. var data = $element.data(DATA_KEY);
  266. if (!data) {
  267. data = new Alert(this);
  268. $element.data(DATA_KEY, data);
  269. }
  270. if (config === 'close') {
  271. data[config](this);
  272. }
  273. });
  274. };
  275. Alert._handleDismiss = function _handleDismiss(alertInstance) {
  276. return function (event) {
  277. if (event) {
  278. event.preventDefault();
  279. }
  280. alertInstance.close(this);
  281. };
  282. };
  283. _createClass(Alert, null, [{
  284. key: "VERSION",
  285. get: function get() {
  286. return VERSION;
  287. }
  288. }]);
  289. return Alert;
  290. }();
  291. /**
  292. * ------------------------------------------------------------------------
  293. * Data Api implementation
  294. * ------------------------------------------------------------------------
  295. */
  296. $$$1(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
  297. /**
  298. * ------------------------------------------------------------------------
  299. * jQuery
  300. * ------------------------------------------------------------------------
  301. */
  302. $$$1.fn[NAME] = Alert._jQueryInterface;
  303. $$$1.fn[NAME].Constructor = Alert;
  304. $$$1.fn[NAME].noConflict = function () {
  305. $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
  306. return Alert._jQueryInterface;
  307. };
  308. return Alert;
  309. }($);
  310. /**
  311. * --------------------------------------------------------------------------
  312. * Bootstrap (v4.1.3): button.js
  313. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  314. * --------------------------------------------------------------------------
  315. */
  316. var Button = function ($$$1) {
  317. /**
  318. * ------------------------------------------------------------------------
  319. * Constants
  320. * ------------------------------------------------------------------------
  321. */
  322. var NAME = 'button';
  323. var VERSION = '4.1.3';
  324. var DATA_KEY = 'bs.button';
  325. var EVENT_KEY = "." + DATA_KEY;
  326. var DATA_API_KEY = '.data-api';
  327. var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
  328. var ClassName = {
  329. ACTIVE: 'active',
  330. BUTTON: 'btn',
  331. FOCUS: 'focus'
  332. };
  333. var Selector = {
  334. DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
  335. DATA_TOGGLE: '[data-toggle="buttons"]',
  336. INPUT: 'input',
  337. ACTIVE: '.active',
  338. BUTTON: '.btn'
  339. };
  340. var Event = {
  341. CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY,
  342. FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY + DATA_API_KEY + " " + ("blur" + EVENT_KEY + DATA_API_KEY)
  343. /**
  344. * ------------------------------------------------------------------------
  345. * Class Definition
  346. * ------------------------------------------------------------------------
  347. */
  348. };
  349. var Button =
  350. /*#__PURE__*/
  351. function () {
  352. function Button(element) {
  353. this._element = element;
  354. } // Getters
  355. var _proto = Button.prototype;
  356. // Public
  357. _proto.toggle = function toggle() {
  358. var triggerChangeEvent = true;
  359. var addAriaPressed = true;
  360. var rootElement = $$$1(this._element).closest(Selector.DATA_TOGGLE)[0];
  361. if (rootElement) {
  362. var input = this._element.querySelector(Selector.INPUT);
  363. if (input) {
  364. if (input.type === 'radio') {
  365. if (input.checked && this._element.classList.contains(ClassName.ACTIVE)) {
  366. triggerChangeEvent = false;
  367. } else {
  368. var activeElement = rootElement.querySelector(Selector.ACTIVE);
  369. if (activeElement) {
  370. $$$1(activeElement).removeClass(ClassName.ACTIVE);
  371. }
  372. }
  373. }
  374. if (triggerChangeEvent) {
  375. if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) {
  376. return;
  377. }
  378. input.checked = !this._element.classList.contains(ClassName.ACTIVE);
  379. $$$1(input).trigger('change');
  380. }
  381. input.focus();
  382. addAriaPressed = false;
  383. }
  384. }
  385. if (addAriaPressed) {
  386. this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName.ACTIVE));
  387. }
  388. if (triggerChangeEvent) {
  389. $$$1(this._element).toggleClass(ClassName.ACTIVE);
  390. }
  391. };
  392. _proto.dispose = function dispose() {
  393. $$$1.removeData(this._element, DATA_KEY);
  394. this._element = null;
  395. }; // Static
  396. Button._jQueryInterface = function _jQueryInterface(config) {
  397. return this.each(function () {
  398. var data = $$$1(this).data(DATA_KEY);
  399. if (!data) {
  400. data = new Button(this);
  401. $$$1(this).data(DATA_KEY, data);
  402. }
  403. if (config === 'toggle') {
  404. data[config]();
  405. }
  406. });
  407. };
  408. _createClass(Button, null, [{
  409. key: "VERSION",
  410. get: function get() {
  411. return VERSION;
  412. }
  413. }]);
  414. return Button;
  415. }();
  416. /**
  417. * ------------------------------------------------------------------------
  418. * Data Api implementation
  419. * ------------------------------------------------------------------------
  420. */
  421. $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
  422. event.preventDefault();
  423. var button = event.target;
  424. if (!$$$1(button).hasClass(ClassName.BUTTON)) {
  425. button = $$$1(button).closest(Selector.BUTTON);
  426. }
  427. Button._jQueryInterface.call($$$1(button), 'toggle');
  428. }).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
  429. var button = $$$1(event.target).closest(Selector.BUTTON)[0];
  430. $$$1(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type));
  431. });
  432. /**
  433. * ------------------------------------------------------------------------
  434. * jQuery
  435. * ------------------------------------------------------------------------
  436. */
  437. $$$1.fn[NAME] = Button._jQueryInterface;
  438. $$$1.fn[NAME].Constructor = Button;
  439. $$$1.fn[NAME].noConflict = function () {
  440. $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
  441. return Button._jQueryInterface;
  442. };
  443. return Button;
  444. }($);
  445. /**
  446. * --------------------------------------------------------------------------
  447. * Bootstrap (v4.1.3): carousel.js
  448. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  449. * --------------------------------------------------------------------------
  450. */
  451. var Carousel = function ($$$1) {
  452. /**
  453. * ------------------------------------------------------------------------
  454. * Constants
  455. * ------------------------------------------------------------------------
  456. */
  457. var NAME = 'carousel';
  458. var VERSION = '4.1.3';
  459. var DATA_KEY = 'bs.carousel';
  460. var EVENT_KEY = "." + DATA_KEY;
  461. var DATA_API_KEY = '.data-api';
  462. var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
  463. var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
  464. var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
  465. var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
  466. var Default = {
  467. interval: 5000,
  468. keyboard: true,
  469. slide: false,
  470. pause: 'hover',
  471. wrap: true
  472. };
  473. var DefaultType = {
  474. interval: '(number|boolean)',
  475. keyboard: 'boolean',
  476. slide: '(boolean|string)',
  477. pause: '(string|boolean)',
  478. wrap: 'boolean'
  479. };
  480. var Direction = {
  481. NEXT: 'next',
  482. PREV: 'prev',
  483. LEFT: 'left',
  484. RIGHT: 'right'
  485. };
  486. var Event = {
  487. SLIDE: "slide" + EVENT_KEY,
  488. SLID: "slid" + EVENT_KEY,
  489. KEYDOWN: "keydown" + EVENT_KEY,
  490. MOUSEENTER: "mouseenter" + EVENT_KEY,
  491. MOUSELEAVE: "mouseleave" + EVENT_KEY,
  492. TOUCHEND: "touchend" + EVENT_KEY,
  493. LOAD_DATA_API: "load" + EVENT_KEY + DATA_API_KEY,
  494. CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
  495. };
  496. var ClassName = {
  497. CAROUSEL: 'carousel',
  498. ACTIVE: 'active',
  499. SLIDE: 'slide',
  500. RIGHT: 'carousel-item-right',
  501. LEFT: 'carousel-item-left',
  502. NEXT: 'carousel-item-next',
  503. PREV: 'carousel-item-prev',
  504. ITEM: 'carousel-item'
  505. };
  506. var Selector = {
  507. ACTIVE: '.active',
  508. ACTIVE_ITEM: '.active.carousel-item',
  509. ITEM: '.carousel-item',
  510. NEXT_PREV: '.carousel-item-next, .carousel-item-prev',
  511. INDICATORS: '.carousel-indicators',
  512. DATA_SLIDE: '[data-slide], [data-slide-to]',
  513. DATA_RIDE: '[data-ride="carousel"]'
  514. /**
  515. * ------------------------------------------------------------------------
  516. * Class Definition
  517. * ------------------------------------------------------------------------
  518. */
  519. };
  520. var Carousel =
  521. /*#__PURE__*/
  522. function () {
  523. function Carousel(element, config) {
  524. this._items = null;
  525. this._interval = null;
  526. this._activeElement = null;
  527. this._isPaused = false;
  528. this._isSliding = false;
  529. this.touchTimeout = null;
  530. this._config = this._getConfig(config);
  531. this._element = $$$1(element)[0];
  532. this._indicatorsElement = this._element.querySelector(Selector.INDICATORS);
  533. this._addEventListeners();
  534. } // Getters
  535. var _proto = Carousel.prototype;
  536. // Public
  537. _proto.next = function next() {
  538. if (!this._isSliding) {
  539. this._slide(Direction.NEXT);
  540. }
  541. };
  542. _proto.nextWhenVisible = function nextWhenVisible() {
  543. // Don't call next when the page isn't visible
  544. // or the carousel or its parent isn't visible
  545. if (!document.hidden && $$$1(this._element).is(':visible') && $$$1(this._element).css('visibility') !== 'hidden') {
  546. this.next();
  547. }
  548. };
  549. _proto.prev = function prev() {
  550. if (!this._isSliding) {
  551. this._slide(Direction.PREV);
  552. }
  553. };
  554. _proto.pause = function pause(event) {
  555. if (!event) {
  556. this._isPaused = true;
  557. }
  558. if (this._element.querySelector(Selector.NEXT_PREV)) {
  559. Util.triggerTransitionEnd(this._element);
  560. this.cycle(true);
  561. }
  562. clearInterval(this._interval);
  563. this._interval = null;
  564. };
  565. _proto.cycle = function cycle(event) {
  566. if (!event) {
  567. this._isPaused = false;
  568. }
  569. if (this._interval) {
  570. clearInterval(this._interval);
  571. this._interval = null;
  572. }
  573. if (this._config.interval && !this._isPaused) {
  574. this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
  575. }
  576. };
  577. _proto.to = function to(index) {
  578. var _this = this;
  579. this._activeElement = this._element.querySelector(Selector.ACTIVE_ITEM);
  580. var activeIndex = this._getItemIndex(this._activeElement);
  581. if (index > this._items.length - 1 || index < 0) {
  582. return;
  583. }
  584. if (this._isSliding) {
  585. $$$1(this._element).one(Event.SLID, function () {
  586. return _this.to(index);
  587. });
  588. return;
  589. }
  590. if (activeIndex === index) {
  591. this.pause();
  592. this.cycle();
  593. return;
  594. }
  595. var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;
  596. this._slide(direction, this._items[index]);
  597. };
  598. _proto.dispose = function dispose() {
  599. $$$1(this._element).off(EVENT_KEY);
  600. $$$1.removeData(this._element, DATA_KEY);
  601. this._items = null;
  602. this._config = null;
  603. this._element = null;
  604. this._interval = null;
  605. this._isPaused = null;
  606. this._isSliding = null;
  607. this._activeElement = null;
  608. this._indicatorsElement = null;
  609. }; // Private
  610. _proto._getConfig = function _getConfig(config) {
  611. config = _objectSpread({}, Default, config);
  612. Util.typeCheckConfig(NAME, config, DefaultType);
  613. return config;
  614. };
  615. _proto._addEventListeners = function _addEventListeners() {
  616. var _this2 = this;
  617. if (this._config.keyboard) {
  618. $$$1(this._element).on(Event.KEYDOWN, function (event) {
  619. return _this2._keydown(event);
  620. });
  621. }
  622. if (this._config.pause === 'hover') {
  623. $$$1(this._element).on(Event.MOUSEENTER, function (event) {
  624. return _this2.pause(event);
  625. }).on(Event.MOUSELEAVE, function (event) {
  626. return _this2.cycle(event);
  627. });
  628. if ('ontouchstart' in document.documentElement) {
  629. // If it's a touch-enabled device, mouseenter/leave are fired as
  630. // part of the mouse compatibility events on first tap - the carousel
  631. // would stop cycling until user tapped out of it;
  632. // here, we listen for touchend, explicitly pause the carousel
  633. // (as if it's the second time we tap on it, mouseenter compat event
  634. // is NOT fired) and after a timeout (to allow for mouse compatibility
  635. // events to fire) we explicitly restart cycling
  636. $$$1(this._element).on(Event.TOUCHEND, function () {
  637. _this2.pause();
  638. if (_this2.touchTimeout) {
  639. clearTimeout(_this2.touchTimeout);
  640. }
  641. _this2.touchTimeout = setTimeout(function (event) {
  642. return _this2.cycle(event);
  643. }, TOUCHEVENT_COMPAT_WAIT + _this2._config.interval);
  644. });
  645. }
  646. }
  647. };
  648. _proto._keydown = function _keydown(event) {
  649. if (/input|textarea/i.test(event.target.tagName)) {
  650. return;
  651. }
  652. switch (event.which) {
  653. case ARROW_LEFT_KEYCODE:
  654. event.preventDefault();
  655. this.prev();
  656. break;
  657. case ARROW_RIGHT_KEYCODE:
  658. event.preventDefault();
  659. this.next();
  660. break;
  661. default:
  662. }
  663. };
  664. _proto._getItemIndex = function _getItemIndex(element) {
  665. this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector.ITEM)) : [];
  666. return this._items.indexOf(element);
  667. };
  668. _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
  669. var isNextDirection = direction === Direction.NEXT;
  670. var isPrevDirection = direction === Direction.PREV;
  671. var activeIndex = this._getItemIndex(activeElement);
  672. var lastItemIndex = this._items.length - 1;
  673. var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
  674. if (isGoingToWrap && !this._config.wrap) {
  675. return activeElement;
  676. }
  677. var delta = direction === Direction.PREV ? -1 : 1;
  678. var itemIndex = (activeIndex + delta) % this._items.length;
  679. return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
  680. };
  681. _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
  682. var targetIndex = this._getItemIndex(relatedTarget);
  683. var fromIndex = this._getItemIndex(this._element.querySelector(Selector.ACTIVE_ITEM));
  684. var slideEvent = $$$1.Event(Event.SLIDE, {
  685. relatedTarget: relatedTarget,
  686. direction: eventDirectionName,
  687. from: fromIndex,
  688. to: targetIndex
  689. });
  690. $$$1(this._element).trigger(slideEvent);
  691. return slideEvent;
  692. };
  693. _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
  694. if (this._indicatorsElement) {
  695. var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector.ACTIVE));
  696. $$$1(indicators).removeClass(ClassName.ACTIVE);
  697. var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
  698. if (nextIndicator) {
  699. $$$1(nextIndicator).addClass(ClassName.ACTIVE);
  700. }
  701. }
  702. };
  703. _proto._slide = function _slide(direction, element) {
  704. var _this3 = this;
  705. var activeElement = this._element.querySelector(Selector.ACTIVE_ITEM);
  706. var activeElementIndex = this._getItemIndex(activeElement);
  707. var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
  708. var nextElementIndex = this._getItemIndex(nextElement);
  709. var isCycling = Boolean(this._interval);
  710. var directionalClassName;
  711. var orderClassName;
  712. var eventDirectionName;
  713. if (direction === Direction.NEXT) {
  714. directionalClassName = ClassName.LEFT;
  715. orderClassName = ClassName.NEXT;
  716. eventDirectionName = Direction.LEFT;
  717. } else {
  718. directionalClassName = ClassName.RIGHT;
  719. orderClassName = ClassName.PREV;
  720. eventDirectionName = Direction.RIGHT;
  721. }
  722. if (nextElement && $$$1(nextElement).hasClass(ClassName.ACTIVE)) {
  723. this._isSliding = false;
  724. return;
  725. }
  726. var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
  727. if (slideEvent.isDefaultPrevented()) {
  728. return;
  729. }
  730. if (!activeElement || !nextElement) {
  731. // Some weirdness is happening, so we bail
  732. return;
  733. }
  734. this._isSliding = true;
  735. if (isCycling) {
  736. this.pause();
  737. }
  738. this._setActiveIndicatorElement(nextElement);
  739. var slidEvent = $$$1.Event(Event.SLID, {
  740. relatedTarget: nextElement,
  741. direction: eventDirectionName,
  742. from: activeElementIndex,
  743. to: nextElementIndex
  744. });
  745. if ($$$1(this._element).hasClass(ClassName.SLIDE)) {
  746. $$$1(nextElement).addClass(orderClassName);
  747. Util.reflow(nextElement);
  748. $$$1(activeElement).addClass(directionalClassName);
  749. $$$1(nextElement).addClass(directionalClassName);
  750. var transitionDuration = Util.getTransitionDurationFromElement(activeElement);
  751. $$$1(activeElement).one(Util.TRANSITION_END, function () {
  752. $$$1(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName.ACTIVE);
  753. $$$1(activeElement).removeClass(ClassName.ACTIVE + " " + orderClassName + " " + directionalClassName);
  754. _this3._isSliding = false;
  755. setTimeout(function () {
  756. return $$$1(_this3._element).trigger(slidEvent);
  757. }, 0);
  758. }).emulateTransitionEnd(transitionDuration);
  759. } else {
  760. $$$1(activeElement).removeClass(ClassName.ACTIVE);
  761. $$$1(nextElement).addClass(ClassName.ACTIVE);
  762. this._isSliding = false;
  763. $$$1(this._element).trigger(slidEvent);
  764. }
  765. if (isCycling) {
  766. this.cycle();
  767. }
  768. }; // Static
  769. Carousel._jQueryInterface = function _jQueryInterface(config) {
  770. return this.each(function () {
  771. var data = $$$1(this).data(DATA_KEY);
  772. var _config = _objectSpread({}, Default, $$$1(this).data());
  773. if (typeof config === 'object') {
  774. _config = _objectSpread({}, _config, config);
  775. }
  776. var action = typeof config === 'string' ? config : _config.slide;
  777. if (!data) {
  778. data = new Carousel(this, _config);
  779. $$$1(this).data(DATA_KEY, data);
  780. }
  781. if (typeof config === 'number') {
  782. data.to(config);
  783. } else if (typeof action === 'string') {
  784. if (typeof data[action] === 'undefined') {
  785. throw new TypeError("No method named \"" + action + "\"");
  786. }
  787. data[action]();
  788. } else if (_config.interval) {
  789. data.pause();
  790. data.cycle();
  791. }
  792. });
  793. };
  794. Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
  795. var selector = Util.getSelectorFromElement(this);
  796. if (!selector) {
  797. return;
  798. }
  799. var target = $$$1(selector)[0];
  800. if (!target || !$$$1(target).hasClass(ClassName.CAROUSEL)) {
  801. return;
  802. }
  803. var config = _objectSpread({}, $$$1(target).data(), $$$1(this).data());
  804. var slideIndex = this.getAttribute('data-slide-to');
  805. if (slideIndex) {
  806. config.interval = false;
  807. }
  808. Carousel._jQueryInterface.call($$$1(target), config);
  809. if (slideIndex) {
  810. $$$1(target).data(DATA_KEY).to(slideIndex);
  811. }
  812. event.preventDefault();
  813. };
  814. _createClass(Carousel, null, [{
  815. key: "VERSION",
  816. get: function get() {
  817. return VERSION;
  818. }
  819. }, {
  820. key: "Default",
  821. get: function get() {
  822. return Default;
  823. }
  824. }]);
  825. return Carousel;
  826. }();
  827. /**
  828. * ------------------------------------------------------------------------
  829. * Data Api implementation
  830. * ------------------------------------------------------------------------
  831. */
  832. $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler);
  833. $$$1(window).on(Event.LOAD_DATA_API, function () {
  834. var carousels = [].slice.call(document.querySelectorAll(Selector.DATA_RIDE));
  835. for (var i = 0, len = carousels.length; i < len; i++) {
  836. var $carousel = $$$1(carousels[i]);
  837. Carousel._jQueryInterface.call($carousel, $carousel.data());
  838. }
  839. });
  840. /**
  841. * ------------------------------------------------------------------------
  842. * jQuery
  843. * ------------------------------------------------------------------------
  844. */
  845. $$$1.fn[NAME] = Carousel._jQueryInterface;
  846. $$$1.fn[NAME].Constructor = Carousel;
  847. $$$1.fn[NAME].noConflict = function () {
  848. $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
  849. return Carousel._jQueryInterface;
  850. };
  851. return Carousel;
  852. }($);
  853. /**
  854. * --------------------------------------------------------------------------
  855. * Bootstrap (v4.1.3): collapse.js
  856. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  857. * --------------------------------------------------------------------------
  858. */
  859. var Collapse = function ($$$1) {
  860. /**
  861. * ------------------------------------------------------------------------
  862. * Constants
  863. * ------------------------------------------------------------------------
  864. */
  865. var NAME = 'collapse';
  866. var VERSION = '4.1.3';
  867. var DATA_KEY = 'bs.collapse';
  868. var EVENT_KEY = "." + DATA_KEY;
  869. var DATA_API_KEY = '.data-api';
  870. var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
  871. var Default = {
  872. toggle: true,
  873. parent: ''
  874. };
  875. var DefaultType = {
  876. toggle: 'boolean',
  877. parent: '(string|element)'
  878. };
  879. var Event = {
  880. SHOW: "show" + EVENT_KEY,
  881. SHOWN: "shown" + EVENT_KEY,
  882. HIDE: "hide" + EVENT_KEY,
  883. HIDDEN: "hidden" + EVENT_KEY,
  884. CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
  885. };
  886. var ClassName = {
  887. SHOW: 'show',
  888. COLLAPSE: 'collapse',
  889. COLLAPSING: 'collapsing',
  890. COLLAPSED: 'collapsed'
  891. };
  892. var Dimension = {
  893. WIDTH: 'width',
  894. HEIGHT: 'height'
  895. };
  896. var Selector = {
  897. ACTIVES: '.show, .collapsing',
  898. DATA_TOGGLE: '[data-toggle="collapse"]'
  899. /**
  900. * ------------------------------------------------------------------------
  901. * Class Definition
  902. * ------------------------------------------------------------------------
  903. */
  904. };
  905. var Collapse =
  906. /*#__PURE__*/
  907. function () {
  908. function Collapse(element, config) {
  909. this._isTransitioning = false;
  910. this._element = element;
  911. this._config = this._getConfig(config);
  912. this._triggerArray = $$$1.makeArray(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));
  913. var toggleList = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE));
  914. for (var i = 0, len = toggleList.length; i < len; i++) {
  915. var elem = toggleList[i];
  916. var selector = Util.getSelectorFromElement(elem);
  917. var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {
  918. return foundElem === element;
  919. });
  920. if (selector !== null && filterElement.length > 0) {
  921. this._selector = selector;
  922. this._triggerArray.push(elem);
  923. }
  924. }
  925. this._parent = this._config.parent ? this._getParent() : null;
  926. if (!this._config.parent) {
  927. this._addAriaAndCollapsedClass(this._element, this._triggerArray);
  928. }
  929. if (this._config.toggle) {
  930. this.toggle();
  931. }
  932. } // Getters
  933. var _proto = Collapse.prototype;
  934. // Public
  935. _proto.toggle = function toggle() {
  936. if ($$$1(this._element).hasClass(ClassName.SHOW)) {
  937. this.hide();
  938. } else {
  939. this.show();
  940. }
  941. };
  942. _proto.show = function show() {
  943. var _this = this;
  944. if (this._isTransitioning || $$$1(this._element).hasClass(ClassName.SHOW)) {
  945. return;
  946. }
  947. var actives;
  948. var activesData;
  949. if (this._parent) {
  950. actives = [].slice.call(this._parent.querySelectorAll(Selector.ACTIVES)).filter(function (elem) {
  951. return elem.getAttribute('data-parent') === _this._config.parent;
  952. });
  953. if (actives.length === 0) {
  954. actives = null;
  955. }
  956. }
  957. if (actives) {
  958. activesData = $$$1(actives).not(this._selector).data(DATA_KEY);
  959. if (activesData && activesData._isTransitioning) {
  960. return;
  961. }
  962. }
  963. var startEvent = $$$1.Event(Event.SHOW);
  964. $$$1(this._element).trigger(startEvent);
  965. if (startEvent.isDefaultPrevented()) {
  966. return;
  967. }
  968. if (actives) {
  969. Collapse._jQueryInterface.call($$$1(actives).not(this._selector), 'hide');
  970. if (!activesData) {
  971. $$$1(actives).data(DATA_KEY, null);
  972. }
  973. }
  974. var dimension = this._getDimension();
  975. $$$1(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING);
  976. this._element.style[dimension] = 0;
  977. if (this._triggerArray.length) {
  978. $$$1(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true);
  979. }
  980. this.setTransitioning(true);
  981. var complete = function complete() {
  982. $$$1(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.SHOW);
  983. _this._element.style[dimension] = '';
  984. _this.setTransitioning(false);
  985. $$$1(_this._element).trigger(Event.SHOWN);
  986. };
  987. var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
  988. var scrollSize = "scroll" + capitalizedDimension;
  989. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  990. $$$1(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  991. this._element.style[dimension] = this._element[scrollSize] + "px";
  992. };
  993. _proto.hide = function hide() {
  994. var _this2 = this;
  995. if (this._isTransitioning || !$$$1(this._element).hasClass(ClassName.SHOW)) {
  996. return;
  997. }
  998. var startEvent = $$$1.Event(Event.HIDE);
  999. $$$1(this._element).trigger(startEvent);
  1000. if (startEvent.isDefaultPrevented()) {
  1001. return;
  1002. }
  1003. var dimension = this._getDimension();
  1004. this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
  1005. Util.reflow(this._element);
  1006. $$$1(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW);
  1007. var triggerArrayLength = this._triggerArray.length;
  1008. if (triggerArrayLength > 0) {
  1009. for (var i = 0; i < triggerArrayLength; i++) {
  1010. var trigger = this._triggerArray[i];
  1011. var selector = Util.getSelectorFromElement(trigger);
  1012. if (selector !== null) {
  1013. var $elem = $$$1([].slice.call(document.querySelectorAll(selector)));
  1014. if (!$elem.hasClass(ClassName.SHOW)) {
  1015. $$$1(trigger).addClass(ClassName.COLLAPSED).attr('aria-expanded', false);
  1016. }
  1017. }
  1018. }
  1019. }
  1020. this.setTransitioning(true);
  1021. var complete = function complete() {
  1022. _this2.setTransitioning(false);
  1023. $$$1(_this2._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN);
  1024. };
  1025. this._element.style[dimension] = '';
  1026. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  1027. $$$1(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  1028. };
  1029. _proto.setTransitioning = function setTransitioning(isTransitioning) {
  1030. this._isTransitioning = isTransitioning;
  1031. };
  1032. _proto.dispose = function dispose() {
  1033. $$$1.removeData(this._element, DATA_KEY);
  1034. this._config = null;
  1035. this._parent = null;
  1036. this._element = null;
  1037. this._triggerArray = null;
  1038. this._isTransitioning = null;
  1039. }; // Private
  1040. _proto._getConfig = function _getConfig(config) {
  1041. config = _objectSpread({}, Default, config);
  1042. config.toggle = Boolean(config.toggle); // Coerce string values
  1043. Util.typeCheckConfig(NAME, config, DefaultType);
  1044. return config;
  1045. };
  1046. _proto._getDimension = function _getDimension() {
  1047. var hasWidth = $$$1(this._element).hasClass(Dimension.WIDTH);
  1048. return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
  1049. };
  1050. _proto._getParent = function _getParent() {
  1051. var _this3 = this;
  1052. var parent = null;
  1053. if (Util.isElement(this._config.parent)) {
  1054. parent = this._config.parent; // It's a jQuery object
  1055. if (typeof this._config.parent.jquery !== 'undefined') {
  1056. parent = this._config.parent[0];
  1057. }
  1058. } else {
  1059. parent = document.querySelector(this._config.parent);
  1060. }
  1061. var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]";
  1062. var children = [].slice.call(parent.querySelectorAll(selector));
  1063. $$$1(children).each(function (i, element) {
  1064. _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
  1065. });
  1066. return parent;
  1067. };
  1068. _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
  1069. if (element) {
  1070. var isOpen = $$$1(element).hasClass(ClassName.SHOW);
  1071. if (triggerArray.length) {
  1072. $$$1(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
  1073. }
  1074. }
  1075. }; // Static
  1076. Collapse._getTargetFromElement = function _getTargetFromElement(element) {
  1077. var selector = Util.getSelectorFromElement(element);
  1078. return selector ? document.querySelector(selector) : null;
  1079. };
  1080. Collapse._jQueryInterface = function _jQueryInterface(config) {
  1081. return this.each(function () {
  1082. var $this = $$$1(this);
  1083. var data = $this.data(DATA_KEY);
  1084. var _config = _objectSpread({}, Default, $this.data(), typeof config === 'object' && config ? config : {});
  1085. if (!data && _config.toggle && /show|hide/.test(config)) {
  1086. _config.toggle = false;
  1087. }
  1088. if (!data) {
  1089. data = new Collapse(this, _config);
  1090. $this.data(DATA_KEY, data);
  1091. }
  1092. if (typeof config === 'string') {
  1093. if (typeof data[config] === 'undefined') {
  1094. throw new TypeError("No method named \"" + config + "\"");
  1095. }
  1096. data[config]();
  1097. }
  1098. });
  1099. };
  1100. _createClass(Collapse, null, [{
  1101. key: "VERSION",
  1102. get: function get() {
  1103. return VERSION;
  1104. }
  1105. }, {
  1106. key: "Default",
  1107. get: function get() {
  1108. return Default;
  1109. }
  1110. }]);
  1111. return Collapse;
  1112. }();
  1113. /**
  1114. * ------------------------------------------------------------------------
  1115. * Data Api implementation
  1116. * ------------------------------------------------------------------------
  1117. */
  1118. $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
  1119. // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
  1120. if (event.currentTarget.tagName === 'A') {
  1121. event.preventDefault();
  1122. }
  1123. var $trigger = $$$1(this);
  1124. var selector = Util.getSelectorFromElement(this);
  1125. var selectors = [].slice.call(document.querySelectorAll(selector));
  1126. $$$1(selectors).each(function () {
  1127. var $target = $$$1(this);
  1128. var data = $target.data(DATA_KEY);
  1129. var config = data ? 'toggle' : $trigger.data();
  1130. Collapse._jQueryInterface.call($target, config);
  1131. });
  1132. });
  1133. /**
  1134. * ------------------------------------------------------------------------
  1135. * jQuery
  1136. * ------------------------------------------------------------------------
  1137. */
  1138. $$$1.fn[NAME] = Collapse._jQueryInterface;
  1139. $$$1.fn[NAME].Constructor = Collapse;
  1140. $$$1.fn[NAME].noConflict = function () {
  1141. $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
  1142. return Collapse._jQueryInterface;
  1143. };
  1144. return Collapse;
  1145. }($);
  1146. /**!
  1147. * @fileOverview Kickass library to create and place poppers near their reference elements.
  1148. * @version 1.14.3
  1149. * @license
  1150. * Copyright (c) 2016 Federico Zivolo and contributors
  1151. *
  1152. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1153. * of this software and associated documentation files (the "Software"), to deal
  1154. * in the Software without restriction, including without limitation the rights
  1155. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1156. * copies of the Software, and to permit persons to whom the Software is
  1157. * furnished to do so, subject to the following conditions:
  1158. *
  1159. * The above copyright notice and this permission notice shall be included in all
  1160. * copies or substantial portions of the Software.
  1161. *
  1162. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1163. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1164. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1165. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1166. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1167. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  1168. * SOFTWARE.
  1169. */
  1170. var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
  1171. var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
  1172. var timeoutDuration = 0;
  1173. for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
  1174. if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
  1175. timeoutDuration = 1;
  1176. break;
  1177. }
  1178. }
  1179. function microtaskDebounce(fn) {
  1180. var called = false;
  1181. return function () {
  1182. if (called) {
  1183. return;
  1184. }
  1185. called = true;
  1186. window.Promise.resolve().then(function () {
  1187. called = false;
  1188. fn();
  1189. });
  1190. };
  1191. }
  1192. function taskDebounce(fn) {
  1193. var scheduled = false;
  1194. return function () {
  1195. if (!scheduled) {
  1196. scheduled = true;
  1197. setTimeout(function () {
  1198. scheduled = false;
  1199. fn();
  1200. }, timeoutDuration);
  1201. }
  1202. };
  1203. }
  1204. var supportsMicroTasks = isBrowser && window.Promise;
  1205. /**
  1206. * Create a debounced version of a method, that's asynchronously deferred
  1207. * but called in the minimum time possible.
  1208. *
  1209. * @method
  1210. * @memberof Popper.Utils
  1211. * @argument {Function} fn
  1212. * @returns {Function}
  1213. */
  1214. var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
  1215. /**
  1216. * Check if the given variable is a function
  1217. * @method
  1218. * @memberof Popper.Utils
  1219. * @argument {Any} functionToCheck - variable to check
  1220. * @returns {Boolean} answer to: is a function?
  1221. */
  1222. function isFunction(functionToCheck) {
  1223. var getType = {};
  1224. return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
  1225. }
  1226. /**
  1227. * Get CSS computed property of the given element
  1228. * @method
  1229. * @memberof Popper.Utils
  1230. * @argument {Eement} element
  1231. * @argument {String} property
  1232. */
  1233. function getStyleComputedProperty(element, property) {
  1234. if (element.nodeType !== 1) {
  1235. return [];
  1236. }
  1237. // NOTE: 1 DOM access here
  1238. var css = getComputedStyle(element, null);
  1239. return property ? css[property] : css;
  1240. }
  1241. /**
  1242. * Returns the parentNode or the host of the element
  1243. * @method
  1244. * @memberof Popper.Utils
  1245. * @argument {Element} element
  1246. * @returns {Element} parent
  1247. */
  1248. function getParentNode(element) {
  1249. if (element.nodeName === 'HTML') {
  1250. return element;
  1251. }
  1252. return element.parentNode || element.host;
  1253. }
  1254. /**
  1255. * Returns the scrolling parent of the given element
  1256. * @method
  1257. * @memberof Popper.Utils
  1258. * @argument {Element} element
  1259. * @returns {Element} scroll parent
  1260. */
  1261. function getScrollParent(element) {
  1262. // Return body, `getScroll` will take care to get the correct `scrollTop` from it
  1263. if (!element) {
  1264. return document.body;
  1265. }
  1266. switch (element.nodeName) {
  1267. case 'HTML':
  1268. case 'BODY':
  1269. return element.ownerDocument.body;
  1270. case '#document':
  1271. return element.body;
  1272. }
  1273. // Firefox want us to check `-x` and `-y` variations as well
  1274. var _getStyleComputedProp = getStyleComputedProperty(element),
  1275. overflow = _getStyleComputedProp.overflow,
  1276. overflowX = _getStyleComputedProp.overflowX,
  1277. overflowY = _getStyleComputedProp.overflowY;
  1278. if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
  1279. return element;
  1280. }
  1281. return getScrollParent(getParentNode(element));
  1282. }
  1283. var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
  1284. var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
  1285. /**
  1286. * Determines if the browser is Internet Explorer
  1287. * @method
  1288. * @memberof Popper.Utils
  1289. * @param {Number} version to check
  1290. * @returns {Boolean} isIE
  1291. */
  1292. function isIE(version) {
  1293. if (version === 11) {
  1294. return isIE11;
  1295. }
  1296. if (version === 10) {
  1297. return isIE10;
  1298. }
  1299. return isIE11 || isIE10;
  1300. }
  1301. /**
  1302. * Returns the offset parent of the given element
  1303. * @method
  1304. * @memberof Popper.Utils
  1305. * @argument {Element} element
  1306. * @returns {Element} offset parent
  1307. */
  1308. function getOffsetParent(element) {
  1309. if (!element) {
  1310. return document.documentElement;
  1311. }
  1312. var noOffsetParent = isIE(10) ? document.body : null;
  1313. // NOTE: 1 DOM access here
  1314. var offsetParent = element.offsetParent;
  1315. // Skip hidden elements which don't have an offsetParent
  1316. while (offsetParent === noOffsetParent && element.nextElementSibling) {
  1317. offsetParent = (element = element.nextElementSibling).offsetParent;
  1318. }
  1319. var nodeName = offsetParent && offsetParent.nodeName;
  1320. if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
  1321. return element ? element.ownerDocument.documentElement : document.documentElement;
  1322. }
  1323. // .offsetParent will return the closest TD or TABLE in case
  1324. // no offsetParent is present, I hate this job...
  1325. if (['TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
  1326. return getOffsetParent(offsetParent);
  1327. }
  1328. return offsetParent;
  1329. }
  1330. function isOffsetContainer(element) {
  1331. var nodeName = element.nodeName;
  1332. if (nodeName === 'BODY') {
  1333. return false;
  1334. }
  1335. return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
  1336. }
  1337. /**
  1338. * Finds the root node (document, shadowDOM root) of the given element
  1339. * @method
  1340. * @memberof Popper.Utils
  1341. * @argument {Element} node
  1342. * @returns {Element} root node
  1343. */
  1344. function getRoot(node) {
  1345. if (node.parentNode !== null) {
  1346. return getRoot(node.parentNode);
  1347. }
  1348. return node;
  1349. }
  1350. /**
  1351. * Finds the offset parent common to the two provided nodes
  1352. * @method
  1353. * @memberof Popper.Utils
  1354. * @argument {Element} element1
  1355. * @argument {Element} element2
  1356. * @returns {Element} common offset parent
  1357. */
  1358. function findCommonOffsetParent(element1, element2) {
  1359. // This check is needed to avoid errors in case one of the elements isn't defined for any reason
  1360. if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
  1361. return document.documentElement;
  1362. }
  1363. // Here we make sure to give as "start" the element that comes first in the DOM
  1364. var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
  1365. var start = order ? element1 : element2;
  1366. var end = order ? element2 : element1;
  1367. // Get common ancestor container
  1368. var range = document.createRange();
  1369. range.setStart(start, 0);
  1370. range.setEnd(end, 0);
  1371. var commonAncestorContainer = range.commonAncestorContainer;
  1372. // Both nodes are inside #document
  1373. if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
  1374. if (isOffsetContainer(commonAncestorContainer)) {
  1375. return commonAncestorContainer;
  1376. }
  1377. return getOffsetParent(commonAncestorContainer);
  1378. }
  1379. // one of the nodes is inside shadowDOM, find which one
  1380. var element1root = getRoot(element1);
  1381. if (element1root.host) {
  1382. return findCommonOffsetParent(element1root.host, element2);
  1383. } else {
  1384. return findCommonOffsetParent(element1, getRoot(element2).host);
  1385. }
  1386. }
  1387. /**
  1388. * Gets the scroll value of the given element in the given side (top and left)
  1389. * @method
  1390. * @memberof Popper.Utils
  1391. * @argument {Element} element
  1392. * @argument {String} side `top` or `left`
  1393. * @returns {number} amount of scrolled pixels
  1394. */
  1395. function getScroll(element) {
  1396. var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
  1397. var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
  1398. var nodeName = element.nodeName;
  1399. if (nodeName === 'BODY' || nodeName === 'HTML') {
  1400. var html = element.ownerDocument.documentElement;
  1401. var scrollingElement = element.ownerDocument.scrollingElement || html;
  1402. return scrollingElement[upperSide];
  1403. }
  1404. return element[upperSide];
  1405. }
  1406. /*
  1407. * Sum or subtract the element scroll values (left and top) from a given rect object
  1408. * @method
  1409. * @memberof Popper.Utils
  1410. * @param {Object} rect - Rect object you want to change
  1411. * @param {HTMLElement} element - The element from the function reads the scroll values
  1412. * @param {Boolean} subtract - set to true if you want to subtract the scroll values
  1413. * @return {Object} rect - The modifier rect object
  1414. */
  1415. function includeScroll(rect, element) {
  1416. var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  1417. var scrollTop = getScroll(element, 'top');
  1418. var scrollLeft = getScroll(element, 'left');
  1419. var modifier = subtract ? -1 : 1;
  1420. rect.top += scrollTop * modifier;
  1421. rect.bottom += scrollTop * modifier;
  1422. rect.left += scrollLeft * modifier;
  1423. rect.right += scrollLeft * modifier;
  1424. return rect;
  1425. }
  1426. /*
  1427. * Helper to detect borders of a given element
  1428. * @method
  1429. * @memberof Popper.Utils
  1430. * @param {CSSStyleDeclaration} styles
  1431. * Result of `getStyleComputedProperty` on the given element
  1432. * @param {String} axis - `x` or `y`
  1433. * @return {number} borders - The borders size of the given axis
  1434. */
  1435. function getBordersSize(styles, axis) {
  1436. var sideA = axis === 'x' ? 'Left' : 'Top';
  1437. var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
  1438. return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10);
  1439. }
  1440. function getSize(axis, body, html, computedStyle) {
  1441. return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? html['offset' + axis] + computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')] + computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')] : 0);
  1442. }
  1443. function getWindowSizes() {
  1444. var body = document.body;
  1445. var html = document.documentElement;
  1446. var computedStyle = isIE(10) && getComputedStyle(html);
  1447. return {
  1448. height: getSize('Height', body, html, computedStyle),
  1449. width: getSize('Width', body, html, computedStyle)
  1450. };
  1451. }
  1452. var classCallCheck = function (instance, Constructor) {
  1453. if (!(instance instanceof Constructor)) {
  1454. throw new TypeError("Cannot call a class as a function");
  1455. }
  1456. };
  1457. var createClass = function () {
  1458. function defineProperties(target, props) {
  1459. for (var i = 0; i < props.length; i++) {
  1460. var descriptor = props[i];
  1461. descriptor.enumerable = descriptor.enumerable || false;
  1462. descriptor.configurable = true;
  1463. if ("value" in descriptor) descriptor.writable = true;
  1464. Object.defineProperty(target, descriptor.key, descriptor);
  1465. }
  1466. }
  1467. return function (Constructor, protoProps, staticProps) {
  1468. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  1469. if (staticProps) defineProperties(Constructor, staticProps);
  1470. return Constructor;
  1471. };
  1472. }();
  1473. var defineProperty = function (obj, key, value) {
  1474. if (key in obj) {
  1475. Object.defineProperty(obj, key, {
  1476. value: value,
  1477. enumerable: true,
  1478. configurable: true,
  1479. writable: true
  1480. });
  1481. } else {
  1482. obj[key] = value;
  1483. }
  1484. return obj;
  1485. };
  1486. var _extends = Object.assign || function (target) {
  1487. for (var i = 1; i < arguments.length; i++) {
  1488. var source = arguments[i];
  1489. for (var key in source) {
  1490. if (Object.prototype.hasOwnProperty.call(source, key)) {
  1491. target[key] = source[key];
  1492. }
  1493. }
  1494. }
  1495. return target;
  1496. };
  1497. /**
  1498. * Given element offsets, generate an output similar to getBoundingClientRect
  1499. * @method
  1500. * @memberof Popper.Utils
  1501. * @argument {Object} offsets
  1502. * @returns {Object} ClientRect like output
  1503. */
  1504. function getClientRect(offsets) {
  1505. return _extends({}, offsets, {
  1506. right: offsets.left + offsets.width,
  1507. bottom: offsets.top + offsets.height
  1508. });
  1509. }
  1510. /**
  1511. * Get bounding client rect of given element
  1512. * @method
  1513. * @memberof Popper.Utils
  1514. * @param {HTMLElement} element
  1515. * @return {Object} client rect
  1516. */
  1517. function getBoundingClientRect(element) {
  1518. var rect = {};
  1519. // IE10 10 FIX: Please, don't ask, the element isn't
  1520. // considered in DOM in some circumstances...
  1521. // This isn't reproducible in IE10 compatibility mode of IE11
  1522. try {
  1523. if (isIE(10)) {
  1524. rect = element.getBoundingClientRect();
  1525. var scrollTop = getScroll(element, 'top');
  1526. var scrollLeft = getScroll(element, 'left');
  1527. rect.top += scrollTop;
  1528. rect.left += scrollLeft;
  1529. rect.bottom += scrollTop;
  1530. rect.right += scrollLeft;
  1531. } else {
  1532. rect = element.getBoundingClientRect();
  1533. }
  1534. } catch (e) {}
  1535. var result = {
  1536. left: rect.left,
  1537. top: rect.top,
  1538. width: rect.right - rect.left,
  1539. height: rect.bottom - rect.top
  1540. };
  1541. // subtract scrollbar size from sizes
  1542. var sizes = element.nodeName === 'HTML' ? getWindowSizes() : {};
  1543. var width = sizes.width || element.clientWidth || result.right - result.left;
  1544. var height = sizes.height || element.clientHeight || result.bottom - result.top;
  1545. var horizScrollbar = element.offsetWidth - width;
  1546. var vertScrollbar = element.offsetHeight - height;
  1547. // if an hypothetical scrollbar is detected, we must be sure it's not a `border`
  1548. // we make this check conditional for performance reasons
  1549. if (horizScrollbar || vertScrollbar) {
  1550. var styles = getStyleComputedProperty(element);
  1551. horizScrollbar -= getBordersSize(styles, 'x');
  1552. vertScrollbar -= getBordersSize(styles, 'y');
  1553. result.width -= horizScrollbar;
  1554. result.height -= vertScrollbar;
  1555. }
  1556. return getClientRect(result);
  1557. }
  1558. function getOffsetRectRelativeToArbitraryNode(children, parent) {
  1559. var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  1560. var isIE10 = isIE(10);
  1561. var isHTML = parent.nodeName === 'HTML';
  1562. var childrenRect = getBoundingClientRect(children);
  1563. var parentRect = getBoundingClientRect(parent);
  1564. var scrollParent = getScrollParent(children);
  1565. var styles = getStyleComputedProperty(parent);
  1566. var borderTopWidth = parseFloat(styles.borderTopWidth, 10);
  1567. var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10);
  1568. // In cases where the parent is fixed, we must ignore negative scroll in offset calc
  1569. if (fixedPosition && parent.nodeName === 'HTML') {
  1570. parentRect.top = Math.max(parentRect.top, 0);
  1571. parentRect.left = Math.max(parentRect.left, 0);
  1572. }
  1573. var offsets = getClientRect({
  1574. top: childrenRect.top - parentRect.top - borderTopWidth,
  1575. left: childrenRect.left - parentRect.left - borderLeftWidth,
  1576. width: childrenRect.width,
  1577. height: childrenRect.height
  1578. });
  1579. offsets.marginTop = 0;
  1580. offsets.marginLeft = 0;
  1581. // Subtract margins of documentElement in case it's being used as parent
  1582. // we do this only on HTML because it's the only element that behaves
  1583. // differently when margins are applied to it. The margins are included in
  1584. // the box of the documentElement, in the other cases not.
  1585. if (!isIE10 && isHTML) {
  1586. var marginTop = parseFloat(styles.marginTop, 10);
  1587. var marginLeft = parseFloat(styles.marginLeft, 10);
  1588. offsets.top -= borderTopWidth - marginTop;
  1589. offsets.bottom -= borderTopWidth - marginTop;
  1590. offsets.left -= borderLeftWidth - marginLeft;
  1591. offsets.right -= borderLeftWidth - marginLeft;
  1592. // Attach marginTop and marginLeft because in some circumstances we may need them
  1593. offsets.marginTop = marginTop;
  1594. offsets.marginLeft = marginLeft;
  1595. }
  1596. if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
  1597. offsets = includeScroll(offsets, parent);
  1598. }
  1599. return offsets;
  1600. }
  1601. function getViewportOffsetRectRelativeToArtbitraryNode(element) {
  1602. var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  1603. var html = element.ownerDocument.documentElement;
  1604. var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
  1605. var width = Math.max(html.clientWidth, window.innerWidth || 0);
  1606. var height = Math.max(html.clientHeight, window.innerHeight || 0);
  1607. var scrollTop = !excludeScroll ? getScroll(html) : 0;
  1608. var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;
  1609. var offset = {
  1610. top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
  1611. left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
  1612. width: width,
  1613. height: height
  1614. };
  1615. return getClientRect(offset);
  1616. }
  1617. /**
  1618. * Check if the given element is fixed or is inside a fixed parent
  1619. * @method
  1620. * @memberof Popper.Utils
  1621. * @argument {Element} element
  1622. * @argument {Element} customContainer
  1623. * @returns {Boolean} answer to "isFixed?"
  1624. */
  1625. function isFixed(element) {
  1626. var nodeName = element.nodeName;
  1627. if (nodeName === 'BODY' || nodeName === 'HTML') {
  1628. return false;
  1629. }
  1630. if (getStyleComputedProperty(element, 'position') === 'fixed') {
  1631. return true;
  1632. }
  1633. return isFixed(getParentNode(element));
  1634. }
  1635. /**
  1636. * Finds the first parent of an element that has a transformed property defined
  1637. * @method
  1638. * @memberof Popper.Utils
  1639. * @argument {Element} element
  1640. * @returns {Element} first transformed parent or documentElement
  1641. */
  1642. function getFixedPositionOffsetParent(element) {
  1643. // This check is needed to avoid errors in case one of the elements isn't defined for any reason
  1644. if (!element || !element.parentElement || isIE()) {
  1645. return document.documentElement;
  1646. }
  1647. var el = element.parentElement;
  1648. while (el && getStyleComputedProperty(el, 'transform') === 'none') {
  1649. el = el.parentElement;
  1650. }
  1651. return el || document.documentElement;
  1652. }
  1653. /**
  1654. * Computed the boundaries limits and return them
  1655. * @method
  1656. * @memberof Popper.Utils
  1657. * @param {HTMLElement} popper
  1658. * @param {HTMLElement} reference
  1659. * @param {number} padding
  1660. * @param {HTMLElement} boundariesElement - Element used to define the boundaries
  1661. * @param {Boolean} fixedPosition - Is in fixed position mode
  1662. * @returns {Object} Coordinates of the boundaries
  1663. */
  1664. function getBoundaries(popper, reference, padding, boundariesElement) {
  1665. var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  1666. // NOTE: 1 DOM access here
  1667. var boundaries = { top: 0, left: 0 };
  1668. var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
  1669. // Handle viewport case
  1670. if (boundariesElement === 'viewport') {
  1671. boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
  1672. } else {
  1673. // Handle other cases based on DOM element used as boundaries
  1674. var boundariesNode = void 0;
  1675. if (boundariesElement === 'scrollParent') {
  1676. boundariesNode = getScrollParent(getParentNode(reference));
  1677. if (boundariesNode.nodeName === 'BODY') {
  1678. boundariesNode = popper.ownerDocument.documentElement;
  1679. }
  1680. } else if (boundariesElement === 'window') {
  1681. boundariesNode = popper.ownerDocument.documentElement;
  1682. } else {
  1683. boundariesNode = boundariesElement;
  1684. }
  1685. var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
  1686. // In case of HTML, we need a different computation
  1687. if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
  1688. var _getWindowSizes = getWindowSizes(),
  1689. height = _getWindowSizes.height,
  1690. width = _getWindowSizes.width;
  1691. boundaries.top += offsets.top - offsets.marginTop;
  1692. boundaries.bottom = height + offsets.top;
  1693. boundaries.left += offsets.left - offsets.marginLeft;
  1694. boundaries.right = width + offsets.left;
  1695. } else {
  1696. // for all the other DOM elements, this one is good
  1697. boundaries = offsets;
  1698. }
  1699. }
  1700. // Add paddings
  1701. boundaries.left += padding;
  1702. boundaries.top += padding;
  1703. boundaries.right -= padding;
  1704. boundaries.bottom -= padding;
  1705. return boundaries;
  1706. }
  1707. function getArea(_ref) {
  1708. var width = _ref.width,
  1709. height = _ref.height;
  1710. return width * height;
  1711. }
  1712. /**
  1713. * Utility used to transform the `auto` placement to the placement with more
  1714. * available space.
  1715. * @method
  1716. * @memberof Popper.Utils
  1717. * @argument {Object} data - The data object generated by update method
  1718. * @argument {Object} options - Modifiers configuration and options
  1719. * @returns {Object} The data object, properly modified
  1720. */
  1721. function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
  1722. var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
  1723. if (placement.indexOf('auto') === -1) {
  1724. return placement;
  1725. }
  1726. var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
  1727. var rects = {
  1728. top: {
  1729. width: boundaries.width,
  1730. height: refRect.top - boundaries.top
  1731. },
  1732. right: {
  1733. width: boundaries.right - refRect.right,
  1734. height: boundaries.height
  1735. },
  1736. bottom: {
  1737. width: boundaries.width,
  1738. height: boundaries.bottom - refRect.bottom
  1739. },
  1740. left: {
  1741. width: refRect.left - boundaries.left,
  1742. height: boundaries.height
  1743. }
  1744. };
  1745. var sortedAreas = Object.keys(rects).map(function (key) {
  1746. return _extends({
  1747. key: key
  1748. }, rects[key], {
  1749. area: getArea(rects[key])
  1750. });
  1751. }).sort(function (a, b) {
  1752. return b.area - a.area;
  1753. });
  1754. var filteredAreas = sortedAreas.filter(function (_ref2) {
  1755. var width = _ref2.width,
  1756. height = _ref2.height;
  1757. return width >= popper.clientWidth && height >= popper.clientHeight;
  1758. });
  1759. var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
  1760. var variation = placement.split('-')[1];
  1761. return computedPlacement + (variation ? '-' + variation : '');
  1762. }
  1763. /**
  1764. * Get offsets to the reference element
  1765. * @method
  1766. * @memberof Popper.Utils
  1767. * @param {Object} state
  1768. * @param {Element} popper - the popper element
  1769. * @param {Element} reference - the reference element (the popper will be relative to this)
  1770. * @param {Element} fixedPosition - is in fixed position mode
  1771. * @returns {Object} An object containing the offsets which will be applied to the popper
  1772. */
  1773. function getReferenceOffsets(state, popper, reference) {
  1774. var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  1775. var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
  1776. return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
  1777. }
  1778. /**
  1779. * Get the outer sizes of the given element (offset size + margins)
  1780. * @method
  1781. * @memberof Popper.Utils
  1782. * @argument {Element} element
  1783. * @returns {Object} object containing width and height properties
  1784. */
  1785. function getOuterSizes(element) {
  1786. var styles = getComputedStyle(element);
  1787. var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
  1788. var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);
  1789. var result = {
  1790. width: element.offsetWidth + y,
  1791. height: element.offsetHeight + x
  1792. };
  1793. return result;
  1794. }
  1795. /**
  1796. * Get the opposite placement of the given one
  1797. * @method
  1798. * @memberof Popper.Utils
  1799. * @argument {String} placement
  1800. * @returns {String} flipped placement
  1801. */
  1802. function getOppositePlacement(placement) {
  1803. var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
  1804. return placement.replace(/left|right|bottom|top/g, function (matched) {
  1805. return hash[matched];
  1806. });
  1807. }
  1808. /**
  1809. * Get offsets to the popper
  1810. * @method
  1811. * @memberof Popper.Utils
  1812. * @param {Object} position - CSS position the Popper will get applied
  1813. * @param {HTMLElement} popper - the popper element
  1814. * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
  1815. * @param {String} placement - one of the valid placement options
  1816. * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
  1817. */
  1818. function getPopperOffsets(popper, referenceOffsets, placement) {
  1819. placement = placement.split('-')[0];
  1820. // Get popper node sizes
  1821. var popperRect = getOuterSizes(popper);
  1822. // Add position, width and height to our offsets object
  1823. var popperOffsets = {
  1824. width: popperRect.width,
  1825. height: popperRect.height
  1826. };
  1827. // depending by the popper placement we have to compute its offsets slightly differently
  1828. var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
  1829. var mainSide = isHoriz ? 'top' : 'left';
  1830. var secondarySide = isHoriz ? 'left' : 'top';
  1831. var measurement = isHoriz ? 'height' : 'width';
  1832. var secondaryMeasurement = !isHoriz ? 'height' : 'width';
  1833. popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
  1834. if (placement === secondarySide) {
  1835. popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
  1836. } else {
  1837. popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
  1838. }
  1839. return popperOffsets;
  1840. }
  1841. /**
  1842. * Mimics the `find` method of Array
  1843. * @method
  1844. * @memberof Popper.Utils
  1845. * @argument {Array} arr
  1846. * @argument prop
  1847. * @argument value
  1848. * @returns index or -1
  1849. */
  1850. function find(arr, check) {
  1851. // use native find if supported
  1852. if (Array.prototype.find) {
  1853. return arr.find(check);
  1854. }
  1855. // use `filter` to obtain the same behavior of `find`
  1856. return arr.filter(check)[0];
  1857. }
  1858. /**
  1859. * Return the index of the matching object
  1860. * @method
  1861. * @memberof Popper.Utils
  1862. * @argument {Array} arr
  1863. * @argument prop
  1864. * @argument value
  1865. * @returns index or -1
  1866. */
  1867. function findIndex(arr, prop, value) {
  1868. // use native findIndex if supported
  1869. if (Array.prototype.findIndex) {
  1870. return arr.findIndex(function (cur) {
  1871. return cur[prop] === value;
  1872. });
  1873. }
  1874. // use `find` + `indexOf` if `findIndex` isn't supported
  1875. var match = find(arr, function (obj) {
  1876. return obj[prop] === value;
  1877. });
  1878. return arr.indexOf(match);
  1879. }
  1880. /**
  1881. * Loop trough the list of modifiers and run them in order,
  1882. * each of them will then edit the data object.
  1883. * @method
  1884. * @memberof Popper.Utils
  1885. * @param {dataObject} data
  1886. * @param {Array} modifiers
  1887. * @param {String} ends - Optional modifier name used as stopper
  1888. * @returns {dataObject}
  1889. */
  1890. function runModifiers(modifiers, data, ends) {
  1891. var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
  1892. modifiersToRun.forEach(function (modifier) {
  1893. if (modifier['function']) {
  1894. // eslint-disable-line dot-notation
  1895. console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
  1896. }
  1897. var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
  1898. if (modifier.enabled && isFunction(fn)) {
  1899. // Add properties to offsets to make them a complete clientRect object
  1900. // we do this before each modifier to make sure the previous one doesn't
  1901. // mess with these values
  1902. data.offsets.popper = getClientRect(data.offsets.popper);
  1903. data.offsets.reference = getClientRect(data.offsets.reference);
  1904. data = fn(data, modifier);
  1905. }
  1906. });
  1907. return data;
  1908. }
  1909. /**
  1910. * Updates the position of the popper, computing the new offsets and applying
  1911. * the new style.<br />
  1912. * Prefer `scheduleUpdate` over `update` because of performance reasons.
  1913. * @method
  1914. * @memberof Popper
  1915. */
  1916. function update() {
  1917. // if popper is destroyed, don't perform any further update
  1918. if (this.state.isDestroyed) {
  1919. return;
  1920. }
  1921. var data = {
  1922. instance: this,
  1923. styles: {},
  1924. arrowStyles: {},
  1925. attributes: {},
  1926. flipped: false,
  1927. offsets: {}
  1928. };
  1929. // compute reference element offsets
  1930. data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);
  1931. // compute auto placement, store placement inside the data object,
  1932. // modifiers will be able to edit `placement` if needed
  1933. // and refer to originalPlacement to know the original value
  1934. data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);
  1935. // store the computed placement inside `originalPlacement`
  1936. data.originalPlacement = data.placement;
  1937. data.positionFixed = this.options.positionFixed;
  1938. // compute the popper offsets
  1939. data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
  1940. data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';
  1941. // run the modifiers
  1942. data = runModifiers(this.modifiers, data);
  1943. // the first `update` will call `onCreate` callback
  1944. // the other ones will call `onUpdate` callback
  1945. if (!this.state.isCreated) {
  1946. this.state.isCreated = true;
  1947. this.options.onCreate(data);
  1948. } else {
  1949. this.options.onUpdate(data);
  1950. }
  1951. }
  1952. /**
  1953. * Helper used to know if the given modifier is enabled.
  1954. * @method
  1955. * @memberof Popper.Utils
  1956. * @returns {Boolean}
  1957. */
  1958. function isModifierEnabled(modifiers, modifierName) {
  1959. return modifiers.some(function (_ref) {
  1960. var name = _ref.name,
  1961. enabled = _ref.enabled;
  1962. return enabled && name === modifierName;
  1963. });
  1964. }
  1965. /**
  1966. * Get the prefixed supported property name
  1967. * @method
  1968. * @memberof Popper.Utils
  1969. * @argument {String} property (camelCase)
  1970. * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
  1971. */
  1972. function getSupportedPropertyName(property) {
  1973. var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
  1974. var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
  1975. for (var i = 0; i < prefixes.length; i++) {
  1976. var prefix = prefixes[i];
  1977. var toCheck = prefix ? '' + prefix + upperProp : property;
  1978. if (typeof document.body.style[toCheck] !== 'undefined') {
  1979. return toCheck;
  1980. }
  1981. }
  1982. return null;
  1983. }
  1984. /**
  1985. * Destroy the popper
  1986. * @method
  1987. * @memberof Popper
  1988. */
  1989. function destroy() {
  1990. this.state.isDestroyed = true;
  1991. // touch DOM only if `applyStyle` modifier is enabled
  1992. if (isModifierEnabled(this.modifiers, 'applyStyle')) {
  1993. this.popper.removeAttribute('x-placement');
  1994. this.popper.style.position = '';
  1995. this.popper.style.top = '';
  1996. this.popper.style.left = '';
  1997. this.popper.style.right = '';
  1998. this.popper.style.bottom = '';
  1999. this.popper.style.willChange = '';
  2000. this.popper.style[getSupportedPropertyName('transform')] = '';
  2001. }
  2002. this.disableEventListeners();
  2003. // remove the popper if user explicity asked for the deletion on destroy
  2004. // do not use `remove` because IE11 doesn't support it
  2005. if (this.options.removeOnDestroy) {
  2006. this.popper.parentNode.removeChild(this.popper);
  2007. }
  2008. return this;
  2009. }
  2010. /**
  2011. * Get the window associated with the element
  2012. * @argument {Element} element
  2013. * @returns {Window}
  2014. */
  2015. function getWindow(element) {
  2016. var ownerDocument = element.ownerDocument;
  2017. return ownerDocument ? ownerDocument.defaultView : window;
  2018. }
  2019. function attachToScrollParents(scrollParent, event, callback, scrollParents) {
  2020. var isBody = scrollParent.nodeName === 'BODY';
  2021. var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
  2022. target.addEventListener(event, callback, { passive: true });
  2023. if (!isBody) {
  2024. attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
  2025. }
  2026. scrollParents.push(target);
  2027. }
  2028. /**
  2029. * Setup needed event listeners used to update the popper position
  2030. * @method
  2031. * @memberof Popper.Utils
  2032. * @private
  2033. */
  2034. function setupEventListeners(reference, options, state, updateBound) {
  2035. // Resize event listener on window
  2036. state.updateBound = updateBound;
  2037. getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });
  2038. // Scroll event listener on scroll parents
  2039. var scrollElement = getScrollParent(reference);
  2040. attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
  2041. state.scrollElement = scrollElement;
  2042. state.eventsEnabled = true;
  2043. return state;
  2044. }
  2045. /**
  2046. * It will add resize/scroll events and start recalculating
  2047. * position of the popper element when they are triggered.
  2048. * @method
  2049. * @memberof Popper
  2050. */
  2051. function enableEventListeners() {
  2052. if (!this.state.eventsEnabled) {
  2053. this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
  2054. }
  2055. }
  2056. /**
  2057. * Remove event listeners used to update the popper position
  2058. * @method
  2059. * @memberof Popper.Utils
  2060. * @private
  2061. */
  2062. function removeEventListeners(reference, state) {
  2063. // Remove resize event listener on window
  2064. getWindow(reference).removeEventListener('resize', state.updateBound);
  2065. // Remove scroll event listener on scroll parents
  2066. state.scrollParents.forEach(function (target) {
  2067. target.removeEventListener('scroll', state.updateBound);
  2068. });
  2069. // Reset state
  2070. state.updateBound = null;
  2071. state.scrollParents = [];
  2072. state.scrollElement = null;
  2073. state.eventsEnabled = false;
  2074. return state;
  2075. }
  2076. /**
  2077. * It will remove resize/scroll events and won't recalculate popper position
  2078. * when they are triggered. It also won't trigger onUpdate callback anymore,
  2079. * unless you call `update` method manually.
  2080. * @method
  2081. * @memberof Popper
  2082. */
  2083. function disableEventListeners() {
  2084. if (this.state.eventsEnabled) {
  2085. cancelAnimationFrame(this.scheduleUpdate);
  2086. this.state = removeEventListeners(this.reference, this.state);
  2087. }
  2088. }
  2089. /**
  2090. * Tells if a given input is a number
  2091. * @method
  2092. * @memberof Popper.Utils
  2093. * @param {*} input to check
  2094. * @return {Boolean}
  2095. */
  2096. function isNumeric(n) {
  2097. return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
  2098. }
  2099. /**
  2100. * Set the style to the given popper
  2101. * @method
  2102. * @memberof Popper.Utils
  2103. * @argument {Element} element - Element to apply the style to
  2104. * @argument {Object} styles
  2105. * Object with a list of properties and values which will be applied to the element
  2106. */
  2107. function setStyles(element, styles) {
  2108. Object.keys(styles).forEach(function (prop) {
  2109. var unit = '';
  2110. // add unit if the value is numeric and is one of the following
  2111. if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
  2112. unit = 'px';
  2113. }
  2114. element.style[prop] = styles[prop] + unit;
  2115. });
  2116. }
  2117. /**
  2118. * Set the attributes to the given popper
  2119. * @method
  2120. * @memberof Popper.Utils
  2121. * @argument {Element} element - Element to apply the attributes to
  2122. * @argument {Object} styles
  2123. * Object with a list of properties and values which will be applied to the element
  2124. */
  2125. function setAttributes(element, attributes) {
  2126. Object.keys(attributes).forEach(function (prop) {
  2127. var value = attributes[prop];
  2128. if (value !== false) {
  2129. element.setAttribute(prop, attributes[prop]);
  2130. } else {
  2131. element.removeAttribute(prop);
  2132. }
  2133. });
  2134. }
  2135. /**
  2136. * @function
  2137. * @memberof Modifiers
  2138. * @argument {Object} data - The data object generated by `update` method
  2139. * @argument {Object} data.styles - List of style properties - values to apply to popper element
  2140. * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
  2141. * @argument {Object} options - Modifiers configuration and options
  2142. * @returns {Object} The same data object
  2143. */
  2144. function applyStyle(data) {
  2145. // any property present in `data.styles` will be applied to the popper,
  2146. // in this way we can make the 3rd party modifiers add custom styles to it
  2147. // Be aware, modifiers could override the properties defined in the previous
  2148. // lines of this modifier!
  2149. setStyles(data.instance.popper, data.styles);
  2150. // any property present in `data.attributes` will be applied to the popper,
  2151. // they will be set as HTML attributes of the element
  2152. setAttributes(data.instance.popper, data.attributes);
  2153. // if arrowElement is defined and arrowStyles has some properties
  2154. if (data.arrowElement && Object.keys(data.arrowStyles).length) {
  2155. setStyles(data.arrowElement, data.arrowStyles);
  2156. }
  2157. return data;
  2158. }
  2159. /**
  2160. * Set the x-placement attribute before everything else because it could be used
  2161. * to add margins to the popper margins needs to be calculated to get the
  2162. * correct popper offsets.
  2163. * @method
  2164. * @memberof Popper.modifiers
  2165. * @param {HTMLElement} reference - The reference element used to position the popper
  2166. * @param {HTMLElement} popper - The HTML element used as popper
  2167. * @param {Object} options - Popper.js options
  2168. */
  2169. function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
  2170. // compute reference element offsets
  2171. var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
  2172. // compute auto placement, store placement inside the data object,
  2173. // modifiers will be able to edit `placement` if needed
  2174. // and refer to originalPlacement to know the original value
  2175. var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
  2176. popper.setAttribute('x-placement', placement);
  2177. // Apply `position` to popper before anything else because
  2178. // without the position applied we can't guarantee correct computations
  2179. setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });
  2180. return options;
  2181. }
  2182. /**
  2183. * @function
  2184. * @memberof Modifiers
  2185. * @argument {Object} data - The data object generated by `update` method
  2186. * @argument {Object} options - Modifiers configuration and options
  2187. * @returns {Object} The data object, properly modified
  2188. */
  2189. function computeStyle(data, options) {
  2190. var x = options.x,
  2191. y = options.y;
  2192. var popper = data.offsets.popper;
  2193. // Remove this legacy support in Popper.js v2
  2194. var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
  2195. return modifier.name === 'applyStyle';
  2196. }).gpuAcceleration;
  2197. if (legacyGpuAccelerationOption !== undefined) {
  2198. console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
  2199. }
  2200. var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
  2201. var offsetParent = getOffsetParent(data.instance.popper);
  2202. var offsetParentRect = getBoundingClientRect(offsetParent);
  2203. // Styles
  2204. var styles = {
  2205. position: popper.position
  2206. };
  2207. // Avoid blurry text by using full pixel integers.
  2208. // For pixel-perfect positioning, top/bottom prefers rounded
  2209. // values, while left/right prefers floored values.
  2210. var offsets = {
  2211. left: Math.floor(popper.left),
  2212. top: Math.round(popper.top),
  2213. bottom: Math.round(popper.bottom),
  2214. right: Math.floor(popper.right)
  2215. };
  2216. var sideA = x === 'bottom' ? 'top' : 'bottom';
  2217. var sideB = y === 'right' ? 'left' : 'right';
  2218. // if gpuAcceleration is set to `true` and transform is supported,
  2219. // we use `translate3d` to apply the position to the popper we
  2220. // automatically use the supported prefixed version if needed
  2221. var prefixedProperty = getSupportedPropertyName('transform');
  2222. // now, let's make a step back and look at this code closely (wtf?)
  2223. // If the content of the popper grows once it's been positioned, it
  2224. // may happen that the popper gets misplaced because of the new content
  2225. // overflowing its reference element
  2226. // To avoid this problem, we provide two options (x and y), which allow
  2227. // the consumer to define the offset origin.
  2228. // If we position a popper on top of a reference element, we can set
  2229. // `x` to `top` to make the popper grow towards its top instead of
  2230. // its bottom.
  2231. var left = void 0,
  2232. top = void 0;
  2233. if (sideA === 'bottom') {
  2234. top = -offsetParentRect.height + offsets.bottom;
  2235. } else {
  2236. top = offsets.top;
  2237. }
  2238. if (sideB === 'right') {
  2239. left = -offsetParentRect.width + offsets.right;
  2240. } else {
  2241. left = offsets.left;
  2242. }
  2243. if (gpuAcceleration && prefixedProperty) {
  2244. styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
  2245. styles[sideA] = 0;
  2246. styles[sideB] = 0;
  2247. styles.willChange = 'transform';
  2248. } else {
  2249. // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
  2250. var invertTop = sideA === 'bottom' ? -1 : 1;
  2251. var invertLeft = sideB === 'right' ? -1 : 1;
  2252. styles[sideA] = top * invertTop;
  2253. styles[sideB] = left * invertLeft;
  2254. styles.willChange = sideA + ', ' + sideB;
  2255. }
  2256. // Attributes
  2257. var attributes = {
  2258. 'x-placement': data.placement
  2259. };
  2260. // Update `data` attributes, styles and arrowStyles
  2261. data.attributes = _extends({}, attributes, data.attributes);
  2262. data.styles = _extends({}, styles, data.styles);
  2263. data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);
  2264. return data;
  2265. }
  2266. /**
  2267. * Helper used to know if the given modifier depends from another one.<br />
  2268. * It checks if the needed modifier is listed and enabled.
  2269. * @method
  2270. * @memberof Popper.Utils
  2271. * @param {Array} modifiers - list of modifiers
  2272. * @param {String} requestingName - name of requesting modifier
  2273. * @param {String} requestedName - name of requested modifier
  2274. * @returns {Boolean}
  2275. */
  2276. function isModifierRequired(modifiers, requestingName, requestedName) {
  2277. var requesting = find(modifiers, function (_ref) {
  2278. var name = _ref.name;
  2279. return name === requestingName;
  2280. });
  2281. var isRequired = !!requesting && modifiers.some(function (modifier) {
  2282. return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
  2283. });
  2284. if (!isRequired) {
  2285. var _requesting = '`' + requestingName + '`';
  2286. var requested = '`' + requestedName + '`';
  2287. console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
  2288. }
  2289. return isRequired;
  2290. }
  2291. /**
  2292. * @function
  2293. * @memberof Modifiers
  2294. * @argument {Object} data - The data object generated by update method
  2295. * @argument {Object} options - Modifiers configuration and options
  2296. * @returns {Object} The data object, properly modified
  2297. */
  2298. function arrow(data, options) {
  2299. var _data$offsets$arrow;
  2300. // arrow depends on keepTogether in order to work
  2301. if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
  2302. return data;
  2303. }
  2304. var arrowElement = options.element;
  2305. // if arrowElement is a string, suppose it's a CSS selector
  2306. if (typeof arrowElement === 'string') {
  2307. arrowElement = data.instance.popper.querySelector(arrowElement);
  2308. // if arrowElement is not found, don't run the modifier
  2309. if (!arrowElement) {
  2310. return data;
  2311. }
  2312. } else {
  2313. // if the arrowElement isn't a query selector we must check that the
  2314. // provided DOM node is child of its popper node
  2315. if (!data.instance.popper.contains(arrowElement)) {
  2316. console.warn('WARNING: `arrow.element` must be child of its popper element!');
  2317. return data;
  2318. }
  2319. }
  2320. var placement = data.placement.split('-')[0];
  2321. var _data$offsets = data.offsets,
  2322. popper = _data$offsets.popper,
  2323. reference = _data$offsets.reference;
  2324. var isVertical = ['left', 'right'].indexOf(placement) !== -1;
  2325. var len = isVertical ? 'height' : 'width';
  2326. var sideCapitalized = isVertical ? 'Top' : 'Left';
  2327. var side = sideCapitalized.toLowerCase();
  2328. var altSide = isVertical ? 'left' : 'top';
  2329. var opSide = isVertical ? 'bottom' : 'right';
  2330. var arrowElementSize = getOuterSizes(arrowElement)[len];
  2331. //
  2332. // extends keepTogether behavior making sure the popper and its
  2333. // reference have enough pixels in conjuction
  2334. //
  2335. // top/left side
  2336. if (reference[opSide] - arrowElementSize < popper[side]) {
  2337. data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
  2338. }
  2339. // bottom/right side
  2340. if (reference[side] + arrowElementSize > popper[opSide]) {
  2341. data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
  2342. }
  2343. data.offsets.popper = getClientRect(data.offsets.popper);
  2344. // compute center of the popper
  2345. var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;
  2346. // Compute the sideValue using the updated popper offsets
  2347. // take popper margin in account because we don't have this info available
  2348. var css = getStyleComputedProperty(data.instance.popper);
  2349. var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10);
  2350. var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10);
  2351. var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
  2352. // prevent arrowElement from being placed not contiguously to its popper
  2353. sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
  2354. data.arrowElement = arrowElement;
  2355. data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);
  2356. return data;
  2357. }
  2358. /**
  2359. * Get the opposite placement variation of the given one
  2360. * @method
  2361. * @memberof Popper.Utils
  2362. * @argument {String} placement variation
  2363. * @returns {String} flipped placement variation
  2364. */
  2365. function getOppositeVariation(variation) {
  2366. if (variation === 'end') {
  2367. return 'start';
  2368. } else if (variation === 'start') {
  2369. return 'end';
  2370. }
  2371. return variation;
  2372. }
  2373. /**
  2374. * List of accepted placements to use as values of the `placement` option.<br />
  2375. * Valid placements are:
  2376. * - `auto`
  2377. * - `top`
  2378. * - `right`
  2379. * - `bottom`
  2380. * - `left`
  2381. *
  2382. * Each placement can have a variation from this list:
  2383. * - `-start`
  2384. * - `-end`
  2385. *
  2386. * Variations are interpreted easily if you think of them as the left to right
  2387. * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
  2388. * is right.<br />
  2389. * Vertically (`left` and `right`), `start` is top and `end` is bottom.
  2390. *
  2391. * Some valid examples are:
  2392. * - `top-end` (on top of reference, right aligned)
  2393. * - `right-start` (on right of reference, top aligned)
  2394. * - `bottom` (on bottom, centered)
  2395. * - `auto-right` (on the side with more space available, alignment depends by placement)
  2396. *
  2397. * @static
  2398. * @type {Array}
  2399. * @enum {String}
  2400. * @readonly
  2401. * @method placements
  2402. * @memberof Popper
  2403. */
  2404. var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
  2405. // Get rid of `auto` `auto-start` and `auto-end`
  2406. var validPlacements = placements.slice(3);
  2407. /**
  2408. * Given an initial placement, returns all the subsequent placements
  2409. * clockwise (or counter-clockwise).
  2410. *
  2411. * @method
  2412. * @memberof Popper.Utils
  2413. * @argument {String} placement - A valid placement (it accepts variations)
  2414. * @argument {Boolean} counter - Set to true to walk the placements counterclockwise
  2415. * @returns {Array} placements including their variations
  2416. */
  2417. function clockwise(placement) {
  2418. var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  2419. var index = validPlacements.indexOf(placement);
  2420. var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
  2421. return counter ? arr.reverse() : arr;
  2422. }
  2423. var BEHAVIORS = {
  2424. FLIP: 'flip',
  2425. CLOCKWISE: 'clockwise',
  2426. COUNTERCLOCKWISE: 'counterclockwise'
  2427. };
  2428. /**
  2429. * @function
  2430. * @memberof Modifiers
  2431. * @argument {Object} data - The data object generated by update method
  2432. * @argument {Object} options - Modifiers configuration and options
  2433. * @returns {Object} The data object, properly modified
  2434. */
  2435. function flip(data, options) {
  2436. // if `inner` modifier is enabled, we can't use the `flip` modifier
  2437. if (isModifierEnabled(data.instance.modifiers, 'inner')) {
  2438. return data;
  2439. }
  2440. if (data.flipped && data.placement === data.originalPlacement) {
  2441. // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
  2442. return data;
  2443. }
  2444. var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
  2445. var placement = data.placement.split('-')[0];
  2446. var placementOpposite = getOppositePlacement(placement);
  2447. var variation = data.placement.split('-')[1] || '';
  2448. var flipOrder = [];
  2449. switch (options.behavior) {
  2450. case BEHAVIORS.FLIP:
  2451. flipOrder = [placement, placementOpposite];
  2452. break;
  2453. case BEHAVIORS.CLOCKWISE:
  2454. flipOrder = clockwise(placement);
  2455. break;
  2456. case BEHAVIORS.COUNTERCLOCKWISE:
  2457. flipOrder = clockwise(placement, true);
  2458. break;
  2459. default:
  2460. flipOrder = options.behavior;
  2461. }
  2462. flipOrder.forEach(function (step, index) {
  2463. if (placement !== step || flipOrder.length === index + 1) {
  2464. return data;
  2465. }
  2466. placement = data.placement.split('-')[0];
  2467. placementOpposite = getOppositePlacement(placement);
  2468. var popperOffsets = data.offsets.popper;
  2469. var refOffsets = data.offsets.reference;
  2470. // using floor because the reference offsets may contain decimals we are not going to consider here
  2471. var floor = Math.floor;
  2472. var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);
  2473. var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
  2474. var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
  2475. var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
  2476. var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
  2477. var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;
  2478. // flip the variation if required
  2479. var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
  2480. var flippedVariation = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
  2481. if (overlapsRef || overflowsBoundaries || flippedVariation) {
  2482. // this boolean to detect any flip loop
  2483. data.flipped = true;
  2484. if (overlapsRef || overflowsBoundaries) {
  2485. placement = flipOrder[index + 1];
  2486. }
  2487. if (flippedVariation) {
  2488. variation = getOppositeVariation(variation);
  2489. }
  2490. data.placement = placement + (variation ? '-' + variation : '');
  2491. // this object contains `position`, we want to preserve it along with
  2492. // any additional property we may add in the future
  2493. data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
  2494. data = runModifiers(data.instance.modifiers, data, 'flip');
  2495. }
  2496. });
  2497. return data;
  2498. }
  2499. /**
  2500. * @function
  2501. * @memberof Modifiers
  2502. * @argument {Object} data - The data object generated by update method
  2503. * @argument {Object} options - Modifiers configuration and options
  2504. * @returns {Object} The data object, properly modified
  2505. */
  2506. function keepTogether(data) {
  2507. var _data$offsets = data.offsets,
  2508. popper = _data$offsets.popper,
  2509. reference = _data$offsets.reference;
  2510. var placement = data.placement.split('-')[0];
  2511. var floor = Math.floor;
  2512. var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
  2513. var side = isVertical ? 'right' : 'bottom';
  2514. var opSide = isVertical ? 'left' : 'top';
  2515. var measurement = isVertical ? 'width' : 'height';
  2516. if (popper[side] < floor(reference[opSide])) {
  2517. data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
  2518. }
  2519. if (popper[opSide] > floor(reference[side])) {
  2520. data.offsets.popper[opSide] = floor(reference[side]);
  2521. }
  2522. return data;
  2523. }
  2524. /**
  2525. * Converts a string containing value + unit into a px value number
  2526. * @function
  2527. * @memberof {modifiers~offset}
  2528. * @private
  2529. * @argument {String} str - Value + unit string
  2530. * @argument {String} measurement - `height` or `width`
  2531. * @argument {Object} popperOffsets
  2532. * @argument {Object} referenceOffsets
  2533. * @returns {Number|String}
  2534. * Value in pixels, or original string if no values were extracted
  2535. */
  2536. function toValue(str, measurement, popperOffsets, referenceOffsets) {
  2537. // separate value from unit
  2538. var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
  2539. var value = +split[1];
  2540. var unit = split[2];
  2541. // If it's not a number it's an operator, I guess
  2542. if (!value) {
  2543. return str;
  2544. }
  2545. if (unit.indexOf('%') === 0) {
  2546. var element = void 0;
  2547. switch (unit) {
  2548. case '%p':
  2549. element = popperOffsets;
  2550. break;
  2551. case '%':
  2552. case '%r':
  2553. default:
  2554. element = referenceOffsets;
  2555. }
  2556. var rect = getClientRect(element);
  2557. return rect[measurement] / 100 * value;
  2558. } else if (unit === 'vh' || unit === 'vw') {
  2559. // if is a vh or vw, we calculate the size based on the viewport
  2560. var size = void 0;
  2561. if (unit === 'vh') {
  2562. size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
  2563. } else {
  2564. size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
  2565. }
  2566. return size / 100 * value;
  2567. } else {
  2568. // if is an explicit pixel unit, we get rid of the unit and keep the value
  2569. // if is an implicit unit, it's px, and we return just the value
  2570. return value;
  2571. }
  2572. }
  2573. /**
  2574. * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
  2575. * @function
  2576. * @memberof {modifiers~offset}
  2577. * @private
  2578. * @argument {String} offset
  2579. * @argument {Object} popperOffsets
  2580. * @argument {Object} referenceOffsets
  2581. * @argument {String} basePlacement
  2582. * @returns {Array} a two cells array with x and y offsets in numbers
  2583. */
  2584. function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
  2585. var offsets = [0, 0];
  2586. // Use height if placement is left or right and index is 0 otherwise use width
  2587. // in this way the first offset will use an axis and the second one
  2588. // will use the other one
  2589. var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;
  2590. // Split the offset string to obtain a list of values and operands
  2591. // The regex addresses values with the plus or minus sign in front (+10, -20, etc)
  2592. var fragments = offset.split(/(\+|\-)/).map(function (frag) {
  2593. return frag.trim();
  2594. });
  2595. // Detect if the offset string contains a pair of values or a single one
  2596. // they could be separated by comma or space
  2597. var divider = fragments.indexOf(find(fragments, function (frag) {
  2598. return frag.search(/,|\s/) !== -1;
  2599. }));
  2600. if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
  2601. console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
  2602. }
  2603. // If divider is found, we divide the list of values and operands to divide
  2604. // them by ofset X and Y.
  2605. var splitRegex = /\s*,\s*|\s+/;
  2606. var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];
  2607. // Convert the values with units to absolute pixels to allow our computations
  2608. ops = ops.map(function (op, index) {
  2609. // Most of the units rely on the orientation of the popper
  2610. var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
  2611. var mergeWithPrevious = false;
  2612. return op
  2613. // This aggregates any `+` or `-` sign that aren't considered operators
  2614. // e.g.: 10 + +5 => [10, +, +5]
  2615. .reduce(function (a, b) {
  2616. if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
  2617. a[a.length - 1] = b;
  2618. mergeWithPrevious = true;
  2619. return a;
  2620. } else if (mergeWithPrevious) {
  2621. a[a.length - 1] += b;
  2622. mergeWithPrevious = false;
  2623. return a;
  2624. } else {
  2625. return a.concat(b);
  2626. }
  2627. }, [])
  2628. // Here we convert the string values into number values (in px)
  2629. .map(function (str) {
  2630. return toValue(str, measurement, popperOffsets, referenceOffsets);
  2631. });
  2632. });
  2633. // Loop trough the offsets arrays and execute the operations
  2634. ops.forEach(function (op, index) {
  2635. op.forEach(function (frag, index2) {
  2636. if (isNumeric(frag)) {
  2637. offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
  2638. }
  2639. });
  2640. });
  2641. return offsets;
  2642. }
  2643. /**
  2644. * @function
  2645. * @memberof Modifiers
  2646. * @argument {Object} data - The data object generated by update method
  2647. * @argument {Object} options - Modifiers configuration and options
  2648. * @argument {Number|String} options.offset=0
  2649. * The offset value as described in the modifier description
  2650. * @returns {Object} The data object, properly modified
  2651. */
  2652. function offset(data, _ref) {
  2653. var offset = _ref.offset;
  2654. var placement = data.placement,
  2655. _data$offsets = data.offsets,
  2656. popper = _data$offsets.popper,
  2657. reference = _data$offsets.reference;
  2658. var basePlacement = placement.split('-')[0];
  2659. var offsets = void 0;
  2660. if (isNumeric(+offset)) {
  2661. offsets = [+offset, 0];
  2662. } else {
  2663. offsets = parseOffset(offset, popper, reference, basePlacement);
  2664. }
  2665. if (basePlacement === 'left') {
  2666. popper.top += offsets[0];
  2667. popper.left -= offsets[1];
  2668. } else if (basePlacement === 'right') {
  2669. popper.top += offsets[0];
  2670. popper.left += offsets[1];
  2671. } else if (basePlacement === 'top') {
  2672. popper.left += offsets[0];
  2673. popper.top -= offsets[1];
  2674. } else if (basePlacement === 'bottom') {
  2675. popper.left += offsets[0];
  2676. popper.top += offsets[1];
  2677. }
  2678. data.popper = popper;
  2679. return data;
  2680. }
  2681. /**
  2682. * @function
  2683. * @memberof Modifiers
  2684. * @argument {Object} data - The data object generated by `update` method
  2685. * @argument {Object} options - Modifiers configuration and options
  2686. * @returns {Object} The data object, properly modified
  2687. */
  2688. function preventOverflow(data, options) {
  2689. var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);
  2690. // If offsetParent is the reference element, we really want to
  2691. // go one step up and use the next offsetParent as reference to
  2692. // avoid to make this modifier completely useless and look like broken
  2693. if (data.instance.reference === boundariesElement) {
  2694. boundariesElement = getOffsetParent(boundariesElement);
  2695. }
  2696. // NOTE: DOM access here
  2697. // resets the popper's position so that the document size can be calculated excluding
  2698. // the size of the popper element itself
  2699. var transformProp = getSupportedPropertyName('transform');
  2700. var popperStyles = data.instance.popper.style; // assignment to help minification
  2701. var top = popperStyles.top,
  2702. left = popperStyles.left,
  2703. transform = popperStyles[transformProp];
  2704. popperStyles.top = '';
  2705. popperStyles.left = '';
  2706. popperStyles[transformProp] = '';
  2707. var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);
  2708. // NOTE: DOM access here
  2709. // restores the original style properties after the offsets have been computed
  2710. popperStyles.top = top;
  2711. popperStyles.left = left;
  2712. popperStyles[transformProp] = transform;
  2713. options.boundaries = boundaries;
  2714. var order = options.priority;
  2715. var popper = data.offsets.popper;
  2716. var check = {
  2717. primary: function primary(placement) {
  2718. var value = popper[placement];
  2719. if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
  2720. value = Math.max(popper[placement], boundaries[placement]);
  2721. }
  2722. return defineProperty({}, placement, value);
  2723. },
  2724. secondary: function secondary(placement) {
  2725. var mainSide = placement === 'right' ? 'left' : 'top';
  2726. var value = popper[mainSide];
  2727. if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
  2728. value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
  2729. }
  2730. return defineProperty({}, mainSide, value);
  2731. }
  2732. };
  2733. order.forEach(function (placement) {
  2734. var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
  2735. popper = _extends({}, popper, check[side](placement));
  2736. });
  2737. data.offsets.popper = popper;
  2738. return data;
  2739. }
  2740. /**
  2741. * @function
  2742. * @memberof Modifiers
  2743. * @argument {Object} data - The data object generated by `update` method
  2744. * @argument {Object} options - Modifiers configuration and options
  2745. * @returns {Object} The data object, properly modified
  2746. */
  2747. function shift(data) {
  2748. var placement = data.placement;
  2749. var basePlacement = placement.split('-')[0];
  2750. var shiftvariation = placement.split('-')[1];
  2751. // if shift shiftvariation is specified, run the modifier
  2752. if (shiftvariation) {
  2753. var _data$offsets = data.offsets,
  2754. reference = _data$offsets.reference,
  2755. popper = _data$offsets.popper;
  2756. var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
  2757. var side = isVertical ? 'left' : 'top';
  2758. var measurement = isVertical ? 'width' : 'height';
  2759. var shiftOffsets = {
  2760. start: defineProperty({}, side, reference[side]),
  2761. end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
  2762. };
  2763. data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);
  2764. }
  2765. return data;
  2766. }
  2767. /**
  2768. * @function
  2769. * @memberof Modifiers
  2770. * @argument {Object} data - The data object generated by update method
  2771. * @argument {Object} options - Modifiers configuration and options
  2772. * @returns {Object} The data object, properly modified
  2773. */
  2774. function hide(data) {
  2775. if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
  2776. return data;
  2777. }
  2778. var refRect = data.offsets.reference;
  2779. var bound = find(data.instance.modifiers, function (modifier) {
  2780. return modifier.name === 'preventOverflow';
  2781. }).boundaries;
  2782. if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
  2783. // Avoid unnecessary DOM access if visibility hasn't changed
  2784. if (data.hide === true) {
  2785. return data;
  2786. }
  2787. data.hide = true;
  2788. data.attributes['x-out-of-boundaries'] = '';
  2789. } else {
  2790. // Avoid unnecessary DOM access if visibility hasn't changed
  2791. if (data.hide === false) {
  2792. return data;
  2793. }
  2794. data.hide = false;
  2795. data.attributes['x-out-of-boundaries'] = false;
  2796. }
  2797. return data;
  2798. }
  2799. /**
  2800. * @function
  2801. * @memberof Modifiers
  2802. * @argument {Object} data - The data object generated by `update` method
  2803. * @argument {Object} options - Modifiers configuration and options
  2804. * @returns {Object} The data object, properly modified
  2805. */
  2806. function inner(data) {
  2807. var placement = data.placement;
  2808. var basePlacement = placement.split('-')[0];
  2809. var _data$offsets = data.offsets,
  2810. popper = _data$offsets.popper,
  2811. reference = _data$offsets.reference;
  2812. var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
  2813. var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
  2814. popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
  2815. data.placement = getOppositePlacement(placement);
  2816. data.offsets.popper = getClientRect(popper);
  2817. return data;
  2818. }
  2819. /**
  2820. * Modifier function, each modifier can have a function of this type assigned
  2821. * to its `fn` property.<br />
  2822. * These functions will be called on each update, this means that you must
  2823. * make sure they are performant enough to avoid performance bottlenecks.
  2824. *
  2825. * @function ModifierFn
  2826. * @argument {dataObject} data - The data object generated by `update` method
  2827. * @argument {Object} options - Modifiers configuration and options
  2828. * @returns {dataObject} The data object, properly modified
  2829. */
  2830. /**
  2831. * Modifiers are plugins used to alter the behavior of your poppers.<br />
  2832. * Popper.js uses a set of 9 modifiers to provide all the basic functionalities
  2833. * needed by the library.
  2834. *
  2835. * Usually you don't want to override the `order`, `fn` and `onLoad` props.
  2836. * All the other properties are configurations that could be tweaked.
  2837. * @namespace modifiers
  2838. */
  2839. var modifiers = {
  2840. /**
  2841. * Modifier used to shift the popper on the start or end of its reference
  2842. * element.<br />
  2843. * It will read the variation of the `placement` property.<br />
  2844. * It can be one either `-end` or `-start`.
  2845. * @memberof modifiers
  2846. * @inner
  2847. */
  2848. shift: {
  2849. /** @prop {number} order=100 - Index used to define the order of execution */
  2850. order: 100,
  2851. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  2852. enabled: true,
  2853. /** @prop {ModifierFn} */
  2854. fn: shift
  2855. },
  2856. /**
  2857. * The `offset` modifier can shift your popper on both its axis.
  2858. *
  2859. * It accepts the following units:
  2860. * - `px` or unitless, interpreted as pixels
  2861. * - `%` or `%r`, percentage relative to the length of the reference element
  2862. * - `%p`, percentage relative to the length of the popper element
  2863. * - `vw`, CSS viewport width unit
  2864. * - `vh`, CSS viewport height unit
  2865. *
  2866. * For length is intended the main axis relative to the placement of the popper.<br />
  2867. * This means that if the placement is `top` or `bottom`, the length will be the
  2868. * `width`. In case of `left` or `right`, it will be the height.
  2869. *
  2870. * You can provide a single value (as `Number` or `String`), or a pair of values
  2871. * as `String` divided by a comma or one (or more) white spaces.<br />
  2872. * The latter is a deprecated method because it leads to confusion and will be
  2873. * removed in v2.<br />
  2874. * Additionally, it accepts additions and subtractions between different units.
  2875. * Note that multiplications and divisions aren't supported.
  2876. *
  2877. * Valid examples are:
  2878. * ```
  2879. * 10
  2880. * '10%'
  2881. * '10, 10'
  2882. * '10%, 10'
  2883. * '10 + 10%'
  2884. * '10 - 5vh + 3%'
  2885. * '-10px + 5vh, 5px - 6%'
  2886. * ```
  2887. * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
  2888. * > with their reference element, unfortunately, you will have to disable the `flip` modifier.
  2889. * > More on this [reading this issue](https://github.com/FezVrasta/popper.js/issues/373)
  2890. *
  2891. * @memberof modifiers
  2892. * @inner
  2893. */
  2894. offset: {
  2895. /** @prop {number} order=200 - Index used to define the order of execution */
  2896. order: 200,
  2897. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  2898. enabled: true,
  2899. /** @prop {ModifierFn} */
  2900. fn: offset,
  2901. /** @prop {Number|String} offset=0
  2902. * The offset value as described in the modifier description
  2903. */
  2904. offset: 0
  2905. },
  2906. /**
  2907. * Modifier used to prevent the popper from being positioned outside the boundary.
  2908. *
  2909. * An scenario exists where the reference itself is not within the boundaries.<br />
  2910. * We can say it has "escaped the boundaries" — or just "escaped".<br />
  2911. * In this case we need to decide whether the popper should either:
  2912. *
  2913. * - detach from the reference and remain "trapped" in the boundaries, or
  2914. * - if it should ignore the boundary and "escape with its reference"
  2915. *
  2916. * When `escapeWithReference` is set to`true` and reference is completely
  2917. * outside its boundaries, the popper will overflow (or completely leave)
  2918. * the boundaries in order to remain attached to the edge of the reference.
  2919. *
  2920. * @memberof modifiers
  2921. * @inner
  2922. */
  2923. preventOverflow: {
  2924. /** @prop {number} order=300 - Index used to define the order of execution */
  2925. order: 300,
  2926. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  2927. enabled: true,
  2928. /** @prop {ModifierFn} */
  2929. fn: preventOverflow,
  2930. /**
  2931. * @prop {Array} [priority=['left','right','top','bottom']]
  2932. * Popper will try to prevent overflow following these priorities by default,
  2933. * then, it could overflow on the left and on top of the `boundariesElement`
  2934. */
  2935. priority: ['left', 'right', 'top', 'bottom'],
  2936. /**
  2937. * @prop {number} padding=5
  2938. * Amount of pixel used to define a minimum distance between the boundaries
  2939. * and the popper this makes sure the popper has always a little padding
  2940. * between the edges of its container
  2941. */
  2942. padding: 5,
  2943. /**
  2944. * @prop {String|HTMLElement} boundariesElement='scrollParent'
  2945. * Boundaries used by the modifier, can be `scrollParent`, `window`,
  2946. * `viewport` or any DOM element.
  2947. */
  2948. boundariesElement: 'scrollParent'
  2949. },
  2950. /**
  2951. * Modifier used to make sure the reference and its popper stay near eachothers
  2952. * without leaving any gap between the two. Expecially useful when the arrow is
  2953. * enabled and you want to assure it to point to its reference element.
  2954. * It cares only about the first axis, you can still have poppers with margin
  2955. * between the popper and its reference element.
  2956. * @memberof modifiers
  2957. * @inner
  2958. */
  2959. keepTogether: {
  2960. /** @prop {number} order=400 - Index used to define the order of execution */
  2961. order: 400,
  2962. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  2963. enabled: true,
  2964. /** @prop {ModifierFn} */
  2965. fn: keepTogether
  2966. },
  2967. /**
  2968. * This modifier is used to move the `arrowElement` of the popper to make
  2969. * sure it is positioned between the reference element and its popper element.
  2970. * It will read the outer size of the `arrowElement` node to detect how many
  2971. * pixels of conjuction are needed.
  2972. *
  2973. * It has no effect if no `arrowElement` is provided.
  2974. * @memberof modifiers
  2975. * @inner
  2976. */
  2977. arrow: {
  2978. /** @prop {number} order=500 - Index used to define the order of execution */
  2979. order: 500,
  2980. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  2981. enabled: true,
  2982. /** @prop {ModifierFn} */
  2983. fn: arrow,
  2984. /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
  2985. element: '[x-arrow]'
  2986. },
  2987. /**
  2988. * Modifier used to flip the popper's placement when it starts to overlap its
  2989. * reference element.
  2990. *
  2991. * Requires the `preventOverflow` modifier before it in order to work.
  2992. *
  2993. * **NOTE:** this modifier will interrupt the current update cycle and will
  2994. * restart it if it detects the need to flip the placement.
  2995. * @memberof modifiers
  2996. * @inner
  2997. */
  2998. flip: {
  2999. /** @prop {number} order=600 - Index used to define the order of execution */
  3000. order: 600,
  3001. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  3002. enabled: true,
  3003. /** @prop {ModifierFn} */
  3004. fn: flip,
  3005. /**
  3006. * @prop {String|Array} behavior='flip'
  3007. * The behavior used to change the popper's placement. It can be one of
  3008. * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
  3009. * placements (with optional variations).
  3010. */
  3011. behavior: 'flip',
  3012. /**
  3013. * @prop {number} padding=5
  3014. * The popper will flip if it hits the edges of the `boundariesElement`
  3015. */
  3016. padding: 5,
  3017. /**
  3018. * @prop {String|HTMLElement} boundariesElement='viewport'
  3019. * The element which will define the boundaries of the popper position,
  3020. * the popper will never be placed outside of the defined boundaries
  3021. * (except if keepTogether is enabled)
  3022. */
  3023. boundariesElement: 'viewport'
  3024. },
  3025. /**
  3026. * Modifier used to make the popper flow toward the inner of the reference element.
  3027. * By default, when this modifier is disabled, the popper will be placed outside
  3028. * the reference element.
  3029. * @memberof modifiers
  3030. * @inner
  3031. */
  3032. inner: {
  3033. /** @prop {number} order=700 - Index used to define the order of execution */
  3034. order: 700,
  3035. /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
  3036. enabled: false,
  3037. /** @prop {ModifierFn} */
  3038. fn: inner
  3039. },
  3040. /**
  3041. * Modifier used to hide the popper when its reference element is outside of the
  3042. * popper boundaries. It will set a `x-out-of-boundaries` attribute which can
  3043. * be used to hide with a CSS selector the popper when its reference is
  3044. * out of boundaries.
  3045. *
  3046. * Requires the `preventOverflow` modifier before it in order to work.
  3047. * @memberof modifiers
  3048. * @inner
  3049. */
  3050. hide: {
  3051. /** @prop {number} order=800 - Index used to define the order of execution */
  3052. order: 800,
  3053. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  3054. enabled: true,
  3055. /** @prop {ModifierFn} */
  3056. fn: hide
  3057. },
  3058. /**
  3059. * Computes the style that will be applied to the popper element to gets
  3060. * properly positioned.
  3061. *
  3062. * Note that this modifier will not touch the DOM, it just prepares the styles
  3063. * so that `applyStyle` modifier can apply it. This separation is useful
  3064. * in case you need to replace `applyStyle` with a custom implementation.
  3065. *
  3066. * This modifier has `850` as `order` value to maintain backward compatibility
  3067. * with previous versions of Popper.js. Expect the modifiers ordering method
  3068. * to change in future major versions of the library.
  3069. *
  3070. * @memberof modifiers
  3071. * @inner
  3072. */
  3073. computeStyle: {
  3074. /** @prop {number} order=850 - Index used to define the order of execution */
  3075. order: 850,
  3076. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  3077. enabled: true,
  3078. /** @prop {ModifierFn} */
  3079. fn: computeStyle,
  3080. /**
  3081. * @prop {Boolean} gpuAcceleration=true
  3082. * If true, it uses the CSS 3d transformation to position the popper.
  3083. * Otherwise, it will use the `top` and `left` properties.
  3084. */
  3085. gpuAcceleration: true,
  3086. /**
  3087. * @prop {string} [x='bottom']
  3088. * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
  3089. * Change this if your popper should grow in a direction different from `bottom`
  3090. */
  3091. x: 'bottom',
  3092. /**
  3093. * @prop {string} [x='left']
  3094. * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
  3095. * Change this if your popper should grow in a direction different from `right`
  3096. */
  3097. y: 'right'
  3098. },
  3099. /**
  3100. * Applies the computed styles to the popper element.
  3101. *
  3102. * All the DOM manipulations are limited to this modifier. This is useful in case
  3103. * you want to integrate Popper.js inside a framework or view library and you
  3104. * want to delegate all the DOM manipulations to it.
  3105. *
  3106. * Note that if you disable this modifier, you must make sure the popper element
  3107. * has its position set to `absolute` before Popper.js can do its work!
  3108. *
  3109. * Just disable this modifier and define you own to achieve the desired effect.
  3110. *
  3111. * @memberof modifiers
  3112. * @inner
  3113. */
  3114. applyStyle: {
  3115. /** @prop {number} order=900 - Index used to define the order of execution */
  3116. order: 900,
  3117. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  3118. enabled: true,
  3119. /** @prop {ModifierFn} */
  3120. fn: applyStyle,
  3121. /** @prop {Function} */
  3122. onLoad: applyStyleOnLoad,
  3123. /**
  3124. * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
  3125. * @prop {Boolean} gpuAcceleration=true
  3126. * If true, it uses the CSS 3d transformation to position the popper.
  3127. * Otherwise, it will use the `top` and `left` properties.
  3128. */
  3129. gpuAcceleration: undefined
  3130. }
  3131. };
  3132. /**
  3133. * The `dataObject` is an object containing all the informations used by Popper.js
  3134. * this object get passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
  3135. * @name dataObject
  3136. * @property {Object} data.instance The Popper.js instance
  3137. * @property {String} data.placement Placement applied to popper
  3138. * @property {String} data.originalPlacement Placement originally defined on init
  3139. * @property {Boolean} data.flipped True if popper has been flipped by flip modifier
  3140. * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper.
  3141. * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
  3142. * @property {Object} data.styles Any CSS property defined here will be applied to the popper, it expects the JavaScript nomenclature (eg. `marginBottom`)
  3143. * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow, it expects the JavaScript nomenclature (eg. `marginBottom`)
  3144. * @property {Object} data.boundaries Offsets of the popper boundaries
  3145. * @property {Object} data.offsets The measurements of popper, reference and arrow elements.
  3146. * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
  3147. * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
  3148. * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
  3149. */
  3150. /**
  3151. * Default options provided to Popper.js constructor.<br />
  3152. * These can be overriden using the `options` argument of Popper.js.<br />
  3153. * To override an option, simply pass as 3rd argument an object with the same
  3154. * structure of this object, example:
  3155. * ```
  3156. * new Popper(ref, pop, {
  3157. * modifiers: {
  3158. * preventOverflow: { enabled: false }
  3159. * }
  3160. * })
  3161. * ```
  3162. * @type {Object}
  3163. * @static
  3164. * @memberof Popper
  3165. */
  3166. var Defaults = {
  3167. /**
  3168. * Popper's placement
  3169. * @prop {Popper.placements} placement='bottom'
  3170. */
  3171. placement: 'bottom',
  3172. /**
  3173. * Set this to true if you want popper to position it self in 'fixed' mode
  3174. * @prop {Boolean} positionFixed=false
  3175. */
  3176. positionFixed: false,
  3177. /**
  3178. * Whether events (resize, scroll) are initially enabled
  3179. * @prop {Boolean} eventsEnabled=true
  3180. */
  3181. eventsEnabled: true,
  3182. /**
  3183. * Set to true if you want to automatically remove the popper when
  3184. * you call the `destroy` method.
  3185. * @prop {Boolean} removeOnDestroy=false
  3186. */
  3187. removeOnDestroy: false,
  3188. /**
  3189. * Callback called when the popper is created.<br />
  3190. * By default, is set to no-op.<br />
  3191. * Access Popper.js instance with `data.instance`.
  3192. * @prop {onCreate}
  3193. */
  3194. onCreate: function onCreate() {},
  3195. /**
  3196. * Callback called when the popper is updated, this callback is not called
  3197. * on the initialization/creation of the popper, but only on subsequent
  3198. * updates.<br />
  3199. * By default, is set to no-op.<br />
  3200. * Access Popper.js instance with `data.instance`.
  3201. * @prop {onUpdate}
  3202. */
  3203. onUpdate: function onUpdate() {},
  3204. /**
  3205. * List of modifiers used to modify the offsets before they are applied to the popper.
  3206. * They provide most of the functionalities of Popper.js
  3207. * @prop {modifiers}
  3208. */
  3209. modifiers: modifiers
  3210. };
  3211. /**
  3212. * @callback onCreate
  3213. * @param {dataObject} data
  3214. */
  3215. /**
  3216. * @callback onUpdate
  3217. * @param {dataObject} data
  3218. */
  3219. // Utils
  3220. // Methods
  3221. var Popper = function () {
  3222. /**
  3223. * Create a new Popper.js instance
  3224. * @class Popper
  3225. * @param {HTMLElement|referenceObject} reference - The reference element used to position the popper
  3226. * @param {HTMLElement} popper - The HTML element used as popper.
  3227. * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
  3228. * @return {Object} instance - The generated Popper.js instance
  3229. */
  3230. function Popper(reference, popper) {
  3231. var _this = this;
  3232. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  3233. classCallCheck(this, Popper);
  3234. this.scheduleUpdate = function () {
  3235. return requestAnimationFrame(_this.update);
  3236. };
  3237. // make update() debounced, so that it only runs at most once-per-tick
  3238. this.update = debounce(this.update.bind(this));
  3239. // with {} we create a new object with the options inside it
  3240. this.options = _extends({}, Popper.Defaults, options);
  3241. // init state
  3242. this.state = {
  3243. isDestroyed: false,
  3244. isCreated: false,
  3245. scrollParents: []
  3246. };
  3247. // get reference and popper elements (allow jQuery wrappers)
  3248. this.reference = reference && reference.jquery ? reference[0] : reference;
  3249. this.popper = popper && popper.jquery ? popper[0] : popper;
  3250. // Deep merge modifiers options
  3251. this.options.modifiers = {};
  3252. Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
  3253. _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
  3254. });
  3255. // Refactoring modifiers' list (Object => Array)
  3256. this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
  3257. return _extends({
  3258. name: name
  3259. }, _this.options.modifiers[name]);
  3260. })
  3261. // sort the modifiers by order
  3262. .sort(function (a, b) {
  3263. return a.order - b.order;
  3264. });
  3265. // modifiers have the ability to execute arbitrary code when Popper.js get inited
  3266. // such code is executed in the same order of its modifier
  3267. // they could add new properties to their options configuration
  3268. // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
  3269. this.modifiers.forEach(function (modifierOptions) {
  3270. if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
  3271. modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
  3272. }
  3273. });
  3274. // fire the first update to position the popper in the right place
  3275. this.update();
  3276. var eventsEnabled = this.options.eventsEnabled;
  3277. if (eventsEnabled) {
  3278. // setup event listeners, they will take care of update the position in specific situations
  3279. this.enableEventListeners();
  3280. }
  3281. this.state.eventsEnabled = eventsEnabled;
  3282. }
  3283. // We can't use class properties because they don't get listed in the
  3284. // class prototype and break stuff like Sinon stubs
  3285. createClass(Popper, [{
  3286. key: 'update',
  3287. value: function update$$1() {
  3288. return update.call(this);
  3289. }
  3290. }, {
  3291. key: 'destroy',
  3292. value: function destroy$$1() {
  3293. return destroy.call(this);
  3294. }
  3295. }, {
  3296. key: 'enableEventListeners',
  3297. value: function enableEventListeners$$1() {
  3298. return enableEventListeners.call(this);
  3299. }
  3300. }, {
  3301. key: 'disableEventListeners',
  3302. value: function disableEventListeners$$1() {
  3303. return disableEventListeners.call(this);
  3304. }
  3305. /**
  3306. * Schedule an update, it will run on the next UI update available
  3307. * @method scheduleUpdate
  3308. * @memberof Popper
  3309. */
  3310. /**
  3311. * Collection of utilities useful when writing custom modifiers.
  3312. * Starting from version 1.7, this method is available only if you
  3313. * include `popper-utils.js` before `popper.js`.
  3314. *
  3315. * **DEPRECATION**: This way to access PopperUtils is deprecated
  3316. * and will be removed in v2! Use the PopperUtils module directly instead.
  3317. * Due to the high instability of the methods contained in Utils, we can't
  3318. * guarantee them to follow semver. Use them at your own risk!
  3319. * @static
  3320. * @private
  3321. * @type {Object}
  3322. * @deprecated since version 1.8
  3323. * @member Utils
  3324. * @memberof Popper
  3325. */
  3326. }]);
  3327. return Popper;
  3328. }();
  3329. /**
  3330. * The `referenceObject` is an object that provides an interface compatible with Popper.js
  3331. * and lets you use it as replacement of a real DOM node.<br />
  3332. * You can use this method to position a popper relatively to a set of coordinates
  3333. * in case you don't have a DOM node to use as reference.
  3334. *
  3335. * ```
  3336. * new Popper(referenceObject, popperNode);
  3337. * ```
  3338. *
  3339. * NB: This feature isn't supported in Internet Explorer 10
  3340. * @name referenceObject
  3341. * @property {Function} data.getBoundingClientRect
  3342. * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
  3343. * @property {number} data.clientWidth
  3344. * An ES6 getter that will return the width of the virtual reference element.
  3345. * @property {number} data.clientHeight
  3346. * An ES6 getter that will return the height of the virtual reference element.
  3347. */
  3348. Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
  3349. Popper.placements = placements;
  3350. Popper.Defaults = Defaults;
  3351. /**
  3352. * --------------------------------------------------------------------------
  3353. * Bootstrap (v4.1.3): dropdown.js
  3354. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  3355. * --------------------------------------------------------------------------
  3356. */
  3357. var Dropdown = function ($$$1) {
  3358. /**
  3359. * ------------------------------------------------------------------------
  3360. * Constants
  3361. * ------------------------------------------------------------------------
  3362. */
  3363. var NAME = 'dropdown';
  3364. var VERSION = '4.1.3';
  3365. var DATA_KEY = 'bs.dropdown';
  3366. var EVENT_KEY = "." + DATA_KEY;
  3367. var DATA_API_KEY = '.data-api';
  3368. var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
  3369. var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
  3370. var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
  3371. var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key
  3372. var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
  3373. var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
  3374. var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
  3375. var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
  3376. var Event = {
  3377. HIDE: "hide" + EVENT_KEY,
  3378. HIDDEN: "hidden" + EVENT_KEY,
  3379. SHOW: "show" + EVENT_KEY,
  3380. SHOWN: "shown" + EVENT_KEY,
  3381. CLICK: "click" + EVENT_KEY,
  3382. CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY,
  3383. KEYDOWN_DATA_API: "keydown" + EVENT_KEY + DATA_API_KEY,
  3384. KEYUP_DATA_API: "keyup" + EVENT_KEY + DATA_API_KEY
  3385. };
  3386. var ClassName = {
  3387. DISABLED: 'disabled',
  3388. SHOW: 'show',
  3389. DROPUP: 'dropup',
  3390. DROPRIGHT: 'dropright',
  3391. DROPLEFT: 'dropleft',
  3392. MENURIGHT: 'dropdown-menu-right',
  3393. MENULEFT: 'dropdown-menu-left',
  3394. POSITION_STATIC: 'position-static'
  3395. };
  3396. var Selector = {
  3397. DATA_TOGGLE: '[data-toggle="dropdown"]',
  3398. FORM_CHILD: '.dropdown form',
  3399. MENU: '.dropdown-menu',
  3400. NAVBAR_NAV: '.navbar-nav',
  3401. VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'
  3402. };
  3403. var AttachmentMap = {
  3404. TOP: 'top-start',
  3405. TOPEND: 'top-end',
  3406. BOTTOM: 'bottom-start',
  3407. BOTTOMEND: 'bottom-end',
  3408. RIGHT: 'right-start',
  3409. RIGHTEND: 'right-end',
  3410. LEFT: 'left-start',
  3411. LEFTEND: 'left-end'
  3412. };
  3413. var Default = {
  3414. offset: 0,
  3415. flip: true,
  3416. boundary: 'scrollParent',
  3417. reference: 'toggle',
  3418. display: 'dynamic'
  3419. };
  3420. var DefaultType = {
  3421. offset: '(number|string|function)',
  3422. flip: 'boolean',
  3423. boundary: '(string|element)',
  3424. reference: '(string|element)',
  3425. display: 'string'
  3426. /**
  3427. * ------------------------------------------------------------------------
  3428. * Class Definition
  3429. * ------------------------------------------------------------------------
  3430. */
  3431. };
  3432. var Dropdown =
  3433. /*#__PURE__*/
  3434. function () {
  3435. function Dropdown(element, config) {
  3436. this._element = element;
  3437. this._popper = null;
  3438. this._config = this._getConfig(config);
  3439. this._menu = this._getMenuElement();
  3440. this._inNavbar = this._detectNavbar();
  3441. this._addEventListeners();
  3442. } // Getters
  3443. var _proto = Dropdown.prototype;
  3444. // Public
  3445. _proto.toggle = function toggle() {
  3446. if (this._element.disabled || $$$1(this._element).hasClass(ClassName.DISABLED)) {
  3447. return;
  3448. }
  3449. var parent = Dropdown._getParentFromElement(this._element);
  3450. var isActive = $$$1(this._menu).hasClass(ClassName.SHOW);
  3451. Dropdown._clearMenus();
  3452. if (isActive) {
  3453. return;
  3454. }
  3455. var relatedTarget = {
  3456. relatedTarget: this._element
  3457. };
  3458. var showEvent = $$$1.Event(Event.SHOW, relatedTarget);
  3459. $$$1(parent).trigger(showEvent);
  3460. if (showEvent.isDefaultPrevented()) {
  3461. return;
  3462. } // Disable totally Popper.js for Dropdown in Navbar
  3463. if (!this._inNavbar) {
  3464. /**
  3465. * Check for Popper dependency
  3466. * Popper - https://popper.js.org
  3467. */
  3468. if (typeof Popper === 'undefined') {
  3469. throw new TypeError('Bootstrap dropdown require Popper.js (https://popper.js.org)');
  3470. }
  3471. var referenceElement = this._element;
  3472. if (this._config.reference === 'parent') {
  3473. referenceElement = parent;
  3474. } else if (Util.isElement(this._config.reference)) {
  3475. referenceElement = this._config.reference; // Check if it's jQuery element
  3476. if (typeof this._config.reference.jquery !== 'undefined') {
  3477. referenceElement = this._config.reference[0];
  3478. }
  3479. } // If boundary is not `scrollParent`, then set position to `static`
  3480. // to allow the menu to "escape" the scroll parent's boundaries
  3481. // https://github.com/twbs/bootstrap/issues/24251
  3482. if (this._config.boundary !== 'scrollParent') {
  3483. $$$1(parent).addClass(ClassName.POSITION_STATIC);
  3484. }
  3485. this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());
  3486. } // If this is a touch-enabled device we add extra
  3487. // empty mouseover listeners to the body's immediate children;
  3488. // only needed because of broken event delegation on iOS
  3489. // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
  3490. if ('ontouchstart' in document.documentElement && $$$1(parent).closest(Selector.NAVBAR_NAV).length === 0) {
  3491. $$$1(document.body).children().on('mouseover', null, $$$1.noop);
  3492. }
  3493. this._element.focus();
  3494. this._element.setAttribute('aria-expanded', true);
  3495. $$$1(this._menu).toggleClass(ClassName.SHOW);
  3496. $$$1(parent).toggleClass(ClassName.SHOW).trigger($$$1.Event(Event.SHOWN, relatedTarget));
  3497. };
  3498. _proto.dispose = function dispose() {
  3499. $$$1.removeData(this._element, DATA_KEY);
  3500. $$$1(this._element).off(EVENT_KEY);
  3501. this._element = null;
  3502. this._menu = null;
  3503. if (this._popper !== null) {
  3504. this._popper.destroy();
  3505. this._popper = null;
  3506. }
  3507. };
  3508. _proto.update = function update() {
  3509. this._inNavbar = this._detectNavbar();
  3510. if (this._popper !== null) {
  3511. this._popper.scheduleUpdate();
  3512. }
  3513. }; // Private
  3514. _proto._addEventListeners = function _addEventListeners() {
  3515. var _this = this;
  3516. $$$1(this._element).on(Event.CLICK, function (event) {
  3517. event.preventDefault();
  3518. event.stopPropagation();
  3519. _this.toggle();
  3520. });
  3521. };
  3522. _proto._getConfig = function _getConfig(config) {
  3523. config = _objectSpread({}, this.constructor.Default, $$$1(this._element).data(), config);
  3524. Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
  3525. return config;
  3526. };
  3527. _proto._getMenuElement = function _getMenuElement() {
  3528. if (!this._menu) {
  3529. var parent = Dropdown._getParentFromElement(this._element);
  3530. if (parent) {
  3531. this._menu = parent.querySelector(Selector.MENU);
  3532. }
  3533. }
  3534. return this._menu;
  3535. };
  3536. _proto._getPlacement = function _getPlacement() {
  3537. var $parentDropdown = $$$1(this._element.parentNode);
  3538. var placement = AttachmentMap.BOTTOM; // Handle dropup
  3539. if ($parentDropdown.hasClass(ClassName.DROPUP)) {
  3540. placement = AttachmentMap.TOP;
  3541. if ($$$1(this._menu).hasClass(ClassName.MENURIGHT)) {
  3542. placement = AttachmentMap.TOPEND;
  3543. }
  3544. } else if ($parentDropdown.hasClass(ClassName.DROPRIGHT)) {
  3545. placement = AttachmentMap.RIGHT;
  3546. } else if ($parentDropdown.hasClass(ClassName.DROPLEFT)) {
  3547. placement = AttachmentMap.LEFT;
  3548. } else if ($$$1(this._menu).hasClass(ClassName.MENURIGHT)) {
  3549. placement = AttachmentMap.BOTTOMEND;
  3550. }
  3551. return placement;
  3552. };
  3553. _proto._detectNavbar = function _detectNavbar() {
  3554. return $$$1(this._element).closest('.navbar').length > 0;
  3555. };
  3556. _proto._getPopperConfig = function _getPopperConfig() {
  3557. var _this2 = this;
  3558. var offsetConf = {};
  3559. if (typeof this._config.offset === 'function') {
  3560. offsetConf.fn = function (data) {
  3561. data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets) || {});
  3562. return data;
  3563. };
  3564. } else {
  3565. offsetConf.offset = this._config.offset;
  3566. }
  3567. var popperConfig = {
  3568. placement: this._getPlacement(),
  3569. modifiers: {
  3570. offset: offsetConf,
  3571. flip: {
  3572. enabled: this._config.flip
  3573. },
  3574. preventOverflow: {
  3575. boundariesElement: this._config.boundary
  3576. }
  3577. } // Disable Popper.js if we have a static display
  3578. };
  3579. if (this._config.display === 'static') {
  3580. popperConfig.modifiers.applyStyle = {
  3581. enabled: false
  3582. };
  3583. }
  3584. return popperConfig;
  3585. }; // Static
  3586. Dropdown._jQueryInterface = function _jQueryInterface(config) {
  3587. return this.each(function () {
  3588. var data = $$$1(this).data(DATA_KEY);
  3589. var _config = typeof config === 'object' ? config : null;
  3590. if (!data) {
  3591. data = new Dropdown(this, _config);
  3592. $$$1(this).data(DATA_KEY, data);
  3593. }
  3594. if (typeof config === 'string') {
  3595. if (typeof data[config] === 'undefined') {
  3596. throw new TypeError("No method named \"" + config + "\"");
  3597. }
  3598. data[config]();
  3599. }
  3600. });
  3601. };
  3602. Dropdown._clearMenus = function _clearMenus(event) {
  3603. if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
  3604. return;
  3605. }
  3606. var toggles = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE));
  3607. for (var i = 0, len = toggles.length; i < len; i++) {
  3608. var parent = Dropdown._getParentFromElement(toggles[i]);
  3609. var context = $$$1(toggles[i]).data(DATA_KEY);
  3610. var relatedTarget = {
  3611. relatedTarget: toggles[i]
  3612. };
  3613. if (event && event.type === 'click') {
  3614. relatedTarget.clickEvent = event;
  3615. }
  3616. if (!context) {
  3617. continue;
  3618. }
  3619. var dropdownMenu = context._menu;
  3620. if (!$$$1(parent).hasClass(ClassName.SHOW)) {
  3621. continue;
  3622. }
  3623. if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $$$1.contains(parent, event.target)) {
  3624. continue;
  3625. }
  3626. var hideEvent = $$$1.Event(Event.HIDE, relatedTarget);
  3627. $$$1(parent).trigger(hideEvent);
  3628. if (hideEvent.isDefaultPrevented()) {
  3629. continue;
  3630. } // If this is a touch-enabled device we remove the extra
  3631. // empty mouseover listeners we added for iOS support
  3632. if ('ontouchstart' in document.documentElement) {
  3633. $$$1(document.body).children().off('mouseover', null, $$$1.noop);
  3634. }
  3635. toggles[i].setAttribute('aria-expanded', 'false');
  3636. $$$1(dropdownMenu).removeClass(ClassName.SHOW);
  3637. $$$1(parent).removeClass(ClassName.SHOW).trigger($$$1.Event(Event.HIDDEN, relatedTarget));
  3638. }
  3639. };
  3640. Dropdown._getParentFromElement = function _getParentFromElement(element) {
  3641. var parent;
  3642. var selector = Util.getSelectorFromElement(element);
  3643. if (selector) {
  3644. parent = document.querySelector(selector);
  3645. }
  3646. return parent || element.parentNode;
  3647. }; // eslint-disable-next-line complexity
  3648. Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
  3649. // If not input/textarea:
  3650. // - And not a key in REGEXP_KEYDOWN => not a dropdown command
  3651. // If input/textarea:
  3652. // - If space key => not a dropdown command
  3653. // - If key is other than escape
  3654. // - If key is not up or down => not a dropdown command
  3655. // - If trigger inside the menu => not a dropdown command
  3656. if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $$$1(event.target).closest(Selector.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
  3657. return;
  3658. }
  3659. event.preventDefault();
  3660. event.stopPropagation();
  3661. if (this.disabled || $$$1(this).hasClass(ClassName.DISABLED)) {
  3662. return;
  3663. }
  3664. var parent = Dropdown._getParentFromElement(this);
  3665. var isActive = $$$1(parent).hasClass(ClassName.SHOW);
  3666. if (!isActive && (event.which !== ESCAPE_KEYCODE || event.which !== SPACE_KEYCODE) || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
  3667. if (event.which === ESCAPE_KEYCODE) {
  3668. var toggle = parent.querySelector(Selector.DATA_TOGGLE);
  3669. $$$1(toggle).trigger('focus');
  3670. }
  3671. $$$1(this).trigger('click');
  3672. return;
  3673. }
  3674. var items = [].slice.call(parent.querySelectorAll(Selector.VISIBLE_ITEMS));
  3675. if (items.length === 0) {
  3676. return;
  3677. }
  3678. var index = items.indexOf(event.target);
  3679. if (event.which === ARROW_UP_KEYCODE && index > 0) {
  3680. // Up
  3681. index--;
  3682. }
  3683. if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
  3684. // Down
  3685. index++;
  3686. }
  3687. if (index < 0) {
  3688. index = 0;
  3689. }
  3690. items[index].focus();
  3691. };
  3692. _createClass(Dropdown, null, [{
  3693. key: "VERSION",
  3694. get: function get() {
  3695. return VERSION;
  3696. }
  3697. }, {
  3698. key: "Default",
  3699. get: function get() {
  3700. return Default;
  3701. }
  3702. }, {
  3703. key: "DefaultType",
  3704. get: function get() {
  3705. return DefaultType;
  3706. }
  3707. }]);
  3708. return Dropdown;
  3709. }();
  3710. /**
  3711. * ------------------------------------------------------------------------
  3712. * Data Api implementation
  3713. * ------------------------------------------------------------------------
  3714. */
  3715. $$$1(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API + " " + Event.KEYUP_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
  3716. event.preventDefault();
  3717. event.stopPropagation();
  3718. Dropdown._jQueryInterface.call($$$1(this), 'toggle');
  3719. }).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) {
  3720. e.stopPropagation();
  3721. });
  3722. /**
  3723. * ------------------------------------------------------------------------
  3724. * jQuery
  3725. * ------------------------------------------------------------------------
  3726. */
  3727. $$$1.fn[NAME] = Dropdown._jQueryInterface;
  3728. $$$1.fn[NAME].Constructor = Dropdown;
  3729. $$$1.fn[NAME].noConflict = function () {
  3730. $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
  3731. return Dropdown._jQueryInterface;
  3732. };
  3733. return Dropdown;
  3734. }($, Popper);
  3735. /**
  3736. * --------------------------------------------------------------------------
  3737. * Bootstrap (v4.1.3): modal.js
  3738. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  3739. * --------------------------------------------------------------------------
  3740. */
  3741. var Modal = function ($$$1) {
  3742. /**
  3743. * ------------------------------------------------------------------------
  3744. * Constants
  3745. * ------------------------------------------------------------------------
  3746. */
  3747. var NAME = 'modal';
  3748. var VERSION = '4.1.3';
  3749. var DATA_KEY = 'bs.modal';
  3750. var EVENT_KEY = "." + DATA_KEY;
  3751. var DATA_API_KEY = '.data-api';
  3752. var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
  3753. var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
  3754. var Default = {
  3755. backdrop: true,
  3756. keyboard: true,
  3757. focus: true,
  3758. show: true
  3759. };
  3760. var DefaultType = {
  3761. backdrop: '(boolean|string)',
  3762. keyboard: 'boolean',
  3763. focus: 'boolean',
  3764. show: 'boolean'
  3765. };
  3766. var Event = {
  3767. HIDE: "hide" + EVENT_KEY,
  3768. HIDDEN: "hidden" + EVENT_KEY,
  3769. SHOW: "show" + EVENT_KEY,
  3770. SHOWN: "shown" + EVENT_KEY,
  3771. FOCUSIN: "focusin" + EVENT_KEY,
  3772. RESIZE: "resize" + EVENT_KEY,
  3773. CLICK_DISMISS: "click.dismiss" + EVENT_KEY,
  3774. KEYDOWN_DISMISS: "keydown.dismiss" + EVENT_KEY,
  3775. MOUSEUP_DISMISS: "mouseup.dismiss" + EVENT_KEY,
  3776. MOUSEDOWN_DISMISS: "mousedown.dismiss" + EVENT_KEY,
  3777. CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
  3778. };
  3779. var ClassName = {
  3780. SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
  3781. BACKDROP: 'modal-backdrop',
  3782. OPEN: 'modal-open',
  3783. FADE: 'fade',
  3784. SHOW: 'show'
  3785. };
  3786. var Selector = {
  3787. DIALOG: '.modal-dialog',
  3788. DATA_TOGGLE: '[data-toggle="modal"]',
  3789. DATA_DISMISS: '[data-dismiss="modal"]',
  3790. FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
  3791. STICKY_CONTENT: '.sticky-top'
  3792. /**
  3793. * ------------------------------------------------------------------------
  3794. * Class Definition
  3795. * ------------------------------------------------------------------------
  3796. */
  3797. };
  3798. var Modal =
  3799. /*#__PURE__*/
  3800. function () {
  3801. function Modal(element, config) {
  3802. this._config = this._getConfig(config);
  3803. this._element = element;
  3804. this._dialog = element.querySelector(Selector.DIALOG);
  3805. this._backdrop = null;
  3806. this._isShown = false;
  3807. this._isBodyOverflowing = false;
  3808. this._ignoreBackdropClick = false;
  3809. this._scrollbarWidth = 0;
  3810. } // Getters
  3811. var _proto = Modal.prototype;
  3812. // Public
  3813. _proto.toggle = function toggle(relatedTarget) {
  3814. return this._isShown ? this.hide() : this.show(relatedTarget);
  3815. };
  3816. _proto.show = function show(relatedTarget) {
  3817. var _this = this;
  3818. if (this._isTransitioning || this._isShown) {
  3819. return;
  3820. }
  3821. if ($$$1(this._element).hasClass(ClassName.FADE)) {
  3822. this._isTransitioning = true;
  3823. }
  3824. var showEvent = $$$1.Event(Event.SHOW, {
  3825. relatedTarget: relatedTarget
  3826. });
  3827. $$$1(this._element).trigger(showEvent);
  3828. if (this._isShown || showEvent.isDefaultPrevented()) {
  3829. return;
  3830. }
  3831. this._isShown = true;
  3832. this._checkScrollbar();
  3833. this._setScrollbar();
  3834. this._adjustDialog();
  3835. $$$1(document.body).addClass(ClassName.OPEN);
  3836. this._setEscapeEvent();
  3837. this._setResizeEvent();
  3838. $$$1(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function (event) {
  3839. return _this.hide(event);
  3840. });
  3841. $$$1(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () {
  3842. $$$1(_this._element).one(Event.MOUSEUP_DISMISS, function (event) {
  3843. if ($$$1(event.target).is(_this._element)) {
  3844. _this._ignoreBackdropClick = true;
  3845. }
  3846. });
  3847. });
  3848. this._showBackdrop(function () {
  3849. return _this._showElement(relatedTarget);
  3850. });
  3851. };
  3852. _proto.hide = function hide(event) {
  3853. var _this2 = this;
  3854. if (event) {
  3855. event.preventDefault();
  3856. }
  3857. if (this._isTransitioning || !this._isShown) {
  3858. return;
  3859. }
  3860. var hideEvent = $$$1.Event(Event.HIDE);
  3861. $$$1(this._element).trigger(hideEvent);
  3862. if (!this._isShown || hideEvent.isDefaultPrevented()) {
  3863. return;
  3864. }
  3865. this._isShown = false;
  3866. var transition = $$$1(this._element).hasClass(ClassName.FADE);
  3867. if (transition) {
  3868. this._isTransitioning = true;
  3869. }
  3870. this._setEscapeEvent();
  3871. this._setResizeEvent();
  3872. $$$1(document).off(Event.FOCUSIN);
  3873. $$$1(this._element).removeClass(ClassName.SHOW);
  3874. $$$1(this._element).off(Event.CLICK_DISMISS);
  3875. $$$1(this._dialog).off(Event.MOUSEDOWN_DISMISS);
  3876. if (transition) {
  3877. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  3878. $$$1(this._element).one(Util.TRANSITION_END, function (event) {
  3879. return _this2._hideModal(event);
  3880. }).emulateTransitionEnd(transitionDuration);
  3881. } else {
  3882. this._hideModal();
  3883. }
  3884. };
  3885. _proto.dispose = function dispose() {
  3886. $$$1.removeData(this._element, DATA_KEY);
  3887. $$$1(window, document, this._element, this._backdrop).off(EVENT_KEY);
  3888. this._config = null;
  3889. this._element = null;
  3890. this._dialog = null;
  3891. this._backdrop = null;
  3892. this._isShown = null;
  3893. this._isBodyOverflowing = null;
  3894. this._ignoreBackdropClick = null;
  3895. this._scrollbarWidth = null;
  3896. };
  3897. _proto.handleUpdate = function handleUpdate() {
  3898. this._adjustDialog();
  3899. }; // Private
  3900. _proto._getConfig = function _getConfig(config) {
  3901. config = _objectSpread({}, Default, config);
  3902. Util.typeCheckConfig(NAME, config, DefaultType);
  3903. return config;
  3904. };
  3905. _proto._showElement = function _showElement(relatedTarget) {
  3906. var _this3 = this;
  3907. var transition = $$$1(this._element).hasClass(ClassName.FADE);
  3908. if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
  3909. // Don't move modal's DOM position
  3910. document.body.appendChild(this._element);
  3911. }
  3912. this._element.style.display = 'block';
  3913. this._element.removeAttribute('aria-hidden');
  3914. this._element.scrollTop = 0;
  3915. if (transition) {
  3916. Util.reflow(this._element);
  3917. }
  3918. $$$1(this._element).addClass(ClassName.SHOW);
  3919. if (this._config.focus) {
  3920. this._enforceFocus();
  3921. }
  3922. var shownEvent = $$$1.Event(Event.SHOWN, {
  3923. relatedTarget: relatedTarget
  3924. });
  3925. var transitionComplete = function transitionComplete() {
  3926. if (_this3._config.focus) {
  3927. _this3._element.focus();
  3928. }
  3929. _this3._isTransitioning = false;
  3930. $$$1(_this3._element).trigger(shownEvent);
  3931. };
  3932. if (transition) {
  3933. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  3934. $$$1(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
  3935. } else {
  3936. transitionComplete();
  3937. }
  3938. };
  3939. _proto._enforceFocus = function _enforceFocus() {
  3940. var _this4 = this;
  3941. $$$1(document).off(Event.FOCUSIN) // Guard against infinite focus loop
  3942. .on(Event.FOCUSIN, function (event) {
  3943. if (document !== event.target && _this4._element !== event.target && $$$1(_this4._element).has(event.target).length === 0) {
  3944. _this4._element.focus();
  3945. }
  3946. });
  3947. };
  3948. _proto._setEscapeEvent = function _setEscapeEvent() {
  3949. var _this5 = this;
  3950. if (this._isShown && this._config.keyboard) {
  3951. $$$1(this._element).on(Event.KEYDOWN_DISMISS, function (event) {
  3952. if (event.which === ESCAPE_KEYCODE) {
  3953. event.preventDefault();
  3954. _this5.hide();
  3955. }
  3956. });
  3957. } else if (!this._isShown) {
  3958. $$$1(this._element).off(Event.KEYDOWN_DISMISS);
  3959. }
  3960. };
  3961. _proto._setResizeEvent = function _setResizeEvent() {
  3962. var _this6 = this;
  3963. if (this._isShown) {
  3964. $$$1(window).on(Event.RESIZE, function (event) {
  3965. return _this6.handleUpdate(event);
  3966. });
  3967. } else {
  3968. $$$1(window).off(Event.RESIZE);
  3969. }
  3970. };
  3971. _proto._hideModal = function _hideModal() {
  3972. var _this7 = this;
  3973. this._element.style.display = 'none';
  3974. this._element.setAttribute('aria-hidden', true);
  3975. this._isTransitioning = false;
  3976. this._showBackdrop(function () {
  3977. $$$1(document.body).removeClass(ClassName.OPEN);
  3978. _this7._resetAdjustments();
  3979. _this7._resetScrollbar();
  3980. $$$1(_this7._element).trigger(Event.HIDDEN);
  3981. });
  3982. };
  3983. _proto._removeBackdrop = function _removeBackdrop() {
  3984. if (this._backdrop) {
  3985. $$$1(this._backdrop).remove();
  3986. this._backdrop = null;
  3987. }
  3988. };
  3989. _proto._showBackdrop = function _showBackdrop(callback) {
  3990. var _this8 = this;
  3991. var animate = $$$1(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';
  3992. if (this._isShown && this._config.backdrop) {
  3993. this._backdrop = document.createElement('div');
  3994. this._backdrop.className = ClassName.BACKDROP;
  3995. if (animate) {
  3996. this._backdrop.classList.add(animate);
  3997. }
  3998. $$$1(this._backdrop).appendTo(document.body);
  3999. $$$1(this._element).on(Event.CLICK_DISMISS, function (event) {
  4000. if (_this8._ignoreBackdropClick) {
  4001. _this8._ignoreBackdropClick = false;
  4002. return;
  4003. }
  4004. if (event.target !== event.currentTarget) {
  4005. return;
  4006. }
  4007. if (_this8._config.backdrop === 'static') {
  4008. _this8._element.focus();
  4009. } else {
  4010. _this8.hide();
  4011. }
  4012. });
  4013. if (animate) {
  4014. Util.reflow(this._backdrop);
  4015. }
  4016. $$$1(this._backdrop).addClass(ClassName.SHOW);
  4017. if (!callback) {
  4018. return;
  4019. }
  4020. if (!animate) {
  4021. callback();
  4022. return;
  4023. }
  4024. var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
  4025. $$$1(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
  4026. } else if (!this._isShown && this._backdrop) {
  4027. $$$1(this._backdrop).removeClass(ClassName.SHOW);
  4028. var callbackRemove = function callbackRemove() {
  4029. _this8._removeBackdrop();
  4030. if (callback) {
  4031. callback();
  4032. }
  4033. };
  4034. if ($$$1(this._element).hasClass(ClassName.FADE)) {
  4035. var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
  4036. $$$1(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
  4037. } else {
  4038. callbackRemove();
  4039. }
  4040. } else if (callback) {
  4041. callback();
  4042. }
  4043. }; // ----------------------------------------------------------------------
  4044. // the following methods are used to handle overflowing modals
  4045. // todo (fat): these should probably be refactored out of modal.js
  4046. // ----------------------------------------------------------------------
  4047. _proto._adjustDialog = function _adjustDialog() {
  4048. var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
  4049. if (!this._isBodyOverflowing && isModalOverflowing) {
  4050. this._element.style.paddingLeft = this._scrollbarWidth + "px";
  4051. }
  4052. if (this._isBodyOverflowing && !isModalOverflowing) {
  4053. this._element.style.paddingRight = this._scrollbarWidth + "px";
  4054. }
  4055. };
  4056. _proto._resetAdjustments = function _resetAdjustments() {
  4057. this._element.style.paddingLeft = '';
  4058. this._element.style.paddingRight = '';
  4059. };
  4060. _proto._checkScrollbar = function _checkScrollbar() {
  4061. var rect = document.body.getBoundingClientRect();
  4062. this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;
  4063. this._scrollbarWidth = this._getScrollbarWidth();
  4064. };
  4065. _proto._setScrollbar = function _setScrollbar() {
  4066. var _this9 = this;
  4067. if (this._isBodyOverflowing) {
  4068. // Note: DOMNode.style.paddingRight returns the actual value or '' if not set
  4069. // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
  4070. var fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT));
  4071. var stickyContent = [].slice.call(document.querySelectorAll(Selector.STICKY_CONTENT)); // Adjust fixed content padding
  4072. $$$1(fixedContent).each(function (index, element) {
  4073. var actualPadding = element.style.paddingRight;
  4074. var calculatedPadding = $$$1(element).css('padding-right');
  4075. $$$1(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px");
  4076. }); // Adjust sticky content margin
  4077. $$$1(stickyContent).each(function (index, element) {
  4078. var actualMargin = element.style.marginRight;
  4079. var calculatedMargin = $$$1(element).css('margin-right');
  4080. $$$1(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px");
  4081. }); // Adjust body padding
  4082. var actualPadding = document.body.style.paddingRight;
  4083. var calculatedPadding = $$$1(document.body).css('padding-right');
  4084. $$$1(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
  4085. }
  4086. };
  4087. _proto._resetScrollbar = function _resetScrollbar() {
  4088. // Restore fixed content padding
  4089. var fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT));
  4090. $$$1(fixedContent).each(function (index, element) {
  4091. var padding = $$$1(element).data('padding-right');
  4092. $$$1(element).removeData('padding-right');
  4093. element.style.paddingRight = padding ? padding : '';
  4094. }); // Restore sticky content
  4095. var elements = [].slice.call(document.querySelectorAll("" + Selector.STICKY_CONTENT));
  4096. $$$1(elements).each(function (index, element) {
  4097. var margin = $$$1(element).data('margin-right');
  4098. if (typeof margin !== 'undefined') {
  4099. $$$1(element).css('margin-right', margin).removeData('margin-right');
  4100. }
  4101. }); // Restore body padding
  4102. var padding = $$$1(document.body).data('padding-right');
  4103. $$$1(document.body).removeData('padding-right');
  4104. document.body.style.paddingRight = padding ? padding : '';
  4105. };
  4106. _proto._getScrollbarWidth = function _getScrollbarWidth() {
  4107. // thx d.walsh
  4108. var scrollDiv = document.createElement('div');
  4109. scrollDiv.className = ClassName.SCROLLBAR_MEASURER;
  4110. document.body.appendChild(scrollDiv);
  4111. var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
  4112. document.body.removeChild(scrollDiv);
  4113. return scrollbarWidth;
  4114. }; // Static
  4115. Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
  4116. return this.each(function () {
  4117. var data = $$$1(this).data(DATA_KEY);
  4118. var _config = _objectSpread({}, Default, $$$1(this).data(), typeof config === 'object' && config ? config : {});
  4119. if (!data) {
  4120. data = new Modal(this, _config);
  4121. $$$1(this).data(DATA_KEY, data);
  4122. }
  4123. if (typeof config === 'string') {
  4124. if (typeof data[config] === 'undefined') {
  4125. throw new TypeError("No method named \"" + config + "\"");
  4126. }
  4127. data[config](relatedTarget);
  4128. } else if (_config.show) {
  4129. data.show(relatedTarget);
  4130. }
  4131. });
  4132. };
  4133. _createClass(Modal, null, [{
  4134. key: "VERSION",
  4135. get: function get() {
  4136. return VERSION;
  4137. }
  4138. }, {
  4139. key: "Default",
  4140. get: function get() {
  4141. return Default;
  4142. }
  4143. }]);
  4144. return Modal;
  4145. }();
  4146. /**
  4147. * ------------------------------------------------------------------------
  4148. * Data Api implementation
  4149. * ------------------------------------------------------------------------
  4150. */
  4151. $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
  4152. var _this10 = this;
  4153. var target;
  4154. var selector = Util.getSelectorFromElement(this);
  4155. if (selector) {
  4156. target = document.querySelector(selector);
  4157. }
  4158. var config = $$$1(target).data(DATA_KEY) ? 'toggle' : _objectSpread({}, $$$1(target).data(), $$$1(this).data());
  4159. if (this.tagName === 'A' || this.tagName === 'AREA') {
  4160. event.preventDefault();
  4161. }
  4162. var $target = $$$1(target).one(Event.SHOW, function (showEvent) {
  4163. if (showEvent.isDefaultPrevented()) {
  4164. // Only register focus restorer if modal will actually get shown
  4165. return;
  4166. }
  4167. $target.one(Event.HIDDEN, function () {
  4168. if ($$$1(_this10).is(':visible')) {
  4169. _this10.focus();
  4170. }
  4171. });
  4172. });
  4173. Modal._jQueryInterface.call($$$1(target), config, this);
  4174. });
  4175. /**
  4176. * ------------------------------------------------------------------------
  4177. * jQuery
  4178. * ------------------------------------------------------------------------
  4179. */
  4180. $$$1.fn[NAME] = Modal._jQueryInterface;
  4181. $$$1.fn[NAME].Constructor = Modal;
  4182. $$$1.fn[NAME].noConflict = function () {
  4183. $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
  4184. return Modal._jQueryInterface;
  4185. };
  4186. return Modal;
  4187. }($);
  4188. /**
  4189. * --------------------------------------------------------------------------
  4190. * Bootstrap (v4.1.3): tooltip.js
  4191. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  4192. * --------------------------------------------------------------------------
  4193. */
  4194. var Tooltip = function ($$$1) {
  4195. /**
  4196. * ------------------------------------------------------------------------
  4197. * Constants
  4198. * ------------------------------------------------------------------------
  4199. */
  4200. var NAME = 'tooltip';
  4201. var VERSION = '4.1.3';
  4202. var DATA_KEY = 'bs.tooltip';
  4203. var EVENT_KEY = "." + DATA_KEY;
  4204. var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
  4205. var CLASS_PREFIX = 'bs-tooltip';
  4206. var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
  4207. var DefaultType = {
  4208. animation: 'boolean',
  4209. template: 'string',
  4210. title: '(string|element|function)',
  4211. trigger: 'string',
  4212. delay: '(number|object)',
  4213. html: 'boolean',
  4214. selector: '(string|boolean)',
  4215. placement: '(string|function)',
  4216. offset: '(number|string)',
  4217. container: '(string|element|boolean)',
  4218. fallbackPlacement: '(string|array)',
  4219. boundary: '(string|element)'
  4220. };
  4221. var AttachmentMap = {
  4222. AUTO: 'auto',
  4223. TOP: 'top',
  4224. RIGHT: 'right',
  4225. BOTTOM: 'bottom',
  4226. LEFT: 'left'
  4227. };
  4228. var Default = {
  4229. animation: true,
  4230. template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',
  4231. trigger: 'hover focus',
  4232. title: '',
  4233. delay: 0,
  4234. html: false,
  4235. selector: false,
  4236. placement: 'top',
  4237. offset: 0,
  4238. container: false,
  4239. fallbackPlacement: 'flip',
  4240. boundary: 'scrollParent'
  4241. };
  4242. var HoverState = {
  4243. SHOW: 'show',
  4244. OUT: 'out'
  4245. };
  4246. var Event = {
  4247. HIDE: "hide" + EVENT_KEY,
  4248. HIDDEN: "hidden" + EVENT_KEY,
  4249. SHOW: "show" + EVENT_KEY,
  4250. SHOWN: "shown" + EVENT_KEY,
  4251. INSERTED: "inserted" + EVENT_KEY,
  4252. CLICK: "click" + EVENT_KEY,
  4253. FOCUSIN: "focusin" + EVENT_KEY,
  4254. FOCUSOUT: "focusout" + EVENT_KEY,
  4255. MOUSEENTER: "mouseenter" + EVENT_KEY,
  4256. MOUSELEAVE: "mouseleave" + EVENT_KEY
  4257. };
  4258. var ClassName = {
  4259. FADE: 'fade',
  4260. SHOW: 'show'
  4261. };
  4262. var Selector = {
  4263. TOOLTIP: '.tooltip',
  4264. TOOLTIP_INNER: '.tooltip-inner',
  4265. ARROW: '.arrow'
  4266. };
  4267. var Trigger = {
  4268. HOVER: 'hover',
  4269. FOCUS: 'focus',
  4270. CLICK: 'click',
  4271. MANUAL: 'manual'
  4272. /**
  4273. * ------------------------------------------------------------------------
  4274. * Class Definition
  4275. * ------------------------------------------------------------------------
  4276. */
  4277. };
  4278. var Tooltip =
  4279. /*#__PURE__*/
  4280. function () {
  4281. function Tooltip(element, config) {
  4282. /**
  4283. * Check for Popper dependency
  4284. * Popper - https://popper.js.org
  4285. */
  4286. if (typeof Popper === 'undefined') {
  4287. throw new TypeError('Bootstrap tooltips require Popper.js (https://popper.js.org)');
  4288. } // private
  4289. this._isEnabled = true;
  4290. this._timeout = 0;
  4291. this._hoverState = '';
  4292. this._activeTrigger = {};
  4293. this._popper = null; // Protected
  4294. this.element = element;
  4295. this.config = this._getConfig(config);
  4296. this.tip = null;
  4297. this._setListeners();
  4298. } // Getters
  4299. var _proto = Tooltip.prototype;
  4300. // Public
  4301. _proto.enable = function enable() {
  4302. this._isEnabled = true;
  4303. };
  4304. _proto.disable = function disable() {
  4305. this._isEnabled = false;
  4306. };
  4307. _proto.toggleEnabled = function toggleEnabled() {
  4308. this._isEnabled = !this._isEnabled;
  4309. };
  4310. _proto.toggle = function toggle(event) {
  4311. if (!this._isEnabled) {
  4312. return;
  4313. }
  4314. if (event) {
  4315. var dataKey = this.constructor.DATA_KEY;
  4316. var context = $$$1(event.currentTarget).data(dataKey);
  4317. if (!context) {
  4318. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  4319. $$$1(event.currentTarget).data(dataKey, context);
  4320. }
  4321. context._activeTrigger.click = !context._activeTrigger.click;
  4322. if (context._isWithActiveTrigger()) {
  4323. context._enter(null, context);
  4324. } else {
  4325. context._leave(null, context);
  4326. }
  4327. } else {
  4328. if ($$$1(this.getTipElement()).hasClass(ClassName.SHOW)) {
  4329. this._leave(null, this);
  4330. return;
  4331. }
  4332. this._enter(null, this);
  4333. }
  4334. };
  4335. _proto.dispose = function dispose() {
  4336. clearTimeout(this._timeout);
  4337. $$$1.removeData(this.element, this.constructor.DATA_KEY);
  4338. $$$1(this.element).off(this.constructor.EVENT_KEY);
  4339. $$$1(this.element).closest('.modal').off('hide.bs.modal');
  4340. if (this.tip) {
  4341. $$$1(this.tip).remove();
  4342. }
  4343. this._isEnabled = null;
  4344. this._timeout = null;
  4345. this._hoverState = null;
  4346. this._activeTrigger = null;
  4347. if (this._popper !== null) {
  4348. this._popper.destroy();
  4349. }
  4350. this._popper = null;
  4351. this.element = null;
  4352. this.config = null;
  4353. this.tip = null;
  4354. };
  4355. _proto.show = function show() {
  4356. var _this = this;
  4357. if ($$$1(this.element).css('display') === 'none') {
  4358. throw new Error('Please use show on visible elements');
  4359. }
  4360. var showEvent = $$$1.Event(this.constructor.Event.SHOW);
  4361. if (this.isWithContent() && this._isEnabled) {
  4362. $$$1(this.element).trigger(showEvent);
  4363. var isInTheDom = $$$1.contains(this.element.ownerDocument.documentElement, this.element);
  4364. if (showEvent.isDefaultPrevented() || !isInTheDom) {
  4365. return;
  4366. }
  4367. var tip = this.getTipElement();
  4368. var tipId = Util.getUID(this.constructor.NAME);
  4369. tip.setAttribute('id', tipId);
  4370. this.element.setAttribute('aria-describedby', tipId);
  4371. this.setContent();
  4372. if (this.config.animation) {
  4373. $$$1(tip).addClass(ClassName.FADE);
  4374. }
  4375. var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
  4376. var attachment = this._getAttachment(placement);
  4377. this.addAttachmentClass(attachment);
  4378. var container = this.config.container === false ? document.body : $$$1(document).find(this.config.container);
  4379. $$$1(tip).data(this.constructor.DATA_KEY, this);
  4380. if (!$$$1.contains(this.element.ownerDocument.documentElement, this.tip)) {
  4381. $$$1(tip).appendTo(container);
  4382. }
  4383. $$$1(this.element).trigger(this.constructor.Event.INSERTED);
  4384. this._popper = new Popper(this.element, tip, {
  4385. placement: attachment,
  4386. modifiers: {
  4387. offset: {
  4388. offset: this.config.offset
  4389. },
  4390. flip: {
  4391. behavior: this.config.fallbackPlacement
  4392. },
  4393. arrow: {
  4394. element: Selector.ARROW
  4395. },
  4396. preventOverflow: {
  4397. boundariesElement: this.config.boundary
  4398. }
  4399. },
  4400. onCreate: function onCreate(data) {
  4401. if (data.originalPlacement !== data.placement) {
  4402. _this._handlePopperPlacementChange(data);
  4403. }
  4404. },
  4405. onUpdate: function onUpdate(data) {
  4406. _this._handlePopperPlacementChange(data);
  4407. }
  4408. });
  4409. $$$1(tip).addClass(ClassName.SHOW); // If this is a touch-enabled device we add extra
  4410. // empty mouseover listeners to the body's immediate children;
  4411. // only needed because of broken event delegation on iOS
  4412. // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
  4413. if ('ontouchstart' in document.documentElement) {
  4414. $$$1(document.body).children().on('mouseover', null, $$$1.noop);
  4415. }
  4416. var complete = function complete() {
  4417. if (_this.config.animation) {
  4418. _this._fixTransition();
  4419. }
  4420. var prevHoverState = _this._hoverState;
  4421. _this._hoverState = null;
  4422. $$$1(_this.element).trigger(_this.constructor.Event.SHOWN);
  4423. if (prevHoverState === HoverState.OUT) {
  4424. _this._leave(null, _this);
  4425. }
  4426. };
  4427. if ($$$1(this.tip).hasClass(ClassName.FADE)) {
  4428. var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
  4429. $$$1(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  4430. } else {
  4431. complete();
  4432. }
  4433. }
  4434. };
  4435. _proto.hide = function hide(callback) {
  4436. var _this2 = this;
  4437. var tip = this.getTipElement();
  4438. var hideEvent = $$$1.Event(this.constructor.Event.HIDE);
  4439. var complete = function complete() {
  4440. if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {
  4441. tip.parentNode.removeChild(tip);
  4442. }
  4443. _this2._cleanTipClass();
  4444. _this2.element.removeAttribute('aria-describedby');
  4445. $$$1(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
  4446. if (_this2._popper !== null) {
  4447. _this2._popper.destroy();
  4448. }
  4449. if (callback) {
  4450. callback();
  4451. }
  4452. };
  4453. $$$1(this.element).trigger(hideEvent);
  4454. if (hideEvent.isDefaultPrevented()) {
  4455. return;
  4456. }
  4457. $$$1(tip).removeClass(ClassName.SHOW); // If this is a touch-enabled device we remove the extra
  4458. // empty mouseover listeners we added for iOS support
  4459. if ('ontouchstart' in document.documentElement) {
  4460. $$$1(document.body).children().off('mouseover', null, $$$1.noop);
  4461. }
  4462. this._activeTrigger[Trigger.CLICK] = false;
  4463. this._activeTrigger[Trigger.FOCUS] = false;
  4464. this._activeTrigger[Trigger.HOVER] = false;
  4465. if ($$$1(this.tip).hasClass(ClassName.FADE)) {
  4466. var transitionDuration = Util.getTransitionDurationFromElement(tip);
  4467. $$$1(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  4468. } else {
  4469. complete();
  4470. }
  4471. this._hoverState = '';
  4472. };
  4473. _proto.update = function update() {
  4474. if (this._popper !== null) {
  4475. this._popper.scheduleUpdate();
  4476. }
  4477. }; // Protected
  4478. _proto.isWithContent = function isWithContent() {
  4479. return Boolean(this.getTitle());
  4480. };
  4481. _proto.addAttachmentClass = function addAttachmentClass(attachment) {
  4482. $$$1(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
  4483. };
  4484. _proto.getTipElement = function getTipElement() {
  4485. this.tip = this.tip || $$$1(this.config.template)[0];
  4486. return this.tip;
  4487. };
  4488. _proto.setContent = function setContent() {
  4489. var tip = this.getTipElement();
  4490. this.setElementContent($$$1(tip.querySelectorAll(Selector.TOOLTIP_INNER)), this.getTitle());
  4491. $$$1(tip).removeClass(ClassName.FADE + " " + ClassName.SHOW);
  4492. };
  4493. _proto.setElementContent = function setElementContent($element, content) {
  4494. var html = this.config.html;
  4495. if (typeof content === 'object' && (content.nodeType || content.jquery)) {
  4496. // Content is a DOM node or a jQuery
  4497. if (html) {
  4498. if (!$$$1(content).parent().is($element)) {
  4499. $element.empty().append(content);
  4500. }
  4501. } else {
  4502. $element.text($$$1(content).text());
  4503. }
  4504. } else {
  4505. $element[html ? 'html' : 'text'](content);
  4506. }
  4507. };
  4508. _proto.getTitle = function getTitle() {
  4509. var title = this.element.getAttribute('data-original-title');
  4510. if (!title) {
  4511. title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
  4512. }
  4513. return title;
  4514. }; // Private
  4515. _proto._getAttachment = function _getAttachment(placement) {
  4516. return AttachmentMap[placement.toUpperCase()];
  4517. };
  4518. _proto._setListeners = function _setListeners() {
  4519. var _this3 = this;
  4520. var triggers = this.config.trigger.split(' ');
  4521. triggers.forEach(function (trigger) {
  4522. if (trigger === 'click') {
  4523. $$$1(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, function (event) {
  4524. return _this3.toggle(event);
  4525. });
  4526. } else if (trigger !== Trigger.MANUAL) {
  4527. var eventIn = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSEENTER : _this3.constructor.Event.FOCUSIN;
  4528. var eventOut = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSELEAVE : _this3.constructor.Event.FOCUSOUT;
  4529. $$$1(_this3.element).on(eventIn, _this3.config.selector, function (event) {
  4530. return _this3._enter(event);
  4531. }).on(eventOut, _this3.config.selector, function (event) {
  4532. return _this3._leave(event);
  4533. });
  4534. }
  4535. $$$1(_this3.element).closest('.modal').on('hide.bs.modal', function () {
  4536. return _this3.hide();
  4537. });
  4538. });
  4539. if (this.config.selector) {
  4540. this.config = _objectSpread({}, this.config, {
  4541. trigger: 'manual',
  4542. selector: ''
  4543. });
  4544. } else {
  4545. this._fixTitle();
  4546. }
  4547. };
  4548. _proto._fixTitle = function _fixTitle() {
  4549. var titleType = typeof this.element.getAttribute('data-original-title');
  4550. if (this.element.getAttribute('title') || titleType !== 'string') {
  4551. this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
  4552. this.element.setAttribute('title', '');
  4553. }
  4554. };
  4555. _proto._enter = function _enter(event, context) {
  4556. var dataKey = this.constructor.DATA_KEY;
  4557. context = context || $$$1(event.currentTarget).data(dataKey);
  4558. if (!context) {
  4559. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  4560. $$$1(event.currentTarget).data(dataKey, context);
  4561. }
  4562. if (event) {
  4563. context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
  4564. }
  4565. if ($$$1(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) {
  4566. context._hoverState = HoverState.SHOW;
  4567. return;
  4568. }
  4569. clearTimeout(context._timeout);
  4570. context._hoverState = HoverState.SHOW;
  4571. if (!context.config.delay || !context.config.delay.show) {
  4572. context.show();
  4573. return;
  4574. }
  4575. context._timeout = setTimeout(function () {
  4576. if (context._hoverState === HoverState.SHOW) {
  4577. context.show();
  4578. }
  4579. }, context.config.delay.show);
  4580. };
  4581. _proto._leave = function _leave(event, context) {
  4582. var dataKey = this.constructor.DATA_KEY;
  4583. context = context || $$$1(event.currentTarget).data(dataKey);
  4584. if (!context) {
  4585. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  4586. $$$1(event.currentTarget).data(dataKey, context);
  4587. }
  4588. if (event) {
  4589. context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
  4590. }
  4591. if (context._isWithActiveTrigger()) {
  4592. return;
  4593. }
  4594. clearTimeout(context._timeout);
  4595. context._hoverState = HoverState.OUT;
  4596. if (!context.config.delay || !context.config.delay.hide) {
  4597. context.hide();
  4598. return;
  4599. }
  4600. context._timeout = setTimeout(function () {
  4601. if (context._hoverState === HoverState.OUT) {
  4602. context.hide();
  4603. }
  4604. }, context.config.delay.hide);
  4605. };
  4606. _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
  4607. for (var trigger in this._activeTrigger) {
  4608. if (this._activeTrigger[trigger]) {
  4609. return true;
  4610. }
  4611. }
  4612. return false;
  4613. };
  4614. _proto._getConfig = function _getConfig(config) {
  4615. config = _objectSpread({}, this.constructor.Default, $$$1(this.element).data(), typeof config === 'object' && config ? config : {});
  4616. if (typeof config.delay === 'number') {
  4617. config.delay = {
  4618. show: config.delay,
  4619. hide: config.delay
  4620. };
  4621. }
  4622. if (typeof config.title === 'number') {
  4623. config.title = config.title.toString();
  4624. }
  4625. if (typeof config.content === 'number') {
  4626. config.content = config.content.toString();
  4627. }
  4628. Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
  4629. return config;
  4630. };
  4631. _proto._getDelegateConfig = function _getDelegateConfig() {
  4632. var config = {};
  4633. if (this.config) {
  4634. for (var key in this.config) {
  4635. if (this.constructor.Default[key] !== this.config[key]) {
  4636. config[key] = this.config[key];
  4637. }
  4638. }
  4639. }
  4640. return config;
  4641. };
  4642. _proto._cleanTipClass = function _cleanTipClass() {
  4643. var $tip = $$$1(this.getTipElement());
  4644. var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
  4645. if (tabClass !== null && tabClass.length) {
  4646. $tip.removeClass(tabClass.join(''));
  4647. }
  4648. };
  4649. _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
  4650. var popperInstance = popperData.instance;
  4651. this.tip = popperInstance.popper;
  4652. this._cleanTipClass();
  4653. this.addAttachmentClass(this._getAttachment(popperData.placement));
  4654. };
  4655. _proto._fixTransition = function _fixTransition() {
  4656. var tip = this.getTipElement();
  4657. var initConfigAnimation = this.config.animation;
  4658. if (tip.getAttribute('x-placement') !== null) {
  4659. return;
  4660. }
  4661. $$$1(tip).removeClass(ClassName.FADE);
  4662. this.config.animation = false;
  4663. this.hide();
  4664. this.show();
  4665. this.config.animation = initConfigAnimation;
  4666. }; // Static
  4667. Tooltip._jQueryInterface = function _jQueryInterface(config) {
  4668. return this.each(function () {
  4669. var data = $$$1(this).data(DATA_KEY);
  4670. var _config = typeof config === 'object' && config;
  4671. if (!data && /dispose|hide/.test(config)) {
  4672. return;
  4673. }
  4674. if (!data) {
  4675. data = new Tooltip(this, _config);
  4676. $$$1(this).data(DATA_KEY, data);
  4677. }
  4678. if (typeof config === 'string') {
  4679. if (typeof data[config] === 'undefined') {
  4680. throw new TypeError("No method named \"" + config + "\"");
  4681. }
  4682. data[config]();
  4683. }
  4684. });
  4685. };
  4686. _createClass(Tooltip, null, [{
  4687. key: "VERSION",
  4688. get: function get() {
  4689. return VERSION;
  4690. }
  4691. }, {
  4692. key: "Default",
  4693. get: function get() {
  4694. return Default;
  4695. }
  4696. }, {
  4697. key: "NAME",
  4698. get: function get() {
  4699. return NAME;
  4700. }
  4701. }, {
  4702. key: "DATA_KEY",
  4703. get: function get() {
  4704. return DATA_KEY;
  4705. }
  4706. }, {
  4707. key: "Event",
  4708. get: function get() {
  4709. return Event;
  4710. }
  4711. }, {
  4712. key: "EVENT_KEY",
  4713. get: function get() {
  4714. return EVENT_KEY;
  4715. }
  4716. }, {
  4717. key: "DefaultType",
  4718. get: function get() {
  4719. return DefaultType;
  4720. }
  4721. }]);
  4722. return Tooltip;
  4723. }();
  4724. /**
  4725. * ------------------------------------------------------------------------
  4726. * jQuery
  4727. * ------------------------------------------------------------------------
  4728. */
  4729. $$$1.fn[NAME] = Tooltip._jQueryInterface;
  4730. $$$1.fn[NAME].Constructor = Tooltip;
  4731. $$$1.fn[NAME].noConflict = function () {
  4732. $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
  4733. return Tooltip._jQueryInterface;
  4734. };
  4735. return Tooltip;
  4736. }($, Popper);
  4737. /**
  4738. * --------------------------------------------------------------------------
  4739. * Bootstrap (v4.1.3): popover.js
  4740. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  4741. * --------------------------------------------------------------------------
  4742. */
  4743. var Popover = function ($$$1) {
  4744. /**
  4745. * ------------------------------------------------------------------------
  4746. * Constants
  4747. * ------------------------------------------------------------------------
  4748. */
  4749. var NAME = 'popover';
  4750. var VERSION = '4.1.3';
  4751. var DATA_KEY = 'bs.popover';
  4752. var EVENT_KEY = "." + DATA_KEY;
  4753. var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
  4754. var CLASS_PREFIX = 'bs-popover';
  4755. var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
  4756. var Default = _objectSpread({}, Tooltip.Default, {
  4757. placement: 'right',
  4758. trigger: 'click',
  4759. content: '',
  4760. template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
  4761. });
  4762. var DefaultType = _objectSpread({}, Tooltip.DefaultType, {
  4763. content: '(string|element|function)'
  4764. });
  4765. var ClassName = {
  4766. FADE: 'fade',
  4767. SHOW: 'show'
  4768. };
  4769. var Selector = {
  4770. TITLE: '.popover-header',
  4771. CONTENT: '.popover-body'
  4772. };
  4773. var Event = {
  4774. HIDE: "hide" + EVENT_KEY,
  4775. HIDDEN: "hidden" + EVENT_KEY,
  4776. SHOW: "show" + EVENT_KEY,
  4777. SHOWN: "shown" + EVENT_KEY,
  4778. INSERTED: "inserted" + EVENT_KEY,
  4779. CLICK: "click" + EVENT_KEY,
  4780. FOCUSIN: "focusin" + EVENT_KEY,
  4781. FOCUSOUT: "focusout" + EVENT_KEY,
  4782. MOUSEENTER: "mouseenter" + EVENT_KEY,
  4783. MOUSELEAVE: "mouseleave" + EVENT_KEY
  4784. /**
  4785. * ------------------------------------------------------------------------
  4786. * Class Definition
  4787. * ------------------------------------------------------------------------
  4788. */
  4789. };
  4790. var Popover =
  4791. /*#__PURE__*/
  4792. function (_Tooltip) {
  4793. _inheritsLoose(Popover, _Tooltip);
  4794. function Popover() {
  4795. return _Tooltip.apply(this, arguments) || this;
  4796. }
  4797. var _proto = Popover.prototype;
  4798. // Overrides
  4799. _proto.isWithContent = function isWithContent() {
  4800. return this.getTitle() || this._getContent();
  4801. };
  4802. _proto.addAttachmentClass = function addAttachmentClass(attachment) {
  4803. $$$1(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
  4804. };
  4805. _proto.getTipElement = function getTipElement() {
  4806. this.tip = this.tip || $$$1(this.config.template)[0];
  4807. return this.tip;
  4808. };
  4809. _proto.setContent = function setContent() {
  4810. var $tip = $$$1(this.getTipElement()); // We use append for html objects to maintain js events
  4811. this.setElementContent($tip.find(Selector.TITLE), this.getTitle());
  4812. var content = this._getContent();
  4813. if (typeof content === 'function') {
  4814. content = content.call(this.element);
  4815. }
  4816. this.setElementContent($tip.find(Selector.CONTENT), content);
  4817. $tip.removeClass(ClassName.FADE + " " + ClassName.SHOW);
  4818. }; // Private
  4819. _proto._getContent = function _getContent() {
  4820. return this.element.getAttribute('data-content') || this.config.content;
  4821. };
  4822. _proto._cleanTipClass = function _cleanTipClass() {
  4823. var $tip = $$$1(this.getTipElement());
  4824. var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
  4825. if (tabClass !== null && tabClass.length > 0) {
  4826. $tip.removeClass(tabClass.join(''));
  4827. }
  4828. }; // Static
  4829. Popover._jQueryInterface = function _jQueryInterface(config) {
  4830. return this.each(function () {
  4831. var data = $$$1(this).data(DATA_KEY);
  4832. var _config = typeof config === 'object' ? config : null;
  4833. if (!data && /destroy|hide/.test(config)) {
  4834. return;
  4835. }
  4836. if (!data) {
  4837. data = new Popover(this, _config);
  4838. $$$1(this).data(DATA_KEY, data);
  4839. }
  4840. if (typeof config === 'string') {
  4841. if (typeof data[config] === 'undefined') {
  4842. throw new TypeError("No method named \"" + config + "\"");
  4843. }
  4844. data[config]();
  4845. }
  4846. });
  4847. };
  4848. _createClass(Popover, null, [{
  4849. key: "VERSION",
  4850. // Getters
  4851. get: function get() {
  4852. return VERSION;
  4853. }
  4854. }, {
  4855. key: "Default",
  4856. get: function get() {
  4857. return Default;
  4858. }
  4859. }, {
  4860. key: "NAME",
  4861. get: function get() {
  4862. return NAME;
  4863. }
  4864. }, {
  4865. key: "DATA_KEY",
  4866. get: function get() {
  4867. return DATA_KEY;
  4868. }
  4869. }, {
  4870. key: "Event",
  4871. get: function get() {
  4872. return Event;
  4873. }
  4874. }, {
  4875. key: "EVENT_KEY",
  4876. get: function get() {
  4877. return EVENT_KEY;
  4878. }
  4879. }, {
  4880. key: "DefaultType",
  4881. get: function get() {
  4882. return DefaultType;
  4883. }
  4884. }]);
  4885. return Popover;
  4886. }(Tooltip);
  4887. /**
  4888. * ------------------------------------------------------------------------
  4889. * jQuery
  4890. * ------------------------------------------------------------------------
  4891. */
  4892. $$$1.fn[NAME] = Popover._jQueryInterface;
  4893. $$$1.fn[NAME].Constructor = Popover;
  4894. $$$1.fn[NAME].noConflict = function () {
  4895. $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
  4896. return Popover._jQueryInterface;
  4897. };
  4898. return Popover;
  4899. }($);
  4900. /**
  4901. * --------------------------------------------------------------------------
  4902. * Bootstrap (v4.1.3): scrollspy.js
  4903. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  4904. * --------------------------------------------------------------------------
  4905. */
  4906. var ScrollSpy = function ($$$1) {
  4907. /**
  4908. * ------------------------------------------------------------------------
  4909. * Constants
  4910. * ------------------------------------------------------------------------
  4911. */
  4912. var NAME = 'scrollspy';
  4913. var VERSION = '4.1.3';
  4914. var DATA_KEY = 'bs.scrollspy';
  4915. var EVENT_KEY = "." + DATA_KEY;
  4916. var DATA_API_KEY = '.data-api';
  4917. var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
  4918. var Default = {
  4919. offset: 10,
  4920. method: 'auto',
  4921. target: ''
  4922. };
  4923. var DefaultType = {
  4924. offset: 'number',
  4925. method: 'string',
  4926. target: '(string|element)'
  4927. };
  4928. var Event = {
  4929. ACTIVATE: "activate" + EVENT_KEY,
  4930. SCROLL: "scroll" + EVENT_KEY,
  4931. LOAD_DATA_API: "load" + EVENT_KEY + DATA_API_KEY
  4932. };
  4933. var ClassName = {
  4934. DROPDOWN_ITEM: 'dropdown-item',
  4935. DROPDOWN_MENU: 'dropdown-menu',
  4936. ACTIVE: 'active'
  4937. };
  4938. var Selector = {
  4939. DATA_SPY: '[data-spy="scroll"]',
  4940. ACTIVE: '.active',
  4941. NAV_LIST_GROUP: '.nav, .list-group',
  4942. NAV_LINKS: '.nav-link',
  4943. NAV_ITEMS: '.nav-item',
  4944. LIST_ITEMS: '.list-group-item',
  4945. DROPDOWN: '.dropdown',
  4946. DROPDOWN_ITEMS: '.dropdown-item',
  4947. DROPDOWN_TOGGLE: '.dropdown-toggle'
  4948. };
  4949. var OffsetMethod = {
  4950. OFFSET: 'offset',
  4951. POSITION: 'position'
  4952. /**
  4953. * ------------------------------------------------------------------------
  4954. * Class Definition
  4955. * ------------------------------------------------------------------------
  4956. */
  4957. };
  4958. var ScrollSpy =
  4959. /*#__PURE__*/
  4960. function () {
  4961. function ScrollSpy(element, config) {
  4962. var _this = this;
  4963. this._element = element;
  4964. this._scrollElement = element.tagName === 'BODY' ? window : element;
  4965. this._config = this._getConfig(config);
  4966. this._selector = this._config.target + " " + Selector.NAV_LINKS + "," + (this._config.target + " " + Selector.LIST_ITEMS + ",") + (this._config.target + " " + Selector.DROPDOWN_ITEMS);
  4967. this._offsets = [];
  4968. this._targets = [];
  4969. this._activeTarget = null;
  4970. this._scrollHeight = 0;
  4971. $$$1(this._scrollElement).on(Event.SCROLL, function (event) {
  4972. return _this._process(event);
  4973. });
  4974. this.refresh();
  4975. this._process();
  4976. } // Getters
  4977. var _proto = ScrollSpy.prototype;
  4978. // Public
  4979. _proto.refresh = function refresh() {
  4980. var _this2 = this;
  4981. var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;
  4982. var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
  4983. var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
  4984. this._offsets = [];
  4985. this._targets = [];
  4986. this._scrollHeight = this._getScrollHeight();
  4987. var targets = [].slice.call(document.querySelectorAll(this._selector));
  4988. targets.map(function (element) {
  4989. var target;
  4990. var targetSelector = Util.getSelectorFromElement(element);
  4991. if (targetSelector) {
  4992. target = document.querySelector(targetSelector);
  4993. }
  4994. if (target) {
  4995. var targetBCR = target.getBoundingClientRect();
  4996. if (targetBCR.width || targetBCR.height) {
  4997. // TODO (fat): remove sketch reliance on jQuery position/offset
  4998. return [$$$1(target)[offsetMethod]().top + offsetBase, targetSelector];
  4999. }
  5000. }
  5001. return null;
  5002. }).filter(function (item) {
  5003. return item;
  5004. }).sort(function (a, b) {
  5005. return a[0] - b[0];
  5006. }).forEach(function (item) {
  5007. _this2._offsets.push(item[0]);
  5008. _this2._targets.push(item[1]);
  5009. });
  5010. };
  5011. _proto.dispose = function dispose() {
  5012. $$$1.removeData(this._element, DATA_KEY);
  5013. $$$1(this._scrollElement).off(EVENT_KEY);
  5014. this._element = null;
  5015. this._scrollElement = null;
  5016. this._config = null;
  5017. this._selector = null;
  5018. this._offsets = null;
  5019. this._targets = null;
  5020. this._activeTarget = null;
  5021. this._scrollHeight = null;
  5022. }; // Private
  5023. _proto._getConfig = function _getConfig(config) {
  5024. config = _objectSpread({}, Default, typeof config === 'object' && config ? config : {});
  5025. if (typeof config.target !== 'string') {
  5026. var id = $$$1(config.target).attr('id');
  5027. if (!id) {
  5028. id = Util.getUID(NAME);
  5029. $$$1(config.target).attr('id', id);
  5030. }
  5031. config.target = "#" + id;
  5032. }
  5033. Util.typeCheckConfig(NAME, config, DefaultType);
  5034. return config;
  5035. };
  5036. _proto._getScrollTop = function _getScrollTop() {
  5037. return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
  5038. };
  5039. _proto._getScrollHeight = function _getScrollHeight() {
  5040. return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
  5041. };
  5042. _proto._getOffsetHeight = function _getOffsetHeight() {
  5043. return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
  5044. };
  5045. _proto._process = function _process() {
  5046. var scrollTop = this._getScrollTop() + this._config.offset;
  5047. var scrollHeight = this._getScrollHeight();
  5048. var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
  5049. if (this._scrollHeight !== scrollHeight) {
  5050. this.refresh();
  5051. }
  5052. if (scrollTop >= maxScroll) {
  5053. var target = this._targets[this._targets.length - 1];
  5054. if (this._activeTarget !== target) {
  5055. this._activate(target);
  5056. }
  5057. return;
  5058. }
  5059. if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
  5060. this._activeTarget = null;
  5061. this._clear();
  5062. return;
  5063. }
  5064. var offsetLength = this._offsets.length;
  5065. for (var i = offsetLength; i--;) {
  5066. var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
  5067. if (isActiveTarget) {
  5068. this._activate(this._targets[i]);
  5069. }
  5070. }
  5071. };
  5072. _proto._activate = function _activate(target) {
  5073. this._activeTarget = target;
  5074. this._clear();
  5075. var queries = this._selector.split(','); // eslint-disable-next-line arrow-body-style
  5076. queries = queries.map(function (selector) {
  5077. return selector + "[data-target=\"" + target + "\"]," + (selector + "[href=\"" + target + "\"]");
  5078. });
  5079. var $link = $$$1([].slice.call(document.querySelectorAll(queries.join(','))));
  5080. if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {
  5081. $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);
  5082. $link.addClass(ClassName.ACTIVE);
  5083. } else {
  5084. // Set triggered link as active
  5085. $link.addClass(ClassName.ACTIVE); // Set triggered links parents as active
  5086. // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
  5087. $link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_LINKS + ", " + Selector.LIST_ITEMS).addClass(ClassName.ACTIVE); // Handle special case when .nav-link is inside .nav-item
  5088. $link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_ITEMS).children(Selector.NAV_LINKS).addClass(ClassName.ACTIVE);
  5089. }
  5090. $$$1(this._scrollElement).trigger(Event.ACTIVATE, {
  5091. relatedTarget: target
  5092. });
  5093. };
  5094. _proto._clear = function _clear() {
  5095. var nodes = [].slice.call(document.querySelectorAll(this._selector));
  5096. $$$1(nodes).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
  5097. }; // Static
  5098. ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
  5099. return this.each(function () {
  5100. var data = $$$1(this).data(DATA_KEY);
  5101. var _config = typeof config === 'object' && config;
  5102. if (!data) {
  5103. data = new ScrollSpy(this, _config);
  5104. $$$1(this).data(DATA_KEY, data);
  5105. }
  5106. if (typeof config === 'string') {
  5107. if (typeof data[config] === 'undefined') {
  5108. throw new TypeError("No method named \"" + config + "\"");
  5109. }
  5110. data[config]();
  5111. }
  5112. });
  5113. };
  5114. _createClass(ScrollSpy, null, [{
  5115. key: "VERSION",
  5116. get: function get() {
  5117. return VERSION;
  5118. }
  5119. }, {
  5120. key: "Default",
  5121. get: function get() {
  5122. return Default;
  5123. }
  5124. }]);
  5125. return ScrollSpy;
  5126. }();
  5127. /**
  5128. * ------------------------------------------------------------------------
  5129. * Data Api implementation
  5130. * ------------------------------------------------------------------------
  5131. */
  5132. $$$1(window).on(Event.LOAD_DATA_API, function () {
  5133. var scrollSpys = [].slice.call(document.querySelectorAll(Selector.DATA_SPY));
  5134. var scrollSpysLength = scrollSpys.length;
  5135. for (var i = scrollSpysLength; i--;) {
  5136. var $spy = $$$1(scrollSpys[i]);
  5137. ScrollSpy._jQueryInterface.call($spy, $spy.data());
  5138. }
  5139. });
  5140. /**
  5141. * ------------------------------------------------------------------------
  5142. * jQuery
  5143. * ------------------------------------------------------------------------
  5144. */
  5145. $$$1.fn[NAME] = ScrollSpy._jQueryInterface;
  5146. $$$1.fn[NAME].Constructor = ScrollSpy;
  5147. $$$1.fn[NAME].noConflict = function () {
  5148. $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
  5149. return ScrollSpy._jQueryInterface;
  5150. };
  5151. return ScrollSpy;
  5152. }($);
  5153. /**
  5154. * --------------------------------------------------------------------------
  5155. * Bootstrap (v4.1.3): tab.js
  5156. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  5157. * --------------------------------------------------------------------------
  5158. */
  5159. var Tab = function ($$$1) {
  5160. /**
  5161. * ------------------------------------------------------------------------
  5162. * Constants
  5163. * ------------------------------------------------------------------------
  5164. */
  5165. var NAME = 'tab';
  5166. var VERSION = '4.1.3';
  5167. var DATA_KEY = 'bs.tab';
  5168. var EVENT_KEY = "." + DATA_KEY;
  5169. var DATA_API_KEY = '.data-api';
  5170. var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
  5171. var Event = {
  5172. HIDE: "hide" + EVENT_KEY,
  5173. HIDDEN: "hidden" + EVENT_KEY,
  5174. SHOW: "show" + EVENT_KEY,
  5175. SHOWN: "shown" + EVENT_KEY,
  5176. CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
  5177. };
  5178. var ClassName = {
  5179. DROPDOWN_MENU: 'dropdown-menu',
  5180. ACTIVE: 'active',
  5181. DISABLED: 'disabled',
  5182. FADE: 'fade',
  5183. SHOW: 'show'
  5184. };
  5185. var Selector = {
  5186. DROPDOWN: '.dropdown',
  5187. NAV_LIST_GROUP: '.nav, .list-group',
  5188. ACTIVE: '.active',
  5189. ACTIVE_UL: '> li > .active',
  5190. DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
  5191. DROPDOWN_TOGGLE: '.dropdown-toggle',
  5192. DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'
  5193. /**
  5194. * ------------------------------------------------------------------------
  5195. * Class Definition
  5196. * ------------------------------------------------------------------------
  5197. */
  5198. };
  5199. var Tab =
  5200. /*#__PURE__*/
  5201. function () {
  5202. function Tab(element) {
  5203. this._element = element;
  5204. } // Getters
  5205. var _proto = Tab.prototype;
  5206. // Public
  5207. _proto.show = function show() {
  5208. var _this = this;
  5209. if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $$$1(this._element).hasClass(ClassName.ACTIVE) || $$$1(this._element).hasClass(ClassName.DISABLED)) {
  5210. return;
  5211. }
  5212. var target;
  5213. var previous;
  5214. var listElement = $$$1(this._element).closest(Selector.NAV_LIST_GROUP)[0];
  5215. var selector = Util.getSelectorFromElement(this._element);
  5216. if (listElement) {
  5217. var itemSelector = listElement.nodeName === 'UL' ? Selector.ACTIVE_UL : Selector.ACTIVE;
  5218. previous = $$$1.makeArray($$$1(listElement).find(itemSelector));
  5219. previous = previous[previous.length - 1];
  5220. }
  5221. var hideEvent = $$$1.Event(Event.HIDE, {
  5222. relatedTarget: this._element
  5223. });
  5224. var showEvent = $$$1.Event(Event.SHOW, {
  5225. relatedTarget: previous
  5226. });
  5227. if (previous) {
  5228. $$$1(previous).trigger(hideEvent);
  5229. }
  5230. $$$1(this._element).trigger(showEvent);
  5231. if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
  5232. return;
  5233. }
  5234. if (selector) {
  5235. target = document.querySelector(selector);
  5236. }
  5237. this._activate(this._element, listElement);
  5238. var complete = function complete() {
  5239. var hiddenEvent = $$$1.Event(Event.HIDDEN, {
  5240. relatedTarget: _this._element
  5241. });
  5242. var shownEvent = $$$1.Event(Event.SHOWN, {
  5243. relatedTarget: previous
  5244. });
  5245. $$$1(previous).trigger(hiddenEvent);
  5246. $$$1(_this._element).trigger(shownEvent);
  5247. };
  5248. if (target) {
  5249. this._activate(target, target.parentNode, complete);
  5250. } else {
  5251. complete();
  5252. }
  5253. };
  5254. _proto.dispose = function dispose() {
  5255. $$$1.removeData(this._element, DATA_KEY);
  5256. this._element = null;
  5257. }; // Private
  5258. _proto._activate = function _activate(element, container, callback) {
  5259. var _this2 = this;
  5260. var activeElements;
  5261. if (container.nodeName === 'UL') {
  5262. activeElements = $$$1(container).find(Selector.ACTIVE_UL);
  5263. } else {
  5264. activeElements = $$$1(container).children(Selector.ACTIVE);
  5265. }
  5266. var active = activeElements[0];
  5267. var isTransitioning = callback && active && $$$1(active).hasClass(ClassName.FADE);
  5268. var complete = function complete() {
  5269. return _this2._transitionComplete(element, active, callback);
  5270. };
  5271. if (active && isTransitioning) {
  5272. var transitionDuration = Util.getTransitionDurationFromElement(active);
  5273. $$$1(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  5274. } else {
  5275. complete();
  5276. }
  5277. };
  5278. _proto._transitionComplete = function _transitionComplete(element, active, callback) {
  5279. if (active) {
  5280. $$$1(active).removeClass(ClassName.SHOW + " " + ClassName.ACTIVE);
  5281. var dropdownChild = $$$1(active.parentNode).find(Selector.DROPDOWN_ACTIVE_CHILD)[0];
  5282. if (dropdownChild) {
  5283. $$$1(dropdownChild).removeClass(ClassName.ACTIVE);
  5284. }
  5285. if (active.getAttribute('role') === 'tab') {
  5286. active.setAttribute('aria-selected', false);
  5287. }
  5288. }
  5289. $$$1(element).addClass(ClassName.ACTIVE);
  5290. if (element.getAttribute('role') === 'tab') {
  5291. element.setAttribute('aria-selected', true);
  5292. }
  5293. Util.reflow(element);
  5294. $$$1(element).addClass(ClassName.SHOW);
  5295. if (element.parentNode && $$$1(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {
  5296. var dropdownElement = $$$1(element).closest(Selector.DROPDOWN)[0];
  5297. if (dropdownElement) {
  5298. var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector.DROPDOWN_TOGGLE));
  5299. $$$1(dropdownToggleList).addClass(ClassName.ACTIVE);
  5300. }
  5301. element.setAttribute('aria-expanded', true);
  5302. }
  5303. if (callback) {
  5304. callback();
  5305. }
  5306. }; // Static
  5307. Tab._jQueryInterface = function _jQueryInterface(config) {
  5308. return this.each(function () {
  5309. var $this = $$$1(this);
  5310. var data = $this.data(DATA_KEY);
  5311. if (!data) {
  5312. data = new Tab(this);
  5313. $this.data(DATA_KEY, data);
  5314. }
  5315. if (typeof config === 'string') {
  5316. if (typeof data[config] === 'undefined') {
  5317. throw new TypeError("No method named \"" + config + "\"");
  5318. }
  5319. data[config]();
  5320. }
  5321. });
  5322. };
  5323. _createClass(Tab, null, [{
  5324. key: "VERSION",
  5325. get: function get() {
  5326. return VERSION;
  5327. }
  5328. }]);
  5329. return Tab;
  5330. }();
  5331. /**
  5332. * ------------------------------------------------------------------------
  5333. * Data Api implementation
  5334. * ------------------------------------------------------------------------
  5335. */
  5336. $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
  5337. event.preventDefault();
  5338. Tab._jQueryInterface.call($$$1(this), 'show');
  5339. });
  5340. /**
  5341. * ------------------------------------------------------------------------
  5342. * jQuery
  5343. * ------------------------------------------------------------------------
  5344. */
  5345. $$$1.fn[NAME] = Tab._jQueryInterface;
  5346. $$$1.fn[NAME].Constructor = Tab;
  5347. $$$1.fn[NAME].noConflict = function () {
  5348. $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
  5349. return Tab._jQueryInterface;
  5350. };
  5351. return Tab;
  5352. }($);
  5353. /**
  5354. * --------------------------------------------------------------------------
  5355. * Bootstrap (v4.1.3): index.js
  5356. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  5357. * --------------------------------------------------------------------------
  5358. */
  5359. (function ($$$1) {
  5360. if (typeof $$$1 === 'undefined') {
  5361. throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
  5362. }
  5363. var version = $$$1.fn.jquery.split(' ')[0].split('.');
  5364. var minMajor = 1;
  5365. var ltMajor = 2;
  5366. var minMinor = 9;
  5367. var minPatch = 1;
  5368. var maxMajor = 4;
  5369. if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
  5370. throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
  5371. }
  5372. })($);
  5373. exports.Util = Util;
  5374. exports.Alert = Alert;
  5375. exports.Button = Button;
  5376. exports.Carousel = Carousel;
  5377. exports.Collapse = Collapse;
  5378. exports.Dropdown = Dropdown;
  5379. exports.Modal = Modal;
  5380. exports.Popover = Popover;
  5381. exports.Scrollspy = ScrollSpy;
  5382. exports.Tab = Tab;
  5383. exports.Tooltip = Tooltip;
  5384. Object.defineProperty(exports, '__esModule', { value: true });
  5385. })));
  5386. //# sourceMappingURL=bootstrap.bundle.js.map