foundation.js 476 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory(require("jquery"));
  4. else if(typeof define === 'function' && define.amd)
  5. define(["jquery"], factory);
  6. else {
  7. var a = typeof exports === 'object' ? factory(require("jquery")) : factory(root["jQuery"]);
  8. for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
  9. }
  10. })(window, function(__WEBPACK_EXTERNAL_MODULE_jquery__) {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // The module cache
  13. /******/ var installedModules = {};
  14. /******/
  15. /******/ // The require function
  16. /******/ function __webpack_require__(moduleId) {
  17. /******/
  18. /******/ // Check if module is in cache
  19. /******/ if(installedModules[moduleId]) {
  20. /******/ return installedModules[moduleId].exports;
  21. /******/ }
  22. /******/ // Create a new module (and put it into the cache)
  23. /******/ var module = installedModules[moduleId] = {
  24. /******/ i: moduleId,
  25. /******/ l: false,
  26. /******/ exports: {}
  27. /******/ };
  28. /******/
  29. /******/ // Execute the module function
  30. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  31. /******/
  32. /******/ // Flag the module as loaded
  33. /******/ module.l = true;
  34. /******/
  35. /******/ // Return the exports of the module
  36. /******/ return module.exports;
  37. /******/ }
  38. /******/
  39. /******/
  40. /******/ // expose the modules object (__webpack_modules__)
  41. /******/ __webpack_require__.m = modules;
  42. /******/
  43. /******/ // expose the module cache
  44. /******/ __webpack_require__.c = installedModules;
  45. /******/
  46. /******/ // define getter function for harmony exports
  47. /******/ __webpack_require__.d = function(exports, name, getter) {
  48. /******/ if(!__webpack_require__.o(exports, name)) {
  49. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  50. /******/ }
  51. /******/ };
  52. /******/
  53. /******/ // define __esModule on exports
  54. /******/ __webpack_require__.r = function(exports) {
  55. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  56. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  57. /******/ }
  58. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  59. /******/ };
  60. /******/
  61. /******/ // create a fake namespace object
  62. /******/ // mode & 1: value is a module id, require it
  63. /******/ // mode & 2: merge all properties of value into the ns
  64. /******/ // mode & 4: return value when already ns object
  65. /******/ // mode & 8|1: behave like require
  66. /******/ __webpack_require__.t = function(value, mode) {
  67. /******/ if(mode & 1) value = __webpack_require__(value);
  68. /******/ if(mode & 8) return value;
  69. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  70. /******/ var ns = Object.create(null);
  71. /******/ __webpack_require__.r(ns);
  72. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  73. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  74. /******/ return ns;
  75. /******/ };
  76. /******/
  77. /******/ // getDefaultExport function for compatibility with non-harmony modules
  78. /******/ __webpack_require__.n = function(module) {
  79. /******/ var getter = module && module.__esModule ?
  80. /******/ function getDefault() { return module['default']; } :
  81. /******/ function getModuleExports() { return module; };
  82. /******/ __webpack_require__.d(getter, 'a', getter);
  83. /******/ return getter;
  84. /******/ };
  85. /******/
  86. /******/ // Object.prototype.hasOwnProperty.call
  87. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  88. /******/
  89. /******/ // __webpack_public_path__
  90. /******/ __webpack_require__.p = "";
  91. /******/
  92. /******/
  93. /******/ // Load entry module and return exports
  94. /******/ return __webpack_require__(__webpack_require__.s = 0);
  95. /******/ })
  96. /************************************************************************/
  97. /******/ ({
  98. /***/ "./js/entries/foundation.js":
  99. /*!**********************************!*\
  100. !*** ./js/entries/foundation.js ***!
  101. \**********************************/
  102. /*! exports provided: Foundation, CoreUtils, Box, onImagesLoaded, Keyboard, MediaQuery, Motion, Nest, Timer, Touch, Triggers, Abide, Accordion, AccordionMenu, Drilldown, Dropdown, DropdownMenu, Equalizer, Interchange, Magellan, OffCanvas, Orbit, ResponsiveMenu, ResponsiveToggle, Reveal, Slider, SmoothScroll, Sticky, Tabs, Toggler, Tooltip, ResponsiveAccordionTabs, default */
  103. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104. "use strict";
  105. __webpack_require__.r(__webpack_exports__);
  106. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  107. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  108. /* harmony import */ var _foundation_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../foundation.core */ "./js/foundation.core.js");
  109. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Foundation", function() { return _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"]; });
  110. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../foundation.core.utils */ "./js/foundation.core.utils.js");
  111. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "CoreUtils", function() { return _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__; });
  112. /* harmony import */ var _foundation_util_box__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../foundation.util.box */ "./js/foundation.util.box.js");
  113. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Box", function() { return _foundation_util_box__WEBPACK_IMPORTED_MODULE_3__["Box"]; });
  114. /* harmony import */ var _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../foundation.util.imageLoader */ "./js/foundation.util.imageLoader.js");
  115. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "onImagesLoaded", function() { return _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__["onImagesLoaded"]; });
  116. /* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../foundation.util.keyboard */ "./js/foundation.util.keyboard.js");
  117. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Keyboard", function() { return _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_5__["Keyboard"]; });
  118. /* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js");
  119. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MediaQuery", function() { return _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_6__["MediaQuery"]; });
  120. /* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../foundation.util.motion */ "./js/foundation.util.motion.js");
  121. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Motion", function() { return _foundation_util_motion__WEBPACK_IMPORTED_MODULE_7__["Motion"]; });
  122. /* harmony import */ var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../foundation.util.nest */ "./js/foundation.util.nest.js");
  123. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Nest", function() { return _foundation_util_nest__WEBPACK_IMPORTED_MODULE_8__["Nest"]; });
  124. /* harmony import */ var _foundation_util_timer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../foundation.util.timer */ "./js/foundation.util.timer.js");
  125. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Timer", function() { return _foundation_util_timer__WEBPACK_IMPORTED_MODULE_9__["Timer"]; });
  126. /* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../foundation.util.touch */ "./js/foundation.util.touch.js");
  127. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Touch", function() { return _foundation_util_touch__WEBPACK_IMPORTED_MODULE_10__["Touch"]; });
  128. /* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../foundation.util.triggers */ "./js/foundation.util.triggers.js");
  129. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Triggers", function() { return _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_11__["Triggers"]; });
  130. /* harmony import */ var _foundation_abide__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../foundation.abide */ "./js/foundation.abide.js");
  131. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Abide", function() { return _foundation_abide__WEBPACK_IMPORTED_MODULE_12__["Abide"]; });
  132. /* harmony import */ var _foundation_accordion__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../foundation.accordion */ "./js/foundation.accordion.js");
  133. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Accordion", function() { return _foundation_accordion__WEBPACK_IMPORTED_MODULE_13__["Accordion"]; });
  134. /* harmony import */ var _foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../foundation.accordionMenu */ "./js/foundation.accordionMenu.js");
  135. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AccordionMenu", function() { return _foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_14__["AccordionMenu"]; });
  136. /* harmony import */ var _foundation_drilldown__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../foundation.drilldown */ "./js/foundation.drilldown.js");
  137. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Drilldown", function() { return _foundation_drilldown__WEBPACK_IMPORTED_MODULE_15__["Drilldown"]; });
  138. /* harmony import */ var _foundation_dropdown__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../foundation.dropdown */ "./js/foundation.dropdown.js");
  139. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Dropdown", function() { return _foundation_dropdown__WEBPACK_IMPORTED_MODULE_16__["Dropdown"]; });
  140. /* harmony import */ var _foundation_dropdownMenu__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../foundation.dropdownMenu */ "./js/foundation.dropdownMenu.js");
  141. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DropdownMenu", function() { return _foundation_dropdownMenu__WEBPACK_IMPORTED_MODULE_17__["DropdownMenu"]; });
  142. /* harmony import */ var _foundation_equalizer__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../foundation.equalizer */ "./js/foundation.equalizer.js");
  143. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Equalizer", function() { return _foundation_equalizer__WEBPACK_IMPORTED_MODULE_18__["Equalizer"]; });
  144. /* harmony import */ var _foundation_interchange__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../foundation.interchange */ "./js/foundation.interchange.js");
  145. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Interchange", function() { return _foundation_interchange__WEBPACK_IMPORTED_MODULE_19__["Interchange"]; });
  146. /* harmony import */ var _foundation_magellan__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../foundation.magellan */ "./js/foundation.magellan.js");
  147. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Magellan", function() { return _foundation_magellan__WEBPACK_IMPORTED_MODULE_20__["Magellan"]; });
  148. /* harmony import */ var _foundation_offcanvas__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../foundation.offcanvas */ "./js/foundation.offcanvas.js");
  149. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "OffCanvas", function() { return _foundation_offcanvas__WEBPACK_IMPORTED_MODULE_21__["OffCanvas"]; });
  150. /* harmony import */ var _foundation_orbit__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../foundation.orbit */ "./js/foundation.orbit.js");
  151. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Orbit", function() { return _foundation_orbit__WEBPACK_IMPORTED_MODULE_22__["Orbit"]; });
  152. /* harmony import */ var _foundation_responsiveMenu__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../foundation.responsiveMenu */ "./js/foundation.responsiveMenu.js");
  153. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ResponsiveMenu", function() { return _foundation_responsiveMenu__WEBPACK_IMPORTED_MODULE_23__["ResponsiveMenu"]; });
  154. /* harmony import */ var _foundation_responsiveToggle__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../foundation.responsiveToggle */ "./js/foundation.responsiveToggle.js");
  155. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ResponsiveToggle", function() { return _foundation_responsiveToggle__WEBPACK_IMPORTED_MODULE_24__["ResponsiveToggle"]; });
  156. /* harmony import */ var _foundation_reveal__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../foundation.reveal */ "./js/foundation.reveal.js");
  157. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Reveal", function() { return _foundation_reveal__WEBPACK_IMPORTED_MODULE_25__["Reveal"]; });
  158. /* harmony import */ var _foundation_slider__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../foundation.slider */ "./js/foundation.slider.js");
  159. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Slider", function() { return _foundation_slider__WEBPACK_IMPORTED_MODULE_26__["Slider"]; });
  160. /* harmony import */ var _foundation_smoothScroll__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../foundation.smoothScroll */ "./js/foundation.smoothScroll.js");
  161. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SmoothScroll", function() { return _foundation_smoothScroll__WEBPACK_IMPORTED_MODULE_27__["SmoothScroll"]; });
  162. /* harmony import */ var _foundation_sticky__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../foundation.sticky */ "./js/foundation.sticky.js");
  163. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Sticky", function() { return _foundation_sticky__WEBPACK_IMPORTED_MODULE_28__["Sticky"]; });
  164. /* harmony import */ var _foundation_tabs__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../foundation.tabs */ "./js/foundation.tabs.js");
  165. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tabs", function() { return _foundation_tabs__WEBPACK_IMPORTED_MODULE_29__["Tabs"]; });
  166. /* harmony import */ var _foundation_toggler__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../foundation.toggler */ "./js/foundation.toggler.js");
  167. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Toggler", function() { return _foundation_toggler__WEBPACK_IMPORTED_MODULE_30__["Toggler"]; });
  168. /* harmony import */ var _foundation_tooltip__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../foundation.tooltip */ "./js/foundation.tooltip.js");
  169. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tooltip", function() { return _foundation_tooltip__WEBPACK_IMPORTED_MODULE_31__["Tooltip"]; });
  170. /* harmony import */ var _foundation_responsiveAccordionTabs__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../foundation.responsiveAccordionTabs */ "./js/foundation.responsiveAccordionTabs.js");
  171. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ResponsiveAccordionTabs", function() { return _foundation_responsiveAccordionTabs__WEBPACK_IMPORTED_MODULE_32__["ResponsiveAccordionTabs"]; });
  172. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].addToJquery(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); // Add Foundation Utils to Foundation global namespace for backwards
  173. // compatibility.
  174. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].rtl = _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["rtl"];
  175. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].GetYoDigits = _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"];
  176. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].transitionend = _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["transitionend"];
  177. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].RegExpEscape = _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["RegExpEscape"];
  178. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].onLoad = _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["onLoad"];
  179. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].Box = _foundation_util_box__WEBPACK_IMPORTED_MODULE_3__["Box"];
  180. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].onImagesLoaded = _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__["onImagesLoaded"];
  181. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].Keyboard = _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_5__["Keyboard"];
  182. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].MediaQuery = _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_6__["MediaQuery"];
  183. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].Motion = _foundation_util_motion__WEBPACK_IMPORTED_MODULE_7__["Motion"];
  184. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].Move = _foundation_util_motion__WEBPACK_IMPORTED_MODULE_7__["Move"];
  185. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].Nest = _foundation_util_nest__WEBPACK_IMPORTED_MODULE_8__["Nest"];
  186. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].Timer = _foundation_util_timer__WEBPACK_IMPORTED_MODULE_9__["Timer"]; // Touch and Triggers previously were almost purely sede effect driven,
  187. // so no need to add it to Foundation, just init them.
  188. _foundation_util_touch__WEBPACK_IMPORTED_MODULE_10__["Touch"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
  189. _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_11__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a, _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"]);
  190. _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_6__["MediaQuery"]._init();
  191. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_abide__WEBPACK_IMPORTED_MODULE_12__["Abide"], 'Abide');
  192. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_accordion__WEBPACK_IMPORTED_MODULE_13__["Accordion"], 'Accordion');
  193. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_14__["AccordionMenu"], 'AccordionMenu');
  194. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_drilldown__WEBPACK_IMPORTED_MODULE_15__["Drilldown"], 'Drilldown');
  195. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_dropdown__WEBPACK_IMPORTED_MODULE_16__["Dropdown"], 'Dropdown');
  196. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_dropdownMenu__WEBPACK_IMPORTED_MODULE_17__["DropdownMenu"], 'DropdownMenu');
  197. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_equalizer__WEBPACK_IMPORTED_MODULE_18__["Equalizer"], 'Equalizer');
  198. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_interchange__WEBPACK_IMPORTED_MODULE_19__["Interchange"], 'Interchange');
  199. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_magellan__WEBPACK_IMPORTED_MODULE_20__["Magellan"], 'Magellan');
  200. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_offcanvas__WEBPACK_IMPORTED_MODULE_21__["OffCanvas"], 'OffCanvas');
  201. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_orbit__WEBPACK_IMPORTED_MODULE_22__["Orbit"], 'Orbit');
  202. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_responsiveMenu__WEBPACK_IMPORTED_MODULE_23__["ResponsiveMenu"], 'ResponsiveMenu');
  203. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_responsiveToggle__WEBPACK_IMPORTED_MODULE_24__["ResponsiveToggle"], 'ResponsiveToggle');
  204. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_reveal__WEBPACK_IMPORTED_MODULE_25__["Reveal"], 'Reveal');
  205. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_slider__WEBPACK_IMPORTED_MODULE_26__["Slider"], 'Slider');
  206. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_smoothScroll__WEBPACK_IMPORTED_MODULE_27__["SmoothScroll"], 'SmoothScroll');
  207. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_sticky__WEBPACK_IMPORTED_MODULE_28__["Sticky"], 'Sticky');
  208. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_tabs__WEBPACK_IMPORTED_MODULE_29__["Tabs"], 'Tabs');
  209. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_toggler__WEBPACK_IMPORTED_MODULE_30__["Toggler"], 'Toggler');
  210. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_tooltip__WEBPACK_IMPORTED_MODULE_31__["Tooltip"], 'Tooltip');
  211. _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_responsiveAccordionTabs__WEBPACK_IMPORTED_MODULE_32__["ResponsiveAccordionTabs"], 'ResponsiveAccordionTabs');
  212. /* harmony default export */ __webpack_exports__["default"] = (_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"]);
  213. /***/ }),
  214. /***/ "./js/foundation.abide.js":
  215. /*!********************************!*\
  216. !*** ./js/foundation.abide.js ***!
  217. \********************************/
  218. /*! exports provided: Abide */
  219. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  220. "use strict";
  221. __webpack_require__.r(__webpack_exports__);
  222. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Abide", function() { return Abide; });
  223. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  224. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  225. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  226. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  227. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  228. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  229. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  230. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  231. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  232. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  233. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  234. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  235. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  236. /**
  237. * Abide module.
  238. * @module foundation.abide
  239. */
  240. var Abide =
  241. /*#__PURE__*/
  242. function (_Plugin) {
  243. _inherits(Abide, _Plugin);
  244. function Abide() {
  245. _classCallCheck(this, Abide);
  246. return _possibleConstructorReturn(this, _getPrototypeOf(Abide).apply(this, arguments));
  247. }
  248. _createClass(Abide, [{
  249. key: "_setup",
  250. /**
  251. * Creates a new instance of Abide.
  252. * @class
  253. * @name Abide
  254. * @fires Abide#init
  255. * @param {Object} element - jQuery object to add the trigger to.
  256. * @param {Object} options - Overrides to the default plugin settings.
  257. */
  258. value: function _setup(element) {
  259. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  260. this.$element = element;
  261. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(true, {}, Abide.defaults, this.$element.data(), options);
  262. this.className = 'Abide'; // ie9 back compat
  263. this._init();
  264. }
  265. /**
  266. * Initializes the Abide plugin and calls functions to get Abide functioning on load.
  267. * @private
  268. */
  269. }, {
  270. key: "_init",
  271. value: function _init() {
  272. var _this2 = this;
  273. this.$inputs = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.merge( // Consider as input to validate:
  274. this.$element.find('input').not('[type=submit]'), // * all input fields expect submit
  275. this.$element.find('textarea, select') // * all textareas and select fields
  276. );
  277. var $globalErrors = this.$element.find('[data-abide-error]'); // Add a11y attributes to all fields
  278. if (this.options.a11yAttributes) {
  279. this.$inputs.each(function (i, input) {
  280. return _this2.addA11yAttributes(jquery__WEBPACK_IMPORTED_MODULE_0___default()(input));
  281. });
  282. $globalErrors.each(function (i, error) {
  283. return _this2.addGlobalErrorA11yAttributes(jquery__WEBPACK_IMPORTED_MODULE_0___default()(error));
  284. });
  285. }
  286. this._events();
  287. }
  288. /**
  289. * Initializes events for Abide.
  290. * @private
  291. */
  292. }, {
  293. key: "_events",
  294. value: function _events() {
  295. var _this3 = this;
  296. this.$element.off('.abide').on('reset.zf.abide', function () {
  297. _this3.resetForm();
  298. }).on('submit.zf.abide', function () {
  299. return _this3.validateForm();
  300. });
  301. if (this.options.validateOn === 'fieldChange') {
  302. this.$inputs.off('change.zf.abide').on('change.zf.abide', function (e) {
  303. _this3.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target));
  304. });
  305. }
  306. if (this.options.liveValidate) {
  307. this.$inputs.off('input.zf.abide').on('input.zf.abide', function (e) {
  308. _this3.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target));
  309. });
  310. }
  311. if (this.options.validateOnBlur) {
  312. this.$inputs.off('blur.zf.abide').on('blur.zf.abide', function (e) {
  313. _this3.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target));
  314. });
  315. }
  316. }
  317. /**
  318. * Calls necessary functions to update Abide upon DOM change
  319. * @private
  320. */
  321. }, {
  322. key: "_reflow",
  323. value: function _reflow() {
  324. this._init();
  325. }
  326. /**
  327. * Checks whether or not a form element has the required attribute and if it's checked or not
  328. * @param {Object} element - jQuery object to check for required attribute
  329. * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty
  330. */
  331. }, {
  332. key: "requiredCheck",
  333. value: function requiredCheck($el) {
  334. if (!$el.attr('required')) return true;
  335. var isGood = true;
  336. switch ($el[0].type) {
  337. case 'checkbox':
  338. isGood = $el[0].checked;
  339. break;
  340. case 'select':
  341. case 'select-one':
  342. case 'select-multiple':
  343. var opt = $el.find('option:selected');
  344. if (!opt.length || !opt.val()) isGood = false;
  345. break;
  346. default:
  347. if (!$el.val() || !$el.val().length) isGood = false;
  348. }
  349. return isGood;
  350. }
  351. /**
  352. * Get:
  353. * - Based on $el, the first element(s) corresponding to `formErrorSelector` in this order:
  354. * 1. The element's direct sibling('s).
  355. * 2. The element's parent's children.
  356. * - Element(s) with the attribute `[data-form-error-for]` set with the element's id.
  357. *
  358. * This allows for multiple form errors per input, though if none are found, no form errors will be shown.
  359. *
  360. * @param {Object} $el - jQuery object to use as reference to find the form error selector.
  361. * @returns {Object} jQuery object with the selector.
  362. */
  363. }, {
  364. key: "findFormError",
  365. value: function findFormError($el) {
  366. var id = $el[0].id;
  367. var $error = $el.siblings(this.options.formErrorSelector);
  368. if (!$error.length) {
  369. $error = $el.parent().find(this.options.formErrorSelector);
  370. }
  371. if (id) {
  372. $error = $error.add(this.$element.find("[data-form-error-for=\"".concat(id, "\"]")));
  373. }
  374. return $error;
  375. }
  376. /**
  377. * Get the first element in this order:
  378. * 2. The <label> with the attribute `[for="someInputId"]`
  379. * 3. The `.closest()` <label>
  380. *
  381. * @param {Object} $el - jQuery object to check for required attribute
  382. * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty
  383. */
  384. }, {
  385. key: "findLabel",
  386. value: function findLabel($el) {
  387. var id = $el[0].id;
  388. var $label = this.$element.find("label[for=\"".concat(id, "\"]"));
  389. if (!$label.length) {
  390. return $el.closest('label');
  391. }
  392. return $label;
  393. }
  394. /**
  395. * Get the set of labels associated with a set of radio els in this order
  396. * 2. The <label> with the attribute `[for="someInputId"]`
  397. * 3. The `.closest()` <label>
  398. *
  399. * @param {Object} $el - jQuery object to check for required attribute
  400. * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty
  401. */
  402. }, {
  403. key: "findRadioLabels",
  404. value: function findRadioLabels($els) {
  405. var _this4 = this;
  406. var labels = $els.map(function (i, el) {
  407. var id = el.id;
  408. var $label = _this4.$element.find("label[for=\"".concat(id, "\"]"));
  409. if (!$label.length) {
  410. $label = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el).closest('label');
  411. }
  412. return $label[0];
  413. });
  414. return jquery__WEBPACK_IMPORTED_MODULE_0___default()(labels);
  415. }
  416. /**
  417. * Adds the CSS error class as specified by the Abide settings to the label, input, and the form
  418. * @param {Object} $el - jQuery object to add the class to
  419. */
  420. }, {
  421. key: "addErrorClasses",
  422. value: function addErrorClasses($el) {
  423. var $label = this.findLabel($el);
  424. var $formError = this.findFormError($el);
  425. if ($label.length) {
  426. $label.addClass(this.options.labelErrorClass);
  427. }
  428. if ($formError.length) {
  429. $formError.addClass(this.options.formErrorClass);
  430. }
  431. $el.addClass(this.options.inputErrorClass).attr({
  432. 'data-invalid': '',
  433. 'aria-invalid': true
  434. });
  435. }
  436. /**
  437. * Adds [for] and [role=alert] attributes to all form error targetting $el,
  438. * and [aria-describedby] attribute to $el toward the first form error.
  439. * @param {Object} $el - jQuery object
  440. */
  441. }, {
  442. key: "addA11yAttributes",
  443. value: function addA11yAttributes($el) {
  444. var $errors = this.findFormError($el);
  445. var $labels = $errors.filter('label');
  446. var $error = $errors.first();
  447. if (!$errors.length) return; // Set [aria-describedby] on the input toward the first form error if it is not set
  448. if (typeof $el.attr('aria-describedby') === 'undefined') {
  449. // Get the first error ID or create one
  450. var errorId = $error.attr('id');
  451. if (typeof errorId === 'undefined') {
  452. errorId = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'abide-error');
  453. $error.attr('id', errorId);
  454. }
  455. ;
  456. $el.attr('aria-describedby', errorId);
  457. }
  458. if ($labels.filter('[for]').length < $labels.length) {
  459. // Get the input ID or create one
  460. var elemId = $el.attr('id');
  461. if (typeof elemId === 'undefined') {
  462. elemId = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'abide-input');
  463. $el.attr('id', elemId);
  464. }
  465. ; // For each label targeting $el, set [for] if it is not set.
  466. $labels.each(function (i, label) {
  467. var $label = jquery__WEBPACK_IMPORTED_MODULE_0___default()(label);
  468. if (typeof $label.attr('for') === 'undefined') $label.attr('for', elemId);
  469. });
  470. } // For each error targeting $el, set [role=alert] if it is not set.
  471. $errors.each(function (i, label) {
  472. var $label = jquery__WEBPACK_IMPORTED_MODULE_0___default()(label);
  473. if (typeof $label.attr('role') === 'undefined') $label.attr('role', 'alert');
  474. }).end();
  475. }
  476. /**
  477. * Adds [aria-live] attribute to the given global form error $el.
  478. * @param {Object} $el - jQuery object to add the attribute to
  479. */
  480. }, {
  481. key: "addGlobalErrorA11yAttributes",
  482. value: function addGlobalErrorA11yAttributes($el) {
  483. if (typeof $el.attr('aria-live') === 'undefined') $el.attr('aria-live', this.options.a11yErrorLevel);
  484. }
  485. /**
  486. * Remove CSS error classes etc from an entire radio button group
  487. * @param {String} groupName - A string that specifies the name of a radio button group
  488. *
  489. */
  490. }, {
  491. key: "removeRadioErrorClasses",
  492. value: function removeRadioErrorClasses(groupName) {
  493. var $els = this.$element.find(":radio[name=\"".concat(groupName, "\"]"));
  494. var $labels = this.findRadioLabels($els);
  495. var $formErrors = this.findFormError($els);
  496. if ($labels.length) {
  497. $labels.removeClass(this.options.labelErrorClass);
  498. }
  499. if ($formErrors.length) {
  500. $formErrors.removeClass(this.options.formErrorClass);
  501. }
  502. $els.removeClass(this.options.inputErrorClass).attr({
  503. 'data-invalid': null,
  504. 'aria-invalid': null
  505. });
  506. }
  507. /**
  508. * Removes CSS error class as specified by the Abide settings from the label, input, and the form
  509. * @param {Object} $el - jQuery object to remove the class from
  510. */
  511. }, {
  512. key: "removeErrorClasses",
  513. value: function removeErrorClasses($el) {
  514. // radios need to clear all of the els
  515. if ($el[0].type == 'radio') {
  516. return this.removeRadioErrorClasses($el.attr('name'));
  517. }
  518. var $label = this.findLabel($el);
  519. var $formError = this.findFormError($el);
  520. if ($label.length) {
  521. $label.removeClass(this.options.labelErrorClass);
  522. }
  523. if ($formError.length) {
  524. $formError.removeClass(this.options.formErrorClass);
  525. }
  526. $el.removeClass(this.options.inputErrorClass).attr({
  527. 'data-invalid': null,
  528. 'aria-invalid': null
  529. });
  530. }
  531. /**
  532. * Goes through a form to find inputs and proceeds to validate them in ways specific to their type.
  533. * Ignores inputs with data-abide-ignore, type="hidden" or disabled attributes set
  534. * @fires Abide#invalid
  535. * @fires Abide#valid
  536. * @param {Object} element - jQuery object to validate, should be an HTML input
  537. * @returns {Boolean} goodToGo - If the input is valid or not.
  538. */
  539. }, {
  540. key: "validateInput",
  541. value: function validateInput($el) {
  542. var clearRequire = this.requiredCheck($el),
  543. validated = false,
  544. customValidator = true,
  545. validator = $el.attr('data-validator'),
  546. equalTo = true; // don't validate ignored inputs or hidden inputs or disabled inputs
  547. if ($el.is('[data-abide-ignore]') || $el.is('[type="hidden"]') || $el.is('[disabled]')) {
  548. return true;
  549. }
  550. switch ($el[0].type) {
  551. case 'radio':
  552. validated = this.validateRadio($el.attr('name'));
  553. break;
  554. case 'checkbox':
  555. validated = clearRequire;
  556. break;
  557. case 'select':
  558. case 'select-one':
  559. case 'select-multiple':
  560. validated = clearRequire;
  561. break;
  562. default:
  563. validated = this.validateText($el);
  564. }
  565. if (validator) {
  566. customValidator = this.matchValidation($el, validator, $el.attr('required'));
  567. }
  568. if ($el.attr('data-equalto')) {
  569. equalTo = this.options.validators.equalTo($el);
  570. }
  571. var goodToGo = [clearRequire, validated, customValidator, equalTo].indexOf(false) === -1;
  572. var message = (goodToGo ? 'valid' : 'invalid') + '.zf.abide';
  573. if (goodToGo) {
  574. // Re-validate inputs that depend on this one with equalto
  575. var dependentElements = this.$element.find("[data-equalto=\"".concat($el.attr('id'), "\"]"));
  576. if (dependentElements.length) {
  577. var _this = this;
  578. dependentElements.each(function () {
  579. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val()) {
  580. _this.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this));
  581. }
  582. });
  583. }
  584. }
  585. this[goodToGo ? 'removeErrorClasses' : 'addErrorClasses']($el);
  586. /**
  587. * Fires when the input is done checking for validation. Event trigger is either `valid.zf.abide` or `invalid.zf.abide`
  588. * Trigger includes the DOM element of the input.
  589. * @event Abide#valid
  590. * @event Abide#invalid
  591. */
  592. $el.trigger(message, [$el]);
  593. return goodToGo;
  594. }
  595. /**
  596. * Goes through a form and if there are any invalid inputs, it will display the form error element
  597. * @returns {Boolean} noError - true if no errors were detected...
  598. * @fires Abide#formvalid
  599. * @fires Abide#forminvalid
  600. */
  601. }, {
  602. key: "validateForm",
  603. value: function validateForm() {
  604. var _this5 = this;
  605. var acc = [];
  606. var _this = this;
  607. this.$inputs.each(function () {
  608. acc.push(_this.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)));
  609. });
  610. var noError = acc.indexOf(false) === -1;
  611. this.$element.find('[data-abide-error]').each(function (i, elem) {
  612. var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(elem); // Ensure a11y attributes are set
  613. if (_this5.options.a11yAttributes) _this5.addGlobalErrorA11yAttributes($elem); // Show or hide the error
  614. $elem.css('display', noError ? 'none' : 'block');
  615. });
  616. /**
  617. * Fires when the form is finished validating. Event trigger is either `formvalid.zf.abide` or `forminvalid.zf.abide`.
  618. * Trigger includes the element of the form.
  619. * @event Abide#formvalid
  620. * @event Abide#forminvalid
  621. */
  622. this.$element.trigger((noError ? 'formvalid' : 'forminvalid') + '.zf.abide', [this.$element]);
  623. return noError;
  624. }
  625. /**
  626. * Determines whether or a not a text input is valid based on the pattern specified in the attribute. If no matching pattern is found, returns true.
  627. * @param {Object} $el - jQuery object to validate, should be a text input HTML element
  628. * @param {String} pattern - string value of one of the RegEx patterns in Abide.options.patterns
  629. * @returns {Boolean} Boolean value depends on whether or not the input value matches the pattern specified
  630. */
  631. }, {
  632. key: "validateText",
  633. value: function validateText($el, pattern) {
  634. // A pattern can be passed to this function, or it will be infered from the input's "pattern" attribute, or it's "type" attribute
  635. pattern = pattern || $el.attr('pattern') || $el.attr('type');
  636. var inputText = $el.val();
  637. var valid = false;
  638. if (inputText.length) {
  639. // If the pattern attribute on the element is in Abide's list of patterns, then test that regexp
  640. if (this.options.patterns.hasOwnProperty(pattern)) {
  641. valid = this.options.patterns[pattern].test(inputText);
  642. } // If the pattern name isn't also the type attribute of the field, then test it as a regexp
  643. else if (pattern !== $el.attr('type')) {
  644. valid = new RegExp(pattern).test(inputText);
  645. } else {
  646. valid = true;
  647. }
  648. } // An empty field is valid if it's not required
  649. else if (!$el.prop('required')) {
  650. valid = true;
  651. }
  652. return valid;
  653. }
  654. /**
  655. * Determines whether or a not a radio input is valid based on whether or not it is required and selected. Although the function targets a single `<input>`, it validates by checking the `required` and `checked` properties of all radio buttons in its group.
  656. * @param {String} groupName - A string that specifies the name of a radio button group
  657. * @returns {Boolean} Boolean value depends on whether or not at least one radio input has been selected (if it's required)
  658. */
  659. }, {
  660. key: "validateRadio",
  661. value: function validateRadio(groupName) {
  662. // If at least one radio in the group has the `required` attribute, the group is considered required
  663. // Per W3C spec, all radio buttons in a group should have `required`, but we're being nice
  664. var $group = this.$element.find(":radio[name=\"".concat(groupName, "\"]"));
  665. var valid = false,
  666. required = false; // For the group to be required, at least one radio needs to be required
  667. $group.each(function (i, e) {
  668. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).attr('required')) {
  669. required = true;
  670. }
  671. });
  672. if (!required) valid = true;
  673. if (!valid) {
  674. // For the group to be valid, at least one radio needs to be checked
  675. $group.each(function (i, e) {
  676. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).prop('checked')) {
  677. valid = true;
  678. }
  679. });
  680. }
  681. ;
  682. return valid;
  683. }
  684. /**
  685. * Determines if a selected input passes a custom validation function. Multiple validations can be used, if passed to the element with `data-validator="foo bar baz"` in a space separated listed.
  686. * @param {Object} $el - jQuery input element.
  687. * @param {String} validators - a string of function names matching functions in the Abide.options.validators object.
  688. * @param {Boolean} required - self explanatory?
  689. * @returns {Boolean} - true if validations passed.
  690. */
  691. }, {
  692. key: "matchValidation",
  693. value: function matchValidation($el, validators, required) {
  694. var _this6 = this;
  695. required = required ? true : false;
  696. var clear = validators.split(' ').map(function (v) {
  697. return _this6.options.validators[v]($el, required, $el.parent());
  698. });
  699. return clear.indexOf(false) === -1;
  700. }
  701. /**
  702. * Resets form inputs and styles
  703. * @fires Abide#formreset
  704. */
  705. }, {
  706. key: "resetForm",
  707. value: function resetForm() {
  708. var $form = this.$element,
  709. opts = this.options;
  710. jquery__WEBPACK_IMPORTED_MODULE_0___default()(".".concat(opts.labelErrorClass), $form).not('small').removeClass(opts.labelErrorClass);
  711. jquery__WEBPACK_IMPORTED_MODULE_0___default()(".".concat(opts.inputErrorClass), $form).not('small').removeClass(opts.inputErrorClass);
  712. jquery__WEBPACK_IMPORTED_MODULE_0___default()("".concat(opts.formErrorSelector, ".").concat(opts.formErrorClass)).removeClass(opts.formErrorClass);
  713. $form.find('[data-abide-error]').css('display', 'none');
  714. jquery__WEBPACK_IMPORTED_MODULE_0___default()(':input', $form).not(':button, :submit, :reset, :hidden, :radio, :checkbox, [data-abide-ignore]').val('').attr({
  715. 'data-invalid': null,
  716. 'aria-invalid': null
  717. });
  718. jquery__WEBPACK_IMPORTED_MODULE_0___default()(':input:radio', $form).not('[data-abide-ignore]').prop('checked', false).attr({
  719. 'data-invalid': null,
  720. 'aria-invalid': null
  721. });
  722. jquery__WEBPACK_IMPORTED_MODULE_0___default()(':input:checkbox', $form).not('[data-abide-ignore]').prop('checked', false).attr({
  723. 'data-invalid': null,
  724. 'aria-invalid': null
  725. });
  726. /**
  727. * Fires when the form has been reset.
  728. * @event Abide#formreset
  729. */
  730. $form.trigger('formreset.zf.abide', [$form]);
  731. }
  732. /**
  733. * Destroys an instance of Abide.
  734. * Removes error styles and classes from elements, without resetting their values.
  735. */
  736. }, {
  737. key: "_destroy",
  738. value: function _destroy() {
  739. var _this = this;
  740. this.$element.off('.abide').find('[data-abide-error]').css('display', 'none');
  741. this.$inputs.off('.abide').each(function () {
  742. _this.removeErrorClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this));
  743. });
  744. }
  745. }]);
  746. return Abide;
  747. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]);
  748. /**
  749. * Default settings for plugin
  750. */
  751. Abide.defaults = {
  752. /**
  753. * The default event to validate inputs. Checkboxes and radios validate immediately.
  754. * Remove or change this value for manual validation.
  755. * @option
  756. * @type {?string}
  757. * @default 'fieldChange'
  758. */
  759. validateOn: 'fieldChange',
  760. /**
  761. * Class to be applied to input labels on failed validation.
  762. * @option
  763. * @type {string}
  764. * @default 'is-invalid-label'
  765. */
  766. labelErrorClass: 'is-invalid-label',
  767. /**
  768. * Class to be applied to inputs on failed validation.
  769. * @option
  770. * @type {string}
  771. * @default 'is-invalid-input'
  772. */
  773. inputErrorClass: 'is-invalid-input',
  774. /**
  775. * Class selector to use to target Form Errors for show/hide.
  776. * @option
  777. * @type {string}
  778. * @default '.form-error'
  779. */
  780. formErrorSelector: '.form-error',
  781. /**
  782. * Class added to Form Errors on failed validation.
  783. * @option
  784. * @type {string}
  785. * @default 'is-visible'
  786. */
  787. formErrorClass: 'is-visible',
  788. /**
  789. * If true, automatically insert when possible:
  790. * - `[aria-describedby]` on fields
  791. * - `[role=alert]` on form errors and `[for]` on form error labels
  792. * - `[aria-live]` on global errors `[data-abide-error]` (see option `a11yErrorLevel`).
  793. * @option
  794. * @type {boolean}
  795. * @default true
  796. */
  797. a11yAttributes: true,
  798. /**
  799. * [aria-live] attribute value to be applied on global errors `[data-abide-error]`.
  800. * Options are: 'assertive', 'polite' and 'off'/null
  801. * @option
  802. * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions
  803. * @type {string}
  804. * @default 'assertive'
  805. */
  806. a11yErrorLevel: 'assertive',
  807. /**
  808. * Set to true to validate text inputs on any value change.
  809. * @option
  810. * @type {boolean}
  811. * @default false
  812. */
  813. liveValidate: false,
  814. /**
  815. * Set to true to validate inputs on blur.
  816. * @option
  817. * @type {boolean}
  818. * @default false
  819. */
  820. validateOnBlur: false,
  821. patterns: {
  822. alpha: /^[a-zA-Z]+$/,
  823. alpha_numeric: /^[a-zA-Z0-9]+$/,
  824. integer: /^[-+]?\d+$/,
  825. number: /^[-+]?\d*(?:[\.\,]\d+)?$/,
  826. // amex, visa, diners
  827. card: /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(?:222[1-9]|2[3-6][0-9]{2}|27[0-1][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/,
  828. cvv: /^([0-9]){3,4}$/,
  829. // http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address
  830. email: /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/,
  831. // From CommonRegexJS (@talyssonoc)
  832. // https://github.com/talyssonoc/CommonRegexJS/blob/e2901b9f57222bc14069dc8f0598d5f412555411/lib/commonregex.js#L76
  833. // For more restrictive URL Regexs, see https://mathiasbynens.be/demo/url-regex.
  834. url: /^((?:(https?|ftps?|file|ssh|sftp):\/\/|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\((?:[^\s()<>]+|(?:\([^\s()<>]+\)))*\))+(?:\((?:[^\s()<>]+|(?:\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?\xab\xbb\u201c\u201d\u2018\u2019]))$/,
  835. // abc.de
  836. domain: /^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,8}$/,
  837. datetime: /^([0-2][0-9]{3})\-([0-1][0-9])\-([0-3][0-9])T([0-5][0-9])\:([0-5][0-9])\:([0-5][0-9])(Z|([\-\+]([0-1][0-9])\:00))$/,
  838. // YYYY-MM-DD
  839. date: /(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))$/,
  840. // HH:MM:SS
  841. time: /^(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]){2}$/,
  842. dateISO: /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/,
  843. // MM/DD/YYYY
  844. month_day_year: /^(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.]\d{4}$/,
  845. // DD/MM/YYYY
  846. day_month_year: /^(0[1-9]|[12][0-9]|3[01])[- \/.](0[1-9]|1[012])[- \/.]\d{4}$/,
  847. // #FFF or #FFFFFF
  848. color: /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/,
  849. // Domain || URL
  850. website: {
  851. test: function test(text) {
  852. return Abide.defaults.patterns['domain'].test(text) || Abide.defaults.patterns['url'].test(text);
  853. }
  854. }
  855. },
  856. /**
  857. * Optional validation functions to be used. `equalTo` being the only default included function.
  858. * Functions should return only a boolean if the input is valid or not. Functions are given the following arguments:
  859. * el : The jQuery element to validate.
  860. * required : Boolean value of the required attribute be present or not.
  861. * parent : The direct parent of the input.
  862. * @option
  863. */
  864. validators: {
  865. equalTo: function equalTo(el, required, parent) {
  866. return jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(el.attr('data-equalto'))).val() === el.val();
  867. }
  868. }
  869. };
  870. /***/ }),
  871. /***/ "./js/foundation.accordion.js":
  872. /*!************************************!*\
  873. !*** ./js/foundation.accordion.js ***!
  874. \************************************/
  875. /*! exports provided: Accordion */
  876. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  877. "use strict";
  878. __webpack_require__.r(__webpack_exports__);
  879. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Accordion", function() { return Accordion; });
  880. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  881. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  882. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  883. /* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js");
  884. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  885. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  886. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  887. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  888. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  889. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  890. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  891. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  892. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  893. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  894. /**
  895. * Accordion module.
  896. * @module foundation.accordion
  897. * @requires foundation.util.keyboard
  898. */
  899. var Accordion =
  900. /*#__PURE__*/
  901. function (_Plugin) {
  902. _inherits(Accordion, _Plugin);
  903. function Accordion() {
  904. _classCallCheck(this, Accordion);
  905. return _possibleConstructorReturn(this, _getPrototypeOf(Accordion).apply(this, arguments));
  906. }
  907. _createClass(Accordion, [{
  908. key: "_setup",
  909. /**
  910. * Creates a new instance of an accordion.
  911. * @class
  912. * @name Accordion
  913. * @fires Accordion#init
  914. * @param {jQuery} element - jQuery object to make into an accordion.
  915. * @param {Object} options - a plain object with settings to override the default options.
  916. */
  917. value: function _setup(element, options) {
  918. this.$element = element;
  919. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Accordion.defaults, this.$element.data(), options);
  920. this.className = 'Accordion'; // ie9 back compat
  921. this._init();
  922. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].register('Accordion', {
  923. 'ENTER': 'toggle',
  924. 'SPACE': 'toggle',
  925. 'ARROW_DOWN': 'next',
  926. 'ARROW_UP': 'previous'
  927. });
  928. }
  929. /**
  930. * Initializes the accordion by animating the preset active pane(s).
  931. * @private
  932. */
  933. }, {
  934. key: "_init",
  935. value: function _init() {
  936. var _this2 = this;
  937. this._isInitializing = true;
  938. this.$element.attr('role', 'tablist');
  939. this.$tabs = this.$element.children('[data-accordion-item]');
  940. this.$tabs.each(function (idx, el) {
  941. var $el = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el),
  942. $content = $el.children('[data-tab-content]'),
  943. id = $content[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, 'accordion'),
  944. linkId = el.id ? "".concat(el.id, "-label") : "".concat(id, "-label");
  945. $el.find('a:first').attr({
  946. 'aria-controls': id,
  947. 'role': 'tab',
  948. 'id': linkId,
  949. 'aria-expanded': false,
  950. 'aria-selected': false
  951. });
  952. $content.attr({
  953. 'role': 'tabpanel',
  954. 'aria-labelledby': linkId,
  955. 'aria-hidden': true,
  956. 'id': id
  957. });
  958. });
  959. var $initActive = this.$element.find('.is-active').children('[data-tab-content]');
  960. if ($initActive.length) {
  961. // Save up the initial hash to return to it later when going back in history
  962. this._initialAnchor = $initActive.prev('a').attr('href');
  963. this._openSingleTab($initActive);
  964. }
  965. this._checkDeepLink = function () {
  966. var anchor = window.location.hash;
  967. if (!anchor.length) {
  968. // If we are still initializing and there is no anchor, then there is nothing to do
  969. if (_this2._isInitializing) return; // Otherwise, move to the initial anchor
  970. if (_this2._initialAnchor) anchor = _this2._initialAnchor;
  971. }
  972. var $anchor = anchor && jquery__WEBPACK_IMPORTED_MODULE_0___default()(anchor);
  973. var $link = anchor && _this2.$element.find("[href$=\"".concat(anchor, "\"]")); // Whether the anchor element that has been found is part of this element
  974. var isOwnAnchor = !!($anchor.length && $link.length); // If there is an anchor for the hash, open it (if not already active)
  975. if ($anchor && $link && $link.length) {
  976. if (!$link.parent('[data-accordion-item]').hasClass('is-active')) {
  977. _this2._openSingleTab($anchor);
  978. }
  979. ;
  980. } // Otherwise, close everything
  981. else {
  982. _this2._closeAllTabs();
  983. }
  984. if (isOwnAnchor) {
  985. // Roll up a little to show the titles
  986. if (_this2.options.deepLinkSmudge) {
  987. Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () {
  988. var offset = _this2.$element.offset();
  989. jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').animate({
  990. scrollTop: offset.top
  991. }, _this2.options.deepLinkSmudgeDelay);
  992. });
  993. }
  994. /**
  995. * Fires when the plugin has deeplinked at pageload
  996. * @event Accordion#deeplink
  997. */
  998. _this2.$element.trigger('deeplink.zf.accordion', [$link, $anchor]);
  999. }
  1000. }; //use browser to open a tab, if it exists in this tabset
  1001. if (this.options.deepLink) {
  1002. this._checkDeepLink();
  1003. }
  1004. this._events();
  1005. this._isInitializing = false;
  1006. }
  1007. /**
  1008. * Adds event handlers for items within the accordion.
  1009. * @private
  1010. */
  1011. }, {
  1012. key: "_events",
  1013. value: function _events() {
  1014. var _this = this;
  1015. this.$tabs.each(function () {
  1016. var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this);
  1017. var $tabContent = $elem.children('[data-tab-content]');
  1018. if ($tabContent.length) {
  1019. $elem.children('a').off('click.zf.accordion keydown.zf.accordion').on('click.zf.accordion', function (e) {
  1020. e.preventDefault();
  1021. _this.toggle($tabContent);
  1022. }).on('keydown.zf.accordion', function (e) {
  1023. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].handleKey(e, 'Accordion', {
  1024. toggle: function toggle() {
  1025. _this.toggle($tabContent);
  1026. },
  1027. next: function next() {
  1028. var $a = $elem.next().find('a').focus();
  1029. if (!_this.options.multiExpand) {
  1030. $a.trigger('click.zf.accordion');
  1031. }
  1032. },
  1033. previous: function previous() {
  1034. var $a = $elem.prev().find('a').focus();
  1035. if (!_this.options.multiExpand) {
  1036. $a.trigger('click.zf.accordion');
  1037. }
  1038. },
  1039. handled: function handled() {
  1040. e.preventDefault();
  1041. e.stopPropagation();
  1042. }
  1043. });
  1044. });
  1045. }
  1046. });
  1047. if (this.options.deepLink) {
  1048. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('hashchange', this._checkDeepLink);
  1049. }
  1050. }
  1051. /**
  1052. * Toggles the selected content pane's open/close state.
  1053. * @param {jQuery} $target - jQuery object of the pane to toggle (`.accordion-content`).
  1054. * @function
  1055. */
  1056. }, {
  1057. key: "toggle",
  1058. value: function toggle($target) {
  1059. if ($target.closest('[data-accordion]').is('[disabled]')) {
  1060. console.info('Cannot toggle an accordion that is disabled.');
  1061. return;
  1062. }
  1063. if ($target.parent().hasClass('is-active')) {
  1064. this.up($target);
  1065. } else {
  1066. this.down($target);
  1067. } //either replace or update browser history
  1068. if (this.options.deepLink) {
  1069. var anchor = $target.prev('a').attr('href');
  1070. if (this.options.updateHistory) {
  1071. history.pushState({}, '', anchor);
  1072. } else {
  1073. history.replaceState({}, '', anchor);
  1074. }
  1075. }
  1076. }
  1077. /**
  1078. * Opens the accordion tab defined by `$target`.
  1079. * @param {jQuery} $target - Accordion pane to open (`.accordion-content`).
  1080. * @fires Accordion#down
  1081. * @function
  1082. */
  1083. }, {
  1084. key: "down",
  1085. value: function down($target) {
  1086. if ($target.closest('[data-accordion]').is('[disabled]')) {
  1087. console.info('Cannot call down on an accordion that is disabled.');
  1088. return;
  1089. }
  1090. if (this.options.multiExpand) this._openTab($target);else this._openSingleTab($target);
  1091. }
  1092. /**
  1093. * Closes the tab defined by `$target`.
  1094. * It may be ignored if the Accordion options don't allow it.
  1095. *
  1096. * @param {jQuery} $target - Accordion tab to close (`.accordion-content`).
  1097. * @fires Accordion#up
  1098. * @function
  1099. */
  1100. }, {
  1101. key: "up",
  1102. value: function up($target) {
  1103. if (this.$element.is('[disabled]')) {
  1104. console.info('Cannot call up on an accordion that is disabled.');
  1105. return;
  1106. } // Don't close the item if it is already closed
  1107. var $targetItem = $target.parent();
  1108. if (!$targetItem.hasClass('is-active')) return; // Don't close the item if there is no other active item (unless with `allowAllClosed`)
  1109. var $othersItems = $targetItem.siblings();
  1110. if (!this.options.allowAllClosed && !$othersItems.hasClass('is-active')) return;
  1111. this._closeTab($target);
  1112. }
  1113. /**
  1114. * Make the tab defined by `$target` the only opened tab, closing all others tabs.
  1115. * @param {jQuery} $target - Accordion tab to open (`.accordion-content`).
  1116. * @function
  1117. * @private
  1118. */
  1119. }, {
  1120. key: "_openSingleTab",
  1121. value: function _openSingleTab($target) {
  1122. // Close all the others active tabs.
  1123. var $activeContents = this.$element.children('.is-active').children('[data-tab-content]');
  1124. if ($activeContents.length) {
  1125. this._closeTab($activeContents.not($target));
  1126. } // Then open the target.
  1127. this._openTab($target);
  1128. }
  1129. /**
  1130. * Opens the tab defined by `$target`.
  1131. * @param {jQuery} $target - Accordion tab to open (`.accordion-content`).
  1132. * @fires Accordion#down
  1133. * @function
  1134. * @private
  1135. */
  1136. }, {
  1137. key: "_openTab",
  1138. value: function _openTab($target) {
  1139. var _this3 = this;
  1140. var $targetItem = $target.parent();
  1141. var targetContentId = $target.attr('aria-labelledby');
  1142. $target.attr('aria-hidden', false);
  1143. $targetItem.addClass('is-active');
  1144. jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(targetContentId)).attr({
  1145. 'aria-expanded': true,
  1146. 'aria-selected': true
  1147. });
  1148. $target.slideDown(this.options.slideSpeed, function () {
  1149. /**
  1150. * Fires when the tab is done opening.
  1151. * @event Accordion#down
  1152. */
  1153. _this3.$element.trigger('down.zf.accordion', [$target]);
  1154. });
  1155. }
  1156. /**
  1157. * Closes the tab defined by `$target`.
  1158. * @param {jQuery} $target - Accordion tab to close (`.accordion-content`).
  1159. * @fires Accordion#up
  1160. * @function
  1161. * @private
  1162. */
  1163. }, {
  1164. key: "_closeTab",
  1165. value: function _closeTab($target) {
  1166. var _this4 = this;
  1167. var $targetItem = $target.parent();
  1168. var targetContentId = $target.attr('aria-labelledby');
  1169. $target.attr('aria-hidden', true);
  1170. $targetItem.removeClass('is-active');
  1171. jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(targetContentId)).attr({
  1172. 'aria-expanded': false,
  1173. 'aria-selected': false
  1174. });
  1175. $target.slideUp(this.options.slideSpeed, function () {
  1176. /**
  1177. * Fires when the tab is done collapsing up.
  1178. * @event Accordion#up
  1179. */
  1180. _this4.$element.trigger('up.zf.accordion', [$target]);
  1181. });
  1182. }
  1183. /**
  1184. * Closes all active tabs
  1185. * @fires Accordion#up
  1186. * @function
  1187. * @private
  1188. */
  1189. }, {
  1190. key: "_closeAllTabs",
  1191. value: function _closeAllTabs() {
  1192. var $activeTabs = this.$element.children('.is-active').children('[data-tab-content]');
  1193. if ($activeTabs.length) {
  1194. this._closeTab($activeTabs);
  1195. }
  1196. }
  1197. /**
  1198. * Destroys an instance of an accordion.
  1199. * @fires Accordion#destroyed
  1200. * @function
  1201. */
  1202. }, {
  1203. key: "_destroy",
  1204. value: function _destroy() {
  1205. this.$element.find('[data-tab-content]').stop(true).slideUp(0).css('display', '');
  1206. this.$element.find('a').off('.zf.accordion');
  1207. if (this.options.deepLink) {
  1208. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('hashchange', this._checkDeepLink);
  1209. }
  1210. }
  1211. }]);
  1212. return Accordion;
  1213. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__["Plugin"]);
  1214. Accordion.defaults = {
  1215. /**
  1216. * Amount of time to animate the opening of an accordion pane.
  1217. * @option
  1218. * @type {number}
  1219. * @default 250
  1220. */
  1221. slideSpeed: 250,
  1222. /**
  1223. * Allow the accordion to have multiple open panes.
  1224. * @option
  1225. * @type {boolean}
  1226. * @default false
  1227. */
  1228. multiExpand: false,
  1229. /**
  1230. * Allow the accordion to close all panes.
  1231. * @option
  1232. * @type {boolean}
  1233. * @default false
  1234. */
  1235. allowAllClosed: false,
  1236. /**
  1237. * Link the location hash to the open pane.
  1238. * Set the location hash when the opened pane changes, and open and scroll to the corresponding pane when the location changes.
  1239. * @option
  1240. * @type {boolean}
  1241. * @default false
  1242. */
  1243. deepLink: false,
  1244. /**
  1245. * If `deepLink` is enabled, adjust the deep link scroll to make sure the top of the accordion panel is visible
  1246. * @option
  1247. * @type {boolean}
  1248. * @default false
  1249. */
  1250. deepLinkSmudge: false,
  1251. /**
  1252. * If `deepLinkSmudge` is enabled, animation time (ms) for the deep link adjustment
  1253. * @option
  1254. * @type {number}
  1255. * @default 300
  1256. */
  1257. deepLinkSmudgeDelay: 300,
  1258. /**
  1259. * If `deepLink` is enabled, update the browser history with the open accordion
  1260. * @option
  1261. * @type {boolean}
  1262. * @default false
  1263. */
  1264. updateHistory: false
  1265. };
  1266. /***/ }),
  1267. /***/ "./js/foundation.accordionMenu.js":
  1268. /*!****************************************!*\
  1269. !*** ./js/foundation.accordionMenu.js ***!
  1270. \****************************************/
  1271. /*! exports provided: AccordionMenu */
  1272. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1273. "use strict";
  1274. __webpack_require__.r(__webpack_exports__);
  1275. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AccordionMenu", function() { return AccordionMenu; });
  1276. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  1277. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  1278. /* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js");
  1279. /* harmony import */ var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.nest */ "./js/foundation.util.nest.js");
  1280. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  1281. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  1282. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  1283. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1284. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  1285. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  1286. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  1287. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  1288. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  1289. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  1290. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  1291. /**
  1292. * AccordionMenu module.
  1293. * @module foundation.accordionMenu
  1294. * @requires foundation.util.keyboard
  1295. * @requires foundation.util.nest
  1296. */
  1297. var AccordionMenu =
  1298. /*#__PURE__*/
  1299. function (_Plugin) {
  1300. _inherits(AccordionMenu, _Plugin);
  1301. function AccordionMenu() {
  1302. _classCallCheck(this, AccordionMenu);
  1303. return _possibleConstructorReturn(this, _getPrototypeOf(AccordionMenu).apply(this, arguments));
  1304. }
  1305. _createClass(AccordionMenu, [{
  1306. key: "_setup",
  1307. /**
  1308. * Creates a new instance of an accordion menu.
  1309. * @class
  1310. * @name AccordionMenu
  1311. * @fires AccordionMenu#init
  1312. * @param {jQuery} element - jQuery object to make into an accordion menu.
  1313. * @param {Object} options - Overrides to the default plugin settings.
  1314. */
  1315. value: function _setup(element, options) {
  1316. this.$element = element;
  1317. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, AccordionMenu.defaults, this.$element.data(), options);
  1318. this.className = 'AccordionMenu'; // ie9 back compat
  1319. this._init();
  1320. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('AccordionMenu', {
  1321. 'ENTER': 'toggle',
  1322. 'SPACE': 'toggle',
  1323. 'ARROW_RIGHT': 'open',
  1324. 'ARROW_UP': 'up',
  1325. 'ARROW_DOWN': 'down',
  1326. 'ARROW_LEFT': 'close',
  1327. 'ESCAPE': 'closeAll'
  1328. });
  1329. }
  1330. /**
  1331. * Initializes the accordion menu by hiding all nested menus.
  1332. * @private
  1333. */
  1334. }, {
  1335. key: "_init",
  1336. value: function _init() {
  1337. _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__["Nest"].Feather(this.$element, 'accordion');
  1338. var _this = this;
  1339. this.$element.find('[data-submenu]').not('.is-active').slideUp(0); //.find('a').css('padding-left', '1rem');
  1340. this.$element.attr({
  1341. 'role': 'tree',
  1342. 'aria-multiselectable': this.options.multiOpen
  1343. });
  1344. this.$menuLinks = this.$element.find('.is-accordion-submenu-parent');
  1345. this.$menuLinks.each(function () {
  1346. var linkId = this.id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'acc-menu-link'),
  1347. $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  1348. $sub = $elem.children('[data-submenu]'),
  1349. subId = $sub[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'acc-menu'),
  1350. isActive = $sub.hasClass('is-active');
  1351. if (_this.options.parentLink) {
  1352. var $anchor = $elem.children('a');
  1353. $anchor.clone().prependTo($sub).wrap('<li data-is-parent-link class="is-submenu-parent-item is-submenu-item is-accordion-submenu-item"></li>');
  1354. }
  1355. if (_this.options.submenuToggle) {
  1356. $elem.addClass('has-submenu-toggle');
  1357. $elem.children('a').after('<button id="' + linkId + '" class="submenu-toggle" aria-controls="' + subId + '" aria-expanded="' + isActive + '" title="' + _this.options.submenuToggleText + '"><span class="submenu-toggle-text">' + _this.options.submenuToggleText + '</span></button>');
  1358. } else {
  1359. $elem.attr({
  1360. 'aria-controls': subId,
  1361. 'aria-expanded': isActive,
  1362. 'id': linkId
  1363. });
  1364. }
  1365. $sub.attr({
  1366. 'aria-labelledby': linkId,
  1367. 'aria-hidden': !isActive,
  1368. 'role': 'group',
  1369. 'id': subId
  1370. });
  1371. });
  1372. this.$element.find('li').attr({
  1373. 'role': 'treeitem'
  1374. });
  1375. var initPanes = this.$element.find('.is-active');
  1376. if (initPanes.length) {
  1377. var _this = this;
  1378. initPanes.each(function () {
  1379. _this.down(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this));
  1380. });
  1381. }
  1382. this._events();
  1383. }
  1384. /**
  1385. * Adds event handlers for items within the menu.
  1386. * @private
  1387. */
  1388. }, {
  1389. key: "_events",
  1390. value: function _events() {
  1391. var _this = this;
  1392. this.$element.find('li').each(function () {
  1393. var $submenu = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('[data-submenu]');
  1394. if ($submenu.length) {
  1395. if (_this.options.submenuToggle) {
  1396. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('.submenu-toggle').off('click.zf.accordionMenu').on('click.zf.accordionMenu', function (e) {
  1397. _this.toggle($submenu);
  1398. });
  1399. } else {
  1400. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('a').off('click.zf.accordionMenu').on('click.zf.accordionMenu', function (e) {
  1401. e.preventDefault();
  1402. _this.toggle($submenu);
  1403. });
  1404. }
  1405. }
  1406. }).on('keydown.zf.accordionmenu', function (e) {
  1407. var $element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  1408. $elements = $element.parent('ul').children('li'),
  1409. $prevElement,
  1410. $nextElement,
  1411. $target = $element.children('[data-submenu]');
  1412. $elements.each(function (i) {
  1413. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is($element)) {
  1414. $prevElement = $elements.eq(Math.max(0, i - 1)).find('a').first();
  1415. $nextElement = $elements.eq(Math.min(i + 1, $elements.length - 1)).find('a').first();
  1416. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('[data-submenu]:visible').length) {
  1417. // has open sub menu
  1418. $nextElement = $element.find('li:first-child').find('a').first();
  1419. }
  1420. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is(':first-child')) {
  1421. // is first element of sub menu
  1422. $prevElement = $element.parents('li').first().find('a').first();
  1423. } else if ($prevElement.parents('li').first().children('[data-submenu]:visible').length) {
  1424. // if previous element has open sub menu
  1425. $prevElement = $prevElement.parents('li').find('li:last-child').find('a').first();
  1426. }
  1427. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is(':last-child')) {
  1428. // is last element of sub menu
  1429. $nextElement = $element.parents('li').first().next('li').find('a').first();
  1430. }
  1431. return;
  1432. }
  1433. });
  1434. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'AccordionMenu', {
  1435. open: function open() {
  1436. if ($target.is(':hidden')) {
  1437. _this.down($target);
  1438. $target.find('li').first().find('a').first().focus();
  1439. }
  1440. },
  1441. close: function close() {
  1442. if ($target.length && !$target.is(':hidden')) {
  1443. // close active sub of this item
  1444. _this.up($target);
  1445. } else if ($element.parent('[data-submenu]').length) {
  1446. // close currently open sub
  1447. _this.up($element.parent('[data-submenu]'));
  1448. $element.parents('li').first().find('a').first().focus();
  1449. }
  1450. },
  1451. up: function up() {
  1452. $prevElement.focus();
  1453. return true;
  1454. },
  1455. down: function down() {
  1456. $nextElement.focus();
  1457. return true;
  1458. },
  1459. toggle: function toggle() {
  1460. if (_this.options.submenuToggle) {
  1461. return false;
  1462. }
  1463. if ($element.children('[data-submenu]').length) {
  1464. _this.toggle($element.children('[data-submenu]'));
  1465. return true;
  1466. }
  1467. },
  1468. closeAll: function closeAll() {
  1469. _this.hideAll();
  1470. },
  1471. handled: function handled(preventDefault) {
  1472. if (preventDefault) {
  1473. e.preventDefault();
  1474. }
  1475. e.stopImmediatePropagation();
  1476. }
  1477. });
  1478. }); //.attr('tabindex', 0);
  1479. }
  1480. /**
  1481. * Closes all panes of the menu.
  1482. * @function
  1483. */
  1484. }, {
  1485. key: "hideAll",
  1486. value: function hideAll() {
  1487. this.up(this.$element.find('[data-submenu]'));
  1488. }
  1489. /**
  1490. * Opens all panes of the menu.
  1491. * @function
  1492. */
  1493. }, {
  1494. key: "showAll",
  1495. value: function showAll() {
  1496. this.down(this.$element.find('[data-submenu]'));
  1497. }
  1498. /**
  1499. * Toggles the open/close state of a submenu.
  1500. * @function
  1501. * @param {jQuery} $target - the submenu to toggle
  1502. */
  1503. }, {
  1504. key: "toggle",
  1505. value: function toggle($target) {
  1506. if (!$target.is(':animated')) {
  1507. if (!$target.is(':hidden')) {
  1508. this.up($target);
  1509. } else {
  1510. this.down($target);
  1511. }
  1512. }
  1513. }
  1514. /**
  1515. * Opens the sub-menu defined by `$target`.
  1516. * @param {jQuery} $target - Sub-menu to open.
  1517. * @fires AccordionMenu#down
  1518. */
  1519. }, {
  1520. key: "down",
  1521. value: function down($target) {
  1522. var _this2 = this;
  1523. // If having multiple submenus active is disabled, close all the submenus
  1524. // that are not parents or children of the targeted submenu.
  1525. if (!this.options.multiOpen) {
  1526. // The "branch" of the targetted submenu, from the component root to
  1527. // the active submenus nested in it.
  1528. var $targetBranch = $target.parentsUntil(this.$element).add($target).add($target.find('.is-active')); // All the active submenus that are not in the branch.
  1529. var $othersActiveSubmenus = this.$element.find('.is-active').not($targetBranch);
  1530. this.up($othersActiveSubmenus);
  1531. }
  1532. $target.addClass('is-active').attr({
  1533. 'aria-hidden': false
  1534. });
  1535. if (this.options.submenuToggle) {
  1536. $target.prev('.submenu-toggle').attr({
  1537. 'aria-expanded': true
  1538. });
  1539. } else {
  1540. $target.parent('.is-accordion-submenu-parent').attr({
  1541. 'aria-expanded': true
  1542. });
  1543. }
  1544. $target.slideDown(this.options.slideSpeed, function () {
  1545. /**
  1546. * Fires when the menu is done opening.
  1547. * @event AccordionMenu#down
  1548. */
  1549. _this2.$element.trigger('down.zf.accordionMenu', [$target]);
  1550. });
  1551. }
  1552. /**
  1553. * Closes the sub-menu defined by `$target`. All sub-menus inside the target will be closed as well.
  1554. * @param {jQuery} $target - Sub-menu to close.
  1555. * @fires AccordionMenu#up
  1556. */
  1557. }, {
  1558. key: "up",
  1559. value: function up($target) {
  1560. var _this3 = this;
  1561. var $submenus = $target.find('[data-submenu]');
  1562. var $allmenus = $target.add($submenus);
  1563. $submenus.slideUp(0);
  1564. $allmenus.removeClass('is-active').attr('aria-hidden', true);
  1565. if (this.options.submenuToggle) {
  1566. $allmenus.prev('.submenu-toggle').attr('aria-expanded', false);
  1567. } else {
  1568. $allmenus.parent('.is-accordion-submenu-parent').attr('aria-expanded', false);
  1569. }
  1570. $target.slideUp(this.options.slideSpeed, function () {
  1571. /**
  1572. * Fires when the menu is done collapsing up.
  1573. * @event AccordionMenu#up
  1574. */
  1575. _this3.$element.trigger('up.zf.accordionMenu', [$target]);
  1576. });
  1577. }
  1578. /**
  1579. * Destroys an instance of accordion menu.
  1580. * @fires AccordionMenu#destroyed
  1581. */
  1582. }, {
  1583. key: "_destroy",
  1584. value: function _destroy() {
  1585. this.$element.find('[data-submenu]').slideDown(0).css('display', '');
  1586. this.$element.find('a').off('click.zf.accordionMenu');
  1587. this.$element.find('[data-is-parent-link]').detach();
  1588. if (this.options.submenuToggle) {
  1589. this.$element.find('.has-submenu-toggle').removeClass('has-submenu-toggle');
  1590. this.$element.find('.submenu-toggle').remove();
  1591. }
  1592. _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__["Nest"].Burn(this.$element, 'accordion');
  1593. }
  1594. }]);
  1595. return AccordionMenu;
  1596. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__["Plugin"]);
  1597. AccordionMenu.defaults = {
  1598. /**
  1599. * Adds the parent link to the submenu.
  1600. * @option
  1601. * @type {boolean}
  1602. * @default false
  1603. */
  1604. parentLink: false,
  1605. /**
  1606. * Amount of time to animate the opening of a submenu in ms.
  1607. * @option
  1608. * @type {number}
  1609. * @default 250
  1610. */
  1611. slideSpeed: 250,
  1612. /**
  1613. * Adds a separate submenu toggle button. This allows the parent item to have a link.
  1614. * @option
  1615. * @example true
  1616. */
  1617. submenuToggle: false,
  1618. /**
  1619. * The text used for the submenu toggle if enabled. This is used for screen readers only.
  1620. * @option
  1621. * @example true
  1622. */
  1623. submenuToggleText: 'Toggle menu',
  1624. /**
  1625. * Allow the menu to have multiple open panes.
  1626. * @option
  1627. * @type {boolean}
  1628. * @default true
  1629. */
  1630. multiOpen: true
  1631. };
  1632. /***/ }),
  1633. /***/ "./js/foundation.core.js":
  1634. /*!*******************************!*\
  1635. !*** ./js/foundation.core.js ***!
  1636. \*******************************/
  1637. /*! exports provided: Foundation */
  1638. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1639. "use strict";
  1640. __webpack_require__.r(__webpack_exports__);
  1641. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Foundation", function() { return Foundation; });
  1642. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  1643. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  1644. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  1645. /* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js");
  1646. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  1647. var FOUNDATION_VERSION = '6.5.3'; // Global Foundation object
  1648. // This is attached to the window, or used as a module for AMD/Browserify
  1649. var Foundation = {
  1650. version: FOUNDATION_VERSION,
  1651. /**
  1652. * Stores initialized plugins.
  1653. */
  1654. _plugins: {},
  1655. /**
  1656. * Stores generated unique ids for plugin instances
  1657. */
  1658. _uuids: [],
  1659. /**
  1660. * Defines a Foundation plugin, adding it to the `Foundation` namespace and the list of plugins to initialize when reflowing.
  1661. * @param {Object} plugin - The constructor of the plugin.
  1662. */
  1663. plugin: function plugin(_plugin, name) {
  1664. // Object key to use when adding to global Foundation object
  1665. // Examples: Foundation.Reveal, Foundation.OffCanvas
  1666. var className = name || functionName(_plugin); // Object key to use when storing the plugin, also used to create the identifying data attribute for the plugin
  1667. // Examples: data-reveal, data-off-canvas
  1668. var attrName = hyphenate(className); // Add to the Foundation object and the plugins list (for reflowing)
  1669. this._plugins[attrName] = this[className] = _plugin;
  1670. },
  1671. /**
  1672. * @function
  1673. * Populates the _uuids array with pointers to each individual plugin instance.
  1674. * Adds the `zfPlugin` data-attribute to programmatically created plugins to allow use of $(selector).foundation(method) calls.
  1675. * Also fires the initialization event for each plugin, consolidating repetitive code.
  1676. * @param {Object} plugin - an instance of a plugin, usually `this` in context.
  1677. * @param {String} name - the name of the plugin, passed as a camelCased string.
  1678. * @fires Plugin#init
  1679. */
  1680. registerPlugin: function registerPlugin(plugin, name) {
  1681. var pluginName = name ? hyphenate(name) : functionName(plugin.constructor).toLowerCase();
  1682. plugin.uuid = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, pluginName);
  1683. if (!plugin.$element.attr("data-".concat(pluginName))) {
  1684. plugin.$element.attr("data-".concat(pluginName), plugin.uuid);
  1685. }
  1686. if (!plugin.$element.data('zfPlugin')) {
  1687. plugin.$element.data('zfPlugin', plugin);
  1688. }
  1689. /**
  1690. * Fires when the plugin has initialized.
  1691. * @event Plugin#init
  1692. */
  1693. plugin.$element.trigger("init.zf.".concat(pluginName));
  1694. this._uuids.push(plugin.uuid);
  1695. return;
  1696. },
  1697. /**
  1698. * @function
  1699. * Removes the plugins uuid from the _uuids array.
  1700. * Removes the zfPlugin data attribute, as well as the data-plugin-name attribute.
  1701. * Also fires the destroyed event for the plugin, consolidating repetitive code.
  1702. * @param {Object} plugin - an instance of a plugin, usually `this` in context.
  1703. * @fires Plugin#destroyed
  1704. */
  1705. unregisterPlugin: function unregisterPlugin(plugin) {
  1706. var pluginName = hyphenate(functionName(plugin.$element.data('zfPlugin').constructor));
  1707. this._uuids.splice(this._uuids.indexOf(plugin.uuid), 1);
  1708. plugin.$element.removeAttr("data-".concat(pluginName)).removeData('zfPlugin')
  1709. /**
  1710. * Fires when the plugin has been destroyed.
  1711. * @event Plugin#destroyed
  1712. */
  1713. .trigger("destroyed.zf.".concat(pluginName));
  1714. for (var prop in plugin) {
  1715. plugin[prop] = null; //clean up script to prep for garbage collection.
  1716. }
  1717. return;
  1718. },
  1719. /**
  1720. * @function
  1721. * Causes one or more active plugins to re-initialize, resetting event listeners, recalculating positions, etc.
  1722. * @param {String} plugins - optional string of an individual plugin key, attained by calling `$(element).data('pluginName')`, or string of a plugin class i.e. `'dropdown'`
  1723. * @default If no argument is passed, reflow all currently active plugins.
  1724. */
  1725. reInit: function reInit(plugins) {
  1726. var isJQ = plugins instanceof jquery__WEBPACK_IMPORTED_MODULE_0___default.a;
  1727. try {
  1728. if (isJQ) {
  1729. plugins.each(function () {
  1730. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('zfPlugin')._init();
  1731. });
  1732. } else {
  1733. var type = _typeof(plugins),
  1734. _this = this,
  1735. fns = {
  1736. 'object': function object(plgs) {
  1737. plgs.forEach(function (p) {
  1738. p = hyphenate(p);
  1739. jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-' + p + ']').foundation('_init');
  1740. });
  1741. },
  1742. 'string': function string() {
  1743. plugins = hyphenate(plugins);
  1744. jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-' + plugins + ']').foundation('_init');
  1745. },
  1746. 'undefined': function undefined() {
  1747. this['object'](Object.keys(_this._plugins));
  1748. }
  1749. };
  1750. fns[type](plugins);
  1751. }
  1752. } catch (err) {
  1753. console.error(err);
  1754. } finally {
  1755. return plugins;
  1756. }
  1757. },
  1758. /**
  1759. * Initialize plugins on any elements within `elem` (and `elem` itself) that aren't already initialized.
  1760. * @param {Object} elem - jQuery object containing the element to check inside. Also checks the element itself, unless it's the `document` object.
  1761. * @param {String|Array} plugins - A list of plugins to initialize. Leave this out to initialize everything.
  1762. */
  1763. reflow: function reflow(elem, plugins) {
  1764. // If plugins is undefined, just grab everything
  1765. if (typeof plugins === 'undefined') {
  1766. plugins = Object.keys(this._plugins);
  1767. } // If plugins is a string, convert it to an array with one item
  1768. else if (typeof plugins === 'string') {
  1769. plugins = [plugins];
  1770. }
  1771. var _this = this; // Iterate through each plugin
  1772. jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(plugins, function (i, name) {
  1773. // Get the current plugin
  1774. var plugin = _this._plugins[name]; // Localize the search to all elements inside elem, as well as elem itself, unless elem === document
  1775. var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(elem).find('[data-' + name + ']').addBack('[data-' + name + ']'); // For each plugin found, initialize it
  1776. $elem.each(function () {
  1777. var $el = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  1778. opts = {}; // Don't double-dip on plugins
  1779. if ($el.data('zfPlugin')) {
  1780. console.warn("Tried to initialize " + name + " on an element that already has a Foundation plugin.");
  1781. return;
  1782. }
  1783. if ($el.attr('data-options')) {
  1784. var thing = $el.attr('data-options').split(';').forEach(function (e, i) {
  1785. var opt = e.split(':').map(function (el) {
  1786. return el.trim();
  1787. });
  1788. if (opt[0]) opts[opt[0]] = parseValue(opt[1]);
  1789. });
  1790. }
  1791. try {
  1792. $el.data('zfPlugin', new plugin(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), opts));
  1793. } catch (er) {
  1794. console.error(er);
  1795. } finally {
  1796. return;
  1797. }
  1798. });
  1799. });
  1800. },
  1801. getFnName: functionName,
  1802. addToJquery: function addToJquery($) {
  1803. // TODO: consider not making this a jQuery function
  1804. // TODO: need way to reflow vs. re-initialize
  1805. /**
  1806. * The Foundation jQuery method.
  1807. * @param {String|Array} method - An action to perform on the current jQuery object.
  1808. */
  1809. var foundation = function foundation(method) {
  1810. var type = _typeof(method),
  1811. $noJS = $('.no-js');
  1812. if ($noJS.length) {
  1813. $noJS.removeClass('no-js');
  1814. }
  1815. if (type === 'undefined') {
  1816. //needs to initialize the Foundation object, or an individual plugin.
  1817. _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__["MediaQuery"]._init();
  1818. Foundation.reflow(this);
  1819. } else if (type === 'string') {
  1820. //an individual method to invoke on a plugin or group of plugins
  1821. var args = Array.prototype.slice.call(arguments, 1); //collect all the arguments, if necessary
  1822. var plugClass = this.data('zfPlugin'); //determine the class of plugin
  1823. if (typeof plugClass !== 'undefined' && typeof plugClass[method] !== 'undefined') {
  1824. //make sure both the class and method exist
  1825. if (this.length === 1) {
  1826. //if there's only one, call it directly.
  1827. plugClass[method].apply(plugClass, args);
  1828. } else {
  1829. this.each(function (i, el) {
  1830. //otherwise loop through the jQuery collection and invoke the method on each
  1831. plugClass[method].apply($(el).data('zfPlugin'), args);
  1832. });
  1833. }
  1834. } else {
  1835. //error for no class or no method
  1836. throw new ReferenceError("We're sorry, '" + method + "' is not an available method for " + (plugClass ? functionName(plugClass) : 'this element') + '.');
  1837. }
  1838. } else {
  1839. //error for invalid argument type
  1840. throw new TypeError("We're sorry, ".concat(type, " is not a valid parameter. You must use a string representing the method you wish to invoke."));
  1841. }
  1842. return this;
  1843. };
  1844. $.fn.foundation = foundation;
  1845. return $;
  1846. }
  1847. };
  1848. Foundation.util = {
  1849. /**
  1850. * Function for applying a debounce effect to a function call.
  1851. * @function
  1852. * @param {Function} func - Function to be called at end of timeout.
  1853. * @param {Number} delay - Time in ms to delay the call of `func`.
  1854. * @returns function
  1855. */
  1856. throttle: function throttle(func, delay) {
  1857. var timer = null;
  1858. return function () {
  1859. var context = this,
  1860. args = arguments;
  1861. if (timer === null) {
  1862. timer = setTimeout(function () {
  1863. func.apply(context, args);
  1864. timer = null;
  1865. }, delay);
  1866. }
  1867. };
  1868. }
  1869. };
  1870. window.Foundation = Foundation; // Polyfill for requestAnimationFrame
  1871. (function () {
  1872. if (!Date.now || !window.Date.now) window.Date.now = Date.now = function () {
  1873. return new Date().getTime();
  1874. };
  1875. var vendors = ['webkit', 'moz'];
  1876. for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) {
  1877. var vp = vendors[i];
  1878. window.requestAnimationFrame = window[vp + 'RequestAnimationFrame'];
  1879. window.cancelAnimationFrame = window[vp + 'CancelAnimationFrame'] || window[vp + 'CancelRequestAnimationFrame'];
  1880. }
  1881. if (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent) || !window.requestAnimationFrame || !window.cancelAnimationFrame) {
  1882. var lastTime = 0;
  1883. window.requestAnimationFrame = function (callback) {
  1884. var now = Date.now();
  1885. var nextTime = Math.max(lastTime + 16, now);
  1886. return setTimeout(function () {
  1887. callback(lastTime = nextTime);
  1888. }, nextTime - now);
  1889. };
  1890. window.cancelAnimationFrame = clearTimeout;
  1891. }
  1892. /**
  1893. * Polyfill for performance.now, required by rAF
  1894. */
  1895. if (!window.performance || !window.performance.now) {
  1896. window.performance = {
  1897. start: Date.now(),
  1898. now: function now() {
  1899. return Date.now() - this.start;
  1900. }
  1901. };
  1902. }
  1903. })();
  1904. if (!Function.prototype.bind) {
  1905. Function.prototype.bind = function (oThis) {
  1906. if (typeof this !== 'function') {
  1907. // closest thing possible to the ECMAScript 5
  1908. // internal IsCallable function
  1909. throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
  1910. }
  1911. var aArgs = Array.prototype.slice.call(arguments, 1),
  1912. fToBind = this,
  1913. fNOP = function fNOP() {},
  1914. fBound = function fBound() {
  1915. return fToBind.apply(this instanceof fNOP ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments)));
  1916. };
  1917. if (this.prototype) {
  1918. // native functions don't have a prototype
  1919. fNOP.prototype = this.prototype;
  1920. }
  1921. fBound.prototype = new fNOP();
  1922. return fBound;
  1923. };
  1924. } // Polyfill to get the name of a function in IE9
  1925. function functionName(fn) {
  1926. if (typeof Function.prototype.name === 'undefined') {
  1927. var funcNameRegex = /function\s([^(]{1,})\(/;
  1928. var results = funcNameRegex.exec(fn.toString());
  1929. return results && results.length > 1 ? results[1].trim() : "";
  1930. } else if (typeof fn.prototype === 'undefined') {
  1931. return fn.constructor.name;
  1932. } else {
  1933. return fn.prototype.constructor.name;
  1934. }
  1935. }
  1936. function parseValue(str) {
  1937. if ('true' === str) return true;else if ('false' === str) return false;else if (!isNaN(str * 1)) return parseFloat(str);
  1938. return str;
  1939. } // Convert PascalCase to kebab-case
  1940. // Thank you: http://stackoverflow.com/a/8955580
  1941. function hyphenate(str) {
  1942. return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
  1943. }
  1944. /***/ }),
  1945. /***/ "./js/foundation.core.plugin.js":
  1946. /*!**************************************!*\
  1947. !*** ./js/foundation.core.plugin.js ***!
  1948. \**************************************/
  1949. /*! exports provided: Plugin */
  1950. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1951. "use strict";
  1952. __webpack_require__.r(__webpack_exports__);
  1953. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Plugin", function() { return Plugin; });
  1954. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  1955. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  1956. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  1957. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1958. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  1959. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  1960. // Abstract class for providing lifecycle hooks. Expect plugins to define AT LEAST
  1961. // {function} _setup (replaces previous constructor),
  1962. // {function} _destroy (replaces previous destroy)
  1963. var Plugin =
  1964. /*#__PURE__*/
  1965. function () {
  1966. function Plugin(element, options) {
  1967. _classCallCheck(this, Plugin);
  1968. this._setup(element, options);
  1969. var pluginName = getPluginName(this);
  1970. this.uuid = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, pluginName);
  1971. if (!this.$element.attr("data-".concat(pluginName))) {
  1972. this.$element.attr("data-".concat(pluginName), this.uuid);
  1973. }
  1974. if (!this.$element.data('zfPlugin')) {
  1975. this.$element.data('zfPlugin', this);
  1976. }
  1977. /**
  1978. * Fires when the plugin has initialized.
  1979. * @event Plugin#init
  1980. */
  1981. this.$element.trigger("init.zf.".concat(pluginName));
  1982. }
  1983. _createClass(Plugin, [{
  1984. key: "destroy",
  1985. value: function destroy() {
  1986. this._destroy();
  1987. var pluginName = getPluginName(this);
  1988. this.$element.removeAttr("data-".concat(pluginName)).removeData('zfPlugin')
  1989. /**
  1990. * Fires when the plugin has been destroyed.
  1991. * @event Plugin#destroyed
  1992. */
  1993. .trigger("destroyed.zf.".concat(pluginName));
  1994. for (var prop in this) {
  1995. this[prop] = null; //clean up script to prep for garbage collection.
  1996. }
  1997. }
  1998. }]);
  1999. return Plugin;
  2000. }(); // Convert PascalCase to kebab-case
  2001. // Thank you: http://stackoverflow.com/a/8955580
  2002. function hyphenate(str) {
  2003. return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
  2004. }
  2005. function getPluginName(obj) {
  2006. if (typeof obj.constructor.name !== 'undefined') {
  2007. return hyphenate(obj.constructor.name);
  2008. } else {
  2009. return hyphenate(obj.className);
  2010. }
  2011. }
  2012. /***/ }),
  2013. /***/ "./js/foundation.core.utils.js":
  2014. /*!*************************************!*\
  2015. !*** ./js/foundation.core.utils.js ***!
  2016. \*************************************/
  2017. /*! exports provided: rtl, GetYoDigits, RegExpEscape, transitionend, onLoad, ignoreMousedisappear */
  2018. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2019. "use strict";
  2020. __webpack_require__.r(__webpack_exports__);
  2021. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rtl", function() { return rtl; });
  2022. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GetYoDigits", function() { return GetYoDigits; });
  2023. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RegExpEscape", function() { return RegExpEscape; });
  2024. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transitionend", function() { return transitionend; });
  2025. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onLoad", function() { return onLoad; });
  2026. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ignoreMousedisappear", function() { return ignoreMousedisappear; });
  2027. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  2028. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  2029. // Core Foundation Utilities, utilized in a number of places.
  2030. /**
  2031. * Returns a boolean for RTL support
  2032. */
  2033. function rtl() {
  2034. return jquery__WEBPACK_IMPORTED_MODULE_0___default()('html').attr('dir') === 'rtl';
  2035. }
  2036. /**
  2037. * returns a random base-36 uid with namespacing
  2038. * @function
  2039. * @param {Number} length - number of random base-36 digits desired. Increase for more random strings.
  2040. * @param {String} namespace - name of plugin to be incorporated in uid, optional.
  2041. * @default {String} '' - if no plugin name is provided, nothing is appended to the uid.
  2042. * @returns {String} - unique id
  2043. */
  2044. function GetYoDigits(length, namespace) {
  2045. length = length || 6;
  2046. return Math.round(Math.pow(36, length + 1) - Math.random() * Math.pow(36, length)).toString(36).slice(1) + (namespace ? "-".concat(namespace) : '');
  2047. }
  2048. /**
  2049. * Escape a string so it can be used as a regexp pattern
  2050. * @function
  2051. * @see https://stackoverflow.com/a/9310752/4317384
  2052. *
  2053. * @param {String} str - string to escape.
  2054. * @returns {String} - escaped string
  2055. */
  2056. function RegExpEscape(str) {
  2057. return str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
  2058. }
  2059. function transitionend($elem) {
  2060. var transitions = {
  2061. 'transition': 'transitionend',
  2062. 'WebkitTransition': 'webkitTransitionEnd',
  2063. 'MozTransition': 'transitionend',
  2064. 'OTransition': 'otransitionend'
  2065. };
  2066. var elem = document.createElement('div'),
  2067. end;
  2068. for (var t in transitions) {
  2069. if (typeof elem.style[t] !== 'undefined') {
  2070. end = transitions[t];
  2071. }
  2072. }
  2073. if (end) {
  2074. return end;
  2075. } else {
  2076. end = setTimeout(function () {
  2077. $elem.triggerHandler('transitionend', [$elem]);
  2078. }, 1);
  2079. return 'transitionend';
  2080. }
  2081. }
  2082. /**
  2083. * Return an event type to listen for window load.
  2084. *
  2085. * If `$elem` is passed, an event will be triggered on `$elem`. If window is already loaded, the event will still be triggered.
  2086. * If `handler` is passed, attach it to the event on `$elem`.
  2087. * Calling `onLoad` without handler allows you to get the event type that will be triggered before attaching the handler by yourself.
  2088. * @function
  2089. *
  2090. * @param {Object} [] $elem - jQuery element on which the event will be triggered if passed.
  2091. * @param {Function} [] handler - function to attach to the event.
  2092. * @returns {String} - event type that should or will be triggered.
  2093. */
  2094. function onLoad($elem, handler) {
  2095. var didLoad = document.readyState === 'complete';
  2096. var eventType = (didLoad ? '_didLoad' : 'load') + '.zf.util.onLoad';
  2097. var cb = function cb() {
  2098. return $elem.triggerHandler(eventType);
  2099. };
  2100. if ($elem) {
  2101. if (handler) $elem.one(eventType, handler);
  2102. if (didLoad) setTimeout(cb);else jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).one('load', cb);
  2103. }
  2104. return eventType;
  2105. }
  2106. /**
  2107. * Retuns an handler for the `mouseleave` that ignore disappeared mouses.
  2108. *
  2109. * If the mouse "disappeared" from the document (like when going on a browser UI element, See https://git.io/zf-11410),
  2110. * the event is ignored.
  2111. * - If the `ignoreLeaveWindow` is `true`, the event is ignored when the user actually left the window
  2112. * (like by switching to an other window with [Alt]+[Tab]).
  2113. * - If the `ignoreReappear` is `true`, the event will be ignored when the mouse will reappear later on the document
  2114. * outside of the element it left.
  2115. *
  2116. * @function
  2117. *
  2118. * @param {Function} [] handler - handler for the filtered `mouseleave` event to watch.
  2119. * @param {Object} [] options - object of options:
  2120. * - {Boolean} [false] ignoreLeaveWindow - also ignore when the user switched windows.
  2121. * - {Boolean} [false] ignoreReappear - also ignore when the mouse reappeared outside of the element it left.
  2122. * @returns {Function} - filtered handler to use to listen on the `mouseleave` event.
  2123. */
  2124. function ignoreMousedisappear(handler) {
  2125. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  2126. _ref$ignoreLeaveWindo = _ref.ignoreLeaveWindow,
  2127. ignoreLeaveWindow = _ref$ignoreLeaveWindo === void 0 ? false : _ref$ignoreLeaveWindo,
  2128. _ref$ignoreReappear = _ref.ignoreReappear,
  2129. ignoreReappear = _ref$ignoreReappear === void 0 ? false : _ref$ignoreReappear;
  2130. return function leaveEventHandler(eLeave) {
  2131. for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  2132. rest[_key - 1] = arguments[_key];
  2133. }
  2134. var callback = handler.bind.apply(handler, [this, eLeave].concat(rest)); // The mouse left: call the given callback if the mouse entered elsewhere
  2135. if (eLeave.relatedTarget !== null) {
  2136. return callback();
  2137. } // Otherwise, check if the mouse actually left the window.
  2138. // In firefox if the user switched between windows, the window sill have the focus by the time
  2139. // the event is triggered. We have to debounce the event to test this case.
  2140. setTimeout(function leaveEventDebouncer() {
  2141. if (!ignoreLeaveWindow && document.hasFocus && !document.hasFocus()) {
  2142. return callback();
  2143. } // Otherwise, wait for the mouse to reeapear outside of the element,
  2144. if (!ignoreReappear) {
  2145. jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).one('mouseenter', function reenterEventHandler(eReenter) {
  2146. if (!jquery__WEBPACK_IMPORTED_MODULE_0___default()(eLeave.currentTarget).has(eReenter.target).length) {
  2147. // Fill where the mouse finally entered.
  2148. eLeave.relatedTarget = eReenter.target;
  2149. callback();
  2150. }
  2151. });
  2152. }
  2153. }, 0);
  2154. };
  2155. }
  2156. /***/ }),
  2157. /***/ "./js/foundation.drilldown.js":
  2158. /*!************************************!*\
  2159. !*** ./js/foundation.drilldown.js ***!
  2160. \************************************/
  2161. /*! exports provided: Drilldown */
  2162. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2163. "use strict";
  2164. __webpack_require__.r(__webpack_exports__);
  2165. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Drilldown", function() { return Drilldown; });
  2166. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  2167. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  2168. /* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js");
  2169. /* harmony import */ var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.nest */ "./js/foundation.util.nest.js");
  2170. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  2171. /* harmony import */ var _foundation_util_box__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.box */ "./js/foundation.util.box.js");
  2172. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  2173. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  2174. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2175. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  2176. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  2177. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  2178. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  2179. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  2180. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  2181. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  2182. /**
  2183. * Drilldown module.
  2184. * @module foundation.drilldown
  2185. * @requires foundation.util.keyboard
  2186. * @requires foundation.util.nest
  2187. * @requires foundation.util.box
  2188. */
  2189. var Drilldown =
  2190. /*#__PURE__*/
  2191. function (_Plugin) {
  2192. _inherits(Drilldown, _Plugin);
  2193. function Drilldown() {
  2194. _classCallCheck(this, Drilldown);
  2195. return _possibleConstructorReturn(this, _getPrototypeOf(Drilldown).apply(this, arguments));
  2196. }
  2197. _createClass(Drilldown, [{
  2198. key: "_setup",
  2199. /**
  2200. * Creates a new instance of a drilldown menu.
  2201. * @class
  2202. * @name Drilldown
  2203. * @param {jQuery} element - jQuery object to make into an accordion menu.
  2204. * @param {Object} options - Overrides to the default plugin settings.
  2205. */
  2206. value: function _setup(element, options) {
  2207. this.$element = element;
  2208. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Drilldown.defaults, this.$element.data(), options);
  2209. this.className = 'Drilldown'; // ie9 back compat
  2210. this._init();
  2211. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('Drilldown', {
  2212. 'ENTER': 'open',
  2213. 'SPACE': 'open',
  2214. 'ARROW_RIGHT': 'next',
  2215. 'ARROW_UP': 'up',
  2216. 'ARROW_DOWN': 'down',
  2217. 'ARROW_LEFT': 'previous',
  2218. 'ESCAPE': 'close',
  2219. 'TAB': 'down',
  2220. 'SHIFT_TAB': 'up'
  2221. });
  2222. }
  2223. /**
  2224. * Initializes the drilldown by creating jQuery collections of elements
  2225. * @private
  2226. */
  2227. }, {
  2228. key: "_init",
  2229. value: function _init() {
  2230. _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__["Nest"].Feather(this.$element, 'drilldown');
  2231. if (this.options.autoApplyClass) {
  2232. this.$element.addClass('drilldown');
  2233. }
  2234. this.$element.attr({
  2235. 'role': 'tree',
  2236. 'aria-multiselectable': false
  2237. });
  2238. this.$submenuAnchors = this.$element.find('li.is-drilldown-submenu-parent').children('a');
  2239. this.$submenus = this.$submenuAnchors.parent('li').children('[data-submenu]').attr('role', 'group');
  2240. this.$menuItems = this.$element.find('li').not('.js-drilldown-back').attr('role', 'treeitem').find('a'); // Set the main menu as current by default (unless a submenu is selected)
  2241. // Used to set the wrapper height when the drilldown is closed/reopened from any (sub)menu
  2242. this.$currentMenu = this.$element;
  2243. this.$element.attr('data-mutate', this.$element.attr('data-drilldown') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'drilldown'));
  2244. this._prepareMenu();
  2245. this._registerEvents();
  2246. this._keyboardEvents();
  2247. }
  2248. /**
  2249. * prepares drilldown menu by setting attributes to links and elements
  2250. * sets a min height to prevent content jumping
  2251. * wraps the element if not already wrapped
  2252. * @private
  2253. * @function
  2254. */
  2255. }, {
  2256. key: "_prepareMenu",
  2257. value: function _prepareMenu() {
  2258. var _this = this; // if(!this.options.holdOpen){
  2259. // this._menuLinkEvents();
  2260. // }
  2261. this.$submenuAnchors.each(function () {
  2262. var $link = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this);
  2263. var $sub = $link.parent();
  2264. if (_this.options.parentLink) {
  2265. $link.clone().prependTo($sub.children('[data-submenu]')).wrap('<li data-is-parent-link class="is-submenu-parent-item is-submenu-item is-drilldown-submenu-item" role="menuitem"></li>');
  2266. }
  2267. $link.data('savedHref', $link.attr('href')).removeAttr('href').attr('tabindex', 0);
  2268. $link.children('[data-submenu]').attr({
  2269. 'aria-hidden': true,
  2270. 'tabindex': 0,
  2271. 'role': 'group'
  2272. });
  2273. _this._events($link);
  2274. });
  2275. this.$submenus.each(function () {
  2276. var $menu = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  2277. $back = $menu.find('.js-drilldown-back');
  2278. if (!$back.length) {
  2279. switch (_this.options.backButtonPosition) {
  2280. case "bottom":
  2281. $menu.append(_this.options.backButton);
  2282. break;
  2283. case "top":
  2284. $menu.prepend(_this.options.backButton);
  2285. break;
  2286. default:
  2287. console.error("Unsupported backButtonPosition value '" + _this.options.backButtonPosition + "'");
  2288. }
  2289. }
  2290. _this._back($menu);
  2291. });
  2292. this.$submenus.addClass('invisible');
  2293. if (!this.options.autoHeight) {
  2294. this.$submenus.addClass('drilldown-submenu-cover-previous');
  2295. } // create a wrapper on element if it doesn't exist.
  2296. if (!this.$element.parent().hasClass('is-drilldown')) {
  2297. this.$wrapper = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.options.wrapper).addClass('is-drilldown');
  2298. if (this.options.animateHeight) this.$wrapper.addClass('animate-height');
  2299. this.$element.wrap(this.$wrapper);
  2300. } // set wrapper
  2301. this.$wrapper = this.$element.parent();
  2302. this.$wrapper.css(this._getMaxDims());
  2303. }
  2304. }, {
  2305. key: "_resize",
  2306. value: function _resize() {
  2307. this.$wrapper.css({
  2308. 'max-width': 'none',
  2309. 'min-height': 'none'
  2310. }); // _getMaxDims has side effects (boo) but calling it should update all other necessary heights & widths
  2311. this.$wrapper.css(this._getMaxDims());
  2312. }
  2313. /**
  2314. * Adds event handlers to elements in the menu.
  2315. * @function
  2316. * @private
  2317. * @param {jQuery} $elem - the current menu item to add handlers to.
  2318. */
  2319. }, {
  2320. key: "_events",
  2321. value: function _events($elem) {
  2322. var _this = this;
  2323. $elem.off('click.zf.drilldown').on('click.zf.drilldown', function (e) {
  2324. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).parentsUntil('ul', 'li').hasClass('is-drilldown-submenu-parent')) {
  2325. e.stopImmediatePropagation();
  2326. e.preventDefault();
  2327. } // if(e.target !== e.currentTarget.firstElementChild){
  2328. // return false;
  2329. // }
  2330. _this._show($elem.parent('li'));
  2331. if (_this.options.closeOnClick) {
  2332. var $body = jquery__WEBPACK_IMPORTED_MODULE_0___default()('body');
  2333. $body.off('.zf.drilldown').on('click.zf.drilldown', function (e) {
  2334. if (e.target === _this.$element[0] || jquery__WEBPACK_IMPORTED_MODULE_0___default.a.contains(_this.$element[0], e.target)) {
  2335. return;
  2336. }
  2337. e.preventDefault();
  2338. _this._hideAll();
  2339. $body.off('.zf.drilldown');
  2340. });
  2341. }
  2342. });
  2343. }
  2344. /**
  2345. * Adds event handlers to the menu element.
  2346. * @function
  2347. * @private
  2348. */
  2349. }, {
  2350. key: "_registerEvents",
  2351. value: function _registerEvents() {
  2352. if (this.options.scrollTop) {
  2353. this._bindHandler = this._scrollTop.bind(this);
  2354. this.$element.on('open.zf.drilldown hide.zf.drilldown closed.zf.drilldown', this._bindHandler);
  2355. }
  2356. this.$element.on('mutateme.zf.trigger', this._resize.bind(this));
  2357. }
  2358. /**
  2359. * Scroll to Top of Element or data-scroll-top-element
  2360. * @function
  2361. * @fires Drilldown#scrollme
  2362. */
  2363. }, {
  2364. key: "_scrollTop",
  2365. value: function _scrollTop() {
  2366. var _this = this;
  2367. var $scrollTopElement = _this.options.scrollTopElement != '' ? jquery__WEBPACK_IMPORTED_MODULE_0___default()(_this.options.scrollTopElement) : _this.$element,
  2368. scrollPos = parseInt($scrollTopElement.offset().top + _this.options.scrollTopOffset, 10);
  2369. jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').stop(true).animate({
  2370. scrollTop: scrollPos
  2371. }, _this.options.animationDuration, _this.options.animationEasing, function () {
  2372. /**
  2373. * Fires after the menu has scrolled
  2374. * @event Drilldown#scrollme
  2375. */
  2376. if (this === jquery__WEBPACK_IMPORTED_MODULE_0___default()('html')[0]) _this.$element.trigger('scrollme.zf.drilldown');
  2377. });
  2378. }
  2379. /**
  2380. * Adds keydown event listener to `li`'s in the menu.
  2381. * @private
  2382. */
  2383. }, {
  2384. key: "_keyboardEvents",
  2385. value: function _keyboardEvents() {
  2386. var _this = this;
  2387. this.$menuItems.add(this.$element.find('.js-drilldown-back > a, .is-submenu-parent-item > a')).on('keydown.zf.drilldown', function (e) {
  2388. var $element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  2389. $elements = $element.parent('li').parent('ul').children('li').children('a'),
  2390. $prevElement,
  2391. $nextElement;
  2392. $elements.each(function (i) {
  2393. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is($element)) {
  2394. $prevElement = $elements.eq(Math.max(0, i - 1));
  2395. $nextElement = $elements.eq(Math.min(i + 1, $elements.length - 1));
  2396. return;
  2397. }
  2398. });
  2399. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'Drilldown', {
  2400. next: function next() {
  2401. if ($element.is(_this.$submenuAnchors)) {
  2402. _this._show($element.parent('li'));
  2403. $element.parent('li').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($element), function () {
  2404. $element.parent('li').find('ul li a').not('.js-drilldown-back a').first().focus();
  2405. });
  2406. return true;
  2407. }
  2408. },
  2409. previous: function previous() {
  2410. _this._hide($element.parent('li').parent('ul'));
  2411. $element.parent('li').parent('ul').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($element), function () {
  2412. setTimeout(function () {
  2413. $element.parent('li').parent('ul').parent('li').children('a').first().focus();
  2414. }, 1);
  2415. });
  2416. return true;
  2417. },
  2418. up: function up() {
  2419. $prevElement.focus(); // Don't tap focus on first element in root ul
  2420. return !$element.is(_this.$element.find('> li:first-child > a'));
  2421. },
  2422. down: function down() {
  2423. $nextElement.focus(); // Don't tap focus on last element in root ul
  2424. return !$element.is(_this.$element.find('> li:last-child > a'));
  2425. },
  2426. close: function close() {
  2427. // Don't close on element in root ul
  2428. if (!$element.is(_this.$element.find('> li > a'))) {
  2429. _this._hide($element.parent().parent());
  2430. $element.parent().parent().siblings('a').focus();
  2431. }
  2432. },
  2433. open: function open() {
  2434. if (_this.options.parentLink && $element.attr('href')) {
  2435. // Link with href
  2436. return false;
  2437. } else if (!$element.is(_this.$menuItems)) {
  2438. // not menu item means back button
  2439. _this._hide($element.parent('li').parent('ul'));
  2440. $element.parent('li').parent('ul').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($element), function () {
  2441. setTimeout(function () {
  2442. $element.parent('li').parent('ul').parent('li').children('a').first().focus();
  2443. }, 1);
  2444. });
  2445. return true;
  2446. } else if ($element.is(_this.$submenuAnchors)) {
  2447. // Sub menu item
  2448. _this._show($element.parent('li'));
  2449. $element.parent('li').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($element), function () {
  2450. $element.parent('li').find('ul li a').not('.js-drilldown-back a').first().focus();
  2451. });
  2452. return true;
  2453. }
  2454. },
  2455. handled: function handled(preventDefault) {
  2456. if (preventDefault) {
  2457. e.preventDefault();
  2458. }
  2459. e.stopImmediatePropagation();
  2460. }
  2461. });
  2462. }); // end keyboardAccess
  2463. }
  2464. /**
  2465. * Closes all open elements, and returns to root menu.
  2466. * @function
  2467. * @fires Drilldown#closed
  2468. */
  2469. }, {
  2470. key: "_hideAll",
  2471. value: function _hideAll() {
  2472. var $elem = this.$element.find('.is-drilldown-submenu.is-active').addClass('is-closing');
  2473. if (this.options.autoHeight) this.$wrapper.css({
  2474. height: $elem.parent().closest('ul').data('calcHeight')
  2475. });
  2476. $elem.one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($elem), function (e) {
  2477. $elem.removeClass('is-active is-closing');
  2478. });
  2479. /**
  2480. * Fires when the menu is fully closed.
  2481. * @event Drilldown#closed
  2482. */
  2483. this.$element.trigger('closed.zf.drilldown');
  2484. }
  2485. /**
  2486. * Adds event listener for each `back` button, and closes open menus.
  2487. * @function
  2488. * @fires Drilldown#back
  2489. * @param {jQuery} $elem - the current sub-menu to add `back` event.
  2490. */
  2491. }, {
  2492. key: "_back",
  2493. value: function _back($elem) {
  2494. var _this = this;
  2495. $elem.off('click.zf.drilldown');
  2496. $elem.children('.js-drilldown-back').on('click.zf.drilldown', function (e) {
  2497. e.stopImmediatePropagation(); // console.log('mouseup on back');
  2498. _this._hide($elem); // If there is a parent submenu, call show
  2499. var parentSubMenu = $elem.parent('li').parent('ul').parent('li');
  2500. if (parentSubMenu.length) {
  2501. _this._show(parentSubMenu);
  2502. }
  2503. });
  2504. }
  2505. /**
  2506. * Adds event listener to menu items w/o submenus to close open menus on click.
  2507. * @function
  2508. * @private
  2509. */
  2510. }, {
  2511. key: "_menuLinkEvents",
  2512. value: function _menuLinkEvents() {
  2513. var _this = this;
  2514. this.$menuItems.not('.is-drilldown-submenu-parent').off('click.zf.drilldown').on('click.zf.drilldown', function (e) {
  2515. // e.stopImmediatePropagation();
  2516. setTimeout(function () {
  2517. _this._hideAll();
  2518. }, 0);
  2519. });
  2520. }
  2521. /**
  2522. * Sets the CSS classes for submenu to show it.
  2523. * @function
  2524. * @private
  2525. * @param {jQuery} $elem - the target submenu (`ul` tag)
  2526. * @param {boolean} trigger - trigger drilldown event
  2527. */
  2528. }, {
  2529. key: "_setShowSubMenuClasses",
  2530. value: function _setShowSubMenuClasses($elem, trigger) {
  2531. $elem.addClass('is-active').removeClass('invisible').attr('aria-hidden', false);
  2532. $elem.parent('li').attr('aria-expanded', true);
  2533. if (trigger === true) {
  2534. this.$element.trigger('open.zf.drilldown', [$elem]);
  2535. }
  2536. }
  2537. /**
  2538. * Sets the CSS classes for submenu to hide it.
  2539. * @function
  2540. * @private
  2541. * @param {jQuery} $elem - the target submenu (`ul` tag)
  2542. * @param {boolean} trigger - trigger drilldown event
  2543. */
  2544. }, {
  2545. key: "_setHideSubMenuClasses",
  2546. value: function _setHideSubMenuClasses($elem, trigger) {
  2547. $elem.removeClass('is-active').addClass('invisible').attr('aria-hidden', true);
  2548. $elem.parent('li').attr('aria-expanded', false);
  2549. if (trigger === true) {
  2550. $elem.trigger('hide.zf.drilldown', [$elem]);
  2551. }
  2552. }
  2553. /**
  2554. * Opens a specific drilldown (sub)menu no matter which (sub)menu in it is currently visible.
  2555. * Compared to _show() this lets you jump into any submenu without clicking through every submenu on the way to it.
  2556. * @function
  2557. * @fires Drilldown#open
  2558. * @param {jQuery} $elem - the target (sub)menu (`ul` tag)
  2559. * @param {boolean} autoFocus - if true the first link in the target (sub)menu gets auto focused
  2560. */
  2561. }, {
  2562. key: "_showMenu",
  2563. value: function _showMenu($elem, autoFocus) {
  2564. var _this = this; // Reset drilldown
  2565. var $expandedSubmenus = this.$element.find('li[aria-expanded="true"] > ul[data-submenu]');
  2566. $expandedSubmenus.each(function (index) {
  2567. _this._setHideSubMenuClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this));
  2568. }); // Save the menu as the currently displayed one.
  2569. this.$currentMenu = $elem; // If target menu is root, focus first link & exit
  2570. if ($elem.is('[data-drilldown]')) {
  2571. if (autoFocus === true) $elem.find('li[role="treeitem"] > a').first().focus();
  2572. if (this.options.autoHeight) this.$wrapper.css('height', $elem.data('calcHeight'));
  2573. return;
  2574. } // Find all submenus on way to root incl. the element itself
  2575. var $submenus = $elem.children().first().parentsUntil('[data-drilldown]', '[data-submenu]'); // Open target menu and all submenus on its way to root
  2576. $submenus.each(function (index) {
  2577. // Update height of first child (target menu) if autoHeight option true
  2578. if (index === 0 && _this.options.autoHeight) {
  2579. _this.$wrapper.css('height', jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('calcHeight'));
  2580. }
  2581. var isLastChild = index == $submenus.length - 1; // Add transitionsend listener to last child (root due to reverse order) to open target menu's first link
  2582. // Last child makes sure the event gets always triggered even if going through several menus
  2583. if (isLastChild === true) {
  2584. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)), function () {
  2585. if (autoFocus === true) {
  2586. $elem.find('li[role="treeitem"] > a').first().focus();
  2587. }
  2588. });
  2589. }
  2590. _this._setShowSubMenuClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), isLastChild);
  2591. });
  2592. }
  2593. /**
  2594. * Opens a submenu.
  2595. * @function
  2596. * @fires Drilldown#open
  2597. * @param {jQuery} $elem - the current element with a submenu to open, i.e. the `li` tag.
  2598. */
  2599. }, {
  2600. key: "_show",
  2601. value: function _show($elem) {
  2602. var $submenu = $elem.children('[data-submenu]');
  2603. $elem.attr('aria-expanded', true);
  2604. this.$currentMenu = $submenu;
  2605. $submenu.addClass('is-active').removeClass('invisible').attr('aria-hidden', false);
  2606. if (this.options.autoHeight) {
  2607. this.$wrapper.css({
  2608. height: $submenu.data('calcHeight')
  2609. });
  2610. }
  2611. /**
  2612. * Fires when the submenu has opened.
  2613. * @event Drilldown#open
  2614. */
  2615. this.$element.trigger('open.zf.drilldown', [$elem]);
  2616. }
  2617. /**
  2618. * Hides a submenu
  2619. * @function
  2620. * @fires Drilldown#hide
  2621. * @param {jQuery} $elem - the current sub-menu to hide, i.e. the `ul` tag.
  2622. */
  2623. }, {
  2624. key: "_hide",
  2625. value: function _hide($elem) {
  2626. if (this.options.autoHeight) this.$wrapper.css({
  2627. height: $elem.parent().closest('ul').data('calcHeight')
  2628. });
  2629. var _this = this;
  2630. $elem.parent('li').attr('aria-expanded', false);
  2631. $elem.attr('aria-hidden', true);
  2632. $elem.addClass('is-closing').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($elem), function () {
  2633. $elem.removeClass('is-active is-closing');
  2634. $elem.blur().addClass('invisible');
  2635. });
  2636. /**
  2637. * Fires when the submenu has closed.
  2638. * @event Drilldown#hide
  2639. */
  2640. $elem.trigger('hide.zf.drilldown', [$elem]);
  2641. }
  2642. /**
  2643. * Iterates through the nested menus to calculate the min-height, and max-width for the menu.
  2644. * Prevents content jumping.
  2645. * @function
  2646. * @private
  2647. */
  2648. }, {
  2649. key: "_getMaxDims",
  2650. value: function _getMaxDims() {
  2651. var maxHeight = 0,
  2652. result = {},
  2653. _this = this; // Recalculate menu heights and total max height
  2654. this.$submenus.add(this.$element).each(function () {
  2655. var numOfElems = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('li').length;
  2656. var height = _foundation_util_box__WEBPACK_IMPORTED_MODULE_4__["Box"].GetDimensions(this).height;
  2657. maxHeight = height > maxHeight ? height : maxHeight;
  2658. if (_this.options.autoHeight) {
  2659. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('calcHeight', height);
  2660. }
  2661. });
  2662. if (this.options.autoHeight) result['height'] = this.$currentMenu.data('calcHeight');else result['min-height'] = "".concat(maxHeight, "px");
  2663. result['max-width'] = "".concat(this.$element[0].getBoundingClientRect().width, "px");
  2664. return result;
  2665. }
  2666. /**
  2667. * Destroys the Drilldown Menu
  2668. * @function
  2669. */
  2670. }, {
  2671. key: "_destroy",
  2672. value: function _destroy() {
  2673. if (this.options.scrollTop) this.$element.off('.zf.drilldown', this._bindHandler);
  2674. this._hideAll();
  2675. this.$element.off('mutateme.zf.trigger');
  2676. _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__["Nest"].Burn(this.$element, 'drilldown');
  2677. this.$element.unwrap().find('.js-drilldown-back, .is-submenu-parent-item').remove().end().find('.is-active, .is-closing, .is-drilldown-submenu').removeClass('is-active is-closing is-drilldown-submenu').end().find('[data-submenu]').removeAttr('aria-hidden tabindex role');
  2678. this.$submenuAnchors.each(function () {
  2679. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).off('.zf.drilldown');
  2680. });
  2681. this.$element.find('[data-is-parent-link]').detach();
  2682. this.$submenus.removeClass('drilldown-submenu-cover-previous invisible');
  2683. this.$element.find('a').each(function () {
  2684. var $link = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this);
  2685. $link.removeAttr('tabindex');
  2686. if ($link.data('savedHref')) {
  2687. $link.attr('href', $link.data('savedHref')).removeData('savedHref');
  2688. } else {
  2689. return;
  2690. }
  2691. });
  2692. }
  2693. }]);
  2694. return Drilldown;
  2695. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_5__["Plugin"]);
  2696. Drilldown.defaults = {
  2697. /**
  2698. * Drilldowns depend on styles in order to function properly; in the default build of Foundation these are
  2699. * on the `drilldown` class. This option auto-applies this class to the drilldown upon initialization.
  2700. * @option
  2701. * @type {boolian}
  2702. * @default true
  2703. */
  2704. autoApplyClass: true,
  2705. /**
  2706. * Markup used for JS generated back button. Prepended or appended (see backButtonPosition) to submenu lists and deleted on `destroy` method, 'js-drilldown-back' class required. Remove the backslash (`\`) if copy and pasting.
  2707. * @option
  2708. * @type {string}
  2709. * @default '<li class="js-drilldown-back"><a tabindex="0">Back</a></li>'
  2710. */
  2711. backButton: '<li class="js-drilldown-back"><a tabindex="0">Back</a></li>',
  2712. /**
  2713. * Position the back button either at the top or bottom of drilldown submenus. Can be `'left'` or `'bottom'`.
  2714. * @option
  2715. * @type {string}
  2716. * @default top
  2717. */
  2718. backButtonPosition: 'top',
  2719. /**
  2720. * Markup used to wrap drilldown menu. Use a class name for independent styling; the JS applied class: `is-drilldown` is required. Remove the backslash (`\`) if copy and pasting.
  2721. * @option
  2722. * @type {string}
  2723. * @default '<div></div>'
  2724. */
  2725. wrapper: '<div></div>',
  2726. /**
  2727. * Adds the parent link to the submenu.
  2728. * @option
  2729. * @type {boolean}
  2730. * @default false
  2731. */
  2732. parentLink: false,
  2733. /**
  2734. * Allow the menu to return to root list on body click.
  2735. * @option
  2736. * @type {boolean}
  2737. * @default false
  2738. */
  2739. closeOnClick: false,
  2740. /**
  2741. * Allow the menu to auto adjust height.
  2742. * @option
  2743. * @type {boolean}
  2744. * @default false
  2745. */
  2746. autoHeight: false,
  2747. /**
  2748. * Animate the auto adjust height.
  2749. * @option
  2750. * @type {boolean}
  2751. * @default false
  2752. */
  2753. animateHeight: false,
  2754. /**
  2755. * Scroll to the top of the menu after opening a submenu or navigating back using the menu back button
  2756. * @option
  2757. * @type {boolean}
  2758. * @default false
  2759. */
  2760. scrollTop: false,
  2761. /**
  2762. * String jquery selector (for example 'body') of element to take offset().top from, if empty string the drilldown menu offset().top is taken
  2763. * @option
  2764. * @type {string}
  2765. * @default ''
  2766. */
  2767. scrollTopElement: '',
  2768. /**
  2769. * ScrollTop offset
  2770. * @option
  2771. * @type {number}
  2772. * @default 0
  2773. */
  2774. scrollTopOffset: 0,
  2775. /**
  2776. * Scroll animation duration
  2777. * @option
  2778. * @type {number}
  2779. * @default 500
  2780. */
  2781. animationDuration: 500,
  2782. /**
  2783. * Scroll animation easing. Can be `'swing'` or `'linear'`.
  2784. * @option
  2785. * @type {string}
  2786. * @see {@link https://api.jquery.com/animate|JQuery animate}
  2787. * @default 'swing'
  2788. */
  2789. animationEasing: 'swing' // holdOpen: false
  2790. };
  2791. /***/ }),
  2792. /***/ "./js/foundation.dropdown.js":
  2793. /*!***********************************!*\
  2794. !*** ./js/foundation.dropdown.js ***!
  2795. \***********************************/
  2796. /*! exports provided: Dropdown */
  2797. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2798. "use strict";
  2799. __webpack_require__.r(__webpack_exports__);
  2800. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Dropdown", function() { return Dropdown; });
  2801. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  2802. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  2803. /* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js");
  2804. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  2805. /* harmony import */ var _foundation_positionable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.positionable */ "./js/foundation.positionable.js");
  2806. /* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js");
  2807. /* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.util.touch */ "./js/foundation.util.touch.js");
  2808. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  2809. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2810. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  2811. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  2812. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  2813. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  2814. function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
  2815. function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
  2816. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  2817. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  2818. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  2819. /**
  2820. * Dropdown module.
  2821. * @module foundation.dropdown
  2822. * @requires foundation.util.keyboard
  2823. * @requires foundation.util.box
  2824. * @requires foundation.util.triggers
  2825. */
  2826. var Dropdown =
  2827. /*#__PURE__*/
  2828. function (_Positionable) {
  2829. _inherits(Dropdown, _Positionable);
  2830. function Dropdown() {
  2831. _classCallCheck(this, Dropdown);
  2832. return _possibleConstructorReturn(this, _getPrototypeOf(Dropdown).apply(this, arguments));
  2833. }
  2834. _createClass(Dropdown, [{
  2835. key: "_setup",
  2836. /**
  2837. * Creates a new instance of a dropdown.
  2838. * @class
  2839. * @name Dropdown
  2840. * @param {jQuery} element - jQuery object to make into a dropdown.
  2841. * Object should be of the dropdown panel, rather than its anchor.
  2842. * @param {Object} options - Overrides to the default plugin settings.
  2843. */
  2844. value: function _setup(element, options) {
  2845. this.$element = element;
  2846. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Dropdown.defaults, this.$element.data(), options);
  2847. this.className = 'Dropdown'; // ie9 back compat
  2848. // Triggers init is idempotent, just need to make sure it is initialized
  2849. _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
  2850. this._init();
  2851. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('Dropdown', {
  2852. 'ENTER': 'toggle',
  2853. 'SPACE': 'toggle',
  2854. 'ESCAPE': 'close'
  2855. });
  2856. }
  2857. /**
  2858. * Initializes the plugin by setting/checking options and attributes, adding helper variables, and saving the anchor.
  2859. * @function
  2860. * @private
  2861. */
  2862. }, {
  2863. key: "_init",
  2864. value: function _init() {
  2865. var $id = this.$element.attr('id');
  2866. this.$anchors = jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-toggle=\"".concat($id, "\"]")).length ? jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-toggle=\"".concat($id, "\"]")) : jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-open=\"".concat($id, "\"]"));
  2867. this.$anchors.attr({
  2868. 'aria-controls': $id,
  2869. 'data-is-focus': false,
  2870. 'data-yeti-box': $id,
  2871. 'aria-haspopup': true,
  2872. 'aria-expanded': false
  2873. });
  2874. this._setCurrentAnchor(this.$anchors.first());
  2875. if (this.options.parentClass) {
  2876. this.$parent = this.$element.parents('.' + this.options.parentClass);
  2877. } else {
  2878. this.$parent = null;
  2879. } // Set [aria-labelledby] on the Dropdown if it is not set
  2880. if (typeof this.$element.attr('aria-labelledby') === 'undefined') {
  2881. // Get the anchor ID or create one
  2882. if (typeof this.$currentAnchor.attr('id') === 'undefined') {
  2883. this.$currentAnchor.attr('id', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'dd-anchor'));
  2884. }
  2885. ;
  2886. this.$element.attr('aria-labelledby', this.$currentAnchor.attr('id'));
  2887. }
  2888. this.$element.attr({
  2889. 'aria-hidden': 'true',
  2890. 'data-yeti-box': $id,
  2891. 'data-resize': $id
  2892. });
  2893. _get(_getPrototypeOf(Dropdown.prototype), "_init", this).call(this);
  2894. this._events();
  2895. }
  2896. }, {
  2897. key: "_getDefaultPosition",
  2898. value: function _getDefaultPosition() {
  2899. // handle legacy classnames
  2900. var position = this.$element[0].className.match(/(top|left|right|bottom)/g);
  2901. if (position) {
  2902. return position[0];
  2903. } else {
  2904. return 'bottom';
  2905. }
  2906. }
  2907. }, {
  2908. key: "_getDefaultAlignment",
  2909. value: function _getDefaultAlignment() {
  2910. // handle legacy float approach
  2911. var horizontalPosition = /float-(\S+)/.exec(this.$currentAnchor.attr('class'));
  2912. if (horizontalPosition) {
  2913. return horizontalPosition[1];
  2914. }
  2915. return _get(_getPrototypeOf(Dropdown.prototype), "_getDefaultAlignment", this).call(this);
  2916. }
  2917. /**
  2918. * Sets the position and orientation of the dropdown pane, checks for collisions if allow-overlap is not true.
  2919. * Recursively calls itself if a collision is detected, with a new position class.
  2920. * @function
  2921. * @private
  2922. */
  2923. }, {
  2924. key: "_setPosition",
  2925. value: function _setPosition() {
  2926. this.$element.removeClass("has-position-".concat(this.position, " has-alignment-").concat(this.alignment));
  2927. _get(_getPrototypeOf(Dropdown.prototype), "_setPosition", this).call(this, this.$currentAnchor, this.$element, this.$parent);
  2928. this.$element.addClass("has-position-".concat(this.position, " has-alignment-").concat(this.alignment));
  2929. }
  2930. /**
  2931. * Make it a current anchor.
  2932. * Current anchor as the reference for the position of Dropdown panes.
  2933. * @param {HTML} el - DOM element of the anchor.
  2934. * @function
  2935. * @private
  2936. */
  2937. }, {
  2938. key: "_setCurrentAnchor",
  2939. value: function _setCurrentAnchor(el) {
  2940. this.$currentAnchor = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el);
  2941. }
  2942. /**
  2943. * Adds event listeners to the element utilizing the triggers utility library.
  2944. * @function
  2945. * @private
  2946. */
  2947. }, {
  2948. key: "_events",
  2949. value: function _events() {
  2950. var _this = this;
  2951. this.$element.on({
  2952. 'open.zf.trigger': this.open.bind(this),
  2953. 'close.zf.trigger': this.close.bind(this),
  2954. 'toggle.zf.trigger': this.toggle.bind(this),
  2955. 'resizeme.zf.trigger': this._setPosition.bind(this)
  2956. });
  2957. this.$anchors.off('click.zf.trigger').on('click.zf.trigger', function () {
  2958. _this._setCurrentAnchor(this);
  2959. });
  2960. if (this.options.hover) {
  2961. this.$anchors.off('mouseenter.zf.dropdown mouseleave.zf.dropdown').on('mouseenter.zf.dropdown', function () {
  2962. _this._setCurrentAnchor(this);
  2963. var bodyData = jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').data();
  2964. if (typeof bodyData.whatinput === 'undefined' || bodyData.whatinput === 'mouse') {
  2965. clearTimeout(_this.timeout);
  2966. _this.timeout = setTimeout(function () {
  2967. _this.open();
  2968. _this.$anchors.data('hover', true);
  2969. }, _this.options.hoverDelay);
  2970. }
  2971. }).on('mouseleave.zf.dropdown', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["ignoreMousedisappear"])(function () {
  2972. clearTimeout(_this.timeout);
  2973. _this.timeout = setTimeout(function () {
  2974. _this.close();
  2975. _this.$anchors.data('hover', false);
  2976. }, _this.options.hoverDelay);
  2977. }));
  2978. if (this.options.hoverPane) {
  2979. this.$element.off('mouseenter.zf.dropdown mouseleave.zf.dropdown').on('mouseenter.zf.dropdown', function () {
  2980. clearTimeout(_this.timeout);
  2981. }).on('mouseleave.zf.dropdown', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["ignoreMousedisappear"])(function () {
  2982. clearTimeout(_this.timeout);
  2983. _this.timeout = setTimeout(function () {
  2984. _this.close();
  2985. _this.$anchors.data('hover', false);
  2986. }, _this.options.hoverDelay);
  2987. }));
  2988. }
  2989. }
  2990. this.$anchors.add(this.$element).on('keydown.zf.dropdown', function (e) {
  2991. var $target = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  2992. visibleFocusableElements = _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].findFocusable(_this.$element);
  2993. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'Dropdown', {
  2994. open: function open() {
  2995. if ($target.is(_this.$anchors) && !$target.is('input, textarea')) {
  2996. _this.open();
  2997. _this.$element.attr('tabindex', -1).focus();
  2998. e.preventDefault();
  2999. }
  3000. },
  3001. close: function close() {
  3002. _this.close();
  3003. _this.$anchors.focus();
  3004. }
  3005. });
  3006. });
  3007. }
  3008. /**
  3009. * Adds an event handler to the body to close any dropdowns on a click.
  3010. * @function
  3011. * @private
  3012. */
  3013. }, {
  3014. key: "_addBodyHandler",
  3015. value: function _addBodyHandler() {
  3016. var $body = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body).not(this.$element),
  3017. _this = this;
  3018. $body.off('click.zf.dropdown').on('click.zf.dropdown', function (e) {
  3019. if (_this.$anchors.is(e.target) || _this.$anchors.find(e.target).length) {
  3020. return;
  3021. }
  3022. if (_this.$element.is(e.target) || _this.$element.find(e.target).length) {
  3023. return;
  3024. }
  3025. _this.close();
  3026. $body.off('click.zf.dropdown');
  3027. });
  3028. }
  3029. /**
  3030. * Opens the dropdown pane, and fires a bubbling event to close other dropdowns.
  3031. * @function
  3032. * @fires Dropdown#closeme
  3033. * @fires Dropdown#show
  3034. */
  3035. }, {
  3036. key: "open",
  3037. value: function open() {
  3038. // var _this = this;
  3039. /**
  3040. * Fires to close other open dropdowns, typically when dropdown is opening
  3041. * @event Dropdown#closeme
  3042. */
  3043. this.$element.trigger('closeme.zf.dropdown', this.$element.attr('id'));
  3044. this.$anchors.addClass('hover').attr({
  3045. 'aria-expanded': true
  3046. }); // this.$element/*.show()*/;
  3047. this.$element.addClass('is-opening');
  3048. this._setPosition();
  3049. this.$element.removeClass('is-opening').addClass('is-open').attr({
  3050. 'aria-hidden': false
  3051. });
  3052. if (this.options.autoFocus) {
  3053. var $focusable = _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].findFocusable(this.$element);
  3054. if ($focusable.length) {
  3055. $focusable.eq(0).focus();
  3056. }
  3057. }
  3058. if (this.options.closeOnClick) {
  3059. this._addBodyHandler();
  3060. }
  3061. if (this.options.trapFocus) {
  3062. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].trapFocus(this.$element);
  3063. }
  3064. /**
  3065. * Fires once the dropdown is visible.
  3066. * @event Dropdown#show
  3067. */
  3068. this.$element.trigger('show.zf.dropdown', [this.$element]);
  3069. }
  3070. /**
  3071. * Closes the open dropdown pane.
  3072. * @function
  3073. * @fires Dropdown#hide
  3074. */
  3075. }, {
  3076. key: "close",
  3077. value: function close() {
  3078. if (!this.$element.hasClass('is-open')) {
  3079. return false;
  3080. }
  3081. this.$element.removeClass('is-open').attr({
  3082. 'aria-hidden': true
  3083. });
  3084. this.$anchors.removeClass('hover').attr('aria-expanded', false);
  3085. /**
  3086. * Fires once the dropdown is no longer visible.
  3087. * @event Dropdown#hide
  3088. */
  3089. this.$element.trigger('hide.zf.dropdown', [this.$element]);
  3090. if (this.options.trapFocus) {
  3091. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].releaseFocus(this.$element);
  3092. }
  3093. }
  3094. /**
  3095. * Toggles the dropdown pane's visibility.
  3096. * @function
  3097. */
  3098. }, {
  3099. key: "toggle",
  3100. value: function toggle() {
  3101. if (this.$element.hasClass('is-open')) {
  3102. if (this.$anchors.data('hover')) return;
  3103. this.close();
  3104. } else {
  3105. this.open();
  3106. }
  3107. }
  3108. /**
  3109. * Destroys the dropdown.
  3110. * @function
  3111. */
  3112. }, {
  3113. key: "_destroy",
  3114. value: function _destroy() {
  3115. this.$element.off('.zf.trigger').hide();
  3116. this.$anchors.off('.zf.dropdown');
  3117. jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body).off('click.zf.dropdown');
  3118. }
  3119. }]);
  3120. return Dropdown;
  3121. }(_foundation_positionable__WEBPACK_IMPORTED_MODULE_3__["Positionable"]);
  3122. Dropdown.defaults = {
  3123. /**
  3124. * Class that designates bounding container of Dropdown (default: window)
  3125. * @option
  3126. * @type {?string}
  3127. * @default null
  3128. */
  3129. parentClass: null,
  3130. /**
  3131. * Amount of time to delay opening a submenu on hover event.
  3132. * @option
  3133. * @type {number}
  3134. * @default 250
  3135. */
  3136. hoverDelay: 250,
  3137. /**
  3138. * Allow submenus to open on hover events
  3139. * @option
  3140. * @type {boolean}
  3141. * @default false
  3142. */
  3143. hover: false,
  3144. /**
  3145. * Don't close dropdown when hovering over dropdown pane
  3146. * @option
  3147. * @type {boolean}
  3148. * @default false
  3149. */
  3150. hoverPane: false,
  3151. /**
  3152. * Number of pixels between the dropdown pane and the triggering element on open.
  3153. * @option
  3154. * @type {number}
  3155. * @default 0
  3156. */
  3157. vOffset: 0,
  3158. /**
  3159. * Number of pixels between the dropdown pane and the triggering element on open.
  3160. * @option
  3161. * @type {number}
  3162. * @default 0
  3163. */
  3164. hOffset: 0,
  3165. /**
  3166. * Position of dropdown. Can be left, right, bottom, top, or auto.
  3167. * @option
  3168. * @type {string}
  3169. * @default 'auto'
  3170. */
  3171. position: 'auto',
  3172. /**
  3173. * Alignment of dropdown relative to anchor. Can be left, right, bottom, top, center, or auto.
  3174. * @option
  3175. * @type {string}
  3176. * @default 'auto'
  3177. */
  3178. alignment: 'auto',
  3179. /**
  3180. * Allow overlap of container/window. If false, dropdown will first try to position as defined by data-position and data-alignment, but reposition if it would cause an overflow.
  3181. * @option
  3182. * @type {boolean}
  3183. * @default false
  3184. */
  3185. allowOverlap: false,
  3186. /**
  3187. * Allow overlap of only the bottom of the container. This is the most common
  3188. * behavior for dropdowns, allowing the dropdown to extend the bottom of the
  3189. * screen but not otherwise influence or break out of the container.
  3190. * @option
  3191. * @type {boolean}
  3192. * @default true
  3193. */
  3194. allowBottomOverlap: true,
  3195. /**
  3196. * Allow the plugin to trap focus to the dropdown pane if opened with keyboard commands.
  3197. * @option
  3198. * @type {boolean}
  3199. * @default false
  3200. */
  3201. trapFocus: false,
  3202. /**
  3203. * Allow the plugin to set focus to the first focusable element within the pane, regardless of method of opening.
  3204. * @option
  3205. * @type {boolean}
  3206. * @default false
  3207. */
  3208. autoFocus: false,
  3209. /**
  3210. * Allows a click on the body to close the dropdown.
  3211. * @option
  3212. * @type {boolean}
  3213. * @default false
  3214. */
  3215. closeOnClick: false
  3216. };
  3217. /***/ }),
  3218. /***/ "./js/foundation.dropdownMenu.js":
  3219. /*!***************************************!*\
  3220. !*** ./js/foundation.dropdownMenu.js ***!
  3221. \***************************************/
  3222. /*! exports provided: DropdownMenu */
  3223. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3224. "use strict";
  3225. __webpack_require__.r(__webpack_exports__);
  3226. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DropdownMenu", function() { return DropdownMenu; });
  3227. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  3228. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  3229. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  3230. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  3231. /* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js");
  3232. /* harmony import */ var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.nest */ "./js/foundation.util.nest.js");
  3233. /* harmony import */ var _foundation_util_box__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.util.box */ "./js/foundation.util.box.js");
  3234. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  3235. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3236. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  3237. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  3238. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  3239. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  3240. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  3241. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  3242. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  3243. /**
  3244. * DropdownMenu module.
  3245. * @module foundation.dropdown-menu
  3246. * @requires foundation.util.keyboard
  3247. * @requires foundation.util.box
  3248. * @requires foundation.util.nest
  3249. */
  3250. var DropdownMenu =
  3251. /*#__PURE__*/
  3252. function (_Plugin) {
  3253. _inherits(DropdownMenu, _Plugin);
  3254. function DropdownMenu() {
  3255. _classCallCheck(this, DropdownMenu);
  3256. return _possibleConstructorReturn(this, _getPrototypeOf(DropdownMenu).apply(this, arguments));
  3257. }
  3258. _createClass(DropdownMenu, [{
  3259. key: "_setup",
  3260. /**
  3261. * Creates a new instance of DropdownMenu.
  3262. * @class
  3263. * @name DropdownMenu
  3264. * @fires DropdownMenu#init
  3265. * @param {jQuery} element - jQuery object to make into a dropdown menu.
  3266. * @param {Object} options - Overrides to the default plugin settings.
  3267. */
  3268. value: function _setup(element, options) {
  3269. this.$element = element;
  3270. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, DropdownMenu.defaults, this.$element.data(), options);
  3271. this.className = 'DropdownMenu'; // ie9 back compat
  3272. this._init();
  3273. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].register('DropdownMenu', {
  3274. 'ENTER': 'open',
  3275. 'SPACE': 'open',
  3276. 'ARROW_RIGHT': 'next',
  3277. 'ARROW_UP': 'up',
  3278. 'ARROW_DOWN': 'down',
  3279. 'ARROW_LEFT': 'previous',
  3280. 'ESCAPE': 'close'
  3281. });
  3282. }
  3283. /**
  3284. * Initializes the plugin, and calls _prepareMenu
  3285. * @private
  3286. * @function
  3287. */
  3288. }, {
  3289. key: "_init",
  3290. value: function _init() {
  3291. _foundation_util_nest__WEBPACK_IMPORTED_MODULE_4__["Nest"].Feather(this.$element, 'dropdown');
  3292. var subs = this.$element.find('li.is-dropdown-submenu-parent');
  3293. this.$element.children('.is-dropdown-submenu-parent').children('.is-dropdown-submenu').addClass('first-sub');
  3294. this.$menuItems = this.$element.find('[role="menuitem"]');
  3295. this.$tabs = this.$element.children('[role="menuitem"]');
  3296. this.$tabs.find('ul.is-dropdown-submenu').addClass(this.options.verticalClass);
  3297. if (this.options.alignment === 'auto') {
  3298. if (this.$element.hasClass(this.options.rightClass) || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["rtl"])() || this.$element.parents('.top-bar-right').is('*')) {
  3299. this.options.alignment = 'right';
  3300. subs.addClass('opens-left');
  3301. } else {
  3302. this.options.alignment = 'left';
  3303. subs.addClass('opens-right');
  3304. }
  3305. } else {
  3306. if (this.options.alignment === 'right') {
  3307. subs.addClass('opens-left');
  3308. } else {
  3309. subs.addClass('opens-right');
  3310. }
  3311. }
  3312. this.changed = false;
  3313. this._events();
  3314. }
  3315. }, {
  3316. key: "_isVertical",
  3317. value: function _isVertical() {
  3318. return this.$tabs.css('display') === 'block' || this.$element.css('flex-direction') === 'column';
  3319. }
  3320. }, {
  3321. key: "_isRtl",
  3322. value: function _isRtl() {
  3323. return this.$element.hasClass('align-right') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["rtl"])() && !this.$element.hasClass('align-left');
  3324. }
  3325. /**
  3326. * Adds event listeners to elements within the menu
  3327. * @private
  3328. * @function
  3329. */
  3330. }, {
  3331. key: "_events",
  3332. value: function _events() {
  3333. var _this = this,
  3334. hasTouch = 'ontouchstart' in window || typeof window.ontouchstart !== 'undefined',
  3335. parClass = 'is-dropdown-submenu-parent'; // used for onClick and in the keyboard handlers
  3336. var handleClickFn = function handleClickFn(e) {
  3337. var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).parentsUntil('ul', ".".concat(parClass)),
  3338. hasSub = $elem.hasClass(parClass),
  3339. hasClicked = $elem.attr('data-is-click') === 'true',
  3340. $sub = $elem.children('.is-dropdown-submenu');
  3341. if (hasSub) {
  3342. if (hasClicked) {
  3343. if (!_this.options.closeOnClick || !_this.options.clickOpen && !hasTouch || _this.options.forceFollow && hasTouch) {
  3344. return;
  3345. } else {
  3346. e.stopImmediatePropagation();
  3347. e.preventDefault();
  3348. _this._hide($elem);
  3349. }
  3350. } else {
  3351. e.preventDefault();
  3352. e.stopImmediatePropagation();
  3353. _this._show($sub);
  3354. $elem.add($elem.parentsUntil(_this.$element, ".".concat(parClass))).attr('data-is-click', true);
  3355. }
  3356. }
  3357. };
  3358. if (this.options.clickOpen || hasTouch) {
  3359. this.$menuItems.on('click.zf.dropdownmenu touchstart.zf.dropdownmenu', handleClickFn);
  3360. } // Handle Leaf element Clicks
  3361. if (_this.options.closeOnClickInside) {
  3362. this.$menuItems.on('click.zf.dropdownmenu', function (e) {
  3363. var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  3364. hasSub = $elem.hasClass(parClass);
  3365. if (!hasSub) {
  3366. _this._hide();
  3367. }
  3368. });
  3369. }
  3370. if (!this.options.disableHover) {
  3371. this.$menuItems.on('mouseenter.zf.dropdownmenu', function (e) {
  3372. var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  3373. hasSub = $elem.hasClass(parClass);
  3374. if (hasSub) {
  3375. clearTimeout($elem.data('_delay'));
  3376. $elem.data('_delay', setTimeout(function () {
  3377. _this._show($elem.children('.is-dropdown-submenu'));
  3378. }, _this.options.hoverDelay));
  3379. }
  3380. }).on('mouseleave.zf.dropdownMenu', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["ignoreMousedisappear"])(function (e) {
  3381. var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  3382. hasSub = $elem.hasClass(parClass);
  3383. if (hasSub && _this.options.autoclose) {
  3384. if ($elem.attr('data-is-click') === 'true' && _this.options.clickOpen) {
  3385. return false;
  3386. }
  3387. clearTimeout($elem.data('_delay'));
  3388. $elem.data('_delay', setTimeout(function () {
  3389. _this._hide($elem);
  3390. }, _this.options.closingTime));
  3391. }
  3392. }));
  3393. }
  3394. this.$menuItems.on('keydown.zf.dropdownmenu', function (e) {
  3395. var $element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).parentsUntil('ul', '[role="menuitem"]'),
  3396. isTab = _this.$tabs.index($element) > -1,
  3397. $elements = isTab ? _this.$tabs : $element.siblings('li').add($element),
  3398. $prevElement,
  3399. $nextElement;
  3400. $elements.each(function (i) {
  3401. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is($element)) {
  3402. $prevElement = $elements.eq(i - 1);
  3403. $nextElement = $elements.eq(i + 1);
  3404. return;
  3405. }
  3406. });
  3407. var nextSibling = function nextSibling() {
  3408. $nextElement.children('a:first').focus();
  3409. e.preventDefault();
  3410. },
  3411. prevSibling = function prevSibling() {
  3412. $prevElement.children('a:first').focus();
  3413. e.preventDefault();
  3414. },
  3415. openSub = function openSub() {
  3416. var $sub = $element.children('ul.is-dropdown-submenu');
  3417. if ($sub.length) {
  3418. _this._show($sub);
  3419. $element.find('li > a:first').focus();
  3420. e.preventDefault();
  3421. } else {
  3422. return;
  3423. }
  3424. },
  3425. closeSub = function closeSub() {
  3426. //if ($element.is(':first-child')) {
  3427. var close = $element.parent('ul').parent('li');
  3428. close.children('a:first').focus();
  3429. _this._hide(close);
  3430. e.preventDefault(); //}
  3431. };
  3432. var functions = {
  3433. open: openSub,
  3434. close: function close() {
  3435. _this._hide(_this.$element);
  3436. _this.$menuItems.eq(0).children('a').focus(); // focus to first element
  3437. e.preventDefault();
  3438. },
  3439. handled: function handled() {
  3440. e.stopImmediatePropagation();
  3441. }
  3442. };
  3443. if (isTab) {
  3444. if (_this._isVertical()) {
  3445. // vertical menu
  3446. if (_this._isRtl()) {
  3447. // right aligned
  3448. jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, {
  3449. down: nextSibling,
  3450. up: prevSibling,
  3451. next: closeSub,
  3452. previous: openSub
  3453. });
  3454. } else {
  3455. // left aligned
  3456. jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, {
  3457. down: nextSibling,
  3458. up: prevSibling,
  3459. next: openSub,
  3460. previous: closeSub
  3461. });
  3462. }
  3463. } else {
  3464. // horizontal menu
  3465. if (_this._isRtl()) {
  3466. // right aligned
  3467. jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, {
  3468. next: prevSibling,
  3469. previous: nextSibling,
  3470. down: openSub,
  3471. up: closeSub
  3472. });
  3473. } else {
  3474. // left aligned
  3475. jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, {
  3476. next: nextSibling,
  3477. previous: prevSibling,
  3478. down: openSub,
  3479. up: closeSub
  3480. });
  3481. }
  3482. }
  3483. } else {
  3484. // not tabs -> one sub
  3485. if (_this._isRtl()) {
  3486. // right aligned
  3487. jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, {
  3488. next: closeSub,
  3489. previous: openSub,
  3490. down: nextSibling,
  3491. up: prevSibling
  3492. });
  3493. } else {
  3494. // left aligned
  3495. jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, {
  3496. next: openSub,
  3497. previous: closeSub,
  3498. down: nextSibling,
  3499. up: prevSibling
  3500. });
  3501. }
  3502. }
  3503. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].handleKey(e, 'DropdownMenu', functions);
  3504. });
  3505. }
  3506. /**
  3507. * Adds an event handler to the body to close any dropdowns on a click.
  3508. * @function
  3509. * @private
  3510. */
  3511. }, {
  3512. key: "_addBodyHandler",
  3513. value: function _addBodyHandler() {
  3514. var $body = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body),
  3515. _this = this;
  3516. $body.off('mouseup.zf.dropdownmenu touchend.zf.dropdownmenu').on('mouseup.zf.dropdownmenu touchend.zf.dropdownmenu', function (e) {
  3517. var $link = _this.$element.find(e.target);
  3518. if ($link.length) {
  3519. return;
  3520. }
  3521. _this._hide();
  3522. $body.off('mouseup.zf.dropdownmenu touchend.zf.dropdownmenu');
  3523. });
  3524. }
  3525. /**
  3526. * Opens a dropdown pane, and checks for collisions first.
  3527. * @param {jQuery} $sub - ul element that is a submenu to show
  3528. * @function
  3529. * @private
  3530. * @fires Dropdownmenu#show
  3531. */
  3532. }, {
  3533. key: "_show",
  3534. value: function _show($sub) {
  3535. var idx = this.$tabs.index(this.$tabs.filter(function (i, el) {
  3536. return jquery__WEBPACK_IMPORTED_MODULE_0___default()(el).find($sub).length > 0;
  3537. }));
  3538. var $sibs = $sub.parent('li.is-dropdown-submenu-parent').siblings('li.is-dropdown-submenu-parent');
  3539. this._hide($sibs, idx);
  3540. $sub.css('visibility', 'hidden').addClass('js-dropdown-active').parent('li.is-dropdown-submenu-parent').addClass('is-active');
  3541. var clear = _foundation_util_box__WEBPACK_IMPORTED_MODULE_5__["Box"].ImNotTouchingYou($sub, null, true);
  3542. if (!clear) {
  3543. var oldClass = this.options.alignment === 'left' ? '-right' : '-left',
  3544. $parentLi = $sub.parent('.is-dropdown-submenu-parent');
  3545. $parentLi.removeClass("opens".concat(oldClass)).addClass("opens-".concat(this.options.alignment));
  3546. clear = _foundation_util_box__WEBPACK_IMPORTED_MODULE_5__["Box"].ImNotTouchingYou($sub, null, true);
  3547. if (!clear) {
  3548. $parentLi.removeClass("opens-".concat(this.options.alignment)).addClass('opens-inner');
  3549. }
  3550. this.changed = true;
  3551. }
  3552. $sub.css('visibility', '');
  3553. if (this.options.closeOnClick) {
  3554. this._addBodyHandler();
  3555. }
  3556. /**
  3557. * Fires when the new dropdown pane is visible.
  3558. * @event Dropdownmenu#show
  3559. */
  3560. this.$element.trigger('show.zf.dropdownmenu', [$sub]);
  3561. }
  3562. /**
  3563. * Hides a single, currently open dropdown pane, if passed a parameter, otherwise, hides everything.
  3564. * @function
  3565. * @param {jQuery} $elem - element with a submenu to hide
  3566. * @param {Number} idx - index of the $tabs collection to hide
  3567. * @private
  3568. */
  3569. }, {
  3570. key: "_hide",
  3571. value: function _hide($elem, idx) {
  3572. var $toClose;
  3573. if ($elem && $elem.length) {
  3574. $toClose = $elem;
  3575. } else if (typeof idx !== 'undefined') {
  3576. $toClose = this.$tabs.not(function (i, el) {
  3577. return i === idx;
  3578. });
  3579. } else {
  3580. $toClose = this.$element;
  3581. }
  3582. var somethingToClose = $toClose.hasClass('is-active') || $toClose.find('.is-active').length > 0;
  3583. if (somethingToClose) {
  3584. $toClose.find('li.is-active').add($toClose).attr({
  3585. 'data-is-click': false
  3586. }).removeClass('is-active');
  3587. $toClose.find('ul.js-dropdown-active').removeClass('js-dropdown-active');
  3588. if (this.changed || $toClose.find('opens-inner').length) {
  3589. var oldClass = this.options.alignment === 'left' ? 'right' : 'left';
  3590. $toClose.find('li.is-dropdown-submenu-parent').add($toClose).removeClass("opens-inner opens-".concat(this.options.alignment)).addClass("opens-".concat(oldClass));
  3591. this.changed = false;
  3592. }
  3593. /**
  3594. * Fires when the open menus are closed.
  3595. * @event Dropdownmenu#hide
  3596. */
  3597. this.$element.trigger('hide.zf.dropdownmenu', [$toClose]);
  3598. }
  3599. }
  3600. /**
  3601. * Destroys the plugin.
  3602. * @function
  3603. */
  3604. }, {
  3605. key: "_destroy",
  3606. value: function _destroy() {
  3607. this.$menuItems.off('.zf.dropdownmenu').removeAttr('data-is-click').removeClass('is-right-arrow is-left-arrow is-down-arrow opens-right opens-left opens-inner');
  3608. jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body).off('.zf.dropdownmenu');
  3609. _foundation_util_nest__WEBPACK_IMPORTED_MODULE_4__["Nest"].Burn(this.$element, 'dropdown');
  3610. }
  3611. }]);
  3612. return DropdownMenu;
  3613. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]);
  3614. /**
  3615. * Default settings for plugin
  3616. */
  3617. DropdownMenu.defaults = {
  3618. /**
  3619. * Disallows hover events from opening submenus
  3620. * @option
  3621. * @type {boolean}
  3622. * @default false
  3623. */
  3624. disableHover: false,
  3625. /**
  3626. * Allow a submenu to automatically close on a mouseleave event, if not clicked open.
  3627. * @option
  3628. * @type {boolean}
  3629. * @default true
  3630. */
  3631. autoclose: true,
  3632. /**
  3633. * Amount of time to delay opening a submenu on hover event.
  3634. * @option
  3635. * @type {number}
  3636. * @default 50
  3637. */
  3638. hoverDelay: 50,
  3639. /**
  3640. * Allow a submenu to open/remain open on parent click event. Allows cursor to move away from menu.
  3641. * @option
  3642. * @type {boolean}
  3643. * @default false
  3644. */
  3645. clickOpen: false,
  3646. /**
  3647. * Amount of time to delay closing a submenu on a mouseleave event.
  3648. * @option
  3649. * @type {number}
  3650. * @default 500
  3651. */
  3652. closingTime: 500,
  3653. /**
  3654. * Position of the menu relative to what direction the submenus should open. Handled by JS. Can be `'auto'`, `'left'` or `'right'`.
  3655. * @option
  3656. * @type {string}
  3657. * @default 'auto'
  3658. */
  3659. alignment: 'auto',
  3660. /**
  3661. * Allow clicks on the body to close any open submenus.
  3662. * @option
  3663. * @type {boolean}
  3664. * @default true
  3665. */
  3666. closeOnClick: true,
  3667. /**
  3668. * Allow clicks on leaf anchor links to close any open submenus.
  3669. * @option
  3670. * @type {boolean}
  3671. * @default true
  3672. */
  3673. closeOnClickInside: true,
  3674. /**
  3675. * Class applied to vertical oriented menus, Foundation default is `vertical`. Update this if using your own class.
  3676. * @option
  3677. * @type {string}
  3678. * @default 'vertical'
  3679. */
  3680. verticalClass: 'vertical',
  3681. /**
  3682. * Class applied to right-side oriented menus, Foundation default is `align-right`. Update this if using your own class.
  3683. * @option
  3684. * @type {string}
  3685. * @default 'align-right'
  3686. */
  3687. rightClass: 'align-right',
  3688. /**
  3689. * Boolean to force overide the clicking of links to perform default action, on second touch event for mobile.
  3690. * @option
  3691. * @type {boolean}
  3692. * @default true
  3693. */
  3694. forceFollow: true
  3695. };
  3696. /***/ }),
  3697. /***/ "./js/foundation.equalizer.js":
  3698. /*!************************************!*\
  3699. !*** ./js/foundation.equalizer.js ***!
  3700. \************************************/
  3701. /*! exports provided: Equalizer */
  3702. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3703. "use strict";
  3704. __webpack_require__.r(__webpack_exports__);
  3705. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Equalizer", function() { return Equalizer; });
  3706. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  3707. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  3708. /* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js");
  3709. /* harmony import */ var _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.imageLoader */ "./js/foundation.util.imageLoader.js");
  3710. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  3711. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  3712. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  3713. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3714. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  3715. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  3716. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  3717. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  3718. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  3719. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  3720. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  3721. /**
  3722. * Equalizer module.
  3723. * @module foundation.equalizer
  3724. * @requires foundation.util.mediaQuery
  3725. * @requires foundation.util.imageLoader if equalizer contains images
  3726. */
  3727. var Equalizer =
  3728. /*#__PURE__*/
  3729. function (_Plugin) {
  3730. _inherits(Equalizer, _Plugin);
  3731. function Equalizer() {
  3732. _classCallCheck(this, Equalizer);
  3733. return _possibleConstructorReturn(this, _getPrototypeOf(Equalizer).apply(this, arguments));
  3734. }
  3735. _createClass(Equalizer, [{
  3736. key: "_setup",
  3737. /**
  3738. * Creates a new instance of Equalizer.
  3739. * @class
  3740. * @name Equalizer
  3741. * @fires Equalizer#init
  3742. * @param {Object} element - jQuery object to add the trigger to.
  3743. * @param {Object} options - Overrides to the default plugin settings.
  3744. */
  3745. value: function _setup(element, options) {
  3746. this.$element = element;
  3747. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Equalizer.defaults, this.$element.data(), options);
  3748. this.className = 'Equalizer'; // ie9 back compat
  3749. this._init();
  3750. }
  3751. /**
  3752. * Initializes the Equalizer plugin and calls functions to get equalizer functioning on load.
  3753. * @private
  3754. */
  3755. }, {
  3756. key: "_init",
  3757. value: function _init() {
  3758. var eqId = this.$element.attr('data-equalizer') || '';
  3759. var $watched = this.$element.find("[data-equalizer-watch=\"".concat(eqId, "\"]"));
  3760. _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]._init();
  3761. this.$watched = $watched.length ? $watched : this.$element.find('[data-equalizer-watch]');
  3762. this.$element.attr('data-resize', eqId || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'eq'));
  3763. this.$element.attr('data-mutate', eqId || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'eq'));
  3764. this.hasNested = this.$element.find('[data-equalizer]').length > 0;
  3765. this.isNested = this.$element.parentsUntil(document.body, '[data-equalizer]').length > 0;
  3766. this.isOn = false;
  3767. this._bindHandler = {
  3768. onResizeMeBound: this._onResizeMe.bind(this),
  3769. onPostEqualizedBound: this._onPostEqualized.bind(this)
  3770. };
  3771. var imgs = this.$element.find('img');
  3772. var tooSmall;
  3773. if (this.options.equalizeOn) {
  3774. tooSmall = this._checkMQ();
  3775. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', this._checkMQ.bind(this));
  3776. } else {
  3777. this._events();
  3778. }
  3779. if (typeof tooSmall !== 'undefined' && tooSmall === false || typeof tooSmall === 'undefined') {
  3780. if (imgs.length) {
  3781. Object(_foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_2__["onImagesLoaded"])(imgs, this._reflow.bind(this));
  3782. } else {
  3783. this._reflow();
  3784. }
  3785. }
  3786. }
  3787. /**
  3788. * Removes event listeners if the breakpoint is too small.
  3789. * @private
  3790. */
  3791. }, {
  3792. key: "_pauseEvents",
  3793. value: function _pauseEvents() {
  3794. this.isOn = false;
  3795. this.$element.off({
  3796. '.zf.equalizer': this._bindHandler.onPostEqualizedBound,
  3797. 'resizeme.zf.trigger': this._bindHandler.onResizeMeBound,
  3798. 'mutateme.zf.trigger': this._bindHandler.onResizeMeBound
  3799. });
  3800. }
  3801. /**
  3802. * function to handle $elements resizeme.zf.trigger, with bound this on _bindHandler.onResizeMeBound
  3803. * @private
  3804. */
  3805. }, {
  3806. key: "_onResizeMe",
  3807. value: function _onResizeMe(e) {
  3808. this._reflow();
  3809. }
  3810. /**
  3811. * function to handle $elements postequalized.zf.equalizer, with bound this on _bindHandler.onPostEqualizedBound
  3812. * @private
  3813. */
  3814. }, {
  3815. key: "_onPostEqualized",
  3816. value: function _onPostEqualized(e) {
  3817. if (e.target !== this.$element[0]) {
  3818. this._reflow();
  3819. }
  3820. }
  3821. /**
  3822. * Initializes events for Equalizer.
  3823. * @private
  3824. */
  3825. }, {
  3826. key: "_events",
  3827. value: function _events() {
  3828. var _this = this;
  3829. this._pauseEvents();
  3830. if (this.hasNested) {
  3831. this.$element.on('postequalized.zf.equalizer', this._bindHandler.onPostEqualizedBound);
  3832. } else {
  3833. this.$element.on('resizeme.zf.trigger', this._bindHandler.onResizeMeBound);
  3834. this.$element.on('mutateme.zf.trigger', this._bindHandler.onResizeMeBound);
  3835. }
  3836. this.isOn = true;
  3837. }
  3838. /**
  3839. * Checks the current breakpoint to the minimum required size.
  3840. * @private
  3841. */
  3842. }, {
  3843. key: "_checkMQ",
  3844. value: function _checkMQ() {
  3845. var tooSmall = !_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].is(this.options.equalizeOn);
  3846. if (tooSmall) {
  3847. if (this.isOn) {
  3848. this._pauseEvents();
  3849. this.$watched.css('height', 'auto');
  3850. }
  3851. } else {
  3852. if (!this.isOn) {
  3853. this._events();
  3854. }
  3855. }
  3856. return tooSmall;
  3857. }
  3858. /**
  3859. * A noop version for the plugin
  3860. * @private
  3861. */
  3862. }, {
  3863. key: "_killswitch",
  3864. value: function _killswitch() {
  3865. return;
  3866. }
  3867. /**
  3868. * Calls necessary functions to update Equalizer upon DOM change
  3869. * @private
  3870. */
  3871. }, {
  3872. key: "_reflow",
  3873. value: function _reflow() {
  3874. if (!this.options.equalizeOnStack) {
  3875. if (this._isStacked()) {
  3876. this.$watched.css('height', 'auto');
  3877. return false;
  3878. }
  3879. }
  3880. if (this.options.equalizeByRow) {
  3881. this.getHeightsByRow(this.applyHeightByRow.bind(this));
  3882. } else {
  3883. this.getHeights(this.applyHeight.bind(this));
  3884. }
  3885. }
  3886. /**
  3887. * Manually determines if the first 2 elements are *NOT* stacked.
  3888. * @private
  3889. */
  3890. }, {
  3891. key: "_isStacked",
  3892. value: function _isStacked() {
  3893. if (!this.$watched[0] || !this.$watched[1]) {
  3894. return true;
  3895. }
  3896. return this.$watched[0].getBoundingClientRect().top !== this.$watched[1].getBoundingClientRect().top;
  3897. }
  3898. /**
  3899. * Finds the outer heights of children contained within an Equalizer parent and returns them in an array
  3900. * @param {Function} cb - A non-optional callback to return the heights array to.
  3901. * @returns {Array} heights - An array of heights of children within Equalizer container
  3902. */
  3903. }, {
  3904. key: "getHeights",
  3905. value: function getHeights(cb) {
  3906. var heights = [];
  3907. for (var i = 0, len = this.$watched.length; i < len; i++) {
  3908. this.$watched[i].style.height = 'auto';
  3909. heights.push(this.$watched[i].offsetHeight);
  3910. }
  3911. cb(heights);
  3912. }
  3913. /**
  3914. * Finds the outer heights of children contained within an Equalizer parent and returns them in an array
  3915. * @param {Function} cb - A non-optional callback to return the heights array to.
  3916. * @returns {Array} groups - An array of heights of children within Equalizer container grouped by row with element,height and max as last child
  3917. */
  3918. }, {
  3919. key: "getHeightsByRow",
  3920. value: function getHeightsByRow(cb) {
  3921. var lastElTopOffset = this.$watched.length ? this.$watched.first().offset().top : 0,
  3922. groups = [],
  3923. group = 0; //group by Row
  3924. groups[group] = [];
  3925. for (var i = 0, len = this.$watched.length; i < len; i++) {
  3926. this.$watched[i].style.height = 'auto'; //maybe could use this.$watched[i].offsetTop
  3927. var elOffsetTop = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.$watched[i]).offset().top;
  3928. if (elOffsetTop != lastElTopOffset) {
  3929. group++;
  3930. groups[group] = [];
  3931. lastElTopOffset = elOffsetTop;
  3932. }
  3933. groups[group].push([this.$watched[i], this.$watched[i].offsetHeight]);
  3934. }
  3935. for (var j = 0, ln = groups.length; j < ln; j++) {
  3936. var heights = jquery__WEBPACK_IMPORTED_MODULE_0___default()(groups[j]).map(function () {
  3937. return this[1];
  3938. }).get();
  3939. var max = Math.max.apply(null, heights);
  3940. groups[j].push(max);
  3941. }
  3942. cb(groups);
  3943. }
  3944. /**
  3945. * Changes the CSS height property of each child in an Equalizer parent to match the tallest
  3946. * @param {array} heights - An array of heights of children within Equalizer container
  3947. * @fires Equalizer#preequalized
  3948. * @fires Equalizer#postequalized
  3949. */
  3950. }, {
  3951. key: "applyHeight",
  3952. value: function applyHeight(heights) {
  3953. var max = Math.max.apply(null, heights);
  3954. /**
  3955. * Fires before the heights are applied
  3956. * @event Equalizer#preequalized
  3957. */
  3958. this.$element.trigger('preequalized.zf.equalizer');
  3959. this.$watched.css('height', max);
  3960. /**
  3961. * Fires when the heights have been applied
  3962. * @event Equalizer#postequalized
  3963. */
  3964. this.$element.trigger('postequalized.zf.equalizer');
  3965. }
  3966. /**
  3967. * Changes the CSS height property of each child in an Equalizer parent to match the tallest by row
  3968. * @param {array} groups - An array of heights of children within Equalizer container grouped by row with element,height and max as last child
  3969. * @fires Equalizer#preequalized
  3970. * @fires Equalizer#preequalizedrow
  3971. * @fires Equalizer#postequalizedrow
  3972. * @fires Equalizer#postequalized
  3973. */
  3974. }, {
  3975. key: "applyHeightByRow",
  3976. value: function applyHeightByRow(groups) {
  3977. /**
  3978. * Fires before the heights are applied
  3979. */
  3980. this.$element.trigger('preequalized.zf.equalizer');
  3981. for (var i = 0, len = groups.length; i < len; i++) {
  3982. var groupsILength = groups[i].length,
  3983. max = groups[i][groupsILength - 1];
  3984. if (groupsILength <= 2) {
  3985. jquery__WEBPACK_IMPORTED_MODULE_0___default()(groups[i][0][0]).css({
  3986. 'height': 'auto'
  3987. });
  3988. continue;
  3989. }
  3990. /**
  3991. * Fires before the heights per row are applied
  3992. * @event Equalizer#preequalizedrow
  3993. */
  3994. this.$element.trigger('preequalizedrow.zf.equalizer');
  3995. for (var j = 0, lenJ = groupsILength - 1; j < lenJ; j++) {
  3996. jquery__WEBPACK_IMPORTED_MODULE_0___default()(groups[i][j][0]).css({
  3997. 'height': max
  3998. });
  3999. }
  4000. /**
  4001. * Fires when the heights per row have been applied
  4002. * @event Equalizer#postequalizedrow
  4003. */
  4004. this.$element.trigger('postequalizedrow.zf.equalizer');
  4005. }
  4006. /**
  4007. * Fires when the heights have been applied
  4008. */
  4009. this.$element.trigger('postequalized.zf.equalizer');
  4010. }
  4011. /**
  4012. * Destroys an instance of Equalizer.
  4013. * @function
  4014. */
  4015. }, {
  4016. key: "_destroy",
  4017. value: function _destroy() {
  4018. this._pauseEvents();
  4019. this.$watched.css('height', 'auto');
  4020. }
  4021. }]);
  4022. return Equalizer;
  4023. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__["Plugin"]);
  4024. /**
  4025. * Default settings for plugin
  4026. */
  4027. Equalizer.defaults = {
  4028. /**
  4029. * Enable height equalization when stacked on smaller screens.
  4030. * @option
  4031. * @type {boolean}
  4032. * @default false
  4033. */
  4034. equalizeOnStack: false,
  4035. /**
  4036. * Enable height equalization row by row.
  4037. * @option
  4038. * @type {boolean}
  4039. * @default false
  4040. */
  4041. equalizeByRow: false,
  4042. /**
  4043. * String representing the minimum breakpoint size the plugin should equalize heights on.
  4044. * @option
  4045. * @type {string}
  4046. * @default ''
  4047. */
  4048. equalizeOn: ''
  4049. };
  4050. /***/ }),
  4051. /***/ "./js/foundation.interchange.js":
  4052. /*!**************************************!*\
  4053. !*** ./js/foundation.interchange.js ***!
  4054. \**************************************/
  4055. /*! exports provided: Interchange */
  4056. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4057. "use strict";
  4058. __webpack_require__.r(__webpack_exports__);
  4059. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Interchange", function() { return Interchange; });
  4060. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  4061. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  4062. /* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js");
  4063. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  4064. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  4065. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  4066. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4067. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  4068. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  4069. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  4070. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  4071. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  4072. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  4073. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  4074. /**
  4075. * Interchange module.
  4076. * @module foundation.interchange
  4077. * @requires foundation.util.mediaQuery
  4078. */
  4079. var Interchange =
  4080. /*#__PURE__*/
  4081. function (_Plugin) {
  4082. _inherits(Interchange, _Plugin);
  4083. function Interchange() {
  4084. _classCallCheck(this, Interchange);
  4085. return _possibleConstructorReturn(this, _getPrototypeOf(Interchange).apply(this, arguments));
  4086. }
  4087. _createClass(Interchange, [{
  4088. key: "_setup",
  4089. /**
  4090. * Creates a new instance of Interchange.
  4091. * @class
  4092. * @name Interchange
  4093. * @fires Interchange#init
  4094. * @param {Object} element - jQuery object to add the trigger to.
  4095. * @param {Object} options - Overrides to the default plugin settings.
  4096. */
  4097. value: function _setup(element, options) {
  4098. this.$element = element;
  4099. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Interchange.defaults, options);
  4100. this.rules = [];
  4101. this.currentPath = '';
  4102. this.className = 'Interchange'; // ie9 back compat
  4103. this._init();
  4104. this._events();
  4105. }
  4106. /**
  4107. * Initializes the Interchange plugin and calls functions to get interchange functioning on load.
  4108. * @function
  4109. * @private
  4110. */
  4111. }, {
  4112. key: "_init",
  4113. value: function _init() {
  4114. _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]._init();
  4115. var id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'interchange');
  4116. this.$element.attr({
  4117. 'data-resize': id,
  4118. 'id': id
  4119. });
  4120. this._addBreakpoints();
  4121. this._generateRules();
  4122. this._reflow();
  4123. }
  4124. /**
  4125. * Initializes events for Interchange.
  4126. * @function
  4127. * @private
  4128. */
  4129. }, {
  4130. key: "_events",
  4131. value: function _events() {
  4132. var _this2 = this;
  4133. this.$element.off('resizeme.zf.trigger').on('resizeme.zf.trigger', function () {
  4134. return _this2._reflow();
  4135. });
  4136. }
  4137. /**
  4138. * Calls necessary functions to update Interchange upon DOM change
  4139. * @function
  4140. * @private
  4141. */
  4142. }, {
  4143. key: "_reflow",
  4144. value: function _reflow() {
  4145. var match; // Iterate through each rule, but only save the last match
  4146. for (var i in this.rules) {
  4147. if (this.rules.hasOwnProperty(i)) {
  4148. var rule = this.rules[i];
  4149. if (window.matchMedia(rule.query).matches) {
  4150. match = rule;
  4151. }
  4152. }
  4153. }
  4154. if (match) {
  4155. this.replace(match.path);
  4156. }
  4157. }
  4158. /**
  4159. * Gets the Foundation breakpoints and adds them to the Interchange.SPECIAL_QUERIES object.
  4160. * @function
  4161. * @private
  4162. */
  4163. }, {
  4164. key: "_addBreakpoints",
  4165. value: function _addBreakpoints() {
  4166. for (var i in _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].queries) {
  4167. if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].queries.hasOwnProperty(i)) {
  4168. var query = _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].queries[i];
  4169. Interchange.SPECIAL_QUERIES[query.name] = query.value;
  4170. }
  4171. }
  4172. }
  4173. /**
  4174. * Checks the Interchange element for the provided media query + content pairings
  4175. * @function
  4176. * @private
  4177. * @param {Object} element - jQuery object that is an Interchange instance
  4178. * @returns {Array} scenarios - Array of objects that have 'mq' and 'path' keys with corresponding keys
  4179. */
  4180. }, {
  4181. key: "_generateRules",
  4182. value: function _generateRules(element) {
  4183. var rulesList = [];
  4184. var rules;
  4185. if (this.options.rules) {
  4186. rules = this.options.rules;
  4187. } else {
  4188. rules = this.$element.data('interchange');
  4189. }
  4190. rules = typeof rules === 'string' ? rules.match(/\[.*?, .*?\]/g) : rules;
  4191. for (var i in rules) {
  4192. if (rules.hasOwnProperty(i)) {
  4193. var rule = rules[i].slice(1, -1).split(', ');
  4194. var path = rule.slice(0, -1).join('');
  4195. var query = rule[rule.length - 1];
  4196. if (Interchange.SPECIAL_QUERIES[query]) {
  4197. query = Interchange.SPECIAL_QUERIES[query];
  4198. }
  4199. rulesList.push({
  4200. path: path,
  4201. query: query
  4202. });
  4203. }
  4204. }
  4205. this.rules = rulesList;
  4206. }
  4207. /**
  4208. * Update the `src` property of an image, or change the HTML of a container, to the specified path.
  4209. * @function
  4210. * @param {String} path - Path to the image or HTML partial.
  4211. * @fires Interchange#replaced
  4212. */
  4213. }, {
  4214. key: "replace",
  4215. value: function replace(path) {
  4216. if (this.currentPath === path) return;
  4217. var _this = this,
  4218. trigger = 'replaced.zf.interchange'; // Replacing images
  4219. if (this.$element[0].nodeName === 'IMG') {
  4220. this.$element.attr('src', path).on('load', function () {
  4221. _this.currentPath = path;
  4222. }).trigger(trigger);
  4223. } // Replacing background images
  4224. else if (path.match(/\.(gif|jpg|jpeg|png|svg|tiff)([?#].*)?/i)) {
  4225. path = path.replace(/\(/g, '%28').replace(/\)/g, '%29');
  4226. this.$element.css({
  4227. 'background-image': 'url(' + path + ')'
  4228. }).trigger(trigger);
  4229. } // Replacing HTML
  4230. else {
  4231. jquery__WEBPACK_IMPORTED_MODULE_0___default.a.get(path, function (response) {
  4232. _this.$element.html(response).trigger(trigger);
  4233. jquery__WEBPACK_IMPORTED_MODULE_0___default()(response).foundation();
  4234. _this.currentPath = path;
  4235. });
  4236. }
  4237. /**
  4238. * Fires when content in an Interchange element is done being loaded.
  4239. * @event Interchange#replaced
  4240. */
  4241. // this.$element.trigger('replaced.zf.interchange');
  4242. }
  4243. /**
  4244. * Destroys an instance of interchange.
  4245. * @function
  4246. */
  4247. }, {
  4248. key: "_destroy",
  4249. value: function _destroy() {
  4250. this.$element.off('resizeme.zf.trigger');
  4251. }
  4252. }]);
  4253. return Interchange;
  4254. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__["Plugin"]);
  4255. /**
  4256. * Default settings for plugin
  4257. */
  4258. Interchange.defaults = {
  4259. /**
  4260. * Rules to be applied to Interchange elements. Set with the `data-interchange` array notation.
  4261. * @option
  4262. * @type {?array}
  4263. * @default null
  4264. */
  4265. rules: null
  4266. };
  4267. Interchange.SPECIAL_QUERIES = {
  4268. 'landscape': 'screen and (orientation: landscape)',
  4269. 'portrait': 'screen and (orientation: portrait)',
  4270. 'retina': 'only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2/1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx)'
  4271. };
  4272. /***/ }),
  4273. /***/ "./js/foundation.magellan.js":
  4274. /*!***********************************!*\
  4275. !*** ./js/foundation.magellan.js ***!
  4276. \***********************************/
  4277. /*! exports provided: Magellan */
  4278. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4279. "use strict";
  4280. __webpack_require__.r(__webpack_exports__);
  4281. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Magellan", function() { return Magellan; });
  4282. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  4283. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  4284. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  4285. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  4286. /* harmony import */ var _foundation_smoothScroll__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.smoothScroll */ "./js/foundation.smoothScroll.js");
  4287. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  4288. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4289. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  4290. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  4291. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  4292. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  4293. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  4294. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  4295. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  4296. /**
  4297. * Magellan module.
  4298. * @module foundation.magellan
  4299. * @requires foundation.smoothScroll
  4300. */
  4301. var Magellan =
  4302. /*#__PURE__*/
  4303. function (_Plugin) {
  4304. _inherits(Magellan, _Plugin);
  4305. function Magellan() {
  4306. _classCallCheck(this, Magellan);
  4307. return _possibleConstructorReturn(this, _getPrototypeOf(Magellan).apply(this, arguments));
  4308. }
  4309. _createClass(Magellan, [{
  4310. key: "_setup",
  4311. /**
  4312. * Creates a new instance of Magellan.
  4313. * @class
  4314. * @name Magellan
  4315. * @fires Magellan#init
  4316. * @param {Object} element - jQuery object to add the trigger to.
  4317. * @param {Object} options - Overrides to the default plugin settings.
  4318. */
  4319. value: function _setup(element, options) {
  4320. this.$element = element;
  4321. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Magellan.defaults, this.$element.data(), options);
  4322. this.className = 'Magellan'; // ie9 back compat
  4323. this._init();
  4324. this.calcPoints();
  4325. }
  4326. /**
  4327. * Initializes the Magellan plugin and calls functions to get equalizer functioning on load.
  4328. * @private
  4329. */
  4330. }, {
  4331. key: "_init",
  4332. value: function _init() {
  4333. var id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, 'magellan');
  4334. var _this = this;
  4335. this.$targets = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-magellan-target]');
  4336. this.$links = this.$element.find('a');
  4337. this.$element.attr({
  4338. 'data-resize': id,
  4339. 'data-scroll': id,
  4340. 'id': id
  4341. });
  4342. this.$active = jquery__WEBPACK_IMPORTED_MODULE_0___default()();
  4343. this.scrollPos = parseInt(window.pageYOffset, 10);
  4344. this._events();
  4345. }
  4346. /**
  4347. * Calculates an array of pixel values that are the demarcation lines between locations on the page.
  4348. * Can be invoked if new elements are added or the size of a location changes.
  4349. * @function
  4350. */
  4351. }, {
  4352. key: "calcPoints",
  4353. value: function calcPoints() {
  4354. var _this = this,
  4355. body = document.body,
  4356. html = document.documentElement;
  4357. this.points = [];
  4358. this.winHeight = Math.round(Math.max(window.innerHeight, html.clientHeight));
  4359. this.docHeight = Math.round(Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight));
  4360. this.$targets.each(function () {
  4361. var $tar = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  4362. pt = Math.round($tar.offset().top - _this.options.threshold);
  4363. $tar.targetPoint = pt;
  4364. _this.points.push(pt);
  4365. });
  4366. }
  4367. /**
  4368. * Initializes events for Magellan.
  4369. * @private
  4370. */
  4371. }, {
  4372. key: "_events",
  4373. value: function _events() {
  4374. var _this = this,
  4375. $body = jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body'),
  4376. opts = {
  4377. duration: _this.options.animationDuration,
  4378. easing: _this.options.animationEasing
  4379. };
  4380. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).one('load', function () {
  4381. if (_this.options.deepLinking) {
  4382. if (location.hash) {
  4383. _this.scrollToLoc(location.hash);
  4384. }
  4385. }
  4386. _this.calcPoints();
  4387. _this._updateActive();
  4388. });
  4389. _this.onLoadListener = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () {
  4390. _this.$element.on({
  4391. 'resizeme.zf.trigger': _this.reflow.bind(_this),
  4392. 'scrollme.zf.trigger': _this._updateActive.bind(_this)
  4393. }).on('click.zf.magellan', 'a[href^="#"]', function (e) {
  4394. e.preventDefault();
  4395. var arrival = this.getAttribute('href');
  4396. _this.scrollToLoc(arrival);
  4397. });
  4398. });
  4399. this._deepLinkScroll = function (e) {
  4400. if (_this.options.deepLinking) {
  4401. _this.scrollToLoc(window.location.hash);
  4402. }
  4403. };
  4404. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('hashchange', this._deepLinkScroll);
  4405. }
  4406. /**
  4407. * Function to scroll to a given location on the page.
  4408. * @param {String} loc - a properly formatted jQuery id selector. Example: '#foo'
  4409. * @function
  4410. */
  4411. }, {
  4412. key: "scrollToLoc",
  4413. value: function scrollToLoc(loc) {
  4414. this._inTransition = true;
  4415. var _this = this;
  4416. var options = {
  4417. animationEasing: this.options.animationEasing,
  4418. animationDuration: this.options.animationDuration,
  4419. threshold: this.options.threshold,
  4420. offset: this.options.offset
  4421. };
  4422. _foundation_smoothScroll__WEBPACK_IMPORTED_MODULE_3__["SmoothScroll"].scrollToLoc(loc, options, function () {
  4423. _this._inTransition = false;
  4424. });
  4425. }
  4426. /**
  4427. * Calls necessary functions to update Magellan upon DOM change
  4428. * @function
  4429. */
  4430. }, {
  4431. key: "reflow",
  4432. value: function reflow() {
  4433. this.calcPoints();
  4434. this._updateActive();
  4435. }
  4436. /**
  4437. * Updates the visibility of an active location link, and updates the url hash for the page, if deepLinking enabled.
  4438. * @private
  4439. * @function
  4440. * @fires Magellan#update
  4441. */
  4442. }, {
  4443. key: "_updateActive",
  4444. value: function _updateActive()
  4445. /*evt, elem, scrollPos*/
  4446. {
  4447. var _this2 = this;
  4448. if (this._inTransition) return;
  4449. var newScrollPos = parseInt(window.pageYOffset, 10);
  4450. var isScrollingUp = this.scrollPos > newScrollPos;
  4451. this.scrollPos = newScrollPos;
  4452. var activeIdx; // Before the first point: no link
  4453. if (newScrollPos < this.points[0]) {}
  4454. /* do nothing */
  4455. // At the bottom of the page: last link
  4456. else if (newScrollPos + this.winHeight === this.docHeight) {
  4457. activeIdx = this.points.length - 1;
  4458. } // Otherwhise, use the last visible link
  4459. else {
  4460. var visibleLinks = this.points.filter(function (p, i) {
  4461. return p - _this2.options.offset - (isScrollingUp ? _this2.options.threshold : 0) <= newScrollPos;
  4462. });
  4463. activeIdx = visibleLinks.length ? visibleLinks.length - 1 : 0;
  4464. } // Get the new active link
  4465. var $oldActive = this.$active;
  4466. var activeHash = '';
  4467. if (typeof activeIdx !== 'undefined') {
  4468. this.$active = this.$links.filter('[href="#' + this.$targets.eq(activeIdx).data('magellan-target') + '"]');
  4469. if (this.$active.length) activeHash = this.$active[0].getAttribute('href');
  4470. } else {
  4471. this.$active = jquery__WEBPACK_IMPORTED_MODULE_0___default()();
  4472. }
  4473. var isNewActive = !(!this.$active.length && !$oldActive.length) && !this.$active.is($oldActive);
  4474. var isNewHash = activeHash !== window.location.hash; // Update the active link element
  4475. if (isNewActive) {
  4476. $oldActive.removeClass(this.options.activeClass);
  4477. this.$active.addClass(this.options.activeClass);
  4478. } // Update the hash (it may have changed with the same active link)
  4479. if (this.options.deepLinking && isNewHash) {
  4480. if (window.history.pushState) {
  4481. // Set or remove the hash (see: https://stackoverflow.com/a/5298684/4317384
  4482. var url = activeHash ? activeHash : window.location.pathname + window.location.search;
  4483. window.history.pushState(null, null, url);
  4484. } else {
  4485. window.location.hash = activeHash;
  4486. }
  4487. }
  4488. if (isNewActive) {
  4489. /**
  4490. * Fires when magellan is finished updating to the new active element.
  4491. * @event Magellan#update
  4492. */
  4493. this.$element.trigger('update.zf.magellan', [this.$active]);
  4494. }
  4495. }
  4496. /**
  4497. * Destroys an instance of Magellan and resets the url of the window.
  4498. * @function
  4499. */
  4500. }, {
  4501. key: "_destroy",
  4502. value: function _destroy() {
  4503. this.$element.off('.zf.trigger .zf.magellan').find(".".concat(this.options.activeClass)).removeClass(this.options.activeClass);
  4504. if (this.options.deepLinking) {
  4505. var hash = this.$active[0].getAttribute('href');
  4506. window.location.hash.replace(hash, '');
  4507. }
  4508. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('hashchange', this._deepLinkScroll);
  4509. if (this.onLoadListener) jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener);
  4510. }
  4511. }]);
  4512. return Magellan;
  4513. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__["Plugin"]);
  4514. /**
  4515. * Default settings for plugin
  4516. */
  4517. Magellan.defaults = {
  4518. /**
  4519. * Amount of time, in ms, the animated scrolling should take between locations.
  4520. * @option
  4521. * @type {number}
  4522. * @default 500
  4523. */
  4524. animationDuration: 500,
  4525. /**
  4526. * Animation style to use when scrolling between locations. Can be `'swing'` or `'linear'`.
  4527. * @option
  4528. * @type {string}
  4529. * @default 'linear'
  4530. * @see {@link https://api.jquery.com/animate|Jquery animate}
  4531. */
  4532. animationEasing: 'linear',
  4533. /**
  4534. * Number of pixels to use as a marker for location changes.
  4535. * @option
  4536. * @type {number}
  4537. * @default 50
  4538. */
  4539. threshold: 50,
  4540. /**
  4541. * Class applied to the active locations link on the magellan container.
  4542. * @option
  4543. * @type {string}
  4544. * @default 'is-active'
  4545. */
  4546. activeClass: 'is-active',
  4547. /**
  4548. * Allows the script to manipulate the url of the current page, and if supported, alter the history.
  4549. * @option
  4550. * @type {boolean}
  4551. * @default false
  4552. */
  4553. deepLinking: false,
  4554. /**
  4555. * Number of pixels to offset the scroll of the page on item click if using a sticky nav bar.
  4556. * @option
  4557. * @type {number}
  4558. * @default 0
  4559. */
  4560. offset: 0
  4561. };
  4562. /***/ }),
  4563. /***/ "./js/foundation.offcanvas.js":
  4564. /*!************************************!*\
  4565. !*** ./js/foundation.offcanvas.js ***!
  4566. \************************************/
  4567. /*! exports provided: OffCanvas */
  4568. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4569. "use strict";
  4570. __webpack_require__.r(__webpack_exports__);
  4571. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OffCanvas", function() { return OffCanvas; });
  4572. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  4573. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  4574. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  4575. /* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js");
  4576. /* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js");
  4577. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  4578. /* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js");
  4579. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  4580. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4581. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  4582. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  4583. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  4584. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  4585. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  4586. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  4587. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  4588. /**
  4589. * OffCanvas module.
  4590. * @module foundation.offcanvas
  4591. * @requires foundation.util.keyboard
  4592. * @requires foundation.util.mediaQuery
  4593. * @requires foundation.util.triggers
  4594. */
  4595. var OffCanvas =
  4596. /*#__PURE__*/
  4597. function (_Plugin) {
  4598. _inherits(OffCanvas, _Plugin);
  4599. function OffCanvas() {
  4600. _classCallCheck(this, OffCanvas);
  4601. return _possibleConstructorReturn(this, _getPrototypeOf(OffCanvas).apply(this, arguments));
  4602. }
  4603. _createClass(OffCanvas, [{
  4604. key: "_setup",
  4605. /**
  4606. * Creates a new instance of an off-canvas wrapper.
  4607. * @class
  4608. * @name OffCanvas
  4609. * @fires OffCanvas#init
  4610. * @param {Object} element - jQuery object to initialize.
  4611. * @param {Object} options - Overrides to the default plugin settings.
  4612. */
  4613. value: function _setup(element, options) {
  4614. var _this2 = this;
  4615. this.className = 'OffCanvas'; // ie9 back compat
  4616. this.$element = element;
  4617. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, OffCanvas.defaults, this.$element.data(), options);
  4618. this.contentClasses = {
  4619. base: [],
  4620. reveal: []
  4621. };
  4622. this.$lastTrigger = jquery__WEBPACK_IMPORTED_MODULE_0___default()();
  4623. this.$triggers = jquery__WEBPACK_IMPORTED_MODULE_0___default()();
  4624. this.position = 'left';
  4625. this.$content = jquery__WEBPACK_IMPORTED_MODULE_0___default()();
  4626. this.nested = !!this.options.nested; // Defines the CSS transition/position classes of the off-canvas content container.
  4627. jquery__WEBPACK_IMPORTED_MODULE_0___default()(['push', 'overlap']).each(function (index, val) {
  4628. _this2.contentClasses.base.push('has-transition-' + val);
  4629. });
  4630. jquery__WEBPACK_IMPORTED_MODULE_0___default()(['left', 'right', 'top', 'bottom']).each(function (index, val) {
  4631. _this2.contentClasses.base.push('has-position-' + val);
  4632. _this2.contentClasses.reveal.push('has-reveal-' + val);
  4633. }); // Triggers init is idempotent, just need to make sure it is initialized
  4634. _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_5__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
  4635. _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__["MediaQuery"]._init();
  4636. this._init();
  4637. this._events();
  4638. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].register('OffCanvas', {
  4639. 'ESCAPE': 'close'
  4640. });
  4641. }
  4642. /**
  4643. * Initializes the off-canvas wrapper by adding the exit overlay (if needed).
  4644. * @function
  4645. * @private
  4646. */
  4647. }, {
  4648. key: "_init",
  4649. value: function _init() {
  4650. var id = this.$element.attr('id');
  4651. this.$element.attr('aria-hidden', 'true'); // Find off-canvas content, either by ID (if specified), by siblings or by closest selector (fallback)
  4652. if (this.options.contentId) {
  4653. this.$content = jquery__WEBPACK_IMPORTED_MODULE_0___default()('#' + this.options.contentId);
  4654. } else if (this.$element.siblings('[data-off-canvas-content]').length) {
  4655. this.$content = this.$element.siblings('[data-off-canvas-content]').first();
  4656. } else {
  4657. this.$content = this.$element.closest('[data-off-canvas-content]').first();
  4658. }
  4659. if (!this.options.contentId) {
  4660. // Assume that the off-canvas element is nested if it isn't a sibling of the content
  4661. this.nested = this.$element.siblings('[data-off-canvas-content]').length === 0;
  4662. } else if (this.options.contentId && this.options.nested === null) {
  4663. // Warning if using content ID without setting the nested option
  4664. // Once the element is nested it is required to work properly in this case
  4665. console.warn('Remember to use the nested option if using the content ID option!');
  4666. }
  4667. if (this.nested === true) {
  4668. // Force transition overlap if nested
  4669. this.options.transition = 'overlap'; // Remove appropriate classes if already assigned in markup
  4670. this.$element.removeClass('is-transition-push');
  4671. }
  4672. this.$element.addClass("is-transition-".concat(this.options.transition, " is-closed")); // Find triggers that affect this element and add aria-expanded to them
  4673. this.$triggers = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).find('[data-open="' + id + '"], [data-close="' + id + '"], [data-toggle="' + id + '"]').attr('aria-expanded', 'false').attr('aria-controls', id); // Get position by checking for related CSS class
  4674. this.position = this.$element.is('.position-left, .position-top, .position-right, .position-bottom') ? this.$element.attr('class').match(/position\-(left|top|right|bottom)/)[1] : this.position; // Add an overlay over the content if necessary
  4675. if (this.options.contentOverlay === true) {
  4676. var overlay = document.createElement('div');
  4677. var overlayPosition = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.$element).css("position") === 'fixed' ? 'is-overlay-fixed' : 'is-overlay-absolute';
  4678. overlay.setAttribute('class', 'js-off-canvas-overlay ' + overlayPosition);
  4679. this.$overlay = jquery__WEBPACK_IMPORTED_MODULE_0___default()(overlay);
  4680. if (overlayPosition === 'is-overlay-fixed') {
  4681. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.$overlay).insertAfter(this.$element);
  4682. } else {
  4683. this.$content.append(this.$overlay);
  4684. }
  4685. } // Get the revealOn option from the class.
  4686. var revealOnRegExp = new RegExp(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["RegExpEscape"])(this.options.revealClass) + '([^\\s]+)', 'g');
  4687. var revealOnClass = revealOnRegExp.exec(this.$element[0].className);
  4688. if (revealOnClass) {
  4689. this.options.isRevealed = true;
  4690. this.options.revealOn = this.options.revealOn || revealOnClass[1];
  4691. } // Ensure the `reveal-on-*` class is set.
  4692. if (this.options.isRevealed === true && this.options.revealOn) {
  4693. this.$element.first().addClass("".concat(this.options.revealClass).concat(this.options.revealOn));
  4694. this._setMQChecker();
  4695. }
  4696. if (this.options.transitionTime) {
  4697. this.$element.css('transition-duration', this.options.transitionTime);
  4698. } // Initally remove all transition/position CSS classes from off-canvas content container.
  4699. this._removeContentClasses();
  4700. }
  4701. /**
  4702. * Adds event handlers to the off-canvas wrapper and the exit overlay.
  4703. * @function
  4704. * @private
  4705. */
  4706. }, {
  4707. key: "_events",
  4708. value: function _events() {
  4709. this.$element.off('.zf.trigger .zf.offcanvas').on({
  4710. 'open.zf.trigger': this.open.bind(this),
  4711. 'close.zf.trigger': this.close.bind(this),
  4712. 'toggle.zf.trigger': this.toggle.bind(this),
  4713. 'keydown.zf.offcanvas': this._handleKeyboard.bind(this)
  4714. });
  4715. if (this.options.closeOnClick === true) {
  4716. var $target = this.options.contentOverlay ? this.$overlay : this.$content;
  4717. $target.on({
  4718. 'click.zf.offcanvas': this.close.bind(this)
  4719. });
  4720. }
  4721. }
  4722. /**
  4723. * Applies event listener for elements that will reveal at certain breakpoints.
  4724. * @private
  4725. */
  4726. }, {
  4727. key: "_setMQChecker",
  4728. value: function _setMQChecker() {
  4729. var _this = this;
  4730. this.onLoadListener = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () {
  4731. if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__["MediaQuery"].atLeast(_this.options.revealOn)) {
  4732. _this.reveal(true);
  4733. }
  4734. });
  4735. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', function () {
  4736. if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__["MediaQuery"].atLeast(_this.options.revealOn)) {
  4737. _this.reveal(true);
  4738. } else {
  4739. _this.reveal(false);
  4740. }
  4741. });
  4742. }
  4743. /**
  4744. * Removes the CSS transition/position classes of the off-canvas content container.
  4745. * Removing the classes is important when another off-canvas gets opened that uses the same content container.
  4746. * @param {Boolean} hasReveal - true if related off-canvas element is revealed.
  4747. * @private
  4748. */
  4749. }, {
  4750. key: "_removeContentClasses",
  4751. value: function _removeContentClasses(hasReveal) {
  4752. if (typeof hasReveal !== 'boolean') {
  4753. this.$content.removeClass(this.contentClasses.base.join(' '));
  4754. } else if (hasReveal === false) {
  4755. this.$content.removeClass("has-reveal-".concat(this.position));
  4756. }
  4757. }
  4758. /**
  4759. * Adds the CSS transition/position classes of the off-canvas content container, based on the opening off-canvas element.
  4760. * Beforehand any transition/position class gets removed.
  4761. * @param {Boolean} hasReveal - true if related off-canvas element is revealed.
  4762. * @private
  4763. */
  4764. }, {
  4765. key: "_addContentClasses",
  4766. value: function _addContentClasses(hasReveal) {
  4767. this._removeContentClasses(hasReveal);
  4768. if (typeof hasReveal !== 'boolean') {
  4769. this.$content.addClass("has-transition-".concat(this.options.transition, " has-position-").concat(this.position));
  4770. } else if (hasReveal === true) {
  4771. this.$content.addClass("has-reveal-".concat(this.position));
  4772. }
  4773. }
  4774. /**
  4775. * Handles the revealing/hiding the off-canvas at breakpoints, not the same as open.
  4776. * @param {Boolean} isRevealed - true if element should be revealed.
  4777. * @function
  4778. */
  4779. }, {
  4780. key: "reveal",
  4781. value: function reveal(isRevealed) {
  4782. if (isRevealed) {
  4783. this.close();
  4784. this.isRevealed = true;
  4785. this.$element.attr('aria-hidden', 'false');
  4786. this.$element.off('open.zf.trigger toggle.zf.trigger');
  4787. this.$element.removeClass('is-closed');
  4788. } else {
  4789. this.isRevealed = false;
  4790. this.$element.attr('aria-hidden', 'true');
  4791. this.$element.off('open.zf.trigger toggle.zf.trigger').on({
  4792. 'open.zf.trigger': this.open.bind(this),
  4793. 'toggle.zf.trigger': this.toggle.bind(this)
  4794. });
  4795. this.$element.addClass('is-closed');
  4796. }
  4797. this._addContentClasses(isRevealed);
  4798. }
  4799. /**
  4800. * Stops scrolling of the body when offcanvas is open on mobile Safari and other troublesome browsers.
  4801. * @private
  4802. */
  4803. }, {
  4804. key: "_stopScrolling",
  4805. value: function _stopScrolling(event) {
  4806. return false;
  4807. } // Taken and adapted from http://stackoverflow.com/questions/16889447/prevent-full-page-scrolling-ios
  4808. // Only really works for y, not sure how to extend to x or if we need to.
  4809. }, {
  4810. key: "_recordScrollable",
  4811. value: function _recordScrollable(event) {
  4812. var elem = this; // called from event handler context with this as elem
  4813. // If the element is scrollable (content overflows), then...
  4814. if (elem.scrollHeight !== elem.clientHeight) {
  4815. // If we're at the top, scroll down one pixel to allow scrolling up
  4816. if (elem.scrollTop === 0) {
  4817. elem.scrollTop = 1;
  4818. } // If we're at the bottom, scroll up one pixel to allow scrolling down
  4819. if (elem.scrollTop === elem.scrollHeight - elem.clientHeight) {
  4820. elem.scrollTop = elem.scrollHeight - elem.clientHeight - 1;
  4821. }
  4822. }
  4823. elem.allowUp = elem.scrollTop > 0;
  4824. elem.allowDown = elem.scrollTop < elem.scrollHeight - elem.clientHeight;
  4825. elem.lastY = event.originalEvent.pageY;
  4826. }
  4827. }, {
  4828. key: "_stopScrollPropagation",
  4829. value: function _stopScrollPropagation(event) {
  4830. var elem = this; // called from event handler context with this as elem
  4831. var up = event.pageY < elem.lastY;
  4832. var down = !up;
  4833. elem.lastY = event.pageY;
  4834. if (up && elem.allowUp || down && elem.allowDown) {
  4835. event.stopPropagation();
  4836. } else {
  4837. event.preventDefault();
  4838. }
  4839. }
  4840. /**
  4841. * Opens the off-canvas menu.
  4842. * @function
  4843. * @param {Object} event - Event object passed from listener.
  4844. * @param {jQuery} trigger - element that triggered the off-canvas to open.
  4845. * @fires Offcanvas#opened
  4846. * @todo also trigger 'open' event?
  4847. */
  4848. }, {
  4849. key: "open",
  4850. value: function open(event, trigger) {
  4851. if (this.$element.hasClass('is-open') || this.isRevealed) {
  4852. return;
  4853. }
  4854. var _this = this;
  4855. if (trigger) {
  4856. this.$lastTrigger = trigger;
  4857. }
  4858. if (this.options.forceTo === 'top') {
  4859. window.scrollTo(0, 0);
  4860. } else if (this.options.forceTo === 'bottom') {
  4861. window.scrollTo(0, document.body.scrollHeight);
  4862. }
  4863. if (this.options.transitionTime && this.options.transition !== 'overlap') {
  4864. this.$element.siblings('[data-off-canvas-content]').css('transition-duration', this.options.transitionTime);
  4865. } else {
  4866. this.$element.siblings('[data-off-canvas-content]').css('transition-duration', '');
  4867. }
  4868. this.$element.addClass('is-open').removeClass('is-closed');
  4869. this.$triggers.attr('aria-expanded', 'true');
  4870. this.$element.attr('aria-hidden', 'false');
  4871. this.$content.addClass('is-open-' + this.position); // If `contentScroll` is set to false, add class and disable scrolling on touch devices.
  4872. if (this.options.contentScroll === false) {
  4873. jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').addClass('is-off-canvas-open').on('touchmove', this._stopScrolling);
  4874. this.$element.on('touchstart', this._recordScrollable);
  4875. this.$element.on('touchmove', this._stopScrollPropagation);
  4876. }
  4877. if (this.options.contentOverlay === true) {
  4878. this.$overlay.addClass('is-visible');
  4879. }
  4880. if (this.options.closeOnClick === true && this.options.contentOverlay === true) {
  4881. this.$overlay.addClass('is-closable');
  4882. }
  4883. if (this.options.autoFocus === true) {
  4884. this.$element.one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["transitionend"])(this.$element), function () {
  4885. if (!_this.$element.hasClass('is-open')) {
  4886. return; // exit if prematurely closed
  4887. }
  4888. var canvasFocus = _this.$element.find('[data-autofocus]');
  4889. if (canvasFocus.length) {
  4890. canvasFocus.eq(0).focus();
  4891. } else {
  4892. _this.$element.find('a, button').eq(0).focus();
  4893. }
  4894. });
  4895. }
  4896. if (this.options.trapFocus === true) {
  4897. this.$content.attr('tabindex', '-1');
  4898. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].trapFocus(this.$element);
  4899. }
  4900. this._addContentClasses();
  4901. /**
  4902. * Fires when the off-canvas menu opens.
  4903. * @event Offcanvas#opened
  4904. */
  4905. this.$element.trigger('opened.zf.offcanvas');
  4906. }
  4907. /**
  4908. * Closes the off-canvas menu.
  4909. * @function
  4910. * @param {Function} cb - optional cb to fire after closure.
  4911. * @fires Offcanvas#closed
  4912. */
  4913. }, {
  4914. key: "close",
  4915. value: function close(cb) {
  4916. if (!this.$element.hasClass('is-open') || this.isRevealed) {
  4917. return;
  4918. }
  4919. var _this = this;
  4920. this.$element.removeClass('is-open');
  4921. this.$element.attr('aria-hidden', 'true')
  4922. /**
  4923. * Fires when the off-canvas menu opens.
  4924. * @event Offcanvas#closed
  4925. */
  4926. .trigger('closed.zf.offcanvas');
  4927. this.$content.removeClass('is-open-left is-open-top is-open-right is-open-bottom'); // If `contentScroll` is set to false, remove class and re-enable scrolling on touch devices.
  4928. if (this.options.contentScroll === false) {
  4929. jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').removeClass('is-off-canvas-open').off('touchmove', this._stopScrolling);
  4930. this.$element.off('touchstart', this._recordScrollable);
  4931. this.$element.off('touchmove', this._stopScrollPropagation);
  4932. }
  4933. if (this.options.contentOverlay === true) {
  4934. this.$overlay.removeClass('is-visible');
  4935. }
  4936. if (this.options.closeOnClick === true && this.options.contentOverlay === true) {
  4937. this.$overlay.removeClass('is-closable');
  4938. }
  4939. this.$triggers.attr('aria-expanded', 'false');
  4940. if (this.options.trapFocus === true) {
  4941. this.$content.removeAttr('tabindex');
  4942. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].releaseFocus(this.$element);
  4943. } // Listen to transitionEnd and add class when done.
  4944. this.$element.one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["transitionend"])(this.$element), function (e) {
  4945. _this.$element.addClass('is-closed');
  4946. _this._removeContentClasses();
  4947. });
  4948. }
  4949. /**
  4950. * Toggles the off-canvas menu open or closed.
  4951. * @function
  4952. * @param {Object} event - Event object passed from listener.
  4953. * @param {jQuery} trigger - element that triggered the off-canvas to open.
  4954. */
  4955. }, {
  4956. key: "toggle",
  4957. value: function toggle(event, trigger) {
  4958. if (this.$element.hasClass('is-open')) {
  4959. this.close(event, trigger);
  4960. } else {
  4961. this.open(event, trigger);
  4962. }
  4963. }
  4964. /**
  4965. * Handles keyboard input when detected. When the escape key is pressed, the off-canvas menu closes, and focus is restored to the element that opened the menu.
  4966. * @function
  4967. * @private
  4968. */
  4969. }, {
  4970. key: "_handleKeyboard",
  4971. value: function _handleKeyboard(e) {
  4972. var _this3 = this;
  4973. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].handleKey(e, 'OffCanvas', {
  4974. close: function close() {
  4975. _this3.close();
  4976. _this3.$lastTrigger.focus();
  4977. return true;
  4978. },
  4979. handled: function handled() {
  4980. e.stopPropagation();
  4981. e.preventDefault();
  4982. }
  4983. });
  4984. }
  4985. /**
  4986. * Destroys the offcanvas plugin.
  4987. * @function
  4988. */
  4989. }, {
  4990. key: "_destroy",
  4991. value: function _destroy() {
  4992. this.close();
  4993. this.$element.off('.zf.trigger .zf.offcanvas');
  4994. this.$overlay.off('.zf.offcanvas');
  4995. if (this.onLoadListener) jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener);
  4996. }
  4997. }]);
  4998. return OffCanvas;
  4999. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__["Plugin"]);
  5000. OffCanvas.defaults = {
  5001. /**
  5002. * Allow the user to click outside of the menu to close it.
  5003. * @option
  5004. * @type {boolean}
  5005. * @default true
  5006. */
  5007. closeOnClick: true,
  5008. /**
  5009. * Adds an overlay on top of `[data-off-canvas-content]`.
  5010. * @option
  5011. * @type {boolean}
  5012. * @default true
  5013. */
  5014. contentOverlay: true,
  5015. /**
  5016. * Target an off-canvas content container by ID that may be placed anywhere. If null the closest content container will be taken.
  5017. * @option
  5018. * @type {?string}
  5019. * @default null
  5020. */
  5021. contentId: null,
  5022. /**
  5023. * Define the off-canvas element is nested in an off-canvas content. This is required when using the contentId option for a nested element.
  5024. * @option
  5025. * @type {boolean}
  5026. * @default null
  5027. */
  5028. nested: null,
  5029. /**
  5030. * Enable/disable scrolling of the main content when an off canvas panel is open.
  5031. * @option
  5032. * @type {boolean}
  5033. * @default true
  5034. */
  5035. contentScroll: true,
  5036. /**
  5037. * Amount of time in ms the open and close transition requires. If none selected, pulls from body style.
  5038. * @option
  5039. * @type {number}
  5040. * @default null
  5041. */
  5042. transitionTime: null,
  5043. /**
  5044. * Type of transition for the offcanvas menu. Options are 'push', 'detached' or 'slide'.
  5045. * @option
  5046. * @type {string}
  5047. * @default push
  5048. */
  5049. transition: 'push',
  5050. /**
  5051. * Force the page to scroll to top or bottom on open.
  5052. * @option
  5053. * @type {?string}
  5054. * @default null
  5055. */
  5056. forceTo: null,
  5057. /**
  5058. * Allow the offcanvas to remain open for certain breakpoints.
  5059. * @option
  5060. * @type {boolean}
  5061. * @default false
  5062. */
  5063. isRevealed: false,
  5064. /**
  5065. * Breakpoint at which to reveal. JS will use a RegExp to target standard classes, if changing classnames, pass your class with the `revealClass` option.
  5066. * @option
  5067. * @type {?string}
  5068. * @default null
  5069. */
  5070. revealOn: null,
  5071. /**
  5072. * Force focus to the offcanvas on open. If true, will focus the opening trigger on close.
  5073. * @option
  5074. * @type {boolean}
  5075. * @default true
  5076. */
  5077. autoFocus: true,
  5078. /**
  5079. * Class used to force an offcanvas to remain open. Foundation defaults for this are `reveal-for-large` & `reveal-for-medium`.
  5080. * @option
  5081. * @type {string}
  5082. * @default reveal-for-
  5083. * @todo improve the regex testing for this.
  5084. */
  5085. revealClass: 'reveal-for-',
  5086. /**
  5087. * Triggers optional focus trapping when opening an offcanvas. Sets tabindex of [data-off-canvas-content] to -1 for accessibility purposes.
  5088. * @option
  5089. * @type {boolean}
  5090. * @default false
  5091. */
  5092. trapFocus: false
  5093. };
  5094. /***/ }),
  5095. /***/ "./js/foundation.orbit.js":
  5096. /*!********************************!*\
  5097. !*** ./js/foundation.orbit.js ***!
  5098. \********************************/
  5099. /*! exports provided: Orbit */
  5100. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5101. "use strict";
  5102. __webpack_require__.r(__webpack_exports__);
  5103. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Orbit", function() { return Orbit; });
  5104. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  5105. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  5106. /* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js");
  5107. /* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js");
  5108. /* harmony import */ var _foundation_util_timer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.timer */ "./js/foundation.util.timer.js");
  5109. /* harmony import */ var _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.imageLoader */ "./js/foundation.util.imageLoader.js");
  5110. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  5111. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  5112. /* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./foundation.util.touch */ "./js/foundation.util.touch.js");
  5113. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  5114. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5115. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  5116. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  5117. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  5118. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  5119. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  5120. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  5121. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  5122. /**
  5123. * Orbit module.
  5124. * @module foundation.orbit
  5125. * @requires foundation.util.keyboard
  5126. * @requires foundation.util.motion
  5127. * @requires foundation.util.timer
  5128. * @requires foundation.util.imageLoader
  5129. * @requires foundation.util.touch
  5130. */
  5131. var Orbit =
  5132. /*#__PURE__*/
  5133. function (_Plugin) {
  5134. _inherits(Orbit, _Plugin);
  5135. function Orbit() {
  5136. _classCallCheck(this, Orbit);
  5137. return _possibleConstructorReturn(this, _getPrototypeOf(Orbit).apply(this, arguments));
  5138. }
  5139. _createClass(Orbit, [{
  5140. key: "_setup",
  5141. /**
  5142. * Creates a new instance of an orbit carousel.
  5143. * @class
  5144. * @name Orbit
  5145. * @param {jQuery} element - jQuery object to make into an Orbit Carousel.
  5146. * @param {Object} options - Overrides to the default plugin settings.
  5147. */
  5148. value: function _setup(element, options) {
  5149. this.$element = element;
  5150. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Orbit.defaults, this.$element.data(), options);
  5151. this.className = 'Orbit'; // ie9 back compat
  5152. _foundation_util_touch__WEBPACK_IMPORTED_MODULE_7__["Touch"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); // Touch init is idempotent, we just need to make sure it's initialied.
  5153. this._init();
  5154. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('Orbit', {
  5155. 'ltr': {
  5156. 'ARROW_RIGHT': 'next',
  5157. 'ARROW_LEFT': 'previous'
  5158. },
  5159. 'rtl': {
  5160. 'ARROW_LEFT': 'next',
  5161. 'ARROW_RIGHT': 'previous'
  5162. }
  5163. });
  5164. }
  5165. /**
  5166. * Initializes the plugin by creating jQuery collections, setting attributes, and starting the animation.
  5167. * @function
  5168. * @private
  5169. */
  5170. }, {
  5171. key: "_init",
  5172. value: function _init() {
  5173. // @TODO: consider discussion on PR #9278 about DOM pollution by changeSlide
  5174. this._reset();
  5175. this.$wrapper = this.$element.find(".".concat(this.options.containerClass));
  5176. this.$slides = this.$element.find(".".concat(this.options.slideClass));
  5177. var $images = this.$element.find('img'),
  5178. initActive = this.$slides.filter('.is-active'),
  5179. id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_5__["GetYoDigits"])(6, 'orbit');
  5180. this.$element.attr({
  5181. 'data-resize': id,
  5182. 'id': id
  5183. });
  5184. if (!initActive.length) {
  5185. this.$slides.eq(0).addClass('is-active');
  5186. }
  5187. if (!this.options.useMUI) {
  5188. this.$slides.addClass('no-motionui');
  5189. }
  5190. if ($images.length) {
  5191. Object(_foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__["onImagesLoaded"])($images, this._prepareForOrbit.bind(this));
  5192. } else {
  5193. this._prepareForOrbit(); //hehe
  5194. }
  5195. if (this.options.bullets) {
  5196. this._loadBullets();
  5197. }
  5198. this._events();
  5199. if (this.options.autoPlay && this.$slides.length > 1) {
  5200. this.geoSync();
  5201. }
  5202. if (this.options.accessible) {
  5203. // allow wrapper to be focusable to enable arrow navigation
  5204. this.$wrapper.attr('tabindex', 0);
  5205. }
  5206. }
  5207. /**
  5208. * Creates a jQuery collection of bullets, if they are being used.
  5209. * @function
  5210. * @private
  5211. */
  5212. }, {
  5213. key: "_loadBullets",
  5214. value: function _loadBullets() {
  5215. this.$bullets = this.$element.find(".".concat(this.options.boxOfBullets)).find('button');
  5216. }
  5217. /**
  5218. * Sets a `timer` object on the orbit, and starts the counter for the next slide.
  5219. * @function
  5220. */
  5221. }, {
  5222. key: "geoSync",
  5223. value: function geoSync() {
  5224. var _this = this;
  5225. this.timer = new _foundation_util_timer__WEBPACK_IMPORTED_MODULE_3__["Timer"](this.$element, {
  5226. duration: this.options.timerDelay,
  5227. infinite: false
  5228. }, function () {
  5229. _this.changeSlide(true);
  5230. });
  5231. this.timer.start();
  5232. }
  5233. /**
  5234. * Sets wrapper and slide heights for the orbit.
  5235. * @function
  5236. * @private
  5237. */
  5238. }, {
  5239. key: "_prepareForOrbit",
  5240. value: function _prepareForOrbit() {
  5241. var _this = this;
  5242. this._setWrapperHeight();
  5243. }
  5244. /**
  5245. * Calulates the height of each slide in the collection, and uses the tallest one for the wrapper height.
  5246. * @function
  5247. * @private
  5248. * @param {Function} cb - a callback function to fire when complete.
  5249. */
  5250. }, {
  5251. key: "_setWrapperHeight",
  5252. value: function _setWrapperHeight(cb) {
  5253. //rewrite this to `for` loop
  5254. var max = 0,
  5255. temp,
  5256. counter = 0,
  5257. _this = this;
  5258. this.$slides.each(function () {
  5259. temp = this.getBoundingClientRect().height;
  5260. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('data-slide', counter); // hide all slides but the active one
  5261. if (!/mui/g.test(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)[0].className) && _this.$slides.filter('.is-active')[0] !== _this.$slides.eq(counter)[0]) {
  5262. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).css({
  5263. 'display': 'none'
  5264. });
  5265. }
  5266. max = temp > max ? temp : max;
  5267. counter++;
  5268. });
  5269. if (counter === this.$slides.length) {
  5270. this.$wrapper.css({
  5271. 'height': max
  5272. }); //only change the wrapper height property once.
  5273. if (cb) {
  5274. cb(max);
  5275. } //fire callback with max height dimension.
  5276. }
  5277. }
  5278. /**
  5279. * Sets the max-height of each slide.
  5280. * @function
  5281. * @private
  5282. */
  5283. }, {
  5284. key: "_setSlideHeight",
  5285. value: function _setSlideHeight(height) {
  5286. this.$slides.each(function () {
  5287. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).css('max-height', height);
  5288. });
  5289. }
  5290. /**
  5291. * Adds event listeners to basically everything within the element.
  5292. * @function
  5293. * @private
  5294. */
  5295. }, {
  5296. key: "_events",
  5297. value: function _events() {
  5298. var _this = this; //***************************************
  5299. //**Now using custom event - thanks to:**
  5300. //** Yohai Ararat of Toronto **
  5301. //***************************************
  5302. //
  5303. this.$element.off('.resizeme.zf.trigger').on({
  5304. 'resizeme.zf.trigger': this._prepareForOrbit.bind(this)
  5305. });
  5306. if (this.$slides.length > 1) {
  5307. if (this.options.swipe) {
  5308. this.$slides.off('swipeleft.zf.orbit swiperight.zf.orbit').on('swipeleft.zf.orbit', function (e) {
  5309. e.preventDefault();
  5310. _this.changeSlide(true);
  5311. }).on('swiperight.zf.orbit', function (e) {
  5312. e.preventDefault();
  5313. _this.changeSlide(false);
  5314. });
  5315. } //***************************************
  5316. if (this.options.autoPlay) {
  5317. this.$slides.on('click.zf.orbit', function () {
  5318. _this.$element.data('clickedOn', _this.$element.data('clickedOn') ? false : true);
  5319. _this.timer[_this.$element.data('clickedOn') ? 'pause' : 'start']();
  5320. });
  5321. if (this.options.pauseOnHover) {
  5322. this.$element.on('mouseenter.zf.orbit', function () {
  5323. _this.timer.pause();
  5324. }).on('mouseleave.zf.orbit', function () {
  5325. if (!_this.$element.data('clickedOn')) {
  5326. _this.timer.start();
  5327. }
  5328. });
  5329. }
  5330. }
  5331. if (this.options.navButtons) {
  5332. var $controls = this.$element.find(".".concat(this.options.nextClass, ", .").concat(this.options.prevClass));
  5333. $controls.attr('tabindex', 0) //also need to handle enter/return and spacebar key presses
  5334. .on('click.zf.orbit touchend.zf.orbit', function (e) {
  5335. e.preventDefault();
  5336. _this.changeSlide(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).hasClass(_this.options.nextClass));
  5337. });
  5338. }
  5339. if (this.options.bullets) {
  5340. this.$bullets.on('click.zf.orbit touchend.zf.orbit', function () {
  5341. if (/is-active/g.test(this.className)) {
  5342. return false;
  5343. } //if this is active, kick out of function.
  5344. var idx = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('slide'),
  5345. ltr = idx > _this.$slides.filter('.is-active').data('slide'),
  5346. $slide = _this.$slides.eq(idx);
  5347. _this.changeSlide(ltr, $slide, idx);
  5348. });
  5349. }
  5350. if (this.options.accessible) {
  5351. this.$wrapper.add(this.$bullets).on('keydown.zf.orbit', function (e) {
  5352. // handle keyboard event with keyboard util
  5353. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'Orbit', {
  5354. next: function next() {
  5355. _this.changeSlide(true);
  5356. },
  5357. previous: function previous() {
  5358. _this.changeSlide(false);
  5359. },
  5360. handled: function handled() {
  5361. // if bullet is focused, make sure focus moves
  5362. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).is(_this.$bullets)) {
  5363. _this.$bullets.filter('.is-active').focus();
  5364. }
  5365. }
  5366. });
  5367. });
  5368. }
  5369. }
  5370. }
  5371. /**
  5372. * Resets Orbit so it can be reinitialized
  5373. */
  5374. }, {
  5375. key: "_reset",
  5376. value: function _reset() {
  5377. // Don't do anything if there are no slides (first run)
  5378. if (typeof this.$slides == 'undefined') {
  5379. return;
  5380. }
  5381. if (this.$slides.length > 1) {
  5382. // Remove old events
  5383. this.$element.off('.zf.orbit').find('*').off('.zf.orbit'); // Restart timer if autoPlay is enabled
  5384. if (this.options.autoPlay) {
  5385. this.timer.restart();
  5386. } // Reset all sliddes
  5387. this.$slides.each(function (el) {
  5388. jquery__WEBPACK_IMPORTED_MODULE_0___default()(el).removeClass('is-active is-active is-in').removeAttr('aria-live').hide();
  5389. }); // Show the first slide
  5390. this.$slides.first().addClass('is-active').show(); // Triggers when the slide has finished animating
  5391. this.$element.trigger('slidechange.zf.orbit', [this.$slides.first()]); // Select first bullet if bullets are present
  5392. if (this.options.bullets) {
  5393. this._updateBullets(0);
  5394. }
  5395. }
  5396. }
  5397. /**
  5398. * Changes the current slide to a new one.
  5399. * @function
  5400. * @param {Boolean} isLTR - if true the slide moves from right to left, if false the slide moves from left to right.
  5401. * @param {jQuery} chosenSlide - the jQuery element of the slide to show next, if one is selected.
  5402. * @param {Number} idx - the index of the new slide in its collection, if one chosen.
  5403. * @fires Orbit#slidechange
  5404. */
  5405. }, {
  5406. key: "changeSlide",
  5407. value: function changeSlide(isLTR, chosenSlide, idx) {
  5408. if (!this.$slides) {
  5409. return;
  5410. } // Don't freak out if we're in the middle of cleanup
  5411. var $curSlide = this.$slides.filter('.is-active').eq(0);
  5412. if (/mui/g.test($curSlide[0].className)) {
  5413. return false;
  5414. } //if the slide is currently animating, kick out of the function
  5415. var $firstSlide = this.$slides.first(),
  5416. $lastSlide = this.$slides.last(),
  5417. dirIn = isLTR ? 'Right' : 'Left',
  5418. dirOut = isLTR ? 'Left' : 'Right',
  5419. _this = this,
  5420. $newSlide;
  5421. if (!chosenSlide) {
  5422. //most of the time, this will be auto played or clicked from the navButtons.
  5423. $newSlide = isLTR ? //if wrapping enabled, check to see if there is a `next` or `prev` sibling, if not, select the first or last slide to fill in. if wrapping not enabled, attempt to select `next` or `prev`, if there's nothing there, the function will kick out on next step. CRAZY NESTED TERNARIES!!!!!
  5424. this.options.infiniteWrap ? $curSlide.next(".".concat(this.options.slideClass)).length ? $curSlide.next(".".concat(this.options.slideClass)) : $firstSlide : $curSlide.next(".".concat(this.options.slideClass)) : //pick next slide if moving left to right
  5425. this.options.infiniteWrap ? $curSlide.prev(".".concat(this.options.slideClass)).length ? $curSlide.prev(".".concat(this.options.slideClass)) : $lastSlide : $curSlide.prev(".".concat(this.options.slideClass)); //pick prev slide if moving right to left
  5426. } else {
  5427. $newSlide = chosenSlide;
  5428. }
  5429. if ($newSlide.length) {
  5430. /**
  5431. * Triggers before the next slide starts animating in and only if a next slide has been found.
  5432. * @event Orbit#beforeslidechange
  5433. */
  5434. this.$element.trigger('beforeslidechange.zf.orbit', [$curSlide, $newSlide]);
  5435. if (this.options.bullets) {
  5436. idx = idx || this.$slides.index($newSlide); //grab index to update bullets
  5437. this._updateBullets(idx);
  5438. }
  5439. if (this.options.useMUI && !this.$element.is(':hidden')) {
  5440. _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateIn($newSlide.addClass('is-active'), this.options["animInFrom".concat(dirIn)], function () {
  5441. $newSlide.css({
  5442. 'display': 'block'
  5443. }).attr('aria-live', 'polite');
  5444. });
  5445. _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateOut($curSlide.removeClass('is-active'), this.options["animOutTo".concat(dirOut)], function () {
  5446. $curSlide.removeAttr('aria-live');
  5447. if (_this.options.autoPlay && !_this.timer.isPaused) {
  5448. _this.timer.restart();
  5449. } //do stuff?
  5450. });
  5451. } else {
  5452. $curSlide.removeClass('is-active is-in').removeAttr('aria-live').hide();
  5453. $newSlide.addClass('is-active is-in').attr('aria-live', 'polite').show();
  5454. if (this.options.autoPlay && !this.timer.isPaused) {
  5455. this.timer.restart();
  5456. }
  5457. }
  5458. /**
  5459. * Triggers when the slide has finished animating in.
  5460. * @event Orbit#slidechange
  5461. */
  5462. this.$element.trigger('slidechange.zf.orbit', [$newSlide]);
  5463. }
  5464. }
  5465. /**
  5466. * Updates the active state of the bullets, if displayed.
  5467. * @function
  5468. * @private
  5469. * @param {Number} idx - the index of the current slide.
  5470. */
  5471. }, {
  5472. key: "_updateBullets",
  5473. value: function _updateBullets(idx) {
  5474. var $oldBullet = this.$element.find(".".concat(this.options.boxOfBullets)).find('.is-active').removeClass('is-active').blur(),
  5475. span = $oldBullet.find('span:last').detach(),
  5476. $newBullet = this.$bullets.eq(idx).addClass('is-active').append(span);
  5477. }
  5478. /**
  5479. * Destroys the carousel and hides the element.
  5480. * @function
  5481. */
  5482. }, {
  5483. key: "_destroy",
  5484. value: function _destroy() {
  5485. this.$element.off('.zf.orbit').find('*').off('.zf.orbit').end().hide();
  5486. }
  5487. }]);
  5488. return Orbit;
  5489. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_6__["Plugin"]);
  5490. Orbit.defaults = {
  5491. /**
  5492. * Tells the JS to look for and loadBullets.
  5493. * @option
  5494. * @type {boolean}
  5495. * @default true
  5496. */
  5497. bullets: true,
  5498. /**
  5499. * Tells the JS to apply event listeners to nav buttons
  5500. * @option
  5501. * @type {boolean}
  5502. * @default true
  5503. */
  5504. navButtons: true,
  5505. /**
  5506. * motion-ui animation class to apply
  5507. * @option
  5508. * @type {string}
  5509. * @default 'slide-in-right'
  5510. */
  5511. animInFromRight: 'slide-in-right',
  5512. /**
  5513. * motion-ui animation class to apply
  5514. * @option
  5515. * @type {string}
  5516. * @default 'slide-out-right'
  5517. */
  5518. animOutToRight: 'slide-out-right',
  5519. /**
  5520. * motion-ui animation class to apply
  5521. * @option
  5522. * @type {string}
  5523. * @default 'slide-in-left'
  5524. *
  5525. */
  5526. animInFromLeft: 'slide-in-left',
  5527. /**
  5528. * motion-ui animation class to apply
  5529. * @option
  5530. * @type {string}
  5531. * @default 'slide-out-left'
  5532. */
  5533. animOutToLeft: 'slide-out-left',
  5534. /**
  5535. * Allows Orbit to automatically animate on page load.
  5536. * @option
  5537. * @type {boolean}
  5538. * @default true
  5539. */
  5540. autoPlay: true,
  5541. /**
  5542. * Amount of time, in ms, between slide transitions
  5543. * @option
  5544. * @type {number}
  5545. * @default 5000
  5546. */
  5547. timerDelay: 5000,
  5548. /**
  5549. * Allows Orbit to infinitely loop through the slides
  5550. * @option
  5551. * @type {boolean}
  5552. * @default true
  5553. */
  5554. infiniteWrap: true,
  5555. /**
  5556. * Allows the Orbit slides to bind to swipe events for mobile, requires an additional util library
  5557. * @option
  5558. * @type {boolean}
  5559. * @default true
  5560. */
  5561. swipe: true,
  5562. /**
  5563. * Allows the timing function to pause animation on hover.
  5564. * @option
  5565. * @type {boolean}
  5566. * @default true
  5567. */
  5568. pauseOnHover: true,
  5569. /**
  5570. * Allows Orbit to bind keyboard events to the slider, to animate frames with arrow keys
  5571. * @option
  5572. * @type {boolean}
  5573. * @default true
  5574. */
  5575. accessible: true,
  5576. /**
  5577. * Class applied to the container of Orbit
  5578. * @option
  5579. * @type {string}
  5580. * @default 'orbit-container'
  5581. */
  5582. containerClass: 'orbit-container',
  5583. /**
  5584. * Class applied to individual slides.
  5585. * @option
  5586. * @type {string}
  5587. * @default 'orbit-slide'
  5588. */
  5589. slideClass: 'orbit-slide',
  5590. /**
  5591. * Class applied to the bullet container. You're welcome.
  5592. * @option
  5593. * @type {string}
  5594. * @default 'orbit-bullets'
  5595. */
  5596. boxOfBullets: 'orbit-bullets',
  5597. /**
  5598. * Class applied to the `next` navigation button.
  5599. * @option
  5600. * @type {string}
  5601. * @default 'orbit-next'
  5602. */
  5603. nextClass: 'orbit-next',
  5604. /**
  5605. * Class applied to the `previous` navigation button.
  5606. * @option
  5607. * @type {string}
  5608. * @default 'orbit-previous'
  5609. */
  5610. prevClass: 'orbit-previous',
  5611. /**
  5612. * Boolean to flag the js to use motion ui classes or not. Default to true for backwards compatibility.
  5613. * @option
  5614. * @type {boolean}
  5615. * @default true
  5616. */
  5617. useMUI: true
  5618. };
  5619. /***/ }),
  5620. /***/ "./js/foundation.positionable.js":
  5621. /*!***************************************!*\
  5622. !*** ./js/foundation.positionable.js ***!
  5623. \***************************************/
  5624. /*! exports provided: Positionable */
  5625. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5626. "use strict";
  5627. __webpack_require__.r(__webpack_exports__);
  5628. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Positionable", function() { return Positionable; });
  5629. /* harmony import */ var _foundation_util_box__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./foundation.util.box */ "./js/foundation.util.box.js");
  5630. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  5631. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  5632. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  5633. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5634. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  5635. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  5636. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  5637. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  5638. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  5639. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  5640. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  5641. var POSITIONS = ['left', 'right', 'top', 'bottom'];
  5642. var VERTICAL_ALIGNMENTS = ['top', 'bottom', 'center'];
  5643. var HORIZONTAL_ALIGNMENTS = ['left', 'right', 'center'];
  5644. var ALIGNMENTS = {
  5645. 'left': VERTICAL_ALIGNMENTS,
  5646. 'right': VERTICAL_ALIGNMENTS,
  5647. 'top': HORIZONTAL_ALIGNMENTS,
  5648. 'bottom': HORIZONTAL_ALIGNMENTS
  5649. };
  5650. function nextItem(item, array) {
  5651. var currentIdx = array.indexOf(item);
  5652. if (currentIdx === array.length - 1) {
  5653. return array[0];
  5654. } else {
  5655. return array[currentIdx + 1];
  5656. }
  5657. }
  5658. var Positionable =
  5659. /*#__PURE__*/
  5660. function (_Plugin) {
  5661. _inherits(Positionable, _Plugin);
  5662. function Positionable() {
  5663. _classCallCheck(this, Positionable);
  5664. return _possibleConstructorReturn(this, _getPrototypeOf(Positionable).apply(this, arguments));
  5665. }
  5666. _createClass(Positionable, [{
  5667. key: "_init",
  5668. /**
  5669. * Abstract class encapsulating the tether-like explicit positioning logic
  5670. * including repositioning based on overlap.
  5671. * Expects classes to define defaults for vOffset, hOffset, position,
  5672. * alignment, allowOverlap, and allowBottomOverlap. They can do this by
  5673. * extending the defaults, or (for now recommended due to the way docs are
  5674. * generated) by explicitly declaring them.
  5675. *
  5676. **/
  5677. value: function _init() {
  5678. this.triedPositions = {};
  5679. this.position = this.options.position === 'auto' ? this._getDefaultPosition() : this.options.position;
  5680. this.alignment = this.options.alignment === 'auto' ? this._getDefaultAlignment() : this.options.alignment;
  5681. this.originalPosition = this.position;
  5682. this.originalAlignment = this.alignment;
  5683. }
  5684. }, {
  5685. key: "_getDefaultPosition",
  5686. value: function _getDefaultPosition() {
  5687. return 'bottom';
  5688. }
  5689. }, {
  5690. key: "_getDefaultAlignment",
  5691. value: function _getDefaultAlignment() {
  5692. switch (this.position) {
  5693. case 'bottom':
  5694. case 'top':
  5695. return Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["rtl"])() ? 'right' : 'left';
  5696. case 'left':
  5697. case 'right':
  5698. return 'bottom';
  5699. }
  5700. }
  5701. /**
  5702. * Adjusts the positionable possible positions by iterating through alignments
  5703. * and positions.
  5704. * @function
  5705. * @private
  5706. */
  5707. }, {
  5708. key: "_reposition",
  5709. value: function _reposition() {
  5710. if (this._alignmentsExhausted(this.position)) {
  5711. this.position = nextItem(this.position, POSITIONS);
  5712. this.alignment = ALIGNMENTS[this.position][0];
  5713. } else {
  5714. this._realign();
  5715. }
  5716. }
  5717. /**
  5718. * Adjusts the dropdown pane possible positions by iterating through alignments
  5719. * on the current position.
  5720. * @function
  5721. * @private
  5722. */
  5723. }, {
  5724. key: "_realign",
  5725. value: function _realign() {
  5726. this._addTriedPosition(this.position, this.alignment);
  5727. this.alignment = nextItem(this.alignment, ALIGNMENTS[this.position]);
  5728. }
  5729. }, {
  5730. key: "_addTriedPosition",
  5731. value: function _addTriedPosition(position, alignment) {
  5732. this.triedPositions[position] = this.triedPositions[position] || [];
  5733. this.triedPositions[position].push(alignment);
  5734. }
  5735. }, {
  5736. key: "_positionsExhausted",
  5737. value: function _positionsExhausted() {
  5738. var isExhausted = true;
  5739. for (var i = 0; i < POSITIONS.length; i++) {
  5740. isExhausted = isExhausted && this._alignmentsExhausted(POSITIONS[i]);
  5741. }
  5742. return isExhausted;
  5743. }
  5744. }, {
  5745. key: "_alignmentsExhausted",
  5746. value: function _alignmentsExhausted(position) {
  5747. return this.triedPositions[position] && this.triedPositions[position].length == ALIGNMENTS[position].length;
  5748. } // When we're trying to center, we don't want to apply offset that's going to
  5749. // take us just off center, so wrap around to return 0 for the appropriate
  5750. // offset in those alignments. TODO: Figure out if we want to make this
  5751. // configurable behavior... it feels more intuitive, especially for tooltips, but
  5752. // it's possible someone might actually want to start from center and then nudge
  5753. // slightly off.
  5754. }, {
  5755. key: "_getVOffset",
  5756. value: function _getVOffset() {
  5757. return this.options.vOffset;
  5758. }
  5759. }, {
  5760. key: "_getHOffset",
  5761. value: function _getHOffset() {
  5762. return this.options.hOffset;
  5763. }
  5764. }, {
  5765. key: "_setPosition",
  5766. value: function _setPosition($anchor, $element, $parent) {
  5767. if ($anchor.attr('aria-expanded') === 'false') {
  5768. return false;
  5769. }
  5770. var $eleDims = _foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].GetDimensions($element),
  5771. $anchorDims = _foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].GetDimensions($anchor);
  5772. if (!this.options.allowOverlap) {
  5773. // restore original position & alignment before checking overlap
  5774. this.position = this.originalPosition;
  5775. this.alignment = this.originalAlignment;
  5776. }
  5777. $element.offset(_foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset()));
  5778. if (!this.options.allowOverlap) {
  5779. var overlaps = {};
  5780. var minOverlap = 100000000; // default coordinates to how we start, in case we can't figure out better
  5781. var minCoordinates = {
  5782. position: this.position,
  5783. alignment: this.alignment
  5784. };
  5785. while (!this._positionsExhausted()) {
  5786. var overlap = _foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].OverlapArea($element, $parent, false, false, this.options.allowBottomOverlap);
  5787. if (overlap === 0) {
  5788. return;
  5789. }
  5790. if (overlap < minOverlap) {
  5791. minOverlap = overlap;
  5792. minCoordinates = {
  5793. position: this.position,
  5794. alignment: this.alignment
  5795. };
  5796. }
  5797. this._reposition();
  5798. $element.offset(_foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset()));
  5799. } // If we get through the entire loop, there was no non-overlapping
  5800. // position available. Pick the version with least overlap.
  5801. this.position = minCoordinates.position;
  5802. this.alignment = minCoordinates.alignment;
  5803. $element.offset(_foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset()));
  5804. }
  5805. }
  5806. }]);
  5807. return Positionable;
  5808. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]);
  5809. Positionable.defaults = {
  5810. /**
  5811. * Position of positionable relative to anchor. Can be left, right, bottom, top, or auto.
  5812. * @option
  5813. * @type {string}
  5814. * @default 'auto'
  5815. */
  5816. position: 'auto',
  5817. /**
  5818. * Alignment of positionable relative to anchor. Can be left, right, bottom, top, center, or auto.
  5819. * @option
  5820. * @type {string}
  5821. * @default 'auto'
  5822. */
  5823. alignment: 'auto',
  5824. /**
  5825. * Allow overlap of container/window. If false, dropdown positionable first
  5826. * try to position as defined by data-position and data-alignment, but
  5827. * reposition if it would cause an overflow.
  5828. * @option
  5829. * @type {boolean}
  5830. * @default false
  5831. */
  5832. allowOverlap: false,
  5833. /**
  5834. * Allow overlap of only the bottom of the container. This is the most common
  5835. * behavior for dropdowns, allowing the dropdown to extend the bottom of the
  5836. * screen but not otherwise influence or break out of the container.
  5837. * @option
  5838. * @type {boolean}
  5839. * @default true
  5840. */
  5841. allowBottomOverlap: true,
  5842. /**
  5843. * Number of pixels the positionable should be separated vertically from anchor
  5844. * @option
  5845. * @type {number}
  5846. * @default 0
  5847. */
  5848. vOffset: 0,
  5849. /**
  5850. * Number of pixels the positionable should be separated horizontally from anchor
  5851. * @option
  5852. * @type {number}
  5853. * @default 0
  5854. */
  5855. hOffset: 0
  5856. };
  5857. /***/ }),
  5858. /***/ "./js/foundation.responsiveAccordionTabs.js":
  5859. /*!**************************************************!*\
  5860. !*** ./js/foundation.responsiveAccordionTabs.js ***!
  5861. \**************************************************/
  5862. /*! exports provided: ResponsiveAccordionTabs */
  5863. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5864. "use strict";
  5865. __webpack_require__.r(__webpack_exports__);
  5866. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResponsiveAccordionTabs", function() { return ResponsiveAccordionTabs; });
  5867. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  5868. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  5869. /* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js");
  5870. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  5871. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  5872. /* harmony import */ var _foundation_accordion__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.accordion */ "./js/foundation.accordion.js");
  5873. /* harmony import */ var _foundation_tabs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.tabs */ "./js/foundation.tabs.js");
  5874. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  5875. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5876. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  5877. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  5878. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  5879. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  5880. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  5881. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  5882. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  5883. // The plugin matches the plugin classes with these plugin instances.
  5884. var MenuPlugins = {
  5885. tabs: {
  5886. cssClass: 'tabs',
  5887. plugin: _foundation_tabs__WEBPACK_IMPORTED_MODULE_5__["Tabs"]
  5888. },
  5889. accordion: {
  5890. cssClass: 'accordion',
  5891. plugin: _foundation_accordion__WEBPACK_IMPORTED_MODULE_4__["Accordion"]
  5892. }
  5893. };
  5894. /**
  5895. * ResponsiveAccordionTabs module.
  5896. * @module foundation.responsiveAccordionTabs
  5897. * @requires foundation.util.motion
  5898. * @requires foundation.accordion
  5899. * @requires foundation.tabs
  5900. */
  5901. var ResponsiveAccordionTabs =
  5902. /*#__PURE__*/
  5903. function (_Plugin) {
  5904. _inherits(ResponsiveAccordionTabs, _Plugin);
  5905. function ResponsiveAccordionTabs() {
  5906. _classCallCheck(this, ResponsiveAccordionTabs);
  5907. return _possibleConstructorReturn(this, _getPrototypeOf(ResponsiveAccordionTabs).apply(this, arguments));
  5908. }
  5909. _createClass(ResponsiveAccordionTabs, [{
  5910. key: "_setup",
  5911. /**
  5912. * Creates a new instance of a responsive accordion tabs.
  5913. * @class
  5914. * @name ResponsiveAccordionTabs
  5915. * @fires ResponsiveAccordionTabs#init
  5916. * @param {jQuery} element - jQuery object to make into Responsive Accordion Tabs.
  5917. * @param {Object} options - Overrides to the default plugin settings.
  5918. */
  5919. value: function _setup(element, options) {
  5920. this.$element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element);
  5921. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, this.$element.data(), options);
  5922. this.rules = this.$element.data('responsive-accordion-tabs');
  5923. this.currentMq = null;
  5924. this.currentPlugin = null;
  5925. this.className = 'ResponsiveAccordionTabs'; // ie9 back compat
  5926. if (!this.$element.attr('id')) {
  5927. this.$element.attr('id', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'responsiveaccordiontabs'));
  5928. }
  5929. ;
  5930. this._init();
  5931. this._events();
  5932. }
  5933. /**
  5934. * Initializes the Menu by parsing the classes from the 'data-responsive-accordion-tabs' attribute on the element.
  5935. * @function
  5936. * @private
  5937. */
  5938. }, {
  5939. key: "_init",
  5940. value: function _init() {
  5941. _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]._init(); // The first time an Interchange plugin is initialized, this.rules is converted from a string of "classes" to an object of rules
  5942. if (typeof this.rules === 'string') {
  5943. var rulesTree = {}; // Parse rules from "classes" pulled from data attribute
  5944. var rules = this.rules.split(' '); // Iterate through every rule found
  5945. for (var i = 0; i < rules.length; i++) {
  5946. var rule = rules[i].split('-');
  5947. var ruleSize = rule.length > 1 ? rule[0] : 'small';
  5948. var rulePlugin = rule.length > 1 ? rule[1] : rule[0];
  5949. if (MenuPlugins[rulePlugin] !== null) {
  5950. rulesTree[ruleSize] = MenuPlugins[rulePlugin];
  5951. }
  5952. }
  5953. this.rules = rulesTree;
  5954. }
  5955. this._getAllOptions();
  5956. if (!jquery__WEBPACK_IMPORTED_MODULE_0___default.a.isEmptyObject(this.rules)) {
  5957. this._checkMediaQueries();
  5958. }
  5959. }
  5960. }, {
  5961. key: "_getAllOptions",
  5962. value: function _getAllOptions() {
  5963. //get all defaults and options
  5964. var _this = this;
  5965. _this.allOptions = {};
  5966. for (var key in MenuPlugins) {
  5967. if (MenuPlugins.hasOwnProperty(key)) {
  5968. var obj = MenuPlugins[key];
  5969. try {
  5970. var dummyPlugin = jquery__WEBPACK_IMPORTED_MODULE_0___default()('<ul></ul>');
  5971. var tmpPlugin = new obj.plugin(dummyPlugin, _this.options);
  5972. for (var keyKey in tmpPlugin.options) {
  5973. if (tmpPlugin.options.hasOwnProperty(keyKey) && keyKey !== 'zfPlugin') {
  5974. var objObj = tmpPlugin.options[keyKey];
  5975. _this.allOptions[keyKey] = objObj;
  5976. }
  5977. }
  5978. tmpPlugin.destroy();
  5979. } catch (e) {}
  5980. }
  5981. }
  5982. }
  5983. /**
  5984. * Initializes events for the Menu.
  5985. * @function
  5986. * @private
  5987. */
  5988. }, {
  5989. key: "_events",
  5990. value: function _events() {
  5991. this._changedZfMediaQueryHandler = this._checkMediaQueries.bind(this);
  5992. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', this._changedZfMediaQueryHandler);
  5993. }
  5994. /**
  5995. * Checks the current screen width against available media queries. If the media query has changed, and the plugin needed has changed, the plugins will swap out.
  5996. * @function
  5997. * @private
  5998. */
  5999. }, {
  6000. key: "_checkMediaQueries",
  6001. value: function _checkMediaQueries() {
  6002. var matchedMq,
  6003. _this = this; // Iterate through each rule and find the last matching rule
  6004. jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(this.rules, function (key) {
  6005. if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].atLeast(key)) {
  6006. matchedMq = key;
  6007. }
  6008. }); // No match? No dice
  6009. if (!matchedMq) return; // Plugin already initialized? We good
  6010. if (this.currentPlugin instanceof this.rules[matchedMq].plugin) return; // Remove existing plugin-specific CSS classes
  6011. jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(MenuPlugins, function (key, value) {
  6012. _this.$element.removeClass(value.cssClass);
  6013. }); // Add the CSS class for the new plugin
  6014. this.$element.addClass(this.rules[matchedMq].cssClass); // Create an instance of the new plugin
  6015. if (this.currentPlugin) {
  6016. //don't know why but on nested elements data zfPlugin get's lost
  6017. if (!this.currentPlugin.$element.data('zfPlugin') && this.storezfData) this.currentPlugin.$element.data('zfPlugin', this.storezfData);
  6018. this.currentPlugin.destroy();
  6019. }
  6020. this._handleMarkup(this.rules[matchedMq].cssClass);
  6021. this.currentPlugin = new this.rules[matchedMq].plugin(this.$element, {});
  6022. this.storezfData = this.currentPlugin.$element.data('zfPlugin');
  6023. }
  6024. }, {
  6025. key: "_handleMarkup",
  6026. value: function _handleMarkup(toSet) {
  6027. var _this = this,
  6028. fromString = 'accordion';
  6029. var $panels = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-tabs-content=' + this.$element.attr('id') + ']');
  6030. if ($panels.length) fromString = 'tabs';
  6031. if (fromString === toSet) {
  6032. return;
  6033. }
  6034. ;
  6035. var tabsTitle = _this.allOptions.linkClass ? _this.allOptions.linkClass : 'tabs-title';
  6036. var tabsPanel = _this.allOptions.panelClass ? _this.allOptions.panelClass : 'tabs-panel';
  6037. this.$element.removeAttr('role');
  6038. var $liHeads = this.$element.children('.' + tabsTitle + ',[data-accordion-item]').removeClass(tabsTitle).removeClass('accordion-item').removeAttr('data-accordion-item');
  6039. var $liHeadsA = $liHeads.children('a').removeClass('accordion-title');
  6040. if (fromString === 'tabs') {
  6041. $panels = $panels.children('.' + tabsPanel).removeClass(tabsPanel).removeAttr('role').removeAttr('aria-hidden').removeAttr('aria-labelledby');
  6042. $panels.children('a').removeAttr('role').removeAttr('aria-controls').removeAttr('aria-selected');
  6043. } else {
  6044. $panels = $liHeads.children('[data-tab-content]').removeClass('accordion-content');
  6045. }
  6046. ;
  6047. $panels.css({
  6048. display: '',
  6049. visibility: ''
  6050. });
  6051. $liHeads.css({
  6052. display: '',
  6053. visibility: ''
  6054. });
  6055. if (toSet === 'accordion') {
  6056. $panels.each(function (key, value) {
  6057. jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).appendTo($liHeads.get(key)).addClass('accordion-content').attr('data-tab-content', '').removeClass('is-active').css({
  6058. height: ''
  6059. });
  6060. jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-tabs-content=' + _this.$element.attr('id') + ']').after('<div id="tabs-placeholder-' + _this.$element.attr('id') + '"></div>').detach();
  6061. $liHeads.addClass('accordion-item').attr('data-accordion-item', '');
  6062. $liHeadsA.addClass('accordion-title');
  6063. });
  6064. } else if (toSet === 'tabs') {
  6065. var $tabsContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-tabs-content=' + _this.$element.attr('id') + ']');
  6066. var $placeholder = jquery__WEBPACK_IMPORTED_MODULE_0___default()('#tabs-placeholder-' + _this.$element.attr('id'));
  6067. if ($placeholder.length) {
  6068. $tabsContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div class="tabs-content"></div>').insertAfter($placeholder).attr('data-tabs-content', _this.$element.attr('id'));
  6069. $placeholder.remove();
  6070. } else {
  6071. $tabsContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div class="tabs-content"></div>').insertAfter(_this.$element).attr('data-tabs-content', _this.$element.attr('id'));
  6072. }
  6073. ;
  6074. $panels.each(function (key, value) {
  6075. var tempValue = jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).appendTo($tabsContent).addClass(tabsPanel);
  6076. var hash = $liHeadsA.get(key).hash.slice(1);
  6077. var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).attr('id') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'accordion');
  6078. if (hash !== id) {
  6079. if (hash !== '') {
  6080. jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).attr('id', hash);
  6081. } else {
  6082. hash = id;
  6083. jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).attr('id', hash);
  6084. jquery__WEBPACK_IMPORTED_MODULE_0___default()($liHeadsA.get(key)).attr('href', jquery__WEBPACK_IMPORTED_MODULE_0___default()($liHeadsA.get(key)).attr('href').replace('#', '') + '#' + hash);
  6085. }
  6086. ;
  6087. }
  6088. ;
  6089. var isActive = jquery__WEBPACK_IMPORTED_MODULE_0___default()($liHeads.get(key)).hasClass('is-active');
  6090. if (isActive) {
  6091. tempValue.addClass('is-active');
  6092. }
  6093. ;
  6094. });
  6095. $liHeads.addClass(tabsTitle);
  6096. }
  6097. ;
  6098. }
  6099. /**
  6100. * Destroys the instance of the current plugin on this element, as well as the window resize handler that switches the plugins out.
  6101. * @function
  6102. */
  6103. }, {
  6104. key: "_destroy",
  6105. value: function _destroy() {
  6106. if (this.currentPlugin) this.currentPlugin.destroy();
  6107. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('changed.zf.mediaquery', this._changedZfMediaQueryHandler);
  6108. }
  6109. }]);
  6110. return ResponsiveAccordionTabs;
  6111. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__["Plugin"]);
  6112. ResponsiveAccordionTabs.defaults = {};
  6113. /***/ }),
  6114. /***/ "./js/foundation.responsiveMenu.js":
  6115. /*!*****************************************!*\
  6116. !*** ./js/foundation.responsiveMenu.js ***!
  6117. \*****************************************/
  6118. /*! exports provided: ResponsiveMenu */
  6119. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6120. "use strict";
  6121. __webpack_require__.r(__webpack_exports__);
  6122. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResponsiveMenu", function() { return ResponsiveMenu; });
  6123. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  6124. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  6125. /* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js");
  6126. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  6127. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  6128. /* harmony import */ var _foundation_dropdownMenu__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.dropdownMenu */ "./js/foundation.dropdownMenu.js");
  6129. /* harmony import */ var _foundation_drilldown__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.drilldown */ "./js/foundation.drilldown.js");
  6130. /* harmony import */ var _foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./foundation.accordionMenu */ "./js/foundation.accordionMenu.js");
  6131. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  6132. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6133. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  6134. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  6135. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  6136. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  6137. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  6138. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  6139. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  6140. var MenuPlugins = {
  6141. dropdown: {
  6142. cssClass: 'dropdown',
  6143. plugin: _foundation_dropdownMenu__WEBPACK_IMPORTED_MODULE_4__["DropdownMenu"]
  6144. },
  6145. drilldown: {
  6146. cssClass: 'drilldown',
  6147. plugin: _foundation_drilldown__WEBPACK_IMPORTED_MODULE_5__["Drilldown"]
  6148. },
  6149. accordion: {
  6150. cssClass: 'accordion-menu',
  6151. plugin: _foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_6__["AccordionMenu"]
  6152. }
  6153. }; // import "foundation.util.triggers.js";
  6154. /**
  6155. * ResponsiveMenu module.
  6156. * @module foundation.responsiveMenu
  6157. * @requires foundation.util.triggers
  6158. * @requires foundation.util.mediaQuery
  6159. */
  6160. var ResponsiveMenu =
  6161. /*#__PURE__*/
  6162. function (_Plugin) {
  6163. _inherits(ResponsiveMenu, _Plugin);
  6164. function ResponsiveMenu() {
  6165. _classCallCheck(this, ResponsiveMenu);
  6166. return _possibleConstructorReturn(this, _getPrototypeOf(ResponsiveMenu).apply(this, arguments));
  6167. }
  6168. _createClass(ResponsiveMenu, [{
  6169. key: "_setup",
  6170. /**
  6171. * Creates a new instance of a responsive menu.
  6172. * @class
  6173. * @name ResponsiveMenu
  6174. * @fires ResponsiveMenu#init
  6175. * @param {jQuery} element - jQuery object to make into a dropdown menu.
  6176. * @param {Object} options - Overrides to the default plugin settings.
  6177. */
  6178. value: function _setup(element, options) {
  6179. this.$element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element);
  6180. this.rules = this.$element.data('responsive-menu');
  6181. this.currentMq = null;
  6182. this.currentPlugin = null;
  6183. this.className = 'ResponsiveMenu'; // ie9 back compat
  6184. this._init();
  6185. this._events();
  6186. }
  6187. /**
  6188. * Initializes the Menu by parsing the classes from the 'data-ResponsiveMenu' attribute on the element.
  6189. * @function
  6190. * @private
  6191. */
  6192. }, {
  6193. key: "_init",
  6194. value: function _init() {
  6195. _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]._init(); // The first time an Interchange plugin is initialized, this.rules is converted from a string of "classes" to an object of rules
  6196. if (typeof this.rules === 'string') {
  6197. var rulesTree = {}; // Parse rules from "classes" pulled from data attribute
  6198. var rules = this.rules.split(' '); // Iterate through every rule found
  6199. for (var i = 0; i < rules.length; i++) {
  6200. var rule = rules[i].split('-');
  6201. var ruleSize = rule.length > 1 ? rule[0] : 'small';
  6202. var rulePlugin = rule.length > 1 ? rule[1] : rule[0];
  6203. if (MenuPlugins[rulePlugin] !== null) {
  6204. rulesTree[ruleSize] = MenuPlugins[rulePlugin];
  6205. }
  6206. }
  6207. this.rules = rulesTree;
  6208. }
  6209. if (!jquery__WEBPACK_IMPORTED_MODULE_0___default.a.isEmptyObject(this.rules)) {
  6210. this._checkMediaQueries();
  6211. } // Add data-mutate since children may need it.
  6212. this.$element.attr('data-mutate', this.$element.attr('data-mutate') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'responsive-menu'));
  6213. }
  6214. /**
  6215. * Initializes events for the Menu.
  6216. * @function
  6217. * @private
  6218. */
  6219. }, {
  6220. key: "_events",
  6221. value: function _events() {
  6222. var _this = this;
  6223. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', function () {
  6224. _this._checkMediaQueries();
  6225. }); // $(window).on('resize.zf.ResponsiveMenu', function() {
  6226. // _this._checkMediaQueries();
  6227. // });
  6228. }
  6229. /**
  6230. * Checks the current screen width against available media queries. If the media query has changed, and the plugin needed has changed, the plugins will swap out.
  6231. * @function
  6232. * @private
  6233. */
  6234. }, {
  6235. key: "_checkMediaQueries",
  6236. value: function _checkMediaQueries() {
  6237. var matchedMq,
  6238. _this = this; // Iterate through each rule and find the last matching rule
  6239. jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(this.rules, function (key) {
  6240. if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].atLeast(key)) {
  6241. matchedMq = key;
  6242. }
  6243. }); // No match? No dice
  6244. if (!matchedMq) return; // Plugin already initialized? We good
  6245. if (this.currentPlugin instanceof this.rules[matchedMq].plugin) return; // Remove existing plugin-specific CSS classes
  6246. jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(MenuPlugins, function (key, value) {
  6247. _this.$element.removeClass(value.cssClass);
  6248. }); // Add the CSS class for the new plugin
  6249. this.$element.addClass(this.rules[matchedMq].cssClass); // Create an instance of the new plugin
  6250. if (this.currentPlugin) this.currentPlugin.destroy();
  6251. this.currentPlugin = new this.rules[matchedMq].plugin(this.$element, {});
  6252. }
  6253. /**
  6254. * Destroys the instance of the current plugin on this element, as well as the window resize handler that switches the plugins out.
  6255. * @function
  6256. */
  6257. }, {
  6258. key: "_destroy",
  6259. value: function _destroy() {
  6260. this.currentPlugin.destroy();
  6261. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('.zf.ResponsiveMenu');
  6262. }
  6263. }]);
  6264. return ResponsiveMenu;
  6265. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__["Plugin"]);
  6266. ResponsiveMenu.defaults = {};
  6267. /***/ }),
  6268. /***/ "./js/foundation.responsiveToggle.js":
  6269. /*!*******************************************!*\
  6270. !*** ./js/foundation.responsiveToggle.js ***!
  6271. \*******************************************/
  6272. /*! exports provided: ResponsiveToggle */
  6273. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6274. "use strict";
  6275. __webpack_require__.r(__webpack_exports__);
  6276. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResponsiveToggle", function() { return ResponsiveToggle; });
  6277. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  6278. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  6279. /* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js");
  6280. /* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js");
  6281. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  6282. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  6283. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6284. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  6285. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  6286. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  6287. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  6288. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  6289. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  6290. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  6291. /**
  6292. * ResponsiveToggle module.
  6293. * @module foundation.responsiveToggle
  6294. * @requires foundation.util.mediaQuery
  6295. * @requires foundation.util.motion
  6296. */
  6297. var ResponsiveToggle =
  6298. /*#__PURE__*/
  6299. function (_Plugin) {
  6300. _inherits(ResponsiveToggle, _Plugin);
  6301. function ResponsiveToggle() {
  6302. _classCallCheck(this, ResponsiveToggle);
  6303. return _possibleConstructorReturn(this, _getPrototypeOf(ResponsiveToggle).apply(this, arguments));
  6304. }
  6305. _createClass(ResponsiveToggle, [{
  6306. key: "_setup",
  6307. /**
  6308. * Creates a new instance of Tab Bar.
  6309. * @class
  6310. * @name ResponsiveToggle
  6311. * @fires ResponsiveToggle#init
  6312. * @param {jQuery} element - jQuery object to attach tab bar functionality to.
  6313. * @param {Object} options - Overrides to the default plugin settings.
  6314. */
  6315. value: function _setup(element, options) {
  6316. this.$element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element);
  6317. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, ResponsiveToggle.defaults, this.$element.data(), options);
  6318. this.className = 'ResponsiveToggle'; // ie9 back compat
  6319. this._init();
  6320. this._events();
  6321. }
  6322. /**
  6323. * Initializes the tab bar by finding the target element, toggling element, and running update().
  6324. * @function
  6325. * @private
  6326. */
  6327. }, {
  6328. key: "_init",
  6329. value: function _init() {
  6330. _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]._init();
  6331. var targetID = this.$element.data('responsive-toggle');
  6332. if (!targetID) {
  6333. console.error('Your tab bar needs an ID of a Menu as the value of data-tab-bar.');
  6334. }
  6335. this.$targetMenu = jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(targetID));
  6336. this.$toggler = this.$element.find('[data-toggle]').filter(function () {
  6337. var target = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('toggle');
  6338. return target === targetID || target === "";
  6339. });
  6340. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, this.options, this.$targetMenu.data()); // If they were set, parse the animation classes
  6341. if (this.options.animate) {
  6342. var input = this.options.animate.split(' ');
  6343. this.animationIn = input[0];
  6344. this.animationOut = input[1] || null;
  6345. }
  6346. this._update();
  6347. }
  6348. /**
  6349. * Adds necessary event handlers for the tab bar to work.
  6350. * @function
  6351. * @private
  6352. */
  6353. }, {
  6354. key: "_events",
  6355. value: function _events() {
  6356. var _this = this;
  6357. this._updateMqHandler = this._update.bind(this);
  6358. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', this._updateMqHandler);
  6359. this.$toggler.on('click.zf.responsiveToggle', this.toggleMenu.bind(this));
  6360. }
  6361. /**
  6362. * Checks the current media query to determine if the tab bar should be visible or hidden.
  6363. * @function
  6364. * @private
  6365. */
  6366. }, {
  6367. key: "_update",
  6368. value: function _update() {
  6369. // Mobile
  6370. if (!_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].atLeast(this.options.hideFor)) {
  6371. this.$element.show();
  6372. this.$targetMenu.hide();
  6373. } // Desktop
  6374. else {
  6375. this.$element.hide();
  6376. this.$targetMenu.show();
  6377. }
  6378. }
  6379. /**
  6380. * Toggles the element attached to the tab bar. The toggle only happens if the screen is small enough to allow it.
  6381. * @function
  6382. * @fires ResponsiveToggle#toggled
  6383. */
  6384. }, {
  6385. key: "toggleMenu",
  6386. value: function toggleMenu() {
  6387. var _this2 = this;
  6388. if (!_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].atLeast(this.options.hideFor)) {
  6389. /**
  6390. * Fires when the element attached to the tab bar toggles.
  6391. * @event ResponsiveToggle#toggled
  6392. */
  6393. if (this.options.animate) {
  6394. if (this.$targetMenu.is(':hidden')) {
  6395. _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateIn(this.$targetMenu, this.animationIn, function () {
  6396. _this2.$element.trigger('toggled.zf.responsiveToggle');
  6397. _this2.$targetMenu.find('[data-mutate]').triggerHandler('mutateme.zf.trigger');
  6398. });
  6399. } else {
  6400. _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateOut(this.$targetMenu, this.animationOut, function () {
  6401. _this2.$element.trigger('toggled.zf.responsiveToggle');
  6402. });
  6403. }
  6404. } else {
  6405. this.$targetMenu.toggle(0);
  6406. this.$targetMenu.find('[data-mutate]').trigger('mutateme.zf.trigger');
  6407. this.$element.trigger('toggled.zf.responsiveToggle');
  6408. }
  6409. }
  6410. }
  6411. }, {
  6412. key: "_destroy",
  6413. value: function _destroy() {
  6414. this.$element.off('.zf.responsiveToggle');
  6415. this.$toggler.off('.zf.responsiveToggle');
  6416. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('changed.zf.mediaquery', this._updateMqHandler);
  6417. }
  6418. }]);
  6419. return ResponsiveToggle;
  6420. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__["Plugin"]);
  6421. ResponsiveToggle.defaults = {
  6422. /**
  6423. * The breakpoint after which the menu is always shown, and the tab bar is hidden.
  6424. * @option
  6425. * @type {string}
  6426. * @default 'medium'
  6427. */
  6428. hideFor: 'medium',
  6429. /**
  6430. * To decide if the toggle should be animated or not.
  6431. * @option
  6432. * @type {boolean}
  6433. * @default false
  6434. */
  6435. animate: false
  6436. };
  6437. /***/ }),
  6438. /***/ "./js/foundation.reveal.js":
  6439. /*!*********************************!*\
  6440. !*** ./js/foundation.reveal.js ***!
  6441. \*********************************/
  6442. /*! exports provided: Reveal */
  6443. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6444. "use strict";
  6445. __webpack_require__.r(__webpack_exports__);
  6446. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Reveal", function() { return Reveal; });
  6447. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  6448. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  6449. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  6450. /* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js");
  6451. /* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js");
  6452. /* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js");
  6453. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  6454. /* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js");
  6455. /* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./foundation.util.touch */ "./js/foundation.util.touch.js");
  6456. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  6457. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6458. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  6459. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  6460. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  6461. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  6462. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  6463. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  6464. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  6465. /**
  6466. * Reveal module.
  6467. * @module foundation.reveal
  6468. * @requires foundation.util.keyboard
  6469. * @requires foundation.util.triggers
  6470. * @requires foundation.util.mediaQuery
  6471. * @requires foundation.util.motion if using animations
  6472. */
  6473. var Reveal =
  6474. /*#__PURE__*/
  6475. function (_Plugin) {
  6476. _inherits(Reveal, _Plugin);
  6477. function Reveal() {
  6478. _classCallCheck(this, Reveal);
  6479. return _possibleConstructorReturn(this, _getPrototypeOf(Reveal).apply(this, arguments));
  6480. }
  6481. _createClass(Reveal, [{
  6482. key: "_setup",
  6483. /**
  6484. * Creates a new instance of Reveal.
  6485. * @class
  6486. * @name Reveal
  6487. * @param {jQuery} element - jQuery object to use for the modal.
  6488. * @param {Object} options - optional parameters.
  6489. */
  6490. value: function _setup(element, options) {
  6491. this.$element = element;
  6492. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Reveal.defaults, this.$element.data(), options);
  6493. this.className = 'Reveal'; // ie9 back compat
  6494. this._init(); // Triggers init is idempotent, just need to make sure it is initialized
  6495. _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_6__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
  6496. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].register('Reveal', {
  6497. 'ESCAPE': 'close'
  6498. });
  6499. }
  6500. /**
  6501. * Initializes the modal by adding the overlay and close buttons, (if selected).
  6502. * @private
  6503. */
  6504. }, {
  6505. key: "_init",
  6506. value: function _init() {
  6507. var _this2 = this;
  6508. _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__["MediaQuery"]._init();
  6509. this.id = this.$element.attr('id');
  6510. this.isActive = false;
  6511. this.cached = {
  6512. mq: _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__["MediaQuery"].current
  6513. };
  6514. this.$anchor = jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-open=\"".concat(this.id, "\"]")).length ? jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-open=\"".concat(this.id, "\"]")) : jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-toggle=\"".concat(this.id, "\"]"));
  6515. this.$anchor.attr({
  6516. 'aria-controls': this.id,
  6517. 'aria-haspopup': true,
  6518. 'tabindex': 0
  6519. });
  6520. if (this.options.fullScreen || this.$element.hasClass('full')) {
  6521. this.options.fullScreen = true;
  6522. this.options.overlay = false;
  6523. }
  6524. if (this.options.overlay && !this.$overlay) {
  6525. this.$overlay = this._makeOverlay(this.id);
  6526. }
  6527. this.$element.attr({
  6528. 'role': 'dialog',
  6529. 'aria-hidden': true,
  6530. 'data-yeti-box': this.id,
  6531. 'data-resize': this.id
  6532. });
  6533. if (this.$overlay) {
  6534. this.$element.detach().appendTo(this.$overlay);
  6535. } else {
  6536. this.$element.detach().appendTo(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.options.appendTo));
  6537. this.$element.addClass('without-overlay');
  6538. }
  6539. this._events();
  6540. if (this.options.deepLink && window.location.hash === "#".concat(this.id)) {
  6541. this.onLoadListener = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () {
  6542. return _this2.open();
  6543. });
  6544. }
  6545. }
  6546. /**
  6547. * Creates an overlay div to display behind the modal.
  6548. * @private
  6549. */
  6550. }, {
  6551. key: "_makeOverlay",
  6552. value: function _makeOverlay() {
  6553. var additionalOverlayClasses = '';
  6554. if (this.options.additionalOverlayClasses) {
  6555. additionalOverlayClasses = ' ' + this.options.additionalOverlayClasses;
  6556. }
  6557. return jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div></div>').addClass('reveal-overlay' + additionalOverlayClasses).appendTo(this.options.appendTo);
  6558. }
  6559. /**
  6560. * Updates position of modal
  6561. * TODO: Figure out if we actually need to cache these values or if it doesn't matter
  6562. * @private
  6563. */
  6564. }, {
  6565. key: "_updatePosition",
  6566. value: function _updatePosition() {
  6567. var width = this.$element.outerWidth();
  6568. var outerWidth = jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).width();
  6569. var height = this.$element.outerHeight();
  6570. var outerHeight = jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).height();
  6571. var left,
  6572. top = null;
  6573. if (this.options.hOffset === 'auto') {
  6574. left = parseInt((outerWidth - width) / 2, 10);
  6575. } else {
  6576. left = parseInt(this.options.hOffset, 10);
  6577. }
  6578. if (this.options.vOffset === 'auto') {
  6579. if (height > outerHeight) {
  6580. top = parseInt(Math.min(100, outerHeight / 10), 10);
  6581. } else {
  6582. top = parseInt((outerHeight - height) / 4, 10);
  6583. }
  6584. } else if (this.options.vOffset !== null) {
  6585. top = parseInt(this.options.vOffset, 10);
  6586. }
  6587. if (top !== null) {
  6588. this.$element.css({
  6589. top: top + 'px'
  6590. });
  6591. } // only worry about left if we don't have an overlay or we have a horizontal offset,
  6592. // otherwise we're perfectly in the middle
  6593. if (!this.$overlay || this.options.hOffset !== 'auto') {
  6594. this.$element.css({
  6595. left: left + 'px'
  6596. });
  6597. this.$element.css({
  6598. margin: '0px'
  6599. });
  6600. }
  6601. }
  6602. /**
  6603. * Adds event handlers for the modal.
  6604. * @private
  6605. */
  6606. }, {
  6607. key: "_events",
  6608. value: function _events() {
  6609. var _this3 = this;
  6610. var _this = this;
  6611. this.$element.on({
  6612. 'open.zf.trigger': this.open.bind(this),
  6613. 'close.zf.trigger': function closeZfTrigger(event, $element) {
  6614. if (event.target === _this.$element[0] || jquery__WEBPACK_IMPORTED_MODULE_0___default()(event.target).parents('[data-closable]')[0] === $element) {
  6615. // only close reveal when it's explicitly called
  6616. return _this3.close.apply(_this3);
  6617. }
  6618. },
  6619. 'toggle.zf.trigger': this.toggle.bind(this),
  6620. 'resizeme.zf.trigger': function resizemeZfTrigger() {
  6621. _this._updatePosition();
  6622. }
  6623. });
  6624. if (this.options.closeOnClick && this.options.overlay) {
  6625. this.$overlay.off('.zf.reveal').on('click.zf.reveal', function (e) {
  6626. if (e.target === _this.$element[0] || jquery__WEBPACK_IMPORTED_MODULE_0___default.a.contains(_this.$element[0], e.target) || !jquery__WEBPACK_IMPORTED_MODULE_0___default.a.contains(document, e.target)) {
  6627. return;
  6628. }
  6629. _this.close();
  6630. });
  6631. }
  6632. if (this.options.deepLink) {
  6633. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on("hashchange.zf.reveal:".concat(this.id), this._handleState.bind(this));
  6634. }
  6635. }
  6636. /**
  6637. * Handles modal methods on back/forward button clicks or any other event that triggers hashchange.
  6638. * @private
  6639. */
  6640. }, {
  6641. key: "_handleState",
  6642. value: function _handleState(e) {
  6643. if (window.location.hash === '#' + this.id && !this.isActive) {
  6644. this.open();
  6645. } else {
  6646. this.close();
  6647. }
  6648. }
  6649. /**
  6650. * Disables the scroll when Reveal is shown to prevent the background from shifting
  6651. * @param {number} scrollTop - Scroll to visually apply, window current scroll by default
  6652. */
  6653. }, {
  6654. key: "_disableScroll",
  6655. value: function _disableScroll(scrollTop) {
  6656. scrollTop = scrollTop || jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).scrollTop();
  6657. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).height() > jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).height()) {
  6658. jquery__WEBPACK_IMPORTED_MODULE_0___default()("html").css("top", -scrollTop);
  6659. }
  6660. }
  6661. /**
  6662. * Reenables the scroll when Reveal closes
  6663. * @param {number} scrollTop - Scroll to restore, html "top" property by default (as set by `_disableScroll`)
  6664. */
  6665. }, {
  6666. key: "_enableScroll",
  6667. value: function _enableScroll(scrollTop) {
  6668. scrollTop = scrollTop || parseInt(jquery__WEBPACK_IMPORTED_MODULE_0___default()("html").css("top"));
  6669. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).height() > jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).height()) {
  6670. jquery__WEBPACK_IMPORTED_MODULE_0___default()("html").css("top", "");
  6671. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).scrollTop(-scrollTop);
  6672. }
  6673. }
  6674. /**
  6675. * Opens the modal controlled by `this.$anchor`, and closes all others by default.
  6676. * @function
  6677. * @fires Reveal#closeme
  6678. * @fires Reveal#open
  6679. */
  6680. }, {
  6681. key: "open",
  6682. value: function open() {
  6683. var _this4 = this;
  6684. // either update or replace browser history
  6685. var hash = "#".concat(this.id);
  6686. if (this.options.deepLink && window.location.hash !== hash) {
  6687. if (window.history.pushState) {
  6688. if (this.options.updateHistory) {
  6689. window.history.pushState({}, '', hash);
  6690. } else {
  6691. window.history.replaceState({}, '', hash);
  6692. }
  6693. } else {
  6694. window.location.hash = hash;
  6695. }
  6696. } // Remember anchor that opened it to set focus back later, have general anchors as fallback
  6697. this.$activeAnchor = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.activeElement).is(this.$anchor) ? jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.activeElement) : this.$anchor;
  6698. this.isActive = true; // Make elements invisible, but remove display: none so we can get size and positioning
  6699. this.$element.css({
  6700. 'visibility': 'hidden'
  6701. }).show().scrollTop(0);
  6702. if (this.options.overlay) {
  6703. this.$overlay.css({
  6704. 'visibility': 'hidden'
  6705. }).show();
  6706. }
  6707. this._updatePosition();
  6708. this.$element.hide().css({
  6709. 'visibility': ''
  6710. });
  6711. if (this.$overlay) {
  6712. this.$overlay.css({
  6713. 'visibility': ''
  6714. }).hide();
  6715. if (this.$element.hasClass('fast')) {
  6716. this.$overlay.addClass('fast');
  6717. } else if (this.$element.hasClass('slow')) {
  6718. this.$overlay.addClass('slow');
  6719. }
  6720. }
  6721. if (!this.options.multipleOpened) {
  6722. /**
  6723. * Fires immediately before the modal opens.
  6724. * Closes any other modals that are currently open
  6725. * @event Reveal#closeme
  6726. */
  6727. this.$element.trigger('closeme.zf.reveal', this.id);
  6728. }
  6729. this._disableScroll();
  6730. var _this = this; // Motion UI method of reveal
  6731. if (this.options.animationIn) {
  6732. var afterAnimation = function afterAnimation() {
  6733. _this.$element.attr({
  6734. 'aria-hidden': false,
  6735. 'tabindex': -1
  6736. }).focus();
  6737. _this._addGlobalClasses();
  6738. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].trapFocus(_this.$element);
  6739. };
  6740. if (this.options.overlay) {
  6741. _foundation_util_motion__WEBPACK_IMPORTED_MODULE_4__["Motion"].animateIn(this.$overlay, 'fade-in');
  6742. }
  6743. _foundation_util_motion__WEBPACK_IMPORTED_MODULE_4__["Motion"].animateIn(this.$element, this.options.animationIn, function () {
  6744. if (_this4.$element) {
  6745. // protect against object having been removed
  6746. _this4.focusableElements = _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].findFocusable(_this4.$element);
  6747. afterAnimation();
  6748. }
  6749. });
  6750. } // jQuery method of reveal
  6751. else {
  6752. if (this.options.overlay) {
  6753. this.$overlay.show(0);
  6754. }
  6755. this.$element.show(this.options.showDelay);
  6756. } // handle accessibility
  6757. this.$element.attr({
  6758. 'aria-hidden': false,
  6759. 'tabindex': -1
  6760. }).focus();
  6761. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].trapFocus(this.$element);
  6762. this._addGlobalClasses();
  6763. this._addGlobalListeners();
  6764. /**
  6765. * Fires when the modal has successfully opened.
  6766. * @event Reveal#open
  6767. */
  6768. this.$element.trigger('open.zf.reveal');
  6769. }
  6770. /**
  6771. * Adds classes and listeners on document required by open modals.
  6772. *
  6773. * The following classes are added and updated:
  6774. * - `.is-reveal-open` - Prevents the scroll on document
  6775. * - `.zf-has-scroll` - Displays a disabled scrollbar on document if required like if the
  6776. * scroll was not disabled. This prevent a "shift" of the page content due
  6777. * the scrollbar disappearing when the modal opens.
  6778. *
  6779. * @private
  6780. */
  6781. }, {
  6782. key: "_addGlobalClasses",
  6783. value: function _addGlobalClasses() {
  6784. var updateScrollbarClass = function updateScrollbarClass() {
  6785. jquery__WEBPACK_IMPORTED_MODULE_0___default()('html').toggleClass('zf-has-scroll', !!(jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).height() > jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).height()));
  6786. };
  6787. this.$element.on('resizeme.zf.trigger.revealScrollbarListener', function () {
  6788. return updateScrollbarClass();
  6789. });
  6790. updateScrollbarClass();
  6791. jquery__WEBPACK_IMPORTED_MODULE_0___default()('html').addClass('is-reveal-open');
  6792. }
  6793. /**
  6794. * Removes classes and listeners on document that were required by open modals.
  6795. * @private
  6796. */
  6797. }, {
  6798. key: "_removeGlobalClasses",
  6799. value: function _removeGlobalClasses() {
  6800. this.$element.off('resizeme.zf.trigger.revealScrollbarListener');
  6801. jquery__WEBPACK_IMPORTED_MODULE_0___default()('html').removeClass('is-reveal-open');
  6802. jquery__WEBPACK_IMPORTED_MODULE_0___default()('html').removeClass('zf-has-scroll');
  6803. }
  6804. /**
  6805. * Adds extra event handlers for the body and window if necessary.
  6806. * @private
  6807. */
  6808. }, {
  6809. key: "_addGlobalListeners",
  6810. value: function _addGlobalListeners() {
  6811. var _this = this;
  6812. if (!this.$element) {
  6813. return;
  6814. } // If we're in the middle of cleanup, don't freak out
  6815. this.focusableElements = _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].findFocusable(this.$element);
  6816. if (!this.options.overlay && this.options.closeOnClick && !this.options.fullScreen) {
  6817. jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').on('click.zf.reveal', function (e) {
  6818. if (e.target === _this.$element[0] || jquery__WEBPACK_IMPORTED_MODULE_0___default.a.contains(_this.$element[0], e.target) || !jquery__WEBPACK_IMPORTED_MODULE_0___default.a.contains(document, e.target)) {
  6819. return;
  6820. }
  6821. _this.close();
  6822. });
  6823. }
  6824. if (this.options.closeOnEsc) {
  6825. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('keydown.zf.reveal', function (e) {
  6826. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].handleKey(e, 'Reveal', {
  6827. close: function close() {
  6828. if (_this.options.closeOnEsc) {
  6829. _this.close();
  6830. }
  6831. }
  6832. });
  6833. });
  6834. }
  6835. }
  6836. /**
  6837. * Closes the modal.
  6838. * @function
  6839. * @fires Reveal#closed
  6840. */
  6841. }, {
  6842. key: "close",
  6843. value: function close() {
  6844. if (!this.isActive || !this.$element.is(':visible')) {
  6845. return false;
  6846. }
  6847. var _this = this; // Motion UI method of hiding
  6848. if (this.options.animationOut) {
  6849. if (this.options.overlay) {
  6850. _foundation_util_motion__WEBPACK_IMPORTED_MODULE_4__["Motion"].animateOut(this.$overlay, 'fade-out');
  6851. }
  6852. _foundation_util_motion__WEBPACK_IMPORTED_MODULE_4__["Motion"].animateOut(this.$element, this.options.animationOut, finishUp);
  6853. } // jQuery method of hiding
  6854. else {
  6855. this.$element.hide(this.options.hideDelay);
  6856. if (this.options.overlay) {
  6857. this.$overlay.hide(0, finishUp);
  6858. } else {
  6859. finishUp();
  6860. }
  6861. } // Conditionals to remove extra event listeners added on open
  6862. if (this.options.closeOnEsc) {
  6863. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('keydown.zf.reveal');
  6864. }
  6865. if (!this.options.overlay && this.options.closeOnClick) {
  6866. jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').off('click.zf.reveal');
  6867. }
  6868. this.$element.off('keydown.zf.reveal');
  6869. function finishUp() {
  6870. // Get the current top before the modal is closed and restore the scroll after.
  6871. // TODO: use component properties instead of HTML properties
  6872. // See https://github.com/zurb/foundation-sites/pull/10786
  6873. var scrollTop = parseInt(jquery__WEBPACK_IMPORTED_MODULE_0___default()("html").css("top"));
  6874. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()('.reveal:visible').length === 0) {
  6875. _this._removeGlobalClasses(); // also remove .is-reveal-open from the html element when there is no opened reveal
  6876. }
  6877. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].releaseFocus(_this.$element);
  6878. _this.$element.attr('aria-hidden', true);
  6879. _this._enableScroll(scrollTop);
  6880. /**
  6881. * Fires when the modal is done closing.
  6882. * @event Reveal#closed
  6883. */
  6884. _this.$element.trigger('closed.zf.reveal');
  6885. }
  6886. /**
  6887. * Resets the modal content
  6888. * This prevents a running video to keep going in the background
  6889. */
  6890. if (this.options.resetOnClose) {
  6891. this.$element.html(this.$element.html());
  6892. }
  6893. this.isActive = false; // If deepLink and we did not switched to an other modal...
  6894. if (_this.options.deepLink && window.location.hash === "#".concat(this.id)) {
  6895. // Remove the history hash
  6896. if (window.history.replaceState) {
  6897. var urlWithoutHash = window.location.pathname + window.location.search;
  6898. if (this.options.updateHistory) {
  6899. window.history.pushState({}, '', urlWithoutHash); // remove the hash
  6900. } else {
  6901. window.history.replaceState('', document.title, urlWithoutHash);
  6902. }
  6903. } else {
  6904. window.location.hash = '';
  6905. }
  6906. }
  6907. this.$activeAnchor.focus();
  6908. }
  6909. /**
  6910. * Toggles the open/closed state of a modal.
  6911. * @function
  6912. */
  6913. }, {
  6914. key: "toggle",
  6915. value: function toggle() {
  6916. if (this.isActive) {
  6917. this.close();
  6918. } else {
  6919. this.open();
  6920. }
  6921. }
  6922. }, {
  6923. key: "_destroy",
  6924. /**
  6925. * Destroys an instance of a modal.
  6926. * @function
  6927. */
  6928. value: function _destroy() {
  6929. if (this.options.overlay) {
  6930. this.$element.appendTo(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.options.appendTo)); // move $element outside of $overlay to prevent error unregisterPlugin()
  6931. this.$overlay.hide().off().remove();
  6932. }
  6933. this.$element.hide().off();
  6934. this.$anchor.off('.zf');
  6935. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(".zf.reveal:".concat(this.id));
  6936. if (this.onLoadListener) jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener);
  6937. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()('.reveal:visible').length === 0) {
  6938. this._removeGlobalClasses(); // also remove .is-reveal-open from the html element when there is no opened reveal
  6939. }
  6940. }
  6941. }]);
  6942. return Reveal;
  6943. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_5__["Plugin"]);
  6944. Reveal.defaults = {
  6945. /**
  6946. * Motion-UI class to use for animated elements. If none used, defaults to simple show/hide.
  6947. * @option
  6948. * @type {string}
  6949. * @default ''
  6950. */
  6951. animationIn: '',
  6952. /**
  6953. * Motion-UI class to use for animated elements. If none used, defaults to simple show/hide.
  6954. * @option
  6955. * @type {string}
  6956. * @default ''
  6957. */
  6958. animationOut: '',
  6959. /**
  6960. * Time, in ms, to delay the opening of a modal after a click if no animation used.
  6961. * @option
  6962. * @type {number}
  6963. * @default 0
  6964. */
  6965. showDelay: 0,
  6966. /**
  6967. * Time, in ms, to delay the closing of a modal after a click if no animation used.
  6968. * @option
  6969. * @type {number}
  6970. * @default 0
  6971. */
  6972. hideDelay: 0,
  6973. /**
  6974. * Allows a click on the body/overlay to close the modal.
  6975. * @option
  6976. * @type {boolean}
  6977. * @default true
  6978. */
  6979. closeOnClick: true,
  6980. /**
  6981. * Allows the modal to close if the user presses the `ESCAPE` key.
  6982. * @option
  6983. * @type {boolean}
  6984. * @default true
  6985. */
  6986. closeOnEsc: true,
  6987. /**
  6988. * If true, allows multiple modals to be displayed at once.
  6989. * @option
  6990. * @type {boolean}
  6991. * @default false
  6992. */
  6993. multipleOpened: false,
  6994. /**
  6995. * Distance, in pixels, the modal should push down from the top of the screen.
  6996. * @option
  6997. * @type {number|string}
  6998. * @default auto
  6999. */
  7000. vOffset: 'auto',
  7001. /**
  7002. * Distance, in pixels, the modal should push in from the side of the screen.
  7003. * @option
  7004. * @type {number|string}
  7005. * @default auto
  7006. */
  7007. hOffset: 'auto',
  7008. /**
  7009. * Allows the modal to be fullscreen, completely blocking out the rest of the view. JS checks for this as well.
  7010. * @option
  7011. * @type {boolean}
  7012. * @default false
  7013. */
  7014. fullScreen: false,
  7015. /**
  7016. * Allows the modal to generate an overlay div, which will cover the view when modal opens.
  7017. * @option
  7018. * @type {boolean}
  7019. * @default true
  7020. */
  7021. overlay: true,
  7022. /**
  7023. * Allows the modal to remove and reinject markup on close. Should be true if using video elements w/o using provider's api, otherwise, videos will continue to play in the background.
  7024. * @option
  7025. * @type {boolean}
  7026. * @default false
  7027. */
  7028. resetOnClose: false,
  7029. /**
  7030. * Link the location hash to the modal.
  7031. * Set the location hash when the modal is opened/closed, and open/close the modal when the location changes.
  7032. * @option
  7033. * @type {boolean}
  7034. * @default false
  7035. */
  7036. deepLink: false,
  7037. /**
  7038. * If `deepLink` is enabled, update the browser history with the open modal
  7039. * @option
  7040. * @default false
  7041. */
  7042. updateHistory: false,
  7043. /**
  7044. * Allows the modal to append to custom div.
  7045. * @option
  7046. * @type {string}
  7047. * @default "body"
  7048. */
  7049. appendTo: "body",
  7050. /**
  7051. * Allows adding additional class names to the reveal overlay.
  7052. * @option
  7053. * @type {string}
  7054. * @default ''
  7055. */
  7056. additionalOverlayClasses: ''
  7057. };
  7058. /***/ }),
  7059. /***/ "./js/foundation.slider.js":
  7060. /*!*********************************!*\
  7061. !*** ./js/foundation.slider.js ***!
  7062. \*********************************/
  7063. /*! exports provided: Slider */
  7064. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7065. "use strict";
  7066. __webpack_require__.r(__webpack_exports__);
  7067. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Slider", function() { return Slider; });
  7068. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  7069. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  7070. /* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js");
  7071. /* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js");
  7072. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  7073. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  7074. /* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.util.touch */ "./js/foundation.util.touch.js");
  7075. /* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js");
  7076. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  7077. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7078. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  7079. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  7080. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  7081. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  7082. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  7083. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  7084. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  7085. /**
  7086. * Slider module.
  7087. * @module foundation.slider
  7088. * @requires foundation.util.motion
  7089. * @requires foundation.util.triggers
  7090. * @requires foundation.util.keyboard
  7091. * @requires foundation.util.touch
  7092. */
  7093. var Slider =
  7094. /*#__PURE__*/
  7095. function (_Plugin) {
  7096. _inherits(Slider, _Plugin);
  7097. function Slider() {
  7098. _classCallCheck(this, Slider);
  7099. return _possibleConstructorReturn(this, _getPrototypeOf(Slider).apply(this, arguments));
  7100. }
  7101. _createClass(Slider, [{
  7102. key: "_setup",
  7103. /**
  7104. * Creates a new instance of a slider control.
  7105. * @class
  7106. * @name Slider
  7107. * @param {jQuery} element - jQuery object to make into a slider control.
  7108. * @param {Object} options - Overrides to the default plugin settings.
  7109. */
  7110. value: function _setup(element, options) {
  7111. this.$element = element;
  7112. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Slider.defaults, this.$element.data(), options);
  7113. this.className = 'Slider'; // ie9 back compat
  7114. // Touch and Triggers inits are idempotent, we just need to make sure it's initialied.
  7115. _foundation_util_touch__WEBPACK_IMPORTED_MODULE_5__["Touch"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
  7116. _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_6__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
  7117. this._init();
  7118. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('Slider', {
  7119. 'ltr': {
  7120. 'ARROW_RIGHT': 'increase',
  7121. 'ARROW_UP': 'increase',
  7122. 'ARROW_DOWN': 'decrease',
  7123. 'ARROW_LEFT': 'decrease',
  7124. 'SHIFT_ARROW_RIGHT': 'increase_fast',
  7125. 'SHIFT_ARROW_UP': 'increase_fast',
  7126. 'SHIFT_ARROW_DOWN': 'decrease_fast',
  7127. 'SHIFT_ARROW_LEFT': 'decrease_fast',
  7128. 'HOME': 'min',
  7129. 'END': 'max'
  7130. },
  7131. 'rtl': {
  7132. 'ARROW_LEFT': 'increase',
  7133. 'ARROW_RIGHT': 'decrease',
  7134. 'SHIFT_ARROW_LEFT': 'increase_fast',
  7135. 'SHIFT_ARROW_RIGHT': 'decrease_fast'
  7136. }
  7137. });
  7138. }
  7139. /**
  7140. * Initilizes the plugin by reading/setting attributes, creating collections and setting the initial position of the handle(s).
  7141. * @function
  7142. * @private
  7143. */
  7144. }, {
  7145. key: "_init",
  7146. value: function _init() {
  7147. this.inputs = this.$element.find('input');
  7148. this.handles = this.$element.find('[data-slider-handle]');
  7149. this.$handle = this.handles.eq(0);
  7150. this.$input = this.inputs.length ? this.inputs.eq(0) : jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(this.$handle.attr('aria-controls')));
  7151. this.$fill = this.$element.find('[data-slider-fill]').css(this.options.vertical ? 'height' : 'width', 0);
  7152. var isDbl = false,
  7153. _this = this;
  7154. if (this.options.disabled || this.$element.hasClass(this.options.disabledClass)) {
  7155. this.options.disabled = true;
  7156. this.$element.addClass(this.options.disabledClass);
  7157. }
  7158. if (!this.inputs.length) {
  7159. this.inputs = jquery__WEBPACK_IMPORTED_MODULE_0___default()().add(this.$input);
  7160. this.options.binding = true;
  7161. }
  7162. this._setInitAttr(0);
  7163. if (this.handles[1]) {
  7164. this.options.doubleSided = true;
  7165. this.$handle2 = this.handles.eq(1);
  7166. this.$input2 = this.inputs.length > 1 ? this.inputs.eq(1) : jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(this.$handle2.attr('aria-controls')));
  7167. if (!this.inputs[1]) {
  7168. this.inputs = this.inputs.add(this.$input2);
  7169. }
  7170. isDbl = true; // this.$handle.triggerHandler('click.zf.slider');
  7171. this._setInitAttr(1);
  7172. } // Set handle positions
  7173. this.setHandles();
  7174. this._events();
  7175. }
  7176. }, {
  7177. key: "setHandles",
  7178. value: function setHandles() {
  7179. var _this2 = this;
  7180. if (this.handles[1]) {
  7181. this._setHandlePos(this.$handle, this.inputs.eq(0).val(), true, function () {
  7182. _this2._setHandlePos(_this2.$handle2, _this2.inputs.eq(1).val(), true);
  7183. });
  7184. } else {
  7185. this._setHandlePos(this.$handle, this.inputs.eq(0).val(), true);
  7186. }
  7187. }
  7188. }, {
  7189. key: "_reflow",
  7190. value: function _reflow() {
  7191. this.setHandles();
  7192. }
  7193. /**
  7194. * @function
  7195. * @private
  7196. * @param {Number} value - floating point (the value) to be transformed using to a relative position on the slider (the inverse of _value)
  7197. */
  7198. }, {
  7199. key: "_pctOfBar",
  7200. value: function _pctOfBar(value) {
  7201. var pctOfBar = percent(value - this.options.start, this.options.end - this.options.start);
  7202. switch (this.options.positionValueFunction) {
  7203. case "pow":
  7204. pctOfBar = this._logTransform(pctOfBar);
  7205. break;
  7206. case "log":
  7207. pctOfBar = this._powTransform(pctOfBar);
  7208. break;
  7209. }
  7210. return pctOfBar.toFixed(2);
  7211. }
  7212. /**
  7213. * @function
  7214. * @private
  7215. * @param {Number} pctOfBar - floating point, the relative position of the slider (typically between 0-1) to be transformed to a value
  7216. */
  7217. }, {
  7218. key: "_value",
  7219. value: function _value(pctOfBar) {
  7220. switch (this.options.positionValueFunction) {
  7221. case "pow":
  7222. pctOfBar = this._powTransform(pctOfBar);
  7223. break;
  7224. case "log":
  7225. pctOfBar = this._logTransform(pctOfBar);
  7226. break;
  7227. }
  7228. var value = (this.options.end - this.options.start) * pctOfBar + parseFloat(this.options.start);
  7229. return value;
  7230. }
  7231. /**
  7232. * @function
  7233. * @private
  7234. * @param {Number} value - floating point (typically between 0-1) to be transformed using the log function
  7235. */
  7236. }, {
  7237. key: "_logTransform",
  7238. value: function _logTransform(value) {
  7239. return baseLog(this.options.nonLinearBase, value * (this.options.nonLinearBase - 1) + 1);
  7240. }
  7241. /**
  7242. * @function
  7243. * @private
  7244. * @param {Number} value - floating point (typically between 0-1) to be transformed using the power function
  7245. */
  7246. }, {
  7247. key: "_powTransform",
  7248. value: function _powTransform(value) {
  7249. return (Math.pow(this.options.nonLinearBase, value) - 1) / (this.options.nonLinearBase - 1);
  7250. }
  7251. /**
  7252. * Sets the position of the selected handle and fill bar.
  7253. * @function
  7254. * @private
  7255. * @param {jQuery} $hndl - the selected handle to move.
  7256. * @param {Number} location - floating point between the start and end values of the slider bar.
  7257. * @param {Function} cb - callback function to fire on completion.
  7258. * @fires Slider#moved
  7259. * @fires Slider#changed
  7260. */
  7261. }, {
  7262. key: "_setHandlePos",
  7263. value: function _setHandlePos($hndl, location, noInvert, cb) {
  7264. // don't move if the slider has been disabled since its initialization
  7265. if (this.$element.hasClass(this.options.disabledClass)) {
  7266. return;
  7267. } //might need to alter that slightly for bars that will have odd number selections.
  7268. location = parseFloat(location); //on input change events, convert string to number...grumble.
  7269. // prevent slider from running out of bounds, if value exceeds the limits set through options, override the value to min/max
  7270. if (location < this.options.start) {
  7271. location = this.options.start;
  7272. } else if (location > this.options.end) {
  7273. location = this.options.end;
  7274. }
  7275. var isDbl = this.options.doubleSided; //this is for single-handled vertical sliders, it adjusts the value to account for the slider being "upside-down"
  7276. //for click and drag events, it's weird due to the scale(-1, 1) css property
  7277. if (this.options.vertical && !noInvert) {
  7278. location = this.options.end - location;
  7279. }
  7280. if (isDbl) {
  7281. //this block is to prevent 2 handles from crossing eachother. Could/should be improved.
  7282. if (this.handles.index($hndl) === 0) {
  7283. var h2Val = parseFloat(this.$handle2.attr('aria-valuenow'));
  7284. location = location >= h2Val ? h2Val - this.options.step : location;
  7285. } else {
  7286. var h1Val = parseFloat(this.$handle.attr('aria-valuenow'));
  7287. location = location <= h1Val ? h1Val + this.options.step : location;
  7288. }
  7289. }
  7290. var _this = this,
  7291. vert = this.options.vertical,
  7292. hOrW = vert ? 'height' : 'width',
  7293. lOrT = vert ? 'top' : 'left',
  7294. handleDim = $hndl[0].getBoundingClientRect()[hOrW],
  7295. elemDim = this.$element[0].getBoundingClientRect()[hOrW],
  7296. //percentage of bar min/max value based on click or drag point
  7297. pctOfBar = this._pctOfBar(location),
  7298. //number of actual pixels to shift the handle, based on the percentage obtained above
  7299. pxToMove = (elemDim - handleDim) * pctOfBar,
  7300. //percentage of bar to shift the handle
  7301. movement = (percent(pxToMove, elemDim) * 100).toFixed(this.options.decimal); //fixing the decimal value for the location number, is passed to other methods as a fixed floating-point value
  7302. location = parseFloat(location.toFixed(this.options.decimal)); // declare empty object for css adjustments, only used with 2 handled-sliders
  7303. var css = {};
  7304. this._setValues($hndl, location); // TODO update to calculate based on values set to respective inputs??
  7305. if (isDbl) {
  7306. var isLeftHndl = this.handles.index($hndl) === 0,
  7307. //empty variable, will be used for min-height/width for fill bar
  7308. dim,
  7309. //percentage w/h of the handle compared to the slider bar
  7310. handlePct = ~~(percent(handleDim, elemDim) * 100); //if left handle, the math is slightly different than if it's the right handle, and the left/top property needs to be changed for the fill bar
  7311. if (isLeftHndl) {
  7312. //left or top percentage value to apply to the fill bar.
  7313. css[lOrT] = "".concat(movement, "%"); //calculate the new min-height/width for the fill bar.
  7314. dim = parseFloat(this.$handle2[0].style[lOrT]) - movement + handlePct; //this callback is necessary to prevent errors and allow the proper placement and initialization of a 2-handled slider
  7315. //plus, it means we don't care if 'dim' isNaN on init, it won't be in the future.
  7316. if (cb && typeof cb === 'function') {
  7317. cb();
  7318. } //this is only needed for the initialization of 2 handled sliders
  7319. } else {
  7320. //just caching the value of the left/bottom handle's left/top property
  7321. var handlePos = parseFloat(this.$handle[0].style[lOrT]); //calculate the new min-height/width for the fill bar. Use isNaN to prevent false positives for numbers <= 0
  7322. //based on the percentage of movement of the handle being manipulated, less the opposing handle's left/top position, plus the percentage w/h of the handle itself
  7323. dim = movement - (isNaN(handlePos) ? (this.options.initialStart - this.options.start) / ((this.options.end - this.options.start) / 100) : handlePos) + handlePct;
  7324. } // assign the min-height/width to our css object
  7325. css["min-".concat(hOrW)] = "".concat(dim, "%");
  7326. }
  7327. this.$element.one('finished.zf.animate', function () {
  7328. /**
  7329. * Fires when the handle is done moving.
  7330. * @event Slider#moved
  7331. */
  7332. _this.$element.trigger('moved.zf.slider', [$hndl]);
  7333. }); //because we don't know exactly how the handle will be moved, check the amount of time it should take to move.
  7334. var moveTime = this.$element.data('dragging') ? 1000 / 60 : this.options.moveTime;
  7335. Object(_foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Move"])(moveTime, $hndl, function () {
  7336. // adjusting the left/top property of the handle, based on the percentage calculated above
  7337. // if movement isNaN, that is because the slider is hidden and we cannot determine handle width,
  7338. // fall back to next best guess.
  7339. if (isNaN(movement)) {
  7340. $hndl.css(lOrT, "".concat(pctOfBar * 100, "%"));
  7341. } else {
  7342. $hndl.css(lOrT, "".concat(movement, "%"));
  7343. }
  7344. if (!_this.options.doubleSided) {
  7345. //if single-handled, a simple method to expand the fill bar
  7346. _this.$fill.css(hOrW, "".concat(pctOfBar * 100, "%"));
  7347. } else {
  7348. //otherwise, use the css object we created above
  7349. _this.$fill.css(css);
  7350. }
  7351. });
  7352. /**
  7353. * Fires when the value has not been change for a given time.
  7354. * @event Slider#changed
  7355. */
  7356. clearTimeout(_this.timeout);
  7357. _this.timeout = setTimeout(function () {
  7358. _this.$element.trigger('changed.zf.slider', [$hndl]);
  7359. }, _this.options.changedDelay);
  7360. }
  7361. /**
  7362. * Sets the initial attribute for the slider element.
  7363. * @function
  7364. * @private
  7365. * @param {Number} idx - index of the current handle/input to use.
  7366. */
  7367. }, {
  7368. key: "_setInitAttr",
  7369. value: function _setInitAttr(idx) {
  7370. var initVal = idx === 0 ? this.options.initialStart : this.options.initialEnd;
  7371. var id = this.inputs.eq(idx).attr('id') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'slider');
  7372. this.inputs.eq(idx).attr({
  7373. 'id': id,
  7374. 'max': this.options.end,
  7375. 'min': this.options.start,
  7376. 'step': this.options.step
  7377. });
  7378. this.inputs.eq(idx).val(initVal);
  7379. this.handles.eq(idx).attr({
  7380. 'role': 'slider',
  7381. 'aria-controls': id,
  7382. 'aria-valuemax': this.options.end,
  7383. 'aria-valuemin': this.options.start,
  7384. 'aria-valuenow': initVal,
  7385. 'aria-orientation': this.options.vertical ? 'vertical' : 'horizontal',
  7386. 'tabindex': 0
  7387. });
  7388. }
  7389. /**
  7390. * Sets the input and `aria-valuenow` values for the slider element.
  7391. * @function
  7392. * @private
  7393. * @param {jQuery} $handle - the currently selected handle.
  7394. * @param {Number} val - floating point of the new value.
  7395. */
  7396. }, {
  7397. key: "_setValues",
  7398. value: function _setValues($handle, val) {
  7399. var idx = this.options.doubleSided ? this.handles.index($handle) : 0;
  7400. this.inputs.eq(idx).val(val);
  7401. $handle.attr('aria-valuenow', val);
  7402. }
  7403. /**
  7404. * Handles events on the slider element.
  7405. * Calculates the new location of the current handle.
  7406. * If there are two handles and the bar was clicked, it determines which handle to move.
  7407. * @function
  7408. * @private
  7409. * @param {Object} e - the `event` object passed from the listener.
  7410. * @param {jQuery} $handle - the current handle to calculate for, if selected.
  7411. * @param {Number} val - floating point number for the new value of the slider.
  7412. * TODO clean this up, there's a lot of repeated code between this and the _setHandlePos fn.
  7413. */
  7414. }, {
  7415. key: "_handleEvent",
  7416. value: function _handleEvent(e, $handle, val) {
  7417. var value, hasVal;
  7418. if (!val) {
  7419. //click or drag events
  7420. e.preventDefault();
  7421. var _this = this,
  7422. vertical = this.options.vertical,
  7423. param = vertical ? 'height' : 'width',
  7424. direction = vertical ? 'top' : 'left',
  7425. eventOffset = vertical ? e.pageY : e.pageX,
  7426. halfOfHandle = this.$handle[0].getBoundingClientRect()[param] / 2,
  7427. barDim = this.$element[0].getBoundingClientRect()[param],
  7428. windowScroll = vertical ? jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).scrollTop() : jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).scrollLeft();
  7429. var elemOffset = this.$element.offset()[direction]; // touch events emulated by the touch util give position relative to screen, add window.scroll to event coordinates...
  7430. // best way to guess this is simulated is if clientY == pageY
  7431. if (e.clientY === e.pageY) {
  7432. eventOffset = eventOffset + windowScroll;
  7433. }
  7434. var eventFromBar = eventOffset - elemOffset;
  7435. var barXY;
  7436. if (eventFromBar < 0) {
  7437. barXY = 0;
  7438. } else if (eventFromBar > barDim) {
  7439. barXY = barDim;
  7440. } else {
  7441. barXY = eventFromBar;
  7442. }
  7443. var offsetPct = percent(barXY, barDim);
  7444. value = this._value(offsetPct); // turn everything around for RTL, yay math!
  7445. if (Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["rtl"])() && !this.options.vertical) {
  7446. value = this.options.end - value;
  7447. }
  7448. value = _this._adjustValue(null, value); //boolean flag for the setHandlePos fn, specifically for vertical sliders
  7449. hasVal = false;
  7450. if (!$handle) {
  7451. //figure out which handle it is, pass it to the next function.
  7452. var firstHndlPos = absPosition(this.$handle, direction, barXY, param),
  7453. secndHndlPos = absPosition(this.$handle2, direction, barXY, param);
  7454. $handle = firstHndlPos <= secndHndlPos ? this.$handle : this.$handle2;
  7455. }
  7456. } else {
  7457. //change event on input
  7458. value = this._adjustValue(null, val);
  7459. hasVal = true;
  7460. }
  7461. this._setHandlePos($handle, value, hasVal);
  7462. }
  7463. /**
  7464. * Adjustes value for handle in regard to step value. returns adjusted value
  7465. * @function
  7466. * @private
  7467. * @param {jQuery} $handle - the selected handle.
  7468. * @param {Number} value - value to adjust. used if $handle is falsy
  7469. */
  7470. }, {
  7471. key: "_adjustValue",
  7472. value: function _adjustValue($handle, value) {
  7473. var val,
  7474. step = this.options.step,
  7475. div = parseFloat(step / 2),
  7476. left,
  7477. prev_val,
  7478. next_val;
  7479. if (!!$handle) {
  7480. val = parseFloat($handle.attr('aria-valuenow'));
  7481. } else {
  7482. val = value;
  7483. }
  7484. if (val >= 0) {
  7485. left = val % step;
  7486. } else {
  7487. left = step + val % step;
  7488. }
  7489. prev_val = val - left;
  7490. next_val = prev_val + step;
  7491. if (left === 0) {
  7492. return val;
  7493. }
  7494. val = val >= prev_val + div ? next_val : prev_val;
  7495. return val;
  7496. }
  7497. /**
  7498. * Adds event listeners to the slider elements.
  7499. * @function
  7500. * @private
  7501. */
  7502. }, {
  7503. key: "_events",
  7504. value: function _events() {
  7505. this._eventsForHandle(this.$handle);
  7506. if (this.handles[1]) {
  7507. this._eventsForHandle(this.$handle2);
  7508. }
  7509. }
  7510. /**
  7511. * Adds event listeners a particular handle
  7512. * @function
  7513. * @private
  7514. * @param {jQuery} $handle - the current handle to apply listeners to.
  7515. */
  7516. }, {
  7517. key: "_eventsForHandle",
  7518. value: function _eventsForHandle($handle) {
  7519. var _this = this,
  7520. curHandle,
  7521. timer;
  7522. var handleChangeEvent = function handleChangeEvent(e) {
  7523. var idx = _this.inputs.index(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this));
  7524. _this._handleEvent(e, _this.handles.eq(idx), jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val());
  7525. }; // IE only triggers the change event when the input loses focus which strictly follows the HTML specification
  7526. // listen for the enter key and trigger a change
  7527. // @see https://html.spec.whatwg.org/multipage/input.html#common-input-element-events
  7528. this.inputs.off('keyup.zf.slider').on('keyup.zf.slider', function (e) {
  7529. if (e.keyCode == 13) handleChangeEvent.call(this, e);
  7530. });
  7531. this.inputs.off('change.zf.slider').on('change.zf.slider', handleChangeEvent);
  7532. if (this.options.clickSelect) {
  7533. this.$element.off('click.zf.slider').on('click.zf.slider', function (e) {
  7534. if (_this.$element.data('dragging')) {
  7535. return false;
  7536. }
  7537. if (!jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).is('[data-slider-handle]')) {
  7538. if (_this.options.doubleSided) {
  7539. _this._handleEvent(e);
  7540. } else {
  7541. _this._handleEvent(e, _this.$handle);
  7542. }
  7543. }
  7544. });
  7545. }
  7546. if (this.options.draggable) {
  7547. this.handles.addTouch();
  7548. var $body = jquery__WEBPACK_IMPORTED_MODULE_0___default()('body');
  7549. $handle.off('mousedown.zf.slider').on('mousedown.zf.slider', function (e) {
  7550. $handle.addClass('is-dragging');
  7551. _this.$fill.addClass('is-dragging'); //
  7552. _this.$element.data('dragging', true);
  7553. curHandle = jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.currentTarget);
  7554. $body.on('mousemove.zf.slider', function (e) {
  7555. e.preventDefault();
  7556. _this._handleEvent(e, curHandle);
  7557. }).on('mouseup.zf.slider', function (e) {
  7558. _this._handleEvent(e, curHandle);
  7559. $handle.removeClass('is-dragging');
  7560. _this.$fill.removeClass('is-dragging');
  7561. _this.$element.data('dragging', false);
  7562. $body.off('mousemove.zf.slider mouseup.zf.slider');
  7563. });
  7564. }) // prevent events triggered by touch
  7565. .on('selectstart.zf.slider touchmove.zf.slider', function (e) {
  7566. e.preventDefault();
  7567. });
  7568. }
  7569. $handle.off('keydown.zf.slider').on('keydown.zf.slider', function (e) {
  7570. var _$handle = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  7571. idx = _this.options.doubleSided ? _this.handles.index(_$handle) : 0,
  7572. oldValue = parseFloat(_this.inputs.eq(idx).val()),
  7573. newValue; // handle keyboard event with keyboard util
  7574. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'Slider', {
  7575. decrease: function decrease() {
  7576. newValue = oldValue - _this.options.step;
  7577. },
  7578. increase: function increase() {
  7579. newValue = oldValue + _this.options.step;
  7580. },
  7581. decrease_fast: function decrease_fast() {
  7582. newValue = oldValue - _this.options.step * 10;
  7583. },
  7584. increase_fast: function increase_fast() {
  7585. newValue = oldValue + _this.options.step * 10;
  7586. },
  7587. min: function min() {
  7588. newValue = _this.options.start;
  7589. },
  7590. max: function max() {
  7591. newValue = _this.options.end;
  7592. },
  7593. handled: function handled() {
  7594. // only set handle pos when event was handled specially
  7595. e.preventDefault();
  7596. _this._setHandlePos(_$handle, newValue, true);
  7597. }
  7598. });
  7599. /*if (newValue) { // if pressed key has special function, update value
  7600. e.preventDefault();
  7601. _this._setHandlePos(_$handle, newValue);
  7602. }*/
  7603. });
  7604. }
  7605. /**
  7606. * Destroys the slider plugin.
  7607. */
  7608. }, {
  7609. key: "_destroy",
  7610. value: function _destroy() {
  7611. this.handles.off('.zf.slider');
  7612. this.inputs.off('.zf.slider');
  7613. this.$element.off('.zf.slider');
  7614. clearTimeout(this.timeout);
  7615. }
  7616. }]);
  7617. return Slider;
  7618. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__["Plugin"]);
  7619. Slider.defaults = {
  7620. /**
  7621. * Minimum value for the slider scale.
  7622. * @option
  7623. * @type {number}
  7624. * @default 0
  7625. */
  7626. start: 0,
  7627. /**
  7628. * Maximum value for the slider scale.
  7629. * @option
  7630. * @type {number}
  7631. * @default 100
  7632. */
  7633. end: 100,
  7634. /**
  7635. * Minimum value change per change event.
  7636. * @option
  7637. * @type {number}
  7638. * @default 1
  7639. */
  7640. step: 1,
  7641. /**
  7642. * Value at which the handle/input *(left handle/first input)* should be set to on initialization.
  7643. * @option
  7644. * @type {number}
  7645. * @default 0
  7646. */
  7647. initialStart: 0,
  7648. /**
  7649. * Value at which the right handle/second input should be set to on initialization.
  7650. * @option
  7651. * @type {number}
  7652. * @default 100
  7653. */
  7654. initialEnd: 100,
  7655. /**
  7656. * Allows the input to be located outside the container and visible. Set to by the JS
  7657. * @option
  7658. * @type {boolean}
  7659. * @default false
  7660. */
  7661. binding: false,
  7662. /**
  7663. * Allows the user to click/tap on the slider bar to select a value.
  7664. * @option
  7665. * @type {boolean}
  7666. * @default true
  7667. */
  7668. clickSelect: true,
  7669. /**
  7670. * Set to true and use the `vertical` class to change alignment to vertical.
  7671. * @option
  7672. * @type {boolean}
  7673. * @default false
  7674. */
  7675. vertical: false,
  7676. /**
  7677. * Allows the user to drag the slider handle(s) to select a value.
  7678. * @option
  7679. * @type {boolean}
  7680. * @default true
  7681. */
  7682. draggable: true,
  7683. /**
  7684. * Disables the slider and prevents event listeners from being applied. Double checked by JS with `disabledClass`.
  7685. * @option
  7686. * @type {boolean}
  7687. * @default false
  7688. */
  7689. disabled: false,
  7690. /**
  7691. * Allows the use of two handles. Double checked by the JS. Changes some logic handling.
  7692. * @option
  7693. * @type {boolean}
  7694. * @default false
  7695. */
  7696. doubleSided: false,
  7697. /**
  7698. * Potential future feature.
  7699. */
  7700. // steps: 100,
  7701. /**
  7702. * Number of decimal places the plugin should go to for floating point precision.
  7703. * @option
  7704. * @type {number}
  7705. * @default 2
  7706. */
  7707. decimal: 2,
  7708. /**
  7709. * Time delay for dragged elements.
  7710. */
  7711. // dragDelay: 0,
  7712. /**
  7713. * Time, in ms, to animate the movement of a slider handle if user clicks/taps on the bar. Needs to be manually set if updating the transition time in the Sass settings.
  7714. * @option
  7715. * @type {number}
  7716. * @default 200
  7717. */
  7718. moveTime: 200,
  7719. //update this if changing the transition time in the sass
  7720. /**
  7721. * Class applied to disabled sliders.
  7722. * @option
  7723. * @type {string}
  7724. * @default 'disabled'
  7725. */
  7726. disabledClass: 'disabled',
  7727. /**
  7728. * Will invert the default layout for a vertical<span data-tooltip title="who would do this???"> </span>slider.
  7729. * @option
  7730. * @type {boolean}
  7731. * @default false
  7732. */
  7733. invertVertical: false,
  7734. /**
  7735. * Milliseconds before the `changed.zf-slider` event is triggered after value change.
  7736. * @option
  7737. * @type {number}
  7738. * @default 500
  7739. */
  7740. changedDelay: 500,
  7741. /**
  7742. * Basevalue for non-linear sliders
  7743. * @option
  7744. * @type {number}
  7745. * @default 5
  7746. */
  7747. nonLinearBase: 5,
  7748. /**
  7749. * Basevalue for non-linear sliders, possible values are: `'linear'`, `'pow'` & `'log'`. Pow and Log use the nonLinearBase setting.
  7750. * @option
  7751. * @type {string}
  7752. * @default 'linear'
  7753. */
  7754. positionValueFunction: 'linear'
  7755. };
  7756. function percent(frac, num) {
  7757. return frac / num;
  7758. }
  7759. function absPosition($handle, dir, clickPos, param) {
  7760. return Math.abs($handle.position()[dir] + $handle[param]() / 2 - clickPos);
  7761. }
  7762. function baseLog(base, value) {
  7763. return Math.log(value) / Math.log(base);
  7764. }
  7765. /***/ }),
  7766. /***/ "./js/foundation.smoothScroll.js":
  7767. /*!***************************************!*\
  7768. !*** ./js/foundation.smoothScroll.js ***!
  7769. \***************************************/
  7770. /*! exports provided: SmoothScroll */
  7771. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7772. "use strict";
  7773. __webpack_require__.r(__webpack_exports__);
  7774. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SmoothScroll", function() { return SmoothScroll; });
  7775. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  7776. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  7777. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  7778. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  7779. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  7780. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7781. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  7782. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  7783. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  7784. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  7785. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  7786. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  7787. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  7788. /**
  7789. * SmoothScroll module.
  7790. * @module foundation.smooth-scroll
  7791. */
  7792. var SmoothScroll =
  7793. /*#__PURE__*/
  7794. function (_Plugin) {
  7795. _inherits(SmoothScroll, _Plugin);
  7796. function SmoothScroll() {
  7797. _classCallCheck(this, SmoothScroll);
  7798. return _possibleConstructorReturn(this, _getPrototypeOf(SmoothScroll).apply(this, arguments));
  7799. }
  7800. _createClass(SmoothScroll, [{
  7801. key: "_setup",
  7802. /**
  7803. * Creates a new instance of SmoothScroll.
  7804. * @class
  7805. * @name SmoothScroll
  7806. * @fires SmoothScroll#init
  7807. * @param {Object} element - jQuery object to add the trigger to.
  7808. * @param {Object} options - Overrides to the default plugin settings.
  7809. */
  7810. value: function _setup(element, options) {
  7811. this.$element = element;
  7812. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, SmoothScroll.defaults, this.$element.data(), options);
  7813. this.className = 'SmoothScroll'; // ie9 back compat
  7814. this._init();
  7815. }
  7816. /**
  7817. * Initialize the SmoothScroll plugin
  7818. * @private
  7819. */
  7820. }, {
  7821. key: "_init",
  7822. value: function _init() {
  7823. var id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, 'smooth-scroll');
  7824. this.$element.attr({
  7825. id: id
  7826. });
  7827. this._events();
  7828. }
  7829. /**
  7830. * Initializes events for SmoothScroll.
  7831. * @private
  7832. */
  7833. }, {
  7834. key: "_events",
  7835. value: function _events() {
  7836. this._linkClickListener = this._handleLinkClick.bind(this);
  7837. this.$element.on('click.zf.smoothScroll', this._linkClickListener);
  7838. this.$element.on('click.zf.smoothScroll', 'a[href^="#"]', this._linkClickListener);
  7839. }
  7840. /**
  7841. * Handle the given event to smoothly scroll to the anchor pointed by the event target.
  7842. * @param {*} e - event
  7843. * @function
  7844. * @private
  7845. */
  7846. }, {
  7847. key: "_handleLinkClick",
  7848. value: function _handleLinkClick(e) {
  7849. var _this = this;
  7850. // Follow the link if it does not point to an anchor.
  7851. if (!jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.currentTarget).is('a[href^="#"]')) return;
  7852. var arrival = e.currentTarget.getAttribute('href');
  7853. this._inTransition = true;
  7854. SmoothScroll.scrollToLoc(arrival, this.options, function () {
  7855. _this._inTransition = false;
  7856. });
  7857. e.preventDefault();
  7858. }
  7859. }, {
  7860. key: "_destroy",
  7861. /**
  7862. * Destroys the SmoothScroll instance.
  7863. * @function
  7864. */
  7865. value: function _destroy() {
  7866. this.$element.off('click.zf.smoothScroll', this._linkClickListener);
  7867. this.$element.off('click.zf.smoothScroll', 'a[href^="#"]', this._linkClickListener);
  7868. }
  7869. }], [{
  7870. key: "scrollToLoc",
  7871. /**
  7872. * Function to scroll to a given location on the page.
  7873. * @param {String} loc - A properly formatted jQuery id selector. Example: '#foo'
  7874. * @param {Object} options - The options to use.
  7875. * @param {Function} callback - The callback function.
  7876. * @static
  7877. * @function
  7878. */
  7879. value: function scrollToLoc(loc) {
  7880. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : SmoothScroll.defaults;
  7881. var callback = arguments.length > 2 ? arguments[2] : undefined;
  7882. var $loc = jquery__WEBPACK_IMPORTED_MODULE_0___default()(loc); // Do nothing if target does not exist to prevent errors
  7883. if (!$loc.length) return false;
  7884. var scrollPos = Math.round($loc.offset().top - options.threshold / 2 - options.offset);
  7885. jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').stop(true).animate({
  7886. scrollTop: scrollPos
  7887. }, options.animationDuration, options.animationEasing, function () {
  7888. if (typeof callback === 'function') {
  7889. callback();
  7890. }
  7891. });
  7892. }
  7893. }]);
  7894. return SmoothScroll;
  7895. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__["Plugin"]);
  7896. /**
  7897. * Default settings for plugin.
  7898. */
  7899. SmoothScroll.defaults = {
  7900. /**
  7901. * Amount of time, in ms, the animated scrolling should take between locations.
  7902. * @option
  7903. * @type {number}
  7904. * @default 500
  7905. */
  7906. animationDuration: 500,
  7907. /**
  7908. * Animation style to use when scrolling between locations. Can be `'swing'` or `'linear'`.
  7909. * @option
  7910. * @type {string}
  7911. * @default 'linear'
  7912. * @see {@link https://api.jquery.com/animate|Jquery animate}
  7913. */
  7914. animationEasing: 'linear',
  7915. /**
  7916. * Number of pixels to use as a marker for location changes.
  7917. * @option
  7918. * @type {number}
  7919. * @default 50
  7920. */
  7921. threshold: 50,
  7922. /**
  7923. * Number of pixels to offset the scroll of the page on item click if using a sticky nav bar.
  7924. * @option
  7925. * @type {number}
  7926. * @default 0
  7927. */
  7928. offset: 0
  7929. };
  7930. /***/ }),
  7931. /***/ "./js/foundation.sticky.js":
  7932. /*!*********************************!*\
  7933. !*** ./js/foundation.sticky.js ***!
  7934. \*********************************/
  7935. /*! exports provided: Sticky */
  7936. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7937. "use strict";
  7938. __webpack_require__.r(__webpack_exports__);
  7939. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Sticky", function() { return Sticky; });
  7940. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  7941. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  7942. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  7943. /* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js");
  7944. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  7945. /* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js");
  7946. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  7947. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7948. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  7949. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  7950. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  7951. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  7952. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  7953. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  7954. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  7955. /**
  7956. * Sticky module.
  7957. * @module foundation.sticky
  7958. * @requires foundation.util.triggers
  7959. * @requires foundation.util.mediaQuery
  7960. */
  7961. var Sticky =
  7962. /*#__PURE__*/
  7963. function (_Plugin) {
  7964. _inherits(Sticky, _Plugin);
  7965. function Sticky() {
  7966. _classCallCheck(this, Sticky);
  7967. return _possibleConstructorReturn(this, _getPrototypeOf(Sticky).apply(this, arguments));
  7968. }
  7969. _createClass(Sticky, [{
  7970. key: "_setup",
  7971. /**
  7972. * Creates a new instance of a sticky thing.
  7973. * @class
  7974. * @name Sticky
  7975. * @param {jQuery} element - jQuery object to make sticky.
  7976. * @param {Object} options - options object passed when creating the element programmatically.
  7977. */
  7978. value: function _setup(element, options) {
  7979. this.$element = element;
  7980. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Sticky.defaults, this.$element.data(), options);
  7981. this.className = 'Sticky'; // ie9 back compat
  7982. // Triggers init is idempotent, just need to make sure it is initialized
  7983. _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
  7984. this._init();
  7985. }
  7986. /**
  7987. * Initializes the sticky element by adding classes, getting/setting dimensions, breakpoints and attributes
  7988. * @function
  7989. * @private
  7990. */
  7991. }, {
  7992. key: "_init",
  7993. value: function _init() {
  7994. _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__["MediaQuery"]._init();
  7995. var $parent = this.$element.parent('[data-sticky-container]'),
  7996. id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, 'sticky'),
  7997. _this = this;
  7998. if ($parent.length) {
  7999. this.$container = $parent;
  8000. } else {
  8001. this.wasWrapped = true;
  8002. this.$element.wrap(this.options.container);
  8003. this.$container = this.$element.parent();
  8004. }
  8005. this.$container.addClass(this.options.containerClass);
  8006. this.$element.addClass(this.options.stickyClass).attr({
  8007. 'data-resize': id,
  8008. 'data-mutate': id
  8009. });
  8010. if (this.options.anchor !== '') {
  8011. jquery__WEBPACK_IMPORTED_MODULE_0___default()('#' + _this.options.anchor).attr({
  8012. 'data-mutate': id
  8013. });
  8014. }
  8015. this.scrollCount = this.options.checkEvery;
  8016. this.isStuck = false;
  8017. this.onLoadListener = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () {
  8018. //We calculate the container height to have correct values for anchor points offset calculation.
  8019. _this.containerHeight = _this.$element.css("display") == "none" ? 0 : _this.$element[0].getBoundingClientRect().height;
  8020. _this.$container.css('height', _this.containerHeight);
  8021. _this.elemHeight = _this.containerHeight;
  8022. if (_this.options.anchor !== '') {
  8023. _this.$anchor = jquery__WEBPACK_IMPORTED_MODULE_0___default()('#' + _this.options.anchor);
  8024. } else {
  8025. _this._parsePoints();
  8026. }
  8027. _this._setSizes(function () {
  8028. var scroll = window.pageYOffset;
  8029. _this._calc(false, scroll); //Unstick the element will ensure that proper classes are set.
  8030. if (!_this.isStuck) {
  8031. _this._removeSticky(scroll >= _this.topPoint ? false : true);
  8032. }
  8033. });
  8034. _this._events(id.split('-').reverse().join('-'));
  8035. });
  8036. }
  8037. /**
  8038. * If using multiple elements as anchors, calculates the top and bottom pixel values the sticky thing should stick and unstick on.
  8039. * @function
  8040. * @private
  8041. */
  8042. }, {
  8043. key: "_parsePoints",
  8044. value: function _parsePoints() {
  8045. var top = this.options.topAnchor == "" ? 1 : this.options.topAnchor,
  8046. btm = this.options.btmAnchor == "" ? document.documentElement.scrollHeight : this.options.btmAnchor,
  8047. pts = [top, btm],
  8048. breaks = {};
  8049. for (var i = 0, len = pts.length; i < len && pts[i]; i++) {
  8050. var pt;
  8051. if (typeof pts[i] === 'number') {
  8052. pt = pts[i];
  8053. } else {
  8054. var place = pts[i].split(':'),
  8055. anchor = jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(place[0]));
  8056. pt = anchor.offset().top;
  8057. if (place[1] && place[1].toLowerCase() === 'bottom') {
  8058. pt += anchor[0].getBoundingClientRect().height;
  8059. }
  8060. }
  8061. breaks[i] = pt;
  8062. }
  8063. this.points = breaks;
  8064. return;
  8065. }
  8066. /**
  8067. * Adds event handlers for the scrolling element.
  8068. * @private
  8069. * @param {String} id - pseudo-random id for unique scroll event listener.
  8070. */
  8071. }, {
  8072. key: "_events",
  8073. value: function _events(id) {
  8074. var _this = this,
  8075. scrollListener = this.scrollListener = "scroll.zf.".concat(id);
  8076. if (this.isOn) {
  8077. return;
  8078. }
  8079. if (this.canStick) {
  8080. this.isOn = true;
  8081. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(scrollListener).on(scrollListener, function (e) {
  8082. if (_this.scrollCount === 0) {
  8083. _this.scrollCount = _this.options.checkEvery;
  8084. _this._setSizes(function () {
  8085. _this._calc(false, window.pageYOffset);
  8086. });
  8087. } else {
  8088. _this.scrollCount--;
  8089. _this._calc(false, window.pageYOffset);
  8090. }
  8091. });
  8092. }
  8093. this.$element.off('resizeme.zf.trigger').on('resizeme.zf.trigger', function (e, el) {
  8094. _this._eventsHandler(id);
  8095. });
  8096. this.$element.on('mutateme.zf.trigger', function (e, el) {
  8097. _this._eventsHandler(id);
  8098. });
  8099. if (this.$anchor) {
  8100. this.$anchor.on('mutateme.zf.trigger', function (e, el) {
  8101. _this._eventsHandler(id);
  8102. });
  8103. }
  8104. }
  8105. /**
  8106. * Handler for events.
  8107. * @private
  8108. * @param {String} id - pseudo-random id for unique scroll event listener.
  8109. */
  8110. }, {
  8111. key: "_eventsHandler",
  8112. value: function _eventsHandler(id) {
  8113. var _this = this,
  8114. scrollListener = this.scrollListener = "scroll.zf.".concat(id);
  8115. _this._setSizes(function () {
  8116. _this._calc(false);
  8117. if (_this.canStick) {
  8118. if (!_this.isOn) {
  8119. _this._events(id);
  8120. }
  8121. } else if (_this.isOn) {
  8122. _this._pauseListeners(scrollListener);
  8123. }
  8124. });
  8125. }
  8126. /**
  8127. * Removes event handlers for scroll and change events on anchor.
  8128. * @fires Sticky#pause
  8129. * @param {String} scrollListener - unique, namespaced scroll listener attached to `window`
  8130. */
  8131. }, {
  8132. key: "_pauseListeners",
  8133. value: function _pauseListeners(scrollListener) {
  8134. this.isOn = false;
  8135. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(scrollListener);
  8136. /**
  8137. * Fires when the plugin is paused due to resize event shrinking the view.
  8138. * @event Sticky#pause
  8139. * @private
  8140. */
  8141. this.$element.trigger('pause.zf.sticky');
  8142. }
  8143. /**
  8144. * Called on every `scroll` event and on `_init`
  8145. * fires functions based on booleans and cached values
  8146. * @param {Boolean} checkSizes - true if plugin should recalculate sizes and breakpoints.
  8147. * @param {Number} scroll - current scroll position passed from scroll event cb function. If not passed, defaults to `window.pageYOffset`.
  8148. */
  8149. }, {
  8150. key: "_calc",
  8151. value: function _calc(checkSizes, scroll) {
  8152. if (checkSizes) {
  8153. this._setSizes();
  8154. }
  8155. if (!this.canStick) {
  8156. if (this.isStuck) {
  8157. this._removeSticky(true);
  8158. }
  8159. return false;
  8160. }
  8161. if (!scroll) {
  8162. scroll = window.pageYOffset;
  8163. }
  8164. if (scroll >= this.topPoint) {
  8165. if (scroll <= this.bottomPoint) {
  8166. if (!this.isStuck) {
  8167. this._setSticky();
  8168. }
  8169. } else {
  8170. if (this.isStuck) {
  8171. this._removeSticky(false);
  8172. }
  8173. }
  8174. } else {
  8175. if (this.isStuck) {
  8176. this._removeSticky(true);
  8177. }
  8178. }
  8179. }
  8180. /**
  8181. * Causes the $element to become stuck.
  8182. * Adds `position: fixed;`, and helper classes.
  8183. * @fires Sticky#stuckto
  8184. * @function
  8185. * @private
  8186. */
  8187. }, {
  8188. key: "_setSticky",
  8189. value: function _setSticky() {
  8190. var _this = this,
  8191. stickTo = this.options.stickTo,
  8192. mrgn = stickTo === 'top' ? 'marginTop' : 'marginBottom',
  8193. notStuckTo = stickTo === 'top' ? 'bottom' : 'top',
  8194. css = {};
  8195. css[mrgn] = "".concat(this.options[mrgn], "em");
  8196. css[stickTo] = 0;
  8197. css[notStuckTo] = 'auto';
  8198. this.isStuck = true;
  8199. this.$element.removeClass("is-anchored is-at-".concat(notStuckTo)).addClass("is-stuck is-at-".concat(stickTo)).css(css)
  8200. /**
  8201. * Fires when the $element has become `position: fixed;`
  8202. * Namespaced to `top` or `bottom`, e.g. `sticky.zf.stuckto:top`
  8203. * @event Sticky#stuckto
  8204. */
  8205. .trigger("sticky.zf.stuckto:".concat(stickTo));
  8206. this.$element.on("transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd", function () {
  8207. _this._setSizes();
  8208. });
  8209. }
  8210. /**
  8211. * Causes the $element to become unstuck.
  8212. * Removes `position: fixed;`, and helper classes.
  8213. * Adds other helper classes.
  8214. * @param {Boolean} isTop - tells the function if the $element should anchor to the top or bottom of its $anchor element.
  8215. * @fires Sticky#unstuckfrom
  8216. * @private
  8217. */
  8218. }, {
  8219. key: "_removeSticky",
  8220. value: function _removeSticky(isTop) {
  8221. var stickTo = this.options.stickTo,
  8222. stickToTop = stickTo === 'top',
  8223. css = {},
  8224. anchorPt = (this.points ? this.points[1] - this.points[0] : this.anchorHeight) - this.elemHeight,
  8225. mrgn = stickToTop ? 'marginTop' : 'marginBottom',
  8226. notStuckTo = stickToTop ? 'bottom' : 'top',
  8227. topOrBottom = isTop ? 'top' : 'bottom';
  8228. css[mrgn] = 0;
  8229. css['bottom'] = 'auto';
  8230. if (isTop) {
  8231. css['top'] = 0;
  8232. } else {
  8233. css['top'] = anchorPt;
  8234. }
  8235. this.isStuck = false;
  8236. this.$element.removeClass("is-stuck is-at-".concat(stickTo)).addClass("is-anchored is-at-".concat(topOrBottom)).css(css)
  8237. /**
  8238. * Fires when the $element has become anchored.
  8239. * Namespaced to `top` or `bottom`, e.g. `sticky.zf.unstuckfrom:bottom`
  8240. * @event Sticky#unstuckfrom
  8241. */
  8242. .trigger("sticky.zf.unstuckfrom:".concat(topOrBottom));
  8243. }
  8244. /**
  8245. * Sets the $element and $container sizes for plugin.
  8246. * Calls `_setBreakPoints`.
  8247. * @param {Function} cb - optional callback function to fire on completion of `_setBreakPoints`.
  8248. * @private
  8249. */
  8250. }, {
  8251. key: "_setSizes",
  8252. value: function _setSizes(cb) {
  8253. this.canStick = _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__["MediaQuery"].is(this.options.stickyOn);
  8254. if (!this.canStick) {
  8255. if (cb && typeof cb === 'function') {
  8256. cb();
  8257. }
  8258. }
  8259. var _this = this,
  8260. newElemWidth = this.$container[0].getBoundingClientRect().width,
  8261. comp = window.getComputedStyle(this.$container[0]),
  8262. pdngl = parseInt(comp['padding-left'], 10),
  8263. pdngr = parseInt(comp['padding-right'], 10);
  8264. if (this.$anchor && this.$anchor.length) {
  8265. this.anchorHeight = this.$anchor[0].getBoundingClientRect().height;
  8266. } else {
  8267. this._parsePoints();
  8268. }
  8269. this.$element.css({
  8270. 'max-width': "".concat(newElemWidth - pdngl - pdngr, "px")
  8271. });
  8272. var newContainerHeight = this.$element[0].getBoundingClientRect().height || this.containerHeight;
  8273. if (this.$element.css("display") == "none") {
  8274. newContainerHeight = 0;
  8275. }
  8276. this.containerHeight = newContainerHeight;
  8277. this.$container.css({
  8278. height: newContainerHeight
  8279. });
  8280. this.elemHeight = newContainerHeight;
  8281. if (!this.isStuck) {
  8282. if (this.$element.hasClass('is-at-bottom')) {
  8283. var anchorPt = (this.points ? this.points[1] - this.$container.offset().top : this.anchorHeight) - this.elemHeight;
  8284. this.$element.css('top', anchorPt);
  8285. }
  8286. }
  8287. this._setBreakPoints(newContainerHeight, function () {
  8288. if (cb && typeof cb === 'function') {
  8289. cb();
  8290. }
  8291. });
  8292. }
  8293. /**
  8294. * Sets the upper and lower breakpoints for the element to become sticky/unsticky.
  8295. * @param {Number} elemHeight - px value for sticky.$element height, calculated by `_setSizes`.
  8296. * @param {Function} cb - optional callback function to be called on completion.
  8297. * @private
  8298. */
  8299. }, {
  8300. key: "_setBreakPoints",
  8301. value: function _setBreakPoints(elemHeight, cb) {
  8302. if (!this.canStick) {
  8303. if (cb && typeof cb === 'function') {
  8304. cb();
  8305. } else {
  8306. return false;
  8307. }
  8308. }
  8309. var mTop = emCalc(this.options.marginTop),
  8310. mBtm = emCalc(this.options.marginBottom),
  8311. topPoint = this.points ? this.points[0] : this.$anchor.offset().top,
  8312. bottomPoint = this.points ? this.points[1] : topPoint + this.anchorHeight,
  8313. // topPoint = this.$anchor.offset().top || this.points[0],
  8314. // bottomPoint = topPoint + this.anchorHeight || this.points[1],
  8315. winHeight = window.innerHeight;
  8316. if (this.options.stickTo === 'top') {
  8317. topPoint -= mTop;
  8318. bottomPoint -= elemHeight + mTop;
  8319. } else if (this.options.stickTo === 'bottom') {
  8320. topPoint -= winHeight - (elemHeight + mBtm);
  8321. bottomPoint -= winHeight - mBtm;
  8322. } else {//this would be the stickTo: both option... tricky
  8323. }
  8324. this.topPoint = topPoint;
  8325. this.bottomPoint = bottomPoint;
  8326. if (cb && typeof cb === 'function') {
  8327. cb();
  8328. }
  8329. }
  8330. /**
  8331. * Destroys the current sticky element.
  8332. * Resets the element to the top position first.
  8333. * Removes event listeners, JS-added css properties and classes, and unwraps the $element if the JS added the $container.
  8334. * @function
  8335. */
  8336. }, {
  8337. key: "_destroy",
  8338. value: function _destroy() {
  8339. this._removeSticky(true);
  8340. this.$element.removeClass("".concat(this.options.stickyClass, " is-anchored is-at-top")).css({
  8341. height: '',
  8342. top: '',
  8343. bottom: '',
  8344. 'max-width': ''
  8345. }).off('resizeme.zf.trigger').off('mutateme.zf.trigger');
  8346. if (this.$anchor && this.$anchor.length) {
  8347. this.$anchor.off('change.zf.sticky');
  8348. }
  8349. if (this.scrollListener) jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.scrollListener);
  8350. if (this.onLoadListener) jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener);
  8351. if (this.wasWrapped) {
  8352. this.$element.unwrap();
  8353. } else {
  8354. this.$container.removeClass(this.options.containerClass).css({
  8355. height: ''
  8356. });
  8357. }
  8358. }
  8359. }]);
  8360. return Sticky;
  8361. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__["Plugin"]);
  8362. Sticky.defaults = {
  8363. /**
  8364. * Customizable container template. Add your own classes for styling and sizing.
  8365. * @option
  8366. * @type {string}
  8367. * @default '&lt;div data-sticky-container&gt;&lt;/div&gt;'
  8368. */
  8369. container: '<div data-sticky-container></div>',
  8370. /**
  8371. * Location in the view the element sticks to. Can be `'top'` or `'bottom'`.
  8372. * @option
  8373. * @type {string}
  8374. * @default 'top'
  8375. */
  8376. stickTo: 'top',
  8377. /**
  8378. * If anchored to a single element, the id of that element.
  8379. * @option
  8380. * @type {string}
  8381. * @default ''
  8382. */
  8383. anchor: '',
  8384. /**
  8385. * If using more than one element as anchor points, the id of the top anchor.
  8386. * @option
  8387. * @type {string}
  8388. * @default ''
  8389. */
  8390. topAnchor: '',
  8391. /**
  8392. * If using more than one element as anchor points, the id of the bottom anchor.
  8393. * @option
  8394. * @type {string}
  8395. * @default ''
  8396. */
  8397. btmAnchor: '',
  8398. /**
  8399. * Margin, in `em`'s to apply to the top of the element when it becomes sticky.
  8400. * @option
  8401. * @type {number}
  8402. * @default 1
  8403. */
  8404. marginTop: 1,
  8405. /**
  8406. * Margin, in `em`'s to apply to the bottom of the element when it becomes sticky.
  8407. * @option
  8408. * @type {number}
  8409. * @default 1
  8410. */
  8411. marginBottom: 1,
  8412. /**
  8413. * Breakpoint string that is the minimum screen size an element should become sticky.
  8414. * @option
  8415. * @type {string}
  8416. * @default 'medium'
  8417. */
  8418. stickyOn: 'medium',
  8419. /**
  8420. * Class applied to sticky element, and removed on destruction. Foundation defaults to `sticky`.
  8421. * @option
  8422. * @type {string}
  8423. * @default 'sticky'
  8424. */
  8425. stickyClass: 'sticky',
  8426. /**
  8427. * Class applied to sticky container. Foundation defaults to `sticky-container`.
  8428. * @option
  8429. * @type {string}
  8430. * @default 'sticky-container'
  8431. */
  8432. containerClass: 'sticky-container',
  8433. /**
  8434. * Number of scroll events between the plugin's recalculating sticky points. Setting it to `0` will cause it to recalc every scroll event, setting it to `-1` will prevent recalc on scroll.
  8435. * @option
  8436. * @type {number}
  8437. * @default -1
  8438. */
  8439. checkEvery: -1
  8440. };
  8441. /**
  8442. * Helper function to calculate em values
  8443. * @param Number {em} - number of em's to calculate into pixels
  8444. */
  8445. function emCalc(em) {
  8446. return parseInt(window.getComputedStyle(document.body, null).fontSize, 10) * em;
  8447. }
  8448. /***/ }),
  8449. /***/ "./js/foundation.tabs.js":
  8450. /*!*******************************!*\
  8451. !*** ./js/foundation.tabs.js ***!
  8452. \*******************************/
  8453. /*! exports provided: Tabs */
  8454. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8455. "use strict";
  8456. __webpack_require__.r(__webpack_exports__);
  8457. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Tabs", function() { return Tabs; });
  8458. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  8459. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  8460. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  8461. /* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js");
  8462. /* harmony import */ var _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.imageLoader */ "./js/foundation.util.imageLoader.js");
  8463. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  8464. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  8465. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8466. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  8467. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  8468. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  8469. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  8470. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  8471. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  8472. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  8473. /**
  8474. * Tabs module.
  8475. * @module foundation.tabs
  8476. * @requires foundation.util.keyboard
  8477. * @requires foundation.util.imageLoader if tabs contain images
  8478. */
  8479. var Tabs =
  8480. /*#__PURE__*/
  8481. function (_Plugin) {
  8482. _inherits(Tabs, _Plugin);
  8483. function Tabs() {
  8484. _classCallCheck(this, Tabs);
  8485. return _possibleConstructorReturn(this, _getPrototypeOf(Tabs).apply(this, arguments));
  8486. }
  8487. _createClass(Tabs, [{
  8488. key: "_setup",
  8489. /**
  8490. * Creates a new instance of tabs.
  8491. * @class
  8492. * @name Tabs
  8493. * @fires Tabs#init
  8494. * @param {jQuery} element - jQuery object to make into tabs.
  8495. * @param {Object} options - Overrides to the default plugin settings.
  8496. */
  8497. value: function _setup(element, options) {
  8498. this.$element = element;
  8499. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Tabs.defaults, this.$element.data(), options);
  8500. this.className = 'Tabs'; // ie9 back compat
  8501. this._init();
  8502. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].register('Tabs', {
  8503. 'ENTER': 'open',
  8504. 'SPACE': 'open',
  8505. 'ARROW_RIGHT': 'next',
  8506. 'ARROW_UP': 'previous',
  8507. 'ARROW_DOWN': 'next',
  8508. 'ARROW_LEFT': 'previous' // 'TAB': 'next',
  8509. // 'SHIFT_TAB': 'previous'
  8510. });
  8511. }
  8512. /**
  8513. * Initializes the tabs by showing and focusing (if autoFocus=true) the preset active tab.
  8514. * @private
  8515. */
  8516. }, {
  8517. key: "_init",
  8518. value: function _init() {
  8519. var _this2 = this;
  8520. var _this = this;
  8521. this._isInitializing = true;
  8522. this.$element.attr({
  8523. 'role': 'tablist'
  8524. });
  8525. this.$tabTitles = this.$element.find(".".concat(this.options.linkClass));
  8526. this.$tabContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-tabs-content=\"".concat(this.$element[0].id, "\"]"));
  8527. this.$tabTitles.each(function () {
  8528. var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  8529. $link = $elem.find('a'),
  8530. isActive = $elem.hasClass("".concat(_this.options.linkActiveClass)),
  8531. hash = $link.attr('data-tabs-target') || $link[0].hash.slice(1),
  8532. linkId = $link[0].id ? $link[0].id : "".concat(hash, "-label"),
  8533. $tabContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(hash));
  8534. $elem.attr({
  8535. 'role': 'presentation'
  8536. });
  8537. $link.attr({
  8538. 'role': 'tab',
  8539. 'aria-controls': hash,
  8540. 'aria-selected': isActive,
  8541. 'id': linkId,
  8542. 'tabindex': isActive ? '0' : '-1'
  8543. });
  8544. $tabContent.attr({
  8545. 'role': 'tabpanel',
  8546. 'aria-labelledby': linkId
  8547. }); // Save up the initial hash to return to it later when going back in history
  8548. if (isActive) {
  8549. _this._initialAnchor = "#".concat(hash);
  8550. }
  8551. if (!isActive) {
  8552. $tabContent.attr('aria-hidden', 'true');
  8553. }
  8554. if (isActive && _this.options.autoFocus) {
  8555. _this.onLoadListener = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () {
  8556. jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').animate({
  8557. scrollTop: $elem.offset().top
  8558. }, _this.options.deepLinkSmudgeDelay, function () {
  8559. $link.focus();
  8560. });
  8561. });
  8562. }
  8563. });
  8564. if (this.options.matchHeight) {
  8565. var $images = this.$tabContent.find('img');
  8566. if ($images.length) {
  8567. Object(_foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_3__["onImagesLoaded"])($images, this._setHeight.bind(this));
  8568. } else {
  8569. this._setHeight();
  8570. }
  8571. } // Current context-bound function to open tabs on page load or history hashchange
  8572. this._checkDeepLink = function () {
  8573. var anchor = window.location.hash;
  8574. if (!anchor.length) {
  8575. // If we are still initializing and there is no anchor, then there is nothing to do
  8576. if (_this2._isInitializing) return; // Otherwise, move to the initial anchor
  8577. if (_this2._initialAnchor) anchor = _this2._initialAnchor;
  8578. }
  8579. var $anchor = anchor && jquery__WEBPACK_IMPORTED_MODULE_0___default()(anchor);
  8580. var $link = anchor && _this2.$element.find('[href$="' + anchor + '"]'); // Whether the anchor element that has been found is part of this element
  8581. var isOwnAnchor = !!($anchor.length && $link.length); // If there is an anchor for the hash, select it
  8582. if ($anchor && $anchor.length && $link && $link.length) {
  8583. _this2.selectTab($anchor, true);
  8584. } // Otherwise, collapse everything
  8585. else {
  8586. _this2._collapse();
  8587. }
  8588. if (isOwnAnchor) {
  8589. // Roll up a little to show the titles
  8590. if (_this2.options.deepLinkSmudge) {
  8591. var offset = _this2.$element.offset();
  8592. jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').animate({
  8593. scrollTop: offset.top
  8594. }, _this2.options.deepLinkSmudgeDelay);
  8595. }
  8596. /**
  8597. * Fires when the plugin has deeplinked at pageload
  8598. * @event Tabs#deeplink
  8599. */
  8600. _this2.$element.trigger('deeplink.zf.tabs', [$link, $anchor]);
  8601. }
  8602. }; //use browser to open a tab, if it exists in this tabset
  8603. if (this.options.deepLink) {
  8604. this._checkDeepLink();
  8605. }
  8606. this._events();
  8607. this._isInitializing = false;
  8608. }
  8609. /**
  8610. * Adds event handlers for items within the tabs.
  8611. * @private
  8612. */
  8613. }, {
  8614. key: "_events",
  8615. value: function _events() {
  8616. this._addKeyHandler();
  8617. this._addClickHandler();
  8618. this._setHeightMqHandler = null;
  8619. if (this.options.matchHeight) {
  8620. this._setHeightMqHandler = this._setHeight.bind(this);
  8621. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', this._setHeightMqHandler);
  8622. }
  8623. if (this.options.deepLink) {
  8624. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('hashchange', this._checkDeepLink);
  8625. }
  8626. }
  8627. /**
  8628. * Adds click handlers for items within the tabs.
  8629. * @private
  8630. */
  8631. }, {
  8632. key: "_addClickHandler",
  8633. value: function _addClickHandler() {
  8634. var _this = this;
  8635. this.$element.off('click.zf.tabs').on('click.zf.tabs', ".".concat(this.options.linkClass), function (e) {
  8636. e.preventDefault();
  8637. e.stopPropagation();
  8638. _this._handleTabChange(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this));
  8639. });
  8640. }
  8641. /**
  8642. * Adds keyboard event handlers for items within the tabs.
  8643. * @private
  8644. */
  8645. }, {
  8646. key: "_addKeyHandler",
  8647. value: function _addKeyHandler() {
  8648. var _this = this;
  8649. this.$tabTitles.off('keydown.zf.tabs').on('keydown.zf.tabs', function (e) {
  8650. if (e.which === 9) return;
  8651. var $element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  8652. $elements = $element.parent('ul').children('li'),
  8653. $prevElement,
  8654. $nextElement;
  8655. $elements.each(function (i) {
  8656. if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is($element)) {
  8657. if (_this.options.wrapOnKeys) {
  8658. $prevElement = i === 0 ? $elements.last() : $elements.eq(i - 1);
  8659. $nextElement = i === $elements.length - 1 ? $elements.first() : $elements.eq(i + 1);
  8660. } else {
  8661. $prevElement = $elements.eq(Math.max(0, i - 1));
  8662. $nextElement = $elements.eq(Math.min(i + 1, $elements.length - 1));
  8663. }
  8664. return;
  8665. }
  8666. }); // handle keyboard event with keyboard util
  8667. _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].handleKey(e, 'Tabs', {
  8668. open: function open() {
  8669. $element.find('[role="tab"]').focus();
  8670. _this._handleTabChange($element);
  8671. },
  8672. previous: function previous() {
  8673. $prevElement.find('[role="tab"]').focus();
  8674. _this._handleTabChange($prevElement);
  8675. },
  8676. next: function next() {
  8677. $nextElement.find('[role="tab"]').focus();
  8678. _this._handleTabChange($nextElement);
  8679. },
  8680. handled: function handled() {
  8681. e.stopPropagation();
  8682. e.preventDefault();
  8683. }
  8684. });
  8685. });
  8686. }
  8687. /**
  8688. * Opens the tab `$targetContent` defined by `$target`. Collapses active tab.
  8689. * @param {jQuery} $target - Tab to open.
  8690. * @param {boolean} historyHandled - browser has already handled a history update
  8691. * @fires Tabs#change
  8692. * @function
  8693. */
  8694. }, {
  8695. key: "_handleTabChange",
  8696. value: function _handleTabChange($target, historyHandled) {
  8697. // With `activeCollapse`, if the target is the active Tab, collapse it.
  8698. if ($target.hasClass("".concat(this.options.linkActiveClass))) {
  8699. if (this.options.activeCollapse) {
  8700. this._collapse();
  8701. }
  8702. return;
  8703. }
  8704. var $oldTab = this.$element.find(".".concat(this.options.linkClass, ".").concat(this.options.linkActiveClass)),
  8705. $tabLink = $target.find('[role="tab"]'),
  8706. target = $tabLink.attr('data-tabs-target'),
  8707. anchor = target && target.length ? "#".concat(target) : $tabLink[0].hash,
  8708. $targetContent = this.$tabContent.find(anchor); //close old tab
  8709. this._collapseTab($oldTab); //open new tab
  8710. this._openTab($target); //either replace or update browser history
  8711. if (this.options.deepLink && !historyHandled) {
  8712. if (this.options.updateHistory) {
  8713. history.pushState({}, '', anchor);
  8714. } else {
  8715. history.replaceState({}, '', anchor);
  8716. }
  8717. }
  8718. /**
  8719. * Fires when the plugin has successfully changed tabs.
  8720. * @event Tabs#change
  8721. */
  8722. this.$element.trigger('change.zf.tabs', [$target, $targetContent]); //fire to children a mutation event
  8723. $targetContent.find("[data-mutate]").trigger("mutateme.zf.trigger");
  8724. }
  8725. /**
  8726. * Opens the tab `$targetContent` defined by `$target`.
  8727. * @param {jQuery} $target - Tab to open.
  8728. * @function
  8729. */
  8730. }, {
  8731. key: "_openTab",
  8732. value: function _openTab($target) {
  8733. var $tabLink = $target.find('[role="tab"]'),
  8734. hash = $tabLink.attr('data-tabs-target') || $tabLink[0].hash.slice(1),
  8735. $targetContent = this.$tabContent.find("#".concat(hash));
  8736. $target.addClass("".concat(this.options.linkActiveClass));
  8737. $tabLink.attr({
  8738. 'aria-selected': 'true',
  8739. 'tabindex': '0'
  8740. });
  8741. $targetContent.addClass("".concat(this.options.panelActiveClass)).removeAttr('aria-hidden');
  8742. }
  8743. /**
  8744. * Collapses `$targetContent` defined by `$target`.
  8745. * @param {jQuery} $target - Tab to collapse.
  8746. * @function
  8747. */
  8748. }, {
  8749. key: "_collapseTab",
  8750. value: function _collapseTab($target) {
  8751. var $target_anchor = $target.removeClass("".concat(this.options.linkActiveClass)).find('[role="tab"]').attr({
  8752. 'aria-selected': 'false',
  8753. 'tabindex': -1
  8754. });
  8755. jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat($target_anchor.attr('aria-controls'))).removeClass("".concat(this.options.panelActiveClass)).attr({
  8756. 'aria-hidden': 'true'
  8757. });
  8758. }
  8759. /**
  8760. * Collapses the active Tab.
  8761. * @fires Tabs#collapse
  8762. * @function
  8763. */
  8764. }, {
  8765. key: "_collapse",
  8766. value: function _collapse() {
  8767. var $activeTab = this.$element.find(".".concat(this.options.linkClass, ".").concat(this.options.linkActiveClass));
  8768. if ($activeTab.length) {
  8769. this._collapseTab($activeTab);
  8770. /**
  8771. * Fires when the plugin has successfully collapsed tabs.
  8772. * @event Tabs#collapse
  8773. */
  8774. this.$element.trigger('collapse.zf.tabs', [$activeTab]);
  8775. }
  8776. }
  8777. /**
  8778. * Public method for selecting a content pane to display.
  8779. * @param {jQuery | String} elem - jQuery object or string of the id of the pane to display.
  8780. * @param {boolean} historyHandled - browser has already handled a history update
  8781. * @function
  8782. */
  8783. }, {
  8784. key: "selectTab",
  8785. value: function selectTab(elem, historyHandled) {
  8786. var idStr;
  8787. if (_typeof(elem) === 'object') {
  8788. idStr = elem[0].id;
  8789. } else {
  8790. idStr = elem;
  8791. }
  8792. if (idStr.indexOf('#') < 0) {
  8793. idStr = "#".concat(idStr);
  8794. }
  8795. var $target = this.$tabTitles.has("[href$=\"".concat(idStr, "\"]"));
  8796. this._handleTabChange($target, historyHandled);
  8797. }
  8798. }, {
  8799. key: "_setHeight",
  8800. /**
  8801. * Sets the height of each panel to the height of the tallest panel.
  8802. * If enabled in options, gets called on media query change.
  8803. * If loading content via external source, can be called directly or with _reflow.
  8804. * If enabled with `data-match-height="true"`, tabs sets to equal height
  8805. * @function
  8806. * @private
  8807. */
  8808. value: function _setHeight() {
  8809. var max = 0,
  8810. _this = this; // Lock down the `this` value for the root tabs object
  8811. this.$tabContent.find(".".concat(this.options.panelClass)).css('height', '').each(function () {
  8812. var panel = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  8813. isActive = panel.hasClass("".concat(_this.options.panelActiveClass)); // get the options from the parent instead of trying to get them from the child
  8814. if (!isActive) {
  8815. panel.css({
  8816. 'visibility': 'hidden',
  8817. 'display': 'block'
  8818. });
  8819. }
  8820. var temp = this.getBoundingClientRect().height;
  8821. if (!isActive) {
  8822. panel.css({
  8823. 'visibility': '',
  8824. 'display': ''
  8825. });
  8826. }
  8827. max = temp > max ? temp : max;
  8828. }).css('height', "".concat(max, "px"));
  8829. }
  8830. /**
  8831. * Destroys an instance of tabs.
  8832. * @fires Tabs#destroyed
  8833. */
  8834. }, {
  8835. key: "_destroy",
  8836. value: function _destroy() {
  8837. this.$element.find(".".concat(this.options.linkClass)).off('.zf.tabs').hide().end().find(".".concat(this.options.panelClass)).hide();
  8838. if (this.options.matchHeight) {
  8839. if (this._setHeightMqHandler != null) {
  8840. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('changed.zf.mediaquery', this._setHeightMqHandler);
  8841. }
  8842. }
  8843. if (this.options.deepLink) {
  8844. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('hashchange', this._checkDeepLink);
  8845. }
  8846. if (this.onLoadListener) {
  8847. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener);
  8848. }
  8849. }
  8850. }]);
  8851. return Tabs;
  8852. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__["Plugin"]);
  8853. Tabs.defaults = {
  8854. /**
  8855. * Link the location hash to the active pane.
  8856. * Set the location hash when the active pane changes, and open the corresponding pane when the location changes.
  8857. * @option
  8858. * @type {boolean}
  8859. * @default false
  8860. */
  8861. deepLink: false,
  8862. /**
  8863. * If `deepLink` is enabled, adjust the deep link scroll to make sure the top of the tab panel is visible
  8864. * @option
  8865. * @type {boolean}
  8866. * @default false
  8867. */
  8868. deepLinkSmudge: false,
  8869. /**
  8870. * If `deepLinkSmudge` is enabled, animation time (ms) for the deep link adjustment
  8871. * @option
  8872. * @type {number}
  8873. * @default 300
  8874. */
  8875. deepLinkSmudgeDelay: 300,
  8876. /**
  8877. * If `deepLink` is enabled, update the browser history with the open tab
  8878. * @option
  8879. * @type {boolean}
  8880. * @default false
  8881. */
  8882. updateHistory: false,
  8883. /**
  8884. * Allows the window to scroll to content of active pane on load.
  8885. * Not recommended if more than one tab panel per page.
  8886. * @option
  8887. * @type {boolean}
  8888. * @default false
  8889. */
  8890. autoFocus: false,
  8891. /**
  8892. * Allows keyboard input to 'wrap' around the tab links.
  8893. * @option
  8894. * @type {boolean}
  8895. * @default true
  8896. */
  8897. wrapOnKeys: true,
  8898. /**
  8899. * Allows the tab content panes to match heights if set to true.
  8900. * @option
  8901. * @type {boolean}
  8902. * @default false
  8903. */
  8904. matchHeight: false,
  8905. /**
  8906. * Allows active tabs to collapse when clicked.
  8907. * @option
  8908. * @type {boolean}
  8909. * @default false
  8910. */
  8911. activeCollapse: false,
  8912. /**
  8913. * Class applied to `li`'s in tab link list.
  8914. * @option
  8915. * @type {string}
  8916. * @default 'tabs-title'
  8917. */
  8918. linkClass: 'tabs-title',
  8919. /**
  8920. * Class applied to the active `li` in tab link list.
  8921. * @option
  8922. * @type {string}
  8923. * @default 'is-active'
  8924. */
  8925. linkActiveClass: 'is-active',
  8926. /**
  8927. * Class applied to the content containers.
  8928. * @option
  8929. * @type {string}
  8930. * @default 'tabs-panel'
  8931. */
  8932. panelClass: 'tabs-panel',
  8933. /**
  8934. * Class applied to the active content container.
  8935. * @option
  8936. * @type {string}
  8937. * @default 'is-active'
  8938. */
  8939. panelActiveClass: 'is-active'
  8940. };
  8941. /***/ }),
  8942. /***/ "./js/foundation.toggler.js":
  8943. /*!**********************************!*\
  8944. !*** ./js/foundation.toggler.js ***!
  8945. \**********************************/
  8946. /*! exports provided: Toggler */
  8947. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8948. "use strict";
  8949. __webpack_require__.r(__webpack_exports__);
  8950. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Toggler", function() { return Toggler; });
  8951. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  8952. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  8953. /* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js");
  8954. /* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
  8955. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  8956. /* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js");
  8957. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  8958. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8959. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  8960. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  8961. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  8962. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  8963. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  8964. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  8965. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  8966. /**
  8967. * Toggler module.
  8968. * @module foundation.toggler
  8969. * @requires foundation.util.motion
  8970. * @requires foundation.util.triggers
  8971. */
  8972. var Toggler =
  8973. /*#__PURE__*/
  8974. function (_Plugin) {
  8975. _inherits(Toggler, _Plugin);
  8976. function Toggler() {
  8977. _classCallCheck(this, Toggler);
  8978. return _possibleConstructorReturn(this, _getPrototypeOf(Toggler).apply(this, arguments));
  8979. }
  8980. _createClass(Toggler, [{
  8981. key: "_setup",
  8982. /**
  8983. * Creates a new instance of Toggler.
  8984. * @class
  8985. * @name Toggler
  8986. * @fires Toggler#init
  8987. * @param {Object} element - jQuery object to add the trigger to.
  8988. * @param {Object} options - Overrides to the default plugin settings.
  8989. */
  8990. value: function _setup(element, options) {
  8991. this.$element = element;
  8992. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Toggler.defaults, element.data(), options);
  8993. this.className = '';
  8994. this.className = 'Toggler'; // ie9 back compat
  8995. // Triggers init is idempotent, just need to make sure it is initialized
  8996. _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
  8997. this._init();
  8998. this._events();
  8999. }
  9000. /**
  9001. * Initializes the Toggler plugin by parsing the toggle class from data-toggler, or animation classes from data-animate.
  9002. * @function
  9003. * @private
  9004. */
  9005. }, {
  9006. key: "_init",
  9007. value: function _init() {
  9008. var input; // Parse animation classes if they were set
  9009. if (this.options.animate) {
  9010. input = this.options.animate.split(' ');
  9011. this.animationIn = input[0];
  9012. this.animationOut = input[1] || null;
  9013. } // Otherwise, parse toggle class
  9014. else {
  9015. input = this.$element.data('toggler'); // Allow for a . at the beginning of the string
  9016. this.className = input[0] === '.' ? input.slice(1) : input;
  9017. } // Add ARIA attributes to triggers:
  9018. var id = this.$element[0].id,
  9019. $triggers = jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-open~=\"".concat(id, "\"], [data-close~=\"").concat(id, "\"], [data-toggle~=\"").concat(id, "\"]")); // - aria-expanded: according to the element visibility.
  9020. $triggers.attr('aria-expanded', !this.$element.is(':hidden')); // - aria-controls: adding the element id to it if not already in it.
  9021. $triggers.each(function (index, trigger) {
  9022. var $trigger = jquery__WEBPACK_IMPORTED_MODULE_0___default()(trigger);
  9023. var controls = $trigger.attr('aria-controls') || '';
  9024. var containsId = new RegExp("\\b".concat(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["RegExpEscape"])(id), "\\b")).test(controls);
  9025. if (!containsId) $trigger.attr('aria-controls', controls ? "".concat(controls, " ").concat(id) : id);
  9026. });
  9027. }
  9028. /**
  9029. * Initializes events for the toggle trigger.
  9030. * @function
  9031. * @private
  9032. */
  9033. }, {
  9034. key: "_events",
  9035. value: function _events() {
  9036. this.$element.off('toggle.zf.trigger').on('toggle.zf.trigger', this.toggle.bind(this));
  9037. }
  9038. /**
  9039. * Toggles the target class on the target element. An event is fired from the original trigger depending on if the resultant state was "on" or "off".
  9040. * @function
  9041. * @fires Toggler#on
  9042. * @fires Toggler#off
  9043. */
  9044. }, {
  9045. key: "toggle",
  9046. value: function toggle() {
  9047. this[this.options.animate ? '_toggleAnimate' : '_toggleClass']();
  9048. }
  9049. }, {
  9050. key: "_toggleClass",
  9051. value: function _toggleClass() {
  9052. this.$element.toggleClass(this.className);
  9053. var isOn = this.$element.hasClass(this.className);
  9054. if (isOn) {
  9055. /**
  9056. * Fires if the target element has the class after a toggle.
  9057. * @event Toggler#on
  9058. */
  9059. this.$element.trigger('on.zf.toggler');
  9060. } else {
  9061. /**
  9062. * Fires if the target element does not have the class after a toggle.
  9063. * @event Toggler#off
  9064. */
  9065. this.$element.trigger('off.zf.toggler');
  9066. }
  9067. this._updateARIA(isOn);
  9068. this.$element.find('[data-mutate]').trigger('mutateme.zf.trigger');
  9069. }
  9070. }, {
  9071. key: "_toggleAnimate",
  9072. value: function _toggleAnimate() {
  9073. var _this = this;
  9074. if (this.$element.is(':hidden')) {
  9075. _foundation_util_motion__WEBPACK_IMPORTED_MODULE_1__["Motion"].animateIn(this.$element, this.animationIn, function () {
  9076. _this._updateARIA(true);
  9077. this.trigger('on.zf.toggler');
  9078. this.find('[data-mutate]').trigger('mutateme.zf.trigger');
  9079. });
  9080. } else {
  9081. _foundation_util_motion__WEBPACK_IMPORTED_MODULE_1__["Motion"].animateOut(this.$element, this.animationOut, function () {
  9082. _this._updateARIA(false);
  9083. this.trigger('off.zf.toggler');
  9084. this.find('[data-mutate]').trigger('mutateme.zf.trigger');
  9085. });
  9086. }
  9087. }
  9088. }, {
  9089. key: "_updateARIA",
  9090. value: function _updateARIA(isOn) {
  9091. var id = this.$element[0].id;
  9092. jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-open=\"".concat(id, "\"], [data-close=\"").concat(id, "\"], [data-toggle=\"").concat(id, "\"]")).attr({
  9093. 'aria-expanded': isOn ? true : false
  9094. });
  9095. }
  9096. /**
  9097. * Destroys the instance of Toggler on the element.
  9098. * @function
  9099. */
  9100. }, {
  9101. key: "_destroy",
  9102. value: function _destroy() {
  9103. this.$element.off('.zf.toggler');
  9104. }
  9105. }]);
  9106. return Toggler;
  9107. }(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__["Plugin"]);
  9108. Toggler.defaults = {
  9109. /**
  9110. * Tells the plugin if the element should animated when toggled.
  9111. * @option
  9112. * @type {boolean}
  9113. * @default false
  9114. */
  9115. animate: false
  9116. };
  9117. /***/ }),
  9118. /***/ "./js/foundation.tooltip.js":
  9119. /*!**********************************!*\
  9120. !*** ./js/foundation.tooltip.js ***!
  9121. \**********************************/
  9122. /*! exports provided: Tooltip */
  9123. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9124. "use strict";
  9125. __webpack_require__.r(__webpack_exports__);
  9126. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Tooltip", function() { return Tooltip; });
  9127. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  9128. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  9129. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  9130. /* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js");
  9131. /* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js");
  9132. /* harmony import */ var _foundation_positionable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.positionable */ "./js/foundation.positionable.js");
  9133. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  9134. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9135. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  9136. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  9137. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  9138. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  9139. function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
  9140. function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
  9141. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  9142. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  9143. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  9144. /**
  9145. * Tooltip module.
  9146. * @module foundation.tooltip
  9147. * @requires foundation.util.box
  9148. * @requires foundation.util.mediaQuery
  9149. * @requires foundation.util.triggers
  9150. */
  9151. var Tooltip =
  9152. /*#__PURE__*/
  9153. function (_Positionable) {
  9154. _inherits(Tooltip, _Positionable);
  9155. function Tooltip() {
  9156. _classCallCheck(this, Tooltip);
  9157. return _possibleConstructorReturn(this, _getPrototypeOf(Tooltip).apply(this, arguments));
  9158. }
  9159. _createClass(Tooltip, [{
  9160. key: "_setup",
  9161. /**
  9162. * Creates a new instance of a Tooltip.
  9163. * @class
  9164. * @name Tooltip
  9165. * @fires Tooltip#init
  9166. * @param {jQuery} element - jQuery object to attach a tooltip to.
  9167. * @param {Object} options - object to extend the default configuration.
  9168. */
  9169. value: function _setup(element, options) {
  9170. this.$element = element;
  9171. this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Tooltip.defaults, this.$element.data(), options);
  9172. this.className = 'Tooltip'; // ie9 back compat
  9173. this.isActive = false;
  9174. this.isClick = false; // Triggers init is idempotent, just need to make sure it is initialized
  9175. _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_3__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);
  9176. this._init();
  9177. }
  9178. /**
  9179. * Initializes the tooltip by setting the creating the tip element, adding it's text, setting private variables and setting attributes on the anchor.
  9180. * @private
  9181. */
  9182. }, {
  9183. key: "_init",
  9184. value: function _init() {
  9185. _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__["MediaQuery"]._init();
  9186. var elemId = this.$element.attr('aria-describedby') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, 'tooltip');
  9187. this.options.tipText = this.options.tipText || this.$element.attr('title');
  9188. this.template = this.options.template ? jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.options.template) : this._buildTemplate(elemId);
  9189. if (this.options.allowHtml) {
  9190. this.template.appendTo(document.body).html(this.options.tipText).hide();
  9191. } else {
  9192. this.template.appendTo(document.body).text(this.options.tipText).hide();
  9193. }
  9194. this.$element.attr({
  9195. 'title': '',
  9196. 'aria-describedby': elemId,
  9197. 'data-yeti-box': elemId,
  9198. 'data-toggle': elemId,
  9199. 'data-resize': elemId
  9200. }).addClass(this.options.triggerClass);
  9201. _get(_getPrototypeOf(Tooltip.prototype), "_init", this).call(this);
  9202. this._events();
  9203. }
  9204. }, {
  9205. key: "_getDefaultPosition",
  9206. value: function _getDefaultPosition() {
  9207. // handle legacy classnames
  9208. var position = this.$element[0].className.match(/\b(top|left|right|bottom)\b/g);
  9209. return position ? position[0] : 'top';
  9210. }
  9211. }, {
  9212. key: "_getDefaultAlignment",
  9213. value: function _getDefaultAlignment() {
  9214. return 'center';
  9215. }
  9216. }, {
  9217. key: "_getHOffset",
  9218. value: function _getHOffset() {
  9219. if (this.position === 'left' || this.position === 'right') {
  9220. return this.options.hOffset + this.options.tooltipWidth;
  9221. } else {
  9222. return this.options.hOffset;
  9223. }
  9224. }
  9225. }, {
  9226. key: "_getVOffset",
  9227. value: function _getVOffset() {
  9228. if (this.position === 'top' || this.position === 'bottom') {
  9229. return this.options.vOffset + this.options.tooltipHeight;
  9230. } else {
  9231. return this.options.vOffset;
  9232. }
  9233. }
  9234. /**
  9235. * builds the tooltip element, adds attributes, and returns the template.
  9236. * @private
  9237. */
  9238. }, {
  9239. key: "_buildTemplate",
  9240. value: function _buildTemplate(id) {
  9241. var templateClasses = "".concat(this.options.tooltipClass, " ").concat(this.options.templateClasses).trim();
  9242. var $template = jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div></div>').addClass(templateClasses).attr({
  9243. 'role': 'tooltip',
  9244. 'aria-hidden': true,
  9245. 'data-is-active': false,
  9246. 'data-is-focus': false,
  9247. 'id': id
  9248. });
  9249. return $template;
  9250. }
  9251. /**
  9252. * sets the position class of an element and recursively calls itself until there are no more possible positions to attempt, or the tooltip element is no longer colliding.
  9253. * if the tooltip is larger than the screen width, default to full width - any user selected margin
  9254. * @private
  9255. */
  9256. }, {
  9257. key: "_setPosition",
  9258. value: function _setPosition() {
  9259. _get(_getPrototypeOf(Tooltip.prototype), "_setPosition", this).call(this, this.$element, this.template);
  9260. }
  9261. /**
  9262. * reveals the tooltip, and fires an event to close any other open tooltips on the page
  9263. * @fires Tooltip#closeme
  9264. * @fires Tooltip#show
  9265. * @function
  9266. */
  9267. }, {
  9268. key: "show",
  9269. value: function show() {
  9270. if (this.options.showOn !== 'all' && !_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__["MediaQuery"].is(this.options.showOn)) {
  9271. // console.error('The screen is too small to display this tooltip');
  9272. return false;
  9273. }
  9274. var _this = this;
  9275. this.template.css('visibility', 'hidden').show();
  9276. this._setPosition();
  9277. this.template.removeClass('top bottom left right').addClass(this.position);
  9278. this.template.removeClass('align-top align-bottom align-left align-right align-center').addClass('align-' + this.alignment);
  9279. /**
  9280. * Fires to close all other open tooltips on the page
  9281. * @event Closeme#tooltip
  9282. */
  9283. this.$element.trigger('closeme.zf.tooltip', this.template.attr('id'));
  9284. this.template.attr({
  9285. 'data-is-active': true,
  9286. 'aria-hidden': false
  9287. });
  9288. _this.isActive = true; // console.log(this.template);
  9289. this.template.stop().hide().css('visibility', '').fadeIn(this.options.fadeInDuration, function () {//maybe do stuff?
  9290. });
  9291. /**
  9292. * Fires when the tooltip is shown
  9293. * @event Tooltip#show
  9294. */
  9295. this.$element.trigger('show.zf.tooltip');
  9296. }
  9297. /**
  9298. * Hides the current tooltip, and resets the positioning class if it was changed due to collision
  9299. * @fires Tooltip#hide
  9300. * @function
  9301. */
  9302. }, {
  9303. key: "hide",
  9304. value: function hide() {
  9305. // console.log('hiding', this.$element.data('yeti-box'));
  9306. var _this = this;
  9307. this.template.stop().attr({
  9308. 'aria-hidden': true,
  9309. 'data-is-active': false
  9310. }).fadeOut(this.options.fadeOutDuration, function () {
  9311. _this.isActive = false;
  9312. _this.isClick = false;
  9313. });
  9314. /**
  9315. * fires when the tooltip is hidden
  9316. * @event Tooltip#hide
  9317. */
  9318. this.$element.trigger('hide.zf.tooltip');
  9319. }
  9320. /**
  9321. * adds event listeners for the tooltip and its anchor
  9322. * TODO combine some of the listeners like focus and mouseenter, etc.
  9323. * @private
  9324. */
  9325. }, {
  9326. key: "_events",
  9327. value: function _events() {
  9328. var _this = this;
  9329. var $template = this.template;
  9330. var isFocus = false;
  9331. if (!this.options.disableHover) {
  9332. this.$element.on('mouseenter.zf.tooltip', function (e) {
  9333. if (!_this.isActive) {
  9334. _this.timeout = setTimeout(function () {
  9335. _this.show();
  9336. }, _this.options.hoverDelay);
  9337. }
  9338. }).on('mouseleave.zf.tooltip', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["ignoreMousedisappear"])(function (e) {
  9339. clearTimeout(_this.timeout);
  9340. if (!isFocus || _this.isClick && !_this.options.clickOpen) {
  9341. _this.hide();
  9342. }
  9343. }));
  9344. }
  9345. if (this.options.clickOpen) {
  9346. this.$element.on('mousedown.zf.tooltip', function (e) {
  9347. e.stopImmediatePropagation();
  9348. if (_this.isClick) {//_this.hide();
  9349. // _this.isClick = false;
  9350. } else {
  9351. _this.isClick = true;
  9352. if ((_this.options.disableHover || !_this.$element.attr('tabindex')) && !_this.isActive) {
  9353. _this.show();
  9354. }
  9355. }
  9356. });
  9357. } else {
  9358. this.$element.on('mousedown.zf.tooltip', function (e) {
  9359. e.stopImmediatePropagation();
  9360. _this.isClick = true;
  9361. });
  9362. }
  9363. if (!this.options.disableForTouch) {
  9364. this.$element.on('tap.zf.tooltip touchend.zf.tooltip', function (e) {
  9365. _this.isActive ? _this.hide() : _this.show();
  9366. });
  9367. }
  9368. this.$element.on({
  9369. // 'toggle.zf.trigger': this.toggle.bind(this),
  9370. // 'close.zf.trigger': this.hide.bind(this)
  9371. 'close.zf.trigger': this.hide.bind(this)
  9372. });
  9373. this.$element.on('focus.zf.tooltip', function (e) {
  9374. isFocus = true;
  9375. if (_this.isClick) {
  9376. // If we're not showing open on clicks, we need to pretend a click-launched focus isn't
  9377. // a real focus, otherwise on hover and come back we get bad behavior
  9378. if (!_this.options.clickOpen) {
  9379. isFocus = false;
  9380. }
  9381. return false;
  9382. } else {
  9383. _this.show();
  9384. }
  9385. }).on('focusout.zf.tooltip', function (e) {
  9386. isFocus = false;
  9387. _this.isClick = false;
  9388. _this.hide();
  9389. }).on('resizeme.zf.trigger', function () {
  9390. if (_this.isActive) {
  9391. _this._setPosition();
  9392. }
  9393. });
  9394. }
  9395. /**
  9396. * adds a toggle method, in addition to the static show() & hide() functions
  9397. * @function
  9398. */
  9399. }, {
  9400. key: "toggle",
  9401. value: function toggle() {
  9402. if (this.isActive) {
  9403. this.hide();
  9404. } else {
  9405. this.show();
  9406. }
  9407. }
  9408. /**
  9409. * Destroys an instance of tooltip, removes template element from the view.
  9410. * @function
  9411. */
  9412. }, {
  9413. key: "_destroy",
  9414. value: function _destroy() {
  9415. this.$element.attr('title', this.template.text()).off('.zf.trigger .zf.tooltip').removeClass(this.options.triggerClass).removeClass('top right left bottom').removeAttr('aria-describedby data-disable-hover data-resize data-toggle data-tooltip data-yeti-box');
  9416. this.template.remove();
  9417. }
  9418. }]);
  9419. return Tooltip;
  9420. }(_foundation_positionable__WEBPACK_IMPORTED_MODULE_4__["Positionable"]);
  9421. Tooltip.defaults = {
  9422. disableForTouch: false,
  9423. /**
  9424. * Time, in ms, before a tooltip should open on hover.
  9425. * @option
  9426. * @type {number}
  9427. * @default 200
  9428. */
  9429. hoverDelay: 200,
  9430. /**
  9431. * Time, in ms, a tooltip should take to fade into view.
  9432. * @option
  9433. * @type {number}
  9434. * @default 150
  9435. */
  9436. fadeInDuration: 150,
  9437. /**
  9438. * Time, in ms, a tooltip should take to fade out of view.
  9439. * @option
  9440. * @type {number}
  9441. * @default 150
  9442. */
  9443. fadeOutDuration: 150,
  9444. /**
  9445. * Disables hover events from opening the tooltip if set to true
  9446. * @option
  9447. * @type {boolean}
  9448. * @default false
  9449. */
  9450. disableHover: false,
  9451. /**
  9452. * Optional addtional classes to apply to the tooltip template on init.
  9453. * @option
  9454. * @type {string}
  9455. * @default ''
  9456. */
  9457. templateClasses: '',
  9458. /**
  9459. * Non-optional class added to tooltip templates. Foundation default is 'tooltip'.
  9460. * @option
  9461. * @type {string}
  9462. * @default 'tooltip'
  9463. */
  9464. tooltipClass: 'tooltip',
  9465. /**
  9466. * Class applied to the tooltip anchor element.
  9467. * @option
  9468. * @type {string}
  9469. * @default 'has-tip'
  9470. */
  9471. triggerClass: 'has-tip',
  9472. /**
  9473. * Minimum breakpoint size at which to open the tooltip.
  9474. * @option
  9475. * @type {string}
  9476. * @default 'small'
  9477. */
  9478. showOn: 'small',
  9479. /**
  9480. * Custom template to be used to generate markup for tooltip.
  9481. * @option
  9482. * @type {string}
  9483. * @default ''
  9484. */
  9485. template: '',
  9486. /**
  9487. * Text displayed in the tooltip template on open.
  9488. * @option
  9489. * @type {string}
  9490. * @default ''
  9491. */
  9492. tipText: '',
  9493. touchCloseText: 'Tap to close.',
  9494. /**
  9495. * Allows the tooltip to remain open if triggered with a click or touch event.
  9496. * @option
  9497. * @type {boolean}
  9498. * @default true
  9499. */
  9500. clickOpen: true,
  9501. /**
  9502. * Position of tooltip. Can be left, right, bottom, top, or auto.
  9503. * @option
  9504. * @type {string}
  9505. * @default 'auto'
  9506. */
  9507. position: 'auto',
  9508. /**
  9509. * Alignment of tooltip relative to anchor. Can be left, right, bottom, top, center, or auto.
  9510. * @option
  9511. * @type {string}
  9512. * @default 'auto'
  9513. */
  9514. alignment: 'auto',
  9515. /**
  9516. * Allow overlap of container/window. If false, tooltip will first try to
  9517. * position as defined by data-position and data-alignment, but reposition if
  9518. * it would cause an overflow. @option
  9519. * @type {boolean}
  9520. * @default false
  9521. */
  9522. allowOverlap: false,
  9523. /**
  9524. * Allow overlap of only the bottom of the container. This is the most common
  9525. * behavior for dropdowns, allowing the dropdown to extend the bottom of the
  9526. * screen but not otherwise influence or break out of the container.
  9527. * Less common for tooltips.
  9528. * @option
  9529. * @type {boolean}
  9530. * @default false
  9531. */
  9532. allowBottomOverlap: false,
  9533. /**
  9534. * Distance, in pixels, the template should push away from the anchor on the Y axis.
  9535. * @option
  9536. * @type {number}
  9537. * @default 0
  9538. */
  9539. vOffset: 0,
  9540. /**
  9541. * Distance, in pixels, the template should push away from the anchor on the X axis
  9542. * @option
  9543. * @type {number}
  9544. * @default 0
  9545. */
  9546. hOffset: 0,
  9547. /**
  9548. * Distance, in pixels, the template spacing auto-adjust for a vertical tooltip
  9549. * @option
  9550. * @type {number}
  9551. * @default 14
  9552. */
  9553. tooltipHeight: 14,
  9554. /**
  9555. * Distance, in pixels, the template spacing auto-adjust for a horizontal tooltip
  9556. * @option
  9557. * @type {number}
  9558. * @default 12
  9559. */
  9560. tooltipWidth: 12,
  9561. /**
  9562. * Allow HTML in tooltip. Warning: If you are loading user-generated content into tooltips,
  9563. * allowing HTML may open yourself up to XSS attacks.
  9564. * @option
  9565. * @type {boolean}
  9566. * @default false
  9567. */
  9568. allowHtml: false
  9569. };
  9570. /**
  9571. * TODO utilize resize event trigger
  9572. */
  9573. /***/ }),
  9574. /***/ "./js/foundation.util.box.js":
  9575. /*!***********************************!*\
  9576. !*** ./js/foundation.util.box.js ***!
  9577. \***********************************/
  9578. /*! exports provided: Box */
  9579. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9580. "use strict";
  9581. __webpack_require__.r(__webpack_exports__);
  9582. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Box", function() { return Box; });
  9583. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  9584. var Box = {
  9585. ImNotTouchingYou: ImNotTouchingYou,
  9586. OverlapArea: OverlapArea,
  9587. GetDimensions: GetDimensions,
  9588. GetOffsets: GetOffsets,
  9589. GetExplicitOffsets: GetExplicitOffsets
  9590. /**
  9591. * Compares the dimensions of an element to a container and determines collision events with container.
  9592. * @function
  9593. * @param {jQuery} element - jQuery object to test for collisions.
  9594. * @param {jQuery} parent - jQuery object to use as bounding container.
  9595. * @param {Boolean} lrOnly - set to true to check left and right values only.
  9596. * @param {Boolean} tbOnly - set to true to check top and bottom values only.
  9597. * @default if no parent object passed, detects collisions with `window`.
  9598. * @returns {Boolean} - true if collision free, false if a collision in any direction.
  9599. */
  9600. };
  9601. function ImNotTouchingYou(element, parent, lrOnly, tbOnly, ignoreBottom) {
  9602. return OverlapArea(element, parent, lrOnly, tbOnly, ignoreBottom) === 0;
  9603. }
  9604. ;
  9605. function OverlapArea(element, parent, lrOnly, tbOnly, ignoreBottom) {
  9606. var eleDims = GetDimensions(element),
  9607. topOver,
  9608. bottomOver,
  9609. leftOver,
  9610. rightOver;
  9611. if (parent) {
  9612. var parDims = GetDimensions(parent);
  9613. bottomOver = parDims.height + parDims.offset.top - (eleDims.offset.top + eleDims.height);
  9614. topOver = eleDims.offset.top - parDims.offset.top;
  9615. leftOver = eleDims.offset.left - parDims.offset.left;
  9616. rightOver = parDims.width + parDims.offset.left - (eleDims.offset.left + eleDims.width);
  9617. } else {
  9618. bottomOver = eleDims.windowDims.height + eleDims.windowDims.offset.top - (eleDims.offset.top + eleDims.height);
  9619. topOver = eleDims.offset.top - eleDims.windowDims.offset.top;
  9620. leftOver = eleDims.offset.left - eleDims.windowDims.offset.left;
  9621. rightOver = eleDims.windowDims.width - (eleDims.offset.left + eleDims.width);
  9622. }
  9623. bottomOver = ignoreBottom ? 0 : Math.min(bottomOver, 0);
  9624. topOver = Math.min(topOver, 0);
  9625. leftOver = Math.min(leftOver, 0);
  9626. rightOver = Math.min(rightOver, 0);
  9627. if (lrOnly) {
  9628. return leftOver + rightOver;
  9629. }
  9630. if (tbOnly) {
  9631. return topOver + bottomOver;
  9632. } // use sum of squares b/c we care about overlap area.
  9633. return Math.sqrt(topOver * topOver + bottomOver * bottomOver + leftOver * leftOver + rightOver * rightOver);
  9634. }
  9635. /**
  9636. * Uses native methods to return an object of dimension values.
  9637. * @function
  9638. * @param {jQuery || HTML} element - jQuery object or DOM element for which to get the dimensions. Can be any element other that document or window.
  9639. * @returns {Object} - nested object of integer pixel values
  9640. * TODO - if element is window, return only those values.
  9641. */
  9642. function GetDimensions(elem) {
  9643. elem = elem.length ? elem[0] : elem;
  9644. if (elem === window || elem === document) {
  9645. throw new Error("I'm sorry, Dave. I'm afraid I can't do that.");
  9646. }
  9647. var rect = elem.getBoundingClientRect(),
  9648. parRect = elem.parentNode.getBoundingClientRect(),
  9649. winRect = document.body.getBoundingClientRect(),
  9650. winY = window.pageYOffset,
  9651. winX = window.pageXOffset;
  9652. return {
  9653. width: rect.width,
  9654. height: rect.height,
  9655. offset: {
  9656. top: rect.top + winY,
  9657. left: rect.left + winX
  9658. },
  9659. parentDims: {
  9660. width: parRect.width,
  9661. height: parRect.height,
  9662. offset: {
  9663. top: parRect.top + winY,
  9664. left: parRect.left + winX
  9665. }
  9666. },
  9667. windowDims: {
  9668. width: winRect.width,
  9669. height: winRect.height,
  9670. offset: {
  9671. top: winY,
  9672. left: winX
  9673. }
  9674. }
  9675. };
  9676. }
  9677. /**
  9678. * Returns an object of top and left integer pixel values for dynamically rendered elements,
  9679. * such as: Tooltip, Reveal, and Dropdown. Maintained for backwards compatibility, and where
  9680. * you don't know alignment, but generally from
  9681. * 6.4 forward you should use GetExplicitOffsets, as GetOffsets conflates position and alignment.
  9682. * @function
  9683. * @param {jQuery} element - jQuery object for the element being positioned.
  9684. * @param {jQuery} anchor - jQuery object for the element's anchor point.
  9685. * @param {String} position - a string relating to the desired position of the element, relative to it's anchor
  9686. * @param {Number} vOffset - integer pixel value of desired vertical separation between anchor and element.
  9687. * @param {Number} hOffset - integer pixel value of desired horizontal separation between anchor and element.
  9688. * @param {Boolean} isOverflow - if a collision event is detected, sets to true to default the element to full width - any desired offset.
  9689. * TODO alter/rewrite to work with `em` values as well/instead of pixels
  9690. */
  9691. function GetOffsets(element, anchor, position, vOffset, hOffset, isOverflow) {
  9692. console.log("NOTE: GetOffsets is deprecated in favor of GetExplicitOffsets and will be removed in 6.5");
  9693. switch (position) {
  9694. case 'top':
  9695. return Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_0__["rtl"])() ? GetExplicitOffsets(element, anchor, 'top', 'left', vOffset, hOffset, isOverflow) : GetExplicitOffsets(element, anchor, 'top', 'right', vOffset, hOffset, isOverflow);
  9696. case 'bottom':
  9697. return Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_0__["rtl"])() ? GetExplicitOffsets(element, anchor, 'bottom', 'left', vOffset, hOffset, isOverflow) : GetExplicitOffsets(element, anchor, 'bottom', 'right', vOffset, hOffset, isOverflow);
  9698. case 'center top':
  9699. return GetExplicitOffsets(element, anchor, 'top', 'center', vOffset, hOffset, isOverflow);
  9700. case 'center bottom':
  9701. return GetExplicitOffsets(element, anchor, 'bottom', 'center', vOffset, hOffset, isOverflow);
  9702. case 'center left':
  9703. return GetExplicitOffsets(element, anchor, 'left', 'center', vOffset, hOffset, isOverflow);
  9704. case 'center right':
  9705. return GetExplicitOffsets(element, anchor, 'right', 'center', vOffset, hOffset, isOverflow);
  9706. case 'left bottom':
  9707. return GetExplicitOffsets(element, anchor, 'bottom', 'left', vOffset, hOffset, isOverflow);
  9708. case 'right bottom':
  9709. return GetExplicitOffsets(element, anchor, 'bottom', 'right', vOffset, hOffset, isOverflow);
  9710. // Backwards compatibility... this along with the reveal and reveal full
  9711. // classes are the only ones that didn't reference anchor
  9712. case 'center':
  9713. return {
  9714. left: $eleDims.windowDims.offset.left + $eleDims.windowDims.width / 2 - $eleDims.width / 2 + hOffset,
  9715. top: $eleDims.windowDims.offset.top + $eleDims.windowDims.height / 2 - ($eleDims.height / 2 + vOffset)
  9716. };
  9717. case 'reveal':
  9718. return {
  9719. left: ($eleDims.windowDims.width - $eleDims.width) / 2 + hOffset,
  9720. top: $eleDims.windowDims.offset.top + vOffset
  9721. };
  9722. case 'reveal full':
  9723. return {
  9724. left: $eleDims.windowDims.offset.left,
  9725. top: $eleDims.windowDims.offset.top
  9726. };
  9727. break;
  9728. default:
  9729. return {
  9730. left: Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_0__["rtl"])() ? $anchorDims.offset.left - $eleDims.width + $anchorDims.width - hOffset : $anchorDims.offset.left + hOffset,
  9731. top: $anchorDims.offset.top + $anchorDims.height + vOffset
  9732. };
  9733. }
  9734. }
  9735. function GetExplicitOffsets(element, anchor, position, alignment, vOffset, hOffset, isOverflow) {
  9736. var $eleDims = GetDimensions(element),
  9737. $anchorDims = anchor ? GetDimensions(anchor) : null;
  9738. var topVal, leftVal; // set position related attribute
  9739. switch (position) {
  9740. case 'top':
  9741. topVal = $anchorDims.offset.top - ($eleDims.height + vOffset);
  9742. break;
  9743. case 'bottom':
  9744. topVal = $anchorDims.offset.top + $anchorDims.height + vOffset;
  9745. break;
  9746. case 'left':
  9747. leftVal = $anchorDims.offset.left - ($eleDims.width + hOffset);
  9748. break;
  9749. case 'right':
  9750. leftVal = $anchorDims.offset.left + $anchorDims.width + hOffset;
  9751. break;
  9752. } // set alignment related attribute
  9753. switch (position) {
  9754. case 'top':
  9755. case 'bottom':
  9756. switch (alignment) {
  9757. case 'left':
  9758. leftVal = $anchorDims.offset.left + hOffset;
  9759. break;
  9760. case 'right':
  9761. leftVal = $anchorDims.offset.left - $eleDims.width + $anchorDims.width - hOffset;
  9762. break;
  9763. case 'center':
  9764. leftVal = isOverflow ? hOffset : $anchorDims.offset.left + $anchorDims.width / 2 - $eleDims.width / 2 + hOffset;
  9765. break;
  9766. }
  9767. break;
  9768. case 'right':
  9769. case 'left':
  9770. switch (alignment) {
  9771. case 'bottom':
  9772. topVal = $anchorDims.offset.top - vOffset + $anchorDims.height - $eleDims.height;
  9773. break;
  9774. case 'top':
  9775. topVal = $anchorDims.offset.top + vOffset;
  9776. break;
  9777. case 'center':
  9778. topVal = $anchorDims.offset.top + vOffset + $anchorDims.height / 2 - $eleDims.height / 2;
  9779. break;
  9780. }
  9781. break;
  9782. }
  9783. return {
  9784. top: topVal,
  9785. left: leftVal
  9786. };
  9787. }
  9788. /***/ }),
  9789. /***/ "./js/foundation.util.imageLoader.js":
  9790. /*!*******************************************!*\
  9791. !*** ./js/foundation.util.imageLoader.js ***!
  9792. \*******************************************/
  9793. /*! exports provided: onImagesLoaded */
  9794. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9795. "use strict";
  9796. __webpack_require__.r(__webpack_exports__);
  9797. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onImagesLoaded", function() { return onImagesLoaded; });
  9798. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  9799. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  9800. /**
  9801. * Runs a callback function when images are fully loaded.
  9802. * @param {Object} images - Image(s) to check if loaded.
  9803. * @param {Func} callback - Function to execute when image is fully loaded.
  9804. */
  9805. function onImagesLoaded(images, callback) {
  9806. var self = this,
  9807. unloaded = images.length;
  9808. if (unloaded === 0) {
  9809. callback();
  9810. }
  9811. images.each(function () {
  9812. // Check if image is loaded
  9813. if (this.complete && typeof this.naturalWidth !== 'undefined') {
  9814. singleImageLoaded();
  9815. } else {
  9816. // If the above check failed, simulate loading on detached element.
  9817. var image = new Image(); // Still count image as loaded if it finalizes with an error.
  9818. var events = "load.zf.images error.zf.images";
  9819. jquery__WEBPACK_IMPORTED_MODULE_0___default()(image).one(events, function me(event) {
  9820. // Unbind the event listeners. We're using 'one' but only one of the two events will have fired.
  9821. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).off(events, me);
  9822. singleImageLoaded();
  9823. });
  9824. image.src = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('src');
  9825. }
  9826. });
  9827. function singleImageLoaded() {
  9828. unloaded--;
  9829. if (unloaded === 0) {
  9830. callback();
  9831. }
  9832. }
  9833. }
  9834. /***/ }),
  9835. /***/ "./js/foundation.util.keyboard.js":
  9836. /*!****************************************!*\
  9837. !*** ./js/foundation.util.keyboard.js ***!
  9838. \****************************************/
  9839. /*! exports provided: Keyboard */
  9840. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9841. "use strict";
  9842. __webpack_require__.r(__webpack_exports__);
  9843. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Keyboard", function() { return Keyboard; });
  9844. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  9845. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  9846. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  9847. /*******************************************
  9848. * *
  9849. * This util was created by Marius Olbertz *
  9850. * Please thank Marius on GitHub /owlbertz *
  9851. * or the web http://www.mariusolbertz.de/ *
  9852. * *
  9853. ******************************************/
  9854. var keyCodes = {
  9855. 9: 'TAB',
  9856. 13: 'ENTER',
  9857. 27: 'ESCAPE',
  9858. 32: 'SPACE',
  9859. 35: 'END',
  9860. 36: 'HOME',
  9861. 37: 'ARROW_LEFT',
  9862. 38: 'ARROW_UP',
  9863. 39: 'ARROW_RIGHT',
  9864. 40: 'ARROW_DOWN'
  9865. };
  9866. var commands = {}; // Functions pulled out to be referenceable from internals
  9867. function findFocusable($element) {
  9868. if (!$element) {
  9869. return false;
  9870. }
  9871. return $element.find('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]').filter(function () {
  9872. if (!jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is(':visible') || jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('tabindex') < 0) {
  9873. return false;
  9874. } //only have visible elements and those that have a tabindex greater or equal 0
  9875. return true;
  9876. });
  9877. }
  9878. function parseKey(event) {
  9879. var key = keyCodes[event.which || event.keyCode] || String.fromCharCode(event.which).toUpperCase(); // Remove un-printable characters, e.g. for `fromCharCode` calls for CTRL only events
  9880. key = key.replace(/\W+/, '');
  9881. if (event.shiftKey) key = "SHIFT_".concat(key);
  9882. if (event.ctrlKey) key = "CTRL_".concat(key);
  9883. if (event.altKey) key = "ALT_".concat(key); // Remove trailing underscore, in case only modifiers were used (e.g. only `CTRL_ALT`)
  9884. key = key.replace(/_$/, '');
  9885. return key;
  9886. }
  9887. var Keyboard = {
  9888. keys: getKeyCodes(keyCodes),
  9889. /**
  9890. * Parses the (keyboard) event and returns a String that represents its key
  9891. * Can be used like Foundation.parseKey(event) === Foundation.keys.SPACE
  9892. * @param {Event} event - the event generated by the event handler
  9893. * @return String key - String that represents the key pressed
  9894. */
  9895. parseKey: parseKey,
  9896. /**
  9897. * Handles the given (keyboard) event
  9898. * @param {Event} event - the event generated by the event handler
  9899. * @param {String} component - Foundation component's name, e.g. Slider or Reveal
  9900. * @param {Objects} functions - collection of functions that are to be executed
  9901. */
  9902. handleKey: function handleKey(event, component, functions) {
  9903. var commandList = commands[component],
  9904. keyCode = this.parseKey(event),
  9905. cmds,
  9906. command,
  9907. fn;
  9908. if (!commandList) return console.warn('Component not defined!');
  9909. if (typeof commandList.ltr === 'undefined') {
  9910. // this component does not differentiate between ltr and rtl
  9911. cmds = commandList; // use plain list
  9912. } else {
  9913. // merge ltr and rtl: if document is rtl, rtl overwrites ltr and vice versa
  9914. if (Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["rtl"])()) cmds = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, commandList.ltr, commandList.rtl);else cmds = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, commandList.rtl, commandList.ltr);
  9915. }
  9916. command = cmds[keyCode];
  9917. fn = functions[command];
  9918. if (fn && typeof fn === 'function') {
  9919. // execute function if exists
  9920. var returnValue = fn.apply();
  9921. if (functions.handled || typeof functions.handled === 'function') {
  9922. // execute function when event was handled
  9923. functions.handled(returnValue);
  9924. }
  9925. } else {
  9926. if (functions.unhandled || typeof functions.unhandled === 'function') {
  9927. // execute function when event was not handled
  9928. functions.unhandled();
  9929. }
  9930. }
  9931. },
  9932. /**
  9933. * Finds all focusable elements within the given `$element`
  9934. * @param {jQuery} $element - jQuery object to search within
  9935. * @return {jQuery} $focusable - all focusable elements within `$element`
  9936. */
  9937. findFocusable: findFocusable,
  9938. /**
  9939. * Returns the component name name
  9940. * @param {Object} component - Foundation component, e.g. Slider or Reveal
  9941. * @return String componentName
  9942. */
  9943. register: function register(componentName, cmds) {
  9944. commands[componentName] = cmds;
  9945. },
  9946. // TODO9438: These references to Keyboard need to not require global. Will 'this' work in this context?
  9947. //
  9948. /**
  9949. * Traps the focus in the given element.
  9950. * @param {jQuery} $element jQuery object to trap the foucs into.
  9951. */
  9952. trapFocus: function trapFocus($element) {
  9953. var $focusable = findFocusable($element),
  9954. $firstFocusable = $focusable.eq(0),
  9955. $lastFocusable = $focusable.eq(-1);
  9956. $element.on('keydown.zf.trapfocus', function (event) {
  9957. if (event.target === $lastFocusable[0] && parseKey(event) === 'TAB') {
  9958. event.preventDefault();
  9959. $firstFocusable.focus();
  9960. } else if (event.target === $firstFocusable[0] && parseKey(event) === 'SHIFT_TAB') {
  9961. event.preventDefault();
  9962. $lastFocusable.focus();
  9963. }
  9964. });
  9965. },
  9966. /**
  9967. * Releases the trapped focus from the given element.
  9968. * @param {jQuery} $element jQuery object to release the focus for.
  9969. */
  9970. releaseFocus: function releaseFocus($element) {
  9971. $element.off('keydown.zf.trapfocus');
  9972. }
  9973. };
  9974. /*
  9975. * Constants for easier comparing.
  9976. * Can be used like Foundation.parseKey(event) === Foundation.keys.SPACE
  9977. */
  9978. function getKeyCodes(kcs) {
  9979. var k = {};
  9980. for (var kc in kcs) {
  9981. k[kcs[kc]] = kcs[kc];
  9982. }
  9983. return k;
  9984. }
  9985. /***/ }),
  9986. /***/ "./js/foundation.util.mediaQuery.js":
  9987. /*!******************************************!*\
  9988. !*** ./js/foundation.util.mediaQuery.js ***!
  9989. \******************************************/
  9990. /*! exports provided: MediaQuery */
  9991. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9992. "use strict";
  9993. __webpack_require__.r(__webpack_exports__);
  9994. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MediaQuery", function() { return MediaQuery; });
  9995. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  9996. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  9997. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  9998. // Default set of media queries
  9999. var defaultQueries = {
  10000. 'default': 'only screen',
  10001. landscape: 'only screen and (orientation: landscape)',
  10002. portrait: 'only screen and (orientation: portrait)',
  10003. retina: 'only screen and (-webkit-min-device-pixel-ratio: 2),' + 'only screen and (min--moz-device-pixel-ratio: 2),' + 'only screen and (-o-min-device-pixel-ratio: 2/1),' + 'only screen and (min-device-pixel-ratio: 2),' + 'only screen and (min-resolution: 192dpi),' + 'only screen and (min-resolution: 2dppx)'
  10004. }; // matchMedia() polyfill - Test a CSS media type/query in JS.
  10005. // Authors & copyright(c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. MIT license
  10006. /* eslint-disable */
  10007. window.matchMedia || (window.matchMedia = function () {
  10008. "use strict"; // For browsers that support matchMedium api such as IE 9 and webkit
  10009. var styleMedia = window.styleMedia || window.media; // For those that don't support matchMedium
  10010. if (!styleMedia) {
  10011. var style = document.createElement('style'),
  10012. script = document.getElementsByTagName('script')[0],
  10013. info = null;
  10014. style.type = 'text/css';
  10015. style.id = 'matchmediajs-test';
  10016. if (!script) {
  10017. document.head.appendChild(style);
  10018. } else {
  10019. script.parentNode.insertBefore(style, script);
  10020. } // 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers
  10021. info = 'getComputedStyle' in window && window.getComputedStyle(style, null) || style.currentStyle;
  10022. styleMedia = {
  10023. matchMedium: function matchMedium(media) {
  10024. var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }'; // 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers
  10025. if (style.styleSheet) {
  10026. style.styleSheet.cssText = text;
  10027. } else {
  10028. style.textContent = text;
  10029. } // Test if media query is true or false
  10030. return info.width === '1px';
  10031. }
  10032. };
  10033. }
  10034. return function (media) {
  10035. return {
  10036. matches: styleMedia.matchMedium(media || 'all'),
  10037. media: media || 'all'
  10038. };
  10039. };
  10040. }());
  10041. /* eslint-enable */
  10042. var MediaQuery = {
  10043. queries: [],
  10044. current: '',
  10045. /**
  10046. * Initializes the media query helper, by extracting the breakpoint list from the CSS and activating the breakpoint watcher.
  10047. * @function
  10048. * @private
  10049. */
  10050. _init: function _init() {
  10051. var self = this;
  10052. var $meta = jquery__WEBPACK_IMPORTED_MODULE_0___default()('meta.foundation-mq');
  10053. if (!$meta.length) {
  10054. jquery__WEBPACK_IMPORTED_MODULE_0___default()('<meta class="foundation-mq">').appendTo(document.head);
  10055. }
  10056. var extractedStyles = jquery__WEBPACK_IMPORTED_MODULE_0___default()('.foundation-mq').css('font-family');
  10057. var namedQueries;
  10058. namedQueries = parseStyleToObject(extractedStyles);
  10059. for (var key in namedQueries) {
  10060. if (namedQueries.hasOwnProperty(key)) {
  10061. self.queries.push({
  10062. name: key,
  10063. value: "only screen and (min-width: ".concat(namedQueries[key], ")")
  10064. });
  10065. }
  10066. }
  10067. this.current = this._getCurrentSize();
  10068. this._watcher();
  10069. },
  10070. /**
  10071. * Checks if the screen is at least as wide as a breakpoint.
  10072. * @function
  10073. * @param {String} size - Name of the breakpoint to check.
  10074. * @returns {Boolean} `true` if the breakpoint matches, `false` if it's smaller.
  10075. */
  10076. atLeast: function atLeast(size) {
  10077. var query = this.get(size);
  10078. if (query) {
  10079. return window.matchMedia(query).matches;
  10080. }
  10081. return false;
  10082. },
  10083. /**
  10084. * Checks if the screen matches to a breakpoint.
  10085. * @function
  10086. * @param {String} size - Name of the breakpoint to check, either 'small only' or 'small'. Omitting 'only' falls back to using atLeast() method.
  10087. * @returns {Boolean} `true` if the breakpoint matches, `false` if it does not.
  10088. */
  10089. is: function is(size) {
  10090. size = size.trim().split(' ');
  10091. if (size.length > 1 && size[1] === 'only') {
  10092. if (size[0] === this._getCurrentSize()) return true;
  10093. } else {
  10094. return this.atLeast(size[0]);
  10095. }
  10096. return false;
  10097. },
  10098. /**
  10099. * Gets the media query of a breakpoint.
  10100. * @function
  10101. * @param {String} size - Name of the breakpoint to get.
  10102. * @returns {String|null} - The media query of the breakpoint, or `null` if the breakpoint doesn't exist.
  10103. */
  10104. get: function get(size) {
  10105. for (var i in this.queries) {
  10106. if (this.queries.hasOwnProperty(i)) {
  10107. var query = this.queries[i];
  10108. if (size === query.name) return query.value;
  10109. }
  10110. }
  10111. return null;
  10112. },
  10113. /**
  10114. * Gets the current breakpoint name by testing every breakpoint and returning the last one to match (the biggest one).
  10115. * @function
  10116. * @private
  10117. * @returns {String} Name of the current breakpoint.
  10118. */
  10119. _getCurrentSize: function _getCurrentSize() {
  10120. var matched;
  10121. for (var i = 0; i < this.queries.length; i++) {
  10122. var query = this.queries[i];
  10123. if (window.matchMedia(query.value).matches) {
  10124. matched = query;
  10125. }
  10126. }
  10127. if (_typeof(matched) === 'object') {
  10128. return matched.name;
  10129. } else {
  10130. return matched;
  10131. }
  10132. },
  10133. /**
  10134. * Activates the breakpoint watcher, which fires an event on the window whenever the breakpoint changes.
  10135. * @function
  10136. * @private
  10137. */
  10138. _watcher: function _watcher() {
  10139. var _this = this;
  10140. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('resize.zf.mediaquery').on('resize.zf.mediaquery', function () {
  10141. var newSize = _this._getCurrentSize(),
  10142. currentSize = _this.current;
  10143. if (newSize !== currentSize) {
  10144. // Change the current media query
  10145. _this.current = newSize; // Broadcast the media query change on the window
  10146. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).trigger('changed.zf.mediaquery', [newSize, currentSize]);
  10147. }
  10148. });
  10149. }
  10150. }; // Thank you: https://github.com/sindresorhus/query-string
  10151. function parseStyleToObject(str) {
  10152. var styleObject = {};
  10153. if (typeof str !== 'string') {
  10154. return styleObject;
  10155. }
  10156. str = str.trim().slice(1, -1); // browsers re-quote string style values
  10157. if (!str) {
  10158. return styleObject;
  10159. }
  10160. styleObject = str.split('&').reduce(function (ret, param) {
  10161. var parts = param.replace(/\+/g, ' ').split('=');
  10162. var key = parts[0];
  10163. var val = parts[1];
  10164. key = decodeURIComponent(key); // missing `=` should be `null`:
  10165. // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters
  10166. val = typeof val === 'undefined' ? null : decodeURIComponent(val);
  10167. if (!ret.hasOwnProperty(key)) {
  10168. ret[key] = val;
  10169. } else if (Array.isArray(ret[key])) {
  10170. ret[key].push(val);
  10171. } else {
  10172. ret[key] = [ret[key], val];
  10173. }
  10174. return ret;
  10175. }, {});
  10176. return styleObject;
  10177. }
  10178. /***/ }),
  10179. /***/ "./js/foundation.util.motion.js":
  10180. /*!**************************************!*\
  10181. !*** ./js/foundation.util.motion.js ***!
  10182. \**************************************/
  10183. /*! exports provided: Move, Motion */
  10184. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10185. "use strict";
  10186. __webpack_require__.r(__webpack_exports__);
  10187. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Move", function() { return Move; });
  10188. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Motion", function() { return Motion; });
  10189. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  10190. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  10191. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  10192. /**
  10193. * Motion module.
  10194. * @module foundation.motion
  10195. */
  10196. var initClasses = ['mui-enter', 'mui-leave'];
  10197. var activeClasses = ['mui-enter-active', 'mui-leave-active'];
  10198. var Motion = {
  10199. animateIn: function animateIn(element, animation, cb) {
  10200. animate(true, element, animation, cb);
  10201. },
  10202. animateOut: function animateOut(element, animation, cb) {
  10203. animate(false, element, animation, cb);
  10204. }
  10205. };
  10206. function Move(duration, elem, fn) {
  10207. var anim,
  10208. prog,
  10209. start = null; // console.log('called');
  10210. if (duration === 0) {
  10211. fn.apply(elem);
  10212. elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]);
  10213. return;
  10214. }
  10215. function move(ts) {
  10216. if (!start) start = ts; // console.log(start, ts);
  10217. prog = ts - start;
  10218. fn.apply(elem);
  10219. if (prog < duration) {
  10220. anim = window.requestAnimationFrame(move, elem);
  10221. } else {
  10222. window.cancelAnimationFrame(anim);
  10223. elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]);
  10224. }
  10225. }
  10226. anim = window.requestAnimationFrame(move);
  10227. }
  10228. /**
  10229. * Animates an element in or out using a CSS transition class.
  10230. * @function
  10231. * @private
  10232. * @param {Boolean} isIn - Defines if the animation is in or out.
  10233. * @param {Object} element - jQuery or HTML object to animate.
  10234. * @param {String} animation - CSS class to use.
  10235. * @param {Function} cb - Callback to run when animation is finished.
  10236. */
  10237. function animate(isIn, element, animation, cb) {
  10238. element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element).eq(0);
  10239. if (!element.length) return;
  10240. var initClass = isIn ? initClasses[0] : initClasses[1];
  10241. var activeClass = isIn ? activeClasses[0] : activeClasses[1]; // Set up the animation
  10242. reset();
  10243. element.addClass(animation).css('transition', 'none');
  10244. requestAnimationFrame(function () {
  10245. element.addClass(initClass);
  10246. if (isIn) element.show();
  10247. }); // Start the animation
  10248. requestAnimationFrame(function () {
  10249. element[0].offsetWidth;
  10250. element.css('transition', '').addClass(activeClass);
  10251. }); // Clean up the animation when it finishes
  10252. element.one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["transitionend"])(element), finish); // Hides the element (for out animations), resets the element, and runs a callback
  10253. function finish() {
  10254. if (!isIn) element.hide();
  10255. reset();
  10256. if (cb) cb.apply(element);
  10257. } // Resets transitions and removes motion-specific classes
  10258. function reset() {
  10259. element[0].style.transitionDuration = 0;
  10260. element.removeClass("".concat(initClass, " ").concat(activeClass, " ").concat(animation));
  10261. }
  10262. }
  10263. /***/ }),
  10264. /***/ "./js/foundation.util.nest.js":
  10265. /*!************************************!*\
  10266. !*** ./js/foundation.util.nest.js ***!
  10267. \************************************/
  10268. /*! exports provided: Nest */
  10269. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10270. "use strict";
  10271. __webpack_require__.r(__webpack_exports__);
  10272. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Nest", function() { return Nest; });
  10273. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  10274. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  10275. var Nest = {
  10276. Feather: function Feather(menu) {
  10277. var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'zf';
  10278. menu.attr('role', 'menubar');
  10279. var items = menu.find('li').attr({
  10280. 'role': 'menuitem'
  10281. }),
  10282. subMenuClass = "is-".concat(type, "-submenu"),
  10283. subItemClass = "".concat(subMenuClass, "-item"),
  10284. hasSubClass = "is-".concat(type, "-submenu-parent"),
  10285. applyAria = type !== 'accordion'; // Accordions handle their own ARIA attriutes.
  10286. items.each(function () {
  10287. var $item = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
  10288. $sub = $item.children('ul');
  10289. if ($sub.length) {
  10290. $item.addClass(hasSubClass);
  10291. if (applyAria) {
  10292. $item.attr({
  10293. 'aria-haspopup': true,
  10294. 'aria-label': $item.children('a:first').text()
  10295. }); // Note: Drilldowns behave differently in how they hide, and so need
  10296. // additional attributes. We should look if this possibly over-generalized
  10297. // utility (Nest) is appropriate when we rework menus in 6.4
  10298. if (type === 'drilldown') {
  10299. $item.attr({
  10300. 'aria-expanded': false
  10301. });
  10302. }
  10303. }
  10304. $sub.addClass("submenu ".concat(subMenuClass)).attr({
  10305. 'data-submenu': '',
  10306. 'role': 'menubar'
  10307. });
  10308. if (type === 'drilldown') {
  10309. $sub.attr({
  10310. 'aria-hidden': true
  10311. });
  10312. }
  10313. }
  10314. if ($item.parent('[data-submenu]').length) {
  10315. $item.addClass("is-submenu-item ".concat(subItemClass));
  10316. }
  10317. });
  10318. return;
  10319. },
  10320. Burn: function Burn(menu, type) {
  10321. var //items = menu.find('li'),
  10322. subMenuClass = "is-".concat(type, "-submenu"),
  10323. subItemClass = "".concat(subMenuClass, "-item"),
  10324. hasSubClass = "is-".concat(type, "-submenu-parent");
  10325. menu.find('>li, > li > ul, .menu, .menu > li, [data-submenu] > li').removeClass("".concat(subMenuClass, " ").concat(subItemClass, " ").concat(hasSubClass, " is-submenu-item submenu is-active")).removeAttr('data-submenu').css('display', '');
  10326. }
  10327. };
  10328. /***/ }),
  10329. /***/ "./js/foundation.util.timer.js":
  10330. /*!*************************************!*\
  10331. !*** ./js/foundation.util.timer.js ***!
  10332. \*************************************/
  10333. /*! exports provided: Timer */
  10334. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10335. "use strict";
  10336. __webpack_require__.r(__webpack_exports__);
  10337. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Timer", function() { return Timer; });
  10338. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  10339. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  10340. function Timer(elem, options, cb) {
  10341. var _this = this,
  10342. duration = options.duration,
  10343. //options is an object for easily adding features later.
  10344. nameSpace = Object.keys(elem.data())[0] || 'timer',
  10345. remain = -1,
  10346. start,
  10347. timer;
  10348. this.isPaused = false;
  10349. this.restart = function () {
  10350. remain = -1;
  10351. clearTimeout(timer);
  10352. this.start();
  10353. };
  10354. this.start = function () {
  10355. this.isPaused = false; // if(!elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things.
  10356. clearTimeout(timer);
  10357. remain = remain <= 0 ? duration : remain;
  10358. elem.data('paused', false);
  10359. start = Date.now();
  10360. timer = setTimeout(function () {
  10361. if (options.infinite) {
  10362. _this.restart(); //rerun the timer.
  10363. }
  10364. if (cb && typeof cb === 'function') {
  10365. cb();
  10366. }
  10367. }, remain);
  10368. elem.trigger("timerstart.zf.".concat(nameSpace));
  10369. };
  10370. this.pause = function () {
  10371. this.isPaused = true; //if(elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things.
  10372. clearTimeout(timer);
  10373. elem.data('paused', true);
  10374. var end = Date.now();
  10375. remain = remain - (end - start);
  10376. elem.trigger("timerpaused.zf.".concat(nameSpace));
  10377. };
  10378. }
  10379. /***/ }),
  10380. /***/ "./js/foundation.util.touch.js":
  10381. /*!*************************************!*\
  10382. !*** ./js/foundation.util.touch.js ***!
  10383. \*************************************/
  10384. /*! exports provided: Touch */
  10385. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10386. "use strict";
  10387. __webpack_require__.r(__webpack_exports__);
  10388. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Touch", function() { return Touch; });
  10389. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  10390. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  10391. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10392. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  10393. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  10394. //**************************************************
  10395. //**Work inspired by multiple jquery swipe plugins**
  10396. //**Done by Yohai Ararat ***************************
  10397. //**************************************************
  10398. var Touch = {};
  10399. var startPosX,
  10400. startPosY,
  10401. startTime,
  10402. elapsedTime,
  10403. startEvent,
  10404. isMoving = false,
  10405. didMoved = false;
  10406. function onTouchEnd(e) {
  10407. this.removeEventListener('touchmove', onTouchMove);
  10408. this.removeEventListener('touchend', onTouchEnd); // If the touch did not move, consider it as a "tap"
  10409. if (!didMoved) {
  10410. var tapEvent = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.Event('tap', startEvent || e);
  10411. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger(tapEvent);
  10412. }
  10413. startEvent = null;
  10414. isMoving = false;
  10415. didMoved = false;
  10416. }
  10417. function onTouchMove(e) {
  10418. if (jquery__WEBPACK_IMPORTED_MODULE_0___default.a.spotSwipe.preventDefault) {
  10419. e.preventDefault();
  10420. }
  10421. if (isMoving) {
  10422. var x = e.touches[0].pageX;
  10423. var y = e.touches[0].pageY;
  10424. var dx = startPosX - x;
  10425. var dy = startPosY - y;
  10426. var dir;
  10427. didMoved = true;
  10428. elapsedTime = new Date().getTime() - startTime;
  10429. if (Math.abs(dx) >= jquery__WEBPACK_IMPORTED_MODULE_0___default.a.spotSwipe.moveThreshold && elapsedTime <= jquery__WEBPACK_IMPORTED_MODULE_0___default.a.spotSwipe.timeThreshold) {
  10430. dir = dx > 0 ? 'left' : 'right';
  10431. } // else if(Math.abs(dy) >= $.spotSwipe.moveThreshold && elapsedTime <= $.spotSwipe.timeThreshold) {
  10432. // dir = dy > 0 ? 'down' : 'up';
  10433. // }
  10434. if (dir) {
  10435. e.preventDefault();
  10436. onTouchEnd.apply(this, arguments);
  10437. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger(jquery__WEBPACK_IMPORTED_MODULE_0___default.a.Event('swipe', e), dir).trigger(jquery__WEBPACK_IMPORTED_MODULE_0___default.a.Event("swipe".concat(dir), e));
  10438. }
  10439. }
  10440. }
  10441. function onTouchStart(e) {
  10442. if (e.touches.length == 1) {
  10443. startPosX = e.touches[0].pageX;
  10444. startPosY = e.touches[0].pageY;
  10445. startEvent = e;
  10446. isMoving = true;
  10447. didMoved = false;
  10448. startTime = new Date().getTime();
  10449. this.addEventListener('touchmove', onTouchMove, false);
  10450. this.addEventListener('touchend', onTouchEnd, false);
  10451. }
  10452. }
  10453. function init() {
  10454. this.addEventListener && this.addEventListener('touchstart', onTouchStart, false);
  10455. }
  10456. function teardown() {
  10457. this.removeEventListener('touchstart', onTouchStart);
  10458. }
  10459. var SpotSwipe =
  10460. /*#__PURE__*/
  10461. function () {
  10462. function SpotSwipe($) {
  10463. _classCallCheck(this, SpotSwipe);
  10464. this.version = '1.0.0';
  10465. this.enabled = 'ontouchstart' in document.documentElement;
  10466. this.preventDefault = false;
  10467. this.moveThreshold = 75;
  10468. this.timeThreshold = 200;
  10469. this.$ = $;
  10470. this._init();
  10471. }
  10472. _createClass(SpotSwipe, [{
  10473. key: "_init",
  10474. value: function _init() {
  10475. var $ = this.$;
  10476. $.event.special.swipe = {
  10477. setup: init
  10478. };
  10479. $.event.special.tap = {
  10480. setup: init
  10481. };
  10482. $.each(['left', 'up', 'down', 'right'], function () {
  10483. $.event.special["swipe".concat(this)] = {
  10484. setup: function setup() {
  10485. $(this).on('swipe', $.noop);
  10486. }
  10487. };
  10488. });
  10489. }
  10490. }]);
  10491. return SpotSwipe;
  10492. }();
  10493. /****************************************************
  10494. * As far as I can tell, both setupSpotSwipe and *
  10495. * setupTouchHandler should be idempotent, *
  10496. * because they directly replace functions & *
  10497. * values, and do not add event handlers directly. *
  10498. ****************************************************/
  10499. Touch.setupSpotSwipe = function ($) {
  10500. $.spotSwipe = new SpotSwipe($);
  10501. };
  10502. /****************************************************
  10503. * Method for adding pseudo drag events to elements *
  10504. ***************************************************/
  10505. Touch.setupTouchHandler = function ($) {
  10506. $.fn.addTouch = function () {
  10507. this.each(function (i, el) {
  10508. $(el).bind('touchstart touchmove touchend touchcancel', function (event) {
  10509. //we pass the original event object because the jQuery event
  10510. //object is normalized to w3c specs and does not provide the TouchList
  10511. handleTouch(event);
  10512. });
  10513. });
  10514. var handleTouch = function handleTouch(event) {
  10515. var touches = event.changedTouches,
  10516. first = touches[0],
  10517. eventTypes = {
  10518. touchstart: 'mousedown',
  10519. touchmove: 'mousemove',
  10520. touchend: 'mouseup'
  10521. },
  10522. type = eventTypes[event.type],
  10523. simulatedEvent;
  10524. if ('MouseEvent' in window && typeof window.MouseEvent === 'function') {
  10525. simulatedEvent = new window.MouseEvent(type, {
  10526. 'bubbles': true,
  10527. 'cancelable': true,
  10528. 'screenX': first.screenX,
  10529. 'screenY': first.screenY,
  10530. 'clientX': first.clientX,
  10531. 'clientY': first.clientY
  10532. });
  10533. } else {
  10534. simulatedEvent = document.createEvent('MouseEvent');
  10535. simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0
  10536. /*left*/
  10537. , null);
  10538. }
  10539. first.target.dispatchEvent(simulatedEvent);
  10540. };
  10541. };
  10542. };
  10543. Touch.init = function ($) {
  10544. if (typeof $.spotSwipe === 'undefined') {
  10545. Touch.setupSpotSwipe($);
  10546. Touch.setupTouchHandler($);
  10547. }
  10548. };
  10549. /***/ }),
  10550. /***/ "./js/foundation.util.triggers.js":
  10551. /*!****************************************!*\
  10552. !*** ./js/foundation.util.triggers.js ***!
  10553. \****************************************/
  10554. /*! exports provided: Triggers */
  10555. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10556. "use strict";
  10557. __webpack_require__.r(__webpack_exports__);
  10558. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Triggers", function() { return Triggers; });
  10559. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
  10560. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
  10561. /* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
  10562. /* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js");
  10563. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  10564. var MutationObserver = function () {
  10565. var prefixes = ['WebKit', 'Moz', 'O', 'Ms', ''];
  10566. for (var i = 0; i < prefixes.length; i++) {
  10567. if ("".concat(prefixes[i], "MutationObserver") in window) {
  10568. return window["".concat(prefixes[i], "MutationObserver")];
  10569. }
  10570. }
  10571. return false;
  10572. }();
  10573. var triggers = function triggers(el, type) {
  10574. el.data(type).split(' ').forEach(function (id) {
  10575. jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(id))[type === 'close' ? 'trigger' : 'triggerHandler']("".concat(type, ".zf.trigger"), [el]);
  10576. });
  10577. };
  10578. var Triggers = {
  10579. Listeners: {
  10580. Basic: {},
  10581. Global: {}
  10582. },
  10583. Initializers: {}
  10584. };
  10585. Triggers.Listeners.Basic = {
  10586. openListener: function openListener() {
  10587. triggers(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 'open');
  10588. },
  10589. closeListener: function closeListener() {
  10590. var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('close');
  10591. if (id) {
  10592. triggers(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 'close');
  10593. } else {
  10594. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger('close.zf.trigger');
  10595. }
  10596. },
  10597. toggleListener: function toggleListener() {
  10598. var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('toggle');
  10599. if (id) {
  10600. triggers(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 'toggle');
  10601. } else {
  10602. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger('toggle.zf.trigger');
  10603. }
  10604. },
  10605. closeableListener: function closeableListener(e) {
  10606. e.stopPropagation();
  10607. var animation = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('closable');
  10608. if (animation !== '') {
  10609. _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateOut(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), animation, function () {
  10610. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger('closed.zf');
  10611. });
  10612. } else {
  10613. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).fadeOut().trigger('closed.zf');
  10614. }
  10615. },
  10616. toggleFocusListener: function toggleFocusListener() {
  10617. var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('toggle-focus');
  10618. jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(id)).triggerHandler('toggle.zf.trigger', [jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)]);
  10619. }
  10620. }; // Elements with [data-open] will reveal a plugin that supports it when clicked.
  10621. Triggers.Initializers.addOpenListener = function ($elem) {
  10622. $elem.off('click.zf.trigger', Triggers.Listeners.Basic.openListener);
  10623. $elem.on('click.zf.trigger', '[data-open]', Triggers.Listeners.Basic.openListener);
  10624. }; // Elements with [data-close] will close a plugin that supports it when clicked.
  10625. // If used without a value on [data-close], the event will bubble, allowing it to close a parent component.
  10626. Triggers.Initializers.addCloseListener = function ($elem) {
  10627. $elem.off('click.zf.trigger', Triggers.Listeners.Basic.closeListener);
  10628. $elem.on('click.zf.trigger', '[data-close]', Triggers.Listeners.Basic.closeListener);
  10629. }; // Elements with [data-toggle] will toggle a plugin that supports it when clicked.
  10630. Triggers.Initializers.addToggleListener = function ($elem) {
  10631. $elem.off('click.zf.trigger', Triggers.Listeners.Basic.toggleListener);
  10632. $elem.on('click.zf.trigger', '[data-toggle]', Triggers.Listeners.Basic.toggleListener);
  10633. }; // Elements with [data-closable] will respond to close.zf.trigger events.
  10634. Triggers.Initializers.addCloseableListener = function ($elem) {
  10635. $elem.off('close.zf.trigger', Triggers.Listeners.Basic.closeableListener);
  10636. $elem.on('close.zf.trigger', '[data-closeable], [data-closable]', Triggers.Listeners.Basic.closeableListener);
  10637. }; // Elements with [data-toggle-focus] will respond to coming in and out of focus
  10638. Triggers.Initializers.addToggleFocusListener = function ($elem) {
  10639. $elem.off('focus.zf.trigger blur.zf.trigger', Triggers.Listeners.Basic.toggleFocusListener);
  10640. $elem.on('focus.zf.trigger blur.zf.trigger', '[data-toggle-focus]', Triggers.Listeners.Basic.toggleFocusListener);
  10641. }; // More Global/complex listeners and triggers
  10642. Triggers.Listeners.Global = {
  10643. resizeListener: function resizeListener($nodes) {
  10644. if (!MutationObserver) {
  10645. //fallback for IE 9
  10646. $nodes.each(function () {
  10647. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).triggerHandler('resizeme.zf.trigger');
  10648. });
  10649. } //trigger all listening elements and signal a resize event
  10650. $nodes.attr('data-events', "resize");
  10651. },
  10652. scrollListener: function scrollListener($nodes) {
  10653. if (!MutationObserver) {
  10654. //fallback for IE 9
  10655. $nodes.each(function () {
  10656. jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).triggerHandler('scrollme.zf.trigger');
  10657. });
  10658. } //trigger all listening elements and signal a scroll event
  10659. $nodes.attr('data-events', "scroll");
  10660. },
  10661. closeMeListener: function closeMeListener(e, pluginId) {
  10662. var plugin = e.namespace.split('.')[0];
  10663. var plugins = jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-".concat(plugin, "]")).not("[data-yeti-box=\"".concat(pluginId, "\"]"));
  10664. plugins.each(function () {
  10665. var _this = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this);
  10666. _this.triggerHandler('close.zf.trigger', [_this]);
  10667. });
  10668. } // Global, parses whole document.
  10669. };
  10670. Triggers.Initializers.addClosemeListener = function (pluginName) {
  10671. var yetiBoxes = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-yeti-box]'),
  10672. plugNames = ['dropdown', 'tooltip', 'reveal'];
  10673. if (pluginName) {
  10674. if (typeof pluginName === 'string') {
  10675. plugNames.push(pluginName);
  10676. } else if (_typeof(pluginName) === 'object' && typeof pluginName[0] === 'string') {
  10677. plugNames = plugNames.concat(pluginName);
  10678. } else {
  10679. console.error('Plugin names must be strings');
  10680. }
  10681. }
  10682. if (yetiBoxes.length) {
  10683. var listeners = plugNames.map(function (name) {
  10684. return "closeme.zf.".concat(name);
  10685. }).join(' ');
  10686. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(listeners).on(listeners, Triggers.Listeners.Global.closeMeListener);
  10687. }
  10688. };
  10689. function debounceGlobalListener(debounce, trigger, listener) {
  10690. var timer,
  10691. args = Array.prototype.slice.call(arguments, 3);
  10692. jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(trigger).on(trigger, function (e) {
  10693. if (timer) {
  10694. clearTimeout(timer);
  10695. }
  10696. timer = setTimeout(function () {
  10697. listener.apply(null, args);
  10698. }, debounce || 10); //default time to emit scroll event
  10699. });
  10700. }
  10701. Triggers.Initializers.addResizeListener = function (debounce) {
  10702. var $nodes = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-resize]');
  10703. if ($nodes.length) {
  10704. debounceGlobalListener(debounce, 'resize.zf.trigger', Triggers.Listeners.Global.resizeListener, $nodes);
  10705. }
  10706. };
  10707. Triggers.Initializers.addScrollListener = function (debounce) {
  10708. var $nodes = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-scroll]');
  10709. if ($nodes.length) {
  10710. debounceGlobalListener(debounce, 'scroll.zf.trigger', Triggers.Listeners.Global.scrollListener, $nodes);
  10711. }
  10712. };
  10713. Triggers.Initializers.addMutationEventsListener = function ($elem) {
  10714. if (!MutationObserver) {
  10715. return false;
  10716. }
  10717. var $nodes = $elem.find('[data-resize], [data-scroll], [data-mutate]'); //element callback
  10718. var listeningElementsMutation = function listeningElementsMutation(mutationRecordsList) {
  10719. var $target = jquery__WEBPACK_IMPORTED_MODULE_0___default()(mutationRecordsList[0].target); //trigger the event handler for the element depending on type
  10720. switch (mutationRecordsList[0].type) {
  10721. case "attributes":
  10722. if ($target.attr("data-events") === "scroll" && mutationRecordsList[0].attributeName === "data-events") {
  10723. $target.triggerHandler('scrollme.zf.trigger', [$target, window.pageYOffset]);
  10724. }
  10725. if ($target.attr("data-events") === "resize" && mutationRecordsList[0].attributeName === "data-events") {
  10726. $target.triggerHandler('resizeme.zf.trigger', [$target]);
  10727. }
  10728. if (mutationRecordsList[0].attributeName === "style") {
  10729. $target.closest("[data-mutate]").attr("data-events", "mutate");
  10730. $target.closest("[data-mutate]").triggerHandler('mutateme.zf.trigger', [$target.closest("[data-mutate]")]);
  10731. }
  10732. break;
  10733. case "childList":
  10734. $target.closest("[data-mutate]").attr("data-events", "mutate");
  10735. $target.closest("[data-mutate]").triggerHandler('mutateme.zf.trigger', [$target.closest("[data-mutate]")]);
  10736. break;
  10737. default:
  10738. return false;
  10739. //nothing
  10740. }
  10741. };
  10742. if ($nodes.length) {
  10743. //for each element that needs to listen for resizing, scrolling, or mutation add a single observer
  10744. for (var i = 0; i <= $nodes.length - 1; i++) {
  10745. var elementObserver = new MutationObserver(listeningElementsMutation);
  10746. elementObserver.observe($nodes[i], {
  10747. attributes: true,
  10748. childList: true,
  10749. characterData: false,
  10750. subtree: true,
  10751. attributeFilter: ["data-events", "style"]
  10752. });
  10753. }
  10754. }
  10755. };
  10756. Triggers.Initializers.addSimpleListeners = function () {
  10757. var $document = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document);
  10758. Triggers.Initializers.addOpenListener($document);
  10759. Triggers.Initializers.addCloseListener($document);
  10760. Triggers.Initializers.addToggleListener($document);
  10761. Triggers.Initializers.addCloseableListener($document);
  10762. Triggers.Initializers.addToggleFocusListener($document);
  10763. };
  10764. Triggers.Initializers.addGlobalListeners = function () {
  10765. var $document = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document);
  10766. Triggers.Initializers.addMutationEventsListener($document);
  10767. Triggers.Initializers.addResizeListener();
  10768. Triggers.Initializers.addScrollListener();
  10769. Triggers.Initializers.addClosemeListener();
  10770. };
  10771. Triggers.init = function ($, Foundation) {
  10772. Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["onLoad"])($(window), function () {
  10773. if ($.triggersInitialized !== true) {
  10774. Triggers.Initializers.addSimpleListeners();
  10775. Triggers.Initializers.addGlobalListeners();
  10776. $.triggersInitialized = true;
  10777. }
  10778. });
  10779. if (Foundation) {
  10780. Foundation.Triggers = Triggers; // Legacy included to be backwards compatible for now.
  10781. Foundation.IHearYou = Triggers.Initializers.addGlobalListeners;
  10782. }
  10783. };
  10784. /***/ }),
  10785. /***/ 0:
  10786. /*!****************************************!*\
  10787. !*** multi ./js/entries/foundation.js ***!
  10788. \****************************************/
  10789. /*! no static exports found */
  10790. /***/ (function(module, exports, __webpack_require__) {
  10791. module.exports = __webpack_require__(/*! /Users/ncoden/Documents/Documents/Projects/Programmation/Web/2016/Foundation/foundation-sites/js/entries/foundation.js */"./js/entries/foundation.js");
  10792. /***/ }),
  10793. /***/ "jquery":
  10794. /*!********************************************************************************************!*\
  10795. !*** external {"root":["jQuery"],"amd":"jquery","commonjs":"jquery","commonjs2":"jquery"} ***!
  10796. \********************************************************************************************/
  10797. /*! no static exports found */
  10798. /***/ (function(module, exports) {
  10799. module.exports = __WEBPACK_EXTERNAL_MODULE_jquery__;
  10800. /***/ })
  10801. /******/ });
  10802. });
  10803. //# sourceMappingURL=foundation.js.map