{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/JJyJUNrgRIv71UTgolWA/pjWOuo2y5dqOZy8LKzcK/Smooth_Scrol.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import Lenis from\"@studio-freight/lenis\";export default function SmoothScroll({intensity=10}){const lenisRef=useRef(null);useEffect(()=>{if(RenderTarget.current()===RenderTarget.thumbnail)return;const isScrollable=element=>{const style=window.getComputedStyle(element);return[\"auto\",\"scroll\"].includes(style.overflowY)&&element.scrollHeight>element.clientHeight;};const addPreventAttribute=()=>{document.querySelectorAll(\"*\").forEach(el=>{if(isScrollable(el)){el.setAttribute(\"data-lenis-prevent\",\"\");}});};addPreventAttribute();const observer=new MutationObserver(mutations=>{mutations.forEach(mutation=>{if(mutation.type===\"childList\"){mutation.addedNodes.forEach(node=>{if(node.nodeType===1){if(isScrollable(node)){node.setAttribute(\"data-lenis-prevent\",\"\");}node.querySelectorAll(\"*\").forEach(el=>{if(isScrollable(el)){el.setAttribute(\"data-lenis-prevent\",\"\");}});}});}});});observer.observe(document.body,{childList:true,subtree:true});lenisRef.current=new Lenis({duration:1.2,easing:t=>Math.min(1,1.001-Math.pow(2,-10*t)),direction:\"vertical\",gestureDirection:\"vertical\",smooth:true,smoothTouch:false,touchMultiplier:2});function raf(time){var _lenisRef_current;(_lenisRef_current=lenisRef.current)===null||_lenisRef_current===void 0?void 0:_lenisRef_current.raf(time);requestAnimationFrame(raf);}requestAnimationFrame(raf);return()=>{var _lenisRef_current;(_lenisRef_current=lenisRef.current)===null||_lenisRef_current===void 0?void 0:_lenisRef_current.destroy();observer.disconnect();};},[]);useEffect(()=>{if(lenisRef.current){// New conversion function for improved smoothness\nconst convertIntensityToLenisSmooth=intensity=>{// Map 1-100 to a smoothness range of 0.95 (almost no smoothing) to 0.05 (very smooth)\nreturn .95-(intensity-1)*(.9/99);};const lenisSmooth=convertIntensityToLenisSmooth(intensity);lenisRef.current.options.lerp=lenisSmooth;}},[intensity]);if(RenderTarget.current()===RenderTarget.thumbnail){return null;}return /*#__PURE__*/_jsx(\"slot\",{});}addPropertyControls(SmoothScroll,{intensity:{type:ControlType.Number,title:\"Intensity\",defaultValue:10,min:1,max:100,step:1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SmoothScroll\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Smooth_Scrol.map"],
  "mappings": "gMAAwM,SAARA,EAA8B,CAAC,UAAAC,EAAU,EAAE,EAAE,CAAC,IAAMC,EAASC,EAAO,IAAI,EAEhH,OAFkHC,EAAU,IAAI,CAAC,GAAGC,EAAa,QAAQ,IAAIA,EAAa,UAAU,OAAO,IAAMC,EAAaC,GAAS,CAAC,IAAMC,EAAMC,EAAO,iBAAiBF,CAAO,EAAE,MAAM,CAAC,OAAO,QAAQ,EAAE,SAASC,EAAM,SAAS,GAAGD,EAAQ,aAAaA,EAAQ,YAAa,GAA4B,IAAI,CAAC,SAAS,iBAAiB,GAAG,EAAE,QAAQG,GAAI,CAAIJ,EAAaI,CAAE,GAAGA,EAAG,aAAa,qBAAqB,EAAE,CAAG,CAAC,CAAE,GAAsB,EAAE,IAAMC,EAAS,IAAI,iBAAiBC,GAAW,CAACA,EAAU,QAAQC,GAAU,CAAIA,EAAS,OAAO,aAAaA,EAAS,WAAW,QAAQC,GAAM,CAAIA,EAAK,WAAW,IAAMR,EAAaQ,CAAI,GAAGA,EAAK,aAAa,qBAAqB,EAAE,EAAGA,EAAK,iBAAiB,GAAG,EAAE,QAAQJ,GAAI,CAAIJ,EAAaI,CAAE,GAAGA,EAAG,aAAa,qBAAqB,EAAE,CAAG,CAAC,EAAG,CAAC,CAAG,CAAC,CAAE,CAAC,EAAEC,EAAS,QAAQ,SAAS,KAAK,CAAC,UAAU,GAAK,QAAQ,EAAI,CAAC,EAAET,EAAS,QAAQ,IAAIa,EAAM,CAAC,SAAS,IAAI,OAAO,GAAG,KAAK,IAAI,EAAE,MAAM,KAAK,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE,UAAU,WAAW,iBAAiB,WAAW,OAAO,GAAK,YAAY,GAAM,gBAAgB,CAAC,CAAC,EAAE,SAASC,EAAIC,EAAK,CAAC,IAAIC,GAAmBA,EAAkBhB,EAAS,WAAW,MAAMgB,IAAoB,QAAcA,EAAkB,IAAID,CAAI,EAAE,sBAAsBD,CAAG,CAAE,CAAC,6BAAsBA,CAAG,EAAQ,IAAI,CAAC,IAAIE,GAAmBA,EAAkBhB,EAAS,WAAW,MAAMgB,IAAoB,QAAcA,EAAkB,QAAQ,EAAEP,EAAS,WAAW,CAAE,CAAE,EAAE,CAAC,CAAC,EAAEP,EAAU,IAAI,CAAC,GAAGF,EAAS,QAAQ,CAE5mD,IAAMiB,GADLlB,GAC7B,KAAKA,EAAU,GAAI,oBAAyDA,CAAS,EAAEC,EAAS,QAAQ,QAAQ,KAAKiB,CAAY,CAAC,EAAE,CAAClB,CAAS,CAAC,EAAKI,EAAa,QAAQ,IAAIA,EAAa,UAAkB,KAA0B,EAAK,OAAO,CAAC,CAAC,CAAE,CAACe,EAAoBpB,EAAa,CAAC,UAAU,CAAC,KAAKqB,EAAY,OAAO,MAAM,YAAY,aAAa,GAAG,IAAI,EAAE,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC",
  "names": ["SmoothScroll", "intensity", "lenisRef", "pe", "ue", "RenderTarget", "isScrollable", "element", "style", "window", "el", "observer", "mutations", "mutation", "node", "l", "raf", "time", "_lenisRef_current", "lenisSmooth", "addPropertyControls", "ControlType"]
}
