1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="af8d8858-ab73-4ffc-8086-c1a7ec6e92c2",e._sentryDebugIdIdentifier="sentry-dbid-af8d8858-ab73-4ffc-8086-c1a7ec6e92c2")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[10148],{13601:()=>{},34541:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var a=n(95155),i=n(12115),r=n(28122),l=n(54919);let o={mortgage:"Mortgage Calculator",dscr:"DSCR Calculator","rent-vs-buy":"Rent vs Buy Calculator",buydown:"Buydown Calculator","net-proceeds":"Seller Net Sheet",refinance:"Refinance Calculator","fha-streamline":"FHA Streamline Calculator","va-irrrl":"VA IRRRL Recoupment Calculator","va-bonus-entitlement":"VA Bonus Entitlement Calculator"},s=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function c(e){let{calculatorType:t,calculatorValues:n,presetId:c,customColors:d,className:p}=e,[x,h]=(0,i.useState)(!1),[g,u]=(0,i.useState)(""),[f,m]=(0,i.useState)(!1),[y,b]=(0,i.useState)(null),[j,v]=(0,i.useState)(null),S=o[t]||"Calculator",w=(null==d?void 0:d.primary)||"var(--calc-primary, #6B46C1)",B=()=>{h(!1),b(null),v(null),m(!1)},A=async e=>{e.preventDefault();let a=g.trim();if(!s.test(a))return void b("Please enter a valid email address");m(!0),b(null);try{let e=await fetch("/api/calculators/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({calculatorType:t,calculatorValues:n,recipientEmail:a,presetId:c,customColors:d})}),i=await e.json();if(!e.ok)throw Error(i.error||"Failed to send calculator");v(i.link),u("")}catch(e){b((0,l.dh)(e,"We couldnât send the calculator. Please try again."))}finally{m(!1)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("button",{type:"button",className:"calc-send-trigger ".concat(p||"").trim(),onClick:()=>h(!0),style:{background:w},children:[(0,a.jsx)(r.kGk,{size:16}),(0,a.jsx)("span",{children:"Send to Me"})]}),x&&(0,a.jsx)("div",{className:"calc-send-modal-backdrop",onClick:B,children:(0,a.jsxs)("div",{className:"calc-send-modal",role:"dialog","aria-modal":"true","aria-label":"Send this ".concat(S),onClick:e=>e.stopPropagation(),children:[(0,a.jsx)("button",{className:"calc-send-modal-close",onClick:B,children:(0,a.jsx)(r.yGN,{size:18})}),(0,a.jsxs)("div",{className:"calc-send-modal-header",children:[(0,a.jsx)("div",{className:"calc-send-icon",style:{background:"".concat(w,"15"),color:w},children:(0,a.jsx)(r.pHD,{size:20})}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("h3",{children:["Send this ",S.toLowerCase()]}),(0,a.jsx)("p",{children:"Enter your email and we'll send a link with every value saved."})]})]}),(0,a.jsxs)("form",{className:"calc-send-form",onSubmit:A,children:[(0,a.jsx)("label",{htmlFor:"calc-send-email",children:"Email address"}),(0,a.jsx)("input",{id:"calc-send-email",type:"email",placeholder:"[email protected]",value:g,onChange:e=>u(e.target.value),required:!0}),y&&(0,a.jsx)("p",{className:"calc-send-error",children:y}),j?(0,a.jsxs)("div",{className:"calc-send-success",children:[(0,a.jsx)(r.A3x,{size:18}),(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:"Email sent!"}),(0,a.jsxs)("p",{children:["We saved your calculator."," ",(0,a.jsx)("a",{href:j,target:"_blank",rel:"noreferrer",children:"Open it now"})]})]})]}):(0,a.jsx)("button",{type:"submit",disabled:f,style:{background:w},children:f?"Sending...":"Send Calculator"})]})]})})]})}},38126:(e,t,n)=>{"use strict";n.d(t,{X:()=>c,l:()=>d});var a=n(95155),i=n(59335),r=n(58579),l=n(24024),o=n(86555),s=n(77535);let c=(0,i.createToaster)({placement:"bottom-end",pauseOnPageIdle:!0}),d=()=>(0,a.jsx)(r.Portal,{children:(0,a.jsx)(l.Toaster,{toaster:c,insetInline:{mdDown:"4"},children:e=>(0,a.jsxs)(l.ToastRoot,{width:{md:"sm"},children:["loading"===e.type?(0,a.jsx)(o.Spinner,{size:"sm",color:"blue.solid"}):(0,a.jsx)(l.ToastIndicator,{}),(0,a.jsxs)(s.Stack,{gap:"1",flex:"1",maxWidth:"100%",children:[e.title&&(0,a.jsx)(l.ToastTitle,{children:e.title}),e.description&&(0,a.jsx)(l.ToastDescription,{children:e.description})]}),e.action&&(0,a.jsx)(l.ToastActionTrigger,{children:e.action.label}),e.closable&&(0,a.jsx)(l.ToastCloseTrigger,{})]})})})}
1,74923:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>g});var a=n(95155),i=n(88661),r=n.n(i);n(13601);var l=n(12115),o=n(70898),s=n(34541),c=n(5632);let d=e=>parseFloat(e.replace(/,/g,""))||0,p=e=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:0}).format(e),x=e=>e<1?80:e>36?0:Math.max(10,82-2*e),h=(e,t,n)=>n===e?String(t):t.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:0}),g=e=>{let{initialValues:t,isPublicView:n,brandColors:i,presetId:g,enableSendToMe:u=!1}=e,[f,m]=(0,l.useState)(1),[y,b]=(0,l.useState)("right"),j=(0,l.useRef)(null),v=(0,l.useRef)(null),[S,w]=(0,l.useState)({currentPrincipalBalance:0,interestDue:0,mipDue:0,negativeEscrowBalance:0,originalPrincipalBalance:0,originalLoanAmount:0,loanAgeMonths:0,originalUfmipPaid:0,...t}),[B,A]=(0,l.useState)({}),[C,k]=(0,l.useState)(null),z=e=>{w(t=>{var n,a,i;return{...t,currentPrincipalBalance:null!=(n=e.balance)?n:t.currentPrincipalBalance,originalLoanAmount:null!=(a=e.originalLoanAmount)?a:t.originalLoanAmount,originalPrincipalBalance:null!=(i=e.originalLoanAmount)?i:t.originalPrincipalBalance,loanAgeMonths:null!=e.originalTermMonths&&null!=e.remainingTermMonths?e.originalTermMonths-e.remainingTermMonths:t.loanAgeMonths}})},W=f/5*100;(0,l.useEffect)(()=>{5===f&&j.current&&v.current&&setTimeout(()=>{let e=j.current,t=v.current;if(e&&t){let n=e.offsetTop,a=e.offsetHeight,i=t.clientHeight;t.scrollTo({top:n-i/2+a/2,behavior:"smooth"})}},400)},[f]);let M=(e,t)=>{w(n=>({...n,[e]:t})),B[e]&&A(t=>({...t,[e]:""}))},P=()=>{(()=>{let e;switch(f){case 1:e=S.currentPrincipalBalance<=0?{isValid:!1,error:"Current principal balance must be greater than 0"}:{isValid:!0};break;case 2:e=S.interestDue<0?{isValid:!1,error:"Interest due cannot be negative"}:S.mipDue<0?{isValid:!1,error:"MIP due cannot be negative"}:S.negativeEscrowBalance<0?{isValid:!1,error:"Negative escrow balance cannot be negative"}:{isValid:!0};break;case 3:e=S.originalPrincipalBalance<=0?{isValid:!1,error:"Original principal balance must be greater than 0"}:S.originalLoanAmount<=0?{isValid:!1,error:"Original loan amount must be greater than 0"}:{isValid:!0};break;case 4:e=S.loanAgeMonths<6?{isValid:!1,error:"FHA Streamline typically requires at least 6 months of payments"}:S.loanAgeMonths>360?{isValid:!1,error:"Loan age seems unreasonably high"}:{isValid:!0};break;default:return!0}return!e.isValid&&e.error&&A({general:e.error}),e.isValid})()&&(A({}),b("right"),m(f+1))},D=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("Enter"===e.key&&!e.shiftKey){if(e.preventDefault(),t&&f<5)P();else if(!t){let t=e.currentTarget,n=Array.from(document.querySelectorAll('input[type="text"], input[type="number"]')),a=n.indexOf(t);if(-1!==a&&a<n.length-1){let e=n[a+1];e&&e.focus()}}}};return(0,a.jsxs)("div",{className:"jsx-4d59e7b1bacf96c9 calculator-container",children:[(0,a.jsx)("div",{style:{background:"var(--calc-bg-card)",borderRadius:"24px",padding:"32px",marginBottom:"32px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)"},className:"jsx-4d59e7b1bacf96c9",children:(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"16px",justifyContent:"center"},className:"jsx-4d59e7b1bacf96c9",children:[(0,a.jsx)("div",{style:{width:"64px",height:"64px",background:"#f3e8ff",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"},className:"jsx-4d59e7b1bacf96c9",children:(0,a.jsx)(o.rQ8,{size:32,color:"#7c3aed"})}),(0,a.jsxs)("div",{className:"jsx-4d59e7b1bacf96c9",children:[(0,a.jsx)("h1",{style:{margin:0,fontSize:"32px",fontWeight:"700",color:"var(--calc-text-primary)"},className:"jsx-4d59e7b1bacf96c9",children:"FHA Streamline Calculator"}),(0,a.jsx)("p",{style:{margin:"8px 0 0 0",fontSize:"16px",color:"var(--calc-text-muted)"},className:"jsx-4d59e7b1bacf96c9",children:"Calculate your new FHA Streamline Refinance loan amount"})]})]})}),u&&(0,a.jsxs)("div",{className:"jsx-4d59e7b1bacf96c9 calc-send-banner",children:[(0,a.jsxs)("div",{className:"jsx-4d59e7b1bacf96c9",children:[(0,a.jsx)("h4",{className:"jsx-4d59e7b1bacf96c9",children:"Email this FHA streamline estimate"}),(0,a.jsx)("p",{className:"jsx-4d59e7b1bacf96c9",children:"We will send a link that keeps every FHA entry for easy follow-up."})]}
1),(0,a.jsx)(s.A,{calculatorType:"fha-streamline",calculatorValues:S,presetId:g,customColors:i||void 0})]}),(0,a.jsxs)("div",{style:{maxWidth:"700px",margin:"0 auto 48px"},className:"jsx-4d59e7b1bacf96c9",children:[(0,a.jsx)("div",{style:{textAlign:"center",marginBottom:"12px"},className:"jsx-4d59e7b1bacf96c9",children:(0,a.jsxs)("span",{style:{fontSize:"14px",fontWeight:"600",color:"#7c3aed"},className:"jsx-4d59e7b1bacf96c9",children:["Step ",f," of ",5]})}),(0,a.jsx)("div",{style:{width:"100%",height:"8px",backgroundColor:"#e9d5ff",borderRadius:"999px",overflow:"hidden"},className:"jsx-4d59e7b1bacf96c9",children:(0,a.jsx)("div",{style:{width:"".concat(W,"%"),height:"100%",background:"linear-gradient(to right, #7c3aed, #a855f7)",borderRadius:"999px",transition:"width 0.3s ease"},className:"jsx-4d59e7b1bacf96c9"})})]}),(0,a.jsx)("div",{style:{minHeight:"400px",position:"relative"},className:"jsx-4d59e7b1bacf96c9",children:(()=>{let e={backgroundColor:"var(--calc-bg-card)",borderRadius:"24px",padding:"48px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.08)",maxWidth:"700px",margin:"0 auto",animation:"slideIn".concat("right"===y?"Right":"Left"," 0.3s ease-out")},t={width:"100%",padding:"24px",fontSize:"24px",border:"2px solid #c084fc",borderRadius:"16px",marginTop:"12px",textAlign:"center",transition:"all 0.2s",backgroundColor:"var(--calc-bg-card)",color:"var(--calc-text-primary)"},n={fontSize:"28px",fontWeight:"700",color:"var(--calc-text-primary)",display:"block",textAlign:"center",marginBottom:"8px"},i={fontSize:"14px",color:"var(--calc-text-muted)",textAlign:"center",marginBottom:"24px"};switch(f){case 1:return(0,a.jsxs)("div",{style:e,children:[(0,a.jsxs)("div",{style:{textAlign:"center",marginBottom:"32px"},children:[(0,a.jsx)("div",{style:{width:"80px",height:"80px",background:"#f3e8ff",borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center",marginBottom:"24px"},children:(0,a.jsx)(o.rQ8,{size:36,color:"#7c3aed"})}),(0,a.jsx)("h2",{style:n,children:"Current Balance"}),(0,a.jsx)("p",{style:i,children:"What's your current unpaid principal balance?"}),(0,a.jsx)("div",{style:{marginTop:"8px"},children:(0,a.jsx)(c.T,{onExtracted:z})})]}),(0,a.jsx)("div",{children:(0,a.jsxs)("div",{style:{position:"relative"},children:[(0,a.jsx)("span",{style:{position:"absolute",left:"24px",top:"50%",transform:"translateY(-50%)",fontSize:"24px",color:"var(--calc-text-faint)"},children:"$"}),(0,a.jsx)("input",{type:"text",style:{...t,paddingLeft:"48px"},value:S.currentPrincipalBalance>0?h("currentPrincipalBalance",S.currentPrincipalBalance,C):"",onChange:e=>M("currentPrincipalBalance",d(e.target.value)),onFocus:()=>k("currentPrincipalBalance"),onBlur:()=>k(null),onKeyDown:e=>D(e,!0),placeholder:"200,000",autoFocus:!0})]})})]});case 2:return(0,a.jsxs)("div",{style:e,children:[(0,a.jsxs)("div",{style:{textAlign:"center",marginBottom:"32px"},children:[(0,a.jsx)("div",{style:{width:"80px",height:"80px",background:"#f3e8ff",borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center",marginBottom:"24px"},children:(0,a.jsx)(o.MxO,{size:36,color:"#7c3aed"})}),(0,a.jsx)("h2",{style:n,children:"Payment Details"}),(0,a.jsx)("p",{style:i,children:"Enter your interest and MIP due for the current month"})]}),(0,a.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,a.jsxs)("label",{style:{fontSize:"16px",fontWeight:"600",color:"var(--calc-text-secondary)",display:"block",marginBottom:"8px"},children:["Interest Due",(0,a.jsx)("span",{style:{fontSize:"13px",fontWeight:"400",color:"var(--calc-text-faint)",marginLeft:"8px"},children:"(from payoff or mortgage statement)"})]}),(0,a.jsxs)("div",{style:{position:"relative"},children:[(0,a.jsx)("span",{style:{position:"absolute",left:"24px",top:"50%",transform:"translateY(-50%)",fontSize:"20px",color:"var(--calc-text-faint)"},children:"$"}),(0,a.jsx)("input",{type:"text",style:{...t,paddingLeft:"48px",fontSize:"20px",padding:"16px"},value:S.interestDue>0?h("interestDue",S.interestDue,C):"",onChange:e=>M("interestDue",d(e.target.value)),onFocus:()=>k("interestDue"),onBlur:()=>k(null),onKeyDown:e=>D(e,!1),placeholder:"1,000",autoFocus:!0})]})]}),(0,a.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,a.jsxs)("label",{style:{fontSize:"16px",fontWeight:"600",color:"var(--calc-text-secondary)",display:"block",marginBottom:"8px"},children:["MIP Due",(0,a.jsx)("span",{style:{fontSize:"13px",fontWeight:"400",color:"var(--calc-text-faint)",marginLeft:"8px"},children:"(from payoff or mortgage statement)"})]}),(0,a.jsxs)("div",{style:{position:"relative"},children:[(0,a.jsx)("span",{style:{position:"absolute",left:"24px",top:"50%",transform:"translateY(-50%)",fontSize:"20px",color:"var(--calc-text-faint)"},children:"$"}),(0,a.jsx)("input",{type:"text",style:{...t,paddingLeft:"48px",fontSize:"20px",padding:"16px"},value:S.mipDue>
10?h("mipDue",S.mipDue,C):"",onChange:e=>M("mipDue",d(e.target.value)),onFocus:()=>k("mipDue"),onBlur:()=>k(null),onKeyDown:e=>D(e,!1),placeholder:"0"})]}),(0,a.jsx)("p",{style:{fontSize:"13px",color:"var(--calc-text-faint)",marginTop:"8px",textAlign:"center"},children:"Enter 0 if you don't have MIP due"})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{style:{fontSize:"16px",fontWeight:"600",color:"var(--calc-text-secondary)",display:"block",marginBottom:"8px"},children:["Negative Escrow Balance",(0,a.jsx)("span",{style:{fontSize:"13px",fontWeight:"400",color:"var(--calc-text-faint)",marginLeft:"8px"},children:"(If applicable)"})]}),(0,a.jsxs)("div",{style:{position:"relative"},children:[(0,a.jsx)("span",{style:{position:"absolute",left:"24px",top:"50%",transform:"translateY(-50%)",fontSize:"20px",color:"var(--calc-text-faint)"},children:"$"}),(0,a.jsx)("input",{type:"text",style:{...t,paddingLeft:"48px",fontSize:"20px",padding:"16px"},value:S.negativeEscrowBalance>0?h("negativeEscrowBalance",S.negativeEscrowBalance,C):"",onChange:e=>M("negativeEscrowBalance",d(e.target.value)),onFocus:()=>k("negativeEscrowBalance"),onBlur:()=>k(null),onKeyDown:e=>D(e,!0),placeholder:"0"})]}),(0,a.jsx)("p",{style:{fontSize:"13px",color:"var(--calc-text-faint)",marginTop:"8px",textAlign:"center"},children:"Amount owed that will be rolled into the new loan"})]})]});case 3:return(0,a.jsxs)("div",{style:e,children:[(0,a.jsxs)("div",{style:{textAlign:"center",marginBottom:"32px"},children:[(0,a.jsx)("div",{style:{width:"80px",height:"80px",background:"#f3e8ff",borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center",marginBottom:"24px"},children:(0,a.jsx)(o.Ani,{size:36,color:"#7c3aed"})}),(0,a.jsx)("h2",{style:n,children:"Original Loan"}),(0,a.jsx)("p",{style:i,children:"Tell us about your original FHA loan"})]}),(0,a.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,a.jsxs)("label",{style:{fontSize:"16px",fontWeight:"600",color:"var(--calc-text-secondary)",display:"block",marginBottom:"8px"},children:["Original Principal Balance",(0,a.jsx)("span",{style:{fontSize:"13px",fontWeight:"400",color:"var(--calc-text-faint)",marginLeft:"8px"},children:"(including original UFMIP)"})]}),(0,a.jsxs)("div",{style:{position:"relative"},children:[(0,a.jsx)("span",{style:{position:"absolute",left:"24px",top:"50%",transform:"translateY(-50%)",fontSize:"20px",color:"var(--calc-text-faint)"},children:"$"}),(0,a.jsx)("input",{type:"text",style:{...t,paddingLeft:"48px",fontSize:"20px",padding:"16px"},value:S.originalPrincipalBalance>0?h("originalPrincipalBalance",S.originalPrincipalBalance,C):"",onChange:e=>M("originalPrincipalBalance",d(e.target.value)),onFocus:()=>k("originalPrincipalBalance"),onBlur:()=>k(null),onKeyDown:e=>D(e,!1),placeholder:"206,500",autoFocus:!0})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{style:{fontSize:"16px",fontWeight:"600",color:"var(--calc-text-secondary)",display:"block",marginBottom:"8px"},children:["Original Loan Amount",(0,a.jsx)("span",{style:{fontSize:"13px",fontWeight:"400",color:"var(--calc-text-faint)",marginLeft:"8px"},children:"(for UFMIP refund calculation)"})]}),(0,a.jsxs)("div",{style:{position:"relative"},children:[(0,a.jsx)("span",{style:{position:"absolute",left:"24px",top:"50%",transform:"translateY(-50%)",fontSize:"20px",color:"var(--calc-text-faint)"},children:"$"}),(0,a.jsx)("input",{type:"text",style:{...t,paddingLeft:"48px",fontSize:"20px",padding:"16px"},value:S.originalLoanAmount>0?h("originalLoanAmount",S.originalLoanAmount,C):"",onChange:e=>M("originalLoanAmount",d(e.target.value)),onFocus:()=>k("originalLoanAmount"),onBlur:()=>k(null),onKeyDown:e=>D(e,!0),placeholder:"200,000"})]})]})]});case 4:return(0,a.jsxs)("div",{style:e,children:[(0,a.jsxs)("div",{style:{textAlign:"center",marginBottom:"32px"},children:[(0,a.jsx)("div",{style:{width:"80px",height:"80px",background:"#f3e8ff",borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center",marginBottom:"24px"},children:(0,a.jsx)(o.A7C,{size:36,color:"#7c3aed"})}),(0,a.jsx)("h2",{style:n,children:"Loan Timeline"}),(0,a.jsx)("p",{style:i,children:"How long have you had this loan?"})]}),(0,a.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,a.jsx)("label",{style:{fontSize:"16px",fontWeight:"600",color:"var(--calc-text-secondary)",display:"block",marginBottom:"8px"},children:"Loan Age (Months Since First Payment)"}),(0,a.jsx)("input",{type:"number",style:{...t,fontSize:"20px",padding:"16px"},value:S.loanAgeMonths>
10?S.loanAgeMonths:"",onChange:e=>M("loanAgeMonths",parseInt(e.target.value)||0),onKeyDown:e=>D(e,!1),placeholder:"18",min:"0",max:"360",autoFocus:!0}),(0,a.jsx)("p",{style:{fontSize:"13px",color:"var(--calc-text-faint)",marginTop:"8px",textAlign:"center"},children:"FHA Streamline typically requires at least 6 months"})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{style:{fontSize:"16px",fontWeight:"600",color:"var(--calc-text-secondary)",display:"block",marginBottom:"8px"},children:["Original UFMIP Paid",(0,a.jsx)("span",{style:{fontSize:"13px",fontWeight:"400",color:"var(--calc-text-faint)",marginLeft:"8px"},children:"(optional)"})]}),(0,a.jsxs)("div",{style:{position:"relative"},children:[(0,a.jsx)("span",{style:{position:"absolute",left:"24px",top:"50%",transform:"translateY(-50%)",fontSize:"20px",color:"var(--calc-text-faint)"},children:"$"}),(0,a.jsx)("input",{type:"text",style:{...t,paddingLeft:"48px",fontSize:"20px",padding:"16px"},value:S.originalUfmipPaid>0?h("originalUfmipPaid",S.originalUfmipPaid,C):"",onChange:e=>M("originalUfmipPaid",d(e.target.value)),onFocus:()=>k("originalUfmipPaid"),onBlur:()=>k(null),onKeyDown:e=>D(e,!0),placeholder:"Leave blank to auto-calculate"})]}),0===S.originalUfmipPaid&&S.originalLoanAmount>0&&(0,a.jsxs)("p",{style:{fontSize:"13px",color:"#10b981",marginTop:"8px",fontWeight:"500",textAlign:"center"},children:["Will auto-calculate as ",p(.0175*S.originalLoanAmount)," (1.75% of original loan)"]})]})]});case 5:let r,l=(()=>{let e=S.originalUfmipPaid>0?S.originalUfmipPaid:.0175*S.originalLoanAmount,t=x(S.loanAgeMonths),n=e*t/100,a=S.currentPrincipalBalance+S.interestDue+S.mipDue+S.negativeEscrowBalance-n,i=S.originalPrincipalBalance,r=Math.min(a,i),l=.0175*r;return{methodA:a,methodABreakdown:{currentBalance:S.currentPrincipalBalance,interestDue:S.interestDue,mipDue:S.mipDue,negativeEscrowBalance:S.negativeEscrowBalance,ufmipRefund:n,total:a},methodB:i,baseLoanAmount:r,useMethodA:a<i,ufmipRefund:n,refundFactor:t,newUfmip:l,totalNewLoan:r+l,originalUfmipPaid:e}})();return(0,a.jsxs)("div",{style:{animation:"slideIn".concat("right"===y?"Right":"Left"," 0.3s ease-out"),maxWidth:"900px",margin:"0 auto"},children:[(0,a.jsxs)("div",{style:{textAlign:"center",marginBottom:"32px"},children:[(0,a.jsx)("h2",{style:{fontSize:"32px",fontWeight:"700",color:"var(--calc-text-primary)",margin:"0 0 8px 0"},children:"Your FHA Streamline Results"}),(0,a.jsx)("p",{style:{fontSize:"16px",color:"var(--calc-text-muted)",margin:0},children:"Here's your new loan amount calculation"})]}),(0,a.jsxs)("div",{style:{backgroundColor:"#fef3c7",border:"2px solid #fbbf24",borderRadius:"16px",padding:"20px",marginBottom:"32px",display:"flex",gap:"12px"},children:[(0,a.jsx)(o.__w,{size:20,color:"#92400e",style:{flexShrink:0,marginTop:"2px"}}),(0,a.jsxs)("div",{style:{fontSize:"14px",color:"#92400e",lineHeight:"1.6"},children:[(0,a.jsx)("strong",{children:"Important:"})," Closing costs cannot be financed into an FHA Streamline loan. You must pay them out of pocket or negotiate with the lender to cover them."]})]}),(0,a.jsxs)("div",{style:{backgroundColor:"var(--calc-bg-card)",borderRadius:"24px",padding:"32px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.08)",marginBottom:"24px"},children:[(0,a.jsx)("h3",{style:{fontSize:"20px",fontWeight:"700",color:"var(--calc-text-primary)",marginBottom:"8px"},children:"Step 1: Calculate Base Loan Amount"}),(0,a.jsxs)("p",{style:{fontSize:"14px",color:"var(--calc-text-muted)",marginBottom:"24px"},children:["FHA uses the ",(0,a.jsx)("strong",{children:"lesser"})," of Method A or Method B:"]}),(0,a.jsxs)("div",{style:{backgroundColor:l.useMethodA?"#f3e8ff":"var(--calc-bg-page)",border:l.useMethodA?"2px solid #7c3aed":"1px solid var(--calc-border)",borderRadius:"12px",padding:"20px",marginBottom:"16px"},children:[(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[(0,a.jsx)("h4",{style:{fontSize:"16px",fontWeight:"700",color:"var(--calc-text-primary)",margin:0},children:"Method A: Current Payoff"}),l.useMethodA&&(0,a.jsx)("span",{style:{backgroundColor:"#7c3aed",color:"white",padding:"4px 12px",borderRadius:"12px",fontSize:"11px",fontWeight:"700"},children:"â USED"})]}),l.useMethodA&&(0,a.jsxs)("div",{style:{position:"relative",display:"inline-block",marginBottom:"12px"},children:[(0,a.jsx)("span",{style:{fontSize:"12px",color:"#7c3aed",fontWeight:"600",cursor:"help",borderBottom:"1px dotted #7c3aed"},className:"tooltip-trigger",children:"Why This Method?"}),(0,a.jsxs)("div",{className:"tooltip-content",style:{position:"absolute",bottom:"100%",left:"0",marginBottom:"8px",padding:"12px",backgroundColor:"#1f2937",color:"white",borderRadius:"8px",fontSize:"13px",lineHeight:"1.5",width:"280px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",opacity:0,visibility:"hidden",transition:"opacity 0.2s, visibility 0.2s",zIndex:10,pointerEvents:"none"},children:[(0,a.jsx)("strong",{children:"Method A is used because:"}),(0,a.jsx)("br",{}),"Your current payoff amount (",p(l.methodA),") is less than your original principal balance (",p(l.methodB),"). FHA always uses the lower amount.",(0,a.jsx)("div",{style:{position:"absolute",top:"100%",left:"20px",width:0,height:0,borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderTop:"6px solid #1f2937"}})]})]}),(0,a.jsxs)("div",{style:{fontSize:"14px",color:"var(--calc-text-secondary)",lineHeight:"1.8"},children:[(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,a.jsx)("span",{children:"Current Principal Balance"}),(0,a.jsx)("span",{style:{fontWeight:"600"},children:p(l.methodABreakdown.currentBalance)})]}),(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,a.jsx)("span",{children:"+ Interest Due"}),(0,a.jsx)("span",{style:{fontWeight:"600"},children:p(l.methodABreakdown.interestDue)})]}),(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,a.jsx)("span",{children:"+ MIP Due"}),(0,a.jsx)("span",{style:{fontWeight:"600"},children:p(l.methodABreakdown.mipDue)})]}),l.methodABreakdown.negativeEscrowBalance>0&&(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,a.jsx)("span",{children:"+ Negative Escrow Balance"}),(0,a.jsx)("span",{style:{fontWeight:"600"},children:p(l.methodABreakdown.negativeEscrowBalance)})]}),(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,a.jsx)("span",{children:"â UFMIP Refund"}),(0,a.jsxs)("span",{style:{fontWeight:"600",color:"#10b981"},children:["â",p(l.ufmipRefund)]})]}),(0,a.jsx)("div",{style:{height:"1px",backgroundColor:"var(--calc-border)",margin:"12px 0"}}),(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,a.jsx)("span",{style:{fontWeight:"700"},children:"Method A Total"}),(0,a.jsx)("span",{style:{fontWeight:"700",color:l.useMethodA?"#7c3aed":"var(--calc-text-primary)"},children:p(l.methodA)})]})]})]}),(0,a.jsxs)("div",{style:{backgroundColor:l.useMethodA?"var(--calc-bg-page)":"#f3e8ff",border:l.useMethodA?"1px solid var(--calc-border)":"2px solid #7c3aed",borderRadius:"12px",padding:"20px"},children:[(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[(0,a.jsx)("h4",{style:{fontSize:"16px",fontWeight:"700",color:"var(--calc-text-primary)",margin:0},children:"Method B: Original Principal Balance"}),!l.useMethodA&&(0,a.jsx)("span",{style:{backgroundColor:"#7c3aed",color:"white",padding:"4px 12px",borderRadius:"12px",fontSize:"11px",fontWeight:"700"},children:"â USED"})]}),!l.useMethodA&&(0,a.jsxs)("div",{style:{position:"relative",display:"inline-block",marginBottom:"12px"},children:[(0,a.jsx)("span",{style:{fontSize:"12px",color:"#7c3aed",fontWeight:"600",cursor:"help",borderBottom:"1px dotted #7c3aed"},className:"tooltip-trigger",children:"Why This Method?"}),(0,a.jsxs)("div",{className:"tooltip-content",style:{position:"absolute",bottom:"100%",left:"0",marginBottom:"8px",padding:"12px",backgroundColor:"#1f2937",color:"white",borderRadius:"8px",fontSize:"13px",lineHeight:"1.5",width:"280px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",opacity:0,visibility:"hidden",transition:"opacity 0.2s, visibility 0.2s",zIndex:10,pointerEvents:"none"},children:[(0,a.jsx)("strong",{children:"Method B is used because:"}),(0,a.jsx)("br",{}),"Your original principal balance (",p(l.methodB),") is less than your current payoff amount (",p(l.methodA),"). FHA always uses the lower amount.",(0,a.jsx)("div",{style:{position:"absolute",top:"100%",left:"20px",width:0,height:0,borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderTop:"6px solid #1f2937"}})]})]}),(0,a.jsx)("div",{style:{fontSize:"14px",color:"var(--calc-text-secondary)",lineHeight:"1.8"},children:(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,a.jsx)("span",{style:{fontWeight:"700"},children:"Method B Total"}),(0,a.jsx)("span",{style:{fontWeight:"700",color:l.useMethodA?"var(--calc-text-primary)":"#7c3aed"},children:p(l.methodB)})]})})]}),(0,a.jsx)("div",{style:{marginTop:"24px",padding:"20px",backgroundColor:"#f3e8ff",borderRadius:"12px",border:"2px s
1olid #7c3aed"},children:(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,a.jsx)("span",{style:{fontSize:"16px",fontWeight:"700",color:"var(--calc-text-primary)"},children:"Base Loan Amount (Lesser of A or B)"}),(0,a.jsx)("span",{style:{fontSize:"24px",fontWeight:"700",color:"#7c3aed"},children:p(l.baseLoanAmount)})]})})]}),(0,a.jsxs)("div",{style:{backgroundColor:"var(--calc-bg-card)",borderRadius:"24px",padding:"32px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.08)",marginBottom:"24px"},children:[(0,a.jsx)("h3",{style:{fontSize:"20px",fontWeight:"700",color:"var(--calc-text-primary)",marginBottom:"8px"},children:"Step 2: Add New UFMIP"}),(0,a.jsx)("p",{style:{fontSize:"14px",color:"var(--calc-text-muted)",marginBottom:"24px"},children:"FHA requires a new 1.75% Upfront Mortgage Insurance Premium:"}),(0,a.jsxs)("div",{style:{fontSize:"16px",color:"var(--calc-text-secondary)",lineHeight:"2"},children:[(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,a.jsx)("span",{children:"Base Loan Amount"}),(0,a.jsx)("span",{style:{fontWeight:"600"},children:p(l.baseLoanAmount)})]}),(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,a.jsx)("span",{children:"+ New UFMIP (1.75%)"}),(0,a.jsx)("span",{style:{fontWeight:"600"},children:p(l.newUfmip)})]}),(0,a.jsx)("div",{style:{height:"2px",backgroundColor:"#7c3aed",margin:"16px 0"}}),(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,a.jsx)("span",{style:{fontSize:"20px",fontWeight:"700"},children:"Total New Loan Amount"}),(0,a.jsx)("span",{style:{fontSize:"36px",fontWeight:"700",color:"#7c3aed"},children:p(l.totalNewLoan)})]})]})]}),l.ufmipRefund>0&&(0,a.jsxs)("div",{style:{backgroundColor:"#d1fae5",border:"2px solid #6ee7b7",borderRadius:"24px",padding:"24px",marginBottom:"24px"},children:[(0,a.jsx)("h4",{style:{fontSize:"18px",fontWeight:"700",color:"#065f46",marginBottom:"12px"},children:"\uD83D\uDCB0 UFMIP Refund Credit"}),(0,a.jsxs)("div",{style:{fontSize:"15px",color:"#065f46",lineHeight:"1.8"},children:[(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"4px"},children:[(0,a.jsx)("span",{children:"Original UFMIP Paid:"}),(0,a.jsx)("span",{style:{fontWeight:"600"},children:p(l.originalUfmipPaid)})]}),(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"4px"},children:[(0,a.jsxs)("span",{children:["Refund Factor (",S.loanAgeMonths," months):"]}),(0,a.jsx)("span",{style:{fontWeight:"600"},children:(r=l.refundFactor,"".concat(r.toFixed(3),"%"))})]}),(0,a.jsx)("div",{style:{height:"1px",backgroundColor:"#6ee7b7",margin:"12px 0"}}),(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,a.jsx)("span",{style:{fontWeight:"700",fontSize:"16px"},children:"Your Refund Credit:"}),(0,a.jsx)("span",{style:{fontWeight:"700",fontSize:"18px"},children:p(l.ufmipRefund)})]})]})]}),(0,a.jsxs)("div",{style:{backgroundColor:"var(--calc-bg-card)",border:"1px solid var(--calc-border)",borderRadius:"24px",padding:"24px"},children:[(0,a.jsx)("h4",{style:{fontSize:"18px",fontWeight:"700",color:"var(--calc-text-primary)",marginBottom:"16px"},children:"Complete UFMIP Refund Schedule"}),(0,a.jsx)("p",{style:{fontSize:"14px",color:"var(--calc-text-muted)",marginBottom:"16px"},children:"Refund percentage for each month (decreases by 2% per month):"}),(0,a.jsx)("div",{ref:v,style:{maxHeight:"400px",overflowY:"auto",border:"1px solid var(--calc-border)",borderRadius:"12px"},children:(0,a.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"14px"},children:[(0,a.jsx)("thead",{style:{position:"sticky",top:0,backgroundColor:"var(--calc-bg-page)",zIndex:1},children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{style:{padding:"12px",textAlign:"left",fontWeight:"600",color:"var(--calc-text-primary)",borderBottom:"2px solid var(--calc-border)"},children:"Months"}),(0,a.jsx)("th",{style:{padding:"12px",textAlign:"right",fontWeight:"600",color:"var(--calc-text-primary)",borderBottom:"2px s
1olid var(--calc-border)"},children:"Refund %"})]})}),(0,a.jsx)("tbody",{children:Array.from({length:37},(e,t)=>{let n=x(t),i=t===S.loanAgeMonths;return(0,a.jsxs)("tr",{ref:i?j:null,style:{backgroundColor:i?"#f3e8ff":t%2==0?"var(--calc-bg-card)":"var(--calc-bg-page)",fontWeight:i?"700":"normal"},children:[(0,a.jsxs)("td",{style:{padding:"10px 12px",color:i?"#7c3aed":"var(--calc-text-secondary)",borderBottom:"1px solid var(--calc-border)"},children:[0===t?"0-1":t," ",1===t?"month":"months",i&&" â Your loan"]}),(0,a.jsxs)("td",{style:{padding:"10px 12px",textAlign:"right",fontWeight:i?"700":"600",color:i?"#7c3aed":"var(--calc-text-primary)",borderBottom:"1px solid var(--calc-border)"},children:[n,"%"]})]},t)})})]})}),(0,a.jsx)("p",{style:{marginTop:"12px",fontSize:"13px",color:"var(--calc-text-muted)",fontStyle:"italic"},children:"Scroll to see all months. Refund is 0% after 36 months."})]})]});default:return null}})()}),B.general&&(0,a.jsx)("div",{style:{maxWidth:"700px",margin:"16px auto 0",padding:"12px 16px",backgroundColor:"#fee2e2",border:"1px solid #fca5a5",borderRadius:"12px",color:"#991b1b",fontSize:"14px",textAlign:"center"},className:"jsx-4d59e7b1bacf96c9",children:B.general}),(0,a.jsxs)("div",{style:{maxWidth:5===f?"1200px":"700px",margin:"32px auto 0",display:"flex",justifyContent:"space-between",alignItems:"center",gap:"16px"},className:"jsx-4d59e7b1bacf96c9",children:[(0,a.jsxs)("button",{onClick:1===f?void 0:()=>{A({}),b("left"),m(f-1)},disabled:1===f,style:{padding:"16px 32px",fontSize:"16px",fontWeight:"600",color:1===f?"var(--calc-text-faint)":"var(--calc-text-secondary)",backgroundColor:"transparent",border:"none",borderRadius:"12px",cursor:1===f?"not-allowed":"pointer",display:"inline-flex",alignItems:"center",gap:"8px",transition:"all 0.2s",opacity:1===f?.5:1},onMouseEnter:e=>{f>1&&(e.currentTarget.style.backgroundColor="#f3f4f6")},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"},className:"jsx-4d59e7b1bacf96c9",children:[f>1&&(0,a.jsx)(o.QVr,{size:16}),1===f?"":"Back"]}),f<5?(0,a.jsxs)("button",{onClick:P,style:{padding:"16px 32px",fontSize:"16px",fontWeight:"600",color:"white",background:"linear-gradient(to right, #6020C8, #481896)",border:"none",borderRadius:"12px",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"8px",transition:"all 0.2s",boxShadow:"0 4px 12px rgba(124, 58, 237, 0.3)"},onMouseEnter:e=>{e.currentTarget.style.transform="translateY(-2px)",e.currentTarget.style.boxShadow="0 10px 20px -5px rgba(124, 58, 237, 0.4)"},onMouseLeave:e=>{e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 4px 12px rgba(124, 58, 237, 0.3)"},className:"jsx-4d59e7b1bacf96c9",children:[4===f?"Calculate":"Continue",(0,a.jsx)(o.Z0P,{size:16})]}):(0,a.jsx)("button",{onClick:()=>{m(1),w({currentPrincipalBalance:0,interestDue:0,mipDue:0,negativeEscrowBalance:0,originalPrincipalBalance:0,originalLoanAmount:0,loanAgeMonths:0,originalUfmipPaid:0}),A({}),b("right")},style:{padding:"16px 32px",fontSize:"16px",fontWeight:"600",color:"white",background:"linear-gradient(to right, #6020C8, #481896)",border:"none",borderRadius:"12px",cursor:"pointer",margin:"0 auto",display:"inline-flex",alignItems:"center",gap:"8px",transition:"all 0.2s",boxShadow:"0 4px 12px rgba(124, 58, 237, 0.3)"},onMouseEnter:e=>{e.currentTarget.style.transform="translateY(-2px)",e.currentTarget.style.boxShadow="0 10px 20px -5px rgba(124, 58, 237, 0.4)"},onMouseLeave:e=>{e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 4px 12px rgba(124, 58, 237, 0.3)"},className:"jsx-4d59e7b1bacf96c9",children:"Start Over"})]}),(0,a.jsx)(r(),{id:"4d59e7b1bacf96c9",children:"@keyframes slideInRight{from{opacity:0;transform:translatex(100px)}to{opacity:1;transform:translatex(0)}}@keyframes slideInLeft{from{opacity:0;transform:translatex(-100px)}to{opacity:1;transform:translatex(0)}}input.jsx-4d59e7b1bacf96c9:focus{outline:none;border-color:#7c3aed;box-shadow:0 0 0 3px rgba(124,58,237,.1);background-color:var(--calc-bg-card)}.tooltip-trigger.jsx-4d59e7b1bacf96c9:hover+.tooltip-content.jsx-4d59e7b1bacf96c9{opacity:1;visibility:visible}"})]})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.