{"version":3,"file":"SubstackSignup.C9VLcto2.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/Xx5RPYta3wwkx9PH0kqP/sPJ1jwYAlNOQYJNjksIg/SubstackSignup.js"],"sourcesContent":["// Get Started: https://www.framer.com/developers\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export function SubstackSignup(props){const{fontFamily,tint,submitText,messageColor}=props;const[email,setEmail]=useState(\"\");const[status,setStatus]=useState(\"idle\");const handleSubmit=async e=>{e.preventDefault();setStatus(\"submitting\");try{const response=await fetch(\"https://mpqyub8xc4.execute-api.us-east-1.amazonaws.com/prod/subscribe\",{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({email})});if(response.ok){setStatus(\"success\");setEmail(\"\");}else{throw new Error(\"Failed to subscribe\");}}catch(error){setStatus(\"error\");}};return /*#__PURE__*/_jsxs(\"form\",{onSubmit:handleSubmit,style:{position:\"relative\",fontFamily},children:[status===\"success\"&&/*#__PURE__*/_jsx(\"p\",{style:{fontFamily:\"inherit\",fontSize:\"20px\",color:messageColor},children:\"Thanks for subscribing!\"}),status===\"error\"&&/*#__PURE__*/_jsx(\"p\",{style:{fontFamily:\"inherit\",fontSize:\"20px\",color:messageColor},children:\"Something went wrong. Try again later.\"}),status===\"idle\"||status===\"submitting\"?/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"input\",{type:\"email\",placeholder:\"Enter your email\",value:email,onChange:e=>setEmail(e.target.value),style:{padding:\"10px\",fontSize:\"16px\",fontFamily:\"inherit\"},required:true}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",style:{padding:\"10px\",position:\"absolute\",top:0,right:0,fontSize:\"16px\",backgroundColor:tint,color:\"#ebeaee\",fontFamily:\"inherit\"},children:status===\"submitting\"?\"Submitting...\":\"Subscribe\"})]}):null]});}addPropertyControls(SubstackSignup,{tint:{title:\"Tint\",type:ControlType.Color,defaultValue:\"#1d1d1d\"},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:16,min:10,max:32},fontFamily:{type:ControlType.String,title:\"Font Family\",placeHolder:\"Galano Grotesque Alt Regular\",defaultValue:\"Galano Grotesque Alt Regular\"},submitText:{type:ControlType.Color,title:\"Button Text Color\",defaultvalue:\"#ebeaee\"},messageColor:{type:ControlType.Color,title:\"Success/Error Msg Color\",defaultValue:\"#eabeaee\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"SubstackSignup\":{\"type\":\"reactComponent\",\"name\":\"SubstackSignup\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SubstackSignup.map"],"mappings":"gRAC+J,SAAgB,EAAe,EAAM,CAAC,GAAK,CAAC,aAAW,OAAK,aAAW,gBAAc,EAAW,CAAC,EAAM,GAAUA,EAAS,GAAG,CAAM,CAAC,EAAO,GAAWA,EAAS,OAAO,CAA8Y,OAAoB,EAAM,OAAO,CAAC,SAA5Z,KAAM,IAAG,CAAC,EAAE,gBAAgB,CAAC,EAAU,aAAa,CAAC,GAAG,CAA8L,IAA9K,MAAM,MAAM,wEAAwE,CAAC,OAAO,OAAO,QAAQ,CAAC,eAAe,mBAAmB,CAAC,KAAK,KAAK,UAAU,CAAC,QAAM,CAAC,CAAC,CAAC,EAAa,GAAI,EAAU,UAAU,CAAC,EAAS,GAAG,MAAO,MAAU,MAAM,sBAAsB,MAAe,CAAC,EAAU,QAAQ,GAA4D,MAAM,CAAC,SAAS,WAAW,aAAW,CAAC,SAAS,CAAC,IAAS,WAAwB,EAAK,IAAI,CAAC,MAAM,CAAC,WAAW,UAAU,SAAS,OAAO,MAAM,EAAa,CAAC,SAAS,0BAA0B,CAAC,CAAC,IAAS,SAAsB,EAAK,IAAI,CAAC,MAAM,CAAC,WAAW,UAAU,SAAS,OAAO,MAAM,EAAa,CAAC,SAAS,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