{"version":3,"file":"MailchimpEmailForm.Cev3kUHv.mjs","names":["React.useId","React.useState","React.useCallback","p"],"sources":["https:/framerusercontent.com/modules/TV2SoSaZyL3buumRHaHr/wb1mAMxUyprT3tDBDZWi/MailchimpEmailForm.js"],"sourcesContent":["// Add an email form, where I can put mailchimp embedded code url and I can add a code for mailchimp tag\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * Mailchimp Email Form\n *\n * @framerIntrinsicWidth 420\n * @framerIntrinsicHeight 170\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function MailchimpEmailForm(props){const{actionUrl,emailFieldName,tagFieldName,tagValue,includeTagField,includeHoneypot,honeypotFieldName,placeholder,buttonLabel,layout,gap,backgroundColor,borderColor,textColor,subtleTextColor,inputBackground,inputTextColor,buttonBackground,buttonTextColor,borderRadius,borderWidth,padding,inputFont,buttonFont,inputWidth,inputWidthPx,style}=props;const isStatic=RenderTarget.current()===RenderTarget.canvas||RenderTarget.current()===RenderTarget.thumbnail;const formTarget=React.useId().replaceAll(\":\",\"_\");const resolvedTarget=isStatic?undefined:props.openInNewTab?\"_blank\":formTarget;const[email,setEmail]=React.useState(\"\");const canSubmit=email.trim().length>3&&email.includes(\"@\")&&actionUrl.trim().length>0;const onSubmit=React.useCallback(e=>{if(!actionUrl?.trim()){e.preventDefault();return;}if(isStatic){e.preventDefault();}},[actionUrl,isStatic]);const directionStyles=layout===\"inline\"?{display:\"grid\",gridTemplateColumns:`${inputWidthPx>0?`${inputWidthPx}px`:inputWidth||\"1fr\"} auto`,gap}:{display:\"grid\",gridTemplateColumns:\"1fr\",gap};const inputBase={width:layout===\"stack\"?inputWidthPx>0?`${inputWidthPx}px`:inputWidth||\"100%\":\"100%\",height:44,borderRadius,border:`${borderWidth}px solid ${borderColor}`,background:inputBackground,color:inputTextColor,padding:\"10px 12px\",outline:\"none\",boxSizing:\"border-box\",...inputFont};const buttonBase={height:44,borderRadius,border:\"none\",background:buttonBackground,color:buttonTextColor,padding:\"10px 14px\",cursor:canSubmit?\"pointer\":\"not-allowed\",opacity:canSubmit?1:.6,whiteSpace:\"nowrap\",...buttonFont};return /*#__PURE__*/_jsx(\"section\",{style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",boxSizing:\"border-box\",display:\"flex\",flexDirection:\"column\",justifyContent:\"center\",padding,background:backgroundColor,color:textColor,borderRadius,border:`${borderWidth}px solid ${borderColor}`,overflow:\"hidden\",gap:10},\"aria-label\":\"Email signup\",children:/*#__PURE__*/_jsxs(\"form\",{action:actionUrl||undefined,method:\"post\",target:resolvedTarget,onSubmit:onSubmit,style:{position:\"relative\",width:\"100%\",margin:0},\"aria-label\":\"Mailchimp signup form\",children:[includeTagField&&tagValue.trim().length>0&&/*#__PURE__*/_jsx(\"input\",{type:\"hidden\",name:tagFieldName||\"tags\",value:tagValue}),includeHoneypot&&honeypotFieldName.trim().length>0&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",left:\"-5000px\"},\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"input\",{tabIndex:-1,name:honeypotFieldName,defaultValue:\"\"})}),/*#__PURE__*/_jsxs(\"div\",{style:directionStyles,children:[/*#__PURE__*/_jsx(\"input\",{type:\"email\",name:emailFieldName||\"EMAIL\",value:email,onChange:e=>{const v=e.target.value;React.startTransition(()=>setEmail(v));},placeholder:placeholder,required:true,autoComplete:\"email\",style:inputBase,\"aria-label\":\"Email address\"}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",name:\"subscribe\",style:buttonBase,disabled:!canSubmit,\"aria-label\":\"Submit email\",children:buttonLabel})]})]})});}addPropertyControls(MailchimpEmailForm,{openInNewTab:{type:ControlType.Boolean,title:\"Target\",defaultValue:true,enabledTitle:\"New Tab\",disabledTitle:\"Inline\"},actionUrl:{type:ControlType.String,title:\"Action URL\",defaultValue:\"https://shop.us15.list-manage.com/subscribe/post?u=1384dcbae55b4bb71ab1dd86a&id=df1d8dbb84&f_id=004eb9e0f0\",placeholder:\"https://xxxx.list-manage.com/subscribe/post?u=...&id=...\"},emailFieldName:{type:ControlType.String,title:\"Email Name\",defaultValue:\"EMAIL\"},includeTagField:{type:ControlType.Boolean,title:\"Tag Field\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},tagFieldName:{type:ControlType.String,title:\"Tag Name\",defaultValue:\"tags\",hidden:p=>!p.includeTagField},tagValue:{type:ControlType.String,title:\"Tag Value\",defaultValue:\"2806642\",placeholder:\"e.g. website\",hidden:p=>!p.includeTagField},includeHoneypot:{type:ControlType.Boolean,title:\"Honeypot\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},honeypotFieldName:{type:ControlType.String,title:\"Honeypot Name\",defaultValue:\"b_1384dcbae55b4bb71ab1dd86a_df1d8dbb84\",placeholder:\"b_xxxxx_xxxxx (from Mailchimp embed)\",hidden:p=>!p.includeHoneypot},placeholder:{type:ControlType.String,title:\"Placeholder\",defaultValue:\"you@company.com\"},buttonLabel:{type:ControlType.String,title:\"Button\",defaultValue:\"Subscribe\"},inputWidthPx:{type:ControlType.Number,title:\"Input Width\",defaultValue:0,min:0,max:1200,step:1,unit:\"px\",description:\"Set > 0 to force a pixel width for the input. Set to 0 to use CSS width below.\"},inputWidth:{type:ControlType.String,title:\"Input Width CSS\",defaultValue:\"1fr\",placeholder:\"e.g. 1fr, 320px, 60%\",description:\"Inline: used as the grid column width. Stack: sets the input element width. Ignored if Input Width (px) > 0.\"},layout:{type:ControlType.Enum,title:\"Layout\",options:[\"stack\",\"inline\"],optionTitles:[\"Stack\",\"Inline\"],defaultValue:\"inline\",displaySegmentedControl:true},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:10,min:0,max:40,step:1,unit:\"px\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},borderColor:{type:ControlType.Color,title:\"Border\",defaultValue:\"#EEEEEE\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#000000\"},subtleTextColor:{type:ControlType.Color,title:\"Subtle Text\",defaultValue:\"#CCCCCC\"},inputBackground:{type:ControlType.Color,title:\"Input Bg\",defaultValue:\"#F5F5F5\"},inputTextColor:{type:ControlType.Color,title:\"Input Text\",defaultValue:\"#000000\"},buttonBackground:{type:ControlType.Color,title:\"Button Bg\",defaultValue:\"#000000\"},buttonTextColor:{type:ControlType.Color,title:\"Button Text\",defaultValue:\"#FFFFFF\"},borderRadius:{type:ControlType.BorderRadius,title:\"Radius\",defaultValue:\"12px\"},borderWidth:{type:ControlType.Number,title:\"Border W\",defaultValue:1,min:0,max:8,step:1,unit:\"px\"},padding:{type:ControlType.Padding,title:\"Padding\",defaultValue:\"16px\"},inputFont:{type:ControlType.Font,title:\"Input Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},buttonFont:{type:ControlType.Font,title:\"Button Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MailchimpEmailForm\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"420\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"170\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MailchimpEmailForm.map"],"mappings":"6MASG,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,YAAU,iBAAe,eAAa,WAAS,kBAAgB,kBAAgB,oBAAkB,cAAY,cAAY,SAAO,MAAI,kBAAgB,cAAY,YAAU,kBAAgB,kBAAg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