"use strict";exports.id=4570,exports.ids=[4570],exports.modules={84570:(a,b,c)=>{c.d(b,{generateRoiSlide:()=>f});let d={EUR:"€",USD:"$",GBP:"\xa3"};function e(a,b){return a>=1e6?`${b}${(a/1e6).toFixed(1)}M`:a>=1e3?`${b}${Math.round(a/1e3)}k`:`${b}${Math.round(a)}`}async function f(a){let b,c,f,g,h,i,{roiEstimate:j,organizationName:k,currency:l,llm:m}=a;try{let a,b=await m.complete({systemPrompt:"You are a VP of Engineering creating a concise, business-value-focused presentation for C-suite audiences. Generate ONLY valid JSON — no markdown fences, no prose outside the JSON object.",messages:[{role:"user",content:(a=d[l]??"€",`Generate a 6-slide executive ROI presentation for ${k??"the organization"}.

## ROI Data
Current grade: ${j.currentGrade} (score ${j.currentScore}/100)
Target grade: ${j.targetGrade} (score ${j.targetScore}/100)
Monthly maintenance cost: ${a}${j.maintenanceCostPerMonth.toLocaleString()}
Annual maintenance cost: ${a}${j.maintenanceCostPerYear.toLocaleString()}
Monthly savings if improved: ${a}${j.savedCostPerMonth.toLocaleString()}
Annual savings if improved: ${a}${j.savedCostPerYear.toLocaleString()}
ROI multiple: ${j.roiMultiple}x
Break-even: ${j.breakEvenMonths} months
Remediation days: ${j.estimatedRemediationDays}

## Pain sources
Import cycles: ${j.breakdown.importCycles.count} cycles, ${j.breakdown.importCycles.hoursPerMonth}h/mo, ${a}${j.breakdown.importCycles.cost.toLocaleString()}/mo
Doc drift: ${j.breakdown.documentationDrift.count} drifted, ${j.breakdown.documentationDrift.hoursPerMonth}h/mo, ${a}${j.breakdown.documentationDrift.cost.toLocaleString()}/mo
High churn: ${j.breakdown.highChurnFiles.count} files, ${j.breakdown.highChurnFiles.hoursPerMonth}h/mo, ${a}${j.breakdown.highChurnFiles.cost.toLocaleString()}/mo
Orphaned: ${j.breakdown.orphanedCode.count} capabilities, ${j.breakdown.orphanedCode.hoursPerMonth}h/mo, ${a}${j.breakdown.orphanedCode.cost.toLocaleString()}/mo

## Output Format
Return a single JSON object:
{
  "title": "<deck title>",
  "slides": [
    { "type": "<title|problem|cost-breakdown|scenarios|recommendation|cta>", "title": "...", "content": "...", "highlight": "...", "highlightLabel": "...", "bullets": ["..."] }
  ],
  "executiveSummary": "<3-bullet summary separated by \\n>",
  "oneLinePitch": "<one sentence for email subject line>"
}
Rules: exactly 6 slides in order: title, problem, cost-breakdown, scenarios, recommendation, cta. Return ONLY valid JSON.`)}],maxTokens:3e3}),c=function(a){let b=a.trim();b.startsWith("```")&&(b=b.replace(/^```(?:json)?\n?/,"").replace(/\n?```$/,"").trim());try{let a=JSON.parse(b),c=Array.isArray(a.slides)?a.slides:[];if(0===c.length)return null;let d=["title","problem","cost-breakdown","scenarios","recommendation","cta"],e=c.map((a,b)=>{let c=a??{},e="string"==typeof c.type&&d.includes(c.type)?c.type:d[b]??"recommendation",f=Array.isArray(c.bullets)?c.bullets.filter(a=>"string"==typeof a).slice(0,4):void 0;return{type:e,title:"string"==typeof c.title?c.title:`Slide ${b+1}`,content:"string"==typeof c.content?c.content:"",..."string"==typeof c.highlight&&c.highlight?{highlight:c.highlight}:{},..."string"==typeof c.highlightLabel&&c.highlightLabel?{highlightLabel:c.highlightLabel}:{},...f&&f.length>0?{bullets:f}:{}}});return{title:"string"==typeof a.title?a.title:"Technical Debt ROI",slides:e,executiveSummary:"string"==typeof a.executiveSummary?a.executiveSummary:"",oneLinePitch:"string"==typeof a.oneLinePitch?a.oneLinePitch:""}}catch{return null}}(b.content);if(c)return c}catch{}return b=d[l]??"€",c=k??"Your Organization",f=e(j.maintenanceCostPerYear,b),g=e(j.savedCostPerYear,b),h=e(j.savedCostPerMonth,b),i=[{type:"title",title:"Technical Debt Cost Analysis",content:`${c} \xb7 Architecture Health Report \xb7 ${new Date().toLocaleDateString("en-GB",{month:"long",year:"numeric"})}`,highlight:j.currentGrade,highlightLabel:"Current Architecture Grade"},{type:"problem",title:"The Hidden Cost of Architecture Debt",content:`Your codebase currently has grade ${j.currentGrade} (${j.currentScore}/100). This translates directly to developer time lost to maintenance overhead every month.`,highlight:e(j.maintenanceCostPerMonth,b),highlightLabel:"Estimated monthly maintenance cost",bullets:[`Import cycles: ${j.breakdown.importCycles.count} cycles — ${j.breakdown.importCycles.hoursPerMonth}h/mo in debugging`,`Documentation drift: ${j.breakdown.documentationDrift.count} drifted capabilities — ${j.breakdown.documentationDrift.hoursPerMonth}h/mo`,`High-churn files: ${j.breakdown.highChurnFiles.count} hot files — ${j.breakdown.highChurnFiles.hoursPerMonth}h/mo in review overhead`,`Orphaned capabilities: ${j.breakdown.orphanedCode.count} untracked modules — ${j.breakdown.orphanedCode.hoursPerMonth}h/mo`]},{type:"cost-breakdown",title:"Where Developer Time Goes",content:`Total: ${j.estimatedMaintenanceHoursPerMonth}h/month in maintenance overhead = ${f}/year at current state`,bullets:[`Import cycles → ${e(j.breakdown.importCycles.cost,b)}/mo (${j.breakdown.importCycles.hoursPerMonth}h debugging)`,`Doc drift → ${e(j.breakdown.documentationDrift.cost,b)}/mo (${j.breakdown.documentationDrift.hoursPerMonth}h searching context)`,`Churn overhead → ${e(j.breakdown.highChurnFiles.cost,b)}/mo (${j.breakdown.highChurnFiles.hoursPerMonth}h in review)`,`Orphaned code → ${e(j.breakdown.orphanedCode.cost,b)}/mo (${j.breakdown.orphanedCode.hoursPerMonth}h ownership gaps)`]},{type:"scenarios",title:"What Reaching Grade B Saves",content:`Moving from ${j.currentGrade} to ${j.targetGrade} cuts maintenance overhead by ~${Math.round(j.savedCostPerMonth/Math.max(j.maintenanceCostPerMonth,1)*100)}%.`,highlight:g,highlightLabel:`Annual savings at grade ${j.targetGrade}`,bullets:[`Monthly savings: ${h}/mo`,`ROI multiple: ${j.roiMultiple}\xd7 return on remediation investment`,`Break-even: ~${j.breakEvenMonths<1?`${Math.round(30*j.breakEvenMonths)} days`:`${j.breakEvenMonths} months`}`,`Remediation effort: ~${j.estimatedRemediationDays} engineering days`]},{type:"recommendation",title:"Recommended Remediation Path",content:j.recommendation,bullets:[`Step 1: Resolve ${j.breakdown.importCycles.count} import cycles (est. ${Math.round(.4*j.estimatedRemediationDays)} days)`,`Step 2: Fix ${j.breakdown.documentationDrift.count} drifted capability docs (est. ${Math.round(.3*j.estimatedRemediationDays)} days)`,`Step 3: Assign ownership for ${j.breakdown.orphanedCode.count} orphaned capabilities (est. ${Math.round(.2*j.estimatedRemediationDays)} days)`,`Step 4: Add coverage to top churn files (est. ${Math.round(.1*j.estimatedRemediationDays)} days)`]},{type:"cta",title:`Approve ${new Date().toLocaleString("default",{month:"short"})} Refactoring Budget`,content:`Investment: ~${e(8*j.estimatedRemediationDays*150,b)} (${j.estimatedRemediationDays} days of engineering effort)
Return: ${g}/year in recovered developer capacity`,highlight:`${j.roiMultiple}\xd7`,highlightLabel:"ROI multiple",bullets:[`${g}/year recurring savings`,`Break-even in ${j.breakEvenMonths<1?`${Math.round(30*j.breakEvenMonths)} days`:`${j.breakEvenMonths} months`}`,`Measurable via PRISM architecture grade (${j.currentGrade} → ${j.targetGrade})`]}],{title:`Technical Debt ROI — ${c}`,slides:i,executiveSummary:`• Current architecture grade ${j.currentGrade} (${j.currentScore}/100) costs ~${f}/year in maintenance overhead.
• Improving to grade ${j.targetGrade} saves ~${g}/year — ${j.roiMultiple}\xd7 return on a ${j.estimatedRemediationDays}-day remediation effort.
• Break-even: ~${j.breakEvenMonths<1?`${Math.round(30*j.breakEvenMonths)} days`:`${j.breakEvenMonths} months`}. Primary sources: ${j.breakdown.importCycles.count} import cycles, ${j.breakdown.documentationDrift.count} drifted docs, ${j.breakdown.orphanedCode.count} orphaned capabilities.`,oneLinePitch:`Moving from ${j.currentGrade} to ${j.targetGrade} saves ${g} annually — ${j.roiMultiple}\xd7 ROI on a ${j.estimatedRemediationDays}-day investment.`}}}};