@threatcaptain/tc-reports 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/components/Dashboard/index.tsx","../src/utils/unifiedDataTransformer.ts","../src/components/Reports/BreachLikelihood.tsx","../src/utils/executiveSummaryTemplates.ts","../src/utils/reportUtils.ts","../src/components/Charts/UnifiedCostBreakdown.tsx","../src/components/Reports/FinancialImpact.tsx","../src/utils/insuranceHealthScoreCalculator.ts","../src/components/Charts/InsuranceHealthGauge.tsx","../src/components/Reports/InsuranceHealth.tsx","../src/components/ReportBuilder/index.tsx"],"sourcesContent":["import { AlertTriangle, DollarSign, FileText, Shield } from \"lucide-react\";\nimport React, { useState } from \"react\";\nimport { useNavigate } from \"react-router-dom\";\nimport {\n Button,\n Badge,\n Card,\n CardContent,\n CardTitle,\n CardHeader,\n} from \"tc-components\";\n\n// import styles from \"./Dashboard.module.css\";\n\ninterface Template {\n id: string;\n name: string;\n description: string;\n category: string;\n preview: string;\n}\n\nconst templates: Template[] = [\n {\n id: \"financial-impact\",\n name: \"Financial Impact Analysis\",\n description:\n \"Quantify the financial impact of potential cyber threats and breaches\",\n category: \"Financial Analysis\",\n preview: \"bg-gradient-to-br from-red-50 to-orange-50\",\n },\n {\n id: \"insurance-health-score\",\n name: \"Cyber Insurance Health Score\",\n description:\n \"Assess readiness for cyber insurance coverage and identify gaps\",\n category: \"Insurance Assessment\",\n preview: \"bg-gradient-to-br from-green-50 to-emerald-50\",\n },\n {\n id: \"breach-likelihood\",\n name: \"Breach Likelihood Assessment\",\n description: \"Evaluate the probability and impact of security incidents\",\n category: \"Risk Assessment\",\n preview: \"bg-gradient-to-br from-orange-50 to-red-50\",\n },\n];\n\nconst Dashboard = () => {\n const navigate = useNavigate();\n const [templateIds, setTemplateId] = useState<string[]>([]);\n\n const handleTemplateClick = (templateId: string) => {\n let updatedTemplateIds = [...templateIds];\n updatedTemplateIds = updatedTemplateIds.includes(templateId)\n ? updatedTemplateIds.filter((id) => id !== templateId)\n : [...updatedTemplateIds, templateId];\n\n setTemplateId(updatedTemplateIds);\n };\n\n const handleNavigation = () => {\n const templateParam = templateIds.join(\",\");\n navigate(`./view-report?template=${templateParam}`);\n };\n\n return (\n <>\n <div className=\"bg-white rounded-xl border border-slate-200 shadow-sm p-6 mb-8\">\n <h3 className=\"text-xl font-semibold text-slate-900 mb-6\">\n Choose Your Report Template\n </h3>\n\n <div className=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 gap-6 \">\n {templates.map((template) => {\n const getTemplateIcon = (id: string) => {\n switch (id) {\n case \"financial-impact\":\n return <DollarSign className=\"w-12 h-12 text-red-500\" />;\n case \"insurance-health-score\":\n return <Shield className=\"w-12 h-12 text-green-500\" />;\n case \"breach-likelihood\":\n return (\n <AlertTriangle className=\"w-12 h-12 text-orange-500\" />\n );\n case \"comprehensive\":\n return <FileText className=\"w-12 h-12 text-purple-500\" />;\n default:\n return <FileText className=\"w-12 h-12 text-slate-400\" />;\n }\n };\n\n return (\n <Card\n key={template.id}\n className={`transition-all border-2 cursor-pointer hover:shadow-lg ${\n templateIds.includes(template.id)\n ? \"border-blue-500 bg-blue-50\"\n : \"border-slate-200 hover:border-slate-300\"\n }`}\n onClick={() => handleTemplateClick(template.id)}\n >\n <CardHeader className=\"pb-3\">\n <figure\n className={`w-full h-32 rounded-lg ${template.preview} border border-slate-200 mb-4 flex items-center justify-center relative`}\n >\n {getTemplateIcon(template.id)}\n </figure>\n <CardTitle className=\"text-lg\">{template.name}</CardTitle>\n </CardHeader>\n <CardContent className=\"pt-0\">\n <p className=\"text-sm mb-3 text-slate-600\">\n {template.description}\n </p>\n <Badge variant=\"secondary\" className=\"text-xs\">\n {template.category}\n </Badge>\n </CardContent>\n </Card>\n );\n })}\n </div>\n <Button\n size=\"lg\"\n onClick={() => handleNavigation()}\n disabled={templateIds.length === 0}\n >\n Create Report\n </Button>\n </div>\n </>\n );\n};\n\nexport default Dashboard;\n","// Unified data transformation layer for both preview and PDF systems\n\nexport interface UnifiedCostBreakdown {\n hard_costs: number;\n business_downtime: number;\n regulatory_fines: number;\n reputation_damage: number;\n}\n\nexport interface UnifiedReportData {\n // Basic info\n companyName: string;\n clientName: string;\n reportTitle: string;\n reportDate: string;\n executiveSummary: string;\n customNotes: string;\n logoUrl?: string;\n \n // Financial data\n totalCost: number;\n recordCount: number;\n businessDowntime: number;\n hoursDown: number;\n breachType: string;\n industry: string;\n percentageBreached: number;\n costPerRecord: number;\n hourlyDowntimeCost: number;\n \n // Insurance data\n insuranceScore?: number;\n insuranceCategory?: string;\n \n // Cost breakdown\n costBreakdown: UnifiedCostBreakdown;\n \n // Cost components with percentages\n hardCosts: string;\n hardCostsPercentage: string;\n businessDowntimePercentage: string;\n regulatoryFines: string;\n regulatoryFinesPercentage: string;\n reputationDamage: string;\n reputationDamagePercentage: string;\n \n // Colors\n primaryColor: string;\n secondaryColor: string;\n}\n\nexport const transformToUnifiedData = (\n formData: any,\n simulationData?: any,\n logoBase64?: string\n): UnifiedReportData => {\n // Use real data if available, otherwise use sample data\n const useRealData = simulationData;\n \n if (useRealData) {\n // Calculate derived metrics - ensure all values are numbers\n const totalCostNum = Number(simulationData.total_cost) || 0;\n const recordCount = Number(simulationData.record_count) || 0;\n const hoursDown = Number(simulationData.hours_down) || 0;\n const businessDowntime = Number(simulationData.business_downtime) || 0;\n const costPerRecord = recordCount > 0 ? Math.round(totalCostNum / recordCount) : 0;\n const hourlyDowntimeCost = hoursDown > 0 ? Math.round(businessDowntime / hoursDown) : 0;\n \n // Parse cost breakdown data from JSON and ensure it's properly typed\n const costBreakdownData = simulationData.cost_breakdown as any;\n const unifiedCostBreakdown: UnifiedCostBreakdown = {\n hard_costs: Number(costBreakdownData?.hard_costs) || Number(simulationData.hard_costs) || 0,\n business_downtime: businessDowntime,\n regulatory_fines: Number(costBreakdownData?.regulatory_fines) || totalCostNum * 0.15,\n reputation_damage: Number(costBreakdownData?.reputation_damage) || totalCostNum * 0.10\n };\n \n // Calculate percentages for each cost component\n const hardCostsPercentage = totalCostNum > 0 ? ((unifiedCostBreakdown.hard_costs / totalCostNum) * 100).toFixed(1) : '0';\n const businessDowntimePercentage = totalCostNum > 0 ? ((unifiedCostBreakdown.business_downtime / totalCostNum) * 100).toFixed(1) : '0';\n const regulatoryFinesPercentage = totalCostNum > 0 ? ((unifiedCostBreakdown.regulatory_fines / totalCostNum) * 100).toFixed(1) : '0';\n const reputationDamagePercentage = totalCostNum > 0 ? ((unifiedCostBreakdown.reputation_damage / totalCostNum) * 100).toFixed(1) : '0';\n \n return {\n companyName: formData.companyName || 'Your MSP Company',\n clientName: formData.clientName || 'Client Company',\n reportTitle: formData.reportTitle || 'Cyber Financial Impact Analysis',\n reportDate: new Date(formData.generatedDate || Date.now()).toLocaleDateString(),\n executiveSummary: formData.executiveSummary || 'This report provides a comprehensive analysis of the potential financial impact of cybersecurity threats on your organization.',\n customNotes: formData.customNotes || 'Please review the recommendations and contact us to discuss implementation strategies.',\n logoUrl: logoBase64,\n primaryColor: '#2563eb',\n secondaryColor: '#1e40af',\n \n // Real financial data from simulation\n totalCost: totalCostNum,\n recordCount: recordCount,\n businessDowntime: businessDowntime,\n hoursDown: hoursDown,\n breachType: simulationData.breach_type || 'Cyber Attack',\n industry: simulationData.industry || 'General',\n \n // Insurance data - pass through from form data\n insuranceScore: formData.insuranceHealthScore || 490,\n insuranceCategory: formData.insuranceScoreCategory || 'Poor',\n \n // Enhanced metrics\n percentageBreached: Number(simulationData.percentage_breached) || 35,\n costPerRecord: costPerRecord,\n hourlyDowntimeCost: hourlyDowntimeCost,\n \n // Cost breakdown\n costBreakdown: unifiedCostBreakdown,\n \n // Individual cost components with percentages (formatted for display)\n hardCosts: unifiedCostBreakdown.hard_costs.toLocaleString(),\n hardCostsPercentage: hardCostsPercentage,\n businessDowntimePercentage: businessDowntimePercentage,\n regulatoryFines: unifiedCostBreakdown.regulatory_fines.toLocaleString(),\n regulatoryFinesPercentage: regulatoryFinesPercentage,\n reputationDamage: unifiedCostBreakdown.reputation_damage.toLocaleString(),\n reputationDamagePercentage: reputationDamagePercentage\n };\n } else {\n // Use sample data\n const sampleTotalCost = 156750;\n const sampleRecordCount = 2500;\n const sampleHoursDown = 18;\n const sampleBusinessDowntime = 89200;\n const sampleHardCosts = sampleTotalCost - sampleBusinessDowntime;\n const sampleRegulatoryFines = sampleTotalCost * 0.15;\n const sampleReputationDamage = sampleTotalCost * 0.10;\n \n const sampleCostBreakdown: UnifiedCostBreakdown = {\n hard_costs: sampleHardCosts,\n business_downtime: sampleBusinessDowntime,\n regulatory_fines: sampleRegulatoryFines,\n reputation_damage: sampleReputationDamage\n };\n \n return {\n companyName: formData.companyName || 'Your MSP Company',\n clientName: formData.clientName || 'Client Company',\n reportTitle: formData.reportTitle || 'Cyber Financial Impact Analysis',\n reportDate: new Date(formData.generatedDate || Date.now()).toLocaleDateString(),\n executiveSummary: formData.executiveSummary || 'This report provides a comprehensive analysis of the potential financial impact of cybersecurity threats on your organization.',\n customNotes: formData.customNotes || 'Please review the recommendations and contact us to discuss implementation strategies.',\n logoUrl: logoBase64,\n primaryColor: '#2563eb',\n secondaryColor: '#1e40af',\n \n // Sample financial data\n totalCost: sampleTotalCost,\n recordCount: sampleRecordCount,\n businessDowntime: sampleBusinessDowntime,\n hoursDown: sampleHoursDown,\n breachType: 'Ransomware Attack',\n industry: 'Healthcare',\n \n // Sample insurance data - pass through from form data\n insuranceScore: formData.insuranceHealthScore || 490,\n insuranceCategory: formData.insuranceScoreCategory || 'Poor',\n \n // Enhanced sample metrics\n percentageBreached: 35,\n costPerRecord: Math.round(sampleTotalCost / sampleRecordCount),\n hourlyDowntimeCost: Math.round(sampleBusinessDowntime / sampleHoursDown),\n \n // Cost breakdown\n costBreakdown: sampleCostBreakdown,\n \n // Individual cost components with percentages (formatted for display)\n hardCosts: sampleHardCosts.toLocaleString(),\n hardCostsPercentage: ((sampleHardCosts / sampleTotalCost) * 100).toFixed(1),\n businessDowntimePercentage: ((sampleBusinessDowntime / sampleTotalCost) * 100).toFixed(1),\n regulatoryFines: sampleRegulatoryFines.toLocaleString(),\n regulatoryFinesPercentage: ((sampleRegulatoryFines / sampleTotalCost) * 100).toFixed(1),\n reputationDamage: sampleReputationDamage.toLocaleString(),\n reputationDamagePercentage: ((sampleReputationDamage / sampleTotalCost) * 100).toFixed(1)\n };\n }\n};","import {\n faDoorOpen,\n faCrown,\n faEyeSlash,\n} from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport {\n DollarSign,\n AlertTriangle,\n FileText,\n CheckCircle,\n Target,\n Shield,\n BarChart3,\n Eye,\n} from \"lucide-react\";\nimport React from \"react\";\n\nconst BreachLikelihood = ({ config }) => {\n\n const calculateBreachLikelihood = (protectionLevel: number) => {\n // Use stored breach likelihood from database if available\n if (\n config.assessmentData?.overall_breach_likelihood !== null &&\n config.assessmentData?.overall_breach_likelihood !== undefined\n ) {\n return Math.round(config.assessmentData.overall_breach_likelihood);\n }\n\n // Fallback: Attack likelihood decreases as protection increases\n return Math.max(5, 100 - protectionLevel);\n };\n const calculateProtectionLevel = () => {\n // Parse assessment data to determine protection percentage\n if (config.assessmentData?.findings) {\n const findings = config.assessmentData.findings;\n const totalControls = 18; // Based on CIS controls\n let implementedControls = 0;\n for (let i = 1; i <= totalControls; i++) {\n const control = findings[`control_${i}`];\n if (control === \"implemented\" || control === \"partial\") {\n implementedControls += control === \"implemented\" ? 1 : 0.5;\n }\n }\n return Math.round((implementedControls / totalControls) * 100);\n }\n return 19; // Default from screenshot\n };\n const calculateRiskExposure = (baseCost: number, likelihood: number) => {\n return Math.round(baseCost * (likelihood / 100));\n };\n const currentProtection = calculateProtectionLevel();\n const attackLikelihood = calculateBreachLikelihood(currentProtection);\n const baseCost = parseInt(\n config.totalEstimatedCost?.replace(/,/g, \"\") || \"510000\",\n );\n const realRiskExposure = calculateRiskExposure(baseCost, attackLikelihood);\n // const vulnerabilityPercentage = 100 - currentProtection;\n const riskReduction = Math.max(0, 100 - attackLikelihood);\n return (\n <>\n {/* Page 1: Executive Summary Dashboard */}\n <section id=\"breach-likelihood\" className=\"report-page space-y-3\">\n <div className=\"text-center space-y-2\">\n {/* Report Title */}\n <h1 className=\"text-3xl font-bold text-slate-900\">\n Breach Likelihood Assessment\n </h1>\n <p className=\"text-slate-600 text-base\">\n Analyzing probability and impact of security incidents\n </p>\n </div>\n\n {/* Executive Summary Title */}\n <h1 className=\"text-2xl font-bold text-slate-900 text-left\">\n Executive Summary\n </h1>\n\n {/* Executive Summary Section */}\n <div className=\"bg-slate-50 rounded-lg p-4 text-left space-y-2\">\n <h3 className=\"text-base font-semibold text-slate-900\">\n Why This Breach Likelihood Assessment Matters\n </h3>\n <div className=\"text-slate-700 leading-relaxed whitespace-pre-line text-sm\">\n {config.executiveSummary}\n </div>\n </div>\n\n {/* 4-Box Risk Dashboard */}\n <div className=\"grid grid-cols-2 gap-4 mb-4\">\n <div className=\"bg-red-600 text-white p-6 rounded-lg text-center\">\n <AlertTriangle className=\"w-8 h-8 mx-auto mb-3\" />\n <div className=\"text-3xl font-bold mb-2\">\n ${baseCost.toLocaleString()}\n </div>\n <div className=\"text-xs opacity-90\">\n What an attack could cost your business\n </div>\n </div>\n\n <div className=\"bg-orange-600 text-white p-6 rounded-lg text-center\">\n <Target className=\"w-8 h-8 mx-auto mb-3\" />\n <div className=\"text-3xl font-bold mb-2\">{attackLikelihood}%</div>\n <div className=\"text-xs opacity-90\">\n Chance criminals would succeed today\n </div>\n </div>\n </div>\n\n {/* Risk Summary */}\n <div className=\"bg-slate-50 rounded-lg p-4 space-y-3\">\n <div className=\"grid grid-cols-3 gap-2 text-xs text-center\">\n <div className=\"flex items-center justify-center space-x-1\">\n <CheckCircle className=\"w-4 h-4 text-green-600\" />\n <span>You&apos;ve reduced your risk by {riskReduction}%</span>\n </div>\n <div className=\"flex items-center justify-center space-x-1\">\n <AlertTriangle className=\"w-4 h-4 text-orange-600\" />\n <span>\n {attackLikelihood}% chance criminals would succeed if they\n targeted you\n </span>\n </div>\n <div className=\"flex items-center justify-center space-x-1\">\n <Target className=\"w-4 h-4 text-blue-600\" />\n <span>\n Smart investments could reduce your risk to under $100,000\n </span>\n </div>\n </div>\n </div>\n\n {/* Risk Reality Section */}\n <div className=\"bg-slate-50 rounded-lg p-3\">\n <div className=\"flex items-center mb-2\">\n <FileText className=\"w-4 h-4 text-slate-600 mr-1\" />\n <h4 className=\"text-sm font-semibold text-slate-700 italic\">\n Your Current Estimated Risk = ${realRiskExposure.toLocaleString()}\n </h4>\n </div>\n <ul className=\"text-xs text-slate-600 space-y-1\">\n <li>\n • Cyber attacks increased 38% globally in 2023 compared to 2022\n </li>\n <li>\n • Small businesses experience a cyberattack every 39 seconds on\n average\n </li>\n <li>\n • 60% of small companies go out of business within 6 months of a\n cyber attack\n </li>\n <li>\n • The average cost of cybercrime for businesses globally rose to\n $4.88 million in 2024\n </li>\n </ul>\n </div>\n </section>\n\n {/* Page 2: Protection Analysis */}\n <section className=\"report-page space-y-6 border-t border-slate-200 pt-8\">\n <div className=\"text-center\">\n <h2 className=\"text-2xl font-bold text-slate-900 mb-2\">\n Protection Analysis\n </h2>\n <p className=\"text-slate-600\">\n Understanding Your Business Protection Shield\n </p>\n </div>\n\n {/* Shield Protection Visual */}\n <div className=\"bg-slate-50 rounded-lg p-8 text-center\">\n <Shield className=\"w-20 h-20 mx-auto mb-4 text-slate-600\" />\n <h3 className=\"text-2xl font-bold mb-4\">\n Your Business Protection Shield\n </h3>\n <div className=\"text-xl font-bold text-red-600 mb-4\">\n Shield Strength: {100 - attackLikelihood}%\n </div>\n\n {/* PDF-friendly shield strength visualization using Unicode characters */}\n <div className=\"flex justify-center items-center space-x-1 mb-4\">\n {Array.from(\n {\n length: 10,\n },\n (_, index) => {\n const shieldPercentage = 100 - attackLikelihood;\n const threshold = (index + 1) * 10;\n const isProtected = shieldPercentage >= threshold;\n return (\n <span\n key={index}\n className={`text-2xl font-bold ${isProtected ? \"text-blue-600\" : \"text-slate-300\"}`}\n style={{\n fontFamily: \"Arial, sans-serif\",\n }}\n >\n ●\n </span>\n );\n },\n )}\n </div>\n\n {/* Alternative text-based progress indicator for PDF compatibility */}\n <div className=\"text-center mb-4\">\n <div className=\"inline-flex items-center space-x-1 bg-slate-100 rounded-lg px-4 py-2\">\n <span className=\"text-sm font-medium text-slate-600\">\n Protection Level:\n </span>\n <span className=\"text-lg font-bold text-blue-600\">\n {100 - attackLikelihood}%\n </span>\n <span className=\"text-sm text-slate-500\">\n ({attackLikelihood}% vulnerable)\n </span>\n </div>\n </div>\n\n <div className=\"text-lg font-bold\">\n {100 - attackLikelihood}% Protected | {attackLikelihood}% Vulnerable\n </div>\n\n <p className=\"text-slate-600 mt-4\">\n Your business has basic protection in a few areas, but most of your\n shield has serious gaps that criminals could easily exploit.\n </p>\n </div>\n\n {/* Attack Process Flow */}\n <div className=\"space-y-6\">\n <h3 className=\"text-xl font-bold text-center\">\n How Criminals Attack Your Business\n </h3>\n\n <div className=\"grid grid-cols-4 gap-4\">\n <div className=\"text-center border-2 border-slate-200 rounded-lg p-4\">\n <FontAwesomeIcon\n icon={faDoorOpen}\n className=\"text-2xl mb-2 text-slate-600\"\n />\n <h4 className=\"font-bold mb-2\">Step 1: Get In</h4>\n <p className=\"text-sm text-slate-600 mb-2\">\n Find any weakness like emails, websites, or mistakes\n </p>\n <div className=\"text-xs font-bold text-red-600\">\n Protection: Minimal\n </div>\n </div>\n\n <div className=\"text-center border-2 border-slate-200 rounded-lg p-4\">\n <Eye className=\"w-8 h-8 mx-auto mb-2 text-slate-600\" />\n <h4 className=\"font-bold mb-2\">Step 2: Sneak Around</h4>\n <p className=\"text-sm text-slate-600 mb-2\">\n Move through systems quietly and find valuable information\n </p>\n <div className=\"text-xs font-bold text-red-600\">\n Protection: None\n </div>\n </div>\n\n <div className=\"text-center border-2 border-slate-200 rounded-lg p-4\">\n <FontAwesomeIcon\n icon={faCrown}\n className=\"text-2xl mb-2 text-slate-600\"\n />\n <h4 className=\"font-bold mb-2\">Step 3: Take Control</h4>\n <p className=\"text-sm text-slate-600 mb-2\">\n Steal data, encrypt files, or take over your systems\n </p>\n <div className=\"text-xs font-bold text-red-600\">\n Protection: None\n </div>\n </div>\n\n <div className=\"text-center border-2 border-slate-200 rounded-lg p-4\">\n <FontAwesomeIcon\n icon={faEyeSlash}\n className=\"text-2xl mb-2 text-slate-600\"\n />\n <h4 className=\"font-bold mb-2\">Step 4: Stay Hidden</h4>\n <p className=\"text-sm text-slate-600 mb-2\">\n Cover tracks so you don&apos;t notice for weeks/months\n </p>\n <div className=\"text-xs font-bold text-red-600\">\n Protection: None\n </div>\n </div>\n </div>\n\n <div className=\"text-center\">\n <p className=\"text-lg font-bold text-red-600\">\n Result: Criminals have a clear path to hurt your business with\n very little stopping them.\n </p>\n </div>\n </div>\n </section>\n\n {/* Page 3: Control-Specific Financial Impact */}\n <section className=\"report-page space-y-6 border-t border-slate-200 pt-8\">\n <div>\n <h2 className=\"text-2xl font-bold text-slate-900 mb-2\">\n Control-Specific Financial Impact\n </h2>\n <p className=\"text-slate-600\">\n Multiple value streams for each control\n </p>\n </div>\n\n {(() => {\n // Use control mappings directly from database\n const controlMappings = config.assessmentData?.control_mappings || [];\n\n const implementedControls = Array.isArray(controlMappings)\n ? controlMappings.filter((c) => c.implemented === true)\n : [];\n const potentialControls = Array.isArray(controlMappings)\n ? controlMappings.filter((c) => c.implemented !== true)\n : [];\n\n const renderControlRow = (control: any) => {\n const mitrePhases = Array.isArray(control.mitrePhases)\n ? control.mitrePhases.join(\", \")\n : control.mitrePhases || \"\";\n const breachValue =\n control.financialValues?.proportionalBreachValue ||\n control.breach_protection ||\n 0;\n const complianceValue =\n control.financialValues?.complianceValue ||\n control.compliance_value ||\n 0;\n const operationalValue =\n control.financialValues?.operationalSavings ||\n control.operational_savings ||\n 0;\n const totalValue =\n control.financialValues?.totalValue ||\n breachValue + complianceValue + operationalValue ||\n 0;\n // const implementationCost =\n // control.implementationCost || control.implementation_cost || 0;\n // const roi =\n // totalValue && implementationCost\n // ? ((totalValue / implementationCost) * 100).toFixed(0) + \"%\"\n // : \"N/A\";\n\n return (\n <tr\n key={control.controlNumber}\n className=\"border-b transition-colors hover:bg-slate-50\"\n >\n <td className=\"p-4 align-top border border-slate-300\">\n <div className=\"space-y-1\">\n <div className=\"font-semibold text-slate-900\">\n CIS {control.controlNumber || control.cis_control_number}\n </div>\n <div className=\"font-medium text-slate-700\">\n {control.controlName ||\n control.cis_control_name ||\n control.name}\n </div>\n <div className=\"text-xs text-slate-600 leading-tight\">\n MITRE: {mitrePhases}\n </div>\n </div>\n </td>\n <td className=\"p-4 align-middle border border-slate-300 text-center\">\n <div className=\"text-blue-600 font-semibold\">\n ${breachValue.toLocaleString()}\n </div>\n </td>\n <td className=\"p-4 align-middle border border-slate-300 text-center\">\n <div className=\"text-green-600 font-semibold\">\n ${complianceValue.toLocaleString()}\n </div>\n </td>\n <td className=\"p-4 align-middle border border-slate-300 text-center\">\n <div className=\"text-purple-600 font-semibold\">\n ${operationalValue.toLocaleString()}\n </div>\n </td>\n <td className=\"p-4 align-middle border border-slate-300 text-center\">\n <div className=\"text-slate-900 font-bold\">\n ${totalValue.toLocaleString()}\n </div>\n </td>\n </tr>\n );\n };\n\n return (\n <div className=\"space-y-6\">\n {(() => {\n const renderControlTable = (\n controls: any[],\n title: string,\n color: string,\n isPotential = false,\n ) => {\n // For live preview, don't paginate additional controls\n if (isPotential) {\n return (\n <div>\n <div className=\"flex items-center gap-2 mb-3\">\n <div\n className={`w-5 h-5 ${color === \"green\" ? \"bg-green-600\" : \"bg-red-600\"} rounded-full flex items-center justify-center`}\n >\n <svg\n className=\"w-3 h-3 text-white\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path\n fillRule=\"evenodd\"\n d={\n color === \"green\"\n ? \"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z\"\n : \"M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z\"\n }\n clipRule=\"evenodd\"\n />\n </svg>\n </div>\n <h3\n className={`text-lg font-semibold ${color === \"green\" ? \"text-green-600\" : \"text-red-600\"}`}\n >\n {title}\n </h3>\n </div>\n <table className=\"w-full caption-bottom text-sm border-collapse border border-slate-300\">\n <thead>\n <tr\n className={\n color === \"green\" ? \"bg-green-50\" : \"bg-red-50\"\n }\n >\n <th className=\"h-12 px-4 text-left align-middle font-medium text-slate-900 border border-slate-300\">\n Control\n </th>\n <th className=\"h-12 px-4 text-left align-middle font-medium text-slate-900 border border-slate-300\">\n Breach Protection\n </th>\n <th className=\"h-12 px-4 text-left align-middle font-medium text-slate-900 border border-slate-300\">\n Compliance Value\n </th>\n <th className=\"h-12 px-4 text-left align-middle font-medium text-slate-900 border border-slate-300\">\n Operational Savings\n </th>\n <th className=\"h-12 px-4 text-left align-middle font-medium text-slate-900 border border-slate-300\">\n Total Value\n </th>\n </tr>\n </thead>\n <tbody>\n {controls.length > 0 ? (\n controls.map((control: any) =>\n renderControlRow(control),\n )\n ) : (\n <tr>\n <td\n colSpan={5}\n className=\"p-8 text-center text-slate-500 border border-slate-300\"\n >\n {isPotential\n ? \"No additional controls recommended\"\n : \"No controls currently implemented\"}\n </td>\n </tr>\n )}\n </tbody>\n </table>\n </div>\n );\n }\n\n // Show all controls in one table\n return (\n <div>\n <div className=\"flex items-center gap-2 mb-3\">\n <div\n className={`w-5 h-5 ${color === \"green\" ? \"bg-green-600\" : \"bg-red-600\"} rounded-full flex items-center justify-center`}\n >\n <svg\n className=\"w-3 h-3 text-white\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path\n fillRule=\"evenodd\"\n d={\n color === \"green\"\n ? \"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z\"\n : \"M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z\"\n }\n clipRule=\"evenodd\"\n />\n </svg>\n </div>\n <h3\n className={`text-lg font-semibold ${color === \"green\" ? \"text-green-600\" : \"text-red-600\"}`}\n >\n {title}\n </h3>\n </div>\n <table className=\"w-full caption-bottom text-sm border-collapse border border-slate-300\">\n <thead>\n <tr\n className={\n color === \"green\" ? \"bg-green-50\" : \"bg-red-50\"\n }\n >\n <th className=\"h-12 px-4 text-left align-middle font-medium text-slate-900 border border-slate-300\">\n Control\n </th>\n <th className=\"h-12 px-4 text-left align-middle font-medium text-slate-900 border border-slate-300\">\n Breach Protection\n </th>\n <th className=\"h-12 px-4 text-left align-middle font-medium text-slate-900 border border-slate-300\">\n Compliance Value\n </th>\n <th className=\"h-12 px-4 text-left align-middle font-medium text-slate-900 border border-slate-300\">\n Operational Savings\n </th>\n <th className=\"h-12 px-4 text-left align-middle font-medium text-slate-900 border border-slate-300\">\n Total Value\n </th>\n </tr>\n </thead>\n <tbody>\n {controls.length > 0 ? (\n controls.map((control: any) =>\n renderControlRow(control),\n )\n ) : (\n <tr>\n <td\n colSpan={5}\n className=\"p-8 text-center text-slate-500 border border-slate-300\"\n >\n {isPotential\n ? \"No additional controls recommended\"\n : \"No controls currently implemented\"}\n </td>\n </tr>\n )}\n </tbody>\n </table>\n </div>\n );\n };\n\n return (\n <div className=\"space-y-6\">\n {/* Implemented Controls */}\n {renderControlTable(\n implementedControls,\n \"Controls Currently in Place\",\n \"green\",\n )}\n\n {/* Potential Controls */}\n {renderControlTable(\n potentialControls,\n \"Recommended Additional Controls\",\n \"red\",\n true,\n )}\n </div>\n );\n })()}\n </div>\n );\n })()}\n\n {/* Summary Section */}\n <div className=\"bg-slate-50 rounded-lg p-6\">\n <h3 className=\"text-lg font-semibold text-slate-900 mb-4\">\n Control Implementation Impact\n </h3>\n {(() => {\n const controlMappings =\n config.assessmentData?.control_mappings || [];\n const implementedControls = Array.isArray(controlMappings)\n ? controlMappings.filter(\n (control: any) => control.implemented === true,\n )\n : [];\n const potentialControls = Array.isArray(controlMappings)\n ? controlMappings.filter(\n (control: any) => control.implemented === false,\n )\n : [];\n\n const implementedTotals = implementedControls.reduce(\n (acc: any, control: any) => {\n acc.breachProtection +=\n control.financialValues?.proportionalBreachValue ||\n control.breach_protection ||\n 0;\n acc.complianceValue +=\n control.financialValues?.complianceValue ||\n control.compliance_value ||\n 0;\n acc.operationalSavings +=\n control.financialValues?.operationalSavings ||\n control.operational_savings ||\n 0;\n return acc;\n },\n {\n breachProtection: 0,\n complianceValue: 0,\n operationalSavings: 0,\n },\n );\n\n const potentialTotals = potentialControls.reduce(\n (acc: any, control: any) => {\n acc.breachProtection +=\n control.financialValues?.proportionalBreachValue ||\n control.breach_protection ||\n 0;\n acc.complianceValue +=\n control.financialValues?.complianceValue ||\n control.compliance_value ||\n 0;\n acc.operationalSavings +=\n control.financialValues?.operationalSavings ||\n control.operational_savings ||\n 0;\n acc.implementationCost +=\n control.implementationCost ||\n control.implementation_cost ||\n 0;\n return acc;\n },\n {\n breachProtection: 0,\n complianceValue: 0,\n operationalSavings: 0,\n implementationCost: 0,\n },\n );\n\n return (\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-6 text-sm\">\n <div className=\"text-center\">\n <div className=\"text-3xl font-bold text-green-600\">\n ${implementedTotals.breachProtection.toLocaleString()}\n </div>\n <div className=\"text-slate-600 mt-2\">\n Current Breach Protection\n </div>\n </div>\n <div className=\"text-center\">\n <div className=\"text-3xl font-bold text-red-600\">\n ${potentialTotals.breachProtection.toLocaleString()}\n </div>\n <div className=\"text-slate-600 mt-2\">\n Additional Protection Available\n </div>\n </div>\n </div>\n );\n })()}\n </div>\n </section>\n\n {/* Page 5: Next Steps & Action Options */}\n <section className=\"report-page space-y-6 border-t border-slate-200 pt-8\">\n <div className=\"text-center\">\n <h2 className=\"text-2xl font-bold text-slate-900 mb-2\">\n Next Steps & Action Options\n </h2>\n <p className=\"text-slate-600\">Choose Your Path Forward</p>\n </div>\n\n {/* Complete Assessment Summary */}\n <div className=\"bg-slate-50 rounded-lg p-6 space-y-4\">\n <h3 className=\"text-xl font-bold text-center\">\n Your Complete Business Risk Assessment\n </h3>\n\n <div className=\"grid grid-cols-3 gap-4 text-sm text-center\">\n <div>\n <span className=\"text-green-600\">✓</span>{\" \"}\n <strong>Financial Impact:</strong> ${baseCost.toLocaleString()}{\" \"}\n potential cost\n </div>\n <div>\n <span className=\"text-green-600\">✓</span>{\" \"}\n <strong>Insurance Readiness:</strong>{\" \"}\n {config.insuranceHealthScore || 490}/850 (\n {config.insuranceScoreCategory || \"Poor\"})\n </div>\n <div>\n <span className=\"text-green-600\">✓</span>{\" \"}\n <strong>Attack Likelihood:</strong> {attackLikelihood}% chance of\n success\n </div>\n </div>\n\n <div className=\"text-center text-lg font-bold text-red-600\">\n Your Bottom Line: ${realRiskExposure.toLocaleString()} at risk\n </div>\n </div>\n\n {/* Action Options */}\n <div className=\"grid grid-cols-3 gap-6\">\n <div className=\"border-2 border-green-500 bg-green-50 rounded-lg p-6 text-center\">\n <h3 className=\"text-lg font-bold mb-2\">\n Option 1: Start With Essentials\n </h3>\n <div className=\"bg-green-600 text-white px-3 py-1 rounded-full text-sm font-bold mb-4 inline-block\">\n Recommended\n </div>\n\n <div className=\"text-sm mb-4\">\n <strong>Benefit:</strong> Reduces risk by 73%\n </div>\n\n <p className=\"text-sm text-slate-600\">\n Get the most critical protections in place first. Covers the most\n common attack methods.\n </p>\n </div>\n\n <div className=\"border-2 border-blue-500 rounded-lg p-6 text-center\">\n <h3 className=\"text-lg font-bold mb-4\">\n Option 2: Complete Protection Plan\n </h3>\n\n <div className=\"text-sm mb-4\">\n <strong>Benefit:</strong> Reduces risk by 87%\n </div>\n\n <p className=\"text-sm text-slate-600\">\n Full comprehensive security. Positions you well for insurance\n discounts and client requirements.\n </p>\n </div>\n\n <div className=\"border-2 border-red-500 bg-red-50 rounded-lg p-6 text-center\">\n <h3 className=\"text-lg font-bold mb-4\">Option 3: Do Nothing</h3>\n\n <div className=\"text-sm mb-2\">\n <strong>Investment:</strong> $0\n </div>\n <div className=\"text-sm mb-4 text-red-600\">\n <strong>Risk:</strong> 97% chance of losing $\n {realRiskExposure.toLocaleString()}\n </div>\n\n <p className=\"text-sm text-slate-600\">\n Keep current protection and hope criminals don&apos;t target you.\n </p>\n </div>\n </div>\n\n {/* Call to Action */}\n <div className=\"bg-gradient-to-r from-blue-600 to-blue-800 text-white rounded-lg p-8 text-center\">\n <h3 className=\"text-2xl font-bold mb-4\">\n Ready to Protect Your Business?\n </h3>\n\n <p className=\"text-lg mb-6 opacity-90\">\n You know what you&apos;re facing and what it costs to fix. The\n question isn&apos;t whether you can afford protection - it&apos;s\n whether you can afford to go without it.\n </p>\n\n <div className=\"text-lg mb-4\">\n {/* <strong>Contact:</strong> {user?.email || \"contact@company.com\"} */}\n </div>\n\n <div className=\"text-sm opacity-80\">\n Every day you wait is another day criminals could strike. Every\n protection you add makes your business safer.\n </div>\n </div>\n </section>\n\n {/* Page 6: Understanding Your Numbers */}\n <section className=\"report-page space-y-6 border-t border-slate-200 pt-8\">\n <div className=\"text-center\">\n <h2 className=\"text-2xl font-bold text-slate-900 mb-2\">\n Understanding Your Numbers\n </h2>\n <p className=\"text-slate-600\">How We Calculate Your Risk</p>\n </div>\n\n {/* Calculation Cards */}\n <div className=\"grid grid-cols-3 gap-6 mb-8\">\n <div className=\"border-2 border-slate-200 rounded-lg p-6\">\n <Target className=\"w-8 h-8 text-orange-600 mb-4\" />\n <h3 className=\"text-lg font-bold mb-3\">Attack Likelihood</h3>\n <div className=\"text-sm text-slate-600 space-y-2\">\n <p>\n <strong>Based on:</strong> Industry attack statistics + your\n current protection level\n </p>\n <p>\n <strong>Source:</strong> FBI Internet Crime Reports and\n cybersecurity research\n </p>\n <p>\n <strong>Your result:</strong> {attackLikelihood}% chance based\n on {currentProtection}% protection implementation\n </p>\n </div>\n </div>\n\n <div className=\"border-2 border-slate-200 rounded-lg p-6\">\n <DollarSign className=\"w-8 h-8 text-red-600 mb-4\" />\n <h3 className=\"text-lg font-bold mb-3\">Financial Impact</h3>\n <div className=\"text-sm text-slate-600 space-y-2\">\n <p>\n <strong>Based on:</strong> Average costs for businesses your\n size in your industry\n </p>\n <p>\n <strong>Source:</strong> IBM Cost of Data Breach Report 2024\n </p>\n <p>\n <strong>Your result:</strong> ${baseCost.toLocaleString()}{\" \"}\n potential cost for small {config.clientIndustry} business\n </p>\n </div>\n </div>\n\n <div className=\"border-2 border-slate-200 rounded-lg p-6\">\n <Shield className=\"w-8 h-8 text-blue-600 mb-4\" />\n <h3 className=\"text-lg font-bold mb-3\">Protection Value</h3>\n <div className=\"text-sm text-slate-600 space-y-2\">\n <p>\n <strong>Based on:</strong> How much each security control\n reduces attack success\n </p>\n <p>\n <strong>Source:</strong> NIST Cybersecurity Framework\n effectiveness data\n </p>\n <p>\n <strong>Your result:</strong> Each control&apos;s value\n calculated from proven risk reduction\n </p>\n </div>\n </div>\n </div>\n\n {/* Methodology */}\n <div className=\"bg-slate-50 rounded-lg p-6 mb-6\">\n <h3 className=\"text-xl font-bold mb-4\">Our Approach</h3>\n <p className=\"text-sm text-slate-700\">\n We use the same data sources that insurance companies and security\n professionals rely on. Our calculations are conservative - real\n attack costs are often higher than our estimates.\n </p>\n </div>\n\n {/* Disclaimers */}\n <div className=\"grid grid-cols-3 gap-6\">\n <div className=\"border border-slate-200 rounded-lg p-5\">\n <Target className=\"w-6 h-6 text-orange-600 mb-3\" />\n <h4 className=\"font-bold mb-3\">About Risk Predictions</h4>\n <p className=\"text-xs text-slate-600\">\n These numbers show likely scenarios based on current data. Every\n business is different, and actual results may vary.\n </p>\n </div>\n\n <div className=\"border border-slate-200 rounded-lg p-5\">\n <DollarSign className=\"w-6 h-6 text-green-600 mb-3\" />\n <h4 className=\"font-bold mb-3\">About Cost Estimates</h4>\n <p className=\"text-xs text-slate-600\">\n Implementation costs are estimates based on typical market rates.\n Actual costs depend on your specific needs and solutions.\n </p>\n </div>\n\n <div className=\"border border-slate-200 rounded-lg p-5\">\n <BarChart3 className=\"w-6 h-6 text-blue-600 mb-3\" />\n <h4 className=\"font-bold mb-3\">About Our Data</h4>\n <p className=\"text-xs text-slate-600\">\n We use industry-standard sources and proven methodologies. This\n assessment is for planning purposes and should be combined with\n professional security advice.\n </p>\n </div>\n </div>\n </section>\n </>\n );\n};\nexport default BreachLikelihood;\n","\ninterface ExecutiveSummaryTemplate {\n audience: string;\n objective: string;\n content: string;\n}\n\nexport const executiveSummaryTemplates: ExecutiveSummaryTemplate[] = [\n // C-Suite templates\n {\n audience: 'c-suite',\n objective: 'win-client',\n content: 'This comprehensive cybersecurity financial impact analysis demonstrates the critical need for enhanced security measures within your organization. Our analysis reveals significant potential financial exposure that threatens business continuity and stakeholder value. By partnering with our managed security services, you can mitigate these risks while achieving measurable ROI through reduced insurance premiums, compliance adherence, and operational resilience.'\n },\n {\n audience: 'c-suite',\n objective: 'expand-services',\n content: 'Building on our successful partnership, this analysis identifies additional cybersecurity vulnerabilities that require immediate attention. The financial impact assessment shows how expanding our current security services will provide enhanced protection against evolving threats while delivering quantifiable business value through risk reduction and operational efficiency improvements.'\n },\n {\n audience: 'c-suite',\n objective: 'contract-renewal',\n content: 'This report demonstrates the tangible value delivered through our ongoing cybersecurity partnership. The financial impact analysis shows how our services have protected your organization from significant potential losses while maintaining business continuity. Continuing our partnership ensures sustained protection against evolving cyber threats and ongoing ROI through risk mitigation.'\n },\n {\n audience: 'c-suite',\n objective: 'competitive-defense',\n content: 'This independent cybersecurity financial impact analysis provides objective insights into your organization\\'s security posture and potential risk exposure. Our comprehensive approach to threat assessment and financial modeling ensures you have the data needed to make informed decisions about your cybersecurity investments and strategic partnerships.'\n },\n\n // IT Leadership templates\n {\n audience: 'it-leadership',\n objective: 'win-client',\n content: 'This technical cybersecurity assessment reveals critical vulnerabilities in your current security infrastructure that expose your organization to significant financial risk. Our detailed analysis includes specific threat vectors, potential impact scenarios, and recommended technical controls. Our managed security services provide the advanced tools, expertise, and 24/7 monitoring capabilities needed to address these vulnerabilities effectively.'\n },\n {\n audience: 'it-leadership',\n objective: 'expand-services',\n content: 'Our ongoing security partnership has identified additional areas where enhanced protection is needed. This technical analysis details specific gaps in your current security stack and quantifies the potential financial impact of unaddressed vulnerabilities. Expanding our services will provide advanced threat detection, incident response capabilities, and compliance support that your team needs.'\n },\n {\n audience: 'it-leadership',\n objective: 'contract-renewal',\n content: 'This comprehensive review demonstrates how our managed security services have strengthened your organization\\'s security posture over the past year. The analysis shows measurable improvements in threat detection, incident response times, and overall risk reduction. Continuing our partnership ensures access to evolving security technologies and expertise as threats continue to advance.'\n },\n {\n audience: 'it-leadership',\n objective: 'competitive-defense',\n content: 'This independent technical assessment provides detailed insights into your cybersecurity infrastructure and potential vulnerabilities. Our analysis includes specific technical recommendations, implementation timelines, and resource requirements to help you make informed decisions about your security strategy and technology investments.'\n },\n\n // Board of Directors templates\n {\n audience: 'board',\n objective: 'win-client',\n content: 'This governance-focused cybersecurity analysis addresses the board\\'s fiduciary responsibility to protect organizational assets and stakeholder interests. The financial impact assessment demonstrates how cybersecurity threats pose material risks to business operations, regulatory compliance, and shareholder value. Our managed security services provide the governance framework and risk management capabilities needed to fulfill board oversight responsibilities.'\n },\n {\n audience: 'board',\n objective: 'expand-services',\n content: 'This analysis provides the board with updated insights into emerging cybersecurity risks and their potential impact on organizational governance and compliance obligations. Expanding our current security services addresses identified governance gaps while ensuring continued adherence to regulatory requirements and industry best practices.'\n },\n {\n audience: 'board',\n objective: 'contract-renewal',\n content: 'This governance report demonstrates how our cybersecurity partnership has enhanced the organization\\'s risk management framework and compliance posture. The analysis shows measurable improvements in governance controls, regulatory adherence, and risk oversight capabilities. Continuing this partnership ensures sustained governance excellence and stakeholder protection.'\n },\n {\n audience: 'board',\n objective: 'competitive-defense',\n content: 'This independent governance assessment provides the board with objective insights into cybersecurity risk management and compliance obligations. Our analysis includes regulatory requirements, industry benchmarks, and governance best practices to support informed board decision-making regarding cybersecurity investments and oversight responsibilities.'\n },\n\n // Procurement Team templates\n {\n audience: 'procurement',\n objective: 'win-client',\n content: 'This cost-benefit analysis demonstrates the superior value proposition of our managed cybersecurity services compared to alternative approaches. The financial impact assessment shows how our comprehensive solution delivers measurable ROI through risk reduction, operational efficiency, and cost optimization. Our transparent pricing model and proven track record provide the procurement assurance you need for strategic vendor partnership.'\n },\n {\n audience: 'procurement',\n objective: 'expand-services',\n content: 'This vendor analysis shows how expanding our current cybersecurity services provides exceptional value compared to alternative solutions. The cost-benefit assessment demonstrates superior ROI through integrated service delivery, reduced vendor management overhead, and proven performance metrics. Our expansion proposal offers competitive pricing with enhanced service level agreements.'\n },\n {\n audience: 'procurement',\n objective: 'contract-renewal',\n content: 'This vendor performance review demonstrates the exceptional value delivered through our cybersecurity partnership. The analysis includes service level achievement, cost efficiency metrics, and comparative market analysis. Our renewal proposal provides continued value optimization with enhanced services and competitive pricing aligned with your procurement objectives.'\n },\n {\n audience: 'procurement',\n objective: 'competitive-defense',\n content: 'This independent vendor analysis provides objective insights into cybersecurity service options and market alternatives. Our comprehensive evaluation includes cost comparisons, service capability assessments, and vendor evaluation criteria to support your procurement decision-making process and ensure optimal value for your cybersecurity investments.'\n }\n];\n\nexport const getExecutiveSummaryTemplate = (industry?: string): string => {\n const industryTemplates = {\n 'Healthcare': \"Think of this like a malpractice insurance evaluation for your medical practice. Just as you wouldn't practice without malpractice coverage, you can't afford to practice without understanding your cyber risk exposure. One successful cyberattack could cost your practice more than your highest malpractice settlement.\",\n 'Legal': \"Think of this like a malpractice insurance evaluation for your law firm. Just as you wouldn't practice without malpractice coverage, you can't afford to practice without understanding your cyber risk exposure. One successful cyberattack could cost your firm more than your highest case settlement.\",\n 'Financial Services': \"Think of this like a regulatory compliance audit for your financial institution. Just as you wouldn't operate without proper compliance, you can't afford to operate without understanding your cyber risk exposure. One successful cyberattack could cost your institution more than your largest loan default.\",\n 'Education': \"Think of this like an accreditation review for your educational institution. Just as you wouldn't operate without proper accreditation, you can't afford to operate without understanding your cyber risk exposure. One successful cyberattack could cost your institution more than losing a major grant.\",\n 'Manufacturing': \"Think of this like a safety inspection for your manufacturing facility. Just as you wouldn't operate without proper safety protocols, you can't afford to operate without understanding your cyber risk exposure. One successful cyberattack could cost your facility more than your largest equipment failure.\",\n 'Retail': \"Think of this like a loss prevention audit for your retail business. Just as you wouldn't operate without proper inventory controls, you can't afford to operate without understanding your cyber risk exposure. One successful cyberattack could cost your business more than your highest shrinkage loss.\",\n 'Technology': \"Think of this like a code review for your software platform. Just as you wouldn't deploy without proper testing, you can't afford to operate without understanding your cyber risk exposure. One successful cyberattack could cost your company more than your largest system outage.\",\n 'Government': \"Think of this like a security clearance review for your agency. Just as you wouldn't operate without proper clearances, you can't afford to operate without understanding your cyber risk exposure. One successful cyberattack could cost your agency more than your largest budget overrun.\"\n };\n\n return industryTemplates[industry] || 'This cybersecurity financial impact analysis estimates the potential cost of a data breach for the client, using trusted, industry-standard data. Backed by sources like IBM Security and the Ponemon Institute, it provides a credible view of the financial risks organizations like yours face in today\\'s threat landscape. Alongside relevant industry insights, this report outlines actionable considerations to support the client\\'s cybersecurity planning, risk management, and executive decision-making—even ahead of a detailed security assessment.';\n};\n","\n// @TODO - These need to be updated once this is all sorted out - SR\n/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n\nexport const formatCurrency = (value: number) => {\n\treturn `$${value.toLocaleString()}`;\n};\n\nexport const getIndustrySpecificCosts = (industry: string, costBreakdown: any) => {\n\tconst industryExamples = {\n\t\t\"Healthcare\": {\n\t\t\t\"Post-Breach Response\":\n\t\t\t\t\"Forensic analysis, legal counsel, incident response team\",\n\t\t\t\"Business Downtime\":\n\t\t\t\t\"EMR systems offline, surgery delays, patient care disruption\",\n\t\t\t\"Notification\":\n\t\t\t\t\"Patient notification letters, credit monitoring, regulatory reporting\",\n\t\t\t\"Investigation\":\n\t\t\t\t\"Brand reputation management, PR costs, patient trust recovery\",\n\t\t},\n\t\t\"Financial Services\": {\n\t\t\t\"Post-Breach Response\":\n\t\t\t\t\"Third-party investigation, compliance audit, cybersecurity consultants\",\n\t\t\t\"Business Downtime\":\n\t\t\t\t\"Trading systems offline, transaction losses, service interruption\",\n\t\t\t\"Notification\": \"GDPR, PCI DSS violations, customer notifications\",\n\t\t\t\"Investigation\":\n\t\t\t\t\"Account monitoring, customer retention, brand recovery\",\n\t\t},\n\t\t\"Manufacturing\": {\n\t\t\t\"Post-Breach Response\":\n\t\t\t\t\"OT forensics, security assessment, incident containment\",\n\t\t\t\"Business Downtime\":\n\t\t\t\t\"Assembly line shutdown, supply chain disruption, production halt\",\n\t\t\t\"Notification\":\n\t\t\t\t\"Industry regulations, safety standards, compliance reporting\",\n\t\t\t\"Investigation\":\n\t\t\t\t\"Competitive disadvantage, customer confidence, market position recovery\",\n\t\t},\n\t};\n\tconst genericExamples = {\n\t\t\"Post-Breach Response\":\n\t\t\t\"Incident response, forensic investigation, legal and regulatory costs\",\n\t\t\"Business Downtime\":\n\t\t\t\"Lost revenue, operational disruption, productivity loss\",\n\t\t\"Notification\":\n\t\t\t\"Customer notifications, regulatory fines, compliance costs\",\n\t\t\"Investigation\":\n\t\t\t\"Reputation management, customer retention, brand recovery efforts\",\n\t};\n\tconst examples = industryExamples[industry] || genericExamples;\n\treturn [\n\t\t{\n\t\t\tcategory: \"Post-Breach Response\",\n\t\t\texample: examples[\"Post-Breach Response\"],\n\t\t\tcost: costBreakdown.hard_costs,\n\t\t\tcolor: \"#dc2626\",\n\t\t},\n\t\t{\n\t\t\tcategory: \"Business Downtime\",\n\t\t\texample: examples[\"Business Downtime\"],\n\t\t\tcost: costBreakdown.business_downtime,\n\t\t\tcolor: \"#3b82f6\",\n\t\t},\n\t\t{\n\t\t\tcategory: \"Notification\",\n\t\t\texample: examples[\"Notification\"],\n\t\t\tcost: costBreakdown.regulatory_fines,\n\t\t\tcolor: \"#ca8a04\",\n\t\t},\n\t\t{\n\t\t\tcategory: \"Investigation\",\n\t\t\texample: examples[\"Investigation\"],\n\t\t\tcost: costBreakdown.reputation_damage,\n\t\t\tcolor: \"#16a34a\",\n\t\t},\n\t];\n};\n\n// Create dynamic cost breakdown from simulation data or use defaults\nexport const createCostBreakdownFromSimulation = ({ costBreakdown }) => {\n\t// Check if breakdown is an object (dummy data format) or array (original format)\n\tif (typeof costBreakdown === \"object\" && !Array.isArray(costBreakdown)) {\n\t\t// Handle object format from dummy data\n\t\treturn {\n\t\t\thard_costs:\n\t\t\t\t(costBreakdown.forensic_costs || 0) +\n\t\t\t\t(costBreakdown.legal_costs || 0) +\n\t\t\t\t(costBreakdown.system_restoration || 0),\n\t\t\tbusiness_downtime: costBreakdown.business_interruption || 0,\n\t\t\tregulatory_fines: costBreakdown.regulatory_fines || 0,\n\t\t\treputation_damage: costBreakdown.pr_costs || 0,\n\t\t};\n\t} else if (Array.isArray(costBreakdown)) {\n\t\t// Handle array format (original implementation)\n\t\treturn {\n\t\t\thard_costs:\n\t\t\t\tcostBreakdown.find((item: any) => item.category === \"Ex-Post Response\")\n\t\t\t\t\t?.amount || 0,\n\t\t\tbusiness_downtime:\n\t\t\t\tcostBreakdown.find((item: any) => item.category === \"Business Downtime\")\n\t\t\t\t\t?.amount || 0,\n\t\t\tregulatory_fines:\n\t\t\t\tcostBreakdown.find((item: any) => item.category === \"Notification\")\n\t\t\t\t\t?.amount || 0,\n\t\t\treputation_damage:\n\t\t\t\tcostBreakdown.find((item: any) => item.category === \"Investigation\")\n\t\t\t\t\t?.amount || 0,\n\t\t};\n\n\t}\n}\n\nexport const totalCostCalculator = (unifiedData, totalEstimatedCost) => {\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n\tconst totalCost: number = parseInt(totalEstimatedCost?.replace(/,/g, \"\") || \"0\") ||\n\t\tunifiedData.totalCost;\n\treturn {\n\t\thard_costs: totalCost * 0.28,\n\t\t// Ex-Post Response\n\t\tbusiness_downtime: totalCost * 0.38,\n\t\t// Business Downtime\n\t\tregulatory_fines: totalCost * 0.09,\n\t\t// Notification\n\t\treputation_damage: totalCost * 0.25, // Investigation\n\t};\n};\n","import React from \"react\";\n\ninterface CostBreakdownData {\n hard_costs: number;\n business_downtime: number;\n regulatory_fines: number;\n reputation_damage: number;\n}\n\ninterface UnifiedCostBreakdownChartProps {\n costBreakdown: CostBreakdownData;\n totalCost: number;\n showTotal?: boolean;\n}\n\nconst UnifiedCostBreakdownChart: React.FC<UnifiedCostBreakdownChartProps> = ({\n costBreakdown,\n totalCost,\n showTotal = true,\n}) => {\n const data = [\n {\n name: \"Post-Breach Response\",\n value: costBreakdown.hard_costs || 0,\n color: \"#dc2626\",\n label: \"Post-Breach Response\",\n },\n {\n name: \"Business Downtime\",\n value: costBreakdown.business_downtime || 0,\n color: \"#3b82f6\",\n label: \"Business Downtime\",\n },\n {\n name: \"Notification\",\n value: costBreakdown.regulatory_fines || 0,\n color: \"#ca8a04\",\n label: \"Notification\",\n },\n {\n name: \"Investigation\",\n value: costBreakdown.reputation_damage || 0,\n color: \"#16a34a\",\n label: \"Investigation\",\n },\n ];\n\n // Only include segments with positive values\n const validData = data.filter((item) => item.value > 0);\n\n // Calculate the actual total from the data to ensure 100% coverage\n const dataTotal = validData.reduce((sum, item) => sum + item.value, 0);\n const chartTotal = dataTotal > 0 ? dataTotal : totalCost;\n\n // Chart dimensions\n const centerX = 350;\n const centerY = 350;\n const radius = 220;\n const innerRadius = showTotal ? 120 : 0;\n\n let currentAngle = -90; // Start at top (12 o'clock position)\n const pathElements: JSX.Element[] = [];\n\n validData.forEach((item, index) => {\n const percentage = (item.value / chartTotal) * 100;\n const angle = (percentage / 100) * 360;\n\n // Convert to radians\n const startAngleRad = (currentAngle * Math.PI) / 180;\n const endAngleRad = ((currentAngle + angle) * Math.PI) / 180;\n\n // Calculate outer arc points\n const x1 = centerX + radius * Math.cos(startAngleRad);\n const y1 = centerY + radius * Math.sin(startAngleRad);\n const x2 = centerX + radius * Math.cos(endAngleRad);\n const y2 = centerY + radius * Math.sin(endAngleRad);\n\n // Calculate inner arc points\n const innerX1 = centerX + innerRadius * Math.cos(startAngleRad);\n const innerY1 = centerY + innerRadius * Math.sin(startAngleRad);\n const innerX2 = centerX + innerRadius * Math.cos(endAngleRad);\n const innerY2 = centerY + innerRadius * Math.sin(endAngleRad);\n\n // Large arc flag (1 if angle > 180°, 0 otherwise)\n const largeArcFlag = angle > 180 ? 1 : 0;\n\n let pathData;\n if (innerRadius > 0) {\n // Donut chart path\n pathData = [\n `M ${innerX1} ${innerY1}`,\n `L ${x1} ${y1}`,\n `A ${radius} ${radius} 0 ${largeArcFlag} 1 ${x2} ${y2}`,\n `L ${innerX2} ${innerY2}`,\n `A ${innerRadius} ${innerRadius} 0 ${largeArcFlag} 0 ${innerX1} ${innerY1}`,\n \"Z\",\n ].join(\" \");\n } else {\n // Regular pie chart path\n pathData = [\n `M ${centerX} ${centerY}`,\n `L ${x1} ${y1}`,\n `A ${radius} ${radius} 0 ${largeArcFlag} 1 ${x2} ${y2}`,\n \"Z\",\n ].join(\" \");\n }\n\n pathElements.push(\n <path\n key={`segment-${index}`}\n d={pathData}\n fill={item.color}\n stroke=\"white\"\n strokeWidth=\"3\"\n opacity=\"0.9\"\n className=\"hover:opacity-100 cursor-pointer transition-all duration-200 hover:stroke-gray-300\"\n style={{ filter: \"drop-shadow(0 4px 8px rgba(0,0,0,0.15))\" }}\n />,\n );\n\n currentAngle += angle;\n });\n\n const formatCurrency = (value: number) => {\n return `$${value.toLocaleString()}`;\n };\n\n return (\n <div className=\"w-full\">\n <div className=\"relative\">\n <svg\n width=\"700\"\n height=\"700\"\n viewBox=\"0 0 700 700\"\n className=\"w-full h-auto\"\n style={{ maxWidth: \"700px\", height: \"auto\" }}\n >\n <title>Cost Breakdown Chart</title>\n <g>{pathElements}</g>\n\n {/* Center total with responsive text sizing */}\n {showTotal && (\n <g>\n <text\n x={350}\n y={320}\n textAnchor=\"middle\"\n dominantBaseline=\"central\"\n fontSize=\"18\"\n fontWeight=\"600\"\n fill=\"#64748b\"\n fontFamily=\"Arial, sans-serif\"\n >\n Estimated Impact\n </text>\n <text\n x={350}\n y={380}\n textAnchor=\"middle\"\n dominantBaseline=\"central\"\n fontSize=\"28\"\n fontWeight=\"bold\"\n fill=\"#1e293b\"\n fontFamily=\"Arial, sans-serif\"\n >\n {formatCurrency(chartTotal)}\n </text>\n </g>\n )}\n </svg>\n </div>\n </div>\n );\n};\n\nexport default UnifiedCostBreakdownChart;\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { DollarSign, AlertTriangle, FileText } from \"lucide-react\";\nimport React from \"react\";\n\nimport { getExecutiveSummaryTemplate } from \"@/utils/executiveSummaryTemplates\";\nimport {\n formatCurrency,\n createCostBreakdownFromSimulation,\n getIndustrySpecificCosts,\n} from \"@/utils/reportUtils\";\n\nimport UnifiedCostBreakdownChart from \"../Charts/UnifiedCostBreakdown\";\n\nconst FinancialImpact = ({ config, unifiedData }) => {\n // Get industry-specific executive summary\n const getDisplayExecutiveSummary = () => {\n if (config.executiveSummary) return config.executiveSummary;\n return getExecutiveSummaryTemplate(config.clientIndustry);\n };\n const getIndustryRiskLevel = (industry: string) => {\n const highRiskIndustries = [\n \"Healthcare\",\n \"Financial Services\",\n \"Government\",\n ];\n const mediumRiskIndustries = [\"Retail\", \"Education\", \"Legal\"];\n if (highRiskIndustries.includes(industry))\n return {\n level: \"High\",\n color: \"text-red-600 bg-red-50\",\n };\n if (mediumRiskIndustries.includes(industry))\n return {\n level: \"Medium\",\n color: \"text-yellow-600 bg-yellow-50\",\n };\n return {\n level: \"Moderate\",\n color: \"text-green-600 bg-green-50\",\n };\n };\n const getIndustryThreats = (industry: string): string[] => {\n const industryThreats = {\n // Snake case mappings (database format)\n \"healthcare\": [\"Phishing\", \"Ransomware\", \"Third Party Breach\"],\n \"financial_services\": [\n \"Business Email Compromise\",\n \"Malware\",\n \"Stolen Credentials\",\n ],\n \"pharmaceuticals_biotechnology\": [\n \"Malicious Insider\",\n \"Software Vulnerability\",\n \"Third Party Breach\",\n ],\n \"technology_software\": [\n \"Cloud Misconfiguration\",\n \"Software Vulnerability\",\n \"Malware\",\n ],\n \"education\": [\"Phishing\", \"Ransomware\", \"Social Engineering\"],\n \"energy_utilities\": [\n \"Malicious Insider\",\n \"Ransomware\",\n \"Software Vulnerability\",\n ],\n \"retail_consumer_goods\": [\"Stolen Credentials\", \"Phishing\", \"Malware\"],\n \"manufacturing_industrial\": [\n \"Ransomware\",\n \"Business Email Compromise\",\n \"Software Vulnerability\",\n ],\n \"transportation_logistics\": [\n \"Ransomware\",\n \"Phishing\",\n \"Malicious Insider\",\n ],\n \"telecommunications\": [\n \"Malware\",\n \"Software Vulnerability\",\n \"Social Engineering\",\n ],\n \"media_entertainment\": [\n \"Phishing\",\n \"Stolen Credentials\",\n \"Cloud Misconfiguration\",\n ],\n \"hospitality_travel\": [\n \"Business Email Compromise\",\n \"Phishing\",\n \"Ransomware\",\n ],\n \"real_estate\": [\n \"Business Email Compromise\",\n \"Phishing\",\n \"Cloud Misconfiguration\",\n ],\n \"construction\": [\"Malware\", \"Phishing\", \"Software Vulnerability\"],\n \"agriculture_food\": [\"Ransomware\", \"Phishing\", \"Malicious Insider\"],\n \"government_public_sector\": [\n \"Software Vulnerability\",\n \"Phishing\",\n \"Third Party Breach\",\n ],\n \"legal_services\": [\n \"Business Email Compromise\",\n \"Stolen Credentials\",\n \"Phishing\",\n ],\n \"professional_services_consulting\": [\n \"Phishing\",\n \"Cloud Misconfiguration\",\n \"Social Engineering\",\n ],\n \"insurance\": [\n \"Stolen Credentials\",\n \"Business Email Compromise\",\n \"Phishing\",\n ],\n \"aerospace_defense\": [\n \"Malicious Insider\",\n \"Third Party Breach\",\n \"Software Vulnerability\",\n ],\n\n // Title case mappings (legacy format)\n \"Healthcare\": [\"Phishing\", \"Ransomware\", \"Third Party Breach\"],\n \"Financial Services\": [\n \"Business Email Compromise\",\n \"Malware\",\n \"Stolen Credentials\",\n ],\n \"Pharmaceuticals & Biotechnology\": [\n \"Malicious Insider\",\n \"Software Vulnerability\",\n \"Third Party Breach\",\n ],\n \"Technology & Software\": [\n \"Cloud Misconfiguration\",\n \"Software Vulnerability\",\n \"Malware\",\n ],\n \"Education\": [\"Phishing\", \"Ransomware\", \"Social Engineering\"],\n \"Energy & Utilities\": [\n \"Malicious Insider\",\n \"Ransomware\",\n \"Software Vulnerability\",\n ],\n \"Retail & Consumer Goods\": [\"Stolen Credentials\", \"Phishing\", \"Malware\"],\n \"Manufacturing & Industrial\": [\n \"Ransomware\",\n \"Business Email Compromise\",\n \"Software Vulnerability\",\n ],\n \"Transportation & Logistics\": [\n \"Ransomware\",\n \"Phishing\",\n \"Malicious Insider\",\n ],\n \"Telecommunications\": [\n \"Malware\",\n \"Software Vulnerability\",\n \"Social Engineering\",\n ],\n \"Media & Entertainment\": [\n \"Phishing\",\n \"Stolen Credentials\",\n \"Cloud Misconfiguration\",\n ],\n \"Hospitality & Travel\": [\n \"Business Email Compromise\",\n \"Phishing\",\n \"Ransomware\",\n ],\n \"Real Estate\": [\n \"Business Email Compromise\",\n \"Phishing\",\n \"Cloud Misconfiguration\",\n ],\n \"Construction\": [\"Malware\", \"Phishing\", \"Software Vulnerability\"],\n \"Agriculture & Food\": [\"Ransomware\", \"Phishing\", \"Malicious Insider\"],\n \"Government & Public Sector\": [\n \"Software Vulnerability\",\n \"Phishing\",\n \"Third Party Breach\",\n ],\n \"Legal Services\": [\n \"Business Email Compromise\",\n \"Stolen Credentials\",\n \"Phishing\",\n ],\n \"Professional Services & Consulting\": [\n \"Phishing\",\n \"Cloud Misconfiguration\",\n \"Social Engineering\",\n ],\n \"Insurance\": [\n \"Stolen Credentials\",\n \"Business Email Compromise\",\n \"Phishing\",\n ],\n \"Aerospace & Defense\": [\n \"Malicious Insider\",\n \"Third Party Breach\",\n \"Software Vulnerability\",\n ],\n\n // Additional legacy mappings\n \"Manufacturing\": [\n \"Ransomware\",\n \"Business Email Compromise\",\n \"Software Vulnerability\",\n ],\n \"Legal\": [\"Business Email Compromise\", \"Stolen Credentials\", \"Phishing\"],\n \"Retail\": [\"Stolen Credentials\", \"Phishing\", \"Malware\"],\n \"Government\": [\n \"Software Vulnerability\",\n \"Phishing\",\n \"Third Party Breach\",\n ],\n };\n\n return (\n industryThreats[industry] || [\n \"Phishing Attacks\",\n \"Business Email Compromise\",\n \"Data Exfiltration\",\n ]\n );\n };\n const riskLevel = getIndustryRiskLevel(config.clientIndustry);\n\n const dynamicCostBreakdown = createCostBreakdownFromSimulation(\n config.simulationData || {},\n );\n\n return (\n <>\n {/* Page 1 - Cover Page */}\n <section id=\"financial-impact\" className=\"report-page text-center space-y-6 pb-8 border-b border-slate-200\">\n {/* Report Title */}\n <div className=\"space-y-2\">\n <h1 className=\"text-4xl font-bold text-slate-900\">\n Cyber Financial Impact Analysis\n </h1>\n <p className=\"text-xl text-slate-600\">\n Quantifying Your Organization&apos;s Cyber Risk Exposure\n </p>\n </div>\n </section>\n\n {/* Page 2 - Executive Summary */}\n <section className=\"report-page space-y-6\">\n <div className=\"flex items-center space-x-3\">\n <FileText className=\"w-6 h-6 text-blue-600\" />\n <div>\n <h2 className=\"text-2xl font-bold text-slate-900\">\n Why This Report Matters to You?\n </h2>\n <p className=\"text-slate-600\">\n An overview of your organization&apos;s financial cyber risk\n </p>\n </div>\n </div>\n {/* Executive Summary Content */}\n <div className=\"bg-slate-50 rounded-lg p-6\">\n <p className=\"text-slate-700 leading-relaxed\">\n {getDisplayExecutiveSummary()}\n </p>\n </div>\n {/* Total Impact Banner */}\n <div className=\"bg-red-600 rounded-lg p-6 text-white text-center\">\n <div className=\"flex items-center justify-center space-x-2 mb-2\">\n <DollarSign className=\"w-8 h-8\" />\n <h3 className=\"text-2xl font-bold\">TOTAL POTENTIAL IMPACT</h3>\n </div>\n <p className=\"text-4xl font-bold\">\n {config.totalEstimatedCost\n ? `${config.totalEstimatedCost}`\n : formatCurrency(unifiedData.totalCost)}\n </p>\n <p className=\"text-sm opacity-75 mt-2\">\n Cost Range:\n {config.costRange ||\n `$${Math.round((parseInt(config.totalEstimatedCost?.replace(/[^0-9]/g, \"\") || \"0\") || unifiedData.totalCost) * 0.75).toLocaleString()} - $${Math.round((parseInt(config.totalEstimatedCost?.replace(/[^0-9]/g, \"\") || \"0\") || unifiedData.totalCost) * 1.5).toLocaleString()}`}\n </p>\n </div>\n {/* Risk Profile Split */}\n <div className=\"space-y-4\">\n <h4 className=\"text-lg font-semibold text-slate-900\">\n Top Industry Threats\n </h4>\n <div className=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\">\n {getIndustryThreats(config.clientIndustry).map((threat, index) => (\n <div\n key={index}\n className=\"bg-red-50 border border-red-200 rounded-lg p-4 flex items-center space-x-3\"\n >\n <div className=\"flex-shrink-0\">\n <AlertTriangle className=\"w-5 h-5 text-red-500\" />\n </div>\n <span className=\"text-sm font-medium text-red-900\">\n {threat}\n </span>\n </div>\n ))}\n </div>\n </div>\n {/* Original Two-Column Layout for Other Reports */}\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-6\">\n <div className=\"space-y-4\">\n <h4 className=\"text-lg font-semibold text-slate-900\">\n Industry Risk Profile\n </h4>\n <div\n className={`inline-flex px-3 py-1 rounded-full text-sm font-medium ${riskLevel.color}`}\n >\n {riskLevel.level} Risk\n </div>\n <p className=\"text-slate-600\">\n {config.clientIndustry === \"Healthcare\" &&\n \"Healthcare organizations face elevated cyber risks due to valuable PHI data that commands high prices on dark web markets.\"}\n {config.clientIndustry === \"Financial Services\" &&\n \"Financial institutions are prime targets due to direct access to funds and sensitive financial data.\"}\n {config.clientIndustry === \"Manufacturing\" &&\n \"Manufacturing companies face operational technology risks that can halt production and supply chains.\"}\n {![\"Healthcare\", \"Financial Services\", \"Manufacturing\"].includes(\n config.clientIndustry,\n ) &&\n \"Your industry faces specific cyber risks that require tailored protection strategies.\"}\n </p>\n </div>\n <div className=\"space-y-4\">\n <h4 className=\"text-lg font-semibold text-slate-900\">\n Key Risk Factors\n </h4>\n <div className=\"space-y-1\">\n {getIndustryThreats(config.clientIndustry).map(\n (threat, index) => (\n <div key={index} className=\"flex items-center space-x-2\">\n <AlertTriangle className=\"w-4 h-4 text-red-500\" />\n <span className=\"text-sm\">{threat}</span>\n </div>\n ),\n )}\n </div>\n </div>\n </div>\n </section>\n\n {/* Page 3 - Financial Breakdown */}\n <section className=\"report-page space-y-6 border-t border-slate-200 pt-8\">\n <div>\n <h2 className=\"text-2xl font-bold text-slate-900 mb-2\">\n Detailed Financial Breakdown\n </h2>\n <p className=\"text-slate-600\">\n Understanding the components of the total potential cost\n </p>\n </div>\n\n {/* Pie Chart and Cost Breakdown */}\n <div className=\"grid grid-cols-1 lg:grid-cols-5 gap-8\">\n {/* Interactive Pie Chart */}\n <div className=\"lg:col-span-2 space-y-4\">\n <div id=\"impact-chart\" className=\"chart-container\">\n <UnifiedCostBreakdownChart\n costBreakdown={dynamicCostBreakdown}\n totalCost={\n parseInt(\n config.totalEstimatedCost?.replace(/,/g, \"\") || \"0\",\n ) || unifiedData.totalCost\n }\n />\n </div>\n </div>\n\n {/* Industry-Specific Cost Categories */}\n <div className=\"lg:col-span-3 space-y-4\">\n <h4 className=\"font-semibold text-slate-900\">Cost Categories</h4>\n <div className=\"space-y-2\">\n {getIndustrySpecificCosts(\n config.clientIndustry,\n dynamicCostBreakdown,\n ).map((item, index) => {\n // Use dynamic cost breakdown values\n const costValues = [\n dynamicCostBreakdown.hard_costs,\n dynamicCostBreakdown.business_downtime,\n dynamicCostBreakdown.regulatory_fines,\n dynamicCostBreakdown.reputation_damage,\n ];\n const dynamicCost = costValues[index] || item.cost;\n // const totalForPercentage =\n // parseInt(\n // config.totalEstimatedCost?.replace(/,/g, \"\") || \"0\",\n // ) || unifiedData.totalCost;\n return (\n <div\n key={index}\n className=\"bg-white border border-slate-200 rounded-lg p-3\"\n >\n <div className=\"flex justify-between items-center mb-1\">\n <div className=\"flex items-center space-x-2\">\n <div\n className=\"w-3 h-3 rounded-full flex-shrink-0\"\n style={{\n backgroundColor: item.color,\n }}\n />\n <h5 className=\"font-semibold text-slate-900 text-sm\">\n {item.category}\n </h5>\n </div>\n <div className=\"text-right\">\n <span className=\"text-lg font-bold text-slate-900\">\n {formatCurrency(dynamicCost)}\n </span>\n </div>\n </div>\n <p className=\"text-xs text-slate-600 leading-tight\">\n {item.example}\n </p>\n </div>\n );\n })}\n </div>\n </div>\n </div>\n\n {/* Attack Scenario and Business Impact - 2 column grid */}\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-6\">\n {/* Attack Scenario */}\n <div className=\"bg-white border border-slate-200 rounded-lg p-6\">\n <h4 className=\"font-semibold text-slate-900 mb-4\">\n Attack Scenario\n </h4>\n <div className=\"space-y-3 text-sm\">\n <div className=\"flex justify-between\">\n <span className=\"text-slate-600\">Breach Type:</span>\n <span className=\"font-medium text-right\">\n {config.breachType}\n </span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-slate-600\">Industry:</span>\n <span className=\"font-medium text-right\">\n {config.clientIndustry}\n </span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-slate-600\">Records at Risk:</span>\n <span className=\"font-medium text-right\">\n {config.recordsAtRisk\n ? parseInt(config.recordsAtRisk).toLocaleString()\n : unifiedData.recordCount.toLocaleString()}\n </span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-slate-600\">% Breached:</span>\n <span className=\"font-medium text-right\">\n {config.percentageBreached}%\n </span>\n </div>\n </div>\n </div>\n\n {/* Business Impact */}\n <div className=\"bg-white border border-slate-200 rounded-lg p-6\">\n <h4 className=\"font-semibold text-slate-900 mb-4\">\n Business Impact\n </h4>\n <div className=\"space-y-3 text-sm\">\n <div className=\"flex justify-between\">\n <span className=\"text-slate-600\">Records Affected:</span>\n <span className=\"font-medium text-right\">\n {config.recordsAffected\n ? parseInt(config.recordsAffected).toLocaleString()\n : Math.round(\n unifiedData.recordCount *\n (parseInt(config.percentageBreached) / 100),\n ).toLocaleString()}\n </span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-slate-600\">Downtime Duration:</span>\n <span className=\"font-medium text-right\">\n {config.downtimeHours || unifiedData.hoursDown}h\n </span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-slate-600\">Cost per Hour:</span>\n <span className=\"font-medium text-right\">\n {formatCurrency(\n parseInt(config.downtimeCostPerHour) ||\n unifiedData.hourlyDowntimeCost,\n )}\n </span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-slate-600\">Total Downtime Cost:</span>\n <span className=\"font-medium text-right\">\n {config.totalDowntimeCost\n ? `$${config.totalDowntimeCost}`\n : formatCurrency(unifiedData.businessDowntime)}\n </span>\n </div>\n </div>\n </div>\n </div>\n </section>\n\n {/* Page 4 - Recommendations (Hidden for Cyber Impact Reports) */}\n\n <section className=\"report-page space-y-4 border-t border-slate-200 pt-8\">\n <h2 className=\"text-2xl font-bold text-slate-900\">\n Recommendations to Reduce Risk\n </h2>\n\n <div className=\"overflow-x-auto\">\n <table className=\"w-full caption-bottom text-sm\">\n <thead className=\"border-b\">\n <tr className=\"border-b transition-colors hover:bg-muted/50\">\n <th className=\"h-10 px-2 text-left align-middle font-medium text-muted-foreground w-12\">\n #\n </th>\n <th className=\"h-10 px-2 text-left align-middle font-medium text-muted-foreground w-1/4\">\n Title\n </th>\n <th className=\"h-10 px-2 text-left align-middle font-medium text-muted-foreground w-1/3\">\n Problem\n </th>\n <th className=\"h-10 px-2 text-left align-middle font-medium text-muted-foreground w-1/3\">\n Solution\n </th>\n </tr>\n </thead>\n <tbody>\n {config.recommendations.map((rec, index) => (\n <tr\n key={rec.id}\n className=\"border-b transition-colors hover:bg-muted/50\"\n >\n <td className=\"p-2 align-top\">\n <div className=\"w-6 h-6 bg-blue-600 text-white rounded-full flex items-center justify-center text-xs font-bold\">\n {index + 1}\n </div>\n </td>\n <td className=\"p-2 align-top\">\n <h4 className=\"text-sm font-semibold text-slate-900 leading-tight\">\n {rec.title}\n </h4>\n </td>\n <td className=\"p-2 align-top\">\n <p className=\"text-xs text-slate-700 leading-tight\">\n {rec.problem}\n </p>\n </td>\n <td className=\"p-2 align-top\">\n <p className=\"text-xs text-slate-700 leading-tight\">\n {rec.solution}\n </p>\n {rec.analogy && (\n <p className=\"text-xs text-slate-600 italic mt-1 leading-tight\">\n <span className=\"font-medium\">\n Think of it this way:\n </span>{\" \"}\n {rec.analogy}\n </p>\n )}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </section>\n\n {/* Page 5 - Next Steps */}\n <section className=\"report-page space-y-6 border-t border-slate-200 pt-8\">\n <div>\n <h2 className=\"text-2xl font-bold text-slate-900 mb-2\">\n Proposed Next Steps\n </h2>\n <p className=\"text-slate-600\">\n Taking action on these findings is critical to reducing your\n organization&apos;s cyber risk exposure and potential financial\n impact.\n </p>\n </div>\n\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-6\">\n <div className=\"border border-slate-200 rounded-lg p-6 space-y-3\">\n <h4 className=\"font-semibold text-slate-900\">\n Breach Likelihood Assessment\n </h4>\n <p className=\"text-sm text-slate-600\">\n Evaluate your current security posture and identify the most\n probable attack vectors targeting your organization.\n </p>\n </div>\n <div className=\"border border-slate-200 rounded-lg p-6 space-y-3\">\n <h4 className=\"font-semibold text-slate-900\">\n Cyber Insurance Health Score\n </h4>\n <p className=\"text-sm text-slate-600\">\n Assess your readiness for cyber insurance coverage and identify\n gaps that could affect your policy.\n </p>\n </div>\n </div>\n\n <div className=\"bg-blue-50 border border-blue-200 rounded-lg p-6 text-center\">\n <h4 className=\"font-semibold text-slate-900 mb-2\">\n Schedule Your Strategy Session\n </h4>\n <p className=\"text-slate-600 mb-4\">\n Let&apos;s discuss these findings and develop a customized\n cybersecurity roadmap for your organization.\n </p>\n <p className=\"text-slate-600\">\n Contact us at:\n <span className=\"font-medium text-slate-900\">\n {/* {user?.email || \"contact@company.com\"} */}\n </span>\n </p>\n </div>\n </section>\n\n {/* Page 6 - Understanding Your Risk Analysis */}\n <section className=\"report-page space-y-6 border-t border-slate-200 pt-8\">\n <div className=\"flex items-center space-x-3\">\n <div className=\"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center\">\n <span className=\"text-white text-lg\">?</span>\n </div>\n <div>\n <h2 className=\"text-2xl font-bold text-slate-900\">\n Understanding Your Risk Analysis\n </h2>\n <p className=\"text-slate-600\">\n Methodology and important information about this assessment\n </p>\n </div>\n </div>\n\n <div className=\"space-y-6\">\n <div className=\"bg-slate-50 rounded-lg p-6\">\n <h4 className=\"font-semibold text-slate-900 mb-4\">\n How We Calculate Risk Impact\n </h4>\n <p className=\"text-slate-700 mb-4\">\n This Financial Impact Analysis is built on industry-standard\n breach cost modeling frameworks, taking into account factors like:\n </p>\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n <div>\n <ul className=\"text-sm text-slate-700 space-y-1\">\n <li>• Industry sector</li>\n <li>• Company size</li>\n <li>• Type of data compromised</li>\n <li>• Threat vector (e.g., phishing, ransomware)</li>\n <li>• Regional regulatory requirements</li>\n </ul>\n </div>\n <div>\n <h5 className=\"font-medium text-slate-900 mb-2\">\n Cost estimates include both direct and indirect expenses, such\n as:\n </h5>\n <ul className=\"text-sm text-slate-700 space-y-1\">\n <li>• Business interruption</li>\n <li>• Investigation and legal expenses</li>\n <li>• Customer notification and credit monitoring</li>\n <li>• Regulatory fines and penalties</li>\n <li>• Reputational damage and PR costs</li>\n </ul>\n </div>\n </div>\n </div>\n\n <div className=\"bg-slate-50 rounded-lg p-6\">\n <h4 className=\"font-semibold text-slate-900 mb-4\">\n Threat Mapping by Industry\n </h4>\n <p className=\"text-slate-700 mb-4\">\n Threat types are matched to each industry using trend data from\n leading global reports and government advisories, including:\n </p>\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n <div>\n <ul className=\"text-sm text-slate-700 space-y-1\">\n <li>• Verizon Data Breach Investigations Report (DBIR)</li>\n <li>• IBM X-Force Threat Intelligence Index</li>\n <li>• ENISA Threat Landscape Report</li>\n </ul>\n </div>\n <div>\n <ul className=\"text-sm text-slate-700 space-y-1\">\n <li>• CISA Sector-Specific Threat Alerts</li>\n <li>• ThreatCaptain internal incident modeling</li>\n </ul>\n </div>\n </div>\n <p className=\"text-slate-700 mt-4\">\n This ensures the analysis reflects both likelihood and financial\n impact, helping you prioritize the risks most relevant to your\n clients.\n </p>\n </div>\n\n <div className=\"bg-yellow-50 border border-yellow-200 rounded-lg p-6\">\n <h4 className=\"font-semibold text-slate-900 mb-2\">\n Important Notes\n </h4>\n <ul className=\"text-slate-700 space-y-2\">\n <li className=\"flex items-start space-x-2\">\n <span className=\"text-yellow-600 mt-1\">•</span>\n <span>\n This analysis is based on industry norms and common threat\n patterns.\n </span>\n </li>\n <li className=\"flex items-start space-x-2\">\n <span className=\"text-yellow-600 mt-1\">•</span>\n <span>\n Actual breach outcomes and costs may vary based on the\n event&apos;s scope and response quality.\n </span>\n </li>\n <li className=\"flex items-start space-x-2\">\n <span className=\"text-yellow-600 mt-1\">•</span>\n <span>\n This report is intended to guide investment and\n preparedness—not to predict specific future events.\n </span>\n </li>\n </ul>\n </div>\n </div>\n </section>\n\n {/* Page 7 - Important Disclaimer */}\n <div className=\"report-page space-y-6 border-t border-slate-200 pt-8\">\n <div className=\"flex items-center space-x-3\">\n <div className=\"w-8 h-8 bg-gray-600 rounded-lg flex items-center justify-center\">\n <FileText className=\"w-5 h-5 text-white\" />\n </div>\n <div>\n <h2 className=\"text-2xl font-bold text-slate-900\">\n Important Disclaimer\n </h2>\n <p className=\"text-slate-600\">\n Legal limitations and professional guidance\n </p>\n </div>\n </div>\n\n\n </div>\n\n {/* Footer */}\n <div className=\"border-t border-slate-200 pt-4 text-center text-xs text-slate-500\">\n <p>\n Powered by ThreatCaptain • Generated on{\" \"}\n {new Date().toLocaleDateString()}\n </p>\n </div>\n </>\n );\n};\n\nexport default FinancialImpact;\n","// Insurance Health Score Calculation Utilities\nexport interface AssessmentResponse {\n question_id: string;\n answer: 'yes' | 'partial' | 'no';\n weight: number;\n category: string;\n}\n\nexport interface CategoryScore {\n score: number;\n maxScore: number;\n weight: number;\n percentage: number;\n}\n\nexport interface CategoryScores {\n accessControl: CategoryScore;\n dataProtection: CategoryScore;\n systemSecurity: CategoryScore;\n incidentResponse: CategoryScore;\n training: CategoryScore;\n insuranceReadiness: CategoryScore;\n}\n\n// Assessment questions configuration with weights\nexport const ASSESSMENT_CATEGORIES = {\n 'Access Control': {\n totalWeight: 45,\n questions: [\n { id: 'mfa_enabled', weight: 20, question: 'MFA enabled' },\n { id: 'admin_accounts', weight: 15, question: 'Admin account management' },\n { id: 'password_policy', weight: 10, question: 'Password policy' }\n ]\n },\n 'Data Protection': {\n totalWeight: 55,\n questions: [\n { id: 'data_backup', weight: 25, question: 'Data backup' },\n { id: 'data_encryption', weight: 20, question: 'Data encryption' },\n { id: 'data_classification', weight: 10, question: 'Data classification' }\n ]\n },\n 'System Security': {\n totalWeight: 55,\n questions: [\n { id: 'patch_mgmt', weight: 25, question: 'Patch management' },\n { id: 'antivirus', weight: 15, question: 'Antivirus protection' },\n { id: 'network_security', weight: 15, question: 'Network security' }\n ]\n },\n 'Incident Response': {\n totalWeight: 55,\n questions: [\n { id: 'incident_plan', weight: 20, question: 'Incident response plan' },\n { id: 'security_monitoring', weight: 25, question: 'Security monitoring' },\n { id: 'vendor_mgmt', weight: 10, question: 'Vendor management' }\n ]\n },\n 'Training & Governance': {\n totalWeight: 25,\n questions: [\n { id: 'employee_training', weight: 15, question: 'Employee training' },\n { id: 'security_policies', weight: 10, question: 'Security policies' }\n ]\n },\n 'Insurance Readiness': {\n totalWeight: 15,\n questions: [\n { id: 'cyber_insurance', weight: 15, question: 'Cyber insurance coverage' }\n ]\n }\n};\n\n// Business impact statistics for each question\nexport const BUSINESS_IMPACT_STATS = {\n mfa: 'Without MFA, accounts are 99% more likely to be compromised',\n data_backup: 'Companies without backups pay 10x more in ransomware incidents',\n patch_mgmt: 'Unpatched systems are targeted in 60% of cyberattacks',\n incident_plan: 'Companies with IR plans reduce breach costs by 30%',\n employee_training: 'Security training reduces human error incidents by 70%',\n // Add more as needed\n};\n\nexport const calculateInsuranceHealthScore = (responses: any): {\n totalScore: number;\n categoryScores: CategoryScores;\n scoreCategory: string;\n insuranceImpact: {\n coverageAvailability: string;\n premiumImpact: string;\n underwritingProcess: string;\n };\n} => {\n let totalPercentage = 0;\n let domainCount = 0;\n \n const categoryScores: CategoryScores = {\n accessControl: { score: 0, maxScore: 45, weight: 45, percentage: 0 },\n dataProtection: { score: 0, maxScore: 55, weight: 55, percentage: 0 },\n systemSecurity: { score: 0, maxScore: 55, weight: 55, percentage: 0 },\n incidentResponse: { score: 0, maxScore: 55, weight: 55, percentage: 0 },\n training: { score: 0, maxScore: 25, weight: 25, percentage: 0 },\n insuranceReadiness: { score: 0, maxScore: 15, weight: 15, percentage: 0 }\n };\n\n // Calculate scores for each category\n Object.entries(ASSESSMENT_CATEGORIES).forEach(([categoryName, categoryConfig]) => {\n let categoryActualPoints = 0;\n const categoryTotalWeight = categoryConfig.totalWeight;\n \n categoryConfig.questions.forEach(question => {\n const response = responses[question.id];\n let points = 0;\n \n if (response === 'yes') {\n points = question.weight;\n } else if (response === 'partial') {\n points = question.weight * 0.5;\n }\n // 'no' answers get 0 points\n \n categoryActualPoints += points;\n });\n \n // Calculate domain percentage\n const domainPercentage = (categoryActualPoints / categoryTotalWeight) * 100;\n \n totalPercentage += domainPercentage;\n domainCount += 1;\n \n // Map to category scores object\n const categoryKey = getCategoryKey(categoryName);\n if (categoryKey && categoryScores[categoryKey]) {\n categoryScores[categoryKey] = {\n score: categoryActualPoints,\n maxScore: categoryTotalWeight,\n weight: categoryTotalWeight,\n percentage: domainPercentage\n };\n }\n });\n \n // Calculate overall percentage and scale to 350-850 range\n const overallPercentage = totalPercentage / domainCount;\n const totalScore = Math.round(350 + (overallPercentage / 100 * 500));\n \n const scoreCategory = getScoreCategory(totalScore);\n const insuranceImpact = getInsuranceImpact(totalScore);\n \n return {\n totalScore,\n categoryScores,\n scoreCategory,\n insuranceImpact\n };\n};\n\nconst getCategoryKey = (categoryName: string): keyof CategoryScores | null => {\n const mapping: Record<string, keyof CategoryScores> = {\n 'Access Control': 'accessControl',\n 'Data Protection': 'dataProtection',\n 'System Security': 'systemSecurity',\n 'Incident Response': 'incidentResponse',\n 'Training & Governance': 'training',\n 'Insurance Readiness': 'insuranceReadiness'\n };\n return mapping[categoryName] || null;\n};\n\nexport const getScoreCategory = (score: number): string => {\n if (score >= 750) return 'excellent';\n if (score >= 650) return 'good';\n if (score >= 550) return 'fair';\n return 'poor';\n};\n\nexport const getScoreCategoryLabel = (score: number): string => {\n if (score >= 750) return 'Excellent';\n if (score >= 650) return 'Good';\n if (score >= 550) return 'Fair';\n return 'Poor';\n};\n\nexport const getScoreDescription = (score: number): string => {\n if (score >= 750) return 'Strong security posture, favorable insurance terms likely';\n if (score >= 650) return 'Solid security foundation, competitive insurance rates';\n if (score >= 550) return 'Some improvements needed, higher premiums possible';\n return 'Significant security gaps, coverage may be limited or denied';\n};\n\nexport const getInsuranceImpact = (score: number) => {\n if (score >= 775) {\n return {\n coverageAvailability: 'Premium coverage with enhanced terms',\n premiumImpact: 'Preferred rates with significant discounts',\n underwritingProcess: 'Fast-track approval, minimal documentation'\n };\n }\n \n if (score >= 700) {\n return {\n coverageAvailability: 'Comprehensive coverage options available',\n premiumImpact: 'Competitive rates, potential discounts',\n underwritingProcess: 'Streamlined approval process'\n };\n }\n \n if (score >= 625) {\n return {\n coverageAvailability: 'Good coverage with standard terms',\n premiumImpact: 'Standard market rates',\n underwritingProcess: 'Standard review and approval'\n };\n }\n \n if (score >= 550) {\n return {\n coverageAvailability: 'Limited coverage options',\n premiumImpact: 'Above-average premiums',\n underwritingProcess: 'Extended review process'\n };\n }\n \n if (score >= 450) {\n return {\n coverageAvailability: 'Restricted coverage with exclusions',\n premiumImpact: 'High premiums with surcharges',\n underwritingProcess: 'Detailed review, additional requirements'\n };\n }\n \n return {\n coverageAvailability: 'Minimal coverage, high exclusions',\n premiumImpact: 'Very high premiums, difficult to place',\n underwritingProcess: 'Extensive review, may require risk mitigation plan'\n };\n};\n\nexport const getSecurityDomains = (responses: any) => {\n const domains = [];\n \n Object.entries(ASSESSMENT_CATEGORIES).forEach(([categoryName, categoryConfig]) => {\n let categoryActualPoints = 0;\n const categoryTotalWeight = categoryConfig.totalWeight;\n \n categoryConfig.questions.forEach(question => {\n const response = responses[question.id];\n let points = 0;\n \n if (response === 'yes') {\n points = question.weight;\n } else if (response === 'partial') {\n points = question.weight * 0.5;\n }\n \n categoryActualPoints += points;\n });\n \n const percentage = (categoryActualPoints / categoryTotalWeight) * 100;\n \n domains.push({\n name: categoryName,\n score: categoryActualPoints,\n maxScore: categoryTotalWeight,\n percentage,\n progressColor: getProgressBarColor(percentage),\n displayScore: `${categoryActualPoints}/${categoryTotalWeight}`\n });\n });\n \n return domains;\n};\n\nexport const getProgressBarColor = (percentage: number): string => {\n if (percentage >= 80) return 'bg-green-500';\n if (percentage >= 60) return 'bg-yellow-500';\n return 'bg-red-500';\n};\n\nexport const getScoreRating = (score: number): { color: string; label: string } => {\n if (score >= 750) return { color: 'text-green-600', label: 'Excellent' };\n if (score >= 650) return { color: 'text-blue-600', label: 'Good' };\n if (score >= 550) return { color: 'text-yellow-600', label: 'Fair' };\n return { color: 'text-red-600', label: 'Poor' };\n};","import React from 'react';\n\ninterface InsuranceHealthGaugeProps {\n score: number;\n maxScore?: number;\n size?: number;\n}\n\nexport const InsuranceHealthGauge: React.FC<InsuranceHealthGaugeProps> = ({ \n score, \n maxScore = 850, \n size = 300 \n}) => {\n const minScore = 350;\n const normalizedScore = Math.max(minScore, Math.min(maxScore, score));\n const percentage = (normalizedScore - minScore) / (maxScore - minScore);\n \n // Updated score categories and colors per requirements\n const getScoreCategory = (score: number) => {\n if (score >= 750) return { category: 'Excellent', color: '#059669', bgColor: '#dcfce7' };\n if (score >= 650) return { category: 'Good', color: '#10b981', bgColor: '#ecfdf5' };\n if (score >= 550) return { category: 'Fair', color: '#f59e0b', bgColor: '#fefbeb' };\n return { category: 'Poor', color: '#ef4444', bgColor: '#fef2f2' };\n };\n\n const scoreInfo = getScoreCategory(normalizedScore);\n \n // 240-degree arc: starts at -210° and ends at 30°\n const startAngle = -210;\n const endAngle = 30;\n const totalArc = 240;\n const needleAngle = startAngle + (percentage * totalArc);\n \n const radius = size / 2 - 55;\n const centerX = size / 2;\n const centerY = size / 2 + 8;\n const strokeWidth = 14;\n \n // Convert degrees to radians\n const degToRad = (deg: number) => (deg * Math.PI) / 180;\n \n // Create arc path for segments\n const createArcPath = (startAngle: number, endAngle: number, radius: number) => {\n const startX = centerX + radius * Math.cos(degToRad(startAngle));\n const startY = centerY + radius * Math.sin(degToRad(startAngle));\n const endX = centerX + radius * Math.cos(degToRad(endAngle));\n const endY = centerY + radius * Math.sin(degToRad(endAngle));\n \n const largeArcFlag = endAngle - startAngle > 180 ? 1 : 0;\n \n return `M ${startX} ${startY} A ${radius} ${radius} 0 ${largeArcFlag} 1 ${endX} ${endY}`;\n };\n \n // Score segments with proper ranges and colors\n const segments = [\n { start: 350, end: 450, color: '#ef4444', label: 'Poor' }, // Red\n { start: 450, end: 550, color: '#f97316', label: 'Below Average' }, // Orange\n { start: 550, end: 625, color: '#f59e0b', label: 'Fair' }, // Yellow\n { start: 625, end: 700, color: '#3b82f6', label: 'Good' }, // Blue\n { start: 700, end: 775, color: '#10b981', label: 'Very Good' }, // Light Green\n { start: 775, end: 850, color: '#059669', label: 'Excellent' } // Dark Green\n ];\n \n // Tick marks positions\n const tickMarks = [350, 450, 550, 625, 700, 775, 850];\n \n // Calculate needle position\n const needleLength = radius - 10;\n const needleX = centerX + needleLength * Math.cos(degToRad(needleAngle));\n const needleY = centerY + needleLength * Math.sin(degToRad(needleAngle));\n\n return (\n <div className=\"flex flex-col items-center space-y-6\">\n <div className=\"relative\">\n <svg width={size} height={size * 0.8} className=\"overflow-visible\">\n {/* Background arc */}\n <path\n d={createArcPath(startAngle, endAngle, radius)}\n stroke=\"#e5e7eb\"\n strokeWidth={strokeWidth}\n fill=\"none\"\n strokeLinecap=\"round\"\n />\n \n {/* Colored segments */}\n {segments.map((segment, index) => {\n const segmentStartAngle = startAngle + ((segment.start - minScore) / (maxScore - minScore)) * totalArc;\n const segmentEndAngle = startAngle + ((segment.end - minScore) / (maxScore - minScore)) * totalArc;\n \n return (\n <path\n key={`segment-${index}`}\n d={createArcPath(segmentStartAngle, segmentEndAngle, radius)}\n stroke={segment.color}\n strokeWidth={strokeWidth}\n fill=\"none\"\n strokeLinecap=\"round\"\n opacity=\"0.8\"\n />\n );\n })}\n \n {/* Tick marks and labels */}\n {tickMarks.map((tickValue, index) => {\n const tickAngle = startAngle + ((tickValue - minScore) / (maxScore - minScore)) * totalArc;\n const tickInnerRadius = radius - strokeWidth / 2 - 5;\n const tickOuterRadius = radius + strokeWidth / 2 + 5;\n const labelRadius = radius + strokeWidth / 2 + 22;\n \n const tickInnerX = centerX + tickInnerRadius * Math.cos(degToRad(tickAngle));\n const tickInnerY = centerY + tickInnerRadius * Math.sin(degToRad(tickAngle));\n const tickOuterX = centerX + tickOuterRadius * Math.cos(degToRad(tickAngle));\n const tickOuterY = centerY + tickOuterRadius * Math.sin(degToRad(tickAngle));\n const labelX = centerX + labelRadius * Math.cos(degToRad(tickAngle));\n const labelY = centerY + labelRadius * Math.sin(degToRad(tickAngle));\n \n return (\n <g key={`tick-${index}`}>\n <line\n x1={tickInnerX}\n y1={tickInnerY}\n x2={tickOuterX}\n y2={tickOuterY}\n stroke=\"#6b7280\"\n strokeWidth=\"2\"\n />\n <text\n x={labelX}\n y={labelY + 4}\n textAnchor=\"middle\"\n className=\"text-xs font-medium fill-slate-600\"\n >\n {tickValue}\n </text>\n </g>\n );\n })}\n \n {/* Professional needle */}\n <g className=\"transition-all duration-1000 ease-out\" style={{ transformOrigin: `${centerX}px ${centerY}px` }}>\n <polygon\n points={`${centerX},${centerY - 6} ${centerX + needleLength - 15},${centerY} ${centerX},${centerY + 6} ${centerX - 15},${centerY}`}\n fill=\"#1f2937\"\n transform={`rotate(${needleAngle} ${centerX} ${centerY})`}\n className=\"transition-transform duration-1000 ease-out\"\n />\n </g>\n \n {/* Center pivot */}\n <circle\n cx={centerX}\n cy={centerY}\n r=\"10\"\n fill=\"#1f2937\"\n />\n <circle\n cx={centerX}\n cy={centerY}\n r=\"6\"\n fill=\"#374151\"\n />\n </svg>\n \n {/* Center score display */}\n <div className=\"absolute inset-0 flex flex-col items-center justify-center mt-44\">\n <div \n className=\"text-3xl font-bold mb-1\" \n style={{ color: scoreInfo.color }}\n >\n {normalizedScore}\n </div>\n <div className=\"text-xs text-slate-600 font-medium\">Insurance Health Score</div>\n </div>\n </div>\n \n {/* Status badge */}\n <div className=\"text-center\">\n <div \n className=\"inline-flex items-center px-6 py-2 rounded-full text-sm font-semibold\"\n style={{ \n backgroundColor: scoreInfo.bgColor,\n color: scoreInfo.color,\n border: `1px solid ${scoreInfo.color}40`\n }}\n >\n {scoreInfo.category}\n </div>\n </div>\n </div>\n );\n};","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { AlertTriangle, FileText } from \"lucide-react\";\nimport React from \"react\";\n\nimport {\n getScoreCategory,\n getSecurityDomains,\n} from \"@/utils/insuranceHealthScoreCalculator\";\n\nimport { InsuranceHealthGauge } from \"../Charts/InsuranceHealthGauge\";\n\nconst InsuranceHealthScore = ({ config }) => {\n // Check if assessment data exists\n const hasAssessmentData =\n config.assessmentData &&\n config.assessmentData.responses &&\n Object.keys(config.assessmentData.responses).length > 0;\n const score = hasAssessmentData ? config.insuranceHealthScore || 650 : null;\n const scoreCategory = score ? getScoreCategory(score) : null;\n\n // Define simple score category object if not returned properly\n const scoreCategoryData =\n typeof scoreCategory === \"string\"\n ? {\n category: scoreCategory,\n description: \"Insurance readiness assessment\",\n color: \"#3b82f6\",\n bgColor: \"bg-blue-600\",\n premiumImpact: \"Standard rates\",\n coverageAvailability: \"Good options\",\n premiumSavings: \"Up to 15%\",\n approvalSpeed: \"Standard\",\n }\n : scoreCategory;\n return (\n <>\n {/* Page 1 - Cover Page */}\n <section id=\"insurance-health-score\" className=\"report-page text-center space-y-6 pb-8 border-b border-slate-200\">\n {/* Report Title */}\n <div className=\"space-y-2\">\n <h1 className=\"text-4xl font-bold text-slate-900\">\n Cyber Insurance Health Score Report\n </h1>\n <p className=\"text-xl text-slate-600\">\n Understanding How Insurance Companies View Your Organization\n </p>\n </div>\n </section>\n\n {/* Page 2 - Executive Summary */}\n <section className=\"report-page space-y-6\">\n <div className=\"flex items-center space-x-3\">\n <FileText className=\"w-6 h-6 text-blue-600\" />\n <div>\n <h2 className=\"text-2xl font-bold text-slate-900\">\n Why Cyber Insurance Health Matters\n </h2>\n <p className=\"text-slate-600\">\n Understanding your organization&apos;s insurance readiness\n </p>\n </div>\n </div>\n\n {/* Executive Summary Content */}\n <div className=\"bg-slate-50 rounded-lg p-6 space-y-4\">\n <p className=\"text-slate-700 leading-relaxed\">\n {config.executiveSummary ||\n \"Think of this like checking your credit score before applying for a business loan. Just as your credit score determines whether banks will lend to you and at what rates, your cybersecurity \\\"credit score\\\" determines whether insurance companies will protect you when cybercriminals attack your business. Here's what most business owners don't realize: cyber insurance is rapidly becoming a business necessity. One ransomware attack can shut down your business for weeks and cost hundreds of thousands in recovery. Many of your clients and partners may soon require you to carry cyber insurance, and insurance companies are getting pickier about who they'll cover and how much they'll charge. This assessment shows you exactly where you stand in the insurance companies' eyes, so you can either improve your \\\"cybersecurity credit score\\\" to get better rates, or at least know what to expect when shopping for coverage.\"}\n </p>\n </div>\n\n {/* Insurance Score Banner */}\n <div\n className={`rounded-lg p-6 text-white text-center ${hasAssessmentData ? scoreCategoryData.bgColor : \"bg-slate-500\"}`}\n >\n <div className=\"flex items-center justify-center space-x-2 mb-2\">\n <div className=\"w-8 h-8 rounded-full bg-white/20 flex items-center justify-center\">\n <span className=\"text-lg font-bold\">\n {hasAssessmentData ? score : \"N/A\"}\n </span>\n </div>\n <h3 className=\"text-2xl font-bold\">INSURANCE HEALTH SCORE</h3>\n </div>\n <p className=\"text-4xl font-bold\">\n {hasAssessmentData ? `${score}/850` : \"Not Available\"}\n </p>\n <p className=\"text-lg font-semibold mt-2\">\n {hasAssessmentData\n ? scoreCategoryData.category\n : \"Assessment Required\"}\n </p>\n <p className=\"text-sm opacity-75 mt-1\">\n {hasAssessmentData\n ? scoreCategoryData.description\n : \"Complete the insurance health assessment to view your score\"}\n </p>\n </div>\n\n {/* Key Considerations */}\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-6\">\n <div className=\"space-y-4\">\n <h4 className=\"text-lg font-semibold text-slate-900\">\n Coverage Impact\n </h4>\n <div className=\"space-y-3\">\n <div className=\"flex items-start space-x-2\">\n <AlertTriangle className=\"w-4 h-4 text-blue-500 mt-1\" />\n <div>\n <p className=\"font-medium text-sm\">Premium Rates</p>\n </div>\n </div>\n <div className=\"flex items-start space-x-2\">\n <AlertTriangle className=\"w-4 h-4 text-blue-500 mt-1\" />\n <div>\n <p className=\"font-medium text-sm\">Coverage Availability</p>\n </div>\n </div>\n <div className=\"flex items-start space-x-2\">\n <AlertTriangle className=\"w-4 h-4 text-blue-500 mt-1\" />\n <div>\n <p className=\"font-medium text-sm\">Risk Evaluation</p>\n </div>\n </div>\n </div>\n </div>\n <div className=\"space-y-4\">\n <h4 className=\"text-lg font-semibold text-slate-900\">\n Things to Consider\n </h4>\n <div className=\"space-y-1\">\n <div className=\"flex items-center space-x-2\">\n <AlertTriangle className=\"w-4 h-4 text-amber-500\" />\n <span className=\"text-sm\">\n Cyber insurance rates are directly tied to your security\n posture\n </span>\n </div>\n <div className=\"flex items-center space-x-2\">\n <AlertTriangle className=\"w-4 h-4 text-amber-500\" />\n <span className=\"text-sm\">\n Insurers are increasingly requiring security controls\n </span>\n </div>\n <div className=\"flex items-center space-x-2\">\n <AlertTriangle className=\"w-4 h-4 text-amber-500\" />\n <span className=\"text-sm\">\n Claims approval depends on documented security measures\n </span>\n </div>\n </div>\n </div>\n </div>\n </section>\n\n {/* Page 3 - Insurance Health Score Results */}\n <section className=\"report-page space-y-6 border-t border-slate-200 pt-8\">\n <div>\n <h2 className=\"text-2xl font-bold text-slate-900 mb-2\">\n Your Insurance Health Score Results\n </h2>\n <p className=\"text-slate-600\">\n Assessment results and category breakdown\n </p>\n </div>\n\n {/* Main Gauge Display */}\n <div className=\"grid grid-cols-1 lg:grid-cols-5 gap-8\">\n <div className=\"lg:col-span-3 flex flex-col items-center space-y-4\">\n {hasAssessmentData ? (\n <InsuranceHealthGauge score={score} size={320} />\n ) : (\n <div\n className=\"flex flex-col items-center justify-center space-y-4\"\n style={{ height: \"320px\" }}\n >\n <div className=\"text-center space-y-2\">\n <div className=\"text-6xl font-bold text-slate-400\">N/A</div>\n <div className=\"text-lg font-semibold text-slate-600\">\n Not Available\n </div>\n <div className=\"text-sm text-slate-500 max-w-xs\">\n Complete the insurance health assessment to view your score\n gauge\n </div>\n </div>\n </div>\n )}\n <div className=\"text-center\"></div>\n </div>\n\n {/* Category Breakdown */}\n <div className=\"lg:col-span-2 space-y-4\">\n <h4 className=\"font-semibold text-slate-900\">\n Security Category Scores\n </h4>\n <div className=\"space-y-3\">\n {(() => {\n // Only show data if we have real assessment data from the database\n if (config.assessmentData && config.assessmentData.responses) {\n const domains = getSecurityDomains(\n config.assessmentData.responses,\n );\n\n return domains.map((domain, index) => {\n // Determine status pill based on percentage\n let statusPill = \"\";\n let statusClass = \"\";\n\n const percentage = domain.percentage || 0;\n\n if (percentage === 0) {\n statusPill = \"FAIL\";\n statusClass = \"bg-red-500 text-white\";\n } else if (percentage === 100) {\n statusPill = \"PASS\";\n statusClass = \"bg-green-500 text-white\";\n } else {\n statusPill = \"NEEDS IMPROVEMENT\";\n statusClass = \"bg-yellow-600 text-white\";\n }\n\n return (\n <div\n key={index}\n className=\"bg-white border border-slate-200 rounded-lg p-4\"\n >\n <div className=\"flex justify-between items-center\">\n <h5 className=\"font-medium text-slate-900 text-sm\">\n {domain.name}\n </h5>\n <div className=\"text-right\">\n <span\n className={`inline-block px-3 py-1 rounded-full text-xs font-semibold uppercase tracking-wider ${statusClass}`}\n >\n {statusPill}\n </span>\n </div>\n </div>\n </div>\n );\n });\n } else {\n // Show message when no assessment data is available\n return (\n <div className=\"bg-slate-50 border border-slate-200 rounded-lg p-6 text-center\">\n <p className=\"text-slate-600 text-sm\">\n No assessment data available for this client. Please\n complete a security assessment to see category scores.\n </p>\n </div>\n );\n }\n })()}\n </div>\n </div>\n </div>\n\n {/* Impact Statistics */}\n </section>\n\n {/* Page 4 - Recommendations */}\n <section className=\"report-page space-y-6 border-t border-slate-200 pt-8\">\n <div>\n <h2 className=\"text-2xl font-bold text-slate-900 mb-2\">\n Recommendations for Improvement\n </h2>\n <p className=\"text-slate-600\">\n Priority actions to enhance your insurance health score\n </p>\n </div>\n\n <div className=\"space-y-6\">\n {config.recommendations?.map((rec, index) => (\n <div\n key={rec.id}\n className=\"bg-white border border-slate-200 rounded-lg p-6\"\n >\n <div className=\"flex items-start space-x-4\">\n <div className=\"bg-blue-100 rounded-full p-2 flex-shrink-0\">\n <span className=\"text-blue-600 font-bold text-sm\">\n {index + 1}\n </span>\n </div>\n <div className=\"flex-grow\">\n <h4 className=\"font-semibold text-slate-900 mb-2\">\n {rec.title}\n </h4>\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n <div>\n <h5 className=\"font-medium text-red-600 mb-1\">\n Current Risk:\n </h5>\n <p className=\"text-sm text-slate-600\">{rec.problem}</p>\n </div>\n <div>\n <h5 className=\"font-medium text-green-600 mb-1\">\n Recommended Action:\n </h5>\n <p className=\"text-sm text-slate-600\">{rec.solution}</p>\n </div>\n </div>\n {rec.analogy && (\n <div className=\"mt-3 p-3 bg-blue-50 rounded border-l-4 border-blue-400\">\n <p className=\"text-sm text-blue-800 italic\">\n {rec.analogy}\n </p>\n </div>\n )}\n </div>\n </div>\n </div>\n )) || (\n <div className=\"text-center py-8\">\n <p className=\"text-slate-500\">\n No specific recommendations available. Your current security\n posture shows good practices.\n </p>\n </div>\n )}\n </div>\n </section>\n\n {/* Page 5 - Proposed Next Steps */}\n <section className=\"report-page space-y-6 border-t border-slate-200 pt-8\">\n <div className=\"flex items-center space-x-3\">\n <div className=\"w-8 h-8 bg-green-600 rounded-lg flex items-center justify-center\">\n <span className=\"text-white text-lg\">✓</span>\n </div>\n <div>\n <h2 className=\"text-2xl font-bold text-slate-900\">\n Proposed Next Steps\n </h2>\n <p className=\"text-slate-600\">\n How to leverage these insights for your organization\n </p>\n </div>\n </div>\n\n <div className=\"space-y-6\">\n {/* Immediate Actions */}\n <div className=\"bg-blue-50 border border-blue-200 rounded-lg p-6\">\n <h4 className=\"font-semibold text-slate-900 mb-4\">\n Immediate Actions\n </h4>\n <ul className=\"space-y-3 text-slate-700\">\n <li className=\"flex items-start space-x-3\">\n <span className=\"text-blue-600 mt-1.5 w-1.5 h-1.5 rounded-full bg-blue-600 flex-shrink-0\"></span>\n <span>\n Implement the highest priority recommendations identified in\n this assessment\n </span>\n </li>\n <li className=\"flex items-start space-x-3\">\n <span className=\"text-blue-600 mt-1.5 w-1.5 h-1.5 rounded-full bg-blue-600 flex-shrink-0\"></span>\n <span>\n Schedule a cybersecurity strategy session to discuss these\n findings in detail\n </span>\n </li>\n <li className=\"flex items-start space-x-3\">\n <span className=\"text-blue-600 mt-1.5 w-1.5 h-1.5 rounded-full bg-blue-600 flex-shrink-0\"></span>\n <span>\n Begin conversations with insurance providers about current\n coverage needs\n </span>\n </li>\n </ul>\n </div>\n\n {/* Two Column Layout */}\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-6\">\n {/* Insurance Planning */}\n <div className=\"bg-slate-50 border border-slate-200 rounded-lg p-6\">\n <h4 className=\"font-semibold text-slate-900 mb-4\">\n Insurance Planning\n </h4>\n <p className=\"text-slate-700 mb-4\">\n Use this score to have informed conversations with insurance\n providers and understand your options in the marketplace.\n </p>\n <ul className=\"space-y-2 text-slate-700\">\n <li className=\"flex items-start space-x-3\">\n <span className=\"text-slate-500 mt-1.5 w-1.5 h-1.5 rounded-full bg-slate-500 flex-shrink-0\"></span>\n <span>Shop for competitive quotes</span>\n </li>\n <li className=\"flex items-start space-x-3\">\n <span className=\"text-slate-500 mt-1.5 w-1.5 h-1.5 rounded-full bg-slate-500 flex-shrink-0\"></span>\n <span>Understand coverage requirements</span>\n </li>\n <li className=\"flex items-start space-x-3\">\n <span className=\"text-slate-500 mt-1.5 w-1.5 h-1.5 rounded-full bg-slate-500 flex-shrink-0\"></span>\n <span>Review existing policy terms</span>\n </li>\n </ul>\n </div>\n\n {/* Security Improvement */}\n <div className=\"bg-slate-50 border border-slate-200 rounded-lg p-6\">\n <h4 className=\"font-semibold text-slate-900 mb-4\">\n Security Improvement\n </h4>\n <p className=\"text-slate-700 mb-4\">\n Focus on the security areas that will have the most positive\n impact on your insurance posture and overall risk.\n </p>\n <ul className=\"space-y-2 text-slate-700\">\n <li className=\"flex items-start space-x-3\">\n <span className=\"text-slate-500 mt-1.5 w-1.5 h-1.5 rounded-full bg-slate-500 flex-shrink-0\"></span>\n <span>Prioritize high-impact improvements</span>\n </li>\n <li className=\"flex items-start space-x-3\">\n <span className=\"text-slate-500 mt-1.5 w-1.5 h-1.5 rounded-full bg-slate-500 flex-shrink-0\"></span>\n <span>Document security controls</span>\n </li>\n <li className=\"flex items-start space-x-3\">\n <span className=\"text-slate-500 mt-1.5 w-1.5 h-1.5 rounded-full bg-slate-500 flex-shrink-0\"></span>\n <span>Monitor progress regularly</span>\n </li>\n </ul>\n </div>\n </div>\n </div>\n </section>\n\n {/* Page 6 - Understanding Your Score */}\n <section className=\"report-page space-y-6 border-t border-slate-200 pt-8\">\n <div className=\"flex items-center space-x-3\">\n <div className=\"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center\">\n <span className=\"text-white text-lg\">?</span>\n </div>\n <div>\n <h2 className=\"text-2xl font-bold text-slate-900\">\n Understanding Your Score\n </h2>\n <p className=\"text-slate-600\">\n Methodology and important information about this assessment\n </p>\n </div>\n </div>\n\n <div className=\"space-y-6\">\n <div className=\"bg-slate-50 rounded-lg p-6\">\n <h4 className=\"font-semibold text-slate-900 mb-4\">\n How We Calculate Your Score\n </h4>\n <p className=\"text-slate-700 mb-4\">\n Your Insurance Health Score is calculated based on\n industry-standard cybersecurity frameworks and real insurance\n company requirements. Each category is weighted according to its\n importance in determining cyber insurance coverage and pricing.\n </p>\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n <div>\n <h5 className=\"font-medium text-slate-900 mb-2\">\n Score Ranges:\n </h5>\n <ul className=\"text-sm text-slate-700 space-y-1\">\n <li>\n <span className=\"font-medium text-green-600\">750-850:</span>{\" \"}\n Excellent - Premium discounts available\n </li>\n <li>\n <span className=\"font-medium text-blue-600\">650-749:</span>{\" \"}\n Good - Standard coverage available\n </li>\n <li>\n <span className=\"font-medium text-yellow-600\">\n 550-649:\n </span>{\" \"}\n Fair - Limited coverage options\n </li>\n <li>\n <span className=\"font-medium text-red-600\">Below 550:</span>{\" \"}\n Poor - Coverage may be denied\n </li>\n </ul>\n </div>\n <div>\n <h5 className=\"font-medium text-slate-900 mb-2\">\n What Insurance Companies Look For:\n </h5>\n <ul className=\"text-sm text-slate-700 space-y-1\">\n <li>• Multi-factor authentication implementation</li>\n <li>• Regular security training programs</li>\n <li>• Incident response procedures</li>\n <li>• Data backup and recovery plans</li>\n <li>• Network security controls</li>\n </ul>\n </div>\n </div>\n </div>\n\n <div className=\"bg-yellow-50 border border-yellow-200 rounded-lg p-6\">\n <h4 className=\"font-semibold text-slate-900 mb-2\">\n Important Notes\n </h4>\n <ul className=\"text-slate-700 space-y-2\">\n <li className=\"flex items-start space-x-2\">\n <span className=\"text-yellow-600 mt-1\">•</span>\n <span>\n This assessment is based on industry standards and general\n insurance requirements\n </span>\n </li>\n <li className=\"flex items-start space-x-2\">\n <span className=\"text-yellow-600 mt-1\">•</span>\n <span>\n Actual insurance coverage and pricing may vary by provider and\n specific circumstances\n </span>\n </li>\n <li className=\"flex items-start space-x-2\">\n <span className=\"text-yellow-600 mt-1\">•</span>\n <span>\n This report should be used as guidance alongside professional\n cybersecurity consultation\n </span>\n </li>\n </ul>\n </div>\n </div>\n </section>\n\n {/* Page 7 - Important Disclaimer */}\n <section className=\"report-page space-y-6 border-t border-slate-200 pt-8\">\n <div className=\"flex items-center space-x-3\">\n <div className=\"w-8 h-8 bg-gray-600 rounded-lg flex items-center justify-center\">\n <FileText className=\"w-5 h-5 text-white\" />\n </div>\n <div>\n <h2 className=\"text-2xl font-bold text-slate-900\">\n Important Disclaimer\n </h2>\n <p className=\"text-slate-600\">\n Legal limitations and professional guidance\n </p>\n </div>\n </div>\n\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-6\">\n <div>\n <h4 className=\"font-semibold text-green-600 mb-3\">\n What This Report IS:\n </h4>\n <ul className=\"text-slate-700 space-y-2 text-sm\">\n <li className=\"flex items-start space-x-2\">\n <span className=\"text-green-600 mt-1\">✓</span>\n <span>\n A cybersecurity assessment tool based on industry standards\n </span>\n </li>\n <li className=\"flex items-start space-x-2\">\n <span className=\"text-green-600 mt-1\">✓</span>\n <span>Educational guidance on insurance readiness factors</span>\n </li>\n <li className=\"flex items-start space-x-2\">\n <span className=\"text-green-600 mt-1\">✓</span>\n <span>\n A starting point for security improvement discussions\n </span>\n </li>\n <li className=\"flex items-start space-x-2\">\n <span className=\"text-green-600 mt-1\">✓</span>\n <span>Based on current cybersecurity best practices</span>\n </li>\n </ul>\n </div>\n\n <div>\n <h4 className=\"font-semibold text-red-600 mb-3\">\n What This Report IS NOT:\n </h4>\n <ul className=\"text-slate-700 space-y-2 text-sm\">\n <li className=\"flex items-start space-x-2\">\n <span className=\"text-red-600 mt-1\">✗</span>\n <span>A guarantee of insurance coverage or pricing</span>\n </li>\n <li className=\"flex items-start space-x-2\">\n <span className=\"text-red-600 mt-1\">✗</span>\n <span>A comprehensive security audit or penetration test</span>\n </li>\n <li className=\"flex items-start space-x-2\">\n <span className=\"text-red-600 mt-1\">✗</span>\n <span>Legal or financial advice</span>\n </li>\n <li className=\"flex items-start space-x-2\">\n <span className=\"text-red-600 mt-1\">✗</span>\n <span>\n A replacement for professional cybersecurity consultation\n </span>\n </li>\n </ul>\n </div>\n </div>\n </section>\n </>\n );\n};\n\nexport default InsuranceHealthScore;\n","import { FileText, Building2 } from \"lucide-react\";\nimport React from \"react\";\nimport { useSearchParams } from \"react-router-dom\";\n\nimport {\n transformToUnifiedData,\n type UnifiedReportData,\n} from \"@/utils/unifiedDataTransformer\";\n\nimport BreachLikelihood from \"../Reports/BreachLikelihood\";\nimport FinancialImpact from \"../Reports/FinancialImpact\";\nimport InsuranceHealthScore from \"../Reports/InsuranceHealth\";\n\nconst ReportMatrix = {\n \"financial-impact\": FinancialImpact,\n \"breach-likelihood\": BreachLikelihood,\n \"insurance-health-score\": InsuranceHealthScore,\n};\n\n// Legacy interface for backward compatibility with existing code\ninterface ReportConfig {\n templateId: string;\n mspCompanyName: string;\n mspLogoBase64?: string;\n clientCompanyName: string;\n clientIndustry: string;\n totalEstimatedCost: string;\n costRange: string;\n breachType: string;\n recordsAtRisk: string;\n percentageBreached: string;\n recordsAffected: string;\n downtimeHours: string;\n downtimeCostPerHour: string;\n totalDowntimeCost: string;\n executiveSummary: string;\n recommendations: Array<{\n id: string;\n title: string;\n problem: string;\n solution: string;\n analogy?: string;\n }>;\n reportDate: string;\n // Add simulation data for dynamic charts\n simulationData?: any;\n // Insurance health score specific fields\n insuranceHealthScore?: number;\n insuranceScoreCategory?: string;\n assessmentData?: any;\n categoryScores?: any;\n // Contact information\n contactEmail?: string;\n}\ninterface ReportPreviewProps {\n clientId?: string;\n config: ReportConfig;\n}\n\nconst ReportBuilder: React.FC<ReportPreviewProps> = ({ clientId, config }) => {\n const [searchParams] = useSearchParams();\n const reportTemplate = searchParams.get(\"template\");\n const templateArray =\n reportTemplate?.split(\",\").map((item) => item.trim()) || [];\n\n // Transform legacy config to unified data format with actual client data\n const unifiedData: UnifiedReportData = transformToUnifiedData(\n {\n companyName: config.mspCompanyName || \"Your MSP Company\",\n clientName: config.clientCompanyName || \"Client Company\",\n reportTitle: \"Cyber Financial Impact Analysis\",\n executiveSummary:\n config.executiveSummary ||\n \"This report provides a comprehensive analysis of the potential financial impact of cybersecurity threats on your organization.\",\n customNotes: \"\",\n generatedDate: new Date().toLocaleDateString(),\n audience: \"c-suite\",\n objective: \"expand-services\",\n },\n null,\n \"\",\n );\n\n return (\n <>\n {!clientId && (\n <div className=\"max-w-4xl mx-auto bg-white p-8 flex items-center justify-center min-h-[600px]\">\n <div className=\"text-center space-y-4\">\n <div className=\"w-16 h-16 bg-slate-100 rounded-full flex items-center justify-center mx-auto\">\n <FileText className=\"w-8 h-8 text-slate-400\" />\n </div>\n <h3 className=\"text-xl font-semibold text-slate-700\">\n Please Select a Client\n </h3>\n <p className=\"text-slate-500 max-w-md\">\n Choose a client from the dropdown above to generate and preview\n their cyber financial impact analysis report.\n </p>\n </div>\n </div>\n )}\n <nav>\n <ul className=\"report-toc max-w-4xl mx-auto bg-white p-4 flex space-x-4 overflow-x-auto\">\n {!!(templateArray.length > 1) &&\n templateArray.map((item) => {\n const Component = ReportMatrix[item];\n return Component ? (\n <li key={item}>\n <a\n href={`#${item}`}\n className=\"text-blue-600 hover:underline\"\n >\n {item\n .split(\"-\")\n .map(\n (word) => word.charAt(0).toUpperCase() + word.slice(1),\n )\n .join(\" \")}\n </a>\n </li>\n ) : null;\n })}\n </ul>\n </nav>\n <article\n id=\"print-report\"\n className=\"report-wrapper max-w-4xl mx-auto bg-white p-8 space-y-8\"\n >\n {/* MSP Logo */}\n <div className=\"mx-auto w-20 h-20 bg-slate-200 rounded-lg flex items-center justify-center\">\n {config.mspLogoBase64 ? (\n <img\n src={config.mspLogoBase64}\n alt=\"MSP Logo\"\n className=\"w-full h-full object-contain rounded-lg\"\n />\n ) : (\n <Building2 className=\"w-10 h-10 text-slate-500\" />\n )}\n </div>\n {/* Client Info Card */}\n <div className=\"max-w-md mx-auto bg-slate-50 rounded-lg p-6 space-y-3\">\n <div className=\"flex justify-between\">\n <span className=\"font-medium text-slate-700\">Prepared For:</span>\n <span className=\"text-slate-900\">\n {config.clientCompanyName || \"Client Company\"}\n </span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"font-medium text-slate-700\">Industry Sector:</span>\n <span className=\"text-slate-900\">\n {config.clientIndustry || \"Industry\"}\n </span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"font-medium text-slate-700\">Prepared By:</span>\n <span className=\"text-slate-900\">\n {config.mspCompanyName || \"MSP Company\"}\n </span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"font-medium text-slate-700\">Assessment Date:</span>\n <span className=\"text-slate-900\">\n {new Date().toLocaleDateString()}\n </span>\n </div>\n </div>\n\n {templateArray.map((item) => {\n const Component = ReportMatrix[item];\n return Component ? (\n <Component key={item} unifiedData={unifiedData} config={config} />\n ) : null;\n })}\n\n <footer className=\"report-page text-center pt-8 border-t border-slate-200\">\n <h4>Professional Recommendation</h4>\n <p className=\"text-sm text-slate-500\">\n This assessment combines financial impact modeling, insurance\n readiness evaluation, and breach likelihood analysis to provide a\n complete view of your organization&apos;s cybersecurity risk\n profile.\n </p>\n\n <p className=\"text-xs text-slate-400 mt-2\">\n Generated by {config.mspCompanyName} on&nbsp;\n {new Date().toLocaleDateString()}\n </p>\n </footer>\n </article>\n </>\n );\n};\n\nexport default ReportBuilder;\n"],"names":["_a","baseCost","formatCurrency","getScoreCategory","score","startAngle","endAngle","radius"],"mappings":";;;;;;;AAsBA,MAAM,YAAwB;AAAA,EAC5B;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,aACE;AAAA,IACF,UAAU;AAAA,IACV,SAAS;A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