{"version":3,"file":"NewsletterInline.DbHi-aZp.mjs","names":["useState","useRef","useCallback","startTransition"],"sources":["https:/framerusercontent.com/modules/xEFTX9uRXT3opwyt8AqL/A3hjtQHE4L4Sdjy9lwFu/NewsletterInline.js"],"sourcesContent":["// NewsletterInline.tsx\n// Layout responsivo com input + botão lado a lado (Opção B)\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useCallback,startTransition,useEffect,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const ENDPOINT=\"https://script.google.com/macros/s/AKfycbwwXXb92z9Owv638eG-QqzNhzcBXHexukqc1Ui1ow72Pgln5epyrf5I3-pPpqjJHBlcRg/exec\";/**\n * Newsletter Inline\n *\n * @framerIntrinsicWidth 800\n * @framerIntrinsicHeight 220\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function NewsletterInline(props){const{title,subtitle,placeholder,buttonLabel,backgroundColor,textColor,subtitleColor,buttonColor,buttonTextColor,inputBackgroundColor,inputTextColor,labelText,labelBackgroundColor,labelTextColor,titleFont,subtitleFont,buttonFont,style}=props;const[email,setEmail]=useState(\"\");const[isNarrow,setIsNarrow]=useState(false);const containerRef=useRef(null);// Detecta \"mobile\" pela largura real do componente\nuseEffect(()=>{if(!containerRef.current||typeof ResizeObserver===\"undefined\")return;const observer=new ResizeObserver(entries=>{for(const entry of entries){const width=entry.contentRect.width;startTransition(()=>setIsNarrow(width<480));}});observer.observe(containerRef.current);return()=>observer.disconnect();},[]);const handleSubmit=useCallback(async e=>{e.preventDefault();if(!email)return;try{const url=`${ENDPOINT}?email=${encodeURIComponent(email)}`;const res=await fetch(url,{method:\"GET\"});console.log(\"Newsletter submit response:\",res.status);}catch(error){console.error(\"NewsletterInline submission error:\",error);}finally{startTransition(()=>{setEmail(\"\");});}},[email]);const isMobile=isNarrow;const fieldHeight=48;return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{...style,width:\"100%\",height:\"auto\",backgroundColor:\"transparent\",display:\"flex\",justifyContent:\"center\",padding:isMobile?\"32px 16px\":\"40px 24px\",boxSizing:\"border-box\"},children:/*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",maxWidth:isMobile?360:740,margin:\"0 auto\",textAlign:\"center\",backgroundColor,padding:isMobile?\"24px 16px\":\"28px 32px\",borderRadius:0,boxSizing:\"border-box\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{display:\"inline-block\",marginBottom:12,padding:\"4px 12px\",borderRadius:999,backgroundColor:labelBackgroundColor,color:labelTextColor,fontSize:11,lineHeight:\"1\",boxShadow:\"inset 0px -1px 2px rgba(249, 249, 249, 0.4)\",backdropFilter:\"blur(24px)\"},children:labelText}),/*#__PURE__*/_jsx(\"h2\",{style:{margin:0,marginBottom:12,color:textColor,...titleFont},children:title}),/*#__PURE__*/_jsx(\"p\",{style:{margin:\"0 0 24px 0\",color:subtitleColor,...subtitleFont},children:subtitle}),/*#__PURE__*/_jsx(\"form\",{onSubmit:handleSubmit,style:{width:\"100%\",maxWidth:isMobile?360:520,margin:\"0 auto\"},children:/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"row\",alignItems:\"center\",gap:8},children:[/*#__PURE__*/_jsx(\"div\",{style:{flex:isMobile?\"0 0 60%\":\"1 1 auto\"},children:/*#__PURE__*/_jsx(\"input\",{type:\"email\",name:\"email\",placeholder:placeholder,value:email,onChange:e=>startTransition(()=>setEmail(e.target.value)),required:true,style:{width:\"100%\",height:fieldHeight,padding:\"0 18px\",borderRadius:999,border:\"none\",backgroundColor:inputBackgroundColor,color:inputTextColor,fontSize:14,lineHeight:\"1.2\",outline:\"none\",boxSizing:\"border-box\"}})}),/*#__PURE__*/_jsx(\"div\",{style:{flex:isMobile?\"0 0 40%\":\"0 0 auto\"},children:/*#__PURE__*/_jsx(\"button\",{type:\"submit\",style:{width:\"100%\",height:fieldHeight,padding:\"0 18px\",borderRadius:999,border:\"none\",backgroundColor:buttonColor,color:buttonTextColor,cursor:\"pointer\",transition:\"transform 0.2s, box-shadow 0.2s\",whiteSpace:\"nowrap\",boxSizing:\"border-box\",...buttonFont},onMouseEnter:e=>{e.currentTarget.style.transform=\"translateY(-1px)\";e.currentTarget.style.boxShadow=\"0 4px 12px rgba(0, 0, 0, 0.25)\";},onMouseLeave:e=>{e.currentTarget.style.transform=\"translateY(0)\";e.currentTarget.style.boxShadow=\"none\";},children:buttonLabel})})]})})]})});}addPropertyControls(NewsletterInline,{labelText:{type:ControlType.String,title:\"Label Text\",defaultValue:\"Newsletter\"},labelBackgroundColor:{type:ControlType.Color,title:\"Label BG\",defaultValue:\"rgba(249, 249, 249, 0.1)\"},labelTextColor:{type:ControlType.Color,title:\"Label Text\",defaultValue:\"rgba(255, 255, 255, 0.8)\"},title:{type:ControlType.String,title:\"Title\",defaultValue:\"Mantenha-se atualizado sobre os novos produtos\"},subtitle:{type:ControlType.String,title:\"Subtitle\",defaultValue:\"Junte-se \\xe0 nossa newsletter e receba em primeira m\\xe3o novidades e promo\\xe7\\xf5es exclusivas.\",displayTextArea:true},placeholder:{type:ControlType.String,title:\"Email Placeholder\",defaultValue:\"Email\"},buttonLabel:{type:ControlType.String,title:\"Button Label\",defaultValue:\"Subscreva\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#111315\"},textColor:{type:ControlType.Color,title:\"Title Color\",defaultValue:\"#B8D0E0\"},subtitleColor:{type:ControlType.Color,title:\"Subtitle Color\",defaultValue:\"#A0A7AC\"},inputBackgroundColor:{type:ControlType.Color,title:\"Input Background\",defaultValue:\"#1E1F21\"},inputTextColor:{type:ControlType.Color,title:\"Input Text\",defaultValue:\"#FFFFFF\"},buttonColor:{type:ControlType.Color,title:\"Button Color\",defaultValue:\"#FFFFFF\"},buttonTextColor:{type:ControlType.Color,title:\"Button Text\",defaultValue:\"#000000\"},titleFont:{type:ControlType.Font,title:\"Title Font\",defaultValue:{fontSize:\"28px\",variant:\"Semibold\",letterSpacing:\"-0.03em\",lineHeight:\"1.2em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},subtitleFont:{type:ControlType.Font,title:\"Subtitle Font\",defaultValue:{fontSize:\"16px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.4em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},buttonFont:{type:ControlType.Font,title:\"Button Font\",defaultValue:{variant:\"Semibold\",fontSize:\"15px\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"NewsletterInline\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"220\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"800\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./NewsletterInline.map"],"mappings":"6MAUG,SAAwB,EAAiB,EAAM,CAAC,GAAK,CAAC,QAAM,WAAS,cAAY,cAAY,kBAAgB,YAAU,gBAAc,cAAY,kBAAgB,uBAAqB,iBAAe,YAAU,uBAAqB,iBAAe,YAAU,eAAa,aAAW,SAAO,EAAW,CAAC,EAAM,GAAUA,EAAS,GAAG,CAAM,CAAC,EAAS,GAAaA,EAAS,GAAM,CAAO,EAAaC,EAAO,KAAK,CACnZ,MAAc,CAAC,GAAG,CAAC,EAAa,SAAS,OAAO,eAAiB,IAAY,OAAO,IAAM,EAAS,IAAI,eAAe,GAAS,CAAC,IAAI,IAAM,KAAS,EAAQ,CAAC,IAAM,EAAM,EAAM,YAAY,MAAM,MAAoB,EAAY,EAAM,IAAI,CAAC,GAAI,CAAwC,OAAvC,EAAS,QAAQ,EAAa,QAAQ,KAAW,EAAS,YAAY,EAAG,EAAE,CAAC,CAAC,IAAM,EAAaC,EAAY,KAAM,IAAG,CAA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