{"version":3,"file":"Custom_Cursor.Bge8ZbRh.mjs","names":[],"sources":["https:/framerusercontent.com/modules/dO5sHOZUNGdA2HpLAEqR/ORiq3wnfX4GDseqVHHSE/Custom_Cursor.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useRef,useState,useEffect}from\"react\";import{motion,useSpring}from\"framer-motion\";function hasButtonOrAnchorAncestor(element){if(!element){return false;}if(element.tagName===\"BUTTON\"||element.tagName===\"A\"){return true;}return hasButtonOrAnchorAncestor(element.parentElement);}export function withCursorFollow(Component){return props=>{if(typeof document===\"undefined\"){return null;}// Add a style tag to the head of the document to hide the system cursor for all elements\nconst style=document.createElement(\"style\");style.appendChild(document.createTextNode(\"* { cursor: none !important; }\"));document.head.appendChild(style);const cursorRef=useRef(null);const[isHovering,setIsHovering]=useState(false);const spring={type:\"spring\",stiffness:1e3,damping:70};const storedPosition=localStorage.getItem(\"cursorPosition\");const initialCursorPosition=useRef(storedPosition?JSON.parse(storedPosition):{x:window.innerWidth/2,y:window.innerHeight/2});const positionX=useSpring(Number(initialCursorPosition.current.x),spring);const positionY=useSpring(Number(initialCursorPosition.current.y),spring);useEffect(()=>{const handleMouseMove=e=>{if(!cursorRef.current)return;// Check if the cursor is hovering a button or \"A\" tag element\nconst isHovered=e.target instanceof HTMLElement&&(e.target.tagName===\"BUTTON\"||e.target.tagName===\"A\"||hasButtonOrAnchorAncestor(e.target.parentElement));setIsHovering(isHovered);// Update the position based on the cursor position\npositionX.set(e.clientX);positionY.set(e.clientY);localStorage.setItem(\"cursorPosition\",JSON.stringify({x:e.clientX,y:e.clientY}));};// Store the initial cursor position when the component is first rendered\ninitialCursorPosition.current.x=window.innerWidth/2;initialCursorPosition.current.y=window.innerHeight/2;window.addEventListener(\"mousemove\",handleMouseMove);return()=>{window.removeEventListener(\"mousemove\",handleMouseMove);};},[]);return /*#__PURE__*/_jsx(motion.div,{ref:cursorRef,style:{position:\"fixed\",left:positionX,top:positionY,pointerEvents:\"none\",zIndex:9999},children:/*#__PURE__*/_jsx(Component,{...props})});};}export function withScrollToBriefingSection(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const findBriefingSection=()=>{if(typeof document===\"undefined\")return null;return document.querySelector(\"#briefing-section\")||document.querySelector(\"[id$='-briefing']\")||document.querySelector(\"[data-framer-name='Eligibility']\");};const scrollToBriefing=()=>{const target=findBriefingSection();if(target&&target instanceof HTMLElement){target.scrollIntoView({behavior:\"smooth\",block:\"start\"});}};const handleClick=event=>{if(event&&typeof event.preventDefault===\"function\"){event.preventDefault();}scrollToBriefing();if(typeof props.onClick===\"function\"){props.onClick(event);}};const handleTap=(event,info)=>{if(event&&typeof event.preventDefault===\"function\"){event.preventDefault();}scrollToBriefing();if(typeof props.onTap===\"function\"){props.onTap(event,info);}};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:handleClick,onTap:handleTap,style:{...props.style,cursor:\"pointer\"}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withCursorFollow\":{\"type\":\"reactHoc\",\"name\":\"withCursorFollow\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withScrollToBriefingSection\":{\"type\":\"reactHoc\",\"name\":\"withScrollToBriefingSection\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Custom_Cursor.map"],"mappings":"mKAIya,SAAgB,EAA4B,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,IAAM,MAA4B,OAAO,SAAW,IAAmB,KAAY,SAAS,cAAc,mBAAmB,GAAG,SAAS,cAAc,mBAAmB,GAAG,SAAS,cAAc,kCAAkC,EAAU,MAAqB,CAAC,IAAM,EAAO,EAAoB,EAAK,GAAQ,aAAkB,aAAa,EAAO,eAAe,CAAC,SAAS,SAAS,MAAM,OAAO,CAAC,CAAG,EAAQ,EAAY,GAAO,CAAI,GAAO,OAAO,EAAM,gBAAiB,YAAY,EAAM,eAAe,EAAG,EAAiB,EAAK,OAAO,EAAM,SAAU,YAAY,EAAM,QAAQ,CAAK,CAAG,EAAQ,GAAW,EAAM,IAAO,CAAI,GAAO,OAAO,EAAM,gBAAiB,YAAY,EAAM,eAAe,EAAG,EAAiB,EAAK,OAAO,EAAM,OAAQ,YAAY,EAAM,MAAM,EAAM,CAAI,CAAG,EAAE,OAAoB,EAAK,EAAU,CAAK,MAAI,GAAG,EAAM,QAAQ,EAAY,MAAM,EAAU,MAAM,CAAC,GAAG,EAAM,MAAM,OAAO,SAAS,CAAC,CAAC,CAAE,CAAC,CAAE,qBAJ52C,IAAwD,IAA4C"}