@threatcaptain/tc-reports 0.2.4 → 0.2.7

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.
package/dist/index.js CHANGED
@@ -28678,7 +28678,7 @@ const Dashboard = () => {
28678
28678
  };
28679
28679
  return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: "bg-white rounded-xl border border-slate-200 shadow-sm p-6 mb-8", children: [
28680
28680
  /* @__PURE__ */ jsx("h3", { className: "text-xl font-semibold text-slate-900 mb-6", children: "Choose Your Report Template" }),
28681
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 gap-6 ", children: templates.map((template) => {
28681
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-6 ", children: templates.map((template) => {
28682
28682
  const getTemplateIcon = (id) => {
28683
28683
  switch (id) {
28684
28684
  case "financial-impact":
@@ -28718,82 +28718,31 @@ const Dashboard = () => {
28718
28718
  template.id
28719
28719
  );
28720
28720
  }) }),
28721
- /* @__PURE__ */ jsx(
28721
+ /* @__PURE__ */ jsx("div", { className: "w-full flex p-4", children: /* @__PURE__ */ jsx(
28722
28722
  Button$1,
28723
28723
  {
28724
28724
  size: "lg",
28725
+ variant: "default",
28726
+ className: "mx-auto w-full max-w-80",
28725
28727
  onClick: () => handleNavigation(),
28726
28728
  disabled: templateIds.length === 0,
28727
28729
  children: "Create Report"
28728
28730
  }
28729
- )
28731
+ ) })
28730
28732
  ] }) });
28731
28733
  };
