PageSourceSearch

https://domdhi.com/assets/CalculatorEmbed-CY5Vrg-k.js

js domdhi.com collected 2026-10-02 01:28:04 UTC 66,965 bytes, 1 lines download raw bytes

1import{H as e,W as t,k as n}from"./chunk-6CSD65Y2-D6zLy3dp.js";import{t as r}from"./jsx-runtime-BGLTrfZy.js";import{n as i,t as a}from"./button-DrB63Wrb.js";import{t as o}from"./plus-CosOOyB9.js";import{t as s}from"./trash-2-BNeaAv3i.js";import{t as c}from"./time-utils-DcRCMNV5.js";import{t as l}from"./input-BBoqvRvE.js";import{t as u}from"./label-CbjB0egX.js";import{t as d}from"./select-Djwuz2jO.js";import{n as f}from"./use-timezone-BxbxSbxz.js";import{n as p}from"./calculators-aelNI-sd.js";import{t as m}from"./tax-brackets-BijtrLgu.js";import{t as h}from"./form-field-BTaYirwI.js";var g=t(e(),1),_=600;function v(e){let t=new Date;return new Date(t.getFullYear(),t.getMonth()+e,1).toISOString().slice(0,10)}function y(e,t){return Math.round(e*t/100/12)}function b(e,t,n){if(e.length===0)return[];let r=e.map(e=>({id:e.id,name:e.name,balanceCents:e.balanceCents,aprPct:e.aprPct,minimumPaymentCents:e.minimumPaymentCents,schedule:[],totalInterestCents:0,paidOff:!1})),i=0,a=0;for(;i<_;){let e=r.filter(e=>!e.paidOff);if(e.length===0)break;i++,e.sort(n);let o=new Map;for(let t of e){let e=y(t.balanceCents,t.aprPct);o.set(t.id,e),t.balanceCents+=e,t.totalInterestCents+=e}let s=t+a;for(let t=0;t<e.length;t++){let n=e[t];if(n.paidOff)continue;let r=n.minimumPaymentCents;if(t===0&&(r+=s,s=0),r>n.balanceCents){let e=r-n.balanceCents;r=n.balanceCents,s+=e}let c=o.get(n.id)??0,l=Math.min(r,c),u=r-l;n.balanceCents-=r,n.schedule.push({month:i,remainingCents:Math.max(0,n.balanceCents),interestPaidCents:l,principalPaidCents:u}),n.balanceCents<=0&&(n.paidOff=!0,a+=n.minimumPaymentCents,n.balanceCents<0&&(s+=Math.abs(n.balanceCents),n.balanceCents=0,n.schedule[n.schedule.length-1].remainingCents=0))}}return r.map(e=>({debtId:e.id,debtName:e.name,schedule:e.schedule,totalInterestCents:e.totalInterestCents,totalMonths:e.schedule.length,payoffDate:v(e.schedule.length)}))}function x(e,t){return b(e,t,(e,t)=>t.aprPct-e.aprPct)}function S(e,t){return b(e,t,(e,t)=>e.balanceCents-t.balanceCents)}function C(e,t){return b(e,t,(e,t)=>{let n=.6*e.aprPct-.4*e.balanceCents;return .6*t.aprPct-.4*t.balanceCents-n})}function ee(e,t,n){if(n<=0||e<=0)return{totalPaidCents:0,totalInterestCents:0,interestRatio:0,totalMonths:0};let r=e,i=0,a=0;for(;r>0&&a<_;){a++;let o=y(r,t);r+=o,i+=o;let s=Math.min(n,r);if(r-=s,a>1&&s<=o&&r>e*2)break}return{totalPaidCents:e+i,totalInterestCents:i,interestRatio:e>0?i/e:0,totalMonths:a}}function w(e){return e===`mfj`?`married_filing_jointly`:`single`}function T(e){return e.map(e=>({upToCents:e.max??1/0,ratePct:Math.round(e.rate*100)}))}T(m.single.brackets),T(m.married_filing_jointly.brackets),m.single.standardDeduction,m.married_filing_jointly.standardDeduction;function te(e,t){if(e<=0)return{taxCents:0,bracketPct:0,marginalRatePct:0};let n=0,r=0;for(let i of t)if(e>i.min){let t=i.max??1/0,a=Math.min(e,t)-i.min;n+=a*i.rate,r=i.rate}let i=Math.round(r*100);return{taxCents:Math.round(n),bracketPct:i,marginalRatePct:i}}function ne(e){let t=m[w(e.filingStatus)],n=t.standardDeduction,r=Math.max(0,e.grossIncomeCents-e.fourOhOnekCents-e.hsaCents),i=Math.max(0,r-n-e.otherDeductionsCents),{taxCents:a,bracketPct:o,marginalRatePct:s}=te(i,t.brackets);return{bracketPct:o,marginalRatePct:s,effectiveRatePct:e.grossIncomeCents>0?Math.round(a/e.grossIncomeCents*1e4)/100:0,federalTaxOwedCents:a,standardDeductionCents:n,taxableIncomeCents:i}}function re(e,t){return Math.round(e*t/100)}var ie=40,E=52;function D(e){let t=ie*E,n=Math.round(e.annualSalaryCents/t),r=e.weeklyRealHours*E,i=Math.max(0,e.annualSalaryCents-e.annualWorkExpensesCents),a=r>0?Math.round(i/r):0;return{grossRateCents:n,realRateCents:a,gapCents:n-a,expensesPct:e.annualSalaryCents>0?Math.round(e.annualWorkExpensesCents/e.annualSalaryCents*1e4)/100:0}}function O(e){let t=Math.max(0,e.targetRetirementAge-e.currentAge),n=e.annualReturnPct/100,r=e.safeWithdrawalRatePct/100,i=r>0?Math.round(e.annualExpensesInRetirementCents/r):0,a=(1+n)**+t,o=a>0?Math.round(i/a):i,s=e.currentPortfolioCents>=o,c=s?0:o-e.currentPortfolioCents,l=0,u=0;if(!s&&t>0){let r=n/12,a=t*12,o=i-e.currentPortfolioCents*(1+r)**+a;if(o>0&&r>0){let e=((1+r)**+a-1)/r;l=Math.round(o/e)}else o>0&&r===0&&(l=Math.round(o/a));if(l>0){let r=l*12,a=e.currentPortfolioCents;for(let e=1;e<=t;e++){a=Math.round(a*(1+n))+r;let o=t-e,s=o>0?Math.round(i/(1+n)**+o):i;
1if(a>=s){u=e;break}}}}return{coastNumberCents:o,isCoasting:s,gapCents:c,monthlyContributionNeededCents:l,yearsToCoast:u}}function ae(e){let{hourlyRateCents:t,hoursPerWeek:n}=e,r=t*n*52;return{annualWasteCents:r,monthlyWasteCents:Math.round(r/12),dailyCostCents:Math.round(n/5*t)}}function k(e,t,n){if(t===0)return e*n;let r=t/100;return Math.round(e*(((1+r)**+n-1)/r))}function oe(e,t,n,r,i,a){let o=t-e,s=k(n,a,o),c=k(n,a,o),l=Math.round(c*(1-i/100)),u=[];for(let e=10;e<=Math.max(o,30)&&!(e>o);e+=10){let t=k(n,a,e),r=k(n,a,e),o=Math.round(r*(1-i/100));u.push({year:e,rothCents:t,tradCents:r,tradAfterTaxCents:o})}u[u.length-1]?.year!==o&&o>0&&u.push({year:o,rothCents:s,tradCents:c,tradAfterTaxCents:l});let d;return d=s>l?`roth`:l>s?`traditional`:`tie`,{rothFutureValueCents:s,tradFutureValueCents:c,tradAfterTaxCents:l,winner:d,breakevenBracketPct:r,projections:u}}var A=r();function j(e){return Math.round(e*100)}function se({onChange:e}){let[t,n]=(0,g.useState)(``),[r,i]=(0,g.useState)(``),[a,o]=(0,g.useState)(``),[s,c]=(0,g.useState)(``),[d,f]=(0,g.useState)(``),[p,m]=(0,g.useState)(``),[h,_]=(0,g.useState)(``),[v,y]=(0,g.useState)(``),b=(0,g.useCallback)((n={})=>{let i={salary:n.salary??t,weeklyHours:n.weeklyHours??r,commute:n.commute??a,clothing:n.clothing??s,lunches:n.lunches??d,profDev:n.profDev??p,childcare:n.childcare??h,decompression:n.decompression??v},o=Number(i.salary),c=Number(i.weeklyHours);if(!o||o<=0||!c||c<=0){e(null);return}let l=((Number(i.commute)||0)+(Number(i.clothing)||0)+(Number(i.lunches)||0)+(Number(i.profDev)||0)+(Number(i.childcare)||0)+(Number(i.decompression)||0))*12;e(D({annualSalaryCents:j(o),weeklyRealHours:c,annualWorkExpensesCents:j(l)}))},[t,r,a,s,d,p,h,v,e]);function x(e,t,n){t(n),b({[e]:n})}return(0,A.jsxs)(`div`,{className:`bg-void border-2 border-white/10 p-6 shadow-[4px_4px_0_0_#00FF9F] space-y-6`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-3`,children:`INCOME`}),(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(u,{htmlFor:`salary`,accent:`emerald`,children:`Annual Salary ($)`}),(0,A.jsx)(l,{id:`salary`,type:`number`,min:`0`,step:`1000`,placeholder:`75000`,value:t,onChange:e=>x(`salary`,n,e.target.value),accent:`emerald`,className:`mt-1`})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(u,{htmlFor:`weeklyHours`,accent:`emerald`,children:`Weekly Real Hours (incl. commute, prep, decompression)`}),(0,A.jsx)(l,{id:`weeklyHours`,type:`number`,min:`0`,max:`168`,step:`0.5`,placeholder:`50`,value:r,onChange:e=>x(`weeklyHours`,i,e.target.value),accent:`emerald`,className:`mt-1`})]})]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-3`,children:`MONTHLY WORK EXPENSES`}),(0,A.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-4`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(u,{htmlFor:`commute`,accent:`emerald`,children:`Commute ($)`}),(0,A.jsx)(l,{id:`commute`,type:`number`,min:`0`,step:`10`,placeholder:`200`,value:a,onChange:e=>x(`commute`,o,e.target.value),accent:`emerald`,className:`mt-1`})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(u,{htmlFor:`clothing`,accent:`emerald`,children:`Work Clothing ($)`}),(0,A.jsx)(l,{id:`clothing`,type:`number`,min:`0`,step:`10`,placeholder:`50`,value:s,onChange:e=>x(`clothing`,c,e.target.value),accent:`emerald`,className:`mt-1`})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(u,{htmlFor:`lunches`,accent:`emerald`,children:`Lunches ($)`}),(0,A.jsx)(l,{id:`lunches`,type:`number`,min:`0`,step:`10`,placeholder:`150`,value:d,onChange:e=>x(`lunches`,f,e.target.value),accent:`emerald`,className:`mt-1`})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(u,{htmlFor:`profDev`,accent:`emerald`,children:`Professional Development ($)`}),(0,A.jsx)(l,{id:`profDev`,type:`number`,min:`0`,step:`10`,placeholder:`50`,value:p,onChange:e=>x(`profDev`,m,e.target.value),accent:`emerald`,className:`mt-1`})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(u,{htmlFor:`childcare`,accent:`emerald`,children:`Childcare (optional, $)`}),(0,A.jsx)(l,{id:`childcare`,type:`number`,min:`0`,step:`10`,placeholder:`0`,value:h,onChange:e=>x(`childcare`,_,e.target.value),accent:`emerald`,className:`mt-1`})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(u,{htmlFor:`decompression`,accent:`emerald`,children:`Decompression (optional, $)`}),(0,A.jsx)(l,{id:`decompression`,type:`number`,min:`0`,step:`10`,placeholder:`0`,value:v,onCh
1ange:e=>x(`decompression`,y,e.target.value),accent:`emerald`,className:`mt-1`})]})]})]})]})}function M(e){return(e/100).toLocaleString(`en-US`,{style:`currency`,currency:`USD`})}function ce({result:e}){return e?(0,A.jsxs)(`div`,{className:`bg-void border-2 border-white/10 p-6 shadow-[4px_4px_0_0_#00FF9F] space-y-6`,children:[(0,A.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,A.jsxs)(`div`,{className:`text-center`,children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-2`,children:`GROSS RATE`}),(0,A.jsx)(`p`,{className:`text-3xl font-mono font-bold text-white`,children:M(e.grossRateCents)}),(0,A.jsx)(`p`,{className:`text-xs text-gray-500 font-mono mt-1`,children:`/hr`})]}),(0,A.jsxs)(`div`,{className:`text-center`,children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-2`,children:`REAL RATE`}),(0,A.jsx)(`p`,{className:`text-3xl font-mono font-bold text-emerald`,children:M(e.realRateCents)}),(0,A.jsx)(`p`,{className:`text-xs text-gray-500 font-mono mt-1`,children:`/hr`})]})]}),(0,A.jsx)(`div`,{className:`border-t border-white/10`}),(0,A.jsxs)(`div`,{className:`bg-rose/10 border-2 border-rose/30 p-4`,children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-1`,children:`THE GAP`}),(0,A.jsxs)(`p`,{className:`text-xl font-mono font-bold text-rose`,children:[`Your real rate is `,M(e.gapCents),` less than you think`]})]}),(0,A.jsxs)(`div`,{className:`bg-amber-500/10 border-2 border-amber-500/30 p-4`,children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-1`,children:`WORK TAX`}),(0,A.jsxs)(`p`,{className:`text-xl font-mono font-bold text-amber-400`,children:[e.expensesPct,`% of your income goes to enabling work, not living`]})]})]}):(0,A.jsx)(`div`,{className:`bg-void border-2 border-white/10 p-6 shadow-[4px_4px_0_0_#00FF9F]`,children:(0,A.jsx)(`p`,{className:`text-gray-500 font-mono text-center py-8`,children:`Enter your salary to begin`})})}function le(e){return Math.round(e*100)}function ue({onChange:e}){let[t,n]=(0,g.useState)(``),[r,i]=(0,g.useState)(``),[a,o]=(0,g.useState)(``),s=(0,g.useCallback)((n={})=>{let i={hourlyRate:n.hourlyRate??t,hoursPerWeek:n.hoursPerWeek??r,taskName:n.taskName??a},o=Number(i.hourlyRate),s=Number(i.hoursPerWeek);if(!o||o<=0||!s||s<=0){e(null);return}let c=ae({hourlyRateCents:le(o),hoursPerWeek:s});e({hourlyRate:o,hoursPerWeek:s,taskName:i.taskName.trim()||void 0,...c})},[t,r,a,e]);function c(e,t,n){t(n),s({[e]:n})}return(0,A.jsxs)(`div`,{className:`bg-void border-2 border-emerald/40 p-6 relative shadow-[4px_4px_0_0_#00FF9F] space-y-6`,children:[(0,A.jsx)(`div`,{className:`absolute -top-3 right-4 bg-emerald text-black text-[10px] font-bold px-2 border-2 border-black font-mono`,children:`AUTOMATION_ROI`}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:`hourlyRate`,className:`block text-xs text-gray-400 font-mono uppercase tracking-wider mb-1`,children:`HOURLY_RATE`}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`input`,{id:`hourlyRate`,type:`number`,min:`0`,step:`1`,placeholder:`75`,value:t,onChange:e=>c(`hourlyRate`,n,e.target.value),className:`w-full bg-black border border-white/20 text-white font-mono p-2 focus:border-emerald focus:outline-none`}),(0,A.jsx)(`span`,{className:`text-gray-400 font-mono text-sm shrink-0`,children:`$/hr`})]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:`hoursPerWeek`,className:`block text-xs text-gray-400 font-mono uppercase tracking-wider mb-1`,children:`HOURS_SAVED_PER_WEEK`}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`input`,{id:`hoursPerWeek`,type:`number`,min:`0`,step:`0.5`,placeholder:`5`,value:r,onChange:e=>c(`hoursPerWeek`,i,e.target.value),className:`w-full bg-black border border-white/20 text-white font-mono p-2 focus:border-emerald focus:outline-none`}),(0,A.jsx)(`span`,{className:`text-gray-400 font-mono text-sm shrink-0`,children:`hrs`})]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`label`,{htmlFor:`taskName`,className:`block text-xs text-gray-400 font-mono uppercase tracking-wider mb-1`,children:[`TASK_DESCRIPTION`,` `,(0,A.jsx)(`span`,{className:`text-gray-600 normal-case`,children:`(optional)`})]}),(0,A.jsx)(`input`,{id:`taskName`,type:`text`,placeholder:`e.g. weekly reports`,value:a,onChange:e=>c(`taskName`,o,e.target.value),className:`w-full bg-black border border-white/20 text-white font-mono p-2 focus:border-emerald focus:outline-none`})]})]})}function N(e){let t=e/100;
1return`$`+Math.round(t).toLocaleString(`en-US`)}function de({result:e}){if(!e)return(0,A.jsx)(`div`,{className:`bg-void border-2 border-white/10 p-6`,children:(0,A.jsx)(`p`,{className:`text-gray-500 font-mono text-center py-8`,children:`ENTER VALUES TO CALCULATE`})});let t=Math.round(e.hourlyRate*e.hoursPerWeek*100/100);return(0,A.jsxs)(`div`,{className:`bg-void border-2 border-white/10 p-6 space-y-4`,children:[e.taskName&&(0,A.jsxs)(`p`,{className:`text-xs font-mono text-gray-400 uppercase tracking-wider`,children:[`TASK:`,` `,(0,A.jsx)(`span`,{className:`text-white`,children:e.taskName})]}),(0,A.jsxs)(`div`,{className:`grid grid-cols-2 lg:grid-cols-3 gap-4`,children:[(0,A.jsxs)(`div`,{className:`text-center`,children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-2`,children:`ANNUAL_WASTE`}),(0,A.jsx)(`p`,{className:`text-2xl font-mono font-bold text-white`,children:N(e.annualWasteCents)})]}),(0,A.jsxs)(`div`,{className:`text-center`,children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-2`,children:`MONTHLY_WASTE`}),(0,A.jsxs)(`p`,{className:`text-2xl font-mono font-bold text-white`,children:[N(e.monthlyWasteCents),(0,A.jsx)(`span`,{className:`text-sm text-gray-400`,children:`/mo`})]})]}),(0,A.jsxs)(`div`,{className:`text-center col-span-2 lg:col-span-1`,children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-2`,children:`DAILY_COST`}),(0,A.jsxs)(`p`,{className:`text-2xl font-mono font-bold text-white`,children:[N(e.dailyCostCents),(0,A.jsx)(`span`,{className:`text-sm text-gray-400`,children:`/day`})]})]})]}),(0,A.jsxs)(`div`,{className:`bg-rose/10 border border-rose/30 p-4 mt-4`,children:[(0,A.jsxs)(`p`,{className:`text-amber font-bold text-2xl font-mono`,children:[`ANNUAL WASTE: `,N(e.annualWasteCents)]}),(0,A.jsxs)(`p`,{className:`text-gray-400 text-sm font-mono mt-2`,children:[`Every week of manual work burns $`,t.toLocaleString(`en-US`),`. Automate to reclaim your time.`]})]})]})}function fe({onChange:e}){let[t,n]=(0,g.useState)(0),[r,i]=(0,g.useState)(0),[a,o]=(0,g.useState)(0),[s,c]=(0,g.useState)(!1),l=(0,g.useCallback)(e=>Math.max(e*.01,25),[]);(0,g.useEffect)(()=>{s&&t>0&&o(l(t))},[s,t,l]),(0,g.useEffect)(()=>{let n=Math.round(t*100),i=Math.round(a*100);if(n<=0||i<=0||r<=0){e(null);return}e(ee(n,r,i))},[t,r,a,e]);let u=`bg-void border-2 border-white/10 text-white px-3 py-2 font-mono focus:border-emerald focus:outline-none w-full`,d=`text-xs font-mono uppercase tracking-wider text-gray-400`;return(0,A.jsxs)(`div`,{className:`bg-void border-2 border-white/10 p-6 space-y-5`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:d,children:`Principal ($)`}),(0,A.jsx)(`input`,{type:`number`,step:`100`,min:`0`,value:t||``,placeholder:`10000`,onChange:e=>n(Number(e.target.value)||0),className:u})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:d,children:`APR (%)`}),(0,A.jsx)(`input`,{type:`number`,step:`0.1`,min:`0`,max:`100`,value:r||``,placeholder:`19.99`,onChange:e=>i(Number(e.target.value)||0),className:u})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:d,children:`Monthly Payment ($)`}),(0,A.jsx)(`input`,{type:`number`,step:`1`,min:`0`,value:a||``,placeholder:`200`,onChange:e=>{c(!1),o(Number(e.target.value)||0)},disabled:s,className:`${u} ${s?`opacity-50`:``}`}),(0,A.jsxs)(`label`,{className:`flex items-center gap-2 mt-2 cursor-pointer`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:s,onChange:e=>c(e.target.checked),className:`accent-[#00FF9F]`}),(0,A.jsx)(`span`,{className:`text-xs font-mono text-gray-400`,children:`Minimum only (1% of balance or $25)`})]})]})]})}function P(e){return(e/100).toLocaleString(`en-US`,{style:`currency`,currency:`USD`})}function F({result:e}){if(!e)return(0,A.jsx)(`div`,{className:`bg-void border-2 border-white/10 p-6 flex items-center justify-center min-h-[300px]`,children:(0,A.jsx)(`p`,{className:`text-gray-500 font-mono text-sm`,children:`Enter loan details above`})});let t=e.totalPaidCents-e.totalInterestCents,n=Math.floor(e.totalMonths/12),r=e.totalMonths%12,i=e.totalPaidCents||1,a=t/i*100,o=e.totalInterestCents/i*100;return(0,A.jsxs)(`div`,{className:`space-y-6`,children:[(0,A.jsxs)(`div`,{className:`bg-void border-2 border-rose p-6 shadow-[4px_4px_0_0_#FF0055]`,children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-2`,children:`Total Extra Cost`}),(0,A.jsx)(`p`,{className:`text-3xl font-bold font-mono text-rose`,children:P(e.totalInterestCents)}),(0,A.jsxs)(`p`,{className:`text-sm text-gray-400 mt-2 font-mono`,children:[`You'll pay`,` `,(0,A.jsx)(`span`,{className:`text-white font-bold`,children:P(e.totalPaidCents)}),` `,`total — that's`,` `,(0,A.jsxs)(`span`,{className:`text-rose font-bold`,children:[(e.interestRatio*100).toFixed(0),`%`]}),` `,`more than you borrowed.`]})]}),(0,A.jsxs)(`div`,{className:`bg-void border-2 border-white/10 p-6`,children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-2`,children:`Payoff Timeline`}),(0,A.jsxs)(`p`,{className:`text-3xl font-bold font-mono text-emerald`,children:[n>0&&`${n}y `,r,`m`]}),(0,A.jsxs)(`p`,{className:`text-sm text-gray-400 mt-1 font-mono`,children:[e.totalMonths,` total months to pay off`]})]}),(0,A.jsxs)(`div`,{className:`bg-void border-2 border-white/10 p-4`,children:[(0,A.jsx)(`h3`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-4`,children:`Principal vs Interest`}),(0,A.jsxs)(`div`,{className:`flex h-10 w-full overflow-hidden`,role:`img`,"aria-label":`Principal: ${P(t)}, Interest: ${P(e.totalInterestCents)}`,children:[(0,A.jsx)(`div`,{className:`bg-emerald h-full transition-all duration-500`,style:{width:`${a}%`}}),(0,A.jsx)(`div`,{className:`bg-rose h-full transition-all duration-500`,style:{width:`${o}%`}})]}),(0,A.jsxs)(`div`,{className:`flex gap-6 justify-center mt-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`div`,{className:`w-3 h-3 bg-emerald`}),(0,A.jsxs)(`span`,{className:`text-xs font-mono text-gray-400`,children:[`Principal: `,P(t)]})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`div`,{className:`w-3 h-3 bg-rose`}),(0,A.jsxs)(`span`,{className:`text-xs font-mono text-gray-400`,children:[`Interest: `,P(e.totalInterestCents)]})]})]})]})]})}
1function I(e){let{salaryCents:t,contributionPct:n,matchPct:r,capPct:i}=e,a=Math.round(t*n/100),o=Math.round(t*Math.min(n,i)/100*r/100),s=Math.round(t*i/100*r/100),c=Math.max(0,s-o);return{annualContributionCents:a,employerMatchCents:o,matchLeftOnTableCents:c,optimalContributionPct:i,maxMatchCents:s,lifetimeMatchLeftOnTableCents:c*30,contributionPct:n}}var L=[{id:`50_up_to_6`,label:`50% up to 6%`,matchPct:50,capPct:6},{id:`100_up_to_3`,label:`100% up to 3%`,matchPct:100,capPct:3},{id:`dollar_up_to_4`,label:`Dollar for dollar up to 4%`,matchPct:100,capPct:4},{id:`custom`,label:`Custom`,matchPct:0,capPct:0}];function R({prefill:e,onChange:t}){let[n,r]=(0,g.useState)(e&&e>0?String(Math.round(e/100)):``),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)(`50_up_to_6`),[c,f]=(0,g.useState)(`50`),[p,m]=(0,g.useState)(`6`),h=(0,g.useCallback)((e={})=>{let r={salary:e.salary??n,contributionPct:e.contributionPct??i,preset:e.preset??o,customMatchPct:e.customMatchPct??c,customCapPct:e.customCapPct??p},a=Number(r.salary),s=Number(r.contributionPct);if(!a||a<=0||!s||s<=0){t(null);return}let l=L.find(e=>e.id===r.preset),u=r.preset===`custom`?Number(r.customMatchPct):l.matchPct,d=r.preset===`custom`?Number(r.customCapPct):l.capPct;t(I({salaryCents:Math.round(a*100),contributionPct:s,matchPct:u,capPct:d}))},[n,i,o,c,p,t]);(0,g.useEffect)(()=>{e&&e>0&&i&&h()},[]);function _(e,t,n){t(n),h({[e]:n})}function v(e){let t=e;s(t),h({preset:t})}return(0,A.jsxs)(`div`,{className:`bg-void border-2 border-white/10 p-6 space-y-5`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(u,{htmlFor:`mo-salary`,accent:`emerald`,children:`ANNUAL SALARY ($)`}),(0,A.jsx)(l,{id:`mo-salary`,type:`number`,min:0,step:1e3,placeholder:`75000`,value:n,onChange:e=>_(`salary`,r,e.target.value),accent:`emerald`,className:`mt-1`}),e&&e>0?(0,A.jsx)(`p`,{className:`text-xs text-emerald/60 mt-1 font-mono`,children:`Pre-filled from your Nexus`}):null]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(u,{htmlFor:`mo-contribution`,accent:`emerald`,children:`YOUR CONTRIBUTION (%)`}),(0,A.jsx)(l,{id:`mo-contribution`,type:`number`,min:0,max:100,step:.5,placeholder:`6`,value:i,onChange:e=>_(`contributionPct`,a,e.target.value),accent:`emerald`,className:`mt-1`})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(u,{htmlFor:`mo-preset`,accent:`emerald`,children:`EMPLOYER MATCH FORMULA`}),(0,A.jsx)(d,{id:`mo-preset`,accent:`emerald`,value:o,onChange:e=>v(e.target.value),options:L.map(e=>({value:e.id,label:e.label})),className:`mt-1`})]}),o===`custom`&&(0,A.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(u,{htmlFor:`mo-custom-match`,accent:`emerald`,children:`MATCH %`}),(0,A.jsx)(l,{id:`mo-custom-match`,type:`number`,min:0,max:200,step:1,placeholder:`50`,value:c,onChange:e=>_(`customMatchPct`,f,e.target.value),accent:`emerald`,className:`mt-1`})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(u,{htmlFor:`mo-custom-cap`,accent:`emerald`,children:`UP TO %`}),(0,A.jsx)(l,{id:`mo-custom-cap`,type:`number`,min:0,max:100,step:.5,placeholder:`6`,value:p,onChange:e=>_(`customCapPct`,m,e.target.value),accent:`emerald`,className:`mt-1`})]})]})]})}function z(e){return(e/100).toLocaleString(`en-US`,{style:`currency`,currency:`USD`})}function B({result:e}){return e?(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsx)(`div`,{className:`bg-void border-2 border-white/10 p-6`,children:(0,A.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400`,children:`YOUR CONTRIBUTION`}),(0,A.jsx)(`p`,{className:`text-2xl font-bold font-mono text-white`,children:z(e.annualContributionCents)}),(0,A.jsxs)(`p`,{className:`text-xs text-gray-500 font-mono`,children:[e.contributionPct,`% of salary`]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400`,children:`EMPLOYER MATCH`}),(0,A.jsx)(`p`,{className:`text-2xl font-bold font-mono text-emerald`,children:z(e.employerMatchCents)}),(0,A.jsx)(`p`,{className:`text-xs text-gray-500 font-mono`,children:`Free money`})]})]})}),e.matchLeftOnTableCents>0?(0,A.jsxs)(`div`,{className:`bg-void border-2 border-rose p-6 shadow-[4px_4px_0_0_#FF0055]`,children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-rose mb-1`,children:`MONEY LEFT ON THE TABLE`}),(0,A.jsx)(`p`,{className:`text-3xl font-bold font-mono text-rose`,children:z(e.matchLeftOnTableCents)}),(0,A.jsxs)(`p`,{className:`text-sm text-gray-400 mt-2 font-mono`,children:[`Contribute at least `,e.optimalContributionPct,`% to capture your full match of `,z(e.maxMatchCents),`/year.`]}),(0,A.jsxs)(`p`,{className:`text-xs text-gray-500 mt-3 font-mono`,children:[`Over a `,30,`-year career:`,` `,(0,A.jsx)(`span`,{className:`text-rose font-bold`,children:z(e.lifetimeMatchLeftOnTableCents)}),` `,`left on the table.`]})]}):(0,A.jsxs)(`div`,{className:`bg-void border-2 border-emerald p-6 shadow-[4px_4px_0_0_#00FF9F]`,children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-emerald mb-1`,children:`FULL MATCH CAPTURED`}),(0,A.jsx)(`p`,{className:`text-lg font-bold font-mono text-emerald`,children:`You're getting every dollar your employer will give you.`})]})]}):(0,A.jsx)(`div`,{className:`bg-void border-2 border-white/10 p-6 flex items-center justify-center min-h-[300px]`,children:(0,A.jsx)(`p`,{className:`text-gray-500 font-mono text-sm`,children:`Enter your salary and contribution to begin`})})}var V=[{value:`single`,label:`Single`},{value:`mfj`,label:`Married Filing Jointly`}];
1function pe({prefill:e,onChange:t}){let[n,r]=(0,g.useState)(`single`),[i,a]=(0,g.useState)(e&&e>0?e/100:0),[o,s]=(0,g.useState)(0),[c,u]=(0,g.useState)(0),[f,p]=(0,g.useState)(0),m=(0,g.useCallback)((e={})=>{let r=e.filingStatus??n,a=e.grossIncome??i,s=e.fourOhOnekDollars??o,l=e.hsaDollars??c,u=e.otherDollars??f,d=Math.round(a*100),p=Math.round(s*100),m=Math.round(l*100),h=Math.round(u*100);if(d<=0){t(null);return}t({result:ne({filingStatus:r,grossIncomeCents:d,fourOhOnekCents:p,hsaCents:m,otherDeductionsCents:h}),deductions:[{label:`401K`,cents:p},{label:`HSA`,cents:m},{label:`OTHER`,cents:h}].filter(e=>e.cents>0)})},[n,i,o,c,f,t]);(0,g.useEffect)(()=>{e&&e>0&&m({grossIncome:e/100})},[]);function _(e){let t=e;r(t),m({filingStatus:t})}function v(e){let t=Number(e);a(t),m({grossIncome:t})}function y(e){let t=Number(e);s(t),m({fourOhOnekDollars:t})}function b(e){let t=Number(e);u(t),m({hsaDollars:t})}function x(e){let t=Number(e);p(t),m({otherDollars:t})}return(0,A.jsxs)(`div`,{className:`bg-void border-2 border-white/10 p-6 space-y-4`,children:[(0,A.jsx)(h,{label:`FILING STATUS`,name:`filing-status`,accent:`emerald`,children:(0,A.jsx)(d,{id:`filing-status`,name:`filing-status`,accent:`emerald`,value:n,options:V,onChange:e=>_(e.target.value)})}),(0,A.jsxs)(h,{label:`GROSS INCOME ($)`,name:`gross-income`,accent:`emerald`,children:[(0,A.jsx)(l,{id:`gross-income`,name:`gross-income`,type:`number`,accent:`emerald`,value:i||``,onChange:e=>v(e.target.value),placeholder:`100000`,min:`0`}),e&&e>0?(0,A.jsx)(`p`,{className:`text-xs text-emerald/60 mt-1 font-mono`,children:`Pre-filled from your Nexus income`}):null]}),(0,A.jsx)(h,{label:`401K CONTRIBUTION ($)`,name:`four-oh-onek`,accent:`emerald`,children:(0,A.jsx)(l,{id:`four-oh-onek`,name:`four-oh-onek`,type:`number`,accent:`emerald`,value:o||``,onChange:e=>y(e.target.value),placeholder:`23500`,min:`0`})}),(0,A.jsx)(h,{label:`HSA CONTRIBUTION ($)`,name:`hsa`,accent:`emerald`,children:(0,A.jsx)(l,{id:`hsa`,name:`hsa`,type:`number`,accent:`emerald`,value:c||``,onChange:e=>b(e.target.value),placeholder:`4150`,min:`0`})}),(0,A.jsx)(h,{label:`OTHER DEDUCTIONS ($)`,name:`other-deductions`,accent:`emerald`,children:(0,A.jsx)(l,{id:`other-deductions`,name:`other-deductions`,type:`number`,accent:`emerald`,value:f||``,onChange:e=>x(e.target.value),placeholder:`0`,min:`0`})})]})}function H(e){return(e/100).toLocaleString(`en-US`,{style:`currency`,currency:`USD`})}function me({result:e}){if(!e)return(0,A.jsx)(`div`,{className:`bg-void border-2 border-white/10 p-6 flex items-center justify-center min-h-[300px]`,children:(0,A.jsx)(`p`,{className:`text-gray-500 font-mono text-sm`,children:`Enter your income to see your bracket`})});let{result:t,deductions:n}=e;return(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsx)(`div`,{className:`bg-void border-2 border-emerald p-6 shadow-[4px_4px_0_0_#00FF9F]`,children:(0,A.jsxs)(`div`,{className:`grid grid-cols-3 gap-4 text-center`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400`,children:`BRACKET`}),(0,A.jsxs)(`p`,{className:`text-3xl font-bold font-mono text-emerald`,children:[t.bracketPct,`%`]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400`,children:`MARGINAL`}),(0,A.jsxs)(`p`,{className:`text-3xl font-bold font-mono text-white`,children:[t.marginalRatePct,`%`]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400`,children:`EFFECTIVE`}),(0,A.jsxs)(`p`,{className:`text-3xl font-bold font-mono text-white`,children:[t.effectiveRatePct.toFixed(1),`%`]})]})]})}),(0,A.jsxs)(`div`,{className:`bg-void border-2 border-white/10 p-6 space-y-3`,children:[(0,A.jsxs)(`div`,{className:`flex justify-between text-sm font-mono`,children:[(0,A.jsx)(`span`,{className:`text-gray-400`,children:`TAXABLE INCOME`}),(0,A.jsx)(`span`,{className:`text-white`,children:H(t.taxableIncomeCents)})]}),(0,A.jsxs)(`div`,{className:`flex justify-between text-sm font-mono`,children:[(0,A.jsx)(`span`,{className:`text-gray-400`,children:`FEDERAL TAX OWED`}),(0,A.jsx)(`span`,{className:`text-rose`,children:H(t.federalTaxOwedCents)})]}),(0,A.jsxs)(`div`,{className:`flex justify-between text-sm font-mono`,children:[(0,A.jsx)(`span`,{className:`text-gray-400`,children:`STANDARD DEDUCTION`}),(0,A.jsx)(`span`,{className:`text-emerald`,children:H(t.standardDeductionCents)})]})]}),n.length>0&&(0,A.jsxs)(`div`,{className:`bg-void border-2 border-white/10 p-6 space-y-2`,children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-2`,children:`DEDUCTION IMPACT`}),n.map(e=>(0,A.jsxs)(`div`,{className:`flex justify-between text-sm font-mono`,children:[(0,A.jsxs)(`span`,{className:`text-gray-400`,children:[e.label,` (`,H(e.cents),`)`]}),(0,A.jsxs)(`span`,{className:`text-emerald`,children:[`saves`,` `,H(re(e.cents,t.bracketPct))]})]},e.label))]}),(0,A.jsx)(`div`,{className:`bg-void border-2 border-amber/20 p-4`,children:(0,A.jsx)(`p`,{className:`text-xs text-amber/70 font-mono`,children:`For estimation only. Consult a tax professional for accurate filing advice.`})})]})}var he=`AL.AK.AZ.AR.CA.CO.CT.DE.FL.GA.HI.ID.IL.IN.IA.KS.KY.LA.ME.MD.MA.MI.MN.MS.MO.MT.NE.NV.NH.NJ.NM.NY.NC.ND.OH.OK.OR.PA.RI.SC.SD.TN.TX.UT.VT.VA.WA.WV.WI.WY.DC`.split(`.`),ge={individual:45e3,spouse:9e4,family:135e3},_e={individual:6024e3,spouse:8166e3,family:1248e4},ve={excellent:.85,good:1,fair:1.2};function ye(e,t,n,r){let i=ge[t],a=e>30?1+(e-30)*.02:1,o=ve[r],s=Math.round(i*a*o),c=_e[t],l=n>0&&n<c,u=s;if(l&&n>0){let e=Math.max(0,(c-n)/c*.5);u=Math.round(s*(1-e))}let d=Math.round(s*1.02),f=l?u*12:s*12;return{monthlyPremiumCents:s,monthlyPremiumWithSubsidyCents:u,cobraEstimateCents:d,annualBudgetCents:f,subsidyEligible:l}}function be({onChange:e}){let[t,n]=(0,g.useState)(``),[r,i]=(0,g.useState)(`individual`),[a,o]=(0,g.useState)(``),[s,c]=(0,g.useState)(``),[l,u]=(0,g.useState)(`good`),d=(0,g.useCallback)((n={})=>{let i={age:n.age??t,familySize:n.familySize??r,state:n.state??a,income:n.income??s,healthTier:n.healthTier??l},o=Number(i.age);
1if(!o||o<18||o>100||!i.state){e(null);return}let c=Math.round((Number(i.income)||0)*100);e(ye(o,i.familySize,c,i.healthTier))},[t,r,a,s,l,e]),f=`bg-void border-2 border-white/10 text-white px-3 py-2 font-mono focus:border-emerald focus:outline-none w-full`,p=`text-xs font-mono uppercase tracking-wider text-gray-400`;return(0,A.jsxs)(`div`,{className:`bg-void border-2 border-white/10 p-6 shadow-[4px_4px_0_0_#00FF9F] space-y-6`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-3`,children:`PERSONAL INFO`}),(0,A.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-4`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:`hi-age`,className:p,children:`Age`}),(0,A.jsx)(`input`,{id:`hi-age`,type:`number`,min:`18`,max:`100`,placeholder:`35`,value:t,onChange:e=>{n(e.target.value),d({age:e.target.value})},className:f})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:`hi-state`,className:p,children:`State`}),(0,A.jsxs)(`select`,{id:`hi-state`,value:a,onChange:e=>{o(e.target.value),d({state:e.target.value})},className:f,children:[(0,A.jsx)(`option`,{value:``,children:`Select state`}),he.map(e=>(0,A.jsx)(`option`,{value:e,children:e},e))]})]})]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-3`,children:`COVERAGE`}),(0,A.jsx)(`div`,{className:`flex flex-col gap-2`,children:[[`individual`,`Individual`,`Just you`],[`spouse`,`You + Spouse`,`Two adults`],[`family`,`Family`,`Adults + children`]].map(([e,t,n])=>(0,A.jsxs)(`label`,{className:`flex items-start gap-3 p-3 border-2 cursor-pointer transition-colors ${r===e?`border-emerald bg-emerald/5`:`border-white/10 hover:border-white/20`}`,children:[(0,A.jsx)(`input`,{type:`radio`,name:`familySize`,value:e,checked:r===e,onChange:()=>{i(e),d({familySize:e})},className:`mt-1 accent-[#00FF9F]`}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{className:`font-mono font-bold text-white text-sm`,children:t}),(0,A.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:n})]})]},e))})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-3`,children:`HEALTH STATUS`}),(0,A.jsx)(`div`,{className:`flex flex-col gap-2`,children:[[`excellent`,`Excellent`,`No chronic conditions, low utilization`],[`good`,`Good`,`Average health, occasional visits`],[`fair`,`Fair`,`Chronic conditions or regular care needed`]].map(([e,t,n])=>(0,A.jsxs)(`label`,{className:`flex items-start gap-3 p-3 border-2 cursor-pointer transition-colors ${l===e?`border-emerald bg-emerald/5`:`border-white/10 hover:border-white/20`}`,children:[(0,A.jsx)(`input`,{type:`radio`,name:`healthTier`,value:e,checked:l===e,onChange:()=>{u(e),d({healthTier:e})},className:`mt-1 accent-[#00FF9F]`}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{className:`font-mono font-bold text-white text-sm`,children:t}),(0,A.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:n})]})]},e))})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-3`,children:`INCOME (for subsidy estimate)`}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:`hi-income`,className:p,children:`Annual Income ($)`}),(0,A.jsx)(`input`,{id:`hi-income`,type:`number`,min:`0`,step:`1000`,placeholder:`55000`,value:s,onChange:e=>{c(e.target.value),d({income:e.target.value})},className:f}),(0,A.jsx)(`p`,{className:`text-xs text-gray-500 mt-1`,children:`Used to estimate ACA marketplace subsidy eligibility`})]})]})]})}function U(e){return(e/100).toLocaleString(`en-US`,{style:`currency`,currency:`USD`})}function xe({result:e}){return e?(0,A.jsxs)(`div`,{className:`bg-void border-2 border-white/10 p-6 shadow-[4px_4px_0_0_#00FF9F] space-y-6`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-3`,children:`MARKETPLACE PREMIUM`}),(0,A.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,A.jsxs)(`div`,{className:`text-center`,children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-2`,children:`FULL PRICE`}),(0,A.jsx)(`p`,{className:`text-3xl font-mono font-bold text-white`,children:U(e.monthlyPremiumCents)}),(0,A.jsx)(`p`,{className:`text-xs text-gray-500 font-mono mt-1`,children:`/month`})]}),(0,A.jsxs)(`div`,{className:`text-center`,children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-2`,children:e.subsidyEligible?`WITH SUBSIDY`:`NO SUBSIDY`}),(0,A.jsx)(`p`,{className:`text-3xl font-mono font-bold ${e.subsidyEligible?`text-emerald`:`text-white`}`,children:U(e.monthlyPremiumWithSubsidyCents)}),(0,A.jsx)(`p`,{className:`text-xs text-gray-500 font-mono mt-1`,children:`/month`})]})]})]}),(0,A.jsx)(`div`,{className:`border-t border-white/10`}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-3`,children:`COBRA ESTIMATE`}),(0,A.jsxs)(`div`,{className:`text-center`,children:[(0,A.jsx)(`p`,{className:`text-3xl font-mono font-bold text-rose`,children:U(e.cobraEstimateCents)}),(0,A.jsx)(`p`,{className:`text-xs text-gray-500 font-mono mt-1`,children:`/month (includes 2% admin fee)`})]})]}),(0,A.jsx)(`div`,{className:`border-t border-white/10`}),(0,A.jsxs)(`div`,{className:`bg-emerald/10 border-2 border-emerald/30 p-4`,children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-1`,children:`ANNUAL HEALTHCARE BUDGET`}),(0,A.jsx)(`p`,{className:`text-2xl font-mono font-bold text-emerald`,children:U(e.annualBudgetCents)}),(0,A.jsx)(`p`,{className:`text-xs text-gray-500 mt-1`,children:`Plan this into your freedom runway`})]}),e.subsidyEligible&&(0,A.jsxs)(`div`,{className:`bg-amber-500/10 border-2 border-amber-500/30 p-4`,children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-1`,children:`SUBSIDY ELIGIBLE`}),(0,A.jsx)(`p`,{className:`text-sm font-mono text-amber-400`,children:`Your income qualifies for ACA marketplace subsidies. Actual subsidy depends on your state, household size, and plan tier.`})]}),(0,A.jsx)(`div`,{className:`border-2 border-white/10 p-4`,children:(0,A.jsxs)(`p`,{className:`text-xs font-mono text-gray-500 leading-relaxed`,children:[`These are rough estimates for planning purposes only. Actual premiums vary by state, county, plan tier (Bronze/Silver/Gold), and household composition. Visit`,` `,(0,A.jsx)(`span`,{className:`text-emerald`,children:`healthcare.gov`}),` `,`for accurate quotes and subsidy calculations.`]})})]}):(0,A.jsx)(`div`,{className:`bg-void border-2 border-white/10 p-6 shadow-[4px_4px_0_0_#00FF9F]`,children:(0,A.jsx)(`p`,{className:`text-gray-500 font-mono text-center py-8`,children:`Enter your details to estimate healthcare costs`})})}function Se(){return`d_${Date.now()}_${Math.random().toString(36).slice(2,7)}`}function W(){return{id:Se(),name:``,balanceCents:0,aprPct:0,minimumPaymentCents:0}}function Ce({initialDebts:e,onCalculate:t}){let[n,r]=(0,g.useState)(e.length>0?e:[W()]),[i,c]=(0,g.useState)(0),[l,u]=(0,g.useState)(`avalanche`);function d(e,t,n){r(r=>r.map(r=>{if(r.id!==e)return r;if(t===`name`)return{...r,name:n};let i=Number(n)||0;return t===`balanceCents`?{...r,balanceCents:Math.round(i*100)}:t===`aprPct`?{...r,aprPct:i}:t===`minimumPaymentCents`?{...r,minimumPaymentCents:Math.round(i*100)}:r}))}function f(){r(e=>[...e,W()])}function p(e){r(t=>t.length<=1?t:t.filter(t=>t.id!==e))}function m(e){e.preventDefault();let r=n.filter(e=>e.balanceCents>0);r.length!==0&&t(r,Math.round(i*100),l)}let h=`bg-void border-2 border-white/10 text-white px-3 py-2 font-mono focus:border-emerald focus:outline-none w-full`,_=`text-xs font-mono uppercase tracking-wider text-gray-400`;return(0,A.jsxs)(`form`,{onSubmit:m,className:`space-y-6`,children:[(0,A.jsx)(`div`,{className:`space-y-4`,children:n.map((e,t)=>(0,A.jsxs)(`div`,{className:`bg-void border-2 border-white/10 p-4 space-y-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`span`,{className:`text-xs font-mono text-gray-500`,children:[`DEBT #`,t+1]}),n.length>1&&(0,A.jsx)(`button`,{type:`button`,onClick:()=>p(e.id),className:`text-gray-500 hover:text-rose transition-colors`,children:(0,A.jsx)(s,{className:`w-4 h-4`})})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:_,children:`N
1ame`}),(0,A.jsx)(`input`,{type:`text`,placeholder:`e.g. Chase Visa`,defaultValue:e.name,onChange:t=>d(e.id,`name`,t.target.value),className:h})]}),(0,A.jsxs)(`div`,{className:`grid grid-cols-3 gap-3`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:_,children:`Balance ($)`}),(0,A.jsx)(`input`,{type:`number`,step:`0.01`,min:`0`,defaultValue:e.balanceCents>0?(e.balanceCents/100).toFixed(2):``,placeholder:`0.00`,onChange:t=>d(e.id,`balanceCents`,t.target.value),className:h})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:_,children:`APR (%)`}),(0,A.jsx)(`input`,{type:`number`,step:`0.01`,min:`0`,max:`100`,defaultValue:e.aprPct>0?e.aprPct:``,placeholder:`0.00`,onChange:t=>d(e.id,`aprPct`,t.target.value),className:h})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:_,children:`Min Payment ($)`}),(0,A.jsx)(`input`,{type:`number`,step:`0.01`,min:`0`,defaultValue:e.minimumPaymentCents>0?(e.minimumPaymentCents/100).toFixed(2):``,placeholder:`0.00`,onChange:t=>d(e.id,`minimumPaymentCents`,t.target.value),className:h})]})]})]},e.id))}),(0,A.jsxs)(a,{type:`button`,variant:`ghost`,accent:`emerald`,size:`sm`,onClick:f,children:[(0,A.jsx)(o,{className:`w-4 h-4 mr-2`}),` ADD DEBT`]}),(0,A.jsxs)(`div`,{className:`bg-void border-2 border-white/10 p-4 space-y-3`,children:[(0,A.jsx)(`label`,{className:_,children:`Extra Monthly Payment ($)`}),(0,A.jsx)(`input`,{type:`number`,step:`1`,min:`0`,value:i||``,placeholder:`0`,onChange:e=>c(Number(e.target.value)||0),className:h}),(0,A.jsx)(`p`,{className:`text-xs text-gray-500`,children:`Additional amount beyond minimum payments each month`})]}),(0,A.jsxs)(`div`,{className:`bg-void border-2 border-white/10 p-4 space-y-3`,children:[(0,A.jsx)(`span`,{className:_,children:`Strategy`}),(0,A.jsx)(`div`,{className:`flex flex-col gap-2 mt-2`,children:[[`avalanche`,`Avalanche`,`Highest APR first (saves most money)`],[`snowball`,`Snowball`,`Lowest balance first (quick wins)`],[`hybrid`,`Hybrid`,`Balanced approach (APR + balance)`]].map(([e,t,n])=>(0,A.jsxs)(`label`,{className:`flex items-start gap-3 p-3 border-2 cursor-pointer transition-colors ${l===e?`border-emerald bg-emerald/5`:`border-white/10 hover:border-white/20`}`,children:[(0,A.jsx)(`input`,{type:`radio`,name:`strategy`,value:e,checked:l===e,onChange:()=>u(e),className:`mt-1 accent-[#00FF9F]`}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{className:`font-mono font-bold text-white text-sm`,children:t}),(0,A.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:n})]})]},e))})]}),(0,A.jsx)(a,{type:`submit`,variant:`brutal`,accent:`emerald`,size:`lg`,className:`w-full`,children:`CALCULATE`})]})}function we(e){return(e/100).toLocaleString(`en-US`,{style:`currency`,currency:`USD`})}function Te(e,t){return c(e,t,{year:!0})}function G(e,t,n){return{name:e,totalMonths:Math.max(...t.map(e=>e.totalMonths),0),totalInterestCents:t.reduce((e,t)=>e+t.totalInterestCents,0),payoffDate:t.reduce((e,t)=>t.payoffDate>e?t.payoffDate:e,``),color:n}}function Ee({results:e}){let t=f();if(!e)return null;let n=[G(`Avalanche`,e.avalanche,`text-emerald`),G(`Snowball`,e.snowball,`text-amber`),G(`Hybrid`,e.hybrid,`text-cyan`)],r=Math.min(...n.map(e=>e.totalInterestCents));return(0,A.jsxs)(`div`,{className:`bg-void border-2 border-white/10 p-4`,children:[(0,A.jsx)(`h3`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-4`,children:`Strategy Comparison`}),(0,A.jsx)(`div`,{className:`overflow-x-auto`,children:(0,A.jsxs)(`table`,{className:`w-full text-sm font-mono`,children:[(0,A.jsx)(`thead`,{children:(0,A.jsxs)(`tr`,{className:`border-b border-white/10`,children:[(0,A.jsx)(`th`,{className:`text-left text-gray-400 text-xs uppercase py-2 pr-4`,children:`Strategy`}),(0,A.jsx)(`th`,{className:`text-right text-gray-400 text-xs uppercase py-2 px-4`,children:`Months`}),(0,A.jsx)(`th`,{className:`text-right text-gray-400 text-xs uppercase py-2 px-4`,children:`Total Interest`}),(0,A.jsx)(`th`,{className:`text-right text-gray-400 text-xs uppercase py-2 pl-4`,children:`Payoff Date`})]})}),(0,A.jsx)(`tbody`,{children:n.map(e=>{let n=e.totalInterestCents===r;return(0,A.jsxs)(`tr`,{className:`border-b border-white/5`,children:[(0,A.jsxs)(`td`,{className:`py-3 pr-4 font-bold ${e.color}`,children:[e.name,n&&(0,A.jsx)(`span`,{className:`ml-2 text-[10px] text-emerald bg-emerald/10 px-1.5 py-0.5`,children:`BEST`})]}),(0,A.jsx)(`td`,{className:`text-right py-3 px-4 text-white`,children:e.totalMonths}),(0,A.jsx)(`td`,{className:`text-right py-3 px-4 ${n?`text-emerald font-bold`:`text-white`}`,children:we(e.totalInterestCents)}),(0,A.jsx)(`td`,{className:`text-right py-3 pl-4 text-gray-400`,children:e.payoffDate?Te(e.payoffDate,t):`—`})]},e.name)})})]})})]})}function K(e){let t=new Map;for(let n of e)for(let e of n.schedule)t.set(e.month,(t.get(e.month)??0)+e.remainingCents);return t}var q={avalanche:`#00FF9F`,snowball:`#FFB000`,hybrid:`#00F0FF`};function De({results:e}){if(!e)return null;let t=K(e.avalanche),n=K(e.snowball),r=K(e.hybrid),i=Math.max(...t.ke
1ys(),...n.keys(),...r.keys(),0);if(i===0)return null;let a=e.avalanche.reduce((e,t)=>{let n=t.schedule[0];return n?e+n.remainingCents+n.principalPaidCents:e},0),o={avalanche:[],snowball:[],hybrid:[]};for(let e=0;e<=i;e++)o.avalanche.push(e===0?a:t.get(e)??0),o.snowball.push(e===0?a:n.get(e)??0),o.hybrid.push(e===0?a:r.get(e)??0);let s=a||1;function c(e){return e.map((e,t)=>`${60+t/i*530},${10+(1-e/s)*210}`).join(` `)}let l=[0,.25,.5,.75,1].map(e=>({y:10+(1-e)*210,label:`$${(s*e/1e5).toFixed(0)}k`})),u=Math.max(1,Math.ceil(i/6)),d=[];for(let e=0;e<=i;e+=u)d.push({x:60+e/i*530,label:`${e}`});return(0,A.jsxs)(`div`,{className:`bg-void border-2 border-white/10 p-4`,children:[(0,A.jsx)(`h3`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-4`,children:`Payoff Timeline`}),(0,A.jsxs)(`svg`,{viewBox:`0 0 600 250`,className:`w-full h-auto`,role:`img`,"aria-label":`Debt payoff comparison chart showing avalanche, snowball, and hybrid strategies`,children:[l.map(e=>(0,A.jsx)(`line`,{x1:60,y1:e.y,x2:590,y2:e.y,stroke:`rgba(255,255,255,0.06)`,strokeDasharray:`3 3`},e.label)),l.map(e=>(0,A.jsx)(`text`,{x:54,y:e.y+3,textAnchor:`end`,fill:`#666`,fontSize:10,fontFamily:`monospace`,children:e.label},`yl-${e.label}`)),d.map(e=>(0,A.jsx)(`text`,{x:e.x,y:245,textAnchor:`middle`,fill:`#666`,fontSize:10,fontFamily:`monospace`,children:e.label},`xl-${e.label}`)),(0,A.jsx)(`text`,{x:325,y:250,textAnchor:`middle`,fill:`#666`,fontSize:10,fontFamily:`monospace`,children:`Months`}),Object.entries(o).map(([e,t])=>(0,A.jsx)(`polyline`,{points:c(t),fill:`none`,stroke:q[e],strokeWidth:2},e))]}),(0,A.jsx)(`div`,{className:`flex gap-6 justify-center mt-3`,children:Object.entries(q).map(([e,t])=>(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`div`,{className:`w-3 h-0.5`,style:{backgroundColor:t}}),(0,A.jsx)(`span`,{className:`text-xs font-mono text-gray-400 capitalize`,children:e})]},e))})]})}function J(e){return(e/100).toLocaleString(`en-US`,{style:`currency`,currency:`USD`})}function Oe({baselineMonths:e,baselineInterest:t,optimizedMonths:n,optimizedInterest:r,extraPayment:i}){if(i<=0)return null;let a=e-n,o=t-r;return a<=0&&o<=0?null:(0,A.jsxs)(`div`,{className:`bg-void border-2 border-emerald p-6 shadow-[4px_4px_0_0_#00FF9F]`,children:[(0,A.jsx)(`h3`,{className:`text-xs font-mono uppercase tracking-wider text-emerald mb-4`,children:`Extra Payment Impact`}),(0,A.jsxs)(`p`,{className:`text-white font-mono text-sm leading-relaxed`,children:[`Adding`,` `,(0,A.jsx)(`span`,{className:`text-emerald font-bold text-lg`,children:J(i)}),`/month saves you`,` `,(0,A.jsx)(`span`,{className:`text-emerald font-bold text-lg`,children:J(o)}),` `,`in interest and`,` `,(0,A.jsx)(`span`,{className:`text-emerald font-bold text-lg`,children:a}),` `,`months.`]}),(0,A.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 mt-4`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{className:`text-xs font-mono text-gray-500 uppercase`,children:`Months Saved`}),(0,A.jsx)(`p`,{className:`text-3xl font-bold font-mono text-emerald`,children:a})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{className:`text-xs font-mono text-gray-500 uppercase`,children:`Interest Saved`}),(0,A.jsx)(`p`,{className:`text-3xl font-bold font-mono text-emerald`,children:J(o)})]})]})]})}function Y(e){let t=e/100;return t>0?String(Math.round(t)):``}function ke({prefilledPortfolioCents:e,prefilledMonthlyBurnCents:t,onChange:n}){let[r,i]=(0,g.useState)(e?Y(e):``),[a,o]=(0,g.useState)(t?Y(t*12):``),[s,c]=(0,g.useState)(``),[l,u]=(0,g.useState)(``),[d,f]=(0,g.useState)(`7`),[p,m]=(0,g.useState)(`4`),h=(0,g.useCallback)((e={})=>{let t={portfolio:e.portfolio??r,annualExpenses:e.annualExpenses??a,currentAge:e.currentAge??s,retirementAge:e.retirementAge??l,returnRate:e.returnRate??d,swr:e.swr??p},i=Number(t.portfolio),o=Number(t.annualExpenses),c=Number(t.currentAge),u=Number(t.retirementAge),f=Number(t.returnRate),m=Number(t.swr);if(!c||c<18||c>100||!u||u<=c||!o||o<=0||m<=0){n(null);return}n(O({currentPortfolioCents:Math.round((i||0)*100),annualExpensesInRetirementCents:Math.round(o*100),currentAge:c,targetRetirementAge:u,annualReturnPct:f,safeWithdrawalRatePct:m}))},[r,a,s,l,d,p,n]);(0,g.useEffect)(()=>{e&&s&&l&&h()},[]);function _(e,t,n){t(n),h({[e]:n})}let v=`bg-void border-2 border-white/10 text-white px-3 py-2 font-mono focus:border-amber focus:outline-none w-full`,y=`text-xs font-mono uppercase tracking-wider text-gray-400`;return(0,A.jsxs)(`div`,{className:`bg-void border-2 border-white/10 p-6 shadow-[4px_4px_0_0_#FFB000] space-y-6`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-3`,children:`CURRENT PORTFOLIO`}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:`cfi-portfolio`,className:y,children:`Total Invested ($)`}),(0,A.jsx)(`input`,{id:`cfi-portfolio`,type:`number`,min:`0`,step:`1000`,placeholder:`150000`,value:r,onChange:e=>_(`portfolio`,i,e.target.value),className:v}),e?(0,A.jsx)(`p`,{className:`text-xs text-emerald/60 mt-1 font-mono`,children:`Pre-filled from your Nexus portfolio`}):null]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-3`,children:`RETIREMENT EXPENSES`}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:`cfi-expenses`,className:y,children:`Annual Retirement Expenses ($)`}),(0,A.jsx)(`input`,{id:`cfi-expenses`,type:`number`,min:`0`,step:`1000`,placeholder:`40000`,value:a,onChange:e=>_(`annualExpenses`,o,e.target.value),className:v}),t?(0,A.jsx)(`p`,{className:`text-xs text-emerald/60 mt-1 font-mono`,children:`Pre-filled from your monthly burn rate`}):null]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-3`,children:`TIMELINE`}),(0,A.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:`cfi-current-age`,className:y,children:`Current Age`}),(0,A.jsx)(`input`,{id:`cfi-current-age`,type:`number`,min:`18`,max:`100`,placeholder:`30`,value:s,onChange:e=>_(`currentAge`,c,e.target.value),className:v})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:`cfi-retirement-age`,className:y,children:`Target Retirement Age`}),(0,A.jsx)(`input`,{id:`cfi-retirement-age`,type:`number`,min:`18`,max:`100`,placeholder:`55`,value:l,onCh
1ange:e=>_(`retirementAge`,u,e.target.value),className:v})]})]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-3`,children:`ASSUMPTIONS`}),(0,A.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:`cfi-return`,className:y,children:`Annual Return (%)`}),(0,A.jsx)(`input`,{id:`cfi-return`,type:`number`,min:`0`,max:`20`,step:`0.5`,placeholder:`7`,value:d,onChange:e=>_(`returnRate`,f,e.target.value),className:v})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:`cfi-swr`,className:y,children:`Safe Withdrawal Rate (%)`}),(0,A.jsx)(`input`,{id:`cfi-swr`,type:`number`,min:`1`,max:`10`,step:`0.25`,placeholder:`4`,value:p,onChange:e=>_(`swr`,m,e.target.value),className:v})]})]})]})]})}function X(e){return(e/100).toLocaleString(`en-US`,{style:`currency`,currency:`USD`})}function Ae({result:e}){return e?(0,A.jsxs)(`div`,{className:`bg-void border-2 border-white/10 p-6 shadow-[4px_4px_0_0_#FFB000] space-y-6`,children:[e.isCoasting?(0,A.jsxs)(`div`,{className:`border-2 border-emerald bg-emerald/10 p-6 text-center`,children:[(0,A.jsx)(`p`,{className:`text-4xl font-mono font-bold text-emerald`,children:`YOU ARE COASTING`}),(0,A.jsx)(`p`,{className:`text-sm text-gray-400 font-mono mt-2`,children:`Your portfolio will grow to your FI number without additional contributions`})]}):(0,A.jsxs)(`div`,{className:`border-2 border-amber-500 bg-amber-500/10 p-6 text-center`,children:[(0,A.jsx)(`p`,{className:`text-4xl font-mono font-bold text-amber-400`,children:`NOT YET`}),(0,A.jsx)(`p`,{className:`text-sm text-gray-400 font-mono mt-2`,children:`Keep contributing — you are building momentum`})]}),(0,A.jsxs)(`div`,{className:`text-center`,children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-2`,children:`COAST FI NUMBER`}),(0,A.jsx)(`p`,{className:`text-3xl font-mono font-bold text-white`,children:X(e.coastNumberCents)}),(0,A.jsx)(`p`,{className:`text-xs text-gray-500 font-mono mt-1`,children:`Amount needed today to coast to FI`})]}),(0,A.jsx)(`div`,{className:`border-t border-white/10`}),!e.isCoasting&&(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`bg-rose/10 border-2 border-rose/30 p-4`,children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-1`,children:`THE GAP`}),(0,A.jsx)(`p`,{className:`text-2xl font-mono font-bold text-rose`,children:X(e.gapCents)}),(0,A.jsx)(`p`,{className:`text-xs text-gray-500 mt-1`,children:`Additional amount needed to reach Coast FI`})]}),(0,A.jsxs)(`div`,{className:`bg-amber-500/10 border-2 border-amber-500/30 p-4`,children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-1`,children:`MONTHLY CONTRIBUTION NEEDED`}),(0,A.jsx)(`p`,{className:`text-2xl font-mono font-bold text-amber-400`,children:X(e.monthlyContributionNeededCents)}),(0,A.jsx)(`p`,{className:`text-xs text-gray-500 mt-1`,children:`Invest this monthly to reach Coast FI`})]}),e.yearsToCoast>0&&(0,A.jsxs)(`div`,{className:`bg-white/5 border-2 border-white/10 p-4`,children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-1`,children:`YEARS TO COAST`}),(0,A.jsxs)(`p`,{className:`text-2xl font-mono font-bold text-white`,children:[e.yearsToCoast,` `,(0,A.jsx)(`span`,{className:`text-sm text-gray-400`,children:e.yearsToCoast===1?`year`:`years`})]}),(0,A.jsx)(`p`,{className:`text-xs text-gray-500 mt-1`,children:`At the recommended monthly contribution`})]})]}),(0,A.jsx)(`div`,{className:`flex justify-end`,children:(0,A.jsx)(i,{to:`/finance/max-fi`,variant:`outline`,accent:`amber`,size:`sm`,children:`FULL FI PROJECTION →`})})]}):(0,A.jsx)(`div`,{className:`bg-void border-2 border-white/10 p-6 shadow-[4px_4px_0_0_#FFB000]`,children:(0,A.jsx)(`p`,{className:`text-gray-500 font-mono text-center py-8`,children:`Enter your details to check your Coast FI status`})})}function je({onChange:e}){let[t,n]=(0,g.useState)(``),[r,i]=(0,g.useState)(``),[a,o]=(0,g.useState)(``),[s,c]=(0,g.useState)(``),[l,u]=(0,g.useState)(``),[d,f]=(0,g.useState)(`7`),p=(0,g.useCallback)((n={})=>{let i={currentAge:n.currentAge??t,retirementAge:n.retirementAge??r,contribution:n.contribution??a,currentBracket:n.currentBracket??s,retirementBracket:n.retirementBracket??l,returnRate:n.returnRate??d},o=Number(i.currentAge),c=Number(i.retirementAge),u=Number(i.contribution),f=Number(i.currentBracket),p=Number(i.retirementBracket),m=Number(i.returnRate);if(!o||o<18||o>100||!c||c<=o||!u||u<=0||f<0||f>60||p<0||p>60){e(null);return}e(oe(o,c,Math.round(u*100),f,p,m))},[t,r,a,s,l,d,e]);function m(e,t,n){t(n),p({[e]:n})}let h=`bg-void border-2 border-white/10 text-white px-3 py-2 font-mono focus:border-amber focus:outline-none w-full`,_=`text-xs font-mono uppercase tracking-wider text-gray-400`;return(0,A.jsxs)(`div`,{className:`bg-void border-2 border-white/10 p-6 shadow-[4px_4px_0_0_#FFB000] space-y-6`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-3`,children:`TIMELINE`}),(0,A.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:`rvt-current-age`,className:_,children:`Current Age`}),(0,A.jsx)(`input`,{id:`rvt-current-age`,type:`number`,min:`18`,max:`100`,placeholder:`30`,value:t,onChange:e=>m(`currentAge`,n,e.target.value),className:h})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:`rvt-retirement-age`,className:_,children:`Retirement Age`}),(0,A.jsx)(`input`,{id:`rvt-retirement-age`,type:`number`,min:`18`,max:`100`,placeholder:`60`,value:r,onChange:e=>m(`retirementAge`,i,e.target.value),className:h})]})]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-3`,children:`CONTRIBUTION`}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:`rvt-contribution`,className:_,children:`Annual Contribution ($)`}),(0,A.jsx)(`input`,{id:`rvt-contribution`,type:`number`,min:`0`,step:`500`,placeholder:`7000`,value:a,onChange:e=>m(`contribution`,o,e.target.value),className:h})]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-3`,children:`TAX BRACKETS`}),(0,A.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:`rvt-current-bracket`,className:_,children:`Current Bracket (%)`}),(0,A.jsx)(`input`,{id:`rvt-current-bracket`,type:`number`,min:`0`,max:`60`,step:`1`,placeholder:`22`,value:s,onChange:e=>m(`currentBracket`,c,e.target.value),className:h})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:`rvt-retirement-bracket`,className:_,children:`Retirement Bracket (%)`}),(0,A.jsx)(`input`,{id:`rvt-retirement-bracket`,type:`number`,min:`0`,max:`60`,step:`1`,placeholder:`12`,value:l,onCh
1ange:e=>m(`retirementBracket`,u,e.target.value),className:h})]})]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-3`,children:`GROWTH`}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:`rvt-return`,className:_,children:`Expected Annual Return (%)`}),(0,A.jsx)(`input`,{id:`rvt-return`,type:`number`,min:`0`,max:`20`,step:`0.5`,placeholder:`7`,value:d,onChange:e=>m(`returnRate`,f,e.target.value),className:h})]})]})]})}function Z(e){return(e/100).toLocaleString(`en-US`,{style:`currency`,currency:`USD`})}function Me({result:e}){if(!e)return(0,A.jsx)(`div`,{className:`bg-void border-2 border-white/10 p-6 shadow-[4px_4px_0_0_#FFB000]`,children:(0,A.jsx)(`p`,{className:`text-gray-500 font-mono text-center py-8`,children:`Enter your details to compare`})});let t=e.winner===`roth`?`ROTH`:e.winner===`traditional`?`TRADITIONAL`:`TIE`,n=e.winner===`roth`?e.rothFutureValueCents-e.tradAfterTaxCents:e.winner===`traditional`?e.tradAfterTaxCents-e.rothFutureValueCents:0;return(0,A.jsxs)(`div`,{className:`bg-void border-2 border-white/10 p-6 shadow-[4px_4px_0_0_#FFB000] space-y-6`,children:[(0,A.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,A.jsxs)(`div`,{className:`text-center`,children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-2`,children:`ROTH (TAX-FREE)`}),(0,A.jsx)(`p`,{className:`text-3xl font-mono font-bold text-emerald`,children:Z(e.rothFutureValueCents)})]}),(0,A.jsxs)(`div`,{className:`text-center`,children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-2`,children:`TRADITIONAL (AFTER TAX)`}),(0,A.jsx)(`p`,{className:`text-3xl font-mono font-bold text-amber-400`,children:Z(e.tradAfterTaxCe
1nts)})]})]}),(0,A.jsx)(`div`,{className:`border-t border-white/10`}),e.projections.length>0&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-3`,children:`PROJECTION BY DECADE`}),(0,A.jsx)(`div`,{className:`overflow-x-auto`,children:(0,A.jsxs)(`table`,{className:`w-full text-sm font-mono`,children:[(0,A.jsx)(`thead`,{children:(0,A.jsxs)(`tr`,{className:`border-b border-white/10`,children:[(0,A.jsx)(`th`,{className:`text-left text-gray-400 text-xs uppercase py-2 pr-4`,children:`Year`}),(0,A.jsx)(`th`,{className:`text-right text-gray-400 text-xs uppercase py-2 pr-4`,children:`Roth`}),(0,A.jsx)(`th`,{className:`text-right text-gray-400 text-xs uppercase py-2 pr-4`,children:`Trad (pre-tax)`}),(0,A.jsx)(`th`,{className:`text-right text-gray-400 text-xs uppercase py-2`,children:`Trad (after tax)`})]})}),(0,A.jsx)(`tbody`,{children:e.projections.map(e=>(0,A.jsxs)(`tr`,{className:`border-b border-white/5`,children:[(0,A.jsxs)(`td`,{className:`py-2 pr-4 text-white`,children:[e.year,`yr`]}),(0,A.jsx)(`td`,{className:`py-2 pr-4 text-right text-emerald`,children:Z(e.rothCents)}),(0,A.jsx)(`td`,{className:`py-2 pr-4 text-right text-white`,children:Z(e.tradCents)}),(0,A.jsx)(`td`,{className:`py-2 text-right text-amber-400`,children:Z(e.tradAfterTaxCe
1nts)})]},e.year))})]})})]}),(0,A.jsx)(`div`,{className:`border-t border-white/10`}),(0,A.jsxs)(`div`,{className:`bg-white/5 border-2 border-white/10 p-4`,children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-1`,children:`BREAKEVEN BRACKET`}),(0,A.jsxs)(`p`,{className:`text-sm font-mono text-white`,children:[`Roth wins if your retirement bracket is above`,` `,(0,A.jsxs)(`span`,{className:`text-amber-400 font-bold`,children:[e.breakevenBracketPct,`%`]})]})]}),(0,A.jsxs)(`div`,{className:`border-2 p-4 ${e.winner===`roth`?`border-emerald bg-emerald/10`:e.winner===`traditional`?`border-amber-500 bg-amber-500/10`:`border-white/30 bg-white/5`}`,children:[(0,A.jsx)(`p`,{className:`text-xs font-mono uppercase tracking-wider text-gray-400 mb-1`,children:`RECOMMENDATION`}),e.winner===`tie`?(0,A.jsx)(`p`,{className:`text-xl font-mono font-bold text-white`,children:`It's a tie at your current brackets`}):(0,A.jsxs)(`p`,{className:`text-xl font-mono font-bold text-white`,children:[`At your inputs,`,` `,(0,A.jsx)(`span`,{className:e.winner===`roth`?`text-emerald`:`text-amber-400`,children:t}),` `,`wins by `,Z(n)]})]}),(0,A.jsx)(`div`,{className:`flex justify-end`,children:(0,A.jsx)(i,{to:`/freedom/ladder`,variant:`outline`,accent:`amber`,size:`sm`,children:`SEE ROTH LADDER →`})})]})}function Q({children:e}){return(0,A.jsx)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-6`,children:e})}function Ne({slug:e,onRun:t}){let[n,r]=(0,g.useState)(null);return(0,A.jsxs)(Q,{children:[(0,A.jsx)(se,{onChange:n=>{r(n),n&&t?.(e)}}),(0,A.jsx)(ce,{result:n})]})}function Pe({slug:e,onRun:t}){let[n,r]=(0,g.useState)(null);return(0,A.jsxs)(Q,{children:[(0,A.jsx)(ue,{onChange:n=>{r(n),n&&t?.(e)}}),(0,A.jsx)(de,{result:n})]})}function $({slug:e,onRun:t}){let[n,r]=(0,g.useState)(null);return(0,A.jsxs)(Q,{children:[(0,A.jsx)(fe,{onChange:n=>{r(n),n&&t?.(e)}}),(0,A.jsx)(F,{result:n})]})}function Fe({slug:e,onRun:t}){let[n,r]=(0,g.useState)(null);return(0,A.jsxs)(Q,{children:[(0,A.jsx)(R,{onChange:n=>{r(n),n&&t?.(e)}}),(0,A.jsx)(B,{result:n})]})}function Ie({slug:e,prefill:t,onRun:n}){let[r,i]=(0,g.useState)(null);return(0,A.jsxs)(Q,{children:[(0,A.jsx)(pe,{prefill:t?.incomeCents,onChange:t=>{i(t),t&&n?.(e)}}),(0,A.jsx)(me,{result:r})]})}function Le({slug:e,onRun:t}){let[n,r]=(0,g.useState)(null);return(0,A.jsxs)(Q,{children:[(0,A.jsx)(be,{onChange:n=>{r(n),n&&t?.(e)}}),(0,A.jsx)(xe,{result:n})]})}function Re({slug:e,prefill:t,onRun:n}){let[r,i]=(0,g.useState)(null);return(0,A.jsxs)(Q,{children:[(0,A.jsx)(ke,{prefilledPortfolioCents:t?.portfolioCents,prefilledMonthlyBurnCents:t?.monthlyBurnCents,onChange:t=>{i(t),t&&n?.(e)}}),(0,A.jsx)(Ae,{result:r})]})}function ze({slug:e,onRun:t}){let[n,r]=(0,g.useState)(null);return(0,A.jsxs)(Q,{children:[(0,A.jsx)(je,{onChange:n=>{r(n),n&&t?.(e)}}),(0,A.jsx)(Me,{result:n})]})}function Be({slug:e,prefill:t,onRun:n}){let r=t?.debts??[],[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(0),[c,l]=(0,g.useState)(`avalanche`),[u,d]=(0,g.useState)(null),f=i?(()=>{let e=i[c];return{months:Math.max(...e.map(e=>e.totalMonths),0),interest:e.reduce((e,t)=>e+t.totalInterestCents,0)}})():null;return(0,A.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-6`,children:[(0,A.jsx)(`div`,{children:(0,A.jsx)(Ce,{initialDebts:r,onCalculate:(0,g.useCallback)((t,r,i)=>{if(a({avalanche:x(t,r),snowball:S(t,r),hybrid:C(t,r)}),s(r),l(i),r>0){let e={avalanche:x,snowball:S,hybrid:C}[i](t,0);d({months:Math.max(...e.map(e=>e.totalMonths),0),interest:e.reduce((e,t)=>e+t.totalInterestCents,0)})}else d(null);n?.(e)},[n,e])})}),(0,A.jsx)(`div`,{className:`space-y-6`,children:i?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Ee,{results:i}),(0,A.jsx)(De,{results:i}),u&&f&&(0,A.jsx)(Oe,{baselineMonths:u.months,baselineInterest:u.interest,o
1ptimizedMonths:f.months,optimizedInterest:f.interest,extraPayment:o})]}):(0,A.jsx)(`div`,{className:`bg-void border-2 border-white/10 p-6 flex items-center justify-center min-h-[300px]`,children:(0,A.jsx)(`p`,{className:`text-gray-500 font-mono text-sm text-center`,children:`Enter your debts and hit CALCULATE`})})})]})}var Ve={"hourly-rate":Ne,"automation-roi":Pe,"true-cost":$,"401k-optimizer":Fe,"tax-bracket":Ie,"health-insurance":Le,"coast-fi":Re,"roth-vs-trad":ze,"debt-destroyer":Be};function He({name:e,routePath:t}){return(0,A.jsxs)(`div`,{className:`bg-panel border-2 border-white/10 p-6 space-y-3`,children:[(0,A.jsxs)(`p`,{className:`text-gray-400 font-mono text-sm`,children:[e,` isn't available as an inline embed.`]}),(0,A.jsxs)(i,{to:t,variant:`outline`,accent:`emerald`,children:[`Open the full `,e,` →`]})]})}function Ue({slug:e}){return(0,A.jsx)(`div`,{className:`bg-panel border-2 border-rose/40 p-6`,children:(0,A.jsxs)(`p`,{className:`text-gray-400 font-mono text-sm`,children:[`Calculator not found:`,` `,(0,A.jsx)(`span`,{className:`text-rose`,children:e})]})})}function We({slug:e,prefill:t,onRun:r}){let i=p[e],a=n(),o=(0,g.useRef)(new Set),s=(0,g.useCallback)(e=>{o.current.has(e)||(o.current.add(e),a.submit({slug:e},{method:`post`,action:`/calculators/run`})),r?.(e)},[a,r]);if(!i)return(0,A.jsx)(Ue,{slug:e});let c=Ve[e];return!i.embeddable||!c?(0,A.jsx)(He,{name:i.name,routePath:i.routePath}):(0,A.jsx)(c,{slug:e,prefill:t,onRun:s})}export{We as t};

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.