{"version":3,"file":"HSform.C05iLSqp.mjs","names":["HubSpotLegacyForm","useRef"],"sources":["https:/framerusercontent.com/modules/M1nu4MmWmFNoB5Dek6UR/UHttfbavtYQtkEF1tTOu/HSform.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,withCSS}from\"framer\";import{emptyStateStyle,stateParagraphStyle,stateTitleStyle}from\"https://framer.com/m/framer/integrations-styles.js@0.2.0\";import{useEffect,useRef}from\"react\";function poll(f,delay=200,count=5*60*5,i=0){if(i>count){console.error(\"poll max attempts\",f);return;}if(!f()){setTimeout(()=>{poll(f,delay,count,i+1);},delay);}}function EmptyState({title,description}){return /*#__PURE__*/_jsxs(\"div\",{style:{...emptyStateStyle,width:\"100%\",height:\"100%\"},children:[/*#__PURE__*/_jsx(\"h1\",{style:stateTitleStyle,children:title}),/*#__PURE__*/_jsx(\"p\",{style:stateParagraphStyle,children:description})]});}/**\n * @framerDisableUnlink\n *\n * @framerIntrinsicWidth 480\n * @framerIntrinsicHeight 300\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */const HubSpotLegacyForm=withCSS(function HubSpotLegacyForm({portalId,formId,region,id}){if(!portalId||!formId||!region){return /*#__PURE__*/_jsx(EmptyState,{title:\"Hubspot\",description:\"Set a portal ID and form in the Properties.\"});}// const ref = React.createRef<HTMLDivElement>()\nconst elementId=`hubspot_form_${id}`;const cleanup=()=>{const element=document.querySelector(`#${elementId}`);if(element)element.innerHTML=\"\";};const formRef=useRef(null);useEffect(()=>{if(window.hbspt){handleScriptLoad();return cleanup;}const script=document.createElement(\"script\");script.src=`https://js-${region}.hsforms.net/forms/shell.js`;script.onload=handleScriptLoad;document.body.appendChild(script);return cleanup;},[portalId,formId,region]);const handleScriptLoad=()=>{poll(()=>{if(!window.hbspt){console.warn(`HubSpot could not be loaded: window.hbspt is missing`);return false;}if(!document.querySelector(`#${elementId}`)){console.warn(`HubSpot could not be loaded: element not found #${elementId}`);return false;}cleanup();window.hbspt.forms.create({region,portalId,formId,target:`#${elementId}`,formInstanceId:formId});return true;});};return /*#__PURE__*/_jsx(\"div\",{ref:formRef,id:elementId});},[/* Base form container */`.hs-form { max-width: 1200px; margin: 0 auto; }`,/* Inputs / selects / textareas */`.hs-form input, .hs-form textarea, .hs-form select {\n            background: transparent !important;\n            border: none !important;\n            border-bottom: 1px solid rgba(255,255,255,0.6) !important;\n            color: #ffffff !important;\n            padding: 10px 0 !important;\n            font-size: 16px !important;\n            font-family: 'Open Sans', sans-serif !important;\n            font-weight: 400 !important;\n            margin-bottom: 20px !important;\n            width: 100% !important;\n            outline: none !important;\n            box-shadow: none !important;\n        }`,/* Placeholders */`.hs-form input::placeholder, .hs-form textarea::placeholder, .hs-form select::placeholder {\n            color: rgba(255,255,255,0.6) !important;\n            font-size: 16px !important;\n            font-family: 'Open Sans', sans-serif !important;\n            font-weight: 400 !important;\n        }`,/* Labels (general fields) */`.hs-form label {\n            color: #ffffff !important;\n            font-size: 16px !important;\n            font-family: 'Open Sans', sans-serif !important;\n            font-weight: 400 !important;\n            display: block !important;\n            margin-bottom: 4px !important;\n        }`,/* Fieldset layout */`.hs-form fieldset {\n            max-width: 1000px !important;\n            width: 100% !important;\n            display: flex !important;\n            flex-wrap: wrap !important;\n            gap: 20px !important;\n            border: 0 !important;\n            margin: 0 !important;\n            padding: 0 !important;\n        }`,/* Flex children: stretch typical fields, NOT boolean/radio groups */`.hs-form fieldset > *:not(.hs-form-booleancheckbox-display):not(.hs-form-checkbox):not(.hs-form-radio) {\n            flex: 1 1 0 !important;\n            min-width: 0 !important;\n        }`,/* Boolean checkbox (your case) — keep inline with text */`.hs-form .hs-form-booleancheckbox-display {\n            display: inline-flex !important;\n            align-items: center !important;\n            gap: 8px !important;\n            margin: 10px 0 !important;\n            flex: 0 0 auto !important;\n            width: auto !important;\n        }`,/* Ensure the checkbox input itself looks right on dark bg */`.hs-form .hs-form-booleancheckbox-display input[type=\"checkbox\"] {\n            width: auto !important;\n            margin: 0 !important;\n            accent-color: #ffffff !important;\n        }`,/* Generic checkbox/radio groups (HubSpot often wraps these) */`.hs-form .hs-form-checkbox, .hs-form .hs-form-radio {\n            display: flex !important;\n            flex-wrap: wrap !important;\n            gap: 12px 20px !important;\n            align-items: center !important;\n            margin: 6px 0 16px 0 !important;\n            flex: 0 0 100% !important; /* occupy a full row */\n        }`,`.hs-form .hs-form-checkbox label,\n            .hs-form .hs-form-radio label {\n            display: inline-flex !important;\n            align-items: center !important;\n            gap: 8px !important;\n            margin: 0 !important;\n            color: #ffffff !important;\n            font-size: 14px !important;\n        }`,`.hs-form .hs-form-checkbox input[type=\"checkbox\"],\n            .hs-form .hs-form-radio input[type=\"radio\"] {\n            width: auto !important;\n            margin: 0 !important;\n            accent-color: #ffffff !important;\n        }`,/* Submit button */`.hs-form input[type=\"submit\"] {\n            background-color: #ffffff !important;\n            color: #0f172a !important;\n            padding: 12px 20px !important;\n            font-weight: 600 !important;\n            border: none !important;\n            border-radius: 6px !important;\n            cursor: pointer !important;\n            margin-top: 10px !important;\n        }`,/* Consent / richtext copy */`.hs-form .legal-consent-container, .hs-form .hs-richtext {\n            color: #ffffff !important;\n            font-size: 12px !important;\n            font-family: 'Open Sans', sans-serif !important;\n            font-weight: 400 !important;\n            line-height: 1.5 !important;\n        }`,`.hs-form .legal-consent-container a, .hs-form .hs-richtext a {\n            color: #ffffff !important;\n            font-size: 12px !important;\n            font-family: 'Open Sans', sans-serif !important;\n            font-weight: 400 !important;\n            text-decoration: underline !important;\n        }`,/* Focus + error states (nice UX on dark bg) */`.hs-form input:focus, .hs-form textarea:focus, .hs-form select:focus {\n            border-bottom-color: #ffffff !important;\n        }`,`.hs-form .hs-error-msg, .hs-form .hs-error-msgs li {\n            color: #ffb4b4 !important;\n            font-size: 12px !important;\n            margin-top: -12px !important;\n            margin-bottom: 12px !important;\n        }`,`.hs-form .invalid input, .hs-form .invalid textarea, .hs-form .invalid select {\n            border-bottom-color: #ff6b6b !important;\n        }`,/* Responsive */`@media (max-width: 810px) {\n            .hs-form fieldset {\n            flex-direction: column !important;\n            gap: 10px !important;\n            }\n            .hs-form fieldset > * { width: 100% !important; }\n\n            /* Keep boolean checkbox inline even on mobile */\n            .hs-form .hs-form-booleancheckbox-display {\n            width: 100% !important;\n            justify-content: flex-start !important;\n            }\n        }`]);addPropertyControls(HubSpotLegacyForm,{portalId:{title:\"Portal\",type:ControlType.String,placeholder:\"25276298\",description:\"Create a [Hubspot](https://www.hubspot.com/) account, add a new form and copy your portal ID. [Learn more…](https://www.framer.com/plugins/hubspot/)\"},formId:{title:\"Form\",type:ControlType.String,placeholder:\"e7167571-4bc4-4c2c-bfdc-a0a8dbfd22f1\"},advanced:{title:\"Advanced\",type:ControlType.Boolean,enabledTitle:\"Show\",disabledTitle:\"Hide\",defaultValue:false},region:{title:\"Region\",type:ControlType.String,placeholder:\"eu1\",defaultValue:\"eu1\",hidden:({advanced})=>!advanced}});export default HubSpotLegacyForm;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HubSpotLegacyForm\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"*\",\"framerIntrinsicWidth\":\"480\",\"framerIntrinsicHeight\":\"300\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HSform.map"],"mappings":"6RAAmR,SAAS,EAAK,EAAE,EAAM,IAAI,EAAM,IAAK,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,EAAM,CAAC,QAAQ,MAAM,oBAAoB,EAAE,CAAC,OAAY,GAAG,EAAE,eAAe,CAAC,EAAK,EAAE,EAAM,EAAM,EAAE,EAAE,EAAG,EAAM,CAAG,SAAS,EAAW,CAAC,QAAM,eAAa,CAAC,OAAoB,EAAM,MAAM,C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