{"version":3,"file":"ScrollFX.Cbf9eixt.mjs","names":["React.useCallback","useRef","__esmMin","ne","de","c","J","init_jsx_runtime","init_npm_react_18_3_1","useTransform","useMotionValue","useScroll","useSpring","useReducedMotion","init_framer_motion_DhsWWWsN","useMergedRef","node","ref","withScrollScale","local","reduced","p","scrollYProgress","smooth","scale","rest","props","Component","style","withParallax","y","useDrift","from","to","withDriftLeft","x","withDriftRight","withMagnetic","onPointerMove","r","onPointerLeave","init_ScrollFX"],"sources":["https:/framerusercontent.com/modules/9TKbrP1w269A17XBmQBB/bfZTHeLPhC5Mo5iSxVKi/ScrollFX.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{forwardRef,useRef}from\"react\";import{useScroll,useSpring,useTransform,useReducedMotion,useMotionValue}from\"framer-motion\";function useMergedRef(ref,local){return React.useCallback(node=>{local.current=node;if(typeof ref===\"function\")ref(node);else if(ref)ref.current=node;},[ref]);}const smooth={stiffness:140,damping:30,mass:.35};export function withScrollScale(Component){return /*#__PURE__*/forwardRef(function ScrollScale(props,ref){const local=useRef(null);const reduced=useReducedMotion();const{scrollYProgress}=useScroll({target:local,offset:[\"start end\",\"center center\"]});const p=useSpring(scrollYProgress,smooth);const scale=useTransform(p,[0,1],[.86,1]);const{style,...rest}=props;return /*#__PURE__*/_jsx(Component,{...rest,ref:useMergedRef(ref,local),style:{...style,...reduced?{}:{scale}}});});}export function withParallax(Component){return /*#__PURE__*/forwardRef(function Parallax(props,ref){const local=useRef(null);const reduced=useReducedMotion();const{scrollYProgress}=useScroll({target:local,offset:[\"start end\",\"end start\"]});const p=useSpring(scrollYProgress,smooth);const y=useTransform(p,[0,1],[\"-7%\",\"7%\"]);const{style,...rest}=props;return /*#__PURE__*/_jsx(Component,{...rest,ref:useMergedRef(ref,local),style:{...style,...reduced?{}:{y,scale:1.16}}});});}function useDrift(local,from,to){const{scrollYProgress}=useScroll({target:local,offset:[\"start end\",\"end start\"]});const p=useSpring(scrollYProgress,smooth);return useTransform(p,[0,1],[from,to]);}export function withDriftLeft(Component){return /*#__PURE__*/forwardRef(function DriftLeft(props,ref){const local=useRef(null);const reduced=useReducedMotion();const x=useDrift(local,\"10%\",\"-18%\");const{style,...rest}=props;return /*#__PURE__*/_jsx(Component,{...rest,ref:useMergedRef(ref,local),style:{...style,...reduced?{}:{x}}});});}export function withDriftRight(Component){return /*#__PURE__*/forwardRef(function DriftRight(props,ref){const local=useRef(null);const reduced=useReducedMotion();const x=useDrift(local,\"-18%\",\"10%\");const{style,...rest}=props;return /*#__PURE__*/_jsx(Component,{...rest,ref:useMergedRef(ref,local),style:{...style,...reduced?{}:{x}}});});}export function withScrollProgress(Component){return /*#__PURE__*/forwardRef(function ScrollProgress(props,ref){const{scrollYProgress}=useScroll();const scaleX=useSpring(scrollYProgress,{stiffness:200,damping:40,mass:.3});const{style,...rest}=props;return /*#__PURE__*/_jsx(Component,{...rest,ref:ref,style:{...style,scaleX,transformOrigin:\"0% 50%\"}});});}export function withMagnetic(Component){return /*#__PURE__*/forwardRef(function Magnetic(props,ref){const x=useSpring(useMotionValue(0),{stiffness:260,damping:18,mass:.4});const y=useSpring(useMotionValue(0),{stiffness:260,damping:18,mass:.4});const reduced=useReducedMotion();const{style,onPointerMove,onPointerLeave,...rest}=props;return /*#__PURE__*/_jsx(Component,{...rest,ref:ref,onPointerMove:e=>{onPointerMove?.(e);if(reduced||e.pointerType!==\"mouse\")return;const r=e.currentTarget.getBoundingClientRect();x.set((e.clientX-(r.left+r.width/2))*.22);y.set((e.clientY-(r.top+r.height/2))*.3);},onPointerLeave:e=>{onPointerLeave?.(e);x.set(0);y.set(0);},style:{...style,x,y}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withParallax\":{\"type\":\"reactHoc\",\"name\":\"withParallax\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDriftRight\":{\"type\":\"reactHoc\",\"name\":\"withDriftRight\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withMagnetic\":{\"type\":\"reactHoc\",\"name\":\"withMagnetic\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDriftLeft\":{\"type\":\"reactHoc\",\"name\":\"withDriftLeft\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withScrollScale\":{\"type\":\"reactHoc\",\"name\":\"withScrollScale\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withScrollProgress\":{\"type\":\"reactHoc\",\"name\":\"withScrollProgress\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollFX.map"],"mappings":"A,6MAAwM,SAASe,EAAa,EAAI,EAAM,CAAC,OAAOf,EAAkB,GAAM,CAAC,EAAM,QAAQgB,EAAQ,OAAOC,GAAM,WAAWA,EAAID,CAAI,EAAUC,IAAI,EAAI,QAAQD,EAAK,EAAE,CAACC,CAAG,CAAC,CAAE,CAAkD,SAAgBC,EAAgB,EAAU,CAAC,MAAoB,gBAAW,SAAqB,EAAM,EAAI,CAAC,IAAMC,EAAMlB,EAAO,IAAI,EAAQmB,EAAQP,EAAiB,EAAO,CAAC,mBAAiBF,EAAU,CAAC,OAAOQ,EAAM,OAAO,CAAC,YAAY,eAAe,CAAC,CAAC,EAAQE,EAAET,EAAUU,EAAgBC,CAAM,EAAQC,EAAMf,EAAaY,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAO,CAAC,QAAM,GAAGI,GAAMC,EAAM,MAAoB,gBAAKC,EAAU,CAAC,GAAGF,EAAK,IAAIV,EAAaE,EAAIE,CAAK,EAAE,MAAM,CAAC,GAAGS,EAAM,GAAGR,EAAQ,CAAC,EAAE,CAAC,OAAK,CAAC,CAAC,CAAC,CAAE,CAAC,CAAE,CAAC,SAAgBS,EAAa,EAAU,CAAC,MAAoB,gBAAW,SAAkB,EAAM,EAAI,CAAC,IAAMV,EAAMlB,EAAO,IAAI,EAAQmB,EAAQP,EAAiB,EAAO,CAAC,mBA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