PageSourceSearch

https://www.hot-factory.jp/assets/lenis-react-BP8O2H7O.js

js hot-factory.jp collected 2026-10-04 07:35:45 UTC 21,636 bytes, 1 lines download raw bytes

1var X=Object.defineProperty;var Y=(t,e,i)=>e in t?X(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var r=(t,e,i)=>Y(t,typeof e!="symbol"?e+"":e,i);import{r as g,j as N}from"./jsx-runtime-CysHdCfF.js";var M="1.3.26";function H(t,e,i){return Math.max(t,Math.min(e,i))}function I(t,e,i){return(1-i)*t+i*e}function A(t,e,i,s){return I(t,e,1-Math.exp(-i*s))}function V(t,e){return(t%e+e)%e}var B=class{constructor(){r(this,"isRunning",!1);r(this,"value",0);r(this,"from",0);r(this,"to",0);r(this,"currentTime",0);r(this,"lerp");r(this,"duration");r(this,"easing");r(this,"onUpdate")}advance(t){var i;if(!this.isRunning)return;let e=!1;if(this.duration&&this.easing){this.currentTime+=t;const s=H(0,this.currentTime/this.duration,1);e=s>=1;const o=e?1:this.easing(s);this.value=this.from+(this.to-this.from)*o}else this.lerp?(this.value=A(this.value,this.to,this.lerp*60,t),Math.round(this.value)===Math.round(this.to)&&(this.value=this.to,e=!0)):(this.value=this.to,e=!0);e&&this.stop(),(i=this.onUpdate)==null||i.call(this,this.value,e)}stop(){this.isRunning=!1}fromTo(t,e,{lerp:i,duration:s,easing:o,onStart:a,onUpdate:p}){this.from=this.value=t,this.to=e,this.lerp=i,this.duration=s,this.easing=o,this.currentTime=0,this.isRunning=!0,a==null||a(),this.onUpdate=p}};function U(t,e){let i;return function(...s){clearTimeout(i),i=setTimeout(()=>{i=void 0,t.apply(this,s)},e)}}var F=class{constructor(t,e,{autoResize:i=!0,debounce:s=250}={}){r(this,"width",0);r(this,"height",0);r(this,"scrollHeight",0);r(this,"scrollWidth",0);r(this,"debouncedResize");r(this,"wrapperResizeObserver");r(this,"contentResizeObserver");r(this,"resize",()=>{this.onWrapperResize(),this.onContentResize()});r(this,"onWrapperResize",()=>{this.wrapper instanceof Window?(this.width=window.innerWidth,this.height=window.innerHeight):(this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight)});r(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=e,i&&(this.debouncedResize=U(this.resize,s),this.wrapper instanceof Window?window.addEventListener("resize",this.debouncedResize):(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(){var t,e;(t=this.wrapperResizeObserver)==null||t.disconnect(),(e=this.contentResizeObserver)==null||e.disconnect(),this.wrapper===window&&this.debouncedResize&&window.removeEventListener("resize",this.debouncedResize)}get limit(){return{x:this.scrollWidth-this.width,y:this.scrollHeight-this.height}}},_=class{constructor(){r(this,"events",{})}emit(t,...e){var s;const i=this.events[t]||[];for(let o=0,a=i.length;o<a;o++)(s=i[o])==null||s.call(i,...e)}on(t,e){return this.events[t]?this.events[t].push(e):this.events[t]=[e],()=>{var i;this.events[t]=(i=this.events[t])==null?void 0:i.filter(s=>e!==s)}}off(t,e){var i;this.events[t]=(i=this.events[t])==null?void 0:i.filter(s=>e!==s)}destroy(){this.events={}}};const j=100/6,T={passive:!1};function O(t,e){return t===1?j:t===2?e:1}var q=class{constructor(t,e={wheelMultiplier:1,touchMultiplier:1}){r(this,"touchStart",{x:0,y:0});r(this,"lastDelta",{x:0,y:0});r(this,"window",{width:0,height:0});r(this,"emitter",new _);r(this,"onTouchStart",t=>{const{clientX:e,clientY:i}=t.targetTouches?t.targetTouches[0]:t;this.touchStart.x=e,this.touchStart.y=i,this.lastDelta={x:0,y:0},this.emitter.emit("scroll",{deltaX:0,deltaY:0,event:t})});r(this,"onTouchMove",t=>{const{clientX:e,clientY:i}=t.targetTouches?t.targetTouches[0]:t,s=-(e-this.touchStart.x)*this.options.touchMultiplier,o=-(i-this.touchStart.y)*this.options.touchMultiplier;this.touchStart.x=e,this.touchStart.y=i,this.lastDelta={x:s,y:o},this.emitter.emit("scroll",{deltaX:s,deltaY:o,event:t})});r(this,"onTouchEnd",t=>{this.emitter.emit("scroll",{deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:t})});r(this,"onWheel",t=>{let{deltaX:e,deltaY:i,deltaMode:s}=t;const o=O(s,this.window.width),a=O(s,this.window.height);e*=o,i*=a,e*=this.options.wheelMultiplier,i*=this.options.wheelMultiplier,this.emitter.emit("scroll",{deltaX:e,deltaY:i,event:t})});r(this,"onWindowResize",()=>{this.window={width:window.innerWidth,height:window.innerHeight}});this.element=t,this.options=e,window.addEventListener("resize",this.onWindowResize),this.onWindowResize(),this.element.addEventListener("wheel",this.onWheel,T),this.element.addEventListener("touchstart",this.onTouchStart,T),this.element.addEventListener("touchmove",this.onTouchMove,T),this.element.addEventListener("touchend",this.onTouchEnd,T)}on(t,e){return this.emitter.on(t,e)}destroy(){this.emitter.destroy(),window.removeEventListener("resize",this.onWindowResize),this.element.removeEventListener("wheel",this.onWheel,T),this.element.removeEventListener("touchstart",this.onTouchStart,T),this.element.removeEventListener("touchmove",this.onTouchMove,T),this.element.removeEventListener("touchend",this.onTouchEnd,T)}};const x=t=>Math.min(1,1.001-2**(-10*t));var G=class{constructor({wrapper:t=window,content:e=document.documentElement,eventsTarget:i=t,smoothWheel:s=!0,syncTouch:o=!1,syncTouchLerp:a=.075,touchInertiaExponent:p=1.7,duration:u,easing:c,lerp:h=.1,infinite:w=!1,orientation:f="vertical",gestureOrientation:l=f==="horizontal"?"both":"vertical",touchMultiplier:m=1,wheelMultiplier:n=1,autoResize:d=!0,prevent:v,virtualScroll:S,overscroll:y=!0,autoRaf:E=!1,anchors:b=!1,autoToggle:z=!1,allowNestedScroll:L=!1,__experimental__naiveDimensions:k=!1,naiveDimensions:C=k,stopInertiaOnNavigate:D=!1,respectReducedMotion:P=!0}={}){r(this,"_isScrolling",!1);r(this,"_isStopped",!1);r(this,"_isLocked",!1);r(this,"_preventNextNativeScrollEvent",!1);r(this,"_resetVelocityTimeout",null);r(this,"_rafId",null);r(this,"_isDraggingSelection",!1);r(this,"reducedMotionMediaQuery",window.matchMedia("(prefers-reduced-motion: reduce)"));r(this,"isTouching");r(this,"isIos");r(this,"time",0);r(this,"userData",{});r(this,"lastVelocity",0);r(this,"velocity",0);r(this,"direction",0);r(this,"options");r(this,"targetScroll");r(this,"animatedScroll");r(this,"animate",new B);r(this,"emitter",new _);r(this,"dimensions");r(this,"virtualScroll");r(this,"onScrollEnd",t=>{t instanceof CustomEvent||(this.isScrolling==="smooth"||this.isScrolling===!1)&&t.stopPropagation()});r(this,"dispatchScrollendEvent",()=>{this.options.wrapper.dispatchEvent(new CustomEvent("scrollend",{bubbles:this.options.wrapper===window,detail:{lenisScrollEnd:!0}}))});r(this,"onTransitionEnd",t=>{var e;(e=t.propertyName)!=null&&e.includes("overflow")&&t.target===this.rootElement&&this.checkOverflow()});r(this,"onClick",t=>{const e=t.composedPath().filter(s=>s instanceof HTMLAnchorElement&&s.href).map(s=>
1new URL(s.href)),i=new URL(window.location.href);if(this.options.anchors){const s=e.find(o=>i.host===o.host&&i.pathname===o.pathname&&o.hash);if(s){const o=typeof this.options.anchors=="object"&&this.options.anchors?this.options.anchors:void 0,a=decodeURIComponent(s.hash);this.scrollTo(a,o);return}}if(this.options.stopInertiaOnNavigate&&e.some(s=>i.host===s.host&&i.pathname!==s.pathname)){this.reset();return}});r(this,"onPointerDown",t=>{t.button===1&&this.reset()});r(this,"onVirtualScroll",t=>{if(typeof this.options.virtualScroll=="function"&&this.options.virtualScroll(t)===!1)return;const{deltaX:e,deltaY:i,event:s}=t;if(this.emitter.emit("virtual-scroll",{deltaX:e,deltaY:i,event:s}),s.ctrlKey||s.lenisStopPropagation)return;const o=s.type.includes("touch"),a=s.type.includes("wheel");if(o&&this.isIos&&(s.type==="touchstart"&&(this._isDraggingSelection=this.isTouchOnSelectionHandle(s)),this._isDraggingSelection)){s.type==="touchend"&&(this._isDraggingSelection=!1);return}this.isTouching=s.type==="touchstart"||s.type==="touchmove";const p=e===0&&i===0;if(this.options.syncTouch&&o&&s.type==="touchstart"&&p&&!this.isStopped&&!this.isLocked){this.reset();return}const u=this.options.gestureOrientation==="vertical"&&i===0||this.options.gestureOrientation==="horizontal"&&e===0;if(p||u)return;let c=s.composedPath();c=c.slice(0,c.indexOf(this.rootElement));const h=this.options.prevent,w=Math.abs(e)>=Math.abs(i)?"horizontal":"vertical";if(c.find(n=>{var d,v,S,y,E;return n instanceof HTMLElement&&(typeof h=="function"&&(h==null?void 0:h(n))||((d=n.hasAttribute)==null?void 0:d.call(n,"data-lenis-prevent"))||w==="vertical"&&((v=n.hasAttribute)==null?void 0:v.call(n,"data-lenis-prevent-vertical"))||w==="horizontal"&&((S=n.hasAttribute)==null?void 0:S.call(n,"data-lenis-prevent-horizontal"))||o&&((y=n.hasAttribute)==null?void 0:y.call(n,"data-lenis-prevent-touch"))||a&&((E=n.hasAttribute)==null?void 0:E.call(n,"data-lenis-prevent-wheel"))||this.options.allowNestedScroll&&this.hasNestedScroll(n,{deltaX:e,deltaY:i}))}))return;if(this.isStopped||this.isLocked){s.cancelable&&s.preventDefault();return}if(!(this.options.syncTouch&&o||this.options.smoothWheel&&a)){this.isScrolling="native",this.animate.stop(),s.lenisStopPropagation=!0;return}let f=i;this.options.gestureOrientation==="both"?f=Math.abs(i)>Math.abs(e)?i:e:this.options.gestureOrientation==="horizontal"&&(f=e),(!this.options.overscroll||this.options.infinite||this.options.wrapper!==window&&this.limit>0&&(this.animatedScroll>0&&this.animatedScroll<this.limit||this.animatedScroll===0&&i>0||this.animatedScroll===this.limit&&i<0))&&(s.lenisStopPropagation=!0),s.cancelable&&s.preventDefault();const l=o&&this.options.syncTouch,m=o&&s.type==="touchend";m&&(f=Math.sign(f)*Math.abs(this.velocity)**this.options.touchInertiaExponent),this.scrollTo(this.targetScroll+f,{programmatic:!1,...l?{lerp:m?this.options.syncTouchLerp:1}:{lerp:this.options.lerp,duration:this.options.duration,easing:this.options.easing}})});r(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))}});r(this,"raf",t=>{const e=t-(this.time||t);this.time=t,this.animate.advance(e*.001),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))});window.lenisVersion=M,window.lenis||(window.lenis={}),window.lenis.version=M,f==="horizontal"&&(window.lenis.horizontal=!0),o===!0&&(window.lenis.touch=!0),this.isIos=/(iPad|iPhone|iPod)/g.test(navigator.userAgent),(!t||t===document.documentElement)&&(t=window),typeof u=="number"&&typeof c!="function"?c=x:typeof c=="function"&&typeof u!="number"&&(u=1),this.options={wrapper:t,content:e,eventsTarget:i,smoothWheel:s,syncTouch:o,syncTouchLerp:a,touchInertiaExponent:p,duration:u,easing:c,lerp:h,infinite:w,gestureOrientation:l,orientation:f,touchMultiplier:m,wheelMultiplier:n,autoResize:d,prevent:v,virtualScroll:S,overscroll:y,autoRaf:E,anchors:b,autoToggle:z,allowNestedScroll:L,naiveDimensions:C,stopInertiaOnNavigate:D,respectReducedMotion:P},this.dimensions=new F(t,e,{autoResize:d}),this.updateClassName(),this.targetScroll=this.animatedScroll=this.actualScroll,this.options.wrapper.addEventListener("scroll",this.onNativeScroll),this.options.wrapper.addEventListener("scrollend",this.onScrollEnd,{capture:!0}),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.addEventListener("click",this.onClick),this.options.wrapper.addEventListener("pointerdown",this.onPointerDown),this.virtualScroll=ne
1w q(i,{touchMultiplier:m,wheelMultiplier:n}),this.virtualScroll.on("scroll",this.onVirtualScroll),this.options.autoToggle&&(this.checkOverflow(),this.rootElement.addEventListener("transitionend",this.onTransitionEnd)),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))}destroy(){this.emitter.destroy(),this.options.wrapper.removeEventListener("scroll",this.onNativeScroll),this.options.wrapper.removeEventListener("scrollend",this.onScrollEnd,{capture:!0}),this.options.wrapper.removeEventListener("pointerdown",this.onPointerDown),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.removeEventListener("click",this.onClick),this.virtualScroll.destroy(),this.dimensions.destroy(),this.cleanUpClassName(),this._rafId&&cancelAnimationFrame(this._rafId)}on(t,e){return this.emitter.on(t,e)}off(t,e){return this.emitter.off(t,e)}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"})}isTouchOnSelectionHandle(t){const e=window.getSelection();if(!e||e.isCollapsed||e.rangeCount===0)return!1;const i=t.targetTouches[0]??t.changedTouches[0];if(!i)return!1;const s=e.getRangeAt(0).getClientRects();if(s.length===0)return!1;const o=s[0],a=s[s.length-1],p=40,u=Math.hypot(i.clientX-o.left,i.clientY-o.top)<=p,c=Math.hypot(i.clientX-a.right,i.clientY-a.bottom)<=p;return u||c}resize(){this.dimensions.resize(),this.animatedScroll=this.targetScroll=this.actualScroll,this.emit()}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:e=0,immediate:i=!1,lock:s=!1,programmatic:o=!0,lerp:a=o?this.options.lerp:void 0,duration:p=o?this.options.duration:void 0,easing:u=o?this.options.easing:void 0,onStart:c,onComplete:h,force:w=!1,userData:f}={}){if(this.prefersReducedMotion&&(o?i=!0:(a=1,p=void 0,u=void 0)),(this.isStopped||this.isLocked)&&!w)return;let l=t,m=e;if(typeof l=="string"&&["top","left","start","#"].includes(l))l=0;else if(typeof l=="string"&&["bottom","right","end"].includes(l))l=this.limit;else{let n=null;if(typeof l=="string"?(n=l.startsWith("#")?document.getElementById(l.slice(1)):document.querySelector(l),n||(l==="#top"?l=0:console.warn("Lenis: Target not found",l))):l instanceof HTMLElement&&(l!=null&&l.nodeType)&&(n=l),n){if(this.options.wrapper!==window){const b=this.rootElement.getBoundingClientRect();m-=this.isHorizontal?b.left:b.top}const d=n.getBoundingClientRect(),v=getComputedStyle(n),S=this.isHorizontal?Number.parseFloat(v.scrollMarginLeft):Number.parseFloat(v.scrollMarginTop),y=getComputedStyle(this.rootElement),E=this.isHorizontal?Number.parseFloat(y.scrollPaddingLeft):Number.parseFloat(y.scrollPaddingTop);l=(this.isHorizontal?d.left:d.top)+this.animatedScroll-(Number.isNaN(S)?0:S)-(Number.isNaN(E)?0:E)}}if(typeof l=="number"){if(l+=m,this.options.infinite){if(o){this.targetScroll=this.animatedScroll=this.scroll;const n=l-this.animatedScroll;n>this.limit/2?l-=this.limit:n<-this.limit/2&&(l+=this.limit)}}else l=H(0,l,this.limit);if(l===this.targetScroll){c==null||c(this),h==null||h(this);return}if(this.userData=f??{},i){this.animatedScroll=this.targetScroll=l,this.setScroll(this.scroll),this.reset(),this.preventNextNativeScrollEvent(),this.emit(),h==null||h(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()});return}o||(this.targetScroll=l),typeof p=="number"&&typeof u!="function"?u=x:typeof u=="function"&&typeof p!="number"&&(p=1),this.animate.fromTo(this.animatedScroll,l,{duration:p,easing:u,lerp:a,onStart:()=>{s&&(this.isLocked=!0),this.isScrolling="smooth",c==null||c(this)},onUpdate:(n,d)=>{this.isScrolling="smooth",this.lastVelocity=this.velocity,this.velocity=n-this.animatedScroll,this.direction=Math.sign(this.velocity),this.animatedScroll=n,this.setScroll(this.scroll),o&&(this.targetScroll=n),d||this.emit
1(),d&&(this.reset(),this.emit(),h==null||h(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()}),this.preventNextNativeScrollEvent())}})}}preventNextNativeScrollEvent(){this._preventNextNativeScrollEvent=!0,requestAnimationFrame(()=>{this._preventNextNativeScrollEvent=!1})}hasNestedScroll(t,{deltaX:e,deltaY:i}){const s=Date.now();t._lenis||(t._lenis={});const o=t._lenis;let a,p,u,c,h,w,f,l,m,n;if(s-(o.time??0)>2e3){o.time=Date.now();const L=window.getComputedStyle(t);if(o.computedStyle=L,a=["auto","overlay","scroll"].includes(L.overflowX),p=["auto","overlay","scroll"].includes(L.overflowY),h=["auto"].includes(L.overscrollBehaviorX),w=["auto"].includes(L.overscrollBehaviorY),o.hasOverflowX=a,o.hasOverflowY=p,!(a||p))return!1;f=t.scrollWidth,l=t.scrollHeight,m=t.clientWidth,n=t.clientHeight,u=f>m,c=l>n,o.isScrollableX=u,o.isScrollableY=c,o.scrollWidth=f,o.scrollHeight=l,o.clientWidth=m,o.clientHeight=n,o.hasOverscrollBehaviorX=h,o.hasOverscrollBehaviorY=w}else u=o.isScrollableX,c=o.isScrollableY,a=o.hasOverflowX,p=o.hasOverflowY,f=o.scrollWidth,l=o.scrollHeight,m=o.clientWidth,n=o.clientHeight,h=o.hasOverscrollBehaviorX,w=o.hasOverscrollBehaviorY;if(!(a&&u||p&&c))return!1;const d=Math.abs(e)>=Math.abs(i)?"horizontal":"vertical";let v,S,y,E,b,z;if(d==="horizontal")v=Math.round(t.scrollLeft),S=f-m,y=e,E=a,b=u,z=h;else if(d==="vertical")v=Math.round(t.scrollTop),S=l-n,y=i,E=p,b=c,z=w;else return!1;return!z&&(v>=S||v<=0)?!0:(y>0?v<S:v>0)&&E&&b}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?V(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 prefersReducedMotion(){return this.options.respectReducedMotion&&this.reducedMotionMediaQuery.matches}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.className.split(" ").forEach(t=>{this.rootElement.classList.add(t)})}cleanUpClassName(){for(const t of Array.from(this.rootElement.classList))(t==="lenis"||t.startsWith("lenis-"))&&this.rootElement.classList.remove(t)}},Q=class{constructor(t){r(this,"listeners",[]);this.state=t}set(t){this.state=t;for(const e of this.listeners)e(this.state)}subscribe(t){return this.listeners=[...this.listeners,t],()=>{this.listeners=this.listeners.filter(e=>e!==t)}}get(){return this.state}};function $(t){const[e,i]=g.useState(t.get());return g.useEffect(()=>t.subscribe(s=>i(s)),[t]),e}const W=g.createContext(null),R=new Q(null),tt=g.forwardRef(({children:t,root:e=!1,options:i={},autoRaf:s=!0,className:o="",...a},p)=>{const u=g.useRef(null),c=g.useRef(null),[h,w]=g.useState(void 0);g.useImperativeHandle(p,()=>({wrapper:u.current,content:c.current,lenis:h}),[h]),g.useEffect(()=>{const n=new G({...i,...u.current&&c.current&&{wrapper:u.current,content:c.current},autoRaf:(i==null?void 0:i.autoRaf)??s});return w(n),()=>{n.destroy(),w(void 0)}},[s,JSON.stringify({...i,wrapper:null,content:null})]);const f=g.useRef([]),l=g.useCallback((n,d)=>{f.current.push({callback:n,priority:d}),f.current.sort((v,S)=>v.priority-S.priority)},[]),m=g.useCallback(n=>{f.current=f.current.filter(d=>d.callback!==n)},[]);return g.useEffect(()=>{if(e&&h)return R.set({lenis:h,addCallback:l,removeCallback:m}),()=>R.set(null)},[e,h,l,m]),g.useEffect(()=>{if(!h)return;const n=d=>{for(const{callback:v}of f.current)v(d)};return h.on("scroll",n),()=>{h.off("scroll",n)}},[h]),t?N.jsx(W.Provider,{value:{lenis:h,addCallback:l,removeCallback:m},children:e&&e!=="asChild"?t:N.jsx("div",{ref:u,className:`${o} ${(h==null?void 0:h.className)??""}`.trim(),...a,children:N.jsx("div",{ref:c,children:t})})}):null}),J={};function et(t,e=[],i=0){const s=g.useContext(W),o=$(R),{lenis:a,addCallback:p,removeCallback:u}=s??o??J;return g.useEffect(()=>{},[a,p,u,i,...e,t]),a}export{tt as R,et as u};

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.