{"version":3,"file":"ParamPrefill.BYa9d86C.mjs","names":[],"sources":["https:/framerusercontent.com/modules/h3NVCa6p2zHKBgjAVzZQ/PoTGtUwp11ToqCreMu4S/ParamPrefill.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Prefills a hidden form field from an existing URL query param, carried\n * forward from an earlier step in the funnel, so the same question is not\n * asked twice.\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function ParamPrefill({paramName,fieldName}){useEffect(()=>{if(!paramName||!fieldName)return;const params=new URLSearchParams(window.location.search);const value=params.get(paramName);if(!value)return;const form=document.querySelector(\"form\");const input=form?.querySelector('input[name=\"'+fieldName+'\"]');if(input&&!input.value){input.value=value;input.dispatchEvent(new Event(\"change\",{bubbles:true}));}},[paramName,fieldName]);return /*#__PURE__*/_jsx(\"div\",{style:{width:0,height:0,overflow:\"hidden\"}});}ParamPrefill.defaultProps={paramName:\"\",fieldName:\"\"};addPropertyControls(ParamPrefill,{paramName:{type:ControlType.String,defaultValue:\"\"},fieldName:{type:ControlType.String,defaultValue:\"\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ParamPrefill\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ParamPrefill.map"],"mappings":"yLAMG,SAAwB,EAAa,CAAC,YAAU,aAAW,CAAkY,OAAjY,MAAc,CAAC,GAAG,CAAC,GAAW,CAAC,EAAU,OAAgE,IAAM,EAAM,IAApD,gBAAgB,EAAO,SAAS,MAAyB,CAAC,CAAC,IAAI,CAAS,EAAE,GAAG,CAAC,EAAM,OAAiD,IAAM,EAArC,SAAS,cAAc,MAAuB,CAAC,EAAE,cAAc,eAAe,EAAU,IAAI,EAAK,GAAO,CAAC,EAAM,QAAO,EAAM,MAAM,EAAM,EAAM,cAAc,IAAI,MAAM,SAAS,CAAC,QAAQ,EAAI,CAAC,CAAC,EAAG,EAAE,CAAC,EAAU,CAAS,CAAC,EAAsB,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,QAAQ,CAAC,CAAC,CAAE,qBANne,IAA6B,IAAoD,EAMmZ,EAAa,aAAa,CAAC,UAAU,GAAG,UAAU,EAAE,EAAE,EAAoB,EAAa,CAAC,UAAU,CAAC,KAAK,EAAY,OAAO,aAAa,EAAE,EAAE,UAAU,CAAC,KAAK,EAAY,OAAO,aAAa,EAAE,CAAC,CAAC"}