28732
- const transformToUnifiedData = (formData, simulationData, logoBase64) => {
28733
- {
28734
- const sampleTotalCost = 156750;
28735
- const sampleRecordCount = 2500;
28736
- const sampleHoursDown = 18;
28737
- const sampleBusinessDowntime = 89200;
28738
- const sampleHardCosts = sampleTotalCost - sampleBusinessDowntime;
28739
- const sampleRegulatoryFines = sampleTotalCost * 0.15;
28740
- const sampleReputationDamage = sampleTotalCost * 0.1;
28741
- const sampleCostBreakdown = {
28742
- hard_costs: sampleHardCosts,
28743
- business_downtime: sampleBusinessDowntime,
28744
- regulatory_fines: sampleRegulatoryFines,
28745
- reputation_damage: sampleReputationDamage
28746
- };
28747
- return {
28748
- companyName: formData.companyName || "Your MSP Company",
28749
- clientName: formData.clientName || "Client Company",
28750
- reportTitle: formData.reportTitle || "Cyber Financial Impact Analysis",
28751
- reportDate: new Date(formData.generatedDate || Date.now()).toLocaleDateString(),
28752
- executiveSummary: formData.executiveSummary || "This report provides a comprehensive analysis of the potential financial impact of cybersecurity threats on your organization.",
28753
- customNotes: "Please review the recommendations and contact us to discuss implementation strategies.",
28754
- logoUrl: logoBase64,
28755
- primaryColor: "#2563eb",
28756
- secondaryColor: "#1e40af",
28757
- // Sample financial data
28758
- totalCost: sampleTotalCost,
28759
- recordCount: sampleRecordCount,
28760
- businessDowntime: sampleBusinessDowntime,
28761
- hoursDown: sampleHoursDown,
28762
- breachType: "Ransomware Attack",
28763
- industry: "Healthcare",
28764
- // Sample insurance data - pass through from form data
28765
- insuranceScore: formData.insuranceHealthScore || 490,
28766
- insuranceCategory: formData.insuranceScoreCategory || "Poor",
28767
- // Enhanced sample metrics
28768
- percentageBreached: 35,
28769
- costPerRecord: Math.round(sampleTotalCost / sampleRecordCount),
28770
- hourlyDowntimeCost: Math.round(sampleBusinessDowntime / sampleHoursDown),
28771
- // Cost breakdown
28772
- costBreakdown: sampleCostBreakdown,
28773
- // Individual cost components with percentages (formatted for display)
28774
- hardCosts: sampleHardCosts.toLocaleString(),
28775
- hardCostsPercentage: (sampleHardCosts / sampleTotalCost * 100).toFixed(1),
28776
- businessDowntimePercentage: (sampleBusinessDowntime / sampleTotalCost * 100).toFixed(1),
28777
- regulatoryFines: sampleRegulatoryFines.toLocaleString(),
28778
- regulatoryFinesPercentage: (sampleRegulatoryFines / sampleTotalCost * 100).toFixed(1),
28779
- reputationDamage: sampleReputationDamage.toLocaleString(),
28780
- reputationDamagePercentage: (sampleReputationDamage / sampleTotalCost * 100).toFixed(1)
28781
- };
28782
- }
28783
- };
28784
- const BreachLikelihood = ({ config }) => {
28734
+ const BreachLikelihood = ({ reportData }) => {
28785
28735
  var _a;
28736
+ const { clientData, securityAssessment, user } = reportData;
28786
28737
  const calculateBreachLikelihood = (protectionLevel) => {
28787
- var _a2, _b;
28788
- if (((_a2 = config.assessmentData) == null ? void 0 : _a2.overall_breach_likelihood) !== null && ((_b = config.assessmentData) == null ? void 0 : _b.overall_breach_likelihood) !== void 0) {
28789
- return Math.round(config.assessmentData.overall_breach_likelihood);
28738
+ if ((securityAssessment == null ? void 0 : securityAssessment.overall_breach_likelihood) !== null && (securityAssessment == null ? void 0 : securityAssessment.overall_breach_likelihood) !== void 0) {
28739
+ return Math.round(securityAssessment.overall_breach_likelihood);
28790
28740
  }
28791
28741
  return Math.max(5, 100 - protectionLevel);
28792
28742
  };
28793
28743
  const calculateProtectionLevel = () => {
28794
- var _a2;
28795
- if ((_a2 = config.assessmentData) == null ? void 0 : _a2.findings) {
28796
- const findings = config.assessmentData.findings;
28744
+ if (securityAssessment == null ? void 0 : securityAssessment.findings) {
28745
+ const findings = securityAssessment.findings;
28797
28746
  const totalControls = 18;
28798
28747
  let implementedControls = 0;
28799
28748
  for (let i = 1; i <= totalControls; i++) {
@@ -28804,7 +28753,7 @@ const BreachLikelihood = ({ config }) => {
28804
28753
  }
28805
28754
  return Math.round(implementedControls / totalControls * 100);
28806
28755
  }
28807
- return 19;
28756
+ return 0;
28808
28757
  };
28809
28758
  const calculateRiskExposure = (baseCost2, likelihood) => {
28810
28759
  return Math.round(baseCost2 * (likelihood / 100));
@@ -28812,7 +28761,7 @@ const BreachLikelihood = ({ config }) => {
28812
28761
  const currentProtection = calculateProtectionLevel();
28813
28762
  const attackLikelihood = calculateBreachLikelihood(currentProtection);
28814
28763
  const baseCost = parseInt(
28815
- ((_a = config.totalEstimatedCost) == null ? void 0 : _a.replace(/,/g, "")) || "510000"
28764
+ ((_a = clientData.totalEstimatedCost) == null ? void 0 : _a.replace(/,/g, "")) || "510000"
28816
28765
  );
28817
28766
  const realRiskExposure = calculateRiskExposure(baseCost, attackLikelihood);
28818
28767
  const riskReduction = Math.max(0, 100 - attackLikelihood);
@@ -28825,14 +28774,14 @@ const BreachLikelihood = ({ config }) => {
28825
28774
  /* @__PURE__ */ jsx("h1", { className: "text-2xl font-bold text-slate-900 text-left", children: "Executive Summary" }),
28826
28775
  /* @__PURE__ */ jsxs("div", { className: "bg-slate-50 rounded-lg p-4 text-left space-y-2", children: [
28827
28776
  /* @__PURE__ */ jsx("h3", { className: "text-base font-semibold text-slate-900", children: "Why This Breach Likelihood Assessment Matters" }),
28828
- /* @__PURE__ */ jsx("div", { className: "text-slate-700 leading-relaxed whitespace-pre-line text-sm", children: config.executiveSummary })
28777
+ /* @__PURE__ */ jsx("div", { className: "text-slate-700 leading-relaxed whitespace-pre-line text-sm", children: clientData.executiveSummary ? clientData.executiveSummary : "" })
28829
28778
  ] }),
28830
28779
  /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4 mb-4", children: [
28831
28780
  /* @__PURE__ */ jsxs("div", { className: "bg-red-600 text-white p-6 rounded-lg text-center", children: [
28832
28781
  /* @__PURE__ */ jsx(AlertTriangle, { className: "w-8 h-8 mx-auto mb-3" }),
28833
28782
  /* @__PURE__ */ jsxs("div", { className: "text-3xl font-bold mb-2", children: [
28834
28783
  "$",
28835
- baseCost.toLocaleString()
28784
+ baseCost ? baseCost.toLocaleString() : "510,000"
28836
28785
  ] }),
28837
28786
  /* @__PURE__ */ jsx("div", { className: "text-xs opacity-90", children: "What an attack could cost your business" })
28838
28787
  ] }),
@@ -28992,7 +28941,7 @@ const BreachLikelihood = ({ config }) => {
28992
28941
  ] }),
28993
28942
  (() => {
28994
28943
  var _a2;
28995
- const controlMappings = ((_a2 = config.assessmentData) == null ? void 0 : _a2.control_mappings) || [];
28944
+ const controlMappings = ((_a2 = clientData.securityAssessment) == null ? void 0 : _a2.control_mappings) || [];
28996
28945
  const implementedControls = Array.isArray(controlMappings) ? controlMappings.filter((c2) => c2.implemented === true) : [];
28997
28946
  const potentialControls = Array.isArray(controlMappings) ? controlMappings.filter((c2) => c2.implemented !== true) : [];
28998
28947
  const renderControlRow = (control) => {
@@ -29179,7 +29128,7 @@ const BreachLikelihood = ({ config }) => {
29179
29128
  /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-slate-900 mb-4", children: "Control Implementation Impact" }),
29180
29129
  (() => {
29181
29130
  var _a2;
29182
- const controlMappings = ((_a2 = config.assessmentData) == null ? void 0 : _a2.control_mappings) || [];
29131
+ const controlMappings = ((_a2 = clientData.securityAssessment) == null ? void 0 : _a2.control_mappings) || [];
29183
29132
  const implementedControls = Array.isArray(controlMappings) ? controlMappings.filter(
29184
29133
  (control) => control.implemented === true
29185
29134
  ) : [];
@@ -29257,9 +29206,9 @@ const BreachLikelihood = ({ config }) => {
29257
29206
  " ",
29258
29207
  /* @__PURE__ */ jsx("strong", { children: "Insurance Readiness:" }),
29259
29208
  " ",
29260
- config.insuranceHealthScore || 490,
29209
+ clientData.insuranceHealthScore || 490,
29261
29210
  "/850 (",
29262
- config.insuranceScoreCategory || "Poor",
29211
+ clientData.insuranceScoreCategory || "Poor",
29263
29212
  ")"
29264
29213
  ] }),
29265
29214
  /* @__PURE__ */ jsxs("div", { children: [
@@ -29312,7 +29261,11 @@ const BreachLikelihood = ({ config }) => {
29312
29261
  /* @__PURE__ */ jsxs("div", { className: "bg-gradient-to-r from-blue-600 to-blue-800 text-white rounded-lg p-8 text-center", children: [
29313
29262
  /* @__PURE__ */ jsx("h3", { className: "text-2xl font-bold mb-4", children: "Ready to Protect Your Business?" }),
29314
29263
  /* @__PURE__ */ jsx("p", { className: "text-lg mb-6 opacity-90", children: "You know what you're facing and what it costs to fix. The question isn't whether you can afford protection - it's whether you can afford to go without it." }),
29315
- /* @__PURE__ */ jsx("div", { className: "text-lg mb-4" }),
29264
+ /* @__PURE__ */ jsxs("div", { className: "text-lg mb-4", children: [
29265
+ /* @__PURE__ */ jsx("strong", { children: "Contact:" }),
29266
+ " ",
29267
+ (user == null ? void 0 : user.email) || "contact@company.com"
29268
+ ] }),
29316
29269
  /* @__PURE__ */ jsx("div", { className: "text-sm opacity-80", children: "Every day you wait is another day criminals could strike. Every protection you add makes your business safer." })
29317
29270
  ] })
29318
29271
  ] }),
@@ -29359,10 +29312,9 @@ const BreachLikelihood = ({ config }) => {
29359
29312
  /* @__PURE__ */ jsxs("p", { children: [
29360
29313
  /* @__PURE__ */ jsx("strong", { children: "Your result:" }),
29361
29314
  " $",
29362
- baseCost.toLocaleString(),
29363
- " ",
29364
- "potential cost for small ",
29365
- config.clientIndustry,
29315
+ baseCost ? baseCost.toLocaleString() : "510,000",
29316
+ " potential cost for small ",
29317
+ clientData.industry,
29366
29318
  " business"
29367
29319
  ] })
29368
29320
  ] })
@@ -29411,22 +29363,31 @@ const BreachLikelihood = ({ config }) => {
29411
29363
  ] });
29412
29364
  };
29413
29365
  const getExecutiveSummaryTemplate = (industry) => {
29414
- const industryTemplates = {
29415
- "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.",
29416
- "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.",
29417
- "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.",
29418
- "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.",
29419
- "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.",
29420
- "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.",
29421
- "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.",
29422
- "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."
29423
- };
29424
- 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.";
29366
+ switch (industry) {
29367
+ case "Healthcare":
29368
+ return "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.";
29369
+ case "Legal":
29370
+ return "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.";
29371
+ case "Financial Services":
29372
+ return "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.";
29373
+ case "Education":
29374
+ return "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.";
29375
+ case "Manufacturing":
29376
+ return "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.";
29377
+ case "Retail":
29378
+ return "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.";
29379
+ case "Technology":
29380
+ return "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.";
29381
+ case "Government":
29382
+ return "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.";
29383
+ default:
29384
+ return "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.";
29385
+ }
29425
29386
  };
29426
29387
  const formatCurrency = (value) => {
29427
29388
  return `$${value.toLocaleString()}`;
29428
29389
  };
29429
- const getIndustrySpecificCosts = (industry, costBreakdown) => {
29390
+ const getIndustrySpecificCosts = (industry, simulationData) => {
29430
29391
  const industryExamples = {
29431
29392
  "Healthcare": {
29432
29393
  "Post-Breach Response": "Forensic analysis, legal counsel, incident response team",
@@ -29458,74 +29419,68 @@ const getIndustrySpecificCosts = (industry, costBreakdown) => {
29458
29419
  {
29459
29420
  category: "Post-Breach Response",
29460
29421
  example: examples["Post-Breach Response"],
29461
- cost: costBreakdown.hard_costs,
29422
+ cost: simulationData.hard_costs,
29462
29423
  color: "#dc2626"
29463
29424
  },
29464
29425
  {
29465
29426
  category: "Business Downtime",
29466
29427
  example: examples["Business Downtime"],
29467
- cost: costBreakdown.business_downtime,
29428
+ cost: simulationData.business_downtime,
29468
29429
  color: "#3b82f6"
29469
29430
  },
29470
29431
  {
29471
29432
  category: "Notification",
29472
29433
  example: examples["Notification"],
29473
- cost: costBreakdown.regulatory_fines,
29434
+ cost: simulationData.regulatory_fines,
29474
29435
  color: "#ca8a04"
29475
29436
  },
29476
29437
  {
29477
29438
  category: "Investigation",
29478
29439
  example: examples["Investigation"],
29479
- cost: costBreakdown.reputation_damage,
29440
+ cost: simulationData.reputation_damage,
29480
29441
  color: "#16a34a"
29481
29442
  }
29482
29443
  ];
29483
29444
  };
29484
- const createCostBreakdownFromSimulation = ({ costBreakdown }) => {
29445
+ const createCostBreakdownFromSimulation = ({ cost_breakdown }) => {
29485
29446
  var _a, _b, _c, _d;
29486
- if (typeof costBreakdown === "object" && !Array.isArray(costBreakdown)) {
29487
- return {
29488
- hard_costs: (costBreakdown.forensic_costs || 0) + (costBreakdown.legal_costs || 0) + (costBreakdown.system_restoration || 0),
29489
- business_downtime: costBreakdown.business_interruption || 0,
29490
- regulatory_fines: costBreakdown.regulatory_fines || 0,
29491
- reputation_damage: costBreakdown.pr_costs || 0
29492
- };
29493
- } else if (Array.isArray(costBreakdown)) {
29494
- return {
29495
- hard_costs: ((_a = costBreakdown.find((item) => item.category === "Ex-Post Response")) == null ? void 0 : _a.amount) || 0,
29496
- business_downtime: ((_b = costBreakdown.find((item) => item.category === "Business Downtime")) == null ? void 0 : _b.amount) || 0,
29497
- regulatory_fines: ((_c = costBreakdown.find((item) => item.category === "Notification")) == null ? void 0 : _c.amount) || 0,
29498
- reputation_damage: ((_d = costBreakdown.find((item) => item.category === "Investigation")) == null ? void 0 : _d.amount) || 0
29499
- };
29500
- }
29447
+ return {
29448
+ hard_costs: ((_a = cost_breakdown.find((item) => item.category === "Ex-Post Response")) == null ? void 0 : _a.amount) || 0,
29449
+ business_downtime: ((_b = cost_breakdown.find((item) => item.category === "Business Downtime")) == null ? void 0 : _b.amount) || 0,
29450
+ regulatory_fines: ((_c = cost_breakdown.find((item) => item.category === "Notification")) == null ? void 0 : _c.amount) || 0,
29451
+ reputation_damage: ((_d = cost_breakdown.find((item) => item.category === "Investigation")) == null ? void 0 : _d.amount) || 0
29452
+ };
29501
29453
  };
29502
29454
  const UnifiedCostBreakdownChart = ({
29503
- costBreakdown,
29455
+ hard_costs,
29456
+ business_downtime,
29457
+ regulatory_fines,
29458
+ reputation_damage,
29504
29459
  totalCost,
29505
29460
  showTotal = true
29506
29461
  }) => {
29507
29462
  const data = [
29508
29463
  {
29509
29464
  name: "Post-Breach Response",
29510
- value: costBreakdown.hard_costs || 0,
29465
+ value: hard_costs || 0,
29511
29466
  color: "#dc2626",
29512
29467
  label: "Post-Breach Response"
29513
29468
  },
29514
29469
  {
29515
29470
  name: "Business Downtime",
29516
- value: costBreakdown.business_downtime || 0,
29471
+ value: business_downtime || 0,
29517
29472
  color: "#3b82f6",
29518
29473
  label: "Business Downtime"
29519
29474
  },
29520
29475
  {
29521
29476
  name: "Notification",
29522
- value: costBreakdown.regulatory_fines || 0,
29477
+ value: regulatory_fines || 0,
29523
29478
  color: "#ca8a04",
29524
29479
  label: "Notification"
29525
29480
  },
29526
29481
  {
29527
29482
  name: "Investigation",
29528
- value: costBreakdown.reputation_damage || 0,
29483
+ value: reputation_damage || 0,
29529
29484
  color: "#16a34a",
29530
29485
  label: "Investigation"
29531
29486
  }
@@ -29636,25 +29591,27 @@ const UnifiedCostBreakdownChart = ({
29636
29591
  }
29637
29592
  ) }) });
29638
29593
  };
29639
- const FinancialImpact = ({ config, unifiedData }) => {
29640
- var _a, _b, _c;
29641
- const getDisplayExecutiveSummary = () => {
29642
- if (config.executiveSummary) return config.executiveSummary;
29643
- return getExecutiveSummaryTemplate(config.clientIndustry);
29594
+ const FinancialImpact = ({ reportData }) => {
29595
+ var _a;
29596
+ const { clientData, simulationData, user } = reportData;
29597
+ const { industry } = clientData;
29598
+ const displayExecutiveSummary = () => {
29599
+ if (clientData.executiveSummary) return clientData.executiveSummary;
29600
+ return getExecutiveSummaryTemplate(clientData.industry);
29644
29601
  };
29645
- const getIndustryRiskLevel = (industry) => {
29602
+ const getIndustryRiskLevel = (industry2) => {
29646
29603
  const highRiskIndustries = [
29647
29604
  "Healthcare",
29648
29605
  "Financial Services",
29649
29606
  "Government"
29650
29607
  ];
29651
29608
  const mediumRiskIndustries = ["Retail", "Education", "Legal"];
29652
- if (highRiskIndustries.includes(industry))
29609
+ if (highRiskIndustries.includes(industry2))
29653
29610
  return {
29654
29611
  level: "High",
29655
29612
  color: "text-red-600 bg-red-50"
29656
29613
  };
29657
- if (mediumRiskIndustries.includes(industry))
29614
+ if (mediumRiskIndustries.includes(industry2))
29658
29615
  return {
29659
29616
  level: "Medium",
29660
29617
  color: "text-yellow-600 bg-yellow-50"
@@ -29664,7 +29621,7 @@ const FinancialImpact = ({ config, unifiedData }) => {
29664
29621
  color: "text-green-600 bg-green-50"
29665
29622
  };
29666
29623
  };
29667
- const getIndustryThreats = (industry) => {
29624
+ const getIndustryThreats = (industry2) => {
29668
29625
  const industryThreats = {
29669
29626
  // Snake case mappings (database format)
29670
29627
  "healthcare": ["Phishing", "Ransomware", "Third Party Breach"],
@@ -29842,21 +29799,26 @@ const FinancialImpact = ({ config, unifiedData }) => {
29842
29799
  "Third Party Breach"
29843
29800
  ]
29844
29801
  };
29845
- return industryThreats[industry] || [
29802
+ return industryThreats[industry2] || [
29846
29803
  "Phishing Attacks",
29847
29804
  "Business Email Compromise",
29848
29805
  "Data Exfiltration"
29849
29806
  ];
29850
29807
  };
29851
- const riskLevel = getIndustryRiskLevel(config.clientIndustry);
29852
- const dynamicCostBreakdown = createCostBreakdownFromSimulation(
29853
- config.simulationData || {}
29854
- );
29808
+ const riskLevel = getIndustryRiskLevel(industry);
29809
+ const dynamicCostBreakdown = createCostBreakdownFromSimulation(simulationData);
29855
29810
  return /* @__PURE__ */ jsxs(Fragment, { children: [
29856
- /* @__PURE__ */ jsx("section", { id: "financial-impact", className: "report-page text-center space-y-6 pb-8 border-b border-slate-200", children: /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
29857
- /* @__PURE__ */ jsx("h1", { className: "text-4xl font-bold text-slate-900", children: "Cyber Financial Impact Analysis" }),
29858
- /* @__PURE__ */ jsx("p", { className: "text-xl text-slate-600", children: "Quantifying Your Organization's Cyber Risk Exposure" })
29859
- ] }) }),
29811
+ /* @__PURE__ */ jsx(
29812
+ "section",
29813
+ {
29814
+ id: "financial-impact",
29815
+ className: "report-page text-center space-y-6 pb-8 border-b border-slate-200",
29816
+ children: /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
29817
+ /* @__PURE__ */ jsx("h1", { className: "text-4xl font-bold text-slate-900", children: "Cyber Financial Impact Analysis" }),
29818
+ /* @__PURE__ */ jsx("p", { className: "text-xl text-slate-600", children: "Quantifying Your Organization's Cyber Risk Exposure" })
29819
+ ] })
29820
+ }
29821
+ ),
29860
29822
  /* @__PURE__ */ jsxs("section", { className: "report-page space-y-6", children: [
29861
29823
  /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-3", children: [
29862
29824
  /* @__PURE__ */ jsx(FileText, { className: "w-6 h-6 text-blue-600" }),
@@ -29865,21 +29827,21 @@ const FinancialImpact = ({ config, unifiedData }) => {
29865
29827
  /* @__PURE__ */ jsx("p", { className: "text-slate-600", children: "An overview of your organization's financial cyber risk" })
29866
29828
  ] })
29867
29829
  ] }),
29868
- /* @__PURE__ */ jsx("div", { className: "bg-slate-50 rounded-lg p-6", children: /* @__PURE__ */ jsx("p", { className: "text-slate-700 leading-relaxed", children: getDisplayExecutiveSummary() }) }),
29830
+ /* @__PURE__ */ jsx("div", { className: "bg-slate-50 rounded-lg p-6", children: /* @__PURE__ */ jsx("p", { className: "text-slate-700 leading-relaxed", children: displayExecutiveSummary() }) }),
29869
29831
  /* @__PURE__ */ jsxs("div", { className: "bg-red-600 rounded-lg p-6 text-white text-center", children: [
29870
29832
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center space-x-2 mb-2", children: [
29871
29833
  /* @__PURE__ */ jsx(DollarSign, { className: "w-8 h-8" }),
29872
29834
  /* @__PURE__ */ jsx("h3", { className: "text-2xl font-bold", children: "TOTAL POTENTIAL IMPACT" })
29873
29835
  ] }),
29874
- /* @__PURE__ */ jsx("p", { className: "text-4xl font-bold", children: config.totalEstimatedCost ? `${config.totalEstimatedCost}` : formatCurrency(unifiedData.totalCost) }),
29836
+ /* @__PURE__ */ jsx("p", { className: "text-4xl font-bold", children: simulationData.total_cost ? formatCurrency(simulationData.total_cost) : "" }),
29875
29837
  /* @__PURE__ */ jsxs("p", { className: "text-sm opacity-75 mt-2", children: [
29876
- "Cost Range:",
29877
- config.costRange || `$${Math.round((parseInt(((_a = config.totalEstimatedCost) == null ? void 0 : _a.replace(/[^0-9]/g, "")) || "0") || unifiedData.totalCost) * 0.75).toLocaleString()} - $${Math.round((parseInt(((_b = config.totalEstimatedCost) == null ? void 0 : _b.replace(/[^0-9]/g, "")) || "0") || unifiedData.totalCost) * 1.5).toLocaleString()}`
29838
+ "Cost Range: ",
29839
+ `$${Math.round(simulationData.total_cost * 0.75).toLocaleString()} - $${Math.round(simulationData.total_cost * 1.5).toLocaleString()}`
29878
29840
  ] })
29879
29841
  ] }),
29880
29842
  /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
29881
29843
  /* @__PURE__ */ jsx("h4", { className: "text-lg font-semibold text-slate-900", children: "Top Industry Threats" }),
29882
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: getIndustryThreats(config.clientIndustry).map((threat, index2) => /* @__PURE__ */ jsxs(
29844
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: getIndustryThreats(clientData.industry).map((threat, index2) => /* @__PURE__ */ jsxs(
29883
29845
  "div",
29884
29846
  {
29885
29847
  className: "bg-red-50 border border-red-200 rounded-lg p-4 flex items-center space-x-3",
@@ -29905,22 +29867,20 @@ const FinancialImpact = ({ config, unifiedData }) => {
29905
29867
  }
29906
29868
  ),
29907
29869
  /* @__PURE__ */ jsxs("p", { className: "text-slate-600", children: [
29908
- config.clientIndustry === "Healthcare" && "Healthcare organizations face elevated cyber risks due to valuable PHI data that commands high prices on dark web markets.",
29909
- config.clientIndustry === "Financial Services" && "Financial institutions are prime targets due to direct access to funds and sensitive financial data.",
29910
- config.clientIndustry === "Manufacturing" && "Manufacturing companies face operational technology risks that can halt production and supply chains.",
29870
+ clientData.industry === "Healthcare" && "Healthcare organizations face elevated cyber risks due to valuable PHI data that commands high prices on dark web markets.",
29871
+ clientData.industry === "Financial Services" && "Financial institutions are prime targets due to direct access to funds and sensitive financial data.",
29872
+ clientData.industry === "Manufacturing" && "Manufacturing companies face operational technology risks that can halt production and supply chains.",
29911
29873
  !["Healthcare", "Financial Services", "Manufacturing"].includes(
29912
- config.clientIndustry
29874
+ clientData.industry
29913
29875
  ) && "Your industry faces specific cyber risks that require tailored protection strategies."
29914
29876
  ] })
29915
29877
  ] }),
29916
29878
  /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
29917
29879
  /* @__PURE__ */ jsx("h4", { className: "text-lg font-semibold text-slate-900", children: "Key Risk Factors" }),
29918
- /* @__PURE__ */ jsx("div", { className: "space-y-1", children: getIndustryThreats(config.clientIndustry).map(
29919
- (threat, index2) => /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
29920
- /* @__PURE__ */ jsx(AlertTriangle, { className: "w-4 h-4 text-red-500" }),
29921
- /* @__PURE__ */ jsx("span", { className: "text-sm", children: threat })
29922
- ] }, index2)
29923
- ) })
29880
+ /* @__PURE__ */ jsx("div", { className: "space-y-1", children: getIndustryThreats(clientData.industry).map((threat, index2) => /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
29881
+ /* @__PURE__ */ jsx(AlertTriangle, { className: "w-4 h-4 text-red-500" }),
29882
+ /* @__PURE__ */ jsx("span", { className: "text-sm", children: threat })
29883
+ ] }, index2)) })
29924
29884
  ] })
