{"version":3,"file":"TrackableButton.AvmCfctj.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/NqiTI9Vwq8ckjwtV1LFw/Vz3S9tb6XfqvoVvK5EVJ/TrackableButton.js"],"sourcesContent":["// This is a Button Componet for a Framer Component Library\nimport{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,useTracking,RenderTarget}from\"framer\";export default function TrackableButton(props){const{title,link,buttonStyle,trackingId,intent,placement,plausibleEvent,widthOverride,heightOverride,linkColorOverride}=props;// State for hover effect\nconst[isHovered,setIsHovered]=React.useState(false);// Framer's built-in event tracking hook\nconst track=useTracking();// --- STYLE CONSTANTS ---\nconst FONT_FAMILY=\"IBM Plex Sans, sans-serif\";const FONT_SIZE=\"18px\";const LIGHTGREEN=\"#E7FBD3\";const NEW_SECONDARY_BG=\"#D3F9AE\";const ONNOGREEN=\"#228876\";const ONNODARKGREEN=\"#16444F\";const primaryHoverColor=ONNODARKGREEN;const secondaryHoverColor=\"rgba(34, 136, 118, 0.4)\";const outlineHoverBG=LIGHTGREEN;// Base styles common to buttons (Primary/Secondary/Outline)\nconst baseButtonStyle={fontFamily:FONT_FAMILY,fontSize:FONT_SIZE,lineHeight:1.2,fontWeight:500,padding:\"16px 24px\",borderRadius:\"999px\",textDecoration:\"none\",display:\"inline-block\",textAlign:\"center\",cursor:\"pointer\",transition:\"background-color 0.2s ease-in-out, color 0.2s ease-in-out, border-color 0.2s ease-in-out\"};let componentStyle;switch(buttonStyle){case\"primary\":componentStyle={...baseButtonStyle,backgroundColor:isHovered?primaryHoverColor:ONNOGREEN,color:LIGHTGREEN};break;case\"secondary\":componentStyle={...baseButtonStyle,backgroundColor:isHovered?secondaryHoverColor:NEW_SECONDARY_BG,color:ONNODARKGREEN,padding:\"14px 20px\"};break;case\"outline\":componentStyle={...baseButtonStyle,backgroundColor:isHovered?outlineHoverBG:\"transparent\",color:ONNODARKGREEN,border:`2px solid ${ONNODARKGREEN}`,padding:\"12px 20px\"};break;case\"link\":const linkColor=linkColorOverride||ONNOGREEN;componentStyle={...baseButtonStyle,color:linkColor,textDecoration:\"underline\",padding:\"0\",borderRadius:\"0\",display:\"inline\",lineHeight:1.4,textAlign:\"left\",\":hover\":{color:linkColor===ONNOGREEN?ONNODARKGREEN:\"inherit\",textDecoration:\"none\"}};break;}// --- APPLY WIDTH/HEIGHT OVERRIDES ---\nif(widthOverride&&widthOverride>0){componentStyle.width=`${widthOverride}px`;// Restore display: block logic when width is set\nif(buttonStyle!==\"link\"&&componentStyle.display===\"inline-block\"){componentStyle.display=\"block\";}}if(heightOverride&&heightOverride>0){componentStyle.height=`${heightOverride}px`;}// Removed all centering logic\n// --- DYNAMIC CLASS GENERATION ---\nconst gtmIntentClass=intent.toLowerCase().replace(/\\s/g,\"-\");const trackingClassName=`track-cta-${gtmIntentClass}`;const plausibleClassName=`plausible-event-name=${plausibleEvent}`;const allClasses=`cta-button ${trackingClassName} ${plausibleClassName}`;// Shared property payload for analytics destinations (PostHog, etc.).\nconst ctaProperties={label:title,intent,placement,style:buttonStyle,plausible_event:plausibleEvent,tracking_id:trackingId||null,href:link};const handleClick=e=>{if(trackingId)track(trackingId);// Mirror the click to PostHog with the full property set. Guarded so it\n// is a no-op when the PostHog snippet isn't loaded (e.g. the editor).\nconst posthog=window?.posthog;if(posthog&&typeof posthog.capture===\"function\"){posthog.capture(\"cta_click\",ctaProperties);}// Inside the Framer editor canvas, never hijack navigation.\nif(RenderTarget.current()===RenderTarget.canvas)return;// Let new-tab / modified / non-primary clicks behave natively, and\n// skip when there's nothing to navigate to.\nif(!link||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey){return;}// The link unloads this page (often to another origin), which cancels\n// Framer's asynchronous tracking flush before the conversion event is\n// sent. Hold navigation for a moment so the event reaches Framer.\ne.preventDefault();window.setTimeout(()=>{window.location.assign(link);},200);};// --- RENDER ELEMENT ---\nreturn /*#__PURE__*/_jsx(\"a\",{href:link,id:trackingId||undefined,style:componentStyle,className:allClasses,\"data-track-intent\":intent,\"data-track-placement\":placement,\"data-track-label\":title,\"data-track-style\":buttonStyle,rel:\"noopener noreferrer\",onClick:handleClick,onMouseEnter:()=>setIsHovered(true),onMouseLeave:()=>setIsHovered(false),children:title});}// 3. DEFINE PROPERTY CONTROLS\naddPropertyControls(TrackableButton,{title:{type:ControlType.String,title:\"Label\",defaultValue:\"Jetzt Dokument hochladen\"},link:{type:ControlType.Link,title:\"Link\",defaultValue:\"https://app.simply-onno.com\"},buttonStyle:{type:ControlType.Enum,options:[\"primary\",\"secondary\",\"link\",\"outline\"],title:\"Style\",defaultValue:\"primary\"},// Removed isCentered control\nwidthOverride:{type:ControlType.Number,title:\"Width\",displayStepper:true,step:10,min:0},heightOverride:{type:ControlType.Number,title:\"Height\",displayStepper:true,step:10,min:0},linkColorOverride:{type:ControlType.Color,title:\"Link Color\",placeholder:\"#001111x\",defaultValue:\"\",hidden:({buttonStyle})=>buttonStyle!==\"link\"},// --- TRACKING CONTROLS ---\ntrackingId:{type:ControlType.TrackingId,title:\"Tracking ID\",placeholder:\"e.g. cta-landing-top\"},intent:{type:ControlType.Enum,options:[\"- none -\",\"Start Upload\",\"Learn More\",\"Support\"],title:\"GA Intent\"},placement:{type:ControlType.Enum,title:\"GA Placement\",options:[\"- none -\",\"Top\",\"Bottom\",\"So funktioniert Onno\",\"Medical Value Prop\",\"Support Us Banner\"]},plausibleEvent:{type:ControlType.Enum,title:\"Plausible Event\",options:[\"- none -\",\"CTA+Landing-Page\",\"CTA+Content-Page\",\"CTA+Content-Page-2\",\"CTA+Content-Page-Info\",\"cta-waitlist-app\",\"cta-waitlist-account\"]}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TrackableButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TrackableButton.map"],"mappings":"uMACoJ,SA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