{"version":3,"file":"DefaultForms.creglC-m.mjs","names":[],"sources":["https:/framerusercontent.com/modules/7jPJEbLt3q3WbAWxkg3r/8bWoswS0HNsKlyWUOnqo/DefaultForms.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef}from\"react\";/**\n * Default OS integration for corridoradvisors.com.\n *\n * Default catalogs a form by the HTML id of its <form> element, so every lead\n * form gets a stable id through one of the overrides below. Apply them to the\n * form layer itself (the Frame whose HTML tag is \"form\").\n *\n *   withHeroFormId          -> id=\"hero-email\"          single work-email captures\n *   withAdvisorFormId       -> id=\"talk-to-an-advisor\"  the /form page\n *   withMarketSurveyFormId  -> id=\"market-survey\"       state-page survey form\n *   withQuotesFormId        -> id=\"email-quotes\"        /form/quotes (email-only path)\n *\n * withEmailMe goes on the \"Just email me\" text on /form: it flips the hidden\n * preferred_path field to \"email\" and submits the same form, so Default gets\n * one submission with preferred_path=email and the workflow can skip the\n * scheduler.\n */const HERO_FORM_ID=\"hero-email\";const ADVISOR_FORM_ID=\"talk-to-an-advisor\";const SURVEY_FORM_ID=\"market-survey\";const QUOTES_FORM_ID=\"email-quotes\";function withFormId(Component,id){return /*#__PURE__*/forwardRef((props,ref)=>/*#__PURE__*/_jsx(Component,{ref:ref,...props,id:id}));}export function withHeroFormId(Component){return withFormId(Component,HERO_FORM_ID);}export function withAdvisorFormId(Component){return withFormId(Component,ADVISOR_FORM_ID);}export function withMarketSurveyFormId(Component){return withFormId(Component,SURVEY_FORM_ID);}export function withQuotesFormId(Component){return withFormId(Component,QUOTES_FORM_ID);}export function withEmailMe(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const handleClick=event=>{if(typeof props.onClick===\"function\")props.onClick(event);if(typeof document===\"undefined\")return;const form=document.getElementById(ADVISOR_FORM_ID);if(!form)return;if(event&&typeof event.preventDefault===\"function\"){event.preventDefault();}const path=form.querySelector('input[name=\"preferred_path\"]');const valid=form.checkValidity();if(path)path.value=\"email\";if(typeof form.requestSubmit===\"function\"){form.requestSubmit();}else{form.dispatchEvent(new Event(\"submit\",{bubbles:true,cancelable:true}));}// Validation failed: nothing was submitted, restore the default path.\nif(!valid&&path)path.value=\"book\";};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:handleClick,style:{...props.style,cursor:\"pointer\"}});});}/**\n * withBackHome goes on the \"Back\" button of /form: browser back when there is\n * history, otherwise the home page.\n */export function withBackHome(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const handleClick=event=>{if(typeof props.onClick===\"function\")props.onClick(event);if(typeof window===\"undefined\")return;if(event&&typeof event.preventDefault===\"function\"){event.preventDefault();}if(window.history.length>1)window.history.back();else window.location.assign(\"/\");};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:handleClick,style:{...props.style,cursor:\"pointer\"}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withQuotesFormId\":{\"type\":\"reactHoc\",\"name\":\"withQuotesFormId\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withEmailMe\":{\"type\":\"reactHoc\",\"name\":\"withEmailMe\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withBackHome\":{\"type\":\"reactHoc\",\"name\":\"withBackHome\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAdvisorFormId\":{\"type\":\"reactHoc\",\"name\":\"withAdvisorFormId\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withMarketSurveyFormId\":{\"type\":\"reactHoc\",\"name\":\"withMarketSurveyFormId\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHeroFormId\":{\"type\":\"reactHoc\",\"name\":\"withHeroFormId\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DefaultForms.map"],"mappings":"gIAgBuJ,SAAS,EAAW,EAAU,EAAG,CAAC,OAAoB,GAAY,EAAM,IAAmB,EAAK,EAAU,CAAK,MAAI,GAAG,EAAS,IAAE,CAAC,CAAC,CAAE,CAAC,SAAgB,EAAe,EAAU,CAAC,OAAO,EAAW,EAAU,CAAY,CAAE,CAAC,SAAgB,EAAkB,EAAU,CAAC,OAAO,EAAW,EAAU,CAAe,CAAE,CAAC,SAAgB,EAAuB,EAAU,CAAC,OAAO,EAAW,EAAU,CAAc,CAAE,CAAC,SAAgB,EAAiB,EAAU,CAAC,OAAO,EAAW,EAAU,CAAc,CAAE,CAIjoB,SAAgB,EAAa,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,IAAM,EAAY,GAAO,CAAI,OAAO,EAAM,SAAU,YAAW,EAAM,QAAQ,CAAK,EAAY,IAAS,SAAsB,GAAO,OAAO,EAAM,gBAAiB,YAAY,EAAM,eAAe,EAAM,EAAO,QAAQ,OAAO,EAAE,EAAO,QAAQ,KAAK,EAAO,EAAO,SAAS,OAAO,GAAG,EAAE,EAAE,OAAoB,EAAK,EAAU,CAAK,MAAI,GAAG,EAAM,QAAQ,EAAY,MAAM,CAAC,GAAG,EAAM,MAAM,OAAO,SAAS,CAAC,CAAC,CAAE,CAAC,CAAE,6BApB9b,IAA8B,EAgB/D,EAAa,aAAmB,EAAgB,qBAA2B,EAAe,gBAAsB,EAAe"}