{"version":3,"file":"EmailGate.Jn3shBDf.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/Ve1tzpVwIHSUcmsvytW4/o4ioCisKD2IlJiPfULGk/EmailGate.js"],"sourcesContent":["// EmailGate — drop on hub + each stage page below the list.\n// Submits to the configured webhook with { email, source, consent }, then shows the download link.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState}from\"react\";const T={card:\"rgba(255,255,255,0.04)\",input:\"rgba(255,255,255,0.08)\",borderSubtle:\"rgba(255,255,255,0.13)\",borderStrong:\"rgba(255,255,255,0.25)\",fg:\"#FFFFFF\",muted:\"rgba(255,255,255,0.60)\",gold:\"#FFE066\",ctaBg:\"linear-gradient(180deg, #FFC72C 0%, #825500 100%)\",ctaText:\"#1A0F00\",font:\"'Geist','Geist Placeholder',-apple-system,BlinkMacSystemFont,'Segoe UI',Inter,Roboto,Helvetica,Arial,sans-serif\"};export default function EmailGate(props){const{title,subtitle,buttonLabel,successHeading,successBody,downloadLabel,downloadUrl,webhookUrl,source,consentLabel}=props;const[email,setEmail]=useState(\"\");const[consent,setConsent]=useState(false);const[submitting,setSubmitting]=useState(false);const[done,setDone]=useState(false);const[error,setError]=useState(null);async function submit(e){e.preventDefault();if(!email||!consent||!webhookUrl)return;setSubmitting(true);setError(null);try{const res=await fetch(webhookUrl,{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({email,consent,source:source||\"unknown\",timestamp:new Date().toISOString(),page_url:typeof window!==\"undefined\"?window.location.href:\"\"})});if(!res.ok)throw new Error(`Webhook returned ${res.status}`);setDone(true);}catch(err){setError(err?.message||\"Submission failed — try again\");}finally{setSubmitting(false);}}if(done){return /*#__PURE__*/_jsxs(\"div\",{style:{background:T.card,border:`1px solid ${T.borderSubtle}`,borderRadius:16,padding:32,color:T.fg,fontFamily:T.font,maxWidth:560,width:\"100%\",boxSizing:\"border-box\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{fontSize:12,color:T.gold,letterSpacing:\"0.12em\",textTransform:\"uppercase\",fontWeight:600,marginBottom:10},children:successHeading||\"You're in\"}),/*#__PURE__*/_jsx(\"div\",{style:{fontSize:16,lineHeight:1.6,color:T.muted,marginBottom:20},children:successBody||\"We just emailed you the pack. If you'd rather grab it now, the link is below.\"}),downloadUrl&&/*#__PURE__*/_jsx(\"a\",{href:downloadUrl,target:\"_blank\",rel:\"noopener noreferrer\",style:{display:\"inline-block\",background:T.ctaBg,color:T.ctaText,padding:\"15px 22px\",borderRadius:12,fontFamily:T.font,fontWeight:600,fontSize:15,letterSpacing:\"-0.005em\",textDecoration:\"none\"},children:downloadLabel||\"Download the pack\"})]});}return /*#__PURE__*/_jsxs(\"form\",{onSubmit:submit,style:{background:T.card,border:`1px solid ${T.borderSubtle}`,borderRadius:16,padding:32,color:T.fg,fontFamily:T.font,maxWidth:560,width:\"100%\",boxSizing:\"border-box\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{fontSize:12,color:T.gold,letterSpacing:\"0.12em\",textTransform:\"uppercase\",fontWeight:600,marginBottom:12},children:source||\"STAOS PACK\"}),/*#__PURE__*/_jsx(\"div\",{style:{fontSize:24,fontWeight:600,letterSpacing:\"-0.02em\",marginBottom:10},children:title||\"Get the full pack\"}),/*#__PURE__*/_jsx(\"div\",{style:{fontSize:14,color:T.muted,lineHeight:1.6,marginBottom:20},children:subtitle||\"Drop your email — we'll send you the PDF + all 100 prompts as a Notion doc.\"}),/*#__PURE__*/_jsx(\"input\",{type:\"email\",required:true,placeholder:\"you@youragency.com\",value:email,onChange:e=>setEmail(e.target.value),style:{width:\"100%\",background:T.input,border:`1px solid ${T.borderSubtle}`,borderRadius:12,padding:\"12px 14px\",color:T.fg,fontFamily:T.font,fontSize:15,boxSizing:\"border-box\",marginBottom:14,outline:\"none\"}}),/*#__PURE__*/_jsxs(\"label\",{style:{display:\"flex\",alignItems:\"flex-start\",gap:10,fontSize:12,color:T.muted,lineHeight:1.5,cursor:\"pointer\",marginBottom:18},children:[/*#__PURE__*/_jsx(\"input\",{type:\"checkbox\",checked:consent,onChange:e=>setConsent(e.target.checked),style:{marginTop:3,accentColor:\"#FFC72C\"}}),/*#__PURE__*/_jsx(\"span\",{children:consentLabel||\"Send me the pack + occasional STAOS emails. Unsubscribe any time.\"})]}),error&&/*#__PURE__*/_jsx(\"div\",{style:{color:\"#FF8A8A\",fontSize:13,marginBottom:12},children:error}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",disabled:!email||!consent||submitting,style:{width:\"100%\",background:submitting||!consent?\"rgba(255,255,255,0.08)\":T.ctaBg,color:submitting||!consent?\"rgba(255,255,255,0.45)\":T.ctaText,border:\"none\",borderRadius:12,padding:\"15px 22px\",fontFamily:T.font,fontWeight:600,fontSize:15,letterSpacing:\"-0.005em\",cursor:submitting||!consent?\"not-allowed\":\"pointer\"},children:submitting?\"Sending…\":buttonLabel||\"Send me the pack\"})]});}addPropertyControls(EmailGate,{title:{type:ControlType.String,title:\"Title\",defaultValue:\"Get the full pack\"},subtitle:{type:ControlType.String,title:\"Subtitle\",displayTextArea:true,defaultValue:\"Drop your email — we'll send you the PDF + all 100 prompts as a Notion doc.\"},buttonLabel:{type:ControlType.String,title:\"Button label\",defaultValue:\"Send me the pack\"},successHeading:{type:ControlType.String,title:\"Success heading\",defaultValue:\"You're in\"},successBody:{type:ControlType.String,title:\"Success body\",displayTextArea:true,defaultValue:\"We just emailed you the pack. If you'd rather grab it now, the link is below.\"},downloadLabel:{type:ControlType.String,title:\"Download label\",defaultValue:\"Download the pack\"},downloadUrl:{type:ControlType.String,title:\"Download URL\"},webhookUrl:{type:ControlType.String,title:\"Webhook URL (Zapier/Make/n8n)\"},source:{type:ControlType.String,title:\"Source / pack id (e.g. 'structure-pack')\",defaultValue:\"structure-pack\"},consentLabel:{type:ControlType.String,title:\"Consent label\",defaultValue:\"Send me the pack + occasional STAOS emails. Unsubscribe any time.\"}});\nexport const __FramerMetadata__ = {\"exports\":{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