29925
29885
  ] })
29926
29886
  ] }),
@@ -29929,27 +29889,30 @@ const FinancialImpact = ({ config, unifiedData }) => {
29929
29889
  /* @__PURE__ */ jsx("h2", { className: "text-2xl font-bold text-slate-900 mb-2", children: "Detailed Financial Breakdown" }),
29930
29890
  /* @__PURE__ */ jsx("p", { className: "text-slate-600", children: "Understanding the components of the total potential cost" })
29931
29891
  ] }),
29932
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-5 gap-8", children: [
29933
- /* @__PURE__ */ jsx("div", { className: "lg:col-span-2 space-y-4", children: /* @__PURE__ */ jsx("div", { id: "impact-chart", className: "chart-container", children: /* @__PURE__ */ jsx(
29892
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-6 gap-8", children: [
29893
+ /* @__PURE__ */ jsx("div", { className: "lg:col-span-3 space-y-4", children: /* @__PURE__ */ jsx("div", { id: "impact-chart", className: "chart-container", children: /* @__PURE__ */ jsx(
29934
29894
  UnifiedCostBreakdownChart,
29935
29895
  {
29936
- costBreakdown: dynamicCostBreakdown,
29896
+ hard_costs: dynamicCostBreakdown.hard_costs,
29897
+ business_downtime: dynamicCostBreakdown.business_downtime,
29898
+ regulatory_fines: dynamicCostBreakdown.regulatory_fines,
29899
+ reputation_damage: dynamicCostBreakdown.reputation_damage,
29937
29900
  totalCost: parseInt(
29938
- ((_c = config.totalEstimatedCost) == null ? void 0 : _c.replace(/,/g, "")) || "0"
29939
- ) || unifiedData.totalCost
29901
+ ((_a = clientData.totalEstimatedCost) == null ? void 0 : _a.replace(/,/g, "")) || "0"
29902
+ ) || clientData.totalCost
29940
29903
  }
29941
29904
  ) }) }),
29942
29905
  /* @__PURE__ */ jsxs("div", { className: "lg:col-span-3 space-y-4", children: [
29943
29906
  /* @__PURE__ */ jsx("h4", { className: "font-semibold text-slate-900", children: "Cost Categories" }),
29944
29907
  /* @__PURE__ */ jsx("div", { className: "space-y-2", children: getIndustrySpecificCosts(
29945
- config.clientIndustry,
29946
- dynamicCostBreakdown
29908
+ clientData.industry,
29909
+ simulationData
29947
29910
  ).map((item, index2) => {
29948
29911
  const costValues = [
29949
- dynamicCostBreakdown.hard_costs,
29950
- dynamicCostBreakdown.business_downtime,
29951
- dynamicCostBreakdown.regulatory_fines,
29952
- dynamicCostBreakdown.reputation_damage
29912
+ dynamicCostBreakdown.hard_costs || 0,
29913
+ dynamicCostBreakdown.business_downtime || 0,
29914
+ dynamicCostBreakdown.regulatory_fines || 0,
29915
+ dynamicCostBreakdown.reputation_damage || 0
29953
29916
  ];
29954
29917
  const dynamicCost = costValues[index2] || item.cost;
29955
29918
  return /* @__PURE__ */ jsxs(
@@ -29986,20 +29949,20 @@ const FinancialImpact = ({ config, unifiedData }) => {
29986
29949
  /* @__PURE__ */ jsxs("div", { className: "space-y-3 text-sm", children: [
29987
29950
  /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
29988
29951
  /* @__PURE__ */ jsx("span", { className: "text-slate-600", children: "Breach Type:" }),
29989
- /* @__PURE__ */ jsx("span", { className: "font-medium text-right", children: config.breachType })
29952
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-right capitalize", children: simulationData.breach_type ? simulationData.breach_type : "" })
29990
29953
  ] }),
29991
29954
  /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
29992
29955
  /* @__PURE__ */ jsx("span", { className: "text-slate-600", children: "Industry:" }),
29993
- /* @__PURE__ */ jsx("span", { className: "font-medium text-right", children: config.clientIndustry })
29956
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-right", children: clientData.industry })
29994
29957
  ] }),
29995
29958
  /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
29996
29959
  /* @__PURE__ */ jsx("span", { className: "text-slate-600", children: "Records at Risk:" }),
29997
- /* @__PURE__ */ jsx("span", { className: "font-medium text-right", children: config.recordsAtRisk ? parseInt(config.recordsAtRisk).toLocaleString() : unifiedData.recordCount.toLocaleString() })
29960
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-right", children: simulationData.record_count ? parseInt(simulationData.record_count).toLocaleString() : "" })
29998
29961
  ] }),
29999
29962
  /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
30000
29963
  /* @__PURE__ */ jsx("span", { className: "text-slate-600", children: "% Breached:" }),
30001
29964
  /* @__PURE__ */ jsxs("span", { className: "font-medium text-right", children: [
30002
- config.percentageBreached,
29965
+ simulationData.percentage_breached,
30003
29966
  "%"
30004
29967
  ] })
30005
29968
  ] })
@@ -30010,62 +29973,29 @@ const FinancialImpact = ({ config, unifiedData }) => {
30010
29973
  /* @__PURE__ */ jsxs("div", { className: "space-y-3 text-sm", children: [
30011
29974
  /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
30012
29975
  /* @__PURE__ */ jsx("span", { className: "text-slate-600", children: "Records Affected:" }),
30013
- /* @__PURE__ */ jsx("span", { className: "font-medium text-right", children: config.recordsAffected ? parseInt(config.recordsAffected).toLocaleString() : Math.round(
30014
- unifiedData.recordCount * (parseInt(config.percentageBreached) / 100)
30015
- ).toLocaleString() })
29976
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-right", children: parseInt(simulationData.record_count) * (simulationData.percentage_breached / 100) || "" })
30016
29977
  ] }),
30017
29978
  /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
30018
29979
  /* @__PURE__ */ jsx("span", { className: "text-slate-600", children: "Downtime Duration:" }),
30019
29980
  /* @__PURE__ */ jsxs("span", { className: "font-medium text-right", children: [
30020
- config.downtimeHours || unifiedData.hoursDown,
29981
+ simulationData.hours_down || "",
30021
29982
  "h"
30022
29983
  ] })
30023
29984
  ] }),
30024
29985
  /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
30025
29986
  /* @__PURE__ */ jsx("span", { className: "text-slate-600", children: "Cost per Hour:" }),
30026
- /* @__PURE__ */ jsx("span", { className: "font-medium text-right", children: formatCurrency(
30027
- parseInt(config.downtimeCostPerHour) || unifiedData.hourlyDowntimeCost
30028
- ) })
29987
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-right", children: formatCurrency(parseInt(simulationData.cost_per_hour)) })
30029
29988
  ] }),
