{"version":3,"sources":["js/smooth-scroll.js","js/main.js"],"names":["root","factory","define","amd","exports","module","SmoothScroll","global","window","defaults","ignore","header","topOnEmptyHash","speed","speedAsDuration","durationMax","durationMin","clip","offset","easing","customEasing","updateURL","popstate","emitEvents","extend","merged","Array","prototype","forEach","call","arguments","obj","key","hasOwnProperty","decode","hash","decoded","decodeURIComponent","e","escapeCharacters","id","charAt","substr","string","codeUnit","String","length","index","result","firstCodeUnit","charCodeAt","InvalidCharacterError","toString","getDocumentHeight","Math","max","document","body","scrollHeight","documentElement","offsetHeight","clientHeight","getHeaderHeight","elem","parseInt","getComputedStyle","height","offsetTop","emitEvent","type","options","anchor","toggle","CustomEvent","event","bubbles","detail","dispatchEvent","selector","smoothScroll","settings","fixedHeader","headerHeight","eventTimeout","animationInterval","cancelScroll","noEvent","cancelAnimationFrame","animateScroll","_settings","isNum","Object","anchorElem","tagName","startLocation","pageYOffset","querySelector","endLocation","start","percentage","position","location","offsetParent","min","innerHeight","getEndLocation","distance","documentHeight","timeLapsed","abs","getSpeed","stopAnimateScroll","currentLocation","focus","activeElement","setAttribute","style","outline","scrollTo","adjustFocus","history","pushState","JSON","stringify","title","requestAnimationFrame","loopAnimateScroll","timestamp","time","pattern","floor","clickHandler","reduceMotion","matchMedia","matches","button","metaKey","ctrlKey","target","closest","toLowerCase","hostname","pathname","test","href","preventDefault","popstateHandler","state","resizeThrottler","setTimeout","destroy","removeEventListener","init","Element","addEventListener","scroll"],"mappings":";;;AAOA,IAAA,EAAA,EAAA,UAAA,GAAA,SAAA,EAAA,GAAA,OAAA,EAAA,mBAAA,QAAA,iBAAA,OAAA,SAAA,SAAA,GAAA,cAAA,GAAA,SAAA,GAAA,OAAA,GAAA,mBAAA,QAAA,EAAA,cAAA,QAAA,IAAA,OAAA,UAAA,gBAAA,IAAA,IAAA,SAAWA,EAAMC,GACM,mBAAXC,GAAyBA,EAAOC,IAC1CD,EAAO,GAAK,WACJD,OAAAA,EAAQD,KAEa,YAAZI,oBAAA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uBAEA,SAAA,EAAA,GAAA,OAAA,GAAA,EAAA,WAAA,EAAA,CAAA,QAAA,GAAA,IAAI4E,EAAS,IAAIrJ,EAAJ,QAAiB","file":"main.37d48470.map","sourceRoot":"..","sourcesContent":["/*!\n * smooth-scroll v15.0.0: Animate scrolling to anchor links\n * (c) 2018 Chris Ferdinandi\n * MIT License\n * http://github.com/cferdinandi/smooth-scroll\n */\n\n(function (root, factory) {\n\tif (typeof define === 'function' && define.amd) {\n\t\tdefine([], (function () {\n\t\t\treturn factory(root);\n\t\t}));\n\t} else if (typeof exports === 'object') {\n\t\tmodule.exports = factory(root);\n\t} else {\n\t\troot.SmoothScroll = factory(root);\n\t}\n})(typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this, (function (window) {\n\n\t'use strict';\n\n\t//\n\t// Default settings\n\t//\n\n\tvar defaults = {\n\n\t\t// Selectors\n\t\tignore: '[data-scroll-ignore]',\n\t\theader: null,\n\t\ttopOnEmptyHash: true,\n\n\t\t// Speed & Duration\n\t\tspeed: 500,\n\t\tspeedAsDuration: false,\n\t\tdurationMax: null,\n\t\tdurationMin: null,\n\t\tclip: true,\n\t\toffset: 0,\n\n\t\t// Easing\n\t\teasing: 'easeInOutCubic',\n\t\tcustomEasing: null,\n\n\t\t// History\n\t\tupdateURL: true,\n\t\tpopstate: true,\n\n\t\t// Custom Events\n\t\temitEvents: true\n\n\t};\n\n\n\t//\n\t// Utility Methods\n\t//\n\n\t/**\n\t * Check if browser supports required methods\n\t * @return {Boolean} Returns true if all required methods are supported\n\t */\n\tvar supports = function () {\n\t\treturn (\n\t\t\t'querySelector' in document &&\n\t\t\t'addEventListener' in window &&\n\t\t\t'requestAnimationFrame' in window &&\n\t\t\t'closest' in window.Element.prototype\n\t\t);\n\t};\n\n\t/**\n\t * Merge two or more objects together.\n\t * @param   {Object}   objects  The objects to merge together\n\t * @returns {Object}            Merged values of defaults and options\n\t */\n\tvar extend = function () {\n\t\tvar merged = {};\n\t\tArray.prototype.forEach.call(arguments, (function (obj) {\n\t\t\tfor (var key in obj) {\n\t\t\t\tif (!obj.hasOwnProperty(key)) return;\n\t\t\t\tmerged[key] = obj[key];\n\t\t\t}\n\t\t}));\n\t\treturn merged;\n\t};\n\n\t/**\n\t * Check to see if user prefers reduced motion\n\t * @param  {Object} settings Script settings\n\t */\n\tvar reduceMotion = function (settings) {\n\t\tif ('matchMedia' in window && window.matchMedia('(prefers-reduced-motion)').matches) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t};\n\n\t/**\n\t * Get the height of an element.\n\t * @param  {Node} elem The element to get the height of\n\t * @return {Number}    The element's height in pixels\n\t */\n\tvar getHeight = function (elem) {\n\t\treturn parseInt(window.getComputedStyle(elem).height, 10);\n\t};\n\n\t/**\n\t * Decode a URI, with error check\n\t * @param  {String} hash The URI to decode\n\t * @return {String}      A decoded URI (or the original string if an error is thrown)\n\t */\n\tvar decode = function (hash) {\n\t\tvar decoded;\n\t\ttry {\n\t\t\tdecoded = decodeURIComponent(hash);\n\t\t} catch(e) {\n\t\t\tdecoded = hash;\n\t\t}\n\t\treturn decoded;\n\t};\n\n\t/**\n\t * Escape special characters for use with querySelector\n\t * @author Mathias Bynens\n\t * @link https://github.com/mathiasbynens/CSS.escape\n\t * @param {String} id The anchor ID to escape\n\t */\n\tvar escapeCharacters = function (id) {\n\n\t\t// Remove leading hash\n\t\tif (id.charAt(0) === '#') {\n\t\t\tid = id.substr(1);\n\t\t}\n\n\t\tvar string = String(id);\n\t\tvar length = string.length;\n\t\tvar index = -1;\n\t\tvar codeUnit;\n\t\tvar result = '';\n\t\tvar firstCodeUnit = string.charCodeAt(0);\n\t\twhile (++index < length) {\n\t\t\tcodeUnit = string.charCodeAt(index);\n\t\t\t// Note: there’s no need to special-case astral symbols, surrogate\n\t\t\t// pairs, or lone surrogates.\n\n\t\t\t// If the character is NULL (U+0000), then throw an\n\t\t\t// `InvalidCharacterError` exception and terminate these steps.\n\t\t\tif (codeUnit === 0x0000) {\n\t\t\t\tthrow new InvalidCharacterError(\n\t\t\t\t\t'Invalid character: the input contains U+0000.'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t// If the character is in the range [\\1-\\1F] (U+0001 to U+001F) or is\n\t\t\t\t// U+007F, […]\n\t\t\t\t(codeUnit >= 0x0001 && codeUnit <= 0x001F) || codeUnit == 0x007F ||\n\t\t\t\t// If the character is the first character and is in the range [0-9]\n\t\t\t\t// (U+0030 to U+0039), […]\n\t\t\t\t(index === 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) ||\n\t\t\t\t// If the character is the second character and is in the range [0-9]\n\t\t\t\t// (U+0030 to U+0039) and the first character is a `-` (U+002D), […]\n\t\t\t\t(\n\t\t\t\t\tindex === 1 &&\n\t\t\t\t\tcodeUnit >= 0x0030 && codeUnit <= 0x0039 &&\n\t\t\t\t\tfirstCodeUnit === 0x002D\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// http://dev.w3.org/csswg/cssom/#escape-a-character-as-code-point\n\t\t\t\tresult += '\\\\' + codeUnit.toString(16) + ' ';\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If the character is not handled by one of the above rules and is\n\t\t\t// greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or\n\t\t\t// is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to\n\t\t\t// U+005A), or [a-z] (U+0061 to U+007A), […]\n\t\t\tif (\n\t\t\t\tcodeUnit >= 0x0080 ||\n\t\t\t\tcodeUnit === 0x002D ||\n\t\t\t\tcodeUnit === 0x005F ||\n\t\t\t\tcodeUnit >= 0x0030 && codeUnit <= 0x0039 ||\n\t\t\t\tcodeUnit >= 0x0041 && codeUnit <= 0x005A ||\n\t\t\t\tcodeUnit >= 0x0061 && codeUnit <= 0x007A\n\t\t\t) {\n\t\t\t\t// the character itself\n\t\t\t\tresult += string.charAt(index);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Otherwise, the escaped character.\n\t\t\t// http://dev.w3.org/csswg/cssom/#escape-a-character\n\t\t\tresult += '\\\\' + string.charAt(index);\n\n\t\t}\n\n\t\t// Return sanitized hash\n\t\tvar hash;\n\t\ttry {\n\t\t\thash = decodeURIComponent('#' + result);\n\t\t} catch(e) {\n\t\t\thash = '#' + result;\n\t\t}\n\t\treturn hash;\n\n\t};\n\n\t/**\n\t * Calculate the easing pattern\n\t * @link https://gist.github.com/gre/1650294\n\t * @param {String} type Easing pattern\n\t * @param {Number} time Time animation should take to complete\n\t * @returns {Number}\n\t */\n\tvar easingPattern = function (settings, time) {\n\t\tvar pattern;\n\n\t\t// Default Easing Patterns\n\t\tif (settings.easing === 'easeInQuad') pattern = time * time; // accelerating from zero velocity\n\t\tif (settings.easing === 'easeOutQuad') pattern = time * (2 - time); // decelerating to zero velocity\n\t\tif (settings.easing === 'easeInOutQuad') pattern = time < 0.5 ? 2 * time * time : -1 + (4 - 2 * time) * time; // acceleration until halfway, then deceleration\n\t\tif (settings.easing === 'easeInCubic') pattern = time * time * time; // accelerating from zero velocity\n\t\tif (settings.easing === 'easeOutCubic') pattern = (--time) * time * time + 1; // decelerating to zero velocity\n\t\tif (settings.easing === 'easeInOutCubic') pattern = time < 0.5 ? 4 * time * time * time : (time - 1) * (2 * time - 2) * (2 * time - 2) + 1; // acceleration until halfway, then deceleration\n\t\tif (settings.easing === 'easeInQuart') pattern = time * time * time * time; // accelerating from zero velocity\n\t\tif (settings.easing === 'easeOutQuart') pattern = 1 - (--time) * time * time * time; // decelerating to zero velocity\n\t\tif (settings.easing === 'easeInOutQuart') pattern = time < 0.5 ? 8 * time * time * time * time : 1 - 8 * (--time) * time * time * time; // acceleration until halfway, then deceleration\n\t\tif (settings.easing === 'easeInQuint') pattern = time * time * time * time * time; // accelerating from zero velocity\n\t\tif (settings.easing === 'easeOutQuint') pattern = 1 + (--time) * time * time * time * time; // decelerating to zero velocity\n\t\tif (settings.easing === 'easeInOutQuint') pattern = time < 0.5 ? 16 * time * time * time * time * time : 1 + 16 * (--time) * time * time * time * time; // acceleration until halfway, then deceleration\n\n\t\t// Custom Easing Patterns\n\t\tif (!!settings.customEasing) pattern = settings.customEasing(time);\n\n\t\treturn pattern || time; // no easing, no acceleration\n\t};\n\n\t/**\n\t * Determine the document's height\n\t * @returns {Number}\n\t */\n\tvar getDocumentHeight = function () {\n\t\treturn Math.max(\n\t\t\tdocument.body.scrollHeight, document.documentElement.scrollHeight,\n\t\t\tdocument.body.offsetHeight, document.documentElement.offsetHeight,\n\t\t\tdocument.body.clientHeight, document.documentElement.clientHeight\n\t\t);\n\t};\n\n\t/**\n\t * Calculate how far to scroll\n\t * Clip support added by robjtede - https://github.com/cferdinandi/smooth-scroll/issues/405\n\t * @param {Element} anchor       The anchor element to scroll to\n\t * @param {Number}  headerHeight Height of a fixed header, if any\n\t * @param {Number}  offset       Number of pixels by which to offset scroll\n\t * @param {Boolean} clip         If true, adjust scroll distance to prevent abrupt stops near the bottom of the page\n\t * @returns {Number}\n\t */\n\tvar getEndLocation = function (anchor, headerHeight, offset, clip) {\n\t\tvar location = 0;\n\t\tif (anchor.offsetParent) {\n\t\t\tdo {\n\t\t\t\tlocation += anchor.offsetTop;\n\t\t\t\tanchor = anchor.offsetParent;\n\t\t\t} while (anchor);\n\t\t}\n\t\tlocation = Math.max(location - headerHeight - offset, 0);\n\t\tif (clip) {\n\t\t\tlocation = Math.min(location, getDocumentHeight() - window.innerHeight);\n\t\t}\n \t\treturn location;\n\t};\n\n\t/**\n\t * Get the height of the fixed header\n\t * @param  {Node}   header The header\n\t * @return {Number}        The height of the header\n\t */\n\tvar getHeaderHeight = function (header) {\n\t\treturn !header ? 0 : (getHeight(header) + header.offsetTop);\n\t};\n\n\t/**\n\t * Calculate the speed to use for the animation\n\t * @param  {Number} distance The distance to travel\n\t * @param  {Object} settings The plugin settings\n\t * @return {Number}          How fast to animate\n\t */\n\tvar getSpeed = function (distance, settings) {\n\t\tvar speed = settings.speedAsDuration ? settings.speed : Math.abs(distance / 1000 * settings.speed);\n\t\tif (settings.durationMax && speed > settings.durationMax) return settings.durationMax;\n\t\tif (settings.durationMin && speed < settings.durationMin) return settings.durationMin;\n\t\treturn speed;\n\t};\n\n\t/**\n\t * Update the URL\n\t * @param  {Node}    anchor  The anchor that was scrolled to\n\t * @param  {Boolean} isNum   If true, anchor is a number\n\t * @param  {Object}  options Settings for Smooth Scroll\n\t */\n\tvar updateURL = function (anchor, isNum, options) {\n\n\t\t// Bail if the anchor is a number\n\t\tif (isNum) return;\n\n\t\t// Verify that pushState is supported and the updateURL option is enabled\n\t\tif (!history.pushState || !options.updateURL) return;\n\n\t\t// Update URL\n\t\thistory.pushState(\n\t\t\t{\n\t\t\t\tsmoothScroll: JSON.stringify(options),\n\t\t\t\tanchor: anchor.id\n\t\t\t},\n\t\t\tdocument.title,\n\t\t\tanchor === document.documentElement ? '#top' : '#' + anchor.id\n\t\t);\n\n\t};\n\n\t/**\n\t * Bring the anchored element into focus\n\t * @param {Node}     anchor      The anchor element\n\t * @param {Number}   endLocation The end location to scroll to\n\t * @param {Boolean}  isNum       If true, scroll is to a position rather than an element\n\t */\n\tvar adjustFocus = function (anchor, endLocation, isNum) {\n\n\t\t// Is scrolling to top of page, blur\n\t\tif (anchor === 0) {\n\t\t\tdocument.body.focus();\n\t\t}\n\n\t\t// Don't run if scrolling to a number on the page\n\t\tif (isNum) return;\n\n\t\t// Otherwise, bring anchor element into focus\n\t\tanchor.focus();\n\t\tif (document.activeElement !== anchor) {\n\t\t\tanchor.setAttribute('tabindex', '-1');\n\t\t\tanchor.focus();\n\t\t\tanchor.style.outline = 'none';\n\t\t}\n\t\twindow.scrollTo(0 , endLocation);\n\n\t};\n\n\t/**\n\t * Emit a custom event\n\t * @param  {String} type    The event type\n\t * @param  {Object} options The settings object\n\t * @param  {Node}   anchor  The anchor element\n\t * @param  {Node}   toggle  The toggle element\n\t */\n\tvar emitEvent = function (type, options, anchor, toggle) {\n\t\tif (!options.emitEvents || typeof window.CustomEvent !== 'function') return;\n\t\tvar event = new CustomEvent(type, {\n\t\t\tbubbles: true,\n\t\t\tdetail: {\n\t\t\t\tanchor: anchor,\n\t\t\t\ttoggle: toggle\n\t\t\t}\n\t\t});\n\t\tdocument.dispatchEvent(event);\n\t};\n\n\n\t//\n\t// SmoothScroll Constructor\n\t//\n\n\tvar SmoothScroll = function (selector, options) {\n\n\t\t//\n\t\t// Variables\n\t\t//\n\n\t\tvar smoothScroll = {}; // Object for public APIs\n\t\tvar settings, anchor, toggle, fixedHeader, headerHeight, eventTimeout, animationInterval;\n\n\n\t\t//\n\t\t// Methods\n\t\t//\n\n\t\t/**\n\t\t * Cancel a scroll-in-progress\n\t\t */\n\t\tsmoothScroll.cancelScroll = function (noEvent) {\n\t\t\tcancelAnimationFrame(animationInterval);\n\t\t\tanimationInterval = null;\n\t\t\tif (noEvent) return;\n\t\t\temitEvent('scrollCancel', settings);\n\t\t};\n\n\t\t/**\n\t\t * Start/stop the scrolling animation\n\t\t * @param {Node|Number} anchor  The element or position to scroll to\n\t\t * @param {Element}     toggle  The element that toggled the scroll event\n\t\t * @param {Object}      options\n\t\t */\n\t\tsmoothScroll.animateScroll = function (anchor, toggle, options) {\n\n\t\t\t// Local settings\n\t\t\tvar _settings = extend(settings || defaults, options || {}); // Merge user options with defaults\n\n\t\t\t// Selectors and variables\n\t\t\tvar isNum = Object.prototype.toString.call(anchor) === '[object Number]' ? true : false;\n\t\t\tvar anchorElem = isNum || !anchor.tagName ? null : anchor;\n\t\t\tif (!isNum && !anchorElem) return;\n\t\t\tvar startLocation = window.pageYOffset; // Current location on the page\n\t\t\tif (_settings.header && !fixedHeader) {\n\t\t\t\t// Get the fixed header if not already set\n\t\t\t\tfixedHeader = document.querySelector(_settings.header);\n\t\t\t}\n\t\t\tif (!headerHeight) {\n\t\t\t\t// Get the height of a fixed header if one exists and not already set\n\t\t\t\theaderHeight = getHeaderHeight(fixedHeader);\n\t\t\t}\n\t\t\tvar endLocation = isNum ? anchor : getEndLocation(anchorElem, headerHeight, parseInt((typeof _settings.offset === 'function' ? _settings.offset(anchor, toggle) : _settings.offset), 10), _settings.clip); // Location to scroll to\n\t\t\tvar distance = endLocation - startLocation; // distance to travel\n\t\t\tvar documentHeight = getDocumentHeight();\n\t\t\tvar timeLapsed = 0;\n\t\t\tvar speed = getSpeed(distance, _settings);\n\t\t\tvar start, percentage, position;\n\n\t\t\t/**\n\t\t\t * Stop the scroll animation when it reaches its target (or the bottom/top of page)\n\t\t\t * @param {Number} position Current position on the page\n\t\t\t * @param {Number} endLocation Scroll to location\n\t\t\t * @param {Number} animationInterval How much to scroll on this loop\n\t\t\t */\n\t\t\tvar stopAnimateScroll = function (position, endLocation) {\n\n\t\t\t\t// Get the current location\n\t\t\t\tvar currentLocation = window.pageYOffset;\n\n\t\t\t\t// Check if the end location has been reached yet (or we've hit the end of the document)\n\t\t\t\tif (position == endLocation || currentLocation == endLocation || ((startLocation < endLocation && window.innerHeight + currentLocation) >= documentHeight)) {\n\n\t\t\t\t\t// Clear the animation timer\n\t\t\t\t\tsmoothScroll.cancelScroll(true);\n\n\t\t\t\t\t// Bring the anchored element into focus\n\t\t\t\t\tadjustFocus(anchor, endLocation, isNum);\n\n\t\t\t\t\t// Emit a custom event\n\t\t\t\t\temitEvent('scrollStop', _settings, anchor, toggle);\n\n\t\t\t\t\t// Reset start\n\t\t\t\t\tstart = null;\n\t\t\t\t\tanimationInterval = null;\n\n\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Loop scrolling animation\n\t\t\t */\n\t\t\tvar loopAnimateScroll = function (timestamp) {\n\t\t\t\tif (!start) { start = timestamp; }\n\t\t\t\ttimeLapsed += timestamp - start;\n\t\t\t\tpercentage = (timeLapsed / parseInt(speed, 10));\n\t\t\t\tpercentage = (percentage > 1) ? 1 : percentage;\n\t\t\t\tposition = startLocation + (distance * easingPattern(_settings, percentage));\n\t\t\t\twindow.scrollTo(0, Math.floor(position));\n\t\t\t\tif (!stopAnimateScroll(position, endLocation)) {\n\t\t\t\t\tanimationInterval = window.requestAnimationFrame(loopAnimateScroll);\n\t\t\t\t\tstart = timestamp;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Reset position to fix weird iOS bug\n\t\t\t * @link https://github.com/cferdinandi/smooth-scroll/issues/45\n\t\t\t */\n\t\t\tif (window.pageYOffset === 0) {\n\t\t\t\twindow.scrollTo(0, 0);\n\t\t\t}\n\n\t\t\t// Update the URL\n\t\t\tupdateURL(anchor, isNum, _settings);\n\n\t\t\t// Emit a custom event\n\t\t\temitEvent('scrollStart', _settings, anchor, toggle);\n\n\t\t\t// Start scrolling animation\n\t\t\tsmoothScroll.cancelScroll(true);\n\t\t\twindow.requestAnimationFrame(loopAnimateScroll);\n\n\t\t};\n\n\t\t/**\n\t\t * If smooth scroll element clicked, animate scroll\n\t\t */\n\t\tvar clickHandler = function (event) {\n\n\t\t\t// Don't run if the user prefers reduced motion\n\t\t\tif (reduceMotion(settings)) return;\n\n\t\t\t// Don't run if right-click or command/control + click\n\t\t\tif (event.button !== 0 || event.metaKey || event.ctrlKey) return;\n\n\t\t\t// Check if event.target has closest() method\n\t\t\t// By @totegi - https://github.com/cferdinandi/smooth-scroll/pull/401/\n\t\t\tif(!('closest' in event.target))return;\n\n\t\t\t// Check if a smooth scroll link was clicked\n\t\t\ttoggle = event.target.closest(selector);\n\t\t\tif (!toggle || toggle.tagName.toLowerCase() !== 'a' || event.target.closest(settings.ignore)) return;\n\n\t\t\t// Only run if link is an anchor and points to the current page\n\t\t\tif (toggle.hostname !== window.location.hostname || toggle.pathname !== window.location.pathname || !/#/.test(toggle.href)) return;\n\n\t\t\t// Get an escaped version of the hash\n\t\t\tvar hash = escapeCharacters(decode(toggle.hash));\n\n\t\t\t// Get the anchored element\n\t\t\tvar anchor = settings.topOnEmptyHash && hash === '#' ? document.documentElement : document.querySelector(hash);\n\t\t\tanchor = !anchor && hash === '#top' ? document.documentElement : anchor;\n\n\t\t\t// If anchored element exists, scroll to it\n\t\t\tif (!anchor) return;\n\t\t\tevent.preventDefault();\n\t\t\tsmoothScroll.animateScroll(anchor, toggle);\n\n\t\t};\n\n\t\t/**\n\t\t * Animate scroll on popstate events\n\t\t */\n\t\tvar popstateHandler = function (event) {\n\n\t\t\t// Stop if history.state doesn't exist (ex. if clicking on a broken anchor link).\n\t\t\t// fixes `Cannot read property 'smoothScroll' of null` error getting thrown.\n\t\t\tif (history.state === null) return;\n\n\t\t\t// Only run if state is a popstate record for this instantiation\n\t\t\tif (!history.state.smoothScroll || history.state.smoothScroll !== JSON.stringify(settings)) return;\n\n\t\t\t// Only run if state includes an anchor\n\t\t\tif (!history.state.anchor) return;\n\n\t\t\t// Get the anchor\n\t\t\tvar anchor = document.querySelector(escapeCharacters(decode(history.state.anchor)));\n\t\t\tif (!anchor) return;\n\n\t\t\t// Animate scroll to anchor link\n\t\t\tsmoothScroll.animateScroll(anchor, null, {updateURL: false});\n\n\t\t};\n\n\t\t/**\n\t\t * On window scroll and resize, only run events at a rate of 15fps for better performance\n\t\t */\n\t\tvar resizeThrottler = function (event) {\n\t\t\tif (!eventTimeout) {\n\t\t\t\teventTimeout = setTimeout((function() {\n\t\t\t\t\teventTimeout = null; // Reset timeout\n\t\t\t\t\theaderHeight = getHeaderHeight(fixedHeader); // Get the height of a fixed header if one exists\n\t\t\t\t}), 66);\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * Destroy the current initialization.\n\t\t */\n\t\tsmoothScroll.destroy = function () {\n\n\t\t\t// If plugin isn't already initialized, stop\n\t\t\tif (!settings) return;\n\n\t\t\t// Remove event listeners\n\t\t\tdocument.removeEventListener('click', clickHandler, false);\n\t\t\twindow.removeEventListener('resize', resizeThrottler, false);\n\t\t\twindow.removeEventListener('popstate', popstateHandler, false);\n\n\t\t\t// Cancel any scrolls-in-progress\n\t\t\tsmoothScroll.cancelScroll();\n\n\t\t\t// Reset variables\n\t\t\tsettings = null;\n\t\t\tanchor = null;\n\t\t\ttoggle = null;\n\t\t\tfixedHeader = null;\n\t\t\theaderHeight = null;\n\t\t\teventTimeout = null;\n\t\t\tanimationInterval = null;\n\n\t\t};\n\n\t\t/**\n\t\t * Initialize Smooth Scroll\n\t\t * @param {Object} options User settings\n\t\t */\n\t\tsmoothScroll.init = function (options) {\n\n\t\t\t// feature test\n\t\t\tif (!supports()) throw 'Smooth Scroll: This browser does not support the required JavaScript methods and browser APIs.';\n\n\t\t\t// Destroy any existing initializations\n\t\t\tsmoothScroll.destroy();\n\n\t\t\t// Selectors and variables\n\t\t\tsettings = extend(defaults, options || {}); // Merge user options with defaults\n\t\t\tfixedHeader = settings.header ? document.querySelector(settings.header) : null; // Get the fixed header\n\t\t\theaderHeight = getHeaderHeight(fixedHeader);\n\n\t\t\t// When a toggle is clicked, run the click handler\n\t\t\tdocument.addEventListener('click', clickHandler, false);\n\n\t\t\t// If window is resized and there's a fixed header, recalculate its size\n\t\t\tif (fixedHeader) {\n\t\t\t\twindow.addEventListener('resize', resizeThrottler, false);\n\t\t\t}\n\n\t\t\t// If updateURL and popState are enabled, listen for pop events\n\t\t\tif (settings.updateURL && settings.popstate) {\n\t\t\t\twindow.addEventListener('popstate', popstateHandler, false);\n\t\t\t}\n\n\t\t};\n\n\n\t\t//\n\t\t// Initialize plugin\n\t\t//\n\n\t\tsmoothScroll.init(options);\n\n\n\t\t//\n\t\t// Public APIs\n\t\t//\n\n\t\treturn smoothScroll;\n\n\t};\n\n\treturn SmoothScroll;\n\n}));\n","import SmoothScroll from './smooth-scroll.js'\n\nvar scroll = new SmoothScroll('nav a[href*=\"#\"]');\n"]}