{"version":3,"file":"Mixpanel_button_click.B9oadMIk.mjs","names":["__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/1rRiLTTHjXTPOehEPxIF/L44V4btKSIYpsCY0FMXa/Mixpanel_button_click.js"],"sourcesContent":["// 3\n// import React from \"react\"\n// import type { ComponentType, MouseEvent } from \"react\"\n// export function withTrackButtonClick<P>(\n//     Component: ComponentType<P>\n// ): ComponentType<P> {\n//     return (props: P) => {\n//         const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n//             const buttonText =\n//                 (event.target as HTMLElement).innerText ||\n//                 (event.target as HTMLElement).textContent\n//             if (typeof mixpanel !== \"undefined\" && mixpanel.track) {\n//                 mixpanel.track(`${buttonText} Click`, {\n//                     \"Button Name\": buttonText,\n//                 })\n//             } else {\n//                 console.error(\"Mixpanel is not initialized\")\n//             }\n//         }\n//         return <Component {...props} onClick={handleClick} />\n//     }\n// }\n//1\nimport{jsx as _jsx}from\"react/jsx-runtime\";export function TrackButtonClick(){return{onClick(event){// Get the button text\nconst buttonText=event.target.innerText||event.target.textContent;// Check if Mixpanel is initialized\nif(typeof mixpanel!==\"undefined\"&&mixpanel.track){// Track the button click event with Mixpanel\nmixpanel.track(`${buttonText} Click`,{\"Button Name\":buttonText});}else{console.error(\"Mixpanel is not initialized\");}}};}// 2\n// import type { ComponentType } from \"react\"\n// export function TrackButtonClick(Component): ComponentType {\n//     return (props) => {\n//         const handlerClick = (event) => {\n//             // Get the button text\n//             const buttonText =\n//                 event.target.innerText || event.target.textContent\n//             // Check if Mixpanel is initialized\n//             if (typeof mixpanel !== \"undefined\" && mixpanel.track) {\n//                 // Track the button click event with Mixpanel\n//                 mixpanel.track(`${buttonText} Click`, {\n//                     \"Button Name\": buttonText,\n//                 })\n//             } else {\n//                 console.error(\"Mixpanel is not initialized\")\n//             }\n//         }\n//         return <Component {...props} onClick={handlerClick} />\n//     }\n// }\nimport{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withTrackButtonClick(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...TrackButtonClick(props)});};}withTrackButtonClick.displayName=\"TrackButtonClick\";\nexport const __FramerMetadata__ = {\"exports\":{\"withTrackButtonClick\":{\"type\":\"reactHoc\",\"name\":\"withTrackButtonClick\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"TrackButtonClick\":{\"type\":\"override\",\"name\":\"TrackButtonClick\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Mixpanel_button_click.map"],"mappings":"iPAuB2C,SAAgB,GAAkB,CAAC,MAAM,CAAC,QAAQ,EAAM,CACnG,IAAM,EAAW,EAAM,OAAO,WAAW,EAAM,OAAO,YACnD,OAAO,SAAW,KAAa,SAAS,MAC3C,SAAS,MAAM,GAAG,EAAW,QAAQ,CAAC,cAAc,EAAW,CAAC,CAAO,QAAQ,MAAM,8BAA8B,EAAI,CAqB4B,SAAgB,EAAqB,EAAE,CAAC,MAAO,KAAQ,EAA+BA,EAAwC,CAAQC,EAAK,EAAE,CAAC,GAAG,EAAM,GAAG,EAAiB,EAAM,CAAC,CAAC,mBAxB3R,IAwBqB,IAAmF,CAAuL,EAAqB,YAAY"}