{"version":3,"file":"LightboxFormCustom.BMbPLaMh.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/nigvYBhPdpiW2nZiXoFP/CgxCMIVOaorjB7XaLV7c/LightboxFormCustom.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import*as ReactDOM from\"react-dom\";import{addPropertyControls,ControlType}from\"framer\";const loadedPortals=new Set;function loadHubSpotScript(portalId){if(typeof window===\"undefined\"||!portalId)return;if(loadedPortals.has(portalId))return;if(document.querySelector(`script[data-hs-portal=\"${portalId}\"]`)){loadedPortals.add(portalId);return;}const script=document.createElement(\"script\");script.src=`https://js.hsforms.net/forms/embed/${portalId}.js`;script.defer=true;script.setAttribute(\"data-hs-portal\",portalId);document.body.appendChild(script);loadedPortals.add(portalId);}/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function LightboxFormCustom(props){const{text,backgroundColor,textColor,fontSize,borderRadius,paddingVertical,paddingHorizontal,overlayColor,boxBackgroundColor,portalId,formId,region,style}=props;const[isOpen,setIsOpen]=React.useState(false);const[mounted,setMounted]=React.useState(false);React.useEffect(()=>{setMounted(true);},[]);React.useEffect(()=>{loadHubSpotScript(portalId);},[portalId]);React.useEffect(()=>{if(!isOpen)return;const onKeyDown=e=>{if(e.key===\"Escape\")setIsOpen(false);};document.addEventListener(\"keydown\",onKeyDown);const previousOverflow=document.body.style.overflow;document.body.style.overflow=\"hidden\";return()=>{document.removeEventListener(\"keydown\",onKeyDown);document.body.style.overflow=previousOverflow;};},[isOpen]);const overlay=/*#__PURE__*/_jsx(\"div\",{onClick:()=>setIsOpen(false),style:{position:\"fixed\",inset:0,zIndex:2147483647,backgroundColor:overlayColor,display:isOpen?\"flex\":\"none\",alignItems:\"center\",justifyContent:\"center\",padding:24},children:/*#__PURE__*/_jsxs(\"div\",{onClick:e=>e.stopPropagation(),style:{position:\"relative\",backgroundColor:boxBackgroundColor,borderRadius:12,maxWidth:560,width:\"100%\",maxHeight:\"90vh\",overflow:\"hidden\",padding:\"40px 24px 24px\"},children:[/*#__PURE__*/_jsx(\"button\",{onClick:()=>setIsOpen(false),\"aria-label\":\"Fechar\",style:{position:\"absolute\",top:12,right:12,width:32,height:32,borderRadius:\"50%\",border:\"none\",backgroundColor:\"#f2f2f2\",cursor:\"pointer\",fontSize:18,lineHeight:\"32px\",textAlign:\"center\",padding:0},children:\"\\xd7\"}),/*#__PURE__*/_jsx(\"div\",{className:\"hs-form-frame\",\"data-region\":region,\"data-form-id\":formId,\"data-portal-id\":portalId})]})});return /*#__PURE__*/_jsxs(\"div\",{style:{...style,display:\"inline-flex\"},children:[/*#__PURE__*/_jsx(\"button\",{onClick:()=>setIsOpen(true),style:{backgroundColor,color:textColor,fontSize,borderRadius,padding:`${paddingVertical}px ${paddingHorizontal}px`,border:\"none\",cursor:\"pointer\",fontFamily:\"inherit\",fontWeight:600,whiteSpace:\"nowrap\"},children:text}),mounted&&/*#__PURE__*/ReactDOM.createPortal(overlay,document.body)]});}LightboxFormCustom.defaultProps={text:\"Fa\\xe7a um teste gr\\xe1tis\",backgroundColor:\"#FAA005\",textColor:\"#FFFFFF\",fontSize:16,borderRadius:5,paddingVertical:14,paddingHorizontal:28,overlayColor:\"rgba(0,0,0,0.6)\",boxBackgroundColor:\"#003B7B\",portalId:\"6514799\",formId:\"694bf324-4781-4528-b970-78086746fd83\",region:\"na1\"};addPropertyControls(LightboxFormCustom,{text:{type:ControlType.String,title:\"Texto\",defaultValue:\"Fa\\xe7a um teste gr\\xe1tis\"},backgroundColor:{type:ControlType.Color,title:\"Cor de fundo\",defaultValue:\"#FAA005\"},textColor:{type:ControlType.Color,title:\"Cor do texto\",defaultValue:\"#FFFFFF\"},fontSize:{type:ControlType.Number,title:\"Tam. da fonte\",defaultValue:16,min:10,max:40},borderRadius:{type:ControlType.Number,title:\"Raio da borda\",defaultValue:5,min:0,max:100},paddingVertical:{type:ControlType.Number,title:\"Padding V\",defaultValue:14,min:0,max:60},paddingHorizontal:{type:ControlType.Number,title:\"Padding H\",defaultValue:28,min:0,max:100},overlayColor:{type:ControlType.Color,title:\"Fundo do lightbox\",defaultValue:\"rgba(0,0,0,0.6)\"},boxBackgroundColor:{type:ControlType.Color,title:\"Fundo do box\",defaultValue:\"#003B7B\"},portalId:{type:ControlType.String,title:\"Portal ID\",defaultValue:\"6514799\"},formId:{type:ControlType.String,title:\"Form ID\",defaultValue:\"694bf324-4781-4528-b970-78086746fd83\"},region:{type:ControlType.String,title:\"Regi\\xe3o\",defaultValue:\"na1\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LightboxFormCustom\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LightboxFormCustom.map"],"mappings":"oNAAwM,SAAS,EAAkB,EAAS,CAAkD,GAAvC,IAAS,QAAa,CAAC,GAAmB,EAAc,IAAI,CAAQ,EAAE,OAAO,GAAG,SAAS,cAAc,0BAA0B,EAAS,GAAG,EAAE,CAAC,EAAc,IAAI,CAAQ,EAAE,MAAO,CAAC,IAAM,EAAO,SAAS,cAAc,QAAQ,EAAE,EAAO,IAAI,sCAAsC,EAAS,KAAK,EAAO,MAAM,GAAK,EAAO,aAAa,iBAAiB,CAAQ,EAAE,SAAS,KAAK,YAAY,CAAM,EAAE,EAAc,IAAI,CAAQ,CAAE,CAGppB,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,OAAK,kBAAgB,YAAU,WAAS,eAAa,kBAAgB,oBAAkB,eAAa,qBAAmB,WAAS,SAAO,SAAO,SAAO,EAAW,CAAC,EAAO,GAAWA,EAAe,EAAK,EAAO,CAAC,EAAQ,GAAYA,EAAe,EAAK,EAAE,MAAoB,CAAC,EAAW,EAAI,CAAE,EAAE,CAAC,CAAC,EAA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