30030
29989
  /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
30031
29990
  /* @__PURE__ */ jsx("span", { className: "text-slate-600", children: "Total Downtime Cost:" }),
30032
- /* @__PURE__ */ jsx("span", { className: "font-medium text-right", children: config.totalDowntimeCost ? `$${config.totalDowntimeCost}` : formatCurrency(unifiedData.businessDowntime) })
29991
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-right", children: formatCurrency(
29992
+ parseInt(simulationData.hours_down) * parseInt(simulationData.cost_per_hour)
29993
+ ) })
30033
29994
  ] })
30034
29995
  ] })
30035
29996
  ] })
30036
29997
  ] })
30037
29998
  ] }),
30038
- /* @__PURE__ */ jsxs("section", { className: "report-page space-y-4 border-t border-slate-200 pt-8", children: [
30039
- /* @__PURE__ */ jsx("h2", { className: "text-2xl font-bold text-slate-900", children: "Recommendations to Reduce Risk" }),
30040
- /* @__PURE__ */ jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs("table", { className: "w-full caption-bottom text-sm", children: [
30041
- /* @__PURE__ */ jsx("thead", { className: "border-b", children: /* @__PURE__ */ jsxs("tr", { className: "border-b transition-colors hover:bg-muted/50", children: [
30042
- /* @__PURE__ */ jsx("th", { className: "h-10 px-2 text-left align-middle font-medium text-muted-foreground w-12", children: "#" }),
30043
- /* @__PURE__ */ jsx("th", { className: "h-10 px-2 text-left align-middle font-medium text-muted-foreground w-1/4", children: "Title" }),
30044
- /* @__PURE__ */ jsx("th", { className: "h-10 px-2 text-left align-middle font-medium text-muted-foreground w-1/3", children: "Problem" }),
30045
- /* @__PURE__ */ jsx("th", { className: "h-10 px-2 text-left align-middle font-medium text-muted-foreground w-1/3", children: "Solution" })
30046
- ] }) }),
30047
- /* @__PURE__ */ jsx("tbody", { children: config.recommendations.map((rec, index2) => /* @__PURE__ */ jsxs(
30048
- "tr",
30049
- {
30050
- className: "border-b transition-colors hover:bg-muted/50",
30051
- children: [
30052
- /* @__PURE__ */ jsx("td", { className: "p-2 align-top", children: /* @__PURE__ */ jsx("div", { className: "w-6 h-6 bg-blue-600 text-white rounded-full flex items-center justify-center text-xs font-bold", children: index2 + 1 }) }),
30053
- /* @__PURE__ */ jsx("td", { className: "p-2 align-top", children: /* @__PURE__ */ jsx("h4", { className: "text-sm font-semibold text-slate-900 leading-tight", children: rec.title }) }),
30054
- /* @__PURE__ */ jsx("td", { className: "p-2 align-top", children: /* @__PURE__ */ jsx("p", { className: "text-xs text-slate-700 leading-tight", children: rec.problem }) }),
30055
- /* @__PURE__ */ jsxs("td", { className: "p-2 align-top", children: [
30056
- /* @__PURE__ */ jsx("p", { className: "text-xs text-slate-700 leading-tight", children: rec.solution }),
30057
- rec.analogy && /* @__PURE__ */ jsxs("p", { className: "text-xs text-slate-600 italic mt-1 leading-tight", children: [
30058
- /* @__PURE__ */ jsx("span", { className: "font-medium", children: "Think of it this way:" }),
30059
- " ",
30060
- rec.analogy
30061
- ] })
30062
- ] })
30063
- ]
30064
- },
30065
- rec.id
30066
- )) })
30067
- ] }) })
30068
- ] }),
30069
29999
  /* @__PURE__ */ jsxs("section", { className: "report-page space-y-6 border-t border-slate-200 pt-8", children: [
30070
30000
  /* @__PURE__ */ jsxs("div", { children: [
30071
30001
  /* @__PURE__ */ jsx("h2", { className: "text-2xl font-bold text-slate-900 mb-2", children: "Proposed Next Steps" }),
@@ -30085,8 +30015,8 @@ const FinancialImpact = ({ config, unifiedData }) => {
30085
30015
  /* @__PURE__ */ jsx("h4", { className: "font-semibold text-slate-900 mb-2", children: "Schedule Your Strategy Session" }),
30086
30016
  /* @__PURE__ */ jsx("p", { className: "text-slate-600 mb-4", children: "Let's discuss these findings and develop a customized cybersecurity roadmap for your organization." }),
30087
30017
  /* @__PURE__ */ jsxs("p", { className: "text-slate-600", children: [
30088
- "Contact us at:",
30089
- /* @__PURE__ */ jsx("span", { className: "font-medium text-slate-900" })
30018
+ "Contact us at: ",
30019
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-slate-900", children: (user == null ? void 0 : user.email) || /* @__PURE__ */ jsx("span", { style: { color: "red", fontWeight: "bold" }, children: "NEEDS MSP EMAIL ADDRESS" }) })
30090
30020
  ] })
30091
30021
  ] })
30092
30022
  ] }),
@@ -30156,19 +30086,7 @@ const FinancialImpact = ({ config, unifiedData }) => {
30156
30086
  ] })
