import{j as e}from"./ui-vendor-BxIDIFnU.js";import{r as s,L as a}from"./react-vendor-0XwOhuTY.js";import{t,H as i,a as r,h as l,i as n,j as d,k as c,l as o,m,b as x,c as u,d as h,e as j,f as v,L as f,I as p,B as N,D as g,M as y,n as b,A as C,o as M,p as w,q as S,F as k,r as $}from"./index-CK9GMtDj.js";import{S as F}from"./slider-AQe2EKXK.js";import"./chart-vendor-H_zCtd_i.js";const I=()=>{const[I,L]=s.useState(15e3),[R,z]=s.useState(30),[B,D]=s.useState(800),[O,P]=s.useState(25),[A,E]=s.useState(75),[Y,V]=s.useState(15e4),[_,H]=s.useState(10500),[q,T]=s.useState("expected"),G=s.useMemo(()=>{const e=12*(I-_),s=B*(O/100)*A*12,a=(e+s)*("conservative"===q?.7:"expected"===q?1:1.3),t=Y+12*_,i=(a-t)/t*100,r=a-t,l=Y/Math.max((a-12*_)/12,1);return{paybackMonths:Math.max(l,0),netBenefit:r,roi:i,benefits:a,costs:t,infraSavings:e,devProductivity:s}},[I,R,B,O,A,Y,_,q]);s.useEffect(()=>{I>0&&B>0&&t({scenario:"modernization",roi_pct:Math.round(100*G.roi)/100,payback_months:Math.round(10*G.paybackMonths)/10,npv_3yr:Math.round(G.netBenefit)})},[G.roi,G.paybackMonths,G.netBenefit,I,B]);return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsxs(i,{children:[e.jsx("title",{children:"Platform Modernization ROI Calculator | Allerin"}),e.jsx("meta",{name:"description",content:"Calculate Year-1 ROI and payback for platform and Rails modernization projects including infrastructure savings and developer velocity."})]}),e.jsx(r,{}),e.jsx("main",{className:"py-8 md:py-12",children:e.jsxs("div",{className:"container max-w-6xl",children:[e.jsx(l,{className:"mb-6",children:e.jsxs(n,{children:[e.jsx(d,{children:e.jsx(c,{asChild:!0,children:e.jsx(a,{to:"/",children:"Home"})})}),e.jsx(o,{}),e.jsx(d,{children:e.jsx(c,{asChild:!0,children:e.jsx(a,{to:"/roi-calculator",children:"ROI Calculator"})})}),e.jsx(o,{}),e.jsx(m,{children:"Modernization"})]})}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-3xl md:text-4xl font-bold mb-2",children:"Platform/Rails Modernization ROI Estimate"}),e.jsx("p",{className:"text-muted-foreground",children:"Calculate infrastructure savings and developer velocity gains."})]}),e.jsxs("div",{className:"grid lg:grid-cols-2 gap-8",children:[e.jsxs(x,{children:[e.jsxs(u,{children:[e.jsx(h,{children:"Your Inputs"}),e.jsx(j,{children:"Adjust values to match your environment"})]}),e.jsxs(v,{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"current",children:"Current infrastructure per month ($)"}),e.jsx(p,{id:"current",type:"number",value:I,onChange:e=>L(Number(e.target.value))})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs(f,{htmlFor:"reduction",children:["Infrastructure reduction (%): ",R]}),e.jsx(F,{id:"reduction",min:0,max:60,step:5,value:[R],onValueChange:e=>{z(e[0]),H(Math.round(I*(1-e[0]/100)))}})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"devhours",children:"Developer hours per month"}),e.jsx(p,{id:"devhours",type:"number",value:B,onChange:e=>D(Number(e.target.value))})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs(f,{htmlFor:"velocity",children:["Velocity gain (%): ",O]}),e.jsx(F,{id:"velocity",min:0,max:50,step:5,value:[O],onValueChange:e=>P(e[0])})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"hourly",children:"Developer hourly rate ($)"}),e.jsx(p,{id:"hourly",type:"number",value:A,onChange:e=>E(Number(e.target.value))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"project",children:"One-time project cost ($)"}),e.jsx(p,{id:"project",type:"number",value:Y,onChange:e=>V(Number(e.target.value))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"new",children:"New infrastructure per month ($)"}),e.jsx(p,{id:"new",type:"number",value:_,onChange:e=>H(Number(e.target.value))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{children:"Confidence level"}),e.jsx("div",{className:"flex gap-2",children:[{value:"conservative",label:"Conservative (0.7×)"},{value:"expected",label:"Expected (1.0×)"},{value:"aggressive",label:"Aggressive (1.3×)"}].map(s=>e.jsx(N,{variant:q===s.value?"default":"outline",size:"sm",onClick:()=>T(s.value),className:"flex-1",children:s.label.split(" ")[0]},s.value))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Conservative = 0.7×, Expected = 1.0×, Aggressive = 1.3× applied to benefits only."})]})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(x,{children:[e.jsx(u,{children:e.jsx(h,{children:"Year-1 Results"})}),e.jsxs(v,{className:"space-y-6",role:"region","aria-live":"polite",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-1",children:"Payback"}),e.jsxs("div",{className:"text-2xl font-bold",children:[G.paybackMonths.toFixed(1)," mo"]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-1",children:"Net Benefit"}),e.jsxs("div",{className:"text-2xl font-bold",children:["$",Math.round(G.netBenefit).toLocaleString()]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-1",children:"ROI"}),e.jsxs("div",{className:"text-2xl font-bold",children:[G.roi.toFixed(0),"%"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:"Costs vs Benefits (Year-1)"}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-20 text-xs text-muted-foreground",children:"Costs"}),e.jsxs("div",{className:"flex-1 h-8 bg-destructive/20 rounded relative overflow-hidden",children:[e.jsx("div",{className:"h-full bg-destructive transition-all",style:{width:G.costs/Math.max(G.benefits,G.costs)*100+"%"}}),e.jsxs("span",{className:"absolute inset-0 flex items-center px-2 text-xs font-medium",children:["$",Math.round(G.costs).toLocaleString()]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-20 text-xs text-muted-foreground",children:"Benefits"}),e.jsxs("div",{className:"flex-1 h-8 bg-primary/20 rounded relative overflow-hidden",children:[e.jsx("div",{className:"h-full bg-primary transition-all",style:{width:G.benefits/Math.max(G.benefits,G.costs)*100+"%"}}),e.jsxs("span",{className:"absolute inset-0 flex items-center px-2 text-xs font-medium",children:["$",Math.round(G.benefits).toLocaleString()]})]})]})]})]})]})]}),e.jsxs(x,{children:[e.jsx(u,{children:e.jsx(h,{children:"Actions"})}),e.jsxs(v,{className:"flex flex-col gap-3",children:[e.jsxs(N,{onClick:()=>{alert("PDF download would trigger here with assumptions + results")},className:"w-full justify-start",children:[e.jsx(g,{className:"mr-2 h-4 w-4"}),"Download PDF"]}),e.jsxs(N,{onClick:()=>{alert("Email form would open here")},variant:"outline",className:"w-full justify-start",children:[e.jsx(y,{className:"mr-2 h-4 w-4"}),"Email me this"]}),e.jsxs(N,{onClick:()=>{$({scenario:"modernization",roi_pct:Math.round(100*G.roi)/100,payback_months:Math.round(10*G.paybackMonths)/10}),window.location.href="mailto:[email protected]?subject=ROI Consult: Platform/Rails Modernization"},variant:"outline",className:"w-full justify-start",children:[e.jsx(b,{className:"mr-2 h-4 w-4"}),"Book 30-min consult"]})]})]}),e.jsx(C,{type:"single",collapsible:!0,children:e.jsxs(M,{value:"assumptions",children:[e.jsx(w,{children:"View all assumptions"}),e.jsx(S,{className:"space-y-2 text-sm",children:e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx("div",{className:"text-muted-foreground",children:"Current infra/mo:"}),e.jsxs("div",{className:"font-medium",children:["$",I.toLocaleString()]}),e.jsx("div",{className:"text-muted-foreground",children:"New infra/mo:"}),e.jsxs("div",{className:"font-medium",children:["$",_.toLocaleString()]}),e.jsx("div",{className:"text-muted-foreground",children:"Reduction:"}),e.jsxs("div",{className:"font-medium",children:[R,"%"]}),e.jsx("div",{className:"text-muted-foreground",children:"Infra savings (Y1):"}),e.jsxs("div",{className:"font-medium",children:["$",Math.round(G.infraSavings).toLocaleString()]}),e.jsx("div",{className:"text-muted-foreground",children:"Dev hours/mo:"}),e.jsx("div",{className:"font-medium",children:B.toLocaleString()}),e.jsx("div",{className:"text-muted-foreground",children:"Velocity gain:"}),e.jsxs("div",{className:"font-medium",children:[O,"%"]}),e.jsx("div",{className:"text-muted-foreground",children:"Hourly rate:"}),e.jsxs("div",{className:"font-medium",children:["$",A]}),e.jsx("div",{className:"text-muted-foreground",children:"Dev productivity (Y1):"}),e.jsxs("div",{className:"font-medium",children:["$",Math.round(G.devProductivity).toLocaleString()]}),e.jsx("div",{className:"text-muted-foreground",children:"One-time project:"}),e.jsxs("div",{className:"font-medium",children:["$",Y.toLocaleString()]}),e.jsx("div",{className:"text-muted-foreground",children:"Confidence:"}),e.jsx("div",{className:"font-medium capitalize",children:q})]})})]})}),e.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"This is an estimate based on provided inputs and industry heuristics. It is not financial advice."})]})]})]})}),e.jsx(k,{})]})};export{I as default};