1 |
- {"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","isEnabled","formnovalidate","className","$inputs","merge","find","not","$submits","$globalErrors","a11yAttributes","each","i","input","addA11yAttributes","error","addGlobalErrorA11yAttributes","_events","off","on","resetForm","validateForm","e","key","preventDefault","target","getAttribute","submit","validateOn","validateInput","liveValidate","validateOnBlur","length","$el","attr","isGood","type","checked","opt","val","failedValidators","id","$error","siblings","formErrorSelector","parent","add","forEach","v","$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","findCheckboxLabels","removeRadioErrorClasses","removeCheckboxErrorClasses","clearRequire","requiredCheck","validator","manageErrorClasses","_validationIsDisabled","is","validateRadio","push","validateCheckbox","validateText","required","split","validators","equalTo","goodToGo","message","dependentElements","_this","removeErrorClasses","addErrorClasses","trigger","acc","checkboxGroupName","initialized","noError","indexOf","elem","$elem","css","pattern","inputText","valid","patterns","hasOwnProperty","test","RegExp","$group","prop","minRequired","parseInt","clear","$form","opts","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","deepLinkSmudgeOffset","deepLinkSmudgeDelay","deepLink","$tabContent","toggle","handleKey","next","$a","focus","multiExpand","previous","handled","$target","console","info","up","down","updateHistory","history","pushState","replaceState","_openTab","$targetItem","$othersItems","allowAllClosed","_closeTab","$activeContents","targetContentId","finish","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","$targetBranch","parentsUntil","$othersActiveSubmenus","$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","p","foundation","Object","keys","err","reflow","addBack","option","_index","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","chars","charsLength","floor","random","transitions","document","createElement","transition","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","scrollTopOffset","animationDuration","animationEasing","_hide","calcHeight","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","hasTouch","ontouchstart","_setPosition","forceFollow","hover","bodyData","whatinput","timeout","hoverDelay","hoverPane","visibleFocusableElements","findFocusable","body","$focusable","_addBodyHandler","trapFocus","releaseFocus","hide","Positionable","vOffset","hOffset","allowOverlap","allowBottomOverlap","subs","verticalClass","rightClass","Rtl","changed","parClass","handleClickFn","hasSub","hasClicked","clickOpen","stopImmediatePropagation","closeOnClickInside","disableHover","autoclose","closingTime","isTab","nextSibling","prevSibling","openSub","closeSub","functions","_isVertical","_isRtl","_removeBodyHandler","isItself","$sibs","ImNotTouchingYou","oldClass","$parentLi","$toClose","somethingToClose","$activeItem","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","_parseOptions","_addBreakpoints","_generateRules","rule","matchMedia","query","matches","path","types","log","queries","SPECIAL_QUERIES","value","rulesList","join","nodeName","response","html","calcPoints","$targets","$links","$active","pageYOffset","documentElement","points","winHeight","round","innerHeight","clientHeight","docHeight","scrollHeight","$tar","pt","threshold","targetPoint","deepLinking","scrollToLoc","_updateActive","onLoadListener","arrival","_deepLinkScroll","loc","_inTransition","newScrollPos","isScrollingUp","activeIdx","visibleLinks","$oldActive","activeHash","isNewActive","isNewHash","activeClass","pathname","search","contentClasses","base","reveal","$lastTrigger","$triggers","nested","$sticky","isInCanvas","contentId","warn","contentOverlay","overlay","overlayPosition","setAttribute","$overlay","insertAfter","revealOnRegExp","revealClass","revealOnClass","isRevealed","revealOn","_setMQChecker","transitionTime","contentScroll","inCanvasFor","inCanvasOn","_checkInCanvas","_removeContentClasses","_handleKeyboard","atLeast","hasReveal","_","topVal","absoluteTopVal","stickyData","_addContentClasses","event","allowUp","allowDown","lastY","originalEvent","pageY","stopPropagation","hasAttribute","forceTo","scrollTo","_stopScrolling","_recordScrollable","_stopScrollPropagation","canvasFocus","_fixStickyElements","_unfixStickyElements","_reset","containerClass","$slides","slideClass","$images","initActive","useMUI","_prepareForOrbit","bullets","_loadBullets","autoPlay","geoSync","accessible","$bullets","boxOfBullets","duration","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","$othersBullets","$newBullet","activeStateDescriptor","spans","spanCountInOthersBullets","toArray","b","every","count","animInFromRight","animOutToRight","animInFromLeft","animOutToLeft","POSITIONS","VERTICAL_ALIGNMENTS","HORIZONTAL_ALIGNMENTS","ALIGNMENTS","nextItem","item","array","currentIdx","triedPositions","_getDefaultPosition","_getDefaultAlignment","originalPosition","originalAlignment","_alignmentsExhausted","_realign","_addTriedPosition","isExhausted","GetExplicitOffsets","_getVOffset","_getHOffset","minOverlap","minCoordinates","_positionsExhausted","overlap","OverlapArea","_reposition","MenuPlugins","tabs","cssClass","selectTab","accordion","storezfData","currentMq","currentRule","currentPlugin","rulesTree","ruleSize","rulePlugin","_getAllOptions","isEmptyObject","_checkMediaQueries","allOptions","dummyPlugin","tmpPlugin","keyKey","objObj","destroy","_changedZfMediaQueryHandler","matchedMq","_handleMarkup","toSet","fromString","$panels","tabsTitle","linkClass","tabsPanel","panelClass","$liHeads","$liHeadsA","display","visibility","appendTo","$tabsContent","$placeholder","tempValue","_target","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","disabled","disabledClass","binding","_setInitAttr","doubleSided","$handle2","$input2","setHandles","_setHandlePos","pctOfBar","percent","positionValueFunction","_logTransform","_powTransform","toFixed","baseLog","nonLinearBase","pow","$hndl","isDbl","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","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","_linkClickListener","_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","dynamicHeight","newContainerHeight","_setBreakPoints","mTop","emCalc","marginTop","mBtm","marginBottom","bottom","em","fontSize","$tabTitles","linkActiveClass","matchHeight","_setHeight","anchorNoHash","_collapse","_addKeyHandler","_addClickHandler","_setHeightMqHandler","_handleTabChange","which","wrapOnKeys","historyHandled","activeCollapse","$oldTab","$tabLink","$targetContent","_collapseTab","panelActiveClass","$target_anchor","$activeTab","idStr","hashIdStr","panel","toggler","Error","$trigger","controls","containsId","_updateARIA","undefined","isClick","tipText","template","_buildTemplate","allowHtml","triggerClass","elementClassName","SVGElement","baseVal","tooltipWidth","tooltipHeight","templateClasses","tooltipClass","$template","showOn","fadeIn","fadeInDuration","fadeOut","fadeOutDuration","isFocus","disableForTouch","touchCloseText","lrOnly","tbOnly","ignoreBottom","eleDims","topOver","bottomOver","leftOver","rightOver","parDims","windowDims","sqrt","rect","parRect","parentNode","winRect","winY","winX","pageXOffset","parentDims","isOverflow","$eleDims","$anchorDims","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","zfIsKeyHandled","returnValue","unhandled","componentName","$firstFocusable","$lastFocusable","kcs","k","kc","defaultQueries","landscape","portrait","retina","styleMedia","media","script","getElementsByTagName","head","appendChild","insertBefore","currentStyle","matchMedium","styleSheet","cssText","textContent","isInitialized","$meta","extractedStyles","namedQueries","parseStyleToObject","_getCurrentSize","_watcher","_reInit","size","only","upTo","nextSize","parts","bpSize","bpModifier","queryIndex","findIndex","q","_getQueryName","nextQuery","matched","newSize","currentSize","styleObject","reduce","ret","decodeURIComponent","isArray","initClasses","activeClasses","animation","anim","prog","move","ts","isIn","initClass","reset","offsetWidth","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","assign","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;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;;AClFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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A7C;AAED,CATD;;AAWArsC,QAAQ,CAACiqC,YAAT,CAAsBqC,kBAAtB,GAA2C,YAAW;AACpD,MAAID,SAAS,GAAGttC,6CAAC,CAACyX,QAAD,CAAjB;AACAxW,UAAQ,CAACiqC,YAAT,CAAsBwB,yBAAtB,CAAgDY,SAAhD;AACArsC,UAAQ,CAACiqC,YAAT,CAAsBsB,iBAAtB;AACAvrC,UAAQ,CAACiqC,YAAT,CAAsBuB,iBAAtB;AACAxrC,UAAQ,CAACiqC,YAAT,CAAsBe,kBAAtB;AACD,CAND;;AASAhrC,QAAQ,CAACD,IAAT,GAAgB,UAAUhB,CAAV,EAAaF,UAAb,EAAyB;AACvCQ,uEAAM,CAACN,CAAC,CAACuM,MAAD,CAAF,EAAY,YAAY;AAC5B,QAAIvM,CAAC,CAACwtC,mBAAF,KAA0B,IAA9B,EAAoC;AAClCvsC,cAAQ,CAACiqC,YAAT,CAAsBmC,kBAAtB;AACApsC,cAAQ,CAACiqC,YAAT,CAAsBqC,kBAAtB;AACAvtC,OAAC,CAACwtC,mBAAF,GAAwB,IAAxB;AACD;AACF,GANK,CAAN;;AAQA,MAAG1tC,UAAH,EAAe;AACbA,cAAU,CAACmB,QAAX,GAAsBA,QAAtB,CADa,CAEb;;AACAnB,cAAU,CAAC2tC,QAAX,GAAsBxsC,QAAQ,CAACiqC,YAAT,CAAsBqC,kBAA5C;AACD;AACF,CAdD;;;;;;;;;;;;;;;;;;;;;;;;;ACrPA,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 this.isEnabled = true;\n this.formnovalidate = null;\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 this.$submits = this.$element.find('[type=\"submit\"]');\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 this.$submits\n .off('click.zf.abide keydown.zf.abide')\n .on('click.zf.abide keydown.zf.abide', (e) => {\n if (!e.key || (e.key === ' ' || e.key === 'Enter')) {\n e.preventDefault();\n this.formnovalidate = e.target.getAttribute('formnovalidate') !== null;\n this.$element.submit();\n }\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 the submitted form should be validated or not, consodering formnovalidate and isEnabled\n * @returns {Boolean}\n * @private\n */\n _validationIsDisabled() {\n if (this.isEnabled === false) { // whole validation disabled\n return true;\n } else if (typeof this.formnovalidate === 'boolean') { // triggered by $submit\n return this.formnovalidate;\n }\n // triggered by Enter in non-submit input\n return this.$submits.length ? this.$submits[0].getAttribute('formnovalidate') !== null : false;\n }\n\n /**\n * Enables the whole validation\n */\n enableValidation() {\n this.isEnabled = true;\n }\n\n /**\n * Disables the whole validation\n */\n disableValidation() {\n this.isEnabled = false;\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 * @param {String[]} [failedValidators] - List of failed validators.\n * @returns {Object} jQuery object with the selector.\n */\n findFormError($el, failedValidators) {\n var id = $el.length ? $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 if (!!failedValidators) {\n $error = $error.not('[data-form-error-on]')\n\n failedValidators.forEach((v) => {\n $error = $error.add($el.siblings(`[data-form-error-on=\"${v}\"]`));\n $error = $error.add(this.$element.find(`[data-form-error-for=\"${id}\"][data-form-error-on=\"${v}\"]`));\n });\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 * Get the set of labels associated with a set of checkbox 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 findCheckboxLabels($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 * @param {String[]} [failedValidators] - List of failed validators.\n */\n addErrorClasses($el, failedValidators) {\n var $label = this.findLabel($el);\n var $formError = this.findFormError($el, failedValidators);\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 * Remove CSS error classes etc from an entire checkbox group\n * @param {String} groupName - A string that specifies the name of a checkbox group\n *\n */\n removeCheckboxErrorClasses(groupName) {\n var $els = this.$element.find(`:checkbox[name=\"${groupName}\"]`);\n var $labels = this.findCheckboxLabels($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 // checkboxes need to clear all of the els\n else if ($el[0].type == 'checkbox') {\n return this.removeCheckboxErrorClasses($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 validator = $el.attr('data-validator'),\n failedValidators = [],\n manageErrorClasses = true;\n\n // skip validation if disabled\n if (this._validationIsDisabled()) {\n return true;\n }\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 this.validateRadio($el.attr('name')) || failedValidators.push('required');\n break;\n\n case 'checkbox':\n this.validateCheckbox($el.attr('name')) || failedValidators.push('required');\n // validateCheckbox() adds/removes error classes\n manageErrorClasses = false;\n break;\n\n case 'select':\n case 'select-one':\n case 'select-multiple':\n clearRequire || failedValidators.push('required');\n break;\n\n default:\n clearRequire || failedValidators.push('required');\n this.validateText($el) || failedValidators.push('pattern');\n }\n\n if (validator) {\n const required = $el.attr('required') ? true : false;\n\n validator.split(' ').forEach((v) => {\n this.options.validators[v]($el, required, $el.parent()) || failedValidators.push(v);\n });\n }\n\n if ($el.attr('data-equalto')) {\n this.options.validators.equalTo($el) || failedValidators.push('equalTo');\n }\n\n var goodToGo = failedValidators.length === 0;\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 if (manageErrorClasses) {\n this.removeErrorClasses($el);\n\n if (!goodToGo) {\n this.addErrorClasses($el, failedValidators);\n }\n }\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 var checkboxGroupName;\n\n // Remember first form submission to prevent specific checkbox validation (more than one required) until form got initially submitted\n if (!this.initialized) {\n this.initialized = true;\n }\n\n // skip validation if disabled\n if (this._validationIsDisabled()) {\n this.formnovalidate = null;\n return true;\n }\n\n this.$inputs.each(function() {\n\n // Only use one checkbox per group since validateCheckbox() iterates over all associated checkboxes\n if ($(this)[0].type === 'checkbox') {\n if ($(this).attr('name') === checkboxGroupName) return true;\n checkboxGroupName = $(this).attr('name');\n }\n\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('data-pattern') || $el.attr('pattern') || $el.attr('type'));\n var inputText = $el.val();\n var valid = true;\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 }\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 whether or a not a checkbox input is valid based on whether or not it is required and checked. Although the function targets a single `<input>`, it validates by checking the `required` and `checked` properties of all checkboxes in its group.\n * @param {String} groupName - A string that specifies the name of a checkbox group\n * @returns {Boolean} Boolean value depends on whether or not at least one checkbox input has been checked (if it's required)\n */\n validateCheckbox(groupName) {\n // If at least one checkbox in the group has the `required` attribute, the group is considered required\n // Per W3C spec, all checkboxes in a group should have `required`, but we're being nice\n var $group = this.$element.find(`:checkbox[name=\"${groupName}\"]`);\n var valid = false, required = false, minRequired = 1, checked = 0;\n\n // For the group to be required, at least one checkbox 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 // Count checked checkboxes within the group\n // Use data-min-required if available (default: 1)\n $group.each((i, e) => {\n if ($(e).prop('checked')) {\n checked++;\n }\n if (typeof $(e).attr('data-min-required') !== 'undefined') {\n minRequired = parseInt($(e).attr('data-min-required'));\n }\n });\n\n // For the group to be valid, the minRequired amount of checkboxes have to be checked\n if (checked >= minRequired) {\n valid = true;\n }\n }\n\n // Skip validation if more than 1 checkbox have to be checked AND if the form hasn't got submitted yet (otherwise it will already show an error during the first fill in)\n if (this.initialized !== true && minRequired > 1) {\n return true;\n }\n\n // Refresh error class for all input\n $group.each((i, e) => {\n if (!valid) {\n this.addErrorClasses($(e), ['required']);\n } else {\n this.removeErrorClasses($(e));\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 this.$submits\n .off('.abide');\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 { Plugin } from './foundation.core.plugin';\nimport { onLoad, GetYoDigits } from './foundation.core.utils';\nimport { Keyboard } from './foundation.util.keyboard';\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.attr({'role': 'presentation'});\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 (isOwnAnchor) {\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 // 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.deepLinkSmudgeOffset }, 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 }\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.finish().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.finish().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 `deepLinkSmudge` is enabled, the offset for scrollToTtop to prevent overlap by a sticky element at the top of the page\n * @option\n * @type {number}\n * @default 0\n */\n deepLinkSmudgeOffset: 0,\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 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 }\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 having multiple submenus active is disabled, close all the submenus\n // that are not parents or children of the targeted submenu.\n if (!this.options.multiOpen) {\n // The \"branch\" of the targetted submenu, from the component root to\n // the active submenus nested in it.\n const $targetBranch = $target.parentsUntil(this.$element)\n .add($target)\n .add($target.find('.is-active'));\n // All the active submenus that are not in the branch.\n const $othersActiveSubmenus = this.$element.find('.is-active').not($targetBranch);\n\n this.up($othersActiveSubmenus);\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.6.3';\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+']').filter(function () {\n return typeof $(this).data(\"zfPlugin\") === 'undefined';\n });\n\n // For each plugin found, initialize it\n $elem.each(function() {\n var $el = $(this),\n opts = { reflow: true };\n\n if($el.attr('data-options')){\n $el.attr('data-options').split(';').forEach(function(option, _index){\n var opt = option.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 return hyphenate(obj.className);\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 = 6, namespace){\n let str = '';\n const chars = '0123456789abcdefghijklmnopqrstuvwxyz';\n const charsLength = chars.length;\n for (let i = 0; i < length; i++) {\n str += chars[Math.floor(Math.random() * charsLength)];\n }\n return namespace ? `${str}-${namespace}` : str;\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 (let transition in transitions){\n if (typeof elem.style[transition] !== 'undefined'){\n end = transitions[transition];\n }\n }\n if (end) {\n return end;\n } else {\n 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\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=\"none\"></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.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 close.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 }\n });\n }); // end keyboardAccess\n }\n\n /**\n * Closes all open elements, and returns to root menu.\n * @function\n * @fires Drilldown#close\n * @fires Drilldown#closed\n */\n _hideAll() {\n var $elem = this.$element.find('.is-drilldown-submenu.is-active')\n $elem.addClass('is-closing');\n\n if (this.options.autoHeight) {\n const calcHeight = $elem.parent().closest('ul').data('calcHeight');\n this.$wrapper.css({ height: calcHeight });\n }\n\n /**\n * Fires when the menu is closing.\n * @event Drilldown#close\n */\n this.$element.trigger('close.zf.drilldown');\n\n $elem.one(transitionend($elem), () => {\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 /**\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 // 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 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 {boolean}\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';\nimport { Touch } from './foundation.util.touch'\n\n/**\n * Dropdown module.\n * @module foundation.dropdown\n * @requires foundation.util.keyboard\n * @requires foundation.util.box\n * @requires foundation.util.touch\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 // Touch and Triggers init are idempotent, just need to make sure they are initialized\n Touch.init($);\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 hasTouch = 'ontouchstart' in window || (typeof window.ontouchstart !== 'undefined');\n\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(e) {\n _this._setCurrentAnchor(this);\n\n if (\n // if forceFollow false, always prevent default action\n (_this.options.forceFollow === false) ||\n // if forceFollow true and hover option true, only prevent default action on 1st click\n // on 2nd click (dropown opened) the default action (e.g. follow a href) gets executed\n (hasTouch && _this.options.hover && _this.$element.hasClass('is-open') === false)\n ) {\n e.preventDefault();\n }\n });\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 tap.zf.dropdown')\n .on('click.zf.dropdown tap.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 tap.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 tap.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 * If true the default action of the toggle (e.g. follow a link with href) gets executed on click. If hover option is also true the default action gets prevented on first click for mobile / touch devices and executed on second click.\n * @option\n * @type {boolean}\n * @default true\n */\n forceFollow: true\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';\nimport { Touch } from './foundation.util.touch'\n\n\n/**\n * DropdownMenu module.\n * @module foundation.dropdownMenu\n * @requires foundation.util.keyboard\n * @requires foundation.util.box\n * @requires foundation.util.nest\n * @requires foundation.util.touch\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 Touch.init($); // Touch init is idempotent, we just need to make sure it's initialied.\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('li[role=\"none\"]');\n this.$tabs = this.$element.children('li[role=\"none\"]');\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\n || (!_this.options.clickOpen && !hasTouch)\n || (_this.options.forceFollow && hasTouch)) {\n return;\n }\n e.stopImmediatePropagation();\n e.preventDefault();\n _this._hide($elem);\n }\n else {\n e.stopImmediatePropagation();\n e.preventDefault();\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=\"none\"]'),\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 };\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 const $body = $(document.body);\n this._removeBodyHandler();\n $body.on('click.zf.dropdownMenu tap.zf.dropdownMenu', (e) => {\n var isItself = !!$(e.target).closest(this.$element).length;\n if (isItself) return;\n\n this._hide();\n this._removeBodyHandler();\n });\n }\n\n /**\n * Remove the body event handler. See `_addBodyHandler`.\n * @function\n * @private\n */\n _removeBodyHandler() {\n $(document.body).off('click.zf.dropdownMenu tap.zf.dropdownMenu');\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 * @fires DropdownMenu#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 var $activeItem = $toClose.find('li.is-active');\n $activeItem.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 clearTimeout($activeItem.data('_delay'));\n this._removeBodyHandler();\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';\nimport { Triggers } from './foundation.util.triggers';\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, this.$element.data(), options);\n this.rules = [];\n this.currentPath = '';\n this.className = 'Interchange'; // 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 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._parseOptions();\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 * Check options valifity and set defaults for:\n * - `data-interchange-type`: if set, enforce the type of replacement (auto, src, background or html)\n * @function\n * @private\n */\n _parseOptions() {\n var types = ['auto', 'src', 'background', 'html'];\n if (typeof this.options.type === 'undefined')\n this.options.type = 'auto';\n else if (types.indexOf(this.options.type) === -1) {\n console.log(`Warning: invalid value \"${this.options.type}\" for Interchange option \"type\"`);\n this.options.type = 'auto';\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 trigger = 'replaced.zf.interchange';\n\n var type = this.options.type;\n if (type === 'auto') {\n if (this.$element[0].nodeName === 'IMG')\n type = 'src';\n else if (path.match(/\\.(gif|jpe?g|png|svg|tiff)([?#].*)?/i))\n type = 'background';\n else\n type = 'html';\n }\n\n // Replacing images\n if (type === 'src') {\n this.$element.attr('src', path)\n .on('load', () => { this.currentPath = path; })\n .trigger(trigger);\n }\n // Replacing background images\n else if (type === 'background') {\n path = path.replace(/\\(/g, '%28').replace(/\\)/g, '%29');\n this.$element\n .css({ 'background-image': 'url(' + path + ')' })\n .trigger(trigger);\n }\n // Replacing HTML\n else if (type === 'html') {\n $.get(path, (response) => {\n this.$element\n .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 /**\n * Type of the responsive ressource to replace. It can take the following options:\n * - `auto` (default): choose the type according to the element tag or the ressource extension,\n * - `src`: replace the `[src]` attribute, recommended for images `<img>`.\n * - `background`: replace the `background-image` CSS property.\n * - `html`: replace the element content.\n * @option\n * @type {string}\n * @default 'auto'\n */\n type: 'auto'\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 { Plugin } from './foundation.core.plugin';\nimport { onLoad, GetYoDigits } from './foundation.core.utils';\nimport { SmoothScroll } from './foundation.smoothScroll';\n\nimport { Triggers } from './foundation.util.triggers';\n\n/**\n * Magellan module.\n * @module foundation.magellan\n * @requires foundation.smoothScroll\n * @requires foundation.util.triggers\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 // Triggers init is idempotent, just need to make sure it is initialized\n Triggers.init($);\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\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 if(this.options.updateHistory){\n window.history.pushState({}, '', url);\n }else{\n window.history.replaceState({}, '', url);\n }\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 * Update the browser history with the active link, if deep linking is enabled.\n * @option\n * @type {boolean}\n * @default false\n */\n updateHistory: 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 { Plugin } from './foundation.core.plugin';\nimport { onLoad, transitionend, RegExpEscape } from './foundation.core.utils';\nimport { Keyboard } from './foundation.util.keyboard';\nimport { MediaQuery } from './foundation.util.mediaQuery';\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 this.$sticky = $();\n this.isInCanvas = false;\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 // Find fixed elements that should stay fixed while off-canvas is opened\n this.$sticky = this.$content.find('[data-off-canvas-sticky]');\n if (this.$sticky.length > 0 && this.options.transition === 'push') {\n // If there's at least one match force contentScroll:false because the absolute top value doesn't get recalculated on scroll\n // Limit to push transition since there's no transform scope for overlap\n this.options.contentScroll = false;\n }\n\n let inCanvasFor = this.$element.attr('class').match(/\\bin-canvas-for-(\\w+)/);\n if (inCanvasFor && inCanvasFor.length === 2) {\n // Set `inCanvasOn` option if found in-canvas-for-[BREAKPONT] CSS class\n this.options.inCanvasOn = inCanvasFor[1];\n } else if (this.options.inCanvasOn) {\n // Ensure the CSS class is set\n this.$element.addClass(`in-canvas-for-${this.options.inCanvasOn}`);\n }\n\n if (this.options.inCanvasOn) {\n this._checkInCanvas();\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 if (this.options.inCanvasOn) {\n $(window).on('changed.zf.mediaquery', () => {\n this._checkInCanvas();\n });\n }\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 * Checks if InCanvas on current breakpoint and adjust off-canvas accordingly\n * @private\n */\n _checkInCanvas() {\n this.isInCanvas = MediaQuery.atLeast(this.options.inCanvasOn);\n if (this.isInCanvas === true) {\n this.close();\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 * Preserves the fixed behavior of sticky elements on opening an off-canvas with push transition.\n * Since the off-canvas container has got a transform scope in such a case, it is done by calculating position absolute values.\n * @private\n */\n _fixStickyElements() {\n this.$sticky.each((_, el) => {\n const $el = $(el);\n\n // If sticky element is currently fixed, adjust its top value to match absolute position due to transform scope\n // Limit to push transition because postion:fixed works without problems for overlap (no transform scope)\n if ($el.css('position') === 'fixed') {\n\n // Save current inline styling to restore it if undoing the absolute fixing\n let topVal = parseInt($el.css('top'), 10);\n $el.data('offCanvasSticky', { top: topVal });\n\n let absoluteTopVal = $(document).scrollTop() + topVal;\n $el.css({ top: `${absoluteTopVal}px`, width: '100%', transition: 'none' });\n }\n });\n }\n\n /**\n * Restores the original fixed styling of sticky elements after having closed an off-canvas that got pseudo fixed beforehand.\n * This reverts the changes of _fixStickyElements()\n * @private\n */\n _unfixStickyElements() {\n this.$sticky.each((_, el) => {\n const $el = $(el);\n let stickyData = $el.data('offCanvasSticky');\n\n // If sticky element has got data object with prior values (meaning it was originally fixed) restore these values once off-canvas is closed\n if (typeof stickyData === 'object') {\n $el.css({ top: `${stickyData.top}px`, width: '', transition: '' })\n $el.data('offCanvasSticky', '');\n }\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 * @function\n * @private\n */\n _stopScrolling(event) {\n return false;\n }\n\n /**\n * Tag the element given as context whether it can be scrolled up and down.\n * Used to allow or prevent it to scroll. See `_stopScrollPropagation`.\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 *\n * @function\n * @private\n */\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 /**\n * Prevent the given event propagation if the element given as context can scroll.\n * Used to preserve the element scrolling on mobile (`touchmove`) when the document\n * scrolling is prevented. See https://git.io/zf-9707.\n * @function\n * @private\n */\n _stopScrollPropagation(event) {\n let elem = this; // called from event handler context with this as elem\n let parent; // off-canvas elem if called from inner scrollbox\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 // It is not recommended to stop event propagation (the user cannot watch it),\n // but in this case this is the only solution we have.\n event.stopPropagation();\n\n // If elem is inner scrollbox we are scrolling the outer off-canvas down/up once the box end has been reached\n // This lets the user continue to touch move the off-canvas without the need to place the finger outside the scrollbox\n if (elem.hasAttribute('data-off-canvas-scrollbox')) {\n parent = elem.closest('[data-off-canvas], [data-off-canvas-scrollbox-outer]');\n if (elem.scrollTop <= 1 && parent.scrollTop > 0) {\n parent.scrollTop--;\n } else if (elem.scrollTop >= elem.scrollHeight - elem.clientHeight - 1 && parent.scrollTop < parent.scrollHeight - parent.clientHeight) {\n parent.scrollTop++;\n }\n }\n\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 || this.isInCanvas) { 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 this.$element.on('touchstart', '[data-off-canvas-scrollbox]', this._recordScrollable);\n this.$element.on('touchmove', '[data-off-canvas-scrollbox]', 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 if (this.options.transition === 'push') {\n this._fixStickyElements();\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 * Fires when the off-canvas menu open transition is done.\n * @event OffCanvas#openedEnd\n */\n this.$element.one(transitionend(this.$element), () => {\n this.$element.trigger('openedEnd.zf.offCanvas');\n });\n }\n\n /**\n * Closes the off-canvas menu.\n * @function\n * @param {Function} cb - optional cb to fire after closure.\n * @fires OffCanvas#close\n * @fires OffCanvas#closed\n */\n close(cb) {\n if (!this.$element.hasClass('is-open') || this.isRevealed) { return; }\n\n /**\n * Fires when the off-canvas menu closes.\n * @event OffCanvas#close\n */\n this.$element.trigger('close.zf.offCanvas');\n\n var _this = this;\n\n this.$element.removeClass('is-open');\n\n this.$element.attr('aria-hidden', 'true');\n\n this.$content.removeClass('is-open-left is-open-top is-open-right is-open-bottom');\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\n // Listen to transitionEnd: add class, re-enable scrolling and release focus when done.\n this.$element.one(transitionend(this.$element), (e) => {\n\n this.$element.addClass('is-closed');\n this._removeContentClasses();\n\n if (this.options.transition === 'push') {\n this._unfixStickyElements();\n }\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 this.$element.off('touchstart', '[data-off-canvas-scrollbox]', this._recordScrollable);\n this.$element.off('touchmove', '[data-off-canvas-scrollbox]', this._stopScrollPropagation);\n }\n\n if (this.options.trapFocus === true) {\n this.$content.removeAttr('tabindex');\n Keyboard.releaseFocus(this.$element);\n }\n\n /**\n * Fires when the off-canvas menu close transition is done.\n * @event OffCanvas#closed\n */\n this.$element.trigger('closed.zf.offCanvas');\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.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 the open and close transition requires, including the appropriate milliseconds (`ms`) or seconds (`s`) unit (e.g. `500ms`, `.75s`) If none selected, pulls from body style.\n * @option\n * @type {string}\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 * Breakpoint at which the off-canvas gets moved into canvas content and acts as regular page element.\n * @option\n * @type {?string}\n * @default null\n */\n inCanvasOn: 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 * Move the descriptor of the current slide `[data-slide-active-label]` to the newly active bullet.\n * If no `[data-slide-active-label]` is set, will move the exceeding `span` element.\n *\n * @function\n * @private\n * @param {Number} idx - the index of the current slide.\n */\n _updateBullets(idx) {\n var $oldBullet = this.$bullets.filter('.is-active');\n var $othersBullets = this.$bullets.not('.is-active');\n var $newBullet = this.$bullets.eq(idx);\n\n $oldBullet.removeClass('is-active').blur();\n $newBullet.addClass('is-active');\n\n // Find the descriptor for the current slide to move it to the new slide button\n var activeStateDescriptor = $oldBullet.children('[data-slide-active-label]').last();\n\n // If not explicitely given, search for the last \"exceeding\" span element (compared to others bullets).\n if (!activeStateDescriptor.length) {\n var spans = $oldBullet.children('span');\n var spanCountInOthersBullets = $othersBullets.toArray().map(b => $(b).children('span').length);\n\n // If there is an exceeding span element, use it as current slide descriptor\n if (spanCountInOthersBullets.every(count => count < spans.length)) {\n activeStateDescriptor = spans.last();\n activeStateDescriptor.attr('data-slide-active-label', '');\n }\n }\n\n // Move the current slide descriptor to the new slide button\n if (activeStateDescriptor.length) {\n activeStateDescriptor.detach();\n $newBullet.append(activeStateDescriptor);\n }\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 _setPosition($anchor, $element, $parent) {\n if($anchor.attr('aria-expanded') === 'false'){ return false; }\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 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 open: (plugin, target) => plugin.selectTab(target),\n close: null /* not supported */,\n toggle: null /* not supported */,\n },\n accordion: {\n cssClass: 'accordion',\n plugin: Accordion,\n open: (plugin, target) => plugin.down($(target)),\n close: (plugin, target) => plugin.up($(target)),\n toggle: (plugin, target) => plugin.toggle($(target)),\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 constructor(element, options) {\n super(element, options);\n return this.options.reflow && this.storezfData || this;\n }\n\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.$element.data('zfPluginBase', this);\n this.options = $.extend({}, ResponsiveAccordionTabs.defaults, this.$element.data(), options);\n\n this.rules = this.$element.data('responsive-accordion-tabs');\n this.currentMq = null;\n this.currentRule = 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.currentRule = this.rules[matchedMq];\n this.currentPlugin = new this.currentRule.plugin(this.$element, this.options);\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 * Opens the plugin pane defined by `target`.\n * @param {jQuery | String} target - jQuery object or string of the id of the pane to open.\n * @see Accordion.down\n * @see Tabs.selectTab\n * @function\n */\n open(_target) {\n if (this.currentRule && typeof this.currentRule.open === 'function') {\n return this.currentRule.open(this.currentPlugin, ...arguments);\n }\n }\n\n /**\n * Closes the plugin pane defined by `target`. Not availaible for Tabs.\n * @param {jQuery | String} target - jQuery object or string of the id of the pane to close.\n * @see Accordion.up\n * @function\n */\n close(_target) {\n if (this.currentRule && typeof this.currentRule.close === 'function') {\n return this.currentRule.close(this.currentPlugin, ...arguments);\n }\n }\n\n /**\n * Toggles the plugin pane defined by `target`. Not availaible for Tabs.\n * @param {jQuery | String} target - jQuery object or string of the id of the pane to toggle.\n * @see Accordion.toggle\n * @function\n */\n toggle(_target) {\n if (this.currentRule && typeof this.currentRule.toggle === 'function') {\n return this.currentRule.toggle(this.currentPlugin, ...arguments);\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 { Plugin } from './foundation.core.plugin';\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 { Triggers } from './foundation.util.triggers';\nimport { Touch } from './foundation.util.touch'\n\n/**\n * Reveal module.\n * @module foundation.reveal\n * @requires foundation.util.keyboard\n * @requires foundation.util.touch\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 // Touch and Triggers init are idempotent, just need to make sure they are initialized\n Touch.init($);\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.dropdown tap.zf.dropdown', 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 if ($('.reveal:visible').length === 0) {\n this._disableScroll();\n }\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.dropdown tap.zf.dropdown', 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.dropdown tap.zf.dropdown');\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/foundation/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 if ($('.reveal:visible').length === 0) {\n _this._enableScroll(scrollTop);\n }\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 _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\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(), () => {\n this._setHandlePos(this.$handle2, this.inputs.eq(1).val());\n });\n } else {\n this._setHandlePos(this.$handle, this.inputs.eq(0).val());\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\n var value\n if (this.options.vertical) {\n // linear interpolation which is working with negative values for start\n // https://math.stackexchange.com/a/1019084\n value = parseFloat(this.options.end) + pctOfBar * (this.options.start - this.options.end)\n } else {\n value = (this.options.end - this.options.start) * pctOfBar + parseFloat(this.options.start);\n }\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, 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 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 barDim = this.$element[0].getBoundingClientRect()[param],\n windowScroll = vertical ? $(window).scrollTop() : $(window).scrollLeft();\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);\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\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);\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.smoothScroll\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._linkClickListener = this._handleLinkClick.bind(this);\n this.$element.on('click.zf.smoothScroll', this._linkClickListener);\n this.$element.on('click.zf.smoothScroll', 'a[href^=\"#\"]', this._linkClickListener);\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._linkClickListener)\n this.$element.off('click.zf.smoothScroll', 'a[href^=\"#\"]', this._linkClickListener);\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 { Plugin } from './foundation.core.plugin';\nimport { onLoad, GetYoDigits } from './foundation.core.utils';\nimport { MediaQuery } from './foundation.util.mediaQuery';\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 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\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 // Recalculate the height only if it is \"dynamic\"\n if (this.options.dynamicHeight || !this.containerHeight) {\n // Get the sticked element height and apply it to the container to \"hold the place\"\n var newContainerHeight = this.$element[0].getBoundingClientRect().height || this.containerHeight;\n newContainerHeight = this.$element.css(\"display\") == \"none\" ? 0 : newContainerHeight;\n this.$container.css('height', newContainerHeight);\n this.containerHeight = newContainerHeight;\n }\n this.elemHeight = this.containerHeight;\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(this.containerHeight, 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 '<div data-sticky-container></div>'\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 * If true (by default), keep the sticky container the same height as the element. Otherwise, the container height is set once and does not change.\n * @option\n * @type {boolean}\n * @default true\n */\n dynamicHeight: true,\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 { Plugin } from './foundation.core.plugin';\nimport { onLoad } from './foundation.core.utils';\nimport { Keyboard } from './foundation.util.keyboard';\nimport { onImagesLoaded } from './foundation.util.imageLoader';\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 anchorNoHash = anchor.indexOf('#') >= 0 ? anchor.slice(1) : anchor;\n var $anchor = anchorNoHash && $(`#${anchorNoHash}`);\n var $link = anchor && this.$element.find(`[href$=\"${anchor}\"],[data-tabs-target=\"${anchorNoHash}\"]`).first();\n // Whether the anchor element that has been found is part of this element\n var isOwnAnchor = !!($anchor.length && $link.length);\n\n if (isOwnAnchor) {\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 // 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 _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.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, hashIdStr;\n\n if (typeof elem === 'object') {\n idStr = elem[0].id;\n } else {\n idStr = elem;\n }\n\n if (idStr.indexOf('#') < 0) {\n hashIdStr = `#${idStr}`;\n } else {\n hashIdStr = idStr;\n idStr = idStr.slice(1);\n }\n\n var $target = this.$tabTitles.has(`[href$=\"${hashIdStr}\"],[data-tabs-target=\"${idStr}\"]`).first();\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 // Collect triggers to set ARIA attributes to\n var id = this.$element[0].id,\n $triggers = $(`[data-open~=\"${id}\"], [data-close~=\"${id}\"], [data-toggle~=\"${id}\"]`);\n\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 // - aria-expanded: according to the element visibility.\n $triggers.attr('aria-expanded', !this.$element.is(':hidden'));\n }\n // Otherwise, parse toggle class\n else {\n input = this.options.toggler;\n if (typeof input !== 'string' || !input.length) {\n throw new Error(`The 'toogler' option containing the target class is required, got \"${input}\"`);\n }\n // Allow for a . at the beginning of the string\n this.className = input[0] === '.' ? input.slice(1) : input;\n\n // - aria-expanded: according to the elements class set.\n $triggers.attr('aria-expanded', this.$element.hasClass(this.className));\n }\n\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 * Class of the element to toggle. It can be provided with or without \".\"\n * @option\n * @type {string}\n */\n toggler: undefined,\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 elementClassName = this.$element[0].className;\n if (this.$element[0] instanceof SVGElement) {\n elementClassName = elementClassName.baseVal;\n }\n var position = elementClassName.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 const _this = this;\n const hasTouch = 'ontouchstart' in window || (typeof window.ontouchstart !== 'undefined');\n const $template = this.template;\n var isFocus = false;\n\n // `disableForTouch: Fully disable the tooltip on touch devices\n if (hasTouch && this.options.disableForTouch) return;\n\n if (!this.options.disableHover) {\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 (hasTouch) {\n this.$element\n .on('tap.zf.tooltip touchend.zf.tooltip', function (e) {\n _this.isActive ? _this.hide() : _this.show();\n });\n }\n\n if (this.options.clickOpen) {\n this.$element.on('mousedown.zf.tooltip', function(e) {\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 _this.isClick = true;\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 /**\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 * Disable the tooltip for touch devices.\n * This can be useful to make elements with a tooltip on it trigger their\n * action on the first tap instead of displaying the tooltip.\n * @option\n * @type {booelan}\n * @default false\n */\n disableForTouch: 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\nvar Box = {\n ImNotTouchingYou: ImNotTouchingYou,\n OverlapArea: OverlapArea,\n GetDimensions: GetDimensions,\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 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 if ($anchorDims !== null) {\n // set position related attribute\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 // 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 }\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 // Ignore the event if it was already handled\n if (event.zfIsKeyHandled === true) return;\n\n // This component does not differentiate between ltr and rtl\n if (typeof commandList.ltr === 'undefined') {\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 // Execute the handler if found\n if (fn && typeof fn === 'function') {\n var returnValue = fn.apply();\n\n // Mark the event as \"handled\" to prevent future handlings\n event.zfIsKeyHandled = true;\n\n // Execute function when event was handled\n if (functions.handled || typeof functions.handled === 'function') {\n functions.handled(returnValue);\n }\n } else {\n // Execute function when event was not handled\n if (functions.unhandled || typeof functions.unhandled === 'function') {\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 © 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\n // make sure the initialization is only done once when calling _init() several times\n if (this.isInitialized === true) {\n return;\n } else {\n this.isInitialized = true;\n }\n\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 self.queries = []; // reset\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 * Reinitializes the media query helper.\n * Useful if your CSS breakpoint configuration has just been loaded or has changed since the initialization.\n * @function\n * @private\n */\n _reInit() {\n this.isInitialized = false;\n this._init();\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 is within the given breakpoint.\n * If smaller than the breakpoint of larger than its upper limit it returns false.\n * @function\n * @param {String} size - Name of the breakpoint to check.\n * @returns {Boolean} `true` if the breakpoint matches, `false` otherwise.\n */\n only(size) {\n return size === this._getCurrentSize();\n },\n\n /**\n * Checks if the screen is within a breakpoint or smaller.\n * @function\n * @param {String} size - Name of the breakpoint to check.\n * @returns {Boolean} `true` if the breakpoint matches, `false` if it's larger.\n */\n upTo(size) {\n const nextSize = this.next(size);\n\n // If the next breakpoint does not match, the screen is smaller than\n // the upper limit of this breakpoint.\n if (nextSize) {\n return !this.atLeast(nextSize);\n }\n\n // If there is no next breakpoint, the \"size\" breakpoint does not have\n // an upper limit and the screen will always be within it or smaller.\n return true;\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 const parts = size.trim().split(' ').filter(p => !!p.length);\n const [bpSize, bpModifier = ''] = parts;\n\n // Only the breakpont\n if (bpModifier === 'only') {\n return this.only(bpSize);\n }\n // At least the breakpoint (included)\n if (!bpModifier || bpModifier === 'up') {\n return this.atLeast(bpSize);\n }\n // Up to the breakpoint (included)\n if (bpModifier === 'down') {\n return this.upTo(bpSize);\n }\n\n throw new Error(`\n Invalid breakpoint passed to MediaQuery.is().\n Expected a breakpoint name formatted like \"<size> <modifier>\", got \"${size}\".\n `);\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 * Get the breakpoint following the given breakpoint.\n * @function\n * @param {String} size - Name of the breakpoint.\n * @returns {String|null} - The name of the following breakpoint, or `null` if the passed breakpoint was the last one.\n */\n next(size) {\n const queryIndex = this.queries.findIndex((q) => this._getQueryName(q) === size);\n if (queryIndex === -1) {\n throw new Error(`\n Unknown breakpoint \"${size}\" passed to MediaQuery.next().\n Ensure it is present in your Sass \"$breakpoints\" setting.\n `);\n }\n\n const nextQuery = this.queries[queryIndex + 1];\n return nextQuery ? nextQuery.name : null;\n },\n\n /**\n * Returns the name of the breakpoint related to the given value.\n * @function\n * @private\n * @param {String|Object} value - Breakpoint name or query object.\n * @returns {String} Name of the breakpoint.\n */\n _getQueryName(value) {\n if (typeof value === 'string')\n return value;\n if (typeof value === 'object')\n return value.name;\n throw new TypeError(`\n Invalid value passed to MediaQuery._getQueryName().\n Expected a breakpoint name (String) or a breakpoint query (Object), got \"${value}\" (${typeof value})\n `);\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 return matched && this._getQueryName(matched);\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 // will trigger the browser to synchronously calculate the style and layout\n // also called reflow or layout thrashing\n // see https://gist.github.com/paulirish/5d52fb081b3570c81e3a\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 menu.find('a').attr({'role': 'menuitem'});\n\n var items = menu.find('li').attr({'role': 'none'}),\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 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', Object.assign({}, e)), dir)\n .trigger($.Event(`swipe${dir}`, Object.assign({}, 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 let animation = $(this).data('closable');\n\n // Only close the first closable element. See https://git.io/zf-7833\n e.stopPropagation();\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 = 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":""}
|