30157
30087
  ] })
30158
30088
  ] })
30159
- ] }),
30160
- /* @__PURE__ */ jsx("div", { className: "report-page space-y-6 border-t border-slate-200 pt-8", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-3", children: [
30161
- /* @__PURE__ */ jsx("div", { className: "w-8 h-8 bg-gray-600 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsx(FileText, { className: "w-5 h-5 text-white" }) }),
30162
- /* @__PURE__ */ jsxs("div", { children: [
30163
- /* @__PURE__ */ jsx("h2", { className: "text-2xl font-bold text-slate-900", children: "Important Disclaimer" }),
30164
- /* @__PURE__ */ jsx("p", { className: "text-slate-600", children: "Legal limitations and professional guidance" })
30165
- ] })
30166
- ] }) }),
30167
- /* @__PURE__ */ jsx("div", { className: "border-t border-slate-200 pt-4 text-center text-xs text-slate-500", children: /* @__PURE__ */ jsxs("p", { children: [
30168
- "Powered by ThreatCaptain • Generated on",
30169
- " ",
30170
- (/* @__PURE__ */ new Date()).toLocaleDateString()
30171
- ] }) })
30089
+ ] })
30172
30090
  ] });
30173
30091
  };
30174
30092
  const ASSESSMENT_CATEGORIES = {
@@ -30422,10 +30340,11 @@ const InsuranceHealthGauge = ({
30422
30340
  ) })
