{"version":3,"file":"Test.BWr_Ch3-.mjs","names":["useRef","useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/uxKsHwLICRL9WIeG2vLm/SjVCoLBex8Fo9jC4miMK/Test.js"],"sourcesContent":["// MowchiMailchimpForm: Newsletter signup card with Mailchimp email form, consent checkboxes, and success message.\n// V1.2.0\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const defaultFormAction=\"https://afrikanakitchen.us6.list-manage.com/subscribe/post?u=dea0bdeb84a393b1453873274&amp;id=bd44325c40&amp;f_id=00bb34e1f0\";const defaultTags=\"1861281\";const defaultHoneypot=\"b_dea0bdeb84a393b1453873274_bd44325c40\";const defaultPrivPol=\"https://www.mowchi.me/privacypolicy\";export default function MowchiMailchimpForm({id=\"mailingListCTACard\",formAction,tags,honeypot,privPol,className,headingFont,labelFont,inputFont,bodySFont,marketingConsent=true,dataProcessing=true}){const resolvedFormAction=formAction&&formAction.trim()?formAction.trim():defaultFormAction;const resolvedTags=tags&&tags.trim()?tags.trim():defaultTags;const resolvedHoneypot=honeypot&&honeypot.trim()?honeypot.trim():defaultHoneypot;const resolvedPrivPol=privPol&&privPol.trim()?privPol.trim():defaultPrivPol;const formRef=useRef(null);const submitRef=useRef(null);const[showCheckboxes,setShowCheckboxes]=useState(false);const[showSuccess,setShowSuccess]=useState(false);const[marketingOptIn,setMarketingOptIn]=useState(true);const hideTimeoutRef=useRef(null);const iframeName=\"mc_hidden_iframe\";useEffect(()=>{const form=formRef.current;const submit=submitRef.current;if(!form||!submit)return;const originalLabel=submit.textContent??\"\";const reenable=()=>{if(submit.disabled){submit.disabled=false;submit.textContent=originalLabel||\"Subscribe\";}if(showSuccess)setShowSuccess(false);const emailInput=form.querySelector('input[name=\"EMAIL\"]');if(!emailInput?.value){if(hideTimeoutRef.current){window.clearTimeout(hideTimeoutRef.current);}hideTimeoutRef.current=window.setTimeout(()=>{setShowCheckboxes(false);setShowSuccess(false);},5e3);}else if(hideTimeoutRef.current){window.clearTimeout(hideTimeoutRef.current);hideTimeoutRef.current=null;}};const onSubmit=()=>{// Let the POST go out, then update UI.\nwindow.setTimeout(()=>{submit.disabled=true;submit.textContent=\"Success\";form.reset();setMarketingOptIn(true);setShowSuccess(true);if(hideTimeoutRef.current){window.clearTimeout(hideTimeoutRef.current);}hideTimeoutRef.current=window.setTimeout(()=>{const emailInput=form.querySelector('input[name=\"EMAIL\"]');if(!emailInput?.value){setShowSuccess(false);setShowCheckboxes(false);}},5e3);},0);};form.addEventListener(\"submit\",onSubmit);form.addEventListener(\"input\",reenable);return()=>{form.removeEventListener(\"submit\",onSubmit);form.removeEventListener(\"input\",reenable);if(hideTimeoutRef.current){window.clearTimeout(hideTimeoutRef.current);}};},[]);return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`\n        :root {\n          /* Colors */\n          --color-beige-1: #DBCBB8;\n          --color-beige-2: #F7F3EB;\n          --color-chocolatebrown: #442B1F;\n          --color-brown: #B89D7F;\n        }\n\n        * {\n          margin: 0;\n          box-sizing: border-box;\n        }\n\n        .checkbox-input {\n          appearance: none;\n          -webkit-appearance: none;\n          width: 14px;\n          height: 14px;\n          border: 1px solid var(--color-chocolatebrown);\n          border-radius: 3px;\n          background-color: var(--color-beige-2);\n          display: inline-block;\n          position: relative;\n          flex: 0 0 auto;\n          cursor: pointer;\n        }\n\n        .checkbox-input:checked {\n          background-color: var(--color-chocolatebrown);\n          border-color: var(--color-chocolatebrown);\n        }\n\n        .checkbox-input:checked::after {\n          content: \"\";\n          position: absolute;\n          width: 6px;\n          height: 10px;\n          border-right: 2px solid var(--color-beige-2);\n          border-bottom: 2px solid var(--color-beige-2);\n          left: 50%;\n          top: 50%;\n          transform: translate(-50%, -60%) rotate(45deg) scale(0.8);\n        }\n\n        .newsletter-card {\n          display: flex;\n          flex-direction: column;\n          gap: 24px;\n          width: 100%;\n        }\n\n        .input {\n          color: var(--color-chocolatebrown);\n        }\n\n        .input::placeholder {\n          color: var(--color-chocolatebrown);\n        }\n\n        @media screen and (max-width: 810px) {\n          .newsletter-card {\n            gap: 20px;\n          }\n\n          #emailInputAndSubmit {\n            flex-direction: column !important;\n          }\n\n          #emailInputAndSubmit button {\n            padding-top: 12px;\n            padding-bottom: 12px;\n            justify-content: center;\n            text-align: center;\n          }\n        }\n\n      `}),/*#__PURE__*/_jsxs(\"div\",{className:`newsletter-card ${className??\"\"}`,id:id,children:[/*#__PURE__*/_jsx(\"iframe\",{name:iframeName,style:{display:\"none\",width:0,height:0,border:0},\"aria-hidden\":\"true\",title:\"mailchimp-hidden-iframe\"}),/*#__PURE__*/_jsxs(\"form\",{ref:formRef,style:{margin:0},id:\"mc_form\",action:resolvedFormAction,method:\"post\",target:iframeName,children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:24},children:[/*#__PURE__*/_jsxs(\"div\",{id:\"emailInputAndSubmit\",style:{display:\"flex\",flexDirection:\"row\",flex:1,gap:12,alignItems:\"stretch\"},children:[/*#__PURE__*/_jsx(\"input\",{style:{display:\"flex\",flex:1,minWidth:0,height:\"100%\",backgroundColor:\"var(--color-beige-1)\",border:\"1px solid var(--color-chocolatebrown)\",paddingTop:12,paddingBottom:12,paddingLeft:16,...inputFont||{}},className:\"input\",type:\"email\",name:\"EMAIL\",placeholder:\"Email\",required:true,onInput:()=>setShowCheckboxes(true)}),/*#__PURE__*/_jsx(\"button\",{ref:submitRef,style:{backgroundColor:\"var(--color-chocolatebrown)\",alignSelf:\"stretch\",display:\"flex\",alignItems:\"center\",paddingTop:12,paddingBottom:12,paddingLeft:16,paddingRight:16,border:\"none\",color:\"var(--color-beige-2)\",appearance:\"none\",cursor:\"pointer\",...labelFont||{}},className:\"label\",type:\"submit\",id:\"mc_submit\",children:\"Subscribe\"})]}),showCheckboxes?/*#__PURE__*/_jsxs(\"div\",{id:\"checkbox_rows\",style:{display:\"flex\",flexDirection:\"column\",gap:8},children:[marketingConsent?/*#__PURE__*/_jsxs(\"label\",{style:{display:\"flex\",gap:8,alignItems:\"flex-start\"},children:[/*#__PURE__*/_jsx(\"input\",{style:{margin:0},type:\"checkbox\",className:\"checkbox-input\",checked:marketingOptIn,onChange:event=>setMarketingOptIn(event.target.checked)}),/*#__PURE__*/_jsx(\"p\",{style:{margin:0,color:\"var(--color-brown)\",...bodySFont||{}},className:\"body-xs\",children:\"I agree to receive marketing emails from Mowchi, including news, offers and updates. I can unsubscribe at any time.\"})]}):null,dataProcessing?/*#__PURE__*/_jsxs(\"label\",{style:{display:\"flex\",gap:8,alignItems:\"flex-start\"},children:[/*#__PURE__*/_jsx(\"input\",{style:{margin:0},type:\"checkbox\",className:\"checkbox-input\",name:\"PRIV_ACC\",value:\"Yes\",required:dataProcessing}),/*#__PURE__*/_jsxs(\"p\",{style:{margin:0,color:\"var(--color-brown)\",...bodySFont||{}},className:\"body-xs\",children:[\"I'd like to receive emails that contain news, offers and competitions from Mowchi. I accept the\",\" \",/*#__PURE__*/_jsx(\"a\",{style:{color:\"var(--color-chocolatebrown)\",...bodySFont||{}},href:resolvedPrivPol,target:\"_blank\",rel:\"noopener\",children:\"privacy policy\"})]})]}):null,showSuccess?/*#__PURE__*/_jsx(\"div\",{id:\"successAlert\",style:{margin:0,marginTop:12,display:\"inline-flex\",alignSelf:\"flex-start\",backgroundColor:\"var(--color-chocolatebrown)\",color:\"var(--color-beige-2)\",paddingBottom:12,paddingTop:12,paddingLeft:16,paddingRight:16,...bodySFont||{}},children:/*#__PURE__*/_jsx(\"p\",{style:{margin:0},className:\"body-xs\",children:\"You've been subscribed, Thanks for signing up!\"})}):null]}):null]}),/*#__PURE__*/_jsx(\"input\",{type:\"hidden\",name:\"MKT_OPTIN\",value:marketingOptIn?\"Yes\":\"No\"}),/*#__PURE__*/_jsx(\"input\",{type:\"hidden\",name:\"tags\",value:resolvedTags}),/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:{position:\"absolute\",left:-5e3},children:/*#__PURE__*/_jsx(\"input\",{type:\"text\",name:resolvedHoneypot,tabIndex:-1,defaultValue:\"\"})})]})]})]});}addPropertyControls(MowchiMailchimpForm,{marketingConsent:{type:ControlType.Boolean,title:\"Marketing Consent\",defaultValue:true},dataProcessing:{type:ControlType.Boolean,title:\"Data Processing\",defaultValue:true},labelFont:{type:ControlType.Font,title:\"Label Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"12px\",lineHeight:\"1.4\"}},inputFont:{type:ControlType.Font,title:\"Input Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"12px\",lineHeight:\"1.4\"}},bodySFont:{type:ControlType.Font,title:\"Body S Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"11px\",lineHeight:\"1.6\",letterSpacing:\"0px\"}},formAction:{type:ControlType.String,title:\"Form Action\",defaultValue:\"\"},tags:{type:ControlType.String,title:\"Tags\",defaultValue:\"\"},honeypot:{type:ControlType.String,title:\"Honeypot\",defaultValue:\"\"},privPol:{type:ControlType.String,title:\"Privacy Policy\",defaultValue:\"\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MowchiMailchimpForm\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Test.map"],"mappings":"oNAE6d,SAAwB,EAAoB,CAAC,KAAG,qBAAqB,aAAW,OAAK,WAAS,UAAQ,YAAU,cAAY,YAAU,YAAU,YAAU,mBAAiB,GAAK,iBAAe,IAAM,CAAC,IAAM,EAAmB,GAAY,EAAW,MAAM,CAAC,EAAW,MAAM,CAAC,EAAwB,EAAa,GAAM,EAAK,MAAM,CAAC,EAAK,MAAM,CAAC,EAAkB,EAAiB,GAAU,EAAS,MAAM,CAAC,EAAS,MAAM,CAAC,EAAsB,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