{"version":3,"file":"Follow.BinfWGZP.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/7rbgqywt7GtZTb8bWGZa/KHBACzexBfzQeabyW9e8/Follow.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useRef,useState,useEffect}from\"react\";export function withCursorFollow(Component){return props=>{const ref=useRef(null);const[isHovering,setIsHovering]=useState(false);const[position,setPosition]=useState({left:0,top:0});useEffect(()=>{const handleMouseMove=e=>{if(!ref.current)return;const parentRect=ref.current.parentElement.getBoundingClientRect();const elementRect=ref.current.getBoundingClientRect();const left=e.clientX-parentRect.left-elementRect.width/2;const top=e.clientY-parentRect.top-elementRect.height/2;// Ensure the element stays within the viewport\nconst maxX=parentRect.width-elementRect.width;const maxY=parentRect.height-elementRect.height;setPosition({left:Math.min(Math.max(left,0),maxX),top:Math.min(Math.max(top,0),maxY)});const isHovered=left>=0&&top>=0&&left<=maxX&&top<=maxY;setIsHovering(isHovered);};window.addEventListener(\"mousemove\",handleMouseMove);return()=>{window.removeEventListener(\"mousemove\",handleMouseMove);};},[]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{position:\"absolute\",left:`${position.left}px`,top:`${position.top}px`,pointerEvents:\"none\",transform:\"translate(-50%, -50%)\"},children:isHovering&&/*#__PURE__*/_jsx(Component,{...props})});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withCursorFollow\":{\"type\":\"reactHoc\",\"name\":\"withCursorFollow\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Follow.map"],"mappings":"8IAAwF,SAAgB,EAAiB,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,EAAIA,EAAO,KAAK,CAAM,CAAC,EAAW,GAAeC,EAAS,GAAM,CAAM,CAAC,EAAS,GAAaA,EAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CACyH,OADxH,MAAc,CAAC,IAAM,EAAgB,GAAG,CAAC,GAAG,CAAC,EAAI,QAAQ,OAAO,IAAM,EAAW,EAAI,QAAQ,cAAc,uBAAuB,CAAO,EAAY,EAAI,QAAQ,uBAAuB,CAAO,EAAK,EAAE,QAAQ,EAAW,KAAK,EAAY,MAAM,EAAQ,EAAI,EAAE,QAAQ,EAAW,IAAI,EAAY,OAAO,EACjjB,EAAK,EAAW,MAAM,EAAY,MAAY,EAAK,EAAW,OAAO,EAAY,OAAO,EAAY,CAAC,KAAK,KAAK,IAAI,KAAK,IAAI,EAAK,EAAE,CAAC,EAAK,CAAC,IAAI,KAAK,IAAI,KAAK,IAAI,EAAI,EAAE,CAAC,EAAK,CAAC,CAAC,CAAwD,EAAvC,GAAM,GAAG,GAAK,GAAG,GAAM,GAAM,GAAK,EAA6B,EAAwD,OAArD,EAAO,iBAAiB,YAAY,EAAgB,KAAW,CAAC,EAAO,oBAAoB,YAAY,EAAgB,GAAK,EAAE,CAAC,CAAqB,EAAK,MAAM,CAAK,MAAI,MAAM,CAAC,SAAS,WAAW,KAAK,GAAG,EAAS,KAAK,IAAI,IAAI,GAAG,EAAS,IAAI,IAAI,cAAc,OAAO,UAAU,wBAAwB,CAAC,SAAS,GAAyB,EAAK,EAAU,CAAC,GAAG,EAAM,CAAC,CAAC,CAAC,uBADvkB,IAA6C"}