/*!
 * sticky-state 2.4.1 - StickyState is a high performant module making native position:sticky statefull and polyfill the missing sticky browser feature
 * Copyright (c) 2016 Sönke Kluth <soenke.kluth@gmail.com> (http://soenkekluth.com/) - https://github.com/soenkekluth/sticky-state#readme
 * License: MIT
 */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.StickyState=e():t.StickyState=e()}(this,function(){return function(t){function e(s){if(i[s])return i[s].exports;var n=i[s]={exports:{},id:s,loaded:!1};return t[s].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){t.exports=i(2)},function(t,e){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t){return!t||0===Object.keys(t).length}Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=e.target,n=e.currentTarget;i(this,t),this.target=s||this,this.currentTarget=n||this,this.eventMap={},this.destroyed=!1,this.on=this.bind=this.addEventListener=this.addListener,this.off=this.unbind=this.removeEventListener=this.removeListener,this.once=this.one=this.addListenerOnce,this.emit=this.trigger=this.dispatchEvent=this.dispatch}return t.prototype.addListener=function(t,e){var i=this.getListener(t);return i?i.indexOf(e)===-1&&i.push(e):this.eventMap[t]=[e],this},t.prototype.addListenerOnce=function(t,e){var i=this,s=function s(n){e(n),i.off(t,s)};return this.on(t,s)},t.prototype.removeListener=function(t,e){if(!e)return this.removeAllListener(t);var i=this.getListener(t);if(i){var s=i.indexOf(e);s>-1&&(i.splice(s,1),i.length||delete this.eventMap[t])}return this},t.prototype.removeAllListener=function(t){var e=this.getListener(t);return e&&(this.eventMap[t].length=0,delete this.eventMap[t]),this},t.prototype.hasListener=function(t){return null!==this.getListener(t)},t.prototype.hasListeners=function(){return null!==this.eventMap&&void 0!==this.eventMap&&!s(this.eventMap)},t.prototype.dispatch=function(t,e){var i=this.getListener(t);if(i){var s=e||{};s.type=t,s.target=s.target||this.target,s.currentTarget=s.currentTarget||this.currentTarget;for(var n=-1;++n<i.length;)i[n](s)}return this},t.prototype.getListener=function(t){var e=this.eventMap?this.eventMap[t]:null;return e||null},t.prototype.destroy=function(){if(this.eventMap)for(var t=Object.keys(this.eventMap),e=0;e<t.length;e++)this.removeAllListener(t[e]);return this.eventMap=null,this.destroyed=!0,this},t}();e.default=n,t.exports=e.default},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}return function(e,i,s){return i&&t(e.prototype,i),s&&t(e,s),e}}(),a=i(4),c=s(a),h=i(3),u=s(h),d=i(1),p=s(d),f=i(7),g=s(f),y={disabled:!1,className:"sticky",stateClassName:"is-sticky",fixedClass:"sticky-fixed",wrapperClass:"sticky-wrap",wrapFixedSticky:!0,absoluteClass:"is-absolute",scrollClass:{down:null,up:null,none:null,persist:!1,active:!1}},m={sticky:!1,absolute:!1,fixedOffset:"",offsetHeight:0,bounds:{top:null,left:null,right:null,bottom:null,height:null,width:null},restrict:{top:null,left:null,right:null,bottom:null,height:null,width:null},wrapperStyle:null,elementStyle:null,initialStyle:null,style:{top:null,bottom:null,left:null,right:null,"margin-top":0,"margin-bottom":0,"margin-left":0,"margin-right":0},disabled:!1},w=function(t,e){var i=t.getBoundingClientRect(),s=i.top+g.default.windowY,n=e||i.height;return{top:s,bottom:s+n,height:n,width:i.width,left:i.left,right:i.right}},v=function(t,e){var i=(0,c.default)({},t);return i.top-=e.top,i.left-=e.left,i.right=i.left+t.width,i.bottom=i.top+t.height,i},S=function(t){var e={},i=window.getComputedStyle(t,null);for(var s in m.style){var n=parseInt(i.getPropertyValue(s));n=isNaN(n)?null:n,e[s]=n}return e},b=function t(e){var i=e.previousElementSibling;return i&&"script"===i.tagName.toLocaleLowerCase()&&(i=t(i)),i},_=function(t){function e(i,s){n(this,e);var r;i instanceof window.NodeList&&(r=[].slice.call(i,1),i=i[0]);var l=o(this,t.call(this,{target:i}));if(l.el=null,l.firstRender=!0,l.scroll=null,l.wrapper=null,l.options=null,l.el=i,s&&s.scrollClass&&(s.scrollClass=(0,c.default)({},y.scrollClass,s.scrollClass,{active:!0})),l.options=(0,c.default)({},y,s),l.setState((0,c.default)({},m,{disabled:l.options.disabled}),!0),l.scrollTarget=g.default.getScrollParent(l.el),l.hasOwnScrollTarget=l.scrollTarget!==window,l.hasOwnScrollTarget&&(l.updateFixedOffset=l.updateFixedOffset.bind(l)),l.render=l.render.bind(l),l.addSrollHandler(),l.addResizeHandler(),l.render(),r&&r.length){var a,h=e.apply(r,s);return h.push(l),a=h,o(l,a)}return l}return r(e,t),e.apply=function(t,i){if(t&&t.length){for(var s=new L,n=0;n<t.length;n++)s.push(new e(t[n],i));return s}return new e(t,i)},e.prototype.setState=function(t,e){this.lastState=this.state||t,this.state=(0,c.default)({},this.state,t),e!==!0&&(this.render(),this.trigger(this.state.sticky?"sticky:on":"sticky:off"))},e.prototype.disable=function(t){this.setState({disabled:t},t)},e.prototype.getBoundingClientRect=function(){return this.el.getBoundingClientRect()},e.prototype.getBounds=function(t){var e=this.getBoundingClientRect(),i=g.default.documentHeight;if(t=t===!0,t!==!0&&null!==this.state.bounds.height&&this.state.offsetHeight===i&&e.height===this.state.bounds.height)return{offsetHeight:i,style:this.state.style,bounds:this.state.bounds,restrict:this.state.restrict};var s=this.state.initialStyle;s||(s=S(this.el));var n,o,r=s,l=this.wrapper||this.el,a=0;if(x.sticky){var c=b(l);a=0,c?(a=parseInt(window.getComputedStyle(c)["margin-bottom"]),a=a||0,n=w(c),this.hasOwnScrollTarget&&(n=v(n,w(this.scrollTarget)),a+=this.scroll.y),n.top=n.bottom+a):(c=l.parentNode,a=parseInt(window.getComputedStyle(c)["padding-top"]),a=a||0,n=w(c),this.hasOwnScrollTarget&&(n=v(n,w(this.scrollTarget)),a+=this.scroll.y),n.top=n.top+a),this.hasOwnScrollTarget&&(o=w(this.scrollTarget),o.top=0,o.height=this.scroll.scrollHeight||o.height,o.bottom=o.height),n.height=l.clientHeight,n.width=l.clientWidth,n.bottom=n.top+n.height}else if(n=w(l,e.height),this.hasOwnScrollTarget){var h=w(this.scrollTarget);a=this.scroll.y,n=v(n,h),o=h,o.top=0,o.height=this.scroll.scrollHeight||o.height,o.bottom=o.height}return o=o||w(l.parentNode),{offsetHeight:i,style:r,bounds:n,initialStyle:s,restrict:o}},e.prototype.updateBounds=function(t,e){t=t===!0,e=e===!0,this.setState(this.getBounds(e),t)},e.prototype.updateFixedOffset=function(){this.lastState.fixedOffset=this.state.fixedOffset,this.state.sticky?this.state.fixedOffset=this.scrollTarget.getBoundingClientRect().top+"px;":this.state.fixedOffset="",this.lastState.fixedOffset!==this.state.fixedOffset&&this.render()},e.prototype.addSrollHandler=function(){if(!this.scroll){var t=g.default.hasInstance(this.scrollTarget);this.scroll=g.default.getInstance(this.scrollTarget),this.onScroll=this.onScroll.bind(this),this.scroll.on("scroll:start",this.onScroll),this.scroll.on("scroll:progress",this.onScroll),this.scroll.on("scroll:stop",this.onScroll),this.options.scrollClass.active&&(this.onScrollDirection=this.onScrollDirection.bind(this),this.scroll.on("scroll:up",this.onScrollDirection),this.scroll.on("scroll:down",this.onScrollDirection),this.options.scrollClass.persist||this.scroll.on("scroll:stop",this.onScrollDirection)),t&&this.scroll.scrollY>0&&this.scroll.trigger("scroll:progress")}},e.prototype.removeSrollHandler=function(){this.scroll&&(this.scroll.off("scroll:start",this.onScroll),this.scroll.off("scroll:progress",this.onScroll),this.scroll.off("scroll:stop",this.onScroll),this.options.scrollClass.active&&(this.scroll.off("scroll:up",this.onScrollDirection),this.scroll.off("scroll:down",this.onScrollDirection),this.scroll.off("scroll:stop",this.onScrollDirection)),this.scroll.hasListeners()||this.scroll.destroy(),this.onScroll=null,this.onScrollDirection=null,this.scroll=null)},e.prototype.addResizeHandler=function(){this.onResize||(this.onResize=this.update.bind(this),window.addEventListener("sticky:update",this.onResize,!1),window.addEventListener("resize",this.onResize,!1),window.addEventListener("orientationchange",this.onResize,!1))},e.prototype.removeResizeHandler=function(){this.onResize&&(window.removeEventListener("sticky:update",this.onResize),window.removeEventListener("resize",this.onResize),window.removeEventListener("orientationchange",this.onResize),this.onResize=null)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.removeSrollHandler(),this.removeResizeHandler(),this.render=null,this.el=null,this.state=null,this.wrapper=null},e.prototype.getScrollClasses=function(t){if(this.options.scrollClass.active){t=t||{};var e=this.scroll.y<=0||this.scroll.y+this.scroll.clientHeight>=this.scroll.scrollHeight?0:this.scroll.directionY;t[this.options.scrollClass.up]=e<0,t[this.options.scrollClass.down]=e>0}return t},e.prototype.onScrollDirection=function(t){(this.state.sticky||t.type===g.default.events.SCROLL_STOP)&&(this.el.className=(0,u.default)(this.el.className,this.getScrollClasses()))},e.prototype.onScroll=function(t){this.updateStickyState(!1),this.hasOwnScrollTarget&&!x.sticky&&(this.updateFixedOffset(),this.state.sticky&&!this.hasWindowScrollListener?(this.hasWindowScrollListener=!0,g.default.getInstance(window).on("scroll:progress",this.updateFixedOffset)):!this.state.sticky&&this.hasWindowScrollListener&&(this.hasWindowScrollListener=!1,g.default.getInstance(window).off("scroll:progress",this.updateFixedOffset)))},e.prototype.update=function(){this.scroll.updateScrollPosition(),this.updateBounds(!0,!0),this.updateStickyState(!1)},e.prototype.getStickyState=function(){if(this.state.disabled)return{sticky:!1,absolute:!1};var t=this.scroll.y,e=(this.scroll.x,this.state.style.top),i=this.state.style.bottom,s=this.state.sticky,n=this.state.absolute;if(null!==e){var o=this.state.restrict.bottom-this.state.bounds.height-e;e=this.state.bounds.top-e,this.state.sticky===!1&&(t>=e&&t<=o||e<=0&&t<e)?(s=!0,n=!1):this.state.sticky&&(e>0&&t<e||t>o)&&(s=!1,n=t>o)}else if(null!==i){t+=window.innerHeight;var r=this.state.restrict.top+this.state.bounds.height-i;i=this.state.bounds.bottom+i,this.state.sticky===!1&&t<=i&&t>=r?(s=!0,n=!1):this.state.sticky&&(t>i||t<r)&&(s=!1,n=t<=r)}return{sticky:s,absolute:n}},e.prototype.updateStickyState=function(t){var e=this.getStickyState();e.sticky===this.state.sticky&&e.absolute===this.state.absolute||(t=t===!0,e=(0,c.default)(e,this.getBounds()),this.setState(e,t))},e.prototype.render=function(){if(!this.state.disabled){var t={};if(this.firstRender){if(this.firstRender=!1,!x.sticky){this.wrapper=document.createElement("div"),this.wrapper.className=this.options.wrapperClass;var e=this.el.parentNode;e&&e.insertBefore(this.wrapper,this.el),this.options.wrapFixedSticky&&this.wrapper.appendChild(this.el),t[this.options.fixedClass]=!0}this.updateBounds(!0,!0),this.updateStickyState(!0)}if(!x.sticky){var i="",s=this.state.disabled||null===this.state.bounds.height||!this.state.sticky&&!this.state.absolute?"auto;":this.state.bounds.height+"px;",n="height:"+s;n+="auto;"===s?"":(this.state.style["margin-top"]?"margin-top:"+this.state.style["margin-top"]+"px;":"0;")+(this.state.style["margin-bottom"]?"margin-bottom"+this.state.style["margin-bottom"]+"px;":"0;"),this.state.absolute!==this.lastState.absolute&&(n+=this.state.absolute?"position:relative;":"",t[this.options.absoluteClass]=this.state.absolute,i+=this.state.absolute?null!==this.state.style.top?"margin-top:"+(this.state.restrict.height-(this.state.bounds.height+this.state.style.top)+(this.state.restrict.top-this.state.bounds.top))+"px;":"margin-top:0;"+(null!==this.state.style.bottom?"margin-bottom:"+(this.state.restrict.height-(this.state.bounds.height+this.state.style.bottom)+(this.state.restrict.bottom-this.state.bounds.bottom))+"px;":"margin-bottom:0;"):"margin-bottom:0;margin-top:0;"),null===this.state.style.top&&null===this.state.style.bottom||!this.hasOwnScrollTarget||this.state.absolute||this.lastState.fixedOffset===this.state.fixedOffset||(i+="margin-top:"+(this.state.fixedOffset?this.state.fixedOffset:"0;")),this.state.wrapperStyle!==n&&(this.state.wrapperStyle=n,this.wrapper.style.cssText+=n),this.state.elementStyle!==i&&(this.state.elementStyle=i,this.el.style.cssText+=i)}t[this.options.stateClassName]=this.state.sticky,t=this.getScrollClasses(t);var o=(0,u.default)(this.el.className,t);return this.el.className!==o&&(this.el.className=o),this.el}},l(e,null,[{key:"native",get:function(){return x.sticky}}]),e}(p.default),O=null,x=function(){function t(){n(this,t)}return l(t,null,[{key:"sticky",get:function(){if(null!==O)return O;if("undefined"!=typeof window){if(window.Modernizr&&window.Modernizr.hasOwnProperty("csspositionsticky"))return O=window.Modernizr.csspositionsticky;var t=document.documentElement,e=document.createElement("div");t.appendChild(e);var i=["sticky","-webkit-sticky"];O=!1;for(var s=0;s<i.length&&(e.style.position=i[s],!(O=!!window.getComputedStyle(e).position.match("sticky")));s++);t.removeChild(e)}return O}}]),t}(),L=function(t){function e(){n(this,e);var i=o(this,t.call(this));return i.items=[],i}return r(e,t),e.prototype.push=function(t){this.items.push(t)},e.prototype.update=function(){for(var t=-1;++t<this.items.length;)this.items[t].update()},e.prototype.addListener=function(t,e){for(var i=-1;++i<this.items.length;)this.items[i].addListener(t,e);return this},e.prototype.removeListener=function(t,e){for(var i=-1;++i<this.items.length;)this.items[i].removeListener(t,e);return this},e}(p.default);e.default=_,t.exports=e.default},function(t,e){function i(){for(var t,e,s=[],o=-1;++o<arguments.length;)if(arguments[o])if(t=arguments[o],e=typeof t,"string"===e||"number"===e)s.push(t);else if(Array.isArray(t)){var r=i.apply(null,t);s=s.length?s.join(" ").split(" "):s;for(var l=-1;++l<r.length;)s.indexOf(r[l])===-1&&s.push(r[l])}else if("object"===e){var a=s.length;s=a?s.join(" ").split(" "):s;for(var c in t)if(n.call(t,c)){var h=a?s.indexOf(c):-1;t[c]?h<0&&(s.push(c),++a):h>-1&&s.splice(h,1)}}return s}function s(){return i.apply(null,arguments).join(" ")}var n={}.hasOwnProperty;t.exports=s},function(t,e){"use strict";function i(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function s(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},i=0;i<10;i++)e["_"+String.fromCharCode(i)]=i;var s=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"!==s.join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}var n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;t.exports=s()?Object.assign:function(t,e){for(var s,r,l=i(t),a=1;a<arguments.length;a++){s=Object(arguments[a]);for(var c in s)n.call(s,c)&&(l[c]=s[c]);if(Object.getOwnPropertySymbols){r=Object.getOwnPropertySymbols(s);for(var h=0;h<r.length;h++)o.call(s,r[h])&&(l[r[h]]=s[r[h]])}}return l}},function(t,e){"use strict";var i=/(auto|scroll)/,s=function(t){var e=window.getComputedStyle(t,null);return i.test(e.getPropertyValue("overflow")+e.getPropertyValue("overflow-y")+e.getPropertyValue("overflow-x"))};t.exports=s},function(t,e,i){"use strict";var s=i(5),n=function(t){if(!(t instanceof HTMLElement))return window;for(;t.parentNode;){if(t.parentNode===document.body)return window;if(s(t.parentNode))return t.parentNode;t=t.parentNode}return window};t.exports=n},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}return function(e,i,s){return i&&t(e.prototype,i),s&&t(e,s),e}}(),a=i(1),c=s(a),h=i(6),u=s(h),d=function(){window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,window.cancelAnimationFrame=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame)},p=function(t){function e(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n(this,e),e.hasInstance(i)){var r;return r=e.getInstance(i),o(l,r)}var l=o(this,t.call(this,{target:i}));return l._scrollTarget=null,l._y=0,l._x=0,l._speedY=0,l._speedX=0,l._lastSpeed=0,l._lastDirectionY=e.direction.none,l._lastDirectionX=e.direction.none,l._stopFrames=3,l._currentStopFrames=0,l._firstRender=!0,l._directionY=e.direction.none,l._directionX=e.direction.none,l._scrolling=!1,l._canScrollY=!1,l._canScrollX=!1,i.scrollFeatures=l,l._scrollTarget=i,l.options=s,g.animationFrame&&d(),l.init(),l}return r(e,t),e.getInstance=function(t,i){return t.scrollFeatures?t.scrollFeatures:new e(t,i)},e.hasInstance=function(t){return"undefined"!=typeof t.scrollFeatures},e.getScrollParent=function(t){return(0,u.default)(t)},l(e,null,[{key:"windowY",get:function(){return window.pageYOffset||window.scrollY||0}},{key:"windowX",get:function(){return window.pageXOffset||window.scrollX||0}},{key:"documentHeight",get:function(){return Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)}},{key:"documentWidth",get:function(){return Math.max(document.body.scrollWidth,document.body.offsetWidth,document.documentElement.clientWidth,document.documentElement.scrollWidth,document.documentElement.offsetWidth)}}]),e.prototype.init=function(){var t=this;if(this.getScrollPosition=this._scrollTarget===window?function(){return{y:e.windowY,x:e.windowX}}.bind(this):function(){return{y:this._scrollTarget.scrollTop,x:this._scrollTarget.scrollLeft}}.bind(this),this.onResize=function(){t.trigger(e.events.SCROLL_RESIZE)},this.onScroll=this.onScroll.bind(this),this.onNextFrame=this.onNextFrame.bind(this),this.updateScrollPosition(),this._scrollTarget!==window){var i=/(auto|scroll)/,s=window.getComputedStyle(this._scrollTarget,null);this._canScrollY=i.test(s.getPropertyValue("overflow-y")),this._canScrollX=i.test(s.getPropertyValue("overflow-x"))}else this._canScrollY=this.clientHeight<this.scrollHeight,this._canScrollX=this.clientWidth<this.scrollWidth;this._scrollTarget.addEventListener?(this._scrollTarget.addEventListener("scroll",this.onScroll,!1),this._scrollTarget.addEventListener("resize",this.onResize,!1)):this._scrollTarget.attachEvent&&(this._scrollTarget.attachEvent("scroll",this.onScroll),this._scrollTarget.attachEvent("resize",this.onResize))},e.prototype.destroy=function(){this._cancelNextFrame(),t.prototype.destroy.call(this),this._scrollTarget&&(this._scrollTarget.addEventListener?(this._scrollTarget.removeEventListener("scroll",this.onScroll),this._scrollTarget.removeEventListener("resize",this.onResize)):this._scrollTarget.attachEvent&&(this._scrollTarget.detachEvent("scroll",this.onScroll),this._scrollTarget.detachEvent("resize",this.onResize))),this.onResize=null,this.onScroll=null,this.getScrollPosition=null,this.onNextFrame=null,delete this._scrollTarget.scrollFeatures,this._scrollTarget=null},e.prototype.updateScrollPosition=function(){this._y=this.y,this._x=this.x},e.prototype.onScroll=function(){return this._currentStopFrames=0,this._firstRender&&(this._firstRender=!1,this.y>1||this.x>1)?(this.updateScrollPosition(),void this.trigger(e.events.SCROLL_PROGRESS)):void(this._scrolling||(this._scrolling=!0,this._lastDirectionY=e.direction.none,this._lastDirectionX=e.direction.none,this.trigger(e.events.SCROLL_START),g.animationFrame?this.nextFrameID=window.requestAnimationFrame(this.onNextFrame):this.onNextFrame()))},e.prototype.onNextFrame=function(){var t=this;this._speedY=this._y-this.y,this._speedX=this._x-this.x;var i=+this.speedY+ +this.speedX;return this._scrolling&&0===i&&this._currentStopFrames++>this._stopFrames?void this.onScrollStop():(this.updateScrollPosition(),this._lastDirectionY!==this.directionY&&this.trigger("scroll:"+(this.directionY===e.direction.down?"down":"up")),this._lastDirectionX!==this.directionX&&this.trigger("scroll:"+(this.directionX===e.direction.right?"right":"left")),this._lastDirectionY=this.directionY,this._lastDirectionX=this.directionX,this.trigger(e.events.SCROLL_PROGRESS),void(g.animationFrame?this.nextFrameID=window.requestAnimationFrame(this.onNextFrame):this._nextTimeout=setTimeout(function(){t.onNextFrame()},1e3/60)))},e.prototype.onScrollStop=function(){this._scrolling=!1,this.updateScrollPosition(),this.trigger(e.events.SCROLL_STOP),this._canScrollY&&(this.y<=0?this.trigger(e.events.SCROLL_MIN):this.y+this.clientHeight>=this.scrollHeight&&this.trigger(e.events.SCROLL_MAX)),this._canScrollX&&(this.x<=0?this.trigger(e.events.SCROLL_MIN):this.x+this.clientWidth>=this.scrollWidth&&this.trigger(e.events.SCROLL_MAX)),this._cancelNextFrame()},e.prototype._cancelNextFrame=function(){this._currentStopFrames=0,g.animationFrame?(window.cancelAnimationFrame(this.nextFrameID),this.nextFrameID=-1):clearTimeout(this._nextTimeout)},l(e,[{key:"scrollPosition",get:function(){return this.getScrollPosition()}},{key:"directionY",get:function(){return!this._canScrollY||0===this.speedY&&!this._scrolling?this._directionY=e.direction.none:this.speedY>0?this._directionY=e.direction.up:this.speedY<0&&(this._directionY=e.direction.down),this._directionY}},{key:"directionX",get:function(){return!this._canScrollX||0===this.speedX&&!this._scrolling?this._directionX=e.direction.none:this.speedX>0?this._directionX=e.direction.left:this.speedX<0&&(this._directionX=e.direction.right),this._directionX}},{key:"scrollTarget",get:function(){return this._scrollTarget}},{key:"scrolling",get:function(){return this._scrolling}},{key:"speedY",get:function(){return this._speedY}},{key:"speedX",get:function(){return this._speedX}},{key:"canScrollY",get:function(){return this._canScrollY}},{key:"canScrollX",get:function(){return this._canScrollX}},{key:"y",get:function(){return this.scrollPosition.y}},{key:"x",get:function(){return this.scrollPosition.x}},{key:"clientHeight",get:function(){return this._scrollTarget===window?window.innerHeight:this._scrollTarget.clientHeight}},{key:"clientWidth",get:function(){return this._scrollTarget===window?window.innerWidth:this._scrollTarget.clientWidth}},{key:"scrollHeight",get:function(){return this._scrollTarget===window?e.documentHeight:this._scrollTarget.scrollHeight}},{key:"scrollWidth",get:function(){return this._scrollTarget===window?e.documentWidth:this._scrollTarget.scrollWidth}}]),e}(c.default);p.direction={up:-1,down:1,none:0,right:2,left:-2},p.events={SCROLL_PROGRESS:"scroll:progress",SCROLL_START:"scroll:start",SCROLL_STOP:"scroll:stop",SCROLL_DOWN:"scroll:down",SCROLL_UP:"scroll:up",SCROLL_MIN:"scroll:min",SCROLL_MAX:"scroll:max",SCROLL_RESIZE:"scroll:resize"},e.default=p;var f=null,g=function(){function t(){n(this,t)}return l(t,null,[{key:"animationFrame",get:function(){return null===f&&(f=!!(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame)),f}}]),t}();t.exports=e.default}])});