1'use strict';var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj;}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj;};!function($){"use strict";var FOUNDATION_VERSION='6.2.0'; // Global Foundation object 2// This is attached to the window, or used as a module for AMD/Browserify 3var Foundation={version:FOUNDATION_VERSION, /** 4 * Stores initialized plugins. 5 */_plugins:{}, /** 6 * Stores generated unique ids for plugin instances 7 */_uuids:[], /** 8 * Returns a boolean for RTL support 9 */rtl:function rtl(){return $('html').attr('dir')==='rtl';}, /** 10 * Defines a Foundation plugin, adding it to the `Foundation` namespace and the list of plugins to initialize when reflowing. 11 * @param {Object} plugin - The constructor of the plugin. 12 */plugin:function plugin(_plugin,name){ // Object key to use when adding to global Foundation object 13// Examples: Foundation.Reveal, Foundation.OffCanvas 14var className=name||functionName(_plugin); // Object key to use when storing the plugin, also used to create the identifying data attribute for the plugin 15// Examples: data-reveal, data-off-canvas 16var attrName=hyphenate(className); // Add to the Foundation object and the plugins list (for reflowing) 17this._plugins[attrName]=this[className]=_plugin;}, /** 18 * @function 19 * Populates the _uuids array with pointers to each individual plugin instance. 20 * Adds the `zfPlugin` data-attribute to programmatically created plugins to allow use of $(selector).foundation(method) calls. 21 * Also fires the initialization event for each plugin, consolidating repeditive code. 22 * @param {Object} plugin - an instance of a plugin, usually `this` in context. 23 * @param {String} name - the name of the plugin, passed as a camelCased string. 24 * @fires Plugin#init 25 */registerPlugin:function registerPlugin(plugin,name){var pluginName=name?hyphenate(name):functionName(plugin.constructor).toLowerCase();plugin.uuid=this.GetYoDigits(6,pluginName);if(!plugin.$element.attr('data-'+pluginName)){plugin.$element.attr('data-'+pluginName,plugin.uuid);}if(!plugin.$element.data('zfPlugin')){plugin.$element.data('zfPlugin',plugin);} /** 26 * Fires when the plugin has initialized. 27 * @event Plugin#init 28 */plugin.$element.trigger('init.zf.'+pluginName);this._uuids.push(plugin.uuid);return;}, /** 29 * @function 30 * Removes the plugins uuid from the _uuids array. 31 * Removes the zfPlugin data attribute, as well as the data-plugin-name attribute. 32 * Also fires the destroyed event for the plugin, consolidating repeditive code. 33 * @param {Object} plugin - an instance of a plugin, usually `this` in context. 34 * @fires Plugin#destroyed 35 */unregisterPlugin:function unregisterPlugin(plugin){var pluginName=hyphenate(functionName(plugin.$element.data('zfPlugin').constructor));this._uuids.splice(this._uuids.indexOf(plugin.uuid),1);plugin.$element.removeAttr('data-'+pluginName).removeData('zfPlugin') /** 36 * Fires when the plugin has been destroyed. 37 * @event Plugin#destroyed 38 */.trigger('destroyed.zf.'+pluginName);for(var prop in plugin){plugin[prop]=null; //clean up script to prep for garbage collection. 39}return;}, /** 40 * @function 41 * Causes one or more active plugins to re-initialize, resetting event listeners, recalculating positions, etc. 42 * @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'` 43 * @default If no argument is passed, reflow all currently active plugins. 44 */reInit:function reInit(plugins){var isJQ=plugins instanceof $;try{if(isJQ){plugins.each(function(){$(this).data('zfPlugin')._init();});}else {var type=typeof plugins==='undefined'?'undefined':_typeof(plugins),_this=this,fns={'object':function object(plgs){plgs.forEach(function(p){p=hyphenate(p);$('[data-'+p+']').foundation('_init');});},'string':function string(){plugins=hyphenate(plugins);$('[data-'+plugins+']').foundation('_init');},'undefined':function undefined(){this['object'](Object.keys(_this._plugins));}};fns[type](plugins);}}catch(err){console.error(err);}finally {return plugins;}}, /** 45 * returns a random base-36 uid with namespacing 46 * @function 47 * @param {Number} length - number of random base-36 digits desired. Increase for more random strings. 48 * @param {String} namespace - name of plugin to be incorporated in uid, optional. 49 * @default {String} '' - if no plugin name is provided, nothing is appended to the uid. 50 * @returns {String} - unique id 51 */GetYoDigits:function GetYoDigits(length,namespace){length=length||6;return Math.round(Math.pow(36,length+1)-Math.random()*Math.pow(36,length)).toString(36).slice(1)+(namespace?'-'+namespace:'');}, /** 52 * Initialize plugins on any elements within `elem` (and `elem` itself) that aren't already initialized. 53 * @param {Object}
vendor: 5,032 bytes, lines 53-85
53 elem - jQuery object containing the element to check inside. Also checks the element itself, unless it's the `document` object. 54 * @param {String|Array} plugins - A list of plugins to initialize. Leave this out to initialize everything. 55 */reflow:function reflow(elem,plugins){ // If plugins is undefined, just grab everything 56if(typeof plugins==='undefined'){plugins=Object.keys(this._plugins);} // If plugins is a string, convert it to an array with one item 57else if(typeof plugins==='string'){plugins=[plugins];}var _this=this; // Iterate through each plugin 58$.each(plugins,function(i,name){ // Get the current plugin 59var plugin=_this._plugins[name]; // Localize the search to all elements inside elem, as well as elem itself, unless elem === document 60var $elem=$(elem).find('[data-'+name+']').addBack('[data-'+name+']'); // For each plugin found, initialize it 61$elem.each(function(){var $el=$(this),opts={}; // Don't double-dip on plugins 62if($el.data('zfPlugin')){console.warn("Tried to initialize "+name+" on an element that already has a Foundation plugin.");return;}if($el.attr('data-options')){var thing=$el.attr('data-options').split(';').forEach(function(e,i){var opt=e.split(':').map(function(el){return el.trim();});if(opt[0])opts[opt[0]]=parseValue(opt[1]);});}try{$el.data('zfPlugin',new plugin($(this),opts));}catch(er){console.error(er);}finally {return;}});});},getFnName:functionName,transitionend:function transitionend($elem){var transitions={'transition':'transitionend','WebkitTransition':'webkitTransitionEnd','MozTransition':'transitionend','OTransition':'otransitionend'};var elem=document.createElement('div'),end;for(var t in transitions){if(typeof elem.style[t]!=='undefined'){end=transitions[t];}}if(end){return end;}else {end=setTimeout(function(){$elem.triggerHandler('transitionend',[$elem]);},1);return 'transitionend';}}};Foundation.util={ /** 63 * Function for applying a debounce effect to a function call. 64 * @function 65 * @param {Function} func - Function to be called at end of timeout. 66 * @param {Number} delay - Time in ms to delay the call of `func`. 67 * @returns function 68 */throttle:function throttle(func,delay){var timer=null;return function(){var context=this,args=arguments;if(timer===null){timer=setTimeout(function(){func.apply(context,args);timer=null;},delay);}};}}; // TODO: consider not making this a jQuery function 69// TODO: need way to reflow vs. re-initialize 70/** 71 * The Foundation jQuery method. 72 * @param {String|Array} method - An action to perform on the current jQuery object. 73 */var foundation=function foundation(method){var type=typeof method==='undefined'?'undefined':_typeof(method),$meta=$('meta.foundation-mq'),$noJS=$('.no-js');if(!$meta.length){$('<meta class="foundation-mq">').appendTo(document.head);}if($noJS.length){$noJS.removeClass('no-js');}if(type==='undefined'){ //needs to initialize the Foundation object, or an individual plugin. 74Foundation.MediaQuery._init();Foundation.reflow(this);}else if(type==='string'){ //an individual method to invoke on a plugin or group of plugins 75var args=Array.prototype.slice.call(arguments,1); //collect all the arguments, if necessary 76var plugClass=this.data('zfPlugin'); //determine the class of plugin 77if(plugClass!==undefined&&plugClass[method]!==undefined){ //make sure both the class and method exist 78if(this.length===1){ //if there's only one, call it directly. 79plugClass[method].apply(plugClass,args);}else {this.each(function(i,el){ //otherwise loop through the jQuery collection and invoke the method on each 80plugClass[method].apply($(el).data('zfPlugin'),args);});}}else { //error for no class or no method 81throw new ReferenceError("We're sorry, '"+method+"' is not an available method for "+(plugClass?functionName(plugClass):'this element')+'.');}}else { //error for invalid argument type 82throw new TypeError('We\'re sorry, '+type+' is not a valid parameter. You must use a string representing the method you wish to invoke.');}return this;};window.Foundation=Foundation;$.fn.foundation=foundation; // Polyfill for requestAnimationFrame 83(function(){if(!Date.now||!window.Date.now)window.Date.now=Date.now=function(){return new Date().getTime();};var vendors=['webkit','moz'];for(var i=0;i<vendors.length&&!window.requestAnimationFrame;++i){var vp=vendors[i];window.requestAnimationFrame=window[vp+'RequestAnimationFrame'];window.cancelAnimationFrame=window[vp+'CancelAnimationFrame']||window[vp+'CancelRequestAnimationFrame'];}if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){var lastTime=0;window.requestAnimationFrame=function(callback){var now=Date.now();var nextTime=Math.max(lastTime+16,now);return setTimeout(function(){callback(lastTime=nextTime);},nextTime-now);};window.cancelAnimationFrame=clearTimeout;} /** 84 * Polyfill for performance.now, required by rAF 85 */if(!window.performance||!window.performance.now){window.performance={start:Date.now(),now:function now(){return Date.now()-this.start;}};}})();
85if(!Function.prototype.bind){Function.prototype.bind=function(oThis){if(typeof this!=='function'){ // closest thing possible to the ECMAScript 5 86// internal IsCallable function 87throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');}var aArgs=Array.prototype.slice.call(arguments,1),fToBind=this,fNOP=function fNOP(){},fBound=function fBound(){return fToBind.apply(this instanceof fNOP?this:oThis,aArgs.concat(Array.prototype.slice.call(arguments)));};if(this.prototype){ // native functions don't have a prototype 88fNOP.prototype=this.prototype;}fBound.prototype=new fNOP();return fBound;};} // Polyfill to get the name of a function in IE9 89function functionName(fn){if(Function.prototype.name===undefined){var funcNameRegex=/function\s([^(]{1,})\(/;var results=funcNameRegex.exec(fn.toString());return results&&results.length>1?results[1].trim():"";}else if(fn.prototype===undefined){return fn.constructor.name;}else {return fn.prototype.constructor.name;}}function parseValue(str){if(/true/.test(str))return true;else if(/false/.test(str))return false;else if(!isNaN(str*1))return parseFloat(str);return str;} // Convert PascalCase to kebab-case 90// Thank you: http://stackoverflow.com/a/8955580 91function hyphenate(str){return str.replace(/([a-z])([A-Z])/g,'$1-$2').toLowerCase();}}(jQuery); 92'use strict';!function($){Foundation.Box={ImNotTouchingYou:ImNotTouchingYou,GetDimensions:GetDimensions,GetOffsets:GetOffsets}; /** 93 * Compares the dimensions of an element to a container and determines collision events with container. 94 * @function 95 * @param {jQuery} element - jQuery object to test for collisions. 96 * @param {jQuery} parent - jQuery object to use as bounding container. 97 * @param {Boolean} lrOnly - set to true to check left and right values only. 98 * @param {Boolean} tbOnly - set to true to check top and bottom values only. 99 * @default if no parent object passed, detects collisions with `window`. 100 * @returns {Boolean} - true if collision free, false if a collision in any direction. 101 */function ImNotTouchingYou(element,parent,lrOnly,tbOnly){var eleDims=GetDimensions(element),top,bottom,left,right;if(parent){var parDims=GetDimensions(parent);bottom=eleDims.offset.top+eleDims.height<=parDims.height+parDims.offset.top;top=eleDims.offset.top>=parDims.offset.top;left=eleDims.offset.left>=parDims.offset.left;right=eleDims.offset.left+eleDims.width<=parDims.width;}else {bottom=eleDims.offset.top+eleDims.height<=eleDims.windowDims.height+eleDims.windowDims.offset.top;top=eleDims.offset.top>=eleDims.windowDims.offset.top;left=eleDims.offset.left>=eleDims.windowDims.offset.left;right=eleDims.offset.left+eleDims.width<=eleDims.windowDims.width;}var allDirs=[bottom,top,left,right];if(lrOnly){return left===right===true;}if(tbOnly){return top===bottom===true;}return allDirs.indexOf(false)===-1;}; /** 102 * Uses native methods to return an object of dimension values. 103 * @function 104 * @param {jQuery || HTML} element - jQuery object or DOM element for which to get the dimensions. Can be any element other that document or window. 105 * @returns {Object} - nested object of integer pixel values 106 * TODO - if element is window, return only those values. 107 */function GetDimensions(elem,test){elem=elem.length?elem[0]:elem;if(elem===window||elem===document){throw new Error("I'm sorry, Dave. I'm afraid I can't do that.");}var rect=elem.getBoundingClientRect(),parRect=elem.parentNode.getBoundingClientRect(),winRect=document.body.getBoundingClientRect(),winY=window.pageYOffset,winX=window.pageXOffset;return {width:rect.width,height:rect.height,offset:{top:rect.top+winY,left:rect.left+winX},parentDims:{width:parRect.width,height:parRect.height,offset:{top:parRect.top+winY,left:parRect.left+winX}},windowDims:{width:winRect.width,height:winRect.height,offset:{top:winY,left:winX}}};} /** 108 * Returns an object of top and left integer pixel values for dynamically rendered elements, 109 * such as: Tooltip, Reveal, and Dropdown 110 * @function 111 * @param {jQuery} element - jQuery object for the element being positioned. 112 * @param {jQuery} anchor - jQuery object for the element's anchor point. 113 * @param {String} position - a string relating to the desired position of the element, relative to it's anchor 114 * @param {Number} vOffset - integer pixel value of desired vertical separation between anchor and element. 115 * @param {Number} hOffset - integer pixel value of desired horizontal separation between anchor and element. 116 * @param {Boolean} isOverflow - if a collision event is detected, sets to true to default the element to full width - any desired offset. 117 * TODO alter/rewrite to work with `em` values as well/instead of pixels 118 */function GetOffsets(element,anchor,position,vOffset,hOffset,isOverflow){var $eleDims=GetDimensions(element),$anchorDims=anchor?GetDimensions(anchor):null;switch(position){case 'top':return {left:Foundation.rtl()?$anchorDims.offset.left-$eleDims.width+$anchorDims.width:$anchorDims.offset.left,top:$anchorDims.offset.top-($eleDims.height+vOffset)};break;case 'left':return {left:$anchorDims.offset.left-($eleDims.width+hOffset),top:$anchorDims.offset.top};break;
118case 'right':return {left:$anchorDims.offset.left+$anchorDims.width+hOffset,top:$anchorDims.offset.top};break;case 'center top':return {left:$anchorDims.offset.left+$anchorDims.width/2-$eleDims.width/2,top:$anchorDims.offset.top-($eleDims.height+vOffset)};break;case 'center bottom':return {left:isOverflow?hOffset:$anchorDims.offset.left+$anchorDims.width/2-$eleDims.width/2,top:$anchorDims.offset.top+$anchorDims.height+vOffset};break;case 'center left':return {left:$anchorDims.offset.left-($eleDims.width+hOffset),top:$anchorDims.offset.top+$anchorDims.height/2-$eleDims.height/2};break;case 'center right':return {left:$anchorDims.offset.left+$anchorDims.width+hOffset+1,top:$anchorDims.offset.top+$anchorDims.height/2-$eleDims.height/2};break;case 'center':return {left:$eleDims.windowDims.offset.left+$eleDims.windowDims.width/2-$eleDims.width/2,top:$eleDims.windowDims.offset.top+$eleDims.windowDims.height/2-$eleDims.height/2};break;case 'reveal':return {left:($eleDims.windowDims.width-$eleDims.width)/2,top:$eleDims.windowDims.offset.top+vOffset};case 'reveal full':return {left:$eleDims.windowDims.offset.left,top:$eleDims.windowDims.offset.top};break;default:return {left:Foundation.rtl()?$anchorDims.offset.left-$eleDims.width+$anchorDims.width:$anchorDims.offset.left,top:$anchorDims.offset.top+$anchorDims.height+vOffset};}}}(jQuery); 119/******************************************* 120 * * 121 * This util was created by Marius Olbertz * 122 * Please thank Marius on GitHub /owlbertz * 123 * or the web http://www.mariusolbertz.de/ * 124 * * 125 ******************************************/'use strict';!function($){var keyCodes={9:'TAB',13:'ENTER',27:'ESCAPE',32:'SPACE',37:'ARROW_LEFT',38:'ARROW_UP',39:'ARROW_RIGHT',40:'ARROW_DOWN'};var commands={};var Keyboard={keys:getKeyCodes(keyCodes), /** 126 * Parses the (keyboard) event and returns a String that represents its key 127 * Can be used like Foundation.parseKey(event) === Foundation.keys.SPACE 128 * @param {Event} event - the event generated by the event handler 129 * @return String key - String that represents the key pressed 130 */parseKey:function parseKey(event){var key=keyCodes[event.which||event.keyCode]||String.fromCharCode(event.which).toUpperCase();if(event.shiftKey)key='SHIFT_'+key;if(event.ctrlKey)key='CTRL_'+key;if(event.altKey)key='ALT_'+key;return key;}, /** 131 * Handles the given (keyboard) event 132 * @param {Event} event - the event generated by the event handler 133 * @param {String} component - Foundation component's name, e.g. Slider or Reveal 134 * @param {Objects} functions - collection of functions that are to be executed 135 */handleKey:function handleKey(event,component,functions){var commandList=commands[component],keyCode=this.parseKey(event),cmds,command,fn;if(!commandList)return console.warn('Component not defined!');if(typeof commandList.ltr==='undefined'){ // this component does not differentiate between ltr and rtl 136cmds=commandList; // use plain list 137}else { // merge ltr and rtl: if document is rtl, rtl overwrites ltr and vice versa 138if(Foundation.rtl())cmds=$.extend({},commandList.ltr,commandList.rtl);else cmds=$.extend({},commandList.rtl,commandList.ltr);}command=cmds[keyCode];fn=functions[command];if(fn&&typeof fn==='function'){ // execute function if exists 139fn.apply();if(functions.handled||typeof functions.handled==='function'){ // execute function when event was handled 140functions.handled.apply();}}else {if(functions.unhandled||typeof functions.unhandled==='function'){ // execute function when event was not handled 141functions.unhandled.apply();}}}, /** 142 * Finds all focusable elements within the given `$element` 143 * @param {jQuery} $element - jQuery object to search within 144 * @return {jQuery} $focusable - all focusable elements within `$element` 145 */findFocusable:function findFocusable($element){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(){if(!$(this).is(':visible')||$(this).attr('tabindex')<0){return false;} //only have visible elements and those that have a tabindex greater or equal 0 146return true;});}, /** 147 * Returns the component name name 148 * @param {Object} component - Foundation component, e.g. Slider or Reveal 149 * @return String componentName 150 */register:function register(componentName,cmds){commands[componentName]=cmds;}}; /* 151 * Constants for easier comparing. 152 * Can be used like Foundation.parseKey(event) === Foundation.keys.SPACE 153 */function getKeyCodes(kcs){var k={};for(var kc in kcs){k[kcs[kc]]=kcs[kc];}return k;}Foundation.Keyboard=Keyboard;}(jQuery); 154'use strict';var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj;}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj;};!function($){ // Default set of media queries 155var defaultQueries={'default':'only screen',landscape:'only screen and (orientation: landscape)',portrait:'only screen and (orientation: portrait)',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)'};var MediaQuery={queries:[],current:'', /** 156 * Initializes the media query helper, by extracting the breakpoint list from the CSS and activating the breakpoint watcher. 157 * @function 158 * @private 159 */_init:function _init(){var self=this;
159var extractedStyles=$('.foundation-mq').css('font-family');var namedQueries;namedQueries=parseStyleToObject(extractedStyles);for(var key in namedQueries){self.queries.push({name:key,value:'only screen and (min-width: '+namedQueries[key]+')'});}this.current=this._getCurrentSize();this._watcher();}, /** 160 * Checks if the screen is at least as wide as a breakpoint. 161 * @function 162 * @param {String} size - Name of the breakpoint to check. 163 * @returns {Boolean} `true` if the breakpoint matches, `false` if it's smaller. 164 */atLeast:function atLeast(size){var query=this.get(size);if(query){return window.matchMedia(query).matches;}return false;}, /** 165 * Gets the media query of a breakpoint. 166 * @function 167 * @param {String} size - Name of the breakpoint to get. 168 * @returns {String|null} - The media query of the breakpoint, or `null` if the breakpoint doesn't exist. 169 */get:function get(size){for(var i in this.queries){var query=this.queries[i];if(size===query.name)return query.value;}return null;}, /** 170 * Gets the current breakpoint name by testing every breakpoint and returning the last one to match (the biggest one). 171 * @function 172 * @private 173 * @returns {String} Name of the current breakpoint. 174 */_getCurrentSize:function _getCurrentSize(){var matched;for(var i in this.queries){var query=this.queries[i];if(window.matchMedia(query.value).matches){matched=query;}}if((typeof matched==='undefined'?'undefined':_typeof(matched))==='object'){return matched.name;}else {return matched;}}, /** 175 * Activates the breakpoint watcher, which fires an event on the window whenever the breakpoint changes. 176 * @function 177 * @private 178 */_watcher:function _watcher(){var _this=this;$(window).on('resize.zf.mediaquery',function(){var newSize=_this._getCurrentSize();if(newSize!==_this.current){ // Broadcast the media query change on the window 179$(window).trigger('changed.zf.mediaquery',[newSize,_this.current]); // Change the current media query 180_this.current=newSize;}});}};Foundation.MediaQuery=MediaQuery; // matchMedia() polyfill - Test a CSS media type/query in JS. 181// Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license 182window.matchMedia||(window.matchMedia=function(){'use strict'; // For browsers that support matchMedium api such as IE 9 and webkit 183var styleMedia=window.styleMedia||window.media; // For those that don't support matchMedium 184if(!styleMedia){var style=document.createElement('style'),script=document.getElementsByTagName('script')[0],info=null;style.type='text/css';style.id='matchmediajs-test';script.parentNode.insertBefore(style,script); // 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers 185info='getComputedStyle' in window&&window.getComputedStyle(style,null)||style.currentStyle;styleMedia={matchMedium:function matchMedium(media){var text='@media '+media+'{ #matchmediajs-test { width: 1px; } }'; // 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers 186if(style.styleSheet){style.styleSheet.cssText=text;}else {style.textContent=text;} // Test if media query is true or false 187return info.width==='1px';}};}return function(media){return {matches:styleMedia.matchMedium(media||'all'),media:media||'all'};};}()); // Thank you: https://github.com/sindresorhus/query-string 188function parseStyleToObject(str){var styleObject={};if(typeof str!=='string'){return styleObject;}str=str.trim().slice(1,-1); // browsers re-quote string style values 189if(!str){return styleObject;}styleObject=str.split('&').reduce(function(ret,param){var parts=param.replace(/\+/g,' ').split('=');var key=parts[0];var val=parts[1];key=decodeURIComponent(key); // missing `=` should be `null`: 190// http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters 191val=val===undefined?null:decodeURIComponent(val);if(!ret.hasOwnProperty(key)){ret[key]=val;}else if(Array.isArray(ret[key])){ret[key].push(val);}else {ret[key]=[ret[key],val];}return ret;},{});return styleObject;}Foundation.MediaQuery=MediaQuery;}(jQuery); 192'use strict';!function($){ /** 193 * Motion module. 194 * @module foundation.motion 195 */var initClasses=['mui-enter','mui-leave'];var activeClasses=['mui-enter-active','mui-leave-active'];var Motion={animateIn:function animateIn(element,animation,cb){animate(true,element,animation,cb);},animateOut:function animateOut(element,animation,cb){animate(false,element,animation,cb);}};function Move(duration,elem,fn){var anim,prog,start=null; // console.log('called');
196function move(ts){if(!start)start=window.performance.now(); // console.log(start, ts); 197prog=ts-start;fn.apply(elem);if(prog<duration){anim=window.requestAnimationFrame(move,elem);}else {window.cancelAnimationFrame(anim);elem.trigger('finished.zf.animate',[elem]).triggerHandler('finished.zf.animate',[elem]);}}anim=window.requestAnimationFrame(move);} /** 198 * Animates an element in or out using a CSS transition class. 199 * @function 200 * @private 201 * @param {Boolean} isIn - Defines if the animation is in or out. 202 * @param {Object} element - jQuery or HTML object to animate. 203 * @param {String} animation - CSS class to use. 204 * @param {Function} cb - Callback to run when animation is finished. 205 */function animate(isIn,element,animation,cb){element=$(element).eq(0);if(!element.length)return;var initClass=isIn?initClasses[0]:initClasses[1];var activeClass=isIn?activeClasses[0]:activeClasses[1]; // Set up the animation 206reset();element.addClass(animation).css('transition','none');requestAnimationFrame(function(){element.addClass(initClass);if(isIn)element.show();}); // Start the animation 207requestAnimationFrame(function(){element[0].offsetWidth;element.css('transition','').addClass(activeClass);}); // Clean up the animation when it finishes 208element.one(Foundation.transitionend(element),finish); // Hides the element (for out animations), resets the element, and runs a callback 209function finish(){if(!isIn)element.hide();reset();if(cb)cb.apply(element);} // Resets transitions and removes motion-specific classes 210function reset(){element[0].style.transitionDuration=0;element.removeClass(initClass+' '+activeClass+' '+animation);}}Foundation.Move=Move;Foundation.Motion=Motion;}(jQuery); 211'use strict';!function($){var Nest={Feather:function Feather(menu){var type=arguments.length<=1||arguments[1]===undefined?'zf':arguments[1];menu.attr('role','menubar');var items=menu.find('li').attr({'role':'menuitem'}),subMenuClass='is-'+type+'-submenu',subItemClass=subMenuClass+'-item',hasSubClass='is-'+type+'-submenu-parent';menu.find('a:first').attr('tabindex',0);items.each(function(){var $item=$(this),$sub=$item.children('ul');if($sub.length){$item.addClass(hasSubClass).attr({'aria-haspopup':true,'aria-expanded':false,'aria-label':$item.children('a:first').text()});$sub.addClass('submenu '+subMenuClass).attr({'data-submenu':'','aria-hidden':true,'role':'menu'});}if($item.parent('[data-submenu]').length){$item.addClass('is-submenu-item '+subItemClass);}});return;},Burn:function Burn(menu,type){var items=menu.find('li').removeAttr('tabindex'),subMenuClass='is-'+type+'-submenu',subItemClass=subMenuClass+'-item',hasSubClass='is-'+type+'-submenu-parent';menu.find('*').removeClass(subMenuClass+' '+subItemClass+' '+hasSubClass+' is-submenu-item submenu is-active').removeAttr('data-submenu').css('display',''); // console.log( menu.find('.' + subMenuClass + ', .' + subItemClass + ', .has-submenu, .is-submenu-item, .submenu, [data-submenu]') 212// .removeClass(subMenuClass + ' ' + subItemClass + ' has-submenu is-submenu-item submenu') 213// .removeAttr('data-submenu')); 214// items.each(function(){ 215// var $item = $(this), 216// $sub = $item.children('ul'); 217// if($item.parent('[data-submenu]').length){ 218// $item.removeClass('is-submenu-item ' + subItemClass); 219// } 220// if($sub.length){ 221// $item.removeClass('has-submenu'); 222// $sub.removeClass('submenu ' + subMenuClass).removeAttr('data-submenu'); 223// } 224// }); 225}};Foundation.Nest=Nest;}(jQuery); 226'use strict';!function($){function Timer(elem,options,cb){var _this=this,duration=options.duration, //options is an object for easily adding features later. 227nameSpace=Object.keys(elem.data())[0]||'timer',remain=-1,start,timer;this.isPaused=false;this.restart=function(){remain=-1;clearTimeout(timer);this.start();};this.start=function(){this.isPaused=false; // if(!elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things. 228clearTimeout(timer);remain=remain<=0?duration:remain;elem.data('paused',false);start=Date.now();timer=setTimeout(function(){if(options.infinite){_this.restart(); //rerun the timer. 229}cb();},remain);elem.trigger('timerstart.zf.'+nameSpace);};this.pause=function(){this.isPaused=true; //if(elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things. 230clearTimeout(timer);elem.data('paused',true);var end=Date.now();remain=remain-(end-start);elem.trigger('timerpaused.zf.'+nameSpace);};} /** 231 * Runs a callback function when images are fully loaded. 232 * @param {Object} images - Image(s) to check if loaded. 233 * @param {Func} callback - Function to execute when image is fully loaded. 234 */function onImagesLoaded(images,callback){var self=this,unloaded=images.length;if(unloaded===0){callback();}images.each(function(){if(this.complete){singleImageLoaded();}
234else if(typeof this.naturalWidth!=='undefined'&&this.naturalWidth>0){singleImageLoaded();}else {$(this).one('load',function(){singleImageLoaded();});}});function singleImageLoaded(){unloaded--;if(unloaded===0){callback();}}}Foundation.Timer=Timer;Foundation.onImagesLoaded=onImagesLoaded;}(jQuery); 235'use strict'; //************************************************** 236//**Work inspired by multiple jquery swipe plugins** 237//**Done by Yohai Ararat *************************** 238//************************************************** 239(function($){$.spotSwipe={version:'1.0.0',enabled:'ontouchstart' in document.documentElement,preventDefault:false,moveThreshold:75,timeThreshold:200};var startPosX,startPosY,startTime,elapsedTime,isMoving=false;function onTouchEnd(){ // alert(this); 240this.removeEventListener('touchmove',onTouchMove);this.removeEventListener('touchend',onTouchEnd);isMoving=false;}function onTouchMove(e){if($.spotSwipe.preventDefault){e.preventDefault();}if(isMoving){var x=e.touches[0].pageX;var y=e.touches[0].pageY;var dx=startPosX-x;var dy=startPosY-y;var dir;elapsedTime=new Date().getTime()-startTime;if(Math.abs(dx)>=$.spotSwipe.moveThreshold&&elapsedTime<=$.spotSwipe.timeThreshold){dir=dx>0?'left':'right';} // else if(Math.abs(dy) >= $.spotSwipe.moveThreshold && elapsedTime <= $.spotSwipe.timeThreshold) { 241// dir = dy > 0 ? 'down' : 'up'; 242// } 243if(dir){e.preventDefault();onTouchEnd.call(this);$(this).trigger('swipe',dir).trigger('swipe'+dir);}}}function onTouchStart(e){if(e.touches.length==1){startPosX=e.touches[0].pageX;startPosY=e.touches[0].pageY;isMoving=true;startTime=new Date().getTime();this.addEventListener('touchmove',onTouchMove,false);this.addEventListener('touchend',onTouchEnd,false);}}function init(){this.addEventListener&&this.addEventListener('touchstart',onTouchStart,false);}function teardown(){this.removeEventListener('touchstart',onTouchStart);}$.event.special.swipe={setup:init};$.each(['left','up','down','right'],function(){$.event.special['swipe'+this]={setup:function setup(){$(this).on('swipe',$.noop);}};});})(jQuery); /**************************************************** 244 * Method for adding psuedo drag events to elements * 245 ***************************************************/!function($){$.fn.addTouch=function(){this.each(function(i,el){$(el).bind('touchstart touchmove touchend touchcancel',function(){ //we pass the original event object because the jQuery event 246//object is normalized to w3c specs and does not provide the TouchList 247handleTouch(event);});});var handleTouch=function handleTouch(event){var touches=event.changedTouches,first=touches[0],eventTypes={touchstart:'mousedown',touchmove:'mousemove',touchend:'mouseup'},type=eventTypes[event.type],simulatedEvent;if('MouseEvent' in window&&typeof window.MouseEvent==='function'){simulatedEvent=window.MouseEvent(type,{'bubbles':true,'cancelable':true,'screenX':first.screenX,'screenY':first.screenY,'clientX':first.clientX,'clientY':first.clientY});}else {simulatedEvent=document.createEvent('MouseEvent');simulatedEvent.initMouseEvent(type,true,true,window,1,first.screenX,first.screenY,first.clientX,first.clientY,false,false,false,false,0 /*left*/,null);}first.target.dispatchEvent(simulatedEvent);};};}(jQuery); //********************************** 248//**From the jQuery Mobile Library** 249//**need to recreate functionality** 250//**and try to improve if possible** 251//********************************** 252/* Removing the jQuery function **** 253************************************ 254 255(function( $, window, undefined ) { 256 257 var $document = $( document ), 258 // supportTouch = $.mobile.support.touch, 259 touchStartEvent = 'touchstart'//supportTouch ? "touchstart" : "mousedown", 260 touchStopEvent = 'touchend'//supportTouch ? "touchend" : "mouseup", 261 touchMoveEvent = 'touchmove'//supportTouch ? "touchmove" : "mousemove"; 262 263 // setup new event shortcuts 264 $.each( ( "touchstart touchmove touchend " + 265 "swipe swipeleft swiperight" ).split( " " ), function( i, name ) { 266 267 $.fn[ name ] = function( fn ) { 268 return fn ? this.bind( name, fn ) : this.trigger( name ); 269 }; 270 271 // jQuery < 1.8 272 if ( $.attrFn ) { 273 $.attrFn[ name ] = true; 274 } 275 }); 276 277 function triggerCustomEvent( obj, eventType, event, bubble ) { 278 var originalType = event.type; 279 event.type = eventType; 280 if ( bubble ) { 281 $.event.trigger( event, undefined, obj ); 282 } else { 283 $.event.dispatch.call( obj, event ); 284 } 285 event.type = originalType; 286 } 287 288 // also handles taphold 289 290 // Also handles swipeleft, swiperight 291 $.event.special.swipe = { 292 293 // More than this horizontal displacement, and we will suppress scrolling. 294 scrollSupressionThreshold: 30, 295 296 // More time than this, and it isn't a swipe. 297 durationThreshold: 1000, 298 299 // Swipe horizontal displacement must be more than this. 300 horizontalDistanceThreshold: window.devicePixelRatio >= 2 ? 15 : 30, 301 302 // Swipe vertical displacement must be less than this. 303 verticalDistanceThreshold: window.devicePixelRatio >= 2 ? 15 : 30, 304 305 getLocation: function ( event ) { 306 var winPageX = window.pageXOffset, 307 winPageY = window.pageYOffset, 308 x = event.clientX, 309 y = event.clientY; 310 311 if ( event.pageY === 0 && Math.floor( y ) > Math.floor( event.pageY ) || 312 event.pageX === 0 && Math.floor( x ) > Math.floor( event.pageX ) ) { 313 314 // iOS4 clientX/clientY have the value that should have been 315 // in pageX/pageY. While pageX/page/ have the value 0 316 x = x - winPageX; 317 y = y - winPageY; 318 } else if ( y < ( event.pageY - winPageY) || x < ( event.pageX - winPageX ) ) { 319 320 // Some Android browsers have totally bogus values for clientX/Y 321 // when scrolling/zooming a page. Detectable since clientX/clientY 322 // should never be smaller than pageX/pageY minus page scroll 323 x = event.pageX - winPageX; 324 y = event.pageY - winPageY; 325 } 326 327 return { 328 x: x, 329 y: y 330 }; 331 }, 332 333 start: function( event ) { 334 var data = event.originalEvent.touches ? 335 event.originalEvent.touches[ 0 ] : event, 336 location = $.event.special.swipe.getLocation( data ); 337 return { 338 time: ( new Date() ).getTime(), 339 coords: [ location.x, location.y ], 340 origin: $( event.target ) 341 }; 342 }, 343 344 stop: function( event ) { 345 var data = event.originalEvent.touches ? 346 event.originalEvent.touches[ 0 ] : event, 347 location = $.event.special.swipe.getLocation( data ); 348 return { 349 time: ( new Date() ).getTime(), 350 coords: [ location.x, location.y ] 351 }; 352 }, 353 354 handleSwipe: function( start, stop, thisObject, origTarget ) { 355 if ( stop.time - start.time < $.event.special.swipe.durationThreshold &&
356 Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.horizontalDistanceThreshold && 357 Math.abs( start.coords[ 1 ] - stop.coords[ 1 ] ) < $.event.special.swipe.verticalDistanceThreshold ) { 358 var direction = start.coords[0] > stop.coords[ 0 ] ? "swipeleft" : "swiperight"; 359 360 triggerCustomEvent( thisObject, "swipe", $.Event( "swipe", { target: origTarget, swipestart: start, swipestop: stop }), true ); 361 triggerCustomEvent( thisObject, direction,$.Event( direction, { target: origTarget, swipestart: start, swipestop: stop } ), true ); 362 return true; 363 } 364 return false; 365 366 }, 367 368 // This serves as a flag to ensure that at most one swipe event event is 369 // in work at any given time 370 eventInProgress: false, 371 372 setup: function() { 373 var events, 374 thisObject = this, 375 $this = $( thisObject ), 376 context = {}; 377 378 // Retrieve the events data for this element and add the swipe context 379 events = $.data( this, "mobile-events" ); 380 if ( !events ) { 381 events = { length: 0 }; 382 $.data( this, "mobile-events", events ); 383 } 384 events.length++; 385 events.swipe = context; 386 387 context.start = function( event ) { 388 389 // Bail if we're already working on a swipe event 390 if ( $.event.special.swipe.eventInProgress ) { 391 return; 392 } 393 $.event.special.swipe.eventInProgress = true; 394 395 var stop, 396 start = $.event.special.swipe.start( event ), 397 origTarget = event.target, 398 emitted = false; 399 400 context.move = function( event ) { 401 if ( !start || event.isDefaultPrevented() ) { 402 return; 403 } 404 405 stop = $.event.special.swipe.stop( event ); 406 if ( !emitted ) { 407 emitted = $.event.special.swipe.handleSwipe( start, stop, thisObject, origTarget ); 408 if ( emitted ) { 409 410 // Reset the context to make way for the next swipe event 411 $.event.special.swipe.eventInProgress = false; 412 } 413 } 414 // prevent scrolling 415 if ( Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.scrollSupressionThreshold ) { 416 event.preventDefault(); 417 } 418 }; 419 420 context.stop = function() { 421 emitted = true; 422 423 // Reset the context to make way for the next swipe event 424 $.event.special.swipe.eventInProgress = false; 425 $document.off( touchMoveEvent, context.move ); 426 context.move = null; 427 }; 428 429 $document.on( touchMoveEvent, context.move ) 430 .one( touchStopEvent, context.stop ); 431 }; 432 $this.on( touchStartEvent, context.start ); 433 }, 434 435 teardown: function() { 436 var events, context; 437 438 events = $.data( this, "mobile-events" ); 439 if ( events ) { 440 context = events.swipe; 441 delete events.swipe; 442 events.length--; 443 if ( events.length === 0 ) { 444 $.removeData( this, "mobile-events" ); 445 } 446 } 447 448 if ( context ) { 449 if ( context.start ) { 450 $( this ).off( touchStartEvent, context.start ); 451 } 452 if ( context.move ) { 453 $document.off( touchMoveEvent, context.move ); 454 } 455 if ( context.stop ) { 456 $document.off( touchStopEvent, context.stop ); 457 } 458 } 459 } 460 }; 461 $.each({ 462 swipeleft: "swipe.left", 463 swiperight: "swipe.right" 464 }, function( event, sourceEvent ) { 465 466 $.event.special[ event ] = { 467 setup: function() { 468 $( this ).bind( sourceEvent, $.noop ); 469 }, 470 teardown: function() { 471 $( this ).unbind( sourceEvent ); 472 } 473 }; 474 }); 475})( jQuery, this ); 476*/ 477'use strict';var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj;}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj;};!function($){var MutationObserver=function(){var prefixes=['WebKit','Moz','O','Ms',''];for(var i=0;i<prefixes.length;i++){if(prefixes[i]+'MutationObserver' in window){return window[prefixes[i]+'MutationObserver'];}}return false;}();var triggers=function triggers(el,type){el.data(type).split(' ').forEach(function(id){$('#'+id)[type==='close'?'trigger':'triggerHandler'](type+'.zf.trigger',[el]);});}; // Elements with [data-open] will reveal a plugin that supports it when clicked. 478$(document).on('click.zf.trigger','[data-open]',function(){triggers($(this),'open');}); // Elements with [data-close] will close a plugin that supports it when clicked. 479// If used without a value on [data-close], the event will bubble, allowing it to close a parent component. 480$(document).on('click.zf.trigger','[data-close]',function(){var id=$(this).data('close');if(id){triggers($(this),'close');}else {$(this).trigger('close.zf.trigger');}}); // Elements with [data-toggle] will toggle a plugin that supports it when clicked. 481$(document).on('click.zf.trigger','[data-toggle]',function(){triggers($(this),'toggle');}); // Elements with [data-closable] will respond to close.zf.trigger events. 482$(document).on('close.zf.trigger','[data-closable]',function(e){e.stopPropagation();var animation=$(this).data('closable');if(animation!==''){Foundation.Motion.animateOut($(this),animation,function(){$(this).trigger('closed.zf');});}else {$(this).fadeOut().trigger('closed.zf');}});$(document).on('focus.zf.trigger blur.zf.trigger','[data-toggle-focus]',function(){var id=$(this).data('toggle-focus');$('#'+id).triggerHandler('toggle.zf.trigger',[$(this)]);}); /** 483* Fires once after all other scripts have loaded 484* @function 485* @private 486*/$(window).load(function(){checkListeners();});function checkListeners(){eventsListener();resizeListener();scrollListener();closemeListener();} //******** only fires this function once on load, if there's something to watch ******** 487function closemeListener(pluginName){var yetiBoxes=$('[data-yeti-box]'),plugNames=['dropdown','tooltip','reveal'];if(pluginName){if(typeof pluginName==='string'){plugNames.push(pluginName);}else if((typeof pluginName==='undefined'?'undefined':_typeof(pluginName))==='object'&&typeof pluginName[0]==='string'){plugNames.concat(pluginName);}else {console.error('Plugin names must be strings');}}if(yetiBoxes.length){var listeners=plugNames.map(function(name){return 'closeme.zf.'+name;}).join(' ');$(window).off(listeners).on(listeners,function(e,pluginId){var plugin=e.namespace.split('.')[0];var plugins=$('[data-'+plugin+']').not('[data-yeti-box="'+pluginId+'"]');plugins.each(function(){var _this=$(this);_this.triggerHandler('close.zf.trigger',[_this]);});});}}function resizeListener(debounce){var timer=undefined,$nodes=$('[data-resize]');if($nodes.length){$(window).off('resize.zf.trigger').on('resize.zf.trigger',function(e){if(timer){clearTimeout(timer);}timer=setTimeout(function(){if(!MutationObserver){ //fallback for IE 9 488$nodes.each(function(){$(this).triggerHandler('resizeme.zf.trigger');});} //trigger all listening elements and signal a resize event 489$nodes.attr('data-events',"resize");},debounce||10); //default time to emit resize event 490});}}
490function scrollListener(debounce){var timer=undefined,$nodes=$('[data-scroll]');if($nodes.length){$(window).off('scroll.zf.trigger').on('scroll.zf.trigger',function(e){if(timer){clearTimeout(timer);}timer=setTimeout(function(){if(!MutationObserver){ //fallback for IE 9 491$nodes.each(function(){$(this).triggerHandler('scrollme.zf.trigger');});} //trigger all listening elements and signal a scroll event 492$nodes.attr('data-events',"scroll");},debounce||10); //default time to emit scroll event 493});}}function eventsListener(){if(!MutationObserver){return false;}var nodes=document.querySelectorAll('[data-resize], [data-scroll], [data-mutate]'); //element callback 494var listeningElementsMutation=function listeningElementsMutation(mutationRecordsList){var $target=$(mutationRecordsList[0].target); //trigger the event handler for the element depending on type 495switch($target.attr("data-events")){case "resize":$target.triggerHandler('resizeme.zf.trigger',[$target]);break;case "scroll":$target.triggerHandler('scrollme.zf.trigger',[$target,window.pageYOffset]);break; // case "mutate" : 496// console.log('mutate', $target); 497// $target.triggerHandler('mutate.zf.trigger'); 498// 499// //make sure we don't get stuck in an infinite loop from sloppy codeing 500// if ($target.index('[data-mutate]') == $("[data-mutate]").length-1) { 501// domMutationObserver(); 502// } 503// break; 504default:return false; //nothing 505}};if(nodes.length){ //for each element that needs to listen for resizing, scrolling, (or coming soon mutation) add a single observer 506for(var i=0;i<=nodes.length-1;i++){var elementObserver=new MutationObserver(listeningElementsMutation);elementObserver.observe(nodes[i],{attributes:true,childList:false,characterData:false,subtree:false,attributeFilter:["data-events"]});}}} // ------------------------------------ 507// [PH] 508// Foundation.CheckWatchers = checkWatchers; 509Foundation.IHearYou=checkListeners; // Foundation.ISeeYou = scrollListener; 510// Foundation.IFeelYou = closemeListener; 511}(jQuery); // function domMutationObserver(debounce) { 512// // !!! This is coming soon and needs more work; not active !!! // 513// var timer, 514// nodes = document.querySelectorAll('[data-mutate]'); 515// // 516// if (nodes.length) { 517// // var MutationObserver = (function () { 518// // var prefixes = ['WebKit', 'Moz', 'O', 'Ms', '']; 519// // for (var i=0; i < prefixes.length; i++) { 520// // if (prefixes[i] + 'MutationObserver' in window) { 521// // return window[prefixes[i] + 'MutationObserver']; 522// // } 523// // } 524// // return false; 525// // }()); 526// 527// 528// //for the body, we need to listen for all changes effecting the style and class attributes 529// var bodyObserver = new MutationObserver(bodyMutation); 530// bodyObserver.observe(document.body, { attributes: true, childList: true, characterData: false, subtree:true, attributeFilter:["style", "class"]}); 531// 532// 533// //body callback 534// function bodyMutation(mutate) { 535// //trigger all listening elements and signal a mutation event 536// if (timer) { clearTimeout(timer); } 537// 538// timer = setTimeout(function() { 539// bodyObserver.disconnect(); 540// $('[data-mutate]').attr('data-events',"mutate"); 541// }, debounce || 150); 542// } 543// } 544// } 545'use strict';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value" in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}!function($){ /** 546 * Abide module. 547 * @module foundation.abide 548 */var Abide=function(){ /** 549 * Creates a new instance of Abide. 550 * @class 551 * @fires Abide#init 552 * @param {Object} element - jQuery object to add the trigger to. 553 * @param {Object} options - Overrides to the default plugin settings. 554 */function Abide(element){var options=arguments.length<=1||arguments[1]===undefined?{}:arguments[1];_classCallCheck(this,Abide);this.$element=element;this.options=$.extend({},Abide.defaults,this.$element.data(),options);this._init();Foundation.registerPlugin(this,'Abide');} /** 555 * Initializes the Abide plugin and calls functions to get Abide functioning on load. 556 * @private 557 */_createClass(Abide,[{key:'_init',value:function _init(){this.$inputs=this.$element.find('input, textarea, select').not('[data-abide-ignore]');this._events();} /** 558 * Initializes events for Abide. 559 * @private 560 */},{key:'_events',value:function _events(){var _this2=this;this.$element.off('.abide').on('reset.zf.abide',function(){_this2.resetForm();}).on('submit.zf.abide',function(){return _this2.validateForm();});if(this.options.validateOn==='fieldChange'){this.$inputs.off('change.zf.abide').on('change.zf.abide',function(e){_this2.validateInput($(e.target));});}if(this.options.liveValidate){this.$inputs.off('input.zf.abide').on('input.zf.abide',function(e){_this2.validateInput($(e.target));});}} /** 561 * Calls necessary functions to update Abide upon DOM change 562 * @private 563 */},{key:'_reflow',value:function _reflow(){this._init();} /** 564 * Checks whether or not a form element has the required attribute and if it's checked or not 565 * @param {Object} element - jQuery object to check for required attribute 566 * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty 567 */},{key:'requiredCheck',value:function requiredCheck($el){if(!$el.attr('required'))return true;var isGood=true;switch($el[0].type){case 'checkbox':case 'radio':isGood=$el[0].checked;break;case 'select':case 'select-one':case 'select-multiple':var opt=$el.find('option:selected');if(!opt.length||!opt.val())isGood=false;break;default:if(!$el.val()||!$el.val().length)isGood=false;}return isGood;} /** 568 * Based on $el, get the first element with selector in this order: 569 * 1. The element's direct sibling('s). 570 * 3. The element's parent's children. 571 * 572 * This allows for multiple form errors per input, though if none are found, no form errors will be shown. 573 * 574 * @param {Object} $el - jQuery object to use as reference to find the form error selector. 575 * @returns {Object} jQuery object with the selector. 576 */},{key:'findFormError',value:function findFormError($el){var $error=$el.siblings(this.options.formErrorSelector);if(!$error.length){$error=$el.parent().find(this.options.formErrorSelector);}return $error;} /** 577 * Get the first element in this order: 578 * 2. The <label> with the attribute `[for="someInputId"]` 579 * 3. The `.closest()` <label> 580 * 581 * @param {Object} $el - jQuery object to check for required attribute 582 * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty 583 */},{key:'findLabel',value:function findLabel($el){var id=$el[0].id;var $label=this.$element.find('label[for="'+id+'"]');if(!$label.length){return $el.closest('label');}return $label;} /** 584 * Adds the CSS error class as specified by the Abide settings to the label, input, and the form 585 * @param {Object} $el - jQuery object to add the class to 586 */},{key:'addErrorClasses',value:function addErrorClasses($el){var $label=this.findLabel($el);var $formError=this.findFormError($el);
586if($label.length){$label.addClass(this.options.labelErrorClass);}if($formError.length){$formError.addClass(this.options.formErrorClass);}$el.addClass(this.options.inputErrorClass).attr('data-invalid','');} /** 587 * Removes CSS error class as specified by the Abide settings from the label, input, and the form 588 * @param {Object} $el - jQuery object to remove the class from 589 */},{key:'removeErrorClasses',value:function removeErrorClasses($el){var $label=this.findLabel($el);var $formError=this.findFormError($el);if($label.length){$label.removeClass(this.options.labelErrorClass);}if($formError.length){$formError.removeClass(this.options.formErrorClass);}$el.removeClass(this.options.inputErrorClass).removeAttr('data-invalid');} /** 590 * Goes through a form to find inputs and proceeds to validate them in ways specific to their type 591 * @fires Abide#invalid 592 * @fires Abide#valid 593 * @param {Object} element - jQuery object to validate, should be an HTML input 594 * @returns {Boolean} goodToGo - If the input is valid or not. 595 */},{key:'validateInput',value:function validateInput($el){var clearRequire=this.requiredCheck($el),validated=false,customValidator=true,validator=$el.attr('data-validator'),equalTo=true;switch($el[0].type){case 'radio':validated=this.validateRadio($el.attr('name'));break;case 'checkbox':validated=clearRequire;break;case 'select':case 'select-one':case 'select-multiple':validated=clearRequire;break;default:validated=this.validateText($el);}if(validator){customValidator=this.matchValidation($el,validator,$el.attr('required'));}if($el.attr('data-equalto')){equalTo=this.options.validators.equalTo($el);}var goodToGo=[clearRequire,validated,customValidator,equalTo].indexOf(false)===-1;var message=(goodToGo?'valid':'invalid')+'.zf.abide';this[goodToGo?'removeErrorClasses':'addErrorClasses']($el); /** 596 * Fires when the input is done checking for validation. Event trigger is either `valid.zf.abide` or `invalid.zf.abide` 597 * Trigger includes the DOM element of the input. 598 * @event Abide#valid 599 * @event Abide#invalid 600 */$el.trigger(message,[$el]);return goodToGo;} /** 601 * Goes through a form and if there are any invalid inputs, it will display the form error element 602 * @returns {Boolean} noError - true if no errors were detected... 603 * @fires Abide#formvalid 604 * @fires Abide#forminvalid 605 */},{key:'validateForm',value:function validateForm(){var acc=[];var _this=this;this.$inputs.each(function(){acc.push(_this.validateInput($(this)));});var noError=acc.indexOf(false)===-1;this.$element.find('[data-abide-error]').css('display',noError?'none':'block'); /** 606 * Fires when the form is finished validating. Event trigger is either `formvalid.zf.abide` or `forminvalid.zf.abide`. 607 * Trigger includes the element of the form. 608 * @event Abide#formvalid 609 * @event Abide#forminvalid 610 */this.$element.trigger((noError?'formvalid':'forminvalid')+'.zf.abide',[this.$element]);return noError;} /** 611 * 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. 612 * @param {Object} $el - jQuery object to validate, should be a text input HTML element 613 * @param {String} pattern - string value of one of the RegEx patterns in Abide.options.patterns 614 * @returns {Boolean} Boolean value depends on whether or not the input value matches the pattern specified 615 */},{key:'validateText',value:function validateText($el,pattern){ // pattern = pattern ? pattern : $el.attr('pattern') ? $el.attr('pattern') : $el.attr('type'); 616pattern=pattern||$el.attr('pattern')||$el.attr('type');var inputText=$el.val(); // if text, check if the pattern exists, if so, test it, if no text or no pattern, return true. 617return inputText.length?this.options.patterns.hasOwnProperty(pattern)?this.options.patterns[pattern].test(inputText):pattern&&pattern!==$el.attr('type')?new RegExp(pattern).test(inputText):true:true;} /** 618 * Determines whether or a not a radio input is valid based on whether or not it is required and selected 619 * @param {String} groupName - A string that specifies the name of a radio button group 620 * @returns {Boolean} Boolean value depends on whether or not at least one radio input has been selected (if it's required) 621 */},{key:'validateRadio',value:function validateRadio(groupName){var $group=this.$element.find(':radio[name="'+groupName+'"]'),counter=[],_this=this;$group.each(function(){var rdio=$(this),clear=_this.requiredCheck(rdio);counter.push(clear);if(clear)_this.removeErrorClasses(rdio);});return counter.indexOf(false)===-1;} /** 622 * 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. 623 * @param {Object} $el - jQuery input element. 624 * @param {String} validators - a string of function names matching functions in the Abide.options.validators object. 625 * @param {Boolean} required - self explanatory? 626 * @returns {Boolean} - true if validations passed. 627 */},{key:'matchValidation',value:function matchValidation($el,validators,required){var _this3=this;required=required?true:false;var clear=validators.split(' ').map(function(v){return _this3.options.validators[v]($el,required,$el.parent());});return clear.indexOf(false)===-1;} /** 628 * Resets form inputs and styles 629 * @fires Abide#formreset 630 */},{key:'resetForm',value:function resetForm(){var $form=this.$element,opts=this.options;$('.'+opts.labelErrorClass,$form).not('small').removeClass(opts.labelErrorClass);$('.'+opts.inputErrorClass,$form).not('small').removeClass(opts.inputErrorClass);$(opts.formErrorSelector+'.'+opts.formErrorClass).removeClass(opts.formErrorClass);$form.find('[data-abide-error]').css('display','none');$(':input',$form).not(':button, :submit, :reset, :hidden, [data-abide-ignore]').val('').removeAttr('data-invalid'); /** 631 * Fires when the form has been reset. 632 * @event Abide#formreset 633 */$form.trigger('formreset.zf.abide',[$form]);} /** 634 * Destroys an instance of Abide. 635 * Removes error styles and classes from elements, without resetting their values. 636 */},{key:'destroy',value:function destroy(){var _this=this;this.$element.off('.abide').find('[data-abide-error]').css('display','none');this.$inputs.off('.abide').each(function(){_this.removeErrorClasses($(this));});Foundation.unregisterPlugin(this);}}]);return Abide;}(); /** 637 * Default settings for plugin 638 */Abide.defaults={ /** 639 * The default event to validate inputs. Checkboxes and radios validate immediately. 640 * Remove or change this value for manual validation. 641 * @option 642 * @example 'fieldChange' 643 */validateOn:'fieldChange', /** 644 * Class to be applied to input labels on failed validation. 645 * @option 646 * @example 'is-invalid-label' 647 */labelErrorClass:'is-invalid-label', /** 648 * Class to be applied to inputs on failed validation. 649 * @option 650 * @example 'is-invalid-input' 651 */inputErrorClass:'is-invalid-input', /** 652 * Class selector to use to target Form Errors for show/hide. 653 * @option 654 * @example '.form-error' 655 */formErrorSelector:'.form-error', /** 656 * Class added to Form Errors on failed validation. 657 * @option 658 * @example 'is-visible' 659 */formErrorClass:'is-visible', /** 660 * Set to true to validate text inputs on any value change. 661 * @option 662 * @example false 663 */liveValidate:false,patterns:{alpha:/^[a-zA-Z]+$/,alpha_numeric:/^[a-zA-Z0-9]+$/,integer:/^[-+]?\d+$/,number:/^[-+]?\d*(?:[\.\,]\d+)?$/, // amex, visa, diners 664card:/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|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})$/,cvv:/^([0-9]){3,4}$/, // http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address 665email:/^[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])?)+$/,url:/^(https?|ftp|file|ssh):\/\/(((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/, // abc.de 666domain:/^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,8}$/,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))$/, // YYYY-MM-DD 667date:/(?: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))$/, // HH:MM:SS 668time:/^(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]){2}$/,dateISO:/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/, // MM/DD/YYYY 669month_day_year:/^(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.]\d{4}$/, // DD/MM/YYYY 670day_month_year:/^(0[1-9]|[12][0-9]|3[01])[- \/.](0[1-9]|1[012])[- \/.]\d{4}$/, // #FFF or #FFFFFF 671color:/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/}, /** 672 * Optional validation functions to be used. `equalTo` being the only default included function. 673 * Functions should return only a boolean if the input is valid or not. Functions are given the following arguments: 674 * el : The jQuery element to validate. 675 * required : Boolean value of the required attribute be present or not. 676 * parent : The direct parent of the input. 677 * @option 678 */validators:{equalTo:function equalTo(el,required,parent){return $('#'+el.attr('data-equalto')).val()===el.val();}}}; // Window exports 679Foundation.plugin(Abide,'Abide');}(jQuery); 680'use strict';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value" in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}!function($){ /** 681 * Accordion module. 682 * @module foundation.accordion 683 * @requires foundation.util.keyboard 684 * @requires foundation.util.motion 685 */var Accordion=function(){ /** 686 * Creates a new instance of an accordion. 687 * @class 688 * @fires Accordion#init 689 * @param {jQuery} element - jQuery object to make into an accordion. 690 * @param {Object} options - a plain object with settings to override the default options. 691 */function Accordion(element,options){_classCallCheck(this,Accordion);this.$element=element;this.options=$.extend({},Accordion.defaults,this.$element.data(),options);this._init();Foundation.registerPlugin(this,'Accordion');Foundation.Keyboard.register('Accordion',{'ENTER':'toggle','SPACE':'toggle','ARROW_DOWN':'next','ARROW_UP':'previous'});} /** 692 * Initializes the accordion by animating the preset active pane(s). 693 * @private 694 */_createClass(Accordion,[{key:'_init',value:function _init(){this.$element.attr('role','tablist');this.$tabs=this.$element.children('li');if(this.$tabs.length===0){this.$tabs=this.$element.children('[data-accordion-item]');}this.$tabs.each(function(idx,el){var $el=$(el),$content=$el.find('[data-tab-content]'),id=$content[0].id||Foundation.GetYoDigits(6,'accordion'),linkId=el.id||id+'-label';$el.find('a:first').attr({'aria-controls':id,'role':'tab','id':linkId,'aria-expanded':false,'aria-selected':false});$content.attr({'role':'tabpanel','aria-labelledby':linkId,'aria-hidden':true,'id':id});});var $initActive=this.$element.find('.is-active').children('[data-tab-content]');if($initActive.length){this.down($initActive,true);}this._events();} /** 695 * Adds event handlers for items within the accordion. 696 * @private 697 */},{key:'_events',value:function _events(){var _this=this;this.$tabs.each(function(){var $elem=$(this);var $tabContent=$elem.children('[data-tab-content]');if($tabContent.length){$elem.children('a').off('click.zf.accordion keydown.zf.accordion').on('click.zf.accordion',function(e){ // $(this).children('a').on('click.zf.accordion', function(e) { 698e.preventDefault();if($elem.hasClass('is-active')){if(_this.options.allowAllClosed||$elem.siblings().hasClass('is-active')){_this.up($tabContent);}}else {_this.down($tabContent);}}).on('keydown.zf.accordion',function(e){Foundation.Keyboard.handleKey(e,'Accordion',{toggle:function toggle(
698){_this.toggle($tabContent);},next:function next(){$elem.next().find('a').focus().trigger('click.zf.accordion');},previous:function previous(){$elem.prev().find('a').focus().trigger('click.zf.accordion');},handled:function handled(){e.preventDefault();e.stopPropagation();}});});}});} /** 699 * Toggles the selected content pane's open/close state. 700 * @param {jQuery} $target - jQuery object of the pane to toggle. 701 * @function 702 */},{key:'toggle',value:function toggle($target){if($target.parent().hasClass('is-active')){if(this.options.allowAllClosed||$target.parent().siblings().hasClass('is-active')){this.up($target);}else {return;}}else {this.down($target);}} /** 703 * Opens the accordion tab defined by `$target`. 704 * @param {jQuery} $target - Accordion pane to open. 705 * @param {Boolean} firstTime - flag to determine if reflow should happen. 706 * @fires Accordion#down 707 * @function 708 */},{key:'down',value:function down($target,firstTime){var _this=this;if(!this.options.multiExpand&&!firstTime){var $currentActive=this.$element.find('.is-active').children('[data-tab-content]');if($currentActive.length){this.up($currentActive);}}$target.attr('aria-hidden',false).parent('[data-tab-content]').addBack().parent().addClass('is-active'); // Foundation.Move(_this.options.slideSpeed, $target, function(){ 709$target.slideDown(_this.options.slideSpeed,function(){ /** 710 * Fires when the tab is done opening. 711 * @event Accordion#down 712 */_this.$element.trigger('down.zf.accordion',[$target]);}); // }); 713// if(!firstTime){ 714// Foundation._reflow(this.$element.attr('data-accordion')); 715// } 716$('#'+$target.attr('aria-labelledby')).attr({'aria-expanded':true,'aria-selected':true});} /** 717 * Closes the tab defined by `$target`. 718 * @param {jQuery} $target - Accordion tab to close. 719 * @fires Accordion#up 720 * @function 721 */},{key:'up',value:function up($target){var $aunts=$target.parent().siblings(),_this=this;var canClose=this.options.multiExpand?$aunts.hasClass('is-active'):$target.parent().hasClass('is-active');if(!this.options.allowAllClosed&&!canClose){return;} // Foundation.Move(this.options.slideSpeed, $target, function(){ 722$target.slideUp(_this.options.slideSpeed,function(){ /** 723 * Fires when the tab is done collapsing up. 724 * @event Accordion#up 725 */_this.$element.trigger('up.zf.accordion',[$target]);}); // }); 726$target.attr('aria-hidden',true).parent().removeClass('is-active');$('#'+$target.attr('aria-labelledby')).attr({'aria-expanded':false,'aria-selected':false});} /** 727 * Destroys an instance of an accordion. 728 * @fires Accordion#destroyed 729 * @function 730 */},{key:'destroy',value:function destroy(){this.$element.find('[data-tab-content]').slideUp(0).css('display','');this.$element.find('a').off('.zf.accordion');Foundation.unregisterPlugin(this);}}]);return Accordion;}();Accordion.defaults={ /** 731 * Amount of time to animate the opening of an accordion pane. 732 * @option 733 * @example 250 734 */slideSpeed:250, /** 735 * Allow the accordion to have multiple open panes. 736 * @option 737 * @example false 738 */multiExpand:false, /** 739 * Allow the accordion to close all panes. 740 * @option 741 * @example false 742 */allowAllClosed:false}; // Window exports 743Foundation.plugin(Accordion,'Accordion');}(jQuery); 744'use strict';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value" in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}!function($){ /** 745 * AccordionMenu module. 746 * @module foundation.accordionMenu 747 * @requires foundation.util.keyboard 748 * @requires foundation.util.motion 749 * @requires foundation.util.nest 750 */var AccordionMenu=function(){ /** 751 * Creates a new instance of an accordion menu. 752 * @class 753 * @fires AccordionMenu#init 754 * @param {jQuery} element - jQuery object to make into an accordion menu. 755 * @param {Object} options - Overrides to the default plugin settings. 756 */function AccordionMenu(element,options){_classCallCheck(this,AccordionMenu);this.$element=element;this.options=$.extend({},AccordionMenu.defaults,this.$element.data(),options);Foundation.Nest.Feather(this.$element,'accordion');this._init();Foundation.registerPlugin(this,'AccordionMenu');Foundation.Keyboard.register('AccordionMenu',{'ENTER':'toggle','SPACE':'toggle','ARROW_RIGHT':'open','ARROW_UP':'up','ARROW_DOWN':'down','ARROW_LEFT':'close','ESCAPE':'closeAll','TAB':'down','SHIFT_TAB':'up'});} /** 757 * Initializes the accordion menu by hiding all nested menus. 758 * @private 759 */_createClass(AccordionMenu,[{key:'_init',value:function _init(){this.$element.find('[data-submenu]').not('.is-active').slideUp(0); //.find('a').css('padding-left', '1rem'); 760this.$element.attr({'role':'tablist','aria-multiselectable':this.options.multiOpe
760n});this.$menuLinks=this.$element.find('.is-accordion-submenu-parent');this.$menuLinks.each(function(){var linkId=this.id||Foundation.GetYoDigits(6,'acc-menu-link'),$elem=$(this),$sub=$elem.children('[data-submenu]'),subId=$sub[0].id||Foundation.GetYoDigits(6,'acc-menu'),isActive=$sub.hasClass('is-active');$elem.attr({'aria-controls':subId,'aria-expanded':isActive,'role':'tab','id':linkId});$sub.attr({'aria-labelledby':linkId,'aria-hidden':!isActive,'role':'tabpanel','id':subId});});var initPanes=this.$element.find('.is-active');if(initPanes.length){var _this=this;initPanes.each(function(){_this.down($(this));});}this._events();} /** 761 * Adds event handlers for items within the menu. 762 * @private 763 */},{key:'_events',value:function _events(){var _this=this;this.$element.find('li').each(function(){var $submenu=$(this).children('[data-submenu]');if($submenu.length){$(this).children('a').off('click.zf.accordionMenu').on('click.zf.accordionMenu',function(e){e.preventDefault();_this.toggle($submenu);});}}).on('keydown.zf.accordionmenu',function(e){var $element=$(this),$elements=$element.parent('ul').children('li'),$prevElement,$nextElement,$target=$element.children('[data-submenu]');$elements.each(function(i){if($(this).is($element)){$prevElement=$elements.eq(Math.max(0,i-1));$nextElement=$elements.eq(Math.min(i+1,$elements.length-1));if($(this).children('[data-submenu]:visible').length){ // has open sub menu 764$nextElement=$element.find('li:first-child');}if($(this).is(':first-child')){ // is first element of sub menu 765$prevElement=$element.parents('li').first();}else if($prevElement.children('[data-submenu]:visible').length){ // if previous element has open sub menu 766$prevElement=$prevElement.find('li:last-child');}if($(this).is(':last-child')){ // is last element of sub menu 767$nextElement=$element.parents('li').first().next('li');}return;}});Foundation.Keyboard.handleKey(e,'AccordionMenu',{open:function open(){if($target.is(':hidden')){_this.down($target);$target.find('li').first().focus();}},close:function close(){if($target.length&&!$target.is(':hidden')){ // close active sub of this item 768_this.up($target);}else if($element.parent('[data-submenu]').length){ // close currently open sub 769_this.up($element.parent('[data-submenu]'));$element.parents('li').first().focus();}},up:function up(){$prevElement.focus();},down:function down(){$nextElement.focus();},toggle:function toggle(){if($element.children('[data-submenu]').length){_this.toggle($element.children('[data-submenu]'));}},closeAll:function closeAll(){_this.hideAll();},handled:function handled(){e.preventDefault();e.stopImmediatePropagation();}});}); //.attr('tabindex', 0); 770} /** 771 * Closes all panes of the menu. 772 * @function 773 */},{key:'hideAll',value:function hideAll(){this.$element.find('[data-submenu]').slideUp(this.options.slideSpeed);} /** 774 * Toggles the open/close state of a submenu. 775 * @function 776 * @param {jQuery} $target - the submenu to toggle 777 */},{key:'toggle',value:function toggle($target){if(!$target.is(':animated')){if(!$target.is(':hidden')){this.up($target);}else {this.down($target);}}} /** 778 * Opens the sub-menu defined by `$target`. 779 * @param {jQuery} $target - Sub-menu to open. 780 * @fires AccordionMenu#down 781 */},{key:'down',value:function down($target){var _this=this;if(!this.options.multiOpen){this.up(this.$element.find('.is-active').not($target.parentsUntil(this.$element).add($target)));}$target.addClass('is-active').attr({'aria-hidden':false}).parent('.is-accordion-submenu-parent').attr({'aria-expanded':true});Foundation.Move(this.options.slideSpeed,$target,function(){$target.slideDown(_this.options.slideSpeed,function(){ /** 782 * Fires when the menu is done opening. 783 * @event AccordionMenu#down 784 */_this.$element.trigger('down.zf.accordionMenu',[$target]);});});} /** 785 * Closes the sub-menu defined by `$target`. All sub-menus inside the target will be closed as well. 786 * @param {jQuery} $target - Sub-menu to close. 787 * @fires AccordionMenu#up 788 */},{key:'up',value:function up($target){var _this=this;Foundation.Move(this.options.slideSpeed,$target,function(){$target.slideUp(_this.options.slideSpeed,function(){ /** 789 * Fires when the menu is done collapsing up. 790 * @event AccordionMenu#up 791 */_this.$element.trigger('up.zf.accordionMenu',[$target]);});});
791var $menus=$target.find('[data-submenu]').slideUp(0).addBack().attr('aria-hidden',true);$menus.parent('.is-accordion-submenu-parent').attr('aria-expanded',false);} /** 792 * Destroys an instance of accordion menu. 793 * @fires AccordionMenu#destroyed 794 */},{key:'destroy',value:function destroy(){this.$element.find('[data-submenu]').slideDown(0).css('display','');this.$element.find('a').off('click.zf.accordionMenu');Foundation.Nest.Burn(this.$element,'accordion');Foundation.unregisterPlugin(this);}}]);return AccordionMenu;}();AccordionMenu.defaults={ /** 795 * Amount of time to animate the opening of a submenu in ms. 796 * @option 797 * @example 250 798 */slideSpeed:250, /** 799 * Allow the menu to have multiple open panes. 800 * @option 801 * @example true 802 */multiOpen:true}; // Window exports 803Foundation.plugin(AccordionMenu,'AccordionMenu');}(jQuery); 804'use strict';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value" in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}!function($){ /** 805 * Drilldown module. 806 * @module foundation.drilldown 807 * @requires foundation.util.keyboard 808 * @requires foundation.util.motion 809 * @requires foundation.util.nest 810 */var Drilldown=function(){ /** 811 * Creates a new instance of a drilldown menu. 812 * @class 813 * @param {jQuery} element - jQuery object to make into an accordion menu. 814 * @param {Object} options - Overrides to the default plugin settings. 815 */function Drilldown(element,options){_classCallCheck(this,Drilldown);this.$element=element;this.options=$.extend({},Drilldown.defaults,this.$element.data(),options);Foundation.Nest.Feather(this.$element,'drilldown');this._init();Foundation.registerPlugin(this,'Drilldown');Foundation.Keyboard.register('Drilldown',{'ENTER':'open','SPACE':'open','ARROW_RIGHT':'next','ARROW_UP':'up','ARROW_DOWN':'down','ARROW_LEFT':'previous','ESCAPE':'close','TAB':'down','SHIFT_TAB':'up'});} /** 816 * Initializes the drilldown by creating jQuery collections of elements 817 * @private 818 */_createClass(Drilldown,[{key:'_init',value:function _init(){this.$submenuAnchors=this.$element.find('li.is-drilldown-submenu-parent');this.$submenus=this.$submenuAnchors.children('[data-submenu]');this.$menuItems=this.$element.find('li').not('.js-drilldown-back').attr('role','menuitem');this._prepareMenu();this._keyboardEvents();} /** 819 * prepares drilldown menu by setting attributes to links and elements 820 * sets a min height to prevent content jumping 821 * wraps the element if not already wrapped 822 * @private 823 * @function 824 */},{key:'_prepareMenu',value:function _prepareMenu(){var _this=this; // if(!this.options.holdOpen){ 825// this._menuLinkEvents(); 826// } 827this.$submenuAnchors.each(function(){var $sub=$(this);var $link=$sub.find('a:first');if(_this.options.parentLink){$link.clone().prependTo($sub.children('[data-submenu]')).wrap('<li class="is-submenu-parent-item is-submenu-item is-drilldown-submenu-item" role="menu-item"></li>');}$link.data('savedHref',$link.attr('href')).removeAttr('href');$sub.children('[data-submenu]').attr({'aria-hidden':true,'tabindex':0,'role':'menu'});_this._events($sub);});this.$submenus.each(function(){var $menu=$(this),$back=$menu.find('.js-drilldown-back');if(!$back.length){$menu.prepend(_this.options.backButton);}_this._back($menu);});if(!this.$element.parent().hasClass('is-drilldown')){this.$wrapper=$(this.options.wrapper).addClass('is-drilldown').css(this._getMaxDims());this.$element.wrap(this.$wrapper);}} /** 828 * Adds event handlers to elements in the menu. 829 * @function 830 * @private 831 * @param {jQuery} $elem - the current menu item to add handlers to. 832 */},{key:'_events',value:function _events($elem){var _this=this;$elem.off('click.zf.drilldown').on('click.zf.drilldown',function(e){if($(e.target).parentsUntil('ul','li').hasClass('is-drilldown-submenu-parent')){e.
832stopImmediatePropagation();e.preventDefault();} // if(e.target !== e.currentTarget.firstElementChild){ 833// return false; 834// } 835_this._show($elem);if(_this.options.closeOnClick){var $body=$('body').not(_this.$wrapper);$body.off('.zf.drilldown').on('click.zf.drilldown',function(e){e.preventDefault();_this._hideAll();$body.off('.zf.drilldown');});}});} /** 836 * Adds keydown event listener to `li`'s in the menu. 837 * @private 838 */},{key:'_keyboardEvents',value:function _keyboardEvents(){var _this=this;this.$menuItems.add(this.$element.find('.js-drilldown-back')).on('keydown.zf.drilldown',function(e){var $element=$(this),$elements=$element.parent('ul').children('li'),$prevElement,$nextElement;$elements.each(function(i){if($(this).is($element)){$prevElement=$elements.eq(Math.max(0,i-1));$nextElement=$elements.eq(Math.min(i+1,$elements.length-1));return;}});Foundation.Keyboard.handleKey(e,'Drilldown',{next:function next(){if($element.is(_this.$submenuAnchors)){_this._show($element);$element.on(Foundation.transitionend($element),function(){$element.find('ul li').filter(_this.$menuItems).first().focus();});}},previous:function previous(){_this._hide($element.parent('ul'));$element.parent('ul').on(Foundation.transitionend($element),function(){setTimeout(function(){$element.parent('ul').parent('li').focus();},1);});},up:function up(){$prevElement.focus();},down:function down(){$nextElement.focus();},close:function close(){_this._back(); //_this.$menuItems.first().focus(); // focus to first element 839},open:function open(){if(!$element.is(_this.$menuItems)){ // not menu item means back button 840_this._hide($element.parent('ul'));setTimeout(function(){$element.parent('ul').parent('li').focus();},1);}else if($element.is(_this.$submenuAnchors)){_this._show($element);setTimeout(function(){$element.find('ul li').filter(_this.$menuItems).first().focus();},1);}},handled:function handled(){e.preventDefault();e.stopImmediatePropagation();}});}); // end keyboardAccess 841} /** 842 * Closes all open elements, and returns to root menu. 843 * @function 844 * @fires Drilldown#closed 845 */},{key:'_hideAll',value:function _hideAll(){var $elem=this.$element.find('.is-drilldown-submenu.is-active').addClass('is-closing');$elem.one(Foundation.transitionend($elem),function(e){$elem.removeClass('is-active is-closing');}); /** 846 * Fires when the menu is fully closed. 847 * @event Drilldown#closed 848 */this.$element.trigger('closed.zf.drilldown');} /** 849 * Adds event listener for each `back` button, and closes open menus. 850 * @function 851 * @fires Drilldown#back 852 * @param {jQuery} $elem - the current sub-menu to add `back` event. 853 */},{key:'_back',value:function _back($elem){var _this=this;$elem.off('click.zf.drilldown');$elem.children('.js-drilldown-back').on('click.zf.drilldown',function(e){e.stopImmediatePropagation(); // console.log('mouseup on back'); 854_this._hide($elem);});} /** 855 * Adds event listener to menu items w/o submenus to close open menus on click. 856 * @function 857 * @private 858 */},{key:'_menuLinkEvents',value:function _menuLinkEvents(){var _this=this;this.$menuItems.not('.is-drilldown-submenu-parent').off('click.zf.drilldown').on('click.zf.drilldown',function(e){ // e.stopImmediatePropagation(); 859setTimeout(function(){_this._hideAll();},0);});} /** 860 * Opens a submenu. 861 * @function 862 * @fires Drilldown#open 863 * @param {jQuery} $elem - the current element with a submenu to open. 864 */},{key:'_show',value:function _show($elem){$elem.children('[data-submenu]').addClass('is-active');this.$element.trigger('open.zf.drilldown',[$elem]);}},{key:'_hide', /** 865 * Hides a submenu 866 * @function 867 * @fires Drilldown#hide 868 * @param {jQuery} $elem - the current sub-menu to hide. 869 */value:function _hide($elem){var _this=this;$elem.addClass('is-closing').one(Foundation.transitionend($elem),function(){$elem.removeClass('is-active is-closing');$elem.blur();}); /** 870 * Fires when the submenu is has closed. 871 * @event Drilldown#hide 872 */$elem.trigger('hide.zf.drilldown',[$elem]);} /** 873 * Iterates through the nested menus to calculate the min-height, and max-width for the menu. 874 * Prevents content jumping. 875 * @function 876 * @private 877 */},{key:'_getMaxDims',value:function _getMaxDims(){var max=0,result={};this.$submenus.add(this.$element).each(function(){var numOfElems=$(this).children('li').length;max=numOfElems>max?numOfElems:max;});result['min-height']=max*this.$menuItems[0].getBoundingClientRect().height+'px';result['max-width']=this.$element[0].getBoundingClientRect().width+'px';return result;} /** 878 * Destroys the Drilldown Menu 879 * @function 880 */},{key:'destroy',value:function destroy(){this._hideAll();Foundation.Nest.Burn(this.$element,'drilldown');this.$element.unwrap().find('.js-drilldown-back, .is-submenu-parent-item').remove().end().find('.is-active, .is-closing, .is-drilldown-submenu').removeClass('is-active is-closing is-drilldown-submenu').end().find('[data-submenu]').removeAttr('aria-hidden tabindex role').off('.zf.drilldown').end().off('zf.drilldown');this.$element.find('a').each(function(){var $link=$(this);if($link.data('savedHref')){$link.attr('href',$link.data('savedHref')).removeData('savedHref');}else {return;}});Foundation.unregisterPlugin(this);}}]);return Drilldown;}();Drilldown.defaults={ /** 881 * Markup used for JS generated back button. Prepended to submenu lists and deleted on `destroy` method, 'js-drilldown-back' class required. Remove the backslash (`\`) if copy and pasting. 882 * @option 883 * @example '<\li><\a>Back<\/a><\/li>' 884 */backButton:'<li class="js-drilldown-back"><a>Back</a></li>', /** 885 * 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. 886 * @option 887 * @example '<\div class="is-drilldown"><\/div>' 888 */wrapper:'<div></div>', /** 889 * Adds the parent link to the submenu. 890 * @option 891 * @example false 892 */parentLink:false, /** 893 * Allow the menu to return to root list on body click. 894 * @option 895 * @example false 896 */closeOnClick:false // holdOpen: false 897}; // Window exports 898Foundation.plugin(Drilldown,'Drilldown');}(jQuery); 899'use strict';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value" in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}!function($){ /** 900 * Dropdown module. 901 * @module foundation.dropdown 902 * @requires foundation.util.keyboard 903 * @requires foundation.util.box 904 * @requires foundation.util.triggers 905 */var Dropdown=function(){ /** 906 * Creates a new instance of a dropdown. 907 * @class 908 * @param {jQuery} element - jQuery object to make into a dropdown. 909 * Object should be of the dropdown panel, rather than
909its anchor. 910 * @param {Object} options - Overrides to the default plugin settings. 911 */function Dropdown(element,options){_classCallCheck(this,Dropdown);this.$element=element;this.options=$.extend({},Dropdown.defaults,this.$element.data(),options);this._init();Foundation.registerPlugin(this,'Dropdown');Foundation.Keyboard.register('Dropdown',{'ENTER':'open','SPACE':'open','ESCAPE':'close','TAB':'tab_forward','SHIFT_TAB':'tab_backward'});} /** 912 * Initializes the plugin by setting/checking options and attributes, adding helper variables, and saving the anchor. 913 * @function 914 * @private 915 */_createClass(Dropdown,[{key:'_init',value:function _init(){var $id=this.$element.attr('id');this.$anchor=$('[data-toggle="'+$id+'"]')||$('[data-open="'+$id+'"]');this.$anchor.attr({'aria-controls':$id,'data-is-focus':false,'data-yeti-box':$id,'aria-haspopup':true,'aria-expanded':false});this.options.positionClass=this.getPositionClass();this.counter=4;this.usedPositions=[];this.$element.attr({'aria-hidden':'true','data-yeti-box':$id,'data-resize':$id,'aria-labelledby':this.$anchor[0].id||Foundation.GetYoDigits(6,'dd-anchor')});this._events();} /** 916 * Helper function to determine current orientation of dropdown pane. 917 * @function 918 * @returns {String} position - string value of a position class. 919 */},{key:'getPositionClass',value:function getPositionClass(){var position=this.$element[0].className.match(/\b(top|left|right)\b/g);position=position?position[0]:'';return position;} /** 920 * Adjusts the dropdown panes orientation by adding/removing positioning classes. 921 * @function 922 * @private 923 * @param {String} position - position class to remove. 924 */},{key:'_reposition',value:function _reposition(position){this.usedPositions.push(position?position:'bottom'); //default, try switching to opposite side 925if(!position&&this.usedPositions.indexOf('top')<0){this.$element.addClass('top');}else if(position==='top'&&this.usedPositions.indexOf('bottom')<0){this.$element.removeClass(position);}else if(position==='left'&&this.usedPositions.indexOf('right')<0){this.$element.removeClass(position).addClass('right');}else if(position==='right'&&this.usedPositions.indexOf('left')<0){this.$element.removeClass(position).addClass('left');} //if default change didn't work, try bottom or left first 926else if(!position&&this.usedPositions.indexOf('top')>-1&&this.usedPositions.indexOf('left')<0){this.$element.addClass('left');}else if(position==='top'&&this.usedPositions.indexOf('bottom')>-1&&this.usedPositions.indexOf('left')<0){this.$element.removeClass(position).addClass('left');}else if(position==='left'&&this.usedPositions.indexOf('right')>-1&&this.usedPositions.indexOf('bottom')<0){this.$element.removeClass(position);}else if(position==='right'&&this.usedPositions.indexOf('left')>-1&&this.usedPositions.indexOf('bottom')<0){this.$element.removeClass(position);} //if nothing cleared, set to bottom 927else {this.$element.removeClass(position);}this.classChanged=true;this.counter--;} /** 928 * Sets the position and orientation of the dropdown pane, checks for collisions. 929 * Recursively calls itself if a collision is detected, with a new position class. 930 * @function 931 * @private 932 */},{key:'_setPosition',value:function _setPosition(){if(this.$anchor.attr('aria-expanded')==='false'){return false;}var position=this.getPositionClass(),$eleDims=Foundation.Box.GetDimensions(this.$element),$anchorDims=Foundation.Box.GetDimensions(this.$anchor),_this=this,direction=position==='left'?'left':position==='right'?'left':'top',param=direction==='top'?'height':'width',offset=param==='height'?this.options.vOffset:this.options.hOffset;if($eleDims.width>=$eleDims.windowDims.width||!this.counter&&!Foundation.Box.ImNotTouchingYou(this.$element)){this.$element.offset(Foundation.Box.GetOffsets(this.$element,this.$anchor,'center bottom',this.options.vOffset,this.options.hOffset,true)).css({'width':$eleDims.windowDims.width-this.options.hOffset*2,'height':'auto'});this.classChanged=true;return false;}this.$element.offset(Foundation.Box.GetOffsets(this.$element,this.$anchor,position,this.options.vOffset,this.options.hOffset));while(!Foundation.Box.ImNotTouchingYou(this.$element)&&this.counter){this._reposition(position);this._setPosition();}} /** 933 * Adds event listeners to the element utilizing the triggers utility library. 934 * @function 935 * @private 936 */},{key:'_events',value:function _events(){var _this=this;this.$element.on({'open.zf.trigger':this.open.bind(this),'close.zf.trigger':this.close.bind(this),'toggle.zf.trigger':this.toggle.bind(this),'resizeme.zf.trigger':this._setPosition.bind(this)});if(this.options.hover){this.$anchor.off('mouseenter.zf.dropdown mouseleave.zf.dropdown').on('mouseenter.zf.dropdown',function(){clearTimeout(_this.timeout);_this.timeout=setTimeout(function(){_this.open();_this.$anchor.data('hover',true);},_this.options.hoverDelay);}).on('mouseleave.zf.dropdown',function(){clearTimeout(_this.timeout);_this.timeout=setTimeout(function(){_this.close();_this.$anchor.data('hover',false);},_this.options.hoverDelay);});if(this.options.hoverPane){this.$element.off('mouseenter.zf.dropdown mouseleave.zf.dropdown').on('mouseenter.zf.dropdown',function(){clearTimeout(_this.timeout);}).on('mouseleave.zf.dropdown',function(){clearTimeout(_this.timeout);_this.timeout=setTimeout(function(){_this.close();_this.$anchor.data('hover',false);},_this.options.hoverDelay);});}}this.$anchor.add(this.$element).on('keydown.zf.dropdown',function(e){var $target=$(this),visibleFocusableElements=Foundation.Keyboard.findFocusable(_this.$element);Foundation.Keyboard.handleKey(e,'Dropdown',{tab_forward:function tab_forward(){if(_this.$element.find(':focus').is(visibleFocusableElements.eq(-1))){ // left modal downwards, setting focus to first element 937if(_this.options.trapFocus){ // if focus shall be trapped 938visibleFocusableElements.eq(0).focus();e.preventDefault();}else { // if focus is not trapped, close dropdown on focus out 939_this.close();}}},tab_backward:function tab_backward(){if(_this.$element.find(':focus').is(visibleFocusableElements.eq(0))||_this.$element.is(':focus')){ // left modal upwards, setting focus to last element 940if(_this.options.trapFocus){ // if focus shall be trapped 941visibleFocusableElements.eq(-1).focus();e.preventDefault();}else { // if focus is not trapped, close dropdown on focus out 942_this.close();}}},open:function open(){if($target.is(_this.$anchor)){_this.open();_this.$element.attr('tabindex',-1).focus();e.preventDefault();}},close:function close(){_this.close();_this.$anchor.focus();}});});} /** 943 * Adds an event handler to the body to close any dropdowns on a click. 944 * @function 945 * @private 946 */},{key:'_addBodyHandler',value:function _addBodyHandler(){var $body=$(document.body).not(this.$element),_this=this;$body.off('click.zf.dropdown').on('click.zf.dropdown',function(e){if(_this.$anchor.is(e.target)||_this.$anchor.find(e.target).length){return;}if(_this.$element.find(e.target).length){return;}_this.close();$body.off('click.zf.dropdown');});} /** 947 * Opens the dropdown pane, and fires a bubbling event to close other dropdowns. 948 * @function 949 * @fires Dropdown#closeme 950 * @fires Dropdown#show 951 */},{key:'open',value:function open(){ // var _this = this; 952/** 953 * Fires to close other open dropdowns 954 * @event Dropdown#closeme 955 */this.$element.trigger('closeme.zf.dropdown',this.$element.attr('id'));this.$anchor.addClass('hover').attr({'aria-expanded':true}); // this.$element/*.show()*/; 956this._setPosition();this.$element.addClass('is-open').attr({'aria-hidden':false});
956if(this.options.autoFocus){var $focusable=Foundation.Keyboard.findFocusable(this.$element);if($focusable.length){$focusable.eq(0).focus();}}if(this.options.closeOnClick){this._addBodyHandler();} /** 957 * Fires once the dropdown is visible. 958 * @event Dropdown#show 959 */this.$element.trigger('show.zf.dropdown',[this.$element]);} /** 960 * Closes the open dropdown pane. 961 * @function 962 * @fires Dropdown#hide 963 */},{key:'close',value:function close(){if(!this.$element.hasClass('is-open')){return false;}this.$element.removeClass('is-open').attr({'aria-hidden':true});this.$anchor.removeClass('hover').attr('aria-expanded',false);if(this.classChanged){var curPositionClass=this.getPositionClass();if(curPositionClass){this.$element.removeClass(curPositionClass);}this.$element.addClass(this.options.positionClass) /*.hide()*/.css({height:'',width:''});this.classChanged=false;this.counter=4;this.usedPositions.length=0;}this.$element.trigger('hide.zf.dropdown',[this.$element]);} /** 964 * Toggles the dropdown pane's visibility. 965 * @function 966 */},{key:'toggle',value:function toggle(){if(this.$element.hasClass('is-open')){if(this.$anchor.data('hover'))return;this.close();}else {this.open();}} /** 967 * Destroys the dropdown. 968 * @function 969 */},{key:'destroy',value:function destroy(){this.$element.off('.zf.trigger').hide();this.$anchor.off('.zf.dropdown');Foundation.unregisterPlugin(this);}}]);return Dropdown;}();Dropdown.defaults={ /** 970 * Amount of time to delay opening a submenu on hover event. 971 * @option 972 * @example 250 973 */hoverDelay:250, /** 974 * Allow submenus to open on hover events 975 * @option 976 * @example false 977 */hover:false, /** 978 * Don't close dropdown when hovering over dropdown pane 979 * @option 980 * @example true 981 */hoverPane:false, /** 982 * Number of pixels between the dropdown pane and the triggering element on open. 983 * @option 984 * @example 1 985 */vOffset:1, /** 986 * Number of pixels between the dropdown pane and the triggering element on open. 987 * @option 988 * @example 1 989 */hOffset:1, /** 990 * Class applied to adjust open position. JS will test and fill this in. 991 * @option 992 * @example 'top' 993 */positionClass:'', /** 994 * Allow the plugin to trap focus to the dropdown pane if opened with keyboard commands. 995 * @option 996 * @example false 997 */trapFocus:false, /** 998 * Allow the plugin to set focus to the first focusable element within the pane, regardless of method of opening. 999 * @option 1000 * @example true 1001 */autoFocus:false, /** 1002 * Allows a click on the body to close the dropdown. 1003 * @option 1004 * @example false 1005 */closeOnClick:false}; // Window exports 1006Foundation.plugin(Dropdown,'Dropdown');}(jQuery); 1007'use strict';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value" in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}!function($){ /** 1008 * DropdownMenu module. 1009 * @module foundation.dropdown-menu 1010 * @requires foundation.util.keyboard 1011 * @requires foundation.util.box 1012 * @requires foundation.util.nest 1013 */var DropdownMenu=function(){ /** 1014 * Creates a new instance of DropdownMenu. 1015 * @class 1016 * @fires DropdownMenu#init 1017 * @param {jQuery} element - jQuery object to make into a dropdown menu. 1018 * @param {Object} options - Overrides to the default plugin settings. 1019 */function DropdownMenu(element,options){_classCallCheck(this,DropdownMenu);this.$element=element;this.options=$.extend({},DropdownMenu.defaults,this.$element.data(),options);Foundation.Nest.Feather(this.$element,'dropdown');this._init();Foundation.registerPlugin(this,'DropdownMenu');Foundation.Keyboard.register('DropdownMenu',{'ENTER':'open','SPACE':'open','ARROW_RIGHT':'next','ARROW_UP':'up','ARROW_DOWN':'down','ARROW_LEFT':'previous','ESCAPE':'close'});} /** 1020 * Initializes the plugin, and calls _prepareMenu 1021 * @private 1022 * @function 1023 */_createClass(DropdownMenu,[{key:'_init',value:function _init(){var subs=this.$element.find('li.is-dropdown-submenu-parent');this.$element.children('.is-dropdown-submenu-parent').children('.is-dropdown-submenu').addClass('first-sub');this.$menuItems=this.$element.find('[role="menuitem"]');this.$tabs=this.$element.children('[role="menuitem"]');this.$tabs.find('ul.is-dropdown-submenu').addClass(this.options.verticalClass);if(this.$element.hasClass(this.options.rightClass)||this.options.alignment==='right'||Foundation.rtl()){this.options.alignment='right';subs.addClass('opens-left');}else {subs.addClass('opens-right');}this.changed=false;this._events();}},{key:'_events', /** 1024 * Adds event listeners to elements within the menu 1025 * @private 1026 * @function 1027 */value:function _events(){var _this=this,hasTouch='ontouchstart' in window||typeof window.ontouchstart!=='undefined',parClass='is-dropdown-submenu-parent';if(this.options.clickOpen||hasTouch){this.$menuItems.on('click.zf.dropdownmenu touchstart.zf.dropdownmenu',function(e){var $elem=$(e.target).parentsUntil('ul','.'+parClass),hasSub=$elem.hasClass(parClass),hasClicked=$elem.attr('data-is-click')==='true',$sub=$elem.children('.is-dropdown-submenu');if(hasSub){if(hasClicked){if(!_this.options.closeOnClick||!_this.options.clickOpen&&!hasTouch||_this.options.forceFollow&&hasTouch){return;}else {e.stopImmediatePropagation();e.preventDefault();_this._hide($elem);}}else {e.preventDefault();e.stopImmediatePropagation();_this._show($elem.children('.is-dropdown-submenu'));$elem.add($elem.parentsUntil(_this.$element,'.'+parClass)).attr('data-is-click',true);}}else {return;}});}if(!this.options.disableHover){this.$menuItems.on('mouseenter.zf.dropdownmenu',function(e){e.stopImmediatePropagation();var $elem=$(this),hasSub=$elem.hasClass(parClass);if(hasSub){clearTimeout(_this.delay);_this.delay=setTimeout(function(){_this._show($elem.children('.is-dropdown-submenu'));},_this.options.hoverDelay);}}).on('mouseleave.zf.dropdownmenu',function(e){var $elem=$(this),hasSub=$elem.hasClass(parClass);if(hasSub&&_this.options.autoclose){if($elem.attr('data-is-click')==='true'&&_this.options.clickOpen){return false;}clearTimeout(_this.delay);_this.delay=setTimeout(function(){_this._hide($elem);},_this.options.closingTime);}});}this.$menuItems.on('keydown.zf.dropdownmenu',function(e){var $element=$(e.target).parentsUntil('ul','[role="menuitem"]'),isTab=_this.$tabs.index($element)>-1,$elements=isTab?_this.$tabs:$element.siblings('li').add($element),$prevElement,$nextElement;$elements.each(function(i){if($(this).is($element)){$prevElement=$elements.eq(i-1);
1027$nextElement=$elements.eq(i+1);return;}});var nextSibling=function nextSibling(){if(!$element.is(':last-child'))$nextElement.children('a:first').focus();},prevSibling=function prevSibling(){$prevElement.children('a:first').focus();},openSub=function openSub(){var $sub=$element.children('ul.is-dropdown-submenu');if($sub.length){_this._show($sub);$element.find('li > a:first').focus();}else {return;}},closeSub=function closeSub(){ //if ($element.is(':first-child')) { 1028var close=$element.parent('ul').parent('li');close.children('a:first').focus();_this._hide(close); //} 1029};var functions={open:openSub,close:function close(){_this._hide(_this.$element);_this.$menuItems.find('a:first').focus(); // focus to first element 1030},handled:function handled(){e.preventDefault();e.stopImmediatePropagation();}};if(isTab){if(_this.vertical){ // vertical menu 1031if(_this.options.alignment==='left'){ // left aligned 1032$.extend(functions,{down:nextSibling,up:prevSibling,next:openSub,previous:closeSub});}else { // right aligned 1033$.extend(functions,{down:nextSibling,up:prevSibling,next:closeSub,previous:openSub});}}else { // horizontal menu 1034$.extend(functions,{next:nextSibling,previous:prevSibling,down:openSub,up:closeSub});}}else { // not tabs -> one sub 1035if(_this.options.alignment==='left'){ // left aligned 1036$.extend(functions,{next:openSub,previous:closeSub,down:nextSibling,up:prevSibling});}else { // right aligned 1037$.extend(functions,{next:closeSub,previous:openSub,down:nextSibling,up:prevSibling});}}Foundation.Keyboard.handleKey(e,'DropdownMenu',functions);});} /** 1038 * Adds an event handler to the body to close any dropdowns on a click. 1039 * @function 1040 * @private 1041 */},{key:'_addBodyHandler',value:function _addBodyHandler(){var $body=$(document.body),_this=this;$body.off('mouseup.zf.dropdownmenu touchend.zf.dropdownmenu').on('mouseup.zf.dropdownmenu touchend.zf.dropdownmenu',function(e){var $link=_this.$element.find(e.target);if($link.length){return;}_this._hide();$body.off('mouseup.zf.dropdownmenu touchend.zf.dropdownmenu');});} /** 1042 * Opens a dropdown pane, and checks for collisions first. 1043 * @param {jQuery} $sub - ul element that is a submenu to show 1044 * @function 1045 * @private 1046 * @fires DropdownMenu#show 1047 */},{key:'_show',value:function _show($sub){var idx=this.$tabs.index(this.$tabs.filter(function(i,el){return $(el).find($sub).length>0;}));var $sibs=$sub.parent('li.is-dropdown-submenu-parent').siblings('li.is-dropdown-submenu-parent');this._hide($sibs,idx);$sub.css('visibility','hidden').addClass('js-dropdown-active').attr({'aria-hidden':false}).parent('li.is-dropdown-submenu-parent').addClass('is-active').attr({'aria-expanded':true});var clear=Foundation.Box.ImNotTouchingYou($sub,null,true);if(!clear){var oldClass=this.options.alignment==='left'?'-right':'-left',$parentLi=$sub.parent('.is-dropdown-submenu-parent');$parentLi.removeClass('opens'+oldClass).addClass('opens-'+this.options.alignment);clear=Foundation.Box.ImNotTouchingYou($sub,null,true);if(!clear){$parentLi.removeClass('opens-'+this.options.alignment).addClass('opens-inner');}this.changed=true;}$sub.css('visibility','');if(this.options.closeOnClick){this._addBodyHandler();} /** 1048 * Fires when the new dropdown pane is visible. 1049 * @event DropdownMenu#show 1050 */this.$element.trigger('show.zf.dropdownmenu',[$sub]);} /** 1051 * Hides a single, currently open dropdown pane, if passed a parameter, otherwise, hides everything. 1052 * @function 1053 * @param {jQuery} $elem - element with a submenu to hide 1054 * @param {Number} idx - index of the $tabs collection to hide 1055 * @private 1056 */},{key:'_hide',value:function _hide($elem,idx){var $toClose;if($elem&&$elem.length){$toClose=$elem;}else if(idx!==undefined){$toClose=this.$tabs.not(function(i,el){return i===idx;});}else {$toClose=this.$element;}var somethingToClose=$toClose.hasClass('is-active')||$toClose.find('.is-active').length>0;if(somethingToClose){$toClose.find('li.is-active').add($toClose).attr({'aria-expanded':false,'data-is-click':false}).removeClass('is-active');$toClose.find('ul.js-dropdown-active').attr({'aria-hidden':true}).removeClass('js-dropdown-active');if(this.changed||$toClose.find('opens-inner').length){var oldClass=this.options.alignment==='left'?'right':'left';$toClose.find('li.is-dropdown-submenu-parent').add($toClose).removeClass('opens-inner opens-'+this.options.alignment).addClass('opens-'+oldClass);this.changed=false;} /** 1057 * Fires when the open menus are closed. 1058 * @event DropdownMenu#hide 1059 */this.$element.trigger('hide.zf.dropdownmenu',[$toClose]);}} /** 1060 * Destroys the plugin. 1061 * @function 1062 */},{key:'destroy',value:function destroy(){this.$menuItems.off('.zf.dropdownmenu').removeAttr('data-is-click').removeClass('is-right-arrow is-left-arrow is-down-arrow opens-right opens-left opens-inner');$(document.body).off('.zf.dropdownmenu');Foundation.Nest.Burn(this.$element,'dropdown');Foundation.unregisterPlugin(this);}}]);return DropdownMenu;}(); /** 1063 * Default settings for plugin 1064 */DropdownMenu.defaults={ /** 1065 * Disallows hover events from opening submenus 1066 * @option 1067 * @example false 1068 */disableHover:false, /** 1069 * Allow a submenu to automatically close on a mouseleave event, if not clicked open. 1070 * @option 1071 * @example true 1072 */autoclose:true, /** 1073 * Amount of time to delay opening a submenu on hover event. 1074 * @option 1075 * @example 50 1076 */hoverDelay:50, /** 1077 * Allow a submenu to open/remain open on parent click event. Allows cursor to move away from menu. 1078 * @option 1079 * @example true 1080 */clickOpen:false, /** 1081 * Amount of time to delay closing a submenu on a mouseleave event. 1082 * @option 1083 * @example 500 1084 */closingTime:500, /** 1085 * Position of the menu relative to what direction the submenus should open. Handled by JS. 1086 * @option 1087 * @example 'left' 1088 */alignment:'left', /** 1089 * Allow clicks on the body to close any open submenus. 1090 * @option 1091 * @example true 1092 */closeOnClick:true, /** 1093 * Class applied to vertical oriented menus, Foundation default is `vertical`. Update this if using your own class. 1094 * @option 1095 * @example 'vertical' 1096 */verticalClass:'vertical', /** 1097 * Class applied to right-side oriented menus, Foundation default is `align-right`. Update this if using your own class. 1098 * @option 1099 * @example 'align-right' 1100 */rightClass:'align-right', /** 1101 * Boolean to force overide the clicking of links to perform default action, on second touch event for mobile. 1102 * @option 1103 * @example false 1104 */forceFollow:true}; // Window exports 1105Foundation.plugin(DropdownMenu,'DropdownMenu');}(jQuery); 1106'use strict';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value" in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}!function($){ /** 1107 * Equalizer module. 1108 * @module foundation.equalizer 1109 */var Equalizer=function(){ /** 1110 * Creates a new instance of Equalizer. 1111 * @class 1112 * @fires Equalizer#init 1113 * @param {Object} element - jQuery object to add the trigger to. 1114 * @param {Object} options - Overrides to the default plugin settings. 1115 */function Equalizer(element,options){_classCallCheck(this,Equalizer);this.$element=element;this.options=$.extend({},Equalizer.defaults,this.$element.data(),options);this._init();Foundation.registerPlugin(this,'Equalizer');} /** 1116 * Initializes the Equalizer plugin and calls functions to get equalizer functioning on load. 1117 * @private 1118 */_createClass(Equalizer,[{key:'_init',value:function _init(){var eqId=this.$element.attr('data-equalizer')||'';var $watched=this.$element.find('[data-equalizer-watch="'+eqId+'"]');this.$watched=$watched.length?$watched:this.$element.find('[data-equalizer-watch]');this.$element.attr('data-resize',eqId||Foundation.GetYoDigits(6,'eq'));this.hasNested=this.$element.find('[data-equalizer]').length>0;this.isNested=this.$element.parentsUntil(document.body,'[data-equalizer]').length>0;this.isOn=false;var imgs=this.$element.find('img');var tooSmall;if(this.options.equalizeOn){tooSmall=this._checkMQ();$(window).on('changed.zf.mediaquery',this._checkMQ.bind(this));}else {this._events();}if(tooSmall!==undefined&&tooSmall===false||tooSmall===undefined){if(imgs.length){Foundation.onImagesLoaded(imgs,this._reflow.bind(this));}else {this._reflow();}}} /** 1119 * Removes event listeners if the breakpoint is too small. 1120 * @private 1121 */},{key:'_pauseEvents',value:function _pauseEvents(){this.isOn=false;
vendor: 4,185 bytes, lines 1121-1165
1121this.$element.off('.zf.equalizer resizeme.zf.trigger');} /** 1122 * Initializes events for Equalizer. 1123 * @private 1124 */},{key:'_events',value:function _events(){var _this=this;this._pauseEvents();if(this.hasNested){this.$element.on('postequalized.zf.equalizer',function(e){if(e.target!==_this.$element[0]){_this._reflow();}});}else {this.$element.on('resizeme.zf.trigger',this._reflow.bind(this));}this.isOn=true;} /** 1125 * Checks the current breakpoint to the minimum required size. 1126 * @private 1127 */},{key:'_checkMQ',value:function _checkMQ(){var tooSmall=!Foundation.MediaQuery.atLeast(this.options.equalizeOn);if(tooSmall){if(this.isOn){this._pauseEvents();this.$watched.css('height','auto');}}else {if(!this.isOn){this._events();}}return tooSmall;} /** 1128 * A noop version for the plugin 1129 * @private 1130 */},{key:'_killswitch',value:function _killswitch(){return;} /** 1131 * Calls necessary functions to update Equalizer upon DOM change 1132 * @private 1133 */},{key:'_reflow',value:function _reflow(){if(!this.options.equalizeOnStack){if(this._isStacked()){this.$watched.css('height','auto');return false;}}if(this.options.equalizeByRow){this.getHeightsByRow(this.applyHeightByRow.bind(this));}else {this.getHeights(this.applyHeight.bind(this));}} /** 1134 * Manually determines if the first 2 elements are *NOT* stacked. 1135 * @private 1136 */},{key:'_isStacked',value:function _isStacked(){return this.$watched[0].offsetTop!==this.$watched[1].offsetTop;} /** 1137 * Finds the outer heights of children contained within an Equalizer parent and returns them in an array 1138 * @param {Function} cb - A non-optional callback to return the heights array to. 1139 * @returns {Array} heights - An array of heights of children within Equalizer container 1140 */},{key:'getHeights',value:function getHeights(cb){var heights=[];for(var i=0,len=this.$watched.length;i<len;i++){this.$watched[i].style.height='auto';heights.push(this.$watched[i].offsetHeight);}cb(heights);} /** 1141 * Finds the outer heights of children contained within an Equalizer parent and returns them in an array 1142 * @param {Function} cb - A non-optional callback to return the heights array to. 1143 * @returns {Array} groups - An array of heights of children within Equalizer container grouped by row with element,height and max as last child 1144 */},{key:'getHeightsByRow',value:function getHeightsByRow(cb){var lastElTopOffset=this.$watched.first().offset().top,groups=[],group=0; //group by Row 1145groups[group]=[];for(var i=0,len=this.$watched.length;i<len;i++){this.$watched[i].style.height='auto'; //maybe could use this.$watched[i].offsetTop 1146var elOffsetTop=$(this.$watched[i]).offset().top;if(elOffsetTop!=lastElTopOffset){group++;groups[group]=[];lastElTopOffset=elOffsetTop;}groups[group].push([this.$watched[i],this.$watched[i].offsetHeight]);}for(var j=0,ln=groups.length;j<ln;j++){var heights=$(groups[j]).map(function(){return this[1];}).get();var max=Math.max.apply(null,heights);groups[j].push(max);}cb(groups);} /** 1147 * Changes the CSS height property of each child in an Equalizer parent to match the tallest 1148 * @param {array} heights - An array of heights of children within Equalizer container 1149 * @fires Equalizer#preequalized 1150 * @fires Equalizer#postequalized 1151 */},{key:'applyHeight',value:function applyHeight(heights){var max=Math.max.apply(null,heights); /** 1152 * Fires before the heights are applied 1153 * @event Equalizer#preequalized 1154 */this.$element.trigger('preequalized.zf.equalizer');this.$watched.css('height',max); /** 1155 * Fires when the heights have been applied 1156 * @event Equalizer#postequalized 1157 */this.$element.trigger('postequalized.zf.equalizer');} /** 1158 * Changes the CSS height property of each child in an Equalizer parent to match the tallest by row 1159 * @param {array} groups - An array of heights of children within Equalizer container grouped by row with element,height and max as last child 1160 * @fires Equalizer#preequalized 1161 * @fires Equalizer#preequalizedRow 1162 * @fires Equalizer#postequalizedRow 1163 * @fires Equalizer#postequalized 1164 */},{key:'applyHeightByRow',value:function applyHeightByRow(groups){ /** 1165 * Fires before the heights are applied
1166 */this.$element.trigger('preequalized.zf.equalizer');for(var i=0,len=groups.length;i<len;i++){var groupsILength=groups[i].length,max=groups[i][groupsILength-1];if(groupsILength<=2){$(groups[i][0][0]).css({'height':'auto'});continue;} /** 1167 * Fires before the heights per row are applied 1168 * @event Equalizer#preequalizedRow 1169 */this.$element.trigger('preequalizedrow.zf.equalizer');for(var j=0,lenJ=groupsILength-1;j<lenJ;j++){$(groups[i][j][0]).css({'height':max});} /** 1170 * Fires when the heights per row have been applied 1171 * @event Equalizer#postequalizedRow 1172 */this.$element.trigger('postequalizedrow.zf.equalizer');} /** 1173 * Fires when the heights have been applied 1174 */this.$element.trigger('postequalized.zf.equalizer');} /** 1175 * Destroys an instance of Equalizer. 1176 * @function 1177 */},{key:'destroy',value:function destroy(){this._pauseEvents();this.$watched.css('height','auto');Foundation.unregisterPlugin(this);}}]);return Equalizer;}(); /** 1178 * Default settings for plugin 1179 */Equalizer.defaults={ /** 1180 * Enable height equalization when stacked on smaller screens. 1181 * @option 1182 * @example true 1183 */equalizeOnStack:true, /** 1184 * Enable height equalization row by row. 1185 * @option 1186 * @example false 1187 */equalizeByRow:false, /** 1188 * String representing the minimum breakpoint size the plugin should equalize heights on. 1189 * @option 1190 * @example 'medium' 1191 */equalizeOn:''}; // Window exports 1192Foundation.plugin(Equalizer,'Equalizer');}(jQuery); 1193'use strict';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value" in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}!function($){ /** 1194 * Interchange module. 1195 * @module foundation.interchange 1196 * @requires foundation.util.mediaQuery 1197 * @requires foundation.util.timerAndImageLoader 1198 */var Interchange=function(){ /** 1199 * Creates a new instance of Interchange. 1200 * @class 1201 * @fires Interchange#init 1202 * @param {Object} element - jQuery object to add the trigger to. 1203 * @param {Object} options - Overrides to the default plugin settings. 1204 */function Interchange(element,options){_classCallCheck(this,Interchange);this.$element=element;this.options=$.extend({},Interchange.defaults,options);this.rules=[];this.currentPath='';this._init();this._events();Foundation.registerPlugin(this,'Interchange');} /** 1205 * Initializes the Interchange plugin and calls functions to get interchange functioning on load. 1206 * @function 1207 * @private 1208 */_createClass(Interchange,[{key:'_init',value:function _init(){this._addBreakpoints();this._generateRules();this._reflow();} /** 1209 * Initializes events for Interchange. 1210 * @function 1211 * @private 1212 */},{key:'_events',value:function _events(){$(window).on('resize.zf.interchange',Foundation.util.throttle(this._reflow.bind(this),50));} /** 1213 * Calls necessary functions to update Interchange upon DOM change 1214 * @function 1215 * @private 1216 */},{key:'_reflow',value:function _reflow(){var match; // Iterate through each rule, but only save the last match 1217for(var i in this.rules){var rule=this.rules[i];if(window.matchMedia(rule.query).matches){match=rule;}}if(match){this.replace(match.path);}} /** 1218 * Gets the Foundation breakpoints and adds them to the Interchange.SPECIAL_QUERIES object. 1219 * @function 1220 * @private 1221 */},{key:'_addBreakpoints',value:function _addBreakpoints(){for(var i in Foundation.MediaQuery.queries){var query=Foundation.MediaQuery.queries[i];Interchange.SPECIAL_QUERIES[query.name]=query.value;}} /** 1222 * Checks the Interchange element for the provided media query + content pairings 1223 * @function 1224 * @private 1225 * @param {Object} element - jQuery object that is an Interchange instance 1226 * @returns {Array} scenarios - Array of objects that have 'mq' and 'path' keys with corresponding keys 1227 */},{key:'_generateRules',value:function _generateRules(element){var rulesList=[];var rules;if(this.options.rules){rules=this.options.rules;}else {rules=this.$element.data('interchange').match(/\[.*?\]/g);}for(var i in rules){var rule=rules[i].slice(1,-1).split(', ');var path=rule.slice(0,-1).join('');var query=rule[rule.length-1];if(Interchange.SPECIAL_QUERIES[query]){query=Interchange.SPECIAL_QUERIES[query];}rulesList.push({path:path,query:query});}this.rules=rulesList;} /** 1228 * Update the `src` property of an image, or change the HTML of a container, to the specified path. 1229 * @function 1230 * @param {String} path - Path to the image or HTML partial. 1231 * @fires Interchange#replaced 1232 */},{key:'replace',value:function replace(path){if(this.currentPath===path)return;var _this=this,trigger='replaced.zf.interchange'; // Replacing images 1233if(this.$element[0].nodeName==='IMG'){this.$element.attr('src',path).load(function(){_this.currentPath=path;}).trigger(trigger);} // Replacing background images 1234else if(path.match(/\.(gif|jpg|jpeg|tiff|png)([?#].*)?/i)){this.$element.css({'background-image':'url('+path+')'}).trigger(trigger);} // Replacing HTML 1235else {$.get(path,function(response){_this.$element.html(response).trigger(trigger);$(response).foundation();_this.currentPath=path;});} /** 1236 * Fires when content in an Interchange element is done being loaded. 1237 * @event Interchange#replaced 1238 */ // this.$element.trigger('replaced.zf.interchange'); 1239} /** 1240 * Destroys an instance of interchange. 1241 * @function 1242 */},{key:'destroy',value:function destroy(){ //TODO this. 1243}}]);return Interchange;}(); /** 1244 * Default settings for plugin 1245 */Interchange.defaults={ /** 1246 * Rules to be applied to Interchange elements. Set with the `data-interchange` array notation. 1247 * @option 1248 */rules:null};Interchange.SPECIAL_QUERIES={'landscape':'screen and (orientation: landscape)','portrait':'screen and (orientation: portrait)','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)'}; // Window exports 1249Foundation.plugin(Interchange,'Interchange');}(jQuery); 1250'use strict';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value" in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}!function($){ /** 1251 * Magellan module. 1252 * @module foundation.magellan 1253 */var Magellan=function(){ /** 1254 * Creates a new instance of Magellan. 1255 * @class 1256 * @fires Magellan#init 1257 * @param {Object} element - jQuery object to add the trigger to. 1258 * @param {Object} options - Overrides to the default plugin settings. 1259 */function Magellan(element,options){_classCallCheck(this,Magellan);this.$element=element;this.options=$.extend({},Magellan.defaults,this.$element.data(),options);this._init();Foundation.registerPlugin(this,'Magellan');} /** 1260 * Initializes the Magellan plugin and calls functions to get equalizer functioning on load. 1261 * @private 1262 */_createClass(Magellan,[{key:'_init',value:function _init(){var id=this.$element[0].id||Foundation.GetYoDigits(6,'magellan');var _this=this;this.$targets=$('[data-magellan-target]');this.$links=this.$element.find('a');this.$element.attr({'data-resize':id,'data-scroll':id,'id':id});this.$active=$();this.scrollPos=parseInt(window.pageYOffset,10);this._events();} /** 1263 * Calculates an array of pixel values that are the demarcation lines between locations on the page. 1264 * Can be invoked if new elements are added or the size of a location changes. 1265 * @function 1266 */},{key:'calcPoints',value:function calcPoints(){var _this=this,body=document.body,html=document.documentElement;this.points=[];this.winHeight=Math.round(Math.max(window.innerHeight,html.clientHeight));this.docHeight=Math.round(Math.max(body.scrollHeight,body.offsetHeight,html.clientHeight,html.scrollHeight,html.offsetHeight));this.$targets.each(function(){var $tar=$(this),pt=Math.round($tar.offset().top-_this.options.threshold);$tar.targetPoint=pt;_this.points.push(pt);});} /** 1267 * Initializes events for Magellan. 1268 * @private 1269 */},{key:'_events',value:function _events(){var _this=this,$body=$('html, body'),opts={duration:_this.options.animationDuration,easing:_this.options.animationEasing};$(window).one('load',function(){if(_this.options.deepLinking){if(location.hash){_this.scrollToLoc(location.hash);}}_this.calcPoints();_this._updateActive();});this.$element.on({'resizeme.zf.trigger':this.reflow.bind(this),'scrollme.zf.trigger':this._updateActive.bind(this)}).on('click.zf.magellan','a[href^="#"]',function(e){e.preventDefault();var arrival=this.getAttribute('href');_this.scrollToLoc(arrival);});} /** 1270 * Function to scroll to a given location on the page. 1271 * @param {String} loc - a properly formatted jQuery id selector. Example: '#foo' 1272 * @function 1273 */},{key:'scrollToLoc',value:function scrollToLoc(loc){var scrollPos=Math.round($(loc).offset().top-this.options.threshold/2-this.options.barOffset);$('html, body').stop(true).animate({scrollTop:scrollPos},this.options.animationDuration,this.options.animationEasing);} /** 1274 * Calls necessary functions to update Magellan upon DOM change 1275 * @function 1276 */},{key:'reflow',value:function reflow(){this.calcPoints();this._updateActive();} /** 1277 * Updates the visibility of an active location link, and updates the url hash for the page, if deepLinking enabled. 1278 * @private 1279 * @function 1280 * @fires Magellan#update 1281 */},{key:'_updateActive',value:function _updateActive() /*evt, elem, scrollPos*/{var winPos= /*scrollPos ||*/parseInt(window.pageYOffset,10),curIdx;if(winPos+this.winHeight===this.docHeight){curIdx=this.points.length-1;}else if(winPos<this.points[0]){curIdx=0;}else {var isDown=this.scrollPos<winPos,_this=this,curVisible=this.points.filter(function(p,i){return isDown?p<=winPos:p-_this.options.threshold<=winPos; //&& winPos >= _this.points[i -1] - _this.options.threshold; 1282});curIdx=curVisible.length?curVisible.length-1:0;}this.$active.removeClass(this.options.activeClass);this.$active=this.$links.eq(curIdx).addClass(this.options.activeClass);if(this.options.deepLinking){var hash=this.$active[0].getAttribute('href');if(window.history.pushState){window.history.pushState(null,null,hash);}else {window.location.hash=hash;}}this.scrollPos=winPos; /** 1283 * Fires when magellan is finished updating to the new active element. 1284 * @event Magellan#update 1285 */this.$element.trigger('update.zf.magellan',[this.$active]);} /** 1286 * Destroys an instance of Magellan and resets the url of the window. 1287 * @function 1288 */},{key:'destroy',value:function destroy(){this.$element.off('.zf.trigger .zf.magellan').find('.'+this.options.activeClass).removeClass(this.options.activeClass);if(this.options.deepLinking){var hash=this.$active[0].getAttribute('href');window.location.hash.replace(hash,'');}Foundation.unregisterPlugin(this);}}]);return Magellan;}(); /** 1289 * Default settings for plugin 1290 */Magellan.defaults={ /** 1291 * Amount of time, in ms, the animated scrolling should take between locations. 1292 * @option 1293 * @example 500 1294 */animationDuration:500, /** 1295 * Animation style to use when scrolling between locations. 1296 * @option 1297 * @example 'ease-in-out' 1298 */animationEasing:'linear', /** 1299 * Number of pixels to use as a marker for location changes. 1300 * @option 1301 * @example 50 1302 */threshold:50, /** 1303 * Class applied to the active locations link on the magellan container. 1304 * @option 1305 * @example 'active' 1306 */activeClass:'active', /** 1307 * Allows the script to manipulate the url of the current page, and if supported, alter the history. 1308 * @option 1309 * @example true 1310 */deepLinking:false, /** 1311 * Number of pixels to offset the scroll of the page on item click if using a sticky nav bar. 1312 * @option 1313 * @example 25 1314 */barOffset:0}; // Window exports 1315Foundation.plugin(Magellan,'Magellan');}(jQuery); 1316'use strict';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value" in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}!function($){ /** 1317 * OffCanvas module. 1318 * @module foundation.offcanvas 1319 * @requires foundation.util.mediaQuery 1320 * @requires foundation.util.triggers 1321 * @requires foundation.util.motion 1322 */var OffCanvas=function(){ /** 1323 * Creates a new instance of an off-canvas wrapper. 1324 * @class 1325 * @fires OffCanvas#init 1326 * @param {Object} element - jQuery object to initialize. 1327 * @param {Object} options - Overrides to the default plugin settings. 1328 */function OffCanvas(element,options){_classCallCheck(this,OffCanvas);this.$element=element;this.options=$.extend({},OffCanvas.defaults,this.$element.data(),options);this.$lastTrigger=$();this._init();this._events();Foundation.registerPlugin(this,'OffCanvas');} /** 1329 * Initializes the off-canvas wrapper by adding the exit overlay (if needed). 1330 * @function 1331 * @private 1332 */_createClass(OffCanvas,[{key:'_init',value:function _init(){var id=this.$element.attr('id');this.$element.attr('aria-hidden','true'); // Find triggers that affect this element and add aria-expanded to them 1333$(document).find('[data-open="'+id+'"], [data-close="'+id+'"], [data-toggle="'+id+'"]').attr('aria-expanded','false').attr('aria-controls',id); // Add a close trigger over the body if necessary 1334if(this.options.closeOnClick){if($('.js-off-canvas-exit').length){this.$exiter=$('.js-off-canvas-exit');}else {var exiter=document.createElement('div');exiter.setAttribute('class','js-off-canvas-exit');$('[data-off-canvas-content]').append(exiter);this.$exiter=$(exiter);}}this.options.isRevealed=this.options.isRevealed||new RegExp(this.options.revealClass,'g').test(this.$element[0].className);if(this.options.isRevealed){this.options.revealOn=this.options.revealOn||this.$element[0].className.match(/(reveal-for-medium|reveal-for-large)/g)[0].split('-')[2];this._setMQChecker();}if(!this.options.transitionTime){this.options.transitionTime=parseFloat(window.getComputedStyle($('[data-off-canvas-wrapper]')[0]).transitionDuration)*1000;}} /** 1335 * Adds event handlers to the off-canvas wrapper and the exit overlay. 1336 * @function 1337 * @private 1338 */},{key:'_events',value:function _events(){this.$element.off('.zf.trigger .zf.offcanvas').on({'open.zf.trigger':this.open.bind(this),'close.zf.trigger':this.close.bind(this),'toggle.zf.trigger':this.toggle.bind(this),'keydown.zf.offcanvas':this._handleKeyboard.bind(this)});if(this.options.closeOnClick&&this.$exiter.length){this.$exiter.on({'click.zf.offcanvas':this.close.bind(this)});}} /** 1339 * Applies event listener for elements that will reveal at certain breakpoints. 1340 * @private 1341 */},{key:'_setMQChecker',value:function _setMQChecker(){var _this=this;$(window).on('changed.zf.mediaquery',function(){if(Foundation.MediaQuery.atLeast(_this.options.revealOn)){_this.reveal(true);}else {_this.reveal(false);}}).one('load.zf.
1341offcanvas',function(){if(Foundation.MediaQuery.atLeast(_this.options.revealOn)){_this.reveal(true);}});} /** 1342 * Handles the revealing/hiding the off-canvas at breakpoints, not the same as open. 1343 * @param {Boolean} isRevealed - true if element should be revealed. 1344 * @function 1345 */},{key:'reveal',value:function reveal(isRevealed){var $closer=this.$element.find('[data-close]');if(isRevealed){this.close();this.isRevealed=true; // if (!this.options.forceTop) { 1346// var scrollPos = parseInt(window.pageYOffset); 1347// this.$element[0].style.transform = 'translate(0,' + scrollPos + 'px)'; 1348// } 1349// if (this.options.isSticky) { this._stick(); } 1350this.$element.off('open.zf.trigger toggle.zf.trigger');if($closer.length){$closer.hide();}}else {this.isRevealed=false; // if (this.options.isSticky || !this.options.forceTop) { 1351// this.$element[0].style.transform = ''; 1352// $(window).off('scroll.zf.offcanvas'); 1353// } 1354this.$element.on({'open.zf.trigger':this.open.bind(this),'toggle.zf.trigger':this.toggle.bind(this)});if($closer.length){$closer.show();}}} /** 1355 * Opens the off-canvas menu. 1356 * @function 1357 * @param {Object} event - Event object passed from listener. 1358 * @param {jQuery} trigger - element that triggered the off-canvas to open. 1359 * @fires OffCanvas#opened 1360 */},{key:'open',value:function open(event,trigger){if(this.$element.hasClass('is-open')||this.isRevealed){return;}var _this=this,$body=$(document.body);if(this.options.forceTop){$('body').scrollTop(0);} // window.pageYOffset = 0; 1361// if (!this.options.forceTop) { 1362// var scrollPos = parseInt(window.pageYOffset); 1363// this.$element[0].style.transform = 'translate(0,' + scrollPos + 'px)'; 1364// if (this.$exiter.length) { 1365// this.$exiter[0].style.transform = 'translate(0,' + scrollPos + 'px)'; 1366// } 1367// } 1368/** 1369 * Fires when the off-canvas menu opens. 1370 * @event OffCanvas#opened 1371 */Foundation.Move(this.options.transitionTime,this.$element,function(){$('[data-off-canvas-wrapper]').addClass('is-off-canvas-open is-open-'+_this.options.position);_this.$element.addClass('is-open'); // if (_this.options.isSticky) { 1372// _this._stick(); 1373// } 1374});this.$element.attr('aria-hidden','false').trigger('opened.zf.offcanvas');if(this.options.closeOnClick){this.$exiter.addClass('is-visible');}if(trigger){this.$lastTrigger=trigger.attr('aria-expanded','true');}if(this.options.autoFocus){this.$element.one(Foundation.transitionend(this.$element),function(){_this.$element.find('a, button').eq(0).focus();});}if(this.options.trapFocus){$('[data-off-canvas-content]').attr('tabindex','-1');this._trapFocus();}} /** 1375 * Traps focus within the offcanvas on open. 1376 * @private 1377 */},{key:'_trapFocus',value:function _trapFocus(){var focusable=Foundation.Keyboard.findFocusable(this.$element),first=focusable.eq(0),last=focusable.eq(-1);focusable.off('.zf.offcanvas').on('keydown.zf.offcanvas',function(e){if(e.which===9||e.keycode===9){if(e.target===last[0]&&!e.shiftKey){e.preventDefault();first.focus();}if(e.target===first[0]&&e.shiftKey){e.preventDefault();last.focus();}}});} /** 1378 * Allows the offcanvas to appear sticky utilizing translate properties. 1379 * @private 1380 */ // OffCanvas.prototype._stick = function() { 1381// var elStyle = this.$element[0].style; 1382// 1383// if (this.options.closeOnClick) { 1384// var exitStyle = this.$exiter[0].style; 1385// } 1386// 1387// $(window).on('scroll.zf.offcanvas', function(e) { 1388// console.log(e); 1389// var pageY = window.pageYOffset; 1390// elStyle.transform = 'translate(0,' + pageY + 'px)'; 1391// if (exitStyle !== undefined) { exitStyle.transform = 'translate(0,' + pageY + 'px)'; } 1392// }); 1393// // this.$element.trigger('stuck.zf.offcanvas'); 1394// }; 1395/** 1396 * Closes the off-canvas menu. 1397 * @function 1398 * @param {Function} cb - optional cb to fire after closure. 1399 * @fires OffCanvas#closed 1400 */},{key:'close',value:function close(cb){if(!this.$element.hasClass('is-open')||this.isRevealed){return;}var _this=this; // Foundation.Move(this.options.transitionTime, this.$element, function() { 1401$('[data-off-canvas-wrapper]').removeClass('is-off-canvas-open is-open-'+_this.options.position);_this.$element.removeClass('is-open'); // Foundation._reflow(); 1402// }); 1403this.$element.attr('aria-hidden','true') /** 1404 * Fires when the off-canvas menu opens. 1405 * @event OffCanvas#closed 1406 */.trigger('closed.zf.offcanvas'); // if (_this.options.isSticky || !_this.options.forceTop) { 1407// setTimeout(function() { 1408// _this.$element[0].style.transform = ''; 1409// $(window).off('scroll.zf.offcanvas'); 1410// }, this.options.transitionTime); 1411// } 1412if(this.options.closeOnClick){this.$exiter.removeClass('is-visible');}this.$lastTrigger.attr('aria-expanded','false');if(this.options.trapFocus){$('[data-off-canvas-content]').removeAttr('tabindex');}} /** 1413 * Toggles the off-canvas menu open or closed. 1414 * @function 1415 * @param {Object} event - Event object passed from listener. 1416 * @param {jQuery} trigger - element that triggered the off-canvas to open. 1417 */},{key:'toggle',value:function toggle(event,trigger){if(this.$element.hasClass('is-open')){this.close(event,trigger);}else {this.open(event,trigger);}} /** 1418 * 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. 1419 * @function 1420 * @private 1421 */},{key:'_handleKeyboard',value:function _handleKeyboard(event){if(event.which!==27)return;event.stopPropagation();event.preventDefault();this.close();this.$lastTrigger.focus();} /** 1422 * Destroys the offcanvas plugin. 1423 * @function 1424 */},{key:'destroy',value:function destroy(){this.close();this.$element.off('.zf.trigger .zf.offcanvas');this.$exiter.off('.zf.offcanvas');Foundation.unregisterPlugin(this);}}]);return OffCanvas;}();OffCanvas.defaults={ /** 1425 * Allow the user to click outside of the menu to close it. 1426 * @option 1427 * @example true 1428 */closeOnClick:true, /** 1429 * Amount of time in ms the open and close transition requires. If none selected, pulls from body style. 1430 * @option 1431 * @example 500 1432 */transitionTime:0, /** 1433 * Direction the offcanvas opens from. Determines class applied to body. 1434 * @option 1435 * @example left 1436 */position:'left', /** 1437 * Force the page to scroll to top on open. 1438 * @option 1439 * @example true 1440 */forceTop:true, /** 1441 * Allow the offcanvas to remain open for certain breakpoints. 1442 * @option 1443 * @example false 1444 */isRevealed:false, /** 1445 * Breakpoint at which to reveal. JS will use a RegExp to target standard classes, if changing classnames, pass your class with the `revealClass` option. 1446 * @option 1447 * @example reveal-for-large 1448 */revealOn:null, /** 1449 * Force focus to the offcanvas on open. If true, will focus the opening trigger on close. 1450 * @option 1451 * @example true 1452 */autoFocus:true, /** 1453 * Class used to force an offcanvas to remain open. Foundation defaults for this are `reveal-for-large` & `reveal-for-medium`. 1454 * @option 1455 * TODO improve the regex testing for this. 1456 * @example reveal-for-large 1457 */revealClass:'reveal-for-', /** 1458 * Triggers optional focus trapping when opening an offcanvas. Sets tabindex of [data-off-canvas-content] to -1 for accessibility purposes. 1459 * @option 1460 * @example true 1461 */trapFocus:false}; // Window exports 1462Foundation.plugin(OffCanvas,'OffCanvas');}(jQuery); 1463'use strict';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value" in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}!function($){ /** 1464 * Orbit module. 1465 * @module foundation.orbit 1466 * @requires foundation.util.keyboard 1467 * @requires foundation.util.motion 1468 * @requires foundation.util.timerAndImageLoader 1469 * @requires foundation.util.touch 1470 */var Orbit=function(){ /** 1471 * Creates a new instance of an orbit carousel. 1472 * @class 1473 * @param {jQuery} element - jQuery object to make into an Orbit Carousel. 1474 * @param {Object} options - Overrides to the default plugin settings. 1475 */function Orbit(element,options){_classCallCheck(this,Orbit);this.$element=element;this.options=$.extend({},Orbit.defaults,this.$element.data(),options);this._init();Foundation.registerPlugin(this,'Orbit');Foundation.Keyboard.register('Orbit',{'ltr':{'ARROW_RIGHT':'next','ARROW_LEFT':'previous'},'rtl':{'ARROW_LEFT':'next','ARROW_RIGHT':'previous'}});} /** 1476 * Initializes the plugin by creating jQuery collections, setting attributes, and starting the animation. 1477 * @function 1478 * @private 1479 */_createClass(Orbit,[{key:'_init',value:function _init(){this.$wrapper=this.$element.find('.'+this.options.containerClass);this.$slides=this.$element.find('.'+this.options.slideClass);var $images=this.$element.find('img'),initActive=this.$slides.filter('.is-active');if(!initActive.length){this.$slides.eq(0).addClass('is-active');}if(!this.options.useMUI){this.$slides.addClass('no-motionui');}if($images.length){Foundation.onImagesLoaded($images,this._prepareForOrbit.bind(this));}else {this._prepareForOrbit(); //hehe 1480}if(this.options.bullets){this._loadBullets();}this._events();if(this.options.autoPlay&&this.$slides.length>1){this.geoSync();}if(this.options.accessible){ // allow wrapper to be focusable to enable arrow navigation 1481this.$wrapper.attr('tabindex',0);}} /** 1482 * Creates a jQuery collection of bullets, if they are being used. 1483 * @function 1484 * @private 1485 */},{key:'_loadBullets',value:function _loadBullets(){this.$bullets=this.$element.find('.'+this.options.boxOfBullets).find('button');} /** 1486 * Sets a `timer` object on the orbit, and starts the counter for the next slide. 1487 * @function 1488 */},{key:'geoSync',value:function geoSync(){var _this=this;this.timer=new Foundation.Timer(this.$element,{duration:this.options.timerDelay,infinite:false},function(){_this.changeSlide(true);});this.timer.start();} /** 1489 * Sets wrapper and slide heights for the orbit. 1490 * @function 1491 * @private 1492 */},{key:'_prepareForOrbit',value:function _prepareForOrbit(){var _this=this;this._setWrapperHeight(function(max){_this._setSlideHeight(max);});} /** 1493 * Calulates the height of each slide in the collection, and uses the tallest one for the wrapper height. 1494 * @function 1495 * @private 1496 * @param {Function} cb - a callback function to fire when complete. 1497 */},{key:'_setWrapperHeight',value:function _setWrapperHeight(cb){ //rewrite this to `for` loop 1498var max=0,temp,counter=0;this.$slides.each(function(){temp=this.getBoundingClientRect().height;
vendor: 14,183 bytes, lines 1498-1675
1498$(this).attr('data-slide',counter);if(counter){ //if not the first slide, set css position and display property 1499$(this).css({'position':'relative','display':'none'});}max=temp>max?temp:max;counter++;});if(counter===this.$slides.length){this.$wrapper.css({'height':max}); //only change the wrapper height property once. 1500cb(max); //fire callback with max height dimension. 1501}} /** 1502 * Sets the max-height of each slide. 1503 * @function 1504 * @private 1505 */},{key:'_setSlideHeight',value:function _setSlideHeight(height){this.$slides.each(function(){$(this).css('max-height',height);});} /** 1506 * Adds event listeners to basically everything within the element. 1507 * @function 1508 * @private 1509 */},{key:'_events',value:function _events(){var _this=this; //*************************************** 1510//**Now using custom event - thanks to:** 1511//** Yohai Ararat of Toronto ** 1512//*************************************** 1513if(this.$slides.length>1){if(this.options.swipe){this.$slides.off('swipeleft.zf.orbit swiperight.zf.orbit').on('swipeleft.zf.orbit',function(e){e.preventDefault();_this.changeSlide(true);}).on('swiperight.zf.orbit',function(e){e.preventDefault();_this.changeSlide(false);});} //*************************************** 1514if(this.options.autoPlay){this.$slides.on('click.zf.orbit',function(){_this.$element.data('clickedOn',_this.$element.data('clickedOn')?false:true);_this.timer[_this.$element.data('clickedOn')?'pause':'start']();});if(this.options.pauseOnHover){this.$element.on('mouseenter.zf.orbit',function(){_this.timer.pause();}).on('mouseleave.zf.orbit',function(){if(!_this.$element.data('clickedOn')){_this.timer.start();}});}}if(this.options.navButtons){var $controls=this.$element.find('.'+this.options.nextClass+', .'+this.options.prevClass);$controls.attr('tabindex',0) //also need to handle enter/return and spacebar key presses 1515.on('click.zf.orbit touchend.zf.orbit',function(){_this.changeSlide($(this).hasClass(_this.options.nextClass));});}if(this.options.bullets){this.$bullets.on('click.zf.orbit touchend.zf.orbit',function(){if(/is-active/g.test(this.className)){return false;} //if this is active, kick out of function. 1516var idx=$(this).data('slide'),ltr=idx>_this.$slides.filter('.is-active').data('slide'),$slide=_this.$slides.eq(idx);_this.changeSlide(ltr,$slide,idx);});}this.$wrapper.add(this.$bullets).on('keydown.zf.orbit',function(e){ // handle keyboard event with keyboard util 1517Foundation.Keyboard.handleKey(e,'Orbit',{next:function next(){_this.changeSlide(true);},previous:function previous(){_this.changeSlide(false);},handled:function handled(){ // if bullet is focused, make sure focus moves 1518if($(e.target).is(_this.$bullets)){_this.$bullets.filter('.is-active').focus();}}});});}} /** 1519 * Changes the current slide to a new one. 1520 * @function 1521 * @param {Boolean} isLTR - flag if the slide should move left to right. 1522 * @param {jQuery} chosenSlide - the jQuery element of the slide to show next, if one is selected. 1523 * @param {Number} idx - the index of the new slide in its collection, if one chosen. 1524 * @fires Orbit#slidechange 1525 */},{key:'changeSlide',value:function changeSlide(isLTR,chosenSlide,idx){var $curSlide=this.$slides.filter('.is-active').eq(0);if(/mui/g.test($curSlide[0].className)){return false;} //if the slide is currently animating, kick out of the function 1526var $firstSlide=this.$slides.first(),$lastSlide=this.$slides.last(),dirIn=isLTR?'Right':'Left',dirOut=isLTR?'Left':'Right',_this=this,$newSlide;if(!chosenSlide){ //most of the time, this will be auto played or clicked from the navButtons. 1527$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!!!!! 1528this.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 1529this.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 1530}else {$newSlide=chosenSlide;}if($newSlide.length){if(this.options.bullets){idx=idx||this.$slides.index($newSlide); //grab index to update bullets 1531this._updateBullets(idx);}if(this.options.useMUI){Foundation.Motion.animateIn($newSlide.addClass('is-active').css({'position':'absolute','top':0}),this.options['animInFrom'+dirIn],function(){$newSlide.css({'position':'relative','display':'block'}).attr('aria-live','polite');});Foundation.Motion.animateOut($curSlide.removeClass('is-active'),this.options['animOutTo'+dirOut],function(){$curSlide.removeAttr('aria-live');if(_this.options.autoPlay&&!_this.timer.isPaused){_this.timer.restart();} //do stuff? 1532});}else {$curSlide.removeClass('is-active is-in').removeAttr('aria-live').hide();$newSlide.addClass('is-active is-in').attr('aria-live','polite').show();if(this.options.autoPlay&&!this.timer.isPaused){this.timer.restart();}} /** 1533 * Triggers when the slide has finished animating in. 1534 * @event Orbit#slidechange 1535 */this.$element.trigger('slidechange.zf.orbit',[$newSlide]);}} /** 1536 * Updates the active state of the bullets, if displayed. 1537 * @function 1538 * @private 1539 * @param {Number} idx - the index of the current slide. 1540 */},{key:'_updateBullets',value:function _updateBullets(idx){var $oldBullet=this.$element.find('.'+this.options.boxOfBullets).find('.is-active').removeClass('is-active').blur(),span=$oldBullet.find('span:last').detach(),$newBullet=this.$bullets.eq(idx).addClass('is-active').append(span);} /** 1541 * Destroys the carousel and hides the element. 1542 * @function 1543 */},{key:'destroy',value:function destroy(){this.$element.off('.zf.orbit').find('*').off('.zf.orbit').end().hide();Foundation.unregisterPlugin(this);}}]);return Orbit;}();Orbit.defaults={ /** 1544 * Tells the JS to look for and loadBullets. 1545 * @option 1546 * @example true 1547 */bullets:true, /** 1548 * Tells the JS to apply event listeners to nav buttons 1549 * @option 1550 * @example true 1551 */navButtons:true, /** 1552 * motion-ui animation class to apply 1553 * @option 1554 * @example 'slide-in-right' 1555 */animInFromRight:'slide-in-right', /** 1556 * motion-ui animation class to apply 1557 * @option 1558 * @example 'slide-out-right' 1559 */animOutToRight:'slide-out-right', /** 1560 * motion-ui animation class to apply 1561 * @option 1562 * @example 'slide-in-left' 1563 * 1564 */animInFromLeft:'slide-in-left', /** 1565 * motion-ui animation class to apply 1566 * @option 1567 * @example 'slide-out-left' 1568 */animOutToLeft:'slide-out-left', /** 1569 * Allows Orbit to automatically animate on page load. 1570 * @option 1571 * @example true 1572 */autoPlay:true, /** 1573 * Amount of time, in ms, between slide transitions 1574 * @option 1575 * @example 5000 1576 */timerDelay:5000, /** 1577 * Allows Orbit to infinitely loop through the slides 1578 * @option 1579 * @example true 1580 */infiniteWrap:true, /** 1581 * Allows the Orbit slides to bind to swipe events for mobile, requires an additional util library 1582 * @option 1583 * @example true 1584 */swipe:true, /** 1585 * Allows the timing function to pause animation on hover. 1586 * @option 1587 * @example true 1588 */pauseOnHover:true, /** 1589 * Allows Orbit to bind keyboard events to the slider, to animate frames with arrow keys 1590 * @option 1591 * @example true 1592 */accessible:true, /** 1593 * Class applied to the container of Orbit 1594 * @option 1595 * @example 'orbit-container' 1596 */containerClass:'orbit-container', /** 1597 * Class applied to individual slides. 1598 * @option 1599 * @example 'orbit-slide' 1600 */slideClass:'orbit-slide', /** 1601 * Class applied to the bullet container. You're welcome. 1602 * @option 1603 * @example 'orbit-bullets' 1604 */boxOfBullets:'orbit-bullets', /** 1605 * Class applied to the `next` navigation button. 1606 * @option 1607 * @example 'orbit-next' 1608 */nextClass:'orbit-next', /** 1609 * Class applied to the `previous` navigation button. 1610 * @option 1611 * @example 'orbit-previous' 1612 */prevClass:'orbit-previous', /** 1613 * Boolean to flag the js to use motion ui classes or not. Default to true for backwards compatability. 1614 * @option 1615 * @example true 1616 */useMUI:true}; // Window exports 1617Foundation.plugin(Orbit,'Orbit');}(jQuery); 1618'use strict';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value" in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}!function($){ /** 1619 * ResponsiveMenu module. 1620 * @module foundation.responsiveMenu 1621 * @requires foundation.util.triggers 1622 * @requires foundation.util.mediaQuery 1623 * @requires foundation.util.accordionMenu 1624 * @requires foundation.util.drilldown 1625 * @requires foundation.util.dropdown-menu 1626 */var ResponsiveMenu=function(){ /** 1627 * Creates a new instance of a responsive menu. 1628 * @class 1629 * @fires ResponsiveMenu#init 1630 * @param {jQuery} element - jQuery object to make into a dropdown menu. 1631 * @param {Object} options - Overrides to the default plugin settings. 1632 */function ResponsiveMenu(element,options){_classCallCheck(this,ResponsiveMenu);this.$element=$(element);this.rules=this.$element.data('responsive-menu');this.currentMq=null;this.currentPlugin=null;this._init();this._events();Foundation.registerPlugin(this,'ResponsiveMenu');} /** 1633 * Initializes the Menu by parsing the classes from the 'data-ResponsiveMenu' attribute on the element. 1634 * @function 1635 * @private 1636 */_createClass(ResponsiveMenu,[{key:'_init',value:function _init(){var rulesTree={}; // Parse rules from "classes" in data attribute 1637var rules=this.rules.split(' '); // Iterate through every rule found 1638for(var i=0;i<rules.length;i++){var rule=rules[i].split('-');var ruleSize=rule.length>1?rule[0]:'small';var rulePlugin=rule.length>1?rule[1]:rule[0];if(MenuPlugins[rulePlugin]!==null){rulesTree[ruleSize]=MenuPlugins[rulePlugin];}}this.rules=rulesTree;if(!$.isEmptyObject(rulesTree)){this._checkMediaQueries();}} /** 1639 * Initializes events for the Menu. 1640 * @function 1641 * @private 1642 */},{key:'_events',value:function _events(){var _this=this;$(window).on('changed.zf.mediaquery',function(){_this._checkMediaQueries();}); // $(window).on('resize.zf.ResponsiveMenu', function() { 1643// _this._checkMediaQueries(); 1644// }); 1645} /** 1646 * 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. 1647 * @function 1648 * @private 1649 */},{key:'_checkMediaQueries',value:function _checkMediaQueries(){var matchedMq,_this=this; // Iterate through each rule and find the last matching rule 1650$.each(this.rules,function(key){if(Foundation.MediaQuery.atLeast(key)){matchedMq=key;}}); // No match? No dice 1651if(!matchedMq)return; // Plugin already initialized? We good 1652if(this.currentPlugin instanceof this.rules[matchedMq].plugin)return; // Remove existing plugin-specific CSS classes 1653$.each(MenuPlugins,function(key,value){_this.$element.removeClass(value.cssClass);}); // Add the CSS class for the new plugin 1654this.$element.addClass(this.rules[matchedMq].cssClass); // Create an instance of the new plugin 1655if(this.currentPlugin)this.currentPlugin.destroy();this.currentPlugin=new this.rules[matchedMq].plugin(this.$element,{});} /** 1656 * Destroys the instance of the current plugin on this element, as well as the window resize handler that switches the plugins out. 1657 * @function 1658 */},{key:'destroy',value:function destroy(){this.currentPlugin.destroy();$(window).off('.zf.ResponsiveMenu');Foundation.unregisterPlugin(this);}}]);return ResponsiveMenu;}();ResponsiveMenu.defaults={}; // The plugin matches the plugin classes with these plugin instances. 1659var MenuPlugins={dropdown:{cssClass:'dropdown',plugin:Foundation._plugins['dropdown-menu']||null},drilldown:{cssClass:'drilldown',plugin:Foundation._plugins['drilldown']||null},accordion:{cssClass:'accordion-menu',plugin:Foundation._plugins['accordion-menu']||null}}; // Window exports 1660Foundation.plugin(ResponsiveMenu,'ResponsiveMenu');}(jQuery); 1661'use strict';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value" in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}!function($){ /** 1662 * ResponsiveToggle module. 1663 * @module foundation.responsiveToggle 1664 * @requires foundation.util.mediaQuery 1665 */var ResponsiveToggle=function(){ /** 1666 * Creates a new instance of Tab Bar. 1667 * @class 1668 * @fires ResponsiveToggle#init 1669 * @param {jQuery} element - jQuery object to attach tab bar functionality to. 1670 * @param {Object} options - Overrides to the default plugin settings. 1671 */function ResponsiveToggle(element,options){_classCallCheck(this,ResponsiveToggle);this.$element=$(element);this.options=$.extend({},ResponsiveToggle.defaults,this.$element.data(),options);this._init();this._events();Foundation.registerPlugin(this,'ResponsiveToggle');} /** 1672 * Initializes the tab bar by finding the target element, toggling element, and running update(). 1673 * @function 1674 * @private 1675 */_createClass(ResponsiveToggle,[{key:'_init',value:function _init(){var targetID=this.$element.data('responsive-toggle');
1675if(!targetID){console.error('Your tab bar needs an ID of a Menu as the value of data-tab-bar.');}this.$targetMenu=$('#'+targetID);this.$toggler=this.$element.find('[data-toggle]');this._update();} /** 1676 * Adds necessary event handlers for the tab bar to work. 1677 * @function 1678 * @private 1679 */},{key:'_events',value:function _events(){var _this=this;$(window).on('changed.zf.mediaquery',this._update.bind(this));this.$toggler.on('click.zf.responsiveToggle',this.toggleMenu.bind(this));} /** 1680 * Checks the current media query to determine if the tab bar should be visible or hidden. 1681 * @function 1682 * @private 1683 */},{key:'_update',value:function _update(){ // Mobile 1684if(!Foundation.MediaQuery.atLeast(this.options.hideFor)){this.$element.show();this.$targetMenu.hide();} // Desktop 1685else {this.$element.hide();this.$targetMenu.show();}} /** 1686 * Toggles the element attached to the tab bar. The toggle only happens if the screen is small enough to allow it. 1687 * @function 1688 * @fires ResponsiveToggle#toggled 1689 */},{key:'toggleMenu',value:function toggleMenu(){if(!Foundation.MediaQuery.atLeast(this.options.hideFor)){this.$targetMenu.toggle(0); /** 1690 * Fires when the element attached to the tab bar toggles. 1691 * @event ResponsiveToggle#toggled 1692 */this.$element.trigger('toggled.zf.responsiveToggle');}}},{key:'destroy',value:function destroy(){ //TODO this... 1693}}]);return ResponsiveToggle;}();ResponsiveToggle.defaults={ /** 1694 * The breakpoint after which the menu is always shown, and the tab bar is hidden. 1695 * @option 1696 * @example 'medium' 1697 */hideFor:'medium'}; // Window exports 1698Foundation.plugin(ResponsiveToggle,'ResponsiveToggle');}(jQuery); 1699'use strict';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value" in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}!function($){ /** 1700 * Reveal module. 1701 * @module foundation.reveal 1702 * @requires foundation.util.keyboard 1703 * @requires foundation.util.box 1704 * @requires foundation.util.triggers 1705 * @requires foundation.util.mediaQuery 1706 * @requires foundation.util.motion if using animations 1707 */var Reveal=function(){ /** 1708 * Creates a new instance of Reveal. 1709 * @class 1710 * @param {jQuery} element - jQuery object to use for the modal. 1711 * @param {Object} options - optional parameters. 1712 */function Reveal(element,options){_classCallCheck(this,Reveal);this.$element=element;this.options=$.extend({},Reveal.defaults,this.$element.data(),options);this._init();Foundation.registerPlugin(this,'Reveal');Foundation.Keyboard.register('Reveal',{'ENTER':'open','SPACE':'open','ESCAPE':'close','TAB':'tab_forward','SHIFT_TAB':'tab_backward'});} /** 1713 * Initializes the modal by adding the overlay and close buttons, (if selected). 1714 * @private 1715 */_createClass(Reveal,[{key:'_init',value:function _init(){this.id=this.$element.attr('id');this.isActive=false;this.cached={mq:Foundation.MediaQuery.current};this.isiOS=iPhoneSniff();if(this.isiOS){this.$element.addClass('is-ios');}this.$anchor=$('[data-open="'+this.id+'"]').length?$('[data-open="'+this.id+'"]'):$('[data-toggle="'+this.id+'"]');if(this.$anchor.length){var anchorId=this.$anchor[0].id||Foundation.GetYoDigits(6,'reveal');this.$anchor.attr({'aria-controls':this.id,'id':anchorId,'aria-haspopup':true,'tabindex':0});this.$element.attr({'aria-labelledby':anchorId});}if(this.options.fullScreen||this.$element.hasClass('full')){this.options.fullScreen=true;this.options.overlay=false;}if(this.options.overlay&&!this.$overlay){this.$overlay=this._makeOverlay(this.id);}this.$element.attr({'role':'dialog','aria-hidden':true,'data-yeti-box':this.id,'data-resize':this.id});if(this.$overlay){this.$element.detach().appendTo(this.$overlay);}else {this.$element.detach().appendTo($('body'));this.$element.addClass('without-overlay');}this._events();
1715if(this.options.deepLink&&window.location.hash==='#'+this.id){$(window).one('load.zf.reveal',this.open.bind(this));}} /** 1716 * Creates an overlay div to display behind the modal. 1717 * @private 1718 */},{key:'_makeOverlay',value:function _makeOverlay(id){var $overlay=$('<div></div>').addClass('reveal-overlay').attr({'tabindex':-1,'aria-hidden':true}).appendTo('body');return $overlay;} /** 1719 * Updates position of modal 1720 * TODO: Figure out if we actually need to cache these values or if it doesn't matter 1721 * @private 1722 */},{key:'_updatePosition',value:function _updatePosition(){var width=this.$element.outerWidth();var outerWidth=$(window).width();var height=this.$element.outerHeight();var outerHeight=$(window).height();var left=parseInt((outerWidth-width)/2,10);var top;if(height>outerHeight){top=parseInt(Math.min(100,outerHeight/10),10);}else {top=parseInt((outerHeight-height)/4,10);}this.$element.css({top:top+'px'}); // only worry about left if we don't have an overlay, otherwise we're perfectly in the middle 1723if(!this.$overlay){this.$element.css({left:left+'px'});}} /** 1724 * Adds event handlers for the modal. 1725 * @private 1726 */},{key:'_events',value:function _events(){var _this=this;this.$element.on({'open.zf.trigger':this.open.bind(this),'close.zf.trigger':this.close.bind(this),'toggle.zf.trigger':this.toggle.bind(this),'resizeme.zf.trigger':function resizemeZfTrigger(){_this._updatePosition();}});if(this.$anchor.length){this.$anchor.on('keydown.zf.reveal',function(e){if(e.which===13||e.which===32){e.stopPropagation();e.preventDefault();_this.open();}});}if(this.options.closeOnClick&&this.options.overlay){this.$overlay.off('.zf.reveal').on('click.zf.reveal',function(e){if(e.target===_this.$element[0]||$.contains(_this.$element[0],e.target)){return;}_this.close();});}if(this.options.deepLink){$(window).on('popstate.zf.reveal:'+this.id,this._handleState.bind(this));}} /** 1727 * Handles modal methods on back/forward button clicks or any other event that triggers popstate. 1728 * @private 1729 */},{key:'_handleState',value:function _handleState(e){if(window.location.hash==='#'+this.id&&!this.isActive){this.open();}else {this.close();}} /** 1730 * Opens the modal controlled by `this.$anchor`, and closes all others by default. 1731 * @function 1732 * @fires Reveal#closeme 1733 * @fires Reveal#open 1734 */},{key:'open',value:function open(){var _this2=this;if(this.options.deepLink){var hash='#'+this.id;if(window.history.pushState){window.history.pushState(null,null,hash);}else {window.location.hash=hash;}}this.isActive=true; // Make elements invisible, but remove display: none so we can get size and positioning 1735this.$element.css({'visibility':'hidden'}).show().scrollTop(0);if(this.options.overlay){this.$overlay.css({'visibility':'hidden'}).show();}this._updatePosition();this.$element.hide().css({'visibility':''});if(this.$overlay){this.$overlay.css({'visibility':''}).hide();}if(!this.options.multipleOpened){ /** 1736 * Fires immediately before the modal opens. 1737 * Closes any other modals that are currently open 1738 * @event Reveal#closeme 1739 */this.$element.trigger('closeme.zf.reveal',this.id);} // Motion UI method of reveal 1740if(this.options.animationIn){if(this.options.overlay){Foundation.Motion.animateIn(this.$overlay,'fade-in');}Foundation.Motion.animateIn(this.$element,this.options.animationIn,function(){this.focusableElements=Foundation.Keyboard.findFocusable(this.$element);});} // jQuery method of reveal 1741else {if(this.options.overlay){this.$overlay.show(0);}this.$element.show(this.options.showDelay);} // handle accessibility 1742this.$element.attr({'aria-hidden':false,'tabindex':-1}).focus(); /** 1743 * Fires when the modal has successfully opened. 1744 * @event Reveal#open 1745 */this.$element.trigger('open.zf.reveal');if(this.isiOS){var scrollPos=window.pageYOffset;$('html, body').addClass('is-reveal-open').scrollTop(scrollPos);}else {$('body').addClass('is-reveal-open');}$('body').addClass('is-reveal-open').attr('aria-hidden',this.options.overlay||this.options.fullScreen?true:false);setTimeout(function(){_this2._extraHandlers();}
1745,0);} /** 1746 * Adds extra event handlers for the body and window if necessary. 1747 * @private 1748 */},{key:'_extraHandlers',value:function _extraHandlers(){var _this=this;this.focusableElements=Foundation.Keyboard.findFocusable(this.$element);if(!this.options.overlay&&this.options.closeOnClick&&!this.options.fullScreen){$('body').on('click.zf.reveal',function(e){if(e.target===_this.$element[0]||$.contains(_this.$element[0],e.target)){return;}_this.close();});}if(this.options.closeOnEsc){$(window).on('keydown.zf.reveal',function(e){Foundation.Keyboard.handleKey(e,'Reveal',{close:function close(){if(_this.options.closeOnEsc){_this.close();_this.$anchor.focus();}}});if(_this.focusableElements.length===0){ // no focusable elements inside the modal at all, prevent tabbing in general 1749e.preventDefault();}});} // lock focus within modal while tabbing 1750this.$element.on('keydown.zf.reveal',function(e){var $target=$(this); // handle keyboard event with keyboard util 1751Foundation.Keyboard.handleKey(e,'Reveal',{tab_forward:function tab_forward(){if(_this.$element.find(':focus').is(_this.focusableElements.eq(-1))){ // left modal downwards, setting focus to first element 1752_this.focusableElements.eq(0).focus();e.preventDefault();}},tab_backward:function tab_backward(){if(_this.$element.find(':focus').is(_this.focusableElements.eq(0))||_this.$element.is(':focus')){ // left modal upwards, setting focus to last element 1753_this.focusableElements.eq(-1).focus();e.preventDefault();}},open:function open(){if(_this.$element.find(':focus').is(_this.$element.find('[data-close]'))){setTimeout(function(){ // set focus back to anchor if close button has been activated 1754_this.$anchor.focus();},1);}else if($target.is(_this.focusableElements)){ // dont't trigger if acual element has focus (i.e. inputs, links, ...) 1755_this.open();}},close:function close(){if(_this.options.closeOnEsc){_this.close();_this.$anchor.focus();}}});});} /** 1756 * Closes the modal. 1757 * @function 1758 * @fires Reveal#closed 1759 */},{key:'close',value:function close(){if(!this.isActive||!this.$element.is(':visible')){return false;}var _this=this; // Motion UI method of hiding 1760if(this.options.animationOut){if(this.options.overlay){Foundation.Motion.animateOut(this.$overlay,'fade-out',finishUp);}else {finishUp();}Foundation.Motion.animateOut(this.$element,this.options.animationOut);} // jQuery method of hiding 1761else {if(this.options.overlay){this.$overlay.hide(0,finishUp);}else {finishUp();}this.$element.hide(this.options.hideDelay);} // Conditionals to remove extra event listeners added on open 1762if(this.options.closeOnEsc){$(window).off('keydown.zf.reveal');}if(!this.options.overlay&&this.options.closeOnClick){$('body').off('click.zf.reveal');}this.$element.off('keydown.zf.reveal');function finishUp(){if(_this.isiOS){$('html, body').removeClass('is-reveal-open');}else {$('body').removeClass('is-reveal-open');}$('body').attr({'aria-hidden':false,'tabindex':''});_this.$element.attr('aria-hidden',true); /** 1763 * Fires when the modal is done closing. 1764 * @event Reveal#closed 1765 */_this.$element.trigger('closed.zf.reveal');} /** 1766 * Resets the modal content 1767 * This prevents a running video to keep going in the background 1768 */if(this.options.resetOnClose){this.$element.html(this.$element.html());}this.isActive=false;if(_this.options.deepLink){if(window.history.replaceState){window.history.replaceState("",document.title,window.location.pathname);}else {window.location.hash='';}}} /** 1769 * Toggles the open/closed state of a modal. 1770 * @function 1771 */},{key:'toggle',value:function toggle(){if(this.isActive){this.close();}else {this.open();}}},{key:'destroy', /** 1772 * Destroys an instance of a modal. 1773 * @function 1774 */value:function destroy(){if(this.options.overlay){this.$overlay.hide().off().remove();}this.$element.hide().off();this.$anchor.off('.zf');$(window).off('.zf.reveal:'+this.id);Foundation.unregisterPlugin(this);}}]);return Reveal;}();Reveal.defaults={ /** 1775 * Motion-UI class to use for animated elements. If none used, defaults to simple show/hide. 1776 * @option 1777 * @example 'slide-in-left' 1778 */animationIn:'', /** 1779 * Motion-UI class to use for animated elements. If none used, defaults to simple show/hide. 1780 * @option 1781 * @example 'slide-out-right' 1782 */animationOut:'', /** 1783 * Time, in ms, to delay the opening of a modal after a click if no animation used. 1784 * @option 1785 * @example 10 1786 */showDelay:0, /** 1787 * Time, in ms, to delay the closing of a modal after a click if no animation used. 1788 * @option 1789 * @example 10 1790 */hideDelay:0, /** 1791 * Allows a click on the body/overlay to close the modal. 1792 * @option 1793 * @example true 1794 */closeOnClick:true, /** 1795 * Allows the modal to close if the user presses the `ESCAPE` key. 1796 * @option 1797 * @example true 1798 */closeOnEsc:true, /** 1799 * If true, allows multiple modals to be displayed at once. 1800 * @option 1801 * @example false 1802 */multipleOpened:false, /** 1803 * Distance, in pixels, the modal should push down from the top of the screen. 1804 * @option 1805 * @example 100 1806 */vOffset:100, /** 1807 * Distance, in pixels, the modal should push in from the side of the screen. 1808 * @option 1809 * @example 0 1810 */hOffset:0, /** 1811 * Allows the modal to be fullscreen, completely blocking out the rest of the view. JS checks for this as well. 1812 * @option 1813 * @example false 1814 */fullScreen:false, /** 1815 * Percentage of screen height the modal should push up from the bottom of the view. 1816 * @option 1817 * @example 10 1818 */btmOffsetPct:10, /** 1819 * Allows the modal to generate an overlay div, which will cover the view when modal opens. 1820 * @option 1821 * @example true 1822 */overlay:true, /** 1823 * 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. 1824 * @option 1825 * @example false 1826 */resetOnClose:false, /** 1827 * Allows the modal to alter the url on open/close, and allows the use of the `back` button to close modals. ALSO, allows a modal to auto-maniacally open on page load IF the hash === the modal'
1827s user-set id. 1828 * @option 1829 * @example false 1830 */deepLink:false}; // Window exports 1831Foundation.plugin(Reveal,'Reveal');function iPhoneSniff(){return (/iP(ad|hone|od).*OS/.test(window.navigator.userAgent));}}(jQuery); 1832'use strict';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value" in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}!function($){ /** 1833 * Slider module. 1834 * @module foundation.slider 1835 * @requires foundation.util.motion 1836 * @requires foundation.util.triggers 1837 * @requires foundation.util.keyboard 1838 * @requires foundation.util.touch 1839 */var Slider=function(){ /** 1840 * Creates a new instance of a drilldown menu. 1841 * @class 1842 * @param {jQuery} element - jQuery object to make into an accordion menu. 1843 * @param {Object} options - Overrides to the default plugin settings. 1844 */function Slider(element,options){_classCallCheck(this,Slider);this.$element=element;this.options=$.extend({},Slider.defaults,this.$element.data(),options);this._init();Foundation.registerPlugin(this,'Slider');Foundation.Keyboard.register('Slider',{'ltr':{'ARROW_RIGHT':'increase','ARROW_UP':'increase','ARROW_DOWN':'decrease','ARROW_LEFT':'decrease','SHIFT_ARROW_RIGHT':'increase_fast','SHIFT_ARROW_UP':'increase_fast','SHIFT_ARROW_DOWN':'decrease_fast','SHIFT_ARROW_LEFT':'decrease_fast'},'rtl':{'ARROW_LEFT':'increase','ARROW_RIGHT':'decrease','SHIFT_ARROW_LEFT':'increase_fast','SHIFT_ARROW_RIGHT':'decrease_fast'}});} /** 1845 * Initilizes the plugin by reading/setting attributes, creating collections and setting the initial position of the handle(s). 1846 * @function 1847 * @private 1848 */_createClass(Slider,[{key:'_init',value:function _init(){this.inputs=this.$element.find('input');this.handles=this.$element.find('[data-slider-handle]');this.$handle=this.handles.eq(0);this.$input=this.inputs.length?this.inputs.eq(0):$('#'+this.$handle.attr('aria-controls'));this.$fill=this.$element.find('[data-slider-fill]').css(this.options.vertical?'height':'width',0);var isDbl=false,_this=this;if(this.options.disabled||this.$element.hasClass(this.options.disabledClass)){this.options.disabled=true;this.$element.addClass(this.options.disabledClass);}if(!this.inputs.length){this.inputs=$().add(this.$input);this.options.binding=true;}this._setInitAttr(0);this._events(this.$handle);if(this.handles[1]){this.options.doubleSided=true;this.$handle2=this.handles.eq(1);this.$input2=this.inputs.length>1?this.inputs.eq(1):$('#'+this.$handle2.attr('aria-controls'));if(!this.inputs[1]){this.inputs=this.inputs.add(this.$input2);}isDbl=true;this._setHandlePos(this.$handle,this.options.initialStart,true,function(){_this._setHandlePos(_this.$handle2,_this.options.initialEnd,true);}); // this.$handle.triggerHandler('click.zf.slider'); 1849this._setInitAttr(1);this._events(this.$handle2);}if(!isDbl){this._setHandlePos(this.$handle,this.options.initialStart,true);}} /** 1850 * Sets the position of the selected handle and fill bar. 1851 * @function 1852 * @private 1853 * @param {jQuery} $hndl - the selected handle to move. 1854 * @param {Number} location - floating point between the start and end values of the slider bar. 1855 * @param {Function} cb - callback function to fire on completion. 1856 * @fires Slider#moved 1857 */},{key:'_setHandlePos',value:function _setHandlePos($hndl,location,noInvert,cb){ //might need to alter that slightly for bars that will have odd number selections. 1858location=parseFloat(location); //on input change events, convert string to number...grumble. 1859// prevent slider from running out of bounds, if value exceeds the limits set through options, override the value to min/max 1860if(location<this.options.start){location=this.options.start;}else if(location>this.options.end){location=this.options.end;}var isDbl=this.options.doubleSided;
1860if(isDbl){ //this block is to prevent 2 handles from crossing eachother. Could/should be improved. 1861if(this.handles.index($hndl)===0){var h2Val=parseFloat(this.$handle2.attr('aria-valuenow'));location=location>=h2Val?h2Val-this.options.step:location;}else {var h1Val=parseFloat(this.$handle.attr('aria-valuenow'));location=location<=h1Val?h1Val+this.options.step:location;}} //this is for single-handled vertical sliders, it adjusts the value to account for the slider being "upside-down" 1862//for click and drag events, it's weird due to the scale(-1, 1) css property 1863if(this.options.vertical&&!noInvert){location=this.options.end-location;}var _this=this,vert=this.options.vertical,hOrW=vert?'height':'width',lOrT=vert?'top':'left',handleDim=$hndl[0].getBoundingClientRect()[hOrW],elemDim=this.$element[0].getBoundingClientRect()[hOrW], //percentage of bar min/max value based on click or drag point 1864pctOfBar=percent(location,this.options.end).toFixed(2), //number of actual pixels to shift the handle, based on the percentage obtained above 1865pxToMove=(elemDim-handleDim)*pctOfBar, //percentage of bar to shift the handle 1866movement=(percent(pxToMove,elemDim)*100).toFixed(this.options.decimal); //fixing the decimal value for the location number, is passed to other methods as a fixed floating-point value 1867location=parseFloat(location.toFixed(this.options.decimal)); // declare empty object for css adjustments, only used with 2 handled-sliders 1868var css={};this._setValues($hndl,location); // TODO update to calculate based on values set to respective inputs?? 1869if(isDbl){var isLeftHndl=this.handles.index($hndl)===0, //empty variable, will be used for min-height/width for fill bar 1870dim, //percentage w/h of the handle compared to the slider bar 1871handlePct=~ ~(percent(handleDim,elemDim)*100); //if left handle, the math is slightly different than if it's the right handle, and the left/top property needs to be changed for the fill bar 1872if(isLeftHndl){ //left or top percentage value to apply to the fill bar. 1873css[lOrT]=movement+'%'; //calculate the new min-height/width for the fill bar. 1874dim=parseFloat(this.$handle2[0].style[lOrT])-movement+handlePct; //this callback is necessary to prevent errors and allow the proper placement and initialization of a 2-handled slider 1875//plus, it means we don't care if 'dim' isNaN on init, it won't be in the future. 1876if(cb&&typeof cb==='function'){cb();} //this is only needed for the initialization of 2 handled sliders 1877}else { //just caching the value of the left/bottom handle's left/top property 1878var handlePos=parseFloat(this.$handle[0].style[lOrT]); //calculate the new min-height/width for the fill bar. Use isNaN to prevent false positives for numbers <= 0 1879//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 1880dim=movement-(isNaN(handlePos)?this.options.initialStart/((this.options.end-this.options.start)/100):handlePos)+handlePct;} // assign the min-height/width to our css object 1881css['min-'+hOrW]=dim+'%';}this.$element.one('finished.zf.animate',function(){ /** 1882 * Fires when the handle is done moving. 1883 * @event Slider#moved 1884 */_this.$element.trigger('moved.zf.slider',[$hndl]);}); //because we don't know exactly how the handle will be moved, check the amount of time it should take to move. 1885var moveTime=this.$element.data('dragging')?1000/60:this.options.moveTime;Foundation.Move(moveTime,$hndl,function(){ //adjusting the left/top property of the handle, based on the percentage calculated above 1886$hndl.css(lOrT,movement+'%');if(!_this.options.doubleSided){ //if single-handled, a simple method to expand the fill bar 1887_this.$fill.css(hOrW,pctOfBar*100+'%');}else { //otherwise, use the css object we created above 1888_this.$fill.css(css);}});} /** 1889 * Sets the initial attribute for the slider element. 1890 * @function 1891 * @private 1892 * @param {Number} idx - index of the current handle/input to use. 1893 */},{key:'_setInitAttr',value:function _setInitAttr(idx){var id=this.inputs.eq(idx).attr('id')||Foundation.GetYoDigits(6,'slider');this.inputs.eq(idx).attr({'id':id,'max':this.options.end,'min':this.options.start,'step':this.options.step});this.handles.eq(idx).attr({'role':'slider','aria-controls':id,'aria-valuemax':this.options.end,'aria-valuemin':this.options.start,'aria-valuenow':idx===0?this.options.initialStart:this.options.initialEnd,'aria-orientation':this.options.vertical?'vertical':'horizontal','tabindex':0});} /** 1894 * Sets the input and `aria-valuenow` values for the slider element. 1895 * @function 1896 * @private 1897 * @param {jQuery} $handle - the currently selected handle. 1898 * @param {Number} val - floating point of the new value. 1899 */},{key:'_setValues',value:function _setValues($handle,val){var idx=this.options.doubleSided?this.handles.index($handle):0;this.inputs.eq(idx).val(val);$handle.attr('aria-valuenow',val);} /** 1900 * Handles events on the slider element. 1901 * Calculates the new location of the current handle. 1902 * If there are two handles and the bar was clicked, it determines which handle to move. 1903 * @function 1904 * @private 1905 * @param {Object} e - the `event` object passed from the listener. 1906 * @param {jQuery} $handle - the current handle to calculate for, if selected. 1907 * @param {Number} val - floating point number for the new value of the slider. 1908 * TODO clean this up, there's a lot of repeated code between this and the _setHandlePos fn. 1909 */},{key:'_handleEvent',value:function _handleEvent(e,$handle,val){var value,hasVal;if(!val){ //click or drag events 1910e.preventDefault();var _this=this,vertical=this.options.vertical,param=vertical?'he
1910ight':'width',direction=vertical?'top':'left',pageXY=vertical?e.pageY:e.pageX,halfOfHandle=this.$handle[0].getBoundingClientRect()[param]/2,barDim=this.$element[0].getBoundingClientRect()[param],barOffset=this.$element.offset()[direction]-pageXY, //if the cursor position is less than or greater than the elements bounding coordinates, set coordinates within those bounds 1911barXY=barOffset>0?-halfOfHandle:barOffset-halfOfHandle<-barDim?barDim:Math.abs(barOffset),offsetPct=percent(barXY,barDim);value=(this.options.end-this.options.start)*offsetPct; // turn everything around for RTL, yay math! 1912if(Foundation.rtl()&&!this.options.vertical){value=this.options.end-value;}value=_this._adjustValue(null,value); //boolean flag for the setHandlePos fn, specifically for vertical sliders 1913hasVal=false;if(!$handle){ //figure out which handle it is, pass it to the next function. 1914var firstHndlPos=absPosition(this.$handle,direction,barXY,param),secndHndlPos=absPosition(this.$handle2,direction,barXY,param);$handle=firstHndlPos<=secndHndlPos?this.$handle:this.$handle2;}}else { //change event on input 1915value=this._adjustValue(null,val);hasVal=true;}this._setHandlePos($handle,value,hasVal);} /** 1916 * Adjustes value for handle in regard to step value. returns adjusted value 1917 * @function 1918 * @private 1919 * @param {jQuery} $handle - the selected handle. 1920 * @param {Number} value - value to adjust. used if $handle is falsy 1921 */},{key:'_adjustValue',value:function _adjustValue($handle,value){var val,step=this.options.step,div=parseFloat(step/2),left,prev_val,next_val;if(!!$handle){val=parseFloat($handle.attr('aria-valuenow'));}else {val=value;}left=val%step;prev_val=val-left;next_val=prev_val+step;if(left===0){return val;}val=val>=prev_val+div?next_val:prev_val;return val;} /** 1922 * Adds event listeners to the slider elements. 1923 * @function 1924 * @private 1925 * @param {jQuery} $handle - the current handle to apply listeners to. 1926 */},{key:'_events',value:function _events($handle){if(this.options.disabled){return false;}var _this=this,curHandle,timer;this.inputs.off('change.zf.slider').on('change.zf.slider',function(e){var idx=_this.inputs.index($(this));_this._handleEvent(e,_this.handles.eq(idx),$(this).val());});if(this.options.clickSelect){this.$element.off('click.zf.slider').on('click.zf.slider',function(e){if(_this.$element.data('dragging')){return false;}if(!$(e.target).is('[data-slider-handle]')){if(_this.options.doubleSided){_this._handleEvent(e);}else {_this._handleEvent(e,_this.$handle);}}});}if(this.options.draggable){this.handles.addTouch();var $body=$('body');$handle.off('mousedown.zf.slider').on('mousedown.zf.slider',function(e){$handle.addClass('is-dragging');_this.$fill.addClass('is-dragging'); // 1927_this.$element.data('dragging',true);curHandle=$(e.currentTarget);$body.on('mousemove.zf.slider',function(e){e.preventDefault();_this._handleEvent(e,curHandle);}).on('mouseup.zf.slider',function(e){_this._handleEvent(e,curHandle);$handle.removeClass('is-dragging');_this.$fill.removeClass('is-dragging');_this.$element.data('dragging',false);$body.off('mousemove.zf.slider mouseup.zf.slider');});});}$handle.off('keydown.zf.slider').on('keydown.zf.slider',function(e){var _$handle=$(this),idx=_this.options.doubleSided?_this.handles.index(_$handle):0,oldValue=parseFloat(_this.inputs.eq(idx).val()),newValue; // handle keyboard event with keyboard util 1928Foundation.Keyboard.handleKey(e,'Slider',{decrease:function decrease(){newValue=oldValue-_this.options.step;},increase:function increase(){newValue=oldValue+_this.options.step;},decrease_fast:function decrease_fast(){newValue=oldValue-_this.options.step*10;},increase_fast:function increase_fast(){newValue=oldValue+_this.options.step*10;},handled:function handled(){ // only set handle pos when event was handled specially 1929e.preventDefault();_this._setHandlePos(_$handle,newValue,true);}}); /*if (newValue) { // if pressed key has special function, update value 1930 e.preventDefault(); 1931 _this._setHandlePos(_$handle, newValue); 1932 }*/});} /** 1933 * Destroys the slider plugin. 1934 */},{key:'destroy',value:function destroy(){this.handles.off('.zf.slider');this.inputs.off('.zf.slider');this.$element.off('.zf.slider');Foundation.unregisterPlugin(this);}}]);return Slider;}();Slider.defaults={ /** 1935 * Minimum value for the slider scale. 1936 * @option 1937 * @example 0 1938 */start:0, /** 1939 * Maximum value for the slider scale. 1940 * @option 1941 * @example 100 1942 */end:100, /** 1943 * Minimum value change per change event. 1944 * @option 1945 * @example 1 1946 */step:1, /** 1947 * Value at which the handle/input *(left handle/first input)* should be set to on initialization. 1948 * @option 1949 * @example 0 1950 */initialStart:0, /** 1951 * Value at which the right handle/second input should be set to on initialization. 1952 * @option 1953 * @example 100 1954 */initialEnd:100, /** 1955 * Allows the input to be located outside the container and visible. Set to by the JS 1956 * @option 1957 * @example false 1958 */binding:false, /** 1959 * Allows the user to click/tap on the slider bar to select a value. 1960 * @option 1961 * @example true 1962 */clickSelect:true, /** 1963 * Set to true and use the `vertical` class to change alignment to vertical. 1964 * @option 1965 * @example false 1966 */vertical:false, /** 1967 * Allows the user to drag the slider handle(s) to select a value. 1968 * @option 1969 * @example true 1970 */draggable:true, /** 1971 * Disables the slider and prevents event listeners from being applied. Double checked by JS with `disabledClass`. 1972 * @option 1973 * @example false 1974 */disabled:false, /** 1975 * Allows the use of two handles. Double checked by the JS. Changes some logic handling. 1976 * @option 1977 * @example false 1978 */doubleSided:false, /** 1979 * Potential future feature. 1980 */ // steps: 100, 1981/** 1982 * Number of decimal places the plugin should go to for floating point precision. 1983 * @option 1984 * @example 2 1985 */decimal:2, /** 1986 * Time delay for dragged elements. 1987 */ // dragDelay: 0, 1988/** 1989 * 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. 1990 * @option 1991 * @example 200 1992 */moveTime:200, //update this if changing the transition time in the sass 1993/** 1994 * Class applied to disabled sliders. 1995 * @option 1996 * @example 'disabled' 1997 */disabledClass:'disabled', /** 1998 * Will invert the default layout for a vertical<span data-tooltip title="who would do this???"> </span>slider. 1999 * @option 2000 * @example false 2001 */invertVertical:false};function percent(frac,num){return frac/num;}function absPosition($handle,dir,clickPos,param){return Math.abs($handle.position()[dir]+$handle[param]()/2-clickPos);} // Window exports 2002Foundation.plugin(Slider,'Slider');}(jQuery); //*********this is in case we go to static, absolute positions instead of dynamic positioning******** 2003// this.setSteps(function() { 2004// _this._events(); 2005// var initStart = _this.options.positions[_this.options.initialStart - 1] || null; 2006// var initEnd = _this.options.initialEnd ? _this.options.position[_this.options.initialEnd - 1] : null; 2007// if (initStart || initEnd) { 2008// _this._handleEvent(initStart, initEnd); 2009// } 2010// }); 2011//***********the other part of absolute positions************* 2012// Slider.prototype.setSteps = function(cb) { 2013// var posChange = this.$element.outerWidth() / this.options.steps; 2014// var counter = 0 2015// while(counter < this.options.steps) { 2016// if (counter) { 2017// this.options.positions.push(this.options.positions[counter - 1] + posChange); 2018// } else { 2019// this.options.positions.push(posChange); 2020// } 2021// counter++; 2022// } 2023// cb(); 2024// }; 2025'use strict';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value" in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}!function($){ /** 2026 * Sticky module. 2027 * @module foundation.sticky 2028 * @requires foundation.util.triggers 2029 * @requires foundation.util.mediaQuery 2030 */var Sticky=function(){ /** 2031 * Creates a new instance of a sticky thing. 2032 * @class 2033 * @param {jQuery} element - jQuery object to make sticky. 2034 * @param {Object} options - options object passed when creating the element programmatically. 2035 */function Sticky(element,options){_classCallCheck(this,Sticky);this.$element=element;this.options=$.extend({},Sticky.defaults,this.$element.data(),options);this._init();Foundation.registerPlugin(this,'Sticky');} /** 2036 * Initializes the sticky element by adding classes, getting/setting dimensions, breakpoints and attributes 2037 * @function 2038 * @private 2039 */_createClass(Sticky,[{key:'_init',value:function _init(){var $parent=this.$element.parent('[data-sticky-container]'),id=this.$element[0].id||Foundation.GetYoDigits(6,'sticky'),_this=this;if(!$parent.length){this.wasWrapped=true;}this.$container=$parent.length?$parent:$(this.options.container).wrapInner(this.$element);this.$container.addClass(this.options.containerClass);this.$element.addClass(this.options.stickyClass).attr({'data-resize':id});this.scrollCount=this.options.checkEvery;this.isStuck=false;$(window).one('load.zf.sticky',function(){if(_this.options.anchor!==''){_this.$anchor=$('#'+_this.options.anchor);}else {_this._parsePoints();}_this._setSizes(function(){_this._calc(false);});_this._events(id.split('-').reverse().join('-'));});} /** 2040 * If using multiple elements as anchors, calculates the top and bottom pixel values the sticky thing should stick and unstick on. 2041 * @function 2042 * @private 2043 */},{key:'_parsePoints',value:function _parsePoints(){var top=this.options.topAnchor,btm=this.options.btmAnchor,pts=[top,btm],breaks={};if(top&&btm){for(var i=0,len=pts.length;i<len&&pts[i];i++){var pt;if(typeof pts[i]==='number'){pt=pts[i];}else {var place=pts[i].split(':'),anchor=$('#'+place[0]);pt=anchor.offset().top;if(place[1]&&place[1].toLowerCase()==='bottom'){pt+=anchor[0].getBoundingClientRect().height;}}breaks[i]=pt;}}else {breaks={0:1,1:document.documentElement.scrollHeight};}this.points=breaks;return;} /** 2044 * Adds event handlers for the scrolling element. 2045 * @private 2046 * @param {String} id - psuedo-random id for unique scroll event listener. 2047 */},{key:'_events',value:function _events(id){var _this=this,scrollListener=this.scrollListener='scroll.zf.'+id;if(this.isOn){return;}if(this.canStick){this.isOn=true;$(window).off(scrollListener).on(scrollListener,function(e){if(_this.scrollCount===0){_this.scrollCount=_this.options.checkEvery;_this._setSizes(function(){_this._calc(false,window.pageYOffset);});}else {_this.scrollCount--;_this._calc(false,window.pageYOffset);}});}this.$element.off('resizeme.zf.trigger').on('resizeme.zf.trigger',function(e,el){_this._setSizes(function(){_this._calc(false);
2047if(_this.canStick){if(!_this.isOn){_this._events(id);}}else if(_this.isOn){_this._pauseListeners(scrollListener);}});});} /** 2048 * Removes event handlers for scroll and change events on anchor. 2049 * @fires Sticky#pause 2050 * @param {String} scrollListener - unique, namespaced scroll listener attached to `window` 2051 */},{key:'_pauseListeners',value:function _pauseListeners(scrollListener){this.isOn=false;$(window).off(scrollListener); /** 2052 * Fires when the plugin is paused due to resize event shrinking the view. 2053 * @event Sticky#pause 2054 * @private 2055 */this.$element.trigger('pause.zf.sticky');} /** 2056 * Called on every `scroll` event and on `_init` 2057 * fires functions based on booleans and cached values 2058 * @param {Boolean} checkSizes - true if plugin should recalculate sizes and breakpoints. 2059 * @param {Number} scroll - current scroll position passed from scroll event cb function. If not passed, defaults to `window.pageYOffset`. 2060 */},{key:'_calc',value:function _calc(checkSizes,scroll){if(checkSizes){this._setSizes();}if(!this.canStick){if(this.isStuck){this._removeSticky(true);}return false;}if(!scroll){scroll=window.pageYOffset;}if(scroll>=this.topPoint){if(scroll<=this.bottomPoint){if(!this.isStuck){this._setSticky();}}else {if(this.isStuck){this._removeSticky(false);}}}else {if(this.isStuck){this._removeSticky(true);}}} /** 2061 * Causes the $element to become stuck. 2062 * Adds `position: fixed;`, and helper classes. 2063 * @fires Sticky#stuckto 2064 * @function 2065 * @private 2066 */},{key:'_setSticky',value:function _setSticky(){var stickTo=this.options.stickTo,mrgn=stickTo==='top'?'marginTop':'marginBottom',notStuckTo=stickTo==='top'?'bottom':'top',css={};css[mrgn]=this.options[mrgn]+'em';css[stickTo]=0;css[notStuckTo]='auto';css['left']=this.$container.offset().left+parseInt(window.getComputedStyle(this.$container[0])["padding-left"],10);this.isStuck=true;this.$element.removeClass('is-anchored is-at-'+notStuckTo).addClass('is-stuck is-at-'+stickTo).css(css) /** 2067 * Fires when the $element has become `position: fixed;` 2068 * Namespaced to `top` or `bottom`, e.g. `sticky.zf.stuckto:top` 2069 * @event Sticky#stuckto 2070 */.trigger('sticky.zf.stuckto:'+stickTo);} /** 2071 * Causes the $element to become unstuck. 2072 * Removes `position: fixed;`, and helper classes. 2073 * Adds other helper classes. 2074 * @param {Boolean} isTop - tells the function if the $element should anchor to the top or bottom of its $anchor element. 2075 * @fires Sticky#unstuckfrom 2076 * @private 2077 */},{key:'_removeSticky',value:function _removeSticky(isTop){var stickTo=this.options.stickTo,stickToTop=stickTo==='top',css={},anchorPt=(this.points?this.points[1]-this.points[0]:this.anchorHeight)-this.elemHeight,mrgn=stickToTop?'marginTop':'marginBottom',notStuckTo=stickToTop?'bottom':'top',topOrBottom=isTop?'top':'bottom';css[mrgn]=0;if(isTop&&!stickToTop||stickToTop&&!isTop){css[stickTo]=anchorPt;css[notStuckTo]=0;}else {css[stickTo]=0;css[notStuckTo]=anchorPt;}css['left']='';this.isStuck=false;this.$element.removeClass('is-stuck is-at-'+stickTo).addClass('is-anchored is-at-'+topOrBottom).css(css) /** 2078 * Fires when the $element has become anchored. 2079 * Namespaced to `top` or `bottom`, e.g. `sticky.zf.unstuckfrom:bottom` 2080 * @event Sticky#unstuckfrom 2081 */.trigger('sticky.zf.unstuckfrom:'+topOrBottom);} /** 2082 * Sets the $element and $container sizes for plugin. 2083 * Calls `_setBreakPoints`. 2084 * @param {Function} cb - optional callback function to fire on completion of `_setBreakPoints`. 2085 * @private 2086 */},{key:'_setSizes',value:function _setSizes(cb){this.canStick=Foundation.MediaQuery.atLeast(this.options.stickyOn);if(!this.canStick){cb();}var _this=this,newElemWidth=this.$container[0].getBoundingClientRect().width,comp=window.getComputedStyle(this.$container[0]),pdng=parseInt(comp['padding-right'],10);if(this.$anchor&&this.$anchor.length){this.anchorHeight=this.$anchor[0].getBoundingClientRect().height;}else {this._parsePoints();}this.$element.css({'max-width':newElemWidth-pdng+'px'});var newContainerHeight=this.$element[0].getBoundingClientRect().height||this.containerHeight;this.containerHeight=newContainerHeight;this.$container.css({height:newContainerHeight});this.elemHeight=newContainerHeight;if(this.isStuck){this.$element.css({"left":this.$container.offset().left+parseInt(comp['padding-left'],10)});}this._setBreakPoints(newContainerHeight,function(){if(cb){cb();}});} /** 2087 * Sets the upper and lower breakpoints for the element to become sticky/unsticky. 2088 * @param {Number} elemHeight - px value for sticky.$element height, calculated by `_setSizes`. 2089 * @param {Function} cb - optional callback function to be called on completion. 2090 * @private 2091 */},{key:'_setBreakPoints',value:function _setBreakPoints(elemHeight,cb){if(!this.canStick){if(cb){cb();}else {return false;}}var mTop=emCalc(this.options.marginTop),mBtm=emCalc(this.options.marginBottom),topPoint=this.points?this.points[0]:this.$anchor.offset().top,bottomPoint=this.points?this.points[1]:topPoint+this.anchorHeight, // topPoint = this.$anchor.offset().top || this.points[0], 2092// bottomPoint = topPoint + this.anchorHeight || this.points[1], 2093winHeight=window.innerHeight;if(this.options.stickTo==='top'){topPoint-=mTop;bottomPoint-=elemHeight+mTop;}else if(this.options.stickTo==='bottom'){topPoint-=winHeight-(elemHeight+mBtm);bottomPoint-=winHeight-mBtm;}else { //this would be the stickTo: both option... tricky 2094}this.topPoint=topPoint;this.bottomPoint=bottomPoint;if(cb){cb();}} /** 2095 * Destroys the current sticky element. 2096 * Resets the element to the top position first. 2097 * Removes event listeners, JS-added css properties and classes, and unwraps the $element if the JS added the $container. 2098 * @function 2099 */},{key:'destroy',value:function destroy(){this._removeSticky(true);this.$element.removeClass(this.options.stickyClass+' is-anchored is-at-top').css({height:'',top:'',bottom:'','max-width':''}).off('resizeme.zf.trigger');this.$anchor.off('change.zf.sticky');$(window).off(this.scrollListener);if(this.wasWrapped){this.$element.unwrap();}else {this.$container.removeClass(this.options.containerClass).css({height:''});}Foundation.unregisterPlugin(this);}}]);return Sticky;}();Sticky.defaults={ /** 2100 * Customizable container template. Add your own classes for styling and sizing. 2101 * @option 2102 * @example '<div data-sticky-container class="small-6 columns"></div>' 2103 */container:'<div data-sticky-container></div>', /** 2104 * Location in the view the element sticks to. 2105 * @option 2106 * @example 'top' 2107 */stickTo:'top', /** 2108 * If anchored to a single element, the id of that element. 2109 * @option 2110 * @example 'exampleId' 2111 */anchor:'', /** 2112 * If using more than one element as anchor points, the id of the top anchor. 2113 * @option 2114 * @example 'exampleId:top' 2115 */topAnchor:'', /** 2116 * If using more than one element as anchor points, the id of the bottom anch
2116or. 2117 * @option 2118 * @example 'exampleId:bottom' 2119 */btmAnchor:'', /** 2120 * Margin, in `em`'s to apply to the top of the element when it becomes sticky. 2121 * @option 2122 * @example 1 2123 */marginTop:1, /** 2124 * Margin, in `em`'s to apply to the bottom of the element when it becomes sticky. 2125 * @option 2126 * @example 1 2127 */marginBottom:1, /** 2128 * Breakpoint string that is the minimum screen size an element should become sticky. 2129 * @option 2130 * @example 'medium' 2131 */stickyOn:'medium', /** 2132 * Class applied to sticky element, and removed on destruction. Foundation defaults to `sticky`. 2133 * @option 2134 * @example 'sticky' 2135 */stickyClass:'sticky', /** 2136 * Class applied to sticky container. Foundation defaults to `sticky-container`. 2137 * @option 2138 * @example 'sticky-container' 2139 */containerClass:'sticky-container', /** 2140 * 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. 2141 * @option 2142 * @example 50 2143 */checkEvery:-1}; /** 2144 * Helper function to calculate em values 2145 * @param Number {em} - number of em's to calculate into pixels 2146 */function emCalc(em){return parseInt(window.getComputedStyle(document.body,null).fontSize,10)*em;} // Window exports 2147Foundation.plugin(Sticky,'Sticky');}(jQuery); 2148'use strict';var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj;}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj;};var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value" in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}!function($){ /** 2149 * Tabs module. 2150 * @module foundation.tabs 2151 * @requires foundation.util.keyboard 2152 * @requires foundation.util.timerAndImageLoader if tabs contain images 2153 */var Tabs=function(){ /** 2154 * Creates a new instance of tabs. 2155 * @class 2156 * @fires Tabs#init 2157 * @param {jQuery} element - jQuery object to make into tabs. 2158 * @param {Object} options - Overrides to the default plugin settings. 2159 */function Tabs(element,options){_classCallCheck(this,Tabs);this.$element=element;this.options=$.extend({},Tabs.defaults,this.$element.data(),options);this._init();Foundation.registerPlugin(this,'Tabs');Foundation.Keyboard.register('Tabs',{'ENTER':'open','SPACE':'open','ARROW_RIGHT':'next','ARROW_UP':'previous','ARROW_DOWN':'next','ARROW_LEFT':'previous' // 'TAB': 'next', 2160// 'SHIFT_TAB': 'previous' 2161});} /** 2162 * Initializes the tabs by showing and focusing (if autoFocus=true) the preset active tab. 2163 * @private 2164 */_createClass(Tabs,[{key:'_init',value:function _init(){var _this=this;this.$tabTitles=this.$element.find('.'+this.options.linkClass);this.$tabContent=$('[data-tabs-content="'+this.$element[0].id+'"]');this.$tabTitles.each(function(){var $elem=$(this),$link=$elem.find('a'),isActive=$elem.hasClass('is-active'),hash=$link[0].hash.slice(1),linkId=$link[0].id?$link[0].id:hash+'-label',$tabContent=$('#'+hash);$elem.attr({'role':'presentation'});$link.attr({'role':'tab','aria-controls':hash,'aria-selected':isActive,'id':linkId});$tabContent.attr({'role':'tabpanel','aria-hidden':!isActive,'aria-labelledby':linkId});if(isActive&&_this.options.autoFocus){$link.focus();}});if(this.options.matchHeight){var $images=this.$tabContent.find('img');if($images.length){Foundation.onImagesLoaded($images,this._setHeight.bind(this));}else {this._setHeight();}}this._events();} /** 2165 * Adds event handlers for items within the tabs. 2166 * @private 2167 */},{key:'_events',value:function _events(){this._addKeyHandler();this._addClickHandler();if(this.options.matchHeight){$(window).on('changed.zf.mediaquery',this._setHeight.bind(this));}} /** 2168 * Adds click handlers for items within the tabs. 2169 * @private 2170 */},{key:'_addClickHandler',value:function _addClickHandler(){var _this=this;this.$element.off('click.zf.tabs').on('click.zf.tabs','.'+this.options.linkClass,function(e){e.preventDefault();e.stopPropagation();if($(this).hasClass('is-active')){return;}_this._handleTabChange($(this));});} /** 2171 * Adds keyboard event handlers for items within the tabs. 2172 * @private 2173 */},{key:'_addKeyHandler',value:function _addKeyHandler(){var _this=this;var $firstTab=_this.$element.find('li:first-of-type');var $lastTab=_this.$element.find('li:last-of-type');this.$tabTitles.off('keydown.zf.tabs').on('keydown.zf.tabs',function(e){if(e.which===9)return;e.stopPropagation();e.preventDefault();var $element=$(this),$elements=$element.parent('ul').children('li'),$prevElement,$nextElement;$elements.each(function(i){if($(this).is($element)){if(_this.options.wrapOnKeys){$prevElement=i===0?$elements.last(
2173):$elements.eq(i-1);$nextElement=i===$elements.length-1?$elements.first():$elements.eq(i+1);}else {$prevElement=$elements.eq(Math.max(0,i-1));$nextElement=$elements.eq(Math.min(i+1,$elements.length-1));}return;}}); // handle keyboard event with keyboard util 2174Foundation.Keyboard.handleKey(e,'Tabs',{open:function open(){$element.find('[role="tab"]').focus();_this._handleTabChange($element);},previous:function previous(){$prevElement.find('[role="tab"]').focus();_this._handleTabChange($prevElement);},next:function next(){$nextElement.find('[role="tab"]').focus();_this._handleTabChange($nextElement);}});});} /** 2175 * Opens the tab `$targetContent` defined by `$target`. 2176 * @param {jQuery} $target - Tab to open. 2177 * @fires Tabs#change 2178 * @function 2179 */},{key:'_handleTabChange',value:function _handleTabChange($target){var $tabLink=$target.find('[role="tab"]'),hash=$tabLink[0].hash,$targetContent=this.$tabContent.find(hash),$oldTab=this.$element.find('.'+this.options.linkClass+'.is-active').removeClass('is-active').find('[role="tab"]').attr({'aria-selected':'false'});$('#'+$oldTab.attr('aria-controls')).removeClass('is-active').attr({'aria-hidden':'true'});$target.addClass('is-active');$tabLink.attr({'aria-selected':'true'});$targetContent.addClass('is-active').attr({'aria-hidden':'false'}); /** 2180 * Fires when the plugin has successfully changed tabs. 2181 * @event Tabs#change 2182 */this.$element.trigger('change.zf.tabs',[$target]);} /** 2183 * Public method for selecting a content pane to display. 2184 * @param {jQuery | String} elem - jQuery object or string of the id of the pane to display. 2185 * @function 2186 */},{key:'selectTab',value:function selectTab(elem){var idStr;if((typeof elem==='undefined'?'undefined':_typeof(elem))==='object'){idStr=elem[0].id;}else {idStr=elem;}if(idStr.indexOf('#')<0){idStr='#'+idStr;}var $target=this.$tabTitles.find('[href="'+idStr+'"]').parent('.'+this.options.linkClass);this._handleTabChange($target);}},{key:'_setHeight', /** 2187 * Sets the height of each panel to the height of the tallest panel. 2188 * If enabled in options, gets called on media query change. 2189 * If loading content via external source, can be called directly or with _reflow. 2190 * @function 2191 * @private 2192 */value:function _setHeight(){var max=0;this.$tabContent.find('.'+this.options.panelClass).css('height','').each(function(){var panel=$(this),isActive=panel.hasClass('is-active');if(!isActive){panel.css({'visibility':'hidden','display':'block'});}var temp=this.getBoundingClientRect().height;if(!isActive){panel.css({'visibility':'','display':''});}max=temp>max?temp:max;}).css('height',max+'px');} /** 2193 * Destroys an instance of an tabs. 2194 * @fires Tabs#destroyed 2195 */},{key:'destroy',value:function destroy(){this.$element.find('.'+this.options.linkClass).off('.zf.tabs').hide().end().find('.'+this.options.panelClass).hide();if(this.options.matchHeight){$(window).off('changed.zf.mediaquery');}Foundation.unregisterPlugin(this);}}]);return Tabs;}();Tabs.defaults={ /** 2196 * Allows the window to scroll to content of active pane on load if set to true. 2197 * @option 2198 * @example false 2199 */autoFocus:false, /** 2200 * Allows keyboard input to 'wrap' around the tab links. 2201 * @option 2202 * @example true 2203 */wrapOnKeys:true, /** 2204 * Allows the tab content panes to match heights if set to true. 2205 * @option 2206 * @example false 2207 */matchHeight:false, /** 2208 * Class applied to `li`'s in tab link list. 2209 * @option 2210 * @example 'tabs-title' 2211 */linkClass:'tabs-title', /** 2212 * Class applied to the content containers. 2213 * @option 2214 * @example 'tabs-panel' 2215 */panelClass:'tabs-panel'};function checkClass($elem){return $elem.hasClass('is-active');} // Window exports 2216Foundation.plugin(Tabs,'Tabs');}(jQuery); 2217'use strict';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value" in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}!function($){ /** 2218 * Toggler module. 2219 * @module foundation.toggler 2220 * @requires foundation.util.motion 2221 * @requires foundation.util.triggers 2222 */var Toggler=function(){ /** 2223 * Creates a new instance of Toggler. 2224 * @class 2225 * @fires Toggler#init 2226 * @param {Object} element - jQuery object to add the trigger to. 2227 * @param {Object} options - Overrides to the default plugin settings. 2228 */function Toggler(element,options){_classCallCheck(this,Toggler);this.$element=element;this.options=$.extend({},Toggler.defaults,element.data(),options);this.className='';this._init();this._events();Foundation.registerPlugin(this,'Toggler');} /** 2229 * Initializes the Toggler plugin by parsing the toggle class from data-toggler, or animation classes from data-animate. 2230 * @function 2231 * @private 2232 */_createClass(Toggler,[{key:'_init',value:function _init(){var input; // Parse animation classes if they were set 2233if(this.options.animate){input=this.options.animate.split(' ');this.animationIn=input[0];this.animationOut=input[1]||null;} // Otherwise, parse toggle class 2234else {input=this.$element.data('toggler'); // Allow for a . at the beginning of the string 2235this.className=input[0]==='.'?input.slice(1):input;} // Add ARIA attributes to triggers 2236var id=this.$element[0].id;$('[data-open="'+id+'"], [data-close="'+id+'"], [data-toggle="'+id+'"]').attr('aria-controls',id); // If the target is hidden, add aria-hidden 2237this.$element.attr('aria-expanded',this.$element.is(':hidden')?false:true);} /** 2238 * Initializes events for the toggle trigger. 2239 * @function 2240 * @private 2241 */},{key:'_events',value:function _events(){this.$element.off('toggle.zf.trigger').on('toggle.zf.trigger',this.toggle.bind(this));} /** 2242 * 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". 2243 * @function 2244 * @fires Toggler#on 2245 * @fires Toggler#off 2246 */}
2246,{key:'toggle',value:function toggle(){this[this.options.animate?'_toggleAnimate':'_toggleClass']();}},{key:'_toggleClass',value:function _toggleClass(){this.$element.toggleClass(this.className);var isOn=this.$element.hasClass(this.className);if(isOn){ /** 2247 * Fires if the target element has the class after a toggle. 2248 * @event Toggler#on 2249 */this.$element.trigger('on.zf.toggler');}else { /** 2250 * Fires if the target element does not have the class after a toggle. 2251 * @event Toggler#off 2252 */this.$element.trigger('off.zf.toggler');}this._updateARIA(isOn);}},{key:'_toggleAnimate',value:function _toggleAnimate(){var _this=this;if(this.$element.is(':hidden')){Foundation.Motion.animateIn(this.$element,this.animationIn,function(){this.trigger('on.zf.toggler');_this._updateARIA(true);});}else {Foundation.Motion.animateOut(this.$element,this.animationOut,function(){this.trigger('off.zf.toggler');_this._updateARIA(false);});}}},{key:'_updateARIA',value:function _updateARIA(isOn){this.$element.attr('aria-expanded',isOn?true:false);} /** 2253 * Destroys the instance of Toggler on the element. 2254 * @function 2255 */},{key:'destroy',value:function destroy(){this.$element.off('.zf.toggler');Foundation.unregisterPlugin(this);}}]);return Toggler;}();Toggler.defaults={ /** 2256 * Tells the plugin if the element should animated when toggled. 2257 * @option 2258 * @example false 2259 */animate:false}; // Window exports 2260Foundation.plugin(Toggler,'Toggler');}(jQuery); 2261'use strict';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value" in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}!function($){ /** 2262 * Tooltip module. 2263 * @module foundation.tooltip 2264 * @requires foundation.util.box 2265 * @requires foundation.util.triggers 2266 */var Tooltip=function(){ /** 2267 * Creates a new instance of a Tooltip. 2268 * @class 2269 * @fires Tooltip#init 2270 * @param {jQuery} element - jQuery object to attach a tooltip to. 2271 * @param {Object} options - object to extend the default configuration. 2272 */function Tooltip(element,options){_classCallCheck(this,Tooltip);this.$element=element;this.options=$.extend({},Tooltip.defaults,this.$element.data(),options);this.isActive=false;this.isClick=false;this._init();Foundation.registerPlugin(this,'Tooltip');} /** 2273 * Initializes the tooltip by setting the creating the tip element, adding it's text, setting private variables and setting attributes on the anchor. 2274 * @private 2275 */_createClass(Tooltip,[{key:'_init',value:function _init(){var elemId=this.$element.attr('aria-describedby')||Foundation.GetYoDigits(6,'tooltip');this.options.positionClass=this._getPositionClass(this.$element);this.options.tipText=this.options.tipText||this.$element.attr('title');this.template=this.options.template?$(this.options.template):this._buildTemplate(elemId);this.template.appendTo(document.body).text(this.options.tipText).hide();this.$element.attr({'title':'','aria-describedby':elemId,'data-yeti-box':elemId,'data-toggle':elemId,'data-resize':elemId}).addClass(this.triggerClass); //helper variables to track movement on collisions 2276this.usedPositions=[];this.counter=4;this.classChanged=false;this._events();} /** 2277 * Grabs the current positioning class, if present, and returns the value or an empty string. 2278 * @private 2279 */},{key:'_getPositionClass',value:function _getPositionClass(element){if(!element){return '';} // var position = element.attr('class').match(/top|left|right/g); 2280var position=element[0].className.match(/\b(top|left|right)\b/g);position=position?position[0]:'';return position;}},{key:'_buildTemplate', /** 2281 * builds the tooltip element, adds attributes, and returns the template. 2282 * @private 2283 */value:function _buildTemplate(id){var templateClasses=(this.options.tooltipClass+' '+this.options.positionClass+' '+this.options.templateClasses).trim();var $template=$('<div></div>').addClass(templateClasses).attr({'role':'tooltip','aria-hidden':true,'data-is-active':false,'data-is-focus':false,'id':id});return $template;} /**
2284 * Function that gets called if a collision event is detected. 2285 * @param {String} position - positioning class to try 2286 * @private 2287 */},{key:'_reposition',value:function _reposition(position){this.usedPositions.push(position?position:'bottom'); //default, try switching to opposite side 2288if(!position&&this.usedPositions.indexOf('top')<0){this.template.addClass('top');}else if(position==='top'&&this.usedPositions.indexOf('bottom')<0){this.template.removeClass(position);}else if(position==='left'&&this.usedPositions.indexOf('right')<0){this.template.removeClass(position).addClass('right');}else if(position==='right'&&this.usedPositions.indexOf('left')<0){this.template.removeClass(position).addClass('left');} //if default change didn't work, try bottom or left first 2289else if(!position&&this.usedPositions.indexOf('top')>-1&&this.usedPositions.indexOf('left')<0){this.template.addClass('left');}else if(position==='top'&&this.usedPositions.indexOf('bottom')>-1&&this.usedPositions.indexOf('left')<0){this.template.removeClass(position).addClass('left');}else if(position==='left'&&this.usedPositions.indexOf('right')>-1&&this.usedPositions.indexOf('bottom')<0){this.template.removeClass(position);}else if(position==='right'&&this.usedPositions.indexOf('left')>-1&&this.usedPositions.indexOf('bottom')<0){this.template.removeClass(position);} //if nothing cleared, set to bottom 2290else {this.template.removeClass(position);}this.classChanged=true;this.counter--;} /** 2291 * 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. 2292 * if the tooltip is larger than the screen width, default to full width - any user selected margin 2293 * @private 2294 */},{key:'_setPosition',value:function _setPosition(){var position=this._getPositionClass(this.template),$tipDims=Foundation.Box.GetDimensions(this.template),$anchorDims=Foundation.Box.GetDimensions(this.$element),direction=position==='left'?'left':position==='right'?'left':'top',param=direction==='top'?'height':'width',offset=param==='height'?this.options.vOffset:this.options.hOffset,_this=this;if($tipDims.width>=$tipDims.windowDims.width||!this.counter&&!Foundation.Box.ImNotTouchingYou(this.template)){this.template.offset(Foundation.Box.GetOffsets(this.template,this.$element,'center bottom',this.options.vOffset,this.options.hOffset,true)).css({ // this.$element.offset(Foundation.GetOffsets(this.template, this.$element, 'center bottom', this.options.vOffset, this.options.hOffset, true)).css({ 2295'width':$anchorDims.windowDims.width-this.options.hOffset*2,'height':'auto'});return false;}this.template.offset(Foundation.Box.GetOffsets(this.template,this.$element,'center '+(position||'bottom'),this.options.vOffset,this.options.hOffset));while(!Foundation.Box.ImNotTouchingYou(this.template)&&this.counter){this._reposition(position);this._setPosition();}} /** 2296 * reveals the tooltip, and fires an event to close any other open tooltips on the page 2297 * @fires Tooltip#closeme 2298 * @fires Tooltip#show 2299 * @function 2300 */},{key:'show',value:function show(){if(this.options.showOn!=='all'&&!Foundation.MediaQuery.atLeast(this.options.showOn)){ // console.error('The screen is too small to display this tooltip'); 2301return false;}var _this=this;this.template.css('visibility','hidden').show();this._setPosition(); /** 2302 * Fires to close all other open tooltips on the page 2303 * @event Closeme#tooltip 2304 */this.$element.trigger('closeme.zf.tooltip',this.template.attr('id'));this.template.attr({'data-is-active':true,'aria-hidden':false});_this.isActive=true; // console.log(this.template); 2305this.template.stop().hide().css('visibility','').fadeIn(this.options.fadeInDuration,function(){ //maybe do stuff? 2306}); /** 2307 * Fires when the tooltip is shown 2308 * @event Tooltip#show 2309 */this.$element.trigger('show.zf.tooltip');} /** 2310 * Hides the current tooltip, and resets the positioning class if it was changed due to collision 2311 * @fires Tooltip#hide 2312 * @function 2313 */},{key:'hide',value:function hide(){ // console.log('hiding', this.$element.data('yeti-box')); 2314var _this=this;this.template.stop().attr({'aria-hidden':true,'data-is-active':false}).fadeOut(this.options.fadeOutDuration,function(){_this.isActive=false;_this.isClick=false;if(_this.classChanged){_this.template.removeClass(_this._getPositionClass(_this.template)).addClass(_this.options.positionClass);_this.usedPositions=[];_this.counter=4;_this.classChanged=false;}}); /** 2315 * fires when the tooltip is hidden 2316 * @event Tooltip#hide 2317 */this.$element.trigger('hide.zf.tooltip');}
2317 /** 2318 * adds event listeners for the tooltip and its anchor 2319 * TODO combine some of the listeners like focus and mouseenter, etc. 2320 * @private 2321 */},{key:'_events',value:function _events(){var _this=this;var $template=this.template;var isFocus=false;if(!this.options.disableHover){this.$element.on('mouseenter.zf.tooltip',function(e){if(!_this.isActive){_this.timeout=setTimeout(function(){_this.show();},_this.options.hoverDelay);}}).on('mouseleave.zf.tooltip',function(e){clearTimeout(_this.timeout);if(!isFocus||!_this.isClick&&_this.options.clickOpen){_this.hide();}});}if(this.options.clickOpen){this.$element.on('mousedown.zf.tooltip',function(e){e.stopImmediatePropagation();if(_this.isClick){_this.hide(); // _this.isClick = false; 2322}else {_this.isClick=true;if((_this.options.disableHover||!_this.$element.attr('tabindex'))&&!_this.isActive){_this.show();}}});}if(!this.options.disableForTouch){this.$element.on('tap.zf.tooltip touchend.zf.tooltip',function(e){_this.isActive?_this.hide():_this.show();});}this.$element.on({ // 'toggle.zf.trigger': this.toggle.bind(this), 2323// 'close.zf.trigger': this.hide.bind(this) 2324'close.zf.trigger':this.hide.bind(this)});this.$element.on('focus.zf.tooltip',function(e){isFocus=true; // console.log(_this.isClick); 2325if(_this.isClick){return false;}else { // $(window) 2326_this.show();}}).on('focusout.zf.tooltip',function(e){isFocus=false;_this.isClick=false;_this.hide();}).on('resizeme.zf.trigger',function(){if(_this.isActive){_this._setPosition();}});} /** 2327 * adds a toggle method, in addition to the static show() & hide() functions 2328 * @function 2329 */},{key:'toggle',value:function toggle(){if(this.isActive){this.hide();}else {this.show();}} /** 2330 * Destroys an instance of tooltip, removes template element from the view. 2331 * @function 2332 */},{key:'destroy',value:function destroy(){this.$element.attr('title',this.template.text()).off('.zf.trigger .zf.tootip') // .removeClass('has-tip') 2333.removeAttr('aria-describedby').removeAttr('data-yeti-box').removeAttr('data-toggle').removeAttr('data-resize');this.template.remove();Foundation.unregisterPlugin(this);}}]);return Tooltip;}();Tooltip.defaults={disableForTouch:false, /** 2334 * Time, in ms, before a tooltip should open on hover. 2335 * @option 2336 * @example 200 2337 */hoverDelay:200, /** 2338 * Time, in ms, a tooltip should take to fade into view. 2339 * @option 2340 * @example 150 2341 */fadeInDuration:150, /** 2342 * Time, in ms, a tooltip should take to fade out of view. 2343 * @option 2344 * @example 150 2345 */fadeOutDuration:150, /** 2346 * Disables hover events from opening the tooltip if set to true 2347 * @option 2348 * @example false 2349 */disableHover:false, /** 2350 * Optional addtional classes to apply to the tooltip template on init. 2351 * @option 2352 * @example 'my-cool-tip-class' 2353 */templateClasses:'', /** 2354 * Non-optional class added to tooltip templates. Foundation default is 'tooltip'. 2355 * @option 2356 * @example 'tooltip' 2357 */tooltipClass:'tooltip', /** 2358 * Class applied to the tooltip anchor element. 2359 * @option 2360 * @example 'has-tip' 2361 */triggerClass:'has-tip', /** 2362 * Minimum breakpoint size at which to open the tooltip. 2363 * @option 2364 * @example 'small' 2365 */showOn:'small', /** 2366 * Custom template to be used to generate markup for tooltip. 2367 * @option 2368 * @example '<div class="tooltip"></div>' 2369 */template:'', /** 2370 * Text displayed in the tooltip template on open. 2371 * @option 2372 * @example 'Some cool space fact here.' 2373 */tipText:'',touchCloseText:'Tap to close.', /** 2374 * Allows the tooltip to remain open if triggered with a click or touch event. 2375 * @option 2376 * @example true 2377 */clickOpen:true, /** 2378 * Additional positioning classes, set by the JS 2379 * @option 2380 * @example 'top' 2381 */positionClass:'', /** 2382 * Distance, in pixels, the template should push away from the anch
2382or on the Y axis. 2383 * @option 2384 * @example 10 2385 */vOffset:10, /** 2386 * Distance, in pixels, the template should push away from the anchor on the X axis, if aligned to a side. 2387 * @option 2388 * @example 12 2389 */hOffset:12}; /** 2390 * TODO utilize resize event trigger 2391 */ // Window exports 2392Foundation.plugin(Tooltip,'Tooltip');}(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.