{"version":3,"file":"FieldNotesSubscribe.bK2DABY7.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/50aEeBDeszUWD1Wue8e5/PxKXKLP45ljq3B0EihbA/FieldNotesSubscribe.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useState}from\"react\";// Backend webhook + shared secret are hardcoded on purpose. They were previously\n// exposed as String property controls with NO defaultValue, and Framer injects an\n// empty string \"\" into every instance for such controls. That \"\" overrode the code\n// defaults (JS destructuring defaults only apply to `undefined`), so the form silently\n// POSTed {url:\"\", token:\"\"} - the request hit the page itself (405) and never reached\n// the webhook. Keeping these in code makes the signup immune to instance/publish resets.\nconst WEBHOOK_URL=\"https://script.google.com/macros/s/AKfycbxbTaMYU_Ca0GcJL49nfrINvMhL1JJp4i8Mtib-rLsySmPTS7K2KYM7vK4ltCfZdWyD8Q/exec\";const TOKEN=\"tgc_sk_7Qf3pX9bL2\";const INK=\"var(--token-35c6f70b-5104-44c9-86ae-c1a336416345, rgb(10, 10, 10))\";const GREY=\"var(--token-f5113768-446c-494d-b43d-e26ecfcece11, rgb(107, 114, 128))\";const MELON=\"var(--token-d741c9d7-fe47-4f0d-9a3f-45e6eb520763, rgb(250, 156, 97))\";const BORDER=\"var(--token-c89c9900-9c04-4e77-9386-2686bfdf3a9a, rgba(10, 10, 10, 0.1))\";const FONT='var(--framer-font-family, \"Switzer\", \"Switzer Placeholder\", sans-serif)';/**\n * Field notes email signup - posts {type:\"subscribe\"} to the TGC Apps Script\n * webhook, which stores it in the \"Subscribers\" tab of the enquiries Sheet.\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 640\n */export default function FieldNotesSignup(props){const{sourcePage=\"/thinking\",heading=\"Get the field notes\",subline=\"One short, straight read on brand and experience in the Gulf. No noise.\"}=props;const isStatic=useIsStaticRenderer();const[email,setEmail]=useState(\"\");const[website,setWebsite]=useState(\"\")// honeypot\n;const[state,setState]=useState(\"idle\");const submit=e=>{e.preventDefault();if(isStatic||state===\"sending\"||state===\"done\")return;const value=email.trim();if(!/^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$/.test(value)){setState(\"error\");return;}setState(\"sending\");try{fetch(WEBHOOK_URL,{method:\"POST\",mode:\"no-cors\",headers:{\"Content-Type\":\"text/plain;charset=utf-8\"},body:JSON.stringify({token:TOKEN,type:\"subscribe\",email:value,source_page:sourcePage,website})}).catch(()=>{});}catch(err){}try{const w=window;if(typeof w.gtag===\"function\"){w.gtag(\"event\",\"field_notes_subscribe\",{source_page:sourcePage});}}catch(err){}setState(\"done\");};const inputStyle={flex:\"1 1 220px\",minWidth:\"0\",padding:\"14px 18px\",fontFamily:FONT,fontSize:\"16px\",fontWeight:400,color:INK,background:\"transparent\",border:`1px solid ${BORDER}`,borderRadius:\"999px\",outline:\"none\"};return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",fontFamily:FONT,display:\"flex\",flexDirection:\"column\",gap:\"10px\",...props.style},children:[/*#__PURE__*/_jsx(\"div\",{style:{fontSize:\"14px\",fontWeight:500,letterSpacing:\"0.01em\",color:MELON},children:\"Field notes\"}),/*#__PURE__*/_jsx(\"div\",{style:{fontSize:\"28px\",fontWeight:600,letterSpacing:\"-0.02em\",lineHeight:1.1,color:INK},children:heading}),/*#__PURE__*/_jsx(\"div\",{style:{fontSize:\"16px\",fontWeight:400,lineHeight:1.5,color:GREY,maxWidth:\"46ch\"},children:subline}),state===\"done\"?/*#__PURE__*/_jsx(\"div\",{style:{fontSize:\"16px\",fontWeight:500,color:INK,padding:\"10px 0 2px\"},children:\"You’re on the list. Speak soon.\"}):/*#__PURE__*/_jsxs(\"form\",{onSubmit:submit,style:{display:\"flex\",flexWrap:\"wrap\",gap:\"10px\",alignItems:\"stretch\",marginTop:\"8px\"},children:[/*#__PURE__*/_jsx(\"input\",{type:\"text\",name:\"website\",value:website,onChange:e=>setWebsite(e.target.value),tabIndex:-1,autoComplete:\"off\",\"aria-hidden\":\"true\",style:{position:\"absolute\",left:\"-9999px\",width:\"1px\",height:\"1px\",opacity:0}}),/*#__PURE__*/_jsx(\"input\",{type:\"email\",name:\"email\",required:true,placeholder:\"you@company.com\",\"aria-label\":\"Email address\",value:email,onChange:e=>{setEmail(e.target.value);if(state===\"error\")setState(\"idle\");},style:inputStyle}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",disabled:state===\"sending\",style:{padding:\"14px 28px\",fontFamily:FONT,fontSize:\"16px\",fontWeight:500,color:INK,background:MELON,border:\"none\",borderRadius:\"999px\",cursor:\"pointer\",flex:\"0 0 auto\"},children:state===\"sending\"?\"One sec...\":\"Subscribe\"}),state===\"error\"&&/*#__PURE__*/_jsx(\"div\",{style:{flexBasis:\"100%\",fontSize:\"14px\",color:GREY},children:\"That email doesn’t look right - try again?\"})]}),/*#__PURE__*/_jsxs(\"div\",{style:{fontSize:\"13px\",fontWeight:400,color:GREY},children:[\"Only ever the notes, nothing else.\",\" \",/*#__PURE__*/_jsx(\"a\",{href:\"/privacy\",style:{color:GREY,textDecoration:\"underline\"},children:\"Privacy\"})]})]});}addPropertyControls(FieldNotesSignup,{heading:{type:ControlType.String,title:\"Heading\",defaultValue:\"Get the field notes\"},subline:{type:ControlType.String,title:\"Subline\",defaultValue:\"One short, straight read on brand and experience in the Gulf. No noise.\"},sourcePage:{type:ControlType.String,title:\"Source page\",defaultValue:\"/thinking\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FieldNotesSignup\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"640\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FieldNotesSubscribe.map"],"mappings":"kMAaG,SAAwB,EAAiB,EAAM,CAAC,GAAK,CAAC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