bootstrap.bundle.js 241 KB

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