biofriction-wp-theme/node_modules/foundation-sites/dist/js/foundation.js.map

1 line
576 KiB
Plaintext

{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap","webpack:///./js/entries/foundation.js","webpack:///./js/foundation.abide.js","webpack:///./js/foundation.accordion.js","webpack:///./js/foundation.accordionMenu.js","webpack:///./js/foundation.core.js","webpack:///./js/foundation.core.plugin.js","webpack:///./js/foundation.core.utils.js","webpack:///./js/foundation.drilldown.js","webpack:///./js/foundation.dropdown.js","webpack:///./js/foundation.dropdownMenu.js","webpack:///./js/foundation.equalizer.js","webpack:///./js/foundation.interchange.js","webpack:///./js/foundation.magellan.js","webpack:///./js/foundation.offcanvas.js","webpack:///./js/foundation.orbit.js","webpack:///./js/foundation.positionable.js","webpack:///./js/foundation.responsiveAccordionTabs.js","webpack:///./js/foundation.responsiveMenu.js","webpack:///./js/foundation.responsiveToggle.js","webpack:///./js/foundation.reveal.js","webpack:///./js/foundation.slider.js","webpack:///./js/foundation.smoothScroll.js","webpack:///./js/foundation.sticky.js","webpack:///./js/foundation.tabs.js","webpack:///./js/foundation.toggler.js","webpack:///./js/foundation.tooltip.js","webpack:///./js/foundation.util.box.js","webpack:///./js/foundation.util.imageLoader.js","webpack:///./js/foundation.util.keyboard.js","webpack:///./js/foundation.util.mediaQuery.js","webpack:///./js/foundation.util.motion.js","webpack:///./js/foundation.util.nest.js","webpack:///./js/foundation.util.timer.js","webpack:///./js/foundation.util.touch.js","webpack:///./js/foundation.util.triggers.js","webpack:///external {\"root\":[\"jQuery\"],\"amd\":\"jquery\",\"commonjs\":\"jquery\",\"commonjs2\":\"jquery\"}"],"names":["Foundation","addToJquery","$","rtl","CoreUtils","GetYoDigits","transitionend","RegExpEscape","onLoad","Box","onImagesLoaded","Keyboard","MediaQuery","Motion","Move","Nest","Timer","Touch","init","Triggers","_init","plugin","Abide","Accordion","AccordionMenu","Drilldown","Dropdown","DropdownMenu","Equalizer","Interchange","Magellan","OffCanvas","Orbit","ResponsiveMenu","ResponsiveToggle","Reveal","Slider","SmoothScroll","Sticky","Tabs","Toggler","Tooltip","ResponsiveAccordionTabs","element","options","$element","extend","defaults","data","className","$inputs","merge","find","not","$globalErrors","a11yAttributes","each","i","input","addA11yAttributes","error","addGlobalErrorA11yAttributes","_events","off","on","resetForm","validateForm","validateOn","e","validateInput","target","liveValidate","validateOnBlur","$el","attr","isGood","type","checked","opt","length","val","id","$error","siblings","formErrorSelector","parent","add","$label","closest","$els","labels","map","el","findLabel","$formError","findFormError","addClass","labelErrorClass","formErrorClass","inputErrorClass","$errors","$labels","filter","first","errorId","elemId","label","end","a11yErrorLevel","groupName","findRadioLabels","$formErrors","removeClass","removeRadioErrorClasses","clearRequire","requiredCheck","validated","customValidator","validator","equalTo","is","validateRadio","validateText","matchValidation","validators","goodToGo","indexOf","message","dependentElements","_this","trigger","acc","push","noError","elem","$elem","css","pattern","inputText","valid","patterns","hasOwnProperty","test","RegExp","prop","$group","required","clear","split","v","$form","opts","removeErrorClasses","Plugin","alpha","alpha_numeric","integer","number","card","cvv","email","url","domain","datetime","date","time","dateISO","month_day_year","day_month_year","color","website","text","register","_isInitializing","$tabs","children","idx","$content","linkId","$initActive","_initialAnchor","prev","_openSingleTab","_checkDeepLink","anchor","window","location","hash","$anchor","$link","isOwnAnchor","hasClass","_closeAllTabs","deepLinkSmudge","offset","animate","scrollTop","top","deepLinkSmudgeDelay","deepLink","$tabContent","preventDefault","toggle","handleKey","next","$a","focus","multiExpand","previous","handled","stopPropagation","$target","console","info","up","down","updateHistory","history","pushState","replaceState","_openTab","$targetItem","$othersItems","allowAllClosed","_closeTab","$activeContents","targetContentId","slideDown","slideSpeed","slideUp","$activeTabs","stop","Feather","multiOpen","$menuLinks","$sub","subId","isActive","parentLink","clone","prependTo","wrap","submenuToggle","after","submenuToggleText","initPanes","$submenu","$elements","$prevElement","$nextElement","eq","Math","max","min","parents","open","close","closeAll","hideAll","stopImmediatePropagation","parentsUntil","$submenus","$allmenus","detach","remove","Burn","FOUNDATION_VERSION","version","_plugins","_uuids","name","functionName","attrName","hyphenate","registerPlugin","pluginName","constructor","toLowerCase","uuid","unregisterPlugin","splice","removeAttr","removeData","reInit","plugins","isJQ","fns","plgs","forEach","p","foundation","Object","keys","err","reflow","addBack","warn","thing","trim","parseValue","er","getFnName","method","$noJS","args","Array","prototype","slice","call","arguments","plugClass","apply","ReferenceError","TypeError","fn","util","throttle","func","delay","timer","context","setTimeout","Date","now","getTime","vendors","requestAnimationFrame","vp","cancelAnimationFrame","navigator","userAgent","lastTime","callback","nextTime","clearTimeout","performance","start","Function","bind","oThis","aArgs","fToBind","fNOP","fBound","concat","funcNameRegex","results","exec","toString","str","isNaN","parseFloat","replace","_setup","getPluginName","_destroy","obj","namespace","round","pow","random","transitions","document","createElement","t","style","triggerHandler","handler","didLoad","readyState","eventType","cb","one","ignoreMousedisappear","ignoreLeaveWindow","ignoreReappear","leaveEventHandler","eLeave","rest","relatedTarget","leaveEventDebouncer","hasFocus","reenterEventHandler","eReenter","currentTarget","has","autoApplyClass","$submenuAnchors","$menuItems","$currentMenu","_prepareMenu","_registerEvents","_keyboardEvents","$menu","$back","backButtonPosition","append","backButton","prepend","_back","autoHeight","$wrapper","wrapper","animateHeight","_getMaxDims","_show","closeOnClick","$body","contains","_hideAll","_bindHandler","_scrollTop","_resize","$scrollTopElement","scrollTopElement","scrollPos","parseInt","scrollTopOffset","animationDuration","animationEasing","_hide","height","parentSubMenu","autoFocus","$expandedSubmenus","index","_setHideSubMenuClasses","isLastChild","_setShowSubMenuClasses","blur","maxHeight","result","numOfElems","GetDimensions","getBoundingClientRect","width","unwrap","$id","$anchors","_setCurrentAnchor","parentClass","$parent","$currentAnchor","position","match","horizontalPosition","alignment","_setPosition","hover","bodyData","whatinput","timeout","hoverDelay","hoverPane","visibleFocusableElements","findFocusable","body","$focusable","_addBodyHandler","trapFocus","releaseFocus","hide","Positionable","vOffset","hOffset","allowOverlap","allowBottomOverlap","subs","verticalClass","rightClass","Rtl","changed","hasTouch","ontouchstart","parClass","handleClickFn","hasSub","hasClicked","clickOpen","forceFollow","closeOnClickInside","disableHover","autoclose","closingTime","isTab","nextSibling","prevSibling","openSub","closeSub","functions","_isVertical","_isRtl","$sibs","ImNotTouchingYou","oldClass","$parentLi","$toClose","somethingToClose","eqId","$watched","hasNested","isNested","isOn","onResizeMeBound","_onResizeMe","onPostEqualizedBound","_onPostEqualized","imgs","tooSmall","equalizeOn","_checkMQ","_reflow","_pauseEvents","equalizeOnStack","_isStacked","equalizeByRow","getHeightsByRow","applyHeightByRow","getHeights","applyHeight","heights","len","offsetHeight","lastElTopOffset","groups","group","elOffsetTop","j","ln","get","groupsILength","lenJ","rules","currentPath","_addBreakpoints","_generateRules","rule","matchMedia","query","matches","path","queries","SPECIAL_QUERIES","value","rulesList","join","nodeName","response","html","calcPoints","$targets","$links","$active","pageYOffset","documentElement","points","winHeight","innerHeight","clientHeight","docHeight","scrollHeight","$tar","pt","threshold","targetPoint","duration","easing","deepLinking","scrollToLoc","_updateActive","onLoadListener","arrival","getAttribute","_deepLinkScroll","loc","_inTransition","newScrollPos","isScrollingUp","activeIdx","visibleLinks","$oldActive","activeHash","isNewActive","isNewHash","activeClass","pathname","search","contentClasses","base","reveal","$lastTrigger","$triggers","nested","contentId","transition","contentOverlay","overlay","overlayPosition","setAttribute","$overlay","insertAfter","revealOnRegExp","revealClass","revealOnClass","isRevealed","revealOn","_setMQChecker","transitionTime","_removeContentClasses","_handleKeyboard","atLeast","hasReveal","_addContentClasses","event","allowUp","allowDown","lastY","originalEvent","pageY","forceTo","scrollTo","contentScroll","_stopScrolling","_recordScrollable","_stopScrollPropagation","canvasFocus","_reset","containerClass","$slides","slideClass","$images","initActive","useMUI","_prepareForOrbit","bullets","_loadBullets","autoPlay","geoSync","accessible","$bullets","boxOfBullets","timerDelay","infinite","changeSlide","_setWrapperHeight","temp","counter","swipe","pauseOnHover","pause","navButtons","$controls","nextClass","prevClass","ltr","$slide","restart","show","_updateBullets","isLTR","chosenSlide","$curSlide","$firstSlide","$lastSlide","last","dirIn","dirOut","$newSlide","infiniteWrap","animateIn","animateOut","isPaused","$oldBullet","span","$newBullet","animInFromRight","animOutToRight","animInFromLeft","animOutToLeft","POSITIONS","VERTICAL_ALIGNMENTS","HORIZONTAL_ALIGNMENTS","ALIGNMENTS","nextItem","item","array","currentIdx","triedPositions","_getDefaultPosition","_getDefaultAlignment","originalPosition","originalAlignment","_alignmentsExhausted","_realign","_addTriedPosition","isExhausted","$eleDims","$anchorDims","GetExplicitOffsets","_getVOffset","_getHOffset","overlaps","minOverlap","minCoordinates","_positionsExhausted","overlap","OverlapArea","_reposition","MenuPlugins","tabs","cssClass","accordion","currentMq","currentPlugin","rulesTree","ruleSize","rulePlugin","_getAllOptions","isEmptyObject","_checkMediaQueries","allOptions","key","dummyPlugin","tmpPlugin","keyKey","objObj","destroy","_changedZfMediaQueryHandler","matchedMq","storezfData","_handleMarkup","toSet","fromString","$panels","tabsTitle","linkClass","tabsPanel","panelClass","$liHeads","$liHeadsA","display","visibility","appendTo","$tabsContent","$placeholder","tempValue","dropdown","drilldown","targetID","$targetMenu","$toggler","animationIn","animationOut","_update","_updateMqHandler","toggleMenu","hideFor","cached","mq","current","fullScreen","_makeOverlay","additionalOverlayClasses","outerWidth","outerHeight","left","margin","_updatePosition","_handleState","$activeAnchor","activeElement","multipleOpened","_disableScroll","afterAnimation","_addGlobalClasses","focusableElements","showDelay","_addGlobalListeners","updateScrollbarClass","toggleClass","closeOnEsc","finishUp","hideDelay","_removeGlobalClasses","_enableScroll","resetOnClose","urlWithoutHash","title","inputs","handles","$handle","$input","$fill","vertical","isDbl","disabled","disabledClass","binding","_setInitAttr","doubleSided","$handle2","$input2","setHandles","_setHandlePos","pctOfBar","percent","positionValueFunction","_logTransform","_powTransform","toFixed","baseLog","nonLinearBase","$hndl","noInvert","h2Val","step","h1Val","vert","hOrW","lOrT","handleDim","elemDim","_pctOfBar","pxToMove","movement","decimal","_setValues","isLeftHndl","dim","handlePct","handlePos","initialStart","moveTime","changedDelay","initVal","initialEnd","hasVal","param","direction","eventOffset","pageX","halfOfHandle","barDim","windowScroll","scrollLeft","elemOffset","clientY","eventFromBar","barXY","offsetPct","_value","_adjustValue","firstHndlPos","absPosition","secndHndlPos","div","prev_val","next_val","_eventsForHandle","curHandle","handleChangeEvent","_handleEvent","keyCode","clickSelect","draggable","addTouch","_$handle","oldValue","newValue","decrease","increase","decrease_fast","increase_fast","invertVertical","frac","num","dir","clickPos","abs","log","_handleLinkClick","$loc","$container","wasWrapped","container","stickyClass","scrollCount","checkEvery","isStuck","containerHeight","elemHeight","_parsePoints","_setSizes","scroll","_calc","_removeSticky","topPoint","reverse","topAnchor","btm","btmAnchor","pts","breaks","place","scrollListener","canStick","_eventsHandler","_pauseListeners","checkSizes","bottomPoint","_setSticky","stickTo","mrgn","notStuckTo","isTop","stickToTop","anchorPt","anchorHeight","topOrBottom","stickyOn","newElemWidth","comp","getComputedStyle","pdngl","pdngr","newContainerHeight","_setBreakPoints","mTop","emCalc","marginTop","mBtm","marginBottom","bottom","em","fontSize","$tabTitles","linkActiveClass","matchHeight","_setHeight","selectTab","_collapse","_addKeyHandler","_addClickHandler","_setHeightMqHandler","_handleTabChange","which","wrapOnKeys","historyHandled","activeCollapse","$oldTab","$tabLink","$targetContent","_collapseTab","panelActiveClass","$target_anchor","$activeTab","idStr","panel","$trigger","controls","containsId","_updateARIA","isClick","tipText","template","_buildTemplate","allowHtml","triggerClass","tooltipWidth","tooltipHeight","templateClasses","tooltipClass","$template","showOn","fadeIn","fadeInDuration","fadeOut","fadeOutDuration","isFocus","disableForTouch","touchCloseText","GetOffsets","lrOnly","tbOnly","ignoreBottom","eleDims","topOver","bottomOver","leftOver","rightOver","parDims","windowDims","sqrt","Error","rect","parRect","parentNode","winRect","winY","winX","pageXOffset","parentDims","isOverflow","topVal","leftVal","images","self","unloaded","complete","naturalWidth","singleImageLoaded","image","Image","events","me","src","keyCodes","commands","parseKey","String","fromCharCode","toUpperCase","shiftKey","ctrlKey","altKey","getKeyCodes","component","commandList","cmds","command","returnValue","unhandled","componentName","$firstFocusable","$lastFocusable","kcs","k","kc","defaultQueries","landscape","portrait","retina","styleMedia","media","script","getElementsByTagName","head","appendChild","insertBefore","currentStyle","matchMedium","styleSheet","cssText","textContent","$meta","extractedStyles","namedQueries","parseStyleToObject","_getCurrentSize","_watcher","size","matched","newSize","currentSize","styleObject","reduce","ret","parts","decodeURIComponent","isArray","initClasses","activeClasses","animation","anim","prog","move","ts","isIn","initClass","reset","offsetWidth","finish","transitionDuration","menu","items","subMenuClass","subItemClass","hasSubClass","applyAria","$item","nameSpace","remain","startPosX","startPosY","startTime","elapsedTime","startEvent","isMoving","didMoved","onTouchEnd","removeEventListener","onTouchMove","tapEvent","Event","spotSwipe","x","touches","y","dx","dy","moveThreshold","timeThreshold","onTouchStart","addEventListener","teardown","SpotSwipe","enabled","special","setup","tap","noop","setupSpotSwipe","setupTouchHandler","handleTouch","changedTouches","eventTypes","touchstart","touchmove","touchend","simulatedEvent","MouseEvent","screenX","screenY","clientX","createEvent","initMouseEvent","dispatchEvent","MutationObserver","prefixes","triggers","Listeners","Basic","Global","Initializers","openListener","closeListener","toggleListener","closeableListener","toggleFocusListener","addOpenListener","addCloseListener","addToggleListener","addCloseableListener","addToggleFocusListener","resizeListener","$nodes","closeMeListener","pluginId","addClosemeListener","yetiBoxes","plugNames","listeners","debounceGlobalListener","debounce","listener","addResizeListener","addScrollListener","addMutationEventsListener","listeningElementsMutation","mutationRecordsList","attributeName","elementObserver","observe","attributes","childList","characterData","subtree","attributeFilter","addSimpleListeners","$document","addGlobalListeners","triggersInitialized","IHearYou"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAE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AAGzpC,6CAAC,CAACwW,QAAD,CAAjB;AACAvV,UAAQ,CAAComC,YAAT,CAAsBwB,yBAAtB,CAAgDY,SAAhD;AACAxoC,UAAQ,CAAComC,YAAT,CAAsBsB,iBAAtB;AACA1nC,UAAQ,CAAComC,YAAT,CAAsBuB,iBAAtB;AACA3nC,UAAQ,CAAComC,YAAT,CAAsBe,kBAAtB;AACD,CAND;;AASAnnC,QAAQ,CAACD,IAAT,GAAgB,UAAUhB,CAAV,EAAaF,UAAb,EAAyB;AACvCQ,uEAAM,CAACN,CAAC,CAACuL,MAAD,CAAF,EAAY,YAAY;AAC5B,QAAIvL,CAAC,CAAC2pC,mBAAF,KAA0B,IAA9B,EAAoC;AAClC1oC,cAAQ,CAAComC,YAAT,CAAsBmC,kBAAtB;AACAvoC,cAAQ,CAAComC,YAAT,CAAsBqC,kBAAtB;AACA1pC,OAAC,CAAC2pC,mBAAF,GAAwB,IAAxB;AACD;AACF,GANK,CAAN;;AAQA,MAAG7pC,UAAH,EAAe;AACbA,cAAU,CAACmB,QAAX,GAAsBA,QAAtB,CADa,CAEb;;AACAnB,cAAU,CAAC8pC,QAAX,GAAsB3oC,QAAQ,CAAComC,YAAT,CAAsBqC,kBAA5C;AACD;AACF,CAdD;;;;;;;;;;;;;;;;;;;;;;;;;ACnPA,oD","file":"foundation.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"jquery\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"jquery\"], factory);\n\telse {\n\t\tvar a = typeof exports === 'object' ? factory(require(\"jquery\")) : factory(root[\"jQuery\"]);\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(window, function(__WEBPACK_EXTERNAL_MODULE_jquery__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","import $ from 'jquery';\n\nimport { Foundation } from '../foundation.core';\nimport * as CoreUtils from '../foundation.core.utils';\nimport { Box } from '../foundation.util.box'\nimport { onImagesLoaded } from '../foundation.util.imageLoader';\nimport { Keyboard } from '../foundation.util.keyboard';\nimport { MediaQuery } from '../foundation.util.mediaQuery';\nimport { Motion, Move } from '../foundation.util.motion';\nimport { Nest } from '../foundation.util.nest';\nimport { Timer } from '../foundation.util.timer';\nimport { Touch } from '../foundation.util.touch';\nimport { Triggers } from '../foundation.util.triggers';\nimport { Abide } from '../foundation.abide';\nimport { Accordion } from '../foundation.accordion';\nimport { AccordionMenu } from '../foundation.accordionMenu';\nimport { Drilldown } from '../foundation.drilldown';\nimport { Dropdown } from '../foundation.dropdown';\nimport { DropdownMenu } from '../foundation.dropdownMenu';\nimport { Equalizer } from '../foundation.equalizer';\nimport { Interchange } from '../foundation.interchange';\nimport { Magellan } from '../foundation.magellan';\nimport { OffCanvas } from '../foundation.offcanvas';\nimport { Orbit } from '../foundation.orbit';\nimport { ResponsiveMenu } from '../foundation.responsiveMenu';\nimport { ResponsiveToggle } from '../foundation.responsiveToggle';\nimport { Reveal } from '../foundation.reveal';\nimport { Slider } from '../foundation.slider';\nimport { SmoothScroll } from '../foundation.smoothScroll';\nimport { Sticky } from '../foundation.sticky';\nimport { Tabs } from '../foundation.tabs';\nimport { Toggler } from '../foundation.toggler';\nimport { Tooltip } from '../foundation.tooltip';\nimport { ResponsiveAccordionTabs } from '../foundation.responsiveAccordionTabs';\n\nFoundation.addToJquery($);\n\n// Add Foundation Utils to Foundation global namespace for backwards\n// compatibility.\nFoundation.rtl = CoreUtils.rtl;\nFoundation.GetYoDigits = CoreUtils.GetYoDigits;\nFoundation.transitionend = CoreUtils.transitionend;\nFoundation.RegExpEscape = CoreUtils.RegExpEscape;\nFoundation.onLoad = CoreUtils.onLoad;\n\nFoundation.Box = Box;\nFoundation.onImagesLoaded = onImagesLoaded;\nFoundation.Keyboard = Keyboard;\nFoundation.MediaQuery = MediaQuery;\nFoundation.Motion = Motion;\nFoundation.Move = Move;\nFoundation.Nest = Nest;\nFoundation.Timer = Timer;\n\n// Touch and Triggers previously were almost purely sede effect driven,\n// so no need to add it to Foundation, just init them.\nTouch.init($);\nTriggers.init($, Foundation);\nMediaQuery._init();\n\nFoundation.plugin(Abide, 'Abide');\nFoundation.plugin(Accordion, 'Accordion');\nFoundation.plugin(AccordionMenu, 'AccordionMenu');\nFoundation.plugin(Drilldown, 'Drilldown');\nFoundation.plugin(Dropdown, 'Dropdown');\nFoundation.plugin(DropdownMenu, 'DropdownMenu');\nFoundation.plugin(Equalizer, 'Equalizer');\nFoundation.plugin(Interchange, 'Interchange');\nFoundation.plugin(Magellan, 'Magellan');\nFoundation.plugin(OffCanvas, 'OffCanvas');\nFoundation.plugin(Orbit, 'Orbit');\nFoundation.plugin(ResponsiveMenu, 'ResponsiveMenu');\nFoundation.plugin(ResponsiveToggle, 'ResponsiveToggle');\nFoundation.plugin(Reveal, 'Reveal');\nFoundation.plugin(Slider, 'Slider');\nFoundation.plugin(SmoothScroll, 'SmoothScroll');\nFoundation.plugin(Sticky, 'Sticky');\nFoundation.plugin(Tabs, 'Tabs');\nFoundation.plugin(Toggler, 'Toggler');\nFoundation.plugin(Tooltip, 'Tooltip');\nFoundation.plugin(ResponsiveAccordionTabs, 'ResponsiveAccordionTabs');\n\nexport {\n Foundation,\n CoreUtils,\n Box,\n onImagesLoaded,\n Keyboard,\n MediaQuery,\n Motion,\n Nest,\n Timer,\n Touch,\n Triggers,\n Abide,\n Accordion,\n AccordionMenu,\n Drilldown,\n Dropdown,\n DropdownMenu,\n Equalizer,\n Interchange,\n Magellan,\n OffCanvas,\n Orbit,\n ResponsiveMenu,\n ResponsiveToggle,\n Reveal,\n Slider,\n SmoothScroll,\n Sticky,\n Tabs,\n Toggler,\n Tooltip,\n ResponsiveAccordionTabs\n}\n\nexport default Foundation;\n\n","'use strict';\n\nimport $ from 'jquery';\nimport { Plugin } from './foundation.core.plugin';\nimport { GetYoDigits } from './foundation.core.utils';\n\n/**\n * Abide module.\n * @module foundation.abide\n */\n\nclass Abide extends Plugin {\n /**\n * Creates a new instance of Abide.\n * @class\n * @name Abide\n * @fires Abide#init\n * @param {Object} element - jQuery object to add the trigger to.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options = {}) {\n this.$element = element;\n this.options = $.extend(true, {}, Abide.defaults, this.$element.data(), options);\n\n this.className = 'Abide'; // ie9 back compat\n this._init();\n }\n\n /**\n * Initializes the Abide plugin and calls functions to get Abide functioning on load.\n * @private\n */\n _init() {\n this.$inputs = $.merge( // Consider as input to validate:\n this.$element.find('input').not('[type=submit]'), // * all input fields expect submit\n this.$element.find('textarea, select') // * all textareas and select fields\n );\n const $globalErrors = this.$element.find('[data-abide-error]');\n\n // Add a11y attributes to all fields\n if (this.options.a11yAttributes) {\n this.$inputs.each((i, input) => this.addA11yAttributes($(input)));\n $globalErrors.each((i, error) => this.addGlobalErrorA11yAttributes($(error)));\n }\n\n this._events();\n }\n\n /**\n * Initializes events for Abide.\n * @private\n */\n _events() {\n this.$element.off('.abide')\n .on('reset.zf.abide', () => {\n this.resetForm();\n })\n .on('submit.zf.abide', () => {\n return this.validateForm();\n });\n\n if (this.options.validateOn === 'fieldChange') {\n this.$inputs\n .off('change.zf.abide')\n .on('change.zf.abide', (e) => {\n this.validateInput($(e.target));\n });\n }\n\n if (this.options.liveValidate) {\n this.$inputs\n .off('input.zf.abide')\n .on('input.zf.abide', (e) => {\n this.validateInput($(e.target));\n });\n }\n\n if (this.options.validateOnBlur) {\n this.$inputs\n .off('blur.zf.abide')\n .on('blur.zf.abide', (e) => {\n this.validateInput($(e.target));\n });\n }\n }\n\n /**\n * Calls necessary functions to update Abide upon DOM change\n * @private\n */\n _reflow() {\n this._init();\n }\n\n /**\n * Checks whether or not a form element has the required attribute and if it's checked or not\n * @param {Object} element - jQuery object to check for required attribute\n * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty\n */\n requiredCheck($el) {\n if (!$el.attr('required')) return true;\n\n var isGood = true;\n\n switch ($el[0].type) {\n case 'checkbox':\n isGood = $el[0].checked;\n break;\n\n case 'select':\n case 'select-one':\n case 'select-multiple':\n var opt = $el.find('option:selected');\n if (!opt.length || !opt.val()) isGood = false;\n break;\n\n default:\n if(!$el.val() || !$el.val().length) isGood = false;\n }\n\n return isGood;\n }\n\n /**\n * Get:\n * - Based on $el, the first element(s) corresponding to `formErrorSelector` in this order:\n * 1. The element's direct sibling('s).\n * 2. The element's parent's children.\n * - Element(s) with the attribute `[data-form-error-for]` set with the element's id.\n *\n * This allows for multiple form errors per input, though if none are found, no form errors will be shown.\n *\n * @param {Object} $el - jQuery object to use as reference to find the form error selector.\n * @returns {Object} jQuery object with the selector.\n */\n findFormError($el) {\n var id = $el[0].id;\n var $error = $el.siblings(this.options.formErrorSelector);\n\n if (!$error.length) {\n $error = $el.parent().find(this.options.formErrorSelector);\n }\n\n if (id) {\n $error = $error.add(this.$element.find(`[data-form-error-for=\"${id}\"]`));\n }\n\n return $error;\n }\n\n /**\n * Get the first element in this order:\n * 2. The <label> with the attribute `[for=\"someInputId\"]`\n * 3. The `.closest()` <label>\n *\n * @param {Object} $el - jQuery object to check for required attribute\n * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty\n */\n findLabel($el) {\n var id = $el[0].id;\n var $label = this.$element.find(`label[for=\"${id}\"]`);\n\n if (!$label.length) {\n return $el.closest('label');\n }\n\n return $label;\n }\n\n /**\n * Get the set of labels associated with a set of radio els in this order\n * 2. The <label> with the attribute `[for=\"someInputId\"]`\n * 3. The `.closest()` <label>\n *\n * @param {Object} $el - jQuery object to check for required attribute\n * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty\n */\n findRadioLabels($els) {\n var labels = $els.map((i, el) => {\n var id = el.id;\n var $label = this.$element.find(`label[for=\"${id}\"]`);\n\n if (!$label.length) {\n $label = $(el).closest('label');\n }\n return $label[0];\n });\n\n return $(labels);\n }\n\n /**\n * Adds the CSS error class as specified by the Abide settings to the label, input, and the form\n * @param {Object} $el - jQuery object to add the class to\n */\n addErrorClasses($el) {\n var $label = this.findLabel($el);\n var $formError = this.findFormError($el);\n\n if ($label.length) {\n $label.addClass(this.options.labelErrorClass);\n }\n\n if ($formError.length) {\n $formError.addClass(this.options.formErrorClass);\n }\n\n $el.addClass(this.options.inputErrorClass).attr({\n 'data-invalid': '',\n 'aria-invalid': true\n });\n }\n\n /**\n * Adds [for] and [role=alert] attributes to all form error targetting $el,\n * and [aria-describedby] attribute to $el toward the first form error.\n * @param {Object} $el - jQuery object\n */\n addA11yAttributes($el) {\n let $errors = this.findFormError($el);\n let $labels = $errors.filter('label');\n let $error = $errors.first();\n if (!$errors.length) return;\n\n // Set [aria-describedby] on the input toward the first form error if it is not set\n if (typeof $el.attr('aria-describedby') === 'undefined') {\n // Get the first error ID or create one\n let errorId = $error.attr('id');\n if (typeof errorId === 'undefined') {\n errorId = GetYoDigits(6, 'abide-error');\n $error.attr('id', errorId);\n };\n\n $el.attr('aria-describedby', errorId);\n }\n\n if ($labels.filter('[for]').length < $labels.length) {\n // Get the input ID or create one\n let elemId = $el.attr('id');\n if (typeof elemId === 'undefined') {\n elemId = GetYoDigits(6, 'abide-input');\n $el.attr('id', elemId);\n };\n\n // For each label targeting $el, set [for] if it is not set.\n $labels.each((i, label) => {\n const $label = $(label);\n if (typeof $label.attr('for') === 'undefined')\n $label.attr('for', elemId);\n });\n }\n\n // For each error targeting $el, set [role=alert] if it is not set.\n $errors.each((i, label) => {\n const $label = $(label);\n if (typeof $label.attr('role') === 'undefined')\n $label.attr('role', 'alert');\n }).end();\n }\n\n /**\n * Adds [aria-live] attribute to the given global form error $el.\n * @param {Object} $el - jQuery object to add the attribute to\n */\n addGlobalErrorA11yAttributes($el) {\n if (typeof $el.attr('aria-live') === 'undefined')\n $el.attr('aria-live', this.options.a11yErrorLevel);\n }\n\n /**\n * Remove CSS error classes etc from an entire radio button group\n * @param {String} groupName - A string that specifies the name of a radio button group\n *\n */\n removeRadioErrorClasses(groupName) {\n var $els = this.$element.find(`:radio[name=\"${groupName}\"]`);\n var $labels = this.findRadioLabels($els);\n var $formErrors = this.findFormError($els);\n\n if ($labels.length) {\n $labels.removeClass(this.options.labelErrorClass);\n }\n\n if ($formErrors.length) {\n $formErrors.removeClass(this.options.formErrorClass);\n }\n\n $els.removeClass(this.options.inputErrorClass).attr({\n 'data-invalid': null,\n 'aria-invalid': null\n });\n\n }\n\n /**\n * Removes CSS error class as specified by the Abide settings from the label, input, and the form\n * @param {Object} $el - jQuery object to remove the class from\n */\n removeErrorClasses($el) {\n // radios need to clear all of the els\n if($el[0].type == 'radio') {\n return this.removeRadioErrorClasses($el.attr('name'));\n }\n\n var $label = this.findLabel($el);\n var $formError = this.findFormError($el);\n\n if ($label.length) {\n $label.removeClass(this.options.labelErrorClass);\n }\n\n if ($formError.length) {\n $formError.removeClass(this.options.formErrorClass);\n }\n\n $el.removeClass(this.options.inputErrorClass).attr({\n 'data-invalid': null,\n 'aria-invalid': null\n });\n }\n\n /**\n * Goes through a form to find inputs and proceeds to validate them in ways specific to their type.\n * Ignores inputs with data-abide-ignore, type=\"hidden\" or disabled attributes set\n * @fires Abide#invalid\n * @fires Abide#valid\n * @param {Object} element - jQuery object to validate, should be an HTML input\n * @returns {Boolean} goodToGo - If the input is valid or not.\n */\n validateInput($el) {\n var clearRequire = this.requiredCheck($el),\n validated = false,\n customValidator = true,\n validator = $el.attr('data-validator'),\n equalTo = true;\n\n // don't validate ignored inputs or hidden inputs or disabled inputs\n if ($el.is('[data-abide-ignore]') || $el.is('[type=\"hidden\"]') || $el.is('[disabled]')) {\n return true;\n }\n\n switch ($el[0].type) {\n case 'radio':\n validated = this.validateRadio($el.attr('name'));\n break;\n\n case 'checkbox':\n validated = clearRequire;\n break;\n\n case 'select':\n case 'select-one':\n case 'select-multiple':\n validated = clearRequire;\n break;\n\n default:\n validated = this.validateText($el);\n }\n\n if (validator) {\n customValidator = this.matchValidation($el, validator, $el.attr('required'));\n }\n\n if ($el.attr('data-equalto')) {\n equalTo = this.options.validators.equalTo($el);\n }\n\n\n var goodToGo = [clearRequire, validated, customValidator, equalTo].indexOf(false) === -1;\n var message = (goodToGo ? 'valid' : 'invalid') + '.zf.abide';\n\n if (goodToGo) {\n // Re-validate inputs that depend on this one with equalto\n const dependentElements = this.$element.find(`[data-equalto=\"${$el.attr('id')}\"]`);\n if (dependentElements.length) {\n let _this = this;\n dependentElements.each(function() {\n if ($(this).val()) {\n _this.validateInput($(this));\n }\n });\n }\n }\n\n this[goodToGo ? 'removeErrorClasses' : 'addErrorClasses']($el);\n\n /**\n * Fires when the input is done checking for validation. Event trigger is either `valid.zf.abide` or `invalid.zf.abide`\n * Trigger includes the DOM element of the input.\n * @event Abide#valid\n * @event Abide#invalid\n */\n $el.trigger(message, [$el]);\n\n return goodToGo;\n }\n\n /**\n * Goes through a form and if there are any invalid inputs, it will display the form error element\n * @returns {Boolean} noError - true if no errors were detected...\n * @fires Abide#formvalid\n * @fires Abide#forminvalid\n */\n validateForm() {\n var acc = [];\n var _this = this;\n\n this.$inputs.each(function() {\n acc.push(_this.validateInput($(this)));\n });\n\n var noError = acc.indexOf(false) === -1;\n\n this.$element.find('[data-abide-error]').each((i, elem) => {\n const $elem = $(elem);\n // Ensure a11y attributes are set\n if (this.options.a11yAttributes) this.addGlobalErrorA11yAttributes($elem);\n // Show or hide the error\n $elem.css('display', (noError ? 'none' : 'block'));\n });\n\n /**\n * Fires when the form is finished validating. Event trigger is either `formvalid.zf.abide` or `forminvalid.zf.abide`.\n * Trigger includes the element of the form.\n * @event Abide#formvalid\n * @event Abide#forminvalid\n */\n this.$element.trigger((noError ? 'formvalid' : 'forminvalid') + '.zf.abide', [this.$element]);\n\n return noError;\n }\n\n /**\n * 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.\n * @param {Object} $el - jQuery object to validate, should be a text input HTML element\n * @param {String} pattern - string value of one of the RegEx patterns in Abide.options.patterns\n * @returns {Boolean} Boolean value depends on whether or not the input value matches the pattern specified\n */\n validateText($el, pattern) {\n // A pattern can be passed to this function, or it will be infered from the input's \"pattern\" attribute, or it's \"type\" attribute\n pattern = (pattern || $el.attr('pattern') || $el.attr('type'));\n var inputText = $el.val();\n var valid = false;\n\n if (inputText.length) {\n // If the pattern attribute on the element is in Abide's list of patterns, then test that regexp\n if (this.options.patterns.hasOwnProperty(pattern)) {\n valid = this.options.patterns[pattern].test(inputText);\n }\n // If the pattern name isn't also the type attribute of the field, then test it as a regexp\n else if (pattern !== $el.attr('type')) {\n valid = new RegExp(pattern).test(inputText);\n }\n else {\n valid = true;\n }\n }\n // An empty field is valid if it's not required\n else if (!$el.prop('required')) {\n valid = true;\n }\n\n return valid;\n }\n\n /**\n * 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.\n * @param {String} groupName - A string that specifies the name of a radio button group\n * @returns {Boolean} Boolean value depends on whether or not at least one radio input has been selected (if it's required)\n */\n validateRadio(groupName) {\n // If at least one radio in the group has the `required` attribute, the group is considered required\n // Per W3C spec, all radio buttons in a group should have `required`, but we're being nice\n var $group = this.$element.find(`:radio[name=\"${groupName}\"]`);\n var valid = false, required = false;\n\n // For the group to be required, at least one radio needs to be required\n $group.each((i, e) => {\n if ($(e).attr('required')) {\n required = true;\n }\n });\n if(!required) valid=true;\n\n if (!valid) {\n // For the group to be valid, at least one radio needs to be checked\n $group.each((i, e) => {\n if ($(e).prop('checked')) {\n valid = true;\n }\n });\n };\n\n return valid;\n }\n\n /**\n * 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.\n * @param {Object} $el - jQuery input element.\n * @param {String} validators - a string of function names matching functions in the Abide.options.validators object.\n * @param {Boolean} required - self explanatory?\n * @returns {Boolean} - true if validations passed.\n */\n matchValidation($el, validators, required) {\n required = required ? true : false;\n\n var clear = validators.split(' ').map((v) => {\n return this.options.validators[v]($el, required, $el.parent());\n });\n return clear.indexOf(false) === -1;\n }\n\n /**\n * Resets form inputs and styles\n * @fires Abide#formreset\n */\n resetForm() {\n var $form = this.$element,\n opts = this.options;\n\n $(`.${opts.labelErrorClass}`, $form).not('small').removeClass(opts.labelErrorClass);\n $(`.${opts.inputErrorClass}`, $form).not('small').removeClass(opts.inputErrorClass);\n $(`${opts.formErrorSelector}.${opts.formErrorClass}`).removeClass(opts.formErrorClass);\n $form.find('[data-abide-error]').css('display', 'none');\n $(':input', $form).not(':button, :submit, :reset, :hidden, :radio, :checkbox, [data-abide-ignore]').val('').attr({\n 'data-invalid': null,\n 'aria-invalid': null\n });\n $(':input:radio', $form).not('[data-abide-ignore]').prop('checked',false).attr({\n 'data-invalid': null,\n 'aria-invalid': null\n });\n $(':input:checkbox', $form).not('[data-abide-ignore]').prop('checked',false).attr({\n 'data-invalid': null,\n 'aria-invalid': null\n });\n /**\n * Fires when the form has been reset.\n * @event Abide#formreset\n */\n $form.trigger('formreset.zf.abide', [$form]);\n }\n\n /**\n * Destroys an instance of Abide.\n * Removes error styles and classes from elements, without resetting their values.\n */\n _destroy() {\n var _this = this;\n this.$element\n .off('.abide')\n .find('[data-abide-error]')\n .css('display', 'none');\n\n this.$inputs\n .off('.abide')\n .each(function() {\n _this.removeErrorClasses($(this));\n });\n }\n}\n\n/**\n * Default settings for plugin\n */\nAbide.defaults = {\n /**\n * The default event to validate inputs. Checkboxes and radios validate immediately.\n * Remove or change this value for manual validation.\n * @option\n * @type {?string}\n * @default 'fieldChange'\n */\n validateOn: 'fieldChange',\n\n /**\n * Class to be applied to input labels on failed validation.\n * @option\n * @type {string}\n * @default 'is-invalid-label'\n */\n labelErrorClass: 'is-invalid-label',\n\n /**\n * Class to be applied to inputs on failed validation.\n * @option\n * @type {string}\n * @default 'is-invalid-input'\n */\n inputErrorClass: 'is-invalid-input',\n\n /**\n * Class selector to use to target Form Errors for show/hide.\n * @option\n * @type {string}\n * @default '.form-error'\n */\n formErrorSelector: '.form-error',\n\n /**\n * Class added to Form Errors on failed validation.\n * @option\n * @type {string}\n * @default 'is-visible'\n */\n formErrorClass: 'is-visible',\n\n /**\n * If true, automatically insert when possible:\n * - `[aria-describedby]` on fields\n * - `[role=alert]` on form errors and `[for]` on form error labels\n * - `[aria-live]` on global errors `[data-abide-error]` (see option `a11yErrorLevel`).\n * @option\n * @type {boolean}\n * @default true\n */\n a11yAttributes: true,\n\n /**\n * [aria-live] attribute value to be applied on global errors `[data-abide-error]`.\n * Options are: 'assertive', 'polite' and 'off'/null\n * @option\n * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions\n * @type {string}\n * @default 'assertive'\n */\n a11yErrorLevel: 'assertive',\n\n /**\n * Set to true to validate text inputs on any value change.\n * @option\n * @type {boolean}\n * @default false\n */\n liveValidate: false,\n\n /**\n * Set to true to validate inputs on blur.\n * @option\n * @type {boolean}\n * @default false\n */\n validateOnBlur: false,\n\n patterns: {\n alpha : /^[a-zA-Z]+$/,\n alpha_numeric : /^[a-zA-Z0-9]+$/,\n integer : /^[-+]?\\d+$/,\n number : /^[-+]?\\d*(?:[\\.\\,]\\d+)?$/,\n\n // amex, visa, diners\n 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})$/,\n cvv : /^([0-9]){3,4}$/,\n\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address\n 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])?)+$/,\n\n // From CommonRegexJS (@talyssonoc)\n // https://github.com/talyssonoc/CommonRegexJS/blob/e2901b9f57222bc14069dc8f0598d5f412555411/lib/commonregex.js#L76\n // For more restrictive URL Regexs, see https://mathiasbynens.be/demo/url-regex.\n 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]))$/,\n\n // abc.de\n domain : /^([a-zA-Z0-9]([a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,8}$/,\n\n 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))$/,\n // YYYY-MM-DD\n 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))$/,\n // HH:MM:SS\n time : /^(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]){2}$/,\n dateISO : /^\\d{4}[\\/\\-]\\d{1,2}[\\/\\-]\\d{1,2}$/,\n // MM/DD/YYYY\n month_day_year : /^(0[1-9]|1[012])[- \\/.](0[1-9]|[12][0-9]|3[01])[- \\/.]\\d{4}$/,\n // DD/MM/YYYY\n day_month_year : /^(0[1-9]|[12][0-9]|3[01])[- \\/.](0[1-9]|1[012])[- \\/.]\\d{4}$/,\n\n // #FFF or #FFFFFF\n color : /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/,\n\n // Domain || URL\n website: {\n test: (text) => {\n return Abide.defaults.patterns['domain'].test(text) || Abide.defaults.patterns['url'].test(text);\n }\n }\n },\n\n /**\n * Optional validation functions to be used. `equalTo` being the only default included function.\n * Functions should return only a boolean if the input is valid or not. Functions are given the following arguments:\n * el : The jQuery element to validate.\n * required : Boolean value of the required attribute be present or not.\n * parent : The direct parent of the input.\n * @option\n */\n validators: {\n equalTo: function (el, required, parent) {\n return $(`#${el.attr('data-equalto')}`).val() === el.val();\n }\n }\n}\n\nexport {Abide};\n","'use strict';\n\nimport $ from 'jquery';\nimport { onLoad, GetYoDigits } from './foundation.core.utils';\nimport { Keyboard } from './foundation.util.keyboard';\nimport { Plugin } from './foundation.core.plugin';\n\n/**\n * Accordion module.\n * @module foundation.accordion\n * @requires foundation.util.keyboard\n */\n\nclass Accordion extends Plugin {\n /**\n * Creates a new instance of an accordion.\n * @class\n * @name Accordion\n * @fires Accordion#init\n * @param {jQuery} element - jQuery object to make into an accordion.\n * @param {Object} options - a plain object with settings to override the default options.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, Accordion.defaults, this.$element.data(), options);\n\n this.className = 'Accordion'; // ie9 back compat\n this._init();\n\n Keyboard.register('Accordion', {\n 'ENTER': 'toggle',\n 'SPACE': 'toggle',\n 'ARROW_DOWN': 'next',\n 'ARROW_UP': 'previous'\n });\n }\n\n /**\n * Initializes the accordion by animating the preset active pane(s).\n * @private\n */\n _init() {\n this._isInitializing = true;\n\n this.$element.attr('role', 'tablist');\n this.$tabs = this.$element.children('[data-accordion-item]');\n\n this.$tabs.each(function(idx, el) {\n var $el = $(el),\n $content = $el.children('[data-tab-content]'),\n id = $content[0].id || GetYoDigits(6, 'accordion'),\n linkId = (el.id) ? `${el.id}-label` : `${id}-label`;\n\n $el.find('a:first').attr({\n 'aria-controls': id,\n 'role': 'tab',\n 'id': linkId,\n 'aria-expanded': false,\n 'aria-selected': false\n });\n\n $content.attr({'role': 'tabpanel', 'aria-labelledby': linkId, 'aria-hidden': true, 'id': id});\n });\n\n var $initActive = this.$element.find('.is-active').children('[data-tab-content]');\n if ($initActive.length) {\n // Save up the initial hash to return to it later when going back in history\n this._initialAnchor = $initActive.prev('a').attr('href');\n this._openSingleTab($initActive);\n }\n\n this._checkDeepLink = () => {\n var anchor = window.location.hash;\n\n if (!anchor.length) {\n // If we are still initializing and there is no anchor, then there is nothing to do\n if (this._isInitializing) return;\n // Otherwise, move to the initial anchor\n if (this._initialAnchor) anchor = this._initialAnchor;\n }\n\n var $anchor = anchor && $(anchor);\n var $link = anchor && this.$element.find(`[href$=\"${anchor}\"]`);\n // Whether the anchor element that has been found is part of this element\n var isOwnAnchor = !!($anchor.length && $link.length);\n\n // If there is an anchor for the hash, open it (if not already active)\n if ($anchor && $link && $link.length) {\n if (!$link.parent('[data-accordion-item]').hasClass('is-active')) {\n this._openSingleTab($anchor);\n };\n }\n // Otherwise, close everything\n else {\n this._closeAllTabs();\n }\n\n if (isOwnAnchor) {\n // Roll up a little to show the titles\n if (this.options.deepLinkSmudge) {\n onLoad($(window), () => {\n var offset = this.$element.offset();\n $('html, body').animate({ scrollTop: offset.top }, this.options.deepLinkSmudgeDelay);\n });\n }\n\n /**\n * Fires when the plugin has deeplinked at pageload\n * @event Accordion#deeplink\n */\n this.$element.trigger('deeplink.zf.accordion', [$link, $anchor]);\n }\n }\n\n //use browser to open a tab, if it exists in this tabset\n if (this.options.deepLink) {\n this._checkDeepLink();\n }\n\n this._events();\n\n this._isInitializing = false;\n }\n\n /**\n * Adds event handlers for items within the accordion.\n * @private\n */\n _events() {\n var _this = this;\n\n this.$tabs.each(function() {\n var $elem = $(this);\n var $tabContent = $elem.children('[data-tab-content]');\n if ($tabContent.length) {\n $elem.children('a').off('click.zf.accordion keydown.zf.accordion')\n .on('click.zf.accordion', function(e) {\n e.preventDefault();\n _this.toggle($tabContent);\n }).on('keydown.zf.accordion', function(e){\n Keyboard.handleKey(e, 'Accordion', {\n toggle: function() {\n _this.toggle($tabContent);\n },\n next: function() {\n var $a = $elem.next().find('a').focus();\n if (!_this.options.multiExpand) {\n $a.trigger('click.zf.accordion')\n }\n },\n previous: function() {\n var $a = $elem.prev().find('a').focus();\n if (!_this.options.multiExpand) {\n $a.trigger('click.zf.accordion')\n }\n },\n handled: function() {\n e.preventDefault();\n e.stopPropagation();\n }\n });\n });\n }\n });\n if(this.options.deepLink) {\n $(window).on('hashchange', this._checkDeepLink);\n }\n }\n\n /**\n * Toggles the selected content pane's open/close state.\n * @param {jQuery} $target - jQuery object of the pane to toggle (`.accordion-content`).\n * @function\n */\n toggle($target) {\n if ($target.closest('[data-accordion]').is('[disabled]')) {\n console.info('Cannot toggle an accordion that is disabled.');\n return;\n }\n if($target.parent().hasClass('is-active')) {\n this.up($target);\n } else {\n this.down($target);\n }\n //either replace or update browser history\n if (this.options.deepLink) {\n var anchor = $target.prev('a').attr('href');\n\n if (this.options.updateHistory) {\n history.pushState({}, '', anchor);\n } else {\n history.replaceState({}, '', anchor);\n }\n }\n }\n\n /**\n * Opens the accordion tab defined by `$target`.\n * @param {jQuery} $target - Accordion pane to open (`.accordion-content`).\n * @fires Accordion#down\n * @function\n */\n down($target) {\n if ($target.closest('[data-accordion]').is('[disabled]')) {\n console.info('Cannot call down on an accordion that is disabled.');\n return;\n }\n\n if (this.options.multiExpand)\n this._openTab($target);\n else\n this._openSingleTab($target);\n }\n\n /**\n * Closes the tab defined by `$target`.\n * It may be ignored if the Accordion options don't allow it.\n *\n * @param {jQuery} $target - Accordion tab to close (`.accordion-content`).\n * @fires Accordion#up\n * @function\n */\n up($target) {\n if (this.$element.is('[disabled]')) {\n console.info('Cannot call up on an accordion that is disabled.');\n return;\n }\n\n // Don't close the item if it is already closed\n const $targetItem = $target.parent();\n if (!$targetItem.hasClass('is-active')) return;\n\n // Don't close the item if there is no other active item (unless with `allowAllClosed`)\n const $othersItems = $targetItem.siblings();\n if (!this.options.allowAllClosed && !$othersItems.hasClass('is-active')) return;\n\n this._closeTab($target);\n }\n\n /**\n * Make the tab defined by `$target` the only opened tab, closing all others tabs.\n * @param {jQuery} $target - Accordion tab to open (`.accordion-content`).\n * @function\n * @private\n */\n _openSingleTab($target) {\n // Close all the others active tabs.\n const $activeContents = this.$element.children('.is-active').children('[data-tab-content]');\n if ($activeContents.length) {\n this._closeTab($activeContents.not($target));\n }\n\n // Then open the target.\n this._openTab($target);\n }\n\n /**\n * Opens the tab defined by `$target`.\n * @param {jQuery} $target - Accordion tab to open (`.accordion-content`).\n * @fires Accordion#down\n * @function\n * @private\n */\n _openTab($target) {\n const $targetItem = $target.parent();\n const targetContentId = $target.attr('aria-labelledby');\n\n $target.attr('aria-hidden', false);\n $targetItem.addClass('is-active');\n\n $(`#${targetContentId}`).attr({\n 'aria-expanded': true,\n 'aria-selected': true\n });\n\n $target.slideDown(this.options.slideSpeed, () => {\n /**\n * Fires when the tab is done opening.\n * @event Accordion#down\n */\n this.$element.trigger('down.zf.accordion', [$target]);\n });\n }\n\n /**\n * Closes the tab defined by `$target`.\n * @param {jQuery} $target - Accordion tab to close (`.accordion-content`).\n * @fires Accordion#up\n * @function\n * @private\n */\n _closeTab($target) {\n const $targetItem = $target.parent();\n const targetContentId = $target.attr('aria-labelledby');\n\n $target.attr('aria-hidden', true)\n $targetItem.removeClass('is-active');\n\n $(`#${targetContentId}`).attr({\n 'aria-expanded': false,\n 'aria-selected': false\n });\n\n $target.slideUp(this.options.slideSpeed, () => {\n /**\n * Fires when the tab is done collapsing up.\n * @event Accordion#up\n */\n this.$element.trigger('up.zf.accordion', [$target]);\n });\n }\n\n /**\n * Closes all active tabs\n * @fires Accordion#up\n * @function\n * @private\n */\n _closeAllTabs() {\n var $activeTabs = this.$element.children('.is-active').children('[data-tab-content]');\n if ($activeTabs.length) {\n this._closeTab($activeTabs);\n }\n }\n\n /**\n * Destroys an instance of an accordion.\n * @fires Accordion#destroyed\n * @function\n */\n _destroy() {\n this.$element.find('[data-tab-content]').stop(true).slideUp(0).css('display', '');\n this.$element.find('a').off('.zf.accordion');\n if(this.options.deepLink) {\n $(window).off('hashchange', this._checkDeepLink);\n }\n\n }\n}\n\nAccordion.defaults = {\n /**\n * Amount of time to animate the opening of an accordion pane.\n * @option\n * @type {number}\n * @default 250\n */\n slideSpeed: 250,\n /**\n * Allow the accordion to have multiple open panes.\n * @option\n * @type {boolean}\n * @default false\n */\n multiExpand: false,\n /**\n * Allow the accordion to close all panes.\n * @option\n * @type {boolean}\n * @default false\n */\n allowAllClosed: false,\n /**\n * Link the location hash to the open pane.\n * Set the location hash when the opened pane changes, and open and scroll to the corresponding pane when the location changes.\n * @option\n * @type {boolean}\n * @default false\n */\n deepLink: false,\n /**\n * If `deepLink` is enabled, adjust the deep link scroll to make sure the top of the accordion panel is visible\n * @option\n * @type {boolean}\n * @default false\n */\n deepLinkSmudge: false,\n /**\n * If `deepLinkSmudge` is enabled, animation time (ms) for the deep link adjustment\n * @option\n * @type {number}\n * @default 300\n */\n deepLinkSmudgeDelay: 300,\n /**\n * If `deepLink` is enabled, update the browser history with the open accordion\n * @option\n * @type {boolean}\n * @default false\n */\n updateHistory: false\n};\n\nexport {Accordion};\n","'use strict';\n\n\nimport $ from 'jquery';\nimport { Keyboard } from './foundation.util.keyboard';\nimport { Nest } from './foundation.util.nest';\nimport { GetYoDigits } from './foundation.core.utils';\nimport { Plugin } from './foundation.core.plugin';\n\n/**\n * AccordionMenu module.\n * @module foundation.accordionMenu\n * @requires foundation.util.keyboard\n * @requires foundation.util.nest\n */\n\nclass AccordionMenu extends Plugin {\n /**\n * Creates a new instance of an accordion menu.\n * @class\n * @name AccordionMenu\n * @fires AccordionMenu#init\n * @param {jQuery} element - jQuery object to make into an accordion menu.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, AccordionMenu.defaults, this.$element.data(), options);\n this.className = 'AccordionMenu'; // ie9 back compat\n\n this._init();\n\n Keyboard.register('AccordionMenu', {\n 'ENTER': 'toggle',\n 'SPACE': 'toggle',\n 'ARROW_RIGHT': 'open',\n 'ARROW_UP': 'up',\n 'ARROW_DOWN': 'down',\n 'ARROW_LEFT': 'close',\n 'ESCAPE': 'closeAll'\n });\n }\n\n\n\n /**\n * Initializes the accordion menu by hiding all nested menus.\n * @private\n */\n _init() {\n Nest.Feather(this.$element, 'accordion');\n\n var _this = this;\n\n this.$element.find('[data-submenu]').not('.is-active').slideUp(0);//.find('a').css('padding-left', '1rem');\n this.$element.attr({\n 'role': 'tree',\n 'aria-multiselectable': this.options.multiOpen\n });\n\n this.$menuLinks = this.$element.find('.is-accordion-submenu-parent');\n this.$menuLinks.each(function(){\n var linkId = this.id || GetYoDigits(6, 'acc-menu-link'),\n $elem = $(this),\n $sub = $elem.children('[data-submenu]'),\n subId = $sub[0].id || GetYoDigits(6, 'acc-menu'),\n isActive = $sub.hasClass('is-active');\n\n if(_this.options.parentLink) {\n let $anchor = $elem.children('a');\n $anchor.clone().prependTo($sub).wrap('<li data-is-parent-link class=\"is-submenu-parent-item is-submenu-item is-accordion-submenu-item\"></li>');\n }\n\n if(_this.options.submenuToggle) {\n $elem.addClass('has-submenu-toggle');\n $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>');\n } else {\n $elem.attr({\n 'aria-controls': subId,\n 'aria-expanded': isActive,\n 'id': linkId\n });\n }\n $sub.attr({\n 'aria-labelledby': linkId,\n 'aria-hidden': !isActive,\n 'role': 'group',\n 'id': subId\n });\n });\n this.$element.find('li').attr({\n 'role': 'treeitem'\n });\n var initPanes = this.$element.find('.is-active');\n if(initPanes.length){\n var _this = this;\n initPanes.each(function(){\n _this.down($(this));\n });\n }\n this._events();\n }\n\n /**\n * Adds event handlers for items within the menu.\n * @private\n */\n _events() {\n var _this = this;\n\n this.$element.find('li').each(function() {\n var $submenu = $(this).children('[data-submenu]');\n\n if ($submenu.length) {\n if(_this.options.submenuToggle) {\n $(this).children('.submenu-toggle').off('click.zf.accordionMenu').on('click.zf.accordionMenu', function(e) {\n _this.toggle($submenu);\n });\n } else {\n $(this).children('a').off('click.zf.accordionMenu').on('click.zf.accordionMenu', function(e) {\n e.preventDefault();\n _this.toggle($submenu);\n });\n }\n }\n }).on('keydown.zf.accordionmenu', function(e){\n var $element = $(this),\n $elements = $element.parent('ul').children('li'),\n $prevElement,\n $nextElement,\n $target = $element.children('[data-submenu]');\n\n $elements.each(function(i) {\n if ($(this).is($element)) {\n $prevElement = $elements.eq(Math.max(0, i-1)).find('a').first();\n $nextElement = $elements.eq(Math.min(i+1, $elements.length-1)).find('a').first();\n\n if ($(this).children('[data-submenu]:visible').length) { // has open sub menu\n $nextElement = $element.find('li:first-child').find('a').first();\n }\n if ($(this).is(':first-child')) { // is first element of sub menu\n $prevElement = $element.parents('li').first().find('a').first();\n } else if ($prevElement.parents('li').first().children('[data-submenu]:visible').length) { // if previous element has open sub menu\n $prevElement = $prevElement.parents('li').find('li:last-child').find('a').first();\n }\n if ($(this).is(':last-child')) { // is last element of sub menu\n $nextElement = $element.parents('li').first().next('li').find('a').first();\n }\n\n return;\n }\n });\n\n Keyboard.handleKey(e, 'AccordionMenu', {\n open: function() {\n if ($target.is(':hidden')) {\n _this.down($target);\n $target.find('li').first().find('a').first().focus();\n }\n },\n close: function() {\n if ($target.length && !$target.is(':hidden')) { // close active sub of this item\n _this.up($target);\n } else if ($element.parent('[data-submenu]').length) { // close currently open sub\n _this.up($element.parent('[data-submenu]'));\n $element.parents('li').first().find('a').first().focus();\n }\n },\n up: function() {\n $prevElement.focus();\n return true;\n },\n down: function() {\n $nextElement.focus();\n return true;\n },\n toggle: function() {\n if (_this.options.submenuToggle) {\n return false;\n }\n if ($element.children('[data-submenu]').length) {\n _this.toggle($element.children('[data-submenu]'));\n return true;\n }\n },\n closeAll: function() {\n _this.hideAll();\n },\n handled: function(preventDefault) {\n if (preventDefault) {\n e.preventDefault();\n }\n e.stopImmediatePropagation();\n }\n });\n });//.attr('tabindex', 0);\n }\n\n /**\n * Closes all panes of the menu.\n * @function\n */\n hideAll() {\n this.up(this.$element.find('[data-submenu]'));\n }\n\n /**\n * Opens all panes of the menu.\n * @function\n */\n showAll() {\n this.down(this.$element.find('[data-submenu]'));\n }\n\n /**\n * Toggles the open/close state of a submenu.\n * @function\n * @param {jQuery} $target - the submenu to toggle\n */\n toggle($target){\n if(!$target.is(':animated')) {\n if (!$target.is(':hidden')) {\n this.up($target);\n }\n else {\n this.down($target);\n }\n }\n }\n\n /**\n * Opens the sub-menu defined by `$target`.\n * @param {jQuery} $target - Sub-menu to open.\n * @fires AccordionMenu#down\n */\n down($target) {\n if(!this.options.multiOpen) {\n this.up(this.$element.find('.is-active').not($target.parentsUntil(this.$element).add($target)));\n }\n\n $target\n .addClass('is-active')\n .attr({ 'aria-hidden': false });\n\n if(this.options.submenuToggle) {\n $target.prev('.submenu-toggle').attr({'aria-expanded': true});\n }\n else {\n $target.parent('.is-accordion-submenu-parent').attr({'aria-expanded': true});\n }\n\n $target.slideDown(this.options.slideSpeed, () => {\n /**\n * Fires when the menu is done opening.\n * @event AccordionMenu#down\n */\n this.$element.trigger('down.zf.accordionMenu', [$target]);\n });\n }\n\n /**\n * Closes the sub-menu defined by `$target`. All sub-menus inside the target will be closed as well.\n * @param {jQuery} $target - Sub-menu to close.\n * @fires AccordionMenu#up\n */\n up($target) {\n const $submenus = $target.find('[data-submenu]');\n const $allmenus = $target.add($submenus);\n\n $submenus.slideUp(0);\n $allmenus\n .removeClass('is-active')\n .attr('aria-hidden', true);\n\n if(this.options.submenuToggle) {\n $allmenus.prev('.submenu-toggle').attr('aria-expanded', false);\n }\n else {\n $allmenus.parent('.is-accordion-submenu-parent').attr('aria-expanded', false);\n }\n\n $target.slideUp(this.options.slideSpeed, () => {\n /**\n * Fires when the menu is done collapsing up.\n * @event AccordionMenu#up\n */\n this.$element.trigger('up.zf.accordionMenu', [$target]);\n });\n }\n\n /**\n * Destroys an instance of accordion menu.\n * @fires AccordionMenu#destroyed\n */\n _destroy() {\n this.$element.find('[data-submenu]').slideDown(0).css('display', '');\n this.$element.find('a').off('click.zf.accordionMenu');\n this.$element.find('[data-is-parent-link]').detach();\n\n if(this.options.submenuToggle) {\n this.$element.find('.has-submenu-toggle').removeClass('has-submenu-toggle');\n this.$element.find('.submenu-toggle').remove();\n }\n\n Nest.Burn(this.$element, 'accordion');\n }\n}\n\nAccordionMenu.defaults = {\n /**\n * Adds the parent link to the submenu.\n * @option\n * @type {boolean}\n * @default false\n */\n parentLink: false,\n /**\n * Amount of time to animate the opening of a submenu in ms.\n * @option\n * @type {number}\n * @default 250\n */\n slideSpeed: 250,\n /**\n * Adds a separate submenu toggle button. This allows the parent item to have a link.\n * @option\n * @example true\n */\n submenuToggle: false,\n /**\n * The text used for the submenu toggle if enabled. This is used for screen readers only.\n * @option\n * @example true\n */\n submenuToggleText: 'Toggle menu',\n /**\n * Allow the menu to have multiple open panes.\n * @option\n * @type {boolean}\n * @default true\n */\n multiOpen: true\n};\n\nexport {AccordionMenu};\n","\"use strict\";\n\nimport $ from 'jquery';\nimport { GetYoDigits } from './foundation.core.utils';\nimport { MediaQuery } from './foundation.util.mediaQuery';\n\nvar FOUNDATION_VERSION = '6.5.1';\n\n// Global Foundation object\n// This is attached to the window, or used as a module for AMD/Browserify\nvar Foundation = {\n version: FOUNDATION_VERSION,\n\n /**\n * Stores initialized plugins.\n */\n _plugins: {},\n\n /**\n * Stores generated unique ids for plugin instances\n */\n _uuids: [],\n\n /**\n * Defines a Foundation plugin, adding it to the `Foundation` namespace and the list of plugins to initialize when reflowing.\n * @param {Object} plugin - The constructor of the plugin.\n */\n plugin: function(plugin, name) {\n // Object key to use when adding to global Foundation object\n // Examples: Foundation.Reveal, Foundation.OffCanvas\n var className = (name || functionName(plugin));\n // Object key to use when storing the plugin, also used to create the identifying data attribute for the plugin\n // Examples: data-reveal, data-off-canvas\n var attrName = hyphenate(className);\n\n // Add to the Foundation object and the plugins list (for reflowing)\n this._plugins[attrName] = this[className] = plugin;\n },\n /**\n * @function\n * Populates the _uuids array with pointers to each individual plugin instance.\n * Adds the `zfPlugin` data-attribute to programmatically created plugins to allow use of $(selector).foundation(method) calls.\n * Also fires the initialization event for each plugin, consolidating repetitive code.\n * @param {Object} plugin - an instance of a plugin, usually `this` in context.\n * @param {String} name - the name of the plugin, passed as a camelCased string.\n * @fires Plugin#init\n */\n registerPlugin: function(plugin, name){\n var pluginName = name ? hyphenate(name) : functionName(plugin.constructor).toLowerCase();\n plugin.uuid = GetYoDigits(6, pluginName);\n\n if(!plugin.$element.attr(`data-${pluginName}`)){ plugin.$element.attr(`data-${pluginName}`, plugin.uuid); }\n if(!plugin.$element.data('zfPlugin')){ plugin.$element.data('zfPlugin', plugin); }\n /**\n * Fires when the plugin has initialized.\n * @event Plugin#init\n */\n plugin.$element.trigger(`init.zf.${pluginName}`);\n\n this._uuids.push(plugin.uuid);\n\n return;\n },\n /**\n * @function\n * Removes the plugins uuid from the _uuids array.\n * Removes the zfPlugin data attribute, as well as the data-plugin-name attribute.\n * Also fires the destroyed event for the plugin, consolidating repetitive code.\n * @param {Object} plugin - an instance of a plugin, usually `this` in context.\n * @fires Plugin#destroyed\n */\n unregisterPlugin: function(plugin){\n var pluginName = hyphenate(functionName(plugin.$element.data('zfPlugin').constructor));\n\n this._uuids.splice(this._uuids.indexOf(plugin.uuid), 1);\n plugin.$element.removeAttr(`data-${pluginName}`).removeData('zfPlugin')\n /**\n * Fires when the plugin has been destroyed.\n * @event Plugin#destroyed\n */\n .trigger(`destroyed.zf.${pluginName}`);\n for(var prop in plugin){\n plugin[prop] = null;//clean up script to prep for garbage collection.\n }\n return;\n },\n\n /**\n * @function\n * Causes one or more active plugins to re-initialize, resetting event listeners, recalculating positions, etc.\n * @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'`\n * @default If no argument is passed, reflow all currently active plugins.\n */\n reInit: function(plugins){\n var isJQ = plugins instanceof $;\n try{\n if(isJQ){\n plugins.each(function(){\n $(this).data('zfPlugin')._init();\n });\n }else{\n var type = typeof plugins,\n _this = this,\n fns = {\n 'object': function(plgs){\n plgs.forEach(function(p){\n p = hyphenate(p);\n $('[data-'+ p +']').foundation('_init');\n });\n },\n 'string': function(){\n plugins = hyphenate(plugins);\n $('[data-'+ plugins +']').foundation('_init');\n },\n 'undefined': function(){\n this['object'](Object.keys(_this._plugins));\n }\n };\n fns[type](plugins);\n }\n }catch(err){\n console.error(err);\n }finally{\n return plugins;\n }\n },\n\n /**\n * Initialize plugins on any elements within `elem` (and `elem` itself) that aren't already initialized.\n * @param {Object} elem - jQuery object containing the element to check inside. Also checks the element itself, unless it's the `document` object.\n * @param {String|Array} plugins - A list of plugins to initialize. Leave this out to initialize everything.\n */\n reflow: function(elem, plugins) {\n\n // If plugins is undefined, just grab everything\n if (typeof plugins === 'undefined') {\n plugins = Object.keys(this._plugins);\n }\n // If plugins is a string, convert it to an array with one item\n else if (typeof plugins === 'string') {\n plugins = [plugins];\n }\n\n var _this = this;\n\n // Iterate through each plugin\n $.each(plugins, function(i, name) {\n // Get the current plugin\n var plugin = _this._plugins[name];\n\n // Localize the search to all elements inside elem, as well as elem itself, unless elem === document\n var $elem = $(elem).find('[data-'+name+']').addBack('[data-'+name+']');\n\n // For each plugin found, initialize it\n $elem.each(function() {\n var $el = $(this),\n opts = {};\n // Don't double-dip on plugins\n if ($el.data('zfPlugin')) {\n console.warn(\"Tried to initialize \"+name+\" on an element that already has a Foundation plugin.\");\n return;\n }\n\n if($el.attr('data-options')){\n var thing = $el.attr('data-options').split(';').forEach(function(e, i){\n var opt = e.split(':').map(function(el){ return el.trim(); });\n if(opt[0]) opts[opt[0]] = parseValue(opt[1]);\n });\n }\n try{\n $el.data('zfPlugin', new plugin($(this), opts));\n }catch(er){\n console.error(er);\n }finally{\n return;\n }\n });\n });\n },\n getFnName: functionName,\n\n addToJquery: function($) {\n // TODO: consider not making this a jQuery function\n // TODO: need way to reflow vs. re-initialize\n /**\n * The Foundation jQuery method.\n * @param {String|Array} method - An action to perform on the current jQuery object.\n */\n var foundation = function(method) {\n var type = typeof method,\n $noJS = $('.no-js');\n\n if($noJS.length){\n $noJS.removeClass('no-js');\n }\n\n if(type === 'undefined'){//needs to initialize the Foundation object, or an individual plugin.\n MediaQuery._init();\n Foundation.reflow(this);\n }else if(type === 'string'){//an individual method to invoke on a plugin or group of plugins\n var args = Array.prototype.slice.call(arguments, 1);//collect all the arguments, if necessary\n var plugClass = this.data('zfPlugin');//determine the class of plugin\n\n if(typeof plugClass !== 'undefined' && typeof plugClass[method] !== 'undefined'){//make sure both the class and method exist\n if(this.length === 1){//if there's only one, call it directly.\n plugClass[method].apply(plugClass, args);\n }else{\n this.each(function(i, el){//otherwise loop through the jQuery collection and invoke the method on each\n plugClass[method].apply($(el).data('zfPlugin'), args);\n });\n }\n }else{//error for no class or no method\n throw new ReferenceError(\"We're sorry, '\" + method + \"' is not an available method for \" + (plugClass ? functionName(plugClass) : 'this element') + '.');\n }\n }else{//error for invalid argument type\n throw new TypeError(`We're sorry, ${type} is not a valid parameter. You must use a string representing the method you wish to invoke.`);\n }\n return this;\n };\n $.fn.foundation = foundation;\n return $;\n }\n};\n\nFoundation.util = {\n /**\n * Function for applying a debounce effect to a function call.\n * @function\n * @param {Function} func - Function to be called at end of timeout.\n * @param {Number} delay - Time in ms to delay the call of `func`.\n * @returns function\n */\n throttle: function (func, delay) {\n var timer = null;\n\n return function () {\n var context = this, args = arguments;\n\n if (timer === null) {\n timer = setTimeout(function () {\n func.apply(context, args);\n timer = null;\n }, delay);\n }\n };\n }\n};\n\nwindow.Foundation = Foundation;\n\n// Polyfill for requestAnimationFrame\n(function() {\n if (!Date.now || !window.Date.now)\n window.Date.now = Date.now = function() { return new Date().getTime(); };\n\n var vendors = ['webkit', 'moz'];\n for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) {\n var vp = vendors[i];\n window.requestAnimationFrame = window[vp+'RequestAnimationFrame'];\n window.cancelAnimationFrame = (window[vp+'CancelAnimationFrame']\n || window[vp+'CancelRequestAnimationFrame']);\n }\n if (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)\n || !window.requestAnimationFrame || !window.cancelAnimationFrame) {\n var lastTime = 0;\n window.requestAnimationFrame = function(callback) {\n var now = Date.now();\n var nextTime = Math.max(lastTime + 16, now);\n return setTimeout(function() { callback(lastTime = nextTime); },\n nextTime - now);\n };\n window.cancelAnimationFrame = clearTimeout;\n }\n /**\n * Polyfill for performance.now, required by rAF\n */\n if(!window.performance || !window.performance.now){\n window.performance = {\n start: Date.now(),\n now: function(){ return Date.now() - this.start; }\n };\n }\n})();\nif (!Function.prototype.bind) {\n Function.prototype.bind = function(oThis) {\n if (typeof this !== 'function') {\n // closest thing possible to the ECMAScript 5\n // internal IsCallable function\n throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');\n }\n\n var aArgs = Array.prototype.slice.call(arguments, 1),\n fToBind = this,\n fNOP = function() {},\n fBound = function() {\n return fToBind.apply(this instanceof fNOP\n ? this\n : oThis,\n aArgs.concat(Array.prototype.slice.call(arguments)));\n };\n\n if (this.prototype) {\n // native functions don't have a prototype\n fNOP.prototype = this.prototype;\n }\n fBound.prototype = new fNOP();\n\n return fBound;\n };\n}\n// Polyfill to get the name of a function in IE9\nfunction functionName(fn) {\n if (typeof Function.prototype.name === 'undefined') {\n var funcNameRegex = /function\\s([^(]{1,})\\(/;\n var results = (funcNameRegex).exec((fn).toString());\n return (results && results.length > 1) ? results[1].trim() : \"\";\n }\n else if (typeof fn.prototype === 'undefined') {\n return fn.constructor.name;\n }\n else {\n return fn.prototype.constructor.name;\n }\n}\nfunction parseValue(str){\n if ('true' === str) return true;\n else if ('false' === str) return false;\n else if (!isNaN(str * 1)) return parseFloat(str);\n return str;\n}\n// Convert PascalCase to kebab-case\n// Thank you: http://stackoverflow.com/a/8955580\nfunction hyphenate(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}\n\nexport {Foundation};\n","'use strict';\n\nimport $ from 'jquery';\nimport { GetYoDigits } from './foundation.core.utils';\n\n// Abstract class for providing lifecycle hooks. Expect plugins to define AT LEAST\n// {function} _setup (replaces previous constructor),\n// {function} _destroy (replaces previous destroy)\nclass Plugin {\n\n constructor(element, options) {\n this._setup(element, options);\n var pluginName = getPluginName(this);\n this.uuid = GetYoDigits(6, pluginName);\n\n if(!this.$element.attr(`data-${pluginName}`)){ this.$element.attr(`data-${pluginName}`, this.uuid); }\n if(!this.$element.data('zfPlugin')){ this.$element.data('zfPlugin', this); }\n /**\n * Fires when the plugin has initialized.\n * @event Plugin#init\n */\n this.$element.trigger(`init.zf.${pluginName}`);\n }\n\n destroy() {\n this._destroy();\n var pluginName = getPluginName(this);\n this.$element.removeAttr(`data-${pluginName}`).removeData('zfPlugin')\n /**\n * Fires when the plugin has been destroyed.\n * @event Plugin#destroyed\n */\n .trigger(`destroyed.zf.${pluginName}`);\n for(var prop in this){\n this[prop] = null;//clean up script to prep for garbage collection.\n }\n }\n}\n\n// Convert PascalCase to kebab-case\n// Thank you: http://stackoverflow.com/a/8955580\nfunction hyphenate(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}\n\nfunction getPluginName(obj) {\n if(typeof(obj.constructor.name) !== 'undefined') {\n return hyphenate(obj.constructor.name);\n } else {\n return hyphenate(obj.className);\n }\n}\n\nexport {Plugin};\n","\"use strict\";\n\nimport $ from 'jquery';\n\n// Core Foundation Utilities, utilized in a number of places.\n\n /**\n * Returns a boolean for RTL support\n */\nfunction rtl() {\n return $('html').attr('dir') === 'rtl';\n}\n\n/**\n * returns a random base-36 uid with namespacing\n * @function\n * @param {Number} length - number of random base-36 digits desired. Increase for more random strings.\n * @param {String} namespace - name of plugin to be incorporated in uid, optional.\n * @default {String} '' - if no plugin name is provided, nothing is appended to the uid.\n * @returns {String} - unique id\n */\nfunction GetYoDigits(length, namespace){\n length = length || 6;\n return Math.round((Math.pow(36, length + 1) - Math.random() * Math.pow(36, length))).toString(36).slice(1) + (namespace ? `-${namespace}` : '');\n}\n\n/**\n * Escape a string so it can be used as a regexp pattern\n * @function\n * @see https://stackoverflow.com/a/9310752/4317384\n *\n * @param {String} str - string to escape.\n * @returns {String} - escaped string\n */\nfunction RegExpEscape(str){\n return str.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n}\n\nfunction transitionend($elem){\n var transitions = {\n 'transition': 'transitionend',\n 'WebkitTransition': 'webkitTransitionEnd',\n 'MozTransition': 'transitionend',\n 'OTransition': 'otransitionend'\n };\n var elem = document.createElement('div'),\n end;\n\n for (var t in transitions){\n if (typeof elem.style[t] !== 'undefined'){\n end = transitions[t];\n }\n }\n if(end){\n return end;\n }else{\n end = setTimeout(function(){\n $elem.triggerHandler('transitionend', [$elem]);\n }, 1);\n return 'transitionend';\n }\n}\n\n/**\n * Return an event type to listen for window load.\n *\n * If `$elem` is passed, an event will be triggered on `$elem`. If window is already loaded, the event will still be triggered.\n * If `handler` is passed, attach it to the event on `$elem`.\n * Calling `onLoad` without handler allows you to get the event type that will be triggered before attaching the handler by yourself.\n * @function\n *\n * @param {Object} [] $elem - jQuery element on which the event will be triggered if passed.\n * @param {Function} [] handler - function to attach to the event.\n * @returns {String} - event type that should or will be triggered.\n */\nfunction onLoad($elem, handler) {\n const didLoad = document.readyState === 'complete';\n const eventType = (didLoad ? '_didLoad' : 'load') + '.zf.util.onLoad';\n const cb = () => $elem.triggerHandler(eventType);\n\n if ($elem) {\n if (handler) $elem.one(eventType, handler);\n\n if (didLoad)\n setTimeout(cb);\n else\n $(window).one('load', cb);\n }\n\n return eventType;\n}\n\n/**\n * Retuns an handler for the `mouseleave` that ignore disappeared mouses.\n *\n * If the mouse \"disappeared\" from the document (like when going on a browser UI element, See https://git.io/zf-11410),\n * the event is ignored.\n * - If the `ignoreLeaveWindow` is `true`, the event is ignored when the user actually left the window\n * (like by switching to an other window with [Alt]+[Tab]).\n * - If the `ignoreReappear` is `true`, the event will be ignored when the mouse will reappear later on the document\n * outside of the element it left.\n *\n * @function\n *\n * @param {Function} [] handler - handler for the filtered `mouseleave` event to watch.\n * @param {Object} [] options - object of options:\n * - {Boolean} [false] ignoreLeaveWindow - also ignore when the user switched windows.\n * - {Boolean} [false] ignoreReappear - also ignore when the mouse reappeared outside of the element it left.\n * @returns {Function} - filtered handler to use to listen on the `mouseleave` event.\n */\nfunction ignoreMousedisappear(handler, { ignoreLeaveWindow = false, ignoreReappear = false } = {}) {\n return function leaveEventHandler(eLeave, ...rest) {\n const callback = handler.bind(this, eLeave, ...rest);\n\n // The mouse left: call the given callback if the mouse entered elsewhere\n if (eLeave.relatedTarget !== null) {\n return callback();\n }\n\n // Otherwise, check if the mouse actually left the window.\n // In firefox if the user switched between windows, the window sill have the focus by the time\n // the event is triggered. We have to debounce the event to test this case.\n setTimeout(function leaveEventDebouncer() {\n if (!ignoreLeaveWindow && document.hasFocus && !document.hasFocus()) {\n return callback();\n }\n\n // Otherwise, wait for the mouse to reeapear outside of the element,\n if (!ignoreReappear) {\n $(document).one('mouseenter', function reenterEventHandler(eReenter) {\n if (!$(eLeave.currentTarget).has(eReenter.target).length) {\n // Fill where the mouse finally entered.\n eLeave.relatedTarget = eReenter.target;\n callback();\n }\n });\n }\n\n }, 0);\n };\n}\n\nexport { rtl, GetYoDigits, RegExpEscape, transitionend, onLoad, ignoreMousedisappear };\n","'use strict';\n\nimport $ from 'jquery';\nimport { Keyboard } from './foundation.util.keyboard';\nimport { Nest } from './foundation.util.nest';\nimport { GetYoDigits, transitionend } from './foundation.core.utils';\nimport { Box } from './foundation.util.box';\nimport { Plugin } from './foundation.core.plugin';\n\n/**\n * Drilldown module.\n * @module foundation.drilldown\n * @requires foundation.util.keyboard\n * @requires foundation.util.nest\n * @requires foundation.util.box\n */\n\nclass Drilldown extends Plugin {\n /**\n * Creates a new instance of a drilldown menu.\n * @class\n * @name Drilldown\n * @param {jQuery} element - jQuery object to make into an accordion menu.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, Drilldown.defaults, this.$element.data(), options);\n this.className = 'Drilldown'; // ie9 back compat\n\n this._init();\n\n Keyboard.register('Drilldown', {\n 'ENTER': 'open',\n 'SPACE': 'open',\n 'ARROW_RIGHT': 'next',\n 'ARROW_UP': 'up',\n 'ARROW_DOWN': 'down',\n 'ARROW_LEFT': 'previous',\n 'ESCAPE': 'close',\n 'TAB': 'down',\n 'SHIFT_TAB': 'up'\n });\n }\n\n /**\n * Initializes the drilldown by creating jQuery collections of elements\n * @private\n */\n _init() {\n Nest.Feather(this.$element, 'drilldown');\n\n if(this.options.autoApplyClass) {\n this.$element.addClass('drilldown');\n }\n\n this.$element.attr({\n 'role': 'tree',\n 'aria-multiselectable': false\n });\n this.$submenuAnchors = this.$element.find('li.is-drilldown-submenu-parent').children('a');\n this.$submenus = this.$submenuAnchors.parent('li').children('[data-submenu]').attr('role', 'group');\n this.$menuItems = this.$element.find('li').not('.js-drilldown-back').attr('role', 'treeitem').find('a');\n\n // Set the main menu as current by default (unless a submenu is selected)\n // Used to set the wrapper height when the drilldown is closed/reopened from any (sub)menu\n this.$currentMenu = this.$element;\n\n this.$element.attr('data-mutate', (this.$element.attr('data-drilldown') || GetYoDigits(6, 'drilldown')));\n\n this._prepareMenu();\n this._registerEvents();\n\n this._keyboardEvents();\n }\n\n /**\n * prepares drilldown menu by setting attributes to links and elements\n * sets a min height to prevent content jumping\n * wraps the element if not already wrapped\n * @private\n * @function\n */\n _prepareMenu() {\n var _this = this;\n // if(!this.options.holdOpen){\n // this._menuLinkEvents();\n // }\n this.$submenuAnchors.each(function(){\n var $link = $(this);\n var $sub = $link.parent();\n if(_this.options.parentLink){\n $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>');\n }\n $link.data('savedHref', $link.attr('href')).removeAttr('href').attr('tabindex', 0);\n $link.children('[data-submenu]')\n .attr({\n 'aria-hidden': true,\n 'tabindex': 0,\n 'role': 'group'\n });\n _this._events($link);\n });\n this.$submenus.each(function(){\n var $menu = $(this),\n $back = $menu.find('.js-drilldown-back');\n if(!$back.length){\n switch (_this.options.backButtonPosition) {\n case \"bottom\":\n $menu.append(_this.options.backButton);\n break;\n case \"top\":\n $menu.prepend(_this.options.backButton);\n break;\n default:\n console.error(\"Unsupported backButtonPosition value '\" + _this.options.backButtonPosition + \"'\");\n }\n }\n _this._back($menu);\n });\n\n this.$submenus.addClass('invisible');\n if(!this.options.autoHeight) {\n this.$submenus.addClass('drilldown-submenu-cover-previous');\n }\n\n // create a wrapper on element if it doesn't exist.\n if(!this.$element.parent().hasClass('is-drilldown')){\n this.$wrapper = $(this.options.wrapper).addClass('is-drilldown');\n if(this.options.animateHeight) this.$wrapper.addClass('animate-height');\n this.$element.wrap(this.$wrapper);\n }\n // set wrapper\n this.$wrapper = this.$element.parent();\n this.$wrapper.css(this._getMaxDims());\n }\n\n _resize() {\n this.$wrapper.css({'max-width': 'none', 'min-height': 'none'});\n // _getMaxDims has side effects (boo) but calling it should update all other necessary heights & widths\n this.$wrapper.css(this._getMaxDims());\n }\n\n /**\n * Adds event handlers to elements in the menu.\n * @function\n * @private\n * @param {jQuery} $elem - the current menu item to add handlers to.\n */\n _events($elem) {\n var _this = this;\n\n $elem.off('click.zf.drilldown')\n .on('click.zf.drilldown', function(e){\n if($(e.target).parentsUntil('ul', 'li').hasClass('is-drilldown-submenu-parent')){\n e.stopImmediatePropagation();\n e.preventDefault();\n }\n\n // if(e.target !== e.currentTarget.firstElementChild){\n // return false;\n // }\n _this._show($elem.parent('li'));\n\n if(_this.options.closeOnClick){\n var $body = $('body');\n $body.off('.zf.drilldown').on('click.zf.drilldown', function(e){\n if (e.target === _this.$element[0] || $.contains(_this.$element[0], e.target)) { return; }\n e.preventDefault();\n _this._hideAll();\n $body.off('.zf.drilldown');\n });\n }\n });\n }\n\n /**\n * Adds event handlers to the menu element.\n * @function\n * @private\n */\n _registerEvents() {\n if(this.options.scrollTop){\n this._bindHandler = this._scrollTop.bind(this);\n this.$element.on('open.zf.drilldown hide.zf.drilldown closed.zf.drilldown',this._bindHandler);\n }\n this.$element.on('mutateme.zf.trigger', this._resize.bind(this));\n }\n\n /**\n * Scroll to Top of Element or data-scroll-top-element\n * @function\n * @fires Drilldown#scrollme\n */\n _scrollTop() {\n var _this = this;\n var $scrollTopElement = _this.options.scrollTopElement!=''?$(_this.options.scrollTopElement):_this.$element,\n scrollPos = parseInt($scrollTopElement.offset().top+_this.options.scrollTopOffset, 10);\n $('html, body').stop(true).animate({ scrollTop: scrollPos }, _this.options.animationDuration, _this.options.animationEasing,function(){\n /**\n * Fires after the menu has scrolled\n * @event Drilldown#scrollme\n */\n if(this===$('html')[0])_this.$element.trigger('scrollme.zf.drilldown');\n });\n }\n\n /**\n * Adds keydown event listener to `li`'s in the menu.\n * @private\n */\n _keyboardEvents() {\n var _this = this;\n\n this.$menuItems.add(this.$element.find('.js-drilldown-back > a, .is-submenu-parent-item > a')).on('keydown.zf.drilldown', function(e){\n var $element = $(this),\n $elements = $element.parent('li').parent('ul').children('li').children('a'),\n $prevElement,\n $nextElement;\n\n $elements.each(function(i) {\n if ($(this).is($element)) {\n $prevElement = $elements.eq(Math.max(0, i-1));\n $nextElement = $elements.eq(Math.min(i+1, $elements.length-1));\n return;\n }\n });\n\n Keyboard.handleKey(e, 'Drilldown', {\n next: function() {\n if ($element.is(_this.$submenuAnchors)) {\n _this._show($element.parent('li'));\n $element.parent('li').one(transitionend($element), function(){\n $element.parent('li').find('ul li a').not('.js-drilldown-back a').first().focus();\n });\n return true;\n }\n },\n previous: function() {\n _this._hide($element.parent('li').parent('ul'));\n $element.parent('li').parent('ul').one(transitionend($element), function(){\n setTimeout(function() {\n $element.parent('li').parent('ul').parent('li').children('a').first().focus();\n }, 1);\n });\n return true;\n },\n up: function() {\n $prevElement.focus();\n // Don't tap focus on first element in root ul\n return !$element.is(_this.$element.find('> li:first-child > a'));\n },\n down: function() {\n $nextElement.focus();\n // Don't tap focus on last element in root ul\n return !$element.is(_this.$element.find('> li:last-child > a'));\n },\n close: function() {\n // Don't close on element in root ul\n if (!$element.is(_this.$element.find('> li > a'))) {\n _this._hide($element.parent().parent());\n $element.parent().parent().siblings('a').focus();\n }\n },\n open: function() {\n if (_this.options.parentLink && $element.attr('href')) { // Link with href\n return false;\n } else if (!$element.is(_this.$menuItems)) { // not menu item means back button\n _this._hide($element.parent('li').parent('ul'));\n $element.parent('li').parent('ul').one(transitionend($element), function(){\n setTimeout(function() {\n $element.parent('li').parent('ul').parent('li').children('a').first().focus();\n }, 1);\n });\n return true;\n } else if ($element.is(_this.$submenuAnchors)) { // Sub menu item\n _this._show($element.parent('li'));\n $element.parent('li').one(transitionend($element), function(){\n $element.parent('li').find('ul li a').not('.js-drilldown-back a').first().focus();\n });\n return true;\n }\n },\n handled: function(preventDefault) {\n if (preventDefault) {\n e.preventDefault();\n }\n e.stopImmediatePropagation();\n }\n });\n }); // end keyboardAccess\n }\n\n /**\n * Closes all open elements, and returns to root menu.\n * @function\n * @fires Drilldown#closed\n */\n _hideAll() {\n var $elem = this.$element.find('.is-drilldown-submenu.is-active').addClass('is-closing');\n if(this.options.autoHeight) this.$wrapper.css({height:$elem.parent().closest('ul').data('calcHeight')});\n $elem.one(transitionend($elem), function(e){\n $elem.removeClass('is-active is-closing');\n });\n /**\n * Fires when the menu is fully closed.\n * @event Drilldown#closed\n */\n this.$element.trigger('closed.zf.drilldown');\n }\n\n /**\n * Adds event listener for each `back` button, and closes open menus.\n * @function\n * @fires Drilldown#back\n * @param {jQuery} $elem - the current sub-menu to add `back` event.\n */\n _back($elem) {\n var _this = this;\n $elem.off('click.zf.drilldown');\n $elem.children('.js-drilldown-back')\n .on('click.zf.drilldown', function(e){\n e.stopImmediatePropagation();\n // console.log('mouseup on back');\n _this._hide($elem);\n\n // If there is a parent submenu, call show\n let parentSubMenu = $elem.parent('li').parent('ul').parent('li');\n if (parentSubMenu.length) {\n _this._show(parentSubMenu);\n }\n });\n }\n\n /**\n * Adds event listener to menu items w/o submenus to close open menus on click.\n * @function\n * @private\n */\n _menuLinkEvents() {\n var _this = this;\n this.$menuItems.not('.is-drilldown-submenu-parent')\n .off('click.zf.drilldown')\n .on('click.zf.drilldown', function(e){\n // e.stopImmediatePropagation();\n setTimeout(function(){\n _this._hideAll();\n }, 0);\n });\n }\n\n /**\n * Sets the CSS classes for submenu to show it.\n * @function\n * @private\n * @param {jQuery} $elem - the target submenu (`ul` tag)\n * @param {boolean} trigger - trigger drilldown event\n */\n _setShowSubMenuClasses($elem, trigger) {\n $elem.addClass('is-active').removeClass('invisible').attr('aria-hidden', false);\n $elem.parent('li').attr('aria-expanded', true);\n if (trigger === true) {\n this.$element.trigger('open.zf.drilldown', [$elem]);\n }\n }\n\n /**\n * Sets the CSS classes for submenu to hide it.\n * @function\n * @private\n * @param {jQuery} $elem - the target submenu (`ul` tag)\n * @param {boolean} trigger - trigger drilldown event\n */\n _setHideSubMenuClasses($elem, trigger) {\n $elem.removeClass('is-active').addClass('invisible').attr('aria-hidden', true);\n $elem.parent('li').attr('aria-expanded', false);\n if (trigger === true) {\n $elem.trigger('hide.zf.drilldown', [$elem]);\n }\n }\n\n /**\n * Opens a specific drilldown (sub)menu no matter which (sub)menu in it is currently visible.\n * Compared to _show() this lets you jump into any submenu without clicking through every submenu on the way to it.\n * @function\n * @fires Drilldown#open\n * @param {jQuery} $elem - the target (sub)menu (`ul` tag)\n * @param {boolean} autoFocus - if true the first link in the target (sub)menu gets auto focused\n */\n _showMenu($elem, autoFocus) {\n\n var _this = this;\n\n // Reset drilldown\n var $expandedSubmenus = this.$element.find('li[aria-expanded=\"true\"] > ul[data-submenu]');\n $expandedSubmenus.each(function(index) {\n _this._setHideSubMenuClasses($(this));\n });\n\n // Save the menu as the currently displayed one.\n this.$currentMenu = $elem;\n\n // If target menu is root, focus first link & exit\n if ($elem.is('[data-drilldown]')) {\n if (autoFocus === true) $elem.find('li[role=\"treeitem\"] > a').first().focus();\n if (this.options.autoHeight) this.$wrapper.css('height', $elem.data('calcHeight'));\n return;\n }\n\n // Find all submenus on way to root incl. the element itself\n var $submenus = $elem.children().first().parentsUntil('[data-drilldown]', '[data-submenu]');\n\n // Open target menu and all submenus on its way to root\n $submenus.each(function(index) {\n\n // Update height of first child (target menu) if autoHeight option true\n if (index === 0 && _this.options.autoHeight) {\n _this.$wrapper.css('height', $(this).data('calcHeight'));\n }\n\n var isLastChild = index == $submenus.length - 1;\n\n // Add transitionsend listener to last child (root due to reverse order) to open target menu's first link\n // Last child makes sure the event gets always triggered even if going through several menus\n if (isLastChild === true) {\n $(this).one(transitionend($(this)), () => {\n if (autoFocus === true) {\n $elem.find('li[role=\"treeitem\"] > a').first().focus();\n }\n });\n }\n\n _this._setShowSubMenuClasses($(this), isLastChild);\n });\n }\n\n /**\n * Opens a submenu.\n * @function\n * @fires Drilldown#open\n * @param {jQuery} $elem - the current element with a submenu to open, i.e. the `li` tag.\n */\n _show($elem) {\n const $submenu = $elem.children('[data-submenu]');\n\n $elem.attr('aria-expanded', true);\n\n this.$currentMenu = $submenu;\n $submenu.addClass('is-active').removeClass('invisible').attr('aria-hidden', false);\n if (this.options.autoHeight) {\n this.$wrapper.css({ height: $submenu.data('calcHeight') });\n }\n\n /**\n * Fires when the submenu has opened.\n * @event Drilldown#open\n */\n this.$element.trigger('open.zf.drilldown', [$elem]);\n }\n\n /**\n * Hides a submenu\n * @function\n * @fires Drilldown#hide\n * @param {jQuery} $elem - the current sub-menu to hide, i.e. the `ul` tag.\n */\n _hide($elem) {\n if(this.options.autoHeight) this.$wrapper.css({height:$elem.parent().closest('ul').data('calcHeight')});\n var _this = this;\n $elem.parent('li').attr('aria-expanded', false);\n $elem.attr('aria-hidden', true);\n $elem.addClass('is-closing')\n .one(transitionend($elem), function(){\n $elem.removeClass('is-active is-closing');\n $elem.blur().addClass('invisible');\n });\n /**\n * Fires when the submenu has closed.\n * @event Drilldown#hide\n */\n $elem.trigger('hide.zf.drilldown', [$elem]);\n }\n\n /**\n * Iterates through the nested menus to calculate the min-height, and max-width for the menu.\n * Prevents content jumping.\n * @function\n * @private\n */\n _getMaxDims() {\n var maxHeight = 0, result = {}, _this = this;\n\n // Recalculate menu heights and total max height\n this.$submenus.add(this.$element).each(function(){\n var numOfElems = $(this).children('li').length;\n var height = Box.GetDimensions(this).height;\n\n maxHeight = height > maxHeight ? height : maxHeight;\n\n if(_this.options.autoHeight) {\n $(this).data('calcHeight',height);\n }\n });\n\n if (this.options.autoHeight)\n result['height'] = this.$currentMenu.data('calcHeight');\n else\n result['min-height'] = `${maxHeight}px`;\n\n result['max-width'] = `${this.$element[0].getBoundingClientRect().width}px`;\n\n return result;\n }\n\n /**\n * Destroys the Drilldown Menu\n * @function\n */\n _destroy() {\n if(this.options.scrollTop) this.$element.off('.zf.drilldown',this._bindHandler);\n this._hideAll();\n\t this.$element.off('mutateme.zf.trigger');\n Nest.Burn(this.$element, 'drilldown');\n this.$element.unwrap()\n .find('.js-drilldown-back, .is-submenu-parent-item').remove()\n .end().find('.is-active, .is-closing, .is-drilldown-submenu').removeClass('is-active is-closing is-drilldown-submenu')\n .end().find('[data-submenu]').removeAttr('aria-hidden tabindex role');\n this.$submenuAnchors.each(function() {\n $(this).off('.zf.drilldown');\n });\n\n this.$element.find('[data-is-parent-link]').detach();\n this.$submenus.removeClass('drilldown-submenu-cover-previous invisible');\n\n this.$element.find('a').each(function(){\n var $link = $(this);\n $link.removeAttr('tabindex');\n if($link.data('savedHref')){\n $link.attr('href', $link.data('savedHref')).removeData('savedHref');\n }else{ return; }\n });\n };\n}\n\nDrilldown.defaults = {\n /**\n * Drilldowns depend on styles in order to function properly; in the default build of Foundation these are\n * on the `drilldown` class. This option auto-applies this class to the drilldown upon initialization.\n * @option\n * @type {boolian}\n * @default true\n */\n autoApplyClass: true,\n /**\n * 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.\n * @option\n * @type {string}\n * @default '<li class=\"js-drilldown-back\"><a tabindex=\"0\">Back</a></li>'\n */\n backButton: '<li class=\"js-drilldown-back\"><a tabindex=\"0\">Back</a></li>',\n /**\n * Position the back button either at the top or bottom of drilldown submenus. Can be `'left'` or `'bottom'`.\n * @option\n * @type {string}\n * @default top\n */\n backButtonPosition: 'top',\n /**\n * 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.\n * @option\n * @type {string}\n * @default '<div></div>'\n */\n wrapper: '<div></div>',\n /**\n * Adds the parent link to the submenu.\n * @option\n * @type {boolean}\n * @default false\n */\n parentLink: false,\n /**\n * Allow the menu to return to root list on body click.\n * @option\n * @type {boolean}\n * @default false\n */\n closeOnClick: false,\n /**\n * Allow the menu to auto adjust height.\n * @option\n * @type {boolean}\n * @default false\n */\n autoHeight: false,\n /**\n * Animate the auto adjust height.\n * @option\n * @type {boolean}\n * @default false\n */\n animateHeight: false,\n /**\n * Scroll to the top of the menu after opening a submenu or navigating back using the menu back button\n * @option\n * @type {boolean}\n * @default false\n */\n scrollTop: false,\n /**\n * String jquery selector (for example 'body') of element to take offset().top from, if empty string the drilldown menu offset().top is taken\n * @option\n * @type {string}\n * @default ''\n */\n scrollTopElement: '',\n /**\n * ScrollTop offset\n * @option\n * @type {number}\n * @default 0\n */\n scrollTopOffset: 0,\n /**\n * Scroll animation duration\n * @option\n * @type {number}\n * @default 500\n */\n animationDuration: 500,\n /**\n * Scroll animation easing. Can be `'swing'` or `'linear'`.\n * @option\n * @type {string}\n * @see {@link https://api.jquery.com/animate|JQuery animate}\n * @default 'swing'\n */\n animationEasing: 'swing'\n // holdOpen: false\n};\n\nexport {Drilldown};\n","'use strict';\n\nimport $ from 'jquery';\nimport { Keyboard } from './foundation.util.keyboard';\nimport { GetYoDigits, ignoreMousedisappear } from './foundation.core.utils';\nimport { Positionable } from './foundation.positionable';\n\nimport { Triggers } from './foundation.util.triggers';\n\n\n/**\n * Dropdown module.\n * @module foundation.dropdown\n * @requires foundation.util.keyboard\n * @requires foundation.util.box\n * @requires foundation.util.triggers\n */\nclass Dropdown extends Positionable {\n /**\n * Creates a new instance of a dropdown.\n * @class\n * @name Dropdown\n * @param {jQuery} element - jQuery object to make into a dropdown.\n * Object should be of the dropdown panel, rather than its anchor.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, Dropdown.defaults, this.$element.data(), options);\n this.className = 'Dropdown'; // ie9 back compat\n\n // Triggers init is idempotent, just need to make sure it is initialized\n Triggers.init($);\n\n this._init();\n\n Keyboard.register('Dropdown', {\n 'ENTER': 'toggle',\n 'SPACE': 'toggle',\n 'ESCAPE': 'close'\n });\n }\n\n /**\n * Initializes the plugin by setting/checking options and attributes, adding helper variables, and saving the anchor.\n * @function\n * @private\n */\n _init() {\n var $id = this.$element.attr('id');\n\n this.$anchors = $(`[data-toggle=\"${$id}\"]`).length ? $(`[data-toggle=\"${$id}\"]`) : $(`[data-open=\"${$id}\"]`);\n this.$anchors.attr({\n 'aria-controls': $id,\n 'data-is-focus': false,\n 'data-yeti-box': $id,\n 'aria-haspopup': true,\n 'aria-expanded': false\n });\n\n this._setCurrentAnchor(this.$anchors.first());\n\n if(this.options.parentClass){\n this.$parent = this.$element.parents('.' + this.options.parentClass);\n }else{\n this.$parent = null;\n }\n\n // Set [aria-labelledby] on the Dropdown if it is not set\n if (typeof this.$element.attr('aria-labelledby') === 'undefined') {\n // Get the anchor ID or create one\n if (typeof this.$currentAnchor.attr('id') === 'undefined') {\n this.$currentAnchor.attr('id', GetYoDigits(6, 'dd-anchor'));\n };\n\n this.$element.attr('aria-labelledby', this.$currentAnchor.attr('id'));\n }\n\n this.$element.attr({\n 'aria-hidden': 'true',\n 'data-yeti-box': $id,\n 'data-resize': $id,\n });\n\n super._init();\n this._events();\n }\n\n _getDefaultPosition() {\n // handle legacy classnames\n var position = this.$element[0].className.match(/(top|left|right|bottom)/g);\n if(position) {\n return position[0];\n } else {\n return 'bottom'\n }\n }\n\n _getDefaultAlignment() {\n // handle legacy float approach\n var horizontalPosition = /float-(\\S+)/.exec(this.$currentAnchor.attr('class'));\n if(horizontalPosition) {\n return horizontalPosition[1];\n }\n\n return super._getDefaultAlignment();\n }\n\n\n\n /**\n * Sets the position and orientation of the dropdown pane, checks for collisions if allow-overlap is not true.\n * Recursively calls itself if a collision is detected, with a new position class.\n * @function\n * @private\n */\n _setPosition() {\n this.$element.removeClass(`has-position-${this.position} has-alignment-${this.alignment}`);\n super._setPosition(this.$currentAnchor, this.$element, this.$parent);\n this.$element.addClass(`has-position-${this.position} has-alignment-${this.alignment}`);\n }\n\n /**\n * Make it a current anchor.\n * Current anchor as the reference for the position of Dropdown panes.\n * @param {HTML} el - DOM element of the anchor.\n * @function\n * @private\n */\n _setCurrentAnchor(el) {\n this.$currentAnchor = $(el);\n }\n\n /**\n * Adds event listeners to the element utilizing the triggers utility library.\n * @function\n * @private\n */\n _events() {\n var _this = this;\n this.$element.on({\n 'open.zf.trigger': this.open.bind(this),\n 'close.zf.trigger': this.close.bind(this),\n 'toggle.zf.trigger': this.toggle.bind(this),\n 'resizeme.zf.trigger': this._setPosition.bind(this)\n });\n\n this.$anchors.off('click.zf.trigger')\n .on('click.zf.trigger', function() { _this._setCurrentAnchor(this); });\n\n if(this.options.hover){\n this.$anchors.off('mouseenter.zf.dropdown mouseleave.zf.dropdown')\n .on('mouseenter.zf.dropdown', function(){\n _this._setCurrentAnchor(this);\n\n var bodyData = $('body').data();\n if(typeof(bodyData.whatinput) === 'undefined' || bodyData.whatinput === 'mouse') {\n clearTimeout(_this.timeout);\n _this.timeout = setTimeout(function(){\n _this.open();\n _this.$anchors.data('hover', true);\n }, _this.options.hoverDelay);\n }\n }).on('mouseleave.zf.dropdown', ignoreMousedisappear(function(){\n clearTimeout(_this.timeout);\n _this.timeout = setTimeout(function(){\n _this.close();\n _this.$anchors.data('hover', false);\n }, _this.options.hoverDelay);\n }));\n if(this.options.hoverPane){\n this.$element.off('mouseenter.zf.dropdown mouseleave.zf.dropdown')\n .on('mouseenter.zf.dropdown', function(){\n clearTimeout(_this.timeout);\n }).on('mouseleave.zf.dropdown', ignoreMousedisappear(function(){\n clearTimeout(_this.timeout);\n _this.timeout = setTimeout(function(){\n _this.close();\n _this.$anchors.data('hover', false);\n }, _this.options.hoverDelay);\n }));\n }\n }\n this.$anchors.add(this.$element).on('keydown.zf.dropdown', function(e) {\n\n var $target = $(this),\n visibleFocusableElements = Keyboard.findFocusable(_this.$element);\n\n Keyboard.handleKey(e, 'Dropdown', {\n open: function() {\n if ($target.is(_this.$anchors) && !$target.is('input, textarea')) {\n _this.open();\n _this.$element.attr('tabindex', -1).focus();\n e.preventDefault();\n }\n },\n close: function() {\n _this.close();\n _this.$anchors.focus();\n }\n });\n });\n }\n\n /**\n * Adds an event handler to the body to close any dropdowns on a click.\n * @function\n * @private\n */\n _addBodyHandler() {\n var $body = $(document.body).not(this.$element),\n _this = this;\n $body.off('click.zf.dropdown')\n .on('click.zf.dropdown', function(e){\n if(_this.$anchors.is(e.target) || _this.$anchors.find(e.target).length) {\n return;\n }\n if(_this.$element.is(e.target) || _this.$element.find(e.target).length) {\n return;\n }\n _this.close();\n $body.off('click.zf.dropdown');\n });\n }\n\n /**\n * Opens the dropdown pane, and fires a bubbling event to close other dropdowns.\n * @function\n * @fires Dropdown#closeme\n * @fires Dropdown#show\n */\n open() {\n // var _this = this;\n /**\n * Fires to close other open dropdowns, typically when dropdown is opening\n * @event Dropdown#closeme\n */\n this.$element.trigger('closeme.zf.dropdown', this.$element.attr('id'));\n this.$anchors.addClass('hover')\n .attr({'aria-expanded': true});\n // this.$element/*.show()*/;\n\n this.$element.addClass('is-opening');\n this._setPosition();\n this.$element.removeClass('is-opening').addClass('is-open')\n .attr({'aria-hidden': false});\n\n if(this.options.autoFocus){\n var $focusable = Keyboard.findFocusable(this.$element);\n if($focusable.length){\n $focusable.eq(0).focus();\n }\n }\n\n if(this.options.closeOnClick){ this._addBodyHandler(); }\n\n if (this.options.trapFocus) {\n Keyboard.trapFocus(this.$element);\n }\n\n /**\n * Fires once the dropdown is visible.\n * @event Dropdown#show\n */\n this.$element.trigger('show.zf.dropdown', [this.$element]);\n }\n\n /**\n * Closes the open dropdown pane.\n * @function\n * @fires Dropdown#hide\n */\n close() {\n if(!this.$element.hasClass('is-open')){\n return false;\n }\n this.$element.removeClass('is-open')\n .attr({'aria-hidden': true});\n\n this.$anchors.removeClass('hover')\n .attr('aria-expanded', false);\n\n /**\n * Fires once the dropdown is no longer visible.\n * @event Dropdown#hide\n */\n this.$element.trigger('hide.zf.dropdown', [this.$element]);\n\n if (this.options.trapFocus) {\n Keyboard.releaseFocus(this.$element);\n }\n }\n\n /**\n * Toggles the dropdown pane's visibility.\n * @function\n */\n toggle() {\n if(this.$element.hasClass('is-open')){\n if(this.$anchors.data('hover')) return;\n this.close();\n }else{\n this.open();\n }\n }\n\n /**\n * Destroys the dropdown.\n * @function\n */\n _destroy() {\n this.$element.off('.zf.trigger').hide();\n this.$anchors.off('.zf.dropdown');\n $(document.body).off('click.zf.dropdown');\n\n }\n}\n\nDropdown.defaults = {\n /**\n * Class that designates bounding container of Dropdown (default: window)\n * @option\n * @type {?string}\n * @default null\n */\n parentClass: null,\n /**\n * Amount of time to delay opening a submenu on hover event.\n * @option\n * @type {number}\n * @default 250\n */\n hoverDelay: 250,\n /**\n * Allow submenus to open on hover events\n * @option\n * @type {boolean}\n * @default false\n */\n hover: false,\n /**\n * Don't close dropdown when hovering over dropdown pane\n * @option\n * @type {boolean}\n * @default false\n */\n hoverPane: false,\n /**\n * Number of pixels between the dropdown pane and the triggering element on open.\n * @option\n * @type {number}\n * @default 0\n */\n vOffset: 0,\n /**\n * Number of pixels between the dropdown pane and the triggering element on open.\n * @option\n * @type {number}\n * @default 0\n */\n hOffset: 0,\n /**\n * Position of dropdown. Can be left, right, bottom, top, or auto.\n * @option\n * @type {string}\n * @default 'auto'\n */\n position: 'auto',\n /**\n * Alignment of dropdown relative to anchor. Can be left, right, bottom, top, center, or auto.\n * @option\n * @type {string}\n * @default 'auto'\n */\n alignment: 'auto',\n /**\n * 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.\n * @option\n * @type {boolean}\n * @default false\n */\n allowOverlap: false,\n /**\n * Allow overlap of only the bottom of the container. This is the most common\n * behavior for dropdowns, allowing the dropdown to extend the bottom of the\n * screen but not otherwise influence or break out of the container.\n * @option\n * @type {boolean}\n * @default true\n */\n allowBottomOverlap: true,\n /**\n * Allow the plugin to trap focus to the dropdown pane if opened with keyboard commands.\n * @option\n * @type {boolean}\n * @default false\n */\n trapFocus: false,\n /**\n * Allow the plugin to set focus to the first focusable element within the pane, regardless of method of opening.\n * @option\n * @type {boolean}\n * @default false\n */\n autoFocus: false,\n /**\n * Allows a click on the body to close the dropdown.\n * @option\n * @type {boolean}\n * @default false\n */\n closeOnClick: false\n};\n\nexport {Dropdown};\n","'use strict';\n\nimport $ from 'jquery';\nimport { Plugin } from './foundation.core.plugin';\nimport { rtl as Rtl, ignoreMousedisappear } from './foundation.core.utils';\nimport { Keyboard } from './foundation.util.keyboard';\nimport { Nest } from './foundation.util.nest';\nimport { Box } from './foundation.util.box';\n\n/**\n * DropdownMenu module.\n * @module foundation.dropdown-menu\n * @requires foundation.util.keyboard\n * @requires foundation.util.box\n * @requires foundation.util.nest\n */\n\nclass DropdownMenu extends Plugin {\n /**\n * Creates a new instance of DropdownMenu.\n * @class\n * @name DropdownMenu\n * @fires DropdownMenu#init\n * @param {jQuery} element - jQuery object to make into a dropdown menu.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, DropdownMenu.defaults, this.$element.data(), options);\n this.className = 'DropdownMenu'; // ie9 back compat\n\n this._init();\n\n Keyboard.register('DropdownMenu', {\n 'ENTER': 'open',\n 'SPACE': 'open',\n 'ARROW_RIGHT': 'next',\n 'ARROW_UP': 'up',\n 'ARROW_DOWN': 'down',\n 'ARROW_LEFT': 'previous',\n 'ESCAPE': 'close'\n });\n }\n\n /**\n * Initializes the plugin, and calls _prepareMenu\n * @private\n * @function\n */\n _init() {\n Nest.Feather(this.$element, 'dropdown');\n\n var subs = this.$element.find('li.is-dropdown-submenu-parent');\n this.$element.children('.is-dropdown-submenu-parent').children('.is-dropdown-submenu').addClass('first-sub');\n\n this.$menuItems = this.$element.find('[role=\"menuitem\"]');\n this.$tabs = this.$element.children('[role=\"menuitem\"]');\n this.$tabs.find('ul.is-dropdown-submenu').addClass(this.options.verticalClass);\n\n if (this.options.alignment === 'auto') {\n if (this.$element.hasClass(this.options.rightClass) || Rtl() || this.$element.parents('.top-bar-right').is('*')) {\n this.options.alignment = 'right';\n subs.addClass('opens-left');\n } else {\n this.options.alignment = 'left';\n subs.addClass('opens-right');\n }\n } else {\n if (this.options.alignment === 'right') {\n subs.addClass('opens-left');\n } else {\n subs.addClass('opens-right');\n }\n }\n this.changed = false;\n this._events();\n };\n\n _isVertical() {\n return this.$tabs.css('display') === 'block' || this.$element.css('flex-direction') === 'column';\n }\n\n _isRtl() {\n return this.$element.hasClass('align-right') || (Rtl() && !this.$element.hasClass('align-left'));\n }\n\n /**\n * Adds event listeners to elements within the menu\n * @private\n * @function\n */\n _events() {\n var _this = this,\n hasTouch = 'ontouchstart' in window || (typeof window.ontouchstart !== 'undefined'),\n parClass = 'is-dropdown-submenu-parent';\n\n // used for onClick and in the keyboard handlers\n var handleClickFn = function(e) {\n var $elem = $(e.target).parentsUntil('ul', `.${parClass}`),\n hasSub = $elem.hasClass(parClass),\n hasClicked = $elem.attr('data-is-click') === 'true',\n $sub = $elem.children('.is-dropdown-submenu');\n\n if (hasSub) {\n if (hasClicked) {\n if (!_this.options.closeOnClick || (!_this.options.clickOpen && !hasTouch) || (_this.options.forceFollow && hasTouch)) { return; }\n else {\n e.stopImmediatePropagation();\n e.preventDefault();\n _this._hide($elem);\n }\n } else {\n e.preventDefault();\n e.stopImmediatePropagation();\n _this._show($sub);\n $elem.add($elem.parentsUntil(_this.$element, `.${parClass}`)).attr('data-is-click', true);\n }\n }\n };\n\n if (this.options.clickOpen || hasTouch) {\n this.$menuItems.on('click.zf.dropdownmenu touchstart.zf.dropdownmenu', handleClickFn);\n }\n\n // Handle Leaf element Clicks\n if(_this.options.closeOnClickInside){\n this.$menuItems.on('click.zf.dropdownmenu', function(e) {\n var $elem = $(this),\n hasSub = $elem.hasClass(parClass);\n if(!hasSub){\n _this._hide();\n }\n });\n }\n\n if (!this.options.disableHover) {\n this.$menuItems.on('mouseenter.zf.dropdownmenu', function (e) {\n var $elem = $(this),\n hasSub = $elem.hasClass(parClass);\n\n if (hasSub) {\n clearTimeout($elem.data('_delay'));\n $elem.data('_delay', setTimeout(function () {\n _this._show($elem.children('.is-dropdown-submenu'));\n }, _this.options.hoverDelay));\n }\n }).on('mouseleave.zf.dropdownMenu', ignoreMousedisappear(function (e) {\n var $elem = $(this),\n hasSub = $elem.hasClass(parClass);\n if (hasSub && _this.options.autoclose) {\n if ($elem.attr('data-is-click') === 'true' && _this.options.clickOpen) { return false; }\n\n clearTimeout($elem.data('_delay'));\n $elem.data('_delay', setTimeout(function () {\n _this._hide($elem);\n }, _this.options.closingTime));\n }\n }));\n }\n this.$menuItems.on('keydown.zf.dropdownmenu', function(e) {\n var $element = $(e.target).parentsUntil('ul', '[role=\"menuitem\"]'),\n isTab = _this.$tabs.index($element) > -1,\n $elements = isTab ? _this.$tabs : $element.siblings('li').add($element),\n $prevElement,\n $nextElement;\n\n $elements.each(function(i) {\n if ($(this).is($element)) {\n $prevElement = $elements.eq(i-1);\n $nextElement = $elements.eq(i+1);\n return;\n }\n });\n\n var nextSibling = function() {\n $nextElement.children('a:first').focus();\n e.preventDefault();\n }, prevSibling = function() {\n $prevElement.children('a:first').focus();\n e.preventDefault();\n }, openSub = function() {\n var $sub = $element.children('ul.is-dropdown-submenu');\n if ($sub.length) {\n _this._show($sub);\n $element.find('li > a:first').focus();\n e.preventDefault();\n } else { return; }\n }, closeSub = function() {\n //if ($element.is(':first-child')) {\n var close = $element.parent('ul').parent('li');\n close.children('a:first').focus();\n _this._hide(close);\n e.preventDefault();\n //}\n };\n var functions = {\n open: openSub,\n close: function() {\n _this._hide(_this.$element);\n _this.$menuItems.eq(0).children('a').focus(); // focus to first element\n e.preventDefault();\n },\n handled: function() {\n e.stopImmediatePropagation();\n }\n };\n\n if (isTab) {\n if (_this._isVertical()) { // vertical menu\n if (_this._isRtl()) { // right aligned\n $.extend(functions, {\n down: nextSibling,\n up: prevSibling,\n next: closeSub,\n previous: openSub\n });\n } else { // left aligned\n $.extend(functions, {\n down: nextSibling,\n up: prevSibling,\n next: openSub,\n previous: closeSub\n });\n }\n } else { // horizontal menu\n if (_this._isRtl()) { // right aligned\n $.extend(functions, {\n next: prevSibling,\n previous: nextSibling,\n down: openSub,\n up: closeSub\n });\n } else { // left aligned\n $.extend(functions, {\n next: nextSibling,\n previous: prevSibling,\n down: openSub,\n up: closeSub\n });\n }\n }\n } else { // not tabs -> one sub\n if (_this._isRtl()) { // right aligned\n $.extend(functions, {\n next: closeSub,\n previous: openSub,\n down: nextSibling,\n up: prevSibling\n });\n } else { // left aligned\n $.extend(functions, {\n next: openSub,\n previous: closeSub,\n down: nextSibling,\n up: prevSibling\n });\n }\n }\n Keyboard.handleKey(e, 'DropdownMenu', functions);\n\n });\n }\n\n /**\n * Adds an event handler to the body to close any dropdowns on a click.\n * @function\n * @private\n */\n _addBodyHandler() {\n var $body = $(document.body),\n _this = this;\n $body.off('mouseup.zf.dropdownmenu touchend.zf.dropdownmenu')\n .on('mouseup.zf.dropdownmenu touchend.zf.dropdownmenu', function(e) {\n var $link = _this.$element.find(e.target);\n if ($link.length) { return; }\n\n _this._hide();\n $body.off('mouseup.zf.dropdownmenu touchend.zf.dropdownmenu');\n });\n }\n\n /**\n * Opens a dropdown pane, and checks for collisions first.\n * @param {jQuery} $sub - ul element that is a submenu to show\n * @function\n * @private\n * @fires Dropdownmenu#show\n */\n _show($sub) {\n var idx = this.$tabs.index(this.$tabs.filter(function(i, el) {\n return $(el).find($sub).length > 0;\n }));\n var $sibs = $sub.parent('li.is-dropdown-submenu-parent').siblings('li.is-dropdown-submenu-parent');\n this._hide($sibs, idx);\n $sub.css('visibility', 'hidden').addClass('js-dropdown-active')\n .parent('li.is-dropdown-submenu-parent').addClass('is-active');\n var clear = Box.ImNotTouchingYou($sub, null, true);\n if (!clear) {\n var oldClass = this.options.alignment === 'left' ? '-right' : '-left',\n $parentLi = $sub.parent('.is-dropdown-submenu-parent');\n $parentLi.removeClass(`opens${oldClass}`).addClass(`opens-${this.options.alignment}`);\n clear = Box.ImNotTouchingYou($sub, null, true);\n if (!clear) {\n $parentLi.removeClass(`opens-${this.options.alignment}`).addClass('opens-inner');\n }\n this.changed = true;\n }\n $sub.css('visibility', '');\n if (this.options.closeOnClick) { this._addBodyHandler(); }\n /**\n * Fires when the new dropdown pane is visible.\n * @event Dropdownmenu#show\n */\n this.$element.trigger('show.zf.dropdownmenu', [$sub]);\n }\n\n /**\n * Hides a single, currently open dropdown pane, if passed a parameter, otherwise, hides everything.\n * @function\n * @param {jQuery} $elem - element with a submenu to hide\n * @param {Number} idx - index of the $tabs collection to hide\n * @private\n */\n _hide($elem, idx) {\n var $toClose;\n if ($elem && $elem.length) {\n $toClose = $elem;\n } else if (typeof idx !== 'undefined') {\n $toClose = this.$tabs.not(function(i, el) {\n return i === idx;\n });\n }\n else {\n $toClose = this.$element;\n }\n var somethingToClose = $toClose.hasClass('is-active') || $toClose.find('.is-active').length > 0;\n\n if (somethingToClose) {\n $toClose.find('li.is-active').add($toClose).attr({\n 'data-is-click': false\n }).removeClass('is-active');\n\n $toClose.find('ul.js-dropdown-active').removeClass('js-dropdown-active');\n\n if (this.changed || $toClose.find('opens-inner').length) {\n var oldClass = this.options.alignment === 'left' ? 'right' : 'left';\n $toClose.find('li.is-dropdown-submenu-parent').add($toClose)\n .removeClass(`opens-inner opens-${this.options.alignment}`)\n .addClass(`opens-${oldClass}`);\n this.changed = false;\n }\n /**\n * Fires when the open menus are closed.\n * @event Dropdownmenu#hide\n */\n this.$element.trigger('hide.zf.dropdownmenu', [$toClose]);\n }\n }\n\n /**\n * Destroys the plugin.\n * @function\n */\n _destroy() {\n this.$menuItems.off('.zf.dropdownmenu').removeAttr('data-is-click')\n .removeClass('is-right-arrow is-left-arrow is-down-arrow opens-right opens-left opens-inner');\n $(document.body).off('.zf.dropdownmenu');\n Nest.Burn(this.$element, 'dropdown');\n }\n}\n\n/**\n * Default settings for plugin\n */\nDropdownMenu.defaults = {\n /**\n * Disallows hover events from opening submenus\n * @option\n * @type {boolean}\n * @default false\n */\n disableHover: false,\n /**\n * Allow a submenu to automatically close on a mouseleave event, if not clicked open.\n * @option\n * @type {boolean}\n * @default true\n */\n autoclose: true,\n /**\n * Amount of time to delay opening a submenu on hover event.\n * @option\n * @type {number}\n * @default 50\n */\n hoverDelay: 50,\n /**\n * Allow a submenu to open/remain open on parent click event. Allows cursor to move away from menu.\n * @option\n * @type {boolean}\n * @default false\n */\n clickOpen: false,\n /**\n * Amount of time to delay closing a submenu on a mouseleave event.\n * @option\n * @type {number}\n * @default 500\n */\n\n closingTime: 500,\n /**\n * Position of the menu relative to what direction the submenus should open. Handled by JS. Can be `'auto'`, `'left'` or `'right'`.\n * @option\n * @type {string}\n * @default 'auto'\n */\n alignment: 'auto',\n /**\n * Allow clicks on the body to close any open submenus.\n * @option\n * @type {boolean}\n * @default true\n */\n closeOnClick: true,\n /**\n * Allow clicks on leaf anchor links to close any open submenus.\n * @option\n * @type {boolean}\n * @default true\n */\n closeOnClickInside: true,\n /**\n * Class applied to vertical oriented menus, Foundation default is `vertical`. Update this if using your own class.\n * @option\n * @type {string}\n * @default 'vertical'\n */\n verticalClass: 'vertical',\n /**\n * Class applied to right-side oriented menus, Foundation default is `align-right`. Update this if using your own class.\n * @option\n * @type {string}\n * @default 'align-right'\n */\n rightClass: 'align-right',\n /**\n * Boolean to force overide the clicking of links to perform default action, on second touch event for mobile.\n * @option\n * @type {boolean}\n * @default true\n */\n forceFollow: true\n};\n\nexport {DropdownMenu};\n","'use strict';\n\nimport $ from 'jquery';\nimport { MediaQuery } from './foundation.util.mediaQuery';\nimport { onImagesLoaded } from './foundation.util.imageLoader';\nimport { GetYoDigits } from './foundation.core.utils';\nimport { Plugin } from './foundation.core.plugin';\n\n/**\n * Equalizer module.\n * @module foundation.equalizer\n * @requires foundation.util.mediaQuery\n * @requires foundation.util.imageLoader if equalizer contains images\n */\n\nclass Equalizer extends Plugin {\n /**\n * Creates a new instance of Equalizer.\n * @class\n * @name Equalizer\n * @fires Equalizer#init\n * @param {Object} element - jQuery object to add the trigger to.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options){\n this.$element = element;\n this.options = $.extend({}, Equalizer.defaults, this.$element.data(), options);\n this.className = 'Equalizer'; // ie9 back compat\n\n this._init();\n }\n\n /**\n * Initializes the Equalizer plugin and calls functions to get equalizer functioning on load.\n * @private\n */\n _init() {\n var eqId = this.$element.attr('data-equalizer') || '';\n var $watched = this.$element.find(`[data-equalizer-watch=\"${eqId}\"]`);\n\n MediaQuery._init();\n\n this.$watched = $watched.length ? $watched : this.$element.find('[data-equalizer-watch]');\n this.$element.attr('data-resize', (eqId || GetYoDigits(6, 'eq')));\n this.$element.attr('data-mutate', (eqId || GetYoDigits(6, 'eq')));\n\n this.hasNested = this.$element.find('[data-equalizer]').length > 0;\n this.isNested = this.$element.parentsUntil(document.body, '[data-equalizer]').length > 0;\n this.isOn = false;\n this._bindHandler = {\n onResizeMeBound: this._onResizeMe.bind(this),\n onPostEqualizedBound: this._onPostEqualized.bind(this)\n };\n\n var imgs = this.$element.find('img');\n var tooSmall;\n if(this.options.equalizeOn){\n tooSmall = this._checkMQ();\n $(window).on('changed.zf.mediaquery', this._checkMQ.bind(this));\n }else{\n this._events();\n }\n if((typeof tooSmall !== 'undefined' && tooSmall === false) || typeof tooSmall === 'undefined'){\n if(imgs.length){\n onImagesLoaded(imgs, this._reflow.bind(this));\n }else{\n this._reflow();\n }\n }\n }\n\n /**\n * Removes event listeners if the breakpoint is too small.\n * @private\n */\n _pauseEvents() {\n this.isOn = false;\n this.$element.off({\n '.zf.equalizer': this._bindHandler.onPostEqualizedBound,\n 'resizeme.zf.trigger': this._bindHandler.onResizeMeBound,\n\t 'mutateme.zf.trigger': this._bindHandler.onResizeMeBound\n });\n }\n\n /**\n * function to handle $elements resizeme.zf.trigger, with bound this on _bindHandler.onResizeMeBound\n * @private\n */\n _onResizeMe(e) {\n this._reflow();\n }\n\n /**\n * function to handle $elements postequalized.zf.equalizer, with bound this on _bindHandler.onPostEqualizedBound\n * @private\n */\n _onPostEqualized(e) {\n if(e.target !== this.$element[0]){ this._reflow(); }\n }\n\n /**\n * Initializes events for Equalizer.\n * @private\n */\n _events() {\n var _this = this;\n this._pauseEvents();\n if(this.hasNested){\n this.$element.on('postequalized.zf.equalizer', this._bindHandler.onPostEqualizedBound);\n }else{\n this.$element.on('resizeme.zf.trigger', this._bindHandler.onResizeMeBound);\n\t this.$element.on('mutateme.zf.trigger', this._bindHandler.onResizeMeBound);\n }\n this.isOn = true;\n }\n\n /**\n * Checks the current breakpoint to the minimum required size.\n * @private\n */\n _checkMQ() {\n var tooSmall = !MediaQuery.is(this.options.equalizeOn);\n if(tooSmall){\n if(this.isOn){\n this._pauseEvents();\n this.$watched.css('height', 'auto');\n }\n }else{\n if(!this.isOn){\n this._events();\n }\n }\n return tooSmall;\n }\n\n /**\n * A noop version for the plugin\n * @private\n */\n _killswitch() {\n return;\n }\n\n /**\n * Calls necessary functions to update Equalizer upon DOM change\n * @private\n */\n _reflow() {\n if(!this.options.equalizeOnStack){\n if(this._isStacked()){\n this.$watched.css('height', 'auto');\n return false;\n }\n }\n if (this.options.equalizeByRow) {\n this.getHeightsByRow(this.applyHeightByRow.bind(this));\n }else{\n this.getHeights(this.applyHeight.bind(this));\n }\n }\n\n /**\n * Manually determines if the first 2 elements are *NOT* stacked.\n * @private\n */\n _isStacked() {\n if (!this.$watched[0] || !this.$watched[1]) {\n return true;\n }\n return this.$watched[0].getBoundingClientRect().top !== this.$watched[1].getBoundingClientRect().top;\n }\n\n /**\n * Finds the outer heights of children contained within an Equalizer parent and returns them in an array\n * @param {Function} cb - A non-optional callback to return the heights array to.\n * @returns {Array} heights - An array of heights of children within Equalizer container\n */\n getHeights(cb) {\n var heights = [];\n for(var i = 0, len = this.$watched.length; i < len; i++){\n this.$watched[i].style.height = 'auto';\n heights.push(this.$watched[i].offsetHeight);\n }\n cb(heights);\n }\n\n /**\n * Finds the outer heights of children contained within an Equalizer parent and returns them in an array\n * @param {Function} cb - A non-optional callback to return the heights array to.\n * @returns {Array} groups - An array of heights of children within Equalizer container grouped by row with element,height and max as last child\n */\n getHeightsByRow(cb) {\n var lastElTopOffset = (this.$watched.length ? this.$watched.first().offset().top : 0),\n groups = [],\n group = 0;\n //group by Row\n groups[group] = [];\n for(var i = 0, len = this.$watched.length; i < len; i++){\n this.$watched[i].style.height = 'auto';\n //maybe could use this.$watched[i].offsetTop\n var elOffsetTop = $(this.$watched[i]).offset().top;\n if (elOffsetTop!=lastElTopOffset) {\n group++;\n groups[group] = [];\n lastElTopOffset=elOffsetTop;\n }\n groups[group].push([this.$watched[i],this.$watched[i].offsetHeight]);\n }\n\n for (var j = 0, ln = groups.length; j < ln; j++) {\n var heights = $(groups[j]).map(function(){ return this[1]; }).get();\n var max = Math.max.apply(null, heights);\n groups[j].push(max);\n }\n cb(groups);\n }\n\n /**\n * Changes the CSS height property of each child in an Equalizer parent to match the tallest\n * @param {array} heights - An array of heights of children within Equalizer container\n * @fires Equalizer#preequalized\n * @fires Equalizer#postequalized\n */\n applyHeight(heights) {\n var max = Math.max.apply(null, heights);\n /**\n * Fires before the heights are applied\n * @event Equalizer#preequalized\n */\n this.$element.trigger('preequalized.zf.equalizer');\n\n this.$watched.css('height', max);\n\n /**\n * Fires when the heights have been applied\n * @event Equalizer#postequalized\n */\n this.$element.trigger('postequalized.zf.equalizer');\n }\n\n /**\n * Changes the CSS height property of each child in an Equalizer parent to match the tallest by row\n * @param {array} groups - An array of heights of children within Equalizer container grouped by row with element,height and max as last child\n * @fires Equalizer#preequalized\n * @fires Equalizer#preequalizedrow\n * @fires Equalizer#postequalizedrow\n * @fires Equalizer#postequalized\n */\n applyHeightByRow(groups) {\n /**\n * Fires before the heights are applied\n */\n this.$element.trigger('preequalized.zf.equalizer');\n for (var i = 0, len = groups.length; i < len ; i++) {\n var groupsILength = groups[i].length,\n max = groups[i][groupsILength - 1];\n if (groupsILength<=2) {\n $(groups[i][0][0]).css({'height':'auto'});\n continue;\n }\n /**\n * Fires before the heights per row are applied\n * @event Equalizer#preequalizedrow\n */\n this.$element.trigger('preequalizedrow.zf.equalizer');\n for (var j = 0, lenJ = (groupsILength-1); j < lenJ ; j++) {\n $(groups[i][j][0]).css({'height':max});\n }\n /**\n * Fires when the heights per row have been applied\n * @event Equalizer#postequalizedrow\n */\n this.$element.trigger('postequalizedrow.zf.equalizer');\n }\n /**\n * Fires when the heights have been applied\n */\n this.$element.trigger('postequalized.zf.equalizer');\n }\n\n /**\n * Destroys an instance of Equalizer.\n * @function\n */\n _destroy() {\n this._pauseEvents();\n this.$watched.css('height', 'auto');\n }\n}\n\n/**\n * Default settings for plugin\n */\nEqualizer.defaults = {\n /**\n * Enable height equalization when stacked on smaller screens.\n * @option\n * @type {boolean}\n * @default false\n */\n equalizeOnStack: false,\n /**\n * Enable height equalization row by row.\n * @option\n * @type {boolean}\n * @default false\n */\n equalizeByRow: false,\n /**\n * String representing the minimum breakpoint size the plugin should equalize heights on.\n * @option\n * @type {string}\n * @default ''\n */\n equalizeOn: ''\n};\n\nexport {Equalizer};\n","'use strict';\n\nimport $ from 'jquery';\nimport { MediaQuery } from './foundation.util.mediaQuery';\nimport { Plugin } from './foundation.core.plugin';\nimport { GetYoDigits } from './foundation.core.utils';\n\n\n/**\n * Interchange module.\n * @module foundation.interchange\n * @requires foundation.util.mediaQuery\n */\n\nclass Interchange extends Plugin {\n /**\n * Creates a new instance of Interchange.\n * @class\n * @name Interchange\n * @fires Interchange#init\n * @param {Object} element - jQuery object to add the trigger to.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, Interchange.defaults, options);\n this.rules = [];\n this.currentPath = '';\n this.className = 'Interchange'; // ie9 back compat\n\n this._init();\n this._events();\n }\n\n /**\n * Initializes the Interchange plugin and calls functions to get interchange functioning on load.\n * @function\n * @private\n */\n _init() {\n MediaQuery._init();\n\n var id = this.$element[0].id || GetYoDigits(6, 'interchange');\n this.$element.attr({\n 'data-resize': id,\n 'id': id\n });\n\n this._addBreakpoints();\n this._generateRules();\n this._reflow();\n }\n\n /**\n * Initializes events for Interchange.\n * @function\n * @private\n */\n _events() {\n this.$element.off('resizeme.zf.trigger').on('resizeme.zf.trigger', () => this._reflow());\n }\n\n /**\n * Calls necessary functions to update Interchange upon DOM change\n * @function\n * @private\n */\n _reflow() {\n var match;\n\n // Iterate through each rule, but only save the last match\n for (var i in this.rules) {\n if(this.rules.hasOwnProperty(i)) {\n var rule = this.rules[i];\n if (window.matchMedia(rule.query).matches) {\n match = rule;\n }\n }\n }\n\n if (match) {\n this.replace(match.path);\n }\n }\n\n /**\n * Gets the Foundation breakpoints and adds them to the Interchange.SPECIAL_QUERIES object.\n * @function\n * @private\n */\n _addBreakpoints() {\n for (var i in MediaQuery.queries) {\n if (MediaQuery.queries.hasOwnProperty(i)) {\n var query = MediaQuery.queries[i];\n Interchange.SPECIAL_QUERIES[query.name] = query.value;\n }\n }\n }\n\n /**\n * Checks the Interchange element for the provided media query + content pairings\n * @function\n * @private\n * @param {Object} element - jQuery object that is an Interchange instance\n * @returns {Array} scenarios - Array of objects that have 'mq' and 'path' keys with corresponding keys\n */\n _generateRules(element) {\n var rulesList = [];\n var rules;\n\n if (this.options.rules) {\n rules = this.options.rules;\n }\n else {\n rules = this.$element.data('interchange');\n }\n\n rules = typeof rules === 'string' ? rules.match(/\\[.*?, .*?\\]/g) : rules;\n\n for (var i in rules) {\n if(rules.hasOwnProperty(i)) {\n var rule = rules[i].slice(1, -1).split(', ');\n var path = rule.slice(0, -1).join('');\n var query = rule[rule.length - 1];\n\n if (Interchange.SPECIAL_QUERIES[query]) {\n query = Interchange.SPECIAL_QUERIES[query];\n }\n\n rulesList.push({\n path: path,\n query: query\n });\n }\n }\n\n this.rules = rulesList;\n }\n\n /**\n * Update the `src` property of an image, or change the HTML of a container, to the specified path.\n * @function\n * @param {String} path - Path to the image or HTML partial.\n * @fires Interchange#replaced\n */\n replace(path) {\n if (this.currentPath === path) return;\n\n var _this = this,\n trigger = 'replaced.zf.interchange';\n\n // Replacing images\n if (this.$element[0].nodeName === 'IMG') {\n this.$element.attr('src', path).on('load', function() {\n _this.currentPath = path;\n })\n .trigger(trigger);\n }\n // Replacing background images\n else if (path.match(/\\.(gif|jpg|jpeg|png|svg|tiff)([?#].*)?/i)) {\n path = path.replace(/\\(/g, '%28').replace(/\\)/g, '%29');\n this.$element.css({ 'background-image': 'url('+path+')' })\n .trigger(trigger);\n }\n // Replacing HTML\n else {\n $.get(path, function(response) {\n _this.$element.html(response)\n .trigger(trigger);\n $(response).foundation();\n _this.currentPath = path;\n });\n }\n\n /**\n * Fires when content in an Interchange element is done being loaded.\n * @event Interchange#replaced\n */\n // this.$element.trigger('replaced.zf.interchange');\n }\n\n /**\n * Destroys an instance of interchange.\n * @function\n */\n _destroy() {\n this.$element.off('resizeme.zf.trigger')\n }\n}\n\n/**\n * Default settings for plugin\n */\nInterchange.defaults = {\n /**\n * Rules to be applied to Interchange elements. Set with the `data-interchange` array notation.\n * @option\n * @type {?array}\n * @default null\n */\n rules: null\n};\n\nInterchange.SPECIAL_QUERIES = {\n 'landscape': 'screen and (orientation: landscape)',\n 'portrait': 'screen and (orientation: portrait)',\n '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)'\n};\n\nexport {Interchange};\n","'use strict';\n\n\nimport $ from 'jquery';\nimport { onLoad, GetYoDigits } from './foundation.core.utils';\nimport { Plugin } from './foundation.core.plugin';\nimport { SmoothScroll } from './foundation.smoothScroll';\n\n/**\n * Magellan module.\n * @module foundation.magellan\n * @requires foundation.smoothScroll\n */\n\nclass Magellan extends Plugin {\n /**\n * Creates a new instance of Magellan.\n * @class\n * @name Magellan\n * @fires Magellan#init\n * @param {Object} element - jQuery object to add the trigger to.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, Magellan.defaults, this.$element.data(), options);\n this.className = 'Magellan'; // ie9 back compat\n\n this._init();\n this.calcPoints();\n }\n\n /**\n * Initializes the Magellan plugin and calls functions to get equalizer functioning on load.\n * @private\n */\n _init() {\n var id = this.$element[0].id || GetYoDigits(6, 'magellan');\n var _this = this;\n this.$targets = $('[data-magellan-target]');\n this.$links = this.$element.find('a');\n this.$element.attr({\n 'data-resize': id,\n 'data-scroll': id,\n 'id': id\n });\n this.$active = $();\n this.scrollPos = parseInt(window.pageYOffset, 10);\n\n this._events();\n }\n\n /**\n * Calculates an array of pixel values that are the demarcation lines between locations on the page.\n * Can be invoked if new elements are added or the size of a location changes.\n * @function\n */\n calcPoints() {\n var _this = this,\n body = document.body,\n html = document.documentElement;\n\n this.points = [];\n this.winHeight = Math.round(Math.max(window.innerHeight, html.clientHeight));\n this.docHeight = Math.round(Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight));\n\n this.$targets.each(function(){\n var $tar = $(this),\n pt = Math.round($tar.offset().top - _this.options.threshold);\n $tar.targetPoint = pt;\n _this.points.push(pt);\n });\n }\n\n /**\n * Initializes events for Magellan.\n * @private\n */\n _events() {\n var _this = this,\n $body = $('html, body'),\n opts = {\n duration: _this.options.animationDuration,\n easing: _this.options.animationEasing\n };\n\n $(window).one('load', function(){\n if(_this.options.deepLinking){\n if(location.hash){\n _this.scrollToLoc(location.hash);\n }\n }\n _this.calcPoints();\n _this._updateActive();\n });\n\n _this.onLoadListener = onLoad($(window), function () {\n _this.$element\n .on({\n 'resizeme.zf.trigger': _this.reflow.bind(_this),\n 'scrollme.zf.trigger': _this._updateActive.bind(_this)\n })\n .on('click.zf.magellan', 'a[href^=\"#\"]', function (e) {\n e.preventDefault();\n var arrival = this.getAttribute('href');\n _this.scrollToLoc(arrival);\n });\n });\n\n this._deepLinkScroll = function(e) {\n if(_this.options.deepLinking) {\n _this.scrollToLoc(window.location.hash);\n }\n };\n\n $(window).on('hashchange', this._deepLinkScroll);\n }\n\n /**\n * Function to scroll to a given location on the page.\n * @param {String} loc - a properly formatted jQuery id selector. Example: '#foo'\n * @function\n */\n scrollToLoc(loc) {\n this._inTransition = true;\n var _this = this;\n\n var options = {\n animationEasing: this.options.animationEasing,\n animationDuration: this.options.animationDuration,\n threshold: this.options.threshold,\n offset: this.options.offset\n };\n\n SmoothScroll.scrollToLoc(loc, options, function() {\n _this._inTransition = false;\n })\n }\n\n /**\n * Calls necessary functions to update Magellan upon DOM change\n * @function\n */\n reflow() {\n this.calcPoints();\n this._updateActive();\n }\n\n /**\n * Updates the visibility of an active location link, and updates the url hash for the page, if deepLinking enabled.\n * @private\n * @function\n * @fires Magellan#update\n */\n _updateActive(/*evt, elem, scrollPos*/) {\n if(this._inTransition) return;\n\n const newScrollPos = parseInt(window.pageYOffset, 10);\n const isScrollingUp = this.scrollPos > newScrollPos;\n this.scrollPos = newScrollPos;\n\n let activeIdx;\n // Before the first point: no link\n if(newScrollPos < this.points[0]){ /* do nothing */ }\n // At the bottom of the page: last link\n else if(newScrollPos + this.winHeight === this.docHeight){ activeIdx = this.points.length - 1; }\n // Otherwhise, use the last visible link\n else{\n const visibleLinks = this.points.filter((p, i) => {\n return (p - this.options.offset - (isScrollingUp ? this.options.threshold : 0)) <= newScrollPos;\n });\n activeIdx = visibleLinks.length ? visibleLinks.length - 1 : 0;\n }\n\n // Get the new active link\n const $oldActive = this.$active;\n let activeHash = '';\n if(typeof activeIdx !== 'undefined'){\n this.$active = this.$links.filter('[href=\"#' + this.$targets.eq(activeIdx).data('magellan-target') + '\"]');\n if (this.$active.length) activeHash = this.$active[0].getAttribute('href');\n }else{\n this.$active = $();\n }\n const isNewActive = !(!this.$active.length && !$oldActive.length) && !this.$active.is($oldActive);\n const isNewHash = activeHash !== window.location.hash;\n\n // Update the active link element\n if(isNewActive) {\n $oldActive.removeClass(this.options.activeClass);\n this.$active.addClass(this.options.activeClass);\n }\n\n // Update the hash (it may have changed with the same active link)\n if(this.options.deepLinking && isNewHash){\n if(window.history.pushState){\n // Set or remove the hash (see: https://stackoverflow.com/a/5298684/4317384\n const url = activeHash ? activeHash : window.location.pathname + window.location.search;\n window.history.pushState(null, null, url);\n }else{\n window.location.hash = activeHash;\n }\n }\n\n if (isNewActive) {\n /**\n * Fires when magellan is finished updating to the new active element.\n * @event Magellan#update\n */\n \tthis.$element.trigger('update.zf.magellan', [this.$active]);\n\t }\n }\n\n /**\n * Destroys an instance of Magellan and resets the url of the window.\n * @function\n */\n _destroy() {\n this.$element.off('.zf.trigger .zf.magellan')\n .find(`.${this.options.activeClass}`).removeClass(this.options.activeClass);\n\n if(this.options.deepLinking){\n var hash = this.$active[0].getAttribute('href');\n window.location.hash.replace(hash, '');\n }\n\n $(window).off('hashchange', this._deepLinkScroll)\n if (this.onLoadListener) $(window).off(this.onLoadListener);\n }\n}\n\n/**\n * Default settings for plugin\n */\nMagellan.defaults = {\n /**\n * Amount of time, in ms, the animated scrolling should take between locations.\n * @option\n * @type {number}\n * @default 500\n */\n animationDuration: 500,\n /**\n * Animation style to use when scrolling between locations. Can be `'swing'` or `'linear'`.\n * @option\n * @type {string}\n * @default 'linear'\n * @see {@link https://api.jquery.com/animate|Jquery animate}\n */\n animationEasing: 'linear',\n /**\n * Number of pixels to use as a marker for location changes.\n * @option\n * @type {number}\n * @default 50\n */\n threshold: 50,\n /**\n * Class applied to the active locations link on the magellan container.\n * @option\n * @type {string}\n * @default 'is-active'\n */\n activeClass: 'is-active',\n /**\n * Allows the script to manipulate the url of the current page, and if supported, alter the history.\n * @option\n * @type {boolean}\n * @default false\n */\n deepLinking: false,\n /**\n * Number of pixels to offset the scroll of the page on item click if using a sticky nav bar.\n * @option\n * @type {number}\n * @default 0\n */\n offset: 0\n}\n\nexport {Magellan};\n","'use strict';\n\nimport $ from 'jquery';\nimport { onLoad, transitionend, RegExpEscape } from './foundation.core.utils';\nimport { Keyboard } from './foundation.util.keyboard';\nimport { MediaQuery } from './foundation.util.mediaQuery';\nimport { Plugin } from './foundation.core.plugin';\n\nimport { Triggers } from './foundation.util.triggers';\n\n/**\n * OffCanvas module.\n * @module foundation.offcanvas\n * @requires foundation.util.keyboard\n * @requires foundation.util.mediaQuery\n * @requires foundation.util.triggers\n */\n\nclass OffCanvas extends Plugin {\n /**\n * Creates a new instance of an off-canvas wrapper.\n * @class\n * @name OffCanvas\n * @fires OffCanvas#init\n * @param {Object} element - jQuery object to initialize.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.className = 'OffCanvas'; // ie9 back compat\n this.$element = element;\n this.options = $.extend({}, OffCanvas.defaults, this.$element.data(), options);\n this.contentClasses = { base: [], reveal: [] };\n this.$lastTrigger = $();\n this.$triggers = $();\n this.position = 'left';\n this.$content = $();\n this.nested = !!(this.options.nested);\n\n // Defines the CSS transition/position classes of the off-canvas content container.\n $(['push', 'overlap']).each((index, val) => {\n this.contentClasses.base.push('has-transition-'+val);\n });\n $(['left', 'right', 'top', 'bottom']).each((index, val) => {\n this.contentClasses.base.push('has-position-'+val);\n this.contentClasses.reveal.push('has-reveal-'+val);\n });\n\n // Triggers init is idempotent, just need to make sure it is initialized\n Triggers.init($);\n MediaQuery._init();\n\n this._init();\n this._events();\n\n Keyboard.register('OffCanvas', {\n 'ESCAPE': 'close'\n });\n\n }\n\n /**\n * Initializes the off-canvas wrapper by adding the exit overlay (if needed).\n * @function\n * @private\n */\n _init() {\n var id = this.$element.attr('id');\n\n this.$element.attr('aria-hidden', 'true');\n\n // Find off-canvas content, either by ID (if specified), by siblings or by closest selector (fallback)\n if (this.options.contentId) {\n this.$content = $('#'+this.options.contentId);\n } else if (this.$element.siblings('[data-off-canvas-content]').length) {\n this.$content = this.$element.siblings('[data-off-canvas-content]').first();\n } else {\n this.$content = this.$element.closest('[data-off-canvas-content]').first();\n }\n\n if (!this.options.contentId) {\n // Assume that the off-canvas element is nested if it isn't a sibling of the content\n this.nested = this.$element.siblings('[data-off-canvas-content]').length === 0;\n\n } else if (this.options.contentId && this.options.nested === null) {\n // Warning if using content ID without setting the nested option\n // Once the element is nested it is required to work properly in this case\n console.warn('Remember to use the nested option if using the content ID option!');\n }\n\n if (this.nested === true) {\n // Force transition overlap if nested\n this.options.transition = 'overlap';\n // Remove appropriate classes if already assigned in markup\n this.$element.removeClass('is-transition-push');\n }\n\n this.$element.addClass(`is-transition-${this.options.transition} is-closed`);\n\n // Find triggers that affect this element and add aria-expanded to them\n this.$triggers = $(document)\n .find('[data-open=\"'+id+'\"], [data-close=\"'+id+'\"], [data-toggle=\"'+id+'\"]')\n .attr('aria-expanded', 'false')\n .attr('aria-controls', id);\n\n // Get position by checking for related CSS class\n 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;\n\n // Add an overlay over the content if necessary\n if (this.options.contentOverlay === true) {\n var overlay = document.createElement('div');\n var overlayPosition = $(this.$element).css(\"position\") === 'fixed' ? 'is-overlay-fixed' : 'is-overlay-absolute';\n overlay.setAttribute('class', 'js-off-canvas-overlay ' + overlayPosition);\n this.$overlay = $(overlay);\n if(overlayPosition === 'is-overlay-fixed') {\n $(this.$overlay).insertAfter(this.$element);\n } else {\n this.$content.append(this.$overlay);\n }\n }\n\n // Get the revealOn option from the class.\n var revealOnRegExp = new RegExp(RegExpEscape(this.options.revealClass) + '([^\\\\s]+)', 'g');\n var revealOnClass = revealOnRegExp.exec(this.$element[0].className);\n if (revealOnClass) {\n this.options.isRevealed = true;\n this.options.revealOn = this.options.revealOn || revealOnClass[1];\n }\n\n // Ensure the `reveal-on-*` class is set.\n if (this.options.isRevealed === true && this.options.revealOn) {\n this.$element.first().addClass(`${this.options.revealClass}${this.options.revealOn}`);\n this._setMQChecker();\n }\n\n if (this.options.transitionTime) {\n this.$element.css('transition-duration', this.options.transitionTime);\n }\n\n // Initally remove all transition/position CSS classes from off-canvas content container.\n this._removeContentClasses();\n }\n\n /**\n * Adds event handlers to the off-canvas wrapper and the exit overlay.\n * @function\n * @private\n */\n _events() {\n this.$element.off('.zf.trigger .zf.offcanvas').on({\n 'open.zf.trigger': this.open.bind(this),\n 'close.zf.trigger': this.close.bind(this),\n 'toggle.zf.trigger': this.toggle.bind(this),\n 'keydown.zf.offcanvas': this._handleKeyboard.bind(this)\n });\n\n if (this.options.closeOnClick === true) {\n var $target = this.options.contentOverlay ? this.$overlay : this.$content;\n $target.on({'click.zf.offcanvas': this.close.bind(this)});\n }\n }\n\n /**\n * Applies event listener for elements that will reveal at certain breakpoints.\n * @private\n */\n _setMQChecker() {\n var _this = this;\n\n this.onLoadListener = onLoad($(window), function () {\n if (MediaQuery.atLeast(_this.options.revealOn)) {\n _this.reveal(true);\n }\n });\n\n $(window).on('changed.zf.mediaquery', function () {\n if (MediaQuery.atLeast(_this.options.revealOn)) {\n _this.reveal(true);\n } else {\n _this.reveal(false);\n }\n });\n }\n\n /**\n * Removes the CSS transition/position classes of the off-canvas content container.\n * Removing the classes is important when another off-canvas gets opened that uses the same content container.\n * @param {Boolean} hasReveal - true if related off-canvas element is revealed.\n * @private\n */\n _removeContentClasses(hasReveal) {\n if (typeof hasReveal !== 'boolean') {\n this.$content.removeClass(this.contentClasses.base.join(' '));\n } else if (hasReveal === false) {\n this.$content.removeClass(`has-reveal-${this.position}`);\n }\n }\n\n /**\n * Adds the CSS transition/position classes of the off-canvas content container, based on the opening off-canvas element.\n * Beforehand any transition/position class gets removed.\n * @param {Boolean} hasReveal - true if related off-canvas element is revealed.\n * @private\n */\n _addContentClasses(hasReveal) {\n this._removeContentClasses(hasReveal);\n if (typeof hasReveal !== 'boolean') {\n this.$content.addClass(`has-transition-${this.options.transition} has-position-${this.position}`);\n } else if (hasReveal === true) {\n this.$content.addClass(`has-reveal-${this.position}`);\n }\n }\n\n /**\n * Handles the revealing/hiding the off-canvas at breakpoints, not the same as open.\n * @param {Boolean} isRevealed - true if element should be revealed.\n * @function\n */\n reveal(isRevealed) {\n if (isRevealed) {\n this.close();\n this.isRevealed = true;\n this.$element.attr('aria-hidden', 'false');\n this.$element.off('open.zf.trigger toggle.zf.trigger');\n this.$element.removeClass('is-closed');\n } else {\n this.isRevealed = false;\n this.$element.attr('aria-hidden', 'true');\n this.$element.off('open.zf.trigger toggle.zf.trigger').on({\n 'open.zf.trigger': this.open.bind(this),\n 'toggle.zf.trigger': this.toggle.bind(this)\n });\n this.$element.addClass('is-closed');\n }\n this._addContentClasses(isRevealed);\n }\n\n /**\n * Stops scrolling of the body when offcanvas is open on mobile Safari and other troublesome browsers.\n * @private\n */\n _stopScrolling(event) {\n return false;\n }\n\n // Taken and adapted from http://stackoverflow.com/questions/16889447/prevent-full-page-scrolling-ios\n // Only really works for y, not sure how to extend to x or if we need to.\n _recordScrollable(event) {\n let elem = this; // called from event handler context with this as elem\n\n // If the element is scrollable (content overflows), then...\n if (elem.scrollHeight !== elem.clientHeight) {\n // If we're at the top, scroll down one pixel to allow scrolling up\n if (elem.scrollTop === 0) {\n elem.scrollTop = 1;\n }\n // If we're at the bottom, scroll up one pixel to allow scrolling down\n if (elem.scrollTop === elem.scrollHeight - elem.clientHeight) {\n elem.scrollTop = elem.scrollHeight - elem.clientHeight - 1;\n }\n }\n elem.allowUp = elem.scrollTop > 0;\n elem.allowDown = elem.scrollTop < (elem.scrollHeight - elem.clientHeight);\n elem.lastY = event.originalEvent.pageY;\n }\n\n _stopScrollPropagation(event) {\n let elem = this; // called from event handler context with this as elem\n let up = event.pageY < elem.lastY;\n let down = !up;\n elem.lastY = event.pageY;\n\n if((up && elem.allowUp) || (down && elem.allowDown)) {\n event.stopPropagation();\n } else {\n event.preventDefault();\n }\n }\n\n /**\n * Opens the off-canvas menu.\n * @function\n * @param {Object} event - Event object passed from listener.\n * @param {jQuery} trigger - element that triggered the off-canvas to open.\n * @fires Offcanvas#opened\n * @todo also trigger 'open' event?\n */\n open(event, trigger) {\n if (this.$element.hasClass('is-open') || this.isRevealed) { return; }\n var _this = this;\n\n if (trigger) {\n this.$lastTrigger = trigger;\n }\n\n if (this.options.forceTo === 'top') {\n window.scrollTo(0, 0);\n } else if (this.options.forceTo === 'bottom') {\n window.scrollTo(0,document.body.scrollHeight);\n }\n\n if (this.options.transitionTime && this.options.transition !== 'overlap') {\n this.$element.siblings('[data-off-canvas-content]').css('transition-duration', this.options.transitionTime);\n } else {\n this.$element.siblings('[data-off-canvas-content]').css('transition-duration', '');\n }\n\n this.$element.addClass('is-open').removeClass('is-closed');\n\n this.$triggers.attr('aria-expanded', 'true');\n this.$element.attr('aria-hidden', 'false');\n\n this.$content.addClass('is-open-' + this.position);\n\n // If `contentScroll` is set to false, add class and disable scrolling on touch devices.\n if (this.options.contentScroll === false) {\n $('body').addClass('is-off-canvas-open').on('touchmove', this._stopScrolling);\n this.$element.on('touchstart', this._recordScrollable);\n this.$element.on('touchmove', this._stopScrollPropagation);\n }\n\n if (this.options.contentOverlay === true) {\n this.$overlay.addClass('is-visible');\n }\n\n if (this.options.closeOnClick === true && this.options.contentOverlay === true) {\n this.$overlay.addClass('is-closable');\n }\n\n if (this.options.autoFocus === true) {\n this.$element.one(transitionend(this.$element), function() {\n if (!_this.$element.hasClass('is-open')) {\n return; // exit if prematurely closed\n }\n var canvasFocus = _this.$element.find('[data-autofocus]');\n if (canvasFocus.length) {\n canvasFocus.eq(0).focus();\n } else {\n _this.$element.find('a, button').eq(0).focus();\n }\n });\n }\n\n if (this.options.trapFocus === true) {\n this.$content.attr('tabindex', '-1');\n Keyboard.trapFocus(this.$element);\n }\n\n this._addContentClasses();\n\n /**\n * Fires when the off-canvas menu opens.\n * @event Offcanvas#opened\n */\n this.$element.trigger('opened.zf.offcanvas');\n }\n\n /**\n * Closes the off-canvas menu.\n * @function\n * @param {Function} cb - optional cb to fire after closure.\n * @fires Offcanvas#closed\n */\n close(cb) {\n if (!this.$element.hasClass('is-open') || this.isRevealed) { return; }\n\n var _this = this;\n\n this.$element.removeClass('is-open');\n\n this.$element.attr('aria-hidden', 'true')\n /**\n * Fires when the off-canvas menu opens.\n * @event Offcanvas#closed\n */\n .trigger('closed.zf.offcanvas');\n\n this.$content.removeClass('is-open-left is-open-top is-open-right is-open-bottom');\n\n // If `contentScroll` is set to false, remove class and re-enable scrolling on touch devices.\n if (this.options.contentScroll === false) {\n $('body').removeClass('is-off-canvas-open').off('touchmove', this._stopScrolling);\n this.$element.off('touchstart', this._recordScrollable);\n this.$element.off('touchmove', this._stopScrollPropagation);\n }\n\n if (this.options.contentOverlay === true) {\n this.$overlay.removeClass('is-visible');\n }\n\n if (this.options.closeOnClick === true && this.options.contentOverlay === true) {\n this.$overlay.removeClass('is-closable');\n }\n\n this.$triggers.attr('aria-expanded', 'false');\n\n if (this.options.trapFocus === true) {\n this.$content.removeAttr('tabindex');\n Keyboard.releaseFocus(this.$element);\n }\n\n // Listen to transitionEnd and add class when done.\n this.$element.one(transitionend(this.$element), function(e) {\n _this.$element.addClass('is-closed');\n _this._removeContentClasses();\n });\n }\n\n /**\n * Toggles the off-canvas menu open or closed.\n * @function\n * @param {Object} event - Event object passed from listener.\n * @param {jQuery} trigger - element that triggered the off-canvas to open.\n */\n toggle(event, trigger) {\n if (this.$element.hasClass('is-open')) {\n this.close(event, trigger);\n }\n else {\n this.open(event, trigger);\n }\n }\n\n /**\n * 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.\n * @function\n * @private\n */\n _handleKeyboard(e) {\n Keyboard.handleKey(e, 'OffCanvas', {\n close: () => {\n this.close();\n this.$lastTrigger.focus();\n return true;\n },\n handled: () => {\n e.stopPropagation();\n e.preventDefault();\n }\n });\n }\n\n /**\n * Destroys the offcanvas plugin.\n * @function\n */\n _destroy() {\n this.close();\n this.$element.off('.zf.trigger .zf.offcanvas');\n this.$overlay.off('.zf.offcanvas');\n if (this.onLoadListener) $(window).off(this.onLoadListener);\n }\n}\n\nOffCanvas.defaults = {\n /**\n * Allow the user to click outside of the menu to close it.\n * @option\n * @type {boolean}\n * @default true\n */\n closeOnClick: true,\n\n /**\n * Adds an overlay on top of `[data-off-canvas-content]`.\n * @option\n * @type {boolean}\n * @default true\n */\n contentOverlay: true,\n\n /**\n * Target an off-canvas content container by ID that may be placed anywhere. If null the closest content container will be taken.\n * @option\n * @type {?string}\n * @default null\n */\n contentId: null,\n\n /**\n * Define the off-canvas element is nested in an off-canvas content. This is required when using the contentId option for a nested element.\n * @option\n * @type {boolean}\n * @default null\n */\n nested: null,\n\n /**\n * Enable/disable scrolling of the main content when an off canvas panel is open.\n * @option\n * @type {boolean}\n * @default true\n */\n contentScroll: true,\n\n /**\n * Amount of time in ms the open and close transition requires. If none selected, pulls from body style.\n * @option\n * @type {number}\n * @default null\n */\n transitionTime: null,\n\n /**\n * Type of transition for the offcanvas menu. Options are 'push', 'detached' or 'slide'.\n * @option\n * @type {string}\n * @default push\n */\n transition: 'push',\n\n /**\n * Force the page to scroll to top or bottom on open.\n * @option\n * @type {?string}\n * @default null\n */\n forceTo: null,\n\n /**\n * Allow the offcanvas to remain open for certain breakpoints.\n * @option\n * @type {boolean}\n * @default false\n */\n isRevealed: false,\n\n /**\n * Breakpoint at which to reveal. JS will use a RegExp to target standard classes, if changing classnames, pass your class with the `revealClass` option.\n * @option\n * @type {?string}\n * @default null\n */\n revealOn: null,\n\n /**\n * Force focus to the offcanvas on open. If true, will focus the opening trigger on close.\n * @option\n * @type {boolean}\n * @default true\n */\n autoFocus: true,\n\n /**\n * Class used to force an offcanvas to remain open. Foundation defaults for this are `reveal-for-large` & `reveal-for-medium`.\n * @option\n * @type {string}\n * @default reveal-for-\n * @todo improve the regex testing for this.\n */\n revealClass: 'reveal-for-',\n\n /**\n * Triggers optional focus trapping when opening an offcanvas. Sets tabindex of [data-off-canvas-content] to -1 for accessibility purposes.\n * @option\n * @type {boolean}\n * @default false\n */\n trapFocus: false\n}\n\nexport {OffCanvas};\n","'use strict';\n\nimport $ from 'jquery';\nimport { Keyboard } from './foundation.util.keyboard';\nimport { Motion } from './foundation.util.motion';\nimport { Timer } from './foundation.util.timer';\nimport { onImagesLoaded } from './foundation.util.imageLoader';\nimport { GetYoDigits } from './foundation.core.utils';\nimport { Plugin } from './foundation.core.plugin';\nimport { Touch } from './foundation.util.touch'\n\n\n/**\n * Orbit module.\n * @module foundation.orbit\n * @requires foundation.util.keyboard\n * @requires foundation.util.motion\n * @requires foundation.util.timer\n * @requires foundation.util.imageLoader\n * @requires foundation.util.touch\n */\n\nclass Orbit extends Plugin {\n /**\n * Creates a new instance of an orbit carousel.\n * @class\n * @name Orbit\n * @param {jQuery} element - jQuery object to make into an Orbit Carousel.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options){\n this.$element = element;\n this.options = $.extend({}, Orbit.defaults, this.$element.data(), options);\n this.className = 'Orbit'; // ie9 back compat\n\n Touch.init($); // Touch init is idempotent, we just need to make sure it's initialied.\n\n this._init();\n\n Keyboard.register('Orbit', {\n 'ltr': {\n 'ARROW_RIGHT': 'next',\n 'ARROW_LEFT': 'previous'\n },\n 'rtl': {\n 'ARROW_LEFT': 'next',\n 'ARROW_RIGHT': 'previous'\n }\n });\n }\n\n /**\n * Initializes the plugin by creating jQuery collections, setting attributes, and starting the animation.\n * @function\n * @private\n */\n _init() {\n // @TODO: consider discussion on PR #9278 about DOM pollution by changeSlide\n this._reset();\n\n this.$wrapper = this.$element.find(`.${this.options.containerClass}`);\n this.$slides = this.$element.find(`.${this.options.slideClass}`);\n\n var $images = this.$element.find('img'),\n initActive = this.$slides.filter('.is-active'),\n id = this.$element[0].id || GetYoDigits(6, 'orbit');\n\n this.$element.attr({\n 'data-resize': id,\n 'id': id\n });\n\n if (!initActive.length) {\n this.$slides.eq(0).addClass('is-active');\n }\n\n if (!this.options.useMUI) {\n this.$slides.addClass('no-motionui');\n }\n\n if ($images.length) {\n onImagesLoaded($images, this._prepareForOrbit.bind(this));\n } else {\n this._prepareForOrbit();//hehe\n }\n\n if (this.options.bullets) {\n this._loadBullets();\n }\n\n this._events();\n\n if (this.options.autoPlay && this.$slides.length > 1) {\n this.geoSync();\n }\n\n if (this.options.accessible) { // allow wrapper to be focusable to enable arrow navigation\n this.$wrapper.attr('tabindex', 0);\n }\n }\n\n /**\n * Creates a jQuery collection of bullets, if they are being used.\n * @function\n * @private\n */\n _loadBullets() {\n this.$bullets = this.$element.find(`.${this.options.boxOfBullets}`).find('button');\n }\n\n /**\n * Sets a `timer` object on the orbit, and starts the counter for the next slide.\n * @function\n */\n geoSync() {\n var _this = this;\n this.timer = new Timer(\n this.$element,\n {\n duration: this.options.timerDelay,\n infinite: false\n },\n function() {\n _this.changeSlide(true);\n });\n this.timer.start();\n }\n\n /**\n * Sets wrapper and slide heights for the orbit.\n * @function\n * @private\n */\n _prepareForOrbit() {\n var _this = this;\n this._setWrapperHeight();\n }\n\n /**\n * Calulates the height of each slide in the collection, and uses the tallest one for the wrapper height.\n * @function\n * @private\n * @param {Function} cb - a callback function to fire when complete.\n */\n _setWrapperHeight(cb) {//rewrite this to `for` loop\n var max = 0, temp, counter = 0, _this = this;\n\n this.$slides.each(function() {\n temp = this.getBoundingClientRect().height;\n $(this).attr('data-slide', counter);\n\n // hide all slides but the active one\n if (!/mui/g.test($(this)[0].className) && _this.$slides.filter('.is-active')[0] !== _this.$slides.eq(counter)[0]) {\n $(this).css({'display': 'none'});\n }\n max = temp > max ? temp : max;\n counter++;\n });\n\n if (counter === this.$slides.length) {\n this.$wrapper.css({'height': max}); //only change the wrapper height property once.\n if(cb) {cb(max);} //fire callback with max height dimension.\n }\n }\n\n /**\n * Sets the max-height of each slide.\n * @function\n * @private\n */\n _setSlideHeight(height) {\n this.$slides.each(function() {\n $(this).css('max-height', height);\n });\n }\n\n /**\n * Adds event listeners to basically everything within the element.\n * @function\n * @private\n */\n _events() {\n var _this = this;\n\n //***************************************\n //**Now using custom event - thanks to:**\n //** Yohai Ararat of Toronto **\n //***************************************\n //\n this.$element.off('.resizeme.zf.trigger').on({\n 'resizeme.zf.trigger': this._prepareForOrbit.bind(this)\n })\n if (this.$slides.length > 1) {\n\n if (this.options.swipe) {\n this.$slides.off('swipeleft.zf.orbit swiperight.zf.orbit')\n .on('swipeleft.zf.orbit', function(e){\n e.preventDefault();\n _this.changeSlide(true);\n }).on('swiperight.zf.orbit', function(e){\n e.preventDefault();\n _this.changeSlide(false);\n });\n }\n //***************************************\n\n if (this.options.autoPlay) {\n this.$slides.on('click.zf.orbit', function() {\n _this.$element.data('clickedOn', _this.$element.data('clickedOn') ? false : true);\n _this.timer[_this.$element.data('clickedOn') ? 'pause' : 'start']();\n });\n\n if (this.options.pauseOnHover) {\n this.$element.on('mouseenter.zf.orbit', function() {\n _this.timer.pause();\n }).on('mouseleave.zf.orbit', function() {\n if (!_this.$element.data('clickedOn')) {\n _this.timer.start();\n }\n });\n }\n }\n\n if (this.options.navButtons) {\n var $controls = this.$element.find(`.${this.options.nextClass}, .${this.options.prevClass}`);\n $controls.attr('tabindex', 0)\n //also need to handle enter/return and spacebar key presses\n .on('click.zf.orbit touchend.zf.orbit', function(e){\n\t e.preventDefault();\n _this.changeSlide($(this).hasClass(_this.options.nextClass));\n });\n }\n\n if (this.options.bullets) {\n this.$bullets.on('click.zf.orbit touchend.zf.orbit', function() {\n if (/is-active/g.test(this.className)) { return false; }//if this is active, kick out of function.\n var idx = $(this).data('slide'),\n ltr = idx > _this.$slides.filter('.is-active').data('slide'),\n $slide = _this.$slides.eq(idx);\n\n _this.changeSlide(ltr, $slide, idx);\n });\n }\n\n if (this.options.accessible) {\n this.$wrapper.add(this.$bullets).on('keydown.zf.orbit', function(e) {\n // handle keyboard event with keyboard util\n Keyboard.handleKey(e, 'Orbit', {\n next: function() {\n _this.changeSlide(true);\n },\n previous: function() {\n _this.changeSlide(false);\n },\n handled: function() { // if bullet is focused, make sure focus moves\n if ($(e.target).is(_this.$bullets)) {\n _this.$bullets.filter('.is-active').focus();\n }\n }\n });\n });\n }\n }\n }\n\n /**\n * Resets Orbit so it can be reinitialized\n */\n _reset() {\n // Don't do anything if there are no slides (first run)\n if (typeof this.$slides == 'undefined') {\n return;\n }\n\n if (this.$slides.length > 1) {\n // Remove old events\n this.$element.off('.zf.orbit').find('*').off('.zf.orbit')\n\n // Restart timer if autoPlay is enabled\n if (this.options.autoPlay) {\n this.timer.restart();\n }\n\n // Reset all sliddes\n this.$slides.each(function(el) {\n $(el).removeClass('is-active is-active is-in')\n .removeAttr('aria-live')\n .hide();\n });\n\n // Show the first slide\n this.$slides.first().addClass('is-active').show();\n\n // Triggers when the slide has finished animating\n this.$element.trigger('slidechange.zf.orbit', [this.$slides.first()]);\n\n // Select first bullet if bullets are present\n if (this.options.bullets) {\n this._updateBullets(0);\n }\n }\n }\n\n /**\n * Changes the current slide to a new one.\n * @function\n * @param {Boolean} isLTR - if true the slide moves from right to left, if false the slide moves from left to right.\n * @param {jQuery} chosenSlide - the jQuery element of the slide to show next, if one is selected.\n * @param {Number} idx - the index of the new slide in its collection, if one chosen.\n * @fires Orbit#slidechange\n */\n changeSlide(isLTR, chosenSlide, idx) {\n if (!this.$slides) {return; } // Don't freak out if we're in the middle of cleanup\n var $curSlide = this.$slides.filter('.is-active').eq(0);\n\n if (/mui/g.test($curSlide[0].className)) { return false; } //if the slide is currently animating, kick out of the function\n\n var $firstSlide = this.$slides.first(),\n $lastSlide = this.$slides.last(),\n dirIn = isLTR ? 'Right' : 'Left',\n dirOut = isLTR ? 'Left' : 'Right',\n _this = this,\n $newSlide;\n\n if (!chosenSlide) { //most of the time, this will be auto played or clicked from the navButtons.\n $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!!!!!\n (this.options.infiniteWrap ? $curSlide.next(`.${this.options.slideClass}`).length ? $curSlide.next(`.${this.options.slideClass}`) : $firstSlide : $curSlide.next(`.${this.options.slideClass}`))//pick next slide if moving left to right\n :\n (this.options.infiniteWrap ? $curSlide.prev(`.${this.options.slideClass}`).length ? $curSlide.prev(`.${this.options.slideClass}`) : $lastSlide : $curSlide.prev(`.${this.options.slideClass}`));//pick prev slide if moving right to left\n } else {\n $newSlide = chosenSlide;\n }\n\n if ($newSlide.length) {\n /**\n * Triggers before the next slide starts animating in and only if a next slide has been found.\n * @event Orbit#beforeslidechange\n */\n this.$element.trigger('beforeslidechange.zf.orbit', [$curSlide, $newSlide]);\n\n if (this.options.bullets) {\n idx = idx || this.$slides.index($newSlide); //grab index to update bullets\n this._updateBullets(idx);\n }\n\n if (this.options.useMUI && !this.$element.is(':hidden')) {\n Motion.animateIn(\n $newSlide.addClass('is-active'),\n this.options[`animInFrom${dirIn}`],\n function(){\n $newSlide.css({'display': 'block'}).attr('aria-live', 'polite');\n });\n\n Motion.animateOut(\n $curSlide.removeClass('is-active'),\n this.options[`animOutTo${dirOut}`],\n function(){\n $curSlide.removeAttr('aria-live');\n if(_this.options.autoPlay && !_this.timer.isPaused){\n _this.timer.restart();\n }\n //do stuff?\n });\n } else {\n $curSlide.removeClass('is-active is-in').removeAttr('aria-live').hide();\n $newSlide.addClass('is-active is-in').attr('aria-live', 'polite').show();\n if (this.options.autoPlay && !this.timer.isPaused) {\n this.timer.restart();\n }\n }\n /**\n * Triggers when the slide has finished animating in.\n * @event Orbit#slidechange\n */\n this.$element.trigger('slidechange.zf.orbit', [$newSlide]);\n }\n }\n\n /**\n * Updates the active state of the bullets, if displayed.\n * @function\n * @private\n * @param {Number} idx - the index of the current slide.\n */\n _updateBullets(idx) {\n var $oldBullet = this.$element.find(`.${this.options.boxOfBullets}`)\n .find('.is-active').removeClass('is-active').blur(),\n span = $oldBullet.find('span:last').detach(),\n $newBullet = this.$bullets.eq(idx).addClass('is-active').append(span);\n }\n\n /**\n * Destroys the carousel and hides the element.\n * @function\n */\n _destroy() {\n this.$element.off('.zf.orbit').find('*').off('.zf.orbit').end().hide();\n }\n}\n\nOrbit.defaults = {\n /**\n * Tells the JS to look for and loadBullets.\n * @option\n * @type {boolean}\n * @default true\n */\n bullets: true,\n /**\n * Tells the JS to apply event listeners to nav buttons\n * @option\n * @type {boolean}\n * @default true\n */\n navButtons: true,\n /**\n * motion-ui animation class to apply\n * @option\n * @type {string}\n * @default 'slide-in-right'\n */\n animInFromRight: 'slide-in-right',\n /**\n * motion-ui animation class to apply\n * @option\n * @type {string}\n * @default 'slide-out-right'\n */\n animOutToRight: 'slide-out-right',\n /**\n * motion-ui animation class to apply\n * @option\n * @type {string}\n * @default 'slide-in-left'\n *\n */\n animInFromLeft: 'slide-in-left',\n /**\n * motion-ui animation class to apply\n * @option\n * @type {string}\n * @default 'slide-out-left'\n */\n animOutToLeft: 'slide-out-left',\n /**\n * Allows Orbit to automatically animate on page load.\n * @option\n * @type {boolean}\n * @default true\n */\n autoPlay: true,\n /**\n * Amount of time, in ms, between slide transitions\n * @option\n * @type {number}\n * @default 5000\n */\n timerDelay: 5000,\n /**\n * Allows Orbit to infinitely loop through the slides\n * @option\n * @type {boolean}\n * @default true\n */\n infiniteWrap: true,\n /**\n * Allows the Orbit slides to bind to swipe events for mobile, requires an additional util library\n * @option\n * @type {boolean}\n * @default true\n */\n swipe: true,\n /**\n * Allows the timing function to pause animation on hover.\n * @option\n * @type {boolean}\n * @default true\n */\n pauseOnHover: true,\n /**\n * Allows Orbit to bind keyboard events to the slider, to animate frames with arrow keys\n * @option\n * @type {boolean}\n * @default true\n */\n accessible: true,\n /**\n * Class applied to the container of Orbit\n * @option\n * @type {string}\n * @default 'orbit-container'\n */\n containerClass: 'orbit-container',\n /**\n * Class applied to individual slides.\n * @option\n * @type {string}\n * @default 'orbit-slide'\n */\n slideClass: 'orbit-slide',\n /**\n * Class applied to the bullet container. You're welcome.\n * @option\n * @type {string}\n * @default 'orbit-bullets'\n */\n boxOfBullets: 'orbit-bullets',\n /**\n * Class applied to the `next` navigation button.\n * @option\n * @type {string}\n * @default 'orbit-next'\n */\n nextClass: 'orbit-next',\n /**\n * Class applied to the `previous` navigation button.\n * @option\n * @type {string}\n * @default 'orbit-previous'\n */\n prevClass: 'orbit-previous',\n /**\n * Boolean to flag the js to use motion ui classes or not. Default to true for backwards compatibility.\n * @option\n * @type {boolean}\n * @default true\n */\n useMUI: true\n};\n\nexport {Orbit};\n","'use strict';\n\nimport { Box } from './foundation.util.box';\nimport { Plugin } from './foundation.core.plugin';\nimport { rtl as Rtl } from './foundation.core.utils';\n\nconst POSITIONS = ['left', 'right', 'top', 'bottom'];\nconst VERTICAL_ALIGNMENTS = ['top', 'bottom', 'center'];\nconst HORIZONTAL_ALIGNMENTS = ['left', 'right', 'center'];\n\nconst ALIGNMENTS = {\n 'left': VERTICAL_ALIGNMENTS,\n 'right': VERTICAL_ALIGNMENTS,\n 'top': HORIZONTAL_ALIGNMENTS,\n 'bottom': HORIZONTAL_ALIGNMENTS\n}\n\nfunction nextItem(item, array) {\n var currentIdx = array.indexOf(item);\n if(currentIdx === array.length - 1) {\n return array[0];\n } else {\n return array[currentIdx + 1];\n }\n}\n\n\nclass Positionable extends Plugin {\n /**\n * Abstract class encapsulating the tether-like explicit positioning logic\n * including repositioning based on overlap.\n * Expects classes to define defaults for vOffset, hOffset, position,\n * alignment, allowOverlap, and allowBottomOverlap. They can do this by\n * extending the defaults, or (for now recommended due to the way docs are\n * generated) by explicitly declaring them.\n *\n **/\n\n _init() {\n this.triedPositions = {};\n this.position = this.options.position === 'auto' ? this._getDefaultPosition() : this.options.position;\n this.alignment = this.options.alignment === 'auto' ? this._getDefaultAlignment() : this.options.alignment;\n this.originalPosition = this.position;\n this.originalAlignment = this.alignment;\n }\n\n _getDefaultPosition () {\n return 'bottom';\n }\n\n _getDefaultAlignment() {\n switch(this.position) {\n case 'bottom':\n case 'top':\n return Rtl() ? 'right' : 'left';\n case 'left':\n case 'right':\n return 'bottom';\n }\n }\n\n /**\n * Adjusts the positionable possible positions by iterating through alignments\n * and positions.\n * @function\n * @private\n */\n _reposition() {\n if(this._alignmentsExhausted(this.position)) {\n this.position = nextItem(this.position, POSITIONS);\n this.alignment = ALIGNMENTS[this.position][0];\n } else {\n this._realign();\n }\n }\n\n /**\n * Adjusts the dropdown pane possible positions by iterating through alignments\n * on the current position.\n * @function\n * @private\n */\n _realign() {\n this._addTriedPosition(this.position, this.alignment)\n this.alignment = nextItem(this.alignment, ALIGNMENTS[this.position])\n }\n\n _addTriedPosition(position, alignment) {\n this.triedPositions[position] = this.triedPositions[position] || []\n this.triedPositions[position].push(alignment);\n }\n\n _positionsExhausted() {\n var isExhausted = true;\n for(var i = 0; i < POSITIONS.length; i++) {\n isExhausted = isExhausted && this._alignmentsExhausted(POSITIONS[i]);\n }\n return isExhausted;\n }\n\n _alignmentsExhausted(position) {\n return this.triedPositions[position] && this.triedPositions[position].length == ALIGNMENTS[position].length;\n }\n\n\n // When we're trying to center, we don't want to apply offset that's going to\n // take us just off center, so wrap around to return 0 for the appropriate\n // offset in those alignments. TODO: Figure out if we want to make this\n // configurable behavior... it feels more intuitive, especially for tooltips, but\n // it's possible someone might actually want to start from center and then nudge\n // slightly off.\n _getVOffset() {\n return this.options.vOffset;\n }\n\n _getHOffset() {\n return this.options.hOffset;\n }\n\n\n _setPosition($anchor, $element, $parent) {\n if($anchor.attr('aria-expanded') === 'false'){ return false; }\n var $eleDims = Box.GetDimensions($element),\n $anchorDims = Box.GetDimensions($anchor);\n\n\n if (!this.options.allowOverlap) {\n // restore original position & alignment before checking overlap\n this.position = this.originalPosition;\n this.alignment = this.originalAlignment;\n }\n\n $element.offset(Box.GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset()));\n\n if(!this.options.allowOverlap) {\n var overlaps = {};\n var minOverlap = 100000000;\n // default coordinates to how we start, in case we can't figure out better\n var minCoordinates = {position: this.position, alignment: this.alignment};\n while(!this._positionsExhausted()) {\n let overlap = Box.OverlapArea($element, $parent, false, false, this.options.allowBottomOverlap);\n if(overlap === 0) {\n return;\n }\n\n if(overlap < minOverlap) {\n minOverlap = overlap;\n minCoordinates = {position: this.position, alignment: this.alignment};\n }\n\n this._reposition();\n\n $element.offset(Box.GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset()));\n }\n // If we get through the entire loop, there was no non-overlapping\n // position available. Pick the version with least overlap.\n this.position = minCoordinates.position;\n this.alignment = minCoordinates.alignment;\n $element.offset(Box.GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset()));\n }\n }\n\n}\n\nPositionable.defaults = {\n /**\n * Position of positionable relative to anchor. Can be left, right, bottom, top, or auto.\n * @option\n * @type {string}\n * @default 'auto'\n */\n position: 'auto',\n /**\n * Alignment of positionable relative to anchor. Can be left, right, bottom, top, center, or auto.\n * @option\n * @type {string}\n * @default 'auto'\n */\n alignment: 'auto',\n /**\n * Allow overlap of container/window. If false, dropdown positionable first\n * try to position as defined by data-position and data-alignment, but\n * reposition if it would cause an overflow.\n * @option\n * @type {boolean}\n * @default false\n */\n allowOverlap: false,\n /**\n * Allow overlap of only the bottom of the container. This is the most common\n * behavior for dropdowns, allowing the dropdown to extend the bottom of the\n * screen but not otherwise influence or break out of the container.\n * @option\n * @type {boolean}\n * @default true\n */\n allowBottomOverlap: true,\n /**\n * Number of pixels the positionable should be separated vertically from anchor\n * @option\n * @type {number}\n * @default 0\n */\n vOffset: 0,\n /**\n * Number of pixels the positionable should be separated horizontally from anchor\n * @option\n * @type {number}\n * @default 0\n */\n hOffset: 0,\n}\n\nexport {Positionable};\n","'use strict';\n\nimport $ from 'jquery';\nimport { MediaQuery } from './foundation.util.mediaQuery';\nimport { GetYoDigits } from './foundation.core.utils';\nimport { Plugin }from './foundation.core.plugin';\n\nimport { Accordion } from './foundation.accordion';\nimport { Tabs } from './foundation.tabs';\n\n// The plugin matches the plugin classes with these plugin instances.\nvar MenuPlugins = {\n tabs: {\n cssClass: 'tabs',\n plugin: Tabs\n },\n accordion: {\n cssClass: 'accordion',\n plugin: Accordion\n }\n};\n\n\n/**\n * ResponsiveAccordionTabs module.\n * @module foundation.responsiveAccordionTabs\n * @requires foundation.util.motion\n * @requires foundation.accordion\n * @requires foundation.tabs\n */\n\nclass ResponsiveAccordionTabs extends Plugin{\n /**\n * Creates a new instance of a responsive accordion tabs.\n * @class\n * @name ResponsiveAccordionTabs\n * @fires ResponsiveAccordionTabs#init\n * @param {jQuery} element - jQuery object to make into Responsive Accordion Tabs.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = $(element);\n this.options = $.extend({}, this.$element.data(), options);\n this.rules = this.$element.data('responsive-accordion-tabs');\n this.currentMq = null;\n this.currentPlugin = null;\n this.className = 'ResponsiveAccordionTabs'; // ie9 back compat\n if (!this.$element.attr('id')) {\n this.$element.attr('id',GetYoDigits(6, 'responsiveaccordiontabs'));\n };\n\n this._init();\n this._events();\n }\n\n /**\n * Initializes the Menu by parsing the classes from the 'data-responsive-accordion-tabs' attribute on the element.\n * @function\n * @private\n */\n _init() {\n MediaQuery._init();\n\n // The first time an Interchange plugin is initialized, this.rules is converted from a string of \"classes\" to an object of rules\n if (typeof this.rules === 'string') {\n let rulesTree = {};\n\n // Parse rules from \"classes\" pulled from data attribute\n let rules = this.rules.split(' ');\n\n // Iterate through every rule found\n for (let i = 0; i < rules.length; i++) {\n let rule = rules[i].split('-');\n let ruleSize = rule.length > 1 ? rule[0] : 'small';\n let rulePlugin = rule.length > 1 ? rule[1] : rule[0];\n\n if (MenuPlugins[rulePlugin] !== null) {\n rulesTree[ruleSize] = MenuPlugins[rulePlugin];\n }\n }\n\n this.rules = rulesTree;\n }\n\n this._getAllOptions();\n\n if (!$.isEmptyObject(this.rules)) {\n this._checkMediaQueries();\n }\n }\n\n _getAllOptions() {\n //get all defaults and options\n var _this = this;\n _this.allOptions = {};\n for (var key in MenuPlugins) {\n if (MenuPlugins.hasOwnProperty(key)) {\n var obj = MenuPlugins[key];\n try {\n var dummyPlugin = $('<ul></ul>');\n var tmpPlugin = new obj.plugin(dummyPlugin,_this.options);\n for (var keyKey in tmpPlugin.options) {\n if (tmpPlugin.options.hasOwnProperty(keyKey) && keyKey !== 'zfPlugin') {\n var objObj = tmpPlugin.options[keyKey];\n _this.allOptions[keyKey] = objObj;\n }\n }\n tmpPlugin.destroy();\n }\n catch(e) {\n }\n }\n }\n }\n\n /**\n * Initializes events for the Menu.\n * @function\n * @private\n */\n _events() {\n this._changedZfMediaQueryHandler = this._checkMediaQueries.bind(this);\n $(window).on('changed.zf.mediaquery', this._changedZfMediaQueryHandler);\n }\n\n /**\n * 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.\n * @function\n * @private\n */\n _checkMediaQueries() {\n var matchedMq, _this = this;\n // Iterate through each rule and find the last matching rule\n $.each(this.rules, function(key) {\n if (MediaQuery.atLeast(key)) {\n matchedMq = key;\n }\n });\n\n // No match? No dice\n if (!matchedMq) return;\n\n // Plugin already initialized? We good\n if (this.currentPlugin instanceof this.rules[matchedMq].plugin) return;\n\n // Remove existing plugin-specific CSS classes\n $.each(MenuPlugins, function(key, value) {\n _this.$element.removeClass(value.cssClass);\n });\n\n // Add the CSS class for the new plugin\n this.$element.addClass(this.rules[matchedMq].cssClass);\n\n // Create an instance of the new plugin\n if (this.currentPlugin) {\n //don't know why but on nested elements data zfPlugin get's lost\n if (!this.currentPlugin.$element.data('zfPlugin') && this.storezfData) this.currentPlugin.$element.data('zfPlugin',this.storezfData);\n this.currentPlugin.destroy();\n }\n this._handleMarkup(this.rules[matchedMq].cssClass);\n this.currentPlugin = new this.rules[matchedMq].plugin(this.$element, {});\n this.storezfData = this.currentPlugin.$element.data('zfPlugin');\n\n }\n\n _handleMarkup(toSet){\n var _this = this, fromString = 'accordion';\n var $panels = $('[data-tabs-content='+this.$element.attr('id')+']');\n if ($panels.length) fromString = 'tabs';\n if (fromString === toSet) {\n return;\n };\n\n var tabsTitle = _this.allOptions.linkClass?_this.allOptions.linkClass:'tabs-title';\n var tabsPanel = _this.allOptions.panelClass?_this.allOptions.panelClass:'tabs-panel';\n\n this.$element.removeAttr('role');\n var $liHeads = this.$element.children('.'+tabsTitle+',[data-accordion-item]').removeClass(tabsTitle).removeClass('accordion-item').removeAttr('data-accordion-item');\n var $liHeadsA = $liHeads.children('a').removeClass('accordion-title');\n\n if (fromString === 'tabs') {\n $panels = $panels.children('.'+tabsPanel).removeClass(tabsPanel).removeAttr('role').removeAttr('aria-hidden').removeAttr('aria-labelledby');\n $panels.children('a').removeAttr('role').removeAttr('aria-controls').removeAttr('aria-selected');\n }else{\n $panels = $liHeads.children('[data-tab-content]').removeClass('accordion-content');\n };\n\n $panels.css({display:'',visibility:''});\n $liHeads.css({display:'',visibility:''});\n if (toSet === 'accordion') {\n $panels.each(function(key,value){\n $(value).appendTo($liHeads.get(key)).addClass('accordion-content').attr('data-tab-content','').removeClass('is-active').css({height:''});\n $('[data-tabs-content='+_this.$element.attr('id')+']').after('<div id=\"tabs-placeholder-'+_this.$element.attr('id')+'\"></div>').detach();\n $liHeads.addClass('accordion-item').attr('data-accordion-item','');\n $liHeadsA.addClass('accordion-title');\n });\n }else if (toSet === 'tabs'){\n var $tabsContent = $('[data-tabs-content='+_this.$element.attr('id')+']');\n var $placeholder = $('#tabs-placeholder-'+_this.$element.attr('id'));\n if ($placeholder.length) {\n $tabsContent = $('<div class=\"tabs-content\"></div>').insertAfter($placeholder).attr('data-tabs-content',_this.$element.attr('id'));\n $placeholder.remove();\n }else{\n $tabsContent = $('<div class=\"tabs-content\"></div>').insertAfter(_this.$element).attr('data-tabs-content',_this.$element.attr('id'));\n };\n $panels.each(function(key,value){\n var tempValue = $(value).appendTo($tabsContent).addClass(tabsPanel);\n var hash = $liHeadsA.get(key).hash.slice(1);\n var id = $(value).attr('id') || GetYoDigits(6, 'accordion');\n if (hash !== id) {\n if (hash !== '') {\n $(value).attr('id',hash);\n }else{\n hash = id;\n $(value).attr('id',hash);\n $($liHeadsA.get(key)).attr('href',$($liHeadsA.get(key)).attr('href').replace('#','')+'#'+hash);\n };\n };\n var isActive = $($liHeads.get(key)).hasClass('is-active');\n if (isActive) {\n tempValue.addClass('is-active');\n };\n });\n $liHeads.addClass(tabsTitle);\n };\n }\n\n /**\n * Destroys the instance of the current plugin on this element, as well as the window resize handler that switches the plugins out.\n * @function\n */\n _destroy() {\n if (this.currentPlugin) this.currentPlugin.destroy();\n $(window).off('changed.zf.mediaquery', this._changedZfMediaQueryHandler);\n }\n}\n\nResponsiveAccordionTabs.defaults = {};\n\nexport {ResponsiveAccordionTabs};\n","'use strict';\n\nimport $ from 'jquery';\n\nimport { MediaQuery } from './foundation.util.mediaQuery';\nimport { GetYoDigits } from './foundation.core.utils';\nimport { Plugin } from './foundation.core.plugin';\n\nimport { DropdownMenu } from './foundation.dropdownMenu';\nimport { Drilldown } from './foundation.drilldown';\nimport { AccordionMenu } from './foundation.accordionMenu';\n\nlet MenuPlugins = {\n dropdown: {\n cssClass: 'dropdown',\n plugin: DropdownMenu\n },\n drilldown: {\n cssClass: 'drilldown',\n plugin: Drilldown\n },\n accordion: {\n cssClass: 'accordion-menu',\n plugin: AccordionMenu\n }\n};\n\n // import \"foundation.util.triggers.js\";\n\n\n/**\n * ResponsiveMenu module.\n * @module foundation.responsiveMenu\n * @requires foundation.util.triggers\n * @requires foundation.util.mediaQuery\n */\n\nclass ResponsiveMenu extends Plugin {\n /**\n * Creates a new instance of a responsive menu.\n * @class\n * @name ResponsiveMenu\n * @fires ResponsiveMenu#init\n * @param {jQuery} element - jQuery object to make into a dropdown menu.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = $(element);\n this.rules = this.$element.data('responsive-menu');\n this.currentMq = null;\n this.currentPlugin = null;\n this.className = 'ResponsiveMenu'; // ie9 back compat\n\n this._init();\n this._events();\n }\n\n /**\n * Initializes the Menu by parsing the classes from the 'data-ResponsiveMenu' attribute on the element.\n * @function\n * @private\n */\n _init() {\n\n MediaQuery._init();\n // The first time an Interchange plugin is initialized, this.rules is converted from a string of \"classes\" to an object of rules\n if (typeof this.rules === 'string') {\n let rulesTree = {};\n\n // Parse rules from \"classes\" pulled from data attribute\n let rules = this.rules.split(' ');\n\n // Iterate through every rule found\n for (let i = 0; i < rules.length; i++) {\n let rule = rules[i].split('-');\n let ruleSize = rule.length > 1 ? rule[0] : 'small';\n let rulePlugin = rule.length > 1 ? rule[1] : rule[0];\n\n if (MenuPlugins[rulePlugin] !== null) {\n rulesTree[ruleSize] = MenuPlugins[rulePlugin];\n }\n }\n\n this.rules = rulesTree;\n }\n\n if (!$.isEmptyObject(this.rules)) {\n this._checkMediaQueries();\n }\n // Add data-mutate since children may need it.\n this.$element.attr('data-mutate', (this.$element.attr('data-mutate') || GetYoDigits(6, 'responsive-menu')));\n }\n\n /**\n * Initializes events for the Menu.\n * @function\n * @private\n */\n _events() {\n var _this = this;\n\n $(window).on('changed.zf.mediaquery', function() {\n _this._checkMediaQueries();\n });\n // $(window).on('resize.zf.ResponsiveMenu', function() {\n // _this._checkMediaQueries();\n // });\n }\n\n /**\n * 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.\n * @function\n * @private\n */\n _checkMediaQueries() {\n var matchedMq, _this = this;\n // Iterate through each rule and find the last matching rule\n $.each(this.rules, function(key) {\n if (MediaQuery.atLeast(key)) {\n matchedMq = key;\n }\n });\n\n // No match? No dice\n if (!matchedMq) return;\n\n // Plugin already initialized? We good\n if (this.currentPlugin instanceof this.rules[matchedMq].plugin) return;\n\n // Remove existing plugin-specific CSS classes\n $.each(MenuPlugins, function(key, value) {\n _this.$element.removeClass(value.cssClass);\n });\n\n // Add the CSS class for the new plugin\n this.$element.addClass(this.rules[matchedMq].cssClass);\n\n // Create an instance of the new plugin\n if (this.currentPlugin) this.currentPlugin.destroy();\n this.currentPlugin = new this.rules[matchedMq].plugin(this.$element, {});\n }\n\n /**\n * Destroys the instance of the current plugin on this element, as well as the window resize handler that switches the plugins out.\n * @function\n */\n _destroy() {\n this.currentPlugin.destroy();\n $(window).off('.zf.ResponsiveMenu');\n }\n}\n\nResponsiveMenu.defaults = {};\n\nexport {ResponsiveMenu};\n","'use strict';\n\nimport $ from 'jquery';\n\nimport { MediaQuery } from './foundation.util.mediaQuery';\nimport { Motion } from './foundation.util.motion';\nimport { Plugin } from './foundation.core.plugin';\n\n/**\n * ResponsiveToggle module.\n * @module foundation.responsiveToggle\n * @requires foundation.util.mediaQuery\n * @requires foundation.util.motion\n */\n\nclass ResponsiveToggle extends Plugin {\n /**\n * Creates a new instance of Tab Bar.\n * @class\n * @name ResponsiveToggle\n * @fires ResponsiveToggle#init\n * @param {jQuery} element - jQuery object to attach tab bar functionality to.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = $(element);\n this.options = $.extend({}, ResponsiveToggle.defaults, this.$element.data(), options);\n this.className = 'ResponsiveToggle'; // ie9 back compat\n\n this._init();\n this._events();\n }\n\n /**\n * Initializes the tab bar by finding the target element, toggling element, and running update().\n * @function\n * @private\n */\n _init() {\n MediaQuery._init();\n var targetID = this.$element.data('responsive-toggle');\n if (!targetID) {\n console.error('Your tab bar needs an ID of a Menu as the value of data-tab-bar.');\n }\n\n this.$targetMenu = $(`#${targetID}`);\n this.$toggler = this.$element.find('[data-toggle]').filter(function() {\n var target = $(this).data('toggle');\n return (target === targetID || target === \"\");\n });\n this.options = $.extend({}, this.options, this.$targetMenu.data());\n\n // If they were set, parse the animation classes\n if(this.options.animate) {\n let input = this.options.animate.split(' ');\n\n this.animationIn = input[0];\n this.animationOut = input[1] || null;\n }\n\n this._update();\n }\n\n /**\n * Adds necessary event handlers for the tab bar to work.\n * @function\n * @private\n */\n _events() {\n var _this = this;\n\n this._updateMqHandler = this._update.bind(this);\n\n $(window).on('changed.zf.mediaquery', this._updateMqHandler);\n\n this.$toggler.on('click.zf.responsiveToggle', this.toggleMenu.bind(this));\n }\n\n /**\n * Checks the current media query to determine if the tab bar should be visible or hidden.\n * @function\n * @private\n */\n _update() {\n // Mobile\n if (!MediaQuery.atLeast(this.options.hideFor)) {\n this.$element.show();\n this.$targetMenu.hide();\n }\n\n // Desktop\n else {\n this.$element.hide();\n this.$targetMenu.show();\n }\n }\n\n /**\n * Toggles the element attached to the tab bar. The toggle only happens if the screen is small enough to allow it.\n * @function\n * @fires ResponsiveToggle#toggled\n */\n toggleMenu() {\n if (!MediaQuery.atLeast(this.options.hideFor)) {\n /**\n * Fires when the element attached to the tab bar toggles.\n * @event ResponsiveToggle#toggled\n */\n if(this.options.animate) {\n if (this.$targetMenu.is(':hidden')) {\n Motion.animateIn(this.$targetMenu, this.animationIn, () => {\n this.$element.trigger('toggled.zf.responsiveToggle');\n this.$targetMenu.find('[data-mutate]').triggerHandler('mutateme.zf.trigger');\n });\n }\n else {\n Motion.animateOut(this.$targetMenu, this.animationOut, () => {\n this.$element.trigger('toggled.zf.responsiveToggle');\n });\n }\n }\n else {\n this.$targetMenu.toggle(0);\n this.$targetMenu.find('[data-mutate]').trigger('mutateme.zf.trigger');\n this.$element.trigger('toggled.zf.responsiveToggle');\n }\n }\n };\n\n _destroy() {\n this.$element.off('.zf.responsiveToggle');\n this.$toggler.off('.zf.responsiveToggle');\n\n $(window).off('changed.zf.mediaquery', this._updateMqHandler);\n }\n}\n\nResponsiveToggle.defaults = {\n /**\n * The breakpoint after which the menu is always shown, and the tab bar is hidden.\n * @option\n * @type {string}\n * @default 'medium'\n */\n hideFor: 'medium',\n\n /**\n * To decide if the toggle should be animated or not.\n * @option\n * @type {boolean}\n * @default false\n */\n animate: false\n};\n\nexport { ResponsiveToggle };\n","'use strict';\n\nimport $ from 'jquery';\nimport { onLoad } from './foundation.core.utils';\nimport { Keyboard } from './foundation.util.keyboard';\nimport { MediaQuery } from './foundation.util.mediaQuery';\nimport { Motion } from './foundation.util.motion';\nimport { Plugin } from './foundation.core.plugin';\nimport { Triggers } from './foundation.util.triggers';\n\n/**\n * Reveal module.\n * @module foundation.reveal\n * @requires foundation.util.keyboard\n * @requires foundation.util.triggers\n * @requires foundation.util.mediaQuery\n * @requires foundation.util.motion if using animations\n */\n\nclass Reveal extends Plugin {\n /**\n * Creates a new instance of Reveal.\n * @class\n * @name Reveal\n * @param {jQuery} element - jQuery object to use for the modal.\n * @param {Object} options - optional parameters.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, Reveal.defaults, this.$element.data(), options);\n this.className = 'Reveal'; // ie9 back compat\n this._init();\n\n // Triggers init is idempotent, just need to make sure it is initialized\n Triggers.init($);\n\n Keyboard.register('Reveal', {\n 'ESCAPE': 'close',\n });\n }\n\n /**\n * Initializes the modal by adding the overlay and close buttons, (if selected).\n * @private\n */\n _init() {\n MediaQuery._init();\n this.id = this.$element.attr('id');\n this.isActive = false;\n this.cached = {mq: MediaQuery.current};\n\n this.$anchor = $(`[data-open=\"${this.id}\"]`).length ? $(`[data-open=\"${this.id}\"]`) : $(`[data-toggle=\"${this.id}\"]`);\n this.$anchor.attr({\n 'aria-controls': this.id,\n 'aria-haspopup': true,\n 'tabindex': 0\n });\n\n if (this.options.fullScreen || this.$element.hasClass('full')) {\n this.options.fullScreen = true;\n this.options.overlay = false;\n }\n if (this.options.overlay && !this.$overlay) {\n this.$overlay = this._makeOverlay(this.id);\n }\n\n this.$element.attr({\n 'role': 'dialog',\n 'aria-hidden': true,\n 'data-yeti-box': this.id,\n 'data-resize': this.id\n });\n\n if(this.$overlay) {\n this.$element.detach().appendTo(this.$overlay);\n } else {\n this.$element.detach().appendTo($(this.options.appendTo));\n this.$element.addClass('without-overlay');\n }\n this._events();\n if (this.options.deepLink && window.location.hash === ( `#${this.id}`)) {\n this.onLoadListener = onLoad($(window), () => this.open());\n }\n }\n\n /**\n * Creates an overlay div to display behind the modal.\n * @private\n */\n _makeOverlay() {\n var additionalOverlayClasses = '';\n\n if (this.options.additionalOverlayClasses) {\n additionalOverlayClasses = ' ' + this.options.additionalOverlayClasses;\n }\n\n return $('<div></div>')\n .addClass('reveal-overlay' + additionalOverlayClasses)\n .appendTo(this.options.appendTo);\n }\n\n /**\n * Updates position of modal\n * TODO: Figure out if we actually need to cache these values or if it doesn't matter\n * @private\n */\n _updatePosition() {\n var width = this.$element.outerWidth();\n var outerWidth = $(window).width();\n var height = this.$element.outerHeight();\n var outerHeight = $(window).height();\n var left, top = null;\n if (this.options.hOffset === 'auto') {\n left = parseInt((outerWidth - width) / 2, 10);\n } else {\n left = parseInt(this.options.hOffset, 10);\n }\n if (this.options.vOffset === 'auto') {\n if (height > outerHeight) {\n top = parseInt(Math.min(100, outerHeight / 10), 10);\n } else {\n top = parseInt((outerHeight - height) / 4, 10);\n }\n } else if (this.options.vOffset !== null) {\n top = parseInt(this.options.vOffset, 10);\n }\n\n if (top !== null) {\n this.$element.css({top: top + 'px'});\n }\n\n // only worry about left if we don't have an overlay or we have a horizontal offset,\n // otherwise we're perfectly in the middle\n if (!this.$overlay || (this.options.hOffset !== 'auto')) {\n this.$element.css({left: left + 'px'});\n this.$element.css({margin: '0px'});\n }\n\n }\n\n /**\n * Adds event handlers for the modal.\n * @private\n */\n _events() {\n var _this = this;\n\n this.$element.on({\n 'open.zf.trigger': this.open.bind(this),\n 'close.zf.trigger': (event, $element) => {\n if ((event.target === _this.$element[0]) ||\n ($(event.target).parents('[data-closable]')[0] === $element)) { // only close reveal when it's explicitly called\n return this.close.apply(this);\n }\n },\n 'toggle.zf.trigger': this.toggle.bind(this),\n 'resizeme.zf.trigger': function() {\n _this._updatePosition();\n }\n });\n\n if (this.options.closeOnClick && this.options.overlay) {\n this.$overlay.off('.zf.reveal').on('click.zf.reveal', function(e) {\n if (e.target === _this.$element[0] ||\n $.contains(_this.$element[0], e.target) ||\n !$.contains(document, e.target)) {\n return;\n }\n _this.close();\n });\n }\n if (this.options.deepLink) {\n $(window).on(`hashchange.zf.reveal:${this.id}`, this._handleState.bind(this));\n }\n }\n\n /**\n * Handles modal methods on back/forward button clicks or any other event that triggers hashchange.\n * @private\n */\n _handleState(e) {\n if(window.location.hash === ( '#' + this.id) && !this.isActive){ this.open(); }\n else{ this.close(); }\n }\n\n /**\n * Disables the scroll when Reveal is shown to prevent the background from shifting\n * @param {number} scrollTop - Scroll to visually apply, window current scroll by default\n */\n _disableScroll(scrollTop) {\n scrollTop = scrollTop || $(window).scrollTop();\n if ($(document).height() > $(window).height()) {\n $(\"html\")\n .css(\"top\", -scrollTop);\n }\n }\n\n /**\n * Reenables the scroll when Reveal closes\n * @param {number} scrollTop - Scroll to restore, html \"top\" property by default (as set by `_disableScroll`)\n */\n _enableScroll(scrollTop) {\n scrollTop = scrollTop || parseInt($(\"html\").css(\"top\"));\n if ($(document).height() > $(window).height()) {\n $(\"html\")\n .css(\"top\", \"\");\n $(window).scrollTop(-scrollTop);\n }\n }\n\n\n /**\n * Opens the modal controlled by `this.$anchor`, and closes all others by default.\n * @function\n * @fires Reveal#closeme\n * @fires Reveal#open\n */\n open() {\n // either update or replace browser history\n const hash = `#${this.id}`;\n if (this.options.deepLink && window.location.hash !== hash) {\n\n if (window.history.pushState) {\n if (this.options.updateHistory) {\n window.history.pushState({}, '', hash);\n } else {\n window.history.replaceState({}, '', hash);\n }\n } else {\n window.location.hash = hash;\n }\n }\n\n // Remember anchor that opened it to set focus back later, have general anchors as fallback\n this.$activeAnchor = $(document.activeElement).is(this.$anchor) ? $(document.activeElement) : this.$anchor;\n\n this.isActive = true;\n\n // Make elements invisible, but remove display: none so we can get size and positioning\n this.$element\n .css({ 'visibility': 'hidden' })\n .show()\n .scrollTop(0);\n if (this.options.overlay) {\n this.$overlay.css({'visibility': 'hidden'}).show();\n }\n\n this._updatePosition();\n\n this.$element\n .hide()\n .css({ 'visibility': '' });\n\n if(this.$overlay) {\n this.$overlay.css({'visibility': ''}).hide();\n if(this.$element.hasClass('fast')) {\n this.$overlay.addClass('fast');\n } else if (this.$element.hasClass('slow')) {\n this.$overlay.addClass('slow');\n }\n }\n\n\n if (!this.options.multipleOpened) {\n /**\n * Fires immediately before the modal opens.\n * Closes any other modals that are currently open\n * @event Reveal#closeme\n */\n this.$element.trigger('closeme.zf.reveal', this.id);\n }\n\n this._disableScroll();\n\n var _this = this;\n\n // Motion UI method of reveal\n if (this.options.animationIn) {\n function afterAnimation(){\n _this.$element\n .attr({\n 'aria-hidden': false,\n 'tabindex': -1\n })\n .focus();\n _this._addGlobalClasses();\n Keyboard.trapFocus(_this.$element);\n }\n if (this.options.overlay) {\n Motion.animateIn(this.$overlay, 'fade-in');\n }\n Motion.animateIn(this.$element, this.options.animationIn, () => {\n if(this.$element) { // protect against object having been removed\n this.focusableElements = Keyboard.findFocusable(this.$element);\n afterAnimation();\n }\n });\n }\n // jQuery method of reveal\n else {\n if (this.options.overlay) {\n this.$overlay.show(0);\n }\n this.$element.show(this.options.showDelay);\n }\n\n // handle accessibility\n this.$element\n .attr({\n 'aria-hidden': false,\n 'tabindex': -1\n })\n .focus();\n Keyboard.trapFocus(this.$element);\n\n this._addGlobalClasses();\n\n this._addGlobalListeners();\n\n /**\n * Fires when the modal has successfully opened.\n * @event Reveal#open\n */\n this.$element.trigger('open.zf.reveal');\n }\n\n /**\n * Adds classes and listeners on document required by open modals.\n *\n * The following classes are added and updated:\n * - `.is-reveal-open` - Prevents the scroll on document\n * - `.zf-has-scroll` - Displays a disabled scrollbar on document if required like if the\n * scroll was not disabled. This prevent a \"shift\" of the page content due\n * the scrollbar disappearing when the modal opens.\n *\n * @private\n */\n _addGlobalClasses() {\n const updateScrollbarClass = () => {\n $('html').toggleClass('zf-has-scroll', !!($(document).height() > $(window).height()));\n };\n\n this.$element.on('resizeme.zf.trigger.revealScrollbarListener', () => updateScrollbarClass());\n updateScrollbarClass();\n $('html').addClass('is-reveal-open');\n }\n\n /**\n * Removes classes and listeners on document that were required by open modals.\n * @private\n */\n _removeGlobalClasses() {\n this.$element.off('resizeme.zf.trigger.revealScrollbarListener');\n $('html').removeClass('is-reveal-open');\n $('html').removeClass('zf-has-scroll');\n }\n\n /**\n * Adds extra event handlers for the body and window if necessary.\n * @private\n */\n _addGlobalListeners() {\n var _this = this;\n if(!this.$element) { return; } // If we're in the middle of cleanup, don't freak out\n this.focusableElements = Keyboard.findFocusable(this.$element);\n\n if (!this.options.overlay && this.options.closeOnClick && !this.options.fullScreen) {\n $('body').on('click.zf.reveal', function(e) {\n if (e.target === _this.$element[0] ||\n $.contains(_this.$element[0], e.target) ||\n !$.contains(document, e.target)) { return; }\n _this.close();\n });\n }\n\n if (this.options.closeOnEsc) {\n $(window).on('keydown.zf.reveal', function(e) {\n Keyboard.handleKey(e, 'Reveal', {\n close: function() {\n if (_this.options.closeOnEsc) {\n _this.close();\n }\n }\n });\n });\n }\n }\n\n /**\n * Closes the modal.\n * @function\n * @fires Reveal#closed\n */\n close() {\n if (!this.isActive || !this.$element.is(':visible')) {\n return false;\n }\n var _this = this;\n\n // Motion UI method of hiding\n if (this.options.animationOut) {\n if (this.options.overlay) {\n Motion.animateOut(this.$overlay, 'fade-out');\n }\n\n Motion.animateOut(this.$element, this.options.animationOut, finishUp);\n }\n // jQuery method of hiding\n else {\n this.$element.hide(this.options.hideDelay);\n\n if (this.options.overlay) {\n this.$overlay.hide(0, finishUp);\n }\n else {\n finishUp();\n }\n }\n\n // Conditionals to remove extra event listeners added on open\n if (this.options.closeOnEsc) {\n $(window).off('keydown.zf.reveal');\n }\n\n if (!this.options.overlay && this.options.closeOnClick) {\n $('body').off('click.zf.reveal');\n }\n\n this.$element.off('keydown.zf.reveal');\n\n function finishUp() {\n\n // Get the current top before the modal is closed and restore the scroll after.\n // TODO: use component properties instead of HTML properties\n // See https://github.com/zurb/foundation-sites/pull/10786\n var scrollTop = parseInt($(\"html\").css(\"top\"));\n\n if ($('.reveal:visible').length === 0) {\n _this._removeGlobalClasses(); // also remove .is-reveal-open from the html element when there is no opened reveal\n }\n\n Keyboard.releaseFocus(_this.$element);\n\n _this.$element.attr('aria-hidden', true);\n\n _this._enableScroll(scrollTop);\n\n /**\n * Fires when the modal is done closing.\n * @event Reveal#closed\n */\n _this.$element.trigger('closed.zf.reveal');\n }\n\n /**\n * Resets the modal content\n * This prevents a running video to keep going in the background\n */\n if (this.options.resetOnClose) {\n this.$element.html(this.$element.html());\n }\n\n this.isActive = false;\n // If deepLink and we did not switched to an other modal...\n if (_this.options.deepLink && window.location.hash === `#${this.id}`) {\n // Remove the history hash\n if (window.history.replaceState) {\n const urlWithoutHash = window.location.pathname + window.location.search;\n if (this.options.updateHistory) {\n window.history.pushState({}, '', urlWithoutHash); // remove the hash\n } else {\n window.history.replaceState('', document.title, urlWithoutHash);\n }\n } else {\n window.location.hash = '';\n }\n }\n\n this.$activeAnchor.focus();\n }\n\n /**\n * Toggles the open/closed state of a modal.\n * @function\n */\n toggle() {\n if (this.isActive) {\n this.close();\n } else {\n this.open();\n }\n };\n\n /**\n * Destroys an instance of a modal.\n * @function\n */\n _destroy() {\n if (this.options.overlay) {\n this.$element.appendTo($(this.options.appendTo)); // move $element outside of $overlay to prevent error unregisterPlugin()\n this.$overlay.hide().off().remove();\n }\n this.$element.hide().off();\n this.$anchor.off('.zf');\n $(window).off(`.zf.reveal:${this.id}`)\n if (this.onLoadListener) $(window).off(this.onLoadListener);\n\n if ($('.reveal:visible').length === 0) {\n this._removeGlobalClasses(); // also remove .is-reveal-open from the html element when there is no opened reveal\n }\n };\n}\n\nReveal.defaults = {\n /**\n * Motion-UI class to use for animated elements. If none used, defaults to simple show/hide.\n * @option\n * @type {string}\n * @default ''\n */\n animationIn: '',\n /**\n * Motion-UI class to use for animated elements. If none used, defaults to simple show/hide.\n * @option\n * @type {string}\n * @default ''\n */\n animationOut: '',\n /**\n * Time, in ms, to delay the opening of a modal after a click if no animation used.\n * @option\n * @type {number}\n * @default 0\n */\n showDelay: 0,\n /**\n * Time, in ms, to delay the closing of a modal after a click if no animation used.\n * @option\n * @type {number}\n * @default 0\n */\n hideDelay: 0,\n /**\n * Allows a click on the body/overlay to close the modal.\n * @option\n * @type {boolean}\n * @default true\n */\n closeOnClick: true,\n /**\n * Allows the modal to close if the user presses the `ESCAPE` key.\n * @option\n * @type {boolean}\n * @default true\n */\n closeOnEsc: true,\n /**\n * If true, allows multiple modals to be displayed at once.\n * @option\n * @type {boolean}\n * @default false\n */\n multipleOpened: false,\n /**\n * Distance, in pixels, the modal should push down from the top of the screen.\n * @option\n * @type {number|string}\n * @default auto\n */\n vOffset: 'auto',\n /**\n * Distance, in pixels, the modal should push in from the side of the screen.\n * @option\n * @type {number|string}\n * @default auto\n */\n hOffset: 'auto',\n /**\n * Allows the modal to be fullscreen, completely blocking out the rest of the view. JS checks for this as well.\n * @option\n * @type {boolean}\n * @default false\n */\n fullScreen: false,\n /**\n * Allows the modal to generate an overlay div, which will cover the view when modal opens.\n * @option\n * @type {boolean}\n * @default true\n */\n overlay: true,\n /**\n * 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.\n * @option\n * @type {boolean}\n * @default false\n */\n resetOnClose: false,\n /**\n * Link the location hash to the modal.\n * Set the location hash when the modal is opened/closed, and open/close the modal when the location changes.\n * @option\n * @type {boolean}\n * @default false\n */\n deepLink: false,\n /**\n * If `deepLink` is enabled, update the browser history with the open modal\n * @option\n * @default false\n */\n updateHistory: false,\n /**\n * Allows the modal to append to custom div.\n * @option\n * @type {string}\n * @default \"body\"\n */\n appendTo: \"body\",\n /**\n * Allows adding additional class names to the reveal overlay.\n * @option\n * @type {string}\n * @default ''\n */\n additionalOverlayClasses: ''\n};\n\nexport {Reveal};\n","'use strict';\n\nimport $ from 'jquery';\nimport { Keyboard } from './foundation.util.keyboard';\nimport { Move } from './foundation.util.motion';\nimport { GetYoDigits, rtl as Rtl } from './foundation.core.utils';\n\nimport { Plugin } from './foundation.core.plugin';\n\nimport { Touch } from './foundation.util.touch';\n\nimport { Triggers } from './foundation.util.triggers';\n/**\n * Slider module.\n * @module foundation.slider\n * @requires foundation.util.motion\n * @requires foundation.util.triggers\n * @requires foundation.util.keyboard\n * @requires foundation.util.touch\n */\n\nclass Slider extends Plugin {\n /**\n * Creates a new instance of a slider control.\n * @class\n * @name Slider\n * @param {jQuery} element - jQuery object to make into a slider control.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, Slider.defaults, this.$element.data(), options);\n this.className = 'Slider'; // ie9 back compat\n\n // Touch and Triggers inits are idempotent, we just need to make sure it's initialied.\n Touch.init($);\n Triggers.init($);\n\n this._init();\n\n Keyboard.register('Slider', {\n 'ltr': {\n 'ARROW_RIGHT': 'increase',\n 'ARROW_UP': 'increase',\n 'ARROW_DOWN': 'decrease',\n 'ARROW_LEFT': 'decrease',\n 'SHIFT_ARROW_RIGHT': 'increase_fast',\n 'SHIFT_ARROW_UP': 'increase_fast',\n 'SHIFT_ARROW_DOWN': 'decrease_fast',\n 'SHIFT_ARROW_LEFT': 'decrease_fast',\n 'HOME': 'min',\n 'END': 'max'\n },\n 'rtl': {\n 'ARROW_LEFT': 'increase',\n 'ARROW_RIGHT': 'decrease',\n 'SHIFT_ARROW_LEFT': 'increase_fast',\n 'SHIFT_ARROW_RIGHT': 'decrease_fast'\n }\n });\n }\n\n /**\n * Initilizes the plugin by reading/setting attributes, creating collections and setting the initial position of the handle(s).\n * @function\n * @private\n */\n _init() {\n this.inputs = this.$element.find('input');\n this.handles = this.$element.find('[data-slider-handle]');\n\n this.$handle = this.handles.eq(0);\n this.$input = this.inputs.length ? this.inputs.eq(0) : $(`#${this.$handle.attr('aria-controls')}`);\n this.$fill = this.$element.find('[data-slider-fill]').css(this.options.vertical ? 'height' : 'width', 0);\n\n var isDbl = false,\n _this = this;\n if (this.options.disabled || this.$element.hasClass(this.options.disabledClass)) {\n this.options.disabled = true;\n this.$element.addClass(this.options.disabledClass);\n }\n if (!this.inputs.length) {\n this.inputs = $().add(this.$input);\n this.options.binding = true;\n }\n\n this._setInitAttr(0);\n\n if (this.handles[1]) {\n this.options.doubleSided = true;\n this.$handle2 = this.handles.eq(1);\n this.$input2 = this.inputs.length > 1 ? this.inputs.eq(1) : $(`#${this.$handle2.attr('aria-controls')}`);\n\n if (!this.inputs[1]) {\n this.inputs = this.inputs.add(this.$input2);\n }\n isDbl = true;\n\n // this.$handle.triggerHandler('click.zf.slider');\n this._setInitAttr(1);\n }\n\n // Set handle positions\n this.setHandles();\n\n this._events();\n }\n\n setHandles() {\n if(this.handles[1]) {\n this._setHandlePos(this.$handle, this.inputs.eq(0).val(), true, () => {\n this._setHandlePos(this.$handle2, this.inputs.eq(1).val(), true);\n });\n } else {\n this._setHandlePos(this.$handle, this.inputs.eq(0).val(), true);\n }\n }\n\n _reflow() {\n this.setHandles();\n }\n /**\n * @function\n * @private\n * @param {Number} value - floating point (the value) to be transformed using to a relative position on the slider (the inverse of _value)\n */\n _pctOfBar(value) {\n var pctOfBar = percent(value - this.options.start, this.options.end - this.options.start)\n\n switch(this.options.positionValueFunction) {\n case \"pow\":\n pctOfBar = this._logTransform(pctOfBar);\n break;\n case \"log\":\n pctOfBar = this._powTransform(pctOfBar);\n break;\n }\n\n return pctOfBar.toFixed(2)\n }\n\n /**\n * @function\n * @private\n * @param {Number} pctOfBar - floating point, the relative position of the slider (typically between 0-1) to be transformed to a value\n */\n _value(pctOfBar) {\n switch(this.options.positionValueFunction) {\n case \"pow\":\n pctOfBar = this._powTransform(pctOfBar);\n break;\n case \"log\":\n pctOfBar = this._logTransform(pctOfBar);\n break;\n }\n var value = (this.options.end - this.options.start) * pctOfBar + parseFloat(this.options.start);\n\n return value\n }\n\n /**\n * @function\n * @private\n * @param {Number} value - floating point (typically between 0-1) to be transformed using the log function\n */\n _logTransform(value) {\n return baseLog(this.options.nonLinearBase, ((value*(this.options.nonLinearBase-1))+1))\n }\n\n /**\n * @function\n * @private\n * @param {Number} value - floating point (typically between 0-1) to be transformed using the power function\n */\n _powTransform(value) {\n return (Math.pow(this.options.nonLinearBase, value) - 1) / (this.options.nonLinearBase - 1)\n }\n\n /**\n * Sets the position of the selected handle and fill bar.\n * @function\n * @private\n * @param {jQuery} $hndl - the selected handle to move.\n * @param {Number} location - floating point between the start and end values of the slider bar.\n * @param {Function} cb - callback function to fire on completion.\n * @fires Slider#moved\n * @fires Slider#changed\n */\n _setHandlePos($hndl, location, noInvert, cb) {\n // don't move if the slider has been disabled since its initialization\n if (this.$element.hasClass(this.options.disabledClass)) {\n return;\n }\n //might need to alter that slightly for bars that will have odd number selections.\n location = parseFloat(location);//on input change events, convert string to number...grumble.\n\n // prevent slider from running out of bounds, if value exceeds the limits set through options, override the value to min/max\n if (location < this.options.start) { location = this.options.start; }\n else if (location > this.options.end) { location = this.options.end; }\n\n var isDbl = this.options.doubleSided;\n\n //this is for single-handled vertical sliders, it adjusts the value to account for the slider being \"upside-down\"\n //for click and drag events, it's weird due to the scale(-1, 1) css property\n if (this.options.vertical && !noInvert) {\n location = this.options.end - location;\n }\n\n if (isDbl) { //this block is to prevent 2 handles from crossing eachother. Could/should be improved.\n if (this.handles.index($hndl) === 0) {\n var h2Val = parseFloat(this.$handle2.attr('aria-valuenow'));\n location = location >= h2Val ? h2Val - this.options.step : location;\n } else {\n var h1Val = parseFloat(this.$handle.attr('aria-valuenow'));\n location = location <= h1Val ? h1Val + this.options.step : location;\n }\n }\n\n var _this = this,\n vert = this.options.vertical,\n hOrW = vert ? 'height' : 'width',\n lOrT = vert ? 'top' : 'left',\n handleDim = $hndl[0].getBoundingClientRect()[hOrW],\n elemDim = this.$element[0].getBoundingClientRect()[hOrW],\n //percentage of bar min/max value based on click or drag point\n pctOfBar = this._pctOfBar(location),\n //number of actual pixels to shift the handle, based on the percentage obtained above\n pxToMove = (elemDim - handleDim) * pctOfBar,\n //percentage of bar to shift the handle\n movement = (percent(pxToMove, elemDim) * 100).toFixed(this.options.decimal);\n //fixing the decimal value for the location number, is passed to other methods as a fixed floating-point value\n location = parseFloat(location.toFixed(this.options.decimal));\n // declare empty object for css adjustments, only used with 2 handled-sliders\n var css = {};\n\n this._setValues($hndl, location);\n\n // TODO update to calculate based on values set to respective inputs??\n if (isDbl) {\n var isLeftHndl = this.handles.index($hndl) === 0,\n //empty variable, will be used for min-height/width for fill bar\n dim,\n //percentage w/h of the handle compared to the slider bar\n handlePct = ~~(percent(handleDim, elemDim) * 100);\n //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\n if (isLeftHndl) {\n //left or top percentage value to apply to the fill bar.\n css[lOrT] = `${movement}%`;\n //calculate the new min-height/width for the fill bar.\n dim = parseFloat(this.$handle2[0].style[lOrT]) - movement + handlePct;\n //this callback is necessary to prevent errors and allow the proper placement and initialization of a 2-handled slider\n //plus, it means we don't care if 'dim' isNaN on init, it won't be in the future.\n if (cb && typeof cb === 'function') { cb(); }//this is only needed for the initialization of 2 handled sliders\n } else {\n //just caching the value of the left/bottom handle's left/top property\n var handlePos = parseFloat(this.$handle[0].style[lOrT]);\n //calculate the new min-height/width for the fill bar. Use isNaN to prevent false positives for numbers <= 0\n //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\n dim = movement - (isNaN(handlePos) ? (this.options.initialStart - this.options.start)/((this.options.end-this.options.start)/100) : handlePos) + handlePct;\n }\n // assign the min-height/width to our css object\n css[`min-${hOrW}`] = `${dim}%`;\n }\n\n this.$element.one('finished.zf.animate', function() {\n /**\n * Fires when the handle is done moving.\n * @event Slider#moved\n */\n _this.$element.trigger('moved.zf.slider', [$hndl]);\n });\n\n //because we don't know exactly how the handle will be moved, check the amount of time it should take to move.\n var moveTime = this.$element.data('dragging') ? 1000/60 : this.options.moveTime;\n\n Move(moveTime, $hndl, function() {\n // adjusting the left/top property of the handle, based on the percentage calculated above\n // if movement isNaN, that is because the slider is hidden and we cannot determine handle width,\n // fall back to next best guess.\n if (isNaN(movement)) {\n $hndl.css(lOrT, `${pctOfBar * 100}%`);\n }\n else {\n $hndl.css(lOrT, `${movement}%`);\n }\n\n if (!_this.options.doubleSided) {\n //if single-handled, a simple method to expand the fill bar\n _this.$fill.css(hOrW, `${pctOfBar * 100}%`);\n } else {\n //otherwise, use the css object we created above\n _this.$fill.css(css);\n }\n });\n\n\n /**\n * Fires when the value has not been change for a given time.\n * @event Slider#changed\n */\n clearTimeout(_this.timeout);\n _this.timeout = setTimeout(function(){\n _this.$element.trigger('changed.zf.slider', [$hndl]);\n }, _this.options.changedDelay);\n }\n\n /**\n * Sets the initial attribute for the slider element.\n * @function\n * @private\n * @param {Number} idx - index of the current handle/input to use.\n */\n _setInitAttr(idx) {\n var initVal = (idx === 0 ? this.options.initialStart : this.options.initialEnd)\n var id = this.inputs.eq(idx).attr('id') || GetYoDigits(6, 'slider');\n this.inputs.eq(idx).attr({\n 'id': id,\n 'max': this.options.end,\n 'min': this.options.start,\n 'step': this.options.step\n });\n this.inputs.eq(idx).val(initVal);\n this.handles.eq(idx).attr({\n 'role': 'slider',\n 'aria-controls': id,\n 'aria-valuemax': this.options.end,\n 'aria-valuemin': this.options.start,\n 'aria-valuenow': initVal,\n 'aria-orientation': this.options.vertical ? 'vertical' : 'horizontal',\n 'tabindex': 0\n });\n }\n\n /**\n * Sets the input and `aria-valuenow` values for the slider element.\n * @function\n * @private\n * @param {jQuery} $handle - the currently selected handle.\n * @param {Number} val - floating point of the new value.\n */\n _setValues($handle, val) {\n var idx = this.options.doubleSided ? this.handles.index($handle) : 0;\n this.inputs.eq(idx).val(val);\n $handle.attr('aria-valuenow', val);\n }\n\n /**\n * Handles events on the slider element.\n * Calculates the new location of the current handle.\n * If there are two handles and the bar was clicked, it determines which handle to move.\n * @function\n * @private\n * @param {Object} e - the `event` object passed from the listener.\n * @param {jQuery} $handle - the current handle to calculate for, if selected.\n * @param {Number} val - floating point number for the new value of the slider.\n * TODO clean this up, there's a lot of repeated code between this and the _setHandlePos fn.\n */\n _handleEvent(e, $handle, val) {\n var value, hasVal;\n if (!val) {//click or drag events\n e.preventDefault();\n var _this = this,\n vertical = this.options.vertical,\n param = vertical ? 'height' : 'width',\n direction = vertical ? 'top' : 'left',\n eventOffset = vertical ? e.pageY : e.pageX,\n halfOfHandle = this.$handle[0].getBoundingClientRect()[param] / 2,\n barDim = this.$element[0].getBoundingClientRect()[param],\n windowScroll = vertical ? $(window).scrollTop() : $(window).scrollLeft();\n\n\n var elemOffset = this.$element.offset()[direction];\n\n // touch events emulated by the touch util give position relative to screen, add window.scroll to event coordinates...\n // best way to guess this is simulated is if clientY == pageY\n if (e.clientY === e.pageY) { eventOffset = eventOffset + windowScroll; }\n var eventFromBar = eventOffset - elemOffset;\n var barXY;\n if (eventFromBar < 0) {\n barXY = 0;\n } else if (eventFromBar > barDim) {\n barXY = barDim;\n } else {\n barXY = eventFromBar;\n }\n var offsetPct = percent(barXY, barDim);\n\n value = this._value(offsetPct);\n\n // turn everything around for RTL, yay math!\n if (Rtl() && !this.options.vertical) {value = this.options.end - value;}\n\n value = _this._adjustValue(null, value);\n //boolean flag for the setHandlePos fn, specifically for vertical sliders\n hasVal = false;\n\n if (!$handle) {//figure out which handle it is, pass it to the next function.\n var firstHndlPos = absPosition(this.$handle, direction, barXY, param),\n secndHndlPos = absPosition(this.$handle2, direction, barXY, param);\n $handle = firstHndlPos <= secndHndlPos ? this.$handle : this.$handle2;\n }\n\n } else {//change event on input\n value = this._adjustValue(null, val);\n hasVal = true;\n }\n\n this._setHandlePos($handle, value, hasVal);\n }\n\n /**\n * Adjustes value for handle in regard to step value. returns adjusted value\n * @function\n * @private\n * @param {jQuery} $handle - the selected handle.\n * @param {Number} value - value to adjust. used if $handle is falsy\n */\n _adjustValue($handle, value) {\n var val,\n step = this.options.step,\n div = parseFloat(step/2),\n left, prev_val, next_val;\n if (!!$handle) {\n val = parseFloat($handle.attr('aria-valuenow'));\n }\n else {\n val = value;\n }\n if (val >= 0) {\n left = val % step;\n } else {\n left = step + (val % step);\n }\n prev_val = val - left;\n next_val = prev_val + step;\n if (left === 0) {\n return val;\n }\n val = val >= prev_val + div ? next_val : prev_val;\n return val;\n }\n\n /**\n * Adds event listeners to the slider elements.\n * @function\n * @private\n */\n _events() {\n this._eventsForHandle(this.$handle);\n if(this.handles[1]) {\n this._eventsForHandle(this.$handle2);\n }\n }\n\n\n /**\n * Adds event listeners a particular handle\n * @function\n * @private\n * @param {jQuery} $handle - the current handle to apply listeners to.\n */\n _eventsForHandle($handle) {\n var _this = this,\n curHandle,\n timer;\n\n const handleChangeEvent = function(e) {\n const idx = _this.inputs.index($(this));\n _this._handleEvent(e, _this.handles.eq(idx), $(this).val());\n };\n\n // IE only triggers the change event when the input loses focus which strictly follows the HTML specification\n // listen for the enter key and trigger a change\n // @see https://html.spec.whatwg.org/multipage/input.html#common-input-element-events\n this.inputs.off('keyup.zf.slider').on('keyup.zf.slider', function (e) {\n if(e.keyCode == 13) handleChangeEvent.call(this, e);\n });\n\n this.inputs.off('change.zf.slider').on('change.zf.slider', handleChangeEvent);\n\n if (this.options.clickSelect) {\n this.$element.off('click.zf.slider').on('click.zf.slider', function(e) {\n if (_this.$element.data('dragging')) { return false; }\n\n if (!$(e.target).is('[data-slider-handle]')) {\n if (_this.options.doubleSided) {\n _this._handleEvent(e);\n } else {\n _this._handleEvent(e, _this.$handle);\n }\n }\n });\n }\n\n if (this.options.draggable) {\n this.handles.addTouch();\n\n var $body = $('body');\n $handle\n .off('mousedown.zf.slider')\n .on('mousedown.zf.slider', function(e) {\n $handle.addClass('is-dragging');\n _this.$fill.addClass('is-dragging');//\n _this.$element.data('dragging', true);\n\n curHandle = $(e.currentTarget);\n\n $body.on('mousemove.zf.slider', function(e) {\n e.preventDefault();\n _this._handleEvent(e, curHandle);\n\n }).on('mouseup.zf.slider', function(e) {\n _this._handleEvent(e, curHandle);\n\n $handle.removeClass('is-dragging');\n _this.$fill.removeClass('is-dragging');\n _this.$element.data('dragging', false);\n\n $body.off('mousemove.zf.slider mouseup.zf.slider');\n });\n })\n // prevent events triggered by touch\n .on('selectstart.zf.slider touchmove.zf.slider', function(e) {\n e.preventDefault();\n });\n }\n\n $handle.off('keydown.zf.slider').on('keydown.zf.slider', function(e) {\n var _$handle = $(this),\n idx = _this.options.doubleSided ? _this.handles.index(_$handle) : 0,\n oldValue = parseFloat(_this.inputs.eq(idx).val()),\n newValue;\n\n // handle keyboard event with keyboard util\n Keyboard.handleKey(e, 'Slider', {\n decrease: function() {\n newValue = oldValue - _this.options.step;\n },\n increase: function() {\n newValue = oldValue + _this.options.step;\n },\n decrease_fast: function() {\n newValue = oldValue - _this.options.step * 10;\n },\n increase_fast: function() {\n newValue = oldValue + _this.options.step * 10;\n },\n min: function() {\n newValue = _this.options.start;\n },\n max: function() {\n newValue = _this.options.end;\n },\n handled: function() { // only set handle pos when event was handled specially\n e.preventDefault();\n _this._setHandlePos(_$handle, newValue, true);\n }\n });\n /*if (newValue) { // if pressed key has special function, update value\n e.preventDefault();\n _this._setHandlePos(_$handle, newValue);\n }*/\n });\n }\n\n /**\n * Destroys the slider plugin.\n */\n _destroy() {\n this.handles.off('.zf.slider');\n this.inputs.off('.zf.slider');\n this.$element.off('.zf.slider');\n\n clearTimeout(this.timeout);\n }\n}\n\nSlider.defaults = {\n /**\n * Minimum value for the slider scale.\n * @option\n * @type {number}\n * @default 0\n */\n start: 0,\n /**\n * Maximum value for the slider scale.\n * @option\n * @type {number}\n * @default 100\n */\n end: 100,\n /**\n * Minimum value change per change event.\n * @option\n * @type {number}\n * @default 1\n */\n step: 1,\n /**\n * Value at which the handle/input *(left handle/first input)* should be set to on initialization.\n * @option\n * @type {number}\n * @default 0\n */\n initialStart: 0,\n /**\n * Value at which the right handle/second input should be set to on initialization.\n * @option\n * @type {number}\n * @default 100\n */\n initialEnd: 100,\n /**\n * Allows the input to be located outside the container and visible. Set to by the JS\n * @option\n * @type {boolean}\n * @default false\n */\n binding: false,\n /**\n * Allows the user to click/tap on the slider bar to select a value.\n * @option\n * @type {boolean}\n * @default true\n */\n clickSelect: true,\n /**\n * Set to true and use the `vertical` class to change alignment to vertical.\n * @option\n * @type {boolean}\n * @default false\n */\n vertical: false,\n /**\n * Allows the user to drag the slider handle(s) to select a value.\n * @option\n * @type {boolean}\n * @default true\n */\n draggable: true,\n /**\n * Disables the slider and prevents event listeners from being applied. Double checked by JS with `disabledClass`.\n * @option\n * @type {boolean}\n * @default false\n */\n disabled: false,\n /**\n * Allows the use of two handles. Double checked by the JS. Changes some logic handling.\n * @option\n * @type {boolean}\n * @default false\n */\n doubleSided: false,\n /**\n * Potential future feature.\n */\n // steps: 100,\n /**\n * Number of decimal places the plugin should go to for floating point precision.\n * @option\n * @type {number}\n * @default 2\n */\n decimal: 2,\n /**\n * Time delay for dragged elements.\n */\n // dragDelay: 0,\n /**\n * 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.\n * @option\n * @type {number}\n * @default 200\n */\n moveTime: 200,//update this if changing the transition time in the sass\n /**\n * Class applied to disabled sliders.\n * @option\n * @type {string}\n * @default 'disabled'\n */\n disabledClass: 'disabled',\n /**\n * Will invert the default layout for a vertical<span data-tooltip title=\"who would do this???\"> </span>slider.\n * @option\n * @type {boolean}\n * @default false\n */\n invertVertical: false,\n /**\n * Milliseconds before the `changed.zf-slider` event is triggered after value change.\n * @option\n * @type {number}\n * @default 500\n */\n changedDelay: 500,\n /**\n * Basevalue for non-linear sliders\n * @option\n * @type {number}\n * @default 5\n */\n nonLinearBase: 5,\n /**\n * Basevalue for non-linear sliders, possible values are: `'linear'`, `'pow'` & `'log'`. Pow and Log use the nonLinearBase setting.\n * @option\n * @type {string}\n * @default 'linear'\n */\n positionValueFunction: 'linear',\n};\n\nfunction percent(frac, num) {\n return (frac / num);\n}\nfunction absPosition($handle, dir, clickPos, param) {\n return Math.abs(($handle.position()[dir] + ($handle[param]() / 2)) - clickPos);\n}\nfunction baseLog(base, value) {\n return Math.log(value)/Math.log(base)\n}\n\nexport {Slider};\n","import $ from 'jquery';\nimport { GetYoDigits } from './foundation.core.utils';\nimport { Plugin } from './foundation.core.plugin';\n\n/**\n * SmoothScroll module.\n * @module foundation.smooth-scroll\n */\nclass SmoothScroll extends Plugin {\n /**\n * Creates a new instance of SmoothScroll.\n * @class\n * @name SmoothScroll\n * @fires SmoothScroll#init\n * @param {Object} element - jQuery object to add the trigger to.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, SmoothScroll.defaults, this.$element.data(), options);\n this.className = 'SmoothScroll'; // ie9 back compat\n\n this._init();\n }\n\n /**\n * Initialize the SmoothScroll plugin\n * @private\n */\n _init() {\n const id = this.$element[0].id || GetYoDigits(6, 'smooth-scroll');\n this.$element.attr({ id });\n\n this._events();\n }\n\n /**\n * Initializes events for SmoothScroll.\n * @private\n */\n _events() {\n this.$element.on('click.zf.smoothScroll', this._handleLinkClick)\n this.$element.on('click.zf.smoothScroll', 'a[href^=\"#\"]', this._handleLinkClick);\n }\n\n /**\n * Handle the given event to smoothly scroll to the anchor pointed by the event target.\n * @param {*} e - event\n * @function\n * @private\n */\n _handleLinkClick(e) {\n // Follow the link if it does not point to an anchor.\n if (!$(e.currentTarget).is('a[href^=\"#\"]')) return;\n\n const arrival = e.currentTarget.getAttribute('href');\n\n this._inTransition = true;\n\n SmoothScroll.scrollToLoc(arrival, this.options, () => {\n this._inTransition = false;\n });\n\n e.preventDefault();\n };\n\n /**\n * Function to scroll to a given location on the page.\n * @param {String} loc - A properly formatted jQuery id selector. Example: '#foo'\n * @param {Object} options - The options to use.\n * @param {Function} callback - The callback function.\n * @static\n * @function\n */\n static scrollToLoc(loc, options = SmoothScroll.defaults, callback) {\n const $loc = $(loc);\n\n // Do nothing if target does not exist to prevent errors\n if (!$loc.length) return false;\n\n var scrollPos = Math.round($loc.offset().top - options.threshold / 2 - options.offset);\n\n $('html, body').stop(true).animate(\n { scrollTop: scrollPos },\n options.animationDuration,\n options.animationEasing,\n () => {\n if (typeof callback === 'function'){\n callback();\n }\n }\n );\n }\n\n /**\n * Destroys the SmoothScroll instance.\n * @function\n */\n _destroy() {\n this.$element.off('click.zf.smoothScroll', this._handleLinkClick)\n this.$element.off('click.zf.smoothScroll', 'a[href^=\"#\"]', this._handleLinkClick);\n }\n}\n\n/**\n * Default settings for plugin.\n */\nSmoothScroll.defaults = {\n /**\n * Amount of time, in ms, the animated scrolling should take between locations.\n * @option\n * @type {number}\n * @default 500\n */\n animationDuration: 500,\n /**\n * Animation style to use when scrolling between locations. Can be `'swing'` or `'linear'`.\n * @option\n * @type {string}\n * @default 'linear'\n * @see {@link https://api.jquery.com/animate|Jquery animate}\n */\n animationEasing: 'linear',\n /**\n * Number of pixels to use as a marker for location changes.\n * @option\n * @type {number}\n * @default 50\n */\n threshold: 50,\n /**\n * Number of pixels to offset the scroll of the page on item click if using a sticky nav bar.\n * @option\n * @type {number}\n * @default 0\n */\n offset: 0\n}\n\nexport {SmoothScroll}\n","'use strict';\n\nimport $ from 'jquery';\nimport { onLoad, GetYoDigits } from './foundation.core.utils';\nimport { MediaQuery } from './foundation.util.mediaQuery';\nimport { Plugin } from './foundation.core.plugin';\nimport { Triggers } from './foundation.util.triggers';\n\n/**\n * Sticky module.\n * @module foundation.sticky\n * @requires foundation.util.triggers\n * @requires foundation.util.mediaQuery\n */\n\nclass Sticky extends Plugin {\n /**\n * Creates a new instance of a sticky thing.\n * @class\n * @name Sticky\n * @param {jQuery} element - jQuery object to make sticky.\n * @param {Object} options - options object passed when creating the element programmatically.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, Sticky.defaults, this.$element.data(), options);\n this.className = 'Sticky'; // ie9 back compat\n\n // Triggers init is idempotent, just need to make sure it is initialized\n Triggers.init($);\n\n this._init();\n }\n\n /**\n * Initializes the sticky element by adding classes, getting/setting dimensions, breakpoints and attributes\n * @function\n * @private\n */\n _init() {\n MediaQuery._init();\n\n var $parent = this.$element.parent('[data-sticky-container]'),\n id = this.$element[0].id || GetYoDigits(6, 'sticky'),\n _this = this;\n\n if($parent.length){\n this.$container = $parent;\n } else {\n this.wasWrapped = true;\n this.$element.wrap(this.options.container);\n this.$container = this.$element.parent();\n }\n this.$container.addClass(this.options.containerClass);\n\n this.$element.addClass(this.options.stickyClass).attr({ 'data-resize': id, 'data-mutate': id });\n if (this.options.anchor !== '') {\n $('#' + _this.options.anchor).attr({ 'data-mutate': id });\n }\n\n this.scrollCount = this.options.checkEvery;\n this.isStuck = false;\n this.onLoadListener = onLoad($(window), function () {\n //We calculate the container height to have correct values for anchor points offset calculation.\n _this.containerHeight = _this.$element.css(\"display\") == \"none\" ? 0 : _this.$element[0].getBoundingClientRect().height;\n _this.$container.css('height', _this.containerHeight);\n _this.elemHeight = _this.containerHeight;\n if (_this.options.anchor !== '') {\n _this.$anchor = $('#' + _this.options.anchor);\n } else {\n _this._parsePoints();\n }\n\n _this._setSizes(function () {\n var scroll = window.pageYOffset;\n _this._calc(false, scroll);\n //Unstick the element will ensure that proper classes are set.\n if (!_this.isStuck) {\n _this._removeSticky((scroll >= _this.topPoint) ? false : true);\n }\n });\n _this._events(id.split('-').reverse().join('-'));\n });\n }\n\n /**\n * If using multiple elements as anchors, calculates the top and bottom pixel values the sticky thing should stick and unstick on.\n * @function\n * @private\n */\n _parsePoints() {\n var top = this.options.topAnchor == \"\" ? 1 : this.options.topAnchor,\n btm = this.options.btmAnchor== \"\" ? document.documentElement.scrollHeight : this.options.btmAnchor,\n pts = [top, btm],\n breaks = {};\n for (var i = 0, len = pts.length; i < len && pts[i]; i++) {\n var pt;\n if (typeof pts[i] === 'number') {\n pt = pts[i];\n } else {\n var place = pts[i].split(':'),\n anchor = $(`#${place[0]}`);\n\n pt = anchor.offset().top;\n if (place[1] && place[1].toLowerCase() === 'bottom') {\n pt += anchor[0].getBoundingClientRect().height;\n }\n }\n breaks[i] = pt;\n }\n\n\n this.points = breaks;\n return;\n }\n\n /**\n * Adds event handlers for the scrolling element.\n * @private\n * @param {String} id - pseudo-random id for unique scroll event listener.\n */\n _events(id) {\n var _this = this,\n scrollListener = this.scrollListener = `scroll.zf.${id}`;\n if (this.isOn) { return; }\n if (this.canStick) {\n this.isOn = true;\n $(window).off(scrollListener)\n .on(scrollListener, function(e) {\n if (_this.scrollCount === 0) {\n _this.scrollCount = _this.options.checkEvery;\n _this._setSizes(function() {\n _this._calc(false, window.pageYOffset);\n });\n } else {\n _this.scrollCount--;\n _this._calc(false, window.pageYOffset);\n }\n });\n }\n\n this.$element.off('resizeme.zf.trigger')\n .on('resizeme.zf.trigger', function(e, el) {\n _this._eventsHandler(id);\n });\n\n this.$element.on('mutateme.zf.trigger', function (e, el) {\n _this._eventsHandler(id);\n });\n\n if(this.$anchor) {\n this.$anchor.on('mutateme.zf.trigger', function (e, el) {\n _this._eventsHandler(id);\n });\n }\n }\n\n /**\n * Handler for events.\n * @private\n * @param {String} id - pseudo-random id for unique scroll event listener.\n */\n _eventsHandler(id) {\n var _this = this,\n scrollListener = this.scrollListener = `scroll.zf.${id}`;\n\n _this._setSizes(function() {\n _this._calc(false);\n if (_this.canStick) {\n if (!_this.isOn) {\n _this._events(id);\n }\n } else if (_this.isOn) {\n _this._pauseListeners(scrollListener);\n }\n });\n }\n\n /**\n * Removes event handlers for scroll and change events on anchor.\n * @fires Sticky#pause\n * @param {String} scrollListener - unique, namespaced scroll listener attached to `window`\n */\n _pauseListeners(scrollListener) {\n this.isOn = false;\n $(window).off(scrollListener);\n\n /**\n * Fires when the plugin is paused due to resize event shrinking the view.\n * @event Sticky#pause\n * @private\n */\n this.$element.trigger('pause.zf.sticky');\n }\n\n /**\n * Called on every `scroll` event and on `_init`\n * fires functions based on booleans and cached values\n * @param {Boolean} checkSizes - true if plugin should recalculate sizes and breakpoints.\n * @param {Number} scroll - current scroll position passed from scroll event cb function. If not passed, defaults to `window.pageYOffset`.\n */\n _calc(checkSizes, scroll) {\n if (checkSizes) { this._setSizes(); }\n\n if (!this.canStick) {\n if (this.isStuck) {\n this._removeSticky(true);\n }\n return false;\n }\n\n if (!scroll) { scroll = window.pageYOffset; }\n\n if (scroll >= this.topPoint) {\n if (scroll <= this.bottomPoint) {\n if (!this.isStuck) {\n this._setSticky();\n }\n } else {\n if (this.isStuck) {\n this._removeSticky(false);\n }\n }\n } else {\n if (this.isStuck) {\n this._removeSticky(true);\n }\n }\n }\n\n /**\n * Causes the $element to become stuck.\n * Adds `position: fixed;`, and helper classes.\n * @fires Sticky#stuckto\n * @function\n * @private\n */\n _setSticky() {\n var _this = this,\n stickTo = this.options.stickTo,\n mrgn = stickTo === 'top' ? 'marginTop' : 'marginBottom',\n notStuckTo = stickTo === 'top' ? 'bottom' : 'top',\n css = {};\n\n css[mrgn] = `${this.options[mrgn]}em`;\n css[stickTo] = 0;\n css[notStuckTo] = 'auto';\n this.isStuck = true;\n this.$element.removeClass(`is-anchored is-at-${notStuckTo}`)\n .addClass(`is-stuck is-at-${stickTo}`)\n .css(css)\n /**\n * Fires when the $element has become `position: fixed;`\n * Namespaced to `top` or `bottom`, e.g. `sticky.zf.stuckto:top`\n * @event Sticky#stuckto\n */\n .trigger(`sticky.zf.stuckto:${stickTo}`);\n this.$element.on(\"transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd\", function() {\n _this._setSizes();\n });\n }\n\n /**\n * Causes the $element to become unstuck.\n * Removes `position: fixed;`, and helper classes.\n * Adds other helper classes.\n * @param {Boolean} isTop - tells the function if the $element should anchor to the top or bottom of its $anchor element.\n * @fires Sticky#unstuckfrom\n * @private\n */\n _removeSticky(isTop) {\n var stickTo = this.options.stickTo,\n stickToTop = stickTo === 'top',\n css = {},\n anchorPt = (this.points ? this.points[1] - this.points[0] : this.anchorHeight) - this.elemHeight,\n mrgn = stickToTop ? 'marginTop' : 'marginBottom',\n notStuckTo = stickToTop ? 'bottom' : 'top',\n topOrBottom = isTop ? 'top' : 'bottom';\n\n css[mrgn] = 0;\n\n css['bottom'] = 'auto';\n if(isTop) {\n css['top'] = 0;\n } else {\n css['top'] = anchorPt;\n }\n\n this.isStuck = false;\n this.$element.removeClass(`is-stuck is-at-${stickTo}`)\n .addClass(`is-anchored is-at-${topOrBottom}`)\n .css(css)\n /**\n * Fires when the $element has become anchored.\n * Namespaced to `top` or `bottom`, e.g. `sticky.zf.unstuckfrom:bottom`\n * @event Sticky#unstuckfrom\n */\n .trigger(`sticky.zf.unstuckfrom:${topOrBottom}`);\n }\n\n /**\n * Sets the $element and $container sizes for plugin.\n * Calls `_setBreakPoints`.\n * @param {Function} cb - optional callback function to fire on completion of `_setBreakPoints`.\n * @private\n */\n _setSizes(cb) {\n this.canStick = MediaQuery.is(this.options.stickyOn);\n if (!this.canStick) {\n if (cb && typeof cb === 'function') { cb(); }\n }\n var _this = this,\n newElemWidth = this.$container[0].getBoundingClientRect().width,\n comp = window.getComputedStyle(this.$container[0]),\n pdngl = parseInt(comp['padding-left'], 10),\n pdngr = parseInt(comp['padding-right'], 10);\n\n if (this.$anchor && this.$anchor.length) {\n this.anchorHeight = this.$anchor[0].getBoundingClientRect().height;\n } else {\n this._parsePoints();\n }\n\n this.$element.css({\n 'max-width': `${newElemWidth - pdngl - pdngr}px`\n });\n\n var newContainerHeight = this.$element[0].getBoundingClientRect().height || this.containerHeight;\n if (this.$element.css(\"display\") == \"none\") {\n newContainerHeight = 0;\n }\n this.containerHeight = newContainerHeight;\n this.$container.css({\n height: newContainerHeight\n });\n this.elemHeight = newContainerHeight;\n\n if (!this.isStuck) {\n if (this.$element.hasClass('is-at-bottom')) {\n var anchorPt = (this.points ? this.points[1] - this.$container.offset().top : this.anchorHeight) - this.elemHeight;\n this.$element.css('top', anchorPt);\n }\n }\n\n this._setBreakPoints(newContainerHeight, function() {\n if (cb && typeof cb === 'function') { cb(); }\n });\n }\n\n /**\n * Sets the upper and lower breakpoints for the element to become sticky/unsticky.\n * @param {Number} elemHeight - px value for sticky.$element height, calculated by `_setSizes`.\n * @param {Function} cb - optional callback function to be called on completion.\n * @private\n */\n _setBreakPoints(elemHeight, cb) {\n if (!this.canStick) {\n if (cb && typeof cb === 'function') { cb(); }\n else { return false; }\n }\n var mTop = emCalc(this.options.marginTop),\n mBtm = emCalc(this.options.marginBottom),\n topPoint = this.points ? this.points[0] : this.$anchor.offset().top,\n bottomPoint = this.points ? this.points[1] : topPoint + this.anchorHeight,\n // topPoint = this.$anchor.offset().top || this.points[0],\n // bottomPoint = topPoint + this.anchorHeight || this.points[1],\n winHeight = window.innerHeight;\n\n if (this.options.stickTo === 'top') {\n topPoint -= mTop;\n bottomPoint -= (elemHeight + mTop);\n } else if (this.options.stickTo === 'bottom') {\n topPoint -= (winHeight - (elemHeight + mBtm));\n bottomPoint -= (winHeight - mBtm);\n } else {\n //this would be the stickTo: both option... tricky\n }\n\n this.topPoint = topPoint;\n this.bottomPoint = bottomPoint;\n\n if (cb && typeof cb === 'function') { cb(); }\n }\n\n /**\n * Destroys the current sticky element.\n * Resets the element to the top position first.\n * Removes event listeners, JS-added css properties and classes, and unwraps the $element if the JS added the $container.\n * @function\n */\n _destroy() {\n this._removeSticky(true);\n\n this.$element.removeClass(`${this.options.stickyClass} is-anchored is-at-top`)\n .css({\n height: '',\n top: '',\n bottom: '',\n 'max-width': ''\n })\n .off('resizeme.zf.trigger')\n .off('mutateme.zf.trigger');\n if (this.$anchor && this.$anchor.length) {\n this.$anchor.off('change.zf.sticky');\n }\n if (this.scrollListener) $(window).off(this.scrollListener)\n if (this.onLoadListener) $(window).off(this.onLoadListener)\n\n if (this.wasWrapped) {\n this.$element.unwrap();\n } else {\n this.$container.removeClass(this.options.containerClass)\n .css({\n height: ''\n });\n }\n }\n}\n\nSticky.defaults = {\n /**\n * Customizable container template. Add your own classes for styling and sizing.\n * @option\n * @type {string}\n * @default '&lt;div data-sticky-container&gt;&lt;/div&gt;'\n */\n container: '<div data-sticky-container></div>',\n /**\n * Location in the view the element sticks to. Can be `'top'` or `'bottom'`.\n * @option\n * @type {string}\n * @default 'top'\n */\n stickTo: 'top',\n /**\n * If anchored to a single element, the id of that element.\n * @option\n * @type {string}\n * @default ''\n */\n anchor: '',\n /**\n * If using more than one element as anchor points, the id of the top anchor.\n * @option\n * @type {string}\n * @default ''\n */\n topAnchor: '',\n /**\n * If using more than one element as anchor points, the id of the bottom anchor.\n * @option\n * @type {string}\n * @default ''\n */\n btmAnchor: '',\n /**\n * Margin, in `em`'s to apply to the top of the element when it becomes sticky.\n * @option\n * @type {number}\n * @default 1\n */\n marginTop: 1,\n /**\n * Margin, in `em`'s to apply to the bottom of the element when it becomes sticky.\n * @option\n * @type {number}\n * @default 1\n */\n marginBottom: 1,\n /**\n * Breakpoint string that is the minimum screen size an element should become sticky.\n * @option\n * @type {string}\n * @default 'medium'\n */\n stickyOn: 'medium',\n /**\n * Class applied to sticky element, and removed on destruction. Foundation defaults to `sticky`.\n * @option\n * @type {string}\n * @default 'sticky'\n */\n stickyClass: 'sticky',\n /**\n * Class applied to sticky container. Foundation defaults to `sticky-container`.\n * @option\n * @type {string}\n * @default 'sticky-container'\n */\n containerClass: 'sticky-container',\n /**\n * 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.\n * @option\n * @type {number}\n * @default -1\n */\n checkEvery: -1\n};\n\n/**\n * Helper function to calculate em values\n * @param Number {em} - number of em's to calculate into pixels\n */\nfunction emCalc(em) {\n return parseInt(window.getComputedStyle(document.body, null).fontSize, 10) * em;\n}\n\nexport {Sticky};\n","'use strict';\n\nimport $ from 'jquery';\nimport { onLoad } from './foundation.core.utils';\nimport { Keyboard } from './foundation.util.keyboard';\nimport { onImagesLoaded } from './foundation.util.imageLoader';\nimport { Plugin } from './foundation.core.plugin';\n/**\n * Tabs module.\n * @module foundation.tabs\n * @requires foundation.util.keyboard\n * @requires foundation.util.imageLoader if tabs contain images\n */\n\nclass Tabs extends Plugin {\n /**\n * Creates a new instance of tabs.\n * @class\n * @name Tabs\n * @fires Tabs#init\n * @param {jQuery} element - jQuery object to make into tabs.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, Tabs.defaults, this.$element.data(), options);\n this.className = 'Tabs'; // ie9 back compat\n\n this._init();\n Keyboard.register('Tabs', {\n 'ENTER': 'open',\n 'SPACE': 'open',\n 'ARROW_RIGHT': 'next',\n 'ARROW_UP': 'previous',\n 'ARROW_DOWN': 'next',\n 'ARROW_LEFT': 'previous'\n // 'TAB': 'next',\n // 'SHIFT_TAB': 'previous'\n });\n }\n\n /**\n * Initializes the tabs by showing and focusing (if autoFocus=true) the preset active tab.\n * @private\n */\n _init() {\n var _this = this;\n this._isInitializing = true;\n\n this.$element.attr({'role': 'tablist'});\n this.$tabTitles = this.$element.find(`.${this.options.linkClass}`);\n this.$tabContent = $(`[data-tabs-content=\"${this.$element[0].id}\"]`);\n\n this.$tabTitles.each(function(){\n var $elem = $(this),\n $link = $elem.find('a'),\n isActive = $elem.hasClass(`${_this.options.linkActiveClass}`),\n hash = $link.attr('data-tabs-target') || $link[0].hash.slice(1),\n linkId = $link[0].id ? $link[0].id : `${hash}-label`,\n $tabContent = $(`#${hash}`);\n\n $elem.attr({'role': 'presentation'});\n\n $link.attr({\n 'role': 'tab',\n 'aria-controls': hash,\n 'aria-selected': isActive,\n 'id': linkId,\n 'tabindex': isActive ? '0' : '-1'\n });\n\n $tabContent.attr({\n 'role': 'tabpanel',\n 'aria-labelledby': linkId\n });\n\n // Save up the initial hash to return to it later when going back in history\n if (isActive) {\n _this._initialAnchor = `#${hash}`;\n }\n\n if(!isActive) {\n $tabContent.attr('aria-hidden', 'true');\n }\n\n if(isActive && _this.options.autoFocus){\n _this.onLoadListener = onLoad($(window), function() {\n $('html, body').animate({ scrollTop: $elem.offset().top }, _this.options.deepLinkSmudgeDelay, () => {\n $link.focus();\n });\n });\n }\n });\n\n if(this.options.matchHeight) {\n var $images = this.$tabContent.find('img');\n\n if ($images.length) {\n onImagesLoaded($images, this._setHeight.bind(this));\n } else {\n this._setHeight();\n }\n }\n\n // Current context-bound function to open tabs on page load or history hashchange\n this._checkDeepLink = () => {\n var anchor = window.location.hash;\n\n if (!anchor.length) {\n // If we are still initializing and there is no anchor, then there is nothing to do\n if (this._isInitializing) return;\n // Otherwise, move to the initial anchor\n if (this._initialAnchor) anchor = this._initialAnchor;\n }\n\n var $anchor = anchor && $(anchor);\n var $link = anchor && this.$element.find('[href$=\"'+anchor+'\"]');\n // Whether the anchor element that has been found is part of this element\n var isOwnAnchor = !!($anchor.length && $link.length);\n\n // If there is an anchor for the hash, select it\n if ($anchor && $anchor.length && $link && $link.length) {\n this.selectTab($anchor, true);\n }\n // Otherwise, collapse everything\n else {\n this._collapse();\n }\n\n if (isOwnAnchor) {\n // Roll up a little to show the titles\n if (this.options.deepLinkSmudge) {\n var offset = this.$element.offset();\n $('html, body').animate({ scrollTop: offset.top }, this.options.deepLinkSmudgeDelay);\n }\n\n /**\n * Fires when the plugin has deeplinked at pageload\n * @event Tabs#deeplink\n */\n this.$element.trigger('deeplink.zf.tabs', [$link, $anchor]);\n }\n }\n\n //use browser to open a tab, if it exists in this tabset\n if (this.options.deepLink) {\n this._checkDeepLink();\n }\n\n this._events();\n\n this._isInitializing = false;\n }\n\n /**\n * Adds event handlers for items within the tabs.\n * @private\n */\n _events() {\n this._addKeyHandler();\n this._addClickHandler();\n this._setHeightMqHandler = null;\n\n if (this.options.matchHeight) {\n this._setHeightMqHandler = this._setHeight.bind(this);\n\n $(window).on('changed.zf.mediaquery', this._setHeightMqHandler);\n }\n\n if(this.options.deepLink) {\n $(window).on('hashchange', this._checkDeepLink);\n }\n }\n\n /**\n * Adds click handlers for items within the tabs.\n * @private\n */\n _addClickHandler() {\n var _this = this;\n\n this.$element\n .off('click.zf.tabs')\n .on('click.zf.tabs', `.${this.options.linkClass}`, function(e){\n e.preventDefault();\n e.stopPropagation();\n _this._handleTabChange($(this));\n });\n }\n\n /**\n * Adds keyboard event handlers for items within the tabs.\n * @private\n */\n _addKeyHandler() {\n var _this = this;\n\n this.$tabTitles.off('keydown.zf.tabs').on('keydown.zf.tabs', function(e){\n if (e.which === 9) return;\n\n\n var $element = $(this),\n $elements = $element.parent('ul').children('li'),\n $prevElement,\n $nextElement;\n\n $elements.each(function(i) {\n if ($(this).is($element)) {\n if (_this.options.wrapOnKeys) {\n $prevElement = i === 0 ? $elements.last() : $elements.eq(i-1);\n $nextElement = i === $elements.length -1 ? $elements.first() : $elements.eq(i+1);\n } else {\n $prevElement = $elements.eq(Math.max(0, i-1));\n $nextElement = $elements.eq(Math.min(i+1, $elements.length-1));\n }\n return;\n }\n });\n\n // handle keyboard event with keyboard util\n Keyboard.handleKey(e, 'Tabs', {\n open: function() {\n $element.find('[role=\"tab\"]').focus();\n _this._handleTabChange($element);\n },\n previous: function() {\n $prevElement.find('[role=\"tab\"]').focus();\n _this._handleTabChange($prevElement);\n },\n next: function() {\n $nextElement.find('[role=\"tab\"]').focus();\n _this._handleTabChange($nextElement);\n },\n handled: function() {\n e.stopPropagation();\n e.preventDefault();\n }\n });\n });\n }\n\n /**\n * Opens the tab `$targetContent` defined by `$target`. Collapses active tab.\n * @param {jQuery} $target - Tab to open.\n * @param {boolean} historyHandled - browser has already handled a history update\n * @fires Tabs#change\n * @function\n */\n _handleTabChange($target, historyHandled) {\n\n // With `activeCollapse`, if the target is the active Tab, collapse it.\n if ($target.hasClass(`${this.options.linkActiveClass}`)) {\n if(this.options.activeCollapse) {\n this._collapse();\n }\n return;\n }\n\n var $oldTab = this.$element.\n find(`.${this.options.linkClass}.${this.options.linkActiveClass}`),\n $tabLink = $target.find('[role=\"tab\"]'),\n target = $tabLink.attr('data-tabs-target'),\n anchor = target && target.length ? `#${target}` : $tabLink[0].hash,\n $targetContent = this.$tabContent.find(anchor);\n\n //close old tab\n this._collapseTab($oldTab);\n\n //open new tab\n this._openTab($target);\n\n //either replace or update browser history\n if (this.options.deepLink && !historyHandled) {\n if (this.options.updateHistory) {\n history.pushState({}, '', anchor);\n } else {\n history.replaceState({}, '', anchor);\n }\n }\n\n /**\n * Fires when the plugin has successfully changed tabs.\n * @event Tabs#change\n */\n this.$element.trigger('change.zf.tabs', [$target, $targetContent]);\n\n //fire to children a mutation event\n $targetContent.find(\"[data-mutate]\").trigger(\"mutateme.zf.trigger\");\n }\n\n /**\n * Opens the tab `$targetContent` defined by `$target`.\n * @param {jQuery} $target - Tab to open.\n * @function\n */\n _openTab($target) {\n var $tabLink = $target.find('[role=\"tab\"]'),\n hash = $tabLink.attr('data-tabs-target') || $tabLink[0].hash.slice(1),\n $targetContent = this.$tabContent.find(`#${hash}`);\n\n $target.addClass(`${this.options.linkActiveClass}`);\n\n $tabLink.attr({\n 'aria-selected': 'true',\n 'tabindex': '0'\n });\n\n $targetContent\n .addClass(`${this.options.panelActiveClass}`).removeAttr('aria-hidden');\n }\n\n /**\n * Collapses `$targetContent` defined by `$target`.\n * @param {jQuery} $target - Tab to collapse.\n * @function\n */\n _collapseTab($target) {\n var $target_anchor = $target\n .removeClass(`${this.options.linkActiveClass}`)\n .find('[role=\"tab\"]')\n .attr({\n 'aria-selected': 'false',\n 'tabindex': -1\n });\n\n $(`#${$target_anchor.attr('aria-controls')}`)\n .removeClass(`${this.options.panelActiveClass}`)\n .attr({ 'aria-hidden': 'true' })\n }\n\n /**\n * Collapses the active Tab.\n * @fires Tabs#collapse\n * @function\n */\n _collapse() {\n var $activeTab = this.$element.find(`.${this.options.linkClass}.${this.options.linkActiveClass}`);\n\n if ($activeTab.length) {\n this._collapseTab($activeTab);\n\n /**\n * Fires when the plugin has successfully collapsed tabs.\n * @event Tabs#collapse\n */\n this.$element.trigger('collapse.zf.tabs', [$activeTab]);\n }\n }\n\n /**\n * Public method for selecting a content pane to display.\n * @param {jQuery | String} elem - jQuery object or string of the id of the pane to display.\n * @param {boolean} historyHandled - browser has already handled a history update\n * @function\n */\n selectTab(elem, historyHandled) {\n var idStr;\n\n if (typeof elem === 'object') {\n idStr = elem[0].id;\n } else {\n idStr = elem;\n }\n\n if (idStr.indexOf('#') < 0) {\n idStr = `#${idStr}`;\n }\n\n var $target = this.$tabTitles.has(`[href$=\"${idStr}\"]`);\n\n this._handleTabChange($target, historyHandled);\n };\n\n /**\n * Sets the height of each panel to the height of the tallest panel.\n * If enabled in options, gets called on media query change.\n * If loading content via external source, can be called directly or with _reflow.\n * If enabled with `data-match-height=\"true\"`, tabs sets to equal height\n * @function\n * @private\n */\n _setHeight() {\n var max = 0,\n _this = this; // Lock down the `this` value for the root tabs object\n\n this.$tabContent\n .find(`.${this.options.panelClass}`)\n .css('height', '')\n .each(function() {\n\n var panel = $(this),\n isActive = panel.hasClass(`${_this.options.panelActiveClass}`); // get the options from the parent instead of trying to get them from the child\n\n if (!isActive) {\n panel.css({'visibility': 'hidden', 'display': 'block'});\n }\n\n var temp = this.getBoundingClientRect().height;\n\n if (!isActive) {\n panel.css({\n 'visibility': '',\n 'display': ''\n });\n }\n\n max = temp > max ? temp : max;\n })\n .css('height', `${max}px`);\n }\n\n /**\n * Destroys an instance of tabs.\n * @fires Tabs#destroyed\n */\n _destroy() {\n this.$element\n .find(`.${this.options.linkClass}`)\n .off('.zf.tabs').hide().end()\n .find(`.${this.options.panelClass}`)\n .hide();\n\n if (this.options.matchHeight) {\n if (this._setHeightMqHandler != null) {\n $(window).off('changed.zf.mediaquery', this._setHeightMqHandler);\n }\n }\n\n if (this.options.deepLink) {\n $(window).off('hashchange', this._checkDeepLink);\n }\n\n if (this.onLoadListener) {\n $(window).off(this.onLoadListener);\n }\n }\n}\n\nTabs.defaults = {\n /**\n * Link the location hash to the active pane.\n * Set the location hash when the active pane changes, and open the corresponding pane when the location changes.\n * @option\n * @type {boolean}\n * @default false\n */\n deepLink: false,\n\n /**\n * If `deepLink` is enabled, adjust the deep link scroll to make sure the top of the tab panel is visible\n * @option\n * @type {boolean}\n * @default false\n */\n deepLinkSmudge: false,\n\n /**\n * If `deepLinkSmudge` is enabled, animation time (ms) for the deep link adjustment\n * @option\n * @type {number}\n * @default 300\n */\n deepLinkSmudgeDelay: 300,\n\n /**\n * If `deepLink` is enabled, update the browser history with the open tab\n * @option\n * @type {boolean}\n * @default false\n */\n updateHistory: false,\n\n /**\n * Allows the window to scroll to content of active pane on load.\n * Not recommended if more than one tab panel per page.\n * @option\n * @type {boolean}\n * @default false\n */\n autoFocus: false,\n\n /**\n * Allows keyboard input to 'wrap' around the tab links.\n * @option\n * @type {boolean}\n * @default true\n */\n wrapOnKeys: true,\n\n /**\n * Allows the tab content panes to match heights if set to true.\n * @option\n * @type {boolean}\n * @default false\n */\n matchHeight: false,\n\n /**\n * Allows active tabs to collapse when clicked.\n * @option\n * @type {boolean}\n * @default false\n */\n activeCollapse: false,\n\n /**\n * Class applied to `li`'s in tab link list.\n * @option\n * @type {string}\n * @default 'tabs-title'\n */\n linkClass: 'tabs-title',\n\n /**\n * Class applied to the active `li` in tab link list.\n * @option\n * @type {string}\n * @default 'is-active'\n */\n linkActiveClass: 'is-active',\n\n /**\n * Class applied to the content containers.\n * @option\n * @type {string}\n * @default 'tabs-panel'\n */\n panelClass: 'tabs-panel',\n\n /**\n * Class applied to the active content container.\n * @option\n * @type {string}\n * @default 'is-active'\n */\n panelActiveClass: 'is-active'\n};\n\nexport {Tabs};\n","'use strict';\n\nimport $ from 'jquery';\nimport { Motion } from './foundation.util.motion';\nimport { Plugin } from './foundation.core.plugin';\nimport { RegExpEscape } from './foundation.core.utils';\nimport { Triggers } from './foundation.util.triggers';\n\n/**\n * Toggler module.\n * @module foundation.toggler\n * @requires foundation.util.motion\n * @requires foundation.util.triggers\n */\n\nclass Toggler extends Plugin {\n /**\n * Creates a new instance of Toggler.\n * @class\n * @name Toggler\n * @fires Toggler#init\n * @param {Object} element - jQuery object to add the trigger to.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, Toggler.defaults, element.data(), options);\n this.className = '';\n this.className = 'Toggler'; // ie9 back compat\n\n // Triggers init is idempotent, just need to make sure it is initialized\n Triggers.init($);\n\n this._init();\n this._events();\n }\n\n /**\n * Initializes the Toggler plugin by parsing the toggle class from data-toggler, or animation classes from data-animate.\n * @function\n * @private\n */\n _init() {\n var input;\n // Parse animation classes if they were set\n if (this.options.animate) {\n input = this.options.animate.split(' ');\n\n this.animationIn = input[0];\n this.animationOut = input[1] || null;\n }\n // Otherwise, parse toggle class\n else {\n input = this.$element.data('toggler');\n // Allow for a . at the beginning of the string\n this.className = input[0] === '.' ? input.slice(1) : input;\n }\n\n // Add ARIA attributes to triggers:\n var id = this.$element[0].id,\n $triggers = $(`[data-open~=\"${id}\"], [data-close~=\"${id}\"], [data-toggle~=\"${id}\"]`);\n\n // - aria-expanded: according to the element visibility.\n $triggers.attr('aria-expanded', !this.$element.is(':hidden'));\n // - aria-controls: adding the element id to it if not already in it.\n $triggers.each((index, trigger) => {\n const $trigger = $(trigger);\n const controls = $trigger.attr('aria-controls') || '';\n\n const containsId = new RegExp(`\\\\b${RegExpEscape(id)}\\\\b`).test(controls);\n if (!containsId) $trigger.attr('aria-controls', controls ? `${controls} ${id}` : id);\n });\n }\n\n /**\n * Initializes events for the toggle trigger.\n * @function\n * @private\n */\n _events() {\n this.$element.off('toggle.zf.trigger').on('toggle.zf.trigger', this.toggle.bind(this));\n }\n\n /**\n * 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\".\n * @function\n * @fires Toggler#on\n * @fires Toggler#off\n */\n toggle() {\n this[ this.options.animate ? '_toggleAnimate' : '_toggleClass']();\n }\n\n _toggleClass() {\n this.$element.toggleClass(this.className);\n\n var isOn = this.$element.hasClass(this.className);\n if (isOn) {\n /**\n * Fires if the target element has the class after a toggle.\n * @event Toggler#on\n */\n this.$element.trigger('on.zf.toggler');\n }\n else {\n /**\n * Fires if the target element does not have the class after a toggle.\n * @event Toggler#off\n */\n this.$element.trigger('off.zf.toggler');\n }\n\n this._updateARIA(isOn);\n this.$element.find('[data-mutate]').trigger('mutateme.zf.trigger');\n }\n\n _toggleAnimate() {\n var _this = this;\n\n if (this.$element.is(':hidden')) {\n Motion.animateIn(this.$element, this.animationIn, function() {\n _this._updateARIA(true);\n this.trigger('on.zf.toggler');\n this.find('[data-mutate]').trigger('mutateme.zf.trigger');\n });\n }\n else {\n Motion.animateOut(this.$element, this.animationOut, function() {\n _this._updateARIA(false);\n this.trigger('off.zf.toggler');\n this.find('[data-mutate]').trigger('mutateme.zf.trigger');\n });\n }\n }\n\n _updateARIA(isOn) {\n var id = this.$element[0].id;\n $(`[data-open=\"${id}\"], [data-close=\"${id}\"], [data-toggle=\"${id}\"]`)\n .attr({\n 'aria-expanded': isOn ? true : false\n });\n }\n\n /**\n * Destroys the instance of Toggler on the element.\n * @function\n */\n _destroy() {\n this.$element.off('.zf.toggler');\n }\n}\n\nToggler.defaults = {\n /**\n * Tells the plugin if the element should animated when toggled.\n * @option\n * @type {boolean}\n * @default false\n */\n animate: false\n};\n\nexport {Toggler};\n","'use strict';\n\nimport $ from 'jquery';\n\nimport { GetYoDigits, ignoreMousedisappear } from './foundation.core.utils';\nimport { MediaQuery } from './foundation.util.mediaQuery';\nimport { Triggers } from './foundation.util.triggers';\nimport { Positionable } from './foundation.positionable';\n\n/**\n * Tooltip module.\n * @module foundation.tooltip\n * @requires foundation.util.box\n * @requires foundation.util.mediaQuery\n * @requires foundation.util.triggers\n */\n\nclass Tooltip extends Positionable {\n /**\n * Creates a new instance of a Tooltip.\n * @class\n * @name Tooltip\n * @fires Tooltip#init\n * @param {jQuery} element - jQuery object to attach a tooltip to.\n * @param {Object} options - object to extend the default configuration.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, Tooltip.defaults, this.$element.data(), options);\n this.className = 'Tooltip'; // ie9 back compat\n\n this.isActive = false;\n this.isClick = false;\n\n // Triggers init is idempotent, just need to make sure it is initialized\n Triggers.init($);\n\n this._init();\n }\n\n /**\n * Initializes the tooltip by setting the creating the tip element, adding it's text, setting private variables and setting attributes on the anchor.\n * @private\n */\n _init() {\n MediaQuery._init();\n var elemId = this.$element.attr('aria-describedby') || GetYoDigits(6, 'tooltip');\n\n this.options.tipText = this.options.tipText || this.$element.attr('title');\n this.template = this.options.template ? $(this.options.template) : this._buildTemplate(elemId);\n\n if (this.options.allowHtml) {\n this.template.appendTo(document.body)\n .html(this.options.tipText)\n .hide();\n } else {\n this.template.appendTo(document.body)\n .text(this.options.tipText)\n .hide();\n }\n\n this.$element.attr({\n 'title': '',\n 'aria-describedby': elemId,\n 'data-yeti-box': elemId,\n 'data-toggle': elemId,\n 'data-resize': elemId\n }).addClass(this.options.triggerClass);\n\n super._init();\n this._events();\n }\n\n _getDefaultPosition() {\n // handle legacy classnames\n var position = this.$element[0].className.match(/\\b(top|left|right|bottom)\\b/g);\n return position ? position[0] : 'top';\n }\n\n _getDefaultAlignment() {\n return 'center';\n }\n\n _getHOffset() {\n if(this.position === 'left' || this.position === 'right') {\n return this.options.hOffset + this.options.tooltipWidth;\n } else {\n return this.options.hOffset\n }\n }\n\n _getVOffset() {\n if(this.position === 'top' || this.position === 'bottom') {\n return this.options.vOffset + this.options.tooltipHeight;\n } else {\n return this.options.vOffset\n }\n }\n\n /**\n * builds the tooltip element, adds attributes, and returns the template.\n * @private\n */\n _buildTemplate(id) {\n var templateClasses = (`${this.options.tooltipClass} ${this.options.templateClasses}`).trim();\n var $template = $('<div></div>').addClass(templateClasses).attr({\n 'role': 'tooltip',\n 'aria-hidden': true,\n 'data-is-active': false,\n 'data-is-focus': false,\n 'id': id\n });\n return $template;\n }\n\n /**\n * 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.\n * if the tooltip is larger than the screen width, default to full width - any user selected margin\n * @private\n */\n _setPosition() {\n super._setPosition(this.$element, this.template);\n }\n\n /**\n * reveals the tooltip, and fires an event to close any other open tooltips on the page\n * @fires Tooltip#closeme\n * @fires Tooltip#show\n * @function\n */\n show() {\n if (this.options.showOn !== 'all' && !MediaQuery.is(this.options.showOn)) {\n // console.error('The screen is too small to display this tooltip');\n return false;\n }\n\n var _this = this;\n this.template.css('visibility', 'hidden').show();\n this._setPosition();\n this.template.removeClass('top bottom left right').addClass(this.position)\n this.template.removeClass('align-top align-bottom align-left align-right align-center').addClass('align-' + this.alignment);\n\n /**\n * Fires to close all other open tooltips on the page\n * @event Closeme#tooltip\n */\n this.$element.trigger('closeme.zf.tooltip', this.template.attr('id'));\n\n\n this.template.attr({\n 'data-is-active': true,\n 'aria-hidden': false\n });\n _this.isActive = true;\n // console.log(this.template);\n this.template.stop().hide().css('visibility', '').fadeIn(this.options.fadeInDuration, function() {\n //maybe do stuff?\n });\n /**\n * Fires when the tooltip is shown\n * @event Tooltip#show\n */\n this.$element.trigger('show.zf.tooltip');\n }\n\n /**\n * Hides the current tooltip, and resets the positioning class if it was changed due to collision\n * @fires Tooltip#hide\n * @function\n */\n hide() {\n // console.log('hiding', this.$element.data('yeti-box'));\n var _this = this;\n this.template.stop().attr({\n 'aria-hidden': true,\n 'data-is-active': false\n }).fadeOut(this.options.fadeOutDuration, function() {\n _this.isActive = false;\n _this.isClick = false;\n });\n /**\n * fires when the tooltip is hidden\n * @event Tooltip#hide\n */\n this.$element.trigger('hide.zf.tooltip');\n }\n\n /**\n * adds event listeners for the tooltip and its anchor\n * TODO combine some of the listeners like focus and mouseenter, etc.\n * @private\n */\n _events() {\n var _this = this;\n var $template = this.template;\n var isFocus = false;\n\n if (!this.options.disableHover) {\n\n this.$element\n .on('mouseenter.zf.tooltip', function(e) {\n if (!_this.isActive) {\n _this.timeout = setTimeout(function() {\n _this.show();\n }, _this.options.hoverDelay);\n }\n })\n .on('mouseleave.zf.tooltip', ignoreMousedisappear(function(e) {\n clearTimeout(_this.timeout);\n if (!isFocus || (_this.isClick && !_this.options.clickOpen)) {\n _this.hide();\n }\n }));\n }\n\n if (this.options.clickOpen) {\n this.$element.on('mousedown.zf.tooltip', function(e) {\n e.stopImmediatePropagation();\n if (_this.isClick) {\n //_this.hide();\n // _this.isClick = false;\n } else {\n _this.isClick = true;\n if ((_this.options.disableHover || !_this.$element.attr('tabindex')) && !_this.isActive) {\n _this.show();\n }\n }\n });\n } else {\n this.$element.on('mousedown.zf.tooltip', function(e) {\n e.stopImmediatePropagation();\n _this.isClick = true;\n });\n }\n\n if (!this.options.disableForTouch) {\n this.$element\n .on('tap.zf.tooltip touchend.zf.tooltip', function(e) {\n _this.isActive ? _this.hide() : _this.show();\n });\n }\n\n this.$element.on({\n // 'toggle.zf.trigger': this.toggle.bind(this),\n // 'close.zf.trigger': this.hide.bind(this)\n 'close.zf.trigger': this.hide.bind(this)\n });\n\n this.$element\n .on('focus.zf.tooltip', function(e) {\n isFocus = true;\n if (_this.isClick) {\n // If we're not showing open on clicks, we need to pretend a click-launched focus isn't\n // a real focus, otherwise on hover and come back we get bad behavior\n if(!_this.options.clickOpen) { isFocus = false; }\n return false;\n } else {\n _this.show();\n }\n })\n\n .on('focusout.zf.tooltip', function(e) {\n isFocus = false;\n _this.isClick = false;\n _this.hide();\n })\n\n .on('resizeme.zf.trigger', function() {\n if (_this.isActive) {\n _this._setPosition();\n }\n });\n }\n\n /**\n * adds a toggle method, in addition to the static show() & hide() functions\n * @function\n */\n toggle() {\n if (this.isActive) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n /**\n * Destroys an instance of tooltip, removes template element from the view.\n * @function\n */\n _destroy() {\n this.$element.attr('title', this.template.text())\n .off('.zf.trigger .zf.tooltip')\n .removeClass(this.options.triggerClass)\n .removeClass('top right left bottom')\n .removeAttr('aria-describedby data-disable-hover data-resize data-toggle data-tooltip data-yeti-box');\n\n this.template.remove();\n }\n}\n\nTooltip.defaults = {\n disableForTouch: false,\n /**\n * Time, in ms, before a tooltip should open on hover.\n * @option\n * @type {number}\n * @default 200\n */\n hoverDelay: 200,\n /**\n * Time, in ms, a tooltip should take to fade into view.\n * @option\n * @type {number}\n * @default 150\n */\n fadeInDuration: 150,\n /**\n * Time, in ms, a tooltip should take to fade out of view.\n * @option\n * @type {number}\n * @default 150\n */\n fadeOutDuration: 150,\n /**\n * Disables hover events from opening the tooltip if set to true\n * @option\n * @type {boolean}\n * @default false\n */\n disableHover: false,\n /**\n * Optional addtional classes to apply to the tooltip template on init.\n * @option\n * @type {string}\n * @default ''\n */\n templateClasses: '',\n /**\n * Non-optional class added to tooltip templates. Foundation default is 'tooltip'.\n * @option\n * @type {string}\n * @default 'tooltip'\n */\n tooltipClass: 'tooltip',\n /**\n * Class applied to the tooltip anchor element.\n * @option\n * @type {string}\n * @default 'has-tip'\n */\n triggerClass: 'has-tip',\n /**\n * Minimum breakpoint size at which to open the tooltip.\n * @option\n * @type {string}\n * @default 'small'\n */\n showOn: 'small',\n /**\n * Custom template to be used to generate markup for tooltip.\n * @option\n * @type {string}\n * @default ''\n */\n template: '',\n /**\n * Text displayed in the tooltip template on open.\n * @option\n * @type {string}\n * @default ''\n */\n tipText: '',\n touchCloseText: 'Tap to close.',\n /**\n * Allows the tooltip to remain open if triggered with a click or touch event.\n * @option\n * @type {boolean}\n * @default true\n */\n clickOpen: true,\n /**\n * Position of tooltip. Can be left, right, bottom, top, or auto.\n * @option\n * @type {string}\n * @default 'auto'\n */\n position: 'auto',\n /**\n * Alignment of tooltip relative to anchor. Can be left, right, bottom, top, center, or auto.\n * @option\n * @type {string}\n * @default 'auto'\n */\n alignment: 'auto',\n /**\n * Allow overlap of container/window. If false, tooltip will first try to\n * position as defined by data-position and data-alignment, but reposition if\n * it would cause an overflow. @option\n * @type {boolean}\n * @default false\n */\n allowOverlap: false,\n /**\n * Allow overlap of only the bottom of the container. This is the most common\n * behavior for dropdowns, allowing the dropdown to extend the bottom of the\n * screen but not otherwise influence or break out of the container.\n * Less common for tooltips.\n * @option\n * @type {boolean}\n * @default false\n */\n allowBottomOverlap: false,\n /**\n * Distance, in pixels, the template should push away from the anchor on the Y axis.\n * @option\n * @type {number}\n * @default 0\n */\n vOffset: 0,\n /**\n * Distance, in pixels, the template should push away from the anchor on the X axis\n * @option\n * @type {number}\n * @default 0\n */\n hOffset: 0,\n /**\n * Distance, in pixels, the template spacing auto-adjust for a vertical tooltip\n * @option\n * @type {number}\n * @default 14\n */\n tooltipHeight: 14,\n /**\n * Distance, in pixels, the template spacing auto-adjust for a horizontal tooltip\n * @option\n * @type {number}\n * @default 12\n */\n tooltipWidth: 12,\n /**\n * Allow HTML in tooltip. Warning: If you are loading user-generated content into tooltips,\n * allowing HTML may open yourself up to XSS attacks.\n * @option\n * @type {boolean}\n * @default false\n */\n allowHtml: false\n};\n\n/**\n * TODO utilize resize event trigger\n */\n\nexport {Tooltip};\n","'use strict';\n\n\nimport { rtl as Rtl } from \"./foundation.core.utils\";\n\nvar Box = {\n ImNotTouchingYou: ImNotTouchingYou,\n OverlapArea: OverlapArea,\n GetDimensions: GetDimensions,\n GetOffsets: GetOffsets,\n GetExplicitOffsets: GetExplicitOffsets\n}\n\n/**\n * Compares the dimensions of an element to a container and determines collision events with container.\n * @function\n * @param {jQuery} element - jQuery object to test for collisions.\n * @param {jQuery} parent - jQuery object to use as bounding container.\n * @param {Boolean} lrOnly - set to true to check left and right values only.\n * @param {Boolean} tbOnly - set to true to check top and bottom values only.\n * @default if no parent object passed, detects collisions with `window`.\n * @returns {Boolean} - true if collision free, false if a collision in any direction.\n */\nfunction ImNotTouchingYou(element, parent, lrOnly, tbOnly, ignoreBottom) {\n return OverlapArea(element, parent, lrOnly, tbOnly, ignoreBottom) === 0;\n};\n\nfunction OverlapArea(element, parent, lrOnly, tbOnly, ignoreBottom) {\n var eleDims = GetDimensions(element),\n topOver, bottomOver, leftOver, rightOver;\n if (parent) {\n var parDims = GetDimensions(parent);\n\n bottomOver = (parDims.height + parDims.offset.top) - (eleDims.offset.top + eleDims.height);\n topOver = eleDims.offset.top - parDims.offset.top;\n leftOver = eleDims.offset.left - parDims.offset.left;\n rightOver = (parDims.width + parDims.offset.left) - (eleDims.offset.left + eleDims.width);\n }\n else {\n bottomOver = (eleDims.windowDims.height + eleDims.windowDims.offset.top) - (eleDims.offset.top + eleDims.height);\n topOver = eleDims.offset.top - eleDims.windowDims.offset.top;\n leftOver = eleDims.offset.left - eleDims.windowDims.offset.left;\n rightOver = eleDims.windowDims.width - (eleDims.offset.left + eleDims.width);\n }\n\n bottomOver = ignoreBottom ? 0 : Math.min(bottomOver, 0);\n topOver = Math.min(topOver, 0);\n leftOver = Math.min(leftOver, 0);\n rightOver = Math.min(rightOver, 0);\n\n if (lrOnly) {\n return leftOver + rightOver;\n }\n if (tbOnly) {\n return topOver + bottomOver;\n }\n\n // use sum of squares b/c we care about overlap area.\n return Math.sqrt((topOver * topOver) + (bottomOver * bottomOver) + (leftOver * leftOver) + (rightOver * rightOver));\n}\n\n/**\n * Uses native methods to return an object of dimension values.\n * @function\n * @param {jQuery || HTML} element - jQuery object or DOM element for which to get the dimensions. Can be any element other that document or window.\n * @returns {Object} - nested object of integer pixel values\n * TODO - if element is window, return only those values.\n */\nfunction GetDimensions(elem){\n elem = elem.length ? elem[0] : elem;\n\n if (elem === window || elem === document) {\n throw new Error(\"I'm sorry, Dave. I'm afraid I can't do that.\");\n }\n\n var rect = elem.getBoundingClientRect(),\n parRect = elem.parentNode.getBoundingClientRect(),\n winRect = document.body.getBoundingClientRect(),\n winY = window.pageYOffset,\n winX = window.pageXOffset;\n\n return {\n width: rect.width,\n height: rect.height,\n offset: {\n top: rect.top + winY,\n left: rect.left + winX\n },\n parentDims: {\n width: parRect.width,\n height: parRect.height,\n offset: {\n top: parRect.top + winY,\n left: parRect.left + winX\n }\n },\n windowDims: {\n width: winRect.width,\n height: winRect.height,\n offset: {\n top: winY,\n left: winX\n }\n }\n }\n}\n\n/**\n * Returns an object of top and left integer pixel values for dynamically rendered elements,\n * such as: Tooltip, Reveal, and Dropdown. Maintained for backwards compatibility, and where\n * you don't know alignment, but generally from\n * 6.4 forward you should use GetExplicitOffsets, as GetOffsets conflates position and alignment.\n * @function\n * @param {jQuery} element - jQuery object for the element being positioned.\n * @param {jQuery} anchor - jQuery object for the element's anchor point.\n * @param {String} position - a string relating to the desired position of the element, relative to it's anchor\n * @param {Number} vOffset - integer pixel value of desired vertical separation between anchor and element.\n * @param {Number} hOffset - integer pixel value of desired horizontal separation between anchor and element.\n * @param {Boolean} isOverflow - if a collision event is detected, sets to true to default the element to full width - any desired offset.\n * TODO alter/rewrite to work with `em` values as well/instead of pixels\n */\nfunction GetOffsets(element, anchor, position, vOffset, hOffset, isOverflow) {\n console.log(\"NOTE: GetOffsets is deprecated in favor of GetExplicitOffsets and will be removed in 6.5\");\n switch (position) {\n case 'top':\n return Rtl() ?\n GetExplicitOffsets(element, anchor, 'top', 'left', vOffset, hOffset, isOverflow) :\n GetExplicitOffsets(element, anchor, 'top', 'right', vOffset, hOffset, isOverflow);\n case 'bottom':\n return Rtl() ?\n GetExplicitOffsets(element, anchor, 'bottom', 'left', vOffset, hOffset, isOverflow) :\n GetExplicitOffsets(element, anchor, 'bottom', 'right', vOffset, hOffset, isOverflow);\n case 'center top':\n return GetExplicitOffsets(element, anchor, 'top', 'center', vOffset, hOffset, isOverflow);\n case 'center bottom':\n return GetExplicitOffsets(element, anchor, 'bottom', 'center', vOffset, hOffset, isOverflow);\n case 'center left':\n return GetExplicitOffsets(element, anchor, 'left', 'center', vOffset, hOffset, isOverflow);\n case 'center right':\n return GetExplicitOffsets(element, anchor, 'right', 'center', vOffset, hOffset, isOverflow);\n case 'left bottom':\n return GetExplicitOffsets(element, anchor, 'bottom', 'left', vOffset, hOffset, isOverflow);\n case 'right bottom':\n return GetExplicitOffsets(element, anchor, 'bottom', 'right', vOffset, hOffset, isOverflow);\n // Backwards compatibility... this along with the reveal and reveal full\n // classes are the only ones that didn't reference anchor\n case 'center':\n return {\n left: ($eleDims.windowDims.offset.left + ($eleDims.windowDims.width / 2)) - ($eleDims.width / 2) + hOffset,\n top: ($eleDims.windowDims.offset.top + ($eleDims.windowDims.height / 2)) - ($eleDims.height / 2 + vOffset)\n }\n case 'reveal':\n return {\n left: ($eleDims.windowDims.width - $eleDims.width) / 2 + hOffset,\n top: $eleDims.windowDims.offset.top + vOffset\n }\n case 'reveal full':\n return {\n left: $eleDims.windowDims.offset.left,\n top: $eleDims.windowDims.offset.top\n }\n break;\n default:\n return {\n left: (Rtl() ? $anchorDims.offset.left - $eleDims.width + $anchorDims.width - hOffset: $anchorDims.offset.left + hOffset),\n top: $anchorDims.offset.top + $anchorDims.height + vOffset\n }\n\n }\n\n}\n\nfunction GetExplicitOffsets(element, anchor, position, alignment, vOffset, hOffset, isOverflow) {\n var $eleDims = GetDimensions(element),\n $anchorDims = anchor ? GetDimensions(anchor) : null;\n\n var topVal, leftVal;\n\n // set position related attribute\n\n switch (position) {\n case 'top':\n topVal = $anchorDims.offset.top - ($eleDims.height + vOffset);\n break;\n case 'bottom':\n topVal = $anchorDims.offset.top + $anchorDims.height + vOffset;\n break;\n case 'left':\n leftVal = $anchorDims.offset.left - ($eleDims.width + hOffset);\n break;\n case 'right':\n leftVal = $anchorDims.offset.left + $anchorDims.width + hOffset;\n break;\n }\n\n\n // set alignment related attribute\n switch (position) {\n case 'top':\n case 'bottom':\n switch (alignment) {\n case 'left':\n leftVal = $anchorDims.offset.left + hOffset;\n break;\n case 'right':\n leftVal = $anchorDims.offset.left - $eleDims.width + $anchorDims.width - hOffset;\n break;\n case 'center':\n leftVal = isOverflow ? hOffset : (($anchorDims.offset.left + ($anchorDims.width / 2)) - ($eleDims.width / 2)) + hOffset;\n break;\n }\n break;\n case 'right':\n case 'left':\n switch (alignment) {\n case 'bottom':\n topVal = $anchorDims.offset.top - vOffset + $anchorDims.height - $eleDims.height;\n break;\n case 'top':\n topVal = $anchorDims.offset.top + vOffset\n break;\n case 'center':\n topVal = ($anchorDims.offset.top + vOffset + ($anchorDims.height / 2)) - ($eleDims.height / 2)\n break;\n }\n break;\n }\n return {top: topVal, left: leftVal};\n}\n\nexport {Box};\n","'use strict';\n\nimport $ from 'jquery';\n\n/**\n * Runs a callback function when images are fully loaded.\n * @param {Object} images - Image(s) to check if loaded.\n * @param {Func} callback - Function to execute when image is fully loaded.\n */\nfunction onImagesLoaded(images, callback){\n var self = this,\n unloaded = images.length;\n\n if (unloaded === 0) {\n callback();\n }\n\n images.each(function(){\n // Check if image is loaded\n if (this.complete && typeof this.naturalWidth !== 'undefined') {\n singleImageLoaded();\n }\n else {\n // If the above check failed, simulate loading on detached element.\n var image = new Image();\n // Still count image as loaded if it finalizes with an error.\n var events = \"load.zf.images error.zf.images\";\n $(image).one(events, function me(event){\n // Unbind the event listeners. We're using 'one' but only one of the two events will have fired.\n $(this).off(events, me);\n singleImageLoaded();\n });\n image.src = $(this).attr('src');\n }\n });\n\n function singleImageLoaded() {\n unloaded--;\n if (unloaded === 0) {\n callback();\n }\n }\n}\n\nexport { onImagesLoaded };\n","/*******************************************\n * *\n * This util was created by Marius Olbertz *\n * Please thank Marius on GitHub /owlbertz *\n * or the web http://www.mariusolbertz.de/ *\n * *\n ******************************************/\n\n'use strict';\n\nimport $ from 'jquery';\nimport { rtl as Rtl } from './foundation.core.utils';\n\nconst keyCodes = {\n 9: 'TAB',\n 13: 'ENTER',\n 27: 'ESCAPE',\n 32: 'SPACE',\n 35: 'END',\n 36: 'HOME',\n 37: 'ARROW_LEFT',\n 38: 'ARROW_UP',\n 39: 'ARROW_RIGHT',\n 40: 'ARROW_DOWN'\n}\n\nvar commands = {}\n\n// Functions pulled out to be referenceable from internals\nfunction findFocusable($element) {\n if(!$element) {return false; }\n 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() {\n if (!$(this).is(':visible') || $(this).attr('tabindex') < 0) { return false; } //only have visible elements and those that have a tabindex greater or equal 0\n return true;\n });\n}\n\nfunction parseKey(event) {\n var key = keyCodes[event.which || event.keyCode] || String.fromCharCode(event.which).toUpperCase();\n\n // Remove un-printable characters, e.g. for `fromCharCode` calls for CTRL only events\n key = key.replace(/\\W+/, '');\n\n if (event.shiftKey) key = `SHIFT_${key}`;\n if (event.ctrlKey) key = `CTRL_${key}`;\n if (event.altKey) key = `ALT_${key}`;\n\n // Remove trailing underscore, in case only modifiers were used (e.g. only `CTRL_ALT`)\n key = key.replace(/_$/, '');\n\n return key;\n}\n\nvar Keyboard = {\n keys: getKeyCodes(keyCodes),\n\n /**\n * Parses the (keyboard) event and returns a String that represents its key\n * Can be used like Foundation.parseKey(event) === Foundation.keys.SPACE\n * @param {Event} event - the event generated by the event handler\n * @return String key - String that represents the key pressed\n */\n parseKey: parseKey,\n\n /**\n * Handles the given (keyboard) event\n * @param {Event} event - the event generated by the event handler\n * @param {String} component - Foundation component's name, e.g. Slider or Reveal\n * @param {Objects} functions - collection of functions that are to be executed\n */\n handleKey(event, component, functions) {\n var commandList = commands[component],\n keyCode = this.parseKey(event),\n cmds,\n command,\n fn;\n\n if (!commandList) return console.warn('Component not defined!');\n\n if (typeof commandList.ltr === 'undefined') { // this component does not differentiate between ltr and rtl\n cmds = commandList; // use plain list\n } else { // merge ltr and rtl: if document is rtl, rtl overwrites ltr and vice versa\n if (Rtl()) cmds = $.extend({}, commandList.ltr, commandList.rtl);\n\n else cmds = $.extend({}, commandList.rtl, commandList.ltr);\n }\n command = cmds[keyCode];\n\n fn = functions[command];\n if (fn && typeof fn === 'function') { // execute function if exists\n var returnValue = fn.apply();\n if (functions.handled || typeof functions.handled === 'function') { // execute function when event was handled\n functions.handled(returnValue);\n }\n } else {\n if (functions.unhandled || typeof functions.unhandled === 'function') { // execute function when event was not handled\n functions.unhandled();\n }\n }\n },\n\n /**\n * Finds all focusable elements within the given `$element`\n * @param {jQuery} $element - jQuery object to search within\n * @return {jQuery} $focusable - all focusable elements within `$element`\n */\n\n findFocusable: findFocusable,\n\n /**\n * Returns the component name name\n * @param {Object} component - Foundation component, e.g. Slider or Reveal\n * @return String componentName\n */\n\n register(componentName, cmds) {\n commands[componentName] = cmds;\n },\n\n\n // TODO9438: These references to Keyboard need to not require global. Will 'this' work in this context?\n //\n /**\n * Traps the focus in the given element.\n * @param {jQuery} $element jQuery object to trap the foucs into.\n */\n trapFocus($element) {\n var $focusable = findFocusable($element),\n $firstFocusable = $focusable.eq(0),\n $lastFocusable = $focusable.eq(-1);\n\n $element.on('keydown.zf.trapfocus', function(event) {\n if (event.target === $lastFocusable[0] && parseKey(event) === 'TAB') {\n event.preventDefault();\n $firstFocusable.focus();\n }\n else if (event.target === $firstFocusable[0] && parseKey(event) === 'SHIFT_TAB') {\n event.preventDefault();\n $lastFocusable.focus();\n }\n });\n },\n /**\n * Releases the trapped focus from the given element.\n * @param {jQuery} $element jQuery object to release the focus for.\n */\n releaseFocus($element) {\n $element.off('keydown.zf.trapfocus');\n }\n}\n\n/*\n * Constants for easier comparing.\n * Can be used like Foundation.parseKey(event) === Foundation.keys.SPACE\n */\nfunction getKeyCodes(kcs) {\n var k = {};\n for (var kc in kcs) k[kcs[kc]] = kcs[kc];\n return k;\n}\n\nexport {Keyboard};\n","'use strict';\n\nimport $ from 'jquery';\n\n// Default set of media queries\nconst defaultQueries = {\n 'default' : 'only screen',\n landscape : 'only screen and (orientation: landscape)',\n portrait : 'only screen and (orientation: portrait)',\n retina : 'only screen and (-webkit-min-device-pixel-ratio: 2),' +\n 'only screen and (min--moz-device-pixel-ratio: 2),' +\n 'only screen and (-o-min-device-pixel-ratio: 2/1),' +\n 'only screen and (min-device-pixel-ratio: 2),' +\n 'only screen and (min-resolution: 192dpi),' +\n 'only screen and (min-resolution: 2dppx)'\n };\n\n\n// matchMedia() polyfill - Test a CSS media type/query in JS.\n// Authors & copyright(c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. MIT license\n/* eslint-disable */\nwindow.matchMedia || (window.matchMedia = (function () {\n \"use strict\";\n\n // For browsers that support matchMedium api such as IE 9 and webkit\n var styleMedia = (window.styleMedia || window.media);\n\n // For those that don't support matchMedium\n if (!styleMedia) {\n var style = document.createElement('style'),\n script = document.getElementsByTagName('script')[0],\n info = null;\n\n style.type = 'text/css';\n style.id = 'matchmediajs-test';\n\n if (!script) {\n document.head.appendChild(style);\n } else {\n script.parentNode.insertBefore(style, script);\n }\n\n // 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers\n info = ('getComputedStyle' in window) && window.getComputedStyle(style, null) || style.currentStyle;\n\n styleMedia = {\n matchMedium: function (media) {\n var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }';\n\n // 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers\n if (style.styleSheet) {\n style.styleSheet.cssText = text;\n } else {\n style.textContent = text;\n }\n\n // Test if media query is true or false\n return info.width === '1px';\n }\n };\n }\n\n return function(media) {\n return {\n matches: styleMedia.matchMedium(media || 'all'),\n media: media || 'all'\n };\n };\n})());\n/* eslint-enable */\n\nvar MediaQuery = {\n queries: [],\n\n current: '',\n\n /**\n * Initializes the media query helper, by extracting the breakpoint list from the CSS and activating the breakpoint watcher.\n * @function\n * @private\n */\n _init() {\n var self = this;\n var $meta = $('meta.foundation-mq');\n if(!$meta.length){\n $('<meta class=\"foundation-mq\">').appendTo(document.head);\n }\n\n var extractedStyles = $('.foundation-mq').css('font-family');\n var namedQueries;\n\n namedQueries = parseStyleToObject(extractedStyles);\n\n for (var key in namedQueries) {\n if(namedQueries.hasOwnProperty(key)) {\n self.queries.push({\n name: key,\n value: `only screen and (min-width: ${namedQueries[key]})`\n });\n }\n }\n\n this.current = this._getCurrentSize();\n\n this._watcher();\n },\n\n /**\n * Checks if the screen is at least as wide as a breakpoint.\n * @function\n * @param {String} size - Name of the breakpoint to check.\n * @returns {Boolean} `true` if the breakpoint matches, `false` if it's smaller.\n */\n atLeast(size) {\n var query = this.get(size);\n\n if (query) {\n return window.matchMedia(query).matches;\n }\n\n return false;\n },\n\n /**\n * Checks if the screen matches to a breakpoint.\n * @function\n * @param {String} size - Name of the breakpoint to check, either 'small only' or 'small'. Omitting 'only' falls back to using atLeast() method.\n * @returns {Boolean} `true` if the breakpoint matches, `false` if it does not.\n */\n is(size) {\n size = size.trim().split(' ');\n if(size.length > 1 && size[1] === 'only') {\n if(size[0] === this._getCurrentSize()) return true;\n } else {\n return this.atLeast(size[0]);\n }\n return false;\n },\n\n /**\n * Gets the media query of a breakpoint.\n * @function\n * @param {String} size - Name of the breakpoint to get.\n * @returns {String|null} - The media query of the breakpoint, or `null` if the breakpoint doesn't exist.\n */\n get(size) {\n for (var i in this.queries) {\n if(this.queries.hasOwnProperty(i)) {\n var query = this.queries[i];\n if (size === query.name) return query.value;\n }\n }\n\n return null;\n },\n\n /**\n * Gets the current breakpoint name by testing every breakpoint and returning the last one to match (the biggest one).\n * @function\n * @private\n * @returns {String} Name of the current breakpoint.\n */\n _getCurrentSize() {\n var matched;\n\n for (var i = 0; i < this.queries.length; i++) {\n var query = this.queries[i];\n\n if (window.matchMedia(query.value).matches) {\n matched = query;\n }\n }\n\n if (typeof matched === 'object') {\n return matched.name;\n } else {\n return matched;\n }\n },\n\n /**\n * Activates the breakpoint watcher, which fires an event on the window whenever the breakpoint changes.\n * @function\n * @private\n */\n _watcher() {\n $(window).off('resize.zf.mediaquery').on('resize.zf.mediaquery', () => {\n var newSize = this._getCurrentSize(), currentSize = this.current;\n\n if (newSize !== currentSize) {\n // Change the current media query\n this.current = newSize;\n\n // Broadcast the media query change on the window\n $(window).trigger('changed.zf.mediaquery', [newSize, currentSize]);\n }\n });\n }\n};\n\n\n\n// Thank you: https://github.com/sindresorhus/query-string\nfunction parseStyleToObject(str) {\n var styleObject = {};\n\n if (typeof str !== 'string') {\n return styleObject;\n }\n\n str = str.trim().slice(1, -1); // browsers re-quote string style values\n\n if (!str) {\n return styleObject;\n }\n\n styleObject = str.split('&').reduce(function(ret, param) {\n var parts = param.replace(/\\+/g, ' ').split('=');\n var key = parts[0];\n var val = parts[1];\n key = decodeURIComponent(key);\n\n // missing `=` should be `null`:\n // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters\n val = typeof val === 'undefined' ? null : decodeURIComponent(val);\n\n if (!ret.hasOwnProperty(key)) {\n ret[key] = val;\n } else if (Array.isArray(ret[key])) {\n ret[key].push(val);\n } else {\n ret[key] = [ret[key], val];\n }\n return ret;\n }, {});\n\n return styleObject;\n}\n\nexport {MediaQuery};\n","'use strict';\n\nimport $ from 'jquery';\nimport { transitionend } from './foundation.core.utils';\n\n/**\n * Motion module.\n * @module foundation.motion\n */\n\nconst initClasses = ['mui-enter', 'mui-leave'];\nconst activeClasses = ['mui-enter-active', 'mui-leave-active'];\n\nconst Motion = {\n animateIn: function(element, animation, cb) {\n animate(true, element, animation, cb);\n },\n\n animateOut: function(element, animation, cb) {\n animate(false, element, animation, cb);\n }\n}\n\nfunction Move(duration, elem, fn){\n var anim, prog, start = null;\n // console.log('called');\n\n if (duration === 0) {\n fn.apply(elem);\n elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]);\n return;\n }\n\n function move(ts){\n if(!start) start = ts;\n // console.log(start, ts);\n prog = ts - start;\n fn.apply(elem);\n\n if(prog < duration){ anim = window.requestAnimationFrame(move, elem); }\n else{\n window.cancelAnimationFrame(anim);\n elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]);\n }\n }\n anim = window.requestAnimationFrame(move);\n}\n\n/**\n * Animates an element in or out using a CSS transition class.\n * @function\n * @private\n * @param {Boolean} isIn - Defines if the animation is in or out.\n * @param {Object} element - jQuery or HTML object to animate.\n * @param {String} animation - CSS class to use.\n * @param {Function} cb - Callback to run when animation is finished.\n */\nfunction animate(isIn, element, animation, cb) {\n element = $(element).eq(0);\n\n if (!element.length) return;\n\n var initClass = isIn ? initClasses[0] : initClasses[1];\n var activeClass = isIn ? activeClasses[0] : activeClasses[1];\n\n // Set up the animation\n reset();\n\n element\n .addClass(animation)\n .css('transition', 'none');\n\n requestAnimationFrame(() => {\n element.addClass(initClass);\n if (isIn) element.show();\n });\n\n // Start the animation\n requestAnimationFrame(() => {\n element[0].offsetWidth;\n element\n .css('transition', '')\n .addClass(activeClass);\n });\n\n // Clean up the animation when it finishes\n element.one(transitionend(element), finish);\n\n // Hides the element (for out animations), resets the element, and runs a callback\n function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }\n\n // Resets transitions and removes motion-specific classes\n function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(`${initClass} ${activeClass} ${animation}`);\n }\n}\n\nexport { Move, Motion };\n\n","'use strict';\n\nimport $ from 'jquery';\n\nconst Nest = {\n Feather(menu, type = 'zf') {\n menu.attr('role', 'menubar');\n\n var items = menu.find('li').attr({'role': 'menuitem'}),\n subMenuClass = `is-${type}-submenu`,\n subItemClass = `${subMenuClass}-item`,\n hasSubClass = `is-${type}-submenu-parent`,\n applyAria = (type !== 'accordion'); // Accordions handle their own ARIA attriutes.\n\n items.each(function() {\n var $item = $(this),\n $sub = $item.children('ul');\n\n if ($sub.length) {\n $item.addClass(hasSubClass);\n $sub.addClass(`submenu ${subMenuClass}`).attr({'data-submenu': ''});\n if(applyAria) {\n $item.attr({\n 'aria-haspopup': true,\n 'aria-label': $item.children('a:first').text()\n });\n // Note: Drilldowns behave differently in how they hide, and so need\n // additional attributes. We should look if this possibly over-generalized\n // utility (Nest) is appropriate when we rework menus in 6.4\n if(type === 'drilldown') {\n $item.attr({'aria-expanded': false});\n }\n }\n $sub\n .addClass(`submenu ${subMenuClass}`)\n .attr({\n 'data-submenu': '',\n 'role': 'menubar'\n });\n if(type === 'drilldown') {\n $sub.attr({'aria-hidden': true});\n }\n }\n\n if ($item.parent('[data-submenu]').length) {\n $item.addClass(`is-submenu-item ${subItemClass}`);\n }\n });\n\n return;\n },\n\n Burn(menu, type) {\n var //items = menu.find('li'),\n subMenuClass = `is-${type}-submenu`,\n subItemClass = `${subMenuClass}-item`,\n hasSubClass = `is-${type}-submenu-parent`;\n\n menu\n .find('>li, > li > ul, .menu, .menu > li, [data-submenu] > li')\n .removeClass(`${subMenuClass} ${subItemClass} ${hasSubClass} is-submenu-item submenu is-active`)\n .removeAttr('data-submenu').css('display', '');\n\n }\n}\n\nexport {Nest};\n","'use strict';\n\nimport $ from 'jquery';\n\nfunction Timer(elem, options, cb) {\n var _this = this,\n duration = options.duration,//options is an object for easily adding features later.\n nameSpace = Object.keys(elem.data())[0] || 'timer',\n remain = -1,\n start,\n timer;\n\n this.isPaused = false;\n\n this.restart = function() {\n remain = -1;\n clearTimeout(timer);\n this.start();\n }\n\n this.start = function() {\n this.isPaused = false;\n // if(!elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things.\n clearTimeout(timer);\n remain = remain <= 0 ? duration : remain;\n elem.data('paused', false);\n start = Date.now();\n timer = setTimeout(function(){\n if(options.infinite){\n _this.restart();//rerun the timer.\n }\n if (cb && typeof cb === 'function') { cb(); }\n }, remain);\n elem.trigger(`timerstart.zf.${nameSpace}`);\n }\n\n this.pause = function() {\n this.isPaused = true;\n //if(elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things.\n clearTimeout(timer);\n elem.data('paused', true);\n var end = Date.now();\n remain = remain - (end - start);\n elem.trigger(`timerpaused.zf.${nameSpace}`);\n }\n}\n\nexport {Timer};\n","//**************************************************\n//**Work inspired by multiple jquery swipe plugins**\n//**Done by Yohai Ararat ***************************\n//**************************************************\n\nimport $ from 'jquery';\n\nvar Touch = {};\n\nvar startPosX,\n startPosY,\n startTime,\n elapsedTime,\n startEvent,\n isMoving = false,\n didMoved = false;\n\nfunction onTouchEnd(e) {\n this.removeEventListener('touchmove', onTouchMove);\n this.removeEventListener('touchend', onTouchEnd);\n\n // If the touch did not move, consider it as a \"tap\"\n if (!didMoved) {\n var tapEvent = $.Event('tap', startEvent || e);\n $(this).trigger(tapEvent);\n }\n\n startEvent = null;\n isMoving = false;\n didMoved = false;\n}\n\nfunction onTouchMove(e) {\n if ($.spotSwipe.preventDefault) { e.preventDefault(); }\n\n if(isMoving) {\n var x = e.touches[0].pageX;\n var y = e.touches[0].pageY;\n var dx = startPosX - x;\n var dy = startPosY - y;\n var dir;\n didMoved = true;\n elapsedTime = new Date().getTime() - startTime;\n if(Math.abs(dx) >= $.spotSwipe.moveThreshold && elapsedTime <= $.spotSwipe.timeThreshold) {\n dir = dx > 0 ? 'left' : 'right';\n }\n // else if(Math.abs(dy) >= $.spotSwipe.moveThreshold && elapsedTime <= $.spotSwipe.timeThreshold) {\n // dir = dy > 0 ? 'down' : 'up';\n // }\n if(dir) {\n e.preventDefault();\n onTouchEnd.apply(this, arguments);\n $(this)\n .trigger($.Event('swipe', e), dir)\n .trigger($.Event(`swipe${dir}`, e));\n }\n }\n\n}\n\nfunction onTouchStart(e) {\n\n if (e.touches.length == 1) {\n startPosX = e.touches[0].pageX;\n startPosY = e.touches[0].pageY;\n startEvent = e;\n isMoving = true;\n didMoved = false;\n startTime = new Date().getTime();\n this.addEventListener('touchmove', onTouchMove, false);\n this.addEventListener('touchend', onTouchEnd, false);\n }\n}\n\nfunction init() {\n this.addEventListener && this.addEventListener('touchstart', onTouchStart, false);\n}\n\nfunction teardown() {\n this.removeEventListener('touchstart', onTouchStart);\n}\n\nclass SpotSwipe {\n constructor($) {\n this.version = '1.0.0';\n this.enabled = 'ontouchstart' in document.documentElement;\n this.preventDefault = false;\n this.moveThreshold = 75;\n this.timeThreshold = 200;\n this.$ = $;\n this._init();\n }\n\n _init() {\n var $ = this.$;\n $.event.special.swipe = { setup: init };\n $.event.special.tap = { setup: init };\n\n $.each(['left', 'up', 'down', 'right'], function () {\n $.event.special[`swipe${this}`] = { setup: function(){\n $(this).on('swipe', $.noop);\n } };\n });\n }\n}\n\n/****************************************************\n * As far as I can tell, both setupSpotSwipe and *\n * setupTouchHandler should be idempotent, *\n * because they directly replace functions & *\n * values, and do not add event handlers directly. *\n ****************************************************/\n\nTouch.setupSpotSwipe = function($) {\n $.spotSwipe = new SpotSwipe($);\n};\n\n/****************************************************\n * Method for adding pseudo drag events to elements *\n ***************************************************/\nTouch.setupTouchHandler = function($) {\n $.fn.addTouch = function(){\n this.each(function(i,el){\n $(el).bind('touchstart touchmove touchend touchcancel', function(event) {\n //we pass the original event object because the jQuery event\n //object is normalized to w3c specs and does not provide the TouchList\n handleTouch(event);\n });\n });\n\n var handleTouch = function(event){\n var touches = event.changedTouches,\n first = touches[0],\n eventTypes = {\n touchstart: 'mousedown',\n touchmove: 'mousemove',\n touchend: 'mouseup'\n },\n type = eventTypes[event.type],\n simulatedEvent\n ;\n\n if('MouseEvent' in window && typeof window.MouseEvent === 'function') {\n simulatedEvent = new window.MouseEvent(type, {\n 'bubbles': true,\n 'cancelable': true,\n 'screenX': first.screenX,\n 'screenY': first.screenY,\n 'clientX': first.clientX,\n 'clientY': first.clientY\n });\n } else {\n simulatedEvent = document.createEvent('MouseEvent');\n simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0/*left*/, null);\n }\n first.target.dispatchEvent(simulatedEvent);\n };\n };\n};\n\nTouch.init = function ($) {\n\n if(typeof($.spotSwipe) === 'undefined') {\n Touch.setupSpotSwipe($);\n Touch.setupTouchHandler($);\n }\n};\n\nexport {Touch};\n","'use strict';\n\nimport $ from 'jquery';\nimport { onLoad } from './foundation.core.utils';\nimport { Motion } from './foundation.util.motion';\n\nconst MutationObserver = (function () {\n var prefixes = ['WebKit', 'Moz', 'O', 'Ms', ''];\n for (var i=0; i < prefixes.length; i++) {\n if (`${prefixes[i]}MutationObserver` in window) {\n return window[`${prefixes[i]}MutationObserver`];\n }\n }\n return false;\n}());\n\nconst triggers = (el, type) => {\n el.data(type).split(' ').forEach(id => {\n $(`#${id}`)[ type === 'close' ? 'trigger' : 'triggerHandler'](`${type}.zf.trigger`, [el]);\n });\n};\n\nvar Triggers = {\n Listeners: {\n Basic: {},\n Global: {}\n },\n Initializers: {}\n}\n\nTriggers.Listeners.Basic = {\n openListener: function() {\n triggers($(this), 'open');\n },\n closeListener: function() {\n let id = $(this).data('close');\n if (id) {\n triggers($(this), 'close');\n }\n else {\n $(this).trigger('close.zf.trigger');\n }\n },\n toggleListener: function() {\n let id = $(this).data('toggle');\n if (id) {\n triggers($(this), 'toggle');\n } else {\n $(this).trigger('toggle.zf.trigger');\n }\n },\n closeableListener: function(e) {\n e.stopPropagation();\n let animation = $(this).data('closable');\n\n if(animation !== ''){\n Motion.animateOut($(this), animation, function() {\n $(this).trigger('closed.zf');\n });\n }else{\n $(this).fadeOut().trigger('closed.zf');\n }\n },\n toggleFocusListener: function() {\n let id = $(this).data('toggle-focus');\n $(`#${id}`).triggerHandler('toggle.zf.trigger', [$(this)]);\n }\n};\n\n// Elements with [data-open] will reveal a plugin that supports it when clicked.\nTriggers.Initializers.addOpenListener = ($elem) => {\n $elem.off('click.zf.trigger', Triggers.Listeners.Basic.openListener);\n $elem.on('click.zf.trigger', '[data-open]', Triggers.Listeners.Basic.openListener);\n}\n\n// Elements with [data-close] will close a plugin that supports it when clicked.\n// If used without a value on [data-close], the event will bubble, allowing it to close a parent component.\nTriggers.Initializers.addCloseListener = ($elem) => {\n $elem.off('click.zf.trigger', Triggers.Listeners.Basic.closeListener);\n $elem.on('click.zf.trigger', '[data-close]', Triggers.Listeners.Basic.closeListener);\n}\n\n// Elements with [data-toggle] will toggle a plugin that supports it when clicked.\nTriggers.Initializers.addToggleListener = ($elem) => {\n $elem.off('click.zf.trigger', Triggers.Listeners.Basic.toggleListener);\n $elem.on('click.zf.trigger', '[data-toggle]', Triggers.Listeners.Basic.toggleListener);\n}\n\n// Elements with [data-closable] will respond to close.zf.trigger events.\nTriggers.Initializers.addCloseableListener = ($elem) => {\n $elem.off('close.zf.trigger', Triggers.Listeners.Basic.closeableListener);\n $elem.on('close.zf.trigger', '[data-closeable], [data-closable]', Triggers.Listeners.Basic.closeableListener);\n}\n\n// Elements with [data-toggle-focus] will respond to coming in and out of focus\nTriggers.Initializers.addToggleFocusListener = ($elem) => {\n $elem.off('focus.zf.trigger blur.zf.trigger', Triggers.Listeners.Basic.toggleFocusListener);\n $elem.on('focus.zf.trigger blur.zf.trigger', '[data-toggle-focus]', Triggers.Listeners.Basic.toggleFocusListener);\n}\n\n\n\n// More Global/complex listeners and triggers\nTriggers.Listeners.Global = {\n resizeListener: function($nodes) {\n if(!MutationObserver){//fallback for IE 9\n $nodes.each(function(){\n $(this).triggerHandler('resizeme.zf.trigger');\n });\n }\n //trigger all listening elements and signal a resize event\n $nodes.attr('data-events', \"resize\");\n },\n scrollListener: function($nodes) {\n if(!MutationObserver){//fallback for IE 9\n $nodes.each(function(){\n $(this).triggerHandler('scrollme.zf.trigger');\n });\n }\n //trigger all listening elements and signal a scroll event\n $nodes.attr('data-events', \"scroll\");\n },\n closeMeListener: function(e, pluginId){\n let plugin = e.namespace.split('.')[0];\n let plugins = $(`[data-${plugin}]`).not(`[data-yeti-box=\"${pluginId}\"]`);\n\n plugins.each(function(){\n let _this = $(this);\n _this.triggerHandler('close.zf.trigger', [_this]);\n });\n }\n}\n\n// Global, parses whole document.\nTriggers.Initializers.addClosemeListener = function(pluginName) {\n var yetiBoxes = $('[data-yeti-box]'),\n plugNames = ['dropdown', 'tooltip', 'reveal'];\n\n if(pluginName){\n if(typeof pluginName === 'string'){\n plugNames.push(pluginName);\n }else if(typeof pluginName === 'object' && typeof pluginName[0] === 'string'){\n plugNames.concat(pluginName);\n }else{\n console.error('Plugin names must be strings');\n }\n }\n if(yetiBoxes.length){\n let listeners = plugNames.map((name) => {\n return `closeme.zf.${name}`;\n }).join(' ');\n\n $(window).off(listeners).on(listeners, Triggers.Listeners.Global.closeMeListener);\n }\n}\n\nfunction debounceGlobalListener(debounce, trigger, listener) {\n let timer, args = Array.prototype.slice.call(arguments, 3);\n $(window).off(trigger).on(trigger, function(e) {\n if (timer) { clearTimeout(timer); }\n timer = setTimeout(function(){\n listener.apply(null, args);\n }, debounce || 10);//default time to emit scroll event\n });\n}\n\nTriggers.Initializers.addResizeListener = function(debounce){\n let $nodes = $('[data-resize]');\n if($nodes.length){\n debounceGlobalListener(debounce, 'resize.zf.trigger', Triggers.Listeners.Global.resizeListener, $nodes);\n }\n}\n\nTriggers.Initializers.addScrollListener = function(debounce){\n let $nodes = $('[data-scroll]');\n if($nodes.length){\n debounceGlobalListener(debounce, 'scroll.zf.trigger', Triggers.Listeners.Global.scrollListener, $nodes);\n }\n}\n\nTriggers.Initializers.addMutationEventsListener = function($elem) {\n if(!MutationObserver){ return false; }\n let $nodes = $elem.find('[data-resize], [data-scroll], [data-mutate]');\n\n //element callback\n var listeningElementsMutation = function (mutationRecordsList) {\n var $target = $(mutationRecordsList[0].target);\n\n //trigger the event handler for the element depending on type\n switch (mutationRecordsList[0].type) {\n case \"attributes\":\n if ($target.attr(\"data-events\") === \"scroll\" && mutationRecordsList[0].attributeName === \"data-events\") {\n $target.triggerHandler('scrollme.zf.trigger', [$target, window.pageYOffset]);\n }\n if ($target.attr(\"data-events\") === \"resize\" && mutationRecordsList[0].attributeName === \"data-events\") {\n $target.triggerHandler('resizeme.zf.trigger', [$target]);\n }\n if (mutationRecordsList[0].attributeName === \"style\") {\n $target.closest(\"[data-mutate]\").attr(\"data-events\",\"mutate\");\n $target.closest(\"[data-mutate]\").triggerHandler('mutateme.zf.trigger', [$target.closest(\"[data-mutate]\")]);\n }\n break;\n\n case \"childList\":\n $target.closest(\"[data-mutate]\").attr(\"data-events\",\"mutate\");\n $target.closest(\"[data-mutate]\").triggerHandler('mutateme.zf.trigger', [$target.closest(\"[data-mutate]\")]);\n break;\n\n default:\n return false;\n //nothing\n }\n };\n\n if ($nodes.length) {\n //for each element that needs to listen for resizing, scrolling, or mutation add a single observer\n for (var i = 0; i <= $nodes.length - 1; i++) {\n var elementObserver = new MutationObserver(listeningElementsMutation);\n elementObserver.observe($nodes[i], { attributes: true, childList: true, characterData: false, subtree: true, attributeFilter: [\"data-events\", \"style\"] });\n }\n }\n}\n\nTriggers.Initializers.addSimpleListeners = function() {\n let $document = $(document);\n\n Triggers.Initializers.addOpenListener($document);\n Triggers.Initializers.addCloseListener($document);\n Triggers.Initializers.addToggleListener($document);\n Triggers.Initializers.addCloseableListener($document);\n Triggers.Initializers.addToggleFocusListener($document);\n\n}\n\nTriggers.Initializers.addGlobalListeners = function() {\n let $document = $(document);\n Triggers.Initializers.addMutationEventsListener($document);\n Triggers.Initializers.addResizeListener();\n Triggers.Initializers.addScrollListener();\n Triggers.Initializers.addClosemeListener();\n}\n\n\nTriggers.init = function ($, Foundation) {\n onLoad($(window), function () {\n if ($.triggersInitialized !== true) {\n Triggers.Initializers.addSimpleListeners();\n Triggers.Initializers.addGlobalListeners();\n $.triggersInitialized = true;\n }\n });\n\n if(Foundation) {\n Foundation.Triggers = Triggers;\n // Legacy included to be backwards compatible for now.\n Foundation.IHearYou = Triggers.Initializers.addGlobalListeners\n }\n}\n\nexport {Triggers};\n","module.exports = __WEBPACK_EXTERNAL_MODULE_jquery__;"],"sourceRoot":""}