30423
30341
  ] });
30424
30342
  };
30425
- const InsuranceHealthScore = ({ config }) => {
30343
+ const InsuranceHealthScore = ({ reportData }) => {
30426
30344
  var _a;
30427
- const hasAssessmentData = config.assessmentData && config.assessmentData.responses && Object.keys(config.assessmentData.responses).length > 0;
30428
- const score = hasAssessmentData ? config.insuranceHealthScore || 650 : null;
30345
+ const { clientData, insuranceHealthData } = reportData;
30346
+ const hasAssessmentData = insuranceHealthData.responses && Object.keys(insuranceHealthData.responses).length > 0;
30347
+ const score = hasAssessmentData ? insuranceHealthData.score || 650 : null;
30429
30348
  const scoreCategory = score ? getScoreCategory(score) : null;
30430
30349
  const scoreCategoryData = typeof scoreCategory === "string" ? {
30431
30350
  category: scoreCategory,
@@ -30433,10 +30352,17 @@ const InsuranceHealthScore = ({ config }) => {
30433
30352
  bgColor: "bg-blue-600"
30434
30353
  } : scoreCategory;
30435
30354
  return /* @__PURE__ */ jsxs(Fragment, { children: [
30436
- /* @__PURE__ */ jsx("section", { id: "insurance-health-score", className: "report-page text-center space-y-6 pb-8 border-b border-slate-200", children: /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
30437
- /* @__PURE__ */ jsx("h1", { className: "text-4xl font-bold text-slate-900", children: "Cyber Insurance Health Score Report" }),
30438
- /* @__PURE__ */ jsx("p", { className: "text-xl text-slate-600", children: "Understanding How Insurance Companies View Your Organization" })
30439
- ] }) }),
30355
+ /* @__PURE__ */ jsx(
30356
+ "section",
30357
+ {
30358
+ id: "insurance-health-score",
30359
+ className: "report-page text-center space-y-6 pb-8 border-b border-slate-200",
30360
+ children: /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
30361
+ /* @__PURE__ */ jsx("h1", { className: "text-4xl font-bold text-slate-900", children: "Cyber Insurance Health Score Report" }),
30362
+ /* @__PURE__ */ jsx("p", { className: "text-xl text-slate-600", children: "Understanding How Insurance Companies View Your Organization" })
30363
+ ] })
30364
+ }
30365
+ ),
30440
30366
  /* @__PURE__ */ jsxs("section", { className: "report-page space-y-6", children: [
30441
30367
  /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-3", children: [
30442
30368
  /* @__PURE__ */ jsx(FileText, { className: "w-6 h-6 text-blue-600" }),
@@ -30445,7 +30371,7 @@ const InsuranceHealthScore = ({ config }) => {
30445
30371
  /* @__PURE__ */ jsx("p", { className: "text-slate-600", children: "Understanding your organization's insurance readiness" })
30446
30372
  ] })
30447
30373
  ] }),
