{"version":3,"file":"ButtonClicked.CZVGDq7r.mjs","names":[],"sources":["https:/framerusercontent.com/modules/qYlibdBzgDbnLKlXdp1k/4d6P5t79FFhjIwGqvRTc/ButtonClicked.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef}from\"react\";// Learn more: https://www.framer.com/developers/overrides/\nconst IS_PRD=()=>{const origin=window?.location.origin;return origin===\"https://xmind.com\"||origin===\"https://app.xmind.com\";};function getPageType(pathname){const langPattern=/^\\/([a-z]{2}(-[A-Z]{2})?)(?=\\/|$)/i;const cleanPath=pathname.replace(langPattern,\"\")||\"/\";if(cleanPath.startsWith(\"/features\")||cleanPath.startsWith(\"/project-management\")||cleanPath.startsWith(\"/structure\")||cleanPath.startsWith(\"/integration\")||cleanPath.startsWith(\"/ai\")||cleanPath.startsWith(\"/collaboration\")||cleanPath.startsWith(\"/security\"))return\"features\";if(cleanPath===\"/\")return\"home\";if(cleanPath.startsWith(\"/download\"))return\"download\";if(cleanPath.startsWith(\"/thank-you-for-downloading\"))return\"thank-you\";if(cleanPath.startsWith(\"/contact-sales\"))return\"contact-sales\";if(cleanPath.startsWith(\"/help\"))return\"help\";if(cleanPath.startsWith(\"/pricing\"))return\"pricing\";if(cleanPath.startsWith(\"/premium\")||cleanPath.startsWith(\"/business\")||cleanPath.startsWith(\"/enterprise\")||cleanPath.startsWith(\"/education\"))return\"plan\";if(cleanPath.startsWith(\"/legal\"))return\"legal\";if(cleanPath.startsWith(\"/releases\"))return\"releases\";if(cleanPath.startsWith(\"/about\"))return\"about\";if(cleanPath.startsWith(\"/blog\"))return\"blog\";if(cleanPath.startsWith(\"/academy\"))return\"academy\";if(cleanPath.startsWith(\"/getting-help\"))return\"faq\";if(cleanPath.startsWith(\"/user-guide\"))return\"user-guide\";if(cleanPath.startsWith(\"/webinar\"))return\"webinar\";if(cleanPath.startsWith(\"/lp\"))return\"ads\";if(cleanPath.startsWith(\"/tools\"))return\"tools\";if(cleanPath.startsWith(\"/compare\"))return\"compare\";if(cleanPath.startsWith(\"/al/\"))return\"alternatives\";if(cleanPath.startsWith(\"/use-cases\"))return\"use-cases\";if(cleanPath.startsWith(\"/user-stories\"))return\"user-story\";if(cleanPath.startsWith(\"/roles\"))return\"roles\";if(cleanPath.startsWith(\"/campaign\"))return\"campaign\";if(cleanPath.startsWith(\"/sales\"))return\"sales\";return\"other\";}const BTN_PREFIX=\"btn_\";const resolveButtonName=target=>{if(!target||!(target instanceof Element))return null;const named=target.closest(\"[data-framer-name]\");if(!named)return null;const raw=named.getAttribute(\"data-framer-name\")||\"\";let decoded=raw;try{decoded=decodeURIComponent(raw);}catch{decoded=raw;}if(!decoded.startsWith(BTN_PREFIX))return null;const name=decoded.slice(BTN_PREFIX.length).trim();return name||null;};/**\n * Applies to any button/link/frame whose layer name starts with `btn_`.\n * The text after `btn_` is recorded as `button_name`.\n * Layers without the prefix are left untouched so accidental overrides don't pollute events.\n */export const trackButtonClicked=Component=>{return /*#__PURE__*/forwardRef((props,ref)=>{const{onClick}=props;const handleClick=event=>{const buttonName=resolveButtonName(event?.currentTarget??event?.target);if(buttonName){const payload={page_url:typeof window!==\"undefined\"?window.location.pathname:\"\",page_type:typeof window!==\"undefined\"?getPageType(window.location.pathname):\"other\",button_name:buttonName};window?.mixpanel?.track(\"button_clicked\",payload);window?.dataLayer?.push?.({event:\"button_clicked\",...payload});if(!IS_PRD()){console.log(\"button_clicked\",payload);}}else if(!IS_PRD()){console.warn(\"[trackButtonClicked] layer name missing `btn_` prefix, event skipped\");}if(onClick)onClick(event);};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:handleClick});});};\nexport const __FramerMetadata__ = {\"exports\":{\"trackButtonClicked\":{\"type\":\"reactHoc\",\"name\":\"trackButtonClicked\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ButtonClicked.map"],"mappings":"gIAC+H,SAAS,EAAY,EAAS,CAAwD,IAAM,E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