import{j as e}from"./ui-vendor-BxIDIFnU.js";import{i as s,r as a,L as t}from"./react-vendor-0XwOhuTY.js";import{t as i,H as l,a as n,h as r,i as d,j as c,k as o,l as m,m as x,b as u,c as h,d as v,e as j,f as p,L as f,B as N,I as g,D as b,M as y,n as w,A as C,o as M,p as S,q as k,F as $,r as R}from"./index-CK9GMtDj.js";import{S as F}from"./slider-AQe2EKXK.js";import"./chart-vendor-H_zCtd_i.js";const L=()=>{const[L]=s(),[A,B]=a.useState(L.get("usecase")||"alpr"),[I,E]=a.useState(5e3),[P,O]=a.useState(15),[V,H]=a.useState(50),[U,Y]=a.useState(5),[_,D]=a.useState(45),[z,q]=a.useState(75e3),[T,G]=a.useState(3e3),[J,K]=a.useState("expected"),Q={alpr:"ALPR",ppe:"PPE Compliance",occupancy:"Occupancy Monitoring"},W=a.useMemo(()=>{const e=I*(P/100)*12*V,s=12*I*U/60*_,a=(e+s)*("conservative"===J?.7:"expected"===J?1:1.3),t=z+12*T,i=(a-t)/t*100,l=a-t,n=z/Math.max((a-12*T)/12,1);return{paybackMonths:Math.max(n,0),netBenefit:l,roi:i,benefits:a,costs:t,revenueUplift:e,reviewerCost:s}},[I,P,V,U,_,z,T,J,A]);a.useEffect(()=>{I>0&&P>0&&i({scenario:"cv",roi_pct:Math.round(100*W.roi)/100,payback_months:Math.round(10*W.paybackMonths)/10,npv_3yr:Math.round(W.netBenefit)})},[W.roi,W.paybackMonths,W.netBenefit,I,P]);return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsxs(l,{children:[e.jsx("title",{children:"Computer Vision ROI Calculator | Allerin"}),e.jsx("meta",{name:"description",content:"Calculate Year-1 ROI and payback for computer vision projects including ALPR, PPE compliance, and occupancy monitoring."})]}),e.jsx(n,{}),e.jsx("main",{className:"py-8 md:py-12",children:e.jsxs("div",{className:"container max-w-6xl",children:[e.jsx(r,{className:"mb-6",children:e.jsxs(d,{children:[e.jsx(c,{children:e.jsx(o,{asChild:!0,children:e.jsx(t,{to:"/",children:"Home"})})}),e.jsx(m,{}),e.jsx(c,{children:e.jsx(o,{asChild:!0,children:e.jsx(t,{to:"/roi-calculator",children:"ROI Calculator"})})}),e.jsx(m,{}),e.jsx(x,{children:"Computer Vision"})]})}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-3xl md:text-4xl font-bold mb-2",children:"Computer Vision ROI Estimate"}),e.jsx("p",{className:"text-muted-foreground",children:"Calculate revenue uplift and operational savings from vision AI."})]}),e.jsxs("div",{className:"grid lg:grid-cols-2 gap-8",children:[e.jsxs(u,{children:[e.jsxs(h,{children:[e.jsx(v,{children:"Your Inputs"}),e.jsx(j,{children:"Adjust values to match your environment"})]}),e.jsxs(p,{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{children:"Use Case"}),e.jsx("div",{className:"flex gap-2",children:Object.entries(Q).map(([s,a])=>e.jsx(N,{variant:A===s?"default":"outline",size:"sm",onClick:()=>B(s),className:"flex-1",children:a},s))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"events",children:"Baseline events per month"}),e.jsx(g,{id:"events",type:"number",value:I,onChange:e=>E(Number(e.target.value))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Citations, inspections, or detections"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs(f,{htmlFor:"uplift",children:["Uplift (%): ",P]}),e.jsx(F,{id:"uplift",min:0,max:50,step:5,value:[P],onValueChange:e=>O(e[0])})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"value",children:"Avg value per event ($)"}),e.jsx(g,{id:"value",type:"number",value:V,onChange:e=>H(Number(e.target.value))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"reviewer",children:"Reviewer minutes per event"}),e.jsx(g,{id:"reviewer",type:"number",value:U,onChange:e=>Y(Number(e.target.value))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"hourly",children:"Hourly rate ($)"}),e.jsx(g,{id:"hourly",type:"number",value:_,onChange:e=>D(Number(e.target.value))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"hardware",children:"Hardware + install (one-time, $)"}),e.jsx(g,{id:"hardware",type:"number",value:z,onChange:e=>q(Number(e.target.value))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"software",children:"Software + ops per month ($)"}),e.jsx(g,{id:"software",type:"number",value:T,onChange:e=>G(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:J===s.value?"default":"outline",size:"sm",onClick:()=>K(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(u,{children:[e.jsx(h,{children:e.jsx(v,{children:"Year-1 Results"})}),e.jsxs(p,{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:[W.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(W.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:[W.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:W.costs/Math.max(W.benefits,W.costs)*100+"%"}}),e.jsxs("span",{className:"absolute inset-0 flex items-center px-2 text-xs font-medium",children:["$",Math.round(W.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:W.benefits/Math.max(W.benefits,W.costs)*100+"%"}}),e.jsxs("span",{className:"absolute inset-0 flex items-center px-2 text-xs font-medium",children:["$",Math.round(W.benefits).toLocaleString()]})]})]})]})]})]})]}),e.jsxs(u,{children:[e.jsx(h,{children:e.jsx(v,{children:"Actions"})}),e.jsxs(p,{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(b,{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:()=>{R({scenario:"cv",roi_pct:Math.round(100*W.roi)/100,payback_months:Math.round(10*W.paybackMonths)/10}),window.location.href=`mailto:[email protected]?subject=ROI Consult: Computer Vision (${Q[A]})`},variant:"outline",className:"w-full justify-start",children:[e.jsx(w,{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(S,{children:"View all assumptions"}),e.jsx(k,{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:"Use case:"}),e.jsx("div",{className:"font-medium",children:Q[A]}),e.jsx("div",{className:"text-muted-foreground",children:"Events/month:"}),e.jsx("div",{className:"font-medium",children:I.toLocaleString()}),e.jsx("div",{className:"text-muted-foreground",children:"Uplift:"}),e.jsxs("div",{className:"font-medium",children:[P,"%"]}),e.jsx("div",{className:"text-muted-foreground",children:"Value/event:"}),e.jsxs("div",{className:"font-medium",children:["$",V]}),e.jsx("div",{className:"text-muted-foreground",children:"Revenue uplift (Y1):"}),e.jsxs("div",{className:"font-medium",children:["$",Math.round(W.revenueUplift).toLocaleString()]}),e.jsx("div",{className:"text-muted-foreground",children:"Reviewer min/event:"}),e.jsx("div",{className:"font-medium",children:U}),e.jsx("div",{className:"text-muted-foreground",children:"Hourly rate:"}),e.jsxs("div",{className:"font-medium",children:["$",_]}),e.jsx("div",{className:"text-muted-foreground",children:"Reviewer savings (Y1):"}),e.jsxs("div",{className:"font-medium",children:["$",Math.round(W.reviewerCost).toLocaleString()]}),e.jsx("div",{className:"text-muted-foreground",children:"Hardware+install:"}),e.jsxs("div",{className:"font-medium",children:["$",z.toLocaleString()]}),e.jsx("div",{className:"text-muted-foreground",children:"Software/mo:"}),e.jsxs("div",{className:"font-medium",children:["$",T.toLocaleString()]}),e.jsx("div",{className:"text-muted-foreground",children:"Confidence:"}),e.jsx("div",{className:"font-medium capitalize",children:J})]})})]})}),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($,{})]})};export{L as default};