{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/kGJZffqItLYUiFucTtS9/JIQ7dUhiroT8cSoOPm2O/Calculator.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const IFRAME_ORIGIN=\"https://home-affordability.lovable.app\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/components/auto-sizing\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight auto\n */export default function Calculator({salary1Amount,salary1Frequency,salary1HoursPerWeek}){const iframeRef=useRef(null);const currentHeight=useRef(400);const[height,setHeight]=useState(400);const[isLoading,setIsLoading]=useState(true);const[isIframeReady,setIsIframeReady]=useState(false);useEffect(()=>{const handleMessage=event=>{// Only accept messages from our iframe source\nif(event.origin!==IFRAME_ORIGIN)return;switch(event.data?.type){case\"resize\":{const newHeight=Math.max(event.data.height,400);setIsLoading(false);if(newHeight!==currentHeight.current){currentHeight.current=newHeight;setHeight(newHeight);}else{iframeRef.current.contentWindow.postMessage({type:\"resize-correct\"},\"*\");}setIsIframeReady(true);break;}case\"submit-form\":{if(iframeRef.current){const iframeTop=iframeRef.current.getBoundingClientRect().top+window.scrollY;const extraSpace=3*16;window.scrollTo({top:iframeTop-extraSpace,behavior:\"smooth\"});}break;}}};window.addEventListener(\"message\",handleMessage);return()=>window.removeEventListener(\"message\",handleMessage);},[]);// Post salary1 to the iframe\nuseEffect(()=>{if(iframeRef.current&&isIframeReady){iframeRef.current.contentWindow.postMessage({type:\"set-salary1\",salary1:{amount:salary1Amount,frequency:salary1Frequency,hoursPerWeek:salary1HoursPerWeek}},\"*\");}},[salary1Amount,salary1Frequency,salary1HoursPerWeek,isIframeReady]);return /*#__PURE__*/_jsxs(_Fragment,{children:[isLoading&&/*#__PURE__*/_jsxs(\"div\",{className:\"skeleton-container\",style:{width:\"calc(100% + 3rem)\",margin:\"-1.5rem\",padding:\"1.5rem\",display:\"flex\",flexDirection:\"column\",gap:\"2rem\"},children:[/*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsx(\"div\",{className:\"skeleton-text\",style:{width:\"30%\",height:\"24px\",marginBottom:\"1rem\"}}),/*#__PURE__*/_jsx(\"div\",{className:\"credit-score-grid\",children:[...Array(6)].map((_,i)=>/*#__PURE__*/_jsx(\"div\",{className:\"skeleton-card credit-score-card\"},i))})]}),/*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsx(\"div\",{className:\"skeleton-text\",style:{width:\"40%\",height:\"24px\",marginBottom:\"1rem\"}}),/*#__PURE__*/_jsxs(\"div\",{className:\"form-row\",children:[/*#__PURE__*/_jsx(\"div\",{className:\"skeleton-card\",style:{height:\"80px\",borderRadius:\"8px\"}}),/*#__PURE__*/_jsx(\"div\",{className:\"skeleton-card add-source-button\",style:{height:\"48px\",borderRadius:\"8px\",border:\"2px dashed var(--skeleton-base-color, #e2e5e7)\"}})]})]}),/*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsx(\"div\",{className:\"skeleton-text\",style:{width:\"35%\",height:\"24px\",marginBottom:\"1rem\"}}),/*#__PURE__*/_jsxs(\"div\",{className:\"form-row\",children:[/*#__PURE__*/_jsx(\"div\",{className:\"skeleton-card\",style:{height:\"80px\",borderRadius:\"8px\"}}),/*#__PURE__*/_jsx(\"div\",{className:\"skeleton-card add-source-button\",style:{height:\"48px\",borderRadius:\"8px\",border:\"2px dashed var(--skeleton-base-color, #e2e5e7)\"}})]})]}),/*#__PURE__*/_jsx(\"div\",{className:\"skeleton-card\",style:{height:\"50px\",borderRadius:\"8px\",marginTop:\"auto\"}})]}),/*#__PURE__*/_jsx(\"iframe\",{ref:iframeRef,src:IFRAME_ORIGIN,style:{width:\"calc(100% + 3rem)\",margin:\"-1.5rem\",height:`${height}px`,border:\"none\",display:isLoading?\"none\":\"block\"}}),/*#__PURE__*/_jsx(\"style\",{children:`\n\t\t\t\t\t@keyframes spin {\n\t\t\t\t\t\t0% { transform: rotate(0deg); }\n\t\t\t\t\t\t100% { transform: rotate(360deg); }\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t@keyframes shimmer {\n\t\t\t\t\t\t0% { background-position: -1000px 0; }\n\t\t\t\t\t\t100% { background-position: 1000px 0; }\n\t\t\t\t\t}\n\n\t\t\t\t\t.skeleton-container {\n\t\t\t\t\t\t    --skeleton-base-color: hsl(220, 10%, 75%, 0.3);\n                            --skeleton-shine-color: hsl(220, 10%, 85%);\n\t\t\t\t\t}\n\t\t\t\t\t.skeleton-text, .skeleton-card {\n\t\t\t\t\t\tbackground: var(--skeleton-base-color);\n\t\t\t\t\t\tbackground-image: linear-gradient(\n\t\t\t\t\t\t\t90deg,\n\t\t\t\t\t\t\tvar(--skeleton-base-color) 0px,\n\t\t\t\t\t\t\tvar(--skeleton-shine-color) 40%,\n\t\t\t\t\t\t\tvar(--skeleton-base-color) 80%\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbackground-size: 1000px 100%;\n\t\t\t\t\t\tanimation: shimmer 2s infinite linear;\n\t\t\t\t\t}\n\n\t\t\t\t\t.credit-score-grid {\n\t\t\t\t\t\tdisplay: grid;\n\t\t\t\t\t\tgap: 0.5rem;\n\t\t\t\t\t\tgrid-template-columns: repeat(6, 1fr);\n\t\t\t\t\t}\n\n\t\t\t\t\t.credit-score-card {\n\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\theight: 78px;\n\t\t\t\t\t\tborder-radius: 12px;\n\t\t\t\t\t}\n\n\t\t\t\t\t.add-source-button {\n\t\t\t\t\t\tbackground: transparent !important;\n\t\t\t\t\t}\n\n\t\t\t\t\t.form-row {\n\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\tgap: 0.75rem;\n\t\t\t\t\t}\n\n\t\t\t\t\t.form-row .skeleton-card {\n\t\t\t\t\t\twidth: calc(50% - 0.375rem);\n\t\t\t\t\t}\n\n\t\t\t\t\t.form-row .add-source-button {\n\t\t\t\t\t\theight: 80px !important;\n\t\t\t\t\t}\n\n\t\t\t\t\t@media (max-width: 624px) {\n\t\t\t\t\t\t.credit-score-grid {\n\t\t\t\t\t\t\tgrid-template-columns: repeat(2, 1fr);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.form-row {\n\t\t\t\t\t\t\tflex-direction: column;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.form-row .skeleton-card {\n\t\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.form-row .add-source-button {\n\t\t\t\t\t\t\theight: 48px !important;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t`})]});}addPropertyControls(Calculator,{salary1Amount:{type:ControlType.Number,defaultValue:1e4,min:0,max:1e6,title:\"Income Source 1\"},salary1Frequency:{type:ControlType.Enum,defaultValue:\"annually\",title:\"Income Source 1 Frequency\",options:[\"annually\",\"monthly\",\"bi-monthly\",\"bi-weekly\",\"weekly\",\"hourly\"]},salary1HoursPerWeek:{type:ControlType.Number,defaultValue:40,title:\"Income Source 1 Hours Per Week\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Calculator\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Calculator.map"],
  "mappings": "4KAAAA,IAAgL,IAAMC,EAAc,yCAMlL,SAARC,EAA4B,CAAC,cAAAC,EAAc,iBAAAC,EAAiB,oBAAAC,CAAmB,EAAE,CAAC,IAAMC,EAAUC,EAAO,IAAI,EAAQC,EAAcD,EAAO,GAAG,EAAO,CAACE,EAAOC,CAAS,EAAEC,EAAS,GAAG,EAAO,CAACC,EAAUC,CAAY,EAAEF,EAAS,EAAI,EAAO,CAACG,EAAcC,CA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K,OAAO,OAAO,QAAQG,EAAU,OAAO,OAAO,CAAC,CAAC,EAAeY,EAAK,QAAQ,CAAC,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAyEnjE,CAAC,CAAC,CAAC,CAAC,CAAE,CAACG,EAAoBzB,EAAW,CAAC,cAAc,CAAC,KAAK0B,EAAY,OAAO,aAAa,IAAI,IAAI,EAAE,IAAI,IAAI,MAAM,iBAAiB,EAAE,iBAAiB,CAAC,KAAKA,EAAY,KAAK,aAAa,WAAW,MAAM,4BAA4B,QAAQ,CAAC,WAAW,UAAU,aAAa,YAAY,SAAS,QAAQ,CAAC,EAAE,oBAAoB,CAAC,KAAKA,EAAY,OAAO,aAAa,GAAG,MAAM,gCAAgC,CAAC,CAAC",
  "names": ["init_ssg_sandbox_shims", "IFRAME_ORIGIN", "Calculator", "salary1Amount", "salary1Frequency", "salary1HoursPerWeek", "iframeRef", "pe", "currentHeight", "height", "setHeight", "ye", "isLoading", "setIsLoading", "isIframeReady", "setIsIframeReady", "ue", "handleMessage", "event", "newHeight", "iframeTop", "extraSpace", "u", "l", "p", "_", "i", "addPropertyControls", "ControlType"]
}
