From 2aa7bc3af476df8484db53f3570b83089aa3aa8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Roche?= Date: Sat, 21 Jan 2023 19:45:12 +0100 Subject: [PATCH] v1.0.0-dev.5 --- bundled/lenis.js | 15 +++++++++++---- bundled/lenis.min.js | 4 ++-- dist/lenis.js | 2 +- dist/lenis.mjs | 2 +- dist/lenis.modern.mjs | 2 +- dist/lenis.umd.js | 2 +- package.json | 2 +- 7 files changed, 18 insertions(+), 11 deletions(-) diff --git a/bundled/lenis.js b/bundled/lenis.js index 581b0916..a7c024c8 100644 --- a/bundled/lenis.js +++ b/bundled/lenis.js @@ -75,7 +75,7 @@ } }); - var version = "1.0.0-dev.4"; + var version = "1.0.0-dev.5"; function clamp(min, input, max) { return Math.max(min, Math.min(input, max)); @@ -522,7 +522,11 @@ return; } _classPrivateFieldLooseBase(_this, _isSmooth2)[_isSmooth2] = _classPrivateFieldLooseBase(_this, _options)[_options].smoothTouch && type === 'touch' || _classPrivateFieldLooseBase(_this, _options)[_options].smoothWheel && type === 'wheel'; - if (!_this.isSmooth) return; + if (!_this.isSmooth) { + _classPrivateFieldLooseBase(_this, _isScrolling2)[_isScrolling2] = false; + _classPrivateFieldLooseBase(_this, _animate)[_animate].stop(); + return; + } event.preventDefault(); var delta = deltaY; if (_classPrivateFieldLooseBase(_this, _options)[_options].gestureOrientation === 'both') { @@ -530,6 +534,7 @@ } else if (_classPrivateFieldLooseBase(_this, _options)[_options].gestureOrientation === 'horizontal') { delta = deltaX; } + console.log('scrollTo', _classPrivateFieldLooseBase(_this, _targetScroll)[_targetScroll] + delta); _this.scrollTo(_classPrivateFieldLooseBase(_this, _targetScroll)[_targetScroll] + delta, {}, false); } }); @@ -618,6 +623,7 @@ }; _proto.stop = function stop() { _classPrivateFieldLooseBase(this, _isStopped2)[_isStopped2] = true; + _classPrivateFieldLooseBase(this, _animate)[_animate].stop(); }; _proto.raf = function raf(time) { var deltaTime = time - (_classPrivateFieldLooseBase(this, _time)[_time] || time); @@ -735,7 +741,7 @@ }, { key: "limit", get: function get() { - return this.isHorizontal ? _classPrivateFieldLooseBase(this, _content)[_content].width - _classPrivateFieldLooseBase(this, _wrapper)[_wrapper].width : _classPrivateFieldLooseBase(this, _content)[_content].height - _classPrivateFieldLooseBase(this, _wrapper)[_wrapper].height; + return Math.round(this.isHorizontal ? _classPrivateFieldLooseBase(this, _content)[_content].width - _classPrivateFieldLooseBase(this, _wrapper)[_wrapper].width : _classPrivateFieldLooseBase(this, _content)[_content].height - _classPrivateFieldLooseBase(this, _wrapper)[_wrapper].height); } }, { key: "isHorizontal", @@ -745,7 +751,7 @@ }, { key: "scroll", get: function get() { - return clampedModulo(_classPrivateFieldLooseBase(this, _animatedScroll)[_animatedScroll], this.limit); + return _classPrivateFieldLooseBase(this, _options)[_options].infinite ? clampedModulo(_classPrivateFieldLooseBase(this, _animatedScroll)[_animatedScroll], this.limit) : _classPrivateFieldLooseBase(this, _animatedScroll)[_animatedScroll]; } }, { key: "progress", @@ -782,6 +788,7 @@ }(); function _setScroll2(scroll) { if (_classPrivateFieldLooseBase(this, _options)[_options].infinite) { + // modulo scroll value scroll = this.scroll; } diff --git a/bundled/lenis.min.js b/bundled/lenis.min.js index 8339474a..89be91f8 100644 --- a/bundled/lenis.min.js +++ b/bundled/lenis.min.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t||self).Lenis=e()}(this,function(){function t(){return t=Object.assign?Object.assign.bind():function(t){for(var e=1;e({events:{},emit(t,...e){let i=this.events[t]||[];for(let t=0,n=i.length;t{this.events[t]=this.events[t]?.filter(t=>e!==t)}}});function r(t,e,i){return Math.max(t,Math.min(e,i))}var s=/*#__PURE__*/function(){function t(){}var e=t.prototype;return e.advance=function(t){var e;if(this.isRunning){var i;this.value===this.from&&(null==(i=this.onStart)||i.call(this,this.from));var n,o,s=!1;if(this.lerp)this.value=(1-(n=this.lerp))*this.value+n*this.to,Math.round(this.value)===this.to&&(this.value=this.to,s=!0);else{this.currentTime+=t;var l=r(0,this.currentTime/this.duration,1),h=(s=l>=1)?1:this.easing(l);this.value=this.from+(this.to-this.from)*h}null==(e=this.onUpdate)||e.call(this,this.value),s&&(null==(o=this.onComplete)||o.call(this,this.to),this.stop())}},e.stop=function(){this.isRunning=!1},e.fromTo=function(t,e,i){var n=i.lerp,o=void 0===n?.1:n,r=i.duration,s=void 0===r?1:r,l=i.easing,h=void 0===l?function(t){return t}:l,a=i.onStart,u=i.onUpdate,c=i.onComplete;this.from=this.value=t,this.to=e,this.lerp=o,this.duration=s,this.easing=h,this.currentTime=0,this.isRunning=!0,this.onStart=a,this.onUpdate=u,this.onComplete=c},t}(),l=/*#__PURE__*/i("resizeObserver"),h=/*#__PURE__*/i("onResize"),a=/*#__PURE__*/i("onWindowResize"),u=/*#__PURE__*/function(){function t(t){var e=this;Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,h,{writable:!0,value:function(t){var i=t[0];if(i){var n=i.contentRect,o=n.height;e.width=n.width,e.height=o}}}),Object.defineProperty(this,a,{writable:!0,value:function(){e.width=window.innerWidth,e.height=window.innerHeight}}),this.element=t,t===window?(window.addEventListener("resize",n(this,a)[a]),n(this,a)[a]()):(this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,n(this,l)[l]=new ResizeObserver(n(this,h)[h]),n(this,l)[l].observe(this.element))}return t.prototype.destroy=function(){window.removeEventListener("resize",this.onWindowResize),n(this,l)[l].disconnect()},t}(),c=/*#__PURE__*/i("wheelMultiplier"),d=/*#__PURE__*/i("touchMultiplier"),v=/*#__PURE__*/i("normalizeWheel"),f=/*#__PURE__*/i("touchStart"),p=/*#__PURE__*/i("emitter"),m=/*#__PURE__*/i("onTouchStart"),b=/*#__PURE__*/i("onTouchMove"),y=/*#__PURE__*/i("onWheel"),w=/*#__PURE__*/function(){function t(t,e){var i=this,s=e.wheelMultiplier,l=void 0===s?1:s,h=e.touchMultiplier,a=void 0===h?2:h,u=e.normalizeWheel,w=void 0!==u&&u;Object.defineProperty(this,c,{writable:!0,value:void 0}),Object.defineProperty(this,d,{writable:!0,value:void 0}),Object.defineProperty(this,v,{writable:!0,value:void 0}),Object.defineProperty(this,f,{writable:!0,value:void 0}),Object.defineProperty(this,p,{writable:!0,value:void 0}),Object.defineProperty(this,m,{writable:!0,value:function(t){var e=t.targetTouches?t.targetTouches[0]:t,o=e.pageX,r=e.pageY;n(i,f)[f].x=o,n(i,f)[f].y=r}}),Object.defineProperty(this,b,{writable:!0,value:function(t){var e=t.targetTouches?t.targetTouches[0]:t,o=e.pageX,r=e.pageY,s=-(o-n(i,f)[f].x)*n(i,d)[d],l=-(r-n(i,f)[f].y)*n(i,d)[d];n(i,f)[f].x=o,n(i,f)[f].y=r,n(i,p)[p].emit("scroll",{type:"touch",deltaX:s,deltaY:l,event:t})}}),Object.defineProperty(this,y,{writable:!0,value:function(t){var e=t.deltaX,o=t.deltaY;n(i,v)[v]&&(e=r(-100,e,100),o=r(-100,o,100)),e*=n(i,c)[c],o*=n(i,c)[c],n(i,p)[p].emit("scroll",{type:"wheel",deltaX:e,deltaY:o,event:t})}}),this.element=t,n(this,c)[c]=l,n(this,d)[d]=a,n(this,v)[v]=w,n(this,f)[f]={x:null,y:null},n(this,p)[p]=o(),this.element.addEventListener("wheel",n(this,y)[y],{passive:!1}),this.element.addEventListener("touchstart",n(this,m)[m],{passive:!1}),this.element.addEventListener("touchmove",n(this,b)[b],{passive:!1})}var e=t.prototype;return e.on=function(t,e){return n(this,p)[p].on(t,e)},e.destroy=function(){n(this,p)[p].events={},this.element.removeEventListener("wheel",n(this,y)[y],{passive:!1}),this.element.removeEventListener("touchstart",n(this,m)[m],{passive:!1}),this.element.removeEventListener("touchmove",n(this,b)[b],{passive:!1})},t}(),g=/*#__PURE__*/i("options"),O=/*#__PURE__*/i("wrapper"),j=/*#__PURE__*/i("content"),P=/*#__PURE__*/i("animate"),S=/*#__PURE__*/i("emitter"),T=/*#__PURE__*/i("virtualScroll"),L=/*#__PURE__*/i("time"),M=/*#__PURE__*/i("velocity"),z=/*#__PURE__*/i("direction"),E=/*#__PURE__*/i("animatedScroll"),W=/*#__PURE__*/i("targetScroll"),k=/*#__PURE__*/i("_isScrolling"),R=/*#__PURE__*/i("_isStopped"),x=/*#__PURE__*/i("_isSmooth"),C=/*#__PURE__*/i("isLocked"),H=/*#__PURE__*/i("setScroll"),_=/*#__PURE__*/i("onVirtualScroll"),X=/*#__PURE__*/i("onScroll"),Y=/*#__PURE__*/i("classElement"),D=/*#__PURE__*/i("actualScroll"),U=/*#__PURE__*/i("isSmooth"),A=/*#__PURE__*/i("isScrolling"),q=/*#__PURE__*/i("isStopped");function B(t){n(this,g)[g].infinite&&(t=this.scroll),this.isHorizontal?n(this,Y)[Y].scrollLeft=t:n(this,Y)[Y].scrollTop=t}function V(){return n(this,O)[O].element===window?n(this,j)[j].element:n(this,O)[O].element}function F(){return n(this,Y)[Y].scrollTop}function K(t){n(this,x)[x]!==t&&n(this,Y)[Y].classList.toggle("lenis-smooth",t),n(this,x)[x]=t}function G(t){n(this,k)[k]!==t&&n(this,Y)[Y].classList.toggle("lenis-scrolling",t),n(this,k)[k]=t}function I(t){n(this,R)[R]!==t&&n(this,Y)[Y].classList.toggle("lenis-stopped",t),n(this,R)[R]=t}/*#__PURE__*/ -return function(){function e(t){var e=this,i=void 0===t?{}:t,r=i.direction,l=i.gestureDirection,h=i.mouseMultiplier,a=i.smooth,c=i.wrapper,d=void 0===c?window:c,v=i.content,f=void 0===v?document.documentElement:v,p=i.smoothWheel,m=void 0===p?null==a||a:p,b=i.smoothTouch,y=void 0!==b&&b,J=i.duration,N=i.easing,Q=void 0===N?function(t){return Math.min(1,1.001-Math.pow(2,-10*t))}:N,Z=i.lerp,$=void 0===Z?J?null:.1:Z,tt=i.infinite,et=void 0!==tt&&tt,it=i.orientation,nt=void 0===it?null!=r?r:"vertical":it,ot=i.gestureOrientation,rt=void 0===ot?null!=l?l:"vertical":ot,st=i.touchMultiplier,lt=void 0===st?2:st,ht=i.wheelMultiplier,at=void 0===ht?null!=h?h:1:ht,ut=i.normalizeWheel,ct=void 0===ut||ut;Object.defineProperty(this,q,{get:void 0,set:I}),Object.defineProperty(this,A,{get:void 0,set:G}),Object.defineProperty(this,U,{get:void 0,set:K}),Object.defineProperty(this,D,{get:F,set:void 0}),Object.defineProperty(this,Y,{get:V,set:void 0}),Object.defineProperty(this,H,{value:B}),Object.defineProperty(this,g,{writable:!0,value:void 0}),Object.defineProperty(this,O,{writable:!0,value:void 0}),Object.defineProperty(this,j,{writable:!0,value:void 0}),Object.defineProperty(this,P,{writable:!0,value:void 0}),Object.defineProperty(this,S,{writable:!0,value:void 0}),Object.defineProperty(this,T,{writable:!0,value:void 0}),Object.defineProperty(this,L,{writable:!0,value:void 0}),Object.defineProperty(this,M,{writable:!0,value:void 0}),Object.defineProperty(this,z,{writable:!0,value:void 0}),Object.defineProperty(this,E,{writable:!0,value:void 0}),Object.defineProperty(this,W,{writable:!0,value:void 0}),Object.defineProperty(this,k,{writable:!0,value:void 0}),Object.defineProperty(this,R,{writable:!0,value:void 0}),Object.defineProperty(this,x,{writable:!0,value:void 0}),Object.defineProperty(this,C,{writable:!0,value:void 0}),Object.defineProperty(this,_,{writable:!0,value:function(t){var i=t.type,o=t.deltaX,r=t.deltaY,s=t.event;if(!s.ctrlKey&&!("vertical"===n(e,g)[g].gestureOrientation&&0===r||"horizontal"===n(e,g)[g].gestureOrientation&&0===o||s.composedPath().find(function(t){return null==t||null==t.hasAttribute?void 0:t.hasAttribute("data-lenis-prevent")})))if(e.isStopped||n(e,C)[C])s.preventDefault();else if(n(e,U)[U]=n(e,g)[g].smoothTouch&&"touch"===i||n(e,g)[g].smoothWheel&&"wheel"===i,e.isSmooth){s.preventDefault();var l=r;"both"===n(e,g)[g].gestureOrientation?l=o+r:"horizontal"===n(e,g)[g].gestureOrientation&&(l=o),e.scrollTo(n(e,W)[W]+l,{},!1)}}}),Object.defineProperty(this,X,{writable:!0,value:function(){if(!e.isScrolling){var t=n(e,E)[E];n(e,E)[E]=n(e,W)[W]=n(e,D)[D],n(e,M)[M]=0,n(e,z)[z]=Math.sign(n(e,E)[E]-t),e.emit()}}}),r&&console.warn("Lenis: `direction` option is deprecated, use `orientation` instead"),l&&console.warn("Lenis: `gestureDirection` option is deprecated, use `gestureOrientation` instead"),h&&console.warn("Lenis: `mouseMultiplier` option is deprecated, use `wheelMultiplier` instead"),a&&console.warn("Lenis: `smooth` option is deprecated, use `smoothWheel` instead"),window.lenisVersion="1.0.0-dev.4",d!==document.documentElement&&d!==document.body||(d=window),n(this,g)[g]={wrapper:d,content:f,smoothWheel:m,smoothTouch:y,duration:J,easing:Q,lerp:$,infinite:et,gestureOrientation:rt,orientation:nt,touchMultiplier:lt,wheelMultiplier:at,normalizeWheel:ct},n(this,O)[O]=new u(d),n(this,j)[j]=new u(f),n(this,Y)[Y].classList.add("lenis"),n(this,M)[M]=0,n(this,q)[q]=!1,n(this,U)[U]=m||y,n(this,A)[A]=!1,n(this,W)[W]=n(this,E)[E]=n(this,D)[D],n(this,P)[P]=new s,n(this,S)[S]=o(),n(this,O)[O].element.addEventListener("scroll",n(this,X)[X],{passive:!1}),n(this,T)[T]=new w(d,{touchMultiplier:lt,wheelMultiplier:at,normalizeWheel:ct}),n(this,T)[T].on("scroll",n(this,_)[_])}var i,l,h=e.prototype;return h.destroy=function(){n(this,S)[S].events={},n(this,O)[O].element.removeEventListener("scroll",n(this,X)[X],{passive:!1}),n(this,T)[T].destroy()},h.on=function(t,e){return n(this,S)[S].on(t,e)},h.emit=function(){n(this,S)[S].emit("scroll",this)},h.start=function(){n(this,q)[q]=!1},h.stop=function(){n(this,q)[q]=!0},h.raf=function(t){var e=t-(n(this,L)[L]||t);n(this,L)[L]=t,n(this,P)[P].advance(.001*e)},h.scrollTo=function(t,e,i){var o=this,s=void 0===e?{}:e,l=s.offset,h=void 0===l?0:l,a=s.immediate,u=void 0!==a&&a,c=s.lock,d=void 0!==c&&c,v=s.duration,f=void 0===v?n(this,g)[g].duration:v,p=s.easing,m=void 0===p?n(this,g)[g].easing:p,b=s.lerp,y=void 0===b?n(this,g)[g].lerp:b,w=s.onComplete;if(void 0===i&&(i=!0),["top","left","start"].includes(t))t=0;else if(["bottom","right","end"].includes(t))t=this.limit;else{var j,S;if("string"==typeof t?S=document.querySelector(t):null!=(j=t)&&j.nodeType&&(S=t),S){if(n(this,O)[O].element!==window){var T=n(this,O)[O].element.getBoundingClientRect();h-=this.isHorizontal?T.left:T.top}var L=S.getBoundingClientRect();t=(this.isHorizontal?L.left:L.top)+n(this,E)[E]}}if("number"==typeof t)if(t+=h,n(this,g)[g].infinite?i&&(n(this,W)[W]=n(this,E)[E]=this.scroll):t=r(0,t,this.limit),n(this,E)[E]!==t){if(u)return n(this,E)[E]=n(this,W)[W]=t,n(this,H)[H](t),this.emit(),void(null==w||w());i||(n(this,W)[W]=t),n(this,P)[P].fromTo(n(this,E)[E],t,{duration:f,easing:m,lerp:y,onStart:function(){d&&(n(o,C)[C]=!0),n(o,A)[A]=!0},onUpdate:function(t){n(o,M)[M]=t-n(o,E)[E],n(o,z)[z]=Math.sign(n(o,M)[M]),n(o,E)[E]=t,n(o,H)[H](t),i&&(n(o,W)[W]=t),o.emit()},onComplete:function(t){d&&(n(o,C)[C]=!1),requestAnimationFrame(function(){n(o,A)[A]=!1}),n(o,M)[M]=0,o.emit(),null==w||w()}})}else null==w||w()},i=e,(l=[{key:"options",get:function(){return t({},n(this,g)[g])}},{key:"limit",get:function(){return this.isHorizontal?n(this,j)[j].width-n(this,O)[O].width:n(this,j)[j].height-n(this,O)[O].height}},{key:"isHorizontal",get:function(){return"horizontal"===n(this,g)[g].orientation}},{key:"scroll",get:function(){return e=n(this,E)[E]%(t=this.limit),(t>0&&e<0||t<0&&e>0)&&(e+=t),e;var t,e}},{key:"progress",get:function(){return this.scroll/this.limit}},{key:"velocity",get:function(){return n(this,M)[M]}},{key:"direction",get:function(){return n(this,z)[z]}},{key:"isSmooth",get:function(){return n(this,x)[x]}},{key:"isScrolling",get:function(){return n(this,k)[k]}},{key:"isStopped",get:function(){return n(this,R)[R]}}])&&function(t,e){for(var i=0;i({events:{},emit(t,...e){let i=this.events[t]||[];for(let t=0,n=i.length;t{this.events[t]=this.events[t]?.filter(t=>e!==t)}}});function r(t,e,i){return Math.max(t,Math.min(e,i))}var s=/*#__PURE__*/function(){function t(){}var e=t.prototype;return e.advance=function(t){var e;if(this.isRunning){var i;this.value===this.from&&(null==(i=this.onStart)||i.call(this,this.from));var n,o,s=!1;if(this.lerp)this.value=(1-(n=this.lerp))*this.value+n*this.to,Math.round(this.value)===this.to&&(this.value=this.to,s=!0);else{this.currentTime+=t;var l=r(0,this.currentTime/this.duration,1),h=(s=l>=1)?1:this.easing(l);this.value=this.from+(this.to-this.from)*h}null==(e=this.onUpdate)||e.call(this,this.value),s&&(null==(o=this.onComplete)||o.call(this,this.to),this.stop())}},e.stop=function(){this.isRunning=!1},e.fromTo=function(t,e,i){var n=i.lerp,o=void 0===n?.1:n,r=i.duration,s=void 0===r?1:r,l=i.easing,h=void 0===l?function(t){return t}:l,a=i.onStart,u=i.onUpdate,c=i.onComplete;this.from=this.value=t,this.to=e,this.lerp=o,this.duration=s,this.easing=h,this.currentTime=0,this.isRunning=!0,this.onStart=a,this.onUpdate=u,this.onComplete=c},t}(),l=/*#__PURE__*/i("resizeObserver"),h=/*#__PURE__*/i("onResize"),a=/*#__PURE__*/i("onWindowResize"),u=/*#__PURE__*/function(){function t(t){var e=this;Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,h,{writable:!0,value:function(t){var i=t[0];if(i){var n=i.contentRect,o=n.height;e.width=n.width,e.height=o}}}),Object.defineProperty(this,a,{writable:!0,value:function(){e.width=window.innerWidth,e.height=window.innerHeight}}),this.element=t,t===window?(window.addEventListener("resize",n(this,a)[a]),n(this,a)[a]()):(this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,n(this,l)[l]=new ResizeObserver(n(this,h)[h]),n(this,l)[l].observe(this.element))}return t.prototype.destroy=function(){window.removeEventListener("resize",this.onWindowResize),n(this,l)[l].disconnect()},t}(),c=/*#__PURE__*/i("wheelMultiplier"),d=/*#__PURE__*/i("touchMultiplier"),v=/*#__PURE__*/i("normalizeWheel"),f=/*#__PURE__*/i("touchStart"),p=/*#__PURE__*/i("emitter"),m=/*#__PURE__*/i("onTouchStart"),b=/*#__PURE__*/i("onTouchMove"),y=/*#__PURE__*/i("onWheel"),w=/*#__PURE__*/function(){function t(t,e){var i=this,s=e.wheelMultiplier,l=void 0===s?1:s,h=e.touchMultiplier,a=void 0===h?2:h,u=e.normalizeWheel,w=void 0!==u&&u;Object.defineProperty(this,c,{writable:!0,value:void 0}),Object.defineProperty(this,d,{writable:!0,value:void 0}),Object.defineProperty(this,v,{writable:!0,value:void 0}),Object.defineProperty(this,f,{writable:!0,value:void 0}),Object.defineProperty(this,p,{writable:!0,value:void 0}),Object.defineProperty(this,m,{writable:!0,value:function(t){var e=t.targetTouches?t.targetTouches[0]:t,o=e.pageX,r=e.pageY;n(i,f)[f].x=o,n(i,f)[f].y=r}}),Object.defineProperty(this,b,{writable:!0,value:function(t){var e=t.targetTouches?t.targetTouches[0]:t,o=e.pageX,r=e.pageY,s=-(o-n(i,f)[f].x)*n(i,d)[d],l=-(r-n(i,f)[f].y)*n(i,d)[d];n(i,f)[f].x=o,n(i,f)[f].y=r,n(i,p)[p].emit("scroll",{type:"touch",deltaX:s,deltaY:l,event:t})}}),Object.defineProperty(this,y,{writable:!0,value:function(t){var e=t.deltaX,o=t.deltaY;n(i,v)[v]&&(e=r(-100,e,100),o=r(-100,o,100)),e*=n(i,c)[c],o*=n(i,c)[c],n(i,p)[p].emit("scroll",{type:"wheel",deltaX:e,deltaY:o,event:t})}}),this.element=t,n(this,c)[c]=l,n(this,d)[d]=a,n(this,v)[v]=w,n(this,f)[f]={x:null,y:null},n(this,p)[p]=o(),this.element.addEventListener("wheel",n(this,y)[y],{passive:!1}),this.element.addEventListener("touchstart",n(this,m)[m],{passive:!1}),this.element.addEventListener("touchmove",n(this,b)[b],{passive:!1})}var e=t.prototype;return e.on=function(t,e){return n(this,p)[p].on(t,e)},e.destroy=function(){n(this,p)[p].events={},this.element.removeEventListener("wheel",n(this,y)[y],{passive:!1}),this.element.removeEventListener("touchstart",n(this,m)[m],{passive:!1}),this.element.removeEventListener("touchmove",n(this,b)[b],{passive:!1})},t}(),g=/*#__PURE__*/i("options"),O=/*#__PURE__*/i("wrapper"),j=/*#__PURE__*/i("content"),P=/*#__PURE__*/i("animate"),S=/*#__PURE__*/i("emitter"),T=/*#__PURE__*/i("virtualScroll"),M=/*#__PURE__*/i("time"),L=/*#__PURE__*/i("velocity"),z=/*#__PURE__*/i("direction"),E=/*#__PURE__*/i("animatedScroll"),W=/*#__PURE__*/i("targetScroll"),k=/*#__PURE__*/i("_isScrolling"),R=/*#__PURE__*/i("_isStopped"),x=/*#__PURE__*/i("_isSmooth"),C=/*#__PURE__*/i("isLocked"),H=/*#__PURE__*/i("setScroll"),_=/*#__PURE__*/i("onVirtualScroll"),X=/*#__PURE__*/i("onScroll"),Y=/*#__PURE__*/i("classElement"),D=/*#__PURE__*/i("actualScroll"),U=/*#__PURE__*/i("isSmooth"),A=/*#__PURE__*/i("isScrolling"),q=/*#__PURE__*/i("isStopped");function B(t){n(this,g)[g].infinite&&(t=this.scroll),this.isHorizontal?n(this,Y)[Y].scrollLeft=t:n(this,Y)[Y].scrollTop=t}function V(){return n(this,O)[O].element===window?n(this,j)[j].element:n(this,O)[O].element}function F(){return n(this,Y)[Y].scrollTop}function K(t){n(this,x)[x]!==t&&n(this,Y)[Y].classList.toggle("lenis-smooth",t),n(this,x)[x]=t}function G(t){n(this,k)[k]!==t&&n(this,Y)[Y].classList.toggle("lenis-scrolling",t),n(this,k)[k]=t}function I(t){n(this,R)[R]!==t&&n(this,Y)[Y].classList.toggle("lenis-stopped",t),n(this,R)[R]=t}/*#__PURE__*/ +return function(){function e(t){var e=this,i=void 0===t?{}:t,r=i.direction,l=i.gestureDirection,h=i.mouseMultiplier,a=i.smooth,c=i.wrapper,d=void 0===c?window:c,v=i.content,f=void 0===v?document.documentElement:v,p=i.smoothWheel,m=void 0===p?null==a||a:p,b=i.smoothTouch,y=void 0!==b&&b,J=i.duration,N=i.easing,Q=void 0===N?function(t){return Math.min(1,1.001-Math.pow(2,-10*t))}:N,Z=i.lerp,$=void 0===Z?J?null:.1:Z,tt=i.infinite,et=void 0!==tt&&tt,it=i.orientation,nt=void 0===it?null!=r?r:"vertical":it,ot=i.gestureOrientation,rt=void 0===ot?null!=l?l:"vertical":ot,st=i.touchMultiplier,lt=void 0===st?2:st,ht=i.wheelMultiplier,at=void 0===ht?null!=h?h:1:ht,ut=i.normalizeWheel,ct=void 0===ut||ut;Object.defineProperty(this,q,{get:void 0,set:I}),Object.defineProperty(this,A,{get:void 0,set:G}),Object.defineProperty(this,U,{get:void 0,set:K}),Object.defineProperty(this,D,{get:F,set:void 0}),Object.defineProperty(this,Y,{get:V,set:void 0}),Object.defineProperty(this,H,{value:B}),Object.defineProperty(this,g,{writable:!0,value:void 0}),Object.defineProperty(this,O,{writable:!0,value:void 0}),Object.defineProperty(this,j,{writable:!0,value:void 0}),Object.defineProperty(this,P,{writable:!0,value:void 0}),Object.defineProperty(this,S,{writable:!0,value:void 0}),Object.defineProperty(this,T,{writable:!0,value:void 0}),Object.defineProperty(this,M,{writable:!0,value:void 0}),Object.defineProperty(this,L,{writable:!0,value:void 0}),Object.defineProperty(this,z,{writable:!0,value:void 0}),Object.defineProperty(this,E,{writable:!0,value:void 0}),Object.defineProperty(this,W,{writable:!0,value:void 0}),Object.defineProperty(this,k,{writable:!0,value:void 0}),Object.defineProperty(this,R,{writable:!0,value:void 0}),Object.defineProperty(this,x,{writable:!0,value:void 0}),Object.defineProperty(this,C,{writable:!0,value:void 0}),Object.defineProperty(this,_,{writable:!0,value:function(t){var i=t.type,o=t.deltaX,r=t.deltaY,s=t.event;if(!s.ctrlKey&&!("vertical"===n(e,g)[g].gestureOrientation&&0===r||"horizontal"===n(e,g)[g].gestureOrientation&&0===o||s.composedPath().find(function(t){return null==t||null==t.hasAttribute?void 0:t.hasAttribute("data-lenis-prevent")})))if(e.isStopped||n(e,C)[C])s.preventDefault();else{if(n(e,U)[U]=n(e,g)[g].smoothTouch&&"touch"===i||n(e,g)[g].smoothWheel&&"wheel"===i,!e.isSmooth)return n(e,A)[A]=!1,void n(e,P)[P].stop();s.preventDefault();var l=r;"both"===n(e,g)[g].gestureOrientation?l=o+r:"horizontal"===n(e,g)[g].gestureOrientation&&(l=o),console.log("scrollTo",n(e,W)[W]+l),e.scrollTo(n(e,W)[W]+l,{},!1)}}}),Object.defineProperty(this,X,{writable:!0,value:function(){if(!e.isScrolling){var t=n(e,E)[E];n(e,E)[E]=n(e,W)[W]=n(e,D)[D],n(e,L)[L]=0,n(e,z)[z]=Math.sign(n(e,E)[E]-t),e.emit()}}}),r&&console.warn("Lenis: `direction` option is deprecated, use `orientation` instead"),l&&console.warn("Lenis: `gestureDirection` option is deprecated, use `gestureOrientation` instead"),h&&console.warn("Lenis: `mouseMultiplier` option is deprecated, use `wheelMultiplier` instead"),a&&console.warn("Lenis: `smooth` option is deprecated, use `smoothWheel` instead"),window.lenisVersion="1.0.0-dev.5",d!==document.documentElement&&d!==document.body||(d=window),n(this,g)[g]={wrapper:d,content:f,smoothWheel:m,smoothTouch:y,duration:J,easing:Q,lerp:$,infinite:et,gestureOrientation:rt,orientation:nt,touchMultiplier:lt,wheelMultiplier:at,normalizeWheel:ct},n(this,O)[O]=new u(d),n(this,j)[j]=new u(f),n(this,Y)[Y].classList.add("lenis"),n(this,L)[L]=0,n(this,q)[q]=!1,n(this,U)[U]=m||y,n(this,A)[A]=!1,n(this,W)[W]=n(this,E)[E]=n(this,D)[D],n(this,P)[P]=new s,n(this,S)[S]=o(),n(this,O)[O].element.addEventListener("scroll",n(this,X)[X],{passive:!1}),n(this,T)[T]=new w(d,{touchMultiplier:lt,wheelMultiplier:at,normalizeWheel:ct}),n(this,T)[T].on("scroll",n(this,_)[_])}var i,l,h=e.prototype;return h.destroy=function(){n(this,S)[S].events={},n(this,O)[O].element.removeEventListener("scroll",n(this,X)[X],{passive:!1}),n(this,T)[T].destroy()},h.on=function(t,e){return n(this,S)[S].on(t,e)},h.emit=function(){n(this,S)[S].emit("scroll",this)},h.start=function(){n(this,q)[q]=!1},h.stop=function(){n(this,q)[q]=!0,n(this,P)[P].stop()},h.raf=function(t){var e=t-(n(this,M)[M]||t);n(this,M)[M]=t,n(this,P)[P].advance(.001*e)},h.scrollTo=function(t,e,i){var o=this,s=void 0===e?{}:e,l=s.offset,h=void 0===l?0:l,a=s.immediate,u=void 0!==a&&a,c=s.lock,d=void 0!==c&&c,v=s.duration,f=void 0===v?n(this,g)[g].duration:v,p=s.easing,m=void 0===p?n(this,g)[g].easing:p,b=s.lerp,y=void 0===b?n(this,g)[g].lerp:b,w=s.onComplete;if(void 0===i&&(i=!0),["top","left","start"].includes(t))t=0;else if(["bottom","right","end"].includes(t))t=this.limit;else{var j,S;if("string"==typeof t?S=document.querySelector(t):null!=(j=t)&&j.nodeType&&(S=t),S){if(n(this,O)[O].element!==window){var T=n(this,O)[O].element.getBoundingClientRect();h-=this.isHorizontal?T.left:T.top}var M=S.getBoundingClientRect();t=(this.isHorizontal?M.left:M.top)+n(this,E)[E]}}if("number"==typeof t)if(t+=h,n(this,g)[g].infinite?i&&(n(this,W)[W]=n(this,E)[E]=this.scroll):t=r(0,t,this.limit),n(this,E)[E]!==t){if(u)return n(this,E)[E]=n(this,W)[W]=t,n(this,H)[H](t),this.emit(),void(null==w||w());i||(n(this,W)[W]=t),n(this,P)[P].fromTo(n(this,E)[E],t,{duration:f,easing:m,lerp:y,onStart:function(){d&&(n(o,C)[C]=!0),n(o,A)[A]=!0},onUpdate:function(t){n(o,L)[L]=t-n(o,E)[E],n(o,z)[z]=Math.sign(n(o,L)[L]),n(o,E)[E]=t,n(o,H)[H](t),i&&(n(o,W)[W]=t),o.emit()},onComplete:function(t){d&&(n(o,C)[C]=!1),requestAnimationFrame(function(){n(o,A)[A]=!1}),n(o,L)[L]=0,o.emit(),null==w||w()}})}else null==w||w()},i=e,(l=[{key:"options",get:function(){return t({},n(this,g)[g])}},{key:"limit",get:function(){return Math.round(this.isHorizontal?n(this,j)[j].width-n(this,O)[O].width:n(this,j)[j].height-n(this,O)[O].height)}},{key:"isHorizontal",get:function(){return"horizontal"===n(this,g)[g].orientation}},{key:"scroll",get:function(){return n(this,g)[g].infinite?(e=n(this,E)[E]%(t=this.limit),(t>0&&e<0||t<0&&e>0)&&(e+=t),e):n(this,E)[E];var t,e}},{key:"progress",get:function(){return this.scroll/this.limit}},{key:"velocity",get:function(){return n(this,L)[L]}},{key:"direction",get:function(){return n(this,z)[z]}},{key:"isSmooth",get:function(){return n(this,x)[x]}},{key:"isScrolling",get:function(){return n(this,k)[k]}},{key:"isStopped",get:function(){return n(this,R)[R]}}])&&function(t,e){for(var i=0;i=1)?1:this.easing(l);this.value=this.from+(this.to-this.from)*h}null==(e=this.onUpdate)||e.call(this,this.value),s&&(null==(o=this.onComplete)||o.call(this,this.to),this.stop())}},e.stop=function(){this.isRunning=!1},e.fromTo=function(t,e,i){var n=i.lerp,o=void 0===n?.1:n,r=i.duration,s=void 0===r?1:r,l=i.easing,h=void 0===l?function(t){return t}:l,a=i.onStart,u=i.onUpdate,c=i.onComplete;this.from=this.value=t,this.to=e,this.lerp=o,this.duration=s,this.easing=h,this.currentTime=0,this.isRunning=!0,this.onStart=a,this.onUpdate=u,this.onComplete=c},t}(),l=/*#__PURE__*/n("resizeObserver"),h=/*#__PURE__*/n("onResize"),a=/*#__PURE__*/n("onWindowResize"),u=/*#__PURE__*/function(){function t(t){var e=this;Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,h,{writable:!0,value:function(t){var i=t[0];if(i){var n=i.contentRect,o=n.height;e.width=n.width,e.height=o}}}),Object.defineProperty(this,a,{writable:!0,value:function(){e.width=window.innerWidth,e.height=window.innerHeight}}),this.element=t,t===window?(window.addEventListener("resize",o(this,a)[a]),o(this,a)[a]()):(this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,o(this,l)[l]=new ResizeObserver(o(this,h)[h]),o(this,l)[l].observe(this.element))}return t.prototype.destroy=function(){window.removeEventListener("resize",this.onWindowResize),o(this,l)[l].disconnect()},t}(),c=/*#__PURE__*/n("wheelMultiplier"),d=/*#__PURE__*/n("touchMultiplier"),v=/*#__PURE__*/n("normalizeWheel"),p=/*#__PURE__*/n("touchStart"),f=/*#__PURE__*/n("emitter"),m=/*#__PURE__*/n("onTouchStart"),b=/*#__PURE__*/n("onTouchMove"),w=/*#__PURE__*/n("onWheel"),y=/*#__PURE__*/function(){function e(e,i){var n=this,s=i.wheelMultiplier,l=void 0===s?1:s,h=i.touchMultiplier,a=void 0===h?2:h,u=i.normalizeWheel,y=void 0!==u&&u;Object.defineProperty(this,c,{writable:!0,value:void 0}),Object.defineProperty(this,d,{writable:!0,value:void 0}),Object.defineProperty(this,v,{writable:!0,value:void 0}),Object.defineProperty(this,p,{writable:!0,value:void 0}),Object.defineProperty(this,f,{writable:!0,value:void 0}),Object.defineProperty(this,m,{writable:!0,value:function(t){var e=t.targetTouches?t.targetTouches[0]:t,i=e.pageX,r=e.pageY;o(n,p)[p].x=i,o(n,p)[p].y=r}}),Object.defineProperty(this,b,{writable:!0,value:function(t){var e=t.targetTouches?t.targetTouches[0]:t,i=e.pageX,r=e.pageY,s=-(i-o(n,p)[p].x)*o(n,d)[d],l=-(r-o(n,p)[p].y)*o(n,d)[d];o(n,p)[p].x=i,o(n,p)[p].y=r,o(n,f)[f].emit("scroll",{type:"touch",deltaX:s,deltaY:l,event:t})}}),Object.defineProperty(this,w,{writable:!0,value:function(t){var e=t.deltaX,i=t.deltaY;o(n,v)[v]&&(e=r(-100,e,100),i=r(-100,i,100)),e*=o(n,c)[c],i*=o(n,c)[c],o(n,f)[f].emit("scroll",{type:"wheel",deltaX:e,deltaY:i,event:t})}}),this.element=e,o(this,c)[c]=l,o(this,d)[d]=a,o(this,v)[v]=y,o(this,p)[p]={x:null,y:null},o(this,f)[f]=t.createNanoEvents(),this.element.addEventListener("wheel",o(this,w)[w],{passive:!1}),this.element.addEventListener("touchstart",o(this,m)[m],{passive:!1}),this.element.addEventListener("touchmove",o(this,b)[b],{passive:!1})}var i=e.prototype;return i.on=function(t,e){return o(this,f)[f].on(t,e)},i.destroy=function(){o(this,f)[f].events={},this.element.removeEventListener("wheel",o(this,w)[w],{passive:!1}),this.element.removeEventListener("touchstart",o(this,m)[m],{passive:!1}),this.element.removeEventListener("touchmove",o(this,b)[b],{passive:!1})},e}(),g=/*#__PURE__*/n("options"),O=/*#__PURE__*/n("wrapper"),j=/*#__PURE__*/n("content"),P=/*#__PURE__*/n("animate"),S=/*#__PURE__*/n("emitter"),M=/*#__PURE__*/n("virtualScroll"),T=/*#__PURE__*/n("time"),z=/*#__PURE__*/n("velocity"),L=/*#__PURE__*/n("direction"),E=/*#__PURE__*/n("animatedScroll"),W=/*#__PURE__*/n("targetScroll"),k=/*#__PURE__*/n("_isScrolling"),R=/*#__PURE__*/n("_isStopped"),C=/*#__PURE__*/n("_isSmooth"),H=/*#__PURE__*/n("isLocked"),_=/*#__PURE__*/n("setScroll"),x=/*#__PURE__*/n("onVirtualScroll"),X=/*#__PURE__*/n("onScroll"),Y=/*#__PURE__*/n("classElement"),D=/*#__PURE__*/n("actualScroll"),U=/*#__PURE__*/n("isSmooth"),q=/*#__PURE__*/n("isScrolling"),A=/*#__PURE__*/n("isStopped");function B(t){o(this,g)[g].infinite&&(t=this.scroll),this.isHorizontal?o(this,Y)[Y].scrollLeft=t:o(this,Y)[Y].scrollTop=t}function N(){return o(this,O)[O].element===window?o(this,j)[j].element:o(this,O)[O].element}function V(){return o(this,Y)[Y].scrollTop}function F(t){o(this,C)[C]!==t&&o(this,Y)[Y].classList.toggle("lenis-smooth",t),o(this,C)[C]=t}function K(t){o(this,k)[k]!==t&&o(this,Y)[Y].classList.toggle("lenis-scrolling",t),o(this,k)[k]=t}function G(t){o(this,R)[R]!==t&&o(this,Y)[Y].classList.toggle("lenis-stopped",t),o(this,R)[R]=t}module.exports=/*#__PURE__*/function(){function i(e){var i=this,n=void 0===e?{}:e,r=n.direction,l=n.gestureDirection,h=n.mouseMultiplier,a=n.smooth,c=n.wrapper,d=void 0===c?window:c,v=n.content,p=void 0===v?document.documentElement:v,f=n.smoothWheel,m=void 0===f?null==a||a:f,b=n.smoothTouch,w=void 0!==b&&b,I=n.duration,J=n.easing,Q=void 0===J?function(t){return Math.min(1,1.001-Math.pow(2,-10*t))}:J,Z=n.lerp,$=void 0===Z?I?null:.1:Z,tt=n.infinite,et=void 0!==tt&&tt,it=n.orientation,nt=void 0===it?null!=r?r:"vertical":it,ot=n.gestureOrientation,rt=void 0===ot?null!=l?l:"vertical":ot,st=n.touchMultiplier,lt=void 0===st?2:st,ht=n.wheelMultiplier,at=void 0===ht?null!=h?h:1:ht,ut=n.normalizeWheel,ct=void 0===ut||ut;Object.defineProperty(this,A,{get:void 0,set:G}),Object.defineProperty(this,q,{get:void 0,set:K}),Object.defineProperty(this,U,{get:void 0,set:F}),Object.defineProperty(this,D,{get:V,set:void 0}),Object.defineProperty(this,Y,{get:N,set:void 0}),Object.defineProperty(this,_,{value:B}),Object.defineProperty(this,g,{writable:!0,value:void 0}),Object.defineProperty(this,O,{writable:!0,value:void 0}),Object.defineProperty(this,j,{writable:!0,value:void 0}),Object.defineProperty(this,P,{writable:!0,value:void 0}),Object.defineProperty(this,S,{writable:!0,value:void 0}),Object.defineProperty(this,M,{writable:!0,value:void 0}),Object.defineProperty(this,T,{writable:!0,value:void 0}),Object.defineProperty(this,z,{writable:!0,value:void 0}),Object.defineProperty(this,L,{writable:!0,value:void 0}),Object.defineProperty(this,E,{writable:!0,value:void 0}),Object.defineProperty(this,W,{writable:!0,value:void 0}),Object.defineProperty(this,k,{writable:!0,value:void 0}),Object.defineProperty(this,R,{writable:!0,value:void 0}),Object.defineProperty(this,C,{writable:!0,value:void 0}),Object.defineProperty(this,H,{writable:!0,value:void 0}),Object.defineProperty(this,x,{writable:!0,value:function(t){var e=t.type,n=t.deltaX,r=t.deltaY,s=t.event;if(!s.ctrlKey&&!("vertical"===o(i,g)[g].gestureOrientation&&0===r||"horizontal"===o(i,g)[g].gestureOrientation&&0===n||s.composedPath().find(function(t){return null==t||null==t.hasAttribute?void 0:t.hasAttribute("data-lenis-prevent")})))if(i.isStopped||o(i,H)[H])s.preventDefault();else{if(o(i,U)[U]=o(i,g)[g].smoothTouch&&"touch"===e||o(i,g)[g].smoothWheel&&"wheel"===e,!i.isSmooth)return o(i,q)[q]=!1,void o(i,P)[P].stop();s.preventDefault();var l=r;"both"===o(i,g)[g].gestureOrientation?l=n+r:"horizontal"===o(i,g)[g].gestureOrientation&&(l=n),console.log("scrollTo",o(i,W)[W]+l),i.scrollTo(o(i,W)[W]+l,{},!1)}}}),Object.defineProperty(this,X,{writable:!0,value:function(){if(!i.isScrolling){var t=o(i,E)[E];o(i,E)[E]=o(i,W)[W]=o(i,D)[D],o(i,z)[z]=0,o(i,L)[L]=Math.sign(o(i,E)[E]-t),i.emit()}}}),r&&console.warn("Lenis: `direction` option is deprecated, use `orientation` instead"),l&&console.warn("Lenis: `gestureDirection` option is deprecated, use `gestureOrientation` instead"),h&&console.warn("Lenis: `mouseMultiplier` option is deprecated, use `wheelMultiplier` instead"),a&&console.warn("Lenis: `smooth` option is deprecated, use `smoothWheel` instead"),window.lenisVersion="1.0.0-dev.4",d!==document.documentElement&&d!==document.body||(d=window),o(this,g)[g]={wrapper:d,content:p,smoothWheel:m,smoothTouch:w,duration:I,easing:Q,lerp:$,infinite:et,gestureOrientation:rt,orientation:nt,touchMultiplier:lt,wheelMultiplier:at,normalizeWheel:ct},o(this,O)[O]=new u(d),o(this,j)[j]=new u(p),o(this,Y)[Y].classList.add("lenis"),o(this,z)[z]=0,o(this,A)[A]=!1,o(this,U)[U]=m||w,o(this,q)[q]=!1,o(this,W)[W]=o(this,E)[E]=o(this,D)[D],o(this,P)[P]=new s,o(this,S)[S]=t.createNanoEvents(),o(this,O)[O].element.addEventListener("scroll",o(this,X)[X],{passive:!1}),o(this,M)[M]=new y(d,{touchMultiplier:lt,wheelMultiplier:at,normalizeWheel:ct}),o(this,M)[M].on("scroll",o(this,x)[x])}var n,l,h=i.prototype;return h.destroy=function(){o(this,S)[S].events={},o(this,O)[O].element.removeEventListener("scroll",o(this,X)[X],{passive:!1}),o(this,M)[M].destroy()},h.on=function(t,e){return o(this,S)[S].on(t,e)},h.emit=function(){o(this,S)[S].emit("scroll",this)},h.start=function(){o(this,A)[A]=!1},h.stop=function(){o(this,A)[A]=!0,o(this,P)[P].stop()},h.raf=function(t){var e=t-(o(this,T)[T]||t);o(this,T)[T]=t,o(this,P)[P].advance(.001*e)},h.scrollTo=function(t,e,i){var n=this,s=void 0===e?{}:e,l=s.offset,h=void 0===l?0:l,a=s.immediate,u=void 0!==a&&a,c=s.lock,d=void 0!==c&&c,v=s.duration,p=void 0===v?o(this,g)[g].duration:v,f=s.easing,m=void 0===f?o(this,g)[g].easing:f,b=s.lerp,w=void 0===b?o(this,g)[g].lerp:b,y=s.onComplete;if(void 0===i&&(i=!0),["top","left","start"].includes(t))t=0;else if(["bottom","right","end"].includes(t))t=this.limit;else{var j,S;if("string"==typeof t?S=document.querySelector(t):null!=(j=t)&&j.nodeType&&(S=t),S){if(o(this,O)[O].element!==window){var M=o(this,O)[O].element.getBoundingClientRect();h-=this.isHorizontal?M.left:M.top}var T=S.getBoundingClientRect();t=(this.isHorizontal?T.left:T.top)+o(this,E)[E]}}if("number"==typeof t)if(t+=h,o(this,g)[g].infinite?i&&(o(this,W)[W]=o(this,E)[E]=this.scroll):t=r(0,t,this.limit),o(this,E)[E]!==t){if(u)return o(this,E)[E]=o(this,W)[W]=t,o(this,_)[_](t),this.emit(),void(null==y||y());i||(o(this,W)[W]=t),o(this,P)[P].fromTo(o(this,E)[E],t,{duration:p,easing:m,lerp:w,onStart:function(){d&&(o(n,H)[H]=!0),o(n,q)[q]=!0},onUpdate:function(t){o(n,z)[z]=t-o(n,E)[E],o(n,L)[L]=Math.sign(o(n,z)[z]),o(n,E)[E]=t,o(n,_)[_](t),i&&(o(n,W)[W]=t),n.emit()},onComplete:function(t){d&&(o(n,H)[H]=!1),requestAnimationFrame(function(){o(n,q)[q]=!1}),o(n,z)[z]=0,n.emit(),null==y||y()}})}else null==y||y()},n=i,(l=[{key:"options",get:function(){return e({},o(this,g)[g])}},{key:"limit",get:function(){return Math.round(this.isHorizontal?o(this,j)[j].width-o(this,O)[O].width:o(this,j)[j].height-o(this,O)[O].height)}},{key:"isHorizontal",get:function(){return"horizontal"===o(this,g)[g].orientation}},{key:"scroll",get:function(){return o(this,g)[g].infinite?(e=o(this,E)[E]%(t=this.limit),(t>0&&e<0||t<0&&e>0)&&(e+=t),e):o(this,E)[E];var t,e}},{key:"progress",get:function(){return this.scroll/this.limit}},{key:"velocity",get:function(){return o(this,z)[z]}},{key:"direction",get:function(){return o(this,L)[L]}},{key:"isSmooth",get:function(){return o(this,C)[C]}},{key:"isScrolling",get:function(){return o(this,k)[k]}},{key:"isStopped",get:function(){return o(this,R)[R]}}])&&function(t,e){for(var i=0;i=1)?1:this.easing(l);this.value=this.from+(this.to-this.from)*h}null==(e=this.onUpdate)||e.call(this,this.value),s&&(null==(o=this.onComplete)||o.call(this,this.to),this.stop())}},e.stop=function(){this.isRunning=!1},e.fromTo=function(t,e,i){var n=i.lerp,o=void 0===n?.1:n,r=i.duration,s=void 0===r?1:r,l=i.easing,h=void 0===l?function(t){return t}:l,a=i.onStart,u=i.onUpdate,c=i.onComplete;this.from=this.value=t,this.to=e,this.lerp=o,this.duration=s,this.easing=h,this.currentTime=0,this.isRunning=!0,this.onStart=a,this.onUpdate=u,this.onComplete=c},t}(),l=/*#__PURE__*/n("resizeObserver"),h=/*#__PURE__*/n("onResize"),a=/*#__PURE__*/n("onWindowResize"),u=/*#__PURE__*/function(){function t(t){var e=this;Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,h,{writable:!0,value:function(t){var i=t[0];if(i){var n=i.contentRect,o=n.height;e.width=n.width,e.height=o}}}),Object.defineProperty(this,a,{writable:!0,value:function(){e.width=window.innerWidth,e.height=window.innerHeight}}),this.element=t,t===window?(window.addEventListener("resize",o(this,a)[a]),o(this,a)[a]()):(this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,o(this,l)[l]=new ResizeObserver(o(this,h)[h]),o(this,l)[l].observe(this.element))}return t.prototype.destroy=function(){window.removeEventListener("resize",this.onWindowResize),o(this,l)[l].disconnect()},t}(),c=/*#__PURE__*/n("wheelMultiplier"),d=/*#__PURE__*/n("touchMultiplier"),v=/*#__PURE__*/n("normalizeWheel"),p=/*#__PURE__*/n("touchStart"),f=/*#__PURE__*/n("emitter"),m=/*#__PURE__*/n("onTouchStart"),b=/*#__PURE__*/n("onTouchMove"),w=/*#__PURE__*/n("onWheel"),y=/*#__PURE__*/function(){function e(e,i){var n=this,s=i.wheelMultiplier,l=void 0===s?1:s,h=i.touchMultiplier,a=void 0===h?2:h,u=i.normalizeWheel,y=void 0!==u&&u;Object.defineProperty(this,c,{writable:!0,value:void 0}),Object.defineProperty(this,d,{writable:!0,value:void 0}),Object.defineProperty(this,v,{writable:!0,value:void 0}),Object.defineProperty(this,p,{writable:!0,value:void 0}),Object.defineProperty(this,f,{writable:!0,value:void 0}),Object.defineProperty(this,m,{writable:!0,value:function(t){var e=t.targetTouches?t.targetTouches[0]:t,i=e.pageX,r=e.pageY;o(n,p)[p].x=i,o(n,p)[p].y=r}}),Object.defineProperty(this,b,{writable:!0,value:function(t){var e=t.targetTouches?t.targetTouches[0]:t,i=e.pageX,r=e.pageY,s=-(i-o(n,p)[p].x)*o(n,d)[d],l=-(r-o(n,p)[p].y)*o(n,d)[d];o(n,p)[p].x=i,o(n,p)[p].y=r,o(n,f)[f].emit("scroll",{type:"touch",deltaX:s,deltaY:l,event:t})}}),Object.defineProperty(this,w,{writable:!0,value:function(t){var e=t.deltaX,i=t.deltaY;o(n,v)[v]&&(e=r(-100,e,100),i=r(-100,i,100)),e*=o(n,c)[c],i*=o(n,c)[c],o(n,f)[f].emit("scroll",{type:"wheel",deltaX:e,deltaY:i,event:t})}}),this.element=e,o(this,c)[c]=l,o(this,d)[d]=a,o(this,v)[v]=y,o(this,p)[p]={x:null,y:null},o(this,f)[f]=t.createNanoEvents(),this.element.addEventListener("wheel",o(this,w)[w],{passive:!1}),this.element.addEventListener("touchstart",o(this,m)[m],{passive:!1}),this.element.addEventListener("touchmove",o(this,b)[b],{passive:!1})}var i=e.prototype;return i.on=function(t,e){return o(this,f)[f].on(t,e)},i.destroy=function(){o(this,f)[f].events={},this.element.removeEventListener("wheel",o(this,w)[w],{passive:!1}),this.element.removeEventListener("touchstart",o(this,m)[m],{passive:!1}),this.element.removeEventListener("touchmove",o(this,b)[b],{passive:!1})},e}(),g=/*#__PURE__*/n("options"),O=/*#__PURE__*/n("wrapper"),j=/*#__PURE__*/n("content"),P=/*#__PURE__*/n("animate"),S=/*#__PURE__*/n("emitter"),M=/*#__PURE__*/n("virtualScroll"),T=/*#__PURE__*/n("time"),z=/*#__PURE__*/n("velocity"),L=/*#__PURE__*/n("direction"),E=/*#__PURE__*/n("animatedScroll"),W=/*#__PURE__*/n("targetScroll"),k=/*#__PURE__*/n("_isScrolling"),R=/*#__PURE__*/n("_isStopped"),C=/*#__PURE__*/n("_isSmooth"),H=/*#__PURE__*/n("isLocked"),_=/*#__PURE__*/n("setScroll"),x=/*#__PURE__*/n("onVirtualScroll"),X=/*#__PURE__*/n("onScroll"),Y=/*#__PURE__*/n("classElement"),D=/*#__PURE__*/n("actualScroll"),U=/*#__PURE__*/n("isSmooth"),q=/*#__PURE__*/n("isScrolling"),A=/*#__PURE__*/n("isStopped");function B(t){o(this,g)[g].infinite&&(t=this.scroll),this.isHorizontal?o(this,Y)[Y].scrollLeft=t:o(this,Y)[Y].scrollTop=t}function N(){return o(this,O)[O].element===window?o(this,j)[j].element:o(this,O)[O].element}function V(){return o(this,Y)[Y].scrollTop}function F(t){o(this,C)[C]!==t&&o(this,Y)[Y].classList.toggle("lenis-smooth",t),o(this,C)[C]=t}function K(t){o(this,k)[k]!==t&&o(this,Y)[Y].classList.toggle("lenis-scrolling",t),o(this,k)[k]=t}function G(t){o(this,R)[R]!==t&&o(this,Y)[Y].classList.toggle("lenis-stopped",t),o(this,R)[R]=t}module.exports=/*#__PURE__*/function(){function i(e){var i=this,n=void 0===e?{}:e,r=n.direction,l=n.gestureDirection,h=n.mouseMultiplier,a=n.smooth,c=n.wrapper,d=void 0===c?window:c,v=n.content,p=void 0===v?document.documentElement:v,f=n.smoothWheel,m=void 0===f?null==a||a:f,b=n.smoothTouch,w=void 0!==b&&b,I=n.duration,J=n.easing,Q=void 0===J?function(t){return Math.min(1,1.001-Math.pow(2,-10*t))}:J,Z=n.lerp,$=void 0===Z?I?null:.1:Z,tt=n.infinite,et=void 0!==tt&&tt,it=n.orientation,nt=void 0===it?null!=r?r:"vertical":it,ot=n.gestureOrientation,rt=void 0===ot?null!=l?l:"vertical":ot,st=n.touchMultiplier,lt=void 0===st?2:st,ht=n.wheelMultiplier,at=void 0===ht?null!=h?h:1:ht,ut=n.normalizeWheel,ct=void 0===ut||ut;Object.defineProperty(this,A,{get:void 0,set:G}),Object.defineProperty(this,q,{get:void 0,set:K}),Object.defineProperty(this,U,{get:void 0,set:F}),Object.defineProperty(this,D,{get:V,set:void 0}),Object.defineProperty(this,Y,{get:N,set:void 0}),Object.defineProperty(this,_,{value:B}),Object.defineProperty(this,g,{writable:!0,value:void 0}),Object.defineProperty(this,O,{writable:!0,value:void 0}),Object.defineProperty(this,j,{writable:!0,value:void 0}),Object.defineProperty(this,P,{writable:!0,value:void 0}),Object.defineProperty(this,S,{writable:!0,value:void 0}),Object.defineProperty(this,M,{writable:!0,value:void 0}),Object.defineProperty(this,T,{writable:!0,value:void 0}),Object.defineProperty(this,z,{writable:!0,value:void 0}),Object.defineProperty(this,L,{writable:!0,value:void 0}),Object.defineProperty(this,E,{writable:!0,value:void 0}),Object.defineProperty(this,W,{writable:!0,value:void 0}),Object.defineProperty(this,k,{writable:!0,value:void 0}),Object.defineProperty(this,R,{writable:!0,value:void 0}),Object.defineProperty(this,C,{writable:!0,value:void 0}),Object.defineProperty(this,H,{writable:!0,value:void 0}),Object.defineProperty(this,x,{writable:!0,value:function(t){var e=t.type,n=t.deltaX,r=t.deltaY,s=t.event;if(!s.ctrlKey&&!("vertical"===o(i,g)[g].gestureOrientation&&0===r||"horizontal"===o(i,g)[g].gestureOrientation&&0===n||s.composedPath().find(function(t){return null==t||null==t.hasAttribute?void 0:t.hasAttribute("data-lenis-prevent")})))if(i.isStopped||o(i,H)[H])s.preventDefault();else{if(o(i,U)[U]=o(i,g)[g].smoothTouch&&"touch"===e||o(i,g)[g].smoothWheel&&"wheel"===e,!i.isSmooth)return o(i,q)[q]=!1,void o(i,P)[P].stop();s.preventDefault();var l=r;"both"===o(i,g)[g].gestureOrientation?l=n+r:"horizontal"===o(i,g)[g].gestureOrientation&&(l=n),console.log("scrollTo",o(i,W)[W]+l),i.scrollTo(o(i,W)[W]+l,{},!1)}}}),Object.defineProperty(this,X,{writable:!0,value:function(){if(!i.isScrolling){var t=o(i,E)[E];o(i,E)[E]=o(i,W)[W]=o(i,D)[D],o(i,z)[z]=0,o(i,L)[L]=Math.sign(o(i,E)[E]-t),i.emit()}}}),r&&console.warn("Lenis: `direction` option is deprecated, use `orientation` instead"),l&&console.warn("Lenis: `gestureDirection` option is deprecated, use `gestureOrientation` instead"),h&&console.warn("Lenis: `mouseMultiplier` option is deprecated, use `wheelMultiplier` instead"),a&&console.warn("Lenis: `smooth` option is deprecated, use `smoothWheel` instead"),window.lenisVersion="1.0.0-dev.5",d!==document.documentElement&&d!==document.body||(d=window),o(this,g)[g]={wrapper:d,content:p,smoothWheel:m,smoothTouch:w,duration:I,easing:Q,lerp:$,infinite:et,gestureOrientation:rt,orientation:nt,touchMultiplier:lt,wheelMultiplier:at,normalizeWheel:ct},o(this,O)[O]=new u(d),o(this,j)[j]=new u(p),o(this,Y)[Y].classList.add("lenis"),o(this,z)[z]=0,o(this,A)[A]=!1,o(this,U)[U]=m||w,o(this,q)[q]=!1,o(this,W)[W]=o(this,E)[E]=o(this,D)[D],o(this,P)[P]=new s,o(this,S)[S]=t.createNanoEvents(),o(this,O)[O].element.addEventListener("scroll",o(this,X)[X],{passive:!1}),o(this,M)[M]=new y(d,{touchMultiplier:lt,wheelMultiplier:at,normalizeWheel:ct}),o(this,M)[M].on("scroll",o(this,x)[x])}var n,l,h=i.prototype;return h.destroy=function(){o(this,S)[S].events={},o(this,O)[O].element.removeEventListener("scroll",o(this,X)[X],{passive:!1}),o(this,M)[M].destroy()},h.on=function(t,e){return o(this,S)[S].on(t,e)},h.emit=function(){o(this,S)[S].emit("scroll",this)},h.start=function(){o(this,A)[A]=!1},h.stop=function(){o(this,A)[A]=!0,o(this,P)[P].stop()},h.raf=function(t){var e=t-(o(this,T)[T]||t);o(this,T)[T]=t,o(this,P)[P].advance(.001*e)},h.scrollTo=function(t,e,i){var n=this,s=void 0===e?{}:e,l=s.offset,h=void 0===l?0:l,a=s.immediate,u=void 0!==a&&a,c=s.lock,d=void 0!==c&&c,v=s.duration,p=void 0===v?o(this,g)[g].duration:v,f=s.easing,m=void 0===f?o(this,g)[g].easing:f,b=s.lerp,w=void 0===b?o(this,g)[g].lerp:b,y=s.onComplete;if(void 0===i&&(i=!0),["top","left","start"].includes(t))t=0;else if(["bottom","right","end"].includes(t))t=this.limit;else{var j,S;if("string"==typeof t?S=document.querySelector(t):null!=(j=t)&&j.nodeType&&(S=t),S){if(o(this,O)[O].element!==window){var M=o(this,O)[O].element.getBoundingClientRect();h-=this.isHorizontal?M.left:M.top}var T=S.getBoundingClientRect();t=(this.isHorizontal?T.left:T.top)+o(this,E)[E]}}if("number"==typeof t)if(t+=h,o(this,g)[g].infinite?i&&(o(this,W)[W]=o(this,E)[E]=this.scroll):t=r(0,t,this.limit),o(this,E)[E]!==t){if(u)return o(this,E)[E]=o(this,W)[W]=t,o(this,_)[_](t),this.emit(),void(null==y||y());i||(o(this,W)[W]=t),o(this,P)[P].fromTo(o(this,E)[E],t,{duration:p,easing:m,lerp:w,onStart:function(){d&&(o(n,H)[H]=!0),o(n,q)[q]=!0},onUpdate:function(t){o(n,z)[z]=t-o(n,E)[E],o(n,L)[L]=Math.sign(o(n,z)[z]),o(n,E)[E]=t,o(n,_)[_](t),i&&(o(n,W)[W]=t),n.emit()},onComplete:function(t){d&&(o(n,H)[H]=!1),requestAnimationFrame(function(){o(n,q)[q]=!1}),o(n,z)[z]=0,n.emit(),null==y||y()}})}else null==y||y()},n=i,(l=[{key:"options",get:function(){return e({},o(this,g)[g])}},{key:"limit",get:function(){return Math.round(this.isHorizontal?o(this,j)[j].width-o(this,O)[O].width:o(this,j)[j].height-o(this,O)[O].height)}},{key:"isHorizontal",get:function(){return"horizontal"===o(this,g)[g].orientation}},{key:"scroll",get:function(){return o(this,g)[g].infinite?(e=o(this,E)[E]%(t=this.limit),(t>0&&e<0||t<0&&e>0)&&(e+=t),e):o(this,E)[E];var t,e}},{key:"progress",get:function(){return this.scroll/this.limit}},{key:"velocity",get:function(){return o(this,z)[z]}},{key:"direction",get:function(){return o(this,L)[L]}},{key:"isSmooth",get:function(){return o(this,C)[C]}},{key:"isScrolling",get:function(){return o(this,k)[k]}},{key:"isStopped",get:function(){return o(this,R)[R]}}])&&function(t,e){for(var i=0;i=1)?1:this.easing(l);this.value=this.from+(this.to-this.from)*h}null==(e=this.onUpdate)||e.call(this,this.value),s&&(null==(o=this.onComplete)||o.call(this,this.to),this.stop())}},e.stop=function(){this.isRunning=!1},e.fromTo=function(t,e,i){var n=i.lerp,o=void 0===n?.1:n,r=i.duration,s=void 0===r?1:r,l=i.easing,h=void 0===l?function(t){return t}:l,a=i.onStart,u=i.onUpdate,c=i.onComplete;this.from=this.value=t,this.to=e,this.lerp=o,this.duration=s,this.easing=h,this.currentTime=0,this.isRunning=!0,this.onStart=a,this.onUpdate=u,this.onComplete=c},t}(),l=/*#__PURE__*/n("resizeObserver"),h=/*#__PURE__*/n("onResize"),a=/*#__PURE__*/n("onWindowResize"),u=/*#__PURE__*/function(){function t(t){var e=this;Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,h,{writable:!0,value:function(t){var i=t[0];if(i){var n=i.contentRect,o=n.height;e.width=n.width,e.height=o}}}),Object.defineProperty(this,a,{writable:!0,value:function(){e.width=window.innerWidth,e.height=window.innerHeight}}),this.element=t,t===window?(window.addEventListener("resize",o(this,a)[a]),o(this,a)[a]()):(this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,o(this,l)[l]=new ResizeObserver(o(this,h)[h]),o(this,l)[l].observe(this.element))}return t.prototype.destroy=function(){window.removeEventListener("resize",this.onWindowResize),o(this,l)[l].disconnect()},t}(),c=/*#__PURE__*/n("wheelMultiplier"),d=/*#__PURE__*/n("touchMultiplier"),v=/*#__PURE__*/n("normalizeWheel"),p=/*#__PURE__*/n("touchStart"),f=/*#__PURE__*/n("emitter"),m=/*#__PURE__*/n("onTouchStart"),b=/*#__PURE__*/n("onTouchMove"),w=/*#__PURE__*/n("onWheel"),y=/*#__PURE__*/function(){function e(e,i){var n=this,s=i.wheelMultiplier,l=void 0===s?1:s,h=i.touchMultiplier,a=void 0===h?2:h,u=i.normalizeWheel,y=void 0!==u&&u;Object.defineProperty(this,c,{writable:!0,value:void 0}),Object.defineProperty(this,d,{writable:!0,value:void 0}),Object.defineProperty(this,v,{writable:!0,value:void 0}),Object.defineProperty(this,p,{writable:!0,value:void 0}),Object.defineProperty(this,f,{writable:!0,value:void 0}),Object.defineProperty(this,m,{writable:!0,value:function(t){var e=t.targetTouches?t.targetTouches[0]:t,i=e.pageX,r=e.pageY;o(n,p)[p].x=i,o(n,p)[p].y=r}}),Object.defineProperty(this,b,{writable:!0,value:function(t){var e=t.targetTouches?t.targetTouches[0]:t,i=e.pageX,r=e.pageY,s=-(i-o(n,p)[p].x)*o(n,d)[d],l=-(r-o(n,p)[p].y)*o(n,d)[d];o(n,p)[p].x=i,o(n,p)[p].y=r,o(n,f)[f].emit("scroll",{type:"touch",deltaX:s,deltaY:l,event:t})}}),Object.defineProperty(this,w,{writable:!0,value:function(t){var e=t.deltaX,i=t.deltaY;o(n,v)[v]&&(e=r(-100,e,100),i=r(-100,i,100)),e*=o(n,c)[c],i*=o(n,c)[c],o(n,f)[f].emit("scroll",{type:"wheel",deltaX:e,deltaY:i,event:t})}}),this.element=e,o(this,c)[c]=l,o(this,d)[d]=a,o(this,v)[v]=y,o(this,p)[p]={x:null,y:null},o(this,f)[f]=t(),this.element.addEventListener("wheel",o(this,w)[w],{passive:!1}),this.element.addEventListener("touchstart",o(this,m)[m],{passive:!1}),this.element.addEventListener("touchmove",o(this,b)[b],{passive:!1})}var i=e.prototype;return i.on=function(t,e){return o(this,f)[f].on(t,e)},i.destroy=function(){o(this,f)[f].events={},this.element.removeEventListener("wheel",o(this,w)[w],{passive:!1}),this.element.removeEventListener("touchstart",o(this,m)[m],{passive:!1}),this.element.removeEventListener("touchmove",o(this,b)[b],{passive:!1})},e}(),g=/*#__PURE__*/n("options"),O=/*#__PURE__*/n("wrapper"),j=/*#__PURE__*/n("content"),P=/*#__PURE__*/n("animate"),S=/*#__PURE__*/n("emitter"),M=/*#__PURE__*/n("virtualScroll"),T=/*#__PURE__*/n("time"),z=/*#__PURE__*/n("velocity"),L=/*#__PURE__*/n("direction"),E=/*#__PURE__*/n("animatedScroll"),W=/*#__PURE__*/n("targetScroll"),k=/*#__PURE__*/n("_isScrolling"),R=/*#__PURE__*/n("_isStopped"),C=/*#__PURE__*/n("_isSmooth"),H=/*#__PURE__*/n("isLocked"),_=/*#__PURE__*/n("setScroll"),x=/*#__PURE__*/n("onVirtualScroll"),X=/*#__PURE__*/n("onScroll"),Y=/*#__PURE__*/n("classElement"),D=/*#__PURE__*/n("actualScroll"),U=/*#__PURE__*/n("isSmooth"),A=/*#__PURE__*/n("isScrolling"),q=/*#__PURE__*/n("isStopped"),B=/*#__PURE__*/function(){function i(e){var i=this,n=void 0===e?{}:e,r=n.direction,l=n.gestureDirection,h=n.mouseMultiplier,a=n.smooth,c=n.wrapper,d=void 0===c?window:c,v=n.content,p=void 0===v?document.documentElement:v,f=n.smoothWheel,m=void 0===f?null==a||a:f,b=n.smoothTouch,w=void 0!==b&&b,B=n.duration,N=n.easing,Q=void 0===N?function(t){return Math.min(1,1.001-Math.pow(2,-10*t))}:N,Z=n.lerp,$=void 0===Z?B?null:.1:Z,tt=n.infinite,et=void 0!==tt&&tt,it=n.orientation,nt=void 0===it?null!=r?r:"vertical":it,ot=n.gestureOrientation,rt=void 0===ot?null!=l?l:"vertical":ot,st=n.touchMultiplier,lt=void 0===st?2:st,ht=n.wheelMultiplier,at=void 0===ht?null!=h?h:1:ht,ut=n.normalizeWheel,ct=void 0===ut||ut;Object.defineProperty(this,q,{get:void 0,set:J}),Object.defineProperty(this,A,{get:void 0,set:I}),Object.defineProperty(this,U,{get:void 0,set:G}),Object.defineProperty(this,D,{get:K,set:void 0}),Object.defineProperty(this,Y,{get:F,set:void 0}),Object.defineProperty(this,_,{value:V}),Object.defineProperty(this,g,{writable:!0,value:void 0}),Object.defineProperty(this,O,{writable:!0,value:void 0}),Object.defineProperty(this,j,{writable:!0,value:void 0}),Object.defineProperty(this,P,{writable:!0,value:void 0}),Object.defineProperty(this,S,{writable:!0,value:void 0}),Object.defineProperty(this,M,{writable:!0,value:void 0}),Object.defineProperty(this,T,{writable:!0,value:void 0}),Object.defineProperty(this,z,{writable:!0,value:void 0}),Object.defineProperty(this,L,{writable:!0,value:void 0}),Object.defineProperty(this,E,{writable:!0,value:void 0}),Object.defineProperty(this,W,{writable:!0,value:void 0}),Object.defineProperty(this,k,{writable:!0,value:void 0}),Object.defineProperty(this,R,{writable:!0,value:void 0}),Object.defineProperty(this,C,{writable:!0,value:void 0}),Object.defineProperty(this,H,{writable:!0,value:void 0}),Object.defineProperty(this,x,{writable:!0,value:function(t){var e=t.type,n=t.deltaX,r=t.deltaY,s=t.event;if(!s.ctrlKey&&!("vertical"===o(i,g)[g].gestureOrientation&&0===r||"horizontal"===o(i,g)[g].gestureOrientation&&0===n||s.composedPath().find(function(t){return null==t||null==t.hasAttribute?void 0:t.hasAttribute("data-lenis-prevent")})))if(i.isStopped||o(i,H)[H])s.preventDefault();else{if(o(i,U)[U]=o(i,g)[g].smoothTouch&&"touch"===e||o(i,g)[g].smoothWheel&&"wheel"===e,!i.isSmooth)return o(i,A)[A]=!1,void o(i,P)[P].stop();s.preventDefault();var l=r;"both"===o(i,g)[g].gestureOrientation?l=n+r:"horizontal"===o(i,g)[g].gestureOrientation&&(l=n),console.log("scrollTo",o(i,W)[W]+l),i.scrollTo(o(i,W)[W]+l,{},!1)}}}),Object.defineProperty(this,X,{writable:!0,value:function(){if(!i.isScrolling){var t=o(i,E)[E];o(i,E)[E]=o(i,W)[W]=o(i,D)[D],o(i,z)[z]=0,o(i,L)[L]=Math.sign(o(i,E)[E]-t),i.emit()}}}),r&&console.warn("Lenis: `direction` option is deprecated, use `orientation` instead"),l&&console.warn("Lenis: `gestureDirection` option is deprecated, use `gestureOrientation` instead"),h&&console.warn("Lenis: `mouseMultiplier` option is deprecated, use `wheelMultiplier` instead"),a&&console.warn("Lenis: `smooth` option is deprecated, use `smoothWheel` instead"),window.lenisVersion="1.0.0-dev.4",d!==document.documentElement&&d!==document.body||(d=window),o(this,g)[g]={wrapper:d,content:p,smoothWheel:m,smoothTouch:w,duration:B,easing:Q,lerp:$,infinite:et,gestureOrientation:rt,orientation:nt,touchMultiplier:lt,wheelMultiplier:at,normalizeWheel:ct},o(this,O)[O]=new u(d),o(this,j)[j]=new u(p),o(this,Y)[Y].classList.add("lenis"),o(this,z)[z]=0,o(this,q)[q]=!1,o(this,U)[U]=m||w,o(this,A)[A]=!1,o(this,W)[W]=o(this,E)[E]=o(this,D)[D],o(this,P)[P]=new s,o(this,S)[S]=t(),o(this,O)[O].element.addEventListener("scroll",o(this,X)[X],{passive:!1}),o(this,M)[M]=new y(d,{touchMultiplier:lt,wheelMultiplier:at,normalizeWheel:ct}),o(this,M)[M].on("scroll",o(this,x)[x])}var n,l,h=i.prototype;return h.destroy=function(){o(this,S)[S].events={},o(this,O)[O].element.removeEventListener("scroll",o(this,X)[X],{passive:!1}),o(this,M)[M].destroy()},h.on=function(t,e){return o(this,S)[S].on(t,e)},h.emit=function(){o(this,S)[S].emit("scroll",this)},h.start=function(){o(this,q)[q]=!1},h.stop=function(){o(this,q)[q]=!0,o(this,P)[P].stop()},h.raf=function(t){var e=t-(o(this,T)[T]||t);o(this,T)[T]=t,o(this,P)[P].advance(.001*e)},h.scrollTo=function(t,e,i){var n=this,s=void 0===e?{}:e,l=s.offset,h=void 0===l?0:l,a=s.immediate,u=void 0!==a&&a,c=s.lock,d=void 0!==c&&c,v=s.duration,p=void 0===v?o(this,g)[g].duration:v,f=s.easing,m=void 0===f?o(this,g)[g].easing:f,b=s.lerp,w=void 0===b?o(this,g)[g].lerp:b,y=s.onComplete;if(void 0===i&&(i=!0),["top","left","start"].includes(t))t=0;else if(["bottom","right","end"].includes(t))t=this.limit;else{var j,S;if("string"==typeof t?S=document.querySelector(t):null!=(j=t)&&j.nodeType&&(S=t),S){if(o(this,O)[O].element!==window){var M=o(this,O)[O].element.getBoundingClientRect();h-=this.isHorizontal?M.left:M.top}var T=S.getBoundingClientRect();t=(this.isHorizontal?T.left:T.top)+o(this,E)[E]}}if("number"==typeof t)if(t+=h,o(this,g)[g].infinite?i&&(o(this,W)[W]=o(this,E)[E]=this.scroll):t=r(0,t,this.limit),o(this,E)[E]!==t){if(u)return o(this,E)[E]=o(this,W)[W]=t,o(this,_)[_](t),this.emit(),void(null==y||y());i||(o(this,W)[W]=t),o(this,P)[P].fromTo(o(this,E)[E],t,{duration:p,easing:m,lerp:w,onStart:function(){d&&(o(n,H)[H]=!0),o(n,A)[A]=!0},onUpdate:function(t){o(n,z)[z]=t-o(n,E)[E],o(n,L)[L]=Math.sign(o(n,z)[z]),o(n,E)[E]=t,o(n,_)[_](t),i&&(o(n,W)[W]=t),n.emit()},onComplete:function(t){d&&(o(n,H)[H]=!1),requestAnimationFrame(function(){o(n,A)[A]=!1}),o(n,z)[z]=0,n.emit(),null==y||y()}})}else null==y||y()},n=i,(l=[{key:"options",get:function(){return e({},o(this,g)[g])}},{key:"limit",get:function(){return Math.round(this.isHorizontal?o(this,j)[j].width-o(this,O)[O].width:o(this,j)[j].height-o(this,O)[O].height)}},{key:"isHorizontal",get:function(){return"horizontal"===o(this,g)[g].orientation}},{key:"scroll",get:function(){return o(this,g)[g].infinite?(e=o(this,E)[E]%(t=this.limit),(t>0&&e<0||t<0&&e>0)&&(e+=t),e):o(this,E)[E];var t,e}},{key:"progress",get:function(){return this.scroll/this.limit}},{key:"velocity",get:function(){return o(this,z)[z]}},{key:"direction",get:function(){return o(this,L)[L]}},{key:"isSmooth",get:function(){return o(this,C)[C]}},{key:"isScrolling",get:function(){return o(this,k)[k]}},{key:"isStopped",get:function(){return o(this,R)[R]}}])&&function(t,e){for(var i=0;i=1)?1:this.easing(l);this.value=this.from+(this.to-this.from)*h}null==(e=this.onUpdate)||e.call(this,this.value),s&&(null==(o=this.onComplete)||o.call(this,this.to),this.stop())}},e.stop=function(){this.isRunning=!1},e.fromTo=function(t,e,i){var n=i.lerp,o=void 0===n?.1:n,r=i.duration,s=void 0===r?1:r,l=i.easing,h=void 0===l?function(t){return t}:l,a=i.onStart,u=i.onUpdate,c=i.onComplete;this.from=this.value=t,this.to=e,this.lerp=o,this.duration=s,this.easing=h,this.currentTime=0,this.isRunning=!0,this.onStart=a,this.onUpdate=u,this.onComplete=c},t}(),l=/*#__PURE__*/n("resizeObserver"),h=/*#__PURE__*/n("onResize"),a=/*#__PURE__*/n("onWindowResize"),u=/*#__PURE__*/function(){function t(t){var e=this;Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,h,{writable:!0,value:function(t){var i=t[0];if(i){var n=i.contentRect,o=n.height;e.width=n.width,e.height=o}}}),Object.defineProperty(this,a,{writable:!0,value:function(){e.width=window.innerWidth,e.height=window.innerHeight}}),this.element=t,t===window?(window.addEventListener("resize",o(this,a)[a]),o(this,a)[a]()):(this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,o(this,l)[l]=new ResizeObserver(o(this,h)[h]),o(this,l)[l].observe(this.element))}return t.prototype.destroy=function(){window.removeEventListener("resize",this.onWindowResize),o(this,l)[l].disconnect()},t}(),c=/*#__PURE__*/n("wheelMultiplier"),d=/*#__PURE__*/n("touchMultiplier"),v=/*#__PURE__*/n("normalizeWheel"),p=/*#__PURE__*/n("touchStart"),f=/*#__PURE__*/n("emitter"),m=/*#__PURE__*/n("onTouchStart"),b=/*#__PURE__*/n("onTouchMove"),w=/*#__PURE__*/n("onWheel"),y=/*#__PURE__*/function(){function e(e,i){var n=this,s=i.wheelMultiplier,l=void 0===s?1:s,h=i.touchMultiplier,a=void 0===h?2:h,u=i.normalizeWheel,y=void 0!==u&&u;Object.defineProperty(this,c,{writable:!0,value:void 0}),Object.defineProperty(this,d,{writable:!0,value:void 0}),Object.defineProperty(this,v,{writable:!0,value:void 0}),Object.defineProperty(this,p,{writable:!0,value:void 0}),Object.defineProperty(this,f,{writable:!0,value:void 0}),Object.defineProperty(this,m,{writable:!0,value:function(t){var e=t.targetTouches?t.targetTouches[0]:t,i=e.pageX,r=e.pageY;o(n,p)[p].x=i,o(n,p)[p].y=r}}),Object.defineProperty(this,b,{writable:!0,value:function(t){var e=t.targetTouches?t.targetTouches[0]:t,i=e.pageX,r=e.pageY,s=-(i-o(n,p)[p].x)*o(n,d)[d],l=-(r-o(n,p)[p].y)*o(n,d)[d];o(n,p)[p].x=i,o(n,p)[p].y=r,o(n,f)[f].emit("scroll",{type:"touch",deltaX:s,deltaY:l,event:t})}}),Object.defineProperty(this,w,{writable:!0,value:function(t){var e=t.deltaX,i=t.deltaY;o(n,v)[v]&&(e=r(-100,e,100),i=r(-100,i,100)),e*=o(n,c)[c],i*=o(n,c)[c],o(n,f)[f].emit("scroll",{type:"wheel",deltaX:e,deltaY:i,event:t})}}),this.element=e,o(this,c)[c]=l,o(this,d)[d]=a,o(this,v)[v]=y,o(this,p)[p]={x:null,y:null},o(this,f)[f]=t(),this.element.addEventListener("wheel",o(this,w)[w],{passive:!1}),this.element.addEventListener("touchstart",o(this,m)[m],{passive:!1}),this.element.addEventListener("touchmove",o(this,b)[b],{passive:!1})}var i=e.prototype;return i.on=function(t,e){return o(this,f)[f].on(t,e)},i.destroy=function(){o(this,f)[f].events={},this.element.removeEventListener("wheel",o(this,w)[w],{passive:!1}),this.element.removeEventListener("touchstart",o(this,m)[m],{passive:!1}),this.element.removeEventListener("touchmove",o(this,b)[b],{passive:!1})},e}(),g=/*#__PURE__*/n("options"),O=/*#__PURE__*/n("wrapper"),j=/*#__PURE__*/n("content"),P=/*#__PURE__*/n("animate"),S=/*#__PURE__*/n("emitter"),M=/*#__PURE__*/n("virtualScroll"),T=/*#__PURE__*/n("time"),z=/*#__PURE__*/n("velocity"),L=/*#__PURE__*/n("direction"),E=/*#__PURE__*/n("animatedScroll"),W=/*#__PURE__*/n("targetScroll"),k=/*#__PURE__*/n("_isScrolling"),R=/*#__PURE__*/n("_isStopped"),C=/*#__PURE__*/n("_isSmooth"),H=/*#__PURE__*/n("isLocked"),_=/*#__PURE__*/n("setScroll"),x=/*#__PURE__*/n("onVirtualScroll"),X=/*#__PURE__*/n("onScroll"),Y=/*#__PURE__*/n("classElement"),D=/*#__PURE__*/n("actualScroll"),U=/*#__PURE__*/n("isSmooth"),A=/*#__PURE__*/n("isScrolling"),q=/*#__PURE__*/n("isStopped"),B=/*#__PURE__*/function(){function i(e){var i=this,n=void 0===e?{}:e,r=n.direction,l=n.gestureDirection,h=n.mouseMultiplier,a=n.smooth,c=n.wrapper,d=void 0===c?window:c,v=n.content,p=void 0===v?document.documentElement:v,f=n.smoothWheel,m=void 0===f?null==a||a:f,b=n.smoothTouch,w=void 0!==b&&b,B=n.duration,N=n.easing,Q=void 0===N?function(t){return Math.min(1,1.001-Math.pow(2,-10*t))}:N,Z=n.lerp,$=void 0===Z?B?null:.1:Z,tt=n.infinite,et=void 0!==tt&&tt,it=n.orientation,nt=void 0===it?null!=r?r:"vertical":it,ot=n.gestureOrientation,rt=void 0===ot?null!=l?l:"vertical":ot,st=n.touchMultiplier,lt=void 0===st?2:st,ht=n.wheelMultiplier,at=void 0===ht?null!=h?h:1:ht,ut=n.normalizeWheel,ct=void 0===ut||ut;Object.defineProperty(this,q,{get:void 0,set:J}),Object.defineProperty(this,A,{get:void 0,set:I}),Object.defineProperty(this,U,{get:void 0,set:G}),Object.defineProperty(this,D,{get:K,set:void 0}),Object.defineProperty(this,Y,{get:F,set:void 0}),Object.defineProperty(this,_,{value:V}),Object.defineProperty(this,g,{writable:!0,value:void 0}),Object.defineProperty(this,O,{writable:!0,value:void 0}),Object.defineProperty(this,j,{writable:!0,value:void 0}),Object.defineProperty(this,P,{writable:!0,value:void 0}),Object.defineProperty(this,S,{writable:!0,value:void 0}),Object.defineProperty(this,M,{writable:!0,value:void 0}),Object.defineProperty(this,T,{writable:!0,value:void 0}),Object.defineProperty(this,z,{writable:!0,value:void 0}),Object.defineProperty(this,L,{writable:!0,value:void 0}),Object.defineProperty(this,E,{writable:!0,value:void 0}),Object.defineProperty(this,W,{writable:!0,value:void 0}),Object.defineProperty(this,k,{writable:!0,value:void 0}),Object.defineProperty(this,R,{writable:!0,value:void 0}),Object.defineProperty(this,C,{writable:!0,value:void 0}),Object.defineProperty(this,H,{writable:!0,value:void 0}),Object.defineProperty(this,x,{writable:!0,value:function(t){var e=t.type,n=t.deltaX,r=t.deltaY,s=t.event;if(!s.ctrlKey&&!("vertical"===o(i,g)[g].gestureOrientation&&0===r||"horizontal"===o(i,g)[g].gestureOrientation&&0===n||s.composedPath().find(function(t){return null==t||null==t.hasAttribute?void 0:t.hasAttribute("data-lenis-prevent")})))if(i.isStopped||o(i,H)[H])s.preventDefault();else{if(o(i,U)[U]=o(i,g)[g].smoothTouch&&"touch"===e||o(i,g)[g].smoothWheel&&"wheel"===e,!i.isSmooth)return o(i,A)[A]=!1,void o(i,P)[P].stop();s.preventDefault();var l=r;"both"===o(i,g)[g].gestureOrientation?l=n+r:"horizontal"===o(i,g)[g].gestureOrientation&&(l=n),console.log("scrollTo",o(i,W)[W]+l),i.scrollTo(o(i,W)[W]+l,{},!1)}}}),Object.defineProperty(this,X,{writable:!0,value:function(){if(!i.isScrolling){var t=o(i,E)[E];o(i,E)[E]=o(i,W)[W]=o(i,D)[D],o(i,z)[z]=0,o(i,L)[L]=Math.sign(o(i,E)[E]-t),i.emit()}}}),r&&console.warn("Lenis: `direction` option is deprecated, use `orientation` instead"),l&&console.warn("Lenis: `gestureDirection` option is deprecated, use `gestureOrientation` instead"),h&&console.warn("Lenis: `mouseMultiplier` option is deprecated, use `wheelMultiplier` instead"),a&&console.warn("Lenis: `smooth` option is deprecated, use `smoothWheel` instead"),window.lenisVersion="1.0.0-dev.5",d!==document.documentElement&&d!==document.body||(d=window),o(this,g)[g]={wrapper:d,content:p,smoothWheel:m,smoothTouch:w,duration:B,easing:Q,lerp:$,infinite:et,gestureOrientation:rt,orientation:nt,touchMultiplier:lt,wheelMultiplier:at,normalizeWheel:ct},o(this,O)[O]=new u(d),o(this,j)[j]=new u(p),o(this,Y)[Y].classList.add("lenis"),o(this,z)[z]=0,o(this,q)[q]=!1,o(this,U)[U]=m||w,o(this,A)[A]=!1,o(this,W)[W]=o(this,E)[E]=o(this,D)[D],o(this,P)[P]=new s,o(this,S)[S]=t(),o(this,O)[O].element.addEventListener("scroll",o(this,X)[X],{passive:!1}),o(this,M)[M]=new y(d,{touchMultiplier:lt,wheelMultiplier:at,normalizeWheel:ct}),o(this,M)[M].on("scroll",o(this,x)[x])}var n,l,h=i.prototype;return h.destroy=function(){o(this,S)[S].events={},o(this,O)[O].element.removeEventListener("scroll",o(this,X)[X],{passive:!1}),o(this,M)[M].destroy()},h.on=function(t,e){return o(this,S)[S].on(t,e)},h.emit=function(){o(this,S)[S].emit("scroll",this)},h.start=function(){o(this,q)[q]=!1},h.stop=function(){o(this,q)[q]=!0,o(this,P)[P].stop()},h.raf=function(t){var e=t-(o(this,T)[T]||t);o(this,T)[T]=t,o(this,P)[P].advance(.001*e)},h.scrollTo=function(t,e,i){var n=this,s=void 0===e?{}:e,l=s.offset,h=void 0===l?0:l,a=s.immediate,u=void 0!==a&&a,c=s.lock,d=void 0!==c&&c,v=s.duration,p=void 0===v?o(this,g)[g].duration:v,f=s.easing,m=void 0===f?o(this,g)[g].easing:f,b=s.lerp,w=void 0===b?o(this,g)[g].lerp:b,y=s.onComplete;if(void 0===i&&(i=!0),["top","left","start"].includes(t))t=0;else if(["bottom","right","end"].includes(t))t=this.limit;else{var j,S;if("string"==typeof t?S=document.querySelector(t):null!=(j=t)&&j.nodeType&&(S=t),S){if(o(this,O)[O].element!==window){var M=o(this,O)[O].element.getBoundingClientRect();h-=this.isHorizontal?M.left:M.top}var T=S.getBoundingClientRect();t=(this.isHorizontal?T.left:T.top)+o(this,E)[E]}}if("number"==typeof t)if(t+=h,o(this,g)[g].infinite?i&&(o(this,W)[W]=o(this,E)[E]=this.scroll):t=r(0,t,this.limit),o(this,E)[E]!==t){if(u)return o(this,E)[E]=o(this,W)[W]=t,o(this,_)[_](t),this.emit(),void(null==y||y());i||(o(this,W)[W]=t),o(this,P)[P].fromTo(o(this,E)[E],t,{duration:p,easing:m,lerp:w,onStart:function(){d&&(o(n,H)[H]=!0),o(n,A)[A]=!0},onUpdate:function(t){o(n,z)[z]=t-o(n,E)[E],o(n,L)[L]=Math.sign(o(n,z)[z]),o(n,E)[E]=t,o(n,_)[_](t),i&&(o(n,W)[W]=t),n.emit()},onComplete:function(t){d&&(o(n,H)[H]=!1),requestAnimationFrame(function(){o(n,A)[A]=!1}),o(n,z)[z]=0,n.emit(),null==y||y()}})}else null==y||y()},n=i,(l=[{key:"options",get:function(){return e({},o(this,g)[g])}},{key:"limit",get:function(){return Math.round(this.isHorizontal?o(this,j)[j].width-o(this,O)[O].width:o(this,j)[j].height-o(this,O)[O].height)}},{key:"isHorizontal",get:function(){return"horizontal"===o(this,g)[g].orientation}},{key:"scroll",get:function(){return o(this,g)[g].infinite?(e=o(this,E)[E]%(t=this.limit),(t>0&&e<0||t<0&&e>0)&&(e+=t),e):o(this,E)[E];var t,e}},{key:"progress",get:function(){return this.scroll/this.limit}},{key:"velocity",get:function(){return o(this,z)[z]}},{key:"direction",get:function(){return o(this,L)[L]}},{key:"isSmooth",get:function(){return o(this,C)[C]}},{key:"isScrolling",get:function(){return o(this,k)[k]}},{key:"isStopped",get:function(){return o(this,R)[R]}}])&&function(t,e){for(var i=0;i=1;const i=s?1:this.easing(e);this.value=this.from+(this.to-this.from)*i}var o,r;null==(e=this.onUpdate)||e.call(this,this.value),s&&(null==(r=this.onComplete)||r.call(this,this.to),this.stop())}stop(){this.isRunning=!1}fromTo(t,e,{lerp:i=.1,duration:s=1,easing:o=(t=>t),onStart:n,onUpdate:r,onComplete:h}){this.from=this.value=t,this.to=e,this.lerp=i,this.duration=s,this.easing=o,this.currentTime=0,this.isRunning=!0,this.onStart=n,this.onUpdate=r,this.onComplete=h}}var h=/*#__PURE__*/s("resizeObserver"),l=/*#__PURE__*/s("onResize"),a=/*#__PURE__*/s("onWindowResize");class u{constructor(t){Object.defineProperty(this,h,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:([t])=>{if(t){const{width:e,height:i}=t.contentRect;this.width=e,this.height=i}}}),Object.defineProperty(this,a,{writable:!0,value:()=>{this.width=window.innerWidth,this.height=window.innerHeight}}),this.element=t,t===window?(window.addEventListener("resize",o(this,a)[a]),o(this,a)[a]()):(this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,o(this,h)[h]=new ResizeObserver(o(this,l)[l]),o(this,h)[h].observe(this.element))}destroy(){window.removeEventListener("resize",this.onWindowResize),o(this,h)[h].disconnect()}}var c=/*#__PURE__*/s("wheelMultiplier"),d=/*#__PURE__*/s("touchMultiplier"),p=/*#__PURE__*/s("normalizeWheel"),v=/*#__PURE__*/s("touchStart"),m=/*#__PURE__*/s("emitter"),f=/*#__PURE__*/s("onTouchStart"),w=/*#__PURE__*/s("onTouchMove"),b=/*#__PURE__*/s("onWheel");class g{constructor(e,{wheelMultiplier:i=1,touchMultiplier:s=2,normalizeWheel:r=!1}){Object.defineProperty(this,c,{writable:!0,value:void 0}),Object.defineProperty(this,d,{writable:!0,value:void 0}),Object.defineProperty(this,p,{writable:!0,value:void 0}),Object.defineProperty(this,v,{writable:!0,value:void 0}),Object.defineProperty(this,m,{writable:!0,value:void 0}),Object.defineProperty(this,f,{writable:!0,value:t=>{const{pageX:e,pageY:i}=t.targetTouches?t.targetTouches[0]:t;o(this,v)[v].x=e,o(this,v)[v].y=i}}),Object.defineProperty(this,w,{writable:!0,value:t=>{const{pageX:e,pageY:i}=t.targetTouches?t.targetTouches[0]:t,s=-(e-o(this,v)[v].x)*o(this,d)[d],n=-(i-o(this,v)[v].y)*o(this,d)[d];o(this,v)[v].x=e,o(this,v)[v].y=i,o(this,m)[m].emit("scroll",{type:"touch",deltaX:s,deltaY:n,event:t})}}),Object.defineProperty(this,b,{writable:!0,value:t=>{let{deltaX:e,deltaY:i}=t;o(this,p)[p]&&(e=n(-100,e,100),i=n(-100,i,100)),e*=o(this,c)[c],i*=o(this,c)[c],o(this,m)[m].emit("scroll",{type:"wheel",deltaX:e,deltaY:i,event:t})}}),this.element=e,o(this,c)[c]=i,o(this,d)[d]=s,o(this,p)[p]=r,o(this,v)[v]={x:null,y:null},o(this,m)[m]=t(),this.element.addEventListener("wheel",o(this,b)[b],{passive:!1}),this.element.addEventListener("touchstart",o(this,f)[f],{passive:!1}),this.element.addEventListener("touchmove",o(this,w)[w],{passive:!1})}on(t,e){return o(this,m)[m].on(t,e)}destroy(){o(this,m)[m].events={},this.element.removeEventListener("wheel",o(this,b)[b],{passive:!1}),this.element.removeEventListener("touchstart",o(this,f)[f],{passive:!1}),this.element.removeEventListener("touchmove",o(this,w)[w],{passive:!1})}}var y=/*#__PURE__*/s("options"),O=/*#__PURE__*/s("wrapper"),j=/*#__PURE__*/s("content"),P=/*#__PURE__*/s("animate"),S=/*#__PURE__*/s("emitter"),M=/*#__PURE__*/s("virtualScroll"),T=/*#__PURE__*/s("time"),z=/*#__PURE__*/s("velocity"),L=/*#__PURE__*/s("direction"),E=/*#__PURE__*/s("animatedScroll"),W=/*#__PURE__*/s("targetScroll"),R=/*#__PURE__*/s("_isScrolling"),C=/*#__PURE__*/s("_isStopped"),H=/*#__PURE__*/s("_isSmooth"),_=/*#__PURE__*/s("isLocked"),x=/*#__PURE__*/s("setScroll"),X=/*#__PURE__*/s("onVirtualScroll"),Y=/*#__PURE__*/s("onScroll"),D=/*#__PURE__*/s("classElement"),U=/*#__PURE__*/s("actualScroll"),A=/*#__PURE__*/s("isSmooth"),k=/*#__PURE__*/s("isScrolling"),q=/*#__PURE__*/s("isStopped");class B{constructor({direction:e,gestureDirection:i,mouseMultiplier:s,smooth:n,wrapper:h=window,content:l=document.documentElement,smoothWheel:a=null==n||n,smoothTouch:c=!1,duration:d,easing:p=(t=>Math.min(1,1.001-Math.pow(2,-10*t))),lerp:v=(d?null:.1),infinite:m=!1,orientation:f=(null!=e?e:"vertical"),gestureOrientation:w=(null!=i?i:"vertical"),touchMultiplier:b=2,wheelMultiplier:B=(null!=s?s:1),normalizeWheel:N=!0}={}){Object.defineProperty(this,q,{get:void 0,set:J}),Object.defineProperty(this,k,{get:void 0,set:I}),Object.defineProperty(this,A,{get:void 0,set:G}),Object.defineProperty(this,U,{get:K,set:void 0}),Object.defineProperty(this,D,{get:F,set:void 0}),Object.defineProperty(this,x,{value:V}),Object.defineProperty(this,y,{writable:!0,value:void 0}),Object.defineProperty(this,O,{writable:!0,value:void 0}),Object.defineProperty(this,j,{writable:!0,value:void 0}),Object.defineProperty(this,P,{writable:!0,value:void 0}),Object.defineProperty(this,S,{writable:!0,value:void 0}),Object.defineProperty(this,M,{writable:!0,value:void 0}),Object.defineProperty(this,T,{writable:!0,value:void 0}),Object.defineProperty(this,z,{writable:!0,value:void 0}),Object.defineProperty(this,L,{writable:!0,value:void 0}),Object.defineProperty(this,E,{writable:!0,value:void 0}),Object.defineProperty(this,W,{writable:!0,value:void 0}),Object.defineProperty(this,R,{writable:!0,value:void 0}),Object.defineProperty(this,C,{writable:!0,value:void 0}),Object.defineProperty(this,H,{writable:!0,value:void 0}),Object.defineProperty(this,_,{writable:!0,value:void 0}),Object.defineProperty(this,X,{writable:!0,value:({type:t,deltaX:e,deltaY:i,event:s})=>{if(s.ctrlKey)return;if("vertical"===o(this,y)[y].gestureOrientation&&0===i||"horizontal"===o(this,y)[y].gestureOrientation&&0===e)return;if(s.composedPath().find(t=>null==t||null==t.hasAttribute?void 0:t.hasAttribute("data-lenis-prevent")))return;if(this.isStopped||o(this,_)[_])return void s.preventDefault();if(o(this,A)[A]=o(this,y)[y].smoothTouch&&"touch"===t||o(this,y)[y].smoothWheel&&"wheel"===t,!this.isSmooth)return o(this,k)[k]=!1,void o(this,P)[P].stop();s.preventDefault();let n=i;"both"===o(this,y)[y].gestureOrientation?n=e+i:"horizontal"===o(this,y)[y].gestureOrientation&&(n=e),console.log("scrollTo",o(this,W)[W]+n),this.scrollTo(o(this,W)[W]+n,{},!1)}}),Object.defineProperty(this,Y,{writable:!0,value:()=>{if(!this.isScrolling){const t=o(this,E)[E];o(this,E)[E]=o(this,W)[W]=o(this,U)[U],o(this,z)[z]=0,o(this,L)[L]=Math.sign(o(this,E)[E]-t),this.emit()}}}),e&&console.warn("Lenis: `direction` option is deprecated, use `orientation` instead"),i&&console.warn("Lenis: `gestureDirection` option is deprecated, use `gestureOrientation` instead"),s&&console.warn("Lenis: `mouseMultiplier` option is deprecated, use `wheelMultiplier` instead"),n&&console.warn("Lenis: `smooth` option is deprecated, use `smoothWheel` instead"),window.lenisVersion="1.0.0-dev.4",h!==document.documentElement&&h!==document.body||(h=window),o(this,y)[y]={wrapper:h,content:l,smoothWheel:a,smoothTouch:c,duration:d,easing:p,lerp:v,infinite:m,gestureOrientation:w,orientation:f,touchMultiplier:b,wheelMultiplier:B,normalizeWheel:N},o(this,O)[O]=new u(h),o(this,j)[j]=new u(l),o(this,D)[D].classList.add("lenis"),o(this,z)[z]=0,o(this,q)[q]=!1,o(this,A)[A]=a||c,o(this,k)[k]=!1,o(this,W)[W]=o(this,E)[E]=o(this,U)[U],o(this,P)[P]=new r,o(this,S)[S]=t(),o(this,O)[O].element.addEventListener("scroll",o(this,Y)[Y],{passive:!1}),o(this,M)[M]=new g(h,{touchMultiplier:b,wheelMultiplier:B,normalizeWheel:N}),o(this,M)[M].on("scroll",o(this,X)[X])}destroy(){o(this,S)[S].events={},o(this,O)[O].element.removeEventListener("scroll",o(this,Y)[Y],{passive:!1}),o(this,M)[M].destroy()}on(t,e){return o(this,S)[S].on(t,e)}emit(){o(this,S)[S].emit("scroll",this)}start(){o(this,q)[q]=!1}stop(){o(this,q)[q]=!0,o(this,P)[P].stop()}raf(t){const e=t-(o(this,T)[T]||t);o(this,T)[T]=t,o(this,P)[P].advance(.001*e)}scrollTo(t,{offset:e=0,immediate:i=!1,lock:s=!1,duration:r=o(this,y)[y].duration,easing:h=o(this,y)[y].easing,lerp:l=o(this,y)[y].lerp,onComplete:a}={},u=!0){if(["top","left","start"].includes(t))t=0;else if(["bottom","right","end"].includes(t))t=this.limit;else{var c;let i;if("string"==typeof t?i=document.querySelector(t):null!=(c=t)&&c.nodeType&&(i=t),i){if(o(this,O)[O].element!==window){const t=o(this,O)[O].element.getBoundingClientRect();e-=this.isHorizontal?t.left:t.top}const s=i.getBoundingClientRect();t=(this.isHorizontal?s.left:s.top)+o(this,E)[E]}}if("number"==typeof t)if(t+=e,o(this,y)[y].infinite?u&&(o(this,W)[W]=o(this,E)[E]=this.scroll):t=n(0,t,this.limit),o(this,E)[E]!==t){if(i)return o(this,E)[E]=o(this,W)[W]=t,o(this,x)[x](t),this.emit(),void(null==a||a());u||(o(this,W)[W]=t),o(this,P)[P].fromTo(o(this,E)[E],t,{duration:r,easing:h,lerp:l,onStart:()=>{s&&(o(this,_)[_]=!0),o(this,k)[k]=!0},onUpdate:t=>{o(this,z)[z]=t-o(this,E)[E],o(this,L)[L]=Math.sign(o(this,z)[z]),o(this,E)[E]=t,o(this,x)[x](t),u&&(o(this,W)[W]=t),this.emit()},onComplete:t=>{s&&(o(this,_)[_]=!1),requestAnimationFrame(()=>{o(this,k)[k]=!1}),o(this,z)[z]=0,this.emit(),null==a||a()}})}else null==a||a()}get options(){return e({},o(this,y)[y])}get limit(){return Math.round(this.isHorizontal?o(this,j)[j].width-o(this,O)[O].width:o(this,j)[j].height-o(this,O)[O].height)}get isHorizontal(){return"horizontal"===o(this,y)[y].orientation}get scroll(){return o(this,y)[y].infinite?function(t,e){let i=t%e;return(e>0&&i<0||e<0&&i>0)&&(i+=e),i}(o(this,E)[E],this.limit):o(this,E)[E]}get progress(){return this.scroll/this.limit}get velocity(){return o(this,z)[z]}get direction(){return o(this,L)[L]}get isSmooth(){return o(this,H)[H]}get isScrolling(){return o(this,R)[R]}get isStopped(){return o(this,C)[C]}}function V(t){o(this,y)[y].infinite&&(t=this.scroll),this.isHorizontal?o(this,D)[D].scrollLeft=t:o(this,D)[D].scrollTop=t}function F(){return o(this,O)[O].element===window?o(this,j)[j].element:o(this,O)[O].element}function K(){return o(this,D)[D].scrollTop}function G(t){o(this,H)[H]!==t&&o(this,D)[D].classList.toggle("lenis-smooth",t),o(this,H)[H]=t}function I(t){o(this,R)[R]!==t&&o(this,D)[D].classList.toggle("lenis-scrolling",t),o(this,R)[R]=t}function J(t){o(this,C)[C]!==t&&o(this,D)[D].classList.toggle("lenis-stopped",t),o(this,C)[C]=t}export{B as default}; +import{createNanoEvents as t}from"nanoevents";function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e=1;const i=s?1:this.easing(e);this.value=this.from+(this.to-this.from)*i}var o,r;null==(e=this.onUpdate)||e.call(this,this.value),s&&(null==(r=this.onComplete)||r.call(this,this.to),this.stop())}stop(){this.isRunning=!1}fromTo(t,e,{lerp:i=.1,duration:s=1,easing:o=(t=>t),onStart:n,onUpdate:r,onComplete:h}){this.from=this.value=t,this.to=e,this.lerp=i,this.duration=s,this.easing=o,this.currentTime=0,this.isRunning=!0,this.onStart=n,this.onUpdate=r,this.onComplete=h}}var h=/*#__PURE__*/s("resizeObserver"),l=/*#__PURE__*/s("onResize"),a=/*#__PURE__*/s("onWindowResize");class u{constructor(t){Object.defineProperty(this,h,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:([t])=>{if(t){const{width:e,height:i}=t.contentRect;this.width=e,this.height=i}}}),Object.defineProperty(this,a,{writable:!0,value:()=>{this.width=window.innerWidth,this.height=window.innerHeight}}),this.element=t,t===window?(window.addEventListener("resize",o(this,a)[a]),o(this,a)[a]()):(this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,o(this,h)[h]=new ResizeObserver(o(this,l)[l]),o(this,h)[h].observe(this.element))}destroy(){window.removeEventListener("resize",this.onWindowResize),o(this,h)[h].disconnect()}}var c=/*#__PURE__*/s("wheelMultiplier"),d=/*#__PURE__*/s("touchMultiplier"),p=/*#__PURE__*/s("normalizeWheel"),v=/*#__PURE__*/s("touchStart"),m=/*#__PURE__*/s("emitter"),f=/*#__PURE__*/s("onTouchStart"),w=/*#__PURE__*/s("onTouchMove"),b=/*#__PURE__*/s("onWheel");class g{constructor(e,{wheelMultiplier:i=1,touchMultiplier:s=2,normalizeWheel:r=!1}){Object.defineProperty(this,c,{writable:!0,value:void 0}),Object.defineProperty(this,d,{writable:!0,value:void 0}),Object.defineProperty(this,p,{writable:!0,value:void 0}),Object.defineProperty(this,v,{writable:!0,value:void 0}),Object.defineProperty(this,m,{writable:!0,value:void 0}),Object.defineProperty(this,f,{writable:!0,value:t=>{const{pageX:e,pageY:i}=t.targetTouches?t.targetTouches[0]:t;o(this,v)[v].x=e,o(this,v)[v].y=i}}),Object.defineProperty(this,w,{writable:!0,value:t=>{const{pageX:e,pageY:i}=t.targetTouches?t.targetTouches[0]:t,s=-(e-o(this,v)[v].x)*o(this,d)[d],n=-(i-o(this,v)[v].y)*o(this,d)[d];o(this,v)[v].x=e,o(this,v)[v].y=i,o(this,m)[m].emit("scroll",{type:"touch",deltaX:s,deltaY:n,event:t})}}),Object.defineProperty(this,b,{writable:!0,value:t=>{let{deltaX:e,deltaY:i}=t;o(this,p)[p]&&(e=n(-100,e,100),i=n(-100,i,100)),e*=o(this,c)[c],i*=o(this,c)[c],o(this,m)[m].emit("scroll",{type:"wheel",deltaX:e,deltaY:i,event:t})}}),this.element=e,o(this,c)[c]=i,o(this,d)[d]=s,o(this,p)[p]=r,o(this,v)[v]={x:null,y:null},o(this,m)[m]=t(),this.element.addEventListener("wheel",o(this,b)[b],{passive:!1}),this.element.addEventListener("touchstart",o(this,f)[f],{passive:!1}),this.element.addEventListener("touchmove",o(this,w)[w],{passive:!1})}on(t,e){return o(this,m)[m].on(t,e)}destroy(){o(this,m)[m].events={},this.element.removeEventListener("wheel",o(this,b)[b],{passive:!1}),this.element.removeEventListener("touchstart",o(this,f)[f],{passive:!1}),this.element.removeEventListener("touchmove",o(this,w)[w],{passive:!1})}}var y=/*#__PURE__*/s("options"),O=/*#__PURE__*/s("wrapper"),j=/*#__PURE__*/s("content"),P=/*#__PURE__*/s("animate"),S=/*#__PURE__*/s("emitter"),M=/*#__PURE__*/s("virtualScroll"),T=/*#__PURE__*/s("time"),z=/*#__PURE__*/s("velocity"),L=/*#__PURE__*/s("direction"),E=/*#__PURE__*/s("animatedScroll"),W=/*#__PURE__*/s("targetScroll"),R=/*#__PURE__*/s("_isScrolling"),C=/*#__PURE__*/s("_isStopped"),H=/*#__PURE__*/s("_isSmooth"),_=/*#__PURE__*/s("isLocked"),x=/*#__PURE__*/s("setScroll"),X=/*#__PURE__*/s("onVirtualScroll"),Y=/*#__PURE__*/s("onScroll"),D=/*#__PURE__*/s("classElement"),U=/*#__PURE__*/s("actualScroll"),A=/*#__PURE__*/s("isSmooth"),k=/*#__PURE__*/s("isScrolling"),q=/*#__PURE__*/s("isStopped");class B{constructor({direction:e,gestureDirection:i,mouseMultiplier:s,smooth:n,wrapper:h=window,content:l=document.documentElement,smoothWheel:a=null==n||n,smoothTouch:c=!1,duration:d,easing:p=(t=>Math.min(1,1.001-Math.pow(2,-10*t))),lerp:v=(d?null:.1),infinite:m=!1,orientation:f=(null!=e?e:"vertical"),gestureOrientation:w=(null!=i?i:"vertical"),touchMultiplier:b=2,wheelMultiplier:B=(null!=s?s:1),normalizeWheel:N=!0}={}){Object.defineProperty(this,q,{get:void 0,set:J}),Object.defineProperty(this,k,{get:void 0,set:I}),Object.defineProperty(this,A,{get:void 0,set:G}),Object.defineProperty(this,U,{get:K,set:void 0}),Object.defineProperty(this,D,{get:F,set:void 0}),Object.defineProperty(this,x,{value:V}),Object.defineProperty(this,y,{writable:!0,value:void 0}),Object.defineProperty(this,O,{writable:!0,value:void 0}),Object.defineProperty(this,j,{writable:!0,value:void 0}),Object.defineProperty(this,P,{writable:!0,value:void 0}),Object.defineProperty(this,S,{writable:!0,value:void 0}),Object.defineProperty(this,M,{writable:!0,value:void 0}),Object.defineProperty(this,T,{writable:!0,value:void 0}),Object.defineProperty(this,z,{writable:!0,value:void 0}),Object.defineProperty(this,L,{writable:!0,value:void 0}),Object.defineProperty(this,E,{writable:!0,value:void 0}),Object.defineProperty(this,W,{writable:!0,value:void 0}),Object.defineProperty(this,R,{writable:!0,value:void 0}),Object.defineProperty(this,C,{writable:!0,value:void 0}),Object.defineProperty(this,H,{writable:!0,value:void 0}),Object.defineProperty(this,_,{writable:!0,value:void 0}),Object.defineProperty(this,X,{writable:!0,value:({type:t,deltaX:e,deltaY:i,event:s})=>{if(s.ctrlKey)return;if("vertical"===o(this,y)[y].gestureOrientation&&0===i||"horizontal"===o(this,y)[y].gestureOrientation&&0===e)return;if(s.composedPath().find(t=>null==t||null==t.hasAttribute?void 0:t.hasAttribute("data-lenis-prevent")))return;if(this.isStopped||o(this,_)[_])return void s.preventDefault();if(o(this,A)[A]=o(this,y)[y].smoothTouch&&"touch"===t||o(this,y)[y].smoothWheel&&"wheel"===t,!this.isSmooth)return o(this,k)[k]=!1,void o(this,P)[P].stop();s.preventDefault();let n=i;"both"===o(this,y)[y].gestureOrientation?n=e+i:"horizontal"===o(this,y)[y].gestureOrientation&&(n=e),console.log("scrollTo",o(this,W)[W]+n),this.scrollTo(o(this,W)[W]+n,{},!1)}}),Object.defineProperty(this,Y,{writable:!0,value:()=>{if(!this.isScrolling){const t=o(this,E)[E];o(this,E)[E]=o(this,W)[W]=o(this,U)[U],o(this,z)[z]=0,o(this,L)[L]=Math.sign(o(this,E)[E]-t),this.emit()}}}),e&&console.warn("Lenis: `direction` option is deprecated, use `orientation` instead"),i&&console.warn("Lenis: `gestureDirection` option is deprecated, use `gestureOrientation` instead"),s&&console.warn("Lenis: `mouseMultiplier` option is deprecated, use `wheelMultiplier` instead"),n&&console.warn("Lenis: `smooth` option is deprecated, use `smoothWheel` instead"),window.lenisVersion="1.0.0-dev.5",h!==document.documentElement&&h!==document.body||(h=window),o(this,y)[y]={wrapper:h,content:l,smoothWheel:a,smoothTouch:c,duration:d,easing:p,lerp:v,infinite:m,gestureOrientation:w,orientation:f,touchMultiplier:b,wheelMultiplier:B,normalizeWheel:N},o(this,O)[O]=new u(h),o(this,j)[j]=new u(l),o(this,D)[D].classList.add("lenis"),o(this,z)[z]=0,o(this,q)[q]=!1,o(this,A)[A]=a||c,o(this,k)[k]=!1,o(this,W)[W]=o(this,E)[E]=o(this,U)[U],o(this,P)[P]=new r,o(this,S)[S]=t(),o(this,O)[O].element.addEventListener("scroll",o(this,Y)[Y],{passive:!1}),o(this,M)[M]=new g(h,{touchMultiplier:b,wheelMultiplier:B,normalizeWheel:N}),o(this,M)[M].on("scroll",o(this,X)[X])}destroy(){o(this,S)[S].events={},o(this,O)[O].element.removeEventListener("scroll",o(this,Y)[Y],{passive:!1}),o(this,M)[M].destroy()}on(t,e){return o(this,S)[S].on(t,e)}emit(){o(this,S)[S].emit("scroll",this)}start(){o(this,q)[q]=!1}stop(){o(this,q)[q]=!0,o(this,P)[P].stop()}raf(t){const e=t-(o(this,T)[T]||t);o(this,T)[T]=t,o(this,P)[P].advance(.001*e)}scrollTo(t,{offset:e=0,immediate:i=!1,lock:s=!1,duration:r=o(this,y)[y].duration,easing:h=o(this,y)[y].easing,lerp:l=o(this,y)[y].lerp,onComplete:a}={},u=!0){if(["top","left","start"].includes(t))t=0;else if(["bottom","right","end"].includes(t))t=this.limit;else{var c;let i;if("string"==typeof t?i=document.querySelector(t):null!=(c=t)&&c.nodeType&&(i=t),i){if(o(this,O)[O].element!==window){const t=o(this,O)[O].element.getBoundingClientRect();e-=this.isHorizontal?t.left:t.top}const s=i.getBoundingClientRect();t=(this.isHorizontal?s.left:s.top)+o(this,E)[E]}}if("number"==typeof t)if(t+=e,o(this,y)[y].infinite?u&&(o(this,W)[W]=o(this,E)[E]=this.scroll):t=n(0,t,this.limit),o(this,E)[E]!==t){if(i)return o(this,E)[E]=o(this,W)[W]=t,o(this,x)[x](t),this.emit(),void(null==a||a());u||(o(this,W)[W]=t),o(this,P)[P].fromTo(o(this,E)[E],t,{duration:r,easing:h,lerp:l,onStart:()=>{s&&(o(this,_)[_]=!0),o(this,k)[k]=!0},onUpdate:t=>{o(this,z)[z]=t-o(this,E)[E],o(this,L)[L]=Math.sign(o(this,z)[z]),o(this,E)[E]=t,o(this,x)[x](t),u&&(o(this,W)[W]=t),this.emit()},onComplete:t=>{s&&(o(this,_)[_]=!1),requestAnimationFrame(()=>{o(this,k)[k]=!1}),o(this,z)[z]=0,this.emit(),null==a||a()}})}else null==a||a()}get options(){return e({},o(this,y)[y])}get limit(){return Math.round(this.isHorizontal?o(this,j)[j].width-o(this,O)[O].width:o(this,j)[j].height-o(this,O)[O].height)}get isHorizontal(){return"horizontal"===o(this,y)[y].orientation}get scroll(){return o(this,y)[y].infinite?function(t,e){let i=t%e;return(e>0&&i<0||e<0&&i>0)&&(i+=e),i}(o(this,E)[E],this.limit):o(this,E)[E]}get progress(){return this.scroll/this.limit}get velocity(){return o(this,z)[z]}get direction(){return o(this,L)[L]}get isSmooth(){return o(this,H)[H]}get isScrolling(){return o(this,R)[R]}get isStopped(){return o(this,C)[C]}}function V(t){o(this,y)[y].infinite&&(t=this.scroll),this.isHorizontal?o(this,D)[D].scrollLeft=t:o(this,D)[D].scrollTop=t}function F(){return o(this,O)[O].element===window?o(this,j)[j].element:o(this,O)[O].element}function K(){return o(this,D)[D].scrollTop}function G(t){o(this,H)[H]!==t&&o(this,D)[D].classList.toggle("lenis-smooth",t),o(this,H)[H]=t}function I(t){o(this,R)[R]!==t&&o(this,D)[D].classList.toggle("lenis-scrolling",t),o(this,R)[R]=t}function J(t){o(this,C)[C]!==t&&o(this,D)[D].classList.toggle("lenis-stopped",t),o(this,C)[C]=t}export{B as default}; //# sourceMappingURL=lenis.modern.mjs.map diff --git a/dist/lenis.umd.js b/dist/lenis.umd.js index c8108142..ab04c735 100644 --- a/dist/lenis.umd.js +++ b/dist/lenis.umd.js @@ -1,3 +1,3 @@ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("nanoevents")):"function"==typeof define&&define.amd?define(["nanoevents"],e):(t||self).lenis=e(t.nanoevents)}(this,function(t){function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e=1)?1:this.easing(l);this.value=this.from+(this.to-this.from)*h}null==(e=this.onUpdate)||e.call(this,this.value),s&&(null==(o=this.onComplete)||o.call(this,this.to),this.stop())}},e.stop=function(){this.isRunning=!1},e.fromTo=function(t,e,i){var n=i.lerp,o=void 0===n?.1:n,r=i.duration,s=void 0===r?1:r,l=i.easing,h=void 0===l?function(t){return t}:l,a=i.onStart,u=i.onUpdate,c=i.onComplete;this.from=this.value=t,this.to=e,this.lerp=o,this.duration=s,this.easing=h,this.currentTime=0,this.isRunning=!0,this.onStart=a,this.onUpdate=u,this.onComplete=c},t}(),l=/*#__PURE__*/n("resizeObserver"),h=/*#__PURE__*/n("onResize"),a=/*#__PURE__*/n("onWindowResize"),u=/*#__PURE__*/function(){function t(t){var e=this;Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,h,{writable:!0,value:function(t){var i=t[0];if(i){var n=i.contentRect,o=n.height;e.width=n.width,e.height=o}}}),Object.defineProperty(this,a,{writable:!0,value:function(){e.width=window.innerWidth,e.height=window.innerHeight}}),this.element=t,t===window?(window.addEventListener("resize",o(this,a)[a]),o(this,a)[a]()):(this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,o(this,l)[l]=new ResizeObserver(o(this,h)[h]),o(this,l)[l].observe(this.element))}return t.prototype.destroy=function(){window.removeEventListener("resize",this.onWindowResize),o(this,l)[l].disconnect()},t}(),c=/*#__PURE__*/n("wheelMultiplier"),d=/*#__PURE__*/n("touchMultiplier"),v=/*#__PURE__*/n("normalizeWheel"),p=/*#__PURE__*/n("touchStart"),f=/*#__PURE__*/n("emitter"),m=/*#__PURE__*/n("onTouchStart"),b=/*#__PURE__*/n("onTouchMove"),y=/*#__PURE__*/n("onWheel"),w=/*#__PURE__*/function(){function e(e,i){var n=this,s=i.wheelMultiplier,l=void 0===s?1:s,h=i.touchMultiplier,a=void 0===h?2:h,u=i.normalizeWheel,w=void 0!==u&&u;Object.defineProperty(this,c,{writable:!0,value:void 0}),Object.defineProperty(this,d,{writable:!0,value:void 0}),Object.defineProperty(this,v,{writable:!0,value:void 0}),Object.defineProperty(this,p,{writable:!0,value:void 0}),Object.defineProperty(this,f,{writable:!0,value:void 0}),Object.defineProperty(this,m,{writable:!0,value:function(t){var e=t.targetTouches?t.targetTouches[0]:t,i=e.pageX,r=e.pageY;o(n,p)[p].x=i,o(n,p)[p].y=r}}),Object.defineProperty(this,b,{writable:!0,value:function(t){var e=t.targetTouches?t.targetTouches[0]:t,i=e.pageX,r=e.pageY,s=-(i-o(n,p)[p].x)*o(n,d)[d],l=-(r-o(n,p)[p].y)*o(n,d)[d];o(n,p)[p].x=i,o(n,p)[p].y=r,o(n,f)[f].emit("scroll",{type:"touch",deltaX:s,deltaY:l,event:t})}}),Object.defineProperty(this,y,{writable:!0,value:function(t){var e=t.deltaX,i=t.deltaY;o(n,v)[v]&&(e=r(-100,e,100),i=r(-100,i,100)),e*=o(n,c)[c],i*=o(n,c)[c],o(n,f)[f].emit("scroll",{type:"wheel",deltaX:e,deltaY:i,event:t})}}),this.element=e,o(this,c)[c]=l,o(this,d)[d]=a,o(this,v)[v]=w,o(this,p)[p]={x:null,y:null},o(this,f)[f]=t.createNanoEvents(),this.element.addEventListener("wheel",o(this,y)[y],{passive:!1}),this.element.addEventListener("touchstart",o(this,m)[m],{passive:!1}),this.element.addEventListener("touchmove",o(this,b)[b],{passive:!1})}var i=e.prototype;return i.on=function(t,e){return o(this,f)[f].on(t,e)},i.destroy=function(){o(this,f)[f].events={},this.element.removeEventListener("wheel",o(this,y)[y],{passive:!1}),this.element.removeEventListener("touchstart",o(this,m)[m],{passive:!1}),this.element.removeEventListener("touchmove",o(this,b)[b],{passive:!1})},e}(),g=/*#__PURE__*/n("options"),O=/*#__PURE__*/n("wrapper"),j=/*#__PURE__*/n("content"),P=/*#__PURE__*/n("animate"),S=/*#__PURE__*/n("emitter"),T=/*#__PURE__*/n("virtualScroll"),M=/*#__PURE__*/n("time"),z=/*#__PURE__*/n("velocity"),L=/*#__PURE__*/n("direction"),E=/*#__PURE__*/n("animatedScroll"),W=/*#__PURE__*/n("targetScroll"),k=/*#__PURE__*/n("_isScrolling"),R=/*#__PURE__*/n("_isStopped"),x=/*#__PURE__*/n("_isSmooth"),C=/*#__PURE__*/n("isLocked"),H=/*#__PURE__*/n("setScroll"),_=/*#__PURE__*/n("onVirtualScroll"),X=/*#__PURE__*/n("onScroll"),Y=/*#__PURE__*/n("classElement"),D=/*#__PURE__*/n("actualScroll"),U=/*#__PURE__*/n("isSmooth"),q=/*#__PURE__*/n("isScrolling"),A=/*#__PURE__*/n("isStopped");function B(t){o(this,g)[g].infinite&&(t=this.scroll),this.isHorizontal?o(this,Y)[Y].scrollLeft=t:o(this,Y)[Y].scrollTop=t}function N(){return o(this,O)[O].element===window?o(this,j)[j].element:o(this,O)[O].element}function V(){return o(this,Y)[Y].scrollTop}function F(t){o(this,x)[x]!==t&&o(this,Y)[Y].classList.toggle("lenis-smooth",t),o(this,x)[x]=t}function K(t){o(this,k)[k]!==t&&o(this,Y)[Y].classList.toggle("lenis-scrolling",t),o(this,k)[k]=t}function G(t){o(this,R)[R]!==t&&o(this,Y)[Y].classList.toggle("lenis-stopped",t),o(this,R)[R]=t}/*#__PURE__*/ -return function(){function i(e){var i=this,n=void 0===e?{}:e,r=n.direction,l=n.gestureDirection,h=n.mouseMultiplier,a=n.smooth,c=n.wrapper,d=void 0===c?window:c,v=n.content,p=void 0===v?document.documentElement:v,f=n.smoothWheel,m=void 0===f?null==a||a:f,b=n.smoothTouch,y=void 0!==b&&b,I=n.duration,J=n.easing,Q=void 0===J?function(t){return Math.min(1,1.001-Math.pow(2,-10*t))}:J,Z=n.lerp,$=void 0===Z?I?null:.1:Z,tt=n.infinite,et=void 0!==tt&&tt,it=n.orientation,nt=void 0===it?null!=r?r:"vertical":it,ot=n.gestureOrientation,rt=void 0===ot?null!=l?l:"vertical":ot,st=n.touchMultiplier,lt=void 0===st?2:st,ht=n.wheelMultiplier,at=void 0===ht?null!=h?h:1:ht,ut=n.normalizeWheel,ct=void 0===ut||ut;Object.defineProperty(this,A,{get:void 0,set:G}),Object.defineProperty(this,q,{get:void 0,set:K}),Object.defineProperty(this,U,{get:void 0,set:F}),Object.defineProperty(this,D,{get:V,set:void 0}),Object.defineProperty(this,Y,{get:N,set:void 0}),Object.defineProperty(this,H,{value:B}),Object.defineProperty(this,g,{writable:!0,value:void 0}),Object.defineProperty(this,O,{writable:!0,value:void 0}),Object.defineProperty(this,j,{writable:!0,value:void 0}),Object.defineProperty(this,P,{writable:!0,value:void 0}),Object.defineProperty(this,S,{writable:!0,value:void 0}),Object.defineProperty(this,T,{writable:!0,value:void 0}),Object.defineProperty(this,M,{writable:!0,value:void 0}),Object.defineProperty(this,z,{writable:!0,value:void 0}),Object.defineProperty(this,L,{writable:!0,value:void 0}),Object.defineProperty(this,E,{writable:!0,value:void 0}),Object.defineProperty(this,W,{writable:!0,value:void 0}),Object.defineProperty(this,k,{writable:!0,value:void 0}),Object.defineProperty(this,R,{writable:!0,value:void 0}),Object.defineProperty(this,x,{writable:!0,value:void 0}),Object.defineProperty(this,C,{writable:!0,value:void 0}),Object.defineProperty(this,_,{writable:!0,value:function(t){var e=t.type,n=t.deltaX,r=t.deltaY,s=t.event;if(!s.ctrlKey&&!("vertical"===o(i,g)[g].gestureOrientation&&0===r||"horizontal"===o(i,g)[g].gestureOrientation&&0===n||s.composedPath().find(function(t){return null==t||null==t.hasAttribute?void 0:t.hasAttribute("data-lenis-prevent")})))if(i.isStopped||o(i,C)[C])s.preventDefault();else{if(o(i,U)[U]=o(i,g)[g].smoothTouch&&"touch"===e||o(i,g)[g].smoothWheel&&"wheel"===e,!i.isSmooth)return o(i,q)[q]=!1,void o(i,P)[P].stop();s.preventDefault();var l=r;"both"===o(i,g)[g].gestureOrientation?l=n+r:"horizontal"===o(i,g)[g].gestureOrientation&&(l=n),console.log("scrollTo",o(i,W)[W]+l),i.scrollTo(o(i,W)[W]+l,{},!1)}}}),Object.defineProperty(this,X,{writable:!0,value:function(){if(!i.isScrolling){var t=o(i,E)[E];o(i,E)[E]=o(i,W)[W]=o(i,D)[D],o(i,z)[z]=0,o(i,L)[L]=Math.sign(o(i,E)[E]-t),i.emit()}}}),r&&console.warn("Lenis: `direction` option is deprecated, use `orientation` instead"),l&&console.warn("Lenis: `gestureDirection` option is deprecated, use `gestureOrientation` instead"),h&&console.warn("Lenis: `mouseMultiplier` option is deprecated, use `wheelMultiplier` instead"),a&&console.warn("Lenis: `smooth` option is deprecated, use `smoothWheel` instead"),window.lenisVersion="1.0.0-dev.4",d!==document.documentElement&&d!==document.body||(d=window),o(this,g)[g]={wrapper:d,content:p,smoothWheel:m,smoothTouch:y,duration:I,easing:Q,lerp:$,infinite:et,gestureOrientation:rt,orientation:nt,touchMultiplier:lt,wheelMultiplier:at,normalizeWheel:ct},o(this,O)[O]=new u(d),o(this,j)[j]=new u(p),o(this,Y)[Y].classList.add("lenis"),o(this,z)[z]=0,o(this,A)[A]=!1,o(this,U)[U]=m||y,o(this,q)[q]=!1,o(this,W)[W]=o(this,E)[E]=o(this,D)[D],o(this,P)[P]=new s,o(this,S)[S]=t.createNanoEvents(),o(this,O)[O].element.addEventListener("scroll",o(this,X)[X],{passive:!1}),o(this,T)[T]=new w(d,{touchMultiplier:lt,wheelMultiplier:at,normalizeWheel:ct}),o(this,T)[T].on("scroll",o(this,_)[_])}var n,l,h=i.prototype;return h.destroy=function(){o(this,S)[S].events={},o(this,O)[O].element.removeEventListener("scroll",o(this,X)[X],{passive:!1}),o(this,T)[T].destroy()},h.on=function(t,e){return o(this,S)[S].on(t,e)},h.emit=function(){o(this,S)[S].emit("scroll",this)},h.start=function(){o(this,A)[A]=!1},h.stop=function(){o(this,A)[A]=!0,o(this,P)[P].stop()},h.raf=function(t){var e=t-(o(this,M)[M]||t);o(this,M)[M]=t,o(this,P)[P].advance(.001*e)},h.scrollTo=function(t,e,i){var n=this,s=void 0===e?{}:e,l=s.offset,h=void 0===l?0:l,a=s.immediate,u=void 0!==a&&a,c=s.lock,d=void 0!==c&&c,v=s.duration,p=void 0===v?o(this,g)[g].duration:v,f=s.easing,m=void 0===f?o(this,g)[g].easing:f,b=s.lerp,y=void 0===b?o(this,g)[g].lerp:b,w=s.onComplete;if(void 0===i&&(i=!0),["top","left","start"].includes(t))t=0;else if(["bottom","right","end"].includes(t))t=this.limit;else{var j,S;if("string"==typeof t?S=document.querySelector(t):null!=(j=t)&&j.nodeType&&(S=t),S){if(o(this,O)[O].element!==window){var T=o(this,O)[O].element.getBoundingClientRect();h-=this.isHorizontal?T.left:T.top}var M=S.getBoundingClientRect();t=(this.isHorizontal?M.left:M.top)+o(this,E)[E]}}if("number"==typeof t)if(t+=h,o(this,g)[g].infinite?i&&(o(this,W)[W]=o(this,E)[E]=this.scroll):t=r(0,t,this.limit),o(this,E)[E]!==t){if(u)return o(this,E)[E]=o(this,W)[W]=t,o(this,H)[H](t),this.emit(),void(null==w||w());i||(o(this,W)[W]=t),o(this,P)[P].fromTo(o(this,E)[E],t,{duration:p,easing:m,lerp:y,onStart:function(){d&&(o(n,C)[C]=!0),o(n,q)[q]=!0},onUpdate:function(t){o(n,z)[z]=t-o(n,E)[E],o(n,L)[L]=Math.sign(o(n,z)[z]),o(n,E)[E]=t,o(n,H)[H](t),i&&(o(n,W)[W]=t),n.emit()},onComplete:function(t){d&&(o(n,C)[C]=!1),requestAnimationFrame(function(){o(n,q)[q]=!1}),o(n,z)[z]=0,n.emit(),null==w||w()}})}else null==w||w()},n=i,(l=[{key:"options",get:function(){return e({},o(this,g)[g])}},{key:"limit",get:function(){return Math.round(this.isHorizontal?o(this,j)[j].width-o(this,O)[O].width:o(this,j)[j].height-o(this,O)[O].height)}},{key:"isHorizontal",get:function(){return"horizontal"===o(this,g)[g].orientation}},{key:"scroll",get:function(){return o(this,g)[g].infinite?(e=o(this,E)[E]%(t=this.limit),(t>0&&e<0||t<0&&e>0)&&(e+=t),e):o(this,E)[E];var t,e}},{key:"progress",get:function(){return this.scroll/this.limit}},{key:"velocity",get:function(){return o(this,z)[z]}},{key:"direction",get:function(){return o(this,L)[L]}},{key:"isSmooth",get:function(){return o(this,x)[x]}},{key:"isScrolling",get:function(){return o(this,k)[k]}},{key:"isStopped",get:function(){return o(this,R)[R]}}])&&function(t,e){for(var i=0;i0&&e<0||t<0&&e>0)&&(e+=t),e):o(this,E)[E];var t,e}},{key:"progress",get:function(){return this.scroll/this.limit}},{key:"velocity",get:function(){return o(this,z)[z]}},{key:"direction",get:function(){return o(this,L)[L]}},{key:"isSmooth",get:function(){return o(this,x)[x]}},{key:"isScrolling",get:function(){return o(this,k)[k]}},{key:"isStopped",get:function(){return o(this,R)[R]}}])&&function(t,e){for(var i=0;i