{"version":3,"file":"EmailCaptureForm.DNFH4lMB.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/1in8I30LHvlBadZiMmO7/yPf6gWa442frTr81Ml3I/EmailCaptureForm.js"],"sourcesContent":["// Email capture form for HubSpot with redirect on success\n// Input and button are side by side on desktop, stacked on mobile\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * HubSpot Email Form\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function EmailCaptureForm(props){const{portalId,formId,redirectUrl,placeholder,buttonLabel,inputBackground,inputTextColor,buttonBackground,buttonTextColor,inputFont,buttonFont,inputBorderColor,inputBorderRadius,inputPadding,buttonBorderRadius,buttonPadding,style,variant=\"auto\",utm_source=\"linkedin\",utm_medium=\"paid_social\",utm_campaign=\"BOF_09_11_Agency\",utm_term=\"\",utm_content=\"123456\"}=props;const[email,setEmail]=useState(\"\");const[submitting,setSubmitting]=useState(false);const[error,setError]=useState(\"\");async function handleSubmit(e){e.preventDefault();setError(\"\");startTransition(()=>setSubmitting(true));try{const res=await fetch(`https://api.hsforms.com/submissions/v3/integration/submit/${portalId}/${formId}`,{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({fields:[{name:\"email\",value:email},// UTM fields (hidden)\n{name:\"utm_source\",value:utm_source},{name:\"utm_medium\",value:utm_medium},{name:\"utm_campaign\",value:utm_campaign},{name:\"utm_term\",value:utm_term},{name:\"utm_content\",value:utm_content}]})});if(res.ok){if(typeof window!==\"undefined\"){window.location.href=redirectUrl;}}else{setError(\"Submission failed. Please try again.\");}}catch{setError(\"Submission failed. Please try again.\");}finally{startTransition(()=>setSubmitting(false));}}// Determine flexDirection based on variant and window width\nlet flexDirection=\"row\";let gap=12;let alignItems=\"center\";if(variant===\"mobile\"){flexDirection=\"column\";gap=10;alignItems=\"stretch\";}else if(variant===\"auto\"){if(typeof window!==\"undefined\"&&window.innerWidth<=500){flexDirection=\"column\";gap=10;alignItems=\"stretch\";}}return /*#__PURE__*/_jsxs(\"form\",{className:\"framer-email-capture-form\",onSubmit:handleSubmit,style:{display:\"flex\",flexDirection:flexDirection,gap,width:\"100%\",alignItems,...style},\"aria-label\":\"Email signup form\",autoComplete:\"off\",children:[variant===\"auto\"&&/*#__PURE__*/_jsx(\"style\",{children:`\n                    @media (max-width: 500px) {\n                        .framer-email-capture-form {\n                            flex-direction: column !important;\n                            gap: 10px !important;\n                            align-items: stretch !important;\n                        }\n                    }\n                `}),/*#__PURE__*/_jsx(\"input\",{type:\"hidden\",name:\"utm_source\",value:utm_source,style:{display:\"none\"}}),/*#__PURE__*/_jsx(\"input\",{type:\"hidden\",name:\"utm_medium\",value:utm_medium,style:{display:\"none\"}}),/*#__PURE__*/_jsx(\"input\",{type:\"hidden\",name:\"utm_campaign\",value:utm_campaign,style:{display:\"none\"}}),/*#__PURE__*/_jsx(\"input\",{type:\"hidden\",name:\"utm_term\",value:utm_term,style:{display:\"none\"}}),/*#__PURE__*/_jsx(\"input\",{type:\"hidden\",name:\"utm_content\",value:utm_content,style:{display:\"none\"}}),/*#__PURE__*/_jsx(\"input\",{type:\"email\",name:\"email\",value:email,onChange:e=>setEmail(e.target.value),placeholder:placeholder,style:{...inputFont,border:`1px solid ${inputBorderColor}`,borderRadius:inputBorderRadius,padding:inputPadding,background:inputBackground,color:inputTextColor,outline:\"none\",flex:1,minWidth:0,boxSizing:\"border-box\"},required:true,\"aria-label\":\"Email\",autoComplete:\"email\"}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",style:{...buttonFont,background:buttonBackground,color:buttonTextColor,border:\"none\",borderRadius:buttonBorderRadius,padding:buttonPadding,cursor:submitting?\"not-allowed\":\"pointer\",whiteSpace:\"nowrap\",boxSizing:\"border-box\",opacity:submitting?.7:1},disabled:submitting,\"aria-label\":buttonLabel,children:submitting?\"Submitting...\":buttonLabel}),error&&/*#__PURE__*/_jsx(\"span\",{style:{color:\"#D32F2F\",marginLeft:8,fontSize:13},children:error})]});}addPropertyControls(EmailCaptureForm,{portalId:{type:ControlType.String,title:\"Portal ID\",defaultValue:\"24249649\"},formId:{type:ControlType.String,title:\"Form ID\",defaultValue:\"be2c90e5-913e-4c43-89d3-013f68a54c2f\"},redirectUrl:{type:ControlType.String,title:\"Redirect URL\",defaultValue:\"https://framer.com/\"},placeholder:{type:ControlType.String,title:\"Placeholder\",defaultValue:\"Enter your email\"},buttonLabel:{type:ControlType.String,title:\"Button Label\",defaultValue:\"Subscribe\"},inputBackground:{type:ControlType.Color,title:\"Input BG\",defaultValue:\"#fff\"},inputTextColor:{type:ControlType.Color,title:\"Input Text\",defaultValue:\"#222\"},buttonBackground:{type:ControlType.Color,title:\"Button BG\",defaultValue:\"#111\"},buttonTextColor:{type:ControlType.Color,title:\"Button Text\",defaultValue:\"#fff\"},inputFont:{type:ControlType.Font,title:\"Input Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{variant:\"Medium\",fontSize:\"15px\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}},buttonFont:{type:ControlType.Font,title:\"Button Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{variant:\"Semibold\",fontSize:\"14px\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},inputBorderColor:{type:ControlType.Color,title:\"Input Border\",defaultValue:\"#CCCCCC\"},inputBorderRadius:{type:ControlType.Number,title:\"Input Radius\",defaultValue:8,min:0,max:32},inputPadding:{type:ControlType.String,title:\"Input Padding\",defaultValue:\"12px 16px\"},buttonBorderRadius:{type:ControlType.Number,title:\"Button Radius\",defaultValue:8,min:0,max:32},buttonPadding:{type:ControlType.String,title:\"Button Padding\",defaultValue:\"12px 24px\"},variant:{type:ControlType.Enum,title:\"Variant\",options:[\"auto\",\"desktop\",\"mobile\"],optionTitles:[\"Auto (Responsive)\",\"Desktop (Horizontal)\",\"Mobile (Vertical)\"],defaultValue:\"auto\"},utm_source:{type:ControlType.String,title:\"UTM Source\",defaultValue:\"linkedin\"},utm_medium:{type:ControlType.String,title:\"UTM Medium\",defaultValue:\"paid_social\"},utm_campaign:{type:ControlType.String,title:\"UTM Campaign\",defaultValue:\"BOF_09_11_Agency\"},utm_term:{type:ControlType.String,title:\"UTM Term\",defaultValue:\"\"},utm_content:{type:ControlType.String,title:\"UTM Content\",defaultValue:\"123456\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"EmailCaptureForm\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./EmailCaptureForm.map"],"mappings":"wTAOG,SAAwB,EAAiB,EAAM,CAAC,GAAK,CAAC,WAAS,SAAO,cAAY,cAAY,cAAY,kBAAgB,iBAAe,mBAAiB,kBAAgB,YAAU,aAAW,mBAAiB,oBAAkB,eAAa,qBAAmB,gBAAc,QAAM,UAAQ,OAAO,aAAW,WAAW,aAAW,cAAc,eAAa,mBAAmB,WAAS,GAAG,cAAY,UAAU,EAAW,CAAC,EAAM,GAAUA,EAAS,GAAG,CAAM,CAAC,EAAW,GAAeA,EAAS,GAAM,CAAM,CAAC,EAAM,GAAUA,EAAS,GAAG,CAAC,eAAe,EAAa,EAAE,CAAC,EAAE,gBAAgB,CAAC,EAAS,GAAG,CAAC,MAAoB,EAAc,GAAK,CAAC,CAAC,GAAG,EAAW,MAAM,MAAM,6DAA6D,EAAS,GAAG,IAAS,CAAC,OAAO,OAAO,QAAQ,CAAC,eAAe,mBAAmB,CAAC,KAAK,KAAK,UAAU,CAAC,OAAO,CAAC,CAAC,KAAK,QAAQ,MAAM,EAAM,CAC31B,CAAC,KAAK,aAAa,MAAM,EAAW,CAAC,CAAC,KAAK,aAAa,MAAM,EAAW,CAAC,CAAC,KAAK,eAAe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