{"version":3,"file":"GoldOutlineButtonHoverText.CknShcvA.mjs","names":["useRef","useCallback"],"sources":["https:/framerusercontent.com/modules/oYt3vWpkgcdHAbIyz2im/IBECHqcJRcy06BoOrLcA/GoldOutlineButtonHoverText.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useCallback,useRef}from\"react\";// User request: Create a Framer code override export named `GoldOutlineButtonHoverText` for an existing canvas button; keep it editable and only add hover/focus descendant text-color behavior.\nexport function GoldOutlineButtonHoverText(Component){return /*#__PURE__*/forwardRef(function GoldOutlineButtonHoverTextOverride(props,ref){const rootRef=useRef(null);const isHoveringRef=useRef(false);const isFocusWithinRef=useRef(false);const previousStylesRef=useRef(new Map);const setCombinedRef=useCallback(node=>{rootRef.current=node;if(typeof ref===\"function\"){ref(node);}else if(ref&&typeof ref===\"object\"){ref.current=node;}},[ref]);const applyTextColor=useCallback(()=>{const root=rootRef.current;if(!root)return;const descendants=root.querySelectorAll(\"*\");descendants.forEach(node=>{if(!(node instanceof HTMLElement))return;if(!previousStylesRef.current.has(node)){previousStylesRef.current.set(node,{color:node.style.color,transition:node.style.transition});}const existingTransition=node.style.transition;node.style.transition=existingTransition?`${existingTransition}, color 250ms ease`:\"color 250ms ease\";node.style.color=\"black\";});},[]);const clearTextColor=useCallback(()=>{previousStylesRef.current.forEach((styles,node)=>{node.style.color=styles.color;node.style.transition=styles.transition;});previousStylesRef.current.clear();},[]);const syncInteractionState=useCallback(()=>{if(isHoveringRef.current||isFocusWithinRef.current){applyTextColor();}else{clearTextColor();}},[applyTextColor,clearTextColor]);const handleMouseEnter=useCallback(event=>{isHoveringRef.current=true;syncInteractionState();props.onMouseEnter?.(event);},[props,syncInteractionState]);const handleMouseLeave=useCallback(event=>{isHoveringRef.current=false;syncInteractionState();props.onMouseLeave?.(event);},[props,syncInteractionState]);const handleFocusCapture=useCallback(event=>{isFocusWithinRef.current=true;syncInteractionState();props.onFocusCapture?.(event);},[props,syncInteractionState]);const handleBlurCapture=useCallback(event=>{const root=rootRef.current;const nextFocused=event.relatedTarget;isFocusWithinRef.current=Boolean(root&&nextFocused&&root.contains(nextFocused));syncInteractionState();props.onBlurCapture?.(event);},[props,syncInteractionState]);return /*#__PURE__*/_jsx(Component,{ref:setCombinedRef,...props,onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,onFocusCapture:handleFocusCapture,onBlurCapture:handleBlurCapture});});}\nexport const __FramerMetadata__ = {\"exports\":{\"GoldOutlineButtonHoverText\":{\"type\":\"reactHoc\",\"name\":\"GoldOutlineButtonHoverText\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GoldOutlineButtonHoverText.map"],"mappings":"2HACA,SAAgB,EAA2B,EAAU,CAAC,OAAoB,EAAW,SAA4C,EAAM,EAAI,CAAC,IAAM,EAAQA,EAAO,IAAI,EAAQ,EAAcA,EAAO,EAAK,EAAQ,EAAiBA,EAAO,EAAK,EAAQ,EAAkBA,EAAO,IAAI,GAAG,EAAQ,EAAeC,EAAY,GAAM,CAAC,EAAQ,QAAQ,EAAQ,OAAO,GAAM,WAAY,EAAI,CAAI,EAAW,GAAK,OAAO,GAAM,WAAU,EAAI,QAAQ,EAAM,EAAE,CAAC,CAAG,CAAC,EAAQ,EAAeA,MAAgB,CAAC,IAAM,EAAK,EAAQ,QAAY,GAAyD,EAAtB,iBAAiB,GAAe,CAAC,CAAC,QAAQ,GAAM,CAAC,GAAG,EAAE,aAAgB,aAAa,OAAW,EAAkB,QAAQ,IAAI,CAAI,GAAG,EAAkB,QAAQ,IAAI,EAAK,CAAC,MAAM,EAAK,MAAM,MAAM,WAAW,EAAK,MAAM,UAAU,CAAC,EAAG,IAAM,EAAmB,EAAK,MAAM,WAAW,EAAK,MAAM,WAAW,EAAmB,GAAG,EAAmB,oBAAoB,mBAAmB,EAAK,MAAM,MAAM,OAAQ,CAAC,CAAE,EAAE,CAAC,CAAC,EAAQ,EAAeA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