30448
- /* @__PURE__ */ jsx("div", { className: "bg-slate-50 rounded-lg p-6 space-y-4", children: /* @__PURE__ */ jsx("p", { className: "text-slate-700 leading-relaxed", children: config.executiveSummary || `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.` }) }),
30374
+ /* @__PURE__ */ jsx("div", { className: "bg-slate-50 rounded-lg p-6 space-y-4", children: /* @__PURE__ */ jsx("p", { className: "text-slate-700 leading-relaxed", children: clientData.executiveSummary || `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.` }) }),
30449
30375
  /* @__PURE__ */ jsxs(
30450
30376
  "div",
30451
30377
  {
@@ -30503,8 +30429,8 @@ const InsuranceHealthScore = ({ config }) => {
30503
30429
  /* @__PURE__ */ jsx("h2", { className: "text-2xl font-bold text-slate-900 mb-2", children: "Your Insurance Health Score Results" }),
30504
30430
  /* @__PURE__ */ jsx("p", { className: "text-slate-600", children: "Assessment results and category breakdown" })
30505
30431
  ] }),
30506
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-5 gap-8", children: [
30507
- /* @__PURE__ */ jsxs("div", { className: "lg:col-span-3 flex flex-col items-center space-y-4", children: [
30432
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-6 gap-8", children: [
30433
+ /* @__PURE__ */ jsxs("div", { className: "md:col-span-3 flex flex-col items-center space-y-4", children: [
30508
30434
  hasAssessmentData ? /* @__PURE__ */ jsx(InsuranceHealthGauge, { score, size: 320 }) : /* @__PURE__ */ jsx(
30509
30435
  "div",
30510
30436
  {
@@ -30519,12 +30445,12 @@ const InsuranceHealthScore = ({ config }) => {
30519
30445
  ),
30520
30446
  /* @__PURE__ */ jsx("div", { className: "text-center" })
30521
30447
  ] }),
30522
- /* @__PURE__ */ jsxs("div", { className: "lg:col-span-2 space-y-4", children: [
30448
+ /* @__PURE__ */ jsxs("div", { className: "md:col-span-3 space-y-4", children: [
30523
30449
  /* @__PURE__ */ jsx("h4", { className: "font-semibold text-slate-900", children: "Security Category Scores" }),
30524
30450
  /* @__PURE__ */ jsx("div", { className: "space-y-3", children: (() => {
30525
- if (config.assessmentData && config.assessmentData.responses) {
30451
+ if (insuranceHealthData.responses) {
30526
30452
  const domains = getSecurityDomains(
30527
- config.assessmentData.responses
30453
+ insuranceHealthData.responses
30528
30454
  );
30529
30455
  return domains.map((domain, index2) => {
30530
30456
  let statusPill = "";
@@ -30570,7 +30496,7 @@ const InsuranceHealthScore = ({ config }) => {
30570
30496
  /* @__PURE__ */ jsx("h2", { className: "text-2xl font-bold text-slate-900 mb-2", children: "Recommendations for Improvement" }),
30571
30497
  /* @__PURE__ */ jsx("p", { className: "text-slate-600", children: "Priority actions to enhance your insurance health score" })
30572
30498
  ] }),
30573
- /* @__PURE__ */ jsx("div", { className: "space-y-6", children: ((_a = config.recommendations) == null ? void 0 : _a.map((rec, index2) => /* @__PURE__ */ jsx(
30499
+ /* @__PURE__ */ jsx("div", { className: "space-y-6", children: ((_a = clientData.recommendations) == null ? void 0 : _a.map((rec, index2) => /* @__PURE__ */ jsx(
30574
30500
  "div",
30575
30501
  {
30576
30502
  className: "bg-white border border-slate-200 rounded-lg p-6",
@@ -30679,22 +30605,18 @@ const InsuranceHealthScore = ({ config }) => {
30679
30605
  /* @__PURE__ */ jsxs("ul", { className: "text-sm text-slate-700 space-y-1", children: [
30680
30606
  /* @__PURE__ */ jsxs("li", { children: [
30681
30607
  /* @__PURE__ */ jsx("span", { className: "font-medium text-green-600", children: "750-850:" }),
30682
- " ",
30683
30608
  "Excellent - Premium discounts available"
30684
30609
  ] }),
30685
30610
  /* @__PURE__ */ jsxs("li", { children: [
30686
30611
  /* @__PURE__ */ jsx("span", { className: "font-medium text-blue-600", children: "650-749:" }),
30687
- " ",
30688
30612
  "Good - Standard coverage available"
30689
30613
  ] }),
30690
30614
  /* @__PURE__ */ jsxs("li", { children: [
30691
30615
  /* @__PURE__ */ jsx("span", { className: "font-medium text-yellow-600", children: "550-649:" }),
30692
- " ",
30693
30616
  "Fair - Limited coverage options"
30694
30617
  ] }),
30695
30618
  /* @__PURE__ */ jsxs("li", { children: [
30696
30619
  /* @__PURE__ */ jsx("span", { className: "font-medium text-red-600", children: "Below 550:" }),
30697
- " ",
30698
30620
  "Poor - Coverage may be denied"
30699
30621
  ] })
30700
30622
  ] })
@@ -30785,35 +30707,32 @@ const InsuranceHealthScore = ({ config }) => {
30785
30707
  ] })
30786
30708
  ] });
30787
30709
  };
30788
- const ReportMatrix = {
30789
- "financial-impact": FinancialImpact,
30790
- "breach-likelihood": BreachLikelihood,
30791
- "insurance-health-score": InsuranceHealthScore
30792
- };
30793
- const ReportBuilder = ({ clientId, config }) => {
30710
+ const ReportBuilder = ({
30711
+ clientData,
30712
+ assessmentData,
30713
+ simulationData,
30714
+ mspCompanyName,
30715
+ user
30716
+ }) => {
30794
30717
  const [searchParams] = useSearchParams();
30795
30718
  const reportTemplate = searchParams.get("template");
30796
30719
  const templateArray = (reportTemplate == null ? void 0 : reportTemplate.split(",").map((item) => item.trim())) || [];
30797
- const unifiedData = transformToUnifiedData(
30798
- {
30799
- companyName: config.mspCompanyName || "Your MSP Company",
30800
- clientName: config.clientCompanyName || "Client Company",
30801
- reportTitle: "Cyber Financial Impact Analysis",
30802
- executiveSummary: config.executiveSummary || "This report provides a comprehensive analysis of the potential financial impact of cybersecurity threats on your organization.",
30803
- generatedDate: (/* @__PURE__ */ new Date()).toLocaleDateString()
30804
- },
30805
- null,
30806
- ""
30720
+ const showFinancialImpact = templateArray.includes("financial-impact");
30721
+ const showBreachLikelihood = templateArray.includes("breach-likelihood");
30722
+ const showInsuranceHealthScore = templateArray.includes(
30723
+ "insurance-health-score"
30807
30724
  );
30725
+ const securityAssessment = assessmentData.securityAssessments;
30726
+ const insuranceHealthData = assessmentData.insuranceAssessment;
30727
+ const financialSimulationData = simulationData;
30808
30728
  return /* @__PURE__ */ jsxs(Fragment, { children: [
30809
- !clientId && /* @__PURE__ */ jsx("div", { className: "max-w-4xl mx-auto bg-white p-8 flex items-center justify-center min-h-[600px]", children: /* @__PURE__ */ jsxs("div", { className: "text-center space-y-4", children: [
30729
+ !clientData.id && /* @__PURE__ */ jsx("div", { className: "max-w-4xl mx-auto bg-white p-8 flex items-center justify-center min-h-[600px]", children: /* @__PURE__ */ jsxs("div", { className: "text-center space-y-4", children: [
30810
30730
  /* @__PURE__ */ jsx("div", { className: "w-16 h-16 bg-slate-100 rounded-full flex items-center justify-center mx-auto", children: /* @__PURE__ */ jsx(FileText, { className: "w-8 h-8 text-slate-400" }) }),
30811
30731
  /* @__PURE__ */ jsx("h3", { className: "text-xl font-semibold text-slate-700", children: "Please Select a Client" }),
30812
30732
  /* @__PURE__ */ jsx("p", { className: "text-slate-500 max-w-md", children: "Choose a client from the dropdown above to generate and preview their cyber financial impact analysis report." })
30813
30733
  ] }) }),
30814
30734
  /* @__PURE__ */ jsx("nav", { children: /* @__PURE__ */ jsx("ul", { className: "report-toc max-w-4xl mx-auto bg-white p-4 flex space-x-4 overflow-x-auto", children: !!(templateArray.length > 1) && templateArray.map((item) => {
30815
- const Component = ReportMatrix[item];
30816
- return Component ? /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
30735
+ return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
30817
30736
  "a",
30818
30737
  {
30819
30738
  href: `#${item}`,
@@ -30822,7 +30741,7 @@ const ReportBuilder = ({ clientId, config }) => {
30822
30741
  (word) => word.charAt(0).toUpperCase() + word.slice(1)
30823
30742
  ).join(" ")
30824
30743
  }
30825
- ) }, item) : null;
30744
+ ) }, item);
30826
30745
  }) }) }),
30827
30746
  /* @__PURE__ */ jsxs(
30828
30747
  "article",
@@ -30830,10 +30749,10 @@ const ReportBuilder = ({ clientId, config }) => {
30830
30749
  id: "print-report",
30831
30750
  className: "report-wrapper max-w-4xl mx-auto bg-white p-8 space-y-8",
30832
30751
  children: [
30833
- /* @__PURE__ */ jsx("div", { className: "mx-auto w-20 h-20 bg-slate-200 rounded-lg flex items-center justify-center", children: config.mspLogoBase64 ? /* @__PURE__ */ jsx(
30752
+ /* @__PURE__ */ jsx("div", { className: "mx-auto w-20 h-20 bg-slate-200 rounded-lg flex items-center justify-center", children: clientData.logo ? /* @__PURE__ */ jsx(
30834
30753
  "img",
30835
30754
  {
30836
- src: config.mspLogoBase64,
30755
+ src: clientData.logo,
30837
30756
  alt: "MSP Logo",
30838
30757
  className: "w-full h-full object-contain rounded-lg"
30839
30758
  }
@@ -30841,32 +30760,51 @@ const ReportBuilder = ({ clientId, config }) => {
30841
30760
  /* @__PURE__ */ jsxs("div", { className: "max-w-md mx-auto bg-slate-50 rounded-lg p-6 space-y-3", children: [
30842
30761
  /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
30843
30762
  /* @__PURE__ */ jsx("span", { className: "font-medium text-slate-700", children: "Prepared For:" }),
30844
- /* @__PURE__ */ jsx("span", { className: "text-slate-900", children: config.clientCompanyName || "Client Company" })
30763
+ /* @__PURE__ */ jsx("span", { className: "text-slate-900", children: clientData.company_name || "Client Company" })
30845
30764
  ] }),
30846
30765
  /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
30847
30766
  /* @__PURE__ */ jsx("span", { className: "font-medium text-slate-700", children: "Industry Sector:" }),
30848
- /* @__PURE__ */ jsx("span", { className: "text-slate-900", children: config.clientIndustry || "Industry" })
30767
+ /* @__PURE__ */ jsx("span", { className: "text-slate-900", children: clientData.industry || "Industry" })
30849
30768
  ] }),
30850
30769
  /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
30851
30770
  /* @__PURE__ */ jsx("span", { className: "font-medium text-slate-700", children: "Prepared By:" }),
30852
- /* @__PURE__ */ jsx("span", { className: "text-slate-900", children: config.mspCompanyName || "MSP Company" })
30771
+ /* @__PURE__ */ jsx("span", { className: "text-slate-900", children: mspCompanyName || /* @__PURE__ */ jsx("span", { style: { color: "red", fontWeight: "bold" }, children: "NEEDS ACTUAL MSP NAME" }) })
30853
30772
  ] }),
30854
30773
  /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
30855
30774
  /* @__PURE__ */ jsx("span", { className: "font-medium text-slate-700", children: "Assessment Date:" }),
30856
30775
  /* @__PURE__ */ jsx("span", { className: "text-slate-900", children: (/* @__PURE__ */ new Date()).toLocaleDateString() })
30857
30776
  ] })
30858
30777
  ] }),
30859
- templateArray.map((item) => {
30860
- const Component = ReportMatrix[item];
30861
- return Component ? /* @__PURE__ */ jsx(Component, { unifiedData, config }, item) : null;
30862
- }),
30778
+ showFinancialImpact && /* @__PURE__ */ jsx(
30779
+ FinancialImpact,
30780
+ {
30781
+ reportData: {
30782
+ clientData,
30783
+ simulationData: financialSimulationData,
30784
+ user
30785
+ }
30786
+ }
30787
+ ),
30788
+ showBreachLikelihood && /* @__PURE__ */ jsx(
30789
+ BreachLikelihood,
30790
+ {
30791
+ reportData: { clientData, securityAssessment, user }
30792
+ }
30793
+ ),
30794
+ showInsuranceHealthScore && /* @__PURE__ */ jsx(
30795
+ InsuranceHealthScore,
30796
+ {
30797
+ reportData: { clientData, insuranceHealthData }
30798
+ }
30799
+ ),
30863
30800
  /* @__PURE__ */ jsxs("footer", { className: "report-page text-center pt-8 border-t border-slate-200", children: [
30864
30801
  /* @__PURE__ */ jsx("h4", { children: "Professional Recommendation" }),
30865
30802
  /* @__PURE__ */ jsx("p", { className: "text-sm text-slate-500", children: "This assessment combines financial impact modeling, insurance readiness evaluation, and breach likelihood analysis to provide a complete view of your organization's cybersecurity risk profile." }),
30866
30803
  /* @__PURE__ */ jsxs("p", { className: "text-xs text-slate-400 mt-2", children: [
30867
- "Generated by ",
30868
- config.mspCompanyName,
30869
- " on ",
30804
+ "Generated by",
30805
+ " ",
30806
+ mspCompanyName ? mspCompanyName : /* @__PURE__ */ jsx("span", { style: { color: "red", fontWeight: "bold" }, children: "NEEDS ACTUAL MSP NAME" }),
30807
+ " on ",
30870
30808
  (/* @__PURE__ */ new Date()).toLocaleDateString()
30871
30809
  ] })
30872
30810
  ] })