bootstrap.bundle.js 206 KB

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