""" Accident Reporting Layer Generates production-grade HTML and JSON reports, incorporating visualizations. """ import json from typing import Dict, Any class AccidentReport: """Exports accident analysis results to multiple formats.""" def __init__(self, metrics: Dict[str, Any], insights: Dict[str, Any]): self.metrics = metrics self.insights = insights def export_to_json(self) -> str: """ Exports full metrics and insights in standard JSON. Returns: JSON formatted string. """ payload = { "metrics": self.metrics, "insights": self.insights } return json.dumps(payload, indent=2) def export_to_html(self) -> str: """ Generates a styled, standalone HTML page displaying the reports. Returns: HTML markup string. """ rec_list = "".join(f"