PageSourceSearch

https://www.discoverdurham.com/dist/lenis-D6yIm6uo.js

js discoverdurham.com collected 2026-10-02 04:31:09 UTC 17,699 bytes, 1 lines download raw bytes

1var _=Object.defineProperty;var k=(t,i,e)=>i in t?_(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e;var s=(t,i,e)=>k(t,typeof i!="symbol"?i+"":i,e);var M="1.3.17";function W(t,i,e){return Math.max(t,Math.min(i,e))}function C(t,i,e){return(1-e)*t+e*i}function D(t,i,e,n){return C(t,i,1-Math.exp(-e*n))}function X(t,i){return(t%i+i)%i}var Y=class{constructor(){s(this,"isRunning",!1);s(this,"value",0);s(this,"from",0);s(this,"to",0);s(this,"currentTime",0);s(this,"lerp");s(this,"duration");s(this,"easing");s(this,"onUpdate")}advance(t){if(!this.isRunning)return;let i=!1;if(this.duration&&this.easing){this.currentTime+=t;const e=W(0,this.currentTime/this.duration,1);i=e>=1;const n=i?1:this.easing(e);this.value=this.from+(this.to-this.from)*n}else this.lerp?(this.value=D(this.value,this.to,this.lerp*60,t),Math.round(this.value)===this.to&&(this.value=this.to,i=!0)):(this.value=this.to,i=!0);i&&this.stop(),this.onUpdate?.(this.value,i)}stop(){this.isRunning=!1}fromTo(t,i,{lerp:e,duration:n,easing:o,onStart:h,onUpdate:r}){this.from=this.value=t,this.to=i,this.lerp=e,this.duration=n,this.easing=o,this.currentTime=0,this.isRunning=!0,h?.(),this.onUpdate=r}};function A(t,i){let e;return function(...n){let o=this;clearTimeout(e),e=setTimeout(()=>{e=void 0,t.apply(o,n)},i)}}var P=class{constructor(t,i,{autoResize:e=!0,debounce:n=250}={}){s(this,"width",0);s(this,"height",0);s(this,"scrollHeight",0);s(this,"scrollWidth",0);s(this,"debouncedResize");s(this,"wrapperResizeObserver");s(this,"contentResizeObserver");s(this,"resize",()=>{this.onWrapperResize(),this.onContentResize()});s(this,"onWrapperResize",()=>{this.wrapper instanceof Window?(this.width=window.innerWidth,this.height=window.innerHeight):(this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight)});s(this,"onContentResize",()=>{this.wrapper instanceof Window?(this.scrollHeight=this.content.scrollHeight,this.scrollWidth=this.content.scrollWidth):(this.scrollHeight=this.wrapper.scrollHeight,this.scrollWidth=this.wrapper.scrollWidth)});this.wrapper=t,this.content=i,e&&(this.debouncedResize=A(this.resize,n),this.wrapper instanceof Window?window.addEventListener("resize",this.debouncedResize,!1):(this.wrapperResizeObserver=new ResizeObserver(this.debouncedResize),this.wrapperResizeObserver.observe(this.wrapper)),this.contentResizeObserver=new ResizeObserver(this.debouncedResize),this.contentResizeObserver.observe(this.content)),this.resize()}destroy(){this.wrapperResizeObserver?.disconnect(),this.contentResizeObserver?.disconnect(),this.wrapper===window&&this.debouncedResize&&window.removeEventListener("resize",this.debouncedResize,!1)}get limit(){return{x:this.scrollWidth-this.width,y:this.scrollHeight-this.height}}},H=class{constructor(){s(this,"events",{})}emit(t,...i){let e=this.events[t]||[];for(let n=0,o=e.length;n<o;n++)e[n]?.(...i)}on(t,i){return this.events[t]?.push(i)||(this.events[t]=[i]),()=>{this.events[t]=this.events[t]?.filter(e=>i!==e)}}off(t,i){this.events[t]=this.events[t]?.filter(e=>i!==e)}destroy(){this.events={}}},N=100/6,w={passive:!1},V=class{constructor(t,i={wheelMultiplier:1,touchMultiplier:1}){s(this,"touchStart",{x:0,y:0});s(this,"lastDelta",{x:0,y:0});s(this,"window",{width:0,height:0});s(this,"emitter",new H);s(this,"onTouchStart",t=>{const{clientX:i,clientY:e}=t.targetTouches?t.targetTouches[0]:t;this.touchStart.x=i,this.touchStart.y=e,this.lastDelta={x:0,y:0},this.emitter.emit("scroll",{deltaX:0,deltaY:0,event:t})});s(this,"onTouchMove",t=>{const{clientX:i,clientY:e}=t.targetTouches?t.targetTouches[0]:t,n=-(i-this.touchStart.x)*this.options.touchMultiplier,o=-(e-this.touchStart.y)*this.options.touchMultiplier;this.touchStart.x=i,this.touchStart.y=e,this.lastDelta={x:n,y:o},this.emitter.emit("scroll",{deltaX:n,deltaY:o,event:t})});s(this,"onTouchEnd",t=>{this.emitter.emit("scroll",{deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:t})});s(this,"onWheel",t=>{let{deltaX:i,deltaY:e,deltaMode:n}=t;const o=n===1?N:n===2?this.window.width:1,h=n===1?N:n===2?this.window.height:1;i*=o,e*=h,i*=this.options.wheelMultiplier,e*=this.options.wheelMultiplier,this.emitter.emit("scroll",{deltaX:i,deltaY:e,event:t})});s(this,"onWindowResize",()=>{this.window={width:window.innerWidth,height:window.innerHeight}});this.element=t,this.options=i,window.addEventListener("resize",this.onWindowResize,!1),this.onWindowResize(),this.element.addEventListener("wheel",this.onWheel,w),this.element.addEventListener("touchstart",this.onTouchStart,w),this.element.addEventListener("touchmove",this.onTouchMove,w),this.element.addEventListener("touchend",this.onTouchEnd,w)}on(t,i){return this.emitter.on(t,i)}destroy(){this.emitter.destroy(),window.removeEventListener("resize",this.onWindowResize,!1),this.element.removeEventListener("wheel",this.onWheel,w),this.element.removeEventListener("touchstart",this.onTouchStart,w),this.element.removeEventListener("touchmove",this.onTouchMove,w),this.element.removeEventListener("touchend",this.onTouchEnd,w)}},R=t=>Math.min(1,1.001-Math.pow(2,-10*t)),U=class{constructor({wrapper:t=window,content:i=document.documentElement,eventsTarget:e=t,smoothWheel:n=!0,syncTouch:o=!1,syncTouchLerp:h=.075,touchInertiaExponent:r=1.7,duration:a,easing:c,lerp:u=.1,infinite:f=!1,orientation:v="vertical",gestureOrientation:l=v==="horizontal"?"both":"vertical",touchMultiplier:p=1,wheelMultiplier:d=1,autoResize:S=!0,prevent:m,virtualScroll:y,overscroll:E=!0,autoRaf:T=!1,anchors:L=!1,autoToggle:g=!1,allowNestedScroll:b=!1,__experimental__naiveDimensions:z=!1,naiveDimensions:O=z,stopInertiaOnNavigate:x=!1}={}){s(this,"_isScrolling",!1);s(this,"_isStopped",!1);s(this,"_isLocked",!1);s(this,"_preventNextNativeScrollEvent",!1);s(this,"_resetVelocityTimeout",null);s(this,"_rafId",null);s(this,"isTouching");s(this,"time",0);s(this,"userData",{});s(this,"lastVelocity",0);s(this,"velocity",0);s(this,"direction",0);s(this,"options");s(this,"targetScroll");s(this,"animatedScroll");s(this,"animate",new Y);s(this,"emitter",new H);s(this,"dimensions");s(this,"virtualScroll");s(this,"onScrollEnd",t=>{t instanceof CustomEvent||(this.isScrolling==="smooth"||this.isScrolling===!1)&&t.stopPropagation()});s(this,"dispatchScrollendEvent",()=>{this.options.wrapper.dispatchEvent(new CustomEvent("scrollend",{bubbles:this.options.wrapper===window,detail:{lenisScrollEnd:!0}}))});s(this,"onTransitionEnd",t=>{t.propertyName.includes("overflow")&&this.checkOverflow()});s(this,"onClick",t=>{const e=t.composedPath().filter(n=>n instanceof HTMLAnchorElement&&n.getAttribute("href"));if(this.options.anchors){const n=e.find(o=>o.getAttribute("href")?.includes("#"));if(n){const o=n.getAttribute("href");if(o){const h=typeof this.options.anchors=="object"&&this.options.anchors?this.options.anchors:void 0,r=`#${o.split("#")[1]}`;this.scrollTo(r,h)}}}this.options.stopInertiaOnNavigate&&e.find(o=>o.host===window.location.host)&&this.reset()});s(this,"onPointerDown",t=>{t.button===1&&this.reset()});s(this,"onVirtualScroll",t=>{if(typeof this.options.virtualScroll=="function"&&this.options.virtualScroll(t)===!1)return;const{deltaX:i,deltaY:e,event:n}=t;if(this.emitter.emit("virtual-scroll",{deltaX:i,deltaY:e,event:n}),n.ctrlKey||n.lenisStopPropagation)return;const o=n.type.includes("touch"),h=n.type.includes("wheel");this.isTouching=n.type==="touchstart"||n.type==="touchmove";
1const r=i===0&&e===0;if(this.options.syncTouch&&o&&n.type==="touchstart"&&r&&!this.isStopped&&!this.isLocked){this.reset();return}const c=this.options.gestureOrientation==="vertical"&&e===0||this.options.gestureOrientation==="horizontal"&&i===0;if(r||c)return;let u=n.composedPath();u=u.slice(0,u.indexOf(this.rootElement));const f=this.options.prevent;if(u.find(m=>m instanceof HTMLElement&&(typeof f=="function"&&f?.(m)||m.hasAttribute?.("data-lenis-prevent")||o&&m.hasAttribute?.("data-lenis-prevent-touch")||h&&m.hasAttribute?.("data-lenis-prevent-wheel")||this.options.allowNestedScroll&&this.checkNestedScroll(m,{deltaX:i,deltaY:e}))))return;if(this.isStopped||this.isLocked){n.cancelable&&n.preventDefault();return}if(!(this.options.syncTouch&&o||this.options.smoothWheel&&h)){this.isScrolling="native",this.animate.stop(),n.lenisStopPropagation=!0;return}let l=e;this.options.gestureOrientation==="both"?l=Math.abs(e)>Math.abs(i)?e:i:this.options.gestureOrientation==="horizontal"&&(l=i),(!this.options.overscroll||this.options.infinite||this.options.wrapper!==window&&this.limit>0&&(this.animatedScroll>0&&this.animatedScroll<this.limit||this.animatedScroll===0&&e>0||this.animatedScroll===this.limit&&e<0))&&(n.lenisStopPropagation=!0),n.cancelable&&n.preventDefault();const p=o&&this.options.syncTouch,S=o&&n.type==="touchend";S&&(l=Math.sign(this.velocity)*Math.pow(Math.abs(this.velocity),this.options.touchInertiaExponent)),this.scrollTo(this.targetScroll+l,{programmatic:!1,...p?{lerp:S?this.options.syncTouchLerp:1}:{lerp:this.options.lerp,duration:this.options.duration,easing:this.options.easing}})});s(this,"onNativeScroll",()=>{if(this._resetVelocityTimeout!==null&&(clearTimeout(this._resetVelocityTimeout),this._resetVelocityTimeout=null),this._preventNextNativeScrollEvent){this._preventNextNativeScrollEvent=!1;return}if(this.isScrolling===!1||this.isScrolling==="native"){const t=this.animatedScroll;this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity,this.velocity=this.animatedScroll-t,this.direction=Math.sign(this.animatedScroll-t),this.isStopped||(this.isScrolling="native"),this.emit(),this.velocity!==0&&(this._resetVelocityTimeout=setTimeout(()=>{this.lastVelocity=this.velocity,this.velocity=0,this.isScrolling=!1,this.emit()},400))}});s(this,"raf",t=>{const i=t-(this.time||t);this.time=t,this.animate.advance(i*.001),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))});window.lenisVersion=M,(!t||t===document.documentElement)&&(t=window),typeof a=="number"&&typeof c!="function"?c=R:typeof c=="function"&&typeof a!="number"&&(a=1),this.options={wrapper:t,content:i,eventsTarget:e,smoothWheel:n,syncTouch:o,syncTouchLerp:h,touchInertiaExponent:r,duration:a,easing:c,lerp:u,infinite:f,gestureOrientation:l,orientation:v,touchMultiplier:p,wheelMultiplier:d,autoResize:S,prevent:m,virtualScroll:y,overscroll:E,autoRaf:T,anchors:L,autoToggle:g,allowNestedScroll:b,naiveDimensions:O,stopInertiaOnNavigate:x},this.dimensions=new P(t,i,{autoResize:S}),this.updateClassName(),this.targetScroll=this.animatedScroll=this.actualScroll,this.options.wrapper.addEventListener("scroll",this.onNativeScroll,!1),this.options.wrapper.addEventListener("scrollend",this.onScrollEnd,{capture:!0}),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.addEventListener("click",this.onClick,!1),this.options.wrapper.addEventListener("pointerdown",this.onPointerDown,!1),this.virtualScroll=new V(e,{touchMultiplier:p,wheelMultiplier:d}),this.virtualScroll.on("scroll",this.onVirtualScroll),this.options.autoToggle&&(this.checkOverflow(),this.rootElement.addEventListener("transitionend",this.onTransitionEnd,{passive:!0})),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))}destroy(){this.emitter.destroy(),this.options.wrapper.removeEventListener("scroll",this.onNativeScroll,!1),this.options.wrapper.removeEventListener("scrollend",this.onScrollEnd,{capture:!0}),this.options.wrapper.removeEventListener("pointerdown",this.onPointerDown,!1),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.removeEventListener("click",this.onClick,!1),this.virtualScroll.destroy(),this.dimensions.destroy(),this.cleanUpClassName(),this._rafId&&cancelAnimationFrame(this._rafId)}on(t,i){return this.emitter.on(t,i)}off(t,i){return this.emitter.off(t,i)}get overflow(){const t=this.isHorizontal?"overflow-x":"overflow-y";return getComputedStyle(this.rootElement)[t]}checkOverflow(){["hidden","clip"].includes(this.overflow)?this.internalStop():this.internalStart()}setScroll(t){this.isHorizontal?this.options.wrapper.scrollTo({left:t,behavior:"instant"}):this.options.wrapper.scrollTo({top:t,behavior:"instant"})}resize(){this.dimensions.resize(),this.animatedScroll=this.targetScroll=this.actualScroll,this.emit
1()}emit(){this.emitter.emit("scroll",this)}reset(){this.isLocked=!1,this.isScrolling=!1,this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity=0,this.animate.stop()}start(){if(this.isStopped){if(this.options.autoToggle){this.rootElement.style.removeProperty("overflow");return}this.internalStart()}}internalStart(){this.isStopped&&(this.reset(),this.isStopped=!1,this.emit())}stop(){if(!this.isStopped){if(this.options.autoToggle){this.rootElement.style.setProperty("overflow","clip");return}this.internalStop()}}internalStop(){this.isStopped||(this.reset(),this.isStopped=!0,this.emit())}scrollTo(t,{offset:i=0,immediate:e=!1,lock:n=!1,programmatic:o=!0,lerp:h=o?this.options.lerp:void 0,duration:r=o?this.options.duration:void 0,easing:a=o?this.options.easing:void 0,onStart:c,onComplete:u,force:f=!1,userData:v}={}){if(!((this.isStopped||this.isLocked)&&!f)){if(typeof t=="string"&&["top","left","start","#"].includes(t))t=0;else if(typeof t=="string"&&["bottom","right","end"].includes(t))t=this.limit;else{let l;if(typeof t=="string"?(l=document.querySelector(t),l||(t==="#top"?t=0:console.warn("Lenis: Target not found",t))):t instanceof HTMLElement&&t?.nodeType&&(l=t),l){if(this.options.wrapper!==window){const d=this.rootElement.getBoundingClientRect();i-=this.isHorizontal?d.left:d.top}const p=l.getBoundingClientRect();t=(this.isHorizontal?p.left:p.top)+this.animatedScroll}}if(typeof t=="number"){if(t+=i,t=Math.round(t),this.options.infinite){if(o){this.targetScroll=this.animatedScroll=this.scroll;const l=t-this.animatedScroll;l>this.limit/2?t=t-this.limit:l<-this.limit/2&&(t=t+this.limit)}}else t=W(0,t,this.limit);if(t===this.targetScroll){c?.(this),u?.(this);return}if(this.userData=v??{},e){this.animatedScroll=this.targetScroll=t,this.setScroll(this.scroll),this.reset(),this.preventNextNativeScrollEvent(),this.emit(),u?.(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()});return}o||(this.targetScroll=t),typeof r=="number"&&typeof a!="function"?a=R:typeof a=="function"&&typeof r!="number"&&(r=1),this.animate.fromTo(this.animatedScroll,t,{duration:r,easing:a,lerp:h,onStart:()=>{n&&(this.isLocked=!0),this.isScrolling="smooth",c?.(this)},onUpdate:(l,p)=>{this.isScrolling="smooth",this.lastVelocity=this.velocity,this.velocity=l-this.animatedScroll,this.direction=Math.sign(this.velocity),this.animatedScroll=l,this.setScroll(this.scroll),o&&(this.targetScroll=l),p||this.emit(),p&&(this.reset(),this.emit(),u?.(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()}),this.preventNextNativeScrollEvent())}})}}}preventNextNativeScrollEvent(){this._preventNextNativeScrollEvent=!0,requestAnimationFrame(()=>{this._preventNextNativeScrollEvent=!1})}checkNestedScroll(t,{deltaX:i,deltaY:e}){const n=Date.now(),o=t._lenis??(t._lenis={});let h,r,a,c,u,f,v,l;const p=this.options.gestureOrientation;if(n-(o.time??0)>2e3){o.time=Date.now();const g=window.getComputedStyle(t);o.computedStyle=g;const b=g.overflowX,z=g.overflowY;if(h=["auto","overlay","scroll"].includes(b),r=["auto","overlay","scroll"].includes(z),o.hasOverflowX=h,o.hasOverflowY=r,!h&&!r||p==="vertical"&&!r||p==="horizontal"&&!h)return!1;u=t.scrollWidth,f=t.scrollHeight,v=t.clientWidth,l=t.clientHeight,a=u>v,c=f>l,o.isScrollableX=a,o.isScrollableY=c,o.scrollWidth=u,o.scrollHeight=f,o.clientWidth=v,o.clientHeight=l}else a=o.isScrollableX,c=o.isScrollableY,h=o.hasOverflowX,r=o.hasOverflowY,u=o.scrollWidth,f=o.scrollHeight,v=o.clientWidth,l=o.clientHeight;if(!h&&!r||!a&&!c||p==="vertical"&&(!r||!c)||p==="horizontal"&&(!h||!a))return!1;let d;if(p==="horizontal")d="x";else if(p==="vertical")d="y";else{const g=i!==0,b=e!==0;g&&h&&a&&(d="x"),b&&r&&c&&(d="y")}if(!d)return!1;let S,m,y,E,T;if(d==="x")S=t.scrollLeft,m=u-v,y=i,E=h,T=a;else if(d==="y")S=t.scrollTop,m=f-l,y=e,E=r,T=c;else return!1;return(y>0?S<m:S>0)&&E&&T}get rootElement(){return this.options.wrapper===window?document.documentElement:this.options.wrapper}get limit(){return this.options.naiveDimensions?this.isHorizontal?this.rootElement.scrollWidth-this.rootElement.clientWidth:this.rootElement.scrollHeight-this.rootElement.clientHeight:this.dimensions.limit[this.isHorizontal?"x":"y"]}get isHorizontal(){return this.options.orientation==="horizontal"}get actualScroll(){const t=this.options.wrapper;return this.isHorizontal?t.scrollX??t.scrollLeft:t.scrollY??t.scrollTop}get scroll(){return this.options.infinite?X(this.animatedScroll,this.limit):this.animatedScroll}get progress(){return this.limit===0?1:this.scroll/this.limit}get isScrolling(){return this._isScrolling}set isScrolling(t){this._isScrolling!==t&&(this._isScrolling=t,this.updateClassName())}get isStopped(){return this._isStopped}set isStopped(t){this._isStopped!==t&&(this._isStopped=t,this.updateClassName())}get isLocked(){return this._isLocked}set isLocked(t){this._isLocked!==t&&(this._isLocked=t,this.updateClassName())}get isSmooth(){return this.isScrolling==="smooth"}get className(){let t="lenis";return this.options.autoToggle&&(t+=" lenis-autoToggle"),this.isStopped&&(t+=" lenis-stopped"),this.isLocked&&(t+=" lenis-locked"),this.isScrolling&&(t+=" lenis-scrolling"),this.isScrolling==="smooth"&&(t+=" lenis-smooth"),t}updateClassName(){this.cleanUpClassName(),this.rootElement.className=`${this.rootElement.className} ${this.className}`.trim()}cleanUpClassName(){this.rootElement.className=this.rootElement.className.replace(/lenis(-\w+)?/g,"").trim()}};export{U as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.