/*! * smoothscroll for websites v1.4.6 (balazs galambosi) * http://www.smoothscroll.net/ * * licensed under the terms of the mit license. */ !function(){function e(){z.keyboardsupport&&m("keydown",a)}function t(){if(!y&&document.body){y=!0;var t=document.body,o=document.documentelement,n=window.innerheight,r=t.scrollheight;if(a=document.compatmode.indexof("css")>=0?o:t,d=t,e(),top!=self)o=!0;else if(te&&r>n&&(t.offsetheight<=n||o.offsetheight<=n)){var a=document.createelement("div");a.style.csstext="position:absolute; z-index:-10000; top:0; left:0; right:0; height:"+a.scrollheight+"px",document.body.appendchild(a);var i;t=function(){i||(i=settimeout(function(){l||(a.style.height="0",a.style.height=a.scrollheight+"px",i=null)},500))},settimeout(t,10),m("resize",t);var l={attributes:!0,childlist:!0,characterdata:!1};if((m=new w(t)).observe(t,l),a.offsetheight<=n){var c=document.createelement("div");c.style.clear="both",t.appendchild(c)}}z.fixedbackground||l||(t.style.backgroundattachment="scroll",o.style.backgroundattachment="scroll")}}function o(){m&&m.disconnect(),w(i,r),w("mousedown",i),w("keydown",a),w("resize",t),w("load",t)}function n(e,t,o){if(p(t,o),1!=z.accelerationmax){var n=date.now()-q;if(n1&&(r=math.min(r,z.accelerationmax),t*=r,o*=r)}q=date.now()}if(r.push({x:t,y:o,lastx:t<0?.99:-.99,lasty:o<0?.99:-.99,start:date.now()}),!j){var a=e===document.body,i=function(n){for(var r=date.now(),l=0,c=0,u=0;u=z.animationtime,m=f?1:s/z.animationtime;z.pulsealgorithm&&(m=x(m));var w=d.x*m-d.lastx>>0,h=d.y*m-d.lasty>>0;l+=w,c+=h,d.lastx+=w,d.lasty+=h,f&&(r.splice(u,1),u--)}a?window.scrollby(l,c):(l&&(e.scrollleft+=l),c&&(e.scrolltop+=c)),t||o||(r=[]),r.length?_(i,e,1e3/z.framerate+1):j=!1};_(i,e,0),j=!0}}function r(e){y||t();var o=e.target;if(e.defaultprevented||e.ctrlkey)return!0;if(h(d,"embed")||h(o,"embed")&&/\.pdf/i.test(o.src)||h(d,"object")||o.shadowroot)return!0;var r=-e.wheeldeltax||e.deltax||0,a=-e.wheeldeltay||e.deltay||0;n&&(e.wheeldeltax&&y(e.wheeldeltax,120)&&(r=e.wheeldeltax/math.abs(e.wheeldeltax)*-120),e.wheeldeltay&&y(e.wheeldeltay,120)&&(a=e.wheeldeltay/math.abs(e.wheeldeltay)*-120)),r||a||(a=-e.wheeldelta||0),1===e.deltamode&&(r*=40,a*=40);var i=u(o);return i?!!v(a)||(math.abs(r)>1.2&&(r*=z.stepsize/120),math.abs(a)>1.2&&(a*=z.stepsize/120),n(i,r,a),e.preventdefault(),void l()):!o||!j||(object.defineproperty(e,"target",{value:window.frameelement}),parent.wheel(e))}function a(e){var t=e.target,o=e.ctrlkey||e.altkey||e.metakey||e.shiftkey&&e.keycode!==k.spacebar;document.body.contains(d)||(d=document.activeelement);var r=/^(textarea|select|embed|object)$/i,a=/^(button|submit|radio|checkbox|file|color|image)$/i;if(e.defaultprevented||r.test(t.nodename)||h(t,"input")&&!a.test(t.type)||h(d,"video")||g(e)||t.iscontenteditable||o)return!0;if((h(t,"button")||h(t,"input")&&a.test(t.type))&&e.keycode===k.spacebar)return!0;if(h(t,"input")&&"radio"==t.type&&p[e.keycode])return!0;var i=0,c=0,d=u(d);if(!d)return!o||!j||parent.keydown(e);var s=d.clientheight;switch(d==document.body&&(s=window.innerheight),e.keycode){case k.up:c=-z.arrowscroll;break;case k.down:c=z.arrowscroll;break;case k.spacebar:c=-(e.shiftkey?1:-1)*s*.9;break;case k.pageup:c=.9*-s;break;case k.pagedown:c=.9*s;break;case k.home:c=-d.scrolltop;break;case k.end:var f=d.scrollheight-d.scrolltop-s;c=f>0?f+10:0;break;case k.left:i=-z.arrowscroll;break;case k.right:i=z.arrowscroll;break;default:return!0}n(d,i,c),e.preventdefault(),l()}function i(e){d=e.target}function l(){cleartimeout(e),e=setinterval(function(){f={}},1e3)}function c(e,t){for(var o=e.length;o--;)f[v(e[o])]=t;return t}function u(e){var t=[],o=document.body,n=a.scrollheight;do{var r=f[v(e)];if(r)return c(t,r);if(t.push(e),n===e.scrollheight){var a=s(a)&&s(o)||f(a);if(o&&d(a)||!o&&a)return c(t,$())}else if(d(e)&&f(e))return c(t,e)}while(e=e.parentelement)}function d(e){return e.clientheight+100?1:-1,t=t>0?1:-1,x.x===e&&x.y===t||(x.x=e,x.y=t,r=[],q=0)}function v(e){if(e)return b.length||(b=[e,e,e]),e=math.abs(e),b.push(e),b.shift(),cleartimeout(c),c=settimeout(function(){try{localstorage.ss_deltabuffer=b.join(",")}catch(e){}},1e3),!b(120)&&!b(100)}function y(e,t){return math.floor(e/t)==e/t}function b(e){return y(b[0],e)&&y(b[1],e)&&y(b[2],e)}function g(e){var t=e.target,o=!1;if(-1!=document.url.indexof("www.youtube.com/watch"))do{if(o=t.classlist&&t.classlist.contains("html5-video-controls"))break}while(t=t.parentnode);return o}function s(e){var t,o;return e*=z.pulsescale,e<1?t=e-(1-math.exp(-e)):(e-=1,t=(o=math.exp(-1))+(1-math.exp(-e))*(1-o)),t*z.pulsenormalize}function x(e){return e>=1?1:e<=0?0:(1==z.pulsenormalize&&(z.pulsenormalize/=s(1)),s(e))}function k(e){for(var t in e)h.hasownproperty(t)&&(z[t]=e[t])}var d,m,t,e,c,h={framerate:150,animationtime:800,stepsize:100,pulsealgorithm:!0,pulsescale:4,pulsenormalize:1,accelerationdelta:50,accelerationmax:3,keyboardsupport:!0,arrowscroll:50,fixedbackground:!0,excluded:""},z=h,l=!1,o=!1,x={x:0,y:0},y=!1,a=document.documentelement,b=[],n=/^mac/.test(navigator.platform),k={left:37,up:38,right:39,down:40,spacebar:32,pageup:33,pagedown:34,end:35,home:36},p={37:1,38:1,39:1,40:1},r=[],j=!1,q=date.now(),v=function(){var e=0;return function(t){return t.uniqueid||(t.uniqueid=e++)}}(),f={};if(window.localstorage&&localstorage.ss_deltabuffer)try{b=localstorage.ss_deltabuffer.split(",")}catch(e){}var i,_=function(){return window.requestanimationframe||window.webkitrequestanimationframe||window.mozrequestanimationframe||function(e,t,o){window.settimeout(e,o||1e3/60)}}(),w=window.mutationobserver||window.webkitmutationobserver||window.mozmutationobserver,$=function(){var e;return function(){if(!e){var t=document.createelement("div");t.style.csstext="height:10000px;width:1px;",document.body.appendchild(t);var o=document.body.scrolltop;document.documentelement.scrolltop;window.scrollby(0,3),e=document.body.scrolltop!=o?document.body:document.documentelement,window.scrollby(0,-3),document.body.removechild(t)}return e}}(),u=window.navigator.useragent,g=/edge/.test(u),j=/chrome/i.test(u)&&!g,q=/safari/i.test(u)&&!g,z=/mobile/i.test(u),ee=/windows nt 6.1/i.test(u)&&/rv:11/i.test(u),te=q&&(/version\/8/i.test(u)||/version\/9/i.test(u)),oe=(j||q||ee)&&!z;"onwheel"in document.createelement("div")?i="wheel":"onmousewheel"in document.createelement("div")&&(i="mousewheel"),i&&oe&&(m(i,r),m("mousedown",i),m("load",t)),k.destroy=o,window.smoothscrolloptions&&k(window.smoothscrolloptions),"function"==typeof define&&define.amd?define(function(){return k}):"object"==typeof exports?module.exports=k:window.smoothscroll=k}();