{"version":3,"file":"FormPrefill.CI5tED68.mjs","names":["React.useContext","React.useMemo","React.Fragment","React.forwardRef","useRef","React.useId","useRef","__esmMin","init_npm_react_18_3_1","x","ce","oe","window","pe","init_ssg_sandbox_shims","init_jsx_runtime","ie","p","J","de","motion","MotionConfigContext","LayoutGroup","init_framer_motion_DhsWWWsN","withFX","addPropertyControls","useVariantState","useLocaleInfo","addFonts","cx","withCSS","init_framer_DxfB3JJo","RichText","ControlType","useComponentViewport","addPropertyOverrides","variants","nextOverrides","variant","overrides","MotionDivWithFX","enabledGestures","cycleOrder","serializationHash","variantClassNames","transition1","transition2","animation","transformTemplate1","Transition","humanReadableVariantMap","Variants","getProps","createLayoutDependency","FramermVh7Uov_5","init_mVh7Uov_5","config","transition","value","contextValue","props","glow","textColor","cTAText","buttonColor","hoverColor","fallbackRef","refBinding","ref","defaultLayoutId","restProps","layoutDependency","scopingClassNames","isDisplayed","baseVariant","isDisplayed1","layoutId","gestureHandlers","className","classNames","G1s9OoXro","PiChBsopY","style","UvONMizB4","gestureVariant","p0OGc94e1","P1VIuwDLc","setField","name","input","form","candidate","nativeSetter","FormPrefill","anchorRef","prefillDataRef","cid","allInputs","i","fillAll","firstNameField","data","lastNameField","emailField","phoneField","companyField","handleSubmit","controller","timerId","apiBaseUrl","res","err","init_FormPrefill"],"sources":["https:/framerusercontent.com/modules/6etWqznF22EVTe7TEKVL/6lnuhw9onqGv5INZW5hV/mVh7Uov_5.js","https:/framerusercontent.com/modules/Vl9senjr48WwfaZveKt0/qE7tXvfSxz9AanPyPTxw/FormPrefill.js"],"sourcesContent":["// Generated by Framer (1a93ff7)\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addFonts,addPropertyControls,ControlType,cx,RichText,useComponentViewport,useLocaleInfo,useVariantState,withCSS,withFX}from\"framer\";import{LayoutGroup,motion,MotionConfigContext}from\"framer-motion\";import*as React from\"react\";import{useRef}from\"react\";const MotionDivWithFX=withFX(motion.div);const enabledGestures={L2mWi8dG_:{hover:true,pressed:true}};const cycleOrder=[\"L2mWi8dG_\",\"vVHTd46UY\",\"dGrJ75R_T\",\"Mfebqk9wq\",\"yP3TbzWZL\"];const serializationHash=\"framer-cO9wx\";const variantClassNames={dGrJ75R_T:\"framer-v-1p5r095\",L2mWi8dG_:\"framer-v-1lg3dq7\",Mfebqk9wq:\"framer-v-rxmafm\",vVHTd46UY:\"framer-v-1360yge\",yP3TbzWZL:\"framer-v-ktuytz\"};function addPropertyOverrides(overrides,...variants){const nextOverrides={};variants?.forEach(variant=>variant&&Object.assign(nextOverrides,overrides[variant]));return nextOverrides;}const PiChBsopY=undefined;const G1s9OoXro=undefined;const UvONMizB4=undefined;const p0OGc94e1=undefined;const P1VIuwDLc=undefined;const transition1={delay:0,duration:.2,ease:[.44,0,.56,1],type:\"tween\"};const transition2={delay:0,duration:1,ease:[0,0,1,1],type:\"tween\"};const animation={opacity:1,rotate:360,rotateX:0,rotateY:0,scale:1,skewX:0,skewY:0,x:0,y:0};const transformTemplate1=(_,t)=>`translateX(-50%) ${t}`;const Transition=({value,children})=>{const config=React.useContext(MotionConfigContext);const transition=value??config.transition;const contextValue=React.useMemo(()=>({...config,transition}),[JSON.stringify(transition)]);return /*#__PURE__*/_jsx(MotionConfigContext.Provider,{value:contextValue,children:children});};const humanReadableVariantMap={Default:\"L2mWi8dG_\",Disabled:\"dGrJ75R_T\",Error:\"yP3TbzWZL\",Loading:\"vVHTd46UY\",Success:\"Mfebqk9wq\"};const Variants=motion.create(React.Fragment);const getProps=({buttonColor,cTAText,glow,height,hoverColor,id,textColor,width,...props})=>{return{...props,G1s9OoXro:glow??props.G1s9OoXro??\"0px 4px 12px 0px rgba(133, 142, 98, 0.5), 4px -2px 12px 0px rgba(90, 122, 226, 0.5), -4px -2px 12px 0px rgba(207, 157, 78, 0.5)\",p0OGc94e1:textColor??props.p0OGc94e1??\"rgb(255, 255, 255)\",P1VIuwDLc:cTAText??props.P1VIuwDLc??\"Watch the demo\",PiChBsopY:buttonColor??props.PiChBsopY??\"rgb(28, 29, 24)\",UvONMizB4:hoverColor??props.UvONMizB4??\"var(--token-8d70c8b7-0f51-40f2-bc78-9030a1ba0e84, rgb(49, 49, 53))\",variant:humanReadableVariantMap[props.variant]??props.variant??\"L2mWi8dG_\"};};const createLayoutDependency=(props,variants)=>{if(props.layoutDependency)return variants.join(\"-\")+props.layoutDependency;return variants.join(\"-\");};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const fallbackRef=useRef(null);const refBinding=ref??fallbackRef;const defaultLayoutId=React.useId();const{activeLocale,setLocale}=useLocaleInfo();const componentViewport=useComponentViewport();const{style,className,layoutId,variant,P1VIuwDLc,p0OGc94e1,PiChBsopY,UvONMizB4,G1s9OoXro,...restProps}=getProps(props);const{baseVariant,classNames,clearLoadingGesture,gestureHandlers,gestureVariant,isLoading,setGestureState,setVariant,variants}=useVariantState({cycleOrder,defaultVariant:\"L2mWi8dG_\",enabledGestures,ref:refBinding,variant,variantClassNames});const layoutDependency=createLayoutDependency(props,variants);const sharedStyleClassNames=[];const scopingClassNames=cx(serializationHash,...sharedStyleClassNames);const isDisplayed=()=>{if(baseVariant===\"vVHTd46UY\")return false;return true;};const isDisplayed1=()=>{if(baseVariant===\"vVHTd46UY\")return true;return false;};return /*#__PURE__*/_jsx(LayoutGroup,{id:layoutId??defaultLayoutId,children:/*#__PURE__*/_jsx(Variants,{animate:variants,initial:false,children:/*#__PURE__*/_jsx(Transition,{value:transition1,children:/*#__PURE__*/_jsxs(motion.button,{...restProps,...gestureHandlers,className:cx(scopingClassNames,\"framer-1lg3dq7\",className,classNames),\"data-framer-name\":\"Default\",\"data-reset\":\"button\",layoutDependency:layoutDependency,layoutId:\"L2mWi8dG_\",ref:refBinding,style:{\"--f2wypb\":G1s9OoXro,backgroundColor:PiChBsopY,borderBottomLeftRadius:10,borderBottomRightRadius:10,borderTopLeftRadius:10,borderTopRightRadius:10,boxShadow:\"var(--f2wypb)\",opacity:1,...style},variants:{\"L2mWi8dG_-hover\":{backgroundColor:UvONMizB4,opacity:1},\"L2mWi8dG_-pressed\":{backgroundColor:\"var(--token-8d70c8b7-0f51-40f2-bc78-9030a1ba0e84, rgb(49, 49, 53))\",opacity:1},dGrJ75R_T:{opacity:.5},Mfebqk9wq:{opacity:1},yP3TbzWZL:{backgroundColor:\"rgba(255, 34, 68, 0.15)\",opacity:1}},...addPropertyOverrides({\"L2mWi8dG_-hover\":{\"data-framer-name\":undefined},\"L2mWi8dG_-pressed\":{\"data-framer-name\":undefined},dGrJ75R_T:{\"data-framer-name\":\"Disabled\"},Mfebqk9wq:{\"data-framer-name\":\"Success\"},vVHTd46UY:{\"data-framer-name\":\"Loading\"},yP3TbzWZL:{\"data-framer-name\":\"Error\"}},baseVariant,gestureVariant),children:[isDisplayed()&&/*#__PURE__*/_jsx(RichText,{__fromCanvasComponent:true,children:/*#__PURE__*/_jsx(React.Fragment,{children:/*#__PURE__*/_jsx(motion.p,{dir:\"auto\",style:{\"--font-selector\":\"SW50ZXItU2VtaUJvbGQ=\",\"--framer-font-size\":\"14px\",\"--framer-font-weight\":\"600\",\"--framer-text-color\":\"var(--extracted-r6o4lv, var(--variable-reference-p0OGc94e1-mVh7Uov_5))\"},children:\"Watch the demo\"})}),className:\"framer-19vua8u\",fonts:[\"Inter-SemiBold\"],layoutDependency:layoutDependency,layoutId:\"Ae5bzhfHS\",style:{\"--extracted-r6o4lv\":\"var(--variable-reference-p0OGc94e1-mVh7Uov_5)\",\"--framer-link-text-color\":\"rgb(0, 153, 255)\",\"--framer-link-text-decoration\":\"underline\",\"--variable-reference-p0OGc94e1-mVh7Uov_5\":p0OGc94e1},text:P1VIuwDLc,variants:{Mfebqk9wq:{\"--extracted-r6o4lv\":\"rgb(255, 255, 255)\"},yP3TbzWZL:{\"--extracted-r6o4lv\":\"rgb(255, 34, 68)\"}},verticalAlignment:\"top\",withExternalLayout:true,...addPropertyOverrides({Mfebqk9wq:{children:/*#__PURE__*/_jsx(React.Fragment,{children:/*#__PURE__*/_jsx(motion.p,{style:{\"--font-selector\":\"SW50ZXItU2VtaUJvbGQ=\",\"--framer-font-size\":\"12px\",\"--framer-font-weight\":\"600\",\"--framer-text-color\":\"var(--extracted-r6o4lv, rgb(255, 255, 255))\"},children:\"Thank you! We have received your info.\"})}),text:undefined},yP3TbzWZL:{children:/*#__PURE__*/_jsx(React.Fragment,{children:/*#__PURE__*/_jsx(motion.p,{style:{\"--font-selector\":\"SW50ZXItU2VtaUJvbGQ=\",\"--framer-font-size\":\"14px\",\"--framer-font-weight\":\"600\",\"--framer-text-color\":\"var(--extracted-r6o4lv, rgb(255, 34, 68))\"},children:\"Something went wrong\"})}),text:undefined}},baseVariant,gestureVariant)}),isDisplayed1()&&/*#__PURE__*/_jsx(motion.div,{className:\"framer-12w9dly\",\"data-framer-name\":\"Spinner\",layoutDependency:layoutDependency,layoutId:\"niXEsW9Br\",style:{mask:\"url('https://framerusercontent.com/images/pGiXYozQ3mE4cilNOItfe2L2fUA.svg?width=20&height=20') alpha no-repeat center / cover add\",WebkitMask:\"url('https://framerusercontent.com/images/pGiXYozQ3mE4cilNOItfe2L2fUA.svg?width=20&height=20') alpha no-repeat center / cover add\"},children:/*#__PURE__*/_jsx(MotionDivWithFX,{__framer__loop:animation,__framer__loopEffectEnabled:true,__framer__loopRepeatDelay:0,__framer__loopRepeatType:\"loop\",__framer__loopTransition:transition2,__perspectiveFX:false,__smartComponentFX:true,__targetOpacity:1,className:\"framer-10n6t0b\",\"data-framer-name\":\"Conic\",layoutDependency:layoutDependency,layoutId:\"UX3J4rzdU\",style:{background:\"conic-gradient(from 180deg at 50% 50%, rgb(68, 204, 255) 0deg, rgb(68, 204, 255) 360deg)\",backgroundColor:\"rgb(68, 204, 255)\",mask:\"none\",WebkitMask:\"none\"},variants:{vVHTd46UY:{background:\"conic-gradient(from 0deg at 50% 50%, rgba(255, 255, 255, 0) 7.208614864864882deg, rgb(255, 255, 255) 342deg)\",backgroundColor:\"rgba(0, 0, 0, 0)\",mask:\"url('https://framerusercontent.com/images/pGiXYozQ3mE4cilNOItfe2L2fUA.svg?width=20&height=20') alpha no-repeat center / cover add\",WebkitMask:\"url('https://framerusercontent.com/images/pGiXYozQ3mE4cilNOItfe2L2fUA.svg?width=20&height=20') alpha no-repeat center / cover add\"}},children:/*#__PURE__*/_jsx(motion.div,{className:\"framer-1frcggs\",\"data-framer-name\":\"Rounding\",layoutDependency:layoutDependency,layoutId:\"vVkmG6Xki\",style:{backgroundColor:\"rgb(255, 255, 255)\",borderBottomLeftRadius:1,borderBottomRightRadius:1,borderTopLeftRadius:1,borderTopRightRadius:1},transformTemplate:transformTemplate1})})})]})})})});});const css=[\"@supports (aspect-ratio: 1) { body { --framer-aspect-ratio-supported: auto; } }\",\".framer-cO9wx.framer-1huugoe, .framer-cO9wx .framer-1huugoe { display: block; }\",\".framer-cO9wx.framer-1lg3dq7 { align-content: center; align-items: center; cursor: pointer; display: flex; flex-direction: row; flex-wrap: nowrap; gap: 0px; height: 40px; justify-content: center; overflow: var(--overflow-clip-fallback, clip); padding: 0px; position: relative; width: 240px; will-change: var(--framer-will-change-override, transform); }\",\".framer-cO9wx .framer-19vua8u { -webkit-user-select: none; flex: none; height: auto; position: relative; user-select: none; white-space: pre; width: auto; }\",\".framer-cO9wx .framer-12w9dly { aspect-ratio: 1 / 1; flex: none; gap: 10px; height: var(--framer-aspect-ratio-supported, 20px); overflow: hidden; position: relative; width: 20px; }\",\".framer-cO9wx .framer-10n6t0b { bottom: 0px; flex: none; left: 0px; overflow: visible; position: absolute; right: 0px; top: 0px; }\",\".framer-cO9wx .framer-1frcggs { aspect-ratio: 1 / 1; flex: none; height: var(--framer-aspect-ratio-supported, 2px); left: 50%; overflow: visible; position: absolute; top: 0px; width: 2px; }\",\".framer-cO9wx.framer-v-1360yge.framer-1lg3dq7, .framer-cO9wx.framer-v-1p5r095.framer-1lg3dq7, .framer-cO9wx.framer-v-rxmafm.framer-1lg3dq7, .framer-cO9wx.framer-v-ktuytz.framer-1lg3dq7 { cursor: unset; }\",\".framer-cO9wx.framer-v-1360yge .framer-10n6t0b { overflow: hidden; }\"];/**\n * This is a generated Framer component.\n * @framerIntrinsicHeight 40\n * @framerIntrinsicWidth 240\n * @framerCanvasComponentVariantDetails {\"propertyName\":\"variant\",\"data\":{\"default\":{\"layout\":[\"fixed\",\"fixed\"]},\"vVHTd46UY\":{\"layout\":[\"fixed\",\"fixed\"]},\"dGrJ75R_T\":{\"layout\":[\"fixed\",\"fixed\"]},\"Mfebqk9wq\":{\"layout\":[\"fixed\",\"fixed\"]},\"yP3TbzWZL\":{\"layout\":[\"fixed\",\"fixed\"]},\"rbmgxMjEm\":{\"layout\":[\"fixed\",\"fixed\"]},\"y9vztox0c\":{\"layout\":[\"fixed\",\"fixed\"]}}}\n * @framerVariables {\"P1VIuwDLc\":\"cTAText\",\"p0OGc94e1\":\"textColor\",\"PiChBsopY\":\"buttonColor\",\"UvONMizB4\":\"hoverColor\",\"G1s9OoXro\":\"glow\"}\n * @framerImmutableVariables true\n * @framerDisplayContentsDiv false\n * @framerAutoSizeImages true\n * @framerComponentViewportWidth true\n * @framerColorSyntax true\n */const FramermVh7Uov_5=withCSS(Component,css,\"framer-cO9wx\");export default FramermVh7Uov_5;FramermVh7Uov_5.displayName=\"Form Submit Button\";FramermVh7Uov_5.defaultProps={height:40,width:240};addPropertyControls(FramermVh7Uov_5,{variant:{options:[\"L2mWi8dG_\",\"vVHTd46UY\",\"dGrJ75R_T\",\"Mfebqk9wq\",\"yP3TbzWZL\"],optionTitles:[\"Default\",\"Loading\",\"Disabled\",\"Success\",\"Error\"],title:\"Variant\",type:ControlType.Enum},P1VIuwDLc:{defaultValue:\"Watch the demo\",displayTextArea:false,title:\"CTA Text\",type:ControlType.String},onP1VIuwDLcChange:{changes:\"P1VIuwDLc\",type:ControlType.ChangeHandler},p0OGc94e1:{defaultValue:\"rgb(255, 255, 255)\",title:\"Text Color\",type:ControlType.Color},PiChBsopY:{defaultValue:\"rgb(28, 29, 24)\",title:\"Button Color\",type:ControlType.Color},UvONMizB4:{defaultValue:'var(--token-8d70c8b7-0f51-40f2-bc78-9030a1ba0e84, rgb(49, 49, 53)) /* {\"name\":\"800\"} */',title:\"Hover Color\",type:ControlType.Color},G1s9OoXro:{defaultValue:[{blur:12,color:\"rgba(133, 142, 98, 0.5)\",diffusion:.5,focus:.5,inset:false,spread:0,type:\"box\",x:0,y:4},{blur:12,color:\"rgba(90, 122, 226, 0.5)\",diffusion:.5,focus:.5,inset:false,spread:0,type:\"box\",x:4,y:-2},{blur:12,color:\"rgba(207, 157, 78, 0.5)\",diffusion:.5,focus:.5,inset:false,spread:0,type:\"box\",x:-4,y:-2}],title:\"Glow\",type:ControlType.BoxShadow}});addFonts(FramermVh7Uov_5,[{explicitInter:true,fonts:[{cssFamilyName:\"Inter\",source:\"framer\",style:\"normal\",uiFamilyName:\"Inter\",unicodeRange:\"U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F\",url:\"https://framerusercontent.com/assets/hyOgCu0Xnghbimh0pE8QTvtt2AU.woff2\",weight:\"600\"},{cssFamilyName:\"Inter\",source:\"framer\",style:\"normal\",uiFamilyName:\"Inter\",unicodeRange:\"U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116\",url:\"https://framerusercontent.com/assets/NeGmSOXrPBfEFIy5YZeHq17LEDA.woff2\",weight:\"600\"},{cssFamilyName:\"Inter\",source:\"framer\",style:\"normal\",uiFamilyName:\"Inter\",unicodeRange:\"U+1F00-1FFF\",url:\"https://framerusercontent.com/assets/oYaAX5himiTPYuN8vLWnqBbfD2s.woff2\",weight:\"600\"},{cssFamilyName:\"Inter\",source:\"framer\",style:\"normal\",uiFamilyName:\"Inter\",unicodeRange:\"U+0370-03FF\",url:\"https://framerusercontent.com/assets/lEJLP4R0yuCaMCjSXYHtJw72M.woff2\",weight:\"600\"},{cssFamilyName:\"Inter\",source:\"framer\",style:\"normal\",uiFamilyName:\"Inter\",unicodeRange:\"U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF\",url:\"https://framerusercontent.com/assets/cRJyLNuTJR5jbyKzGi33wU9cqIQ.woff2\",weight:\"600\"},{cssFamilyName:\"Inter\",source:\"framer\",style:\"normal\",uiFamilyName:\"Inter\",unicodeRange:\"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2070, U+2074-207E, U+2080-208E, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD\",url:\"https://framerusercontent.com/assets/yDtI2UI8XcEg1W2je9XPN3Noo.woff2\",weight:\"600\"},{cssFamilyName:\"Inter\",source:\"framer\",style:\"normal\",uiFamilyName:\"Inter\",unicodeRange:\"U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB\",url:\"https://framerusercontent.com/assets/A0Wcc7NgXMjUuFdquHDrIZpzZw0.woff2\",weight:\"600\"}]}],{supportsExplicitInterCodegen:true});\nexport const __FramerMetadata__ = {\"exports\":{\"Props\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"FramermVh7Uov_5\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisplayContentsDiv\":\"false\",\"framerAutoSizeImages\":\"true\",\"framerColorSyntax\":\"true\",\"framerIntrinsicWidth\":\"240\",\"framerVariables\":\"{\\\"P1VIuwDLc\\\":\\\"cTAText\\\",\\\"p0OGc94e1\\\":\\\"textColor\\\",\\\"PiChBsopY\\\":\\\"buttonColor\\\",\\\"UvONMizB4\\\":\\\"hoverColor\\\",\\\"G1s9OoXro\\\":\\\"glow\\\"}\",\"framerCanvasComponentVariantDetails\":\"{\\\"propertyName\\\":\\\"variant\\\",\\\"data\\\":{\\\"default\\\":{\\\"layout\\\":[\\\"fixed\\\",\\\"fixed\\\"]},\\\"vVHTd46UY\\\":{\\\"layout\\\":[\\\"fixed\\\",\\\"fixed\\\"]},\\\"dGrJ75R_T\\\":{\\\"layout\\\":[\\\"fixed\\\",\\\"fixed\\\"]},\\\"Mfebqk9wq\\\":{\\\"layout\\\":[\\\"fixed\\\",\\\"fixed\\\"]},\\\"yP3TbzWZL\\\":{\\\"layout\\\":[\\\"fixed\\\",\\\"fixed\\\"]},\\\"rbmgxMjEm\\\":{\\\"layout\\\":[\\\"fixed\\\",\\\"fixed\\\"]},\\\"y9vztox0c\\\":{\\\"layout\\\":[\\\"fixed\\\",\\\"fixed\\\"]}}}\",\"framerComponentViewportWidth\":\"true\",\"framerIntrinsicHeight\":\"40\",\"framerImmutableVariables\":\"true\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./mVh7Uov_5.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";// React controls input values internally — a plain `input.value =` assignment is\n// overwritten on the next render. Using the native HTMLInputElement setter bypasses\n// React's value tracking so the subsequent synthetic events are treated as real user\n// input, causing React to update its internal state and keep the value.\nfunction setField(form,name,value){if(!name||!value)return;// Traverse by property rather than CSS selector to avoid SyntaxError on\n// field names that contain quotes, brackets, or other selector metacharacters.\nconst input=Array.from(form.querySelectorAll(\"input\")).find(candidate=>candidate.name===name);if(!input){console.error(`[FormPrefill] input[name=\"${name}\"] not found in form`);return;}console.log(`[FormPrefill] filling input[name=\"${name}\"]`);const nativeSetter=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,\"value\")?.set;if(nativeSetter){nativeSetter.call(input,value);}else{input.value=value;}input.dispatchEvent(new Event(\"input\",{bubbles:true}));input.dispatchEvent(new Event(\"change\",{bubbles:true}));}export default function FormPrefill({apiBaseUrl=\"https://www.podium.com\",firstNameField=\"FirstName\",lastNameField=\"LastName\",emailField=\"Email\",phoneField=\"Phone\",companyField=\"Company\"}){const anchorRef=useRef(null);const prefillDataRef=useRef(null);useEffect(()=>{if(typeof window===\"undefined\")return;const cid=new URLSearchParams(window.location.search).get(\"cid\");if(!cid){console.log(\"[FormPrefill] no cid in URL, skipping prefill\");return;}const form=anchorRef.current?.closest(\"form\");if(!form){console.error(\"[FormPrefill] parent <form> not found — place FormPrefill inside a Framer Form component\");return;}const allInputs=Array.from(form.querySelectorAll(\"input\"));console.log(\"[FormPrefill] found inputs in form:\",allInputs.map(i=>`input[name=\"${i.name}\"]`));const fillAll=data=>{setField(form,firstNameField,data.firstName);setField(form,lastNameField,data.lastName);setField(form,emailField,data.email);setField(form,phoneField,data.phone);setField(form,companyField,data.companyName);};// Re-fill on submit (capture phase) to guard against React re-renders\n// clearing prefilled values before the form data is collected.\nconst handleSubmit=()=>{try{if(prefillDataRef.current)fillAll(prefillDataRef.current);}catch{// Never block form submission\n}};form.addEventListener(\"submit\",handleSubmit,true);const controller=new AbortController;let timerId;fetch(`${apiBaseUrl}/api/contact-prefill?cid=${encodeURIComponent(cid)}`,{signal:controller.signal}).then(res=>{if(!res.ok){console.error(`[FormPrefill] API returned ${res.status}`);return null;}return res.json();}).then(data=>{if(!data)return;console.log(\"[FormPrefill] prefill data received\");prefillDataRef.current=data;timerId=setTimeout(()=>fillAll(data),0);}).catch(err=>{if(err?.name!==\"AbortError\"){console.error(\"[FormPrefill] fetch failed:\",err);}});return()=>{controller.abort();clearTimeout(timerId);form.removeEventListener(\"submit\",handleSubmit,true);};},[apiBaseUrl,firstNameField,lastNameField,emailField,phoneField,companyField]);return /*#__PURE__*/_jsx(\"span\",{ref:anchorRef,style:{display:\"none\"}});}FormPrefill.displayName=\"FormPrefill\";addPropertyControls(FormPrefill,{apiBaseUrl:{type:ControlType.String,title:\"API Base URL\",defaultValue:\"https://www.podium.com\",description:\"Base URL of the vanbrunt API\"},firstNameField:{type:ControlType.String,title:\"First Name Field\",defaultValue:\"FirstName\",description:\"input[name] to fill with first name\"},lastNameField:{type:ControlType.String,title:\"Last Name Field\",defaultValue:\"LastName\",description:\"input[name] to fill with last name\"},emailField:{type:ControlType.String,title:\"Email Field\",defaultValue:\"Email\",description:\"input[name] to fill with email\"},phoneField:{type:ControlType.String,title:\"Phone Field\",defaultValue:\"Phone\",description:\"input[name] to fill with phone\"},companyField:{type:ControlType.String,title:\"Company Field\",defaultValue:\"Company\",description:\"input[name] to fill with company name\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FormPrefill\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FormPrefill.map"],"mappings":"A,sWACgsB,SAASmC,EAAqB,EAAU,GAAGC,EAAS,CAAC,IAAMC,EAAc,CAAC,EAAuF,OAArFD,GAAU,QAAQ,GAASE,GAAS,OAAO,OAAOD,EAAcE,EAAUD,EAAQ,CAAC,EAASD,CAAc,C,gFAApjB,EAAgBb,EAAOJ,EAAO,GAAG,EAAQ,EAAgB,CAAC,UAAU,CAAC,MAAM,GAAK,QAAQ,EAAI,CAAC,EAAQ,EAAW,CAAC,YAAY,YAAY,YAAY,YAAY,WAAW,EAAQ,EAAkB,eAAqB,EAAkB,CAAC,UAAU,mBAAmB,UAAU,mBAAmB,UAAU,kBAAkB,UAAU,mBAAmB,UAAU,iBAAiB,EAAiU,EAAY,CAAC,MAAM,EAAE,SAAS,GAAG,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,KAAK,OAAO,EAAQ,EAAY,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,OAAO,EAAQ,EAAU,CAAC,QAAQ,EAAE,OAAO,IAAI,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,EAAQ,GAAoB,EAAE,IAAI,oBAAo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