var autoScroll=function(){"use strict";function e(e,n){var t,r;return r=n,"function"==typeof(e=void 0===(t=e)?void 0===r?t:r:t)?function(){for(var n=arguments,t=arguments.length,r=Array(t),o=0;o0?1:-1)*Math.floor(Math.abs(n)):n}(e);return Math.min(Math.max(n,0),t)},o=function(e){var n=e.next();return!Boolean(n.done)&&n},function(e){var t,i,a,u=this,c=arguments.length>1?arguments[1]:void 0;if(void 0!==c){if(!n(c))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(t=arguments[2])}var l=function(e,t){if(null!=e&&null!=t){var r=e[t];if(null==r)return;if(!n(r))throw new TypeError(r+" is not a function");return r}}(e,function(e){if(null!=e){if(["string","number","boolean","symbol"].indexOf(typeof e)>-1)return Symbol.iterator;if("undefined"!=typeof Symbol&&"iterator"in Symbol&&Symbol.iterator in e)return Symbol.iterator;if("@@iterator"in e)return"@@iterator"}}(e));if(void 0!==l){i=n(u)?Object(new u):[];var f,d,s=l.call(e);if(null==s)throw new TypeError("Array.from requires an array-like or iterable object");for(a=0;;){if(!(f=o(s)))return i.length=a,i;d=f.value,i[a]=c?c.call(t,d,a):d,a++}}else{var m=Object(e);if(null==e)throw new TypeError("Array.from requires an array-like object - not null or undefined");var v,w=r(m.length);for(i=n(u)?Object(new u(w)):new Array(w),a=0;a0;)t[r]=n[r+1];return function(e,n){for(var t=0;t0;)t[r]=n[r+1];return t.map(w).reduce((function(n,t){var r=d(e,t);return-1!==r?n.concat(e.splice(r,1)):n}),[])}function w(e,n){if("string"==typeof e)try{return document.querySelector(e)}catch(e){throw e}if(!f(e)&&!n)throw new TypeError(e+" is not a DOM element.");return e}function p(e){if(e===window)return function(){var e={top:{value:0,enumerable:!0},left:{value:0,enumerable:!0},right:{value:window.innerWidth,enumerable:!0},bottom:{value:window.innerHeight,enumerable:!0},width:{value:window.innerWidth,enumerable:!0},height:{value:window.innerHeight,enumerable:!0},x:{value:0,enumerable:!0},y:{value:0,enumerable:!0}};if(Object.create)return Object.create({},e);var n={};return Object.defineProperties(n,e),n}();try{var n=e.getBoundingClientRect();return void 0===n.x&&(n.x=n.left,n.y=n.top),n}catch(n){throw new TypeError("Can't call getBoundingClientRect on "+e)}}var h,g=void 0;"function"!=typeof Object.create?(h=function(){},g=function(e,n){if(e!==Object(e)&&null!==e)throw TypeError("Argument must be an object, or null");h.prototype=e||{};var t=new h;return h.prototype=null,void 0!==n&&Object.defineProperties(t,n),null===e&&(t.__proto__=null),t}):g=Object.create;var y=g,b=["altKey","button","buttons","clientX","clientY","ctrlKey","metaKey","movementX","movementY","offsetX","offsetY","pageX","pageY","region","relatedTarget","screenX","screenY","shiftKey","which","x","y"];function E(e,n){n=n||{};for(var t=y(e),r=0;ro.right-r.margin?Math.ceil(Math.min(1,(c.x-o.right)/r.margin+1)*r.maxSpeed):0,t=c.yo.bottom-r.margin?Math.ceil(Math.min(1,(c.y-o.bottom)/r.margin+1)*r.maxSpeed):0,r.syncMove()&&f.dispatch(e,{pageX:c.pageX+n,pageY:c.pageY+t,clientX:c.x+n,clientY:c.y+t}),setTimeout((function(){t&&function(e,n){e===window?window.scrollTo(e.pageXOffset,e.pageYOffset+n):e.scrollTop+=n}(e,t),n&&function(e,n){e===window?window.scrollTo(e.pageXOffset+n,e.pageYOffset):e.scrollLeft+=n}(e,n)}))}window.addEventListener("mousedown",Y,!1),window.addEventListener("touchstart",Y,!1),window.addEventListener("mouseup",A,!1),window.addEventListener("touchend",A,!1),window.addEventListener("pointerup",A,!1),window.addEventListener("mousemove",M,!1),window.addEventListener("touchmove",M,!1),window.addEventListener("mouseleave",S,!1),window.addEventListener("scroll",X,!0)}function L(e,n,t){return t?e.y>t.top&&e.yt.left&&e.xt.top&&e.yt.left&&e.x