{"version":3,"file":"ScrollToForm.2gu6zGDF.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/vJyCBI68r4vdcikx0Wrd/6LNYBQPA1iSNGNlLVHzY/ScrollToForm.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";// Plan buttons: open the current page with ?plan=<value>#claim-form.\n// The page's \"Plan\" variable reads the query parameter on load and preselects\n// the matching option in the claim form. (Framer won't accept query strings in\n// internal links, and Set Variable actions were unreliable, so this is done here.)\nfunction goToPlan(plan){if(typeof window===\"undefined\")return;// Keep any existing query (Framer's preview relies on it) and set the plan.\nconst url=new URL(window.location.href);url.searchParams.set(\"plan\",plan);url.hash=\"claim-form\";window.location.assign(url.toString());}function wrap(Component,plan){return props=>/*#__PURE__*/_jsx(Component,{...props,style:{...props.style,cursor:\"pointer\"},onClick:e=>{e?.preventDefault?.();goToPlan(plan);}});}export function withPlanFree(Component){return wrap(Component,\"free\");}export function withPlanMonthly(Component){return wrap(Component,\"monthly\");}export function withPlanOwn(Component){return wrap(Component,\"own\");}export function withPlanCustom(Component){return wrap(Component,\"custom\");}// Site-wide \"free demo\" CTAs (header, hero, footer): always go to the Plans\n// page form with Free demo preselected, whichever page they're clicked on.\n// The button's own link must point at /plans. We take the href Framer rendered\n// for it (correct on the live site and in Framer's preview, which serves pages\n// under its own prefix) and add the plan and the form anchor.\nexport function withFreeDemo(Component){return props=>/*#__PURE__*/_jsx(Component,{...props,style:{...props.style,cursor:\"pointer\"},onClick:e=>{if(typeof window===\"undefined\")return;const el=e?.currentTarget??e?.target;const anchor=el?.closest?.(\"a[href]\")??el?.querySelector?.(\"a[href]\");const url=new URL(anchor?.href??\"/plans\",window.location.href);url.searchParams.set(\"plan\",\"free\");url.hash=\"claim-form\";e?.preventDefault?.();window.location.assign(url.toString());}});}// Claim Form plan pills. Each radio is bound to its own boolean, and a browser\n// never fires \"change\" on the radio that gets unchecked, so anything bound to\n// those booleans goes stale when the visitor switches plan. These overrides\n// read the radios' real checked state instead.\nfunction usePlanChecked(value){const[checked,setChecked]=useState(false);useEffect(()=>{if(typeof document===\"undefined\")return;const sync=()=>{const input=document.querySelector(`input[name=\"Plan\"][value=\"${value}\"]`);setChecked(!!input?.checked);};sync();// The preselected plan is applied after mount, without a change event.\nconst raf=requestAnimationFrame(sync);const timer=setTimeout(sync,400);document.addEventListener(\"change\",sync,true);document.addEventListener(\"reset\",sync,true);return()=>{cancelAnimationFrame(raf);clearTimeout(timer);document.removeEventListener(\"change\",sync,true);document.removeEventListener(\"reset\",sync,true);};},[value]);return checked;}// Gold \"Selected\" outline inside each pill.\nfunction selectedFor(Component,value){return props=>{const checked=usePlanChecked(value);return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,opacity:checked?1:0,transition:\"opacity 0.2s\"}});};}export function withSelectedFree(Component){return selectedFor(Component,\"Free demo\");}export function withSelectedMonthly(Component){return selectedFor(Component,\"Pay monthly\");}export function withSelectedOwn(Component){return selectedFor(Component,\"Own it outright\");}export function withSelectedCustom(Component){return selectedFor(Component,\"Custom request\");}// The two custom-package fields: shown only while Custom request is checked.\nexport function withCustomOnly(Component){return props=>{const checked=usePlanChecked(\"Custom request\");return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,display:checked?undefined:\"none\"}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withSelectedFree\":{\"type\":\"reactHoc\",\"name\":\"withSelectedFree\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPlanCustom\":{\"type\":\"reactHoc\",\"name\":\"withPlanCustom\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withFreeDemo\":{\"type\":\"reactHoc\",\"name\":\"withFreeDemo\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSelectedMonthly\":{\"type\":\"reactHoc\",\"name\":\"withSelectedMonthly\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSelectedCustom\":{\"type\":\"reactHoc\",\"name\":\"withSelectedCustom\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPlanOwn\":{\"type\":\"reactHoc\",\"name\":\"withPlanOwn\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPlanFree\":{\"type\":\"reactHoc\",\"name\":\"withPlanFree\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPlanMonthly\":{\"type\":\"reactHoc\",\"name\":\"withPlanMonthly\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSelectedOwn\":{\"type\":\"reactHoc\",\"name\":\"withSelectedOwn\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCustomOnly\":{\"type\":\"reactHoc\",\"name\":\"withCustomOnly\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollToForm.map"],"mappings":"uIAIA,SAAS,EAAS,EAAK,CAAC,GAAU,IAAS,OAAY,OACvD,IAAM,EAAI,IAAI,IAAI,EAAO,SAAS,IAAI,EAAE,EAAI,aAAa,IAAI,OAAO,CAAI,EAAE,EAAI,KAAK,aAAa,EAAO,SAAS,OAAO,EAAI,SAAS,CAAC,CAAE,CAAC,SAAS,EAAK,EAAU,EAAK,CAAC,MAAO,IAAoB,EAAK,EAAU,CAAC,GAAG,EAAM,MAAM,CAAC,GAAG,EAAM,MAAM,OAAO,SAAS,EAAE,QAAQ,GAAG,CAAC,GAAG,iBAAiB,EAAE,EAAS,CAAI,CAAE,CAAC,CAAC,CAAE,CAAC,SAAgB,EAAa,EAAU,CAAC,OAAO,EAAK,EAAU,MAAM,CAAE,CAAC,SAAgB,EAAgB,EAAU,CAAC,OAAO,EAAK,EAAU,SAAS,CAAE,CAAC,SAAgB,EAAY,EAAU,CAAC,OAAO,EAAK,EAAU,KAAK,CAAE,CAAC,SAAgB,EAAe,EAAU,CAAC,OAAO,EAAK,EAAU,QAAQ,CAAE,CAK3lB,SAAgB,EAAa,EAAU,CAAC,MAAO,IAAoB,EAAK,EAAU,CAAC,GAAG,EAAM,MAAM,CA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