blob: b56877c3294cbe255e2387c9eaca8b62af9e9628 [file] [log] [blame]
!function(){function e(e){var t=document.querySelectorAll('[data-tab-nav] a[href="#'+e+'"]');if(t.length){for(var n=document.querySelectorAll(".is-activeTab"),a=0;a<n.length;a++)n[a].className=n[a].className.replace("is-activeTab","");var t=document.querySelectorAll('[data-tab-nav] a[href="#'+e+'"]');t[0].className+=" is-activeTab",document.getElementById(e).className+=" is-activeTab"}}function t(t){history&&(t.preventDefault(),history.pushState({},"",t.target.href)),e(t.target.href.split("#")[1])}function n(){location.hash.split("#").length&&e(location.hash.split("#")[1])}function a(){var a=document.querySelectorAll("[data-tab-nav] a");Array.prototype.forEach.call(a,function(e){e.addEventListener("click",t,!1)}),window.addEventListener("hashchange",function(){e(location.hash.split("#")[1])},!1),n()}window.featureCards={init:a}}(),function(e,t){"function"==typeof define&&define.amd?define([],t(e)):"object"==typeof exports?module.exports=t(e):e.smoothScroll=t(e)}("undefined"!=typeof global?global:this.window||this.global,function(e){"use strict";var t,n,a,r,o,c={},i="querySelector"in document&&"addEventListener"in e,l={selector:"[data-scroll]",selectorHeader:"[data-scroll-header]",speed:500,easing:"easeInOutCubic",offset:0,updateURL:!0,callback:function(){}},u=function(){var e={},t=!1,n=0,a=arguments.length;"[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(t=arguments[0],n++);for(var r=function(n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t&&"[object Object]"===Object.prototype.toString.call(n[a])?e[a]=u(!0,e[a],n[a]):e[a]=n[a])};a>n;n++){var o=arguments[n];r(o)}return e},s=function(e){return Math.max(e.scrollHeight,e.offsetHeight,e.clientHeight)},f=function(e,t){var n,a,r=t.charAt(0),o="classList"in document.documentElement;for("["===r&&(t=t.substr(1,t.length-2),n=t.split("="),n.length>1&&(a=!0,n[1]=n[1].replace(/"/g,"").replace(/'/g,"")));e&&e!==document;e=e.parentNode){if("."===r)if(o){if(e.classList.contains(t.substr(1)))return e}else if(new RegExp("(^|\\s)"+t.substr(1)+"(\\s|$)").test(e.className))return e;if("#"===r&&e.id===t.substr(1))return e;if("["===r&&e.hasAttribute(n[0])){if(!a)return e;if(e.getAttribute(n[0])===n[1])return e}if(e.tagName.toLowerCase()===t)return e}return null};c.escapeCharacters=function(e){"#"===e.charAt(0)&&(e=e.substr(1));for(var t,n=String(e),a=n.length,r=-1,o="",c=n.charCodeAt(0);++r<a;){if(t=n.charCodeAt(r),0===t)throw new InvalidCharacterError("Invalid character: the input contains U+0000.");o+=t>=1&&31>=t||127==t||0===r&&t>=48&&57>=t||1===r&&t>=48&&57>=t&&45===c?"\\"+t.toString(16)+" ":t>=128||45===t||95===t||t>=48&&57>=t||t>=65&&90>=t||t>=97&&122>=t?n.charAt(r):"\\"+n.charAt(r)}return"#"+o};var d=function(e,t){var n;return"easeInQuad"===e&&(n=t*t),"easeOutQuad"===e&&(n=t*(2-t)),"easeInOutQuad"===e&&(n=.5>t?2*t*t:-1+(4-2*t)*t),"easeInCubic"===e&&(n=t*t*t),"easeOutCubic"===e&&(n=--t*t*t+1),"easeInOutCubic"===e&&(n=.5>t?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1),"easeInQuart"===e&&(n=t*t*t*t),"easeOutQuart"===e&&(n=1- --t*t*t*t),"easeInOutQuart"===e&&(n=.5>t?8*t*t*t*t:1-8*--t*t*t*t),"easeInQuint"===e&&(n=t*t*t*t*t),"easeOutQuint"===e&&(n=1+--t*t*t*t*t),"easeInOutQuint"===e&&(n=.5>t?16*t*t*t*t*t:1+16*--t*t*t*t*t),n||t},h=function(e,t,n){var a=0;if(e.offsetParent)do a+=e.offsetTop,e=e.offsetParent;while(e);return a=a-t-n,a>=0?a:0},p=function(){return Math.max(e.document.body.scrollHeight,e.document.documentElement.scrollHeight,e.document.body.offsetHeight,e.document.documentElement.offsetHeight,e.document.body.clientHeight,e.document.documentElement.clientHeight)},m=function(e){return e&&"object"==typeof JSON&&"function"==typeof JSON.parse?JSON.parse(e):{}},v=function(t,n){e.history.pushState&&(n||"true"===n)&&"file:"!==e.location.protocol&&e.history.pushState(null,null,[e.location.protocol,"//",e.location.host,e.location.pathname,e.location.search,t].join(""))},g=function(e){return null===e?0:s(e)+e.offsetTop};c.animateScroll=function(n,c,i){var s=m(c?c.getAttribute("data-options"):null),f=u(t||l,i||{},s),b="[object Number]"===Object.prototype.toString.call(n),y=b?null:"#"===n?e.document.documentElement:e.document.querySelector(n);if(b||y){var S=e.pageYOffset;a||(a=e.document.querySelector(f.selectorHeader)),r||(r=g(a));var O,I,E=b?n:h(y,r,parseInt(f.offset,10)),A=E-S,w=p(),H=0;b||v(n,f.updateURL);var L=function(t,a,r){var o=e.pageYOffset;(t==a||o==a||e.innerHeight+o>=w)&&(clearInterval(r),b||y.focus(),f.callback(n,c))},C=function(){H+=16,O=H/parseInt(f.speed,10),O=O>1?1:O,I=S+A*d(f.easing,O),e.scrollTo(0,Math.floor(I)),L(I,E,o)},N=function(){clearInterval(o),o=setInterval(C,16)};0===e.pageYOffset&&e.scrollTo(0,0),N()}};var b=function(e){if(0===e.button&&!e.metaKey&&!e.ctrlKey){var n=f(e.target,t.selector);if(n&&"a"===n.tagName.toLowerCase()){e.preventDefault();var a=c.escapeCharacters(n.hash);c.animateScroll(a,n,t)}}},y=function(e){n||(n=setTimeout(function(){n=null,r=g(a)},66))};return c.destroy=function(){t&&(e.document.removeEventListener("click",b,!1),e.removeEventListener("resize",y,!1),t=null,n=null,a=null,r=null,o=null)},c.init=function(n){i&&(c.destroy(),t=u(l,n||{}),a=e.document.querySelector(t.selectorHeader),r=g(a),e.document.addEventListener("click",b,!1),a&&e.addEventListener("resize",y,!1))},c});