{"version":3,"file":"Form_Hubspot.YJSfnIVD.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/Ro51wI2tEwqIgvhmrd6S/AQmo083Kvl1sp3NqB0bT/Form_Hubspot.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useRef}from\"react\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function HubSpotForm(props){const{portalId,formId,region}=props;const formRef=useRef(null);useEffect(()=>{// Clear any existing form inside the container\nif(formRef.current){formRef.current.innerHTML=\"\";}// Load the HubSpot script dynamically\nconst script=document.createElement(\"script\");script.src=\"https://js.hsforms.net/forms/embed/v2.js\";script.async=true;script.onload=()=>{if(window.hbspt){window.hbspt.forms.create({portalId,formId,region,target:`#hubspot-form-${formId}`,onFormSubmit:function(){// GA4 direct\nif(window.gtag){window.gtag(\"event\",\"hubspot_form_submit\",{form_id:formId,page_path:location.pathname});}}});}};document.body.appendChild(script);return()=>{// Cleanup: Remove script to prevent duplicates\nscript.remove();};},[portalId,formId,region]);return /*#__PURE__*/_jsx(\"div\",{id:`hubspot-form-${formId}`,ref:formRef,style:formContainerStyle});}// **Framer Property Controls**\naddPropertyControls(HubSpotForm,{portalId:{title:\"Portal ID\",type:ControlType.String,defaultValue:\"45694123\"},formId:{title:\"Form ID\",type:ControlType.String,defaultValue:\"d8754ba8-32dd-4ee8-bc81-5bc3e3001674\"},region:{title:\"Region\",type:ControlType.String,defaultValue:\"na1\"}});// **Styles**\nconst formContainerStyle={width:\"100%\"};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HubSpotForm\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Form_Hubspot.map"],"mappings":"kTAGG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,WAAS,SAAO,UAAQ,EAAY,EAAQA,EAAO,KAAK,CAI9D,OAJ+D,MAAc,CACxH,EAAQ,UAAS,EAAQ,QAAQ,UAAU,IAC9C,IAAM,EAAO,SAAS,cAAc,SAAS,CACqG,MADpG,GAAO,IAAI,2CAA2C,EAAO,MAAM,GAAK,EAAO,WAAW,CAAI,EAAO,OAAO,EAAO,MAAM,MAAM,OAAO,CAAC,WAAS,SAAO,SAAO,OAAO,iBAAiB,IAAS,aAAa,UAAU,CACjQ,EAAO,MAAM,EAAO,KAAK,QAAQ,sBAAsB,CAAC,QAAQ,EAAO,UAAU,SAAS,SAAS,CAAC,EAAI,CAAC,EAAI,SAAS,KAAK,YAAY,EAAO,KAAW,CAC5J,EAAO,QAAQ,GAAK,CAAC,EAAS,EAAO,EAAO,CAAC,CAAqB,EAAK,MAAM,CAAC,GAAG,gBAAgB,IAAS,IAAI,EAAQ,MAAM,EAAmB,CAAC,wBAPrG,IAAoD,IAAoC,CAQnI,EAAoB,EAAY,CAAC,SAAS,CAAC,MAAM,YAAY,KAAK,EAAY,OAAO,aAAa,WAAW,CAAC,OAAO,CAAC,MAAM,UAAU,KAAK,EAAY,OAAO,aAAa,uCAAuC,CAAC,OAAO,CAAC,MAAM,SAAS,KAAK,EAAY,OAAO,aAAa,MAAM,CAAC,CAAC,CACjR,EAAmB,CAAC,MAAM,OAAO"}