{"version":3,"file":"Events.CPuJX-2a.mjs","names":[],"sources":["https:/framerusercontent.com/modules/aE2aAnfGhyk4dI9keZ2K/aRRengt89WgKTcArES5Z/Events.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";const handleClick=(props,ref,name=\"\")=>{window._emitUserInteractionEvent?.({event_action:\"click\",interaction_name:name,interaction_raw_text:ref.current?.innerText,option_selected:\"\",destination_href:ref.current?.href,custom_tracking_fields:{element:ref.current?.id||ref.current?.className}});props?.onClick?.();};export function withLinkClickEvent(Component){return props=>{const ref=useRef(null);return /*#__PURE__*/_jsx(Component,{...props,ref:ref,onClick:()=>handleClick(props,ref,\"link_click\")});};}export function withButtonClickEvent(Component){return props=>{const ref=useRef(null);return /*#__PURE__*/_jsx(Component,{...props,ref:ref,onClick:()=>handleClick(props,ref,\"button_click\")});};}export function withToggleEvent(Component){return props=>{const ref=useRef(null);return /*#__PURE__*/_jsx(Component,{...props,ref:ref,onClick:()=>handleClick(props,ref,\"toggle\")});};}export function withTabChangeEvent(Component){return props=>{const ref=useRef(null);return /*#__PURE__*/_jsx(Component,{...props,ref:ref,onClick:()=>handleClick(props,ref,\"tab_change\")});};}export function withScrollIntoViewEvent(Component){return props=>{const ref=useRef(null);const[hasIntersected,setHasIntersected]=useState(false);useEffect(()=>{const target=ref.current;if(!target||hasIntersected)return;const emit=()=>{window._emitUserInteractionEvent?.({event_action:\"in_view\",interaction_name:\"scroll_into_view\",option_selected:\"\",custom_tracking_fields:{element:ref.current?.id||ref.current?.className}});};const observer=new IntersectionObserver(([entry])=>{if(entry.isIntersecting){setHasIntersected(true);if(window._emitUserInteractionEvent){emit();}else{const interval=setInterval(()=>{if(window._emitUserInteractionEvent){emit();clearInterval(interval);}},100);setTimeout(()=>clearInterval(interval),5e3);}}});observer.observe(target);return()=>observer.unobserve(target);},[hasIntersected]);return /*#__PURE__*/_jsx(Component,{...props,ref:ref});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withTabChangeEvent\":{\"type\":\"reactHoc\",\"name\":\"withTabChangeEvent\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withToggleEvent\":{\"type\":\"reactHoc\",\"name\":\"withToggleEvent\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withButtonClickEvent\":{\"type\":\"reactHoc\",\"name\":\"withButtonClickEvent\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withScrollIntoViewEvent\":{\"type\":\"reactHoc\",\"name\":\"withScrollIntoViewEvent\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withLinkClickEvent\":{\"type\":\"reactHoc\",\"name\":\"withLinkClickEvent\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Events.map"],"mappings":"mNAAiZ,SAAgB,EAAmB,EAAU,CAAC,MAAO,CAAA,GAAO,CAAC,IAAM,EAAI,EAAO,KAAK,CAAC,MAAoB,GAAK,EAAU,CAAC,GAAG,EAAU,MAAI,QAAQ,IAAI,EAAY,EAAM,EAAI,aAAa,AAAC,EAAC,AAAE,CAAE,UAAgB,EAAqB,EAAU,CAAC,MAAO,CAAA,GAAO,CAAC,IAAM,EAAI,EAAO,KAAK,CAAC,MAAoB,GAAK,EAAU,CAAC,GAAG,EAAU,MAAI,QAAQ,IAAI,EAAY,EAAM,EAAI,eAAe,AAAC,EAAC,AAAE,CAAE,CAAuL,SAAgB,EAAmB,EAAU,CAAC,MAAO,CAAA,GAAO,CAAC,IAAM,EAAI,EAAO,KAAK,CAAC,MAAoB,GAAK,EAAU,CAAC,GAAG,EAAU,MAAI,QAAQ,IAAI,EAAY,EAAM,EAAI,aAAa,AAAC,EAAC,AAAE,CAAE,UAAgB,EAAwB,EAAU,CAAC,MAAO,CAAA,GAAO,CAAwB,IAAjB,EAAI,EAAO,KAAK,CAAM,CAAC,EAAe,EAAkB,CAAC,GAAS,EAAM,CAAgqB,MAA/pB,GAAU,IAAI,CAAC,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